@10yun/cv-pc-ui 0.3.48 → 0.3.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cv-ui.cjs +5 -5
- package/lib/cv-ui.css +1 -1
- package/lib/cv-ui.js +144 -144
- package/package.json +1 -1
package/lib/cv-ui.cjs
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<img src=${i.url} style="width: ${this.trueWidth}px; height: ${this.trueHeight}px; transform:
|
|
5
5
|
scale(${a})translate3d(${l}px, ${n}px, 0px)rotateZ(${90*this.rotate}deg)">
|
|
6
6
|
</div>
|
|
7
|
-
</div>`,this.$emit("real-time",i)},reload(){let t=new Image;t.onload=()=>{this.w=parseFloat(window.getComputedStyle(this.$refs.cropper).width),this.h=parseFloat(window.getComputedStyle(this.$refs.cropper).height),this.trueWidth=t.width,this.trueHeight=t.height,this.original?this.scale=1:this.scale=this.checkedMode(),this.$nextTick(()=>{this.x=-(this.trueWidth-this.trueWidth*this.scale)/2+(this.w-this.trueWidth*this.scale)/2,this.y=-(this.trueHeight-this.trueHeight*this.scale)/2+(this.h-this.trueHeight*this.scale)/2,this.loading=!1,this.autoCrop&&this.goAutoCrop(),this.$emit("img-load","success"),setTimeout(()=>{this.showPreview()},20)})},t.onerror=()=>{this.$emit("img-load","error")},t.src=this.imgs},checkedMode(){let t=1,o=this.trueWidth,a=this.trueHeight;const i=this.mode.split(" ");switch(i[0]){case"contain":this.trueWidth>this.w&&(t=this.w/this.trueWidth),this.trueHeight*t>this.h&&(t=this.h/this.trueHeight);break;case"cover":o=this.w,t=o/this.trueWidth,a*=t,a<this.h&&(a=this.h,t=a/this.trueHeight);break;default:try{let l=i[0];if(l.search("px")!==-1){l=l.replace("px",""),o=parseFloat(l);const n=o/this.trueWidth;let r=1,c=i[1];c.search("px")!==-1&&(c=c.replace("px",""),a=parseFloat(c),r=a/this.trueHeight),t=Math.min(n,r)}if(l.search("%")!==-1&&(l=l.replace("%",""),o=parseFloat(l)/100*this.w,t=o/this.trueWidth),i.length===2&&l==="auto"){let n=i[1];n.search("px")!==-1&&(n=n.replace("px",""),a=parseFloat(n),t=a/this.trueHeight),n.search("%")!==-1&&(n=n.replace("%",""),a=parseFloat(n)/100*this.h,t=a/this.trueHeight)}}catch{t=1}}return t},goAutoCrop(t,o){if(this.imgs===""||this.imgs===null)return;this.clearCrop(),this.cropping=!0;let a=this.w,i=this.h;if(this.centerBox){const r=Math.abs(this.rotate)%2>0;let c=(r?this.trueHeight:this.trueWidth)*this.scale,h=(r?this.trueWidth:this.trueHeight)*this.scale;a=c<a?c:a,i=h<i?h:i}var l=t||parseFloat(this.autoCropWidth),n=o||parseFloat(this.autoCropHeight);(l===0||n===0)&&(l=.8*a,n=.8*i),l=l>a?a:l,n=n>i?i:n,this.fixed&&(n=l/this.fixedNumber[0]*this.fixedNumber[1]),n>this.h&&(l=(n=this.h)/this.fixedNumber[1]*this.fixedNumber[0]),this.changeCrop(l,n)},changeCrop(t,o){if(this.centerBox){let a=this.getImgAxis();t>a.x2-a.x1&&(o=(t=a.x2-a.x1)/this.fixedNumber[0]*this.fixedNumber[1]),o>a.y2-a.y1&&(t=(o=a.y2-a.y1)/this.fixedNumber[1]*this.fixedNumber[0])}this.cropW=t,this.cropH=o,this.checkCropLimitSize(),this.$nextTick(()=>{this.cropOffsertX=(this.w-this.cropW)/2,this.cropOffsertY=(this.h-this.cropH)/2,this.centerBox&&this.moveCrop(null,!0)})},refresh(){this.img,this.imgs="",this.scale=1,this.crop=!1,this.rotate=0,this.w=0,this.h=0,this.trueWidth=0,this.trueHeight=0,this.imgIsQqualCrop=!1,this.clearCrop(),this.$nextTick(()=>{this.checkedImg()})},rotateLeft(){this.rotate=this.rotate<=-3?0:this.rotate-1},rotateRight(){this.rotate=this.rotate>=3?0:this.rotate+1},rotateClear(){this.rotate=0},checkoutImgAxis(t,o,a){t=t||this.x,o=o||this.y,a=a||this.scale;let i=!0;if(this.centerBox){let l=this.getImgAxis(t,o,a),n=this.getCropAxis();l.x1>=n.x1&&(i=!1),l.x2<=n.x2&&(i=!1),l.y1>=n.y1&&(i=!1),l.y2<=n.y2&&(i=!1),i||this.changeImgScale(l,n,a)}return i},changeImgScale(t,o,a){let i=this.trueWidth,l=this.trueHeight,n=i*a,r=l*a;if(n>=this.cropW&&r>=this.cropH)this.scale=a;else{const c=this.cropW/i,h=this.cropH/l,d=this.cropH<=l*c?c:h;this.scale=d,n=i*d,r=l*d}this.imgIsQqualCrop||(t.x1>=o.x1&&(this.isRotateRightOrLeft?this.x=o.x1-(i-n)/2-(n-r)/2:this.x=o.x1-(i-n)/2),t.x2<=o.x2&&(this.isRotateRightOrLeft?this.x=o.x1-(i-n)/2-(n-r)/2-r+this.cropW:this.x=o.x2-(i-n)/2-n),t.y1>=o.y1&&(this.isRotateRightOrLeft?this.y=o.y1-(l-r)/2-(r-n)/2:this.y=o.y1-(l-r)/2),t.y2<=o.y2&&(this.isRotateRightOrLeft?this.y=o.y2-(l-r)/2-(r-n)/2-n:this.y=o.y2-(l-r)/2-r)),(n<this.cropW||r<this.cropH)&&(this.imgIsQqualCrop=!0)}},mounted(){this.support="onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll";let t=this;var o=navigator.userAgent;this.isIOS=!!o.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(a,i,l){for(var n=atob(this.toDataURL(i,l).split(",")[1]),r=n.length,c=new Uint8Array(r),h=0;h<r;h++)c[h]=n.charCodeAt(h);a(new Blob([c],{type:t.type||"image/png"}))}}),this.showPreview(),this.checkedImg()},unmounted(){window.removeEventListener("mousemove",this.moveCrop),window.removeEventListener("mouseup",this.leaveCrop),window.removeEventListener("touchmove",this.moveCrop),window.removeEventListener("touchend",this.leaveCrop),this.cancelScale()}}),mi={key:0,class:"cropper-box"},ui=["src"],gi={class:"cropper-view-box"},fi=["src"],Ci={key:1},vi={props:{loading:{type:[Boolean],default:!1},modelValue:{type:[Boolean],default:!1},src:{type:[String],default:""},size:{type:[Number],default:120},title:{type:[String],default:"裁剪"}},components:{VueCropper:hi(pi,[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",{class:"vue-cropper",ref:"cropper",onMouseover:o[28]||(o[28]=(...r)=>t.scaleImg&&t.scaleImg(...r)),onMouseout:o[29]||(o[29]=(...r)=>t.cancelScale&&t.cancelScale(...r))},[t.imgs?(e.openBlock(),e.createElementBlock("div",mi,[e.withDirectives(e.createElementVNode("div",{class:"cropper-box-canvas",style:e.normalizeStyle({width:t.trueWidth+"px",height:t.trueHeight+"px",transform:"scale("+t.scale+","+t.scale+") translate3d("+t.x/t.scale+"px,"+t.y/t.scale+"px,0)rotateZ("+90*t.rotate+"deg)"})},[e.createElementVNode("img",{src:t.imgs,alt:"cropper-img",ref:"cropperImg"},null,8,ui)],4),[[e.vShow,!t.loading]])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["cropper-drag-box",{"cropper-move":t.move&&!t.crop,"cropper-crop":t.crop,"cropper-modal":t.cropping}]),onMousedown:o[0]||(o[0]=(...r)=>t.startMove&&t.startMove(...r)),onTouchstart:o[1]||(o[1]=(...r)=>t.startMove&&t.startMove(...r))},null,34),e.withDirectives(e.createElementVNode("div",{class:"cropper-crop-box",style:e.normalizeStyle({width:t.cropW+"px",height:t.cropH+"px",transform:"translate3d("+t.cropOffsertX+"px,"+t.cropOffsertY+"px,0)"})},[e.createElementVNode("span",gi,[e.createElementVNode("img",{style:e.normalizeStyle({width:t.trueWidth+"px",height:t.trueHeight+"px",transform:"scale("+t.scale+","+t.scale+") translate3d("+(t.x-t.cropOffsertX)/t.scale+"px,"+(t.y-t.cropOffsertY)/t.scale+"px,0)rotateZ("+90*t.rotate+"deg)"}),src:t.imgs,alt:"cropper-img"},null,12,fi)]),e.createElementVNode("span",{class:"cropper-face cropper-move",onMousedown:o[2]||(o[2]=(...r)=>t.cropMove&&t.cropMove(...r)),onTouchstart:o[3]||(o[3]=(...r)=>t.cropMove&&t.cropMove(...r))},null,32),t.info?(e.openBlock(),e.createElementBlock("span",{key:0,class:"crop-info",style:e.normalizeStyle({top:t.cropInfo.top})},e.toDisplayString(t.cropInfo.width)+" × "+e.toDisplayString(t.cropInfo.height),5)):e.createCommentVNode("",!0),t.fixedBox?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Ci,[e.createElementVNode("span",{class:"crop-line line-w",onMousedown:o[4]||(o[4]=r=>t.changeCropSize(r,!1,!0,0,1)),onTouchstart:o[5]||(o[5]=r=>t.changeCropSize(r,!1,!0,0,1))},null,32),e.createElementVNode("span",{class:"crop-line line-a",onMousedown:o[6]||(o[6]=r=>t.changeCropSize(r,!0,!1,1,0)),onTouchstart:o[7]||(o[7]=r=>t.changeCropSize(r,!0,!1,1,0))},null,32),e.createElementVNode("span",{class:"crop-line line-s",onMousedown:o[8]||(o[8]=r=>t.changeCropSize(r,!1,!0,0,2)),onTouchstart:o[9]||(o[9]=r=>t.changeCropSize(r,!1,!0,0,2))},null,32),e.createElementVNode("span",{class:"crop-line line-d",onMousedown:o[10]||(o[10]=r=>t.changeCropSize(r,!0,!1,2,0)),onTouchstart:o[11]||(o[11]=r=>t.changeCropSize(r,!0,!1,2,0))},null,32),e.createElementVNode("span",{class:"crop-point point1",onMousedown:o[12]||(o[12]=r=>t.changeCropSize(r,!0,!0,1,1)),onTouchstart:o[13]||(o[13]=r=>t.changeCropSize(r,!0,!0,1,1))},null,32),e.createElementVNode("span",{class:"crop-point point2",onMousedown:o[14]||(o[14]=r=>t.changeCropSize(r,!1,!0,0,1)),onTouchstart:o[15]||(o[15]=r=>t.changeCropSize(r,!1,!0,0,1))},null,32),e.createElementVNode("span",{class:"crop-point point3",onMousedown:o[16]||(o[16]=r=>t.changeCropSize(r,!0,!0,2,1)),onTouchstart:o[17]||(o[17]=r=>t.changeCropSize(r,!0,!0,2,1))},null,32),e.createElementVNode("span",{class:"crop-point point4",onMousedown:o[18]||(o[18]=r=>t.changeCropSize(r,!0,!1,1,0)),onTouchstart:o[19]||(o[19]=r=>t.changeCropSize(r,!0,!1,1,0))},null,32),e.createElementVNode("span",{class:"crop-point point5",onMousedown:o[20]||(o[20]=r=>t.changeCropSize(r,!0,!1,2,0)),onTouchstart:o[21]||(o[21]=r=>t.changeCropSize(r,!0,!1,2,0))},null,32),e.createElementVNode("span",{class:"crop-point point6",onMousedown:o[22]||(o[22]=r=>t.changeCropSize(r,!0,!0,1,2)),onTouchstart:o[23]||(o[23]=r=>t.changeCropSize(r,!0,!0,1,2))},null,32),e.createElementVNode("span",{class:"crop-point point7",onMousedown:o[24]||(o[24]=r=>t.changeCropSize(r,!1,!0,0,2)),onTouchstart:o[25]||(o[25]=r=>t.changeCropSize(r,!1,!0,0,2))},null,32),e.createElementVNode("span",{class:"crop-point point8",onMousedown:o[26]||(o[26]=r=>t.changeCropSize(r,!0,!0,2,2)),onTouchstart:o[27]||(o[27]=r=>t.changeCropSize(r,!0,!0,2,2))},null,32)]))],4),[[e.vShow,t.cropping]])],544)}],["__scopeId","data-v-a742df44"]])},emits:["update:modelValue","onSubmit","onClose"],data(){return{cropDialogVisible:!1,cropAutoCrop:!0,cropFixedBox:!0,cropOutputType:"png",cropPreviews:{},cropVisible:!1,cropBeforelImage:"",cropAfterImage:"",cropLocalWidth:this.size,cropLocalHeight:this.size}},watch:{modelValue(t){this.cropDialogVisible=t,this.cropInit()},src(t){this.cropInit()}},computed:{cropAttrs(){return{info:!0,autoCrop:this.cropAutoCrop,fixedBox:this.cropFixedBox,autoCropWidth:this.cropLocalWidth,autoCropHeight:this.cropLocalHeight,outputType:this.cropOutputType}}},mounted(){},methods:{cropInit(){this.cropBeforelImage=this.src||""},cropDialoClose(){this.cropBeforelImage="",this.cropPreviews="",this.cropVisible=!1,this.cropDialogVisible=!1,this.$emit("update:modelValue",!1),this.$emit("onClose",!1)},cropDialogOpened(){this.$nextTick(()=>{this.cropVisible=!0})},cropSubmit(){this._submit_blob()},_submit_blob(){this.$refs.cvAvatartCropper.getCropBlob(t=>{this.$emit("onSubmit",{file:t})})},_submit_base64(){this.$refs.cvAvatartCropper.getCropData(t=>{let o=new Image;o.src=t,o.onload=async()=>{imageCompress(o)}})},cropRotateRefresh(){},cropRotateLeft(){this.$refs.cvAvatartCropper.rotateLeft()},cropRotateRight(){this.$refs.cvAvatartCropper.rotateRight()},cropChangeScale(t){t=t||1,this.$refs.cvAvatartCropper.changeScale(t)},cropRealTime(t){this.cropPreviews=t}}},yi={class:"cv-upload-crop-box"},ki={class:"cv-upload-crop-left-box"},bi={class:"cv-upload-crop-left-opt"},wi={class:"cv-upload-crop-left-opt2"},Vi={class:"cv-upload-crop-left-opt2"},xi={class:"cv-upload-crop-right-box"},Ni=["innerHTML"],Si={title:"头像上传",name:"cvUploadAvatar",mixins:[lo],components:{UploadCrop:v(vi,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("vue-cropper"),c=e.resolveComponent("el-button"),h=e.resolveComponent("el-tooltip"),d=e.resolveComponent("el-input"),p=e.resolveComponent("el-dialog"),u=e.resolveDirective("loading");return e.openBlock(),e.createBlock(p,{title:a.title,modelValue:l.cropDialogVisible,"onUpdate:modelValue":o[7]||(o[7]=m=>l.cropDialogVisible=m),width:"800px","append-to-body":"",onOpened:n.cropDialogOpened,onClose:n.cropDialoClose},{footer:e.withCtx(()=>[e.createVNode(c,{type:"primary",onClick:n.cropSubmit,loading:a.loading,disabled:a.loading},{default:e.withCtx(()=>o[12]||(o[12]=[e.createTextVNode("提 交")])),_:1,__:[12]},8,["onClick","loading","disabled"])]),default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createElementBlock("div",yi,[e.createElementVNode("div",ki,[l.cropVisible?(e.openBlock(),e.createBlock(r,e.mergeProps({key:0,ref:"cvAvatartCropper",img:l.cropBeforelImage},n.cropAttrs,{onRealTime:n.cropRealTime}),null,16,["img","onRealTime"])):e.createCommentVNode("",!0),e.createElementVNode("div",bi,[e.renderSlot(t.$slots,"default"),e.createVNode(h,{effect:"dark",content:"重置",placement:"top"},{default:e.withCtx(()=>[e.createVNode(c,{icon:"ElIconRefresh",onClick:o[0]||(o[0]=m=>n.cropRotateRefresh())})]),_:1}),e.createVNode(h,{effect:"dark",content:"放大",placement:"top"},{default:e.withCtx(()=>[e.createVNode(c,{icon:"ElIconZoomIn",onClick:o[1]||(o[1]=m=>n.cropChangeScale(1))})]),_:1}),e.createVNode(h,{effect:"dark",content:"缩小",placement:"top"},{default:e.withCtx(()=>[e.createVNode(c,{icon:"ElIconZoomOut",onClick:o[2]||(o[2]=m=>n.cropChangeScale(-1))})]),_:1}),e.createVNode(h,{effect:"dark",content:"向左旋转",placement:"top"},{default:e.withCtx(()=>[e.createVNode(c,{icon:"ElIconRefreshLeft",onClick:o[3]||(o[3]=m=>n.cropRotateLeft())})]),_:1}),e.createVNode(h,{effect:"dark",content:"向右旋转",placement:"top"},{default:e.withCtx(()=>[e.createVNode(c,{icon:"ElIconRefreshRight",onClick:o[4]||(o[4]=m=>n.cropRotateRight())})]),_:1})]),e.createElementVNode("div",wi,[e.createVNode(d,{size:"small"},{prepend:e.withCtx(()=>o[8]||(o[8]=[e.createTextVNode("X 坐标")])),_:1}),e.createVNode(d,{size:"small"},{prepend:e.withCtx(()=>o[9]||(o[9]=[e.createTextVNode("Y 坐标")])),_:1})]),e.createElementVNode("div",Vi,[e.createVNode(d,{size:"small",modelValue:l.cropLocalWidth,"onUpdate:modelValue":o[5]||(o[5]=m=>l.cropLocalWidth=m)},{prepend:e.withCtx(()=>o[10]||(o[10]=[e.createTextVNode("宽度")])),_:1},8,["modelValue"]),e.createVNode(d,{size:"small",modelValue:l.cropLocalHeight,"onUpdate:modelValue":o[6]||(o[6]=m=>l.cropLocalHeight=m)},{prepend:e.withCtx(()=>o[11]||(o[11]=[e.createTextVNode("高度")])),_:1},8,["modelValue"])])]),e.createElementVNode("div",xi,[e.createElementVNode("div",{class:"cv-upload-crop-preview",innerHTML:l.cropPreviews.html},null,8,Ni)])])),[[u,a.loading]])]),_:3},8,["title","modelValue","onOpened","onClose"])}]])},props:{modelValue:{type:[String],default:""},initValue:{type:[String],default:""},fileSize:{type:[Number],default:2},fileType:{type:[Array],default:()=>["png","jpg","jpeg","gif"]},showSize:{type:Number,default:120},crop:{type:[Boolean],default:!0},signatureParam:{type:[Object],default:()=>({save_sign:"avatar"})}},data:()=>({localValue:"",localList:[],upAccept:"image/*"}),computed:{localRef:()=>"cvUploadAvatar"+ +new Date+(1e3*Math.random()).toFixed(0),handlerAttr(){return{ref:this.localRef,action:"#",accept:this.upAccept,limit:1,multiple:!1,drag:!1,disabled:this.upIngLoading,showFileList:!1}},showStyle(){return{width:this.showSize+"px",height:this.showSize+"px",lineHeight:this.showSize+"px"}}},watch:{initValue(t){this._init_parse()}},mounted(){this._init_parse()},methods:{_init_parse(){this.localValue=this.initValue||""},cropDialogOpen(){this.cropShow=!0,this.$nextTick(()=>{this._init_parse()})},initBeforeUpload(t){if(!this._commonBeforeUpload(t))return this.upIngLoading=!1,!1;if(this.crop){const o=new FileReader;o.readAsDataURL(t),o.onload=()=>{this.localValue=o.result},this.$refs.cvUploadAvatar.clearFiles()}},async onHttpRequest(t){const{file:o}=t;this.upIngLoading=!0;const a=this.mergeAttrs.signatureType||null,i=this.mergeAttrs.signatureFn||null,l=this.mergeAttrs.signatureParam||{};await Ko(o,a,i,l).then(n=>{this.$nextTick(()=>{this.$emit("update:modelValue",n.full_path),this.$emit("update:initValue",n.cdn_full_path)}),k.ElMessage.success("上传成功"),this.upIngLoading=!1,this.cropShow=!1}).catch(()=>{this.upIngLoading=!1})}}},Bi=["src"],pt=v(Si,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("upload-tip"),c=e.resolveComponent("cv-icons"),h=e.resolveComponent("el-button"),d=e.resolveComponent("el-tooltip"),p=e.resolveComponent("el-upload"),u=e.resolveComponent("upload-crop");return e.openBlock(),e.createElementBlock("div",{class:"cv-upload-avatar-wrap",onClick:o[2]||(o[2]=(...m)=>n.cropDialogOpen&&n.cropDialogOpen(...m))},[a.initValue?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"cv-upload-avatar-box cv-upload-avatar-empty",style:e.normalizeStyle(n.showStyle)},o[3]||(o[3]=[e.createElementVNode("div",{class:"cv-upload-avatar__text"},"上传头像",-1)]),4)),a.initValue?(e.openBlock(),e.createElementBlock("div",{key:1,class:"cv-upload-avatar-box",style:e.normalizeStyle(n.showStyle)},[e.createElementVNode("img",{class:"cv-upload-avatar__img",src:a.initValue},null,8,Bi)],4)):e.createCommentVNode("",!0),e.createVNode(r,e.mergeProps(t.tipAttr,{fileUnit:"张",multiple:!1,limit:1}),null,16),a.crop?(e.openBlock(),e.createBlock(u,{key:2,modelValue:t.cropShow,"onUpdate:modelValue":o[0]||(o[0]=m=>t.cropShow=m),title:"修改头像",size:a.showSize,onOnSubmit:n.onHttpRequest,onOnClose:o[1]||(o[1]=m=>t.upIngLoading=!1),loading:t.upIngLoading,src:l.localValue},{default:e.withCtx(()=>[e.createVNode(p,e.mergeProps(n.handlerAttr,{"before-upload":n.initBeforeUpload,"http-request":t.initHttpRequest}),{default:e.withCtx(()=>[e.createVNode(d,{effect:"dark",content:"选择图片",placement:"top"},{default:e.withCtx(()=>[e.createVNode(h,{style:{"margin-right":"10px"},loading:t.upIngLoading,disabled:t.upIngLoading},{default:e.withCtx(()=>[e.createVNode(c,{type:"ElIconPlus",size:"14",style:{"margin-right":"10px"}}),o[4]||(o[4]=e.createTextVNode(" 选择 "))]),_:1,__:[4]},8,["loading","disabled"])]),_:1})]),_:1},16,["before-upload","http-request"])]),_:1},8,["modelValue","size","onOnSubmit","loading","src"])):e.createCommentVNode("",!0)])}]]),Ei={title:"图片上传",name:"cvUploadImage",mixins:[lo],components:{},props:{modelValue:{type:[String,Array,Object],default:()=>[]},initValue:{type:[String,Array],default:()=>""},fileSize:{type:[Number],default:2},fileType:{type:[Array],default:()=>["png","jpg","jpeg","gif"]},showSize:{type:Number,default:150},showBig:{type:[Boolean],default:!1},crop:{type:[Boolean],default:!1},galleryLabel:{type:String,default:""},lazy:{type:Boolean,default:!0},drag:{type:Boolean,default:!1},signatureParam:{type:[Object],default:()=>({save_sign:"image"})}},data:()=>({localValue:[],localList:[],previewShow:!1,previewTitle:"",previewUrl:"",upAccept:"image/*"}),computed:{localRef:()=>"cvUploadImage"+ +new Date+(1e3*Math.random()).toFixed(0),handlerAttr(){return{ref:this.localRef,action:"#",accept:this.upAccept,limit:parseInt(this.limit),multiple:this.multiple,drag:!!this.drag,disabled:this.upIngLoading,showFileList:!1}},showUpload(){return!(this.localList.length>=this.limit)},showStyle(){let t=this.showSize+"px";return(this.showBig||this.drag)&&(t=2*this.showSize+"px"),{width:t,height:this.showSize+"px",lineHeight:this.showSize+"px"}}},watch:{modelValue(t){this._init_parse_value()},initValue(t){this._init_parse_list()}},mounted(){},methods:{_init_parse_value(){this.modelValue?this.localValue=Fl(this.modelValue):this.localValue=[]},_init_parse_list(){this.initValue?this.localList=qo(this.initValue):this.localList=[]},initOnChange(t,o){},initBeforeUpload(t){return this.upIngLoading=!0,!!this._commonBeforeUpload(t)||(this.upIngLoading=!1,!1)},async initHttpRequest(t){const{file:o}=t;this.upIngLoading=!0,this.mergeAttrs.upResponseFn;const a=this.mergeAttrs.signatureType||null,i=this.mergeAttrs.signatureFn||null,l=this.mergeAttrs.signatureParam||{};await Ko(o,a,i,l).then(n=>{this.$nextTick(()=>{this.updateValue(n.full_path,n.cdn_full_path)}),k.ElMessage.success("上传成功"),this.upIngLoading=!1}).catch(()=>{this.upIngLoading=!1})},updateValue(t,o){if(this.multiple){let a=ra(this.localValue,t);this.$emit("update:modelValue",a)}else this.$emit("update:modelValue",t);if(this.multiple){let a=ra(this.localList,o);this.$emit("update:initValue",a)}else this.$emit("update:initValue",o)},handleItemPreview(t,o){t.raw,t.type.includes("image")?(this.previewTitle=t.name,this.previewUrl=t.url,this.previewShow=!0):window.open(t.url)},doRemove(t){this.multiple?(this.localValue.splice(t,1),this.localList.splice(t,1)):(this.localValue="",this.localList=[]),this.updateValue(null,null)},handleItemRemove(t,o){if(this.beforeRemove&&typeof this.beforeRemove=="function"){const a=this.multiple?this.localValue[o]:this.localValue,i=this.beforeRemove(a,this.localValue);i&&i.then?i.then(()=>{this.doRemove(o)},()=>{}):i!==!1&&this.doRemove(o)}else this.doRemove(o)},handleItemEdit(t,o){k.ElMessageBox.prompt("请输入文件地址","编辑",{confirmButtonText:"OK",cancelButtonText:"Cancel",inputValue:t.url||"",inputErrorMessage:"格式不正确"}).then(({value:a})=>{var h,d;const i=a.split("/").pop(),l=i.split(".").pop().toLowerCase();if(!this.fileType.includes(l)){let p=this.fileType.join("、");return k.ElMessage.error(`文件格式错误,请填写类型,如:${p} 格式文件`),!1}const n=function(p){if(!p)return"";const u=p.replace(/^\./,"").toLowerCase();return Il.extensionToMime[u]||""}(l);if(!n)return k.ElMessage.error("文件格式错误"),!1;var r;(r=a).startsWith("http://")||r.startsWith("https://")||r.startsWith("//")||(h=this.mergeAttrs)!=null&&h.baseDomain&&(a=((d=this.mergeAttrs)==null?void 0:d.baseDomain)+a);const c={name:i,status:"success",type:n,uid:Date.now(),url:a};this.localList[o]=c}).catch(()=>{})},handleItemCrop(t,o){}}},Di={class:"cv-upload-image cv-upload-common"},_i={class:"cv-upload-list-box el-upload-list el-upload-list--picture-card"},Ti=["tabindex"],Ii={class:"el-upload-list__item-status-label"},Li={class:"el-upload-list__item-actions"},Fi=["onClick"],Oi={class:"el-upload-list__item-delete"},$i={class:"el-upload-list__item-delete"},zi=["onClick"],Pi={style:{margin:"0 auto"}},Mi=["src"],mt=v(Ei,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-image"),c=e.resolveComponent("cv-icons"),h=e.resolveComponent("el-upload"),d=e.resolveComponent("upload-tip"),p=e.resolveComponent("el-dialog"),u=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",Di,[e.createElementVNode("div",_i,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.localList,(m,f)=>(e.openBlock(),e.createElementBlock("section",{class:"el-upload-list__item is-success",key:f,tabindex:f,style:e.normalizeStyle(n.showStyle)},[e.createVNode(r,{class:"el-upload-list__item-thumbnail",lazy:a.lazy,src:m.url,style:e.normalizeStyle(n.showStyle),fit:"contain"},null,8,["lazy","src","style"]),e.createElementVNode("label",Ii,[e.createVNode(c,{type:"ElIconCheck",color:"#ffffff",size:"12"})]),e.createElementVNode("span",Li,[e.createElementVNode("span",{class:"el-upload-list__item-preview",onClick:C=>n.handleItemPreview(m)},[e.createVNode(c,{type:"ElIconZoomIn",size:"20"})],8,Fi),e.createElementVNode("span",Oi,[e.createVNode(c,{type:"ElIconDelete",size:"20",onClick:C=>n.handleItemRemove(m,f)},null,8,["onClick"])]),e.createElementVNode("span",$i,[e.createVNode(c,{type:"ElIconEdit",size:"20",onClick:C=>n.handleItemEdit(m,f)},null,8,["onClick"])]),a.crop?(e.openBlock(),e.createElementBlock("span",{key:0,class:"el-upload-list__item-preview",onClick:C=>n.handleItemCrop(m)},[e.createVNode(c,{type:"ElIconCrop",size:"20"})],8,zi)):e.createCommentVNode("",!0)])],12,Ti))),128)),n.showUpload?(e.openBlock(),e.createBlock(h,e.mergeProps({key:0,class:"cv-upload-common-handle"},n.handlerAttr,{"file-list":l.localList,"before-upload":n.initBeforeUpload,"http-request":n.initHttpRequest,"on-change":n.initOnChange,"on-exceed":t.initOnExceed,style:n.showStyle}),{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:"cv-upload-common__ing",style:e.normalizeStyle(n.showStyle)},[a.drag?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(c,{type:"ElIconUpload",size:"24"}),o[1]||(o[1]=e.createElementVNode("div",{class:"el-upload__text"},[e.createTextVNode(" 将文件拖到此处,或 "),e.createElementVNode("em",null,"点击上传")],-1))],64)):(e.openBlock(),e.createBlock(c,{key:1,type:"ElIconPlus",size:a.showSize/3},null,8,["size"]))],4)),[[u,t.upIngLoading]])]),_:1},16,["file-list","before-upload","http-request","on-change","on-exceed","style"])):e.createCommentVNode("",!0)]),e.createVNode(d,e.mergeProps(t.tipAttr,{fileUnit:"张"}),null,16),e.createVNode(p,{modelValue:l.previewShow,"onUpdate:modelValue":o[0]||(o[0]=m=>l.previewShow=m),title:l.previewTitle,"append-to-body":""},{default:e.withCtx(()=>[e.createElementVNode("div",Pi,[e.createElementVNode("img",{width:"100%",src:l.previewUrl,style:{"max-width":"300px"}},null,8,Mi)])]),_:1},8,["modelValue","title"])])}]]),Hi={mdb:"access",accdb:"access",ai:"ai",html:"html",htm:"html",asp:"web",pdf:"pdf",psd:"photoshop",psb:"photoshop",mpo:"photoshop",eps:"photoshop",avi:"video",wmv:"video",rm:"video",rmvb:"video",mp4:"video","3gp":"video",asf:"video",mov:"video",m4v:"video",flv:"video",f4v:"video",mkv:"video",mts:"video",swf:"flash",ts:"video",mp3:"audio",wav:"audio",wma:"audio",ape:"audio",aac:"audio",zip:"zip",rar:"zip",gz:"zip","7z":"zip",z:"zip",bmp:"image",jpg:"image",jpeg:"image",png:"image",gif:"image",webp:"image",svg:"image",txt:"txt",rtf:"txt",xls:"excel",xlsx:"excel",xlsm:"excel",xltx:"excel",doc:"word",docx:"word",docm:"word",wps:"word",dotx:"word",dotm:"word",ppt:"powerpoint",pptx:"powerpoint",mdf:"db",db:"db",dbf:"db",wdb:"db",vue:"vue",php:"php",jar:"jar",ini:"ini",bat:"bat",config:"config",fla:"fla",eot:"font",otf:"font",fon:"font",font:"font",ttf:"font",ttc:"font",woff:"font",woff2:"font",js:"js",md:"markdown",one:"onenote",jsx:"reactjs",xfl:"xfl",file:"file",css:"css"};function so(t){return`https://10ui.cn/default/icon_ext/${Hi[t]}.svg`}const Ai={name:"uploadList",props:{files:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1},isCanDownload:{type:Boolean,default:!0},isCanDelete:{type:Boolean,default:!0}},methods:{getExtension(t){return t.lastIndexOf(".")>-1&&so[t.slice(t.lastIndexOf(".")+1).toLowerCase()]||so.file},getSize:t=>t&&!isNaN(Number(t))?t:"",parsePercentage:t=>parseInt(t,10),handleDownload(t){t.url},handleDelete(t,o){this.$confirm("确认删除该文件吗? ").then(()=>{this.$emit("remove",t,o)}).catch(()=>{})}}},ji=["src"],Ri={class:"cv-upload-list__item-content-action"},Ui={title:"文件上传",inheritAttrs:!1,name:"cvUploadFile",mixins:[lo],components:{uploadList:v(Ai,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-link");return e.openBlock(),e.createBlock(e.TransitionGroup,{class:"cv-upload-file-list el-upload-list el-upload-list--text",name:"el-list",tag:"ul"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.files,(c,h)=>(e.openBlock(),e.createElementBlock("li",{key:c.uid,class:"el-upload-list__item cv-upload-list__item-content"},[e.createVNode(r,{href:c.url,underline:!1,target:"_blank"},{default:e.withCtx(()=>[e.createElementVNode("img",{src:n.getExtension(c.name),class:"el-upload-list__item-content-name-icon"},null,8,ji),e.createElementVNode("span",null,e.toDisplayString(c.name),1)]),_:2},1032,["href"]),e.createElementVNode("div",Ri,[e.createVNode(r,{underline:!1},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.getSize(c.size)),1)]),_:2},1024),a.isCanDownload?(e.openBlock(),e.createBlock(r,{key:0,underline:!1,onClick:d=>n.handleDownload(c)},{default:e.withCtx(()=>o[0]||(o[0]=[e.createTextVNode("下载")])),_:2,__:[0]},1032,["onClick"])):e.createCommentVNode("",!0),!a.disabled&&a.isCanDelete?(e.openBlock(),e.createBlock(r,{key:1,underline:!1,onClick:d=>n.handleDelete(h,c),type:"danger"},{default:e.withCtx(()=>o[1]||(o[1]=[e.createTextVNode(" 删除 ")])),_:2,__:[1]},1032,["onClick"])):e.createCommentVNode("",!0)])]))),128))]),_:1})}]])},props:{modelValue:{type:[String,Object,Array],default:""},initValue:{type:[String,Object,Array],default:""},fileSize:{type:[Number],default:5},fileType:{type:[Array],default:["txt","png","jpg","xlsx","xls"]},multiple:{type:[Boolean],default:!1},limit:{type:[Number],default:5},disabled:Boolean,isCanDownload:{type:Boolean,default:!0},isCanDelete:{type:Boolean,default:!0},isCanUploadSame:{type:Boolean,default:!0}},data:()=>({localValue:[],localList:[]}),computed:{localRef:()=>"cvUploadFile"+ +new Date+(1e3*Math.random()).toFixed(0),handlerAttr(){return{ref:this.localRef,action:"#",limit:parseInt(this.limit),multiple:this.multiple,drag:!1,disabled:this.upIngLoading,showFileList:!0}},list(){let t=1;return this.modelValue?(Array.isArray(this.modelValue)?this.modelValue:[this.modelValue]).map(o=>(typeof o=="string"&&(o={name:o,url:o}),o.uid=o.uid||new Date().getTime()+t++,o)):[]}},watch:{initValue(t){this._init_parse()}},mounted(){this._init_parse()},methods:{_init_parse(){this.initValue?this.localList=qo(this.initValue):this.localList=[]},initOnChange(t,o){this.localList=o},initBeforeUpload(t){return this._commonBeforeUpload(t)?!this.isCanUploadSame&&this.localList.some(o=>o.name+o.size===t.name+t.size)?(this.$message.error("此文件已上传!"),!1):!0:!1},upFileError(t){this.$message.error("上传失败, 请重试"),this.$emit("error",t)},upFileSuccess(t,o){this.upResponseFn&&typeof this.upResponseFn=="function"&&(t=this.upResponseFn(t,o,this.localList)),this.multiple?this.$emit("update:modelValue",[...this.localList,t]):this.$emit("update:modelValue",t),this.$emit("success",t,this.localList)},handleRemove(t,o){if(this.beforeRemove&&typeof this.beforeRemove=="function"){const a=this.beforeRemove(this.localList[o],this.localList);a&&a.then?a.then(()=>{this._do_remove(o)},()=>{}):a!==!1&&this._do_remove(o)}else this._do_remove(o)},_do_remove(t){if(this.$emit("remove",this.list[t],this.list),this.localList.splice(t,1),this.multiple){const o=[...this.list];o.splice(t,1),this.$emit("update:modelValue",o||[])}else this.$emit("update:modelValue",null)}}},Wi={class:"cv-upload-file"},ut=v(Ui,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-button"),c=e.resolveComponent("el-upload"),h=e.resolveComponent("upload-tip"),d=e.resolveComponent("upload-list");return e.openBlock(),e.createElementBlock("div",Wi,[e.createVNode(c,e.mergeProps({class:"cv-upload-file-uploader"},n.handlerAttr,{"file-list":l.localList,"onUpdate:fileList":o[0]||(o[0]=p=>l.localList=p),"before-upload":n.initBeforeUpload,"on-change":n.initOnChange,"on-exceed":t.initOnExceed,"on-error":n.upFileError,"on-success":n.upFileSuccess}),{default:e.withCtx(()=>[e.createVNode(r,{type:"primary",icon:"ElIconUpload"},{default:e.withCtx(()=>o[1]||(o[1]=[e.createTextVNode("上传文件")])),_:1,__:[1]})]),_:1},16,["file-list","before-upload","on-change","on-exceed","on-error","on-success"]),e.createVNode(h,e.mergeProps(t.tipAttr,{fileUnit:"个"}),null,16),e.createVNode(d,{disabled:a.disabled,files:n.list,isCanDelete:a.isCanDelete,isCanDownload:a.isCanDownload,onRemove:n.handleRemove},null,8,["disabled","files","isCanDelete","isCanDownload","onRemove"])])}]]),Yi={class:"cv-upload-video"},Xi={class:"cv-upload-list-box el-upload-list el-upload-list--picture-card"},qi=["tabindex"],Ki=["src"],Gi={class:"el-upload-list__item-status-label"},Zi={class:"el-upload-list__item-actions"},Qi=["onClick"],Ji={class:"el-upload-list__item-delete"},er={class:"el-upload-list__item-delete"},tr={key:0,style:{width:"500px",height:"300px",margin:"0 auto"}},or=["src"],gt=v({title:"视频上传",name:"cvUploadVideo",mixins:[lo],components:{},props:{modelValue:{type:[String],default:""},initValue:{type:[String],default:""},fileSize:{type:[Number],default:10},fileType:{type:Array,default:["mp4","mp3"]},showSize:{type:Number,default:360},signatureParam:{type:[Object],default:()=>({save_sign:"video"})}},data:()=>({localValue:"",localList:"",previewShow:!1,previewTitle:"",previewUrl:"",upAccept:"video/*"}),computed:{localRef:()=>"cvUploadVideo"+ +new Date+(1e3*Math.random()).toFixed(0),handlerAttr(){return{ref:this.localRef,action:"#",accept:this.upAccept,limit:1,multiple:!1,drag:!0,disabled:this.upIngLoading,showFileList:!1}},showUpload(){return!this.localValue},showStyle(){return{width:this.showSize+"px",height:this.showSize/5*3+"px",lineHeight:this.showSize+"px"}}},watch:{modelValue(t){this._init_parse_value()},initValue(t){this._init_parse_list()}},mounted(){this._init_parse_value(),this._init_parse_list()},methods:{_init_parse_value(){this.modelValue?this.localValue=Fl(this.modelValue):this.localValue=""},_init_parse_list(){this.initValue?this.localList=qo(this.initValue):this.localList=""},initBeforeUpload(t){return this.upIngLoading=!0,!!this._commonBeforeUpload(t)||(this.upIngLoading=!1,!1)},async initHttpRequest(t){const{file:o}=t;this.upIngLoading=!0,this.mergeAttrs.upResponseFn;const a=this.mergeAttrs.signatureType||null,i=this.mergeAttrs.signatureFn||null,l=this.mergeAttrs.signatureParam||{};await Ko(o,a,i,l).then(n=>{this.$nextTick(()=>{this.$emit("update:modelValue",n.full_path),this.$emit("update:initValue",n.cdn_full_path)}),ExtendMessage.success("上传成功"),this.upIngLoading=!1}).catch(()=>{this.upIngLoading=!1})},handleItemPreview(t,o){this.previewTitle=t.name,this.previewUrl=t.url,this.previewShow=!0},doRemove(t){this.localValue="",this.localList="",this.$emit("update:modelValue",""),this.$emit("update:initValue","")},handleItemRemove(t,o){if(this.beforeRemove&&typeof this.beforeRemove=="function"){const a=this.multiple?this.localValue[o]:this.localValue,i=this.beforeRemove(a,this.localValue);i&&i.then?i.then(()=>{this.doRemove(o)},()=>{}):i!==!1&&this.doRemove(o)}else this.doRemove(o)}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("cv-icons"),c=e.resolveComponent("el-progress"),h=e.resolveComponent("el-upload"),d=e.resolveComponent("upload-tip"),p=e.resolveComponent("el-dialog");return e.openBlock(),e.createElementBlock("div",Yi,[e.createElementVNode("div",Xi,[l.localList?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(l.localList,(u,m)=>(e.openBlock(),e.createElementBlock("section",{class:"el-upload-list__item is-success",key:m,tabindex:m,style:e.normalizeStyle(n.showStyle)},[e.createElementVNode("video",{class:"el-upload-list__item-thumbnail",autoplay:!1,src:u.url,style:e.normalizeStyle(n.showStyle)}," 您的浏览器不支持视频播放 ",12,Ki),e.createElementVNode("label",Gi,[e.createVNode(r,{type:"ElIconCheck",color:"#ffffff",size:"12"})]),e.createElementVNode("span",Zi,[e.createElementVNode("span",{class:"el-upload-list__item-preview",onClick:f=>n.handleItemPreview(u)},[e.createVNode(r,{type:"ElIconVideoPlay",size:"20"})],8,Qi),e.createElementVNode("span",Ji,[e.createVNode(r,{type:"ElIconDelete",size:"20",onClick:f=>n.handleItemRemove(u,m)},null,8,["onClick"])]),e.createElementVNode("span",er,[e.createVNode(r,{type:"ElIconEdit",size:"20",onClick:f=>t.handleItemEdit(u,m)},null,8,["onClick"])])])],12,qi))),128)):e.createCommentVNode("",!0),n.showUpload?(e.openBlock(),e.createBlock(h,e.mergeProps({key:1,class:"cv-upload-handler"},n.handlerAttr,{"before-upload":n.initBeforeUpload,"http-request":n.initHttpRequest,style:n.showStyle}),{default:e.withCtx(()=>[t.upIngPercent>0?(e.openBlock(),e.createBlock(c,{key:0,percentage:t.upIngPercent,style:{"margin-top":"20px"},type:"circle"},null,8,["percentage"])):(e.openBlock(),e.createElementBlock("div",{key:1,class:"cv-upload-video__ing",style:e.normalizeStyle(n.showStyle)},[e.createVNode(r,{type:"ElIconUpload",size:"24"}),o[1]||(o[1]=e.createElementVNode("div",{class:"el-upload__text"},[e.createTextVNode(" 将视频拖到此处,或 "),e.createElementVNode("em",null,"点击上传")],-1))],4))]),_:1},16,["before-upload","http-request","style"])):e.createCommentVNode("",!0)]),e.createVNode(d,e.mergeProps(t.tipAttr,{fileUnit:"个",limit:1}),null,16),e.createVNode(p,{modelValue:l.previewShow,"onUpdate:modelValue":o[0]||(o[0]=u=>l.previewShow=u),title:l.previewTitle,"append-to-body":""},{default:e.withCtx(()=>[l.previewShow?(e.openBlock(),e.createElementBlock("div",tr,[e.createElementVNode("video",{autoplay:!0,src:l.previewUrl,controls:"controls",style:{width:"500px",height:"300px"}}," 您的浏览器不支持视频播放 ",8,or)])):e.createCommentVNode("",!0)]),_:1},8,["modelValue","title"])])}]]),ar={emits:["get-unlist","on-close","on-update","on-delete"],props:{modelValue:{type:Array,default:()=>[]},model:{type:String,default:""},accept:{type:String,default:""},multiple:{type:Boolean,default:!1}},data:()=>({audioInfo:{},file:null,fileList:[],fileHash:"",tempCheckpoint:null,uploadId:"",uploadStatus:null,showAudio:!1,percentage:0,uploadName:"",client:null,year:new Date().getFullYear(),uploadDisabled:!0,resumeDisabled:!0,pauseDisabled:!0,dialogVisible:!1,isDoing:!1,unList:[],fileMap:{},map_max_key:0,partSize:1048576,parallel:4,checkpoints:{}}),watch:{dialogVisible:{handler(t){t||(this.fileList=[],this.$refs.upload.uploadFiles=[])}},fileList:{handler(t){if(t.length){this.dialogVisible=!0;let o=[],a=[];t.forEach(i=>{i.raw.name.indexOf(".")===-1&&(i.errMsg="不支持此格式上传"),i.percentage===100?o.push(i):a.push(i)}),o.length===t.length?(this.pauseDisabled=!0,this.isDoing=!0):this.isDoing=!1,this.unList=a}},deep:!0}},mounted(){window.addEventListener("online",this.resumeUpload)},methods:{filterSize:ia,handleExceed(){this.$confirm("上传文件数量不能超过100个,请重新选择!","操作提示",{confirmButtonText:"确 定",cancelButtonText:"取 消",type:"warning"}).then(()=>{this.fileList=[],this.dialogVisible=!1}).catch(()=>{this.fileList=[]})},handleDeleteChangeFile(t){this.fileList.splice(t,1),this.fileList.length||(this.dialogVisible=!1)},fileTypeIcon(t){const{type:o}=t.raw,a=o.indexOf("video")!==-1,i=o.indexOf("image")!==-1,l=o.indexOf("audio")!==-1,n=o.indexOf("zip")!==-1,r=o.indexOf("wordprocessingml")!==-1,c=o.indexOf("pdf")!==-1,h=o.indexOf("text")!==-1,d=o.indexOf("sheet")!==-1;return a?"MP4":i?"JPG1":l?"mp3-1":n?"yasuo":r?"DOCX":c?"wenjianleixing-biaozhuntu-PDFwendang":h?"div-1":d?"excel1":"weizhiwenjian"},handleClose(){this.$emit("on-close"),this.isDoing?this.dialogVisible=!1:this.$confirm("正在上传文件,关闭后上传文件会丢失!是否继续?","操作提示",{confirmButtonText:"确 定",cancelButtonText:"取 消",type:"warning"}).then(()=>{this.$emit("get-unlist"),this.fileList.forEach(t=>{t.client&&t.percentage<100&&t.client.cancel()}),this.dialogVisible=!1}).catch(()=>{})},async handleBeforeUpload(t){},handleStopChangeFile(t,o){o.isPlay=!o.isPlay,this.fileList.splice(t,1,o),o.isPlay?this.resumeMultipartUpload(o):o.client.cancel()},async starUpload(){this.uploadDisabled=!0,this.pauseDisabled=!1,this.multipartUpload()},async multipartUpload(){this.file?this.fileList.forEach(async t=>{t.isLoading=!0,await this.ossUploadHandle(t,this.fileList)}):k.ElMessage.error("请选择文件")},async resumeUpload(){this.pauseDisabled=!1,this.uploadDisabled=!0,this.resumeDisabled=!0,await this.resumeMultipartUpload()},stopUpload(){this.resumeDisabled=!1,this.pauseDisabled=!0,this.fileList.forEach(t=>{t.client.cancel(),t.isPlay=!1})},async change(t,o){this.fileMap[t]=o,this.map_max_key=t},async handle_network_speed_change(t,o,a){t-this.map_max_key>=1e4&&(this.fileMap={});for(let i=t;i<=o;i++){const l=await this.fileMap[i];l?await this.change(i,l+a):await this.change(i,a)}},handle_network_speed(t,o,a){const i=t.rt/1e3,l=new Date(t.headers.date).getTime(),n=l-i;let r=parseInt(o/i);return a===0&&(r=0),r===0||this.handle_network_speed_change(n,l,r),r?ia(r):0},async resetUpload(t,o){JSON.stringify(t).indexOf("Error")!==-1&&(o.client&&o.client.cancel(),o.client=await ca(this.signatureType,this.apiFunc),await this.resumeMultipartUpload(o))},async resumeMultipartUpload(t){if(t){const{tempCheckpoint:o}=t;this.resumeUploadFile(t,o)}else Object.values(this.checkpoints).forEach(o=>{const{uploadId:a}=o,i=this.fileList.findIndex(n=>n.upload===a),l=this.fileList[i];this.resumeUploadFile(l,o)})},async resumeUploadFile(t,o){const{uploadId:a,file:i,name:l}=o;try{const{raw:n,percentage:r}=t;t.partSize=0,r<100&&n.name.indexOf(".")!==-1&&t.client.multipartUpload(a,i,{parallel:this.parallel,partSize:this.partSize,progress:async(c,h,d)=>{await this.onUploadProgress(t,c,h,d,l)},checkpoint:o}).then(()=>{delete this.checkpoints[o.uploadId],this.$emit("update:modelValue",this.fileList),this.resumeDisabled=!0,this.unList.length&&this.uploadDisabled&&(this.resumeDisabled=!1),this.onCreatePanFile(t)}).catch(async c=>{await this.resetUpload(c,t)})}catch{}},async onUploadProgress(t,o,a,i,l){a&&(this.checkpoints[a.uploadId]=a,t.speed=this.handle_network_speed(i,this.partSize,o),t.tempCheckpoint=a,t.abortCheckpoint=a,t.upload=a.uploadId),t.isPlay=!0,t.isPlay&&(t.isLoading=!1),t.uploadName=l,t.percentage=Number((100*o).toFixed(2))},async ossUploadHandle(t){let o={pass:!0,filePath:""};try{const{raw:a,percentage:i}=t,l=a,n=await ca(this.signatureType,this.apiFunc,{},{secure:!0});if(this.signatureType=="aliyun_oss_type1"){if(t.client=n,t.partSize=0,i<100&&a.name.indexOf(".")!==-1){const r=n.dir+l.name;await t.client.multipartUpload(r,l,{parallel:this.parallel,partSize:this.partSize,progress:async(c,h,d)=>{await this.onUploadProgress(t,c,h,d,r)}}).then(()=>{this.$emit("upload:modelValue",this.fileList),this.resumeDisabled=!0,this.onCreatePanFile(t),this.unList.length&&this.uploadDisabled&&(this.resumeDisabled=!1)}).catch(async c=>{})}}else this.signatureType=="aliyun_oss_type2"&&Ol(l,n)}catch(a){o={...a,pass:!1,filePath:""}}return o},getToday(){const t=new Date;return`${t.getFullYear()}${t.getMonth()+1}${t.getDate()}${t.getHours()}${t.getMinutes()}${t.getSeconds()}`},handleChange(t,o){o.forEach(a=>{a.client=null,a.isPlay=!1,a.isLoading=!1,a.abortCheckpoint=!1}),this.fileList=o,this.file=t.raw,this.uploadDisabled=!1,this.pauseDisabled=this.resumeDisabled=!0},handleDeleteFile(t){const o=t.indexOf(this.model);t.substring(o,t.length),this.$emit("on-delete"),this.fileList=[],k.ElMessage.success("删除成功")},async onCreatePanFile(t){await this.getParams(t),this.$emit("on-update")},handleMediaRes:t=>({image:async function(o){return new Promise(a=>{var i=new FileReader;i.onload=function(l){var n=l.target.result,r=new Image;r.onload=function(){a({Width:this.width,Height:this.height})},r.src=n},i.readAsDataURL(o)})},audio:async function(o){return new Promise(a=>{var i=new FileReader;i.onload=function(l){var n=l.target.result,r=new Audio;r.onloadeddata=function(){const c=r.duration;a({Duration:1e3*c})},r.src=n},i.readAsDataURL(o)})},video:async function(o){return new Promise(a=>{var i=URL.createObjectURL(o);const l=document.createElement("video");l.src=i,l.onloadeddata=function(){a({CoverImg:"",Duration:1e3*this.duration,Width:this.videoWidth,Height:this.videoHeight})}})}})[t],captureImage:(t,o)=>t+"?x-oss-process=video/snapshot,t_"+(o=o||"3000 ")+",f_jpg",async getParams(t){const{type:o}=t.raw,a=o.indexOf("video")!==-1,i=o.indexOf("image")!==-1,l=o.indexOf("audio")!==-1;let n,r="";return a?r="video":i?o.indexOf("adobe")===-1&&(r="image"):l&&(r="audio"),(a||i||l)&&r&&(n=await this.handleMediaRes(r)(t.raw)),{ResTitle:t.name,ResDescribe:"",OssKey:t.uploadName,ContentType:o||"application/octet-stream",ContentLength:t.size,...n}}}},lr={class:"oss-upload"},nr={class:"cv-upload-task-hd-title"},ir={class:"cv-upload-task-hd-num"},rr={class:"cv-upload-task-opts"},sr={class:"cv-upload-task-lists"},cr={class:"cv-upload-task-item-name"},dr={class:"name"},hr={class:"file-name-item"},pr={key:0,class:"speed"},mr={key:1,class:"speed"},ur={key:2,class:"success"},gr={class:"total"},fr={key:0,class:"name error"},Cr={class:"cv-upload-task-item-tool"},vr=["onClick"],yr=["onClick"],ft=v({name:"cvUploadOss",mixins:[ar]},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-button"),c=e.resolveComponent("el-upload"),h=e.resolveComponent("el-progress"),d=e.resolveComponent("cv-icons"),p=e.resolveComponent("el-dialog");return e.openBlock(),e.createElementBlock("div",lr,[e.createVNode(c,{ref:"upload",action:"","show-file-list":!1,multiple:"","on-change":t.handleChange,"before-upload":t.handleBeforeUpload,"auto-upload":!1,limit:100,"on-exceed":t.handleExceed,accept:t.accept},{default:e.withCtx(()=>[e.createVNode(r,{type:"primary",icon:"ElIconUpload",round:""},{default:e.withCtx(()=>o[1]||(o[1]=[e.createTextVNode("上 传")])),_:1,__:[1]})]),_:1},8,["on-change","before-upload","on-exceed","accept"]),e.createVNode(p,{modelValue:t.dialogVisible,"onUpdate:modelValue":o[0]||(o[0]=u=>t.dialogVisible=u),width:"650px",height:"500","destroy-on-close":"","close-on-click-modal":!1,"before-close":t.handleClose,style:{height:"500px"}},{header:e.withCtx(()=>[e.createElementVNode("div",nr,[o[2]||(o[2]=e.createElementVNode("span",null,"上传",-1)),e.createElementVNode("span",ir,e.toDisplayString(t.fileList.length-t.unList.length)+"/"+e.toDisplayString(t.fileList.length),1)])]),default:e.withCtx(()=>[e.createElementVNode("div",rr,[e.createVNode(r,{type:"primary",icon:"ElIconVideoPlay",disabled:t.uploadDisabled,onClick:t.starUpload},{default:e.withCtx(()=>o[3]||(o[3]=[e.createTextVNode("开始上传")])),_:1,__:[3]},8,["disabled","onClick"]),e.createVNode(r,{type:"success",icon:"ElIconRefreshRight",disabled:t.resumeDisabled,onClick:t.resumeUpload},{default:e.withCtx(()=>o[4]||(o[4]=[e.createTextVNode("继续")])),_:1,__:[4]},8,["disabled","onClick"]),e.createVNode(r,{type:"danger",icon:"ElIconVideoPause",disabled:t.pauseDisabled,onClick:t.stopUpload},{default:e.withCtx(()=>o[5]||(o[5]=[e.createTextVNode("暂停")])),_:1,__:[5]},8,["disabled","onClick"])]),e.createElementVNode("div",sr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fileList,(u,m)=>(e.openBlock(),e.createElementBlock("div",{class:"cv-upload-task-item-box",key:m},[e.createElementVNode("div",cr,[e.createElementVNode("div",dr,[e.createElementVNode("span",hr,e.toDisplayString(m+1)+"."+e.toDisplayString(u.name),1),u.isLoading&&!u.isPlay?(e.openBlock(),e.createElementBlock("span",pr,"准备就绪")):e.createCommentVNode("",!0),u.isPlay&&u.percentage!==100?(e.openBlock(),e.createElementBlock("span",mr,e.toDisplayString(u.speed)+"/s",1)):e.createCommentVNode("",!0),u.percentage===100?(e.openBlock(),e.createElementBlock("span",ur,"完成")):e.createCommentVNode("",!0),e.createElementVNode("div",gr,e.toDisplayString(t.filterSize(u.size)),1)]),u.errMsg?(e.openBlock(),e.createElementBlock("span",fr,e.toDisplayString(u.errMsg),1)):e.createCommentVNode("",!0),u.percentage<100&&!u.errMsg?(e.openBlock(),e.createBlock(h,{key:1,percentage:u.percentage},null,8,["percentage"])):(e.openBlock(),e.createBlock(h,{key:2,percentage:u.percentage,status:u.errMsg?"exception":"success"},null,8,["percentage","status"]))]),e.createElementVNode("div",Cr,[!u.percentage||0<u.percentage<100&&!u.isPlay?(e.openBlock(),e.createElementBlock("span",{key:0,class:"icon delete",onClick:f=>t.handleDeleteChangeFile(m)},[e.createVNode(d,{type:"ElIconClose"})],8,vr)):e.createCommentVNode("",!0),u.percentage&&u.percentage!==100?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(["icon",u.isPlay?"delete":"success"]),onClick:f=>t.handleStopChangeFile(m,u)},[u.isPlay?(e.openBlock(),e.createBlock(d,{key:0,type:"ElIconVideoPause"})):(e.openBlock(),e.createBlock(d,{key:1,type:"ElIconCaretRight"}))],10,yr)):e.createCommentVNode("",!0)])]))),128))])]),_:1},8,["modelValue","before-close"])])}],["__scopeId","data-v-9c3ea43c"]]);pt.install=function(t){t.component(pt.name,pt)},mt.install=function(t){t.component(mt.name,mt)},ut.install=function(t){t.component(ut.name,ut)},gt.install=function(t){t.component(gt.name,gt)},ft.install=function(t){t.component(ft.name,ft)};const kr={class:"tabs-header"},Ct=v({name:"cvTabsJump",props:{tabPosition:{type:String,default:"top"}},provide(){return{addChildComponents:t=>{this.childComponents.push(t)},clearChildClass:()=>{this.childComponents.map(t=>{t.className=null})}}},data:()=>({childComponents:[]}),computed:{tabPositionClass(){return this.tabPosition=="left"?"left":this.tabPosition=="right"?"right":this.tabPosition=="bottom"?"bottom":"top"}},created(){},mounted(){}},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cv-tabs-jump",n.tabPositionClass])},[e.createElementVNode("div",kr,[e.renderSlot(t.$slots,"default")])],2)}]]),br={name:"cvTabPane",emits:["click"],inject:["addChildComponents","clearChildClass"],data:()=>({isshow:!0,className:null}),props:{label:{type:String,default:""},current:{type:Boolean,default:!1},name:{type:String}},mounted(){this.addChildComponents(this),this.initCurrent()},methods:{initCurrent(){this.current&&this.handleClick()},handleClick(){this.clearChildClass(),this.className="active",this.$emit("click")}}},wr={key:1},vt=v(br,[["render",function(t,o,a,i,l,n){return e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cv-tab-pane",l.className]),onClick:o[0]||(o[0]=(...r)=>n.handleClick&&n.handleClick(...r))},[t.$slots.label?e.renderSlot(t.$slots,"label",{key:0}):(e.openBlock(),e.createElementBlock("span",wr,e.toDisplayString(a.label),1))],2)),[[e.vShow,l.isshow]])}]]);Ct.install=function(t){t.component(Ct.name,Ct)},vt.install=function(t){t.component(vt.name,vt)};const Vr={class:"cv-draw-captcha"},xr=["width","height"],yt=v({name:"cvDrawCaptcha",props:{modelValue:{type:[String,Number],default:"1234"},baseCode:{type:String,default:"1234567890ABCDEFGHGKMNPQRSTUVWXY"},fontSizeMin:{type:Number,default:25},fontSizeMax:{type:Number,default:30},backgroundColorMin:{type:Number,default:255},backgroundColorMax:{type:Number,default:255},colorMin:{type:Number,default:0},colorMax:{type:Number,default:160},lineColorMin:{type:Number,default:100},lineColorMax:{type:Number,default:255},dotColorMin:{type:Number,default:0},dotColorMax:{type:Number,default:255},contentWidth:{type:Number,default:112},contentHeight:{type:Number,default:31},refreshNum:{type:Number,default:1}},data:()=>({localCode:""}),watch:{modelValue(t){this.localCode=t,this.drawPic()},refreshNum(){this.refreshCode(),this.drawPic()}},mounted(){this.modelValue==""&&(this.refreshCode(),this.drawPic())},created(){this.localCode=this.modelValue},methods:{refreshCode(){this.localCode="",this.makeCode(this.baseCode,4),this.$emit("update:modelValue",this.localCode)},makeCode(t,o){for(let a=0;a<o;a++)this.localCode+=this.baseCode[this.randomNum(0,this.baseCode.length)]},randomNum:(t,o)=>Math.floor(Math.random()*(o-t)+t),randomColor(t,o){return"rgb("+this.randomNum(t,o)+","+this.randomNum(t,o)+","+this.randomNum(t,o)+")"},drawPic(){let t=document.getElementById("cv-draw-captcha").getContext("2d");t.textBaseline="bottom",t.fillStyle=this.randomColor(this.backgroundColorMin,this.backgroundColorMax),t.fillRect(0,0,this.contentWidth,this.contentHeight);for(let o=0;o<this.localCode.length;o++)this.drawText(t,this.localCode[o],o);this.drawLine(t),this.drawDot(t)},drawText(t,o,a){t.fillStyle=this.randomColor(this.colorMin,this.colorMax),t.font=this.randomNum(this.fontSizeMin,this.fontSizeMax)+"px SimHei";let i=(a+1)*(this.contentWidth/(this.localCode.length+1)),l=this.randomNum(this.fontSizeMax,this.contentHeight-5);var n=this.randomNum(-45,45);t.translate(i,l),t.rotate(n*Math.PI/180),t.fillText(o,0,0),t.rotate(-n*Math.PI/180),t.translate(-i,-l)},drawLine(t){for(let o=0;o<5;o++)t.strokeStyle=this.randomColor(this.lineColorMin,this.lineColorMax),t.beginPath(),t.moveTo(this.randomNum(0,this.contentWidth),this.randomNum(0,this.contentHeight)),t.lineTo(this.randomNum(0,this.contentWidth),this.randomNum(0,this.contentHeight)),t.stroke()},drawDot(t){for(let o=0;o<80;o++)t.fillStyle=this.randomColor(0,255),t.beginPath(),t.arc(this.randomNum(0,this.contentWidth),this.randomNum(0,this.contentHeight),1,0,2*Math.PI),t.fill()}}},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",Vr,[e.createElementVNode("canvas",{id:"cv-draw-captcha",width:a.contentWidth,height:a.contentHeight,onClick:o[0]||(o[0]=(...r)=>n.refreshCode&&n.refreshCode(...r))},null,8,xr)])}]]),kt=v({name:"cvDrawQrcode",data:()=>({})},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",null,"二维码")}]]);yt.install=function(t){t.component(yt.name,yt)},kt.install=function(t){t.component(kt.name,kt)};const Nr={name:"cvTagBase",mixins:[],components:{},emits:["update:modelValue"],props:{...k.ElTag.props,modelValue:{type:[Array,Object],default:()=>[]},closable:{type:Boolean,default:!1},disableTransitions:{type:Boolean,default:!1},effect:{type:String,default:"light"},color:{type:String,default:""},hit:{type:Boolean,default:!1},type:{type:[String],default:"primary"},size:{type:[String],default:"large"},disabled:{type:Boolean,default:!1}},watch:{modelValue(){this.localVal=this.modelValue},localVal(){this.$emit("update:modelValue",this.localVal)}},data(){return{localVal:this.modelValue}},methods:{addTag(){this.disabled||(this.localVal.push("新标签"),this.$nextTick(()=>{let t=this.localVal.length,o=this.$refs["newTag"+(t-1)][0],a=document.createRange();a.selectNodeContents(o),window.getSelection().removeAllRanges(),window.getSelection().addRange(a)}))},checkTag(t){if(this.disabled)return;let o=this.$refs[`newTag${t}`][0].innerText.trim();o.length==0?this.localVal.pop():this.localVal[t]=o},removeTag(t){this.disabled||this.localVal.splice(t,1)}}},Sr={class:"cv-tag-base"},Br=["contenteditable","onKeyup","onBlur"],bt=v(Nr,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-tag"),c=e.resolveComponent("cv-icons");return e.openBlock(),e.createElementBlock("div",Sr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.localVal,(h,d)=>(e.openBlock(),e.createBlock(r,e.mergeProps({class:"cv-tag-content"},{ref_for:!0},{closable:!a.disabled&&a.closable,disableTransitions:a.disableTransitions,effect:a.effect,type:a.type,color:a.color,hit:a.hit,size:a.size},{key:d,onClose:p=>n.removeTag(d),disabled:a.disabled}),{default:e.withCtx(()=>[e.createElementVNode("div",{class:"cv-tag-item",contenteditable:!a.disabled&&"plaintext-only",ref_for:!0,ref:`newTag${d}`,onKeyup:e.withKeys(p=>!a.disabled&&n.checkTag(d),["enter"]),onBlur:p=>!a.disabled&&n.checkTag(d)},e.toDisplayString(h),41,Br)]),_:2},1040,["onClose","disabled"]))),128)),a.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(c,{key:0,type:"ElIconCirclePlus",size:"16",onClick:o[0]||(o[0]=h=>n.addTag())}))])}]]);bt.install=function(t){t.component(bt.name,bt)};const Er={name:"cvTransferTable",props:{modelValue:{type:[Array],default:()=>[]},showQuery:{type:Boolean,default:!1},showPagination:{type:Boolean,default:!1},paginationCallBack:{type:Function,default:function(){return new Promise((t,o)=>{try{t({total:0,data:null})}catch{o()}})}},titleTexts:{type:Array,default:()=>["待选项","已选项"]},buttonTexts:{type:Array,default:()=>[]},queryTexts:{type:Array,default:()=>["查询","筛选"]},leftColumns:{type:Array,default:()=>[]},rightColumns:{type:Array,default(){}},minHeight:{type:String,default:"300px"},maxHeight:{type:String,default:"500px"},tableRowKey:{type:Function,default:t=>t&&t&&t.id}},data:()=>({leftTableData:[],rightTableData:[],pageIndex:1,pageSize:20,totalSize:0,leftSelection:[],rightSelection:[],leftQueryCondition:{},rightQueryCondition:{},rightConditionTemp:void 0}),watch:{modelValue(t){this.rightTableData=t}},created(){this.rightTableData=this.modelValue,this.handlePaginationCallBack()},computed:{hasButtonTexts(){return this.buttonTexts.length===2},buttonClasses(){return["transfer-button",{"is-with-texts":this.hasButtonTexts}]},disabledLeftButton(){return!this.leftSelection.some(t=>!this.rightTableData.some(o=>this.checkObjectIsEqual(t,o)))},calcRightTableData(){if(this.showQuery&&this.rightConditionTemp){const t=Object.keys(this.rightConditionTemp);return this.rightTableData.filter(o=>t.some(a=>{const i=o[a],l=this.rightConditionTemp[a].trim();return!i||String(i).indexOf(l)>-1}))}return this.rightTableData}},methods:{handleLeftSelectionChange(t){this.leftSelection=t},handleRightSelectionChange(t){this.rightSelection=t},handleLeftRowClick(t){this.rightTableData.some(o=>this.checkObjectIsEqual(o,t))||this.$refs.leftTable.toggleRowSelection(t)},handleRightRowClick(t){this.$refs.rightTable.toggleRowSelection(t)},handleSizeChange(t){this.pageSize=t,this.handlePaginationCallBack()},handleCurrentChange(t){this.pageIndex=t,this.handlePaginationCallBack()},handlePaginationCallBack(){if(this.showPagination&&this.paginationCallBack){const t={pageIndex:this.pageIndex,pageSize:this.pageSize,...this.leftQueryCondition};this.paginationCallBack.call(null,t).then(o=>{o&&Array.isArray(o.data)&&(this.leftTableData=o.data,this.totalSize=o.total),this.$nextTick(()=>{this.leftTableData.forEach(a=>{const i=this.rightTableData.some(l=>this.checkObjectIsEqual(l,a));this.$refs.leftTable.toggleRowSelection(a,i)})})})}},handleRowStyle({row:t}){return this.rightTableData.some(o=>this.checkObjectIsEqual(o,t))?{color:"blue"}:{}},handleSelectable(t){return!this.rightTableData.some(o=>this.checkObjectIsEqual(o,t))},addToRight(){for(const t of this.leftSelection)this.rightTableData.some(o=>this.checkObjectIsEqual(o,t))||this.rightTableData.push(t);this.$emit("update:modelValue",this.rightTableData)},addToLeft(){this.rightSelection.forEach(t=>{const o=this.rightTableData.findIndex(a=>this.checkObjectIsEqual(a,t));if(o!==-1){this.rightTableData.splice(o,1);const a=this.leftTableData.find(i=>this.checkObjectIsEqual(i,t));a&&this.$refs.leftTable.toggleRowSelection(a,!1)}}),this.$emit("update:modelValue",this.rightTableData)},onLeftQuerySubmit(){this.handlePaginationCallBack()},onRightQuerySubmit(){this.rightConditionTemp=JSON.parse(JSON.stringify(this.rightQueryCondition))},checkObjectIsEqual(t,o){return this.tableRowKey(t)===this.tableRowKey(o)},clear(){this.rightTableData=[],this.$refs.leftTable.clearSelection();for(const t in this.leftQueryCondition)this.leftQueryCondition[t]=void 0;for(const t in this.rightQueryCondition)this.rightQueryCondition[t]=void 0;this.pageIndex=1,this.handlePaginationCallBack()}}},Dr={class:"cv-transfer-table"},_r={class:"transfer-panel"},Tr={class:"transfer-panel-header"},Ir={key:0},Lr={style:{padding:"5px"}},Fr={class:"transfer-buttons"},Or={key:0,class:"button-text"},$r={key:0,class:"button-text"},zr={class:"transfer-panel"},Pr={class:"transfer-panel-header"},Mr={key:0},Hr={style:{padding:"5px"}},wt=v(Er,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-button"),c=e.resolveComponent("el-form-item"),h=e.resolveComponent("el-form"),d=e.resolveComponent("el-table-column"),p=e.resolveComponent("el-table"),u=e.resolveComponent("el-pagination"),m=e.resolveComponent("cv-icons");return e.openBlock(),e.createElementBlock("div",Dr,[e.createElementVNode("div",_r,[e.createElementVNode("p",Tr,[e.createElementVNode("span",null,e.toDisplayString(a.titleTexts&&a.titleTexts[0]),1),e.createElementVNode("span",null,e.toDisplayString(l.leftSelection.length)+"/"+e.toDisplayString(l.leftTableData.length),1)]),a.showQuery?(e.openBlock(),e.createElementBlock("div",Ir,[e.createVNode(h,{inline:!0,model:l.leftQueryCondition,class:"cv-transfer-form"},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"leftCondition",{scope:l.leftQueryCondition}),e.createVNode(c,null,{default:e.withCtx(()=>[e.createVNode(r,{type:"primary",onClick:o[0]||(o[0]=f=>n.onLeftQuerySubmit())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.queryTexts[0]),1)]),_:1})]),_:1})]),_:3},8,["model"])])):e.createCommentVNode("",!0),e.createVNode(p,{ref:"leftTable","max-height":a.maxHeight,height:a.minHeight,data:l.leftTableData,"row-key":a.tableRowKey,"row-style":n.handleRowStyle,onRowClick:n.handleLeftRowClick,onSelectionChange:n.handleLeftSelectionChange,border:"",stripe:""},{default:e.withCtx(()=>[e.createVNode(d,{width:"40px",type:"selection",selectable:n.handleSelectable},null,8,["selectable"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.leftColumns,f=>(e.openBlock(),e.createBlock(d,{prop:f.id,key:f.id,label:f.label,width:f.width},{default:e.withCtx(C=>[e.renderSlot(t.$slots,"default",{scope:{row:C.row,col:f}},()=>[e.createElementVNode("span",null,e.toDisplayString(C.row[f.id]),1)])]),_:2},1032,["prop","label","width"]))),128))]),_:3},8,["max-height","height","data","row-key","row-style","onRowClick","onSelectionChange"]),e.createElementVNode("div",Lr,[a.showPagination?(e.openBlock(),e.createBlock(u,{key:0,onSizeChange:n.handleSizeChange,onCurrentChange:n.handleCurrentChange,"current-page":l.pageIndex,"page-sizes":[10,20,50,100],"page-size":l.pageSize,"pager-count":5,total:l.totalSize,layout:"total, sizes, prev, pager, next"},null,8,["onSizeChange","onCurrentChange","current-page","page-size","total"])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Fr,[e.createVNode(r,{type:"primary",class:e.normalizeClass(n.buttonClasses),disabled:n.disabledLeftButton,onClick:n.addToRight},{default:e.withCtx(()=>[a.buttonTexts[0]!==void 0?(e.openBlock(),e.createElementBlock("span",Or,e.toDisplayString(a.buttonTexts[0]),1)):e.createCommentVNode("",!0),e.createVNode(m,{type:"ElIconArrowRight"})]),_:1},8,["class","disabled","onClick"]),e.createVNode(r,{type:"primary",class:e.normalizeClass(n.buttonClasses),disabled:l.rightSelection.length===0,onClick:n.addToLeft},{default:e.withCtx(()=>[e.createVNode(m,{type:"ElIconArrowLeft"}),a.buttonTexts[1]!==void 0?(e.openBlock(),e.createElementBlock("span",$r,e.toDisplayString(a.buttonTexts[1]),1)):e.createCommentVNode("",!0)]),_:1},8,["class","disabled","onClick"])]),e.createElementVNode("div",zr,[e.createElementVNode("p",Pr,[e.createElementVNode("span",null,e.toDisplayString(a.titleTexts&&a.titleTexts[1]),1),e.createElementVNode("span",null,e.toDisplayString(l.rightSelection.length)+"/"+e.toDisplayString(l.rightTableData.length),1)]),a.showQuery?(e.openBlock(),e.createElementBlock("div",Mr,[e.createVNode(h,{inline:!0,model:l.rightQueryCondition,class:"cv-transfer-form"},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"rightCondition",{scope:l.rightQueryCondition}),e.createVNode(c,null,{default:e.withCtx(()=>[e.createVNode(r,{type:"primary",onClick:o[1]||(o[1]=f=>n.onRightQuerySubmit())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.queryTexts[1]),1)]),_:1})]),_:1})]),_:3},8,["model"])])):e.createCommentVNode("",!0),e.createVNode(p,{ref:"rightTable","max-height":a.maxHeight,height:a.minHeight,data:n.calcRightTableData,"row-key":a.tableRowKey,onRowClick:n.handleRightRowClick,onSelectionChange:n.handleRightSelectionChange,border:"",stripe:""},{default:e.withCtx(()=>[e.createVNode(d,{width:"40px",type:"selection"}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.rightColumns||a.leftColumns,f=>(e.openBlock(),e.createBlock(d,{prop:f.id,key:f.id,label:f.label,width:f.width},{default:e.withCtx(C=>[e.renderSlot(t.$slots,"default",{scope:{row:C.row,col:f}},()=>[e.createElementVNode("span",null,e.toDisplayString(C.row[f.id]),1)])]),_:2},1032,["prop","label","width"]))),128))]),_:3},8,["max-height","height","data","row-key","onRowClick","onSelectionChange"]),e.createElementVNode("div",Hr,[a.showPagination?(e.openBlock(),e.createBlock(u,{key:0,total:l.rightTableData.length,layout:"total"},null,8,["total"])):e.createCommentVNode("",!0)])])])}]]);wt.install=function(t){t.component(wt.name,wt)};const Go={provide(){return{pageCurr:this.loadConfigSetting.pageCurr||1,pageLimit:this.loadConfigSetting.pageLimit||10}},props:{...k.ElTable.props,modelValue:{type:[Array,Object],default:()=>[]},headerCellStyle:{type:[Function,Object],default:()=>({})}},data:()=>({loadDataList:[]}),watch:{modelValue(t){this.loadDataList=t},loadDataList(t){this.$emit("update:modelValue",t)}},created(){this.loadDataList=this.modelValue},methods:{_getPageCurr(){return this.loadPageCurr},_getPageSize(){return this.loadPageLimit},handleCurrentChange(t){this.loadPageCurr=t,this.getData()},handleSizeChange(t){this.loadPageLimit=t,this.getData()}}},Ar={name:"cvTableBase",mixins:[oo,Go],props:{align:{type:String,default:"left"},showPagebreak:{type:[Boolean,String],default:!0},tablePagin:{type:Object,default:()=>({})},tableConfig:{type:Object,default:()=>({})},tableRefresh:{type:Number,default:()=>0}},data:()=>({paginationGroup:[10,20,30,50,100,200],paginationCount:7,searchData:{},tableConfDef:{}}),watch:{tableRefresh(t,o){this.initConfAll(),this.refresh()}},updated(){},created(){this.initConfAll(),this.getData()},mounted(){},methods:{getData(){this.loadDataList=[],this.loadGetData()},handleSelectionChange(t){this.$emit("selection-change",t)},initConfAll(){let t={};Object.assign(t,this.loadConfigDef,this.tableConfDef,this.tableConfig),this.loadPageCurr=t.pageCurr||1,this.loadPageLimit=t.pageLimit||this.paginationGroup[0],Object.assign(t.where,this.searchData),this.loadConfigSetting=t},searchSubmit(t){this.searchData=t||{},this.loadConfigSetting.isSkip?this.searchData:(this.page=1,this.getData())},searchReset(t){this.searchData={},this.page=1,this.getData()},refresh(t){this.getData()}}},jr={class:"cv-table-list"},Rr={key:0,class:"cv-tablie-list-page page"},Vt=v(Ar,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table"),c=e.resolveComponent("cv-icons"),h=e.resolveComponent("el-button"),d=e.resolveComponent("el-pagination"),p=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",jr,[e.withDirectives((e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{data:t.loadDataList,style:{width:"100%"},onSelectionChange:n.handleSelectionChange}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16,["data","onSelectionChange"])),[[p,t.loadDataLoading]]),a.showPagebreak?e.withDirectives((e.openBlock(),e.createElementBlock("div",Rr,[e.createVNode(h,{onClick:n.refresh,style:{float:"left",margin:"0 10px 0 0",padding:"5px 10px"}},{default:e.withCtx(()=>[e.createVNode(c,{type:"ElIconRefresh",size:"14"})]),_:1},8,["onClick"]),e.createVNode(d,{background:"",onSizeChange:t.handleSizeChange,onCurrentChange:t.handleCurrentChange,"pager-count":l.paginationCount,"page-sizes":l.paginationGroup,"current-page":t.loadPageCurr,"page-size":t.loadPageLimit,layout:"total, sizes, prev, pager, next, jumper",total:t.loadDataTotal},null,8,["onSizeChange","onCurrentChange","pager-count","page-sizes","current-page","page-size","total"])],512)),[[e.vShow,t.loadDataLoading===!1]]):e.createCommentVNode("",!0)])}]]),Ur={class:"cv-table-tree"},xt=v({name:"cvTableTree",mixins:[oo,Go],props:{tableConfig:{type:Object,default:()=>({})},tableRefresh:{type:Number,default:()=>0}},data:()=>({searchData:{},tableConfDef:{tablePrimary:"",childName:"children"},pager_count:7,page:1}),watch:{tableRefresh(t,o){this.refresh()}},created(){this.initConfAll(),this.getData()},mounted(){},methods:{getData(){this.loadDataList=[],this.loadGetData()},handleSelectionChange(t){this.$emit("selection-change",t)},initConfAll(){let t={};Object.assign(t,this.loadConfigDef,this.tableConfDef,this.tableConfig),Object.assign(t.where,this.searchData),this.loadConfigSetting=t},searchSubmit(t){this.searchData=t||{},this.loadConfigSetting.isSkip?this.searchData:(this.page=1,this.getData())},searchReset(t){this.searchData={},this.page=1,this.getData()},refresh(t){this.getData()}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table"),c=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",Ur,[e.withDirectives((e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{data:t.loadDataList,style:{width:"100%"},onSelectionChange:n.handleSelectionChange,"row-key":t.loadConfigSetting.tablePrimary,"tree-props":{children:t.loadConfigSetting.childName,hasChildren:"hasChildren"}}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16,["data","onSelectionChange","row-key","tree-props"])),[[c,t.loadDataLoading]])])}]]),Wr={name:"cvTableEditor",mixins:[oo,Go],props:{border:{type:[Boolean],default:!0},tableConfig:{type:[Array,Object],default:()=>({})}},data:()=>({mergeRules:{},apiFunc:null,tableConfDef:{},cell_click_index:null,cell_click_label:""}),watch:{},created(){this.loadConfigSetting=Object.assign({},this.tableConfDef,this.tableConfig)},mounted(){},methods:{cell_click(t,o,a,i){switch(this.cell_click_index=t.index,this.cell_click_label=o.label,o.label){case"taskid":case"taskname":this.cell_click_index=t.index,this.cell_click_label=o.label;break;default:return}},handleChangeTData(t){}}},Yr={class:"cv-table-editor"},Nt=v(Wr,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table"),c=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",Yr,[e.withDirectives((e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{data:t.loadDataList,style:{width:"100%"},"row-class-name":"cv-tbed-tr"}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16,["data"])),[[c,t.loadDataLoading]])])}]]),St=v({name:"cvTbColumnIndex",inject:{pageCurr:{default:1},pageLimit:{default:10}},props:{...k.ElTableColumn.props,fixed:{type:[String],default:"left"},align:{type:String,default:"center"},width:{type:[String,Number],default:55},continuity:{type:[Boolean,String],default:!1}},data:()=>({}),created(){},methods:{indexMethod(t){return this.continuity&&this.pageCurr&&this.pageLimit?t+1+(this.pageCurr-1)*this.pageLimit:t+1}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{type:"index",index:n.indexMethod}),null,16,["index"])}]]),Bt=v({name:"cvTbColumnCheck",props:{...k.ElTableColumn.props,fixed:{type:[String],default:"left"},align:{type:[String],default:"center"},width:{type:[String,Number],default:55}},data:()=>({}),created(){}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{type:"selection"}),null,16)}]]),Xr={name:"cvTbColumnText",props:{...k.ElTableColumn.props},data:()=>({}),created(){},methods:{getContentText(t){let o=t.row[this.prop];return this.formatter&&(o=this.formatter(t.row,t.column)),o}}},qr={style:{display:"contents"}},Et=v(Xr,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(c=>[e.createElementVNode("div",qr,e.toDisplayString(c.row[t.prop]),1)]),_:1},16)}]]),Kr={name:"cvTbColumnImg",props:{...k.ElTableColumn.props,imgWidth:{type:[String,Number],default:null},imgHeight:{type:[String,Number],default:null}},data:()=>({localImgWidth:"50px",localImgHeight:"50px",localImgArr:[],localImgOne:""}),created(){this.imgWidth&&(this.localImgWidth=this.imgWidth.indexOf("px")!==-1?this.imgWidth:this.imgWidth+"px"),this.imgHeight&&(this.localImgHeight=this.imgHeight.indexOf("px")!==-1?this.imgHeight:this.imgHeight+"px")},methods:{handleImgOne(t){let o=t[this.prop]||null;if(o){if(Object.prototype.toString.call(o)==="[object Array]")return o[0];if(Object.prototype.toString.call(o)==="[object String]")return o}},handleImgArr(t){let o=t[this.prop]||null;if(o){if(Object.prototype.toString.call(o)==="[object Array]")return o;if(Object.prototype.toString.call(o)==="[object String]")return[o]}},handleImgLeng(t){let o=t[this.prop]||null;return o?Object.prototype.toString.call(o)==="[object Array]"?o.length:Object.prototype.toString.call(o)==="[object String]"?1:void 0:0}}},Gr={key:0,class:"cv-table-column-img-mark"},Zr={class:"cv-table-column-img-text"},Dt=v(Kr,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-image"),c=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(c,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(h=>[e.createElementVNode("div",{class:"cv-table-column-img-box",style:e.normalizeStyle({width:l.localImgWidth,height:l.localImgHeight})},[e.createVNode(r,{style:e.normalizeStyle({width:l.localImgWidth,height:l.localImgHeight}),fit:"scale-down",lazy:"",src:n.handleImgOne(h.row),"preview-src-list":n.handleImgArr(h.row)},{error:e.withCtx(()=>o[0]||(o[0]=[e.createElementVNode("span",{class:"el-image__error cv-table-column-img-err"},[e.createTextVNode(" 暂无 "),e.createElementVNode("br"),e.createTextVNode(" 图片 ")],-1)])),_:2},1032,["style","src","preview-src-list"]),n.handleImgLeng(h.row)>1?(e.openBlock(),e.createElementBlock("p",Gr,[e.createElementVNode("span",Zr,e.toDisplayString(n.handleImgLeng(h.row))+"张",1)])):e.createCommentVNode("",!0)],4)]),_:1},16)}]]),_t=v({name:"cvTbColumnOpt",props:{...k.ElTableColumn.props,fixed:{type:[String],default:"right"},label:{type:[String],default:"操作"}},data:()=>({}),created(){}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(c=>[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps({row:c.row,$index:c.$index,scope:c})))]),_:3},16)}]]),Tt=v({name:"cvTbColumnBase",props:{...k.ElTableColumn.props,width:{type:[String,Number],default:""}},data:()=>({}),created(){}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(c=>[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps({row:c.row,$index:c.$index,scope:c})))]),_:3},16)}]]),It=v({name:"cvTbColumnExpand",props:{...k.ElTableColumn.props},data:()=>({}),created(){}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{type:"expand"}),{default:e.withCtx(c=>[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps({row:c.row,$index:c.$index,props:c})))]),_:3},16)}]]),Lt=v({name:"cvTbColumnEnum",props:{...k.ElTableColumn.props,dataLists:{type:[Object,Array],default:()=>({})}},data:()=>({}),created(){},methods:{dealTypeEnum(t){let o=Object.keys(this.dataLists);return t[this.prop]?this.dataLists[t[this.prop]]||"":this.dataLists[o[0]]||""}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(c=>[e.createElementVNode("span",null,e.toDisplayString(n.dealTypeEnum(c.row)),1)]),_:1},16)}]]),Qr={name:"cvTbEditSearch",props:{...k.ElTableColumn.props,modelValue:{type:[String],default:""},align:{type:[String],default:"left"}},data:()=>({isEditIndex:null,localVal:"",autocompleteAttr:{debounce:0},searchSett:{searchFunc:null,searchParam:{},searchMockData:null,searchField:{}},searchResList:[],searchCurrClass:"",searchCurrTbIndex:0,searchIsSelect:!1}),watch:{modelValue(t){},localVal(t){this.$emit("update:modelValue",t)}},directives:{edfocus:{mounted:t=>{}}},created(){},methods:{searchEdit(t,o){this.isEditIndex=o,this.$nextTick(()=>{this.$refs[`cv-tbce-autocomplete${o}`].focus()})},searchSave(t,o){this.isEditIndex=null},searchSelect(t,o,a){this.searchIsSelect=!0,this.localTableData[a]=Object.assign(this.localTableData[a],t),this.localTableData[a].row_num=1,t.row_attr?this.localTableData[a].row_name=t.row_name+`<br><span class="cv-tbce-showtext-attr">[ ${t.row_attr} ]</span>`:this.localTableData[a].row_name=t.row_name},searchFocus(t,o){this.searchCurrClass="cvtegac"+t,this.searchCurrTbIndex=t},searchBlur(t,o){this.searchIsSelect||(this.isEditIndex=null)},searchQuery(t,o){this.searchIsSelect=!1,this.searchResList=[];const a=this.searchSett;if(a.searchMockData!=null&&a.searchMockData){if(!(typeof a.searchMockData!="Array"&&typeof a.searchMockData!="object")){const i=this.sortOutData(a.searchMockData);this.tableData=i,this.$message({message:i.msg||"",type:"warning",duration:1300})}this.$nextTick(()=>{this.tableLoading=!1})}else a.searchFunc&&typeof a.searchFunc=="function"&&a.searchFunc({page:1,pagesize:20,keyword:t,...a.searchParam}).then(i=>{this.searchResList=[...i.data],this.searchParseData(t,o)})},searchParseData(t,o){var a=[],i=[];const l=this.searchSett;if(this.searchResList.length>0){for(let n in this.searchResList){let r=this.searchResList[n];const c=l.searchField.row_price;r.row_price=r[c];const h=l.searchField.row_stock;r.row_stock=r[h];const d=l.searchField.row_attr;r.row_attr=r[d];const p=l.searchField.row_name;r.row_name=r[p];const u=l.searchField.row_unit;r.row_unit=r[u];const m=l.searchField.row_id;r.row_id=r[m],r.value=r.row_name,i.push(r)}a=i}clearTimeout(this.timeout),this.timeout=setTimeout(()=>{o(a)},600)},inputSearchFilter:t=>o=>o.value.toLowerCase().indexOf(t.toLowerCase())===0,searchIconClick(){this.isEditIndex=null}}},Jr={class:"name"},es={class:"addr"},ts={class:"addr"},os={class:"droplist-item"},as={class:"name"},ls={key:0,class:"attr"},ns={class:"price"},is={class:"rest"},rs=["onClick"],Ft=v(Qr,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("ElIconCircleClose"),c=e.resolveComponent("el-icon"),h=e.resolveComponent("el-autocomplete"),d=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(d,e.mergeProps(t.$props,{"class-name":"cv-table-editor-search-column"}),{default:e.withCtx(p=>[l.isEditIndex==p.$index?(e.openBlock(),e.createBlock(h,e.mergeProps({key:0,ref:`cv-tbce-autocomplete${p.$index}`},l.autocompleteAttr,{modelValue:p.row[t.prop],"onUpdate:modelValue":u=>p.row[t.prop]=u,"popper-class":`cv-tbce-autocomplete cvtegac${p.$index}`,"fetch-suggestions":n.searchQuery,onSelect:u=>n.searchSelect(u,p.row,p.$index),onFocus:u=>n.searchFocus(p.$index,u),onBlur:u=>n.searchBlur(p.row,p.$index)}),{suffix:e.withCtx(()=>[e.createVNode(c,{onClick:u=>n.searchIconClick(p.row,p.$index)},{default:e.withCtx(()=>[e.createVNode(r)]),_:2},1032,["onClick"])]),default:e.withCtx(({item:u})=>[e.renderSlot(t.$slots,"default",{item:u},()=>[e.createElementVNode("div",Jr,e.toDisplayString(u.row_name),1),e.createElementVNode("span",es,"价格:"+e.toDisplayString(u.row_price),1),e.createElementVNode("span",ts,e.toDisplayString(u.row_rest),1),e.createElementVNode("div",os,[e.createElementVNode("div",as,[e.createTextVNode(e.toDisplayString(u.row_name)+" ",1),u.row_attr?(e.openBlock(),e.createElementBlock("div",ls,"[ "+e.toDisplayString(u.row_attr)+"]",1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",ns,"¥ "+e.toDisplayString(u.row_price),1),e.createElementVNode("div",is,e.toDisplayString(u.attr_stock),1)])])]),_:2},1040,["modelValue","onUpdate:modelValue","popper-class","fetch-suggestions","onSelect","onFocus","onBlur"])):(e.openBlock(),e.createElementBlock("span",{key:1,class:"showtext",onClick:u=>n.searchEdit(p.row,p.$index)},e.toDisplayString(p.row[t.prop]),9,rs))]),_:3},16)}]]),Ot=v({name:"cvTbEditOpt",props:{tableData:{type:[Array],default:()=>[]},...k.ElTableColumn.props,label:{type:[String],default:"操作"},align:{type:[String],default:"center"},width:{type:[String],default:"100"},fixed:{type:[String],default:"left"},btnAdd:{type:[Boolean,String],default:!0},btnDel:{type:[Boolean,String],default:!0}},data:()=>({localTbData:[]}),watch:{tableData(t){this.localTbData=t}},created(){this.localTbData=this.tableData},methods:{optHdDelete(t,o){this.localTbData.splice(t,1),this.localTbData.length<1&&this.optHdAdd()},optHdAdd(){this.localTbData.push({})}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("cv-icons"),c=e.resolveComponent("el-button"),h=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(h,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(d=>[a.btnAdd?(e.openBlock(),e.createBlock(c,{key:0,plain:"",style:{padding:"5px",width:"26px",height:"26px"},onClick:o[0]||(o[0]=p=>n.optHdAdd())},{default:e.withCtx(()=>[e.createVNode(r,{type:"ElIconPlus"})]),_:1})):e.createCommentVNode("",!0),a.btnDel?(e.openBlock(),e.createBlock(c,{key:1,plain:"",style:{padding:"5px",width:"26px",height:"26px"},onClick:p=>n.optHdDelete(d.$index,d.row)},{default:e.withCtx(()=>[e.createVNode(r,{type:"ElIconClose"})]),_:2},1032,["onClick"])):e.createCommentVNode("",!0)]),_:1},16)}]]),ss={name:"cvTbEditText",props:{...k.ElTableColumn.props,width:{type:[String,Number],default:""},editAttr:{type:[Object],default:()=>({placeholder:"请输入"})},editClearable:{type:[Boolean],default:!0},editStyle:{type:[Object],default:()=>({"--el-input-border":0,"--el-input-border-radius":0,"--el-input-height":"36px"})},editClass:{type:[Object],default:()=>({})},editChange:{type:[Function],default:()=>{}},editFormatter:{type:[Function],default:()=>{}},toFixed:{type:[String,Number],default:""}},data:()=>({currValue:"",isEditIndex:null,isErrIndex:[]}),directives:{edfocus:{mounted:t=>{t.querySelector("input").focus()},inserted:function(t){t.querySelector("input").focus()}}},created(){},methods:{textIsError(t){return this.isErrIndex&&this.isErrIndex[t]&&this.isErrIndex[t][this.prop]},textHdEdit(t,o){this.isEditIndex=o},textHdClear(t,o){},textHdSave(t,o){this.isEditIndex=null;let a=t[this.prop];if(this.toFixed!=""){let i=parseInt(this.toFixed);isNaN(a)||(t[this.prop]=parseFloat(a).toFixed(i))}else t[this.prop]=a}},render22(t,o){let a=this;return t("el-table-column",{props:{...this.$props},scopedSlots:{default:i=>{this.currValue=i.row[this.prop];let l=i.$index;return this.isEditIndex==l?t("el-input",{props:{style:this.editStyle,class:this.editClass},domProps:{value:this.currValue},props:{placeholder:this.placeholder,value:this.param},nativeOn:{keyup:n=>{n.keyCode===13&&(this.$emit("update:param",n.target.value),this.callback&&this.callback())}},on:{blur:n=>{this.$emit("update:param",n.target.value),this.callback&&this.callback()},input:function(n){a.currValue=n||n.target.value},blur:n=>{this.isEditIndex=null,a.currValue=n||n.target.value}}},this.currValue):t("span",{class:{showtext:!0},on:{click:()=>{this.isEditIndex=l}}},this.currValue)}}})}},cs=["onClick"],$t=v(ss,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-input"),c=e.resolveComponent("el-table-column"),h=e.resolveDirective("edfocus");return e.openBlock(),e.createBlock(c,e.mergeProps(t.$props,{"class-name":"cv-table-editor-text-column"}),{default:e.withCtx(d=>[l.isEditIndex!=d.$index||a.editAttr.disabled?(e.openBlock(),e.createElementBlock("span",{key:1,class:"showtext",onClick:p=>n.textHdEdit(d.row,d.$index)},e.toDisplayString(d.row[t.prop]),9,cs)):e.withDirectives((e.openBlock(),e.createBlock(r,e.mergeProps({key:0},a.editAttr,{clearable:a.editClearable,style:a.editStyle,class:a.editClass,modelValue:d.row[t.prop],"onUpdate:modelValue":p=>d.row[t.prop]=p,onBlur:e.withModifiers(p=>n.textHdSave(d.row,d.$index),["prevent"]),onClear:p=>n.textHdClear(d.row,d.$index)}),null,16,["clearable","style","class","modelValue","onUpdate:modelValue","onBlur","onClear"])),[[h]])]),_:1},16)}]]),zt=v({name:"cvTbEditRadio",props:{...k.ElTableColumn.props,editAttr:{type:[Object],default:()=>({})},editStyle:{type:[Object],default:()=>({})},editClass:{type:[Object],default:()=>({})},dataLists:{type:[Object,Array],default:()=>({})},dataField:{type:Object,default:()=>({label:"label",value:"value"})},editChange:{type:[Function],default:()=>{}},editFormatter:{type:[Function],default:()=>{}}},data:()=>({}),created(){}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-radio"),c=e.resolveComponent("el-radio-group"),h=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(h,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(d=>[e.createVNode(c,e.mergeProps({style:a.editStyle,class:a.editClass,modelValue:d.row[t.prop],"onUpdate:modelValue":p=>d.row[t.prop]=p},a.editAttr),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.dataLists,(p,u)=>(e.openBlock(),e.createBlock(r,{key:u,label:p[a.dataField.label],value:p[a.dataField.value]},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p[a.dataField.label]),1)]),_:2},1032,["label","value"]))),128))]),_:2},1040,["style","class","modelValue","onUpdate:modelValue"])]),_:1},16)}]]),Pt=v({name:"cvTbEditCheckbox",props:{...k.ElTableColumn.props,editAttr:{type:[Object],default:()=>({})},editStyle:{type:[Object],default:()=>({})},editClass:{type:[Object],default:()=>({})},dataLists:{type:[Object,Array],default:()=>({})},dataField:{type:Object,default:()=>({label:"label",value:"value"})},editChange:{type:[Function],default:()=>{}},editFormatter:{type:[Function],default:()=>{}}},data:()=>({localVal:[]}),created(){},methods:{handleParseValue(t){this.localVal=[]}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-checkbox"),c=e.resolveComponent("el-checkbox-group"),h=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(h,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(d=>[d.row[t.prop]?(e.openBlock(),e.createBlock(c,e.mergeProps({key:0,style:a.editStyle,class:a.editClass,modelValue:d.row[t.prop],"onUpdate:modelValue":p=>d.row[t.prop]=p},a.editAttr),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.dataLists,(p,u)=>(e.openBlock(),e.createBlock(r,{key:u,label:p[a.dataField.label],value:p[a.dataField.value]},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p[a.dataField.label]),1)]),_:2},1032,["label","value"]))),128))]),_:2},1040,["style","class","modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)]),_:1},16)}]]),Mt=v({name:"cvTbEditSelect",props:{...k.ElTableColumn.props,editAttr:{type:[Object],default:()=>({})},editStyle:{type:[Object],default:()=>({})},editClass:{type:[Object],default:()=>({})},dataLists:{type:[Object,Array],default:()=>({})},dataField:{type:Object,default:()=>({label:"label",value:"value"})},editChange:{type:[Function],default:()=>{}},editFormatter:{type:[Function],default:()=>{}}},data:()=>({}),created(){}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-option"),c=e.resolveComponent("el-select"),h=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(h,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(d=>[e.createVNode(c,e.mergeProps({style:a.editStyle,class:a.editClass,modelValue:d.row[t.prop],"onUpdate:modelValue":p=>d.row[t.prop]=p},a.editAttr),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.dataLists,(p,u)=>(e.openBlock(),e.createBlock(r,{key:u,label:p[a.dataField.label],value:p[a.dataField.value]},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p[a.dataField.label]),1)]),_:2},1032,["label","value"]))),128))]),_:2},1040,["style","class","modelValue","onUpdate:modelValue"])]),_:1},16)}]]);Vt.install=function(t){t.component(Vt.name,Vt)},xt.install=function(t){t.component(xt.name,xt)},Nt.install=function(t){t.component(Nt.name,Nt)},St.install=function(t){t.component(St.name,St)},Bt.install=function(t){t.component(Bt.name,Bt)},Et.install=function(t){t.component(Et.name,Et)},Dt.install=function(t){t.component(Dt.name,Dt)},_t.install=function(t){t.component(_t.name,_t)},Tt.install=function(t){t.component(Tt.name,Tt)},It.install=function(t){t.component(It.name,It)},Lt.install=function(t){t.component(Lt.name,Lt)},Ft.install=function(t){t.component(Ft.name,Ft)},Ot.install=function(t){t.component(Ot.name,Ot)},$t.install=function(t){t.component($t.name,$t)},zt.install=function(t){t.component(zt.name,zt)},Pt.install=function(t){t.component(Pt.name,Pt)},Mt.install=function(t){t.component(Mt.name,Mt)};const ds={width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},hs=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("svg",ds,o[0]||(o[0]=[e.createElementVNode("rect",{width:"12",height:"12",rx:"2",fill:"#86909C"},null,-1),e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.98095 5.49307L8.22012 3.25389C8.28521 3.18881 8.39074 3.18881 8.45582 3.25389L8.69153 3.4896C8.75661 3.55468 8.75661 3.66021 8.69153 3.7253L6.45235 5.96447L8.69153 8.20364C8.75661 8.26873 8.75661 8.37426 8.69153 8.43934L8.45582 8.67505C8.39074 8.74013 8.28521 8.74013 8.22012 8.67505L5.98095 6.43587L3.74178 8.67505C3.67669 8.74013 3.57116 8.74013 3.50608 8.67505L3.27037 8.43934C3.20529 8.37426 3.20529 8.26873 3.27037 8.20364L5.50954 5.96447L3.27037 3.7253C3.20529 3.66021 3.20529 3.55468 3.27037 3.4896L3.50608 3.25389C3.57116 3.18881 3.67669 3.18881 3.74178 3.25389L5.98095 5.49307Z",fill:"white"},null,-1)]))}]]),ps={width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"icon"},ms=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("svg",ps,o[0]||(o[0]=[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.00002 0.666504C12.0501 0.666504 15.3334 3.94975 15.3334 7.99984C15.3334 12.0499 12.0501 15.3332 8.00002 15.3332C3.94993 15.3332 0.666687 12.0499 0.666687 7.99984C0.666687 3.94975 3.94993 0.666504 8.00002 0.666504ZM8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2ZM10.6667 5.66667V7.66667H9.33333V5.66667H10.6667ZM6.66667 5.66667V7.66667H5.33333V5.66667H6.66667ZM10.0767 9.33333H11.0495C11.1804 9.33333 11.2866 9.43951 11.2866 9.57048C11.2866 9.60754 11.2779 9.64409 11.2612 9.67718L11.244 9.71053C10.6294 10.8739 9.40726 11.6667 7.99998 11.6667C6.61523 11.6667 5.40977 10.8991 4.7859 9.76612L4.73786 9.67593C4.67845 9.56052 4.72385 9.4188 4.83926 9.35939C4.87253 9.34226 4.90941 9.33333 4.94683 9.33333H5.92347C6.02396 9.33332 6.11908 9.37865 6.18238 9.4567C6.26207 9.55496 6.32833 9.62955 6.38117 9.68046C6.80074 10.0847 7.37133 10.3333 7.99998 10.3333C8.63289 10.3333 9.20694 10.0814 9.62728 9.67224C9.67791 9.62296 9.74135 9.55121 9.8176 9.45698C9.88089 9.37877 9.97611 9.33333 10.0767 9.33333Z"},null,-1)]))}]]),us={class:"comment-common-icon"},gs=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("i",us,o[0]||(o[0]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:""},[e.createElementVNode("path",{d:"M4.88933 0.613974C4.92947 0.616946 4.96831 0.629568 5.00253 0.650767C6.67348 1.68589 7.55141 3.13884 7.63632 5.00962C7.947 5.00962 8.2245 4.65999 8.46882 3.96072L8.49487 3.88447C8.53862 3.75351 8.68025 3.68282 8.8112 3.72656C8.83398 3.73417 8.85554 3.74502 8.87522 3.75878C9.96316 4.5193 10.5048 5.50231 10.5 6.70782C10.4999 6.73762 10.4982 6.76675 10.495 6.7952C10.4985 6.86294 10.5 6.93131 10.5 7.00005C10.5 9.48533 8.48528 11.5 6 11.5C3.51472 11.5 1.5 9.48533 1.5 7.00005C1.5 6.90255 1.5031 6.80578 1.50921 6.70983C1.5062 6.70917 1.5031 6.70849 1.5 6.70782C1.50864 6.60849 1.52139 6.50994 1.53824 6.41219C1.54515 6.35775 1.55321 6.30373 1.56222 6.25003L1.57017 6.24983C1.7622 5.3813 2.28426 4.57601 3.13635 3.83394C4.00892 3.07405 4.50079 2.11523 4.61198 0.957499L4.62156 0.844839C4.63175 0.707146 4.75163 0.603784 4.88933 0.613974Z"})],-1)]))}]]),fs={width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"icon"},Cs=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("svg",fs,o[0]||(o[0]=[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14 1.3335C14.3514 1.3335 14.6394 1.60546 14.6648 1.95041L14.6666 2.00016V14.0002C14.6666 14.3516 14.3947 14.6396 14.0497 14.665L14 14.6668H1.99998C1.64853 14.6668 1.36059 14.3949 1.33514 14.0499L1.33331 14.0002V2.00016C1.33331 1.64871 1.60527 1.36077 1.95023 1.33532L1.99998 1.3335H14ZM13.3333 2.66618H2.66664V13.3328H13.3333V2.66618ZM11.9219 6.7879C11.9719 6.83791 12 6.90574 12 6.97647V11.7993C12 11.9098 11.9104 11.9993 11.8 11.9993H6.81615C6.7975 11.9993 6.77945 11.9968 6.76232 11.992L3.91042 11.9847C3.79996 11.9844 3.71063 11.8947 3.7109 11.7842C3.71102 11.7313 3.73209 11.6807 3.76948 11.6433L6.52468 8.88807C6.62882 8.78393 6.79766 8.78393 6.9018 8.88807L8.17297 10.1593L11.5447 6.7879C11.6489 6.68376 11.8177 6.68376 11.9219 6.7879ZM5.99997 3.99951V5.99951H3.99997V3.99951H5.99997Z"},null,-1)]))}]]),vs={class:"comment-common-icon"},ys=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("i",vs,o[0]||(o[0]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M586.624 234.624a74.624 74.624 0 1 1-149.184 0 74.624 74.624 0 0 1 149.12 0z m0 554.624a74.624 74.624 0 1 1-149.248 0 74.624 74.624 0 0 1 149.248 0zM512 586.624a74.624 74.624 0 1 0 0-149.248 74.624 74.624 0 0 0 0 149.248z",fill:"currentColor"})],-1)]))}]]),ks={class:"comment-common-icon",style:{color:"#1e80ff"}},bs=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("i",ks,o[0]||(o[0]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1534"},[e.createElementVNode("path",{d:"M668.928 166.912c-20.48-53.504-47.9744-84.7872-82.0224-94.9248-33.5872-10.0352-61.952 4.096-76.032 13.9776-27.5456 19.3536-41.216 49.664-50.0224 74.1376-3.3792 9.3184-6.4512 19.0976-9.216 27.9552l-2.6624 8.3968a227.8912 227.8912 0 0 1-10.3936 27.9552c-25.344 52.9408-47.4112 84.5312-66.7648 104.96-18.944 19.968-36.4544 30.464-55.1936 39.7824a45.3632 45.3632 0 0 0-25.088 40.5504l-0.1024 480.7168c0 24.9344 20.2752 45.2096 45.2096 45.2096h423.0656c21.7088 0 38.144-6.912 50.0224-16.9984a72.192 72.192 0 0 0 14.4896-16.896l0.2048-0.2048 0.0512-0.1536 0.8192-1.024 1.2288-1.8944c39.424-63.7952 66.7648-114.688 88.2176-175.616 24.4224-69.4784 36.8128-129.6896 42.0352-176.64 5.12-45.6704 3.7888-81.664-1.5872-101.376a77.9776 77.9776 0 0 0-45.568-52.3264 116.5824 116.5824 0 0 0-45.4144-8.6016l-192.8192-2.6624c28.1088-115.0976 10.0864-181.6064-2.4576-214.3744zM64.0512 413.9008a45.2096 45.2096 0 0 1 45.1584-47.36H176.128c24.9344 0 45.2096 20.2752 45.2096 45.2096v480.6144a45.2096 45.2096 0 0 1-45.2096 45.2096h-44.288a45.2096 45.2096 0 0 1-45.1584-43.0592L64 413.952z","p-id":"1535"})],-1)]))}]]),ws={class:"comment-common-icon"},Vs=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("i",ws,o[0]||(o[0]=[e.createElementVNode("svg",{t:"1650360973068",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1168",width:"200",height:"200"},[e.createElementVNode("path",{d:"M547.968 138.88c6.656-4.672 14.08-6.976 20.48-5.056 6.08 1.792 22.848 10.752 40.192 56.128 8.576 22.4 27.264 81.536-5.632 197.504a45.44 45.44 0 0 0 42.88 57.984l217.6 3.008h0.448a53.12 53.12 0 0 1 20.096 3.328 16.256 16.256 0 0 1 5.568 3.648 14.464 14.464 0 0 1 3.264 6.4c2.176 7.808 4.608 33.984-0.256 77.248-4.672 41.984-15.936 97.408-38.784 162.368-19.136 54.336-43.52 100.48-81.472 161.792a56.384 56.384 0 0 0-1.664 2.496l-0.128 0.128-1.408 2.112a7.872 7.872 0 0 1-1.28 1.472 3.84 3.84 0 0 1-1.28 0.64 20.48 20.48 0 0 1-6.848 0.96H356.032V421.44c19.712-10.624 40.704-24.576 62.592-47.616 25.472-26.88 51.008-64.768 78.208-121.6 5.568-11.584 9.856-24.384 13.632-36.032l3.072-9.856c2.688-8.448 5.184-16.384 8.064-24.32 8.064-22.4 16.128-36.032 26.368-43.136z m120.96 27.968c-20.48-53.44-48-84.736-81.984-94.912-33.6-9.984-61.952 4.16-76.032 14.08-27.584 19.264-41.28 49.6-50.048 74.048-3.392 9.344-6.464 19.2-9.216 27.968l-2.688 8.448a227.84 227.84 0 0 1-10.432 27.904c-25.28 52.928-47.36 84.544-66.752 104.96-18.944 19.968-36.48 30.464-55.168 39.808a45.376 45.376 0 0 0-25.088 40.576l-0.064 480.64c0 24.96 20.224 45.248 45.184 45.248h423.04c21.76 0 38.144-6.912 50.048-16.96a71.808 71.808 0 0 0 14.528-16.896l0.128-0.256 0.128-0.128 0.832-0.96 1.152-1.92c39.424-63.872 66.816-114.688 88.256-175.68a810.24 810.24 0 0 0 42.048-176.64c5.12-45.632 3.776-81.664-1.6-101.376a77.952 77.952 0 0 0-45.568-52.288 116.544 116.544 0 0 0-45.44-8.64l-192.768-2.688c28.096-115.072 10.048-181.568-2.496-214.336z m-604.864 247.04a45.184 45.184 0 0 1 45.12-47.296h67.008c24.96 0 45.184 20.288 45.184 45.248v480.64c0 24.96-20.224 45.12-45.184 45.12H131.84a45.184 45.184 0 0 1-45.12-43.072l-22.656-480.64z","p-id":"1169"})],-1)]))}]]),xs={width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:""},Ns=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("svg",xs,o[0]||(o[0]=[e.createElementVNode("path",{"data-v-d6f79dbc":"","fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.99976 7.93206L10.0656 3.86619C10.1633 3.76856 10.3215 3.76856 10.4192 3.86619L10.7727 4.21975C10.8704 4.31738 10.8704 4.47567 10.7727 4.5733L6.35331 8.99272C6.15805 9.18798 5.84147 9.18798 5.6462 8.99272L1.22679 4.5733C1.12916 4.47567 1.12916 4.31738 1.22679 4.21975L1.58034 3.86619C1.67797 3.76856 1.83626 3.76856 1.93389 3.86619L5.99976 7.93206Z"},null,-1)]))}]]),Ss={class:"comment-common-icon"},Bs=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("i",Ss,o[0]||(o[0]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:""},[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.99951 0.5C9.03708 0.5 11.4995 2.96243 11.4995 6C11.4995 9.03757 9.03708 11.5 5.99951 11.5C2.96195 11.5 0.499512 9.03757 0.499512 6C0.499512 2.96243 2.96195 0.5 5.99951 0.5ZM6.25 3.49988C6.38807 3.49988 6.5 3.61181 6.5 3.74988V5.49988H8.25C8.38807 5.49988 8.5 5.61181 8.5 5.74988V6.24988C8.5 6.38795 8.38807 6.49988 8.25 6.49988H5.75C5.61193 6.49988 5.5 6.38795 5.5 6.24988V3.74988C5.5 3.61181 5.61193 3.49988 5.75 3.49988H6.25Z"})],-1)]))}]]),Es={class:"comment-common-icon"},Ds=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("i",Es,o[0]||(o[0]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1320",width:"200",height:"200"},[e.createElementVNode("path",{d:"M147.264 647.296V220.928c0-49.536 40.128-89.728 89.6-89.728H793.6c49.536 0 89.728 40.192 89.728 89.728v426.368c0 49.536-40.128 89.728-89.6 89.728h-145.216a47.04 47.04 0 0 0-28.16 9.408l-194.56 145.792a3.392 3.392 0 0 1-5.12-1.984l-26.752-116.672a47.04 47.04 0 0 0-45.824-36.544H236.992a89.728 89.728 0 0 1-89.728-89.728zM236.864 64A156.928 156.928 0 0 0 80 220.928l0.064 426.368a156.928 156.928 0 0 0 156.928 156.928h94.976l23.232 101.312 0.064 0.448a70.592 70.592 0 0 0 109.696 40.832l190.208-142.592H793.6a156.928 156.928 0 0 0 156.928-156.928l-0.064-426.368A156.928 156.928 0 0 0 793.536 64H236.928z m69.44 442.496a65.344 65.344 0 1 0 0-130.752 65.344 65.344 0 0 0 0 130.752z m268.8-65.344a65.344 65.344 0 1 1-130.752 0 65.344 65.344 0 0 1 130.752 0z m138.368 65.344a65.344 65.344 0 1 0 0-130.752 65.344 65.344 0 0 0 0 130.752z","p-id":"1321"})],-1)]))}]]),_s={class:"cv-comment-emoji"},Ts={class:"face-tooltip-head select-none"},Is=["onClick"],Ls=["src"],Fs={class:"emoji-body select-none"},Os={style:{padding:"0 5px"}},$s=["onClick"],zs={class:"emoji-btn select-none"},Ps={key:0},Ms=v(Object.assign({name:"CompInputEmoji"},{__name:"input-emoji",props:{emoji:{faceList:[],emojiList:[],allEmoji:{}},placement:"bottom"},emits:["addEmoji"],setup(t,{emit:o}){const a=t,i=e.ref(0),l=e.ref(0),n=e.ref(new Array(2)),{emojiList:r,faceList:c}=a.emoji;function h(){n.value[0]=r[0]}return(d,p)=>(e.openBlock(),e.createElementBlock("div",_s,[e.createVNode(e.unref(k.ElPopover),{placement:t.placement,"popper-class":"emoji-popover",width:250,trigger:"click",onBeforeEnter:h},{reference:e.withCtx(()=>[e.createElementVNode("div",zs,[d.$slots.default?e.renderSlot(d.$slots,"default",{key:1},void 0,!0):(e.openBlock(),e.createElementBlock("div",Ps,[e.createVNode(e.unref(ms)),p[0]||(p[0]=e.createElementVNode("span",null,"表情",-1))]))])]),default:e.withCtx(()=>[e.createElementVNode("div",Ts,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),(u,m)=>(e.openBlock(),e.createElementBlock("label",{key:m,class:e.normalizeClass(i.value==m?"active":""),onClick:f=>function(C){switch(i.value=C,C){case 0:l.value=0;break;case 1:l.value=-50,n.value[1]=r[1]}}(m)},[e.createElementVNode("img",{src:u,alt:""},null,8,Ls)],10,Is))),128))]),e.createElementVNode("div",Fs,[e.createElementVNode("div",{class:"emjio-container",style:e.normalizeStyle({transform:`translateX(${l.value}%)`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(u,m)=>(e.openBlock(),e.createElementBlock("div",{key:m,class:"emoji-wrapper"},[e.createVNode(e.unref(k.ElScrollbar),null,{default:e.withCtx(()=>[e.createElementVNode("div",Os,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u,(f,C)=>(e.openBlock(),e.createElementBlock("span",{key:C,class:"emoji-item",onClick:g=>d.$emit("addEmoji",C)},[e.createVNode(e.unref(k.ElImage),{src:f,title:String(C),class:"emoji",style:{width:"24px",height:"24px",margin:"5px"},lazy:""},null,8,["src","title"])],8,$s))),128))])]),_:2},1024)]))),128))],4)])]),_:3},8,["placement"])]))}}),[["__scopeId","data-v-2fb59975"]]),Hs={class:"cv-comment-editor"},As=["placeholder","innerHTML"],js=["src"],Rs=["onClick"],Us={key:0,class:"cv-comment-editor__action"},Ws={__name:"input-box",props:{placeholder:"",contentBtn:"",parentId:"",reply:""},emits:["hide","close"],setup(t,{expose:o,emit:a}){const i=t,l=e.ref(""),n=e.ref(),r=e.ref(!1),c=e.ref(!1),h=e.ref(),d=e.ref(!0),p=e.ref(),u=e.ref(),m=e.ref([]),f=e.ref([]),C=e.reactive({imgLength:0}),g=64,y=e.ref(),b=e.ref(!1),w=e.ref(),V=e.computed(()=>g+"px"),B=e.computed(()=>"8px 12px"),S=a,{upload:I,submit:L,focus:z}=e.inject("InjectInputBox"),ne=e.inject("InjectionEmojiApi");function ea(){L({content:i.reply?`回复 <span style="color: var(--cv-color-success-dark-2);">@${i.reply.user.username}:</span> ${l.value}`:l.value,parentId:le(i.parentId,null),reply:i.reply,files:f.value,clear:()=>{h.value&&(h.value.innerHTML="",l.value=h.value.innerHTML,r.value=!1),m.value.length=0,f.value=[],d.value=!0,S("close")}})}function Gl(E){oe(l.value)&&!C.imgLength&&(c.value=!1,S("hide",E))}function Zl(E){b.value=!0,r.value=!0,c.value=!0,e.nextTick(()=>{p.value=document.querySelector("div[id^='el-popper-container']")}),z()}function Ql(E){var N,_;y.value=(N=window.getSelection())==null?void 0:N.getRangeAt(0),(_=h.value)!=null&&_.innerHTML||(r.value=!1),b.value=!1}function Jl(E){const{innerHTML:N}=(E==null?void 0:E.target)||E;l.value=N||"",oe(l.value.replace(/ |<br>| /g,""))?d.value=!0:d.value=!1}function ta(){e.nextTick(()=>{var E;(E=h.value)==null||E.focus()})}function en(E){E.ctrlKey&&E.key=="Enter"&&(oe(l.value.replace(/ |<br>| /g,""))?k.ElMessage({message:"内容不能为空",type:"info"}):ea())}function tn(E){var F;m.value.length=0,f.value.length=0;const N=(F=u.value)==null?void 0:F.files;if(C.imgLength=le(N==null?void 0:N.length,0),N)for(let T=0;T<N.length;T++){let Z=N[T].name,ie=(_=N[T],window.URL?window.URL.createObjectURL(_):window.webkitURL?window.webkitURL.createObjectURL(_):"");f.value.push(N[T]),Kn(Z)?m.value.push(ie):k.ElMessage({type:"warn",message:"请选择图片类型文件!",duration:2500})}var _}return e.watch(()=>l.value,E=>{b.value||(n.value=E)}),e.onMounted(()=>{var E;(E=h.value)==null||E.addEventListener("keyup",N=>{const _=N.target;_.innerHTML=="<br>"&&(_.innerHTML="")})}),o({focus:()=>ta()}),(E,N)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",Hs,[e.createElementVNode("div",{class:e.normalizeClass(["cv-comment-editor__box",{active:r.value,"input-active":c.value}])},[e.createElementVNode("div",{ref_key:"editorRef",ref:h,class:"rich-input",contenteditable:"true",placeholder:i.placeholder,onFocus:Zl,onInput:Jl,onBlur:Ql,onKeydown:e.withKeys(en,["enter"]),innerHTML:n.value,style:e.normalizeStyle({minHeight:V.value,padding:B.value})},null,44,As),e.createElementVNode("div",{ref_key:"imageRef",ref:w,class:"image-preview-box"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(_,F)=>(e.openBlock(),e.createElementBlock("div",{key:F,class:"image-preview"},[e.createElementVNode("img",{src:_,alt:""},null,8,js),e.createElementVNode("div",{class:"clean-btn",onClick:T=>{var ie;return Z=F,void((ie=m==null?void 0:m.value)==null?void 0:ie.splice(Z,1));var Z}},[e.createVNode(e.unref(hs))],8,Rs)]))),128))],512)],2),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[c.value?(e.openBlock(),e.createElementBlock("div",Us,[e.createElementVNode("div",null,[e.createVNode(Ms,{emoji:e.unref(ne),onAddEmoji:N[0]||(N[0]=_=>function(F){var Z;let T=window.getSelection();T&&(T.removeAllRanges(),y.value||(ta(),y.value=T.getRangeAt(0)),y.value.deleteContents(),y.value.insertNode(y.value.createContextualFragment(F)),y.value.collapse(!1),T.addRange(y.value),l.value=((Z=h==null?void 0:h.value)==null?void 0:Z.innerHTML)||"",oe(l.value.replace(/ |<br>| /g,""))?d.value=!0:d.value=!1)}(_))},null,8,["emoji"]),e.createElementVNode("div",{class:"picture",onClick:N[1]||(N[1]=(..._)=>{var F,T;return((F=u.value)==null?void 0:F.click)&&((T=u.value)==null?void 0:T.click(..._))})},[e.createVNode(e.unref(Cs)),N[2]||(N[2]=e.createElementVNode("span",null,"图片",-1)),e.createElementVNode("input",{id:"comment-upload",ref_key:"inputRef",ref:u,type:"file",multiple:"",onChange:tn},null,544)])]),e.createElementVNode("div",null,[N[3]||(N[3]=e.createElementVNode("span",{style:{"margin-right":"10px"}},[e.createTextVNode(" 文明上网理性发言,请遵守 "),e.createElementVNode("a",{href:"###",target:"_blank"},"《新闻评论服务协议》")],-1)),e.createVNode(e.unref(k.ElButton),{type:"primary",disabled:d.value,onClick:ea},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.contentBtn),1)]),_:1},8,["disabled"])])])):e.createCommentVNode("",!0)]),_:1})])),[[e.unref(k.ClickOutside),Gl,p.value]])}},zl=v(Ws,[["__scopeId","data-v-e3fd437e"]]),Ys={class:"u-fold"},Xs={class:"action-box select-none"},qs=v(Object.assign({name:"UFold"},{__name:"fold",props:{line:{type:[Number,String],default:5}},setup(t){e.useCssVars(c=>({"15491e60":a.value}));const o=t,a=e.computed(()=>{let c=Math.trunc(Number(o.line));return c>0?c:1}),i=e.ref(!0),l=e.ref(!1),n=e.ref();let r;return e.onMounted(()=>{r=new ResizeObserver(c=>{i.value&&n.value&&(l.value=n.value.offsetHeight<n.value.scrollHeight)}),r.observe(n.value)}),e.onUnmounted(()=>{r.disconnect()}),(c,h)=>(e.openBlock(),e.createElementBlock("div",Ys,[e.createElementVNode("div",{class:e.normalizeClass(["txt-box",{"over-hidden":i.value}])},[e.createElementVNode("div",{ref_key:"divBox",ref:n},[e.renderSlot(c.$slots,"default",{},void 0,!0)],512)],2),e.createElementVNode("div",Xs,[l.value&&c.unfold?(e.openBlock(),e.createElementBlock("div",{key:0,class:"expand-btn",onClick:h[0]||(h[0]=d=>i.value=!i.value)},e.toDisplayString(i.value?"展开":"收起"),1)):e.createCommentVNode("",!0)])]))}}),[["__scopeId","data-v-94334818"]]),da={__name:"user-card",props:{uid:""},setup(t){const o=e.ref({}),{showInfo:a}=e.inject("InjectContentBox"),i=e.inject("InjectSlots"),l=()=>e.h("div",i.card(o.value));return(n,r)=>e.unref(i).card?(e.openBlock(),e.createBlock(e.unref(k.ElPopover),{key:0,placement:"top",width:300,"show-after":300,onBeforeEnter:r[0]||(r[0]=()=>e.unref(a)(t.uid,c=>o.value=c))},{reference:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),default:e.withCtx(()=>[e.createVNode(l)]),_:3})):e.renderSlot(n.$slots,"default",{key:1})}};function Pl(t){return!!e.getCurrentScope()&&(e.onScopeDispose(t),!0)}const Zo=typeof window<"u"&&typeof document<"u";const Ks=Object.prototype.toString,Gs=t=>Ks.call(t)==="[object Object]";function co(t){return Array.isArray(t)?t:[t]}const Zs=Zo?window:void 0,Ml=Zo?window.navigator:void 0;function Hl(...t){const o=[],a=()=>{o.forEach(h=>h()),o.length=0},i=e.computed(()=>{const h=co(e.toValue(t[0])).filter(d=>d!=null);return h.every(d=>typeof d!="string")?h:void 0}),l=(n=()=>{var h,d;return[(d=(h=i.value)==null?void 0:h.map(p=>function(u){var m;const f=e.toValue(u);return(m=f==null?void 0:f.$el)!=null?m:f}(p)))!=null?d:[Zs].filter(p=>p!=null),co(e.toValue(i.value?t[1]:t[0])),co(e.unref(i.value?t[2]:t[1])),e.toValue(i.value?t[3]:t[2])]},r=([h,d,p,u])=>{if(a(),!(h!=null&&h.length)||!(d!=null&&d.length)||!(p!=null&&p.length))return;const m=Gs(u)?{...u}:u;o.push(...h.flatMap(f=>d.flatMap(C=>p.map(g=>((y,b,w,V)=>(y.addEventListener(b,w,V),()=>y.removeEventListener(b,w,V)))(f,C,g,m)))))},c={flush:"post"},e.watch(n,r,{...c,immediate:!0}));var n,r,c;return Pl(a),()=>{l(),a()}}function Al(t){const o=function(){const a=e.shallowRef(!1),i=e.getCurrentInstance();return i&&e.onMounted(()=>{a.value=!0},i),a}();return e.computed(()=>(o.value,!!t()))}function ha(t,o={}){const{controls:a=!1,navigator:i=Ml}=o,l=Al(()=>i&&"permissions"in i),n=e.shallowRef(),r=typeof t=="string"?{name:t}:t,c=e.shallowRef(),h=()=>{var p,u;c.value=(u=(p=n.value)==null?void 0:p.state)!=null?u:"prompt"};Hl(n,"change",h,{passive:!0});const d=function(p){let u;function m(){return u||(u=p()),u}return m.reset=async()=>{const f=u;u=void 0,f&&await f},m}(async()=>{if(l.value){if(!n.value)try{n.value=await i.permissions.query(r)}catch{n.value=void 0}finally{h()}return a?e.toRaw(n.value):void 0}});return d(),a?{state:c,isSupported:l,query:d}:c}function Qs(t={}){const{navigator:o=Ml,read:a=!1,source:i,copiedDuring:l=1500,legacy:n=!1}=t,r=Al(()=>o&&"clipboard"in o),c=ha("clipboard-read"),h=ha("clipboard-write"),d=e.computed(()=>r.value||n),p=e.shallowRef(""),u=e.shallowRef(!1),m=function(C,g,y={}){const{immediate:b=!0,immediateCallback:w=!1}=y,V=e.shallowRef(!1);let B=null;function S(){B&&(clearTimeout(B),B=null)}function I(){V.value=!1,S()}function L(...z){w&&C(),S(),V.value=!0,B=setTimeout(()=>{V.value=!1,B=null,C(...z)},e.toValue(g))}return b&&(V.value=!0,Zo&&L()),Pl(I),{isPending:e.shallowReadonly(V),start:L,stop:I}}(()=>u.value=!1,l,{immediate:!1});function f(C){return C==="granted"||C==="prompt"}return d.value&&a&&Hl(["copy","cut"],async function(){let C=!(r.value&&f(c.value));if(!C)try{p.value=await o.clipboard.readText()}catch{C=!0}var g,y,b;C&&(p.value=(b=(y=(g=document==null?void 0:document.getSelection)==null?void 0:g.call(document))==null?void 0:y.toString())!=null?b:"")},{passive:!0}),{isSupported:d,text:p,copied:u,copy:async function(C=e.toValue(i)){if(d.value&&C!=null){let g=!(r.value&&f(h.value));if(!g)try{await o.clipboard.writeText(C)}catch{g=!0}g&&function(y){const b=document.createElement("textarea");b.value=y??"",b.style.position="absolute",b.style.opacity="0",document.body.appendChild(b),b.select(),document.execCommand("copy"),b.remove()}(C),p.value=C,u.value=!0,m.start()}}}}const Js={class:"comment-list-actbox__right"},ec={class:"operation-warp"},tc={class:"dialog-footer"},oc={__name:"comment-operate",props:{data:{type:[Object],default:()=>({})}},setup(t){const{copy:o}=Qs(),a=e.ref(!1),i=e.ref({report_type:"",report_content:""}),l=t;function n(){let r=l.data||{};a.value=!1,k.ElMessage({type:"info",message:"举报成功: "+r.id})}return(r,c)=>{const h=e.resolveComponent("el-dropdown-item"),d=e.resolveComponent("el-dropdown-menu"),p=e.resolveComponent("el-dropdown"),u=e.resolveComponent("el-radio"),m=e.resolveComponent("el-radio-group"),f=e.resolveComponent("el-form-item"),C=e.resolveComponent("el-input"),g=e.resolveComponent("el-form"),y=e.resolveComponent("el-button"),b=e.resolveComponent("el-dialog");return e.openBlock(),e.createElementBlock("div",Js,[e.createVNode(p,{trigger:"click",onCommand:c[0]||(c[0]=w=>function(V){let B=l.data||{};switch(V){case"remove":setTimeout(()=>{var S;(S=commentRef.value)==null||S.remove(B)},200);break;case"report":a.value=!0;break;case"copy":o(B.content),k.ElMessage({type:"info",message:"复制成功"})}}(w))},{dropdown:e.withCtx(()=>[e.createVNode(d,null,{default:e.withCtx(()=>[e.createVNode(h,{command:"report"},{default:e.withCtx(()=>c[5]||(c[5]=[e.createTextVNode("举报")])),_:1,__:[5]}),e.createVNode(h,{command:"remove"},{default:e.withCtx(()=>c[6]||(c[6]=[e.createTextVNode("删除")])),_:1,__:[6]}),e.createVNode(h,{divided:"",command:"copy"},{default:e.withCtx(()=>c[7]||(c[7]=[e.createTextVNode("复制")])),_:1,__:[7]})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",ec,[e.createVNode(e.unref(ys))])]),_:1}),e.createVNode(b,{title:"举报",modelValue:a.value,"onUpdate:modelValue":c[4]||(c[4]=w=>a.value=w),width:"400px",style:{width:"90%","max-width":"400px"}},{footer:e.withCtx(()=>[e.createElementVNode("span",tc,[e.createVNode(y,{onClick:c[3]||(c[3]=w=>a.value=!1)},{default:e.withCtx(()=>c[13]||(c[13]=[e.createTextVNode("取消")])),_:1,__:[13]}),e.createVNode(y,{type:"primary",onClick:n},{default:e.withCtx(()=>c[14]||(c[14]=[e.createTextVNode("提交")])),_:1,__:[14]})])]),default:e.withCtx(()=>[e.createVNode(g,{"label-position":"top"},{default:e.withCtx(()=>[e.createVNode(f,{label:"您为什么要举报此信息?"},{default:e.withCtx(()=>[e.createVNode(m,{modelValue:i.value.report_type,"onUpdate:modelValue":c[1]||(c[1]=w=>i.value.report_type=w)},{default:e.withCtx(()=>[e.createVNode(u,{value:"色情淫秽"},{default:e.withCtx(()=>c[8]||(c[8]=[e.createTextVNode("色情淫秽")])),_:1,__:[8]}),e.createVNode(u,{value:"骚扰谩骂"},{default:e.withCtx(()=>c[9]||(c[9]=[e.createTextVNode("骚扰谩骂")])),_:1,__:[9]}),e.createVNode(u,{value:"广告欺诈"},{default:e.withCtx(()=>c[10]||(c[10]=[e.createTextVNode("广告欺诈")])),_:1,__:[10]}),e.createVNode(u,{value:"反动"},{default:e.withCtx(()=>c[11]||(c[11]=[e.createTextVNode("反动")])),_:1,__:[11]}),e.createVNode(u,{value:"其他"},{default:e.withCtx(()=>c[12]||(c[12]=[e.createTextVNode("其他")])),_:1,__:[12]})]),_:1},8,["modelValue"])]),_:1}),e.createVNode(f,{label:"举报说明(可选):"},{default:e.withCtx(()=>[e.createVNode(C,{type:"textarea",modelValue:i.value.report_content,"onUpdate:modelValue":c[2]||(c[2]=w=>i.value.report_content=w),maxlength:"200",placeholder:"描述恶意行为",rows:"3"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1},8,["modelValue"])])}}},ac={class:"comment-sub"},lc=["href"],nc={class:"comment-primary"},ic={class:"comment-main"},rc={key:1,class:"user-info"},sc=["href"],cc={class:"username"},dc={class:"name",style:{"max-width":"10em"}},hc={blank:"true",class:"rank"},pc=["innerHTML"],mc={class:"address",style:{color:"#939393","font-size":"12px"}},uc={class:"time"},gc={class:"content"},fc=["innerHTML"],Cc={class:"imgbox",style:{display:"flex"}},vc={class:"comment-list-actbox select-none"},yc={class:"comment-list-actbox__left"},kc={key:2},bc={class:"comment-list-actbox__right"},wc={key:2},Vc={__name:"content-box",props:{reply:{type:[Boolean],default:!1},data:{type:[Object],default:()=>({})},id:{type:[String],default:""}},setup(t){const o=t,a=e.reactive({active:!1}),i=e.ref(),l=e.ref(),n=e.computed(()=>{let y=o.data.contentImg;return oe(y)?[]:y==null?void 0:y.split("||")}),{allEmoji:r}=e.inject("InjectionEmojiApi"),{like:c,user:h,relativeTime:d}=e.inject("InjectContentBox");function p(){a.active=!a.active,a.active&&e.nextTick(()=>{var y;(y=i.value)==null||y.focus()})}function u(y){var w;const b=y.target;(w=l.value)!=null&&w.contains(b)||(a.active=!1)}const m=e.inject("InjectSlots"),f=()=>e.h("div",m.info(o.data)),C=e.computed(()=>((y,b)=>b.replace(/\[.+?\]/g,w=>{const V=y[w];return V?['<img src="',V,'" width="20" height="20" alt="',w,'" title="',w,'" style="margin: 0 1px; vertical-align: text-bottom"',"/>"].join(""):w}))(r,o.data.content)),g=y=>{switch(y){case 1:return'<svg viewBox="0 0 1682 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="831"><path d="M219.428571 73.142857h1243.428572a146.285714 146.285714 0 0 1 146.285714 146.285714v585.142858a146.285714 146.285714 0 0 1-146.285714 146.285714H219.428571a146.285714 146.285714 0 0 1-146.285714-146.285714V219.428571a146.285714 146.285714 0 0 1 146.285714-146.285714z" fill="#8CDBF4" p-id="832"></path><path d="M219.428571 292.571429h146.285715v512H219.428571z m365.714286 146.285714h146.285714l146.285715 365.714286h-146.285715z" fill="#FFFFFF" p-id="833"></path><path d="M1024 438.857143h-146.285714l-146.285715 365.714286h146.285715zM219.428571 658.285714h365.714286v146.285715H219.428571z m950.857143-365.714285l73.142857-73.142858v146.285715h-73.142857z m73.142857-73.142858h146.285715v146.285715h-146.285715z m0 146.285715h146.285715v438.857143h-146.285715z" fill="#FFFFFF"></path></svg>';case 2:return'<svg viewBox="0 0 1682 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="765"><path d="M219.428571 73.142857h1243.428572a146.285714 146.285714 0 0 1 146.285714 146.285714v585.142858a146.285714 146.285714 0 0 1-146.285714 146.285714H219.428571a146.285714 146.285714 0 0 1-146.285714-146.285714V219.428571a146.285714 146.285714 0 0 1 146.285714-146.285714z" fill="#6ECEFF" p-id="766"></path><path d="M219.428571 292.571429h146.285715v512H219.428571z m365.714286 146.285714h146.285714l146.285715 365.714286h-146.285715z" fill="#FFFFFF" p-id="767"></path><path d="M1024 438.857143h-146.285714l-146.285715 365.714286h146.285715zM219.428571 658.285714h365.714286v146.285715H219.428571z m877.714286-438.857143h365.714286v146.285715h-365.714286z m219.428572 146.285715h146.285714v146.285714h-146.285714z m-219.428572 292.571428V512h146.285714v146.285714z" fill="#FFFFFF" p-id="768"></path><path d="M1097.142857 585.142857V438.857143h365.714286v146.285714z m0 73.142857h365.714286v146.285715h-365.714286z" fill="#FFFFFF"></path></svg>';case 3:return'<svg viewBox="0 0 1682 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="799"><path d="M219.428571 73.142857h1243.428572a146.285714 146.285714 0 0 1 146.285714 146.285714v585.142858a146.285714 146.285714 0 0 1-146.285714 146.285714H219.428571a146.285714 146.285714 0 0 1-146.285714-146.285714V219.428571a146.285714 146.285714 0 0 1 146.285714-146.285714z" fill="#599DFF" p-id="800"></path><path d="M219.428571 292.571429h146.285715v512H219.428571z m365.714286 146.285714h146.285714l146.285715 365.714286h-146.285715z" fill="#FFFFFF" p-id="801"></path><path d="M1024 438.857143h-146.285714l-146.285715 365.714286h146.285715zM219.428571 658.285714h365.714286v146.285715H219.428571z m877.714286-438.857143h365.714286v146.285715h-365.714286z m219.428572 146.285715h146.285714v73.142857h-146.285714z m0 219.428571h146.285714v73.142857h-146.285714z m-146.285715-146.285714h292.571429v146.285714h-292.571429z m-73.142857 219.428571h365.714286v146.285715h-365.714286z" fill="#FFFFFF"></path></svg>';case 4:return'<svg viewBox="0 0 1682 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="815"><path d="M219.428571 73.142857h1243.428572a146.285714 146.285714 0 0 1 146.285714 146.285714v585.142858a146.285714 146.285714 0 0 1-146.285714 146.285714H219.428571a146.285714 146.285714 0 0 1-146.285714-146.285714V219.428571a146.285714 146.285714 0 0 1 146.285714-146.285714z" fill="#34D19B" p-id="816"></path><path d="M219.428571 292.571429h146.285715v512H219.428571z m365.714286 146.285714h146.285714l146.285715 365.714286h-146.285715z" fill="#FFFFFF" p-id="817"></path><path d="M1024 438.857143h-146.285714l-146.285715 365.714286h146.285715zM219.428571 658.285714h365.714286v146.285715H219.428571z m975.213715-365.714285L1243.428571 219.428571v219.428572h-146.285714zM1097.142857 438.857143h146.285714v292.571428h-146.285714z m146.285714 146.285714h73.142858v146.285714h-73.142858z m0-365.714286h73.142858v146.285715h-73.142858z m73.142858 0h146.285714v585.142858h-146.285714z" fill="#FFFFFF"></path></svg>';case 5:return'<svg viewBox="0 0 1682 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="782"><path d="M219.428571 73.142857h1243.428572a146.285714 146.285714 0 0 1 146.285714 146.285714v585.142858a146.285714 146.285714 0 0 1-146.285714 146.285714H219.428571a146.285714 146.285714 0 0 1-146.285714-146.285714V219.428571a146.285714 146.285714 0 0 1 146.285714-146.285714z" fill="#FFA000" p-id="783"></path><path d="M219.428571 292.571429h146.285715v512H219.428571z m365.714286 146.285714h146.285714l146.285715 365.714286h-146.285715z" fill="#FFFFFF" p-id="784"></path><path d="M1024 438.857143h-146.285714l-146.285715 365.714286h146.285715zM219.428571 658.285714h365.714286v146.285715H219.428571z m1097.142858-73.142857h146.285714v219.428572h-146.285714z m-219.428572-365.714286h365.714286v146.285715h-365.714286z m0 438.857143h219.428572v146.285715h-219.428572z m73.142857-219.428571h219.428572v146.285714h-219.428572z" fill="#FFFFFF" p-id="785"></path><path d="M1316.571429 438.857143h146.285714v146.285714h-146.285714z m-219.428572-73.142857h146.285714v219.428571h-146.285714z" fill="#FFFFFF"></path></svg>';case 6:return'<svg viewBox="0 0 1682 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="748"><path d="M219.428571 73.142857h1243.428572a146.285714 146.285714 0 0 1 146.285714 146.285714v585.142858a146.285714 146.285714 0 0 1-146.285714 146.285714H219.428571a146.285714 146.285714 0 0 1-146.285714-146.285714V219.428571a146.285714 146.285714 0 0 1 146.285714-146.285714z" fill="#F36262" p-id="749"></path><path d="M219.428571 292.571429h146.285715v512H219.428571z m365.714286 146.285714h146.285714l146.285715 365.714286h-146.285715z" fill="#FFFFFF" p-id="750"></path><path d="M1024 438.857143h-146.285714l-146.285715 365.714286h146.285715zM219.428571 658.285714h365.714286v146.285715H219.428571z m1097.142858-146.285714h146.285714v292.571429h-146.285714z m-73.142858-292.571429h146.285715v146.285715h-146.285715z m-146.285714 146.285715h146.285714v438.857143h-146.285714z" fill="#FFFFFF" p-id="751"></path><path d="M1243.428571 438.857143h219.428572v146.285714h-219.428572z m-48.786285-170.642286L1243.428571 219.428571v146.285715h-146.285714zM1243.428571 658.285714h146.285715v146.285715h-146.285715z" fill="#FFFFFF"></path></svg>';default:return""}};return(y,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["comment",{reply:o.reply}])},[e.createElementVNode("div",ac,[e.createVNode(da,{uid:e.unref(Q)(t.data.uid)},{default:e.withCtx(()=>[e.createElementVNode("a",{href:t.data.user.homeLink,target:"_blank",class:"no-underline",style:{display:"block"}},[e.createVNode(e.unref(k.ElAvatar),{style:{"margin-top":"5px"},size:40,fit:"cover",src:t.data.user.avatar},{default:e.withCtx(()=>b[2]||(b[2]=[e.createElementVNode("img",{src:"https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png"},null,-1)])),_:1,__:[2]},8,["src"])],8,lc)]),_:1},8,["uid"])]),e.createElementVNode("div",nc,[e.createElementVNode("div",ic,[e.unref(m).info?(e.openBlock(),e.createBlock(f,{key:0})):(e.openBlock(),e.createElementBlock("div",rc,[e.createVNode(da,{uid:e.unref(Q)(t.data.uid)},{default:e.withCtx(()=>[e.createElementVNode("a",{href:t.data.user.homeLink,target:"_blank",class:"no-underline",style:{display:"block"}},[e.createElementVNode("div",cc,[e.createElementVNode("span",dc,e.toDisplayString(t.data.user.username),1),e.createElementVNode("span",hc,[e.createElementVNode("i",{class:"comment-common-icon",style:{"font-size":"24px"},innerHTML:g(t.data.user.level)},null,8,pc)])])],8,sc)]),_:1},8,["uid"]),e.createElementVNode("span",mc," "+e.toDisplayString(t.data.address),1),e.createElementVNode("time",uc,e.toDisplayString(e.unref(d)?e.unref(qn)(t.data.createTime):t.data.createTime),1)])),e.createElementVNode("div",gc,[e.createVNode(qs,{unfold:""},{default:e.withCtx(()=>[e.createElementVNode("div",{innerHTML:C.value},null,8,fc),e.createElementVNode("div",Cc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(w,V)=>(e.openBlock(),e.createBlock(e.unref(k.ElImage),{key:V,src:w,style:{height:"72px",padding:"8px 4px"},lazy:"","preview-src-list":n.value,"initial-index":V},null,8,["src","preview-src-list","initial-index"]))),128))])]),_:1})]),e.createElementVNode("div",vc,[e.createElementVNode("div",yc,[e.createElementVNode("div",{"data-tip":"点赞",class:"item",onClick:b[0]||(b[0]=w=>e.unref(c)(e.unref(Q)(t.data.id)))},[e.unref(h).likeIds.map(String).indexOf(e.unref(Q)(t.data.id))==-1?(e.openBlock(),e.createBlock(e.unref(Vs),{key:0})):(e.openBlock(),e.createBlock(e.unref(bs),{key:1})),t.data.likes!=0?(e.openBlock(),e.createElementBlock("span",kc,e.toDisplayString(t.data.likes),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{"data-tip":"回复",ref_key:"btnRef",ref:l,class:e.normalizeClass(["item",{active:a.active}]),onClick:p},[e.createVNode(e.unref(Ds)),e.createElementVNode("span",null,e.toDisplayString(a.active?"取消回复":"回复"),1)],2)]),e.createElementVNode("div",bc,[e.renderSlot(y.$slots,"operate",{},()=>[e.createVNode(oc,{data:o.data},null,8,["data"])],!0)])]),a.active?(e.openBlock(),e.createElementBlock("div",wc,[e.createVNode(zl,{ref_key:"commentRef",ref:i,"parent-id":e.unref(Q)(t.id),placeholder:`回复 @${t.data.user.username}...`,reply:t.data,"content-btn":"发布",style:{"margin-top":"12px"},onHide:u,onClose:b[1]||(b[1]=w=>a.active=!1)},null,8,["parent-id","placeholder","reply"])])):e.createCommentVNode("",!0)]),e.renderSlot(y.$slots,"default",{},void 0,!0)])],2))}},jl=v(Vc,[["__scopeId","data-v-cfe79df7"]]),xc={key:0,class:"reply-box"},Nc={class:"reply-list"},Sc={key:0,class:"fetch-more"},Bc={key:0},Ec={key:1},Dc={key:0},_c={key:1,class:"fetch-more"},Tc={__name:"reply-box",props:{data:{type:[Array,Object],default:()=>null},id:{type:[String],default:""}},setup(t){const o=t,a=e.reactive({loading:!1,over:!1,pageNum:1,pageSize:5}),{replyPage:i,replyShowSize:l,comments:n,page:r}=e.inject("InjectReplyBox"),c=e.computed(()=>{let m={total:0,length:0,list:[]};if(o.data){let f=o.data.list.length;m={total:o.data.total,length:f,list:o.data.list}}if(!a.over){let f=m.list.slice(0,l);m.list=f}return r&&(m.list=m.list.slice(0,5)),m}),h=()=>{a.over=!0},d=m=>{n.value.forEach(f=>{f.id==o.id&&f.reply&&(f.reply=m)})},p=m=>{a.pageNum=m,i(o.id,m,a.pageSize,f=>d(f))},u=m=>{a.pageSize=m,i(o.id,a.pageNum,m,f=>d(f))};return(m,f)=>c.value.length>0?(e.openBlock(),e.createElementBlock("div",xc,[e.createElementVNode("div",Nc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.list,(C,g)=>(e.openBlock(),e.createBlock(jl,{id:t.id,key:g,data:C,reply:""},null,8,["id","data"]))),128)),c.value.length>e.unref(l)?(e.openBlock(),e.createElementBlock("div",Sc,[a.loading?(e.openBlock(),e.createElementBlock("span",Bc,"加载中...")):(e.openBlock(),e.createElementBlock("div",Ec,[a.over?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Dc,[e.createTextVNode(" 共"+e.toDisplayString(c.value.total)+"条回复, ",1),e.createElementVNode("span",{class:"fetch-more-comment select-none",onClick:h},[f[0]||(f[0]=e.createTextVNode(" 点击查看 ")),e.createVNode(e.unref(Ns))])]))]))])):e.createCommentVNode("",!0),a.over&&e.unref(r)?(e.openBlock(),e.createElementBlock("div",_c,[e.createVNode(e.unref(k.ElPagination),{small:"","hide-on-single-page":"",layout:"total, prev, pager, next",total:c.value.total,"page-size":a.pageSize,onCurrentChange:p,onSizeChange:u},null,8,["total","page-size"])])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)}},Ic=v(Tc,[["__scopeId","data-v-16e0a50b"]]),Lc={key:0,class:"comment-list"},Fc={__name:"comment-list",props:{data:{type:[Array,Object],default:()=>[]},total:{type:[Number],default:0},showSize:{type:[Number],default:0}},setup:t=>(o,a)=>t.data?(e.openBlock(),e.createElementBlock("div",Lc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data,(i,l)=>(e.openBlock(),e.createBlock(jl,{id:e.unref(Q)(i.id),key:l,data:i},{default:e.withCtx(()=>[e.createVNode(Ic,{id:e.unref(Q)(i.id),data:i.reply},null,8,["id","data"])]),_:2},1032,["id","data"]))),128))])):e.createCommentVNode("",!0)},Oc={class:"cv-comment-base"},$c={class:"cv-comment-form"},zc={class:"cv-comment-form__content"},Pc={class:"cv-comment-form__avatar"},Mc={class:"cv-comment-list-wrapper"},Ht=Object.assign({name:"cvCommentBase"},{__name:"comment",props:{config:{},page:!1,upload:!1,relativeTime:!1},emits:["submit","like","replyPage","showInfo","focus"],setup(t,{expose:o,emit:a}){const i=t,{user:l,comments:n,showSize:r,replyShowSize:c,total:h}=e.toRefs(i.config),d=a,p={upload:i.upload,submit:({content:m,parentId:f,reply:C,files:g,clear:y})=>{d("submit",{content:m,parentId:f,reply:C,files:g,finish:b=>{if(y(),f){let w=n.value.find(V=>V.id==f);if(w){let V=w.reply;V?(V.list.unshift(b),V.total++):w.reply={total:1,list:[b]}}}else n.value.unshift(b)}})},focus:()=>d("focus")};e.provide("InjectInputBox",p);const u=(m,f)=>{let C=null;n.value.forEach(g=>{var y;C=g.id==m?g:(y=g.reply)==null?void 0:y.list.find(b=>b.id==m),C&&(C.likes+=f)})};return e.provide("InjectContentBox",{user:l,like:m=>{const f=i.config.user.likeIds;d("like",m,()=>{if(f.findIndex(C=>C==m)==-1)f.push(m),u(m,1);else{let C=f.findIndex(g=>g==m);C!=-1&&(f.splice(C,1),u(m,-1))}})},relativeTime:le(i.relativeTime,!1),showInfo:(m,f)=>d("showInfo",m,f)}),e.provide("InjectReplyBox",{page:i.page,replyPage:(m,f,C,g)=>{d("replyPage",{parentId:m,pageNum:f,pageSize:C,finish:g})},replyShowSize:le(c,3),comments:n}),e.provide("InjectionEmojiApi",i.config.emoji),e.provide("InjectSlots",e.useSlots()),o({remove:m=>{const{parentId:f,id:C}=m;if(f){let g=n.value.find(b=>b.id==f),y=g==null?void 0:g.reply;if(y){let b=y.list.findIndex(w=>w.id==C);b!=-1&&(y.list.splice(b,1),y.total--)}}else{let g=n.value.findIndex(y=>y.id==C);g!=-1&&n.value.splice(g,1)}}}),(m,f)=>{const C=e.resolveComponent("el-avatar");return e.openBlock(),e.createElementBlock("div",Oc,[e.createElementVNode("div",$c,[f[1]||(f[1]=e.createElementVNode("div",{class:"cv-comment-form__header"},[e.createElementVNode("span",{class:"cv-comment-form__hdtitle"},"评论")],-1)),e.createElementVNode("div",zc,[e.createElementVNode("div",Pc,[e.createVNode(C,{size:40,src:t.config.user.avatar},{default:e.withCtx(()=>f[0]||(f[0]=[e.createElementVNode("img",{src:"https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png"},null,-1)])),_:1,__:[0]},8,["src"])]),e.createVNode(zl,{placeholder:"输入评论(Enter换行,Ctrl + Enter发送)","content-btn":"发表评论"})])]),e.renderSlot(m.$slots,"default",{},()=>[f[2]||(f[2]=e.createElementVNode("div",{class:"title"},"全部评论",-1))]),e.createElementVNode("div",Mc,[e.createVNode(Fc,{data:e.unref(n),total:e.unref(h),"show-size":e.unref(le)(e.unref(r),5)},null,8,["data","total","show-size"])])])}}}),Hc={class:"comment-scroll"},Ac=["infinite-scroll-disabled"],jc={class:"scroll-btn"},Rc={key:1},Uc={key:2},At=Object.assign({name:"cvCommentScroll"},{__name:"comment-scroll",props:{disable:{type:[Boolean],default:!1},show:{type:[Boolean],default:!1}},emits:["more"],setup(t,{emit:o}){const a=t,i=e.ref(!1),l=e.ref(!1),n=o,r=e.computed(()=>l.value&&a.disable),c=e.computed(()=>!l.value||i.value||r.value),h=Dl(()=>{n("more"),i.value=!1},500),d=()=>{i.value=!0,h()};return(p,u)=>{const m=e.resolveComponent("el-link"),f=e.resolveDirective("infinite-scroll");return e.openBlock(),e.createElementBlock("div",Hc,[e.withDirectives((e.openBlock(),e.createElementBlock("div",{"infinite-scroll-disabled":c.value,"infinite-scroll-distance":"2"},[e.renderSlot(p.$slots,"default"),e.createElementVNode("div",jc,[l.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(m,{key:0,type:"primary",underline:!1,onClick:u[0]||(u[0]=C=>l.value=!l.value)},{default:e.withCtx(()=>u[1]||(u[1]=[e.createTextVNode("加载更多")])),_:1,__:[1]})),i.value?(e.openBlock(),e.createElementBlock("p",Rc,"加载中...")):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("p",Uc,"没有更多了")):e.createCommentVNode("",!0)])],8,Ac)),[[f,d]])])}}}),Wc={class:"cv-comment-nav-wrap"},Yc={class:"cv-comment-nav__sort"},jt=Object.assign({name:"cvCommentNav"},{__name:"comment-nav",props:{modelValue:!1},emits:["update:modelValue","sorted"],setup(t,{emit:o}){const a=t,i=o,l=e.computed({get:()=>a.modelValue,set(n){i("update:modelValue",n),i("sorted",n)}});return(n,r)=>(e.openBlock(),e.createElementBlock("div",Wc,[r[4]||(r[4]=e.createElementVNode("span",{class:"cv-comment-nav__title"},"全部评论",-1)),e.createElementVNode("div",Yc,[e.createElementVNode("div",{class:e.normalizeClass(["item select-none",{active:l.value}]),onClick:r[0]||(r[0]=c=>l.value=!0)},[e.createVNode(e.unref(Bs)),r[2]||(r[2]=e.createTextVNode(" 最新 "))],2),e.createElementVNode("div",{class:e.normalizeClass(["item select-none",{active:!l.value}]),onClick:r[1]||(r[1]=c=>l.value=!1)},[e.createVNode(e.unref(gs)),r[3]||(r[3]=e.createTextVNode(" 最热 "))],2)])]))}});Ht.install=function(t){t.component(Ht.name,Ht)},At.install=function(t){t.component(At.name,At)},jt.install=function(t){t.component(jt.name,jt)};const Xc={name:"cvSvgs",props:{...k.ElIcon.prop,type:{type:[String],default:""},size:{type:[String,Number],default:12},name:{type:[String],default:""}},data:()=>({}),computed:{svgType(){return"svg"+this.type},style(){return{fontSize:isNaN(Number(this.size))?this.size+"px":this.size,color:props.color}}},created(){},methods:{}},qc={key:0,"aria-hidden":"true"},Kc=["xlink:href"],Rt=v(Xc,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-icon");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.svgType)))]),a.name?(e.openBlock(),e.createElementBlock("svg",qc,[e.createElementVNode("use",{"xlink:href":a.name},null,8,Kc)])):e.createCommentVNode("",!0)]),_:3},16)}]]),Gc={name:"cvIcons",props:{...k.ElIcon.prop,type:{type:[String],default:""},size:{type:[String,Number],default:12},name:{type:[String],default:""}},data:()=>({}),computed:{style(){return{fontSize:isNaN(Number(this.size))?this.size+"px":this.size,color:props.color}}},created(){},methods:{}},Zc={key:0,"aria-hidden":"true"},Qc=["xlink:href"],Ut=v(Gc,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-icon");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.type)))]),a.name?(e.openBlock(),e.createElementBlock("svg",Zc,[e.createElementVNode("use",{"xlink:href":a.name},null,8,Qc)])):e.createCommentVNode("",!0)]),_:3},16)}]]);Ut.install=function(t){t.component(Ut.name,Ut)},Rt.install=function(t){t.component(Rt.name,Rt)};const Jc={class:"u-emoji"},ed={class:"face-tooltip-head select-none"},td=["onClick"],od=["src"],ad={class:"emoji-body select-none"},ld={style:{padding:"0 5px"}},nd=["onClick"],id={class:"emoji-btn select-none"},rd={key:0},sd=v(Object.assign({name:"cvEmoji"},{__name:"emoji",props:{emoji:{faceList:[],emojiList:[],allEmoji:{}},placement:"bottom"},emits:["addEmoji"],setup(t,{emit:o}){const a=t,i=e.ref(0),l=e.ref(0),n=e.ref(new Array(2)),{emojiList:r,faceList:c}=a.emoji;function h(){n.value[0]=r[0]}return(d,p)=>(e.openBlock(),e.createElementBlock("div",Jc,[e.createVNode(e.unref(k.ElPopover),{placement:t.placement,"popper-class":"emoji-popover",width:250,trigger:"click",onBeforeEnter:h},{reference:e.withCtx(()=>[e.createElementVNode("div",id,[d.$slots.default?e.renderSlot(d.$slots,"default",{key:1},void 0,!0):(e.openBlock(),e.createElementBlock("div",rd,p[0]||(p[0]=[e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"icon"},[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.00002 0.666504C12.0501 0.666504 15.3334 3.94975 15.3334 7.99984C15.3334 12.0499 12.0501 15.3332 8.00002 15.3332C3.94993 15.3332 0.666687 12.0499 0.666687 7.99984C0.666687 3.94975 3.94993 0.666504 8.00002 0.666504ZM8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2ZM10.6667 5.66667V7.66667H9.33333V5.66667H10.6667ZM6.66667 5.66667V7.66667H5.33333V5.66667H6.66667ZM10.0767 9.33333H11.0495C11.1804 9.33333 11.2866 9.43951 11.2866 9.57048C11.2866 9.60754 11.2779 9.64409 11.2612 9.67718L11.244 9.71053C10.6294 10.8739 9.40726 11.6667 7.99998 11.6667C6.61523 11.6667 5.40977 10.8991 4.7859 9.76612L4.73786 9.67593C4.67845 9.56052 4.72385 9.4188 4.83926 9.35939C4.87253 9.34226 4.90941 9.33333 4.94683 9.33333H5.92347C6.02396 9.33332 6.11908 9.37865 6.18238 9.4567C6.26207 9.55496 6.32833 9.62955 6.38117 9.68046C6.80074 10.0847 7.37133 10.3333 7.99998 10.3333C8.63289 10.3333 9.20694 10.0814 9.62728 9.67224C9.67791 9.62296 9.74135 9.55121 9.8176 9.45698C9.88089 9.37877 9.97611 9.33333 10.0767 9.33333Z"})],-1),e.createElementVNode("span",null,"表情",-1)])))])]),default:e.withCtx(()=>[e.createElementVNode("div",ed,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),(u,m)=>(e.openBlock(),e.createElementBlock("label",{key:m,class:e.normalizeClass(i.value==m?"active":""),onClick:f=>function(C){switch(i.value=C,C){case 0:l.value=0;break;case 1:l.value=-50,n.value[1]=r[1]}}(m)},[e.createElementVNode("img",{src:u,alt:""},null,8,od)],10,td))),128))]),e.createElementVNode("div",ad,[e.createElementVNode("div",{class:"emjio-container",style:e.normalizeStyle({transform:`translateX(${l.value}%)`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(u,m)=>(e.openBlock(),e.createElementBlock("div",{key:m,class:"emoji-wrapper"},[e.createVNode(e.unref(k.ElScrollbar),null,{default:e.withCtx(()=>[e.createElementVNode("div",ld,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u,(f,C)=>(e.openBlock(),e.createElementBlock("span",{key:C,class:"emoji-item",onClick:g=>d.$emit("addEmoji",C)},[e.createVNode(e.unref(k.ElImage),{src:f,title:String(C),class:"emoji",style:{width:"24px",height:"24px",margin:"5px"},lazy:""},null,8,["src","title"])],8,nd))),128))])]),_:2},1024)]))),128))],4)])]),_:3},8,["placement"])]))}}),[["__scopeId","data-v-da53b6ed"]]),cd={class:"cv-chat-message"},dd={class:"chat-list"},hd={class:"content"},pd={key:0,class:"username"},md=["innerHTML"],ud={__name:"message",props:{data:{type:[Array],default:()=>[]},userId:{type:[Number],default:0}},setup(t,{expose:o}){const{allEmoji:a}=e.inject("InjectionEmojiApi"),i=e.ref();o({scroll:()=>{e.nextTick(()=>{const n=document.querySelector(".chat-item:last-child");i.value.setScrollTop(n.offsetTop)})}});const l=(n,r)=>r=r.replace(/\[.+?\]/g,c=>{const h=n[c];return h?['<img src="',h,'" width="20" height="20" alt="',c,'" title="',c,'" style="margin: 0 1px; vertical-align: text-bottom"',"/>"].join(""):c});return(n,r)=>(e.openBlock(),e.createElementBlock("div",cd,[e.createVNode(e.unref(k.ElScrollbar),{ref_key:"scrollbarRef",ref:i},{default:e.withCtx(()=>[e.createElementVNode("div",dd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data,(c,h)=>(e.openBlock(),e.createElementBlock("div",{key:h,class:e.normalizeClass([{self:t.userId==c.id},"chat-item"])},[e.createElementVNode("div",null,[e.createVNode(e.unref(k.ElAvatar),null,{default:e.withCtx(()=>r[0]||(r[0]=[e.createElementVNode("img",{src:"https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png"},null,-1)])),_:1,__:[0]})]),e.createElementVNode("div",hd,[t.userId!=c.id?(e.openBlock(),e.createElementBlock("div",pd,e.toDisplayString(c.username),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"card-box",innerHTML:l(e.unref(a),c.content)},null,8,md)]),r[1]||(r[1]=e.createElementVNode("div",{class:"date"},null,-1))],2))),128))])]),_:1},512)]))}},gd={class:"cv-chat-wrap"},fd={class:"header"},Cd={id:"chat-footer",class:"footer"},Wt=Object.assign({name:"cvChat"},{__name:"chat",props:{data:{type:[Array],default:()=>[]},userId:{type:[Number],default:0},emoji:{type:[Object],default:()=>({})}},emits:["submit"],setup(t,{emit:o}){const a=t,i=e.ref(!1),l=e.ref(""),n=e.ref(),{data:r}=a,c=o,h=m=>{const{ctrlKey:f,key:C}=m;f&&C=="Enter"&&p()},d=()=>{l.value="",n.value.scroll()},p=()=>{let m=l.value;m.trim()?(m=m.replace(/\n/g,"<br/>"),c("submit",{clear:d,content:m})):k.ElMessage({type:"error",message:"内容不能为空"})},u=m=>{let f=document.getElementById("emojiInput"),C=f.selectionStart,g=f.selectionEnd,y=f.value;if(C===null||g===null)return;let b=y.substring(0,C)+m+y.substring(g);f.value=b,f.focus(),f.selectionStart=C+m.length,f.selectionEnd=C+m.length,l.value=b};return e.provide("InjectionEmojiApi",a.emoji),(m,f)=>{const C=e.resolveComponent("cvIcons");return e.openBlock(),e.createElementBlock("div",gd,[e.createElementVNode("div",{class:e.normalizeClass([{active:i.value},"chat-container translate"])},[e.createElementVNode("div",fd,[e.createVNode(C,{size:"32"},{default:e.withCtx(()=>f[2]||(f[2]=[e.createElementVNode("svg",{viewBox:"0 0 1318 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1318.502489 432.779052c0-231.790522-209.29842-419.704826-467.458992-419.704826s-467.56979 188.357498-467.56979 419.704826 209.409219 419.704826 467.56979 419.704826a512.110799 512.110799 0 0 0 183.482363-33.239559l93.292361 93.292361a25.816057 25.816057 0 0 0 44.319412-19.168145L1165.822116 742.350141C1259.336074 665.56676 1318.502489 555.433023 1318.502489 432.779052z",fill:"#612273","p-id":"10993"}),e.createElementVNode("path",{d:"M1034.304263 745.784895a509.673231 509.673231 0 0 1-183.482363 33.239559c-244.532352 0-445.077689-168.524562-465.353819-383.25211-1.107985 12.07704-1.883575 24.264878-1.883575 36.563514 0 231.790522 209.409219 419.704826 467.56979 419.704826a512.110799 512.110799 0 0 0 183.482363-33.239559l93.292361 93.292361a25.816057 25.816057 0 0 0 44.319411-19.168145 25.262064 25.262064 0 0 0-7.5343-17.284571zM1165.822116 669.223112l2.769964 70.689461C1260.44406 663.239991 1318.502489 553.992642 1318.502489 432.779052a366.632331 366.632331 0 0 0-1.883575-36.785111 403.971435 403.971435 0 0 1-150.796798 273.229171z",fill:"#612273",opacity:".2","p-id":"10994"}),e.createElementVNode("path",{d:"M383.25211 432.779052a383.141311 383.141311 0 0 1 41.881844-172.956503c-12.298637-0.997187-24.81887-1.661978-37.449903-1.661978C173.510496 258.160571 0 413.943302 0 606.178749c0 101.713049 48.97295 193.011037 126.421121 256.609392l-5.761524 148.470028a12.187838 12.187838 0 0 0 20.830124 9.08548l94.06795-93.957153A425.577148 425.577148 0 0 0 387.79485 954.196927a404.636226 404.636226 0 0 0 300.37481-128.304696c-177.831638-59.388011-304.91755-212.733175-304.91755-393.113179z",fill:"#EB3D72","p-id":"10995"}),e.createElementVNode("path",{d:"M342.256654 391.672798c0 117.557239 53.958883 223.59143 140.714132 299.71002a391.008007 391.008007 0 0 1-99.718676-258.603766 383.141311 383.141311 0 0 1 41.881844-172.956503c-12.298637-0.997187-24.81887-1.661978-37.449903-1.661978-7.091106 0-14.071413 0-21.05172 0.553993a375.939407 375.939407 0 0 0-24.375677 132.958234zM630.111231 802.181346a407.627786 407.627786 0 0 1-283.533434 110.798528 424.136767 424.136767 0 0 1-152.12638-27.699632l-71.686647 71.686648-2.105173 54.291279a12.187838 12.187838 0 0 0 20.830124 9.08548l94.06795-93.957153A425.577148 425.577148 0 0 0 387.79485 954.196927a404.636226 404.636226 0 0 0 300.37481-128.304696 486.294741 486.294741 0 0 1-58.058429-23.710885zM85.425665 821.792686l-5.761523-4.985934c1.883575 2.215971 3.656351 4.431941 5.650725 6.647911z",fill:"#EB3D72",opacity:".5","p-id":"10996"}),e.createElementVNode("path",{d:"M833.426531 332.395585c64.263147-10.193465 64.041549-66.479117 62.601169-75.342999s-15.400995-54.291279-59.942004-47.200173S799.078987 254.836615 799.078987 254.836615a28.475222 28.475222 0 1 0 56.174854-8.97468s6.315516 3.323956 8.30989 20.27613-11.966241 29.029214-35.455529 33.239559-88.638823-19.943735-104.039819-115.452067C709.110582 96.39472 781.57282 28.253625 838.966457 13.185025a55.399264 55.399264 0 0 0-64.041549-5.318329c-56.064055 35.123134-97.170309 109.579745-85.536464 182.817571 14.957801 93.846354 79.664142 151.904783 144.038087 141.711318zM203.980091 573.825579a53.072495 53.072495 0 0 0 33.90435-67.919498c-2.659165-6.537113-21.162519-38.225492-53.51569-25.040467a30.026401 30.026401 0 0 0-19.832936 40.773858 22.159706 22.159706 0 1 0 40.773858-16.619779s5.318329 1.329582 9.861069 13.739017-3.988747 24.043281-21.05172 31.023588-70.02467 0.553993-98.832288-68.695087C68.916685 417.599654 110.798528 353.558104 151.904783 332.395585a42.879031 42.879031 0 0 0-48.97295 7.423502 146.918849 146.918849 0 0 0-32.574767 152.458775c27.810431 68.141095 86.866046 100.605064 133.623025 81.547717z",fill:"#FED150","p-id":"10997"})],-1)])),_:1,__:[2]}),f[3]||(f[3]=e.createElementVNode("div",{style:{"margin-left":"12px"}},[e.createElementVNode("div",null,"聊天室"),e.createElementVNode("div",{style:{"font-size":"12px"}},"当前2人在线")],-1))]),e.createVNode(ud,{ref_key:"messageRef",ref:n,data:e.unref(r),"user-id":t.userId},null,8,["data","user-id"]),e.createElementVNode("div",Cd,[e.createVNode(e.unref(k.ElInput),{id:"emojiInput",modelValue:l.value,"onUpdate:modelValue":f[0]||(f[0]=g=>l.value=g),type:"textarea",autosize:{minRows:1,maxRows:4},placeholder:"请输入内容",onKeydown:e.withKeys(h,["enter"])},null,8,["modelValue"]),e.createVNode(sd,{style:{margin:"0 8px 0"},emoji:t.emoji,placement:"top-end",onAddEmoji:u},{default:e.withCtx(()=>f[4]||(f[4]=[e.createElementVNode("svg",{width:"22",height:"22",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7186"},[e.createElementVNode("path",{d:"M510.944 960c-247.04 0-448-200.96-448-448s200.992-448 448-448c247.008 0 448 200.96 448 448S757.984 960 510.944 960zM510.944 128c-211.744 0-384 172.256-384 384 0 211.744 172.256 384 384 384 211.744 0 384-172.256 384-384C894.944 300.256 722.688 128 510.944 128zM512 773.344c-89.184 0-171.904-40.32-226.912-110.624-10.88-13.92-8.448-34.016 5.472-44.896 13.888-10.912 34.016-8.48 44.928 5.472 42.784 54.688 107.136 86.048 176.512 86.048 70.112 0 134.88-31.904 177.664-87.552 10.784-14.016 30.848-16.672 44.864-5.888 14.016 10.784 16.672 30.88 5.888 44.864C685.408 732.32 602.144 773.344 512 773.344zM368 515.2c-26.528 0-48-21.472-48-48l0-64c0-26.528 21.472-48 48-48s48 21.472 48 48l0 64C416 493.696 394.496 515.2 368 515.2zM656 515.2c-26.496 0-48-21.472-48-48l0-64c0-26.528 21.504-48 48-48s48 21.472 48 48l0 64C704 493.696 682.496 515.2 656 515.2z","p-id":"7187"})],-1)])),_:1,__:[4]},8,["emoji"]),e.createVNode(C,{size:"18",class:e.normalizeClass([{".cv-chat-wrap submit-btn":l.value.trim()!=""},"select-none cursor-pointer"]),style:{"padding-bottom":"5px"},onClick:p},{default:e.withCtx(()=>f[5]||(f[5]=[e.createElementVNode("svg",{viewBox:"0 0 1025 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"15072"},[e.createElementVNode("path",{d:"M1008.00076 6.285714q18.857143 13.714286 15.428571 36.571429l-146.285714 877.714286q-2.857143 16.571429-18.285714 25.714286-8 4.571429-17.714286 4.571429-6.285714 0-13.714286-2.857143l-258.857143-105.714286-138.285714 168.571429q-10.285714 13.142857-28 13.142857-7.428571 0-12.571429-2.285714-10.857143-4-17.428571-13.428571t-6.571429-20.857143l0-199.428571 493.714286-605.142857-610.857143 528.571429-225.714286-92.571429q-21.142857-8-22.857143-31.428571-1.142857-22.857143 18.285714-33.714286l950.857143-548.571429q8.571429-5.142857 18.285714-5.142857 11.428571 0 20.571429 6.285714z","p-id":"15073"})],-1)])),_:1,__:[5]},8,["class"])])],2),e.createVNode(e.unref(k.ElButton),{class:"chat-btn",onClick:f[1]||(f[1]=g=>i.value=!i.value)},{default:e.withCtx(()=>f[6]||(f[6]=[e.createTextVNode("chat")])),_:1,__:[6]})])}}});Wt.install=function(t){t.component(Wt.name,Wt)};const vd={key:0},Yt=Object.assign({name:"cvNoticeBar"},{__name:"notice-bar",props:{data:{type:[String,Array],default:()=>[]},vertical:{type:[Boolean],default:!1},suffixIcon:{type:[String],default:""},prefixIcon:{type:[String],default:""},size:{type:[Number],default:14},height:{type:[Number],default:40},delay:{type:[Number],default:1e3},spped:{type:[Number],default:100},color:{type:[String],default:"--color-warning"},background:{type:[String],default:"var(--color-warning-light-9)"}},setup(t){const o=t,{data:a,vertical:i,suffixIcon:l,prefixIcon:n,size:r,height:c,delay:h,spped:d,color:p,background:u}=o,m=e.reactive({boxWidth:0,textWidth:0,oneTime:0,twoTime:0,order:1}),f=e.ref({}),C=e.ref({style:{cssText:""}}),g=e.computed(()=>o.delay>2e3?o.delay:2e3),y=()=>{m.oneTime=m.textWidth/o.spped,m.twoTime=(m.textWidth+m.boxWidth)/o.spped},b=()=>{var w,V;m.order===1?((w=C.value)!=null&&w.style&&(C.value.style.cssText=`animation: oneAnimation ${m.oneTime}s linear; opactity: 1;}`),m.order=2):(V=C.value)!=null&&V.style&&(C.value.style.cssText=`animation: twoAnimation ${m.twoTime}s linear infinite; opacity: 1;`)};return e.onMounted(()=>{o.vertical||(e.nextTick(()=>{m.boxWidth=f.value.offsetWidth,m.textWidth=C.value.offsetWidth,document.styleSheets[0].insertRule(`@keyframes oneAnimation {0% {left: 0px;} 100% {left: -${m.textWidth}px;}}`),document.styleSheets[0].insertRule(`@keyframes twoAnimation {0% {left: ${m.boxWidth}px;} 100% {left: -${m.textWidth}px;}}`),y(),setTimeout(()=>{b()},o.delay)}),C.value.addEventListener("animationend",()=>{b()},!1))}),(w,V)=>{const B=e.resolveComponent("el-carousel-item"),S=e.resolveComponent("el-carousel"),I=e.resolveComponent("cvIcons");return e.openBlock(),e.createElementBlock("div",{class:"cv-notice-bar",style:e.normalizeStyle({background:e.unref(u),height:`${e.unref(c)}px`})},[e.unref(i)?(e.openBlock(),e.createElementBlock("div",vd,[e.createVNode(S,{height:"40px",direction:"vertical",autoplay:!0,"indicator-position":"none",interval:g.value},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a),L=>(e.openBlock(),e.createBlock(B,{key:L},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(L),1)]),_:2},1024))),128))]),_:1},8,["interval"])])):(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle({color:e.unref(p),fontSize:`${e.unref(r)}px`}),class:"cv-notice-bar-wrap"},[e.unref(n)?(e.openBlock(),e.createBlock(I,{key:0,type:e.unref(n)},null,8,["type"])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"boxRef",ref:f,class:"text-box"},[e.createElementVNode("div",{ref_key:"textRef",ref:C,class:"text"},e.toDisplayString(e.unref(a)),513)],512),e.unref(l)?(e.openBlock(),e.createBlock(I,{key:1,type:e.unref(l)},null,8,["type"])):e.createCommentVNode("",!0)],4))],4)}}});Yt.install=function(t){t.component(Yt.name,Yt)};const yd=Object.freeze({autofocus:!1,disabled:!1,indentWithTab:!0,tabSize:2,placeholder:"",autoDestroy:!0,extensions:[cn.basicSetup]}),pa="change",ma="update",ua="focus",ga="blur",fa="ready",Ca="update:modelValue",kd=({onUpdate:t,onChange:o,onFocus:a,onBlur:i,...l})=>O.EditorState.create({doc:l.doc,selection:l.selection,extensions:[...Array.isArray(l.extensions)?l.extensions:[l.extensions],D.EditorView.updateListener.of(n=>{t(n),n.docChanged&&o(n.state.doc.toString(),n),n.focusChanged&&(n.view.hasFocus?a(n):i(n))})]}),te=t=>{const o=new O.Compartment;return{compartment:o,run:a=>{o.get(t.state)?t.dispatch({effects:o.reconfigure(a)}):t.dispatch({effects:O.StateEffect.appendConfig.of(o.of(a))})}}},va=(t,o)=>{const{compartment:a,run:i}=te(t);return l=>{const n=a.get(t.state);i(l??n!==o?o:[])}},bd=t=>{const o=()=>t.state.doc.toString(),{run:a}=te(t),i=va(t,[D.EditorView.editable.of(!1),O.EditorState.readOnly.of(!0)]),l=va(t,D.keymap.of([dn.indentWithTab])),{run:n}=te(t),{run:r}=te(t),{run:c}=te(t),{run:h}=te(t);return{focus:()=>t.focus(),getDoc:o,setDoc:d=>{d!==o()&&t.dispatch({changes:{from:0,to:t.state.doc.length,insert:d}})},reExtensions:a,toggleDisabled:i,toggleIndentWithTab:l,setTabSize:d=>{n([O.EditorState.tabSize.of(d),x.indentUnit.of(" ".repeat(d))])},setPhrases:d=>{r([O.EditorState.phrases.of(d)])},setPlaceholder:d=>{c(D.placeholder(d))},setStyle:(d={})=>{h(D.EditorView.theme({"&":{...d}}))}}},wd=e.defineComponent({name:"VueCodemirror",props:{modelValue:{type:String,default:""},autofocus:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},indentWithTab:{type:Boolean,default:!1},tabSize:Number,placeholder:String,style:Object,autoDestroy:{type:Boolean,default:!1},phrases:Object,root:Object,extensions:Array,selection:Object},emits:{[pa]:(t,o)=>!0,[ma]:t=>!0,[ua]:t=>!0,[ga]:t=>!0,[fa]:t=>!0,[Ca]:(t,o)=>!0},setup(t,o){const a=e.shallowRef(),i=e.shallowRef(),l=e.shallowRef(),n={...yd},r=e.computed(()=>{const c={};return Object.keys(e.toRaw(t)).forEach(h=>{h!=="modelValue"&&(c[h]=t[h]??n[h])}),c});return e.onMounted(()=>{i.value=kd({doc:t.modelValue,selection:r.value.selection,extensions:n.extensions??[],onFocus:h=>o.emit(ua,h),onBlur:h=>o.emit(ga,h),onUpdate:h=>o.emit(ma,h),onChange:(h,d)=>{h!==t.modelValue&&(o.emit(pa,h,d),o.emit(Ca,h,d))}}),l.value=new D.EditorView({state:i.value,parent:a.value,root:r.value.root}),l.value.contentDOM.addEventListener("scroll",h=>{});const c=bd(l.value);e.watch(()=>t.modelValue,h=>{h!==c.getDoc()&&c.setDoc(h)}),e.watch(()=>t.extensions,h=>c.reExtensions(h||[]),{immediate:!0}),e.watch(()=>r.value.disabled,h=>c.toggleDisabled(h),{immediate:!0}),e.watch(()=>r.value.indentWithTab,h=>c.toggleIndentWithTab(h),{immediate:!0}),e.watch(()=>r.value.tabSize,h=>c.setTabSize(h),{immediate:!0}),e.watch(()=>r.value.phrases,h=>c.setPhrases(h||{}),{immediate:!0}),e.watch(()=>r.value.placeholder,h=>c.setPlaceholder(h),{immediate:!0}),e.watch(()=>r.value.style,h=>c.setStyle(h),{immediate:!0}),r.value.autofocus&&c.focus(),o.emit(fa,{state:i.value,view:l.value,container:a.value,editorTools:c})}),e.onBeforeUnmount(()=>{r.value.autoDestroy&&l.value&&l.value.destroy()}),()=>e.h("div",{class:"cv-editor-codemirror",ref:a})}}),ya="#e06c75",Xt="#abb2bf",Xo="#7d8799",ka="#d19a66",ba="#2c313a",wa="#282c34",ho="#353a42",Va="#528bff",Vd=D.EditorView.theme({"&":{color:Xt,backgroundColor:wa},".cm-content":{caretColor:Va},".cm-cursor, .cm-dropCursor":{borderLeftColor:Va},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:Xt},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:wa,color:Xo,border:"none"},".cm-activeLineGutter":{backgroundColor:ba},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:ho},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:ho,borderBottomColor:ho},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:ba,color:Xt}}},{dark:!0}),xd=x.HighlightStyle.define([{tag:s.tags.keyword,color:"#c678dd"},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.propertyName,s.tags.macroName],color:ya},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:"#61afef"},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:ka},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:Xt},{tag:[s.tags.typeName,s.tags.className,s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:"#e5c07b"},{tag:[s.tags.operator,s.tags.operatorKeyword,s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link,s.tags.special(s.tags.string)],color:"#56b6c2"},{tag:[s.tags.meta,s.tags.comment],color:Xo},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.strikethrough,textDecoration:"line-through"},{tag:s.tags.link,color:Xo,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:ya},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:ka},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted],color:"#98c379"},{tag:s.tags.invalid,color:"#ffffff"}]),Nd=[Vd,x.syntaxHighlighting(xd)],Sd=!1,po="#FAFAFA",M="#90A4AE",re="#80CBC440",xa="#272727",mo="#FAFAFA",Na="#00000010",Bd="#c2c2c222",Ed="#CFD8DC",Dd="#7E939E",_d="#FAFAFA",Sa="#7C4DFF",uo="#90A4AE",Ba="#6182B8",Td="#91B859",Id="#F76D47",Ea="#8796B0",Ld="#FFB62C",Fd="#F76D47",Od="#90A4AE",$d="#91B859",zd="#E53935",Pd="#39ADB5",Md=D.EditorView.theme({"&":{color:M,backgroundColor:po},".cm-content":{caretColor:xa},".cm-cursor, .cm-dropCursor":{borderLeftColor:xa},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:re},".cm-panels":{backgroundColor:mo,color:M},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:mo,outline:`1px solid ${Na}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:re},".cm-activeLine":{backgroundColor:Bd},".cm-selectionMatch":{backgroundColor:re},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:_d,outline:"none"},".cm-gutters":{backgroundColor:po,color:M,border:"none"},".cm-activeLineGutter":{backgroundColor:po},".cm-lineNumbers .cm-gutterElement":{color:Ed},".cm-lineNumbers .cm-activeLineGutter":{color:Dd},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:M},".cm-tooltip":{border:`1px solid ${Na}`,backgroundColor:mo,color:M},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:M,borderBottomColor:M},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:re,color:M}}},{dark:Sd}),Hd=x.HighlightStyle.define([{tag:s.tags.keyword,color:Sa},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:uo},{tag:[s.tags.propertyName],color:Ba},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:Td},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:Ba},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:Id},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:uo},{tag:[s.tags.className],color:Ld},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:Fd},{tag:[s.tags.typeName],color:Ea,fontStyle:Ea},{tag:[s.tags.operator,s.tags.operatorKeyword],color:Sa},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:Pd},{tag:[s.tags.meta,s.tags.comment],color:Od},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:$d},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:uo},{tag:s.tags.invalid,color:zd},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),Ad=[Md,x.syntaxHighlighting(Hd)],jd=!0,go="#263238",H="#EEFFFF",se="#80CBC420",Da="#FFCC00",fo="#263238",_a="#FFFFFF10",Rd="#4c616c22",Ud="#37474F",Wd="#607a86",Yd="#263238",Ta="#C792EA",Co="#EEFFFF",Ia="#82AAFF",Xd="#C3E88D",qd="#F78C6C",La="#B2CCD6",Kd="#FFCB6B",Gd="#F78C6C",Zd="#546E7A",Qd="#C3E88D",Jd="#FF5370",eh="#89DDFF",th=D.EditorView.theme({"&":{color:H,backgroundColor:go},".cm-content":{caretColor:Da},".cm-cursor, .cm-dropCursor":{borderLeftColor:Da},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:se},".cm-panels":{backgroundColor:fo,color:H},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:fo,outline:`1px solid ${_a}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:se},".cm-activeLine":{backgroundColor:Rd},".cm-selectionMatch":{backgroundColor:se},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:Yd,outline:"none"},".cm-gutters":{backgroundColor:go,color:H,border:"none"},".cm-activeLineGutter":{backgroundColor:go},".cm-lineNumbers .cm-gutterElement":{color:Ud},".cm-lineNumbers .cm-activeLineGutter":{color:Wd},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:H},".cm-tooltip":{border:`1px solid ${_a}`,backgroundColor:fo,color:H},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:H,borderBottomColor:H},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:se,color:H}}},{dark:jd}),oh=x.HighlightStyle.define([{tag:s.tags.keyword,color:Ta},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:Co},{tag:[s.tags.propertyName],color:Ia},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:Xd},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:Ia},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:qd},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:Co},{tag:[s.tags.className],color:Kd},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:Gd},{tag:[s.tags.typeName],color:La,fontStyle:La},{tag:[s.tags.operator,s.tags.operatorKeyword],color:Ta},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:eh},{tag:[s.tags.meta,s.tags.comment],color:Zd},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:Qd},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:Co},{tag:s.tags.invalid,color:Jd},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),ah=[th,x.syntaxHighlighting(oh)],lh=!1,vo="#FDF6E3",A="#586E75",ce="#EEE8D5",Fa="#657B83",yo="#FDF6E3",Oa="#D3AF86",nh="#d5bd5c22",ih="#586E75",rh="#567983",sh="#EEE8D5",$a="#859900",ko="#268BD2",za="#268BD2",ch="#2AA198",dh="#CB4B16",Pa="#CB4B16",hh="#CB4B16",ph="#D33682",mh="#93A1A1",uh="#268BD2",gh="#DC322F",fh="#DC322F",Ch=D.EditorView.theme({"&":{color:A,backgroundColor:vo},".cm-content":{caretColor:Fa},".cm-cursor, .cm-dropCursor":{borderLeftColor:Fa},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:ce},".cm-panels":{backgroundColor:yo,color:A},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:yo,outline:`1px solid ${Oa}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:ce},".cm-activeLine":{backgroundColor:nh},".cm-selectionMatch":{backgroundColor:ce},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:sh,outline:"none"},".cm-gutters":{backgroundColor:vo,color:A,border:"none"},".cm-activeLineGutter":{backgroundColor:vo},".cm-lineNumbers .cm-gutterElement":{color:ih},".cm-lineNumbers .cm-activeLineGutter":{color:rh},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:A},".cm-tooltip":{border:`1px solid ${Oa}`,backgroundColor:yo,color:A},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:A,borderBottomColor:A},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:ce,color:A}}},{dark:lh}),vh=x.HighlightStyle.define([{tag:s.tags.keyword,color:$a},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:ko},{tag:[s.tags.propertyName],color:za},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:ch},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:za},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:dh},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:ko},{tag:[s.tags.className],color:hh},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:ph},{tag:[s.tags.typeName],color:Pa,fontStyle:Pa},{tag:[s.tags.operator,s.tags.operatorKeyword],color:$a},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:fh},{tag:[s.tags.meta,s.tags.comment],color:mh},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:uh},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:ko},{tag:s.tags.invalid,color:gh},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),yh=[Ch,x.syntaxHighlighting(vh)],kh=!0,bo="#002B36",j="#93A1A1",de="#274642",Ma="#D30102",wo="#002B36",Ha="#2AA19899",bh="#005b7022",wh="#93A1A1",Vh="#949494",xh="#073642",Aa="#859900",Vo="#268BD2",ja="#268BD2",Nh="#2AA198",Sh="#CB4B16",Ra="#CB4B16",Bh="#CB4B16",Eh="#D33682",Dh="#586E75",_h="#268BD2",Th="#DC322F",Ih="#DC322F",Lh=D.EditorView.theme({"&":{color:j,backgroundColor:bo},".cm-content":{caretColor:Ma},".cm-cursor, .cm-dropCursor":{borderLeftColor:Ma},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:de},".cm-panels":{backgroundColor:wo,color:j},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:wo,outline:`1px solid ${Ha}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:de},".cm-activeLine":{backgroundColor:bh},".cm-selectionMatch":{backgroundColor:de},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:xh,outline:"none"},".cm-gutters":{backgroundColor:bo,color:j,border:"none"},".cm-activeLineGutter":{backgroundColor:bo},".cm-lineNumbers .cm-gutterElement":{color:wh},".cm-lineNumbers .cm-activeLineGutter":{color:Vh},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:j},".cm-tooltip":{border:`1px solid ${Ha}`,backgroundColor:wo,color:j},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:j,borderBottomColor:j},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:de,color:j}}},{dark:kh}),Fh=x.HighlightStyle.define([{tag:s.tags.keyword,color:Aa},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:Vo},{tag:[s.tags.propertyName],color:ja},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:Nh},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:ja},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:Sh},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:Vo},{tag:[s.tags.className],color:Bh},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:Eh},{tag:[s.tags.typeName],color:Ra,fontStyle:Ra},{tag:[s.tags.operator,s.tags.operatorKeyword],color:Aa},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:Ih},{tag:[s.tags.meta,s.tags.comment],color:Dh},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:_h},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:Vo},{tag:s.tags.invalid,color:Th},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),Oh=[Lh,x.syntaxHighlighting(Fh)],$h=!0,xo="#282A36",R="#F8F8F2",he="#44475A",Ua="#F8F8F2",No="#282A36",Wa="#191A21",zh="#53576c22",Ph="#6272A4",Mh="#F8F8F2",Hh="#44475A",Ya="#FF79C6",So="#F8F8F2",Xa="#50FA7B",Ah="#F1FA8C",jh="#BD93F9",qa="#8BE9FD",Rh="#8BE9FD",Uh="#BD93F9",Wh="#6272A4",Yh="#BD93F9",Xh="#FF5555",qh="#F1FA8C",Kh=D.EditorView.theme({"&":{color:R,backgroundColor:xo},".cm-content":{caretColor:Ua},".cm-cursor, .cm-dropCursor":{borderLeftColor:Ua},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:he},".cm-panels":{backgroundColor:No,color:R},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:No,outline:`1px solid ${Wa}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:he},".cm-activeLine":{backgroundColor:zh},".cm-selectionMatch":{backgroundColor:he},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:Hh,outline:"none"},".cm-gutters":{backgroundColor:xo,color:R,border:"none"},".cm-activeLineGutter":{backgroundColor:xo},".cm-lineNumbers .cm-gutterElement":{color:Ph},".cm-lineNumbers .cm-activeLineGutter":{color:Mh},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:R},".cm-tooltip":{border:`1px solid ${Wa}`,backgroundColor:No,color:R},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:R,borderBottomColor:R},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:he,color:R}}},{dark:$h}),Gh=x.HighlightStyle.define([{tag:s.tags.keyword,color:Ya},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:So},{tag:[s.tags.propertyName],color:Xa},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:Ah},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:Xa},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:jh},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:So},{tag:[s.tags.className],color:Rh},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:Uh},{tag:[s.tags.typeName],color:qa,fontStyle:qa},{tag:[s.tags.operator,s.tags.operatorKeyword],color:Ya},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:qh},{tag:[s.tags.meta,s.tags.comment],color:Wh},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:Yh},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:So},{tag:s.tags.invalid,color:Xh},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),Zh=[Kh,x.syntaxHighlighting(Gh)],Qh=!1,Bo="#fff",U="#444d56",pe="#0366d625",Ka="#044289",Eo="#fff",Ga="#e1e4e8",Jh="#c6c6c622",ep="#1b1f234d",tp="#24292e",op="#34d05840",Za="#d73a49",Do="#e36209",Qa="#005cc5",ap="#032f62",lp="#005cc5",Ja="#005cc5",np="#6f42c1",ip="#005cc5",rp="#6a737d",sp="#005cc5",cp="#cb2431",dp="#032f62",hp=D.EditorView.theme({"&":{color:U,backgroundColor:Bo},".cm-content":{caretColor:Ka},".cm-cursor, .cm-dropCursor":{borderLeftColor:Ka},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:pe},".cm-panels":{backgroundColor:Eo,color:U},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:Eo,outline:`1px solid ${Ga}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:pe},".cm-activeLine":{backgroundColor:Jh},".cm-selectionMatch":{backgroundColor:pe},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:op,outline:"none"},".cm-gutters":{backgroundColor:Bo,color:U,border:"none"},".cm-activeLineGutter":{backgroundColor:Bo},".cm-lineNumbers .cm-gutterElement":{color:ep},".cm-lineNumbers .cm-activeLineGutter":{color:tp},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:U},".cm-tooltip":{border:`1px solid ${Ga}`,backgroundColor:Eo,color:U},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:U,borderBottomColor:U},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:pe,color:U}}},{dark:Qh}),pp=x.HighlightStyle.define([{tag:s.tags.keyword,color:Za},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:Do},{tag:[s.tags.propertyName],color:Qa},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:ap},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:Qa},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:lp},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:Do},{tag:[s.tags.className],color:np},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:ip},{tag:[s.tags.typeName],color:Ja,fontStyle:Ja},{tag:[s.tags.operator,s.tags.operatorKeyword],color:Za},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:dp},{tag:[s.tags.meta,s.tags.comment],color:rp},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:sp},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:Do},{tag:s.tags.invalid,color:cp},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),mp=[hp,x.syntaxHighlighting(pp)],up=!0,_o="#24292e",W="#d1d5da",me="#3392FF44",el="#c8e1ff",To="#24292e",tl="#1b1f23",gp="#4d566022",fp="#444d56",Cp="#e1e4e8",vp="#17E5E650",ol="#f97583",Io="#ffab70",al="#79b8ff",yp="#9ecbff",kp="#79b8ff",ll="#79b8ff",bp="#b392f0",wp="#79b8ff",Vp="#6a737d",xp="#79b8ff",Np="#f97583",Sp="#9ecbff",Bp=D.EditorView.theme({"&":{color:W,backgroundColor:_o},".cm-content":{caretColor:el},".cm-cursor, .cm-dropCursor":{borderLeftColor:el},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:me},".cm-panels":{backgroundColor:To,color:W},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:To,outline:`1px solid ${tl}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:me},".cm-activeLine":{backgroundColor:gp},".cm-selectionMatch":{backgroundColor:me},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:vp,outline:"none"},".cm-gutters":{backgroundColor:_o,color:W,border:"none"},".cm-activeLineGutter":{backgroundColor:_o},".cm-lineNumbers .cm-gutterElement":{color:fp},".cm-lineNumbers .cm-activeLineGutter":{color:Cp},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:W},".cm-tooltip":{border:`1px solid ${tl}`,backgroundColor:To,color:W},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:W,borderBottomColor:W},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:me,color:W}}},{dark:up}),Ep=x.HighlightStyle.define([{tag:s.tags.keyword,color:ol},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:Io},{tag:[s.tags.propertyName],color:al},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:yp},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:al},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:kp},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:Io},{tag:[s.tags.className],color:bp},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:wp},{tag:[s.tags.typeName],color:ll,fontStyle:ll},{tag:[s.tags.operator,s.tags.operatorKeyword],color:ol},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:Sp},{tag:[s.tags.meta,s.tags.comment],color:Vp},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:xp},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:Io},{tag:s.tags.invalid,color:Np},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),Dp=[Bp,x.syntaxHighlighting(Ep)],_p=!0,Lo="#21202e",Y="#edecee",ue="#3d375e7f",nl="#a277ff",Fo="#21202e",il="#3b334b",Tp="#4d4b6622",Ip="#a394f033",Lp="#cdccce",Fp="#a394f033",rl="#a277ff",Oo="#edecee",sl="#ffca85",Op="#61ffca",$p="#61ffca",cl="#82e2ff",zp="#82e2ff",Pp="#61ffca",Mp="#6d6d6d",Hp="#a277ff",Ap="#ff6767",jp="#61ffca",Rp=D.EditorView.theme({"&":{color:Y,backgroundColor:Lo},".cm-content":{caretColor:nl},".cm-cursor, .cm-dropCursor":{borderLeftColor:nl},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:ue},".cm-panels":{backgroundColor:Fo,color:Y},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:Fo,outline:`1px solid ${il}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:ue},".cm-activeLine":{backgroundColor:Tp},".cm-selectionMatch":{backgroundColor:ue},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:Fp,outline:"none"},".cm-gutters":{backgroundColor:Lo,color:Y,border:"none"},".cm-activeLineGutter":{backgroundColor:Lo},".cm-lineNumbers .cm-gutterElement":{color:Ip},".cm-lineNumbers .cm-activeLineGutter":{color:Lp},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:Y},".cm-tooltip":{border:`1px solid ${il}`,backgroundColor:Fo,color:Y},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Y,borderBottomColor:Y},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:ue,color:Y}}},{dark:_p}),Up=x.HighlightStyle.define([{tag:s.tags.keyword,color:rl},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:Oo},{tag:[s.tags.propertyName],color:sl},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:Op},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:sl},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:$p},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:Oo},{tag:[s.tags.className],color:zp},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:Pp},{tag:[s.tags.typeName],color:cl,fontStyle:cl},{tag:[s.tags.operator,s.tags.operatorKeyword],color:rl},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:jp},{tag:[s.tags.meta,s.tags.comment],color:Mp},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:Hp},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:Oo},{tag:s.tags.invalid,color:Ap},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),Wp=[Rp,x.syntaxHighlighting(Up)],Yp=!0,$o="#1a1b26",X="#787c99",ge="#515c7e40",dl="#c0caf5",zo="#1a1b26",hl="#787c99",Xp="#43455c22",qp="#363b54",Kp="#737aa2",Gp="#16161e",pl="#bb9af7",Po="#c0caf5",ml="#7aa2f7",Zp="#9ece6a",Qp="#bb9af7",ul="#0db9d7",Jp="#c0caf5",em="#ff9e64",tm="#444b6a",om="#89ddff",am="#ff5370",lm="#b4f9f8",nm=D.EditorView.theme({"&":{color:X,backgroundColor:$o},".cm-content":{caretColor:dl},".cm-cursor, .cm-dropCursor":{borderLeftColor:dl},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:ge},".cm-panels":{backgroundColor:zo,color:X},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:zo,outline:`1px solid ${hl}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:ge},".cm-activeLine":{backgroundColor:Xp},".cm-selectionMatch":{backgroundColor:ge},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:Gp,outline:"none"},".cm-gutters":{backgroundColor:$o,color:X,border:"none"},".cm-activeLineGutter":{backgroundColor:$o},".cm-lineNumbers .cm-gutterElement":{color:qp},".cm-lineNumbers .cm-activeLineGutter":{color:Kp},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:X},".cm-tooltip":{border:`1px solid ${hl}`,backgroundColor:zo,color:X},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:X,borderBottomColor:X},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:ge,color:X}}},{dark:Yp}),im=x.HighlightStyle.define([{tag:s.tags.keyword,color:pl},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:Po},{tag:[s.tags.propertyName],color:ml},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:Zp},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:ml},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:Qp},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:Po},{tag:[s.tags.className],color:Jp},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:em},{tag:[s.tags.typeName],color:ul,fontStyle:ul},{tag:[s.tags.operator,s.tags.operatorKeyword],color:pl},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:lm},{tag:[s.tags.meta,s.tags.comment],color:tm},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:om},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:Po},{tag:s.tags.invalid,color:am},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),rm=[nm,x.syntaxHighlighting(im)],sm=!0,Mo="#24283b",q="#7982a9",fe="#6f7bb630",gl="#c0caf5",Ho="#24283b",fl="#7982a9",cm="#4d547722",dm="#3b4261",hm="#737aa2",pm="#1f2335",Cl="#bb9af7",Ao="#c0caf5",vl="#7aa2f7",mm="#9ece6a",um="#bb9af7",yl="#2ac3de",gm="#c0caf5",fm="#ff9e64",Cm="#565f89",vm="#89ddff",ym="#ff5370",km="#b4f9f8",bm=D.EditorView.theme({"&":{color:q,backgroundColor:Mo},".cm-content":{caretColor:gl},".cm-cursor, .cm-dropCursor":{borderLeftColor:gl},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:fe},".cm-panels":{backgroundColor:Ho,color:q},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:Ho,outline:`1px solid ${fl}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:fe},".cm-activeLine":{backgroundColor:cm},".cm-selectionMatch":{backgroundColor:fe},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:pm,outline:"none"},".cm-gutters":{backgroundColor:Mo,color:q,border:"none"},".cm-activeLineGutter":{backgroundColor:Mo},".cm-lineNumbers .cm-gutterElement":{color:dm},".cm-lineNumbers .cm-activeLineGutter":{color:hm},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:q},".cm-tooltip":{border:`1px solid ${fl}`,backgroundColor:Ho,color:q},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:q,borderBottomColor:q},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:fe,color:q}}},{dark:sm}),wm=x.HighlightStyle.define([{tag:s.tags.keyword,color:Cl},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:Ao},{tag:[s.tags.propertyName],color:vl},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:mm},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:vl},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:um},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:Ao},{tag:[s.tags.className],color:gm},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:fm},{tag:[s.tags.typeName],color:yl,fontStyle:yl},{tag:[s.tags.operator,s.tags.operatorKeyword],color:Cl},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:km},{tag:[s.tags.meta,s.tags.comment],color:Cm},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:vm},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:Ao},{tag:s.tags.invalid,color:ym},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),Vm=[bm,x.syntaxHighlighting(wm)],xm=!1,jo="#e1e2e7",K="#6a6f8e",Ce="#8591b840",kl="#3760bf",Ro="#e1e2e7",bl="#6a6f8e",Nm="#a7aaba22",Sm="#b3b6cd",Bm="#68709a",Em="#e9e9ec",wl="#9854f1",Uo="#3760bf",Vl="#2e7de9",Dm="#587539",_m="#9854f1",xl="#07879d",Tm="#3760bf",Im="#b15c00",Lm="#9da3c2",Fm="#006a83",Om="#ff3e64",$m="#2e5857",zm=D.EditorView.theme({"&":{color:K,backgroundColor:jo},".cm-content":{caretColor:kl},".cm-cursor, .cm-dropCursor":{borderLeftColor:kl},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Ce},".cm-panels":{backgroundColor:Ro,color:K},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:Ro,outline:`1px solid ${bl}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:Ce},".cm-activeLine":{backgroundColor:Nm},".cm-selectionMatch":{backgroundColor:Ce},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:Em,outline:"none"},".cm-gutters":{backgroundColor:jo,color:K,border:"none"},".cm-activeLineGutter":{backgroundColor:jo},".cm-lineNumbers .cm-gutterElement":{color:Sm},".cm-lineNumbers .cm-activeLineGutter":{color:Bm},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:K},".cm-tooltip":{border:`1px solid ${bl}`,backgroundColor:Ro,color:K},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:K,borderBottomColor:K},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:Ce,color:K}}},{dark:xm}),Pm=x.HighlightStyle.define([{tag:s.tags.keyword,color:wl},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:Uo},{tag:[s.tags.propertyName],color:Vl},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:Dm},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:Vl},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:_m},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:Uo},{tag:[s.tags.className],color:Tm},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:Im},{tag:[s.tags.typeName],color:xl,fontStyle:xl},{tag:[s.tags.operator,s.tags.operatorKeyword],color:wl},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:$m},{tag:[s.tags.meta,s.tags.comment],color:Lm},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:Fm},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:Uo},{tag:s.tags.invalid,color:Om},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),Mm=[zm,x.syntaxHighlighting(Pm)],Hm={disabled:!1,indentWithTab:!0,tabSize:4,autofocus:!1,placeholder:"input...",backgroundColor:"white",language:"markdown",theme:"oneDark",phrases:"en-us"},Rl={emits:["update:config"],components:{CodemirrorEditor:wd},data:()=>({codemrrConfig:{...Hm},codemrrThemes:{oneDark:Nd,materialLight:Ad,materialDark:ah,solarizedLight:yh,solarizedDark:Oh,dracula:Zh,githubLight:mp,githubDark:Dp,aura:Wp,tokyoNight:rm,tokyoNightStorm:Vm,tokyoNightDay:Mm},codemrrLanguages:{javascript:aa.javascript(),js:aa.javascript(),html:hn.html(),markdown:mn.markdown(),json:pn.json(),vue:un.vue(),java:fn.java(),php:gn.php(),python:Cn.python(),go:yn.go(),mysql:la.sql(),sql:la.sql(),xml:vn.xml(),css:kn.css()},codemrrPhrases:{"Control character":"Steuerzeichen","Selection deleted":"Auswahl gelöscht","Folded lines":"Eingeklappte Zeilen","Unfolded lines":"Ausgeklappte Zeilen",to:"bis","folded code":"eingeklappter Code",unfold:"ausklappen","Fold line":"Zeile einklappen","Unfold line":"Zeile ausklappen","Go to line":"Springe zu Zeile",go:"OK",Find:"Suchen",Replace:"Ersetzen",next:"nächste",previous:"vorherige",all:"alle","match case":"groß/klein beachten","by word":"ganze Wörter",replace:"ersetzen","replace all":"alle ersetzen",close:"schließen","current match":"aktueller Treffer","replaced $ matches":"$ Treffer ersetzt","replaced match on line $":"Treffer on Zeile $ ersetzt","on line":"auf Zeile",Completions:"Vervollständigungen",Diagnostics:"Diagnosen","No diagnostics":"Keine Diagnosen"},editorViewInst:null,editorStateInst:null}),computed:{optionTheme(){let t=Object.keys(this.codemrrThemes);return["default"].concat(t)},optionPhrases:()=>["en-us","de-de"],optionLanguage(){return Object.keys(this.codemrrLanguages)},extensions(){const t=[];return t.push(this.codemrrLanguages[this.codemrrConfig.language]),this.codemrrThemes[this.codemrrConfig.theme]&&t.push(this.codemrrThemes[this.codemrrConfig.theme]),t},codemrrBind(){return{theme:this.codemrrConfig.theme,language:this.codemrrConfig.language,autofocus:this.codemrrConfig.autofocus,placeholder:this.codemrrConfig.placeholder,indentWithTab:this.codemrrConfig.indentWithTab,tabSize:this.codemrrConfig.tabSize,disabled:this.codemrrConfig.disabled,phrases:this.codemrrConfig.phrases==="en-us"?{}:this.codemrrPhrases}}},watch:{codemrrConfig(t){this.$emit("update:config",t)}}},ae={props:{editorID:{type:[String],required:!1,default:()=>""}},data:()=>({editorRefEL:null}),computed:{editorRefID(){return this.editorID?this.editorID:this.$options.name+ +new Date+((1e3*Math.random()).toFixed(0)+"")}}};function Ul(t,o){var a=document.createElement("a");if(a.setAttribute("href","data:text/plain;charset=UTF-8,"+encodeURIComponent(t)),a.setAttribute("download",o),a.style.display="none",document.createEvent){const i=document.createEvent("MouseEvents");i.initEvent("click",!0,!0),a.dispatchEvent(i)}else a.click()}function ve(t){return t<10?"0"+t:t}const Am={undo:!1,redo:!1,strong:!0,italic:!0,overline:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,hr:!0,quote:!0,ul:!0,ol:!0,notChecked:!0,checked:!0,link:!0,table:!0,image:!0,uploadImage:!0,custom_image:!0,custom_uploadImage:!0,custom_uploadFile:!0,importmd:!0,exportmd:!0,code:!0,html_to_markdown:!0,split:!0,preview:!0,scrollSync:!0,save:!0,clear:!0,copy:!0,toc:!0,fullscreen:!0,theme:!0,backgroundColor:!1,language:!1,phrases:!1,disabled:!1,autofocus:!1,indentWithTab:!1},jm={t:"1713021153946",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1924",width:"20",height:"20"},Rm={t:"1599285632421",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"45640",width:"17",height:"17"},Um={t:"1611551476626",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4615",width:"22",height:"22"},Wm={t:"1713097613984",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"6856",width:"18",height:"18"},Ym={t:"1713109019954",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"13071",width:"18",height:"18"},Qo={components:{SvgImgMap:v({name:"SvgImgMap"},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("svg",jm,o[0]||(o[0]=[e.createElementVNode("path",{d:"M659.456 786.432l-114.688-188.416c-4.10112-8.192-8.19712-12.28288-16.384-12.28288-4.096 0-8.19712 4.096-12.288 4.096l-57.344 57.344-61.44-90.11712c-4.096-8.192-8.192-12.28288-16.384-12.28288s-12.288 4.096-16.384 8.192l-151.552 225.28c0 4.096-4.096 8.192-4.096 12.288 0 12.28288 8.192 20.48 20.48 20.48h413.696c12.288 0 20.48-8.19712 20.48-20.48l-4.096-4.10112zM286.72 512c40.96 0 73.728-32.768 73.728-73.728S327.68 364.544 286.72 364.544s-73.728 32.768-73.728 73.728C208.896 479.232 245.76 512 286.72 512zM851.968 98.304H323.584c-40.96 0-73.728 32.768-73.728 73.728v20.48c0 12.288 8.192 20.48 20.48 20.48s16.384-12.288 16.384-20.48v-20.48c0-20.48 16.384-36.864 36.864-36.864h528.384c20.48 0 36.85888 16.384 36.85888 36.864v528.384c0 20.48-16.37888 36.864-36.85888 36.864h-20.48c-12.288 0-20.48 8.192-20.48 20.48s8.192 20.48 20.48 20.48h20.48c40.96 0 73.72288-32.768 73.72288-73.728v-532.48c0.00512-40.96-32.76288-73.728-73.72288-73.728z","p-id":"1925"},null,-1),e.createElementVNode("path",{d:"M700.416 249.856H172.032c-40.96 0-73.728 32.768-73.728 73.728v528.384c0 40.96 32.768 73.72288 73.728 73.72288h528.384c40.96 0 73.728-32.76288 73.728-73.72288V323.584c0-40.96-32.768-73.728-73.728-73.728z m36.864 602.112c0 20.48-16.384 36.85888-36.864 36.85888H172.032c-20.48 0-36.864-16.37888-36.864-36.85888V323.584c0-20.48 16.384-36.864 36.864-36.864h528.384c20.48 0 36.864 16.384 36.864 36.864v528.384z","p-id":"1926"},null,-1)]))}]]),SvgUploadFile:v({name:"SvgUploadFile"},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("svg",Rm,o[0]||(o[0]=[e.createElementVNode("path",{d:"M127.519 892.879v-763.34h655.448V514.69h63.612V81.831c0-8.783-7.12-15.903-15.903-15.903H79.81c-8.783 0-15.903 7.12-15.903 15.903v858.757c0 8.783 7.12 15.903 15.903 15.903h493.993v-63.612H127.519z","p-id":"45641"},null,-1),e.createElementVNode("path",{d:"M231.608 228.388h447.269V292H231.608zM231.608 384.409h447.269v63.612H231.608zM231.608 540.43h245.141v63.612H231.608zM231.608 696.451h245.141v63.612H231.608zM923.269 762.938L745.315 584.984c-3.545-3.545-8.34-5.074-12.966-4.596a15.931 15.931 0 0 0-9.848 4.616L544.586 762.918c-6.248 6.248-6.248 16.379 0 22.627l22.353 22.353c6.248 6.248 16.379 6.248 22.627 0l112.555-112.555v245.148c0 8.837 7.163 16 16 16h31.612c8.837 0 16-7.163 16-16V695.363l112.555 112.555c6.248 6.248 16.379 6.248 22.627 0l22.353-22.353c6.249-6.248 6.249-16.378 0.001-22.627z","p-id":"45642"},null,-1)]))}]]),SvgToc:v({name:"SvgToc"},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("svg",Um,o[0]||(o[0]=[e.createElementVNode("path",{d:"M370.1 371.5h-49.6c-3.1 0-5.7-2.5-5.7-5.7v-49.6c0-3.1 2.5-5.7 5.7-5.7h49.6c3.1 0 5.7 2.5 5.7 5.7v49.6c0 3.1-2.6 5.7-5.7 5.7z m333.5-7.6H460.5c-3.1 0-5.7-2.5-5.7-5.7v-34.5c0-3.1 2.5-5.7 5.7-5.7h243.2c3.1 0 5.7 2.5 5.7 5.7v34.5c-0.1 3.2-2.7 5.7-5.8 5.7zM370.1 712.4h-49.6c-3.1 0-5.7-2.5-5.7-5.7v-49.6c0-3.1 2.5-5.7 5.7-5.7h49.6c3.1 0 5.7 2.5 5.7 5.7v49.6c0 3.2-2.6 5.7-5.7 5.7z m333.5-7.5H460.5c-3.1 0-5.7-2.5-5.7-5.7v-34.5c0-3.1 2.5-5.7 5.7-5.7h243.2c3.1 0 5.7 2.5 5.7 5.7v34.5c-0.1 3.1-2.7 5.7-5.8 5.7zM370.1 542.5h-49.6c-3.1 0-5.7-2.5-5.7-5.7v-49.6c0-3.1 2.5-5.7 5.7-5.7h49.6c3.1 0 5.7 2.5 5.7 5.7v49.6c0 3.1-2.6 5.7-5.7 5.7z m333.5-7.6H460.5c-3.1 0-5.7-2.5-5.7-5.7v-34.5c0-3.1 2.5-5.7 5.7-5.7h243.2c3.1 0 5.7 2.5 5.7 5.7v34.5c-0.1 3.2-2.7 5.7-5.8 5.7z","p-id":"4616"},null,-1),e.createElementVNode("path",{d:"M847.1 560.4V250.1s0-24.7-14-46.4c-10.8-16.8-30-31.8-64.2-31.8h-261c-0.2 0-0.3 0-0.5 0.1H255s-78.1 0-78.1 78.1l0.1 213.4V774s0 24.7 13.9 46.3c10.8 16.8 30 31.8 64.2 31.8h261.1c0.2 0 0.3 0 0.5-0.1H769s78.1 0 78.1-78.1l-0.1-213.4 0.1-0.1z m-39 213.6c-1.3 38.5-38.9 39-38.9 39h-514c-1.3-0.1-2.5-0.2-3.8-0.3-5.4-1.1-15.7-4.1-23.9-11.7-9-9.7-11.2-22.3-11.7-26.1v-0.7l0.1-524.2c1.3-38.5 38.9-39 38.9-39h514c1.3 0.1 2.5 0.2 3.7 0.3 5.4 1.1 15.7 4.1 23.9 11.7 9 9.7 11.2 22.2 11.7 26 0 0.2 0 0.5 0.1 0.7l-0.1 524.3z","p-id":"4617"},null,-1)]))}]]),SvgCopy:v({name:"SvgCopy"},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("svg",Wm,o[0]||(o[0]=[e.createElementVNode("path",{d:"M857.373005 65.290005 469.604424 65.290005c-34.211173 0-62.044078 27.832905-62.044078 62.043055l0 10.340509-63.076594 0c-25.993001 0-48.228421 16.346293-57.001225 39.293935L166.626995 176.967504c-34.21015 0-62.043055 27.832905-62.043055 62.043055l0 657.655358c0 34.21015 27.832905 62.043055 62.043055 62.043055l550.115086 0c34.21015 0 62.043055-27.832905 62.043055-62.043055l0-49.634444 78.587869 0c34.21015 0 62.043055-27.832905 62.043055-62.043055L919.41606 127.33306C919.41606 93.122911 891.583155 65.290005 857.373005 65.290005zM344.483752 179.035606l194.402595 0c10.833743 0 19.646456 8.813736 19.646456 19.646456 0 10.833743-8.813736 19.646456-19.646456 19.646456L344.483752 218.328517c-10.833743 0-19.646456-8.813736-19.646456-19.646456C324.836273 187.849342 333.650009 179.035606 344.483752 179.035606zM737.423099 896.665917c0 11.402701-9.278317 20.681018-20.681018 20.681018L166.626995 917.346935c-11.403724 0-20.681018-9.278317-20.681018-20.681018L145.945977 239.010559c0-11.402701 9.277294-20.681018 20.681018-20.681018l120.111588 0c8.197706 24.02723 30.977525 41.362037 57.744145 41.362037l194.402595 0c26.767644 0 49.54644-17.334807 57.744145-41.362037l120.111588 0c11.402701 0 20.681018 9.278317 20.681018 20.681018L737.422076 896.665917zM878.054023 784.988418c0 11.402701-9.278317 20.681018-20.681018 20.681018l-78.587869 0L778.785136 239.010559c0-34.21015-27.832905-62.043055-62.043055-62.043055L595.886549 176.967504c-8.771781-22.947641-31.007201-39.293935-57.001225-39.293935l-89.963964 0L448.921359 127.33306c0-11.403724 9.278317-20.681018 20.683065-20.681018l387.768581 0c11.402701 0 20.681018 9.277294 20.681018 20.681018L878.054023 784.988418z","p-id":"6857"},null,-1),e.createElementVNode("path",{d:"M620.597347 334.252737 260.748652 334.252737c-11.422144 0-20.681018 9.259898-20.681018 20.681018s9.258874 20.681018 20.681018 20.681018l359.849718 0c11.42112 0 20.681018-9.259898 20.681018-20.681018S632.018467 334.252737 620.597347 334.252737z","p-id":"6858"},null,-1),e.createElementVNode("path",{d:"M620.597347 454.201619 260.748652 454.201619c-11.422144 0-20.681018 9.259898-20.681018 20.681018 0 11.42112 9.258874 20.681018 20.681018 20.681018l359.849718 0c11.42112 0 20.681018-9.259898 20.681018-20.681018C641.278365 463.46254 632.018467 454.201619 620.597347 454.201619z","p-id":"6859"},null,-1),e.createElementVNode("path",{d:"M440.673511 574.151525 260.748652 574.151525c-11.422144 0-20.681018 9.259898-20.681018 20.681018 0 11.42112 9.258874 20.681018 20.681018 20.681018l179.924859 0c11.42112 0 20.681018-9.259898 20.681018-20.681018C461.35453 583.411423 452.093609 574.151525 440.673511 574.151525z","p-id":"6860"},null,-1)]))}]]),SvgLanguage:v({name:"SvgLanguage"},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("svg",Ym,o[0]||(o[0]=[e.createElementVNode("path",{d:"M200.313605 806.764028h487.993851v78.708685h-487.993851z",fill:"#6C7280","p-id":"13072"},null,-1),e.createElementVNode("path",{d:"M809.518832 136.166026H79.102229a78.708686 78.708686 0 0 0-78.708686 78.708686V944.504228a78.708686 78.708686 0 0 0 78.708686 78.708685h730.416603a78.708686 78.708686 0 0 0 78.708685-78.708685V214.874712a78.708686 78.708686 0 0 0-78.708685-78.708686z m0 848.479631V944.504228H79.102229V214.874712h730.416603V944.504228z","p-id":"13073"},null,-1),e.createElementVNode("path",{d:"M944.897771 0H171.978478v78.708686H944.897771v787.086856h78.708686V78.708686a78.708686 78.708686 0 0 0-78.708686-78.708686z","p-id":"13074"},null,-1),e.createElementVNode("path",{d:"M360.092237 609.205227h161.352805l44.863951 117.275941h58.244427l-157.417371-385.672559h-55.09608L263.280553 725.694081H315.228286z m57.45734-157.417372a487.206764 487.206764 0 0 0 20.464259-73.986164q8.657955 31.483474 27.548039 78.708686l40.14143 107.043812H375.046887z","p-id":"13075"},null,-1)]))}]])},emits:["on-action","on-act-copy","on-act-save","on-act-theme","on-act-custom","on-act-choose-image"],props:{exportFileName:{type:String,default:""},toolbars:{type:Object,default:()=>({})},isPreview:{type:Boolean,default:!1},isFullscreen:{type:Boolean,default:!1}},data:()=>({actionThemeDropdown:!1,actionPhrasesDropdown:!1,actionLanguageDropdown:!1,actionBgColorDropdown:!1,actionSplit:!0,actionPreview:!1,actionScrollSync:!0,actionToc:!0,actionFullscreen:!1,actionHtmlDiaVisible:!1,actionHtmlText:""}),computed:{lastExpFileName(){let t=new Date,o=t.getFullYear(),a=t.getMonth()+1,i=t.getDate(),l=t.getHours(),n=t.getMinutes(),r=o+"-"+ve(a)+"-"+ve(i)+"_"+ve(l)+"-"+ve(n);return this.exportFileName||r},toolConfig(){const{toolbars:t={}}=this;return{...Am,...t}}},created(){this.actionPreview=this.isPreview||!1},methods:{actionPhrasesSet(t){this.codemrrConfig.phrases=t,this.actionPhrasesDropdown=!1},actionLanguageSet(t){this.codemrrConfig.language=t,this.actionLanguageDropdown=!1},actionBgColorSet(t){this.codemrrConfig.backgroundColor=t,this.actionBgColorDropdown=!1},actionThemesSet(t){this.codemrrConfig.theme=t,this.actionThemeDropdown=!1,this.$emit("on-act-theme",t)},actionFullscreenSet(t){this.actionFullscreen=t;let o=this.$refs[this.editorWrapRefID];t?o.classList.add("fullscreen"):o.classList.remove("fullscreen"),this.actionCurrent("fullscreen",t)},actionChooseImage(){const t=document.createElement("input");t.type="file",t.accept="image/*",t.onchange=()=>{const o=t.files;o[0]&&(this.$emit("on-act-choose-image",o[0]),t.value="")},t.click()},actionInsBg(){const t=this.getLastPoint(),o=t.content||!1;o?this.insertContent("=="+o+"=="):(this.insertContent("===="),this.setCursor(t.line,t.ch+1))},actionUndo(){if(this.editorViewInst){const t=this.editorViewInst.state.behavior(O.EditorState.effect(O.EditorState.undo));this.editorViewInst.update([{changes:{from:0,to:t.doc.length,insert:t.doc},selection:O.EditorSelection.single(0)}])}},actionRedo(){this.editorViewInst&&this.editorViewInst.dispatch({...this.editorViewInst.state,effects:O.EditorState.redo()})},actionInsStrong(){const t=this.getLastPoint(),o=t.content||!1;let a="";o?(a="**"+o+"**",this.deleteContent(t.start,t.end),this.insertContent(t.start,a)):(a="****",this.insertContent(t.start,a)),this.setCursor(t.start+a.length,t.start+a.length)},actionInsItalic(){const t=this.getLastPoint(),o=t.content||!1;let a="";o?(a="*"+o+"*",this.deleteContent(t.start,t.end),this.insertContent(t.start,a)):(a="**",this.insertContent(t.start,a)),this.setCursor(t.start+a.length,t.start+a.length)},actionInsOverline(){const t=this.getLastPoint(),o=t.content||!1;let a="";o?(a="~~"+o+"~~",this.deleteContent(t.start,t.end),this.insertContent(t.start,a)):(a="~~~~",this.insertContent(t.start,a)),this.setCursor(t.start+a.length,t.start+a.length)},actionInsUnderline(){const t=this.getLastPoint(),o=t.content||!1;let a="";o?(a="<u>"+o+"</u>",this.deleteContent(t.start,t.end),this.insertContent(t.start,a)):(a="<u></u>",this.insertContent(t.start,a)),this.setCursor(t.start+a.length,t.start+a.length)},actionInsTitle(t){const o={1:"# ",2:"## ",3:"### ",4:"#### ",5:"##### ",6:"###### "}[t],a=this.getLastPoint(),i=a.content||!1;let l=`
|
|
7
|
+
</div>`,this.$emit("real-time",i)},reload(){let t=new Image;t.onload=()=>{this.w=parseFloat(window.getComputedStyle(this.$refs.cropper).width),this.h=parseFloat(window.getComputedStyle(this.$refs.cropper).height),this.trueWidth=t.width,this.trueHeight=t.height,this.original?this.scale=1:this.scale=this.checkedMode(),this.$nextTick(()=>{this.x=-(this.trueWidth-this.trueWidth*this.scale)/2+(this.w-this.trueWidth*this.scale)/2,this.y=-(this.trueHeight-this.trueHeight*this.scale)/2+(this.h-this.trueHeight*this.scale)/2,this.loading=!1,this.autoCrop&&this.goAutoCrop(),this.$emit("img-load","success"),setTimeout(()=>{this.showPreview()},20)})},t.onerror=()=>{this.$emit("img-load","error")},t.src=this.imgs},checkedMode(){let t=1,o=this.trueWidth,a=this.trueHeight;const i=this.mode.split(" ");switch(i[0]){case"contain":this.trueWidth>this.w&&(t=this.w/this.trueWidth),this.trueHeight*t>this.h&&(t=this.h/this.trueHeight);break;case"cover":o=this.w,t=o/this.trueWidth,a*=t,a<this.h&&(a=this.h,t=a/this.trueHeight);break;default:try{let l=i[0];if(l.search("px")!==-1){l=l.replace("px",""),o=parseFloat(l);const n=o/this.trueWidth;let r=1,c=i[1];c.search("px")!==-1&&(c=c.replace("px",""),a=parseFloat(c),r=a/this.trueHeight),t=Math.min(n,r)}if(l.search("%")!==-1&&(l=l.replace("%",""),o=parseFloat(l)/100*this.w,t=o/this.trueWidth),i.length===2&&l==="auto"){let n=i[1];n.search("px")!==-1&&(n=n.replace("px",""),a=parseFloat(n),t=a/this.trueHeight),n.search("%")!==-1&&(n=n.replace("%",""),a=parseFloat(n)/100*this.h,t=a/this.trueHeight)}}catch{t=1}}return t},goAutoCrop(t,o){if(this.imgs===""||this.imgs===null)return;this.clearCrop(),this.cropping=!0;let a=this.w,i=this.h;if(this.centerBox){const r=Math.abs(this.rotate)%2>0;let c=(r?this.trueHeight:this.trueWidth)*this.scale,h=(r?this.trueWidth:this.trueHeight)*this.scale;a=c<a?c:a,i=h<i?h:i}var l=t||parseFloat(this.autoCropWidth),n=o||parseFloat(this.autoCropHeight);(l===0||n===0)&&(l=.8*a,n=.8*i),l=l>a?a:l,n=n>i?i:n,this.fixed&&(n=l/this.fixedNumber[0]*this.fixedNumber[1]),n>this.h&&(l=(n=this.h)/this.fixedNumber[1]*this.fixedNumber[0]),this.changeCrop(l,n)},changeCrop(t,o){if(this.centerBox){let a=this.getImgAxis();t>a.x2-a.x1&&(o=(t=a.x2-a.x1)/this.fixedNumber[0]*this.fixedNumber[1]),o>a.y2-a.y1&&(t=(o=a.y2-a.y1)/this.fixedNumber[1]*this.fixedNumber[0])}this.cropW=t,this.cropH=o,this.checkCropLimitSize(),this.$nextTick(()=>{this.cropOffsertX=(this.w-this.cropW)/2,this.cropOffsertY=(this.h-this.cropH)/2,this.centerBox&&this.moveCrop(null,!0)})},refresh(){this.img,this.imgs="",this.scale=1,this.crop=!1,this.rotate=0,this.w=0,this.h=0,this.trueWidth=0,this.trueHeight=0,this.imgIsQqualCrop=!1,this.clearCrop(),this.$nextTick(()=>{this.checkedImg()})},rotateLeft(){this.rotate=this.rotate<=-3?0:this.rotate-1},rotateRight(){this.rotate=this.rotate>=3?0:this.rotate+1},rotateClear(){this.rotate=0},checkoutImgAxis(t,o,a){t=t||this.x,o=o||this.y,a=a||this.scale;let i=!0;if(this.centerBox){let l=this.getImgAxis(t,o,a),n=this.getCropAxis();l.x1>=n.x1&&(i=!1),l.x2<=n.x2&&(i=!1),l.y1>=n.y1&&(i=!1),l.y2<=n.y2&&(i=!1),i||this.changeImgScale(l,n,a)}return i},changeImgScale(t,o,a){let i=this.trueWidth,l=this.trueHeight,n=i*a,r=l*a;if(n>=this.cropW&&r>=this.cropH)this.scale=a;else{const c=this.cropW/i,h=this.cropH/l,d=this.cropH<=l*c?c:h;this.scale=d,n=i*d,r=l*d}this.imgIsQqualCrop||(t.x1>=o.x1&&(this.isRotateRightOrLeft?this.x=o.x1-(i-n)/2-(n-r)/2:this.x=o.x1-(i-n)/2),t.x2<=o.x2&&(this.isRotateRightOrLeft?this.x=o.x1-(i-n)/2-(n-r)/2-r+this.cropW:this.x=o.x2-(i-n)/2-n),t.y1>=o.y1&&(this.isRotateRightOrLeft?this.y=o.y1-(l-r)/2-(r-n)/2:this.y=o.y1-(l-r)/2),t.y2<=o.y2&&(this.isRotateRightOrLeft?this.y=o.y2-(l-r)/2-(r-n)/2-n:this.y=o.y2-(l-r)/2-r)),(n<this.cropW||r<this.cropH)&&(this.imgIsQqualCrop=!0)}},mounted(){this.support="onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll";let t=this;var o=navigator.userAgent;this.isIOS=!!o.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(a,i,l){for(var n=atob(this.toDataURL(i,l).split(",")[1]),r=n.length,c=new Uint8Array(r),h=0;h<r;h++)c[h]=n.charCodeAt(h);a(new Blob([c],{type:t.type||"image/png"}))}}),this.showPreview(),this.checkedImg()},unmounted(){window.removeEventListener("mousemove",this.moveCrop),window.removeEventListener("mouseup",this.leaveCrop),window.removeEventListener("touchmove",this.moveCrop),window.removeEventListener("touchend",this.leaveCrop),this.cancelScale()}}),mi={key:0,class:"cropper-box"},ui=["src"],gi={class:"cropper-view-box"},fi=["src"],Ci={key:1},vi={props:{loading:{type:[Boolean],default:!1},modelValue:{type:[Boolean],default:!1},src:{type:[String],default:""},size:{type:[Number],default:120},title:{type:[String],default:"裁剪"}},components:{VueCropper:hi(pi,[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",{class:"vue-cropper",ref:"cropper",onMouseover:o[28]||(o[28]=(...r)=>t.scaleImg&&t.scaleImg(...r)),onMouseout:o[29]||(o[29]=(...r)=>t.cancelScale&&t.cancelScale(...r))},[t.imgs?(e.openBlock(),e.createElementBlock("div",mi,[e.withDirectives(e.createElementVNode("div",{class:"cropper-box-canvas",style:e.normalizeStyle({width:t.trueWidth+"px",height:t.trueHeight+"px",transform:"scale("+t.scale+","+t.scale+") translate3d("+t.x/t.scale+"px,"+t.y/t.scale+"px,0)rotateZ("+90*t.rotate+"deg)"})},[e.createElementVNode("img",{src:t.imgs,alt:"cropper-img",ref:"cropperImg"},null,8,ui)],4),[[e.vShow,!t.loading]])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["cropper-drag-box",{"cropper-move":t.move&&!t.crop,"cropper-crop":t.crop,"cropper-modal":t.cropping}]),onMousedown:o[0]||(o[0]=(...r)=>t.startMove&&t.startMove(...r)),onTouchstart:o[1]||(o[1]=(...r)=>t.startMove&&t.startMove(...r))},null,34),e.withDirectives(e.createElementVNode("div",{class:"cropper-crop-box",style:e.normalizeStyle({width:t.cropW+"px",height:t.cropH+"px",transform:"translate3d("+t.cropOffsertX+"px,"+t.cropOffsertY+"px,0)"})},[e.createElementVNode("span",gi,[e.createElementVNode("img",{style:e.normalizeStyle({width:t.trueWidth+"px",height:t.trueHeight+"px",transform:"scale("+t.scale+","+t.scale+") translate3d("+(t.x-t.cropOffsertX)/t.scale+"px,"+(t.y-t.cropOffsertY)/t.scale+"px,0)rotateZ("+90*t.rotate+"deg)"}),src:t.imgs,alt:"cropper-img"},null,12,fi)]),e.createElementVNode("span",{class:"cropper-face cropper-move",onMousedown:o[2]||(o[2]=(...r)=>t.cropMove&&t.cropMove(...r)),onTouchstart:o[3]||(o[3]=(...r)=>t.cropMove&&t.cropMove(...r))},null,32),t.info?(e.openBlock(),e.createElementBlock("span",{key:0,class:"crop-info",style:e.normalizeStyle({top:t.cropInfo.top})},e.toDisplayString(t.cropInfo.width)+" × "+e.toDisplayString(t.cropInfo.height),5)):e.createCommentVNode("",!0),t.fixedBox?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Ci,[e.createElementVNode("span",{class:"crop-line line-w",onMousedown:o[4]||(o[4]=r=>t.changeCropSize(r,!1,!0,0,1)),onTouchstart:o[5]||(o[5]=r=>t.changeCropSize(r,!1,!0,0,1))},null,32),e.createElementVNode("span",{class:"crop-line line-a",onMousedown:o[6]||(o[6]=r=>t.changeCropSize(r,!0,!1,1,0)),onTouchstart:o[7]||(o[7]=r=>t.changeCropSize(r,!0,!1,1,0))},null,32),e.createElementVNode("span",{class:"crop-line line-s",onMousedown:o[8]||(o[8]=r=>t.changeCropSize(r,!1,!0,0,2)),onTouchstart:o[9]||(o[9]=r=>t.changeCropSize(r,!1,!0,0,2))},null,32),e.createElementVNode("span",{class:"crop-line line-d",onMousedown:o[10]||(o[10]=r=>t.changeCropSize(r,!0,!1,2,0)),onTouchstart:o[11]||(o[11]=r=>t.changeCropSize(r,!0,!1,2,0))},null,32),e.createElementVNode("span",{class:"crop-point point1",onMousedown:o[12]||(o[12]=r=>t.changeCropSize(r,!0,!0,1,1)),onTouchstart:o[13]||(o[13]=r=>t.changeCropSize(r,!0,!0,1,1))},null,32),e.createElementVNode("span",{class:"crop-point point2",onMousedown:o[14]||(o[14]=r=>t.changeCropSize(r,!1,!0,0,1)),onTouchstart:o[15]||(o[15]=r=>t.changeCropSize(r,!1,!0,0,1))},null,32),e.createElementVNode("span",{class:"crop-point point3",onMousedown:o[16]||(o[16]=r=>t.changeCropSize(r,!0,!0,2,1)),onTouchstart:o[17]||(o[17]=r=>t.changeCropSize(r,!0,!0,2,1))},null,32),e.createElementVNode("span",{class:"crop-point point4",onMousedown:o[18]||(o[18]=r=>t.changeCropSize(r,!0,!1,1,0)),onTouchstart:o[19]||(o[19]=r=>t.changeCropSize(r,!0,!1,1,0))},null,32),e.createElementVNode("span",{class:"crop-point point5",onMousedown:o[20]||(o[20]=r=>t.changeCropSize(r,!0,!1,2,0)),onTouchstart:o[21]||(o[21]=r=>t.changeCropSize(r,!0,!1,2,0))},null,32),e.createElementVNode("span",{class:"crop-point point6",onMousedown:o[22]||(o[22]=r=>t.changeCropSize(r,!0,!0,1,2)),onTouchstart:o[23]||(o[23]=r=>t.changeCropSize(r,!0,!0,1,2))},null,32),e.createElementVNode("span",{class:"crop-point point7",onMousedown:o[24]||(o[24]=r=>t.changeCropSize(r,!1,!0,0,2)),onTouchstart:o[25]||(o[25]=r=>t.changeCropSize(r,!1,!0,0,2))},null,32),e.createElementVNode("span",{class:"crop-point point8",onMousedown:o[26]||(o[26]=r=>t.changeCropSize(r,!0,!0,2,2)),onTouchstart:o[27]||(o[27]=r=>t.changeCropSize(r,!0,!0,2,2))},null,32)]))],4),[[e.vShow,t.cropping]])],544)}],["__scopeId","data-v-a742df44"]])},emits:["update:modelValue","onSubmit","onClose"],data(){return{cropDialogVisible:!1,cropAutoCrop:!0,cropFixedBox:!0,cropOutputType:"png",cropPreviews:{},cropVisible:!1,cropBeforelImage:"",cropAfterImage:"",cropLocalWidth:this.size,cropLocalHeight:this.size}},watch:{modelValue(t){this.cropDialogVisible=t,this.cropInit()},src(t){this.cropInit()}},computed:{cropAttrs(){return{info:!0,autoCrop:this.cropAutoCrop,fixedBox:this.cropFixedBox,autoCropWidth:this.cropLocalWidth,autoCropHeight:this.cropLocalHeight,outputType:this.cropOutputType}}},mounted(){},methods:{cropInit(){this.cropBeforelImage=this.src||""},cropDialoClose(){this.cropBeforelImage="",this.cropPreviews="",this.cropVisible=!1,this.cropDialogVisible=!1,this.$emit("update:modelValue",!1),this.$emit("onClose",!1)},cropDialogOpened(){this.$nextTick(()=>{this.cropVisible=!0})},cropSubmit(){this._submit_blob()},_submit_blob(){this.$refs.cvAvatartCropper.getCropBlob(t=>{this.$emit("onSubmit",{file:t})})},_submit_base64(){this.$refs.cvAvatartCropper.getCropData(t=>{let o=new Image;o.src=t,o.onload=async()=>{imageCompress(o)}})},cropRotateRefresh(){},cropRotateLeft(){this.$refs.cvAvatartCropper.rotateLeft()},cropRotateRight(){this.$refs.cvAvatartCropper.rotateRight()},cropChangeScale(t){t=t||1,this.$refs.cvAvatartCropper.changeScale(t)},cropRealTime(t){this.cropPreviews=t}}},yi={class:"cv-upload-crop-box"},ki={class:"cv-upload-crop-left-box"},bi={class:"cv-upload-crop-left-opt"},wi={class:"cv-upload-crop-left-opt2"},Vi={class:"cv-upload-crop-left-opt2"},xi={class:"cv-upload-crop-right-box"},Ni=["innerHTML"],Si={title:"头像上传",name:"cvUploadAvatar",mixins:[lo],components:{UploadCrop:v(vi,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("vue-cropper"),c=e.resolveComponent("el-button"),h=e.resolveComponent("el-tooltip"),d=e.resolveComponent("el-input"),p=e.resolveComponent("el-dialog"),u=e.resolveDirective("loading");return e.openBlock(),e.createBlock(p,{title:a.title,modelValue:l.cropDialogVisible,"onUpdate:modelValue":o[7]||(o[7]=m=>l.cropDialogVisible=m),width:"800px","append-to-body":"",onOpened:n.cropDialogOpened,onClose:n.cropDialoClose},{footer:e.withCtx(()=>[e.createVNode(c,{type:"primary",onClick:n.cropSubmit,loading:a.loading,disabled:a.loading},{default:e.withCtx(()=>o[12]||(o[12]=[e.createTextVNode("提 交")])),_:1,__:[12]},8,["onClick","loading","disabled"])]),default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createElementBlock("div",yi,[e.createElementVNode("div",ki,[l.cropVisible?(e.openBlock(),e.createBlock(r,e.mergeProps({key:0,ref:"cvAvatartCropper",img:l.cropBeforelImage},n.cropAttrs,{onRealTime:n.cropRealTime}),null,16,["img","onRealTime"])):e.createCommentVNode("",!0),e.createElementVNode("div",bi,[e.renderSlot(t.$slots,"default"),e.createVNode(h,{effect:"dark",content:"重置",placement:"top"},{default:e.withCtx(()=>[e.createVNode(c,{icon:"ElIconRefresh",onClick:o[0]||(o[0]=m=>n.cropRotateRefresh())})]),_:1}),e.createVNode(h,{effect:"dark",content:"放大",placement:"top"},{default:e.withCtx(()=>[e.createVNode(c,{icon:"ElIconZoomIn",onClick:o[1]||(o[1]=m=>n.cropChangeScale(1))})]),_:1}),e.createVNode(h,{effect:"dark",content:"缩小",placement:"top"},{default:e.withCtx(()=>[e.createVNode(c,{icon:"ElIconZoomOut",onClick:o[2]||(o[2]=m=>n.cropChangeScale(-1))})]),_:1}),e.createVNode(h,{effect:"dark",content:"向左旋转",placement:"top"},{default:e.withCtx(()=>[e.createVNode(c,{icon:"ElIconRefreshLeft",onClick:o[3]||(o[3]=m=>n.cropRotateLeft())})]),_:1}),e.createVNode(h,{effect:"dark",content:"向右旋转",placement:"top"},{default:e.withCtx(()=>[e.createVNode(c,{icon:"ElIconRefreshRight",onClick:o[4]||(o[4]=m=>n.cropRotateRight())})]),_:1})]),e.createElementVNode("div",wi,[e.createVNode(d,{size:"small"},{prepend:e.withCtx(()=>o[8]||(o[8]=[e.createTextVNode("X 坐标")])),_:1}),e.createVNode(d,{size:"small"},{prepend:e.withCtx(()=>o[9]||(o[9]=[e.createTextVNode("Y 坐标")])),_:1})]),e.createElementVNode("div",Vi,[e.createVNode(d,{size:"small",modelValue:l.cropLocalWidth,"onUpdate:modelValue":o[5]||(o[5]=m=>l.cropLocalWidth=m)},{prepend:e.withCtx(()=>o[10]||(o[10]=[e.createTextVNode("宽度")])),_:1},8,["modelValue"]),e.createVNode(d,{size:"small",modelValue:l.cropLocalHeight,"onUpdate:modelValue":o[6]||(o[6]=m=>l.cropLocalHeight=m)},{prepend:e.withCtx(()=>o[11]||(o[11]=[e.createTextVNode("高度")])),_:1},8,["modelValue"])])]),e.createElementVNode("div",xi,[e.createElementVNode("div",{class:"cv-upload-crop-preview",innerHTML:l.cropPreviews.html},null,8,Ni)])])),[[u,a.loading]])]),_:3},8,["title","modelValue","onOpened","onClose"])}]])},props:{modelValue:{type:[String],default:""},initValue:{type:[String],default:""},fileSize:{type:[Number],default:2},fileType:{type:[Array],default:()=>["png","jpg","jpeg","gif"]},showSize:{type:Number,default:120},crop:{type:[Boolean],default:!0},signatureParam:{type:[Object],default:()=>({save_sign:"avatar"})}},data:()=>({localValue:"",localList:[],upAccept:"image/*"}),computed:{localRef:()=>"cvUploadAvatar"+ +new Date+(1e3*Math.random()).toFixed(0),handlerAttr(){return{ref:this.localRef,action:"#",accept:this.upAccept,limit:1,multiple:!1,drag:!1,disabled:this.upIngLoading,showFileList:!1}},showStyle(){return{width:this.showSize+"px",height:this.showSize+"px",lineHeight:this.showSize+"px"}}},watch:{initValue(t){this._init_parse()}},mounted(){this._init_parse()},methods:{_init_parse(){this.localValue=this.initValue||""},cropDialogOpen(){this.cropShow=!0,this.$nextTick(()=>{this._init_parse()})},initBeforeUpload(t){if(!this._commonBeforeUpload(t))return this.upIngLoading=!1,!1;if(this.crop){const o=new FileReader;o.readAsDataURL(t),o.onload=()=>{this.localValue=o.result},this.$refs.cvUploadAvatar.clearFiles()}},async onHttpRequest(t){const{file:o}=t;this.upIngLoading=!0;const a=this.mergeAttrs.signatureType||null,i=this.mergeAttrs.signatureFn||null,l=this.mergeAttrs.signatureParam||{};await Ko(o,a,i,l).then(n=>{this.$nextTick(()=>{this.$emit("update:modelValue",n.full_path),this.$emit("update:initValue",n.cdn_full_path)}),k.ElMessage.success("上传成功"),this.upIngLoading=!1,this.cropShow=!1}).catch(()=>{this.upIngLoading=!1})}}},Bi=["src"],pt=v(Si,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("upload-tip"),c=e.resolveComponent("cv-icons"),h=e.resolveComponent("el-button"),d=e.resolveComponent("el-tooltip"),p=e.resolveComponent("el-upload"),u=e.resolveComponent("upload-crop");return e.openBlock(),e.createElementBlock("div",{class:"cv-upload-avatar-wrap",onClick:o[2]||(o[2]=(...m)=>n.cropDialogOpen&&n.cropDialogOpen(...m))},[a.initValue?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"cv-upload-avatar-box cv-upload-avatar-empty",style:e.normalizeStyle(n.showStyle)},o[3]||(o[3]=[e.createElementVNode("div",{class:"cv-upload-avatar__text"},"上传头像",-1)]),4)),a.initValue?(e.openBlock(),e.createElementBlock("div",{key:1,class:"cv-upload-avatar-box",style:e.normalizeStyle(n.showStyle)},[e.createElementVNode("img",{class:"cv-upload-avatar__img",src:a.initValue},null,8,Bi)],4)):e.createCommentVNode("",!0),e.createVNode(r,e.mergeProps(t.tipAttr,{fileUnit:"张",multiple:!1,limit:1}),null,16),a.crop?(e.openBlock(),e.createBlock(u,{key:2,modelValue:t.cropShow,"onUpdate:modelValue":o[0]||(o[0]=m=>t.cropShow=m),title:"修改头像",size:a.showSize,onOnSubmit:n.onHttpRequest,onOnClose:o[1]||(o[1]=m=>t.upIngLoading=!1),loading:t.upIngLoading,src:l.localValue},{default:e.withCtx(()=>[e.createVNode(p,e.mergeProps(n.handlerAttr,{"before-upload":n.initBeforeUpload,"http-request":t.initHttpRequest}),{default:e.withCtx(()=>[e.createVNode(d,{effect:"dark",content:"选择图片",placement:"top"},{default:e.withCtx(()=>[e.createVNode(h,{style:{"margin-right":"10px"},loading:t.upIngLoading,disabled:t.upIngLoading},{default:e.withCtx(()=>[e.createVNode(c,{type:"ElIconPlus",size:"14",style:{"margin-right":"10px"}}),o[4]||(o[4]=e.createTextVNode(" 选择 "))]),_:1,__:[4]},8,["loading","disabled"])]),_:1})]),_:1},16,["before-upload","http-request"])]),_:1},8,["modelValue","size","onOnSubmit","loading","src"])):e.createCommentVNode("",!0)])}]]),Ei={title:"图片上传",name:"cvUploadImage",mixins:[lo],components:{},props:{modelValue:{type:[String,Array,Object],default:()=>[]},initValue:{type:[String,Array],default:()=>""},fileSize:{type:[Number],default:2},fileType:{type:[Array],default:()=>["png","jpg","jpeg","gif"]},showSize:{type:Number,default:150},showBig:{type:[Boolean],default:!1},crop:{type:[Boolean],default:!1},galleryLabel:{type:String,default:""},lazy:{type:Boolean,default:!0},drag:{type:Boolean,default:!1},signatureParam:{type:[Object],default:()=>({save_sign:"image"})}},data:()=>({localValue:[],localList:[],previewShow:!1,previewTitle:"",previewUrl:"",upAccept:"image/*"}),computed:{localRef:()=>"cvUploadImage"+ +new Date+(1e3*Math.random()).toFixed(0),handlerAttr(){return{ref:this.localRef,action:"#",accept:this.upAccept,limit:parseInt(this.limit),multiple:this.multiple,drag:!!this.drag,disabled:this.upIngLoading,showFileList:!1}},showUpload(){return!(this.localList.length>=this.limit)},showStyle(){let t=this.showSize+"px";return(this.showBig||this.drag)&&(t=2*this.showSize+"px"),{width:t,height:this.showSize+"px",lineHeight:this.showSize+"px"}}},watch:{modelValue(t){this._init_parse_value()},initValue(t){this._init_parse_list()}},mounted(){},methods:{_init_parse_value(){this.modelValue?this.localValue=Fl(this.modelValue):this.localValue=[]},_init_parse_list(){this.initValue?this.localList=qo(this.initValue):this.localList=[]},initOnChange(t,o){},initBeforeUpload(t){return this.upIngLoading=!0,!!this._commonBeforeUpload(t)||(this.upIngLoading=!1,!1)},async initHttpRequest(t){const{file:o}=t;this.upIngLoading=!0,this.mergeAttrs.upResponseFn;const a=this.mergeAttrs.signatureType||null,i=this.mergeAttrs.signatureFn||null,l=this.mergeAttrs.signatureParam||{};await Ko(o,a,i,l).then(n=>{this.$nextTick(()=>{this.updateValue(n.full_path,n.cdn_full_path)}),k.ElMessage.success("上传成功"),this.upIngLoading=!1}).catch(()=>{this.upIngLoading=!1})},updateValue(t,o){if(this.multiple){let a=ra(this.localValue,t);this.$emit("update:modelValue",a)}else this.$emit("update:modelValue",t);if(this.multiple){let a=ra(this.localList,o);this.$emit("update:initValue",a)}else this.$emit("update:initValue",o)},handleItemPreview(t,o){t.raw,t.type.includes("image")?(this.previewTitle=t.name,this.previewUrl=t.url,this.previewShow=!0):window.open(t.url)},doRemove(t){this.multiple?(this.localValue.splice(t,1),this.localList.splice(t,1)):(this.localValue="",this.localList=[]),this.updateValue(null,null)},handleItemRemove(t,o){if(this.beforeRemove&&typeof this.beforeRemove=="function"){const a=this.multiple?this.localValue[o]:this.localValue,i=this.beforeRemove(a,this.localValue);i&&i.then?i.then(()=>{this.doRemove(o)},()=>{}):i!==!1&&this.doRemove(o)}else this.doRemove(o)},handleItemEdit(t,o){k.ElMessageBox.prompt("请输入文件地址","编辑",{confirmButtonText:"OK",cancelButtonText:"Cancel",inputValue:t.url||"",inputErrorMessage:"格式不正确"}).then(({value:a})=>{var h,d;const i=a.split("/").pop(),l=i.split(".").pop().toLowerCase();if(!this.fileType.includes(l)){let p=this.fileType.join("、");return k.ElMessage.error(`文件格式错误,请填写类型,如:${p} 格式文件`),!1}const n=function(p){if(!p)return"";const u=p.replace(/^\./,"").toLowerCase();return Il.extensionToMime[u]||""}(l);if(!n)return k.ElMessage.error("文件格式错误"),!1;var r;(r=a).startsWith("http://")||r.startsWith("https://")||r.startsWith("//")||(h=this.mergeAttrs)!=null&&h.baseDomain&&(a=((d=this.mergeAttrs)==null?void 0:d.baseDomain)+a);const c={name:i,status:"success",type:n,uid:Date.now(),url:a};this.localList[o]=c}).catch(()=>{})},handleItemCrop(t,o){}}},Di={class:"cv-upload-image cv-upload-common"},_i={class:"cv-upload-list-box el-upload-list el-upload-list--picture-card"},Ti=["tabindex"],Ii={class:"el-upload-list__item-status-label"},Li={class:"el-upload-list__item-actions"},Fi=["onClick"],Oi={class:"el-upload-list__item-delete"},$i={class:"el-upload-list__item-delete"},zi=["onClick"],Pi={style:{margin:"0 auto"}},Mi=["src"],mt=v(Ei,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-image"),c=e.resolveComponent("cv-icons"),h=e.resolveComponent("el-upload"),d=e.resolveComponent("upload-tip"),p=e.resolveComponent("el-dialog"),u=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",Di,[e.createElementVNode("div",_i,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.localList,(m,f)=>(e.openBlock(),e.createElementBlock("section",{class:"el-upload-list__item is-success",key:f,tabindex:f,style:e.normalizeStyle(n.showStyle)},[e.createVNode(r,{class:"el-upload-list__item-thumbnail",lazy:a.lazy,src:m.url,style:e.normalizeStyle(n.showStyle),fit:"contain"},null,8,["lazy","src","style"]),e.createElementVNode("label",Ii,[e.createVNode(c,{type:"ElIconCheck",color:"#ffffff",size:"12"})]),e.createElementVNode("span",Li,[e.createElementVNode("span",{class:"el-upload-list__item-preview",onClick:C=>n.handleItemPreview(m)},[e.createVNode(c,{type:"ElIconZoomIn",size:"20"})],8,Fi),e.createElementVNode("span",Oi,[e.createVNode(c,{type:"ElIconDelete",size:"20",onClick:C=>n.handleItemRemove(m,f)},null,8,["onClick"])]),e.createElementVNode("span",$i,[e.createVNode(c,{type:"ElIconEdit",size:"20",onClick:C=>n.handleItemEdit(m,f)},null,8,["onClick"])]),a.crop?(e.openBlock(),e.createElementBlock("span",{key:0,class:"el-upload-list__item-preview",onClick:C=>n.handleItemCrop(m)},[e.createVNode(c,{type:"ElIconCrop",size:"20"})],8,zi)):e.createCommentVNode("",!0)])],12,Ti))),128)),n.showUpload?(e.openBlock(),e.createBlock(h,e.mergeProps({key:0,class:"cv-upload-common-handle"},n.handlerAttr,{"file-list":l.localList,"before-upload":n.initBeforeUpload,"http-request":n.initHttpRequest,"on-change":n.initOnChange,"on-exceed":t.initOnExceed,style:n.showStyle}),{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:"cv-upload-common__ing",style:e.normalizeStyle(n.showStyle)},[a.drag?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(c,{type:"ElIconUpload",size:"24"}),o[1]||(o[1]=e.createElementVNode("div",{class:"el-upload__text"},[e.createTextVNode(" 将文件拖到此处,或 "),e.createElementVNode("em",null,"点击上传")],-1))],64)):(e.openBlock(),e.createBlock(c,{key:1,type:"ElIconPlus",size:a.showSize/3},null,8,["size"]))],4)),[[u,t.upIngLoading]])]),_:1},16,["file-list","before-upload","http-request","on-change","on-exceed","style"])):e.createCommentVNode("",!0)]),e.createVNode(d,e.mergeProps(t.tipAttr,{fileUnit:"张"}),null,16),e.createVNode(p,{modelValue:l.previewShow,"onUpdate:modelValue":o[0]||(o[0]=m=>l.previewShow=m),title:l.previewTitle,"append-to-body":""},{default:e.withCtx(()=>[e.createElementVNode("div",Pi,[e.createElementVNode("img",{width:"100%",src:l.previewUrl,style:{"max-width":"300px"}},null,8,Mi)])]),_:1},8,["modelValue","title"])])}]]),Hi={mdb:"access",accdb:"access",ai:"ai",html:"html",htm:"html",asp:"web",pdf:"pdf",psd:"photoshop",psb:"photoshop",mpo:"photoshop",eps:"photoshop",avi:"video",wmv:"video",rm:"video",rmvb:"video",mp4:"video","3gp":"video",asf:"video",mov:"video",m4v:"video",flv:"video",f4v:"video",mkv:"video",mts:"video",swf:"flash",ts:"video",mp3:"audio",wav:"audio",wma:"audio",ape:"audio",aac:"audio",zip:"zip",rar:"zip",gz:"zip","7z":"zip",z:"zip",bmp:"image",jpg:"image",jpeg:"image",png:"image",gif:"image",webp:"image",svg:"image",txt:"txt",rtf:"txt",xls:"excel",xlsx:"excel",xlsm:"excel",xltx:"excel",doc:"word",docx:"word",docm:"word",wps:"word",dotx:"word",dotm:"word",ppt:"powerpoint",pptx:"powerpoint",mdf:"db",db:"db",dbf:"db",wdb:"db",vue:"vue",php:"php",jar:"jar",ini:"ini",bat:"bat",config:"config",fla:"fla",eot:"font",otf:"font",fon:"font",font:"font",ttf:"font",ttc:"font",woff:"font",woff2:"font",js:"js",md:"markdown",one:"onenote",jsx:"reactjs",xfl:"xfl",file:"file",css:"css"};function so(t){return`https://10ui.cn/default/icon_ext/${Hi[t]}.svg`}const Ai={name:"uploadList",props:{files:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1},isCanDownload:{type:Boolean,default:!0},isCanDelete:{type:Boolean,default:!0}},methods:{getExtension(t){return t.lastIndexOf(".")>-1&&so[t.slice(t.lastIndexOf(".")+1).toLowerCase()]||so.file},getSize:t=>t&&!isNaN(Number(t))?t:"",parsePercentage:t=>parseInt(t,10),handleDownload(t){t.url},handleDelete(t,o){this.$confirm("确认删除该文件吗? ").then(()=>{this.$emit("remove",t,o)}).catch(()=>{})}}},ji=["src"],Ri={class:"cv-upload-list__item-content-action"},Ui={title:"文件上传",inheritAttrs:!1,name:"cvUploadFile",mixins:[lo],components:{uploadList:v(Ai,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-link");return e.openBlock(),e.createBlock(e.TransitionGroup,{class:"cv-upload-file-list el-upload-list el-upload-list--text",name:"el-list",tag:"ul"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.files,(c,h)=>(e.openBlock(),e.createElementBlock("li",{key:c.uid,class:"el-upload-list__item cv-upload-list__item-content"},[e.createVNode(r,{href:c.url,underline:!1,target:"_blank"},{default:e.withCtx(()=>[e.createElementVNode("img",{src:n.getExtension(c.name),class:"el-upload-list__item-content-name-icon"},null,8,ji),e.createElementVNode("span",null,e.toDisplayString(c.name),1)]),_:2},1032,["href"]),e.createElementVNode("div",Ri,[e.createVNode(r,{underline:!1},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.getSize(c.size)),1)]),_:2},1024),a.isCanDownload?(e.openBlock(),e.createBlock(r,{key:0,underline:!1,onClick:d=>n.handleDownload(c)},{default:e.withCtx(()=>o[0]||(o[0]=[e.createTextVNode("下载")])),_:2,__:[0]},1032,["onClick"])):e.createCommentVNode("",!0),!a.disabled&&a.isCanDelete?(e.openBlock(),e.createBlock(r,{key:1,underline:!1,onClick:d=>n.handleDelete(h,c),type:"danger"},{default:e.withCtx(()=>o[1]||(o[1]=[e.createTextVNode(" 删除 ")])),_:2,__:[1]},1032,["onClick"])):e.createCommentVNode("",!0)])]))),128))]),_:1})}]])},props:{modelValue:{type:[String,Object,Array],default:""},initValue:{type:[String,Object,Array],default:""},fileSize:{type:[Number],default:5},fileType:{type:[Array],default:["txt","png","jpg","xlsx","xls"]},multiple:{type:[Boolean],default:!1},limit:{type:[Number],default:5},disabled:Boolean,isCanDownload:{type:Boolean,default:!0},isCanDelete:{type:Boolean,default:!0},isCanUploadSame:{type:Boolean,default:!0}},data:()=>({localValue:[],localList:[]}),computed:{localRef:()=>"cvUploadFile"+ +new Date+(1e3*Math.random()).toFixed(0),handlerAttr(){return{ref:this.localRef,action:"#",limit:parseInt(this.limit),multiple:this.multiple,drag:!1,disabled:this.upIngLoading,showFileList:!0}},list(){let t=1;return this.modelValue?(Array.isArray(this.modelValue)?this.modelValue:[this.modelValue]).map(o=>(typeof o=="string"&&(o={name:o,url:o}),o.uid=o.uid||new Date().getTime()+t++,o)):[]}},watch:{initValue(t){this._init_parse()}},mounted(){this._init_parse()},methods:{_init_parse(){this.initValue?this.localList=qo(this.initValue):this.localList=[]},initOnChange(t,o){this.localList=o},initBeforeUpload(t){return this._commonBeforeUpload(t)?!this.isCanUploadSame&&this.localList.some(o=>o.name+o.size===t.name+t.size)?(this.$message.error("此文件已上传!"),!1):!0:!1},upFileError(t){this.$message.error("上传失败, 请重试"),this.$emit("error",t)},upFileSuccess(t,o){this.upResponseFn&&typeof this.upResponseFn=="function"&&(t=this.upResponseFn(t,o,this.localList)),this.multiple?this.$emit("update:modelValue",[...this.localList,t]):this.$emit("update:modelValue",t),this.$emit("success",t,this.localList)},handleRemove(t,o){if(this.beforeRemove&&typeof this.beforeRemove=="function"){const a=this.beforeRemove(this.localList[o],this.localList);a&&a.then?a.then(()=>{this._do_remove(o)},()=>{}):a!==!1&&this._do_remove(o)}else this._do_remove(o)},_do_remove(t){if(this.$emit("remove",this.list[t],this.list),this.localList.splice(t,1),this.multiple){const o=[...this.list];o.splice(t,1),this.$emit("update:modelValue",o||[])}else this.$emit("update:modelValue",null)}}},Wi={class:"cv-upload-file"},ut=v(Ui,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-button"),c=e.resolveComponent("el-upload"),h=e.resolveComponent("upload-tip"),d=e.resolveComponent("upload-list");return e.openBlock(),e.createElementBlock("div",Wi,[e.createVNode(c,e.mergeProps({class:"cv-upload-file-uploader"},n.handlerAttr,{"file-list":l.localList,"onUpdate:fileList":o[0]||(o[0]=p=>l.localList=p),"before-upload":n.initBeforeUpload,"on-change":n.initOnChange,"on-exceed":t.initOnExceed,"on-error":n.upFileError,"on-success":n.upFileSuccess}),{default:e.withCtx(()=>[e.createVNode(r,{type:"primary",icon:"ElIconUpload"},{default:e.withCtx(()=>o[1]||(o[1]=[e.createTextVNode("上传文件")])),_:1,__:[1]})]),_:1},16,["file-list","before-upload","on-change","on-exceed","on-error","on-success"]),e.createVNode(h,e.mergeProps(t.tipAttr,{fileUnit:"个"}),null,16),e.createVNode(d,{disabled:a.disabled,files:n.list,isCanDelete:a.isCanDelete,isCanDownload:a.isCanDownload,onRemove:n.handleRemove},null,8,["disabled","files","isCanDelete","isCanDownload","onRemove"])])}]]),Yi={class:"cv-upload-video"},Xi={class:"cv-upload-list-box el-upload-list el-upload-list--picture-card"},qi=["tabindex"],Ki=["src"],Gi={class:"el-upload-list__item-status-label"},Zi={class:"el-upload-list__item-actions"},Qi=["onClick"],Ji={class:"el-upload-list__item-delete"},er={class:"el-upload-list__item-delete"},tr={key:0,style:{width:"500px",height:"300px",margin:"0 auto"}},or=["src"],gt=v({title:"视频上传",name:"cvUploadVideo",mixins:[lo],components:{},props:{modelValue:{type:[String],default:""},initValue:{type:[String],default:""},fileSize:{type:[Number],default:10},fileType:{type:Array,default:["mp4","mp3"]},showSize:{type:Number,default:360},signatureParam:{type:[Object],default:()=>({save_sign:"video"})}},data:()=>({localValue:"",localList:"",previewShow:!1,previewTitle:"",previewUrl:"",upAccept:"video/*"}),computed:{localRef:()=>"cvUploadVideo"+ +new Date+(1e3*Math.random()).toFixed(0),handlerAttr(){return{ref:this.localRef,action:"#",accept:this.upAccept,limit:1,multiple:!1,drag:!0,disabled:this.upIngLoading,showFileList:!1}},showUpload(){return!this.localValue},showStyle(){return{width:this.showSize+"px",height:this.showSize/5*3+"px",lineHeight:this.showSize+"px"}}},watch:{modelValue(t){this._init_parse_value()},initValue(t){this._init_parse_list()}},mounted(){this._init_parse_value(),this._init_parse_list()},methods:{_init_parse_value(){this.modelValue?this.localValue=Fl(this.modelValue):this.localValue=""},_init_parse_list(){this.initValue?this.localList=qo(this.initValue):this.localList=""},initBeforeUpload(t){return this.upIngLoading=!0,!!this._commonBeforeUpload(t)||(this.upIngLoading=!1,!1)},async initHttpRequest(t){const{file:o}=t;this.upIngLoading=!0,this.mergeAttrs.upResponseFn;const a=this.mergeAttrs.signatureType||null,i=this.mergeAttrs.signatureFn||null,l=this.mergeAttrs.signatureParam||{};await Ko(o,a,i,l).then(n=>{this.$nextTick(()=>{this.$emit("update:modelValue",n.full_path),this.$emit("update:initValue",n.cdn_full_path)}),ExtendMessage.success("上传成功"),this.upIngLoading=!1}).catch(()=>{this.upIngLoading=!1})},handleItemPreview(t,o){this.previewTitle=t.name,this.previewUrl=t.url,this.previewShow=!0},doRemove(t){this.localValue="",this.localList="",this.$emit("update:modelValue",""),this.$emit("update:initValue","")},handleItemRemove(t,o){if(this.beforeRemove&&typeof this.beforeRemove=="function"){const a=this.multiple?this.localValue[o]:this.localValue,i=this.beforeRemove(a,this.localValue);i&&i.then?i.then(()=>{this.doRemove(o)},()=>{}):i!==!1&&this.doRemove(o)}else this.doRemove(o)}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("cv-icons"),c=e.resolveComponent("el-progress"),h=e.resolveComponent("el-upload"),d=e.resolveComponent("upload-tip"),p=e.resolveComponent("el-dialog");return e.openBlock(),e.createElementBlock("div",Yi,[e.createElementVNode("div",Xi,[l.localList?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(l.localList,(u,m)=>(e.openBlock(),e.createElementBlock("section",{class:"el-upload-list__item is-success",key:m,tabindex:m,style:e.normalizeStyle(n.showStyle)},[e.createElementVNode("video",{class:"el-upload-list__item-thumbnail",autoplay:!1,src:u.url,style:e.normalizeStyle(n.showStyle)}," 您的浏览器不支持视频播放 ",12,Ki),e.createElementVNode("label",Gi,[e.createVNode(r,{type:"ElIconCheck",color:"#ffffff",size:"12"})]),e.createElementVNode("span",Zi,[e.createElementVNode("span",{class:"el-upload-list__item-preview",onClick:f=>n.handleItemPreview(u)},[e.createVNode(r,{type:"ElIconVideoPlay",size:"20"})],8,Qi),e.createElementVNode("span",Ji,[e.createVNode(r,{type:"ElIconDelete",size:"20",onClick:f=>n.handleItemRemove(u,m)},null,8,["onClick"])]),e.createElementVNode("span",er,[e.createVNode(r,{type:"ElIconEdit",size:"20",onClick:f=>t.handleItemEdit(u,m)},null,8,["onClick"])])])],12,qi))),128)):e.createCommentVNode("",!0),n.showUpload?(e.openBlock(),e.createBlock(h,e.mergeProps({key:1,class:"cv-upload-handler"},n.handlerAttr,{"before-upload":n.initBeforeUpload,"http-request":n.initHttpRequest,style:n.showStyle}),{default:e.withCtx(()=>[t.upIngPercent>0?(e.openBlock(),e.createBlock(c,{key:0,percentage:t.upIngPercent,style:{"margin-top":"20px"},type:"circle"},null,8,["percentage"])):(e.openBlock(),e.createElementBlock("div",{key:1,class:"cv-upload-video__ing",style:e.normalizeStyle(n.showStyle)},[e.createVNode(r,{type:"ElIconUpload",size:"24"}),o[1]||(o[1]=e.createElementVNode("div",{class:"el-upload__text"},[e.createTextVNode(" 将视频拖到此处,或 "),e.createElementVNode("em",null,"点击上传")],-1))],4))]),_:1},16,["before-upload","http-request","style"])):e.createCommentVNode("",!0)]),e.createVNode(d,e.mergeProps(t.tipAttr,{fileUnit:"个",limit:1}),null,16),e.createVNode(p,{modelValue:l.previewShow,"onUpdate:modelValue":o[0]||(o[0]=u=>l.previewShow=u),title:l.previewTitle,"append-to-body":""},{default:e.withCtx(()=>[l.previewShow?(e.openBlock(),e.createElementBlock("div",tr,[e.createElementVNode("video",{autoplay:!0,src:l.previewUrl,controls:"controls",style:{width:"500px",height:"300px"}}," 您的浏览器不支持视频播放 ",8,or)])):e.createCommentVNode("",!0)]),_:1},8,["modelValue","title"])])}]]),ar={emits:["get-unlist","on-close","on-update","on-delete"],props:{modelValue:{type:Array,default:()=>[]},model:{type:String,default:""},accept:{type:String,default:""},multiple:{type:Boolean,default:!1}},data:()=>({audioInfo:{},file:null,fileList:[],fileHash:"",tempCheckpoint:null,uploadId:"",uploadStatus:null,showAudio:!1,percentage:0,uploadName:"",client:null,year:new Date().getFullYear(),uploadDisabled:!0,resumeDisabled:!0,pauseDisabled:!0,dialogVisible:!1,isDoing:!1,unList:[],fileMap:{},map_max_key:0,partSize:1048576,parallel:4,checkpoints:{}}),watch:{dialogVisible:{handler(t){t||(this.fileList=[],this.$refs.upload.uploadFiles=[])}},fileList:{handler(t){if(t.length){this.dialogVisible=!0;let o=[],a=[];t.forEach(i=>{i.raw.name.indexOf(".")===-1&&(i.errMsg="不支持此格式上传"),i.percentage===100?o.push(i):a.push(i)}),o.length===t.length?(this.pauseDisabled=!0,this.isDoing=!0):this.isDoing=!1,this.unList=a}},deep:!0}},mounted(){window.addEventListener("online",this.resumeUpload)},methods:{filterSize:ia,handleExceed(){this.$confirm("上传文件数量不能超过100个,请重新选择!","操作提示",{confirmButtonText:"确 定",cancelButtonText:"取 消",type:"warning"}).then(()=>{this.fileList=[],this.dialogVisible=!1}).catch(()=>{this.fileList=[]})},handleDeleteChangeFile(t){this.fileList.splice(t,1),this.fileList.length||(this.dialogVisible=!1)},fileTypeIcon(t){const{type:o}=t.raw,a=o.indexOf("video")!==-1,i=o.indexOf("image")!==-1,l=o.indexOf("audio")!==-1,n=o.indexOf("zip")!==-1,r=o.indexOf("wordprocessingml")!==-1,c=o.indexOf("pdf")!==-1,h=o.indexOf("text")!==-1,d=o.indexOf("sheet")!==-1;return a?"MP4":i?"JPG1":l?"mp3-1":n?"yasuo":r?"DOCX":c?"wenjianleixing-biaozhuntu-PDFwendang":h?"div-1":d?"excel1":"weizhiwenjian"},handleClose(){this.$emit("on-close"),this.isDoing?this.dialogVisible=!1:this.$confirm("正在上传文件,关闭后上传文件会丢失!是否继续?","操作提示",{confirmButtonText:"确 定",cancelButtonText:"取 消",type:"warning"}).then(()=>{this.$emit("get-unlist"),this.fileList.forEach(t=>{t.client&&t.percentage<100&&t.client.cancel()}),this.dialogVisible=!1}).catch(()=>{})},async handleBeforeUpload(t){},handleStopChangeFile(t,o){o.isPlay=!o.isPlay,this.fileList.splice(t,1,o),o.isPlay?this.resumeMultipartUpload(o):o.client.cancel()},async starUpload(){this.uploadDisabled=!0,this.pauseDisabled=!1,this.multipartUpload()},async multipartUpload(){this.file?this.fileList.forEach(async t=>{t.isLoading=!0,await this.ossUploadHandle(t,this.fileList)}):k.ElMessage.error("请选择文件")},async resumeUpload(){this.pauseDisabled=!1,this.uploadDisabled=!0,this.resumeDisabled=!0,await this.resumeMultipartUpload()},stopUpload(){this.resumeDisabled=!1,this.pauseDisabled=!0,this.fileList.forEach(t=>{t.client.cancel(),t.isPlay=!1})},async change(t,o){this.fileMap[t]=o,this.map_max_key=t},async handle_network_speed_change(t,o,a){t-this.map_max_key>=1e4&&(this.fileMap={});for(let i=t;i<=o;i++){const l=await this.fileMap[i];l?await this.change(i,l+a):await this.change(i,a)}},handle_network_speed(t,o,a){const i=t.rt/1e3,l=new Date(t.headers.date).getTime(),n=l-i;let r=parseInt(o/i);return a===0&&(r=0),r===0||this.handle_network_speed_change(n,l,r),r?ia(r):0},async resetUpload(t,o){JSON.stringify(t).indexOf("Error")!==-1&&(o.client&&o.client.cancel(),o.client=await ca(this.signatureType,this.apiFunc),await this.resumeMultipartUpload(o))},async resumeMultipartUpload(t){if(t){const{tempCheckpoint:o}=t;this.resumeUploadFile(t,o)}else Object.values(this.checkpoints).forEach(o=>{const{uploadId:a}=o,i=this.fileList.findIndex(n=>n.upload===a),l=this.fileList[i];this.resumeUploadFile(l,o)})},async resumeUploadFile(t,o){const{uploadId:a,file:i,name:l}=o;try{const{raw:n,percentage:r}=t;t.partSize=0,r<100&&n.name.indexOf(".")!==-1&&t.client.multipartUpload(a,i,{parallel:this.parallel,partSize:this.partSize,progress:async(c,h,d)=>{await this.onUploadProgress(t,c,h,d,l)},checkpoint:o}).then(()=>{delete this.checkpoints[o.uploadId],this.$emit("update:modelValue",this.fileList),this.resumeDisabled=!0,this.unList.length&&this.uploadDisabled&&(this.resumeDisabled=!1),this.onCreatePanFile(t)}).catch(async c=>{await this.resetUpload(c,t)})}catch{}},async onUploadProgress(t,o,a,i,l){a&&(this.checkpoints[a.uploadId]=a,t.speed=this.handle_network_speed(i,this.partSize,o),t.tempCheckpoint=a,t.abortCheckpoint=a,t.upload=a.uploadId),t.isPlay=!0,t.isPlay&&(t.isLoading=!1),t.uploadName=l,t.percentage=Number((100*o).toFixed(2))},async ossUploadHandle(t){let o={pass:!0,filePath:""};try{const{raw:a,percentage:i}=t,l=a,n=await ca(this.signatureType,this.apiFunc,{},{secure:!0});if(this.signatureType=="aliyun_oss_type1"){if(t.client=n,t.partSize=0,i<100&&a.name.indexOf(".")!==-1){const r=n.dir+l.name;await t.client.multipartUpload(r,l,{parallel:this.parallel,partSize:this.partSize,progress:async(c,h,d)=>{await this.onUploadProgress(t,c,h,d,r)}}).then(()=>{this.$emit("upload:modelValue",this.fileList),this.resumeDisabled=!0,this.onCreatePanFile(t),this.unList.length&&this.uploadDisabled&&(this.resumeDisabled=!1)}).catch(async c=>{})}}else this.signatureType=="aliyun_oss_type2"&&Ol(l,n)}catch(a){o={...a,pass:!1,filePath:""}}return o},getToday(){const t=new Date;return`${t.getFullYear()}${t.getMonth()+1}${t.getDate()}${t.getHours()}${t.getMinutes()}${t.getSeconds()}`},handleChange(t,o){o.forEach(a=>{a.client=null,a.isPlay=!1,a.isLoading=!1,a.abortCheckpoint=!1}),this.fileList=o,this.file=t.raw,this.uploadDisabled=!1,this.pauseDisabled=this.resumeDisabled=!0},handleDeleteFile(t){const o=t.indexOf(this.model);t.substring(o,t.length),this.$emit("on-delete"),this.fileList=[],k.ElMessage.success("删除成功")},async onCreatePanFile(t){await this.getParams(t),this.$emit("on-update")},handleMediaRes:t=>({image:async function(o){return new Promise(a=>{var i=new FileReader;i.onload=function(l){var n=l.target.result,r=new Image;r.onload=function(){a({Width:this.width,Height:this.height})},r.src=n},i.readAsDataURL(o)})},audio:async function(o){return new Promise(a=>{var i=new FileReader;i.onload=function(l){var n=l.target.result,r=new Audio;r.onloadeddata=function(){const c=r.duration;a({Duration:1e3*c})},r.src=n},i.readAsDataURL(o)})},video:async function(o){return new Promise(a=>{var i=URL.createObjectURL(o);const l=document.createElement("video");l.src=i,l.onloadeddata=function(){a({CoverImg:"",Duration:1e3*this.duration,Width:this.videoWidth,Height:this.videoHeight})}})}})[t],captureImage:(t,o)=>t+"?x-oss-process=video/snapshot,t_"+(o=o||"3000 ")+",f_jpg",async getParams(t){const{type:o}=t.raw,a=o.indexOf("video")!==-1,i=o.indexOf("image")!==-1,l=o.indexOf("audio")!==-1;let n,r="";return a?r="video":i?o.indexOf("adobe")===-1&&(r="image"):l&&(r="audio"),(a||i||l)&&r&&(n=await this.handleMediaRes(r)(t.raw)),{ResTitle:t.name,ResDescribe:"",OssKey:t.uploadName,ContentType:o||"application/octet-stream",ContentLength:t.size,...n}}}},lr={class:"oss-upload"},nr={class:"cv-upload-task-hd-title"},ir={class:"cv-upload-task-hd-num"},rr={class:"cv-upload-task-opts"},sr={class:"cv-upload-task-lists"},cr={class:"cv-upload-task-item-name"},dr={class:"name"},hr={class:"file-name-item"},pr={key:0,class:"speed"},mr={key:1,class:"speed"},ur={key:2,class:"success"},gr={class:"total"},fr={key:0,class:"name error"},Cr={class:"cv-upload-task-item-tool"},vr=["onClick"],yr=["onClick"],ft=v({name:"cvUploadOss",mixins:[ar]},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-button"),c=e.resolveComponent("el-upload"),h=e.resolveComponent("el-progress"),d=e.resolveComponent("cv-icons"),p=e.resolveComponent("el-dialog");return e.openBlock(),e.createElementBlock("div",lr,[e.createVNode(c,{ref:"upload",action:"","show-file-list":!1,multiple:"","on-change":t.handleChange,"before-upload":t.handleBeforeUpload,"auto-upload":!1,limit:100,"on-exceed":t.handleExceed,accept:t.accept},{default:e.withCtx(()=>[e.createVNode(r,{type:"primary",icon:"ElIconUpload",round:""},{default:e.withCtx(()=>o[1]||(o[1]=[e.createTextVNode("上 传")])),_:1,__:[1]})]),_:1},8,["on-change","before-upload","on-exceed","accept"]),e.createVNode(p,{modelValue:t.dialogVisible,"onUpdate:modelValue":o[0]||(o[0]=u=>t.dialogVisible=u),width:"650px",height:"500","destroy-on-close":"","close-on-click-modal":!1,"before-close":t.handleClose,style:{height:"500px"}},{header:e.withCtx(()=>[e.createElementVNode("div",nr,[o[2]||(o[2]=e.createElementVNode("span",null,"上传",-1)),e.createElementVNode("span",ir,e.toDisplayString(t.fileList.length-t.unList.length)+"/"+e.toDisplayString(t.fileList.length),1)])]),default:e.withCtx(()=>[e.createElementVNode("div",rr,[e.createVNode(r,{type:"primary",icon:"ElIconVideoPlay",disabled:t.uploadDisabled,onClick:t.starUpload},{default:e.withCtx(()=>o[3]||(o[3]=[e.createTextVNode("开始上传")])),_:1,__:[3]},8,["disabled","onClick"]),e.createVNode(r,{type:"success",icon:"ElIconRefreshRight",disabled:t.resumeDisabled,onClick:t.resumeUpload},{default:e.withCtx(()=>o[4]||(o[4]=[e.createTextVNode("继续")])),_:1,__:[4]},8,["disabled","onClick"]),e.createVNode(r,{type:"danger",icon:"ElIconVideoPause",disabled:t.pauseDisabled,onClick:t.stopUpload},{default:e.withCtx(()=>o[5]||(o[5]=[e.createTextVNode("暂停")])),_:1,__:[5]},8,["disabled","onClick"])]),e.createElementVNode("div",sr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fileList,(u,m)=>(e.openBlock(),e.createElementBlock("div",{class:"cv-upload-task-item-box",key:m},[e.createElementVNode("div",cr,[e.createElementVNode("div",dr,[e.createElementVNode("span",hr,e.toDisplayString(m+1)+"."+e.toDisplayString(u.name),1),u.isLoading&&!u.isPlay?(e.openBlock(),e.createElementBlock("span",pr,"准备就绪")):e.createCommentVNode("",!0),u.isPlay&&u.percentage!==100?(e.openBlock(),e.createElementBlock("span",mr,e.toDisplayString(u.speed)+"/s",1)):e.createCommentVNode("",!0),u.percentage===100?(e.openBlock(),e.createElementBlock("span",ur,"完成")):e.createCommentVNode("",!0),e.createElementVNode("div",gr,e.toDisplayString(t.filterSize(u.size)),1)]),u.errMsg?(e.openBlock(),e.createElementBlock("span",fr,e.toDisplayString(u.errMsg),1)):e.createCommentVNode("",!0),u.percentage<100&&!u.errMsg?(e.openBlock(),e.createBlock(h,{key:1,percentage:u.percentage},null,8,["percentage"])):(e.openBlock(),e.createBlock(h,{key:2,percentage:u.percentage,status:u.errMsg?"exception":"success"},null,8,["percentage","status"]))]),e.createElementVNode("div",Cr,[!u.percentage||0<u.percentage<100&&!u.isPlay?(e.openBlock(),e.createElementBlock("span",{key:0,class:"icon delete",onClick:f=>t.handleDeleteChangeFile(m)},[e.createVNode(d,{type:"ElIconClose"})],8,vr)):e.createCommentVNode("",!0),u.percentage&&u.percentage!==100?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(["icon",u.isPlay?"delete":"success"]),onClick:f=>t.handleStopChangeFile(m,u)},[u.isPlay?(e.openBlock(),e.createBlock(d,{key:0,type:"ElIconVideoPause"})):(e.openBlock(),e.createBlock(d,{key:1,type:"ElIconCaretRight"}))],10,yr)):e.createCommentVNode("",!0)])]))),128))])]),_:1},8,["modelValue","before-close"])])}],["__scopeId","data-v-9c3ea43c"]]);pt.install=function(t){t.component(pt.name,pt)},mt.install=function(t){t.component(mt.name,mt)},ut.install=function(t){t.component(ut.name,ut)},gt.install=function(t){t.component(gt.name,gt)},ft.install=function(t){t.component(ft.name,ft)};const kr={class:"tabs-header"},Ct=v({name:"cvTabsJump",props:{tabPosition:{type:String,default:"top"}},provide(){return{addChildComponents:t=>{this.childComponents.push(t)},clearChildClass:()=>{this.childComponents.map(t=>{t.className=null})}}},data:()=>({childComponents:[]}),computed:{tabPositionClass(){return this.tabPosition=="left"?"left":this.tabPosition=="right"?"right":this.tabPosition=="bottom"?"bottom":"top"}},created(){},mounted(){}},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cv-tabs-jump",n.tabPositionClass])},[e.createElementVNode("div",kr,[e.renderSlot(t.$slots,"default")])],2)}]]),br={name:"cvTabPane",emits:["click"],inject:["addChildComponents","clearChildClass"],data:()=>({isshow:!0,className:null}),props:{label:{type:String,default:""},current:{type:Boolean,default:!1},name:{type:String}},mounted(){this.addChildComponents(this),this.initCurrent()},methods:{initCurrent(){this.current&&this.handleClick()},handleClick(){this.clearChildClass(),this.className="active",this.$emit("click")}}},wr={key:1},vt=v(br,[["render",function(t,o,a,i,l,n){return e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cv-tab-pane",l.className]),onClick:o[0]||(o[0]=(...r)=>n.handleClick&&n.handleClick(...r))},[t.$slots.label?e.renderSlot(t.$slots,"label",{key:0}):(e.openBlock(),e.createElementBlock("span",wr,e.toDisplayString(a.label),1))],2)),[[e.vShow,l.isshow]])}]]);Ct.install=function(t){t.component(Ct.name,Ct)},vt.install=function(t){t.component(vt.name,vt)};const Vr={class:"cv-draw-captcha"},xr=["width","height"],yt=v({name:"cvDrawCaptcha",props:{modelValue:{type:[String,Number],default:"1234"},baseCode:{type:String,default:"1234567890ABCDEFGHGKMNPQRSTUVWXY"},fontSizeMin:{type:Number,default:25},fontSizeMax:{type:Number,default:30},backgroundColorMin:{type:Number,default:255},backgroundColorMax:{type:Number,default:255},colorMin:{type:Number,default:0},colorMax:{type:Number,default:160},lineColorMin:{type:Number,default:100},lineColorMax:{type:Number,default:255},dotColorMin:{type:Number,default:0},dotColorMax:{type:Number,default:255},contentWidth:{type:Number,default:112},contentHeight:{type:Number,default:31},refreshNum:{type:Number,default:1}},data:()=>({localCode:""}),watch:{modelValue(t){this.localCode=t,this.drawPic()},refreshNum(){this.refreshCode(),this.drawPic()}},mounted(){this.modelValue==""&&(this.refreshCode(),this.drawPic())},created(){this.localCode=this.modelValue},methods:{refreshCode(){this.localCode="",this.makeCode(this.baseCode,4),this.$emit("update:modelValue",this.localCode)},makeCode(t,o){for(let a=0;a<o;a++)this.localCode+=this.baseCode[this.randomNum(0,this.baseCode.length)]},randomNum:(t,o)=>Math.floor(Math.random()*(o-t)+t),randomColor(t,o){return"rgb("+this.randomNum(t,o)+","+this.randomNum(t,o)+","+this.randomNum(t,o)+")"},drawPic(){let t=document.getElementById("cv-draw-captcha").getContext("2d");t.textBaseline="bottom",t.fillStyle=this.randomColor(this.backgroundColorMin,this.backgroundColorMax),t.fillRect(0,0,this.contentWidth,this.contentHeight);for(let o=0;o<this.localCode.length;o++)this.drawText(t,this.localCode[o],o);this.drawLine(t),this.drawDot(t)},drawText(t,o,a){t.fillStyle=this.randomColor(this.colorMin,this.colorMax),t.font=this.randomNum(this.fontSizeMin,this.fontSizeMax)+"px SimHei";let i=(a+1)*(this.contentWidth/(this.localCode.length+1)),l=this.randomNum(this.fontSizeMax,this.contentHeight-5);var n=this.randomNum(-45,45);t.translate(i,l),t.rotate(n*Math.PI/180),t.fillText(o,0,0),t.rotate(-n*Math.PI/180),t.translate(-i,-l)},drawLine(t){for(let o=0;o<5;o++)t.strokeStyle=this.randomColor(this.lineColorMin,this.lineColorMax),t.beginPath(),t.moveTo(this.randomNum(0,this.contentWidth),this.randomNum(0,this.contentHeight)),t.lineTo(this.randomNum(0,this.contentWidth),this.randomNum(0,this.contentHeight)),t.stroke()},drawDot(t){for(let o=0;o<80;o++)t.fillStyle=this.randomColor(0,255),t.beginPath(),t.arc(this.randomNum(0,this.contentWidth),this.randomNum(0,this.contentHeight),1,0,2*Math.PI),t.fill()}}},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",Vr,[e.createElementVNode("canvas",{id:"cv-draw-captcha",width:a.contentWidth,height:a.contentHeight,onClick:o[0]||(o[0]=(...r)=>n.refreshCode&&n.refreshCode(...r))},null,8,xr)])}]]),kt=v({name:"cvDrawQrcode",data:()=>({})},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",null,"二维码")}]]);yt.install=function(t){t.component(yt.name,yt)},kt.install=function(t){t.component(kt.name,kt)};const Nr={name:"cvTagBase",mixins:[],components:{},emits:["update:modelValue","exceed-max-length"],props:{...k.ElTag.props,modelValue:{type:[Array,Object],default:()=>[]},closable:{type:Boolean,default:!1},disableTransitions:{type:Boolean,default:!1},effect:{type:String,default:"light"},color:{type:String,default:""},hit:{type:Boolean,default:!1},type:{type:[String],default:"primary"},size:{type:[String],default:"large"},disabled:{type:Boolean,default:!1},maxlength:{type:Number,default:3,validator:t=>t>0}},watch:{modelValue(){this.localVal=this.modelValue},localVal(t){this.$emit("update:modelValue",t),t.length>=this.maxlength&&this.$emit("exceed-max-length",t.length)}},data(){return{localVal:this.modelValue}},methods:{addTag(){this.disabled||this.localVal.length>=this.maxlength||(this.localVal.push("新标签"),this.$nextTick(()=>{let t=this.localVal.length,o=this.$refs["newTag"+(t-1)][0],a=document.createRange();a.selectNodeContents(o),window.getSelection().removeAllRanges(),window.getSelection().addRange(a)}))},checkTag(t){if(this.disabled)return;let o=this.$refs[`newTag${t}`][0].innerText.trim();o.length==0?this.localVal.pop():this.localVal[t]=o},removeTag(t){this.disabled||this.localVal.splice(t,1)}}},Sr={class:"cv-tag-base"},Br=["contenteditable","onKeyup","onBlur"],Er={key:1,class:"cv-tag-maxlength-hint"},bt=v(Nr,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-tag"),c=e.resolveComponent("cv-icons");return e.openBlock(),e.createElementBlock("div",Sr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.localVal,(h,d)=>(e.openBlock(),e.createBlock(r,e.mergeProps({class:"cv-tag-content"},{ref_for:!0},{closable:!a.disabled&&a.closable,disableTransitions:a.disableTransitions,effect:a.effect,type:a.type,color:a.color,hit:a.hit,size:a.size},{key:d,onClose:p=>n.removeTag(d),disabled:a.disabled}),{default:e.withCtx(()=>[e.createElementVNode("div",{class:"cv-tag-item",contenteditable:!a.disabled&&"plaintext-only",ref_for:!0,ref:`newTag${d}`,onKeyup:e.withKeys(p=>!a.disabled&&n.checkTag(d),["enter"]),onBlur:p=>!a.disabled&&n.checkTag(d)},e.toDisplayString(h),41,Br)]),_:2},1040,["onClose","disabled"]))),128)),!a.disabled&&l.localVal.length<a.maxlength?(e.openBlock(),e.createBlock(c,{key:0,type:"ElIconCirclePlus",size:"20",onClick:o[0]||(o[0]=h=>n.addTag())})):e.createCommentVNode("",!0),!a.disabled&&l.localVal.length>=a.maxlength?(e.openBlock(),e.createElementBlock("span",Er,"已达到最大数量 ("+e.toDisplayString(a.maxlength)+")",1)):e.createCommentVNode("",!0)])}]]);bt.install=function(t){t.component(bt.name,bt)};const Dr={name:"cvTransferTable",props:{modelValue:{type:[Array],default:()=>[]},showQuery:{type:Boolean,default:!1},showPagination:{type:Boolean,default:!1},paginationCallBack:{type:Function,default:function(){return new Promise((t,o)=>{try{t({total:0,data:null})}catch{o()}})}},titleTexts:{type:Array,default:()=>["待选项","已选项"]},buttonTexts:{type:Array,default:()=>[]},queryTexts:{type:Array,default:()=>["查询","筛选"]},leftColumns:{type:Array,default:()=>[]},rightColumns:{type:Array,default(){}},minHeight:{type:String,default:"300px"},maxHeight:{type:String,default:"500px"},tableRowKey:{type:Function,default:t=>t&&t&&t.id}},data:()=>({leftTableData:[],rightTableData:[],pageIndex:1,pageSize:20,totalSize:0,leftSelection:[],rightSelection:[],leftQueryCondition:{},rightQueryCondition:{},rightConditionTemp:void 0}),watch:{modelValue(t){this.rightTableData=t}},created(){this.rightTableData=this.modelValue,this.handlePaginationCallBack()},computed:{hasButtonTexts(){return this.buttonTexts.length===2},buttonClasses(){return["transfer-button",{"is-with-texts":this.hasButtonTexts}]},disabledLeftButton(){return!this.leftSelection.some(t=>!this.rightTableData.some(o=>this.checkObjectIsEqual(t,o)))},calcRightTableData(){if(this.showQuery&&this.rightConditionTemp){const t=Object.keys(this.rightConditionTemp);return this.rightTableData.filter(o=>t.some(a=>{const i=o[a],l=this.rightConditionTemp[a].trim();return!i||String(i).indexOf(l)>-1}))}return this.rightTableData}},methods:{handleLeftSelectionChange(t){this.leftSelection=t},handleRightSelectionChange(t){this.rightSelection=t},handleLeftRowClick(t){this.rightTableData.some(o=>this.checkObjectIsEqual(o,t))||this.$refs.leftTable.toggleRowSelection(t)},handleRightRowClick(t){this.$refs.rightTable.toggleRowSelection(t)},handleSizeChange(t){this.pageSize=t,this.handlePaginationCallBack()},handleCurrentChange(t){this.pageIndex=t,this.handlePaginationCallBack()},handlePaginationCallBack(){if(this.showPagination&&this.paginationCallBack){const t={pageIndex:this.pageIndex,pageSize:this.pageSize,...this.leftQueryCondition};this.paginationCallBack.call(null,t).then(o=>{o&&Array.isArray(o.data)&&(this.leftTableData=o.data,this.totalSize=o.total),this.$nextTick(()=>{this.leftTableData.forEach(a=>{const i=this.rightTableData.some(l=>this.checkObjectIsEqual(l,a));this.$refs.leftTable.toggleRowSelection(a,i)})})})}},handleRowStyle({row:t}){return this.rightTableData.some(o=>this.checkObjectIsEqual(o,t))?{color:"blue"}:{}},handleSelectable(t){return!this.rightTableData.some(o=>this.checkObjectIsEqual(o,t))},addToRight(){for(const t of this.leftSelection)this.rightTableData.some(o=>this.checkObjectIsEqual(o,t))||this.rightTableData.push(t);this.$emit("update:modelValue",this.rightTableData)},addToLeft(){this.rightSelection.forEach(t=>{const o=this.rightTableData.findIndex(a=>this.checkObjectIsEqual(a,t));if(o!==-1){this.rightTableData.splice(o,1);const a=this.leftTableData.find(i=>this.checkObjectIsEqual(i,t));a&&this.$refs.leftTable.toggleRowSelection(a,!1)}}),this.$emit("update:modelValue",this.rightTableData)},onLeftQuerySubmit(){this.handlePaginationCallBack()},onRightQuerySubmit(){this.rightConditionTemp=JSON.parse(JSON.stringify(this.rightQueryCondition))},checkObjectIsEqual(t,o){return this.tableRowKey(t)===this.tableRowKey(o)},clear(){this.rightTableData=[],this.$refs.leftTable.clearSelection();for(const t in this.leftQueryCondition)this.leftQueryCondition[t]=void 0;for(const t in this.rightQueryCondition)this.rightQueryCondition[t]=void 0;this.pageIndex=1,this.handlePaginationCallBack()}}},_r={class:"cv-transfer-table"},Tr={class:"transfer-panel"},Ir={class:"transfer-panel-header"},Lr={key:0},Fr={style:{padding:"5px"}},Or={class:"transfer-buttons"},$r={key:0,class:"button-text"},zr={key:0,class:"button-text"},Pr={class:"transfer-panel"},Mr={class:"transfer-panel-header"},Hr={key:0},Ar={style:{padding:"5px"}},wt=v(Dr,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-button"),c=e.resolveComponent("el-form-item"),h=e.resolveComponent("el-form"),d=e.resolveComponent("el-table-column"),p=e.resolveComponent("el-table"),u=e.resolveComponent("el-pagination"),m=e.resolveComponent("cv-icons");return e.openBlock(),e.createElementBlock("div",_r,[e.createElementVNode("div",Tr,[e.createElementVNode("p",Ir,[e.createElementVNode("span",null,e.toDisplayString(a.titleTexts&&a.titleTexts[0]),1),e.createElementVNode("span",null,e.toDisplayString(l.leftSelection.length)+"/"+e.toDisplayString(l.leftTableData.length),1)]),a.showQuery?(e.openBlock(),e.createElementBlock("div",Lr,[e.createVNode(h,{inline:!0,model:l.leftQueryCondition,class:"cv-transfer-form"},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"leftCondition",{scope:l.leftQueryCondition}),e.createVNode(c,null,{default:e.withCtx(()=>[e.createVNode(r,{type:"primary",onClick:o[0]||(o[0]=f=>n.onLeftQuerySubmit())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.queryTexts[0]),1)]),_:1})]),_:1})]),_:3},8,["model"])])):e.createCommentVNode("",!0),e.createVNode(p,{ref:"leftTable","max-height":a.maxHeight,height:a.minHeight,data:l.leftTableData,"row-key":a.tableRowKey,"row-style":n.handleRowStyle,onRowClick:n.handleLeftRowClick,onSelectionChange:n.handleLeftSelectionChange,border:"",stripe:""},{default:e.withCtx(()=>[e.createVNode(d,{width:"40px",type:"selection",selectable:n.handleSelectable},null,8,["selectable"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.leftColumns,f=>(e.openBlock(),e.createBlock(d,{prop:f.id,key:f.id,label:f.label,width:f.width},{default:e.withCtx(C=>[e.renderSlot(t.$slots,"default",{scope:{row:C.row,col:f}},()=>[e.createElementVNode("span",null,e.toDisplayString(C.row[f.id]),1)])]),_:2},1032,["prop","label","width"]))),128))]),_:3},8,["max-height","height","data","row-key","row-style","onRowClick","onSelectionChange"]),e.createElementVNode("div",Fr,[a.showPagination?(e.openBlock(),e.createBlock(u,{key:0,onSizeChange:n.handleSizeChange,onCurrentChange:n.handleCurrentChange,"current-page":l.pageIndex,"page-sizes":[10,20,50,100],"page-size":l.pageSize,"pager-count":5,total:l.totalSize,layout:"total, sizes, prev, pager, next"},null,8,["onSizeChange","onCurrentChange","current-page","page-size","total"])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Or,[e.createVNode(r,{type:"primary",class:e.normalizeClass(n.buttonClasses),disabled:n.disabledLeftButton,onClick:n.addToRight},{default:e.withCtx(()=>[a.buttonTexts[0]!==void 0?(e.openBlock(),e.createElementBlock("span",$r,e.toDisplayString(a.buttonTexts[0]),1)):e.createCommentVNode("",!0),e.createVNode(m,{type:"ElIconArrowRight"})]),_:1},8,["class","disabled","onClick"]),e.createVNode(r,{type:"primary",class:e.normalizeClass(n.buttonClasses),disabled:l.rightSelection.length===0,onClick:n.addToLeft},{default:e.withCtx(()=>[e.createVNode(m,{type:"ElIconArrowLeft"}),a.buttonTexts[1]!==void 0?(e.openBlock(),e.createElementBlock("span",zr,e.toDisplayString(a.buttonTexts[1]),1)):e.createCommentVNode("",!0)]),_:1},8,["class","disabled","onClick"])]),e.createElementVNode("div",Pr,[e.createElementVNode("p",Mr,[e.createElementVNode("span",null,e.toDisplayString(a.titleTexts&&a.titleTexts[1]),1),e.createElementVNode("span",null,e.toDisplayString(l.rightSelection.length)+"/"+e.toDisplayString(l.rightTableData.length),1)]),a.showQuery?(e.openBlock(),e.createElementBlock("div",Hr,[e.createVNode(h,{inline:!0,model:l.rightQueryCondition,class:"cv-transfer-form"},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"rightCondition",{scope:l.rightQueryCondition}),e.createVNode(c,null,{default:e.withCtx(()=>[e.createVNode(r,{type:"primary",onClick:o[1]||(o[1]=f=>n.onRightQuerySubmit())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.queryTexts[1]),1)]),_:1})]),_:1})]),_:3},8,["model"])])):e.createCommentVNode("",!0),e.createVNode(p,{ref:"rightTable","max-height":a.maxHeight,height:a.minHeight,data:n.calcRightTableData,"row-key":a.tableRowKey,onRowClick:n.handleRightRowClick,onSelectionChange:n.handleRightSelectionChange,border:"",stripe:""},{default:e.withCtx(()=>[e.createVNode(d,{width:"40px",type:"selection"}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.rightColumns||a.leftColumns,f=>(e.openBlock(),e.createBlock(d,{prop:f.id,key:f.id,label:f.label,width:f.width},{default:e.withCtx(C=>[e.renderSlot(t.$slots,"default",{scope:{row:C.row,col:f}},()=>[e.createElementVNode("span",null,e.toDisplayString(C.row[f.id]),1)])]),_:2},1032,["prop","label","width"]))),128))]),_:3},8,["max-height","height","data","row-key","onRowClick","onSelectionChange"]),e.createElementVNode("div",Ar,[a.showPagination?(e.openBlock(),e.createBlock(u,{key:0,total:l.rightTableData.length,layout:"total"},null,8,["total"])):e.createCommentVNode("",!0)])])])}]]);wt.install=function(t){t.component(wt.name,wt)};const Go={provide(){return{pageCurr:this.loadConfigSetting.pageCurr||1,pageLimit:this.loadConfigSetting.pageLimit||10}},props:{...k.ElTable.props,modelValue:{type:[Array,Object],default:()=>[]},headerCellStyle:{type:[Function,Object],default:()=>({})}},data:()=>({loadDataList:[]}),watch:{modelValue(t){this.loadDataList=t},loadDataList(t){this.$emit("update:modelValue",t)}},created(){this.loadDataList=this.modelValue},methods:{_getPageCurr(){return this.loadPageCurr},_getPageSize(){return this.loadPageLimit},handleCurrentChange(t){this.loadPageCurr=t,this.getData()},handleSizeChange(t){this.loadPageLimit=t,this.getData()}}},jr={name:"cvTableBase",mixins:[oo,Go],props:{align:{type:String,default:"left"},showPagebreak:{type:[Boolean,String],default:!0},tablePagin:{type:Object,default:()=>({})},tableConfig:{type:Object,default:()=>({})},tableRefresh:{type:Number,default:()=>0}},data:()=>({paginationGroup:[10,20,30,50,100,200],paginationCount:7,searchData:{},tableConfDef:{}}),watch:{tableRefresh(t,o){this.initConfAll(),this.refresh()}},updated(){},created(){this.initConfAll(),this.getData()},mounted(){},methods:{getData(){this.loadDataList=[],this.loadGetData()},handleSelectionChange(t){this.$emit("selection-change",t)},initConfAll(){let t={};Object.assign(t,this.loadConfigDef,this.tableConfDef,this.tableConfig),this.loadPageCurr=t.pageCurr||1,this.loadPageLimit=t.pageLimit||this.paginationGroup[0],Object.assign(t.where,this.searchData),this.loadConfigSetting=t},searchSubmit(t){this.searchData=t||{},this.loadConfigSetting.isSkip?this.searchData:(this.page=1,this.getData())},searchReset(t){this.searchData={},this.page=1,this.getData()},refresh(t){this.getData()}}},Rr={class:"cv-table-list"},Ur={key:0,class:"cv-tablie-list-page page"},Vt=v(jr,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table"),c=e.resolveComponent("cv-icons"),h=e.resolveComponent("el-button"),d=e.resolveComponent("el-pagination"),p=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",Rr,[e.withDirectives((e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{data:t.loadDataList,style:{width:"100%"},onSelectionChange:n.handleSelectionChange}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16,["data","onSelectionChange"])),[[p,t.loadDataLoading]]),a.showPagebreak?e.withDirectives((e.openBlock(),e.createElementBlock("div",Ur,[e.createVNode(h,{onClick:n.refresh,style:{float:"left",margin:"0 10px 0 0",padding:"5px 10px"}},{default:e.withCtx(()=>[e.createVNode(c,{type:"ElIconRefresh",size:"14"})]),_:1},8,["onClick"]),e.createVNode(d,{background:"",onSizeChange:t.handleSizeChange,onCurrentChange:t.handleCurrentChange,"pager-count":l.paginationCount,"page-sizes":l.paginationGroup,"current-page":t.loadPageCurr,"page-size":t.loadPageLimit,layout:"total, sizes, prev, pager, next, jumper",total:t.loadDataTotal},null,8,["onSizeChange","onCurrentChange","pager-count","page-sizes","current-page","page-size","total"])],512)),[[e.vShow,t.loadDataLoading===!1]]):e.createCommentVNode("",!0)])}]]),Wr={class:"cv-table-tree"},xt=v({name:"cvTableTree",mixins:[oo,Go],props:{tableConfig:{type:Object,default:()=>({})},tableRefresh:{type:Number,default:()=>0}},data:()=>({searchData:{},tableConfDef:{tablePrimary:"",childName:"children"},pager_count:7,page:1}),watch:{tableRefresh(t,o){this.refresh()}},created(){this.initConfAll(),this.getData()},mounted(){},methods:{getData(){this.loadDataList=[],this.loadGetData()},handleSelectionChange(t){this.$emit("selection-change",t)},initConfAll(){let t={};Object.assign(t,this.loadConfigDef,this.tableConfDef,this.tableConfig),Object.assign(t.where,this.searchData),this.loadConfigSetting=t},searchSubmit(t){this.searchData=t||{},this.loadConfigSetting.isSkip?this.searchData:(this.page=1,this.getData())},searchReset(t){this.searchData={},this.page=1,this.getData()},refresh(t){this.getData()}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table"),c=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",Wr,[e.withDirectives((e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{data:t.loadDataList,style:{width:"100%"},onSelectionChange:n.handleSelectionChange,"row-key":t.loadConfigSetting.tablePrimary,"tree-props":{children:t.loadConfigSetting.childName,hasChildren:"hasChildren"}}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16,["data","onSelectionChange","row-key","tree-props"])),[[c,t.loadDataLoading]])])}]]),Yr={name:"cvTableEditor",mixins:[oo,Go],props:{border:{type:[Boolean],default:!0},tableConfig:{type:[Array,Object],default:()=>({})}},data:()=>({mergeRules:{},apiFunc:null,tableConfDef:{},cell_click_index:null,cell_click_label:""}),watch:{},created(){this.loadConfigSetting=Object.assign({},this.tableConfDef,this.tableConfig)},mounted(){},methods:{cell_click(t,o,a,i){switch(this.cell_click_index=t.index,this.cell_click_label=o.label,o.label){case"taskid":case"taskname":this.cell_click_index=t.index,this.cell_click_label=o.label;break;default:return}},handleChangeTData(t){}}},Xr={class:"cv-table-editor"},Nt=v(Yr,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table"),c=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",Xr,[e.withDirectives((e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{data:t.loadDataList,style:{width:"100%"},"row-class-name":"cv-tbed-tr"}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16,["data"])),[[c,t.loadDataLoading]])])}]]),St=v({name:"cvTbColumnIndex",inject:{pageCurr:{default:1},pageLimit:{default:10}},props:{...k.ElTableColumn.props,fixed:{type:[String],default:"left"},align:{type:String,default:"center"},width:{type:[String,Number],default:55},continuity:{type:[Boolean,String],default:!1}},data:()=>({}),created(){},methods:{indexMethod(t){return this.continuity&&this.pageCurr&&this.pageLimit?t+1+(this.pageCurr-1)*this.pageLimit:t+1}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{type:"index",index:n.indexMethod}),null,16,["index"])}]]),Bt=v({name:"cvTbColumnCheck",props:{...k.ElTableColumn.props,fixed:{type:[String],default:"left"},align:{type:[String],default:"center"},width:{type:[String,Number],default:55}},data:()=>({}),created(){}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{type:"selection"}),null,16)}]]),qr={name:"cvTbColumnText",props:{...k.ElTableColumn.props},data:()=>({}),created(){},methods:{getContentText(t){let o=t.row[this.prop];return this.formatter&&(o=this.formatter(t.row,t.column)),o}}},Kr={style:{display:"contents"}},Et=v(qr,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(c=>[e.createElementVNode("div",Kr,e.toDisplayString(c.row[t.prop]),1)]),_:1},16)}]]),Gr={name:"cvTbColumnImg",props:{...k.ElTableColumn.props,imgWidth:{type:[String,Number],default:null},imgHeight:{type:[String,Number],default:null}},data:()=>({localImgWidth:"50px",localImgHeight:"50px",localImgArr:[],localImgOne:""}),created(){this.imgWidth&&(this.localImgWidth=this.imgWidth.indexOf("px")!==-1?this.imgWidth:this.imgWidth+"px"),this.imgHeight&&(this.localImgHeight=this.imgHeight.indexOf("px")!==-1?this.imgHeight:this.imgHeight+"px")},methods:{handleImgOne(t){let o=t[this.prop]||null;if(o){if(Object.prototype.toString.call(o)==="[object Array]")return o[0];if(Object.prototype.toString.call(o)==="[object String]")return o}},handleImgArr(t){let o=t[this.prop]||null;if(o){if(Object.prototype.toString.call(o)==="[object Array]")return o;if(Object.prototype.toString.call(o)==="[object String]")return[o]}},handleImgLeng(t){let o=t[this.prop]||null;return o?Object.prototype.toString.call(o)==="[object Array]"?o.length:Object.prototype.toString.call(o)==="[object String]"?1:void 0:0}}},Zr={key:0,class:"cv-table-column-img-mark"},Qr={class:"cv-table-column-img-text"},Dt=v(Gr,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-image"),c=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(c,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(h=>[e.createElementVNode("div",{class:"cv-table-column-img-box",style:e.normalizeStyle({width:l.localImgWidth,height:l.localImgHeight})},[e.createVNode(r,{style:e.normalizeStyle({width:l.localImgWidth,height:l.localImgHeight}),fit:"scale-down",lazy:"",src:n.handleImgOne(h.row),"preview-src-list":n.handleImgArr(h.row)},{error:e.withCtx(()=>o[0]||(o[0]=[e.createElementVNode("span",{class:"el-image__error cv-table-column-img-err"},[e.createTextVNode(" 暂无 "),e.createElementVNode("br"),e.createTextVNode(" 图片 ")],-1)])),_:2},1032,["style","src","preview-src-list"]),n.handleImgLeng(h.row)>1?(e.openBlock(),e.createElementBlock("p",Zr,[e.createElementVNode("span",Qr,e.toDisplayString(n.handleImgLeng(h.row))+"张",1)])):e.createCommentVNode("",!0)],4)]),_:1},16)}]]),_t=v({name:"cvTbColumnOpt",props:{...k.ElTableColumn.props,fixed:{type:[String],default:"right"},label:{type:[String],default:"操作"}},data:()=>({}),created(){}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(c=>[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps({row:c.row,$index:c.$index,scope:c})))]),_:3},16)}]]),Tt=v({name:"cvTbColumnBase",props:{...k.ElTableColumn.props,width:{type:[String,Number],default:""}},data:()=>({}),created(){}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(c=>[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps({row:c.row,$index:c.$index,scope:c})))]),_:3},16)}]]),It=v({name:"cvTbColumnExpand",props:{...k.ElTableColumn.props},data:()=>({}),created(){}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(r,e.mergeProps(t.$props,{type:"expand"}),{default:e.withCtx(c=>[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps({row:c.row,$index:c.$index,props:c})))]),_:3},16)}]]),Lt=v({name:"cvTbColumnEnum",props:{...k.ElTableColumn.props,dataLists:{type:[Object,Array],default:()=>({})}},data:()=>({}),created(){},methods:{dealTypeEnum(t){let o=Object.keys(this.dataLists);return t[this.prop]?this.dataLists[t[this.prop]]||"":this.dataLists[o[0]]||""}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(c=>[e.createElementVNode("span",null,e.toDisplayString(n.dealTypeEnum(c.row)),1)]),_:1},16)}]]),Jr={name:"cvTbEditSearch",props:{...k.ElTableColumn.props,modelValue:{type:[String],default:""},align:{type:[String],default:"left"}},data:()=>({isEditIndex:null,localVal:"",autocompleteAttr:{debounce:0},searchSett:{searchFunc:null,searchParam:{},searchMockData:null,searchField:{}},searchResList:[],searchCurrClass:"",searchCurrTbIndex:0,searchIsSelect:!1}),watch:{modelValue(t){},localVal(t){this.$emit("update:modelValue",t)}},directives:{edfocus:{mounted:t=>{}}},created(){},methods:{searchEdit(t,o){this.isEditIndex=o,this.$nextTick(()=>{this.$refs[`cv-tbce-autocomplete${o}`].focus()})},searchSave(t,o){this.isEditIndex=null},searchSelect(t,o,a){this.searchIsSelect=!0,this.localTableData[a]=Object.assign(this.localTableData[a],t),this.localTableData[a].row_num=1,t.row_attr?this.localTableData[a].row_name=t.row_name+`<br><span class="cv-tbce-showtext-attr">[ ${t.row_attr} ]</span>`:this.localTableData[a].row_name=t.row_name},searchFocus(t,o){this.searchCurrClass="cvtegac"+t,this.searchCurrTbIndex=t},searchBlur(t,o){this.searchIsSelect||(this.isEditIndex=null)},searchQuery(t,o){this.searchIsSelect=!1,this.searchResList=[];const a=this.searchSett;if(a.searchMockData!=null&&a.searchMockData){if(!(typeof a.searchMockData!="Array"&&typeof a.searchMockData!="object")){const i=this.sortOutData(a.searchMockData);this.tableData=i,this.$message({message:i.msg||"",type:"warning",duration:1300})}this.$nextTick(()=>{this.tableLoading=!1})}else a.searchFunc&&typeof a.searchFunc=="function"&&a.searchFunc({page:1,pagesize:20,keyword:t,...a.searchParam}).then(i=>{this.searchResList=[...i.data],this.searchParseData(t,o)})},searchParseData(t,o){var a=[],i=[];const l=this.searchSett;if(this.searchResList.length>0){for(let n in this.searchResList){let r=this.searchResList[n];const c=l.searchField.row_price;r.row_price=r[c];const h=l.searchField.row_stock;r.row_stock=r[h];const d=l.searchField.row_attr;r.row_attr=r[d];const p=l.searchField.row_name;r.row_name=r[p];const u=l.searchField.row_unit;r.row_unit=r[u];const m=l.searchField.row_id;r.row_id=r[m],r.value=r.row_name,i.push(r)}a=i}clearTimeout(this.timeout),this.timeout=setTimeout(()=>{o(a)},600)},inputSearchFilter:t=>o=>o.value.toLowerCase().indexOf(t.toLowerCase())===0,searchIconClick(){this.isEditIndex=null}}},es={class:"name"},ts={class:"addr"},os={class:"addr"},as={class:"droplist-item"},ls={class:"name"},ns={key:0,class:"attr"},is={class:"price"},rs={class:"rest"},ss=["onClick"],Ft=v(Jr,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("ElIconCircleClose"),c=e.resolveComponent("el-icon"),h=e.resolveComponent("el-autocomplete"),d=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(d,e.mergeProps(t.$props,{"class-name":"cv-table-editor-search-column"}),{default:e.withCtx(p=>[l.isEditIndex==p.$index?(e.openBlock(),e.createBlock(h,e.mergeProps({key:0,ref:`cv-tbce-autocomplete${p.$index}`},l.autocompleteAttr,{modelValue:p.row[t.prop],"onUpdate:modelValue":u=>p.row[t.prop]=u,"popper-class":`cv-tbce-autocomplete cvtegac${p.$index}`,"fetch-suggestions":n.searchQuery,onSelect:u=>n.searchSelect(u,p.row,p.$index),onFocus:u=>n.searchFocus(p.$index,u),onBlur:u=>n.searchBlur(p.row,p.$index)}),{suffix:e.withCtx(()=>[e.createVNode(c,{onClick:u=>n.searchIconClick(p.row,p.$index)},{default:e.withCtx(()=>[e.createVNode(r)]),_:2},1032,["onClick"])]),default:e.withCtx(({item:u})=>[e.renderSlot(t.$slots,"default",{item:u},()=>[e.createElementVNode("div",es,e.toDisplayString(u.row_name),1),e.createElementVNode("span",ts,"价格:"+e.toDisplayString(u.row_price),1),e.createElementVNode("span",os,e.toDisplayString(u.row_rest),1),e.createElementVNode("div",as,[e.createElementVNode("div",ls,[e.createTextVNode(e.toDisplayString(u.row_name)+" ",1),u.row_attr?(e.openBlock(),e.createElementBlock("div",ns,"[ "+e.toDisplayString(u.row_attr)+"]",1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",is,"¥ "+e.toDisplayString(u.row_price),1),e.createElementVNode("div",rs,e.toDisplayString(u.attr_stock),1)])])]),_:2},1040,["modelValue","onUpdate:modelValue","popper-class","fetch-suggestions","onSelect","onFocus","onBlur"])):(e.openBlock(),e.createElementBlock("span",{key:1,class:"showtext",onClick:u=>n.searchEdit(p.row,p.$index)},e.toDisplayString(p.row[t.prop]),9,ss))]),_:3},16)}]]),Ot=v({name:"cvTbEditOpt",props:{tableData:{type:[Array],default:()=>[]},...k.ElTableColumn.props,label:{type:[String],default:"操作"},align:{type:[String],default:"center"},width:{type:[String],default:"100"},fixed:{type:[String],default:"left"},btnAdd:{type:[Boolean,String],default:!0},btnDel:{type:[Boolean,String],default:!0}},data:()=>({localTbData:[]}),watch:{tableData(t){this.localTbData=t}},created(){this.localTbData=this.tableData},methods:{optHdDelete(t,o){this.localTbData.splice(t,1),this.localTbData.length<1&&this.optHdAdd()},optHdAdd(){this.localTbData.push({})}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("cv-icons"),c=e.resolveComponent("el-button"),h=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(h,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(d=>[a.btnAdd?(e.openBlock(),e.createBlock(c,{key:0,plain:"",style:{padding:"5px",width:"26px",height:"26px"},onClick:o[0]||(o[0]=p=>n.optHdAdd())},{default:e.withCtx(()=>[e.createVNode(r,{type:"ElIconPlus"})]),_:1})):e.createCommentVNode("",!0),a.btnDel?(e.openBlock(),e.createBlock(c,{key:1,plain:"",style:{padding:"5px",width:"26px",height:"26px"},onClick:p=>n.optHdDelete(d.$index,d.row)},{default:e.withCtx(()=>[e.createVNode(r,{type:"ElIconClose"})]),_:2},1032,["onClick"])):e.createCommentVNode("",!0)]),_:1},16)}]]),cs={name:"cvTbEditText",props:{...k.ElTableColumn.props,width:{type:[String,Number],default:""},editAttr:{type:[Object],default:()=>({placeholder:"请输入"})},editClearable:{type:[Boolean],default:!0},editStyle:{type:[Object],default:()=>({"--el-input-border":0,"--el-input-border-radius":0,"--el-input-height":"36px"})},editClass:{type:[Object],default:()=>({})},editChange:{type:[Function],default:()=>{}},editFormatter:{type:[Function],default:()=>{}},toFixed:{type:[String,Number],default:""}},data:()=>({currValue:"",isEditIndex:null,isErrIndex:[]}),directives:{edfocus:{mounted:t=>{t.querySelector("input").focus()},inserted:function(t){t.querySelector("input").focus()}}},created(){},methods:{textIsError(t){return this.isErrIndex&&this.isErrIndex[t]&&this.isErrIndex[t][this.prop]},textHdEdit(t,o){this.isEditIndex=o},textHdClear(t,o){},textHdSave(t,o){this.isEditIndex=null;let a=t[this.prop];if(this.toFixed!=""){let i=parseInt(this.toFixed);isNaN(a)||(t[this.prop]=parseFloat(a).toFixed(i))}else t[this.prop]=a}},render22(t,o){let a=this;return t("el-table-column",{props:{...this.$props},scopedSlots:{default:i=>{this.currValue=i.row[this.prop];let l=i.$index;return this.isEditIndex==l?t("el-input",{props:{style:this.editStyle,class:this.editClass},domProps:{value:this.currValue},props:{placeholder:this.placeholder,value:this.param},nativeOn:{keyup:n=>{n.keyCode===13&&(this.$emit("update:param",n.target.value),this.callback&&this.callback())}},on:{blur:n=>{this.$emit("update:param",n.target.value),this.callback&&this.callback()},input:function(n){a.currValue=n||n.target.value},blur:n=>{this.isEditIndex=null,a.currValue=n||n.target.value}}},this.currValue):t("span",{class:{showtext:!0},on:{click:()=>{this.isEditIndex=l}}},this.currValue)}}})}},ds=["onClick"],$t=v(cs,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-input"),c=e.resolveComponent("el-table-column"),h=e.resolveDirective("edfocus");return e.openBlock(),e.createBlock(c,e.mergeProps(t.$props,{"class-name":"cv-table-editor-text-column"}),{default:e.withCtx(d=>[l.isEditIndex!=d.$index||a.editAttr.disabled?(e.openBlock(),e.createElementBlock("span",{key:1,class:"showtext",onClick:p=>n.textHdEdit(d.row,d.$index)},e.toDisplayString(d.row[t.prop]),9,ds)):e.withDirectives((e.openBlock(),e.createBlock(r,e.mergeProps({key:0},a.editAttr,{clearable:a.editClearable,style:a.editStyle,class:a.editClass,modelValue:d.row[t.prop],"onUpdate:modelValue":p=>d.row[t.prop]=p,onBlur:e.withModifiers(p=>n.textHdSave(d.row,d.$index),["prevent"]),onClear:p=>n.textHdClear(d.row,d.$index)}),null,16,["clearable","style","class","modelValue","onUpdate:modelValue","onBlur","onClear"])),[[h]])]),_:1},16)}]]),zt=v({name:"cvTbEditRadio",props:{...k.ElTableColumn.props,editAttr:{type:[Object],default:()=>({})},editStyle:{type:[Object],default:()=>({})},editClass:{type:[Object],default:()=>({})},dataLists:{type:[Object,Array],default:()=>({})},dataField:{type:Object,default:()=>({label:"label",value:"value"})},editChange:{type:[Function],default:()=>{}},editFormatter:{type:[Function],default:()=>{}}},data:()=>({}),created(){}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-radio"),c=e.resolveComponent("el-radio-group"),h=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(h,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(d=>[e.createVNode(c,e.mergeProps({style:a.editStyle,class:a.editClass,modelValue:d.row[t.prop],"onUpdate:modelValue":p=>d.row[t.prop]=p},a.editAttr),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.dataLists,(p,u)=>(e.openBlock(),e.createBlock(r,{key:u,label:p[a.dataField.label],value:p[a.dataField.value]},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p[a.dataField.label]),1)]),_:2},1032,["label","value"]))),128))]),_:2},1040,["style","class","modelValue","onUpdate:modelValue"])]),_:1},16)}]]),Pt=v({name:"cvTbEditCheckbox",props:{...k.ElTableColumn.props,editAttr:{type:[Object],default:()=>({})},editStyle:{type:[Object],default:()=>({})},editClass:{type:[Object],default:()=>({})},dataLists:{type:[Object,Array],default:()=>({})},dataField:{type:Object,default:()=>({label:"label",value:"value"})},editChange:{type:[Function],default:()=>{}},editFormatter:{type:[Function],default:()=>{}}},data:()=>({localVal:[]}),created(){},methods:{handleParseValue(t){this.localVal=[]}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-checkbox"),c=e.resolveComponent("el-checkbox-group"),h=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(h,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(d=>[d.row[t.prop]?(e.openBlock(),e.createBlock(c,e.mergeProps({key:0,style:a.editStyle,class:a.editClass,modelValue:d.row[t.prop],"onUpdate:modelValue":p=>d.row[t.prop]=p},a.editAttr),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.dataLists,(p,u)=>(e.openBlock(),e.createBlock(r,{key:u,label:p[a.dataField.label],value:p[a.dataField.value]},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p[a.dataField.label]),1)]),_:2},1032,["label","value"]))),128))]),_:2},1040,["style","class","modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)]),_:1},16)}]]),Mt=v({name:"cvTbEditSelect",props:{...k.ElTableColumn.props,editAttr:{type:[Object],default:()=>({})},editStyle:{type:[Object],default:()=>({})},editClass:{type:[Object],default:()=>({})},dataLists:{type:[Object,Array],default:()=>({})},dataField:{type:Object,default:()=>({label:"label",value:"value"})},editChange:{type:[Function],default:()=>{}},editFormatter:{type:[Function],default:()=>{}}},data:()=>({}),created(){}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-option"),c=e.resolveComponent("el-select"),h=e.resolveComponent("el-table-column");return e.openBlock(),e.createBlock(h,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(d=>[e.createVNode(c,e.mergeProps({style:a.editStyle,class:a.editClass,modelValue:d.row[t.prop],"onUpdate:modelValue":p=>d.row[t.prop]=p},a.editAttr),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.dataLists,(p,u)=>(e.openBlock(),e.createBlock(r,{key:u,label:p[a.dataField.label],value:p[a.dataField.value]},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p[a.dataField.label]),1)]),_:2},1032,["label","value"]))),128))]),_:2},1040,["style","class","modelValue","onUpdate:modelValue"])]),_:1},16)}]]);Vt.install=function(t){t.component(Vt.name,Vt)},xt.install=function(t){t.component(xt.name,xt)},Nt.install=function(t){t.component(Nt.name,Nt)},St.install=function(t){t.component(St.name,St)},Bt.install=function(t){t.component(Bt.name,Bt)},Et.install=function(t){t.component(Et.name,Et)},Dt.install=function(t){t.component(Dt.name,Dt)},_t.install=function(t){t.component(_t.name,_t)},Tt.install=function(t){t.component(Tt.name,Tt)},It.install=function(t){t.component(It.name,It)},Lt.install=function(t){t.component(Lt.name,Lt)},Ft.install=function(t){t.component(Ft.name,Ft)},Ot.install=function(t){t.component(Ot.name,Ot)},$t.install=function(t){t.component($t.name,$t)},zt.install=function(t){t.component(zt.name,zt)},Pt.install=function(t){t.component(Pt.name,Pt)},Mt.install=function(t){t.component(Mt.name,Mt)};const hs={width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ps=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("svg",hs,o[0]||(o[0]=[e.createElementVNode("rect",{width:"12",height:"12",rx:"2",fill:"#86909C"},null,-1),e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.98095 5.49307L8.22012 3.25389C8.28521 3.18881 8.39074 3.18881 8.45582 3.25389L8.69153 3.4896C8.75661 3.55468 8.75661 3.66021 8.69153 3.7253L6.45235 5.96447L8.69153 8.20364C8.75661 8.26873 8.75661 8.37426 8.69153 8.43934L8.45582 8.67505C8.39074 8.74013 8.28521 8.74013 8.22012 8.67505L5.98095 6.43587L3.74178 8.67505C3.67669 8.74013 3.57116 8.74013 3.50608 8.67505L3.27037 8.43934C3.20529 8.37426 3.20529 8.26873 3.27037 8.20364L5.50954 5.96447L3.27037 3.7253C3.20529 3.66021 3.20529 3.55468 3.27037 3.4896L3.50608 3.25389C3.57116 3.18881 3.67669 3.18881 3.74178 3.25389L5.98095 5.49307Z",fill:"white"},null,-1)]))}]]),ms={width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"icon"},us=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("svg",ms,o[0]||(o[0]=[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.00002 0.666504C12.0501 0.666504 15.3334 3.94975 15.3334 7.99984C15.3334 12.0499 12.0501 15.3332 8.00002 15.3332C3.94993 15.3332 0.666687 12.0499 0.666687 7.99984C0.666687 3.94975 3.94993 0.666504 8.00002 0.666504ZM8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2ZM10.6667 5.66667V7.66667H9.33333V5.66667H10.6667ZM6.66667 5.66667V7.66667H5.33333V5.66667H6.66667ZM10.0767 9.33333H11.0495C11.1804 9.33333 11.2866 9.43951 11.2866 9.57048C11.2866 9.60754 11.2779 9.64409 11.2612 9.67718L11.244 9.71053C10.6294 10.8739 9.40726 11.6667 7.99998 11.6667C6.61523 11.6667 5.40977 10.8991 4.7859 9.76612L4.73786 9.67593C4.67845 9.56052 4.72385 9.4188 4.83926 9.35939C4.87253 9.34226 4.90941 9.33333 4.94683 9.33333H5.92347C6.02396 9.33332 6.11908 9.37865 6.18238 9.4567C6.26207 9.55496 6.32833 9.62955 6.38117 9.68046C6.80074 10.0847 7.37133 10.3333 7.99998 10.3333C8.63289 10.3333 9.20694 10.0814 9.62728 9.67224C9.67791 9.62296 9.74135 9.55121 9.8176 9.45698C9.88089 9.37877 9.97611 9.33333 10.0767 9.33333Z"},null,-1)]))}]]),gs={class:"comment-common-icon"},fs=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("i",gs,o[0]||(o[0]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:""},[e.createElementVNode("path",{d:"M4.88933 0.613974C4.92947 0.616946 4.96831 0.629568 5.00253 0.650767C6.67348 1.68589 7.55141 3.13884 7.63632 5.00962C7.947 5.00962 8.2245 4.65999 8.46882 3.96072L8.49487 3.88447C8.53862 3.75351 8.68025 3.68282 8.8112 3.72656C8.83398 3.73417 8.85554 3.74502 8.87522 3.75878C9.96316 4.5193 10.5048 5.50231 10.5 6.70782C10.4999 6.73762 10.4982 6.76675 10.495 6.7952C10.4985 6.86294 10.5 6.93131 10.5 7.00005C10.5 9.48533 8.48528 11.5 6 11.5C3.51472 11.5 1.5 9.48533 1.5 7.00005C1.5 6.90255 1.5031 6.80578 1.50921 6.70983C1.5062 6.70917 1.5031 6.70849 1.5 6.70782C1.50864 6.60849 1.52139 6.50994 1.53824 6.41219C1.54515 6.35775 1.55321 6.30373 1.56222 6.25003L1.57017 6.24983C1.7622 5.3813 2.28426 4.57601 3.13635 3.83394C4.00892 3.07405 4.50079 2.11523 4.61198 0.957499L4.62156 0.844839C4.63175 0.707146 4.75163 0.603784 4.88933 0.613974Z"})],-1)]))}]]),Cs={width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"icon"},vs=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("svg",Cs,o[0]||(o[0]=[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14 1.3335C14.3514 1.3335 14.6394 1.60546 14.6648 1.95041L14.6666 2.00016V14.0002C14.6666 14.3516 14.3947 14.6396 14.0497 14.665L14 14.6668H1.99998C1.64853 14.6668 1.36059 14.3949 1.33514 14.0499L1.33331 14.0002V2.00016C1.33331 1.64871 1.60527 1.36077 1.95023 1.33532L1.99998 1.3335H14ZM13.3333 2.66618H2.66664V13.3328H13.3333V2.66618ZM11.9219 6.7879C11.9719 6.83791 12 6.90574 12 6.97647V11.7993C12 11.9098 11.9104 11.9993 11.8 11.9993H6.81615C6.7975 11.9993 6.77945 11.9968 6.76232 11.992L3.91042 11.9847C3.79996 11.9844 3.71063 11.8947 3.7109 11.7842C3.71102 11.7313 3.73209 11.6807 3.76948 11.6433L6.52468 8.88807C6.62882 8.78393 6.79766 8.78393 6.9018 8.88807L8.17297 10.1593L11.5447 6.7879C11.6489 6.68376 11.8177 6.68376 11.9219 6.7879ZM5.99997 3.99951V5.99951H3.99997V3.99951H5.99997Z"},null,-1)]))}]]),ys={class:"comment-common-icon"},ks=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("i",ys,o[0]||(o[0]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M586.624 234.624a74.624 74.624 0 1 1-149.184 0 74.624 74.624 0 0 1 149.12 0z m0 554.624a74.624 74.624 0 1 1-149.248 0 74.624 74.624 0 0 1 149.248 0zM512 586.624a74.624 74.624 0 1 0 0-149.248 74.624 74.624 0 0 0 0 149.248z",fill:"currentColor"})],-1)]))}]]),bs={class:"comment-common-icon",style:{color:"#1e80ff"}},ws=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("i",bs,o[0]||(o[0]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1534"},[e.createElementVNode("path",{d:"M668.928 166.912c-20.48-53.504-47.9744-84.7872-82.0224-94.9248-33.5872-10.0352-61.952 4.096-76.032 13.9776-27.5456 19.3536-41.216 49.664-50.0224 74.1376-3.3792 9.3184-6.4512 19.0976-9.216 27.9552l-2.6624 8.3968a227.8912 227.8912 0 0 1-10.3936 27.9552c-25.344 52.9408-47.4112 84.5312-66.7648 104.96-18.944 19.968-36.4544 30.464-55.1936 39.7824a45.3632 45.3632 0 0 0-25.088 40.5504l-0.1024 480.7168c0 24.9344 20.2752 45.2096 45.2096 45.2096h423.0656c21.7088 0 38.144-6.912 50.0224-16.9984a72.192 72.192 0 0 0 14.4896-16.896l0.2048-0.2048 0.0512-0.1536 0.8192-1.024 1.2288-1.8944c39.424-63.7952 66.7648-114.688 88.2176-175.616 24.4224-69.4784 36.8128-129.6896 42.0352-176.64 5.12-45.6704 3.7888-81.664-1.5872-101.376a77.9776 77.9776 0 0 0-45.568-52.3264 116.5824 116.5824 0 0 0-45.4144-8.6016l-192.8192-2.6624c28.1088-115.0976 10.0864-181.6064-2.4576-214.3744zM64.0512 413.9008a45.2096 45.2096 0 0 1 45.1584-47.36H176.128c24.9344 0 45.2096 20.2752 45.2096 45.2096v480.6144a45.2096 45.2096 0 0 1-45.2096 45.2096h-44.288a45.2096 45.2096 0 0 1-45.1584-43.0592L64 413.952z","p-id":"1535"})],-1)]))}]]),Vs={class:"comment-common-icon"},xs=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("i",Vs,o[0]||(o[0]=[e.createElementVNode("svg",{t:"1650360973068",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1168",width:"200",height:"200"},[e.createElementVNode("path",{d:"M547.968 138.88c6.656-4.672 14.08-6.976 20.48-5.056 6.08 1.792 22.848 10.752 40.192 56.128 8.576 22.4 27.264 81.536-5.632 197.504a45.44 45.44 0 0 0 42.88 57.984l217.6 3.008h0.448a53.12 53.12 0 0 1 20.096 3.328 16.256 16.256 0 0 1 5.568 3.648 14.464 14.464 0 0 1 3.264 6.4c2.176 7.808 4.608 33.984-0.256 77.248-4.672 41.984-15.936 97.408-38.784 162.368-19.136 54.336-43.52 100.48-81.472 161.792a56.384 56.384 0 0 0-1.664 2.496l-0.128 0.128-1.408 2.112a7.872 7.872 0 0 1-1.28 1.472 3.84 3.84 0 0 1-1.28 0.64 20.48 20.48 0 0 1-6.848 0.96H356.032V421.44c19.712-10.624 40.704-24.576 62.592-47.616 25.472-26.88 51.008-64.768 78.208-121.6 5.568-11.584 9.856-24.384 13.632-36.032l3.072-9.856c2.688-8.448 5.184-16.384 8.064-24.32 8.064-22.4 16.128-36.032 26.368-43.136z m120.96 27.968c-20.48-53.44-48-84.736-81.984-94.912-33.6-9.984-61.952 4.16-76.032 14.08-27.584 19.264-41.28 49.6-50.048 74.048-3.392 9.344-6.464 19.2-9.216 27.968l-2.688 8.448a227.84 227.84 0 0 1-10.432 27.904c-25.28 52.928-47.36 84.544-66.752 104.96-18.944 19.968-36.48 30.464-55.168 39.808a45.376 45.376 0 0 0-25.088 40.576l-0.064 480.64c0 24.96 20.224 45.248 45.184 45.248h423.04c21.76 0 38.144-6.912 50.048-16.96a71.808 71.808 0 0 0 14.528-16.896l0.128-0.256 0.128-0.128 0.832-0.96 1.152-1.92c39.424-63.872 66.816-114.688 88.256-175.68a810.24 810.24 0 0 0 42.048-176.64c5.12-45.632 3.776-81.664-1.6-101.376a77.952 77.952 0 0 0-45.568-52.288 116.544 116.544 0 0 0-45.44-8.64l-192.768-2.688c28.096-115.072 10.048-181.568-2.496-214.336z m-604.864 247.04a45.184 45.184 0 0 1 45.12-47.296h67.008c24.96 0 45.184 20.288 45.184 45.248v480.64c0 24.96-20.224 45.12-45.184 45.12H131.84a45.184 45.184 0 0 1-45.12-43.072l-22.656-480.64z","p-id":"1169"})],-1)]))}]]),Ns={width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:""},Ss=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("svg",Ns,o[0]||(o[0]=[e.createElementVNode("path",{"data-v-d6f79dbc":"","fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.99976 7.93206L10.0656 3.86619C10.1633 3.76856 10.3215 3.76856 10.4192 3.86619L10.7727 4.21975C10.8704 4.31738 10.8704 4.47567 10.7727 4.5733L6.35331 8.99272C6.15805 9.18798 5.84147 9.18798 5.6462 8.99272L1.22679 4.5733C1.12916 4.47567 1.12916 4.31738 1.22679 4.21975L1.58034 3.86619C1.67797 3.76856 1.83626 3.76856 1.93389 3.86619L5.99976 7.93206Z"},null,-1)]))}]]),Bs={class:"comment-common-icon"},Es=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("i",Bs,o[0]||(o[0]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:""},[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.99951 0.5C9.03708 0.5 11.4995 2.96243 11.4995 6C11.4995 9.03757 9.03708 11.5 5.99951 11.5C2.96195 11.5 0.499512 9.03757 0.499512 6C0.499512 2.96243 2.96195 0.5 5.99951 0.5ZM6.25 3.49988C6.38807 3.49988 6.5 3.61181 6.5 3.74988V5.49988H8.25C8.38807 5.49988 8.5 5.61181 8.5 5.74988V6.24988C8.5 6.38795 8.38807 6.49988 8.25 6.49988H5.75C5.61193 6.49988 5.5 6.38795 5.5 6.24988V3.74988C5.5 3.61181 5.61193 3.49988 5.75 3.49988H6.25Z"})],-1)]))}]]),Ds={class:"comment-common-icon"},_s=v({},[["render",function(t,o){return e.openBlock(),e.createElementBlock("i",Ds,o[0]||(o[0]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1320",width:"200",height:"200"},[e.createElementVNode("path",{d:"M147.264 647.296V220.928c0-49.536 40.128-89.728 89.6-89.728H793.6c49.536 0 89.728 40.192 89.728 89.728v426.368c0 49.536-40.128 89.728-89.6 89.728h-145.216a47.04 47.04 0 0 0-28.16 9.408l-194.56 145.792a3.392 3.392 0 0 1-5.12-1.984l-26.752-116.672a47.04 47.04 0 0 0-45.824-36.544H236.992a89.728 89.728 0 0 1-89.728-89.728zM236.864 64A156.928 156.928 0 0 0 80 220.928l0.064 426.368a156.928 156.928 0 0 0 156.928 156.928h94.976l23.232 101.312 0.064 0.448a70.592 70.592 0 0 0 109.696 40.832l190.208-142.592H793.6a156.928 156.928 0 0 0 156.928-156.928l-0.064-426.368A156.928 156.928 0 0 0 793.536 64H236.928z m69.44 442.496a65.344 65.344 0 1 0 0-130.752 65.344 65.344 0 0 0 0 130.752z m268.8-65.344a65.344 65.344 0 1 1-130.752 0 65.344 65.344 0 0 1 130.752 0z m138.368 65.344a65.344 65.344 0 1 0 0-130.752 65.344 65.344 0 0 0 0 130.752z","p-id":"1321"})],-1)]))}]]),Ts={class:"cv-comment-emoji"},Is={class:"face-tooltip-head select-none"},Ls=["onClick"],Fs=["src"],Os={class:"emoji-body select-none"},$s={style:{padding:"0 5px"}},zs=["onClick"],Ps={class:"emoji-btn select-none"},Ms={key:0},Hs=v(Object.assign({name:"CompInputEmoji"},{__name:"input-emoji",props:{emoji:{faceList:[],emojiList:[],allEmoji:{}},placement:"bottom"},emits:["addEmoji"],setup(t,{emit:o}){const a=t,i=e.ref(0),l=e.ref(0),n=e.ref(new Array(2)),{emojiList:r,faceList:c}=a.emoji;function h(){n.value[0]=r[0]}return(d,p)=>(e.openBlock(),e.createElementBlock("div",Ts,[e.createVNode(e.unref(k.ElPopover),{placement:t.placement,"popper-class":"emoji-popover",width:250,trigger:"click",onBeforeEnter:h},{reference:e.withCtx(()=>[e.createElementVNode("div",Ps,[d.$slots.default?e.renderSlot(d.$slots,"default",{key:1},void 0,!0):(e.openBlock(),e.createElementBlock("div",Ms,[e.createVNode(e.unref(us)),p[0]||(p[0]=e.createElementVNode("span",null,"表情",-1))]))])]),default:e.withCtx(()=>[e.createElementVNode("div",Is,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),(u,m)=>(e.openBlock(),e.createElementBlock("label",{key:m,class:e.normalizeClass(i.value==m?"active":""),onClick:f=>function(C){switch(i.value=C,C){case 0:l.value=0;break;case 1:l.value=-50,n.value[1]=r[1]}}(m)},[e.createElementVNode("img",{src:u,alt:""},null,8,Fs)],10,Ls))),128))]),e.createElementVNode("div",Os,[e.createElementVNode("div",{class:"emjio-container",style:e.normalizeStyle({transform:`translateX(${l.value}%)`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(u,m)=>(e.openBlock(),e.createElementBlock("div",{key:m,class:"emoji-wrapper"},[e.createVNode(e.unref(k.ElScrollbar),null,{default:e.withCtx(()=>[e.createElementVNode("div",$s,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u,(f,C)=>(e.openBlock(),e.createElementBlock("span",{key:C,class:"emoji-item",onClick:g=>d.$emit("addEmoji",C)},[e.createVNode(e.unref(k.ElImage),{src:f,title:String(C),class:"emoji",style:{width:"24px",height:"24px",margin:"5px"},lazy:""},null,8,["src","title"])],8,zs))),128))])]),_:2},1024)]))),128))],4)])]),_:3},8,["placement"])]))}}),[["__scopeId","data-v-2fb59975"]]),As={class:"cv-comment-editor"},js=["placeholder","innerHTML"],Rs=["src"],Us=["onClick"],Ws={key:0,class:"cv-comment-editor__action"},Ys={__name:"input-box",props:{placeholder:"",contentBtn:"",parentId:"",reply:""},emits:["hide","close"],setup(t,{expose:o,emit:a}){const i=t,l=e.ref(""),n=e.ref(),r=e.ref(!1),c=e.ref(!1),h=e.ref(),d=e.ref(!0),p=e.ref(),u=e.ref(),m=e.ref([]),f=e.ref([]),C=e.reactive({imgLength:0}),g=64,y=e.ref(),b=e.ref(!1),w=e.ref(),V=e.computed(()=>g+"px"),B=e.computed(()=>"8px 12px"),S=a,{upload:I,submit:L,focus:z}=e.inject("InjectInputBox"),ne=e.inject("InjectionEmojiApi");function ea(){L({content:i.reply?`回复 <span style="color: var(--cv-color-success-dark-2);">@${i.reply.user.username}:</span> ${l.value}`:l.value,parentId:le(i.parentId,null),reply:i.reply,files:f.value,clear:()=>{h.value&&(h.value.innerHTML="",l.value=h.value.innerHTML,r.value=!1),m.value.length=0,f.value=[],d.value=!0,S("close")}})}function Gl(E){oe(l.value)&&!C.imgLength&&(c.value=!1,S("hide",E))}function Zl(E){b.value=!0,r.value=!0,c.value=!0,e.nextTick(()=>{p.value=document.querySelector("div[id^='el-popper-container']")}),z()}function Ql(E){var N,_;y.value=(N=window.getSelection())==null?void 0:N.getRangeAt(0),(_=h.value)!=null&&_.innerHTML||(r.value=!1),b.value=!1}function Jl(E){const{innerHTML:N}=(E==null?void 0:E.target)||E;l.value=N||"",oe(l.value.replace(/ |<br>| /g,""))?d.value=!0:d.value=!1}function ta(){e.nextTick(()=>{var E;(E=h.value)==null||E.focus()})}function en(E){E.ctrlKey&&E.key=="Enter"&&(oe(l.value.replace(/ |<br>| /g,""))?k.ElMessage({message:"内容不能为空",type:"info"}):ea())}function tn(E){var F;m.value.length=0,f.value.length=0;const N=(F=u.value)==null?void 0:F.files;if(C.imgLength=le(N==null?void 0:N.length,0),N)for(let T=0;T<N.length;T++){let Z=N[T].name,ie=(_=N[T],window.URL?window.URL.createObjectURL(_):window.webkitURL?window.webkitURL.createObjectURL(_):"");f.value.push(N[T]),Kn(Z)?m.value.push(ie):k.ElMessage({type:"warn",message:"请选择图片类型文件!",duration:2500})}var _}return e.watch(()=>l.value,E=>{b.value||(n.value=E)}),e.onMounted(()=>{var E;(E=h.value)==null||E.addEventListener("keyup",N=>{const _=N.target;_.innerHTML=="<br>"&&(_.innerHTML="")})}),o({focus:()=>ta()}),(E,N)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",As,[e.createElementVNode("div",{class:e.normalizeClass(["cv-comment-editor__box",{active:r.value,"input-active":c.value}])},[e.createElementVNode("div",{ref_key:"editorRef",ref:h,class:"rich-input",contenteditable:"true",placeholder:i.placeholder,onFocus:Zl,onInput:Jl,onBlur:Ql,onKeydown:e.withKeys(en,["enter"]),innerHTML:n.value,style:e.normalizeStyle({minHeight:V.value,padding:B.value})},null,44,js),e.createElementVNode("div",{ref_key:"imageRef",ref:w,class:"image-preview-box"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(_,F)=>(e.openBlock(),e.createElementBlock("div",{key:F,class:"image-preview"},[e.createElementVNode("img",{src:_,alt:""},null,8,Rs),e.createElementVNode("div",{class:"clean-btn",onClick:T=>{var ie;return Z=F,void((ie=m==null?void 0:m.value)==null?void 0:ie.splice(Z,1));var Z}},[e.createVNode(e.unref(ps))],8,Us)]))),128))],512)],2),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[c.value?(e.openBlock(),e.createElementBlock("div",Ws,[e.createElementVNode("div",null,[e.createVNode(Hs,{emoji:e.unref(ne),onAddEmoji:N[0]||(N[0]=_=>function(F){var Z;let T=window.getSelection();T&&(T.removeAllRanges(),y.value||(ta(),y.value=T.getRangeAt(0)),y.value.deleteContents(),y.value.insertNode(y.value.createContextualFragment(F)),y.value.collapse(!1),T.addRange(y.value),l.value=((Z=h==null?void 0:h.value)==null?void 0:Z.innerHTML)||"",oe(l.value.replace(/ |<br>| /g,""))?d.value=!0:d.value=!1)}(_))},null,8,["emoji"]),e.createElementVNode("div",{class:"picture",onClick:N[1]||(N[1]=(..._)=>{var F,T;return((F=u.value)==null?void 0:F.click)&&((T=u.value)==null?void 0:T.click(..._))})},[e.createVNode(e.unref(vs)),N[2]||(N[2]=e.createElementVNode("span",null,"图片",-1)),e.createElementVNode("input",{id:"comment-upload",ref_key:"inputRef",ref:u,type:"file",multiple:"",onChange:tn},null,544)])]),e.createElementVNode("div",null,[N[3]||(N[3]=e.createElementVNode("span",{style:{"margin-right":"10px"}},[e.createTextVNode(" 文明上网理性发言,请遵守 "),e.createElementVNode("a",{href:"###",target:"_blank"},"《新闻评论服务协议》")],-1)),e.createVNode(e.unref(k.ElButton),{type:"primary",disabled:d.value,onClick:ea},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.contentBtn),1)]),_:1},8,["disabled"])])])):e.createCommentVNode("",!0)]),_:1})])),[[e.unref(k.ClickOutside),Gl,p.value]])}},zl=v(Ys,[["__scopeId","data-v-e3fd437e"]]),Xs={class:"u-fold"},qs={class:"action-box select-none"},Ks=v(Object.assign({name:"UFold"},{__name:"fold",props:{line:{type:[Number,String],default:5}},setup(t){e.useCssVars(c=>({"15491e60":a.value}));const o=t,a=e.computed(()=>{let c=Math.trunc(Number(o.line));return c>0?c:1}),i=e.ref(!0),l=e.ref(!1),n=e.ref();let r;return e.onMounted(()=>{r=new ResizeObserver(c=>{i.value&&n.value&&(l.value=n.value.offsetHeight<n.value.scrollHeight)}),r.observe(n.value)}),e.onUnmounted(()=>{r.disconnect()}),(c,h)=>(e.openBlock(),e.createElementBlock("div",Xs,[e.createElementVNode("div",{class:e.normalizeClass(["txt-box",{"over-hidden":i.value}])},[e.createElementVNode("div",{ref_key:"divBox",ref:n},[e.renderSlot(c.$slots,"default",{},void 0,!0)],512)],2),e.createElementVNode("div",qs,[l.value&&c.unfold?(e.openBlock(),e.createElementBlock("div",{key:0,class:"expand-btn",onClick:h[0]||(h[0]=d=>i.value=!i.value)},e.toDisplayString(i.value?"展开":"收起"),1)):e.createCommentVNode("",!0)])]))}}),[["__scopeId","data-v-94334818"]]),da={__name:"user-card",props:{uid:""},setup(t){const o=e.ref({}),{showInfo:a}=e.inject("InjectContentBox"),i=e.inject("InjectSlots"),l=()=>e.h("div",i.card(o.value));return(n,r)=>e.unref(i).card?(e.openBlock(),e.createBlock(e.unref(k.ElPopover),{key:0,placement:"top",width:300,"show-after":300,onBeforeEnter:r[0]||(r[0]=()=>e.unref(a)(t.uid,c=>o.value=c))},{reference:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),default:e.withCtx(()=>[e.createVNode(l)]),_:3})):e.renderSlot(n.$slots,"default",{key:1})}};function Pl(t){return!!e.getCurrentScope()&&(e.onScopeDispose(t),!0)}const Zo=typeof window<"u"&&typeof document<"u";const Gs=Object.prototype.toString,Zs=t=>Gs.call(t)==="[object Object]";function co(t){return Array.isArray(t)?t:[t]}const Qs=Zo?window:void 0,Ml=Zo?window.navigator:void 0;function Hl(...t){const o=[],a=()=>{o.forEach(h=>h()),o.length=0},i=e.computed(()=>{const h=co(e.toValue(t[0])).filter(d=>d!=null);return h.every(d=>typeof d!="string")?h:void 0}),l=(n=()=>{var h,d;return[(d=(h=i.value)==null?void 0:h.map(p=>function(u){var m;const f=e.toValue(u);return(m=f==null?void 0:f.$el)!=null?m:f}(p)))!=null?d:[Qs].filter(p=>p!=null),co(e.toValue(i.value?t[1]:t[0])),co(e.unref(i.value?t[2]:t[1])),e.toValue(i.value?t[3]:t[2])]},r=([h,d,p,u])=>{if(a(),!(h!=null&&h.length)||!(d!=null&&d.length)||!(p!=null&&p.length))return;const m=Zs(u)?{...u}:u;o.push(...h.flatMap(f=>d.flatMap(C=>p.map(g=>((y,b,w,V)=>(y.addEventListener(b,w,V),()=>y.removeEventListener(b,w,V)))(f,C,g,m)))))},c={flush:"post"},e.watch(n,r,{...c,immediate:!0}));var n,r,c;return Pl(a),()=>{l(),a()}}function Al(t){const o=function(){const a=e.shallowRef(!1),i=e.getCurrentInstance();return i&&e.onMounted(()=>{a.value=!0},i),a}();return e.computed(()=>(o.value,!!t()))}function ha(t,o={}){const{controls:a=!1,navigator:i=Ml}=o,l=Al(()=>i&&"permissions"in i),n=e.shallowRef(),r=typeof t=="string"?{name:t}:t,c=e.shallowRef(),h=()=>{var p,u;c.value=(u=(p=n.value)==null?void 0:p.state)!=null?u:"prompt"};Hl(n,"change",h,{passive:!0});const d=function(p){let u;function m(){return u||(u=p()),u}return m.reset=async()=>{const f=u;u=void 0,f&&await f},m}(async()=>{if(l.value){if(!n.value)try{n.value=await i.permissions.query(r)}catch{n.value=void 0}finally{h()}return a?e.toRaw(n.value):void 0}});return d(),a?{state:c,isSupported:l,query:d}:c}function Js(t={}){const{navigator:o=Ml,read:a=!1,source:i,copiedDuring:l=1500,legacy:n=!1}=t,r=Al(()=>o&&"clipboard"in o),c=ha("clipboard-read"),h=ha("clipboard-write"),d=e.computed(()=>r.value||n),p=e.shallowRef(""),u=e.shallowRef(!1),m=function(C,g,y={}){const{immediate:b=!0,immediateCallback:w=!1}=y,V=e.shallowRef(!1);let B=null;function S(){B&&(clearTimeout(B),B=null)}function I(){V.value=!1,S()}function L(...z){w&&C(),S(),V.value=!0,B=setTimeout(()=>{V.value=!1,B=null,C(...z)},e.toValue(g))}return b&&(V.value=!0,Zo&&L()),Pl(I),{isPending:e.shallowReadonly(V),start:L,stop:I}}(()=>u.value=!1,l,{immediate:!1});function f(C){return C==="granted"||C==="prompt"}return d.value&&a&&Hl(["copy","cut"],async function(){let C=!(r.value&&f(c.value));if(!C)try{p.value=await o.clipboard.readText()}catch{C=!0}var g,y,b;C&&(p.value=(b=(y=(g=document==null?void 0:document.getSelection)==null?void 0:g.call(document))==null?void 0:y.toString())!=null?b:"")},{passive:!0}),{isSupported:d,text:p,copied:u,copy:async function(C=e.toValue(i)){if(d.value&&C!=null){let g=!(r.value&&f(h.value));if(!g)try{await o.clipboard.writeText(C)}catch{g=!0}g&&function(y){const b=document.createElement("textarea");b.value=y??"",b.style.position="absolute",b.style.opacity="0",document.body.appendChild(b),b.select(),document.execCommand("copy"),b.remove()}(C),p.value=C,u.value=!0,m.start()}}}}const ec={class:"comment-list-actbox__right"},tc={class:"operation-warp"},oc={class:"dialog-footer"},ac={__name:"comment-operate",props:{data:{type:[Object],default:()=>({})}},setup(t){const{copy:o}=Js(),a=e.ref(!1),i=e.ref({report_type:"",report_content:""}),l=t;function n(){let r=l.data||{};a.value=!1,k.ElMessage({type:"info",message:"举报成功: "+r.id})}return(r,c)=>{const h=e.resolveComponent("el-dropdown-item"),d=e.resolveComponent("el-dropdown-menu"),p=e.resolveComponent("el-dropdown"),u=e.resolveComponent("el-radio"),m=e.resolveComponent("el-radio-group"),f=e.resolveComponent("el-form-item"),C=e.resolveComponent("el-input"),g=e.resolveComponent("el-form"),y=e.resolveComponent("el-button"),b=e.resolveComponent("el-dialog");return e.openBlock(),e.createElementBlock("div",ec,[e.createVNode(p,{trigger:"click",onCommand:c[0]||(c[0]=w=>function(V){let B=l.data||{};switch(V){case"remove":setTimeout(()=>{var S;(S=commentRef.value)==null||S.remove(B)},200);break;case"report":a.value=!0;break;case"copy":o(B.content),k.ElMessage({type:"info",message:"复制成功"})}}(w))},{dropdown:e.withCtx(()=>[e.createVNode(d,null,{default:e.withCtx(()=>[e.createVNode(h,{command:"report"},{default:e.withCtx(()=>c[5]||(c[5]=[e.createTextVNode("举报")])),_:1,__:[5]}),e.createVNode(h,{command:"remove"},{default:e.withCtx(()=>c[6]||(c[6]=[e.createTextVNode("删除")])),_:1,__:[6]}),e.createVNode(h,{divided:"",command:"copy"},{default:e.withCtx(()=>c[7]||(c[7]=[e.createTextVNode("复制")])),_:1,__:[7]})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",tc,[e.createVNode(e.unref(ks))])]),_:1}),e.createVNode(b,{title:"举报",modelValue:a.value,"onUpdate:modelValue":c[4]||(c[4]=w=>a.value=w),width:"400px",style:{width:"90%","max-width":"400px"}},{footer:e.withCtx(()=>[e.createElementVNode("span",oc,[e.createVNode(y,{onClick:c[3]||(c[3]=w=>a.value=!1)},{default:e.withCtx(()=>c[13]||(c[13]=[e.createTextVNode("取消")])),_:1,__:[13]}),e.createVNode(y,{type:"primary",onClick:n},{default:e.withCtx(()=>c[14]||(c[14]=[e.createTextVNode("提交")])),_:1,__:[14]})])]),default:e.withCtx(()=>[e.createVNode(g,{"label-position":"top"},{default:e.withCtx(()=>[e.createVNode(f,{label:"您为什么要举报此信息?"},{default:e.withCtx(()=>[e.createVNode(m,{modelValue:i.value.report_type,"onUpdate:modelValue":c[1]||(c[1]=w=>i.value.report_type=w)},{default:e.withCtx(()=>[e.createVNode(u,{value:"色情淫秽"},{default:e.withCtx(()=>c[8]||(c[8]=[e.createTextVNode("色情淫秽")])),_:1,__:[8]}),e.createVNode(u,{value:"骚扰谩骂"},{default:e.withCtx(()=>c[9]||(c[9]=[e.createTextVNode("骚扰谩骂")])),_:1,__:[9]}),e.createVNode(u,{value:"广告欺诈"},{default:e.withCtx(()=>c[10]||(c[10]=[e.createTextVNode("广告欺诈")])),_:1,__:[10]}),e.createVNode(u,{value:"反动"},{default:e.withCtx(()=>c[11]||(c[11]=[e.createTextVNode("反动")])),_:1,__:[11]}),e.createVNode(u,{value:"其他"},{default:e.withCtx(()=>c[12]||(c[12]=[e.createTextVNode("其他")])),_:1,__:[12]})]),_:1},8,["modelValue"])]),_:1}),e.createVNode(f,{label:"举报说明(可选):"},{default:e.withCtx(()=>[e.createVNode(C,{type:"textarea",modelValue:i.value.report_content,"onUpdate:modelValue":c[2]||(c[2]=w=>i.value.report_content=w),maxlength:"200",placeholder:"描述恶意行为",rows:"3"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1},8,["modelValue"])])}}},lc={class:"comment-sub"},nc=["href"],ic={class:"comment-primary"},rc={class:"comment-main"},sc={key:1,class:"user-info"},cc=["href"],dc={class:"username"},hc={class:"name",style:{"max-width":"10em"}},pc={blank:"true",class:"rank"},mc=["innerHTML"],uc={class:"address",style:{color:"#939393","font-size":"12px"}},gc={class:"time"},fc={class:"content"},Cc=["innerHTML"],vc={class:"imgbox",style:{display:"flex"}},yc={class:"comment-list-actbox select-none"},kc={class:"comment-list-actbox__left"},bc={key:2},wc={class:"comment-list-actbox__right"},Vc={key:2},xc={__name:"content-box",props:{reply:{type:[Boolean],default:!1},data:{type:[Object],default:()=>({})},id:{type:[String],default:""}},setup(t){const o=t,a=e.reactive({active:!1}),i=e.ref(),l=e.ref(),n=e.computed(()=>{let y=o.data.contentImg;return oe(y)?[]:y==null?void 0:y.split("||")}),{allEmoji:r}=e.inject("InjectionEmojiApi"),{like:c,user:h,relativeTime:d}=e.inject("InjectContentBox");function p(){a.active=!a.active,a.active&&e.nextTick(()=>{var y;(y=i.value)==null||y.focus()})}function u(y){var w;const b=y.target;(w=l.value)!=null&&w.contains(b)||(a.active=!1)}const m=e.inject("InjectSlots"),f=()=>e.h("div",m.info(o.data)),C=e.computed(()=>((y,b)=>b.replace(/\[.+?\]/g,w=>{const V=y[w];return V?['<img src="',V,'" width="20" height="20" alt="',w,'" title="',w,'" style="margin: 0 1px; vertical-align: text-bottom"',"/>"].join(""):w}))(r,o.data.content)),g=y=>{switch(y){case 1:return'<svg viewBox="0 0 1682 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="831"><path d="M219.428571 73.142857h1243.428572a146.285714 146.285714 0 0 1 146.285714 146.285714v585.142858a146.285714 146.285714 0 0 1-146.285714 146.285714H219.428571a146.285714 146.285714 0 0 1-146.285714-146.285714V219.428571a146.285714 146.285714 0 0 1 146.285714-146.285714z" fill="#8CDBF4" p-id="832"></path><path d="M219.428571 292.571429h146.285715v512H219.428571z m365.714286 146.285714h146.285714l146.285715 365.714286h-146.285715z" fill="#FFFFFF" p-id="833"></path><path d="M1024 438.857143h-146.285714l-146.285715 365.714286h146.285715zM219.428571 658.285714h365.714286v146.285715H219.428571z m950.857143-365.714285l73.142857-73.142858v146.285715h-73.142857z m73.142857-73.142858h146.285715v146.285715h-146.285715z m0 146.285715h146.285715v438.857143h-146.285715z" fill="#FFFFFF"></path></svg>';case 2:return'<svg viewBox="0 0 1682 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="765"><path d="M219.428571 73.142857h1243.428572a146.285714 146.285714 0 0 1 146.285714 146.285714v585.142858a146.285714 146.285714 0 0 1-146.285714 146.285714H219.428571a146.285714 146.285714 0 0 1-146.285714-146.285714V219.428571a146.285714 146.285714 0 0 1 146.285714-146.285714z" fill="#6ECEFF" p-id="766"></path><path d="M219.428571 292.571429h146.285715v512H219.428571z m365.714286 146.285714h146.285714l146.285715 365.714286h-146.285715z" fill="#FFFFFF" p-id="767"></path><path d="M1024 438.857143h-146.285714l-146.285715 365.714286h146.285715zM219.428571 658.285714h365.714286v146.285715H219.428571z m877.714286-438.857143h365.714286v146.285715h-365.714286z m219.428572 146.285715h146.285714v146.285714h-146.285714z m-219.428572 292.571428V512h146.285714v146.285714z" fill="#FFFFFF" p-id="768"></path><path d="M1097.142857 585.142857V438.857143h365.714286v146.285714z m0 73.142857h365.714286v146.285715h-365.714286z" fill="#FFFFFF"></path></svg>';case 3:return'<svg viewBox="0 0 1682 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="799"><path d="M219.428571 73.142857h1243.428572a146.285714 146.285714 0 0 1 146.285714 146.285714v585.142858a146.285714 146.285714 0 0 1-146.285714 146.285714H219.428571a146.285714 146.285714 0 0 1-146.285714-146.285714V219.428571a146.285714 146.285714 0 0 1 146.285714-146.285714z" fill="#599DFF" p-id="800"></path><path d="M219.428571 292.571429h146.285715v512H219.428571z m365.714286 146.285714h146.285714l146.285715 365.714286h-146.285715z" fill="#FFFFFF" p-id="801"></path><path d="M1024 438.857143h-146.285714l-146.285715 365.714286h146.285715zM219.428571 658.285714h365.714286v146.285715H219.428571z m877.714286-438.857143h365.714286v146.285715h-365.714286z m219.428572 146.285715h146.285714v73.142857h-146.285714z m0 219.428571h146.285714v73.142857h-146.285714z m-146.285715-146.285714h292.571429v146.285714h-292.571429z m-73.142857 219.428571h365.714286v146.285715h-365.714286z" fill="#FFFFFF"></path></svg>';case 4:return'<svg viewBox="0 0 1682 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="815"><path d="M219.428571 73.142857h1243.428572a146.285714 146.285714 0 0 1 146.285714 146.285714v585.142858a146.285714 146.285714 0 0 1-146.285714 146.285714H219.428571a146.285714 146.285714 0 0 1-146.285714-146.285714V219.428571a146.285714 146.285714 0 0 1 146.285714-146.285714z" fill="#34D19B" p-id="816"></path><path d="M219.428571 292.571429h146.285715v512H219.428571z m365.714286 146.285714h146.285714l146.285715 365.714286h-146.285715z" fill="#FFFFFF" p-id="817"></path><path d="M1024 438.857143h-146.285714l-146.285715 365.714286h146.285715zM219.428571 658.285714h365.714286v146.285715H219.428571z m975.213715-365.714285L1243.428571 219.428571v219.428572h-146.285714zM1097.142857 438.857143h146.285714v292.571428h-146.285714z m146.285714 146.285714h73.142858v146.285714h-73.142858z m0-365.714286h73.142858v146.285715h-73.142858z m73.142858 0h146.285714v585.142858h-146.285714z" fill="#FFFFFF"></path></svg>';case 5:return'<svg viewBox="0 0 1682 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="782"><path d="M219.428571 73.142857h1243.428572a146.285714 146.285714 0 0 1 146.285714 146.285714v585.142858a146.285714 146.285714 0 0 1-146.285714 146.285714H219.428571a146.285714 146.285714 0 0 1-146.285714-146.285714V219.428571a146.285714 146.285714 0 0 1 146.285714-146.285714z" fill="#FFA000" p-id="783"></path><path d="M219.428571 292.571429h146.285715v512H219.428571z m365.714286 146.285714h146.285714l146.285715 365.714286h-146.285715z" fill="#FFFFFF" p-id="784"></path><path d="M1024 438.857143h-146.285714l-146.285715 365.714286h146.285715zM219.428571 658.285714h365.714286v146.285715H219.428571z m1097.142858-73.142857h146.285714v219.428572h-146.285714z m-219.428572-365.714286h365.714286v146.285715h-365.714286z m0 438.857143h219.428572v146.285715h-219.428572z m73.142857-219.428571h219.428572v146.285714h-219.428572z" fill="#FFFFFF" p-id="785"></path><path d="M1316.571429 438.857143h146.285714v146.285714h-146.285714z m-219.428572-73.142857h146.285714v219.428571h-146.285714z" fill="#FFFFFF"></path></svg>';case 6:return'<svg viewBox="0 0 1682 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="748"><path d="M219.428571 73.142857h1243.428572a146.285714 146.285714 0 0 1 146.285714 146.285714v585.142858a146.285714 146.285714 0 0 1-146.285714 146.285714H219.428571a146.285714 146.285714 0 0 1-146.285714-146.285714V219.428571a146.285714 146.285714 0 0 1 146.285714-146.285714z" fill="#F36262" p-id="749"></path><path d="M219.428571 292.571429h146.285715v512H219.428571z m365.714286 146.285714h146.285714l146.285715 365.714286h-146.285715z" fill="#FFFFFF" p-id="750"></path><path d="M1024 438.857143h-146.285714l-146.285715 365.714286h146.285715zM219.428571 658.285714h365.714286v146.285715H219.428571z m1097.142858-146.285714h146.285714v292.571429h-146.285714z m-73.142858-292.571429h146.285715v146.285715h-146.285715z m-146.285714 146.285715h146.285714v438.857143h-146.285714z" fill="#FFFFFF" p-id="751"></path><path d="M1243.428571 438.857143h219.428572v146.285714h-219.428572z m-48.786285-170.642286L1243.428571 219.428571v146.285715h-146.285714zM1243.428571 658.285714h146.285715v146.285715h-146.285715z" fill="#FFFFFF"></path></svg>';default:return""}};return(y,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["comment",{reply:o.reply}])},[e.createElementVNode("div",lc,[e.createVNode(da,{uid:e.unref(Q)(t.data.uid)},{default:e.withCtx(()=>[e.createElementVNode("a",{href:t.data.user.homeLink,target:"_blank",class:"no-underline",style:{display:"block"}},[e.createVNode(e.unref(k.ElAvatar),{style:{"margin-top":"5px"},size:40,fit:"cover",src:t.data.user.avatar},{default:e.withCtx(()=>b[2]||(b[2]=[e.createElementVNode("img",{src:"https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png"},null,-1)])),_:1,__:[2]},8,["src"])],8,nc)]),_:1},8,["uid"])]),e.createElementVNode("div",ic,[e.createElementVNode("div",rc,[e.unref(m).info?(e.openBlock(),e.createBlock(f,{key:0})):(e.openBlock(),e.createElementBlock("div",sc,[e.createVNode(da,{uid:e.unref(Q)(t.data.uid)},{default:e.withCtx(()=>[e.createElementVNode("a",{href:t.data.user.homeLink,target:"_blank",class:"no-underline",style:{display:"block"}},[e.createElementVNode("div",dc,[e.createElementVNode("span",hc,e.toDisplayString(t.data.user.username),1),e.createElementVNode("span",pc,[e.createElementVNode("i",{class:"comment-common-icon",style:{"font-size":"24px"},innerHTML:g(t.data.user.level)},null,8,mc)])])],8,cc)]),_:1},8,["uid"]),e.createElementVNode("span",uc," "+e.toDisplayString(t.data.address),1),e.createElementVNode("time",gc,e.toDisplayString(e.unref(d)?e.unref(qn)(t.data.createTime):t.data.createTime),1)])),e.createElementVNode("div",fc,[e.createVNode(Ks,{unfold:""},{default:e.withCtx(()=>[e.createElementVNode("div",{innerHTML:C.value},null,8,Cc),e.createElementVNode("div",vc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(w,V)=>(e.openBlock(),e.createBlock(e.unref(k.ElImage),{key:V,src:w,style:{height:"72px",padding:"8px 4px"},lazy:"","preview-src-list":n.value,"initial-index":V},null,8,["src","preview-src-list","initial-index"]))),128))])]),_:1})]),e.createElementVNode("div",yc,[e.createElementVNode("div",kc,[e.createElementVNode("div",{"data-tip":"点赞",class:"item",onClick:b[0]||(b[0]=w=>e.unref(c)(e.unref(Q)(t.data.id)))},[e.unref(h).likeIds.map(String).indexOf(e.unref(Q)(t.data.id))==-1?(e.openBlock(),e.createBlock(e.unref(xs),{key:0})):(e.openBlock(),e.createBlock(e.unref(ws),{key:1})),t.data.likes!=0?(e.openBlock(),e.createElementBlock("span",bc,e.toDisplayString(t.data.likes),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{"data-tip":"回复",ref_key:"btnRef",ref:l,class:e.normalizeClass(["item",{active:a.active}]),onClick:p},[e.createVNode(e.unref(_s)),e.createElementVNode("span",null,e.toDisplayString(a.active?"取消回复":"回复"),1)],2)]),e.createElementVNode("div",wc,[e.renderSlot(y.$slots,"operate",{},()=>[e.createVNode(ac,{data:o.data},null,8,["data"])],!0)])]),a.active?(e.openBlock(),e.createElementBlock("div",Vc,[e.createVNode(zl,{ref_key:"commentRef",ref:i,"parent-id":e.unref(Q)(t.id),placeholder:`回复 @${t.data.user.username}...`,reply:t.data,"content-btn":"发布",style:{"margin-top":"12px"},onHide:u,onClose:b[1]||(b[1]=w=>a.active=!1)},null,8,["parent-id","placeholder","reply"])])):e.createCommentVNode("",!0)]),e.renderSlot(y.$slots,"default",{},void 0,!0)])],2))}},jl=v(xc,[["__scopeId","data-v-cfe79df7"]]),Nc={key:0,class:"reply-box"},Sc={class:"reply-list"},Bc={key:0,class:"fetch-more"},Ec={key:0},Dc={key:1},_c={key:0},Tc={key:1,class:"fetch-more"},Ic={__name:"reply-box",props:{data:{type:[Array,Object],default:()=>null},id:{type:[String],default:""}},setup(t){const o=t,a=e.reactive({loading:!1,over:!1,pageNum:1,pageSize:5}),{replyPage:i,replyShowSize:l,comments:n,page:r}=e.inject("InjectReplyBox"),c=e.computed(()=>{let m={total:0,length:0,list:[]};if(o.data){let f=o.data.list.length;m={total:o.data.total,length:f,list:o.data.list}}if(!a.over){let f=m.list.slice(0,l);m.list=f}return r&&(m.list=m.list.slice(0,5)),m}),h=()=>{a.over=!0},d=m=>{n.value.forEach(f=>{f.id==o.id&&f.reply&&(f.reply=m)})},p=m=>{a.pageNum=m,i(o.id,m,a.pageSize,f=>d(f))},u=m=>{a.pageSize=m,i(o.id,a.pageNum,m,f=>d(f))};return(m,f)=>c.value.length>0?(e.openBlock(),e.createElementBlock("div",Nc,[e.createElementVNode("div",Sc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.list,(C,g)=>(e.openBlock(),e.createBlock(jl,{id:t.id,key:g,data:C,reply:""},null,8,["id","data"]))),128)),c.value.length>e.unref(l)?(e.openBlock(),e.createElementBlock("div",Bc,[a.loading?(e.openBlock(),e.createElementBlock("span",Ec,"加载中...")):(e.openBlock(),e.createElementBlock("div",Dc,[a.over?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",_c,[e.createTextVNode(" 共"+e.toDisplayString(c.value.total)+"条回复, ",1),e.createElementVNode("span",{class:"fetch-more-comment select-none",onClick:h},[f[0]||(f[0]=e.createTextVNode(" 点击查看 ")),e.createVNode(e.unref(Ss))])]))]))])):e.createCommentVNode("",!0),a.over&&e.unref(r)?(e.openBlock(),e.createElementBlock("div",Tc,[e.createVNode(e.unref(k.ElPagination),{small:"","hide-on-single-page":"",layout:"total, prev, pager, next",total:c.value.total,"page-size":a.pageSize,onCurrentChange:p,onSizeChange:u},null,8,["total","page-size"])])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)}},Lc=v(Ic,[["__scopeId","data-v-16e0a50b"]]),Fc={key:0,class:"comment-list"},Oc={__name:"comment-list",props:{data:{type:[Array,Object],default:()=>[]},total:{type:[Number],default:0},showSize:{type:[Number],default:0}},setup:t=>(o,a)=>t.data?(e.openBlock(),e.createElementBlock("div",Fc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data,(i,l)=>(e.openBlock(),e.createBlock(jl,{id:e.unref(Q)(i.id),key:l,data:i},{default:e.withCtx(()=>[e.createVNode(Lc,{id:e.unref(Q)(i.id),data:i.reply},null,8,["id","data"])]),_:2},1032,["id","data"]))),128))])):e.createCommentVNode("",!0)},$c={class:"cv-comment-base"},zc={class:"cv-comment-form"},Pc={class:"cv-comment-form__content"},Mc={class:"cv-comment-form__avatar"},Hc={class:"cv-comment-list-wrapper"},Ht=Object.assign({name:"cvCommentBase"},{__name:"comment",props:{config:{},page:!1,upload:!1,relativeTime:!1},emits:["submit","like","replyPage","showInfo","focus"],setup(t,{expose:o,emit:a}){const i=t,{user:l,comments:n,showSize:r,replyShowSize:c,total:h}=e.toRefs(i.config),d=a,p={upload:i.upload,submit:({content:m,parentId:f,reply:C,files:g,clear:y})=>{d("submit",{content:m,parentId:f,reply:C,files:g,finish:b=>{if(y(),f){let w=n.value.find(V=>V.id==f);if(w){let V=w.reply;V?(V.list.unshift(b),V.total++):w.reply={total:1,list:[b]}}}else n.value.unshift(b)}})},focus:()=>d("focus")};e.provide("InjectInputBox",p);const u=(m,f)=>{let C=null;n.value.forEach(g=>{var y;C=g.id==m?g:(y=g.reply)==null?void 0:y.list.find(b=>b.id==m),C&&(C.likes+=f)})};return e.provide("InjectContentBox",{user:l,like:m=>{const f=i.config.user.likeIds;d("like",m,()=>{if(f.findIndex(C=>C==m)==-1)f.push(m),u(m,1);else{let C=f.findIndex(g=>g==m);C!=-1&&(f.splice(C,1),u(m,-1))}})},relativeTime:le(i.relativeTime,!1),showInfo:(m,f)=>d("showInfo",m,f)}),e.provide("InjectReplyBox",{page:i.page,replyPage:(m,f,C,g)=>{d("replyPage",{parentId:m,pageNum:f,pageSize:C,finish:g})},replyShowSize:le(c,3),comments:n}),e.provide("InjectionEmojiApi",i.config.emoji),e.provide("InjectSlots",e.useSlots()),o({remove:m=>{const{parentId:f,id:C}=m;if(f){let g=n.value.find(b=>b.id==f),y=g==null?void 0:g.reply;if(y){let b=y.list.findIndex(w=>w.id==C);b!=-1&&(y.list.splice(b,1),y.total--)}}else{let g=n.value.findIndex(y=>y.id==C);g!=-1&&n.value.splice(g,1)}}}),(m,f)=>{const C=e.resolveComponent("el-avatar");return e.openBlock(),e.createElementBlock("div",$c,[e.createElementVNode("div",zc,[f[1]||(f[1]=e.createElementVNode("div",{class:"cv-comment-form__header"},[e.createElementVNode("span",{class:"cv-comment-form__hdtitle"},"评论")],-1)),e.createElementVNode("div",Pc,[e.createElementVNode("div",Mc,[e.createVNode(C,{size:40,src:t.config.user.avatar},{default:e.withCtx(()=>f[0]||(f[0]=[e.createElementVNode("img",{src:"https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png"},null,-1)])),_:1,__:[0]},8,["src"])]),e.createVNode(zl,{placeholder:"输入评论(Enter换行,Ctrl + Enter发送)","content-btn":"发表评论"})])]),e.renderSlot(m.$slots,"default",{},()=>[f[2]||(f[2]=e.createElementVNode("div",{class:"title"},"全部评论",-1))]),e.createElementVNode("div",Hc,[e.createVNode(Oc,{data:e.unref(n),total:e.unref(h),"show-size":e.unref(le)(e.unref(r),5)},null,8,["data","total","show-size"])])])}}}),Ac={class:"comment-scroll"},jc=["infinite-scroll-disabled"],Rc={class:"scroll-btn"},Uc={key:1},Wc={key:2},At=Object.assign({name:"cvCommentScroll"},{__name:"comment-scroll",props:{disable:{type:[Boolean],default:!1},show:{type:[Boolean],default:!1}},emits:["more"],setup(t,{emit:o}){const a=t,i=e.ref(!1),l=e.ref(!1),n=o,r=e.computed(()=>l.value&&a.disable),c=e.computed(()=>!l.value||i.value||r.value),h=Dl(()=>{n("more"),i.value=!1},500),d=()=>{i.value=!0,h()};return(p,u)=>{const m=e.resolveComponent("el-link"),f=e.resolveDirective("infinite-scroll");return e.openBlock(),e.createElementBlock("div",Ac,[e.withDirectives((e.openBlock(),e.createElementBlock("div",{"infinite-scroll-disabled":c.value,"infinite-scroll-distance":"2"},[e.renderSlot(p.$slots,"default"),e.createElementVNode("div",Rc,[l.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(m,{key:0,type:"primary",underline:!1,onClick:u[0]||(u[0]=C=>l.value=!l.value)},{default:e.withCtx(()=>u[1]||(u[1]=[e.createTextVNode("加载更多")])),_:1,__:[1]})),i.value?(e.openBlock(),e.createElementBlock("p",Uc,"加载中...")):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("p",Wc,"没有更多了")):e.createCommentVNode("",!0)])],8,jc)),[[f,d]])])}}}),Yc={class:"cv-comment-nav-wrap"},Xc={class:"cv-comment-nav__sort"},jt=Object.assign({name:"cvCommentNav"},{__name:"comment-nav",props:{modelValue:!1},emits:["update:modelValue","sorted"],setup(t,{emit:o}){const a=t,i=o,l=e.computed({get:()=>a.modelValue,set(n){i("update:modelValue",n),i("sorted",n)}});return(n,r)=>(e.openBlock(),e.createElementBlock("div",Yc,[r[4]||(r[4]=e.createElementVNode("span",{class:"cv-comment-nav__title"},"全部评论",-1)),e.createElementVNode("div",Xc,[e.createElementVNode("div",{class:e.normalizeClass(["item select-none",{active:l.value}]),onClick:r[0]||(r[0]=c=>l.value=!0)},[e.createVNode(e.unref(Es)),r[2]||(r[2]=e.createTextVNode(" 最新 "))],2),e.createElementVNode("div",{class:e.normalizeClass(["item select-none",{active:!l.value}]),onClick:r[1]||(r[1]=c=>l.value=!1)},[e.createVNode(e.unref(fs)),r[3]||(r[3]=e.createTextVNode(" 最热 "))],2)])]))}});Ht.install=function(t){t.component(Ht.name,Ht)},At.install=function(t){t.component(At.name,At)},jt.install=function(t){t.component(jt.name,jt)};const qc={name:"cvSvgs",props:{...k.ElIcon.prop,type:{type:[String],default:""},size:{type:[String,Number],default:12},name:{type:[String],default:""}},data:()=>({}),computed:{svgType(){return"svg"+this.type},style(){return{fontSize:isNaN(Number(this.size))?this.size+"px":this.size,color:props.color}}},created(){},methods:{}},Kc={key:0,"aria-hidden":"true"},Gc=["xlink:href"],Rt=v(qc,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-icon");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.svgType)))]),a.name?(e.openBlock(),e.createElementBlock("svg",Kc,[e.createElementVNode("use",{"xlink:href":a.name},null,8,Gc)])):e.createCommentVNode("",!0)]),_:3},16)}]]),Zc={name:"cvIcons",props:{...k.ElIcon.prop,type:{type:[String],default:""},size:{type:[String,Number],default:12},name:{type:[String],default:""}},data:()=>({}),computed:{style(){return{fontSize:isNaN(Number(this.size))?this.size+"px":this.size,color:props.color}}},created(){},methods:{}},Qc={key:0,"aria-hidden":"true"},Jc=["xlink:href"],Ut=v(Zc,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("el-icon");return e.openBlock(),e.createBlock(r,e.normalizeProps(e.guardReactiveProps(t.$props)),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.type)))]),a.name?(e.openBlock(),e.createElementBlock("svg",Qc,[e.createElementVNode("use",{"xlink:href":a.name},null,8,Jc)])):e.createCommentVNode("",!0)]),_:3},16)}]]);Ut.install=function(t){t.component(Ut.name,Ut)},Rt.install=function(t){t.component(Rt.name,Rt)};const ed={class:"u-emoji"},td={class:"face-tooltip-head select-none"},od=["onClick"],ad=["src"],ld={class:"emoji-body select-none"},nd={style:{padding:"0 5px"}},id=["onClick"],rd={class:"emoji-btn select-none"},sd={key:0},cd=v(Object.assign({name:"cvEmoji"},{__name:"emoji",props:{emoji:{faceList:[],emojiList:[],allEmoji:{}},placement:"bottom"},emits:["addEmoji"],setup(t,{emit:o}){const a=t,i=e.ref(0),l=e.ref(0),n=e.ref(new Array(2)),{emojiList:r,faceList:c}=a.emoji;function h(){n.value[0]=r[0]}return(d,p)=>(e.openBlock(),e.createElementBlock("div",ed,[e.createVNode(e.unref(k.ElPopover),{placement:t.placement,"popper-class":"emoji-popover",width:250,trigger:"click",onBeforeEnter:h},{reference:e.withCtx(()=>[e.createElementVNode("div",rd,[d.$slots.default?e.renderSlot(d.$slots,"default",{key:1},void 0,!0):(e.openBlock(),e.createElementBlock("div",sd,p[0]||(p[0]=[e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"icon"},[e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.00002 0.666504C12.0501 0.666504 15.3334 3.94975 15.3334 7.99984C15.3334 12.0499 12.0501 15.3332 8.00002 15.3332C3.94993 15.3332 0.666687 12.0499 0.666687 7.99984C0.666687 3.94975 3.94993 0.666504 8.00002 0.666504ZM8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2ZM10.6667 5.66667V7.66667H9.33333V5.66667H10.6667ZM6.66667 5.66667V7.66667H5.33333V5.66667H6.66667ZM10.0767 9.33333H11.0495C11.1804 9.33333 11.2866 9.43951 11.2866 9.57048C11.2866 9.60754 11.2779 9.64409 11.2612 9.67718L11.244 9.71053C10.6294 10.8739 9.40726 11.6667 7.99998 11.6667C6.61523 11.6667 5.40977 10.8991 4.7859 9.76612L4.73786 9.67593C4.67845 9.56052 4.72385 9.4188 4.83926 9.35939C4.87253 9.34226 4.90941 9.33333 4.94683 9.33333H5.92347C6.02396 9.33332 6.11908 9.37865 6.18238 9.4567C6.26207 9.55496 6.32833 9.62955 6.38117 9.68046C6.80074 10.0847 7.37133 10.3333 7.99998 10.3333C8.63289 10.3333 9.20694 10.0814 9.62728 9.67224C9.67791 9.62296 9.74135 9.55121 9.8176 9.45698C9.88089 9.37877 9.97611 9.33333 10.0767 9.33333Z"})],-1),e.createElementVNode("span",null,"表情",-1)])))])]),default:e.withCtx(()=>[e.createElementVNode("div",td,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),(u,m)=>(e.openBlock(),e.createElementBlock("label",{key:m,class:e.normalizeClass(i.value==m?"active":""),onClick:f=>function(C){switch(i.value=C,C){case 0:l.value=0;break;case 1:l.value=-50,n.value[1]=r[1]}}(m)},[e.createElementVNode("img",{src:u,alt:""},null,8,ad)],10,od))),128))]),e.createElementVNode("div",ld,[e.createElementVNode("div",{class:"emjio-container",style:e.normalizeStyle({transform:`translateX(${l.value}%)`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(u,m)=>(e.openBlock(),e.createElementBlock("div",{key:m,class:"emoji-wrapper"},[e.createVNode(e.unref(k.ElScrollbar),null,{default:e.withCtx(()=>[e.createElementVNode("div",nd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u,(f,C)=>(e.openBlock(),e.createElementBlock("span",{key:C,class:"emoji-item",onClick:g=>d.$emit("addEmoji",C)},[e.createVNode(e.unref(k.ElImage),{src:f,title:String(C),class:"emoji",style:{width:"24px",height:"24px",margin:"5px"},lazy:""},null,8,["src","title"])],8,id))),128))])]),_:2},1024)]))),128))],4)])]),_:3},8,["placement"])]))}}),[["__scopeId","data-v-da53b6ed"]]),dd={class:"cv-chat-message"},hd={class:"chat-list"},pd={class:"content"},md={key:0,class:"username"},ud=["innerHTML"],gd={__name:"message",props:{data:{type:[Array],default:()=>[]},userId:{type:[Number],default:0}},setup(t,{expose:o}){const{allEmoji:a}=e.inject("InjectionEmojiApi"),i=e.ref();o({scroll:()=>{e.nextTick(()=>{const n=document.querySelector(".chat-item:last-child");i.value.setScrollTop(n.offsetTop)})}});const l=(n,r)=>r=r.replace(/\[.+?\]/g,c=>{const h=n[c];return h?['<img src="',h,'" width="20" height="20" alt="',c,'" title="',c,'" style="margin: 0 1px; vertical-align: text-bottom"',"/>"].join(""):c});return(n,r)=>(e.openBlock(),e.createElementBlock("div",dd,[e.createVNode(e.unref(k.ElScrollbar),{ref_key:"scrollbarRef",ref:i},{default:e.withCtx(()=>[e.createElementVNode("div",hd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data,(c,h)=>(e.openBlock(),e.createElementBlock("div",{key:h,class:e.normalizeClass([{self:t.userId==c.id},"chat-item"])},[e.createElementVNode("div",null,[e.createVNode(e.unref(k.ElAvatar),null,{default:e.withCtx(()=>r[0]||(r[0]=[e.createElementVNode("img",{src:"https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png"},null,-1)])),_:1,__:[0]})]),e.createElementVNode("div",pd,[t.userId!=c.id?(e.openBlock(),e.createElementBlock("div",md,e.toDisplayString(c.username),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"card-box",innerHTML:l(e.unref(a),c.content)},null,8,ud)]),r[1]||(r[1]=e.createElementVNode("div",{class:"date"},null,-1))],2))),128))])]),_:1},512)]))}},fd={class:"cv-chat-wrap"},Cd={class:"header"},vd={id:"chat-footer",class:"footer"},Wt=Object.assign({name:"cvChat"},{__name:"chat",props:{data:{type:[Array],default:()=>[]},userId:{type:[Number],default:0},emoji:{type:[Object],default:()=>({})}},emits:["submit"],setup(t,{emit:o}){const a=t,i=e.ref(!1),l=e.ref(""),n=e.ref(),{data:r}=a,c=o,h=m=>{const{ctrlKey:f,key:C}=m;f&&C=="Enter"&&p()},d=()=>{l.value="",n.value.scroll()},p=()=>{let m=l.value;m.trim()?(m=m.replace(/\n/g,"<br/>"),c("submit",{clear:d,content:m})):k.ElMessage({type:"error",message:"内容不能为空"})},u=m=>{let f=document.getElementById("emojiInput"),C=f.selectionStart,g=f.selectionEnd,y=f.value;if(C===null||g===null)return;let b=y.substring(0,C)+m+y.substring(g);f.value=b,f.focus(),f.selectionStart=C+m.length,f.selectionEnd=C+m.length,l.value=b};return e.provide("InjectionEmojiApi",a.emoji),(m,f)=>{const C=e.resolveComponent("cvIcons");return e.openBlock(),e.createElementBlock("div",fd,[e.createElementVNode("div",{class:e.normalizeClass([{active:i.value},"chat-container translate"])},[e.createElementVNode("div",Cd,[e.createVNode(C,{size:"32"},{default:e.withCtx(()=>f[2]||(f[2]=[e.createElementVNode("svg",{viewBox:"0 0 1318 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1318.502489 432.779052c0-231.790522-209.29842-419.704826-467.458992-419.704826s-467.56979 188.357498-467.56979 419.704826 209.409219 419.704826 467.56979 419.704826a512.110799 512.110799 0 0 0 183.482363-33.239559l93.292361 93.292361a25.816057 25.816057 0 0 0 44.319412-19.168145L1165.822116 742.350141C1259.336074 665.56676 1318.502489 555.433023 1318.502489 432.779052z",fill:"#612273","p-id":"10993"}),e.createElementVNode("path",{d:"M1034.304263 745.784895a509.673231 509.673231 0 0 1-183.482363 33.239559c-244.532352 0-445.077689-168.524562-465.353819-383.25211-1.107985 12.07704-1.883575 24.264878-1.883575 36.563514 0 231.790522 209.409219 419.704826 467.56979 419.704826a512.110799 512.110799 0 0 0 183.482363-33.239559l93.292361 93.292361a25.816057 25.816057 0 0 0 44.319411-19.168145 25.262064 25.262064 0 0 0-7.5343-17.284571zM1165.822116 669.223112l2.769964 70.689461C1260.44406 663.239991 1318.502489 553.992642 1318.502489 432.779052a366.632331 366.632331 0 0 0-1.883575-36.785111 403.971435 403.971435 0 0 1-150.796798 273.229171z",fill:"#612273",opacity:".2","p-id":"10994"}),e.createElementVNode("path",{d:"M383.25211 432.779052a383.141311 383.141311 0 0 1 41.881844-172.956503c-12.298637-0.997187-24.81887-1.661978-37.449903-1.661978C173.510496 258.160571 0 413.943302 0 606.178749c0 101.713049 48.97295 193.011037 126.421121 256.609392l-5.761524 148.470028a12.187838 12.187838 0 0 0 20.830124 9.08548l94.06795-93.957153A425.577148 425.577148 0 0 0 387.79485 954.196927a404.636226 404.636226 0 0 0 300.37481-128.304696c-177.831638-59.388011-304.91755-212.733175-304.91755-393.113179z",fill:"#EB3D72","p-id":"10995"}),e.createElementVNode("path",{d:"M342.256654 391.672798c0 117.557239 53.958883 223.59143 140.714132 299.71002a391.008007 391.008007 0 0 1-99.718676-258.603766 383.141311 383.141311 0 0 1 41.881844-172.956503c-12.298637-0.997187-24.81887-1.661978-37.449903-1.661978-7.091106 0-14.071413 0-21.05172 0.553993a375.939407 375.939407 0 0 0-24.375677 132.958234zM630.111231 802.181346a407.627786 407.627786 0 0 1-283.533434 110.798528 424.136767 424.136767 0 0 1-152.12638-27.699632l-71.686647 71.686648-2.105173 54.291279a12.187838 12.187838 0 0 0 20.830124 9.08548l94.06795-93.957153A425.577148 425.577148 0 0 0 387.79485 954.196927a404.636226 404.636226 0 0 0 300.37481-128.304696 486.294741 486.294741 0 0 1-58.058429-23.710885zM85.425665 821.792686l-5.761523-4.985934c1.883575 2.215971 3.656351 4.431941 5.650725 6.647911z",fill:"#EB3D72",opacity:".5","p-id":"10996"}),e.createElementVNode("path",{d:"M833.426531 332.395585c64.263147-10.193465 64.041549-66.479117 62.601169-75.342999s-15.400995-54.291279-59.942004-47.200173S799.078987 254.836615 799.078987 254.836615a28.475222 28.475222 0 1 0 56.174854-8.97468s6.315516 3.323956 8.30989 20.27613-11.966241 29.029214-35.455529 33.239559-88.638823-19.943735-104.039819-115.452067C709.110582 96.39472 781.57282 28.253625 838.966457 13.185025a55.399264 55.399264 0 0 0-64.041549-5.318329c-56.064055 35.123134-97.170309 109.579745-85.536464 182.817571 14.957801 93.846354 79.664142 151.904783 144.038087 141.711318zM203.980091 573.825579a53.072495 53.072495 0 0 0 33.90435-67.919498c-2.659165-6.537113-21.162519-38.225492-53.51569-25.040467a30.026401 30.026401 0 0 0-19.832936 40.773858 22.159706 22.159706 0 1 0 40.773858-16.619779s5.318329 1.329582 9.861069 13.739017-3.988747 24.043281-21.05172 31.023588-70.02467 0.553993-98.832288-68.695087C68.916685 417.599654 110.798528 353.558104 151.904783 332.395585a42.879031 42.879031 0 0 0-48.97295 7.423502 146.918849 146.918849 0 0 0-32.574767 152.458775c27.810431 68.141095 86.866046 100.605064 133.623025 81.547717z",fill:"#FED150","p-id":"10997"})],-1)])),_:1,__:[2]}),f[3]||(f[3]=e.createElementVNode("div",{style:{"margin-left":"12px"}},[e.createElementVNode("div",null,"聊天室"),e.createElementVNode("div",{style:{"font-size":"12px"}},"当前2人在线")],-1))]),e.createVNode(gd,{ref_key:"messageRef",ref:n,data:e.unref(r),"user-id":t.userId},null,8,["data","user-id"]),e.createElementVNode("div",vd,[e.createVNode(e.unref(k.ElInput),{id:"emojiInput",modelValue:l.value,"onUpdate:modelValue":f[0]||(f[0]=g=>l.value=g),type:"textarea",autosize:{minRows:1,maxRows:4},placeholder:"请输入内容",onKeydown:e.withKeys(h,["enter"])},null,8,["modelValue"]),e.createVNode(cd,{style:{margin:"0 8px 0"},emoji:t.emoji,placement:"top-end",onAddEmoji:u},{default:e.withCtx(()=>f[4]||(f[4]=[e.createElementVNode("svg",{width:"22",height:"22",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7186"},[e.createElementVNode("path",{d:"M510.944 960c-247.04 0-448-200.96-448-448s200.992-448 448-448c247.008 0 448 200.96 448 448S757.984 960 510.944 960zM510.944 128c-211.744 0-384 172.256-384 384 0 211.744 172.256 384 384 384 211.744 0 384-172.256 384-384C894.944 300.256 722.688 128 510.944 128zM512 773.344c-89.184 0-171.904-40.32-226.912-110.624-10.88-13.92-8.448-34.016 5.472-44.896 13.888-10.912 34.016-8.48 44.928 5.472 42.784 54.688 107.136 86.048 176.512 86.048 70.112 0 134.88-31.904 177.664-87.552 10.784-14.016 30.848-16.672 44.864-5.888 14.016 10.784 16.672 30.88 5.888 44.864C685.408 732.32 602.144 773.344 512 773.344zM368 515.2c-26.528 0-48-21.472-48-48l0-64c0-26.528 21.472-48 48-48s48 21.472 48 48l0 64C416 493.696 394.496 515.2 368 515.2zM656 515.2c-26.496 0-48-21.472-48-48l0-64c0-26.528 21.504-48 48-48s48 21.472 48 48l0 64C704 493.696 682.496 515.2 656 515.2z","p-id":"7187"})],-1)])),_:1,__:[4]},8,["emoji"]),e.createVNode(C,{size:"18",class:e.normalizeClass([{".cv-chat-wrap submit-btn":l.value.trim()!=""},"select-none cursor-pointer"]),style:{"padding-bottom":"5px"},onClick:p},{default:e.withCtx(()=>f[5]||(f[5]=[e.createElementVNode("svg",{viewBox:"0 0 1025 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"15072"},[e.createElementVNode("path",{d:"M1008.00076 6.285714q18.857143 13.714286 15.428571 36.571429l-146.285714 877.714286q-2.857143 16.571429-18.285714 25.714286-8 4.571429-17.714286 4.571429-6.285714 0-13.714286-2.857143l-258.857143-105.714286-138.285714 168.571429q-10.285714 13.142857-28 13.142857-7.428571 0-12.571429-2.285714-10.857143-4-17.428571-13.428571t-6.571429-20.857143l0-199.428571 493.714286-605.142857-610.857143 528.571429-225.714286-92.571429q-21.142857-8-22.857143-31.428571-1.142857-22.857143 18.285714-33.714286l950.857143-548.571429q8.571429-5.142857 18.285714-5.142857 11.428571 0 20.571429 6.285714z","p-id":"15073"})],-1)])),_:1,__:[5]},8,["class"])])],2),e.createVNode(e.unref(k.ElButton),{class:"chat-btn",onClick:f[1]||(f[1]=g=>i.value=!i.value)},{default:e.withCtx(()=>f[6]||(f[6]=[e.createTextVNode("chat")])),_:1,__:[6]})])}}});Wt.install=function(t){t.component(Wt.name,Wt)};const yd={key:0},Yt=Object.assign({name:"cvNoticeBar"},{__name:"notice-bar",props:{data:{type:[String,Array],default:()=>[]},vertical:{type:[Boolean],default:!1},suffixIcon:{type:[String],default:""},prefixIcon:{type:[String],default:""},size:{type:[Number],default:14},height:{type:[Number],default:40},delay:{type:[Number],default:1e3},spped:{type:[Number],default:100},color:{type:[String],default:"--color-warning"},background:{type:[String],default:"var(--color-warning-light-9)"}},setup(t){const o=t,{data:a,vertical:i,suffixIcon:l,prefixIcon:n,size:r,height:c,delay:h,spped:d,color:p,background:u}=o,m=e.reactive({boxWidth:0,textWidth:0,oneTime:0,twoTime:0,order:1}),f=e.ref({}),C=e.ref({style:{cssText:""}}),g=e.computed(()=>o.delay>2e3?o.delay:2e3),y=()=>{m.oneTime=m.textWidth/o.spped,m.twoTime=(m.textWidth+m.boxWidth)/o.spped},b=()=>{var w,V;m.order===1?((w=C.value)!=null&&w.style&&(C.value.style.cssText=`animation: oneAnimation ${m.oneTime}s linear; opactity: 1;}`),m.order=2):(V=C.value)!=null&&V.style&&(C.value.style.cssText=`animation: twoAnimation ${m.twoTime}s linear infinite; opacity: 1;`)};return e.onMounted(()=>{o.vertical||(e.nextTick(()=>{m.boxWidth=f.value.offsetWidth,m.textWidth=C.value.offsetWidth,document.styleSheets[0].insertRule(`@keyframes oneAnimation {0% {left: 0px;} 100% {left: -${m.textWidth}px;}}`),document.styleSheets[0].insertRule(`@keyframes twoAnimation {0% {left: ${m.boxWidth}px;} 100% {left: -${m.textWidth}px;}}`),y(),setTimeout(()=>{b()},o.delay)}),C.value.addEventListener("animationend",()=>{b()},!1))}),(w,V)=>{const B=e.resolveComponent("el-carousel-item"),S=e.resolveComponent("el-carousel"),I=e.resolveComponent("cvIcons");return e.openBlock(),e.createElementBlock("div",{class:"cv-notice-bar",style:e.normalizeStyle({background:e.unref(u),height:`${e.unref(c)}px`})},[e.unref(i)?(e.openBlock(),e.createElementBlock("div",yd,[e.createVNode(S,{height:"40px",direction:"vertical",autoplay:!0,"indicator-position":"none",interval:g.value},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a),L=>(e.openBlock(),e.createBlock(B,{key:L},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(L),1)]),_:2},1024))),128))]),_:1},8,["interval"])])):(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle({color:e.unref(p),fontSize:`${e.unref(r)}px`}),class:"cv-notice-bar-wrap"},[e.unref(n)?(e.openBlock(),e.createBlock(I,{key:0,type:e.unref(n)},null,8,["type"])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"boxRef",ref:f,class:"text-box"},[e.createElementVNode("div",{ref_key:"textRef",ref:C,class:"text"},e.toDisplayString(e.unref(a)),513)],512),e.unref(l)?(e.openBlock(),e.createBlock(I,{key:1,type:e.unref(l)},null,8,["type"])):e.createCommentVNode("",!0)],4))],4)}}});Yt.install=function(t){t.component(Yt.name,Yt)};const kd=Object.freeze({autofocus:!1,disabled:!1,indentWithTab:!0,tabSize:2,placeholder:"",autoDestroy:!0,extensions:[cn.basicSetup]}),pa="change",ma="update",ua="focus",ga="blur",fa="ready",Ca="update:modelValue",bd=({onUpdate:t,onChange:o,onFocus:a,onBlur:i,...l})=>O.EditorState.create({doc:l.doc,selection:l.selection,extensions:[...Array.isArray(l.extensions)?l.extensions:[l.extensions],D.EditorView.updateListener.of(n=>{t(n),n.docChanged&&o(n.state.doc.toString(),n),n.focusChanged&&(n.view.hasFocus?a(n):i(n))})]}),te=t=>{const o=new O.Compartment;return{compartment:o,run:a=>{o.get(t.state)?t.dispatch({effects:o.reconfigure(a)}):t.dispatch({effects:O.StateEffect.appendConfig.of(o.of(a))})}}},va=(t,o)=>{const{compartment:a,run:i}=te(t);return l=>{const n=a.get(t.state);i(l??n!==o?o:[])}},wd=t=>{const o=()=>t.state.doc.toString(),{run:a}=te(t),i=va(t,[D.EditorView.editable.of(!1),O.EditorState.readOnly.of(!0)]),l=va(t,D.keymap.of([dn.indentWithTab])),{run:n}=te(t),{run:r}=te(t),{run:c}=te(t),{run:h}=te(t);return{focus:()=>t.focus(),getDoc:o,setDoc:d=>{d!==o()&&t.dispatch({changes:{from:0,to:t.state.doc.length,insert:d}})},reExtensions:a,toggleDisabled:i,toggleIndentWithTab:l,setTabSize:d=>{n([O.EditorState.tabSize.of(d),x.indentUnit.of(" ".repeat(d))])},setPhrases:d=>{r([O.EditorState.phrases.of(d)])},setPlaceholder:d=>{c(D.placeholder(d))},setStyle:(d={})=>{h(D.EditorView.theme({"&":{...d}}))}}},Vd=e.defineComponent({name:"VueCodemirror",props:{modelValue:{type:String,default:""},autofocus:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},indentWithTab:{type:Boolean,default:!1},tabSize:Number,placeholder:String,style:Object,autoDestroy:{type:Boolean,default:!1},phrases:Object,root:Object,extensions:Array,selection:Object},emits:{[pa]:(t,o)=>!0,[ma]:t=>!0,[ua]:t=>!0,[ga]:t=>!0,[fa]:t=>!0,[Ca]:(t,o)=>!0},setup(t,o){const a=e.shallowRef(),i=e.shallowRef(),l=e.shallowRef(),n={...kd},r=e.computed(()=>{const c={};return Object.keys(e.toRaw(t)).forEach(h=>{h!=="modelValue"&&(c[h]=t[h]??n[h])}),c});return e.onMounted(()=>{i.value=bd({doc:t.modelValue,selection:r.value.selection,extensions:n.extensions??[],onFocus:h=>o.emit(ua,h),onBlur:h=>o.emit(ga,h),onUpdate:h=>o.emit(ma,h),onChange:(h,d)=>{h!==t.modelValue&&(o.emit(pa,h,d),o.emit(Ca,h,d))}}),l.value=new D.EditorView({state:i.value,parent:a.value,root:r.value.root}),l.value.contentDOM.addEventListener("scroll",h=>{});const c=wd(l.value);e.watch(()=>t.modelValue,h=>{h!==c.getDoc()&&c.setDoc(h)}),e.watch(()=>t.extensions,h=>c.reExtensions(h||[]),{immediate:!0}),e.watch(()=>r.value.disabled,h=>c.toggleDisabled(h),{immediate:!0}),e.watch(()=>r.value.indentWithTab,h=>c.toggleIndentWithTab(h),{immediate:!0}),e.watch(()=>r.value.tabSize,h=>c.setTabSize(h),{immediate:!0}),e.watch(()=>r.value.phrases,h=>c.setPhrases(h||{}),{immediate:!0}),e.watch(()=>r.value.placeholder,h=>c.setPlaceholder(h),{immediate:!0}),e.watch(()=>r.value.style,h=>c.setStyle(h),{immediate:!0}),r.value.autofocus&&c.focus(),o.emit(fa,{state:i.value,view:l.value,container:a.value,editorTools:c})}),e.onBeforeUnmount(()=>{r.value.autoDestroy&&l.value&&l.value.destroy()}),()=>e.h("div",{class:"cv-editor-codemirror",ref:a})}}),ya="#e06c75",Xt="#abb2bf",Xo="#7d8799",ka="#d19a66",ba="#2c313a",wa="#282c34",ho="#353a42",Va="#528bff",xd=D.EditorView.theme({"&":{color:Xt,backgroundColor:wa},".cm-content":{caretColor:Va},".cm-cursor, .cm-dropCursor":{borderLeftColor:Va},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:Xt},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:wa,color:Xo,border:"none"},".cm-activeLineGutter":{backgroundColor:ba},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:ho},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:ho,borderBottomColor:ho},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:ba,color:Xt}}},{dark:!0}),Nd=x.HighlightStyle.define([{tag:s.tags.keyword,color:"#c678dd"},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.propertyName,s.tags.macroName],color:ya},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:"#61afef"},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:ka},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:Xt},{tag:[s.tags.typeName,s.tags.className,s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:"#e5c07b"},{tag:[s.tags.operator,s.tags.operatorKeyword,s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link,s.tags.special(s.tags.string)],color:"#56b6c2"},{tag:[s.tags.meta,s.tags.comment],color:Xo},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.strikethrough,textDecoration:"line-through"},{tag:s.tags.link,color:Xo,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:ya},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:ka},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted],color:"#98c379"},{tag:s.tags.invalid,color:"#ffffff"}]),Sd=[xd,x.syntaxHighlighting(Nd)],Bd=!1,po="#FAFAFA",M="#90A4AE",re="#80CBC440",xa="#272727",mo="#FAFAFA",Na="#00000010",Ed="#c2c2c222",Dd="#CFD8DC",_d="#7E939E",Td="#FAFAFA",Sa="#7C4DFF",uo="#90A4AE",Ba="#6182B8",Id="#91B859",Ld="#F76D47",Ea="#8796B0",Fd="#FFB62C",Od="#F76D47",$d="#90A4AE",zd="#91B859",Pd="#E53935",Md="#39ADB5",Hd=D.EditorView.theme({"&":{color:M,backgroundColor:po},".cm-content":{caretColor:xa},".cm-cursor, .cm-dropCursor":{borderLeftColor:xa},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:re},".cm-panels":{backgroundColor:mo,color:M},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:mo,outline:`1px solid ${Na}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:re},".cm-activeLine":{backgroundColor:Ed},".cm-selectionMatch":{backgroundColor:re},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:Td,outline:"none"},".cm-gutters":{backgroundColor:po,color:M,border:"none"},".cm-activeLineGutter":{backgroundColor:po},".cm-lineNumbers .cm-gutterElement":{color:Dd},".cm-lineNumbers .cm-activeLineGutter":{color:_d},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:M},".cm-tooltip":{border:`1px solid ${Na}`,backgroundColor:mo,color:M},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:M,borderBottomColor:M},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:re,color:M}}},{dark:Bd}),Ad=x.HighlightStyle.define([{tag:s.tags.keyword,color:Sa},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:uo},{tag:[s.tags.propertyName],color:Ba},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:Id},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:Ba},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:Ld},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:uo},{tag:[s.tags.className],color:Fd},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:Od},{tag:[s.tags.typeName],color:Ea,fontStyle:Ea},{tag:[s.tags.operator,s.tags.operatorKeyword],color:Sa},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:Md},{tag:[s.tags.meta,s.tags.comment],color:$d},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:zd},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:uo},{tag:s.tags.invalid,color:Pd},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),jd=[Hd,x.syntaxHighlighting(Ad)],Rd=!0,go="#263238",H="#EEFFFF",se="#80CBC420",Da="#FFCC00",fo="#263238",_a="#FFFFFF10",Ud="#4c616c22",Wd="#37474F",Yd="#607a86",Xd="#263238",Ta="#C792EA",Co="#EEFFFF",Ia="#82AAFF",qd="#C3E88D",Kd="#F78C6C",La="#B2CCD6",Gd="#FFCB6B",Zd="#F78C6C",Qd="#546E7A",Jd="#C3E88D",eh="#FF5370",th="#89DDFF",oh=D.EditorView.theme({"&":{color:H,backgroundColor:go},".cm-content":{caretColor:Da},".cm-cursor, .cm-dropCursor":{borderLeftColor:Da},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:se},".cm-panels":{backgroundColor:fo,color:H},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:fo,outline:`1px solid ${_a}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:se},".cm-activeLine":{backgroundColor:Ud},".cm-selectionMatch":{backgroundColor:se},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:Xd,outline:"none"},".cm-gutters":{backgroundColor:go,color:H,border:"none"},".cm-activeLineGutter":{backgroundColor:go},".cm-lineNumbers .cm-gutterElement":{color:Wd},".cm-lineNumbers .cm-activeLineGutter":{color:Yd},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:H},".cm-tooltip":{border:`1px solid ${_a}`,backgroundColor:fo,color:H},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:H,borderBottomColor:H},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:se,color:H}}},{dark:Rd}),ah=x.HighlightStyle.define([{tag:s.tags.keyword,color:Ta},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:Co},{tag:[s.tags.propertyName],color:Ia},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:qd},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:Ia},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:Kd},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:Co},{tag:[s.tags.className],color:Gd},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:Zd},{tag:[s.tags.typeName],color:La,fontStyle:La},{tag:[s.tags.operator,s.tags.operatorKeyword],color:Ta},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:th},{tag:[s.tags.meta,s.tags.comment],color:Qd},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:Jd},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:Co},{tag:s.tags.invalid,color:eh},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),lh=[oh,x.syntaxHighlighting(ah)],nh=!1,vo="#FDF6E3",A="#586E75",ce="#EEE8D5",Fa="#657B83",yo="#FDF6E3",Oa="#D3AF86",ih="#d5bd5c22",rh="#586E75",sh="#567983",ch="#EEE8D5",$a="#859900",ko="#268BD2",za="#268BD2",dh="#2AA198",hh="#CB4B16",Pa="#CB4B16",ph="#CB4B16",mh="#D33682",uh="#93A1A1",gh="#268BD2",fh="#DC322F",Ch="#DC322F",vh=D.EditorView.theme({"&":{color:A,backgroundColor:vo},".cm-content":{caretColor:Fa},".cm-cursor, .cm-dropCursor":{borderLeftColor:Fa},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:ce},".cm-panels":{backgroundColor:yo,color:A},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:yo,outline:`1px solid ${Oa}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:ce},".cm-activeLine":{backgroundColor:ih},".cm-selectionMatch":{backgroundColor:ce},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:ch,outline:"none"},".cm-gutters":{backgroundColor:vo,color:A,border:"none"},".cm-activeLineGutter":{backgroundColor:vo},".cm-lineNumbers .cm-gutterElement":{color:rh},".cm-lineNumbers .cm-activeLineGutter":{color:sh},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:A},".cm-tooltip":{border:`1px solid ${Oa}`,backgroundColor:yo,color:A},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:A,borderBottomColor:A},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:ce,color:A}}},{dark:nh}),yh=x.HighlightStyle.define([{tag:s.tags.keyword,color:$a},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:ko},{tag:[s.tags.propertyName],color:za},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:dh},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:za},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:hh},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:ko},{tag:[s.tags.className],color:ph},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:mh},{tag:[s.tags.typeName],color:Pa,fontStyle:Pa},{tag:[s.tags.operator,s.tags.operatorKeyword],color:$a},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:Ch},{tag:[s.tags.meta,s.tags.comment],color:uh},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:gh},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:ko},{tag:s.tags.invalid,color:fh},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),kh=[vh,x.syntaxHighlighting(yh)],bh=!0,bo="#002B36",j="#93A1A1",de="#274642",Ma="#D30102",wo="#002B36",Ha="#2AA19899",wh="#005b7022",Vh="#93A1A1",xh="#949494",Nh="#073642",Aa="#859900",Vo="#268BD2",ja="#268BD2",Sh="#2AA198",Bh="#CB4B16",Ra="#CB4B16",Eh="#CB4B16",Dh="#D33682",_h="#586E75",Th="#268BD2",Ih="#DC322F",Lh="#DC322F",Fh=D.EditorView.theme({"&":{color:j,backgroundColor:bo},".cm-content":{caretColor:Ma},".cm-cursor, .cm-dropCursor":{borderLeftColor:Ma},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:de},".cm-panels":{backgroundColor:wo,color:j},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:wo,outline:`1px solid ${Ha}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:de},".cm-activeLine":{backgroundColor:wh},".cm-selectionMatch":{backgroundColor:de},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:Nh,outline:"none"},".cm-gutters":{backgroundColor:bo,color:j,border:"none"},".cm-activeLineGutter":{backgroundColor:bo},".cm-lineNumbers .cm-gutterElement":{color:Vh},".cm-lineNumbers .cm-activeLineGutter":{color:xh},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:j},".cm-tooltip":{border:`1px solid ${Ha}`,backgroundColor:wo,color:j},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:j,borderBottomColor:j},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:de,color:j}}},{dark:bh}),Oh=x.HighlightStyle.define([{tag:s.tags.keyword,color:Aa},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:Vo},{tag:[s.tags.propertyName],color:ja},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:Sh},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:ja},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:Bh},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:Vo},{tag:[s.tags.className],color:Eh},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:Dh},{tag:[s.tags.typeName],color:Ra,fontStyle:Ra},{tag:[s.tags.operator,s.tags.operatorKeyword],color:Aa},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:Lh},{tag:[s.tags.meta,s.tags.comment],color:_h},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:Th},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:Vo},{tag:s.tags.invalid,color:Ih},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),$h=[Fh,x.syntaxHighlighting(Oh)],zh=!0,xo="#282A36",R="#F8F8F2",he="#44475A",Ua="#F8F8F2",No="#282A36",Wa="#191A21",Ph="#53576c22",Mh="#6272A4",Hh="#F8F8F2",Ah="#44475A",Ya="#FF79C6",So="#F8F8F2",Xa="#50FA7B",jh="#F1FA8C",Rh="#BD93F9",qa="#8BE9FD",Uh="#8BE9FD",Wh="#BD93F9",Yh="#6272A4",Xh="#BD93F9",qh="#FF5555",Kh="#F1FA8C",Gh=D.EditorView.theme({"&":{color:R,backgroundColor:xo},".cm-content":{caretColor:Ua},".cm-cursor, .cm-dropCursor":{borderLeftColor:Ua},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:he},".cm-panels":{backgroundColor:No,color:R},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:No,outline:`1px solid ${Wa}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:he},".cm-activeLine":{backgroundColor:Ph},".cm-selectionMatch":{backgroundColor:he},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:Ah,outline:"none"},".cm-gutters":{backgroundColor:xo,color:R,border:"none"},".cm-activeLineGutter":{backgroundColor:xo},".cm-lineNumbers .cm-gutterElement":{color:Mh},".cm-lineNumbers .cm-activeLineGutter":{color:Hh},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:R},".cm-tooltip":{border:`1px solid ${Wa}`,backgroundColor:No,color:R},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:R,borderBottomColor:R},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:he,color:R}}},{dark:zh}),Zh=x.HighlightStyle.define([{tag:s.tags.keyword,color:Ya},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:So},{tag:[s.tags.propertyName],color:Xa},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:jh},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:Xa},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:Rh},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:So},{tag:[s.tags.className],color:Uh},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:Wh},{tag:[s.tags.typeName],color:qa,fontStyle:qa},{tag:[s.tags.operator,s.tags.operatorKeyword],color:Ya},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:Kh},{tag:[s.tags.meta,s.tags.comment],color:Yh},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:Xh},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:So},{tag:s.tags.invalid,color:qh},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),Qh=[Gh,x.syntaxHighlighting(Zh)],Jh=!1,Bo="#fff",U="#444d56",pe="#0366d625",Ka="#044289",Eo="#fff",Ga="#e1e4e8",ep="#c6c6c622",tp="#1b1f234d",op="#24292e",ap="#34d05840",Za="#d73a49",Do="#e36209",Qa="#005cc5",lp="#032f62",np="#005cc5",Ja="#005cc5",ip="#6f42c1",rp="#005cc5",sp="#6a737d",cp="#005cc5",dp="#cb2431",hp="#032f62",pp=D.EditorView.theme({"&":{color:U,backgroundColor:Bo},".cm-content":{caretColor:Ka},".cm-cursor, .cm-dropCursor":{borderLeftColor:Ka},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:pe},".cm-panels":{backgroundColor:Eo,color:U},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:Eo,outline:`1px solid ${Ga}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:pe},".cm-activeLine":{backgroundColor:ep},".cm-selectionMatch":{backgroundColor:pe},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:ap,outline:"none"},".cm-gutters":{backgroundColor:Bo,color:U,border:"none"},".cm-activeLineGutter":{backgroundColor:Bo},".cm-lineNumbers .cm-gutterElement":{color:tp},".cm-lineNumbers .cm-activeLineGutter":{color:op},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:U},".cm-tooltip":{border:`1px solid ${Ga}`,backgroundColor:Eo,color:U},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:U,borderBottomColor:U},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:pe,color:U}}},{dark:Jh}),mp=x.HighlightStyle.define([{tag:s.tags.keyword,color:Za},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:Do},{tag:[s.tags.propertyName],color:Qa},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:lp},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:Qa},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:np},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:Do},{tag:[s.tags.className],color:ip},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:rp},{tag:[s.tags.typeName],color:Ja,fontStyle:Ja},{tag:[s.tags.operator,s.tags.operatorKeyword],color:Za},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:hp},{tag:[s.tags.meta,s.tags.comment],color:sp},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:cp},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:Do},{tag:s.tags.invalid,color:dp},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),up=[pp,x.syntaxHighlighting(mp)],gp=!0,_o="#24292e",W="#d1d5da",me="#3392FF44",el="#c8e1ff",To="#24292e",tl="#1b1f23",fp="#4d566022",Cp="#444d56",vp="#e1e4e8",yp="#17E5E650",ol="#f97583",Io="#ffab70",al="#79b8ff",kp="#9ecbff",bp="#79b8ff",ll="#79b8ff",wp="#b392f0",Vp="#79b8ff",xp="#6a737d",Np="#79b8ff",Sp="#f97583",Bp="#9ecbff",Ep=D.EditorView.theme({"&":{color:W,backgroundColor:_o},".cm-content":{caretColor:el},".cm-cursor, .cm-dropCursor":{borderLeftColor:el},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:me},".cm-panels":{backgroundColor:To,color:W},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:To,outline:`1px solid ${tl}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:me},".cm-activeLine":{backgroundColor:fp},".cm-selectionMatch":{backgroundColor:me},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:yp,outline:"none"},".cm-gutters":{backgroundColor:_o,color:W,border:"none"},".cm-activeLineGutter":{backgroundColor:_o},".cm-lineNumbers .cm-gutterElement":{color:Cp},".cm-lineNumbers .cm-activeLineGutter":{color:vp},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:W},".cm-tooltip":{border:`1px solid ${tl}`,backgroundColor:To,color:W},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:W,borderBottomColor:W},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:me,color:W}}},{dark:gp}),Dp=x.HighlightStyle.define([{tag:s.tags.keyword,color:ol},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:Io},{tag:[s.tags.propertyName],color:al},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:kp},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:al},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:bp},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:Io},{tag:[s.tags.className],color:wp},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:Vp},{tag:[s.tags.typeName],color:ll,fontStyle:ll},{tag:[s.tags.operator,s.tags.operatorKeyword],color:ol},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:Bp},{tag:[s.tags.meta,s.tags.comment],color:xp},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:Np},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:Io},{tag:s.tags.invalid,color:Sp},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),_p=[Ep,x.syntaxHighlighting(Dp)],Tp=!0,Lo="#21202e",Y="#edecee",ue="#3d375e7f",nl="#a277ff",Fo="#21202e",il="#3b334b",Ip="#4d4b6622",Lp="#a394f033",Fp="#cdccce",Op="#a394f033",rl="#a277ff",Oo="#edecee",sl="#ffca85",$p="#61ffca",zp="#61ffca",cl="#82e2ff",Pp="#82e2ff",Mp="#61ffca",Hp="#6d6d6d",Ap="#a277ff",jp="#ff6767",Rp="#61ffca",Up=D.EditorView.theme({"&":{color:Y,backgroundColor:Lo},".cm-content":{caretColor:nl},".cm-cursor, .cm-dropCursor":{borderLeftColor:nl},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:ue},".cm-panels":{backgroundColor:Fo,color:Y},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:Fo,outline:`1px solid ${il}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:ue},".cm-activeLine":{backgroundColor:Ip},".cm-selectionMatch":{backgroundColor:ue},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:Op,outline:"none"},".cm-gutters":{backgroundColor:Lo,color:Y,border:"none"},".cm-activeLineGutter":{backgroundColor:Lo},".cm-lineNumbers .cm-gutterElement":{color:Lp},".cm-lineNumbers .cm-activeLineGutter":{color:Fp},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:Y},".cm-tooltip":{border:`1px solid ${il}`,backgroundColor:Fo,color:Y},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Y,borderBottomColor:Y},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:ue,color:Y}}},{dark:Tp}),Wp=x.HighlightStyle.define([{tag:s.tags.keyword,color:rl},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:Oo},{tag:[s.tags.propertyName],color:sl},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:$p},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:sl},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:zp},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:Oo},{tag:[s.tags.className],color:Pp},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:Mp},{tag:[s.tags.typeName],color:cl,fontStyle:cl},{tag:[s.tags.operator,s.tags.operatorKeyword],color:rl},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:Rp},{tag:[s.tags.meta,s.tags.comment],color:Hp},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:Ap},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:Oo},{tag:s.tags.invalid,color:jp},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),Yp=[Up,x.syntaxHighlighting(Wp)],Xp=!0,$o="#1a1b26",X="#787c99",ge="#515c7e40",dl="#c0caf5",zo="#1a1b26",hl="#787c99",qp="#43455c22",Kp="#363b54",Gp="#737aa2",Zp="#16161e",pl="#bb9af7",Po="#c0caf5",ml="#7aa2f7",Qp="#9ece6a",Jp="#bb9af7",ul="#0db9d7",em="#c0caf5",tm="#ff9e64",om="#444b6a",am="#89ddff",lm="#ff5370",nm="#b4f9f8",im=D.EditorView.theme({"&":{color:X,backgroundColor:$o},".cm-content":{caretColor:dl},".cm-cursor, .cm-dropCursor":{borderLeftColor:dl},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:ge},".cm-panels":{backgroundColor:zo,color:X},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:zo,outline:`1px solid ${hl}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:ge},".cm-activeLine":{backgroundColor:qp},".cm-selectionMatch":{backgroundColor:ge},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:Zp,outline:"none"},".cm-gutters":{backgroundColor:$o,color:X,border:"none"},".cm-activeLineGutter":{backgroundColor:$o},".cm-lineNumbers .cm-gutterElement":{color:Kp},".cm-lineNumbers .cm-activeLineGutter":{color:Gp},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:X},".cm-tooltip":{border:`1px solid ${hl}`,backgroundColor:zo,color:X},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:X,borderBottomColor:X},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:ge,color:X}}},{dark:Xp}),rm=x.HighlightStyle.define([{tag:s.tags.keyword,color:pl},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:Po},{tag:[s.tags.propertyName],color:ml},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:Qp},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:ml},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:Jp},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:Po},{tag:[s.tags.className],color:em},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:tm},{tag:[s.tags.typeName],color:ul,fontStyle:ul},{tag:[s.tags.operator,s.tags.operatorKeyword],color:pl},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:nm},{tag:[s.tags.meta,s.tags.comment],color:om},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:am},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:Po},{tag:s.tags.invalid,color:lm},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),sm=[im,x.syntaxHighlighting(rm)],cm=!0,Mo="#24283b",q="#7982a9",fe="#6f7bb630",gl="#c0caf5",Ho="#24283b",fl="#7982a9",dm="#4d547722",hm="#3b4261",pm="#737aa2",mm="#1f2335",Cl="#bb9af7",Ao="#c0caf5",vl="#7aa2f7",um="#9ece6a",gm="#bb9af7",yl="#2ac3de",fm="#c0caf5",Cm="#ff9e64",vm="#565f89",ym="#89ddff",km="#ff5370",bm="#b4f9f8",wm=D.EditorView.theme({"&":{color:q,backgroundColor:Mo},".cm-content":{caretColor:gl},".cm-cursor, .cm-dropCursor":{borderLeftColor:gl},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:fe},".cm-panels":{backgroundColor:Ho,color:q},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:Ho,outline:`1px solid ${fl}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:fe},".cm-activeLine":{backgroundColor:dm},".cm-selectionMatch":{backgroundColor:fe},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:mm,outline:"none"},".cm-gutters":{backgroundColor:Mo,color:q,border:"none"},".cm-activeLineGutter":{backgroundColor:Mo},".cm-lineNumbers .cm-gutterElement":{color:hm},".cm-lineNumbers .cm-activeLineGutter":{color:pm},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:q},".cm-tooltip":{border:`1px solid ${fl}`,backgroundColor:Ho,color:q},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:q,borderBottomColor:q},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:fe,color:q}}},{dark:cm}),Vm=x.HighlightStyle.define([{tag:s.tags.keyword,color:Cl},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:Ao},{tag:[s.tags.propertyName],color:vl},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:um},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:vl},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:gm},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:Ao},{tag:[s.tags.className],color:fm},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:Cm},{tag:[s.tags.typeName],color:yl,fontStyle:yl},{tag:[s.tags.operator,s.tags.operatorKeyword],color:Cl},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:bm},{tag:[s.tags.meta,s.tags.comment],color:vm},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:ym},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:Ao},{tag:s.tags.invalid,color:km},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),xm=[wm,x.syntaxHighlighting(Vm)],Nm=!1,jo="#e1e2e7",K="#6a6f8e",Ce="#8591b840",kl="#3760bf",Ro="#e1e2e7",bl="#6a6f8e",Sm="#a7aaba22",Bm="#b3b6cd",Em="#68709a",Dm="#e9e9ec",wl="#9854f1",Uo="#3760bf",Vl="#2e7de9",_m="#587539",Tm="#9854f1",xl="#07879d",Im="#3760bf",Lm="#b15c00",Fm="#9da3c2",Om="#006a83",$m="#ff3e64",zm="#2e5857",Pm=D.EditorView.theme({"&":{color:K,backgroundColor:jo},".cm-content":{caretColor:kl},".cm-cursor, .cm-dropCursor":{borderLeftColor:kl},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Ce},".cm-panels":{backgroundColor:Ro,color:K},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:Ro,outline:`1px solid ${bl}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:Ce},".cm-activeLine":{backgroundColor:Sm},".cm-selectionMatch":{backgroundColor:Ce},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:Dm,outline:"none"},".cm-gutters":{backgroundColor:jo,color:K,border:"none"},".cm-activeLineGutter":{backgroundColor:jo},".cm-lineNumbers .cm-gutterElement":{color:Bm},".cm-lineNumbers .cm-activeLineGutter":{color:Em},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:K},".cm-tooltip":{border:`1px solid ${bl}`,backgroundColor:Ro,color:K},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:K,borderBottomColor:K},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{background:Ce,color:K}}},{dark:Nm}),Mm=x.HighlightStyle.define([{tag:s.tags.keyword,color:wl},{tag:[s.tags.name,s.tags.deleted,s.tags.character,s.tags.macroName],color:Uo},{tag:[s.tags.propertyName],color:Vl},{tag:[s.tags.processingInstruction,s.tags.string,s.tags.inserted,s.tags.special(s.tags.string)],color:_m},{tag:[s.tags.function(s.tags.variableName),s.tags.labelName],color:Vl},{tag:[s.tags.color,s.tags.constant(s.tags.name),s.tags.standard(s.tags.name)],color:Tm},{tag:[s.tags.definition(s.tags.name),s.tags.separator],color:Uo},{tag:[s.tags.className],color:Im},{tag:[s.tags.number,s.tags.changed,s.tags.annotation,s.tags.modifier,s.tags.self,s.tags.namespace],color:Lm},{tag:[s.tags.typeName],color:xl,fontStyle:xl},{tag:[s.tags.operator,s.tags.operatorKeyword],color:wl},{tag:[s.tags.url,s.tags.escape,s.tags.regexp,s.tags.link],color:zm},{tag:[s.tags.meta,s.tags.comment],color:Fm},{tag:s.tags.strong,fontWeight:"bold"},{tag:s.tags.emphasis,fontStyle:"italic"},{tag:s.tags.link,textDecoration:"underline"},{tag:s.tags.heading,fontWeight:"bold",color:Om},{tag:[s.tags.atom,s.tags.bool,s.tags.special(s.tags.variableName)],color:Uo},{tag:s.tags.invalid,color:$m},{tag:s.tags.strikethrough,textDecoration:"line-through"}]),Hm=[Pm,x.syntaxHighlighting(Mm)],Am={disabled:!1,indentWithTab:!0,tabSize:4,autofocus:!1,placeholder:"input...",backgroundColor:"white",language:"markdown",theme:"oneDark",phrases:"en-us"},Rl={emits:["update:config"],components:{CodemirrorEditor:Vd},data:()=>({codemrrConfig:{...Am},codemrrThemes:{oneDark:Sd,materialLight:jd,materialDark:lh,solarizedLight:kh,solarizedDark:$h,dracula:Qh,githubLight:up,githubDark:_p,aura:Yp,tokyoNight:sm,tokyoNightStorm:xm,tokyoNightDay:Hm},codemrrLanguages:{javascript:aa.javascript(),js:aa.javascript(),html:hn.html(),markdown:mn.markdown(),json:pn.json(),vue:un.vue(),java:fn.java(),php:gn.php(),python:Cn.python(),go:yn.go(),mysql:la.sql(),sql:la.sql(),xml:vn.xml(),css:kn.css()},codemrrPhrases:{"Control character":"Steuerzeichen","Selection deleted":"Auswahl gelöscht","Folded lines":"Eingeklappte Zeilen","Unfolded lines":"Ausgeklappte Zeilen",to:"bis","folded code":"eingeklappter Code",unfold:"ausklappen","Fold line":"Zeile einklappen","Unfold line":"Zeile ausklappen","Go to line":"Springe zu Zeile",go:"OK",Find:"Suchen",Replace:"Ersetzen",next:"nächste",previous:"vorherige",all:"alle","match case":"groß/klein beachten","by word":"ganze Wörter",replace:"ersetzen","replace all":"alle ersetzen",close:"schließen","current match":"aktueller Treffer","replaced $ matches":"$ Treffer ersetzt","replaced match on line $":"Treffer on Zeile $ ersetzt","on line":"auf Zeile",Completions:"Vervollständigungen",Diagnostics:"Diagnosen","No diagnostics":"Keine Diagnosen"},editorViewInst:null,editorStateInst:null}),computed:{optionTheme(){let t=Object.keys(this.codemrrThemes);return["default"].concat(t)},optionPhrases:()=>["en-us","de-de"],optionLanguage(){return Object.keys(this.codemrrLanguages)},extensions(){const t=[];return t.push(this.codemrrLanguages[this.codemrrConfig.language]),this.codemrrThemes[this.codemrrConfig.theme]&&t.push(this.codemrrThemes[this.codemrrConfig.theme]),t},codemrrBind(){return{theme:this.codemrrConfig.theme,language:this.codemrrConfig.language,autofocus:this.codemrrConfig.autofocus,placeholder:this.codemrrConfig.placeholder,indentWithTab:this.codemrrConfig.indentWithTab,tabSize:this.codemrrConfig.tabSize,disabled:this.codemrrConfig.disabled,phrases:this.codemrrConfig.phrases==="en-us"?{}:this.codemrrPhrases}}},watch:{codemrrConfig(t){this.$emit("update:config",t)}}},ae={props:{editorID:{type:[String],required:!1,default:()=>""}},data:()=>({editorRefEL:null}),computed:{editorRefID(){return this.editorID?this.editorID:this.$options.name+ +new Date+((1e3*Math.random()).toFixed(0)+"")}}};function Ul(t,o){var a=document.createElement("a");if(a.setAttribute("href","data:text/plain;charset=UTF-8,"+encodeURIComponent(t)),a.setAttribute("download",o),a.style.display="none",document.createEvent){const i=document.createEvent("MouseEvents");i.initEvent("click",!0,!0),a.dispatchEvent(i)}else a.click()}function ve(t){return t<10?"0"+t:t}const jm={undo:!1,redo:!1,strong:!0,italic:!0,overline:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,hr:!0,quote:!0,ul:!0,ol:!0,notChecked:!0,checked:!0,link:!0,table:!0,image:!0,uploadImage:!0,custom_image:!0,custom_uploadImage:!0,custom_uploadFile:!0,importmd:!0,exportmd:!0,code:!0,html_to_markdown:!0,split:!0,preview:!0,scrollSync:!0,save:!0,clear:!0,copy:!0,toc:!0,fullscreen:!0,theme:!0,backgroundColor:!1,language:!1,phrases:!1,disabled:!1,autofocus:!1,indentWithTab:!1},Rm={t:"1713021153946",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1924",width:"20",height:"20"},Um={t:"1599285632421",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"45640",width:"17",height:"17"},Wm={t:"1611551476626",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4615",width:"22",height:"22"},Ym={t:"1713097613984",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"6856",width:"18",height:"18"},Xm={t:"1713109019954",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"13071",width:"18",height:"18"},Qo={components:{SvgImgMap:v({name:"SvgImgMap"},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("svg",Rm,o[0]||(o[0]=[e.createElementVNode("path",{d:"M659.456 786.432l-114.688-188.416c-4.10112-8.192-8.19712-12.28288-16.384-12.28288-4.096 0-8.19712 4.096-12.288 4.096l-57.344 57.344-61.44-90.11712c-4.096-8.192-8.192-12.28288-16.384-12.28288s-12.288 4.096-16.384 8.192l-151.552 225.28c0 4.096-4.096 8.192-4.096 12.288 0 12.28288 8.192 20.48 20.48 20.48h413.696c12.288 0 20.48-8.19712 20.48-20.48l-4.096-4.10112zM286.72 512c40.96 0 73.728-32.768 73.728-73.728S327.68 364.544 286.72 364.544s-73.728 32.768-73.728 73.728C208.896 479.232 245.76 512 286.72 512zM851.968 98.304H323.584c-40.96 0-73.728 32.768-73.728 73.728v20.48c0 12.288 8.192 20.48 20.48 20.48s16.384-12.288 16.384-20.48v-20.48c0-20.48 16.384-36.864 36.864-36.864h528.384c20.48 0 36.85888 16.384 36.85888 36.864v528.384c0 20.48-16.37888 36.864-36.85888 36.864h-20.48c-12.288 0-20.48 8.192-20.48 20.48s8.192 20.48 20.48 20.48h20.48c40.96 0 73.72288-32.768 73.72288-73.728v-532.48c0.00512-40.96-32.76288-73.728-73.72288-73.728z","p-id":"1925"},null,-1),e.createElementVNode("path",{d:"M700.416 249.856H172.032c-40.96 0-73.728 32.768-73.728 73.728v528.384c0 40.96 32.768 73.72288 73.728 73.72288h528.384c40.96 0 73.728-32.76288 73.728-73.72288V323.584c0-40.96-32.768-73.728-73.728-73.728z m36.864 602.112c0 20.48-16.384 36.85888-36.864 36.85888H172.032c-20.48 0-36.864-16.37888-36.864-36.85888V323.584c0-20.48 16.384-36.864 36.864-36.864h528.384c20.48 0 36.864 16.384 36.864 36.864v528.384z","p-id":"1926"},null,-1)]))}]]),SvgUploadFile:v({name:"SvgUploadFile"},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("svg",Um,o[0]||(o[0]=[e.createElementVNode("path",{d:"M127.519 892.879v-763.34h655.448V514.69h63.612V81.831c0-8.783-7.12-15.903-15.903-15.903H79.81c-8.783 0-15.903 7.12-15.903 15.903v858.757c0 8.783 7.12 15.903 15.903 15.903h493.993v-63.612H127.519z","p-id":"45641"},null,-1),e.createElementVNode("path",{d:"M231.608 228.388h447.269V292H231.608zM231.608 384.409h447.269v63.612H231.608zM231.608 540.43h245.141v63.612H231.608zM231.608 696.451h245.141v63.612H231.608zM923.269 762.938L745.315 584.984c-3.545-3.545-8.34-5.074-12.966-4.596a15.931 15.931 0 0 0-9.848 4.616L544.586 762.918c-6.248 6.248-6.248 16.379 0 22.627l22.353 22.353c6.248 6.248 16.379 6.248 22.627 0l112.555-112.555v245.148c0 8.837 7.163 16 16 16h31.612c8.837 0 16-7.163 16-16V695.363l112.555 112.555c6.248 6.248 16.379 6.248 22.627 0l22.353-22.353c6.249-6.248 6.249-16.378 0.001-22.627z","p-id":"45642"},null,-1)]))}]]),SvgToc:v({name:"SvgToc"},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("svg",Wm,o[0]||(o[0]=[e.createElementVNode("path",{d:"M370.1 371.5h-49.6c-3.1 0-5.7-2.5-5.7-5.7v-49.6c0-3.1 2.5-5.7 5.7-5.7h49.6c3.1 0 5.7 2.5 5.7 5.7v49.6c0 3.1-2.6 5.7-5.7 5.7z m333.5-7.6H460.5c-3.1 0-5.7-2.5-5.7-5.7v-34.5c0-3.1 2.5-5.7 5.7-5.7h243.2c3.1 0 5.7 2.5 5.7 5.7v34.5c-0.1 3.2-2.7 5.7-5.8 5.7zM370.1 712.4h-49.6c-3.1 0-5.7-2.5-5.7-5.7v-49.6c0-3.1 2.5-5.7 5.7-5.7h49.6c3.1 0 5.7 2.5 5.7 5.7v49.6c0 3.2-2.6 5.7-5.7 5.7z m333.5-7.5H460.5c-3.1 0-5.7-2.5-5.7-5.7v-34.5c0-3.1 2.5-5.7 5.7-5.7h243.2c3.1 0 5.7 2.5 5.7 5.7v34.5c-0.1 3.1-2.7 5.7-5.8 5.7zM370.1 542.5h-49.6c-3.1 0-5.7-2.5-5.7-5.7v-49.6c0-3.1 2.5-5.7 5.7-5.7h49.6c3.1 0 5.7 2.5 5.7 5.7v49.6c0 3.1-2.6 5.7-5.7 5.7z m333.5-7.6H460.5c-3.1 0-5.7-2.5-5.7-5.7v-34.5c0-3.1 2.5-5.7 5.7-5.7h243.2c3.1 0 5.7 2.5 5.7 5.7v34.5c-0.1 3.2-2.7 5.7-5.8 5.7z","p-id":"4616"},null,-1),e.createElementVNode("path",{d:"M847.1 560.4V250.1s0-24.7-14-46.4c-10.8-16.8-30-31.8-64.2-31.8h-261c-0.2 0-0.3 0-0.5 0.1H255s-78.1 0-78.1 78.1l0.1 213.4V774s0 24.7 13.9 46.3c10.8 16.8 30 31.8 64.2 31.8h261.1c0.2 0 0.3 0 0.5-0.1H769s78.1 0 78.1-78.1l-0.1-213.4 0.1-0.1z m-39 213.6c-1.3 38.5-38.9 39-38.9 39h-514c-1.3-0.1-2.5-0.2-3.8-0.3-5.4-1.1-15.7-4.1-23.9-11.7-9-9.7-11.2-22.3-11.7-26.1v-0.7l0.1-524.2c1.3-38.5 38.9-39 38.9-39h514c1.3 0.1 2.5 0.2 3.7 0.3 5.4 1.1 15.7 4.1 23.9 11.7 9 9.7 11.2 22.2 11.7 26 0 0.2 0 0.5 0.1 0.7l-0.1 524.3z","p-id":"4617"},null,-1)]))}]]),SvgCopy:v({name:"SvgCopy"},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("svg",Ym,o[0]||(o[0]=[e.createElementVNode("path",{d:"M857.373005 65.290005 469.604424 65.290005c-34.211173 0-62.044078 27.832905-62.044078 62.043055l0 10.340509-63.076594 0c-25.993001 0-48.228421 16.346293-57.001225 39.293935L166.626995 176.967504c-34.21015 0-62.043055 27.832905-62.043055 62.043055l0 657.655358c0 34.21015 27.832905 62.043055 62.043055 62.043055l550.115086 0c34.21015 0 62.043055-27.832905 62.043055-62.043055l0-49.634444 78.587869 0c34.21015 0 62.043055-27.832905 62.043055-62.043055L919.41606 127.33306C919.41606 93.122911 891.583155 65.290005 857.373005 65.290005zM344.483752 179.035606l194.402595 0c10.833743 0 19.646456 8.813736 19.646456 19.646456 0 10.833743-8.813736 19.646456-19.646456 19.646456L344.483752 218.328517c-10.833743 0-19.646456-8.813736-19.646456-19.646456C324.836273 187.849342 333.650009 179.035606 344.483752 179.035606zM737.423099 896.665917c0 11.402701-9.278317 20.681018-20.681018 20.681018L166.626995 917.346935c-11.403724 0-20.681018-9.278317-20.681018-20.681018L145.945977 239.010559c0-11.402701 9.277294-20.681018 20.681018-20.681018l120.111588 0c8.197706 24.02723 30.977525 41.362037 57.744145 41.362037l194.402595 0c26.767644 0 49.54644-17.334807 57.744145-41.362037l120.111588 0c11.402701 0 20.681018 9.278317 20.681018 20.681018L737.422076 896.665917zM878.054023 784.988418c0 11.402701-9.278317 20.681018-20.681018 20.681018l-78.587869 0L778.785136 239.010559c0-34.21015-27.832905-62.043055-62.043055-62.043055L595.886549 176.967504c-8.771781-22.947641-31.007201-39.293935-57.001225-39.293935l-89.963964 0L448.921359 127.33306c0-11.403724 9.278317-20.681018 20.683065-20.681018l387.768581 0c11.402701 0 20.681018 9.277294 20.681018 20.681018L878.054023 784.988418z","p-id":"6857"},null,-1),e.createElementVNode("path",{d:"M620.597347 334.252737 260.748652 334.252737c-11.422144 0-20.681018 9.259898-20.681018 20.681018s9.258874 20.681018 20.681018 20.681018l359.849718 0c11.42112 0 20.681018-9.259898 20.681018-20.681018S632.018467 334.252737 620.597347 334.252737z","p-id":"6858"},null,-1),e.createElementVNode("path",{d:"M620.597347 454.201619 260.748652 454.201619c-11.422144 0-20.681018 9.259898-20.681018 20.681018 0 11.42112 9.258874 20.681018 20.681018 20.681018l359.849718 0c11.42112 0 20.681018-9.259898 20.681018-20.681018C641.278365 463.46254 632.018467 454.201619 620.597347 454.201619z","p-id":"6859"},null,-1),e.createElementVNode("path",{d:"M440.673511 574.151525 260.748652 574.151525c-11.422144 0-20.681018 9.259898-20.681018 20.681018 0 11.42112 9.258874 20.681018 20.681018 20.681018l179.924859 0c11.42112 0 20.681018-9.259898 20.681018-20.681018C461.35453 583.411423 452.093609 574.151525 440.673511 574.151525z","p-id":"6860"},null,-1)]))}]]),SvgLanguage:v({name:"SvgLanguage"},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("svg",Xm,o[0]||(o[0]=[e.createElementVNode("path",{d:"M200.313605 806.764028h487.993851v78.708685h-487.993851z",fill:"#6C7280","p-id":"13072"},null,-1),e.createElementVNode("path",{d:"M809.518832 136.166026H79.102229a78.708686 78.708686 0 0 0-78.708686 78.708686V944.504228a78.708686 78.708686 0 0 0 78.708686 78.708685h730.416603a78.708686 78.708686 0 0 0 78.708685-78.708685V214.874712a78.708686 78.708686 0 0 0-78.708685-78.708686z m0 848.479631V944.504228H79.102229V214.874712h730.416603V944.504228z","p-id":"13073"},null,-1),e.createElementVNode("path",{d:"M944.897771 0H171.978478v78.708686H944.897771v787.086856h78.708686V78.708686a78.708686 78.708686 0 0 0-78.708686-78.708686z","p-id":"13074"},null,-1),e.createElementVNode("path",{d:"M360.092237 609.205227h161.352805l44.863951 117.275941h58.244427l-157.417371-385.672559h-55.09608L263.280553 725.694081H315.228286z m57.45734-157.417372a487.206764 487.206764 0 0 0 20.464259-73.986164q8.657955 31.483474 27.548039 78.708686l40.14143 107.043812H375.046887z","p-id":"13075"},null,-1)]))}]])},emits:["on-action","on-act-copy","on-act-save","on-act-theme","on-act-custom","on-act-choose-image"],props:{exportFileName:{type:String,default:""},toolbars:{type:Object,default:()=>({})},isPreview:{type:Boolean,default:!1},isFullscreen:{type:Boolean,default:!1}},data:()=>({actionThemeDropdown:!1,actionPhrasesDropdown:!1,actionLanguageDropdown:!1,actionBgColorDropdown:!1,actionSplit:!0,actionPreview:!1,actionScrollSync:!0,actionToc:!0,actionFullscreen:!1,actionHtmlDiaVisible:!1,actionHtmlText:""}),computed:{lastExpFileName(){let t=new Date,o=t.getFullYear(),a=t.getMonth()+1,i=t.getDate(),l=t.getHours(),n=t.getMinutes(),r=o+"-"+ve(a)+"-"+ve(i)+"_"+ve(l)+"-"+ve(n);return this.exportFileName||r},toolConfig(){const{toolbars:t={}}=this;return{...jm,...t}}},created(){this.actionPreview=this.isPreview||!1},methods:{actionPhrasesSet(t){this.codemrrConfig.phrases=t,this.actionPhrasesDropdown=!1},actionLanguageSet(t){this.codemrrConfig.language=t,this.actionLanguageDropdown=!1},actionBgColorSet(t){this.codemrrConfig.backgroundColor=t,this.actionBgColorDropdown=!1},actionThemesSet(t){this.codemrrConfig.theme=t,this.actionThemeDropdown=!1,this.$emit("on-act-theme",t)},actionFullscreenSet(t){this.actionFullscreen=t;let o=this.$refs[this.editorWrapRefID];t?o.classList.add("fullscreen"):o.classList.remove("fullscreen"),this.actionCurrent("fullscreen",t)},actionChooseImage(){const t=document.createElement("input");t.type="file",t.accept="image/*",t.onchange=()=>{const o=t.files;o[0]&&(this.$emit("on-act-choose-image",o[0]),t.value="")},t.click()},actionInsBg(){const t=this.getLastPoint(),o=t.content||!1;o?this.insertContent("=="+o+"=="):(this.insertContent("===="),this.setCursor(t.line,t.ch+1))},actionUndo(){if(this.editorViewInst){const t=this.editorViewInst.state.behavior(O.EditorState.effect(O.EditorState.undo));this.editorViewInst.update([{changes:{from:0,to:t.doc.length,insert:t.doc},selection:O.EditorSelection.single(0)}])}},actionRedo(){this.editorViewInst&&this.editorViewInst.dispatch({...this.editorViewInst.state,effects:O.EditorState.redo()})},actionInsStrong(){const t=this.getLastPoint(),o=t.content||!1;let a="";o?(a="**"+o+"**",this.deleteContent(t.start,t.end),this.insertContent(t.start,a)):(a="****",this.insertContent(t.start,a)),this.setCursor(t.start+a.length,t.start+a.length)},actionInsItalic(){const t=this.getLastPoint(),o=t.content||!1;let a="";o?(a="*"+o+"*",this.deleteContent(t.start,t.end),this.insertContent(t.start,a)):(a="**",this.insertContent(t.start,a)),this.setCursor(t.start+a.length,t.start+a.length)},actionInsOverline(){const t=this.getLastPoint(),o=t.content||!1;let a="";o?(a="~~"+o+"~~",this.deleteContent(t.start,t.end),this.insertContent(t.start,a)):(a="~~~~",this.insertContent(t.start,a)),this.setCursor(t.start+a.length,t.start+a.length)},actionInsUnderline(){const t=this.getLastPoint(),o=t.content||!1;let a="";o?(a="<u>"+o+"</u>",this.deleteContent(t.start,t.end),this.insertContent(t.start,a)):(a="<u></u>",this.insertContent(t.start,a)),this.setCursor(t.start+a.length,t.start+a.length)},actionInsTitle(t){const o={1:"# ",2:"## ",3:"### ",4:"#### ",5:"##### ",6:"###### "}[t],a=this.getLastPoint(),i=a.content||!1;let l=`
|
|
8
8
|
`+o+`标题
|
|
9
9
|
|
|
10
10
|
`;i?i.startsWith("#")?this.insertContent(a.end+1,l):(l=`
|
|
@@ -30,11 +30,11 @@ row 2 col 1 | row 2 col 2
|
|
|
30
30
|
`,this.insertContent(t.end,o),this.setCursor(t.start+77,t.start+77)},actionInsImage(){const t=this.getLastPoint();let o="";o=`
|
|
31
31
|
|
|
32
32
|
`,this.insertContent(t.end,o),this.setCursor(t.start+48,t.start+48)},actionImportFile(t){const o=t.target.files[0];if(!o)return;const{type:a}=o;if(!["text/markdown","text/src"].includes(a))return;const i=new FileReader;i.readAsText(o,{encoding:"utf-8"}),i.onload=()=>{this.localVal=i.result},i.onerror=l=>{}},actionExportFile(){let t=".text";const o={java:".java",php:".php",css:".css",vue:".vue",go:".go",python:".py",json:".json",javascript:".js",js:".js",html:".html",markdown:".md"};this.language&&o[this.language]&&(t=o[this.language]),Ul(this.localVal,this.lastExpFileName+t)},insertCode(){const t=this.getLastPoint(),o=t.content||!1;let a="";o?(a="\n```text\n"+o+"\n```\n",this.deleteContent(t.start,t.end),this.insertContent(t.start,a)):(a="\n```text\n\n```\n",this.insertContent(t.start,a)),this.setCursor(t.start+a.length,t.start+a.length)},actionSaveSet(){const{localVal:t,codemrrConfig:o,lastHtml:a}=this;this.$emit("on-act-save",{theme:o.theme||"",value:t||"",html:a||""})},actionCopySet(){this.$cvCopy(this.localVal),this.$emit("on-act-copy",this.localVal)},actionHtmlVisible(t){this.actionHtmlText="",this.actionHtmlDiaVisible=!!t},actionHtmlToMD(){const t=this.getLastPoint();let o="";o=`
|
|
33
|
-
`+bn(this.actionHtmlText),this.insertContent(t.end,o),this.setCursor(t.start+o.length,t.start+o.length),this.actionHtmlText="",this.actionHtmlDiaVisible=!1},actionCurrent(t,o){this.$emit("on-action",t,o)},actionCustom(t){this.$emit("on-act-custom",t)}}},Xm={name:"cvEditorCode",mixins:[Rl,ae,Qo],emits:["update:modelValue","on-ready"],props:{modelValue:{type:[String,Number],default:""},options:{type:[Object],default:()=>({autoRefresh:!0,autofocus:!1,lineNumbers:!0,tabSize:4,indentUnit:2,line:!0,styleActiveLine:!0})},toolbars:{type:[Object],default:()=>({})},language:{type:[String],default:""},theme:{type:[String],default:"oneDark"},readOnly:{type:[Boolean],default:!1},autoSave:{type:[Boolean],default:!1},width:{type:[Number,String],default:"auto"},height:{type:[Number,String],default:600},bordered:{type:[Boolean],default:!0}},data:()=>({localVal:"",heightMainPx:"",editorWrapRefEL:null}),watch:{localVal(t){this.$emit("update:modelValue",t)},modelValue(t){this.localVal!=t&&(this.localVal=t)},height(t){this.heightMainPx=this.getHeightMainPx()}},computed:{editorWrapRefID(){return this.editorRefID+"wrap"},heightTotalPx(){let t=""+this.height;return t.includes("%")||t.includes("px")?t:t+"px"},widthTotalPx(){let t=""+this.width;return t.includes("px")?t:t+"px"}},created(){this.localVal=this.modelValue,this.codemrrConfig.disabled=this.readOnly||!1},mounted(){this.heightMainPx=this.getHeightMainPx(),this.optionLanguage.includes(this.language)&&(this.codemrrConfig.language=this.language),this.optionTheme.includes(this.theme)&&(this.codemrrConfig.theme=this.theme)},destroyed(){},methods:{getHeightMainPx(){this.editorWrapRefEL=this.$refs[this.editorWrapRefID];const t=this.editorWrapRefEL.querySelector(".cv-editor-code-toolbar").offsetHeight;return t?this.heightTotalPx.includes("%")?`calc(100% - ${t}px - 2px)`:this.heightTotalPx.replace("px","")-t-2+"px":this.heightTotalPx},consoleLog(t,o){},initEditorReady(t){const{container:o,state:a,view:i}=t;this.editorStateInst=a,this.editorViewInst=i,this.listerenEvent(),this.$emit("on-ready")},listerenEvent(){}}},qm={key:0,class:"cv-editor-code-toolbar","data-title":"头部工具栏"},Km={class:"cv-editor-toolbars"},Gm={name:"导入文件",class:"import-file"},Zm={name:"保存到本地"},Qm={key:1,class:"shift-theme",name:"主题"},Jm=["onClick"],eu={class:"shift-theme",name:"语言"},tu=["onClick"],ou={class:"icon-svg"},au={key:5,class:"segmentation"},lu=["name"],nu={title:"编辑器",class:"cv-editor-code-main"},qt=v(Xm,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("SvgLanguage"),c=e.resolveComponent("SvgCopy"),h=e.resolveComponent("CodemirrorEditor");return e.openBlock(),e.createElementBlock("div",{ref:n.editorWrapRefID,class:e.normalizeClass(["cv-editor-code-wrap cv-editor-vars",a.bordered?"border":""]),style:e.normalizeStyle({width:n.widthTotalPx,height:n.heightTotalPx})},[t.actionPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",qm,[e.createElementVNode("ul",Km,[t.$slots.title?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("li",null,[e.renderSlot(t.$slots,"title")]),o[16]||(o[16]=e.createElementVNode("li",{class:"segmentation"},[e.createElementVNode("div")],-1))],64)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("li",Gm,[e.createElementVNode("span",{class:"iconfont icon-daoru",onClick:o[0]||(o[0]=(...d)=>t.actionImportFile&&t.actionImportFile(...d))}),e.createElementVNode("input",{type:"file",onChange:o[1]||(o[1]=d=>t.actionImportFile(d)),accept:"text/markdown"},null,32)],512),[[e.vShow,t.toolConfig.importmd]]),e.withDirectives(e.createElementVNode("li",Zm,[e.createElementVNode("span",{class:"iconfont icon-download",onClick:o[2]||(o[2]=(...d)=>t.actionExportFile&&t.actionExportFile(...d))})],512),[[e.vShow,t.toolConfig.exportmd]]),o[20]||(o[20]=e.createElementVNode("li",{class:"segmentation"},[e.createElementVNode("div")],-1)),t.toolConfig.theme?(e.openBlock(),e.createElementBlock("li",Qm,[e.createElementVNode("span",{class:"iconfont icon-theme",onClick:o[3]||(o[3]=d=>t.actionThemeDropdown=!t.actionThemeDropdown)}),e.createElementVNode("ul",{class:e.normalizeClass({active:t.actionThemeDropdown}),onMouseleave:o[4]||(o[4]=d=>t.actionThemeDropdown=!1)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.optionTheme,d=>(e.openBlock(),e.createElementBlock("li",{onClick:p=>t.actionThemesSet(d)},e.toDisplayString(d),9,Jm))),256))],34)])):e.createCommentVNode("",!0),e.createElementVNode("li",eu,[e.createElementVNode("span",{class:"icon-svg",onClick:o[5]||(o[5]=d=>t.actionLanguageDropdown=!t.actionLanguageDropdown)},[e.createVNode(r)]),e.createElementVNode("ul",{class:e.normalizeClass({active:t.actionLanguageDropdown}),onMouseleave:o[6]||(o[6]=d=>t.actionLanguageDropdown=!1)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.optionLanguage,d=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(d==a.language?"active":""),onClick:p=>t.actionLanguageSet(d)},e.toDisplayString(d),11,tu))),256))],34)]),o[21]||(o[21]=e.createElementVNode("li",{class:"empty"},null,-1)),t.toolConfig.copy?(e.openBlock(),e.createElementBlock("li",{key:2,name:"复制",onClick:o[7]||(o[7]=(...d)=>t.actionCopySet&&t.actionCopySet(...d))},[e.createElementVNode("span",ou,[e.createVNode(c)])])):e.createCommentVNode("",!0),t.toolConfig.clear?(e.openBlock(),e.createElementBlock("li",{key:3,name:"清空",onClick:o[8]||(o[8]=d=>l.localVal="")},o[17]||(o[17]=[e.createElementVNode("span",{class:"iconfont icon-clear"},null,-1)]))):e.createCommentVNode("",!0),t.toolConfig.save?(e.openBlock(),e.createElementBlock("li",{key:4,name:"保存",onClick:o[9]||(o[9]=(...d)=>t.actionSaveSet&&t.actionSaveSet(...d))},o[18]||(o[18]=[e.createElementVNode("span",{class:"iconfont icon-save"},null,-1)]))):e.createCommentVNode("",!0),t.toolConfig.fullscreen?(e.openBlock(),e.createElementBlock("li",au,o[19]||(o[19]=[e.createElementVNode("div",null,null,-1)]))):e.createCommentVNode("",!0),t.toolConfig.fullscreen?(e.openBlock(),e.createElementBlock("li",{key:6,name:t.actionFullscreen?"退出全屏":"全屏"},[e.withDirectives(e.createElementVNode("span",{onClick:o[10]||(o[10]=d=>t.actionFullscreenSet(!1)),class:"iconfont icon-quite"},null,512),[[e.vShow,t.actionFullscreen]]),e.withDirectives(e.createElementVNode("span",{onClick:o[11]||(o[11]=d=>t.actionFullscreenSet(!0)),class:"iconfont icon-fullscreen"},null,512),[[e.vShow,!t.actionFullscreen]])],8,lu)):e.createCommentVNode("",!0)])])),e.createElementVNode("div",nu,[e.createVNode(h,e.mergeProps(t.codemrrBind,{id:t.editorRefID,ref:t.editorRefID,style:{height:l.heightMainPx,backgroundColor:t.codemrrConfig.backgroundColor},extensions:t.extensions,modelValue:l.localVal,"onUpdate:modelValue":o[12]||(o[12]=d=>l.localVal=d),onReady:n.initEditorReady,onChange:o[13]||(o[13]=d=>n.consoleLog("change",d)),onFocus:o[14]||(o[14]=d=>n.consoleLog("focus",d)),onBlur:o[15]||(o[15]=d=>n.consoleLog("blur",d))}),null,16,["id","style","extensions","modelValue","onReady"])])],6)}]]),Kt=v({name:"cvEditorJson",components:{},mixins:[ae],props:{modelValue:{type:[Object,Array,Number,String,Boolean],default:""},mode:{type:[String],default:"text"},readOnly:{type:[Boolean],default:!1},options:{type:[Object],default:()=>({mode:"text"})},height:{type:String},plus:{type:Boolean,default:!0}},data:()=>({editorInstance:null,style:{},max:!1,internalChange:!1,localVal:""}),watch:{modelValue:{handler(t){this.localVal!=t&&(this.localVal=t,this.updateVal(t))},deep:!0},max(t){this.$nextTick(()=>{this.initNewCreate()})},options:{handler(t){this.options&&this.options.mode&&this.editorInstance},deep:!0}},computed:{getHeight(){return this.height&&!this.max?{height:this.height}:{}}},async mounted(){this.initNewCreate()},updated(){this.editorInstance.updateProps({mode:this.mode,readOnly:this.readOnly})},beforeUnmount(){this.destroyView()},beforeDestroy(){this.destroyView()},methods:{async initNewCreate(){const{JSONEditor:t}=await import("https://10ui.cn/jsoneditor/vanilla-jsoneditor@0.22.0/standalone.js");this.editorInstance||(this.editorInstance=new t({target:this.$refs[this.editorRefID],props:{value:this.modelValue,mode:this.mode,readOnly:this.readOnly,...this.options,onChange:this.onChange}}),this.updateVal(this.modelValue))},onChange(){let t=null,o={};try{o=this.editorInstance.get()}catch(a){t=a}t?this.$emit("error",t):this.editorInstance&&(this.internalChange=!0,this.localVal=o,this.$emit("update:modelValue",this.localVal),this.$nextTick(()=>{this.internalChange=!1}))},updateVal(t){this.editorInstance&&t!==void 0&&!this.internalChange&&this.editorInstance.update({json:t})},isJSON(t){try{return JSON.parse(t),!0}catch{return!1}},destroyView(){this.editor&&(this.editorInstance.destroy(),this.editor=null)},handleChange(t){this.emitData||(this.emitData=Dl(400,o=>{this.$emit("update:modelValue",o)})),this.emitData(t)}}},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cv-editor-json",{"max-box":l.max,"min-box":!l.max}]),style:e.normalizeStyle(n.getHeight)},[e.createElementVNode("div",{ref:t.editorRefID,class:"jsoneditor-box"},null,512),e.createElementVNode("a",{onClick:o[0]||(o[0]=r=>l.max=!l.max),class:"max-btn"})],6)}]]),iu={class:"cv-editor-upload-container"},ru=["advlist","anchor","autolink","autosave","code","codesample","directionality","emoticons","fullscreen","image","insertdatetime","link","lists","media","nonbreaking","pagebreak","preview","save","searchreplace","table","visualblocks","visualchars","wordcount"],su=["hr blockquote anchor pagebreak insertdatetime table emoticons | searchreplace preview code codesample | fullscreen | link media image ","inserttemplate undo redo | styles | removeformat subscript superscript forecolor backcolor bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist indent"];let ee=[];const cu=(t,o)=>{const a=document.getElementById(t),i=o||function(){};if(!a){const l=document.createElement("script");l.src=t,l.id=t,document.body.appendChild(l),ee.push(i),("onload"in l?function(r){r.onload=function(){this.onerror=this.onload=null;for(const c of ee)c(null,r);ee=null},r.onerror=function(){this.onerror=this.onload=null,i(new Error("Failed to load "+t),r)}}:function(r){r.onreadystatechange=function(){if(this.readyState==="complete"||this.readyState==="loaded"){this.onreadystatechange=null;for(const c of ee)c(null,r);ee=null}}})(l)}a&&i&&(window.tinymce?i(null,a):ee.push(i))},du=["id"],hu={class:"editor-custom-btn-container"},Gt=v({inheritAttrs:!1,name:"cvEditorTinymce",components:{EditorSlideUpload:v({name:"EditorSlideUpload",props:{color:{type:String,default:"#1890ff"},accept:{type:[String],default:"image/jpeg,image/gif,image/png"},upName:{type:[String],default:""},upAction:{type:[String],default:""},upResponseFn:{type:[Function],default:()=>{}},upHeaders:{type:[Object],default:()=>{}},upData:{type:[Object],default:()=>{}}},data:()=>({dialogVisible:!1,listObj:{},fileList:[],diyUpList:new FormData}),methods:{checkAllSuccess(){return Object.keys(this.listObj).every(t=>this.listObj[t].hasSuccess)},handleSubmit(){const t=Object.keys(this.listObj).map(o=>this.listObj[o]);this.checkAllSuccess()?(this.$emit("successCBK",t),this.listObj={},this.fileList=[],this.dialogVisible=!1):this.$message("请等待所有图片上传成功。如果出现网络问题,请刷新页面并重新上传!")},handleSuccess(t,o){const a=o.uid,i=Object.keys(this.listObj);for(let l=0,n=i.length;l<n;l++)if(this.listObj[i[l]].uid===a)return this.upResponseFn&&typeof this.upResponseFn=="function"?this.listObj[i[l]].url=this.upResponseFn(t):this.listObj[i[l]].url=t.files.file||"",void(this.listObj[i[l]].hasSuccess=!0)},handleRemove(t){const o=t.uid,a=Object.keys(this.listObj);for(let i=0,l=a.length;i<l;i++)if(this.listObj[a[i]].uid===o)return void delete this.listObj[a[i]]},beforeUpload(t){const o=this,a=window.URL||window.webkitURL,i=t.uid;return this.listObj[i]={},new Promise((l,n)=>{const r=new Image;r.src=a.createObjectURL(t),r.onload=function(){o.listObj[i]={hasSuccess:!1,uid:t.uid,width:this.width,height:this.height}},l(!0)})}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("cv-icons"),c=e.resolveComponent("el-button"),h=e.resolveComponent("el-upload"),d=e.resolveComponent("el-dialog");return e.openBlock(),e.createElementBlock("div",iu,[e.createVNode(c,{style:e.normalizeStyle({background:a.color,borderColor:a.color,fontSize:"16px"}),type:"primary",onClick:o[0]||(o[0]=p=>l.dialogVisible=!0)},{default:e.withCtx(()=>[e.createVNode(r,{type:"ElIconUpload",size:"16",style:{"margin-right":"5px"}}),o[2]||(o[2]=e.createTextVNode(" 上传 "))]),_:1,__:[2]},8,["style"]),e.createVNode(d,{visible:l.dialogVisible},{default:e.withCtx(()=>[e.createVNode(h,e.mergeProps({class:"editor-slide-upload"},{action:a.upAction,headers:a.upHeaders,data:a.upData,name:a.upName,multiple:!0,showFileList:!0,listType:"picture-card",autoUpload:!0},{"file-list":l.fileList,"on-remove":n.handleRemove,"on-success":n.handleSuccess,"before-upload":n.beforeUpload}),{default:e.withCtx(()=>[e.createVNode(c,{type:"primary"},{default:e.withCtx(()=>o[3]||(o[3]=[e.createTextVNode("点击上传")])),_:1,__:[3]})]),_:1},16,["file-list","on-remove","on-success","before-upload"]),e.createVNode(c,{onClick:o[1]||(o[1]=p=>l.dialogVisible=!1)},{default:e.withCtx(()=>o[4]||(o[4]=[e.createTextVNode("取消")])),_:1,__:[4]}),e.createVNode(c,{type:"primary",onClick:n.handleSubmit},{default:e.withCtx(()=>o[5]||(o[5]=[e.createTextVNode("确定")])),_:1,__:[5]},8,["onClick"])]),_:1},8,["visible"])])}]])},emits:["update:modelValue"],mixins:[ae],props:{modelValue:{type:String,default:""},toolbar:{type:Array,required:!1,default:()=>[]},menubar:{type:String,default:"file edit insert view format table"},height:{type:[Number,String],required:!1,default:360},width:{type:[Number,String],required:!1,default:"100%"},uploadAttr:{type:[Object],default:()=>({})}},data:()=>({localVal:"",fullscreen:!1,languageTypeList:{en:"en",zh:"zh_CN",es:"es_MX",ja:"ja"}}),computed:{containerWidth(){const t=this.width;return/^[\d]+(\.[\d]+)?$/.test(t)?`${t}px`:t}},watch:{modelValue(t){this.localVal!=t&&(this.localVal=t,window.tinymce.get(this.editorRefID).setContent(t||""))}},created(){this.localVal=this.modelValue},mounted(){this.initLoad()},activated(){window.tinymce&&this.initTinymce()},deactivated(){this.destroyTinymce()},destroyed(){this.destroyTinymce()},methods:{initLoad(){cu("https://10ui.cn/tinymce/@7.0.0/tinymce.min.js",t=>{t?this.$message.error(t.message):this.initTinymce()})},initTinymce(){const t=this;window.tinymce.init({selector:`#${this.editorRefID}`,license_key:"gpl",language:this.languageTypeList.zh,height:this.height,body_class:"panel-body ",object_resizing:!1,toolbar:this.toolbar.length>0?this.toolbar:su,menubar:this.menubar,plugins:ru,end_container_on_empty_block:!0,powerpaste_word_import:"clean",code_dialog_height:450,code_dialog_width:1e3,advlist_bullet_styles:"square",advlist_number_styles:"default",editimage_cors_hosts:["www.tinymce.com","codepen.io"],link_default_target:"_blank",link_title:!1,nonbreaking_force_tab:!0,init_instance_callback:o=>{t.localVal&&o.setContent(t.localVal)},setup(o){o.on("FullscreenStateChanged",a=>{t.fullscreen=a.state}),o.on("input",a=>{t.localVal=o.getContent(),t.$emit("update:modelValue",t.localVal)})},convert_urls:!1,images_upload_handler(o,a,i,l){l(0),new FormData}})},destroyTinymce(){const t=window.tinymce.get(this.editorRefID);this.fullscreen&&t.execCommand("mceFullScreen"),t&&t.destroy()},setContent(t){window.tinymce.get(this.editorRefID).setContent(t)},getContent(){window.tinymce.get(this.editorRefID).getContent()},imageSuccessCBK(t){t.forEach(o=>window.tinymce.get(this.editorRefID).insertContent(`<img class="wscnph" src="${o.url}" >`))}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("EditorSlideUpload");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cv-editor-tinymce tinymce-container",{fullscreen:l.fullscreen}]),style:e.normalizeStyle({width:n.containerWidth})},[e.createElementVNode("textarea",{id:t.editorRefID,class:"tinymce-textarea"},null,8,du),e.createElementVNode("div",hu,[e.createVNode(r,e.mergeProps({color:"#1890ff",class:"editor-upload-btn",onSuccessCBK:n.imageSuccessCBK},a.uploadAttr),null,16,["onSuccessCBK"])])],6)}],["__scopeId","data-v-8cbc5d06"]]),pu={name:"cvEditorMarkdown",mixins:[Rl,ae,Qo],emits:["update:modelValue","on-ready","on-upload-image"],props:{modelValue:{type:[String,Number],default:""},options:{type:[Object],default:()=>({})},toolbars:{type:[Object],default:()=>({})},language:{type:[String],default:"markdown"},theme:{type:[String],default:"light"},readOnly:{type:[Boolean],default:!1},autoSave:{type:[Boolean],default:!1},width:{type:[Number,String],default:"auto"},height:{type:[Number,String],default:600},bordered:{type:[Boolean],default:!0}},data:()=>({lastPos:"",lastInsert:"",lastHtml:"",scrollSide:"",localVal:"",heightMainPx:"",editorWrapRefEL:null}),watch:{localVal(t){this.$emit("update:modelValue",t)},modelValue(t){this.localVal!=t&&(this.localVal=t)},height(t){this.heightMainPx=this.getHeightMainPx()}},computed:{editorWrapRefID(){return this.editorRefID+"wrap"},previewRefID(){return this.editorRefID+"preview"},heightTotalPx(){let t=""+this.height;return t.includes("%")||t.includes("px")?t:t+"px"},widthTotalPx(){let t=""+this.width;return t.includes("px")?t:t+"px"}},created(){this.localVal=this.modelValue,this.codemrrConfig.disabled=this.readOnly||!1},mounted(){this.heightMainPx=this.getHeightMainPx()},destroyed(){},methods:{getHeightMainPx(){this.editorWrapRefEL=this.$refs[this.editorWrapRefID];const t=this.editorWrapRefEL.querySelector(".cv-editor-markdown-toolbar").offsetHeight;return t?this.heightTotalPx.includes("%")?`calc(100% - ${t}px - 2px)`:this.heightTotalPx.replace("px","")-t-2+"px":this.heightTotalPx},consoleLog(t,o){},initEditorReady(t){const{container:o,state:a,view:i}=t;this.editorStateInst=a,this.editorViewInst=i,this.listerenEvent(),this.$emit("on-ready")},listerenEvent(){this.editorWrapRefEL=this.$refs[this.editorWrapRefID],this.editorWrapRefEL.querySelector(".cv-editor-markdown-main .cm-scroller").addEventListener("scroll",this.markdownScroll),this.editorWrapRefEL.querySelector(".cv-markdown-preview .markdown-preview").addEventListener("scroll",this.previewScroll)},handlePaste(t,o){const{clipboardData:a={}}=o,{types:i=[],items:l}=a;let n=null;for(let r=0;r<i.length;r++)if(i[r]==="Files"){n=l[r];break}if(n){const r=n.getAsFile();/image/gi.test(r.type)&&(this.$emit("on-upload-image",r),o.preventDefault())}},setCursor(t,o){this.editorViewInst.dispatch({selection:{anchor:t,head:o}}),this.editorViewInst.focus()},GetContent(){const t=this.editorViewState.selection.main.head,o=this.editorViewState.doc.lineAt(t).number,a=this.editorViewState.doc.line(o).text.trim();return a!==""&&a},deleteContent(t,o){this.editorViewInst.dispatch({changes:{from:t,to:o}})},getLastPoint(){const t=this.editorViewInst.state.selection.main.head,o=this.editorViewInst.state.doc.lineAt(t).number,a=this.editorViewInst.state.doc.line(o).from,i=this.editorViewInst.state.doc.line(o).to,l=this.editorViewInst.state.doc.line(o).text;return this.lastPos||{line:o,start:a,end:i,content:l}},insertContent(t,o){this.getLastPoint(),this.editorViewInst.dispatch({changes:{from:t,insert:o}})},listerenKeyupEnter(t){const{lastInsert:o}=this;o&&(["-","- [ ]","- [x]"].includes(o.trim())?(t.preventDefault(),this.insertContent(`
|
|
33
|
+
`+bn(this.actionHtmlText),this.insertContent(t.end,o),this.setCursor(t.start+o.length,t.start+o.length),this.actionHtmlText="",this.actionHtmlDiaVisible=!1},actionCurrent(t,o){this.$emit("on-action",t,o)},actionCustom(t){this.$emit("on-act-custom",t)}}},qm={name:"cvEditorCode",mixins:[Rl,ae,Qo],emits:["update:modelValue","on-ready"],props:{modelValue:{type:[String,Number],default:""},options:{type:[Object],default:()=>({autoRefresh:!0,autofocus:!1,lineNumbers:!0,tabSize:4,indentUnit:2,line:!0,styleActiveLine:!0})},toolbars:{type:[Object],default:()=>({})},language:{type:[String],default:""},theme:{type:[String],default:"oneDark"},readOnly:{type:[Boolean],default:!1},autoSave:{type:[Boolean],default:!1},width:{type:[Number,String],default:"auto"},height:{type:[Number,String],default:600},bordered:{type:[Boolean],default:!0}},data:()=>({localVal:"",heightMainPx:"",editorWrapRefEL:null}),watch:{localVal(t){this.$emit("update:modelValue",t)},modelValue(t){this.localVal!=t&&(this.localVal=t)},height(t){this.heightMainPx=this.getHeightMainPx()}},computed:{editorWrapRefID(){return this.editorRefID+"wrap"},heightTotalPx(){let t=""+this.height;return t.includes("%")||t.includes("px")?t:t+"px"},widthTotalPx(){let t=""+this.width;return t.includes("px")?t:t+"px"}},created(){this.localVal=this.modelValue,this.codemrrConfig.disabled=this.readOnly||!1},mounted(){this.heightMainPx=this.getHeightMainPx(),this.optionLanguage.includes(this.language)&&(this.codemrrConfig.language=this.language),this.optionTheme.includes(this.theme)&&(this.codemrrConfig.theme=this.theme)},destroyed(){},methods:{getHeightMainPx(){this.editorWrapRefEL=this.$refs[this.editorWrapRefID];const t=this.editorWrapRefEL.querySelector(".cv-editor-code-toolbar").offsetHeight;return t?this.heightTotalPx.includes("%")?`calc(100% - ${t}px - 2px)`:this.heightTotalPx.replace("px","")-t-2+"px":this.heightTotalPx},consoleLog(t,o){},initEditorReady(t){const{container:o,state:a,view:i}=t;this.editorStateInst=a,this.editorViewInst=i,this.listerenEvent(),this.$emit("on-ready")},listerenEvent(){}}},Km={key:0,class:"cv-editor-code-toolbar","data-title":"头部工具栏"},Gm={class:"cv-editor-toolbars"},Zm={name:"导入文件",class:"import-file"},Qm={name:"保存到本地"},Jm={key:1,class:"shift-theme",name:"主题"},eu=["onClick"],tu={class:"shift-theme",name:"语言"},ou=["onClick"],au={class:"icon-svg"},lu={key:5,class:"segmentation"},nu=["name"],iu={title:"编辑器",class:"cv-editor-code-main"},qt=v(qm,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("SvgLanguage"),c=e.resolveComponent("SvgCopy"),h=e.resolveComponent("CodemirrorEditor");return e.openBlock(),e.createElementBlock("div",{ref:n.editorWrapRefID,class:e.normalizeClass(["cv-editor-code-wrap cv-editor-vars",a.bordered?"border":""]),style:e.normalizeStyle({width:n.widthTotalPx,height:n.heightTotalPx})},[t.actionPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Km,[e.createElementVNode("ul",Gm,[t.$slots.title?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("li",null,[e.renderSlot(t.$slots,"title")]),o[16]||(o[16]=e.createElementVNode("li",{class:"segmentation"},[e.createElementVNode("div")],-1))],64)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("li",Zm,[e.createElementVNode("span",{class:"iconfont icon-daoru",onClick:o[0]||(o[0]=(...d)=>t.actionImportFile&&t.actionImportFile(...d))}),e.createElementVNode("input",{type:"file",onChange:o[1]||(o[1]=d=>t.actionImportFile(d)),accept:"text/markdown"},null,32)],512),[[e.vShow,t.toolConfig.importmd]]),e.withDirectives(e.createElementVNode("li",Qm,[e.createElementVNode("span",{class:"iconfont icon-download",onClick:o[2]||(o[2]=(...d)=>t.actionExportFile&&t.actionExportFile(...d))})],512),[[e.vShow,t.toolConfig.exportmd]]),o[20]||(o[20]=e.createElementVNode("li",{class:"segmentation"},[e.createElementVNode("div")],-1)),t.toolConfig.theme?(e.openBlock(),e.createElementBlock("li",Jm,[e.createElementVNode("span",{class:"iconfont icon-theme",onClick:o[3]||(o[3]=d=>t.actionThemeDropdown=!t.actionThemeDropdown)}),e.createElementVNode("ul",{class:e.normalizeClass({active:t.actionThemeDropdown}),onMouseleave:o[4]||(o[4]=d=>t.actionThemeDropdown=!1)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.optionTheme,d=>(e.openBlock(),e.createElementBlock("li",{onClick:p=>t.actionThemesSet(d)},e.toDisplayString(d),9,eu))),256))],34)])):e.createCommentVNode("",!0),e.createElementVNode("li",tu,[e.createElementVNode("span",{class:"icon-svg",onClick:o[5]||(o[5]=d=>t.actionLanguageDropdown=!t.actionLanguageDropdown)},[e.createVNode(r)]),e.createElementVNode("ul",{class:e.normalizeClass({active:t.actionLanguageDropdown}),onMouseleave:o[6]||(o[6]=d=>t.actionLanguageDropdown=!1)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.optionLanguage,d=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(d==a.language?"active":""),onClick:p=>t.actionLanguageSet(d)},e.toDisplayString(d),11,ou))),256))],34)]),o[21]||(o[21]=e.createElementVNode("li",{class:"empty"},null,-1)),t.toolConfig.copy?(e.openBlock(),e.createElementBlock("li",{key:2,name:"复制",onClick:o[7]||(o[7]=(...d)=>t.actionCopySet&&t.actionCopySet(...d))},[e.createElementVNode("span",au,[e.createVNode(c)])])):e.createCommentVNode("",!0),t.toolConfig.clear?(e.openBlock(),e.createElementBlock("li",{key:3,name:"清空",onClick:o[8]||(o[8]=d=>l.localVal="")},o[17]||(o[17]=[e.createElementVNode("span",{class:"iconfont icon-clear"},null,-1)]))):e.createCommentVNode("",!0),t.toolConfig.save?(e.openBlock(),e.createElementBlock("li",{key:4,name:"保存",onClick:o[9]||(o[9]=(...d)=>t.actionSaveSet&&t.actionSaveSet(...d))},o[18]||(o[18]=[e.createElementVNode("span",{class:"iconfont icon-save"},null,-1)]))):e.createCommentVNode("",!0),t.toolConfig.fullscreen?(e.openBlock(),e.createElementBlock("li",lu,o[19]||(o[19]=[e.createElementVNode("div",null,null,-1)]))):e.createCommentVNode("",!0),t.toolConfig.fullscreen?(e.openBlock(),e.createElementBlock("li",{key:6,name:t.actionFullscreen?"退出全屏":"全屏"},[e.withDirectives(e.createElementVNode("span",{onClick:o[10]||(o[10]=d=>t.actionFullscreenSet(!1)),class:"iconfont icon-quite"},null,512),[[e.vShow,t.actionFullscreen]]),e.withDirectives(e.createElementVNode("span",{onClick:o[11]||(o[11]=d=>t.actionFullscreenSet(!0)),class:"iconfont icon-fullscreen"},null,512),[[e.vShow,!t.actionFullscreen]])],8,nu)):e.createCommentVNode("",!0)])])),e.createElementVNode("div",iu,[e.createVNode(h,e.mergeProps(t.codemrrBind,{id:t.editorRefID,ref:t.editorRefID,style:{height:l.heightMainPx,backgroundColor:t.codemrrConfig.backgroundColor},extensions:t.extensions,modelValue:l.localVal,"onUpdate:modelValue":o[12]||(o[12]=d=>l.localVal=d),onReady:n.initEditorReady,onChange:o[13]||(o[13]=d=>n.consoleLog("change",d)),onFocus:o[14]||(o[14]=d=>n.consoleLog("focus",d)),onBlur:o[15]||(o[15]=d=>n.consoleLog("blur",d))}),null,16,["id","style","extensions","modelValue","onReady"])])],6)}]]),Kt=v({name:"cvEditorJson",components:{},mixins:[ae],props:{modelValue:{type:[Object,Array,Number,String,Boolean],default:""},mode:{type:[String],default:"text"},readOnly:{type:[Boolean],default:!1},options:{type:[Object],default:()=>({mode:"text"})},height:{type:String},plus:{type:Boolean,default:!0}},data:()=>({editorInstance:null,style:{},max:!1,internalChange:!1,localVal:""}),watch:{modelValue:{handler(t){this.localVal!=t&&(this.localVal=t,this.updateVal(t))},deep:!0},max(t){this.$nextTick(()=>{this.initNewCreate()})},options:{handler(t){this.options&&this.options.mode&&this.editorInstance},deep:!0}},computed:{getHeight(){return this.height&&!this.max?{height:this.height}:{}}},async mounted(){this.initNewCreate()},updated(){this.editorInstance.updateProps({mode:this.mode,readOnly:this.readOnly})},beforeUnmount(){this.destroyView()},beforeDestroy(){this.destroyView()},methods:{async initNewCreate(){const{JSONEditor:t}=await import("https://10ui.cn/jsoneditor/vanilla-jsoneditor@0.22.0/standalone.js");this.editorInstance||(this.editorInstance=new t({target:this.$refs[this.editorRefID],props:{value:this.modelValue,mode:this.mode,readOnly:this.readOnly,...this.options,onChange:this.onChange}}),this.updateVal(this.modelValue))},onChange(){let t=null,o={};try{o=this.editorInstance.get()}catch(a){t=a}t?this.$emit("error",t):this.editorInstance&&(this.internalChange=!0,this.localVal=o,this.$emit("update:modelValue",this.localVal),this.$nextTick(()=>{this.internalChange=!1}))},updateVal(t){this.editorInstance&&t!==void 0&&!this.internalChange&&this.editorInstance.update({json:t})},isJSON(t){try{return JSON.parse(t),!0}catch{return!1}},destroyView(){this.editor&&(this.editorInstance.destroy(),this.editor=null)},handleChange(t){this.emitData||(this.emitData=Dl(400,o=>{this.$emit("update:modelValue",o)})),this.emitData(t)}}},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cv-editor-json",{"max-box":l.max,"min-box":!l.max}]),style:e.normalizeStyle(n.getHeight)},[e.createElementVNode("div",{ref:t.editorRefID,class:"jsoneditor-box"},null,512),e.createElementVNode("a",{onClick:o[0]||(o[0]=r=>l.max=!l.max),class:"max-btn"})],6)}]]),ru={class:"cv-editor-upload-container"},su=["advlist","anchor","autolink","autosave","code","codesample","directionality","emoticons","fullscreen","image","insertdatetime","link","lists","media","nonbreaking","pagebreak","preview","save","searchreplace","table","visualblocks","visualchars","wordcount"],cu=["hr blockquote anchor pagebreak insertdatetime table emoticons | searchreplace preview code codesample | fullscreen | link media image ","inserttemplate undo redo | styles | removeformat subscript superscript forecolor backcolor bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist indent"];let ee=[];const du=(t,o)=>{const a=document.getElementById(t),i=o||function(){};if(!a){const l=document.createElement("script");l.src=t,l.id=t,document.body.appendChild(l),ee.push(i),("onload"in l?function(r){r.onload=function(){this.onerror=this.onload=null;for(const c of ee)c(null,r);ee=null},r.onerror=function(){this.onerror=this.onload=null,i(new Error("Failed to load "+t),r)}}:function(r){r.onreadystatechange=function(){if(this.readyState==="complete"||this.readyState==="loaded"){this.onreadystatechange=null;for(const c of ee)c(null,r);ee=null}}})(l)}a&&i&&(window.tinymce?i(null,a):ee.push(i))},hu=["id"],pu={class:"editor-custom-btn-container"},Gt=v({inheritAttrs:!1,name:"cvEditorTinymce",components:{EditorSlideUpload:v({name:"EditorSlideUpload",props:{color:{type:String,default:"#1890ff"},accept:{type:[String],default:"image/jpeg,image/gif,image/png"},upName:{type:[String],default:""},upAction:{type:[String],default:""},upResponseFn:{type:[Function],default:()=>{}},upHeaders:{type:[Object],default:()=>{}},upData:{type:[Object],default:()=>{}}},data:()=>({dialogVisible:!1,listObj:{},fileList:[],diyUpList:new FormData}),methods:{checkAllSuccess(){return Object.keys(this.listObj).every(t=>this.listObj[t].hasSuccess)},handleSubmit(){const t=Object.keys(this.listObj).map(o=>this.listObj[o]);this.checkAllSuccess()?(this.$emit("successCBK",t),this.listObj={},this.fileList=[],this.dialogVisible=!1):this.$message("请等待所有图片上传成功。如果出现网络问题,请刷新页面并重新上传!")},handleSuccess(t,o){const a=o.uid,i=Object.keys(this.listObj);for(let l=0,n=i.length;l<n;l++)if(this.listObj[i[l]].uid===a)return this.upResponseFn&&typeof this.upResponseFn=="function"?this.listObj[i[l]].url=this.upResponseFn(t):this.listObj[i[l]].url=t.files.file||"",void(this.listObj[i[l]].hasSuccess=!0)},handleRemove(t){const o=t.uid,a=Object.keys(this.listObj);for(let i=0,l=a.length;i<l;i++)if(this.listObj[a[i]].uid===o)return void delete this.listObj[a[i]]},beforeUpload(t){const o=this,a=window.URL||window.webkitURL,i=t.uid;return this.listObj[i]={},new Promise((l,n)=>{const r=new Image;r.src=a.createObjectURL(t),r.onload=function(){o.listObj[i]={hasSuccess:!1,uid:t.uid,width:this.width,height:this.height}},l(!0)})}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("cv-icons"),c=e.resolveComponent("el-button"),h=e.resolveComponent("el-upload"),d=e.resolveComponent("el-dialog");return e.openBlock(),e.createElementBlock("div",ru,[e.createVNode(c,{style:e.normalizeStyle({background:a.color,borderColor:a.color,fontSize:"16px"}),type:"primary",onClick:o[0]||(o[0]=p=>l.dialogVisible=!0)},{default:e.withCtx(()=>[e.createVNode(r,{type:"ElIconUpload",size:"16",style:{"margin-right":"5px"}}),o[2]||(o[2]=e.createTextVNode(" 上传 "))]),_:1,__:[2]},8,["style"]),e.createVNode(d,{visible:l.dialogVisible},{default:e.withCtx(()=>[e.createVNode(h,e.mergeProps({class:"editor-slide-upload"},{action:a.upAction,headers:a.upHeaders,data:a.upData,name:a.upName,multiple:!0,showFileList:!0,listType:"picture-card",autoUpload:!0},{"file-list":l.fileList,"on-remove":n.handleRemove,"on-success":n.handleSuccess,"before-upload":n.beforeUpload}),{default:e.withCtx(()=>[e.createVNode(c,{type:"primary"},{default:e.withCtx(()=>o[3]||(o[3]=[e.createTextVNode("点击上传")])),_:1,__:[3]})]),_:1},16,["file-list","on-remove","on-success","before-upload"]),e.createVNode(c,{onClick:o[1]||(o[1]=p=>l.dialogVisible=!1)},{default:e.withCtx(()=>o[4]||(o[4]=[e.createTextVNode("取消")])),_:1,__:[4]}),e.createVNode(c,{type:"primary",onClick:n.handleSubmit},{default:e.withCtx(()=>o[5]||(o[5]=[e.createTextVNode("确定")])),_:1,__:[5]},8,["onClick"])]),_:1},8,["visible"])])}]])},emits:["update:modelValue"],mixins:[ae],props:{modelValue:{type:String,default:""},toolbar:{type:Array,required:!1,default:()=>[]},menubar:{type:String,default:"file edit insert view format table"},height:{type:[Number,String],required:!1,default:360},width:{type:[Number,String],required:!1,default:"100%"},uploadAttr:{type:[Object],default:()=>({})}},data:()=>({localVal:"",fullscreen:!1,languageTypeList:{en:"en",zh:"zh_CN",es:"es_MX",ja:"ja"}}),computed:{containerWidth(){const t=this.width;return/^[\d]+(\.[\d]+)?$/.test(t)?`${t}px`:t}},watch:{modelValue(t){this.localVal!=t&&(this.localVal=t,window.tinymce.get(this.editorRefID).setContent(t||""))}},created(){this.localVal=this.modelValue},mounted(){this.initLoad()},activated(){window.tinymce&&this.initTinymce()},deactivated(){this.destroyTinymce()},destroyed(){this.destroyTinymce()},methods:{initLoad(){du("https://10ui.cn/tinymce/@7.0.0/tinymce.min.js",t=>{t?this.$message.error(t.message):this.initTinymce()})},initTinymce(){const t=this;window.tinymce.init({selector:`#${this.editorRefID}`,license_key:"gpl",language:this.languageTypeList.zh,height:this.height,body_class:"panel-body ",object_resizing:!1,toolbar:this.toolbar.length>0?this.toolbar:cu,menubar:this.menubar,plugins:su,end_container_on_empty_block:!0,powerpaste_word_import:"clean",code_dialog_height:450,code_dialog_width:1e3,advlist_bullet_styles:"square",advlist_number_styles:"default",editimage_cors_hosts:["www.tinymce.com","codepen.io"],link_default_target:"_blank",link_title:!1,nonbreaking_force_tab:!0,init_instance_callback:o=>{t.localVal&&o.setContent(t.localVal)},setup(o){o.on("FullscreenStateChanged",a=>{t.fullscreen=a.state}),o.on("input",a=>{t.localVal=o.getContent(),t.$emit("update:modelValue",t.localVal)})},convert_urls:!1,images_upload_handler(o,a,i,l){l(0),new FormData}})},destroyTinymce(){const t=window.tinymce.get(this.editorRefID);this.fullscreen&&t.execCommand("mceFullScreen"),t&&t.destroy()},setContent(t){window.tinymce.get(this.editorRefID).setContent(t)},getContent(){window.tinymce.get(this.editorRefID).getContent()},imageSuccessCBK(t){t.forEach(o=>window.tinymce.get(this.editorRefID).insertContent(`<img class="wscnph" src="${o.url}" >`))}}},[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("EditorSlideUpload");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cv-editor-tinymce tinymce-container",{fullscreen:l.fullscreen}]),style:e.normalizeStyle({width:n.containerWidth})},[e.createElementVNode("textarea",{id:t.editorRefID,class:"tinymce-textarea"},null,8,hu),e.createElementVNode("div",pu,[e.createVNode(r,e.mergeProps({color:"#1890ff",class:"editor-upload-btn",onSuccessCBK:n.imageSuccessCBK},a.uploadAttr),null,16,["onSuccessCBK"])])],6)}],["__scopeId","data-v-8cbc5d06"]]),mu={name:"cvEditorMarkdown",mixins:[Rl,ae,Qo],emits:["update:modelValue","on-ready","on-upload-image"],props:{modelValue:{type:[String,Number],default:""},options:{type:[Object],default:()=>({})},toolbars:{type:[Object],default:()=>({})},language:{type:[String],default:"markdown"},theme:{type:[String],default:"light"},readOnly:{type:[Boolean],default:!1},autoSave:{type:[Boolean],default:!1},width:{type:[Number,String],default:"auto"},height:{type:[Number,String],default:600},bordered:{type:[Boolean],default:!0}},data:()=>({lastPos:"",lastInsert:"",lastHtml:"",scrollSide:"",localVal:"",heightMainPx:"",editorWrapRefEL:null}),watch:{localVal(t){this.$emit("update:modelValue",t)},modelValue(t){this.localVal!=t&&(this.localVal=t)},height(t){this.heightMainPx=this.getHeightMainPx()}},computed:{editorWrapRefID(){return this.editorRefID+"wrap"},previewRefID(){return this.editorRefID+"preview"},heightTotalPx(){let t=""+this.height;return t.includes("%")||t.includes("px")?t:t+"px"},widthTotalPx(){let t=""+this.width;return t.includes("px")?t:t+"px"}},created(){this.localVal=this.modelValue,this.codemrrConfig.disabled=this.readOnly||!1},mounted(){this.heightMainPx=this.getHeightMainPx()},destroyed(){},methods:{getHeightMainPx(){this.editorWrapRefEL=this.$refs[this.editorWrapRefID];const t=this.editorWrapRefEL.querySelector(".cv-editor-markdown-toolbar").offsetHeight;return t?this.heightTotalPx.includes("%")?`calc(100% - ${t}px - 2px)`:this.heightTotalPx.replace("px","")-t-2+"px":this.heightTotalPx},consoleLog(t,o){},initEditorReady(t){const{container:o,state:a,view:i}=t;this.editorStateInst=a,this.editorViewInst=i,this.listerenEvent(),this.$emit("on-ready")},listerenEvent(){this.editorWrapRefEL=this.$refs[this.editorWrapRefID],this.editorWrapRefEL.querySelector(".cv-editor-markdown-main .cm-scroller").addEventListener("scroll",this.markdownScroll),this.editorWrapRefEL.querySelector(".cv-markdown-preview .markdown-preview").addEventListener("scroll",this.previewScroll)},handlePaste(t,o){const{clipboardData:a={}}=o,{types:i=[],items:l}=a;let n=null;for(let r=0;r<i.length;r++)if(i[r]==="Files"){n=l[r];break}if(n){const r=n.getAsFile();/image/gi.test(r.type)&&(this.$emit("on-upload-image",r),o.preventDefault())}},setCursor(t,o){this.editorViewInst.dispatch({selection:{anchor:t,head:o}}),this.editorViewInst.focus()},GetContent(){const t=this.editorViewState.selection.main.head,o=this.editorViewState.doc.lineAt(t).number,a=this.editorViewState.doc.line(o).text.trim();return a!==""&&a},deleteContent(t,o){this.editorViewInst.dispatch({changes:{from:t,to:o}})},getLastPoint(){const t=this.editorViewInst.state.selection.main.head,o=this.editorViewInst.state.doc.lineAt(t).number,a=this.editorViewInst.state.doc.line(o).from,i=this.editorViewInst.state.doc.line(o).to,l=this.editorViewInst.state.doc.line(o).text;return this.lastPos||{line:o,start:a,end:i,content:l}},insertContent(t,o){this.getLastPoint(),this.editorViewInst.dispatch({changes:{from:t,insert:o}})},listerenKeyupEnter(t){const{lastInsert:o}=this;o&&(["-","- [ ]","- [x]"].includes(o.trim())?(t.preventDefault(),this.insertContent(`
|
|
34
34
|
`+o)):/^\d+\.$/.test(o.trim())&&(t.preventDefault(),this.insertContent(`
|
|
35
35
|
`+(parseInt(o,0)+1)+". ")))},listerenDelete(){setTimeout(()=>{const{editorViewInst:t}=this;t.isClean()||t.getValue().split(`
|
|
36
|
-
`).pop()===""&&(this.lastInsert="")},20)},mousescrollSide(t){this.scrollSide=t},getScrollData(){const t=this.editorWrapRefEL.querySelector(".cv-editor-markdown-main .cm-scroller"),o=t.scrollHeight,a=t.scrollTop,i=this.editorWrapRefEL.querySelector(".cv-markdown-preview .markdown-preview");return{markdownRef:t,markdownScrollHeight:o,markdownScrollTop:a,previewRef:i,contentHeight:i.offsetHeight,previewScrollHeight:i.scrollHeight,previewScrollTop:i.scrollTop||0}},markdownScroll(){if(this.actionScrollSync&&this.scrollSide==="left"){const{markdownRef:t,markdownScrollHeight:o,markdownScrollTop:a,previewRef:i,contentHeight:l,previewScrollHeight:n,previewScrollTop:r}=this.getScrollData();i.scrollTop=parseInt(a/(o-l)*(n-l),0)}},previewScroll(){if(this.actionScrollSync&&this.scrollSide==="right"){const{markdownRef:t,markdownScrollHeight:o,markdownScrollTop:a,previewRef:i,contentHeight:l,previewScrollHeight:n,previewScrollTop:r}=this.getScrollData(),c=parseInt(r/(n-l)*(o-l),0);t.scrollTop=c}}}},mu={key:0,class:"cv-editor-markdown-toolbar","data-title":"头部工具栏"},uu={class:"cv-editor-toolbars"},gu={key:1,name:"插入图片"},fu={key:2,name:"本地图片"},Cu={class:"icon-svg"},vu={key:4,name:"上传图片"},yu={key:5,name:"上传文件"},ku={name:"导入文件",class:"import-file"},bu={name:"保存到本地"},wu={key:6,name:"代码块"},Vu={key:7,class:"shift-theme",name:"主题"},xu=["onClick"],Nu={key:8,class:"shift-theme",name:"背景颜色"},Su=["onClick"],Bu={key:9,class:"shift-theme",name:"phrases"},Eu=["onClick"],Du=["name"],_u=["name"],Tu=["name"],Iu=["name"],Lu={key:15,name:"全屏编辑"},Fu={key:16,name:"分屏显示"},Ou={key:17,name:"预览"},$u={key:18,class:"segmentation"},zu={class:"icon-svg"},Pu={key:22,class:"segmentation"},Mu={key:23,name:"目录"},Hu={key:24,class:"segmentation"},Au=["name"],ju={class:"cv-editor-toolbars"},Ru={key:0,name:"撤销"},Uu={key:2,name:"粗体"},Wu={key:3,name:"斜体"},Yu={key:4,name:"删除线"},Xu={key:5,name:"下划线"},qu={key:6,name:"标题1"},Ku={key:7,name:"标题2"},Gu={key:8,name:"标题3"},Zu={key:9,name:"标题4"},Qu={key:10,name:"标题5"},Ju={key:11,name:"标题6"},eg={key:12,name:"分割线"},tg={key:13,name:"引用"},og={key:14,name:"无序列表"},ag={key:15,name:"有序列表"},lg={key:16,name:"未完成列表"},ng={key:17,name:"已完成列表"},ig={key:18,name:"链接"},rg={key:19,name:"表格"},Zt=v(pu,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("SvgImgMap"),c=e.resolveComponent("SvgUploadFile"),h=e.resolveComponent("SvgCopy"),d=e.resolveComponent("SvgToc"),p=e.resolveComponent("CodemirrorEditor"),u=e.resolveComponent("cv-markdown-show"),m=e.resolveComponent("el-input"),f=e.resolveComponent("el-button"),C=e.resolveComponent("el-dialog");return e.openBlock(),e.createElementBlock("div",{ref:n.editorWrapRefID,class:e.normalizeClass(["cv-editor-markdown-wrap",a.bordered?"border":""]),style:e.normalizeStyle({width:n.widthTotalPx,height:n.heightTotalPx})},[t.actionPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",mu,[e.createElementVNode("ul",uu,[t.$slots.title?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("li",null,[e.renderSlot(t.$slots,"title",{},void 0,!0)]),o[65]||(o[65]=e.createElementVNode("li",{class:"segmentation"},[e.createElementVNode("div")],-1))],64)):e.createCommentVNode("",!0),t.toolConfig.image?(e.openBlock(),e.createElementBlock("li",gu,[e.createElementVNode("span",{onClick:o[0]||(o[0]=(...g)=>t.actionInsImage&&t.actionInsImage(...g)),class:"iconfont icon-img"})])):e.createCommentVNode("",!0),t.toolConfig.uploadImage?(e.openBlock(),e.createElementBlock("li",fu,[e.createElementVNode("span",{onClick:o[1]||(o[1]=(...g)=>t.actionChooseImage&&t.actionChooseImage(...g)),class:"iconfont icon-upload-img"})])):e.createCommentVNode("",!0),t.toolConfig.custom_image?(e.openBlock(),e.createElementBlock("li",{key:3,name:"图片空间",onClick:o[2]||(o[2]=g=>t.actionCustom("image-browse"))},[e.createElementVNode("span",Cu,[e.createVNode(r)])])):e.createCommentVNode("",!0),t.toolConfig.custom_uploadImage?(e.openBlock(),e.createElementBlock("li",vu,[e.createElementVNode("span",{onClick:o[3]||(o[3]=g=>t.actionCustom("image-upload")),class:"iconfont icon-upload-img"})])):e.createCommentVNode("",!0),t.toolConfig.custom_uploadFile?(e.openBlock(),e.createElementBlock("li",yu,[e.createElementVNode("span",{onClick:o[4]||(o[4]=g=>t.actionCustom("file-upload")),class:"icon-svg"},[e.createVNode(c)])])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("li",ku,[e.createElementVNode("span",{class:"iconfont icon-daoru",onClick:o[5]||(o[5]=(...g)=>t.actionImportFile&&t.actionImportFile(...g))}),e.createElementVNode("input",{type:"file",onChange:o[6]||(o[6]=g=>t.actionImportFile(g)),accept:"text/markdown"},null,32)],512),[[e.vShow,t.toolConfig.importmd]]),e.withDirectives(e.createElementVNode("li",bu,[e.createElementVNode("span",{class:"iconfont icon-download",onClick:o[7]||(o[7]=(...g)=>t.actionExportFile&&t.actionExportFile(...g))})],512),[[e.vShow,t.toolConfig.exportmd]]),o[72]||(o[72]=e.createElementVNode("li",{class:"segmentation"},[e.createElementVNode("div")],-1)),t.toolConfig.code?(e.openBlock(),e.createElementBlock("li",wu,[e.createElementVNode("span",{onClick:o[8]||(o[8]=(...g)=>t.insertCode&&t.insertCode(...g)),class:"iconfont icon-code"})])):e.createCommentVNode("",!0),t.toolConfig.theme?(e.openBlock(),e.createElementBlock("li",Vu,[e.createElementVNode("span",{class:"iconfont icon-theme",onClick:o[9]||(o[9]=g=>t.actionThemeDropdown=!t.actionThemeDropdown)}),e.createElementVNode("ul",{class:e.normalizeClass({active:t.actionThemeDropdown}),onMouseleave:o[10]||(o[10]=g=>t.actionThemeDropdown=!1)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.optionTheme,g=>(e.openBlock(),e.createElementBlock("li",{onClick:y=>t.actionThemesSet(g)},e.toDisplayString(g),9,xu))),256))],34)])):e.createCommentVNode("",!0),t.toolConfig.backgroundColor?(e.openBlock(),e.createElementBlock("li",Nu,[e.createElementVNode("span",{class:"iconfont icon-theme",onClick:o[11]||(o[11]=g=>t.actionBgColorDropdown=!t.actionBgColorDropdown)}),e.createElementVNode("ul",{class:e.normalizeClass({active:t.actionBgColorDropdown}),onMouseleave:o[12]||(o[12]=g=>t.actionBgColorDropdown=!1)},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(["red","black","yellow","lawngreen","blue","white"],g=>e.createElementVNode("li",{onClick:y=>t.actionBgColorSet(g)},e.toDisplayString(g),9,Su)),64))],34)])):e.createCommentVNode("",!0),t.toolConfig.phrases?(e.openBlock(),e.createElementBlock("li",Bu,[e.createElementVNode("span",{class:"iconfont icon-theme",onClick:o[13]||(o[13]=g=>t.actionPhrasesDropdown=!t.actionPhrasesDropdown)}),e.createElementVNode("ul",{class:e.normalizeClass({active:t.actionPhrasesDropdown}),onMouseleave:o[14]||(o[14]=g=>t.actionPhrasesDropdown=!1)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.optionPhrases,g=>(e.openBlock(),e.createElementBlock("li",{onClick:y=>t.actionPhrasesSet(g)},e.toDisplayString(g),9,Eu))),256))],34)])):e.createCommentVNode("",!0),t.toolConfig.html_to_markdown?(e.openBlock(),e.createElementBlock("li",{key:10,name:"html转markdown",onClick:o[15]||(o[15]=g=>t.actionHtmlVisible(!0))},o[66]||(o[66]=[e.createElementVNode("span",{style:{width:"auto","font-size":"12px !important",padding:"0px 6px",margin:"0 10px",border:"1px #e2e2e2 solid"}}," HTML2MD ",-1)]))):e.createCommentVNode("",!0),t.toolConfig.disabled?(e.openBlock(),e.createElementBlock("li",{key:11,name:t.codemrrConfig.disabled?"toggle disabled:开":"toggle disabled:关"},[e.withDirectives(e.createElementVNode("span",{onClick:o[16]||(o[16]=g=>t.codemrrConfig.disabled=!t.codemrrConfig.disabled),class:"iconfont icon-on"},null,512),[[e.vShow,t.codemrrConfig.disabled]]),e.withDirectives(e.createElementVNode("span",{onClick:o[17]||(o[17]=g=>t.codemrrConfig.disabled=!t.codemrrConfig.disabled),class:"iconfont icon-off"},null,512),[[e.vShow,!t.codemrrConfig.disabled]])],8,Du)):e.createCommentVNode("",!0),t.toolConfig.autofocus?(e.openBlock(),e.createElementBlock("li",{key:12,name:t.codemrrConfig.autofocus?"toggle autofocus:开":"toggle autofocus:关"},[e.withDirectives(e.createElementVNode("span",{onClick:o[18]||(o[18]=g=>t.codemrrConfig.autofocus=!t.codemrrConfig.autofocus),class:"iconfont icon-on"},null,512),[[e.vShow,t.codemrrConfig.autofocus]]),e.withDirectives(e.createElementVNode("span",{onClick:o[19]||(o[19]=g=>t.codemrrConfig.autofocus=!t.codemrrConfig.autofocus),class:"iconfont icon-off"},null,512),[[e.vShow,!t.codemrrConfig.autofocus]])],8,_u)):e.createCommentVNode("",!0),t.toolConfig.indentWithTab?(e.openBlock(),e.createElementBlock("li",{key:13,name:t.codemrrConfig.indentWithTab?"toggle indentWithTab:开":"toggle indentWithTab:关"},[e.withDirectives(e.createElementVNode("span",{onClick:o[20]||(o[20]=g=>t.codemrrConfig.indentWithTab=!t.codemrrConfig.indentWithTab),class:"iconfont icon-on"},null,512),[[e.vShow,t.codemrrConfig.indentWithTab]]),e.withDirectives(e.createElementVNode("span",{onClick:o[21]||(o[21]=g=>t.codemrrConfig.indentWithTab=!t.codemrrConfig.indentWithTab),class:"iconfont icon-off"},null,512),[[e.vShow,!t.codemrrConfig.indentWithTab]])],8,Tu)):e.createCommentVNode("",!0),o[73]||(o[73]=e.createElementVNode("li",{class:"empty"},null,-1)),t.toolConfig.scrollSync?(e.openBlock(),e.createElementBlock("li",{key:14,name:t.actionScrollSync?"同步滚动:开":"同步滚动:关"},[e.withDirectives(e.createElementVNode("span",{onClick:o[22]||(o[22]=g=>t.actionScrollSync=!t.actionScrollSync),class:"iconfont icon-on active"},null,512),[[e.vShow,t.actionScrollSync]]),e.withDirectives(e.createElementVNode("span",{onClick:o[23]||(o[23]=g=>t.actionScrollSync=!t.actionScrollSync),class:"iconfont icon-off"},null,512),[[e.vShow,!t.actionScrollSync]])],8,Iu)):e.createCommentVNode("",!0),t.toolConfig.split&&t.actionSplit?(e.openBlock(),e.createElementBlock("li",Lu,[e.createElementVNode("span",{onClick:o[24]||(o[24]=g=>t.actionSplit=!1),class:"iconfont icon-md"})])):e.createCommentVNode("",!0),t.toolConfig.split&&!t.actionSplit?(e.openBlock(),e.createElementBlock("li",Fu,[e.createElementVNode("span",{onClick:o[25]||(o[25]=g=>t.actionSplit=!0),class:"iconfont icon-group"})])):e.createCommentVNode("",!0),t.toolConfig.preview?(e.openBlock(),e.createElementBlock("li",Ou,[e.createElementVNode("span",{onClick:o[26]||(o[26]=g=>t.actionPreview=!0),class:"iconfont icon-preview"})])):e.createCommentVNode("",!0),t.toolConfig.copy||t.toolConfig.clear||t.toolConfig.save?(e.openBlock(),e.createElementBlock("li",$u,o[67]||(o[67]=[e.createElementVNode("div",null,null,-1)]))):e.createCommentVNode("",!0),t.toolConfig.copy?(e.openBlock(),e.createElementBlock("li",{key:19,name:"复制",onClick:o[27]||(o[27]=(...g)=>t.actionCopySet&&t.actionCopySet(...g))},[e.createElementVNode("span",zu,[e.createVNode(h)])])):e.createCommentVNode("",!0),t.toolConfig.clear?(e.openBlock(),e.createElementBlock("li",{key:20,name:"清空",onClick:o[28]||(o[28]=g=>l.localVal="")},o[68]||(o[68]=[e.createElementVNode("span",{class:"iconfont icon-clear"},null,-1)]))):e.createCommentVNode("",!0),t.toolConfig.save?(e.openBlock(),e.createElementBlock("li",{key:21,name:"保存",onClick:o[29]||(o[29]=(...g)=>t.actionSaveSet&&t.actionSaveSet(...g))},o[69]||(o[69]=[e.createElementVNode("span",{class:"iconfont icon-save"},null,-1)]))):e.createCommentVNode("",!0),t.toolConfig.toc?(e.openBlock(),e.createElementBlock("li",Pu,o[70]||(o[70]=[e.createElementVNode("div",null,null,-1)]))):e.createCommentVNode("",!0),t.toolConfig.toc?(e.openBlock(),e.createElementBlock("li",Mu,[e.withDirectives(e.createElementVNode("span",{onClick:o[30]||(o[30]=g=>t.actionToc=!t.actionToc),class:"icon-svg active"},[e.createVNode(d)],512),[[e.vShow,t.actionToc]]),e.withDirectives(e.createElementVNode("span",{onClick:o[31]||(o[31]=g=>t.actionToc=!t.actionToc),class:"icon-svg"},[e.createVNode(d)],512),[[e.vShow,!t.actionToc]])])):e.createCommentVNode("",!0),t.toolConfig.fullscreen?(e.openBlock(),e.createElementBlock("li",Hu,o[71]||(o[71]=[e.createElementVNode("div",null,null,-1)]))):e.createCommentVNode("",!0),t.toolConfig.fullscreen?(e.openBlock(),e.createElementBlock("li",{key:25,name:t.actionFullscreen?"退出全屏":"全屏"},[e.withDirectives(e.createElementVNode("span",{onClick:o[32]||(o[32]=g=>t.actionFullscreenSet(!1)),class:"iconfont icon-quite"},null,512),[[e.vShow,t.actionFullscreen]]),e.withDirectives(e.createElementVNode("span",{onClick:o[33]||(o[33]=g=>t.actionFullscreenSet(!0)),class:"iconfont icon-fullscreen"},null,512),[[e.vShow,!t.actionFullscreen]])],8,Au)):e.createCommentVNode("",!0)]),e.createElementVNode("ul",ju,[t.toolConfig.undo?(e.openBlock(),e.createElementBlock("li",Ru,[e.createElementVNode("span",{class:"iconfont icon-undo",onClick:o[34]||(o[34]=(...g)=>t.actionUndo&&t.actionUndo(...g))})])):e.createCommentVNode("",!0),t.toolConfig.redo?(e.openBlock(),e.createElementBlock("li",{key:1,name:"重做",onClick:o[35]||(o[35]=(...g)=>t.actionRedo&&t.actionRedo(...g))},o[74]||(o[74]=[e.createElementVNode("span",{class:"iconfont icon-redo"},null,-1)]))):e.createCommentVNode("",!0),t.toolConfig.strong?(e.openBlock(),e.createElementBlock("li",Uu,[e.createElementVNode("span",{onClick:o[36]||(o[36]=(...g)=>t.actionInsStrong&&t.actionInsStrong(...g)),class:"iconfont icon-bold"})])):e.createCommentVNode("",!0),t.toolConfig.italic?(e.openBlock(),e.createElementBlock("li",Wu,[e.createElementVNode("span",{onClick:o[37]||(o[37]=(...g)=>t.actionInsItalic&&t.actionInsItalic(...g)),class:"iconfont icon-italic"})])):e.createCommentVNode("",!0),t.toolConfig.overline?(e.openBlock(),e.createElementBlock("li",Yu,[e.createElementVNode("span",{onClick:o[38]||(o[38]=(...g)=>t.actionInsOverline&&t.actionInsOverline(...g)),class:"iconfont icon-overline"})])):e.createCommentVNode("",!0),t.toolConfig.overline?(e.openBlock(),e.createElementBlock("li",Xu,[e.createElementVNode("span",{onClick:o[39]||(o[39]=(...g)=>t.actionInsUnderline&&t.actionInsUnderline(...g)),class:"iconfont icon-under-line"})])):e.createCommentVNode("",!0),t.toolConfig.h1?(e.openBlock(),e.createElementBlock("li",qu,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[40]||(o[40]=g=>t.actionInsTitle(1))},"h1")])):e.createCommentVNode("",!0),t.toolConfig.h2?(e.openBlock(),e.createElementBlock("li",Ku,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[41]||(o[41]=g=>t.actionInsTitle(2))},"h2")])):e.createCommentVNode("",!0),t.toolConfig.h3?(e.openBlock(),e.createElementBlock("li",Gu,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[42]||(o[42]=g=>t.actionInsTitle(3))},"h3")])):e.createCommentVNode("",!0),t.toolConfig.h4?(e.openBlock(),e.createElementBlock("li",Zu,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[43]||(o[43]=g=>t.actionInsTitle(4))},"h4")])):e.createCommentVNode("",!0),t.toolConfig.h5?(e.openBlock(),e.createElementBlock("li",Qu,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[44]||(o[44]=g=>t.actionInsTitle(5))},"h5")])):e.createCommentVNode("",!0),t.toolConfig.h6?(e.openBlock(),e.createElementBlock("li",Ju,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[45]||(o[45]=g=>t.actionInsTitle(6))},"h6")])):e.createCommentVNode("",!0),t.toolConfig.hr?(e.openBlock(),e.createElementBlock("li",eg,[e.createElementVNode("span",{onClick:o[46]||(o[46]=(...g)=>t.actionInsLine&&t.actionInsLine(...g)),class:"iconfont icon-horizontal"})])):e.createCommentVNode("",!0),t.toolConfig.quote?(e.openBlock(),e.createElementBlock("li",tg,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[47]||(o[47]=(...g)=>t.actionInsQuote&&t.actionInsQuote(...g)),class:"iconfont icon-quote"})])):e.createCommentVNode("",!0),t.toolConfig.ul?(e.openBlock(),e.createElementBlock("li",og,[e.createElementVNode("span",{onClick:o[48]||(o[48]=(...g)=>t.actionInsUl&&t.actionInsUl(...g)),class:"iconfont icon-ul"})])):e.createCommentVNode("",!0),t.toolConfig.ol?(e.openBlock(),e.createElementBlock("li",ag,[e.createElementVNode("span",{onClick:o[49]||(o[49]=(...g)=>t.actionInsOl&&t.actionInsOl(...g)),class:"iconfont icon-ol"})])):e.createCommentVNode("",!0),t.toolConfig.notChecked?(e.openBlock(),e.createElementBlock("li",lg,[e.createElementVNode("span",{onClick:o[50]||(o[50]=(...g)=>t.insertNotFinished&&t.insertNotFinished(...g)),class:"iconfont icon-checked-false"})])):e.createCommentVNode("",!0),t.toolConfig.checked?(e.openBlock(),e.createElementBlock("li",ng,[e.createElementVNode("span",{onClick:o[51]||(o[51]=(...g)=>t.insertFinished&&t.insertFinished(...g)),class:"iconfont icon-checked"})])):e.createCommentVNode("",!0),t.toolConfig.link?(e.openBlock(),e.createElementBlock("li",ig,[e.createElementVNode("span",{onClick:o[52]||(o[52]=(...g)=>t.actionInsLink&&t.actionInsLink(...g)),class:"iconfont icon-link"})])):e.createCommentVNode("",!0),t.toolConfig.table?(e.openBlock(),e.createElementBlock("li",rg,[e.createElementVNode("span",{onClick:o[53]||(o[53]=(...g)=>t.actionInsTable&&t.actionInsTable(...g)),class:"iconfont icon-table"})])):e.createCommentVNode("",!0)])])),e.createElementVNode("div",{title:"编辑器",class:"cv-editor-markdown-main",style:e.normalizeStyle({background:t.actionPreview?"#fff":""})},[e.withDirectives(e.createVNode(p,e.mergeProps(t.codemrrBind,{id:t.editorRefID,ref:t.editorRefID,style:{height:l.heightMainPx,backgroundColor:t.codemrrConfig.backgroundColor},extensions:t.extensions,modelValue:l.localVal,"onUpdate:modelValue":o[54]||(o[54]=g=>l.localVal=g),onReady:n.initEditorReady,onChange:o[55]||(o[55]=g=>n.consoleLog("change",g)),onFocus:o[56]||(o[56]=g=>n.consoleLog("focus",g)),onBlur:o[57]||(o[57]=g=>n.consoleLog("blur",g)),onMouseenter:o[58]||(o[58]=g=>n.mousescrollSide("left"))}),null,16,["id","style","extensions","modelValue","onReady"]),[[e.vShow,!t.actionPreview]]),e.withDirectives(e.createVNode(u,{html:l.lastHtml,"onUpdate:html":o[59]||(o[59]=g=>l.lastHtml=g),ref:n.previewRefID,editorID:n.previewRefID,modelValue:l.localVal,theme:t.codemrrConfig.theme||a.theme,language:a.language,tocShow:t.actionToc,style:e.normalizeStyle([{flex:"1",height:"100%","border-left":"1px solid #dedede","overflow-y":"auto"},{height:t.actionPreview?"":l.heightMainPx}]),onMouseenter:o[60]||(o[60]=g=>n.mousescrollSide("right"))},null,8,["html","editorID","modelValue","theme","language","tocShow","style"]),[[e.vShow,t.actionPreview?t.actionPreview:t.actionSplit]])],4),e.withDirectives(e.createElementVNode("div",{title:"关闭预览按钮",class:"close-preview",onClick:o[61]||(o[61]=g=>t.actionPreview=!1)},o[75]||(o[75]=[e.createElementVNode("span",{class:"iconfont icon-close"},null,-1)]),512),[[e.vShow,t.actionPreview]]),e.createVNode(C,{modelValue:t.actionHtmlDiaVisible,"onUpdate:modelValue":o[64]||(o[64]=g=>t.actionHtmlDiaVisible=g),title:"html转markdown",width:"680","show-close":!1,"append-to-body":""},{footer:e.withCtx(()=>[e.createVNode(f,{onClick:o[63]||(o[63]=g=>t.actionHtmlVisible(!1))},{default:e.withCtx(()=>o[76]||(o[76]=[e.createTextVNode("取消")])),_:1,__:[76]}),e.createVNode(f,{type:"primary",onClick:t.actionHtmlToMD},{default:e.withCtx(()=>o[77]||(o[77]=[e.createTextVNode("转换成markdown")])),_:1,__:[77]},8,["onClick"])]),default:e.withCtx(()=>[e.createVNode(m,{type:"textarea",modelValue:t.actionHtmlText,"onUpdate:modelValue":o[62]||(o[62]=g=>t.actionHtmlText=g),rows:14,placeholder:"请输入html代码..."},null,8,["modelValue"])]),_:1},8,["modelValue"])],6)}],["__scopeId","data-v-a76ecd6a"]]),ye={add(t,o){const a=`toc${o}${++this.index}`,i={anchor:a,level:o,text:t},l=this.tocItems;return i.level<=5&&l.push(i),a},reset:function(){this.tocItems=[],this.index=0},tocItems:[],index:0};function Nl(t){return o=>{typeof o=="string"&&o!==t.text&&(t.escaped=!0,t.text=o)}}const Wl=/[&<>"']/,sg=new RegExp(Wl.source,"g"),Yl=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,cg=new RegExp(Yl.source,"g"),dg={"&":"&","<":"<",">":">",'"':""","'":"'"},Sl=t=>dg[t];function Bl(t,o){if(o){if(Wl.test(t))return t.replace(sg,Sl)}else if(Yl.test(t))return t.replace(cg,Sl);return t}const hg={name:"cvMarkdownShow",mixins:[ae],emits:["update:html","on-copy"],props:{html:{type:[String]},modelValue:{type:[String],default:""},markedOptions:{type:Object,default:()=>({})},theme:{type:String,default:"light"},language:{type:String,default:""},copyCode:{type:Boolean,default:!0},copyBtnText:{type:String,default:"复制代码"},tocShow:{type:[Boolean],default:!1}},watch:{modelValue(t){this.localVal=t||"",this.initNewCreate()},localHtml(t){this.$emit("update:html",t)}},data:()=>({localVal:"",localHtml:"",previewImgModal:!1,previewImgSrc:"",previewImgMode:"",timeoutId:null,imgs:[],tocTrigger:!1,tocAction:"",tocLists:[]}),created(){this.localVal=this.modelValue||""},async mounted(){ye.reset(),await function(t,o=!1){let a=document.createElement("link");a.setAttribute("rel","stylesheet"),a.setAttribute("type","text/css"),a.setAttribute("id",t),o?a.setAttribute("href",t+"?t="+new Date().getTime()):a.setAttribute("href",t),document.getElementById(t)||document.head.appendChild(a)}(this.CDN_URL_UI+"/highlight.js/@11.8.0/styles/default.min.css"),await J(this.CDN_URL_UI+"/highlight.js/@11.8.0/highlight.min.js").then(()=>{setTimeout(()=>{hljs.highlightAll(),this.initNewCreate()},30)})},methods:{async initNewCreate(){const{Marked:t,Renderer:o}=await import("https://10ui.cn/marked/@12.0.1/marked.esm.js");o.prototype.heading=function(l,n,r,c){let h=ye.add(l,n);return`<h${n} id="${r.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-")}" toc-id="${h}">${l}</h${n}>`};const a=new t(function(l){if(typeof l=="function"&&(l={highlight:l}),!l||typeof l.highlight!="function")throw new Error("Must provide highlight function");return typeof l.langPrefix!="string"&&(l.langPrefix="language-"),{async:!!l.async,walkTokens(n){if(n.type!=="code")return;const r=function(h){return(h.lang||"").match(/\S*/)[0]}(n);if(l.async)return Promise.resolve(l.highlight(n.text,r)).then(Nl(n));const c=l.highlight(n.text,r);if(c instanceof Promise)throw new Error("markedHighlight is not set to async but the highlight function is async. Set the async option to true on markedHighlight to await the async highlight function.");Nl(n)(c)},renderer:{code(n,r,c){const h=(r||"").match(/\S*/)[0],d=h?` class="${l.langPrefix}${Bl(h)}"`:"";return n=n.replace(/\n$/,""),`<pre><code${d}>${c?n:Bl(n,!0)}
|
|
37
|
-
</code></pre>`}}}}({langPrefix:"hljs language-",highlight(l,n){const r=hljs.getLanguage(n)?n:"plaintext";return hljs.highlight(l,{language:r}).value}}));a.use({gfm:!0,tables:!0,breaks:!1,pedantic:!1,smartLists:!0});let i=a.parse(this.localVal,{sanitize:!1,...this.markedOptions});i=i.replace(/href="/gi,'target="_blank" href="'),this.copyCode&&(i=i.replace(/<pre>/g,'<div class="code-block"><span class="copy-code">'+this.copyBtnText+"</span><pre>").replace(/<\/pre>/g,"</pre></div>")),/\[\[TOC\]\]/.test(i)&&(i=i.replace(/\[\[TOC\]\]/g,'<ul class="toc-anchor"></ul>')),this.localHtml=i,this.tocLists=ye.tocItems,this.tocTrigger,ye.reset(),this.addCopyListener(),this.addImageClickListener()},addCopyListener(){setTimeout(()=>{const t=document.querySelectorAll(".code-block .copy-code");this.btns=t;for(let o=0,a=t.length;o<a;o++)t[o].onclick=()=>{const i=t[o].parentNode.querySelectorAll("pre")[0].innerText;this.$cvCopy(i),this.$emit("on-copy",i)}},30)},addImageClickListener(){if(this.imgs.length>0)for(let t=0,o=this.imgs.length;t<o;t++)this.imgs[t].onclick=null;setTimeout(()=>{if(this.$refs[this.editorRefID]){this.imgs=this.$refs[this.editorRefID].querySelectorAll("img");for(let t=0,o=this.imgs.length;t<o;t++)this.imgs[t].onclick=()=>{const a=this.imgs[t].getAttribute("src");this.previewImage(a)}}},600)},previewImage(t){const o=new Image;o.src=t,o.onload=()=>{const a=o.naturalWidth,i=o.naturalHeight;this.previewImgMode=i/a>1.4?"horizontal":"vertical",this.previewImgSrc=t,this.previewImgModal=!0}},handleScroll(){const t=this.$refs[this.editorRefID],o=t.querySelector(".markdown-preview"),a=o.querySelectorAll("h1,h2,h3,h4,h5");let i=null;if([...a].forEach(l=>{l.offsetTop-o.offsetTop<=o.scrollTop&&(i=l)}),i){this.tocAction=i.getAttribute("toc-id");const l=t.querySelector("ul.toc-anchor");if(l){const n=l.querySelector(`li[anchor="${this.tocAction}"]`);n&&(l.scrollTop=n.offsetTop-l.offsetTop-20)}}},tocClick(t){this.tocAction=t.anchor;const o=this.$refs[this.editorRefID].querySelector(".markdown-preview"),a=o.querySelector("h"+t.level+'[toc-id="'+this.tocAction+'"]');a&&o.scrollTo({top:a.offsetTop-o.offsetTop,behavior:"smooth"})},tocLevel(t,o){let a=9999;return o===void 0&&(o=this.tocLists),o.forEach(({level:i})=>{a=Math.min(a,i)}),a===9999?t:t-(a-1)}}},
|
|
36
|
+
`).pop()===""&&(this.lastInsert="")},20)},mousescrollSide(t){this.scrollSide=t},getScrollData(){const t=this.editorWrapRefEL.querySelector(".cv-editor-markdown-main .cm-scroller"),o=t.scrollHeight,a=t.scrollTop,i=this.editorWrapRefEL.querySelector(".cv-markdown-preview .markdown-preview");return{markdownRef:t,markdownScrollHeight:o,markdownScrollTop:a,previewRef:i,contentHeight:i.offsetHeight,previewScrollHeight:i.scrollHeight,previewScrollTop:i.scrollTop||0}},markdownScroll(){if(this.actionScrollSync&&this.scrollSide==="left"){const{markdownRef:t,markdownScrollHeight:o,markdownScrollTop:a,previewRef:i,contentHeight:l,previewScrollHeight:n,previewScrollTop:r}=this.getScrollData();i.scrollTop=parseInt(a/(o-l)*(n-l),0)}},previewScroll(){if(this.actionScrollSync&&this.scrollSide==="right"){const{markdownRef:t,markdownScrollHeight:o,markdownScrollTop:a,previewRef:i,contentHeight:l,previewScrollHeight:n,previewScrollTop:r}=this.getScrollData(),c=parseInt(r/(n-l)*(o-l),0);t.scrollTop=c}}}},uu={key:0,class:"cv-editor-markdown-toolbar","data-title":"头部工具栏"},gu={class:"cv-editor-toolbars"},fu={key:1,name:"插入图片"},Cu={key:2,name:"本地图片"},vu={class:"icon-svg"},yu={key:4,name:"上传图片"},ku={key:5,name:"上传文件"},bu={name:"导入文件",class:"import-file"},wu={name:"保存到本地"},Vu={key:6,name:"代码块"},xu={key:7,class:"shift-theme",name:"主题"},Nu=["onClick"],Su={key:8,class:"shift-theme",name:"背景颜色"},Bu=["onClick"],Eu={key:9,class:"shift-theme",name:"phrases"},Du=["onClick"],_u=["name"],Tu=["name"],Iu=["name"],Lu=["name"],Fu={key:15,name:"全屏编辑"},Ou={key:16,name:"分屏显示"},$u={key:17,name:"预览"},zu={key:18,class:"segmentation"},Pu={class:"icon-svg"},Mu={key:22,class:"segmentation"},Hu={key:23,name:"目录"},Au={key:24,class:"segmentation"},ju=["name"],Ru={class:"cv-editor-toolbars"},Uu={key:0,name:"撤销"},Wu={key:2,name:"粗体"},Yu={key:3,name:"斜体"},Xu={key:4,name:"删除线"},qu={key:5,name:"下划线"},Ku={key:6,name:"标题1"},Gu={key:7,name:"标题2"},Zu={key:8,name:"标题3"},Qu={key:9,name:"标题4"},Ju={key:10,name:"标题5"},eg={key:11,name:"标题6"},tg={key:12,name:"分割线"},og={key:13,name:"引用"},ag={key:14,name:"无序列表"},lg={key:15,name:"有序列表"},ng={key:16,name:"未完成列表"},ig={key:17,name:"已完成列表"},rg={key:18,name:"链接"},sg={key:19,name:"表格"},Zt=v(mu,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("SvgImgMap"),c=e.resolveComponent("SvgUploadFile"),h=e.resolveComponent("SvgCopy"),d=e.resolveComponent("SvgToc"),p=e.resolveComponent("CodemirrorEditor"),u=e.resolveComponent("cv-markdown-show"),m=e.resolveComponent("el-input"),f=e.resolveComponent("el-button"),C=e.resolveComponent("el-dialog");return e.openBlock(),e.createElementBlock("div",{ref:n.editorWrapRefID,class:e.normalizeClass(["cv-editor-markdown-wrap",a.bordered?"border":""]),style:e.normalizeStyle({width:n.widthTotalPx,height:n.heightTotalPx})},[t.actionPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",uu,[e.createElementVNode("ul",gu,[t.$slots.title?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("li",null,[e.renderSlot(t.$slots,"title",{},void 0,!0)]),o[65]||(o[65]=e.createElementVNode("li",{class:"segmentation"},[e.createElementVNode("div")],-1))],64)):e.createCommentVNode("",!0),t.toolConfig.image?(e.openBlock(),e.createElementBlock("li",fu,[e.createElementVNode("span",{onClick:o[0]||(o[0]=(...g)=>t.actionInsImage&&t.actionInsImage(...g)),class:"iconfont icon-img"})])):e.createCommentVNode("",!0),t.toolConfig.uploadImage?(e.openBlock(),e.createElementBlock("li",Cu,[e.createElementVNode("span",{onClick:o[1]||(o[1]=(...g)=>t.actionChooseImage&&t.actionChooseImage(...g)),class:"iconfont icon-upload-img"})])):e.createCommentVNode("",!0),t.toolConfig.custom_image?(e.openBlock(),e.createElementBlock("li",{key:3,name:"图片空间",onClick:o[2]||(o[2]=g=>t.actionCustom("image-browse"))},[e.createElementVNode("span",vu,[e.createVNode(r)])])):e.createCommentVNode("",!0),t.toolConfig.custom_uploadImage?(e.openBlock(),e.createElementBlock("li",yu,[e.createElementVNode("span",{onClick:o[3]||(o[3]=g=>t.actionCustom("image-upload")),class:"iconfont icon-upload-img"})])):e.createCommentVNode("",!0),t.toolConfig.custom_uploadFile?(e.openBlock(),e.createElementBlock("li",ku,[e.createElementVNode("span",{onClick:o[4]||(o[4]=g=>t.actionCustom("file-upload")),class:"icon-svg"},[e.createVNode(c)])])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("li",bu,[e.createElementVNode("span",{class:"iconfont icon-daoru",onClick:o[5]||(o[5]=(...g)=>t.actionImportFile&&t.actionImportFile(...g))}),e.createElementVNode("input",{type:"file",onChange:o[6]||(o[6]=g=>t.actionImportFile(g)),accept:"text/markdown"},null,32)],512),[[e.vShow,t.toolConfig.importmd]]),e.withDirectives(e.createElementVNode("li",wu,[e.createElementVNode("span",{class:"iconfont icon-download",onClick:o[7]||(o[7]=(...g)=>t.actionExportFile&&t.actionExportFile(...g))})],512),[[e.vShow,t.toolConfig.exportmd]]),o[72]||(o[72]=e.createElementVNode("li",{class:"segmentation"},[e.createElementVNode("div")],-1)),t.toolConfig.code?(e.openBlock(),e.createElementBlock("li",Vu,[e.createElementVNode("span",{onClick:o[8]||(o[8]=(...g)=>t.insertCode&&t.insertCode(...g)),class:"iconfont icon-code"})])):e.createCommentVNode("",!0),t.toolConfig.theme?(e.openBlock(),e.createElementBlock("li",xu,[e.createElementVNode("span",{class:"iconfont icon-theme",onClick:o[9]||(o[9]=g=>t.actionThemeDropdown=!t.actionThemeDropdown)}),e.createElementVNode("ul",{class:e.normalizeClass({active:t.actionThemeDropdown}),onMouseleave:o[10]||(o[10]=g=>t.actionThemeDropdown=!1)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.optionTheme,g=>(e.openBlock(),e.createElementBlock("li",{onClick:y=>t.actionThemesSet(g)},e.toDisplayString(g),9,Nu))),256))],34)])):e.createCommentVNode("",!0),t.toolConfig.backgroundColor?(e.openBlock(),e.createElementBlock("li",Su,[e.createElementVNode("span",{class:"iconfont icon-theme",onClick:o[11]||(o[11]=g=>t.actionBgColorDropdown=!t.actionBgColorDropdown)}),e.createElementVNode("ul",{class:e.normalizeClass({active:t.actionBgColorDropdown}),onMouseleave:o[12]||(o[12]=g=>t.actionBgColorDropdown=!1)},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(["red","black","yellow","lawngreen","blue","white"],g=>e.createElementVNode("li",{onClick:y=>t.actionBgColorSet(g)},e.toDisplayString(g),9,Bu)),64))],34)])):e.createCommentVNode("",!0),t.toolConfig.phrases?(e.openBlock(),e.createElementBlock("li",Eu,[e.createElementVNode("span",{class:"iconfont icon-theme",onClick:o[13]||(o[13]=g=>t.actionPhrasesDropdown=!t.actionPhrasesDropdown)}),e.createElementVNode("ul",{class:e.normalizeClass({active:t.actionPhrasesDropdown}),onMouseleave:o[14]||(o[14]=g=>t.actionPhrasesDropdown=!1)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.optionPhrases,g=>(e.openBlock(),e.createElementBlock("li",{onClick:y=>t.actionPhrasesSet(g)},e.toDisplayString(g),9,Du))),256))],34)])):e.createCommentVNode("",!0),t.toolConfig.html_to_markdown?(e.openBlock(),e.createElementBlock("li",{key:10,name:"html转markdown",onClick:o[15]||(o[15]=g=>t.actionHtmlVisible(!0))},o[66]||(o[66]=[e.createElementVNode("span",{style:{width:"auto","font-size":"12px !important",padding:"0px 6px",margin:"0 10px",border:"1px #e2e2e2 solid"}}," HTML2MD ",-1)]))):e.createCommentVNode("",!0),t.toolConfig.disabled?(e.openBlock(),e.createElementBlock("li",{key:11,name:t.codemrrConfig.disabled?"toggle disabled:开":"toggle disabled:关"},[e.withDirectives(e.createElementVNode("span",{onClick:o[16]||(o[16]=g=>t.codemrrConfig.disabled=!t.codemrrConfig.disabled),class:"iconfont icon-on"},null,512),[[e.vShow,t.codemrrConfig.disabled]]),e.withDirectives(e.createElementVNode("span",{onClick:o[17]||(o[17]=g=>t.codemrrConfig.disabled=!t.codemrrConfig.disabled),class:"iconfont icon-off"},null,512),[[e.vShow,!t.codemrrConfig.disabled]])],8,_u)):e.createCommentVNode("",!0),t.toolConfig.autofocus?(e.openBlock(),e.createElementBlock("li",{key:12,name:t.codemrrConfig.autofocus?"toggle autofocus:开":"toggle autofocus:关"},[e.withDirectives(e.createElementVNode("span",{onClick:o[18]||(o[18]=g=>t.codemrrConfig.autofocus=!t.codemrrConfig.autofocus),class:"iconfont icon-on"},null,512),[[e.vShow,t.codemrrConfig.autofocus]]),e.withDirectives(e.createElementVNode("span",{onClick:o[19]||(o[19]=g=>t.codemrrConfig.autofocus=!t.codemrrConfig.autofocus),class:"iconfont icon-off"},null,512),[[e.vShow,!t.codemrrConfig.autofocus]])],8,Tu)):e.createCommentVNode("",!0),t.toolConfig.indentWithTab?(e.openBlock(),e.createElementBlock("li",{key:13,name:t.codemrrConfig.indentWithTab?"toggle indentWithTab:开":"toggle indentWithTab:关"},[e.withDirectives(e.createElementVNode("span",{onClick:o[20]||(o[20]=g=>t.codemrrConfig.indentWithTab=!t.codemrrConfig.indentWithTab),class:"iconfont icon-on"},null,512),[[e.vShow,t.codemrrConfig.indentWithTab]]),e.withDirectives(e.createElementVNode("span",{onClick:o[21]||(o[21]=g=>t.codemrrConfig.indentWithTab=!t.codemrrConfig.indentWithTab),class:"iconfont icon-off"},null,512),[[e.vShow,!t.codemrrConfig.indentWithTab]])],8,Iu)):e.createCommentVNode("",!0),o[73]||(o[73]=e.createElementVNode("li",{class:"empty"},null,-1)),t.toolConfig.scrollSync?(e.openBlock(),e.createElementBlock("li",{key:14,name:t.actionScrollSync?"同步滚动:开":"同步滚动:关"},[e.withDirectives(e.createElementVNode("span",{onClick:o[22]||(o[22]=g=>t.actionScrollSync=!t.actionScrollSync),class:"iconfont icon-on active"},null,512),[[e.vShow,t.actionScrollSync]]),e.withDirectives(e.createElementVNode("span",{onClick:o[23]||(o[23]=g=>t.actionScrollSync=!t.actionScrollSync),class:"iconfont icon-off"},null,512),[[e.vShow,!t.actionScrollSync]])],8,Lu)):e.createCommentVNode("",!0),t.toolConfig.split&&t.actionSplit?(e.openBlock(),e.createElementBlock("li",Fu,[e.createElementVNode("span",{onClick:o[24]||(o[24]=g=>t.actionSplit=!1),class:"iconfont icon-md"})])):e.createCommentVNode("",!0),t.toolConfig.split&&!t.actionSplit?(e.openBlock(),e.createElementBlock("li",Ou,[e.createElementVNode("span",{onClick:o[25]||(o[25]=g=>t.actionSplit=!0),class:"iconfont icon-group"})])):e.createCommentVNode("",!0),t.toolConfig.preview?(e.openBlock(),e.createElementBlock("li",$u,[e.createElementVNode("span",{onClick:o[26]||(o[26]=g=>t.actionPreview=!0),class:"iconfont icon-preview"})])):e.createCommentVNode("",!0),t.toolConfig.copy||t.toolConfig.clear||t.toolConfig.save?(e.openBlock(),e.createElementBlock("li",zu,o[67]||(o[67]=[e.createElementVNode("div",null,null,-1)]))):e.createCommentVNode("",!0),t.toolConfig.copy?(e.openBlock(),e.createElementBlock("li",{key:19,name:"复制",onClick:o[27]||(o[27]=(...g)=>t.actionCopySet&&t.actionCopySet(...g))},[e.createElementVNode("span",Pu,[e.createVNode(h)])])):e.createCommentVNode("",!0),t.toolConfig.clear?(e.openBlock(),e.createElementBlock("li",{key:20,name:"清空",onClick:o[28]||(o[28]=g=>l.localVal="")},o[68]||(o[68]=[e.createElementVNode("span",{class:"iconfont icon-clear"},null,-1)]))):e.createCommentVNode("",!0),t.toolConfig.save?(e.openBlock(),e.createElementBlock("li",{key:21,name:"保存",onClick:o[29]||(o[29]=(...g)=>t.actionSaveSet&&t.actionSaveSet(...g))},o[69]||(o[69]=[e.createElementVNode("span",{class:"iconfont icon-save"},null,-1)]))):e.createCommentVNode("",!0),t.toolConfig.toc?(e.openBlock(),e.createElementBlock("li",Mu,o[70]||(o[70]=[e.createElementVNode("div",null,null,-1)]))):e.createCommentVNode("",!0),t.toolConfig.toc?(e.openBlock(),e.createElementBlock("li",Hu,[e.withDirectives(e.createElementVNode("span",{onClick:o[30]||(o[30]=g=>t.actionToc=!t.actionToc),class:"icon-svg active"},[e.createVNode(d)],512),[[e.vShow,t.actionToc]]),e.withDirectives(e.createElementVNode("span",{onClick:o[31]||(o[31]=g=>t.actionToc=!t.actionToc),class:"icon-svg"},[e.createVNode(d)],512),[[e.vShow,!t.actionToc]])])):e.createCommentVNode("",!0),t.toolConfig.fullscreen?(e.openBlock(),e.createElementBlock("li",Au,o[71]||(o[71]=[e.createElementVNode("div",null,null,-1)]))):e.createCommentVNode("",!0),t.toolConfig.fullscreen?(e.openBlock(),e.createElementBlock("li",{key:25,name:t.actionFullscreen?"退出全屏":"全屏"},[e.withDirectives(e.createElementVNode("span",{onClick:o[32]||(o[32]=g=>t.actionFullscreenSet(!1)),class:"iconfont icon-quite"},null,512),[[e.vShow,t.actionFullscreen]]),e.withDirectives(e.createElementVNode("span",{onClick:o[33]||(o[33]=g=>t.actionFullscreenSet(!0)),class:"iconfont icon-fullscreen"},null,512),[[e.vShow,!t.actionFullscreen]])],8,ju)):e.createCommentVNode("",!0)]),e.createElementVNode("ul",Ru,[t.toolConfig.undo?(e.openBlock(),e.createElementBlock("li",Uu,[e.createElementVNode("span",{class:"iconfont icon-undo",onClick:o[34]||(o[34]=(...g)=>t.actionUndo&&t.actionUndo(...g))})])):e.createCommentVNode("",!0),t.toolConfig.redo?(e.openBlock(),e.createElementBlock("li",{key:1,name:"重做",onClick:o[35]||(o[35]=(...g)=>t.actionRedo&&t.actionRedo(...g))},o[74]||(o[74]=[e.createElementVNode("span",{class:"iconfont icon-redo"},null,-1)]))):e.createCommentVNode("",!0),t.toolConfig.strong?(e.openBlock(),e.createElementBlock("li",Wu,[e.createElementVNode("span",{onClick:o[36]||(o[36]=(...g)=>t.actionInsStrong&&t.actionInsStrong(...g)),class:"iconfont icon-bold"})])):e.createCommentVNode("",!0),t.toolConfig.italic?(e.openBlock(),e.createElementBlock("li",Yu,[e.createElementVNode("span",{onClick:o[37]||(o[37]=(...g)=>t.actionInsItalic&&t.actionInsItalic(...g)),class:"iconfont icon-italic"})])):e.createCommentVNode("",!0),t.toolConfig.overline?(e.openBlock(),e.createElementBlock("li",Xu,[e.createElementVNode("span",{onClick:o[38]||(o[38]=(...g)=>t.actionInsOverline&&t.actionInsOverline(...g)),class:"iconfont icon-overline"})])):e.createCommentVNode("",!0),t.toolConfig.overline?(e.openBlock(),e.createElementBlock("li",qu,[e.createElementVNode("span",{onClick:o[39]||(o[39]=(...g)=>t.actionInsUnderline&&t.actionInsUnderline(...g)),class:"iconfont icon-under-line"})])):e.createCommentVNode("",!0),t.toolConfig.h1?(e.openBlock(),e.createElementBlock("li",Ku,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[40]||(o[40]=g=>t.actionInsTitle(1))},"h1")])):e.createCommentVNode("",!0),t.toolConfig.h2?(e.openBlock(),e.createElementBlock("li",Gu,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[41]||(o[41]=g=>t.actionInsTitle(2))},"h2")])):e.createCommentVNode("",!0),t.toolConfig.h3?(e.openBlock(),e.createElementBlock("li",Zu,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[42]||(o[42]=g=>t.actionInsTitle(3))},"h3")])):e.createCommentVNode("",!0),t.toolConfig.h4?(e.openBlock(),e.createElementBlock("li",Qu,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[43]||(o[43]=g=>t.actionInsTitle(4))},"h4")])):e.createCommentVNode("",!0),t.toolConfig.h5?(e.openBlock(),e.createElementBlock("li",Ju,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[44]||(o[44]=g=>t.actionInsTitle(5))},"h5")])):e.createCommentVNode("",!0),t.toolConfig.h6?(e.openBlock(),e.createElementBlock("li",eg,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[45]||(o[45]=g=>t.actionInsTitle(6))},"h6")])):e.createCommentVNode("",!0),t.toolConfig.hr?(e.openBlock(),e.createElementBlock("li",tg,[e.createElementVNode("span",{onClick:o[46]||(o[46]=(...g)=>t.actionInsLine&&t.actionInsLine(...g)),class:"iconfont icon-horizontal"})])):e.createCommentVNode("",!0),t.toolConfig.quote?(e.openBlock(),e.createElementBlock("li",og,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[47]||(o[47]=(...g)=>t.actionInsQuote&&t.actionInsQuote(...g)),class:"iconfont icon-quote"})])):e.createCommentVNode("",!0),t.toolConfig.ul?(e.openBlock(),e.createElementBlock("li",ag,[e.createElementVNode("span",{onClick:o[48]||(o[48]=(...g)=>t.actionInsUl&&t.actionInsUl(...g)),class:"iconfont icon-ul"})])):e.createCommentVNode("",!0),t.toolConfig.ol?(e.openBlock(),e.createElementBlock("li",lg,[e.createElementVNode("span",{onClick:o[49]||(o[49]=(...g)=>t.actionInsOl&&t.actionInsOl(...g)),class:"iconfont icon-ol"})])):e.createCommentVNode("",!0),t.toolConfig.notChecked?(e.openBlock(),e.createElementBlock("li",ng,[e.createElementVNode("span",{onClick:o[50]||(o[50]=(...g)=>t.insertNotFinished&&t.insertNotFinished(...g)),class:"iconfont icon-checked-false"})])):e.createCommentVNode("",!0),t.toolConfig.checked?(e.openBlock(),e.createElementBlock("li",ig,[e.createElementVNode("span",{onClick:o[51]||(o[51]=(...g)=>t.insertFinished&&t.insertFinished(...g)),class:"iconfont icon-checked"})])):e.createCommentVNode("",!0),t.toolConfig.link?(e.openBlock(),e.createElementBlock("li",rg,[e.createElementVNode("span",{onClick:o[52]||(o[52]=(...g)=>t.actionInsLink&&t.actionInsLink(...g)),class:"iconfont icon-link"})])):e.createCommentVNode("",!0),t.toolConfig.table?(e.openBlock(),e.createElementBlock("li",sg,[e.createElementVNode("span",{onClick:o[53]||(o[53]=(...g)=>t.actionInsTable&&t.actionInsTable(...g)),class:"iconfont icon-table"})])):e.createCommentVNode("",!0)])])),e.createElementVNode("div",{title:"编辑器",class:"cv-editor-markdown-main",style:e.normalizeStyle({background:t.actionPreview?"#fff":""})},[e.withDirectives(e.createVNode(p,e.mergeProps(t.codemrrBind,{id:t.editorRefID,ref:t.editorRefID,style:{height:l.heightMainPx,backgroundColor:t.codemrrConfig.backgroundColor},extensions:t.extensions,modelValue:l.localVal,"onUpdate:modelValue":o[54]||(o[54]=g=>l.localVal=g),onReady:n.initEditorReady,onChange:o[55]||(o[55]=g=>n.consoleLog("change",g)),onFocus:o[56]||(o[56]=g=>n.consoleLog("focus",g)),onBlur:o[57]||(o[57]=g=>n.consoleLog("blur",g)),onMouseenter:o[58]||(o[58]=g=>n.mousescrollSide("left"))}),null,16,["id","style","extensions","modelValue","onReady"]),[[e.vShow,!t.actionPreview]]),e.withDirectives(e.createVNode(u,{html:l.lastHtml,"onUpdate:html":o[59]||(o[59]=g=>l.lastHtml=g),ref:n.previewRefID,editorID:n.previewRefID,modelValue:l.localVal,theme:t.codemrrConfig.theme||a.theme,language:a.language,tocShow:t.actionToc,style:e.normalizeStyle([{flex:"1",height:"100%","border-left":"1px solid #dedede","overflow-y":"auto"},{height:t.actionPreview?"":l.heightMainPx}]),onMouseenter:o[60]||(o[60]=g=>n.mousescrollSide("right"))},null,8,["html","editorID","modelValue","theme","language","tocShow","style"]),[[e.vShow,t.actionPreview?t.actionPreview:t.actionSplit]])],4),e.withDirectives(e.createElementVNode("div",{title:"关闭预览按钮",class:"close-preview",onClick:o[61]||(o[61]=g=>t.actionPreview=!1)},o[75]||(o[75]=[e.createElementVNode("span",{class:"iconfont icon-close"},null,-1)]),512),[[e.vShow,t.actionPreview]]),e.createVNode(C,{modelValue:t.actionHtmlDiaVisible,"onUpdate:modelValue":o[64]||(o[64]=g=>t.actionHtmlDiaVisible=g),title:"html转markdown",width:"680","show-close":!1,"append-to-body":""},{footer:e.withCtx(()=>[e.createVNode(f,{onClick:o[63]||(o[63]=g=>t.actionHtmlVisible(!1))},{default:e.withCtx(()=>o[76]||(o[76]=[e.createTextVNode("取消")])),_:1,__:[76]}),e.createVNode(f,{type:"primary",onClick:t.actionHtmlToMD},{default:e.withCtx(()=>o[77]||(o[77]=[e.createTextVNode("转换成markdown")])),_:1,__:[77]},8,["onClick"])]),default:e.withCtx(()=>[e.createVNode(m,{type:"textarea",modelValue:t.actionHtmlText,"onUpdate:modelValue":o[62]||(o[62]=g=>t.actionHtmlText=g),rows:14,placeholder:"请输入html代码..."},null,8,["modelValue"])]),_:1},8,["modelValue"])],6)}],["__scopeId","data-v-a76ecd6a"]]),ye={add(t,o){const a=`toc${o}${++this.index}`,i={anchor:a,level:o,text:t},l=this.tocItems;return i.level<=5&&l.push(i),a},reset:function(){this.tocItems=[],this.index=0},tocItems:[],index:0};function Nl(t){return o=>{typeof o=="string"&&o!==t.text&&(t.escaped=!0,t.text=o)}}const Wl=/[&<>"']/,cg=new RegExp(Wl.source,"g"),Yl=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,dg=new RegExp(Yl.source,"g"),hg={"&":"&","<":"<",">":">",'"':""","'":"'"},Sl=t=>hg[t];function Bl(t,o){if(o){if(Wl.test(t))return t.replace(cg,Sl)}else if(Yl.test(t))return t.replace(dg,Sl);return t}const pg={name:"cvMarkdownShow",mixins:[ae],emits:["update:html","on-copy"],props:{html:{type:[String]},modelValue:{type:[String],default:""},markedOptions:{type:Object,default:()=>({})},theme:{type:String,default:"light"},language:{type:String,default:""},copyCode:{type:Boolean,default:!0},copyBtnText:{type:String,default:"复制代码"},tocShow:{type:[Boolean],default:!1}},watch:{modelValue(t){this.localVal=t||"",this.initNewCreate()},localHtml(t){this.$emit("update:html",t)}},data:()=>({localVal:"",localHtml:"",previewImgModal:!1,previewImgSrc:"",previewImgMode:"",timeoutId:null,imgs:[],tocTrigger:!1,tocAction:"",tocLists:[]}),created(){this.localVal=this.modelValue||""},async mounted(){ye.reset(),await function(t,o=!1){let a=document.createElement("link");a.setAttribute("rel","stylesheet"),a.setAttribute("type","text/css"),a.setAttribute("id",t),o?a.setAttribute("href",t+"?t="+new Date().getTime()):a.setAttribute("href",t),document.getElementById(t)||document.head.appendChild(a)}(this.CDN_URL_UI+"/highlight.js/@11.8.0/styles/default.min.css"),await J(this.CDN_URL_UI+"/highlight.js/@11.8.0/highlight.min.js").then(()=>{setTimeout(()=>{hljs.highlightAll(),this.initNewCreate()},30)})},methods:{async initNewCreate(){const{Marked:t,Renderer:o}=await import("https://10ui.cn/marked/@12.0.1/marked.esm.js");o.prototype.heading=function(l,n,r,c){let h=ye.add(l,n);return`<h${n} id="${r.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-")}" toc-id="${h}">${l}</h${n}>`};const a=new t(function(l){if(typeof l=="function"&&(l={highlight:l}),!l||typeof l.highlight!="function")throw new Error("Must provide highlight function");return typeof l.langPrefix!="string"&&(l.langPrefix="language-"),{async:!!l.async,walkTokens(n){if(n.type!=="code")return;const r=function(h){return(h.lang||"").match(/\S*/)[0]}(n);if(l.async)return Promise.resolve(l.highlight(n.text,r)).then(Nl(n));const c=l.highlight(n.text,r);if(c instanceof Promise)throw new Error("markedHighlight is not set to async but the highlight function is async. Set the async option to true on markedHighlight to await the async highlight function.");Nl(n)(c)},renderer:{code(n,r,c){const h=(r||"").match(/\S*/)[0],d=h?` class="${l.langPrefix}${Bl(h)}"`:"";return n=n.replace(/\n$/,""),`<pre><code${d}>${c?n:Bl(n,!0)}
|
|
37
|
+
</code></pre>`}}}}({langPrefix:"hljs language-",highlight(l,n){const r=hljs.getLanguage(n)?n:"plaintext";return hljs.highlight(l,{language:r}).value}}));a.use({gfm:!0,tables:!0,breaks:!1,pedantic:!1,smartLists:!0});let i=a.parse(this.localVal,{sanitize:!1,...this.markedOptions});i=i.replace(/href="/gi,'target="_blank" href="'),this.copyCode&&(i=i.replace(/<pre>/g,'<div class="code-block"><span class="copy-code">'+this.copyBtnText+"</span><pre>").replace(/<\/pre>/g,"</pre></div>")),/\[\[TOC\]\]/.test(i)&&(i=i.replace(/\[\[TOC\]\]/g,'<ul class="toc-anchor"></ul>')),this.localHtml=i,this.tocLists=ye.tocItems,this.tocTrigger,ye.reset(),this.addCopyListener(),this.addImageClickListener()},addCopyListener(){setTimeout(()=>{const t=document.querySelectorAll(".code-block .copy-code");this.btns=t;for(let o=0,a=t.length;o<a;o++)t[o].onclick=()=>{const i=t[o].parentNode.querySelectorAll("pre")[0].innerText;this.$cvCopy(i),this.$emit("on-copy",i)}},30)},addImageClickListener(){if(this.imgs.length>0)for(let t=0,o=this.imgs.length;t<o;t++)this.imgs[t].onclick=null;setTimeout(()=>{if(this.$refs[this.editorRefID]){this.imgs=this.$refs[this.editorRefID].querySelectorAll("img");for(let t=0,o=this.imgs.length;t<o;t++)this.imgs[t].onclick=()=>{const a=this.imgs[t].getAttribute("src");this.previewImage(a)}}},600)},previewImage(t){const o=new Image;o.src=t,o.onload=()=>{const a=o.naturalWidth,i=o.naturalHeight;this.previewImgMode=i/a>1.4?"horizontal":"vertical",this.previewImgSrc=t,this.previewImgModal=!0}},handleScroll(){const t=this.$refs[this.editorRefID],o=t.querySelector(".markdown-preview"),a=o.querySelectorAll("h1,h2,h3,h4,h5");let i=null;if([...a].forEach(l=>{l.offsetTop-o.offsetTop<=o.scrollTop&&(i=l)}),i){this.tocAction=i.getAttribute("toc-id");const l=t.querySelector("ul.toc-anchor");if(l){const n=l.querySelector(`li[anchor="${this.tocAction}"]`);n&&(l.scrollTop=n.offsetTop-l.offsetTop-20)}}},tocClick(t){this.tocAction=t.anchor;const o=this.$refs[this.editorRefID].querySelector(".markdown-preview"),a=o.querySelector("h"+t.level+'[toc-id="'+this.tocAction+'"]');a&&o.scrollTo({top:a.offsetTop-o.offsetTop,behavior:"smooth"})},tocLevel(t,o){let a=9999;return o===void 0&&(o=this.tocLists),o.forEach(({level:i})=>{a=Math.min(a,i)}),a===9999?t:t-(a-1)}}},mg=["id"],ug=["innerHTML"],gg={class:"toc-anchor"},fg=["anchor","onClick"],Cg=["anchor","title"],vg=["src"],Qt=v(pg,[["render",function(t,o,a,i,l,n){const r=e.resolveComponent("cv-icons");return e.openBlock(),e.createElementBlock("div",{class:"cv-markdown-preview",id:t.editorRefID,ref:t.editorRefID,style:e.normalizeStyle([a.tocShow?"display:flex;":""])},[t.$slots.default?e.renderSlot(t.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(l.localHtml),1)]):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass("markdown-preview markdown-theme-base "+("markdown-theme-"+a.theme)),onScroll:o[0]||(o[0]=(...c)=>n.handleScroll&&n.handleScroll(...c)),innerHTML:l.localHtml},null,42,ug),e.withDirectives(e.createElementVNode("ul",gg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.tocLists,c=>(e.openBlock(),e.createElementBlock("li",{class:"toc-anchor-item",anchor:c.anchor,key:c.anchor,onClick:h=>n.tocClick(c)},[e.createElementVNode("span",{class:e.normalizeClass(`toc-link-${n.tocLevel(c.level)}${l.tocAction==c.anchor?" toc-link-action":""}`),anchor:c.anchor,title:c.text},e.toDisplayString(c.text),11,Cg)],8,fg))),128))],512),[[e.vShow,a.tocShow]]),e.createElementVNode("div",{class:e.normalizeClass(["preview-img",l.previewImgModal?"active":""])},[e.createVNode(r,{type:"ElIconClose",onClick:o[1]||(o[1]=c=>l.previewImgModal=!1)}),e.createElementVNode("img",{src:l.previewImgSrc,class:e.normalizeClass([l.previewImgMode]),alt:""},null,10,vg)],2)],12,mg)}]]),yg={name:"cvMarkdownSimple",mixins:[ae,Qo,{methods:{toggleSlideDown(){this.slideDown=!this.slideDown},actionThemesSet(t){this.codemrrConfig.theme=t,this.actionThemeDropdown=!1,this.$emit("on-act-theme",t)},actionChooseImage(){const t=document.createElement("input");t.type="file",t.accept="image/*",t.onchange=()=>{const o=t.files;o[0]&&(this.$emit("on-act-choose-image",o[0]),t.value="")},t.click()},actionUndo(){},actionRedo(){},actionInsBg(){const t=this.getCursortPosition(),o=this.localVal.substring(t-1,t);this.insertContent("===="),o!==`
|
|
38
38
|
`&&this.localVal,this.setCaretPosition(t+5)},actionInsStrong(){const t=this.getCursortPosition(),o=this.localVal.substring(t-1,t);this.insertContent("****"),o!==`
|
|
39
39
|
`&&this.localVal,this.setCaretPosition(t+2)},actionInsItalic(){const t=this.getCursortPosition(),o=this.localVal.substring(t-1,t);this.insertContent("**"),o!==`
|
|
40
40
|
`&&this.localVal,this.setCaretPosition(t+1)},actionInsOverline(){const t=this.getCursortPosition(),o=this.localVal.substring(t-1,t);this.insertContent("~~~~"),o!==`
|
|
@@ -55,4 +55,4 @@ row 2 col 1 | row 2 col 2
|
|
|
55
55
|
`).length,this.textareaHeight=22*this.indexLenth,this.addImageClickListener(),this.addCopyListener(),this.$emit("update:modelValue",t)},30)},modelValue(){this.localVal!==this.modelValue&&(this.localVal=this.modelValue)}},mounted(){this.init()},methods:{init(){this.localVal=this.modelValue,this.codemrrConfig.theme=this.theme,setTimeout(()=>{const t=this.$refs.textarea;t.focus(),t.addEventListener("keydown",o=>{o.keyCode===83&&(o.metaKey||o.ctrlKey)&&(o.preventDefault(),this.actionSaveSet())}),t.addEventListener("paste",this.handlePaste),this.autoSave&&(this.timerId=setInterval(()=>{this.actionSaveSet()},this.interval)),this.$emit("on-ready",{vm:this,insertContent:this.insertContent})},20)},insertContent(t){this.lastInsert=t;const o=this.getCursortPosition(),a=this.localVal.substring(o-1,o),i=this.localVal.substring(o-4,o);if(a!==`
|
|
56
56
|
`&&this.localVal!==""&&i!==" "){const l=`
|
|
57
57
|
`+t;this.insertAfterText(l)}else this.insertAfterText(t)},getCursortPosition(){const t=this.$refs.textarea;let o=0;if(document.selection){t.focus();let a=document.selection.createRange();a.moveStart("character",-this.localVal.length),o=a.text.length}else(t.selectionStart||parseInt(t.selectionStart,0)===0)&&(o=t.selectionStart);return o},insertAfterText(t){const o=this.$refs.textarea;let a;if(document.selection)o.focus(),a=document.selection.createRange(),a.text=t,o.focus();else if(o.selectionStart||parseInt(o.selectionStart,0)===0){const i=o.selectionStart,l=o.selectionEnd,n=o.scrollTop;o.value=o.value.substring(0,i)+t+o.value.substring(l,o.value.length),o.focus(),o.selectionStart=i+t.length,o.selectionEnd=i+t.length,o.scrollTop=n}else o.value+=t,o.focus();this.localVal=o.value},setCaretPosition(t){const o=this.$refs.textarea;if(o.setSelectionRange)o.focus(),o.setSelectionRange(t,t);else if(o.createTextRange){let a=o.createTextRange();a.collapse(!0),a.moveEnd("character",t),a.moveStart("character",t),a.select()}},tab(t){this.insertContent(" ",this),t.preventDefault?t.preventDefault():t.returnValue=!1},enter(){const{lastInsert:t}=this;["- ","1. ","- [ ] ","- [x] "].includes(t)&&this.insertContent(t)},onDelete(){const t=this.localVal.split(`
|
|
58
|
-
`);t[t.length-1]===""&&(this.lastInsert="")},mousescrollSide(t){this.scrollSide=t},handlePaste(t){const{clipboardData:o={}}=t,{types:a=[],items:i}=o;let l=null;for(let n=0;n<a.length;n++)if(a[n]==="Files"){l=i[n];break}if(l){const n=l.getAsFile();/image/gi.test(n.type)&&(this.$emit("on-upload-image",n),this.$emit("on-paste-image",n),t.preventDefault())}},markdownScroll(){const{scrolling:t}=this;if(t&&this.scroll==="left"){const o=this.$refs.markdownEditor,a=this.$refs.preview,i=a.offsetHeight,l=o.scrollHeight,n=o.scrollTop,r=a.scrollHeight;a.scrollTop=parseInt(n/(l-i)*(r-i),0)}},previewScroll(){const{scrolling:t}=this;if(t&&this.scroll==="right"){const o=this.$refs.markdownEditor,a=this.$refs.preview,i=a.offsetHeight,l=o.scrollHeight,n=a.scrollHeight,r=a.scrollTop;o.scrollTop=parseInt(r/(n-i)*(l-i),0)}},mousescrollSide(t){this.scroll=t}}},yg={key:0,title:"头部工具栏"},kg={class:"cv-editor-toolbars"},bg={key:0,name:"粗体"},wg={key:1,name:"斜体"},Vg={key:2,name:"删除线"},xg={key:3,name:"下划线"},Ng={key:4,name:"标题1"},Sg={key:5,name:"标题2"},Bg={key:6,name:"标题3"},Eg={key:7,name:"标题4"},Dg={key:8,name:"标题5"},_g={key:9,name:"标题6"},Tg={key:10,name:"分割线"},Ig={key:11,name:"引用"},Lg={key:12,name:"无序列表"},Fg={key:13,name:"有序列表"},Og={key:14,name:"未完成列表"},$g={key:15,name:"已完成列表"},zg={key:16,name:"链接"},Pg={key:17,name:"表格"},Mg=["name"],Hg={key:19,name:"全屏编辑"},Ag={key:20,name:"分屏显示"},jg={key:21,name:"预览"},Rg={class:"cv-editor-toolbars"},Ug={key:0,name:"图片"},Wg={key:1,name:"本地图片"},Yg={key:2,name:"图片空间"},Xg={key:3,name:"上传图片"},qg={key:4,name:"上传文件"},Kg={key:5,class:"shift-theme",name:"代码块主题"},Gg={name:"导入文件",class:"import-file"},Zg={name:"保存到本地"},Qg={key:6,name:"全屏"},Jg={key:7,name:"退出全屏"},e1=["innerHTML"],Jt=v(vg,[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`markdown ${l.fullscreen?"fullscreen":""} ${a.bordered?"border":""}`),ref:"markdown",style:e.normalizeStyle({width:a.width+(typeof a.width=="string"?"":"px"),height:a.height+(typeof a.height=="string"?"":"px")})},[t.actionPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",yg,[e.createElementVNode("ul",kg,[e.createElementVNode("li",null,[e.renderSlot(t.$slots,"title",{},void 0,!0)]),t.toolConfig.strong?(e.openBlock(),e.createElementBlock("li",bg,[e.createElementVNode("span",{onClick:o[0]||(o[0]=(...r)=>t.actionInsStrong&&t.actionInsStrong(...r)),class:"iconfont icon-bold"})])):e.createCommentVNode("",!0),t.toolConfig.italic?(e.openBlock(),e.createElementBlock("li",wg,[e.createElementVNode("span",{onClick:o[1]||(o[1]=(...r)=>t.actionInsItalic&&t.actionInsItalic(...r)),class:"iconfont icon-italic"})])):e.createCommentVNode("",!0),t.toolConfig.overline?(e.openBlock(),e.createElementBlock("li",Vg,[e.createElementVNode("span",{onClick:o[2]||(o[2]=(...r)=>t.actionInsOverline&&t.actionInsOverline(...r)),class:"iconfont icon-overline"})])):e.createCommentVNode("",!0),t.toolConfig.overline?(e.openBlock(),e.createElementBlock("li",xg,[e.createElementVNode("span",{onClick:o[3]||(o[3]=(...r)=>t.actionInsUnderline&&t.actionInsUnderline(...r)),class:"iconfont icon-under-line"})])):e.createCommentVNode("",!0),t.toolConfig.h1?(e.openBlock(),e.createElementBlock("li",Ng,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[4]||(o[4]=r=>t.actionInsTitle(1))},"h1")])):e.createCommentVNode("",!0),t.toolConfig.h2?(e.openBlock(),e.createElementBlock("li",Sg,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[5]||(o[5]=r=>t.actionInsTitle(2))},"h2")])):e.createCommentVNode("",!0),t.toolConfig.h3?(e.openBlock(),e.createElementBlock("li",Bg,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[6]||(o[6]=r=>t.actionInsTitle(3))},"h3")])):e.createCommentVNode("",!0),t.toolConfig.h4?(e.openBlock(),e.createElementBlock("li",Eg,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[7]||(o[7]=r=>t.actionInsTitle(4))},"h4")])):e.createCommentVNode("",!0),t.toolConfig.h5?(e.openBlock(),e.createElementBlock("li",Dg,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[8]||(o[8]=r=>t.actionInsTitle(5))},"h5")])):e.createCommentVNode("",!0),t.toolConfig.h6?(e.openBlock(),e.createElementBlock("li",_g,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[9]||(o[9]=r=>t.actionInsTitle(6))},"h6")])):e.createCommentVNode("",!0),t.toolConfig.hr?(e.openBlock(),e.createElementBlock("li",Tg,[e.createElementVNode("span",{onClick:o[10]||(o[10]=(...r)=>t.actionInsLine&&t.actionInsLine(...r)),class:"iconfont icon-horizontal"})])):e.createCommentVNode("",!0),t.toolConfig.quote?(e.openBlock(),e.createElementBlock("li",Ig,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[11]||(o[11]=(...r)=>t.actionInsQuote&&t.actionInsQuote(...r)),class:"iconfont icon-quote"})])):e.createCommentVNode("",!0),t.toolConfig.ul?(e.openBlock(),e.createElementBlock("li",Lg,[e.createElementVNode("span",{onClick:o[12]||(o[12]=(...r)=>t.actionInsUl&&t.actionInsUl(...r)),class:"iconfont icon-ul"})])):e.createCommentVNode("",!0),t.toolConfig.ol?(e.openBlock(),e.createElementBlock("li",Fg,[e.createElementVNode("span",{onClick:o[13]||(o[13]=(...r)=>t.actionInsOl&&t.actionInsOl(...r)),class:"iconfont icon-ol"})])):e.createCommentVNode("",!0),t.toolConfig.notChecked?(e.openBlock(),e.createElementBlock("li",Og,[e.createElementVNode("span",{onClick:o[14]||(o[14]=(...r)=>t.insertNotFinished&&t.insertNotFinished(...r)),class:"iconfont icon-checked-false"})])):e.createCommentVNode("",!0),t.toolConfig.checked?(e.openBlock(),e.createElementBlock("li",$g,[e.createElementVNode("span",{onClick:o[15]||(o[15]=(...r)=>t.insertFinished&&t.insertFinished(...r)),class:"iconfont icon-checked"})])):e.createCommentVNode("",!0),t.toolConfig.link?(e.openBlock(),e.createElementBlock("li",zg,[e.createElementVNode("span",{onClick:o[16]||(o[16]=(...r)=>t.actionInsLink&&t.actionInsLink(...r)),class:"iconfont icon-link"})])):e.createCommentVNode("",!0),t.toolConfig.table?(e.openBlock(),e.createElementBlock("li",Pg,[e.createElementVNode("span",{onClick:o[17]||(o[17]=(...r)=>t.actionInsTable&&t.actionInsTable(...r)),class:"iconfont icon-table"})])):e.createCommentVNode("",!0),o[53]||(o[53]=e.createElementVNode("li",{class:"empty"},null,-1)),t.toolConfig.scrollSync?(e.openBlock(),e.createElementBlock("li",{key:18,name:t.actionScrollSync?"同步滚动:开":"同步滚动:关"},[e.withDirectives(e.createElementVNode("span",{onClick:o[18]||(o[18]=r=>t.actionScrollSync=!t.actionScrollSync),class:"iconfont icon-on"},null,512),[[e.vShow,t.actionScrollSync]]),e.withDirectives(e.createElementVNode("span",{onClick:o[19]||(o[19]=r=>t.actionScrollSync=!t.actionScrollSync),class:"iconfont icon-off"},null,512),[[e.vShow,!t.actionScrollSync]])],8,Mg)):e.createCommentVNode("",!0),t.toolConfig.split&&t.actionSplit?(e.openBlock(),e.createElementBlock("li",Hg,[e.createElementVNode("span",{onClick:o[20]||(o[20]=r=>t.actionSplit=!1),class:"iconfont icon-md"})])):e.createCommentVNode("",!0),t.toolConfig.split&&!t.actionSplit?(e.openBlock(),e.createElementBlock("li",Ag,[e.createElementVNode("span",{onClick:o[21]||(o[21]=r=>t.actionSplit=!0),class:"iconfont icon-group"})])):e.createCommentVNode("",!0),t.toolConfig.preview?(e.openBlock(),e.createElementBlock("li",jg,[e.createElementVNode("span",{onClick:o[22]||(o[22]=r=>t.actionPreview=!0),class:"iconfont icon-preview"})])):e.createCommentVNode("",!0),t.toolConfig.clear?(e.openBlock(),e.createElementBlock("li",{key:22,name:"清空",onClick:o[23]||(o[23]=r=>l.localVal="")},o[51]||(o[51]=[e.createElementVNode("span",{class:"iconfont icon-clear"},null,-1)]))):e.createCommentVNode("",!0),t.toolConfig.save?(e.openBlock(),e.createElementBlock("li",{key:23,name:"保存",onClick:o[24]||(o[24]=(...r)=>t.actionSaveSet&&t.actionSaveSet(...r))},o[52]||(o[52]=[e.createElementVNode("span",{class:"iconfont icon-save"},null,-1)]))):e.createCommentVNode("",!0)]),e.createElementVNode("ul",Rg,[t.toolConfig.image?(e.openBlock(),e.createElementBlock("li",Ug,[e.createElementVNode("span",{onClick:o[25]||(o[25]=(...r)=>t.actionInsImage&&t.actionInsImage(...r)),class:"iconfont icon-img"})])):e.createCommentVNode("",!0),t.toolConfig.uploadImage?(e.openBlock(),e.createElementBlock("li",Wg,[e.createElementVNode("span",{onClick:o[26]||(o[26]=(...r)=>t.actionChooseImage&&t.actionChooseImage(...r)),class:"iconfont icon-upload-img"})])):e.createCommentVNode("",!0),t.toolConfig.custom_image?(e.openBlock(),e.createElementBlock("li",Yg,[e.createElementVNode("span",{onClick:o[27]||(o[27]=(...r)=>t.custom_actionInsImage&&t.custom_actionInsImage(...r)),class:"iconfont icon-img"})])):e.createCommentVNode("",!0),t.toolConfig.custom_uploadImage?(e.openBlock(),e.createElementBlock("li",Xg,[e.createElementVNode("span",{onClick:o[28]||(o[28]=(...r)=>t.custom_chooseImage&&t.custom_chooseImage(...r)),class:"iconfont icon-upload-img"})])):e.createCommentVNode("",!0),t.toolConfig.custom_uploadFile?(e.openBlock(),e.createElementBlock("li",qg,[e.createElementVNode("span",{onClick:o[29]||(o[29]=(...r)=>t.custom_chooseFile&&t.custom_chooseFile(...r)),class:"iconfont icon-upload-img"})])):e.createCommentVNode("",!0),t.toolConfig.theme?(e.openBlock(),e.createElementBlock("li",Kg,[e.createElementVNode("div",null,[e.createElementVNode("span",{class:"iconfont icon-theme",onClick:o[30]||(o[30]=r=>l.themeSlideDown=!l.themeSlideDown)}),e.createElementVNode("ul",{class:e.normalizeClass({active:l.themeSlideDown}),onMouseleave:o[35]||(o[35]=r=>l.themeSlideDown=!1)},[e.createElementVNode("li",{onClick:o[31]||(o[31]=r=>t.setThemes("light"))},"Light"),e.createElementVNode("li",{onClick:o[32]||(o[32]=r=>t.setThemes("dark"))},"VS Code"),e.createElementVNode("li",{onClick:o[33]||(o[33]=r=>t.setThemes("oneDark"))},"Atom OneDark"),e.createElementVNode("li",{onClick:o[34]||(o[34]=r=>t.setThemes("gitHub"))},"GitHub")],34)])])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("li",Gg,[e.createElementVNode("span",{class:"iconfont icon-daoru",onClick:o[36]||(o[36]=(...r)=>t.actionImportFile&&t.actionImportFile(...r))}),e.createElementVNode("input",{type:"file",onChange:o[37]||(o[37]=r=>t.actionImportFile(r)),accept:"text/markdown"},null,32)],512),[[e.vShow,t.toolConfig.importmd]]),e.withDirectives(e.createElementVNode("li",Zg,[e.createElementVNode("span",{class:"iconfont icon-download",onClick:o[38]||(o[38]=(...r)=>t.actionExportFile&&t.actionExportFile(...r))})],512),[[e.vShow,t.toolConfig.exportmd]]),o[54]||(o[54]=e.createElementVNode("li",{class:"empty"},null,-1)),t.toolConfig.fullscreen&&!l.fullscreen?(e.openBlock(),e.createElementBlock("li",Qg,[e.createElementVNode("span",{onClick:o[39]||(o[39]=r=>l.fullscreen=!l.fullscreen),class:"iconfont icon-fullscreen"})])):e.createCommentVNode("",!0),t.toolConfig.fullscreen&&l.fullscreen?(e.openBlock(),e.createElementBlock("li",Jg,[e.createElementVNode("span",{onClick:o[40]||(o[40]=r=>l.fullscreen=!l.fullscreen),class:"iconfont icon-quite"})])):e.createCommentVNode("",!0)])])),e.withDirectives(e.createElementVNode("div",{title:"关闭预览按钮",class:"close-preview",onClick:o[41]||(o[41]=r=>t.actionPreview=!1)},o[55]||(o[55]=[e.createElementVNode("span",{class:"iconfont icon-close"},null,-1)]),512),[[e.vShow,t.actionPreview]]),e.createElementVNode("div",{title:"编辑器",class:"cv-editor-markdown-main",style:e.normalizeStyle({background:t.actionPreview?"#fff":""})},[e.withDirectives(e.createElementVNode("div",{class:"markdown-editor",ref:"markdownEditor",onScroll:o[47]||(o[47]=(...r)=>n.markdownScroll&&n.markdownScroll(...r)),onMouseenter:o[48]||(o[48]=r=>n.mousescrollSide("markdown"))},[e.createElementVNode("ul",{class:"index",ref:"index",style:e.normalizeStyle({height:l.textareaHeight?`${l.textareaHeight}px`:"100%"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.indexLenth,r=>(e.openBlock(),e.createElementBlock("li",{key:r},e.toDisplayString(r),1))),128))],4),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":o[42]||(o[42]=r=>l.localVal=r),ref:"textarea",onKeydown:o[43]||(o[43]=e.withKeys((...r)=>n.tab&&n.tab(...r),["tab"])),onKeyup:[o[44]||(o[44]=e.withKeys((...r)=>n.enter&&n.enter(...r),["enter"])),o[45]||(o[45]=e.withKeys((...r)=>n.onDelete&&n.onDelete(...r),["delete"]))],onMouseenter:o[46]||(o[46]=r=>n.mousescrollSide("left")),style:e.normalizeStyle({height:l.textareaHeight?`${l.textareaHeight}px`:"100%"})},null,36),[[e.vModelText,l.localVal]])],544),[[e.vShow,!t.preview]]),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass("markdown-preview "+("markdown-theme-"+t.codemrrConfig.theme)),ref:"preview",onScroll:o[49]||(o[49]=(...r)=>n.previewScroll&&n.previewScroll(...r)),onMouseenter:o[50]||(o[50]=r=>n.mousescrollSide("right"))},[e.createElementVNode("div",{innerHTML:l.html,ref:"previewInner"},null,8,e1)],34),[[e.vShow,t.preview?t.preview:t.split]])],4)],6)}],["__scopeId","data-v-36211c6f"]]),t1=["innerHTML"],eo=v({name:"cvMarkdownNostyle",props:{modelValue:{type:String,default:""},initValue:{type:String,default:""}},data:()=>({localHtml:"",localVal:""}),watch:{initValue(){this.initNewCreate()}},created(){this.localVal=this.initValue||""},async mounted(){this.initNewCreate()},methods:{async initNewCreate(){const{Marked:t,Renderer:o}=await import("https://10ui.cn/marked/@12.0.1/marked.esm.js");let a=new t().parser(this.localVal,{sanitize:!1});a=a.replace(/href="/gi,'target="_blank" href="'),this.localHtml=a}}},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",{class:"markdown-preview-nostyle",innerHTML:l.localHtml},null,8,t1)}]]);function Wo(t){return{text:"按钮",clickFn:null,type:"default",isHide:!1,order:2,...t}}Zt.install=function(t){t.component(Zt.name,Zt)},Qt.install=function(t){t.component(Qt.name,Qt)},Jt.install=function(t){t.component(Jt.name,Jt)},eo.install=function(t){t.component(eo.name,eo)},qt.install=function(t){t.component(qt.name,qt)},Kt.install=function(t){t.component(Kt.name,Kt)},Gt.install=function(t){t.component(Gt.name,Gt)};class o1{constructor(o,a){this.WinVue=o,this.vmCompObj=null,this.vmComponent=null,this.vmApp=null,this.dialogObj=null,this.boxShow=e.ref(!1),this.boxProps=e.ref({}),this.boxOptions=G({closeIsConfirm:!1,closeIsDestroy:!0,width:"40%",title:"默认标题"},a.diyOpts),this.boxProps.value=_l(this.boxOptions,["closeIsConfirm","closeIsDestroy"]),this.bodyComponent=a.component||"",this.bodyOptions=G({},a.props),this.bodyFunc=G({},a.onFunc);for(const i in this.bodyFunc)if(this.bodyFunc.hasOwnProperty(i)&&!i.startsWith("on")){const l="on"+i.charAt(0).toUpperCase()+i.slice(1);this.bodyFunc[l]=this.bodyFunc[i],delete this.bodyFunc[i]}this.defaultFunc={onOK:()=>{this.close()},onCancel:()=>{this.close()}},this._initVm()}_initVm(){var o=this;const a={data:()=>({}),methods:{clearVm(){o.vmApp&&o.close()}},mounted(){},unmounted(){},render(){const n=e.createVNode(o.bodyComponent,{...o.bodyOptions,ref:"inner",onSetTitle(p){o.boxProps.value.title=p},onClose:()=>o.close(),...o.bodyFunc},{default:()=>""});let r={ok:Wo({text:"确定",type:"primary",order:0}),cancel:Wo({text:"取消",order:1})};Object.entries(r).forEach(([p,u])=>{if(["ok","cancel"].includes(p)){const m=p==="ok"?o.defaultFunc.onOK:o.defaultFunc.onCancel;u.clickFn=u.clickFn||m}else r[p]=Wo(u)});const c=Object.values(r).filter(p=>!p.isHide);e.createVNode("div",{},c.map(p=>e.createVNode(k.ElButton,{type:p.type,onClick:p.clickFn},p.text)));const h=function(p){o.close()},d=typeof o.boxOptions.beforeClose=="function"?o.boxOptions.beforeClose:h;return e.createVNode(k.ElDialog,{...o.boxProps.value,modelValue:o.boxShow.value,beforeClose:p=>{o.boxOptions.closeIsConfirm?k.ElMessageBox.confirm("确认关闭?","提示").then(u=>{d(h)}).catch(u=>{h()}):d(h)},onClosed2(p){o.close()},onClosed:o.close},{default:()=>n})}};this.vmComponent=a;const i=document.createElement("div");document.body.appendChild(i),this.vmTargetElement=i;const l=e.createVNode(a);l.appContext=this.WinVue._context,e.render(l,this.vmTargetElement),this.vmApp=l}close(){this.boxShow&&(this.boxShow.value=!1),this.vmTargetElement&&(e.render(null,this.vmTargetElement),document.body.removeChild(this.vmTargetElement),this.vmApp=null)}show(){this.boxShow.value=!0}getInner(){return this.vmCompObj.$refs.inner}}function Yo(t){return{text:"按钮",clickFn:null,type:"default",isHide:!1,order:2,...t}}class a1{constructor(o,a){this.WinVue=o,this.vmCompObj=null,this.vmComponent=null,this.vmApp=null,this.dialogObj=null,this.boxShow=e.ref(!1),this.boxProps=e.ref({}),this.boxOptions=G({closeIsConfirm:!0,closeIsDestroy:!0,width:"40%",title:"默认标题"},a.diyOpts),this.boxProps.value=_l(this.boxOptions,["closeIsConfirm","closeIsDestroy"]),this.bodyComponent=a.component||"",this.bodyOptions=G({},a.props),this.bodyFunc=G({},a.onFunc);for(const i in this.bodyFunc)if(this.bodyFunc.hasOwnProperty(i)&&!i.startsWith("on")){const l="on"+i.charAt(0).toUpperCase()+i.slice(1);this.bodyFunc[l]=this.bodyFunc[i],delete this.bodyFunc[i]}this.defaultFunc={onOK:()=>{this.close()},onCancel:()=>{this.close()}},this._initVm()}_initVm(){var o=this;const a={data:()=>({}),methods:{clearVm(){o.vmApp&&o.close()}},mounted(){},unmounted(){document.body.removeChild(o.vmTargetElement)},render(){const n=e.createVNode(o.bodyComponent,{...o.bodyOptions,ref:"inner",onSetTitle(p){o.boxProps.value.title=p},onClose:this.clearVm,...o.bodyFunc},{default:()=>""});let r={ok:Yo({text:"确定",type:"primary",order:0}),cancel:Yo({text:"取消",order:1})};Object.entries(r).forEach(([p,u])=>{if(["ok","cancel"].includes(p)){const m=p==="ok"?o.defaultFunc.onOK:o.defaultFunc.onCancel;u.clickFn=u.clickFn||m}else r[p]=Yo(u)});const c=Object.values(r).filter(p=>!p.isHide);e.createVNode("div",{},c.map(p=>e.createVNode(k.ElButton,{type:p.type,onClick:p.clickFn},p.text)));const h=function(p){o.close()},d=typeof o.boxOptions.beforeClose=="function"?o.boxOptions.beforeClose:h;return e.createVNode(k.ElDrawer,{...o.boxProps.value,modelValue:o.boxShow.value,beforeClose:p=>{o.boxOptions.closeIsConfirm?k.ElMessageBox.confirm("确认关闭?","提示").then(u=>{d(h)}).catch(u=>{h()}):d(h)},onClosed2(p){this.clearVm()},onClosed:this.clearVm},{default:()=>n})}};this.vmComponent=a;const i=document.createElement("div");document.body.appendChild(i),this.vmTargetElement=i;const l=e.createVNode(a);l.appContext=this.WinVue._context,e.render(l,this.vmTargetElement),this.vmApp=l}close(){this.boxShow.value=!1,e.render(null,this.vmTargetElement)}show(){this.boxShow.value=!0}getInner(){return this.vmCompObj.$refs.inner}}function Xl(t,o=null,a={},i={},l={}){const n=new o1(t,{component:o,diyOpts:a,props:i,onFunc:l,onOK(){n.getInner(),n.close()},onCancel(){n.close()}});return n}function ql(t,o="",a={},i={},l=null){const n=new a1(t,{component:o,diyOpts:{...a},props:i,onFunc:l,onOK(){n.getInner(),n.close()},onCancel(){n.close()}});return n}var Kl=[ke,be,we,Ve,xe,Ne,Se,Be,Ee,De,xn,_e,Te,Ie,Le,Fe,Oe,Pe,Me,$e,ze,He,Ae,je,We,Re,Ue,Ke,Ye,Xe,qe,Qe,Je,et,tt,ot,at,lt,nt,it,rt,st,ct,dt,pt,mt,ut,gt,ft,bt,wt,ht,yt,kt,xt,Vt,Nt,Ft,Ot,$t,zt,Pt,Mt,St,Bt,Et,Dt,_t,Tt,It,Lt,Ct,vt,Ge,Ze,Ht,At,jt,Ut,Rt,Wt,Yt,qt,Kt,Gt,Zt,Qt,Jt,eo];const Jo=function(t,o={}){Kl.forEach(a=>{t.component(a.name,a)}),t.config.globalProperties.$cvUiParams={...o},t.config.globalProperties.$cvDialogRender=function(){return Xl(t,...arguments)},t.config.globalProperties.$cvCopy=Xn,t.config.globalProperties.$cvDrawerRender=function(){return ql(t,...arguments)},t.config.globalProperties.CDN_URL_UI="https://10ui.cn/"};typeof window<"u"&&window._vueApp_&&Jo(window._vueApp_);const l1={version:"0.3.x",install:Jo};exports.components=Kl,exports.cvDialogRender=Xl,exports.cvDrawerRender=ql,exports.default=l1,exports.install=Jo;
|
|
58
|
+
`);t[t.length-1]===""&&(this.lastInsert="")},mousescrollSide(t){this.scrollSide=t},handlePaste(t){const{clipboardData:o={}}=t,{types:a=[],items:i}=o;let l=null;for(let n=0;n<a.length;n++)if(a[n]==="Files"){l=i[n];break}if(l){const n=l.getAsFile();/image/gi.test(n.type)&&(this.$emit("on-upload-image",n),this.$emit("on-paste-image",n),t.preventDefault())}},markdownScroll(){const{scrolling:t}=this;if(t&&this.scroll==="left"){const o=this.$refs.markdownEditor,a=this.$refs.preview,i=a.offsetHeight,l=o.scrollHeight,n=o.scrollTop,r=a.scrollHeight;a.scrollTop=parseInt(n/(l-i)*(r-i),0)}},previewScroll(){const{scrolling:t}=this;if(t&&this.scroll==="right"){const o=this.$refs.markdownEditor,a=this.$refs.preview,i=a.offsetHeight,l=o.scrollHeight,n=a.scrollHeight,r=a.scrollTop;o.scrollTop=parseInt(r/(n-i)*(l-i),0)}},mousescrollSide(t){this.scroll=t}}},kg={key:0,title:"头部工具栏"},bg={class:"cv-editor-toolbars"},wg={key:0,name:"粗体"},Vg={key:1,name:"斜体"},xg={key:2,name:"删除线"},Ng={key:3,name:"下划线"},Sg={key:4,name:"标题1"},Bg={key:5,name:"标题2"},Eg={key:6,name:"标题3"},Dg={key:7,name:"标题4"},_g={key:8,name:"标题5"},Tg={key:9,name:"标题6"},Ig={key:10,name:"分割线"},Lg={key:11,name:"引用"},Fg={key:12,name:"无序列表"},Og={key:13,name:"有序列表"},$g={key:14,name:"未完成列表"},zg={key:15,name:"已完成列表"},Pg={key:16,name:"链接"},Mg={key:17,name:"表格"},Hg=["name"],Ag={key:19,name:"全屏编辑"},jg={key:20,name:"分屏显示"},Rg={key:21,name:"预览"},Ug={class:"cv-editor-toolbars"},Wg={key:0,name:"图片"},Yg={key:1,name:"本地图片"},Xg={key:2,name:"图片空间"},qg={key:3,name:"上传图片"},Kg={key:4,name:"上传文件"},Gg={key:5,class:"shift-theme",name:"代码块主题"},Zg={name:"导入文件",class:"import-file"},Qg={name:"保存到本地"},Jg={key:6,name:"全屏"},e1={key:7,name:"退出全屏"},t1=["innerHTML"],Jt=v(yg,[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`markdown ${l.fullscreen?"fullscreen":""} ${a.bordered?"border":""}`),ref:"markdown",style:e.normalizeStyle({width:a.width+(typeof a.width=="string"?"":"px"),height:a.height+(typeof a.height=="string"?"":"px")})},[t.actionPreview?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",kg,[e.createElementVNode("ul",bg,[e.createElementVNode("li",null,[e.renderSlot(t.$slots,"title",{},void 0,!0)]),t.toolConfig.strong?(e.openBlock(),e.createElementBlock("li",wg,[e.createElementVNode("span",{onClick:o[0]||(o[0]=(...r)=>t.actionInsStrong&&t.actionInsStrong(...r)),class:"iconfont icon-bold"})])):e.createCommentVNode("",!0),t.toolConfig.italic?(e.openBlock(),e.createElementBlock("li",Vg,[e.createElementVNode("span",{onClick:o[1]||(o[1]=(...r)=>t.actionInsItalic&&t.actionInsItalic(...r)),class:"iconfont icon-italic"})])):e.createCommentVNode("",!0),t.toolConfig.overline?(e.openBlock(),e.createElementBlock("li",xg,[e.createElementVNode("span",{onClick:o[2]||(o[2]=(...r)=>t.actionInsOverline&&t.actionInsOverline(...r)),class:"iconfont icon-overline"})])):e.createCommentVNode("",!0),t.toolConfig.overline?(e.openBlock(),e.createElementBlock("li",Ng,[e.createElementVNode("span",{onClick:o[3]||(o[3]=(...r)=>t.actionInsUnderline&&t.actionInsUnderline(...r)),class:"iconfont icon-under-line"})])):e.createCommentVNode("",!0),t.toolConfig.h1?(e.openBlock(),e.createElementBlock("li",Sg,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[4]||(o[4]=r=>t.actionInsTitle(1))},"h1")])):e.createCommentVNode("",!0),t.toolConfig.h2?(e.openBlock(),e.createElementBlock("li",Bg,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[5]||(o[5]=r=>t.actionInsTitle(2))},"h2")])):e.createCommentVNode("",!0),t.toolConfig.h3?(e.openBlock(),e.createElementBlock("li",Eg,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[6]||(o[6]=r=>t.actionInsTitle(3))},"h3")])):e.createCommentVNode("",!0),t.toolConfig.h4?(e.openBlock(),e.createElementBlock("li",Dg,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[7]||(o[7]=r=>t.actionInsTitle(4))},"h4")])):e.createCommentVNode("",!0),t.toolConfig.h5?(e.openBlock(),e.createElementBlock("li",_g,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[8]||(o[8]=r=>t.actionInsTitle(5))},"h5")])):e.createCommentVNode("",!0),t.toolConfig.h6?(e.openBlock(),e.createElementBlock("li",Tg,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[9]||(o[9]=r=>t.actionInsTitle(6))},"h6")])):e.createCommentVNode("",!0),t.toolConfig.hr?(e.openBlock(),e.createElementBlock("li",Ig,[e.createElementVNode("span",{onClick:o[10]||(o[10]=(...r)=>t.actionInsLine&&t.actionInsLine(...r)),class:"iconfont icon-horizontal"})])):e.createCommentVNode("",!0),t.toolConfig.quote?(e.openBlock(),e.createElementBlock("li",Lg,[e.createElementVNode("span",{style:{"font-size":"16px"},onClick:o[11]||(o[11]=(...r)=>t.actionInsQuote&&t.actionInsQuote(...r)),class:"iconfont icon-quote"})])):e.createCommentVNode("",!0),t.toolConfig.ul?(e.openBlock(),e.createElementBlock("li",Fg,[e.createElementVNode("span",{onClick:o[12]||(o[12]=(...r)=>t.actionInsUl&&t.actionInsUl(...r)),class:"iconfont icon-ul"})])):e.createCommentVNode("",!0),t.toolConfig.ol?(e.openBlock(),e.createElementBlock("li",Og,[e.createElementVNode("span",{onClick:o[13]||(o[13]=(...r)=>t.actionInsOl&&t.actionInsOl(...r)),class:"iconfont icon-ol"})])):e.createCommentVNode("",!0),t.toolConfig.notChecked?(e.openBlock(),e.createElementBlock("li",$g,[e.createElementVNode("span",{onClick:o[14]||(o[14]=(...r)=>t.insertNotFinished&&t.insertNotFinished(...r)),class:"iconfont icon-checked-false"})])):e.createCommentVNode("",!0),t.toolConfig.checked?(e.openBlock(),e.createElementBlock("li",zg,[e.createElementVNode("span",{onClick:o[15]||(o[15]=(...r)=>t.insertFinished&&t.insertFinished(...r)),class:"iconfont icon-checked"})])):e.createCommentVNode("",!0),t.toolConfig.link?(e.openBlock(),e.createElementBlock("li",Pg,[e.createElementVNode("span",{onClick:o[16]||(o[16]=(...r)=>t.actionInsLink&&t.actionInsLink(...r)),class:"iconfont icon-link"})])):e.createCommentVNode("",!0),t.toolConfig.table?(e.openBlock(),e.createElementBlock("li",Mg,[e.createElementVNode("span",{onClick:o[17]||(o[17]=(...r)=>t.actionInsTable&&t.actionInsTable(...r)),class:"iconfont icon-table"})])):e.createCommentVNode("",!0),o[53]||(o[53]=e.createElementVNode("li",{class:"empty"},null,-1)),t.toolConfig.scrollSync?(e.openBlock(),e.createElementBlock("li",{key:18,name:t.actionScrollSync?"同步滚动:开":"同步滚动:关"},[e.withDirectives(e.createElementVNode("span",{onClick:o[18]||(o[18]=r=>t.actionScrollSync=!t.actionScrollSync),class:"iconfont icon-on"},null,512),[[e.vShow,t.actionScrollSync]]),e.withDirectives(e.createElementVNode("span",{onClick:o[19]||(o[19]=r=>t.actionScrollSync=!t.actionScrollSync),class:"iconfont icon-off"},null,512),[[e.vShow,!t.actionScrollSync]])],8,Hg)):e.createCommentVNode("",!0),t.toolConfig.split&&t.actionSplit?(e.openBlock(),e.createElementBlock("li",Ag,[e.createElementVNode("span",{onClick:o[20]||(o[20]=r=>t.actionSplit=!1),class:"iconfont icon-md"})])):e.createCommentVNode("",!0),t.toolConfig.split&&!t.actionSplit?(e.openBlock(),e.createElementBlock("li",jg,[e.createElementVNode("span",{onClick:o[21]||(o[21]=r=>t.actionSplit=!0),class:"iconfont icon-group"})])):e.createCommentVNode("",!0),t.toolConfig.preview?(e.openBlock(),e.createElementBlock("li",Rg,[e.createElementVNode("span",{onClick:o[22]||(o[22]=r=>t.actionPreview=!0),class:"iconfont icon-preview"})])):e.createCommentVNode("",!0),t.toolConfig.clear?(e.openBlock(),e.createElementBlock("li",{key:22,name:"清空",onClick:o[23]||(o[23]=r=>l.localVal="")},o[51]||(o[51]=[e.createElementVNode("span",{class:"iconfont icon-clear"},null,-1)]))):e.createCommentVNode("",!0),t.toolConfig.save?(e.openBlock(),e.createElementBlock("li",{key:23,name:"保存",onClick:o[24]||(o[24]=(...r)=>t.actionSaveSet&&t.actionSaveSet(...r))},o[52]||(o[52]=[e.createElementVNode("span",{class:"iconfont icon-save"},null,-1)]))):e.createCommentVNode("",!0)]),e.createElementVNode("ul",Ug,[t.toolConfig.image?(e.openBlock(),e.createElementBlock("li",Wg,[e.createElementVNode("span",{onClick:o[25]||(o[25]=(...r)=>t.actionInsImage&&t.actionInsImage(...r)),class:"iconfont icon-img"})])):e.createCommentVNode("",!0),t.toolConfig.uploadImage?(e.openBlock(),e.createElementBlock("li",Yg,[e.createElementVNode("span",{onClick:o[26]||(o[26]=(...r)=>t.actionChooseImage&&t.actionChooseImage(...r)),class:"iconfont icon-upload-img"})])):e.createCommentVNode("",!0),t.toolConfig.custom_image?(e.openBlock(),e.createElementBlock("li",Xg,[e.createElementVNode("span",{onClick:o[27]||(o[27]=(...r)=>t.custom_actionInsImage&&t.custom_actionInsImage(...r)),class:"iconfont icon-img"})])):e.createCommentVNode("",!0),t.toolConfig.custom_uploadImage?(e.openBlock(),e.createElementBlock("li",qg,[e.createElementVNode("span",{onClick:o[28]||(o[28]=(...r)=>t.custom_chooseImage&&t.custom_chooseImage(...r)),class:"iconfont icon-upload-img"})])):e.createCommentVNode("",!0),t.toolConfig.custom_uploadFile?(e.openBlock(),e.createElementBlock("li",Kg,[e.createElementVNode("span",{onClick:o[29]||(o[29]=(...r)=>t.custom_chooseFile&&t.custom_chooseFile(...r)),class:"iconfont icon-upload-img"})])):e.createCommentVNode("",!0),t.toolConfig.theme?(e.openBlock(),e.createElementBlock("li",Gg,[e.createElementVNode("div",null,[e.createElementVNode("span",{class:"iconfont icon-theme",onClick:o[30]||(o[30]=r=>l.themeSlideDown=!l.themeSlideDown)}),e.createElementVNode("ul",{class:e.normalizeClass({active:l.themeSlideDown}),onMouseleave:o[35]||(o[35]=r=>l.themeSlideDown=!1)},[e.createElementVNode("li",{onClick:o[31]||(o[31]=r=>t.setThemes("light"))},"Light"),e.createElementVNode("li",{onClick:o[32]||(o[32]=r=>t.setThemes("dark"))},"VS Code"),e.createElementVNode("li",{onClick:o[33]||(o[33]=r=>t.setThemes("oneDark"))},"Atom OneDark"),e.createElementVNode("li",{onClick:o[34]||(o[34]=r=>t.setThemes("gitHub"))},"GitHub")],34)])])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("li",Zg,[e.createElementVNode("span",{class:"iconfont icon-daoru",onClick:o[36]||(o[36]=(...r)=>t.actionImportFile&&t.actionImportFile(...r))}),e.createElementVNode("input",{type:"file",onChange:o[37]||(o[37]=r=>t.actionImportFile(r)),accept:"text/markdown"},null,32)],512),[[e.vShow,t.toolConfig.importmd]]),e.withDirectives(e.createElementVNode("li",Qg,[e.createElementVNode("span",{class:"iconfont icon-download",onClick:o[38]||(o[38]=(...r)=>t.actionExportFile&&t.actionExportFile(...r))})],512),[[e.vShow,t.toolConfig.exportmd]]),o[54]||(o[54]=e.createElementVNode("li",{class:"empty"},null,-1)),t.toolConfig.fullscreen&&!l.fullscreen?(e.openBlock(),e.createElementBlock("li",Jg,[e.createElementVNode("span",{onClick:o[39]||(o[39]=r=>l.fullscreen=!l.fullscreen),class:"iconfont icon-fullscreen"})])):e.createCommentVNode("",!0),t.toolConfig.fullscreen&&l.fullscreen?(e.openBlock(),e.createElementBlock("li",e1,[e.createElementVNode("span",{onClick:o[40]||(o[40]=r=>l.fullscreen=!l.fullscreen),class:"iconfont icon-quite"})])):e.createCommentVNode("",!0)])])),e.withDirectives(e.createElementVNode("div",{title:"关闭预览按钮",class:"close-preview",onClick:o[41]||(o[41]=r=>t.actionPreview=!1)},o[55]||(o[55]=[e.createElementVNode("span",{class:"iconfont icon-close"},null,-1)]),512),[[e.vShow,t.actionPreview]]),e.createElementVNode("div",{title:"编辑器",class:"cv-editor-markdown-main",style:e.normalizeStyle({background:t.actionPreview?"#fff":""})},[e.withDirectives(e.createElementVNode("div",{class:"markdown-editor",ref:"markdownEditor",onScroll:o[47]||(o[47]=(...r)=>n.markdownScroll&&n.markdownScroll(...r)),onMouseenter:o[48]||(o[48]=r=>n.mousescrollSide("markdown"))},[e.createElementVNode("ul",{class:"index",ref:"index",style:e.normalizeStyle({height:l.textareaHeight?`${l.textareaHeight}px`:"100%"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.indexLenth,r=>(e.openBlock(),e.createElementBlock("li",{key:r},e.toDisplayString(r),1))),128))],4),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":o[42]||(o[42]=r=>l.localVal=r),ref:"textarea",onKeydown:o[43]||(o[43]=e.withKeys((...r)=>n.tab&&n.tab(...r),["tab"])),onKeyup:[o[44]||(o[44]=e.withKeys((...r)=>n.enter&&n.enter(...r),["enter"])),o[45]||(o[45]=e.withKeys((...r)=>n.onDelete&&n.onDelete(...r),["delete"]))],onMouseenter:o[46]||(o[46]=r=>n.mousescrollSide("left")),style:e.normalizeStyle({height:l.textareaHeight?`${l.textareaHeight}px`:"100%"})},null,36),[[e.vModelText,l.localVal]])],544),[[e.vShow,!t.preview]]),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass("markdown-preview "+("markdown-theme-"+t.codemrrConfig.theme)),ref:"preview",onScroll:o[49]||(o[49]=(...r)=>n.previewScroll&&n.previewScroll(...r)),onMouseenter:o[50]||(o[50]=r=>n.mousescrollSide("right"))},[e.createElementVNode("div",{innerHTML:l.html,ref:"previewInner"},null,8,t1)],34),[[e.vShow,t.preview?t.preview:t.split]])],4)],6)}],["__scopeId","data-v-36211c6f"]]),o1=["innerHTML"],eo=v({name:"cvMarkdownNostyle",props:{modelValue:{type:String,default:""},initValue:{type:String,default:""}},data:()=>({localHtml:"",localVal:""}),watch:{initValue(){this.initNewCreate()}},created(){this.localVal=this.initValue||""},async mounted(){this.initNewCreate()},methods:{async initNewCreate(){const{Marked:t,Renderer:o}=await import("https://10ui.cn/marked/@12.0.1/marked.esm.js");let a=new t().parser(this.localVal,{sanitize:!1});a=a.replace(/href="/gi,'target="_blank" href="'),this.localHtml=a}}},[["render",function(t,o,a,i,l,n){return e.openBlock(),e.createElementBlock("div",{class:"markdown-preview-nostyle",innerHTML:l.localHtml},null,8,o1)}]]);function Wo(t){return{text:"按钮",clickFn:null,type:"default",isHide:!1,order:2,...t}}Zt.install=function(t){t.component(Zt.name,Zt)},Qt.install=function(t){t.component(Qt.name,Qt)},Jt.install=function(t){t.component(Jt.name,Jt)},eo.install=function(t){t.component(eo.name,eo)},qt.install=function(t){t.component(qt.name,qt)},Kt.install=function(t){t.component(Kt.name,Kt)},Gt.install=function(t){t.component(Gt.name,Gt)};class a1{constructor(o,a){this.WinVue=o,this.vmCompObj=null,this.vmComponent=null,this.vmApp=null,this.dialogObj=null,this.boxShow=e.ref(!1),this.boxProps=e.ref({}),this.boxOptions=G({closeIsConfirm:!1,closeIsDestroy:!0,width:"40%",title:"默认标题"},a.diyOpts),this.boxProps.value=_l(this.boxOptions,["closeIsConfirm","closeIsDestroy"]),this.bodyComponent=a.component||"",this.bodyOptions=G({},a.props),this.bodyFunc=G({},a.onFunc);for(const i in this.bodyFunc)if(this.bodyFunc.hasOwnProperty(i)&&!i.startsWith("on")){const l="on"+i.charAt(0).toUpperCase()+i.slice(1);this.bodyFunc[l]=this.bodyFunc[i],delete this.bodyFunc[i]}this.defaultFunc={onOK:()=>{this.close()},onCancel:()=>{this.close()}},this._initVm()}_initVm(){var o=this;const a={data:()=>({}),methods:{clearVm(){o.vmApp&&o.close()}},mounted(){},unmounted(){},render(){const n=e.createVNode(o.bodyComponent,{...o.bodyOptions,ref:"inner",onSetTitle(p){o.boxProps.value.title=p},onClose:()=>o.close(),...o.bodyFunc},{default:()=>""});let r={ok:Wo({text:"确定",type:"primary",order:0}),cancel:Wo({text:"取消",order:1})};Object.entries(r).forEach(([p,u])=>{if(["ok","cancel"].includes(p)){const m=p==="ok"?o.defaultFunc.onOK:o.defaultFunc.onCancel;u.clickFn=u.clickFn||m}else r[p]=Wo(u)});const c=Object.values(r).filter(p=>!p.isHide);e.createVNode("div",{},c.map(p=>e.createVNode(k.ElButton,{type:p.type,onClick:p.clickFn},p.text)));const h=function(p){o.close()},d=typeof o.boxOptions.beforeClose=="function"?o.boxOptions.beforeClose:h;return e.createVNode(k.ElDialog,{...o.boxProps.value,modelValue:o.boxShow.value,beforeClose:p=>{o.boxOptions.closeIsConfirm?k.ElMessageBox.confirm("确认关闭?","提示").then(u=>{d(h)}).catch(u=>{h()}):d(h)},onClosed2(p){o.close()},onClosed:o.close},{default:()=>n})}};this.vmComponent=a;const i=document.createElement("div");document.body.appendChild(i),this.vmTargetElement=i;const l=e.createVNode(a);l.appContext=this.WinVue._context,e.render(l,this.vmTargetElement),this.vmApp=l}close(){this.boxShow&&(this.boxShow.value=!1),this.vmTargetElement&&(e.render(null,this.vmTargetElement),document.body.removeChild(this.vmTargetElement),this.vmApp=null)}show(){this.boxShow.value=!0}getInner(){return this.vmCompObj.$refs.inner}}function Yo(t){return{text:"按钮",clickFn:null,type:"default",isHide:!1,order:2,...t}}class l1{constructor(o,a){this.WinVue=o,this.vmCompObj=null,this.vmComponent=null,this.vmApp=null,this.dialogObj=null,this.boxShow=e.ref(!1),this.boxProps=e.ref({}),this.boxOptions=G({closeIsConfirm:!0,closeIsDestroy:!0,width:"40%",title:"默认标题"},a.diyOpts),this.boxProps.value=_l(this.boxOptions,["closeIsConfirm","closeIsDestroy"]),this.bodyComponent=a.component||"",this.bodyOptions=G({},a.props),this.bodyFunc=G({},a.onFunc);for(const i in this.bodyFunc)if(this.bodyFunc.hasOwnProperty(i)&&!i.startsWith("on")){const l="on"+i.charAt(0).toUpperCase()+i.slice(1);this.bodyFunc[l]=this.bodyFunc[i],delete this.bodyFunc[i]}this.defaultFunc={onOK:()=>{this.close()},onCancel:()=>{this.close()}},this._initVm()}_initVm(){var o=this;const a={data:()=>({}),methods:{clearVm(){o.vmApp&&o.close()}},mounted(){},unmounted(){document.body.removeChild(o.vmTargetElement)},render(){const n=e.createVNode(o.bodyComponent,{...o.bodyOptions,ref:"inner",onSetTitle(p){o.boxProps.value.title=p},onClose:this.clearVm,...o.bodyFunc},{default:()=>""});let r={ok:Yo({text:"确定",type:"primary",order:0}),cancel:Yo({text:"取消",order:1})};Object.entries(r).forEach(([p,u])=>{if(["ok","cancel"].includes(p)){const m=p==="ok"?o.defaultFunc.onOK:o.defaultFunc.onCancel;u.clickFn=u.clickFn||m}else r[p]=Yo(u)});const c=Object.values(r).filter(p=>!p.isHide);e.createVNode("div",{},c.map(p=>e.createVNode(k.ElButton,{type:p.type,onClick:p.clickFn},p.text)));const h=function(p){o.close()},d=typeof o.boxOptions.beforeClose=="function"?o.boxOptions.beforeClose:h;return e.createVNode(k.ElDrawer,{...o.boxProps.value,modelValue:o.boxShow.value,beforeClose:p=>{o.boxOptions.closeIsConfirm?k.ElMessageBox.confirm("确认关闭?","提示").then(u=>{d(h)}).catch(u=>{h()}):d(h)},onClosed2(p){this.clearVm()},onClosed:this.clearVm},{default:()=>n})}};this.vmComponent=a;const i=document.createElement("div");document.body.appendChild(i),this.vmTargetElement=i;const l=e.createVNode(a);l.appContext=this.WinVue._context,e.render(l,this.vmTargetElement),this.vmApp=l}close(){this.boxShow.value=!1,e.render(null,this.vmTargetElement)}show(){this.boxShow.value=!0}getInner(){return this.vmCompObj.$refs.inner}}function Xl(t,o=null,a={},i={},l={}){const n=new a1(t,{component:o,diyOpts:a,props:i,onFunc:l,onOK(){n.getInner(),n.close()},onCancel(){n.close()}});return n}function ql(t,o="",a={},i={},l=null){const n=new l1(t,{component:o,diyOpts:{...a},props:i,onFunc:l,onOK(){n.getInner(),n.close()},onCancel(){n.close()}});return n}var Kl=[ke,be,we,Ve,xe,Ne,Se,Be,Ee,De,xn,_e,Te,Ie,Le,Fe,Oe,Pe,Me,$e,ze,He,Ae,je,We,Re,Ue,Ke,Ye,Xe,qe,Qe,Je,et,tt,ot,at,lt,nt,it,rt,st,ct,dt,pt,mt,ut,gt,ft,bt,wt,ht,yt,kt,xt,Vt,Nt,Ft,Ot,$t,zt,Pt,Mt,St,Bt,Et,Dt,_t,Tt,It,Lt,Ct,vt,Ge,Ze,Ht,At,jt,Ut,Rt,Wt,Yt,qt,Kt,Gt,Zt,Qt,Jt,eo];const Jo=function(t,o={}){Kl.forEach(a=>{t.component(a.name,a)}),t.config.globalProperties.$cvUiParams={...o},t.config.globalProperties.$cvDialogRender=function(){return Xl(t,...arguments)},t.config.globalProperties.$cvCopy=Xn,t.config.globalProperties.$cvDrawerRender=function(){return ql(t,...arguments)},t.config.globalProperties.CDN_URL_UI="https://10ui.cn/"};typeof window<"u"&&window._vueApp_&&Jo(window._vueApp_);const n1={version:"0.3.x",install:Jo};exports.components=Kl,exports.cvDialogRender=Xl,exports.cvDrawerRender=ql,exports.default=n1,exports.install=Jo;
|