(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[501],{78771:function(e,i,n){Promise.resolve().then(n.bind(n,21336))},21336:function(e,i,n){"use strict";n.r(i),n.d(i,{default:function(){return p}});var t=n(57437),l=n(2265),o=n(76301),r=n(62146),s=n(36699),d=n(97500),u=n(65582),c=n(99376),a=n(9707);function p(){let{Paragraph:e}=o.Typography,{trigger:i}=(0,u.Z)("/v1/upload/streamers",d.wG),n=(0,c.useRouter)(),p=(0,l.useRef)(),[_,m]=(0,l.useState)("inset");return(0,l.useEffect)(()=>{let e=(0,s.ql)(s.f.lg,{match:()=>{m("left")},unmatch:()=>{m("top")}});return()=>e()},[]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{style:{display:"flex",flexDirection:"row-reverse",paddingRight:12},children:(0,t.jsx)(o.zx,{onClick:()=>{var e;null===(e=p.current)||void 0===e||e.submitForm()},type:"primary",icon:(0,t.jsx)(r.Z,{size:"large"}),theme:"solid",style:{marginTop:12,marginRight:4},children:"创建模板"})}),(0,t.jsx)("main",{style:{backgroundColor:"var(--semi-color-bg-0)",display:"flex",justifyContent:"space-around"},children:(0,t.jsx)(o.Form,{autoScrollToError:!0,onSubmit:async l=>{try{var r,s,d,u,c,a,p,_,m,h,y,v;let e={template_name:l.template_name,user_cookie:l.user_cookie,copyright:l.copyright,id:l.id,copyright_source:null!==(a=l.copyright_source)&&void 0!==a?a:"",tid:l.tid[1],cover_path:null!==(p=l.cover_path)&&void 0!==p?p:"",title:null!==(_=l.title)&&void 0!==_?_:"",description:null!==(m=l.description)&&void 0!==m?m:"",dynamic:null!==(h=l.dynamic)&&void 0!==h?h:"",tags:null!==(y=l.tags)&&void 0!==y?y:[],dolby:(null===(r=l.sound)||void 0===r?void 0:r.includes("dolby"))?1:0,hires:(null===(s=l.sound)||void 0===s?void 0:s.includes("hires"))?1:0,up_selection_reply:(null===(d=l.interaction)||void 0===d?void 0:d.includes("up_selection_reply"))?1:0,up_close_reply:(null===(u=l.interaction)||void 0===u?void 0:u.includes("up_close_reply"))?1:0,up_close_danmu:(null===(c=l.interaction)||void 0===c?void 0:c.includes("up_close_danmu"))?1:0,charging_pay:l.charging_pay?1:0,no_reprint:l.no_reprint?1:0,is_only_self:l.is_only_self?1:0,mission_id:l.mission_id,dtime:l.isDtime?null==l?void 0:l.dtime:null,credits:l.credits,uploader:l.uploader,extra_fields:null!==(v=l.extra_fields)&&void 0!==v?v:""};await i(e),o.FN.success("创建成功"),n.push("/upload-manager")}catch(i){throw o.P_.error({title:"创建失败",content:(0,t.jsx)(e,{style:{maxWidth:450},children:i.message}),style:{width:"min-content"}}),i}},component:a.Z,getFormApi:e=>p.current=e,labelWidth:"180px",labelPosition:_})})]})}}},function(e){e.O(0,[916,737,877,623,290,852,191,147,429,326,301,323,201,971,117,744],function(){return e(e.s=78771)}),_N_E=e.O()}]);