import{d as A,T as u,s as h,e as b,bh as v,bo as f,p as U,a$ as D,i as a,N as p,b as w,F as y}from"./index.6b776f4b.js";import"./index.7cc0b0e7.js";import"./index.570314c1.js";import"./index.bf33b691.js";import{U as z}from"./index.87f67876.js";const V="_uploader_22hbs_1",R="_uploaderText_22hbs_53",k="_uploadImg_22hbs_58";var d={"uploader-section":"_uploader-section_22hbs_1","img-close":"_img-close_22hbs_9","col-uploader":"_col-uploader_22hbs_24",uploader:V,uploaderText:R,uploadImg:k},g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAAyCAMAAAAz3ZgNAAAAAXNSR0IArs4c6QAAAV9QTFRFAAAA////////qqqq////v7+/29vb39/fzMzM5ubm6Ojo1dXV6urq6+vr39/f4+Pj5OTk3t7e4ODg4eHh29vb4+Pj3d3d4+Pj4eHh4uLi3d3d3t7e3t7e39/f4ODg3d3d3t7e39/f4ODg39/f3Nzc3d3d39/f4ODg3t7e4eHh39/f3t7e39/f3t7e3t7e4ODg3t7e3d3d39/f39/f39/f4ODg39/f3d3d3t7e39/f3d3d3t7e4ODg3t7e39/f3t7e3t7e3d3d4ODg39/f3d3d3t7e3t7e39/f3d3d39/f3t7e3t7e39/f3d3d3t7e3t7e3t7e39/f3t7e3d3d39/f3t7e3t7e39/f39/f39/f3t7e3t7e3t7e3t7e39/f3t7e39/f3t7e39/f3t7e3t7e3d3d39/f39/f3t7e3t7e3t7e3t7e3t7e3t7e3t7e3d3d3t7e3t7e3t7e39/f3t7eiTfdtAAAAHR0Uk5TAAECAwMEBwgKCgsMDA0QEhMXISIjJCUlKiwtLi8wMTQ2Nzk/QUxPU1RUWF5gY2RrbG9vcHFydnh7f4CCi5GRkpWYoqWnqaqur6+ztLW2t7i5ubq9vr/BxsfW2Nna293e3uPk5+nr7e7x8/X29/j5+vr9/v6jM+nnAAABy0lEQVRIx+3WZ1PCQBAG4AURG6gQu6goIPaGvVcQewEbYi9YUND9/2M4owFySS7nB8cZ309LZp/hkmxmFsBY/PGH7RrgjSeNiBdlOddq5+NJ1Mzb3U6XKdO6TH62Z+vhV2TJll3sjZCyP0sPIWOOCgGi+Vx4YeU4SuGzzBpDFH7C4BJTDSVms9lE4c/6Oub87lZwff0kjonQN0BySq4ESd3fUSrz5EJbua11jjIAMwDd9Lk4r/7iV+7PwzRdKpq84HhUOdiuxJPur5tpUvyRAD61+0pKfEF+GHP5Pc3gUuNxibfJvDW/JwCwRNdpv8TLZW7LbzqzgmVoLRrJ5P7zTWbKaGTFAwwcFwv03rvW4RH3G3S41qMT8368EVoNj8ncHM7hWi+O9slYMHdoNcaGhWsMrZIPKDlDNgG2SNEDxRw8BjBIDloFdRwcG8Eizt9jN8AkD98X58flcwA4EzwcF63E1MSQi+NZoFnwzjwhJ5fzz/8QD17+iHcVjdxKZYqHA9gnEqQ84OMAldPizF7X83IAR19vBfDz7PwufzbAO5X8xABvUXIDi9lNoZIbWAvHaUtygFUfWqlL9nCKSe9VqCzp+gt5+mbdb6LRD+7pAfpKTznkAAAAAElFTkSuQmCC",E=A({name:"ColUploadVideo",props:{modelValue:String,posterUrl:String,tips:{type:String,default:"\u70B9\u51FB\u4E0A\u4F20"},nativeUpload:{type:Boolean,default:!0},size:{type:Number,default:30},deletable:{type:Boolean,default:!0},bucket:{type:String,default:"daya"}},methods:{beforeRead(t){return t.size/1024/1024{this.$emit("update:modelValue",t.fileUrl)})},getVideoBase64(t){return new Promise(function(r){let l="";const e=document.createElement("video");e.setAttribute("crossOrigin","anonymous"),e.setAttribute("src",t),e.setAttribute("preload","auto"),e.addEventListener("loadeddata",function(){console.log(e,"video loadeddata");const o=document.createElement("canvas");console.log("video.clientWidth",e.videoWidth),console.log("video.clientHeight",e.videoHeight);const s=e.videoWidth||750,i=e.videoHeight||500;o.width=s,o.height=i,o.getContext("2d").drawImage(e,0,0,s,i),l=o.toDataURL("image/jpeg"),r(l)})})}},render(){return D(()=>this.modelValue),a("div",{class:d["uploader-section"]},[this.modelValue&&this.deletable?a(p,{name:"cross",onClick:this.onClose,class:d["img-close"]},null):null,w().isApp&&this.nativeUpload?a("div",{onClick:this.onNativeUpload,style:{height:"100%"}},[this.modelValue?a("video",{ref:"videoUpload",class:d.uploadImg,src:this.modelValue+"#t=1,4"},null):a("div",{class:d.uploader},[a(p,{name:g,size:"32"},null),a("p",{class:d.uploaderText},[this.tips])])]):a(y,null,[a(z,{accept:".mp4",afterRead:this.afterRead,beforeRead:this.beforeRead,beforeDelete:this.beforeDelete},{default:()=>this.modelValue?a("video",{ref:"videoUpload",class:d.uploadImg,src:this.modelValue+"#t=1,4"},null):a("div",{class:d.uploader},[a(p,{name:g,size:"32"},null),a("p",{class:d.uploaderText},[this.tips])])})])])}});export{E as C};