import{$ as e,D as t,G as n,H as r,I as i,K as a,L as o,M as s,St as c,T as l,Tt as u,W as d,_ as f,b as p,dt as m,et as ee,f as h,l as g,nt as _,o as v,pt as y,q as b,rt as x,s as S,u as C,v as w,w as T,wt as E,x as D,y as te,z as ne}from"./vue.runtime.esm-bundler-gHHLlCcd.js";import{a as re,t as O}from"./backend-BIDAMQu4.js";import{n as ie,r as ae,t as k}from"./_plugin-vue_export-helper-BgFcNt9i.js";import{i as oe,t as se}from"./Select-i-D3cQiB.js";import{t as ce}from"./Input-CzZwXnLY.js";import{n as le,t as ue}from"./Slider-By9jpeq7.js";import{t as de}from"./Spin-0UC-HobP.js";var A={class:`card`},j={class:`card-hd`},M={class:`sec-hd`},N={class:`count-row`},P={class:`mode-row`},fe={class:`cfg-wrap`},F={class:`cfg-body`},I={class:`cfg-form`},pe={class:`cfg-col`},L={class:`cfg-col`},R={class:`cfg-ft`},z=`# 角色
你是一位专业的文案改写大师，擅长将口播文案进行优化和改写，以适应不同的表达风格和人设需求，降低文本重复度，调整出吸引人的开头，并有需要时结合用户的人设信息改写案例，使内容更加生动贴近受众。你擅长提取、改写、生成和润色文案，以提升用户内容的质量和吸引力。

# 技能
## 技能1：降低重复度
**任务**：对用户提供的口播文案进行深入分析后，按照需求完成改写，同时确保最终文本的重复度低于 40%。
- 在既定观点基础上撰写1500字以下的改写稿，使用同义词替换、句式调整等方法降低重复度，改编出黄金三秒开头；如原文涉及人设信息，则适当融入用户人设信息；如原文未涉及人设信息，则不加入用户人设信息。
- 整体保持口语化表达、保证结构完整、语言流畅，核心思想与原文一致，且不含敏感词。
- 确保改写后的文案保持原意，且语言流畅自然。

## 技能2：改编黄金三秒开头
**任务**：将文案的开头部分改写成能够吸引听众注意力的"黄金三秒"开头。
- 采用引人入胜的开场白，如：提出一个让人想知道答案的问题、引用名言、讲述故事或提供令人惊讶的事实、引发"惊讶、好奇、愤怒、共鸣、焦虑"等情绪、让目标受众立刻感受到"这讲的是我"、从第一句就让观众进入故事或画面等。
- 前3秒不铺垫、不寒暄，直接切入冲突或价值，确保开头部分简洁有力，能够立即引起听众的好奇心和兴趣。

## 技能3：结合人设信息进行案例改写
**任务**：如果用户提供的爆款文案有涉及到人设信息，则根据用户的用户人设信息，对文案中的案例和人设进行改写；如果用户提供的口播文案没有涉及到人设信息，则跳过这个步骤。
- 保持干练的表达风格，避免冗长和复杂的句子，注意口语化表达。
- 使用直接、简洁的语言，突出关键信息，使内容更易于理解和记忆。
- 充分考虑用户人设特点和行业背景，调整案例细节、语气与风格，确保改后的文案符合用户形象和受众期待；如原文没有讨论人设信息，则改写时无需加入用户的人设信息；如果原文提到了人设信息，则将原文中的人设信息替换为用户人设信息。

## 技能4：确保文案符合用户期望
**任务**：在改写过程中，确保文案符合用户的个人风格和表达方式，对改写的文案进行润色和结构优化。
- 了解并应用用户的人设信息，确保文案与用户的形象一致；如果原文没有涉及人设信息，则无需加入用户的人设信息。
- 确保文案的专业性和权威性，符合用户的行业背景和经验，保持可信度，文案应既能体现用户的价值观，又能吸引目标受众。
- 通过调整语序、句式结构和用词，使文案更加流畅，逻辑更严密，语言更具感染力，避免冗长复杂的表达。

# 限制：
- 所有生成和改写的文案必须用【中文】撰写，并确保表达流畅、准确。
- 严格遵守抖音违禁词库v2025.2等平台政策，避免绝对化表述和违禁词。
- 在改写文案时，保持语言口语化、易于理解，改写的文案长度应该符合原文口播文案。
- 如原文没有讨论人设信息，则改写时不需加入用户的人设信息；若原文提到了人设信息，则按正常流程用用户人设信息替换原文中的人设信息，结合用户的个人风格、行业背景和人设信息，确保最终文案与用户形象一致。
- 改写后的文案必须保持原意，不得改变核心信息；重复度需控制在40%以下，改写后的文案应保持口语化表达，确保观众易于接受和理解。
- 开头必须在前三秒内吸引听众注意，可采用提问、名言、故事或惊人事实；结尾不出现类似"#"的话题标签，严禁使用表情包、非法符号等，仅以自然段落的文字输出改写内容文案，输出纯净不带单引号（'）、破折号（——）、双引号（""）和冒号（：）的版本，符号只能出现逗号和句号。
- 改写内容文案字数上限约 1500 字（约等于 5 分钟口播），且输出内容应纯净，无引号、冒号或破折号，只能使用逗号和句号。
- 不得凭空生成案例、数据或任何虚假内容，所有输出必须基于真实信息，内容需贴近实际且具有实用性，用户的用户人设信息不得随意篡改或改编出不存在的内容。
- 生成、改写、润色的文案必须不含敏感词，并严格遵守抖音违禁词库v2025.2；避免绝对化表述，禁止出现违禁词。保持内容正向健康，避免虚假或误导信息，并注意敏感信息的筛选和防范。
- 生成的文案表达语气和风格与输入的文案尽可能保持相似。
- 开头句式必须每次多样化，严禁每次都用"你有没有""你有没有过""你有没有发现"等同一种提问开场；应在提问、故事代入、场景描写、惊人数据、名言金句、直接抛出结论等多种钩子之间灵活轮换，确保不同文案的开头彼此不雷同。`,B=`· 身份：【女】，【独立情感治愈主理人】，【擅长用声音和故事抚慰人心】，性格【温柔细腻】，喜欢【收集人间故事，将情绪熬成治愈的光】。
· 类型：【情感IP】型创作者，【精神陪伴型】内容。主要输出【声音疗愈、情感故事】。
· 标签：【情绪树洞】、【人间故事收藏家】、【治愈系声音主理人】。
· 目标：通过短视频【打造一处线上心灵避风港，用声音和共情传递温暖，让每个感到孤独或疲惫的人都能在这里找到共鸣与陪伴，成为用户心中不可或缺的情感依靠】。`,V=k(t({__name:`Copywriting`,props:{userApiData:{},btnType:{}},emits:[`update:btnType`,`text-changed`],setup(e,{emit:t}){let n=e,i=t,a=s(`open`,()=>{}),o=s(`close`,()=>{}),u=s(`advanceProgress`,()=>{}),f=y(``),p=y(``),m=y(``),h=y(!1),g=s(`autoModeStep`,y(``)),v=y(100),b=y(!1),C=y({prompt1:z,prompt2:B});function E(){C.value.prompt1=C.value.prompt1.replace(/\d+(?=\s*字)/g,String(v.value)).replace(/字数上限/g,`目标字数`).replace(/(\d+)字以下的改写稿/g,`约$1字的改写稿`)}r(async()=>{try{let e=await O({url:`/config/prompt/`});e?.data?.code===0&&(e.data.data.prompt1&&(C.value.prompt1=e.data.data.prompt1),e.data.data.prompt2&&(C.value.prompt2=e.data.data.prompt2))}catch{}v.value=n.userApiData.wordCount||100,E()}),ee(v,()=>E());async function te(){if(!f.value){window.$message?.error(`请输入抖音视频链接`);return}a({message:`提取视频文案`});try{let e=await O({url:`/text/douyin/`,method:`POST`,data:{text:f.value}});e?.data?.code===0?(p.value=e?.data?.data||``,h.value&&(o(),await k())):window.$message?.error(e?.data?.message||`提取失败`)}catch(e){window.$message?.error(e?.message||`操作失败`)}finally{o()}}async function ne(){if(!p.value){window.$message?.error(`请先输入或提取视频文案`);return}a({message:`文案改写`});try{let e=await O({url:`/text/rewrite/`,method:`POST`,timeout:0,data:{text:p.value,source:n.userApiData.wordService||`0`,prompt1:C.value.prompt1.replace(/1500|500/g,String(v.value)),prompt2:C.value.prompt2,mode:n.btnType===`custom`?`custom`:`smart`}});e?.data?.code===0?(m.value=e?.data?.data||``,i(`text-changed`,m.value),window.__copywritingText=m.value,u(1),h.value&&(o(),await oe(`titleTopic`))):window.$message?.error(e?.data?.message||`改写失败`)}catch(e){window.$message?.error(e?.message||`操作失败`)}finally{o()}}function ie(e){i(`update:btnType`,e)}async function ae(){b.value=!1;try{await O({url:`/config/prompt/`,method:`POST`,data:{prompt1:C.value.prompt1,prompt2:C.value.prompt2}}),window.$message?.success(`配置已保存`)}catch{window.$message?.error(`保存失败`)}}async function k(){try{window.$message?.info(`自动模式：正在改写文案...`),await ne(),await oe(`titleTopic`)}catch(e){window.$message?.error(`自动模式执行失败: `+(e?.message||``))}}async function oe(e){setTimeout(()=>{g.value=e},300)}return(e,t)=>{let r=re;return d(),D(`div`,A,[w(`div`,j,[t[15]||=w(`span`,{class:`hd-line`},null,-1),t[16]||=w(`span`,{class:`hd-title`},`文案仿写`,-1),w(`div`,{class:`auto-row`,onClick:t[0]||=e=>h.value=!h.value},[w(`div`,{class:c([`auto-switch`,{on:h.value}])},[...t[13]||=[w(`div`,{class:`switch-knob`},null,-1)]],2),t[14]||=w(`span`,{class:`auto-label`},`自动模式`,-1)])]),t[25]||=w(`div`,{class:`sec-hd`},[w(`span`,{class:`sec-line`}),w(`span`,{class:`sec-title`},`1.文案生成`)],-1),x(w(`input`,{"onUpdate:modelValue":t[1]||=e=>f.value=e,class:`inp`,placeholder:`抖音视频链接`},null,512),[[S,f.value]]),w(`button`,{class:`btn`,onClick:te},`提取视频文案`),x(w(`textarea`,{"onUpdate:modelValue":t[2]||=e=>p.value=e,class:`txa txa-src`},null,512),[[S,p.value]]),t[26]||=w(`div`,{class:`spacer`},null,-1),w(`div`,M,[t[18]||=w(`span`,{class:`sec-line`},null,-1),t[19]||=w(`span`,{class:`sec-title`},`2.文案改写`,-1),w(`div`,N,[t[17]||=w(`span`,{class:`count-lbl`},`字数`,-1),x(w(`input`,{type:`number`,"onUpdate:modelValue":t[3]||=e=>v.value=e,class:`count-inp`,min:10,max:500,step:10},null,512),[[S,v.value,void 0,{number:!0}]])])]),w(`div`,P,[w(`div`,{class:c([`mode-item`,{active:n.btnType!==`custom`}]),onClick:t[4]||=e=>ie(`intelligentRewriting`)},[w(`span`,{class:c([`mode-dot`,{on:n.btnType!==`custom`}])},null,2),t[20]||=T(`智能改写 `,-1)],2),w(`div`,{class:c([`mode-item`,{active:n.btnType===`custom`}]),onClick:t[5]||=e=>ie(`custom`)},[w(`span`,{class:c([`mode-dot`,{on:n.btnType===`custom`}])},null,2),t[21]||=T(`自定义改写 `,-1)],2),w(`button`,{class:`cfg-btn`,onClick:t[6]||=e=>b.value=!0},`配置`)]),w(`button`,{class:`btn`,onClick:ne},`文案改写`),t[27]||=w(`div`,{class:`tip-text`},`文案预览 可手动进行修改`,-1),x(w(`textarea`,{"onUpdate:modelValue":t[7]||=e=>m.value=e,class:`txa txa-preview`,onInput:t[8]||=e=>i(`text-changed`,e.target.value)},null,544),[[S,m.value]]),t[28]||=w(`div`,{class:`breath`},null,-1),l(r,{show:b.value,"onUpdate:show":t[12]||=e=>b.value=e,style:{width:`75%`}},{default:_(()=>[w(`div`,fe,[t[24]||=w(`div`,{class:`cfg-hd`},[w(`h4`,{class:`cfg-hd-title`},`配置`)],-1),w(`div`,F,[w(`div`,I,[w(`div`,pe,[t[22]||=w(`div`,{class:`cfg-item-hd`},[w(`span`,{class:`cfg-item-line`}),w(`span`,{class:`cfg-item-title`},`提示词`)],-1),x(w(`textarea`,{"onUpdate:modelValue":t[9]||=e=>C.value.prompt1=e,class:`cfg-txa`,placeholder:`请输入自定义改写提示词`},null,512),[[S,C.value.prompt1]])]),w(`div`,L,[t[23]||=w(`div`,{class:`cfg-item-hd`},[w(`span`,{class:`cfg-item-line`}),w(`span`,{class:`cfg-item-title`},`人设信息`)],-1),x(w(`textarea`,{"onUpdate:modelValue":t[10]||=e=>C.value.prompt2=e,class:`cfg-txa`,placeholder:`请输入人设信息`},null,512),[[S,C.value.prompt2]])])]),w(`div`,R,[w(`button`,{class:`cfg-btn-save`,onClick:ae},`确认`),w(`button`,{class:`cfg-btn-cancel`,onClick:t[11]||=e=>b.value=!1},`取消`)])])])]),_:1},8,[`show`])])}}}),[[`__scopeId`,`data-v-eb4eb243`]]),H=y(``),U=y([]),me=y(``),W={class:`card`},he={class:`tt-row`},G={class:`topic-tags`},K=[`onClick`],q=k(t({__name:`TitleTopic`,props:{userApiData:{}},setup(e){let t=s(`open`,()=>{}),n=s(`close`,()=>{}),r=s(`advanceProgress`,()=>{}),o=s(`autoModeStep`,y(``)),c=y(``),l=y([]),f=y([]),p=y(``),m=y();function g(){let e=p.value.trim();e&&!l.value.includes(e)&&(l.value=[...l.value,e]),p.value=``}function _(e){l.value=l.value.filter((t,n)=>n!==e)}function v(e){e.key===`Enter`||e.key===`,`?(e.preventDefault(),g()):e.key===`Backspace`&&!p.value&&l.value.length&&(l.value=l.value.slice(0,-1))}async function b(){let e=window.__copywritingText||``;if(!e){window.$message?.error(`请先改写文案`);return}t?.({message:`生成标题话题`});try{let t=await O({url:`/title/`,method:`POST`,data:{text:e}});if(t?.data?.code===0){let e=t?.data?.data||{};f.value=[...new Set((e.topics||[]).filter(Boolean))],l.value=[...f.value],c.value=e.title||``,H.value=c.value,r(2)}}catch(e){window.$message?.error(e?.message||`生成标题失败`)}finally{n?.()}}return ee(l,e=>{U.value=[...e]},{deep:!0,immediate:!0}),ee(c,e=>{H.value=e},{immediate:!0}),ee(o,async e=>{e===`titleTopic`&&(await i(),await b(),o.value===`titleTopic`&&(o.value=`audio`))}),(e,t)=>(d(),D(`div`,W,[t[3]||=w(`div`,{class:`card-hd`},[w(`span`,{class:`hd-line`}),w(`span`,{class:`hd-title`},`标题话题`)],-1),t[4]||=w(`div`,{class:`lbl`},`标题`,-1),w(`div`,he,[x(w(`input`,{"onUpdate:modelValue":t[0]||=e=>c.value=e,class:`inp`,type:`text`,placeholder:`自动生成或手动输入标题`},null,512),[[S,c.value]]),w(`button`,{class:`btn`,onClick:b},`自动生成`)]),t[5]||=w(`div`,{class:`lbl`},`话题`,-1),w(`div`,{class:`topic-box`,onClick:t[2]||=()=>m.value?.focus()},[w(`div`,G,[(d(!0),D(h,null,a(l.value,(e,t)=>(d(),D(`span`,{key:t,class:`topic-chip`},[T(u(e),1),w(`button`,{class:`chip-close`,onClick:e=>_(t)},`×`,8,K)]))),128))]),x(w(`input`,{ref_key:`topicInpRef`,ref:m,"onUpdate:modelValue":t[1]||=e=>p.value=e,class:`topic-inp`,placeholder:`输入话题后按回车添加`,onKeydown:v,onChange:g},null,544),[[S,p.value]])])]))}}),[[`__scopeId`,`data-v-da7fa00f`]]),ge=[`src`],J={key:0},_e={key:1,style:{"margin-left":`2px`}},ve={class:`ap-time`},ye={class:`ap-time`},be=k(t({__name:`AudioPlayer`,props:{src:{}},setup(e){let t=e,n=y(),r=y(!1),i=y(0),a=y(0),o=y(0);function s(){n.value&&(n.value.paused?(n.value.play(),r.value=!0):(n.value.pause(),r.value=!1))}function c(){n.value&&(i.value=n.value.currentTime,a.value&&(o.value=i.value/a.value*100))}function l(){n.value&&(a.value=n.value.duration)}function f(){r.value=!1,o.value=0,i.value=0}function p(e){if(!n.value||!a.value)return;let t=e.currentTarget.getBoundingClientRect(),r=(e.clientX-t.left)/t.width;n.value.currentTime=r*a.value}function m(e){return!e||!isFinite(e)?`0:00`:`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,`0`)}`}return ee(()=>t.src,()=>{r.value=!1,o.value=0,i.value=0,a.value=0}),(t,ee)=>(d(),D(`div`,{class:`ap`,onClick:ee[0]||=C(()=>{},[`stop`])},[w(`audio`,{ref_key:`audioRef`,ref:n,src:e.src,onTimeupdate:c,onLoadedmetadata:l,onEnded:f},null,40,ge),w(`button`,{class:`ap-btn`,onClick:s},[r.value?(d(),D(`span`,J,`❚❚`)):(d(),D(`span`,_e,`▶`))]),w(`span`,ve,u(m(i.value)),1),w(`div`,{class:`ap-bar`,onClick:p},[w(`div`,{class:`ap-fill`,style:E({width:o.value+`%`})},null,4)]),w(`span`,ye,u(m(a.value)),1)]))}}),[[`__scopeId`,`data-v-abe3b697`]]),xe={class:`card`},Se={class:`sec-title-row`},Ce=[`disabled`],we={key:2,class:`row-2`},Te={class:`col-item`},Ee={class:`col-item`},De={key:3,class:`row-2`},Y={class:`col-item`},Oe={class:`col-item`},ke={class:`col-item`},X={class:`col-item`},Z={key:4,class:`row-2`},Ae={class:`col-item`},je={key:0,class:`col-item`},Me={key:1,class:`col-item`},Ne=[`value`],Pe={key:5,class:`row-v`},Fe={class:`sec-title-row`},Ie=[`disabled`],Le={class:`human-row`},Re=[`src`],ze=[`value`],Be={class:`prog-box`},Ve={class:`prog-title`},He={class:`prog-pct`},Ue={key:0,class:`first-run`},We={class:`vp-wrap`},Ge=[`src`],Q={key:1,class:`vp-none`},Ke=k(t({__name:`Audio`,props:{userApiData:{},audioSettings:{}},emits:[`srt-data-ready`,`audio-changed`],setup(e,{emit:t}){let n=e,a=t;s(`open`),s(`close`);let m=s(`advanceProgress`,()=>{}),g=s(`autoModeStep`,y(``)),v=f(()=>{let e=n.userApiData.voiceModelType;return e==`2`?`2.0`:e==`3`?`F5TTS`:e==`4`?`MiniMax`:e==`5`?`CosyVoice云`:`1.0`}),b=f(()=>v.value===`MiniMax`),T=s(`reloadUserApiData`,null),E=y(!1);async function ae(){if(!T){window.$message?.warning(`无法刷新，请重新进入页面`);return}E.value=!0;try{await T(),window.$message?.success(`服务配置已刷新`)}catch{window.$message?.error(`刷新失败，请重试`)}finally{E.value=!1}}let k=y([]),oe=y(``),ue=y(1),de=y(`direct`),A=y(.1),j=y(.1),M=y(``),N=y(``),P=y(!1),fe=y(``),F=y(`auto`),I=y(1),pe=y(1),L=y(0),R=y(`speech-2.5-hd-preview`),z=[{label:`青涩青年（男）`,value:`male-qn-qingse`},{label:`精英青年（男）`,value:`male-qn-jingying`},{label:`霸道青年（男）`,value:`male-qn-badao`},{label:`青年大学生（男）`,value:`male-qn-daxuesheng`},{label:`少女（女）`,value:`female-shaonv`},{label:`御姐（女）`,value:`female-yujie`},{label:`成熟女性（女）`,value:`female-chengshu`},{label:`甜美女性（女）`,value:`female-tianmei`},{label:`男主持人`,value:`presenter_male`},{label:`女主持人`,value:`presenter_female`},{label:`男有声书`,value:`audiobook_male_1`},{label:`女有声书`,value:`audiobook_female_1`},{label:`聪明男童`,value:`clever_boy`},{label:`可爱男童`,value:`cute_boy`},{label:`萌萌女童`,value:`lovely_girl`},{label:`卡通猪小琪`,value:`cartoon_pig`}],B=f(()=>{let e=k.value.filter(e=>{try{return!!e.url&&decodeURIComponent(e.url).includes(`音色`)}catch{return!1}}).map(e=>({label:e.name,value:e.url})),t=[];return e.length&&t.push({type:`group`,label:`我的音色（克隆你的声音）`,key:`g-mine`,children:e}),t.push({type:`group`,label:`MiniMax 预置音色`,key:`g-preset`,children:z}),t}),V=y([]),H=y(``),U=y(``),me=y(!1),W=y(``),he=y(``),G=y(!1),K=y(!1),q=y(0),ge=y(`audio`),J=null,_e=y(!1),ve=y(`0`),ye=[{label:`自动`,value:`auto`},{label:`高兴`,value:`happy`},{label:`悲伤`,value:`sad`},{label:`愤怒`,value:`angry`},{label:`害怕`,value:`fearful`},{label:`厌恶`,value:`disgusted`},{label:`惊讶`,value:`surprised`},{label:`中性`,value:`calm`},{label:`生动`,value:`fluent`},{label:`低语`,value:`whisper`}],Ke=ie;function qe(e){return!e||e.startsWith(`http://`)||e.startsWith(`https://`)?e:e.startsWith(`/`)?Ke+e:e}async function Je(){try{let e=await O({url:`/voices/`});e?.data?.code===0&&(k.value=e.data.data.map(e=>({name:e.name,url:qe(e.audio_file)})))}catch{}}async function Ye(){try{let e=await O({url:`/meta_human/`});e?.data?.code===0&&(V.value=e.data.data)}catch{}}function Xe(){window.__audioComponent={chooseImage:M.value,coverUrl:N.value,videoUrl:W.value,audioUrl:H.value,options2:V.value},window.dispatchEvent(new CustomEvent(`audio-component-updated`))}let Ze=!1;o(()=>{if(!Ze){Ze=!0;return}Je(),Ye()});function Qe(){Je(),Ye()}r(()=>window.addEventListener(`media-list-changed`,Qe)),ne(()=>window.removeEventListener(`media-list-changed`,Qe)),r(async()=>{if(await Promise.all([Je(),Ye()]),ve.value=localStorage.getItem(`isFirstCreateVideo`)||`0`,n.audioSettings){if(oe.value=n.audioSettings.timbre||``,ue.value=n.audioSettings.num||1,de.value=n.audioSettings.generateType||`direct`,A.value=n.audioSettings.jzPause??.1,j.value=n.audioSettings.jjPause??.1,M.value=n.audioSettings.chooseImage||``,M.value){let e=V.value.find(e=>e.name===M.value);e&&(N.value=qe(e.cover))}P.value=n.audioSettings.use_super_resolution||!1,fe.value=n.audioSettings.voice||``,F.value=n.audioSettings.miniMaxEmotion||`auto`,I.value=n.audioSettings.speechRates||1,pe.value=n.audioSettings.volumes||1,L.value=n.audioSettings.pitchRates||0}Xe()}),ne(()=>{J&&clearInterval(J)}),ee(g,async e=>{e===`audio`&&(await i(),await ft())});function $e(){Object.assign(n.audioSettings,{timbre:oe.value,num:ue.value,jzPause:A.value,jjPause:j.value,generateType:de.value,chooseImage:M.value,use_super_resolution:P.value,voice:fe.value,miniMaxEmotion:F.value,speechRates:I.value,volumes:pe.value,pitchRates:L.value})}function et(e){e.preventDefault(),me.value=!0}function tt(){me.value=!1}function nt(e){e.preventDefault(),me.value=!1;let t=e.dataTransfer?.files?.[0];t&&rt(t)&&it(t)}function rt(e){let t=[`audio/mpeg`,`audio/mp3`,`audio/wav`,`audio/ogg`,`audio/aac`,`audio/m4a`,`audio/flac`,`audio/wma`].includes(e.type)||/\.(mp3|wav|ogg|aac|m4a|flac|wma)$/i.test(e.name);return t||window.$message?.error(`只能上传音频文件`),t}async function it(e){let t=new FormData;t.append(`file`,e),t.append(`overwrite`,`true`),t.append(`key`,`临时文件`);try{let e=await O({url:`/files/upload/`,method:`POST`,data:t,headers:{"Content-Type":`multipart/form-data`}});e?.data?.data&&(H.value=qe(e?.data?.data),U.value=decodeURIComponent(e?.data?.data).split(`/`).pop()||``,window.$message?.success(`音频已选择`),a(`audio-changed`))}catch{window.$message?.error(`上传失败`)}}function at(){let e=document.createElement(`input`);e.type=`file`,e.accept=`audio/*`,e.onchange=e=>{let t=e.target.files?.[0];t&&rt(t)&&it(t)},e.click()}function ot(e){e.preventDefault(),G.value=!0}function st(){G.value=!1}function ct(e){e.preventDefault(),G.value=!1;let t=e.dataTransfer?.files?.[0];t&&lt(t)&&ut(t)}function lt(e){let t=[`video/mp4`,`video/avi`,`video/mov`,`video/mkv`,`video/flv`,`video/wmv`,`video/webm`].includes(e.type)||/\.(mp4|avi|mov|mkv|flv|wmv|webm)$/i.test(e.name);return t||window.$message?.error(`只能上传视频文件`),t}async function ut(e){let t=new FormData;t.append(`file`,e),t.append(`overwrite`,`true`),t.append(`key`,`临时文件`);try{let e=await O({url:`/files/upload/`,method:`POST`,data:t,headers:{"Content-Type":`multipart/form-data`}});e?.data?.data&&(W.value=qe(e?.data?.data),he.value=decodeURIComponent(e?.data?.data).split(`/`).pop()||``,window.__videoAddress=W.value,Xe(),window.$message?.success(`视频已选择`))}catch{window.$message?.error(`视频上传失败`)}}function dt(){let e=document.createElement(`input`);e.type=`file`,e.accept=`video/*`,e.onchange=e=>{let t=e.target.files?.[0];t&&lt(t)&&ut(t)},e.click()}async function ft(){if(!b.value&&!oe.value){window.$message?.error(`请先选择音色`);return}if(b.value&&!fe.value){window.$message?.error(`请先选择音色`);return}let e=window.__copywritingText||``;if(!e){window.$message?.error(`请先进行文案改写`);return}let t;b.value?t={version:`4`,text:e,voice:fe.value,model:R.value,speed:I.value,vol:pe.value,pitch:L.value,emotion:F.value===`auto`?``:F.value}:(t={version:n.userApiData.voiceModelType||`1`,emo:`正常`,tts_type:de.value,text:e,speed:ue.value,prompt_audio:oe.value,pause:{pause1:0,pause2:0}},de.value===`pro`&&(t.pause={pause1:A.value,pause2:j.value}));try{let e=await O({url:`/audio/generate/`,method:`POST`,data:t});e?.data?.code===0?(ge.value=`audio`,q.value=0,K.value=!0,mt()):window.$message?.error(e?.data?.message||`操作失败`)}catch(e){window.$message?.error(e?.message||`操作失败`)}}async function pt(){if(!H.value){window.$message?.error(`请先选择音频`);return}if(!M.value){window.$message?.error(`请先选择形象`);return}let e=n.userApiData.videoServiceType===`video_pro`?`pro`:`sync`;try{let t=await O({url:`/video/meta_human_video/`,method:`POST`,data:{type:e,audio_file:H.value,meta_human_name:M.value,use_super_resolution:P.value,batch_size:n.userApiData.batchSize||8}});t?.data?.code===0?(ge.value=`video`,q.value=0,K.value=!0,mt()):window.$message?.error(t?.data?.message||`操作失败`)}catch{window.$message?.error(`操作失败`)}}function mt(){J&&clearInterval(J),gt(),J=setInterval(gt,2e3)}function ht(){J&&=(clearInterval(J),null),K.value=!1}async function gt(){let e=ge.value===`audio`?`/audio/progress/`:`/video/meta_human_video/progress/`;try{let t=await O({url:e});if(t?.data?.code===0){let e=t.data?.data;if(e.status===`progress`)q.value=Math.round(e.data)||0;else if(e.status===`done`){if(q.value=100,ge.value===`audio`){if(H.value=qe(e.url||``),U.value=decodeURIComponent(e.url||``).split(`/`).pop()||``,Xe(),a(`srt-data-ready`,e.subtitles||e.srt||[]),ht(),K.value=!1,q.value=0,window.$message?.success(`音频生成成功`),g.value===`audio`&&M.value){setTimeout(()=>pt(),500);return}g.value===`audio`&&!M.value&&(g.value=`videoClip`)}else W.value=qe(e.urlData||e.url||``),he.value=decodeURIComponent(e.urlData||``).split(`/`).pop()||``,window.__videoAddress=W.value,Xe(),m(3),window.$message?.success(`口播视频生成成功`),g.value===`audio`&&(g.value=`videoClip`);ve.value=`1`,localStorage.setItem(`isFirstCreateVideo`,`1`),ht(),K.value=!1}}else{let e=t?.data?.message||t?.data?.data?.data||`生成失败`;window.$message?.error(e),ht(),K.value=!1,q.value=0}}catch{}}function _t(e){let t=V.value.find(t=>t.name===e);t&&(N.value=qe(t.cover)),$e(),Xe()}function vt(){if(!H.value){window.$message?.error(`没有可下载的音频`);return}window.open(H.value,`_blank`)}function yt(){W.value?_e.value=!0:window.$message?.warning(`请先生成或上传视频`)}let bt=f(()=>ge.value===`audio`?`音频生成中`:`视频生成中`);return(e,t)=>{let n=se,r=ce,i=le,a=re;return d(),D(`div`,xe,[t[26]||=w(`div`,{class:`card-hd`},[w(`span`,{class:`hd-line`}),w(`span`,{class:`hd-title`},`音频视频`)],-1),w(`div`,Se,[t[15]||=w(`span`,{class:`sec-title`},`音频生成`,-1),w(`button`,{class:`btn-refresh`,disabled:E.value,title:`在设置页切换语音服务后，点这里刷新即可生效，无需重进网页`,onClick:ae},u(E.value?`刷新中…`:`⟳ 刷新服务`),9,Ce)]),t[27]||=w(`div`,{class:`lbl`},`音色`,-1),b.value?(d(),te(n,{key:0,value:fe.value,"onUpdate:value":[t[0]||=e=>fe.value=e,$e],options:B.value,placeholder:`选 MiniMax 音色（我的音色=克隆你的声音）`},null,8,[`value`,`options`])):(d(),D(h,{key:1},[l(n,{value:oe.value,"onUpdate:value":[t[1]||=e=>oe.value=e,$e],options:k.value.map(e=>({label:e.name,value:e.url})),placeholder:`选择音色`},null,8,[`value`,`options`]),(d(),te(be,{key:oe.value,src:oe.value||void 0},null,8,[`src`]))],64)),b.value?p(``,!0):(d(),D(`div`,we,[w(`div`,Te,[t[16]||=w(`div`,{class:`lbl-s`},`模型选择`,-1),l(r,{value:v.value,readonly:``},null,8,[`value`])]),w(`div`,Ee,[t[17]||=w(`div`,{class:`lbl-s`},`调节语速`,-1),x(w(`input`,{type:`number`,"onUpdate:modelValue":t[2]||=e=>ue.value=e,class:`numinp`,min:.5,max:2,step:.1,onChange:$e},null,544),[[S,ue.value,void 0,{number:!0}]])])])),b.value?(d(),D(`div`,De,[w(`div`,Y,[t[18]||=w(`div`,{class:`lbl-s`},`情感`,-1),l(n,{value:F.value,"onUpdate:value":[t[3]||=e=>F.value=e,$e],options:ye},null,8,[`value`])]),w(`div`,Oe,[t[19]||=w(`div`,{class:`lbl-s`},`语速`,-1),x(w(`input`,{type:`number`,"onUpdate:modelValue":t[4]||=e=>I.value=e,class:`numinp`,min:.5,max:2,step:.1,onChange:$e},null,544),[[S,I.value,void 0,{number:!0}]])]),w(`div`,ke,[t[20]||=w(`div`,{class:`lbl-s`},`音量`,-1),x(w(`input`,{type:`number`,"onUpdate:modelValue":t[5]||=e=>pe.value=e,class:`numinp`,min:0,max:10,step:.1,onChange:$e},null,544),[[S,pe.value,void 0,{number:!0}]])]),w(`div`,X,[t[21]||=w(`div`,{class:`lbl-s`},`语调`,-1),x(w(`input`,{type:`number`,"onUpdate:modelValue":t[6]||=e=>L.value=e,class:`numinp`,min:-12,max:12,step:1,onChange:$e},null,544),[[S,L.value,void 0,{number:!0}]])])])):p(``,!0),b.value?p(``,!0):(d(),D(`div`,Z,[w(`div`,Ae,[t[22]||=w(`div`,{class:`lbl-s`},`生成方式`,-1),l(n,{value:de.value,"onUpdate:value":[t[7]||=e=>de.value=e,$e],options:[{label:`逐句生成`,value:`pro`},{label:`整段生成`,value:`direct`}]},null,8,[`value`])]),de.value===`pro`?(d(),D(`div`,je,[t[23]||=w(`div`,{class:`lbl-s`},`句中停顿`,-1),x(w(`input`,{type:`number`,"onUpdate:modelValue":t[8]||=e=>A.value=e,class:`numinp`,min:0,max:2,step:.05,onChange:$e},null,544),[[S,A.value,void 0,{number:!0}]])])):p(``,!0),de.value===`pro`?(d(),D(`div`,Me,[t[24]||=w(`div`,{class:`lbl-s`},`句间停顿`,-1),x(w(`input`,{type:`number`,"onUpdate:modelValue":t[9]||=e=>j.value=e,class:`numinp`,min:0,max:2,step:.05,onChange:$e},null,544),[[S,j.value,void 0,{number:!0}]])])):p(``,!0)])),w(`button`,{class:`btn`,onClick:ft},`生成音频`),w(`div`,{class:c([`row-sel`,{over:me.value}]),onDragover:et,onDragleave:tt,onDrop:nt},[w(`input`,{value:U.value,readonly:``,class:`inp flex-1`},null,8,Ne),w(`button`,{class:`btn-s`,onClick:C(at,[`stop`])},`选择音频`)],34),H.value?(d(),D(`div`,Pe,[(d(),te(be,{key:H.value,src:H.value},null,8,[`src`])),w(`button`,{class:`btn-s`,onClick:vt},`下载`)])):p(``,!0),t[28]||=w(`div`,{class:`divider`},null,-1),w(`div`,Fe,[t[25]||=w(`span`,{class:`sec-title`},`数字人视频`,-1),w(`button`,{class:`btn-refresh`,disabled:E.value,title:`在设置页切换视频服务后，点这里刷新即可生效，无需重进网页`,onClick:ae},u(E.value?`刷新中…`:`⟳ 刷新服务`),9,Ie)]),t[29]||=w(`div`,{class:`lbl`},`选择形象`,-1),w(`div`,Le,[l(n,{value:M.value,"onUpdate:value":[t[10]||=e=>M.value=e,_t],options:V.value.map(e=>({label:e.name,value:e.name})),placeholder:`选择形象`,class:`flex-1`},null,8,[`value`,`options`]),N.value?(d(),D(`img`,{key:0,src:N.value,class:`human-preview`,alt:``},null,8,Re)):p(``,!0)]),w(`div`,{class:`row-chk`,onClick:t[11]||=e=>{P.value=!P.value,$e()}},[w(`span`,{class:c([`dot`,{on:P.value}])},u(P.value?`✓`:``),3),w(`span`,{class:c([`chk-label`,{on:P.value}])},`画质修复`,2)]),w(`div`,{class:`row-2`},[w(`button`,{class:`btn flex-1`,onClick:pt},`生成视频`),w(`button`,{class:`btn btn-o flex-1`,onClick:yt},`预览视频`)]),w(`div`,{class:c([`row-sel`,{over:G.value}]),onDragover:ot,onDragleave:st,onDrop:ct},[w(`input`,{value:he.value,readonly:``,class:`inp flex-1`},null,8,ze),w(`button`,{class:`btn-s`,onClick:C(dt,[`stop`])},`选择视频`)],34),l(a,{show:K.value,"onUpdate:show":t[13]||=e=>K.value=e,"mask-closable":!1,style:{width:`420px`}},{default:_(()=>[w(`div`,Be,[w(`div`,Ve,u(bt.value),1),l(i,{type:`line`,percentage:q.value,"indicator-placement":`inside`,height:24,"border-radius":4,"fill-border-radius":4,processing:``},null,8,[`percentage`]),w(`div`,He,u(q.value)+`%`,1),ve.value===`0`?(d(),D(`div`,Ue,`初次生成视频需要初始化，请耐心等待`)):p(``,!0),w(`button`,{class:`btn-cancel`,onClick:t[12]||=e=>{ht(),K.value=!1}},`取消`)])]),_:1},8,[`show`]),l(a,{show:_e.value,"onUpdate:show":t[14]||=e=>_e.value=e,title:`视频预览`,style:{width:`50%`}},{default:_(()=>[w(`div`,We,[W.value?(d(),D(`video`,{key:W.value,class:`vp-vid`,controls:``,src:qe(W.value)},null,8,Ge)):(d(),D(`div`,Q,`暂无视频`))])]),_:1},8,[`show`])])}}}),[[`__scopeId`,`data-v-64190082`]]),qe={class:`card`},Je={class:`layout`},Ye={class:`left`},Xe={class:`btn-row`},Ze=[`disabled`],Qe={class:`sec-hd`},$e={key:0,class:`bgm-box`},et={class:`row-inline`},tt={class:`row-inline`},nt={class:`sec-hd`},rt={key:1,class:`pip-card`},it={class:`pip-upload-row`},at=[`disabled`],ot={key:0,class:`pip-material`},st=[`src`],ct={class:`pip-material-copy`},lt={key:1,class:`pip-empty`},ut={class:`pip-group`},dt={class:`pip-option-grid`},ft=[`onClick`],pt={class:`pip-group`},mt={class:`pip-label-row`},ht={class:`pip-value`},gt={class:`pip-range-row`},_t={class:`pip-group`},vt={class:`pip-time-row`},yt={class:`pip-time-field`},bt={class:`pip-time-field`},xt={key:0,class:`pip-error`},St={class:`pip-cleanup`},Ct={class:`pip-group`},wt={class:`pip-label-row`},Tt={class:`pip-value`},Et={class:`pip-presets`},Dt=[`onClick`],Ot={class:`pip-range-row`},kt={class:`pip-group`},At={class:`pip-label-row`},jt={class:`pip-value`},Mt={class:`pip-presets`},Nt=[`onClick`],Pt={class:`pip-range-row`},Ft={class:`row-inline`},It=[`value`],Lt={class:`right`},Rt={class:`preview`},zt={class:`prev-bar`},Bt={class:`quality-row`},Vt={key:0,class:`pip-preview-badge`},Ht={class:`prev-body`},Ut=[`src`],Wt={key:1,class:`prev-empty`},Gt=[`src`],Kt={class:`prog-wrap`},qt={style:{"font-size":`13px`,"margin-bottom":`16px`}},Jt={style:{"max-height":`60vh`,"overflow-y":`auto`}},Yt={style:{width:`100%`,"border-collapse":`collapse`,"font-size":`15px`,color:`rgb(var(--base-text-color)/0.55)`}},Xt={style:{"text-align":`center`,padding:`6px`,color:`rgb(var(--base-text-color)/0.55)`}},Zt={style:{padding:`4px`}},Qt=[`onUpdate:modelValue`],$t={style:{padding:`4px`}},en=[`onUpdate:modelValue`],tn={style:{padding:`4px`}},nn=[`onUpdate:modelValue`],rn={style:{"text-align":`center`,padding:`4px`}},an=[`onClick`],on={key:0,style:{"text-align":`center`,padding:`32px`,color:`rgb(var(--base-text-color)/0.35)`,"font-size":`16px`}},sn={style:{display:`flex`,gap:`8px`,"margin-top":`12px`,"justify-content":`flex-end`}},cn={class:`dlg-layout`},ln={class:`dlg-left`},un={class:`tpl-select-row`},dn=[`value`],fn=[`src`],pn={key:1,class:`dlg-prev-placeholder`},mn={class:`dlg-right`},hn={class:`dlg-sec-title-row`},gn={class:`dlg-sec-actions`},_n={class:`dlg-switch`},vn={class:`dlg-tabs`},yn={class:`dlg-settings-card`},bn={class:`setting-row`},xn={class:`setting-item`},Sn={class:`setting-control`},Cn={class:`setting-item`},wn={class:`setting-control`},Tn={class:`setting-row`},En={class:`setting-item setting-item-title`},Dn={class:`setting-control title-control`},On={class:`setting-row`},kn={class:`setting-item`},An={class:`setting-control`},jn={class:`setting-item`},Mn={class:`setting-control`},Nn=[`value`],Pn={class:`setting-row`},Fn={class:`setting-item`},In={class:`setting-control`},Ln={class:`setting-item`},Rn={class:`setting-control setting-control-with-checkbox`},zn={class:`setting-row`},Bn={class:`setting-item`},Vn={class:`setting-control`},Hn={class:`setting-item`},Un={class:`setting-control`},Wn={class:`setting-row`},Gn={class:`setting-item`},Kn={class:`setting-control`},qn={class:`setting-item`},Jn={class:`setting-control`},Yn={class:`setting-row`},Xn={class:`setting-item`},Zn={class:`setting-control`},Qn={class:`setting-item`},$n={class:`setting-control`},er={class:`setting-row`},tr={class:`setting-item setting-item-title`},nr={class:`setting-control title-control`},rr={class:`setting-row`},ir={class:`setting-item`},ar={class:`setting-control`},or={class:`setting-item`},sr={class:`setting-control`},cr=[`value`],lr={class:`setting-row`},ur={class:`setting-item`},dr={class:`setting-control`},fr={class:`setting-item`},pr={class:`setting-control setting-control-with-checkbox`},mr={class:`setting-row`},hr={class:`setting-item`},gr={class:`setting-control`},_r={class:`setting-item`},vr={class:`setting-control`},yr={class:`setting-row`},br={class:`setting-item`},xr={class:`setting-control`},Sr={class:`setting-item`},Cr={class:`setting-control`},wr={class:`dlg-sec-title-row`,style:{"margin-top":`40px`}},Tr={class:`dlg-switch`},Er={class:`dlg-settings-card`},Dr={class:`setting-row`},Or={class:`setting-item`},kr={class:`setting-control`},Ar={class:`setting-item`},jr={class:`setting-control`},Mr={class:`setting-row`},Nr={class:`setting-item`},Pr={class:`setting-control`},Fr={class:`setting-row`},Ir={class:`setting-item`},Lr={class:`setting-control`},Rr=[`value`],zr={class:`setting-row`},Br={class:`setting-item`},Vr={class:`setting-control`},Hr={class:`setting-item`},Ur={class:`setting-control`},Wr={style:{display:`flex`,"flex-direction":`column`,gap:`12px`}},Gr={style:{display:`flex`,gap:`8px`,"justify-content":`flex-end`}},Kr=300,qr=533,Jr=k(t({__name:`VideoClip`,props:{videoClipSettings:{},srtData:{}},setup(e){let t=e,n=s(`advanceProgress`,()=>{}),m=s(`autoModeStep`,y(``)),b=y([]),k=y(`剪辑模板1`),ce=y(!0),A=y(!1),j=y(``),M=y([]),N=y(20),P=y(100),fe=[[`top-left`,`左上角`],[`top-right`,`右上角`],[`bottom-left`,`左下角`],[`bottom-right`,`右下角`]],F=y(!1),I=y(``),pe=y(``),L=y(`bottom-right`),R=y(30),z=y(0),B=y(0),V=y(!0),H=y(0),U=y(100),me=y(!1),W=y(!0),he=y(!1),G=y(!1),K=y(`t1`),q=y(`8M`),ge=y(!1),J=y(!1),_e=y(!1),ve=y(``),ye=y([]),xe=y(``),Se=y(``),Ce=y(``),we=y([]),Te=y(new Set);function Ee(e){if(!e||e===`默认`||Te.value.has(e))return;Te.value.add(e);let t=`preview_`+e.replace(/[^a-zA-Z0-9]/g,`_`).slice(-30),n=document.createElement(`style`);n.textContent=`@font-face { font-family: '${t}'; src: url(${e}); }`,document.head.appendChild(n),window.__fontFamilyMap=window.__fontFamilyMap||{},window.__fontFamilyMap[e]=t}function De(e){return e&&(window.__fontFamilyMap||{})[e]||``}let Y=y({primary_color:`#FFFFFF`,outline_color:`#000000`,outline_width:1,font_file:``,font_size:70,margin_left_right:80,margin_bottom:50,subtitle_effect:`none`}),Oe=y(!1),ke=y(!1),X=y({text:``,primary_color:`#FFFFFF`,font_file:``,font_size:90,start_time:0,duration_time:0,x:80,y:200,outline1_color:`#000000`,outline1_width:0,shadow_color:`#000000`,shadow_x:0,shadow_y:0}),Z=y({text:``,primary_color:`#FFFFFF`,font_file:``,font_size:90,start_time:0,duration_time:0,x:80,y:340,outline1_color:`#000000`,outline1_width:0,shadow_color:`#000000`,shadow_x:0,shadow_y:0}),Ae=ie;function je(e){return!e||e.startsWith(`http://`)||e.startsWith(`https://`)?e:e.startsWith(`/`)?Ae+e:e}async function Me(){try{let e=await O({url:`/background_music/`});e?.data?.code===0&&(M.value=e.data.data.map(e=>({label:e.name,value:e.url,url:e.url})),M.value.push({label:`自定义上传...`,value:`__custom__`,url:``}))}catch{}}let Ne=!1;o(()=>{if(!Ne){Ne=!0;return}Me()}),r(()=>{window.addEventListener(`media-list-changed`,Me),window.addEventListener(`audio-component-updated`,$r)}),ne(()=>{window.removeEventListener(`media-list-changed`,Me),window.removeEventListener(`audio-component-updated`,$r)});let Pe=y(!1),Fe=y(!1),Ie=y(0),Le=y(``),Re=y(``),ze=y(``),Be=y(),Ve=y(null);function He(e){return e+`px`}let Ue=f(()=>ke.value?Kr/2:Math.max(0,Math.min(Kr,X.value.x/1080*Kr))||40),We=f(()=>ke.value?Kr/2:Math.max(0,Math.min(Kr,Z.value.x/1080*Kr))||40),Ge=f(()=>X.value.y/1920*qr||40),Q=f(()=>Z.value.y/1920*qr||80),Ke=f(()=>Math.max(10,X.value.font_size/200*40)),Jr=f(()=>Math.max(10,Z.value.font_size/200*40)),Yr=f(()=>Math.max(8,Y.value.font_size/100*20)),Xr=f(()=>Kr),Zr=f(()=>qr),Qr=y(0);function $r(){Qr.value++;let e=window.__videoAddress||``;e&&e!==Le.value&&(ze.value=e,W.value=!0)}let ei=f(()=>(Qr.value,window.__videoAddress||Le.value||``)),ti=f(()=>Le.value&&!W.value?Le.value:ze.value||ei.value),ni=f(()=>F.value&&!!I.value&&(W.value||!Le.value)),ri=f(()=>({width:`${Math.max(15,Math.min(55,R.value))}%`,opacity:Math.max(0,Math.min(100,U.value))/100})),ii=f(()=>`${z.value.toFixed(1)} 秒 — ${B.value>0?`${B.value.toFixed(1)} 秒`:`主视频片尾`}`),ai=f(()=>{let e=t.srtData||[];return e.length&&(e[0].content||e[0].text||e[0].subtitle)||`字幕文字预览`});r(async()=>{try{let e=await O({url:`/video/clip_template/`});e?.data?.code===0&&(b.value=e.data.data)}catch{}try{let e=await O({url:`/video/fonts/`});e?.data?.code===0&&(we.value=e.data.data,we.value.forEach(e=>Ee(e.file)))}catch{}if(await Me(),t.videoClipSettings){if(k.value=t.videoClipSettings.timbreTem||`剪辑模板1`,ce.value=t.videoClipSettings.useTemplateDefaults!==!1,A.value=t.videoClipSettings.use_super_music||!1,j.value=t.videoClipSettings.timbreMus||``,N.value=t.videoClipSettings.bgvalue??20,P.value=t.videoClipSettings.pervalue??100,F.value=t.videoClipSettings.enablePip||!1,I.value=t.videoClipSettings.pipVideoFile||``,pe.value=t.videoClipSettings.pipVideoName||``,L.value=t.videoClipSettings.pipPosition||`bottom-right`,R.value=oi(t.videoClipSettings.pipScale,30),z.value=Math.max(0,Number(t.videoClipSettings.pipStartTime)||0),B.value=Math.max(0,Number(t.videoClipSettings.pipEndTime)||0),V.value=t.videoClipSettings.pipEdgeCleanup!==!1,H.value=oi(t.videoClipSettings.pipAudioVolume,0),U.value=oi(t.videoClipSettings.pipOpacity,100),he.value=t.videoClipSettings.enableSubtitle!==!1,G.value=t.videoClipSettings.enableDrawText||!1,q.value=t.videoClipSettings.clipVideoBitrate||`8M`,t.videoClipSettings.srtSettings&&(Y.value={...Y.value,...t.videoClipSettings.srtSettings}),t.videoClipSettings.srtCenter!==void 0&&(Oe.value=t.videoClipSettings.srtCenter),t.videoClipSettings.titleCenter!==void 0&&(ke.value=t.videoClipSettings.titleCenter),t.videoClipSettings.drawText){let e=t.videoClipSettings.drawText;e.x===0&&e.y===0?X.value={...X.value,...e,x:X.value.x,y:X.value.y}:X.value={...X.value,...e}}if(t.videoClipSettings.drawText2){let e=t.videoClipSettings.drawText2;e.x===0&&e.y===0?Z.value={...Z.value,...e,x:Z.value.x,y:Z.value.y}:Z.value={...Z.value,...e}}}document.addEventListener(`mousemove`,fi),document.addEventListener(`mouseup`,pi)}),ne(()=>{document.removeEventListener(`mousemove`,fi),document.removeEventListener(`mouseup`,pi)});function oi(e,t){let n=Number(e);return Number.isFinite(n)?n<=1?n*100:n:t}function $(){Object.assign(t.videoClipSettings,{timbreTem:k.value,useTemplateDefaults:ce.value,use_super_music:A.value,timbreMus:j.value,bgvalue:N.value,pervalue:P.value,enablePip:F.value,pipVideoFile:I.value,pipVideoName:pe.value,pipPosition:L.value,pipScale:R.value/100,pipStartTime:z.value,pipEndTime:B.value,pipEdgeCleanup:V.value,pipAudioVolume:H.value/100,pipOpacity:U.value/100,enableSubtitle:he.value,enableDrawText:G.value,clipVideoBitrate:q.value,srtSettings:{...Y.value},srtCenter:Oe.value,titleCenter:ke.value,drawText:{...X.value},drawText2:{...Z.value}})}function si(){W.value=!0,$()}function ci(e){e===`scale`&&(R.value=Math.max(15,Math.min(55,Number(R.value)||30))),e===`start`&&(z.value=Math.max(0,Math.round((Number(z.value)||0)*10)/10)),e===`end`&&(B.value=Math.max(0,Math.round((Number(B.value)||0)*10)/10)),e===`audio`&&(H.value=Math.max(0,Math.min(100,Math.round(Number(H.value)||0)))),e===`opacity`&&(U.value=Math.max(0,Math.min(100,Math.round(Number(U.value)||0)))),si()}function li(e,t){e===`audio`?H.value=t:U.value=t,si()}function ui(){z.value=0,B.value=0,si()}function di(e,t){e.preventDefault(),e.stopPropagation();let n=0,r=0;t===`srtPos`?(n=Y.value.margin_bottom,r=Y.value.margin_left_right):t===`srtSize`?(n=Y.value.font_size,r=Y.value.font_size):t===`title1`?(n=X.value.x,r=X.value.y):t===`title2`?(n=Z.value.x,r=Z.value.y):t===`title1Size`?(n=X.value.font_size,r=X.value.font_size):t===`title2Size`&&(n=Z.value.font_size,r=Z.value.font_size),Ve.value={type:t,startX:e.clientX,startY:e.clientY,startValX:n,startValY:r}}function fi(e){if(!Ve.value)return;let t=Ve.value,n=e.clientX-t.startX,r=e.clientY-t.startY,i=Be.value?.getBoundingClientRect(),a=i?.width||Kr,o=i?.height||qr,s=1080/a,c=1920/o;t.type===`title1Size`?(X.value.font_size=Math.max(10,Math.min(200,t.startValX+n*s)),$()):t.type===`title2Size`?(Z.value.font_size=Math.max(10,Math.min(200,t.startValX+n*s)),$()):t.type===`srtSize`?(Y.value.font_size=Math.max(10,Math.min(200,t.startValX+n*s)),$()):t.type===`srtPos`?(Y.value.margin_bottom=Math.max(0,t.startValX-r*c),$()):t.type===`title1`?(X.value.y=Math.max(0,t.startValY+r*c),X.value.x=Math.max(0,t.startValX+n*s),$()):t.type===`title2`&&(Z.value.y=Math.max(0,t.startValY+r*c),Z.value.x=Math.max(0,t.startValX+n*s),$())}function pi(){Ve.value=null}function mi(){let e=document.createElement(`input`);e.type=`file`,e.accept=`audio/*`,e.onchange=async e=>{let t=e.target.files?.[0];if(!t)return;let n=new FormData;n.append(`file`,t),n.append(`overwrite`,`true`),n.append(`key`,`临时文件`);try{let e=await O({url:`/files/upload/`,method:`POST`,data:n,headers:{"Content-Type":`multipart/form-data`}});e?.data?.data&&(j.value=je(e?.data?.data),Ce.value=decodeURIComponent(e?.data?.data).split(`/`).pop()||``,$(),window.$message?.success(`背景音乐已上传`))}catch{}},e.click()}function hi(e){if(e===`__custom__`){j.value=``,mi();return}j.value=e,$()}function gi(){let e=document.createElement(`input`);e.type=`file`,e.accept=`video/*`,e.onchange=async e=>{let t=e.target.files?.[0];if(!t)return;let n=new FormData;n.append(`file`,t),n.append(`overwrite`,`true`),n.append(`key`,`临时文件`);try{let e=await O({url:`/files/upload/`,method:`POST`,data:n,headers:{"Content-Type":`multipart/form-data`}});e?.data?.data&&(xe.value=je(e?.data?.data),Se.value=decodeURIComponent(e?.data?.data).split(`/`).pop()||``,Le.value=``,Re.value=``,W.value=!0,window.__videoAddress=xe.value,$r(),ze.value=xe.value,window.$message?.success(`视频已选择`))}catch{}},e.click()}function _i(){let e=document.createElement(`input`);e.type=`file`,e.accept=`video/*`,e.onchange=async e=>{let t=e.target.files?.[0];if(!t)return;me.value=!0;let n=new FormData;n.append(`file`,t),n.append(`overwrite`,`true`),n.append(`key`,`画中画素材库`);try{let e=(await O({url:`/files/upload/`,method:`POST`,timeout:0,data:n,headers:{"Content-Type":`multipart/form-data`}}))?.data?.data;if(!e)throw Error(`上传完成但没有返回素材地址`);I.value=je(e),pe.value=t.name,F.value=!0,si(),window.$message?.success(`画中画素材已加入剪辑`)}catch(e){window.$message?.error(e instanceof Error?e.message:`画中画素材上传失败`)}finally{me.value=!1}},e.click()}function vi(){I.value=``,pe.value=``,si()}async function yi(){ze.value||=window.__videoAddress||``;let e=ze.value;if(!e){window.$message?.error(`请先生成口播视频`);return}if(ci(`scale`),ci(`start`),ci(`end`),ci(`audio`),ci(`opacity`),F.value&&!I.value){window.$message?.error(`请先选择画中画视频素材`);return}if(F.value&&B.value>0&&B.value<=z.value){window.$message?.error(`画中画出点必须晚于入点`);return}Pe.value=!0,Ie.value=0;try{let r=he.value?t.srtData?.length?t.srtData:window.__srtData||[]:[],i=await O({url:`/video/clip_v3/`,method:`POST`,timeout:0,data:{video_file:e,template_name:k.value,use_template_defaults:ce.value,enable_subtitle:he.value,srt_data:r,srt_settings:he.value?Y.value:{},enable_draw_text:G.value,title_lines:G.value?[X.value.text||``,Z.value.text||``].filter(e=>e&&e.trim()):[],title_settings:G.value?{font_file:X.value.font_file,font_size:X.value.font_size,color:X.value.primary_color,x:ke.value?`(w-text_w)/2`:X.value.x,y:X.value.y,start_time:X.value.start_time,duration_time:X.value.duration_time,stroke_width:X.value.outline1_width,stroke_color:X.value.outline1_color,shadow_color:X.value.shadow_color,shadow_x:X.value.shadow_x,shadow_y:X.value.shadow_y}:{},title2_settings:G.value?{font_file:Z.value.font_file,font_size:Z.value.font_size,color:Z.value.primary_color,x:ke.value?`(w-text_w)/2`:Z.value.x,y:Z.value.y,start_time:Z.value.start_time,duration_time:Z.value.duration_time,stroke_width:Z.value.outline1_width,stroke_color:Z.value.outline1_color,shadow_color:Z.value.shadow_color,shadow_x:Z.value.shadow_x,shadow_y:Z.value.shadow_y}:{},bg_music:A.value?j.value:void 0,bg_volume:N.value/100,perv_volume:P.value/100,enable_pip:F.value,pip_video_file:F.value?I.value:``,pip_position:L.value,pip_scale:R.value/100,pip_start_time:z.value,pip_end_time:B.value,pip_edge_cleanup:V.value,pip_audio_volume:H.value/100,pip_opacity:U.value/100}}),a=i?.data?.data,o=typeof a==`string`?null:a?.task_id||``;if(i?.data?.code===0)if(o){let e=setInterval(async()=>{try{let t=(await O({url:`/video/clip_v3/progress/?task_id=`+encodeURIComponent(o)}))?.data?.data;t&&(Ie.value=t.percent||0,t.status===`done`&&t.url?(clearInterval(e),Ie.value=100,Le.value=je(t.url),Re.value=decodeURIComponent(t.url).split(`/`).pop()||``,window.__videoAddress=Le.value,$r(),W.value=!1,setTimeout(()=>{Pe.value=!1,n(4),window.$message?.success(`视频剪辑成功`),m.value===`videoClip`&&(m.value=``,window.$message?.success(`自动模式已完成（剪辑结束），封面和发布请手动操作`))},600)):t.status===`error`&&(clearInterval(e),Pe.value=!1,window.$message?.error(t.error||`剪辑失败`)))}catch{}},1e3)}else{let e=typeof a==`string`?a:a?.url||a?.urlData||``;e?(Ie.value=100,Le.value=je(e),Re.value=decodeURIComponent(e).split(`/`).pop()||``,window.__videoAddress=Le.value,$r(),W.value=!1,setTimeout(()=>{Pe.value=!1,n(4),window.$message?.success(`视频剪辑成功`),m.value===`videoClip`&&(m.value=``,window.$message?.success(`自动模式已完成（剪辑结束），封面和发布请手动操作`))},600)):(Pe.value=!1,window.$message?.error(`剪辑完成但未返回视频地址`))}else Pe.value=!1,window.$message?.error(i?.data?.message||`操作失败`)}catch{Pe.value=!1,window.$message?.error(`操作失败`)}}ee(m,async e=>{e===`videoClip`&&(await i(),await yi())});function bi(){if(!Le.value){window.$message?.error(`没有可下载的视频`);return}window.open(Le.value,`_blank`)}function xi(){let e=window.__audioComponent?.audioUrl||window.__audioAddress||``,t=window.__videoAddress||``;if(!e&&!t){window.$message?.error(`请先生成配音或口播视频`);return}Fe.value=!0;try{O({url:`/srt/`,method:`POST`,data:{audio_file:e,video_file:t}}).then(e=>{Fe.value=!1,e?.data?.code===0&&e.data.data?.length?(window.__srtData=e.data.data,window.$message?.success(`字幕已生成 (${e.data.data.length} 条)`)):e?.data?.code===0?window.$message?.warning(`字幕生成完成但没有内容 — 请先在音频模块生成配音`):window.$message?.error(e?.data?.message||`生成失败`)}).catch(()=>{Fe.value=!1})}catch{Fe.value=!1,window.$message?.error(`操作失败`)}}async function Si(){let e=window.__srtData;if(e&&e.length){ye.value=e.map((e,t)=>({index:t+1,start:e.start||e.start_time||``,end:e.end||e.end_time||``,text:e.content||e.text||e.subtitle||``})),J.value=!0;return}if(t.srtData&&t.srtData.length){ye.value=t.srtData.map((e,t)=>({index:t+1,start:e.start||e.start_time||``,end:e.end||e.end_time||``,text:e.content||e.text||e.subtitle||``})),J.value=!0;return}let n=window.__audioComponent?.audioUrl||window.__audioAddress||``,r=window.__videoAddress||``;try{let e=await O({url:`/srt/`,method:`POST`,data:n?{audio_file:n,video_file:r}:r?{video_file:r}:{}});e?.data?.code===0&&e.data.data?.length?ye.value=e.data.data.map((e,t)=>({index:t+1,start:e.start||e.start_time||``,end:e.end||e.end_time||``,text:e.content||e.text||e.subtitle||``})):ye.value=[]}catch{ye.value=[]}J.value=!0}function Ci(){window.__srtData=ye.value,window.$message?.success(`字幕已保存`),J.value=!1}async function wi(){let e=window.__copywritingText||``;if(!e){window.$message?.error(`请先改写文案`);return}try{let t=await O({url:`/title/clip/`,method:`POST`,data:{text:e}});if(t?.data?.code===0){let e=t?.data?.data,n;n=typeof e==`string`?e.split(`
`).map(e=>e.trim()).filter(Boolean):e&&typeof e==`object`?[e.title||``,e.subtitle||``].filter(Boolean):[],n.length?(X.value.text=n[0]||``,n.length>1&&(Z.value.text=n[1]),$(),window.$message?.success(`标题已生成 (${n.length} 行)`)):window.$message?.warning(`标题生成返回为空`)}else window.$message?.error(t?.data?.message||`标题生成失败`)}catch{window.$message?.error(`生成失败`)}}function Ti(){$();let e=b.value.find(e=>(e.name||e.template_name)===k.value);if(!e)return;let t=e;if(e.template&&typeof e.template==`object`&&(t=e.template),typeof e.config==`string`)try{t=JSON.parse(e.config)}catch{}if(typeof t.config==`string`)try{t=JSON.parse(t.config)}catch{}typeof t.enable_subtitle==`boolean`&&(he.value=t.enable_subtitle),typeof t.srt_center==`boolean`&&(Oe.value=t.srt_center),typeof t.enable_draw_text==`boolean`&&(G.value=t.enable_draw_text),typeof t.title_center==`boolean`&&(ke.value=t.title_center);let n=t.draw_text_lines?.lines;if(n?.length){let e=n[0];e.text&&!X.value.text&&(X.value.text=e.text),X.value.font_size=e.font_size||90,X.value.x=e.x===`(w-text_w)/2`?0:typeof e.x==`number`?e.x:0,X.value.y=e.y||200,X.value.start_time=e.start||0,X.value.duration_time=e.duration||0;let t=String(e.primary_color||``).replace(`#`,``);if(t.length===6&&(X.value.primary_color=`#`+t),e.outline1_width!==void 0&&(X.value.outline1_width=Number(e.outline1_width)||0),e.outline1_color){let t=String(e.outline1_color).replace(`#`,``);t.length===6&&(X.value.outline1_color=`#`+t)}if(e.shadow_color){let t=String(e.shadow_color).replace(`#`,``);t.length===6&&(X.value.shadow_color=`#`+t)}e.shadow_x!==void 0&&(X.value.shadow_x=Number(e.shadow_x)||0),e.shadow_y!==void 0&&(X.value.shadow_y=Number(e.shadow_y)||0);let r=e.font_file_name||e.font_file||``;if(r){let e=decodeURIComponent(r).split(`/`).pop()?.split(`?`)[0]||r,t=we.value.find(t=>t.file?.endsWith(e)||t.name?.endsWith(e));t&&(X.value.font_file=t.file)}if(n.length>1){let e=n[1];e.text&&!Z.value.text&&(Z.value.text=e.text),Z.value.font_size=e.font_size||90,Z.value.x=e.x===`(w-text_w)/2`?0:typeof e.x==`number`?e.x:0,Z.value.y=e.y||340,Z.value.start_time=e.start||0,Z.value.duration_time=e.duration||0;let t=String(e.primary_color||``).replace(`#`,``);if(t.length===6&&(Z.value.primary_color=`#`+t),e.outline1_width!==void 0&&(Z.value.outline1_width=Number(e.outline1_width)||0),e.outline1_color){let t=String(e.outline1_color).replace(`#`,``);t.length===6&&(Z.value.outline1_color=`#`+t)}if(e.shadow_color){let t=String(e.shadow_color).replace(`#`,``);t.length===6&&(Z.value.shadow_color=`#`+t)}e.shadow_x!==void 0&&(Z.value.shadow_x=Number(e.shadow_x)||0),e.shadow_y!==void 0&&(Z.value.shadow_y=Number(e.shadow_y)||0);let r=e.font_file_name||e.font_file||``;if(r){let e=decodeURIComponent(r).split(`/`).pop()?.split(`?`)[0]||r,t=we.value.find(t=>t.file?.endsWith(e)||t.name?.endsWith(e));t&&(Z.value.font_file=t.file)}}}let r=t.srt;if(r){Y.value.font_size=r.font_size||70,Y.value.margin_left_right=r.margin_left_right??80,Y.value.margin_bottom=r.margin_bottom??50,Y.value.outline_width=r.outline_width||r.stroke_width||1,Y.value.subtitle_effect=r.subtitle_effect||`none`;let e=String(r.primary_color||``).replace(`#`,``);e.length===6&&(Y.value.primary_color=`#`+e);let t=String(r.outline_color||``).replace(`#`,``);t.length===6&&(Y.value.outline_color=`#`+t);let n=r.font_name||r.font_file||``;if(n){let e=decodeURIComponent(n).split(`/`).pop()?.split(`?`)[0]||n,t=we.value.find(t=>t.file?.endsWith(e)||t.name?.endsWith(e));t&&(Y.value.font_file=t.file)}}}async function Ei(){ve.value=k.value,_e.value=!0}async function Di(){let e=ve.value.trim();if(!e){window.$message?.error(`请输入模板名称`);return}try{let t={enable_subtitle:he.value,srt_center:Oe.value,enable_draw_text:G.value,title_center:ke.value,draw_text_lines:{lines:[{text:X.value.text,primary_color:X.value.primary_color.replace(`#`,``),font_file:X.value.font_file,font_size:X.value.font_size,start:X.value.start_time,duration:X.value.duration_time,x:X.value.x,y:X.value.y,outline1_color:X.value.outline1_color.replace(`#`,``),outline1_width:X.value.outline1_width,outline2_color:X.value.outline2_color.replace(`#`,``),outline2_width:X.value.outline2_width,shadow_color:X.value.shadow_color.replace(`#`,``),shadow_x:X.value.shadow_x,shadow_y:X.value.shadow_y},{text:Z.value.text,primary_color:Z.value.primary_color.replace(`#`,``),font_file:Z.value.font_file,font_size:Z.value.font_size,start:Z.value.start_time,duration:Z.value.duration_time,x:Z.value.x,y:Z.value.y,outline1_color:Z.value.outline1_color.replace(`#`,``),outline1_width:Z.value.outline1_width,outline2_color:Z.value.outline2_color.replace(`#`,``),outline2_width:Z.value.outline2_width,shadow_color:Z.value.shadow_color.replace(`#`,``),shadow_x:Z.value.shadow_x,shadow_y:Z.value.shadow_y}]},srt:{primary_color:Y.value.primary_color.replace(`#`,``),outline_color:Y.value.outline_color.replace(`#`,``),outline_width:Y.value.outline_width,font_file:Y.value.font_file,font_size:Y.value.font_size,margin_left_right:Y.value.margin_left_right,margin_bottom:Y.value.margin_bottom,subtitle_effect:Y.value.subtitle_effect}},n=await O({url:`/video/clip_template/`,method:`POST`,data:{key:`custom_`+Date.now(),name:e,config:JSON.stringify(t)}});if(n?.data?.code===0){window.$message?.success(`模板已保存`),_e.value=!1;try{let e=await O({url:`/video/clip_template/`});e?.data?.code===0&&(b.value=e.data.data)}catch{}}else window.$message?.error(n?.data?.message||`保存失败`)}catch{window.$message?.error(`保存失败`)}}async function Oi(){let e=b.value.find(e=>(e.name||e.template_name)===k.value);if(e)try{let t=await O({url:`/video/clip_template/`,method:`DELETE`,data:{key:e.key}});if(t?.data?.code===0){window.$message?.success(`模板已删除`);try{let e=await O({url:`/video/clip_template/`});e?.data?.code===0&&(b.value=e.data.data)}catch{}k.value=b.value.length>0?b.value[0].name||b.value[0].template_name:``}else window.$message?.error(t?.data?.message||`删除失败`)}catch{window.$message?.error(`删除失败`)}}return(e,t)=>{let n=de,r=se,i=ue,o=oe,s=le,f=re,m=ae;return d(),D(`div`,qe,[t[155]||=w(`div`,{class:`card-hd`},[w(`span`,{class:`hd-line`}),w(`span`,{class:`hd-title`},`视频剪辑`)],-1),w(`div`,Je,[w(`div`,Ye,[t[103]||=w(`div`,{class:`sec-hd`},[w(`span`,{class:`sec-num`},`1`),w(`span`,{class:`sec-title`},`字幕生成`)],-1),w(`div`,Xe,[w(`button`,{class:`btn flex-1`,disabled:Fe.value,onClick:xi},[Fe.value?(d(),te(n,{key:0,size:`small`,style:{marginRight:`6px`}})):p(``,!0),T(` `+u(Fe.value?`字幕识别中…`:`生成字幕`),1)],8,Ze),w(`button`,{class:`btn flex-1`,onClick:Si},`编辑字幕`)]),t[104]||=w(`div`,{class:`sec-hd`},[w(`span`,{class:`sec-num`},`2`),w(`span`,{class:`sec-title`},`字幕模板`)],-1),w(`button`,{class:`btn`,style:{background:`linear-gradient(135deg,#8B7CF6,#4ab8ce)`},onClick:t[0]||=e=>ge.value=!0},`顶部标题及字幕设置`),w(`div`,Qe,[t[79]||=w(`span`,{class:`sec-num`},`3`,-1),t[80]||=w(`span`,{class:`sec-title`},`背景音乐生成`,-1),t[81]||=w(`span`,{style:{flex:`1`}},null,-1),w(`span`,{class:c([`dot-sm`,{on:A.value}]),onClick:t[1]||=e=>{A.value=!A.value,$()}},u(A.value?`✓`:``),3),w(`span`,{class:c([`dot-lbl-sm`,{on:A.value}]),onClick:t[2]||=e=>{A.value=!A.value,$()}},`启用`,2)]),l(r,{value:j.value,"onUpdate:value":[t[3]||=e=>j.value=e,hi],options:M.value,placeholder:`选择背景音乐...`,filterable:``,clearable:``,style:{"flex-shrink":`0`}},null,8,[`value`,`options`]),j.value?(d(),D(`div`,$e,[(d(),te(be,{key:j.value,src:je(j.value)},null,8,[`src`]))])):p(``,!0),w(`div`,et,[t[82]||=w(`span`,{class:`sl-lbl`},`背景音量`,-1),l(i,{value:N.value,"onUpdate:value":[t[4]||=e=>N.value=e,$],min:0,max:100,step:1,style:{flex:`1`}},null,8,[`value`])]),w(`div`,tt,[t[83]||=w(`span`,{class:`sl-lbl`},`人声音量`,-1),l(i,{value:P.value,"onUpdate:value":[t[5]||=e=>P.value=e,$],min:0,max:100,step:1,style:{flex:`1`}},null,8,[`value`])]),w(`div`,nt,[t[84]||=w(`span`,{class:`sec-num`},`4`,-1),t[85]||=w(`span`,{class:`sec-title`},`画中画`,-1),t[86]||=w(`span`,{style:{flex:`1`}},null,-1),w(`span`,{class:c([`dot-sm`,{on:F.value}]),onClick:t[6]||=e=>{F.value=!F.value,si()}},u(F.value?`✓`:``),3),w(`span`,{class:c([`dot-lbl-sm`,{on:F.value}]),onClick:t[7]||=e=>{F.value=!F.value,si()}},`启用`,2)]),F.value?(d(),D(`div`,rt,[w(`div`,it,[w(`button`,{class:`pip-upload-btn`,disabled:me.value,onClick:_i},u(me.value?`上传中…`:I.value?`更换画中画素材`:`选择画中画素材`),9,at),I.value?(d(),D(`button`,{key:0,class:`pip-clear-btn`,onClick:vi},`移除`)):p(``,!0)]),I.value?(d(),D(`div`,ot,[w(`video`,{src:I.value,class:`pip-material-video`,controls:``,muted:``,preload:`metadata`},null,8,st),w(`div`,ct,[w(`strong`,null,u(pe.value||`画中画视频`),1),w(`span`,null,u(ii.value),1)])])):(d(),D(`div`,lt,`选择一段视频后，可在右侧立即预览叠加效果。`)),w(`div`,ut,[t[87]||=w(`div`,{class:`pip-label`},`画中画位置`,-1),w(`div`,dt,[(d(),D(h,null,a(fe,e=>w(`button`,{key:e[0],class:c([`pip-option`,{active:L.value===e[0]}]),onClick:t=>{L.value=e[0],si()}},u(e[1]),11,ft)),64))])]),w(`div`,pt,[w(`div`,mt,[t[88]||=w(`span`,{class:`pip-label`},`画中画大小`,-1),w(`span`,ht,u(Math.round(R.value))+`%`,1)]),w(`div`,gt,[l(i,{value:R.value,"onUpdate:value":[t[8]||=e=>R.value=e,si],min:15,max:55,step:1,style:{flex:`1`}},null,8,[`value`]),x(w(`input`,{"onUpdate:modelValue":t[9]||=e=>R.value=e,"aria-label":`画中画大小手动输入`,class:`pip-number`,type:`number`,min:`15`,max:`55`,onChange:t[10]||=e=>ci(`scale`)},null,544),[[S,R.value,void 0,{number:!0}]]),t[89]||=w(`span`,{class:`pip-unit`},`%`,-1)])]),w(`div`,_t,[w(`div`,{class:`pip-label-row`},[t[90]||=w(`span`,{class:`pip-label`},`入点和出点`,-1),w(`button`,{class:`pip-align-btn`,onClick:ui},`与主视频首尾对齐`)]),w(`div`,vt,[w(`label`,yt,[t[91]||=w(`span`,null,`入点`,-1),x(w(`input`,{"onUpdate:modelValue":t[11]||=e=>z.value=e,"aria-label":`画中画入点`,class:`pip-time-input`,type:`number`,min:`0`,step:`0.1`,onChange:t[12]||=e=>ci(`start`)},null,544),[[S,z.value,void 0,{number:!0}]]),t[92]||=w(`em`,null,`秒`,-1)]),w(`label`,bt,[t[93]||=w(`span`,null,`出点`,-1),x(w(`input`,{"onUpdate:modelValue":t[13]||=e=>B.value=e,"aria-label":`画中画出点`,class:`pip-time-input`,type:`number`,min:`0`,step:`0.1`,onChange:t[14]||=e=>ci(`end`)},null,544),[[S,B.value,void 0,{number:!0}]]),t[94]||=w(`em`,null,`秒`,-1)])]),t[95]||=w(`div`,{class:`pip-hint`},`出点填 0 时自动对齐主视频片尾；画中画会按设置时间准确出现和退出。`,-1),B.value>0&&B.value<=z.value?(d(),D(`div`,xt,`出点必须晚于入点`)):p(``,!0)]),w(`label`,St,[l(o,{checked:V.value,"onUpdate:checked":[t[15]||=e=>V.value=e,si]},null,8,[`checked`]),t[96]||=w(`span`,null,[w(`strong`,null,`智能边缘清理`),w(`small`,null,`自动裁除原生黑边、上下字幕条、边角水印和无效留白`)],-1)]),w(`div`,Ct,[w(`div`,wt,[t[97]||=w(`span`,{class:`pip-label`},`画中画音频`,-1),w(`span`,Tt,u(H.value===0?`静音`:`${H.value}%`),1)]),w(`div`,Et,[(d(),D(h,null,a([0,30,60,100],e=>w(`button`,{key:e,class:c([`pip-chip`,{active:H.value===e}]),onClick:t=>li(`audio`,e)},u(e===0?`静音`:`${e}%`),11,Dt)),64))]),w(`div`,Ot,[l(i,{value:H.value,"onUpdate:value":[t[16]||=e=>H.value=e,si],min:0,max:100,step:1,style:{flex:`1`}},null,8,[`value`]),t[98]||=w(`span`,{class:`pip-manual-label`},`手动`,-1),x(w(`input`,{"onUpdate:modelValue":t[17]||=e=>H.value=e,"aria-label":`画中画音量手动输入`,class:`pip-number`,type:`number`,min:`0`,max:`100`,onChange:t[18]||=e=>ci(`audio`)},null,544),[[S,H.value,void 0,{number:!0}]]),t[99]||=w(`span`,{class:`pip-unit`},`%`,-1)])]),w(`div`,kt,[w(`div`,At,[t[100]||=w(`span`,{class:`pip-label`},`画中画透明度`,-1),w(`span`,jt,u(U.value===100?`不透明`:`${U.value}%`),1)]),w(`div`,Mt,[(d(),D(h,null,a([35,60,80,100],e=>w(`button`,{key:e,class:c([`pip-chip`,{active:U.value===e}]),onClick:t=>li(`opacity`,e)},u(e===100?`不透明`:`${e}%`),11,Nt)),64))]),w(`div`,Pt,[l(i,{value:U.value,"onUpdate:value":[t[19]||=e=>U.value=e,si],min:0,max:100,step:1,style:{flex:`1`}},null,8,[`value`]),t[101]||=w(`span`,{class:`pip-manual-label`},`手动`,-1),x(w(`input`,{"onUpdate:modelValue":t[20]||=e=>U.value=e,"aria-label":`画中画透明度手动输入`,class:`pip-number`,type:`number`,min:`0`,max:`100`,onChange:t[21]||=e=>ci(`opacity`)},null,544),[[S,U.value,void 0,{number:!0}]]),t[102]||=w(`span`,{class:`pip-unit`},`%`,-1)])])])):p(``,!0),w(`div`,{class:`btn-row`},[w(`button`,{class:`btn flex-1`,onClick:yi},`剪辑`)]),w(`div`,Ft,[w(`input`,{value:Se.value,readonly:``,class:`inp flex-1`,placeholder:`选择视频素材...`},null,8,It),w(`button`,{class:`btn-s`,onClick:gi},`选择`)])]),w(`div`,Lt,[w(`div`,Rt,[w(`div`,zt,[t[107]||=w(`span`,{class:`prev-label`},`视频预览`,-1),w(`div`,Bt,[ni.value?(d(),D(`span`,Vt,`画中画预览`)):p(``,!0),t[106]||=w(`span`,{class:`q-label`},`视频质量`,-1),x(w(`select`,{"onUpdate:modelValue":t[22]||=e=>q.value=e,class:`s-sel`,style:{width:`76px`},onChange:$},[...t[105]||=[w(`option`,{value:`8M`},`8M`,-1),w(`option`,{value:`16M`},`16M`,-1),w(`option`,{value:`24M`},`24M`,-1),w(`option`,{value:`32M`},`32M`,-1)]],544),[[v,q.value]])])]),w(`div`,Ht,[ti.value?(d(),D(`video`,{key:ti.value,class:`prev-vid`,controls:``,src:ti.value},null,8,Ut)):(d(),D(`div`,Wt,`生成或选择主视频后，在这里预览画中画效果`)),ni.value?(d(),D(`video`,{key:I.value,class:c([`pip-preview-layer`,`pip-${L.value}`]),style:E(ri.value),src:I.value,autoplay:``,loop:``,muted:``,playsinline:``},null,14,Gt)):p(``,!0)])]),Le.value?(d(),D(`button`,{key:0,class:`btn btn-s`,style:{"margin-top":`6px`},onClick:bi},`下载`)):p(``,!0)])]),l(f,{show:Pe.value,"onUpdate:show":t[23]||=e=>Pe.value=e,"mask-closable":!1,style:{width:`400px`}},{default:_(()=>[w(`div`,Kt,[w(`div`,qt,`视频剪辑中 `+u(Ie.value)+`%`,1),l(s,{percentage:Ie.value},null,8,[`percentage`])])]),_:1},8,[`show`]),l(f,{show:J.value,"onUpdate:show":t[25]||=e=>J.value=e,title:`编辑字幕`,preset:`card`,style:{width:`800px`}},{footer:_(()=>[l(m,{type:`primary`,onClick:Ci},{default:_(()=>[...t[109]||=[T(`保存并关闭`,-1)]]),_:1})]),default:_(()=>[w(`div`,Jt,[w(`table`,Yt,[t[108]||=w(`thead`,null,[w(`tr`,{style:{"border-bottom":`1px solid rgb(var(--base-text-color)/0.12)`}},[w(`th`,{style:{width:`50px`,padding:`8px 6px`,"text-align":`center`}},`#`),w(`th`,{style:{width:`130px`,padding:`8px 6px`}},`开始`),w(`th`,{style:{width:`130px`,padding:`8px 6px`}},`结束`),w(`th`,{style:{padding:`8px 6px`}},`文字`),w(`th`,{style:{width:`50px`,padding:`8px 6px`}})])],-1),w(`tbody`,null,[(d(!0),D(h,null,a(ye.value,(e,t)=>(d(),D(`tr`,{key:t,style:{"border-bottom":`1px solid rgb(var(--base-text-color)/0.06)`}},[w(`td`,Xt,u(e.index),1),w(`td`,Zt,[x(w(`input`,{"onUpdate:modelValue":t=>e.start=t,class:`s-inp`,style:{width:`110px`,"font-size":`13px`}},null,8,Qt),[[S,e.start]])]),w(`td`,$t,[x(w(`input`,{"onUpdate:modelValue":t=>e.end=t,class:`s-inp`,style:{width:`110px`,"font-size":`13px`}},null,8,en),[[S,e.end]])]),w(`td`,tn,[x(w(`input`,{"onUpdate:modelValue":t=>e.text=t,class:`s-inp`,style:{width:`100%`,"font-size":`14px`,"text-align":`left`}},null,8,nn),[[S,e.text]])]),w(`td`,rn,[w(`button`,{style:{background:`none`,border:`none`,color:`#e74c3c`,cursor:`pointer`,"font-size":`16px`},onClick:e=>ye.value.splice(t,1)},`✕`,8,an)])]))),128))])]),ye.value.length?p(``,!0):(d(),D(`div`,on,`暂未获取到字幕数据，请先生成字幕。`))]),w(`div`,sn,[w(`button`,{class:`btn-s`,style:{background:`rgb(var(--base-text-color)/0.08)`,color:`rgb(var(--base-text-color)/0.55)`},onClick:t[24]||=e=>J.value=!1},`取消`),w(`button`,{class:`btn-s`,onClick:Ci},`保存字幕`)])]),_:1},8,[`show`]),l(f,{show:ge.value,"onUpdate:show":t[75]||=e=>ge.value=e,title:`字幕模板预览`,preset:`card`,style:{width:`1000px`}},{footer:_(()=>[l(m,{type:`primary`,onClick:t[74]||=e=>ge.value=!1},{default:_(()=>[...t[153]||=[T(`确定`,-1)]]),_:1})]),default:_(()=>[w(`div`,cn,[w(`div`,ln,[w(`div`,un,[t[110]||=w(`span`,{class:`tpl-select-label`},`选择模板`,-1),x(w(`select`,{"onUpdate:modelValue":t[26]||=e=>k.value=e,class:`s-sel`,style:{flex:`1`},onChange:Ti},[(d(!0),D(h,null,a(b.value,e=>(d(),D(`option`,{key:e.key||e.name,value:e.name||e.template_name},u(e.name||e.template_name)+u(e.isCustom?` (自定义)`:``),9,dn))),128))],544),[[v,k.value]])]),t[111]||=w(`div`,{class:`dlg-sec-title`},`实时预览`,-1),w(`div`,{ref_key:`previewRef`,ref:Be,class:`dlg-preview-canvas`,style:E({width:Xr.value+`px`,height:Zr.value+`px`})},[ei.value?(d(),D(`video`,{key:0,src:ei.value,class:`dlg-prev-video`,muted:``,loop:``},null,8,fn)):(d(),D(`div`,pn,`请先选择形象图片`)),G.value&&X.value.text?(d(),D(`div`,{key:2,class:`dlg-prev-title`,style:E(ke.value?{left:`50%`,top:He(Ge.value),transform:`translateX(-50%)`}:{left:He(Ue.value),top:He(Ge.value)}),onMousedown:t[31]||=e=>di(e,`title1`)},[w(`span`,{class:`tdot tl`,onMousedown:t[27]||=C(e=>di(e,`title1Size`),[`stop`])},null,32),w(`span`,{class:`tdot tr`,onMousedown:t[28]||=C(e=>di(e,`title1Size`),[`stop`])},null,32),w(`span`,{class:`tdot bl`,onMousedown:t[29]||=C(e=>di(e,`title1Size`),[`stop`])},null,32),w(`span`,{class:`tdot br`,onMousedown:t[30]||=C(e=>di(e,`title1Size`),[`stop`])},null,32),w(`span`,{style:E({fontFamily:De(X.value.font_file),fontSize:He(Ke.value),color:X.value.primary_color,fontWeight:`700`,WebkitTextStrokeWidth:Math.max(.5,X.value.outline1_width*.3)+`px`,WebkitTextStrokeColor:X.value.outline1_color})},u(X.value.text.slice(0,20)),5)],36)):p(``,!0),G.value&&Z.value.text?(d(),D(`div`,{key:3,class:`dlg-prev-title`,style:E(ke.value?{left:`50%`,top:He(Q.value),transform:`translateX(-50%)`}:{left:He(We.value),top:He(Q.value)}),onMousedown:t[36]||=e=>di(e,`title2`)},[w(`span`,{class:`tdot tl`,onMousedown:t[32]||=C(e=>di(e,`title2Size`),[`stop`])},null,32),w(`span`,{class:`tdot tr`,onMousedown:t[33]||=C(e=>di(e,`title2Size`),[`stop`])},null,32),w(`span`,{class:`tdot bl`,onMousedown:t[34]||=C(e=>di(e,`title2Size`),[`stop`])},null,32),w(`span`,{class:`tdot br`,onMousedown:t[35]||=C(e=>di(e,`title2Size`),[`stop`])},null,32),w(`span`,{style:E({fontFamily:De(Z.value.font_file),fontSize:He(Jr.value),color:Z.value.primary_color,fontWeight:`700`,WebkitTextStrokeWidth:Math.max(.5,Z.value.outline1_width*.3)+`px`,WebkitTextStrokeColor:Z.value.outline1_color})},u(Z.value.text.slice(0,20)),5)],36)):p(``,!0),he.value?(d(),D(`div`,{key:4,class:`dlg-prev-srt`,style:E({left:He(Math.max(0,Y.value.margin_left_right/4)),right:He(Math.max(0,Y.value.margin_left_right/4)),bottom:He(Y.value.margin_bottom/4+10),textAlign:`center`}),onMousedown:t[41]||=e=>di(e,`srtPos`)},[w(`span`,{class:`tdot tl`,onMousedown:t[37]||=C(e=>di(e,`srtSize`),[`stop`])},null,32),w(`span`,{class:`tdot tr`,onMousedown:t[38]||=C(e=>di(e,`srtSize`),[`stop`])},null,32),w(`span`,{class:`tdot bl`,onMousedown:t[39]||=C(e=>di(e,`srtSize`),[`stop`])},null,32),w(`span`,{class:`tdot br`,onMousedown:t[40]||=C(e=>di(e,`srtSize`),[`stop`])},null,32),w(`span`,{style:E({fontFamily:De(Y.value.font_file),color:Y.value.primary_color,fontSize:He(Yr.value),fontWeight:`700`,WebkitTextStrokeWidth:Math.max(.5,Y.value.outline_width*.3)+`px`,WebkitTextStrokeColor:Y.value.outline_color})},u(ai.value.slice(0,30)),5)],36)):p(``,!0)],4),t[112]||=w(`div`,{class:`dlg-prev-tip`},[T(`拖动文字调整位置`),w(`br`),T(`拖动文字四角圆点调整大小`),w(`br`),T(`预览效果仅供参考`)],-1)]),w(`div`,mn,[w(`div`,hn,[t[114]||=w(`span`,{class:`dlg-sec-title`},`顶部标题设置`,-1),w(`div`,gn,[w(`button`,{class:`tmpl-act-btn tmpl-act-save`,onClick:Ei},`保存模板`),w(`button`,{class:`tmpl-act-btn tmpl-act-del`,onClick:Oi},`删除模板`),w(`div`,_n,[t[113]||=w(`span`,{class:`dlg-switch-lbl`},`显示顶部标题`,-1),l(o,{checked:G.value,"onUpdate:checked":[t[42]||=e=>G.value=e,$],size:`small`},null,8,[`checked`])])])]),w(`div`,vn,[w(`span`,{class:c([`dlg-tab`,{active:K.value===`t1`}]),onClick:t[43]||=e=>K.value=`t1`},`标题第一行`,2),w(`span`,{class:c([`dlg-tab`,{active:K.value===`t2`}]),onClick:t[44]||=e=>K.value=`t2`},`标题第二行`,2)]),w(`div`,yn,[K.value===`t1`?(d(),D(h,{key:0},[w(`div`,bn,[w(`div`,xn,[t[115]||=w(`span`,{class:`setting-label`},`开始时间(秒)`,-1),w(`div`,Sn,[x(w(`input`,{type:`number`,"onUpdate:modelValue":t[45]||=e=>X.value.start_time=e,class:`s-inp num-input-w`,step:.1,min:`0`,onChange:$},null,544),[[S,X.value.start_time,void 0,{number:!0}]])])]),w(`div`,Cn,[t[116]||=w(`span`,{class:`setting-label`},`显示时长(秒)`,-1),w(`div`,wn,[x(w(`input`,{type:`number`,"onUpdate:modelValue":t[46]||=e=>X.value.duration_time=e,class:`s-inp num-input-w`,step:.1,min:`0`,onChange:$},null,544),[[S,X.value.duration_time,void 0,{number:!0}]])])])]),t[128]||=w(`div`,{class:`setting-tip`},`显示时长为 0 时全程显示`,-1),w(`div`,Tn,[w(`div`,En,[t[117]||=w(`span`,{class:`setting-label`},`顶部标题`,-1),w(`div`,Dn,[x(w(`textarea`,{"onUpdate:modelValue":t[47]||=e=>X.value.text=e,class:`top-title-textarea`,placeholder:`请输入第一行标题`,onChange:$},null,544),[[S,X.value.text]]),w(`button`,{class:`auto-gen-btn`,onClick:wi},`自动生成`)])])]),w(`div`,On,[w(`div`,kn,[t[118]||=w(`span`,{class:`setting-label`},`文字颜色`,-1),w(`div`,An,[x(w(`input`,{type:`color`,"onUpdate:modelValue":t[48]||=e=>X.value.primary_color=e,class:`s-color`,onChange:$},null,544),[[S,X.value.primary_color]])])]),w(`div`,jn,[t[120]||=w(`span`,{class:`setting-label`},`字体文件`,-1),w(`div`,Mn,[x(w(`select`,{"onUpdate:modelValue":t[49]||=e=>X.value.font_file=e,class:`s-sel font-sel-w`,onChange:$},[t[119]||=w(`option`,{value:``},`选择字体`,-1),(d(!0),D(h,null,a(we.value,e=>(d(),D(`option`,{key:e.file,value:e.file},u(e.name||e.font_name),9,Nn))),128))],544),[[v,X.value.font_file]])])])]),w(`div`,Pn,[w(`div`,Fn,[t[121]||=w(`span`,{class:`setting-label`},`描边宽度`,-1),w(`div`,In,[x(w(`input`,{type:`number`,"onUpdate:modelValue":t[50]||=e=>X.value.outline1_width=e,class:`s-inp num-input-w`,min:0,onChange:$},null,544),[[S,X.value.outline1_width,void 0,{number:!0}]])])]),w(`div`,Ln,[t[123]||=w(`span`,{class:`setting-label`},`位置方式`,-1),w(`div`,Rn,[l(o,{checked:ke.value,"onUpdate:checked":[t[51]||=e=>ke.value=e,$],size:`small`},{default:_(()=>[...t[122]||=[T(`居中`,-1)]]),_:1},8,[`checked`])])])]),w(`div`,zn,[w(`div`,Bn,[t[124]||=w(`span`,{class:`setting-label`},`描边颜色`,-1),w(`div`,Vn,[x(w(`input`,{type:`color`,"onUpdate:modelValue":t[52]||=e=>X.value.outline1_color=e,class:`s-color`,onChange:$},null,544),[[S,X.value.outline1_color]])])]),w(`div`,Hn,[t[125]||=w(`span`,{class:`setting-label`},`阴影颜色`,-1),w(`div`,Un,[x(w(`input`,{type:`color`,"onUpdate:modelValue":t[53]||=e=>X.value.shadow_color=e,class:`s-color`,onChange:$},null,544),[[S,X.value.shadow_color]])])])]),w(`div`,Wn,[w(`div`,Gn,[t[126]||=w(`span`,{class:`setting-label`},`阴影X偏移`,-1),w(`div`,Kn,[x(w(`input`,{type:`number`,"onUpdate:modelValue":t[54]||=e=>X.value.shadow_x=e,class:`s-inp num-input-w`,min:-100,max:100,onChange:$},null,544),[[S,X.value.shadow_x,void 0,{number:!0}]])])]),w(`div`,qn,[t[127]||=w(`span`,{class:`setting-label`},`阴影Y偏移`,-1),w(`div`,Jn,[x(w(`input`,{type:`number`,"onUpdate:modelValue":t[55]||=e=>X.value.shadow_y=e,class:`s-inp num-input-w`,min:-100,max:100,onChange:$},null,544),[[S,X.value.shadow_y,void 0,{number:!0}]])])])])],64)):p(``,!0),K.value===`t2`?(d(),D(h,{key:1},[w(`div`,Yn,[w(`div`,Xn,[t[129]||=w(`span`,{class:`setting-label`},`开始时间(秒)`,-1),w(`div`,Zn,[x(w(`input`,{type:`number`,"onUpdate:modelValue":t[56]||=e=>Z.value.start_time=e,class:`s-inp num-input-w`,step:.1,min:`0`,onChange:$},null,544),[[S,Z.value.start_time,void 0,{number:!0}]])])]),w(`div`,Qn,[t[130]||=w(`span`,{class:`setting-label`},`显示时长(秒)`,-1),w(`div`,$n,[x(w(`input`,{type:`number`,"onUpdate:modelValue":t[57]||=e=>Z.value.duration_time=e,class:`s-inp num-input-w`,step:.1,min:`0`,onChange:$},null,544),[[S,Z.value.duration_time,void 0,{number:!0}]])])])]),t[142]||=w(`div`,{class:`setting-tip`},`显示时长为 0 时全程显示`,-1),w(`div`,er,[w(`div`,tr,[t[131]||=w(`span`,{class:`setting-label`},`顶部标题`,-1),w(`div`,nr,[x(w(`textarea`,{"onUpdate:modelValue":t[58]||=e=>Z.value.text=e,class:`top-title-textarea`,placeholder:`请输入第二行标题`,onChange:$},null,544),[[S,Z.value.text]]),w(`button`,{class:`auto-gen-btn`,onClick:wi},`自动生成`)])])]),w(`div`,rr,[w(`div`,ir,[t[132]||=w(`span`,{class:`setting-label`},`文字颜色`,-1),w(`div`,ar,[x(w(`input`,{type:`color`,"onUpdate:modelValue":t[59]||=e=>Z.value.primary_color=e,class:`s-color`,onChange:$},null,544),[[S,Z.value.primary_color]])])]),w(`div`,or,[t[134]||=w(`span`,{class:`setting-label`},`字体文件`,-1),w(`div`,sr,[x(w(`select`,{"onUpdate:modelValue":t[60]||=e=>Z.value.font_file=e,class:`s-sel font-sel-w`,onChange:$},[t[133]||=w(`option`,{value:``},`选择字体`,-1),(d(!0),D(h,null,a(we.value,e=>(d(),D(`option`,{key:e.file,value:e.file},u(e.name||e.font_name),9,cr))),128))],544),[[v,Z.value.font_file]])])])]),w(`div`,lr,[w(`div`,ur,[t[135]||=w(`span`,{class:`setting-label`},`描边宽度`,-1),w(`div`,dr,[x(w(`input`,{type:`number`,"onUpdate:modelValue":t[61]||=e=>Z.value.outline1_width=e,class:`s-inp num-input-w`,min:0,onChange:$},null,544),[[S,Z.value.outline1_width,void 0,{number:!0}]])])]),w(`div`,fr,[t[137]||=w(`span`,{class:`setting-label`},`位置方式`,-1),w(`div`,pr,[l(o,{checked:ke.value,"onUpdate:checked":[t[62]||=e=>ke.value=e,$],size:`small`},{default:_(()=>[...t[136]||=[T(`居中`,-1)]]),_:1},8,[`checked`])])])]),w(`div`,mr,[w(`div`,hr,[t[138]||=w(`span`,{class:`setting-label`},`描边颜色`,-1),w(`div`,gr,[x(w(`input`,{type:`color`,"onUpdate:modelValue":t[63]||=e=>Z.value.outline1_color=e,class:`s-color`,onChange:$},null,544),[[S,Z.value.outline1_color]])])]),w(`div`,_r,[t[139]||=w(`span`,{class:`setting-label`},`阴影颜色`,-1),w(`div`,vr,[x(w(`input`,{type:`color`,"onUpdate:modelValue":t[64]||=e=>Z.value.shadow_color=e,class:`s-color`,onChange:$},null,544),[[S,Z.value.shadow_color]])])])]),w(`div`,yr,[w(`div`,br,[t[140]||=w(`span`,{class:`setting-label`},`阴影X偏移`,-1),w(`div`,xr,[x(w(`input`,{type:`number`,"onUpdate:modelValue":t[65]||=e=>Z.value.shadow_x=e,class:`s-inp num-input-w`,min:-100,max:100,onChange:$},null,544),[[S,Z.value.shadow_x,void 0,{number:!0}]])])]),w(`div`,Sr,[t[141]||=w(`span`,{class:`setting-label`},`阴影Y偏移`,-1),w(`div`,Cr,[x(w(`input`,{type:`number`,"onUpdate:modelValue":t[66]||=e=>Z.value.shadow_y=e,class:`s-inp num-input-w`,min:-100,max:100,onChange:$},null,544),[[S,Z.value.shadow_y,void 0,{number:!0}]])])])])],64)):p(``,!0)]),w(`div`,wr,[t[144]||=w(`span`,{class:`dlg-sec-title`},`字幕设置`,-1),w(`div`,Tr,[t[143]||=w(`span`,{class:`dlg-switch-lbl`},`显示字幕`,-1),l(o,{checked:he.value,"onUpdate:checked":[t[67]||=e=>he.value=e,$],size:`small`},null,8,[`checked`])])]),w(`div`,Er,[w(`div`,Dr,[w(`div`,Or,[t[145]||=w(`span`,{class:`setting-label`},`字幕颜色`,-1),w(`div`,kr,[x(w(`input`,{type:`color`,"onUpdate:modelValue":t[68]||=e=>Y.value.primary_color=e,class:`s-color`,onChange:$},null,544),[[S,Y.value.primary_color]])])]),w(`div`,Ar,[t[146]||=w(`span`,{class:`setting-label`},`描边宽度`,-1),w(`div`,jr,[x(w(`input`,{type:`number`,"onUpdate:modelValue":t[69]||=e=>Y.value.outline_width=e,class:`s-inp num-input-w`,min:0,max:30,onChange:$},null,544),[[S,Y.value.outline_width,void 0,{number:!0}]])])])]),w(`div`,Mr,[w(`div`,Nr,[t[147]||=w(`span`,{class:`setting-label`},`描边颜色`,-1),w(`div`,Pr,[x(w(`input`,{type:`color`,"onUpdate:modelValue":t[70]||=e=>Y.value.outline_color=e,class:`s-color`,onChange:$},null,544),[[S,Y.value.outline_color]])])])]),w(`div`,Fr,[w(`div`,Ir,[t[149]||=w(`span`,{class:`setting-label`},`字体文件`,-1),w(`div`,Lr,[x(w(`select`,{"onUpdate:modelValue":t[71]||=e=>Y.value.font_file=e,class:`s-sel font-sel-w`,onChange:$},[t[148]||=w(`option`,{value:``},`选择字体`,-1),(d(!0),D(h,null,a(we.value,e=>(d(),D(`option`,{key:e.file,value:e.file},u(e.name||e.font_name),9,Rr))),128))],544),[[v,Y.value.font_file]])])])]),w(`div`,zr,[w(`div`,Br,[t[150]||=w(`span`,{class:`setting-label`},`左右边距`,-1),w(`div`,Vr,[x(w(`input`,{type:`number`,"onUpdate:modelValue":t[72]||=e=>Y.value.margin_left_right=e,class:`s-inp num-input-w`,min:0,max:500,onChange:$},null,544),[[S,Y.value.margin_left_right,void 0,{number:!0}]])])]),w(`div`,Hr,[t[152]||=w(`span`,{class:`setting-label`},`字幕动效`,-1),w(`div`,Ur,[x(w(`select`,{"onUpdate:modelValue":t[73]||=e=>Y.value.subtitle_effect=e,class:`s-sel font-sel-w`,onChange:$},[...t[151]||=[w(`option`,{value:`none`},`无`,-1),w(`option`,{value:`fade_pop`},`渐入弹出`,-1),w(`option`,{value:`strong_bounce`},`强烈弹跳`,-1)]],544),[[v,Y.value.subtitle_effect]])])])])])])])]),_:1},8,[`show`]),l(f,{show:_e.value,"onUpdate:show":t[78]||=e=>_e.value=e,title:`保存模板`,preset:`card`,style:{width:`400px`}},{default:_(()=>[w(`div`,Wr,[t[154]||=w(`span`,{style:{"font-size":`14px`,color:`rgb(var(--base-text-color)/0.55)`}},`请输入模板名称：`,-1),x(w(`input`,{"onUpdate:modelValue":t[76]||=e=>ve.value=e,class:`inp`,style:{width:`100%`},placeholder:`模板名称`,onKeyup:g(Di,[`enter`])},null,544),[[S,ve.value]]),w(`div`,Gr,[w(`button`,{class:`btn-s`,style:{background:`rgb(var(--base-text-color)/0.08)`,color:`rgb(var(--base-text-color)/0.55)`},onClick:t[77]||=e=>_e.value=!1},`取消`),w(`button`,{class:`btn-s`,onClick:Di},`保存`)])])]),_:1},8,[`show`])])}}}),[[`__scopeId`,`data-v-2a74569a`]]),Yr={class:`card`},Xr={class:`cover-input-row`},Zr={class:`thumb-row`},Qr=[`src`],$r={key:1,class:`thumb-placeholder`},ei={style:{"text-align":`center`}},ti=[`src`],ni={class:`tpl-toolbar`},ri=[`value`],ii=[`value`],ai={class:`tpl-toolbar-actions`},oi=[`disabled`],$={class:`tpl-layout`},si={class:`tpl-preview`},ci=[`src`],li={key:1,class:`tpl-placeholder`},ui={class:`tpl-settings`},di={class:`tpl-section`},fi={class:`tpl-card`},pi={class:`setting-row`},mi={class:`setting-item setting-item-full`},hi={class:`setting-control`},gi={class:`setting-row`},_i={class:`setting-item setting-item-full`},vi={class:`setting-control`},yi=[`src`],bi={class:`setting-row`},xi={class:`setting-item setting-item-full`},Si={class:`setting-control frame-slider-wrap`},Ci={class:`frame-time-text`},wi={class:`setting-row`},Ti={class:`setting-item setting-item-full`},Ei={class:`setting-control`,style:{"margin-left":`70px`}},Di={key:0,class:`setting-row`},Oi={class:`setting-item setting-item-full`},ki=[`src`],Ai={key:1,class:`tpl-tip-warn`},ji={class:`setting-row`},Mi={class:`setting-item setting-item-full`},Ni={class:`setting-control`},Pi={key:0,class:`setting-row`},Fi=[`src`],Ii={class:`tpl-section`},Li={class:`tpl-card`},Ri={class:`setting-row`},zi={class:`setting-item`},Bi={class:`setting-control`},Vi={class:`setting-item`},Hi={class:`setting-control`},Ui={class:`setting-val`},Wi={class:`tpl-section`},Gi={class:`text-tabs`},Ki={class:`tpl-card`,style:{"border-radius":`0 0 8px 8px`}},qi={class:`setting-row`},Ji={class:`setting-item setting-item-full`},Yi={class:`setting-control`},Xi={class:`setting-row`},Zi={class:`setting-item`},Qi={class:`setting-control`},$i={class:`setting-item`},ea={class:`setting-control`},ta=[`value`],na={class:`setting-row`},ra={class:`setting-item`},ia={class:`setting-control`},aa={class:`setting-item`},oa={class:`setting-control setting-control-with-checkbox`},sa={class:`setting-row`},ca={class:`setting-item`},la={class:`setting-control`},ua={class:`setting-item`},da={class:`setting-control`},fa={class:`setting-row`},pa={class:`setting-item`},ma={class:`setting-control`},ha={class:`setting-item`},ga={class:`setting-control`},_a={class:`setting-row`},va={class:`setting-item`},ya={class:`setting-control`},ba={class:`setting-item`},xa={class:`setting-control`},Sa={class:`setting-row`},Ca={class:`setting-item setting-item-full`},wa={class:`setting-control`},Ta={class:`setting-row`},Ea={class:`setting-item`},Da={class:`setting-control`},Oa={class:`setting-item`},ka={class:`setting-control`},Aa=[`value`],ja={class:`setting-row`},Ma={class:`setting-item`},Na={class:`setting-control`},Pa={class:`setting-row`},Fa={class:`setting-item`},Ia={class:`setting-control`},La={class:`setting-item`},Ra={class:`setting-control`},za={class:`setting-row`},Ba={class:`setting-item`},Va={class:`setting-control`},Ha={class:`setting-item`},Ua={class:`setting-control`},Wa={class:`setting-row`},Ga={class:`setting-item`},Ka={class:`setting-control`},qa={class:`setting-item`},Ja={class:`setting-control`},Ya={style:{display:`flex`,"flex-direction":`column`,gap:`12px`}},Xa={style:{display:`flex`,gap:`8px`,"justify-content":`flex-end`}},Za=270,Qa=1080,$a=1920,eo=k(t({__name:`CoverMake`,props:{coverMakeSettings:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,i=s(`open`,()=>{}),o=s(`close`,()=>{}),m=s(`advanceProgress`,()=>{}),b=y(``),te=y(``),k=y(``),se=y(``),ce=y(!1),le=y(!1),de=y(!1),A=y([]),j=[`标题`,`四字标题`,`八到十字短句短标题`,`十个字以上的长句子长标题`],M=y([]),N=y(`video_frame`),P=y(``),fe=y(!1),F=y(``),I=y([]),pe=y([]),L=f(()=>[...pe.value,...I.value]),R=y({color:`#000000`,opacity:.1}),z=y({font_file:``,color:`#FFFFFF`,font_size:240,x:0,y:320,centerX:!0,shadow_color:`#1f1f1f`,shadow_x:8,shadow_y:10,border_w:0,border_color:`#898888`}),B=y({font_file:``,color:`#FFFFFF`,font_size:200,x:0,y:800,centerX:!0,shadow_color:`#1f1f1f`,shadow_x:8,shadow_y:10,border_w:0,border_color:`#898888`}),V=y(`line1`),H=y(``),U=y(0),W=y(0),he=y(0),G=y(!1),K=y(!1),q=null,ge=y(),J=y(``),_e=y(0),ve=y(!1),ye=y({}),be=y(``),xe=y(``),Se=y(null),Ce=ie;function we(e){return!e||e.startsWith(`http://`)||e.startsWith(`https://`)?e:e.startsWith(`/`)?Ce+e:e}let Te=y(0);function Ee(){Te.value++}let De=f(()=>{Te.value;let e=window.__audioComponent;if(e?.chooseImage&&e?.options2?.length){let t=e.options2.find(t=>t.name===e.chooseImage);if(t?.video_info?.width)return t.video_info.width}return 1080}),Y=f(()=>{Te.value;let e=window.__audioComponent;if(e?.chooseImage&&e?.options2?.length){let t=e.options2.find(t=>t.name===e.chooseImage);if(t?.video_info?.height)return t.video_info.height}return 1920}),Oe=f(()=>(Te.value,window.__audioComponent?.videoUrl||window.__videoAddress||``)),ke=f(()=>{if(Te.value,N.value===`video_frame`&&H.value){let e=H.value.indexOf(`?`)>=0?`&`:`?`;return we(H.value)+e+`t=`+(U.value||1)}if(N.value===`custom_upload`&&J.value){let e=J.value.indexOf(`?`)>=0?`&`:`?`;return we(J.value)+e+`t=`+(_e.value||1)}return we(window.__audioComponent?.coverUrl||``)}),X=f(()=>{let e=Y.value*(Za/De.value);return Math.max(200,Math.min(800,Math.round(e)))}),Z=f(()=>Za/De.value),Ae=f(()=>X.value/Y.value),je=f(()=>De.value/Qa),Me=f(()=>Y.value/$a),Ne=f(()=>Math.max(12,Math.round(z.value.font_size*je.value))),Pe=f(()=>Math.max(12,Math.round(B.value.font_size*je.value))),Fe=f(()=>Math.round(z.value.y*Me.value)),Ie=f(()=>Math.round(B.value.y*Me.value)),Le=f(()=>Math.max(12,Ne.value*Z.value)),Re=f(()=>z.value.centerX?`50%`:`${z.value.x*Z.value}px`),ze=f(()=>`${Fe.value*Ae.value-.4*Le.value}px`),Be=f(()=>{let e=Math.round(z.value.shadow_x*je.value)*Z.value,t=Math.round(z.value.shadow_y*je.value)*Z.value,n=Math.round(z.value.border_w*je.value)*Z.value,r={left:Re.value,top:ze.value,fontSize:`${Le.value}px`,color:z.value.color,fontFamily:qe(`line1`)};return z.value.centerX&&(r.transform=`translateX(-50%)`),(e||t)&&(r.textShadow=`${e}px ${t}px 0 ${z.value.shadow_color}`),z.value.border_w>0&&(r.WebkitTextStroke=`${Math.max(.5,n)}px ${z.value.border_color}`),r}),Ve=f(()=>Math.max(12,Pe.value*Z.value)),He=f(()=>B.value.centerX?`50%`:`${B.value.x*Z.value}px`),Ue=f(()=>`${Ie.value*Ae.value-.4*Ve.value}px`),We=f(()=>{let e=Math.round(B.value.shadow_x*je.value)*Z.value,t=Math.round(B.value.shadow_y*je.value)*Z.value,n=Math.round(B.value.border_w*je.value)*Z.value,r={left:He.value,top:Ue.value,fontSize:`${Ve.value}px`,color:B.value.color,fontFamily:qe(`line2`)};return B.value.centerX&&(r.transform=`translateX(-50%)`),(e||t)&&(r.textShadow=`${e}px ${t}px 0 ${B.value.shadow_color}`),B.value.border_w>0&&(r.WebkitTextStroke=`${Math.max(.5,n)}px ${B.value.border_color}`),r}),Ge=f(()=>({backgroundColor:R.value.color,opacity:R.value.opacity}));ee(b,e=>{me.value=e||``},{immediate:!0}),r(async()=>{window.addEventListener(`audio-component-updated`,Ee);try{let e=await O({url:`/video/fonts/`});if(e?.data?.code===0){M.value=e.data.data;let t=M.value.find(e=>(e.name||``).includes(`锐字潮牌真言简2.0免费`));t?(z.value.font_file||(z.value.font_file=t.file),B.value.font_file||(B.value.font_file=t.file)):M.value.length>0&&(z.value.font_file||(z.value.font_file=M.value[0].file),B.value.font_file||(B.value.font_file=M.value[0].file)),z.value.font_file&&Ke(z.value.font_file,`line1`),B.value.font_file&&Ke(B.value.font_file,`line2`)}}catch{}try{let e=await O({url:`/cover/template/`});if(e?.data?.code===0){let t=e.data.data;pe.value=t.filter(e=>e.is_preset),I.value=t.filter(e=>!e.is_preset)}}catch{}if(n.coverMakeSettings){let e=n.coverMakeSettings;e.drawTextSettings&&(z.value={...z.value,...e.drawTextSettings},k.value=e.drawTextSettings.text||``),e.drawTextSettings2&&(B.value={...B.value,...e.drawTextSettings2},se.value=e.drawTextSettings2.text||``),e.maskSettings&&(R.value={...R.value,...e.maskSettings}),N.value=e.backgroundSource||`video_frame`,H.value=e.customFrameUrl||``,J.value=e.customBackgroundUrl||``,P.value=e.selectedTemplate||``}}),ne(()=>{window.removeEventListener(`audio-component-updated`,Ee),q&&clearTimeout(q)});function Q(){Object.assign(n.coverMakeSettings,{drawTextSettings:{...z.value,text:k.value},drawTextSettings2:{...B.value,text:se.value},maskSettings:{...R.value},backgroundSource:N.value,customFrameUrl:H.value,customBackgroundUrl:J.value,selectedTemplate:P.value})}async function Ke(e,t){if(!e)return;let n=`${e}_${t}`;if(ye.value[n]){t===`line1`?be.value=ye.value[n]:xe.value=ye.value[n];return}try{let r=`CustomFont_${t}_${Date.now()}`,i=new FontFace(r,`url("${e}")`);await i.load(),document.fonts.add(i),ye.value[n]=r,t===`line1`?be.value=r:xe.value=r}catch{}}function qe(e){return(e===`line1`?be.value:xe.value)||`sans-serif`}async function Je(){let e=window.__copywritingText||``;if(!e){window.$message?.error(`请先改写文案`);return}i?.({message:`生成封面标题...`});try{let t=await O({url:`/title/cover/`,method:`POST`,data:{text:e}});if(t?.data?.code===0){let e=(t?.data?.data||``).split(`
`);k.value=e[0]||``,se.value=e[1]||``,Q(),window.$message?.success(`标题生成成功 (${e.filter(Boolean).length} 行)`)}else window.$message?.error(t?.data?.message||`标题生成失败`)}catch(e){window.$message?.error(e?.message||`标题生成请求失败`)}finally{o?.()}}async function Ye(){if(!k.value&&!se.value){window.$message?.error(`请先输入封面标题`);return}let e=``;if(N.value===`video_frame`?e=H.value:N.value===`custom_upload`&&(e=J.value),e||=window.__audioComponent?.coverUrl||H.value||``,!e){window.$message?.error(`无可用背景图，请从视频截取一帧或上传自定义背景图`);return}e=we(e),i?.({message:`生成封面中...`});try{let t=[];k.value&&t.push({text:k.value,font_file:z.value.font_file,font_color:z.value.color.replace(`#`,``),font_size:z.value.font_size,x:z.value.centerX?`(w-text_w)/2`:z.value.x,y:z.value.y,shadow_color:z.value.shadow_color.replace(`#`,``),shadow_x:z.value.shadow_x,shadow_y:z.value.shadow_y,border_w:z.value.border_w,border_color:z.value.border_color.replace(`#`,``)}),se.value&&t.push({text:se.value,font_file:B.value.font_file,font_color:B.value.color.replace(`#`,``),font_size:B.value.font_size,x:B.value.centerX?`(w-text_w)/2`:B.value.x,y:B.value.y,shadow_color:B.value.shadow_color.replace(`#`,``),shadow_x:B.value.shadow_x,shadow_y:B.value.shadow_y,border_w:B.value.border_w,border_color:B.value.border_color.replace(`#`,``)});let n={image_file:e,draw_texts:t};R.value.opacity>0&&(n.mask={color:R.value.color,opacity:R.value.opacity});let r=await O({url:`/cover/v2/`,method:`POST`,data:n});r?.data?.code===0&&(b.value=r.data.data,te.value=decodeURIComponent(r.data.data).split(`/`).pop()||``,A.value=[,,,,].fill(b.value),de.value=!0,m(5),window.$message?.success(`封面生成成功`))}catch{}finally{o?.()}}function Xe(){let e=document.createElement(`input`);e.type=`file`,e.accept=`image/*`,e.onchange=async e=>{let t=e.target.files?.[0];if(!t)return;let n=new FormData;n.append(`file`,t),n.append(`overwrite`,`true`),n.append(`key`,`临时文件`);try{let e=await O({url:`/files/upload/`,method:`POST`,data:n,headers:{"Content-Type":`multipart/form-data`}});e?.data?.data&&(b.value=e.data.data,te.value=decodeURIComponent(e.data.data).split(`/`).pop()||``,A.value=[,,,,].fill(b.value),de.value=!0,window.$message?.success(`封面已上传`))}catch{}},e.click()}function Ze(){if(!b.value){window.$message?.error(`请先生成封面或上传封面`);return}ce.value=!0}function Qe(e){if(!e)return;P.value=e;let t=L.value.find(t=>t.key===e);if(!t)return;let n=t.config;if(R.value.color=n.mask?.color||`#000000`,R.value.opacity=n.mask?.opacity??.1,n.drawTextSettings){let e=n.drawTextSettings;e.font_file&&(z.value.font_file=e.font_file),z.value.color=e.color,z.value.font_size=e.font_size,z.value.x=e.x,z.value.y=e.y,z.value.centerX=e.centerX,z.value.shadow_color=e.shadow_color,z.value.shadow_x=e.shadow_x,z.value.shadow_y=e.shadow_y,z.value.border_w=e.border_w,z.value.border_color=e.border_color,k.value=e.text||``}if(n.drawTextSettings2){let e=n.drawTextSettings2;e.font_file&&(B.value.font_file=e.font_file),B.value.color=e.color,B.value.font_size=e.font_size,B.value.x=e.x,B.value.y=e.y,B.value.centerX=e.centerX,B.value.shadow_color=e.shadow_color,B.value.shadow_x=e.shadow_x,B.value.shadow_y=e.shadow_y,B.value.border_w=e.border_w,B.value.border_color=e.border_color,se.value=e.text||``}else se.value=``,B.value={font_file:``,color:`#FFFFFF`,font_size:200,x:0,y:800,centerX:!0,shadow_color:`#1f1f1f`,shadow_x:8,shadow_y:10,border_w:0,border_color:`#898888`};Q(),window.$message?.success(`已应用"${t.name}"模板`)}function $e(){le.value=!0}function et(){F.value=P.value||``,fe.value=!0}async function tt(){let e=F.value.trim();if(!e){window.$message?.error(`请输入模板名称`);return}let t={...z.value};delete t.text;let n={...B.value};delete n.text;let r={mask:{color:R.value.color,opacity:R.value.opacity},drawTextSettings:t,drawTextSettings2:n};try{if((await O({url:`/cover/template/`,method:`POST`,data:{key:`custom_`+Date.now(),name:e,config:r}}))?.data?.code===0){window.$message?.success(`模板已保存`),fe.value=!1;try{let e=await O({url:`/cover/template/`});if(e?.data?.code===0){let t=e.data.data;pe.value=t.filter(e=>e.is_preset),I.value=t.filter(e=>!e.is_preset)}}catch{}}}catch{}}async function nt(){let e=L.value.find(e=>e.key===P.value);if(e){if(e.is_preset){window.$message?.error(`预设模板不能删除`);return}try{(await O({url:`/cover/template/`,method:`DELETE`,data:{key:e.key}}))?.data?.code===0&&(window.$message?.success(`模板已删除`),I.value=I.value.filter(t=>t.key!==e.key),P.value=L.value.length>0?L.value[0].key:``)}catch{}}}function rt(){let e=ge.value;e&&typeof e.duration==`number`&&!isNaN(e.duration)&&(he.value=e.duration)}function it(){G.value&&(G.value=!1,q&&=(clearTimeout(q),null),at())}function at(){let e=ge.value;if(!(!e||e.readyState<2))try{let t=document.createElement(`canvas`);t.width=e.videoWidth,t.height=e.videoHeight,t.getContext(`2d`).drawImage(e,0,0),st(t.toDataURL(`image/jpeg`,.9))}catch{window.$message?.error(`无法截取该帧`)}}function ot(e,t=`cover_frame.jpg`){let n=e.split(`,`),r=(n[0].match(/:(.*?);/)||[])[1]||`image/jpeg`,i=atob(n[1]),a=i.length,o=new Uint8Array(a);for(let e=0;e<a;e++)o[e]=i.charCodeAt(e);return new File([new Blob([o],{type:r})],t,{type:r})}async function st(e){let t=ot(e),n=new FormData;n.append(`file`,t),n.append(`key`,`临时文件`),n.append(`overwrite`,`true`),K.value=!0;try{let e=await O({url:`/files/upload/`,method:`POST`,data:n,headers:{"Content-Type":`multipart/form-data`}});e?.data?.code===0&&e.data.data&&(H.value=e.data.data,U.value=Date.now(),Q(),window.$message?.success(`已截取此帧并设为背景`))}catch{window.$message?.error(`上传失败`)}finally{K.value=!1}}function ct(){let e=ge.value;e&&(e.currentTime=W.value)}function lt(){let e=ge.value;if(!e){window.$message?.warning(`视频尚未加载`);return}if(e.readyState<2){window.$message?.warning(`视频尚未加载完成，请稍候`);return}G.value=!0,e.currentTime=W.value,q=setTimeout(()=>{G.value&&(G.value=!1,at()),q=null},350)}function ut(e){if(e==null||isNaN(e))return`0:00`;let t=Math.floor(e/60),n=Math.floor(e%60),r=Math.round(e%1*10);return r>0?`${t}:${String(n).padStart(2,`0`)}.${r}`:`${t}:${String(n).padStart(2,`0`)}`}async function dt(){let e=document.createElement(`input`);e.type=`file`,e.accept=`.jpg,.jpeg,.png,.gif,.webp`,e.onchange=async e=>{let t=e.target.files?.[0];if(!t)return;ve.value=!0;let n=new FormData;n.append(`file`,t),n.append(`overwrite`,`true`),n.append(`key`,`临时文件`);try{let e=await O({url:`/files/upload/`,method:`POST`,data:n,headers:{"Content-Type":`multipart/form-data`}});e?.data?.data&&(J.value=e.data.data,_e.value=Date.now(),Q(),window.$message?.success(`自定义背景已上传`))}catch{}finally{ve.value=!1}},e.click()}function ft(e,t){e.preventDefault(),e.stopPropagation();let n=0,r=0;t===`line1`?(n=z.value.x,r=z.value.y):t===`line2`?(n=B.value.x,r=B.value.y):t===`line1Size`?n=z.value.font_size:t===`line2Size`&&(n=B.value.font_size),Se.value={type:t,startX:e.clientX,startY:e.clientY,startValX:n,startValY:r},document.addEventListener(`mousemove`,pt),document.addEventListener(`mouseup`,mt)}function pt(e){if(!Se.value)return;let t=Se.value,n=(e.clientX-t.startX)/(Z.value*je.value),r=(e.clientY-t.startY)/(Ae.value*Me.value);t.type===`line1`?(z.value.x=Math.round(t.startValX+n),z.value.y=Math.round(t.startValY+r),Q()):t.type===`line2`?(B.value.x=Math.round(t.startValX+n),B.value.y=Math.round(t.startValY+r),Q()):t.type===`line1Size`?(z.value.font_size=Math.max(12,Math.min(400,Math.round(t.startValX+n*2))),Q()):t.type===`line2Size`&&(B.value.font_size=Math.max(12,Math.min(400,Math.round(t.startValX+n*2))),Q())}function mt(){Se.value=null,document.removeEventListener(`mousemove`,pt),document.removeEventListener(`mouseup`,mt)}return(e,t)=>{let n=re,r=ue,i=ae,o=oe;return d(),D(`div`,Yr,[t[92]||=w(`div`,{class:`card-hd`},[w(`span`,{class:`hd-line`}),w(`span`,{class:`hd-title`},`封面制作`)],-1),w(`div`,Xr,[x(w(`textarea`,{"onUpdate:modelValue":t[0]||=e=>k.value=e,class:`cover-title-textarea`,placeholder:`请输入封面标题`},null,512),[[S,k.value]]),w(`button`,{class:`cover-gen-btn`,onClick:Je},`生成标题`)]),w(`div`,Zr,[(d(),D(h,null,a(4,(e,t)=>w(`div`,{key:t,class:`thumb-item`},[de.value&&A.value[t]?(d(),D(`img`,{key:0,src:we(A.value[t]),class:`thumb-img`,alt:``},null,8,Qr)):(d(),D(`div`,$r,u(j[t]),1))])),64))]),w(`div`,{class:`cover-box`},[w(`div`,{class:`cover-btn-row`},[w(`button`,{class:`cover-action-btn`,onClick:$e},`模板编辑`)]),w(`div`,{class:`cover-btn-row-split`},[w(`button`,{class:`cover-action-btn flex-1`,onClick:Xe},`上传封面`),w(`button`,{class:`cover-action-btn flex-1`,onClick:Ye},`生成封面`)]),w(`button`,{class:`btn btn-s`,style:{width:`100%`,"min-height":`44px`},onClick:Ze},`预览`)]),l(n,{show:ce.value,"onUpdate:show":t[1]||=e=>ce.value=e,title:`预览`,style:{width:`500px`}},{default:_(()=>[w(`div`,ei,[b.value?(d(),D(`img`,{key:0,src:we(b.value),style:{"max-width":`100%`,"max-height":`70vh`},alt:``},null,8,ti)):p(``,!0)])]),_:1},8,[`show`]),l(n,{show:le.value,"onUpdate:show":t[44]||=e=>le.value=e,title:`封面模板设置`,preset:`card`,style:{width:`950px`}},{footer:_(()=>[l(i,{type:`primary`,onClick:t[43]||=e=>le.value=!1},{default:_(()=>[...t[91]||=[T(`确定`,-1)]]),_:1})]),default:_(()=>[w(`div`,ni,[t[49]||=w(`span`,{class:`tpl-toolbar-label`},`选择模板`,-1),w(`select`,{value:P.value,class:`tpl-toolbar-sel`,onChange:t[2]||=e=>Qe(e.target.value)},[t[48]||=w(`option`,{value:``},`-- 自定义 --`,-1),(d(!0),D(h,null,a(L.value,e=>(d(),D(`option`,{key:e.key,value:e.key},u(e.name)+u(e.is_preset?``:`(自定义)`),9,ii))),128))],40,ri),w(`div`,ai,[w(`button`,{class:`tpl-action-btn tpl-action-save`,onClick:et},`保存`),w(`button`,{class:c([`tpl-action-btn tpl-action-del`,{disabled:!P.value}]),disabled:!P.value,onClick:nt},`删除`,10,oi)])]),w(`div`,$,[w(`div`,si,[t[50]||=w(`div`,{class:`tpl-preview-title`},`实时预览`,-1),w(`div`,{class:`tpl-canvas`,style:E({width:Za+`px`,height:X.value+`px`})},[ke.value?(d(),D(`img`,{key:0,src:ke.value,class:`tpl-bg-img`,alt:``},null,8,ci)):(d(),D(`div`,li,u(N.value===`video_frame`&&!Oe.value?`请先生成或上传数字人视频`:N.value===`video_frame`&&!H.value?`请从右侧截取一帧`:N.value===`custom_upload`&&!J.value?`请上传自定义背景图`:`请从右侧截取一帧或上传图片`),1)),w(`div`,{class:`tpl-mask`,style:E(Ge.value)},null,4),k.value?(d(),D(`div`,{key:2,class:c([`tpl-text`,{dragging:Se.value&&Se.value.type===`line1`}]),style:E(Be.value),onMousedown:t[7]||=e=>ft(e,`line1`)},[T(u(k.value)+` `,1),w(`span`,{class:`tdot tl`,onMousedown:t[3]||=C(e=>ft(e,`line1Size`),[`stop`]),title:`拖拽调整字号`},null,32),w(`span`,{class:`tdot tr`,onMousedown:t[4]||=C(e=>ft(e,`line1Size`),[`stop`]),title:`拖拽调整字号`},null,32),w(`span`,{class:`tdot bl`,onMousedown:t[5]||=C(e=>ft(e,`line1Size`),[`stop`]),title:`拖拽调整字号`},null,32),w(`span`,{class:`tdot br`,onMousedown:t[6]||=C(e=>ft(e,`line1Size`),[`stop`]),title:`拖拽调整字号`},null,32)],38)):p(``,!0),se.value?(d(),D(`div`,{key:3,class:c([`tpl-text`,{dragging:Se.value&&(Se.value.type===`line2`||Se.value.type===`line2Size`)}]),style:E(We.value),onMousedown:t[12]||=e=>ft(e,`line2`)},[T(u(se.value)+` `,1),w(`span`,{class:`tdot tl`,onMousedown:t[8]||=C(e=>ft(e,`line2Size`),[`stop`]),title:`拖拽调整字号`},null,32),w(`span`,{class:`tdot tr`,onMousedown:t[9]||=C(e=>ft(e,`line2Size`),[`stop`]),title:`拖拽调整字号`},null,32),w(`span`,{class:`tdot bl`,onMousedown:t[10]||=C(e=>ft(e,`line2Size`),[`stop`]),title:`拖拽调整字号`},null,32),w(`span`,{class:`tdot br`,onMousedown:t[11]||=C(e=>ft(e,`line2Size`),[`stop`]),title:`拖拽调整字号`},null,32)],38)):p(``,!0)],4),t[51]||=w(`div`,{class:`tpl-preview-tip`},[T(`拖拽文字调整位置，拖拽四周`),w(`em`,null,`圆点`),T(`调整字号`),w(`br`),T(`调整文字大小也可在右侧设置`),w(`br`),T(`预览效果仅供参考`)],-1)]),w(`div`,ui,[w(`div`,di,[t[60]||=w(`div`,{class:`tpl-section-title`},`背景设置`,-1),w(`div`,fi,[w(`div`,pi,[w(`div`,mi,[t[53]||=w(`span`,{class:`setting-label`},`背景来源`,-1),w(`div`,hi,[x(w(`select`,{"onUpdate:modelValue":t[13]||=e=>N.value=e,class:`s-sel`,style:{flex:`1`},onChange:t[14]||=e=>Q()},[...t[52]||=[w(`option`,{value:`video_frame`},`从视频截取`,-1),w(`option`,{value:`custom_upload`},`自定义图片`,-1)]],544),[[v,N.value]])])])]),N.value===`video_frame`?(d(),D(h,{key:0},[Oe.value?(d(),D(h,{key:0},[w(`div`,gi,[w(`div`,_i,[t[54]||=w(`span`,{class:`setting-label`},`选择画面`,-1),w(`div`,vi,[(d(),D(`video`,{ref_key:`framePickerVideoRef`,ref:ge,crossorigin:`anonymous`,src:Oe.value,key:Oe.value,class:`frame-picker-video`,muted:``,preload:`auto`,onLoadedmetadata:rt,onSeeked:it},null,40,yi))])])]),w(`div`,bi,[w(`div`,xi,[t[55]||=w(`span`,{class:`setting-label`},`时间`,-1),w(`div`,Si,[l(r,{value:W.value,"onUpdate:value":[t[15]||=e=>W.value=e,ct],min:0,max:he.value||1,step:.1},null,8,[`value`,`max`]),w(`span`,Ci,u(ut(W.value))+` / `+u(ut(he.value)),1)])])]),w(`div`,wi,[w(`div`,Ti,[w(`div`,Ei,[l(i,{type:`primary`,size:`small`,loading:K.value,disabled:K.value,onClick:lt},{default:_(()=>[...t[56]||=[T(` 截取此帧并设为背景 `,-1)]]),_:1},8,[`loading`,`disabled`])])])]),H.value?(d(),D(`div`,Di,[w(`div`,Oi,[t[57]||=w(`span`,{class:`setting-label`},`已截取`,-1),w(`img`,{src:we(H.value)+`?t=`+U.value,class:`tpl-thumb`},null,8,ki)])])):p(``,!0)],64)):(d(),D(`div`,Ai,`请先生成或上传数字人视频`))],64)):p(``,!0),N.value===`custom_upload`?(d(),D(h,{key:1},[w(`div`,ji,[w(`div`,Mi,[t[59]||=w(`span`,{class:`setting-label`},`上传背景图`,-1),w(`div`,Ni,[l(i,{size:`small`,loading:ve.value,onClick:dt},{default:_(()=>[T(u(ve.value?`上传中...`:J.value?`重新上传`:`选择图片`),1)]),_:1},8,[`loading`]),t[58]||=w(`span`,{class:`custom-bg-limit-tip`},`支持 JPG/PNG/GIF/WebP，单张不超过 5MB`,-1)])])]),J.value?(d(),D(`div`,Pi,[w(`img`,{src:we(J.value),class:`tpl-thumb`},null,8,Fi)])):p(``,!0)],64)):p(``,!0)])]),w(`div`,Ii,[t[63]||=w(`div`,{class:`tpl-section-title`},`遮罩设置`,-1),w(`div`,Li,[w(`div`,Ri,[w(`div`,zi,[t[61]||=w(`span`,{class:`setting-label`},`遮罩颜色`,-1),w(`div`,Bi,[x(w(`input`,{type:`color`,"onUpdate:modelValue":t[16]||=e=>R.value.color=e,class:`color-inp`,onChange:Q},null,544),[[S,R.value.color]])])]),w(`div`,Vi,[t[62]||=w(`span`,{class:`setting-label`},`不透明度`,-1),w(`div`,Hi,[l(r,{value:R.value.opacity,"onUpdate:value":[t[17]||=e=>R.value.opacity=e,Q],min:0,max:1,step:.05},null,8,[`value`])]),w(`span`,Ui,u(Math.round(R.value.opacity*100))+`%`,1)])])])]),w(`div`,Wi,[t[90]||=w(`div`,{class:`tpl-section-title`},`文字设置`,-1),w(`div`,Gi,[w(`button`,{class:c([`text-tab`,{active:V.value===`line1`}]),onClick:t[18]||=e=>V.value=`line1`},`第一行`,2),w(`button`,{class:c([`text-tab`,{active:V.value===`line2`}]),onClick:t[19]||=e=>V.value=`line2`},`第二行`,2)]),w(`div`,Ki,[V.value===`line1`?(d(),D(h,{key:0},[w(`div`,qi,[w(`div`,Ji,[t[65]||=w(`span`,{class:`setting-label`},`文本内容`,-1),w(`div`,Yi,[x(w(`textarea`,{"onUpdate:modelValue":t[20]||=e=>k.value=e,class:`text-textarea`,placeholder:`请输入第一行文本`,onChange:Q},null,544),[[S,k.value]]),t[64]||=w(`div`,{class:`settings-tip`},`如想增加字间距请输入空格`,-1)])])]),w(`div`,Xi,[w(`div`,Zi,[t[66]||=w(`span`,{class:`setting-label`},`文字颜色`,-1),w(`div`,Qi,[x(w(`input`,{type:`color`,"onUpdate:modelValue":t[21]||=e=>z.value.color=e,class:`color-inp`,onChange:Q},null,544),[[S,z.value.color]])])]),w(`div`,$i,[t[68]||=w(`span`,{class:`setting-label`},`字体文件`,-1),w(`div`,ea,[x(w(`select`,{"onUpdate:modelValue":t[22]||=e=>z.value.font_file=e,class:`s-sel font-select`,onChange:t[23]||=e=>{Q(),Ke(z.value.font_file,`line1`)}},[t[67]||=w(`option`,{value:``},`默认`,-1),(d(!0),D(h,null,a(M.value,e=>(d(),D(`option`,{key:e.file,value:e.file},u(e.name||e.font_name),9,ta))),128))],544),[[v,z.value.font_file]])])])]),w(`div`,na,[w(`div`,ra,[t[69]||=w(`span`,{class:`setting-label`},`字体大小`,-1),w(`div`,ia,[x(w(`input`,{type:`number`,"onUpdate:modelValue":t[24]||=e=>z.value.font_size=e,class:`num-inp`,onChange:Q},null,544),[[S,z.value.font_size,void 0,{number:!0}]])])]),w(`div`,aa,[t[71]||=w(`span`,{class:`setting-label`},`位置方式`,-1),w(`div`,oa,[l(o,{checked:z.value.centerX,"onUpdate:checked":[t[25]||=e=>z.value.centerX=e,Q],size:`small`},{default:_(()=>[...t[70]||=[T(`居中`,-1)]]),_:1},8,[`checked`])])])]),w(`div`,sa,[w(`div`,ca,[t[72]||=w(`span`,{class:`setting-label`},`Y坐标`,-1),w(`div`,la,[x(w(`input`,{type:`number`,"onUpdate:modelValue":t[26]||=e=>z.value.y=e,class:`num-inp`,onChange:Q},null,544),[[S,z.value.y,void 0,{number:!0}]])])]),w(`div`,ua,[t[73]||=w(`span`,{class:`setting-label`},`边框宽度`,-1),w(`div`,da,[x(w(`input`,{type:`number`,"onUpdate:modelValue":t[27]||=e=>z.value.border_w=e,class:`num-inp`,onChange:Q},null,544),[[S,z.value.border_w,void 0,{number:!0}]])])])]),w(`div`,fa,[w(`div`,pa,[t[74]||=w(`span`,{class:`setting-label`},`边框颜色`,-1),w(`div`,ma,[x(w(`input`,{type:`color`,"onUpdate:modelValue":t[28]||=e=>z.value.border_color=e,class:`color-inp`,onChange:Q},null,544),[[S,z.value.border_color]])])]),w(`div`,ha,[t[75]||=w(`span`,{class:`setting-label`},`阴影颜色`,-1),w(`div`,ga,[x(w(`input`,{type:`color`,"onUpdate:modelValue":t[29]||=e=>z.value.shadow_color=e,class:`color-inp`,onChange:Q},null,544),[[S,z.value.shadow_color]])])])]),w(`div`,_a,[w(`div`,va,[t[76]||=w(`span`,{class:`setting-label`},`阴影X偏移`,-1),w(`div`,ya,[x(w(`input`,{type:`number`,"onUpdate:modelValue":t[30]||=e=>z.value.shadow_x=e,class:`num-inp`,onChange:Q},null,544),[[S,z.value.shadow_x,void 0,{number:!0}]])])]),w(`div`,ba,[t[77]||=w(`span`,{class:`setting-label`},`阴影Y偏移`,-1),w(`div`,xa,[x(w(`input`,{type:`number`,"onUpdate:modelValue":t[31]||=e=>z.value.shadow_y=e,class:`num-inp`,onChange:Q},null,544),[[S,z.value.shadow_y,void 0,{number:!0}]])])])])],64)):p(``,!0),V.value===`line2`?(d(),D(h,{key:1},[w(`div`,Sa,[w(`div`,Ca,[t[79]||=w(`span`,{class:`setting-label`},`文本内容`,-1),w(`div`,wa,[x(w(`textarea`,{"onUpdate:modelValue":t[32]||=e=>se.value=e,class:`text-textarea`,placeholder:`请输入第二行文本`,onChange:Q},null,544),[[S,se.value]]),t[78]||=w(`div`,{class:`settings-tip`},`如想增加字间距请输入空格`,-1)])])]),w(`div`,Ta,[w(`div`,Ea,[t[80]||=w(`span`,{class:`setting-label`},`文字颜色`,-1),w(`div`,Da,[x(w(`input`,{type:`color`,"onUpdate:modelValue":t[33]||=e=>B.value.color=e,class:`color-inp`,onChange:Q},null,544),[[S,B.value.color]])])]),w(`div`,Oa,[t[82]||=w(`span`,{class:`setting-label`},`字体文件`,-1),w(`div`,ka,[x(w(`select`,{"onUpdate:modelValue":t[34]||=e=>B.value.font_file=e,class:`s-sel font-select`,onChange:t[35]||=e=>{Q(),Ke(B.value.font_file,`line2`)}},[t[81]||=w(`option`,{value:``},`默认`,-1),(d(!0),D(h,null,a(M.value,e=>(d(),D(`option`,{key:e.file,value:e.file},u(e.name||e.font_name),9,Aa))),128))],544),[[v,B.value.font_file]])])])]),w(`div`,ja,[w(`div`,Ma,[t[83]||=w(`span`,{class:`setting-label`},`字体大小`,-1),w(`div`,Na,[x(w(`input`,{type:`number`,"onUpdate:modelValue":t[36]||=e=>B.value.font_size=e,class:`num-inp`,onChange:Q},null,544),[[S,B.value.font_size,void 0,{number:!0}]])])])]),w(`div`,Pa,[w(`div`,Fa,[t[84]||=w(`span`,{class:`setting-label`},`Y坐标`,-1),w(`div`,Ia,[x(w(`input`,{type:`number`,"onUpdate:modelValue":t[37]||=e=>B.value.y=e,class:`num-inp`,onChange:Q},null,544),[[S,B.value.y,void 0,{number:!0}]])])]),w(`div`,La,[t[85]||=w(`span`,{class:`setting-label`},`边框宽度`,-1),w(`div`,Ra,[x(w(`input`,{type:`number`,"onUpdate:modelValue":t[38]||=e=>B.value.border_w=e,class:`num-inp`,onChange:Q},null,544),[[S,B.value.border_w,void 0,{number:!0}]])])])]),w(`div`,za,[w(`div`,Ba,[t[86]||=w(`span`,{class:`setting-label`},`边框颜色`,-1),w(`div`,Va,[x(w(`input`,{type:`color`,"onUpdate:modelValue":t[39]||=e=>B.value.border_color=e,class:`color-inp`,onChange:Q},null,544),[[S,B.value.border_color]])])]),w(`div`,Ha,[t[87]||=w(`span`,{class:`setting-label`},`阴影颜色`,-1),w(`div`,Ua,[x(w(`input`,{type:`color`,"onUpdate:modelValue":t[40]||=e=>B.value.shadow_color=e,class:`color-inp`,onChange:Q},null,544),[[S,B.value.shadow_color]])])])]),w(`div`,Wa,[w(`div`,Ga,[t[88]||=w(`span`,{class:`setting-label`},`阴影X偏移`,-1),w(`div`,Ka,[x(w(`input`,{type:`number`,"onUpdate:modelValue":t[41]||=e=>B.value.shadow_x=e,class:`num-inp`,onChange:Q},null,544),[[S,B.value.shadow_x,void 0,{number:!0}]])])]),w(`div`,qa,[t[89]||=w(`span`,{class:`setting-label`},`阴影Y偏移`,-1),w(`div`,Ja,[x(w(`input`,{type:`number`,"onUpdate:modelValue":t[42]||=e=>B.value.shadow_y=e,class:`num-inp`,onChange:Q},null,544),[[S,B.value.shadow_y,void 0,{number:!0}]])])])])],64)):p(``,!0)])])])])]),_:1},8,[`show`]),l(n,{show:fe.value,"onUpdate:show":t[47]||=e=>fe.value=e,title:`保存模板`,preset:`card`,style:{width:`400px`}},{default:_(()=>[w(`div`,Ya,[x(w(`input`,{"onUpdate:modelValue":t[45]||=e=>F.value=e,class:`inp`,style:{width:`100%`},placeholder:`模板名称`,onKeyup:g(tt,[`enter`])},null,544),[[S,F.value]]),w(`div`,Xa,[w(`button`,{class:`btn-s`,style:{background:`rgb(var(--base-text-color)/0.08)`,color:`rgb(var(--base-text-color)/0.55)`},onClick:t[46]||=e=>fe.value=!1},`取消`),w(`button`,{class:`btn-s`,onClick:tt},`保存`)])])]),_:1},8,[`show`])])}}}),[[`__scopeId`,`data-v-a159d245`]]),to=`data:image/png;base64,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`,no=`data:image/png;base64, `,ro=`data:image/png;base64,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`,io={class:`card`},ao={class:`opt-row`},oo=[`disabled`],so={class:`plat-row`},co=[`onClick`],lo=[`src`],uo={key:0,class:`radio-dot`},fo={class:`plat-name`},po={style:{"text-align":`center`,padding:`28px 24px`,background:`#1a1a2e`,"border-radius":`12px`}},mo=k(t({__name:`Release`,props:{releaseSettings:{}},setup(t){let n=t,i=s(`advanceProgress`,()=>{}),o=y(!1),f=y(!1),m=y(!1),ee=y(!1),g=y(!1),v=y(!1),b=y(!1),x={douyin:to,shipinghao:no,kuaishou:ro};n.releaseSettings&&(o.value=n.releaseSettings.auto_publish||!1,f.value=n.releaseSettings.isAddCover===void 0?!!me.value:n.releaseSettings.isAddCover,m.value=n.releaseSettings.douyin||!1,ee.value=n.releaseSettings.shipinghao||!1,g.value=n.releaseSettings.kuaishou||!1);function S(){Object.assign(n.releaseSettings,{auto_publish:o.value,isAddCover:f.value,douyin:m.value,shipinghao:ee.value,kuaishou:g.value})}let C=[{key:`douyin`,label:`抖音`,ref:m,toggle:()=>{m.value=!m.value,S()}},{key:`shipinghao`,label:`视频号`,ref:ee,toggle:()=>{ee.value=!ee.value,S()}},{key:`kuaishou`,label:`快手`,ref:g,toggle:()=>{g.value=!g.value,S()}}];async function E(){let e=C.filter(e=>e.ref.value).map(e=>e.key);if(e.length===0){window.$message?.warning(`请至少选择一个发布平台`);return}if(!v.value){v.value=!0;try{if(window.__videoAddress){let t=H.value||``,n=window.__videoAddress,r=U.value||[],a=f.value&&me.value||``;if(!t.trim()){window.$message?.warning(`请先生成或填写发布标题`);return}if(f.value&&!a){window.$message?.warning(`已勾选添加封面，请先生成或上传封面`);return}b.value=!0;for(let i of e){let e=await O({url:`/video/publish_v2/`,method:`POST`,data:{video_file:n,platform:i,title:t,topics:r,cover:a,auto_publish:o.value}});if(e?.data?.code!==0)throw Error(e?.data?.message||`${C.find(e=>e.key===i)?.label||i} 发布失败`)}i(6)}else{for(let t of e){let e=C.find(e=>e.key===t)?.label||t;window.$message?.info(`正在打开 `+e+` 登录窗口...`),await O({url:`/video/publish/login/`,method:`POST`,data:{platform:t}}),await new Promise(e=>setTimeout(e,1500))}window.$message?.warning(`登录窗口已全部打开，请在任务栏找到 Chrome 窗口完成扫码登录。`)}}catch(e){b.value=!1,window.$message?.error(e?.message||`发布失败`)}finally{v.value=!1}}}let te=e(`pubBtn`);return r(()=>{te.value&&te.value.addEventListener(`click`,E)}),(e,t)=>{let n=de,r=ae,i=re;return d(),D(`div`,io,[t[10]||=w(`div`,{class:`card-hd`},[w(`span`,{class:`hd-line`}),w(`span`,{class:`hd-title`},`发布平台`)],-1),t[11]||=w(`div`,{class:`hint`},[T(`首次发布需在浏览器登录账号，后续无需登录`),w(`br`),T(`如需切换账号，请手动在浏览器内切换`)],-1),w(`div`,ao,[w(`div`,{class:`opt-item`,onClick:t[0]||=e=>{o.value=!o.value,S()}},[w(`span`,{class:c([`chk-circle`,{on:o.value}])},u(o.value?`✓`:``),3),t[4]||=w(`span`,{class:`opt-label`},`直接发布`,-1)]),w(`div`,{class:`opt-item`,onClick:t[1]||=e=>{f.value=!f.value,S()}},[w(`span`,{class:c([`chk-circle`,{on:f.value}])},u(f.value?`✓`:``),3),t[5]||=w(`span`,{class:`opt-label`},`添加封面`,-1)])]),w(`button`,{ref_key:`pubBtn`,ref:te,class:`btn`,disabled:v.value},`视频发布到各平台`,8,oo),t[12]||=w(`div`,{class:`hint`},`发布平台（可多选）`,-1),w(`div`,so,[(d(),D(h,null,a(C,e=>w(`div`,{key:e.key,class:`plat-item`,onClick:t=>e.toggle()},[w(`img`,{src:x[e.key],class:`plat-img`,alt:``},null,8,lo),w(`span`,{class:c([`plat-radio`,{on:e.ref.value}])},[e.ref.value?(d(),D(`span`,uo)):p(``,!0)],2),w(`span`,fo,u(e.label),1)],8,co)),64))]),l(i,{show:b.value,"onUpdate:show":t[3]||=e=>b.value=e,"mask-closable":!1,style:{width:`380px`}},{default:_(()=>[w(`div`,po,[l(n,{size:`large`}),t[7]||=w(`div`,{style:{"margin-top":`14px`,"font-size":`17px`,"font-weight":`600`,color:`rgb(var(--base-text-color))`}},`正在发布，请稍后...`,-1),t[8]||=w(`div`,{style:{"margin-top":`10px`,"font-size":`14px`,color:`rgb(var(--base-text-color)/0.55)`}},`可手动关闭此窗口，发布将在后台继续`,-1),t[9]||=w(`div`,{style:{"margin-top":`6px`,"font-size":`14px`,color:`#ff4d4f`}},`发布页会打开在电脑下方任务栏右侧，请手动点击查看`,-1),l(r,{size:`medium`,style:{"margin-top":`16px`},onClick:t[2]||=e=>b.value=!1},{default:_(()=>[...t[6]||=[T(`关闭`,-1)]]),_:1})])]),_:1},8,[`show`])])}}}),[[`__scopeId`,`data-v-aa25570e`]]),ho={class:`beams-root`},go={class:`beams-content`},_o=20,vo=k(t({__name:`BeamsBackground`,setup(e){function t(e,t){let n=-35+Math.random()*10;return{x:Math.random()*e*1.5-e*.25,y:Math.random()*t*1.5-t*.25,width:30+Math.random()*60,length:t*2.5,angle:n,speed:.6+Math.random()*1.2,opacity:.12+Math.random()*.16,hue:190+Math.random()*70,pulse:Math.random()*Math.PI*2,pulseSpeed:.02+Math.random()*.03}}function n(e,t){e.save(),e.translate(t.x,t.y),e.rotate(t.angle*Math.PI/180);let n=t.opacity*(.8+Math.sin(t.pulse)*.2),r=e.createLinearGradient(0,0,0,t.length);r.addColorStop(0,`hsla(${t.hue}, 85%, 65%, 0)`),r.addColorStop(.1,`hsla(${t.hue}, 85%, 65%, ${n*.5})`),r.addColorStop(.4,`hsla(${t.hue}, 85%, 65%, ${n})`),r.addColorStop(.6,`hsla(${t.hue}, 85%, 65%, ${n})`),r.addColorStop(.9,`hsla(${t.hue}, 85%, 65%, ${n*.5})`),r.addColorStop(1,`hsla(${t.hue}, 85%, 65%, 0)`),e.fillStyle=r,e.fillRect(-t.width/2,0,t.width,t.length),e.restore()}let i=y(),a=0;return r(()=>{let e=i.value;if(!e)return;let r=e.getContext(`2d`);if(!r)return;let o=[];function s(){let n=window.devicePixelRatio||1,i=window.innerWidth,a=window.innerHeight;e.width=i*n,e.height=a*n,e.style.width=`${i}px`,e.style.height=`${a}px`,r.setTransform(n,0,0,n,0,0),o=Array.from({length:_o*1.5},()=>t(i,a))}s(),window.addEventListener(`resize`,s);function c(e,t){let n=window.innerWidth,r=window.innerHeight,i=t%3,a=n/3;e.y=r+100,e.x=i*a+a/2+(Math.random()-.5)*a*.5,e.width=100+Math.random()*100,e.speed=.5+Math.random()*.4,e.opacity=.2+Math.random()*.1}function l(){!e||!r||(r.clearRect(0,0,e.width,e.height),r.filter=`blur(35px)`,o.forEach((e,t)=>{e.y-=e.speed,e.pulse+=e.pulseSpeed,e.y+e.length<-100&&c(e,t),n(r,e)}),a=requestAnimationFrame(l))}l(),ne(()=>{window.removeEventListener(`resize`,s),cancelAnimationFrame(a)})}),(e,t)=>(d(),D(`div`,ho,[w(`canvas`,{ref_key:`canvasRef`,ref:i,class:`beams-canvas`},null,512),t[0]||=w(`div`,{class:`beams-overlay`},null,-1),w(`div`,go,[b(e.$slots,`default`,{},void 0,!0)])]))}}),[[`__scopeId`,`data-v-c92b79b7`]]),yo={class:`home-container`},bo={class:`progress-bar-wrapper`},xo={class:`tech-progress`},So={class:`tp-num`},Co={key:0,class:`tp-check`},wo={class:`tp-labels`},To={class:`tp-desc`},Eo={key:0,class:`workspace`},Do={class:`col col-left`},Oo={class:`col col-right`},ko={class:`col col-third`},Ao={class:`third-bottom-row`},jo={class:`loading-box`},Mo={class:`loading-msg`},No=k(t({name:`home`,__name:`index`,setup(e){let t={btnType:`intelligentRewriting`,audioSettings:{timbre:``,num:1,jzPause:.1,jjPause:.1,generateType:`direct`,chooseImage:``,use_super_resolution:!1,voice:``,miniMaxEmotion:`auto`,speechRates:1,volumes:1,pitchRates:0},videoClipSettings:{use_super_music:!1,timbreTem:`剪辑模板1`,useTemplateDefaults:!0,customTemplates:[],timbreMus:``,bgvalue:20,pervalue:100,enableDrawText:!0,enablePip:!1,pipVideoFile:``,pipVideoName:``,pipPosition:`bottom-right`,pipScale:.3,pipStartTime:0,pipEndTime:0,pipEdgeCleanup:!0,pipAudioVolume:0,pipOpacity:1,drawText:{text:``,primary_color:`#FFFFFF`,font_file:``,font_size:90,start_time:0,duration_time:0,x:0,y:0,outline1_color:`#000000`,outline1_width:0,outline2_color:`#000000`,outline2_width:0,shadow_color:`#000000`,shadow_x:0,shadow_y:0},drawText2:{text:``,primary_color:`#FFFFFF`,font_file:``,font_size:90,start_time:0,duration_time:0,x:0,y:0,outline1_color:`#000000`,outline1_width:0,outline2_color:`#000000`,outline2_width:0,shadow_color:`#000000`,shadow_x:0,shadow_y:0},clipVideoBitrate:`8M`,enableSubtitle:!0,srtSettings:{primary_color:`#FFFFFF`,outline_color:`#000000`,outline_width:1,font_file:``,font_size:70,margin_left_right:80,margin_bottom:50,subtitle_effect:`none`}},coverMakeSettings:{selectedTemplate:``,backgroundSource:`avatar_cover`,maskSettings:{color:`#000000`,opacity:.1},drawTextSettings:{font_file:``,color:`#FFFFFF`,font_size:200,x:0,y:800,centerX:!0},drawTextSettings2:{font_file:``,color:`#FFFFFF`,font_size:200,x:0,y:800,centerX:!0}},releaseSettings:{auto_publish:!1,isAddCover:!1,douyin:!1,shipinghao:!1,kuaishou:!1}},i=y({wordService:0,titleService:0,voiceModelType:`1`,batchSize:8,videoClipEncoder:`libx264`}),o=m(structuredClone(t)),s=y(``),f=y([]),g=y(!1),v=y(0),b=y(!1),x=y(``);function S(e){x.value=e?.message||``,b.value=!0}function C(){b.value=!1,x.value=``}let T=[{num:1,title:`文案仿写`,desc:`提取并改写文案`},{num:2,title:`标题话题`,desc:`生成标题与话题`},{num:3,title:`音频视频`,desc:`生成音频/口播视频`},{num:4,title:`视频剪辑`,desc:`剪辑并添加字幕`},{num:5,title:`封面制作`,desc:`生成视频封面`},{num:6,title:`发布平台`,desc:`发布到各平台`}],E=null;window.__copywritingText=s.value;function ne(e){s.value=e||``,window.__copywritingText=s.value}let ie=y(``);window.__titleText=ie.value;function ae(e){e>v.value&&(v.value=e)}function k(){g.value&&(E&&clearTimeout(E),E=setTimeout(async()=>{try{await O({url:`/config/`,method:`POST`,data:{key:`persistence`,value:{...o}}})}catch{}},300))}ee(o,k,{deep:!0});async function oe(){try{let e=await O({url:`/config/?key=api`});e.data?.data&&Object.assign(i.value,e.data?.data)}catch{}}r(async()=>{await oe();try{let e=(await O({url:`/config/?key=persistence`})).data?.data;e&&(o.btnType=e.btnType||t.btnType,o.audioSettings={...t.audioSettings,...e.audioSettings||{}},o.videoClipSettings={...t.videoClipSettings,...e.videoClipSettings||{},drawText:{...t.videoClipSettings.drawText,...e.videoClipSettings?.drawText||{}},drawText2:{...t.videoClipSettings.drawText2,...e.videoClipSettings?.drawText2||{}},srtSettings:{...t.videoClipSettings.srtSettings,...e.videoClipSettings?.srtSettings||{}}},o.coverMakeSettings={...t.coverMakeSettings,...e.coverMakeSettings||{},maskSettings:{...t.coverMakeSettings.maskSettings,...e.coverMakeSettings?.maskSettings||{}},drawTextSettings:{...t.coverMakeSettings.drawTextSettings,...e.coverMakeSettings?.drawTextSettings||{}},drawTextSettings2:{...t.coverMakeSettings.drawTextSettings2,...e.coverMakeSettings?.drawTextSettings2||{}}},o.releaseSettings={...t.releaseSettings,...e.releaseSettings||{}})}catch{}g.value=!0});let se=y(``);return n(`persistence`,o),n(`open`,S),n(`close`,C),n(`userApiData`,i),n(`reloadUserApiData`,oe),n(`advanceProgress`,ae),n(`copywritingText`,s),n(`titleText`,ie),n(`autoModeStep`,se),(e,t)=>{let n=de,r=re;return d(),te(vo,null,{default:_(()=>[w(`div`,yo,[w(`div`,bo,[w(`div`,xo,[(d(),D(h,null,a(T,e=>w(`div`,{key:e.num,class:`tp-node-wrap`},[w(`div`,{class:c([`tp-line`,{done:v.value>=e.num}])},[...t[3]||=[w(`div`,{class:`tp-line-fill`},null,-1)]],2),w(`div`,{class:c([`tp-node`,{done:v.value>=e.num,active:v.value===e.num-1}])},[w(`span`,So,u(e.num),1),v.value>=e.num?(d(),D(`span`,Co,`✓`)):p(``,!0)],2),w(`div`,wo,[w(`span`,{class:c([`tp-title`,{done:v.value>=e.num}])},u(e.title),3),w(`span`,To,u(e.desc),1)])])),64))])]),g.value?(d(),D(`div`,Eo,[w(`div`,Do,[l(V,{"user-api-data":i.value,"btn-type":o.btnType,"onUpdate:btnType":t[0]||=e=>o.btnType=e,onTextChanged:ne},null,8,[`user-api-data`,`btn-type`])]),w(`div`,Oo,[l(q,{"user-api-data":i.value},null,8,[`user-api-data`]),l(Ke,{"user-api-data":i.value,"audio-settings":o.audioSettings,onSrtDataReady:t[1]||=e=>f.value=Array.isArray(e)?e:[]},null,8,[`user-api-data`,`audio-settings`])]),w(`div`,ko,[l(Jr,{"video-clip-settings":o.videoClipSettings,"srt-data":f.value},null,8,[`video-clip-settings`,`srt-data`]),w(`div`,Ao,[l(eo,{"cover-make-settings":o.coverMakeSettings},null,8,[`cover-make-settings`]),l(mo,{"release-settings":o.releaseSettings},null,8,[`release-settings`])])])])):p(``,!0)]),l(r,{show:b.value,"onUpdate:show":t[2]||=e=>b.value=e,"mask-closable":!1,style:{width:`400px`}},{default:_(()=>[w(`div`,jo,[l(n,{size:`large`}),w(`div`,Mo,u(x.value),1)])]),_:1},8,[`show`])]),_:1})}}}),[[`__scopeId`,`data-v-c14b8e08`]]);export{No as default};