(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[83591],{21232:function(Y){Y.exports={imgtovideomodalbox:"imgtovideomodalbox___2a9Ti",buttonBox:"buttonBox___e0gCb",drawersetBox:"drawersetBox___slBI1",selectboxx:"selectboxx___3v1MF"}},73651:function(Y,K,s){"use strict";var he=s(20136),q=s(55241),je=s(67294),L=s(53390),W=s(85893),R=_=>{var z=_.color,re=_.setColor;return(0,W.jsx)(q.Z,{trigger:"click",placement:"right",content:(0,W.jsx)(L.xS,{color:z,onChangeComplete:k=>{var ne=k.hex;return re(ne)}}),children:(0,W.jsx)("i",{className:"colorIco",style:{background:z||"#fff"}})})};K.Z=R},83591:function(Y,K,s){"use strict";s.r(K),s.d(K,{default:function(){return Ke}});var he=s(57338),q=s(273),je=s(77883),L=s(85986),W=s(43358),R=s(34041),_=s(49111),z=s(19650),re=s(57663),k=s(71577),ne=s(59250),de=s(13013),f=s(11849),We=s(34669),ee=s(54458),Re=s(74379),se=s(38648),ze=s(34792),ce=s(48086),Ie=s(34895),ye=s(28216),be=s(19675),Me=s(1977),De=s(24616),Ne=s(44545),Ce=s(74707),Ze=s(39144),me=s(67294),V=s(30672),we=s(20157),Pe=s(19034),Se=s(51964),Oe=s.n(Se),Ve=s(30381),ve=s(2824),Be=s(37266),$e=s(71879),Ee=s(21232),h=s.n(Ee),e=s(85893),ke=j=>{var i=j.id,o=i===void 0?"":i,p=j.index,I=p===void 0?"":p,N=j.changePosition,D=N===void 0?()=>{}:N,C=j.className,y=C===void 0?{}:C,U=j.children,Z=j.rowKey,G=Z===void 0?"":Z,d=(0,me.useRef)(null),H=(0,Be.L)({accept:"DragDropBox",hover:(t,v)=>{if(!!d.current){var O=t.index,B=I;O!==B&&(D&&D(O,B),t.index=B)}}}),w=(0,ve.Z)(H,2),ae=w[1],P=(0,$e.c)({type:"DragDropBox",item:{id:o,index:I},collect:t=>({isDragging:t.isDragging()})}),g=(0,ve.Z)(P,2),S=g[0].isDragging,J=g[1];return(0,e.jsx)("div",{ref:J(ae(d)),style:{opacity:S?.5:1},className:y.dragBox,children:(0,e.jsx)("span",{className:h().reviewer,children:U},G)})},Fe=s(96486),Te=s(73651),Ue=s(22004),Ae=s(69847),ge,pe,Ke=(ge=(0,ye.$j)(j=>{var i=j.common,o=j.loading;return{common:i,loading:o.effects["common/imagesToVideo"]}}),ge(pe=class extends me.PureComponent{constructor(){super(...arguments);this.state={modelZindex:100,imglist:[],activeId:0,submitbtnloading:!1,draweropen:!1,confignow:{audioParams:{sourceID:0,playUrl:window.cdnPath+"/mp3/Cheerfulness.mp3",audioUrl:"/mp3/Cheerfulness.mp3",name:"\u6B22\u5FEB.mp3",playing:!1},videobg:"#000000",imgs:3,animates:1.5,proportion:"0",animate:"0"},configls:{audioParams:{sourceID:0,playUrl:window.cdnPath+"/mp3/Cheerfulness.mp3",audioUrl:"/mp3/Cheerfulness.mp3",name:"\u6B22\u5FEB.mp3",playing:!1},videobg:"#000000",imgs:3,animates:1.5,proportion:"0",animate:"0"}},this.getinfo=()=>{var i=this.props,o=i.dispatch,p=i.sourceID,I=i.common,N=i.f,D=I.shareCode;o({type:"common/getFilePreview",payload:{busType:"cloud",sourceID:p,shareCode:D||void 0,f:N},callback:C=>{var y=C.data||{};this.setState({fileInfo:y}),(y==null?void 0:y.isM3u8)==0&&ce.ZP.warning(intl.formatMessage({id:"storage-video-transingx"}))}})},this.imagesToVideo=()=>{var i=this,o=i.props,p=o.dispatch,I=o.common,N=o.open,D=o.setOpenModel,C=o.videoOption,y=o.showIndex,U=o.issmall,Z=o.sourceID,G=I.checkFolderParams,d=this.state,H=d.modelZindex,w=d.fileInfo,ae=w===void 0?{}:w,P=d.imglist,g=P===void 0?[]:P,S=d.draweropen,J=S===void 0?!1:S,t=d.configls,v=d.confignow,O=v.audioParams,B=O===void 0?{}:O,ie=v.videobg,u=v.imgs,xe=v.animates,ue=v.proportion,fe=v.animate,F=(0,V.lw)((0,V.Kd)()),le=x=>{var b=x.taskID||"";window.imgtovideoTimer&&clearInterval(window.imgtovideoTimer),window.imgtovideoTimer=setInterval(function(){p({type:"common/getimagesToVideotaskAction",payload:{taskID:b},callback:T=>{if(T.success){var $=T.data||{},M=$.status||0,E=parseInt($.progress||0);M==1?(window.imgtovideoTimer&&clearInterval(window.imgtovideoTimer),se.Z.success({message:F.formatMessage({id:"common.tips"}),key:b,description:(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{children:"\u56FE\u7247\u8F6C\u89C6\u9891\u5B8C\u6210"})," ",(0,e.jsx)("div",{children:(0,e.jsx)(ee.Z,{percent:100})})]}),duration:4.5}),i.setState({submitbtnloading:!1}),D(!1,"visible")):M==0?se.Z.info({message:F.formatMessage({id:"common.tips"}),key:b,description:(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{children:"\u56FE\u7247\u8F6C\u89C6\u9891\u4E2D\xB7\xB7\xB7"})," ",(0,e.jsx)("div",{children:(0,e.jsx)(ee.Z,{percent:E})})]}),duration:100}):M==2&&(window.imgtovideoTimer&&clearInterval(window.imgtovideoTimer),i.setState({submitbtnloading:!1}),se.Z.error({message:F.formatMessage({id:"common.tips"}),key:b,description:(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{children:"\u56FE\u7247\u8F6C\u89C6\u9891\u5931\u8D25"})," ",(0,e.jsx)("div",{children:(0,e.jsx)(ee.Z,{percent:E})})]}),duration:100}))}}})},1500)},l=()=>{var x=v.proportion,b=i.state.imglist,T=b.length?b[0]:{},$=T.resolution||"",M=$?$.split("*"):[1920,1080],E=parseInt(M[0]),a=parseInt(M[1]),r=1;switch(x){case"0":return E+"x"+a;case"1":return r=16/9,"1920x1080";break;case"2":return r=4/3,"1440x1080";break;case"3":return r=2/1,"1920x960";break;case"4":return r=9/16,"1080x1920";break;case"5":return r=3/4,"1080x1440";break;case"6":return r=1/1,"1080x1080";break;default:return E+"x"+a}},oe=["fade","wipeleft","slideleft","rectcrop","squeezev","dissolve","radial","hblur","vuslice"];if(!!g.length){var Q=[];g.map((x,b)=>{Q.push({background:v.videobg.toUpperCase(),duration:v.animates,length:v.imgs,transition:v.animate=="0"?oe[Math.floor(Math.random()*10)]:v.animate,fileName:x.fileName||"",pUrl:x.pUrl||""})});var te=g.length?g[0]:{};p({type:"common/imagesToVideo",payload:{audio:B.audioUrl,name:"\u7167\u7247\u8F6C\u89C6\u9891.mp4",resolution:l(),sourceIDTo:Z||G.sourceID||te.parentID,cutList:Q},callback:x=>{x.success?(i.setState({submitbtnloading:!0}),le(x.data||{})):ce.ZP.error(F.formatMessage({id:x.code}))}})}}}componentDidMount(){var i=this,o=i.props.imglist,p=o===void 0?[]:o;i.setState({imglist:p})}componentWillUnmount(){var i=this,o=i.props,p=o.dispatch,I=o.common,N=o.open,D=o.setOpenModel,C=o.videoOption,y=o.showIndex,U=o.issmall,Z=I.sourceID}render(){var i=this,o=i.props,p=o.dispatch,I=o.common,N=o.open,D=o.setOpenModel,C=o.videoOption,y=o.showIndex,U=o.issmall,Z=o.loading,G=I.sourceID,d=this.state,H=d.modelZindex,w=d.fileInfo,ae=w===void 0?{}:w,P=d.imglist,g=P===void 0?[]:P,S=d.draweropen,J=S===void 0?!1:S,t=d.configls,v=d.confignow,O=d.activeId,B=d.submitbtnloading,ie=t.audioParams,u=ie===void 0?{}:ie,xe=t.videobg,ue=t.imgs,fe=t.animates,F=t.proportion,le=t.animate,l=(0,V.lw)((0,V.Kd)()),oe=a=>{i.setState({modelZindex:a})},Q=(a,r)=>{var n=(0,Fe.cloneDeep)(g),c=n[a];n[a]=n[r],n[r]=c,i.setState({imglist:n})},te=a=>{window.fileBoxApi.fileSelect({title:l.formatMessage({id:"explorer.selectFile"}),type:"file",single:!1,allowExt:"jpg,jpeg,png",callback:function(n){var c=n.data||{},m=c.selectIds.length?c.selectItems||[]:[];i.setState({imglist:[...i.state.imglist,...m]})}})},x=a=>{a.key=="1"?window.fileBoxApi.fileSelect({title:l.formatMessage({id:"explorer.selectFile"}),type:"file",single:!1,allowExt:"jpg,jpeg,png",callback:function(n){var c=n.data||{},m=c.selectIds.length?c.selectItems||[]:[];i.setState({imglist:[...i.state.imglist,...m]})}}):window.fileBoxApi.fileSelect({title:l.formatMessage({id:"explorer.selectFolder"}),type:"folder",single:!0,callback:function(n){var c=n.data||{},m=c.selectIds.length?c.selectItems||[]:[],X=m.length?m[0]:{};X.sourceID&&p({type:"common/getImgList",payload:{sourceID:X.sourceID},callback:A=>{if(A.success){var Le=A.data||[];i.setState({imglist:[...i.state.imglist,...Le]})}}})}})},b=[{label:l.formatMessage({id:"explorer.selectFile"}),key:"1"},{label:l.formatMessage({id:"explorer.selectFolder"}),key:"2"}],T={items:b,onClick:x},$=()=>{i.setState({configls:(0,f.Z)({},v),draweropen:!0})},M=()=>{i.setState({draweropen:!1})},E=(a,r)=>[{key:"1",label:(0,e.jsx)("a",{onClick:()=>{var n=[...i.state.imglist];n.splice(r,1),i.setState({imglist:[...n]})},target:"_blank",rel:"noopener noreferrer",children:l.formatMessage({id:"common.delete"})})},{key:"2",label:(0,e.jsx)("a",{onClick:()=>{window.fileBoxApi.fileSelect({title:l.formatMessage({id:"explorer.selectFile"}),type:"file",single:!0,allowExt:"jpg,jpeg,png",callback:function(c){var m=c.data||{},X=m.selectItems||[],A=[...i.state.imglist];A.splice(r,1,X[0]),i.setState({imglist:[...A]})}})},target:"_blank",rel:"noopener noreferrer",children:l.formatMessage({id:"explorer.editor.replace"})})}];return(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(Ie.Z,{open:N,modelZindex:H,setOpenModel:D,setModelZindex:oe,type:"imgtovideo",issmall:U,showIndex:y,title:l.formatMessage({id:"utils.imgtovideo"}),children:(0,e.jsxs)("div",{className:h().imgtovideomodalbox,children:[(0,e.jsxs)("div",{className:"imgtovideoheaderbox",children:[(0,e.jsxs)("div",{className:"uploadImgBox",children:[(0,e.jsxs)(de.Z.Button,{menu:T,placement:"bottom",icon:(0,e.jsx)(be.Z,{}),onClick:te,className:h().buttonBox,overlayStyle:{zIndex:2e3},children:[(0,e.jsx)(Me.Z,{style:{fontSize:12}})," ",l.formatMessage({id:"explorer.type.image"})]}),(0,e.jsxs)(k.Z,{style:{marginLeft:12,float:"left"},onClick:()=>{$()},children:[(0,e.jsx)(De.Z,{})," ",l.formatMessage({id:"menu.setting"})]})]}),(0,e.jsx)("div",{className:"videoSetBox"})]}),(0,e.jsx)("div",{className:"imgtovideocontentbox",children:(0,e.jsx)(Pe.W,{backend:we.PD,children:g!=null&&g.length?(0,e.jsx)("div",{style:{display:"flex",flexWrap:"wrap"},children:g.map((a,r)=>{var n=(0,Ae.pp)(a);return(0,e.jsx)(ke,{rowKey:(a==null?void 0:a.sourceID)+"x"+r,index:r,id:(a==null?void 0:a.sourceID)+"x"+r,changePosition:Q,children:(0,e.jsxs)("span",{onClick:()=>{i.setState({activeId:a==null?void 0:a.sourceID})},className:"reviewer"+(O==(a==null?void 0:a.sourceID)?" active":""),children:[(0,e.jsxs)("div",{className:"reviewerImg",children:[(0,e.jsx)("img",{src:n,className:"icon"}),(0,e.jsx)("div",{className:"textIndex",children:r+1})]}),(0,e.jsx)("div",{className:"reviewerTxt",children:a.name}),(0,e.jsx)("div",{className:"action",children:(0,e.jsx)(de.Z,{menu:{items:E(a,r)},children:(0,e.jsx)("a",{onClick:c=>c.preventDefault(),children:(0,e.jsx)(z.Z,{children:(0,e.jsx)(Ne.Z,{})})})})})]},(a==null?void 0:a.sourceID)+"x"+r)})})}):null})}),(0,e.jsxs)("div",{className:"imgtovideofootorbox",children:[(0,e.jsx)("div",{className:"pagebox"}),(0,e.jsx)("div",{className:"submitbox",children:(0,e.jsx)(k.Z,{onClick:()=>{i.imagesToVideo()},loading:Z||B,size:"large",type:"primary",children:l.formatMessage({id:"utils.generateVideo"})})})]}),(0,e.jsx)(q.Z,{title:null,placement:"right",closable:!1,onClose:M,mask:!1,open:J,getContainer:!1,style:{position:"absolute"},children:(0,e.jsxs)("div",{className:h().drawersetBox,children:[(0,e.jsx)("div",{className:"drawscrollbox",children:(0,e.jsxs)(Oe(),{children:[(0,e.jsxs)("div",{className:"Cropping",children:[(0,e.jsx)("div",{className:"cropleft",children:l.formatMessage({id:"common.proportion"})}),(0,e.jsx)("div",{className:"cropright",children:(0,e.jsx)(R.Z,{placeholder:l.formatMessage({id:"common.select"}),style:{width:"100%"},value:F,onChange:a=>{t.proportion=a,i.setState({configls:(0,f.Z)({},t)})},options:[{value:"0",label:l.formatMessage({id:"common.original"})},{value:"1",label:(0,e.jsxs)("div",{className:h().selectboxx,children:[(0,e.jsx)("div",{className:"selecttext",children:" 16:9 "})," ",(0,e.jsx)("div",{className:"box16b9"})]})},{value:"2",label:(0,e.jsxs)("div",{className:h().selectboxx,children:[(0,e.jsx)("div",{className:"selecttext",children:" 4:3 "})," ",(0,e.jsx)("div",{className:"box4b3"})]})},{value:"3",label:(0,e.jsxs)("div",{className:h().selectboxx,children:[(0,e.jsx)("div",{className:"selecttext",children:" 2:1 "})," ",(0,e.jsx)("div",{className:"box2b1"})]})},{value:"4",label:(0,e.jsxs)("div",{className:h().selectboxx,children:[(0,e.jsx)("div",{className:"selecttext",children:" 9:16 "})," ",(0,e.jsx)("div",{className:"box9b16"})]})},{value:"5",label:(0,e.jsxs)("div",{className:h().selectboxx,children:[(0,e.jsx)("div",{className:"selecttext",children:" 3:4 "})," ",(0,e.jsx)("div",{className:"box3b4"})]})},{value:"6",label:(0,e.jsxs)("div",{className:h().selectboxx,children:[(0,e.jsx)("div",{className:"selecttext",children:" 1:1 "})," ",(0,e.jsx)("div",{className:"box1b1"})]})}]})})]}),(0,e.jsxs)("div",{className:"Cropping",children:[(0,e.jsx)("div",{className:"cropleft",children:l.formatMessage({id:"animate.Singlesheetduration"})}),(0,e.jsx)("div",{className:"cropright",children:(0,e.jsx)(L.Z,{onChange:a=>{t.imgs=a,i.setState({configls:(0,f.Z)({},t)})},value:ue,min:0,max:500,precision:0,formatter:a=>"".concat(a," \u79D2"),parser:a=>a.replace("\u79D2",""),placeholder:l.formatMessage({id:"common.input"})})})]}),(0,e.jsxs)("div",{className:"Cropping",children:[(0,e.jsx)("div",{className:"cropleft",children:l.formatMessage({id:"animate.Switchingduration"})}),(0,e.jsx)("div",{className:"cropright",children:(0,e.jsx)(L.Z,{onChange:a=>{t.animates=a,i.setState({configls:(0,f.Z)({},t)})},value:fe,min:.1,max:100,precision:1,formatter:a=>"".concat(a," \u79D2"),parser:a=>a.replace("\u79D2",""),placeholder:l.formatMessage({id:"common.input"})})})]}),(0,e.jsxs)("div",{className:"Cropping",children:[(0,e.jsx)("div",{className:"cropleft",children:l.formatMessage({id:"animate.SwitchAnimation"})}),(0,e.jsx)("div",{className:"cropright",children:(0,e.jsx)(R.Z,{placeholder:l.formatMessage({id:"common.select"}),style:{width:"100%"},value:le,onChange:a=>{t.animate=a,i.setState({configls:(0,f.Z)({},t)})},options:[{value:"0",label:l.formatMessage({id:"animate.suiji"})},{value:"fade",label:l.formatMessage({id:"animate.fade"})},{value:"wipeleft",label:l.formatMessage({id:"animate.wipeleft"})},{value:"slideleft",label:l.formatMessage({id:"animate.slideleft"})},{value:"rectcrop",label:l.formatMessage({id:"animate.rectcrop"})},{value:"squeezev",label:l.formatMessage({id:"animate.squeezev"})},{value:"dissolve",label:l.formatMessage({id:"animate.dissolve"})},{value:"radial",label:l.formatMessage({id:"animate.radial"})},{value:"hblur",label:l.formatMessage({id:"animate.hblur"})},{value:"vuslice",label:l.formatMessage({id:"animate.vuslice"})}]})})]}),(0,e.jsxs)("div",{className:"Cropping",children:[(0,e.jsxs)("div",{className:"cropleft",children:[l.formatMessage({id:"user.theme.background"}),l.formatMessage({id:"explorer.type.music"})]}),(0,e.jsxs)("div",{className:"cropright",children:[(0,e.jsxs)("div",{className:"audioplaybox",children:[(0,e.jsx)("div",{onClick:()=>{window.fileBoxApi.fileSelect({title:l.formatMessage({id:"explorer.selectFile"}),type:"file",single:!0,allowExt:"mp3",callback:function(r){var n=r.data||{},c=n.selectItems||[],m=c.length?c[0]:{};m.sourceID&&(t.audioParams={sourceID:m.sourceID,playUrl:m.downloadUrl||m.h264Path,audioUrl:m.pUrl+m.fileName,playing:!1,name:m.name},i.setState({configls:(0,f.Z)({},t)}))}})},className:"audioname",children:u.name}),(0,e.jsx)("div",{className:"audioplaybtn",children:u.playUrl?(0,e.jsx)(e.Fragment,{children:u.playing?(0,e.jsx)(Ce.Z,{onClick:()=>{u.playing=!1,i.setState({audioParams:(0,f.Z)({},u)})}}):(0,e.jsx)(Ze.Z,{onClick:()=>{u.playing=!0,i.setState({audioParams:(0,f.Z)({},u)})}})}):" "})]}),u.playUrl?(0,e.jsx)("div",{style:{display:"none"},children:(0,e.jsx)(Ue.Z,{volume:.7,url:u.playUrl,controls:!0,playing:u.playing,ref:a=>{this.audioplayer=a},onProgress:()=>{},onDuration:()=>{},onEnded:()=>{}})}):""]})]}),(0,e.jsxs)("div",{className:"Cropping",children:[(0,e.jsx)("div",{className:"cropleft",children:l.formatMessage({id:"user.theme.background"})}),(0,e.jsx)("div",{className:"cropright",children:(0,e.jsx)(Te.Z,{color:xe,setColor:a=>{t.videobg=a,i.setState({configls:(0,f.Z)({},t)})}})})]})]})}),(0,e.jsxs)("div",{className:"drawerfooter",children:[(0,e.jsx)(k.Z,{onClick:()=>{M()},size:"large",children:l.formatMessage({id:"common.cancel"})}),(0,e.jsx)(k.Z,{onClick:()=>{i.setState({confignow:(0,f.Z)({},t)}),M()},size:"large",type:"primary",children:l.formatMessage({id:"common.ok"})})]})]})})]})})})}})||pe)}}]);