diff --git a/video-gen-admin/dist/assets/index-CEW5ggCs.js b/video-gen-admin/dist/assets/index-CzqFKsZY.js similarity index 97% rename from video-gen-admin/dist/assets/index-CEW5ggCs.js rename to video-gen-admin/dist/assets/index-CzqFKsZY.js index 450f6801..3acf7bb8 100644 --- a/video-gen-admin/dist/assets/index-CEW5ggCs.js +++ b/video-gen-admin/dist/assets/index-CzqFKsZY.js @@ -545,4 +545,4 @@ MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA...\r 你是一位专业的电商视频文案专家,擅长将产品卖点转化为视觉语言`,size:`large`})}),(0,Q.jsx)(X.Item,{name:`skills_wentutujie_image`,label:`文图理解生成图片提示词`,extra:`用于LLM优化图片提示词的系统指令,根据行业特点引导AI理解文案与画面的关系`,children:(0,Q.jsx)(MN.TextArea,{rows:3,placeholder:`请输入文图理解生成图片提示词,例如: 你是一位专业的电商图片文案专家,擅长将产品卖点转化为图片生成提示词`,size:`large`})}),(0,Q.jsxs)(`div`,{style:{marginBottom:8},children:[(0,Q.jsx)(Z.Text,{strong:!0,style:{fontSize:13},children:`行业选项配置`}),(0,Q.jsx)(Z.Text,{style:{fontSize:12,color:`#94a3b8`,marginLeft:8},children:`添加选项组,每组包含名称和多个选项,前台将显示为下拉选择`})]}),(0,Q.jsx)(X.List,{name:`optionGroups`,children:(e,{add:t,remove:n})=>(0,Q.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8,marginBottom:16},children:[e.map(({key:e,name:t,...r})=>(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:8,alignItems:`flex-start`,padding:`10px 12px`,borderRadius:10,background:`#f8f9fc`,border:`1px solid #f0f0f5`},children:[(0,Q.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,gap:8},children:[(0,Q.jsx)(X.Item,{...r,name:[t,`name`],label:`选项名称`,style:{marginBottom:0},rules:[{required:!0,message:`请输入选项名称`}],children:(0,Q.jsx)(MN,{placeholder:`例如:视频风格`,size:`middle`,style:{borderRadius:8}})}),(0,Q.jsx)(X.Item,{...r,name:[t,`options`],label:`选项内容`,style:{marginBottom:0},children:(0,Q.jsx)(bb,{mode:`tags`,size:`middle`,placeholder:`输入选项后回车添加`,style:{borderRadius:8},tokenSeparators:[`,`,`,`,`、`]})})]}),(0,Q.jsx)($$,{onClick:()=>n(t),style:{color:`#ef4444`,fontSize:16,marginTop:34,cursor:`pointer`,flexShrink:0}})]},e)),(0,Q.jsx)(JS,{type:`dashed`,onClick:()=>t(),block:!0,icon:(0,Q.jsx)(rA,{}),style:{borderRadius:8,height:36},children:`添加选项组`})]})}),(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:16},children:[(0,Q.jsx)(X.Item,{name:`is_active`,label:`启用状态`,valuePropName:`checked`,initialValue:!0,style:{flex:1},children:(0,Q.jsx)(eF,{})}),(0,Q.jsx)(X.Item,{name:`sort_order`,label:`排序`,initialValue:0,style:{flex:1},children:(0,Q.jsx)(MN,{type:`number`,size:`large`})})]})]})})]})};function G5(e){if(Array.isArray(e))return e;if(typeof e==`string`)try{return JSON.parse(e)}catch{return[]}return[]}var bUe=()=>{let[e,t]=(0,C.useState)([]),[n,r]=(0,C.useState)(!1),[i,a]=(0,C.useState)({open:!1,engine:null}),[o]=X.useForm(),s=X.useWatch(`multiGenerationEnabled`,o)??!1,c=async()=>{r(!0);try{t((await aVe()).map(e=>({...e,supportedRatios:G5(e.supportedRatios),supportedResolutions:G5(e.supportedResolutions),supportedDurations:G5(e.supportedDurations)})))}catch{mP.error(`加载视频引擎失败`)}finally{r(!1)}};(0,C.useEffect)(()=>{c()},[]);let l=async()=>{try{let e=await o.validateFields(),t={name:e.name,provider:e.provider,api_base:e.apiBase,api_key:e.apiKey,model_name:e.modelName,supported_ratios:JSON.stringify(e.supportedRatios||[]),supported_resolutions:JSON.stringify(e.supportedResolutions||[]),supported_durations:JSON.stringify(e.supportedDurations||[]),max_duration:e.maxDuration??15,max_image_count:e.maxImageCount??2,max_video_count:e.maxVideoCount??0,max_audio_count:e.maxAudioCount??0,supports_first_last_frame:e.supportsFirstLastFrame??!1,supports_universal_reference:e.supportsUniversalReference??!0,is_active:e.isActive??!0,priority:e.priority??0,multi_generation_enabled:e.multiGenerationEnabled??!1,max_generation_count:e.maxGenerationCount??1};i.engine?(await n5({id:i.engine.id,...t}),mP.success(`已更新`)):(await n5(t),mP.success(`已添加`)),a({open:!1,engine:null}),o.resetFields(),c()}catch(e){if(e?.errorFields)return;mP.error(e?.message||`保存失败`)}},u=async e=>{try{await oVe(e),mP.success(`已删除`),c()}catch{mP.error(`删除失败`)}},d=e=>{a({open:!0,engine:e||null}),e?o.setFieldsValue(e):(o.resetFields(),o.setFieldsValue({isActive:!0,priority:0,multiGenerationEnabled:!1,maxGenerationCount:1,maxDuration:30,maxImageCount:2,maxVideoCount:0,maxAudioCount:0,supportsFirstLastFrame:!1,supportsUniversalReference:!0,supportedRatios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],supportedResolutions:[`480p`,`720p`,`1080p`],supportedDurations:[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]}))};return(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(OA,{variant:`outlined`,style:{borderRadius:12,border:`1px solid #f0f0f5`},children:[(0,Q.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,marginBottom:16},children:[(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(r0,{style:{fontSize:18,color:`#6366f1`}}),(0,Q.jsx)(Z.Text,{strong:!0,style:{fontSize:16},children:`视频引擎配置`}),(0,Q.jsxs)(hR,{color:`purple`,children:[e.length,` 个引擎`]})]}),(0,Q.jsx)(JS,{type:`primary`,icon:(0,Q.jsx)(rA,{}),onClick:()=>d(),style:{borderRadius:8},children:`添加引擎`})]}),(0,Q.jsx)(nR,{columns:[{title:`引擎名称`,key:`name`,width:180,render:(e,t)=>(0,Q.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,Q.jsx)(`div`,{style:{width:36,height:36,borderRadius:8,background:t.isActive?`linear-gradient(135deg, #6366f1, #8b5cf6)`:`linear-gradient(135deg, #94a3b8, #cbd5e1)`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#fff`,fontSize:16},children:(0,Q.jsx)(r0,{})}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(Z.Text,{strong:!0,children:t.name}),(0,Q.jsx)(`div`,{style:{color:`#94a3b8`,fontSize:12},children:t.provider})]})]})},{title:`支持比例`,dataIndex:`supportedRatios`,width:200,render:e=>(0,Q.jsx)(CM,{size:2,wrap:!0,children:e.map(e=>(0,Q.jsx)(hR,{children:e},e))})},{title:`支持分辨率`,dataIndex:`supportedResolutions`,width:150,render:e=>(0,Q.jsx)(CM,{size:2,wrap:!0,children:e.map(e=>(0,Q.jsx)(hR,{color:`blue`,children:e},e))})},{title:`支持时长`,dataIndex:`supportedDurations`,width:120,render:e=>(0,Q.jsx)(hR,{color:`orange`,children:e?.length?`${Math.min(...e)}-${Math.max(...e)}s`:`-`})},{title:`最大图片`,dataIndex:`maxImageCount`,width:100,render:e=>(0,Q.jsxs)(hR,{color:`purple`,children:[e,` 张`]})},{title:`最大视频`,dataIndex:`maxVideoCount`,width:100,render:e=>(0,Q.jsxs)(hR,{color:`cyan`,children:[e,` 个`]})},{title:`最大音频`,dataIndex:`maxAudioCount`,width:100,render:e=>(0,Q.jsxs)(hR,{color:e>0?`geekblue`:`default`,children:[e||0,` 段`]})},{title:`首尾帧`,dataIndex:`supportsFirstLastFrame`,width:90,render:e=>(0,Q.jsx)(hR,{color:e?`green`:`default`,children:e?`支持`:`不支持`})},{title:`全能参考`,dataIndex:`supportsUniversalReference`,width:100,render:e=>(0,Q.jsx)(hR,{color:e?`purple`:`default`,children:e?`支持`:`不支持`})},{title:`多份生成`,dataIndex:`multiGenerationEnabled`,width:100,render:e=>(0,Q.jsx)(hR,{color:e?`blue`:`default`,children:e?`开启`:`关闭`})},{title:`数量上限`,dataIndex:`maxGenerationCount`,width:100,render:(e,t)=>(0,Q.jsxs)(hR,{color:t.multiGenerationEnabled&&Number(e||1)>1?`magenta`:`default`,children:[`最多 `,t.multiGenerationEnabled&&e||1,` 份`]})},{title:`状态`,dataIndex:`isActive`,width:80,render:e=>(0,Q.jsx)(hR,{color:e?`green`:`default`,children:e?`启用`:`停用`})},{title:`操作`,key:`action`,width:150,fixed:`right`,render:(e,t)=>(0,Q.jsxs)(CM,{size:4,children:[(0,Q.jsx)(JS,{type:`link`,size:`small`,icon:(0,Q.jsx)(xR,{}),onClick:()=>d(t),children:`编辑`}),(0,Q.jsx)(yP,{title:`确定删除?`,onConfirm:()=>u(t.id),children:(0,Q.jsx)(JS,{type:`link`,size:`small`,danger:!0,icon:(0,Q.jsx)(vR,{}),children:`删除`})})]})}],dataSource:e,rowKey:`id`,loading:n,pagination:!1,scroll:{x:1200}})]}),(0,Q.jsx)(gP,{title:(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(r0,{}),i.engine?`编辑引擎`:`添加引擎`]}),open:i.open,onOk:l,onCancel:()=>{a({open:!1,engine:null}),o.resetFields()},okText:`保存`,cancelText:`取消`,width:620,children:(0,Q.jsxs)(X,{form:o,layout:`vertical`,style:{marginTop:16},children:[(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:16},children:[(0,Q.jsx)(X.Item,{name:`name`,label:`引擎名称`,style:{flex:1},rules:[{required:!0}],children:(0,Q.jsx)(MN,{placeholder:`Seedance 2.0`,size:`large`})}),(0,Q.jsx)(X.Item,{name:`provider`,label:`提供商`,style:{flex:1},rules:[{required:!0}],children:(0,Q.jsx)(bb,{size:`large`,options:[{value:`ark`,label:`火山引擎 (Ark)`}]})})]}),(0,Q.jsx)(X.Item,{name:`apiBase`,label:`API基础地址`,rules:[{required:!0}],children:(0,Q.jsx)(MN,{placeholder:`https://ark.cn-beijing.volces.com/api/v3`,size:`large`})}),(0,Q.jsx)(X.Item,{name:`apiKey`,label:`API Key`,children:(0,Q.jsx)(MN.Password,{placeholder:`sk-****`,size:`large`})}),(0,Q.jsx)(X.Item,{name:`modelName`,label:`模型名称`,children:(0,Q.jsx)(MN,{placeholder:`doubao-seedance-2-0-260128`,size:`large`})}),(0,Q.jsx)(X.Item,{name:`supportedRatios`,label:`支持比例`,children:(0,Q.jsx)(bb,{mode:`multiple`,size:`large`,options:[{value:`16:9`,label:`16:9 (横屏)`},{value:`4:3`,label:`4:3 (标准)`},{value:`1:1`,label:`1:1 (方形)`},{value:`3:4`,label:`3:4 (竖版)`},{value:`9:16`,label:`9:16 (竖屏)`},{value:`21:9`,label:`21:9 (超宽)`}]})}),(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:16},children:[(0,Q.jsx)(X.Item,{name:`supportedResolutions`,label:`支持分辨率`,style:{flex:1},children:(0,Q.jsx)(bb,{mode:`multiple`,size:`large`,options:[{value:`480p`},{value:`720p`},{value:`1080p`}]})}),(0,Q.jsx)(X.Item,{name:`supportedDurations`,label:`支持时长(秒)`,style:{flex:1},children:(0,Q.jsx)(bb,{mode:`multiple`,size:`large`,options:Array.from({length:12},(e,t)=>({value:t+4,label:`${t+4}秒`}))})})]}),(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:16},children:[(0,Q.jsx)(X.Item,{name:`maxDuration`,label:`最大时长(秒)`,style:{flex:1},children:(0,Q.jsx)(MN,{type:`number`,size:`large`})}),(0,Q.jsx)(X.Item,{name:`maxImageCount`,label:`最大图片数量`,style:{flex:1},children:(0,Q.jsx)(MN,{type:`number`,size:`large`})}),(0,Q.jsx)(X.Item,{name:`maxVideoCount`,label:`最大视频数量`,style:{flex:1},children:(0,Q.jsx)(MN,{type:`number`,size:`large`})})]}),(0,Q.jsx)(`div`,{style:{display:`flex`,gap:16},children:(0,Q.jsx)(X.Item,{name:`maxAudioCount`,label:`最大参考音频数`,style:{flex:1},extra:`0 表示不支持音频参考,最大 3 段`,rules:[{validator:(e,t)=>{let n=Number(t??0);return!Number.isInteger(n)||n<0||n>3?Promise.reject(Error(`最大参考音频数必须为 0-3 的整数`)):Promise.resolve()}}],children:(0,Q.jsx)(MN,{type:`number`,size:`large`,min:0,max:3})})}),(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:16},children:[(0,Q.jsx)(X.Item,{name:`supportsFirstLastFrame`,label:`首尾帧模式`,valuePropName:`checked`,style:{paddingTop:30,flex:1},children:(0,Q.jsx)(eF,{checkedChildren:`支持`,unCheckedChildren:`不支持`})}),(0,Q.jsx)(X.Item,{name:`supportsUniversalReference`,label:`全能参考模式`,valuePropName:`checked`,style:{paddingTop:30,flex:1},children:(0,Q.jsx)(eF,{checkedChildren:`支持`,unCheckedChildren:`不支持`})}),(0,Q.jsx)(X.Item,{name:`isActive`,label:`启用状态`,valuePropName:`checked`,style:{paddingTop:30,flex:1},children:(0,Q.jsx)(eF,{})})]}),(0,Q.jsxs)(`div`,{style:{background:`#f8f9fc`,borderRadius:10,padding:16,marginBottom:12},children:[(0,Q.jsx)(Z.Text,{strong:!0,children:`多份生成能力`}),(0,Q.jsx)(Z.Paragraph,{style:{margin:`6px 0 0`,color:`#64748b`,fontSize:12},children:`管理后台只控制是否允许客户端选择多份及最大数量;客户端每次可在 1 到上限之间选择。`})]}),(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:16},children:[(0,Q.jsx)(X.Item,{name:`multiGenerationEnabled`,label:`允许客户端多份生成`,valuePropName:`checked`,style:{flex:1},children:(0,Q.jsx)(eF,{checkedChildren:`开启`,unCheckedChildren:`关闭`})}),(0,Q.jsx)(X.Item,{name:`maxGenerationCount`,label:`客户端最大生成数量`,style:{flex:1},rules:[{required:!0}],children:(0,Q.jsx)(xj,{min:1,max:5,precision:0,size:`large`,style:{width:`100%`},disabled:!s})}),(0,Q.jsx)(X.Item,{name:`priority`,label:`优先级`,style:{flex:1},children:(0,Q.jsx)(bb,{size:`large`,options:[{value:0,label:`0 (默认)`},{value:1,label:`1`},{value:2,label:`2`},{value:3,label:`3`},{value:5,label:`5`},{value:10,label:`10 (最高)`}]})})]})]})})]})};function xUe(e){if(Array.isArray(e))return e;if(typeof e==`string`)try{return JSON.parse(e)}catch{return[]}return[]}function SUe(e){if(e&&typeof e==`object`&&!Array.isArray(e))return e;if(typeof e==`string`)try{let t=JSON.parse(e);return t&&typeof t==`object`&&!Array.isArray(t)?t:{}}catch{return{}}return{}}var K5={"1K":{"1:1":`1024x1024`,"4:3":`1152x864`,"3:4":`864x1152`,"16:9":`1312x736`,"9:16":`736x1312`,"3:2":`1248x832`,"2:3":`832x1248`,"21:9":`1568x672`},"2K":{"1:1":`2048x2048`,"4:3":`2304x1728`,"3:4":`1728x2304`,"16:9":`2848x1600`,"9:16":`1600x2848`,"3:2":`2496x1664`,"2:3":`1664x2496`,"21:9":`3136x1344`},"4K":{"1:1":`4096x4096`,"4:3":`4704x3520`,"3:4":`3520x4704`,"16:9":`5504x3040`,"9:16":`3040x5504`,"3:2":`4992x3328`,"2:3":`3328x4992`,"21:9":`6197x2656`}},q5=[`1:1`,`4:3`,`3:4`,`16:9`,`9:16`,`3:2`,`2:3`,`21:9`],CUe=()=>{let[e,t]=(0,C.useState)([]),[n,r]=(0,C.useState)(!1),[i,a]=(0,C.useState)({open:!1,engine:null}),[o]=X.useForm(),s=X.useWatch(`multiGenerationEnabled`,o)??!1,c=async()=>{r(!0);try{t((await sVe()).map(e=>({...e,supportedModels:xUe(e.supportedModels),supportedSizes:SUe(e.supportedSizes)})))}catch{mP.error(`加载图片引擎失败`)}finally{r(!1)}};(0,C.useEffect)(()=>{c()},[]);let l=async()=>{try{let e=await o.validateFields(),t={};for(let n of[`1K`,`2K`,`4K`]){let r=e[`size_${n}`]||[];if(r.length>0){t[n]={};for(let e of r)t[n][e]=K5[n]?.[e]||e}}let n={name:e.name,provider:e.provider,api_base:e.apiBase,api_key:e.apiKey,model_name:e.modelName,supported_models:JSON.stringify(e.supportedModels||[]),supported_sizes:JSON.stringify(t),default_size:e.defaultSize||`2K`,max_image_count:e.maxImageCount??0,generate_url:e.generateUrl||``,is_active:e.isActive??!0,priority:e.priority??0,multi_generation_enabled:e.multiGenerationEnabled??!1,max_generation_count:e.maxGenerationCount??1,multi_image_max_images:e.multiImageMaxImages??15,max_reference_image_count:e.maxReferenceImageCount??14,output_format:e.outputFormat??``};i.engine?(await r5({id:i.engine.id,...n}),mP.success(`已更新`)):(await r5(n),mP.success(`已添加`)),a({open:!1,engine:null}),o.resetFields(),c()}catch(e){if(e?.errorFields)return;mP.error(e?.message||`保存失败`)}},u=async e=>{try{await cVe(e),mP.success(`已删除`),c()}catch{mP.error(`删除失败`)}},d=e=>{if(a({open:!0,engine:e||null}),e){let t={};for(let n of[`1K`,`2K`,`4K`])t[`size_${n}`]=Object.keys(e.supportedSizes?.[n]||{});o.setFieldsValue({...e,...t})}else o.resetFields(),o.setFieldsValue({isActive:!0,priority:0,multiGenerationEnabled:!1,maxGenerationCount:1,multiImageMaxImages:15,maxReferenceImageCount:14,outputFormat:``,supportedModels:[`doubao-seedream-5-0-260128`],defaultSize:`2K`,maxImageCount:0,size_1K:q5,size_2K:q5,size_4K:q5})};return(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(OA,{style:{borderRadius:12,border:`1px solid #f0f0f5`},children:[(0,Q.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,marginBottom:16},children:[(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(q1,{style:{fontSize:18,color:`#10b981`}}),(0,Q.jsx)(Z.Text,{strong:!0,style:{fontSize:16},children:`图片引擎配置`}),(0,Q.jsxs)(hR,{color:`green`,children:[e.length,` 个引擎`]})]}),(0,Q.jsx)(JS,{type:`primary`,icon:(0,Q.jsx)(rA,{}),onClick:()=>d(),style:{borderRadius:8},children:`添加引擎`})]}),(0,Q.jsx)(nR,{columns:[{title:`引擎名称`,key:`name`,width:180,render:(e,t)=>(0,Q.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,Q.jsx)(`div`,{style:{width:36,height:36,borderRadius:8,background:t.isActive?`linear-gradient(135deg, #10b981, #059669)`:`linear-gradient(135deg, #94a3b8, #cbd5e1)`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#fff`,fontSize:16},children:(0,Q.jsx)(q1,{})}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(Z.Text,{strong:!0,children:t.name}),(0,Q.jsx)(`div`,{style:{color:`#94a3b8`,fontSize:12},children:t.modelName})]})]})},{title:`1K 支持比例`,key:`sizes_1k`,width:260,render:(e,t)=>{let n=Object.keys(t.supportedSizes?.[`1K`]||{});return n.length===0?(0,Q.jsx)(`span`,{style:{color:`#bfbfbf`},children:`-`}):(0,Q.jsx)(CM,{size:2,wrap:!0,children:n.map(e=>(0,Q.jsxs)(hR,{color:`green`,children:[e,` `,t.supportedSizes[`1K`][e]]},e))})}},{title:`2K 支持比例`,key:`sizes_2k`,width:260,render:(e,t)=>{let n=Object.keys(t.supportedSizes?.[`2K`]||{});return n.length===0?(0,Q.jsx)(`span`,{style:{color:`#bfbfbf`},children:`-`}):(0,Q.jsx)(CM,{size:2,wrap:!0,children:n.map(e=>(0,Q.jsxs)(hR,{color:`blue`,children:[e,` `,t.supportedSizes[`2K`][e]]},e))})}},{title:`4K 支持比例`,key:`sizes_4k`,width:260,render:(e,t)=>{let n=Object.keys(t.supportedSizes?.[`4K`]||{});return n.length===0?(0,Q.jsx)(`span`,{style:{color:`#bfbfbf`},children:`-`}):(0,Q.jsx)(CM,{size:2,wrap:!0,children:n.map(e=>(0,Q.jsxs)(hR,{color:`purple`,children:[e,` `,t.supportedSizes[`4K`][e]]},e))})}},{title:`最大图片`,dataIndex:`maxImageCount`,width:100,render:e=>(0,Q.jsxs)(hR,{color:`purple`,children:[e,` 张`]})},{title:`多份生成`,dataIndex:`multiGenerationEnabled`,width:100,render:e=>(0,Q.jsx)(hR,{color:e?`blue`:`default`,children:e?`开启`:`关闭`})},{title:`数量上限`,dataIndex:`maxGenerationCount`,width:100,render:(e,t)=>(0,Q.jsxs)(hR,{color:t.multiGenerationEnabled&&Number(e||1)>1?`magenta`:`default`,children:[`最多 `,t.multiGenerationEnabled&&e||1,` 份`]})},{title:`状态`,dataIndex:`isActive`,width:80,render:e=>(0,Q.jsx)(hR,{color:e?`green`:`default`,children:e?`启用`:`停用`})},{title:`操作`,key:`action`,width:150,fixed:`right`,render:(e,t)=>(0,Q.jsxs)(CM,{size:4,children:[(0,Q.jsx)(JS,{type:`link`,size:`small`,icon:(0,Q.jsx)(xR,{}),onClick:()=>d(t),children:`编辑`}),(0,Q.jsx)(yP,{title:`确定删除?`,onConfirm:()=>u(t.id),children:(0,Q.jsx)(JS,{type:`link`,size:`small`,danger:!0,icon:(0,Q.jsx)(vR,{}),children:`删除`})})]})}],dataSource:e,rowKey:`id`,loading:n,pagination:!1,scroll:{x:1e3}})]}),(0,Q.jsx)(gP,{title:(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(q1,{}),i.engine?`编辑引擎`:`添加引擎`]}),open:i.open,onOk:l,onCancel:()=>{a({open:!1,engine:null}),o.resetFields()},okText:`保存`,cancelText:`取消`,width:680,children:(0,Q.jsxs)(X,{form:o,layout:`vertical`,style:{marginTop:16},children:[(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:16},children:[(0,Q.jsx)(X.Item,{name:`name`,label:`引擎名称`,style:{flex:1},rules:[{required:!0}],children:(0,Q.jsx)(MN,{placeholder:`豆包文生图`,size:`large`})}),(0,Q.jsx)(X.Item,{name:`provider`,label:`提供商`,style:{flex:1},rules:[{required:!0}],children:(0,Q.jsx)(bb,{size:`large`,options:[{value:`ark`,label:`火山引擎 (Ark)`}]})})]}),(0,Q.jsx)(X.Item,{name:`apiBase`,label:`API基础地址`,rules:[{required:!0}],children:(0,Q.jsx)(MN,{placeholder:`https://ark.cn-beijing.volces.com/api/v3`,size:`large`})}),(0,Q.jsx)(X.Item,{name:`apiKey`,label:`API Key`,children:(0,Q.jsx)(MN.Password,{placeholder:`sk-****`,size:`large`})}),(0,Q.jsx)(X.Item,{name:`modelName`,label:`默认模型`,children:(0,Q.jsx)(MN,{placeholder:`doubao-seedream-5-0-260128`,size:`large`})}),(0,Q.jsx)(X.Item,{name:`supportedModels`,label:`支持模型列表`,children:(0,Q.jsx)(bb,{mode:`tags`,size:`large`,placeholder:`输入模型ID后回车添加`,tokenSeparators:[`,`,`,`],options:[{value:`doubao-seedream-5-0-260128`}]})}),(0,Q.jsxs)(`div`,{style:{background:`#f8f9fc`,borderRadius:10,padding:16,marginBottom:8},children:[(0,Q.jsx)(Z.Text,{strong:!0,style:{fontSize:14},children:`尺寸配置`}),(0,Q.jsx)(Z.Text,{style:{fontSize:12,color:`#94a3b8`,marginLeft:8},children:`勾选每个档位支持的比例,前台选择后传对应像素值给SDK`})]}),[`1K`,`2K`,`4K`].map(e=>(0,Q.jsxs)(`div`,{style:{background:`#fafbfc`,borderRadius:10,padding:`12px 16px`,marginBottom:12,border:`1px solid #f0f0f5`},children:[(0,Q.jsx)(Z.Text,{strong:!0,style:{fontSize:13,color:e===`2K`?`#3b82f6`:`#8b5cf6`},children:e}),(0,Q.jsx)(X.Item,{name:`size_${e}`,style:{marginTop:8,marginBottom:0},children:(0,Q.jsx)(GA.Group,{style:{width:`100%`},children:(0,Q.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(4, 1fr)`,gap:`6px 0`},children:q5.map(t=>(0,Q.jsxs)(GA,{value:t,style:{fontSize:12},children:[t,` `,(0,Q.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:11},children:K5[e]?.[t]})]},t))})})})]},e)),(0,Q.jsx)(X.Item,{name:`defaultSize`,label:`默认尺寸档位`,children:(0,Q.jsx)(bb,{size:`large`,options:[{value:`1K`,label:`1K`},{value:`2K`,label:`2K`},{value:`4K`,label:`4K`}]})}),(0,Q.jsx)(X.Item,{name:`maxImageCount`,label:`最大图片数量`,children:(0,Q.jsx)(MN,{type:`number`,size:`large`})}),(0,Q.jsx)(X.Item,{name:`generateUrl`,label:`生成接口地址`,children:(0,Q.jsx)(MN,{placeholder:`https://ark.cn-beijing.volces.com/api/v3/images/generations`,size:`large`})}),(0,Q.jsxs)(`div`,{style:{background:`#f8f9fc`,borderRadius:10,padding:16,marginBottom:12},children:[(0,Q.jsx)(Z.Text,{strong:!0,children:`多份生成能力`}),(0,Q.jsx)(Z.Paragraph,{style:{margin:`6px 0 0`,color:`#64748b`,fontSize:12},children:`管理后台只控制是否允许客户端选择多份及最大数量。客户端本次选择 2-5 份时,后端只调用一次火山同步组图 API;失败绝不降级成多次单图请求。`})]}),(0,Q.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(2, minmax(0, 1fr))`,gap:16},children:[(0,Q.jsx)(X.Item,{name:`multiGenerationEnabled`,label:`允许客户端多份生成`,valuePropName:`checked`,children:(0,Q.jsx)(eF,{checkedChildren:`开启`,unCheckedChildren:`关闭`})}),(0,Q.jsx)(X.Item,{name:`maxGenerationCount`,label:`客户端最大生成数量`,rules:[{required:!0}],children:(0,Q.jsx)(xj,{min:1,max:5,precision:0,size:`large`,style:{width:`100%`},disabled:!s})}),(0,Q.jsx)(X.Item,{name:`multiImageMaxImages`,label:`组图输入输出总上限`,rules:[{required:!0}],children:(0,Q.jsx)(xj,{min:1,max:15,precision:0,size:`large`,style:{width:`100%`}})}),(0,Q.jsx)(X.Item,{name:`maxReferenceImageCount`,label:`最大参考图数量`,rules:[{required:!0}],children:(0,Q.jsx)(xj,{min:0,max:14,precision:0,size:`large`,style:{width:`100%`}})}),(0,Q.jsx)(X.Item,{name:`outputFormat`,label:`供应商输出格式`,children:(0,Q.jsx)(bb,{size:`large`,options:[{value:``,label:`不传(兼容不支持 output_format 的模型)`},{value:`png`,label:`PNG`},{value:`jpeg`,label:`JPEG`}]})})]}),(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:16},children:[(0,Q.jsx)(X.Item,{name:`priority`,label:`优先级`,children:(0,Q.jsx)(bb,{size:`large`,options:[{value:0,label:`0 (默认)`},{value:1,label:`1`},{value:2,label:`2`},{value:3,label:`3`},{value:5,label:`5`},{value:10,label:`10 (最高)`}]})}),(0,Q.jsx)(X.Item,{name:`isActive`,label:`启用状态`,valuePropName:`checked`,style:{paddingTop:30},children:(0,Q.jsx)(eF,{})})]})]})})]})},wUe=[`2K`,`4K`],TUe=[`480p`,`720p`,`1080p`],EUe=()=>{let[e,t]=(0,C.useState)([]),[n,r]=(0,C.useState)([]),[i,a]=(0,C.useState)(!1),[o,s]=(0,C.useState)({open:!1,ratio:null}),[c]=X.useForm(),[l,u]=(0,C.useState)(10),[d,f]=(0,C.useState)(null),[p,m]=(0,C.useState)(!1),h=X.useWatch(`genType`,c)||`video`,g=X.useWatch(`modelConfigId`,c),_=async()=>{a(!0);try{let[e,n,i]=await Promise.all([lVe(),X8(),BVe()]),a=(i?.engine?.image||[]).map(e=>({...e,genType:`image`})),o=(i?.engine?.video||[]).map(e=>({...e,genType:`video`}));t(e),r([...o,...a]);let s=n.find(e=>e.key===`text_credits_per_1000_tokens`);s&&(u(Number(s.value)||10),f({id:s.id}))}catch{mP.error(`加载积分比例失败`)}finally{a(!1)}};(0,C.useEffect)(()=>{_()},[]);let v=(0,C.useMemo)(()=>n.filter(e=>e.genType===h).map(e=>({value:e.id,label:`${e.name}${e.modelName?`(${e.modelName})`:``}`})),[n,h]),y=(0,C.useMemo)(()=>n.find(e=>e.id===g&&e.genType===h),[n,h,g]),b=(0,C.useMemo)(()=>{if(h===`image`){let e=y?.supportedSizes?Object.keys(y.supportedSizes):[];return(e.length?e:wUe).map(e=>({value:e,label:e}))}let e=y?.supportedResolutions||[];return(e.length?e:TUe).map(e=>({value:e,label:e}))},[h,y]),x=(e,t)=>n.find(n=>n.id===e&&(!t||n.genType===t))?.name||e,S=async()=>{try{let e=await c.validateFields(),t={model_config_id:e.modelConfigId,gen_type:e.genType,resolution:e.resolution,ratio:e.ratio,base_credits:e.baseCredits,per_second_credits:e.genType===`image`?0:e.perSecondCredits||0};e.genType===`video`&&(t.input_video_ratio=e.inputVideoRatio??1,t.input_video_base_credits=e.inputVideoBaseCredits??0,t.input_video_per_second_credits=e.inputVideoPerSecondCredits??0),t.input_image_ratio=e.inputImageRatio??1,t.input_image_base_credits=e.inputImageBaseCredits??0,t.input_image_per_image_credits=e.inputImagePerImageCredits??0,o.ratio?(await i5({id:o.ratio.id,...t}),mP.success(`已更新`)):(await i5(t),mP.success(`已添加`)),s({open:!1,ratio:null}),c.resetFields(),_()}catch(e){if(e?.errorFields)return;mP.error(e?.message||`保存失败`)}},w=async e=>{try{await uVe(e),mP.success(`已删除`),_()}catch{mP.error(`删除失败`)}},T=async()=>{if(d){m(!0);try{await Z8(d.id,String(l)),mP.success(`文字积分费率已更新`)}catch(e){mP.error(e?.message||`保存失败`)}finally{m(!1)}}},E=e=>{s({open:!0,ratio:e||null}),e?c.setFieldsValue({modelConfigId:e.modelConfigId,genType:e.genType===`image`?`image`:`video`,resolution:e.resolution,ratio:e.ratio,baseCredits:e.baseCredits,perSecondCredits:e.perSecondCredits,inputVideoRatio:e.inputVideoRatio,inputVideoBaseCredits:e.inputVideoBaseCredits,inputVideoPerSecondCredits:e.inputVideoPerSecondCredits,inputImageRatio:e.inputImageRatio,inputImageBaseCredits:e.inputImageBaseCredits,inputImagePerImageCredits:e.inputImagePerImageCredits}):(c.resetFields(),c.setFieldsValue({genType:`video`,ratio:1,baseCredits:60,perSecondCredits:2,inputVideoRatio:1,inputVideoBaseCredits:0,inputVideoPerSecondCredits:.5,inputImageRatio:1,inputImageBaseCredits:0,inputImagePerImageCredits:.5}))};return(0,Q.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:16},children:[(0,Q.jsxs)(OA,{variant:`outlined`,style:{borderRadius:12,border:`1px solid #f0f0f5`},children:[(0,Q.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:16},children:[(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(eZ,{style:{fontSize:18,color:`#f59e0b`}}),(0,Q.jsx)(Z.Text,{strong:!0,style:{fontSize:16},children:`文字积分费率`})]}),(0,Q.jsx)(JS,{type:`primary`,loading:p,onClick:T,style:{borderRadius:8},children:`保存`})]}),(0,Q.jsx)(Z.Text,{type:`secondary`,style:{display:`block`,marginBottom:16,fontSize:13},children:`文字积分计算公式:ceil(总token数 x 费率 / 1000),最低1积分`}),(0,Q.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16},children:[(0,Q.jsx)(Z.Text,{children:`每1000 token消耗积分:`}),(0,Q.jsxs)(CM.Compact,{style:{width:160},children:[(0,Q.jsx)(xj,{min:0,max:1e3,step:.01,value:l,onChange:e=>u(e||0),size:`large`,style:{width:`100%`}}),(0,Q.jsx)(Z.Text,{children:`积分`})]}),(0,Q.jsxs)(Z.Text,{type:`secondary`,style:{fontSize:12},children:[`示例:1000 token = `,l,` 积分,500 token = `,(500*l/1e3).toFixed(4),` 积分`]})]})]}),(0,Q.jsxs)(OA,{variant:`outlined`,style:{borderRadius:12,border:`1px solid #f0f0f5`},children:[(0,Q.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,marginBottom:16},children:[(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(AG,{style:{fontSize:18,color:`#6366f1`}}),(0,Q.jsx)(Z.Text,{strong:!0,style:{fontSize:16},children:`积分比例配置`}),(0,Q.jsxs)(hR,{color:`purple`,children:[e.length,` 条规则`]})]}),(0,Q.jsx)(JS,{type:`primary`,icon:(0,Q.jsx)(rA,{}),onClick:()=>E(),style:{borderRadius:8},children:`添加比例`})]}),(0,Q.jsx)(Z.Text,{type:`secondary`,style:{display:`block`,marginBottom:16,fontSize:13},children:`视频积分公式:(基础积分 + 每秒积分 x 视频时长) x 模型倍率;图片积分公式:基础积分 x 模型倍率`}),(0,Q.jsx)(nR,{columns:[{title:`类型`,dataIndex:`genType`,width:80,render:e=>(0,Q.jsx)(hR,{color:e===`image`?`cyan`:`orange`,children:e===`image`?`图片`:`视频`})},{title:`引擎`,dataIndex:`modelConfigId`,width:180,render:(e,t)=>(0,Q.jsx)(hR,{color:t.genType===`image`?`cyan`:`purple`,children:x(e,t.genType)})},{title:`分辨率/尺寸`,dataIndex:`resolution`,width:110,render:e=>(0,Q.jsx)(hR,{color:{"480p":`blue`,"720p":`blue`,"1080p":`blue`,"4K":`green`,"2K":`green`}[e]||`default`,children:e})},{title:`倍率`,dataIndex:`ratio`,width:100,sorter:(e,t)=>e.ratio-t.ratio,render:e=>(0,Q.jsxs)(Z.Text,{strong:!0,style:{color:e>=2?`#ef4444`:e>=1.5?`#f59e0b`:`#10b981`},children:[`x`,e]})},{title:`基础积分`,dataIndex:`baseCredits`,width:100,render:e=>(0,Q.jsxs)(Z.Text,{children:[e,` 积分`]})},{title:`每秒积分`,dataIndex:`perSecondCredits`,width:100,render:(e,t)=>(0,Q.jsx)(Z.Text,{children:t.genType===`image`?`-`:`${e} 积分/秒`})},{title:`传入视频`,children:[{title:`倍率`,dataIndex:`inputVideoRatio`,width:90,render:(e,t)=>(0,Q.jsx)(Z.Text,{children:t.genType===`image`?`-`:(0,Q.jsxs)(`span`,{style:{color:e>=2?`#ef4444`:e>=1.5?`#f59e0b`:`#10b981`},children:[`x`,e]})})},{title:`基础积分`,dataIndex:`inputVideoBaseCredits`,width:100,render:(e,t)=>(0,Q.jsx)(Z.Text,{children:t.genType===`image`?`-`:`${e} 积分`})},{title:`每秒积分`,dataIndex:`inputVideoPerSecondCredits`,width:100,render:(e,t)=>(0,Q.jsx)(Z.Text,{children:t.genType===`image`?`-`:`${e} 积分/秒`})}]},{title:`传入图片`,children:[{title:`倍率`,dataIndex:`inputImageRatio`,width:90,render:e=>(0,Q.jsxs)(`span`,{style:{color:e>=2?`#ef4444`:e>=1.5?`#f59e0b`:`#10b981`},children:[`x`,e]})},{title:`基础积分`,dataIndex:`inputImageBaseCredits`,width:100,render:e=>(0,Q.jsxs)(Z.Text,{children:[e,` 积分`]})},{title:`每张积分`,dataIndex:`inputImagePerImageCredits`,width:100,render:e=>(0,Q.jsxs)(Z.Text,{children:[e,` 积分/张`]})}]},{title:`示例计算`,key:`example`,width:160,render:(e,t)=>{let n;return t.genType===`image`?(n=Math.round(t.baseCredits*t.ratio),t.inputImageRatio&&t.inputImagePerImageCredits&&(n+=Math.round((t.inputImageBaseCredits+t.inputImagePerImageCredits*3)*t.inputImageRatio))):(n=Math.round((t.baseCredits+t.perSecondCredits*15)*t.ratio),t.inputVideoRatio&&t.inputVideoPerSecondCredits&&(n+=Math.round((t.inputVideoBaseCredits+t.inputVideoPerSecondCredits*15)*t.inputVideoRatio)),t.inputImageRatio&&t.inputImagePerImageCredits&&(n+=Math.round((t.inputImageBaseCredits+t.inputImagePerImageCredits*3)*t.inputImageRatio))),(0,Q.jsxs)(Z.Text,{strong:!0,style:{color:`#6366f1`},children:[n,` 积分`]})}},{title:`操作`,key:`action`,width:150,fixed:`right`,render:(e,t)=>(0,Q.jsxs)(CM,{size:4,children:[(0,Q.jsx)(JS,{type:`link`,size:`small`,icon:(0,Q.jsx)(xR,{}),onClick:()=>E(t),children:`编辑`}),(0,Q.jsx)(yP,{title:`确定删除?`,onConfirm:()=>w(t.id),children:(0,Q.jsx)(JS,{type:`link`,size:`small`,danger:!0,icon:(0,Q.jsx)(vR,{}),children:`删除`})})]})}],dataSource:e,rowKey:`id`,loading:i,pagination:!1,scroll:{x:1500}})]}),(0,Q.jsx)(gP,{title:(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(AG,{}),o.ratio?`编辑比例`:`添加比例`]}),open:o.open,onOk:S,onCancel:()=>{s({open:!1,ratio:null}),c.resetFields()},okText:`保存`,cancelText:`取消`,width:520,children:(0,Q.jsxs)(X,{form:c,layout:`vertical`,style:{marginTop:16},children:[(0,Q.jsx)(X.Item,{name:`genType`,label:`生成类型`,rules:[{required:!0,message:`请选择生成类型`}],children:(0,Q.jsx)(bb,{size:`large`,options:[{value:`video`,label:`视频`},{value:`image`,label:`图片`}],onChange:()=>{c.setFieldsValue({modelConfigId:void 0,resolution:void 0})}})}),(0,Q.jsx)(X.Item,{name:`modelConfigId`,label:`引擎`,rules:[{required:!0,message:`请选择引擎`}],children:(0,Q.jsx)(bb,{size:`large`,placeholder:`请选择引擎`,options:v,showSearch:!0,optionFilterProp:`label`,onChange:()=>c.setFieldsValue({resolution:void 0})})}),(0,Q.jsx)(X.Item,{name:`resolution`,label:h===`image`?`图片尺寸`:`分辨率`,rules:[{required:!0,message:h===`image`?`请选择图片尺寸`:`请选择分辨率`}],children:(0,Q.jsx)(bb,{size:`large`,placeholder:h===`image`?`请选择图片尺寸`:`请选择分辨率`,options:b})}),(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:16},children:[(0,Q.jsx)(X.Item,{name:`ratio`,label:`倍率`,style:{flex:1},rules:[{required:!0,message:`请输入倍率`}],children:(0,Q.jsx)(xj,{min:.1,max:10,step:.1,style:{width:`100%`},size:`large`})}),(0,Q.jsx)(X.Item,{name:`baseCredits`,label:`基础积分`,style:{flex:1},rules:[{required:!0,message:`请输入基础积分`}],children:(0,Q.jsx)(xj,{min:0,max:1e3,style:{width:`100%`},size:`large`})}),h!==`image`&&(0,Q.jsx)(X.Item,{name:`perSecondCredits`,label:`每秒积分`,style:{flex:1},rules:[{required:!0,message:`请输入每秒积分`}],children:(0,Q.jsx)(xj,{min:0,max:100,style:{width:`100%`},size:`large`})})]}),h!==`image`&&(0,Q.jsxs)(`div`,{style:{marginTop:8,padding:`12px 16px`,backgroundColor:`#f5f5ff`,borderRadius:8,border:`1px solid #e0e0ff`},children:[(0,Q.jsx)(Z.Text,{strong:!0,style:{display:`block`,marginBottom:8,color:`#4f46e5`},children:`传入视频价格`}),(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:16},children:[(0,Q.jsx)(X.Item,{name:`inputVideoRatio`,label:`倍率`,style:{flex:1,marginBottom:0},rules:[{required:!0,message:`请输入传入视频倍率`}],children:(0,Q.jsx)(xj,{min:0,max:10,step:.1,style:{width:`100%`},size:`large`})}),(0,Q.jsx)(X.Item,{name:`inputVideoBaseCredits`,label:`基础积分`,style:{flex:1,marginBottom:0},rules:[{required:!0,message:`请输入传入视频基础积分`}],children:(0,Q.jsx)(xj,{min:0,max:500,style:{width:`100%`},size:`large`})}),(0,Q.jsx)(X.Item,{name:`inputVideoPerSecondCredits`,label:`每秒积分`,style:{flex:1,marginBottom:0},rules:[{required:!0,message:`请输入传入视频每秒积分`}],children:(0,Q.jsx)(xj,{min:0,max:50,style:{width:`100%`},size:`large`})})]})]}),(0,Q.jsxs)(`div`,{style:{marginTop:12,padding:`12px 16px`,backgroundColor:`#f0fff4`,borderRadius:8,border:`1px solid #c6f6d5`},children:[(0,Q.jsx)(Z.Text,{strong:!0,style:{display:`block`,marginBottom:8,color:`#059669`},children:`传入图片价格`}),(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:16},children:[(0,Q.jsx)(X.Item,{name:`inputImageRatio`,label:`倍率`,style:{flex:1,marginBottom:0},rules:[{required:!0,message:`请输入传入图片倍率`}],children:(0,Q.jsx)(xj,{min:0,max:10,step:.1,style:{width:`100%`},size:`large`})}),(0,Q.jsx)(X.Item,{name:`inputImageBaseCredits`,label:`基础积分`,style:{flex:1,marginBottom:0},rules:[{required:!0,message:`请输入传入图片基础积分`}],children:(0,Q.jsx)(xj,{min:0,max:500,style:{width:`100%`},size:`large`})}),(0,Q.jsx)(X.Item,{name:`inputImagePerImageCredits`,label:`每张积分`,style:{flex:1,marginBottom:0},rules:[{required:!0,message:`请输入传入图片每张积分`}],children:(0,Q.jsx)(xj,{min:0,max:50,style:{width:`100%`},size:`large`})})]})]})]})})]})},J5={HomeOutlined:(0,Q.jsx)(sQ,{}),PlayCircleOutlined:(0,Q.jsx)(r0,{}),WalletOutlined:(0,Q.jsx)(Q6,{}),RobotOutlined:(0,Q.jsx)(w2,{}),SettingOutlined:(0,Q.jsx)(t4,{}),BellOutlined:(0,Q.jsx)(IU,{}),UserOutlined:(0,Q.jsx)(I6,{}),AppstoreOutlined:(0,Q.jsx)(fH,{}),FileTextOutlined:(0,Q.jsx)(DM,{}),StarOutlined:(0,Q.jsx)(n3,{}),HeartOutlined:(0,Q.jsx)(XZ,{}),CameraOutlined:(0,Q.jsx)(GG,{}),DashboardOutlined:(0,Q.jsx)(mJ,{}),CalculatorOutlined:(0,Q.jsx)(AG,{}),DollarOutlined:(0,Q.jsx)(GJ,{}),GiftOutlined:(0,Q.jsx)(TZ,{}),ThunderboltOutlined:(0,Q.jsx)(V3,{}),FireOutlined:(0,Q.jsx)(RX,{}),CloudOutlined:(0,Q.jsx)(uq,{}),SmileOutlined:(0,Q.jsx)(z4,{}),TrophyOutlined:(0,Q.jsx)(i6,{}),RocketOutlined:(0,Q.jsx)(D2,{}),BulbOutlined:(0,Q.jsx)(xG,{}),CodeOutlined:(0,Q.jsx)(yq,{}),PictureOutlined:(0,Q.jsx)(q1,{}),VideoCameraOutlined:(0,Q.jsx)(J6,{}),AudioOutlined:(0,Q.jsx)(HH,{}),MailOutlined:(0,Q.jsx)(E$,{}),PhoneOutlined:(0,Q.jsx)(B1,{}),GlobalOutlined:(0,Q.jsx)(MZ,{}),ShoppingCartOutlined:(0,Q.jsx)(l4,{}),TeamOutlined:(0,Q.jsx)(R3,{}),BarChartOutlined:(0,Q.jsx)(hU,{}),PieChartOutlined:(0,Q.jsx)(X1,{}),LineChartOutlined:(0,Q.jsx)(o$,{}),SecurityScanOutlined:(0,Q.jsx)(J2,{}),ApiOutlined:(0,Q.jsx)(JV,{}),DatabaseOutlined:(0,Q.jsx)(vJ,{}),CloudServerOutlined:(0,Q.jsx)(fq,{}),MenuOutlined:(0,Q.jsx)(H$,{})},DUe=Object.keys(J5).map(e=>({value:e,label:(0,Q.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[J5[e],` `,e.replace(`Outlined`,``)]})})),OUe={page:`blue`,group:`purple`},kUe={page:`页面`,group:`分组`},AUe=()=>{let[e,t]=(0,C.useState)([]),[n,r]=(0,C.useState)(!0),[i,a]=(0,C.useState)(`frontend`),[o,s]=(0,C.useState)({open:!1,menu:null}),[c]=X.useForm(),l=async()=>{r(!0);try{t(await a5())}catch{}r(!1)};(0,C.useEffect)(()=>{l()},[]);let u=async()=>{try{let e=await c.validateFields(),t={label:e.label,path:e.path||``,icon:e.icon||``,sort_order:e.sortOrder??0,is_active:e.isActive??!0,parent_id:e.parentId||null,menu_type:e.menuType||`page`,menu_target:e.menuTarget||`frontend`,is_default:e.isDefault??!1};o.menu?.id?await o5({...t,id:o.menu.id}):await o5(t),mP.success(o.menu?.id?`菜单已更新`:`菜单已添加`),s({open:!1,menu:null}),c.resetFields(),l()}catch{}},d=async e=>{try{await bVe(e),mP.success(`菜单已删除`),l()}catch(e){mP.error(e?.message||`删除失败`)}},f=t=>{s({open:!0,menu:t||null}),t?c.setFieldsValue({label:t.label,path:t.path,icon:t.icon,sortOrder:t.sortOrder??0,isActive:t.isActive??!0,parentId:t.parentId??``,menuType:t.menuType??`page`,menuTarget:t.menuTarget??`frontend`,isDefault:t.isDefault??!1}):(c.resetFields(),c.setFieldsValue({icon:`HomeOutlined`,sortOrder:e.length,isActive:!0,menuType:`page`,menuTarget:i,isDefault:!1}))},p=e.filter(e=>{let t=e.menuTarget??`frontend`;return t===i||t===`both`}),m=[{value:``,label:`顶级菜单`},...p.filter(e=>e.menuType===`group`).map(e=>({value:e.id,label:e.label}))],h=[],g=p.filter(e=>!e.parentId),_={};p.filter(e=>e.parentId).forEach(e=>{let t=e.parentId;_[t]||(_[t]=[]),_[t].push(e)}),g.sort((e,t)=>(e.sortOrder??0)-(t.sortOrder??0)).forEach(e=>{h.push({...e,_depth:0}),(_[e.id]||[]).sort((e,t)=>(e.sortOrder??0)-(t.sortOrder??0)).forEach(e=>{h.push({...e,_depth:1})})});let v=[{title:`排序`,dataIndex:`sortOrder`,width:60},{title:`菜单名称`,key:`label`,width:180,render:(e,t)=>(0,Q.jsxs)(`span`,{style:{paddingLeft:t._depth*20,fontWeight:t._depth===0?600:400},children:[t._depth===1&&(0,Q.jsx)(`span`,{style:{color:`#cbd5e1`,marginRight:4},children:`└`}),t.label]})},{title:`路由路径`,dataIndex:`path`,width:160,render:e=>e||(0,Q.jsx)(Z.Text,{type:`secondary`,children:`-`})},{title:`图标`,dataIndex:`icon`,width:100,render:e=>e&&J5[e]?(0,Q.jsx)(`span`,{style:{fontSize:16,color:`#6366f1`},children:J5[e]}):`-`},{title:`类型`,dataIndex:`menuType`,width:80,render:e=>(0,Q.jsx)(hR,{color:OUe[e]||`default`,children:kUe[e]||e})},{title:`状态`,dataIndex:`isActive`,width:70,render:e=>(0,Q.jsx)(`span`,{style:{color:e?`#22c55e`:`#94a3b8`},children:e?`启用`:`停用`})},...i===`frontend`?[{title:`默认显示`,dataIndex:`isDefault`,width:80,render:e=>e?(0,Q.jsx)(hR,{color:`green`,children:`默认`}):(0,Q.jsx)(Z.Text,{type:`secondary`,children:`-`})}]:[],{title:`操作`,key:`action`,width:150,render:(e,t)=>(0,Q.jsxs)(CM,{size:4,children:[(0,Q.jsx)(JS,{type:`link`,size:`small`,icon:(0,Q.jsx)(xR,{}),onClick:()=>f(t),children:`编辑`}),(0,Q.jsx)(yP,{title:`确定删除该菜单?`,onConfirm:()=>d(t.id),children:(0,Q.jsx)(JS,{type:`link`,size:`small`,danger:!0,icon:(0,Q.jsx)(vR,{}),children:`删除`})})]})}];return(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(OA,{variant:`outlined`,style:{borderRadius:12,border:`1px solid #f0f0f5`},children:[(0,Q.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,marginBottom:16},children:[(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(H$,{style:{fontSize:18,color:`#6366f1`}}),(0,Q.jsx)(Z.Text,{strong:!0,style:{fontSize:16},children:`菜单配置`})]}),(0,Q.jsx)(JS,{type:`primary`,icon:(0,Q.jsx)(rA,{}),onClick:()=>f(),style:{borderRadius:8},children:`添加菜单`})]}),(0,Q.jsx)(EA,{activeKey:i,onChange:a,items:[{key:`frontend`,label:`前台菜单`},{key:`admin`,label:`后台菜单`}]}),(0,Q.jsx)(nR,{columns:v,dataSource:h,rowKey:`id`,loading:n,pagination:!1,scroll:{x:900}})]}),(0,Q.jsx)(gP,{title:(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(H$,{}),o.menu?.id?`编辑菜单`:`添加菜单`]}),open:o.open,onOk:u,onCancel:()=>{s({open:!1,menu:null}),c.resetFields()},okText:`确认`,cancelText:`取消`,width:520,children:(0,Q.jsxs)(X,{form:c,layout:`vertical`,children:[(0,Q.jsx)(X.Item,{name:`label`,label:`菜单名称`,rules:[{required:!0,message:`请输入菜单名称`}],children:(0,Q.jsx)(MN,{placeholder:`例如:我的项目`,size:`large`})}),(0,Q.jsx)(X.Item,{name:`path`,label:`路由路径`,tooltip:`分组类型可留空`,children:(0,Q.jsx)(MN,{placeholder:`例如:/projects(分组可留空)`,size:`large`})}),(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:16},children:[(0,Q.jsx)(X.Item,{name:`menuType`,label:`菜单类型`,style:{flex:1},rules:[{required:!0}],children:(0,Q.jsx)(bb,{size:`large`,options:[{value:`page`,label:`页面`},{value:`group`,label:`分组`}]})}),(0,Q.jsx)(X.Item,{name:`menuTarget`,label:`适用端`,style:{flex:1},rules:[{required:!0}],children:(0,Q.jsx)(bb,{size:`large`,options:[{value:`frontend`,label:`前台`},{value:`admin`,label:`后台`},{value:`both`,label:`两者`}]})})]}),(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:16},children:[(0,Q.jsx)(X.Item,{name:`icon`,label:`图标`,style:{flex:1},rules:[{required:!0}],children:(0,Q.jsx)(bb,{size:`large`,options:DUe})}),(0,Q.jsx)(X.Item,{name:`sortOrder`,label:`排序`,style:{flex:1},children:(0,Q.jsx)(xj,{min:0,max:100,style:{width:`100%`},size:`large`,placeholder:`默认0`})})]}),(0,Q.jsx)(X.Item,{name:`parentId`,label:`上级菜单`,children:(0,Q.jsx)(bb,{size:`large`,options:m,allowClear:!0,placeholder:`顶级菜单`})}),(0,Q.jsx)(X.Item,{name:`isActive`,label:`启用`,valuePropName:`checked`,children:(0,Q.jsx)(eF,{})}),(0,Q.jsx)(X.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.menuTarget!==t.menuTarget,children:({getFieldValue:e})=>e(`menuTarget`)===`admin`?null:(0,Q.jsx)(X.Item,{name:`isDefault`,label:`新用户默认显示`,valuePropName:`checked`,tooltip:`开启后,新注册用户默认显示此菜单`,children:(0,Q.jsx)(eF,{})})})]})})]})},jUe={normal:`blue`,gift:`green`,promo:`purple`},MUe={normal:`常规`,gift:`赠送`,promo:`促销`},NUe=()=>{let[e,t]=(0,C.useState)([]),[n,r]=(0,C.useState)(!1),[i,a]=(0,C.useState)({open:!1,item:null}),[o]=X.useForm(),s=async()=>{r(!0);try{t((await EVe()).map(e=>({id:e.id,name:e.name,credits:e.credits,price:e.price,bonusCredits:e.bonus_credits??e.bonusCredits??0,totalCredits:e.total_credits??e.totalCredits??e.credits,description:e.description,packageType:e.package_type??e.packageType??`normal`,isGift:e.is_gift??e.isGift??!1,isActive:e.is_active??e.isActive??!0,sortOrder:e.sort_order??e.sortOrder??0})))}catch{mP.error(`加载充值套餐失败`)}finally{r(!1)}};(0,C.useEffect)(()=>{s()},[]);let c=async()=>{try{let e=await o.validateFields(),t={name:e.name,credits:e.credits,price:e.price,bonus_credits:e.bonusCredits||0,description:e.description||null,package_type:e.packageType||`normal`,is_gift:e.isGift||!1,is_active:e.isActive??!0,sort_order:e.sortOrder??0};i.item?.id?(await c5({id:i.item.id,...t}),mP.success(`已更新`)):(await c5(t),mP.success(`已添加`)),a({open:!1,item:null}),o.resetFields(),s()}catch{}},l=async e=>{try{await DVe(e),mP.success(`已删除`),s()}catch(e){mP.error(e?.message||`删除失败`)}},u=e=>{a({open:!0,item:e||null}),e?o.setFieldsValue({name:e.name,credits:e.credits,price:e.price,bonusCredits:e.bonusCredits,description:e.description,packageType:e.packageType,isGift:e.isGift,isActive:e.isActive,sortOrder:e.sortOrder}):(o.resetFields(),o.setFieldsValue({isActive:!0,sortOrder:0,packageType:`normal`,bonusCredits:0,isGift:!1}))};return(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(OA,{variant:`outlined`,style:{borderRadius:12,border:`1px solid #f0f0f5`},children:[(0,Q.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,marginBottom:16},children:[(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(TZ,{style:{fontSize:18,color:`#6366f1`}}),(0,Q.jsx)(Z.Text,{strong:!0,style:{fontSize:16},children:`充值套餐管理`}),(0,Q.jsxs)(hR,{color:`purple`,children:[e.length,` 个套餐`]})]}),(0,Q.jsx)(JS,{type:`primary`,icon:(0,Q.jsx)(rA,{}),onClick:()=>u(),style:{borderRadius:8},children:`添加套餐`})]}),(0,Q.jsx)(nR,{columns:[{title:`套餐名称`,key:`name`,width:160,render:(e,t)=>(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(Z.Text,{strong:!0,children:t.name}),t.description&&(0,Q.jsx)(`div`,{style:{color:`#94a3b8`,fontSize:12},children:t.description})]})},{title:`基础积分`,dataIndex:`credits`,width:100,render:e=>(0,Q.jsx)(Z.Text,{children:e.toLocaleString()})},{title:`赠送积分`,dataIndex:`bonusCredits`,width:100,render:e=>e>0?(0,Q.jsxs)(hR,{color:`green`,children:[`+`,e.toLocaleString()]}):(0,Q.jsx)(Z.Text,{type:`secondary`,children:`-`})},{title:`总积分`,key:`total`,width:100,render:(e,t)=>(0,Q.jsx)(Z.Text,{strong:!0,style:{color:`#6366f1`},children:(t.credits+t.bonusCredits).toLocaleString()})},{title:`价格(元)`,dataIndex:`price`,width:100,render:e=>(0,Q.jsxs)(Z.Text,{strong:!0,children:[`¥`,e]})},{title:`类型`,dataIndex:`packageType`,width:80,render:e=>(0,Q.jsx)(hR,{color:jUe[e]||`default`,children:MUe[e]||e})},{title:`状态`,dataIndex:`isActive`,width:80,render:e=>(0,Q.jsx)(hR,{color:e?`green`:`default`,children:e?`启用`:`停用`})},{title:`操作`,key:`action`,width:150,fixed:`right`,render:(e,t)=>(0,Q.jsxs)(CM,{size:4,children:[(0,Q.jsx)(JS,{type:`link`,size:`small`,icon:(0,Q.jsx)(xR,{}),onClick:()=>u(t),children:`编辑`}),(0,Q.jsx)(yP,{title:`确定删除?`,onConfirm:()=>l(t.id),children:(0,Q.jsx)(JS,{type:`link`,size:`small`,danger:!0,icon:(0,Q.jsx)(vR,{}),children:`删除`})})]})}],dataSource:e,rowKey:`id`,loading:n,pagination:!1,scroll:{x:900}})]}),(0,Q.jsx)(gP,{title:(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(TZ,{}),i.item?`编辑套餐`:`添加套餐`]}),open:i.open,onOk:c,onCancel:()=>{a({open:!1,item:null}),o.resetFields()},okText:`保存`,cancelText:`取消`,width:520,children:(0,Q.jsxs)(X,{form:o,layout:`vertical`,style:{marginTop:16},children:[(0,Q.jsx)(X.Item,{name:`name`,label:`套餐名称`,rules:[{required:!0,message:`请输入套餐名称`}],children:(0,Q.jsx)(MN,{placeholder:`例如:进阶包`,size:`large`})}),(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:16},children:[(0,Q.jsx)(X.Item,{name:`credits`,label:`基础积分`,rules:[{required:!0,message:`请输入积分`}],style:{flex:1},children:(0,Q.jsx)(xj,{min:1,placeholder:`2000`,size:`large`,style:{width:`100%`}})}),(0,Q.jsx)(X.Item,{name:`price`,label:`价格(元)`,rules:[{required:!0,message:`请输入价格`}],style:{flex:1},children:(0,Q.jsx)(xj,{min:.01,step:1,placeholder:`168`,size:`large`,style:{width:`100%`}})})]}),(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:16},children:[(0,Q.jsx)(X.Item,{name:`bonusCredits`,label:`赠送积分`,initialValue:0,style:{flex:1},children:(0,Q.jsx)(xj,{min:0,placeholder:`0`,size:`large`,style:{width:`100%`}})}),(0,Q.jsx)(X.Item,{name:`packageType`,label:`套餐类型`,initialValue:`normal`,style:{flex:1},children:(0,Q.jsx)(bb,{size:`large`,options:[{value:`normal`,label:`常规`},{value:`gift`,label:`赠送`},{value:`promo`,label:`促销`}]})})]}),(0,Q.jsx)(X.Item,{name:`description`,label:`描述`,children:(0,Q.jsx)(MN,{placeholder:`套餐描述(可选)`,size:`large`})}),(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:16},children:[(0,Q.jsx)(X.Item,{name:`isActive`,label:`启用状态`,valuePropName:`checked`,initialValue:!0,style:{flex:1},children:(0,Q.jsx)(eF,{})}),(0,Q.jsx)(X.Item,{name:`isGift`,label:`是否赠送`,valuePropName:`checked`,initialValue:!1,style:{flex:1},children:(0,Q.jsx)(eF,{})}),(0,Q.jsx)(X.Item,{name:`sortOrder`,label:`排序`,initialValue:0,style:{flex:1},children:(0,Q.jsx)(xj,{size:`large`,style:{width:`100%`}})})]})]})})]})},PUe={POST:`green`,PUT:`blue`,DELETE:`red`},FUe=()=>{let[e,t]=(0,C.useState)([]),[n,r]=(0,C.useState)(0),[i,a]=(0,C.useState)(!1),[o,s]=(0,C.useState)(1),c=async e=>{a(!0);try{let n=await OVe(e||o);t(n.items||[]),r(n.total||0)}catch{mP.error(`加载操作日志失败`)}finally{a(!1)}};return(0,C.useEffect)(()=>{c()},[]),(0,Q.jsx)(`div`,{children:(0,Q.jsxs)(OA,{variant:`outlined`,style:{borderRadius:12,border:`1px solid #f0f0f5`},children:[(0,Q.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,marginBottom:16},children:[(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(iQ,{style:{fontSize:18,color:`#6366f1`}}),(0,Q.jsx)(Z.Text,{strong:!0,style:{fontSize:16},children:`操作日志`})]}),(0,Q.jsx)(JS,{icon:(0,Q.jsx)(MP,{}),onClick:()=>c(),children:`刷新`})]}),(0,Q.jsx)(nR,{columns:[{title:`操作人`,dataIndex:`username`,width:120,render:e=>(0,Q.jsx)(Z.Text,{strong:!0,children:e})},{title:`操作`,dataIndex:`action`,width:160,render:e=>(0,Q.jsx)(Z.Text,{children:e})},{title:`方法`,dataIndex:`method`,width:80,render:e=>(0,Q.jsx)(hR,{color:PUe[e]||`default`,children:e})},{title:`路径`,dataIndex:`path`,width:220,ellipsis:!0,render:e=>(0,Q.jsx)(Z.Text,{type:`secondary`,style:{fontSize:12},children:e})},{title:`时间`,dataIndex:`createdAt`,width:160,render:e=>(0,Q.jsx)(Z.Text,{type:`secondary`,style:{fontSize:12},children:C5(e)})}],dataSource:e,rowKey:`id`,loading:i,pagination:{current:o,pageSize:20,total:n,showTotal:e=>`共 ${e} 条记录`,onChange:e=>{s(e),c(e)}},scroll:{x:800}})]})})},IUe=()=>{let[e,t]=(0,C.useState)([]),[n,r]=(0,C.useState)(0),[i,a]=(0,C.useState)(!1),[o,s]=(0,C.useState)(1),[c,l]=(0,C.useState)(!1),[u,d]=(0,C.useState)(!1),[f,p]=(0,C.useState)(!1),[m,h]=(0,C.useState)(null),[g]=X.useForm(),[_]=X.useForm(),v=async e=>{a(!0);try{let n=await kVe(e||o);t(n.items||[]),r(n.total||0)}catch{mP.error(`加载应用管理列表失败`)}finally{a(!1)}},y=async()=>{try{let e=await g.validateFields();await AVe({app_id:e.app_id,secret:e.secret,open_type:e.open_type,max_count:e.max_count,auth_url:e.auth_url,company:e.company}),mP.success(`创建成功`),l(!1),g.resetFields(),v()}catch(e){mP.error(e?.message||`创建失败`)}},b=async e=>{try{h(await l5(e)),d(!0)}catch(e){mP.error(e?.message||`获取详情失败`)}},x=async e=>{try{let t=await l5(e);h(t),_.setFieldsValue({appId:t.appId,secret:t.secret,openType:t.openType,maxCount:t.maxCount,authUrl:t.authUrl,company:t.company}),p(!0)}catch(e){mP.error(e?.message||`获取详情失败`)}},S=async()=>{if(m)try{let e=await _.validateFields();await jVe(m.id,{app_id:e.app_id,secret:e.secret,open_type:e.open_type,count:e.count,auth_url:e.auth_url,company:e.company}),mP.success(`更新成功`),p(!1),_.resetFields(),v()}catch(e){mP.error(e?.message||`更新失败`)}},w=e=>{gP.confirm({title:`确认删除`,content:`确定要删除这个应用管理吗?`,okText:`删除`,okType:`danger`,cancelText:`取消`,onOk:async()=>{try{await MVe(e),mP.success(`删除成功`),v()}catch(e){mP.error(e?.message||`删除失败`)}}})};return(0,C.useEffect)(()=>{v()},[]),(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(OA,{variant:`outlined`,style:{borderRadius:12,border:`1px solid #f0f0f5`},children:[(0,Q.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,marginBottom:16},children:[(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(H$,{style:{fontSize:18,color:`#6366f1`}}),(0,Q.jsx)(Z.Text,{strong:!0,style:{fontSize:16},children:`应用管理列表`})]}),(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(JS,{icon:(0,Q.jsx)(MP,{}),onClick:()=>v(),children:`刷新`}),(0,Q.jsx)(JS,{type:`primary`,icon:(0,Q.jsx)(rA,{}),onClick:()=>l(!0),children:`创建`})]})]}),(0,Q.jsx)(nR,{columns:[{title:`ID`,dataIndex:`id`,width:120,render:e=>(0,Q.jsx)(Z.Text,{children:e})},{title:`应用ID`,dataIndex:`appId`,width:120,render:e=>(0,Q.jsx)(Z.Text,{children:e})},{title:`应用密钥`,dataIndex:`secret`,width:120,render:e=>{if(!e)return`-`;let t=e.length>12?`${e.slice(0,6)}...${e.slice(-4)}`:e;return(0,Q.jsx)(ux,{title:e,placement:`topLeft`,children:(0,Q.jsx)(Z.Text,{style:{fontSize:12},children:t})})}},{title:`开户方式`,dataIndex:`openType`,width:90,render:e=>(0,Q.jsx)(Z.Text,{children:{1:`千川`,2:`广告`,3:`本地推`,4:`星图`,5:`快手代理商`,6:`巨量星图`,7:`巨量服务单`,8:`腾讯服务单`,9:`腾讯营销K2`,10:`腾讯营销K3`}[e]||e})},{title:`归属公司`,dataIndex:`company`,width:120,render:e=>(0,Q.jsx)(Z.Text,{children:e})},{title:`授权次数`,dataIndex:`maxCount`,width:90,render:e=>(0,Q.jsx)(Z.Text,{children:e})},{title:`状态`,dataIndex:`status`,width:80,render:e=>(0,Q.jsx)(hR,{color:e===1?`green`:`red`,children:e===1?`正常`:`禁用`})},{title:`授权URL`,dataIndex:`authUrl`,width:200,render:e=>e?(0,Q.jsx)(ux,{title:e,placement:`topLeft`,children:(0,Q.jsx)(Z.Text,{style:{fontSize:12},ellipsis:!0,children:e.length>30?`${e.slice(0,27)}...`:e})}):`-`},{title:`创建人`,dataIndex:`createBy`,width:120,render:e=>(0,Q.jsx)(Z.Text,{children:e})},{title:`创建时间`,dataIndex:`createdAt`,width:160,render:e=>(0,Q.jsx)(Z.Text,{children:C5(e)})},{title:`更新时间`,dataIndex:`updatedAt`,width:160,render:e=>(0,Q.jsx)(Z.Text,{children:C5(e)})},{title:`操作`,width:120,fixed:`right`,render:(e,t)=>(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(JS,{icon:(0,Q.jsx)(CN,{}),size:`small`,onClick:()=>b(t.id),children:`详情`}),(0,Q.jsx)(JS,{icon:(0,Q.jsx)(xR,{}),size:`small`,onClick:()=>x(t.id),children:`更新`}),(0,Q.jsx)(JS,{icon:(0,Q.jsx)(vR,{}),size:`small`,danger:!0,onClick:()=>w(t.id),children:`删除`})]})}],dataSource:e,rowKey:`id`,loading:i,pagination:{current:o,pageSize:20,total:n,showTotal:e=>`共 ${e} 条记录`,onChange:e=>{s(e),v(e)}},scroll:{x:`max-content`}})]}),(0,Q.jsx)(gP,{title:`创建应用管理`,open:c,onOk:y,onCancel:()=>{l(!1),g.resetFields()},okText:`创建`,cancelText:`取消`,width:600,children:(0,Q.jsxs)(X,{form:g,layout:`vertical`,children:[(0,Q.jsx)(X.Item,{name:`app_id`,label:`应用ID`,rules:[{required:!0,message:`请输入应用ID`},{max:64,message:`应用ID不能超过64个字符`}],children:(0,Q.jsx)(MN,{placeholder:`请输入应用ID`})}),(0,Q.jsx)(X.Item,{name:`secret`,label:`应用密钥`,rules:[{required:!0,message:`请输入应用密钥`},{max:256,message:`应用密钥不能超过256个字符`}],children:(0,Q.jsx)(MN,{placeholder:`请输入应用密钥`})}),(0,Q.jsx)(X.Item,{name:`open_type`,label:`开户方式`,rules:[{required:!0,message:`请选择开户方式`}],children:(0,Q.jsxs)(bb,{placeholder:`请选择开户方式`,children:[(0,Q.jsx)(bb.Option,{value:1,children:`千川`}),(0,Q.jsx)(bb.Option,{value:2,children:`广告`}),(0,Q.jsx)(bb.Option,{value:3,children:`本地推`}),(0,Q.jsx)(bb.Option,{value:4,children:`星图`}),(0,Q.jsx)(bb.Option,{value:5,children:`快手代理商`}),(0,Q.jsx)(bb.Option,{value:6,children:`巨量星图`}),(0,Q.jsx)(bb.Option,{value:7,children:`巨量服务单`}),(0,Q.jsx)(bb.Option,{value:8,children:`腾讯服务单`}),(0,Q.jsx)(bb.Option,{value:9,children:`腾讯营销K2`}),(0,Q.jsx)(bb.Option,{value:10,children:`腾讯营销K3`})]})}),(0,Q.jsx)(X.Item,{name:`max_count`,label:`最大授权用户数`,initialValue:100,children:(0,Q.jsx)(xj,{min:1,placeholder:`应用最大可以授权多少个用户`})}),(0,Q.jsx)(X.Item,{name:`auth_url`,label:`应用授权链接`,children:(0,Q.jsx)(MN,{placeholder:`请输入应用授权链接`})}),(0,Q.jsx)(X.Item,{name:`company`,label:`应用归属公司名称`,rules:[{max:256,message:`公司名称不能超过256个字符`}],children:(0,Q.jsx)(MN,{placeholder:`请输入应用归属公司名称`})})]})}),(0,Q.jsx)(gP,{title:`应用管理详情`,open:u,onCancel:()=>{d(!1),h(null)},okText:`关闭`,cancelText:`取消`,width:600,children:m&&(0,Q.jsxs)(`div`,{style:{lineHeight:`2`},children:[(0,Q.jsxs)(`p`,{children:[(0,Q.jsx)(`strong`,{children:`ID:`}),` `,m.id]}),(0,Q.jsxs)(`p`,{children:[(0,Q.jsx)(`strong`,{children:`应用ID:`}),` `,m.appId]}),(0,Q.jsxs)(`p`,{children:[(0,Q.jsx)(`strong`,{children:`应用密钥:`}),` `,m.secret]}),(0,Q.jsxs)(`p`,{children:[(0,Q.jsx)(`strong`,{children:`开户方式:`}),` `,{1:`千川`,2:`广告`,3:`本地推`,4:`星图`,5:`快手代理商`,6:`巨量星图`,7:`巨量服务单`,8:`腾讯服务单`,9:`腾讯营销K2`,10:`腾讯营销K3`}[m.openType]||m.openType]}),(0,Q.jsxs)(`p`,{children:[(0,Q.jsx)(`strong`,{children:`归属公司:`}),` `,m.company||`-`]}),(0,Q.jsxs)(`p`,{children:[(0,Q.jsx)(`strong`,{children:`授权次数:`}),` `,m.maxCount]}),(0,Q.jsxs)(`p`,{children:[(0,Q.jsx)(`strong`,{children:`状态:`}),` `,m.status===1?`正常`:`禁用`]}),(0,Q.jsxs)(`p`,{children:[(0,Q.jsx)(`strong`,{children:`授权URL:`}),` `,m.authUrl||`-`]}),(0,Q.jsxs)(`p`,{children:[(0,Q.jsx)(`strong`,{children:`创建人:`}),` `,m.createBy]}),(0,Q.jsxs)(`p`,{children:[(0,Q.jsx)(`strong`,{children:`创建时间:`}),` `,C5(m.createdAt)]}),(0,Q.jsxs)(`p`,{children:[(0,Q.jsx)(`strong`,{children:`更新时间:`}),` `,C5(m.updatedAt)]})]})}),(0,Q.jsx)(gP,{title:`更新应用管理`,open:f,onOk:S,onCancel:()=>{p(!1),_.resetFields(),h(null)},okText:`更新`,cancelText:`取消`,width:600,children:(0,Q.jsxs)(X,{form:_,layout:`vertical`,children:[(0,Q.jsx)(X.Item,{name:`appId`,label:`应用ID`,rules:[{required:!0,message:`请输入应用ID`},{max:64,message:`应用ID不能超过64个字符`}],children:(0,Q.jsx)(MN,{placeholder:`请输入应用ID`})}),(0,Q.jsx)(X.Item,{name:`secret`,label:`应用密钥`,rules:[{required:!0,message:`请输入应用密钥`},{max:256,message:`应用密钥不能超过256个字符`}],children:(0,Q.jsx)(MN,{placeholder:`请输入应用密钥`})}),(0,Q.jsx)(X.Item,{name:`openType`,label:`开户方式`,rules:[{required:!0,message:`请选择开户方式`}],children:(0,Q.jsxs)(bb,{placeholder:`请选择开户方式`,children:[(0,Q.jsx)(bb.Option,{value:1,children:`千川`}),(0,Q.jsx)(bb.Option,{value:2,children:`广告`}),(0,Q.jsx)(bb.Option,{value:3,children:`本地推`}),(0,Q.jsx)(bb.Option,{value:4,children:`星图`}),(0,Q.jsx)(bb.Option,{value:5,children:`快手代理商`}),(0,Q.jsx)(bb.Option,{value:6,children:`巨量星图`}),(0,Q.jsx)(bb.Option,{value:7,children:`巨量服务单`}),(0,Q.jsx)(bb.Option,{value:8,children:`腾讯服务单`}),(0,Q.jsx)(bb.Option,{value:9,children:`腾讯营销K2`}),(0,Q.jsx)(bb.Option,{value:10,children:`腾讯营销K3`})]})}),(0,Q.jsx)(X.Item,{name:`maxCount`,label:`最大授权用户数`,children:(0,Q.jsx)(xj,{min:1,placeholder:`应用最大可以授权多少个用户`})}),(0,Q.jsx)(X.Item,{name:`authUrl`,label:`应用授权链接`,children:(0,Q.jsx)(MN,{placeholder:`请输入应用授权链接`})}),(0,Q.jsx)(X.Item,{name:`company`,label:`应用归属公司名称`,rules:[{max:256,message:`公司名称不能超过256个字符`}],children:(0,Q.jsx)(MN,{placeholder:`请输入应用归属公司名称`})})]})})]})},Y5=`http://ceshi.apiforeign.minzhong.cn`.replace(/\/api\/?$/i,``).replace(/\/$/,``),X5={image:`empty`,video:`empty`,videoCover:`empty`,references:{}},Z5={optimizing:{color:`processing`,text:`优化中`,icon:(0,Q.jsx)(fm,{spin:!0})},prompt_optimized:{color:`processing`,text:`待生成`,icon:(0,Q.jsx)($j,{})},generating:{color:`warning`,text:`生成中`,icon:(0,Q.jsx)(fm,{spin:!0})},completed:{color:`success`,text:`已完成`,icon:(0,Q.jsx)(AK,{})},failed:{color:`error`,text:`失败`,icon:(0,Q.jsx)(nq,{})}},Q5={image:{text:`图片`,color:`purple`,icon:(0,Q.jsx)(oX,{})},video:{text:`视频`,color:`geekblue`,icon:(0,Q.jsx)(J6,{})}},LUe=e=>/^(https?:)?\/\//i.test(e)||/^(blob|data):/i.test(e),$5=e=>!!e&&/^blob:/i.test(e.trim()),e7=e=>{if(!e)return``;let t=String(e).trim();return t?LUe(t)?t:Y5?`${Y5}${t.startsWith(`/`)?t:`/${t}`}`:t.startsWith(`/`)?t:`/${t}`:``},RUe=e=>e?e.length>12?`${e.slice(0,8)}...`:e:`-`,t7=e=>e?C5(e):`-`,zUe=e=>e==null||e===``,n7=e=>{if(!e||$5(e))return!1;try{let t=new URL(e7(e),window.location.origin),n=t.searchParams.get(`exp`)||t.searchParams.get(`expires`)||t.searchParams.get(`expire`)||t.searchParams.get(`expires_at`)||t.searchParams.get(`x-expires`);if(!n)return!1;let r=Number(n);if(!Number.isFinite(r))return!1;let i=r>1e10?r:r*1e3;return Date.now()>=i}catch{return!1}},r7=e=>e?$5(e)||n7(e)?`invalid`:`checking`:`empty`,i7=e=>{let t=e.url||e.mediaUrl||e.fileUrl;return typeof t==`string`&&t.trim()?t.trim():void 0},BUe=e=>{let t=String(e.type||e.mediaType||e.mimeType||``).toLowerCase(),n=i7(e)?.toLowerCase()||``;return t.includes(`video`)||/\.(mp4|mov|webm|m4v)(\?|$)/i.test(n)?`video`:t.includes(`image`)||/\.(png|jpe?g|webp|gif|bmp|svg)(\?|$)/i.test(n)?`image`:t||`unknown`},a7=(e,t)=>`${t}-${i7(e)||`empty`}`,o7=(e,t=`资源`)=>$5(e)?`本地临时素材已失效`:n7(e)?`${t}链接已超时,请刷新列表或重新搜索后再查看`:`${t}加载失败,请刷新列表或重新搜索后再查看`,s7=({text:e,minHeight:t=240,compact:n=!1,action:r})=>(0,Q.jsxs)(`div`,{style:{width:`100%`,minHeight:n?void 0:t,height:n?`100%`:void 0,borderRadius:n?10:12,background:`#f8f9fc`,border:`1px dashed #cbd5e1`,color:`#64748b`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexDirection:`column`,gap:n?4:10,textAlign:`center`},children:[(0,Q.jsx)(Z.Text,{style:{color:`#64748b`,fontSize:n?11:13},children:e}),r]}),c7=({label:e,value:t})=>(0,Q.jsxs)(`div`,{style:{flex:1,minWidth:120},children:[(0,Q.jsx)(Z.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:e}),(0,Q.jsx)(Z.Text,{strong:!0,style:{fontSize:14},children:zUe(t)?`-`:t})]}),VUe=()=>{let[e,t]=(0,C.useState)([]),[n,r]=(0,C.useState)(0),[i,a]=(0,C.useState)(!1),[o,s]=(0,C.useState)(1),[c]=(0,C.useState)(20),[l,u]=(0,C.useState)(``),[d,f]=(0,C.useState)(``),[p,m]=(0,C.useState)(0),[h,g]=(0,C.useState)(null),[_,v]=(0,C.useState)(X5),[y,b]=(0,C.useState)(!1),x=(0,C.useRef)(null),[S,w]=(0,C.useState)(null),[T,E]=(0,C.useState)(null),D=(0,C.useCallback)(async()=>{a(!0);try{let e=await LVe({userId:d.trim()||void 0,status:l||void 0,page:o,pageSize:c});t((e.items||[]).map(e=>({id:e.id,userId:e.userId,username:e.username,projectId:e.projectId,projectName:e.projectName,industry:e.industry,originalPrompt:e.originalPrompt,optimizedPrompt:e.optimizedPrompt,duration:e.duration,aspectRatio:e.aspectRatio,resolution:e.resolution,status:e.status,videoUrl:e.videoUrl,videoCoverUrl:e.videoCoverUrl,references:e.references,creditsCost:e.creditsCost||0,textCreditsCost:e.textCreditsCost||0,textTokensUsed:e.textTokensUsed||0,videoTokensUsed:e.videoTokensUsed||0,errorMessage:e.errorMessage,createdAt:e.createdAt,generatedAt:e.generatedAt,genType:e.genType,imageSize:e.imageSize,imageUrl:e.imageUrl,imageTokensUsed:e.imageTokensUsed||0,imageProportion:e.imageProportion,imagePx:e.imagePx}))),r(e.total||0)}catch{mP.error(`加载记录失败`)}finally{a(!1)}},[l,d,o,c]);(0,C.useEffect)(()=>{D()},[D,p]),(0,C.useEffect)(()=>{if(!h){v(X5);return}let e=(h.references||[]).reduce((e,t,n)=>{let r=i7(t);return e[a7(t,n)]=r7(r),e},{});x.current&&(x.current.pause(),x.current.currentTime=0),b(!1),v({image:r7(h.imageUrl),video:r7(h.videoUrl),videoCover:r7(h.videoCoverUrl),references:e})},[h]);let O=()=>{s(1),m(e=>e+1)},k=(0,C.useCallback)(e=>{g(e)},[]),A=()=>{x.current&&x.current.pause(),b(!1),g(null)},j=e=>{v(t=>({...t,...e}))},M=(e,t)=>{v(n=>({...n,references:{...n.references,[e]:t}}))},N=(e,t=`素材`)=>{if(!e){mP.warning(`${t}链接为空,暂无法查看`);return}if($5(e)){mP.warning(`本地临时素材已失效,暂无法查看`);return}if(n7(e)){mP.warning(`${t}链接已超时,请刷新列表或重新搜索后再查看`);return}window.open(e7(e),`_blank`,`noopener,noreferrer`)},P=()=>{if(h?.videoUrl){if(n7(h.videoUrl)){j({video:`invalid`}),mP.warning(`视频链接已超时,请刷新列表或重新搜索后再查看`);return}b(!0),window.setTimeout(()=>{x.current?.play().catch(()=>{b(!1),j({video:`invalid`}),mP.warning(`视频播放失败,请确认资源链接是否仍然有效`)})},0)}},F=async(e,t,n)=>{w(e);try{await RVe(e,t,n),mP.success(`状态已更新`),D()}catch(e){mP.error(e?.message||`更新失败`)}finally{w(null)}},I=async()=>{if(T){w(T.record.id);try{await zVe(T.record.id,T.ratio,T.resolution,T.image_size),mP.success(`已提交${T.record.genType===`video`?`视频`:`图片`}生成`),E(null),D()}catch(e){mP.error(e?.message||`生成失败`)}finally{w(null)}}},L=(0,C.useMemo)(()=>[{title:`用户`,key:`user`,width:120,render:(e,t)=>(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(Z.Text,{strong:!0,style:{fontSize:13},children:t.username||`未知用户`}),(0,Q.jsx)(`div`,{style:{fontSize:11,color:`#94a3b8`},children:RUe(t.userId)})]})},{title:`项目`,dataIndex:`projectName`,width:120,ellipsis:!0,render:e=>(0,Q.jsx)(Z.Text,{style:{fontSize:13},children:e||`-`})},{title:`行业`,dataIndex:`industry`,width:100,ellipsis:!0,render:e=>(0,Q.jsx)(hR,{color:`cyan`,children:e||`-`})},{title:`类型`,dataIndex:`genType`,width:90,ellipsis:!0,render:e=>{let t=Q5[e]||{text:e||`-`,color:`default`,icon:null};return(0,Q.jsx)(hR,{color:t.color,icon:t.icon,children:t.text})}},{title:`提示词`,key:`prompt`,ellipsis:!0,render:(e,t)=>(0,Q.jsx)(ux,{title:t.originalPrompt,placement:`topLeft`,children:(0,Q.jsx)(Z.Text,{style:{fontSize:12,color:`#475569`},ellipsis:!0,children:t.originalPrompt||`-`})})},{title:`参数`,key:`params`,width:160,render:(e,t)=>t.genType===`video`?t.duration||t.aspectRatio||t.resolution?(0,Q.jsxs)(CM,{size:4,wrap:!0,children:[t.duration?(0,Q.jsxs)(hR,{children:[t.duration,`s`]}):null,t.aspectRatio?(0,Q.jsx)(hR,{children:t.aspectRatio}):null,t.resolution?(0,Q.jsx)(hR,{children:t.resolution}):null]}):(0,Q.jsx)(hR,{color:`default`,children:`待配置`}):t.imageSize||t.imageProportion||t.imagePx?(0,Q.jsxs)(CM,{size:4,wrap:!0,children:[t.imageSize?(0,Q.jsx)(hR,{children:t.imageSize}):null,t.imageProportion?(0,Q.jsx)(hR,{children:t.imageProportion}):null,t.imagePx?(0,Q.jsx)(hR,{children:t.imagePx}):null]}):(0,Q.jsx)(hR,{color:`default`,children:`待配置`})},{title:`积分`,key:`credits`,width:120,render:(e,t)=>(0,Q.jsxs)(`div`,{style:{fontSize:12},children:[t.textCreditsCost>0?(0,Q.jsxs)(`div`,{style:{color:`#f59e0b`},children:[`文字: `,t.textCreditsCost]}):null,t.creditsCost>0?(0,Q.jsxs)(`div`,{style:{color:`#6366f1`},children:[t.genType===`video`?`视频`:`图片`,`: `,t.creditsCost]}):null,t.textCreditsCost===0&&t.creditsCost===0?(0,Q.jsx)(Z.Text,{style:{color:`#94a3b8`},children:`0`}):null]})},{title:`状态`,dataIndex:`status`,width:90,render:e=>{let t=Z5[e]||{color:`default`,text:e||`-`,icon:null};return(0,Q.jsx)(hR,{color:t.color,icon:t.icon,children:t.text})}},{title:`时间`,key:`time`,width:150,render:(e,t)=>(0,Q.jsxs)(`div`,{style:{fontSize:12,color:`#94a3b8`},children:[(0,Q.jsx)(`div`,{children:t7(t.createdAt)}),t.generatedAt?(0,Q.jsxs)(`div`,{style:{color:`#10b981`},children:[`生成: `,t7(t.generatedAt)]}):null]})},{title:`操作`,key:`action`,width:150,fixed:`right`,render:(e,t)=>(0,Q.jsxs)(CM,{size:4,wrap:!0,children:[(0,Q.jsx)(JS,{size:`small`,icon:(0,Q.jsx)(CN,{}),onClick:()=>k(t),children:`详情`}),t.status===`generating`?(0,Q.jsx)(JS,{size:`small`,danger:!0,loading:S===t.id,onClick:()=>{gP.confirm({title:`确认操作`,icon:(0,Q.jsx)(xY,{}),content:`确定将此记录标记为失败?`,onOk:()=>F(t.id,`failed`)})},children:`标记失败`}):null,t.status===`failed`?(0,Q.jsx)(JS,{size:`small`,type:`primary`,danger:!0,loading:S===t.id,onClick:()=>E({record:t,ratio:t.aspectRatio||`16:9`,resolution:t.resolution||`720p`,image_size:t.imageSize||`2K`}),children:`重试生成`}):null,t.status===`prompt_optimized`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(JS,{size:`small`,type:`primary`,loading:S===t.id,onClick:()=>E({record:t,ratio:t.aspectRatio||`16:9`,resolution:t.resolution||`720p`,image_size:t.imageSize||`2K`}),style:{background:`#6366f1`,border:`none`},children:[`生成`,t.genType===`video`?`视频`:`图片`]}),(0,Q.jsx)(JS,{size:`small`,danger:!0,loading:S===t.id,onClick:()=>{gP.confirm({title:`确认操作`,icon:(0,Q.jsx)(xY,{}),content:`确定将此记录标记为失败?`,onOk:()=>F(t.id,`failed`)})},children:`标记失败`})]}):null]})}],[k,S]),R=h?Q5[h.genType||``]||{text:h.genType||`-`,color:`default`,icon:null}:null,z=h?Z5[h.status]||{color:`default`,text:h.status||`-`,icon:null}:null,B=()=>{if(!h||h.genType!==`image`||h.status!==`completed`)return null;if(!h.imageUrl)return(0,Q.jsx)(s7,{text:`此图片任务暂无结果图片`,minHeight:260});if(_.image===`invalid`)return(0,Q.jsx)(s7,{text:o7(h.imageUrl,`图片`),minHeight:260});let e=e7(h.imageUrl);return(0,Q.jsxs)(`div`,{title:`点击新页面查看图片`,onClick:()=>N(h.imageUrl,`生成图片`),style:{position:`relative`,width:`100%`,minHeight:260,borderRadius:12,background:`#f8f9fc`,border:`1px solid #e2e8f0`,overflow:`hidden`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`},children:[(0,Q.jsx)(`img`,{src:e,alt:`生成图片`,onLoad:()=>j({image:`valid`}),onError:()=>j({image:`invalid`}),style:{display:_.image===`valid`?`block`:`none`,width:`100%`,maxHeight:560,objectFit:`contain`,background:`#fff`}},`${h.id}-${e}`),_.image===`checking`?(0,Q.jsx)(s7,{text:`图片加载检测中...`,minHeight:260}):null]})},V=()=>{if(!h||y||_.video===`invalid`)return null;let e=h.videoUrl?(0,Q.jsx)(JS,{type:`primary`,shape:`circle`,size:`large`,icon:(0,Q.jsx)(r0,{}),onClick:P,style:{boxShadow:`0 8px 20px rgba(15,23,42,0.25)`}}):null;if(!h.videoCoverUrl)return(0,Q.jsx)(`div`,{style:{position:`absolute`,inset:0,borderRadius:12,overflow:`hidden`,background:`#f8f9fc`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,Q.jsx)(s7,{text:`此视频无封面`,minHeight:340,action:e})});if(_.videoCover===`invalid`)return(0,Q.jsx)(s7,{text:o7(h.videoCoverUrl,`视频封面`),minHeight:340,action:e});let t=e7(h.videoCoverUrl);return(0,Q.jsxs)(`div`,{style:{position:`absolute`,inset:0,borderRadius:12,overflow:`hidden`,background:`#f8f9fc`,border:`1px solid #e2e8f0`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:[(0,Q.jsx)(`img`,{src:t,alt:`视频封面`,onLoad:()=>j({videoCover:`valid`}),onError:()=>j({videoCover:`invalid`}),style:{display:_.videoCover===`valid`?`block`:`none`,width:`100%`,height:`100%`,objectFit:`contain`,background:`#000`}},`${h.id}-cover-${t}`),_.videoCover===`checking`?(0,Q.jsx)(s7,{text:`视频封面加载检测中...`,minHeight:340,action:e}):null,_.videoCover===`valid`?(0,Q.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`rgba(15,23,42,0.18)`},children:e}):null]})},H=()=>{if(!h||h.genType!==`video`||h.status!==`completed`)return null;if(!h.videoUrl)return(0,Q.jsx)(s7,{text:`此视频任务暂无结果视频`,minHeight:340});if(_.video===`invalid`)return(0,Q.jsx)(s7,{text:o7(h.videoUrl,`视频`),minHeight:340});let e=e7(h.videoUrl);return(0,Q.jsxs)(`div`,{style:{position:`relative`,width:`100%`,height:340,borderRadius:12,background:`#000`,overflow:`hidden`,border:`1px solid #e2e8f0`},children:[(0,Q.jsx)(`video`,{ref:x,src:e,preload:`metadata`,controls:y,onLoadedMetadata:()=>j({video:`valid`}),onCanPlay:()=>j({video:`valid`}),onPlaying:()=>{b(!0),j({video:`valid`})},onPause:()=>b(!1),onEnded:()=>b(!1),onError:()=>{b(!1),j({video:`invalid`})},style:{width:`100%`,height:`100%`,objectFit:`contain`,background:`#000`,opacity:+!!y,pointerEvents:y?`auto`:`none`}},`${h.id}-${e}`),V()]})},U=(e,t)=>{let n=i7(e),r=BUe(e),i=a7(e,t),a=_.references[i]||r7(n),o=r===`image`,s=r===`video`,c=typeof e.name==`string`&&e.name?e.name:`参考素材 ${t+1}`;if(!n)return(0,Q.jsxs)(`div`,{style:{width:94},children:[(0,Q.jsx)(`div`,{style:{width:94,height:94},children:(0,Q.jsx)(s7,{text:`无链接`,compact:!0})}),(0,Q.jsx)(Z.Text,{ellipsis:!0,style:{display:`block`,marginTop:4,fontSize:11,color:`#94a3b8`},children:c})]},i);if(a===`invalid`)return(0,Q.jsxs)(`div`,{style:{width:94},children:[(0,Q.jsx)(`div`,{style:{width:94,height:94},children:(0,Q.jsx)(s7,{text:$5(n)?`本地临时素材已失效`:`素材不可访问`,compact:!0})}),(0,Q.jsx)(ux,{title:c,children:(0,Q.jsx)(Z.Text,{ellipsis:!0,style:{display:`block`,marginTop:4,fontSize:11,color:`#94a3b8`},children:c})})]},i);let l=e7(n);return(0,Q.jsxs)(`div`,{style:{width:94},children:[(0,Q.jsxs)(`div`,{role:`button`,tabIndex:0,title:`点击新页面查看素材`,onClick:()=>N(n,s?`视频素材`:o?`图片素材`:`素材`),onKeyDown:e=>{e.key===`Enter`&&N(n,s?`视频素材`:o?`图片素材`:`素材`)},style:{width:94,height:94,borderRadius:10,overflow:`hidden`,border:`1px solid #e2e8f0`,background:`#f8f9fc`,position:`relative`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`},children:[o?(0,Q.jsx)(`img`,{src:l,alt:c,onLoad:()=>M(i,`valid`),onError:()=>M(i,`invalid`),style:{display:a===`valid`?`block`:`none`,width:`100%`,height:`100%`,objectFit:`cover`}}):null,s?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`video`,{src:l,preload:`metadata`,onLoadedMetadata:()=>M(i,`valid`),onError:()=>M(i,`invalid`),style:{display:`none`}}),(0,Q.jsxs)(`div`,{style:{color:`#64748b`,fontSize:12,textAlign:`center`},children:[(0,Q.jsx)(r0,{style:{fontSize:18}}),(0,Q.jsx)(`div`,{children:`视频素材`}),(0,Q.jsx)(`div`,{style:{fontSize:10,color:`#94a3b8`,marginTop:2},children:`点击查看`})]})]}):null,!o&&!s?(0,Q.jsxs)(`div`,{style:{color:`#64748b`,fontSize:12,textAlign:`center`},children:[`文件素材`,(0,Q.jsx)(`div`,{style:{fontSize:10,color:`#94a3b8`,marginTop:2},children:`点击查看`})]}):null,a===`checking`&&o?(0,Q.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`#f8f9fc`},children:(0,Q.jsx)(fm,{style:{color:`#6366f1`}})}):null]}),(0,Q.jsx)(ux,{title:c,children:(0,Q.jsx)(Z.Text,{ellipsis:!0,style:{display:`block`,marginTop:4,fontSize:11,color:`#94a3b8`},children:c})})]},i)};return(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(OA,{variant:`outlined`,style:{borderRadius:12,border:`1px solid #f0f0f5`},children:[(0,Q.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,marginBottom:16,flexWrap:`wrap`,gap:12},children:[(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(J6,{style:{fontSize:18,color:`#6366f1`}}),(0,Q.jsx)(Z.Text,{strong:!0,style:{fontSize:16},children:`生成记录管理`}),(0,Q.jsxs)(hR,{color:`purple`,children:[n,` 条记录`]})]}),(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(bb,{placeholder:`状态筛选`,allowClear:!0,style:{width:120},value:l||void 0,onChange:e=>{u(e||``),s(1)},options:[{value:`optimizing`,label:`优化中`},{value:`prompt_optimized`,label:`待生成`},{value:`generating`,label:`生成中`},{value:`completed`,label:`已完成`},{value:`failed`,label:`失败`}]}),(0,Q.jsx)(MN,{placeholder:`用户ID搜索`,prefix:(0,Q.jsx)(hb,{style:{color:`#94a3b8`}}),style:{width:200},value:d,onChange:e=>f(e.target.value),onPressEnter:O,allowClear:!0}),(0,Q.jsx)(JS,{type:`primary`,onClick:O,style:{borderRadius:8},children:`搜索`})]})]}),(0,Q.jsx)(nR,{columns:L,dataSource:e,rowKey:`id`,loading:i,scroll:{x:1120},pagination:{current:o,pageSize:c,total:n,onChange:s,showSizeChanger:!1,showTotal:e=>`共 ${e} 条`}})]}),(0,Q.jsx)(gP,{title:(0,Q.jsxs)(CM,{children:[h?.genType===`video`?(0,Q.jsx)(J6,{}):(0,Q.jsx)(oX,{}),(0,Q.jsx)(`span`,{children:`生成记录详情`})]}),open:!!h,onCancel:A,footer:null,width:900,destroyOnClose:!0,children:h?(0,Q.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:16,marginTop:16},children:[(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:16,flexWrap:`wrap`},children:[(0,Q.jsxs)(`div`,{style:{flex:1,minWidth:150,padding:12,borderRadius:10,background:`#f8f9fc`},children:[(0,Q.jsx)(Z.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:`用户`}),(0,Q.jsx)(Z.Text,{strong:!0,children:h.username||`-`})]}),(0,Q.jsxs)(`div`,{style:{flex:1,minWidth:150,padding:12,borderRadius:10,background:`#f8f9fc`},children:[(0,Q.jsx)(Z.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:`项目`}),(0,Q.jsx)(Z.Text,{strong:!0,children:h.projectName||`-`})]}),(0,Q.jsxs)(`div`,{style:{flex:1,minWidth:150,padding:12,borderRadius:10,background:`#f8f9fc`},children:[(0,Q.jsx)(Z.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:`类型 / 状态`}),(0,Q.jsxs)(CM,{size:4,wrap:!0,children:[R?(0,Q.jsx)(hR,{color:R.color,icon:R.icon,children:R.text}):null,z?(0,Q.jsx)(hR,{color:z.color,icon:z.icon,children:z.text}):null]})]})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(Z.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:6},children:`原始提示词`}),(0,Q.jsx)(`div`,{style:{padding:12,borderRadius:10,background:`#f8f9fc`,border:`1px solid #f0f0f5`},children:(0,Q.jsx)(Z.Text,{style:{fontSize:13,color:`#475569`,lineHeight:1.7},children:h.originalPrompt||`-`})})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(Z.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:6},children:`优化后提示词`}),(0,Q.jsx)(`div`,{style:{padding:12,borderRadius:10,background:`rgba(99,102,241,0.02)`,border:`1px solid rgba(99,102,241,0.1)`},children:(0,Q.jsx)(Z.Text,{style:{fontSize:13,color:`#1a1a2e`,lineHeight:1.7},children:h.optimizedPrompt||`-`})})]}),(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:16,padding:12,borderRadius:10,background:`#f8f9fc`,flexWrap:`wrap`},children:[(0,Q.jsx)(c7,{label:`文字积分`,value:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Z.Text,{strong:!0,style:{color:`#f59e0b`},children:h.textCreditsCost||0}),(0,Q.jsxs)(Z.Text,{style:{fontSize:11,color:`#94a3b8`},children:[` (`,h.textTokensUsed||0,` tokens)`]})]})}),(0,Q.jsx)(c7,{label:`${h.genType===`image`?`图片`:`视频`}积分`,value:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Z.Text,{strong:!0,style:{color:`#6366f1`},children:h.creditsCost||0}),h.genType===`video`&&h.videoTokensUsed?(0,Q.jsxs)(Z.Text,{style:{fontSize:11,color:`#94a3b8`},children:[` (`,h.videoTokensUsed,` tokens)`]}):null,h.genType===`image`&&h.imageTokensUsed?(0,Q.jsxs)(Z.Text,{style:{fontSize:11,color:`#94a3b8`},children:[` (`,h.imageTokensUsed,` tokens)`]}):null]})}),(0,Q.jsx)(c7,{label:`总积分`,value:(h.textCreditsCost||0)+(h.creditsCost||0)})]}),h.genType===`video`?h.duration||h.aspectRatio||h.resolution?(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:16,padding:12,borderRadius:10,background:`#f8f9fc`,flexWrap:`wrap`},children:[(0,Q.jsx)(c7,{label:`时长`,value:h.duration?`${h.duration}秒`:`-`}),(0,Q.jsx)(c7,{label:`比例`,value:h.aspectRatio||`-`}),(0,Q.jsx)(c7,{label:`分辨率`,value:h.resolution||`-`})]}):(0,Q.jsx)(`div`,{style:{padding:12,borderRadius:10,background:`#f8f9fc`,textAlign:`center`},children:(0,Q.jsx)(hR,{color:`default`,children:`视频参数待用户配置`})}):null,h.genType===`image`?h.imageSize||h.imageProportion||h.imagePx?(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:16,padding:12,borderRadius:10,background:`#f8f9fc`,flexWrap:`wrap`},children:[(0,Q.jsx)(c7,{label:`尺寸`,value:h.imagePx||`-`}),(0,Q.jsx)(c7,{label:`比例`,value:h.imageProportion||`-`}),(0,Q.jsx)(c7,{label:`分辨率`,value:h.imageSize||`-`})]}):(0,Q.jsx)(`div`,{style:{padding:12,borderRadius:10,background:`#f8f9fc`,textAlign:`center`},children:(0,Q.jsx)(hR,{color:`default`,children:`图片参数待用户配置`})}):null,!h?.references||h.references.length===0?null:(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(Z.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:6},children:`参考内容`}),(0,Q.jsx)(`div`,{style:{display:`flex`,gap:10,flexWrap:`wrap`},children:h.references.map((e,t)=>U(e,t))})]}),h.status===`completed`?(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(Z.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:6},children:h.genType===`video`?`生成视频`:`生成图片`}),h.genType===`video`?H():B()]}):null,h.status===`failed`&&h.errorMessage?(0,Q.jsx)(`div`,{style:{padding:12,borderRadius:10,background:`rgba(239,68,68,0.04)`,border:`1px solid rgba(239,68,68,0.15)`},children:(0,Q.jsxs)(Z.Text,{style:{fontSize:12,color:`#ef4444`},children:[`错误信息: `,h.errorMessage]})}):null,(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:16,fontSize:12,color:`#94a3b8`,flexWrap:`wrap`},children:[(0,Q.jsxs)(`span`,{children:[`创建: `,t7(h.createdAt)]}),(0,Q.jsxs)(`span`,{children:[`生成: `,t7(h.generatedAt)]})]})]}):(0,Q.jsx)(Wy,{description:`暂无详情`})}),(0,Q.jsx)(gP,{title:(0,Q.jsxs)(CM,{children:[T&&(T.record.genType===`video`?(0,Q.jsx)(r0,{}):(0,Q.jsx)(oX,{})),T&&(T.record.genType===`video`?`生成视频`:`生成图片`)]}),open:!!T,onCancel:()=>E(null),onOk:I,okText:`提交生成`,cancelText:`取消`,confirmLoading:T?S===T.record.id:!1,width:420,children:T?(0,Q.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:16,marginTop:16},children:T.record.genType===`video`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{style:{padding:12,borderRadius:10,background:`#f8f9fc`},children:[(0,Q.jsx)(Z.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:`时长`}),(0,Q.jsxs)(Z.Text,{strong:!0,children:[T.record.duration||5,`s`]})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(Z.Text,{style:{fontSize:12,color:`#64748b`,display:`block`,marginBottom:6},children:`画面比例`}),(0,Q.jsx)(bb,{value:T.ratio,onChange:e=>E(t=>t?{...t,ratio:e}:null),style:{width:`100%`},options:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`].map(e=>({value:e,label:e}))})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(Z.Text,{style:{fontSize:12,color:`#64748b`,display:`block`,marginBottom:6},children:`分辨率`}),(0,Q.jsx)(bb,{value:T.resolution,onChange:e=>E(t=>t?{...t,resolution:e}:null),style:{width:`100%`},options:[`480p`,`720p`,`1080p`].map(e=>({value:e,label:e}))})]})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{style:{padding:12,borderRadius:10,background:`#f8f9fc`},children:[(0,Q.jsx)(Z.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:`尺寸`}),(0,Q.jsx)(Z.Text,{strong:!0,children:T.record.imagePx||`-`})]}),(0,Q.jsxs)(`div`,{style:{padding:12,borderRadius:10,background:`#f8f9fc`},children:[(0,Q.jsx)(Z.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:`比例`}),(0,Q.jsx)(Z.Text,{strong:!0,children:T.record.imageProportion||`-`})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(Z.Text,{style:{fontSize:12,color:`#64748b`,display:`block`,marginBottom:6},children:`分辨率`}),(0,Q.jsx)(bb,{value:T.image_size,onChange:e=>E(t=>t?{...t,image_size:e}:null),style:{width:`100%`},options:[`2K`,`4K`].map(e=>({value:e,label:e}))})]})]})}):null})]})},HUe=(e,t)=>e<=1?6:e===2||e===4?3:e===3?t<2?3:6:t<3?2:3,UUe={pending:`待处理`,queued:`已入队`,preparing:`准备中`,generating:`生成中`,creating_provider_task:`创建任务中`,waiting_remote:`等待生成`,polling:`轮询中`,result_ready:`结果就绪`,download_queued:`等待下载`,downloading:`下载中`,retry_waiting:`等待重试`,completed:`已完成`,failed:`生成失败`,download_failed:`下载失败`,deleted:`已删除`},WUe=({task:e,resolveUrl:t,onPreview:n})=>{let r=Math.max(1,Math.min(5,Number(e.generationCount||e.childItems?.length||1))),i=[...e.childItems||[]].sort((e,t)=>Number(e.generationIndex||0)-Number(t.generationIndex||0)),a=i.length?i:r>1?Array.from({length:r},(t,n)=>({...e,id:`${e.id}-${n+1}`,generationIndex:n+1,childItems:[]})):[e];return(0,Q.jsx)(`div`,{style:{width:`100%`,height:430,display:`grid`,gridTemplateColumns:`repeat(6, minmax(0,1fr))`,gridAutoRows:`minmax(0,1fr)`,gap:a.length>1?8:0},children:a.map((e,r)=>{let i=e.displayStatus||e.pipelineStage||e.status||`pending`,o=e.genType===`video`,s=t(o?e.videoUrl:e.imageUrl),c=t(e.videoCoverUrl),l=[`pending`,`queued`,`preparing`,`generating`,`creating_provider_task`,`waiting_remote`,`polling`,`result_ready`,`download_queued`,`downloading`,`retry_waiting`].includes(i);return(0,Q.jsxs)(`div`,{style:{gridColumn:`span ${HUe(a.length,r)}`,minWidth:0,minHeight:0,border:`1px solid #edf0f5`,borderRadius:10,overflow:`hidden`,position:`relative`,background:`#f8f9fc`},children:[s&&i!==`deleted`?(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>n(s,o?`video`:`image`,`生成结果 ${e.generationIndex||r+1}`),style:{width:`100%`,height:`100%`,padding:0,border:0,background:`transparent`,cursor:`pointer`,position:`relative`},children:[o?c?(0,Q.jsx)(`img`,{src:c,alt:`视频封面`,style:{width:`100%`,height:`100%`,objectFit:`contain`}}):(0,Q.jsx)(`video`,{src:s,muted:!0,preload:`metadata`,style:{width:`100%`,height:`100%`,objectFit:`contain`}}):(0,Q.jsx)(`img`,{src:s,alt:`生成图片`,style:{width:`100%`,height:`100%`,objectFit:`contain`}}),o?(0,Q.jsx)(t0,{style:{position:`absolute`,left:`50%`,top:`50%`,transform:`translate(-50%,-50%)`,color:`#fff`,fontSize:38,filter:`drop-shadow(0 3px 8px rgba(0,0,0,.35))`}}):null]}):(0,Q.jsxs)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:9,padding:12,textAlign:`center`},children:[l?(0,Q.jsx)(rP,{size:`small`}):(0,Q.jsx)(Wy,{image:Wy.PRESENTED_IMAGE_SIMPLE,description:null}),(0,Q.jsx)(hR,{color:i===`deleted`?`default`:i===`download_failed`||i===`failed`?`error`:`processing`,children:UUe[i]||i}),e.errorMessage&&!l?(0,Q.jsx)(Z.Text,{type:`danger`,style:{fontSize:11},children:e.errorMessage}):null]}),a.length>1?(0,Q.jsxs)(`span`,{style:{position:`absolute`,top:6,left:6,padding:`1px 7px`,borderRadius:10,color:`#fff`,background:`rgba(17,24,39,.58)`,fontSize:11},children:[`#`,e.generationIndex||r+1]}):null]},e.id)})})},{RangePicker:GUe}=rM,l7=`http://ceshi.apiforeign.minzhong.cn`.replace(/\/api\/?$/i,``).replace(/\/$/,``),u7=20,d7=e=>e&&(e.name||e.modelName||e.id)||null,f7={image:`empty`,video:`empty`,videoCover:`empty`,references:{}},p7={pending:{color:`default`,text:`待处理`,icon:(0,Q.jsx)($j,{})},generating:{color:`warning`,text:`生成中`,icon:(0,Q.jsx)(fm,{spin:!0})},completed:{color:`success`,text:`已完成`,icon:(0,Q.jsx)(AK,{})},failed:{color:`error`,text:`失败`,icon:(0,Q.jsx)(nq,{})},download_failed:{color:`error`,text:`下载失败`,icon:(0,Q.jsx)(nq,{})},deleted:{color:`default`,text:`已删除`,icon:(0,Q.jsx)(nq,{})}},m7={timeout:`任务超时`,queued:`已入队`,preparing:`准备中`,creating_provider_task:`创建任务中`,waiting_remote:`等待生成`,result_ready:`结果就绪`,downloading:`下载中`,done:`完成`,download_failed:`下载失败`,polling:`轮询中`,failed:`失败`},h7={image:{text:`图片`,color:`purple`,icon:(0,Q.jsx)(oX,{})},video:{text:`视频`,color:`geekblue`,icon:(0,Q.jsx)(J6,{})}},KUe=e=>/^(https?:)?\/\//i.test(e)||/^(blob|data):/i.test(e),g7=e=>!!e&&/^blob:/i.test(e.trim()),_7=e=>{if(!e)return``;let t=String(e).trim();return t?KUe(t)?t:l7?`${l7}${t.startsWith(`/`)?t:`/${t}`}`:t.startsWith(`/`)?t:`/${t}`:``},qUe=e=>e?e.length>12?`${e.slice(0,8)}...`:e:`-`,v7=e=>e?C5(e):`-`,JUe=e=>e==null||e===``,y7=e=>{if(!e||g7(e))return!1;try{let t=new URL(_7(e),window.location.origin),n=t.searchParams.get(`exp`)||t.searchParams.get(`expires`)||t.searchParams.get(`expire`)||t.searchParams.get(`expires_at`)||t.searchParams.get(`x-expires`);if(!n)return!1;let r=Number(n);if(!Number.isFinite(r))return!1;let i=r>1e10?r:r*1e3;return Date.now()>=i}catch{return!1}},b7=e=>e?g7(e)||y7(e)?`invalid`:`checking`:`empty`,x7=e=>{let t=e.url||e.mediaUrl||e.fileUrl;return typeof t==`string`&&t.trim()?t.trim():void 0},S7=e=>{let t=String(e.type||e.mediaType||e.mimeType||``).toLowerCase(),n=x7(e)?.toLowerCase()||``;return t.includes(`video`)||/\.(mp4|mov|webm|m4v)(\?|$)/i.test(n)?`video`:t.includes(`image`)||/\.(png|jpe?g|webp|gif|bmp|svg)(\?|$)/i.test(n)?`image`:t||`unknown`},C7=(e,t)=>`${t}-${x7(e)||`empty`}`,w7=({text:e,minHeight:t=240,compact:n=!1,action:r})=>(0,Q.jsxs)(`div`,{style:{width:`100%`,minHeight:n?void 0:t,height:n?`100%`:void 0,borderRadius:n?10:12,background:`#f8f9fc`,border:`1px dashed #cbd5e1`,color:`#64748b`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexDirection:`column`,gap:n?4:10,textAlign:`center`},children:[(0,Q.jsx)(Z.Text,{style:{color:`#64748b`,fontSize:n?11:13},children:e}),r]}),T7=({label:e,value:t})=>(0,Q.jsxs)(`div`,{style:{flex:1,minWidth:120},children:[(0,Q.jsx)(Z.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:e}),(0,Q.jsx)(Z.Text,{strong:!0,style:{fontSize:14},children:JUe(t)?`-`:t})]}),E7=()=>(0,XS.default)().startOf(`day`),D7=()=>(0,XS.default)().endOf(`day`),YUe=()=>{let[e,t]=(0,C.useState)([]),[n,r]=(0,C.useState)(0),[i,a]=(0,C.useState)(!1),[o,s]=(0,C.useState)(1),[c,l]=(0,C.useState)(``),[u,d]=(0,C.useState)(``),[f,p]=(0,C.useState)(``),[m,h]=(0,C.useState)(``),[g,_]=(0,C.useState)(``),[v,y]=(0,C.useState)(``),[b,x]=(0,C.useState)(``),[S,w]=(0,C.useState)(``),[T,E]=(0,C.useState)([E7(),D7()]),[D,O]=(0,C.useState)([E7(),D7()]),[k,A]=(0,C.useState)(0),[j,M]=(0,C.useState)(null),[N,P]=(0,C.useState)(f7),[F,I]=(0,C.useState)(!1),L=(0,C.useRef)(null),[R,z]=(0,C.useState)(null),B=(0,C.useCallback)(async()=>{a(!0);try{let e=await VVe({genType:u||void 0,status:c||void 0,userId:v||void 0,userName:b||void 0,engineId:S||void 0,createdStart:D?.[0]?.format?.(`YYYY-MM-DDTHH:mm:ss`),createdEnd:D?.[1]?.format?.(`YYYY-MM-DDTHH:mm:ss`),page:o,pageSize:u7});t(e.items||[]),r(e.total||0)}catch(e){mP.error(e?.message||`加载创作记录失败`)}finally{a(!1)}},[u,c,o,v,b,S,D]);(0,C.useEffect)(()=>{B()},[B,k]),(0,C.useEffect)(()=>{if(!j){P(f7);return}let e=(j.mediaReferences||[]).reduce((e,t,n)=>{let r=x7(t);return e[C7(t,n)]=b7(r),e},{});L.current&&(L.current.pause(),L.current.currentTime=0),I(!1),P({image:b7(j.imageUrl),video:b7(j.videoUrl),videoCover:b7(j.videoCoverUrl),references:e})},[j]);let V=()=>{s(1),y(m.trim()),x(g.trim()),w(f),O(T),A(e=>e+1)},H=()=>{l(``),d(``),p(``),h(``),_(``),y(``),x(``),w(``);let e=[E7(),D7()];E(e),O(e),s(1),A(e=>e+1)},U=(0,C.useCallback)(e=>{M(e)},[]),W=()=>{L.current&&L.current.pause(),I(!1),M(null)},ee=(e,t)=>{P(n=>({...n,references:{...n.references,[e]:t}}))},te=(e,t=`素材`)=>{if(!e){mP.warning(`${t}链接为空,暂无法查看`);return}if(g7(e)){mP.warning(`本地临时素材已失效,暂无法查看`);return}if(y7(e)){mP.warning(`${t}链接已超时,请刷新列表或重新搜索后再查看`);return}window.open(_7(e),`_blank`,`noopener,noreferrer`)},ne=(e,t,n)=>{if(g7(e)){mP.warning(`本地临时素材已失效,暂无法查看`);return}if(y7(e)){mP.warning(`链接已超时,请刷新列表或重新搜索后再查看`);return}z({url:_7(e),type:t,title:n})},re=()=>z(null),ie=(0,C.useMemo)(()=>[{title:`用户`,key:`user`,width:150,render:(e,t)=>(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(Z.Text,{strong:!0,style:{fontSize:13},children:t.userName||`未知用户`}),(0,Q.jsx)(`div`,{style:{fontSize:11,color:`#94a3b8`},children:qUe(t.userId)})]})},{title:`类型`,dataIndex:`genType`,width:90,render:e=>{let t=h7[e]||{text:e||`-`,color:`default`,icon:null};return(0,Q.jsx)(hR,{color:t.color,icon:t.icon,children:t.text})}},{title:`生成数量`,key:`generationCount`,width:150,render:(e,t)=>{let n=Math.max(1,Number(t.generationCount||1));if(n===1)return(0,Q.jsx)(hR,{children:`1份`});let r=t.childItems||[],i=r.filter(e=>(e.displayStatus||e.status)===`completed`).length,a=r.filter(e=>[`failed`,`download_failed`].includes(e.displayStatus||e.status)).length,o=r.filter(e=>(e.displayStatus||e.status)===`deleted`).length;return(0,Q.jsxs)(CM,{size:4,wrap:!0,children:[(0,Q.jsxs)(hR,{color:`purple`,children:[n,`份`]}),(0,Q.jsxs)(Z.Text,{style:{fontSize:11,color:`#64748b`},children:[i,`完成`,a?` / ${a}失败`:``,o?` / ${o}删除`:``]})]})}},{title:`引擎`,key:`engine`,width:160,render:(e,t)=>{let n=d7(t.engineSnapshot);return(0,Q.jsx)(ux,{title:t.engineId||`未知引擎`,placement:`topLeft`,children:(0,Q.jsx)(hR,{icon:(0,Q.jsx)(w2,{}),color:`cyan`,children:n||t.engineId||`-`})})}},{title:`附件`,key:`references`,width:100,render:(e,t)=>{let n=t.mediaReferences||[];return n.length===0?(0,Q.jsx)(Z.Text,{style:{fontSize:12,color:`#94a3b8`},children:`无`}):(0,Q.jsx)(CM,{size:2,wrap:!0,children:n.map((e,t)=>{let n=x7(e),r=S7(e),i=typeof e.name==`string`&&e.name?e.name:`附件 ${t+1}`;return n?(0,Q.jsx)(ux,{title:i,children:(0,Q.jsx)(JS,{size:`small`,type:`text`,icon:r===`video`?(0,Q.jsx)(J6,{style:{color:`#6366f1`}}):r===`audio`?(0,Q.jsx)(HH,{style:{color:`#f59e0b`}}):(0,Q.jsx)(oX,{style:{color:`#8b5cf6`}}),style:{width:28,height:28,padding:0},onClick:e=>{e.stopPropagation(),ne(n,r===`video`?`video`:`image`,i)}})},t):null})})}},{title:`结果`,key:`result`,width:90,render:(e,t)=>t.status===`completed`?t.genType===`video`&&t.videoUrl?(0,Q.jsx)(JS,{size:`small`,icon:(0,Q.jsx)(r0,{}),type:`link`,style:{padding:0},onClick:e=>{e.stopPropagation(),ne(t.videoUrl,`video`,`生成视频`)},children:`看视频`}):t.genType===`image`&&t.imageUrl?(0,Q.jsx)(JS,{size:`small`,icon:(0,Q.jsx)(oX,{}),type:`link`,style:{padding:0},onClick:e=>{e.stopPropagation(),ne(t.imageUrl,`image`,`生成图片`)},children:`看图片`}):(0,Q.jsx)(Z.Text,{style:{fontSize:12,color:`#94a3b8`},children:`无`}):(0,Q.jsx)(Z.Text,{style:{fontSize:12,color:`#94a3b8`},children:`-`})},{title:`提示词`,key:`prompt`,ellipsis:!0,render:(e,t)=>(0,Q.jsx)(ux,{title:t.originalPrompt,placement:`topLeft`,children:(0,Q.jsx)(Z.Text,{style:{fontSize:12,color:`#475569`},ellipsis:!0,children:t.originalPrompt||`-`})})},{title:`参数`,key:`params`,width:180,render:(e,t)=>t.genType===`video`?t.duration||t.aspectRatio||t.resolution?(0,Q.jsxs)(CM,{size:4,wrap:!0,children:[t.duration?(0,Q.jsxs)(hR,{children:[t.duration,`s`]}):null,t.aspectRatio?(0,Q.jsx)(hR,{children:t.aspectRatio}):null,t.resolution?(0,Q.jsx)(hR,{children:t.resolution}):null]}):(0,Q.jsx)(hR,{color:`default`,children:`无参数`}):t.imageSize||t.imageProportion||t.imagePx?(0,Q.jsxs)(CM,{size:4,wrap:!0,children:[t.imageSize?(0,Q.jsx)(hR,{children:t.imageSize}):null,t.imageProportion?(0,Q.jsx)(hR,{children:t.imageProportion}):null,t.imagePx?(0,Q.jsx)(hR,{children:t.imagePx}):null]}):(0,Q.jsx)(hR,{color:`default`,children:`无参数`})},{title:`积分`,key:`credits`,width:130,render:(e,t)=>(0,Q.jsxs)(`div`,{style:{fontSize:12},children:[(0,Q.jsxs)(`div`,{style:{color:`#6366f1`},children:[`总: `,t.creditsCost||0]}),t.textCreditsCost>0?(0,Q.jsxs)(`div`,{style:{color:`#f59e0b`},children:[`文字: `,t.textCreditsCost]}):null]})},{title:`状态`,dataIndex:`status`,width:100,render:e=>{let t=p7[e]||{color:`default`,text:e||`-`,icon:null};return(0,Q.jsx)(hR,{color:t.color,icon:t.icon,children:t.text})}},{title:`阶段`,dataIndex:`pipelineStage`,width:120,render:e=>(0,Q.jsx)(hR,{color:`blue`,children:m7[e]||e||`-`})},{title:`时间`,key:`time`,width:170,render:(e,t)=>(0,Q.jsxs)(`div`,{style:{fontSize:12,color:`#94a3b8`},children:[(0,Q.jsx)(`div`,{children:v7(t.createdAt)}),t.generatedAt?(0,Q.jsxs)(`div`,{style:{color:`#10b981`},children:[`生成: `,v7(t.generatedAt)]}):null]})},{title:`操作`,key:`action`,width:90,fixed:`right`,render:(e,t)=>(0,Q.jsx)(JS,{size:`small`,icon:(0,Q.jsx)(CN,{}),onClick:()=>U(t),children:`详情`})}],[U]),ae=j?h7[j.genType]||{text:j.genType||`-`,color:`default`,icon:null}:null,G=j?p7[j.status]||{color:`default`,text:j.status||`-`,icon:null}:null,oe=(e,t)=>{let n=x7(e),r=S7(e),i=C7(e,t),a=N.references[i]||b7(n),o=r===`image`,s=r===`video`,c=typeof e.name==`string`&&e.name?e.name:`参考素材 ${t+1}`;if(!n)return(0,Q.jsxs)(`div`,{style:{width:94},children:[(0,Q.jsx)(`div`,{style:{width:94,height:94},children:(0,Q.jsx)(w7,{text:`无链接`,compact:!0})}),(0,Q.jsx)(Z.Text,{ellipsis:!0,style:{display:`block`,marginTop:4,fontSize:11,color:`#94a3b8`},children:c})]},i);if(a===`invalid`)return(0,Q.jsxs)(`div`,{style:{width:94},children:[(0,Q.jsx)(`div`,{style:{width:94,height:94},children:(0,Q.jsx)(w7,{text:g7(n)?`本地临时素材已失效`:`素材不可访问`,compact:!0})}),(0,Q.jsx)(ux,{title:c,children:(0,Q.jsx)(Z.Text,{ellipsis:!0,style:{display:`block`,marginTop:4,fontSize:11,color:`#94a3b8`},children:c})})]},i);let l=_7(n);return(0,Q.jsxs)(`div`,{style:{width:94},children:[(0,Q.jsxs)(`div`,{role:`button`,tabIndex:0,title:`点击新页面查看素材`,onClick:()=>te(n,s?`视频素材`:o?`图片素材`:`素材`),onKeyDown:e=>{e.key===`Enter`&&te(n,s?`视频素材`:o?`图片素材`:`素材`)},style:{width:94,height:94,borderRadius:10,overflow:`hidden`,border:`1px solid #e2e8f0`,background:`#f8f9fc`,position:`relative`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`},children:[o?(0,Q.jsx)(`img`,{src:l,alt:c,onLoad:()=>ee(i,`valid`),onError:()=>ee(i,`invalid`),style:{display:a===`valid`?`block`:`none`,width:`100%`,height:`100%`,objectFit:`cover`}}):null,s?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`video`,{src:l,preload:`metadata`,onLoadedMetadata:()=>ee(i,`valid`),onError:()=>ee(i,`invalid`),style:{display:`none`}}),(0,Q.jsxs)(`div`,{style:{color:`#64748b`,fontSize:12,textAlign:`center`},children:[(0,Q.jsx)(r0,{style:{fontSize:18}}),(0,Q.jsx)(`div`,{children:`视频素材`}),(0,Q.jsx)(`div`,{style:{fontSize:10,color:`#94a3b8`,marginTop:2},children:`点击查看`})]})]}):null,!o&&!s?(0,Q.jsxs)(`div`,{style:{color:`#64748b`,fontSize:12,textAlign:`center`},children:[`文件素材`,(0,Q.jsx)(`div`,{style:{fontSize:10,color:`#94a3b8`,marginTop:2},children:`点击查看`})]}):null,a===`checking`&&o?(0,Q.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`#f8f9fc`},children:(0,Q.jsx)(fm,{style:{color:`#6366f1`}})}):null]}),(0,Q.jsx)(ux,{title:c,children:(0,Q.jsx)(Z.Text,{ellipsis:!0,style:{display:`block`,marginTop:4,fontSize:11,color:`#94a3b8`},children:c})})]},i)};return(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(OA,{variant:`outlined`,style:{borderRadius:12,border:`1px solid #f0f0f5`},children:[(0,Q.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,marginBottom:16,flexWrap:`wrap`,gap:12},children:[(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(r0,{style:{fontSize:18,color:`#6366f1`}}),(0,Q.jsx)(Z.Text,{strong:!0,style:{fontSize:16},children:`创作记录管理`}),(0,Q.jsxs)(hR,{color:`purple`,children:[n,` 条记录`]})]}),(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(bb,{allowClear:!0,placeholder:`状态筛选`,value:c||void 0,style:{width:140},onChange:e=>{l(e||``),s(1)},options:[{value:`generating`,label:`生成中`},{value:`completed`,label:`已完成`},{value:`failed`,label:`失败`}]}),(0,Q.jsx)(bb,{allowClear:!0,placeholder:`类型筛选`,value:u||void 0,style:{width:120},onChange:e=>{d(e||``),s(1)},options:[{value:`image`,label:`图片`},{value:`video`,label:`视频`}]}),(0,Q.jsx)(bb,{allowClear:!0,showSearch:!0,placeholder:`引擎筛选`,value:f||void 0,style:{width:180},onChange:e=>{p(e||``),s(1),w(e||``)},optionFilterProp:`label`,options:Array.from(new Map(e.filter(e=>e.engineId).map(e=>[e.engineId,{value:e.engineId,label:d7(e.engineSnapshot)||e.engineId}])).values())}),(0,Q.jsx)(GUe,{value:T,onChange:e=>{e&&e[0]&&e[1]?E([e[0].startOf(`day`),e[1].endOf(`day`)]):E(e)},placeholder:[`开始日期`,`结束日期`]}),(0,Q.jsx)(MN,{placeholder:`用户ID搜索`,prefix:(0,Q.jsx)(hb,{style:{color:`#94a3b8`}}),style:{width:150},value:m,onChange:e=>h(e.target.value),onPressEnter:V,allowClear:!0}),(0,Q.jsx)(MN,{placeholder:`用户名搜索`,prefix:(0,Q.jsx)(hb,{style:{color:`#94a3b8`}}),style:{width:150},value:g,onChange:e=>_(e.target.value),onPressEnter:V,allowClear:!0}),(0,Q.jsx)(JS,{type:`primary`,onClick:V,style:{borderRadius:8},children:`搜索`}),(0,Q.jsx)(JS,{onClick:H,style:{borderRadius:8},children:`重置`})]})]}),(0,Q.jsx)(nR,{rowKey:`id`,loading:i,columns:ie,dataSource:e,scroll:{x:1650},pagination:{current:o,pageSize:u7,total:n,showSizeChanger:!1,showTotal:e=>`共 ${e} 条`,onChange:e=>s(e)}})]}),(0,Q.jsx)(gP,{title:(0,Q.jsxs)(CM,{children:[j?.genType===`video`?(0,Q.jsx)(J6,{}):(0,Q.jsx)(oX,{}),(0,Q.jsx)(`span`,{children:`创作记录详情`})]}),open:!!j,onCancel:W,footer:null,width:900,destroyOnClose:!0,children:j?(0,Q.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:16,marginTop:12},children:[(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:12,flexWrap:`wrap`},children:[ae?(0,Q.jsx)(hR,{color:ae.color,icon:ae.icon,children:ae.text}):null,G?(0,Q.jsx)(hR,{color:G.color,icon:G.icon,children:G.text}):null,j.pipelineStage?(0,Q.jsx)(hR,{color:`blue`,children:m7[j.pipelineStage]||j.pipelineStage}):null]}),(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:16,padding:12,borderRadius:10,background:`#f8f9fc`,flexWrap:`wrap`},children:[(0,Q.jsx)(T7,{label:`用户名称`,value:j.userName||`未知用户`}),(0,Q.jsx)(T7,{label:`用户ID`,value:j.userId||`-`}),(0,Q.jsx)(T7,{label:`任务ID`,value:j.id}),(0,Q.jsx)(T7,{label:`生成数量`,value:`${j.generationCount||1} 份`})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(Z.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:6},children:`原始提示词`}),(0,Q.jsx)(`div`,{style:{padding:12,borderRadius:10,background:`#f8f9fc`,lineHeight:1.6},children:j.originalPrompt||`-`})]}),j.genType===`video`?(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:16,padding:12,borderRadius:10,background:`#f8f9fc`,flexWrap:`wrap`},children:[(0,Q.jsx)(T7,{label:`时长`,value:j.duration?`${j.duration}秒`:`-`}),(0,Q.jsx)(T7,{label:`画面比例`,value:j.aspectRatio||`-`}),(0,Q.jsx)(T7,{label:`分辨率`,value:j.resolution||`-`})]}):(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:16,padding:12,borderRadius:10,background:`#f8f9fc`,flexWrap:`wrap`},children:[(0,Q.jsx)(T7,{label:`图片档位`,value:j.imageSize||`-`}),(0,Q.jsx)(T7,{label:`图片比例`,value:j.imageProportion||`-`}),(0,Q.jsx)(T7,{label:`像素尺寸`,value:j.imagePx||`-`})]}),j.engineSnapshot?(0,Q.jsxs)(`div`,{style:{padding:12,borderRadius:10,background:`#f8f9fc`},children:[(0,Q.jsx)(Z.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:8},children:`引擎快照`}),(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:16,flexWrap:`wrap`},children:[(0,Q.jsx)(T7,{label:`引擎名称`,value:j.engineSnapshot.name||`-`}),(0,Q.jsx)(T7,{label:`服务商`,value:j.engineSnapshot.provider||`-`}),(0,Q.jsx)(T7,{label:`模型`,value:j.engineSnapshot.modelName||`-`}),(0,Q.jsx)(T7,{label:`引擎ID`,value:j.engineSnapshot.id||j.engineId||`-`})]})]}):null,(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:16,padding:12,borderRadius:10,background:`#f8f9fc`,flexWrap:`wrap`},children:[(0,Q.jsx)(T7,{label:`总积分`,value:(0,Q.jsx)(Z.Text,{strong:!0,style:{color:`#6366f1`},children:j.creditsCost||0})}),(0,Q.jsx)(T7,{label:`文字积分`,value:`${j.textCreditsCost||0} (${j.textTokensUsed||0} tokens)`}),(0,Q.jsx)(T7,{label:`图片 tokens`,value:j.imageTokensUsed??0}),(0,Q.jsx)(T7,{label:`视频 tokens`,value:j.videoTokensUsed??0})]}),(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:16,padding:12,borderRadius:10,background:`#f8f9fc`,flexWrap:`wrap`},children:[(0,Q.jsx)(T7,{label:`第三方任务ID`,value:j.providerTaskId||j.seedanceTaskId||`-`}),(0,Q.jsx)(T7,{label:`轮询次数`,value:j.pollCount??0}),(0,Q.jsx)(T7,{label:`重试次数`,value:j.retryCount??0})]}),!j?.mediaReferences||j.mediaReferences.length===0?null:(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(Z.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:6},children:`参考内容`}),(0,Q.jsx)(`div`,{style:{display:`flex`,gap:10,flexWrap:`wrap`},children:j.mediaReferences.map((e,t)=>oe(e,t))})]}),j.mediaReferences&&j.mediaReferences.length>0?(0,Q.jsxs)(`div`,{style:{padding:12,borderRadius:10,background:`#f8f9fc`},children:[(0,Q.jsx)(Z.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:8},children:`附件快速查看(点击新窗口打开)`}),(0,Q.jsx)(CM,{size:8,wrap:!0,children:j.mediaReferences.map((e,t)=>{let n=x7(e),r=S7(e),i=typeof e.name==`string`&&e.name?e.name:`附件 ${t+1}`;return n?(0,Q.jsx)(JS,{size:`small`,icon:r===`video`?(0,Q.jsx)(r0,{}):(0,Q.jsx)(u$,{}),onClick:()=>ne(n,r===`video`?`video`:`image`,i),children:i},t):null})})]}):null,(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(Z.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:6},children:[`生成资源(共 `,j.generationCount||1,` 份)`]}),(0,Q.jsx)(WUe,{task:j,resolveUrl:_7,onPreview:ne})]}),j.status===`failed`&&j.errorMessage?(0,Q.jsx)(`div`,{style:{padding:12,borderRadius:10,background:`rgba(239,68,68,0.04)`,border:`1px solid rgba(239,68,68,0.15)`},children:(0,Q.jsxs)(Z.Text,{style:{fontSize:12,color:`#ef4444`},children:[`错误信息: `,j.errorMessage]})}):null,(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:16,fontSize:12,color:`#94a3b8`,flexWrap:`wrap`},children:[(0,Q.jsxs)(`span`,{children:[`创建: `,v7(j.createdAt)]}),(0,Q.jsxs)(`span`,{children:[`生成: `,v7(j.generatedAt)]})]})]}):(0,Q.jsx)(Wy,{description:`暂无详情`})}),(0,Q.jsx)(gP,{title:R?.title||`资源预览`,open:!!R,onCancel:re,footer:null,width:R?.type===`video`?800:600,destroyOnHidden:!0,children:R?R.type===`video`?(0,Q.jsx)(`video`,{src:R.url,controls:!0,autoPlay:!0,style:{width:`100%`,maxHeight:600,background:`#000`,borderRadius:8}},R.url):(0,Q.jsx)(`img`,{src:R.url,alt:R.title,style:{width:`100%`,maxHeight:600,objectFit:`contain`,borderRadius:8}}):null})]})},O7=20,XUe=[{value:`pending`,label:`已创建`},{value:`waiting_user`,label:`等待用户操作`},{value:`processing`,label:`处理中`},{value:`completed`,label:`已完成`},{value:`failed`,label:`失败`},{value:`cancelled`,label:`已取消`}],ZUe={pending:{color:`default`,text:`已创建`},waiting_user:{color:`processing`,text:`等待用户操作`},processing:{color:`warning`,text:`处理中`},completed:{color:`success`,text:`已完成`},failed:{color:`error`,text:`失败`},cancelled:{color:`default`,text:`已取消`}},QUe={material_input:`素材输入`,image_prompt_optimize:`图片 AI 提词`,image_generate:`图片生成`,video_prompt_optimize:`视频 AI 提词`,video_generate:`视频生成`},k7=e=>e?C5(e):`-`,A7=e=>e?e.length>16?`${e.slice(0,10)}...`:e:`-`,$Ue=({status:e})=>{if(!e)return(0,Q.jsx)(hR,{children:`-`});let t=ZUe[e]||{color:`blue`,text:e};return(0,Q.jsx)(hR,{color:t.color,children:t.text})},eWe=()=>{let e=Ze(),[t,n]=(0,C.useState)([]),[r,i]=(0,C.useState)(0),[a,o]=(0,C.useState)(!1),[s,c]=(0,C.useState)(1),[l,u]=(0,C.useState)(``),[d,f]=(0,C.useState)(``),[p,m]=(0,C.useState)(``),[h,g]=(0,C.useState)(``),[_,v]=(0,C.useState)(null),[y,b]=(0,C.useState)(``),[x,S]=(0,C.useState)(``),[w,T]=(0,C.useState)(``),[E,D]=(0,C.useState)(null),[O,k]=(0,C.useState)(0),A=(0,C.useCallback)(async()=>{o(!0);try{let e=await HVe({status:l||void 0,keyword:y||void 0,userId:x||void 0,userName:w||void 0,createdStart:E?.[0]?.toISOString?.(),createdEnd:E?.[1]?.toISOString?.(),page:s,pageSize:O7});n(e.items||[]),i(e.total||0)}catch(e){mP.error(e?.message||`加载爆款开头复刻任务失败`)}finally{o(!1)}},[s,E,y,x,w,l]);(0,C.useEffect)(()=>{A()},[A,O]);let j=()=>{b(d.trim()),S(p.trim()),T(h.trim()),D(_),c(1)};return(0,Q.jsxs)(OA,{variant:`outlined`,style:{borderRadius:12,border:`1px solid #f0f0f5`},children:[(0,Q.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,marginBottom:16,flexWrap:`wrap`,gap:12},children:[(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(r0,{style:{fontSize:18,color:`#6366f1`}}),(0,Q.jsx)(Z.Text,{strong:!0,style:{fontSize:16},children:`爆款开头复刻`}),(0,Q.jsxs)(hR,{color:`purple`,children:[r,` 条记录`]})]}),(0,Q.jsx)(JS,{icon:(0,Q.jsx)(MP,{}),onClick:()=>k(e=>e+1),children:`刷新`})]}),(0,Q.jsxs)(CM,{wrap:!0,children:[(0,Q.jsx)(bb,{allowClear:!0,placeholder:`任务状态`,style:{width:160},value:l||void 0,onChange:e=>{u(e||``),c(1)},options:XUe}),(0,Q.jsx)(MN,{allowClear:!0,prefix:(0,Q.jsx)(hb,{}),placeholder:`关键词:标题/项目名/核心点`,style:{width:260},value:d,onChange:e=>f(e.target.value),onPressEnter:j}),(0,Q.jsx)(MN,{allowClear:!0,placeholder:`用户ID(管理员)`,style:{width:190},value:p,onChange:e=>m(e.target.value),onPressEnter:j}),(0,Q.jsx)(MN,{allowClear:!0,placeholder:`用户名(管理员)`,style:{width:230},value:h,onChange:e=>g(e.target.value),onPressEnter:j}),(0,Q.jsx)(rM.RangePicker,{showTime:!0,value:_,onChange:v,placeholder:[`创建开始`,`创建结束`]}),(0,Q.jsx)(JS,{type:`primary`,icon:(0,Q.jsx)(hb,{}),onClick:j,children:`搜索`}),(0,Q.jsx)(JS,{onClick:()=>{u(``),f(``),m(``),g(``),v(null),b(``),S(``),T(``),D(null),c(1),k(e=>e+1)},children:`重置`})]}),(0,Q.jsx)(nR,{rowKey:`id`,loading:a,dataSource:t,pagination:{current:s,pageSize:O7,total:r,showSizeChanger:!1,showTotal:e=>`共 ${e} 条`,onChange:c},scroll:{x:1380},columns:[{title:`项目ID`,dataIndex:`id`,width:150,render:e=>(0,Q.jsx)(ux,{title:e,children:A7(e)})},{title:`用户`,width:180,render:(e,t)=>(0,Q.jsxs)(CM,{direction:`vertical`,size:0,children:[(0,Q.jsx)(Z.Text,{children:t.userName||`-`}),(0,Q.jsx)(Z.Text,{type:`secondary`,style:{fontSize:12},children:A7(t.userId)})]})},{title:`项目信息`,width:260,render:(e,t)=>(0,Q.jsxs)(CM,{direction:`vertical`,size:2,children:[(0,Q.jsx)(Z.Text,{strong:!0,children:t.title||t.targetProjectName||`-`}),(0,Q.jsxs)(Z.Text,{type:`secondary`,ellipsis:!0,style:{maxWidth:240},children:[`素材:`,t.sourceProjectName||`-`]}),(0,Q.jsxs)(Z.Text,{type:`secondary`,ellipsis:!0,style:{maxWidth:240},children:[`核心:`,t.coreContentPoint||`-`]})]})},{title:`状态`,dataIndex:`status`,width:130,render:e=>(0,Q.jsx)($Ue,{status:e})},{title:`当前步骤`,dataIndex:`currentStepCode`,width:140,render:e=>QUe[e]||e||`-`},{title:`图片结果`,dataIndex:`finalImageUrl`,width:90,render:e=>e?(0,Q.jsx)(hR,{color:`success`,children:`有`}):(0,Q.jsx)(hR,{children:`无`})},{title:`视频结果`,dataIndex:`finalVideoUrl`,width:90,render:e=>e?(0,Q.jsx)(hR,{color:`success`,children:`有`}):(0,Q.jsx)(hR,{children:`无`})},{title:`错误信息`,dataIndex:`errorMessage`,width:220,ellipsis:!0,render:e=>e||`-`},{title:`创建时间`,dataIndex:`createdAt`,width:170,render:k7},{title:`更新时间`,dataIndex:`updatedAt`,width:170,render:k7},{title:`操作`,fixed:`right`,width:110,render:(t,n)=>(0,Q.jsx)(JS,{type:`link`,icon:(0,Q.jsx)(CN,{}),onClick:()=>e(`/hot-opening-replications/${n.id}`),children:`详情`})}]})]})},j7=({value:e,maxHeight:t=420})=>e==null||e===``?(0,Q.jsx)(Wy,{image:Wy.PRESENTED_IMAGE_SIMPLE,description:`暂无 JSON 数据`}):(0,Q.jsx)(`pre`,{style:{margin:0,padding:12,maxHeight:t,overflow:`auto`,background:`#0f172a`,color:`#e2e8f0`,borderRadius:8,fontSize:12,lineHeight:1.6},children:JSON.stringify(e,null,2)}),tWe=({input:e,output:t,raw:n,inputLabel:r=`查看 input_json`,outputLabel:i=`查看 output_json`,rawLabel:a=`查看原始 JSON`})=>{let o=[];return e!==void 0&&o.push({key:`input`,label:r,children:(0,Q.jsx)(j7,{value:e})}),t!==void 0&&o.push({key:`output`,label:i,children:(0,Q.jsx)(j7,{value:t})}),n!==void 0&&o.push({key:`raw`,label:a,children:(0,Q.jsx)(j7,{value:n})}),o.length?(0,Q.jsx)(Hh,{size:`small`,style:{marginTop:12},items:o}):null};async function nWe(e){try{if(navigator.clipboard&&typeof navigator.clipboard.writeText==`function`)return await navigator.clipboard.writeText(e),!0;let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.left=`-9999px`,t.style.top=`0`,document.body.appendChild(t),t.focus(),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch{return!1}}var rWe=`http://ceshi.apiforeign.minzhong.cn`.replace(/\/api\/?$/i,``).replace(/\/$/,``);function iWe(e){if(!e)return``;let t=String(e).trim();return t?/^(https?:)?\/\//i.test(t)||/^(blob|data):/i.test(t)?t:`${rWe}${t.startsWith(`/`)?t:`/${t}`}`:``}var M7=({url:e,type:t,height:n=260,emptyDescription:r=`暂无资源`,errorDescription:i=`资源加载失败,可能文件不存在、签名过期或访问权限受限。`})=>{let a=(0,C.useMemo)(()=>iWe(e),[e]),[o,s]=(0,C.useState)(!1);(0,C.useEffect)(()=>{s(!1)},[a]);let c=a?(0,Q.jsxs)(CM,{wrap:!0,style:{marginTop:8},children:[(0,Q.jsx)(JS,{size:`small`,icon:(0,Q.jsx)(WR,{}),onClick:async()=>{if(!a)return;let e=await nWe(a);mP.success(e?`资源地址已复制`:`复制失败,请手动复制`)},children:`复制地址`}),(0,Q.jsx)(JS,{size:`small`,icon:(0,Q.jsx)(u$,{}),onClick:()=>window.open(a,`_blank`,`noopener,noreferrer`),children:`新窗口打开`}),(0,Q.jsx)(Z.Text,{copyable:{text:a},type:`secondary`,style:{maxWidth:460},ellipsis:!0,children:a})]}):null;return a?(0,Q.jsxs)(`div`,{children:[o?(0,Q.jsx)(cf,{type:`warning`,showIcon:!0,message:`资源预览失败`,description:i,style:{marginBottom:8}}):null,t===`image`?(0,Q.jsx)(vN,{src:a,onError:()=>s(!0),style:{width:`100%`,maxHeight:n,objectFit:`contain`,borderRadius:12,background:`#f8fafc`,border:`1px solid #f1f5f9`},fallback:``,preview:!o}):(0,Q.jsx)(`video`,{src:a,controls:!0,preload:`metadata`,onError:()=>s(!0),style:{width:`100%`,maxHeight:n,borderRadius:12,background:`#0f172a`,border:`1px solid #f1f5f9`}}),c]}):(0,Q.jsx)(`div`,{children:(0,Q.jsx)(`div`,{style:{height:n,borderRadius:12,border:`1px dashed #cbd5e1`,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`#f8fafc`},children:(0,Q.jsx)(Wy,{image:Wy.PRESENTED_IMAGE_SIMPLE,description:r})})})},N7={pending:{text:`待处理`,color:`default`},waiting_user:{text:`等待用户操作`,color:`processing`},processing:{text:`处理中`,color:`warning`},completed:{text:`已完成`,color:`success`},failed:{text:`失败`,color:`error`},cancelled:{text:`已取消`,color:`default`},canceled:{text:`已取消`,color:`default`},timeout:{text:`已超时`,color:`error`},queued:{text:`已入队`,color:`processing`},preparing:{text:`准备中`,color:`processing`},creating_provider_task:{text:`创建远端任务`,color:`processing`},waiting_remote:{text:`等待远端结果`,color:`processing`},polling:{text:`轮询远端结果`,color:`processing`},result_ready:{text:`结果已就绪`,color:`success`},downloading:{text:`下载中`,color:`processing`},done:{text:`已完成`,color:`success`},download_failed:{text:`下载失败`,color:`error`},retry_waiting:{text:`等待重试`,color:`orange`},pending_analysis:{text:`等待分析`,color:`default`},analyzing:{text:`分析中`,color:`processing`},analysis_completed:{text:`分析完成`,color:`success`},analysis_failed:{text:`分析失败`,color:`error`},splitting:{text:`拆镜中`,color:`warning`},split_completed:{text:`拆镜完成`,color:`success`},partial_failed:{text:`部分失败`,color:`orange`},none:{text:`未拆镜`,color:`default`},not_required:{text:`无需处理`,color:`default`},not_started:{text:`未开始`,color:`default`},project_created:{text:`已创建项目`,color:`processing`},true:{text:`是`,color:`success`},false:{text:`否`,color:`default`}},P7={material_input:`素材输入`,image_prompt_optimize:`图片 AI 提词`,image_generate:`图片生成`,video_prompt_optimize:`视频 AI 提词`,video_generate:`视频生成`},F7={hot_opening_replicate:`爆款开头复刻`,shot_replicate:`拆镜复刻`},I7={ai_suggestion:{text:`AI 建议`,color:`purple`},custom:{text:`自定义`,color:`cyan`},original:{text:`原视频`,color:`blue`}};function L7(e){return e?F7[e]||e:`-`}function R7(e){return e?P7[e]||e:`-`}function aWe(e){return e?N7[e]?.text||P7[e]||F7[e]||I7[e]?.text||e:`-`}function oWe(e){return e?N7[e]?.color||I7[e]?.color||`blue`:`default`}var z7=({status:e,tooltipRaw:t=!0})=>{if(e==null||e===``)return(0,Q.jsx)(hR,{children:`-`});let n=String(e),r=aWe(n),i=(0,Q.jsx)(hR,{color:oWe(n),children:r});return!t||r===n?i:(0,Q.jsx)(ux,{title:n,children:i})};function B7(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function V7(e,...t){for(let n of t){let t=e[n];if(t!=null&&String(t).trim()!==``)return String(t)}return``}function H7(e,t,...n){for(let t of n){let n=e[t];if(n===!0||n===!1)return n;if(n===`true`)return!0;if(n===`false`)return!1}return t}function sWe(e,...t){for(let n of t){let t=e[n];if(typeof t==`number`&&Number.isFinite(t)&&t>0)return t;if(typeof t==`string`&&t.trim()){let e=Number(t);if(Number.isFinite(e)&&e>0)return e}}}function U7(e){if(!B7(e))return null;let t=V7(e,`key`);return t?{key:t,label:V7(e,`label`)||t,type:V7(e,`type`)||void 0,enabled:H7(e,!0,`enabled`),editable:H7(e,!0,`editable`),maxLength:sWe(e,`maxLength`,`max_length`)}:null}function W7(e){if(!B7(e))return null;let t=e.data;return B7(t)?t:Array.isArray(e.sections)?e:null}function cWe(e){return!!W7(e)}function lWe(e){let t=W7(e);return(Array.isArray(t?.sections)?t.sections:[]).map(e=>{let t=U7(e);if(!t||!B7(e))return null;let n=Array.isArray(e.children)?e.children.map(U7).filter(Boolean):[],r=Array.isArray(e.itemFields)?e.itemFields.map(U7).filter(Boolean):Array.isArray(e.item_fields)?e.item_fields.map(U7).filter(Boolean):[];return{...t,contentKey:V7(e,`contentKey`,`content_key`)||void 0,children:n,itemFields:r}}).filter(e=>!!e&&e.enabled)}function uWe(e){return B7(e)?Object.entries(e).filter(([e])=>![`schemaVersion`,`schemaUsage`,`schema_version`,`schema_usage`].includes(e)).map(([e,t])=>Array.isArray(t)&&t.every(B7)?{key:e,label:e,type:`flow`,enabled:!0,editable:!1,itemFields:Array.from(new Set(t.flatMap(e=>Object.keys(e)))).filter(e=>e!==`时间段`).map(e=>({key:e,label:e,enabled:!0,editable:!1})),children:[]}:B7(t)?{key:e,label:e,type:`object`,enabled:!0,editable:!1,children:Object.keys(t).map(e=>({key:e,label:e,enabled:!0,editable:!1})),itemFields:[]}:{key:e,label:e,type:`text`,enabled:!0,editable:!1,children:[],itemFields:[]}):[]}var G7=e=>!!e&&typeof e==`object`&&!Array.isArray(e),K7=e=>typeof e==`string`&&e.length>80,q7=e=>e==null||e===``?(0,Q.jsx)(Z.Text,{type:`secondary`,children:`-`}):typeof e==`boolean`?e?`是`:`否`:typeof e==`number`?e:typeof e==`string`?(0,Q.jsx)(Z.Paragraph,{style:{marginBottom:0,whiteSpace:`pre-wrap`},children:e}):(0,Q.jsx)(j7,{value:e,maxHeight:220}),J7=e=>e?(0,Q.jsx)(hR,{color:`processing`,children:`可编辑`}):(0,Q.jsx)(hR,{color:`default`,children:`只读`}),Y7=(e,t)=>e[t],dWe=(e,t)=>{let n=Y7(e,t.key);if(!G7(n))return(0,Q.jsx)(j7,{value:n??{},maxHeight:220});let r=t.children.filter(e=>e.enabled);return r.length?(0,Q.jsx)(sM,{size:`small`,column:2,bordered:!0,children:r.map(e=>(0,Q.jsx)(sM.Item,{label:(0,Q.jsxs)(CM,{size:4,children:[e.label,J7(e.editable)]}),span:K7(n[e.key])||G7(n[e.key])||Array.isArray(n[e.key])?2:1,children:q7(n[e.key])},e.key))}):(0,Q.jsx)(j7,{value:n,maxHeight:220})},fWe=(e,t)=>{let n=e.itemFields.filter(e=>e.enabled);return n.length?[{key:`时间段`,label:`时间段`,enabled:!0,editable:!1},...n]:Array.from(new Set(t.flatMap(e=>Object.keys(e)))).map(e=>({key:e,label:e,enabled:!0,editable:!1}))},pWe=(e,t)=>{let n=Y7(e,t.key);if(!Array.isArray(n)||!n.every(G7))return(0,Q.jsx)(j7,{value:n??[],maxHeight:260});let r=n,i=fWe(t,r);return(0,Q.jsx)(nR,{size:`small`,rowKey:(e,n)=>`${t.key}-${n}`,columns:i.map(e=>({title:(0,Q.jsxs)(CM,{size:4,children:[e.label,J7(e.editable)]}),dataIndex:e.key,key:e.key,width:K7(r.find(t=>t[e.key])?.[e.key])?320:160,render:e=>q7(e)})),dataSource:r,pagination:!1,scroll:{x:Math.max(900,i.length*180)},tableLayout:`fixed`})},mWe=(e,t)=>q7(Y7(e,t.key)),hWe=({schema:e,finalPrompt:t,schemaConfigSnapshot:n,schemaConfigSource:r,schemaConfigVersion:i,schemaConfigIsFallback:a})=>{let o=!!e&&Object.keys(e).length>0;if(!o&&!t)return(0,Q.jsx)(Wy,{description:`暂无视频提词 schema`});let s=o?e:{},c=cWe(n),l=(c?lWe(n):uWe(s)).filter(e=>e.key in s).map(e=>({key:e.key,label:(0,Q.jsxs)(CM,{size:8,wrap:!0,children:[(0,Q.jsx)(`span`,{children:e.label}),J7(e.editable),c?null:(0,Q.jsx)(hR,{color:`warning`,children:`管理后台兜底展示`})]}),children:e.type===`object`?dWe(s,e):e.type===`flow`?pWe(s,e):mWe(s,e)}));return(0,Q.jsxs)(CM,{direction:`vertical`,size:12,style:{width:`100%`},children:[(0,Q.jsx)(OA,{size:`small`,title:`Schema 配置来源`,children:(0,Q.jsxs)(sM,{size:`small`,column:3,bordered:!0,children:[(0,Q.jsx)(sM.Item,{label:`来源`,children:r||n?.source||(c?`-`:`viewer_fallback`)}),(0,Q.jsx)(sM.Item,{label:`版本`,children:i||n?.version||`-`}),(0,Q.jsx)(sM.Item,{label:`历史兜底`,children:a||!c?(0,Q.jsx)(hR,{color:`warning`,children:`是`}):(0,Q.jsx)(hR,{color:`success`,children:`否`})})]})}),t?(0,Q.jsx)(OA,{size:`small`,title:`最终视频提示词`,children:(0,Q.jsx)(Z.Paragraph,{style:{whiteSpace:`pre-wrap`,marginBottom:0},children:t})}):null,l.length?(0,Q.jsx)(Hh,{size:`small`,items:l}):o?(0,Q.jsx)(OA,{size:`small`,title:`视频提词 Schema`,children:(0,Q.jsx)(j7,{value:s,maxHeight:360})}):null,o?(0,Q.jsx)(Hh,{size:`small`,items:[{key:`raw_schema`,label:`原始 JSON / 历史脏字段排查`,children:(0,Q.jsx)(j7,{value:s,maxHeight:420})}]}):null]})},gWe=[`material_input`,`image_prompt_optimize`,`image_generate`,`video_prompt_optimize`,`video_generate`],_We={material_input:`参考素材、项目名称和核心内容点`,image_prompt_optimize:`图片 AI 提词优化结果`,image_generate:`图片引擎、生成参数和结果图`,video_prompt_optimize:`视频 JSON schema、动作流程和最终提词`,video_generate:`视频引擎、生成参数、封面和结果视频`},X7=e=>e?C5(e):`-`,Z7=e=>e?e.length>18?`${e.slice(0,10)}...${e.slice(-4)}`:e:`-`,vWe=({text:e=`-`})=>(0,Q.jsx)(Z.Text,{type:`secondary`,children:e}),Q7=({step:e})=>e?(0,Q.jsx)(tWe,{input:e.input,output:e.output}):null,$7=({index:e,stepCode:t,step:n,current:r})=>(0,Q.jsxs)(CM,{wrap:!0,size:8,children:[(0,Q.jsx)(Z.Text,{strong:!0,children:`第${e}步:${R7(t)}`}),(0,Q.jsx)(z7,{status:n?.status||`not_started`}),r?(0,Q.jsx)(hR,{color:`blue`,children:`当前步骤`}):null,(0,Q.jsx)(Z.Text,{type:`secondary`,children:_We[t]||t}),n?.updatedAt?(0,Q.jsxs)(Z.Text,{type:`secondary`,children:[`更新时间:`,X7(n.updatedAt)]}):null,n?.chatTaskId?(0,Q.jsx)(ux,{title:n.chatTaskId,children:(0,Q.jsxs)(hR,{children:[`Chat:`,Z7(n.chatTaskId)]})}):null]}),yWe=(e,t)=>{if(!e)return[];let n=new Set;return n.add(`material_input`),e.currentStepCode&&n.add(e.currentStepCode),Object.values(t).forEach(e=>{(e.status===`failed`||e.errorMessage)&&n.add(e.stepCode)}),e.errorMessage&&n.add(e.currentStepCode||`material_input`),Array.from(n)},e9=(e,t=`错误信息`)=>e?(0,Q.jsx)(cf,{type:`error`,showIcon:!0,message:t,description:e,style:{marginTop:12,marginBottom:12}}):null,bWe=(e,t=`暂无提词`)=>e?(0,Q.jsx)(Z.Paragraph,{style:{whiteSpace:`pre-wrap`,marginBottom:0},children:e}):(0,Q.jsx)(vWe,{text:t}),t9=({moduleType:e=`shot_replicate`})=>{let{projectId:t}=tt(),n=Ze(),[r,i]=(0,C.useState)(null),[a,o]=(0,C.useState)(!1),s=(0,C.useCallback)(async()=>{if(t){o(!0);try{i(e===`hot_opening_replicate`?await UVe(t):await JVe(t))}catch(e){mP.error(e?.message||`加载复刻项目详情失败`)}finally{o(!1)}}},[e,t]);(0,C.useEffect)(()=>{s()},[s]);let c=(0,C.useMemo)(()=>{let e={};return(r?.steps||[]).forEach(t=>{e[t.stepCode]=t}),e},[r]),l=r?.module||e,u=L7(l),d=(0,C.useMemo)(()=>gWe.map(e=>{let t=c[e],n=`wait`;return t?.status===`completed`?n=`finish`:t?.status===`processing`?n=`process`:t?.status===`failed`&&(n=`error`),{title:R7(e),description:t?(0,Q.jsx)(z7,{status:t.status}):`未创建`,status:n}}),[c]),f=(0,C.useMemo)(()=>yWe(r,c),[r,c]);if(a&&!r)return(0,Q.jsx)(`div`,{style:{padding:64,textAlign:`center`},children:(0,Q.jsx)(rP,{size:`large`})});if(!r)return(0,Q.jsx)(OA,{style:{margin:24},children:(0,Q.jsx)(Wy,{description:`未找到复刻项目详情`})});let p=c.material_input,m=c.image_prompt_optimize,h=c.image_generate,g=c.video_prompt_optimize,_=c.video_generate,v=r.imageGeneration?.resultImageUrl||r.finalImageUrl,y=r.videoGeneration?.resultVideoCoverUrl||r.finalVideoCoverUrl,b=r.videoGeneration?.resultVideoUrl||r.finalVideoUrl,x=[{key:`material_input`,label:(0,Q.jsx)($7,{index:1,stepCode:`material_input`,step:p,current:r.currentStepCode===`material_input`}),children:(0,Q.jsxs)(CM,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Q.jsxs)(sM,{column:2,bordered:!0,size:`small`,children:[(0,Q.jsx)(sM.Item,{label:`模块类型`,children:(0,Q.jsx)(z7,{status:l})}),(0,Q.jsx)(sM.Item,{label:`素材步骤ID`,children:r.material?.materialStepId||`-`}),(0,Q.jsx)(sM.Item,{label:`参考素材项目名`,children:r.material?.sourceProjectName||`-`}),(0,Q.jsx)(sM.Item,{label:`生成项目名称`,children:r.material?.targetProjectName||`-`}),(0,Q.jsx)(sM.Item,{label:`核心内容点`,span:2,children:r.material?.coreContentPoint||`-`})]}),(0,Q.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(320px, 1fr))`,gap:16},children:[(0,Q.jsx)(OA,{size:`small`,title:(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(r0,{}),`素材视频`]}),children:(0,Q.jsx)(M7,{type:`video`,url:r.material?.materialVideoUrl,emptyDescription:`暂无素材视频`})}),(0,Q.jsx)(OA,{size:`small`,title:(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(oX,{}),`素材图片`]}),children:(0,Q.jsx)(M7,{type:`image`,url:r.material?.materialImageUrl,emptyDescription:`暂无素材图片`})})]}),e9(p?.errorMessage),(0,Q.jsx)(Q7,{step:p})]})},{key:`image_prompt_optimize`,label:(0,Q.jsx)($7,{index:2,stepCode:`image_prompt_optimize`,step:m,current:r.currentStepCode===`image_prompt_optimize`}),children:(0,Q.jsxs)(CM,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Q.jsxs)(sM,{column:2,bordered:!0,size:`small`,children:[(0,Q.jsx)(sM.Item,{label:`提词步骤ID`,children:r.imageGeneration?.promptStepId||`-`}),(0,Q.jsx)(sM.Item,{label:`步骤状态`,children:(0,Q.jsx)(z7,{status:m?.status||r.imageGeneration?.status})}),(0,Q.jsx)(sM.Item,{label:`图片提示词`,span:2,children:bWe(r.imageGeneration?.prompt,`暂无图片提示词`)})]}),e9(m?.errorMessage||r.imageGeneration?.errorMessage),(0,Q.jsx)(Q7,{step:m})]})},{key:`image_generate`,label:(0,Q.jsx)($7,{index:3,stepCode:`image_generate`,step:h,current:r.currentStepCode===`image_generate`}),children:(0,Q.jsxs)(CM,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Q.jsxs)(sM,{column:3,bordered:!0,size:`small`,children:[(0,Q.jsx)(sM.Item,{label:`生成步骤ID`,children:r.imageGeneration?.generateStepId||`-`}),(0,Q.jsx)(sM.Item,{label:`Chat任务ID`,children:r.imageGeneration?.chatTaskId||`-`}),(0,Q.jsx)(sM.Item,{label:`状态`,children:(0,Q.jsx)(z7,{status:r.imageGeneration?.status||h?.status})}),(0,Q.jsx)(sM.Item,{label:`图片引擎ID`,children:r.imageGeneration?.engineId||`-`}),(0,Q.jsx)(sM.Item,{label:`图片引擎名称`,children:r.imageGeneration?.engineName||`-`}),(0,Q.jsx)(sM.Item,{label:`生成参数`,span:3,children:(0,Q.jsx)(j7,{value:r.imageGeneration?.params||{},maxHeight:160})})]}),e9(r.imageGeneration?.errorMessage||h?.errorMessage),(0,Q.jsx)(OA,{size:`small`,title:(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(oX,{}),`图片结果`]}),children:(0,Q.jsx)(M7,{type:`image`,url:v,height:360,emptyDescription:h?.status===`failed`||r.imageGeneration?.errorMessage?`图片生成失败,未返回图片地址`:`暂无图片结果`,errorDescription:`图片资源加载失败,可能图片文件不存在、签名过期或访问权限受限。`})}),(0,Q.jsx)(Q7,{step:h})]})},{key:`video_prompt_optimize`,label:(0,Q.jsx)($7,{index:4,stepCode:`video_prompt_optimize`,step:g,current:r.currentStepCode===`video_prompt_optimize`}),children:(0,Q.jsxs)(CM,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Q.jsxs)(sM,{column:3,bordered:!0,size:`small`,children:[(0,Q.jsx)(sM.Item,{label:`提词步骤ID`,children:r.videoGeneration?.promptStepId||`-`}),(0,Q.jsx)(sM.Item,{label:`步骤状态`,children:(0,Q.jsx)(z7,{status:g?.status})}),(0,Q.jsx)(sM.Item,{label:`提词参数`,span:3,children:(0,Q.jsx)(j7,{value:r.videoGeneration?.promptParams||{},maxHeight:160})})]}),e9(g?.errorMessage||r.videoGeneration?.errorMessage),(0,Q.jsx)(hWe,{schema:r.videoGeneration?.promptSchema,finalPrompt:r.videoGeneration?.finalPrompt,schemaConfigSnapshot:r.videoGeneration?.schemaConfigSnapshot,schemaConfigSource:r.videoGeneration?.schemaConfigSource,schemaConfigVersion:r.videoGeneration?.schemaConfigVersion,schemaConfigIsFallback:r.videoGeneration?.schemaConfigIsFallback}),(0,Q.jsx)(Q7,{step:g})]})},{key:`video_generate`,label:(0,Q.jsx)($7,{index:5,stepCode:`video_generate`,step:_,current:r.currentStepCode===`video_generate`}),children:(0,Q.jsxs)(CM,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Q.jsxs)(sM,{column:3,bordered:!0,size:`small`,children:[(0,Q.jsx)(sM.Item,{label:`生成步骤ID`,children:r.videoGeneration?.generateStepId||`-`}),(0,Q.jsx)(sM.Item,{label:`Chat任务ID`,children:r.videoGeneration?.chatTaskId||`-`}),(0,Q.jsx)(sM.Item,{label:`状态`,children:(0,Q.jsx)(z7,{status:r.videoGeneration?.status||_?.status})}),(0,Q.jsx)(sM.Item,{label:`视频引擎ID`,children:r.videoGeneration?.engineId||`-`}),(0,Q.jsx)(sM.Item,{label:`视频引擎名称`,children:r.videoGeneration?.engineName||`-`}),(0,Q.jsx)(sM.Item,{label:`生成参数`,span:3,children:(0,Q.jsx)(j7,{value:r.videoGeneration?.params||{},maxHeight:160})})]}),e9(r.videoGeneration?.errorMessage||_?.errorMessage),(0,Q.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(320px, 1fr))`,gap:16},children:[(0,Q.jsx)(OA,{size:`small`,title:(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(oX,{}),`视频封面`]}),children:(0,Q.jsx)(M7,{type:`image`,url:y,emptyDescription:_?.status===`failed`||r.videoGeneration?.errorMessage?`视频生成失败,未返回封面`:`暂无视频封面`,errorDescription:`视频封面加载失败,可能文件不存在、签名过期或访问权限受限。`})}),(0,Q.jsx)(OA,{size:`small`,title:(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(J6,{}),`最终视频`]}),children:(0,Q.jsx)(M7,{type:`video`,url:b,emptyDescription:_?.status===`failed`||r.videoGeneration?.errorMessage?`视频生成失败,未返回视频地址`:`暂无最终视频`,errorDescription:`视频资源加载失败,可能文件不存在、签名过期或访问权限受限。`})})]}),(0,Q.jsx)(Q7,{step:_})]})}];return(0,Q.jsx)(`div`,{style:{padding:24},children:(0,Q.jsxs)(CM,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Q.jsxs)(CM,{wrap:!0,style:{justifyContent:`space-between`,width:`100%`},children:[(0,Q.jsxs)(CM,{wrap:!0,children:[(0,Q.jsx)(JS,{icon:(0,Q.jsx)(wH,{}),onClick:()=>n(-1),children:`返回`}),(0,Q.jsxs)(Z.Title,{level:3,style:{margin:0},children:[u,`项目详情`]}),(0,Q.jsx)(z7,{status:r.status}),r.module&&r.module!==e?(0,Q.jsxs)(hR,{color:`gold`,children:[`接口模块:`,L7(r.module)]}):null]}),(0,Q.jsx)(JS,{onClick:s,loading:a,children:`刷新`})]}),(0,Q.jsx)(OA,{children:(0,Q.jsxs)(sM,{title:`基础信息`,column:3,bordered:!0,size:`small`,children:[(0,Q.jsx)(sM.Item,{label:`项目ID`,children:r.id}),(0,Q.jsx)(sM.Item,{label:`模块类型`,children:(0,Q.jsx)(z7,{status:l})}),(0,Q.jsx)(sM.Item,{label:`用户ID`,children:r.userId||`-`}),(0,Q.jsx)(sM.Item,{label:`用户名`,children:r.userName||`-`}),(0,Q.jsx)(sM.Item,{label:`标题`,children:r.title||`-`}),(0,Q.jsx)(sM.Item,{label:`当前步骤`,children:(0,Q.jsx)(ux,{title:r.currentStepCode||``,children:R7(r.currentStepCode)})}),(0,Q.jsx)(sM.Item,{label:`状态`,children:(0,Q.jsx)(z7,{status:r.status})}),(0,Q.jsx)(sM.Item,{label:`创建时间`,children:X7(r.createdAt)}),(0,Q.jsx)(sM.Item,{label:`更新时间`,children:X7(r.updatedAt)}),(0,Q.jsx)(sM.Item,{label:`完成时间`,children:X7(r.completedAt)}),r.errorMessage?(0,Q.jsx)(sM.Item,{label:`错误信息`,span:3,children:(0,Q.jsx)(cf,{type:`error`,showIcon:!0,message:r.errorMessage})}):null]})}),(0,Q.jsx)(OA,{title:`步骤进度`,children:(0,Q.jsx)(hhe,{items:d})}),(0,Q.jsx)(OA,{title:`最终结果预览`,children:(0,Q.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(280px, 1fr))`,gap:16},children:[(0,Q.jsx)(OA,{size:`small`,title:`最终图片`,children:(0,Q.jsx)(M7,{type:`image`,url:r.finalImageUrl||r.imageGeneration?.resultImageUrl,height:220,emptyDescription:`暂无最终图片`})}),(0,Q.jsx)(OA,{size:`small`,title:`最终视频封面`,children:(0,Q.jsx)(M7,{type:`image`,url:r.finalVideoCoverUrl||r.videoGeneration?.resultVideoCoverUrl,height:220,emptyDescription:`暂无最终视频封面`})}),(0,Q.jsx)(OA,{size:`small`,title:`最终视频`,children:(0,Q.jsx)(M7,{type:`video`,url:r.finalVideoUrl||r.videoGeneration?.resultVideoUrl,height:220,emptyDescription:`暂无最终视频`})})]})}),(0,Q.jsx)(Hh,{defaultActiveKey:f,items:x}),(0,Q.jsx)(Hh,{items:[{key:`steps-table`,label:`完整步骤列表`,children:(0,Q.jsx)(nR,{rowKey:`id`,size:`small`,pagination:!1,dataSource:r.steps||[],scroll:{x:1100},columns:[{title:`序号`,dataIndex:`stepIndex`,width:70},{title:`步骤`,dataIndex:`stepCode`,width:160,render:e=>(0,Q.jsx)(ux,{title:e,children:R7(e)})},{title:`状态`,dataIndex:`status`,width:120,render:e=>(0,Q.jsx)(z7,{status:e})},{title:`版本`,dataIndex:`version`,width:70},{title:`当前有效`,dataIndex:`isCurrent`,width:90,render:e=>e?(0,Q.jsx)(hR,{color:`success`,children:`是`}):(0,Q.jsx)(hR,{children:`否`})},{title:`Chat任务`,dataIndex:`chatTaskId`,width:160,render:e=>(0,Q.jsx)(ux,{title:e||``,children:Z7(e)})},{title:`创建时间`,dataIndex:`createdAt`,width:170,render:X7},{title:`完成时间`,dataIndex:`completedAt`,width:170,render:X7},{title:`错误`,dataIndex:`errorMessage`,ellipsis:!0,render:e=>e||`-`}]})},{key:`raw-detail`,label:`完整详情原始 JSON`,children:(0,Q.jsx)(j7,{value:r,maxHeight:520})}]})]})})},xWe=()=>(0,Q.jsx)(t9,{moduleType:`hot_opening_replicate`}),n9=20,SWe=[{value:`pending_analysis`,label:`等待分析`},{value:`analyzing`,label:`分析中`},{value:`analysis_completed`,label:`分析完成`},{value:`analysis_failed`,label:`分析失败`},{value:`splitting`,label:`拆镜中`},{value:`split_completed`,label:`拆镜完成`},{value:`partial_failed`,label:`部分失败`},{value:`failed`,label:`失败`}],CWe=[{value:`pending`,label:`待分析`},{value:`processing`,label:`分析中`},{value:`completed`,label:`分析完成`},{value:`failed`,label:`分析失败`}],wWe=[{value:`none`,label:`未拆镜`},{value:`pending`,label:`待拆镜`},{value:`processing`,label:`拆镜中`},{value:`completed`,label:`拆镜完成`},{value:`failed`,label:`拆镜失败`},{value:`retry_waiting`,label:`等待重试`}],TWe={pending_analysis:{color:`default`,text:`等待分析`},analyzing:{color:`processing`,text:`分析中`},analysis_completed:{color:`success`,text:`分析完成`},analysis_failed:{color:`error`,text:`分析失败`},splitting:{color:`warning`,text:`拆镜中`},split_completed:{color:`success`,text:`拆镜完成`},partial_failed:{color:`orange`,text:`部分失败`},failed:{color:`error`,text:`失败`},none:{color:`default`,text:`未拆镜`},pending:{color:`default`,text:`待处理`},processing:{color:`warning`,text:`处理中`},completed:{color:`success`,text:`完成`},retry_waiting:{color:`orange`,text:`等待重试`}},r9=e=>e?C5(e):`-`,i9=e=>e?e.length>16?`${e.slice(0,10)}...`:e:`-`,a9=({status:e})=>{if(!e)return(0,Q.jsx)(hR,{children:`-`});let t=TWe[e]||{color:`blue`,text:e};return(0,Q.jsx)(hR,{color:t.color,children:t.text})},EWe=()=>{let e=Ze(),[t,n]=(0,C.useState)([]),[r,i]=(0,C.useState)(0),[a,o]=(0,C.useState)(!1),[s,c]=(0,C.useState)(1),[l,u]=(0,C.useState)(``),[d,f]=(0,C.useState)(``),[p,m]=(0,C.useState)(``),[h,g]=(0,C.useState)(``),[_,v]=(0,C.useState)(``),[y,b]=(0,C.useState)(``),[x,S]=(0,C.useState)(null),[w,T]=(0,C.useState)(``),[E,D]=(0,C.useState)(``),[O,k]=(0,C.useState)(``),[A,j]=(0,C.useState)(null),[M,N]=(0,C.useState)(0),P=(0,C.useCallback)(async()=>{o(!0);try{let e=await WVe({status:l||void 0,analysisStatus:d||void 0,splitStatus:p||void 0,keyword:w||void 0,userId:E||void 0,userName:O||void 0,createdStart:A?.[0]?.toISOString?.(),createdEnd:A?.[1]?.toISOString?.(),page:s,pageSize:n9});n(e.items||[]),i(e.total||0)}catch(e){mP.error(e?.message||`加载拆镜复刻任务失败`)}finally{o(!1)}},[d,s,A,w,E,O,p,l]);(0,C.useEffect)(()=>{P()},[P,M]);let F=()=>{T(h.trim()),D(_.trim()),k(y.trim()),j(x),c(1)};return(0,Q.jsxs)(OA,{variant:`outlined`,style:{borderRadius:12,border:`1px solid #f0f0f5`},children:[(0,Q.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,marginBottom:16,flexWrap:`wrap`,gap:12},children:[(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(GG,{style:{fontSize:18,color:`#6366f1`}}),(0,Q.jsx)(Z.Text,{strong:!0,style:{fontSize:16},children:`拆镜复刻`}),(0,Q.jsxs)(hR,{color:`purple`,children:[r,` 条记录`]})]}),(0,Q.jsx)(JS,{icon:(0,Q.jsx)(MP,{}),onClick:()=>N(e=>e+1),children:`刷新`})]}),(0,Q.jsxs)(CM,{wrap:!0,children:[(0,Q.jsx)(bb,{allowClear:!0,placeholder:`总任务状态`,style:{width:150},value:l||void 0,onChange:e=>{u(e||``),c(1)},options:SWe}),(0,Q.jsx)(bb,{allowClear:!0,placeholder:`分析状态`,style:{width:140},value:d||void 0,onChange:e=>{f(e||``),c(1)},options:CWe}),(0,Q.jsx)(bb,{allowClear:!0,placeholder:`拆镜状态`,style:{width:140},value:p||void 0,onChange:e=>{m(e||``),c(1)},options:wWe}),(0,Q.jsx)(MN,{allowClear:!0,prefix:(0,Q.jsx)(hb,{}),placeholder:`关键词:标题/内容/分类/受众`,style:{width:260},value:h,onChange:e=>g(e.target.value),onPressEnter:F}),(0,Q.jsx)(MN,{allowClear:!0,placeholder:`用户ID(管理员)`,style:{width:190},value:_,onChange:e=>v(e.target.value),onPressEnter:F}),(0,Q.jsx)(MN,{allowClear:!0,placeholder:`用户名(管理员)`,style:{width:230},value:y,onChange:e=>b(e.target.value),onPressEnter:F}),(0,Q.jsx)(rM.RangePicker,{showTime:!0,value:x,onChange:S,placeholder:[`创建开始`,`创建结束`]}),(0,Q.jsx)(JS,{type:`primary`,icon:(0,Q.jsx)(hb,{}),onClick:F,children:`搜索`}),(0,Q.jsx)(JS,{onClick:()=>{u(``),f(``),m(``),g(``),v(``),b(``),S(null),T(``),D(``),k(``),j(null),c(1),N(e=>e+1)},children:`重置`})]}),(0,Q.jsx)(nR,{rowKey:`id`,loading:a,dataSource:t,pagination:{current:s,pageSize:n9,total:r,showSizeChanger:!1,showTotal:e=>`共 ${e} 条`,onChange:c},scroll:{x:1500},columns:[{title:`任务集ID`,dataIndex:`id`,width:150,render:e=>(0,Q.jsx)(ux,{title:e,children:i9(e)})},{title:`用户`,width:180,render:(e,t)=>(0,Q.jsxs)(CM,{direction:`vertical`,size:0,children:[(0,Q.jsx)(Z.Text,{children:t.userName||`-`}),(0,Q.jsx)(Z.Text,{type:`secondary`,style:{fontSize:12},children:i9(t.userId)})]})},{title:`任务信息`,width:300,render:(e,t)=>(0,Q.jsxs)(CM,{direction:`vertical`,size:2,children:[(0,Q.jsx)(Z.Text,{strong:!0,children:t.title||`-`}),(0,Q.jsxs)(Z.Text,{type:`secondary`,ellipsis:!0,style:{maxWidth:280},children:[`分类:`,t.originalVideoCategory||`-`]}),(0,Q.jsxs)(Z.Text,{type:`secondary`,ellipsis:!0,style:{maxWidth:280},children:[`受众:`,t.originalVideoAudience||`-`]})]})},{title:`总状态`,dataIndex:`status`,width:120,render:e=>(0,Q.jsx)(a9,{status:e})},{title:`分析状态`,dataIndex:`analysisStatus`,width:110,render:e=>(0,Q.jsx)(a9,{status:e})},{title:`拆镜状态`,dataIndex:`splitStatus`,width:110,render:e=>(0,Q.jsx)(a9,{status:e})},{title:`切片进度`,width:180,render:(e,t)=>{let n=t.segmentCount||0,r=t.completedSegmentCount||0;return(0,Q.jsx)(AP,{size:`small`,percent:n?Math.round(r/n*100):0,format:()=>`${r}/${n}`})}},{title:`失败片段`,dataIndex:`failedSegmentCount`,width:90,render:e=>e?(0,Q.jsx)(hR,{color:`error`,children:e}):(0,Q.jsx)(hR,{children:`0`})},{title:`视频时长`,dataIndex:`videoDurationSeconds`,width:100,render:e=>`${Number(e||0).toFixed(1)}s`},{title:`创建时间`,dataIndex:`createdAt`,width:170,render:r9},{title:`更新时间`,dataIndex:`updatedAt`,width:170,render:r9},{title:`操作`,fixed:`right`,width:120,render:(t,n)=>(0,Q.jsx)(JS,{type:`link`,icon:(0,Q.jsx)(CN,{}),onClick:()=>e(`/shot-replications/task-sets/${n.id}`),children:`查看切片`})}]})]})},DWe=`http://ceshi.apiforeign.minzhong.cn`.replace(/\/api\/?$/i,``).replace(/\/$/,``),o9=20,OWe=[{value:`ai_suggestion`,label:`AI 建议`},{value:`custom`,label:`自定义`}],kWe=[{value:`none`,label:`未拆镜`},{value:`pending`,label:`待拆镜`},{value:`processing`,label:`拆镜中`},{value:`completed`,label:`拆镜完成`},{value:`failed`,label:`拆镜失败`},{value:`retry_waiting`,label:`等待重试`}],AWe=[{value:`not_required`,label:`无需分析`},{value:`pending`,label:`待分析`},{value:`processing`,label:`分析中`},{value:`completed`,label:`分析完成`},{value:`failed`,label:`分析失败`}],jWe=[{value:`not_started`,label:`未复刻`},{value:`project_created`,label:`已创建项目`},{value:`processing`,label:`复刻中`},{value:`completed`,label:`复刻完成`},{value:`failed`,label:`复刻失败`}],MWe={pending_analysis:{color:`default`,text:`等待分析`},analyzing:{color:`processing`,text:`分析中`},analysis_completed:{color:`success`,text:`分析完成`},analysis_failed:{color:`error`,text:`分析失败`},splitting:{color:`warning`,text:`拆镜中`},split_completed:{color:`success`,text:`拆镜完成`},partial_failed:{color:`orange`,text:`部分失败`},failed:{color:`error`,text:`失败`},none:{color:`default`,text:`未拆镜`},pending:{color:`default`,text:`待处理`},processing:{color:`warning`,text:`处理中`},completed:{color:`success`,text:`完成`},retry_waiting:{color:`orange`,text:`等待重试`},not_required:{color:`default`,text:`无需分析`},not_started:{color:`default`,text:`未复刻`},project_created:{color:`processing`,text:`已创建项目`}},NWe=e=>{if(!e)return``;let t=String(e).trim();return t?/^(https?:)?\/\//i.test(t)||/^(blob|data):/i.test(t)?t:`${DWe}${t.startsWith(`/`)?t:`/${t}`}`:``},s9=e=>e?C5(e):`-`,c9=e=>e?e.length>16?`${e.slice(0,10)}...`:e:`-`,l9=({status:e})=>{if(!e)return(0,Q.jsx)(hR,{children:`-`});let t=MWe[e]||{color:`blue`,text:e};return(0,Q.jsx)(hR,{color:t.color,children:t.text})},u9=({value:e,maxHeight:t=420})=>(0,Q.jsx)(`pre`,{style:{margin:0,padding:12,maxHeight:t,overflow:`auto`,background:`#0f172a`,color:`#e2e8f0`,borderRadius:8,fontSize:12,lineHeight:1.6},children:JSON.stringify(e??{},null,2)}),d9=({url:e,height:t=280})=>e?(0,Q.jsx)(`video`,{src:NWe(e),controls:!0,preload:`metadata`,style:{width:`100%`,maxHeight:t,borderRadius:12,background:`#0f172a`}}):(0,Q.jsx)(Wy,{description:`暂无视频`,image:Wy.PRESENTED_IMAGE_SIMPLE}),PWe=({items:e=[]})=>(0,Q.jsx)(nR,{rowKey:`index`,size:`small`,pagination:!1,dataSource:e,scroll:{x:!0},columns:[{title:`序号`,dataIndex:`index`,width:70},{title:`时间节点`,dataIndex:`timeNode`,width:120},{title:`开始`,dataIndex:`startSecond`,width:80,render:e=>`${Number(e||0).toFixed(2)}s`},{title:`结束`,dataIndex:`endSecond`,width:80,render:e=>`${Number(e||0).toFixed(2)}s`},{title:`内容`,dataIndex:`content`,ellipsis:!0},{title:`分类`,dataIndex:`category`,width:140},{title:`受众`,dataIndex:`audience`,ellipsis:!0}]}),FWe=()=>{let{taskSetId:e}=tt(),t=Ze(),[n,r]=(0,C.useState)(null),[i,a]=(0,C.useState)([]),[o,s]=(0,C.useState)(0),[c,l]=(0,C.useState)(1),[u,d]=(0,C.useState)(!1),[f,p]=(0,C.useState)(!1),[m,h]=(0,C.useState)(0),[g,_]=(0,C.useState)(``),[v,y]=(0,C.useState)(``),[b,x]=(0,C.useState)(``),[S,w]=(0,C.useState)(``),[T,E]=(0,C.useState)(!1),[D,O]=(0,C.useState)(null),k=(0,C.useCallback)(async()=>{if(e){d(!0);try{r(await GVe(e))}catch(e){mP.error(e?.message||`加载拆镜任务详情失败`)}finally{d(!1)}}},[e]),A=(0,C.useCallback)(async()=>{if(e){p(!0);try{let t=await KVe(e,{sourceMode:g||void 0,splitStatus:v||void 0,analysisStatus:b||void 0,replicateStatus:S||void 0,page:c,pageSize:o9});a(t.items||[]),s(t.total||0)}catch(e){mP.error(e?.message||`加载拆镜片段失败`)}finally{p(!1)}}},[b,c,S,g,v,e]);(0,C.useEffect)(()=>{k()},[k,m]),(0,C.useEffect)(()=>{A()},[A,m]);let j=async e=>{E(!0),O(null);try{O(await qVe(e))}catch(e){mP.error(e?.message||`加载片段详情失败`)}};return u&&!n?(0,Q.jsx)(`div`,{style:{padding:64,textAlign:`center`},children:(0,Q.jsx)(rP,{size:`large`})}):n?(0,Q.jsxs)(`div`,{style:{padding:24},children:[(0,Q.jsxs)(CM,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Q.jsxs)(CM,{style:{justifyContent:`space-between`,width:`100%`},children:[(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(JS,{icon:(0,Q.jsx)(wH,{}),onClick:()=>t(`/shot-replications`),children:`返回列表`}),(0,Q.jsx)(Z.Title,{level:3,style:{margin:0},children:`拆镜任务详情`}),(0,Q.jsx)(l9,{status:n.status})]}),(0,Q.jsx)(JS,{icon:(0,Q.jsx)(MP,{}),onClick:()=>h(e=>e+1),children:`刷新`})]}),(0,Q.jsx)(OA,{children:(0,Q.jsxs)(sM,{title:`总任务信息`,column:3,bordered:!0,size:`small`,children:[(0,Q.jsx)(sM.Item,{label:`任务集ID`,children:n.id}),(0,Q.jsx)(sM.Item,{label:`用户ID`,children:n.userId||`-`}),(0,Q.jsx)(sM.Item,{label:`用户名`,children:n.userName||`-`}),(0,Q.jsx)(sM.Item,{label:`标题`,children:n.title||`-`}),(0,Q.jsxs)(sM.Item,{label:`视频时长`,children:[Number(n.videoDurationSeconds||0).toFixed(2),`s`]}),(0,Q.jsx)(sM.Item,{label:`总状态`,children:(0,Q.jsx)(l9,{status:n.status})}),(0,Q.jsx)(sM.Item,{label:`分析状态`,children:(0,Q.jsx)(l9,{status:n.analysisStatus})}),(0,Q.jsx)(sM.Item,{label:`拆镜状态`,children:(0,Q.jsx)(l9,{status:n.splitStatus})}),(0,Q.jsxs)(sM.Item,{label:`片段数量`,children:[n.completedSegmentCount,`/`,n.segmentCount,`,失败 `,n.failedSegmentCount]}),(0,Q.jsx)(sM.Item,{label:`原视频分类`,children:n.originalVideoCategory||`-`}),(0,Q.jsx)(sM.Item,{label:`创建时间`,children:s9(n.createdAt)}),(0,Q.jsx)(sM.Item,{label:`更新时间`,children:s9(n.updatedAt)}),(0,Q.jsx)(sM.Item,{label:`原视频内容`,span:3,children:n.originalVideoContent||`-`}),(0,Q.jsx)(sM.Item,{label:`原视频受众`,span:3,children:n.originalVideoAudience||`-`}),n.analysisErrorMessage?(0,Q.jsx)(sM.Item,{label:`分析错误`,span:3,children:(0,Q.jsx)(cf,{type:`error`,message:n.analysisErrorMessage})}):null,n.splitErrorMessage?(0,Q.jsx)(sM.Item,{label:`拆镜错误`,span:3,children:(0,Q.jsx)(cf,{type:`error`,message:n.splitErrorMessage})}):null]})}),(0,Q.jsx)(OA,{title:(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(r0,{}),`原视频预览`]}),children:(0,Q.jsx)(d9,{url:n.videoUrl,height:360})}),(0,Q.jsxs)(OA,{title:`AI 建议拆镜列表`,children:[n.aiSuggestions?.length?(0,Q.jsx)(PWe,{items:n.aiSuggestions}):(0,Q.jsx)(Wy,{description:`暂无 AI 建议拆镜`}),(0,Q.jsx)(Hh,{size:`small`,ghost:!0,style:{marginTop:12},items:[{key:`raw`,label:`查看原视频分析完整 JSON`,children:(0,Q.jsx)(u9,{value:n.analysisResultJson})}]})]}),(0,Q.jsxs)(OA,{title:`片段列表`,children:[(0,Q.jsxs)(CM,{wrap:!0,style:{marginBottom:16},children:[(0,Q.jsx)(bb,{allowClear:!0,placeholder:`片段来源`,style:{width:140},value:g||void 0,options:OWe,onChange:e=>{_(e||``),l(1)}}),(0,Q.jsx)(bb,{allowClear:!0,placeholder:`切割状态`,style:{width:140},value:v||void 0,options:kWe,onChange:e=>{y(e||``),l(1)}}),(0,Q.jsx)(bb,{allowClear:!0,placeholder:`分析状态`,style:{width:140},value:b||void 0,options:AWe,onChange:e=>{x(e||``),l(1)}}),(0,Q.jsx)(bb,{allowClear:!0,placeholder:`复刻状态`,style:{width:150},value:S||void 0,options:jWe,onChange:e=>{w(e||``),l(1)}}),(0,Q.jsx)(JS,{icon:(0,Q.jsx)(hb,{}),onClick:()=>h(e=>e+1),children:`筛选`}),(0,Q.jsx)(JS,{onClick:()=>{_(``),y(``),x(``),w(``),l(1),h(e=>e+1)},children:`重置`})]}),(0,Q.jsx)(nR,{rowKey:`id`,loading:f,dataSource:i,pagination:{current:c,pageSize:o9,total:o,showSizeChanger:!1,showTotal:e=>`共 ${e} 条`,onChange:l},scroll:{x:1550},columns:[{title:`片段ID`,dataIndex:`id`,width:150,render:e=>(0,Q.jsx)(ux,{title:e,children:c9(e)})},{title:`序号`,dataIndex:`segmentIndex`,width:70},{title:`来源`,dataIndex:`sourceMode`,width:100,render:e=>e===`ai_suggestion`?(0,Q.jsx)(hR,{color:`purple`,children:`AI建议`}):(0,Q.jsx)(hR,{color:`cyan`,children:`自定义`})},{title:`时间节点`,dataIndex:`timeNode`,width:130},{title:`时长`,dataIndex:`durationSeconds`,width:90,render:e=>`${Number(e||0).toFixed(2)}s`},{title:`切割`,dataIndex:`splitStatus`,width:100,render:e=>(0,Q.jsx)(l9,{status:e})},{title:`分析`,dataIndex:`analysisStatus`,width:100,render:e=>(0,Q.jsx)(l9,{status:e})},{title:`复刻`,dataIndex:`replicateStatus`,width:110,render:e=>(0,Q.jsx)(l9,{status:e})},{title:`片段内容`,dataIndex:`segmentContent`,width:260,ellipsis:!0,render:e=>e||`-`},{title:`分类`,dataIndex:`segmentCategory`,width:120,render:e=>e||`-`},{title:`关联项目`,width:220,render:(e,n)=>n.moduleProjectId?(0,Q.jsxs)(CM,{direction:`vertical`,size:0,children:[(0,Q.jsx)(JS,{type:`link`,style:{padding:0},onClick:()=>t(`/shot-replications/projects/${n.moduleProjectId}`),children:c9(n.moduleProjectId)}),(0,Q.jsx)(Z.Text,{type:`secondary`,style:{fontSize:12},children:n.moduleProjectTitle||R7(n.moduleProjectCurrentStepCode)}),(0,Q.jsx)(l9,{status:n.moduleProjectStatus})]}):(0,Q.jsx)(hR,{children:`未创建`})},{title:`错误`,dataIndex:`splitLastError`,width:220,ellipsis:!0,render:(e,t)=>e||t.analysisErrorMessage||`-`},{title:`创建时间`,dataIndex:`createdAt`,width:170,render:s9},{title:`操作`,fixed:`right`,width:100,render:(e,t)=>(0,Q.jsx)(JS,{type:`link`,icon:(0,Q.jsx)(CN,{}),onClick:()=>j(t.id),children:`详情`})}]})]})]}),(0,Q.jsx)(Hde,{title:`片段详情`,width:720,open:T,onClose:()=>E(!1),destroyOnClose:!0,children:D?(0,Q.jsxs)(CM,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Q.jsxs)(sM,{column:2,bordered:!0,size:`small`,children:[(0,Q.jsx)(sM.Item,{label:`片段ID`,span:2,children:D.id}),(0,Q.jsx)(sM.Item,{label:`时间节点`,children:D.timeNode}),(0,Q.jsxs)(sM.Item,{label:`时长`,children:[Number(D.durationSeconds||0).toFixed(2),`s`]}),(0,Q.jsx)(sM.Item,{label:`切割状态`,children:(0,Q.jsx)(l9,{status:D.splitStatus})}),(0,Q.jsx)(sM.Item,{label:`分析状态`,children:(0,Q.jsx)(l9,{status:D.analysisStatus})}),(0,Q.jsx)(sM.Item,{label:`复刻状态`,children:(0,Q.jsx)(l9,{status:D.replicateStatus})}),(0,Q.jsx)(sM.Item,{label:`关联项目`,children:D.moduleProjectId?(0,Q.jsx)(JS,{type:`link`,onClick:()=>t(`/shot-replications/projects/${D.moduleProjectId}`),children:D.moduleProjectId}):`-`}),(0,Q.jsx)(sM.Item,{label:`片段内容`,span:2,children:D.segmentContent||`-`}),(0,Q.jsx)(sM.Item,{label:`片段分类`,children:D.segmentCategory||`-`}),(0,Q.jsx)(sM.Item,{label:`片段受众`,children:D.segmentAudience||`-`})]}),(0,Q.jsx)(OA,{size:`small`,title:`片段视频`,children:(0,Q.jsx)(d9,{url:D.segmentVideoUrl,height:300})}),D.splitLastError?(0,Q.jsx)(cf,{type:`error`,message:`切割错误`,description:D.splitLastError}):null,D.analysisErrorMessage?(0,Q.jsx)(cf,{type:`error`,message:`分析错误`,description:D.analysisErrorMessage}):null,(0,Q.jsx)(Hh,{size:`small`,items:[{key:`analysis`,label:`片段分析 JSON`,children:(0,Q.jsx)(u9,{value:D.analysisJson})},{key:`suggestion`,label:`AI 建议原始 JSON`,children:(0,Q.jsx)(u9,{value:D.aiSuggestionJson})}]})]}):(0,Q.jsx)(rP,{})})]}):(0,Q.jsx)(OA,{style:{margin:24},children:(0,Q.jsx)(Wy,{description:`未找到拆镜任务详情`})})},{Title:IWe,Text:f9,Paragraph:LWe}=Z,{TextArea:p9}=MN,m9=[{label:`对象`,value:`object`},{label:`数组`,value:`array`},{label:`字符串`,value:`string`},{label:`数字`,value:`number`},{label:`布尔`,value:`boolean`},{label:`流程数组`,value:`flow`}],h9=`画面属性`,RWe=new Set([`视频时长`,`视频比例`,`清晰度`,`帧率`,`推荐分辨率`]);function g9(e,t){return e===h9&&!!t&&RWe.has(t)}function _9(e){return e===h9}function zWe(e){return JSON.parse(JSON.stringify(e??null))}function v9(e,t,n,r){return!e||typeof e!=`object`?r:e[t]===void 0?e[n]===void 0?r:e[n]:e[t]}function BWe(e){return{key:String(e?.key||e?.label||`新流程字段`),label:String(e?.label||e?.key||`新流程字段`),enabled:e?.enabled??!0,editable:e?.editable??!0,maxLength:Number(v9(e,`maxLength`,`max_length`,800)||800),value:e?.value??``}}function y9(e){let t=String(e?.type||`string`),n={key:String(e?.key||e?.label||`新字段`),label:String(e?.label||e?.key||`新字段`),type:t,enabled:e?.enabled??!0,editable:e?.editable??!0,maxLength:Number(v9(e,`maxLength`,`max_length`,t===`flow`?800:1e3)||(t===`flow`?800:1e3))};if(t===`object`)n.children=Array.isArray(e?.children)?e.children.map(y9):[];else if(t===`flow`){n.contentKey=String(v9(e,`contentKey`,`content_key`,e?.key===`镜头流程`?`镜头内容`:`动作内容`));let t=v9(e,`contentAliases`,`content_aliases`,[]);n.contentAliases=Array.isArray(t)?t.map(e=>String(e)).filter(Boolean):[];let r=v9(e,`itemFields`,`item_fields`,[]);n.itemFields=Array.isArray(r)&&r.length>0?r.map(BWe):[{key:n.contentKey,label:n.contentKey,enabled:!0,editable:!0,maxLength:n.maxLength||800,value:``}]}else n.value=e?.value??(t===`array`?[]:t===`boolean`?!1:t===`number`?0:`无`);return n}function VWe(e){let t=Array.isArray(e?.segments)?e.segments:[],n=Array.isArray(e?.ratios)?e.ratios:[];return{minDuration:Number(v9(e,`minDuration`,`min_duration`,1)||1),maxDuration:Number(v9(e,`maxDuration`,`max_duration`,5)||5),ratios:n.map(e=>Number(e||0)),segments:t.map(e=>({stage:String(e?.stage||`新阶段`),description:String(e?.description||e?.desc||`阶段说明`)}))}}function b9(e){let t=Array.isArray(e?.sections)?e.sections:[],n=Array.isArray(e?.timePlanRules)?e.timePlanRules:Array.isArray(e?.time_plan_rules)?e.time_plan_rules:[];return{version:e?.version||`video_prompt_schema_config_v1`,enabled:e?.enabled??!0,sections:t.map(y9),timePlanRules:n.map(VWe)}}function x9(e,t){let n=_9(e.key),r=g9(t,e.key),i={key:e.key,label:e.label,type:r?`string`:e.type,enabled:n||r?!0:!!e.enabled,editable:r?!1:!!e.editable,max_length:e.maxLength};return e.type===`object`?i.children=(e.children||[]).map(t=>x9(t,e.key)):e.type===`flow`?(i.content_key=e.contentKey,i.content_aliases=e.contentAliases||[],i.item_fields=(e.itemFields||[]).map(e=>({key:e.key,label:e.label,enabled:!!e.enabled,editable:!!e.editable,max_length:e.maxLength,value:e.value??``}))):i.value=e.value,i}function S9(e,t){return{version:e.version,enabled:t,sections:(e.sections||[]).map(e=>x9(e)),time_plan_rules:(e.timePlanRules||[]).map(e=>({min_duration:e.minDuration,max_duration:e.maxDuration,ratios:e.ratios||[],segments:(e.segments||[]).map(e=>({stage:e.stage,description:e.description}))}))}}function C9(e){return e?.runtimeSchema||e?.runtime_schema||{}}function w9(e){let t=e?.timePlan||e?.time_plan||C9(e)?.动态时间规划||[];return Array.isArray(t)?t:[]}function HWe(e){return e?.schemaConfigSnapshot||e?.schema_config_snapshot||{}}function UWe(e,t){let n=new Blob([JSON.stringify(t,null,2)],{type:`application/json;charset=utf-8`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=e,i.click(),URL.revokeObjectURL(r)}var T9=(e=`string`)=>({key:`新字段`,label:`新字段`,type:e,enabled:!0,editable:!0,maxLength:e===`flow`?800:1e3,value:e===`array`?[]:e===`boolean`?!1:e===`number`?0:`无`,children:e===`object`?[]:void 0,contentKey:e===`flow`?`动作内容`:void 0,contentAliases:e===`flow`?[`动作内容`,`动作`,`动作说明`,`内容`,`说明`]:void 0,itemFields:e===`flow`?[{key:`动作内容`,label:`动作内容`,enabled:!0,editable:!0,maxLength:800,value:``}]:void 0}),WWe=()=>({minDuration:1,maxDuration:5,ratios:[.2,.4,.4],segments:[{stage:`开场吸引`,description:`快速吸引注意力`},{stage:`核心展示`,description:`展示主体动作、核心卖点或主要视觉内容`},{stage:`收尾引导`,description:`给出行动引导并稳定落版`}]}),GWe=()=>{let[e,t]=(0,C.useState)(!1),[n,r]=(0,C.useState)(!1),[i,a]=(0,C.useState)(!0),[o,s]=(0,C.useState)(!1),[c,l]=(0,C.useState)(null),[u,d]=(0,C.useState)(null),[f,p]=(0,C.useState)(!1),[m,h]=(0,C.useState)(null),[g]=X.useForm(),_=(0,C.useRef)(null),v=c?.sections||[],y=c?.timePlanRules||[],b=async()=>{t(!0);try{let e=await YVe();a(!!(e.isEnabled??e.is_enabled??e.data?.enabled??!1)),s(!!(e.usingDefault??e.using_default??!1)),l(b9(e.data)),d(b9(e.defaultData??e.default_data))}catch(e){mP.error(e?.message||`加载失败`)}finally{t(!1)}};(0,C.useEffect)(()=>{b()},[]);let x=e=>{l(t=>{let n=b9(zWe(t));return e(n),n})},S=async()=>{if(c){r(!0);try{let e=await XVe({is_enabled:i,data:S9(c,i)});l(b9(e.data)),a(!!(e.isEnabled??e.is_enabled??e.data?.enabled??!1)),s(!!(e.usingDefault??e.using_default??!1)),mP.success(`保存成功`)}catch(e){mP.error(e?.message||`保存失败`)}finally{r(!1)}}},w=async()=>{r(!0);try{let e=await ZVe();l(b9(e.data)),d(b9(e.defaultData??e.default_data)),a(!!(e.isEnabled??e.is_enabled??e.data?.enabled??!1)),s(!!(e.usingDefault??e.using_default??!1)),mP.success(`已恢复默认配置`)}catch(e){mP.error(e?.message||`恢复默认失败`)}finally{r(!1)}},T=async()=>{try{UWe(`video_prompt_schema_config.json`,await QVe())}catch(e){mP.error(e?.message||`导出失败`)}},E=async e=>{let t=e.target.files?.[0];if(e.target.value=``,t)try{let e=await t.text(),n=JSON.parse(e),r=n.data||n,o=await $Ve({is_enabled:!!(n.isEnabled??n.is_enabled??i),data:r});l(b9(o.data)),a(!!(o.isEnabled??o.is_enabled??o.data?.enabled??!1)),s(!!(o.usingDefault??o.using_default??!1)),mP.success(`导入成功`)}catch(e){mP.error(e?.message||`导入失败,请检查 JSON 格式`)}},D=()=>{g.setFieldsValue({duration:8,aspectRatio:`9:16`,resolution:`1080p`,frameRate:`30fps`}),h(null),p(!0)},O=async()=>{if(!c)return;let e=await g.validateFields();try{h(await eHe({is_enabled:i,data:S9(c,i),duration:Number(e.duration||8),aspect_ratio:e.aspectRatio,resolution:e.resolution,frame_rate:e.frameRate}))}catch(e){mP.error(e?.message||`预览失败`)}},k=()=>{x(e=>{e.sections.push(T9(`object`))})},A=(e,t)=>{x(n=>{let r=n.sections[e];_9(r?.key)&&(delete t.key,delete t.type,delete t.enabled),n.sections[e]={...n.sections[e],...t},t.type===`object`&&(n.sections[e].children=n.sections[e].children||[]),t.type===`flow`&&(n.sections[e].contentKey=n.sections[e].contentKey||`动作内容`,n.sections[e].contentAliases=n.sections[e].contentAliases||[`动作内容`,`动作`,`动作说明`,`内容`,`说明`],n.sections[e].itemFields=n.sections[e].itemFields||[{key:`动作内容`,label:`动作内容`,enabled:!0,editable:!0,maxLength:800,value:``}])})},j=e=>{x(t=>{t.sections.splice(e,1)})},M=e=>{x(t=>{let n=t.sections[e];n.children=n.children||[],n.children.push(T9(`string`))})},N=(e,t,n)=>{x(r=>{let i=r.sections[e],a=i.children||[],o=a[t];g9(i?.key,o?.key)&&(delete n.key,delete n.type,delete n.enabled,n.editable=!1),a[t]={...a[t],...n},r.sections[e].children=a})},P=(e,t)=>{x(n=>{n.sections[e].children?.splice(t,1)})},F=e=>{x(t=>{let n=t.sections[e];n.itemFields=n.itemFields||[],n.itemFields.push({key:`新流程字段`,label:`新流程字段`,enabled:!0,editable:!0,maxLength:800,value:``})})},I=(e,t,n)=>{x(r=>{let i=r.sections[e].itemFields||[];i[t]={...i[t],...n},r.sections[e].itemFields=i})},L=(e,t)=>{x(n=>{n.sections[e].itemFields?.splice(t,1)})},R=()=>{x(e=>{e.timePlanRules.push(WWe())})},z=(e,t)=>{x(n=>{n.timePlanRules[e]={...n.timePlanRules[e],...t}})},B=e=>{x(t=>{t.timePlanRules.splice(e,1)})},V=(e,t,n)=>{x(r=>{let i=r.timePlanRules[e];n.ratio!==void 0&&(i.ratios[t]=Number(n.ratio||0)),n.stage!==void 0&&(i.segments[t].stage=n.stage),n.description!==void 0&&(i.segments[t].description=n.description)})},H=e=>{x(t=>{let n=t.timePlanRules[e];n.ratios.push(1),n.segments.push({stage:`新阶段`,description:`阶段说明`})})},U=(e,t)=>{x(n=>{let r=n.timePlanRules[e];r.ratios.splice(t,1),r.segments.splice(t,1)})},W=(0,C.useMemo)(()=>v.map((e,t)=>({key:`section-${t}`,label:(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(f9,{strong:!0,children:e.label||e.key||`未命名分组`}),e.key&&e.key!==e.label&&(0,Q.jsxs)(hR,{color:`blue`,children:[`key: `,e.key]}),(0,Q.jsx)(hR,{children:e.type}),_9(e.key)&&(0,Q.jsx)(hR,{color:`red`,children:`系统锁定`}),!e.enabled&&!_9(e.key)&&(0,Q.jsx)(hR,{color:`default`,children:`已禁用`})]}),children:(0,Q.jsxs)(CM,{direction:`vertical`,style:{width:`100%`},size:`middle`,children:[(0,Q.jsxs)(FP,{gutter:12,align:`middle`,children:[(0,Q.jsx)(ZA,{span:4,children:(0,Q.jsx)(MN,{addonBefore:`key`,value:e.key,maxLength:64,placeholder:`传给 AI 的字段名`,disabled:_9(e.key),onChange:e=>A(t,{key:e.target.value})})}),(0,Q.jsx)(ZA,{span:4,children:(0,Q.jsx)(MN,{addonBefore:`label`,value:e.label,maxLength:64,placeholder:`后台显示名称`,onChange:e=>A(t,{label:e.target.value})})}),(0,Q.jsx)(ZA,{span:4,children:(0,Q.jsx)(bb,{value:e.type,options:m9,style:{width:`100%`},disabled:_9(e.key),onChange:e=>A(t,{type:e})})}),(0,Q.jsx)(ZA,{span:3,children:(0,Q.jsxs)(CM,{children:[`启用`,(0,Q.jsx)(eF,{checked:_9(e.key)?!0:e.enabled,disabled:_9(e.key),onChange:e=>A(t,{enabled:e})})]})}),(0,Q.jsx)(ZA,{span:3,children:(0,Q.jsxs)(CM,{children:[`可编辑`,(0,Q.jsx)(eF,{checked:e.editable,onChange:e=>A(t,{editable:e})})]})}),(0,Q.jsx)(ZA,{span:4,children:(0,Q.jsx)(xj,{min:1,max:2e4,value:e.maxLength,addonBefore:`长度`,style:{width:`100%`},onChange:e=>A(t,{maxLength:Number(e||1e3)})})}),(0,Q.jsx)(ZA,{span:2,style:{textAlign:`right`},children:(0,Q.jsx)(yP,{title:`确认删除该分组?`,disabled:_9(e.key),onConfirm:()=>j(t),children:(0,Q.jsx)(JS,{danger:!0,icon:(0,Q.jsx)(vR,{}),disabled:_9(e.key)})})})]}),e.type===`object`&&(0,Q.jsx)(OA,{size:`small`,title:`对象字段`,extra:(0,Q.jsx)(JS,{size:`small`,icon:(0,Q.jsx)(rA,{}),onClick:()=>M(t),children:`新增字段`}),children:(0,Q.jsx)(CM,{direction:`vertical`,style:{width:`100%`},children:(e.children||[]).map((n,r)=>(0,Q.jsxs)(FP,{gutter:8,align:`middle`,children:[(0,Q.jsx)(ZA,{span:4,children:(0,Q.jsx)(MN,{addonBefore:`key`,value:n.key,maxLength:64,placeholder:`传给 AI 的字段名`,disabled:g9(e.key,n.key),onChange:e=>N(t,r,{key:e.target.value})})}),(0,Q.jsx)(ZA,{span:4,children:(0,Q.jsx)(MN,{addonBefore:`label`,value:n.label,maxLength:64,placeholder:`后台显示名称`,onChange:e=>N(t,r,{label:e.target.value})})}),(0,Q.jsx)(ZA,{span:3,children:(0,Q.jsx)(bb,{value:n.type,options:m9.filter(e=>e.value!==`object`&&e.value!==`flow`),style:{width:`100%`},disabled:g9(e.key,n.key),onChange:e=>N(t,r,{type:e})})}),(0,Q.jsx)(ZA,{span:2,children:(0,Q.jsxs)(CM,{children:[`启用`,(0,Q.jsx)(eF,{checked:g9(e.key,n.key)?!0:n.enabled,disabled:g9(e.key,n.key),onChange:e=>N(t,r,{enabled:e})})]})}),(0,Q.jsx)(ZA,{span:2,children:(0,Q.jsxs)(CM,{children:[`编辑`,(0,Q.jsx)(eF,{checked:g9(e.key,n.key)?!1:n.editable,disabled:g9(e.key,n.key),onChange:e=>N(t,r,{editable:e})})]})}),(0,Q.jsx)(ZA,{span:3,children:(0,Q.jsx)(xj,{min:1,max:2e4,value:n.maxLength,addonBefore:`长度`,style:{width:`100%`},onChange:e=>N(t,r,{maxLength:Number(e||1e3)})})}),(0,Q.jsx)(ZA,{span:5,children:(0,Q.jsx)(MN,{value:Array.isArray(n.value)?n.value.join(`/`):String(n.value??``),maxLength:n.maxLength||1e3,placeholder:`默认值`,onChange:e=>N(t,r,{value:n.type===`array`?e.target.value.split(`/`).filter(Boolean):e.target.value})})}),(0,Q.jsx)(ZA,{span:1,style:{textAlign:`right`},children:(0,Q.jsx)(JS,{danger:!0,size:`small`,icon:(0,Q.jsx)(vR,{}),disabled:g9(e.key,n.key),onClick:()=>P(t,r)})})]},`child-${t}-${r}`))})}),e.type===`flow`&&(0,Q.jsxs)(OA,{size:`small`,title:`流程数组对象字段`,extra:(0,Q.jsx)(JS,{size:`small`,icon:(0,Q.jsx)(rA,{}),onClick:()=>F(t),children:`新增流程字段`}),children:[(0,Q.jsxs)(FP,{gutter:12,style:{marginBottom:12},children:[(0,Q.jsx)(ZA,{span:6,children:(0,Q.jsx)(MN,{addonBefore:`内容字段`,value:e.contentKey,maxLength:64,onChange:e=>A(t,{contentKey:e.target.value})})}),(0,Q.jsx)(ZA,{span:18,children:(0,Q.jsx)(MN,{addonBefore:`别名 / 分隔`,value:(e.contentAliases||[]).join(`/`),onChange:e=>A(t,{contentAliases:e.target.value.split(`/`).map(e=>e.trim()).filter(Boolean)})})})]}),(0,Q.jsx)(CM,{direction:`vertical`,style:{width:`100%`},children:(e.itemFields||[]).map((e,n)=>(0,Q.jsxs)(FP,{gutter:8,align:`middle`,children:[(0,Q.jsx)(ZA,{span:5,children:(0,Q.jsx)(MN,{addonBefore:`key`,value:e.key,maxLength:64,placeholder:`流程对象字段名`,onChange:e=>I(t,n,{key:e.target.value})})}),(0,Q.jsx)(ZA,{span:5,children:(0,Q.jsx)(MN,{addonBefore:`label`,value:e.label,maxLength:64,placeholder:`后台显示名称`,onChange:e=>I(t,n,{label:e.target.value})})}),(0,Q.jsx)(ZA,{span:3,children:(0,Q.jsxs)(CM,{children:[`启用`,(0,Q.jsx)(eF,{checked:e.enabled,onChange:e=>I(t,n,{enabled:e})})]})}),(0,Q.jsx)(ZA,{span:3,children:(0,Q.jsxs)(CM,{children:[`编辑`,(0,Q.jsx)(eF,{checked:e.editable,onChange:e=>I(t,n,{editable:e})})]})}),(0,Q.jsx)(ZA,{span:4,children:(0,Q.jsx)(xj,{min:1,max:2e4,value:e.maxLength,addonBefore:`长度`,style:{width:`100%`},onChange:e=>I(t,n,{maxLength:Number(e||800)})})}),(0,Q.jsx)(ZA,{span:3,children:(0,Q.jsx)(MN,{value:String(e.value??``),maxLength:e.maxLength||800,placeholder:`默认值`,onChange:e=>I(t,n,{value:e.target.value})})}),(0,Q.jsx)(ZA,{span:1,style:{textAlign:`right`},children:(0,Q.jsx)(JS,{danger:!0,size:`small`,icon:(0,Q.jsx)(vR,{}),onClick:()=>L(t,n)})})]},`flow-${t}-${n}`))})]}),e.type!==`object`&&e.type!==`flow`&&(0,Q.jsx)(OA,{size:`small`,title:`默认值`,children:(0,Q.jsx)(p9,{rows:3,value:Array.isArray(e.value)?e.value.join(` `):String(e.value??``),maxLength:e.maxLength||1e3,showCount:!0,onChange:n=>A(t,{value:e.type===`array`?n.target.value.split(` -`).filter(Boolean):n.target.value})})})]})})),[v]);return e||!c?(0,Q.jsx)(rP,{}):(0,Q.jsxs)(`div`,{style:{padding:24},children:[(0,Q.jsx)(OA,{children:(0,Q.jsxs)(CM,{direction:`vertical`,style:{width:`100%`},size:`large`,children:[(0,Q.jsxs)(FP,{justify:`space-between`,align:`middle`,children:[(0,Q.jsxs)(ZA,{children:[(0,Q.jsx)(IWe,{level:3,style:{margin:0},children:`视频提词 Schema 配置`}),(0,Q.jsx)(LWe,{type:`secondary`,style:{marginBottom:0},children:`配置会被爆款开头复刻和拆镜复刻第 4 步视频 AI 提词共同复用。传给 AI 时只保留纯键值 schema,不携带显示名、启用、可编辑等管理字段。`})]}),(0,Q.jsx)(ZA,{children:(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(f9,{children:`启用自定义配置`}),(0,Q.jsx)(eF,{checked:i,onChange:a}),o&&(0,Q.jsx)(hR,{color:`orange`,children:`当前使用默认配置兜底`}),u&&(0,Q.jsxs)(hR,{children:[`默认分组 `,u.sections.length]})]})})]}),(0,Q.jsx)(cf,{type:`info`,showIcon:!0,message:`长度限制策略`,description:`只对管理后台字段和用户可编辑字段做长度校验,不会自动裁剪 AI 生成结果或第 5 步最终视频 prompt。若供应商因为 prompt 过长拒绝,会按真实失败进入现有日志/退款/重试流程。`}),(0,Q.jsx)(cf,{type:`warning`,showIcon:!0,message:`预览说明`,description:`预览会跟随右上角「启用自定义配置」开关。关闭时会按默认 CLIENT_SCHEMA_V1 兜底预览;打开后才会按当前页面编辑的 sections 和秒数切片规则预览。`}),(0,Q.jsxs)(CM,{wrap:!0,children:[(0,Q.jsx)(JS,{type:`primary`,icon:(0,Q.jsx)(z2,{}),loading:n,onClick:S,children:`保存配置`}),(0,Q.jsx)(JS,{icon:(0,Q.jsx)(CN,{}),onClick:D,children:`预览运行时 Schema`}),(0,Q.jsx)(JS,{icon:(0,Q.jsx)(rB,{}),onClick:T,children:`导出 JSON`}),(0,Q.jsx)(JS,{icon:(0,Q.jsx)(k6,{}),onClick:()=>_.current?.click(),children:`导入 JSON`}),(0,Q.jsx)(yP,{title:`确认恢复默认配置?`,description:`会用 CLIENT_SCHEMA_V1 生成的默认配置覆盖当前配置。`,onConfirm:w,children:(0,Q.jsx)(JS,{icon:(0,Q.jsx)(MP,{}),children:`恢复默认`})}),(0,Q.jsx)(`input`,{ref:_,type:`file`,accept:`application/json,.json`,style:{display:`none`},onChange:E})]}),(0,Q.jsx)(EA,{items:[{key:`fields`,label:`Schema 字段配置`,children:(0,Q.jsxs)(CM,{direction:`vertical`,style:{width:`100%`},size:`middle`,children:[(0,Q.jsx)(cf,{type:`warning`,showIcon:!0,message:`字段说明`,description:`key 是最终传给 AI 和保存到 prompt_schema 的真实字段名,例如「素材理解」「动作流程」;label 只用于管理后台显示,帮助运营/管理员理解这个字段,不会传给 AI;启用关闭后该字段不会进入运行时 schema;可编辑关闭后用户在第 4 步修改时不能改这个字段。「画面属性」里的视频时长、视频比例、清晰度、帧率、推荐分辨率属于系统锁定参数,不能改 key、不能禁用、不能开放用户编辑。`}),(0,Q.jsx)(JS,{icon:(0,Q.jsx)(rA,{}),onClick:k,children:`新增一级分组`}),(0,Q.jsx)(Hh,{items:W})]})},{key:`time`,label:`秒数切片规则`,children:(0,Q.jsxs)(CM,{direction:`vertical`,style:{width:`100%`},size:`middle`,children:[(0,Q.jsx)(cf,{type:`info`,showIcon:!0,message:`切片规则说明`,description:`这里决定指定视频时长会被拆成几段,以及每段的阶段名称和说明。运行时会同步生成「动态时间规划」「动作流程」「镜头流程」三个数组,三者时间段保持一致。`}),(0,Q.jsx)(JS,{icon:(0,Q.jsx)(rA,{}),onClick:R,children:`新增秒数规则`}),y.map((e,t)=>(0,Q.jsxs)(OA,{size:`small`,title:`${e.minDuration}-${e.maxDuration} 秒:${e.segments.length} 段`,extra:(0,Q.jsx)(JS,{danger:!0,size:`small`,icon:(0,Q.jsx)(vR,{}),onClick:()=>B(t),children:`删除规则`}),children:[(0,Q.jsxs)(FP,{gutter:12,style:{marginBottom:12},children:[(0,Q.jsx)(ZA,{span:4,children:(0,Q.jsx)(xj,{min:1,value:e.minDuration,addonBefore:`最小秒`,style:{width:`100%`},onChange:e=>z(t,{minDuration:Number(e||1)})})}),(0,Q.jsx)(ZA,{span:4,children:(0,Q.jsx)(xj,{min:1,value:e.maxDuration,addonBefore:`最大秒`,style:{width:`100%`},onChange:e=>z(t,{maxDuration:Number(e||1)})})}),(0,Q.jsx)(ZA,{span:16,children:(0,Q.jsx)(JS,{size:`small`,icon:(0,Q.jsx)(rA,{}),onClick:()=>H(t),children:`新增片段`})})]}),(0,Q.jsx)(CM,{direction:`vertical`,style:{width:`100%`},children:e.segments.map((n,r)=>(0,Q.jsxs)(FP,{gutter:8,align:`middle`,children:[(0,Q.jsx)(ZA,{span:3,children:(0,Q.jsx)(xj,{min:.01,step:.01,value:e.ratios[r],addonBefore:`比例`,style:{width:`100%`},onChange:e=>V(t,r,{ratio:Number(e||.01)})})}),(0,Q.jsx)(ZA,{span:5,children:(0,Q.jsx)(MN,{value:n.stage,maxLength:64,placeholder:`阶段`,onChange:e=>V(t,r,{stage:e.target.value})})}),(0,Q.jsx)(ZA,{span:15,children:(0,Q.jsx)(MN,{value:n.description,maxLength:300,placeholder:`说明`,onChange:e=>V(t,r,{description:e.target.value})})}),(0,Q.jsx)(ZA,{span:1,children:(0,Q.jsx)(JS,{danger:!0,size:`small`,icon:(0,Q.jsx)(vR,{}),onClick:()=>U(t,r)})})]},r))})]},t))]})},{key:`json`,label:`JSON 高级查看`,children:(0,Q.jsx)(p9,{rows:24,value:JSON.stringify(S9(c,i),null,2),readOnly:!0})}]})]})}),(0,Q.jsxs)(gP,{title:`预览运行时 Schema`,open:f,onCancel:()=>p(!1),width:980,footer:(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(JS,{onClick:()=>p(!1),children:`关闭`}),(0,Q.jsx)(JS,{type:`primary`,onClick:O,children:`生成预览`})]}),children:[(0,Q.jsxs)(X,{form:g,layout:`inline`,style:{marginBottom:16},children:[(0,Q.jsx)(X.Item,{name:`duration`,label:`时长`,rules:[{required:!0}],children:(0,Q.jsx)(xj,{min:1,max:3600})}),(0,Q.jsx)(X.Item,{name:`aspectRatio`,label:`比例`,rules:[{required:!0}],children:(0,Q.jsx)(MN,{})}),(0,Q.jsx)(X.Item,{name:`resolution`,label:`清晰度`,rules:[{required:!0}],children:(0,Q.jsx)(MN,{})}),(0,Q.jsx)(X.Item,{name:`frameRate`,label:`帧率`,rules:[{required:!0}],children:(0,Q.jsx)(MN,{})})]}),(0,Q.jsx)(yue,{}),m?(0,Q.jsx)(EA,{items:[{key:`runtime`,label:`运行时 Schema`,children:(0,Q.jsx)(p9,{rows:24,value:JSON.stringify(C9(m),null,2),readOnly:!0})},{key:`timePlan`,label:`动态时间规划(${w9(m).length} 段)`,children:(0,Q.jsx)(p9,{rows:24,value:JSON.stringify(w9(m),null,2),readOnly:!0})},{key:`snapshot`,label:`配置快照`,children:(0,Q.jsx)(p9,{rows:24,value:JSON.stringify(HWe(m),null,2),readOnly:!0})}]}):(0,Q.jsx)(cf,{type:`info`,showIcon:!0,message:`点击生成预览后,可以看到传给 AI 的纯 schema、动态时间规划和本次配置快照。`})]})]})},{Title:KWe,Text:E9,Paragraph:qWe}=Z,JWe=[{key:`local_ffmpeg_crop_v1`,label:`本地 FFmpeg(crop)`},{key:`volc_standard_v1`,label:`火山画质增强(标准版)`},{key:`volc_professional_v1`,label:`火山画质增强(专业版)`},{key:`volc_large_model_v1`,label:`火山画质增强(大模型)`}],D9=[`480p`,`720p`,`1080p`,`2K`,`4K`].map(e=>({label:e,value:e})),YWe=()=>({targetResolution:`1080p`,providerGenerationResolution:`720p`,processorKey:`local_ffmpeg_crop_v1`,enabled:!0});function O9(e){return{enabled:!!e.enabled,version:Number(e.version||1),deleteSourceAfterSuccess:e.deleteSourceAfterSuccess!==!1,rules:Array.isArray(e.rules)?e.rules.map(e=>({...e})):[]}}function XWe(e){return{data:{enabled:e.enabled,version:e.version,delete_source_after_success:e.deleteSourceAfterSuccess,rules:e.rules.map(e=>({target_resolution:e.targetResolution,provider_generation_resolution:e.providerGenerationResolution,processor_key:e.processorKey,enabled:e.enabled}))}}}var ZWe=()=>{let{message:e,modal:t}=Lv.useApp(),[n,r]=(0,C.useState)(!0),[i,a]=(0,C.useState)(!1),[o,s]=(0,C.useState)(null),c=(0,C.useCallback)(async()=>{r(!0);try{s(O9((await MBe()).data))}catch(t){e.error(t instanceof Error?t.message:`读取视频超分配置失败`)}finally{r(!1)}},[e]);(0,C.useEffect)(()=>{c()},[c]);let l=(e,t)=>{s(n=>n&&{...n,rules:n.rules.map((n,r)=>r===e?{...n,...t}:n)})},u=e=>{s(t=>t&&{...t,rules:t.rules.filter((t,n)=>n!==e)})},d=()=>{s(e=>e&&{...e,rules:[...e.rules,YWe()]})},f=async()=>{if(!o)return;let t=o.rules.filter(e=>e.enabled).map(e=>e.targetResolution.trim().toLowerCase());if(new Set(t).size!==t.length){e.error(`同一个客户目标分辨率只能存在一条启用规则`);return}a(!0);try{let t=await NBe(XWe(o));s(O9(t.data)),e.success(`视频超分配置已保存,版本 ${t.data.version}`)}catch(t){e.error(t instanceof Error?t.message:`保存失败`)}finally{a(!1)}};return n||!o?(0,Q.jsx)(`div`,{style:{minHeight:360,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,Q.jsx)(rP,{size:`large`})}):(0,Q.jsxs)(CM,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Q.jsxs)(OA,{children:[(0,Q.jsxs)(FP,{justify:`space-between`,align:`middle`,gutter:[16,16],children:[(0,Q.jsxs)(ZA,{children:[(0,Q.jsx)(KWe,{level:3,style:{margin:0},children:`视频超分配置`}),(0,Q.jsx)(qWe,{type:`secondary`,style:{margin:`8px 0 0`},children:`规则只按客户选择的目标分辨率匹配。视频比例和最终像素由客户任务参数在创建任务时自动计算并固化快照。`})]}),(0,Q.jsx)(ZA,{children:(0,Q.jsxs)(CM,{children:[(0,Q.jsxs)(hR,{children:[`配置版本 `,o.version]}),(0,Q.jsx)(JS,{icon:(0,Q.jsx)(MP,{}),onClick:()=>void c(),children:`重新加载`}),(0,Q.jsx)(JS,{type:`primary`,icon:(0,Q.jsx)(z2,{}),loading:i,onClick:()=>void f(),children:`保存配置`})]})})]}),(0,Q.jsxs)(CM,{direction:`vertical`,size:14,style:{marginTop:20},children:[(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(E9,{strong:!0,children:`全局开启超分`}),(0,Q.jsx)(eF,{checked:o.enabled,onChange:e=>s({...o,enabled:e})}),(0,Q.jsx)(E9,{type:`secondary`,children:`关闭后新任务走原流程,已经创建的任务仍按自身快照执行。`})]}),(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(E9,{strong:!0,children:`超分成功后删除源视频`}),(0,Q.jsx)(eF,{checked:o.deleteSourceAfterSuccess,onChange:e=>s({...o,deleteSourceAfterSuccess:e})}),(0,Q.jsx)(E9,{type:`secondary`,children:`默认开启。关闭仅用于调试,会保留超分前源视频并持续占用服务器磁盘;超分失败时始终保留源视频。`})]})]})]}),(0,Q.jsx)(OA,{title:`目标分辨率规则`,extra:(0,Q.jsx)(JS,{icon:(0,Q.jsx)(rA,{}),onClick:d,children:`新增规则`}),children:o.rules.length===0?(0,Q.jsx)(Wy,{description:`暂无规则;未匹配规则的视频任务继续走原流程`}):(0,Q.jsx)(CM,{direction:`vertical`,size:12,style:{width:`100%`},children:o.rules.map((e,n)=>{let r=e.enabled&&o.rules.filter(t=>t.enabled&&t.targetResolution.toLowerCase()===e.targetResolution.toLowerCase()).length>1;return(0,Q.jsx)(OA,{size:`small`,children:(0,Q.jsxs)(FP,{gutter:[12,12],align:`bottom`,children:[(0,Q.jsxs)(ZA,{xs:24,md:5,children:[(0,Q.jsx)(E9,{type:`secondary`,children:`客户选择分辨率`}),(0,Q.jsx)(bb,{value:e.targetResolution,options:D9,style:{width:`100%`,marginTop:4},onChange:e=>l(n,{targetResolution:e}),status:r?`error`:void 0})]}),(0,Q.jsxs)(ZA,{xs:24,md:5,children:[(0,Q.jsx)(E9,{type:`secondary`,children:`实际生成分辨率`}),(0,Q.jsx)(bb,{value:e.providerGenerationResolution,options:D9,style:{width:`100%`,marginTop:4},onChange:e=>l(n,{providerGenerationResolution:e})})]}),(0,Q.jsxs)(ZA,{xs:24,md:7,children:[(0,Q.jsx)(E9,{type:`secondary`,children:`处理方式`}),(0,Q.jsx)(bb,{value:e.processorKey,options:JWe.map(e=>({value:e.key,label:e.label})),style:{width:`100%`,marginTop:4},onChange:e=>l(n,{processorKey:e})})]}),(0,Q.jsxs)(ZA,{xs:12,md:2,children:[(0,Q.jsx)(E9,{type:`secondary`,children:`启用`}),(0,Q.jsx)(`div`,{style:{marginTop:8},children:(0,Q.jsx)(eF,{checked:e.enabled,onChange:e=>l(n,{enabled:e})})})]}),(0,Q.jsx)(ZA,{xs:12,md:2,children:(0,Q.jsx)(JS,{danger:!0,icon:(0,Q.jsx)(vR,{}),onClick:()=>t.confirm({title:`删除这条超分规则?`,onOk:()=>u(n)})})}),(0,Q.jsx)(ZA,{span:24,children:(0,Q.jsx)(E9,{type:`secondary`,children:`客户选择该目标分辨率时,无论横屏、竖屏或方形比例,都按本规则选择的实际分辨率生成;最终像素由任务比例自动计算。`})})]})},`${n}-${e.targetResolution}`)})})})]})},QWe=()=>{let[e,t]=(0,C.useState)([]),[n,r]=(0,C.useState)(0),[i,a]=(0,C.useState)(!1),[o,s]=(0,C.useState)(1),[c,l]=(0,C.useState)(10),[u,d]=(0,C.useState)(null),[f,p]=(0,C.useState)(null),[m,h]=(0,C.useState)(!1),{user:g}=v5(),_=async()=>{if(g?.isAdmin){a(!0);try{let e=new URLSearchParams;e.set(`page`,String(o)),e.set(`page_size`,String(c)),u!==null&&e.set(`is_handled`,String(u));let n=await G8.get(`/contact/requests?${e.toString()}`);t(n.items),r(n.total)}catch(e){mP.error(e?.message||`获取失败`)}finally{a(!1)}}};(0,C.useEffect)(()=>{_()},[o,c,u]);let v=async e=>{try{await G8.put(`/contact/requests/${e}/handle`),mP.success(`已标记为处理`),_()}catch(e){mP.error(e?.message||`操作失败`)}},y=async e=>{try{await G8.delete(`/contact/requests/${e}`),mP.success(`已删除`),_()}catch(e){mP.error(e?.message||`删除失败`)}},b=e=>{p(e),h(!0)};return(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(OA,{variant:`outlined`,style:{borderRadius:12,border:`1px solid #f0f0f5`},children:[(0,Q.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,marginBottom:16},children:[(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(Y$,{style:{fontSize:18,color:`#6366f1`}}),(0,Q.jsx)(Z.Text,{strong:!0,style:{fontSize:16},children:`联系请求管理`}),(0,Q.jsxs)(hR,{color:`purple`,children:[`共 `,n,` 条记录`]})]}),(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,Q.jsx)(JS,{type:u===null?`primary`:`default`,onClick:()=>d(null),icon:(0,Q.jsx)(PX,{}),size:`small`,children:`全部`}),(0,Q.jsx)(JS,{type:u===!1?`primary`:`default`,onClick:()=>d(!1),size:`small`,children:`待处理`}),(0,Q.jsx)(JS,{type:u===!0?`primary`:`default`,onClick:()=>d(!0),size:`small`,children:`已处理`})]})]}),i?(0,Q.jsx)(`div`,{style:{textAlign:`center`,padding:40},children:`加载中...`}):e.length===0?(0,Q.jsx)(Wy,{description:`暂无联系请求`,style:{padding:`40px 0`}}):(0,Q.jsx)(nR,{columns:[{title:`姓名`,dataIndex:`name`,key:`name`,width:100,render:e=>(0,Q.jsx)(Z.Text,{strong:!0,children:e})},{title:`手机号`,dataIndex:`phone`,key:`phone`,width:120},{title:`公司名称`,dataIndex:`companyName`,key:`companyName`,width:150,ellipsis:!0},{title:`行业`,dataIndex:`industry`,key:`industry`,width:120},{title:`状态`,dataIndex:`isHandled`,key:`isHandled`,width:80,render:e=>(0,Q.jsx)(hR,{color:e?`green`:`orange`,children:e?`已处理`:`待处理`})},{title:`提交时间`,dataIndex:`createdAt`,key:`createdAt`,width:160,render:e=>C5(e)},{title:`操作`,key:`actions`,width:180,render:(e,t)=>(0,Q.jsxs)(CM,{size:4,children:[(0,Q.jsx)(JS,{type:`link`,size:`small`,icon:(0,Q.jsx)(CN,{}),onClick:()=>b(t),children:`查看`}),!t.isHandled&&(0,Q.jsx)(JS,{type:`link`,size:`small`,icon:(0,Q.jsx)(lb,{}),onClick:()=>v(t.id),children:`标记处理`}),(0,Q.jsx)(yP,{title:`确定删除该记录?`,onConfirm:()=>y(t.id),children:(0,Q.jsx)(JS,{type:`link`,danger:!0,size:`small`,icon:(0,Q.jsx)(vR,{}),children:`删除`})})]})}],dataSource:e,rowKey:`id`,loading:i,pagination:{current:o,pageSize:c,total:n,onChange:(e,t)=>{s(e),l(t)},showSizeChanger:!0,showTotal:e=>`共 ${e} 条记录`},scroll:{x:900}})]}),(0,Q.jsx)(gP,{title:(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(CN,{}),`联系请求详情`]}),open:m,onCancel:()=>h(!1),footer:null,width:500,children:f&&(0,Q.jsxs)(`div`,{style:{padding:8},children:[(0,Q.jsxs)(`div`,{style:{marginBottom:16},children:[(0,Q.jsxs)(Z.Title,{level:4,style:{marginBottom:16},children:[f.name,(0,Q.jsx)(hR,{color:f.isHandled?`green`:`orange`,style:{marginLeft:12},children:f.isHandled?`已处理`:`待处理`})]}),(0,Q.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`120px 1fr`,gap:12},children:[(0,Q.jsx)(Z.Text,{style:{color:`#64748b`},children:`手机号:`}),(0,Q.jsx)(Z.Text,{children:f.phone}),(0,Q.jsx)(Z.Text,{style:{color:`#64748b`},children:`公司名称:`}),(0,Q.jsx)(Z.Text,{children:f.companyName}),(0,Q.jsx)(Z.Text,{style:{color:`#64748b`},children:`行业:`}),(0,Q.jsx)(Z.Text,{children:f.industry}),(0,Q.jsx)(Z.Text,{style:{color:`#64748b`},children:`提交时间:`}),(0,Q.jsx)(Z.Text,{children:C5(f.createdAt)}),f.message&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Z.Text,{style:{color:`#64748b`},children:`留言:`}),(0,Q.jsx)(Z.Text,{children:f.message})]})]})]}),(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:12},children:[!f.isHandled&&(0,Q.jsx)(JS,{type:`primary`,onClick:()=>{v(f.id),h(!1)},icon:(0,Q.jsx)(lb,{}),children:`标记为已处理`}),(0,Q.jsx)(JS,{onClick:()=>h(!1),children:`关闭`})]})]})})]})},k9=`http://ceshi.apiforeign.minzhong.cn`.replace(/\/$/,``).replace(/\/api\/?$/i,``).replace(/\/$/,``),$We=e=>/^(https?:)?\/\//i.test(e)||/^(blob|data):/i.test(e),A9=e=>{if(!e)return``;let t=String(e).trim();return t?$We(t)?t:k9?`${k9}${t.startsWith(`/`)?t:`/${t}`}`:t.startsWith(`/`)?t:`/${t}`:``},eGe=360,j9=280;function M9(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,e)):t}function tGe(e,t){let n=Math.max(0,e);if(!n)return{width:0,height:j9};if(!t?.width||!t?.height)return{width:n,height:j9};let r=Math.min(n/t.width,eGe/t.height);return{width:Math.max(1,Math.round(t.width*r)),height:Math.max(1,Math.round(t.height*r))}}function nGe(e,t){if(e.sizeMode===`px`&&e.widthPx)return M9(e.widthPx,1,Math.max(1,t));let n=M9(e.widthRatio??.18,.01,1);return Math.max(1,t*n)}function rGe(e){let t=e.marginX??24,n=e.marginY??24;switch(e.position){case`top_left`:return{left:t,top:n};case`top_center`:return{left:`50%`,top:n,transform:`translateX(-50%)`};case`top_right`:return{right:t,top:n};case`middle_left`:return{left:t,top:`50%`,transform:`translateY(-50%)`};case`center`:return{left:`50%`,top:`50%`,transform:`translate(-50%, -50%)`};case`middle_right`:return{right:t,top:`50%`,transform:`translateY(-50%)`};case`bottom_left`:return{left:t,bottom:n};case`bottom_center`:return{left:`50%`,bottom:n,transform:`translateX(-50%)`};default:return{right:t,bottom:n}}}function iGe(e){let t=e.textWatermark;return!t||!t.text?.trim()?null:{text:t.text.trim(),opacity_level:t.opacityLevel,font_size_px:t.fontSizePx,color:t.color,rotate_deg:t.rotateDeg,gap_x:t.gapX,gap_y:t.gapY,staggered:t.staggered}}var aGe=({mediaUrl:e,mediaType:t=`image`,watermarkUrl:n,config:r,onChange:i})=>{let a=(0,C.useRef)(null),o=(0,C.useRef)(null),s=(0,C.useRef)(null),c=(0,C.useRef)({x:0,y:0}),l=(0,C.useRef)(0),[u,d]=(0,C.useState)(0),[f,p]=(0,C.useState)(null),[m,h]=(0,C.useState)({width:0,height:0}),[g,_]=(0,C.useState)(!1),[v,y]=(0,C.useState)(``),[b,x]=(0,C.useState)(!1),[S,w]=(0,C.useState)(``),T=(0,C.useMemo)(()=>A9(e),[e]),E=(0,C.useMemo)(()=>A9(n),[n]),D=(0,C.useMemo)(()=>tGe(u,f),[u,f]),O=(0,C.useMemo)(()=>nGe(r,D.width),[r,D.width]),k=r.watermarkType===`repeated_text`;(0,C.useLayoutEffect)(()=>{if(!a.current)return;let e=()=>d(a.current?.clientWidth||0);e();let t=new ResizeObserver(e);return t.observe(a.current),()=>t.disconnect()},[]),(0,C.useLayoutEffect)(()=>{if(!s.current)return;let e=()=>{let e=s.current?.getBoundingClientRect();e&&h({width:e.width,height:e.height})};e();let t=new ResizeObserver(e);return t.observe(s.current),()=>t.disconnect()},[E,O]),(0,C.useEffect)(()=>{p(null),y(``),w(``)},[T,t]),(0,C.useEffect)(()=>{if(!k){y(``),x(!1),w(``);return}let e=iGe(r);if(!f?.width||!f.height||!e){y(``);return}let t=++l.current;x(!0),w(``);let n=window.setTimeout(async()=>{try{let n=await gHe({width:f.width,height:f.height,text_watermark:e});l.current===t&&y(n.previewLayerDataUrl)}catch(e){l.current===t&&(y(``),w(e instanceof Error?e.message:`文字水印预览生成失败`))}finally{l.current===t&&x(!1)}},300);return()=>window.clearTimeout(n)},[r,k,f]),(0,C.useEffect)(()=>{let e=e=>{if(!g||!o.current||!i||k)return;let t=o.current.getBoundingClientRect(),n=m.width||O,r=m.height||1,a=Math.max(1,t.width-n),s=Math.max(1,t.height-r),l=M9(e.clientX-t.left-c.current.x,0,a),u=M9(e.clientY-t.top-c.current.y,0,s);i({position:`custom`,customXRatio:Number((l/a).toFixed(4)),customYRatio:Number((u/s).toFixed(4))})},t=()=>_(!1);return window.addEventListener(`pointermove`,e),window.addEventListener(`pointerup`,t),window.addEventListener(`pointercancel`,t),()=>{window.removeEventListener(`pointermove`,e),window.removeEventListener(`pointerup`,t),window.removeEventListener(`pointercancel`,t)}},[g,k,i,m.height,m.width,O]);let A=(0,C.useMemo)(()=>{if(r.position!==`custom`)return rGe(r);let e=m.width||O,t=m.height||1,n=Math.max(0,D.width-e),i=Math.max(0,D.height-t),a=M9(r.customXRatio??.5,0,1),o=M9(r.customYRatio??.5,0,1);return{left:n*a,top:i*o,transform:`none`}},[r,D.height,D.width,m.height,m.width,O]);return(0,Q.jsx)(`div`,{ref:a,style:{position:`relative`,width:`100%`,minHeight:Math.max(j9,D.height),background:`#0f172a`,borderRadius:12,overflow:`hidden`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`},children:T?(0,Q.jsxs)(`div`,{ref:o,style:{position:`relative`,width:D.width||`100%`,height:D.height||j9,maxWidth:`100%`,overflow:`hidden`,background:`#000`},children:[t===`video`?(0,Q.jsx)(`video`,{src:T,controls:!0,onLoadedMetadata:e=>{let t=e.currentTarget;t.videoWidth&&t.videoHeight&&p({width:t.videoWidth,height:t.videoHeight})},style:{width:`100%`,height:`100%`,objectFit:`fill`,display:`block`}}):(0,Q.jsx)(`img`,{src:T,alt:`素材预览`,onLoad:e=>{let t=e.currentTarget;t.naturalWidth&&t.naturalHeight&&p({width:t.naturalWidth,height:t.naturalHeight})},style:{width:`100%`,height:`100%`,objectFit:`fill`,display:`block`}}),k&&v&&(0,Q.jsx)(`img`,{src:v,alt:`重复文字水印预览`,draggable:!1,style:{position:`absolute`,inset:0,width:`100%`,height:`100%`,objectFit:`fill`,zIndex:2,pointerEvents:`none`,userSelect:`none`}}),k&&(b||S)&&(0,Q.jsx)(`div`,{style:{position:`absolute`,left:12,bottom:12,zIndex:3,padding:`6px 10px`,borderRadius:8,background:`rgba(15, 23, 42, 0.82)`,color:`#e2e8f0`,fontSize:12},children:b?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(rP,{size:`small`}),` 正在生成精准预览...`]}):S}),!k&&E&&(0,Q.jsx)(`img`,{ref:s,src:E,alt:`水印预览`,draggable:!1,onLoad:e=>{let t=e.currentTarget.getBoundingClientRect();h({width:t.width,height:t.height})},onPointerDown:e=>{if(!i)return;e.preventDefault();let t=e.currentTarget.getBoundingClientRect();c.current={x:e.clientX-t.left,y:e.clientY-t.top},_(!0)},style:{position:`absolute`,zIndex:2,cursor:i?`move`:`default`,width:O,opacity:(r.opacityLevel??6)/10,userSelect:`none`,touchAction:`none`,pointerEvents:i?`auto`:`none`,...A}})]}):(0,Q.jsx)(`span`,{children:`上传素材后可预览水印效果`})})},oGe=[{label:`左上角`,value:`top_left`},{label:`顶部居中`,value:`top_center`},{label:`右上角`,value:`top_right`},{label:`左侧居中`,value:`middle_left`},{label:`正中间`,value:`center`},{label:`右侧居中`,value:`middle_right`},{label:`左下角`,value:`bottom_left`},{label:`底部居中`,value:`bottom_center`},{label:`右下角`,value:`bottom_right`},{label:`拖拽自定义`,value:`custom`}],N9={text:`民众智创`,opacityLevel:2,fontSizePx:28,color:`#ffffff`,rotateDeg:-30,gapX:220,gapY:140,staggered:!0},P9=({value:e,onChange:t,watermarks:n,mediaUrl:r,mediaType:i})=>{let a=n=>t({...e,...n}),o=t=>{a({textWatermark:{...N9,...e.textWatermark||{},...t}})},s=n.find(t=>t.id===e.watermarkId)?.fileUrl,c={...N9,...e.textWatermark||{}};return(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(X,{layout:`vertical`,children:[(0,Q.jsx)(X.Item,{label:`水印类型`,required:!0,children:(0,Q.jsxs)(jk.Group,{value:e.watermarkType||`image`,onChange:e=>{let t=e.target.value;a({watermarkType:t,textWatermark:t===`repeated_text`?c:null})},children:[(0,Q.jsx)(jk.Button,{value:`image`,children:`图片水印`}),(0,Q.jsx)(jk.Button,{value:`repeated_text`,children:`重复文字水印`})]})}),e.watermarkType===`repeated_text`?(0,Q.jsxs)(FP,{gutter:16,children:[(0,Q.jsx)(ZA,{span:24,children:(0,Q.jsx)(X.Item,{label:`水印文字`,required:!0,extra:`字体由后端固定开源可商用字体渲染,前端预览层和最终生成使用同一后端渲染逻辑。`,children:(0,Q.jsx)(MN,{maxLength:64,showCount:!0,value:c.text,onChange:e=>o({text:e.target.value}),placeholder:`请输入重复水印文字`})})}),(0,Q.jsx)(ZA,{span:12,children:(0,Q.jsx)(X.Item,{label:`文字透明度:${c.opacityLevel}/10`,required:!0,children:(0,Q.jsx)(Uj,{min:1,max:10,step:1,value:c.opacityLevel,onChange:e=>o({opacityLevel:e})})})}),(0,Q.jsx)(ZA,{span:12,children:(0,Q.jsx)(X.Item,{label:`字号(px)`,required:!0,children:(0,Q.jsx)(xj,{min:8,max:160,style:{width:`100%`},value:c.fontSizePx,onChange:e=>o({fontSizePx:Number(e||28)})})})}),(0,Q.jsx)(ZA,{span:12,children:(0,Q.jsx)(X.Item,{label:`文字颜色`,required:!0,children:(0,Q.jsx)(MN,{value:c.color,onChange:e=>o({color:e.target.value||`#ffffff`}),placeholder:`#ffffff`})})}),(0,Q.jsx)(ZA,{span:12,children:(0,Q.jsx)(X.Item,{label:`旋转角度`,required:!0,children:(0,Q.jsx)(xj,{min:-90,max:90,style:{width:`100%`},value:c.rotateDeg,onChange:e=>o({rotateDeg:Number(e??-30)})})})}),(0,Q.jsx)(ZA,{span:12,children:(0,Q.jsx)(X.Item,{label:`横向间距`,required:!0,children:(0,Q.jsx)(xj,{min:20,max:2e3,style:{width:`100%`},value:c.gapX,onChange:e=>o({gapX:Number(e||220)})})})}),(0,Q.jsx)(ZA,{span:12,children:(0,Q.jsx)(X.Item,{label:`纵向间距`,required:!0,children:(0,Q.jsx)(xj,{min:20,max:2e3,style:{width:`100%`},value:c.gapY,onChange:e=>o({gapY:Number(e||140)})})})}),(0,Q.jsx)(ZA,{span:12,children:(0,Q.jsx)(X.Item,{label:`交错排列`,valuePropName:`checked`,children:(0,Q.jsx)(eF,{checked:c.staggered,onChange:e=>o({staggered:e})})})})]}):(0,Q.jsxs)(FP,{gutter:16,children:[(0,Q.jsx)(ZA,{span:12,children:(0,Q.jsx)(X.Item,{label:`水印图片`,required:!0,children:(0,Q.jsx)(bb,{placeholder:`请选择水印`,value:e.watermarkId||void 0,onChange:e=>a({watermarkId:e}),options:n.map(e=>({label:`${e.name}${e.isDefault?`(默认)`:``}`,value:e.id}))})})}),(0,Q.jsx)(ZA,{span:12,children:(0,Q.jsx)(X.Item,{label:`透明度:${e.opacityLevel}/10`,required:!0,children:(0,Q.jsx)(Uj,{min:1,max:10,step:1,value:e.opacityLevel,onChange:e=>a({opacityLevel:e})})})}),(0,Q.jsx)(ZA,{span:12,children:(0,Q.jsx)(X.Item,{label:`水印位置`,required:!0,children:(0,Q.jsx)(bb,{value:e.position,onChange:e=>a({position:e}),options:oGe})})}),(0,Q.jsx)(ZA,{span:12,children:(0,Q.jsx)(X.Item,{label:`大小模式`,required:!0,children:(0,Q.jsx)(bb,{value:e.sizeMode,onChange:e=>a({sizeMode:e}),options:[{label:`按素材宽度比例`,value:`ratio`},{label:`固定像素宽度`,value:`px`}]})})}),e.sizeMode===`ratio`?(0,Q.jsx)(ZA,{span:12,children:(0,Q.jsx)(X.Item,{label:`水印宽度比例`,required:!0,children:(0,Q.jsx)(xj,{min:.01,max:1,step:.01,style:{width:`100%`},value:e.widthRatio??.18,onChange:e=>a({widthRatio:Number(e||.18)})})})}):(0,Q.jsx)(ZA,{span:12,children:(0,Q.jsx)(X.Item,{label:`水印宽度(px)`,required:!0,children:(0,Q.jsx)(xj,{min:1,max:1e4,style:{width:`100%`},value:e.widthPx??200,onChange:e=>a({widthPx:Number(e||200)})})})}),(0,Q.jsx)(ZA,{span:6,children:(0,Q.jsx)(X.Item,{label:`横向边距`,children:(0,Q.jsx)(xj,{min:0,max:2e3,style:{width:`100%`},value:e.marginX,onChange:e=>a({marginX:Number(e||0)})})})}),(0,Q.jsx)(ZA,{span:6,children:(0,Q.jsx)(X.Item,{label:`纵向边距`,children:(0,Q.jsx)(xj,{min:0,max:2e3,style:{width:`100%`},value:e.marginY,onChange:e=>a({marginY:Number(e||0)})})})})]})]}),(0,Q.jsx)(aGe,{mediaUrl:r,mediaType:i,watermarkUrl:s,config:e,onChange:e=>a(e)})]})},sGe={image:`图片`,video:`视频`,audio:`音频`};function cGe(e){if(e.type.startsWith(`image/`))return`image`;if(e.type.startsWith(`video/`))return`video`;if(e.type.startsWith(`audio/`))return`audio`;let t=e.name.toLowerCase();return/\.(jpg|jpeg|png|webp|gif)$/.test(t)?`image`:/\.(mp4|mov|m4v|webm)$/.test(t)?`video`:/\.(mp3|wav|m4a|aac)$/.test(t)?`audio`:null}function lGe(e,t){return t!==`video`&&t!==`audio`?Promise.resolve(null):new Promise(n=>{let r=URL.createObjectURL(e),i=document.createElement(t===`video`?`video`:`audio`);i.preload=`metadata`,i.onloadedmetadata=()=>{let e=Number.isFinite(i.duration)?Number(i.duration.toFixed(3)):null;URL.revokeObjectURL(r),n(e)},i.onerror=()=>{URL.revokeObjectURL(r),n(null)},i.src=r})}var F9=({value:e,onChange:t,disabled:n})=>{let r=(0,C.useMemo)(()=>e||[],[e]),[i,a]=(0,C.useState)(!1),o=(e,n)=>{t(r.map((t,r)=>r===e?{...t,...n}:t))},s=e=>{t(r.filter((t,n)=>n!==e))},c=async e=>{let n=cGe(e);if(!n||![`image`,`video`,`audio`].includes(n))return mP.warning(`附件仅支持图片、视频、音频`),lB.LIST_IGNORE;a(!0);try{let i=await lGe(e,n),a=(await Q8(e,{scene:`home_material_reference`,resourceType:n,durationSeconds:i})).mediaReference;if(!a||![`image`,`video`,`audio`].includes(a.type))throw Error(`上传返回附件格式异常`);t([...r,{url:a.url,type:a.type,name:a.name||e.name,duration:a.duration??i,source:a.source,uploadResourceId:a.uploadResourceId,displayUrl:a.displayUrl||a.url,previewUrl:a.previewUrl||a.displayUrl||a.url,role:a.role||`reference_${a.type}`}]),mP.success(`附件上传成功`)}catch(e){mP.error(e?.message||`附件上传失败`)}finally{a(!1)}return lB.LIST_IGNORE};return(0,Q.jsxs)(CM,{direction:`vertical`,style:{width:`100%`},size:12,children:[(0,Q.jsx)(lB,{beforeUpload:e=>c(e),showUploadList:!1,disabled:n||i,accept:`image/*,video/*,audio/*`,children:(0,Q.jsx)(JS,{icon:(0,Q.jsx)(k6,{}),loading:i,disabled:n||i,children:`上传附件`})}),r.length===0?(0,Q.jsx)(`div`,{style:{color:`#999`,fontSize:13},children:`暂无附件。可上传图片、视频、音频,保存后会随前台素材接口返回。`}):(0,Q.jsx)(CM,{direction:`vertical`,style:{width:`100%`},size:10,children:r.map((e,t)=>{let r=A9(e.previewUrl||e.displayUrl||e.url),i=A9(e.displayUrl||e.url);return(0,Q.jsx)(OA,{size:`small`,bodyStyle:{padding:12},children:(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:12,alignItems:`flex-start`},children:[(0,Q.jsxs)(`div`,{style:{width:120,minHeight:72,flexShrink:0,borderRadius:8,overflow:`hidden`,background:`#f6f7fb`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:[e.type===`image`&&(0,Q.jsx)(vN,{width:120,height:72,style:{objectFit:`cover`},src:r}),e.type===`video`&&(0,Q.jsx)(`video`,{src:i,style:{width:120,height:72,objectFit:`cover`,background:`#000`},controls:!0}),e.type===`audio`&&(0,Q.jsx)(`audio`,{src:i,controls:!0,style:{width:112}})]}),(0,Q.jsxs)(CM,{direction:`vertical`,style:{flex:1,minWidth:0},size:8,children:[(0,Q.jsxs)(CM,{wrap:!0,children:[(0,Q.jsx)(hR,{color:e.type===`image`?`blue`:e.type===`video`?`purple`:`green`,children:sGe[e.type]||e.type}),e.uploadResourceId&&(0,Q.jsxs)(hR,{children:[`资源ID:`,e.uploadResourceId]})]}),(0,Q.jsx)(MN,{size:`small`,value:e.name||``,placeholder:`附件名称`,disabled:n,onChange:e=>o(t,{name:e.target.value||null})}),(0,Q.jsx)(MN,{size:`small`,value:e.role||``,placeholder:`附件角色,如 reference_image`,disabled:n,onChange:e=>o(t,{role:e.target.value||null})}),(e.type===`video`||e.type===`audio`)&&(0,Q.jsx)(xj,{size:`small`,min:0,precision:3,style:{width:180},value:e.duration??null,placeholder:`时长(秒)`,disabled:n,onChange:e=>o(t,{duration:e===null?null:Number(e)})}),(0,Q.jsx)(MN,{size:`small`,value:e.url,disabled:!0})]}),(0,Q.jsx)(JS,{danger:!0,size:`small`,icon:(0,Q.jsx)(vR,{}),disabled:n,onClick:()=>s(t),children:`删除`})]})},`${e.url}-${t}`)})})]})},I9={draft:{text:`草稿`,color:`default`},processing:{text:`处理中`,color:`processing`},success:{text:`成功`,color:`success`},failed:{text:`失败`,color:`error`}},L9={text:`民众智创`,opacityLevel:2,fontSizePx:28,color:`#ffffff`,rotateDeg:-30,gapX:220,gapY:140,staggered:!0},uGe={watermarkType:`image`,watermarkId:null,opacityLevel:6,position:`bottom_right`,customXRatio:null,customYRatio:null,sizeMode:`ratio`,widthRatio:.18,widthPx:null,marginX:24,marginY:24,textWatermark:L9},dGe={image:`图片`,video:`视频`,audio:`音频`};function fGe(e){return{text:e?.text||L9.text,opacityLevel:e?.opacityLevel??e?.opacity_level??L9.opacityLevel,fontSizePx:e?.fontSizePx??e?.font_size_px??L9.fontSizePx,color:e?.color||L9.color,rotateDeg:e?.rotateDeg??e?.rotate_deg??L9.rotateDeg,gapX:e?.gapX??e?.gap_x??L9.gapX,gapY:e?.gapY??e?.gap_y??L9.gapY,staggered:e?.staggered??L9.staggered}}function R9(e,t){let n=e||{},r=n.watermarkType||n.watermark_type||`image`;return{watermarkType:r,watermarkId:r===`repeated_text`?null:n.watermarkId||n.watermark_id||t||null,opacityLevel:n.opacityLevel||n.opacity_level||6,position:n.position||`bottom_right`,customXRatio:n.customXRatio??n.custom_x_ratio??null,customYRatio:n.customYRatio??n.custom_y_ratio??null,sizeMode:n.sizeMode||n.size_mode||`ratio`,widthRatio:n.widthRatio??n.width_ratio??.18,widthPx:n.widthPx??n.width_px??null,marginX:n.marginX??n.margin_x??24,marginY:n.marginY??n.margin_y??24,textWatermark:fGe(n.textWatermark||n.text_watermark)}}function z9(e){return e.watermarkType===`repeated_text`?!!e.textWatermark?.text?.trim():!!e.watermarkId}function pGe(e,t=48){let n=(e||``).trim();return n?n.length>t?`${n.slice(0,t)}...`:n:``}function mGe(e){let t=e||[];return t.length===0?(0,Q.jsx)(Z.Text,{type:`secondary`,children:`暂无附件`}):(0,Q.jsx)(CM,{direction:`vertical`,style:{width:`100%`},size:12,children:t.map((e,t)=>{let n=A9(e.displayUrl||e.url),r=A9(e.previewUrl||e.displayUrl||e.url);return(0,Q.jsxs)(`div`,{style:{border:`1px solid #f0f0f5`,borderRadius:8,padding:12,display:`flex`,gap:12},children:[(0,Q.jsxs)(`div`,{style:{width:140,minHeight:80,flexShrink:0,background:`#f6f7fb`,borderRadius:8,overflow:`hidden`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:[e.type===`image`&&(0,Q.jsx)(vN,{width:140,height:80,style:{objectFit:`cover`},src:r}),e.type===`video`&&(0,Q.jsx)(`video`,{src:n,controls:!0,style:{width:140,height:80,objectFit:`cover`,background:`#000`}}),e.type===`audio`&&(0,Q.jsx)(`audio`,{src:n,controls:!0,style:{width:132}})]}),(0,Q.jsxs)(CM,{direction:`vertical`,size:6,style:{flex:1,minWidth:0},children:[(0,Q.jsxs)(CM,{wrap:!0,children:[(0,Q.jsx)(hR,{children:dGe[e.type]||e.type}),e.duration!==void 0&&e.duration!==null&&(0,Q.jsxs)(hR,{children:[e.duration,`s`]}),e.role&&(0,Q.jsx)(hR,{children:e.role})]}),(0,Q.jsx)(Z.Text,{strong:!0,children:e.name||`未命名附件`}),(0,Q.jsx)(Z.Text,{copyable:!0,ellipsis:!0,style:{maxWidth:620},children:e.url})]})]},`${e.url}-${t}`)})})}var hGe=({categories:e,watermarks:t,reloadKey:n})=>{let[r,i]=(0,C.useState)([]),[a,o]=(0,C.useState)(0),[s,c]=(0,C.useState)(!1),[l,u]=(0,C.useState)({page:1,pageSize:20}),[d,f]=(0,C.useState)(null),[p,m]=(0,C.useState)(null),[h,g]=(0,C.useState)(uGe),[_,v]=(0,C.useState)(!1),[y,b]=(0,C.useState)(null),[x,S]=(0,C.useState)(``),[w,T]=(0,C.useState)([]),[E,D]=(0,C.useState)(!1),O=async()=>{c(!0);try{let e=await dHe(l);i(e.items),o(e.total)}finally{c(!1)}};(0,C.useEffect)(()=>{O()},[l,n]),(0,C.useEffect)(()=>{let e=r.filter(e=>e.status===`processing`);if(e.length===0)return;let t=window.setInterval(async()=>{(await Promise.all(e.map(e=>fHe(e.id).catch(()=>null)))).some(e=>e&&e.status!==`processing`)&&O()},2500);return()=>window.clearInterval(t)},[r]);let k=e=>{m(e),g(R9(e.watermarkConfig,e.watermarkId))},A=e=>{b(e),S(e.generationPrompt||``),T(e.mediaReferences||[])},j=e=>e.mediaType===`image`?A9(e.watermarkedUrl||e.originalUrl):A9(e.coverUrl||``),M=e=>A9(e.watermarkedUrl||e.originalUrl),N=e=>{gP.confirm({title:`确认删除该素材?`,content:e.title||e.id,okText:`删除`,okButtonProps:{danger:!0},cancelText:`取消`,async onOk(){await vHe(e.id),mP.success(`删除成功`),await O()}})};return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(CM,{style:{marginBottom:16},wrap:!0,children:[(0,Q.jsx)(bb,{allowClear:!0,style:{width:180},placeholder:`行业`,value:l.categoryId,onChange:e=>u(t=>({...t,categoryId:e,page:1})),options:e.map(e=>({label:e.name,value:e.id}))}),(0,Q.jsx)(bb,{allowClear:!0,style:{width:140},placeholder:`素材类型`,value:l.mediaType,onChange:e=>u(t=>({...t,mediaType:e,page:1})),options:[{label:`图片`,value:`image`},{label:`视频`,value:`video`}]}),(0,Q.jsx)(bb,{allowClear:!0,style:{width:140},placeholder:`处理状态`,value:l.status,onChange:e=>u(t=>({...t,status:e,page:1})),options:Object.entries(I9).map(([e,t])=>({value:e,label:t.text}))}),(0,Q.jsx)(JS,{onClick:O,children:`刷新`})]}),(0,Q.jsx)(nR,{rowKey:`id`,loading:s,dataSource:r,pagination:{current:l.page,pageSize:l.pageSize,total:a,onChange:(e,t)=>u(n=>({...n,page:e,pageSize:t}))},scroll:{x:1380},columns:[{title:`预览`,width:110,render:(e,t)=>{let n=j(t);if(t.mediaType===`image`)return n?(0,Q.jsx)(vN,{width:86,height:64,style:{objectFit:`cover`,borderRadius:6},src:n}):`-`;let r=M(t),i=A9(t.coverUrl||``);return r?(0,Q.jsx)(`video`,{src:r,poster:i||void 0,muted:!0,preload:`metadata`,style:{width:100,height:64,objectFit:`cover`,borderRadius:6,background:`#000`}}):`-`}},{title:`标题`,dataIndex:`title`,render:e=>e||(0,Q.jsx)(`span`,{style:{color:`#999`},children:`未命名素材`})},{title:`行业`,dataIndex:`categoryName`},{title:`类型`,dataIndex:`mediaType`,render:e=>e===`image`?`图片`:`视频`},{title:`状态`,dataIndex:`status`,render:e=>(0,Q.jsx)(hR,{color:I9[e]?.color,children:I9[e]?.text||e})},{title:`生成提词`,width:210,render:(e,t)=>t.generationPrompt?(0,Q.jsx)(ux,{title:t.generationPrompt,children:(0,Q.jsx)(Z.Text,{children:pGe(t.generationPrompt)})}):(0,Q.jsx)(Z.Text,{type:`secondary`,children:`未设置`})},{title:`附件`,width:90,render:(e,t)=>(0,Q.jsx)(hR,{color:(t.mediaReferences?.length||0)>0?`blue`:`default`,children:t.mediaReferences?.length||0})},{title:`水印`,render:(e,t)=>R9(t.watermarkConfig,t.watermarkId).watermarkType===`repeated_text`?`重复文字水印`:t.watermarkName||`图片水印`},{title:`排序`,dataIndex:`sortOrder`},{title:`错误`,dataIndex:`errorMessage`,ellipsis:!0},{title:`操作`,width:170,align:`center`,render:(e,t)=>(0,Q.jsxs)(CM,{size:8,children:[(0,Q.jsx)(JS,{size:`small`,onClick:()=>f(t),children:`查看`}),(0,Q.jsx)(TM,{trigger:[`click`],menu:{items:[{key:`generation_config`,icon:(0,Q.jsx)(xR,{}),label:`编辑生成配置`},{key:`regenerate`,icon:(0,Q.jsx)(MP,{}),label:`重新生成水印`},{key:`delete`,icon:(0,Q.jsx)(vR,{}),label:`删除素材`,danger:!0}],onClick:({key:e})=>{e===`generation_config`&&A(t),e===`regenerate`&&k(t),e===`delete`&&N(t)}},children:(0,Q.jsx)(JS,{size:`small`,icon:(0,Q.jsx)(h1,{}),children:`更多`})})]})}]}),(0,Q.jsx)(gP,{title:`素材详情`,open:!!d,onCancel:()=>f(null),footer:null,width:960,destroyOnHidden:!0,children:d&&(0,Q.jsxs)(CM,{direction:`vertical`,style:{width:`100%`},size:`large`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`b`,{children:`原素材:`}),d.originalUrl?A9(d.originalUrl):`-`]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`b`,{children:`水印素材:`}),d.watermarkedUrl?A9(d.watermarkedUrl):`-`]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`b`,{children:`生成提词:`}),(0,Q.jsx)(`div`,{style:{marginTop:8,padding:12,borderRadius:8,background:`#f8fafc`,whiteSpace:`pre-wrap`},children:d.generationPrompt||`未设置`})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`b`,{children:`附件 / 参考素材:`}),(0,Q.jsx)(`div`,{style:{marginTop:8},children:mGe(d.mediaReferences)})]}),d.mediaType===`image`?(0,Q.jsx)(vN,{src:A9(d.watermarkedUrl||d.originalUrl)}):(0,Q.jsx)(`video`,{src:M(d),poster:A9(d.coverUrl||``)||void 0,controls:!0,style:{width:`100%`,background:`#000`}})]})}),(0,Q.jsx)(gP,{title:`编辑生成配置`,open:!!y,onCancel:()=>!E&&b(null),onOk:async()=>{if(!(!y||E)){D(!0);try{await hHe(y.id,{category_id:y.categoryId,title:y.title||null,is_active:y.isActive,sort_order:y.sortOrder,generation_prompt:x.trim()||null,media_references:w}),mP.success(`生成配置已保存`),b(null),await O()}finally{D(!1)}}},confirmLoading:E,cancelButtonProps:{disabled:E},width:920,destroyOnHidden:!0,children:(0,Q.jsxs)(CM,{direction:`vertical`,style:{width:`100%`},size:16,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(Z.Text,{strong:!0,children:`生成提词`}),(0,Q.jsx)(MN.TextArea,{rows:6,maxLength:8e3,showCount:!0,value:x,disabled:E,placeholder:`请输入用于生成该素材的提示词`,onChange:e=>S(e.target.value),style:{marginTop:8}})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(Z.Text,{strong:!0,children:`附件 / 参考素材`}),(0,Q.jsx)(`div`,{style:{marginTop:8},children:(0,Q.jsx)(F9,{value:w,onChange:T,disabled:E})})]})]})}),(0,Q.jsx)(gP,{title:`重新生成水印`,open:!!p,onCancel:()=>!_&&m(null),onOk:async()=>{if(!(!p||_)){if(!z9(h)){mP.warning(h.watermarkType===`repeated_text`?`请输入重复文字水印内容`:`请选择水印图片`);return}v(!0);try{await _He(p.id,{watermark_type:h.watermarkType,watermark_id:h.watermarkType===`image`?h.watermarkId:null,opacity_level:h.opacityLevel,position:h.position,custom_x_ratio:h.customXRatio,custom_y_ratio:h.customYRatio,size_mode:h.sizeMode,width_ratio:h.widthRatio,width_px:h.widthPx,margin_x:h.marginX,margin_y:h.marginY,text_watermark:h.watermarkType===`repeated_text`&&h.textWatermark?{text:h.textWatermark.text,opacity_level:h.textWatermark.opacityLevel,font_size_px:h.textWatermark.fontSizePx,color:h.textWatermark.color,rotate_deg:h.textWatermark.rotateDeg,gap_x:h.textWatermark.gapX,gap_y:h.textWatermark.gapY,staggered:h.textWatermark.staggered}:null,wait:!1}),mP.success(`已提交重新生成`),m(null),await O()}finally{v(!1)}}},confirmLoading:_,okButtonProps:{disabled:_||!z9(h)},cancelButtonProps:{disabled:_},width:980,destroyOnHidden:!0,children:p&&(0,Q.jsx)(P9,{value:h,onChange:g,watermarks:t,mediaUrl:A9(p.originalUrl||p.watermarkedUrl),mediaType:p.mediaType})})]})},gGe=yBe,_Ge=[{label:`通用应用`,value:`AppstoreOutlined`},{label:`图片素材`,value:`PictureOutlined`},{label:`视频素材`,value:`VideoCameraOutlined`},{label:`电商购物`,value:`ShoppingOutlined`},{label:`门店商铺`,value:`ShopOutlined`},{label:`美妆护肤`,value:`SkinOutlined`},{label:`餐饮食品`,value:`CoffeeOutlined`},{label:`家居生活`,value:`HomeOutlined`},{label:`汽车出行`,value:`CarOutlined`},{label:`医疗健康`,value:`MedicineBoxOutlined`},{label:`教育培训`,value:`BookOutlined`},{label:`数码科技`,value:`LaptopOutlined`},{label:`旅游定位`,value:`EnvironmentOutlined`},{label:`摄影影像`,value:`CameraOutlined`},{label:`礼品活动`,value:`GiftOutlined`},{label:`热门爆款`,value:`FireOutlined`},{label:`品牌服务`,value:`CustomerServiceOutlined`},{label:`营销增长`,value:`RocketOutlined`},{label:`机构企业`,value:`BankOutlined`},{label:`娱乐休闲`,value:`SmileOutlined`}];function B9(e,t){if(!e)return(0,Q.jsx)(`span`,{style:{color:`#999`},children:`未设置`});let n=gGe[e];return(0,Q.jsxs)(CM,{size:6,children:[n?(0,Q.jsx)(n,{}):null,(0,Q.jsx)(`span`,{children:t||e}),(0,Q.jsx)(`span`,{style:{color:`#999`},children:e})]})}var vGe=({onChanged:e})=>{let[t,n]=(0,C.useState)([]),[r,i]=(0,C.useState)(0),[a,o]=(0,C.useState)(!1),[s,c]=(0,C.useState)(1),[l,u]=(0,C.useState)(!1),[d,f]=(0,C.useState)(null),[p]=X.useForm(),m=async()=>{o(!0);try{let e=await h5({page:s,pageSize:20});n(e.items),i(e.total)}finally{o(!1)}};(0,C.useEffect)(()=>{m()},[s]);let h=e=>{f(e||null),p.setFieldsValue(e?{name:e.name,key:e.key,description:e.description,icon:e.icon,is_active:e.isActive,sort_order:e.sortOrder}:{is_active:!0,sort_order:0}),u(!0)};return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{style:{marginBottom:16,display:`flex`,justifyContent:`space-between`},children:[(0,Q.jsx)(`div`,{}),(0,Q.jsx)(JS,{type:`primary`,icon:(0,Q.jsx)(rA,{}),onClick:()=>h(),children:`新增行业`})]}),(0,Q.jsx)(nR,{rowKey:`id`,loading:a,dataSource:t,pagination:{current:s,total:r,pageSize:20,onChange:c},columns:[{title:`行业名称`,dataIndex:`name`},{title:`Key`,dataIndex:`key`},{title:`图标`,dataIndex:`icon`,render:e=>B9(e)},{title:`启用`,dataIndex:`isActive`,render:e=>e?`启用`:`禁用`},{title:`素材数`,dataIndex:`assetCount`},{title:`图片/视频`,render:(e,t)=>`${t.imageCount}/${t.videoCount}`},{title:`排序`,dataIndex:`sortOrder`},{title:`操作`,render:(t,n)=>(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(JS,{size:`small`,icon:(0,Q.jsx)(xR,{}),onClick:()=>h(n),children:`编辑`}),(0,Q.jsx)(yP,{title:`确认删除该行业?`,onConfirm:async()=>{await sHe(n.id),mP.success(`删除成功`),await m(),e?.()},children:(0,Q.jsx)(JS,{size:`small`,danger:!0,icon:(0,Q.jsx)(vR,{}),children:`删除`})})]})}]}),(0,Q.jsx)(gP,{title:d?`编辑行业`:`新增行业`,open:l,onOk:async()=>{await oHe({...await p.validateFields(),id:d?.id}),mP.success(`保存成功`),u(!1),await m(),e?.()},onCancel:()=>u(!1),destroyOnHidden:!0,children:(0,Q.jsxs)(X,{form:p,layout:`vertical`,children:[(0,Q.jsx)(X.Item,{name:`name`,label:`行业名称`,rules:[{required:!0,message:`请输入行业名称`}],children:(0,Q.jsx)(MN,{})}),(0,Q.jsx)(X.Item,{name:`key`,label:`行业Key`,rules:[{required:!0,message:`请输入行业Key`},{pattern:/^[A-Za-z0-9_-]+$/,message:`只允许字母、数字、下划线、中划线`}],children:(0,Q.jsx)(MN,{})}),(0,Q.jsx)(X.Item,{name:`description`,label:`描述`,children:(0,Q.jsx)(MN.TextArea,{rows:3})}),(0,Q.jsx)(X.Item,{name:`icon`,label:`图标`,children:(0,Q.jsx)(bb,{allowClear:!0,showSearch:!0,placeholder:`请选择行业图标`,optionFilterProp:`searchText`,filterOption:(e,t)=>{let n=String(t?.searchText||``).toLowerCase(),r=String(t?.value||``).toLowerCase(),i=e.toLowerCase();return n.includes(i)||r.includes(i)},options:_Ge.map(e=>({value:e.value,searchText:`${e.label} ${e.value}`,label:B9(e.value,e.label)}))})}),(0,Q.jsx)(X.Item,{name:`sort_order`,label:`排序`,children:(0,Q.jsx)(xj,{min:0,style:{width:`100%`}})}),(0,Q.jsx)(X.Item,{name:`is_active`,label:`启用`,valuePropName:`checked`,children:(0,Q.jsx)(eF,{})})]})})]})},V9={watermarkType:`image`,watermarkId:null,opacityLevel:6,position:`bottom_right`,customXRatio:null,customYRatio:null,sizeMode:`ratio`,widthRatio:.18,widthPx:null,marginX:24,marginY:24,textWatermark:{text:`民众智创`,opacityLevel:2,fontSizePx:28,color:`#ffffff`,rotateDeg:-30,gapX:220,gapY:140,staggered:!0}};function yGe(e){return e.watermarkType===`repeated_text`?!!e.textWatermark?.text?.trim():!!e.watermarkId}var bGe=({open:e,onClose:t,categories:n,watermarks:r,onSuccess:i})=>{let[a]=X.useForm(),[o,s]=(0,C.useState)(null),[c,l]=(0,C.useState)([]),[u,d]=(0,C.useState)(`image`),[f,p]=(0,C.useState)(V9),[m,h]=(0,C.useState)(!1),[g,_]=(0,C.useState)(``),[v,y]=(0,C.useState)([]),b=()=>{s(null),l([]),d(`image`),_(``),h(!1),y([])};(0,C.useEffect)(()=>{if(e){b();let e=r.find(e=>e.isDefault)||r[0];p({...V9,watermarkId:e?.id||null}),a.setFieldsValue({media_type:`image`,is_active:!0,sort_order:0,title:void 0,generation_prompt:void 0})}},[e,r,a]),(0,C.useEffect)(()=>()=>{g.startsWith(`blob:`)&&URL.revokeObjectURL(g)},[g]);let x=(0,C.useMemo)(()=>g||void 0,[g]),S=e=>{let t=e.type.startsWith(`image/`),n=e.type.startsWith(`video/`);if(u===`image`&&!t)return mP.warning(`当前素材类型为图片,请选择图片文件`),lB.LIST_IGNORE;if(u===`video`&&!n)return mP.warning(`当前素材类型为视频,请选择视频文件`),lB.LIST_IGNORE;g.startsWith(`blob:`)&&URL.revokeObjectURL(g);let r=URL.createObjectURL(e);return s(e),_(r),l([{uid:e.name,name:e.name,status:`done`,originFileObj:e}]),!1},w=()=>{s(null),l([]),g.startsWith(`blob:`)&&URL.revokeObjectURL(g),_(``)};return(0,Q.jsxs)(gP,{title:`上传首页素材`,open:e,onCancel:()=>{m||t()},onOk:async()=>{if(m)return;let e=await a.validateFields();if(!o){mP.warning(`请选择素材文件`);return}if(f.watermarkType===`image`&&!f.watermarkId){mP.warning(`请选择水印图片`);return}if(f.watermarkType===`repeated_text`&&!f.textWatermark?.text?.trim()){mP.warning(`请输入重复文字水印内容`);return}h(!0);try{let n=await mHe({categoryId:e.category_id,file:o,mediaType:u,title:e.title?.trim()||null,generationPrompt:e.generation_prompt?.trim()||null,mediaReferences:v,watermarkType:f.watermarkType,watermarkId:f.watermarkType===`image`?f.watermarkId:null,opacityLevel:f.opacityLevel,position:f.position,customXRatio:f.customXRatio,customYRatio:f.customYRatio,sizeMode:f.sizeMode,widthRatio:f.widthRatio,widthPx:f.widthPx,marginX:f.marginX,marginY:f.marginY,textWatermark:f.watermarkType===`repeated_text`?f.textWatermark:null,isActive:e.is_active,sortOrder:e.sort_order,wait:!1});mP.success(n.message||`已提交水印处理`),i(),t()}finally{h(!1)}},confirmLoading:m,okButtonProps:{disabled:m||!o||!yGe(f)},cancelButtonProps:{disabled:m},width:980,destroyOnHidden:!0,children:[(0,Q.jsxs)(X,{form:a,layout:`vertical`,children:[(0,Q.jsx)(X.Item,{name:`category_id`,label:`行业`,rules:[{required:!0,message:`请选择行业`}],children:(0,Q.jsx)(bb,{options:n.map(e=>({label:e.name,value:e.id})),disabled:m})}),(0,Q.jsx)(X.Item,{name:`media_type`,label:`素材类型`,rules:[{required:!0}],children:(0,Q.jsx)(bb,{value:u,onChange:e=>{d(e),w()},disabled:m,options:[{label:`图片`,value:`image`},{label:`视频`,value:`video`}]})}),(0,Q.jsx)(X.Item,{label:`素材文件`,required:!0,children:(0,Q.jsx)(lB,{beforeUpload:e=>S(e),onRemove:w,fileList:c,maxCount:1,accept:u===`image`?`image/*`:`video/*`,disabled:m,children:(0,Q.jsxs)(JS,{icon:(0,Q.jsx)(k6,{}),loading:m,disabled:m,children:[`选择`,u===`image`?`图片`:`视频`]})})}),(0,Q.jsx)(X.Item,{name:`title`,label:`素材标题`,extra:`选填;不填时后台显示“未命名素材”,不会再自动使用文件名作为标题。`,children:(0,Q.jsx)(MN,{disabled:m})}),(0,Q.jsx)(X.Item,{name:`generation_prompt`,label:`生成提词`,extra:`选填;会随前台素材接口返回。`,children:(0,Q.jsx)(MN.TextArea,{rows:5,maxLength:8e3,showCount:!0,disabled:m,placeholder:`请输入用于生成该素材的提示词`})}),(0,Q.jsx)(X.Item,{label:`附件 / 参考素材`,children:(0,Q.jsx)(F9,{value:v,onChange:y,disabled:m})}),(0,Q.jsx)(X.Item,{name:`sort_order`,label:`排序`,children:(0,Q.jsx)(xj,{min:0,style:{width:`100%`},disabled:m})}),(0,Q.jsx)(X.Item,{name:`is_active`,label:`前台展示`,valuePropName:`checked`,children:(0,Q.jsx)(eF,{disabled:m})})]}),(0,Q.jsx)(P9,{value:f,onChange:p,watermarks:r,mediaUrl:x,mediaType:u})]})},xGe=({open:e=!0,onClose:t,embedded:n=!1,onChanged:r})=>{let[i,a]=(0,C.useState)([]),[o,s]=(0,C.useState)(!1),[c,l]=(0,C.useState)(!1),[u,d]=(0,C.useState)(null),[f,p]=(0,C.useState)(null),[m,h]=(0,C.useState)([]),[g,_]=(0,C.useState)(``),[v,y]=(0,C.useState)(!1),[b]=X.useForm(),x=async()=>{s(!0);try{a((await g5({page:1,pageSize:200})).items)}finally{s(!1)}};(0,C.useEffect)(()=>{e&&x()},[e]),(0,C.useEffect)(()=>()=>{g.startsWith(`blob:`)&&URL.revokeObjectURL(g)},[g]);let S=()=>{p(null),h([]),_(``),y(!1)},w=()=>{d(null),S(),b.setFieldsValue({name:``,is_default:!1,is_active:!0}),l(!0)},T=e=>{d(e),S(),_(A9(e.fileUrl)),b.setFieldsValue({name:e.name,is_default:e.isDefault,is_active:e.isActive}),l(!0)},E=()=>{v||(l(!1),S())},D=e=>{if(!e.type.startsWith(`image/`))return mP.warning(`请选择图片文件`),lB.LIST_IGNORE;g.startsWith(`blob:`)&&URL.revokeObjectURL(g);let t=URL.createObjectURL(e);return p(e),_(t),h([{uid:e.name,name:e.name,status:`done`,originFileObj:e}]),!1},O=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{style:{marginBottom:16,display:`flex`,justifyContent:`space-between`},children:[(0,Q.jsx)(`div`,{}),(0,Q.jsx)(JS,{type:`primary`,icon:(0,Q.jsx)(rA,{}),onClick:w,children:`上传水印`})]}),(0,Q.jsx)(nR,{rowKey:`id`,loading:o,dataSource:i,pagination:{pageSize:20},columns:[{title:`预览`,dataIndex:`fileUrl`,render:e=>(0,Q.jsx)(vN,{width:80,src:A9(e)})},{title:`名称`,dataIndex:`name`},{title:`尺寸`,render:(e,t)=>t.width&&t.height?`${t.width}×${t.height}`:`-`},{title:`默认`,dataIndex:`isDefault`,render:e=>e?`是`:`否`},{title:`启用`,dataIndex:`isActive`,render:e=>e?`启用`:`禁用`},{title:`操作`,render:(e,t)=>(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(JS,{size:`small`,icon:(0,Q.jsx)(xR,{}),onClick:()=>T(t),children:`编辑`}),(0,Q.jsx)(yP,{title:`确认删除该水印?`,onConfirm:async()=>{await uHe(t.id),mP.success(`删除成功`),await x(),r?.()},children:(0,Q.jsx)(JS,{size:`small`,danger:!0,icon:(0,Q.jsx)(vR,{}),children:`删除`})})]})}]}),(0,Q.jsx)(gP,{title:u?`编辑水印`:`上传水印`,open:c,onOk:async()=>{if(v)return;let e=await b.validateFields();if(!u&&!f){mP.warning(`请选择水印图片`);return}y(!0);try{u?await lHe(u.id,{name:e.name,is_default:e.is_default,is_active:e.is_active}):f&&await cHe(f,e.name,e.is_default),mP.success(`保存成功`),l(!1),S(),await x(),r?.()}finally{y(!1)}},onCancel:E,confirmLoading:v,okButtonProps:{disabled:v||!u&&!f},cancelButtonProps:{disabled:v},destroyOnHidden:!0,children:(0,Q.jsxs)(X,{form:b,layout:`vertical`,children:[!u&&(0,Q.jsxs)(X.Item,{label:`水印图片`,required:!0,children:[(0,Q.jsx)(lB,{beforeUpload:e=>D(e),onRemove:()=>{p(null),h([]),g.startsWith(`blob:`)&&URL.revokeObjectURL(g),_(``)},fileList:m,maxCount:1,accept:`image/png,image/jpeg,image/webp`,disabled:v,children:(0,Q.jsx)(JS,{icon:(0,Q.jsx)(k6,{}),loading:v,disabled:v,children:`选择图片`})}),g&&(0,Q.jsx)(`div`,{style:{marginTop:12},children:(0,Q.jsx)(vN,{src:g,alt:`水印预览`,width:180,style:{maxHeight:120,objectFit:`contain`,background:`#0f172a`,borderRadius:8,padding:8}})})]}),u&&g&&(0,Q.jsx)(X.Item,{label:`当前水印`,children:(0,Q.jsx)(vN,{src:g,alt:`当前水印`,width:180,style:{maxHeight:120,objectFit:`contain`,background:`#0f172a`,borderRadius:8,padding:8}})}),(0,Q.jsx)(X.Item,{name:`name`,label:`水印名称`,rules:[{required:!0,message:`请输入水印名称`}],children:(0,Q.jsx)(MN,{disabled:v})}),(0,Q.jsx)(X.Item,{name:`is_default`,label:`默认水印`,valuePropName:`checked`,children:(0,Q.jsx)(eF,{disabled:v})}),(0,Q.jsx)(X.Item,{name:`is_active`,label:`启用`,valuePropName:`checked`,children:(0,Q.jsx)(eF,{disabled:v})})]})})]});return n?O:(0,Q.jsx)(gP,{title:`水印库`,open:e,onCancel:t,footer:null,width:900,destroyOnHidden:!0,children:O})},SGe=()=>{let[e]=X.useForm(),[t,n]=(0,C.useState)(!1),[r,i]=(0,C.useState)([]),[a,o]=(0,C.useState)([]),[s,c]=(0,C.useState)(!1),[l,u]=(0,C.useState)(0),d=async()=>{let[e,t]=await Promise.all([h5({page:1,pageSize:200}),g5({page:1,pageSize:200,isActive:!0})]);i(e.items),o(t.items)},f=async()=>{n(!0);try{let t=await iHe();e.setFieldsValue(t)}finally{n(!1)}};(0,C.useEffect)(()=>{f(),d()},[]);let p=async()=>{await aHe(await e.validateFields()),mP.success(`配置已保存`)},m=async()=>{await d(),u(e=>e+1)};return(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(OA,{style:{marginBottom:16},loading:t,children:(0,Q.jsxs)(X,{form:e,layout:`inline`,initialValues:{enabled:!1,title:`行业素材案例`,subtitle:`精选图片与视频素材展示`,showOriginalInAdmin:!0},children:[(0,Q.jsx)(X.Item,{name:`enabled`,label:`首页展示`,valuePropName:`checked`,children:(0,Q.jsx)(eF,{})}),(0,Q.jsx)(X.Item,{name:`title`,label:`标题`,rules:[{required:!0,message:`请输入标题`}],children:(0,Q.jsx)(MN,{style:{width:220}})}),(0,Q.jsx)(X.Item,{name:`subtitle`,label:`副标题`,children:(0,Q.jsx)(MN,{style:{width:320}})}),(0,Q.jsx)(X.Item,{name:`showOriginalInAdmin`,label:`后台展示原素材`,valuePropName:`checked`,children:(0,Q.jsx)(eF,{})}),(0,Q.jsx)(X.Item,{children:(0,Q.jsx)(JS,{type:`primary`,icon:(0,Q.jsx)(z2,{}),onClick:p,children:`保存配置`})})]})}),(0,Q.jsx)(OA,{title:`首页素材行业装修`,extra:(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(JS,{onClick:m,children:`刷新`}),(0,Q.jsx)(JS,{type:`primary`,icon:(0,Q.jsx)(rA,{}),onClick:()=>c(!0),children:`上传素材`})]}),children:(0,Q.jsx)(EA,{items:[{key:`assets`,label:`素材管理`,children:(0,Q.jsx)(hGe,{categories:r,watermarks:a,reloadKey:l})},{key:`categories`,label:`行业类别`,children:(0,Q.jsx)(vGe,{onChanged:m})},{key:`watermarks`,label:`水印库`,children:(0,Q.jsx)(xGe,{embedded:!0,onChanged:m})}]})}),(0,Q.jsx)(bGe,{open:s,onClose:()=>c(!1),categories:r,watermarks:a,onSuccess:m})]})},CGe=[{id:`AD_APP_ACTIVATE`,name:`AD_APP_ACTIVATE`,label:`应用-激活`,description:`应用激活行为`},{id:`AD_APP_AUTH`,name:`AD_APP_AUTH`,label:`应用-授信`,description:`应用授信行为`},{id:`AD_APP_BOOK`,name:`AD_APP_BOOK`,label:`应用-预约表单`,description:`应用预约表单`},{id:`AD_APP_BUY`,name:`AD_APP_BUY`,label:`应用-APP内付费`,description:`APP内付费行为`},{id:`AD_APP_CLICKS`,name:`AD_APP_CLICKS`,label:`应用-点击量`,description:`应用点击量`},{id:`AD_APP_DETAIL`,name:`AD_APP_DETAIL`,label:`应用-APP内详情页到站UV`,description:`APP内详情页到站UV`},{id:`AD_APP_DOWNLOADED`,name:`AD_APP_DOWNLOADED`,label:`应用-下载完成`,description:`应用下载完成`},{id:`AD_APP_INSTALLED`,name:`AD_APP_INSTALLED`,label:`应用-安装完成`,description:`应用安装完成`},{id:`AD_APP_KEY_BEHAVIOR`,name:`AD_APP_KEY_BEHAVIOR`,label:`应用-关键行为`,description:`应用关键行为`},{id:`AD_APP_ORDER`,name:`AD_APP_ORDER`,label:`应用-APP内下单`,description:`APP内下单行为`},{id:`AD_APP_PAY`,name:`AD_APP_PAY`,label:`应用-付费`,description:`应用付费行为`},{id:`AD_APP_PRE_AUTH`,name:`AD_APP_PRE_AUTH`,label:`应用-预授信`,description:`应用预授信行为`},{id:`AD_APP_PRE_DOWNLOAD`,name:`AD_APP_PRE_DOWNLOAD`,label:`应用-预约下载`,description:`应用预约下载`},{id:`AD_APP_PUSH_ORDER`,name:`AD_APP_PUSH_ORDER`,label:`应用-首次发单(乘客)`,description:`首次发单行为`},{id:`AD_APP_REGISTER`,name:`AD_APP_REGISTER`,label:`应用-注册`,description:`应用注册行为`},{id:`AD_APP_SHOW`,name:`AD_APP_SHOW`,label:`应用-展示量`,description:`应用展示量`},{id:`AD_APP_SUBMIT`,name:`AD_APP_SUBMIT`,label:`应用-提交认证`,description:`应用提交认证`},{id:`AD_APP_VIEW`,name:`AD_APP_VIEW`,label:`应用-APP内访问`,description:`APP内访问行为`},{id:`AD_CLUE_AUTH`,name:`AD_CLUE_AUTH`,label:`销售线索收集-授信`,description:`销售线索授信`},{id:`AD_CLUE_BUTTON`,name:`AD_CLUE_BUTTON`,label:`销售线索收集-按钮跳转`,description:`按钮跳转`},{id:`AD_CLUE_CLICKS`,name:`AD_CLUE_CLICKS`,label:`销售线索收集-点击量`,description:`点击量`},{id:`AD_CLUE_CONFIRM`,name:`AD_CLUE_CONFIRM`,label:`销售线索收集-回访-信息确认`,description:`回访信息确认`},{id:`AD_CLUE_CONSULT`,name:`AD_CLUE_CONSULT`,label:`销售线索收集-有效咨询`,description:`有效咨询`},{id:`AD_CLUE_CONSULT_MSG`,name:`AD_CLUE_CONSULT_MSG`,label:`销售线索收集-留资咨询`,description:`留资咨询`},{id:`AD_CLUE_COUPON`,name:`AD_CLUE_COUPON`,label:`销售线索收集-卡券领取`,description:`卡券领取`},{id:`AD_CLUE_CUSTOMER`,name:`AD_CLUE_CUSTOMER`,label:`销售线索收集-有效获客`,description:`有效获客`},{id:`AD_CLUE_CVT`,name:`AD_CLUE_CVT`,label:`销售线索收集-多转化`,description:`多转化`},{id:`AD_CLUE_DONE`,name:`AD_CLUE_DONE`,label:`销售线索收集-完件`,description:`完件`},{id:`AD_CLUE_FORM`,name:`AD_CLUE_FORM`,label:`销售线索收集-表单提交`,description:`表单提交`},{id:`AD_CLUE_FRIENDS`,name:`AD_CLUE_FRIENDS`,label:`销售线索收集-回访-加为好友`,description:`回访加为好友`},{id:`AD_CLUE_INSURANCE`,name:`AD_CLUE_INSURANCE`,label:`销售线索收集-保险支付`,description:`保险支付`},{id:`AD_CLUE_INTENTION`,name:`AD_CLUE_INTENTION`,label:`销售线索收集-存在意向`,description:`存在意向`},{id:`AD_CLUE_INTENTION_FORM`,name:`AD_CLUE_INTENTION_FORM`,label:`销售线索收集-意向表单`,description:`意向表单`},{id:`AD_CLUE_INTENTION_TEL`,name:`AD_CLUE_INTENTION_TEL`,label:`销售线索收集-意向话单`,description:`意向话单`},{id:`AD_CLUE_MESSAGE`,name:`AD_CLUE_MESSAGE`,label:`销售线索收集-私信消息`,description:`私信消息`},{id:`AD_CLUE_MONEY`,name:`AD_CLUE_MONEY`,label:`销售线索收集-放款`,description:`放款`},{id:`AD_CLUE_MSG`,name:`AD_CLUE_MSG`,label:`销售线索收集-私信留资`,description:`私信留资`},{id:`AD_CLUE_PAGE`,name:`AD_CLUE_PAGE`,label:`销售线索收集-访问目标页面`,description:`访问目标页面`},{id:`AD_CLUE_PAY`,name:`AD_CLUE_PAY`,label:`销售线索收集-付费`,description:`付费`},{id:`AD_CLUE_PRE_AUTH`,name:`AD_CLUE_PRE_AUTH`,label:`销售线索收集-预授信`,description:`预授信`},{id:`AD_CLUE_PROTENTIAL_DEAL`,name:`AD_CLUE_PROTENTIAL_DEAL`,label:`销售线索收集-回访-高潜成交`,description:`回访高潜成交`},{id:`AD_CLUE_PUSH_ORDER`,name:`AD_CLUE_PUSH_ORDER`,label:`销售线索收集-首次发单(乘客)`,description:`首次发单`},{id:`AD_CLUE_REGISTER`,name:`AD_CLUE_REGISTER`,label:`销售线索收集-注册`,description:`注册`},{id:`AD_CLUE_SHOW`,name:`AD_CLUE_SHOW`,label:`销售线索收集-展示量`,description:`展示量`},{id:`AD_CLUE_SUBMIT`,name:`AD_CLUE_SUBMIT`,label:`销售线索收集-提交认证`,description:`提交认证`},{id:`AD_CLUE_TEL`,name:`AD_CLUE_TEL`,label:`销售线索收集-智能电话确认接通`,description:`智能电话确认接通`},{id:`AD_CLUE_TEL_CALL`,name:`AD_CLUE_TEL_CALL`,label:`销售线索收集-电话接通`,description:`电话接通`},{id:`AD_CLUE_WX_ADD`,name:`AD_CLUE_WX_ADD`,label:`销售线索收集-微信-添加企业微信`,description:`添加企业微信`},{id:`AD_CLUE_WX_COPY`,name:`AD_CLUE_WX_COPY`,label:`销售线索收集-微信复制`,description:`微信复制`},{id:`AD_CLUE_WX_MSG`,name:`AD_CLUE_WX_MSG`,label:`销售线索收集-微信-用户首次消息`,description:`用户首次消息`},{id:`AD_ECP_APP_BUY`,name:`AD_ECP_APP_BUY`,label:`电商-app内下单`,description:`电商app内下单`},{id:`AD_ECP_APP_DETAIL`,name:`AD_ECP_APP_DETAIL`,label:`电商-app内详情页到站uv`,description:`电商app内详情页到站uv`},{id:`AD_ECP_APP_VIEW`,name:`AD_ECP_APP_VIEW`,label:`电商-app内访问`,description:`电商app内访问`},{id:`AD_ECP_BUTTON`,name:`AD_ECP_BUTTON`,label:`电商-按钮跳转`,description:`电商按钮跳转`},{id:`AD_ECP_INTEREST`,name:`AD_ECP_INTEREST`,label:`电商-引流电商种草`,description:`引流电商种草`},{id:`AD_ECP_SHOP`,name:`AD_ECP_SHOP`,label:`电商-调起店铺`,description:`调起店铺`},{id:`AD_ECP_SHOP_STAY`,name:`AD_ECP_SHOP_STAY`,label:`电商-店铺停留`,description:`店铺停留`},{id:`AD_MINIAPP_ACTIVATE`,name:`AD_MINIAPP_ACTIVATE`,label:`快应用-激活`,description:`快应用激活`},{id:`AD_MINIAPP_KEY_BEHAVIOR`,name:`AD_MINIAPP_KEY_BEHAVIOR`,label:`快应用-关键行为`,description:`快应用关键行为`},{id:`AD_MINIAPP_PAY`,name:`AD_MINIAPP_PAY`,label:`快应用-付费`,description:`快应用付费`},{id:`AD_MINIAPP_REGISTER`,name:`AD_MINIAPP_REGISTER`,label:`快应用-注册`,description:`快应用注册`},{id:`AD_NATIVE_ACTIVATE`,name:`AD_NATIVE_ACTIVATE`,label:`原声互动-激活`,description:`原声互动激活`},{id:`AD_NATIVE_CLICKS`,name:`AD_NATIVE_CLICKS`,label:`原声互动-组件点击`,description:`组件点击`},{id:`AD_NATIVE_FANS_GROUP`,name:`AD_NATIVE_FANS_GROUP`,label:`原声互动-粉丝入群`,description:`粉丝入群`},{id:`AD_NATIVE_FOLLOW`,name:`AD_NATIVE_FOLLOW`,label:`原声互动-帐号关注`,description:`帐号关注`},{id:`AD_NATIVE_INTERACTIVE`,name:`AD_NATIVE_INTERACTIVE`,label:`原声互动-互动`,description:`互动`},{id:`AD_NATIVE_LIVE`,name:`AD_NATIVE_LIVE`,label:`原声互动-预约直播`,description:`预约直播`},{id:`AD_NATIVE_LIVE_DONATE`,name:`AD_NATIVE_LIVE_DONATE`,label:`原声互动-直播间营销捐赠`,description:`直播间营销捐赠`},{id:`AD_NATIVE_LIVE_PAY`,name:`AD_NATIVE_LIVE_PAY`,label:`原声互动-直播间打赏`,description:`直播间打赏`},{id:`AD_NATIVE_LIVE_STAY`,name:`AD_NATIVE_LIVE_STAY`,label:`原声互动-直播间停留`,description:`直播间停留`},{id:`AD_NATIVE_LIVE_VIEW`,name:`AD_NATIVE_LIVE_VIEW`,label:`原声互动-直播间观看`,description:`直播间观看`},{id:`AD_NATIVE_PAY`,name:`AD_NATIVE_PAY`,label:`原声互动-付费`,description:`原声互动付费`},{id:`AD_PRODUCT_ACTIVATE`,name:`AD_PRODUCT_ACTIVATE`,label:`商品-激活`,description:`商品激活`},{id:`AD_PRODUCT_APP_BUY`,name:`AD_PRODUCT_APP_BUY`,label:`商品-app内下单`,description:`商品app内下单`},{id:`AD_PRODUCT_APP_DETAIL`,name:`AD_PRODUCT_APP_DETAIL`,label:`商品-app内详情页到站uv`,description:`商品app内详情页到站uv`},{id:`AD_PRODUCT_APP_PAY`,name:`AD_PRODUCT_APP_PAY`,label:`商品-app内付费`,description:`商品app内付费`},{id:`AD_PRODUCT_APP_VIEW`,name:`AD_PRODUCT_APP_VIEW`,label:`商品-app内访问`,description:`商品app内访问`},{id:`AD_PRODUCT_FORM`,name:`AD_PRODUCT_FORM`,label:`商品-表单提交`,description:`商品表单提交`},{id:`AD_PRODUCT_KEY_BEHAVIOR`,name:`AD_PRODUCT_KEY_BEHAVIOR`,label:`商品-关键行为`,description:`商品关键行为`},{id:`AD_PRODUCT_PAY`,name:`AD_PRODUCT_PAY`,label:`商品-付费`,description:`商品付费`},{id:`AD_TINYAPP_ACTIVATE`,name:`AD_TINYAPP_ACTIVATE`,label:`小程序-激活`,description:`小程序激活`},{id:`AD_TINYAPP_KEY_BEHAVIOR`,name:`AD_TINYAPP_KEY_BEHAVIOR`,label:`小程序-关键行为`,description:`小程序关键行为`},{id:`AD_TINYAPP_PAY`,name:`AD_TINYAPP_PAY`,label:`小程序-付费`,description:`小程序付费`},{id:`QC_LIVE_BUY`,name:`QC_LIVE_BUY`,label:`直播投放-直播间下单`,description:`直播间下单`},{id:`QC_LIVE_CHECK`,name:`QC_LIVE_CHECK`,label:`直播投放-直播间结算`,description:`直播间结算`},{id:`QC_LIVE_COMMENTS`,name:`QC_LIVE_COMMENTS`,label:`直播投放-直播间评论`,description:`直播间评论`},{id:`QC_LIVE_DEAL`,name:`QC_LIVE_DEAL`,label:`直播投放-直播间成交`,description:`直播间成交`},{id:`QC_LIVE_ENTRY`,name:`QC_LIVE_ENTRY`,label:`直播投放-进入直播间`,description:`进入直播间`},{id:`QC_LIVE_FANS`,name:`QC_LIVE_FANS`,label:`直播投放-直播间粉丝提升`,description:`直播间粉丝提升`},{id:`QC_LIVE_HIT`,name:`QC_LIVE_HIT`,label:`直播投放-直播加热`,description:`直播加热`},{id:`QC_LIVE_PRODUCT_CLICKS`,name:`QC_LIVE_PRODUCT_CLICKS`,label:`直播投放-直播间商品点击`,description:`直播间商品点击`},{id:`QC_LIVE_ROI_CHECK`,name:`QC_LIVE_ROI_CHECK`,label:`直播投放-结算roi`,description:`结算roi`},{id:`QC_LIVE_ROI_DEAL`,name:`QC_LIVE_ROI_DEAL`,label:`直播投放-支付roi-直播间成交`,description:`支付roi直播间成交`},{id:`QC_LIVE_ROI_QC`,name:`QC_LIVE_ROI_QC`,label:`直播投放-支付roi-千川直接+间接订单`,description:`支付roi千川订单`},{id:`QC_PRODUCT_BUY`,name:`QC_PRODUCT_BUY`,label:`商品投放-商品购买`,description:`商品购买`},{id:`QC_PRODUCT_COMMENTS`,name:`QC_PRODUCT_COMMENTS`,label:`商品投放-点赞评论`,description:`点赞评论`},{id:`QC_PRODUCT_FANS`,name:`QC_PRODUCT_FANS`,label:`商品投放-粉丝提升`,description:`粉丝提升`},{id:`QC_PRODUCT_INTEREST`,name:`QC_PRODUCT_INTEREST`,label:`商品投放-人群种草`,description:`人群种草`},{id:`QC_PRODUCT_QC`,name:`QC_PRODUCT_QC`,label:`商品投放-千川直接+间接订单`,description:`千川订单`},{id:`QC_PRODUCT_ROI`,name:`QC_PRODUCT_ROI`,label:`商品投放-商品支付roi`,description:`商品支付roi`}],H9=e=>{if(!e)return``;let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)} ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`},{Text:wGe}=Z,TGe=()=>{let[e,t]=(0,C.useState)([]),[n,r]=(0,C.useState)(!1),[i,a]=(0,C.useState)(1),[o,s]=(0,C.useState)(10),[c,l]=(0,C.useState)(0),[u,d]=(0,C.useState)(``),[f,p]=(0,C.useState)(``),[m,h]=(0,C.useState)(),[g,_]=(0,C.useState)({});(0,C.useEffect)(()=>{v()},[]);let v=async()=>{try{let e=localStorage.getItem(`preTestAreaData`);if(e){_(JSON.parse(e).cityCodeMap);return}let t=(await _5({level:`ONE_LEVEL`})).data||[],n={};await Promise.all(t.map(async e=>{let t=[];try{t=(await _5({level:`TWO_LEVEL`,parent_code:e.code})).data||[],t.forEach(e=>{n[e.code]=e.name})}catch(t){console.error(`获取省份 ${e.name} 的城市失败`,t)}}));let r={cityCodeMap:n};localStorage.setItem(`preTestAreaData`,JSON.stringify(r)),_(n)}catch(e){console.error(`加载区域数据失败:`,e),mP.error(`加载区域数据失败`)}},y=[{title:`序号`,dataIndex:`index`,key:`index`,width:60,render:e=>(0,Q.jsx)(`span`,{style:{color:`#64748b`},children:e})},{title:`ID`,dataIndex:`id`,key:`id`,width:120,render:e=>{if(!e)return`-`;let t=e.length>12?`${e.slice(0,6)}...${e.slice(-4)}`:e;return(0,Q.jsx)(ux,{title:e,placement:`topLeft`,children:(0,Q.jsx)(Z.Text,{style:{fontSize:12},children:t})})}},{title:`投放平台`,dataIndex:`platform`,key:`platform`,width:100,render:e=>(0,Q.jsx)(hR,{color:e===`AD`?`blue`:e===`QIANCHUAN`?`green`:`orange`,style:{borderRadius:6,fontSize:12},children:e===`AD`?`AD`:e===`QIANCHUAN`?`千川`:`本地推`})},{title:`优化目标`,dataIndex:`externalAction`,key:`externalAction`,ellipsis:!0,width:200,render:e=>{if(!e)return(0,Q.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13},children:`-`});let t=CGe.find(t=>t.name===e.trim());return(0,Q.jsx)(`span`,{style:{color:`#1e293b`,fontSize:13},children:t?t.label:e})}},{title:`目标转化成本`,dataIndex:`cpaBid`,key:`cpaBid`,width:100},{title:`受众年龄`,dataIndex:`audienceAge`,key:`audienceAge`,width:100},{title:`受众性别`,dataIndex:`audienceGender`,key:`audienceGender`,width:100},{title:`受众网络`,dataIndex:`audienceNetwork`,key:`audienceNetwork`,width:100},{title:`受众区域`,dataIndex:`audienceRegion`,key:`audienceRegion`,ellipsis:!0,width:300,render:e=>{let t=JSON.parse(e);if(!Array.isArray(t)||t.length===0)return(0,Q.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13},children:`-`});let n=t.map(e=>{let t=String(e).padEnd(6,`0`);return g[t]||t});return(0,Q.jsx)(MN.TextArea,{value:n.join(`, `)||`-`,readOnly:!0,autoSize:{minRows:1,maxRows:4},style:{resize:`none`,border:`none`,background:`transparent`,padding:0},placeholder:`-`})}},{title:`客户主体名称`,dataIndex:`cusName`,key:`cusName`,width:150},{title:`计费方式`,dataIndex:`pricingType`,key:`pricingType`,width:100},{title:`是否最优成本出价`,dataIndex:`costCap`,key:`costCap`,width:100},{title:`是否稳定成本出价`,dataIndex:`targetCost`,key:`targetCost`,width:100},{title:`是否最大转化出价`,dataIndex:`nobid`,key:`nobid`,width:100},{title:`目标点击成本`,dataIndex:`cpcBid`,key:`cpcBid`,width:100},{title:`预算金额`,dataIndex:`budget`,key:`budget`,width:100},{title:`名称`,dataIndex:`name`,key:`name`,width:150},{title:`备注`,dataIndex:`note`,key:`note`,width:150},{title:`用户ID`,dataIndex:`userId`,key:`userId`,width:110,render:e=>{if(!e)return`-`;let t=e.length>12?`${e.slice(0,6)}...${e.slice(-4)}`:e;return(0,Q.jsx)(ux,{title:e,placement:`topLeft`,children:(0,Q.jsx)(Z.Text,{style:{fontSize:12},children:t})})}},{title:`用户手机号`,dataIndex:`userPhone`,key:`userPhone`,width:150},{title:`是否默认`,dataIndex:`isDefault`,key:`isDefault`,width:100,render:e=>(0,Q.jsx)(hR,{color:e?`green`:`red`,children:e?`是`:`否`})},{title:`创建时间`,dataIndex:`createdAt`,key:`createdAt`,width:180,render:e=>(0,Q.jsx)(`span`,{style:{color:`#64748b`},children:H9(e)})},{title:`更新时间`,dataIndex:`updatedAt`,key:`updatedAt`,width:180,render:e=>(0,Q.jsx)(`span`,{style:{color:`#64748b`},children:H9(e)})}],b=async()=>{r(!0);try{let e=await xHe({id:u||void 0,phone:f||void 0,created_at:m?[m[0].format(`YYYY-MM-DD`),m[1].format(`YYYY-MM-DD`)]:void 0,page:i,page_size:o});t((e.data||[]).map((e,t)=>({...e,index:(i-1)*o+t+1}))),l(e.pagination.total||0)}catch(e){console.error(`加载数据失败:`,e)}finally{r(!1)}};(0,C.useEffect)(()=>{b()},[i,o]);let x=(e,t)=>{a(e),s(t)},S=()=>{a(1),b()};return(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12},children:[(0,Q.jsx)(DM,{style:{color:`#6366f1`,fontSize:16}}),(0,Q.jsx)(wGe,{strong:!0,style:{fontSize:16},children:`素材前测模板`})]}),(0,Q.jsx)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:16},children:(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:12,alignItems:`center`},children:[(0,Q.jsx)(MN,{placeholder:`ID`,value:u,onChange:e=>d(e.target.value),style:{width:160},allowClear:!0,onPressEnter:S}),(0,Q.jsx)(MN,{placeholder:`手机号`,value:f,onChange:e=>p(e.target.value),style:{width:160},allowClear:!0,onPressEnter:S}),(0,Q.jsx)(rM.RangePicker,{placeholder:[`开始日期`,`结束日期`],value:m,onChange:e=>{e&&e[0]&&e[1]?h([e[0],e[1]]):h(void 0)},style:{width:260}}),(0,Q.jsx)(JS,{type:`primary`,onClick:S,children:`搜索`})]})}),(0,Q.jsxs)(`div`,{style:{background:`#fff`,borderRadius:16,boxShadow:`0 4px 20px rgba(0,0,0,0.04)`,overflow:`hidden`},children:[(0,Q.jsx)(nR,{dataSource:e,columns:y,loading:n,pagination:!1,rowKey:`id`,bordered:!1,scroll:{x:`max-content`},onRow:()=>({style:{cursor:`pointer`,transition:`background-color 0.15s`},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=`#f8fafc`},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=`transparent`}})}),(0,Q.jsx)(`div`,{style:{padding:`16px`,textAlign:`right`},children:(0,Q.jsx)(JN,{current:i,pageSize:o,total:c,showSizeChanger:!0,showTotal:e=>`共 ${e} 条记录`,pageSizeOptions:[`10`,`20`,`50`,`100`],onChange:x,size:`small`})})]})]})},U9=e=>{if(!e)return``;let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)} ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`},{Text:EGe}=Z,DGe=()=>{let[e,t]=(0,C.useState)([]),[n,r]=(0,C.useState)(!1),[i,a]=(0,C.useState)(1),[o,s]=(0,C.useState)(10),[c,l]=(0,C.useState)(0),[u,d]=(0,C.useState)(``),[f,p]=(0,C.useState)(``),[m,h]=(0,C.useState)({}),[g,_]=(0,C.useState)([]),[v,y]=(0,C.useState)(void 0),b=[{title:`序号`,dataIndex:`index`,key:`index`,width:60,render:e=>(0,Q.jsx)(`span`,{style:{color:`#64748b`},children:e})},{title:`ID`,dataIndex:`id`,key:`id`},{title:`前台用户ID`,dataIndex:`userId`,key:`userId`},{title:`前台用户手机号`,dataIndex:`userPhone`,key:`userPhone`},{title:`授权应用ID`,dataIndex:`appid`,key:`appid`},{title:`授权绑定账户ID`,dataIndex:`accountId`,key:`accountId`},{title:`授权绑定账户名称`,dataIndex:`accountName`,key:`accountName`},{title:`授权绑定账户角色`,dataIndex:`accountRole`,key:`accountRole`,render:e=>({ADVERTISER:`客户`,CUSTOMER_ADMIN:`普通版工作台-管理员`,CUSTOMER_OPERATOR:`普通版工作台-协作者`,AGENT:`代理商`,CHILD_AGENT:`二级代理商`,PLATFORM_ROLE_STAR:`星图账户`,PLATFORM_ROLE_SHOP_ACCOUNT:`抖音店铺账户`,PLATFORM_ROLE_QIANCHUAN_AGENT:`千川代理商`,PLATFORM_ROLE_STAR_AGENT:`星图代理商`,PLATFORM_ROLE_AWEME:`抖音号`,PLATFORM_ROLE_STAR_MCN:`星图MCN机构`,PLATFORM_ROLE_STAR_ISV:`星图服务商`,AGENT_SYSTEM_ACCOUNT:`代理商系统账户`,PLATFORM_ROLE_LOCAL_AGENT:`本地推代理商`,PLATFORM_ROLE_YUNTU_BRAND_ISV_ADMIN:`云图品牌服务商管理员`,PLATFORM_ROLE_LIFE:`抖音来客账户`,PLATFORM_ROLE_ENTERPRISE_BP_ADMIN:`升级版工作台管理员`,PLATFORM_ROLE_ENTERPRISE_BP_OPERATOR:`升级版工作台协作者`})[e]||e},{title:`授权登录账户用户ID`,dataIndex:`accountUserid`,key:`accountUserid`},{title:`授权登录账户用户名`,dataIndex:`accountUsername`,key:`accountUsername`},{title:`开户方式`,dataIndex:`openType`,key:`openType`,width:120,render:e=>(0,Q.jsx)(`span`,{style:{color:`#1e293b`},children:m[e]||e})},{title:`平台端口`,dataIndex:`portType`,key:`portType`,render:e=>({1:`巨量`,2:`磁力`,3:`巨量星图`,4:`服务单`,5:`腾讯`})[e]||e},{title:`授权刷新Token`,dataIndex:`refreshToken`,key:`refreshToken`},{title:`刷新Token过期时间`,dataIndex:`refreshTokenExpired`,key:`refreshTokenExpired`,render:e=>(0,Q.jsx)(`span`,{style:{color:`#64748b`},children:U9(e)})},{title:`授权Token`,dataIndex:`accessToken`,key:`accessToken`},{title:`Token过期时间`,dataIndex:`accessTokenExpired`,key:`accessTokenExpired`,render:e=>(0,Q.jsx)(`span`,{style:{color:`#64748b`},children:U9(e)})},{title:`创建时间`,dataIndex:`createdAt`,key:`createdAt`,width:180,render:e=>(0,Q.jsx)(`span`,{style:{color:`#64748b`},children:U9(e)})},{title:`更新时间`,dataIndex:`updatedAt`,key:`updatedAt`,width:180,render:e=>(0,Q.jsx)(`span`,{style:{color:`#64748b`},children:U9(e)})}],x=async()=>{try{let e=(await d5()).data||[],t={},n=[];e.forEach(e=>{t[e.openType]=e.typeName,n.push({value:e.openType,label:e.typeName})}),h(t),_(n)}catch(e){console.error(`加载开户方式列表失败:`,e)}},S=async()=>{r(!0);try{let e=await yHe({account_id:u||void 0,account_userid:f||void 0,open_type:v,page:i,page_size:o});t((e.data||[]).map((e,t)=>({...e,index:(i-1)*o+t+1}))),l(e.pagination?.total||0)}catch(e){console.error(`加载数据失败:`,e)}finally{r(!1)}};(0,C.useEffect)(()=>{x(),S()},[i,o]);let w=()=>{a(1),S()};return(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12},children:[(0,Q.jsx)(_$,{style:{color:`#6366f1`,fontSize:16}}),(0,Q.jsx)(EGe,{strong:!0,style:{fontSize:16},children:`投放平台授权列表`})]}),(0,Q.jsx)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:16},children:(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:12,alignItems:`center`},children:[(0,Q.jsx)(MN,{placeholder:`授权绑定账户ID`,value:u,onChange:e=>d(e.target.value),style:{width:180},allowClear:!0,prefix:(0,Q.jsx)(hb,{}),onPressEnter:w}),(0,Q.jsx)(MN,{placeholder:`授权登录账户用户ID`,value:f,onChange:e=>p(e.target.value),style:{width:180},allowClear:!0,prefix:(0,Q.jsx)(hb,{}),onPressEnter:w}),(0,Q.jsx)(bb,{placeholder:`开户方式`,value:v,onChange:e=>y(e),style:{width:140},allowClear:!0,options:g}),(0,Q.jsx)(JS,{type:`primary`,onClick:w,children:`搜索`})]})}),(0,Q.jsx)(`div`,{style:{background:`#fff`,borderRadius:12,boxShadow:`0 1px 3px rgba(0,0,0,0.05)`},children:(0,Q.jsx)(nR,{dataSource:e,columns:b,loading:n,rowKey:`id`,bordered:!1,scroll:{x:`max-content`},pagination:{current:i,pageSize:o,total:c,showSizeChanger:!0,showTotal:e=>`共 ${e} 条记录`,onChange:(e,t)=>{a(e),s(t)}}})})]})},W9=[{key:`is_ad_high_quality_material`,label:`AD优质`,noLabel:`AD非优质素材`,unknownLabel:`AD未知`,yesColor:`green`,noColor:`red`,unknownColor:`default`},{key:`is_ecp_high_quality_material`,label:`千川优质`,noLabel:`千川非优质素材`,unknownLabel:`千川未知`,yesColor:`green`,noColor:`red`,unknownColor:`default`},{key:`is_local_high_quality_material`,label:`本地推优质`,noLabel:`本地推非优质`,unknownLabel:`本地推未知`,yesColor:`green`,noColor:`red`,unknownColor:`default`},{key:`is_inefficient_material`,label:`低效`,noLabel:`非低效`,unknownLabel:`是否低效未知`,yesColor:`red`,noColor:`green`,unknownColor:`default`},{key:`is_first_publish_material`,label:`首发`,noLabel:`非首发`,unknownLabel:`是否首发未知`,yesColor:`blue`,noColor:`default`,unknownColor:`default`}],OGe=({preResult:e})=>{let[t,n]=(0,C.useState)(null),[r,i]=(0,C.useState)(!1);if(C.useEffect(()=>{if(!e){n(null),i(!1);return}try{n(JSON.parse(e)),i(!1)}catch{n(null),i(!0)}},[e]),!e||r||!t)return(0,Q.jsx)(`span`,{style:{color:`#64748b`},children:`-`});let a=e=>{let n=W9.find(t=>t.key===e);if(!n)return null;let r=t[e],i=r===`YES`,a=r===`NO`;if(r===`UNKNOWN`)return null;let o,s;return i?(o=n.label,s=n.yesColor):a&&(o=n.noLabel,s=n.noColor),{tag:(0,Q.jsx)(hR,{color:s,style:{marginRight:6,fontSize:12,borderRadius:4},children:o},e),detail:{label:n.label.replace(`优质`,`优质素材`),value:o,color:s}}};return(0,Q.jsx)(_x,{content:(0,Q.jsxs)(`div`,{style:{maxWidth:500,padding:`8px 0`},children:[(0,Q.jsx)(Z.Text,{strong:!0,style:{fontSize:14,display:`block`,marginBottom:12,color:`#1e293b`},children:`前测结果详情`}),(0,Q.jsxs)(sM,{column:1,size:`small`,style:{marginBottom:12},children:[(0,Q.jsx)(sM.Item,{label:`视频ID`,labelStyle:{fontWeight:500,color:`#64748b`},contentStyle:{color:`#1e293b`},children:t.video_id}),(0,Q.jsx)(sM.Item,{label:`广告主ID`,labelStyle:{fontWeight:500,color:`#64748b`},contentStyle:{color:`#1e293b`},children:t.advertiser_id}),(0,Q.jsx)(sM.Item,{label:`素材ID`,labelStyle:{fontWeight:500,color:`#64748b`},contentStyle:{color:`#1e293b`},children:t.material_id})]}),(0,Q.jsx)(Z.Text,{strong:!0,style:{fontSize:12,color:`#64748b`,display:`block`,marginBottom:8},children:`质量评估`}),(0,Q.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:8,marginBottom:12},children:W9.map(e=>{let n=t[e.key],r=n===`YES`,i=n===`NO`;if(n===`UNKNOWN`)return null;let a,o;return r?(a=e.label,o=e.yesColor):i&&(a=e.noLabel,o=e.noColor),(0,Q.jsx)(hR,{color:o,style:{fontSize:12,borderRadius:4},children:a},e.key)})}),t.not_ad_high_quality_reason&&t.not_ad_high_quality_reason.length>0&&(0,Q.jsxs)(`div`,{style:{marginBottom:12},children:[(0,Q.jsx)(Z.Text,{strong:!0,style:{fontSize:12,color:`#ef4444`,display:`block`,marginBottom:8},children:`AD非优质原因`}),(0,Q.jsx)(oP,{dataSource:t.not_ad_high_quality_reason,renderItem:(e,t)=>(0,Q.jsxs)(oP.Item,{style:{padding:`4px 0`,fontSize:12,color:`#64748b`},children:[t+1,`. `,e]},t),size:`small`})]}),t.not_ecp_high_quality_reason&&t.not_ecp_high_quality_reason.length>0&&(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(Z.Text,{strong:!0,style:{fontSize:12,color:`#ef4444`,display:`block`,marginBottom:8},children:`千川非优质原因`}),(0,Q.jsx)(oP,{dataSource:t.not_ecp_high_quality_reason,renderItem:(e,t)=>(0,Q.jsxs)(oP.Item,{style:{padding:`4px 0`,fontSize:12,color:`#64748b`},children:[t+1,`. `,e]},t),size:`small`})]})]}),title:null,trigger:`hover`,placement:`topLeft`,overlayStyle:{borderRadius:12,boxShadow:`0 8px 24px rgba(0,0,0,0.12)`},children:(0,Q.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,alignItems:`center`,gap:4},children:W9.map(e=>a(e.key)?.tag)})})},G9=e=>{if(!e)return``;let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)} ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`},{Text:kGe}=Z,AGe=()=>{let[e,t]=(0,C.useState)([]),[n,r]=(0,C.useState)(!1),[i,a]=(0,C.useState)(1),[o,s]=(0,C.useState)(10),[c,l]=(0,C.useState)(0),[u,d]=(0,C.useState)(``),[f,p]=(0,C.useState)(``),[m,h]=(0,C.useState)(``),g=[{title:`序号`,dataIndex:`index`,key:`index`,width:60,render:e=>(0,Q.jsx)(`span`,{style:{color:`#64748b`},children:e})},{title:`ID`,dataIndex:`id`,key:`id`},{title:`广告主账户ID`,dataIndex:`advertiserId`,key:`advertiserId`},{title:`素材ID`,dataIndex:`materialId`,key:`materialId`,width:180},{title:`上传ID`,dataIndex:`uploadId`,key:`uploadId`,render:e=>{if(!e)return`-`;let t=e.length>12?`${e.slice(0,6)}...${e.slice(-4)}`:e;return(0,Q.jsx)(ux,{title:e,placement:`topLeft`,children:(0,Q.jsx)(Z.Text,{style:{fontSize:12},children:t})})}},{title:`预测试模板ID`,dataIndex:`preTestTemplateId`,key:`preTestTemplateId`},{title:`授权ID`,dataIndex:`oauthId`,key:`oauthId`},{title:`目标标ID`,dataIndex:`targetId`,key:`targetId`},{title:`目标表`,dataIndex:`targetTable`,key:`targetTable`},{title:`任务ID`,dataIndex:`taskId`,key:`taskId`},{title:`用户ID`,dataIndex:`userId`,key:`userId`},{title:`备注`,dataIndex:`note`,key:`note`,width:200,render:e=>(0,Q.jsx)(MN.TextArea,{value:e||``,readOnly:!0,autoSize:{minRows:1,maxRows:4},style:{color:`#94a3b8`,resize:`none`,border:`none`,background:`transparent`,padding:0},placeholder:`-`})},{title:`预测试结果`,dataIndex:`preResult`,key:`preResult`,width:120,render:e=>(0,Q.jsx)(OGe,{preResult:e})},{title:`资源类型`,dataIndex:`resourceType`,key:`resourceType`,width:100,render:e=>(0,Q.jsx)(hR,{color:e===`video`?`blue`:`green`,children:e===`video`?`视频`:`图片`})},{title:`状态`,dataIndex:`status`,key:`status`,width:100,render:e=>(0,Q.jsx)(hR,{color:e===`SUCCESS`?`green`:e===`PENDING`?`orange`:`red`,children:e===`SUCCESS`?`成功`:e===`PENDING`?`处理中`:`失败`})},{title:`创建时间`,dataIndex:`createdAt`,key:`createdAt`,width:180,render:e=>(0,Q.jsx)(`span`,{style:{color:`#64748b`},children:G9(e)})},{title:`更新时间`,dataIndex:`updatedAt`,key:`updatedAt`,width:180,render:e=>(0,Q.jsx)(`span`,{style:{color:`#64748b`},children:G9(e)})}],_=async()=>{r(!0);try{let e=await bHe({material_id:u||void 0,upload_id:f||void 0,resource_type:m||void 0,page:i,page_size:o});t((e.data||[]).map((e,t)=>({...e,index:(i-1)*o+t+1}))),l(e.pagination?.total||0)}catch(e){console.error(`加载数据失败:`,e)}finally{r(!1)}};(0,C.useEffect)(()=>{_()},[i,o]);let v=()=>{a(1),_()};return(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12},children:[(0,Q.jsx)(DM,{style:{color:`#6366f1`,fontSize:16}}),(0,Q.jsx)(kGe,{strong:!0,style:{fontSize:16},children:`素材ID列表`})]}),(0,Q.jsx)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:16},children:(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:12,alignItems:`center`},children:[(0,Q.jsx)(MN,{placeholder:`素材ID`,value:u,onChange:e=>d(e.target.value),style:{width:160},allowClear:!0,onPressEnter:v}),(0,Q.jsx)(MN,{placeholder:`上传ID`,value:f,onChange:e=>p(e.target.value),style:{width:160},allowClear:!0,onPressEnter:v}),(0,Q.jsx)(MN,{placeholder:`文件名`,value:m,onChange:e=>h(e.target.value),style:{width:140},allowClear:!0,onPressEnter:v}),(0,Q.jsx)(bb,{placeholder:`资源类型`,value:m,onChange:e=>h(e),style:{width:120},allowClear:!0,options:[{value:`image`,label:`图片`},{value:`video`,label:`视频`}]}),(0,Q.jsx)(JS,{type:`primary`,onClick:v,children:`搜索`})]})}),(0,Q.jsxs)(`div`,{style:{background:`#fff`,borderRadius:12,boxShadow:`0 1px 3px rgba(0,0,0,0.05)`},children:[(0,Q.jsx)(nR,{dataSource:e,columns:g,loading:n,pagination:!1,rowKey:`id`,bordered:!1,scroll:{x:`max-content`}}),(0,Q.jsx)(`div`,{style:{padding:`16px`,textAlign:`right`},children:(0,Q.jsx)(JN,{current:i,pageSize:o,total:c,showSizeChanger:!0,showTotal:e=>`共 ${e} 条记录`,onChange:(e,t)=>{a(e),s(t)},size:`small`})})]})]})},{Title:jGe,Text:K9}=Z,q9=20,MGe=[{label:`全部素材库`,value:``},{label:`真人认证`,value:`real_person`},{label:`虚拟人像`,value:`aigc_virtual`}],NGe=[{label:`全部类型`,value:``},{label:`图片`,value:`Image`},{label:`视频`,value:`Video`}],PGe=[{label:`全部项目状态`,value:``},{label:`可用`,value:`active`},{label:`认证中`,value:`validating`},{label:`认证失败`,value:`validate_failed`},{label:`创建远端组中`,value:`creating_remote_group`},{label:`创建远端组失败`,value:`create_group_failed`},{label:`已删除`,value:`deleted`}],FGe=[{label:`全部素材状态`,value:``},{label:`创建中`,value:`creating`},{label:`处理中`,value:`Processing`},{label:`可用`,value:`Active`},{label:`失败`,value:`Failed`},{label:`本地已删`,value:`local_deleted`},{label:`远端已删`,value:`remote_deleted`},{label:`删除失败`,value:`delete_failed`}],J9=e=>e===`real_person`?`真人认证`:e===`aigc_virtual`?`虚拟人像`:e||`-`,Y9=e=>e===`real_person`?`purple`:e===`aigc_virtual`?`cyan`:`default`,X9=e=>e===`Active`||e===`active`?`green`:e===`Processing`||e===`creating_remote_group`||e===`validating`||e===`creating`?`blue`:e===`Failed`||e===`failed`||e===`delete_failed`||e===`validate_failed`||e===`create_group_failed`?`red`:(e?.includes(`deleted`),`default`),IGe=e=>e===`Image`?`图片`:e===`Video`?`视频`:e||`-`,Z9=(e,t=10)=>e?e.length<=t*2+3?e:`${e.slice(0,t)}...${e.slice(-t)}`:`-`,Q9=async e=>{e&&(await navigator.clipboard?.writeText(e),mP.success(`已复制`))},$9=e=>{if(!e)return``;let t=String(e).trim();return!t||t.startsWith(`asset://`)?``:A9(t)},LGe=({asset:e})=>{let t=$9(e.displayUrl||e.previewUrl||e.remoteUrl||e.sourceUrl),n=$9(e.videoCoverUrl||e.previewUrl||e.displayUrl||e.sourceUrl);return e.assetType===`Video`?(0,Q.jsxs)(`div`,{style:{width:72,height:52,borderRadius:10,overflow:`hidden`,background:`#f5f3ff`,display:`flex`,alignItems:`center`,justifyContent:`center`,position:`relative`},children:[n?(0,Q.jsx)(`img`,{src:n,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,Q.jsx)(r0,{style:{fontSize:24,color:`#8b5cf6`}}),t?(0,Q.jsx)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,style:{position:`absolute`,inset:0}}):null,(0,Q.jsx)(r0,{style:{position:`absolute`,color:`#fff`,fontSize:22,filter:`drop-shadow(0 1px 3px rgba(0,0,0,.45))`}})]}):t?(0,Q.jsx)(vN,{width:72,height:52,src:t,style:{objectFit:`cover`,borderRadius:10}}):(0,Q.jsx)(`div`,{style:{width:72,height:52,borderRadius:10,background:`#f5f5f5`}})},RGe=()=>{let[e,t]=(0,C.useState)([]),[n,r]=(0,C.useState)([]),[i,a]=(0,C.useState)(0),[o,s]=(0,C.useState)(0),[c,l]=(0,C.useState)(!1),[u,d]=(0,C.useState)(!1),[f,p]=(0,C.useState)(``),[m,h]=(0,C.useState)(``),[g,_]=(0,C.useState)(``),[v,y]=(0,C.useState)(``),[b,x]=(0,C.useState)(``),[S,w]=(0,C.useState)(),[T,E]=(0,C.useState)(1),[D,O]=(0,C.useState)(1),k=(0,C.useMemo)(()=>({keyword:f.trim()||void 0,libraryType:m||void 0,assetType:g||void 0,projectStatus:v||void 0,assetStatus:b||void 0}),[f,m,g,v,b]),A=async()=>{l(!0);try{let e=await SHe({keyword:k.keyword,libraryType:k.libraryType,status:k.projectStatus,page:T,pageSize:q9});t(e.items||[]),a(e.total||0)}catch(e){mP.error(e?.message||`加载私域人像素材项目失败`)}finally{l(!1)}},j=async()=>{d(!0);try{let e=await CHe({projectId:S,keyword:k.keyword,libraryType:k.libraryType,assetType:k.assetType,status:k.assetStatus,page:D,pageSize:q9});r(e.items||[]),s(e.total||0)}catch(e){mP.error(e?.message||`加载私域人像素材失败`)}finally{d(!1)}};(0,C.useEffect)(()=>{A()},[T,k.libraryType,k.projectStatus]),(0,C.useEffect)(()=>{j()},[S,D,k.libraryType,k.assetType,k.assetStatus]);let M=()=>{E(1),O(1),setTimeout(()=>{A(),j()},0)},N=()=>{p(``),h(``),_(``),y(``),x(``),w(void 0),E(1),O(1)},P=(0,C.useMemo)(()=>e.reduce((e,t)=>(e.asset+=t.assetCount||0,e.image+=t.imageAssetCount||0,e.video+=t.videoAssetCount||0,e.active+=t.activeAssetCount||0,e),{asset:0,image:0,video:0,active:0}),[e]),F=[{title:`项目名称`,dataIndex:`name`,width:200,fixed:`left`,render:(e,t)=>(0,Q.jsx)(JS,{type:`link`,onClick:()=>{w(t.id),O(1)},children:e})},{title:`类型`,dataIndex:`libraryType`,width:110,render:e=>(0,Q.jsx)(hR,{color:Y9(e),children:J9(e)})},{title:`用户ID`,dataIndex:`userId`,width:170,render:e=>(0,Q.jsx)(K9,{code:!0,copyable:!!e,children:e||`-`})},{title:`状态`,dataIndex:`status`,width:130,render:e=>(0,Q.jsx)(hR,{color:X9(e),children:e})},{title:`素材`,width:170,render:(e,t)=>(0,Q.jsxs)(CM,{size:4,children:[(0,Q.jsxs)(hR,{children:[`总 `,t.assetCount||0]}),(0,Q.jsxs)(hR,{color:`blue`,children:[`图 `,t.imageAssetCount||0]}),(0,Q.jsxs)(hR,{color:`geekblue`,children:[`视 `,t.videoAssetCount||0]})]})},{title:`Active`,dataIndex:`activeAssetCount`,width:90},{title:`ProjectName`,dataIndex:`remoteProjectName`,width:180,render:e=>(0,Q.jsx)(K9,{code:!0,copyable:!!e,children:e||`-`})},{title:`创建时间`,dataIndex:`createdAt`,width:170,render:C5},{title:`更新时间`,dataIndex:`updatedAt`,width:170,render:C5}],I=[{title:`预览`,width:100,fixed:`left`,render:(e,t)=>(0,Q.jsx)(LGe,{asset:t})},{title:`素材名称`,dataIndex:`name`,width:180,render:(e,t)=>(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(K9,{strong:!0,children:e||`未命名素材`}),(0,Q.jsx)(`br`,{}),(0,Q.jsx)(K9,{type:`secondary`,children:IGe(t.assetType)})]})},{title:`库类型`,dataIndex:`libraryType`,width:110,render:e=>(0,Q.jsx)(hR,{color:Y9(e),children:J9(e)})},{title:`用户ID`,dataIndex:`userId`,width:170,render:e=>(0,Q.jsx)(K9,{code:!0,copyable:!!e,children:e||`-`})},{title:`本地项目`,dataIndex:`projectName`,width:160,render:e=>e||`-`},{title:`状态`,dataIndex:`status`,width:120,render:e=>(0,Q.jsx)(hR,{color:X9(e),children:e})},{title:`AssetId`,dataIndex:`remoteAssetId`,width:190,render:e=>(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(K9,{code:!0,children:Z9(e)}),e?(0,Q.jsx)(JS,{size:`small`,type:`text`,icon:(0,Q.jsx)(WR,{}),onClick:()=>Q9(e)}):null]})},{title:`GroupId`,dataIndex:`remoteGroupId`,width:190,render:e=>(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(K9,{code:!0,children:Z9(e)}),e?(0,Q.jsx)(JS,{size:`small`,type:`text`,icon:(0,Q.jsx)(WR,{}),onClick:()=>Q9(e)}):null]})},{title:`轮询`,width:160,render:(e,t)=>(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(K9,{children:[`次数:`,t.pollCount||0]}),(0,Q.jsx)(`br`,{}),(0,Q.jsxs)(K9,{type:`secondary`,children:[`下次:`,C5(t.nextPollAt)]})]})},{title:`错误`,dataIndex:`errorMessage`,width:240,ellipsis:!0,render:e=>e?(0,Q.jsx)(ux,{title:e,children:(0,Q.jsx)(K9,{type:`danger`,children:e})}):`-`},{title:`创建时间`,dataIndex:`createdAt`,width:170,render:C5}];return(0,Q.jsxs)(`div`,{style:{padding:24,background:`#f7f7fb`,minHeight:`100%`},children:[(0,Q.jsxs)(CM,{style:{width:`100%`,justifyContent:`space-between`,marginBottom:16},align:`start`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(jGe,{level:3,style:{margin:0},children:`私域人像素材库`}),(0,Q.jsx)(K9,{type:`secondary`,children:`统一查看真人认证素材与虚拟人像素材,支持图片/视频资产状态排查。`})]}),(0,Q.jsxs)(CM,{wrap:!0,children:[(0,Q.jsx)(MN,{allowClear:!0,prefix:(0,Q.jsx)(hb,{}),placeholder:`搜索项目/素材`,value:f,onChange:e=>p(e.target.value),onPressEnter:M,style:{width:240}}),(0,Q.jsx)(bb,{value:m,onChange:e=>{h(e),E(1),O(1)},options:MGe,style:{width:150}}),(0,Q.jsx)(bb,{value:g,onChange:e=>{_(e),O(1)},options:NGe,style:{width:130}}),(0,Q.jsx)(JS,{icon:(0,Q.jsx)(hb,{}),type:`primary`,onClick:M,children:`查询`}),(0,Q.jsx)(JS,{onClick:N,children:`重置`}),(0,Q.jsx)(JS,{icon:(0,Q.jsx)(MP,{}),onClick:()=>{A(),j()},children:`刷新`})]})]}),(0,Q.jsxs)(CM,{size:16,wrap:!0,style:{marginBottom:16},children:[(0,Q.jsx)(OA,{style:{width:180},children:(0,Q.jsx)(RP,{title:`项目数`,value:i})}),(0,Q.jsx)(OA,{style:{width:180},children:(0,Q.jsx)(RP,{title:`当前页素材`,value:P.asset})}),(0,Q.jsx)(OA,{style:{width:180},children:(0,Q.jsx)(RP,{title:`图片`,value:P.image})}),(0,Q.jsx)(OA,{style:{width:180},children:(0,Q.jsx)(RP,{title:`视频`,value:P.video})}),(0,Q.jsx)(OA,{style:{width:180},children:(0,Q.jsx)(RP,{title:`Active`,value:P.active})})]}),(0,Q.jsx)(OA,{title:`项目组`,style:{marginBottom:16,borderRadius:14},extra:(0,Q.jsx)(bb,{value:v,onChange:e=>{y(e),E(1)},options:PGe,style:{width:180}}),children:(0,Q.jsx)(nR,{rowKey:`id`,columns:F,dataSource:e,loading:c,pagination:{current:T,pageSize:q9,total:i,onChange:E},size:`small`,scroll:{x:1350}})}),(0,Q.jsx)(OA,{title:S?`项目素材明细`:`全部素材明细`,style:{borderRadius:14},extra:(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(bb,{value:b,onChange:e=>{x(e),O(1)},options:FGe,style:{width:170}}),S?(0,Q.jsx)(JS,{size:`small`,onClick:()=>w(void 0),children:`查看全部`}):null]}),children:(0,Q.jsx)(nR,{rowKey:`id`,columns:I,dataSource:n,loading:u,pagination:{current:D,pageSize:q9,total:o,onChange:O},size:`small`,scroll:{x:1700}})})]})},zGe=({children:e})=>{let{user:t,loading:n,checkAuth:r}=v5();return(0,C.useEffect)(()=>{!localStorage.getItem(`auth_token`)&&!n&&!t&&(window.location.href=`/login`)},[t,n]),n?(0,Q.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,alignItems:`center`,height:`100vh`},children:(0,Q.jsx)(rP,{size:`large`})}):t?(0,Q.jsx)(Q.Fragment,{children:e}):(window.location.href=`/login`,null)};(0,v.createRoot)(document.getElementById(`root`)).render((0,Q.jsx)(()=>{let{checkAuth:e}=v5();return(0,C.useEffect)(()=>{e()},[]),(0,Q.jsx)($p,{locale:O8.default,theme:{token:{colorPrimary:`#6366f1`,borderRadius:8},components:{Button:{controlHeight:36,controlHeightLG:44},Card:{boxShadow:`0 1px 3px rgba(0,0,0,0.04)`},Table:{headerBg:`#fafbfc`}}},children:(0,Q.jsx)(Lv,{children:(0,Q.jsx)(_n,{children:(0,Q.jsxs)(kt,{children:[(0,Q.jsx)(Dt,{path:`/login`,element:(0,Q.jsx)(PHe,{})}),(0,Q.jsxs)(Dt,{path:`/`,element:(0,Q.jsx)(zGe,{children:(0,Q.jsx)(kHe,{})}),children:[(0,Q.jsx)(Dt,{index:!0,element:(0,Q.jsx)(FHe,{})}),(0,Q.jsx)(Dt,{path:`users`,element:(0,Q.jsx)(zHe,{})}),(0,Q.jsx)(Dt,{path:`teams`,element:(0,Q.jsx)(UHe,{})}),(0,Q.jsx)(Dt,{path:`credit-records`,element:(0,Q.jsx)(fUe,{})}),(0,Q.jsx)(Dt,{path:`models`,element:(0,Q.jsx)(k5,{})}),(0,Q.jsx)(Dt,{path:`credit-ratios`,element:(0,Q.jsx)(EUe,{})}),(0,Q.jsx)(Dt,{path:`video-engines`,element:(0,Q.jsx)(bUe,{})}),(0,Q.jsx)(Dt,{path:`image-engines`,element:(0,Q.jsx)(CUe,{})}),(0,Q.jsx)(Dt,{path:`industries`,element:(0,Q.jsx)(yUe,{})}),(0,Q.jsx)(Dt,{path:`menu-configs`,element:(0,Q.jsx)(AUe,{})}),(0,Q.jsx)(Dt,{path:`recharge-packages`,element:(0,Q.jsx)(NUe,{})}),(0,Q.jsx)(Dt,{path:`payment`,element:(0,Q.jsx)(pUe,{})}),(0,Q.jsx)(Dt,{path:`payment-stats`,element:(0,Q.jsx)(hUe,{})}),(0,Q.jsx)(Dt,{path:`settings`,element:(0,Q.jsx)(WHe,{})}),(0,Q.jsx)(Dt,{path:`video-prompt-schema-config`,element:(0,Q.jsx)(GWe,{})}),(0,Q.jsx)(Dt,{path:`video-upscale`,element:(0,Q.jsx)(ZWe,{})}),(0,Q.jsx)(Dt,{path:`notifications`,element:(0,Q.jsx)(GHe,{})}),(0,Q.jsx)(Dt,{path:`oauthapp-list`,element:(0,Q.jsx)(IUe,{})}),(0,Q.jsx)(Dt,{path:`operation-logs`,element:(0,Q.jsx)(FUe,{})}),(0,Q.jsx)(Dt,{path:`generation-records`,element:(0,Q.jsx)(VUe,{})}),(0,Q.jsx)(Dt,{path:`generation-ai`,element:(0,Q.jsx)(YUe,{})}),(0,Q.jsx)(Dt,{path:`hot-opening-replications`,element:(0,Q.jsx)(eWe,{})}),(0,Q.jsx)(Dt,{path:`hot-opening-replications/:projectId`,element:(0,Q.jsx)(xWe,{})}),(0,Q.jsx)(Dt,{path:`shot-replications`,element:(0,Q.jsx)(EWe,{})}),(0,Q.jsx)(Dt,{path:`shot-replications/task-sets/:taskSetId`,element:(0,Q.jsx)(FWe,{})}),(0,Q.jsx)(Dt,{path:`shot-replications/projects/:projectId`,element:(0,Q.jsx)(t9,{moduleType:`shot_replicate`})}),(0,Q.jsx)(Dt,{path:`authoriza`,element:(0,Q.jsx)(jHe,{})}),(0,Q.jsx)(Dt,{path:`consume`,element:(0,Q.jsx)(NHe,{})}),(0,Q.jsx)(Dt,{path:`platform`,element:(0,Q.jsx)(IHe,{})}),(0,Q.jsx)(Dt,{path:`contact-requests`,element:(0,Q.jsx)(QWe,{})}),(0,Q.jsx)(Dt,{path:`home-materials`,element:(0,Q.jsx)(SGe,{})}),(0,Q.jsx)(Dt,{path:`pretest-templates`,element:(0,Q.jsx)(TGe,{})}),(0,Q.jsx)(Dt,{path:`oauth-list`,element:(0,Q.jsx)(DGe,{})}),(0,Q.jsx)(Dt,{path:`material-list`,element:(0,Q.jsx)(AGe,{})}),(0,Q.jsx)(Dt,{path:`private-portrait-projects`,element:(0,Q.jsx)(RGe,{})})]}),(0,Q.jsx)(Dt,{path:`*`,element:(0,Q.jsx)(Tt,{to:`/`,replace:!0})})]})})})})},{})); \ No newline at end of file +`).filter(Boolean):n.target.value})})})]})})),[v]);return e||!c?(0,Q.jsx)(rP,{}):(0,Q.jsxs)(`div`,{style:{padding:24},children:[(0,Q.jsx)(OA,{children:(0,Q.jsxs)(CM,{direction:`vertical`,style:{width:`100%`},size:`large`,children:[(0,Q.jsxs)(FP,{justify:`space-between`,align:`middle`,children:[(0,Q.jsxs)(ZA,{children:[(0,Q.jsx)(IWe,{level:3,style:{margin:0},children:`视频提词 Schema 配置`}),(0,Q.jsx)(LWe,{type:`secondary`,style:{marginBottom:0},children:`配置会被爆款开头复刻和拆镜复刻第 4 步视频 AI 提词共同复用。传给 AI 时只保留纯键值 schema,不携带显示名、启用、可编辑等管理字段。`})]}),(0,Q.jsx)(ZA,{children:(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(f9,{children:`启用自定义配置`}),(0,Q.jsx)(eF,{checked:i,onChange:a}),o&&(0,Q.jsx)(hR,{color:`orange`,children:`当前使用默认配置兜底`}),u&&(0,Q.jsxs)(hR,{children:[`默认分组 `,u.sections.length]})]})})]}),(0,Q.jsx)(cf,{type:`info`,showIcon:!0,message:`长度限制策略`,description:`只对管理后台字段和用户可编辑字段做长度校验,不会自动裁剪 AI 生成结果或第 5 步最终视频 prompt。若供应商因为 prompt 过长拒绝,会按真实失败进入现有日志/退款/重试流程。`}),(0,Q.jsx)(cf,{type:`warning`,showIcon:!0,message:`预览说明`,description:`预览会跟随右上角「启用自定义配置」开关。关闭时会按默认 CLIENT_SCHEMA_V1 兜底预览;打开后才会按当前页面编辑的 sections 和秒数切片规则预览。`}),(0,Q.jsxs)(CM,{wrap:!0,children:[(0,Q.jsx)(JS,{type:`primary`,icon:(0,Q.jsx)(z2,{}),loading:n,onClick:S,children:`保存配置`}),(0,Q.jsx)(JS,{icon:(0,Q.jsx)(CN,{}),onClick:D,children:`预览运行时 Schema`}),(0,Q.jsx)(JS,{icon:(0,Q.jsx)(rB,{}),onClick:T,children:`导出 JSON`}),(0,Q.jsx)(JS,{icon:(0,Q.jsx)(k6,{}),onClick:()=>_.current?.click(),children:`导入 JSON`}),(0,Q.jsx)(yP,{title:`确认恢复默认配置?`,description:`会用 CLIENT_SCHEMA_V1 生成的默认配置覆盖当前配置。`,onConfirm:w,children:(0,Q.jsx)(JS,{icon:(0,Q.jsx)(MP,{}),children:`恢复默认`})}),(0,Q.jsx)(`input`,{ref:_,type:`file`,accept:`application/json,.json`,style:{display:`none`},onChange:E})]}),(0,Q.jsx)(EA,{items:[{key:`fields`,label:`Schema 字段配置`,children:(0,Q.jsxs)(CM,{direction:`vertical`,style:{width:`100%`},size:`middle`,children:[(0,Q.jsx)(cf,{type:`warning`,showIcon:!0,message:`字段说明`,description:`key 是最终传给 AI 和保存到 prompt_schema 的真实字段名,例如「素材理解」「动作流程」;label 只用于管理后台显示,帮助运营/管理员理解这个字段,不会传给 AI;启用关闭后该字段不会进入运行时 schema;可编辑关闭后用户在第 4 步修改时不能改这个字段。「画面属性」里的视频时长、视频比例、清晰度、帧率、推荐分辨率属于系统锁定参数,不能改 key、不能禁用、不能开放用户编辑。`}),(0,Q.jsx)(JS,{icon:(0,Q.jsx)(rA,{}),onClick:k,children:`新增一级分组`}),(0,Q.jsx)(Hh,{items:W})]})},{key:`time`,label:`秒数切片规则`,children:(0,Q.jsxs)(CM,{direction:`vertical`,style:{width:`100%`},size:`middle`,children:[(0,Q.jsx)(cf,{type:`info`,showIcon:!0,message:`切片规则说明`,description:`这里决定指定视频时长会被拆成几段,以及每段的阶段名称和说明。运行时会同步生成「动态时间规划」「动作流程」「镜头流程」三个数组,三者时间段保持一致。`}),(0,Q.jsx)(JS,{icon:(0,Q.jsx)(rA,{}),onClick:R,children:`新增秒数规则`}),y.map((e,t)=>(0,Q.jsxs)(OA,{size:`small`,title:`${e.minDuration}-${e.maxDuration} 秒:${e.segments.length} 段`,extra:(0,Q.jsx)(JS,{danger:!0,size:`small`,icon:(0,Q.jsx)(vR,{}),onClick:()=>B(t),children:`删除规则`}),children:[(0,Q.jsxs)(FP,{gutter:12,style:{marginBottom:12},children:[(0,Q.jsx)(ZA,{span:4,children:(0,Q.jsx)(xj,{min:1,value:e.minDuration,addonBefore:`最小秒`,style:{width:`100%`},onChange:e=>z(t,{minDuration:Number(e||1)})})}),(0,Q.jsx)(ZA,{span:4,children:(0,Q.jsx)(xj,{min:1,value:e.maxDuration,addonBefore:`最大秒`,style:{width:`100%`},onChange:e=>z(t,{maxDuration:Number(e||1)})})}),(0,Q.jsx)(ZA,{span:16,children:(0,Q.jsx)(JS,{size:`small`,icon:(0,Q.jsx)(rA,{}),onClick:()=>H(t),children:`新增片段`})})]}),(0,Q.jsx)(CM,{direction:`vertical`,style:{width:`100%`},children:e.segments.map((n,r)=>(0,Q.jsxs)(FP,{gutter:8,align:`middle`,children:[(0,Q.jsx)(ZA,{span:3,children:(0,Q.jsx)(xj,{min:.01,step:.01,value:e.ratios[r],addonBefore:`比例`,style:{width:`100%`},onChange:e=>V(t,r,{ratio:Number(e||.01)})})}),(0,Q.jsx)(ZA,{span:5,children:(0,Q.jsx)(MN,{value:n.stage,maxLength:64,placeholder:`阶段`,onChange:e=>V(t,r,{stage:e.target.value})})}),(0,Q.jsx)(ZA,{span:15,children:(0,Q.jsx)(MN,{value:n.description,maxLength:300,placeholder:`说明`,onChange:e=>V(t,r,{description:e.target.value})})}),(0,Q.jsx)(ZA,{span:1,children:(0,Q.jsx)(JS,{danger:!0,size:`small`,icon:(0,Q.jsx)(vR,{}),onClick:()=>U(t,r)})})]},r))})]},t))]})},{key:`json`,label:`JSON 高级查看`,children:(0,Q.jsx)(p9,{rows:24,value:JSON.stringify(S9(c,i),null,2),readOnly:!0})}]})]})}),(0,Q.jsxs)(gP,{title:`预览运行时 Schema`,open:f,onCancel:()=>p(!1),width:980,footer:(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(JS,{onClick:()=>p(!1),children:`关闭`}),(0,Q.jsx)(JS,{type:`primary`,onClick:O,children:`生成预览`})]}),children:[(0,Q.jsxs)(X,{form:g,layout:`inline`,style:{marginBottom:16},children:[(0,Q.jsx)(X.Item,{name:`duration`,label:`时长`,rules:[{required:!0}],children:(0,Q.jsx)(xj,{min:1,max:3600})}),(0,Q.jsx)(X.Item,{name:`aspectRatio`,label:`比例`,rules:[{required:!0}],children:(0,Q.jsx)(MN,{})}),(0,Q.jsx)(X.Item,{name:`resolution`,label:`清晰度`,rules:[{required:!0}],children:(0,Q.jsx)(MN,{})}),(0,Q.jsx)(X.Item,{name:`frameRate`,label:`帧率`,rules:[{required:!0}],children:(0,Q.jsx)(MN,{})})]}),(0,Q.jsx)(yue,{}),m?(0,Q.jsx)(EA,{items:[{key:`runtime`,label:`运行时 Schema`,children:(0,Q.jsx)(p9,{rows:24,value:JSON.stringify(C9(m),null,2),readOnly:!0})},{key:`timePlan`,label:`动态时间规划(${w9(m).length} 段)`,children:(0,Q.jsx)(p9,{rows:24,value:JSON.stringify(w9(m),null,2),readOnly:!0})},{key:`snapshot`,label:`配置快照`,children:(0,Q.jsx)(p9,{rows:24,value:JSON.stringify(HWe(m),null,2),readOnly:!0})}]}):(0,Q.jsx)(cf,{type:`info`,showIcon:!0,message:`点击生成预览后,可以看到传给 AI 的纯 schema、动态时间规划和本次配置快照。`})]})]})},{Title:KWe,Text:E9,Paragraph:qWe}=Z,JWe=[{key:`local_ffmpeg_crop_v1`,label:`本地 FFmpeg(crop)`},{key:`volc_standard_v1`,label:`火山画质增强(标准版)`},{key:`volc_professional_v1`,label:`火山画质增强(专业版)`},{key:`volc_large_model_v1`,label:`火山画质增强(大模型)`}],D9=[`480p`,`720p`,`1080p`,`2K`,`4K`].map(e=>({label:e,value:e})),YWe=()=>({targetResolution:`1080p`,providerGenerationResolution:`720p`,processorKey:`local_ffmpeg_crop_v1`,enabled:!0});function O9(e){return{enabled:!!e.enabled,version:Number(e.version||1),deleteSourceAfterSuccess:e.deleteSourceAfterSuccess!==!1,rules:Array.isArray(e.rules)?e.rules.map(e=>({...e})):[]}}function XWe(e){return{data:{enabled:e.enabled,version:e.version,delete_source_after_success:e.deleteSourceAfterSuccess,rules:e.rules.map(e=>({target_resolution:e.targetResolution,provider_generation_resolution:e.providerGenerationResolution,processor_key:e.processorKey,enabled:e.enabled}))}}}var ZWe=()=>{let{message:e,modal:t}=Lv.useApp(),[n,r]=(0,C.useState)(!0),[i,a]=(0,C.useState)(!1),[o,s]=(0,C.useState)(null),c=(0,C.useCallback)(async()=>{r(!0);try{s(O9((await MBe()).data))}catch(t){e.error(t instanceof Error?t.message:`读取视频超分配置失败`)}finally{r(!1)}},[e]);(0,C.useEffect)(()=>{c()},[c]);let l=(e,t)=>{s(n=>n&&{...n,rules:n.rules.map((n,r)=>r===e?{...n,...t}:n)})},u=e=>{s(t=>t&&{...t,rules:t.rules.filter((t,n)=>n!==e)})},d=()=>{s(e=>e&&{...e,rules:[...e.rules,YWe()]})},f=async()=>{if(!o)return;let t=o.rules.filter(e=>e.enabled).map(e=>e.targetResolution.trim().toLowerCase());if(new Set(t).size!==t.length){e.error(`同一个客户目标分辨率只能存在一条启用规则`);return}a(!0);try{let t=await NBe(XWe(o));s(O9(t.data)),e.success(`视频超分配置已保存,版本 ${t.data.version}`)}catch(t){e.error(t instanceof Error?t.message:`保存失败`)}finally{a(!1)}};return n||!o?(0,Q.jsx)(`div`,{style:{minHeight:360,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,Q.jsx)(rP,{size:`large`})}):(0,Q.jsxs)(CM,{direction:`vertical`,size:16,style:{width:`100%`},children:[(0,Q.jsxs)(OA,{children:[(0,Q.jsxs)(FP,{justify:`space-between`,align:`middle`,gutter:[16,16],children:[(0,Q.jsxs)(ZA,{children:[(0,Q.jsx)(KWe,{level:3,style:{margin:0},children:`视频超分配置`}),(0,Q.jsx)(qWe,{type:`secondary`,style:{margin:`8px 0 0`},children:`规则只按客户选择的目标分辨率匹配。视频比例和最终像素由客户任务参数在创建任务时自动计算并固化快照。`})]}),(0,Q.jsx)(ZA,{children:(0,Q.jsxs)(CM,{children:[(0,Q.jsxs)(hR,{children:[`配置版本 `,o.version]}),(0,Q.jsx)(JS,{icon:(0,Q.jsx)(MP,{}),onClick:()=>void c(),children:`重新加载`}),(0,Q.jsx)(JS,{type:`primary`,icon:(0,Q.jsx)(z2,{}),loading:i,onClick:()=>void f(),children:`保存配置`})]})})]}),(0,Q.jsxs)(CM,{direction:`vertical`,size:14,style:{marginTop:20},children:[(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(E9,{strong:!0,children:`全局开启超分`}),(0,Q.jsx)(eF,{checked:o.enabled,onChange:e=>s({...o,enabled:e})}),(0,Q.jsx)(E9,{type:`secondary`,children:`关闭后新任务走原流程,已经创建的任务仍按自身快照执行。`})]}),(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(E9,{strong:!0,children:`超分成功后删除源视频`}),(0,Q.jsx)(eF,{checked:o.deleteSourceAfterSuccess,onChange:e=>s({...o,deleteSourceAfterSuccess:e})}),(0,Q.jsx)(E9,{type:`secondary`,children:`默认开启。关闭仅用于调试,会保留超分前源视频并持续占用服务器磁盘;超分失败时始终保留源视频。`})]})]})]}),(0,Q.jsx)(OA,{title:`目标分辨率规则`,extra:(0,Q.jsx)(JS,{icon:(0,Q.jsx)(rA,{}),onClick:d,children:`新增规则`}),children:o.rules.length===0?(0,Q.jsx)(Wy,{description:`暂无规则;未匹配规则的视频任务继续走原流程`}):(0,Q.jsx)(CM,{direction:`vertical`,size:12,style:{width:`100%`},children:o.rules.map((e,n)=>{let r=e.enabled&&o.rules.filter(t=>t.enabled&&t.targetResolution.toLowerCase()===e.targetResolution.toLowerCase()).length>1;return(0,Q.jsx)(OA,{size:`small`,children:(0,Q.jsxs)(FP,{gutter:[12,12],align:`bottom`,children:[(0,Q.jsxs)(ZA,{xs:24,md:5,children:[(0,Q.jsx)(E9,{type:`secondary`,children:`客户选择分辨率`}),(0,Q.jsx)(bb,{value:e.targetResolution,options:D9,style:{width:`100%`,marginTop:4},onChange:e=>l(n,{targetResolution:e}),status:r?`error`:void 0})]}),(0,Q.jsxs)(ZA,{xs:24,md:5,children:[(0,Q.jsx)(E9,{type:`secondary`,children:`实际生成分辨率`}),(0,Q.jsx)(bb,{value:e.providerGenerationResolution,options:D9,style:{width:`100%`,marginTop:4},onChange:e=>l(n,{providerGenerationResolution:e})})]}),(0,Q.jsxs)(ZA,{xs:24,md:7,children:[(0,Q.jsx)(E9,{type:`secondary`,children:`处理方式`}),(0,Q.jsx)(bb,{value:e.processorKey,options:JWe.map(e=>({value:e.key,label:e.label})),style:{width:`100%`,marginTop:4},onChange:e=>l(n,{processorKey:e})})]}),(0,Q.jsxs)(ZA,{xs:12,md:2,children:[(0,Q.jsx)(E9,{type:`secondary`,children:`启用`}),(0,Q.jsx)(`div`,{style:{marginTop:8},children:(0,Q.jsx)(eF,{checked:e.enabled,onChange:e=>l(n,{enabled:e})})})]}),(0,Q.jsx)(ZA,{xs:12,md:2,children:(0,Q.jsx)(JS,{danger:!0,icon:(0,Q.jsx)(vR,{}),onClick:()=>t.confirm({title:`删除这条超分规则?`,onOk:()=>u(n)})})}),(0,Q.jsx)(ZA,{span:24,children:(0,Q.jsx)(E9,{type:`secondary`,children:`客户选择该目标分辨率时,无论横屏、竖屏或方形比例,都按本规则选择的实际分辨率生成;最终像素由任务比例自动计算。`})})]})},`${n}-${e.targetResolution}`)})})})]})},QWe=()=>{let[e,t]=(0,C.useState)([]),[n,r]=(0,C.useState)(0),[i,a]=(0,C.useState)(!1),[o,s]=(0,C.useState)(1),[c,l]=(0,C.useState)(10),[u,d]=(0,C.useState)(null),[f,p]=(0,C.useState)(null),[m,h]=(0,C.useState)(!1),{user:g}=v5(),_=async()=>{a(!0);try{let e=new URLSearchParams;e.set(`page`,String(o)),e.set(`page_size`,String(c)),u!==null&&e.set(`is_handled`,String(u));let n=await G8.get(`/admin/contact-requests?${e.toString()}`);t(n.items),r(n.total)}catch(e){mP.error(e?.message||`获取失败`)}finally{a(!1)}};(0,C.useEffect)(()=>{_()},[o,c,u]);let v=async e=>{try{await G8.put(`/admin/contact-requests/${e}/handle`),mP.success(`已标记为处理`),_()}catch(e){mP.error(e?.message||`操作失败`)}},y=async e=>{try{await G8.delete(`/admin/contact-requests/${e}`),mP.success(`已删除`),_()}catch(e){mP.error(e?.message||`删除失败`)}},b=e=>{p(e),h(!0)};return(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(OA,{variant:`outlined`,style:{borderRadius:12,border:`1px solid #f0f0f5`},children:[(0,Q.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,marginBottom:16},children:[(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(Y$,{style:{fontSize:18,color:`#6366f1`}}),(0,Q.jsx)(Z.Text,{strong:!0,style:{fontSize:16},children:`联系请求管理`}),(0,Q.jsxs)(hR,{color:`purple`,children:[`共 `,n,` 条记录`]})]}),(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,Q.jsx)(JS,{type:u===null?`primary`:`default`,onClick:()=>d(null),icon:(0,Q.jsx)(PX,{}),size:`small`,children:`全部`}),(0,Q.jsx)(JS,{type:u===!1?`primary`:`default`,onClick:()=>d(!1),size:`small`,children:`待处理`}),(0,Q.jsx)(JS,{type:u===!0?`primary`:`default`,onClick:()=>d(!0),size:`small`,children:`已处理`})]})]}),i?(0,Q.jsx)(`div`,{style:{textAlign:`center`,padding:40},children:`加载中...`}):e.length===0?(0,Q.jsx)(Wy,{description:`暂无联系请求`,style:{padding:`40px 0`}}):(0,Q.jsx)(nR,{columns:[{title:`姓名`,dataIndex:`name`,key:`name`,width:100,render:e=>(0,Q.jsx)(Z.Text,{strong:!0,children:e})},{title:`手机号`,dataIndex:`phone`,key:`phone`,width:120},{title:`公司名称`,dataIndex:`companyName`,key:`companyName`,width:150,ellipsis:!0},{title:`行业`,dataIndex:`industry`,key:`industry`,width:120},{title:`状态`,dataIndex:`isHandled`,key:`isHandled`,width:80,render:e=>(0,Q.jsx)(hR,{color:e?`green`:`orange`,children:e?`已处理`:`待处理`})},{title:`提交时间`,dataIndex:`createdAt`,key:`createdAt`,width:160,render:e=>C5(e)},{title:`操作`,key:`actions`,width:180,render:(e,t)=>(0,Q.jsxs)(CM,{size:4,children:[(0,Q.jsx)(JS,{type:`link`,size:`small`,icon:(0,Q.jsx)(CN,{}),onClick:()=>b(t),children:`查看`}),!t.isHandled&&(0,Q.jsx)(JS,{type:`link`,size:`small`,icon:(0,Q.jsx)(lb,{}),onClick:()=>v(t.id),children:`标记处理`}),(0,Q.jsx)(yP,{title:`确定删除该记录?`,onConfirm:()=>y(t.id),children:(0,Q.jsx)(JS,{type:`link`,danger:!0,size:`small`,icon:(0,Q.jsx)(vR,{}),children:`删除`})})]})}],dataSource:e,rowKey:`id`,loading:i,pagination:{current:o,pageSize:c,total:n,onChange:(e,t)=>{s(e),l(t)},showSizeChanger:!0,showTotal:e=>`共 ${e} 条记录`},scroll:{x:900}})]}),(0,Q.jsx)(gP,{title:(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(CN,{}),`联系请求详情`]}),open:m,onCancel:()=>h(!1),footer:null,width:500,children:f&&(0,Q.jsxs)(`div`,{style:{padding:8},children:[(0,Q.jsxs)(`div`,{style:{marginBottom:16},children:[(0,Q.jsxs)(Z.Title,{level:4,style:{marginBottom:16},children:[f.name,(0,Q.jsx)(hR,{color:f.isHandled?`green`:`orange`,style:{marginLeft:12},children:f.isHandled?`已处理`:`待处理`})]}),(0,Q.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`120px 1fr`,gap:12},children:[(0,Q.jsx)(Z.Text,{style:{color:`#64748b`},children:`手机号:`}),(0,Q.jsx)(Z.Text,{children:f.phone}),(0,Q.jsx)(Z.Text,{style:{color:`#64748b`},children:`公司名称:`}),(0,Q.jsx)(Z.Text,{children:f.companyName}),(0,Q.jsx)(Z.Text,{style:{color:`#64748b`},children:`行业:`}),(0,Q.jsx)(Z.Text,{children:f.industry}),(0,Q.jsx)(Z.Text,{style:{color:`#64748b`},children:`提交时间:`}),(0,Q.jsx)(Z.Text,{children:C5(f.createdAt)}),f.message&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Z.Text,{style:{color:`#64748b`},children:`留言:`}),(0,Q.jsx)(Z.Text,{children:f.message})]})]})]}),(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:12},children:[!f.isHandled&&(0,Q.jsx)(JS,{type:`primary`,onClick:()=>{v(f.id),h(!1)},icon:(0,Q.jsx)(lb,{}),children:`标记为已处理`}),(0,Q.jsx)(JS,{onClick:()=>h(!1),children:`关闭`})]})]})})]})},k9=`http://ceshi.apiforeign.minzhong.cn`.replace(/\/$/,``).replace(/\/api\/?$/i,``).replace(/\/$/,``),$We=e=>/^(https?:)?\/\//i.test(e)||/^(blob|data):/i.test(e),A9=e=>{if(!e)return``;let t=String(e).trim();return t?$We(t)?t:k9?`${k9}${t.startsWith(`/`)?t:`/${t}`}`:t.startsWith(`/`)?t:`/${t}`:``},eGe=360,j9=280;function M9(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,e)):t}function tGe(e,t){let n=Math.max(0,e);if(!n)return{width:0,height:j9};if(!t?.width||!t?.height)return{width:n,height:j9};let r=Math.min(n/t.width,eGe/t.height);return{width:Math.max(1,Math.round(t.width*r)),height:Math.max(1,Math.round(t.height*r))}}function nGe(e,t){if(e.sizeMode===`px`&&e.widthPx)return M9(e.widthPx,1,Math.max(1,t));let n=M9(e.widthRatio??.18,.01,1);return Math.max(1,t*n)}function rGe(e){let t=e.marginX??24,n=e.marginY??24;switch(e.position){case`top_left`:return{left:t,top:n};case`top_center`:return{left:`50%`,top:n,transform:`translateX(-50%)`};case`top_right`:return{right:t,top:n};case`middle_left`:return{left:t,top:`50%`,transform:`translateY(-50%)`};case`center`:return{left:`50%`,top:`50%`,transform:`translate(-50%, -50%)`};case`middle_right`:return{right:t,top:`50%`,transform:`translateY(-50%)`};case`bottom_left`:return{left:t,bottom:n};case`bottom_center`:return{left:`50%`,bottom:n,transform:`translateX(-50%)`};default:return{right:t,bottom:n}}}function iGe(e){let t=e.textWatermark;return!t||!t.text?.trim()?null:{text:t.text.trim(),opacity_level:t.opacityLevel,font_size_px:t.fontSizePx,color:t.color,rotate_deg:t.rotateDeg,gap_x:t.gapX,gap_y:t.gapY,staggered:t.staggered}}var aGe=({mediaUrl:e,mediaType:t=`image`,watermarkUrl:n,config:r,onChange:i})=>{let a=(0,C.useRef)(null),o=(0,C.useRef)(null),s=(0,C.useRef)(null),c=(0,C.useRef)({x:0,y:0}),l=(0,C.useRef)(0),[u,d]=(0,C.useState)(0),[f,p]=(0,C.useState)(null),[m,h]=(0,C.useState)({width:0,height:0}),[g,_]=(0,C.useState)(!1),[v,y]=(0,C.useState)(``),[b,x]=(0,C.useState)(!1),[S,w]=(0,C.useState)(``),T=(0,C.useMemo)(()=>A9(e),[e]),E=(0,C.useMemo)(()=>A9(n),[n]),D=(0,C.useMemo)(()=>tGe(u,f),[u,f]),O=(0,C.useMemo)(()=>nGe(r,D.width),[r,D.width]),k=r.watermarkType===`repeated_text`;(0,C.useLayoutEffect)(()=>{if(!a.current)return;let e=()=>d(a.current?.clientWidth||0);e();let t=new ResizeObserver(e);return t.observe(a.current),()=>t.disconnect()},[]),(0,C.useLayoutEffect)(()=>{if(!s.current)return;let e=()=>{let e=s.current?.getBoundingClientRect();e&&h({width:e.width,height:e.height})};e();let t=new ResizeObserver(e);return t.observe(s.current),()=>t.disconnect()},[E,O]),(0,C.useEffect)(()=>{p(null),y(``),w(``)},[T,t]),(0,C.useEffect)(()=>{if(!k){y(``),x(!1),w(``);return}let e=iGe(r);if(!f?.width||!f.height||!e){y(``);return}let t=++l.current;x(!0),w(``);let n=window.setTimeout(async()=>{try{let n=await gHe({width:f.width,height:f.height,text_watermark:e});l.current===t&&y(n.previewLayerDataUrl)}catch(e){l.current===t&&(y(``),w(e instanceof Error?e.message:`文字水印预览生成失败`))}finally{l.current===t&&x(!1)}},300);return()=>window.clearTimeout(n)},[r,k,f]),(0,C.useEffect)(()=>{let e=e=>{if(!g||!o.current||!i||k)return;let t=o.current.getBoundingClientRect(),n=m.width||O,r=m.height||1,a=Math.max(1,t.width-n),s=Math.max(1,t.height-r),l=M9(e.clientX-t.left-c.current.x,0,a),u=M9(e.clientY-t.top-c.current.y,0,s);i({position:`custom`,customXRatio:Number((l/a).toFixed(4)),customYRatio:Number((u/s).toFixed(4))})},t=()=>_(!1);return window.addEventListener(`pointermove`,e),window.addEventListener(`pointerup`,t),window.addEventListener(`pointercancel`,t),()=>{window.removeEventListener(`pointermove`,e),window.removeEventListener(`pointerup`,t),window.removeEventListener(`pointercancel`,t)}},[g,k,i,m.height,m.width,O]);let A=(0,C.useMemo)(()=>{if(r.position!==`custom`)return rGe(r);let e=m.width||O,t=m.height||1,n=Math.max(0,D.width-e),i=Math.max(0,D.height-t),a=M9(r.customXRatio??.5,0,1),o=M9(r.customYRatio??.5,0,1);return{left:n*a,top:i*o,transform:`none`}},[r,D.height,D.width,m.height,m.width,O]);return(0,Q.jsx)(`div`,{ref:a,style:{position:`relative`,width:`100%`,minHeight:Math.max(j9,D.height),background:`#0f172a`,borderRadius:12,overflow:`hidden`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`},children:T?(0,Q.jsxs)(`div`,{ref:o,style:{position:`relative`,width:D.width||`100%`,height:D.height||j9,maxWidth:`100%`,overflow:`hidden`,background:`#000`},children:[t===`video`?(0,Q.jsx)(`video`,{src:T,controls:!0,onLoadedMetadata:e=>{let t=e.currentTarget;t.videoWidth&&t.videoHeight&&p({width:t.videoWidth,height:t.videoHeight})},style:{width:`100%`,height:`100%`,objectFit:`fill`,display:`block`}}):(0,Q.jsx)(`img`,{src:T,alt:`素材预览`,onLoad:e=>{let t=e.currentTarget;t.naturalWidth&&t.naturalHeight&&p({width:t.naturalWidth,height:t.naturalHeight})},style:{width:`100%`,height:`100%`,objectFit:`fill`,display:`block`}}),k&&v&&(0,Q.jsx)(`img`,{src:v,alt:`重复文字水印预览`,draggable:!1,style:{position:`absolute`,inset:0,width:`100%`,height:`100%`,objectFit:`fill`,zIndex:2,pointerEvents:`none`,userSelect:`none`}}),k&&(b||S)&&(0,Q.jsx)(`div`,{style:{position:`absolute`,left:12,bottom:12,zIndex:3,padding:`6px 10px`,borderRadius:8,background:`rgba(15, 23, 42, 0.82)`,color:`#e2e8f0`,fontSize:12},children:b?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(rP,{size:`small`}),` 正在生成精准预览...`]}):S}),!k&&E&&(0,Q.jsx)(`img`,{ref:s,src:E,alt:`水印预览`,draggable:!1,onLoad:e=>{let t=e.currentTarget.getBoundingClientRect();h({width:t.width,height:t.height})},onPointerDown:e=>{if(!i)return;e.preventDefault();let t=e.currentTarget.getBoundingClientRect();c.current={x:e.clientX-t.left,y:e.clientY-t.top},_(!0)},style:{position:`absolute`,zIndex:2,cursor:i?`move`:`default`,width:O,opacity:(r.opacityLevel??6)/10,userSelect:`none`,touchAction:`none`,pointerEvents:i?`auto`:`none`,...A}})]}):(0,Q.jsx)(`span`,{children:`上传素材后可预览水印效果`})})},oGe=[{label:`左上角`,value:`top_left`},{label:`顶部居中`,value:`top_center`},{label:`右上角`,value:`top_right`},{label:`左侧居中`,value:`middle_left`},{label:`正中间`,value:`center`},{label:`右侧居中`,value:`middle_right`},{label:`左下角`,value:`bottom_left`},{label:`底部居中`,value:`bottom_center`},{label:`右下角`,value:`bottom_right`},{label:`拖拽自定义`,value:`custom`}],N9={text:`民众智创`,opacityLevel:2,fontSizePx:28,color:`#ffffff`,rotateDeg:-30,gapX:220,gapY:140,staggered:!0},P9=({value:e,onChange:t,watermarks:n,mediaUrl:r,mediaType:i})=>{let a=n=>t({...e,...n}),o=t=>{a({textWatermark:{...N9,...e.textWatermark||{},...t}})},s=n.find(t=>t.id===e.watermarkId)?.fileUrl,c={...N9,...e.textWatermark||{}};return(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(X,{layout:`vertical`,children:[(0,Q.jsx)(X.Item,{label:`水印类型`,required:!0,children:(0,Q.jsxs)(jk.Group,{value:e.watermarkType||`image`,onChange:e=>{let t=e.target.value;a({watermarkType:t,textWatermark:t===`repeated_text`?c:null})},children:[(0,Q.jsx)(jk.Button,{value:`image`,children:`图片水印`}),(0,Q.jsx)(jk.Button,{value:`repeated_text`,children:`重复文字水印`})]})}),e.watermarkType===`repeated_text`?(0,Q.jsxs)(FP,{gutter:16,children:[(0,Q.jsx)(ZA,{span:24,children:(0,Q.jsx)(X.Item,{label:`水印文字`,required:!0,extra:`字体由后端固定开源可商用字体渲染,前端预览层和最终生成使用同一后端渲染逻辑。`,children:(0,Q.jsx)(MN,{maxLength:64,showCount:!0,value:c.text,onChange:e=>o({text:e.target.value}),placeholder:`请输入重复水印文字`})})}),(0,Q.jsx)(ZA,{span:12,children:(0,Q.jsx)(X.Item,{label:`文字透明度:${c.opacityLevel}/10`,required:!0,children:(0,Q.jsx)(Uj,{min:1,max:10,step:1,value:c.opacityLevel,onChange:e=>o({opacityLevel:e})})})}),(0,Q.jsx)(ZA,{span:12,children:(0,Q.jsx)(X.Item,{label:`字号(px)`,required:!0,children:(0,Q.jsx)(xj,{min:8,max:160,style:{width:`100%`},value:c.fontSizePx,onChange:e=>o({fontSizePx:Number(e||28)})})})}),(0,Q.jsx)(ZA,{span:12,children:(0,Q.jsx)(X.Item,{label:`文字颜色`,required:!0,children:(0,Q.jsx)(MN,{value:c.color,onChange:e=>o({color:e.target.value||`#ffffff`}),placeholder:`#ffffff`})})}),(0,Q.jsx)(ZA,{span:12,children:(0,Q.jsx)(X.Item,{label:`旋转角度`,required:!0,children:(0,Q.jsx)(xj,{min:-90,max:90,style:{width:`100%`},value:c.rotateDeg,onChange:e=>o({rotateDeg:Number(e??-30)})})})}),(0,Q.jsx)(ZA,{span:12,children:(0,Q.jsx)(X.Item,{label:`横向间距`,required:!0,children:(0,Q.jsx)(xj,{min:20,max:2e3,style:{width:`100%`},value:c.gapX,onChange:e=>o({gapX:Number(e||220)})})})}),(0,Q.jsx)(ZA,{span:12,children:(0,Q.jsx)(X.Item,{label:`纵向间距`,required:!0,children:(0,Q.jsx)(xj,{min:20,max:2e3,style:{width:`100%`},value:c.gapY,onChange:e=>o({gapY:Number(e||140)})})})}),(0,Q.jsx)(ZA,{span:12,children:(0,Q.jsx)(X.Item,{label:`交错排列`,valuePropName:`checked`,children:(0,Q.jsx)(eF,{checked:c.staggered,onChange:e=>o({staggered:e})})})})]}):(0,Q.jsxs)(FP,{gutter:16,children:[(0,Q.jsx)(ZA,{span:12,children:(0,Q.jsx)(X.Item,{label:`水印图片`,required:!0,children:(0,Q.jsx)(bb,{placeholder:`请选择水印`,value:e.watermarkId||void 0,onChange:e=>a({watermarkId:e}),options:n.map(e=>({label:`${e.name}${e.isDefault?`(默认)`:``}`,value:e.id}))})})}),(0,Q.jsx)(ZA,{span:12,children:(0,Q.jsx)(X.Item,{label:`透明度:${e.opacityLevel}/10`,required:!0,children:(0,Q.jsx)(Uj,{min:1,max:10,step:1,value:e.opacityLevel,onChange:e=>a({opacityLevel:e})})})}),(0,Q.jsx)(ZA,{span:12,children:(0,Q.jsx)(X.Item,{label:`水印位置`,required:!0,children:(0,Q.jsx)(bb,{value:e.position,onChange:e=>a({position:e}),options:oGe})})}),(0,Q.jsx)(ZA,{span:12,children:(0,Q.jsx)(X.Item,{label:`大小模式`,required:!0,children:(0,Q.jsx)(bb,{value:e.sizeMode,onChange:e=>a({sizeMode:e}),options:[{label:`按素材宽度比例`,value:`ratio`},{label:`固定像素宽度`,value:`px`}]})})}),e.sizeMode===`ratio`?(0,Q.jsx)(ZA,{span:12,children:(0,Q.jsx)(X.Item,{label:`水印宽度比例`,required:!0,children:(0,Q.jsx)(xj,{min:.01,max:1,step:.01,style:{width:`100%`},value:e.widthRatio??.18,onChange:e=>a({widthRatio:Number(e||.18)})})})}):(0,Q.jsx)(ZA,{span:12,children:(0,Q.jsx)(X.Item,{label:`水印宽度(px)`,required:!0,children:(0,Q.jsx)(xj,{min:1,max:1e4,style:{width:`100%`},value:e.widthPx??200,onChange:e=>a({widthPx:Number(e||200)})})})}),(0,Q.jsx)(ZA,{span:6,children:(0,Q.jsx)(X.Item,{label:`横向边距`,children:(0,Q.jsx)(xj,{min:0,max:2e3,style:{width:`100%`},value:e.marginX,onChange:e=>a({marginX:Number(e||0)})})})}),(0,Q.jsx)(ZA,{span:6,children:(0,Q.jsx)(X.Item,{label:`纵向边距`,children:(0,Q.jsx)(xj,{min:0,max:2e3,style:{width:`100%`},value:e.marginY,onChange:e=>a({marginY:Number(e||0)})})})})]})]}),(0,Q.jsx)(aGe,{mediaUrl:r,mediaType:i,watermarkUrl:s,config:e,onChange:e=>a(e)})]})},sGe={image:`图片`,video:`视频`,audio:`音频`};function cGe(e){if(e.type.startsWith(`image/`))return`image`;if(e.type.startsWith(`video/`))return`video`;if(e.type.startsWith(`audio/`))return`audio`;let t=e.name.toLowerCase();return/\.(jpg|jpeg|png|webp|gif)$/.test(t)?`image`:/\.(mp4|mov|m4v|webm)$/.test(t)?`video`:/\.(mp3|wav|m4a|aac)$/.test(t)?`audio`:null}function lGe(e,t){return t!==`video`&&t!==`audio`?Promise.resolve(null):new Promise(n=>{let r=URL.createObjectURL(e),i=document.createElement(t===`video`?`video`:`audio`);i.preload=`metadata`,i.onloadedmetadata=()=>{let e=Number.isFinite(i.duration)?Number(i.duration.toFixed(3)):null;URL.revokeObjectURL(r),n(e)},i.onerror=()=>{URL.revokeObjectURL(r),n(null)},i.src=r})}var F9=({value:e,onChange:t,disabled:n})=>{let r=(0,C.useMemo)(()=>e||[],[e]),[i,a]=(0,C.useState)(!1),o=(e,n)=>{t(r.map((t,r)=>r===e?{...t,...n}:t))},s=e=>{t(r.filter((t,n)=>n!==e))},c=async e=>{let n=cGe(e);if(!n||![`image`,`video`,`audio`].includes(n))return mP.warning(`附件仅支持图片、视频、音频`),lB.LIST_IGNORE;a(!0);try{let i=await lGe(e,n),a=(await Q8(e,{scene:`home_material_reference`,resourceType:n,durationSeconds:i})).mediaReference;if(!a||![`image`,`video`,`audio`].includes(a.type))throw Error(`上传返回附件格式异常`);t([...r,{url:a.url,type:a.type,name:a.name||e.name,duration:a.duration??i,source:a.source,uploadResourceId:a.uploadResourceId,displayUrl:a.displayUrl||a.url,previewUrl:a.previewUrl||a.displayUrl||a.url,role:a.role||`reference_${a.type}`}]),mP.success(`附件上传成功`)}catch(e){mP.error(e?.message||`附件上传失败`)}finally{a(!1)}return lB.LIST_IGNORE};return(0,Q.jsxs)(CM,{direction:`vertical`,style:{width:`100%`},size:12,children:[(0,Q.jsx)(lB,{beforeUpload:e=>c(e),showUploadList:!1,disabled:n||i,accept:`image/*,video/*,audio/*`,children:(0,Q.jsx)(JS,{icon:(0,Q.jsx)(k6,{}),loading:i,disabled:n||i,children:`上传附件`})}),r.length===0?(0,Q.jsx)(`div`,{style:{color:`#999`,fontSize:13},children:`暂无附件。可上传图片、视频、音频,保存后会随前台素材接口返回。`}):(0,Q.jsx)(CM,{direction:`vertical`,style:{width:`100%`},size:10,children:r.map((e,t)=>{let r=A9(e.previewUrl||e.displayUrl||e.url),i=A9(e.displayUrl||e.url);return(0,Q.jsx)(OA,{size:`small`,bodyStyle:{padding:12},children:(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:12,alignItems:`flex-start`},children:[(0,Q.jsxs)(`div`,{style:{width:120,minHeight:72,flexShrink:0,borderRadius:8,overflow:`hidden`,background:`#f6f7fb`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:[e.type===`image`&&(0,Q.jsx)(vN,{width:120,height:72,style:{objectFit:`cover`},src:r}),e.type===`video`&&(0,Q.jsx)(`video`,{src:i,style:{width:120,height:72,objectFit:`cover`,background:`#000`},controls:!0}),e.type===`audio`&&(0,Q.jsx)(`audio`,{src:i,controls:!0,style:{width:112}})]}),(0,Q.jsxs)(CM,{direction:`vertical`,style:{flex:1,minWidth:0},size:8,children:[(0,Q.jsxs)(CM,{wrap:!0,children:[(0,Q.jsx)(hR,{color:e.type===`image`?`blue`:e.type===`video`?`purple`:`green`,children:sGe[e.type]||e.type}),e.uploadResourceId&&(0,Q.jsxs)(hR,{children:[`资源ID:`,e.uploadResourceId]})]}),(0,Q.jsx)(MN,{size:`small`,value:e.name||``,placeholder:`附件名称`,disabled:n,onChange:e=>o(t,{name:e.target.value||null})}),(0,Q.jsx)(MN,{size:`small`,value:e.role||``,placeholder:`附件角色,如 reference_image`,disabled:n,onChange:e=>o(t,{role:e.target.value||null})}),(e.type===`video`||e.type===`audio`)&&(0,Q.jsx)(xj,{size:`small`,min:0,precision:3,style:{width:180},value:e.duration??null,placeholder:`时长(秒)`,disabled:n,onChange:e=>o(t,{duration:e===null?null:Number(e)})}),(0,Q.jsx)(MN,{size:`small`,value:e.url,disabled:!0})]}),(0,Q.jsx)(JS,{danger:!0,size:`small`,icon:(0,Q.jsx)(vR,{}),disabled:n,onClick:()=>s(t),children:`删除`})]})},`${e.url}-${t}`)})})]})},I9={draft:{text:`草稿`,color:`default`},processing:{text:`处理中`,color:`processing`},success:{text:`成功`,color:`success`},failed:{text:`失败`,color:`error`}},L9={text:`民众智创`,opacityLevel:2,fontSizePx:28,color:`#ffffff`,rotateDeg:-30,gapX:220,gapY:140,staggered:!0},uGe={watermarkType:`image`,watermarkId:null,opacityLevel:6,position:`bottom_right`,customXRatio:null,customYRatio:null,sizeMode:`ratio`,widthRatio:.18,widthPx:null,marginX:24,marginY:24,textWatermark:L9},dGe={image:`图片`,video:`视频`,audio:`音频`};function fGe(e){return{text:e?.text||L9.text,opacityLevel:e?.opacityLevel??e?.opacity_level??L9.opacityLevel,fontSizePx:e?.fontSizePx??e?.font_size_px??L9.fontSizePx,color:e?.color||L9.color,rotateDeg:e?.rotateDeg??e?.rotate_deg??L9.rotateDeg,gapX:e?.gapX??e?.gap_x??L9.gapX,gapY:e?.gapY??e?.gap_y??L9.gapY,staggered:e?.staggered??L9.staggered}}function R9(e,t){let n=e||{},r=n.watermarkType||n.watermark_type||`image`;return{watermarkType:r,watermarkId:r===`repeated_text`?null:n.watermarkId||n.watermark_id||t||null,opacityLevel:n.opacityLevel||n.opacity_level||6,position:n.position||`bottom_right`,customXRatio:n.customXRatio??n.custom_x_ratio??null,customYRatio:n.customYRatio??n.custom_y_ratio??null,sizeMode:n.sizeMode||n.size_mode||`ratio`,widthRatio:n.widthRatio??n.width_ratio??.18,widthPx:n.widthPx??n.width_px??null,marginX:n.marginX??n.margin_x??24,marginY:n.marginY??n.margin_y??24,textWatermark:fGe(n.textWatermark||n.text_watermark)}}function z9(e){return e.watermarkType===`repeated_text`?!!e.textWatermark?.text?.trim():!!e.watermarkId}function pGe(e,t=48){let n=(e||``).trim();return n?n.length>t?`${n.slice(0,t)}...`:n:``}function mGe(e){let t=e||[];return t.length===0?(0,Q.jsx)(Z.Text,{type:`secondary`,children:`暂无附件`}):(0,Q.jsx)(CM,{direction:`vertical`,style:{width:`100%`},size:12,children:t.map((e,t)=>{let n=A9(e.displayUrl||e.url),r=A9(e.previewUrl||e.displayUrl||e.url);return(0,Q.jsxs)(`div`,{style:{border:`1px solid #f0f0f5`,borderRadius:8,padding:12,display:`flex`,gap:12},children:[(0,Q.jsxs)(`div`,{style:{width:140,minHeight:80,flexShrink:0,background:`#f6f7fb`,borderRadius:8,overflow:`hidden`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:[e.type===`image`&&(0,Q.jsx)(vN,{width:140,height:80,style:{objectFit:`cover`},src:r}),e.type===`video`&&(0,Q.jsx)(`video`,{src:n,controls:!0,style:{width:140,height:80,objectFit:`cover`,background:`#000`}}),e.type===`audio`&&(0,Q.jsx)(`audio`,{src:n,controls:!0,style:{width:132}})]}),(0,Q.jsxs)(CM,{direction:`vertical`,size:6,style:{flex:1,minWidth:0},children:[(0,Q.jsxs)(CM,{wrap:!0,children:[(0,Q.jsx)(hR,{children:dGe[e.type]||e.type}),e.duration!==void 0&&e.duration!==null&&(0,Q.jsxs)(hR,{children:[e.duration,`s`]}),e.role&&(0,Q.jsx)(hR,{children:e.role})]}),(0,Q.jsx)(Z.Text,{strong:!0,children:e.name||`未命名附件`}),(0,Q.jsx)(Z.Text,{copyable:!0,ellipsis:!0,style:{maxWidth:620},children:e.url})]})]},`${e.url}-${t}`)})})}var hGe=({categories:e,watermarks:t,reloadKey:n})=>{let[r,i]=(0,C.useState)([]),[a,o]=(0,C.useState)(0),[s,c]=(0,C.useState)(!1),[l,u]=(0,C.useState)({page:1,pageSize:20}),[d,f]=(0,C.useState)(null),[p,m]=(0,C.useState)(null),[h,g]=(0,C.useState)(uGe),[_,v]=(0,C.useState)(!1),[y,b]=(0,C.useState)(null),[x,S]=(0,C.useState)(``),[w,T]=(0,C.useState)([]),[E,D]=(0,C.useState)(!1),O=async()=>{c(!0);try{let e=await dHe(l);i(e.items),o(e.total)}finally{c(!1)}};(0,C.useEffect)(()=>{O()},[l,n]),(0,C.useEffect)(()=>{let e=r.filter(e=>e.status===`processing`);if(e.length===0)return;let t=window.setInterval(async()=>{(await Promise.all(e.map(e=>fHe(e.id).catch(()=>null)))).some(e=>e&&e.status!==`processing`)&&O()},2500);return()=>window.clearInterval(t)},[r]);let k=e=>{m(e),g(R9(e.watermarkConfig,e.watermarkId))},A=e=>{b(e),S(e.generationPrompt||``),T(e.mediaReferences||[])},j=e=>e.mediaType===`image`?A9(e.watermarkedUrl||e.originalUrl):A9(e.coverUrl||``),M=e=>A9(e.watermarkedUrl||e.originalUrl),N=e=>{gP.confirm({title:`确认删除该素材?`,content:e.title||e.id,okText:`删除`,okButtonProps:{danger:!0},cancelText:`取消`,async onOk(){await vHe(e.id),mP.success(`删除成功`),await O()}})};return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(CM,{style:{marginBottom:16},wrap:!0,children:[(0,Q.jsx)(bb,{allowClear:!0,style:{width:180},placeholder:`行业`,value:l.categoryId,onChange:e=>u(t=>({...t,categoryId:e,page:1})),options:e.map(e=>({label:e.name,value:e.id}))}),(0,Q.jsx)(bb,{allowClear:!0,style:{width:140},placeholder:`素材类型`,value:l.mediaType,onChange:e=>u(t=>({...t,mediaType:e,page:1})),options:[{label:`图片`,value:`image`},{label:`视频`,value:`video`}]}),(0,Q.jsx)(bb,{allowClear:!0,style:{width:140},placeholder:`处理状态`,value:l.status,onChange:e=>u(t=>({...t,status:e,page:1})),options:Object.entries(I9).map(([e,t])=>({value:e,label:t.text}))}),(0,Q.jsx)(JS,{onClick:O,children:`刷新`})]}),(0,Q.jsx)(nR,{rowKey:`id`,loading:s,dataSource:r,pagination:{current:l.page,pageSize:l.pageSize,total:a,onChange:(e,t)=>u(n=>({...n,page:e,pageSize:t}))},scroll:{x:1380},columns:[{title:`预览`,width:110,render:(e,t)=>{let n=j(t);if(t.mediaType===`image`)return n?(0,Q.jsx)(vN,{width:86,height:64,style:{objectFit:`cover`,borderRadius:6},src:n}):`-`;let r=M(t),i=A9(t.coverUrl||``);return r?(0,Q.jsx)(`video`,{src:r,poster:i||void 0,muted:!0,preload:`metadata`,style:{width:100,height:64,objectFit:`cover`,borderRadius:6,background:`#000`}}):`-`}},{title:`标题`,dataIndex:`title`,render:e=>e||(0,Q.jsx)(`span`,{style:{color:`#999`},children:`未命名素材`})},{title:`行业`,dataIndex:`categoryName`},{title:`类型`,dataIndex:`mediaType`,render:e=>e===`image`?`图片`:`视频`},{title:`状态`,dataIndex:`status`,render:e=>(0,Q.jsx)(hR,{color:I9[e]?.color,children:I9[e]?.text||e})},{title:`生成提词`,width:210,render:(e,t)=>t.generationPrompt?(0,Q.jsx)(ux,{title:t.generationPrompt,children:(0,Q.jsx)(Z.Text,{children:pGe(t.generationPrompt)})}):(0,Q.jsx)(Z.Text,{type:`secondary`,children:`未设置`})},{title:`附件`,width:90,render:(e,t)=>(0,Q.jsx)(hR,{color:(t.mediaReferences?.length||0)>0?`blue`:`default`,children:t.mediaReferences?.length||0})},{title:`水印`,render:(e,t)=>R9(t.watermarkConfig,t.watermarkId).watermarkType===`repeated_text`?`重复文字水印`:t.watermarkName||`图片水印`},{title:`排序`,dataIndex:`sortOrder`},{title:`错误`,dataIndex:`errorMessage`,ellipsis:!0},{title:`操作`,width:170,align:`center`,render:(e,t)=>(0,Q.jsxs)(CM,{size:8,children:[(0,Q.jsx)(JS,{size:`small`,onClick:()=>f(t),children:`查看`}),(0,Q.jsx)(TM,{trigger:[`click`],menu:{items:[{key:`generation_config`,icon:(0,Q.jsx)(xR,{}),label:`编辑生成配置`},{key:`regenerate`,icon:(0,Q.jsx)(MP,{}),label:`重新生成水印`},{key:`delete`,icon:(0,Q.jsx)(vR,{}),label:`删除素材`,danger:!0}],onClick:({key:e})=>{e===`generation_config`&&A(t),e===`regenerate`&&k(t),e===`delete`&&N(t)}},children:(0,Q.jsx)(JS,{size:`small`,icon:(0,Q.jsx)(h1,{}),children:`更多`})})]})}]}),(0,Q.jsx)(gP,{title:`素材详情`,open:!!d,onCancel:()=>f(null),footer:null,width:960,destroyOnHidden:!0,children:d&&(0,Q.jsxs)(CM,{direction:`vertical`,style:{width:`100%`},size:`large`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`b`,{children:`原素材:`}),d.originalUrl?A9(d.originalUrl):`-`]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`b`,{children:`水印素材:`}),d.watermarkedUrl?A9(d.watermarkedUrl):`-`]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`b`,{children:`生成提词:`}),(0,Q.jsx)(`div`,{style:{marginTop:8,padding:12,borderRadius:8,background:`#f8fafc`,whiteSpace:`pre-wrap`},children:d.generationPrompt||`未设置`})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`b`,{children:`附件 / 参考素材:`}),(0,Q.jsx)(`div`,{style:{marginTop:8},children:mGe(d.mediaReferences)})]}),d.mediaType===`image`?(0,Q.jsx)(vN,{src:A9(d.watermarkedUrl||d.originalUrl)}):(0,Q.jsx)(`video`,{src:M(d),poster:A9(d.coverUrl||``)||void 0,controls:!0,style:{width:`100%`,background:`#000`}})]})}),(0,Q.jsx)(gP,{title:`编辑生成配置`,open:!!y,onCancel:()=>!E&&b(null),onOk:async()=>{if(!(!y||E)){D(!0);try{await hHe(y.id,{category_id:y.categoryId,title:y.title||null,is_active:y.isActive,sort_order:y.sortOrder,generation_prompt:x.trim()||null,media_references:w}),mP.success(`生成配置已保存`),b(null),await O()}finally{D(!1)}}},confirmLoading:E,cancelButtonProps:{disabled:E},width:920,destroyOnHidden:!0,children:(0,Q.jsxs)(CM,{direction:`vertical`,style:{width:`100%`},size:16,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(Z.Text,{strong:!0,children:`生成提词`}),(0,Q.jsx)(MN.TextArea,{rows:6,maxLength:8e3,showCount:!0,value:x,disabled:E,placeholder:`请输入用于生成该素材的提示词`,onChange:e=>S(e.target.value),style:{marginTop:8}})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(Z.Text,{strong:!0,children:`附件 / 参考素材`}),(0,Q.jsx)(`div`,{style:{marginTop:8},children:(0,Q.jsx)(F9,{value:w,onChange:T,disabled:E})})]})]})}),(0,Q.jsx)(gP,{title:`重新生成水印`,open:!!p,onCancel:()=>!_&&m(null),onOk:async()=>{if(!(!p||_)){if(!z9(h)){mP.warning(h.watermarkType===`repeated_text`?`请输入重复文字水印内容`:`请选择水印图片`);return}v(!0);try{await _He(p.id,{watermark_type:h.watermarkType,watermark_id:h.watermarkType===`image`?h.watermarkId:null,opacity_level:h.opacityLevel,position:h.position,custom_x_ratio:h.customXRatio,custom_y_ratio:h.customYRatio,size_mode:h.sizeMode,width_ratio:h.widthRatio,width_px:h.widthPx,margin_x:h.marginX,margin_y:h.marginY,text_watermark:h.watermarkType===`repeated_text`&&h.textWatermark?{text:h.textWatermark.text,opacity_level:h.textWatermark.opacityLevel,font_size_px:h.textWatermark.fontSizePx,color:h.textWatermark.color,rotate_deg:h.textWatermark.rotateDeg,gap_x:h.textWatermark.gapX,gap_y:h.textWatermark.gapY,staggered:h.textWatermark.staggered}:null,wait:!1}),mP.success(`已提交重新生成`),m(null),await O()}finally{v(!1)}}},confirmLoading:_,okButtonProps:{disabled:_||!z9(h)},cancelButtonProps:{disabled:_},width:980,destroyOnHidden:!0,children:p&&(0,Q.jsx)(P9,{value:h,onChange:g,watermarks:t,mediaUrl:A9(p.originalUrl||p.watermarkedUrl),mediaType:p.mediaType})})]})},gGe=yBe,_Ge=[{label:`通用应用`,value:`AppstoreOutlined`},{label:`图片素材`,value:`PictureOutlined`},{label:`视频素材`,value:`VideoCameraOutlined`},{label:`电商购物`,value:`ShoppingOutlined`},{label:`门店商铺`,value:`ShopOutlined`},{label:`美妆护肤`,value:`SkinOutlined`},{label:`餐饮食品`,value:`CoffeeOutlined`},{label:`家居生活`,value:`HomeOutlined`},{label:`汽车出行`,value:`CarOutlined`},{label:`医疗健康`,value:`MedicineBoxOutlined`},{label:`教育培训`,value:`BookOutlined`},{label:`数码科技`,value:`LaptopOutlined`},{label:`旅游定位`,value:`EnvironmentOutlined`},{label:`摄影影像`,value:`CameraOutlined`},{label:`礼品活动`,value:`GiftOutlined`},{label:`热门爆款`,value:`FireOutlined`},{label:`品牌服务`,value:`CustomerServiceOutlined`},{label:`营销增长`,value:`RocketOutlined`},{label:`机构企业`,value:`BankOutlined`},{label:`娱乐休闲`,value:`SmileOutlined`}];function B9(e,t){if(!e)return(0,Q.jsx)(`span`,{style:{color:`#999`},children:`未设置`});let n=gGe[e];return(0,Q.jsxs)(CM,{size:6,children:[n?(0,Q.jsx)(n,{}):null,(0,Q.jsx)(`span`,{children:t||e}),(0,Q.jsx)(`span`,{style:{color:`#999`},children:e})]})}var vGe=({onChanged:e})=>{let[t,n]=(0,C.useState)([]),[r,i]=(0,C.useState)(0),[a,o]=(0,C.useState)(!1),[s,c]=(0,C.useState)(1),[l,u]=(0,C.useState)(!1),[d,f]=(0,C.useState)(null),[p]=X.useForm(),m=async()=>{o(!0);try{let e=await h5({page:s,pageSize:20});n(e.items),i(e.total)}finally{o(!1)}};(0,C.useEffect)(()=>{m()},[s]);let h=e=>{f(e||null),p.setFieldsValue(e?{name:e.name,key:e.key,description:e.description,icon:e.icon,is_active:e.isActive,sort_order:e.sortOrder}:{is_active:!0,sort_order:0}),u(!0)};return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{style:{marginBottom:16,display:`flex`,justifyContent:`space-between`},children:[(0,Q.jsx)(`div`,{}),(0,Q.jsx)(JS,{type:`primary`,icon:(0,Q.jsx)(rA,{}),onClick:()=>h(),children:`新增行业`})]}),(0,Q.jsx)(nR,{rowKey:`id`,loading:a,dataSource:t,pagination:{current:s,total:r,pageSize:20,onChange:c},columns:[{title:`行业名称`,dataIndex:`name`},{title:`Key`,dataIndex:`key`},{title:`图标`,dataIndex:`icon`,render:e=>B9(e)},{title:`启用`,dataIndex:`isActive`,render:e=>e?`启用`:`禁用`},{title:`素材数`,dataIndex:`assetCount`},{title:`图片/视频`,render:(e,t)=>`${t.imageCount}/${t.videoCount}`},{title:`排序`,dataIndex:`sortOrder`},{title:`操作`,render:(t,n)=>(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(JS,{size:`small`,icon:(0,Q.jsx)(xR,{}),onClick:()=>h(n),children:`编辑`}),(0,Q.jsx)(yP,{title:`确认删除该行业?`,onConfirm:async()=>{await sHe(n.id),mP.success(`删除成功`),await m(),e?.()},children:(0,Q.jsx)(JS,{size:`small`,danger:!0,icon:(0,Q.jsx)(vR,{}),children:`删除`})})]})}]}),(0,Q.jsx)(gP,{title:d?`编辑行业`:`新增行业`,open:l,onOk:async()=>{await oHe({...await p.validateFields(),id:d?.id}),mP.success(`保存成功`),u(!1),await m(),e?.()},onCancel:()=>u(!1),destroyOnHidden:!0,children:(0,Q.jsxs)(X,{form:p,layout:`vertical`,children:[(0,Q.jsx)(X.Item,{name:`name`,label:`行业名称`,rules:[{required:!0,message:`请输入行业名称`}],children:(0,Q.jsx)(MN,{})}),(0,Q.jsx)(X.Item,{name:`key`,label:`行业Key`,rules:[{required:!0,message:`请输入行业Key`},{pattern:/^[A-Za-z0-9_-]+$/,message:`只允许字母、数字、下划线、中划线`}],children:(0,Q.jsx)(MN,{})}),(0,Q.jsx)(X.Item,{name:`description`,label:`描述`,children:(0,Q.jsx)(MN.TextArea,{rows:3})}),(0,Q.jsx)(X.Item,{name:`icon`,label:`图标`,children:(0,Q.jsx)(bb,{allowClear:!0,showSearch:!0,placeholder:`请选择行业图标`,optionFilterProp:`searchText`,filterOption:(e,t)=>{let n=String(t?.searchText||``).toLowerCase(),r=String(t?.value||``).toLowerCase(),i=e.toLowerCase();return n.includes(i)||r.includes(i)},options:_Ge.map(e=>({value:e.value,searchText:`${e.label} ${e.value}`,label:B9(e.value,e.label)}))})}),(0,Q.jsx)(X.Item,{name:`sort_order`,label:`排序`,children:(0,Q.jsx)(xj,{min:0,style:{width:`100%`}})}),(0,Q.jsx)(X.Item,{name:`is_active`,label:`启用`,valuePropName:`checked`,children:(0,Q.jsx)(eF,{})})]})})]})},V9={watermarkType:`image`,watermarkId:null,opacityLevel:6,position:`bottom_right`,customXRatio:null,customYRatio:null,sizeMode:`ratio`,widthRatio:.18,widthPx:null,marginX:24,marginY:24,textWatermark:{text:`民众智创`,opacityLevel:2,fontSizePx:28,color:`#ffffff`,rotateDeg:-30,gapX:220,gapY:140,staggered:!0}};function yGe(e){return e.watermarkType===`repeated_text`?!!e.textWatermark?.text?.trim():!!e.watermarkId}var bGe=({open:e,onClose:t,categories:n,watermarks:r,onSuccess:i})=>{let[a]=X.useForm(),[o,s]=(0,C.useState)(null),[c,l]=(0,C.useState)([]),[u,d]=(0,C.useState)(`image`),[f,p]=(0,C.useState)(V9),[m,h]=(0,C.useState)(!1),[g,_]=(0,C.useState)(``),[v,y]=(0,C.useState)([]),b=()=>{s(null),l([]),d(`image`),_(``),h(!1),y([])};(0,C.useEffect)(()=>{if(e){b();let e=r.find(e=>e.isDefault)||r[0];p({...V9,watermarkId:e?.id||null}),a.setFieldsValue({media_type:`image`,is_active:!0,sort_order:0,title:void 0,generation_prompt:void 0})}},[e,r,a]),(0,C.useEffect)(()=>()=>{g.startsWith(`blob:`)&&URL.revokeObjectURL(g)},[g]);let x=(0,C.useMemo)(()=>g||void 0,[g]),S=e=>{let t=e.type.startsWith(`image/`),n=e.type.startsWith(`video/`);if(u===`image`&&!t)return mP.warning(`当前素材类型为图片,请选择图片文件`),lB.LIST_IGNORE;if(u===`video`&&!n)return mP.warning(`当前素材类型为视频,请选择视频文件`),lB.LIST_IGNORE;g.startsWith(`blob:`)&&URL.revokeObjectURL(g);let r=URL.createObjectURL(e);return s(e),_(r),l([{uid:e.name,name:e.name,status:`done`,originFileObj:e}]),!1},w=()=>{s(null),l([]),g.startsWith(`blob:`)&&URL.revokeObjectURL(g),_(``)};return(0,Q.jsxs)(gP,{title:`上传首页素材`,open:e,onCancel:()=>{m||t()},onOk:async()=>{if(m)return;let e=await a.validateFields();if(!o){mP.warning(`请选择素材文件`);return}if(f.watermarkType===`image`&&!f.watermarkId){mP.warning(`请选择水印图片`);return}if(f.watermarkType===`repeated_text`&&!f.textWatermark?.text?.trim()){mP.warning(`请输入重复文字水印内容`);return}h(!0);try{let n=await mHe({categoryId:e.category_id,file:o,mediaType:u,title:e.title?.trim()||null,generationPrompt:e.generation_prompt?.trim()||null,mediaReferences:v,watermarkType:f.watermarkType,watermarkId:f.watermarkType===`image`?f.watermarkId:null,opacityLevel:f.opacityLevel,position:f.position,customXRatio:f.customXRatio,customYRatio:f.customYRatio,sizeMode:f.sizeMode,widthRatio:f.widthRatio,widthPx:f.widthPx,marginX:f.marginX,marginY:f.marginY,textWatermark:f.watermarkType===`repeated_text`?f.textWatermark:null,isActive:e.is_active,sortOrder:e.sort_order,wait:!1});mP.success(n.message||`已提交水印处理`),i(),t()}finally{h(!1)}},confirmLoading:m,okButtonProps:{disabled:m||!o||!yGe(f)},cancelButtonProps:{disabled:m},width:980,destroyOnHidden:!0,children:[(0,Q.jsxs)(X,{form:a,layout:`vertical`,children:[(0,Q.jsx)(X.Item,{name:`category_id`,label:`行业`,rules:[{required:!0,message:`请选择行业`}],children:(0,Q.jsx)(bb,{options:n.map(e=>({label:e.name,value:e.id})),disabled:m})}),(0,Q.jsx)(X.Item,{name:`media_type`,label:`素材类型`,rules:[{required:!0}],children:(0,Q.jsx)(bb,{value:u,onChange:e=>{d(e),w()},disabled:m,options:[{label:`图片`,value:`image`},{label:`视频`,value:`video`}]})}),(0,Q.jsx)(X.Item,{label:`素材文件`,required:!0,children:(0,Q.jsx)(lB,{beforeUpload:e=>S(e),onRemove:w,fileList:c,maxCount:1,accept:u===`image`?`image/*`:`video/*`,disabled:m,children:(0,Q.jsxs)(JS,{icon:(0,Q.jsx)(k6,{}),loading:m,disabled:m,children:[`选择`,u===`image`?`图片`:`视频`]})})}),(0,Q.jsx)(X.Item,{name:`title`,label:`素材标题`,extra:`选填;不填时后台显示“未命名素材”,不会再自动使用文件名作为标题。`,children:(0,Q.jsx)(MN,{disabled:m})}),(0,Q.jsx)(X.Item,{name:`generation_prompt`,label:`生成提词`,extra:`选填;会随前台素材接口返回。`,children:(0,Q.jsx)(MN.TextArea,{rows:5,maxLength:8e3,showCount:!0,disabled:m,placeholder:`请输入用于生成该素材的提示词`})}),(0,Q.jsx)(X.Item,{label:`附件 / 参考素材`,children:(0,Q.jsx)(F9,{value:v,onChange:y,disabled:m})}),(0,Q.jsx)(X.Item,{name:`sort_order`,label:`排序`,children:(0,Q.jsx)(xj,{min:0,style:{width:`100%`},disabled:m})}),(0,Q.jsx)(X.Item,{name:`is_active`,label:`前台展示`,valuePropName:`checked`,children:(0,Q.jsx)(eF,{disabled:m})})]}),(0,Q.jsx)(P9,{value:f,onChange:p,watermarks:r,mediaUrl:x,mediaType:u})]})},xGe=({open:e=!0,onClose:t,embedded:n=!1,onChanged:r})=>{let[i,a]=(0,C.useState)([]),[o,s]=(0,C.useState)(!1),[c,l]=(0,C.useState)(!1),[u,d]=(0,C.useState)(null),[f,p]=(0,C.useState)(null),[m,h]=(0,C.useState)([]),[g,_]=(0,C.useState)(``),[v,y]=(0,C.useState)(!1),[b]=X.useForm(),x=async()=>{s(!0);try{a((await g5({page:1,pageSize:200})).items)}finally{s(!1)}};(0,C.useEffect)(()=>{e&&x()},[e]),(0,C.useEffect)(()=>()=>{g.startsWith(`blob:`)&&URL.revokeObjectURL(g)},[g]);let S=()=>{p(null),h([]),_(``),y(!1)},w=()=>{d(null),S(),b.setFieldsValue({name:``,is_default:!1,is_active:!0}),l(!0)},T=e=>{d(e),S(),_(A9(e.fileUrl)),b.setFieldsValue({name:e.name,is_default:e.isDefault,is_active:e.isActive}),l(!0)},E=()=>{v||(l(!1),S())},D=e=>{if(!e.type.startsWith(`image/`))return mP.warning(`请选择图片文件`),lB.LIST_IGNORE;g.startsWith(`blob:`)&&URL.revokeObjectURL(g);let t=URL.createObjectURL(e);return p(e),_(t),h([{uid:e.name,name:e.name,status:`done`,originFileObj:e}]),!1},O=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{style:{marginBottom:16,display:`flex`,justifyContent:`space-between`},children:[(0,Q.jsx)(`div`,{}),(0,Q.jsx)(JS,{type:`primary`,icon:(0,Q.jsx)(rA,{}),onClick:w,children:`上传水印`})]}),(0,Q.jsx)(nR,{rowKey:`id`,loading:o,dataSource:i,pagination:{pageSize:20},columns:[{title:`预览`,dataIndex:`fileUrl`,render:e=>(0,Q.jsx)(vN,{width:80,src:A9(e)})},{title:`名称`,dataIndex:`name`},{title:`尺寸`,render:(e,t)=>t.width&&t.height?`${t.width}×${t.height}`:`-`},{title:`默认`,dataIndex:`isDefault`,render:e=>e?`是`:`否`},{title:`启用`,dataIndex:`isActive`,render:e=>e?`启用`:`禁用`},{title:`操作`,render:(e,t)=>(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(JS,{size:`small`,icon:(0,Q.jsx)(xR,{}),onClick:()=>T(t),children:`编辑`}),(0,Q.jsx)(yP,{title:`确认删除该水印?`,onConfirm:async()=>{await uHe(t.id),mP.success(`删除成功`),await x(),r?.()},children:(0,Q.jsx)(JS,{size:`small`,danger:!0,icon:(0,Q.jsx)(vR,{}),children:`删除`})})]})}]}),(0,Q.jsx)(gP,{title:u?`编辑水印`:`上传水印`,open:c,onOk:async()=>{if(v)return;let e=await b.validateFields();if(!u&&!f){mP.warning(`请选择水印图片`);return}y(!0);try{u?await lHe(u.id,{name:e.name,is_default:e.is_default,is_active:e.is_active}):f&&await cHe(f,e.name,e.is_default),mP.success(`保存成功`),l(!1),S(),await x(),r?.()}finally{y(!1)}},onCancel:E,confirmLoading:v,okButtonProps:{disabled:v||!u&&!f},cancelButtonProps:{disabled:v},destroyOnHidden:!0,children:(0,Q.jsxs)(X,{form:b,layout:`vertical`,children:[!u&&(0,Q.jsxs)(X.Item,{label:`水印图片`,required:!0,children:[(0,Q.jsx)(lB,{beforeUpload:e=>D(e),onRemove:()=>{p(null),h([]),g.startsWith(`blob:`)&&URL.revokeObjectURL(g),_(``)},fileList:m,maxCount:1,accept:`image/png,image/jpeg,image/webp`,disabled:v,children:(0,Q.jsx)(JS,{icon:(0,Q.jsx)(k6,{}),loading:v,disabled:v,children:`选择图片`})}),g&&(0,Q.jsx)(`div`,{style:{marginTop:12},children:(0,Q.jsx)(vN,{src:g,alt:`水印预览`,width:180,style:{maxHeight:120,objectFit:`contain`,background:`#0f172a`,borderRadius:8,padding:8}})})]}),u&&g&&(0,Q.jsx)(X.Item,{label:`当前水印`,children:(0,Q.jsx)(vN,{src:g,alt:`当前水印`,width:180,style:{maxHeight:120,objectFit:`contain`,background:`#0f172a`,borderRadius:8,padding:8}})}),(0,Q.jsx)(X.Item,{name:`name`,label:`水印名称`,rules:[{required:!0,message:`请输入水印名称`}],children:(0,Q.jsx)(MN,{disabled:v})}),(0,Q.jsx)(X.Item,{name:`is_default`,label:`默认水印`,valuePropName:`checked`,children:(0,Q.jsx)(eF,{disabled:v})}),(0,Q.jsx)(X.Item,{name:`is_active`,label:`启用`,valuePropName:`checked`,children:(0,Q.jsx)(eF,{disabled:v})})]})})]});return n?O:(0,Q.jsx)(gP,{title:`水印库`,open:e,onCancel:t,footer:null,width:900,destroyOnHidden:!0,children:O})},SGe=()=>{let[e]=X.useForm(),[t,n]=(0,C.useState)(!1),[r,i]=(0,C.useState)([]),[a,o]=(0,C.useState)([]),[s,c]=(0,C.useState)(!1),[l,u]=(0,C.useState)(0),d=async()=>{let[e,t]=await Promise.all([h5({page:1,pageSize:200}),g5({page:1,pageSize:200,isActive:!0})]);i(e.items),o(t.items)},f=async()=>{n(!0);try{let t=await iHe();e.setFieldsValue(t)}finally{n(!1)}};(0,C.useEffect)(()=>{f(),d()},[]);let p=async()=>{await aHe(await e.validateFields()),mP.success(`配置已保存`)},m=async()=>{await d(),u(e=>e+1)};return(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(OA,{style:{marginBottom:16},loading:t,children:(0,Q.jsxs)(X,{form:e,layout:`inline`,initialValues:{enabled:!1,title:`行业素材案例`,subtitle:`精选图片与视频素材展示`,showOriginalInAdmin:!0},children:[(0,Q.jsx)(X.Item,{name:`enabled`,label:`首页展示`,valuePropName:`checked`,children:(0,Q.jsx)(eF,{})}),(0,Q.jsx)(X.Item,{name:`title`,label:`标题`,rules:[{required:!0,message:`请输入标题`}],children:(0,Q.jsx)(MN,{style:{width:220}})}),(0,Q.jsx)(X.Item,{name:`subtitle`,label:`副标题`,children:(0,Q.jsx)(MN,{style:{width:320}})}),(0,Q.jsx)(X.Item,{name:`showOriginalInAdmin`,label:`后台展示原素材`,valuePropName:`checked`,children:(0,Q.jsx)(eF,{})}),(0,Q.jsx)(X.Item,{children:(0,Q.jsx)(JS,{type:`primary`,icon:(0,Q.jsx)(z2,{}),onClick:p,children:`保存配置`})})]})}),(0,Q.jsx)(OA,{title:`首页素材行业装修`,extra:(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(JS,{onClick:m,children:`刷新`}),(0,Q.jsx)(JS,{type:`primary`,icon:(0,Q.jsx)(rA,{}),onClick:()=>c(!0),children:`上传素材`})]}),children:(0,Q.jsx)(EA,{items:[{key:`assets`,label:`素材管理`,children:(0,Q.jsx)(hGe,{categories:r,watermarks:a,reloadKey:l})},{key:`categories`,label:`行业类别`,children:(0,Q.jsx)(vGe,{onChanged:m})},{key:`watermarks`,label:`水印库`,children:(0,Q.jsx)(xGe,{embedded:!0,onChanged:m})}]})}),(0,Q.jsx)(bGe,{open:s,onClose:()=>c(!1),categories:r,watermarks:a,onSuccess:m})]})},CGe=[{id:`AD_APP_ACTIVATE`,name:`AD_APP_ACTIVATE`,label:`应用-激活`,description:`应用激活行为`},{id:`AD_APP_AUTH`,name:`AD_APP_AUTH`,label:`应用-授信`,description:`应用授信行为`},{id:`AD_APP_BOOK`,name:`AD_APP_BOOK`,label:`应用-预约表单`,description:`应用预约表单`},{id:`AD_APP_BUY`,name:`AD_APP_BUY`,label:`应用-APP内付费`,description:`APP内付费行为`},{id:`AD_APP_CLICKS`,name:`AD_APP_CLICKS`,label:`应用-点击量`,description:`应用点击量`},{id:`AD_APP_DETAIL`,name:`AD_APP_DETAIL`,label:`应用-APP内详情页到站UV`,description:`APP内详情页到站UV`},{id:`AD_APP_DOWNLOADED`,name:`AD_APP_DOWNLOADED`,label:`应用-下载完成`,description:`应用下载完成`},{id:`AD_APP_INSTALLED`,name:`AD_APP_INSTALLED`,label:`应用-安装完成`,description:`应用安装完成`},{id:`AD_APP_KEY_BEHAVIOR`,name:`AD_APP_KEY_BEHAVIOR`,label:`应用-关键行为`,description:`应用关键行为`},{id:`AD_APP_ORDER`,name:`AD_APP_ORDER`,label:`应用-APP内下单`,description:`APP内下单行为`},{id:`AD_APP_PAY`,name:`AD_APP_PAY`,label:`应用-付费`,description:`应用付费行为`},{id:`AD_APP_PRE_AUTH`,name:`AD_APP_PRE_AUTH`,label:`应用-预授信`,description:`应用预授信行为`},{id:`AD_APP_PRE_DOWNLOAD`,name:`AD_APP_PRE_DOWNLOAD`,label:`应用-预约下载`,description:`应用预约下载`},{id:`AD_APP_PUSH_ORDER`,name:`AD_APP_PUSH_ORDER`,label:`应用-首次发单(乘客)`,description:`首次发单行为`},{id:`AD_APP_REGISTER`,name:`AD_APP_REGISTER`,label:`应用-注册`,description:`应用注册行为`},{id:`AD_APP_SHOW`,name:`AD_APP_SHOW`,label:`应用-展示量`,description:`应用展示量`},{id:`AD_APP_SUBMIT`,name:`AD_APP_SUBMIT`,label:`应用-提交认证`,description:`应用提交认证`},{id:`AD_APP_VIEW`,name:`AD_APP_VIEW`,label:`应用-APP内访问`,description:`APP内访问行为`},{id:`AD_CLUE_AUTH`,name:`AD_CLUE_AUTH`,label:`销售线索收集-授信`,description:`销售线索授信`},{id:`AD_CLUE_BUTTON`,name:`AD_CLUE_BUTTON`,label:`销售线索收集-按钮跳转`,description:`按钮跳转`},{id:`AD_CLUE_CLICKS`,name:`AD_CLUE_CLICKS`,label:`销售线索收集-点击量`,description:`点击量`},{id:`AD_CLUE_CONFIRM`,name:`AD_CLUE_CONFIRM`,label:`销售线索收集-回访-信息确认`,description:`回访信息确认`},{id:`AD_CLUE_CONSULT`,name:`AD_CLUE_CONSULT`,label:`销售线索收集-有效咨询`,description:`有效咨询`},{id:`AD_CLUE_CONSULT_MSG`,name:`AD_CLUE_CONSULT_MSG`,label:`销售线索收集-留资咨询`,description:`留资咨询`},{id:`AD_CLUE_COUPON`,name:`AD_CLUE_COUPON`,label:`销售线索收集-卡券领取`,description:`卡券领取`},{id:`AD_CLUE_CUSTOMER`,name:`AD_CLUE_CUSTOMER`,label:`销售线索收集-有效获客`,description:`有效获客`},{id:`AD_CLUE_CVT`,name:`AD_CLUE_CVT`,label:`销售线索收集-多转化`,description:`多转化`},{id:`AD_CLUE_DONE`,name:`AD_CLUE_DONE`,label:`销售线索收集-完件`,description:`完件`},{id:`AD_CLUE_FORM`,name:`AD_CLUE_FORM`,label:`销售线索收集-表单提交`,description:`表单提交`},{id:`AD_CLUE_FRIENDS`,name:`AD_CLUE_FRIENDS`,label:`销售线索收集-回访-加为好友`,description:`回访加为好友`},{id:`AD_CLUE_INSURANCE`,name:`AD_CLUE_INSURANCE`,label:`销售线索收集-保险支付`,description:`保险支付`},{id:`AD_CLUE_INTENTION`,name:`AD_CLUE_INTENTION`,label:`销售线索收集-存在意向`,description:`存在意向`},{id:`AD_CLUE_INTENTION_FORM`,name:`AD_CLUE_INTENTION_FORM`,label:`销售线索收集-意向表单`,description:`意向表单`},{id:`AD_CLUE_INTENTION_TEL`,name:`AD_CLUE_INTENTION_TEL`,label:`销售线索收集-意向话单`,description:`意向话单`},{id:`AD_CLUE_MESSAGE`,name:`AD_CLUE_MESSAGE`,label:`销售线索收集-私信消息`,description:`私信消息`},{id:`AD_CLUE_MONEY`,name:`AD_CLUE_MONEY`,label:`销售线索收集-放款`,description:`放款`},{id:`AD_CLUE_MSG`,name:`AD_CLUE_MSG`,label:`销售线索收集-私信留资`,description:`私信留资`},{id:`AD_CLUE_PAGE`,name:`AD_CLUE_PAGE`,label:`销售线索收集-访问目标页面`,description:`访问目标页面`},{id:`AD_CLUE_PAY`,name:`AD_CLUE_PAY`,label:`销售线索收集-付费`,description:`付费`},{id:`AD_CLUE_PRE_AUTH`,name:`AD_CLUE_PRE_AUTH`,label:`销售线索收集-预授信`,description:`预授信`},{id:`AD_CLUE_PROTENTIAL_DEAL`,name:`AD_CLUE_PROTENTIAL_DEAL`,label:`销售线索收集-回访-高潜成交`,description:`回访高潜成交`},{id:`AD_CLUE_PUSH_ORDER`,name:`AD_CLUE_PUSH_ORDER`,label:`销售线索收集-首次发单(乘客)`,description:`首次发单`},{id:`AD_CLUE_REGISTER`,name:`AD_CLUE_REGISTER`,label:`销售线索收集-注册`,description:`注册`},{id:`AD_CLUE_SHOW`,name:`AD_CLUE_SHOW`,label:`销售线索收集-展示量`,description:`展示量`},{id:`AD_CLUE_SUBMIT`,name:`AD_CLUE_SUBMIT`,label:`销售线索收集-提交认证`,description:`提交认证`},{id:`AD_CLUE_TEL`,name:`AD_CLUE_TEL`,label:`销售线索收集-智能电话确认接通`,description:`智能电话确认接通`},{id:`AD_CLUE_TEL_CALL`,name:`AD_CLUE_TEL_CALL`,label:`销售线索收集-电话接通`,description:`电话接通`},{id:`AD_CLUE_WX_ADD`,name:`AD_CLUE_WX_ADD`,label:`销售线索收集-微信-添加企业微信`,description:`添加企业微信`},{id:`AD_CLUE_WX_COPY`,name:`AD_CLUE_WX_COPY`,label:`销售线索收集-微信复制`,description:`微信复制`},{id:`AD_CLUE_WX_MSG`,name:`AD_CLUE_WX_MSG`,label:`销售线索收集-微信-用户首次消息`,description:`用户首次消息`},{id:`AD_ECP_APP_BUY`,name:`AD_ECP_APP_BUY`,label:`电商-app内下单`,description:`电商app内下单`},{id:`AD_ECP_APP_DETAIL`,name:`AD_ECP_APP_DETAIL`,label:`电商-app内详情页到站uv`,description:`电商app内详情页到站uv`},{id:`AD_ECP_APP_VIEW`,name:`AD_ECP_APP_VIEW`,label:`电商-app内访问`,description:`电商app内访问`},{id:`AD_ECP_BUTTON`,name:`AD_ECP_BUTTON`,label:`电商-按钮跳转`,description:`电商按钮跳转`},{id:`AD_ECP_INTEREST`,name:`AD_ECP_INTEREST`,label:`电商-引流电商种草`,description:`引流电商种草`},{id:`AD_ECP_SHOP`,name:`AD_ECP_SHOP`,label:`电商-调起店铺`,description:`调起店铺`},{id:`AD_ECP_SHOP_STAY`,name:`AD_ECP_SHOP_STAY`,label:`电商-店铺停留`,description:`店铺停留`},{id:`AD_MINIAPP_ACTIVATE`,name:`AD_MINIAPP_ACTIVATE`,label:`快应用-激活`,description:`快应用激活`},{id:`AD_MINIAPP_KEY_BEHAVIOR`,name:`AD_MINIAPP_KEY_BEHAVIOR`,label:`快应用-关键行为`,description:`快应用关键行为`},{id:`AD_MINIAPP_PAY`,name:`AD_MINIAPP_PAY`,label:`快应用-付费`,description:`快应用付费`},{id:`AD_MINIAPP_REGISTER`,name:`AD_MINIAPP_REGISTER`,label:`快应用-注册`,description:`快应用注册`},{id:`AD_NATIVE_ACTIVATE`,name:`AD_NATIVE_ACTIVATE`,label:`原声互动-激活`,description:`原声互动激活`},{id:`AD_NATIVE_CLICKS`,name:`AD_NATIVE_CLICKS`,label:`原声互动-组件点击`,description:`组件点击`},{id:`AD_NATIVE_FANS_GROUP`,name:`AD_NATIVE_FANS_GROUP`,label:`原声互动-粉丝入群`,description:`粉丝入群`},{id:`AD_NATIVE_FOLLOW`,name:`AD_NATIVE_FOLLOW`,label:`原声互动-帐号关注`,description:`帐号关注`},{id:`AD_NATIVE_INTERACTIVE`,name:`AD_NATIVE_INTERACTIVE`,label:`原声互动-互动`,description:`互动`},{id:`AD_NATIVE_LIVE`,name:`AD_NATIVE_LIVE`,label:`原声互动-预约直播`,description:`预约直播`},{id:`AD_NATIVE_LIVE_DONATE`,name:`AD_NATIVE_LIVE_DONATE`,label:`原声互动-直播间营销捐赠`,description:`直播间营销捐赠`},{id:`AD_NATIVE_LIVE_PAY`,name:`AD_NATIVE_LIVE_PAY`,label:`原声互动-直播间打赏`,description:`直播间打赏`},{id:`AD_NATIVE_LIVE_STAY`,name:`AD_NATIVE_LIVE_STAY`,label:`原声互动-直播间停留`,description:`直播间停留`},{id:`AD_NATIVE_LIVE_VIEW`,name:`AD_NATIVE_LIVE_VIEW`,label:`原声互动-直播间观看`,description:`直播间观看`},{id:`AD_NATIVE_PAY`,name:`AD_NATIVE_PAY`,label:`原声互动-付费`,description:`原声互动付费`},{id:`AD_PRODUCT_ACTIVATE`,name:`AD_PRODUCT_ACTIVATE`,label:`商品-激活`,description:`商品激活`},{id:`AD_PRODUCT_APP_BUY`,name:`AD_PRODUCT_APP_BUY`,label:`商品-app内下单`,description:`商品app内下单`},{id:`AD_PRODUCT_APP_DETAIL`,name:`AD_PRODUCT_APP_DETAIL`,label:`商品-app内详情页到站uv`,description:`商品app内详情页到站uv`},{id:`AD_PRODUCT_APP_PAY`,name:`AD_PRODUCT_APP_PAY`,label:`商品-app内付费`,description:`商品app内付费`},{id:`AD_PRODUCT_APP_VIEW`,name:`AD_PRODUCT_APP_VIEW`,label:`商品-app内访问`,description:`商品app内访问`},{id:`AD_PRODUCT_FORM`,name:`AD_PRODUCT_FORM`,label:`商品-表单提交`,description:`商品表单提交`},{id:`AD_PRODUCT_KEY_BEHAVIOR`,name:`AD_PRODUCT_KEY_BEHAVIOR`,label:`商品-关键行为`,description:`商品关键行为`},{id:`AD_PRODUCT_PAY`,name:`AD_PRODUCT_PAY`,label:`商品-付费`,description:`商品付费`},{id:`AD_TINYAPP_ACTIVATE`,name:`AD_TINYAPP_ACTIVATE`,label:`小程序-激活`,description:`小程序激活`},{id:`AD_TINYAPP_KEY_BEHAVIOR`,name:`AD_TINYAPP_KEY_BEHAVIOR`,label:`小程序-关键行为`,description:`小程序关键行为`},{id:`AD_TINYAPP_PAY`,name:`AD_TINYAPP_PAY`,label:`小程序-付费`,description:`小程序付费`},{id:`QC_LIVE_BUY`,name:`QC_LIVE_BUY`,label:`直播投放-直播间下单`,description:`直播间下单`},{id:`QC_LIVE_CHECK`,name:`QC_LIVE_CHECK`,label:`直播投放-直播间结算`,description:`直播间结算`},{id:`QC_LIVE_COMMENTS`,name:`QC_LIVE_COMMENTS`,label:`直播投放-直播间评论`,description:`直播间评论`},{id:`QC_LIVE_DEAL`,name:`QC_LIVE_DEAL`,label:`直播投放-直播间成交`,description:`直播间成交`},{id:`QC_LIVE_ENTRY`,name:`QC_LIVE_ENTRY`,label:`直播投放-进入直播间`,description:`进入直播间`},{id:`QC_LIVE_FANS`,name:`QC_LIVE_FANS`,label:`直播投放-直播间粉丝提升`,description:`直播间粉丝提升`},{id:`QC_LIVE_HIT`,name:`QC_LIVE_HIT`,label:`直播投放-直播加热`,description:`直播加热`},{id:`QC_LIVE_PRODUCT_CLICKS`,name:`QC_LIVE_PRODUCT_CLICKS`,label:`直播投放-直播间商品点击`,description:`直播间商品点击`},{id:`QC_LIVE_ROI_CHECK`,name:`QC_LIVE_ROI_CHECK`,label:`直播投放-结算roi`,description:`结算roi`},{id:`QC_LIVE_ROI_DEAL`,name:`QC_LIVE_ROI_DEAL`,label:`直播投放-支付roi-直播间成交`,description:`支付roi直播间成交`},{id:`QC_LIVE_ROI_QC`,name:`QC_LIVE_ROI_QC`,label:`直播投放-支付roi-千川直接+间接订单`,description:`支付roi千川订单`},{id:`QC_PRODUCT_BUY`,name:`QC_PRODUCT_BUY`,label:`商品投放-商品购买`,description:`商品购买`},{id:`QC_PRODUCT_COMMENTS`,name:`QC_PRODUCT_COMMENTS`,label:`商品投放-点赞评论`,description:`点赞评论`},{id:`QC_PRODUCT_FANS`,name:`QC_PRODUCT_FANS`,label:`商品投放-粉丝提升`,description:`粉丝提升`},{id:`QC_PRODUCT_INTEREST`,name:`QC_PRODUCT_INTEREST`,label:`商品投放-人群种草`,description:`人群种草`},{id:`QC_PRODUCT_QC`,name:`QC_PRODUCT_QC`,label:`商品投放-千川直接+间接订单`,description:`千川订单`},{id:`QC_PRODUCT_ROI`,name:`QC_PRODUCT_ROI`,label:`商品投放-商品支付roi`,description:`商品支付roi`}],H9=e=>{if(!e)return``;let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)} ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`},{Text:wGe}=Z,TGe=()=>{let[e,t]=(0,C.useState)([]),[n,r]=(0,C.useState)(!1),[i,a]=(0,C.useState)(1),[o,s]=(0,C.useState)(10),[c,l]=(0,C.useState)(0),[u,d]=(0,C.useState)(``),[f,p]=(0,C.useState)(``),[m,h]=(0,C.useState)(),[g,_]=(0,C.useState)({});(0,C.useEffect)(()=>{v()},[]);let v=async()=>{try{let e=localStorage.getItem(`preTestAreaData`);if(e){_(JSON.parse(e).cityCodeMap);return}let t=(await _5({level:`ONE_LEVEL`})).data||[],n={};await Promise.all(t.map(async e=>{let t=[];try{t=(await _5({level:`TWO_LEVEL`,parent_code:e.code})).data||[],t.forEach(e=>{n[e.code]=e.name})}catch(t){console.error(`获取省份 ${e.name} 的城市失败`,t)}}));let r={cityCodeMap:n};localStorage.setItem(`preTestAreaData`,JSON.stringify(r)),_(n)}catch(e){console.error(`加载区域数据失败:`,e),mP.error(`加载区域数据失败`)}},y=[{title:`序号`,dataIndex:`index`,key:`index`,width:60,render:e=>(0,Q.jsx)(`span`,{style:{color:`#64748b`},children:e})},{title:`ID`,dataIndex:`id`,key:`id`,width:120,render:e=>{if(!e)return`-`;let t=e.length>12?`${e.slice(0,6)}...${e.slice(-4)}`:e;return(0,Q.jsx)(ux,{title:e,placement:`topLeft`,children:(0,Q.jsx)(Z.Text,{style:{fontSize:12},children:t})})}},{title:`投放平台`,dataIndex:`platform`,key:`platform`,width:100,render:e=>(0,Q.jsx)(hR,{color:e===`AD`?`blue`:e===`QIANCHUAN`?`green`:`orange`,style:{borderRadius:6,fontSize:12},children:e===`AD`?`AD`:e===`QIANCHUAN`?`千川`:`本地推`})},{title:`优化目标`,dataIndex:`externalAction`,key:`externalAction`,ellipsis:!0,width:200,render:e=>{if(!e)return(0,Q.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13},children:`-`});let t=CGe.find(t=>t.name===e.trim());return(0,Q.jsx)(`span`,{style:{color:`#1e293b`,fontSize:13},children:t?t.label:e})}},{title:`目标转化成本`,dataIndex:`cpaBid`,key:`cpaBid`,width:100},{title:`受众年龄`,dataIndex:`audienceAge`,key:`audienceAge`,width:100},{title:`受众性别`,dataIndex:`audienceGender`,key:`audienceGender`,width:100},{title:`受众网络`,dataIndex:`audienceNetwork`,key:`audienceNetwork`,width:100},{title:`受众区域`,dataIndex:`audienceRegion`,key:`audienceRegion`,ellipsis:!0,width:300,render:e=>{let t=JSON.parse(e);if(!Array.isArray(t)||t.length===0)return(0,Q.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13},children:`-`});let n=t.map(e=>{let t=String(e).padEnd(6,`0`);return g[t]||t});return(0,Q.jsx)(MN.TextArea,{value:n.join(`, `)||`-`,readOnly:!0,autoSize:{minRows:1,maxRows:4},style:{resize:`none`,border:`none`,background:`transparent`,padding:0},placeholder:`-`})}},{title:`客户主体名称`,dataIndex:`cusName`,key:`cusName`,width:150},{title:`计费方式`,dataIndex:`pricingType`,key:`pricingType`,width:100},{title:`是否最优成本出价`,dataIndex:`costCap`,key:`costCap`,width:100},{title:`是否稳定成本出价`,dataIndex:`targetCost`,key:`targetCost`,width:100},{title:`是否最大转化出价`,dataIndex:`nobid`,key:`nobid`,width:100},{title:`目标点击成本`,dataIndex:`cpcBid`,key:`cpcBid`,width:100},{title:`预算金额`,dataIndex:`budget`,key:`budget`,width:100},{title:`名称`,dataIndex:`name`,key:`name`,width:150},{title:`备注`,dataIndex:`note`,key:`note`,width:150},{title:`用户ID`,dataIndex:`userId`,key:`userId`,width:110,render:e=>{if(!e)return`-`;let t=e.length>12?`${e.slice(0,6)}...${e.slice(-4)}`:e;return(0,Q.jsx)(ux,{title:e,placement:`topLeft`,children:(0,Q.jsx)(Z.Text,{style:{fontSize:12},children:t})})}},{title:`用户手机号`,dataIndex:`userPhone`,key:`userPhone`,width:150},{title:`是否默认`,dataIndex:`isDefault`,key:`isDefault`,width:100,render:e=>(0,Q.jsx)(hR,{color:e?`green`:`red`,children:e?`是`:`否`})},{title:`创建时间`,dataIndex:`createdAt`,key:`createdAt`,width:180,render:e=>(0,Q.jsx)(`span`,{style:{color:`#64748b`},children:H9(e)})},{title:`更新时间`,dataIndex:`updatedAt`,key:`updatedAt`,width:180,render:e=>(0,Q.jsx)(`span`,{style:{color:`#64748b`},children:H9(e)})}],b=async()=>{r(!0);try{let e=await xHe({id:u||void 0,phone:f||void 0,created_at:m?[m[0].format(`YYYY-MM-DD`),m[1].format(`YYYY-MM-DD`)]:void 0,page:i,page_size:o});t((e.data||[]).map((e,t)=>({...e,index:(i-1)*o+t+1}))),l(e.pagination.total||0)}catch(e){console.error(`加载数据失败:`,e)}finally{r(!1)}};(0,C.useEffect)(()=>{b()},[i,o]);let x=(e,t)=>{a(e),s(t)},S=()=>{a(1),b()};return(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12},children:[(0,Q.jsx)(DM,{style:{color:`#6366f1`,fontSize:16}}),(0,Q.jsx)(wGe,{strong:!0,style:{fontSize:16},children:`素材前测模板`})]}),(0,Q.jsx)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:16},children:(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:12,alignItems:`center`},children:[(0,Q.jsx)(MN,{placeholder:`ID`,value:u,onChange:e=>d(e.target.value),style:{width:160},allowClear:!0,onPressEnter:S}),(0,Q.jsx)(MN,{placeholder:`手机号`,value:f,onChange:e=>p(e.target.value),style:{width:160},allowClear:!0,onPressEnter:S}),(0,Q.jsx)(rM.RangePicker,{placeholder:[`开始日期`,`结束日期`],value:m,onChange:e=>{e&&e[0]&&e[1]?h([e[0],e[1]]):h(void 0)},style:{width:260}}),(0,Q.jsx)(JS,{type:`primary`,onClick:S,children:`搜索`})]})}),(0,Q.jsxs)(`div`,{style:{background:`#fff`,borderRadius:16,boxShadow:`0 4px 20px rgba(0,0,0,0.04)`,overflow:`hidden`},children:[(0,Q.jsx)(nR,{dataSource:e,columns:y,loading:n,pagination:!1,rowKey:`id`,bordered:!1,scroll:{x:`max-content`},onRow:()=>({style:{cursor:`pointer`,transition:`background-color 0.15s`},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=`#f8fafc`},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=`transparent`}})}),(0,Q.jsx)(`div`,{style:{padding:`16px`,textAlign:`right`},children:(0,Q.jsx)(JN,{current:i,pageSize:o,total:c,showSizeChanger:!0,showTotal:e=>`共 ${e} 条记录`,pageSizeOptions:[`10`,`20`,`50`,`100`],onChange:x,size:`small`})})]})]})},U9=e=>{if(!e)return``;let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)} ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`},{Text:EGe}=Z,DGe=()=>{let[e,t]=(0,C.useState)([]),[n,r]=(0,C.useState)(!1),[i,a]=(0,C.useState)(1),[o,s]=(0,C.useState)(10),[c,l]=(0,C.useState)(0),[u,d]=(0,C.useState)(``),[f,p]=(0,C.useState)(``),[m,h]=(0,C.useState)({}),[g,_]=(0,C.useState)([]),[v,y]=(0,C.useState)(void 0),b=[{title:`序号`,dataIndex:`index`,key:`index`,width:60,render:e=>(0,Q.jsx)(`span`,{style:{color:`#64748b`},children:e})},{title:`ID`,dataIndex:`id`,key:`id`},{title:`前台用户ID`,dataIndex:`userId`,key:`userId`},{title:`前台用户手机号`,dataIndex:`userPhone`,key:`userPhone`},{title:`授权应用ID`,dataIndex:`appid`,key:`appid`},{title:`授权绑定账户ID`,dataIndex:`accountId`,key:`accountId`},{title:`授权绑定账户名称`,dataIndex:`accountName`,key:`accountName`},{title:`授权绑定账户角色`,dataIndex:`accountRole`,key:`accountRole`,render:e=>({ADVERTISER:`客户`,CUSTOMER_ADMIN:`普通版工作台-管理员`,CUSTOMER_OPERATOR:`普通版工作台-协作者`,AGENT:`代理商`,CHILD_AGENT:`二级代理商`,PLATFORM_ROLE_STAR:`星图账户`,PLATFORM_ROLE_SHOP_ACCOUNT:`抖音店铺账户`,PLATFORM_ROLE_QIANCHUAN_AGENT:`千川代理商`,PLATFORM_ROLE_STAR_AGENT:`星图代理商`,PLATFORM_ROLE_AWEME:`抖音号`,PLATFORM_ROLE_STAR_MCN:`星图MCN机构`,PLATFORM_ROLE_STAR_ISV:`星图服务商`,AGENT_SYSTEM_ACCOUNT:`代理商系统账户`,PLATFORM_ROLE_LOCAL_AGENT:`本地推代理商`,PLATFORM_ROLE_YUNTU_BRAND_ISV_ADMIN:`云图品牌服务商管理员`,PLATFORM_ROLE_LIFE:`抖音来客账户`,PLATFORM_ROLE_ENTERPRISE_BP_ADMIN:`升级版工作台管理员`,PLATFORM_ROLE_ENTERPRISE_BP_OPERATOR:`升级版工作台协作者`})[e]||e},{title:`授权登录账户用户ID`,dataIndex:`accountUserid`,key:`accountUserid`},{title:`授权登录账户用户名`,dataIndex:`accountUsername`,key:`accountUsername`},{title:`开户方式`,dataIndex:`openType`,key:`openType`,width:120,render:e=>(0,Q.jsx)(`span`,{style:{color:`#1e293b`},children:m[e]||e})},{title:`平台端口`,dataIndex:`portType`,key:`portType`,render:e=>({1:`巨量`,2:`磁力`,3:`巨量星图`,4:`服务单`,5:`腾讯`})[e]||e},{title:`授权刷新Token`,dataIndex:`refreshToken`,key:`refreshToken`},{title:`刷新Token过期时间`,dataIndex:`refreshTokenExpired`,key:`refreshTokenExpired`,render:e=>(0,Q.jsx)(`span`,{style:{color:`#64748b`},children:U9(e)})},{title:`授权Token`,dataIndex:`accessToken`,key:`accessToken`},{title:`Token过期时间`,dataIndex:`accessTokenExpired`,key:`accessTokenExpired`,render:e=>(0,Q.jsx)(`span`,{style:{color:`#64748b`},children:U9(e)})},{title:`创建时间`,dataIndex:`createdAt`,key:`createdAt`,width:180,render:e=>(0,Q.jsx)(`span`,{style:{color:`#64748b`},children:U9(e)})},{title:`更新时间`,dataIndex:`updatedAt`,key:`updatedAt`,width:180,render:e=>(0,Q.jsx)(`span`,{style:{color:`#64748b`},children:U9(e)})}],x=async()=>{try{let e=(await d5()).data||[],t={},n=[];e.forEach(e=>{t[e.openType]=e.typeName,n.push({value:e.openType,label:e.typeName})}),h(t),_(n)}catch(e){console.error(`加载开户方式列表失败:`,e)}},S=async()=>{r(!0);try{let e=await yHe({account_id:u||void 0,account_userid:f||void 0,open_type:v,page:i,page_size:o});t((e.data||[]).map((e,t)=>({...e,index:(i-1)*o+t+1}))),l(e.pagination?.total||0)}catch(e){console.error(`加载数据失败:`,e)}finally{r(!1)}};(0,C.useEffect)(()=>{x(),S()},[i,o]);let w=()=>{a(1),S()};return(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12},children:[(0,Q.jsx)(_$,{style:{color:`#6366f1`,fontSize:16}}),(0,Q.jsx)(EGe,{strong:!0,style:{fontSize:16},children:`投放平台授权列表`})]}),(0,Q.jsx)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:16},children:(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:12,alignItems:`center`},children:[(0,Q.jsx)(MN,{placeholder:`授权绑定账户ID`,value:u,onChange:e=>d(e.target.value),style:{width:180},allowClear:!0,prefix:(0,Q.jsx)(hb,{}),onPressEnter:w}),(0,Q.jsx)(MN,{placeholder:`授权登录账户用户ID`,value:f,onChange:e=>p(e.target.value),style:{width:180},allowClear:!0,prefix:(0,Q.jsx)(hb,{}),onPressEnter:w}),(0,Q.jsx)(bb,{placeholder:`开户方式`,value:v,onChange:e=>y(e),style:{width:140},allowClear:!0,options:g}),(0,Q.jsx)(JS,{type:`primary`,onClick:w,children:`搜索`})]})}),(0,Q.jsx)(`div`,{style:{background:`#fff`,borderRadius:12,boxShadow:`0 1px 3px rgba(0,0,0,0.05)`},children:(0,Q.jsx)(nR,{dataSource:e,columns:b,loading:n,rowKey:`id`,bordered:!1,scroll:{x:`max-content`},pagination:{current:i,pageSize:o,total:c,showSizeChanger:!0,showTotal:e=>`共 ${e} 条记录`,onChange:(e,t)=>{a(e),s(t)}}})})]})},W9=[{key:`is_ad_high_quality_material`,label:`AD优质`,noLabel:`AD非优质素材`,unknownLabel:`AD未知`,yesColor:`green`,noColor:`red`,unknownColor:`default`},{key:`is_ecp_high_quality_material`,label:`千川优质`,noLabel:`千川非优质素材`,unknownLabel:`千川未知`,yesColor:`green`,noColor:`red`,unknownColor:`default`},{key:`is_local_high_quality_material`,label:`本地推优质`,noLabel:`本地推非优质`,unknownLabel:`本地推未知`,yesColor:`green`,noColor:`red`,unknownColor:`default`},{key:`is_inefficient_material`,label:`低效`,noLabel:`非低效`,unknownLabel:`是否低效未知`,yesColor:`red`,noColor:`green`,unknownColor:`default`},{key:`is_first_publish_material`,label:`首发`,noLabel:`非首发`,unknownLabel:`是否首发未知`,yesColor:`blue`,noColor:`default`,unknownColor:`default`}],OGe=({preResult:e})=>{let[t,n]=(0,C.useState)(null),[r,i]=(0,C.useState)(!1);if(C.useEffect(()=>{if(!e){n(null),i(!1);return}try{n(JSON.parse(e)),i(!1)}catch{n(null),i(!0)}},[e]),!e||r||!t)return(0,Q.jsx)(`span`,{style:{color:`#64748b`},children:`-`});let a=e=>{let n=W9.find(t=>t.key===e);if(!n)return null;let r=t[e],i=r===`YES`,a=r===`NO`;if(r===`UNKNOWN`)return null;let o,s;return i?(o=n.label,s=n.yesColor):a&&(o=n.noLabel,s=n.noColor),{tag:(0,Q.jsx)(hR,{color:s,style:{marginRight:6,fontSize:12,borderRadius:4},children:o},e),detail:{label:n.label.replace(`优质`,`优质素材`),value:o,color:s}}};return(0,Q.jsx)(_x,{content:(0,Q.jsxs)(`div`,{style:{maxWidth:500,padding:`8px 0`},children:[(0,Q.jsx)(Z.Text,{strong:!0,style:{fontSize:14,display:`block`,marginBottom:12,color:`#1e293b`},children:`前测结果详情`}),(0,Q.jsxs)(sM,{column:1,size:`small`,style:{marginBottom:12},children:[(0,Q.jsx)(sM.Item,{label:`视频ID`,labelStyle:{fontWeight:500,color:`#64748b`},contentStyle:{color:`#1e293b`},children:t.video_id}),(0,Q.jsx)(sM.Item,{label:`广告主ID`,labelStyle:{fontWeight:500,color:`#64748b`},contentStyle:{color:`#1e293b`},children:t.advertiser_id}),(0,Q.jsx)(sM.Item,{label:`素材ID`,labelStyle:{fontWeight:500,color:`#64748b`},contentStyle:{color:`#1e293b`},children:t.material_id})]}),(0,Q.jsx)(Z.Text,{strong:!0,style:{fontSize:12,color:`#64748b`,display:`block`,marginBottom:8},children:`质量评估`}),(0,Q.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:8,marginBottom:12},children:W9.map(e=>{let n=t[e.key],r=n===`YES`,i=n===`NO`;if(n===`UNKNOWN`)return null;let a,o;return r?(a=e.label,o=e.yesColor):i&&(a=e.noLabel,o=e.noColor),(0,Q.jsx)(hR,{color:o,style:{fontSize:12,borderRadius:4},children:a},e.key)})}),t.not_ad_high_quality_reason&&t.not_ad_high_quality_reason.length>0&&(0,Q.jsxs)(`div`,{style:{marginBottom:12},children:[(0,Q.jsx)(Z.Text,{strong:!0,style:{fontSize:12,color:`#ef4444`,display:`block`,marginBottom:8},children:`AD非优质原因`}),(0,Q.jsx)(oP,{dataSource:t.not_ad_high_quality_reason,renderItem:(e,t)=>(0,Q.jsxs)(oP.Item,{style:{padding:`4px 0`,fontSize:12,color:`#64748b`},children:[t+1,`. `,e]},t),size:`small`})]}),t.not_ecp_high_quality_reason&&t.not_ecp_high_quality_reason.length>0&&(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(Z.Text,{strong:!0,style:{fontSize:12,color:`#ef4444`,display:`block`,marginBottom:8},children:`千川非优质原因`}),(0,Q.jsx)(oP,{dataSource:t.not_ecp_high_quality_reason,renderItem:(e,t)=>(0,Q.jsxs)(oP.Item,{style:{padding:`4px 0`,fontSize:12,color:`#64748b`},children:[t+1,`. `,e]},t),size:`small`})]})]}),title:null,trigger:`hover`,placement:`topLeft`,overlayStyle:{borderRadius:12,boxShadow:`0 8px 24px rgba(0,0,0,0.12)`},children:(0,Q.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,alignItems:`center`,gap:4},children:W9.map(e=>a(e.key)?.tag)})})},G9=e=>{if(!e)return``;let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)} ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`},{Text:kGe}=Z,AGe=()=>{let[e,t]=(0,C.useState)([]),[n,r]=(0,C.useState)(!1),[i,a]=(0,C.useState)(1),[o,s]=(0,C.useState)(10),[c,l]=(0,C.useState)(0),[u,d]=(0,C.useState)(``),[f,p]=(0,C.useState)(``),[m,h]=(0,C.useState)(``),g=[{title:`序号`,dataIndex:`index`,key:`index`,width:60,render:e=>(0,Q.jsx)(`span`,{style:{color:`#64748b`},children:e})},{title:`ID`,dataIndex:`id`,key:`id`},{title:`广告主账户ID`,dataIndex:`advertiserId`,key:`advertiserId`},{title:`素材ID`,dataIndex:`materialId`,key:`materialId`,width:180},{title:`上传ID`,dataIndex:`uploadId`,key:`uploadId`,render:e=>{if(!e)return`-`;let t=e.length>12?`${e.slice(0,6)}...${e.slice(-4)}`:e;return(0,Q.jsx)(ux,{title:e,placement:`topLeft`,children:(0,Q.jsx)(Z.Text,{style:{fontSize:12},children:t})})}},{title:`预测试模板ID`,dataIndex:`preTestTemplateId`,key:`preTestTemplateId`},{title:`授权ID`,dataIndex:`oauthId`,key:`oauthId`},{title:`目标标ID`,dataIndex:`targetId`,key:`targetId`},{title:`目标表`,dataIndex:`targetTable`,key:`targetTable`},{title:`任务ID`,dataIndex:`taskId`,key:`taskId`},{title:`用户ID`,dataIndex:`userId`,key:`userId`},{title:`备注`,dataIndex:`note`,key:`note`,width:200,render:e=>(0,Q.jsx)(MN.TextArea,{value:e||``,readOnly:!0,autoSize:{minRows:1,maxRows:4},style:{color:`#94a3b8`,resize:`none`,border:`none`,background:`transparent`,padding:0},placeholder:`-`})},{title:`预测试结果`,dataIndex:`preResult`,key:`preResult`,width:120,render:e=>(0,Q.jsx)(OGe,{preResult:e})},{title:`资源类型`,dataIndex:`resourceType`,key:`resourceType`,width:100,render:e=>(0,Q.jsx)(hR,{color:e===`video`?`blue`:`green`,children:e===`video`?`视频`:`图片`})},{title:`状态`,dataIndex:`status`,key:`status`,width:100,render:e=>(0,Q.jsx)(hR,{color:e===`SUCCESS`?`green`:e===`PENDING`?`orange`:`red`,children:e===`SUCCESS`?`成功`:e===`PENDING`?`处理中`:`失败`})},{title:`创建时间`,dataIndex:`createdAt`,key:`createdAt`,width:180,render:e=>(0,Q.jsx)(`span`,{style:{color:`#64748b`},children:G9(e)})},{title:`更新时间`,dataIndex:`updatedAt`,key:`updatedAt`,width:180,render:e=>(0,Q.jsx)(`span`,{style:{color:`#64748b`},children:G9(e)})}],_=async()=>{r(!0);try{let e=await bHe({material_id:u||void 0,upload_id:f||void 0,resource_type:m||void 0,page:i,page_size:o});t((e.data||[]).map((e,t)=>({...e,index:(i-1)*o+t+1}))),l(e.pagination?.total||0)}catch(e){console.error(`加载数据失败:`,e)}finally{r(!1)}};(0,C.useEffect)(()=>{_()},[i,o]);let v=()=>{a(1),_()};return(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12},children:[(0,Q.jsx)(DM,{style:{color:`#6366f1`,fontSize:16}}),(0,Q.jsx)(kGe,{strong:!0,style:{fontSize:16},children:`素材ID列表`})]}),(0,Q.jsx)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:16},children:(0,Q.jsxs)(`div`,{style:{display:`flex`,gap:12,alignItems:`center`},children:[(0,Q.jsx)(MN,{placeholder:`素材ID`,value:u,onChange:e=>d(e.target.value),style:{width:160},allowClear:!0,onPressEnter:v}),(0,Q.jsx)(MN,{placeholder:`上传ID`,value:f,onChange:e=>p(e.target.value),style:{width:160},allowClear:!0,onPressEnter:v}),(0,Q.jsx)(MN,{placeholder:`文件名`,value:m,onChange:e=>h(e.target.value),style:{width:140},allowClear:!0,onPressEnter:v}),(0,Q.jsx)(bb,{placeholder:`资源类型`,value:m,onChange:e=>h(e),style:{width:120},allowClear:!0,options:[{value:`image`,label:`图片`},{value:`video`,label:`视频`}]}),(0,Q.jsx)(JS,{type:`primary`,onClick:v,children:`搜索`})]})}),(0,Q.jsxs)(`div`,{style:{background:`#fff`,borderRadius:12,boxShadow:`0 1px 3px rgba(0,0,0,0.05)`},children:[(0,Q.jsx)(nR,{dataSource:e,columns:g,loading:n,pagination:!1,rowKey:`id`,bordered:!1,scroll:{x:`max-content`}}),(0,Q.jsx)(`div`,{style:{padding:`16px`,textAlign:`right`},children:(0,Q.jsx)(JN,{current:i,pageSize:o,total:c,showSizeChanger:!0,showTotal:e=>`共 ${e} 条记录`,onChange:(e,t)=>{a(e),s(t)},size:`small`})})]})]})},{Title:jGe,Text:K9}=Z,q9=20,MGe=[{label:`全部素材库`,value:``},{label:`真人认证`,value:`real_person`},{label:`虚拟人像`,value:`aigc_virtual`}],NGe=[{label:`全部类型`,value:``},{label:`图片`,value:`Image`},{label:`视频`,value:`Video`}],PGe=[{label:`全部项目状态`,value:``},{label:`可用`,value:`active`},{label:`认证中`,value:`validating`},{label:`认证失败`,value:`validate_failed`},{label:`创建远端组中`,value:`creating_remote_group`},{label:`创建远端组失败`,value:`create_group_failed`},{label:`已删除`,value:`deleted`}],FGe=[{label:`全部素材状态`,value:``},{label:`创建中`,value:`creating`},{label:`处理中`,value:`Processing`},{label:`可用`,value:`Active`},{label:`失败`,value:`Failed`},{label:`本地已删`,value:`local_deleted`},{label:`远端已删`,value:`remote_deleted`},{label:`删除失败`,value:`delete_failed`}],J9=e=>e===`real_person`?`真人认证`:e===`aigc_virtual`?`虚拟人像`:e||`-`,Y9=e=>e===`real_person`?`purple`:e===`aigc_virtual`?`cyan`:`default`,X9=e=>e===`Active`||e===`active`?`green`:e===`Processing`||e===`creating_remote_group`||e===`validating`||e===`creating`?`blue`:e===`Failed`||e===`failed`||e===`delete_failed`||e===`validate_failed`||e===`create_group_failed`?`red`:(e?.includes(`deleted`),`default`),IGe=e=>e===`Image`?`图片`:e===`Video`?`视频`:e||`-`,Z9=(e,t=10)=>e?e.length<=t*2+3?e:`${e.slice(0,t)}...${e.slice(-t)}`:`-`,Q9=async e=>{e&&(await navigator.clipboard?.writeText(e),mP.success(`已复制`))},$9=e=>{if(!e)return``;let t=String(e).trim();return!t||t.startsWith(`asset://`)?``:A9(t)},LGe=({asset:e})=>{let t=$9(e.displayUrl||e.previewUrl||e.remoteUrl||e.sourceUrl),n=$9(e.videoCoverUrl||e.previewUrl||e.displayUrl||e.sourceUrl);return e.assetType===`Video`?(0,Q.jsxs)(`div`,{style:{width:72,height:52,borderRadius:10,overflow:`hidden`,background:`#f5f3ff`,display:`flex`,alignItems:`center`,justifyContent:`center`,position:`relative`},children:[n?(0,Q.jsx)(`img`,{src:n,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,Q.jsx)(r0,{style:{fontSize:24,color:`#8b5cf6`}}),t?(0,Q.jsx)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,style:{position:`absolute`,inset:0}}):null,(0,Q.jsx)(r0,{style:{position:`absolute`,color:`#fff`,fontSize:22,filter:`drop-shadow(0 1px 3px rgba(0,0,0,.45))`}})]}):t?(0,Q.jsx)(vN,{width:72,height:52,src:t,style:{objectFit:`cover`,borderRadius:10}}):(0,Q.jsx)(`div`,{style:{width:72,height:52,borderRadius:10,background:`#f5f5f5`}})},RGe=()=>{let[e,t]=(0,C.useState)([]),[n,r]=(0,C.useState)([]),[i,a]=(0,C.useState)(0),[o,s]=(0,C.useState)(0),[c,l]=(0,C.useState)(!1),[u,d]=(0,C.useState)(!1),[f,p]=(0,C.useState)(``),[m,h]=(0,C.useState)(``),[g,_]=(0,C.useState)(``),[v,y]=(0,C.useState)(``),[b,x]=(0,C.useState)(``),[S,w]=(0,C.useState)(),[T,E]=(0,C.useState)(1),[D,O]=(0,C.useState)(1),k=(0,C.useMemo)(()=>({keyword:f.trim()||void 0,libraryType:m||void 0,assetType:g||void 0,projectStatus:v||void 0,assetStatus:b||void 0}),[f,m,g,v,b]),A=async()=>{l(!0);try{let e=await SHe({keyword:k.keyword,libraryType:k.libraryType,status:k.projectStatus,page:T,pageSize:q9});t(e.items||[]),a(e.total||0)}catch(e){mP.error(e?.message||`加载私域人像素材项目失败`)}finally{l(!1)}},j=async()=>{d(!0);try{let e=await CHe({projectId:S,keyword:k.keyword,libraryType:k.libraryType,assetType:k.assetType,status:k.assetStatus,page:D,pageSize:q9});r(e.items||[]),s(e.total||0)}catch(e){mP.error(e?.message||`加载私域人像素材失败`)}finally{d(!1)}};(0,C.useEffect)(()=>{A()},[T,k.libraryType,k.projectStatus]),(0,C.useEffect)(()=>{j()},[S,D,k.libraryType,k.assetType,k.assetStatus]);let M=()=>{E(1),O(1),setTimeout(()=>{A(),j()},0)},N=()=>{p(``),h(``),_(``),y(``),x(``),w(void 0),E(1),O(1)},P=(0,C.useMemo)(()=>e.reduce((e,t)=>(e.asset+=t.assetCount||0,e.image+=t.imageAssetCount||0,e.video+=t.videoAssetCount||0,e.active+=t.activeAssetCount||0,e),{asset:0,image:0,video:0,active:0}),[e]),F=[{title:`项目名称`,dataIndex:`name`,width:200,fixed:`left`,render:(e,t)=>(0,Q.jsx)(JS,{type:`link`,onClick:()=>{w(t.id),O(1)},children:e})},{title:`类型`,dataIndex:`libraryType`,width:110,render:e=>(0,Q.jsx)(hR,{color:Y9(e),children:J9(e)})},{title:`用户ID`,dataIndex:`userId`,width:170,render:e=>(0,Q.jsx)(K9,{code:!0,copyable:!!e,children:e||`-`})},{title:`状态`,dataIndex:`status`,width:130,render:e=>(0,Q.jsx)(hR,{color:X9(e),children:e})},{title:`素材`,width:170,render:(e,t)=>(0,Q.jsxs)(CM,{size:4,children:[(0,Q.jsxs)(hR,{children:[`总 `,t.assetCount||0]}),(0,Q.jsxs)(hR,{color:`blue`,children:[`图 `,t.imageAssetCount||0]}),(0,Q.jsxs)(hR,{color:`geekblue`,children:[`视 `,t.videoAssetCount||0]})]})},{title:`Active`,dataIndex:`activeAssetCount`,width:90},{title:`ProjectName`,dataIndex:`remoteProjectName`,width:180,render:e=>(0,Q.jsx)(K9,{code:!0,copyable:!!e,children:e||`-`})},{title:`创建时间`,dataIndex:`createdAt`,width:170,render:C5},{title:`更新时间`,dataIndex:`updatedAt`,width:170,render:C5}],I=[{title:`预览`,width:100,fixed:`left`,render:(e,t)=>(0,Q.jsx)(LGe,{asset:t})},{title:`素材名称`,dataIndex:`name`,width:180,render:(e,t)=>(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(K9,{strong:!0,children:e||`未命名素材`}),(0,Q.jsx)(`br`,{}),(0,Q.jsx)(K9,{type:`secondary`,children:IGe(t.assetType)})]})},{title:`库类型`,dataIndex:`libraryType`,width:110,render:e=>(0,Q.jsx)(hR,{color:Y9(e),children:J9(e)})},{title:`用户ID`,dataIndex:`userId`,width:170,render:e=>(0,Q.jsx)(K9,{code:!0,copyable:!!e,children:e||`-`})},{title:`本地项目`,dataIndex:`projectName`,width:160,render:e=>e||`-`},{title:`状态`,dataIndex:`status`,width:120,render:e=>(0,Q.jsx)(hR,{color:X9(e),children:e})},{title:`AssetId`,dataIndex:`remoteAssetId`,width:190,render:e=>(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(K9,{code:!0,children:Z9(e)}),e?(0,Q.jsx)(JS,{size:`small`,type:`text`,icon:(0,Q.jsx)(WR,{}),onClick:()=>Q9(e)}):null]})},{title:`GroupId`,dataIndex:`remoteGroupId`,width:190,render:e=>(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(K9,{code:!0,children:Z9(e)}),e?(0,Q.jsx)(JS,{size:`small`,type:`text`,icon:(0,Q.jsx)(WR,{}),onClick:()=>Q9(e)}):null]})},{title:`轮询`,width:160,render:(e,t)=>(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(K9,{children:[`次数:`,t.pollCount||0]}),(0,Q.jsx)(`br`,{}),(0,Q.jsxs)(K9,{type:`secondary`,children:[`下次:`,C5(t.nextPollAt)]})]})},{title:`错误`,dataIndex:`errorMessage`,width:240,ellipsis:!0,render:e=>e?(0,Q.jsx)(ux,{title:e,children:(0,Q.jsx)(K9,{type:`danger`,children:e})}):`-`},{title:`创建时间`,dataIndex:`createdAt`,width:170,render:C5}];return(0,Q.jsxs)(`div`,{style:{padding:24,background:`#f7f7fb`,minHeight:`100%`},children:[(0,Q.jsxs)(CM,{style:{width:`100%`,justifyContent:`space-between`,marginBottom:16},align:`start`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(jGe,{level:3,style:{margin:0},children:`私域人像素材库`}),(0,Q.jsx)(K9,{type:`secondary`,children:`统一查看真人认证素材与虚拟人像素材,支持图片/视频资产状态排查。`})]}),(0,Q.jsxs)(CM,{wrap:!0,children:[(0,Q.jsx)(MN,{allowClear:!0,prefix:(0,Q.jsx)(hb,{}),placeholder:`搜索项目/素材`,value:f,onChange:e=>p(e.target.value),onPressEnter:M,style:{width:240}}),(0,Q.jsx)(bb,{value:m,onChange:e=>{h(e),E(1),O(1)},options:MGe,style:{width:150}}),(0,Q.jsx)(bb,{value:g,onChange:e=>{_(e),O(1)},options:NGe,style:{width:130}}),(0,Q.jsx)(JS,{icon:(0,Q.jsx)(hb,{}),type:`primary`,onClick:M,children:`查询`}),(0,Q.jsx)(JS,{onClick:N,children:`重置`}),(0,Q.jsx)(JS,{icon:(0,Q.jsx)(MP,{}),onClick:()=>{A(),j()},children:`刷新`})]})]}),(0,Q.jsxs)(CM,{size:16,wrap:!0,style:{marginBottom:16},children:[(0,Q.jsx)(OA,{style:{width:180},children:(0,Q.jsx)(RP,{title:`项目数`,value:i})}),(0,Q.jsx)(OA,{style:{width:180},children:(0,Q.jsx)(RP,{title:`当前页素材`,value:P.asset})}),(0,Q.jsx)(OA,{style:{width:180},children:(0,Q.jsx)(RP,{title:`图片`,value:P.image})}),(0,Q.jsx)(OA,{style:{width:180},children:(0,Q.jsx)(RP,{title:`视频`,value:P.video})}),(0,Q.jsx)(OA,{style:{width:180},children:(0,Q.jsx)(RP,{title:`Active`,value:P.active})})]}),(0,Q.jsx)(OA,{title:`项目组`,style:{marginBottom:16,borderRadius:14},extra:(0,Q.jsx)(bb,{value:v,onChange:e=>{y(e),E(1)},options:PGe,style:{width:180}}),children:(0,Q.jsx)(nR,{rowKey:`id`,columns:F,dataSource:e,loading:c,pagination:{current:T,pageSize:q9,total:i,onChange:E},size:`small`,scroll:{x:1350}})}),(0,Q.jsx)(OA,{title:S?`项目素材明细`:`全部素材明细`,style:{borderRadius:14},extra:(0,Q.jsxs)(CM,{children:[(0,Q.jsx)(bb,{value:b,onChange:e=>{x(e),O(1)},options:FGe,style:{width:170}}),S?(0,Q.jsx)(JS,{size:`small`,onClick:()=>w(void 0),children:`查看全部`}):null]}),children:(0,Q.jsx)(nR,{rowKey:`id`,columns:I,dataSource:n,loading:u,pagination:{current:D,pageSize:q9,total:o,onChange:O},size:`small`,scroll:{x:1700}})})]})},zGe=({children:e})=>{let{user:t,loading:n,checkAuth:r}=v5();return(0,C.useEffect)(()=>{!localStorage.getItem(`auth_token`)&&!n&&!t&&(window.location.href=`/login`)},[t,n]),n?(0,Q.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,alignItems:`center`,height:`100vh`},children:(0,Q.jsx)(rP,{size:`large`})}):t?(0,Q.jsx)(Q.Fragment,{children:e}):(window.location.href=`/login`,null)};(0,v.createRoot)(document.getElementById(`root`)).render((0,Q.jsx)(()=>{let{checkAuth:e}=v5();return(0,C.useEffect)(()=>{e()},[]),(0,Q.jsx)($p,{locale:O8.default,theme:{token:{colorPrimary:`#6366f1`,borderRadius:8},components:{Button:{controlHeight:36,controlHeightLG:44},Card:{boxShadow:`0 1px 3px rgba(0,0,0,0.04)`},Table:{headerBg:`#fafbfc`}}},children:(0,Q.jsx)(Lv,{children:(0,Q.jsx)(_n,{children:(0,Q.jsxs)(kt,{children:[(0,Q.jsx)(Dt,{path:`/login`,element:(0,Q.jsx)(PHe,{})}),(0,Q.jsxs)(Dt,{path:`/`,element:(0,Q.jsx)(zGe,{children:(0,Q.jsx)(kHe,{})}),children:[(0,Q.jsx)(Dt,{index:!0,element:(0,Q.jsx)(FHe,{})}),(0,Q.jsx)(Dt,{path:`users`,element:(0,Q.jsx)(zHe,{})}),(0,Q.jsx)(Dt,{path:`teams`,element:(0,Q.jsx)(UHe,{})}),(0,Q.jsx)(Dt,{path:`credit-records`,element:(0,Q.jsx)(fUe,{})}),(0,Q.jsx)(Dt,{path:`models`,element:(0,Q.jsx)(k5,{})}),(0,Q.jsx)(Dt,{path:`credit-ratios`,element:(0,Q.jsx)(EUe,{})}),(0,Q.jsx)(Dt,{path:`video-engines`,element:(0,Q.jsx)(bUe,{})}),(0,Q.jsx)(Dt,{path:`image-engines`,element:(0,Q.jsx)(CUe,{})}),(0,Q.jsx)(Dt,{path:`industries`,element:(0,Q.jsx)(yUe,{})}),(0,Q.jsx)(Dt,{path:`menu-configs`,element:(0,Q.jsx)(AUe,{})}),(0,Q.jsx)(Dt,{path:`recharge-packages`,element:(0,Q.jsx)(NUe,{})}),(0,Q.jsx)(Dt,{path:`payment`,element:(0,Q.jsx)(pUe,{})}),(0,Q.jsx)(Dt,{path:`payment-stats`,element:(0,Q.jsx)(hUe,{})}),(0,Q.jsx)(Dt,{path:`settings`,element:(0,Q.jsx)(WHe,{})}),(0,Q.jsx)(Dt,{path:`video-prompt-schema-config`,element:(0,Q.jsx)(GWe,{})}),(0,Q.jsx)(Dt,{path:`video-upscale`,element:(0,Q.jsx)(ZWe,{})}),(0,Q.jsx)(Dt,{path:`notifications`,element:(0,Q.jsx)(GHe,{})}),(0,Q.jsx)(Dt,{path:`oauthapp-list`,element:(0,Q.jsx)(IUe,{})}),(0,Q.jsx)(Dt,{path:`operation-logs`,element:(0,Q.jsx)(FUe,{})}),(0,Q.jsx)(Dt,{path:`generation-records`,element:(0,Q.jsx)(VUe,{})}),(0,Q.jsx)(Dt,{path:`generation-ai`,element:(0,Q.jsx)(YUe,{})}),(0,Q.jsx)(Dt,{path:`hot-opening-replications`,element:(0,Q.jsx)(eWe,{})}),(0,Q.jsx)(Dt,{path:`hot-opening-replications/:projectId`,element:(0,Q.jsx)(xWe,{})}),(0,Q.jsx)(Dt,{path:`shot-replications`,element:(0,Q.jsx)(EWe,{})}),(0,Q.jsx)(Dt,{path:`shot-replications/task-sets/:taskSetId`,element:(0,Q.jsx)(FWe,{})}),(0,Q.jsx)(Dt,{path:`shot-replications/projects/:projectId`,element:(0,Q.jsx)(t9,{moduleType:`shot_replicate`})}),(0,Q.jsx)(Dt,{path:`authoriza`,element:(0,Q.jsx)(jHe,{})}),(0,Q.jsx)(Dt,{path:`consume`,element:(0,Q.jsx)(NHe,{})}),(0,Q.jsx)(Dt,{path:`platform`,element:(0,Q.jsx)(IHe,{})}),(0,Q.jsx)(Dt,{path:`contact-requests`,element:(0,Q.jsx)(QWe,{})}),(0,Q.jsx)(Dt,{path:`home-materials`,element:(0,Q.jsx)(SGe,{})}),(0,Q.jsx)(Dt,{path:`pretest-templates`,element:(0,Q.jsx)(TGe,{})}),(0,Q.jsx)(Dt,{path:`oauth-list`,element:(0,Q.jsx)(DGe,{})}),(0,Q.jsx)(Dt,{path:`material-list`,element:(0,Q.jsx)(AGe,{})}),(0,Q.jsx)(Dt,{path:`private-portrait-projects`,element:(0,Q.jsx)(RGe,{})})]}),(0,Q.jsx)(Dt,{path:`*`,element:(0,Q.jsx)(Tt,{to:`/`,replace:!0})})]})})})})},{})); \ No newline at end of file diff --git a/video-gen-admin/dist/index.html b/video-gen-admin/dist/index.html index 3b0b360f..fc58bb5b 100644 --- a/video-gen-admin/dist/index.html +++ b/video-gen-admin/dist/index.html @@ -28,7 +28,7 @@ } })(); - + diff --git a/video-gen-admin/src/pages/AdminContactRequests.tsx b/video-gen-admin/src/pages/AdminContactRequests.tsx index 0b5fc80c..95514cdf 100644 --- a/video-gen-admin/src/pages/AdminContactRequests.tsx +++ b/video-gen-admin/src/pages/AdminContactRequests.tsx @@ -30,7 +30,7 @@ const AdminContactRequests: React.FC = () => { const { user } = useAdminStore(); const fetchData = async () => { - if (!user?.isAdmin) return; + // if (!user?.isAdmin) return; setLoading(true); try { const query = new URLSearchParams(); @@ -39,7 +39,7 @@ const AdminContactRequests: React.FC = () => { if (isHandledFilter !== null) { query.set('is_handled', String(isHandledFilter)); } - const res = await api.get<{ items: ContactRequest[]; total: number }>(`/contact/requests?${query.toString()}`); + const res = await api.get<{ items: ContactRequest[]; total: number }>(`/admin/contact-requests?${query.toString()}`); setData(res.items); setTotal(res.total); } catch (err: any) { @@ -55,7 +55,7 @@ const AdminContactRequests: React.FC = () => { const handleMarkHandled = async (id: string) => { try { - await api.put(`/contact/requests/${id}/handle`); + await api.put(`/admin/contact-requests/${id}/handle`); message.success('已标记为处理'); fetchData(); } catch (err: any) { @@ -65,7 +65,7 @@ const AdminContactRequests: React.FC = () => { const handleDelete = async (id: string) => { try { - await api.delete(`/contact/requests/${id}`); + await api.delete(`/admin/contact-requests/${id}`); message.success('已删除'); fetchData(); } catch (err: any) { diff --git a/video-gen-api/app/api/admin/__init__.py b/video-gen-api/app/api/admin/__init__.py index 707543fd..9db3c0bc 100644 --- a/video-gen-api/app/api/admin/__init__.py +++ b/video-gen-api/app/api/admin/__init__.py @@ -9,6 +9,7 @@ from app.api.admin.private_portrait import router as private_portrait_router from app.api.admin.recharge_package import router as recharge_package_router from app.api.admin.menu_config import router as menu_config_router from app.api.admin.upload import router as admin_upload_router +from app.api.admin.contact import router as admin_contact_router router = APIRouter() router.include_router(video_prompt_schema_config_router) @@ -20,3 +21,4 @@ router.include_router(private_portrait_router) router.include_router(recharge_package_router) router.include_router(menu_config_router) router.include_router(admin_upload_router) +router.include_router(admin_contact_router) diff --git a/video-gen-api/app/api/admin/contact.py b/video-gen-api/app/api/admin/contact.py new file mode 100644 index 00000000..28178144 --- /dev/null +++ b/video-gen-api/app/api/admin/contact.py @@ -0,0 +1,75 @@ +from fastapi import APIRouter, Depends, HTTPException, Query +from sqlalchemy import func, select +from sqlalchemy.ext.asyncio import AsyncSession + +from app.dependencies import get_admin_user, get_db +from app.models.contact_request import ContactRequest +from app.models.user import User +from app.schemas.contact import ContactRequestListOut, ContactRequestOut + +router = APIRouter(prefix="/admin/contact-requests", tags=["admin-contact-requests"]) + + +@router.get("", response_model=ContactRequestListOut) +async def list_contact_requests( + page: int = Query(1, ge=1), + page_size: int = Query(20, ge=1, le=200), + is_handled: bool | None = Query(None), + admin: User = Depends(get_admin_user), + db: AsyncSession = Depends(get_db), +): + query = select(ContactRequest) + count_query = select(func.count(ContactRequest.id)) + if is_handled is not None: + query = query.where(ContactRequest.is_handled == is_handled) + count_query = count_query.where(ContactRequest.is_handled == is_handled) + query = query.order_by(ContactRequest.created_at.desc()) + offset = (page - 1) * page_size + result = await db.execute(query.offset(offset).limit(page_size)) + items = result.scalars().all() + total = (await db.execute(count_query)).scalar_one() + return {"items": items, "total": total} + + +@router.get("/{request_id}", response_model=ContactRequestOut) +async def get_contact_request( + request_id: str, + admin: User = Depends(get_admin_user), + db: AsyncSession = Depends(get_db), +): + result = await db.execute(select(ContactRequest).where(ContactRequest.id == request_id)) + item = result.scalar_one_or_none() + if not item: + raise HTTPException(status_code=404, detail="记录不存在") + return item + + +@router.put("/{request_id}/handle") +async def mark_contact_handled( + request_id: str, + admin: User = Depends(get_admin_user), + db: AsyncSession = Depends(get_db), +): + result = await db.execute(select(ContactRequest).where(ContactRequest.id == request_id)) + item = result.scalar_one_or_none() + if not item: + raise HTTPException(status_code=404, detail="记录不存在") + item.is_handled = True + await db.commit() + await db.refresh(item) + return {"message": "已标记为处理"} + + +@router.delete("/{request_id}") +async def delete_contact_request( + request_id: str, + admin: User = Depends(get_admin_user), + db: AsyncSession = Depends(get_db), +): + result = await db.execute(select(ContactRequest).where(ContactRequest.id == request_id)) + item = result.scalar_one_or_none() + if not item: + raise HTTPException(status_code=404, detail="记录不存在") + await db.delete(item) + await db.commit() + return {"message": "删除成功"} diff --git a/video-gen-api/app/api/v1/contact.py b/video-gen-api/app/api/v1/contact.py index bfb10121..ba9f1477 100644 --- a/video-gen-api/app/api/v1/contact.py +++ b/video-gen-api/app/api/v1/contact.py @@ -1,14 +1,14 @@ from datetime import datetime, timezone, timedelta from fastapi import APIRouter, Depends, HTTPException, status -from sqlalchemy import func, select +from sqlalchemy import select from sqlalchemy.exc import IntegrityError from sqlalchemy.ext.asyncio import AsyncSession from app.dependencies import get_db, get_current_user from app.models.contact_request import ContactRequest from app.models.user import User -from app.schemas.contact import ContactRequestCreate, ContactRequestListOut, ContactRequestOut +from app.schemas.contact import ContactRequestCreate from app.utils.id_gen import generate_id router = APIRouter(prefix="/contact", tags=["contact"]) @@ -62,94 +62,4 @@ async def create_contact_request( detail="每个账号每天只能提交一次联系我们" ) - return {"message": "提交成功,我们会尽快与您联系"} - - -@router.get("/requests", summary="获取联系请求列表", response_model=ContactRequestListOut) -async def get_contact_requests( - page: int = 1, - page_size: int = 20, - is_handled: bool | None = None, - db: AsyncSession = Depends(get_db), - user: User = Depends(get_current_user), -): - if not user.is_admin: - raise HTTPException(status_code=status.HTTP_403_FORBIDDEN, detail="无权限") - - query = select(ContactRequest) - count_query = select(func.count(ContactRequest.id)) - - if is_handled is not None: - query = query.where(ContactRequest.is_handled == is_handled) - count_query = count_query.where(ContactRequest.is_handled == is_handled) - - query = query.order_by(ContactRequest.created_at.desc()) - - offset = (page - 1) * page_size - result = await db.execute(query.offset(offset).limit(page_size)) - items = result.scalars().all() - - total = (await db.execute(count_query)).scalar_one() - - return {"items": items, "total": total} - - -@router.get("/requests/{request_id}", summary="获取联系请求详情", response_model=ContactRequestOut) -async def get_contact_request( - request_id: str, - db: AsyncSession = Depends(get_db), - user: User = Depends(get_current_user), -): - if not user.is_admin: - raise HTTPException(status_code=status.HTTP_403_FORBIDDEN, detail="无权限") - - result = await db.execute(select(ContactRequest).where(ContactRequest.id == request_id)) - contact_request = result.scalar_one_or_none() - - if not contact_request: - raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="记录不存在") - - return contact_request - - -@router.put("/requests/{request_id}/handle", summary="标记为已处理") -async def mark_as_handled( - request_id: str, - db: AsyncSession = Depends(get_db), - user: User = Depends(get_current_user), -): - if not user.is_admin: - raise HTTPException(status_code=status.HTTP_403_FORBIDDEN, detail="无权限") - - result = await db.execute(select(ContactRequest).where(ContactRequest.id == request_id)) - contact_request = result.scalar_one_or_none() - - if not contact_request: - raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="记录不存在") - - contact_request.is_handled = True - await db.commit() - await db.refresh(contact_request) - - return {"message": "已标记为处理"} - - -@router.delete("/requests/{request_id}", summary="删除联系请求") -async def delete_contact_request( - request_id: str, - db: AsyncSession = Depends(get_db), - user: User = Depends(get_current_user), -): - if not user.is_admin: - raise HTTPException(status_code=status.HTTP_403_FORBIDDEN, detail="无权限") - - result = await db.execute(select(ContactRequest).where(ContactRequest.id == request_id)) - contact_request = result.scalar_one_or_none() - - if not contact_request: - raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="记录不存在") - - await db.delete(contact_request) - await db.commit() - - return {"message": "删除成功"} \ No newline at end of file + return {"message": "提交成功,我们会尽快与您联系"} \ No newline at end of file diff --git a/video-gen-api/app/services/llm.py b/video-gen-api/app/services/llm.py index a6df8c34..d1215180 100644 --- a/video-gen-api/app/services/llm.py +++ b/video-gen-api/app/services/llm.py @@ -2,7 +2,6 @@ import base64 import json import mimetypes import os -import random from datetime import datetime import httpx @@ -112,44 +111,27 @@ async def optimize_prompt( await db.commit() if configs: - total_weight = sum(c.weight for c in configs) - r = random.uniform(0, total_weight) - cumulative = 0 - selected = configs[0] - for c in configs: - cumulative += c.weight - if r <= cumulative: - selected = c - break + # 按 priority 从大到小依次尝试,跳过 mock,失败则用下一个 + for selected in configs: + if selected.provider == "mock": + continue + if selected.provider in ("openai_compatible", "sdk"): + try: + return await _call_openai_compatible( + selected, original_prompt, db, user_id, industry_key, duration, + references=references, + gen_type=gen_type, + image_size=image_size, + image_proportion=image_proportion, + image_px=image_px, + ) + except Exception: + continue - if selected.provider == "mock": + # 所有真实模型都失败,降级到 mock + mock_cfg = next((c for c in configs if c.provider == "mock"), None) + if mock_cfg: return _mock_optimize(original_prompt, gen_type) - elif selected.provider in ("openai_compatible", "sdk"): - try: - return await _call_openai_compatible( - selected, original_prompt, db, user_id, industry_key, duration, - references=references, - gen_type=gen_type, - image_size=image_size, - image_proportion=image_proportion, - image_px=image_px, - ) - except Exception: - for c in configs: - if c.id == selected.id or c.provider == "mock": - continue - try: - return await _call_openai_compatible( - c, original_prompt, db, user_id, industry_key, duration, - references=references, - gen_type=gen_type, - image_size=image_size, - image_proportion=image_proportion, - image_px=image_px, - ) - except Exception: - continue - raise if settings.LLM_MOCK: return _mock_optimize(original_prompt, gen_type) diff --git a/video-gen-app/dist/assets/index-CKeRPhR_.css b/video-gen-app/dist/assets/index-Bsz_Xon-.css similarity index 70% rename from video-gen-app/dist/assets/index-CKeRPhR_.css rename to video-gen-app/dist/assets/index-Bsz_Xon-.css index 2449df0d..62eb425e 100644 --- a/video-gen-app/dist/assets/index-CKeRPhR_.css +++ b/video-gen-app/dist/assets/index-Bsz_Xon-.css @@ -1 +1 @@ -@import "https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap";:root{--font-sans:"Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;--nav-bg:#f8f9fb;--nav-surface:#00000005;--nav-border:#e5e7eb;--nav-text:#1f2937;--nav-text-muted:#6b7280;--nav-hover:#0000000a;--nav-active:#6366f114}*,:before,:after{box-sizing:border-box;margin:0;padding:0}html,body{font-family:var(--font-sans);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#1a1a2e;letter-spacing:-.01em;background:#f8f9fc;margin:0;padding:0}#root{min-height:100vh}::-webkit-scrollbar{width:5px;height:5px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:3px}::-webkit-scrollbar-thumb:hover{background:#9ca3af}@keyframes electric-pulse{0%,to{opacity:.4;filter:blur(1px)}50%{opacity:1;filter:blur()}}@keyframes electric-flow{0%{background-position:0%}50%{background-position:100%}to{background-position:0%}}.content_box{scrollbar-width:none;border-radius:0 0 16px 16px;height:calc(100vh - 34px);margin:-24px -32px -32px;padding:20px;overflow:auto}.electric-border-card{position:relative}.electric-border{z-index:0;background:linear-gradient(90deg,#6366f1,#8b5cf6,#a855f7,#6366f1,#8b5cf6,#a855f7,#6366f1) 0 0/300% 100%;border-radius:16px;animation:3s linear infinite electric-flow,2s ease-in-out infinite electric-pulse;position:absolute;inset:-2px}.electric-border-inner{-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);z-index:0;background:#ffffffe6;border-radius:14px;position:absolute;inset:2px}.electric-border-card:hover .electric-border{opacity:.8;animation-duration:1.5s,1s}@keyframes shiny{0%{background-position:-200%}to{background-position:200%}}.shiny-text-container{margin-bottom:16px}.shiny-text{background:linear-gradient(90deg,#6366f1 0%,#8b5cf6 20%,#a855f7 40%,#c084fc 50%,#a855f7 60%,#8b5cf6 80%,#6366f1 100%) 0 0/200%;-webkit-text-fill-color:transparent;letter-spacing:1px;-webkit-background-clip:text;background-clip:text;font-size:24px;font-weight:700;animation:3s linear infinite shiny;display:inline-block}@keyframes fadeInUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@keyframes fadeInLeft{0%{opacity:0;transform:translate(-20px)}to{opacity:1;transform:translate(0)}}@keyframes fadeInRight{0%{opacity:0;transform:translate(20px)}to{opacity:1;transform:translate(0)}}@keyframes float1{0%,to{transform:translate(0)scale(1)}50%{transform:translate(20px,-30px)scale(1.05)}}@keyframes float2{0%,to{transform:translate(0)scale(1)}50%{transform:translate(-15px,20px)scale(.95)}}@keyframes float3{0%,to{transform:translate(0)rotate(0)}50%{transform:translate(10px,-15px)rotate(3deg)}}@keyframes slideInCard{0%{opacity:0;transform:translateY(14px)scale(.97)}to{opacity:1;transform:translateY(0)scale(1)}}@keyframes spinSlow{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes pulse{0%,to{opacity:1}50%{opacity:.6}}.animate-fadeInUp{animation:.45s ease-out both fadeInUp}.animate-fadeInLeft{animation:.55s ease-out both fadeInLeft}.animate-fadeInRight{animation:.55s ease-out both fadeInRight}.animate-slideInCard{animation:.4s ease-out both slideInCard}.animate-float1{animation:8s ease-in-out infinite float1}.animate-float2{animation:10s ease-in-out infinite float2}.animate-float3{animation:12s ease-in-out infinite float3}.ref-thumb:hover .ref-delete{opacity:1!important}.stagger-children>:first-child{animation-delay:40ms}.stagger-children>:nth-child(2){animation-delay:.1s}.stagger-children>:nth-child(3){animation-delay:.16s}.stagger-children>:nth-child(4){animation-delay:.22s}.stagger-children>:nth-child(5){animation-delay:.28s}.stagger-children>:nth-child(6){animation-delay:.34s}.ant-input,.ant-input-affix-wrapper,.ant-select-selector,.ant-input-number{border-radius:10px!important;transition:all .25s!important}.ant-input:focus,.ant-input-affix-wrapper:focus,.ant-input-affix-wrapper-focused,.ant-select-focused .ant-select-selector{border-color:#6366f1!important;box-shadow:0 0 0 3px #6366f11f!important}.ant-btn{border-radius:10px!important;font-weight:500!important;transition:all .25s!important}.ant-btn:hover{transform:none}.ant-btn:active{transform:translateY(0)}.ant-card{border-radius:16px!important;transition:all .3s!important}.ant-modal-content{overflow:hidden;border-radius:20px!important}.ant-tag{font-size:12px;border-radius:8px!important}.recharge-card{cursor:pointer;transition:all .35s cubic-bezier(.4,0,.2,1)!important}.recharge-card:hover{transform:translateY(-8px)scale(1.02)!important;box-shadow:0 20px 40px #6366f126!important}.recharge-card .recharge-price{transition:all .3s}.recharge-card:hover .recharge-price{transform:scale(1.08)}.homepage-tabs .ant-tabs-tab{color:#6b7280!important;padding:8px 16px!important;font-size:13px!important;font-weight:500!important;transition:all .25s!important}.homepage-tabs .ant-tabs-tab:hover{color:#6366f1!important}.homepage-tabs .ant-tabs-tab-active .ant-tabs-tab-btn{color:#6366f1!important;font-weight:600!important}.homepage-tabs .ant-tabs-ink-bar{background:linear-gradient(90deg,#6366f1,#a855f7)!important;border-radius:2px!important;height:3px!important}.project-card{position:relative;overflow:visible;transition:all .35s cubic-bezier(.4,0,.2,1)!important}.project-card:hover{border-color:#6366f1!important;transform:translateY(-4px)!important;box-shadow:0 16px 40px #6366f11f!important}.mobile-bottom-nav{z-index:200;-webkit-backdrop-filter:blur(24px);backdrop-filter:blur(24px);background:#fffffff2;border-top:1px solid #0000000d;height:60px;display:none;position:fixed;bottom:0;left:0;right:0;box-shadow:0 -4px 20px #0000000f}.mobile-bottom-nav .nav-item{cursor:pointer;color:#8b8fa3;letter-spacing:0;flex-direction:column;flex:1;justify-content:center;align-items:center;gap:2px;font-size:9px;font-weight:400;transition:all .2s;display:flex}.mobile-bottom-nav .nav-item.active{color:#08080c}.mobile-bottom-nav .nav-item .nav-icon{font-size:18px;transition:transform .2s}.mobile-bottom-nav .nav-item.active .nav-icon{transform:scale(1.05)}@media (width<=768px){.desktop-sidebar{display:none!important}.desktop-content{margin-left:0!important;padding:16px 16px 80px!important;overflow-x:hidden!important}.desktop-sidebar-toggle-zone{display:none!important}.mobile-bottom-nav{display:flex!important}html,body{overflow-x:hidden!important}.mobile-hide{display:none!important}.mobile-full{width:100%!important;max-width:100%!important}.mobile-stack{flex-direction:column!important}.mobile-p-16{padding:16px!important}.mobile-gap-12{gap:12px!important}.login-page{flex-direction:column!important}.login-left{display:none!important}.login-right{padding:24px 16px!important}.login-card{width:100%!important}.project-item{flex-direction:column!important;align-items:flex-start!important}.project-item .project-actions{justify-content:flex-end;width:100%;margin-top:12px;margin-left:0!important}.gen-header{flex-direction:column!important;gap:12px!important;padding:16px 18px!important}.gen-flow-bar{flex-direction:column!important;gap:14px!important;padding:16px!important}.gen-flow-divider{display:none!important}.gen-form-row{flex-direction:column!important;gap:0!important}.gen-credits-bar{text-align:center;flex-direction:column!important;gap:8px!important}.gen-prompt-row{flex-direction:column!important}.gen-prompt-row>*{width:100%!important}.gen-params{flex-wrap:wrap!important;gap:8px!important}.gen-params>div{min-width:0;flex:45%!important}.gen-detail-row{flex-direction:column!important}.gen-detail-row>*{flex:auto!important;width:100%!important;min-width:0!important}.record-filter-bar{flex-direction:column!important}.record-filter-bar .ant-space{flex-wrap:wrap!important}.record-filter-bar .ant-select{width:100%!important}.record-item{flex-direction:column!important;align-items:flex-start!important;gap:8px!important;overflow:hidden!important}.record-item .record-actions{justify-content:flex-end;width:100%!important}.record-item>span[style*=textOverflow]{white-space:normal!important;text-overflow:unset!important;overflow:visible!important}.mobile-meta{display:none!important}.credits-balance,.recharge-grid{flex-direction:column!important}.recharge-grid>*{width:100%!important}video{max-width:100%!important}.replication-container{flex-direction:column!important;gap:16px!important;height:calc(100vh - 64px)!important;padding:16px!important}.replication-preview{border-radius:12px!important;width:100%!important;height:30vh!important}.replication-form{border-radius:12px!important;width:100%!important;height:auto!important;max-height:calc(70vh - 32px)!important}.replication-form-content{max-height:calc(70vh - 64px)!important;padding:16px!important}}.date-display{font-family:SF Mono,Menlo,Consolas,monospace}@media (width<=480px){html,body{font-size:14px!important}.login-card{width:100%!important}.login-right{padding:16px!important}.gen-header{padding:12px 14px!important}.gen-form-row{gap:8px!important}.ant-btn{height:36px!important;padding:0 12px!important;font-size:13px!important}.ant-input,.ant-input-affix-wrapper,.ant-select-selector{height:36px!important;font-size:13px!important}.ant-card{padding:12px!important}.mobile-bottom-nav{height:56px!important}.mobile-bottom-nav .nav-item .nav-icon{font-size:18px!important}.mobile-bottom-nav .nav-item{gap:2px!important;font-size:9px!important}.replication-container{gap:12px!important;padding:12px!important}.replication-preview{border-radius:10px!important;height:25vh!important}.replication-form-content{padding:12px!important}.replication-form-content .ant-btn,.replication-form-content .ant-input,.replication-form-content .ant-input-affix-wrapper{height:36px!important;font-size:13px!important}video,img{border-radius:6px!important;max-height:160px!important}.upload-area,.mobile-p-16{padding:12px!important}.mobile-gap-12{gap:8px!important}h1{font-size:18px!important}h2{font-size:16px!important}h3{font-size:14px!important}p,.btn-text-sm{font-size:12px!important}.mobile-mb-8{margin-bottom:8px!important}.mobile-mb-12{margin-bottom:12px!important}}@media (width>=769px) and (width<=1024px){.ant-card{max-width:calc(50% - 8px)!important}html,body{font-size:15px!important}}@media (width>=1200px){.max-w-container{max-width:1400px;margin:0 auto}.card-grid{grid-template-columns:repeat(3,1fr)!important}}.homepage-tabs .ant-tabs-nav{margin-bottom:0}.homepage-tabs .ant-tabs-tab{margin-right:4px;padding:8px 20px;font-size:14px;font-weight:500}.homepage-tabs .ant-tabs-tab-active{color:#6366f1;font-weight:600}.homepage-tabs .ant-tabs-ink-bar{background:linear-gradient(135deg,#6366f1,#8b5cf6)}.media-download-btn{z-index:10;opacity:0;pointer-events:none;transition:opacity .2s;position:absolute;top:8px;right:8px}.media-card:hover .media-download-btn{opacity:1;pointer-events:auto}.media-preview-tip{opacity:0;transition:opacity .2s}.media-card:hover .media-preview-tip{opacity:1}.desktop-sidebar{display:flex}.desktop-content{display:block}.mobile-header,.mobile-content,.mobile-menu-drawer{display:none}.mobile-menu-item{cursor:pointer;border-radius:10px;align-items:center;gap:12px;min-height:48px;margin:2px 8px;padding:12px 16px;transition:all .2s;display:flex}.mobile-menu-item:hover{background:#6366f10d}.mobile-menu-item-active{background:linear-gradient(135deg,#6366f11a 0%,#8b5cf614 100%)!important}.mobile-menu-group{cursor:default}.mobile-menu-group:hover{background:0 0}.mobile-menu-icon{flex-shrink:0;justify-content:center;align-items:center;width:24px;font-size:18px;display:flex}.mobile-menu-label{flex:1;font-size:15px}.mobile-submenu{background:#f8fafc80;border-radius:8px;margin:0 8px;padding-left:12px}.mobile-submenu-item{min-height:44px;margin:1px 0;padding:10px 16px 10px 20px}.mobile-recharge-item{box-shadow:0 4px 16px #6366f166;background:linear-gradient(135deg,#6366f1 0%,#8b5cf6 100%)!important}.mobile-recharge-item:hover{background:linear-gradient(135deg,#4f46e5 0%,#7c3aed 100%)!important}.contact-button-wrapper{z-index:1000;cursor:move;position:fixed;bottom:25%;right:24px}.contact-tooltip{color:#fff;white-space:nowrap;pointer-events:none;background:#1e293be6;border-radius:8px;padding:8px 16px;font-size:13px;transition:opacity .2s;position:absolute;bottom:8px;right:64px}.contact-button{color:#fff;cursor:pointer;background:linear-gradient(135deg,#6366f1cc 0%,#8b5cf6cc 100%);border:none;border-radius:50%;justify-content:center;align-items:center;width:40px;height:40px;transition:all .3s;display:flex;box-shadow:0 4px 20px #6366f14d}.contact-button:hover{background:linear-gradient(135deg,#6366f1f2 0%,#8b5cf6f2 100%);transform:scale(1.05);box-shadow:0 6px 24px #6366f166}.contact-button.dragging{cursor:grabbing;transform:scale(1.1);box-shadow:0 8px 30px #6366f180}@media (width<=767px){.desktop-sidebar,.desktop-content{display:none!important}.mobile-header{z-index:100;background:linear-gradient(135deg,#fff 0%,#f8fafc 100%);border-bottom:1px solid #0000000f;display:block;position:fixed;top:0;left:0;right:0;box-shadow:0 2px 12px #0000000f}.mobile-header-content{justify-content:space-between;align-items:center;height:56px;padding:0 16px;display:flex}.mobile-menu-btn{cursor:pointer;color:#475569;border-radius:10px;justify-content:center;align-items:center;width:40px;height:40px;transition:all .2s;display:flex}.mobile-menu-btn:hover{color:#6366f1;background:#6366f114}.mobile-header-title{color:#1e293b;background:linear-gradient(135deg,#6366f1,#8b5cf6);-webkit-text-fill-color:transparent;-webkit-background-clip:text;background-clip:text;font-size:18px;font-weight:700}.mobile-header-right{align-items:center;gap:12px;display:flex}.mobile-credits-badge{color:#6366f1;cursor:pointer;background:#6366f114;border-radius:20px;align-items:center;gap:6px;padding:6px 12px;font-size:13px;font-weight:600;transition:all .2s;display:flex}.mobile-credits-badge:hover{background:#6366f126}.mobile-content{background:#f8fafc;min-height:100vh;padding-top:56px;padding-bottom:24px;display:block}.mobile-content>div{background:#fff;border:1px solid #0000000a;border-radius:16px;min-height:calc(100vh - 104px);margin:12px;padding:16px;box-shadow:0 2px 12px #0000000a}.contact-button-wrapper{bottom:16px;right:16px}.contact-tooltip{display:none}.contact-button{width:44px;height:44px}.recharge-modal .ant-modal,.contact-modal .ant-modal{max-width:calc(100vw - 32px)!important;margin:16px!important}}.login-page{background:#1a1a2e url(/backimage.png) 50%/cover;flex-direction:column;height:100vh;max-height:100vh;display:flex;position:relative;overflow:hidden}.login-bg-video{object-fit:cover;z-index:0;pointer-events:none;width:100%;height:100%;position:absolute;inset:0}.login-bg-overlay{z-index:0;background:linear-gradient(135deg,#0f0f1ebf 0%,#141432a6 100%);position:absolute;inset:0}.login-slogan{z-index:2;position:absolute;top:40px;left:48px}.login-slogan-text{letter-spacing:1px;background:linear-gradient(90deg,#fff 0%,#c7d2fe 25%,#fff 50%,#c7d2fe 75%,#fff 100%) 0 0/200%;-webkit-text-fill-color:transparent;text-shadow:none;-webkit-background-clip:text;background-clip:text;font-size:24px;font-weight:800;animation:3s linear infinite shinySlide}@keyframes shinySlide{0%{background-position:0%}to{background-position:200%}}.login-center{z-index:1;flex:1;justify-content:flex-end;align-items:center;padding:24px 60px 24px 24px;display:flex}.login-card{-webkit-backdrop-filter:blur(24px);width:100%;max-width:400px;background:#fffffff2!important;border:1px solid #ffffff26!important;border-radius:20px!important;box-shadow:0 24px 80px #00000040,0 8px 32px #6366f11a!important}.login-card-header{text-align:center;margin-bottom:24px}.login-logo-row{justify-content:center;align-items:center;gap:12px;display:flex}.login-logo-img{object-fit:contain;border-radius:12px;width:40px;height:40px}.login-logo-placeholder{background:linear-gradient(135deg,#6366f1,#8b5cf6);border-radius:12px;justify-content:center;align-items:center;width:40px;height:40px;display:flex;box-shadow:0 6px 20px #6366f14d}.login-site-name{color:#1e293b;letter-spacing:-.3px;font-size:22px;font-weight:800}.login-card-subtitle{text-align:center;color:#94a3b8;margin-bottom:24px;font-size:13px;display:block}.login-tabs{background:#f1f5f9;border:1px solid #e2e8f0;border-radius:10px;gap:0;margin-bottom:20px;padding:4px;display:flex}.login-tab{text-align:center;cursor:pointer;color:#64748b;background:0 0;border:1px solid #0000;border-radius:8px;flex:1;padding:9px 0;font-size:13px;font-weight:400;transition:all .3s}.login-tab-active{color:#6366f1!important;background:#fff!important;border:1px solid #6366f133!important;font-weight:600!important;box-shadow:0 2px 8px #6366f11a!important}.login-submit-btn{background:linear-gradient(135deg,#6366f1 0%,#8b5cf6 100%)!important;border:none!important;border-radius:10px!important;height:46px!important;font-size:15px!important;font-weight:600!important;box-shadow:0 8px 24px #6366f140!important}.login-code-btn{border:1.5px solid #e2e8f0!important;border-radius:10px!important;min-width:100px!important;height:46px!important;font-weight:600!important}.login-agreement{margin-bottom:14px}.login-agreement-text{color:#64748b;font-size:12px}.login-link{color:#6366f1;cursor:pointer}.login-footer{justify-content:center;display:flex}.login-switch-btn{cursor:pointer;color:#6366f1!important;font-size:13px!important}.login-copyright-wrapper{text-align:center;z-index:2;pointer-events:none;position:absolute;bottom:20px;left:0;right:0}.login-copyright{color:#ffffff80;text-shadow:0 1px 3px #0000004d;font-size:12px}.login-page .ant-input-affix-wrapper{height:46px!important;padding:0 11px!important}.login-page .ant-input-affix-wrapper .ant-input-prefix{margin-left:0!important;margin-right:10px!important}.login-page .ant-input{height:46px!important;padding-left:11px!important}@media (width<=899px){.login-slogan{top:24px;left:24px}.login-slogan-text{font-size:18px}.login-center{justify-content:center;padding:80px 20px 24px}}@media (width<=480px){.login-slogan{top:20px;left:20px}.login-slogan-text{font-size:15px}.login-card .ant-card-body{padding:24px 20px!important}.login-card{border-radius:16px!important}.login-page .ant-input,.login-page .ant-input-affix-wrapper{height:44px!important}.login-code-btn{min-width:90px!important;height:44px!important}.login-submit-btn{height:44px!important}}@keyframes sliderShake{0%,to{transform:translate(0)}10%{transform:translate(-8px)}20%{transform:translate(8px)}30%{transform:translate(-6px)}40%{transform:translate(6px)}50%{transform:translate(-4px)}60%{transform:translate(4px)}70%{transform:translate(-2px)}80%{transform:translate(2px)}90%{transform:translate(-1px)}}*{box-sizing:border-box}.material_box{padding:24px}.material_box>div{margin:0 0 20px}.medio_box{width:280px;height:150px;margin-top:6px}.medio_box img,.medio_box video{width:100%;height:100%}.ant-collapse-ghost>.ant-collapse-item{border-bottom:1px solid #6366f10f;transition:all .3s cubic-bezier(.4,0,.2,1)}.ant-collapse-ghost>.ant-collapse-item:hover{background:#6366f105}.ant-collapse-ghost>.ant-collapse-item>.ant-collapse-header{transition:all .3s cubic-bezier(.4,0,.2,1);padding:14px 16px!important}.replication-form-content::-webkit-scrollbar{width:6px}.replication-preview::-webkit-scrollbar{width:6px}.replication-form-content::-webkit-scrollbar-thumb{background:#6366f133;border-radius:3px}.replication-preview::-webkit-scrollbar-thumb{background:#6366f133;border-radius:3px}.replication-form-content::-webkit-scrollbar-thumb:hover{background:#6366f166}.replication-preview::-webkit-scrollbar-thumb:hover{background:#6366f166}.replication-form-content::-webkit-scrollbar-track{background:0 0}.replication-preview::-webkit-scrollbar-track{background:0 0}input[type=range]{appearance:none;background:0 0}input[type=range]::-webkit-slider-thumb{appearance:none;cursor:pointer;background:#6366f1;border:2px solid #fff;border-radius:50%;width:16px;height:16px;transition:all .2s;box-shadow:0 2px 6px #6366f166}input[type=range]::-webkit-slider-thumb:hover{transform:scale(1.15);box-shadow:0 3px 10px #6366f199}input[type=range]::-moz-range-thumb{cursor:pointer;background:#6366f1;border:2px solid #fff;border-radius:50%;width:16px;height:16px;box-shadow:0 2px 6px #6366f166} +@import "https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap";:root{--font-sans:"Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;--nav-bg:#f8f9fb;--nav-surface:#00000005;--nav-border:#e5e7eb;--nav-text:#1f2937;--nav-text-muted:#6b7280;--nav-hover:#0000000a;--nav-active:#6366f114}*,:before,:after{box-sizing:border-box;margin:0;padding:0}html,body{font-family:var(--font-sans);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#1a1a2e;letter-spacing:-.01em;background:#f8f9fc;margin:0;padding:0}#root{min-height:100vh}::-webkit-scrollbar{width:5px;height:5px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:3px}::-webkit-scrollbar-thumb:hover{background:#9ca3af}@keyframes electric-pulse{0%,to{opacity:.4;filter:blur(1px)}50%{opacity:1;filter:blur()}}@keyframes electric-flow{0%{background-position:0%}50%{background-position:100%}to{background-position:0%}}.content_box{scrollbar-width:none;border-radius:0 0 16px 16px;height:calc(100vh - 34px);margin:-24px -32px -32px;padding:20px;overflow:auto}.electric-border-card{position:relative}.electric-border{z-index:0;background:linear-gradient(90deg,#6366f1,#8b5cf6,#a855f7,#6366f1,#8b5cf6,#a855f7,#6366f1) 0 0/300% 100%;border-radius:16px;animation:3s linear infinite electric-flow,2s ease-in-out infinite electric-pulse;position:absolute;inset:-2px}.electric-border-inner{-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);z-index:0;background:#ffffffe6;border-radius:14px;position:absolute;inset:2px}.electric-border-card:hover .electric-border{opacity:.8;animation-duration:1.5s,1s}@keyframes shiny{0%{background-position:-200%}to{background-position:200%}}.shiny-text-container{margin-bottom:16px}.shiny-text{background:linear-gradient(90deg,#6366f1 0%,#8b5cf6 20%,#a855f7 40%,#c084fc 50%,#a855f7 60%,#8b5cf6 80%,#6366f1 100%) 0 0/200%;-webkit-text-fill-color:transparent;letter-spacing:1px;-webkit-background-clip:text;background-clip:text;font-size:24px;font-weight:700;animation:3s linear infinite shiny;display:inline-block}@keyframes fadeInUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@keyframes fadeInLeft{0%{opacity:0;transform:translate(-20px)}to{opacity:1;transform:translate(0)}}@keyframes fadeInRight{0%{opacity:0;transform:translate(20px)}to{opacity:1;transform:translate(0)}}@keyframes float1{0%,to{transform:translate(0)scale(1)}50%{transform:translate(20px,-30px)scale(1.05)}}@keyframes float2{0%,to{transform:translate(0)scale(1)}50%{transform:translate(-15px,20px)scale(.95)}}@keyframes float3{0%,to{transform:translate(0)rotate(0)}50%{transform:translate(10px,-15px)rotate(3deg)}}@keyframes slideInCard{0%{opacity:0;transform:translateY(14px)scale(.97)}to{opacity:1;transform:translateY(0)scale(1)}}@keyframes spinSlow{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes pulse{0%,to{opacity:1}50%{opacity:.6}}.animate-fadeInUp{animation:.45s ease-out both fadeInUp}.animate-fadeInLeft{animation:.55s ease-out both fadeInLeft}.animate-fadeInRight{animation:.55s ease-out both fadeInRight}.animate-slideInCard{animation:.4s ease-out both slideInCard}.animate-float1{animation:8s ease-in-out infinite float1}.animate-float2{animation:10s ease-in-out infinite float2}.animate-float3{animation:12s ease-in-out infinite float3}.ref-thumb:hover .ref-delete{opacity:1!important}.stagger-children>:first-child{animation-delay:40ms}.stagger-children>:nth-child(2){animation-delay:.1s}.stagger-children>:nth-child(3){animation-delay:.16s}.stagger-children>:nth-child(4){animation-delay:.22s}.stagger-children>:nth-child(5){animation-delay:.28s}.stagger-children>:nth-child(6){animation-delay:.34s}.ant-input,.ant-input-affix-wrapper,.ant-select-selector,.ant-input-number{border-radius:10px!important;transition:all .25s!important}.ant-input:focus,.ant-input-affix-wrapper:focus,.ant-input-affix-wrapper-focused,.ant-select-focused .ant-select-selector{border-color:#6366f1!important;box-shadow:0 0 0 3px #6366f11f!important}.ant-btn{border-radius:10px!important;font-weight:500!important;transition:all .25s!important}.ant-btn:hover{transform:none}.ant-btn:active{transform:translateY(0)}.ant-card{border-radius:16px!important;transition:all .3s!important}.ant-modal-content{overflow:hidden;border-radius:20px!important}.ant-tag{font-size:12px;border-radius:8px!important}.recharge-card{cursor:pointer;transition:all .35s cubic-bezier(.4,0,.2,1)!important}.recharge-card:hover{transform:translateY(-8px)scale(1.02)!important;box-shadow:0 20px 40px #6366f126!important}.recharge-card .recharge-price{transition:all .3s}.recharge-card:hover .recharge-price{transform:scale(1.08)}.homepage-tabs .ant-tabs-tab{color:#6b7280!important;padding:8px 16px!important;font-size:13px!important;font-weight:500!important;transition:all .25s!important}.homepage-tabs .ant-tabs-tab:hover{color:#6366f1!important}.homepage-tabs .ant-tabs-tab-active .ant-tabs-tab-btn{color:#6366f1!important;font-weight:600!important}.homepage-tabs .ant-tabs-ink-bar{background:linear-gradient(90deg,#6366f1,#a855f7)!important;border-radius:2px!important;height:3px!important}.project-card{position:relative;overflow:visible;transition:all .35s cubic-bezier(.4,0,.2,1)!important}.project-card:hover{border-color:#6366f1!important;transform:translateY(-4px)!important;box-shadow:0 16px 40px #6366f11f!important}.mobile-bottom-nav{z-index:200;-webkit-backdrop-filter:blur(24px);backdrop-filter:blur(24px);background:#fffffff2;border-top:1px solid #0000000d;height:60px;display:none;position:fixed;bottom:0;left:0;right:0;box-shadow:0 -4px 20px #0000000f}.mobile-bottom-nav .nav-item{cursor:pointer;color:#8b8fa3;letter-spacing:0;flex-direction:column;flex:1;justify-content:center;align-items:center;gap:2px;font-size:9px;font-weight:400;transition:all .2s;display:flex}.mobile-bottom-nav .nav-item.active{color:#08080c}.mobile-bottom-nav .nav-item .nav-icon{font-size:18px;transition:transform .2s}.mobile-bottom-nav .nav-item.active .nav-icon{transform:scale(1.05)}@media (width<=768px){.desktop-sidebar{display:none!important}.desktop-content{margin-left:0!important;padding:16px 16px 80px!important;overflow-x:hidden!important}.desktop-sidebar-toggle-zone{display:none!important}.mobile-bottom-nav{display:flex!important}html,body{overflow-x:hidden!important}.mobile-hide{display:none!important}.mobile-full{width:100%!important;max-width:100%!important}.mobile-stack{flex-direction:column!important}.mobile-p-16{padding:16px!important}.mobile-gap-12{gap:12px!important}.login-page{flex-direction:column!important}.login-left{display:none!important}.login-right{padding:24px 16px!important}.login-card{width:100%!important}.project-item{flex-direction:column!important;align-items:flex-start!important}.project-item .project-actions{justify-content:flex-end;width:100%;margin-top:12px;margin-left:0!important}.gen-header{flex-direction:column!important;gap:12px!important;padding:16px 18px!important}.gen-flow-bar{flex-direction:column!important;gap:14px!important;padding:16px!important}.gen-flow-divider{display:none!important}.gen-form-row{flex-direction:column!important;gap:0!important}.gen-credits-bar{text-align:center;flex-direction:column!important;gap:8px!important}.gen-prompt-row{flex-direction:column!important}.gen-prompt-row>*{width:100%!important}.gen-params{flex-wrap:wrap!important;gap:8px!important}.gen-params>div{min-width:0;flex:45%!important}.gen-detail-row{flex-direction:column!important}.gen-detail-row>*{flex:auto!important;width:100%!important;min-width:0!important}.record-filter-bar{flex-direction:column!important}.record-filter-bar .ant-space{flex-wrap:wrap!important}.record-filter-bar .ant-select{width:100%!important}.record-item{flex-direction:column!important;align-items:flex-start!important;gap:8px!important;overflow:hidden!important}.record-item .record-actions{justify-content:flex-end;width:100%!important}.record-item>span[style*=textOverflow]{white-space:normal!important;text-overflow:unset!important;overflow:visible!important}.mobile-meta{display:none!important}.credits-balance,.recharge-grid{flex-direction:column!important}.recharge-grid>*{width:100%!important}video{max-width:100%!important}.replication-container{flex-direction:column!important;gap:16px!important;height:calc(100vh - 64px)!important;padding:16px!important}.replication-preview{border-radius:12px!important;width:100%!important;height:30vh!important}.replication-form{border-radius:12px!important;width:100%!important;height:auto!important;max-height:calc(70vh - 32px)!important}.replication-form-content{max-height:calc(70vh - 64px)!important;padding:16px!important}}.date-display{font-family:SF Mono,Menlo,Consolas,monospace}@media (width<=480px){html,body{font-size:14px!important}.login-card{width:100%!important}.login-right{padding:16px!important}.gen-header{padding:12px 14px!important}.gen-form-row{gap:8px!important}.ant-btn{height:36px!important;padding:0 12px!important;font-size:13px!important}.ant-input,.ant-input-affix-wrapper,.ant-select-selector{height:36px!important;font-size:13px!important}.ant-card{padding:12px!important}.mobile-bottom-nav{height:56px!important}.mobile-bottom-nav .nav-item .nav-icon{font-size:18px!important}.mobile-bottom-nav .nav-item{gap:2px!important;font-size:9px!important}.replication-container{gap:12px!important;padding:12px!important}.replication-preview{border-radius:10px!important;height:25vh!important}.replication-form-content{padding:12px!important}.replication-form-content .ant-btn,.replication-form-content .ant-input,.replication-form-content .ant-input-affix-wrapper{height:36px!important;font-size:13px!important}video,img{border-radius:6px!important;max-height:160px!important}.upload-area,.mobile-p-16{padding:12px!important}.mobile-gap-12{gap:8px!important}h1{font-size:18px!important}h2{font-size:16px!important}h3{font-size:14px!important}p,.btn-text-sm{font-size:12px!important}.mobile-mb-8{margin-bottom:8px!important}.mobile-mb-12{margin-bottom:12px!important}}@media (width>=769px) and (width<=1024px){.ant-card{max-width:calc(50% - 8px)!important}html,body{font-size:15px!important}}@media (width>=1200px){.max-w-container{max-width:1400px;margin:0 auto}.card-grid{grid-template-columns:repeat(3,1fr)!important}}.homepage-tabs .ant-tabs-nav{margin-bottom:0}.homepage-tabs .ant-tabs-tab{margin-right:4px;padding:8px 20px;font-size:14px;font-weight:500}.homepage-tabs .ant-tabs-tab-active{color:#6366f1;font-weight:600}.homepage-tabs .ant-tabs-ink-bar{background:linear-gradient(135deg,#6366f1,#8b5cf6)}.media-download-btn{z-index:10;opacity:0;pointer-events:none;transition:opacity .2s;position:absolute;top:8px;right:8px}.media-card:hover .media-download-btn{opacity:1;pointer-events:auto}.media-preview-tip{opacity:0;transition:opacity .2s}.media-card:hover .media-preview-tip{opacity:1}.desktop-sidebar{display:flex}.desktop-content{display:block}.mobile-header,.mobile-content,.mobile-menu-drawer{display:none}.mobile-menu-item{cursor:pointer;border-radius:10px;align-items:center;gap:12px;min-height:48px;margin:2px 8px;padding:12px 16px;transition:all .2s;display:flex}.mobile-menu-item:hover{background:#6366f10d}.mobile-menu-item-active{background:linear-gradient(135deg,#6366f11a 0%,#8b5cf614 100%)!important}.mobile-menu-group{cursor:default}.mobile-menu-group:hover{background:0 0}.mobile-menu-icon{flex-shrink:0;justify-content:center;align-items:center;width:24px;font-size:18px;display:flex}.mobile-menu-label{flex:1;font-size:15px}.mobile-submenu{background:#f8fafc80;border-radius:8px;margin:0 8px;padding-left:12px}.mobile-submenu-item{min-height:44px;margin:1px 0;padding:10px 16px 10px 20px}.mobile-recharge-item{box-shadow:0 4px 16px #6366f166;background:linear-gradient(135deg,#6366f1 0%,#8b5cf6 100%)!important}.mobile-recharge-item:hover{background:linear-gradient(135deg,#4f46e5 0%,#7c3aed 100%)!important}.contact-button-wrapper{z-index:1000;cursor:move;position:fixed;bottom:25%;right:24px}.contact-tooltip{color:#fff;white-space:nowrap;pointer-events:none;background:#1e293be6;border-radius:8px;padding:8px 16px;font-size:13px;transition:opacity .2s;position:absolute;bottom:8px;right:64px}.contact-button{color:#fff;cursor:pointer;background:linear-gradient(135deg,#6366f1cc 0%,#8b5cf6cc 100%);border:none;border-radius:50%;justify-content:center;align-items:center;width:40px;height:40px;transition:all .3s;display:flex;box-shadow:0 4px 20px #6366f14d}.contact-button:hover{background:linear-gradient(135deg,#6366f1f2 0%,#8b5cf6f2 100%);transform:scale(1.05);box-shadow:0 6px 24px #6366f166}.contact-button.dragging{cursor:grabbing;transform:scale(1.1);box-shadow:0 8px 30px #6366f180}@media (width<=767px){.desktop-sidebar,.desktop-content{display:none!important}.mobile-header{z-index:100;background:linear-gradient(135deg,#fff 0%,#f8fafc 100%);border-bottom:1px solid #0000000f;display:block;position:fixed;top:0;left:0;right:0;box-shadow:0 2px 12px #0000000f}.mobile-header-content{justify-content:space-between;align-items:center;height:56px;padding:0 16px;display:flex}.mobile-menu-btn{cursor:pointer;color:#475569;border-radius:10px;justify-content:center;align-items:center;width:40px;height:40px;transition:all .2s;display:flex}.mobile-menu-btn:hover{color:#6366f1;background:#6366f114}.mobile-header-title{color:#1e293b;background:linear-gradient(135deg,#6366f1,#8b5cf6);-webkit-text-fill-color:transparent;-webkit-background-clip:text;background-clip:text;font-size:18px;font-weight:700}.mobile-header-right{align-items:center;gap:12px;display:flex}.mobile-credits-badge{color:#6366f1;cursor:pointer;background:#6366f114;border-radius:20px;align-items:center;gap:6px;padding:6px 12px;font-size:13px;font-weight:600;transition:all .2s;display:flex}.mobile-credits-badge:hover{background:#6366f126}.mobile-content{background:#f8fafc;min-height:100vh;padding-top:56px;padding-bottom:24px;display:block}.mobile-content>div{background:#fff;border:1px solid #0000000a;border-radius:16px;min-height:calc(100vh - 104px);margin:12px;padding:16px;box-shadow:0 2px 12px #0000000a}.contact-button-wrapper{bottom:16px;right:16px}.contact-tooltip{display:none}.contact-button{width:44px;height:44px}.recharge-modal .ant-modal,.contact-modal .ant-modal{max-width:calc(100vw - 32px)!important;margin:16px!important}}.login-page{background:#1a1a2e;flex-direction:column;height:100vh;max-height:100vh;display:flex;position:relative;overflow:hidden}.login-bg-video{object-fit:cover;z-index:0;pointer-events:none;width:100%;height:100%;transition:opacity .6s;position:absolute;inset:0}.login-bg-placeholder{background:#1a1a2e}.login-bg-overlay{z-index:0;background:linear-gradient(135deg,#0f0f1ebf 0%,#141432a6 100%);position:absolute;inset:0}.login-slogan{z-index:2;position:absolute;top:40px;left:48px}.login-slogan-text{letter-spacing:1px;background:linear-gradient(90deg,#fff 0%,#c7d2fe 25%,#fff 50%,#c7d2fe 75%,#fff 100%) 0 0/200%;-webkit-text-fill-color:transparent;text-shadow:none;-webkit-background-clip:text;background-clip:text;font-size:24px;font-weight:800;animation:3s linear infinite shinySlide}@keyframes shinySlide{0%{background-position:0%}to{background-position:200%}}.login-center{z-index:1;flex:1;justify-content:flex-end;align-items:center;padding:24px 60px 24px 24px;display:flex}.login-card{-webkit-backdrop-filter:blur(24px);width:100%;max-width:400px;background:#fffffff2!important;border:1px solid #ffffff26!important;border-radius:20px!important;box-shadow:0 24px 80px #00000040,0 8px 32px #6366f11a!important}.login-card-header{text-align:center;margin-bottom:24px}.login-logo-row{justify-content:center;align-items:center;gap:12px;display:flex}.login-logo-img{object-fit:contain;border-radius:12px;width:40px;height:40px}.login-logo-placeholder{background:linear-gradient(135deg,#6366f1,#8b5cf6);border-radius:12px;justify-content:center;align-items:center;width:40px;height:40px;display:flex;box-shadow:0 6px 20px #6366f14d}.login-site-name{color:#1e293b;letter-spacing:-.3px;font-size:22px;font-weight:800}.login-card-subtitle{text-align:center;color:#94a3b8;margin-bottom:24px;font-size:13px;display:block}.login-tabs{background:#f1f5f9;border:1px solid #e2e8f0;border-radius:10px;gap:0;margin-bottom:20px;padding:4px;display:flex}.login-tab{text-align:center;cursor:pointer;color:#64748b;background:0 0;border:1px solid #0000;border-radius:8px;flex:1;padding:9px 0;font-size:13px;font-weight:400;transition:all .3s}.login-tab-active{color:#6366f1!important;background:#fff!important;border:1px solid #6366f133!important;font-weight:600!important;box-shadow:0 2px 8px #6366f11a!important}.login-submit-btn{background:linear-gradient(135deg,#6366f1 0%,#8b5cf6 100%)!important;border:none!important;border-radius:10px!important;height:46px!important;font-size:15px!important;font-weight:600!important;box-shadow:0 8px 24px #6366f140!important}.login-code-btn{border:1.5px solid #e2e8f0!important;border-radius:10px!important;min-width:100px!important;height:46px!important;font-weight:600!important}.login-agreement{margin-bottom:14px}.login-agreement-text{color:#64748b;font-size:12px}.login-link{color:#6366f1;cursor:pointer}.login-footer{justify-content:center;display:flex}.login-switch-btn{cursor:pointer;color:#6366f1!important;font-size:13px!important}.login-copyright-wrapper{text-align:center;z-index:2;pointer-events:none;position:absolute;bottom:20px;left:0;right:0}.login-copyright{color:#ffffff80;text-shadow:0 1px 3px #0000004d;font-size:12px}.login-page .ant-input-affix-wrapper{height:46px!important;padding:0 11px!important}.login-page .ant-input-affix-wrapper .ant-input-prefix{margin-left:0!important;margin-right:10px!important}.login-page .ant-input{height:46px!important;padding-left:11px!important}@media (width<=899px){.login-slogan{top:24px;left:24px}.login-slogan-text{font-size:18px}.login-center{justify-content:center;padding:80px 20px 24px}}@media (width<=480px){.login-slogan{top:20px;left:20px}.login-slogan-text{font-size:15px}.login-card .ant-card-body{padding:24px 20px!important}.login-card{border-radius:16px!important}.login-page .ant-input,.login-page .ant-input-affix-wrapper{height:44px!important}.login-code-btn{min-width:90px!important;height:44px!important}.login-submit-btn{height:44px!important}}@keyframes sliderShake{0%,to{transform:translate(0)}10%{transform:translate(-8px)}20%{transform:translate(8px)}30%{transform:translate(-6px)}40%{transform:translate(6px)}50%{transform:translate(-4px)}60%{transform:translate(4px)}70%{transform:translate(-2px)}80%{transform:translate(2px)}90%{transform:translate(-1px)}}*{box-sizing:border-box}.material_box{padding:24px}.material_box>div{margin:0 0 20px}.medio_box{width:280px;height:150px;margin-top:6px}.medio_box img,.medio_box video{width:100%;height:100%}.ant-collapse-ghost>.ant-collapse-item{border-bottom:1px solid #6366f10f;transition:all .3s cubic-bezier(.4,0,.2,1)}.ant-collapse-ghost>.ant-collapse-item:hover{background:#6366f105}.ant-collapse-ghost>.ant-collapse-item>.ant-collapse-header{transition:all .3s cubic-bezier(.4,0,.2,1);padding:14px 16px!important}.replication-form-content::-webkit-scrollbar{width:6px}.replication-preview::-webkit-scrollbar{width:6px}.replication-form-content::-webkit-scrollbar-thumb{background:#6366f133;border-radius:3px}.replication-preview::-webkit-scrollbar-thumb{background:#6366f133;border-radius:3px}.replication-form-content::-webkit-scrollbar-thumb:hover{background:#6366f166}.replication-preview::-webkit-scrollbar-thumb:hover{background:#6366f166}.replication-form-content::-webkit-scrollbar-track{background:0 0}.replication-preview::-webkit-scrollbar-track{background:0 0}input[type=range]{appearance:none;background:0 0}input[type=range]::-webkit-slider-thumb{appearance:none;cursor:pointer;background:#6366f1;border:2px solid #fff;border-radius:50%;width:16px;height:16px;transition:all .2s;box-shadow:0 2px 6px #6366f166}input[type=range]::-webkit-slider-thumb:hover{transform:scale(1.15);box-shadow:0 3px 10px #6366f199}input[type=range]::-moz-range-thumb{cursor:pointer;background:#6366f1;border:2px solid #fff;border-radius:50%;width:16px;height:16px;box-shadow:0 2px 6px #6366f166} diff --git a/video-gen-app/dist/assets/index-DYI2idb2.js b/video-gen-app/dist/assets/index-C9TClkR9.js similarity index 88% rename from video-gen-app/dist/assets/index-DYI2idb2.js rename to video-gen-app/dist/assets/index-C9TClkR9.js index f808f1eb..cf7ebc3d 100644 --- a/video-gen-app/dist/assets/index-DYI2idb2.js +++ b/video-gen-app/dist/assets/index-C9TClkR9.js @@ -454,8 +454,64 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho animation: none !important; filter: drop-shadow(0 0 15px rgba(139, 92, 246, 0.8)) !important; } - `})]})})})]}),(0,$.jsx)(`div`,{className:`desktop-content`,style:{marginLeft:Se+28,marginRight:12,marginTop:16,marginBottom:16,flex:1,minHeight:`calc(100vh - 32px)`,background:`transparent`,padding:0,transition:`margin-left 0.25s ease`},children:(0,$.jsx)(`div`,{style:{boxSizing:`border-box`,height:`100%`,background:`#ffffffff`,borderRadius:`20px`,boxShadow:`0 4px 32px rgba(0, 0, 0, 0.06), 0 1px 8px rgba(0, 0, 0, 0.04)`,minHeight:`100%`,padding:`24px 32px 32px`,border:`1px solid rgba(0, 0, 0, 0.06)`},children:!fe&&(0,$.jsx)(wt,{})})}),(0,$.jsx)(`div`,{className:`mobile-header`,children:(0,$.jsxs)(`div`,{className:`mobile-header-content`,children:[(0,$.jsx)(`div`,{className:`mobile-menu-btn`,onClick:()=>C(!0),children:(0,$.jsx)(d6,{style:{fontSize:20}})}),(0,$.jsx)(`div`,{className:`mobile-header-title`,children:L}),(0,$.jsx)(`div`,{className:`mobile-header-right`,children:(0,$.jsxs)(`div`,{className:`mobile-credits-badge`,onClick:()=>c(!0),children:[(0,$.jsx)(r5,{}),(0,$.jsx)(`span`,{children:n?.credits||0})]})})]})}),(0,$.jsx)(`div`,{className:`mobile-content`,children:fe&&(0,$.jsx)(wt,{})}),(0,$.jsxs)(QV,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:36,height:36,borderRadius:10,flexShrink:0,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.35)`},children:z?(0,$.jsx)(`img`,{src:z,alt:`logo`,style:{width:24,height:24,objectFit:`contain`}}):(0,$.jsx)(W8,{style:{fontSize:18,color:`#ffffff`}})}),(0,$.jsx)(`span`,{style:{fontWeight:700,fontSize:16,color:`#1e293b`},children:L})]}),placement:`left`,onClose:()=>C(!1),open:x,size:280,closable:!0,className:`mobile-menu-drawer`,styles:{header:{borderBottom:`1px solid #f1f5f9`,padding:`16px 20px`},body:{padding:`12px 8px`,display:`flex`,flexDirection:`column`}},children:[(0,$.jsxs)(`div`,{style:{flex:1,overflow:`auto`,paddingBottom:12},children:[(0,$.jsx)(`div`,{style:{padding:`12px 8px 16px`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,marginBottom:16},children:[(0,$.jsx)(Dw,{size:44,style:{background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,flexShrink:0},children:(0,$.jsx)($8,{})}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,$.jsx)(`div`,{style:{fontSize:15,fontWeight:600,color:`#1e293b`,marginBottom:2},children:n?.username||`用户`}),(0,$.jsxs)(`div`,{style:{fontSize:13,color:`#64748b`},children:[(0,$.jsx)(r5,{style:{color:`#f59e0b`,marginRight:4}}),`积分: `,(0,$.jsx)(`span`,{style:{color:`#f59e0b`,fontWeight:600},children:n?.credits??0})]})]})]})}),(0,$.jsx)(y7,{data:ue}),we.map(e=>{let t=e.menu_type??e.menuType,n=Ce[e.id]&&Ce[e.id].length>0,r=e.path===xe,i=F[e.id],a=b7[e.icon]||(0,$.jsx)(k3,{});return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{className:`mobile-menu-item ${r&&!n?`mobile-menu-item-active`:``} ${t===`group`?`mobile-menu-group`:``}`,onClick:()=>Te(e),children:[t!==`group`&&(0,$.jsx)(`span`,{className:`mobile-menu-icon`,style:{color:r?`#6366f1`:`#64748b`},children:a}),(0,$.jsx)(`span`,{className:`mobile-menu-label`,style:{paddingLeft:0,color:t===`group`?`#94a3b8`:r?`#4f46e5`:`#475569`,fontWeight:t===`group`||r?600:400,fontSize:t===`group`?12:15,textTransform:t===`group`?`uppercase`:`none`,letterSpacing:t===`group`?.5:0},children:e.label}),(t===`group`||n)&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#cbd5e1`,transition:`transform 0.2s ease`,transform:i?`rotate(90deg)`:`rotate(0deg)`},children:(0,$.jsx)(Bg,{})})]}),(t===`group`||n)&&i&&(0,$.jsx)(`div`,{className:`mobile-submenu`,children:(Ce[e.id]||[]).map(e=>{let t=e.path===xe,n=b7[e.icon]||(0,$.jsx)(k3,{});return(0,$.jsxs)(`div`,{className:`mobile-menu-item mobile-submenu-item ${t?`mobile-menu-item-active`:``}`,onClick:()=>Te(e),children:[(0,$.jsx)(`span`,{className:`mobile-menu-icon`,style:{color:t?`#6366f1`:`#94a3b8`},children:n}),(0,$.jsx)(`span`,{className:`mobile-menu-label`,style:{color:t?`#4f46e5`:`#64748b`,fontWeight:t?600:400,fontSize:14},children:e.label})]},e.id)})})]},e.id)})]}),(0,$.jsxs)(`div`,{style:{padding:`8px 0`,borderTop:`1px solid #f1f5f9`},children:[(0,$.jsxs)(`div`,{className:`mobile-menu-item`,onClick:()=>{e(`/user-center?tab=credits`),C(!1)},children:[(0,$.jsx)(`span`,{className:`mobile-menu-icon`,style:{color:`#f59e0b`},children:(0,$.jsx)(r5,{})}),(0,$.jsx)(`span`,{className:`mobile-menu-label`,style:{color:`#475569`},children:`积分明细`})]}),(0,$.jsxs)(`div`,{className:`mobile-menu-item`,onClick:()=>{e(`/user-center?tab=orders`),C(!1)},children:[(0,$.jsx)(`span`,{className:`mobile-menu-icon`,style:{color:`#6366f1`},children:(0,$.jsx)(fH,{})}),(0,$.jsx)(`span`,{className:`mobile-menu-label`,style:{color:`#475569`},children:`订单记录`})]}),(0,$.jsxs)(`div`,{className:`mobile-menu-item`,onClick:()=>{e(`/messages`),C(!1)},children:[(0,$.jsx)(`span`,{className:`mobile-menu-icon`,style:{color:`#8b5cf6`},children:(0,$.jsx)(V2,{})}),(0,$.jsxs)(`span`,{className:`mobile-menu-label`,style:{color:`#475569`},children:[`消息中心`,y>0&&(0,$.jsx)(XQ,{color:`red`,style:{marginLeft:8,fontSize:11},children:y})]})]}),(0,$.jsxs)(`div`,{className:`mobile-menu-item`,onClick:()=>{o(!0),C(!1)},children:[(0,$.jsx)(`span`,{className:`mobile-menu-icon`,style:{color:`#0ea5e9`},children:(0,$.jsx)(X3,{})}),(0,$.jsx)(`span`,{className:`mobile-menu-label`,style:{color:`#475569`},children:`个人信息`})]}),(0,$.jsx)(`div`,{style:{height:8}}),(0,$.jsxs)(`div`,{className:`mobile-menu-item mobile-recharge-item`,onClick:()=>{c(!0),C(!1)},children:[(0,$.jsx)(`span`,{className:`mobile-menu-icon`,style:{color:`#fff`},children:(0,$.jsx)(rL,{})}),(0,$.jsx)(`span`,{className:`mobile-menu-label`,style:{color:`#fff`,fontWeight:600},children:`充值积分`})]}),(0,$.jsxs)(`div`,{className:`mobile-menu-item`,onClick:()=>{Ae(),C(!1)},children:[(0,$.jsx)(`span`,{className:`mobile-menu-icon`,style:{color:`#ef4444`},children:(0,$.jsx)(n6,{})}),(0,$.jsx)(`span`,{className:`mobile-menu-label`,style:{color:`#ef4444`},children:`退出登录`})]})]})]}),(0,$.jsx)(mK,{title:(0,$.jsxs)(sH,{children:[(0,$.jsx)(C8,{}),`账号设置`]}),open:a,onCancel:()=>{o(!1),d.resetFields(),f.resetFields()},width:440,footer:null,children:(0,$.jsxs)(TL,{defaultActiveKey:`profile`,children:[(0,$.jsx)(TL.TabPane,{tab:`个人信息`,children:(0,$.jsxs)(tU,{form:f,layout:`vertical`,style:{marginTop:20},onValuesChange:()=>{},children:[(0,$.jsx)(tU.Item,{name:`username`,label:`用户名`,rules:[{required:!0,message:`请输入用户名`},{min:3,message:`用户名至少3位`}],children:(0,$.jsx)(IW,{placeholder:`请输入用户名`,size:`large`,prefix:(0,$.jsx)($8,{style:{color:`#94a3b8`,marginRight:8}})})}),(0,$.jsx)(tU.Item,{children:(0,$.jsx)(X,{type:`primary`,size:`large`,onClick:ke,style:{width:`100%`},children:`确认修改`})})]})},`profile`),(0,$.jsx)(TL.TabPane,{tab:`修改密码`,children:(0,$.jsxs)(tU,{form:d,layout:`vertical`,style:{marginTop:20},onValuesChange:()=>{},children:[(0,$.jsx)(tU.Item,{name:`oldPwd`,label:`原密码`,rules:[{required:!0,message:`请输入原密码`}],children:(0,$.jsx)(IW.Password,{placeholder:`请输入原密码`,size:`large`,prefix:(0,$.jsx)(X3,{style:{color:`#94a3b8`,marginRight:8}})})}),(0,$.jsx)(tU.Item,{name:`newPwd`,label:`新密码`,rules:[{required:!0,message:`请输入新密码`},{min:6,message:`密码至少6位`}],children:(0,$.jsx)(IW.Password,{placeholder:`请输入新密码(至少6位)`,size:`large`,prefix:(0,$.jsx)(X3,{style:{color:`#94a3b8`,marginRight:8}})})}),(0,$.jsx)(tU.Item,{name:`confirmPwd`,label:`确认新密码`,rules:[{required:!0,message:`请再次输入新密码`},({getFieldValue:e})=>({validator(t,n){return!n||e(`newPwd`)===n?Promise.resolve():Promise.reject(Error(`两次密码不一致`))}})],children:(0,$.jsx)(IW.Password,{placeholder:`请再次输入新密码`,size:`large`,prefix:(0,$.jsx)(X3,{style:{color:`#94a3b8`,marginRight:8}})})}),(0,$.jsx)(tU.Item,{children:(0,$.jsx)(X,{type:`primary`,size:`large`,onClick:Oe,style:{width:`100%`},children:`确认修改`})})]})},`password`)]})}),(0,$.jsx)(mK,{title:(0,$.jsxs)(sH,{children:[(0,$.jsx)(m3,{}),`积分充值`]}),open:s,onCancel:()=>{c(!1),m(null)},width:680,className:`recharge-modal`,footer:(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,padding:`12px 0 0`,borderTop:`1px solid #f0f0f0`},children:[(0,$.jsx)(X,{size:`large`,onClick:()=>{c(!1),m(null)},style:{borderRadius:10,marginRight:12},children:`取消`}),(0,$.jsx)(X,{type:`primary`,size:`large`,disabled:!p||!ce.alipay&&!ce.wechat,loading:re,onClick:async()=>{let e=_.find(e=>e.id===p);if(!e)return;let t=(e.credits||0)+(e.bonus_credits||e.bonusCredits||0);try{ie(!0);let n=await zie(e.id,G),r=n.qrUrl||n.codeUrl||n.qr_code||n.code_url;(n.paymentMethod===`alipay`||n.paymentMethod===`wechat`)&&r?(te({price:e.price,credits:t,qrCode:r,method:n.paymentMethod}),c(!1),W(!0),se.current=n.orderNo,localStorage.setItem(ge,JSON.stringify({orderNo:n.orderNo,price:e.price,credits:t,qrCode:r,method:n.paymentMethod,createdAt:n.createdAt||new Date().toISOString(),timeoutSeconds:180})),Ne(n.orderNo)):(Z.success(`充值成功!积分已到账`),_7.getState().refreshUser(),c(!1),m(null))}catch(e){Z.error(e?.message||`创建订单失败,请重试`)}finally{ie(!1)}},style:{borderRadius:10,fontWeight:600,background:p?`linear-gradient(135deg, #6366f1, #8b5cf6)`:`#d1d5db`,border:`none`,boxShadow:p?`0 8px 24px rgba(99,102,241,0.3)`:`none`},children:`确认充值`})]}),children:(0,$.jsxs)(`div`,{style:{marginTop:16},children:[(0,$.jsxs)(sH,{style:{marginBottom:16},children:[(0,$.jsx)(r5,{style:{color:`#6366f1`}}),(0,$.jsx)(Q.Text,{style:{color:`#64748b`,letterSpacing:0},children:`当前积分余额`}),(0,$.jsx)(Q.Text,{strong:!0,style:{color:`#6366f1`,fontSize:20,fontWeight:600},children:n?.credits??0})]}),!ce.alipay&&!ce.wechat?(0,$.jsx)(`div`,{style:{marginBottom:16,padding:16,background:`#fef2f2`,borderRadius:12,border:`1px solid #fecaca`},children:(0,$.jsx)(Q.Text,{style:{color:`#dc2626`,fontSize:13},children:`⚠️ 暂无可用的支付方式,请联系管理员开启支付功能`})}):(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(Q.Text,{style:{color:`#64748b`,fontSize:13,marginBottom:8,display:`block`},children:`选择支付方式`}),(0,$.jsxs)(jI.Group,{value:G,onChange:e=>ne(e.target.value),style:{display:`flex`,gap:12},children:[ce.alipay&&(0,$.jsxs)(jI.Button,{value:`alipay`,style:{flex:1,textAlign:`center`,borderRadius:10,height:44,lineHeight:`42px`,borderColor:G===`alipay`?`#1677ff`:void 0,color:G===`alipay`?`#1677ff`:void 0},children:[(0,$.jsx)(c2,{style:{fontSize:16,marginRight:6}}),`支付宝`]}),ce.wechat&&(0,$.jsxs)(jI.Button,{value:`wechat`,style:{flex:1,textAlign:`center`,borderRadius:10,height:44,lineHeight:`42px`,borderColor:G===`wechat`?`#07c160`:void 0,color:G===`wechat`?`#07c160`:void 0},children:[(0,$.jsx)(o5,{style:{fontSize:16,marginRight:6}}),`微信支付`]})]})]}),(0,$.jsxs)(`div`,{style:{padding:`12px 16px`,background:`rgba(99, 102, 241, 0.06)`,borderRadius:10,marginBottom:16,display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(F3,{style:{color:`#6366f1`,fontSize:14}}),(0,$.jsxs)(Q.Text,{style:{color:`#64748b`,fontSize:13},children:[`当前平台仅支持支付宝/微信扫码充值,如需转账支付请`,(0,$.jsx)(Q.Text,{style:{color:`#ff0000ff`,cursor:`pointer`,textDecoration:`underline`},onClick:()=>{c(!1),u(!0)},children:`联系我们`})]})]}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:12,flexWrap:`wrap`},children:_.map((e,t)=>{let n=x7[t%x7.length],r=(e.credits||0)+(e.bonus_credits||e.bonusCredits||0);return(0,$.jsxs)(`div`,{onClick:()=>m(e.id),style:{flex:`1 1 45%`,minWidth:200,borderRadius:16,padding:`20px 16px`,background:p===e.id?`rgba(99,102,241,0.04)`:`#fafbff`,border:p===e.id?`2px solid #6366f1`:`1px solid #f0f0f5`,cursor:`pointer`,position:`relative`,transition:`all 0.2s`},children:[e.description&&(0,$.jsx)(XQ,{color:`purple`,style:{position:`absolute`,top:-10,left:`50%`,transform:`translateX(-50%)`,borderRadius:8,fontSize:11},children:e.description}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:44,height:44,borderRadius:12,flexShrink:0,background:n.gradient,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:18,color:`#fff`,boxShadow:`0 6px 16px ${n.shadow}`},children:n.icon}),(0,$.jsxs)(`div`,{style:{flex:1},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`baseline`,gap:6},children:[(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:15},children:e.name}),(0,$.jsxs)(Q.Text,{style:{fontSize:14,fontWeight:600,color:`#6366f1`},children:[r.toLocaleString(),` 积分`]})]}),(0,$.jsxs)(`div`,{style:{fontSize:22,fontWeight:800,marginTop:4,background:n.gradient,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`},children:[`¥`,e.price]})]})]})]},e.id)})})]})}),(0,$.jsx)(mK,{open:U,onCancel:async()=>{if(Me(),se.current){try{await R5(se.current)}catch{}se.current=null}localStorage.removeItem(ge),W(!1),te(null)},footer:null,width:400,closable:!1,styles:{body:{padding:0,borderRadius:16,overflow:`hidden`}},children:(0,$.jsxs)(`div`,{style:{padding:`24px`},children:[(0,$.jsxs)(`div`,{style:{textAlign:`center`,marginBottom:24},children:[(0,$.jsx)(`div`,{style:{width:48,height:48,background:ee?.method===`alipay`?`linear-gradient(135deg, #1677ff, #0958d9)`:`linear-gradient(135deg, #07c160, #06ae56)`,borderRadius:16,display:`flex`,alignItems:`center`,justifyContent:`center`,margin:`0 auto 12px`},children:ee?.method===`alipay`?(0,$.jsx)(c2,{style:{fontSize:24,color:`#fff`}}):(0,$.jsx)(o5,{style:{fontSize:24,color:`#fff`}})}),(0,$.jsx)(Q.Title,{level:4,style:{margin:0},children:ee?.method===`alipay`?`支付宝支付`:`微信支付`}),(0,$.jsx)(Q.Text,{style:{color:`#94a3b8`,fontSize:13},children:ee?.method===`alipay`?`请使用支付宝扫描二维码完成支付`:`请使用微信扫描二维码完成支付`})]}),(0,$.jsxs)(`div`,{style:{background:`#fff`,borderRadius:16,padding:20,display:`flex`,flexDirection:`column`,alignItems:`center`,boxShadow:`0 4px 20px rgba(0,0,0,0.08)`},children:[(0,$.jsx)(`div`,{style:{width:180,height:180,borderRadius:12,overflow:`hidden`,background:`#fff`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:ee&&(0,$.jsx)(a2,{value:ee.qrCode,size:160,level:`M`,includeMargin:!1})}),(0,$.jsxs)(`div`,{style:{marginTop:16,textAlign:`center`},children:[(0,$.jsxs)(`div`,{style:{fontSize:28,fontWeight:700,color:`#1a1a2e`},children:[`¥`,ee?.price||0]}),(0,$.jsxs)(`div`,{style:{fontSize:13,color:`#64748b`,marginTop:4},children:[`购买 `,ee?.credits||0,` 积分`]}),(0,$.jsx)(`div`,{style:{marginTop:12,padding:`8px 16px`,background:ae<=30?`#fef2f2`:`#f0f9ff`,borderRadius:8,border:ae<=30?`1px solid #fecaca`:`1px solid #bae6fd`,display:`inline-block`},children:(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:ae<=30?`#dc2626`:`#0284c7`},children:[`订单将在 `,(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:800},children:ae}),` 秒后关闭`]})})]})]}),(0,$.jsx)(`div`,{style:{marginTop:20,padding:16,background:`#fef3c7`,borderRadius:12},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:8},children:[(0,$.jsx)(`div`,{style:{fontSize:16,marginTop:-2},children:`💡`}),(0,$.jsxs)(`div`,{style:{fontSize:13,color:`#92400e`},children:[(0,$.jsx)(`div`,{style:{fontWeight:500,marginBottom:4},children:`支付提示`}),(0,$.jsxs)(`ul`,{style:{margin:0,paddingLeft:16},children:[(0,$.jsx)(`li`,{style:{marginBottom:2},children:`请在支付后等待页面自动跳转`}),(0,$.jsx)(`li`,{children:`如支付成功但未到账,请联系客服`})]})]})]})}),(0,$.jsx)(`div`,{style:{marginTop:20},children:(0,$.jsx)(X,{size:`large`,block:!0,onClick:async()=>{if(Me(),se.current){try{await R5(se.current)}catch{}se.current=null}localStorage.removeItem(ge),W(!1),te(null),m(null)},style:{borderRadius:10},children:`取消支付`})})]})}),(0,$.jsx)($ae,{}),(0,$.jsx)(`div`,{className:`contact-button-wrapper`,style:{right:`${k.x}px`,bottom:`${window.innerHeight-k.y}px`},children:(0,$.jsxs)(`div`,{style:{position:`relative`},children:[(0,$.jsx)(`div`,{className:`contact-tooltip`,style:{opacity:+!!w},children:`联系我们`}),(0,$.jsx)(`button`,{className:`contact-button ${j?`dragging`:``}`,onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),onMouseDown:_e,onMouseUp:ye,children:(0,$.jsx)(m6,{style:{fontSize:20}})})]})}),(0,$.jsx)(mK,{title:(0,$.jsxs)(sH,{children:[(0,$.jsx)(m6,{}),`联系我们`]}),open:l,onCancel:()=>{u(!1),E.resetFields()},footer:null,width:480,className:`contact-modal`,children:(0,$.jsxs)(`div`,{style:{marginTop:8},children:[(0,$.jsxs)(tU,{form:E,layout:`vertical`,children:[(0,$.jsx)(tU.Item,{name:`name`,label:`姓名`,rules:[{required:!0,message:`请输入姓名`}],children:(0,$.jsx)(IW,{placeholder:`请输入您的姓名`,size:`large`})}),(0,$.jsx)(tU.Item,{name:`phone`,label:`手机号`,rules:[{required:!0,message:`请输入手机号`},{pattern:/^1[3-9]\d{9}$/,message:`请输入正确的手机号`}],children:(0,$.jsx)(IW,{placeholder:`请输入您的手机号`,size:`large`})}),(0,$.jsx)(tU.Item,{name:`companyName`,label:`公司名称`,rules:[{required:!0,message:`请输入公司名称`}],children:(0,$.jsx)(IW,{placeholder:`请输入公司名称`,size:`large`})}),(0,$.jsx)(tU.Item,{name:`industry`,label:`您的行业`,rules:[{required:!0,message:`请输入您的行业`}],children:(0,$.jsx)(IW,{placeholder:`请输入您的行业`,size:`large`})}),(0,$.jsx)(tU.Item,{name:`message`,label:`留言(选填)`,children:(0,$.jsx)(IW.TextArea,{placeholder:`请输入您的需求或问题`,rows:3,style:{borderRadius:10}})})]}),(0,$.jsxs)(`div`,{style:{marginTop:16,display:`flex`,gap:12},children:[(0,$.jsx)(X,{size:`large`,onClick:()=>{u(!1),E.resetFields()},style:{borderRadius:10,flex:1},children:`取消`}),(0,$.jsx)(X,{type:`primary`,size:`large`,onClick:je,loading:D,style:{borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,flex:1},children:`提交`})]})]})})]})},noe=`http://localhost:8000/api`,roe=()=>{let{checkAuth:e}=_7(),[t,n]=(0,S.useState)(!1),[r,i]=(0,S.useState)(`password`),[a,o]=(0,S.useState)(`password`),[s]=On(),c=s.get(`redirect`),l=s.get(`tab`),[u,d]=(0,S.useState)(0),[f,p]=(0,S.useState)(0),[m,h]=(0,S.useState)(!1),[g,_]=(0,S.useState)(!1),[v,y]=(0,S.useState)(!1),[b,x]=(0,S.useState)(!1),[C,w]=(0,S.useState)(0),[T,E]=(0,S.useState)(!1),[D,O]=(0,S.useState)(!1),[k,A]=(0,S.useState)(!1),j=(()=>{try{let e=localStorage.getItem(`siteInfo`);if(e){let t=JSON.parse(e);return{siteName:t.siteName||`VideoGen.AI`,siteLogo:t.siteLogo||``}}}catch{}return{siteName:`VideoGen.AI`,siteLogo:``}})(),[M,N]=(0,S.useState)(j.siteName),[P,F]=(0,S.useState)(j.siteLogo),[I,L]=(0,S.useState)(``),[R,z]=(0,S.useState)(``),[B,V]=(0,S.useState)(``),H=Ye(),{login:U}=_7(),[W]=tU.useForm(),[ee]=tU.useForm(),[te]=tU.useForm();(0,S.useEffect)(()=>{j5().then(e=>{N(e.siteName),F(e.siteLogo),L(e.loginBgVideo||``),z(e.userAgreementPrivacyUrl),V(e.siteCopyright)}).catch(()=>{})},[]),(0,S.useEffect)(()=>{l===`register`&&i(`register`)},[l]);let G=()=>{if(c)try{H(decodeURIComponent(c));return}catch{}H(`/home`)},ne=()=>m?!0:(Z.warning(`请先阅读并同意用户协议及隐私政策`),!1),re=async()=>{if(ne())try{let t=await W.validateFields();await U(t.phone,t.password,void 0,t.rememberMe),Z.success(`登录成功,欢迎回来`),await e(),G()}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`登录失败`;Z.error(t)}},ie=async()=>{if(ne())try{let t=ee.getFieldsValue();if(!t.phone||!t.code){Z.error(`请填写手机号和验证码`);return}n(!0),await gie(t.phone,t.code),Z.success(`登录成功,欢迎回来`),await e(),G()}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`登录失败`;Z.error(t)}finally{n(!1)}},ae=async()=>{if(ne())try{let t=await te.validateFields();n(!0),await _ie(t.phone,t.regCode,t.password),Z.success(`注册成功`),await e(),G()}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`注册失败`;Z.error(t)}finally{n(!1)}},oe=(e,t)=>{e(60);let n=setInterval(()=>{e(e=>e<=1?(clearInterval(n),_(!1),t?O(!0):A(!0),0):e-1)},1e3)};(0,S.useEffect)(()=>{u===0&&r===`phone`&&x(!1)},[u,r]);let K=async(e,t)=>{try{if(!e||!/^1\d{10}$/.test(e)){Z.error(`请输入正确的手机号`);return}if(t){_(!0),y(!1);return}if(!b){_(!0),x(!1);return}let n=``;n=r===`register`?`register`:`login`,await M5(e,n),oe(t?p:d),Z.success(`验证码已发送`)}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`登录失败`;Z.error(t),r===`register`?(y(!1),p(0)):(x(!1),d(0)),w(e=>e+1)}},q=async(e=!1)=>{let t=r===`register`?te.getFieldValue(`phone`):ee.getFieldValue(`phone`);try{let e=``;e=r===`register`?`register`:`login`,await M5(t,e),r===`register`?(y(!0),oe(p,!0)):(x(!0),oe(d,!1)),Z.success(`验证码已发送`)}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`登录失败`;Z.error(t),r===`register`?(y(!1),p(0),O(!0)):(x(!1),d(0),A(!0)),w(e=>e+1)}},se=e=>{o(e),i(e),d(0),p(0),x(!1),y(!1),_(!1),O(!1),A(!1),w(e=>e+1),e===`password`?W.resetFields():ee.resetFields()},ce={background:`#fff`,border:`1.5px solid #e2e8f0`,color:`#1e293b`,borderRadius:10,fontSize:14},le=e=>{if(!e){Z.warning(`暂未上传协议文件`);return}e.startsWith(`http://`)||e.startsWith(`https://`)?window.open(e,`_blank`):window.open(`${noe.replace(/\/api$/,``)}${e}`,`_blank`)};return(0,$.jsxs)(`div`,{className:`login-page`,children:[I&&(I.toLowerCase().endsWith(`.gif`)||I.toLowerCase().endsWith(`.webp`))?(0,$.jsx)(`img`,{className:`login-bg-video`,src:I,alt:``}):I?(0,$.jsx)(`video`,{className:`login-bg-video`,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,preload:`auto`,children:(0,$.jsx)(`source`,{src:I,type:I.endsWith(`.webm`)?`video/webm`:I.endsWith(`.mov`)?`video/quicktime`:`video/mp4`})}):null,(0,$.jsx)(`div`,{className:`login-bg-overlay`}),(0,$.jsx)(`div`,{className:`login-slogan`,children:(0,$.jsx)(`span`,{className:`login-slogan-text`,children:`AI赋能创意,素材触手可及`})}),(0,$.jsx)(`div`,{className:`login-center`,children:(0,$.jsxs)(DL,{className:`login-card`,styles:{body:{padding:`32px 32px`}},children:[(0,$.jsx)(`div`,{className:`login-card-header`,children:(0,$.jsxs)(`div`,{className:`login-logo-row`,children:[P?(0,$.jsx)(`img`,{src:P,alt:`logo`,className:`login-logo-img`}):(0,$.jsx)(`div`,{className:`login-logo-placeholder`,children:(0,$.jsx)(W8,{style:{fontSize:20,color:`#fff`}})}),(0,$.jsx)(`span`,{className:`login-site-name`,children:M})]})}),(0,$.jsx)(Q.Text,{className:`login-card-subtitle`,children:r===`register`?`注册新账号,开始创作视频`:`登录您的账号,开始创作`}),r!==`register`&&(0,$.jsx)(`div`,{className:`login-tabs`,children:[`password`,`phone`].map(e=>(0,$.jsx)(`div`,{onClick:()=>se(e),className:`login-tab ${a===e?`login-tab-active`:``}`,children:e===`password`?`密码登录`:`验证码登录`},e))}),r===`password`&&(0,$.jsxs)(tU,{form:W,size:`large`,layout:`vertical`,onFinish:re,children:[(0,$.jsx)(tU.Item,{name:`phone`,rules:[{required:!0,message:`请输入手机号`},{pattern:/^1\d{10}$/,message:`请输入正确的手机号`}],children:(0,$.jsx)(IW,{prefix:(0,$.jsx)(_6,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入手机号`,style:ce})}),(0,$.jsx)(tU.Item,{name:`password`,rules:[{required:!0,message:`请输入密码`}],children:(0,$.jsx)(IW.Password,{prefix:(0,$.jsx)(X3,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入密码`,style:ce})}),(0,$.jsx)(tU.Item,{name:`rememberMe`,valuePropName:`checked`,style:{marginBottom:12},children:(0,$.jsx)(VR,{children:`记住我的登录状态`})}),(0,$.jsx)(tU.Item,{style:{marginBottom:12},children:(0,$.jsx)(X,{type:`primary`,htmlType:`submit`,loading:t,block:!0,className:`login-submit-btn`,children:`登 录`})})]}),r===`phone`&&(0,$.jsxs)(tU,{form:ee,size:`large`,layout:`vertical`,children:[(0,$.jsx)(tU.Item,{name:`phone`,rules:[{required:!0,message:`请输入手机号`},{pattern:/^1\d{10}$/,message:`请输入正确的手机号`}],children:(0,$.jsx)(IW,{prefix:(0,$.jsx)(_6,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入手机号`,maxLength:11,style:ce})}),(0,$.jsx)(tU.Item,{name:`code`,rules:[{required:!0,message:`请输入验证码`}],children:(0,$.jsxs)(sH.Compact,{style:{width:`100%`},children:[(0,$.jsx)(IW,{prefix:(0,$.jsx)(m8,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入验证码`,maxLength:6,disabled:!b,style:{...ce,borderRadius:`10px 0 0 10px`,flex:1}}),(0,$.jsx)(X,{disabled:u>0,onClick:()=>{k?(x(!1),_(!0),w(e=>e+1)):g&&!b?(E(!0),setTimeout(()=>E(!1),500)):K(ee.getFieldValue(`phone`))},className:`login-code-btn`,children:u>0?`${u}s`:k?`重新发送`:`获取验证码`})]})}),g&&(0,$.jsx)(tU.Item,{style:{marginBottom:12},children:(0,$.jsx)(S7,{onSuccess:q,isVerified:b,shake:T})},C),(0,$.jsx)(tU.Item,{style:{marginBottom:12},children:(0,$.jsx)(X,{type:`primary`,onClick:ie,loading:t,block:!0,className:`login-submit-btn`,children:`登 录`})})]}),r===`register`&&(0,$.jsxs)(tU,{form:te,size:`large`,layout:`vertical`,children:[(0,$.jsx)(tU.Item,{name:`phone`,rules:[{required:!0,message:`请输入手机号`},{pattern:/^1\d{10}$/,message:`请输入正确的手机号`}],children:(0,$.jsx)(IW,{prefix:(0,$.jsx)(_6,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入手机号`,maxLength:11,style:ce})}),(0,$.jsx)(tU.Item,{name:`regCode`,rules:[{required:!0,message:`请输入验证码`}],children:(0,$.jsxs)(sH.Compact,{style:{width:`100%`},children:[(0,$.jsx)(IW,{prefix:(0,$.jsx)(m8,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入验证码`,maxLength:6,disabled:!v,style:{...ce,borderRadius:`10px 0 0 10px`,flex:1}}),(0,$.jsx)(X,{disabled:f>0,onClick:()=>{D?(y(!1),_(!0),w(e=>e+1)):g&&!v?(E(!0),setTimeout(()=>E(!1),500)):K(te.getFieldValue(`phone`),!0)},className:`login-code-btn`,children:f>0?`${f}s`:D?`重新发送`:`获取验证码`})]})}),g&&(0,$.jsx)(tU.Item,{style:{marginBottom:12},children:(0,$.jsx)(S7,{onSuccess:q,isVerified:v,shake:T})},C),(0,$.jsx)(tU.Item,{name:`password`,rules:[{required:!0,message:`请设置密码`},{min:6,message:`密码至少6位`}],children:(0,$.jsx)(IW.Password,{prefix:(0,$.jsx)(X3,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请设置密码(至少6位)`,style:ce})}),(0,$.jsx)(tU.Item,{style:{marginBottom:12},children:(0,$.jsx)(X,{type:`primary`,onClick:ae,loading:t,block:!0,className:`login-submit-btn`,children:`注 册`})})]}),(0,$.jsx)(`div`,{className:`login-agreement`,children:(0,$.jsx)(VR,{checked:m,onChange:e=>h(e.target.checked),children:(0,$.jsxs)(`span`,{className:`login-agreement-text`,children:[`我已阅读并同意`,(0,$.jsx)(`span`,{onClick:e=>{e.stopPropagation(),le(R)},className:`login-link`,children:`《用户协议及隐私政策》`})]})})}),(0,$.jsx)(`div`,{className:`login-footer`,children:r===`register`?(0,$.jsx)(Q.Text,{className:`login-switch-btn`,onClick:()=>{i(`password`),o(`password`),O(!1),A(!1),y(!1),_(!1),w(e=>e+1),te.resetFields()},children:`已有账号?去登录`}):(0,$.jsx)(Q.Text,{className:`login-switch-btn`,onClick:()=>{i(`register`),O(!1),A(!1),y(!1),_(!1),w(e=>e+1)},children:`没有账号?立即注册`})})]})}),B&&(0,$.jsx)(`div`,{className:`login-copyright-wrapper`,children:(0,$.jsx)(`div`,{className:`login-copyright`,children:B})})]})},S7=({onSuccess:e,isVerified:t,shake:n})=>{let r=S.useRef(null),i=S.useRef(null),a=S.useRef(null),o=S.useRef(0),s=S.useRef(!1),[c,l]=S.useState(360),u=c-50;S.useEffect(()=>{let e=()=>{if(r.current){let e=r.current.offsetWidth;e>0&&l(e)}};e();let t=new ResizeObserver(e);return r.current&&t.observe(r.current),window.addEventListener(`resize`,e),()=>{t.disconnect(),window.removeEventListener(`resize`,e)}},[]);let d=n=>{if(s.current||t)return;let r=Math.max(0,Math.min(n,u));o.current=r,i.current&&(i.current.style.left=`${r}px`),a.current&&(a.current.style.width=`${r+50}px`),r>=u-5&&(s.current=!0,i.current&&(i.current.style.background=`#22c55e`,i.current.innerHTML=``),a.current&&(a.current.style.width=`${c}px`,a.current.style.background=`#dcfce7`),e())};return(0,$.jsxs)(`div`,{ref:r,onMouseDown:e=>{if(e.preventDefault(),s.current||t)return;let n=r.current;if(!n)return;let c=n.getBoundingClientRect(),l=e=>{d(e.clientX-c.left-50/2)},f=()=>{document.removeEventListener(`mousemove`,l),document.removeEventListener(`mouseup`,f),!s.current&&o.current{if(s.current||t)return;e.preventDefault();let n=r.current;if(!n)return;let c=n.getBoundingClientRect();d(e.touches[0].clientX-c.left-50/2);let l=e=>{d(e.touches[0].clientX-c.left-50/2)},f=()=>{document.removeEventListener(`touchmove`,l),document.removeEventListener(`touchend`,f),!s.current&&o.current({page:1,pageSize:10,total:0,items:[]}),C7=d5((e,t)=>({projects:[],records:ioe(),loading:!1,mediaType:`video`,countType:`请选择`,generationCount:1,selectedRatio:`1:1`,selectedResolution:`2K`,width:2048,height:2048,videoDuration:5,videoAspectRatio:`9:16`,videoResolution:`720p`,engineOptions:{ratios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:[`480p`,`720p`,`1080p`],durations:[5,8,10,12,15]},enginesele:[],inputValue:``,currentMedia:[],fetchProjects:async()=>{e({loading:!0});try{e({projects:await bie(),loading:!1})}catch{e({loading:!1})}},createProject:async(n,r)=>{let i=await xie(n,r);return e({projects:[i,...t().projects]}),i},deleteProject:async n=>{await Sie(n),e({projects:t().projects.filter(e=>e.id!==n)})},fetchRecords:async(t={})=>{e({loading:!0});try{e({records:await w5(t),loading:!1})}catch{e({loading:!1})}},optimizePrompt:async(n,r)=>{let i=await Cie(n,r);try{await _7.getState().checkAuth()}catch{}let a=t().records;return e({records:{...a,total:a.total+1,items:[i.record,...a.items]}}),i},generateVideo:async(n,r)=>{let i=await Nie(n,r);try{await _7.getState().checkAuth()}catch{}let a=t().records;return e({records:{...a,items:a.items.map(e=>e.id===n?i:e)}}),i},updateRecordReferences:(n,r)=>{let i=t().records;e({records:{...i,items:i.items.map(e=>e.id===n?{...e,references:r}:e)}})},setMediaType:t=>e({mediaType:t}),setCountType:t=>e({countType:t}),setGenerationCount:t=>e({generationCount:t}),setImageSettings:(t,n,r,i)=>e({selectedRatio:t,selectedResolution:n,width:r,height:i}),setVideoSettings:(t,n,r)=>e({videoDuration:t,videoAspectRatio:n,videoResolution:r}),setEngineOptions:t=>e({engineOptions:t}),setSelectedRatio:t=>e({selectedRatio:t}),setSelectedResolution:t=>e({selectedResolution:t}),setWidth:t=>e({width:t}),setHeight:t=>e({height:t}),setVideoDuration:t=>e({videoDuration:t}),setVideoAspectRatio:t=>e({videoAspectRatio:t}),setVideoResolution:t=>e({videoResolution:t}),setEnginesele:t=>e({enginesele:t}),setInputValue:t=>e({inputValue:t}),setCurrentMedia:t=>e({currentMedia:t}),resetGenerationConfig:()=>e({mediaType:`image`,countType:`请选择`,generationCount:1,selectedRatio:`1:1`,selectedResolution:`2K`,width:2048,height:2048,videoDuration:5,videoAspectRatio:`9:16`,videoResolution:`720p`,engineOptions:{ratios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:[`480p`,`720p`,`1080p`],durations:[5,8,10,12,15]},enginesele:[],inputValue:``,currentMedia:[]})})),w7=480;function T7(e){if(!e)return`-`;let t=e.trim();if(!t)return`-`;let n=t.match(/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(?:\.\d+)?(Z|[+-]\d{2}:?\d{2})?$/);if(!n)return t.slice(0,16).replace(`T`,` `);let[,r,i,a,o,s,c,l]=n,u=Date.UTC(+r,i-1,+a,+o,+s,+c);if(l&&l!==`Z`){let e=l[0]===`+`?1:-1,[t,n]=l.slice(1).split(`:`),r=u-e*(t*60+ +n)*6e4+w7*6e4,i=new Date(r);return`${i.getUTCFullYear()}-${E7(i.getUTCMonth()+1)}-${E7(i.getUTCDate())} ${E7(i.getUTCHours())}:${E7(i.getUTCMinutes())}`}let d=l===`Z`?u+w7*6e4:u,f=new Date(d);return`${f.getUTCFullYear()}-${E7(f.getUTCMonth()+1)}-${E7(f.getUTCDate())} ${E7(f.getUTCHours())}:${E7(f.getUTCMinutes())}`}function E7(e){return e<10?`0${e}`:String(e)}var D7=[`#f97316`,`#3b82f6`,`#8b5cf6`,`#10b981`,`#eab308`,`#6366f1`,`#ef4444`,`#06b6d4`,`#64748b`,`#78716c`],O7={ShoppingCartOutlined:(0,$.jsx)(E8,{}),BookOutlined:(0,$.jsx)(W2,{}),HomeOutlined:(0,$.jsx)(k3,{}),FireOutlined:(0,$.jsx)(c3,{}),RocketOutlined:(0,$.jsx)(d8,{}),SkinOutlined:(0,$.jsx)(Mre,{}),CompassOutlined:(0,$.jsx)(F4,{}),HeartOutlined:(0,$.jsx)(b3,{}),CarOutlined:(0,$.jsx)(a4,{}),CameraOutlined:(0,$.jsx)(n4,{}),CloudOutlined:(0,$.jsx)(_4,{}),StarOutlined:(0,$.jsx)(R8,{}),TrophyOutlined:(0,$.jsx)(q8,{}),ThunderboltOutlined:(0,$.jsx)(W8,{}),BulbOutlined:(0,$.jsx)(X2,{}),CoffeeOutlined:(0,$.jsx)(k4,{}),CrownOutlined:(0,$.jsx)(V4,{}),DashboardOutlined:(0,$.jsx)(W4,{}),FlagOutlined:(0,$.jsx)(d3,{}),GlobalOutlined:(0,$.jsx)(_3,{}),GiftOutlined:(0,$.jsx)(m3,{}),LaptopOutlined:(0,$.jsx)(R3,{}),MobileOutlined:(0,$.jsx)(_6,{}),MonitorOutlined:(0,$.jsx)(b6,{}),PayCircleOutlined:(0,$.jsx)(M6,{}),PictureOutlined:(0,$.jsx)(R6,{}),PlayCircleOutlined:(0,$.jsx)(q6,{}),SafetyOutlined:(0,$.jsx)(m8,{}),ShoppingOutlined:(0,$.jsx)(k8,{}),SmileOutlined:(0,$.jsx)(N8,{}),SoundOutlined:(0,$.jsx)(I8,{}),TagOutlined:(0,$.jsx)(Vre,{}),TeamOutlined:(0,$.jsx)(H8,{}),ToolOutlined:(0,$.jsx)(Gre,{}),TruckOutlined:(0,$.jsx)(Jre,{}),VideoCameraOutlined:(0,$.jsx)(t5,{}),WalletOutlined:(0,$.jsx)(r5,{}),BankOutlined:(0,$.jsx)(F2,{}),BuildOutlined:(0,$.jsx)(q2,{}),ExperimentOutlined:(0,$.jsx)($4,{}),HighlightOutlined:(0,$.jsx)(C3,{}),IdcardOutlined:(0,$.jsx)(M3,{}),MedicineBoxOutlined:(0,$.jsx)(c6,{}),ReadOutlined:(0,$.jsx)($6,{}),RestOutlined:(0,$.jsx)(n8,{}),SketchOutlined:(0,$.jsx)(Are,{}),SolutionOutlined:(0,$.jsx)(Fre,{})},aoe=()=>{let[e,t]=(0,S.useState)(!1),[n]=tU.useForm(),r=Ye(),{projects:i,fetchProjects:a,createProject:o,deleteProject:s}=C7(),[c,l]=(0,S.useState)([]);(0,S.useEffect)(()=>{a(),I5().then(l).catch(()=>{})},[]);let u=Object.fromEntries(c.map((e,t)=>[e.key,{label:e.label,color:D7[t%D7.length],icon:e.icon||`AppstoreOutlined`}]));return(0,$.jsxs)(`div`,{className:`content_box`,children:[(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:24,padding:`16px 24px`,borderRadius:16,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(139, 92, 246, 0.04) 100%)`,backdropFilter:`blur(10px)`,border:`1px solid rgba(99, 102, 241, 0.08)`,position:`relative`,overflow:`hidden`,flexWrap:`wrap`,gap:12},children:[(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16},children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{style:{margin:0,fontSize:18,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`行业制造`}),(0,$.jsxs)(`p`,{style:{fontSize:13,color:`#64748b`,margin:`4px 0 0 0`},children:[`共 `,i.length,` 个项目 · 按行业分类管理`]})]})}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:12},children:[(0,$.jsx)(X,{icon:(0,$.jsx)(fH,{}),onClick:()=>r(`/records`),size:`large`,style:{background:`rgba(99, 102, 241, 0.1)`,border:`1px solid rgba(99, 102, 241, 0.2)`,color:`#6366f1`,fontWeight:600,borderRadius:10,height:42},children:`项目记录`}),(0,$.jsx)(X,{icon:(0,$.jsx)(rL,{}),onClick:()=>t(!0),size:`large`,style:{background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,color:`#fff`,fontWeight:600,borderRadius:10,height:42,boxShadow:`0 4px 16px rgba(99, 102, 241, 0.35)`},children:`新建项目`})]})]}),i.length===0?(0,$.jsx)(XS,{image:XS.PRESENTED_IMAGE_SIMPLE,description:`还没有项目,创建您的第一个视频项目`,style:{padding:`60px 0`},children:(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(rL,{}),onClick:()=>t(!0),size:`large`,children:`创建第一个项目`})}):(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},className:`stagger-children`,children:i.map((e,t)=>(0,$.jsxs)(`div`,{className:`project-card project-item animate-slideInCard`,onClick:()=>r(`/projects/${e.id}/generate`),style:{display:`flex`,alignItems:`center`,padding:`18px 22px`,borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,cursor:`pointer`,animationDelay:`${t*.06}s`},children:[(0,$.jsx)(`div`,{style:{width:50,height:50,borderRadius:14,flexShrink:0,background:`${u[e.industry]?.color||`#64748b`}12`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:24,marginRight:16,color:u[e.industry]?.color||`#64748b`},children:O7[u[e.industry]?.icon]||(0,$.jsx)(m2,{})}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:4,flexWrap:`wrap`},children:[(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:15,color:`#1a1a2e`},children:e.name}),(0,$.jsx)(XQ,{color:u[e.industry]?.color||`#64748b`,style:{borderRadius:6,margin:0},children:u[e.industry]?.label||e.industry})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,$.jsx)(aV,{style:{fontSize:12,color:`#94a3b8`}}),(0,$.jsxs)(`span`,{className:`date-display`,translate:`no`,style:{fontSize:12,color:`#94a3b8`},children:[`创建于 `,T7(e.createdAt)]})]})]}),(0,$.jsxs)(`div`,{className:`project-actions`,style:{display:`flex`,alignItems:`center`,gap:8,marginLeft:16},children:[(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(q6,{}),onClick:t=>{t.stopPropagation(),r(`/projects/${e.id}/generate`)},style:{background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`,borderRadius:10,fontWeight:600,height:36,boxShadow:`0 4px 12px rgba(99,102,241,0.25)`},children:`生成`}),(0,$.jsx)(vK,{title:`确定删除该项目?`,description:`项目下的生成记录将一并删除`,onConfirm:async t=>{t?.stopPropagation(),await s(e.id),Z.success(`项目已删除`)},onCancel:e=>e?.stopPropagation(),children:(0,$.jsx)(X,{danger:!0,icon:(0,$.jsx)(u$,{}),onClick:e=>e.stopPropagation(),style:{borderRadius:10,height:36,background:`rgba(239,68,68,0.06)`,border:`1px solid rgba(239,68,68,0.15)`,color:`#ef4444`}})}),(0,$.jsx)(Bg,{className:`mobile-hide`,style:{color:`#cbd5e1`,fontSize:12}})]})]},e.id))}),(0,$.jsx)(mK,{title:(0,$.jsxs)(sH,{children:[(0,$.jsx)(m2,{}),`新建项目`]}),open:e,onOk:async()=>{try{let e=await n.validateFields(),i=await o(e.name,e.industry);Z.success(`项目创建成功`),t(!1),n.resetFields(),r(`/projects/${i.id}/generate`)}catch{}},onCancel:()=>{t(!1),n.resetFields()},okText:`创建`,cancelText:`取消`,width:480,children:(0,$.jsxs)(tU,{form:n,layout:`vertical`,style:{marginTop:20},children:[(0,$.jsx)(tU.Item,{name:`name`,label:`项目名称`,rules:[{required:!0,message:`请输入项目名称`}],children:(0,$.jsx)(IW,{placeholder:`例如:618电商大促宣传片`,prefix:(0,$.jsx)(KX,{}),size:`large`})}),(0,$.jsx)(tU.Item,{name:`industry`,label:`所属行业`,rules:[{required:!0,message:`请选择行业`}],children:(0,$.jsx)(EC,{placeholder:`选择项目所属行业`,size:`large`,children:c.map((e,t)=>(0,$.jsx)(EC.Option,{value:e.key,children:(0,$.jsxs)(sH,{children:[O7[e.icon]||(0,$.jsx)(m2,{}),` `,e.label]})},e.key))})})]})})]})};async function k7(e){try{if(navigator.clipboard&&typeof navigator.clipboard.writeText==`function`)return await navigator.clipboard.writeText(e),!0;let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.left=`-9999px`,t.style.top=`0`,document.body.appendChild(t),t.focus(),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch{return!1}}var{Text:A7}=Q,ooe={real_person:{title:`选择真人素材库`,empty:`暂无可选 Active 真人素材`,projectError:`加载真人素材项目失败`,assetError:`加载真人素材失败`,fallbackName:`真人素材`},aigc_virtual:{title:`选择虚拟素材库`,empty:`暂无可选 Active 虚拟素材`,projectError:`加载虚拟素材项目失败`,assetError:`加载虚拟素材失败`,fallbackName:`虚拟素材`}},j7=e=>e?e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`data:`)||e.startsWith(`blob:`)?e:`${`http://ceshi.apiforeign.minzhong.cn`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`:``,soe=e=>e.assetType===`Video`?j7(e.videoCoverUrl||e.previewUrl||e.displayUrl||e.providerUrl):j7(e.previewUrl||e.displayUrl||e.videoCoverUrl||e.providerUrl),coe=e=>{let t=Number(e||0);return!Number.isFinite(t)||t<=0?`-`:`${t.toFixed(t>=10?0:1)}s`},M7=({open:e,libraryType:t=`real_person`,selectedIds:n=[],maxCount:r=20,onClose:i,onSelect:a,maxImageCount:o,maxVideoCount:s,usedImageCount:c,usedVideoCount:l,usedVideoDuration:u,maxVideoDuration:d,accept:f})=>{let p=ooe[t],[m,h]=(0,S.useState)([]),[g,_]=(0,S.useState)(),[v,y]=(0,S.useState)(``),[b,x]=(0,S.useState)(f===`image/*`?`Image`:void 0),[C,w]=(0,S.useState)([]),[T,E]=(0,S.useState)(new Map),[D,O]=(0,S.useState)(!1),[k,A]=(0,S.useState)(!1),j=(0,S.useMemo)(()=>new Set(T.keys()),[T]),M=async()=>{O(!0);try{let e=(await(t===`aigc_virtual`?g7:m7)({page:1,pageSize:100,status:`active`})).items||[];h(e),_(t=>t&&e.some(e=>e.id===t)?t:e[0]?.id)}catch(e){Z.error(e?.message||p.projectError)}finally{O(!1)}},N=async()=>{A(!0);try{w((await(t===`aigc_virtual`?zae:Nae)({projectId:g,keyword:v.trim()||void 0,assetType:b,page:1,pageSize:100})).items||[])}catch(e){Z.error(e?.message||p.assetError)}finally{A(!1)}};(0,S.useEffect)(()=>{e&&setTimeout(()=>{E(new Map),y(``),x(void 0),_(void 0),w([]),M()},0)},[e,t]),(0,S.useEffect)(()=>{g&&setTimeout(()=>{N()},0)},[g,b]);let P=e=>{if(n.includes(e.id)){Z.info(`该素材已添加`);return}if(f===`image/*`&&e.assetType===`Video`){Z.warning(`当前仅支持选择图片素材`);return}E(t=>{let n=new Map(t);return n.has(e.id)?(n.delete(e.id),n):n.size>=r?(Z.warning(`最多选择 ${r} 个参考素材`),t):(n.set(e.id,e),n)})},F=(0,S.useMemo)(()=>{let e=Array.from(T.values()).filter(e=>e.assetType===`Image`).length,t=Array.from(T.values()).filter(e=>e.assetType===`Video`).length,n=Array.from(T.values()).filter(e=>e.assetType===`Video`).reduce((e,t)=>e+(t.videoDuration||0),0),r=o!==void 0&&c!==void 0?o-c:1/0,i=s!==void 0&&l!==void 0?s-l:1/0,a=d!==void 0&&u!==void 0?d-u:1/0;return e>r||t>i||n>a},[T,o,c,s,l,d,u]);return(0,$.jsxs)(mK,{title:`${p.title}`,open:e,onCancel:i,width:920,destroyOnHidden:!0,footer:[(0,$.jsx)(X,{onClick:i,children:`取消`},`cancel`),(0,$.jsxs)(X,{type:`primary`,onClick:()=>{let e=Array.from(T.values()).filter(e=>!n.includes(e.id));if(!e.length){Z.warning(`请选择至少一个${t===`aigc_virtual`?`虚拟`:`真人`}素材`);return}a(e),i()},disabled:F,style:{background:F?`#94a3b8`:`#8b5cf6`,opacity:F?.6:1,cursor:F?`not-allowed`:`pointer`},children:[`添加选中素材(`,T.size,`)`]},`ok`)],children:[f!==`image/*`&&(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:20,marginBottom:16,padding:`12px 16px`,background:`#fafafa`,borderRadius:8},children:(()=>{let e=Array.from(T.values()).filter(e=>e.assetType===`Image`).length,t=Array.from(T.values()).filter(e=>e.assetType===`Video`).length,n=Array.from(T.values()).filter(e=>e.assetType===`Video`).reduce((e,t)=>e+(t.videoDuration||0),0),r=o!==void 0&&c!==void 0?o-c:1/0,i=s!==void 0&&l!==void 0?s-l:1/0,a=d!==void 0&&u!==void 0?d-u:1/0,f=e>r,p=t>i,m=n>a;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`span`,{style:{fontSize:13,color:f?`#ef4444`:`#64748b`,fontWeight:f?600:400},children:[`还可选取图片 `,e,`/`,o!==void 0&&c!==void 0?o-c:`-`,` 张`]}),(0,$.jsxs)(`span`,{style:{fontSize:13,color:p||m?`#ef4444`:`#64748b`,fontWeight:p||m?600:400},children:[`视频还可选取 `,t,`/`,s!==void 0&&l!==void 0?s-l:`-`,` 个(`,n.toFixed(1),`/`,d!==void 0&&u!==void 0?(d-u).toFixed(1):`-`,`秒)`]})]})})()}),(0,$.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`240px 1fr`,gap:16,height:500},children:[(0,$.jsxs)(`div`,{style:{border:`1px solid #eef0f4`,borderRadius:12,padding:12,background:`#fafafa`,overflowY:`auto`,height:`100%`},children:[(0,$.jsxs)(sH,{style:{width:`100%`,justifyContent:`space-between`,marginBottom:12},children:[(0,$.jsx)(A7,{strong:!0,children:`项目组`}),(0,$.jsx)(X,{size:`small`,icon:(0,$.jsx)(wq,{}),onClick:M,loading:D})]}),(0,$.jsx)(UG,{spinning:D,children:m.length===0?(0,$.jsx)(XS,{image:XS.PRESENTED_IMAGE_SIMPLE,description:`暂无项目组`}):(0,$.jsx)(`div`,{children:m.map(e=>(0,$.jsx)(`div`,{onClick:()=>_(e.id),style:{cursor:`pointer`,padding:`10px 12px`,borderRadius:10,marginBottom:6,border:g===e.id?`1px solid #8b5cf6`:`1px solid transparent`,background:g===e.id?`#f5f3ff`:`#fff`},children:(0,$.jsxs)(`div`,{style:{width:`100%`},children:[(0,$.jsx)(A7,{strong:!0,ellipsis:!0,style:{display:`block`},children:e.name}),(0,$.jsx)(A7,{type:`secondary`,style:{fontSize:12},children:typeof e.activeImageAssetCount==`number`||typeof e.activeVideoAssetCount==`number`?` 图 ${e.activeImageAssetCount||0} / 视 ${e.activeVideoAssetCount||0}`:``})]})},e.id))})})]}),(0,$.jsxs)(`div`,{style:{overflowY:`auto`,height:`100%`},children:[(0,$.jsxs)(sH,{style:{width:`100%`,marginBottom:12},children:[(0,$.jsx)(IW,{allowClear:!0,prefix:(0,$.jsx)(xC,{}),placeholder:`搜索素材名称`,value:v,onChange:e=>y(e.target.value),onPressEnter:N}),(0,$.jsx)(EC,{allowClear:f!==`image/*`,placeholder:`素材类型`,value:b,onChange:x,style:{width:116},options:f===`image/*`?[{value:`Image`,label:`图片`}]:[{value:`Image`,label:`图片`},{value:`Video`,label:`视频`}]}),(0,$.jsx)(X,{icon:(0,$.jsx)(wq,{}),onClick:N,loading:k,children:`刷新`})]}),(0,$.jsx)(UG,{spinning:k,children:C.length===0?(0,$.jsx)(XS,{image:XS.PRESENTED_IMAGE_SIMPLE,description:p.empty,style:{marginTop:120}}):(0,$.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(140px, 1fr))`,gap:12,maxHeight:420,overflowY:`auto`,paddingRight:4},children:C.filter(e=>f!==`image/*`||e.assetType===`Image`).map(e=>{let t=j.has(e.id)||n.includes(e.id),r=n.includes(e.id),i=soe(e),a=e.assetType===`Video`;return(0,$.jsxs)(`div`,{onClick:()=>P(e),style:{cursor:r?`not-allowed`:`pointer`,border:t?`2px solid #8b5cf6`:`1px solid #edf0f5`,borderRadius:12,overflow:`hidden`,background:`#fff`,boxShadow:t?`0 8px 20px rgba(139,92,246,0.18)`:`0 4px 12px rgba(15,23,42,0.04)`,opacity:r?.62:1,position:`relative`},children:[(0,$.jsxs)(`div`,{style:{aspectRatio:`1 / 1`,background:`#f8fafc`,display:`flex`,alignItems:`center`,justifyContent:`center`,position:`relative`},children:[i?a?(0,$.jsx)(`video`,{src:i,muted:!0,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(`img`,{src:i,alt:e.name||p.fallbackName,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):a?(0,$.jsx)(t5,{style:{fontSize:32,color:`#94a3b8`}}):(0,$.jsx)(R6,{style:{fontSize:32,color:`#94a3b8`}}),a&&(0,$.jsx)(`div`,{style:{position:`absolute`,left:8,bottom:8,padding:`2px 6px`,borderRadius:8,background:`rgba(15,23,42,0.72)`,color:`#fff`,fontSize:12},children:coe(e.videoDuration)})]}),t&&(0,$.jsx)(`div`,{style:{position:`absolute`,top:8,right:8,width:24,height:24,borderRadius:12,background:`#8b5cf6`,color:`#fff`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(hC,{})}),(0,$.jsxs)(`div`,{style:{padding:10},children:[(0,$.jsx)(A7,{strong:!0,ellipsis:!0,style:{display:`block`},children:e.name||`未命名素材`}),(0,$.jsxs)(sH,{wrap:!0,size:4,style:{marginTop:6},children:[(0,$.jsx)(XQ,{color:a?`blue`:`default`,children:a?`视频`:`图片`}),(0,$.jsx)(XQ,{children:e.projectName})]})]})]},e.id)})})})]})]})]})},N7=({src:e,size:t=`normal`})=>{let n=(0,S.useRef)(null),[r,i]=(0,S.useState)(!1),[a,o]=(0,S.useState)(0),[s,c]=(0,S.useState)(0),[l,u]=(0,S.useState)(1),[d,f]=(0,S.useState)(!1),p=e=>`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,`0`)}`,m=(0,S.useCallback)(()=>{n.current&&(r?n.current.pause():n.current.play(),i(!r))},[r]),h=(0,S.useCallback)(()=>{n.current&&o(n.current.currentTime)},[]),g=(0,S.useCallback)(()=>{n.current&&c(n.current.duration)},[]),_=(0,S.useCallback)(()=>{i(!1),o(0)},[]),v=(0,S.useCallback)(e=>{if(!n.current||s===0)return;let t=e.currentTarget.getBoundingClientRect(),r=(e.clientX-t.left)/t.width*s;n.current.currentTime=r,o(r)},[s]),y=(0,S.useCallback)(e=>{if(!n.current)return;let t=parseFloat(e.target.value);n.current.volume=t,u(t),f(t===0)},[]),b=(0,S.useCallback)(()=>{n.current&&(d?(n.current.volume=l||.5,f(!1)):(n.current.volume=0,f(!0)))},[d,l]);(0,S.useEffect)(()=>{let e=n.current;if(e)return e.addEventListener(`timeupdate`,h),e.addEventListener(`loadedmetadata`,g),e.addEventListener(`ended`,_),()=>{e.removeEventListener(`timeupdate`,h),e.removeEventListener(`loadedmetadata`,g),e.removeEventListener(`ended`,_)}},[h,g,_]);let x=s>0?a/s*100:0;return(0,$.jsxs)(`div`,{style:{width:`100%`,height:t===`small`?130:112,background:`#f1f5f9`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,padding:t===`small`?`16px 16px`:`12px 16px`},children:[(0,$.jsx)(`audio`,{ref:n,src:e}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16,width:`100%`},children:[(0,$.jsx)(`button`,{onClick:m,style:{width:48,height:48,borderRadius:`50%`,background:`linear-gradient(135deg, #8b5cf6, #a78bfa)`,border:`none`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,flexShrink:0},children:r?(0,$.jsx)(E6,{style:{fontSize:24,color:`#fff`}}):(0,$.jsx)(q6,{style:{fontSize:24,color:`#fff`,marginLeft:2}})}),(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,gap:8},children:[(0,$.jsxs)(`div`,{onClick:v,style:{height:5,background:`#e2e8f0`,borderRadius:10,cursor:`pointer`,overflow:`visible`,position:`relative`},children:[(0,$.jsx)(`div`,{style:{height:`100%`,width:`${x}%`,background:`linear-gradient(90deg, #8b5cf6, #a78bfa)`,borderRadius:10,transition:`width 0.1s linear`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,left:`${x}%`,top:`50%`,transform:`translate(-50%, -50%)`,width:t===`small`?12:14,height:t===`small`?12:14,background:`#fff`,borderRadius:`50%`,boxShadow:`0 2px 6px rgba(0,0,0,0.15)`,opacity:+(x>0),transition:`opacity 0.2s`}})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{fontSize:t===`small`?11:12,color:`#64748b`},children:p(a)}),(0,$.jsx)(`span`,{style:{fontSize:t===`small`?11:12,color:`#64748b`},children:p(s)})]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,flexShrink:0},children:[(0,$.jsx)(`button`,{onClick:b,style:{border:`none`,background:`transparent`,cursor:`pointer`,padding:0},children:d?(0,$.jsx)(m4,{style:{fontSize:t===`small`?14:16,color:`#94a3b8`}}):(0,$.jsx)(I8,{style:{fontSize:t===`small`?14:16,color:`#94a3b8`}})}),(0,$.jsx)(`input`,{type:`range`,min:`0`,max:`1`,step:`0.1`,value:d?0:l,onChange:y,style:{width:t===`small`?40:50,height:4,borderRadius:2,appearance:`none`,background:`#e2e8f0`,cursor:`pointer`}})]})]})]})},{Text:P7}=Q,F7=e=>{if(!e)return``;if(/^data:|blob:/i.test(e))return e;if(/^https?:\/\//i.test(e)){let t=new URL(e);return t.pathname.startsWith(`/uploads`)?t.pathname+t.search:e}return`${`http://ceshi.apiforeign.minzhong.cn`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`},I7=(e,t)=>{if(e<300||e>6e3)return`图片宽度需在 300~6000px 之间,当前为 ${e}px`;if(t<300||t>6e3)return`图片高度需在 300~6000px 之间,当前为 ${t}px`;let n=e/t;return n<.4||n>2.5?`图片宽高比需在 0.4~2.5 之间,当前为 ${n.toFixed(2)}`:null},L7=(e,t)=>{if(e<300||e>6e3)return`视频宽度需在 300~6000px 之间,当前为 ${e}px`;if(t<300||t>6e3)return`视频高度需在 300~6000px 之间,当前为 ${t}px`;let n=e/t;if(n<.4||n>2.5)return`视频宽高比需在 0.4~2.5 之间,当前为 ${n.toFixed(2)}`;let r=e*t;return r<409600?`视频总像素数过小(${e}×${t}=${r}),需 ≥ 640×640=409600`:r>8295044?`视频总像素数过大(${e}×${t}=${r}),需 ≤ 3326×2494=8295044`:null},loe=e=>{let t=e,n=t.width||t.videoWidth||t.imageWidth||0,r=t.height||t.videoHeight||t.imageHeight||0;if(e.resourceType===`image`){if(n>0&&r>0)return I7(n,r)}else if(e.resourceType===`video`&&n>0&&r>0)return L7(n,r);return null},uoe=e=>new Promise(t=>{let n=new Image;n.onload=()=>{t({width:n.width,height:n.height})},n.onerror=()=>{t({width:0,height:0})},n.src=e}),doe=e=>e===`video`?(0,$.jsx)(t5,{}):e===`audio`?(0,$.jsx)(k2,{}):(0,$.jsx)(R6,{}),foe=e=>e===`video`?`视频`:e===`audio`?`音频`:`图片`,poe=({open:e,onClose:t,onSelect:n,allowedTypes:r,selectedIds:i=[],title:a=`选择历史上传素材`,maxImageCount:o,maxVideoCount:s,usedImageCount:c,usedVideoCount:l,maxVideoDuration:u,usedVideoDuration:d,maxAudioCount:f,usedAudioCount:p,maxAudioDuration:m,usedAudioDuration:h,hideLimitHint:g})=>{let[_,v]=(0,S.useState)(``),[y,b]=(0,S.useState)(``),[x,C]=(0,S.useState)(1),[w,T]=(0,S.useState)(10),[E,D]=(0,S.useState)(1),[O,k]=(0,S.useState)(10),[A,j]=(0,S.useState)(!1),[M,N]=(0,S.useState)(!1),[P,F]=(0,S.useState)([]),[I,L]=(0,S.useState)(0),[R,z]=(0,S.useState)(``),[B,V]=(0,S.useState)([]),[H,U]=(0,S.useState)(0),[W,ee]=(0,S.useState)(new Map),te=(0,S.useMemo)(()=>new Set(i),[i]),G=(0,S.useMemo)(()=>new Set(r||[`image`,`video`,`audio`]),[JSON.stringify(r)]),ne=(0,S.useMemo)(()=>Array.from(W.values()).filter(e=>e.resourceType===`image`).length,[W]),re=(0,S.useMemo)(()=>Array.from(W.values()).filter(e=>e.resourceType===`video`).length,[W]),ie=(0,S.useMemo)(()=>Array.from(W.values()).filter(e=>e.resourceType===`video`).reduce((e,t)=>e+(t.durationSeconds||0),0),[W]),ae=(0,S.useMemo)(()=>Array.from(W.values()).filter(e=>e.resourceType===`audio`).length,[W]),oe=(0,S.useMemo)(()=>Array.from(W.values()).filter(e=>e.resourceType===`audio`).reduce((e,t)=>e+(t.durationSeconds||0),0),[W]),K=(0,S.useMemo)(()=>o!==void 0&&c!==void 0?o-c:1/0,[o,c]),q=(0,S.useMemo)(()=>s!==void 0&&l!==void 0?s-l:1/0,[s,l]),se=(0,S.useMemo)(()=>u!==void 0&&d!==void 0?u-d:1/0,[u,d]),ce=(0,S.useMemo)(()=>f!==void 0&&p!==void 0?f-p:1/0,[f,p]),le=(0,S.useMemo)(()=>m!==void 0&&h!==void 0?m-h:1/0,[m,h]),ue=(0,S.useMemo)(()=>ne>K,[ne,K]),de=(0,S.useMemo)(()=>re>q,[re,q]),fe=(0,S.useMemo)(()=>ie>se,[ie,se]),pe=(0,S.useMemo)(()=>ae>ce,[ae,ce]),me=(0,S.useMemo)(()=>oe>le,[oe,le]),he=(0,S.useCallback)(async()=>{if(e){N(!0);try{let e=await d7({resourceType:_||void 0,keyword:y||void 0,page:x,pageSize:w,scene:`picker`});F(x===1?e.groups||[]:t=>[...t,...e.groups||[]]),L(e.totalDays||0)}catch(e){Z.error(e?.message||`加载历史上传素材失败`),x===1&&F([]),L(0)}finally{N(!1)}}},[G,y,e,x,w,_]),ge=(0,S.useCallback)(async e=>{j(!0);try{let t=await f7(e,{resourceType:_||void 0,keyword:y||void 0,page:E,pageSize:8,scene:`picker`});V((t.items||[]).filter(e=>G.has(e.resourceType))),U(t.total||0)}catch(e){Z.error(e?.message||`加载历史上传素材失败`),V([]),U(0)}finally{j(!1)}},[G,y,E,O,_]);(0,S.useEffect)(()=>{e&&he()},[e,x,he]),(0,S.useEffect)(()=>{R&&D(1)},[R]),(0,S.useEffect)(()=>{R&&ge(R)},[R,E,ge]),(0,S.useEffect)(()=>{e&&ee(new Map)},[e]);let _e=async e=>{if(te.has(e.id)){Z.warning(`该素材已经在参考内容中`);return}let t=e,n=t.width||t.videoWidth||t.imageWidth||0,r=t.height||t.videoHeight||t.imageHeight||0;if(e.resourceType===`image`){if(n<=0||r<=0){let t=F7(e.previewUrl||e.displayUrl||e.resourceUrl);if(t){let e=await uoe(t);n=e.width,r=e.height}}if(n>0&&r>0){let t=I7(n,r);if(t){Z.error(`${e.fileName||`图片`}:${t}`);return}}}else if(e.resourceType===`video`&&n>0&&r>0){let t=L7(n,r);if(t){Z.error(`${e.fileName||`视频`}:${t}`);return}}ee(t=>{let n=new Map(t);return n.has(e.id)?n.delete(e.id):n.set(e.id,e),n})},ve=()=>{let e=Array.from(W.values());if(e.length===0){Z.warning(`请先选择历史素材`);return}n(e),ee(new Map),t()},ye=(0,S.useMemo)(()=>[{label:`全部`,value:``},{label:`图片`,value:`image`},{label:`视频`,value:`video`},{label:`音频`,value:`audio`}].filter(e=>!e.value||G.has(e.value)),[G]);return(0,$.jsxs)(mK,{title:a,open:e,onCancel:t,width:1e3,centered:!0,destroyOnHidden:!0,footer:[(0,$.jsx)(X,{onClick:t,children:`取消`},`cancel`),(0,$.jsxs)(X,{type:`primary`,onClick:ve,style:{background:`#8b5cf6`},disabled:ue||de||fe||pe||me,children:[`应用选择 (`,W.size,`)`]},`ok`)],children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsxs)(sH,{wrap:!0,children:[(0,$.jsx)(EC,{value:_,options:ye,style:{width:120},onChange:e=>{v(e),C(1)}}),(0,$.jsx)(IW,{allowClear:!0,value:y,prefix:(0,$.jsx)(xC,{}),placeholder:`搜索文件名`,style:{width:220},onChange:e=>b(e.target.value),onPressEnter:()=>{C(1),he()}}),(0,$.jsx)(X,{icon:(0,$.jsx)(wq,{}),onClick:he,children:`刷新`})]}),!g&&(0,$.jsxs)(`div`,{style:{display:`flex`,gap:16,marginTop:12,flexWrap:`wrap`},children:[(0,$.jsxs)(`span`,{style:{fontSize:13,color:ue?`#ef4444`:`#64748b`,fontWeight:ue?600:400},children:[`还可选取图片 `,ne,`/`,o!==void 0&&c!==void 0?o-c:`-`,` 张`]}),(0,$.jsxs)(`span`,{style:{fontSize:13,color:de||fe?`#ef4444`:`#64748b`,fontWeight:de||fe?600:400},children:[`视频还可选取 `,re,`/`,s!==void 0&&l!==void 0?s-l:`-`,` 个(`,ie.toFixed(1),`/`,u!==void 0&&d!==void 0?(u-d).toFixed(1):`-`,`秒)`]}),f!==void 0&&(0,$.jsxs)(`span`,{style:{fontSize:13,color:pe||me?`#ef4444`:`#64748b`,fontWeight:pe||me?600:400},children:[`音频还可选取 `,ae,`/`,f!==void 0&&p!==void 0?f-p:`-`,` 个(`,oe.toFixed(1),`/`,m!==void 0&&h!==void 0?(m-h).toFixed(1):`-`,`秒)`]})]})]}),(0,$.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`240px 1fr`,gap:16,height:500},children:[(0,$.jsxs)(`div`,{style:{border:`1px solid #eef0f4`,borderRadius:12,padding:12,background:`#fafafa`,overflowY:`auto`},children:[(0,$.jsx)(P7,{strong:!0,style:{fontSize:14},children:`日期列表`}),(0,$.jsx)(UG,{spinning:M,children:P.length===0?(0,$.jsx)(XS,{image:XS.PRESENTED_IMAGE_SIMPLE,description:`暂无日期`,style:{padding:`40px 0`}}):(0,$.jsxs)(`div`,{style:{marginTop:12},children:[P.map(e=>(0,$.jsxs)(`div`,{onClick:()=>z(e.generatedDate),style:{padding:`10px 12px`,borderRadius:10,marginBottom:6,cursor:`pointer`,border:R===e.generatedDate?`1px solid #8b5cf6`:`1px solid transparent`,background:R===e.generatedDate?`#f5f3ff`:`#fff`},children:[(0,$.jsx)(`div`,{style:{fontSize:13,fontWeight:500,color:`#334155`},children:e.generatedDate}),(0,$.jsxs)(`div`,{style:{fontSize:12,color:`#94a3b8`,marginTop:4},children:[`共 `,e.total,` 个素材`]})]},e.generatedDate)),I>P.length&&(0,$.jsx)(`div`,{style:{marginTop:12,textAlign:`center`},children:(0,$.jsx)(X,{size:`small`,onClick:()=>C(x+1),children:`加载更多`})})]})})]}),(0,$.jsx)(`div`,{style:{border:`1px solid #eef0f4`,borderRadius:12,padding:12,overflowY:`auto`},children:(0,$.jsx)(UG,{spinning:A,children:R?B.length===0?(0,$.jsx)(XS,{description:`该日期暂无可复用的历史上传素材`,style:{padding:`48px 0`}}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(150px, 1fr))`,gap:14},children:B.map(e=>{let t=W.has(e.id),n=te.has(e.id),r=loe(e),i=n||!!r,a=F7(e.previewUrl||e.displayUrl||e.resourceUrl);return(0,$.jsxs)(`div`,{onClick:()=>!i&&_e(e),style:{position:`relative`,borderRadius:14,border:t?`2px solid #8b5cf6`:`1px solid #e2e8f0`,background:i?`#f8fafc`:`#fff`,opacity:i?.55:1,cursor:i?`not-allowed`:`pointer`,overflow:`hidden`,boxShadow:t?`0 10px 24px rgba(139, 92, 246, 0.18)`:`0 6px 18px rgba(15,23,42,0.06)`},title:r||void 0,children:[(0,$.jsx)(`div`,{style:{background:`#f1f5f9`},children:e.resourceType===`image`?(0,$.jsx)(`img`,{src:a,alt:e.fileName||e.id,style:{width:`100%`,height:130,objectFit:`cover`}}):e.resourceType===`video`?(0,$.jsx)(`video`,{src:a,muted:!0,style:{width:`100%`,height:130,objectFit:`cover`}}):(0,$.jsx)(N7,{src:a,size:`small`})}),(0,$.jsxs)(`div`,{style:{padding:10},children:[(0,$.jsxs)(sH,{size:6,style:{marginBottom:6},children:[(0,$.jsx)(XQ,{color:`purple`,icon:doe(e.resourceType),style:{margin:0},children:foe(e.resourceType)}),e.durationSeconds?(0,$.jsxs)(XQ,{style:{margin:0},children:[Number(e.durationSeconds).toFixed(1),`s`]}):null,r&&(0,$.jsx)(XQ,{color:`red`,style:{margin:0},children:`尺寸不符`})]}),(0,$.jsx)(P7,{ellipsis:!0,style:{display:`block`,fontSize:13,color:`#334155`},title:e.fileName||e.id,children:e.fileName||e.id}),(0,$.jsx)(P7,{type:`secondary`,style:{fontSize:12},children:e.moduleLabel||`普通上传`})]}),t&&(0,$.jsx)(`div`,{style:{position:`absolute`,top:8,right:8,width:24,height:24,borderRadius:12,background:`#8b5cf6`,color:`#fff`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(hC,{})}),n&&(0,$.jsx)(`div`,{style:{position:`absolute`,top:8,right:8},children:(0,$.jsx)(XQ,{children:`已选`})}),r&&(0,$.jsx)(`div`,{style:{position:`absolute`,bottom:0,left:0,right:0,background:`rgba(239, 68, 68, 0.9)`,color:`#fff`,padding:`4px 8px`,fontSize:11,textAlign:`center`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:r})]},e.id)})}),(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,marginTop:16,paddingBottom:8},children:(0,$.jsx)(SG,{current:E,pageSize:O,total:H,showSizeChanger:!0,pageSizeOptions:[10,20,50,100],onChange:(e,t)=>{D(e),k(t)}})})]}):(0,$.jsx)(XS,{image:XS.PRESENTED_IMAGE_SIMPLE,description:`请选择日期`,style:{padding:`80px 0`}})})})]})]})},R7=({children:e,accept:t=`image/*,video/*`,multiple:n=!0,onLocalSelect:r,onHistorySelect:i,onPortraitSelect:a,onPortraitLibrarySelect:o,uploading:s,tooltipTitle:c,maxImageCount:l,maxVideoCount:u,usedImageCount:d,usedVideoCount:f,usedVideoDuration:p,maxVideoDuration:m,maxAudioCount:h,usedAudioCount:g,maxAudioDuration:_,usedAudioDuration:v,hideLimitHint:y,mediaType:b})=>{let x=(0,S.useRef)(null),[C,w]=(0,S.useState)(!1),[T,E]=(0,S.useState)(`real_person`),[D,O]=(0,S.useState)(!1),[k,A]=(0,S.useState)(!1),[j,M]=(0,S.useState)(!1),N=()=>{A(!1),x.current?.click()},P=e=>{let t=e.target.files;t&&r&&r(Array.from(t)),x.current&&(x.current.value=``)},F=e=>{if(A(!1),a){E(e),w(!0);return}if(o){o(e);return}E(e),w(!0)},I=(0,$.jsxs)(`div`,{style:{padding:`4px 0`,minWidth:180},children:[(0,$.jsxs)(`div`,{onClick:()=>{N()},style:{display:`flex`,alignItems:`center`,gap:12,padding:`8px 16px`,cursor:`pointer`,transition:`background 0.15s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`#f1f5f9`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:[(0,$.jsx)(KX,{style:{fontSize:14,color:`#64748b`}}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#334155`},children:`本地上传`})]}),(0,$.jsxs)(`div`,{onClick:()=>{A(!1),O(!0)},style:{display:`flex`,alignItems:`center`,gap:12,padding:`8px 16px`,cursor:`pointer`,transition:`background 0.15s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`#f1f5f9`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:[(0,$.jsx)(q4,{style:{fontSize:14,color:`#64748b`}}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#334155`},children:`从资产中选择`})]}),b!==`image`&&(0,$.jsxs)(`div`,{onClick:()=>F(`real_person`),style:{display:`flex`,alignItems:`center`,gap:12,padding:`8px 16px`,cursor:`pointer`,transition:`background 0.15s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`#f1f5f9`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:[(0,$.jsx)($8,{style:{fontSize:14,color:`#64748b`}}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#334155`},children:`真人素材库`})]}),b!==`image`&&(0,$.jsxs)(`div`,{onClick:()=>F(`aigc_virtual`),style:{display:`flex`,alignItems:`center`,gap:12,padding:`8px 16px`,cursor:`pointer`,transition:`background 0.15s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`#f1f5f9`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:[(0,$.jsx)(H8,{style:{fontSize:14,color:`#64748b`}}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#334155`},children:`虚拟素材库`})]})]});return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`input`,{ref:x,type:`file`,accept:t,multiple:n,onChange:P,style:{display:`none`}}),c?(0,$.jsx)(gw,{title:c,children:(0,$.jsx)(ww,{content:I,open:k,onOpenChange:A,trigger:`click`,placement:`bottomLeft`,children:(0,$.jsx)(`div`,{style:{cursor:s?`not-allowed`:`pointer`},children:e})})}):(0,$.jsx)(ww,{content:I,open:k,onOpenChange:A,trigger:`click`,placement:`bottomLeft`,children:(0,$.jsx)(`div`,{style:{cursor:s?`not-allowed`:`pointer`},children:e})}),(0,$.jsx)(poe,{open:D,onClose:()=>O(!1),onSelect:e=>{i?.(e),O(!1)},allowedTypes:t.includes(`audio`)?[`image`,`video`,`audio`]:t.includes(`video`)?[`image`,`video`]:[`image`],maxImageCount:l,maxVideoCount:u,usedImageCount:d,usedVideoCount:f,maxVideoDuration:m,usedVideoDuration:p,maxAudioCount:h,usedAudioCount:g,maxAudioDuration:_,usedAudioDuration:v,hideLimitHint:y}),(0,$.jsx)(M7,{open:C,libraryType:T,onClose:()=>w(!1),onSelect:e=>{a?.(e),w(!1)},accept:t,maxCount:t===`image/*`&&!n?1:void 0,maxImageCount:l,maxVideoCount:u,usedImageCount:d,usedVideoCount:f,usedVideoDuration:p,maxVideoDuration:m})]})};function moe(){if(typeof crypto<`u`&&typeof crypto.randomUUID==`function`)return crypto.randomUUID();if(typeof crypto<`u`&&typeof crypto.getRandomValues==`function`){let e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}return`${Date.now().toString(16).padStart(12,`0`)}-${Math.random().toString(16).slice(2,10).padStart(8,`0`)}-4xxx-yxxx-${Math.random().toString(16).slice(2,12)}`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}var z7=({src:e,width:t=48,height:n=48})=>{let[r,i]=(0,S.useState)(null),[a,o]=(0,S.useState)(null);return(0,S.useEffect)(()=>{let r=document.createElement(`video`);r.muted=!0,r.preload=`metadata`,r.crossOrigin=`anonymous`;let a=()=>{o(r.duration),r.currentTime=Math.min(1,r.duration*.1)},s=()=>{try{let e=document.createElement(`canvas`);e.width=t*2,e.height=n*2;let a=e.getContext(`2d`);a&&(a.drawImage(r,0,0,e.width,e.height),i(e.toDataURL(`image/jpeg`,.7)))}catch{}};return r.addEventListener(`loadedmetadata`,a),r.addEventListener(`seeked`,s),r.src=e,()=>{r.removeEventListener(`loadedmetadata`,a),r.removeEventListener(`seeked`,s)}},[e,t,n]),(0,$.jsxs)(`div`,{style:{width:`100%`,height:`100%`,position:`relative`,background:`#1a1a2e`},children:[r?(0,$.jsx)(`img`,{src:r,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(q6,{style:{color:`#fff`,fontSize:18}})}),a!=null&&(0,$.jsx)(`span`,{style:{position:`absolute`,bottom:2,right:2,fontSize:9,color:`#fff`,background:`rgba(0,0,0,0.6)`,borderRadius:4,padding:`1px 4px`,lineHeight:1.3},children:(e=>`${Math.round(e)}s`)(a)})]})},hoe=()=>{let{projectId:e}=$e(),t=Ye(),[n]=tU.useForm(),{projects:r,records:i,fetchProjects:a,fetchRecords:o,optimizePrompt:s,generateVideo:c}=C7(),l=i.items,{user:u}=_7(),[d,f]=(0,S.useState)(!1),[p,m]=(0,S.useState)(!1),[h,g]=(0,S.useState)(null),[_,v]=(0,S.useState)(``),[y,b]=(0,S.useState)(!1),[x,C]=(0,S.useState)({}),[w,T]=(0,S.useState)({}),[E,D]=(0,S.useState)({}),[O,k]=(0,S.useState)({}),[A,j]=(0,S.useState)({}),M=(0,S.useRef)(null),N=(0,S.useCallback)(e=>{if(!e)return 0;let t=new Date(e).getTime(),n=(Date.now()-t)/1e3;return n>=180?99:Math.min(99,n*.6)},[]);(0,S.useEffect)(()=>{let e=Object.entries(w).filter(([,e])=>e===`generating`).map(([e])=>e);if(e.length===0){M.current&&=(clearInterval(M.current),null);return}let t=()=>{e.forEach(e=>{let t=C7.getState().records.items.find(t=>t.id===e);if(t?.createdAt){let n=N(t.createdAt);D(t=>({...t,[e]:n})),k(t=>({...t,[e]:n}))}})};return t(),M.current=window.setInterval(t,1e3),()=>{M.current&&=(clearInterval(M.current),null)}},[w,N]),(0,S.useEffect)(()=>{Object.entries(w).forEach(([e,t])=>{if(t===`done`&&!A[e]){j(t=>({...t,[e]:!0}));let t=O[e]||0,n=Date.now(),r=()=>{let i=Date.now()-n,a=Math.min(i/800,1),o=1-(1-a)**3,s=t+(100-t)*o;k(t=>({...t,[e]:s})),a<1&&requestAnimationFrame(r)};requestAnimationFrame(r)}})},[w]),(0,S.useEffect)(()=>{Object.entries(w).forEach(([e,t])=>{if(t===`generating`){let t=C7.getState().records.items.find(t=>t.id===e);if(t?.createdAt){let n=N(t.createdAt);D(t=>({...t,[e]:n})),k(t=>({...t,[e]:n}))}}})},[h]);let[P,F]=(0,S.useState)({}),[I,L]=(0,S.useState)(null),[R,z]=(0,S.useState)(null),[B,V]=(0,S.useState)([]),[H,U]=(0,S.useState)(!1),[W,ee]=(0,S.useState)(``),[te,G]=(0,S.useState)(!1),[ne,re]=(0,S.useState)(``),ie=(0,S.useRef)(null),[ae,oe]=(0,S.useState)({}),[K,q]=(0,S.useState)({}),[se,ce]=(0,S.useState)({}),[le,ue]=(0,S.useState)(null),[de,fe]=(0,S.useState)({}),[pe,me]=(0,S.useState)(null),[he,ge]=(0,S.useState)(5),[_e,ve]=(0,S.useState)(`16:9`),[ye,be]=(0,S.useState)(`720p`),[xe,Se]=(0,S.useState)(null),[Ce,we]=(0,S.useState)({ratios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:[`720p`,`1080p`],durations:[5,8,10,12,15]}),[Te,Ee]=(0,S.useState)(0),[De,Oe]=(0,S.useState)(0),[ke,Ae]=(0,S.useState)(`video`),[je,Me]=(0,S.useState)(`1:1`),[Ne,Pe]=(0,S.useState)(`2K`),[Fe,Ie]=(0,S.useState)(2048),[Le,Re]=(0,S.useState)(2048),[ze,Be]=(0,S.useState)(!1),[Ve,He]=(0,S.useState)([]),[Ue,We]=(0,S.useState)([]),Ge=(e,t)=>{if(e<300||e>6e3)return`图片宽度需在 300~6000px 之间,当前为 ${e}px`;if(t<300||t>6e3)return`图片高度需在 300~6000px 之间,当前为 ${t}px`;let n=e/t;return n<.4||n>2.5?`图片宽高比需在 0.4~2.5 之间,当前为 ${n.toFixed(2)}`:null},Ke=(e,t)=>{if(e<300||e>6e3)return`视频宽度需在 300~6000px 之间,当前为 ${e}px`;if(t<300||t>6e3)return`视频高度需在 300~6000px 之间,当前为 ${t}px`;let n=e/t;if(n<.4||n>2.5)return`视频宽高比需在 0.4~2.5 之间,当前为 ${n.toFixed(2)}`;let r=e*t;return r<409600?`视频总像素数过小(${e}×${t}=${r}),需 ≥ 640×640=409600`:r>8295044?`视频总像素数过大(${e}×${t}=${r}),需 ≤ 3326×2494=8295044`:null},qe=async e=>{let t=e.type.startsWith(`image/`),n=e.type.startsWith(`video/`);if(!t&&!n)return Z.error(`仅支持图片或视频文件`),!1;let r=n?100:10;if(e.size/1024/1024>r)return Z.error(`${n?`视频`:`图片`}大小不能超过${r}MB`),!1;let i=B.filter(e=>e.type===`image`).length,a=B.filter(e=>e.type===`video`).length,o=B.filter(e=>e.type===`video`).reduce((e,t)=>e+(t.duration||0),0);if(t&&i>=5)return Z.error(`最多上传5张图片`),!1;if(n&&a>=2)return Z.error(`最多上传2个视频`),!1;let s=0;if(n){let t=await new Promise(t=>{let n=document.createElement(`video`);n.preload=`metadata`,n.onloadedmetadata=()=>{t({duration:n.duration||0,width:n.videoWidth||0,height:n.videoHeight||0}),n.remove()},n.onerror=()=>{t({duration:0,width:0,height:0}),n.remove()},n.src=URL.createObjectURL(e)});if(s=t.duration,t.width>0&&t.height>0){let e=Ke(t.width,t.height);if(e)return Z.error(`${e}`),!1}if(o+s>15)return Z.error(`视频总时长不能超过15秒`),!1}else{let t=await new Promise(t=>{let n=document.createElement(`img`);n.onload=()=>{t({width:n.width,height:n.height}),URL.revokeObjectURL(n.src)},n.onerror=()=>{t({width:0,height:0}),URL.revokeObjectURL(n.src)},n.src=URL.createObjectURL(e)});if(t.width>0&&t.height>0){let e=Ge(t.width,t.height);if(e)return Z.error(`${e}`),!1}}U(!0);try{let r;r=t?await E5(e):await D5(e,s);let o=t?`图片`:`视频`,c=t?i+1:a+1;V(e=>[...e,{url:r.url,type:t?`image`:`video`,name:`${o}${c}`,duration:n?s:void 0}]),Z.success(`${o}上传成功`)}catch{Z.error(`上传失败`)}finally{U(!1)}return!1};(0,S.useEffect)(()=>{if(Vie().then(e=>{He(e.video),We(e.image)}),!ze)return;let e=e=>{let t=e.target;!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&Be(!1)};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[ze]);let Je=(e,t)=>{for(let n=0;n{let t=e===`2k`?`2048`:e===`4k`?`4096`:e;for(let e=0;e{st(e);let t=ut[Ne]?.[e];if(t){let[e,n]=t.split(/x/i).map(Number);Ie(e),Re(n)}},Qe=e=>{lt(e);let t=Object.keys(ut[e]||{});tt(t.map(e=>({value:e,label:e})));let n=t.includes(je)?je:t[0]||`1:1`;n!==je&&Me(n);let r=ut[e]?.[n];if(r){let[e,t]=r.split(/x/i).map(Number);Ie(e),Re(t)}},[et,tt]=(0,S.useState)([]),[nt,rt]=(0,S.useState)([]),[it,at]=(0,S.useState)([]),[ot,st]=(0,S.useState)(0),[ct,lt]=(0,S.useState)(0),[ut,dt]=(0,S.useState)({});(0,S.useEffect)(()=>{it[ct]&&it[ct][ot]!==void 0&&(Ie(it[ct][ot].substring(0,4)),Re(it[ct][ot].substring(5)))},[ot]),(0,S.useEffect)(()=>{it[ct]&&it[ct][ot]!==void 0&&(Ie(it[ct][ot].substring(0,4)),Re(it[ct][ot].substring(5)))},[ct]);let ft=()=>{Ie(Le),Re(Fe)},pt=e=>{Ae(e.target.value===`image`?`image`:`video`)};(0,S.useEffect)(()=>{I5().then(e=>{oe(Object.fromEntries(e.map(e=>[e.key,e.label]))),q(Object.fromEntries(e.map(e=>[e.key,e.optionGroups||[]])))}).catch(()=>{}),Fie().then(e=>{let t=e.items?.[0]?.supportedSizes||{};dt(t);let n=Object.keys(t);rt(n.map(e=>({value:e,label:e})));let r=n.includes(Ne)?Ne:n[0]||`2K`,i=Object.keys(t[r]||{});tt(i.map(e=>({value:e,label:e})));let a=i.includes(je)?je:i[0]||`1:1`;a!==je&&Me(a);let o=t[r]?.[a];if(o){let[e,t]=o.split(/x/i).map(Number);Ie(e),Re(t)}}).catch(()=>{}),Pie().then(e=>{if(e.items?.length){let t=e.items[0];we({ratios:t.supportedRatios?.length?t.supportedRatios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:t.supportedResolutions?.length?t.supportedResolutions:[`720p`,`1080p`],durations:t.supportedDurations?.length?t.supportedDurations:[5,8,10,12,15]})}}).catch(()=>{})},[]),(0,S.useEffect)(()=>{a(),o({projectId:e,page:1,pageSize:100})},[e,a,o]);let mt=(0,S.useRef)(!1);(0,S.useEffect)(()=>{mt.current||l.length===0||(mt.current=!0,l.forEach(t=>{t.projectId===e&&t.status===`generating`&&(T(e=>({...e,[t.id]:`generating`})),Vt(t.id)),t.projectId===e&&t.status===`optimizing`&&St(t.id)}))},[l,e]);let ht=(0,S.useRef)(new Set),gt=(0,S.useRef)(null),_t=(0,S.useRef)(null),vt=e=>{ht.current.add(e),xt()},yt=e=>{ht.current.delete(e),ht.current.size===0&&bt()},bt=()=>{gt.current&&=(clearInterval(gt.current),null),_t.current&&=(_t.current.abort(),null)},xt=()=>{gt.current||=setInterval(async()=>{try{_t.current&&_t.current.abort();let t=new AbortController;_t.current=t;let n=await w5({projectId:e,page:1,pageSize:100,signal:t.signal});_t.current=null;let r=Array.from(ht.current),i=[];if(r.length>0){let e=C7.getState().records,t=e.items.map(e=>{if(r.includes(e.id)){let t=n.items.find(t=>t.id===e.id);if(t)return t.status!==`optimizing`&&i.push(e.id),t}return e});C7.setState({records:{...e,items:t}}),i.forEach(e=>{yt(e)})}}catch(e){e.name}},3e3)},St=e=>{vt(e)},Ct=(0,S.useRef)(!1),wt=(0,S.useRef)(null);(0,S.useEffect)(()=>{if(Ct.current||l.length===0)return;let t=localStorage.getItem(`pending_optimize`);if(t)try{let{key:n,projectId:r,prompt:i,duration:a,ts:o}=JSON.parse(t);if(Date.now()-o>300*1e3||r!==e){localStorage.removeItem(`pending_optimize`);return}if(wt.current===n)return;let s=l.find(e=>e.projectId===r&&e.originalPrompt===i&&e.duration===a&&e.status===`prompt_optimized`&&new Date(e.createdAt).getTime()>o-1e4);s?(Ct.current=!0,localStorage.removeItem(`pending_optimize`),g(s),v(s.optimizedPrompt||``),Ee(s.textCreditsCost),Oe(s.textTokensUsed),m(!0),Z.success({content:`优化请求已恢复,消耗 ${s.textCreditsCost} 积分`,key:`recovery`})):Date.now()-o>3e4&&localStorage.removeItem(`pending_optimize`)}catch{localStorage.removeItem(`pending_optimize`)}},[l,e]);let Tt=r.find(t=>t.id===e),Et=l.filter(t=>t.projectId===e),Dt=Tt?.name??`项目`,Ot=Tt&&K[Tt.industry]||[],kt=u?.credits??0,At=e=>{let t=e===`2k`?`2048`:e===`4k`?`4096`:e;for(let e=0;e=jt,Nt=async()=>{try{if(!e){Z.error(`项目ID为空,请先选择项目`);return}let t=await n.validateFields();if(!t.prompt||!t.prompt.trim()){Z.error(`请输入视频/图片描述`);return}f(!0);let r=Object.entries(se).map(([e,t])=>`@${e}:${t}`),i=r.length>0?`${t.prompt}\n\n${r.join(`;`)}`:t.prompt,a=moe();localStorage.setItem(`pending_optimize`,JSON.stringify({key:a,projectId:e,prompt:i,duration:he,ts:Date.now()})),wt.current=a;let o=await s(e,{prompt:i,duration:he,genType:ke,resolution:Ne,references:B.length>0?B:void 0,idempotencyKey:a,image_size:Ne,image_proportion:je,image_px:Fe+`x`+Le});localStorage.removeItem(`pending_optimize`),wt.current=null,g(o.record),v(o.record.optimizedPrompt||``),Ee(o.textCreditsCost),Oe(o.textTokensUsed),m(!0),Z.success({content:`「${Dt}」提示词优化完成,消耗 ${o.textCreditsCost} 积分`,key:`optimize`})}catch(e){let t=e?.response?.data?.message||e?.message||`操作失败,请稍后重试`;Z.error(t)}finally{f(!1),localStorage.removeItem(`pending_optimize`),wt.current=null}},Pt=(0,S.useRef)(new Set),Ft=(0,S.useRef)(null),It=(0,S.useRef)(null),Lt=e=>{Pt.current.add(e),Bt()},Rt=e=>{Pt.current.delete(e),Pt.current.size===0&&zt()},zt=()=>{Ft.current&&=(clearInterval(Ft.current),null),It.current&&=(It.current.abort(),null)},Bt=()=>{Ft.current||=setInterval(async()=>{try{It.current&&It.current.abort();let t=new AbortController;It.current=t;let n=await w5({projectId:e,page:1,pageSize:100,signal:t.signal});It.current=null;let r=Array.from(Pt.current),i=[];if(r.length>0){let e=C7.getState().records,t=e.items.map(e=>{if(r.includes(e.id)){let t=n.items.find(t=>t.id===e.id);if(t){let n=w[e.id];return t.status===`generating`?n!==`generating`&&T(t=>({...t,[e.id]:`generating`})):i.push(e.id),t}}return e});C7.setState({records:{...e,items:t}}),i.forEach(e=>{let t=n.items.find(t=>t.id===e);Rt(e),t?.status===`completed`?(T(t=>({...t,[e]:`done`})),g(n=>n?.id===e?t:n),Z.success({content:`「${Dt}」视频生成完成!`,key:e,duration:5})):t?.status===`failed`&&(T(t=>({...t,[e]:`failed`})),g(n=>n?.id===e?t:n),Z.error({content:`「${Dt}」视频生成失败: ${t.errorMessage||`未知错误`}`,key:e,duration:5}))})}}catch(e){e.name}},5e3)},Vt=e=>{Lt(e)};(0,S.useEffect)(()=>()=>{zt(),bt()},[]),(0,S.useEffect)(()=>{l.filter(e=>e.status===`generating`).forEach(e=>{T(t=>({...t,[e.id]:`generating`})),Vt(e.id)})},[l]);let Ht=async e=>{if(!Mt){Z.error(`积分不足,请先充值`);return}C(t=>({...t,[e]:!0})),T(t=>({...t,[e]:`generating`})),Z.loading({content:`「${Dt}」正在提交视频生成...`,duration:0,key:e});try{(await c(e,{aspectRatio:_e,resolution:ye})).status===`failed`?(T(t=>({...t,[e]:`failed`})),Z.error({content:`「${Dt}」提交失败`,key:e,duration:3})):(Z.success({content:`「${Dt}」已提交,正在生成中...`,key:e,duration:3}),Vt(e))}catch(t){T(t=>({...t,[e]:`failed`}));let n=`提交失败`;t?.response?.data?.detail?n=t.response.data.detail:t?.data?.detail?n=t.data.detail:t?.detail?n=t.detail:t?.message&&(n=t.message),Z.error({content:`${n}`,key:e,duration:3})}finally{C(t=>({...t,[e]:!1}))}},Ut=e=>{let t=w[e.id];return t===`generating`?`generating`:t===`done`?`completed`:t===`failed`?`failed`:e.status},Wt={optimizing:{color:`processing`,text:`优化中`,icon:(0,$.jsx)(Xm,{style:{animation:`spinSlow 1s linear infinite`}})},prompt_optimized:{color:`processing`,text:`待生成`,icon:(0,$.jsx)(cV,{})},generating:{color:`warning`,text:`生成中`,icon:(0,$.jsx)(Xm,{style:{animation:`spinSlow 1s linear infinite`}})},completed:{color:`success`,text:`已完成`,icon:(0,$.jsx)(d4,{})},failed:{color:`error`,text:`失败`,icon:(0,$.jsx)(m4,{})}},Gt=({label:e,value:t,options:n,suffix:r,expanded:i,onToggle:a,onSelect:o,onClose:s})=>{let c=(0,S.useRef)(null),l=(0,S.useRef)(null),u=(0,S.useRef)(i),[d,f]=(0,S.useState)(null);return u.current=i,(0,S.useEffect)(()=>{if(i&&c.current){let e=c.current.getBoundingClientRect();f({bottom:window.innerHeight-e.top+4,left:e.left,width:Math.max(e.width,100)})}else f(null)},[i]),(0,S.useEffect)(()=>{if(!i)return;let e=e=>{c.current?.contains(e.target)||l.current?.contains(e.target)||u.current&&s()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[i,s]),(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{ref:c,onClick:a,translate:`no`,style:{display:`flex`,alignItems:`center`,gap:6,padding:`5px 12px`,borderRadius:8,cursor:`pointer`,userSelect:`none`,transition:`background 0.2s, border-color 0.2s`,background:i?`rgba(99,102,241,0.08)`:`#f8f9fc`,border:i?`1px solid #6366f1`:`1px solid #e2e8f0`,minWidth:70,whiteSpace:`nowrap`,flexShrink:0},children:[(0,$.jsxs)(`span`,{style:{fontSize:12,color:`#6366f1`,fontWeight:500,lineHeight:`18px`},children:[t,r]}),(0,$.jsx)(YZ,{style:{fontSize:9,color:`#94a3b8`,transition:`transform 0.2s`,transform:i?`rotate(180deg)`:`rotate(0deg)`}})]}),d&&(0,Vi.createPortal)((0,$.jsxs)(`div`,{ref:l,style:{position:`fixed`,bottom:d.bottom,left:d.left,minWidth:d.width,background:`#fff`,borderRadius:12,padding:6,zIndex:99999,boxShadow:`0 8px 30px rgba(0,0,0,0.12)`,border:`1px solid #e2e8f0`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:10,color:`#94a3b8`,display:`block`,padding:`2px 6px 4px`},children:e}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:2},children:n.map((e,n)=>{let r=t===e;return(0,$.jsx)(`div`,{onClick:()=>{o(e),s()},style:{padding:`6px 10px`,borderRadius:8,fontSize:13,cursor:`pointer`,transition:`all 0.15s`,background:r?`linear-gradient(135deg, #6366f1, #8b5cf6)`:`transparent`,color:r?`#fff`:`#1a1a2e`,fontWeight:r?600:400},onMouseEnter:e=>{r||(e.currentTarget.style.background=`#f1f5f9`)},onMouseLeave:e=>{r||(e.currentTarget.style.background=`transparent`)},children:e},n)})})]}),document.body)]})},Kt=({group:e,selected:t,expanded:n,onToggle:r,onSelect:i,onClose:a})=>{let o=(0,S.useRef)(null),s=(0,S.useRef)(null),c=(0,S.useRef)(n),[l,u]=(0,S.useState)(null);return c.current=n,(0,S.useEffect)(()=>{if(n&&o.current){let e=o.current.getBoundingClientRect();u({bottom:window.innerHeight-e.top+4,left:e.left})}else u(null)},[n]),(0,S.useEffect)(()=>{if(!n)return;let e=e=>{o.current?.contains(e.target)||s.current?.contains(e.target)||c.current&&a()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[n,a]),(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{ref:o,onClick:r,style:{display:`flex`,alignItems:`center`,gap:6,padding:`5px 12px`,borderRadius:8,cursor:`pointer`,userSelect:`none`,transition:`all 0.2s`,background:t?`rgba(99,102,241,0.08)`:`#f8f9fc`,border:n?`1px solid #6366f1`:`1px solid #e2e8f0`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:t?`#6366f1`:`#64748b`,fontWeight:t?600:400},children:t||e.name}),(0,$.jsx)(YZ,{style:{fontSize:9,color:t?`#6366f1`:`#94a3b8`,transition:`transform 0.2s`,transform:n?`rotate(180deg)`:`rotate(0deg)`}})]}),l&&(0,Vi.createPortal)((0,$.jsxs)(`div`,{ref:s,style:{position:`fixed`,bottom:l.bottom,left:l.left,background:`#fff`,borderRadius:12,padding:8,minWidth:160,zIndex:99999,boxShadow:`0 8px 30px rgba(0,0,0,0.12)`,border:`1px solid #e2e8f0`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:10,color:`#94a3b8`,display:`block`,padding:`2px 6px 4px`},children:e.name}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:2},children:e.options.map((e,n)=>{let r=t===e;return(0,$.jsx)(`div`,{onClick:()=>{i(e),a()},style:{padding:`6px 10px`,borderRadius:8,fontSize:13,cursor:`pointer`,transition:`all 0.15s`,background:r?`linear-gradient(135deg, #6366f1, #8b5cf6)`:`transparent`,color:r?`#fff`:`#1a1a2e`,fontWeight:r?600:400},onMouseEnter:e=>{r||(e.currentTarget.style.background=`#f1f5f9`)},onMouseLeave:e=>{r||(e.currentTarget.style.background=`transparent`)},children:e},n)})})]}),document.body)]})};return(0,$.jsxs)(`div`,{style:{margin:`-24px -32px -32px`,borderRadius:20,height:`calc(100vh - 34px)`,padding:`24px`,background:`#fff`,overflowY:`auto`},children:[(0,$.jsxs)(`div`,{className:`gen-header animate-fadeInUp`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:24,padding:`16px 24px`,borderRadius:16,background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,border:`1px solid rgba(99, 102, 241, 0.08)`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16},children:[(0,$.jsx)(X,{icon:(0,$.jsx)(b2,{}),onClick:()=>t(`/projects`),style:{borderRadius:10,fontSize:13,height:32,background:`rgba(99, 102, 241, 0.1)`,border:`1px solid rgba(99, 102, 241, 0.2)`,color:`#6366f1`},children:`返回`}),(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #6366f1, #8b5cf6, transparent)`,borderRadius:1}}),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,$.jsx)(Q.Title,{level:4,style:{margin:0,fontSize:16,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:Dt}),Tt&&(0,$.jsx)(XQ,{style:{background:`rgba(99, 102, 241, 0.08)`,border:`1px solid rgba(99, 102, 241, 0.15)`,color:`#6366f1`,borderRadius:6},children:ae[Tt.industry]||Tt.industry})]}),(0,$.jsx)(Q.Text,{style:{color:`#64748b`,fontSize:13},children:`描述视频 → AI优化 → 生成视频`})]}),(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #8b5cf6, #6366f1, transparent)`,borderRadius:1}})]}),(0,$.jsxs)(XQ,{style:{background:`rgba(99, 102, 241, 0.08)`,border:`1px solid rgba(99, 102, 241, 0.15)`,color:`#6366f1`,borderRadius:20,fontSize:13,padding:`4px 14px`},children:[`剩余 `,kt,` 积分`]})]}),!p&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`animate-fadeInUp`,style:{marginBottom:24,padding:`16px 20px`,borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,boxShadow:`0 2px 12px rgba(0,0,0,0.03)`},children:(0,$.jsxs)(`div`,{style:{width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`flex-start`},children:[(0,$.jsxs)(`div`,{style:{marginRight:70,position:`relative`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:14,fontWeight:500,color:`#475569`,marginRight:16},children:`生成类型:`}),(0,$.jsxs)(jI.Group,{defaultValue:`video`,buttonStyle:`solid`,onChange:pt,children:[(0,$.jsxs)(jI.Button,{value:`video`,children:[(0,$.jsx)(t5,{style:{marginRight:6,fontSize:14}}),` `,`视频`]}),(0,$.jsxs)(jI.Button,{value:`image`,style:{zIndex:0},children:[(0,$.jsx)(R6,{style:{marginRight:6,fontSize:14}}),` `,`图片`]})]})]}),ke===`video`&&[{icon:(0,$.jsx)(M$,{}),label:`描述视频+时长`,color:`#6366f1`},{icon:(0,$.jsx)(W8,{}),label:`AI智能优化`,color:`#8b5cf6`},{icon:(0,$.jsx)(d8,{}),label:`选择参数生成`,color:`#10b981`}].map((e,t)=>(0,$.jsxs)(S.Fragment,{children:[t>0&&(0,$.jsx)(`div`,{style:{width:40,height:1,background:`linear-gradient(90deg, #e2e8f0, #cbd5e1, #e2e8f0)`,margin:`0 12px`,flexShrink:0}}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:10,background:`${e.color}12`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`span`,{style:{color:e.color,fontSize:15},children:e.icon})}),(0,$.jsx)(Q.Text,{style:{fontSize:13,fontWeight:500,color:`#1a1a2e`},children:e.label})]})]},t)),ke===`image`&&[{icon:(0,$.jsx)(M$,{}),label:`描述图片+尺寸`,color:`#6366f1`},{icon:(0,$.jsx)(W8,{}),label:`AI智能优化`,color:`#8b5cf6`},{icon:(0,$.jsx)(d8,{}),label:`图片生成`,color:`#10b981`}].map((e,t)=>(0,$.jsxs)(S.Fragment,{children:[t>0&&(0,$.jsx)(`div`,{style:{width:40,height:1,background:`linear-gradient(90deg, #e2e8f0, #cbd5e1, #e2e8f0)`,margin:`0 12px`,flexShrink:0}}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:10,background:`${e.color}12`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`span`,{style:{color:e.color,fontSize:15},children:e.icon})}),(0,$.jsx)(Q.Text,{style:{fontSize:13,fontWeight:500,color:`#1a1a2e`},children:e.label})]})]},t))]})}),(0,$.jsxs)(tU,{form:n,initialValues:{},children:[(0,$.jsx)(tU.Item,{name:`prompt`,noStyle:!0,rules:[{required:!0,message:`请输入视频描述`}],style:{display:`none`}}),(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{borderRadius:20,background:`#fff`,border:`1px solid #f0f0f5`,boxShadow:`0 4px 24px rgba(0,0,0,0.04)`,overflow:`visible`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`12px 16px 0`,minHeight:60},children:[B.map((e,t)=>(0,$.jsxs)(`div`,{className:`ref-thumb`,style:{position:`relative`,width:48,height:48,borderRadius:12,overflow:`visible`,flexShrink:0},children:[(0,$.jsx)(`div`,{style:{width:48,height:48,borderRadius:12,overflow:`hidden`,border:`1px solid #e2e8f0`,cursor:`pointer`},onClick:()=>{e.type===`video`&&me(`http://ceshi.apiforeign.minzhong.cn${e.url}`)},children:e.type===`image`?(0,$.jsx)(tW,{src:`http://ceshi.apiforeign.minzhong.cn${e.url}`,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(z7,{src:`http://ceshi.apiforeign.minzhong.cn${e.url}`})}),(0,$.jsx)(`div`,{className:`ref-delete`,onClick:n=>{n.stopPropagation(),k5(e.url).catch(()=>{}),V(e=>e.filter((e,n)=>n!==t))},style:{position:`absolute`,top:-4,right:-4,width:16,height:16,borderRadius:`50%`,background:`rgba(0,0,0,0.55)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,zIndex:10,opacity:0,transition:`opacity 0.15s`,backdropFilter:`blur(4px)`},children:(0,$.jsx)(m4,{style:{color:`#fff`,fontSize:10}})})]},t)),(0,$.jsx)(R7,{accept:`image/*,video/*`,onLocalSelect:e=>{e.forEach(async e=>{await qe(e)})},onHistorySelect:e=>{e.forEach(e=>{V(t=>[...t,{url:e.resourceUrl||e.previewUrl||e.displayUrl||``,type:e.resourceType,name:e.fileName||``}])}),Z.success(`成功添加${e.length}个历史记录`)},onPortraitSelect:e=>{e.forEach(e=>{V(t=>[...t,{url:e.previewUrl||``,type:e.assetType===`Video`?`video`:`image`,name:e.name||`真人素材`,source:`private_portrait_asset`,private_asset_id:e.id,label:``,duration:e.assetType===`Video`?e.videoDuration||0:void 0}])}),Z.success(`已添加 ${e.length} 个真人素材参考`)},uploading:H,tooltipTitle:`图片${B.filter(e=>e.type===`image`).length}/5,视频${B.filter(e=>e.type===`video`).length}/2`,maxImageCount:5,maxVideoCount:2,usedImageCount:B.filter(e=>e.type===`image`).length,usedVideoCount:B.filter(e=>e.type===`video`).length,usedVideoDuration:B.filter(e=>e.type===`video`).reduce((e,t)=>e+(t.duration||0),0),maxVideoDuration:15,children:(0,$.jsx)(`div`,{style:{width:48,height:48,borderRadius:12,border:`1.5px dashed #d9d9d9`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,transition:`all 0.2s`,flexShrink:0},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#6366f1`,e.currentTarget.style.background=`rgba(99,102,241,0.04)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`#d9d9d9`,e.currentTarget.style.background=`transparent`},children:H?(0,$.jsx)(Xm,{style:{fontSize:18,color:`#6366f1`}}):(0,$.jsx)(rL,{style:{fontSize:18,color:`#94a3b8`}})})})]}),(0,$.jsx)(`div`,{style:{padding:`8px 16px 4px`},children:(0,$.jsx)(IW.TextArea,{ref:ie,value:W,onChange:e=>{let t=e.target.value;ee(t),n.setFieldsValue({prompt:t});let r=t.lastIndexOf(`@`);if(r>=0){let e=t.slice(r+1);if(!e.includes(` `)&&!e.includes(` -`)){G(!0),re(e);return}}G(!1)},onPaste:e=>{let t=e.clipboardData?.items;if(!t)return;let n=[];for(let e=0;e0&&(e.preventDefault(),n.forEach(async e=>{await qe(e)}))},rows:3,placeholder:`上传参考素材(只用做模型理解,不参与生成)、输入文字,自由组合图、文多元素。输入 @ 可引用参考内容...`,maxLength:500,bordered:!1,autoSize:{minRows:2,maxRows:6},style:{padding:`6px 2px`,fontSize:15,lineHeight:1.7,resize:`none`,caretColor:`#6366f1`}})}),te&&B.length>0&&(0,$.jsx)(`div`,{style:{margin:`0 16px 8px`,background:`#fff`,borderRadius:10,boxShadow:`0 6px 24px rgba(0,0,0,0.12)`,border:`1px solid #e2e8f0`,padding:6,maxHeight:180,overflowY:`auto`},children:B.filter(e=>!ne||e.name.includes(ne)).map((e,t)=>(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,padding:`8px 10px`,borderRadius:8,cursor:`pointer`,transition:`background 0.15s`},onMouseEnter:e=>e.currentTarget.style.background=`#f1f5f9`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,onMouseDown:t=>{t.preventDefault();let r=ie.current?.resizableTextArea?.textArea||ie.current?.nativeElement?.querySelector(`textarea`)||ie.current;if(!r||!r.value)return;let i=r.value,a=i.lastIndexOf(`@`),o=i.slice(0,a)+`@${e.name} `;ee(o),n.setFieldValue(`prompt`,o),G(!1),setTimeout(()=>{r.focus(),r.selectionStart=o.length,r.selectionEnd=o.length},50)},children:[(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:8,overflow:`hidden`,background:e.type===`image`?`#f1f5f9`:`#1a1a2e`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0},children:e.type===`image`?(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn${e.url}`,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(q6,{style:{color:`#fff`,fontSize:14}})}),(0,$.jsx)(Q.Text,{style:{fontSize:13},children:e.name}),(0,$.jsx)(XQ,{style:{marginLeft:`auto`,fontSize:11},children:e.type===`image`?`图片`:`视频`})]},t))}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`8px 12px 12px`,gap:8,flexWrap:`wrap`,position:`relative`,zIndex:50,minHeight:48},children:[ke!==`image`&&(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,flex:1,flexWrap:`wrap`},children:[(0,$.jsx)(Gt,{label:`时长`,value:`${he}`,options:Ce.durations.map(e=>`${e}`),suffix:`秒`,expanded:xe===`duration`,onToggle:()=>Se(xe===`duration`?null:`duration`),onSelect:e=>ge(parseInt(e)),onClose:()=>Se(null)}),Ot.map((e,t)=>{let n=le===e.name,r=se[e.name];return(0,$.jsx)(Kt,{group:e,selected:r,expanded:n,onToggle:()=>ue(n?null:e.name),onSelect:t=>{ce(n=>{let r={...n};return r[e.name]===t?delete r[e.name]:r[e.name]=t,r})},onClose:()=>ue(null)},`og-${t}`)})]}),ke==`image`&&(0,$.jsxs)(`div`,{style:{position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>Be(!ze),className:`image-settings-trigger`,style:{minWidth:220,padding:`0px 16px`,height:30,borderRadius:10,border:`1px solid #e2e8f0`,backgroundColor:`#f8f9fc`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,transition:`all 0.2s`},children:[(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:(0,$.jsxs)(`div`,{style:{textAlign:`left`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:13,fontWeight:600,color:`#374151`,marginRight:10},children:je===`auto`?`智能`:je}),(0,$.jsxs)(Q.Text,{style:{fontSize:12,color:`#9ca3af`},children:[Ne===`1K`?`标清 1K`:Ne===`2K`?`高清 2K`:`${Ne}分辨率`,`| `,Fe,`×`,Le]})]})}),(0,$.jsx)(YZ,{style:{fontSize:14,color:`#9ca3af`}})]}),ze&&(0,$.jsxs)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:0,width:520,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:20,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(`div`,{style:{marginBottom:20},children:[(0,$.jsx)(Q.Text,{style:{display:`block`,marginBottom:10,fontSize:13,fontWeight:500,color:`#666666`},children:`选择比例`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:6},children:et.map(e=>(0,$.jsxs)(`button`,{onClick:()=>{Me(e.value),Ze(e.label)},style:{flex:`0 0 calc(11.11% - 5px)`,minWidth:48,height:56,borderRadius:8,border:je===e.value?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:je===e.value?`#fff`:`#f9fafb`,cursor:`pointer`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:[(0,$.jsx)(`div`,{style:{width:(()=>{let[t,n]=e.value===`auto`?[1,1]:e.value.split(`:`).map(Number);return t>=n?20:Math.round(t/n*20)})(),height:(()=>{let[t,n]=e.value===`auto`?[1,1]:e.value.split(`:`).map(Number);return n>=t?20:Math.round(n/t*20)})(),border:`2px solid ${je===e.value?`#6366f1`:`#9ca3af`}`,borderRadius:(e.value,3),marginBottom:3,display:`flex`,alignItems:`center`,justifyContent:`center`},children:e.value===`auto`&&(0,$.jsx)(`span`,{style:{fontSize:8,color:je===e.value?`#6366f1`:`#9ca3af`},children:`智`})}),(0,$.jsx)(`span`,{style:{fontSize:10,color:je===e.value?`#6366f1`:`#6b7280`,fontWeight:je===e.value?600:400},children:e.value})]},e.value))})]}),(0,$.jsxs)(`div`,{style:{marginBottom:20},children:[(0,$.jsx)(Q.Text,{style:{display:`block`,marginBottom:10,fontSize:13,fontWeight:500,color:`#666666`},children:`选择分辨率`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:8},children:nt.map(e=>(0,$.jsx)(`button`,{onClick:()=>{Pe(e.value),Qe(e.label)},style:{flex:1,height:48,borderRadius:8,border:Ne===e.value?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:Ne===e.value?`#6366f1`:`#f9fafb`,cursor:`pointer`,display:`flex`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:(0,$.jsxs)(`span`,{style:{fontSize:13,fontWeight:600,color:Ne===e.value?`#fff`:`#4b5563`},children:[e.value,e.value===`4k`&&(0,$.jsx)(`span`,{style:{marginLeft:3},children:`✨`})]})},e.value))})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Text,{style:{display:`block`,marginBottom:10,fontSize:13,fontWeight:500,color:`#666666`},children:`尺寸`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,flex:1,maxWidth:140},children:[(0,$.jsx)(`span`,{style:{color:`#9ca3af`,fontSize:12,marginRight:6},children:`W`}),(0,$.jsx)(IW,{value:Fe,onChange:e=>Ie(Number(e.target.value)||0),style:{flex:1,textAlign:`center`,borderRadius:6,height:40,border:`1px solid #e5e7eb`,backgroundColor:`#f9fafb`,fontSize:14,fontWeight:600,color:`#1f2937`}})]}),(0,$.jsx)(`button`,{onClick:ft,style:{width:28,height:28,borderRadius:6,border:`1px solid #e5e7eb`,backgroundColor:`#fff`,cursor:`pointer`,display:`flex`,justifyContent:`center`,alignItems:`center`,color:`#6366f1`},children:(0,$.jsx)(BU,{style:{fontSize:12}})}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,flex:1,maxWidth:140},children:[(0,$.jsx)(`span`,{style:{color:`#9ca3af`,fontSize:12,marginRight:6},children:`H`}),(0,$.jsx)(IW,{value:Le,onChange:e=>Re(Number(e.target.value)||0),style:{flex:1,textAlign:`center`,borderRadius:6,height:40,border:`1px solid #e5e7eb`,backgroundColor:`#f9fafb`,fontSize:14,fontWeight:600,color:`#1f2937`}})]}),(0,$.jsx)(`span`,{style:{color:`#9ca3af`,fontSize:12},children:`PX`})]})]})]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,flexShrink:0},children:[ke===`image`&&(0,$.jsx)(`span`,{style:{color:`#7c7c7c`,fontSize:14},children:`(请在左侧选择图片比例和尺寸)`}),(0,$.jsx)(X,{type:`primary`,size:`large`,onClick:Nt,loading:d,style:{borderRadius:10,fontWeight:600,minWidth:140,height:40,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,boxShadow:`0 4px 16px rgba(99,102,241,0.35)`},children:`AI优化提示词`})]})]})]})]})]}),p&&h&&(0,$.jsxs)(DL,{className:`animate-fadeInUp`,style:{borderRadius:16},styles:{body:{padding:`24px 28px`}},children:[!w[h.id]||w[h.id]===`idle`?(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14,marginBottom:24,padding:`14px 18px`,borderRadius:12,background:`linear-gradient(135deg, rgba(16,185,129,0.06), rgba(5,150,105,0.06))`,border:`1px solid rgba(16,185,129,0.15)`},children:[(0,$.jsx)(d4,{style:{color:`#10b981`,fontSize:22}}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:15,display:`block`},children:`提示词优化完成`}),(0,$.jsxs)(Q.Text,{style:{fontSize:12,color:`#94a3b8`},children:[`文本优化消耗 `,Te,` 积分· 您可以编辑提示词后选择参数生成视频`]})]})]}):(0,$.jsxs)(`div`,{style:{marginBottom:24,padding:`16px 18px`,borderRadius:12,display:`flex`,alignItems:`center`,gap:12,background:w[h.id]===`failed`?`rgba(239,68,68,0.04)`:w[h.id]===`done`?`rgba(16,185,129,0.04)`:`rgba(99,102,241,0.04)`,border:`1px solid ${w[h.id]===`failed`?`rgba(239,68,68,0.12)`:w[h.id]===`done`?`rgba(16,185,129,0.12)`:`rgba(99,102,241,0.12)`}`},children:[w[h.id]===`generating`&&(0,$.jsx)(Xm,{style:{color:`#6366f1`,fontSize:18},spin:!0}),w[h.id]===`done`&&(0,$.jsx)(d4,{style:{color:`#10b981`,fontSize:18}}),w[h.id]===`failed`&&(0,$.jsx)(m4,{style:{color:`#ef4444`,fontSize:18}}),(0,$.jsxs)(Q.Text,{strong:!0,style:{fontSize:14,color:w[h.id]===`failed`?`#ef4444`:w[h.id]===`done`?`#10b981`:`#6366f1`},children:[w[h.id]===`generating`&&(0,$.jsxs)(`span`,{children:[ke===`image`?`图片`:`视频`,`生成中,请稍候...`,(0,$.jsxs)(`span`,{style:{marginLeft:8,fontSize:14,fontWeight:700,color:`#6366f1`,textShadow:`0 0 8px rgba(99, 102, 241, 0.3)`},children:[Math.round(O[h.id]||0),`%`]})]}),w[h.id]===`done`&&`${ke===`image`?`图片`:`视频`}生成成功`,w[h.id]===`failed`&&`${ke===`image`?`图片`:`视频`}生成失败,请重试`]})]}),!w[h.id]||w[h.id]===`idle`||w[h.id]===`failed`?(0,$.jsxs)(`div`,{className:`gen-prompt-row`,style:{display:`flex`,gap:20,flexWrap:`wrap`},children:[(0,$.jsxs)(`div`,{style:{flex:`1 1 45%`,minWidth:240},children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:8},children:`原始提示词`}),(0,$.jsx)(`div`,{style:{padding:14,borderRadius:12,background:`#f8f9fc`,border:`1px solid #f0f0f5`,minHeight:100},children:(0,$.jsx)(Q.Text,{style:{fontSize:14,color:`#64748b`,lineHeight:1.7},children:h.originalPrompt})})]}),(0,$.jsxs)(`div`,{style:{flex:`1 1 45%`,minWidth:240},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:8},children:[(0,$.jsxs)(Q.Text,{style:{fontSize:12,color:`#94a3b8`},children:[`优化后的提示词`,` `,!y&&(0,$.jsx)(`span`,{style:{color:`#6366f1`},children:`(可编辑)`})]}),!y&&(0,$.jsxs)(sH,{size:4,children:[(0,$.jsx)(gw,{title:`复制`,children:(0,$.jsx)(X,{type:`text`,size:`small`,icon:(0,$.jsx)(t1,{}),onClick:async()=>{let e=await k7(_);Z.success(e?`已复制`:`复制失败`)},style:{color:`#94a3b8`}})}),(0,$.jsx)(gw,{title:`编辑`,children:(0,$.jsx)(X,{type:`text`,size:`small`,icon:(0,$.jsx)(M$,{}),onClick:()=>b(!0),style:{color:`#6366f1`}})})]})]}),y?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(IW.TextArea,{value:_,onChange:e=>v(e.target.value),rows:5,style:{borderRadius:12,fontSize:14,lineHeight:1.7,border:`1px solid rgba(99,102,241,0.25)`,background:`rgba(99,102,241,0.02)`}}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,marginTop:8},children:[(0,$.jsx)(X,{size:`small`,onClick:()=>{v(h.optimizedPrompt||``),b(!1)},children:`取消`}),(0,$.jsx)(X,{size:`small`,type:`primary`,onClick:()=>{b(!1),Z.success(`提示词已更新`)},style:{borderRadius:6,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`},children:`保存`})]})]}):(0,$.jsx)(`div`,{style:{padding:14,borderRadius:12,background:`rgba(99,102,241,0.02)`,border:`1px solid rgba(99,102,241,0.1)`,minHeight:100},children:(0,$.jsx)(Q.Text,{style:{fontSize:14,color:`#1a1a2e`,lineHeight:1.7},children:_})})]})]}):(0,$.jsxs)(`div`,{className:`gen-prompt-row`,style:{display:`flex`,gap:24,flexWrap:`wrap`},children:[(0,$.jsxs)(`div`,{style:{flex:`1 1 55%`,minWidth:280},children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:8},children:`原始提示词`}),(0,$.jsx)(`div`,{style:{padding:14,borderRadius:12,background:`#f8f9fc`,border:`1px solid #f0f0f5`,minHeight:80},children:(0,$.jsx)(Q.Text,{style:{fontSize:13,color:`#64748b`,lineHeight:1.6},children:h.originalPrompt})})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:8},children:[(0,$.jsxs)(Q.Text,{style:{fontSize:12,color:`#94a3b8`},children:[`优化后的提示词`,` `,!y&&(0,$.jsx)(`span`,{style:{color:`#6366f1`},children:`(可编辑)`})]}),!y&&(0,$.jsxs)(sH,{size:4,children:[(0,$.jsx)(gw,{title:`复制`,children:(0,$.jsx)(X,{type:`text`,size:`small`,icon:(0,$.jsx)(t1,{}),onClick:async()=>{let e=await k7(_);Z.success(e?`已复制`:`复制失败`)},style:{color:`#94a3b8`}})}),(0,$.jsx)(gw,{title:`编辑`,children:(0,$.jsx)(X,{type:`text`,size:`small`,icon:(0,$.jsx)(M$,{}),onClick:()=>b(!0),style:{color:`#6366f1`}})})]})]}),y?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(IW.TextArea,{value:_,onChange:e=>v(e.target.value),rows:5,style:{borderRadius:12,fontSize:13,lineHeight:1.6,border:`1px solid rgba(99,102,241,0.25)`,background:`rgba(99,102,241,0.02)`}}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,marginTop:8},children:[(0,$.jsx)(X,{size:`small`,onClick:()=>{v(h.optimizedPrompt||``),b(!1)},children:`取消`}),(0,$.jsx)(X,{size:`small`,type:`primary`,onClick:()=>{b(!1),Z.success(`提示词已更新`)},style:{borderRadius:6,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`},children:`保存`})]})]}):(0,$.jsx)(`div`,{style:{padding:14,borderRadius:12,background:`rgba(99,102,241,0.02)`,border:`1px solid rgba(99,102,241,0.1)`,minHeight:120},children:(0,$.jsx)(Q.Text,{style:{fontSize:13,color:`#1a1a2e`,lineHeight:1.6},children:_})})]})]}),(0,$.jsxs)(`div`,{style:{flex:`1 1 40%`,minWidth:280},children:[h.videoUrl&&(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:8},children:`生成视频`}),(0,$.jsx)(`div`,{style:{borderRadius:12,overflow:`hidden`,border:`1px solid #f0f0f5`,background:`#000`},children:(0,$.jsx)(`video`,{src:`http://ceshi.apiforeign.minzhong.cn${h.videoUrl}`,controls:!0,style:{width:`100%`,maxHeight:350,display:`block`}})})]}),h.imageUrl&&(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:8},children:`生成图片`}),(0,$.jsx)(tW,{src:`http://ceshi.apiforeign.minzhong.cn${h.imageUrl}`,style:{width:`100%`,maxHeight:350,objectFit:`contain`,borderRadius:12,border:`1px solid #f0f0f5`},preview:!0})]})]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginTop:20,padding:`14px 18px`,borderRadius:12,background:`#f8f9fc`,border:`1px solid #f0f0f5`},children:[ke!==`image`&&(0,$.jsxs)(`div`,{style:{marginTop:24,borderRadius:12,background:`#f8f9fc`,width:`25%`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:13,color:`#1a1a2e`,fontWeight:600,display:`block`,marginBottom:12},children:`选择视频参数`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,flexWrap:`wrap`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,padding:`5px 12px`,borderRadius:8,background:`#f8f9fc`,border:`1px solid #e2e8f0`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#94a3b8`},children:`时长`}),(0,$.jsxs)(Q.Text,{strong:!0,style:{fontSize:13,color:`#6366f1`},children:[he,`s`]})]}),(0,$.jsx)(Gt,{label:`比例`,value:_e,options:Ce.ratios,expanded:xe===`ratio`,onToggle:()=>Se(xe===`ratio`?null:`ratio`),onSelect:e=>ve(e),onClose:()=>Se(null)}),(0,$.jsx)(Gt,{label:`分辨率`,value:ye,options:Ce.resolutions,expanded:xe===`resolution`,onToggle:()=>Se(xe===`resolution`?null:`resolution`),onSelect:e=>be(e),onClose:()=>Se(null)})]})]}),ke==`image`&&h&&(0,$.jsx)(`div`,{style:{marginTop:24,borderRadius:12,background:`#f8f9fc`,width:`25%`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-around`},children:[(0,$.jsxs)(`div`,{style:{textAlign:`center`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`,marginBottom:4},children:`分辨率`}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:14,color:`#1a1a2e`},children:h.imageSize||`-`})]}),(0,$.jsxs)(`div`,{style:{textAlign:`center`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`,marginBottom:4},children:`画面比例`}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:14,color:`#1a1a2e`},children:h.imageProportion||`-`})]}),(0,$.jsxs)(`div`,{style:{textAlign:`center`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`,marginBottom:4},children:`画面尺寸`}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:14,color:`#1a1a2e`},children:h.imagePx||`-`})]})]})}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16},children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:`文字积分`}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:14,color:`#6366f1`},children:Te})]}),(0,$.jsx)(Q.Text,{style:{color:`#cbd5e1`,fontSize:18},children:`+`}),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:[`预估`,ke===`image`?`图片`:`视频`,`积分`]}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:14,color:`#10b981`},children:ke===`image`&&h.imageSize?At(h.imageSize)||jt:Je(he,ye)})]}),(0,$.jsx)(Q.Text,{style:{color:`#cbd5e1`,fontSize:18},children:`=`}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:`总计`}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:16,color:`#1a1a2e`},children:(Te+(ke===`image`?At(h.imageSize):Je(he,ye))).toFixed(2)})]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:12},children:[(0,$.jsxs)(X,{size:`large`,onClick:()=>{m(!1),g(null),v(``),ee(``),V([]),ce({}),ue(null),Se(null),n.resetFields()},style:{borderRadius:12,minWidth:120,height:44,fontWeight:500},children:[`配置新`,ke===`image`?`图片`:`视频`]}),(0,$.jsx)(gw,{title:Mt?``:`积分不足`,children:(0,$.jsx)(X,{type:`primary`,size:`large`,icon:(0,$.jsx)(d8,{}),onClick:()=>Ht(h.id),loading:w[h.id]===`generating`,disabled:!Mt||w[h.id]===`generating`||w[h.id]===`done`,style:{borderRadius:12,minWidth:180,height:44,fontWeight:600,background:w[h.id]===`done`?`#10b981`:Mt?`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`:`#d1d5db`,border:`none`,boxShadow:Mt?`0 8px 24px rgba(99,102,241,0.3)`:`none`},children:w[h.id]===`done`?`生成完成`:w[h.id]===`generating`?`生成中...`:`生成${ke===`image`?`图片`:`视频`} (${ke===`image`?At(h.imageSize):Je(he,ye)}积分)`})})]})]}),h.references&&h.references.length>0&&(0,$.jsxs)(`div`,{style:{marginTop:16},children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:8},children:`参考内容`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`},children:h.references.map((e,t)=>(0,$.jsxs)(`div`,{style:{width:64,height:64,borderRadius:10,overflow:`hidden`,border:`1px solid #e2e8f0`,position:`relative`,cursor:`pointer`},onClick:()=>{e.type===`video`&&me(`http://ceshi.apiforeign.minzhong.cn${e.url}`)},children:[e.type===`image`?(0,$.jsx)(tW,{src:`http://ceshi.apiforeign.minzhong.cn${e.url}`,style:{width:`100%`,height:`100%`,objectFit:`cover`},preview:!0}):(0,$.jsx)(z7,{src:`http://ceshi.apiforeign.minzhong.cn${e.url}`,width:64,height:64}),(0,$.jsx)(XQ,{style:{position:`absolute`,bottom:0,left:0,right:0,margin:0,fontSize:9,textAlign:`center`,borderRadius:`0 0 8px 8px`,background:`rgba(0,0,0,0.5)`,border:`none`,color:`#fff`,padding:`0 2px`},children:e.name})]},t))})]})]}),Et.length>0&&(0,$.jsxs)(`div`,{style:{marginTop:24},children:[(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:15,display:`block`,marginBottom:12},children:`本项目生成记录`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8,background:`#fff`,borderRadius:12,padding:8,border:`1px solid #f0f0f5`},className:`stagger-children`,children:Et.map((e,t)=>{let n=Ut(e),r=P[e.id]??(e.optimizedPrompt||e.originalPrompt),i=R===e.id,a=e.genType||`image`;return(0,$.jsxs)(`div`,{className:`animate-slideInCard`,style:{animationDelay:`${t*.05}s`},children:[(0,$.jsxs)(`div`,{className:`record-item`,onClick:()=>z(i?null:e.id),style:{padding:`12px 16px`,borderRadius:i?`8px 8px 0 0`:8,background:`#fafafa`,cursor:`pointer`,transition:`all 0.2s`,display:`flex`,alignItems:`center`,gap:10},children:[(0,$.jsx)(`div`,{style:{width:28,height:28,borderRadius:8,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,background:a===`image`?`#fef3c7`:`#dbeafe`},children:a===`image`?(0,$.jsx)(R6,{style:{color:`#d97706`,fontSize:12}}):(0,$.jsx)(t5,{style:{color:`#2563eb`,fontSize:12}})}),i?(0,$.jsx)(YZ,{style:{color:`#6366f1`,fontSize:11,flexShrink:0}}):(0,$.jsx)(c4,{style:{color:`#cbd5e1`,fontSize:11,flexShrink:0}}),(0,$.jsx)(XQ,{color:Wt[n]?.color,icon:Wt[n]?.icon,style:{margin:0},children:Wt[n]?.text}),(0,$.jsx)(Q.Text,{style:{flex:1,fontSize:13,color:`#475569`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:r}),n===`prompt_optimized`&&(0,$.jsx)(XQ,{color:`processing`,style:{padding:`3px 10px`,fontSize:12,margin:0,flexShrink:0},children:`待配置`}),a===`image`?(0,$.jsxs)(`span`,{className:`mobile-meta`,translate:`no`,style:{fontSize:12,color:`#94a3b8`,flexShrink:0},children:[e.duration?`${e.imageSize}`:`-`,` ·`,` `,e.imageProportion||`-`,` ·`,` `,e.imagePx||`-`,` ·`,` `,(0,$.jsx)(`span`,{className:`date-display`,translate:`no`,children:T7(e.createdAt)})]}):(0,$.jsxs)(`span`,{className:`mobile-meta`,translate:`no`,style:{fontSize:12,color:`#94a3b8`,flexShrink:0},children:[e.duration?`${e.duration}秒`:`-`,` ·`,` `,e.aspectRatio||`-`,` · `,e.resolution||`-`,` `,`·`,` `,(0,$.jsx)(`span`,{className:`date-display`,translate:`no`,children:T7(e.createdAt)})]}),(0,$.jsx)(`div`,{className:`record-actions`,onClick:e=>e.stopPropagation()})]}),i&&(0,$.jsx)(`div`,{style:{background:`#fff`,borderRadius:`0 0 8px 8px`,padding:`18px 20px`,animation:`fadeInUp 0.25s ease both`},children:(0,$.jsxs)(`div`,{className:`gen-detail-row`,style:{display:`flex`,gap:20,flexWrap:`wrap`},children:[(0,$.jsxs)(`div`,{style:{flex:`1 1 50%`,minWidth:260},children:[(0,$.jsxs)(`div`,{style:{marginBottom:14},children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:6},children:`原始提示词`}),(0,$.jsx)(`div`,{style:{padding:12,borderRadius:10,background:`#f8f9fc`,border:`1px solid #f0f0f5`},children:(0,$.jsx)(Q.Text,{style:{fontSize:13,color:`#64748b`,lineHeight:1.7},children:e.originalPrompt})})]}),(0,$.jsxs)(`div`,{style:{marginBottom:14},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:6},children:[(0,$.jsxs)(Q.Text,{style:{fontSize:12,color:`#94a3b8`},children:[`优化后的提示词`,` `,(n===`prompt_optimized`||n===`failed`)&&I!==e.id&&(0,$.jsx)(`span`,{style:{color:`#6366f1`},children:`(可编辑)`})]}),I!==e.id&&(0,$.jsxs)(sH,{size:4,children:[(0,$.jsx)(gw,{title:`复制`,children:(0,$.jsx)(X,{type:`text`,size:`small`,icon:(0,$.jsx)(t1,{}),onClick:async()=>{let e=await k7(r);Z.success(e?`已复制`:`复制失败`)},style:{color:`#94a3b8`}})}),(n===`prompt_optimized`||n===`failed`)&&(0,$.jsx)(gw,{title:`编辑`,children:(0,$.jsx)(X,{type:`text`,size:`small`,icon:(0,$.jsx)(M$,{}),onClick:()=>{L(e.id),F(t=>({...t,[e.id]:t[e.id]??e.optimizedPrompt??``}))},style:{color:`#6366f1`}})})]})]}),I===e.id?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(IW.TextArea,{value:r,onChange:t=>F(n=>({...n,[e.id]:t.target.value})),rows:4,style:{borderRadius:10,fontSize:13,lineHeight:1.7,border:`1px solid rgba(99,102,241,0.25)`,background:`rgba(99,102,241,0.02)`}}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,marginTop:8},children:[(0,$.jsx)(X,{size:`small`,onClick:()=>L(null),children:`取消`}),(0,$.jsx)(X,{size:`small`,type:`primary`,onClick:()=>{F(t=>({...t,[e.id]:r})),L(null),Z.success(`提示词已更新`)},style:{borderRadius:6,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`},children:`保存`})]})]}):(0,$.jsx)(`div`,{style:{padding:12,borderRadius:10,background:n===`prompt_optimized`?`rgba(99,102,241,0.02)`:`#f8f9fc`,border:n===`prompt_optimized`?`1px solid rgba(99,102,241,0.1)`:`1px solid #f0f0f5`},children:(0,$.jsx)(Q.Text,{style:{fontSize:13,color:`#1a1a2e`,lineHeight:1.7},children:r})})]}),a===`image`?(0,$.jsx)(`div`,{style:{display:`flex`,gap:14,padding:`10px 14px`,borderRadius:10,background:`#f8f9fc`},children:[{label:`文字积分`,value:`${e.textCreditsCost||0}`},{label:`图片积分`,value:`${e.creditsCost||0}`},{label:`分辨率`,value:e.imageSize?`${e.imageSize}`:`-`},{label:`比例`,value:e.imageProportion||`-`},{label:`尺寸`,value:e.imagePx||`-`}].map((e,t)=>(0,$.jsxs)(`div`,{style:{flex:1},children:[(0,$.jsx)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:e.label}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:13,color:`#1a1a2e`},children:e.value})]},t))}):(0,$.jsx)(`div`,{style:{display:`flex`,gap:14,padding:`10px 14px`,borderRadius:10,background:`#f8f9fc`},children:[{label:`文字积分`,value:`${e.textCreditsCost||0}`},{label:`视频积分`,value:`${e.creditsCost||0}`},{label:`时长`,value:e.duration?`${e.duration}秒`:`-`},{label:`比例`,value:e.aspectRatio||`-`},{label:`分辨率`,value:e.resolution||`-`}].map((e,t)=>(0,$.jsxs)(`div`,{style:{flex:1},children:[(0,$.jsx)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:e.label}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:13,color:`#1a1a2e`},children:e.value})]},t))}),(e.references&&e.references.length>0||n===`failed`)&&(0,$.jsxs)(`div`,{style:{marginTop:14},children:[(0,$.jsxs)(Q.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:8},children:[`参考素材`,` `,n===`failed`&&(0,$.jsx)(`span`,{style:{color:`#6366f1`},children:`(可删除/添加后重试)`})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`},children:[e.references?.map((t,r)=>(0,$.jsxs)(`div`,{style:{width:64,height:64,borderRadius:10,overflow:`visible`,border:`1px solid #e2e8f0`,position:`relative`,cursor:`pointer`},onClick:()=>{t.type===`video`&&me(`http://ceshi.apiforeign.minzhong.cn${t.url}`)},children:[(0,$.jsx)(`div`,{style:{width:64,height:64,borderRadius:10,overflow:`hidden`},children:t.type===`image`?(0,$.jsx)(tW,{src:`http://ceshi.apiforeign.minzhong.cn${t.url}`,style:{width:`100%`,height:`100%`,objectFit:`cover`},preview:!0}):(0,$.jsx)(z7,{src:`http://ceshi.apiforeign.minzhong.cn${t.url}`,width:64,height:64})}),(0,$.jsx)(XQ,{style:{position:`absolute`,bottom:0,left:0,right:0,margin:0,fontSize:9,textAlign:`center`,borderRadius:`0 0 8px 8px`,background:`rgba(0,0,0,0.5)`,border:`none`,color:`#fff`,padding:`0 2px`},children:t.name}),n===`failed`&&(0,$.jsx)(`div`,{className:`ref-delete`,onClick:n=>{n.stopPropagation(),k5(t.url).catch(()=>{});let i=e.references.filter((e,t)=>t!==r);C7.getState().updateRecordReferences(e.id,i)},style:{position:`absolute`,top:-4,right:-4,width:16,height:16,borderRadius:`50%`,background:`rgba(239,68,68,0.8)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,zIndex:10,opacity:0,transition:`opacity 0.15s`},children:(0,$.jsx)(m4,{style:{color:`#fff`,fontSize:10}})})]},r)),n===`failed`&&(0,$.jsx)(b0,{accept:`image/*,video/*`,showUploadList:!1,multiple:!0,beforeUpload:t=>{let n=t.type.startsWith(`image/`),r=t.type.startsWith(`video/`);return!n&&!r?(Z.error(`仅支持图片或视频文件`),!1):(n?E5(t).then(n=>{let r={url:n.url,type:`image`,name:t.name||`图片`},i=e.references||[];C7.getState().updateRecordReferences(e.id,[...i,r]),Z.success(`上传成功`)}).catch(()=>Z.error(`上传失败`)):new Promise(e=>{let n=document.createElement(`video`);n.preload=`metadata`,n.onloadedmetadata=()=>{e(n.duration||0),n.remove()},n.onerror=()=>{e(0),n.remove()},n.src=URL.createObjectURL(t)}).then(n=>{D5(t,n).then(r=>{let i={url:r.url,type:`video`,name:t.name||`视频`,duration:n||void 0},a=e.references||[];C7.getState().updateRecordReferences(e.id,[...a,i]),Z.success(`上传成功`)}).catch(()=>Z.error(`上传失败`))}),!1)},children:(0,$.jsx)(gw,{title:`添加参考素材`,children:(0,$.jsx)(`div`,{style:{width:64,height:64,borderRadius:10,border:`1.5px dashed #d9d9d9`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,transition:`all 0.2s`},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#6366f1`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`#d9d9d9`},children:(0,$.jsx)(rL,{style:{fontSize:18,color:`#94a3b8`}})})})})]})]})]}),(0,$.jsxs)(`div`,{style:{flex:`1 1 40%`,minWidth:220,position:`relative`},children:[n===`prompt_optimized`&&(0,$.jsxs)(`div`,{style:{marginTop:16,position:`absolute`,top:0,left:0,width:`100%`,height:`100%`,backgroundColor:`transparent`},children:[a===`video`&&(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,flexWrap:`wrap`,marginBottom:12},children:[(0,$.jsxs)(`div`,{translate:`no`,style:{display:`flex`,alignItems:`center`,gap:6,padding:`5px 12px`,borderRadius:8,background:`#f8f9fc`,border:`1px solid #e2e8f0`,marginLeft:12},children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#94a3b8`},children:`时长`}),(0,$.jsxs)(Q.Text,{strong:!0,style:{fontSize:13,color:`#6366f1`},children:[e.duration,`秒`]})]}),(0,$.jsx)(Gt,{label:`比例`,value:de[e.id]?.aspectRatio||`选择比例`,options:Ce.ratios,expanded:xe===`ratio-${e.id}`,onToggle:()=>Se(xe===`ratio-${e.id}`?null:`ratio-${e.id}`),onSelect:t=>fe(n=>({...n,[e.id]:{...n[e.id],aspectRatio:t,resolution:n[e.id]?.resolution||``}})),onClose:()=>Se(null)}),(0,$.jsx)(Gt,{label:`分辨率`,value:de[e.id]?.resolution||`选择分辨率`,options:Ce.resolutions,expanded:xe===`res-${e.id}`,onToggle:()=>Se(xe===`res-${e.id}`?null:`res-${e.id}`),onSelect:t=>fe(n=>({...n,[e.id]:{...n[e.id],aspectRatio:n[e.id]?.aspectRatio||``,resolution:t}})),onClose:()=>Se(null)})]}),(0,$.jsxs)(X,{type:`primary`,size:`large`,icon:(0,$.jsx)(d8,{}),block:!0,loading:x[e.id],disabled:a===`video`&&(!de[e.id]?.aspectRatio||!de[e.id]?.resolution),onClick:async()=>{let t=de[e.id];if(a===`video`){if(!t?.aspectRatio||!t?.resolution){Z.error(`请选择比例和分辨率`);return}if(kt({...t,[e.id]:!0})),T(t=>({...t,[e.id]:`generating`}));let n=a===`video`?`视频`:`图片`;Z.loading({content:`「${Dt}」正在生成${n}...`,duration:0,key:e.id});try{await c(e.id,{aspectRatio:t?.aspectRatio,resolution:t?.resolution}),Vt(e.id),Z.success({content:`「${Dt}」${n}已提交,正在生成中...`,key:e.id,duration:3})}catch(t){T(t=>({...t,[e.id]:`failed`}));let r=t?.response?.data?.message||t?.message||`${n}生成失败`;Z.error({content:`「${Dt}」${r}`,key:e.id,duration:3})}finally{C(t=>({...t,[e.id]:!1}))}},style:{borderRadius:12,fontWeight:600,color:`#fff`,height:48,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,position:`absolute`,bottom:18,left:0},children:[`生成`,a===`video`?`视频`:`图片`,a===`video`?(0,$.jsx)(`span`,{style:{color:`#d2d2d2`,fontSize:`14px`,marginLeft:`6px`},children:`(请选择上方的比例分辨率)`}):``,` `,a===`video`&&de[e.id]?.resolution?`(${Je(e.duration||5,de[e.id].resolution)}积分)`:``,a===`image`&&e.imageSize?`(${Xe(e.imageSize)}积分)`:a===`image`?`(积分)`:``]})]}),n===`failed`&&(0,$.jsx)(`div`,{style:{position:`absolute`,bottom:18,right:20}}),n===`generating`?(0,$.jsxs)(`div`,{style:{height:`100%`,minHeight:180,borderRadius:12,background:`linear-gradient(135deg, rgba(99,102,241,0.04), rgba(139,92,246,0.04))`,border:`1px dashed rgba(99,102,241,0.2)`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:10},children:[(0,$.jsx)(Xm,{style:{color:`#6366f1`,fontSize:28},spin:!0}),(0,$.jsxs)(Q.Text,{style:{color:`#94a3b8`,fontSize:13},children:[a===`video`?`视频`:`图片`,`生成中...`]})]}):n===`completed`&&e.videoUrl||e.imageUrl?(0,$.jsxs)(`div`,{style:{borderRadius:12,overflow:`hidden`,border:`1px solid #f0f0f5`,position:`relative`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:10,right:10,zIndex:10},children:(0,$.jsx)(gw,{title:`下载${a===`video`?`视频`:`图片`}`,children:(0,$.jsx)(X,{size:`small`,icon:(0,$.jsx)(m0,{}),onClick:()=>{let t=document.createElement(`a`);t.href=`http://ceshi.apiforeign.minzhong.cn${a===`video`?e.videoUrl:e.imageUrl}&download=1`,t.download=`${e.projectName}${a===`video`?`.mp4`:`.png`}`,t.click()},style:{background:`rgba(0,0,0,0.5)`,border:`none`,color:`#fff`,backdropFilter:`blur(4px)`,borderRadius:8},children:`下载`})})}),(0,$.jsx)(`div`,{style:{minHeight:180,overflow:`hidden`},children:a===`video`?(0,$.jsx)(`video`,{src:`http://ceshi.apiforeign.minzhong.cn${e.videoUrl}`,controls:!0,preload:`metadata`,style:{width:`100%`,height:`400px`,borderRadius:0}}):(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn${e.imageUrl}`,alt:e.projectName,style:{width:`100%`,maxHeight:`400px`,objectFit:`contain`,borderRadius:0}})}),(0,$.jsxs)(`div`,{style:{padding:`8px 12px`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,background:`#fafbff`},children:[(0,$.jsxs)(sH,{children:[a===`video`?(0,$.jsx)(t5,{style:{color:`#6366f1`,fontSize:13}}):(0,$.jsx)(R6,{style:{color:`#6366f1`,fontSize:13}}),(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#475569`},children:e.projectName})]}),e.generatedAt&&(0,$.jsx)(`span`,{className:`date-display`,translate:`no`,style:{fontSize:11,color:`#94a3b8`},children:T7(e.generatedAt)})]})]}):n===`failed`?(0,$.jsxs)(`div`,{style:{height:`100%`,minHeight:180,borderRadius:12,background:`rgba(239,68,68,0.03)`,border:`1px dashed rgba(239,68,68,0.2)`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:10,padding:16},children:[(0,$.jsx)(m4,{style:{color:`#ef4444`,fontSize:28}}),(0,$.jsxs)(Q.Text,{style:{color:`#ef4444`,fontSize:14,fontWeight:600},children:[a===`video`?`视频`:`图片`,`生成失败`]}),e.errorMessage&&(0,$.jsx)(Q.Text,{style:{color:`#ef4444`,fontSize:12,textAlign:`center`,lineHeight:1.6},children:e.errorMessage})]}):(0,$.jsxs)(`div`,{style:{height:`100%`,minHeight:180,borderRadius:12,background:`#f8f9fc`,border:`1px dashed #e2e8f0`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:10},children:[(0,$.jsx)(cV,{style:{color:`#94a3b8`,fontSize:28}}),(0,$.jsx)(Q.Text,{style:{color:`#94a3b8`,fontSize:13},children:a===`image`?`待生成图片`:n===`prompt_optimized`?`待配置视频参数`:`待生成视频`})]})]})]})})]},e.id)})})]}),(0,$.jsx)(mK,{open:!!pe,onCancel:()=>me(null),footer:null,width:480,centered:!0,destroyOnHidden:!0,closable:!1,title:null,styles:{body:{padding:0,background:`#000`,position:`relative`}},children:pe&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`video`,{src:pe,controls:!0,autoPlay:!0,style:{width:`100%`,display:`block`,maxHeight:`70vh`}}),(0,$.jsx)(`div`,{onClick:()=>me(null),style:{position:`absolute`,top:8,right:8,width:28,height:28,borderRadius:`50%`,background:`rgba(0,0,0,0.6)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,zIndex:10,transition:`background 0.15s`},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(0,0,0,0.85)`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(0,0,0,0.6)`},children:(0,$.jsx)(c5,{style:{color:`#fff`,fontSize:16}})})]})})]})},B7={optimizing:{color:`processing`,text:`优化中`,icon:(0,$.jsx)(Xm,{spin:!0})},prompt_optimized:{color:`processing`,text:`待生成`,icon:(0,$.jsx)(cV,{})},generating:{color:`warning`,text:`生成中`,icon:(0,$.jsx)(Xm,{spin:!0})},completed:{color:`success`,text:`已完成`,icon:(0,$.jsx)(d4,{})},failed:{color:`error`,text:`失败`,icon:(0,$.jsx)(m4,{})}},goe=()=>{let e=Ye(),{records:t,projects:n,fetchRecords:r,fetchProjects:i,generateVideo:a}=C7(),o=t.items,[s,c]=(0,S.useState)(1),[l,u]=(0,S.useState)(10),[d,f]=(0,S.useState)({}),[p,m]=(0,S.useState)(void 0),[h,g]=(0,S.useState)(void 0),[_,v]=(0,S.useState)({}),[y,b]=(0,S.useState)(null),[x,C]=(0,S.useState)(null),[w,T]=(0,S.useState)(null);(0,S.useEffect)(()=>{i()},[i]),(0,S.useEffect)(()=>{r({projectId:p,status:h,page:s,pageSize:l})},[r,p,h,s,l]);let E=async()=>{if(!w)return;let{recordId:e,projectName:t,ratio:n,resolution:r}=w;f(t=>({...t,[e]:!0})),T(null),Z.loading({content:`「${t}」正在生成视频...`,duration:0,key:e});try{await a(e,{aspectRatio:n,resolution:r}),Z.success({content:`「${t}」视频生成成功!`,key:e,duration:3})}catch{Z.error({content:`「${t}」视频生成失败`,key:e,duration:3})}finally{f(t=>({...t,[e]:!1}))}},D=e=>{if((e.genType||`image`)===`image`){f(t=>({...t,[e.id]:!0})),Z.loading({content:`「${e.projectName}」正在生成图片...`,duration:0,key:e.id}),a(e.id,{}).then(()=>{Z.success({content:`「${e.projectName}」图片生成成功!`,key:e.id,duration:3})}).catch(()=>{Z.error({content:`「${e.projectName}」图片生成失败`,key:e.id,duration:3})}).finally(()=>{f(t=>({...t,[e.id]:!1}))});return}T({recordId:e.id,projectName:e.projectName,ratio:e.aspectRatio||`16:9`,resolution:e.resolution||`720p`})},O=o;return(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:20,padding:`16px 24px`,borderRadius:16,background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,border:`1px solid rgba(99, 102, 241, 0.08)`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16},children:[(0,$.jsx)(X,{icon:(0,$.jsx)(b2,{}),onClick:()=>e(`/projects`),style:{borderRadius:10,fontSize:13,height:32,background:`rgba(99, 102, 241, 0.1)`,border:`1px solid rgba(99, 102, 241, 0.2)`,color:`#6366f1`},children:`返回`}),(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #6366f1, #8b5cf6, transparent)`,borderRadius:1}}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Title,{level:2,style:{margin:0,fontSize:16,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`项目记录`}),(0,$.jsx)(Q.Text,{style:{fontSize:13,color:`#64748b`},children:`查看所有视频生成记录,点击记录查看完整内容和视频`})]}),(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #8b5cf6, #6366f1, transparent)`,borderRadius:1}})]})}),(0,$.jsxs)(`div`,{className:`record-filter-bar animate-fadeInUp`,style:{display:`flex`,gap:12,marginBottom:20,padding:`14px 20px`,borderRadius:14,background:`#fff`,border:`1px solid #f0f0f5`},children:[(0,$.jsxs)(sH,{children:[(0,$.jsx)(n3,{style:{color:`#94a3b8`}}),(0,$.jsx)(EC,{placeholder:`全部项目`,allowClear:!0,style:{width:200},onChange:e=>{m(e),c(1)},children:n.map(e=>(0,$.jsx)(EC.Option,{value:e.id,children:e.name},e.id))}),(0,$.jsxs)(EC,{placeholder:`全部状态`,allowClear:!0,style:{width:140},onChange:e=>{g(e),c(1)},children:[(0,$.jsx)(EC.Option,{value:`prompt_optimized`,children:`待生成`}),(0,$.jsx)(EC.Option,{value:`generating`,children:`生成中`}),(0,$.jsx)(EC.Option,{value:`completed`,children:`已完成`}),(0,$.jsx)(EC.Option,{value:`failed`,children:`失败`})]})]}),(0,$.jsxs)(Q.Text,{style:{marginLeft:`auto`,lineHeight:`32px`,color:`#94a3b8`,fontSize:13},children:[`共 `,t.total,` 条记录`]})]}),O.length===0?(0,$.jsx)(XS,{image:XS.PRESENTED_IMAGE_SIMPLE,description:`暂无生成记录`,style:{padding:60}}):(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},className:`stagger-children`,children:O.map((e,t)=>{let n=y===e.id,r=_[e.id]??e.optimizedPrompt,i=d[e.id],a=x===e.id,o=e.genType||`image`;return(0,$.jsxs)(`div`,{className:`animate-slideInCard`,style:{animationDelay:`${t*.04}s`},children:[(0,$.jsxs)(`div`,{className:`record-item`,onClick:()=>C(a?null:e.id),style:{padding:`14px 20px`,borderRadius:a?`14px 14px 0 0`:14,background:`#fff`,border:`1px solid #f0f0f5`,cursor:`pointer`,transition:`all 0.2s`,display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:28,height:28,borderRadius:8,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,background:o===`image`?`#fef3c7`:`#dbeafe`},children:o===`image`?(0,$.jsx)(R6,{style:{color:`#d97706`,fontSize:12}}):(0,$.jsx)(t5,{style:{color:`#2563eb`,fontSize:12}})}),a?(0,$.jsx)(YZ,{style:{color:`#6366f1`,fontSize:12,flexShrink:0}}):(0,$.jsx)(c4,{style:{color:`#cbd5e1`,fontSize:12,flexShrink:0}}),(0,$.jsx)(XQ,{color:B7[e.status].color,icon:B7[e.status].icon,style:{margin:0},children:B7[e.status].text}),(0,$.jsx)(XQ,{style:{background:`#f0f0ff`,border:`none`,color:`#6366f1`,margin:0},children:e.projectName}),(0,$.jsx)(Q.Text,{style:{flex:1,fontSize:13,color:`#475569`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:r}),o===`image`?(0,$.jsxs)(`span`,{className:`mobile-meta`,translate:`no`,style:{fontSize:12,color:`#94a3b8`,flexShrink:0},children:[e.duration?`${e.imageSize}`:`-`,` · `,e.imageProportion||`-`,` · `,e.imagePx||`-`,` · `,(0,$.jsx)(`span`,{className:`date-display`,translate:`no`,children:T7(e.createdAt)})]}):(0,$.jsxs)(`span`,{className:`mobile-meta`,translate:`no`,style:{fontSize:12,color:`#94a3b8`,flexShrink:0},children:[e.duration?`${e.duration}秒`:`-`,` · `,e.aspectRatio||`-`,` · `,e.resolution||`-`,` · `,(0,$.jsx)(`span`,{className:`date-display`,translate:`no`,children:T7(e.createdAt)})]}),(0,$.jsx)(`div`,{className:`record-actions`,onClick:e=>e.stopPropagation(),children:(0,$.jsxs)(sH,{children:[e.status===`prompt_optimized`&&(0,$.jsx)(X,{type:`primary`,size:`small`,icon:(0,$.jsx)(q6,{}),loading:i,onClick:()=>D(e),style:{borderRadius:8,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`},children:`生成`}),e.status===`generating`&&(0,$.jsx)(XQ,{color:`processing`,icon:(0,$.jsx)(Xm,{spin:!0}),style:{padding:`4px 12px`,fontSize:12},children:`生成中...`}),e.status===`failed`&&(0,$.jsx)(X,{type:`primary`,danger:!0,size:`small`,icon:(0,$.jsx)(q6,{}),loading:i,onClick:()=>D(e),style:{borderRadius:8},children:`重试`})]})})]}),a&&(0,$.jsx)(`div`,{style:{background:`#fff`,border:`1px solid #f0f0f5`,borderTop:`none`,borderRadius:`0 0 14px 14px`,padding:`20px 24px`,animation:`fadeInUp 0.25s ease both`},children:(0,$.jsxs)(`div`,{className:`gen-detail-row`,style:{display:`flex`,gap:24,flexWrap:`wrap`},children:[(0,$.jsxs)(`div`,{style:{flex:`1 1 50%`,minWidth:280},children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:6},children:`原始提示词`}),(0,$.jsx)(`div`,{style:{padding:12,borderRadius:10,background:`#f8f9fc`,border:`1px solid #f0f0f5`},children:(0,$.jsx)(Q.Text,{style:{fontSize:13,color:`#64748b`,lineHeight:1.7},children:e.originalPrompt})})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:6},children:[(0,$.jsxs)(Q.Text,{style:{fontSize:12,color:`#94a3b8`},children:[`优化后的提示词 `,e.status===`prompt_optimized`&&(0,$.jsx)(`span`,{style:{color:`#6366f1`},children:`(可编辑)`})]}),!n&&(0,$.jsxs)(sH,{size:4,children:[(0,$.jsx)(gw,{title:`复制`,children:(0,$.jsx)(X,{type:`text`,size:`small`,icon:(0,$.jsx)(t1,{}),onClick:async()=>{let e=await k7(r);Z.success(e?`已复制`:`复制失败`)},style:{color:`#94a3b8`}})}),e.status===`prompt_optimized`&&(0,$.jsx)(gw,{title:`编辑`,children:(0,$.jsx)(X,{type:`text`,size:`small`,icon:(0,$.jsx)(M$,{}),onClick:()=>{b(e.id),v(t=>({...t,[e.id]:t[e.id]??e.optimizedPrompt}))},style:{color:`#6366f1`}})})]})]}),n?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(IW.TextArea,{value:r,onChange:t=>v(n=>({...n,[e.id]:t.target.value})),rows:4,style:{borderRadius:10,fontSize:13,lineHeight:1.7,border:`1px solid rgba(99,102,241,0.25)`,background:`rgba(99,102,241,0.02)`}}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,marginTop:8},children:[(0,$.jsx)(X,{size:`small`,onClick:()=>b(null),children:`取消`}),(0,$.jsx)(X,{size:`small`,type:`primary`,onClick:()=>{v(t=>({...t,[e.id]:r})),b(null),Z.success(`提示词已更新`)},style:{borderRadius:6,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`},children:`保存`})]})]}):(0,$.jsx)(`div`,{style:{padding:12,borderRadius:10,background:`rgba(99,102,241,0.02)`,border:`1px solid rgba(99,102,241,0.1)`},children:(0,$.jsx)(Q.Text,{style:{fontSize:13,color:`#1a1a2e`,lineHeight:1.7},children:r})})]}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:16,padding:`12px 16px`,borderRadius:10,background:`#f8f9fc`},children:o===`image`?[{label:`分辨率`,value:e.imageSize?`${e.imageSize} `:`-`},{label:`画面比例`,value:e.imageProportion?`${e.imageProportion} `:`-`},{label:`画面尺寸`,value:e.imageProportion?`${e.imageProportion} `:`-`},{label:`消耗积分`,value:e.creditsCost?`${e.creditsCost} `:`-`,highlight:!!e.creditsCost}].map((e,t)=>(0,$.jsxs)(`div`,{style:{flex:1},children:[(0,$.jsx)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:e.label}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:14,color:e.highlight?`#6366f1`:`#1a1a2e`},children:e.value})]},t)):[{label:`时长`,value:e.duration?`${e.duration} 秒`:`-`},{label:`画面比例`,value:e.aspectRatio||(e.status===`prompt_optimized`?`待选择`:`-`)},{label:`分辨率`,value:e.resolution||(e.status===`prompt_optimized`?`待选择`:`-`)},{label:`消耗积分`,value:e.creditsCost?`${e.creditsCost}`:`-`,highlight:!!e.creditsCost}].map((e,t)=>(0,$.jsxs)(`div`,{style:{flex:1},children:[(0,$.jsx)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:e.label}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:14,color:e.highlight?`#6366f1`:`#1a1a2e`},children:e.value})]},t))}),e.status===`prompt_optimized`&&(0,$.jsx)(`div`,{style:{marginTop:16,display:`flex`,justifyContent:`flex-end`},children:(0,$.jsx)(X,{type:`primary`,size:`large`,icon:(0,$.jsx)(d8,{}),loading:i,onClick:()=>D(e),style:{borderRadius:12,fontWeight:600,height:44,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,boxShadow:`0 8px 24px rgba(99,102,241,0.3)`},children:o===`video`?`选择参数生成视频`:`生成图片`})}),e.status===`failed`&&(0,$.jsx)(`div`,{style:{marginTop:16,display:`flex`,justifyContent:`flex-end`},children:(0,$.jsxs)(X,{type:`primary`,danger:!0,size:`large`,icon:(0,$.jsx)(q6,{}),loading:i,onClick:()=>D(e),style:{borderRadius:12,fontWeight:600,height:44},children:[`重新生成`,o===`video`?`视频`:`图片`]})})]}),(0,$.jsx)(`div`,{style:{flex:`1 1 40%`,minWidth:240},children:e.status===`generating`?(0,$.jsxs)(`div`,{style:{height:`100%`,minHeight:200,borderRadius:14,background:`linear-gradient(135deg, rgba(99,102,241,0.04), rgba(139,92,246,0.04))`,border:`1px dashed rgba(99,102,241,0.2)`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:12},children:[(0,$.jsx)(Xm,{style:{color:`#6366f1`,fontSize:32},spin:!0}),(0,$.jsxs)(Q.Text,{style:{color:`#94a3b8`,fontSize:14},children:[o===`video`?`视频`:`图片`,`生成中...`]}),(0,$.jsx)(Q.Text,{style:{color:`#cbd5e1`,fontSize:12},children:`请耐心等待,生成完成后将自动展示`})]}):e.status===`completed`&&(e.videoUrl||e.imageUrl)?(0,$.jsxs)(`div`,{style:{borderRadius:14,overflow:`hidden`,border:`1px solid #f0f0f5`,position:`relative`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:10,right:10,zIndex:10},children:(0,$.jsx)(gw,{title:`下载${o===`video`?`视频`:`图片`}`,children:(0,$.jsx)(X,{size:`small`,icon:(0,$.jsx)(m0,{}),onClick:()=>{let t=document.createElement(`a`);t.href=`http://ceshi.apiforeign.minzhong.cn${o===`video`?e.videoUrl:e.imageUrl}&download=1`,t.download=`${e.projectName}${o===`video`?`.mp4`:`.png`}`,t.click()},style:{background:`rgba(0,0,0,0.5)`,border:`none`,color:`#fff`,backdropFilter:`blur(4px)`,borderRadius:8},children:`下载`})})}),(0,$.jsx)(`div`,{style:{minHeight:280,overflow:`hidden`},children:o===`video`?(0,$.jsx)(`video`,{src:`http://ceshi.apiforeign.minzhong.cn${e.videoUrl}`,controls:!0,preload:`metadata`,style:{width:`100%`,height:`400px`,display:`block`}}):(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn${e.imageUrl}`,alt:e.projectName,style:{width:`100%`,maxHeight:`400px`,objectFit:`contain`,display:`block`}})}),(0,$.jsxs)(`div`,{style:{padding:`10px 14px`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,background:`#fafbff`},children:[(0,$.jsxs)(sH,{children:[o===`video`?(0,$.jsx)(t5,{style:{color:`#6366f1`}}):(0,$.jsx)(R6,{style:{color:`#6366f1`}}),(0,$.jsx)(Q.Text,{style:{fontSize:13,color:`#475569`},children:e.projectName})]}),e.generatedAt&&(0,$.jsxs)(`span`,{className:`date-display`,translate:`no`,style:{fontSize:12,color:`#94a3b8`},children:[`生成于 `,T7(e.generatedAt)]})]})]}):e.status===`failed`?(0,$.jsxs)(`div`,{style:{height:`100%`,minHeight:200,borderRadius:14,background:`rgba(239,68,68,0.03)`,border:`1px dashed rgba(239,68,68,0.2)`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:12},children:[(0,$.jsx)(m4,{style:{color:`#ef4444`,fontSize:32}}),(0,$.jsxs)(Q.Text,{style:{color:`#ef4444`,fontSize:14},children:[o===`video`?`视频`:`图片`,`生成失败`]}),(0,$.jsx)(Q.Text,{style:{color:`#94a3b8`,fontSize:12},children:`请在左侧点击重新生成`})]}):(0,$.jsxs)(`div`,{style:{height:`100%`,minHeight:200,borderRadius:14,background:`#f8f9fc`,border:`1px dashed #e2e8f0`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:12},children:[(0,$.jsx)(cV,{style:{color:`#94a3b8`,fontSize:32}}),(0,$.jsxs)(Q.Text,{style:{color:`#94a3b8`,fontSize:14},children:[`待生成`,o===`video`?`视频`:`图片`]}),(0,$.jsx)(Q.Text,{style:{color:`#cbd5e1`,fontSize:12},children:`点击左侧生成按钮开始生成`})]})})]})})]},e.id)})}),t.total>0&&(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,marginTop:18},children:(0,$.jsx)(SG,{current:t.page||s,pageSize:t.pageSize||l,total:t.total,showSizeChanger:!0,showTotal:e=>`共 ${e} 条记录`,onChange:(e,t)=>{c(e),u(t)}})}),(0,$.jsx)(mK,{title:(0,$.jsxs)(sH,{children:[(0,$.jsx)(d8,{}),`生成视频`]}),open:!!w,onCancel:()=>T(null),onOk:E,okText:`提交生成`,cancelText:`取消`,width:420,children:w&&(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:16,marginTop:16},children:(()=>{let e=o.find(e=>e.id===w.recordId);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{padding:12,borderRadius:10,background:`#f8f9fc`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:`时长`}),(0,$.jsxs)(Q.Text,{strong:!0,children:[e?.duration||5,`秒`]})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#64748b`,display:`block`,marginBottom:6},children:`画面比例`}),(0,$.jsx)(EC,{value:w.ratio,onChange:e=>T(t=>t?{...t,ratio:e}:null),style:{width:`100%`},options:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`].map(e=>({value:e,label:e}))})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#64748b`,display:`block`,marginBottom:6},children:`分辨率`}),(0,$.jsx)(EC,{value:w.resolution,onChange:e=>T(t=>t?{...t,resolution:e}:null),style:{width:`100%`},options:[`480p`,`720p`,`1080p`].map(e=>({value:e,label:e}))})]})]})})()})})]})},V7=({value:e,duration:t=1200})=>{let[n,r]=(0,S.useState)(0),i=(0,S.useRef)(0);return(0,S.useEffect)(()=>{let a=n,o=e-a;if(o===0)return;let s=performance.now(),c=e=>{let n=e-s,l=Math.min(n/t,1);r(a+o*(1-(1-l)**3)),l<1&&(i.current=requestAnimationFrame(c))};return i.current=requestAnimationFrame(c),()=>cancelAnimationFrame(i.current)},[e]),(0,$.jsx)($.Fragment,{children:n.toLocaleString()})},_oe=()=>{let{user:e}=_7(),[t,n]=(0,S.useState)([]),[r,i]=(0,S.useState)(!1),[a,o]=(0,S.useState)(1),[s,c]=(0,S.useState)(10),[l,u]=(0,S.useState)(0);(0,S.useEffect)(()=>{(async()=>{i(!0);let e=await A5(a,s);n(e.records),u(e.total),i(!1)})()},[a,s]);let d=(e,t)=>{o(e),c(t)},f=t.filter(e=>e.type===`recharge`).reduce((e,t)=>e+t.amount,0),p=t.filter(e=>e.type===`consume`).reduce((e,t)=>e+Math.abs(t.amount),0);return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(Yq,{gutter:[16,16],style:{marginBottom:24},children:[(0,$.jsx)(JR,{xs:24,sm:8,children:(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{borderRadius:16,padding:24,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,position:`relative`,overflow:`hidden`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,right:-20,top:-20,width:120,height:120,borderRadius:`50%`,background:`rgba(255,255,255,0.1)`}}),(0,$.jsxs)(`div`,{style:{position:`relative`},children:[(0,$.jsxs)(sH,{style:{marginBottom:10},children:[(0,$.jsx)(r5,{style:{color:`rgba(255,255,255,0.8)`,fontSize:16}}),(0,$.jsx)(`span`,{style:{color:`rgba(255,255,255,0.8)`,fontSize:14},children:`当前可用积分`})]}),(0,$.jsx)(`div`,{style:{color:`#fff`,fontSize:38,fontWeight:800,lineHeight:1},children:(0,$.jsx)(V7,{value:e?.credits??0})})]})]})}),(0,$.jsx)(JR,{xs:12,sm:8,children:(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{borderRadius:16,padding:24,background:`#fff`,border:`1px solid #f0f0f5`,animationDelay:`0.06s`},children:[(0,$.jsxs)(sH,{style:{marginBottom:10},children:[(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:8,background:`rgba(16,185,129,0.1)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(E2,{style:{color:`#10b981`,fontSize:14}})}),(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:14},children:`累计获得`})]}),(0,$.jsx)(`div`,{style:{color:`#10b981`,fontSize:28,fontWeight:800},children:(0,$.jsx)(V7,{value:f})})]})}),(0,$.jsx)(JR,{xs:12,sm:8,children:(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{borderRadius:16,padding:24,background:`#fff`,border:`1px solid #f0f0f5`,animationDelay:`0.12s`},children:[(0,$.jsxs)(sH,{style:{marginBottom:10},children:[(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:8,background:`rgba(239,68,68,0.1)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(_2,{style:{color:`#ef4444`,fontSize:14}})}),(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:14},children:`累计消耗`})]}),(0,$.jsx)(`div`,{style:{color:`#ef4444`,fontSize:28,fontWeight:800},children:(0,$.jsx)(V7,{value:p})})]})})]}),(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{animationDelay:`0.15s`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12},children:[(0,$.jsx)(W8,{style:{color:`#6366f1`,fontSize:16}}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:16},children:`积分明细`})]}),(0,$.jsx)(`div`,{style:{borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,overflow:`hidden`},children:(0,$.jsx)(LQ,{columns:[{title:`类型`,dataIndex:`type`,key:`type`,width:100,render:e=>(0,$.jsx)(XQ,{color:e===`recharge`?`green`:`orange`,icon:e===`recharge`?(0,$.jsx)(E2,{}):(0,$.jsx)(_2,{}),children:e===`recharge`?`充值`:`消费`})},{title:`积分变动`,dataIndex:`amount`,key:`amount`,width:120,render:e=>(0,$.jsxs)(Q.Text,{strong:!0,style:{color:e>0?`#10b981`:`#ef4444`,fontSize:15},children:[e>0?`+`:``,e]})},{title:`说明`,dataIndex:`description`,key:`description`},{title:`时间`,dataIndex:`createdAt`,key:`createdAt`,width:160,render:e=>(0,$.jsx)(`span`,{className:`date-display`,translate:`no`,style:{color:`#94a3b8`},children:T7(e)})}],dataSource:t,rowKey:`id`,loading:r,pagination:{current:a,pageSize:s,total:l,onChange:d,showSizeChanger:!0,showTotal:e=>`共 ${e} 条`},scroll:{x:500}})})]})]})},voe=()=>{let[e,t]=(0,S.useState)(!0),[n,r]=(0,S.useState)([]),[i,a]=(0,S.useState)(0),[o,s]=(0,S.useState)(0),[c,l]=(0,S.useState)(1),[u]=(0,S.useState)(10);(0,S.useEffect)(()=>{d()},[c]);let d=async()=>{t(!0);try{let e=await A5(c,u);r(e.records||[]),a(e.credits||0),s(e.total||0)}catch{r([])}t(!1)};return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(Yq,{gutter:[16,16],style:{marginBottom:24},children:[(0,$.jsx)(JR,{xs:24,sm:8,children:(0,$.jsxs)(`div`,{style:{borderRadius:16,padding:24,background:`linear-gradient(135deg, #f59e0b 0%, #ea580c 100%)`,position:`relative`,overflow:`hidden`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,right:-20,top:-20,width:120,height:120,borderRadius:`50%`,background:`rgba(255,255,255,0.1)`}}),(0,$.jsxs)(`div`,{style:{position:`relative`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:10},children:[(0,$.jsx)(r5,{style:{color:`rgba(255,255,255,0.8)`,fontSize:16}}),(0,$.jsx)(`span`,{style:{color:`rgba(255,255,255,0.8)`,fontSize:14},children:`可用积分`})]}),(0,$.jsx)(`div`,{style:{color:`#fff`,fontSize:38,fontWeight:800,lineHeight:1},children:i.toLocaleString()})]})]})}),(0,$.jsx)(JR,{xs:12,sm:8,children:(0,$.jsxs)(`div`,{style:{borderRadius:16,padding:24,background:`#fff`,border:`1px solid #f0f0f5`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:10},children:[(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:8,background:`rgba(16,185,129,0.1)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(X6,{style:{color:`#10b981`,fontSize:14}})}),(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:14},children:`累计获得`})]}),(0,$.jsx)(`div`,{style:{color:`#10b981`,fontSize:28,fontWeight:800},children:n.filter(e=>e.amount>0).reduce((e,t)=>e+t.amount,0).toLocaleString()})]})}),(0,$.jsx)(JR,{xs:12,sm:8,children:(0,$.jsxs)(`div`,{style:{borderRadius:16,padding:24,background:`#fff`,border:`1px solid #f0f0f5`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:10},children:[(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:8,background:`rgba(239,68,68,0.1)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(W8,{style:{color:`#ef4444`,fontSize:14}})}),(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:14},children:`累计消耗`})]}),(0,$.jsx)(`div`,{style:{color:`#ef4444`,fontSize:28,fontWeight:800},children:n.filter(e=>e.amount<0).reduce((e,t)=>e+Math.abs(t.amount),0).toLocaleString()})]})})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12},children:[(0,$.jsx)(W8,{style:{color:`#f59e0b`,fontSize:16}}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:16},children:`积分明细`})]}),(0,$.jsx)(`div`,{style:{borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,overflow:`hidden`},children:(0,$.jsx)(UG,{spinning:e,children:n.length===0?(0,$.jsx)(XS,{description:(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`暂无积分变动记录`})}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(LQ,{dataSource:n,columns:[{title:`变动类型`,dataIndex:`type`,key:`type`,width:120,render:e=>{let t={recharge:{color:`#10b981`,label:`充值`,bg:`rgba(16,185,129,0.1)`},consume:{color:`#ef4444`,label:`消费`,bg:`rgba(239,68,68,0.1)`},admin:{color:`#f59e0b`,label:`管理员调整`,bg:`rgba(245,158,11,0.1)`},refund:{color:`#8b5cf6`,label:`退款`,bg:`rgba(139,92,246,0.1)`},team_internal:{color:`#0958d9`,label:`团队内部`,bg:`rgba(139,92,246,0.1)`}}[e]||{color:`#64748b`,label:e,bg:`rgba(100,116,139,0.1)`};return(0,$.jsx)(XQ,{color:t.color,style:{background:t.bg,fontWeight:500,padding:`4px 12px`},children:t.label})}},{title:`描述`,dataIndex:`description`,key:`description`,ellipsis:!0},{title:`变动积分`,dataIndex:`amount`,key:`amount`,width:120,align:`right`,render:e=>(0,$.jsxs)(Q.Text,{strong:!0,style:{fontWeight:700,color:e>0?`#10b981`:`#ef4444`,fontSize:15},children:[e>0?`+`:``,e]})},{title:`创建时间`,key:`createdAt`,width:180,render:(e,t)=>{let n=t.created_at||t.createdAt||t.create_time||t.createTime;return n?new Date(n).toLocaleString(`zh-CN`):`-`}}],rowKey:`id`,pagination:!1,bordered:!1}),(0,$.jsx)(`div`,{style:{padding:`16px`,textAlign:`right`},children:(0,$.jsx)(SG,{current:c,pageSize:u,total:o,onChange:e=>{l(e)},size:`small`})})]})})})]})]})},yoe=()=>{let[e,t]=(0,S.useState)(!0),[n,r]=(0,S.useState)([]),[i,a]=(0,S.useState)(0),[o,s]=(0,S.useState)(1),[c]=(0,S.useState)(10);(0,S.useEffect)(()=>{l()},[o]);let l=async()=>{t(!0);try{let e=await Bie(o,c);r(e.items||[]),a(e.total||0)}catch{r([])}t(!1)};return(0,$.jsx)(`div`,{children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12},children:[(0,$.jsx)(fH,{style:{color:`#0ea5e9`,fontSize:16}}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:16},children:`订单记录`}),(0,$.jsxs)(`span`,{style:{color:`#94a3b8`,fontSize:13},children:[`共 `,n.length,` 条记录`]})]}),(0,$.jsx)(`div`,{style:{borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,overflow:`hidden`},children:(0,$.jsx)(UG,{spinning:e,children:n.length===0?(0,$.jsx)(XS,{description:(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`暂无订单记录`})}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(LQ,{dataSource:n,columns:[{title:`订单号`,key:`orderNo`,width:200,render:(e,t)=>(0,$.jsx)(`span`,{style:{fontFamily:`monospace`,fontSize:13,color:`#64748b`},children:t.order_no||t.orderNo||t.id})},{title:`支付方式`,key:`paymentMethod`,width:100,render:(e,t)=>{let n=t.payment_method||t.paymentMethod||`wechat`,r={alipay:{icon:(0,$.jsx)(c2,{style:{fontSize:16}}),label:`支付宝`,color:`#1677ff`},wechat:{icon:(0,$.jsx)(o5,{style:{fontSize:16}}),label:`微信支付`,color:`#07c160`}},i=r[n]||r.wechat;return(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{color:i.color},children:i.icon}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#374151`},children:i.label})]})}},{title:`金额`,key:`amount`,width:100,align:`right`,render:(e,t)=>{let n=t.amount||t.total_amount||0;return(0,$.jsxs)(Q.Text,{strong:!0,style:{fontWeight:700,fontSize:14,color:`#1e293b`},children:[`¥`,n]})}},{title:`获得积分`,key:`credits`,width:100,align:`center`,render:(e,t)=>{let n=t.credits||t.credit_amount||0;return(0,$.jsx)(Q.Text,{strong:!0,style:{fontWeight:600,fontSize:14,color:`#f59e0b`},children:n})}},{title:`状态`,key:`status`,width:100,render:(e,t)=>{let n=t.status||`pending`,r={pending:{color:`#f59e0b`,label:`待支付`,bg:`rgba(245,158,11,0.1)`},paid:{color:`#10b981`,label:`已支付`,bg:`rgba(16,185,129,0.1)`},refunded:{color:`#94a3b8`,label:`已退款`,bg:`rgba(148,163,184,0.1)`},failed:{color:`#ef4444`,label:`支付失败`,bg:`rgba(239,68,68,0.1)`},cancelled:{color:`#64748b`,label:`已取消`,bg:`rgba(100,116,139,0.1)`},processing:{color:`#0ea5e9`,label:`处理中`,bg:`rgba(14,165,233,0.1)`}}[n]||{color:`#64748b`,label:n,bg:`rgba(100,116,139,0.1)`};return(0,$.jsx)(XQ,{color:r.color,style:{background:r.bg,fontWeight:500,padding:`4px 12px`},children:r.label})}},{title:`创建时间`,key:`createdAt`,width:180,render:(e,t)=>{let n=t.created_at||t.createdAt;return n?new Date(n).toLocaleString(`zh-CN`):`-`}},{title:`支付时间`,key:`paidAt`,width:180,render:(e,t)=>{let n=t.paid_at||t.paidAt;return n?new Date(n).toLocaleString(`zh-CN`):`-`}}],rowKey:`order_no`,pagination:!1,bordered:!1}),(0,$.jsx)(`div`,{style:{padding:`16px`,textAlign:`right`},children:(0,$.jsx)(SG,{current:o,pageSize:c,total:i,onChange:e=>{s(e)},size:`small`})})]})})})]})})},boe=()=>{let[e,t]=(0,S.useState)(!0),[n,r]=(0,S.useState)([]),[i,a]=(0,S.useState)(0),[o,s]=(0,S.useState)(0),[c,l]=(0,S.useState)(1),[u]=(0,S.useState)(10);(0,S.useEffect)(()=>{d(),f()},[c]);let d=async()=>{t(!0);try{let e=await N5(c,u);r(e.items||[]),s(e.total||0)}catch{r([])}t(!1)},f=async()=>{try{a(await P5())}catch{a(0)}},p=async e=>{try{await F5(e),d(),f()}catch{}};return(0,$.jsx)(`div`,{children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12},children:[(0,$.jsx)(V2,{style:{color:`#6366f1`,fontSize:16}}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:16},children:`消息中心`}),(0,$.jsxs)(`span`,{style:{color:`#94a3b8`,fontSize:13},children:[`未读 `,i,` 条`]})]}),(0,$.jsx)(`div`,{style:{borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,overflow:`hidden`},children:(0,$.jsx)(UG,{spinning:e,children:n.length===0?(0,$.jsx)(XS,{description:(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`暂无消息`})}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(LQ,{dataSource:n,columns:[{title:`类型`,dataIndex:`type`,key:`type`,width:100,render:e=>{let t={system:{color:`#6366f1`,label:`系统`,bg:`rgba(99,102,241,0.1)`,icon:(0,$.jsx)(C8,{style:{fontSize:14}})},credit:{color:`#f59e0b`,label:`积分`,bg:`rgba(245,158,11,0.1)`,icon:(0,$.jsx)(r5,{style:{fontSize:14}})},promo:{color:`#8b5cf6`,label:`活动`,bg:`rgba(139,92,246,0.1)`,icon:(0,$.jsx)(m3,{style:{fontSize:14}})}},n=t[e]||t.system;return(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{color:n.color},children:n.icon}),(0,$.jsx)(`span`,{style:{fontSize:13,color:n.color,fontWeight:500},children:n.label})]})}},{title:`标题`,dataIndex:`title`,key:`title`,ellipsis:!0},{title:`内容`,dataIndex:`content`,key:`content`,ellipsis:!0},{title:`状态`,dataIndex:`isRead`,key:`isRead`,width:80,render:(e,t)=>e??t.is_read?(0,$.jsx)(XQ,{color:`gray`,style:{background:`rgba(148,163,184,0.1)`},children:`已读`}):(0,$.jsx)(XQ,{color:`purple`,style:{background:`rgba(139,92,246,0.1)`},children:`未读`})},{title:`创建时间`,dataIndex:`createdAt`,key:`createdAt`,width:160,render:e=>{if(!e)return`-`;let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/(1e3*60*60));if(r<1)return`刚刚`;if(r<24)return`${r}小时前`;let i=Math.floor(r/24);return i<7?`${i}天前`:t.toLocaleDateString(`zh-CN`)}},{title:`操作`,key:`action`,width:100,render:(e,t)=>t.isRead??t.is_read?null:(0,$.jsx)(X,{type:`text`,size:`small`,onClick:()=>p(t.id),style:{color:`#6366f1`},children:`标记已读`})}],rowKey:`id`,pagination:!1,bordered:!1}),(0,$.jsx)(`div`,{style:{padding:`16px`,textAlign:`right`},children:(0,$.jsx)(SG,{current:c,pageSize:u,total:o,onChange:e=>{l(e)},size:`small`})})]})})})]})})},H7=()=>{let[e]=On(),[t,n]=(0,S.useState)(`credits`);return(0,S.useEffect)(()=>{(e.get(`tab`)||`credits`)===`orders`?n(`orders`):n(`credits`)},[e]),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(TL,{activeKey:t,onChange:n,items:[{key:`credits`,label:`积分明细`},{key:`orders`,label:`订单记录`}],style:{marginBottom:24},size:`large`}),t===`credits`&&(0,$.jsx)(voe,{}),t===`orders`&&(0,$.jsx)(yoe,{})]})},xoe=`/assets/bg1-CQh9PRPW.png`,Soe=(e,t)=>e<=1?6:e===2||e===4||e===3?3:2,Coe=e=>{let t=e.displayStatus||e.pipelineStage||e.status||`generating`;return{pending:`待处理`,queued:`排队中`,preparing:`准备中`,generating:`生成中`,creating_provider_task:`创建任务中`,waiting_remote:`等待生成`,polling:`轮询中`,result_ready:`结果就绪`,download_queued:`等待下载`,downloading:`下载中`,retry_waiting:`等待重试`,completed:`已完成`,failed:`生成失败`,download_failed:`下载失败`,deleted:`已删除`}[t]||t},U7=e=>{let t=e.displayStatus||e.pipelineStage||e.status;return!t||[`pending`,`queued`,`preparing`,`generating`,`creating_provider_task`,`waiting_remote`,`polling`,`result_ready`,`download_queued`,`downloading`,`retry_waiting`].includes(t)},woe=180,Toe=.6,W7=e=>{if(!e)return 0;let t=new Date(e).getTime(),n=(Date.now()-t)/1e3;return n>=woe?99:Math.min(99,n*Toe)},Eoe=({item:e,isPending:t,isCompleted:n,onAnimationComplete:r,onProgressChange:i})=>{let[a,o]=(0,S.useState)(0),[s,c]=(0,S.useState)(0),[l,u]=(0,S.useState)(!1),d=(0,S.useRef)(null);return(0,S.useEffect)(()=>{i&&i(s)},[s,i]),(0,S.useEffect)(()=>{let t=W7(e.createdAt);o(t),c(t)},[e]),(0,S.useEffect)(()=>{if(n&&!l){u(!0);return}if(!t&&!l){d.current&&=(clearInterval(d.current),null);return}return d.current=window.setInterval(()=>{let t=W7(e.createdAt);o(t),c(t)},1e3),()=>{d.current&&=(clearInterval(d.current),null)}},[e.createdAt,t,n,l,e.id]),(0,S.useEffect)(()=>{if(l){let e=s,t=Date.now(),n=()=>{let i=Date.now()-t,a=Math.min(i/800,1),o=1-(1-a)**3;c(e+(100-e)*o),a<1?requestAnimationFrame(n):setTimeout(()=>{r?.()},100)};requestAnimationFrame(n)}},[l,s,r]),!t&&!l?null:(0,$.jsx)(`div`,{style:{marginTop:4},children:(0,$.jsxs)(`div`,{style:{textAlign:`center`,fontSize:13,color:`#8b5cf6`,fontWeight:700,textShadow:`0 0 8px rgba(139, 92, 246, 0.3)`,transition:`all 0.3s ease-out`},children:[Math.round(s),`%`]})})},Doe=({task:e,onPreview:t,resolveUrl:n=e=>e||``})=>{let r=Math.max(1,Math.min(5,Number(e.generationCount||e.childItems?.length||1))),i=[...e.childItems||[]].sort((e,t)=>Number(e.generationIndex||0)-Number(t.generationIndex||0)),a=i.length>0?i:r>1?Array.from({length:r},(t,n)=>({id:`${e.id||`task`}-placeholder-${n+1}`,genType:e.genType,status:e.status,displayStatus:e.displayStatus,pipelineStage:e.pipelineStage,generationIndex:n+1,errorMessage:e.errorMessage,createdAt:e.createdAt})):[e],[o,s]=(0,S.useState)(new Set),[c,l]=(0,S.useState)(new Set),u=(0,S.useRef)(new Set),d=(e,t)=>{t>=100&&l(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n})};(0,S.useEffect)(()=>{a.slice(0,5).forEach((e,t)=>{let n=e.displayStatus||e.pipelineStage||e.status||`generating`,r=U7(e),i=!r&&n!==`failed`&&n!==`download_failed`&&n!==`deleted`,a=e.id||`${t}`;i&&!u.current.has(a)&&r===!1&&(u.current.add(a),s(e=>{let t=new Set(e);return t.add(a),t}))})},[a]);let f=e=>{s(t=>{let n=new Set(t);return n.delete(e),n})};return(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`grid`,gridTemplateColumns:`repeat(6, minmax(0, 1fr))`,gridAutoRows:`minmax(0, 1fr)`,gap:r>1?6:0},children:a.slice(0,5).map((r,i)=>{let s=r.displayStatus||r.pipelineStage||r.status||`generating`,l=n(`/static${r.imageUrl}&w=300&q=50`),u=n(r.videoUrl),p=n(`/static${r.videoCoverUrl}&w=300&q=50`),m=(r.genType||e.genType)===`video`,h=m?!!u:!!l,g=U7(r),_=!g&&s!==`failed`&&s!==`download_failed`&&s!==`deleted`,v=r.id||`${i}`,y=o.has(v);c.has(v);let b=_&&!y,x=y?`加载中`:Coe(r);return(0,$.jsxs)(`div`,{style:{gridColumn:`span ${Soe(a.length,i)}`,minWidth:0,minHeight:0,position:`relative`,overflow:`hidden`,borderRadius:a.length===1?12:8,background:`#ffffff`,border:`1px solid #E7EAF0`},children:[h&&s!==`deleted`&&s!==`failed`&&s!==`download_failed`&&b?(0,$.jsxs)(`button`,{type:`button`,onClick:()=>t(m?u:l,m?`video`:`image`),style:{width:`100%`,height:`100%`,border:0,padding:0,background:`transparent`,cursor:`pointer`,position:`relative`},children:[m?p?(0,$.jsx)(`img`,{src:p,alt:`生成结果${r.generationIndex||i+1}`,style:{width:`100%`,height:`100%`,objectFit:`contain`}}):(0,$.jsx)(`video`,{src:u,muted:!0,preload:`metadata`,style:{width:`100%`,height:`100%`,objectFit:`contain`}}):(0,$.jsx)(`img`,{src:l,alt:`生成结果${r.generationIndex||i+1}`,style:{width:`100%`,height:`100%`,objectFit:`contain`}}),m?(0,$.jsx)(W6,{style:{position:`absolute`,left:`50%`,top:`50%`,transform:`translate(-50%, -50%)`,fontSize:a.length>2?28:46,color:`rgba(255,255,255,.92)`,filter:`drop-shadow(0 4px 10px rgba(0,0,0,.28))`}}):null]}):(0,$.jsxs)(`div`,{style:{width:`100%`,height:`100%`,minHeight:0,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:7,padding:8,textAlign:`center`},children:[g||y?(0,$.jsx)(Xm,{spin:!0,style:{color:`#8b5cf6`,fontSize:a.length>2?20:34}}):(0,$.jsx)(nie,{style:{color:s===`deleted`?`#98A2B3`:`#A45B5B`,fontSize:a.length>2?20:34}}),(0,$.jsx)(`span`,{style:{fontSize:a.length>2?10:12,color:g||y?`#8b5cf6`:s===`deleted`?`#98A2B3`:`#A45B5B`,fontWeight:500},children:x}),(0,$.jsx)(Eoe,{item:r,isPending:g||y,isCompleted:_,onAnimationComplete:()=>f(v),onProgressChange:e=>d(v,e)}),!g&&r.errorMessage&&a.length<=2?(0,$.jsx)(`span`,{style:{fontSize:10,color:`#A45B5B`,lineHeight:1.3,maxHeight:28,overflow:`hidden`},children:r.errorMessage}):null]}),a.length>1?(0,$.jsxs)(`span`,{style:{position:`absolute`,top:5,left:5,zIndex:2,padding:`1px 6px`,borderRadius:10,background:`rgba(17,24,39,.58)`,color:`#fff`,fontSize:10},children:[`#`,r.generationIndex||i+1]}):null]},r.id||`${i}`)})})},{Text:G7}=Q,Ooe=({items:e,selectedId:t,onSelect:n})=>e.length?(0,$.jsx)(sH,{orientation:`vertical`,style:{width:`100%`},size:10,children:e.map(e=>{let r=t===e.id;return(0,$.jsxs)(`div`,{onClick:()=>n(e),style:{padding:14,borderRadius:14,cursor:`pointer`,border:r?`1px solid #8b5cf6`:`1px solid #e2e8f0`,background:r?`#f5f3ff`:`#fff`},children:[(0,$.jsx)(sH,{style:{width:`100%`,justifyContent:`space-between`},align:`start`,children:(0,$.jsxs)(`div`,{style:{minWidth:0},children:[(0,$.jsx)(G7,{strong:!0,ellipsis:!0,style:{display:`block`},children:e.name}),e.description&&(0,$.jsx)(G7,{type:`secondary`,ellipsis:!0,style:{display:`block`,fontSize:12},children:e.description})]})}),(0,$.jsxs)(sH,{wrap:!0,size:4,style:{marginTop:10},children:[(0,$.jsxs)(XQ,{children:[`总 `,e.assetCount||0]}),(0,$.jsxs)(XQ,{color:`green`,children:[`图 `,e.imageAssetCount||0]}),(0,$.jsxs)(XQ,{color:`blue`,children:[`视频 `,e.videoAssetCount||0]})]})]},e.id)})}):(0,$.jsx)(XS,{description:`暂无项目组`}),koe={Active:`green`,Processing:`processing`,Failed:`red`,local_deleted:`default`,remote_deleted:`default`,delete_failed:`red`},Aoe={Active:`入库成功`,Processing:`入库处理中`,Failed:`入库失败`,local_deleted:`本地已删除`,remote_deleted:`远程已删除`,delete_failed:`删除失败`},K7=e=>e?e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`data:`)||e.startsWith(`blob:`)?e:`${`http://ceshi.apiforeign.minzhong.cn`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`:``,q7=e=>e.assetType===`Video`?K7(e.videoCoverUrl||e.previewUrl||e.displayUrl||e.remoteUrl||e.sourceUrl):K7(e.previewUrl||e.displayUrl||e.videoCoverUrl||e.remoteUrl||e.sourceUrl),joe=e=>{let t=Number(e||0);return!Number.isFinite(t)||t<=0?`-`:`${t.toFixed(t>=10?0:1)}s`},Moe=({items:e,onDelete:t,onRefresh:n})=>{let r=(0,S.useRef)(null),[i,a]=(0,S.useState)(!1),[o,s]=(0,S.useState)(``),[c,l]=(0,S.useState)(`Image`);(0,S.useEffect)(()=>(e.some(e=>e.status!==`Failed`&&e.status!==`Active`)&&n?r.current||=window.setInterval(()=>{n()},3e3):r.current&&=(clearInterval(r.current),null),()=>{r.current&&=(clearInterval(r.current),null)}),[e,n]);let u=e=>{let t=q7(e);t&&(s(t),l(e.assetType===`Video`?`Video`:`Image`),a(!0))};return e.length?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(220px, 1fr))`,gap:14},children:e.map(e=>{let n=e.assetType===`Video`,r=q7(e);return(0,$.jsx)(DL,{hoverable:!0,bodyStyle:{padding:12},style:{borderRadius:16,overflow:`hidden`,borderColor:`#eef2f7`},cover:(0,$.jsxs)(`div`,{style:{height:170,background:`#f8fafc`,display:`flex`,alignItems:`center`,justifyContent:`center`,position:`relative`},children:[r?n&&e.videoCoverUrl?(0,$.jsx)(`img`,{src:r,alt:e.name||`视频封面`,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):n?(0,$.jsx)(`video`,{src:r,muted:!0,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(`img`,{src:r,alt:e.name||``,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):n?(0,$.jsx)(t5,{style:{fontSize:42,color:`#64748b`}}):(0,$.jsx)(R6,{style:{fontSize:42,color:`#64748b`}}),n&&(0,$.jsx)(XQ,{color:`blue`,style:{position:`absolute`,left:10,top:10},children:`视频`}),r&&(0,$.jsx)(X,{size:`small`,shape:`circle`,icon:(0,$.jsx)(mW,{}),style:{position:`absolute`,right:10,top:10},onClick:()=>u(e)}),n&&(0,$.jsx)(`div`,{style:{position:`absolute`,left:10,bottom:10,padding:`2px 6px`,borderRadius:8,background:`rgba(15,23,42,0.72)`,color:`#fff`,fontSize:12},children:joe(e.videoDuration)})]}),children:(0,$.jsxs)(sH,{direction:`vertical`,size:8,style:{width:`100%`},children:[(0,$.jsx)(gw,{title:e.name||e.remoteAssetId||e.id,children:(0,$.jsx)(`div`,{style:{fontWeight:600,color:`#1e293b`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:e.name||e.remoteAssetId||`未命名素材`})}),(0,$.jsxs)(sH,{wrap:!0,size:4,children:[(0,$.jsx)(XQ,{color:koe[e.status]||`default`,children:Aoe[e.status]||e.status}),(0,$.jsx)(XQ,{color:n?`blue`:`default`,children:n?`视频`:`图片`})]}),(0,$.jsx)(sH,{size:6,wrap:!0,children:(0,$.jsx)(vK,{title:`确认删除这个素材吗?`,onConfirm:()=>t(e.id),children:(0,$.jsx)(X,{size:`small`,danger:!0,icon:(0,$.jsx)(u$,{}),children:`删除`})})})]})},e.id)})}),(0,$.jsx)(mK,{title:`素材预览`,open:i,onCancel:()=>a(!1),footer:null,width:760,destroyOnClose:!0,children:(0,$.jsx)(`div`,{style:{minHeight:420,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`#0f172a`,borderRadius:12,overflow:`hidden`},children:c===`Video`?(0,$.jsx)(`video`,{src:o,controls:!0,autoPlay:!0,style:{maxWidth:`100%`,maxHeight:520}}):(0,$.jsx)(`img`,{src:o,alt:`素材预览`,style:{maxWidth:`100%`,maxHeight:520,objectFit:`contain`}})})})]}):(0,$.jsx)(XS,{description:`暂无素材`})},J7=(0,S.createContext)(void 0),Noe=({children:e,refreshConfig:t})=>(0,$.jsx)(J7.Provider,{value:{refreshConfig:t},children:e}),Y7=()=>{let e=(0,S.useContext)(J7);if(!e)throw Error(`useLibrary must be used within a LibraryProvider`);return e},X7=2,Z7=15,Poe=e=>new Promise(t=>{if(!e.type.startsWith(`video/`)){t(null);return}let n=URL.createObjectURL(e),r=document.createElement(`video`);r.preload=`metadata`,r.onloadedmetadata=()=>{let e=Number.isFinite(r.duration)?r.duration:null;URL.revokeObjectURL(n),t(e)},r.onerror=()=>{URL.revokeObjectURL(n),t(null)},r.src=n}),Foe=e=>e==null||!Number.isFinite(e)||e<=0?(Z.error(`无法读取视频秒数,请检查视频文件是否损坏`),!1):eZ7?(Z.error(`视频素材最长不能超过 ${Z7} 秒`),!1):!0,Ioe=({projectId:e,open:t,onClose:n,onSuccess:r})=>{let{refreshConfig:i}=Y7(),[a,o]=(0,S.useState)([]),[s,c]=(0,S.useState)({}),[l,u]=(0,S.useState)({}),[d,f]=(0,S.useState)({}),[p,m]=(0,S.useState)({}),[h,g]=(0,S.useState)(!1),_=()=>{o([]),c({}),u({}),f({}),m({})};return(0,$.jsx)(mK,{title:`上传真人素材`,open:t,onCancel:()=>{_(),n()},onOk:async()=>{let t=a.filter(e=>l[e.uid]===`uploaded`);if(t.length===0){Z.warning(`请等待文件上传完成后再提交入库`);return}g(!0);try{for(let n of t){let t=n.originFileObj;if(!t)continue;let r=d[n.uid];if(!r)continue;m(e=>({...e,[n.uid]:`importing`}));let i=t.type.startsWith(`image/`)?`Image`:`Video`;await Aae(e,{url:r.url,assetType:i,name:s[n.uid]?.trim()||t.name,videoDuration:r.duration_seconds,fileSize:r.file_size_bytes??t.size,mimeType:t.type||null,uploadResourceId:r.resource_id||null}),m(e=>({...e,[n.uid]:`imported`}))}Z.success(`已成功提交 ${t.length} 个素材入库,处理中`),i(),setTimeout(()=>{_(),r(),n()},1500)}catch(e){Z.error(e?.message||`提交入库失败`)}finally{g(!1)}},confirmLoading:h,okText:`提交入库`,destroyOnHidden:!0,width:650,okButtonProps:{disabled:a.length===0||a.some(e=>l[e.uid]!==`uploaded`)},children:(0,$.jsx)(`div`,{style:{maxHeight:600,overflow:`auto`,marginTop:30},children:(0,$.jsxs)(sH,{direction:`vertical`,style:{width:`100%`},size:14,children:[(0,$.jsx)(b0,{accept:`image/*,video/*`,fileList:a,multiple:!0,beforeUpload:async e=>{let t=`${Date.now()}-${Math.random().toString(36).substr(2,9)}`,n=e.type.startsWith(`image/`),r=URL.createObjectURL(e),i={uid:t,name:e.name,status:`uploading`,originFileObj:e,thumbUrl:r,type:e.type};o(e=>[...e,i]),c(e=>({...e,[t]:``})),u(e=>({...e,[t]:`uploading`}));try{let r=n?`Image`:`Video`,i=r===`Video`?await Poe(e):null;if(r===`Video`&&!Foe(i))return u(e=>({...e,[t]:`error`})),!1;let a=r===`Video`?await Eie(e,i||void 0):await Tie(e);f(e=>({...e,[t]:{url:a.url,duration_seconds:a.duration_seconds,file_size_bytes:a.file_size_bytes,resource_id:a.resource_id}})),u(e=>({...e,[t]:`uploaded`}))}catch{u(e=>({...e,[t]:`error`})),Z.error(`文件 ${e.name} 上传失败`)}return!1},listType:`picture`,itemRender:(e,t,n)=>{let r=t.type?.startsWith(`video/`)||t.name.match(/\.(mp4|mov|avi|webm)$/i),i=l[t.uid],a=p[t.uid];return(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,padding:12,border:`1px solid #e5e7eb`,borderRadius:8,marginBottom:8},children:[(0,$.jsx)(`div`,{style:{width:64,height:64,borderRadius:8,overflow:`hidden`,flexShrink:0},children:t.thumbUrl||t.url?r?(0,$.jsx)(`video`,{src:t.thumbUrl||t.url,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(`img`,{src:t.thumbUrl||t.url,alt:t.name,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,backgroundColor:`#f1f5f9`},children:r?(0,$.jsx)(t5,{style:{color:`#94a3b8`,fontSize:20}}):(0,$.jsx)(R6,{style:{color:`#94a3b8`,fontSize:20}})})}),(0,$.jsx)(`span`,{style:{width:`20%`,overflow:`hidden`,whiteSpace:`nowrap`,textOverflow:`ellipsis`,fontSize:13,color:`#64748b`,flexShrink:0},children:t.name}),(0,$.jsx)(IW,{style:{width:200,flexShrink:0},value:s[t.uid]||``,onChange:e=>c({...s,[t.uid]:e.target.value}),placeholder:`素材名称,默认使用文件名`,maxLength:256}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[i===`uploading`&&(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,$.jsx)(UG,{size:`small`,style:{color:`#6366f1`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#6366f1`},children:`上传中`})]}),i===`uploaded`&&!a&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#10b981`},children:`✓ 上传完成`}),i===`error`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#ef4444`},children:`✗ 上传失败`}),a===`importing`&&(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,$.jsx)(UG,{size:`small`,style:{color:`#6366f1`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#6366f1`},children:`入库中`})]}),a===`imported`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#10b981`},children:`✓ 已入库校验`}),a===`error`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#ef4444`},children:`✗ 入库失败`})]}),(0,$.jsx)(`button`,{onClick:e=>{e.stopPropagation(),o(e=>e.filter(e=>e.uid!==t.uid)),c(e=>{let n={...e};return delete n[t.uid],n}),u(e=>{let n={...e};return delete n[t.uid],n}),f(e=>{let n={...e};return delete n[t.uid],n}),m(e=>{let n={...e};return delete n[t.uid],n})},style:{width:28,height:28,borderRadius:`50%`,backgroundColor:`#f1f5f9`,border:`none`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0},children:(0,$.jsx)(u$,{style:{color:`#64748b`,fontSize:14}})})]})},children:(0,$.jsx)(X,{icon:(0,$.jsx)(X8,{}),children:`选择图片或视频`})}),(0,$.jsxs)(`div`,{style:{padding:12,background:`#f8fafc`,borderRadius:12,color:`#64748b`,fontSize:13},children:[`当前开放图片和视频,音频暂不接入。视频素材必须在 `,X7,`~`,Z7,` 秒内;入库后会经过火山真人一致性校验,入库校验成功 后才可用于 AI 创作。`]})]})})})},Loe=({project:e,onDeleted:t,onChanged:n})=>{let{refreshConfig:r}=Y7(),[i,a]=(0,S.useState)([]),[o,s]=(0,S.useState)(!1),[c,l]=(0,S.useState)(!1),[u,d]=(0,S.useState)(``),[f,p]=(0,S.useState)(),[m,h]=(0,S.useState)(),[g,_]=(0,S.useState)(1),[v,y]=(0,S.useState)(20),[b,x]=(0,S.useState)(0),C=async(t=g,n=v)=>{s(!0);try{let r=await jae(e.id,{page:t,pageSize:n,keyword:u,status:f,assetType:m});a(r.items),x(r.total||0),_(t),y(n)}catch(e){Z.error(e?.message||`加载素材失败`)}finally{s(!1)}};(0,S.useEffect)(()=>{C(1,v)},[e.id,u,f,m]);let w=async e=>{try{await Mae(e),await C(g,v),n(),r(),Z.success(`素材已删除`)}catch(e){Z.error(e?.message||`删除素材失败`)}},T=async()=>{try{await Oae(e.id),Z.success(`项目组已删除`),t()}catch(e){Z.error(e?.message||`删除项目组失败`)}},E=e.status===`active`;return(0,$.jsxs)(DL,{title:(0,$.jsx)(sH,{children:(0,$.jsx)(`span`,{children:e.name})}),extra:(0,$.jsxs)(sH,{children:[(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(X8,{}),disabled:!E,onClick:()=>l(!0),children:`上传素材`}),(0,$.jsx)(vK,{title:`确认删除这个真人素材项目组吗?`,onConfirm:T,children:(0,$.jsx)(X,{danger:!0,icon:(0,$.jsx)(u$,{}),children:`删除项目组`})})]}),style:{borderRadius:16},children:[!E&&(0,$.jsx)(Q.Paragraph,{style:{color:`#f97316`},children:`项目组未完成真人认证,暂不能上传素材。请重新创建项目组并完成手机扫码认证。`}),(0,$.jsxs)(sH,{style:{width:`100%`,marginBottom:16},wrap:!0,children:[(0,$.jsx)(IW.Search,{allowClear:!0,placeholder:`搜索素材名称`,value:u,onChange:e=>d(e.target.value),onSearch:()=>C(1,v),style:{width:240}}),(0,$.jsx)(EC,{allowClear:!0,placeholder:`素材状态`,value:f,onChange:e=>p(e),style:{width:150},options:[{value:`Processing`,label:`处理中`},{value:`Active`,label:`可用`},{value:`Failed`,label:`失败`}]}),(0,$.jsx)(EC,{allowClear:!0,placeholder:`素材类型`,value:m,onChange:e=>h(e),style:{width:130},options:[{value:`Image`,label:`图片`},{value:`Video`,label:`视频`}]}),(0,$.jsx)(X,{onClick:()=>C(1,v),children:`筛选`})]}),(0,$.jsx)(UG,{spinning:o,children:i.length===0?(0,$.jsx)(XS,{description:`暂无素材,上传图片/视频后会异步入库`,style:{marginTop:80}}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Moe,{items:i,loading:o,onDelete:w,onRefresh:()=>C(g,v)}),(0,$.jsx)(`div`,{style:{textAlign:`right`,marginTop:16},children:(0,$.jsx)(SG,{current:g,pageSize:v,total:b,showSizeChanger:!0,showTotal:e=>`共 ${e} 个素材`,onChange:(e,t)=>C(e,t)})})]})}),(0,$.jsx)(Ioe,{projectId:e.id,open:c,onClose:()=>l(!1),onSuccess:()=>{C(1,v),n()}})]})},Q7=`group_active`,$7=2e3,Roe=()=>{let[e,t]=(0,S.useState)([]),[n,r]=(0,S.useState)(null),[i,a]=(0,S.useState)(!1),[o,s]=(0,S.useState)(!1),[c,l]=(0,S.useState)(!1),[u,d]=(0,S.useState)(null),[f,p]=(0,S.useState)(null),[m,h]=(0,S.useState)(!1),[g]=tU.useForm(),_=(0,S.useRef)(null),v=()=>{_.current&&=(window.clearInterval(_.current),null)},y=()=>{v(),s(!1),l(!1),h(!1),d(null),p(null),g.resetFields()},b=async()=>{a(!0);try{let e=await m7({pageSize:100,status:`active`});t(e.items),r(t=>t?e.items.find(e=>e.id===t.id)||e.items[0]||null:e.items[0]||null)}catch(e){Z.error(e?.message||`加载真人素材项目组失败`)}finally{a(!1)}};(0,S.useEffect)(()=>{b()},[]),(0,S.useEffect)(()=>()=>v(),[]);let x=async e=>{v(),h(!1),Z.success(`真人认证完成,项目组已创建成功`),s(!1),p(null),d(null),g.resetFields();let n=await m7({pageSize:100,status:`active`});t(n.items),r(n.items.find(t=>t.id===e)||n.items[0]||null)},C=(e,t,n)=>{v(),h(!0);let r=async()=>{try{let n=await kae(e);if(p(n),n.status===Q7){await x(t);return}[`callback_failed`,`failed`,`expired`].includes(n.status)&&(v(),h(!1),Z.error(n.errorMessage||`真人认证未完成,请重新创建项目组`))}catch(e){v(),h(!1),Z.error(e?.message||`轮询真人认证状态失败`)}};_.current=window.setInterval(r,Math.max(1e3,n||$7)),r()},w=async()=>{let e=await g.validateFields();l(!0);try{let t=`${window.location.origin}/private-portrait-authorized`,n=await Dae({...e,callbackRedirectUrl:t});d(n.project),p(n.validateSession),Z.success(`请使用手机扫码完成人脸认证`),n.validateSession?.id&&C(n.validateSession.id,n.project.id,n.pollIntervalMs||$7)}catch(e){Z.error(e?.message||`创建项目组认证二维码失败`)}finally{l(!1)}},T=f?.h5Link||``,E=f?.status===Q7;return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{marginBottom:16,display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Title,{level:4,style:{margin:0},children:`真人素材库`}),(0,$.jsx)(Q.Text,{type:`secondary`,children:`创建项目组时先完成真人认证,认证成功后项目组才会正式创建并可上传素材。`})]}),(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(rL,{}),onClick:()=>s(!0),style:{borderRadius:8,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`创建项目组`})]}),(0,$.jsxs)(Yq,{gutter:16,children:[(0,$.jsx)(JR,{xs:24,lg:5,children:(0,$.jsx)(DL,{style:{borderRadius:16,minHeight:520},children:(0,$.jsx)(UG,{spinning:i,children:e.length===0?(0,$.jsx)(XS,{description:`暂无真人项目组`}):(0,$.jsx)(Ooe,{items:e,selectedId:n?.id,onSelect:r})})})}),(0,$.jsx)(JR,{xs:24,lg:19,children:n?(0,$.jsx)(Loe,{project:n,onDeleted:()=>{r(null),b()},onChanged:b}):(0,$.jsx)(DL,{style:{borderRadius:16,minHeight:520,textAlign:`center`,color:`#94a3b8`},children:`请先创建或选择一个真人素材项目组`})})]}),(0,$.jsx)(mK,{title:`新建真人素材项目组`,open:o,onCancel:y,footer:f?[(0,$.jsx)(X,{onClick:y,children:`关闭`},`close`)]:void 0,onOk:f?void 0:w,okText:`开始认证并创建`,confirmLoading:c,mask:{closable:!m},children:f?(0,$.jsxs)(sH,{direction:`vertical`,align:`center`,size:16,style:{width:`100%`},children:[E?(0,$.jsx)(d4,{style:{fontSize:54,color:`#22c55e`}}):T?(0,$.jsx)(kq,{value:T,size:220}):(0,$.jsx)(UG,{}),(0,$.jsxs)(`div`,{style:{textAlign:`center`},children:[(0,$.jsx)(Q.Title,{level:5,style:{marginBottom:8},children:u?.name||`真人素材项目组`}),(0,$.jsx)(Q.Text,{type:E?`success`:`secondary`,children:E?`认证成功,项目组正在刷新`:`请使用手机扫码完成人脸认证,成功后回到电脑端查看项目组。`})]})]}):(0,$.jsxs)(tU,{form:g,layout:`vertical`,children:[(0,$.jsx)(tU.Item,{label:`项目组名称`,name:`name`,rules:[{required:!0,message:`请输入项目组名称`}],children:(0,$.jsx)(IW,{placeholder:`例如:达人A、客户B、张三人像`})}),(0,$.jsx)(tU.Item,{label:`描述`,name:`description`,children:(0,$.jsx)(IW.TextArea,{rows:3,placeholder:`可选`})}),(0,$.jsx)(Q.Paragraph,{type:`secondary`,style:{marginBottom:0},children:`点击后会生成真人认证二维码。手机扫码认证成功后,项目组才会出现在项目列表中。`})]})})]})},{Text:e9}=Q,t9=2,n9=15,zoe={creating:{label:`本地创建中`,color:`processing`},Processing:{label:`入库处理中`,color:`processing`},Active:{label:`入库成功`,color:`success`},Failed:{label:`入库失败`,color:`error`},local_deleted:{label:`本地已删`,color:`default`},remote_deleted:{label:`远端已删`,color:`default`},delete_failed:{label:`远端删除失败`,color:`error`}},Boe=e=>{let t=Number(e||0);return!Number.isFinite(t)||t<=0?`-`:`${t.toFixed(t>=10?0:1)}s`},r9=e=>e?e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`data:`)||e.startsWith(`blob:`)?e:`${`http://ceshi.apiforeign.minzhong.cn`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`:``,i9=e=>e.assetType===`Video`?r9(e.videoCoverUrl||e.previewUrl||e.displayUrl||e.remoteUrl||e.sourceUrl):r9(e.previewUrl||e.displayUrl||e.videoCoverUrl||e.remoteUrl||e.sourceUrl),Voe=e=>new Promise(t=>{if(!e.type.startsWith(`video/`)){t(null);return}let n=URL.createObjectURL(e),r=document.createElement(`video`);r.preload=`metadata`,r.onloadedmetadata=()=>{let e=Number.isFinite(r.duration)?r.duration:null;URL.revokeObjectURL(n),t(e)},r.onerror=()=>{URL.revokeObjectURL(n),t(null)},r.src=n}),Hoe=(e,t)=>e==null||!Number.isFinite(e)||e<=0?(t(`无法读取视频秒数,请检查视频文件是否损坏`),!1):en9?(t(`视频素材最长不能超过 ${n9} 秒`),!1):!0,Uoe=({status:e})=>{let t=e||`-`,n=zoe[t];return(0,$.jsx)(XQ,{color:n?.color||`default`,children:n?.label||t})},Woe=()=>{let{message:e}=Vb.useApp(),{refreshConfig:t}=Y7(),[n,r]=(0,S.useState)([]),[i,a]=(0,S.useState)(),[o,s]=(0,S.useState)([]),[c,l]=(0,S.useState)(!1),[u,d]=(0,S.useState)(!1),[f,p]=(0,S.useState)(1),[m,h]=(0,S.useState)(20),[g,_]=(0,S.useState)(0),[v,y]=(0,S.useState)(``),[b,x]=(0,S.useState)(),[C,w]=(0,S.useState)(),[T,E]=(0,S.useState)(!1),[D,O]=(0,S.useState)(!1),[k,A]=(0,S.useState)(!1),[j,M]=(0,S.useState)(!1),[N,P]=(0,S.useState)([]),[F,I]=(0,S.useState)({}),[L,R]=(0,S.useState)({}),[z,B]=(0,S.useState)({}),[V,H]=(0,S.useState)({}),[U,W]=(0,S.useState)(!1),[ee,te]=(0,S.useState)(``),[G,ne]=(0,S.useState)(`Image`),[re]=tU.useForm(),ie=(0,S.useRef)(null),ae=(0,S.useMemo)(()=>n.find(e=>e.id===i)||null,[n,i]),oe=async()=>{l(!0);try{let e=(await g7({page:1,pageSize:100,status:`active`})).items||[];r(e),a(t=>t&&e.some(e=>e.id===t)?t:e[0]?.id)}catch(t){e.error(t?.message||`加载虚拟人像项目组失败`)}finally{l(!1)}},K=async(t=f,n=m)=>{if(!i){s([]),_(0);return}d(!0);try{let e=await Lae(i,{page:t,pageSize:n,keyword:v.trim()||void 0,status:b,assetType:C});s(e.items||[]),_(e.total||0),p(t),h(n)}catch(t){e.error(t?.message||`加载虚拟人像素材失败`)}finally{d(!1)}},q=async()=>{await oe()};(0,S.useEffect)(()=>{q()},[]),(0,S.useEffect)(()=>{i&&K(1,m)},[i]),(0,S.useEffect)(()=>(o.some(e=>e.status!==`Failed`&&e.status!==`Active`)&&i?ie.current||=window.setInterval(()=>{K(f,m)},3e3):ie.current&&=(clearInterval(ie.current),null),()=>{ie.current&&=(clearInterval(ie.current),null)}),[o,i,f,m]);let se=async()=>{let t=await re.validateFields();O(!0);try{let n=await Pae(t);e.success(`虚拟人像项目组已创建`),E(!1),re.resetFields(),await oe(),a(n.id)}catch(t){e.error(t?.message||`创建项目组失败`)}finally{O(!1)}},ce=async()=>{if(!i){e.warning(`请先创建或选择项目组`);return}if(N.length===0){e.warning(`请先选择图片或视频素材`);return}let n=N.filter(e=>L[e.uid]===`uploaded`);if(n.length===0){e.warning(`请等待文件上传完成后再提交入库`);return}M(!0);try{for(let e of n){let t=e.originFileObj;if(!t)continue;let n=z[e.uid];if(!n)continue;H(t=>({...t,[e.uid]:`importing`}));let r=t.type.startsWith(`image/`)?`Image`:`Video`;await Iae(i,{url:n.url,assetType:r,name:F[e.uid]?.trim()||t.name,videoDuration:n.duration_seconds,fileSize:n.file_size_bytes??t.size,mimeType:t.type||null,uploadResourceId:n.resource_id||null}),H(t=>({...t,[e.uid]:`imported`}))}e.success(`已成功提交 ${n.length} 个素材入库,处理中`),setTimeout(()=>{A(!1),P([]),I({}),R({}),B({}),H({})},1500),await Promise.all([oe(),K(1,m),t()])}catch(t){e.error(t?.message||`提交入库失败`)}finally{M(!1)}},le=async n=>{try{await Rae(n),e.success(`素材已删除,远端删除将异步执行`),await Promise.all([oe(),K(f,m),t()])}catch(t){e.error(t?.message||`删除素材失败`)}},ue=async()=>{if(i)try{await Fae(i),e.success(`项目组已删除,远端资产组将异步删除`),a(void 0),await q()}catch(t){e.error(t?.message||`删除项目组失败`)}},de=t=>{let n=i9(t);if(!n){e.warning(`暂无可预览地址`);return}te(n),ne(t.assetType===`Video`?`Video`:`Image`),W(!0)};return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{marginBottom:16,display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Title,{level:4,style:{margin:0},children:`虚拟素材库`}),(0,$.jsx)(Q.Text,{type:`secondary`,children:`可提前上传虚拟人像素材,后续生成视频时可直接使用。`})]}),(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(rL,{}),onClick:()=>E(!0),style:{borderRadius:8,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`创建项目组`})]}),(0,$.jsxs)(Yq,{gutter:[10,10],children:[(0,$.jsx)(JR,{xs:24,lg:5,children:(0,$.jsx)(DL,{style:{borderRadius:16,minHeight:520,margin:`0 auto`,maxWidth:1200},children:(0,$.jsx)(UG,{spinning:c,children:n.length===0?(0,$.jsx)(XS,{description:`暂无虚拟人像项目组`}):(0,$.jsx)(sH,{orientation:`vertical`,style:{width:`100%`},size:10,children:n.map(e=>{let t=i===e.id;return(0,$.jsxs)(`div`,{onClick:()=>a(e.id),style:{padding:14,borderRadius:14,cursor:`pointer`,border:t?`1px solid #8b5cf6`:`1px solid #e2e8f0`,background:t?`#f5f3ff`:`#fff`},children:[(0,$.jsx)(sH,{style:{width:`100%`,justifyContent:`space-between`},align:`start`,children:(0,$.jsxs)(`div`,{style:{minWidth:0},children:[(0,$.jsx)(e9,{strong:!0,ellipsis:!0,style:{display:`block`},children:e.name}),e.description&&(0,$.jsx)(e9,{type:`secondary`,ellipsis:!0,style:{display:`block`,fontSize:12},children:e.description})]})}),(0,$.jsxs)(sH,{wrap:!0,size:4,style:{marginTop:10},children:[(0,$.jsxs)(XQ,{children:[`总 `,e.assetCount||0]}),(0,$.jsxs)(XQ,{color:`green`,children:[`图 `,e.imageAssetCount||0]}),(0,$.jsxs)(XQ,{color:`blue`,children:[`视频 `,e.videoAssetCount||0]})]})]},e.id)})})})})}),(0,$.jsx)(JR,{xs:24,lg:19,children:(0,$.jsxs)(DL,{title:ae?ae.name:`素材资产`,extra:(0,$.jsxs)(sH,{wrap:!0,children:[(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(X8,{}),disabled:!i,onClick:()=>A(!0),style:{borderRadius:8,fontWeight:600,borderColor:`transparent`},children:`上传图片/视频`}),i&&(0,$.jsx)(vK,{title:`确认删除当前虚拟人像项目组吗?`,onConfirm:ue,children:(0,$.jsx)(X,{danger:!0,icon:(0,$.jsx)(u$,{}),style:{borderRadius:8,fontWeight:600},children:`删除项目组`})})]}),style:{borderRadius:16,minHeight:520},children:[(0,$.jsxs)(sH,{style:{width:`100%`,marginBottom:16},wrap:!0,children:[(0,$.jsx)(IW.Search,{allowClear:!0,placeholder:`搜索素材名称`,value:v,onChange:e=>y(e.target.value),onSearch:()=>K(1,m),style:{width:240,borderRadius:8},enterButton:!0}),(0,$.jsx)(EC,{allowClear:!0,placeholder:`素材状态`,value:b,onChange:e=>x(e),style:{width:140,borderRadius:8},options:[{value:`Processing`,label:`处理中`},{value:`Active`,label:`可用`},{value:`Failed`,label:`失败`}]}),(0,$.jsx)(EC,{allowClear:!0,placeholder:`素材类型`,value:C,onChange:e=>w(e),style:{width:120,borderRadius:8},options:[{value:`Image`,label:`图片`},{value:`Video`,label:`视频`}]}),(0,$.jsx)(X,{type:`primary`,onClick:()=>K(1,m),style:{borderRadius:8,fontWeight:600,borderColor:`transparent`},children:`筛选`})]}),(0,$.jsx)(UG,{spinning:u,children:i?o.length===0?(0,$.jsx)(XS,{description:`暂无素材,上传图片/视频后会异步入库`,style:{marginTop:80}}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(220px, 1fr))`,gap:14},children:o.map(e=>{let t=i9(e),n=e.assetType===`Video`;return(0,$.jsx)(DL,{hoverable:!0,styles:{body:{padding:12}},style:{borderRadius:16,overflow:`hidden`,borderColor:`#eef2f7`},cover:(0,$.jsxs)(`div`,{style:{height:170,background:`#f8fafc`,display:`flex`,alignItems:`center`,justifyContent:`center`,position:`relative`},children:[t?n&&e.videoCoverUrl?(0,$.jsx)(`img`,{src:t,alt:e.name||`视频封面`,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):n?(0,$.jsx)(`video`,{src:t,muted:!0,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(`img`,{src:t,alt:e.name||`虚拟人像素材`,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):n?(0,$.jsx)(t5,{style:{fontSize:42,color:`#64748b`}}):(0,$.jsx)(R6,{style:{fontSize:42,color:`#64748b`}}),n&&(0,$.jsx)(XQ,{color:`blue`,style:{position:`absolute`,left:10,top:10},children:`视频`}),t&&(0,$.jsx)(X,{size:`small`,shape:`circle`,icon:(0,$.jsx)(mW,{}),style:{position:`absolute`,right:10,top:10},onClick:()=>de(e)}),n&&(0,$.jsx)(`div`,{style:{position:`absolute`,left:10,bottom:10,padding:`2px 6px`,borderRadius:8,background:`rgba(15,23,42,0.72)`,color:`#fff`,fontSize:12},children:Boe(e.videoDuration)})]}),children:(0,$.jsxs)(sH,{direction:`vertical`,size:8,style:{width:`100%`},children:[(0,$.jsx)(gw,{title:e.name||e.remoteAssetId||e.id,children:(0,$.jsx)(`div`,{style:{fontWeight:600,color:`#1e293b`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:e.name||e.remoteAssetId||`未命名素材`})}),(0,$.jsxs)(sH,{wrap:!0,size:4,children:[(0,$.jsx)(Uoe,{status:e.status}),(0,$.jsx)(XQ,{color:n?`blue`:`default`,children:n?`视频`:`图片`})]}),(0,$.jsx)(sH,{size:6,wrap:!0,children:(0,$.jsx)(vK,{title:`确认删除这个虚拟人像素材吗?`,onConfirm:()=>le(e.id),children:(0,$.jsx)(X,{size:`small`,danger:!0,icon:(0,$.jsx)(u$,{}),children:`删除`})})})]})},e.id)})}),(0,$.jsx)(`div`,{style:{textAlign:`right`,marginTop:16},children:(0,$.jsx)(SG,{current:f,pageSize:m,total:g,showSizeChanger:!0,showTotal:e=>`共 ${e} 个素材`,onChange:(e,t)=>K(e,t)})})]}):(0,$.jsx)(XS,{description:`请先创建或选择项目组`,style:{marginTop:80}})})]})})]}),(0,$.jsx)(mK,{title:`创建虚拟人像项目组`,open:T,onCancel:()=>E(!1),onOk:se,confirmLoading:D,okText:`创建项目组`,children:(0,$.jsxs)(tU,{form:re,layout:`vertical`,children:[(0,$.jsx)(tU.Item,{name:`name`,label:`项目组名称`,rules:[{required:!0,message:`请输入项目组名称`}],children:(0,$.jsx)(IW,{placeholder:`例如:虚拟主播A / 品牌代言人B`,maxLength:128})}),(0,$.jsx)(tU.Item,{name:`description`,label:`描述`,children:(0,$.jsx)(IW.TextArea,{placeholder:`可填写人物设定、服装风格、素材要求等`,maxLength:2e3,rows:4})})]})}),(0,$.jsx)(mK,{title:`上传虚拟人像素材`,open:k,onCancel:()=>A(!1),onOk:ce,confirmLoading:j,okText:`提交入库`,width:650,okButtonProps:{disabled:N.length===0||N.some(e=>L[e.uid]!==`uploaded`)},children:(0,$.jsx)(`div`,{style:{maxHeight:600,overflow:`auto`,marginTop:30},children:(0,$.jsxs)(sH,{direction:`vertical`,style:{width:`100%`},size:14,children:[(0,$.jsx)(b0,{accept:`image/*,video/*`,fileList:N,multiple:!0,beforeUpload:async t=>{let n=`${Date.now()}-${Math.random().toString(36).substr(2,9)}`,r=t.type.startsWith(`image/`),i=URL.createObjectURL(t),a={uid:n,name:t.name,status:`uploading`,originFileObj:t,thumbUrl:i,type:t.type};P(e=>[...e,a]),I(e=>({...e,[n]:``})),R(e=>({...e,[n]:`uploading`}));try{let i=r?`Image`:`Video`,a=i===`Video`?await Voe(t):null;if(i===`Video`&&!Hoe(a,e.error))return R(e=>({...e,[n]:`error`})),!1;let o=i===`Video`?await Oie(t,a||void 0):await Die(t);B(e=>({...e,[n]:{url:o.url,duration_seconds:o.duration_seconds,file_size_bytes:o.file_size_bytes,resource_id:o.resource_id}})),R(e=>({...e,[n]:`uploaded`}))}catch{R(e=>({...e,[n]:`error`})),e.error(`文件 ${t.name} 上传失败`)}return!1},listType:`picture`,itemRender:(e,t,n)=>{let r=t.type?.startsWith(`video/`)||t.name.match(/\.(mp4|mov|avi|webm)$/i),i=L[t.uid],a=V[t.uid];return(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,padding:12,border:`1px solid #e5e7eb`,borderRadius:8,marginBottom:8},children:[(0,$.jsx)(`div`,{style:{width:64,height:64,borderRadius:8,overflow:`hidden`,flexShrink:0},children:t.thumbUrl||t.url?r?(0,$.jsx)(`video`,{src:t.thumbUrl||t.url,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(`img`,{src:t.thumbUrl||t.url,alt:t.name,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,backgroundColor:`#f1f5f9`},children:r?(0,$.jsx)(t5,{style:{color:`#94a3b8`,fontSize:20}}):(0,$.jsx)(R6,{style:{color:`#94a3b8`,fontSize:20}})})}),(0,$.jsx)(`span`,{style:{width:`20%`,overflow:`hidden`,whiteSpace:`nowrap`,textOverflow:`ellipsis`,fontSize:13,color:`#64748b`,flexShrink:0},children:t.name}),(0,$.jsx)(IW,{style:{width:200,flexShrink:0},value:F[t.uid]||``,onChange:e=>I({...F,[t.uid]:e.target.value}),placeholder:`素材名称,默认使用文件名`,maxLength:256}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[i===`uploading`&&(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,$.jsx)(UG,{size:`small`,style:{color:`#6366f1`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#6366f1`},children:`上传中`})]}),i===`uploaded`&&!a&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#10b981`},children:`✓ 上传完成`}),i===`error`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#ef4444`},children:`✗ 上传失败`}),a===`importing`&&(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,$.jsx)(UG,{size:`small`,style:{color:`#6366f1`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#6366f1`},children:`入库中`})]}),a===`imported`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#10b981`},children:`✓ 已入库校验`}),a===`error`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#ef4444`},children:`✗ 入库失败`})]}),(0,$.jsx)(`button`,{onClick:e=>{e.stopPropagation(),P(e=>e.filter(e=>e.uid!==t.uid)),I(e=>{let n={...e};return delete n[t.uid],n}),R(e=>{let n={...e};return delete n[t.uid],n}),B(e=>{let n={...e};return delete n[t.uid],n}),H(e=>{let n={...e};return delete n[t.uid],n})},style:{width:28,height:28,borderRadius:`50%`,backgroundColor:`#f1f5f9`,border:`none`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0},children:(0,$.jsx)(u$,{style:{color:`#64748b`,fontSize:14}})})]})},children:(0,$.jsx)(X,{icon:(0,$.jsx)(X8,{}),children:`选择图片或视频`})}),(0,$.jsxs)(`div`,{style:{padding:12,background:`#f8fafc`,borderRadius:12,color:`#64748b`,fontSize:13},children:[`当前开放图片和视频,视频素材必须在 `,t9,`~`,n9,` 秒内;提交后会调用火山 CreateAsset 异步处理,状态变为 入库校验成功 后才可用于 AI 创作。`]})]})})}),(0,$.jsx)(mK,{title:`素材预览`,open:U,onCancel:()=>W(!1),footer:null,width:760,destroyOnHidden:!0,children:(0,$.jsx)(`div`,{style:{minHeight:420,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`#0f172a`,borderRadius:12,overflow:`hidden`},children:G===`Video`?(0,$.jsx)(`video`,{src:ee,controls:!0,autoPlay:!0,style:{maxWidth:`100%`,maxHeight:520}}):(0,$.jsx)(`img`,{src:ee,alt:`素材预览`,style:{maxWidth:`100%`,maxHeight:520,objectFit:`contain`}})})})]})},{Title:Goe,Text:Koe,Paragraph:qoe}=Q,a9=e=>e===`aigc_virtual`?`aigc_virtual`:`real_person`,Joe=()=>{let[e,t]=On(),[n,r]=(0,S.useState)(()=>a9(e.get(`portraitTab`))),[i,a]=(0,S.useState)(null),[o,s]=(0,S.useState)([]),[c,l]=(0,S.useState)(),u=async()=>{try{a(n===`aigc_virtual`?await h7():await p7())}catch(e){Z.error(e?.message||`加载配置失败`)}};(0,S.useEffect)(()=>{(async()=>{try{if(n===`aigc_virtual`){let[e,t]=await Promise.all([h7(),g7({page:1,pageSize:100,status:`active`})]);a(e);let n=t.items||[];s(n),l(e=>e&&n.some(t=>t.id===e)?e:n[0]?.id)}else{let[e,t]=await Promise.all([p7(),m7({pageSize:100,status:`active`})]);a(e);let n=t.items||[];s(n),l(e=>e&&n.some(t=>t.id===e)?e:n[0]?.id)}}catch(e){Z.error(e?.message||`加载数据失败`)}})()},[n]),(0,S.useMemo)(()=>o.find(e=>e.id===c)||null,[o,c]);let d=(0,S.useMemo)(()=>i?`已用 ${i.usedAssetCount||0} / ${i.assetLimit||0} 个素材,剩余 ${i.remainingAssetCount||0}`:`额度加载中`,[i]),f=(0,S.useMemo)(()=>[{key:`real_person`,label:`真人素材库`,children:(0,$.jsx)(Roe,{})},{key:`aigc_virtual`,label:`虚拟素材库`,children:(0,$.jsx)(Woe,{})}],[]);return(0,$.jsx)(Noe,{refreshConfig:u,children:(0,$.jsx)(`div`,{children:(0,$.jsx)(TL,{activeKey:n,onChange:n=>{let i=a9(n);r(i);let a=new URLSearchParams(e);a.set(`filterType`,`private_portrait`),a.set(`portraitTab`,i),t(a,{replace:!0})},items:f,destroyOnHidden:!1,tabBarExtraContent:(0,$.jsxs)(`div`,{style:{fontSize:14,fontWeight:700,color:`#4f46e5`,marginTop:8},children:[d,`。真人/虚拟共用,图片/视频共用。`]})})})})},{Header:Yoe,Sider:Xoe,Content:Zoe}=GW,{TextArea:Qoe}=IW,{Option:$oe}=EC,{Text:o9}=Q,ese=`http://ceshi.apiforeign.minzhong.cn`.replace(/\/api\/?$/i,``).replace(/\/$/,``),tse=e=>{if(!e)return``;let t=String(e).trim();return t?/^(https?:)?\/\//i.test(t)||/^(blob|data):/i.test(t)?t:`${ese}${t.startsWith(`/`)?t:`/${t}`}`:``},nse=()=>{let{message:e}=Vb.useApp(),t=Ke(),[n,r]=(0,S.useState)(!1),[i,a]=(0,S.useState)(`1`),[o,s]=(0,S.useState)([]),{mediaType:c,countType:l,generationCount:u,selectedRatio:d,selectedResolution:f,width:p,height:m,videoDuration:h,videoAspectRatio:g,videoResolution:_,engineOptions:v,enginesele:y,inputValue:b,setMediaType:x,setCountType:C,setGenerationCount:w,setSelectedRatio:T,setSelectedResolution:E,setWidth:D,setHeight:O,setVideoDuration:k,setVideoAspectRatio:A,setVideoResolution:j,setEngineOptions:M,setEnginesele:N,setInputValue:P,currentMedia:F,setCurrentMedia:I}=C7(),L=Array.isArray(y)?{}:y,R=(c===`image`?L.image:L.video)?.find(e=>e.id===l),z=R?.maxImageCount??4,B=R?.maxVideoCount??1,V=!!R?.multiGenerationEnabled,H=V?Math.max(1,Math.min(5,Number(R?.maxGenerationCount||1))):1,U=c===`image`?F.filter(e=>e.type===`image`).length:0,W=c===`image`?Math.max(1,Number(R?.multiImageMaxImages||15)-U):5,ee=Math.max(1,Math.min(5,H,c===`image`?W:5)),[te,G]=(0,S.useState)(!1),[ne,re]=(0,S.useState)(!1),[ie,ae]=(0,S.useState)(!1),[oe,K]=(0,S.useState)(`universal`),[q,se]=(0,S.useState)(null),[ce,le]=(0,S.useState)(null),[ue,de]=(0,S.useState)(null),[fe,pe]=(0,S.useState)(!1),[me,he]=(0,S.useState)(!1),[ge,_e]=(0,S.useState)(`real_person`),[ve,ye]=(0,S.useState)(!1),be=(0,S.useRef)(null),xe=(0,S.useCallback)(()=>{be.current&&=(window.clearTimeout(be.current),null),ye(!0)},[]),Se=(0,S.useCallback)(()=>{be.current&&window.clearTimeout(be.current),be.current=window.setTimeout(()=>{ye(!1),be.current=null},260)},[]),[Ce,we]=(0,S.useState)(!1),Te=(0,S.useRef)(null),Ee=(0,S.useRef)(!1),[De,Oe]=(0,S.useState)({top:0,left:0}),ke=e=>{let t=0,n=0,r=0;return e.map(e=>e.type===`image`?(t++,`图片${t}`):e.type===`video`?(n++,`视频${n}`):(r++,`音频${r}`))},[Ae,je]=(0,S.useState)(!1),[Me,Ne]=(0,S.useState)(``),[Pe,Fe]=(0,S.useState)(`image`),Ie=(0,S.useRef)(null);(0,S.useEffect)(()=>{if(Ae&&Pe===`video`){let e=()=>{Ie.current&&Ie.current.play().catch(()=>{})};Ie.current&&(Ie.current.readyState>=2?e():Ie.current.addEventListener(`loadedmetadata`,e));let t=setTimeout(e,300);return()=>{clearTimeout(t),Ie.current&&(Ie.current.removeEventListener(`loadedmetadata`,e),Ie.current.pause())}}else Ie.current&&Ie.current.pause()},[Ae,Pe]);let[Le,Re]=(0,S.useState)(new Set),ze=e=>{if(!e)return null;try{let t=new URL(e).searchParams.get(`exp`);return t?parseInt(t,10):null}catch{try{let t=e.indexOf(`?`);if(t!==-1){let n=e.substring(t+1),r=new URLSearchParams(n).get(`exp`);if(r)return parseInt(r,10)}return null}catch{return null}}},Be=e=>{let t=ze(e);return t?Math.floor(Date.now()/1e3)>t:!1},[Ve,He]=(0,S.useState)(!1),[Ue,We]=(0,S.useState)(``),[Ge,qe]=(0,S.useState)(`image`),[Je,Ye]=(0,S.useState)(``),Xe=(0,S.useRef)(null);(0,S.useEffect)(()=>{if(Ve&&Ge===`video`&&Xe.current){let e=Xe.current;e.currentTime=0,e.muted=!1;let t=e.play();t&&typeof t.catch==`function`&&t.catch(()=>{e.muted=!0,e.play().catch(()=>{})})}else if(!Ve&&Xe.current){let e=Xe.current;e.pause(),e.muted=!0,e.currentTime=0}},[Ve,Ge,Ue]);let[Ze,Qe]=(0,S.useState)(null),[$e,et]=(0,S.useState)(0),[tt,nt]=(0,S.useState)(!1),[rt,it]=(0,S.useState)(null),[at,ot]=(0,S.useState)({x:0,y:0}),[st,ct]=(0,S.useState)(!1),[lt,ut]=(0,S.useState)(!1),[dt,ft]=(0,S.useState)([]),[pt,mt]=(0,S.useState)([]),[ht,gt]=(0,S.useState)({}),[_t,vt]=(0,S.useState)(!1),[yt,bt]=(0,S.useState)(!1),[xt,St]=(0,S.useState)([]),[Ct,wt]=(0,S.useState)([]),[Tt,Et]=(0,S.useState)([]),Dt=()=>{let e={};if(e=Tt.find(e=>e.modelConfigId===l&&e.genType===c&&e.resolution===(c===`video`?_:f)),e||(c===`video`?(e={perSecondCredits:2,baseCredits:60,ratio:1.3,inputVideoRatio:1.3,inputVideoBaseCredits:0,inputVideoPerSecondCredits:15,inputImageRatio:1,inputImageBaseCredits:0,inputImagePerImageCredits:0},(_===`1080p`||_===`720p`||_===`480p`)&&(e.ratio=1.3)):(e={perSecondCredits:.1,baseCredits:2,ratio:3,inputImageRatio:1,inputImageBaseCredits:0,inputImagePerImageCredits:0},(f===`2K`||f===`4K`||f===`1K`)&&(e.ratio=3))),c===`video`){let t=(h*e.perSecondCredits+e.baseCredits)*e.ratio,n=F.filter(e=>e.type===`video`).reduce((e,t)=>e+(t.duration||0),0);if(n>0){let r=((e.inputVideoBaseCredits||0)+(e.inputVideoPerSecondCredits||0)*n)*(e.inputVideoRatio||1);t+=r}let r=F.filter(e=>e.type===`image`).length;if(r>0){let n=((e.inputImageBaseCredits||0)+(e.inputImagePerImageCredits||0)*r)*(e.inputImageRatio||1);t+=n}return Number((t*u).toFixed(2))}else{let t=e.baseCredits*e.ratio,n=F.filter(e=>e.type===`image`).length;if(n>0){let r=((e.inputImageBaseCredits||0)+(e.inputImagePerImageCredits||0)*n)*(e.inputImageRatio||1);t+=r}return Number((t*u).toFixed(2))}},Ot=(0,S.useRef)(null),kt=(0,S.useRef)(null),At=(0,S.useRef)(null);(0,S.useRef)(!0);let jt=(0,S.useRef)(!1),Mt=(0,S.useRef)(0);o.find(e=>e.id===i);let[Nt,Pt]=(0,S.useState)([]),[Ft,It]=(0,S.useState)({page:1,pageSize:20}),[Lt,Rt]=(0,S.useState)(0),[zt,Bt]=(0,S.useState)(!1);(0,S.useEffect)(()=>{let e=t.state;e&&(e.generationPrompt&&P(e.generationPrompt),e.mediaReferences&&Array.isArray(e.mediaReferences)&&e.mediaReferences.length>0&&I(e.mediaReferences.map(e=>{let t=e.url||e.resourceUrl||e.previewUrl||``,n=t.startsWith(`http`)?t:`http://ceshi.apiforeign.minzhong.cn${t}`;return{...e,name:e.name||`参考${e.type}`,type:e.type===`video`?`video`:e.type===`audio`?`audio`:`image`,url:n,duration:e.duration||0,label:e.label||``}})),e.aspectRatio&&A(e.aspectRatio),window.history.replaceState({},``,window.location.pathname))},[t.state]),(0,S.useEffect)(()=>()=>{be.current&&window.clearTimeout(be.current)},[]);let Vt=(0,S.useCallback)((e=`instant`)=>{let t=kt.current;t&&(Mt.current=Date.now(),requestAnimationFrame(()=>{t.scrollTo({top:t.scrollHeight,behavior:e})}))},[]);(0,S.useEffect)(()=>{if(Nt.length>0&&!jt.current){let e=setTimeout(()=>{Vt(`smooth`),jt.current=!0},300);return()=>clearTimeout(e)}},[Nt.length,Vt]),(0,S.useEffect)(()=>{if(Ee.current){Ee.current=!1;return}if(!ie)return;let e=Array.isArray(y)?{}:y,t=c===`image`?e.image:e.video;t&&t.length>0&&(t.some(e=>e.id===l)||C(t[0].id))},[c,y,ie]),(0,S.useEffect)(()=>{ie&&w(1)},[c,l,ie,w]),(0,S.useEffect)(()=>{u>ee&&(w(ee),c===`image`&&e.info(`受当前引擎或参考图数量限制,本次最多生成 ${ee} 份`))},[u,ee,c,w,e]),(0,S.useEffect)(()=>{let e=e=>{let t=e.target;yt&&!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&bt(!1),_t&&!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&vt(!1),st&&!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&ct(!1),lt&&!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&ut(!1),fe&&!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&pe(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[yt,_t,st,lt,fe]),(0,S.useEffect)(()=>{if(Ee.current){Ee.current=!1;return}if(c!==`video`)return;let e=L.video?.find(e=>e.id===l);if(!e)return;let t=e.supportsFirstLastFrame??!1,n=e.supportsUniversalReference??!0;K(e=>n?`universal`:e===`universal`&&!n&&t?`first_last_frame`:e)},[l,c,y]),(0,S.useEffect)(()=>{z5().then(e=>{if(N(e.engine),ae(!0),e.engine.video&&e.engine.video.length>0){let t=e.engine.video[0],n=e.engine.video.find(e=>e.id===l)||t;M({ratios:n.supportedRatios||[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:n.supportedResolutions||[`480p`,`720p`,`1080p`],durations:n.supportedDurations||[5,8,10,12,15]}),n.supportedRatios?.includes(g)||A(n.supportedRatios?.[0]||`16:9`),n.supportedResolutions?.includes(_)||j(n.supportedResolutions?.[0]||`720p`),n.supportedDurations?.includes(h)||k(n.supportedDurations?.[0]||5),l===`请选择`&&C(n.id)}if(e.engine.image&&e.engine.image.length>0){let t=e.engine.image.find(e=>e.id===l)||e.engine.image[0],n=t.supportedSizes||{},r=Object.keys(n).sort((e,t)=>{let n={"1K":0,"2K":1,"4K":2};return(n[e]||0)-(n[t]||0)}),i=r[0]||`2K`,a=Object.keys(n[i]||{});if(ft(a.map(e=>({value:e,label:e}))),gt(n),mt(r.map(e=>{let t=e.match(/(\d+)K/);return{value:e,label:`${{1:`标清`,2:`高清`,4:`超清`}[t?parseInt(t[1]):1]||`高清`} ${e}`}})),n[i]&&n[i][a[0]]){let[e,t]=n[i][a[0]].split(/[×x]/);D(Number(e)),O(Number(t)),T(a[0]),E(i)}l===`请选择`&&C(t.id)}}).catch(()=>{}),H5().then(e=>{Et(e)}),B5(Ft).then(e=>{let t=e.total;Pt(e.items),Rt(t)})},[]),(0,S.useEffect)(()=>{if(At.current&&=(clearInterval(At.current),null),Nt.some(e=>e.status===`generating`))return At.current=window.setInterval(()=>{B5(Ft).then(e=>{Pt(t=>t.map(t=>t.status===`generating`&&e.items.find(e=>e.id===t.id)||t)),Rt(e.total)}).catch(e=>{})},1e4),()=>{At.current&&=(clearInterval(At.current),null)}},[Nt,Ft]),(0,S.useEffect)(()=>{if(!st)return;let e=e=>{let t=e.target;!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&ct(!1)};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[st]),(0,S.useEffect)(()=>{if(!lt)return;let e=e=>{let t=e.target;!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&ut(!1)};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[lt]);let Ht=e=>{let t=Object.keys(ht).sort((e,t)=>{let n={"1K":0,"2K":1,"4K":2};return(n[e]||0)-(n[t]||0)}),n=ht[f]&&ht[f][e]?f:t.find(t=>ht[t]&&ht[t][e])||t[0];if(n&&ht[n]&&ht[n][e]){let[t,r]=ht[n][e].split(/[×x]/);D(Number(t)),O(Number(r)),T(e),E(n)}},Ut=e=>{ht[e]||(e=Object.keys(ht).sort((e,t)=>{let n={"1K":0,"2K":1,"4K":2};return(n[e]||0)-(n[t]||0)})[0]||e);let t=ht[e]?Object.keys(ht[e]):[];ft(t.map(e=>({value:e,label:e})));let n=t.includes(d)?d:t[0]||``;if(n&&ht[e]&&ht[e][n]){let[t,r]=ht[e][n].split(/[×x]/);D(Number(t)),O(Number(r)),T(n),E(e)}},Wt=()=>{D(m),O(p)},Gt=y?.video?.find(e=>e.id===l),Kt=Gt?.supportsFirstLastFrame??!1,qt=Gt?.supportsUniversalReference??!0,Jt=e=>{e===`first_last_frame`&&!Kt||e===`universal`&&!qt||(K(e),pe(!1),I([]),P(``))},Yt=()=>{let e=q;se(ce),le(e)},Xt=()=>{se(null),le(null)},Zt=()=>{le(null)},Qt=async()=>{let t=c===`video`&&oe===`first_last_frame`;if(t){if(!b.trim()){e.warning(`请输入内容`);return}}else if(!b.trim()&&F.length===0){e.warning(`请输入内容或上传图片/视频`);return}let n=e=>e.replace(/([A-Z])/g,`_$1`).toLowerCase(),r=e=>!e||typeof e!=`object`?e:Array.isArray(e)?e.map(r):Object.fromEntries(Object.entries(e).map(([e,t])=>[n(e),r(t)])),i;t?(i=[],q&&i.push(r({...q,role:`first_frame`})),ce&&i.push(r({...ce,role:`last_frame`})),i.length===0&&(i=void 0)):i=F.length>0?F.map(e=>{if(e.type===`image`){let{duration:t,...n}=e;return r(n)}return r(e)}):void 0;let a={id:``,gen_type:c,original_prompt:b.trim(),engine_id:l,idempotency_key:new Date().toLocaleString(`zh-CN`),generation_count:u,media_references:i,...c===`image`&&{image_size:f,image_proportion:d,image_px:p+`x`+m},...c===`video`&&{duration:h,aspect_ratio:g,resolution:_}};console.log(a),re(!0),Hie(a).then(()=>{P(``),I([]),se(null),le(null),w(1);let e={...Ft,page:1};It(e),B5(e).then(e=>{let t=e.items.map(e=>(e.media_references&&Array.isArray(e.media_references)&&(e.mediaReferences=e.media_references.map(e=>({...e,display_url:e.display_url||e.displayUrl,preview_url:e.preview_url||e.previewUrl,private_asset_id:e.private_asset_id||e.privateAssetId,provider_url:e.provider_url||e.providerUrl,remote_asset_id:e.remote_asset_id||e.remoteAssetId}))),e)),n=Array.isArray(t)&&t.length>0?t[t.length-1]:null;n&&Pt(e=>[...e,n]),Rt(e.total),setTimeout(()=>{Ot.current?.scrollIntoView({behavior:`smooth`})},100)}).catch(e=>{})}).catch(t=>{let n=`创建任务失败`;t?.response?.data?.detail?n=t.response.data.detail:t?.data?.detail?n=t.data.detail:t?.detail?n=t.detail:t?.message&&(n=t.message),e.error({content:n,duration:3})}).finally(()=>{re(!1)}),setTimeout(()=>{re(!1)},3e3)},$t=async()=>{if(Nt.length>=Lt)return;let e=kt.current;if(!e)return;let t=e.scrollTop,n=e.scrollHeight;Bt(!0);try{let r=Ft.page+1,i=await B5({...Ft,page:r}),a=Array.isArray(i)?{items:i,total:i.length}:i;a.total&&Rt(a.total),It(e=>({...e,page:r})),Pt(e=>{let t=new Set(e.map(e=>e.id));return[...(a.items||[]).filter(e=>!e.id||t.has(e.id)?!1:(t.add(e.id),!0)).reverse(),...e]}),setTimeout(()=>{e.scrollTop=t+(e.scrollHeight-n)},200)}catch{}finally{Bt(!1)}},en=e=>new Promise((t,n)=>{let r=document.createElement(`video`);r.preload=`metadata`,r.onloadedmetadata=()=>{window.URL.revokeObjectURL(r.src),t(r.duration)},r.onerror=()=>{window.URL.revokeObjectURL(r.src),n(Error(`无法获取视频时长`))},r.src=URL.createObjectURL(e)}),tn=e=>new Promise((t,n)=>{let r=document.createElement(`audio`);r.preload=`metadata`,r.onloadedmetadata=()=>{URL.revokeObjectURL(r.src),t(r.duration)},r.onerror=()=>{URL.revokeObjectURL(r.src),n(Error(`无法获取音频时长`))},r.src=URL.createObjectURL(e)}),nn=e=>{let t=e.startsWith(`http`)?e:`http://ceshi.apiforeign.minzhong.cn${e}`;if(Ze===t){let e=document.getElementById(`audio-player`);e&&e.pause(),Qe(null)}else Qe(t)},rn=e=>new Promise((t,n)=>{let r=new Image;r.onload=()=>{window.URL.revokeObjectURL(r.src),t({width:r.naturalWidth,height:r.naturalHeight})},r.onerror=()=>{window.URL.revokeObjectURL(r.src),n(Error(`无法读取图片尺寸`))},r.src=URL.createObjectURL(e)}),an=e=>new Promise((t,n)=>{let r=document.createElement(`video`);r.preload=`metadata`,r.onloadedmetadata=()=>{window.URL.revokeObjectURL(r.src),t({width:r.videoWidth,height:r.videoHeight,duration:r.duration})},r.onerror=()=>{window.URL.revokeObjectURL(r.src),n(Error(`无法读取视频尺寸`))},r.src=URL.createObjectURL(e)}),on=(e,t)=>{if(e<300||e>6e3)return`图片宽度需在 300~6000px 之间,当前为 ${e}px`;if(t<300||t>6e3)return`图片高度需在 300~6000px 之间,当前为 ${t}px`;let n=e/t;return n<.4||n>2.5?`图片宽高比需在 0.4~2.5 之间,当前为 ${n.toFixed(2)}`:null},sn=(e,t)=>{if(e<300||e>6e3)return`视频宽度需在 300~6000px 之间,当前为 ${e}px`;if(t<300||t>6e3)return`视频高度需在 300~6000px 之间,当前为 ${t}px`;let n=e/t;if(n<.4||n>2.5)return`视频宽高比需在 0.4~2.5 之间,当前为 ${n.toFixed(2)}`;let r=e*t;return r<409600?`视频总像素数过小(${e}×${t}=${r}),需 ≥ 640×640=409600`:r>8295044?`视频总像素数过大(${e}×${t}=${r}),需 ≤ 3326×2494=8295044`:null},cn=async(t,n)=>{let r=t.type.startsWith(`image/`),i=t.type.startsWith(`video/`);if(c===`video`&&oe===`first_last_frame`){if(!r)return e.error(`首尾帧模式仅支持上传图片`),!1;if(t.size/1024/1024>10)return e.error(`图片大小不能超过10MB`),!1;try{let{width:n,height:r}=await rn(t),i=on(n,r);if(i)return e.error(i),!1}catch{return e.error(`无法读取图片尺寸,请检查文件是否损坏`),!1}let i=n||ue;if(!i)return e.error(`请选择首帧或尾帧上传位置`),!1;G(!0);try{let n=await E5(t),r={name:t.name,type:`image`,url:n.url,role:i===`first`?`first_frame`:`last_frame`};i===`first`?se(r):le(r),e.success(`图片上传成功`)}catch(t){let n=t?.response?.data?.message||t?.response?.data?.detail||t?.message||`上传失败`;e.error(n)}finally{G(!1),de(null)}return!1}let a=t.type.startsWith(`audio/`);if(!r&&!i&&!a)return e.error(`仅支持图片、视频或音频文件`),!1;if(a){let n=t.name.split(`.`).pop()?.toLowerCase();if(![`wav`,`mp3`].includes(n||``))return e.error(`音频仅支持wav和mp3格式`),!1}if(c===`image`&&(i||a))return e.error(`图片模式仅支持上传图片`),!1;if(a&&c!==`video`)return e.error(`仅视频模式支持上传音频`),!1;let o=i?100:a?50:10,s=i?`视频`:a?`音频`:`图片`;if(t.size/1024/1024>o)return e.error(`${s}大小不能超过${o}MB`),!1;if(r)try{let{width:n,height:r}=await rn(t),i=on(n,r);if(i)return e.error(i),!1}catch{return e.error(`无法读取图片尺寸,请检查文件是否损坏`),!1}let l=F.filter(e=>e.type===`image`).length;if(r&&l>=Mn)return e.error(`该引擎最多上传${Mn}张图片`),!1;let u=F.filter(e=>e.type===`video`).length;if(i&&u>=Nn)return e.error(`该引擎最多上传${Nn}个视频`),!1;let d=F.filter(e=>e.type===`audio`).length;if(a&&d>=Pn)return e.error(`该引擎最多上传${Pn}个音频`),!1;let f=0,p=0;if(i)try{if(f=await en(t),f<2)return e.error(`视频素材最短不能少于 2 秒`),!1;let n=F.filter(e=>e.type===`video`).reduce((e,t)=>e+(t.duration||0),0);if(n+f>15)return e.error(`所有视频素材总时长不能超过 15 秒,当前 ${(n+f).toFixed(1)} 秒`),!1;let{width:r,height:i}=await an(t),a=sn(r,i);if(a)return e.error(a),!1}catch{return e.error(`无法获取视频信息,请检查文件是否损坏`),!1}if(a)try{if(p=await tn(t),p<2)return e.error(`音频素材最短不能少于 2 秒`),!1;let n=F.filter(e=>e.type===`audio`).reduce((e,t)=>e+(t.duration||0),0);if(n+p>15)return e.error(`所有音频素材总时长不能超过 15 秒,当前 ${(n+p).toFixed(1)} 秒`),!1}catch{return e.error(`无法获取音频信息,请检查文件是否损坏`),!1}G(!0);try{let e;e=r?await E5(t):a?await T5(t,p):await D5(t,f);let n=r?`image`:a?`audio`:`video`,o=[...F,{name:t.name,type:n,url:e.url,label:``,...i&&{duration:f},...a&&{duration:p}}],s=ke(o);I(o.map((e,t)=>({...e,label:s[t]})))}catch(t){let n=t?.response?.data?.message||t?.response?.data?.detail||t?.message||`上传失败`;e.error(n)}finally{G(!1)}return!1},ln=async t=>{let n=t.type.startsWith(`image/`),r=t.type.startsWith(`video/`),i=t.type.startsWith(`audio/`);if(!n&&!r&&!i)return e.error(`仅支持图片、视频或音频文件`),!1;let a=r?100:i?50:30;if(t.size/1024/1024>a)return e.error(`${r?`视频`:i?`音频`:`图片`}大小不能超过${a}MB`),!1;if(n||r){let n=C7.getState().currentMedia.filter(e=>e.type===`image`||e.type===`video`).reduce((e,t)=>e+(Number(t.fileSizeBytes)||0),0),r=(n+t.size)/1024/1024;if(r>64)return e.error(`所有图片和视频总大小不能超过64MB,当前已${(n/1024/1024).toFixed(1)}MB,加上此文件后${r.toFixed(1)}MB`),!1}if(i){let n=t.name.split(`.`).pop()?.toLowerCase();if(![`wav`,`mp3`].includes(n||``))return e.error(`音频仅支持wav和mp3格式`),!1}if(n)try{let{width:n,height:r}=await rn(t),i=on(n,r);if(i)return e.error(i),!1}catch{return e.error(`无法读取图片尺寸,请检查文件是否损坏`),!1}let o=0,s=0;if(r)try{if(o=await en(t),o<2)return e.error(`视频素材最短不能少于 2 秒`),!1;let n=C7.getState().currentMedia.filter(e=>e.type===`video`).reduce((e,t)=>e+(t.duration||0),0);if(n+o>15)return e.error(`所有视频素材总时长不能超过 15 秒,当前 ${(n+o).toFixed(1)} 秒`),!1}catch{return e.error(`无法获取视频信息,请检查文件是否损坏`),!1}if(i)try{if(s=await tn(t),s<2)return e.error(`音频素材最短不能少于 2 秒`),!1;let n=C7.getState().currentMedia.filter(e=>e.type===`audio`).reduce((e,t)=>e+(t.duration||0),0);if(n+s>15)return e.error(`所有音频素材总时长不能超过 15 秒,当前 ${(n+s).toFixed(1)} 秒`),!1}catch{return e.error(`无法获取音频信息,请检查文件是否损坏`),!1}let c=n?`image`:i?`audio`:`video`,l={name:t.name,type:c,url:``,label:``,...r&&{duration:o},...i&&{duration:s}},u=C7.getState().currentMedia;if(!fn(u,[l]))return!1;try{let e;return e=n?await E5(t):i?await T5(t,s):await D5(t,o),{name:l.name,type:l.type,url:e.url,label:l.label||``,fileSizeBytes:t.size,...l.duration!==void 0&&{duration:l.duration}}}catch(t){let n=t?.response?.data?.message||t?.response?.data?.detail||t?.message||`上传失败`;return e.error(n),!1}},un=async t=>{let n=0,r=0;G(!0);for(let e of t){let t=await ln(e);if(t){let e=[...C7.getState().currentMedia,t],r=ke(e);I(e.map((e,t)=>({...e,label:r[t]}))),n++}else r++}G(!1),n>0&&e.success(`成功上传${n}个文件${r>0?`,${r}个文件上传失败`:``}`)},dn=(e,t)=>e.filter(e=>e.type===t).reduce((e,t)=>e+(Number(t.duration)||0),0),fn=(t,n)=>{if(!n.length)return!1;if(c===`image`&&n.some(e=>e.type!==`image`))return e.error(`图片模式仅支持添加图片素材`),!1;if(n.some(e=>e.type===`audio`)&&c!==`video`)return e.error(`仅视频模式支持添加音频素材`),!1;let r=t.filter(e=>e.type===`image`).length,i=t.filter(e=>e.type===`video`).length,a=t.filter(e=>e.type===`audio`).length,o=n.filter(e=>e.type===`image`).length,s=n.filter(e=>e.type===`video`).length,l=n.filter(e=>e.type===`audio`).length;if(r+o>Mn)return e.error(`该引擎最多上传${Mn}张图片,当前还能添加 ${Math.max(0,Mn-r)} 张`),!1;if(i+s>Nn)return e.error(`该引擎最多上传${Nn}个视频,当前还能添加 ${Math.max(0,Nn-i)} 个`),!1;if(a+l>Pn)return e.error(`该引擎最多上传${Pn}个音频,当前还能添加 ${Math.max(0,Pn-a)} 个`),!1;for(let t of n){if(t.type!==`video`)continue;let n=Number(t.duration);if(!Number.isFinite(n)||n<=0)return e.error(`${t.name||`视频素材`}缺少视频秒数,不能用于 AI 创作`),!1;if(n<2)return e.error(`${t.name||`视频素材`}最短不能少于 2 秒`),!1;if(n>15)return e.error(`${t.name||`视频素材`}最长不能超过 15 秒`),!1}let u=dn(t,`video`)+dn(n,`video`);if(u>15)return e.error(`所有视频素材总时长不能超过 15 秒,当前 ${u.toFixed(1)} 秒`),!1;let d=dn(t,`audio`)+dn(n,`audio`);return d>15?(e.error(`所有音频素材总时长不能超过 15 秒,当前 ${d.toFixed(1)} 秒`),!1):!0},pn=t=>{let n=t.mediaReference,r=n?.type||t.resourceType,i=n?.url||t.resourceUrl||t.displayUrl||t.previewUrl||``;if(!i)return e.error(`${t.fileName||t.id} 缺少素材地址,不能用于 AI 创作`),null;if(r===`audio`&&c!==`video`)return e.error(`仅视频模式支持添加音频素材`),null;let a=Number(n?.duration??t.durationSeconds);return{name:n?.name||t.fileName||t.id,type:r,url:i,source:`upload_resource`,upload_resource_id:t.id,label:``,...(r===`video`||r===`audio`)&&Number.isFinite(a)&&a>0?{duration:a}:{}}},mn=t=>{let n=t.map(pn).filter(Boolean);if(!n.length)return;let r=C7.getState().currentMedia;if(!fn(r,n))return;let i=[...r,...n],a=ke(i);I(i.map((e,t)=>({...e,label:a[t]}))),e.success(`已添加 ${n.length} 个历史上传素材参考`)},hn=t=>{if(t.assetType===`Audio`)return e.error(`音频私域素材暂不支持用于 AI 创作`),null;let n=t.assetType===`Video`?`video`:`image`,r=ge===`aigc_virtual`?`虚拟素材`:`真人素材`,i=n===`video`?t.videoCoverUrl||t.previewUrl||t.displayUrl||t.providerUrl||``:t.previewUrl||t.displayUrl||t.videoCoverUrl||t.providerUrl||``;return{name:t.name||r,type:n,url:i,source:`private_portrait_asset`,private_asset_id:t.id,label:``,...n===`video`&&{duration:Number(t.videoDuration)||void 0}}},gn=e=>{_e(e),he(!0)},_n=t=>{let n=t.map(hn).filter(Boolean),r=C7.getState().currentMedia;if(!fn(r,n))return;let i=[...r,...n],a=ke(i);I(i.map((e,t)=>({...e,label:a[t]}))),e.success(`已添加 ${n.length} 个${ge===`aigc_virtual`?`虚拟`:`真人`}素材参考`)},vn=e=>e?e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`data:`)||e.startsWith(`blob:`)?e:`${`http://ceshi.apiforeign.minzhong.cn`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`:``,yn=e=>{let t=F.filter((t,n)=>n!==e),n=ke(t);I(t.map((e,t)=>({...e,label:n[t]})))},bn=(e,t)=>{let n=e.selectionStart;return t.slice(0,n).match(/@([^@\s]*)$/)&&F.length>0?(we(!0),!0):(we(!1),!1)},xn=e=>{let t=e.target.value;P(t);let n=e.target;bn(n,t)},Sn=e=>{Ce&&e.key===`Escape`&&we(!1)},Cn=e=>{let t=Te.current?.resizableTextArea?.textArea;if(!t)return;let n=t.selectionStart,r=b.slice(0,n),i=b.slice(n),a=r.lastIndexOf(`@`);if(a===-1){we(!1);return}P(r.slice(0,a)+`@${e} `+i),we(!1),setTimeout(()=>{let n=a+e.length+2;t.focus(),t.setSelectionRange(n,n)},0)},wn=()=>{je(!1),Ne(``),Ie.current&&Ie.current.pause()},Tn=e=>{if(e.preventDefault(),e.stopPropagation(),!Me)return;let t=Me.replace(`/static`,``).replace(/&w=\d+/i,``).replace(/&q=\d+/i,``);t.includes(`download=1`)||(t+=`&download=1`);let n=document.createElement(`a`);n.href=t,console.log(t),n.download=Pe===`image`?`image.png`:`video.mp4`,document.body.appendChild(n),n.click(),document.body.removeChild(n)},En=e=>{let t=String(e?.type||``).toLowerCase(),n=String(e?.url||e?.name||``).toLowerCase();return t.includes(`video`)||/\.(mp4|mov|avi|webm|m4v)(\?|$)/.test(n)?`video`:t.includes(`audio`)||/\.(mp3|wav|ogg|aac|m4a)(\?|$)/.test(n)?`audio`:`image`},Dn=e=>e?/^https?:\/\//i.test(e)?e:`http://ceshi.apiforeign.minzhong.cn${e}`:``,On=e=>{e?.url&&(We(e.url),qe(En(e)),Ye(e.name||`附件`),He(!0))},kn=c===`video`&&oe===`first_last_frame`,An=!te&&(kn?!!(b.trim()||q):!!(b.trim()||F.length>0)),jn=c===`image`?`输入画面描述,或上传图片参考风格、构图、主体与光影。例:@图片1 参考色调,生成一张简洁高级的产品海报。`:kn?`首帧尾帧可以不传,如需传入建议描述首帧到尾帧的主体动作、镜头运动、节奏与转场。例:从首帧自然推进到尾帧,产品居中突出,动作平滑连贯。`:`上传最多12个参考素材,输入文字或 @ 引用参考内容,自由组合图、文、视频。例:@图片1 模仿 @视频1 的动作。`,Mn=z,Nn=B,Pn=R?.maxAudioCount??1;return(0,$.jsxs)(GW,{className:`ai-create-page`,style:{margin:`-24px -32px -32px`,borderRadius:22,height:`calc(100vh - 34px)`,background:`#fff`,overflow:`hidden`},children:[(0,$.jsx)(`audio`,{id:`audio-player`,src:Ze||null,autoPlay:!0,onEnded:()=>Qe(null),style:{display:`none`}}),!1,(0,$.jsxs)(GW,{style:{display:`flex`,flex:1,background:`#fff`},children:[(0,$.jsx)(`div`,{className:`animate-fadeInUp`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,padding:`16px 24px`,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(139, 92, 246, 0.04) 100%)`,backdropFilter:`blur(22px)`,border:`1px solid rgba(231, 234, 240, 0.82)`,position:`relative`,overflow:`hidden`,flexWrap:`wrap`,gap:12},children:(0,$.jsxs)(`div`,{style:{width:`100%`,display:`flex`,alignItems:`center`,gap:16},children:[(0,$.jsx)(`div`,{style:{width:`15%`,height:1,background:`linear-gradient(90deg, transparent, rgba(117,106,136,0.18), rgba(232,227,236,0.48), transparent)`,borderRadius:1}}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:0,textAlign:`center`},children:[(0,$.jsx)(`h2`,{style:{margin:0,fontSize:18,fontWeight:700,color:`#8b5cf6`,letterSpacing:.4},children:`AI创作`}),(0,$.jsx)(`p`,{style:{fontSize:13,color:`#667085`,margin:`4px 0 0 0`},children:`输入想法、剧本或上传参考,智能生成视频/图片`})]}),(0,$.jsx)(`div`,{style:{width:`15%`,height:1,background:`linear-gradient(90deg, transparent, rgba(232,227,236,0.48), rgba(117,106,136,0.18), transparent)`,borderRadius:1}})]})}),(0,$.jsxs)(Zoe,{style:{flex:1,margin:0,padding:`20px 24px 22px`,boxSizing:`border-box`,display:`flex`,flexDirection:`column`,overflow:`hidden`,minHeight:0},children:[Nt.length===0&&(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`},children:[(0,$.jsx)(`div`,{style:{width:80,height:80,borderRadius:50,background:`linear-gradient(135deg, #8b5cf6 0%, #ddd6fe 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,marginBottom:16},children:(0,$.jsx)(c8,{style:{fontSize:40,color:`#fff`}})}),(0,$.jsx)(`h2`,{style:{margin:0,fontSize:18,fontWeight:500,color:`#2f3440`},children:`你好,想创作什么?`}),(0,$.jsx)(`p`,{style:{margin:8,fontSize:13,color:`#98a2b3`},children:`输入想法、剧本或上传参考,开始你的创作之旅`})]}),Nt.length>0&&(0,$.jsxs)(`div`,{ref:kt,className:`ai-create-scroll`,style:{flex:1,overflowY:`auto`,paddingRight:10,paddingBottom:18,background:`#fff`},onScroll:e=>{let t=e.currentTarget;!(Date.now()-Mt.current<500)&&jt.current&&t.scrollTop<=50&&!zt&&Nt.length{let t=e;return Nt.map(e=>(0,$.jsx)(`div`,{style:{width:`100%`,display:`flex`,justifyContent:`flex-start`,marginBottom:16},children:(0,$.jsxs)(`div`,{style:{width:`100%`,display:`flex`,gap:10},children:[(0,$.jsx)(`div`,{style:{width:36,height:36,borderRadius:12,background:`linear-gradient(135deg, #8b5cf6 0%, #ddd6fe 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0},children:(0,$.jsx)(c8,{style:{color:`#fff`,fontSize:16}})}),(0,$.jsx)(`div`,{style:{flex:1},children:(0,$.jsxs)(`div`,{style:{background:`rgba(255, 255, 255, 0.92)`,backdropFilter:`blur(18px)`,borderRadius:`22px`,padding:`14px 16px`,width:`70%`,minWidth:500,boxSizing:`border-box`,boxShadow:`0 18px 50px rgba(47, 52, 64, 0.075)`,position:`relative`,border:`1px solid rgba(231, 234, 240, 0.9)`},children:[(0,$.jsxs)(`div`,{style:{margin:4,fontSize:11,color:`#98a2b3`,textAlign:`left`,display:`flex`,flexWrap:`wrap`,gap:8,alignItems:`center`},children:[(0,$.jsx)(`span`,{children:e.createdAt?.replace(`T`,` `).split(`.`)[0]}),(0,$.jsx)(`span`,{style:{background:(e.genType,`rgba(139, 92, 246, 0.10)`),color:(e.genType,`#8b5cf6`),padding:`2px 8px`,borderRadius:12,fontWeight:500,fontSize:11,marginLeft:8},children:e.genType===`image`?`图片生成`:`视频生成`})]}),e.mediaReferences&&e.mediaReferences.length>0&&(0,$.jsx)(`div`,{style:{position:`absolute`,top:8,right:8,zIndex:100},children:(0,$.jsx)(`span`,{style:{padding:`4px 12px`,borderRadius:16,color:`#8b5cf6`,cursor:`pointer`,fontWeight:500,border:`1px solid rgba(139, 92, 246, 0.2)`,background:`rgba(139, 92, 246, 0.04)`},onClick:t=>{t.stopPropagation();let n=t.currentTarget.getBoundingClientRect();ot({x:n.left,y:n.top-10}),it(e.id),nt(!0)},children:`附件详情`})}),(0,$.jsxs)(`div`,{style:{position:`absolute`,bottom:8,right:8,zIndex:100,display:`flex`,gap:6},children:[(0,$.jsxs)(`button`,{onClick:n=>{n.stopPropagation(),P(e.originalPrompt||``);let r=!0,i=e.engineId||e.engineSnapshot?.id||e.engine_id;if(i&&e.genType){let n=Array.isArray(y)?{}:y,a=(e.genType===`image`?n.image:n.video)?.find(e=>e.id===i);if(a){if(C(a.id),e.genType===`video`&&M({ratios:a.supportedRatios||[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:a.supportedResolutions||[`480p`,`720p`,`1080p`],durations:a.supportedDurations||[5,8,10,12,15]}),e.genType===`image`){let e=a.supportedSizes||{},t=Object.keys(e).sort((e,t)=>{let n={"1K":0,"2K":1,"4K":2};return(n[e]||0)-(n[t]||0)}),n=t[0]||`2K`,r=Object.keys(e[n]||{});if(ft(r.map(e=>({value:e,label:e}))),gt(e),mt(t.map(e=>{let t=e.match(/(\d+)K/);return{value:e,label:`${{1:`标清`,2:`高清`,4:`超清`}[t?parseInt(t[1]):1]||`高清`} ${e}`}})),e[n]&&e[n][r[0]]){let[t,i]=e[n][r[0]].split(/[×x]/);D(Number(t)),O(Number(i)),T(r[0]),E(n)}}}else t.error(`该引擎已删除,无法重新编辑`),r=!1}if(r){if(e.genType&&(Ee.current=!0,x(e.genType)),e.mediaReferences&&e.mediaReferences.length>0)if(e.mediaReferences.some(e=>e.role===`first_frame`||e.role===`last_frame`)&&e.genType===`video`){let t=e.mediaReferences.find(e=>e.role===`first_frame`),n=e.mediaReferences.find(e=>e.role===`last_frame`);se(t?{...t,label:t.label||``,duration:t.duration}:null),le(n?{...n,label:n.label||``,duration:n.duration}:null),I([]),K(`first_last_frame`)}else if(I(e.mediaReferences.map(e=>({...e,name:e.name,type:e.type,url:e.url,label:e.label||``,role:e.role,duration:e.duration}))),se(null),le(null),e.genType===`video`){let e=L.video?.find(e=>e.id===i);if(e){let t=e.supportsUniversalReference??!0,n=e.supportsFirstLastFrame??!1;K(t?`universal`:n?`first_last_frame`:`universal`)}else K(`universal`)}else K(`universal`);else if(I([]),se(null),le(null),e.genType===`video`){let e=y?.video?.find(e=>e.id===i);if(e){let t=e.supportsUniversalReference??!0,n=e.supportsFirstLastFrame??!1;K(t?`universal`:n?`first_last_frame`:`universal`)}}t.success(`已加载到编辑区`)}},style:{height:28,padding:`0 10px`,borderRadius:10,border:`none`,background:`rgba(139, 92, 246, 0.08)`,color:`#8b5cf6`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,transition:`all 0.2s ease`,gap:4,fontSize:12},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(139, 92, 246, 0.15)`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(139, 92, 246, 0.08)`},children:[(0,$.jsx)(wq,{style:{fontSize:12}}),`重新编辑`]}),(0,$.jsx)(vK,{title:`确定要删除吗?`,onConfirm:async()=>{try{await Wie(e.id),t.success(`删除成功`),Pt(t=>t.filter(t=>t.id!==e.id)),Rt(e=>e-1)}catch(e){let n=e?.response?.data?.message||e?.message||`删除失败`;t.error(n)}},okText:`确定`,cancelText:`取消`,children:(0,$.jsxs)(`button`,{onClick:e=>e.stopPropagation(),style:{height:28,padding:`0 10px`,borderRadius:10,border:`none`,background:`rgba(139, 92, 246, 0.08)`,color:`#8b5cf6`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,transition:`all 0.2s ease`,gap:4,fontSize:12},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(164, 91, 91, 0.1)`,e.currentTarget.style.color=`#A45B5B`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(139, 92, 246, 0.08)`,e.currentTarget.style.color=`#8b5cf6`},children:[(0,$.jsx)(u$,{style:{fontSize:12}}),`删除`]})})]}),(e.status===`generating`||e.status===`failed`||e.status===`completed`)&&(0,$.jsxs)(`div`,{style:{display:`flex`,gap:16,marginBottom:16,marginTop:16,width:`100%`,alignItems:`flex-start`},children:[(0,$.jsx)(`div`,{style:{width:`50%`,overflow:`hidden`,borderRadius:12,position:`relative`,height:220,border:`1px solid #E7EAF0`,boxShadow:`0 4px 12px rgba(139, 92, 246, 0.08)`,background:`linear-gradient(135deg, #ffffff 0%, #FAFBFC 100%)`},children:(0,$.jsx)(Doe,{task:e,resolveUrl:tse,onPreview:(e,t)=>{Ne(e),Fe(t),je(!0)}})}),(0,$.jsxs)(`div`,{style:{width:`50%`,display:`flex`,flexDirection:`column`,gap:12},children:[(0,$.jsx)(`div`,{style:{background:`#FFFFFF`,borderRadius:12,padding:12,border:`1px solid #E7EAF0`,flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`p`,{style:{width:`100%`,height:150,overflow:`auto`,padding:0,marginTop:0,marginBottom:0,lineHeight:2,color:`#475467`,fontSize:13},children:e.originalPrompt})}),(0,$.jsxs)(`div`,{style:{fontSize:12,color:`#667085`,textAlign:`left`,display:`flex`,flexWrap:`wrap`,gap:12,alignItems:`center`,justifyContent:`space-between`,marginBottom:12},children:[(0,$.jsx)(`span`,{style:{borderRadius:16,color:`#8b5cf6`,fontWeight:500},children:e.engineSnapshot?.name||`未知引擎`}),(0,$.jsx)(`span`,{style:{borderRadius:16,color:`#667085`},children:e.genType===`image`?`${e.imageProportion||``} · ${e.imagePx||``} · ${e.imageSize||``}`:`${e.duration||``}秒 · ${e.aspectRatio||``} · ${e.resolution||``}`}),(0,$.jsxs)(`span`,{style:{fontSize:14,borderRadius:16,color:`#8b5cf6`},children:[`消耗积分:`,e.creditsCost]})]})]})]})]})})]})},e.id))})(),(0,$.jsx)(`div`,{ref:Ot})]}),tt&&rt&&(()=>{let e=Nt.find(e=>e.id===rt)?.mediaReferences||[];return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{position:`fixed`,top:0,left:0,right:0,bottom:0,background:`transparent`,zIndex:9998},onClick:()=>{nt(!1),it(null)}}),(0,$.jsxs)(`div`,{className:`ai-reference-expanded-tray ai-attachment-popover`,style:{position:`fixed`,top:`max(84px, ${at.y-96}px)`,left:`max(24px, min(${at.x-250}px, calc(100vw - 456px)))`,width:424,padding:`12px 12px 10px`,borderRadius:18,background:`rgba(255,255,255,0.98)`,border:`1px solid #E7EAF0`,boxShadow:`0 24px 60px rgba(31, 41, 55, 0.12)`,backdropFilter:`blur(18px)`,zIndex:9999,pointerEvents:`auto`},onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:10},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:2},children:[(0,$.jsx)(`span`,{style:{fontSize:13,color:`#344054`,fontWeight:800},children:`参考附件`}),(0,$.jsx)(`span`,{style:{fontSize:11,color:`#98A2B3`,fontWeight:600},children:`点击素材查看,或直接下载原文件`})]}),(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:(0,$.jsx)(`button`,{onClick:()=>{nt(!1),it(null)},style:{width:26,height:26,borderRadius:`50%`,border:`1px solid transparent`,background:`#F6F7FA`,cursor:`pointer`,color:`#98a2b3`,display:`flex`,alignItems:`center`,justifyContent:`center`,transition:`all 0.2s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`#EEF1F6`,e.currentTarget.style.color=`#2f3440`},onMouseLeave:e=>{e.currentTarget.style.background=`#F6F7FA`,e.currentTarget.style.color=`#98a2b3`},children:(0,$.jsx)(ju,{style:{fontSize:12}})})})]}),(0,$.jsx)(`div`,{className:`ai-reference-tray-scroll`,style:{display:`flex`,gap:10,overflowX:`auto`,padding:`2px 2px 4px`},children:e.map((e,t)=>{let n=En(e),r=e.label||(e.role===`first_frame`?`首帧`:e.role===`last_frame`?`尾帧`:`${n===`image`?`图片`:n===`video`?`视频`:`音频`}${t+1}`);return(0,$.jsxs)(`div`,{style:{flex:`0 0 92px`,width:92,borderRadius:16,background:`#FFFFFF`,border:`1px solid #E7EAF0`,boxShadow:`0 8px 18px rgba(31, 41, 55, 0.06)`,padding:7,boxSizing:`border-box`},children:[(0,$.jsx)(`div`,{onClick:t=>{n===`audio`?(t.stopPropagation(),nn(e.url)):(On(e),nt(!1),it(null))},style:{position:`relative`,width:`100%`,height:70,borderRadius:12,overflow:`hidden`,cursor:`pointer`,background:`#F7F8FA`,border:`1px solid rgba(231, 234, 240, 0.9)`},children:n===`image`?(0,$.jsx)(`img`,{src:Dn(e.url),alt:e.name||r,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}}):n===`video`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`video`,{src:Dn(e.url),muted:!0,playsInline:!0,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`rgba(31, 41, 55, 0.08)`},children:(0,$.jsx)(`div`,{style:{width:28,height:28,borderRadius:`50%`,background:`rgba(47, 52, 64, 0.72)`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 8px 18px rgba(31, 41, 55, 0.22)`},children:(0,$.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`#fff`,children:(0,$.jsx)(`path`,{d:`M8 5v14l11-7z`})})})})]}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%)`},children:Ze===(e.url.startsWith(`http`)?e.url:`http://ceshi.apiforeign.minzhong.cn${e.url}`)?(0,$.jsx)(k6,{style:{fontSize:24,color:`#fff`}}):(0,$.jsx)(k2,{style:{fontSize:24,color:`#fff`}})})}),(0,$.jsx)(`div`,{title:e.name||r,style:{marginTop:6,color:`#667085`,fontSize:10,fontWeight:700,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,textAlign:`center`},children:e.name||r}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:5,marginTop:7},children:(0,$.jsx)(`button`,{onClick:()=>{On(e),nt(!1),it(null)},style:{flex:1,height:24,borderRadius:9,border:`1px solid #E7EAF0`,background:`#F8FAFC`,color:`#8b5cf6`,fontSize:11,fontWeight:700,cursor:`pointer`,transition:`all 0.2s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`#EEF1F6`},onMouseLeave:e=>{e.currentTarget.style.background=`#F8FAFC`},children:`查看`})})]},`${e.url||e.name||t}-${t}`)})})]})]})})(),(0,$.jsxs)(`div`,{style:{position:`relative`,background:`#ffffff`,borderRadius:24,padding:`18px 72px 16px 20px`,boxShadow:`0 22px 64px rgba(31, 41, 55, 0.08), 0 1px 0 rgba(255,255,255,0.98) inset`,transition:`all 0.25s ease`,border:`1px solid rgba(231, 234, 240, 0.78)`,backdropFilter:`blur(24px)`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,gap:18,alignItems:`flex-end`,marginBottom:14},children:[(0,$.jsx)(`div`,{style:{width:kn?220:70,minWidth:kn?220:70,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`flex-start`,paddingTop:2,gap:8},children:c===`video`&&oe===`first_last_frame`?(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`row`,alignItems:`stretch`,gap:12,width:`100%`,height:100},children:[(0,$.jsxs)(`div`,{style:{position:`relative`,flex:1,minWidth:0,height:100,borderRadius:12,border:`1px solid #E7EAF0`,background:`#ffffff`,boxShadow:`0 6px 16px rgba(47, 52, 64, 0.04)`,overflow:`hidden`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:8,left:10,right:10,display:`flex`,alignItems:`center`,justifyContent:`space-between`,zIndex:2},children:(0,$.jsx)(`span`,{style:{fontSize:11,fontWeight:600,color:`#8b5cf6`,lineHeight:1},children:`首帧(可选)`})}),q?(0,$.jsxs)(`div`,{style:{position:`absolute`,left:10,right:10,bottom:10,height:64},children:[(0,$.jsx)(`img`,{src:vn(q.url),alt:q.name,onClick:()=>{We(q.url),qe(`image`),Ye(q.name),He(!0)},style:{width:`100%`,height:`100%`,objectFit:`cover`,borderRadius:8,cursor:`pointer`,border:`1px solid rgba(139, 92, 246, 0.2)`,boxShadow:`0 3px 10px rgba(47, 52, 64, 0.06)`}}),(0,$.jsx)(`button`,{onClick:Xt,style:{position:`absolute`,top:-6,right:-6,width:18,height:18,border:`none`,background:`#A45B5B`,borderRadius:50,cursor:`pointer`,color:`#fff`,fontSize:9,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 2px 4px rgba(164, 91, 91, 0.3)`,zIndex:10},children:(0,$.jsx)(u$,{style:{fontSize:9}})})]}):(0,$.jsx)(R7,{accept:`image/*`,multiple:!1,onLocalSelect:e=>{e.length>0&&cn(e[0],`first`)},onHistorySelect:t=>{if(t.length>0){let n=t[0];se({name:n.fileName||``,type:`image`,url:n.resourceUrl||n.previewUrl||n.displayUrl||``,role:`first_frame`,label:``}),e.success(`成功添加首帧`)}},onPortraitSelect:t=>{if(t.length>0){let n=t[0],r=n.previewUrl||n.displayUrl||n.videoCoverUrl||n.providerUrl||``;se({name:n.name||`首帧图片`,type:`image`,url:r,role:`first_frame`,label:``,source:`private_portrait_asset`,private_asset_id:n.id}),e.success(`成功添加首帧`)}},uploading:te,children:(0,$.jsxs)(`div`,{style:{position:`absolute`,left:10,right:10,bottom:10,height:64,borderRadius:8,border:`1px dashed rgba(139, 92, 246, 0.28)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,transition:`all 0.25s ease`,backgroundColor:`rgba(139, 92, 246, 0.04)`,flexDirection:`column`,gap:4},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#a78bfa`,e.currentTarget.style.backgroundColor=`rgba(139, 92, 246, 0.08)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`rgba(139, 92, 246, 0.28)`,e.currentTarget.style.backgroundColor=`rgba(139, 92, 246, 0.04)`},children:[(0,$.jsx)(rL,{style:{fontSize:18,color:`#8b5cf6`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#8b5cf6`,fontWeight:500},children:`上传首帧`})]})})]}),(0,$.jsx)(`button`,{onClick:Yt,disabled:!q||!ce,title:`调换首尾帧`,style:{width:32,height:32,alignSelf:`center`,borderRadius:50,border:`1px solid rgba(231, 234, 240, 0.95)`,background:q&&ce?`linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%)`:`#F3F5F8`,cursor:q&&ce?`pointer`:`not-allowed`,color:q&&ce?`#fff`:`#98A2B3`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:q&&ce?`0 6px 14px rgba(139, 92, 246, 0.24)`:`none`,transition:`all 0.2s ease`,flexShrink:0},onMouseEnter:e=>{q&&ce&&(e.currentTarget.style.transform=`scale(1.06)`)},onMouseLeave:e=>{e.currentTarget.style.transform=`scale(1)`},children:(0,$.jsx)(BU,{style:{fontSize:14}})}),(0,$.jsxs)(`div`,{style:{position:`relative`,flex:1,minWidth:0,height:100,borderRadius:12,border:`1px solid #E7EAF0`,background:`#ffffff`,boxShadow:`0 6px 16px rgba(47, 52, 64, 0.04)`,overflow:`hidden`,opacity:q?1:.5},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:8,left:10,right:10,display:`flex`,alignItems:`center`,justifyContent:`space-between`,zIndex:2},children:(0,$.jsx)(`span`,{style:{fontSize:11,fontWeight:600,color:`#8b5cf6`,lineHeight:1},children:`尾帧`})}),ce?(0,$.jsxs)(`div`,{style:{position:`absolute`,left:10,right:10,bottom:10,height:64},children:[(0,$.jsx)(`img`,{src:vn(ce.url),alt:ce.name,onClick:()=>{We(ce.url),qe(`image`),Ye(ce.name),He(!0)},style:{width:`100%`,height:`100%`,objectFit:`cover`,borderRadius:8,cursor:`pointer`,border:`1px solid rgba(139, 92, 246, 0.2)`,boxShadow:`0 3px 10px rgba(47, 52, 64, 0.06)`}}),(0,$.jsx)(`button`,{onClick:Zt,style:{position:`absolute`,top:-6,right:-6,width:18,height:18,border:`none`,background:`#A45B5B`,borderRadius:50,cursor:`pointer`,color:`#fff`,fontSize:9,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 2px 4px rgba(164, 91, 91, 0.3)`,zIndex:10},children:(0,$.jsx)(u$,{style:{fontSize:9}})})]}):q?(0,$.jsx)(R7,{accept:`image/*`,multiple:!1,onLocalSelect:e=>{e.length>0&&cn(e[0],`last`)},onHistorySelect:t=>{if(t.length>0){let n=t[0];le({name:n.fileName||``,type:`image`,url:n.resourceUrl||n.previewUrl||n.displayUrl||``,role:`last_frame`,label:``}),e.success(`成功添加尾帧`)}},onPortraitSelect:t=>{if(t.length>0){let n=t[0],r=n.previewUrl||n.displayUrl||n.videoCoverUrl||n.providerUrl||``;le({name:n.name||`尾帧图片`,type:`image`,url:r,role:`last_frame`,label:``,source:`private_portrait_asset`,private_asset_id:n.id}),e.success(`成功添加尾帧`)}},uploading:te,children:(0,$.jsxs)(`div`,{style:{position:`absolute`,left:10,right:10,bottom:10,height:64,borderRadius:8,border:`1px dashed rgba(139, 92, 246, 0.24)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,transition:`all 0.25s ease`,backgroundColor:`rgba(139, 92, 246, 0.04)`,flexDirection:`column`,gap:4},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#a78bfa`,e.currentTarget.style.backgroundColor=`rgba(139, 92, 246, 0.08)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`rgba(139, 92, 246, 0.24)`,e.currentTarget.style.backgroundColor=`rgba(139, 92, 246, 0.04)`},children:[(0,$.jsx)(rL,{style:{fontSize:18,color:`#8b5cf6`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#8b5cf6`,fontWeight:500},children:`上传尾帧`})]})}):(0,$.jsxs)(`div`,{style:{position:`absolute`,left:10,right:10,bottom:10,height:64,borderRadius:8,border:`1px dashed rgba(226, 232, 240, 0.4)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`not-allowed`,backgroundColor:`rgba(241, 245, 249, 0.5)`,flexDirection:`column`,gap:4},children:[(0,$.jsx)(rL,{style:{fontSize:18,color:`#cbd5e1`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#94a3b8`,fontWeight:500},children:`请先上传首帧`})]})]})]}):(0,$.jsx)($.Fragment,{children:!(c===`video`&&oe===`first_last_frame`)&&(0,$.jsxs)(`div`,{style:{position:`relative`,width:64,height:72,marginTop:`-10`},onMouseEnter:xe,onMouseLeave:Se,children:[F.length===0&&(0,$.jsx)(R7,{accept:c===`image`?`image/*`:`image/*,video/*,audio/*`,onLocalSelect:un,onHistorySelect:mn,onPortraitLibrarySelect:e=>{gn(e)},uploading:te,tooltipTitle:c===`image`?`图片${F.filter(e=>e.type===`image`).length}/${z}`:`图片${F.filter(e=>e.type===`image`).length}/${z}, + `})]})})})]}),(0,$.jsx)(`div`,{className:`desktop-content`,style:{marginLeft:Se+28,marginRight:12,marginTop:16,marginBottom:16,flex:1,minHeight:`calc(100vh - 32px)`,background:`transparent`,padding:0,transition:`margin-left 0.25s ease`},children:(0,$.jsx)(`div`,{style:{boxSizing:`border-box`,height:`100%`,background:`#f1f2f3`,borderRadius:`20px`,boxShadow:`0 4px 32px rgba(0, 0, 0, 0.06), 0 1px 8px rgba(0, 0, 0, 0.04)`,minHeight:`100%`,padding:`24px 32px 32px`,border:`1px solid rgba(0, 0, 0, 0.06)`},children:!fe&&(0,$.jsx)(wt,{})})}),(0,$.jsx)(`div`,{className:`mobile-header`,children:(0,$.jsxs)(`div`,{className:`mobile-header-content`,children:[(0,$.jsx)(`div`,{className:`mobile-menu-btn`,onClick:()=>C(!0),children:(0,$.jsx)(d6,{style:{fontSize:20}})}),(0,$.jsx)(`div`,{className:`mobile-header-title`,children:L}),(0,$.jsx)(`div`,{className:`mobile-header-right`,children:(0,$.jsxs)(`div`,{className:`mobile-credits-badge`,onClick:()=>c(!0),children:[(0,$.jsx)(r5,{}),(0,$.jsx)(`span`,{children:n?.credits||0})]})})]})}),(0,$.jsx)(`div`,{className:`mobile-content`,children:fe&&(0,$.jsx)(wt,{})}),(0,$.jsxs)(QV,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:36,height:36,borderRadius:10,flexShrink:0,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.35)`},children:z?(0,$.jsx)(`img`,{src:z,alt:`logo`,style:{width:24,height:24,objectFit:`contain`}}):(0,$.jsx)(W8,{style:{fontSize:18,color:`#ffffff`}})}),(0,$.jsx)(`span`,{style:{fontWeight:700,fontSize:16,color:`#1e293b`},children:L})]}),placement:`left`,onClose:()=>C(!1),open:x,size:280,closable:!0,className:`mobile-menu-drawer`,styles:{header:{borderBottom:`1px solid #f1f5f9`,padding:`16px 20px`},body:{padding:`12px 8px`,display:`flex`,flexDirection:`column`}},children:[(0,$.jsxs)(`div`,{style:{flex:1,overflow:`auto`,paddingBottom:12},children:[(0,$.jsx)(`div`,{style:{padding:`12px 8px 16px`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,marginBottom:16},children:[(0,$.jsx)(Dw,{size:44,style:{background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,flexShrink:0},children:(0,$.jsx)($8,{})}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,$.jsx)(`div`,{style:{fontSize:15,fontWeight:600,color:`#1e293b`,marginBottom:2},children:n?.username||`用户`}),(0,$.jsxs)(`div`,{style:{fontSize:13,color:`#64748b`},children:[(0,$.jsx)(r5,{style:{color:`#f59e0b`,marginRight:4}}),`积分: `,(0,$.jsx)(`span`,{style:{color:`#f59e0b`,fontWeight:600},children:n?.credits??0})]})]})]})}),(0,$.jsx)(y7,{data:ue}),we.map(e=>{let t=e.menu_type??e.menuType,n=Ce[e.id]&&Ce[e.id].length>0,r=e.path===xe,i=F[e.id],a=b7[e.icon]||(0,$.jsx)(k3,{});return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{className:`mobile-menu-item ${r&&!n?`mobile-menu-item-active`:``} ${t===`group`?`mobile-menu-group`:``}`,onClick:()=>Te(e),children:[t!==`group`&&(0,$.jsx)(`span`,{className:`mobile-menu-icon`,style:{color:r?`#6366f1`:`#64748b`},children:a}),(0,$.jsx)(`span`,{className:`mobile-menu-label`,style:{paddingLeft:0,color:t===`group`?`#94a3b8`:r?`#4f46e5`:`#475569`,fontWeight:t===`group`||r?600:400,fontSize:t===`group`?12:15,textTransform:t===`group`?`uppercase`:`none`,letterSpacing:t===`group`?.5:0},children:e.label}),(t===`group`||n)&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#cbd5e1`,transition:`transform 0.2s ease`,transform:i?`rotate(90deg)`:`rotate(0deg)`},children:(0,$.jsx)(Bg,{})})]}),(t===`group`||n)&&i&&(0,$.jsx)(`div`,{className:`mobile-submenu`,children:(Ce[e.id]||[]).map(e=>{let t=e.path===xe,n=b7[e.icon]||(0,$.jsx)(k3,{});return(0,$.jsxs)(`div`,{className:`mobile-menu-item mobile-submenu-item ${t?`mobile-menu-item-active`:``}`,onClick:()=>Te(e),children:[(0,$.jsx)(`span`,{className:`mobile-menu-icon`,style:{color:t?`#6366f1`:`#94a3b8`},children:n}),(0,$.jsx)(`span`,{className:`mobile-menu-label`,style:{color:t?`#4f46e5`:`#64748b`,fontWeight:t?600:400,fontSize:14},children:e.label})]},e.id)})})]},e.id)})]}),(0,$.jsxs)(`div`,{style:{padding:`8px 0`,borderTop:`1px solid #f1f5f9`},children:[(0,$.jsxs)(`div`,{className:`mobile-menu-item`,onClick:()=>{e(`/user-center?tab=credits`),C(!1)},children:[(0,$.jsx)(`span`,{className:`mobile-menu-icon`,style:{color:`#f59e0b`},children:(0,$.jsx)(r5,{})}),(0,$.jsx)(`span`,{className:`mobile-menu-label`,style:{color:`#475569`},children:`积分明细`})]}),(0,$.jsxs)(`div`,{className:`mobile-menu-item`,onClick:()=>{e(`/user-center?tab=orders`),C(!1)},children:[(0,$.jsx)(`span`,{className:`mobile-menu-icon`,style:{color:`#6366f1`},children:(0,$.jsx)(fH,{})}),(0,$.jsx)(`span`,{className:`mobile-menu-label`,style:{color:`#475569`},children:`订单记录`})]}),(0,$.jsxs)(`div`,{className:`mobile-menu-item`,onClick:()=>{e(`/messages`),C(!1)},children:[(0,$.jsx)(`span`,{className:`mobile-menu-icon`,style:{color:`#8b5cf6`},children:(0,$.jsx)(V2,{})}),(0,$.jsxs)(`span`,{className:`mobile-menu-label`,style:{color:`#475569`},children:[`消息中心`,y>0&&(0,$.jsx)(XQ,{color:`red`,style:{marginLeft:8,fontSize:11},children:y})]})]}),(0,$.jsxs)(`div`,{className:`mobile-menu-item`,onClick:()=>{o(!0),C(!1)},children:[(0,$.jsx)(`span`,{className:`mobile-menu-icon`,style:{color:`#0ea5e9`},children:(0,$.jsx)(X3,{})}),(0,$.jsx)(`span`,{className:`mobile-menu-label`,style:{color:`#475569`},children:`个人信息`})]}),(0,$.jsx)(`div`,{style:{height:8}}),(0,$.jsxs)(`div`,{className:`mobile-menu-item mobile-recharge-item`,onClick:()=>{c(!0),C(!1)},children:[(0,$.jsx)(`span`,{className:`mobile-menu-icon`,style:{color:`#fff`},children:(0,$.jsx)(rL,{})}),(0,$.jsx)(`span`,{className:`mobile-menu-label`,style:{color:`#fff`,fontWeight:600},children:`充值积分`})]}),(0,$.jsxs)(`div`,{className:`mobile-menu-item`,onClick:()=>{Ae(),C(!1)},children:[(0,$.jsx)(`span`,{className:`mobile-menu-icon`,style:{color:`#ef4444`},children:(0,$.jsx)(n6,{})}),(0,$.jsx)(`span`,{className:`mobile-menu-label`,style:{color:`#ef4444`},children:`退出登录`})]})]})]}),(0,$.jsx)(mK,{title:(0,$.jsxs)(sH,{children:[(0,$.jsx)(C8,{}),`账号设置`]}),open:a,onCancel:()=>{o(!1),d.resetFields(),f.resetFields()},width:440,footer:null,children:(0,$.jsxs)(TL,{defaultActiveKey:`profile`,children:[(0,$.jsx)(TL.TabPane,{tab:`个人信息`,children:(0,$.jsxs)(tU,{form:f,layout:`vertical`,style:{marginTop:20},onValuesChange:()=>{},children:[(0,$.jsx)(tU.Item,{name:`username`,label:`用户名`,rules:[{required:!0,message:`请输入用户名`},{min:3,message:`用户名至少3位`}],children:(0,$.jsx)(IW,{placeholder:`请输入用户名`,size:`large`,prefix:(0,$.jsx)($8,{style:{color:`#94a3b8`,marginRight:8}})})}),(0,$.jsx)(tU.Item,{children:(0,$.jsx)(X,{type:`primary`,size:`large`,onClick:ke,style:{width:`100%`},children:`确认修改`})})]})},`profile`),(0,$.jsx)(TL.TabPane,{tab:`修改密码`,children:(0,$.jsxs)(tU,{form:d,layout:`vertical`,style:{marginTop:20},onValuesChange:()=>{},children:[(0,$.jsx)(tU.Item,{name:`oldPwd`,label:`原密码`,rules:[{required:!0,message:`请输入原密码`}],children:(0,$.jsx)(IW.Password,{placeholder:`请输入原密码`,size:`large`,prefix:(0,$.jsx)(X3,{style:{color:`#94a3b8`,marginRight:8}})})}),(0,$.jsx)(tU.Item,{name:`newPwd`,label:`新密码`,rules:[{required:!0,message:`请输入新密码`},{min:6,message:`密码至少6位`}],children:(0,$.jsx)(IW.Password,{placeholder:`请输入新密码(至少6位)`,size:`large`,prefix:(0,$.jsx)(X3,{style:{color:`#94a3b8`,marginRight:8}})})}),(0,$.jsx)(tU.Item,{name:`confirmPwd`,label:`确认新密码`,rules:[{required:!0,message:`请再次输入新密码`},({getFieldValue:e})=>({validator(t,n){return!n||e(`newPwd`)===n?Promise.resolve():Promise.reject(Error(`两次密码不一致`))}})],children:(0,$.jsx)(IW.Password,{placeholder:`请再次输入新密码`,size:`large`,prefix:(0,$.jsx)(X3,{style:{color:`#94a3b8`,marginRight:8}})})}),(0,$.jsx)(tU.Item,{children:(0,$.jsx)(X,{type:`primary`,size:`large`,onClick:Oe,style:{width:`100%`},children:`确认修改`})})]})},`password`)]})}),(0,$.jsx)(mK,{title:(0,$.jsxs)(sH,{children:[(0,$.jsx)(m3,{}),`积分充值`]}),open:s,onCancel:()=>{c(!1),m(null)},width:680,className:`recharge-modal`,footer:(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,padding:`12px 0 0`,borderTop:`1px solid #f0f0f0`},children:[(0,$.jsx)(X,{size:`large`,onClick:()=>{c(!1),m(null)},style:{borderRadius:10,marginRight:12},children:`取消`}),(0,$.jsx)(X,{type:`primary`,size:`large`,disabled:!p||!ce.alipay&&!ce.wechat,loading:re,onClick:async()=>{let e=_.find(e=>e.id===p);if(!e)return;let t=(e.credits||0)+(e.bonus_credits||e.bonusCredits||0);try{ie(!0);let n=await zie(e.id,G),r=n.qrUrl||n.codeUrl||n.qr_code||n.code_url;(n.paymentMethod===`alipay`||n.paymentMethod===`wechat`)&&r?(te({price:e.price,credits:t,qrCode:r,method:n.paymentMethod}),c(!1),W(!0),se.current=n.orderNo,localStorage.setItem(ge,JSON.stringify({orderNo:n.orderNo,price:e.price,credits:t,qrCode:r,method:n.paymentMethod,createdAt:n.createdAt||new Date().toISOString(),timeoutSeconds:180})),Ne(n.orderNo)):(Z.success(`充值成功!积分已到账`),_7.getState().refreshUser(),c(!1),m(null))}catch(e){Z.error(e?.message||`创建订单失败,请重试`)}finally{ie(!1)}},style:{borderRadius:10,fontWeight:600,background:p?`linear-gradient(135deg, #6366f1, #8b5cf6)`:`#d1d5db`,border:`none`,boxShadow:p?`0 8px 24px rgba(99,102,241,0.3)`:`none`},children:`确认充值`})]}),children:(0,$.jsxs)(`div`,{style:{marginTop:16},children:[(0,$.jsxs)(sH,{style:{marginBottom:16},children:[(0,$.jsx)(r5,{style:{color:`#6366f1`}}),(0,$.jsx)(Q.Text,{style:{color:`#64748b`,letterSpacing:0},children:`当前积分余额`}),(0,$.jsx)(Q.Text,{strong:!0,style:{color:`#6366f1`,fontSize:20,fontWeight:600},children:n?.credits??0})]}),!ce.alipay&&!ce.wechat?(0,$.jsx)(`div`,{style:{marginBottom:16,padding:16,background:`#fef2f2`,borderRadius:12,border:`1px solid #fecaca`},children:(0,$.jsx)(Q.Text,{style:{color:`#dc2626`,fontSize:13},children:`⚠️ 暂无可用的支付方式,请联系管理员开启支付功能`})}):(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(Q.Text,{style:{color:`#64748b`,fontSize:13,marginBottom:8,display:`block`},children:`选择支付方式`}),(0,$.jsxs)(jI.Group,{value:G,onChange:e=>ne(e.target.value),style:{display:`flex`,gap:12},children:[ce.alipay&&(0,$.jsxs)(jI.Button,{value:`alipay`,style:{flex:1,textAlign:`center`,borderRadius:10,height:44,lineHeight:`42px`,borderColor:G===`alipay`?`#1677ff`:void 0,color:G===`alipay`?`#1677ff`:void 0},children:[(0,$.jsx)(c2,{style:{fontSize:16,marginRight:6}}),`支付宝`]}),ce.wechat&&(0,$.jsxs)(jI.Button,{value:`wechat`,style:{flex:1,textAlign:`center`,borderRadius:10,height:44,lineHeight:`42px`,borderColor:G===`wechat`?`#07c160`:void 0,color:G===`wechat`?`#07c160`:void 0},children:[(0,$.jsx)(o5,{style:{fontSize:16,marginRight:6}}),`微信支付`]})]})]}),(0,$.jsxs)(`div`,{style:{padding:`12px 16px`,background:`rgba(99, 102, 241, 0.06)`,borderRadius:10,marginBottom:16,display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(F3,{style:{color:`#6366f1`,fontSize:14}}),(0,$.jsxs)(Q.Text,{style:{color:`#64748b`,fontSize:13},children:[`当前平台仅支持支付宝/微信扫码充值,如需转账支付请`,(0,$.jsx)(Q.Text,{style:{color:`#ff0000ff`,cursor:`pointer`,textDecoration:`underline`},onClick:()=>{c(!1),u(!0)},children:`联系我们`})]})]}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:12,flexWrap:`wrap`},children:_.map((e,t)=>{let n=x7[t%x7.length],r=(e.credits||0)+(e.bonus_credits||e.bonusCredits||0);return(0,$.jsxs)(`div`,{onClick:()=>m(e.id),style:{flex:`1 1 45%`,minWidth:200,borderRadius:16,padding:`20px 16px`,background:p===e.id?`rgba(99,102,241,0.04)`:`#fafbff`,border:p===e.id?`2px solid #6366f1`:`1px solid #f0f0f5`,cursor:`pointer`,position:`relative`,transition:`all 0.2s`},children:[e.description&&(0,$.jsx)(XQ,{color:`purple`,style:{position:`absolute`,top:-10,left:`50%`,transform:`translateX(-50%)`,borderRadius:8,fontSize:11},children:e.description}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:44,height:44,borderRadius:12,flexShrink:0,background:n.gradient,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:18,color:`#fff`,boxShadow:`0 6px 16px ${n.shadow}`},children:n.icon}),(0,$.jsxs)(`div`,{style:{flex:1},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`baseline`,gap:6},children:[(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:15},children:e.name}),(0,$.jsxs)(Q.Text,{style:{fontSize:14,fontWeight:600,color:`#6366f1`},children:[r.toLocaleString(),` 积分`]})]}),(0,$.jsxs)(`div`,{style:{fontSize:22,fontWeight:800,marginTop:4,background:n.gradient,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`},children:[`¥`,e.price]})]})]})]},e.id)})})]})}),(0,$.jsx)(mK,{open:U,onCancel:async()=>{if(Me(),se.current){try{await R5(se.current)}catch{}se.current=null}localStorage.removeItem(ge),W(!1),te(null)},footer:null,width:400,closable:!1,styles:{body:{padding:0,borderRadius:16,overflow:`hidden`}},children:(0,$.jsxs)(`div`,{style:{padding:`24px`},children:[(0,$.jsxs)(`div`,{style:{textAlign:`center`,marginBottom:24},children:[(0,$.jsx)(`div`,{style:{width:48,height:48,background:ee?.method===`alipay`?`linear-gradient(135deg, #1677ff, #0958d9)`:`linear-gradient(135deg, #07c160, #06ae56)`,borderRadius:16,display:`flex`,alignItems:`center`,justifyContent:`center`,margin:`0 auto 12px`},children:ee?.method===`alipay`?(0,$.jsx)(c2,{style:{fontSize:24,color:`#fff`}}):(0,$.jsx)(o5,{style:{fontSize:24,color:`#fff`}})}),(0,$.jsx)(Q.Title,{level:4,style:{margin:0},children:ee?.method===`alipay`?`支付宝支付`:`微信支付`}),(0,$.jsx)(Q.Text,{style:{color:`#94a3b8`,fontSize:13},children:ee?.method===`alipay`?`请使用支付宝扫描二维码完成支付`:`请使用微信扫描二维码完成支付`})]}),(0,$.jsxs)(`div`,{style:{background:`#fff`,borderRadius:16,padding:20,display:`flex`,flexDirection:`column`,alignItems:`center`,boxShadow:`0 4px 20px rgba(0,0,0,0.08)`},children:[(0,$.jsx)(`div`,{style:{width:180,height:180,borderRadius:12,overflow:`hidden`,background:`#fff`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:ee&&(0,$.jsx)(a2,{value:ee.qrCode,size:160,level:`M`,includeMargin:!1})}),(0,$.jsxs)(`div`,{style:{marginTop:16,textAlign:`center`},children:[(0,$.jsxs)(`div`,{style:{fontSize:28,fontWeight:700,color:`#1a1a2e`},children:[`¥`,ee?.price||0]}),(0,$.jsxs)(`div`,{style:{fontSize:13,color:`#64748b`,marginTop:4},children:[`购买 `,ee?.credits||0,` 积分`]}),(0,$.jsx)(`div`,{style:{marginTop:12,padding:`8px 16px`,background:ae<=30?`#fef2f2`:`#f0f9ff`,borderRadius:8,border:ae<=30?`1px solid #fecaca`:`1px solid #bae6fd`,display:`inline-block`},children:(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:ae<=30?`#dc2626`:`#0284c7`},children:[`订单将在 `,(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:800},children:ae}),` 秒后关闭`]})})]})]}),(0,$.jsx)(`div`,{style:{marginTop:20,padding:16,background:`#fef3c7`,borderRadius:12},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:8},children:[(0,$.jsx)(`div`,{style:{fontSize:16,marginTop:-2},children:`💡`}),(0,$.jsxs)(`div`,{style:{fontSize:13,color:`#92400e`},children:[(0,$.jsx)(`div`,{style:{fontWeight:500,marginBottom:4},children:`支付提示`}),(0,$.jsxs)(`ul`,{style:{margin:0,paddingLeft:16},children:[(0,$.jsx)(`li`,{style:{marginBottom:2},children:`请在支付后等待页面自动跳转`}),(0,$.jsx)(`li`,{children:`如支付成功但未到账,请联系客服`})]})]})]})}),(0,$.jsx)(`div`,{style:{marginTop:20},children:(0,$.jsx)(X,{size:`large`,block:!0,onClick:async()=>{if(Me(),se.current){try{await R5(se.current)}catch{}se.current=null}localStorage.removeItem(ge),W(!1),te(null),m(null)},style:{borderRadius:10},children:`取消支付`})})]})}),(0,$.jsx)($ae,{}),(0,$.jsx)(`div`,{className:`contact-button-wrapper`,style:{right:`${k.x}px`,bottom:`${window.innerHeight-k.y}px`},children:(0,$.jsxs)(`div`,{style:{position:`relative`},children:[(0,$.jsx)(`div`,{className:`contact-tooltip`,style:{opacity:+!!w},children:`联系我们`}),(0,$.jsx)(`button`,{className:`contact-button ${j?`dragging`:``}`,onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),onMouseDown:_e,onMouseUp:ye,children:(0,$.jsx)(m6,{style:{fontSize:20}})})]})}),(0,$.jsx)(mK,{title:(0,$.jsxs)(sH,{children:[(0,$.jsx)(m6,{}),`联系我们`]}),open:l,onCancel:()=>{u(!1),E.resetFields()},footer:null,width:480,className:`contact-modal`,children:(0,$.jsxs)(`div`,{style:{marginTop:8},children:[(0,$.jsxs)(tU,{form:E,layout:`vertical`,children:[(0,$.jsx)(tU.Item,{name:`name`,label:`姓名`,rules:[{required:!0,message:`请输入姓名`}],children:(0,$.jsx)(IW,{placeholder:`请输入您的姓名`,size:`large`})}),(0,$.jsx)(tU.Item,{name:`phone`,label:`手机号`,rules:[{required:!0,message:`请输入手机号`},{pattern:/^1[3-9]\d{9}$/,message:`请输入正确的手机号`}],children:(0,$.jsx)(IW,{placeholder:`请输入您的手机号`,size:`large`})}),(0,$.jsx)(tU.Item,{name:`companyName`,label:`公司名称`,rules:[{required:!0,message:`请输入公司名称`}],children:(0,$.jsx)(IW,{placeholder:`请输入公司名称`,size:`large`})}),(0,$.jsx)(tU.Item,{name:`industry`,label:`您的行业`,rules:[{required:!0,message:`请输入您的行业`}],children:(0,$.jsx)(IW,{placeholder:`请输入您的行业`,size:`large`})}),(0,$.jsx)(tU.Item,{name:`message`,label:`留言(选填)`,children:(0,$.jsx)(IW.TextArea,{placeholder:`请输入您的需求或问题`,rows:3,style:{borderRadius:10}})})]}),(0,$.jsxs)(`div`,{style:{marginTop:16,display:`flex`,gap:12},children:[(0,$.jsx)(X,{size:`large`,onClick:()=>{u(!1),E.resetFields()},style:{borderRadius:10,flex:1},children:`取消`}),(0,$.jsx)(X,{type:`primary`,size:`large`,onClick:je,loading:D,style:{borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,flex:1},children:`提交`})]})]})})]})},noe=`http://localhost:8000/api`,roe=()=>{let{checkAuth:e}=_7(),[t,n]=(0,S.useState)(!1),[r,i]=(0,S.useState)(`password`),[a,o]=(0,S.useState)(`password`),[s]=On(),c=s.get(`redirect`),l=s.get(`tab`),[u,d]=(0,S.useState)(0),[f,p]=(0,S.useState)(0),[m,h]=(0,S.useState)(!1),[g,_]=(0,S.useState)(!1),[v,y]=(0,S.useState)(!1),[b,x]=(0,S.useState)(!1),[C,w]=(0,S.useState)(0),[T,E]=(0,S.useState)(!1),[D,O]=(0,S.useState)(!1),[k,A]=(0,S.useState)(!1),j=(()=>{try{let e=localStorage.getItem(`siteInfo`);if(e){let t=JSON.parse(e);return{siteName:t.siteName||`VideoGen.AI`,siteLogo:t.siteLogo||``}}}catch{}return{siteName:`VideoGen.AI`,siteLogo:``}})(),[M,N]=(0,S.useState)(j.siteName),[P,F]=(0,S.useState)(j.siteLogo),[I,L]=(0,S.useState)(``),[R,z]=(0,S.useState)(!1),[B,V]=(0,S.useState)(``),[H,U]=(0,S.useState)(``),W=Ye(),{login:ee}=_7(),[te]=tU.useForm(),[G]=tU.useForm(),[ne]=tU.useForm();(0,S.useEffect)(()=>{j5().then(e=>{N(e.siteName),F(e.siteLogo),L(e.loginBgVideo||``),V(e.userAgreementPrivacyUrl),U(e.siteCopyright)}).catch(()=>{})},[]),(0,S.useEffect)(()=>{l===`register`&&i(`register`)},[l]);let re=()=>{if(c)try{W(decodeURIComponent(c));return}catch{}W(`/home`)},ie=()=>m?!0:(Z.warning(`请先阅读并同意用户协议及隐私政策`),!1),ae=async()=>{if(ie())try{let t=await te.validateFields();await ee(t.phone,t.password,void 0,t.rememberMe),Z.success(`登录成功,欢迎回来`),await e(),re()}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`登录失败`;Z.error(t)}},oe=async()=>{if(ie())try{let t=G.getFieldsValue();if(!t.phone||!t.code){Z.error(`请填写手机号和验证码`);return}n(!0),await gie(t.phone,t.code),Z.success(`登录成功,欢迎回来`),await e(),re()}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`登录失败`;Z.error(t)}finally{n(!1)}},K=async()=>{if(ie())try{let t=await ne.validateFields();n(!0),await _ie(t.phone,t.regCode,t.password),Z.success(`注册成功`),await e(),re()}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`注册失败`;Z.error(t)}finally{n(!1)}},q=(e,t)=>{e(60);let n=setInterval(()=>{e(e=>e<=1?(clearInterval(n),_(!1),t?O(!0):A(!0),0):e-1)},1e3)};(0,S.useEffect)(()=>{u===0&&r===`phone`&&x(!1)},[u,r]);let se=async(e,t)=>{try{if(!e||!/^1\d{10}$/.test(e)){Z.error(`请输入正确的手机号`);return}if(t){_(!0),y(!1);return}if(!b){_(!0),x(!1);return}let n=``;n=r===`register`?`register`:`login`,await M5(e,n),q(t?p:d),Z.success(`验证码已发送`)}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`登录失败`;Z.error(t),r===`register`?(y(!1),p(0)):(x(!1),d(0)),w(e=>e+1)}},ce=async(e=!1)=>{let t=r===`register`?ne.getFieldValue(`phone`):G.getFieldValue(`phone`);try{let e=``;e=r===`register`?`register`:`login`,await M5(t,e),r===`register`?(y(!0),q(p,!0)):(x(!0),q(d,!1)),Z.success(`验证码已发送`)}catch(e){let t=e?.response?.data?.detail||e?.response?.data?.message||e?.message||`登录失败`;Z.error(t),r===`register`?(y(!1),p(0),O(!0)):(x(!1),d(0),A(!0)),w(e=>e+1)}},le=e=>{o(e),i(e),d(0),p(0),x(!1),y(!1),_(!1),O(!1),A(!1),w(e=>e+1),e===`password`?te.resetFields():G.resetFields()},ue={background:`#fff`,border:`1.5px solid #e2e8f0`,color:`#1e293b`,borderRadius:10,fontSize:14},de=e=>{if(!e){Z.warning(`暂未上传协议文件`);return}e.startsWith(`http://`)||e.startsWith(`https://`)?window.open(e,`_blank`):window.open(`${noe.replace(/\/api$/,``)}${e}`,`_blank`)};return(0,$.jsxs)(`div`,{className:`login-page`,children:[(0,$.jsx)(ioe,{src:I,onReady:()=>z(!0)}),(0,$.jsx)(`div`,{className:`login-bg-overlay`,style:{opacity:+!!R}}),(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,opacity:+!!R,transition:`opacity 0.5s ease`,pointerEvents:R?`auto`:`none`},children:[(0,$.jsx)(`div`,{className:`login-slogan`,children:(0,$.jsx)(`span`,{className:`login-slogan-text`,children:`AI赋能创意,素材触手可及`})}),(0,$.jsx)(`div`,{className:`login-center`,children:(0,$.jsxs)(DL,{className:`login-card`,styles:{body:{padding:`32px 32px`}},children:[(0,$.jsx)(`div`,{className:`login-card-header`,children:(0,$.jsxs)(`div`,{className:`login-logo-row`,children:[P?(0,$.jsx)(`img`,{src:P,alt:`logo`,className:`login-logo-img`}):(0,$.jsx)(`div`,{className:`login-logo-placeholder`,children:(0,$.jsx)(W8,{style:{fontSize:20,color:`#fff`}})}),(0,$.jsx)(`span`,{className:`login-site-name`,children:M})]})}),(0,$.jsx)(Q.Text,{className:`login-card-subtitle`,children:r===`register`?`注册新账号,开始创作视频`:`登录您的账号,开始创作`}),r!==`register`&&(0,$.jsx)(`div`,{className:`login-tabs`,children:[`password`,`phone`].map(e=>(0,$.jsx)(`div`,{onClick:()=>le(e),className:`login-tab ${a===e?`login-tab-active`:``}`,children:e===`password`?`密码登录`:`验证码登录`},e))}),r===`password`&&(0,$.jsxs)(tU,{form:te,size:`large`,layout:`vertical`,onFinish:ae,children:[(0,$.jsx)(tU.Item,{name:`phone`,rules:[{required:!0,message:`请输入手机号`},{pattern:/^1\d{10}$/,message:`请输入正确的手机号`}],children:(0,$.jsx)(IW,{prefix:(0,$.jsx)(_6,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入手机号`,style:ue})}),(0,$.jsx)(tU.Item,{name:`password`,rules:[{required:!0,message:`请输入密码`}],children:(0,$.jsx)(IW.Password,{prefix:(0,$.jsx)(X3,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入密码`,style:ue})}),(0,$.jsx)(tU.Item,{name:`rememberMe`,valuePropName:`checked`,style:{marginBottom:12},children:(0,$.jsx)(VR,{children:`记住我的登录状态`})}),(0,$.jsx)(tU.Item,{style:{marginBottom:12},children:(0,$.jsx)(X,{type:`primary`,htmlType:`submit`,loading:t,block:!0,className:`login-submit-btn`,children:`登 录`})})]}),r===`phone`&&(0,$.jsxs)(tU,{form:G,size:`large`,layout:`vertical`,children:[(0,$.jsx)(tU.Item,{name:`phone`,rules:[{required:!0,message:`请输入手机号`},{pattern:/^1\d{10}$/,message:`请输入正确的手机号`}],children:(0,$.jsx)(IW,{prefix:(0,$.jsx)(_6,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入手机号`,maxLength:11,style:ue})}),(0,$.jsx)(tU.Item,{name:`code`,rules:[{required:!0,message:`请输入验证码`}],children:(0,$.jsxs)(sH.Compact,{style:{width:`100%`},children:[(0,$.jsx)(IW,{prefix:(0,$.jsx)(m8,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入验证码`,maxLength:6,disabled:!b,style:{...ue,borderRadius:`10px 0 0 10px`,flex:1}}),(0,$.jsx)(X,{disabled:u>0,style:{fontSize:14,fontWeight:400},onClick:()=>{k?(x(!1),_(!0),w(e=>e+1)):g&&!b?(E(!0),setTimeout(()=>E(!1),500)):se(G.getFieldValue(`phone`))},className:`login-code-btn`,children:u>0?`${u}s`:k?`重新发送`:`获取验证码`})]})}),g&&(0,$.jsx)(tU.Item,{style:{marginBottom:12},children:(0,$.jsx)(S7,{onSuccess:ce,isVerified:b,shake:T})},C),(0,$.jsx)(tU.Item,{style:{marginBottom:12},children:(0,$.jsx)(X,{type:`primary`,onClick:oe,loading:t,block:!0,className:`login-submit-btn`,children:`登 录`})})]}),r===`register`&&(0,$.jsxs)(tU,{form:ne,size:`large`,layout:`vertical`,children:[(0,$.jsx)(tU.Item,{name:`phone`,rules:[{required:!0,message:`请输入手机号`},{pattern:/^1\d{10}$/,message:`请输入正确的手机号`}],children:(0,$.jsx)(IW,{prefix:(0,$.jsx)(_6,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入手机号`,maxLength:11,style:ue})}),(0,$.jsx)(tU.Item,{name:`regCode`,rules:[{required:!0,message:`请输入验证码`}],children:(0,$.jsxs)(sH.Compact,{style:{width:`100%`},children:[(0,$.jsx)(IW,{prefix:(0,$.jsx)(m8,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请输入验证码`,maxLength:6,disabled:!v,style:{...ue,borderRadius:`10px 0 0 10px`,flex:1}}),(0,$.jsx)(X,{disabled:f>0,style:{fontSize:14,fontWeight:400},onClick:()=>{D?(y(!1),_(!0),w(e=>e+1)):g&&!v?(E(!0),setTimeout(()=>E(!1),500)):se(ne.getFieldValue(`phone`),!0)},className:`login-code-btn`,children:f>0?`${f}s`:D?`重新发送`:`获取验证码`})]})}),g&&(0,$.jsx)(tU.Item,{style:{marginBottom:12},children:(0,$.jsx)(S7,{onSuccess:ce,isVerified:v,shake:T})},C),(0,$.jsx)(tU.Item,{name:`password`,rules:[{required:!0,message:`请设置密码`},{min:6,message:`密码至少6位`}],children:(0,$.jsx)(IW.Password,{prefix:(0,$.jsx)(X3,{style:{color:`#94a3b8`,marginRight:8}}),placeholder:`请设置密码(至少6位)`,style:ue})}),(0,$.jsx)(tU.Item,{style:{marginBottom:12},children:(0,$.jsx)(X,{type:`primary`,onClick:K,loading:t,block:!0,className:`login-submit-btn`,children:`注 册`})})]}),(0,$.jsx)(`div`,{className:`login-agreement`,children:(0,$.jsx)(VR,{checked:m,onChange:e=>h(e.target.checked),children:(0,$.jsxs)(`span`,{className:`login-agreement-text`,children:[`我已阅读并同意`,(0,$.jsx)(`span`,{onClick:e=>{e.stopPropagation(),de(B)},className:`login-link`,children:`《用户协议及隐私政策》`})]})})}),(0,$.jsx)(`div`,{className:`login-footer`,children:r===`register`?(0,$.jsx)(Q.Text,{className:`login-switch-btn`,onClick:()=>{i(`password`),o(`password`),O(!1),A(!1),y(!1),_(!1),w(e=>e+1),ne.resetFields()},children:`已有账号?去登录`}):(0,$.jsx)(Q.Text,{className:`login-switch-btn`,onClick:()=>{i(`register`),O(!1),A(!1),y(!1),_(!1),w(e=>e+1)},children:`没有账号?立即注册`})})]})}),H&&(0,$.jsx)(`div`,{className:`login-copyright-wrapper`,children:(0,$.jsx)(`div`,{className:`login-copyright`,children:H})})]})]})},ioe=({src:e,onReady:t})=>{let[n,r]=(0,S.useState)(!1),i=S.useRef(null),a=()=>{n||(r(!0),i.current?.play().catch(()=>{}),t())};if(!e)return t(),null;let o=e.toLowerCase().endsWith(`.gif`),s=e.toLowerCase().endsWith(`.webp`);return o||s?(0,$.jsx)(`img`,{className:`login-bg-video`,src:e,alt:``,onLoad:a,onError:a}):(0,$.jsxs)($.Fragment,{children:[!n&&(0,$.jsx)(`div`,{className:`login-bg-video login-bg-placeholder`}),(0,$.jsx)(`video`,{ref:i,className:`login-bg-video`,style:{opacity:+!!n},autoPlay:!0,loop:!0,muted:!0,playsInline:!0,preload:`auto`,onCanPlayThrough:a,onCanPlay:a,onError:a,children:(0,$.jsx)(`source`,{src:e,type:e.endsWith(`.webm`)?`video/webm`:e.endsWith(`.mov`)?`video/quicktime`:`video/mp4`})})]})},S7=({onSuccess:e,isVerified:t,shake:n})=>{let r=S.useRef(null),i=S.useRef(null),a=S.useRef(null),o=S.useRef(0),s=S.useRef(!1),[c,l]=S.useState(360),u=c-50;S.useEffect(()=>{let e=()=>{if(r.current){let e=r.current.offsetWidth;e>0&&l(e)}};e();let t=new ResizeObserver(e);return r.current&&t.observe(r.current),window.addEventListener(`resize`,e),()=>{t.disconnect(),window.removeEventListener(`resize`,e)}},[]);let d=n=>{if(s.current||t)return;let r=Math.max(0,Math.min(n,u));o.current=r,i.current&&(i.current.style.left=`${r}px`),a.current&&(a.current.style.width=`${r+50}px`),r>=u-5&&(s.current=!0,i.current&&(i.current.style.background=`#22c55e`,i.current.innerHTML=``),a.current&&(a.current.style.width=`${c}px`,a.current.style.background=`#dcfce7`),e())};return(0,$.jsxs)(`div`,{ref:r,onMouseDown:e=>{if(e.preventDefault(),s.current||t)return;let n=r.current;if(!n)return;let c=n.getBoundingClientRect(),l=e=>{d(e.clientX-c.left-50/2)},f=()=>{document.removeEventListener(`mousemove`,l),document.removeEventListener(`mouseup`,f),!s.current&&o.current{if(s.current||t)return;e.preventDefault();let n=r.current;if(!n)return;let c=n.getBoundingClientRect();d(e.touches[0].clientX-c.left-50/2);let l=e=>{d(e.touches[0].clientX-c.left-50/2)},f=()=>{document.removeEventListener(`touchmove`,l),document.removeEventListener(`touchend`,f),!s.current&&o.current({page:1,pageSize:10,total:0,items:[]}),C7=d5((e,t)=>({projects:[],records:aoe(),loading:!1,mediaType:`video`,countType:`请选择`,generationCount:1,selectedRatio:`1:1`,selectedResolution:`2K`,width:2048,height:2048,videoDuration:5,videoAspectRatio:`9:16`,videoResolution:`720p`,engineOptions:{ratios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:[`480p`,`720p`,`1080p`],durations:[5,8,10,12,15]},enginesele:[],inputValue:``,currentMedia:[],fetchProjects:async()=>{e({loading:!0});try{e({projects:await bie(),loading:!1})}catch{e({loading:!1})}},createProject:async(n,r)=>{let i=await xie(n,r);return e({projects:[i,...t().projects]}),i},deleteProject:async n=>{await Sie(n),e({projects:t().projects.filter(e=>e.id!==n)})},fetchRecords:async(t={})=>{e({loading:!0});try{e({records:await w5(t),loading:!1})}catch{e({loading:!1})}},optimizePrompt:async(n,r)=>{let i=await Cie(n,r);try{await _7.getState().checkAuth()}catch{}let a=t().records;return e({records:{...a,total:a.total+1,items:[i.record,...a.items]}}),i},generateVideo:async(n,r)=>{let i=await Nie(n,r);try{await _7.getState().checkAuth()}catch{}let a=t().records;return e({records:{...a,items:a.items.map(e=>e.id===n?i:e)}}),i},updateRecordReferences:(n,r)=>{let i=t().records;e({records:{...i,items:i.items.map(e=>e.id===n?{...e,references:r}:e)}})},setMediaType:t=>e({mediaType:t}),setCountType:t=>e({countType:t}),setGenerationCount:t=>e({generationCount:t}),setImageSettings:(t,n,r,i)=>e({selectedRatio:t,selectedResolution:n,width:r,height:i}),setVideoSettings:(t,n,r)=>e({videoDuration:t,videoAspectRatio:n,videoResolution:r}),setEngineOptions:t=>e({engineOptions:t}),setSelectedRatio:t=>e({selectedRatio:t}),setSelectedResolution:t=>e({selectedResolution:t}),setWidth:t=>e({width:t}),setHeight:t=>e({height:t}),setVideoDuration:t=>e({videoDuration:t}),setVideoAspectRatio:t=>e({videoAspectRatio:t}),setVideoResolution:t=>e({videoResolution:t}),setEnginesele:t=>e({enginesele:t}),setInputValue:t=>e({inputValue:t}),setCurrentMedia:t=>e({currentMedia:t}),resetGenerationConfig:()=>e({mediaType:`image`,countType:`请选择`,generationCount:1,selectedRatio:`1:1`,selectedResolution:`2K`,width:2048,height:2048,videoDuration:5,videoAspectRatio:`9:16`,videoResolution:`720p`,engineOptions:{ratios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:[`480p`,`720p`,`1080p`],durations:[5,8,10,12,15]},enginesele:[],inputValue:``,currentMedia:[]})})),w7=480;function T7(e){if(!e)return`-`;let t=e.trim();if(!t)return`-`;let n=t.match(/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(?:\.\d+)?(Z|[+-]\d{2}:?\d{2})?$/);if(!n)return t.slice(0,16).replace(`T`,` `);let[,r,i,a,o,s,c,l]=n,u=Date.UTC(+r,i-1,+a,+o,+s,+c);if(l&&l!==`Z`){let e=l[0]===`+`?1:-1,[t,n]=l.slice(1).split(`:`),r=u-e*(t*60+ +n)*6e4+w7*6e4,i=new Date(r);return`${i.getUTCFullYear()}-${E7(i.getUTCMonth()+1)}-${E7(i.getUTCDate())} ${E7(i.getUTCHours())}:${E7(i.getUTCMinutes())}`}let d=l===`Z`?u+w7*6e4:u,f=new Date(d);return`${f.getUTCFullYear()}-${E7(f.getUTCMonth()+1)}-${E7(f.getUTCDate())} ${E7(f.getUTCHours())}:${E7(f.getUTCMinutes())}`}function E7(e){return e<10?`0${e}`:String(e)}var D7=[`#f97316`,`#3b82f6`,`#8b5cf6`,`#10b981`,`#eab308`,`#6366f1`,`#ef4444`,`#06b6d4`,`#64748b`,`#78716c`],O7={ShoppingCartOutlined:(0,$.jsx)(E8,{}),BookOutlined:(0,$.jsx)(W2,{}),HomeOutlined:(0,$.jsx)(k3,{}),FireOutlined:(0,$.jsx)(c3,{}),RocketOutlined:(0,$.jsx)(d8,{}),SkinOutlined:(0,$.jsx)(Mre,{}),CompassOutlined:(0,$.jsx)(F4,{}),HeartOutlined:(0,$.jsx)(b3,{}),CarOutlined:(0,$.jsx)(a4,{}),CameraOutlined:(0,$.jsx)(n4,{}),CloudOutlined:(0,$.jsx)(_4,{}),StarOutlined:(0,$.jsx)(R8,{}),TrophyOutlined:(0,$.jsx)(q8,{}),ThunderboltOutlined:(0,$.jsx)(W8,{}),BulbOutlined:(0,$.jsx)(X2,{}),CoffeeOutlined:(0,$.jsx)(k4,{}),CrownOutlined:(0,$.jsx)(V4,{}),DashboardOutlined:(0,$.jsx)(W4,{}),FlagOutlined:(0,$.jsx)(d3,{}),GlobalOutlined:(0,$.jsx)(_3,{}),GiftOutlined:(0,$.jsx)(m3,{}),LaptopOutlined:(0,$.jsx)(R3,{}),MobileOutlined:(0,$.jsx)(_6,{}),MonitorOutlined:(0,$.jsx)(b6,{}),PayCircleOutlined:(0,$.jsx)(M6,{}),PictureOutlined:(0,$.jsx)(R6,{}),PlayCircleOutlined:(0,$.jsx)(q6,{}),SafetyOutlined:(0,$.jsx)(m8,{}),ShoppingOutlined:(0,$.jsx)(k8,{}),SmileOutlined:(0,$.jsx)(N8,{}),SoundOutlined:(0,$.jsx)(I8,{}),TagOutlined:(0,$.jsx)(Vre,{}),TeamOutlined:(0,$.jsx)(H8,{}),ToolOutlined:(0,$.jsx)(Gre,{}),TruckOutlined:(0,$.jsx)(Jre,{}),VideoCameraOutlined:(0,$.jsx)(t5,{}),WalletOutlined:(0,$.jsx)(r5,{}),BankOutlined:(0,$.jsx)(F2,{}),BuildOutlined:(0,$.jsx)(q2,{}),ExperimentOutlined:(0,$.jsx)($4,{}),HighlightOutlined:(0,$.jsx)(C3,{}),IdcardOutlined:(0,$.jsx)(M3,{}),MedicineBoxOutlined:(0,$.jsx)(c6,{}),ReadOutlined:(0,$.jsx)($6,{}),RestOutlined:(0,$.jsx)(n8,{}),SketchOutlined:(0,$.jsx)(Are,{}),SolutionOutlined:(0,$.jsx)(Fre,{})},ooe=()=>{let[e,t]=(0,S.useState)(!1),[n]=tU.useForm(),r=Ye(),{projects:i,fetchProjects:a,createProject:o,deleteProject:s}=C7(),[c,l]=(0,S.useState)([]);(0,S.useEffect)(()=>{a(),I5().then(l).catch(()=>{})},[]);let u=Object.fromEntries(c.map((e,t)=>[e.key,{label:e.label,color:D7[t%D7.length],icon:e.icon||`AppstoreOutlined`}]));return(0,$.jsxs)(`div`,{className:`content_box`,children:[(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:24,padding:`16px 24px`,borderRadius:16,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(139, 92, 246, 0.04) 100%)`,backdropFilter:`blur(10px)`,border:`1px solid rgba(99, 102, 241, 0.08)`,position:`relative`,overflow:`hidden`,flexWrap:`wrap`,gap:12},children:[(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16},children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{style:{margin:0,fontSize:18,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`垂直行业提示词智能优化(新手专属,一键生成标准素材)`}),(0,$.jsxs)(`p`,{style:{fontSize:13,color:`#64748b`,margin:`4px 0 0 0`},children:[`共 `,i.length,` 个项目 · 按行业分类管理`]})]})}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:12},children:[(0,$.jsx)(X,{icon:(0,$.jsx)(fH,{}),onClick:()=>r(`/records`),size:`large`,style:{background:`rgba(99, 102, 241, 0.1)`,border:`1px solid rgba(99, 102, 241, 0.2)`,color:`#6366f1`,fontWeight:600,borderRadius:10,height:42},children:`项目记录`}),(0,$.jsx)(X,{icon:(0,$.jsx)(rL,{}),onClick:()=>t(!0),size:`large`,style:{background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,color:`#fff`,fontWeight:600,borderRadius:10,height:42,boxShadow:`0 4px 16px rgba(99, 102, 241, 0.35)`},children:`新建项目`})]})]}),i.length===0?(0,$.jsx)(XS,{image:XS.PRESENTED_IMAGE_SIMPLE,description:`还没有项目,创建您的第一个视频项目`,style:{padding:`60px 0`},children:(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(rL,{}),onClick:()=>t(!0),size:`large`,children:`创建第一个项目`})}):(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},className:`stagger-children`,children:i.map((e,t)=>(0,$.jsxs)(`div`,{className:`project-card project-item animate-slideInCard`,onClick:()=>r(`/projects/${e.id}/generate`),style:{display:`flex`,alignItems:`center`,padding:`18px 22px`,borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,cursor:`pointer`,animationDelay:`${t*.06}s`},children:[(0,$.jsx)(`div`,{style:{width:50,height:50,borderRadius:14,flexShrink:0,background:`${u[e.industry]?.color||`#64748b`}12`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:24,marginRight:16,color:u[e.industry]?.color||`#64748b`},children:O7[u[e.industry]?.icon]||(0,$.jsx)(m2,{})}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:4,flexWrap:`wrap`},children:[(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:15,color:`#1a1a2e`},children:e.name}),(0,$.jsx)(XQ,{color:u[e.industry]?.color||`#64748b`,style:{borderRadius:6,margin:0},children:u[e.industry]?.label||e.industry})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,$.jsx)(aV,{style:{fontSize:12,color:`#94a3b8`}}),(0,$.jsxs)(`span`,{className:`date-display`,translate:`no`,style:{fontSize:12,color:`#94a3b8`},children:[`创建于 `,T7(e.createdAt)]})]})]}),(0,$.jsxs)(`div`,{className:`project-actions`,style:{display:`flex`,alignItems:`center`,gap:8,marginLeft:16},children:[(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(q6,{}),onClick:t=>{t.stopPropagation(),r(`/projects/${e.id}/generate`)},style:{background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`,borderRadius:10,fontWeight:600,height:36,boxShadow:`0 4px 12px rgba(99,102,241,0.25)`},children:`生成`}),(0,$.jsx)(vK,{title:`确定删除该项目?`,description:`项目下的生成记录将一并删除`,onConfirm:async t=>{t?.stopPropagation(),await s(e.id),Z.success(`项目已删除`)},onCancel:e=>e?.stopPropagation(),children:(0,$.jsx)(X,{danger:!0,icon:(0,$.jsx)(u$,{}),onClick:e=>e.stopPropagation(),style:{borderRadius:10,height:36,background:`rgba(239,68,68,0.06)`,border:`1px solid rgba(239,68,68,0.15)`,color:`#ef4444`}})}),(0,$.jsx)(Bg,{className:`mobile-hide`,style:{color:`#cbd5e1`,fontSize:12}})]})]},e.id))}),(0,$.jsx)(mK,{title:(0,$.jsxs)(sH,{children:[(0,$.jsx)(m2,{}),`新建项目`]}),open:e,onOk:async()=>{try{let e=await n.validateFields(),i=await o(e.name,e.industry);Z.success(`项目创建成功`),t(!1),n.resetFields(),r(`/projects/${i.id}/generate`)}catch{}},onCancel:()=>{t(!1),n.resetFields()},okText:`创建`,cancelText:`取消`,width:480,children:(0,$.jsxs)(tU,{form:n,layout:`vertical`,style:{marginTop:20},children:[(0,$.jsx)(tU.Item,{name:`name`,label:`项目名称`,rules:[{required:!0,message:`请输入项目名称`}],children:(0,$.jsx)(IW,{placeholder:`例如:618电商大促宣传片`,prefix:(0,$.jsx)(KX,{}),size:`large`})}),(0,$.jsx)(tU.Item,{name:`industry`,label:`所属行业`,rules:[{required:!0,message:`请选择行业`}],children:(0,$.jsx)(EC,{placeholder:`选择项目所属行业`,size:`large`,children:c.map((e,t)=>(0,$.jsx)(EC.Option,{value:e.key,children:(0,$.jsxs)(sH,{children:[O7[e.icon]||(0,$.jsx)(m2,{}),` `,e.label]})},e.key))})})]})})]})};async function k7(e){try{if(navigator.clipboard&&typeof navigator.clipboard.writeText==`function`)return await navigator.clipboard.writeText(e),!0;let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.left=`-9999px`,t.style.top=`0`,document.body.appendChild(t),t.focus(),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch{return!1}}var{Text:A7}=Q,soe={real_person:{title:`选择真人素材库`,empty:`暂无可选 Active 真人素材`,projectError:`加载真人素材项目失败`,assetError:`加载真人素材失败`,fallbackName:`真人素材`},aigc_virtual:{title:`选择虚拟素材库`,empty:`暂无可选 Active 虚拟素材`,projectError:`加载虚拟素材项目失败`,assetError:`加载虚拟素材失败`,fallbackName:`虚拟素材`}},j7=e=>e?e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`data:`)||e.startsWith(`blob:`)?e:`${`http://ceshi.apiforeign.minzhong.cn`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`:``,coe=e=>e.assetType===`Video`?j7(e.videoCoverUrl||e.previewUrl||e.displayUrl||e.providerUrl):j7(e.previewUrl||e.displayUrl||e.videoCoverUrl||e.providerUrl),loe=e=>{let t=Number(e||0);return!Number.isFinite(t)||t<=0?`-`:`${t.toFixed(t>=10?0:1)}s`},M7=({open:e,libraryType:t=`real_person`,selectedIds:n=[],maxCount:r=20,onClose:i,onSelect:a,maxImageCount:o,maxVideoCount:s,usedImageCount:c,usedVideoCount:l,usedVideoDuration:u,maxVideoDuration:d,accept:f})=>{let p=soe[t],[m,h]=(0,S.useState)([]),[g,_]=(0,S.useState)(),[v,y]=(0,S.useState)(``),[b,x]=(0,S.useState)(f===`image/*`?`Image`:void 0),[C,w]=(0,S.useState)([]),[T,E]=(0,S.useState)(new Map),[D,O]=(0,S.useState)(!1),[k,A]=(0,S.useState)(!1),j=(0,S.useMemo)(()=>new Set(T.keys()),[T]),M=async()=>{O(!0);try{let e=(await(t===`aigc_virtual`?g7:m7)({page:1,pageSize:100,status:`active`})).items||[];h(e),_(t=>t&&e.some(e=>e.id===t)?t:e[0]?.id)}catch(e){Z.error(e?.message||p.projectError)}finally{O(!1)}},N=async()=>{A(!0);try{w((await(t===`aigc_virtual`?zae:Nae)({projectId:g,keyword:v.trim()||void 0,assetType:b,page:1,pageSize:100})).items||[])}catch(e){Z.error(e?.message||p.assetError)}finally{A(!1)}};(0,S.useEffect)(()=>{e&&setTimeout(()=>{E(new Map),y(``),x(void 0),_(void 0),w([]),M()},0)},[e,t]),(0,S.useEffect)(()=>{g&&setTimeout(()=>{N()},0)},[g,b]);let P=e=>{if(n.includes(e.id)){Z.info(`该素材已添加`);return}if(f===`image/*`&&e.assetType===`Video`){Z.warning(`当前仅支持选择图片素材`);return}E(t=>{let n=new Map(t);return n.has(e.id)?(n.delete(e.id),n):n.size>=r?(Z.warning(`最多选择 ${r} 个参考素材`),t):(n.set(e.id,e),n)})},F=(0,S.useMemo)(()=>{let e=Array.from(T.values()).filter(e=>e.assetType===`Image`).length,t=Array.from(T.values()).filter(e=>e.assetType===`Video`).length,n=Array.from(T.values()).filter(e=>e.assetType===`Video`).reduce((e,t)=>e+(t.videoDuration||0),0),r=o!==void 0&&c!==void 0?o-c:1/0,i=s!==void 0&&l!==void 0?s-l:1/0,a=d!==void 0&&u!==void 0?d-u:1/0;return e>r||t>i||n>a},[T,o,c,s,l,d,u]);return(0,$.jsxs)(mK,{title:`${p.title}`,open:e,onCancel:i,width:920,destroyOnHidden:!0,footer:[(0,$.jsx)(X,{onClick:i,children:`取消`},`cancel`),(0,$.jsxs)(X,{type:`primary`,onClick:()=>{let e=Array.from(T.values()).filter(e=>!n.includes(e.id));if(!e.length){Z.warning(`请选择至少一个${t===`aigc_virtual`?`虚拟`:`真人`}素材`);return}a(e),i()},disabled:F,style:{background:F?`#94a3b8`:`#8b5cf6`,opacity:F?.6:1,cursor:F?`not-allowed`:`pointer`},children:[`添加选中素材(`,T.size,`)`]},`ok`)],children:[f!==`image/*`&&(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:20,marginBottom:16,padding:`12px 16px`,background:`#fafafa`,borderRadius:8},children:(()=>{let e=Array.from(T.values()).filter(e=>e.assetType===`Image`).length,t=Array.from(T.values()).filter(e=>e.assetType===`Video`).length,n=Array.from(T.values()).filter(e=>e.assetType===`Video`).reduce((e,t)=>e+(t.videoDuration||0),0),r=o!==void 0&&c!==void 0?o-c:1/0,i=s!==void 0&&l!==void 0?s-l:1/0,a=d!==void 0&&u!==void 0?d-u:1/0,f=e>r,p=t>i,m=n>a;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`span`,{style:{fontSize:13,color:f?`#ef4444`:`#64748b`,fontWeight:f?600:400},children:[`还可选取图片 `,e,`/`,o!==void 0&&c!==void 0?o-c:`-`,` 张`]}),(0,$.jsxs)(`span`,{style:{fontSize:13,color:p||m?`#ef4444`:`#64748b`,fontWeight:p||m?600:400},children:[`视频还可选取 `,t,`/`,s!==void 0&&l!==void 0?s-l:`-`,` 个(`,n.toFixed(1),`/`,d!==void 0&&u!==void 0?(d-u).toFixed(1):`-`,`秒)`]})]})})()}),(0,$.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`240px 1fr`,gap:16,height:500},children:[(0,$.jsxs)(`div`,{style:{border:`1px solid #eef0f4`,borderRadius:12,padding:12,background:`#fafafa`,overflowY:`auto`,height:`100%`},children:[(0,$.jsxs)(sH,{style:{width:`100%`,justifyContent:`space-between`,marginBottom:12},children:[(0,$.jsx)(A7,{strong:!0,children:`项目组`}),(0,$.jsx)(X,{size:`small`,icon:(0,$.jsx)(wq,{}),onClick:M,loading:D})]}),(0,$.jsx)(UG,{spinning:D,children:m.length===0?(0,$.jsx)(XS,{image:XS.PRESENTED_IMAGE_SIMPLE,description:`暂无项目组`}):(0,$.jsx)(`div`,{children:m.map(e=>(0,$.jsx)(`div`,{onClick:()=>_(e.id),style:{cursor:`pointer`,padding:`10px 12px`,borderRadius:10,marginBottom:6,border:g===e.id?`1px solid #8b5cf6`:`1px solid transparent`,background:g===e.id?`#f5f3ff`:`#fff`},children:(0,$.jsxs)(`div`,{style:{width:`100%`},children:[(0,$.jsx)(A7,{strong:!0,ellipsis:!0,style:{display:`block`},children:e.name}),(0,$.jsx)(A7,{type:`secondary`,style:{fontSize:12},children:typeof e.activeImageAssetCount==`number`||typeof e.activeVideoAssetCount==`number`?` 图 ${e.activeImageAssetCount||0} / 视 ${e.activeVideoAssetCount||0}`:``})]})},e.id))})})]}),(0,$.jsxs)(`div`,{style:{overflowY:`auto`,height:`100%`},children:[(0,$.jsxs)(sH,{style:{width:`100%`,marginBottom:12},children:[(0,$.jsx)(IW,{allowClear:!0,prefix:(0,$.jsx)(xC,{}),placeholder:`搜索素材名称`,value:v,onChange:e=>y(e.target.value),onPressEnter:N}),(0,$.jsx)(EC,{allowClear:f!==`image/*`,placeholder:`素材类型`,value:b,onChange:x,style:{width:116},options:f===`image/*`?[{value:`Image`,label:`图片`}]:[{value:`Image`,label:`图片`},{value:`Video`,label:`视频`}]}),(0,$.jsx)(X,{icon:(0,$.jsx)(wq,{}),onClick:N,loading:k,children:`刷新`})]}),(0,$.jsx)(UG,{spinning:k,children:C.length===0?(0,$.jsx)(XS,{image:XS.PRESENTED_IMAGE_SIMPLE,description:p.empty,style:{marginTop:120}}):(0,$.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(140px, 1fr))`,gap:12,maxHeight:420,overflowY:`auto`,paddingRight:4},children:C.filter(e=>f!==`image/*`||e.assetType===`Image`).map(e=>{let t=j.has(e.id)||n.includes(e.id),r=n.includes(e.id),i=coe(e),a=e.assetType===`Video`;return(0,$.jsxs)(`div`,{onClick:()=>P(e),style:{cursor:r?`not-allowed`:`pointer`,border:t?`2px solid #8b5cf6`:`1px solid #edf0f5`,borderRadius:12,overflow:`hidden`,background:`#fff`,boxShadow:t?`0 8px 20px rgba(139,92,246,0.18)`:`0 4px 12px rgba(15,23,42,0.04)`,opacity:r?.62:1,position:`relative`},children:[(0,$.jsxs)(`div`,{style:{aspectRatio:`1 / 1`,background:`#f8fafc`,display:`flex`,alignItems:`center`,justifyContent:`center`,position:`relative`},children:[i?a?(0,$.jsx)(`video`,{src:i,muted:!0,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(`img`,{src:i,alt:e.name||p.fallbackName,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):a?(0,$.jsx)(t5,{style:{fontSize:32,color:`#94a3b8`}}):(0,$.jsx)(R6,{style:{fontSize:32,color:`#94a3b8`}}),a&&(0,$.jsx)(`div`,{style:{position:`absolute`,left:8,bottom:8,padding:`2px 6px`,borderRadius:8,background:`rgba(15,23,42,0.72)`,color:`#fff`,fontSize:12},children:loe(e.videoDuration)})]}),t&&(0,$.jsx)(`div`,{style:{position:`absolute`,top:8,right:8,width:24,height:24,borderRadius:12,background:`#8b5cf6`,color:`#fff`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(hC,{})}),(0,$.jsxs)(`div`,{style:{padding:10},children:[(0,$.jsx)(A7,{strong:!0,ellipsis:!0,style:{display:`block`},children:e.name||`未命名素材`}),(0,$.jsxs)(sH,{wrap:!0,size:4,style:{marginTop:6},children:[(0,$.jsx)(XQ,{color:a?`blue`:`default`,children:a?`视频`:`图片`}),(0,$.jsx)(XQ,{children:e.projectName})]})]})]},e.id)})})})]})]})]})},N7=({src:e,size:t=`normal`})=>{let n=(0,S.useRef)(null),[r,i]=(0,S.useState)(!1),[a,o]=(0,S.useState)(0),[s,c]=(0,S.useState)(0),[l,u]=(0,S.useState)(1),[d,f]=(0,S.useState)(!1),p=e=>`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,`0`)}`,m=(0,S.useCallback)(()=>{n.current&&(r?n.current.pause():n.current.play(),i(!r))},[r]),h=(0,S.useCallback)(()=>{n.current&&o(n.current.currentTime)},[]),g=(0,S.useCallback)(()=>{n.current&&c(n.current.duration)},[]),_=(0,S.useCallback)(()=>{i(!1),o(0)},[]),v=(0,S.useCallback)(e=>{if(!n.current||s===0)return;let t=e.currentTarget.getBoundingClientRect(),r=(e.clientX-t.left)/t.width*s;n.current.currentTime=r,o(r)},[s]),y=(0,S.useCallback)(e=>{if(!n.current)return;let t=parseFloat(e.target.value);n.current.volume=t,u(t),f(t===0)},[]),b=(0,S.useCallback)(()=>{n.current&&(d?(n.current.volume=l||.5,f(!1)):(n.current.volume=0,f(!0)))},[d,l]);(0,S.useEffect)(()=>{let e=n.current;if(e)return e.addEventListener(`timeupdate`,h),e.addEventListener(`loadedmetadata`,g),e.addEventListener(`ended`,_),()=>{e.removeEventListener(`timeupdate`,h),e.removeEventListener(`loadedmetadata`,g),e.removeEventListener(`ended`,_)}},[h,g,_]);let x=s>0?a/s*100:0;return(0,$.jsxs)(`div`,{style:{width:`100%`,height:t===`small`?130:112,background:`#f1f5f9`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,padding:t===`small`?`16px 16px`:`12px 16px`},children:[(0,$.jsx)(`audio`,{ref:n,src:e}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16,width:`100%`},children:[(0,$.jsx)(`button`,{onClick:m,style:{width:48,height:48,borderRadius:`50%`,background:`linear-gradient(135deg, #8b5cf6, #a78bfa)`,border:`none`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,flexShrink:0},children:r?(0,$.jsx)(E6,{style:{fontSize:24,color:`#fff`}}):(0,$.jsx)(q6,{style:{fontSize:24,color:`#fff`,marginLeft:2}})}),(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,gap:8},children:[(0,$.jsxs)(`div`,{onClick:v,style:{height:5,background:`#e2e8f0`,borderRadius:10,cursor:`pointer`,overflow:`visible`,position:`relative`},children:[(0,$.jsx)(`div`,{style:{height:`100%`,width:`${x}%`,background:`linear-gradient(90deg, #8b5cf6, #a78bfa)`,borderRadius:10,transition:`width 0.1s linear`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,left:`${x}%`,top:`50%`,transform:`translate(-50%, -50%)`,width:t===`small`?12:14,height:t===`small`?12:14,background:`#fff`,borderRadius:`50%`,boxShadow:`0 2px 6px rgba(0,0,0,0.15)`,opacity:+(x>0),transition:`opacity 0.2s`}})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{fontSize:t===`small`?11:12,color:`#64748b`},children:p(a)}),(0,$.jsx)(`span`,{style:{fontSize:t===`small`?11:12,color:`#64748b`},children:p(s)})]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,flexShrink:0},children:[(0,$.jsx)(`button`,{onClick:b,style:{border:`none`,background:`transparent`,cursor:`pointer`,padding:0},children:d?(0,$.jsx)(m4,{style:{fontSize:t===`small`?14:16,color:`#94a3b8`}}):(0,$.jsx)(I8,{style:{fontSize:t===`small`?14:16,color:`#94a3b8`}})}),(0,$.jsx)(`input`,{type:`range`,min:`0`,max:`1`,step:`0.1`,value:d?0:l,onChange:y,style:{width:t===`small`?40:50,height:4,borderRadius:2,appearance:`none`,background:`#e2e8f0`,cursor:`pointer`}})]})]})]})},{Text:P7}=Q,F7=e=>{if(!e)return``;if(/^data:|blob:/i.test(e))return e;if(/^https?:\/\//i.test(e)){let t=new URL(e);return t.pathname.startsWith(`/uploads`)?t.pathname+t.search:e}return`${`http://ceshi.apiforeign.minzhong.cn`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`},I7=(e,t)=>{if(e<300||e>6e3)return`图片宽度需在 300~6000px 之间,当前为 ${e}px`;if(t<300||t>6e3)return`图片高度需在 300~6000px 之间,当前为 ${t}px`;let n=e/t;return n<.4||n>2.5?`图片宽高比需在 0.4~2.5 之间,当前为 ${n.toFixed(2)}`:null},L7=(e,t)=>{if(e<300||e>6e3)return`视频宽度需在 300~6000px 之间,当前为 ${e}px`;if(t<300||t>6e3)return`视频高度需在 300~6000px 之间,当前为 ${t}px`;let n=e/t;if(n<.4||n>2.5)return`视频宽高比需在 0.4~2.5 之间,当前为 ${n.toFixed(2)}`;let r=e*t;return r<409600?`视频总像素数过小(${e}×${t}=${r}),需 ≥ 640×640=409600`:r>8295044?`视频总像素数过大(${e}×${t}=${r}),需 ≤ 3326×2494=8295044`:null},uoe=e=>{let t=e,n=t.width||t.videoWidth||t.imageWidth||0,r=t.height||t.videoHeight||t.imageHeight||0;if(e.resourceType===`image`){if(n>0&&r>0)return I7(n,r)}else if(e.resourceType===`video`&&n>0&&r>0)return L7(n,r);return null},doe=e=>new Promise(t=>{let n=new Image;n.onload=()=>{t({width:n.width,height:n.height})},n.onerror=()=>{t({width:0,height:0})},n.src=e}),foe=e=>e===`video`?(0,$.jsx)(t5,{}):e===`audio`?(0,$.jsx)(k2,{}):(0,$.jsx)(R6,{}),poe=e=>e===`video`?`视频`:e===`audio`?`音频`:`图片`,moe=({open:e,onClose:t,onSelect:n,allowedTypes:r,selectedIds:i=[],title:a=`选择历史上传素材`,maxImageCount:o,maxVideoCount:s,usedImageCount:c,usedVideoCount:l,maxVideoDuration:u,usedVideoDuration:d,maxAudioCount:f,usedAudioCount:p,maxAudioDuration:m,usedAudioDuration:h,hideLimitHint:g})=>{let[_,v]=(0,S.useState)(``),[y,b]=(0,S.useState)(``),[x,C]=(0,S.useState)(1),[w,T]=(0,S.useState)(10),[E,D]=(0,S.useState)(1),[O,k]=(0,S.useState)(10),[A,j]=(0,S.useState)(!1),[M,N]=(0,S.useState)(!1),[P,F]=(0,S.useState)([]),[I,L]=(0,S.useState)(0),[R,z]=(0,S.useState)(``),[B,V]=(0,S.useState)([]),[H,U]=(0,S.useState)(0),[W,ee]=(0,S.useState)(new Map),te=(0,S.useMemo)(()=>new Set(i),[i]),G=(0,S.useMemo)(()=>new Set(r||[`image`,`video`,`audio`]),[JSON.stringify(r)]),ne=(0,S.useMemo)(()=>Array.from(W.values()).filter(e=>e.resourceType===`image`).length,[W]),re=(0,S.useMemo)(()=>Array.from(W.values()).filter(e=>e.resourceType===`video`).length,[W]),ie=(0,S.useMemo)(()=>Array.from(W.values()).filter(e=>e.resourceType===`video`).reduce((e,t)=>e+(t.durationSeconds||0),0),[W]),ae=(0,S.useMemo)(()=>Array.from(W.values()).filter(e=>e.resourceType===`audio`).length,[W]),oe=(0,S.useMemo)(()=>Array.from(W.values()).filter(e=>e.resourceType===`audio`).reduce((e,t)=>e+(t.durationSeconds||0),0),[W]),K=(0,S.useMemo)(()=>o!==void 0&&c!==void 0?o-c:1/0,[o,c]),q=(0,S.useMemo)(()=>s!==void 0&&l!==void 0?s-l:1/0,[s,l]),se=(0,S.useMemo)(()=>u!==void 0&&d!==void 0?u-d:1/0,[u,d]),ce=(0,S.useMemo)(()=>f!==void 0&&p!==void 0?f-p:1/0,[f,p]),le=(0,S.useMemo)(()=>m!==void 0&&h!==void 0?m-h:1/0,[m,h]),ue=(0,S.useMemo)(()=>ne>K,[ne,K]),de=(0,S.useMemo)(()=>re>q,[re,q]),fe=(0,S.useMemo)(()=>ie>se,[ie,se]),pe=(0,S.useMemo)(()=>ae>ce,[ae,ce]),me=(0,S.useMemo)(()=>oe>le,[oe,le]),he=(0,S.useCallback)(async()=>{if(e){N(!0);try{let e=await d7({resourceType:_||void 0,keyword:y||void 0,page:x,pageSize:w,scene:`picker`});F(x===1?e.groups||[]:t=>[...t,...e.groups||[]]),L(e.totalDays||0)}catch(e){Z.error(e?.message||`加载历史上传素材失败`),x===1&&F([]),L(0)}finally{N(!1)}}},[G,y,e,x,w,_]),ge=(0,S.useCallback)(async e=>{j(!0);try{let t=await f7(e,{resourceType:_||void 0,keyword:y||void 0,page:E,pageSize:8,scene:`picker`});V((t.items||[]).filter(e=>G.has(e.resourceType))),U(t.total||0)}catch(e){Z.error(e?.message||`加载历史上传素材失败`),V([]),U(0)}finally{j(!1)}},[G,y,E,O,_]);(0,S.useEffect)(()=>{e&&he()},[e,x,he]),(0,S.useEffect)(()=>{R&&D(1)},[R]),(0,S.useEffect)(()=>{R&&ge(R)},[R,E,ge]),(0,S.useEffect)(()=>{e&&ee(new Map)},[e]);let _e=async e=>{if(te.has(e.id)){Z.warning(`该素材已经在参考内容中`);return}let t=e,n=t.width||t.videoWidth||t.imageWidth||0,r=t.height||t.videoHeight||t.imageHeight||0;if(e.resourceType===`image`){if(n<=0||r<=0){let t=F7(e.previewUrl||e.displayUrl||e.resourceUrl);if(t){let e=await doe(t);n=e.width,r=e.height}}if(n>0&&r>0){let t=I7(n,r);if(t){Z.error(`${e.fileName||`图片`}:${t}`);return}}}else if(e.resourceType===`video`&&n>0&&r>0){let t=L7(n,r);if(t){Z.error(`${e.fileName||`视频`}:${t}`);return}}ee(t=>{let n=new Map(t);return n.has(e.id)?n.delete(e.id):n.set(e.id,e),n})},ve=()=>{let e=Array.from(W.values());if(e.length===0){Z.warning(`请先选择历史素材`);return}n(e),ee(new Map),t()},ye=(0,S.useMemo)(()=>[{label:`全部`,value:``},{label:`图片`,value:`image`},{label:`视频`,value:`video`},{label:`音频`,value:`audio`}].filter(e=>!e.value||G.has(e.value)),[G]);return(0,$.jsxs)(mK,{title:a,open:e,onCancel:t,width:1e3,centered:!0,destroyOnHidden:!0,footer:[(0,$.jsx)(X,{onClick:t,children:`取消`},`cancel`),(0,$.jsxs)(X,{type:`primary`,onClick:ve,style:{background:`#8b5cf6`},disabled:ue||de||fe||pe||me,children:[`应用选择 (`,W.size,`)`]},`ok`)],children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsxs)(sH,{wrap:!0,children:[(0,$.jsx)(EC,{value:_,options:ye,style:{width:120},onChange:e=>{v(e),C(1)}}),(0,$.jsx)(IW,{allowClear:!0,value:y,prefix:(0,$.jsx)(xC,{}),placeholder:`搜索文件名`,style:{width:220},onChange:e=>b(e.target.value),onPressEnter:()=>{C(1),he()}}),(0,$.jsx)(X,{icon:(0,$.jsx)(wq,{}),onClick:he,children:`刷新`})]}),!g&&(0,$.jsxs)(`div`,{style:{display:`flex`,gap:16,marginTop:12,flexWrap:`wrap`},children:[(0,$.jsxs)(`span`,{style:{fontSize:13,color:ue?`#ef4444`:`#64748b`,fontWeight:ue?600:400},children:[`还可选取图片 `,ne,`/`,o!==void 0&&c!==void 0?o-c:`-`,` 张`]}),(0,$.jsxs)(`span`,{style:{fontSize:13,color:de||fe?`#ef4444`:`#64748b`,fontWeight:de||fe?600:400},children:[`视频还可选取 `,re,`/`,s!==void 0&&l!==void 0?s-l:`-`,` 个(`,ie.toFixed(1),`/`,u!==void 0&&d!==void 0?(u-d).toFixed(1):`-`,`秒)`]}),f!==void 0&&(0,$.jsxs)(`span`,{style:{fontSize:13,color:pe||me?`#ef4444`:`#64748b`,fontWeight:pe||me?600:400},children:[`音频还可选取 `,ae,`/`,f!==void 0&&p!==void 0?f-p:`-`,` 个(`,oe.toFixed(1),`/`,m!==void 0&&h!==void 0?(m-h).toFixed(1):`-`,`秒)`]})]})]}),(0,$.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`240px 1fr`,gap:16,height:500},children:[(0,$.jsxs)(`div`,{style:{border:`1px solid #eef0f4`,borderRadius:12,padding:12,background:`#fafafa`,overflowY:`auto`},children:[(0,$.jsx)(P7,{strong:!0,style:{fontSize:14},children:`日期列表`}),(0,$.jsx)(UG,{spinning:M,children:P.length===0?(0,$.jsx)(XS,{image:XS.PRESENTED_IMAGE_SIMPLE,description:`暂无日期`,style:{padding:`40px 0`}}):(0,$.jsxs)(`div`,{style:{marginTop:12},children:[P.map(e=>(0,$.jsxs)(`div`,{onClick:()=>z(e.generatedDate),style:{padding:`10px 12px`,borderRadius:10,marginBottom:6,cursor:`pointer`,border:R===e.generatedDate?`1px solid #8b5cf6`:`1px solid transparent`,background:R===e.generatedDate?`#f5f3ff`:`#fff`},children:[(0,$.jsx)(`div`,{style:{fontSize:13,fontWeight:500,color:`#334155`},children:e.generatedDate}),(0,$.jsxs)(`div`,{style:{fontSize:12,color:`#94a3b8`,marginTop:4},children:[`共 `,e.total,` 个素材`]})]},e.generatedDate)),I>P.length&&(0,$.jsx)(`div`,{style:{marginTop:12,textAlign:`center`},children:(0,$.jsx)(X,{size:`small`,onClick:()=>C(x+1),children:`加载更多`})})]})})]}),(0,$.jsx)(`div`,{style:{border:`1px solid #eef0f4`,borderRadius:12,padding:12,overflowY:`auto`},children:(0,$.jsx)(UG,{spinning:A,children:R?B.length===0?(0,$.jsx)(XS,{description:`该日期暂无可复用的历史上传素材`,style:{padding:`48px 0`}}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(150px, 1fr))`,gap:14},children:B.map(e=>{let t=W.has(e.id),n=te.has(e.id),r=uoe(e),i=n||!!r,a=F7(e.previewUrl||e.displayUrl||e.resourceUrl);return(0,$.jsxs)(`div`,{onClick:()=>!i&&_e(e),style:{position:`relative`,borderRadius:14,border:t?`2px solid #8b5cf6`:`1px solid #e2e8f0`,background:i?`#f8fafc`:`#fff`,opacity:i?.55:1,cursor:i?`not-allowed`:`pointer`,overflow:`hidden`,boxShadow:t?`0 10px 24px rgba(139, 92, 246, 0.18)`:`0 6px 18px rgba(15,23,42,0.06)`},title:r||void 0,children:[(0,$.jsx)(`div`,{style:{background:`#f1f5f9`},children:e.resourceType===`image`?(0,$.jsx)(`img`,{src:a,alt:e.fileName||e.id,style:{width:`100%`,height:130,objectFit:`cover`}}):e.resourceType===`video`?(0,$.jsx)(`video`,{src:a,muted:!0,style:{width:`100%`,height:130,objectFit:`cover`}}):(0,$.jsx)(N7,{src:a,size:`small`})}),(0,$.jsxs)(`div`,{style:{padding:10},children:[(0,$.jsxs)(sH,{size:6,style:{marginBottom:6},children:[(0,$.jsx)(XQ,{color:`purple`,icon:foe(e.resourceType),style:{margin:0},children:poe(e.resourceType)}),e.durationSeconds?(0,$.jsxs)(XQ,{style:{margin:0},children:[Number(e.durationSeconds).toFixed(1),`s`]}):null,r&&(0,$.jsx)(XQ,{color:`red`,style:{margin:0},children:`尺寸不符`})]}),(0,$.jsx)(P7,{ellipsis:!0,style:{display:`block`,fontSize:13,color:`#334155`},title:e.fileName||e.id,children:e.fileName||e.id}),(0,$.jsx)(P7,{type:`secondary`,style:{fontSize:12},children:e.moduleLabel||`普通上传`})]}),t&&(0,$.jsx)(`div`,{style:{position:`absolute`,top:8,right:8,width:24,height:24,borderRadius:12,background:`#8b5cf6`,color:`#fff`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(hC,{})}),n&&(0,$.jsx)(`div`,{style:{position:`absolute`,top:8,right:8},children:(0,$.jsx)(XQ,{children:`已选`})}),r&&(0,$.jsx)(`div`,{style:{position:`absolute`,bottom:0,left:0,right:0,background:`rgba(239, 68, 68, 0.9)`,color:`#fff`,padding:`4px 8px`,fontSize:11,textAlign:`center`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:r})]},e.id)})}),(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,marginTop:16,paddingBottom:8},children:(0,$.jsx)(SG,{current:E,pageSize:O,total:H,showSizeChanger:!0,pageSizeOptions:[10,20,50,100],onChange:(e,t)=>{D(e),k(t)}})})]}):(0,$.jsx)(XS,{image:XS.PRESENTED_IMAGE_SIMPLE,description:`请选择日期`,style:{padding:`80px 0`}})})})]})]})},R7=({children:e,accept:t=`image/*,video/*`,multiple:n=!0,onLocalSelect:r,onHistorySelect:i,onPortraitSelect:a,onPortraitLibrarySelect:o,uploading:s,tooltipTitle:c,maxImageCount:l,maxVideoCount:u,usedImageCount:d,usedVideoCount:f,usedVideoDuration:p,maxVideoDuration:m,maxAudioCount:h,usedAudioCount:g,maxAudioDuration:_,usedAudioDuration:v,hideLimitHint:y,mediaType:b})=>{let x=(0,S.useRef)(null),[C,w]=(0,S.useState)(!1),[T,E]=(0,S.useState)(`real_person`),[D,O]=(0,S.useState)(!1),[k,A]=(0,S.useState)(!1),[j,M]=(0,S.useState)(!1),N=()=>{A(!1),x.current?.click()},P=e=>{let t=e.target.files;t&&r&&r(Array.from(t)),x.current&&(x.current.value=``)},F=e=>{if(A(!1),a){E(e),w(!0);return}if(o){o(e);return}E(e),w(!0)},I=(0,$.jsxs)(`div`,{style:{padding:`4px 0`,minWidth:180},children:[(0,$.jsxs)(`div`,{onClick:()=>{N()},style:{display:`flex`,alignItems:`center`,gap:12,padding:`8px 16px`,cursor:`pointer`,transition:`background 0.15s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`#f1f5f9`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:[(0,$.jsx)(KX,{style:{fontSize:14,color:`#64748b`}}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#334155`},children:`本地上传`})]}),(0,$.jsxs)(`div`,{onClick:()=>{A(!1),O(!0)},style:{display:`flex`,alignItems:`center`,gap:12,padding:`8px 16px`,cursor:`pointer`,transition:`background 0.15s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`#f1f5f9`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:[(0,$.jsx)(q4,{style:{fontSize:14,color:`#64748b`}}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#334155`},children:`从资产中选择`})]}),b!==`image`&&(0,$.jsxs)(`div`,{onClick:()=>F(`real_person`),style:{display:`flex`,alignItems:`center`,gap:12,padding:`8px 16px`,cursor:`pointer`,transition:`background 0.15s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`#f1f5f9`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:[(0,$.jsx)($8,{style:{fontSize:14,color:`#64748b`}}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#334155`},children:`真人素材库`})]}),b!==`image`&&(0,$.jsxs)(`div`,{onClick:()=>F(`aigc_virtual`),style:{display:`flex`,alignItems:`center`,gap:12,padding:`8px 16px`,cursor:`pointer`,transition:`background 0.15s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`#f1f5f9`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:[(0,$.jsx)(H8,{style:{fontSize:14,color:`#64748b`}}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#334155`},children:`虚拟素材库`})]})]});return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`input`,{ref:x,type:`file`,accept:t,multiple:n,onChange:P,style:{display:`none`}}),c?(0,$.jsx)(gw,{title:c,children:(0,$.jsx)(ww,{content:I,open:k,onOpenChange:A,trigger:`click`,placement:`bottomLeft`,children:(0,$.jsx)(`div`,{style:{cursor:s?`not-allowed`:`pointer`},children:e})})}):(0,$.jsx)(ww,{content:I,open:k,onOpenChange:A,trigger:`click`,placement:`bottomLeft`,children:(0,$.jsx)(`div`,{style:{cursor:s?`not-allowed`:`pointer`},children:e})}),(0,$.jsx)(moe,{open:D,onClose:()=>O(!1),onSelect:e=>{i?.(e),O(!1)},allowedTypes:t.includes(`audio`)?[`image`,`video`,`audio`]:t.includes(`video`)?[`image`,`video`]:[`image`],maxImageCount:l,maxVideoCount:u,usedImageCount:d,usedVideoCount:f,maxVideoDuration:m,usedVideoDuration:p,maxAudioCount:h,usedAudioCount:g,maxAudioDuration:_,usedAudioDuration:v,hideLimitHint:y}),(0,$.jsx)(M7,{open:C,libraryType:T,onClose:()=>w(!1),onSelect:e=>{a?.(e),w(!1)},accept:t,maxCount:t===`image/*`&&!n?1:void 0,maxImageCount:l,maxVideoCount:u,usedImageCount:d,usedVideoCount:f,usedVideoDuration:p,maxVideoDuration:m})]})};function hoe(){if(typeof crypto<`u`&&typeof crypto.randomUUID==`function`)return crypto.randomUUID();if(typeof crypto<`u`&&typeof crypto.getRandomValues==`function`){let e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``);return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}return`${Date.now().toString(16).padStart(12,`0`)}-${Math.random().toString(16).slice(2,10).padStart(8,`0`)}-4xxx-yxxx-${Math.random().toString(16).slice(2,12)}`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}var z7=({src:e,width:t=48,height:n=48})=>{let[r,i]=(0,S.useState)(null),[a,o]=(0,S.useState)(null);return(0,S.useEffect)(()=>{let r=document.createElement(`video`);r.muted=!0,r.preload=`metadata`,r.crossOrigin=`anonymous`;let a=()=>{o(r.duration),r.currentTime=Math.min(1,r.duration*.1)},s=()=>{try{let e=document.createElement(`canvas`);e.width=t*2,e.height=n*2;let a=e.getContext(`2d`);a&&(a.drawImage(r,0,0,e.width,e.height),i(e.toDataURL(`image/jpeg`,.7)))}catch{}};return r.addEventListener(`loadedmetadata`,a),r.addEventListener(`seeked`,s),r.src=e,()=>{r.removeEventListener(`loadedmetadata`,a),r.removeEventListener(`seeked`,s)}},[e,t,n]),(0,$.jsxs)(`div`,{style:{width:`100%`,height:`100%`,position:`relative`,background:`#1a1a2e`},children:[r?(0,$.jsx)(`img`,{src:r,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(q6,{style:{color:`#fff`,fontSize:18}})}),a!=null&&(0,$.jsx)(`span`,{style:{position:`absolute`,bottom:2,right:2,fontSize:9,color:`#fff`,background:`rgba(0,0,0,0.6)`,borderRadius:4,padding:`1px 4px`,lineHeight:1.3},children:(e=>`${Math.round(e)}s`)(a)})]})},goe=()=>{let{projectId:e}=$e(),t=Ye(),[n]=tU.useForm(),{projects:r,records:i,fetchProjects:a,fetchRecords:o,optimizePrompt:s,generateVideo:c}=C7(),l=i.items,{user:u}=_7(),[d,f]=(0,S.useState)(!1),[p,m]=(0,S.useState)(!1),[h,g]=(0,S.useState)(null),[_,v]=(0,S.useState)(``),[y,b]=(0,S.useState)(!1),[x,C]=(0,S.useState)({}),[w,T]=(0,S.useState)({}),[E,D]=(0,S.useState)({}),[O,k]=(0,S.useState)({}),[A,j]=(0,S.useState)({}),M=(0,S.useRef)(null),N=(0,S.useCallback)(e=>{if(!e)return 0;let t=new Date(e).getTime(),n=(Date.now()-t)/1e3;return n>=180?99:Math.min(99,n*.6)},[]);(0,S.useEffect)(()=>{let e=Object.entries(w).filter(([,e])=>e===`generating`).map(([e])=>e);if(e.length===0){M.current&&=(clearInterval(M.current),null);return}let t=()=>{e.forEach(e=>{let t=C7.getState().records.items.find(t=>t.id===e);if(t?.createdAt){let n=N(t.createdAt);D(t=>({...t,[e]:n})),k(t=>({...t,[e]:n}))}})};return t(),M.current=window.setInterval(t,1e3),()=>{M.current&&=(clearInterval(M.current),null)}},[w,N]),(0,S.useEffect)(()=>{Object.entries(w).forEach(([e,t])=>{if(t===`done`&&!A[e]){j(t=>({...t,[e]:!0}));let t=O[e]||0,n=Date.now(),r=()=>{let i=Date.now()-n,a=Math.min(i/800,1),o=1-(1-a)**3,s=t+(100-t)*o;k(t=>({...t,[e]:s})),a<1&&requestAnimationFrame(r)};requestAnimationFrame(r)}})},[w]),(0,S.useEffect)(()=>{Object.entries(w).forEach(([e,t])=>{if(t===`generating`){let t=C7.getState().records.items.find(t=>t.id===e);if(t?.createdAt){let n=N(t.createdAt);D(t=>({...t,[e]:n})),k(t=>({...t,[e]:n}))}}})},[h]);let[P,F]=(0,S.useState)({}),[I,L]=(0,S.useState)(null),[R,z]=(0,S.useState)(null),[B,V]=(0,S.useState)([]),[H,U]=(0,S.useState)(!1),[W,ee]=(0,S.useState)(``),[te,G]=(0,S.useState)(!1),[ne,re]=(0,S.useState)(``),ie=(0,S.useRef)(null),[ae,oe]=(0,S.useState)({}),[K,q]=(0,S.useState)({}),[se,ce]=(0,S.useState)({}),[le,ue]=(0,S.useState)(null),[de,fe]=(0,S.useState)({}),[pe,me]=(0,S.useState)(null),[he,ge]=(0,S.useState)(5),[_e,ve]=(0,S.useState)(`16:9`),[ye,be]=(0,S.useState)(`720p`),[xe,Se]=(0,S.useState)(null),[Ce,we]=(0,S.useState)({ratios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:[`720p`,`1080p`],durations:[5,8,10,12,15]}),[Te,Ee]=(0,S.useState)(0),[De,Oe]=(0,S.useState)(0),[ke,Ae]=(0,S.useState)(`video`),[je,Me]=(0,S.useState)(`1:1`),[Ne,Pe]=(0,S.useState)(`2K`),[Fe,Ie]=(0,S.useState)(2048),[Le,Re]=(0,S.useState)(2048),[ze,Be]=(0,S.useState)(!1),[Ve,He]=(0,S.useState)([]),[Ue,We]=(0,S.useState)([]),Ge=(e,t)=>{if(e<300||e>6e3)return`图片宽度需在 300~6000px 之间,当前为 ${e}px`;if(t<300||t>6e3)return`图片高度需在 300~6000px 之间,当前为 ${t}px`;let n=e/t;return n<.4||n>2.5?`图片宽高比需在 0.4~2.5 之间,当前为 ${n.toFixed(2)}`:null},Ke=(e,t)=>{if(e<300||e>6e3)return`视频宽度需在 300~6000px 之间,当前为 ${e}px`;if(t<300||t>6e3)return`视频高度需在 300~6000px 之间,当前为 ${t}px`;let n=e/t;if(n<.4||n>2.5)return`视频宽高比需在 0.4~2.5 之间,当前为 ${n.toFixed(2)}`;let r=e*t;return r<409600?`视频总像素数过小(${e}×${t}=${r}),需 ≥ 640×640=409600`:r>8295044?`视频总像素数过大(${e}×${t}=${r}),需 ≤ 3326×2494=8295044`:null},qe=async e=>{let t=e.type.startsWith(`image/`),n=e.type.startsWith(`video/`);if(!t&&!n)return Z.error(`仅支持图片或视频文件`),!1;let r=n?100:10;if(e.size/1024/1024>r)return Z.error(`${n?`视频`:`图片`}大小不能超过${r}MB`),!1;let i=B.filter(e=>e.type===`image`).length,a=B.filter(e=>e.type===`video`).length,o=B.filter(e=>e.type===`video`).reduce((e,t)=>e+(t.duration||0),0);if(t&&i>=5)return Z.error(`最多上传5张图片`),!1;if(n&&a>=2)return Z.error(`最多上传2个视频`),!1;let s=0;if(n){let t=await new Promise(t=>{let n=document.createElement(`video`);n.preload=`metadata`,n.onloadedmetadata=()=>{t({duration:n.duration||0,width:n.videoWidth||0,height:n.videoHeight||0}),n.remove()},n.onerror=()=>{t({duration:0,width:0,height:0}),n.remove()},n.src=URL.createObjectURL(e)});if(s=t.duration,t.width>0&&t.height>0){let e=Ke(t.width,t.height);if(e)return Z.error(`${e}`),!1}if(o+s>15)return Z.error(`视频总时长不能超过15秒`),!1}else{let t=await new Promise(t=>{let n=document.createElement(`img`);n.onload=()=>{t({width:n.width,height:n.height}),URL.revokeObjectURL(n.src)},n.onerror=()=>{t({width:0,height:0}),URL.revokeObjectURL(n.src)},n.src=URL.createObjectURL(e)});if(t.width>0&&t.height>0){let e=Ge(t.width,t.height);if(e)return Z.error(`${e}`),!1}}U(!0);try{let r;r=t?await E5(e):await D5(e,s);let o=t?`图片`:`视频`,c=t?i+1:a+1;V(e=>[...e,{url:r.url,type:t?`image`:`video`,name:`${o}${c}`,duration:n?s:void 0}]),Z.success(`${o}上传成功`)}catch{Z.error(`上传失败`)}finally{U(!1)}return!1};(0,S.useEffect)(()=>{if(Vie().then(e=>{He(e.video),We(e.image)}),!ze)return;let e=e=>{let t=e.target;!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&Be(!1)};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[ze]);let Je=(e,t)=>{for(let n=0;n{let t=e===`2k`?`2048`:e===`4k`?`4096`:e;for(let e=0;e{st(e);let t=ut[Ne]?.[e];if(t){let[e,n]=t.split(/x/i).map(Number);Ie(e),Re(n)}},Qe=e=>{lt(e);let t=Object.keys(ut[e]||{});tt(t.map(e=>({value:e,label:e})));let n=t.includes(je)?je:t[0]||`1:1`;n!==je&&Me(n);let r=ut[e]?.[n];if(r){let[e,t]=r.split(/x/i).map(Number);Ie(e),Re(t)}},[et,tt]=(0,S.useState)([]),[nt,rt]=(0,S.useState)([]),[it,at]=(0,S.useState)([]),[ot,st]=(0,S.useState)(0),[ct,lt]=(0,S.useState)(0),[ut,dt]=(0,S.useState)({});(0,S.useEffect)(()=>{it[ct]&&it[ct][ot]!==void 0&&(Ie(it[ct][ot].substring(0,4)),Re(it[ct][ot].substring(5)))},[ot]),(0,S.useEffect)(()=>{it[ct]&&it[ct][ot]!==void 0&&(Ie(it[ct][ot].substring(0,4)),Re(it[ct][ot].substring(5)))},[ct]);let ft=()=>{Ie(Le),Re(Fe)},pt=e=>{Ae(e.target.value===`image`?`image`:`video`)};(0,S.useEffect)(()=>{I5().then(e=>{oe(Object.fromEntries(e.map(e=>[e.key,e.label]))),q(Object.fromEntries(e.map(e=>[e.key,e.optionGroups||[]])))}).catch(()=>{}),Fie().then(e=>{let t=e.items?.[0]?.supportedSizes||{};dt(t);let n=Object.keys(t);rt(n.map(e=>({value:e,label:e})));let r=n.includes(Ne)?Ne:n[0]||`2K`,i=Object.keys(t[r]||{});tt(i.map(e=>({value:e,label:e})));let a=i.includes(je)?je:i[0]||`1:1`;a!==je&&Me(a);let o=t[r]?.[a];if(o){let[e,t]=o.split(/x/i).map(Number);Ie(e),Re(t)}}).catch(()=>{}),Pie().then(e=>{if(e.items?.length){let t=e.items[0];we({ratios:t.supportedRatios?.length?t.supportedRatios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:t.supportedResolutions?.length?t.supportedResolutions:[`720p`,`1080p`],durations:t.supportedDurations?.length?t.supportedDurations:[5,8,10,12,15]})}}).catch(()=>{})},[]),(0,S.useEffect)(()=>{a(),o({projectId:e,page:1,pageSize:100})},[e,a,o]);let mt=(0,S.useRef)(!1);(0,S.useEffect)(()=>{mt.current||l.length===0||(mt.current=!0,l.forEach(t=>{t.projectId===e&&t.status===`generating`&&(T(e=>({...e,[t.id]:`generating`})),Vt(t.id)),t.projectId===e&&t.status===`optimizing`&&St(t.id)}))},[l,e]);let ht=(0,S.useRef)(new Set),gt=(0,S.useRef)(null),_t=(0,S.useRef)(null),vt=e=>{ht.current.add(e),xt()},yt=e=>{ht.current.delete(e),ht.current.size===0&&bt()},bt=()=>{gt.current&&=(clearInterval(gt.current),null),_t.current&&=(_t.current.abort(),null)},xt=()=>{gt.current||=setInterval(async()=>{try{_t.current&&_t.current.abort();let t=new AbortController;_t.current=t;let n=await w5({projectId:e,page:1,pageSize:100,signal:t.signal});_t.current=null;let r=Array.from(ht.current),i=[];if(r.length>0){let e=C7.getState().records,t=e.items.map(e=>{if(r.includes(e.id)){let t=n.items.find(t=>t.id===e.id);if(t)return t.status!==`optimizing`&&i.push(e.id),t}return e});C7.setState({records:{...e,items:t}}),i.forEach(e=>{yt(e)})}}catch(e){e.name}},3e3)},St=e=>{vt(e)},Ct=(0,S.useRef)(!1),wt=(0,S.useRef)(null);(0,S.useEffect)(()=>{if(Ct.current||l.length===0)return;let t=localStorage.getItem(`pending_optimize`);if(t)try{let{key:n,projectId:r,prompt:i,duration:a,ts:o}=JSON.parse(t);if(Date.now()-o>300*1e3||r!==e){localStorage.removeItem(`pending_optimize`);return}if(wt.current===n)return;let s=l.find(e=>e.projectId===r&&e.originalPrompt===i&&e.duration===a&&e.status===`prompt_optimized`&&new Date(e.createdAt).getTime()>o-1e4);s?(Ct.current=!0,localStorage.removeItem(`pending_optimize`),g(s),v(s.optimizedPrompt||``),Ee(s.textCreditsCost),Oe(s.textTokensUsed),m(!0),Z.success({content:`优化请求已恢复,消耗 ${s.textCreditsCost} 积分`,key:`recovery`})):Date.now()-o>3e4&&localStorage.removeItem(`pending_optimize`)}catch{localStorage.removeItem(`pending_optimize`)}},[l,e]);let Tt=r.find(t=>t.id===e),Et=l.filter(t=>t.projectId===e),Dt=Tt?.name??`项目`,Ot=Tt&&K[Tt.industry]||[],kt=u?.credits??0,At=e=>{let t=e===`2k`?`2048`:e===`4k`?`4096`:e;for(let e=0;e=jt,Nt=async()=>{try{if(!e){Z.error(`项目ID为空,请先选择项目`);return}let t=await n.validateFields();if(!t.prompt||!t.prompt.trim()){Z.error(`请输入视频/图片描述`);return}f(!0);let r=Object.entries(se).map(([e,t])=>`@${e}:${t}`),i=r.length>0?`${t.prompt}\n\n${r.join(`;`)}`:t.prompt,a=hoe();localStorage.setItem(`pending_optimize`,JSON.stringify({key:a,projectId:e,prompt:i,duration:he,ts:Date.now()})),wt.current=a;let o=await s(e,{prompt:i,duration:he,genType:ke,resolution:Ne,references:B.length>0?B:void 0,idempotencyKey:a,image_size:Ne,image_proportion:je,image_px:Fe+`x`+Le});localStorage.removeItem(`pending_optimize`),wt.current=null,g(o.record),v(o.record.optimizedPrompt||``),Ee(o.textCreditsCost),Oe(o.textTokensUsed),m(!0),Z.success({content:`「${Dt}」提示词优化完成,消耗 ${o.textCreditsCost} 积分`,key:`optimize`})}catch(e){let t=e?.response?.data?.message||e?.message||`操作失败,请稍后重试`;Z.error(t)}finally{f(!1),localStorage.removeItem(`pending_optimize`),wt.current=null}},Pt=(0,S.useRef)(new Set),Ft=(0,S.useRef)(null),It=(0,S.useRef)(null),Lt=e=>{Pt.current.add(e),Bt()},Rt=e=>{Pt.current.delete(e),Pt.current.size===0&&zt()},zt=()=>{Ft.current&&=(clearInterval(Ft.current),null),It.current&&=(It.current.abort(),null)},Bt=()=>{Ft.current||=setInterval(async()=>{try{It.current&&It.current.abort();let t=new AbortController;It.current=t;let n=await w5({projectId:e,page:1,pageSize:100,signal:t.signal});It.current=null;let r=Array.from(Pt.current),i=[];if(r.length>0){let e=C7.getState().records,t=e.items.map(e=>{if(r.includes(e.id)){let t=n.items.find(t=>t.id===e.id);if(t){let n=w[e.id];return t.status===`generating`?n!==`generating`&&T(t=>({...t,[e.id]:`generating`})):i.push(e.id),t}}return e});C7.setState({records:{...e,items:t}}),i.forEach(e=>{let t=n.items.find(t=>t.id===e);Rt(e),t?.status===`completed`?(T(t=>({...t,[e]:`done`})),g(n=>n?.id===e?t:n),Z.success({content:`「${Dt}」视频生成完成!`,key:e,duration:5})):t?.status===`failed`&&(T(t=>({...t,[e]:`failed`})),g(n=>n?.id===e?t:n),Z.error({content:`「${Dt}」视频生成失败: ${t.errorMessage||`未知错误`}`,key:e,duration:5}))})}}catch(e){e.name}},5e3)},Vt=e=>{Lt(e)};(0,S.useEffect)(()=>()=>{zt(),bt()},[]),(0,S.useEffect)(()=>{l.filter(e=>e.status===`generating`).forEach(e=>{T(t=>({...t,[e.id]:`generating`})),Vt(e.id)})},[l]);let Ht=async e=>{if(!Mt){Z.error(`积分不足,请先充值`);return}C(t=>({...t,[e]:!0})),T(t=>({...t,[e]:`generating`})),Z.loading({content:`「${Dt}」正在提交视频生成...`,duration:0,key:e});try{(await c(e,{aspectRatio:_e,resolution:ye})).status===`failed`?(T(t=>({...t,[e]:`failed`})),Z.error({content:`「${Dt}」提交失败`,key:e,duration:3})):(Z.success({content:`「${Dt}」已提交,正在生成中...`,key:e,duration:3}),Vt(e))}catch(t){T(t=>({...t,[e]:`failed`}));let n=`提交失败`;t?.response?.data?.detail?n=t.response.data.detail:t?.data?.detail?n=t.data.detail:t?.detail?n=t.detail:t?.message&&(n=t.message),Z.error({content:`${n}`,key:e,duration:3})}finally{C(t=>({...t,[e]:!1}))}},Ut=e=>{let t=w[e.id];return t===`generating`?`generating`:t===`done`?`completed`:t===`failed`?`failed`:e.status},Wt={optimizing:{color:`processing`,text:`优化中`,icon:(0,$.jsx)(Xm,{style:{animation:`spinSlow 1s linear infinite`}})},prompt_optimized:{color:`processing`,text:`待生成`,icon:(0,$.jsx)(cV,{})},generating:{color:`warning`,text:`生成中`,icon:(0,$.jsx)(Xm,{style:{animation:`spinSlow 1s linear infinite`}})},completed:{color:`success`,text:`已完成`,icon:(0,$.jsx)(d4,{})},failed:{color:`error`,text:`失败`,icon:(0,$.jsx)(m4,{})}},Gt=({label:e,value:t,options:n,suffix:r,expanded:i,onToggle:a,onSelect:o,onClose:s})=>{let c=(0,S.useRef)(null),l=(0,S.useRef)(null),u=(0,S.useRef)(i),[d,f]=(0,S.useState)(null);return u.current=i,(0,S.useEffect)(()=>{if(i&&c.current){let e=c.current.getBoundingClientRect();f({bottom:window.innerHeight-e.top+4,left:e.left,width:Math.max(e.width,100)})}else f(null)},[i]),(0,S.useEffect)(()=>{if(!i)return;let e=e=>{c.current?.contains(e.target)||l.current?.contains(e.target)||u.current&&s()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[i,s]),(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{ref:c,onClick:a,translate:`no`,style:{display:`flex`,alignItems:`center`,gap:6,padding:`5px 12px`,borderRadius:8,cursor:`pointer`,userSelect:`none`,transition:`background 0.2s, border-color 0.2s`,background:i?`rgba(99,102,241,0.08)`:`#f8f9fc`,border:i?`1px solid #6366f1`:`1px solid #e2e8f0`,minWidth:70,whiteSpace:`nowrap`,flexShrink:0},children:[(0,$.jsxs)(`span`,{style:{fontSize:12,color:`#6366f1`,fontWeight:500,lineHeight:`18px`},children:[t,r]}),(0,$.jsx)(YZ,{style:{fontSize:9,color:`#94a3b8`,transition:`transform 0.2s`,transform:i?`rotate(180deg)`:`rotate(0deg)`}})]}),d&&(0,Vi.createPortal)((0,$.jsxs)(`div`,{ref:l,style:{position:`fixed`,bottom:d.bottom,left:d.left,minWidth:d.width,background:`#fff`,borderRadius:12,padding:6,zIndex:99999,boxShadow:`0 8px 30px rgba(0,0,0,0.12)`,border:`1px solid #e2e8f0`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:10,color:`#94a3b8`,display:`block`,padding:`2px 6px 4px`},children:e}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:2},children:n.map((e,n)=>{let r=t===e;return(0,$.jsx)(`div`,{onClick:()=>{o(e),s()},style:{padding:`6px 10px`,borderRadius:8,fontSize:13,cursor:`pointer`,transition:`all 0.15s`,background:r?`linear-gradient(135deg, #6366f1, #8b5cf6)`:`transparent`,color:r?`#fff`:`#1a1a2e`,fontWeight:r?600:400},onMouseEnter:e=>{r||(e.currentTarget.style.background=`#f1f5f9`)},onMouseLeave:e=>{r||(e.currentTarget.style.background=`transparent`)},children:e},n)})})]}),document.body)]})},Kt=({group:e,selected:t,expanded:n,onToggle:r,onSelect:i,onClose:a})=>{let o=(0,S.useRef)(null),s=(0,S.useRef)(null),c=(0,S.useRef)(n),[l,u]=(0,S.useState)(null);return c.current=n,(0,S.useEffect)(()=>{if(n&&o.current){let e=o.current.getBoundingClientRect();u({bottom:window.innerHeight-e.top+4,left:e.left})}else u(null)},[n]),(0,S.useEffect)(()=>{if(!n)return;let e=e=>{o.current?.contains(e.target)||s.current?.contains(e.target)||c.current&&a()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[n,a]),(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{ref:o,onClick:r,style:{display:`flex`,alignItems:`center`,gap:6,padding:`5px 12px`,borderRadius:8,cursor:`pointer`,userSelect:`none`,transition:`all 0.2s`,background:t?`rgba(99,102,241,0.08)`:`#f8f9fc`,border:n?`1px solid #6366f1`:`1px solid #e2e8f0`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:t?`#6366f1`:`#64748b`,fontWeight:t?600:400},children:t||e.name}),(0,$.jsx)(YZ,{style:{fontSize:9,color:t?`#6366f1`:`#94a3b8`,transition:`transform 0.2s`,transform:n?`rotate(180deg)`:`rotate(0deg)`}})]}),l&&(0,Vi.createPortal)((0,$.jsxs)(`div`,{ref:s,style:{position:`fixed`,bottom:l.bottom,left:l.left,background:`#fff`,borderRadius:12,padding:8,minWidth:160,zIndex:99999,boxShadow:`0 8px 30px rgba(0,0,0,0.12)`,border:`1px solid #e2e8f0`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:10,color:`#94a3b8`,display:`block`,padding:`2px 6px 4px`},children:e.name}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:2},children:e.options.map((e,n)=>{let r=t===e;return(0,$.jsx)(`div`,{onClick:()=>{i(e),a()},style:{padding:`6px 10px`,borderRadius:8,fontSize:13,cursor:`pointer`,transition:`all 0.15s`,background:r?`linear-gradient(135deg, #6366f1, #8b5cf6)`:`transparent`,color:r?`#fff`:`#1a1a2e`,fontWeight:r?600:400},onMouseEnter:e=>{r||(e.currentTarget.style.background=`#f1f5f9`)},onMouseLeave:e=>{r||(e.currentTarget.style.background=`transparent`)},children:e},n)})})]}),document.body)]})};return(0,$.jsxs)(`div`,{style:{margin:`-24px -32px -32px`,borderRadius:20,height:`calc(100vh - 34px)`,padding:`24px`,background:`#fff`,overflowY:`auto`},children:[(0,$.jsxs)(`div`,{className:`gen-header animate-fadeInUp`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:24,padding:`16px 24px`,borderRadius:16,background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,border:`1px solid rgba(99, 102, 241, 0.08)`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16},children:[(0,$.jsx)(X,{icon:(0,$.jsx)(b2,{}),onClick:()=>t(`/projects`),style:{borderRadius:10,fontSize:13,height:32,background:`rgba(99, 102, 241, 0.1)`,border:`1px solid rgba(99, 102, 241, 0.2)`,color:`#6366f1`},children:`返回`}),(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #6366f1, #8b5cf6, transparent)`,borderRadius:1}}),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,$.jsx)(Q.Title,{level:4,style:{margin:0,fontSize:16,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:Dt}),Tt&&(0,$.jsx)(XQ,{style:{background:`rgba(99, 102, 241, 0.08)`,border:`1px solid rgba(99, 102, 241, 0.15)`,color:`#6366f1`,borderRadius:6},children:ae[Tt.industry]||Tt.industry})]}),(0,$.jsx)(Q.Text,{style:{color:`#64748b`,fontSize:13},children:`描述视频 → AI优化 → 生成视频`})]}),(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #8b5cf6, #6366f1, transparent)`,borderRadius:1}})]}),(0,$.jsxs)(XQ,{style:{background:`rgba(99, 102, 241, 0.08)`,border:`1px solid rgba(99, 102, 241, 0.15)`,color:`#6366f1`,borderRadius:20,fontSize:13,padding:`4px 14px`},children:[`剩余 `,kt,` 积分`]})]}),!p&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`animate-fadeInUp`,style:{marginBottom:24,padding:`16px 20px`,borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,boxShadow:`0 2px 12px rgba(0,0,0,0.03)`},children:(0,$.jsxs)(`div`,{style:{width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`flex-start`},children:[(0,$.jsxs)(`div`,{style:{marginRight:70,position:`relative`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:14,fontWeight:500,color:`#475569`,marginRight:16},children:`生成类型:`}),(0,$.jsxs)(jI.Group,{defaultValue:`video`,buttonStyle:`solid`,onChange:pt,children:[(0,$.jsxs)(jI.Button,{value:`video`,children:[(0,$.jsx)(t5,{style:{marginRight:6,fontSize:14}}),` `,`视频`]}),(0,$.jsxs)(jI.Button,{value:`image`,style:{zIndex:0},children:[(0,$.jsx)(R6,{style:{marginRight:6,fontSize:14}}),` `,`图片`]})]})]}),ke===`video`&&[{icon:(0,$.jsx)(M$,{}),label:`描述视频+时长`,color:`#6366f1`},{icon:(0,$.jsx)(W8,{}),label:`AI智能优化`,color:`#8b5cf6`},{icon:(0,$.jsx)(d8,{}),label:`选择参数生成`,color:`#10b981`}].map((e,t)=>(0,$.jsxs)(S.Fragment,{children:[t>0&&(0,$.jsx)(`div`,{style:{width:40,height:1,background:`linear-gradient(90deg, #e2e8f0, #cbd5e1, #e2e8f0)`,margin:`0 12px`,flexShrink:0}}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:10,background:`${e.color}12`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`span`,{style:{color:e.color,fontSize:15},children:e.icon})}),(0,$.jsx)(Q.Text,{style:{fontSize:13,fontWeight:500,color:`#1a1a2e`},children:e.label})]})]},t)),ke===`image`&&[{icon:(0,$.jsx)(M$,{}),label:`描述图片+尺寸`,color:`#6366f1`},{icon:(0,$.jsx)(W8,{}),label:`AI智能优化`,color:`#8b5cf6`},{icon:(0,$.jsx)(d8,{}),label:`图片生成`,color:`#10b981`}].map((e,t)=>(0,$.jsxs)(S.Fragment,{children:[t>0&&(0,$.jsx)(`div`,{style:{width:40,height:1,background:`linear-gradient(90deg, #e2e8f0, #cbd5e1, #e2e8f0)`,margin:`0 12px`,flexShrink:0}}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:10,background:`${e.color}12`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`span`,{style:{color:e.color,fontSize:15},children:e.icon})}),(0,$.jsx)(Q.Text,{style:{fontSize:13,fontWeight:500,color:`#1a1a2e`},children:e.label})]})]},t))]})}),(0,$.jsxs)(tU,{form:n,initialValues:{},children:[(0,$.jsx)(tU.Item,{name:`prompt`,noStyle:!0,rules:[{required:!0,message:`请输入视频描述`}],style:{display:`none`}}),(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{borderRadius:20,background:`#fff`,border:`1px solid #f0f0f5`,boxShadow:`0 4px 24px rgba(0,0,0,0.04)`,overflow:`visible`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`12px 16px 0`,minHeight:60},children:[B.map((e,t)=>(0,$.jsxs)(`div`,{className:`ref-thumb`,style:{position:`relative`,width:48,height:48,borderRadius:12,overflow:`visible`,flexShrink:0},children:[(0,$.jsx)(`div`,{style:{width:48,height:48,borderRadius:12,overflow:`hidden`,border:`1px solid #e2e8f0`,cursor:`pointer`},onClick:()=>{e.type===`video`&&me(`http://ceshi.apiforeign.minzhong.cn${e.url}`)},children:e.type===`image`?(0,$.jsx)(tW,{src:`http://ceshi.apiforeign.minzhong.cn${e.url}`,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(z7,{src:`http://ceshi.apiforeign.minzhong.cn${e.url}`})}),(0,$.jsx)(`div`,{className:`ref-delete`,onClick:n=>{n.stopPropagation(),k5(e.url).catch(()=>{}),V(e=>e.filter((e,n)=>n!==t))},style:{position:`absolute`,top:-4,right:-4,width:16,height:16,borderRadius:`50%`,background:`rgba(0,0,0,0.55)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,zIndex:10,opacity:0,transition:`opacity 0.15s`,backdropFilter:`blur(4px)`},children:(0,$.jsx)(m4,{style:{color:`#fff`,fontSize:10}})})]},t)),(0,$.jsx)(R7,{accept:`image/*,video/*`,onLocalSelect:e=>{e.forEach(async e=>{await qe(e)})},onHistorySelect:e=>{e.forEach(e=>{V(t=>[...t,{url:e.resourceUrl||e.previewUrl||e.displayUrl||``,type:e.resourceType,name:e.fileName||``}])}),Z.success(`成功添加${e.length}个历史记录`)},onPortraitSelect:e=>{e.forEach(e=>{V(t=>[...t,{url:e.previewUrl||``,type:e.assetType===`Video`?`video`:`image`,name:e.name||`真人素材`,source:`private_portrait_asset`,private_asset_id:e.id,label:``,duration:e.assetType===`Video`?e.videoDuration||0:void 0}])}),Z.success(`已添加 ${e.length} 个真人素材参考`)},uploading:H,tooltipTitle:`图片${B.filter(e=>e.type===`image`).length}/5,视频${B.filter(e=>e.type===`video`).length}/2`,maxImageCount:5,maxVideoCount:2,usedImageCount:B.filter(e=>e.type===`image`).length,usedVideoCount:B.filter(e=>e.type===`video`).length,usedVideoDuration:B.filter(e=>e.type===`video`).reduce((e,t)=>e+(t.duration||0),0),maxVideoDuration:15,children:(0,$.jsx)(`div`,{style:{width:48,height:48,borderRadius:12,border:`1.5px dashed #d9d9d9`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,transition:`all 0.2s`,flexShrink:0},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#6366f1`,e.currentTarget.style.background=`rgba(99,102,241,0.04)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`#d9d9d9`,e.currentTarget.style.background=`transparent`},children:H?(0,$.jsx)(Xm,{style:{fontSize:18,color:`#6366f1`}}):(0,$.jsx)(rL,{style:{fontSize:18,color:`#94a3b8`}})})})]}),(0,$.jsx)(`div`,{style:{padding:`8px 16px 4px`},children:(0,$.jsx)(IW.TextArea,{ref:ie,value:W,onChange:e=>{let t=e.target.value;ee(t),n.setFieldsValue({prompt:t});let r=t.lastIndexOf(`@`);if(r>=0){let e=t.slice(r+1);if(!e.includes(` `)&&!e.includes(` +`)){G(!0),re(e);return}}G(!1)},onPaste:e=>{let t=e.clipboardData?.items;if(!t)return;let n=[];for(let e=0;e0&&(e.preventDefault(),n.forEach(async e=>{await qe(e)}))},rows:3,placeholder:`上传参考素材(只用做模型理解,不参与生成)、输入文字,自由组合图、文多元素。输入 @ 可引用参考内容...`,maxLength:500,bordered:!1,autoSize:{minRows:2,maxRows:6},style:{padding:`6px 2px`,fontSize:15,lineHeight:1.7,resize:`none`,caretColor:`#6366f1`}})}),te&&B.length>0&&(0,$.jsx)(`div`,{style:{margin:`0 16px 8px`,background:`#fff`,borderRadius:10,boxShadow:`0 6px 24px rgba(0,0,0,0.12)`,border:`1px solid #e2e8f0`,padding:6,maxHeight:180,overflowY:`auto`},children:(()=>{let e=B.filter(e=>!ne||e.name.includes(ne));return(e.length>0?e:B).map((e,t)=>{let r=B.indexOf(e);return(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,padding:`8px 10px`,borderRadius:8,cursor:`pointer`,transition:`background 0.15s`},onMouseEnter:e=>e.currentTarget.style.background=`#f1f5f9`,onMouseLeave:e=>e.currentTarget.style.background=`transparent`,onMouseDown:t=>{t.preventDefault();let i=ie.current?.resizableTextArea?.textArea||ie.current?.nativeElement?.querySelector(`textarea`)||ie.current;if(!i||!i.value)return;let a=i.value,o=a.lastIndexOf(`@`),s=e.name||(e.type===`image`?`图片${r+1}`:`视频${r+1}`),c=a.slice(0,o)+`@${s} `;ee(c),n.setFieldValue(`prompt`,c),G(!1),setTimeout(()=>{i.focus(),i.selectionStart=c.length,i.selectionEnd=c.length},50)},children:[(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:8,overflow:`hidden`,background:e.type===`image`?`#f1f5f9`:`#1a1a2e`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0},children:e.type===`image`?(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn${e.url}`,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(q6,{style:{color:`#fff`,fontSize:14}})}),(0,$.jsx)(Q.Text,{style:{fontSize:13},children:e.name||(e.type===`image`?`图片${r+1}`:`视频${r+1}`)}),(0,$.jsx)(XQ,{style:{marginLeft:`auto`,fontSize:11},children:e.type===`image`?`图片`:`视频`})]},t)})})()}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`8px 12px 12px`,gap:8,flexWrap:`wrap`,position:`relative`,zIndex:50,minHeight:48},children:[ke!==`image`&&(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,flex:1,flexWrap:`wrap`},children:[(0,$.jsx)(Gt,{label:`时长`,value:`${he}`,options:Ce.durations.map(e=>`${e}`),suffix:`秒`,expanded:xe===`duration`,onToggle:()=>Se(xe===`duration`?null:`duration`),onSelect:e=>ge(parseInt(e)),onClose:()=>Se(null)}),Ot.map((e,t)=>{let n=le===e.name,r=se[e.name];return(0,$.jsx)(Kt,{group:e,selected:r,expanded:n,onToggle:()=>ue(n?null:e.name),onSelect:t=>{ce(n=>{let r={...n};return r[e.name]===t?delete r[e.name]:r[e.name]=t,r})},onClose:()=>ue(null)},`og-${t}`)})]}),ke==`image`&&(0,$.jsxs)(`div`,{style:{position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>Be(!ze),className:`image-settings-trigger`,style:{minWidth:220,padding:`0px 16px`,height:30,borderRadius:10,border:`1px solid #e2e8f0`,backgroundColor:`#f8f9fc`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,transition:`all 0.2s`},children:[(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:(0,$.jsxs)(`div`,{style:{textAlign:`left`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:13,fontWeight:600,color:`#374151`,marginRight:10},children:je===`auto`?`智能`:je}),(0,$.jsxs)(Q.Text,{style:{fontSize:12,color:`#9ca3af`},children:[Ne===`1K`?`标清 1K`:Ne===`2K`?`高清 2K`:`${Ne}分辨率`,`| `,Fe,`×`,Le]})]})}),(0,$.jsx)(YZ,{style:{fontSize:14,color:`#9ca3af`}})]}),ze&&(0,$.jsxs)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:0,width:520,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:20,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(`div`,{style:{marginBottom:20},children:[(0,$.jsx)(Q.Text,{style:{display:`block`,marginBottom:10,fontSize:13,fontWeight:500,color:`#666666`},children:`选择比例`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:6},children:et.map(e=>(0,$.jsxs)(`button`,{onClick:()=>{Me(e.value),Ze(e.label)},style:{flex:`0 0 calc(11.11% - 5px)`,minWidth:48,height:56,borderRadius:8,border:je===e.value?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:je===e.value?`#fff`:`#f9fafb`,cursor:`pointer`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:[(0,$.jsx)(`div`,{style:{width:(()=>{let[t,n]=e.value===`auto`?[1,1]:e.value.split(`:`).map(Number);return t>=n?20:Math.round(t/n*20)})(),height:(()=>{let[t,n]=e.value===`auto`?[1,1]:e.value.split(`:`).map(Number);return n>=t?20:Math.round(n/t*20)})(),border:`2px solid ${je===e.value?`#6366f1`:`#9ca3af`}`,borderRadius:(e.value,3),marginBottom:3,display:`flex`,alignItems:`center`,justifyContent:`center`},children:e.value===`auto`&&(0,$.jsx)(`span`,{style:{fontSize:8,color:je===e.value?`#6366f1`:`#9ca3af`},children:`智`})}),(0,$.jsx)(`span`,{style:{fontSize:10,color:je===e.value?`#6366f1`:`#6b7280`,fontWeight:je===e.value?600:400},children:e.value})]},e.value))})]}),(0,$.jsxs)(`div`,{style:{marginBottom:20},children:[(0,$.jsx)(Q.Text,{style:{display:`block`,marginBottom:10,fontSize:13,fontWeight:500,color:`#666666`},children:`选择分辨率`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:8},children:nt.map(e=>(0,$.jsx)(`button`,{onClick:()=>{Pe(e.value),Qe(e.label)},style:{flex:1,height:48,borderRadius:8,border:Ne===e.value?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:Ne===e.value?`#6366f1`:`#f9fafb`,cursor:`pointer`,display:`flex`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:(0,$.jsxs)(`span`,{style:{fontSize:13,fontWeight:600,color:Ne===e.value?`#fff`:`#4b5563`},children:[e.value,e.value===`4k`&&(0,$.jsx)(`span`,{style:{marginLeft:3},children:`✨`})]})},e.value))})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Text,{style:{display:`block`,marginBottom:10,fontSize:13,fontWeight:500,color:`#666666`},children:`尺寸`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,flex:1,maxWidth:140},children:[(0,$.jsx)(`span`,{style:{color:`#9ca3af`,fontSize:12,marginRight:6},children:`W`}),(0,$.jsx)(IW,{value:Fe,onChange:e=>Ie(Number(e.target.value)||0),style:{flex:1,textAlign:`center`,borderRadius:6,height:40,border:`1px solid #e5e7eb`,backgroundColor:`#f9fafb`,fontSize:14,fontWeight:600,color:`#1f2937`}})]}),(0,$.jsx)(`button`,{onClick:ft,style:{width:28,height:28,borderRadius:6,border:`1px solid #e5e7eb`,backgroundColor:`#fff`,cursor:`pointer`,display:`flex`,justifyContent:`center`,alignItems:`center`,color:`#6366f1`},children:(0,$.jsx)(BU,{style:{fontSize:12}})}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,flex:1,maxWidth:140},children:[(0,$.jsx)(`span`,{style:{color:`#9ca3af`,fontSize:12,marginRight:6},children:`H`}),(0,$.jsx)(IW,{value:Le,onChange:e=>Re(Number(e.target.value)||0),style:{flex:1,textAlign:`center`,borderRadius:6,height:40,border:`1px solid #e5e7eb`,backgroundColor:`#f9fafb`,fontSize:14,fontWeight:600,color:`#1f2937`}})]}),(0,$.jsx)(`span`,{style:{color:`#9ca3af`,fontSize:12},children:`PX`})]})]})]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,flexShrink:0},children:[ke===`image`&&(0,$.jsx)(`span`,{style:{color:`#7c7c7c`,fontSize:14},children:`(请在左侧选择图片比例和尺寸)`}),(0,$.jsx)(X,{type:`primary`,size:`large`,onClick:Nt,loading:d,style:{borderRadius:10,fontWeight:600,minWidth:140,height:40,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,boxShadow:`0 4px 16px rgba(99,102,241,0.35)`},children:`AI优化提示词`})]})]})]})]})]}),p&&h&&(0,$.jsxs)(DL,{className:`animate-fadeInUp`,style:{borderRadius:16},styles:{body:{padding:`24px 28px`}},children:[!w[h.id]||w[h.id]===`idle`?(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14,marginBottom:24,padding:`14px 18px`,borderRadius:12,background:`linear-gradient(135deg, rgba(16,185,129,0.06), rgba(5,150,105,0.06))`,border:`1px solid rgba(16,185,129,0.15)`},children:[(0,$.jsx)(d4,{style:{color:`#10b981`,fontSize:22}}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:15,display:`block`},children:`提示词优化完成`}),(0,$.jsxs)(Q.Text,{style:{fontSize:12,color:`#94a3b8`},children:[`文本优化消耗 `,Te,` 积分· 您可以编辑提示词后选择参数生成视频`]})]})]}):(0,$.jsxs)(`div`,{style:{marginBottom:24,padding:`16px 18px`,borderRadius:12,display:`flex`,alignItems:`center`,gap:12,background:w[h.id]===`failed`?`rgba(239,68,68,0.04)`:w[h.id]===`done`?`rgba(16,185,129,0.04)`:`rgba(99,102,241,0.04)`,border:`1px solid ${w[h.id]===`failed`?`rgba(239,68,68,0.12)`:w[h.id]===`done`?`rgba(16,185,129,0.12)`:`rgba(99,102,241,0.12)`}`},children:[w[h.id]===`generating`&&(0,$.jsx)(Xm,{style:{color:`#6366f1`,fontSize:18},spin:!0}),w[h.id]===`done`&&(0,$.jsx)(d4,{style:{color:`#10b981`,fontSize:18}}),w[h.id]===`failed`&&(0,$.jsx)(m4,{style:{color:`#ef4444`,fontSize:18}}),(0,$.jsxs)(Q.Text,{strong:!0,style:{fontSize:14,color:w[h.id]===`failed`?`#ef4444`:w[h.id]===`done`?`#10b981`:`#6366f1`},children:[w[h.id]===`generating`&&(0,$.jsxs)(`span`,{children:[ke===`image`?`图片`:`视频`,`生成中,请稍候...`]}),w[h.id]===`done`&&`${ke===`image`?`图片`:`视频`}生成成功`,w[h.id]===`failed`&&`${ke===`image`?`图片`:`视频`}生成失败,请重试`]})]}),!w[h.id]||w[h.id]===`idle`||w[h.id]===`failed`?(0,$.jsxs)(`div`,{className:`gen-prompt-row`,style:{display:`flex`,gap:20,flexWrap:`wrap`},children:[(0,$.jsxs)(`div`,{style:{flex:`1 1 45%`,minWidth:240},children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:8},children:`原始提示词`}),(0,$.jsx)(`div`,{style:{padding:14,borderRadius:12,background:`#f8f9fc`,border:`1px solid #f0f0f5`,minHeight:100},children:(0,$.jsx)(Q.Text,{style:{fontSize:14,color:`#64748b`,lineHeight:1.7},children:h.originalPrompt})})]}),(0,$.jsxs)(`div`,{style:{flex:`1 1 45%`,minWidth:240},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:8},children:[(0,$.jsxs)(Q.Text,{style:{fontSize:12,color:`#94a3b8`},children:[`优化后的提示词`,` `,!y&&(0,$.jsx)(`span`,{style:{color:`#6366f1`},children:`(可编辑)`})]}),!y&&(0,$.jsxs)(sH,{size:4,children:[(0,$.jsx)(gw,{title:`复制`,children:(0,$.jsx)(X,{type:`text`,size:`small`,icon:(0,$.jsx)(t1,{}),onClick:async()=>{let e=await k7(_);Z.success(e?`已复制`:`复制失败`)},style:{color:`#94a3b8`}})}),(0,$.jsx)(gw,{title:`编辑`,children:(0,$.jsx)(X,{type:`text`,size:`small`,icon:(0,$.jsx)(M$,{}),onClick:()=>b(!0),style:{color:`#6366f1`}})})]})]}),y?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(IW.TextArea,{value:_,onChange:e=>v(e.target.value),rows:5,style:{borderRadius:12,fontSize:14,lineHeight:1.7,border:`1px solid rgba(99,102,241,0.25)`,background:`rgba(99,102,241,0.02)`}}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,marginTop:8},children:[(0,$.jsx)(X,{size:`small`,onClick:()=>{v(h.optimizedPrompt||``),b(!1)},children:`取消`}),(0,$.jsx)(X,{size:`small`,type:`primary`,onClick:()=>{b(!1),Z.success(`提示词已更新`)},style:{borderRadius:6,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`},children:`保存`})]})]}):(0,$.jsx)(`div`,{style:{padding:14,borderRadius:12,background:`rgba(99,102,241,0.02)`,border:`1px solid rgba(99,102,241,0.1)`,minHeight:100},children:(0,$.jsx)(Q.Text,{style:{fontSize:14,color:`#1a1a2e`,lineHeight:1.7},children:_})})]})]}):(0,$.jsxs)(`div`,{className:`gen-prompt-row`,style:{display:`flex`,gap:24,flexWrap:`wrap`},children:[(0,$.jsxs)(`div`,{style:{flex:`1 1 55%`,minWidth:280},children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:8},children:`原始提示词`}),(0,$.jsx)(`div`,{style:{padding:14,borderRadius:12,background:`#f8f9fc`,border:`1px solid #f0f0f5`,minHeight:80},children:(0,$.jsx)(Q.Text,{style:{fontSize:13,color:`#64748b`,lineHeight:1.6},children:h.originalPrompt})})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:8},children:[(0,$.jsxs)(Q.Text,{style:{fontSize:12,color:`#94a3b8`},children:[`优化后的提示词`,` `,!y&&(0,$.jsx)(`span`,{style:{color:`#6366f1`},children:`(可编辑)`})]}),!y&&(0,$.jsxs)(sH,{size:4,children:[(0,$.jsx)(gw,{title:`复制`,children:(0,$.jsx)(X,{type:`text`,size:`small`,icon:(0,$.jsx)(t1,{}),onClick:async()=>{let e=await k7(_);Z.success(e?`已复制`:`复制失败`)},style:{color:`#94a3b8`}})}),(0,$.jsx)(gw,{title:`编辑`,children:(0,$.jsx)(X,{type:`text`,size:`small`,icon:(0,$.jsx)(M$,{}),onClick:()=>b(!0),style:{color:`#6366f1`}})})]})]}),y?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(IW.TextArea,{value:_,onChange:e=>v(e.target.value),rows:5,style:{borderRadius:12,fontSize:13,lineHeight:1.6,border:`1px solid rgba(99,102,241,0.25)`,background:`rgba(99,102,241,0.02)`}}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,marginTop:8},children:[(0,$.jsx)(X,{size:`small`,onClick:()=>{v(h.optimizedPrompt||``),b(!1)},children:`取消`}),(0,$.jsx)(X,{size:`small`,type:`primary`,onClick:()=>{b(!1),Z.success(`提示词已更新`)},style:{borderRadius:6,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`},children:`保存`})]})]}):(0,$.jsx)(`div`,{style:{padding:14,borderRadius:12,background:`rgba(99,102,241,0.02)`,border:`1px solid rgba(99,102,241,0.1)`,minHeight:120},children:(0,$.jsx)(Q.Text,{style:{fontSize:13,color:`#1a1a2e`,lineHeight:1.6},children:_})})]})]}),(0,$.jsxs)(`div`,{style:{flex:`1 1 40%`,minWidth:280},children:[h.videoUrl&&(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:8},children:`生成视频`}),(0,$.jsx)(`div`,{style:{borderRadius:12,overflow:`hidden`,border:`1px solid #f0f0f5`,background:`#000`},children:(0,$.jsx)(`video`,{src:`http://ceshi.apiforeign.minzhong.cn${h.videoUrl}`,controls:!0,style:{width:`100%`,maxHeight:350,display:`block`}})})]}),h.imageUrl&&(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:8},children:`生成图片`}),(0,$.jsx)(tW,{src:`http://ceshi.apiforeign.minzhong.cn${h.imageUrl}`,style:{width:`100%`,maxHeight:350,objectFit:`contain`,borderRadius:12,border:`1px solid #f0f0f5`},preview:!0})]})]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginTop:20,padding:`14px 18px`,borderRadius:12,background:`#f8f9fc`,border:`1px solid #f0f0f5`},children:[ke!==`image`&&(0,$.jsxs)(`div`,{style:{marginTop:24,borderRadius:12,background:`#f8f9fc`,width:`25%`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:13,color:`#1a1a2e`,fontWeight:600,display:`block`,marginBottom:12},children:`选择视频参数`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,flexWrap:`wrap`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6,padding:`5px 12px`,borderRadius:8,background:`#f8f9fc`,border:`1px solid #e2e8f0`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#94a3b8`},children:`时长`}),(0,$.jsxs)(Q.Text,{strong:!0,style:{fontSize:13,color:`#6366f1`},children:[he,`s`]})]}),(0,$.jsx)(Gt,{label:`比例`,value:_e,options:Ce.ratios,expanded:xe===`ratio`,onToggle:()=>Se(xe===`ratio`?null:`ratio`),onSelect:e=>ve(e),onClose:()=>Se(null)}),(0,$.jsx)(Gt,{label:`分辨率`,value:ye,options:Ce.resolutions,expanded:xe===`resolution`,onToggle:()=>Se(xe===`resolution`?null:`resolution`),onSelect:e=>be(e),onClose:()=>Se(null)})]})]}),ke==`image`&&h&&(0,$.jsx)(`div`,{style:{marginTop:24,borderRadius:12,background:`#f8f9fc`,width:`25%`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-around`},children:[(0,$.jsxs)(`div`,{style:{textAlign:`center`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`,marginBottom:4},children:`分辨率`}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:14,color:`#1a1a2e`},children:h.imageSize||`-`})]}),(0,$.jsxs)(`div`,{style:{textAlign:`center`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`,marginBottom:4},children:`画面比例`}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:14,color:`#1a1a2e`},children:h.imageProportion||`-`})]}),(0,$.jsxs)(`div`,{style:{textAlign:`center`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`,marginBottom:4},children:`画面尺寸`}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:14,color:`#1a1a2e`},children:h.imagePx||`-`})]})]})}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16},children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:`文字积分`}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:14,color:`#6366f1`},children:Te})]}),(0,$.jsx)(Q.Text,{style:{color:`#cbd5e1`,fontSize:18},children:`+`}),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:[`预估`,ke===`image`?`图片`:`视频`,`积分`]}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:14,color:`#10b981`},children:ke===`image`&&h.imageSize?At(h.imageSize)||jt:Je(he,ye)})]}),(0,$.jsx)(Q.Text,{style:{color:`#cbd5e1`,fontSize:18},children:`=`}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:`总计`}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:16,color:`#1a1a2e`},children:(Te+(ke===`image`?At(h.imageSize):Je(he,ye))).toFixed(2)})]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:12},children:[(0,$.jsxs)(X,{size:`large`,onClick:()=>{m(!1),g(null),v(``),ee(``),V([]),ce({}),ue(null),Se(null),n.resetFields()},style:{borderRadius:12,minWidth:120,height:44,fontWeight:500},children:[`配置新`,ke===`image`?`图片`:`视频`]}),(0,$.jsx)(gw,{title:Mt?``:`积分不足`,children:(0,$.jsx)(X,{type:`primary`,size:`large`,icon:(0,$.jsx)(d8,{}),onClick:()=>Ht(h.id),loading:w[h.id]===`generating`,disabled:!Mt||w[h.id]===`generating`||w[h.id]===`done`,style:{borderRadius:12,minWidth:180,height:44,fontWeight:600,background:w[h.id]===`done`?`#10b981`:Mt?`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`:`#d1d5db`,border:`none`,boxShadow:Mt?`0 8px 24px rgba(99,102,241,0.3)`:`none`},children:w[h.id]===`done`?`生成完成`:w[h.id]===`generating`?`生成中...`:`生成${ke===`image`?`图片`:`视频`} (${ke===`image`?At(h.imageSize):Je(he,ye)}积分)`})})]})]}),h.references&&h.references.length>0&&(0,$.jsxs)(`div`,{style:{marginTop:16},children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:8},children:`参考内容`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`},children:h.references.map((e,t)=>(0,$.jsxs)(`div`,{style:{width:64,height:64,borderRadius:10,overflow:`hidden`,border:`1px solid #e2e8f0`,position:`relative`,cursor:`pointer`},onClick:()=>{e.type===`video`&&me(`http://ceshi.apiforeign.minzhong.cn${e.url}`)},children:[e.type===`image`?(0,$.jsx)(tW,{src:`http://ceshi.apiforeign.minzhong.cn${e.url}`,style:{width:`100%`,height:`100%`,objectFit:`cover`},preview:!0}):(0,$.jsx)(z7,{src:`http://ceshi.apiforeign.minzhong.cn${e.url}`,width:64,height:64}),(0,$.jsx)(XQ,{style:{position:`absolute`,bottom:0,left:0,right:0,margin:0,fontSize:9,textAlign:`center`,borderRadius:`0 0 8px 8px`,background:`rgba(0,0,0,0.5)`,border:`none`,color:`#fff`,padding:`0 2px`},children:e.name})]},t))})]})]}),Et.length>0&&(0,$.jsxs)(`div`,{style:{marginTop:24},children:[(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:15,display:`block`,marginBottom:12},children:`本项目生成记录`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8,background:`#fff`,borderRadius:12,padding:8,border:`1px solid #f0f0f5`},className:`stagger-children`,children:Et.map((e,t)=>{let n=Ut(e),r=P[e.id]??(e.optimizedPrompt||e.originalPrompt),i=R===e.id,a=e.genType||`image`;return(0,$.jsxs)(`div`,{className:`animate-slideInCard`,style:{animationDelay:`${t*.05}s`},children:[(0,$.jsxs)(`div`,{className:`record-item`,onClick:()=>z(i?null:e.id),style:{padding:`12px 16px`,borderRadius:i?`8px 8px 0 0`:8,background:`#fafafa`,cursor:`pointer`,transition:`all 0.2s`,display:`flex`,alignItems:`center`,gap:10},children:[(0,$.jsx)(`div`,{style:{width:28,height:28,borderRadius:8,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,background:a===`image`?`#fef3c7`:`#dbeafe`},children:a===`image`?(0,$.jsx)(R6,{style:{color:`#d97706`,fontSize:12}}):(0,$.jsx)(t5,{style:{color:`#2563eb`,fontSize:12}})}),i?(0,$.jsx)(YZ,{style:{color:`#6366f1`,fontSize:11,flexShrink:0}}):(0,$.jsx)(c4,{style:{color:`#cbd5e1`,fontSize:11,flexShrink:0}}),(0,$.jsx)(XQ,{color:Wt[n]?.color,icon:Wt[n]?.icon,style:{margin:0},children:Wt[n]?.text}),(0,$.jsx)(Q.Text,{style:{flex:1,fontSize:13,color:`#475569`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:r}),n===`prompt_optimized`&&(0,$.jsx)(XQ,{color:`processing`,style:{padding:`3px 10px`,fontSize:12,margin:0,flexShrink:0},children:`待配置`}),a===`image`?(0,$.jsxs)(`span`,{className:`mobile-meta`,translate:`no`,style:{fontSize:12,color:`#94a3b8`,flexShrink:0},children:[e.duration?`${e.imageSize}`:`-`,` ·`,` `,e.imageProportion||`-`,` ·`,` `,e.imagePx||`-`,` ·`,` `,(0,$.jsx)(`span`,{className:`date-display`,translate:`no`,children:T7(e.createdAt)})]}):(0,$.jsxs)(`span`,{className:`mobile-meta`,translate:`no`,style:{fontSize:12,color:`#94a3b8`,flexShrink:0},children:[e.duration?`${e.duration}秒`:`-`,` ·`,` `,e.aspectRatio||`-`,` · `,e.resolution||`-`,` `,`·`,` `,(0,$.jsx)(`span`,{className:`date-display`,translate:`no`,children:T7(e.createdAt)})]}),(0,$.jsx)(`div`,{className:`record-actions`,onClick:e=>e.stopPropagation()})]}),i&&(0,$.jsx)(`div`,{style:{background:`#fff`,borderRadius:`0 0 8px 8px`,padding:`18px 20px`,animation:`fadeInUp 0.25s ease both`},children:(0,$.jsxs)(`div`,{className:`gen-detail-row`,style:{display:`flex`,gap:20,flexWrap:`wrap`},children:[(0,$.jsxs)(`div`,{style:{flex:`1 1 50%`,minWidth:260},children:[(0,$.jsxs)(`div`,{style:{marginBottom:14},children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:6},children:`原始提示词`}),(0,$.jsx)(`div`,{style:{padding:12,borderRadius:10,background:`#f8f9fc`,border:`1px solid #f0f0f5`},children:(0,$.jsx)(Q.Text,{style:{fontSize:13,color:`#64748b`,lineHeight:1.7},children:e.originalPrompt})})]}),(0,$.jsxs)(`div`,{style:{marginBottom:14},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:6},children:[(0,$.jsxs)(Q.Text,{style:{fontSize:12,color:`#94a3b8`},children:[`优化后的提示词`,` `,(n===`prompt_optimized`||n===`failed`)&&I!==e.id&&(0,$.jsx)(`span`,{style:{color:`#6366f1`},children:`(可编辑)`})]}),I!==e.id&&(0,$.jsxs)(sH,{size:4,children:[(0,$.jsx)(gw,{title:`复制`,children:(0,$.jsx)(X,{type:`text`,size:`small`,icon:(0,$.jsx)(t1,{}),onClick:async()=>{let e=await k7(r);Z.success(e?`已复制`:`复制失败`)},style:{color:`#94a3b8`}})}),(n===`prompt_optimized`||n===`failed`)&&(0,$.jsx)(gw,{title:`编辑`,children:(0,$.jsx)(X,{type:`text`,size:`small`,icon:(0,$.jsx)(M$,{}),onClick:()=>{L(e.id),F(t=>({...t,[e.id]:t[e.id]??e.optimizedPrompt??``}))},style:{color:`#6366f1`}})})]})]}),I===e.id?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(IW.TextArea,{value:r,onChange:t=>F(n=>({...n,[e.id]:t.target.value})),rows:4,style:{borderRadius:10,fontSize:13,lineHeight:1.7,border:`1px solid rgba(99,102,241,0.25)`,background:`rgba(99,102,241,0.02)`}}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,marginTop:8},children:[(0,$.jsx)(X,{size:`small`,onClick:()=>L(null),children:`取消`}),(0,$.jsx)(X,{size:`small`,type:`primary`,onClick:()=>{F(t=>({...t,[e.id]:r})),L(null),Z.success(`提示词已更新`)},style:{borderRadius:6,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`},children:`保存`})]})]}):(0,$.jsx)(`div`,{style:{padding:12,borderRadius:10,background:n===`prompt_optimized`?`rgba(99,102,241,0.02)`:`#f8f9fc`,border:n===`prompt_optimized`?`1px solid rgba(99,102,241,0.1)`:`1px solid #f0f0f5`},children:(0,$.jsx)(Q.Text,{style:{fontSize:13,color:`#1a1a2e`,lineHeight:1.7},children:r})})]}),a===`image`?(0,$.jsx)(`div`,{style:{display:`flex`,gap:14,padding:`10px 14px`,borderRadius:10,background:`#f8f9fc`},children:[{label:`文字积分`,value:`${e.textCreditsCost||0}`},{label:`图片积分`,value:`${e.creditsCost||0}`},{label:`分辨率`,value:e.imageSize?`${e.imageSize}`:`-`},{label:`比例`,value:e.imageProportion||`-`},{label:`尺寸`,value:e.imagePx||`-`}].map((e,t)=>(0,$.jsxs)(`div`,{style:{flex:1},children:[(0,$.jsx)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:e.label}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:13,color:`#1a1a2e`},children:e.value})]},t))}):(0,$.jsx)(`div`,{style:{display:`flex`,gap:14,padding:`10px 14px`,borderRadius:10,background:`#f8f9fc`},children:[{label:`文字积分`,value:`${e.textCreditsCost||0}`},{label:`视频积分`,value:`${e.creditsCost||0}`},{label:`时长`,value:e.duration?`${e.duration}秒`:`-`},{label:`比例`,value:e.aspectRatio||`-`},{label:`分辨率`,value:e.resolution||`-`}].map((e,t)=>(0,$.jsxs)(`div`,{style:{flex:1},children:[(0,$.jsx)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:e.label}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:13,color:`#1a1a2e`},children:e.value})]},t))}),(e.references&&e.references.length>0||n===`failed`)&&(0,$.jsxs)(`div`,{style:{marginTop:14},children:[(0,$.jsxs)(Q.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:8},children:[`参考素材`,` `,n===`failed`&&(0,$.jsx)(`span`,{style:{color:`#6366f1`},children:`(可删除/添加后重试)`})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`},children:[e.references?.map((t,r)=>(0,$.jsxs)(`div`,{style:{width:64,height:64,borderRadius:10,overflow:`visible`,border:`1px solid #e2e8f0`,position:`relative`,cursor:`pointer`},onClick:()=>{t.type===`video`&&me(`http://ceshi.apiforeign.minzhong.cn${t.url}`)},children:[(0,$.jsx)(`div`,{style:{width:64,height:64,borderRadius:10,overflow:`hidden`},children:t.type===`image`?(0,$.jsx)(tW,{src:`http://ceshi.apiforeign.minzhong.cn${t.url}`,style:{width:`100%`,height:`100%`,objectFit:`cover`},preview:!0}):(0,$.jsx)(z7,{src:`http://ceshi.apiforeign.minzhong.cn${t.url}`,width:64,height:64})}),(0,$.jsx)(XQ,{style:{position:`absolute`,bottom:0,left:0,right:0,margin:0,fontSize:9,textAlign:`center`,borderRadius:`0 0 8px 8px`,background:`rgba(0,0,0,0.5)`,border:`none`,color:`#fff`,padding:`0 2px`},children:t.name}),n===`failed`&&(0,$.jsx)(`div`,{className:`ref-delete`,onClick:n=>{n.stopPropagation(),k5(t.url).catch(()=>{});let i=e.references.filter((e,t)=>t!==r);C7.getState().updateRecordReferences(e.id,i)},style:{position:`absolute`,top:-4,right:-4,width:16,height:16,borderRadius:`50%`,background:`rgba(239,68,68,0.8)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,zIndex:10,opacity:0,transition:`opacity 0.15s`},children:(0,$.jsx)(m4,{style:{color:`#fff`,fontSize:10}})})]},r)),n===`failed`&&(0,$.jsx)(b0,{accept:`image/*,video/*`,showUploadList:!1,multiple:!0,beforeUpload:t=>{let n=t.type.startsWith(`image/`),r=t.type.startsWith(`video/`);return!n&&!r?(Z.error(`仅支持图片或视频文件`),!1):(n?E5(t).then(n=>{let r={url:n.url,type:`image`,name:t.name||`图片`},i=e.references||[];C7.getState().updateRecordReferences(e.id,[...i,r]),Z.success(`上传成功`)}).catch(()=>Z.error(`上传失败`)):new Promise(e=>{let n=document.createElement(`video`);n.preload=`metadata`,n.onloadedmetadata=()=>{e(n.duration||0),n.remove()},n.onerror=()=>{e(0),n.remove()},n.src=URL.createObjectURL(t)}).then(n=>{D5(t,n).then(r=>{let i={url:r.url,type:`video`,name:t.name||`视频`,duration:n||void 0},a=e.references||[];C7.getState().updateRecordReferences(e.id,[...a,i]),Z.success(`上传成功`)}).catch(()=>Z.error(`上传失败`))}),!1)},children:(0,$.jsx)(gw,{title:`添加参考素材`,children:(0,$.jsx)(`div`,{style:{width:64,height:64,borderRadius:10,border:`1.5px dashed #d9d9d9`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,transition:`all 0.2s`},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#6366f1`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`#d9d9d9`},children:(0,$.jsx)(rL,{style:{fontSize:18,color:`#94a3b8`}})})})})]})]})]}),(0,$.jsxs)(`div`,{style:{flex:`1 1 40%`,minWidth:220,position:`relative`},children:[n===`prompt_optimized`&&(0,$.jsxs)(`div`,{style:{marginTop:16,position:`absolute`,top:0,left:0,width:`100%`,height:`100%`,backgroundColor:`transparent`},children:[a===`video`&&(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,flexWrap:`wrap`,marginBottom:12},children:[(0,$.jsxs)(`div`,{translate:`no`,style:{display:`flex`,alignItems:`center`,gap:6,padding:`5px 12px`,borderRadius:8,background:`#f8f9fc`,border:`1px solid #e2e8f0`,marginLeft:12},children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#94a3b8`},children:`时长`}),(0,$.jsxs)(Q.Text,{strong:!0,style:{fontSize:13,color:`#6366f1`},children:[e.duration,`秒`]})]}),(0,$.jsx)(Gt,{label:`比例`,value:de[e.id]?.aspectRatio||`选择比例`,options:Ce.ratios,expanded:xe===`ratio-${e.id}`,onToggle:()=>Se(xe===`ratio-${e.id}`?null:`ratio-${e.id}`),onSelect:t=>fe(n=>({...n,[e.id]:{...n[e.id],aspectRatio:t,resolution:n[e.id]?.resolution||``}})),onClose:()=>Se(null)}),(0,$.jsx)(Gt,{label:`分辨率`,value:de[e.id]?.resolution||`选择分辨率`,options:Ce.resolutions,expanded:xe===`res-${e.id}`,onToggle:()=>Se(xe===`res-${e.id}`?null:`res-${e.id}`),onSelect:t=>fe(n=>({...n,[e.id]:{...n[e.id],aspectRatio:n[e.id]?.aspectRatio||``,resolution:t}})),onClose:()=>Se(null)})]}),(0,$.jsxs)(X,{type:`primary`,size:`large`,icon:(0,$.jsx)(d8,{}),block:!0,loading:x[e.id],disabled:a===`video`&&(!de[e.id]?.aspectRatio||!de[e.id]?.resolution),onClick:async()=>{let t=de[e.id];if(a===`video`){if(!t?.aspectRatio||!t?.resolution){Z.error(`请选择比例和分辨率`);return}if(kt({...t,[e.id]:!0})),T(t=>({...t,[e.id]:`generating`}));let n=a===`video`?`视频`:`图片`;Z.loading({content:`「${Dt}」正在生成${n}...`,duration:0,key:e.id});try{await c(e.id,{aspectRatio:t?.aspectRatio,resolution:t?.resolution}),Vt(e.id),Z.success({content:`「${Dt}」${n}已提交,正在生成中...`,key:e.id,duration:3})}catch(t){T(t=>({...t,[e.id]:`failed`}));let r=t?.response?.data?.message||t?.message||`${n}生成失败`;Z.error({content:`「${Dt}」${r}`,key:e.id,duration:3})}finally{C(t=>({...t,[e.id]:!1}))}},style:{borderRadius:12,fontWeight:600,color:`#fff`,height:48,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,position:`absolute`,bottom:18,left:0},children:[`生成`,a===`video`?`视频`:`图片`,a===`video`?(0,$.jsx)(`span`,{style:{color:`#d2d2d2`,fontSize:`14px`,marginLeft:`6px`},children:`(请选择上方的比例分辨率)`}):``,` `,a===`video`&&de[e.id]?.resolution?`(${Je(e.duration||5,de[e.id].resolution)}积分)`:``,a===`image`&&e.imageSize?`(${Xe(e.imageSize)}积分)`:a===`image`?`(积分)`:``]})]}),n===`failed`&&(0,$.jsx)(`div`,{style:{position:`absolute`,bottom:18,right:20}}),n===`generating`?(0,$.jsxs)(`div`,{style:{height:`100%`,minHeight:180,borderRadius:12,background:`linear-gradient(135deg, rgba(99,102,241,0.04), rgba(139,92,246,0.04))`,border:`1px dashed rgba(99,102,241,0.2)`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:10},children:[(0,$.jsx)(Xm,{style:{color:`#6366f1`,fontSize:28},spin:!0}),(0,$.jsxs)(Q.Text,{style:{color:`#94a3b8`,fontSize:13},children:[a===`video`?`视频`:`图片`,`生成中...`]})]}):n===`completed`&&e.videoUrl||e.imageUrl?(0,$.jsxs)(`div`,{style:{borderRadius:12,overflow:`hidden`,border:`1px solid #f0f0f5`,position:`relative`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:10,right:10,zIndex:10},children:(0,$.jsx)(gw,{title:`下载${a===`video`?`视频`:`图片`}`,children:(0,$.jsx)(X,{size:`small`,icon:(0,$.jsx)(m0,{}),onClick:()=>{let t=document.createElement(`a`);t.href=`http://ceshi.apiforeign.minzhong.cn${a===`video`?e.videoUrl:e.imageUrl}&download=1`,t.download=`${e.projectName}${a===`video`?`.mp4`:`.png`}`,t.click()},style:{background:`rgba(0,0,0,0.5)`,border:`none`,color:`#fff`,backdropFilter:`blur(4px)`,borderRadius:8},children:`下载`})})}),(0,$.jsx)(`div`,{style:{minHeight:180,overflow:`hidden`},children:a===`video`?(0,$.jsx)(`video`,{src:`http://ceshi.apiforeign.minzhong.cn${e.videoUrl}`,controls:!0,preload:`metadata`,style:{width:`100%`,height:`400px`,borderRadius:0}}):(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn${e.imageUrl}`,alt:e.projectName,style:{width:`100%`,maxHeight:`400px`,objectFit:`contain`,borderRadius:0}})}),(0,$.jsxs)(`div`,{style:{padding:`8px 12px`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,background:`#fafbff`},children:[(0,$.jsxs)(sH,{children:[a===`video`?(0,$.jsx)(t5,{style:{color:`#6366f1`,fontSize:13}}):(0,$.jsx)(R6,{style:{color:`#6366f1`,fontSize:13}}),(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#475569`},children:e.projectName})]}),e.generatedAt&&(0,$.jsx)(`span`,{className:`date-display`,translate:`no`,style:{fontSize:11,color:`#94a3b8`},children:T7(e.generatedAt)})]})]}):n===`failed`?(0,$.jsxs)(`div`,{style:{height:`100%`,minHeight:180,borderRadius:12,background:`rgba(239,68,68,0.03)`,border:`1px dashed rgba(239,68,68,0.2)`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:10,padding:16},children:[(0,$.jsx)(m4,{style:{color:`#ef4444`,fontSize:28}}),(0,$.jsxs)(Q.Text,{style:{color:`#ef4444`,fontSize:14,fontWeight:600},children:[a===`video`?`视频`:`图片`,`生成失败`]}),e.errorMessage&&(0,$.jsx)(Q.Text,{style:{color:`#ef4444`,fontSize:12,textAlign:`center`,lineHeight:1.6},children:e.errorMessage})]}):(0,$.jsxs)(`div`,{style:{height:`100%`,minHeight:180,borderRadius:12,background:`#f8f9fc`,border:`1px dashed #e2e8f0`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:10},children:[(0,$.jsx)(cV,{style:{color:`#94a3b8`,fontSize:28}}),(0,$.jsx)(Q.Text,{style:{color:`#94a3b8`,fontSize:13},children:a===`image`?`待生成图片`:n===`prompt_optimized`?`待配置视频参数`:`待生成视频`})]})]})]})})]},e.id)})})]}),(0,$.jsx)(mK,{open:!!pe,onCancel:()=>me(null),footer:null,width:480,centered:!0,destroyOnHidden:!0,closable:!1,title:null,styles:{body:{padding:0,background:`#000`,position:`relative`}},children:pe&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`video`,{src:pe,controls:!0,autoPlay:!0,style:{width:`100%`,display:`block`,maxHeight:`70vh`}}),(0,$.jsx)(`div`,{onClick:()=>me(null),style:{position:`absolute`,top:8,right:8,width:28,height:28,borderRadius:`50%`,background:`rgba(0,0,0,0.6)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,zIndex:10,transition:`background 0.15s`},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(0,0,0,0.85)`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(0,0,0,0.6)`},children:(0,$.jsx)(c5,{style:{color:`#fff`,fontSize:16}})})]})})]})},B7={optimizing:{color:`processing`,text:`优化中`,icon:(0,$.jsx)(Xm,{spin:!0})},prompt_optimized:{color:`processing`,text:`待生成`,icon:(0,$.jsx)(cV,{})},generating:{color:`warning`,text:`生成中`,icon:(0,$.jsx)(Xm,{spin:!0})},completed:{color:`success`,text:`已完成`,icon:(0,$.jsx)(d4,{})},failed:{color:`error`,text:`失败`,icon:(0,$.jsx)(m4,{})}},_oe=()=>{let e=Ye(),{records:t,projects:n,fetchRecords:r,fetchProjects:i,generateVideo:a}=C7(),o=t.items,[s,c]=(0,S.useState)(1),[l,u]=(0,S.useState)(10),[d,f]=(0,S.useState)({}),[p,m]=(0,S.useState)(void 0),[h,g]=(0,S.useState)(void 0),[_,v]=(0,S.useState)({}),[y,b]=(0,S.useState)(null),[x,C]=(0,S.useState)(null),[w,T]=(0,S.useState)(null);(0,S.useEffect)(()=>{i()},[i]),(0,S.useEffect)(()=>{r({projectId:p,status:h,page:s,pageSize:l})},[r,p,h,s,l]);let E=async()=>{if(!w)return;let{recordId:e,projectName:t,ratio:n,resolution:r}=w;f(t=>({...t,[e]:!0})),T(null),Z.loading({content:`「${t}」正在生成视频...`,duration:0,key:e});try{await a(e,{aspectRatio:n,resolution:r}),Z.success({content:`「${t}」视频生成成功!`,key:e,duration:3})}catch{Z.error({content:`「${t}」视频生成失败`,key:e,duration:3})}finally{f(t=>({...t,[e]:!1}))}},D=e=>{if((e.genType||`image`)===`image`){f(t=>({...t,[e.id]:!0})),Z.loading({content:`「${e.projectName}」正在生成图片...`,duration:0,key:e.id}),a(e.id,{}).then(()=>{Z.success({content:`「${e.projectName}」图片生成成功!`,key:e.id,duration:3})}).catch(()=>{Z.error({content:`「${e.projectName}」图片生成失败`,key:e.id,duration:3})}).finally(()=>{f(t=>({...t,[e.id]:!1}))});return}T({recordId:e.id,projectName:e.projectName,ratio:e.aspectRatio||`16:9`,resolution:e.resolution||`720p`})},O=o;return(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:20,padding:`16px 24px`,borderRadius:16,background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,border:`1px solid rgba(99, 102, 241, 0.08)`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16},children:[(0,$.jsx)(X,{icon:(0,$.jsx)(b2,{}),onClick:()=>e(`/projects`),style:{borderRadius:10,fontSize:13,height:32,background:`rgba(99, 102, 241, 0.1)`,border:`1px solid rgba(99, 102, 241, 0.2)`,color:`#6366f1`},children:`返回`}),(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #6366f1, #8b5cf6, transparent)`,borderRadius:1}}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Title,{level:2,style:{margin:0,fontSize:16,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`项目记录`}),(0,$.jsx)(Q.Text,{style:{fontSize:13,color:`#64748b`},children:`查看所有视频生成记录,点击记录查看完整内容和视频`})]}),(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #8b5cf6, #6366f1, transparent)`,borderRadius:1}})]})}),(0,$.jsxs)(`div`,{className:`record-filter-bar animate-fadeInUp`,style:{display:`flex`,gap:12,marginBottom:20,padding:`14px 20px`,borderRadius:14,background:`#fff`,border:`1px solid #f0f0f5`},children:[(0,$.jsxs)(sH,{children:[(0,$.jsx)(n3,{style:{color:`#94a3b8`}}),(0,$.jsx)(EC,{placeholder:`全部项目`,allowClear:!0,style:{width:200},onChange:e=>{m(e),c(1)},children:n.map(e=>(0,$.jsx)(EC.Option,{value:e.id,children:e.name},e.id))}),(0,$.jsxs)(EC,{placeholder:`全部状态`,allowClear:!0,style:{width:140},onChange:e=>{g(e),c(1)},children:[(0,$.jsx)(EC.Option,{value:`prompt_optimized`,children:`待生成`}),(0,$.jsx)(EC.Option,{value:`generating`,children:`生成中`}),(0,$.jsx)(EC.Option,{value:`completed`,children:`已完成`}),(0,$.jsx)(EC.Option,{value:`failed`,children:`失败`})]})]}),(0,$.jsxs)(Q.Text,{style:{marginLeft:`auto`,lineHeight:`32px`,color:`#94a3b8`,fontSize:13},children:[`共 `,t.total,` 条记录`]})]}),O.length===0?(0,$.jsx)(XS,{image:XS.PRESENTED_IMAGE_SIMPLE,description:`暂无生成记录`,style:{padding:60}}):(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},className:`stagger-children`,children:O.map((e,t)=>{let n=y===e.id,r=_[e.id]??e.optimizedPrompt,i=d[e.id],a=x===e.id,o=e.genType||`image`;return(0,$.jsxs)(`div`,{className:`animate-slideInCard`,style:{animationDelay:`${t*.04}s`},children:[(0,$.jsxs)(`div`,{className:`record-item`,onClick:()=>C(a?null:e.id),style:{padding:`14px 20px`,borderRadius:a?`14px 14px 0 0`:14,background:`#fff`,border:`1px solid #f0f0f5`,cursor:`pointer`,transition:`all 0.2s`,display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:28,height:28,borderRadius:8,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,background:o===`image`?`#fef3c7`:`#dbeafe`},children:o===`image`?(0,$.jsx)(R6,{style:{color:`#d97706`,fontSize:12}}):(0,$.jsx)(t5,{style:{color:`#2563eb`,fontSize:12}})}),a?(0,$.jsx)(YZ,{style:{color:`#6366f1`,fontSize:12,flexShrink:0}}):(0,$.jsx)(c4,{style:{color:`#cbd5e1`,fontSize:12,flexShrink:0}}),(0,$.jsx)(XQ,{color:B7[e.status].color,icon:B7[e.status].icon,style:{margin:0},children:B7[e.status].text}),(0,$.jsx)(XQ,{style:{background:`#f0f0ff`,border:`none`,color:`#6366f1`,margin:0},children:e.projectName}),(0,$.jsx)(Q.Text,{style:{flex:1,fontSize:13,color:`#475569`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:r}),o===`image`?(0,$.jsxs)(`span`,{className:`mobile-meta`,translate:`no`,style:{fontSize:12,color:`#94a3b8`,flexShrink:0},children:[e.duration?`${e.imageSize}`:`-`,` · `,e.imageProportion||`-`,` · `,e.imagePx||`-`,` · `,(0,$.jsx)(`span`,{className:`date-display`,translate:`no`,children:T7(e.createdAt)})]}):(0,$.jsxs)(`span`,{className:`mobile-meta`,translate:`no`,style:{fontSize:12,color:`#94a3b8`,flexShrink:0},children:[e.duration?`${e.duration}秒`:`-`,` · `,e.aspectRatio||`-`,` · `,e.resolution||`-`,` · `,(0,$.jsx)(`span`,{className:`date-display`,translate:`no`,children:T7(e.createdAt)})]}),(0,$.jsx)(`div`,{className:`record-actions`,onClick:e=>e.stopPropagation(),children:(0,$.jsxs)(sH,{children:[e.status===`prompt_optimized`&&(0,$.jsx)(X,{type:`primary`,size:`small`,icon:(0,$.jsx)(q6,{}),loading:i,onClick:()=>D(e),style:{borderRadius:8,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`},children:`生成`}),e.status===`generating`&&(0,$.jsx)(XQ,{color:`processing`,icon:(0,$.jsx)(Xm,{spin:!0}),style:{padding:`4px 12px`,fontSize:12},children:`生成中...`}),e.status===`failed`&&(0,$.jsx)(X,{type:`primary`,danger:!0,size:`small`,icon:(0,$.jsx)(q6,{}),loading:i,onClick:()=>D(e),style:{borderRadius:8},children:`重试`})]})})]}),a&&(0,$.jsx)(`div`,{style:{background:`#fff`,border:`1px solid #f0f0f5`,borderTop:`none`,borderRadius:`0 0 14px 14px`,padding:`20px 24px`,animation:`fadeInUp 0.25s ease both`},children:(0,$.jsxs)(`div`,{className:`gen-detail-row`,style:{display:`flex`,gap:24,flexWrap:`wrap`},children:[(0,$.jsxs)(`div`,{style:{flex:`1 1 50%`,minWidth:280},children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#94a3b8`,display:`block`,marginBottom:6},children:`原始提示词`}),(0,$.jsx)(`div`,{style:{padding:12,borderRadius:10,background:`#f8f9fc`,border:`1px solid #f0f0f5`},children:(0,$.jsx)(Q.Text,{style:{fontSize:13,color:`#64748b`,lineHeight:1.7},children:e.originalPrompt})})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:6},children:[(0,$.jsxs)(Q.Text,{style:{fontSize:12,color:`#94a3b8`},children:[`优化后的提示词 `,e.status===`prompt_optimized`&&(0,$.jsx)(`span`,{style:{color:`#6366f1`},children:`(可编辑)`})]}),!n&&(0,$.jsxs)(sH,{size:4,children:[(0,$.jsx)(gw,{title:`复制`,children:(0,$.jsx)(X,{type:`text`,size:`small`,icon:(0,$.jsx)(t1,{}),onClick:async()=>{let e=await k7(r);Z.success(e?`已复制`:`复制失败`)},style:{color:`#94a3b8`}})}),e.status===`prompt_optimized`&&(0,$.jsx)(gw,{title:`编辑`,children:(0,$.jsx)(X,{type:`text`,size:`small`,icon:(0,$.jsx)(M$,{}),onClick:()=>{b(e.id),v(t=>({...t,[e.id]:t[e.id]??e.optimizedPrompt}))},style:{color:`#6366f1`}})})]})]}),n?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(IW.TextArea,{value:r,onChange:t=>v(n=>({...n,[e.id]:t.target.value})),rows:4,style:{borderRadius:10,fontSize:13,lineHeight:1.7,border:`1px solid rgba(99,102,241,0.25)`,background:`rgba(99,102,241,0.02)`}}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:8,marginTop:8},children:[(0,$.jsx)(X,{size:`small`,onClick:()=>b(null),children:`取消`}),(0,$.jsx)(X,{size:`small`,type:`primary`,onClick:()=>{v(t=>({...t,[e.id]:r})),b(null),Z.success(`提示词已更新`)},style:{borderRadius:6,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`},children:`保存`})]})]}):(0,$.jsx)(`div`,{style:{padding:12,borderRadius:10,background:`rgba(99,102,241,0.02)`,border:`1px solid rgba(99,102,241,0.1)`},children:(0,$.jsx)(Q.Text,{style:{fontSize:13,color:`#1a1a2e`,lineHeight:1.7},children:r})})]}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:16,padding:`12px 16px`,borderRadius:10,background:`#f8f9fc`},children:o===`image`?[{label:`分辨率`,value:e.imageSize?`${e.imageSize} `:`-`},{label:`画面比例`,value:e.imageProportion?`${e.imageProportion} `:`-`},{label:`画面尺寸`,value:e.imageProportion?`${e.imageProportion} `:`-`},{label:`消耗积分`,value:e.creditsCost?`${e.creditsCost} `:`-`,highlight:!!e.creditsCost}].map((e,t)=>(0,$.jsxs)(`div`,{style:{flex:1},children:[(0,$.jsx)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:e.label}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:14,color:e.highlight?`#6366f1`:`#1a1a2e`},children:e.value})]},t)):[{label:`时长`,value:e.duration?`${e.duration} 秒`:`-`},{label:`画面比例`,value:e.aspectRatio||(e.status===`prompt_optimized`?`待选择`:`-`)},{label:`分辨率`,value:e.resolution||(e.status===`prompt_optimized`?`待选择`:`-`)},{label:`消耗积分`,value:e.creditsCost?`${e.creditsCost}`:`-`,highlight:!!e.creditsCost}].map((e,t)=>(0,$.jsxs)(`div`,{style:{flex:1},children:[(0,$.jsx)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:e.label}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:14,color:e.highlight?`#6366f1`:`#1a1a2e`},children:e.value})]},t))}),e.status===`prompt_optimized`&&(0,$.jsx)(`div`,{style:{marginTop:16,display:`flex`,justifyContent:`flex-end`},children:(0,$.jsx)(X,{type:`primary`,size:`large`,icon:(0,$.jsx)(d8,{}),loading:i,onClick:()=>D(e),style:{borderRadius:12,fontWeight:600,height:44,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,boxShadow:`0 8px 24px rgba(99,102,241,0.3)`},children:o===`video`?`选择参数生成视频`:`生成图片`})}),e.status===`failed`&&(0,$.jsx)(`div`,{style:{marginTop:16,display:`flex`,justifyContent:`flex-end`},children:(0,$.jsxs)(X,{type:`primary`,danger:!0,size:`large`,icon:(0,$.jsx)(q6,{}),loading:i,onClick:()=>D(e),style:{borderRadius:12,fontWeight:600,height:44},children:[`重新生成`,o===`video`?`视频`:`图片`]})})]}),(0,$.jsx)(`div`,{style:{flex:`1 1 40%`,minWidth:240},children:e.status===`generating`?(0,$.jsxs)(`div`,{style:{height:`100%`,minHeight:200,borderRadius:14,background:`linear-gradient(135deg, rgba(99,102,241,0.04), rgba(139,92,246,0.04))`,border:`1px dashed rgba(99,102,241,0.2)`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:12},children:[(0,$.jsx)(Xm,{style:{color:`#6366f1`,fontSize:32},spin:!0}),(0,$.jsxs)(Q.Text,{style:{color:`#94a3b8`,fontSize:14},children:[o===`video`?`视频`:`图片`,`生成中...`]}),(0,$.jsx)(Q.Text,{style:{color:`#cbd5e1`,fontSize:12},children:`请耐心等待,生成完成后将自动展示`})]}):e.status===`completed`&&(e.videoUrl||e.imageUrl)?(0,$.jsxs)(`div`,{style:{borderRadius:14,overflow:`hidden`,border:`1px solid #f0f0f5`,position:`relative`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:10,right:10,zIndex:10},children:(0,$.jsx)(gw,{title:`下载${o===`video`?`视频`:`图片`}`,children:(0,$.jsx)(X,{size:`small`,icon:(0,$.jsx)(m0,{}),onClick:()=>{let t=document.createElement(`a`);t.href=`http://ceshi.apiforeign.minzhong.cn${o===`video`?e.videoUrl:e.imageUrl}&download=1`,t.download=`${e.projectName}${o===`video`?`.mp4`:`.png`}`,t.click()},style:{background:`rgba(0,0,0,0.5)`,border:`none`,color:`#fff`,backdropFilter:`blur(4px)`,borderRadius:8},children:`下载`})})}),(0,$.jsx)(`div`,{style:{minHeight:280,overflow:`hidden`},children:o===`video`?(0,$.jsx)(`video`,{src:`http://ceshi.apiforeign.minzhong.cn${e.videoUrl}`,controls:!0,preload:`metadata`,style:{width:`100%`,height:`400px`,display:`block`}}):(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn${e.imageUrl}`,alt:e.projectName,style:{width:`100%`,maxHeight:`400px`,objectFit:`contain`,display:`block`}})}),(0,$.jsxs)(`div`,{style:{padding:`10px 14px`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,background:`#fafbff`},children:[(0,$.jsxs)(sH,{children:[o===`video`?(0,$.jsx)(t5,{style:{color:`#6366f1`}}):(0,$.jsx)(R6,{style:{color:`#6366f1`}}),(0,$.jsx)(Q.Text,{style:{fontSize:13,color:`#475569`},children:e.projectName})]}),e.generatedAt&&(0,$.jsxs)(`span`,{className:`date-display`,translate:`no`,style:{fontSize:12,color:`#94a3b8`},children:[`生成于 `,T7(e.generatedAt)]})]})]}):e.status===`failed`?(0,$.jsxs)(`div`,{style:{height:`100%`,minHeight:200,borderRadius:14,background:`rgba(239,68,68,0.03)`,border:`1px dashed rgba(239,68,68,0.2)`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:12},children:[(0,$.jsx)(m4,{style:{color:`#ef4444`,fontSize:32}}),(0,$.jsxs)(Q.Text,{style:{color:`#ef4444`,fontSize:14},children:[o===`video`?`视频`:`图片`,`生成失败`]}),(0,$.jsx)(Q.Text,{style:{color:`#94a3b8`,fontSize:12},children:`请在左侧点击重新生成`})]}):(0,$.jsxs)(`div`,{style:{height:`100%`,minHeight:200,borderRadius:14,background:`#f8f9fc`,border:`1px dashed #e2e8f0`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:12},children:[(0,$.jsx)(cV,{style:{color:`#94a3b8`,fontSize:32}}),(0,$.jsxs)(Q.Text,{style:{color:`#94a3b8`,fontSize:14},children:[`待生成`,o===`video`?`视频`:`图片`]}),(0,$.jsx)(Q.Text,{style:{color:`#cbd5e1`,fontSize:12},children:`点击左侧生成按钮开始生成`})]})})]})})]},e.id)})}),t.total>0&&(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,marginTop:18},children:(0,$.jsx)(SG,{current:t.page||s,pageSize:t.pageSize||l,total:t.total,showSizeChanger:!0,showTotal:e=>`共 ${e} 条记录`,onChange:(e,t)=>{c(e),u(t)}})}),(0,$.jsx)(mK,{title:(0,$.jsxs)(sH,{children:[(0,$.jsx)(d8,{}),`生成视频`]}),open:!!w,onCancel:()=>T(null),onOk:E,okText:`提交生成`,cancelText:`取消`,width:420,children:w&&(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:16,marginTop:16},children:(()=>{let e=o.find(e=>e.id===w.recordId);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{padding:12,borderRadius:10,background:`#f8f9fc`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:11,color:`#94a3b8`,display:`block`},children:`时长`}),(0,$.jsxs)(Q.Text,{strong:!0,children:[e?.duration||5,`秒`]})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#64748b`,display:`block`,marginBottom:6},children:`画面比例`}),(0,$.jsx)(EC,{value:w.ratio,onChange:e=>T(t=>t?{...t,ratio:e}:null),style:{width:`100%`},options:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`].map(e=>({value:e,label:e}))})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#64748b`,display:`block`,marginBottom:6},children:`分辨率`}),(0,$.jsx)(EC,{value:w.resolution,onChange:e=>T(t=>t?{...t,resolution:e}:null),style:{width:`100%`},options:[`480p`,`720p`,`1080p`].map(e=>({value:e,label:e}))})]})]})})()})})]})},V7=({value:e,duration:t=1200})=>{let[n,r]=(0,S.useState)(0),i=(0,S.useRef)(0);return(0,S.useEffect)(()=>{let a=n,o=e-a;if(o===0)return;let s=performance.now(),c=e=>{let n=e-s,l=Math.min(n/t,1);r(a+o*(1-(1-l)**3)),l<1&&(i.current=requestAnimationFrame(c))};return i.current=requestAnimationFrame(c),()=>cancelAnimationFrame(i.current)},[e]),(0,$.jsx)($.Fragment,{children:n.toLocaleString()})},voe=()=>{let{user:e}=_7(),[t,n]=(0,S.useState)([]),[r,i]=(0,S.useState)(!1),[a,o]=(0,S.useState)(1),[s,c]=(0,S.useState)(10),[l,u]=(0,S.useState)(0);(0,S.useEffect)(()=>{(async()=>{i(!0);let e=await A5(a,s);n(e.records),u(e.total),i(!1)})()},[a,s]);let d=(e,t)=>{o(e),c(t)},f=t.filter(e=>e.type===`recharge`).reduce((e,t)=>e+t.amount,0),p=t.filter(e=>e.type===`consume`).reduce((e,t)=>e+Math.abs(t.amount),0);return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(Yq,{gutter:[16,16],style:{marginBottom:24},children:[(0,$.jsx)(JR,{xs:24,sm:8,children:(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{borderRadius:16,padding:24,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,position:`relative`,overflow:`hidden`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,right:-20,top:-20,width:120,height:120,borderRadius:`50%`,background:`rgba(255,255,255,0.1)`}}),(0,$.jsxs)(`div`,{style:{position:`relative`},children:[(0,$.jsxs)(sH,{style:{marginBottom:10},children:[(0,$.jsx)(r5,{style:{color:`rgba(255,255,255,0.8)`,fontSize:16}}),(0,$.jsx)(`span`,{style:{color:`rgba(255,255,255,0.8)`,fontSize:14},children:`当前可用积分`})]}),(0,$.jsx)(`div`,{style:{color:`#fff`,fontSize:38,fontWeight:800,lineHeight:1},children:(0,$.jsx)(V7,{value:e?.credits??0})})]})]})}),(0,$.jsx)(JR,{xs:12,sm:8,children:(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{borderRadius:16,padding:24,background:`#fff`,border:`1px solid #f0f0f5`,animationDelay:`0.06s`},children:[(0,$.jsxs)(sH,{style:{marginBottom:10},children:[(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:8,background:`rgba(16,185,129,0.1)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(E2,{style:{color:`#10b981`,fontSize:14}})}),(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:14},children:`累计获得`})]}),(0,$.jsx)(`div`,{style:{color:`#10b981`,fontSize:28,fontWeight:800},children:(0,$.jsx)(V7,{value:f})})]})}),(0,$.jsx)(JR,{xs:12,sm:8,children:(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{borderRadius:16,padding:24,background:`#fff`,border:`1px solid #f0f0f5`,animationDelay:`0.12s`},children:[(0,$.jsxs)(sH,{style:{marginBottom:10},children:[(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:8,background:`rgba(239,68,68,0.1)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(_2,{style:{color:`#ef4444`,fontSize:14}})}),(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:14},children:`累计消耗`})]}),(0,$.jsx)(`div`,{style:{color:`#ef4444`,fontSize:28,fontWeight:800},children:(0,$.jsx)(V7,{value:p})})]})})]}),(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{animationDelay:`0.15s`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12},children:[(0,$.jsx)(W8,{style:{color:`#6366f1`,fontSize:16}}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:16},children:`积分明细`})]}),(0,$.jsx)(`div`,{style:{borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,overflow:`hidden`},children:(0,$.jsx)(LQ,{columns:[{title:`类型`,dataIndex:`type`,key:`type`,width:100,render:e=>(0,$.jsx)(XQ,{color:e===`recharge`?`green`:`orange`,icon:e===`recharge`?(0,$.jsx)(E2,{}):(0,$.jsx)(_2,{}),children:e===`recharge`?`充值`:`消费`})},{title:`积分变动`,dataIndex:`amount`,key:`amount`,width:120,render:e=>(0,$.jsxs)(Q.Text,{strong:!0,style:{color:e>0?`#10b981`:`#ef4444`,fontSize:15},children:[e>0?`+`:``,e]})},{title:`说明`,dataIndex:`description`,key:`description`},{title:`时间`,dataIndex:`createdAt`,key:`createdAt`,width:160,render:e=>(0,$.jsx)(`span`,{className:`date-display`,translate:`no`,style:{color:`#94a3b8`},children:T7(e)})}],dataSource:t,rowKey:`id`,loading:r,pagination:{current:a,pageSize:s,total:l,onChange:d,showSizeChanger:!0,showTotal:e=>`共 ${e} 条`},scroll:{x:500}})})]})]})},yoe=()=>{let[e,t]=(0,S.useState)(!0),[n,r]=(0,S.useState)([]),[i,a]=(0,S.useState)(0),[o,s]=(0,S.useState)(0),[c,l]=(0,S.useState)(1),[u]=(0,S.useState)(10);(0,S.useEffect)(()=>{d()},[c]);let d=async()=>{t(!0);try{let e=await A5(c,u);r(e.records||[]),a(e.credits||0),s(e.total||0)}catch{r([])}t(!1)};return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(Yq,{gutter:[16,16],style:{marginBottom:24},children:[(0,$.jsx)(JR,{xs:24,sm:8,children:(0,$.jsxs)(`div`,{style:{borderRadius:16,padding:24,background:`linear-gradient(135deg, #f59e0b 0%, #ea580c 100%)`,position:`relative`,overflow:`hidden`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,right:-20,top:-20,width:120,height:120,borderRadius:`50%`,background:`rgba(255,255,255,0.1)`}}),(0,$.jsxs)(`div`,{style:{position:`relative`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:10},children:[(0,$.jsx)(r5,{style:{color:`rgba(255,255,255,0.8)`,fontSize:16}}),(0,$.jsx)(`span`,{style:{color:`rgba(255,255,255,0.8)`,fontSize:14},children:`可用积分`})]}),(0,$.jsx)(`div`,{style:{color:`#fff`,fontSize:38,fontWeight:800,lineHeight:1},children:i.toLocaleString()})]})]})}),(0,$.jsx)(JR,{xs:12,sm:8,children:(0,$.jsxs)(`div`,{style:{borderRadius:16,padding:24,background:`#fff`,border:`1px solid #f0f0f5`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:10},children:[(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:8,background:`rgba(16,185,129,0.1)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(X6,{style:{color:`#10b981`,fontSize:14}})}),(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:14},children:`累计获得`})]}),(0,$.jsx)(`div`,{style:{color:`#10b981`,fontSize:28,fontWeight:800},children:n.filter(e=>e.amount>0).reduce((e,t)=>e+t.amount,0).toLocaleString()})]})}),(0,$.jsx)(JR,{xs:12,sm:8,children:(0,$.jsxs)(`div`,{style:{borderRadius:16,padding:24,background:`#fff`,border:`1px solid #f0f0f5`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:10},children:[(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:8,background:`rgba(239,68,68,0.1)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(W8,{style:{color:`#ef4444`,fontSize:14}})}),(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:14},children:`累计消耗`})]}),(0,$.jsx)(`div`,{style:{color:`#ef4444`,fontSize:28,fontWeight:800},children:n.filter(e=>e.amount<0).reduce((e,t)=>e+Math.abs(t.amount),0).toLocaleString()})]})})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12},children:[(0,$.jsx)(W8,{style:{color:`#f59e0b`,fontSize:16}}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:16},children:`积分明细`})]}),(0,$.jsx)(`div`,{style:{borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,overflow:`hidden`},children:(0,$.jsx)(UG,{spinning:e,children:n.length===0?(0,$.jsx)(XS,{description:(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`暂无积分变动记录`})}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(LQ,{dataSource:n,columns:[{title:`变动类型`,dataIndex:`type`,key:`type`,width:120,render:e=>{let t={recharge:{color:`#10b981`,label:`充值`,bg:`rgba(16,185,129,0.1)`},consume:{color:`#ef4444`,label:`消费`,bg:`rgba(239,68,68,0.1)`},admin:{color:`#f59e0b`,label:`管理员调整`,bg:`rgba(245,158,11,0.1)`},refund:{color:`#8b5cf6`,label:`退款`,bg:`rgba(139,92,246,0.1)`},team_internal:{color:`#0958d9`,label:`团队内部`,bg:`rgba(139,92,246,0.1)`}}[e]||{color:`#64748b`,label:e,bg:`rgba(100,116,139,0.1)`};return(0,$.jsx)(XQ,{color:t.color,style:{background:t.bg,fontWeight:500,padding:`4px 12px`},children:t.label})}},{title:`描述`,dataIndex:`description`,key:`description`,ellipsis:!0},{title:`变动积分`,dataIndex:`amount`,key:`amount`,width:120,align:`right`,render:e=>(0,$.jsxs)(Q.Text,{strong:!0,style:{fontWeight:700,color:e>0?`#10b981`:`#ef4444`,fontSize:15},children:[e>0?`+`:``,e]})},{title:`创建时间`,key:`createdAt`,width:180,render:(e,t)=>{let n=t.created_at||t.createdAt||t.create_time||t.createTime;return n?new Date(n).toLocaleString(`zh-CN`):`-`}}],rowKey:`id`,pagination:!1,bordered:!1}),(0,$.jsx)(`div`,{style:{padding:`16px`,textAlign:`right`},children:(0,$.jsx)(SG,{current:c,pageSize:u,total:o,onChange:e=>{l(e)},size:`small`})})]})})})]})]})},boe=()=>{let[e,t]=(0,S.useState)(!0),[n,r]=(0,S.useState)([]),[i,a]=(0,S.useState)(0),[o,s]=(0,S.useState)(1),[c]=(0,S.useState)(10);(0,S.useEffect)(()=>{l()},[o]);let l=async()=>{t(!0);try{let e=await Bie(o,c);r(e.items||[]),a(e.total||0)}catch{r([])}t(!1)};return(0,$.jsx)(`div`,{children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12},children:[(0,$.jsx)(fH,{style:{color:`#0ea5e9`,fontSize:16}}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:16},children:`订单记录`}),(0,$.jsxs)(`span`,{style:{color:`#94a3b8`,fontSize:13},children:[`共 `,n.length,` 条记录`]})]}),(0,$.jsx)(`div`,{style:{borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,overflow:`hidden`},children:(0,$.jsx)(UG,{spinning:e,children:n.length===0?(0,$.jsx)(XS,{description:(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`暂无订单记录`})}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(LQ,{dataSource:n,columns:[{title:`订单号`,key:`orderNo`,width:200,render:(e,t)=>(0,$.jsx)(`span`,{style:{fontFamily:`monospace`,fontSize:13,color:`#64748b`},children:t.order_no||t.orderNo||t.id})},{title:`支付方式`,key:`paymentMethod`,width:100,render:(e,t)=>{let n=t.payment_method||t.paymentMethod||`wechat`,r={alipay:{icon:(0,$.jsx)(c2,{style:{fontSize:16}}),label:`支付宝`,color:`#1677ff`},wechat:{icon:(0,$.jsx)(o5,{style:{fontSize:16}}),label:`微信支付`,color:`#07c160`}},i=r[n]||r.wechat;return(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{color:i.color},children:i.icon}),(0,$.jsx)(`span`,{style:{fontSize:13,color:`#374151`},children:i.label})]})}},{title:`金额`,key:`amount`,width:100,align:`right`,render:(e,t)=>{let n=t.amount||t.total_amount||0;return(0,$.jsxs)(Q.Text,{strong:!0,style:{fontWeight:700,fontSize:14,color:`#1e293b`},children:[`¥`,n]})}},{title:`获得积分`,key:`credits`,width:100,align:`center`,render:(e,t)=>{let n=t.credits||t.credit_amount||0;return(0,$.jsx)(Q.Text,{strong:!0,style:{fontWeight:600,fontSize:14,color:`#f59e0b`},children:n})}},{title:`状态`,key:`status`,width:100,render:(e,t)=>{let n=t.status||`pending`,r={pending:{color:`#f59e0b`,label:`待支付`,bg:`rgba(245,158,11,0.1)`},paid:{color:`#10b981`,label:`已支付`,bg:`rgba(16,185,129,0.1)`},refunded:{color:`#94a3b8`,label:`已退款`,bg:`rgba(148,163,184,0.1)`},failed:{color:`#ef4444`,label:`支付失败`,bg:`rgba(239,68,68,0.1)`},cancelled:{color:`#64748b`,label:`已取消`,bg:`rgba(100,116,139,0.1)`},processing:{color:`#0ea5e9`,label:`处理中`,bg:`rgba(14,165,233,0.1)`}}[n]||{color:`#64748b`,label:n,bg:`rgba(100,116,139,0.1)`};return(0,$.jsx)(XQ,{color:r.color,style:{background:r.bg,fontWeight:500,padding:`4px 12px`},children:r.label})}},{title:`创建时间`,key:`createdAt`,width:180,render:(e,t)=>{let n=t.created_at||t.createdAt;return n?new Date(n).toLocaleString(`zh-CN`):`-`}},{title:`支付时间`,key:`paidAt`,width:180,render:(e,t)=>{let n=t.paid_at||t.paidAt;return n?new Date(n).toLocaleString(`zh-CN`):`-`}}],rowKey:`order_no`,pagination:!1,bordered:!1}),(0,$.jsx)(`div`,{style:{padding:`16px`,textAlign:`right`},children:(0,$.jsx)(SG,{current:o,pageSize:c,total:i,onChange:e=>{s(e)},size:`small`})})]})})})]})})},xoe=()=>{let[e,t]=(0,S.useState)(!0),[n,r]=(0,S.useState)([]),[i,a]=(0,S.useState)(0),[o,s]=(0,S.useState)(0),[c,l]=(0,S.useState)(1),[u]=(0,S.useState)(10);(0,S.useEffect)(()=>{d(),f()},[c]);let d=async()=>{t(!0);try{let e=await N5(c,u);r(e.items||[]),s(e.total||0)}catch{r([])}t(!1)},f=async()=>{try{a(await P5())}catch{a(0)}},p=async e=>{try{await F5(e),d(),f()}catch{}};return(0,$.jsx)(`div`,{children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12},children:[(0,$.jsx)(V2,{style:{color:`#6366f1`,fontSize:16}}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:16},children:`消息中心`}),(0,$.jsxs)(`span`,{style:{color:`#94a3b8`,fontSize:13},children:[`未读 `,i,` 条`]})]}),(0,$.jsx)(`div`,{style:{borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,overflow:`hidden`},children:(0,$.jsx)(UG,{spinning:e,children:n.length===0?(0,$.jsx)(XS,{description:(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`暂无消息`})}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(LQ,{dataSource:n,columns:[{title:`类型`,dataIndex:`type`,key:`type`,width:100,render:e=>{let t={system:{color:`#6366f1`,label:`系统`,bg:`rgba(99,102,241,0.1)`,icon:(0,$.jsx)(C8,{style:{fontSize:14}})},credit:{color:`#f59e0b`,label:`积分`,bg:`rgba(245,158,11,0.1)`,icon:(0,$.jsx)(r5,{style:{fontSize:14}})},promo:{color:`#8b5cf6`,label:`活动`,bg:`rgba(139,92,246,0.1)`,icon:(0,$.jsx)(m3,{style:{fontSize:14}})}},n=t[e]||t.system;return(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{color:n.color},children:n.icon}),(0,$.jsx)(`span`,{style:{fontSize:13,color:n.color,fontWeight:500},children:n.label})]})}},{title:`标题`,dataIndex:`title`,key:`title`,ellipsis:!0},{title:`内容`,dataIndex:`content`,key:`content`,ellipsis:!0},{title:`状态`,dataIndex:`isRead`,key:`isRead`,width:80,render:(e,t)=>e??t.is_read?(0,$.jsx)(XQ,{color:`gray`,style:{background:`rgba(148,163,184,0.1)`},children:`已读`}):(0,$.jsx)(XQ,{color:`purple`,style:{background:`rgba(139,92,246,0.1)`},children:`未读`})},{title:`创建时间`,dataIndex:`createdAt`,key:`createdAt`,width:160,render:e=>{if(!e)return`-`;let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/(1e3*60*60));if(r<1)return`刚刚`;if(r<24)return`${r}小时前`;let i=Math.floor(r/24);return i<7?`${i}天前`:t.toLocaleDateString(`zh-CN`)}},{title:`操作`,key:`action`,width:100,render:(e,t)=>t.isRead??t.is_read?null:(0,$.jsx)(X,{type:`text`,size:`small`,onClick:()=>p(t.id),style:{color:`#6366f1`},children:`标记已读`})}],rowKey:`id`,pagination:!1,bordered:!1}),(0,$.jsx)(`div`,{style:{padding:`16px`,textAlign:`right`},children:(0,$.jsx)(SG,{current:c,pageSize:u,total:o,onChange:e=>{l(e)},size:`small`})})]})})})]})})},H7=()=>{let[e]=On(),[t,n]=(0,S.useState)(`credits`);return(0,S.useEffect)(()=>{(e.get(`tab`)||`credits`)===`orders`?n(`orders`):n(`credits`)},[e]),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(TL,{activeKey:t,onChange:n,items:[{key:`credits`,label:`积分明细`},{key:`orders`,label:`订单记录`}],style:{marginBottom:24},size:`large`}),t===`credits`&&(0,$.jsx)(yoe,{}),t===`orders`&&(0,$.jsx)(boe,{})]})},Soe=(e,t)=>e<=1?6:e===2||e===4||e===3?3:2,Coe=e=>{let t=e.displayStatus||e.pipelineStage||e.status||`generating`;return{pending:`待处理`,queued:`排队中`,preparing:`准备中`,generating:`生成中`,creating_provider_task:`创建任务中`,waiting_remote:`等待生成`,polling:`轮询中`,result_ready:`结果就绪`,download_queued:`等待下载`,downloading:`下载中`,retry_waiting:`等待重试`,completed:`已完成`,failed:`生成失败`,download_failed:`下载失败`,deleted:`已删除`}[t]||t},U7=e=>{let t=e.displayStatus||e.pipelineStage||e.status;return!t||[`pending`,`queued`,`preparing`,`generating`,`creating_provider_task`,`waiting_remote`,`polling`,`result_ready`,`download_queued`,`downloading`,`retry_waiting`].includes(t)},woe=180,Toe=.6,W7=e=>{if(!e)return 0;let t=new Date(e).getTime();if(isNaN(t))return 0;let n=Math.max(0,(Date.now()-t)/1e3);return n>=woe?99:Math.min(99,n*Toe)},Eoe=({item:e,isPending:t,isCompleted:n,onAnimationComplete:r,onProgressChange:i})=>{let[a,o]=(0,S.useState)(0),[s,c]=(0,S.useState)(0),[l,u]=(0,S.useState)(!1),d=(0,S.useRef)(null);return(0,S.useEffect)(()=>{i&&i(s)},[s,i]),(0,S.useEffect)(()=>{let t=W7(e.createdAt);o(t),c(t)},[e]),(0,S.useEffect)(()=>{if(n&&!l){u(!0);return}if(!t&&!l){d.current&&=(clearInterval(d.current),null);return}return d.current=window.setInterval(()=>{let t=W7(e.createdAt);o(t),c(t)},1e3),()=>{d.current&&=(clearInterval(d.current),null)}},[e.createdAt,t,n,l,e.id]),(0,S.useEffect)(()=>{if(l){let e=s,t=Date.now(),n=()=>{let i=Date.now()-t,a=Math.min(i/800,1),o=1-(1-a)**3;c(e+(100-e)*o),a<1?requestAnimationFrame(n):setTimeout(()=>{r?.()},100)};requestAnimationFrame(n)}},[l,s,r]),!t&&!l?null:(0,$.jsx)(`div`,{style:{marginTop:4},children:(0,$.jsxs)(`div`,{style:{textAlign:`center`,fontSize:13,color:`#8b5cf6`,fontWeight:700,textShadow:`0 0 8px rgba(139, 92, 246, 0.3)`,transition:`all 0.3s ease-out`},children:[Math.round(s),`%`]})})},Doe=({task:e,onPreview:t,resolveUrl:n=e=>e||``})=>{let r=Math.max(1,Math.min(5,Number(e.generationCount||e.childItems?.length||1))),i=[...e.childItems||[]].sort((e,t)=>Number(e.generationIndex||0)-Number(t.generationIndex||0)),a=i.length>0?i:r>1?Array.from({length:r},(t,n)=>({id:`${e.id||`task`}-placeholder-${n+1}`,genType:e.genType,status:e.status,displayStatus:e.displayStatus,pipelineStage:e.pipelineStage,generationIndex:n+1,errorMessage:e.errorMessage,createdAt:e.createdAt})):[e],[o,s]=(0,S.useState)(new Set),[c,l]=(0,S.useState)(new Set),u=(0,S.useRef)(new Set);(0,S.useEffect)(()=>{let e=`gen-task-resource-grid-animations`;if(document.getElementById(e))return;let t=document.createElement(`style`);t.id=e,t.textContent=` + .gen-task-loading-bg { + position: relative; + overflow: hidden; + background: linear-gradient(135deg, #faf8ff 0%, #f5f3ff 100%); + } + .gen-task-loading-bg::before, + .gen-task-loading-bg::after, + .gen-task-loading-bg .gen-task-aurora-3 { + content: ''; + position: absolute; + border-radius: 50%; + filter: blur(30px); + pointer-events: none; + z-index: 0; + } + .gen-task-loading-bg::before { + width: 220px; + height: 220px; + background: radial-gradient(circle, rgba(139, 92, 246, 0.45) 0%, rgba(168, 85, 247, 0.25) 50%, transparent 100%); + animation: genTaskAurora1 6s linear infinite; + } + .gen-task-loading-bg::after { + width: 240px; + height: 240px; + background: radial-gradient(circle, rgba(168, 85, 247, 0.35) 0%, rgba(192, 132, 252, 0.2) 50%, transparent 100%); + animation: genTaskAurora2 7.5s linear infinite; + } + .gen-task-loading-bg .gen-task-aurora-3 { + width: 180px; + height: 180px; + background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.15) 50%, transparent 100%); + animation: genTaskAurora3 5s linear infinite; + } + .gen-task-loading-bg > * { position: relative; z-index: 1; } + @keyframes genTaskAurora1 { + 0% { transform: translate(-100px, -80px); } + 25% { transform: translate(100px, -60px); } + 50% { transform: translate(120px, 80px); } + 75% { transform: translate(-60px, 100px); } + 100% { transform: translate(-100px, -80px); } + } + @keyframes genTaskAurora2 { + 0% { transform: translate(120px, 100px); } + 25% { transform: translate(-80px, 120px); } + 50% { transform: translate(-100px, -60px); } + 75% { transform: translate(80px, -80px); } + 100% { transform: translate(120px, 100px); } + } + @keyframes genTaskAurora3 { + 0% { transform: translate(60px, -40px); } + 25% { transform: translate(-40px, 60px); } + 50% { transform: translate(40px, 100px); } + 75% { transform: translate(100px, -20px); } + 100% { transform: translate(60px, -40px); } + } + `,document.head.appendChild(t)},[]);let d=(e,t)=>{t>=100&&l(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n})};(0,S.useEffect)(()=>{a.slice(0,5).forEach((e,t)=>{let n=e.displayStatus||e.pipelineStage||e.status||`generating`,r=U7(e),i=!r&&n!==`failed`&&n!==`download_failed`&&n!==`deleted`,a=e.id||`${t}`;i&&!u.current.has(a)&&r===!1&&(u.current.add(a),s(e=>{let t=new Set(e);return t.add(a),t}))})},[a]);let f=e=>{s(t=>{let n=new Set(t);return n.delete(e),n})};return(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`grid`,gridTemplateColumns:`repeat(6, minmax(0, 1fr))`,gridAutoRows:`minmax(0, 1fr)`,gap:r>1?6:0},children:a.slice(0,5).map((r,i)=>{let s=r.displayStatus||r.pipelineStage||r.status||`generating`,l=n(`/static${r.imageUrl}&w=300&q=50`),u=n(r.videoUrl),p=n(`/static${r.videoCoverUrl}&w=300&q=50`),m=(r.genType||e.genType)===`video`,h=m?!!u:!!l,g=U7(r),_=!g&&s!==`failed`&&s!==`download_failed`&&s!==`deleted`,v=r.id||`${i}`,y=o.has(v);c.has(v);let b=_&&!y,x=y?`加载中`:Coe(r);return(0,$.jsxs)(`div`,{style:{gridColumn:`span ${Soe(a.length,i)}`,minWidth:0,minHeight:0,position:`relative`,overflow:`hidden`,borderRadius:a.length===1?12:8,background:`#ffffff`,border:`1px solid #E7EAF0`},children:[h&&s!==`deleted`&&s!==`failed`&&s!==`download_failed`&&b?(0,$.jsxs)(`button`,{type:`button`,onClick:()=>t(m?u:l,m?`video`:`image`),style:{width:`100%`,height:`100%`,border:0,padding:0,background:`transparent`,cursor:`pointer`,position:`relative`},children:[m?p?(0,$.jsx)(`img`,{src:p,alt:`生成结果${r.generationIndex||i+1}`,style:{width:`100%`,height:`100%`,objectFit:`contain`}}):(0,$.jsx)(`video`,{src:u,muted:!0,preload:`metadata`,style:{width:`100%`,height:`100%`,objectFit:`contain`}}):(0,$.jsx)(`img`,{src:l,alt:`生成结果${r.generationIndex||i+1}`,style:{width:`100%`,height:`100%`,objectFit:`contain`}}),m?(0,$.jsx)(W6,{style:{position:`absolute`,left:`50%`,top:`50%`,transform:`translate(-50%, -50%)`,fontSize:a.length>2?28:46,color:`rgba(255,255,255,.92)`,filter:`drop-shadow(0 4px 10px rgba(0,0,0,.28))`}}):null]}):(0,$.jsxs)(`div`,{className:g||y?`gen-task-loading-bg`:``,style:{width:`100%`,height:`100%`,minHeight:0,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:7,padding:8,textAlign:`center`},children:[g||y?(0,$.jsx)(`span`,{className:`gen-task-aurora-3`}):null,g||y?(0,$.jsx)(Xm,{spin:!0,style:{color:`#8b5cf6`,fontSize:a.length>2?20:34}}):(0,$.jsx)(nie,{style:{color:s===`deleted`?`#98A2B3`:`#A45B5B`,fontSize:a.length>2?20:34}}),(0,$.jsx)(`span`,{style:{fontSize:a.length>2?10:12,color:g||y?`#8b5cf6`:s===`deleted`?`#98A2B3`:`#A45B5B`,fontWeight:500},children:x}),(0,$.jsx)(Eoe,{item:r,isPending:g||y,isCompleted:_,onAnimationComplete:()=>f(v),onProgressChange:e=>d(v,e)}),!g&&r.errorMessage&&a.length<=2?(0,$.jsx)(`span`,{style:{fontSize:10,color:`#A45B5B`,lineHeight:1.3,maxHeight:28,overflow:`hidden`},children:r.errorMessage}):null]}),a.length>1?(0,$.jsxs)(`span`,{style:{position:`absolute`,top:5,left:5,zIndex:2,padding:`1px 6px`,borderRadius:10,background:`rgba(17,24,39,.58)`,color:`#fff`,fontSize:10},children:[`#`,r.generationIndex||i+1]}):null]},r.id||`${i}`)})})},{Text:G7}=Q,Ooe=({items:e,selectedId:t,onSelect:n})=>e.length?(0,$.jsx)(sH,{orientation:`vertical`,style:{width:`100%`},size:10,children:e.map(e=>{let r=t===e.id;return(0,$.jsxs)(`div`,{onClick:()=>n(e),style:{padding:14,borderRadius:14,cursor:`pointer`,border:r?`1px solid #8b5cf6`:`1px solid #e2e8f0`,background:r?`#f5f3ff`:`#fff`},children:[(0,$.jsx)(sH,{style:{width:`100%`,justifyContent:`space-between`},align:`start`,children:(0,$.jsxs)(`div`,{style:{minWidth:0},children:[(0,$.jsx)(G7,{strong:!0,ellipsis:!0,style:{display:`block`},children:e.name}),e.description&&(0,$.jsx)(G7,{type:`secondary`,ellipsis:!0,style:{display:`block`,fontSize:12},children:e.description})]})}),(0,$.jsxs)(sH,{wrap:!0,size:4,style:{marginTop:10},children:[(0,$.jsxs)(XQ,{children:[`总 `,e.assetCount||0]}),(0,$.jsxs)(XQ,{color:`green`,children:[`图 `,e.imageAssetCount||0]}),(0,$.jsxs)(XQ,{color:`blue`,children:[`视频 `,e.videoAssetCount||0]})]})]},e.id)})}):(0,$.jsx)(XS,{description:`暂无项目组`}),koe={Active:`green`,Processing:`processing`,Failed:`red`,local_deleted:`default`,remote_deleted:`default`,delete_failed:`red`},Aoe={Active:`入库成功`,Processing:`入库处理中`,Failed:`入库失败`,local_deleted:`本地已删除`,remote_deleted:`远程已删除`,delete_failed:`删除失败`},K7=e=>e?e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`data:`)||e.startsWith(`blob:`)?e:`${`http://ceshi.apiforeign.minzhong.cn`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`:``,q7=e=>e.assetType===`Video`?K7(e.videoCoverUrl||e.previewUrl||e.displayUrl||e.remoteUrl||e.sourceUrl):K7(e.previewUrl||e.displayUrl||e.videoCoverUrl||e.remoteUrl||e.sourceUrl),joe=e=>{let t=Number(e||0);return!Number.isFinite(t)||t<=0?`-`:`${t.toFixed(t>=10?0:1)}s`},Moe=({items:e,onDelete:t,onRefresh:n})=>{let r=(0,S.useRef)(null),[i,a]=(0,S.useState)(!1),[o,s]=(0,S.useState)(``),[c,l]=(0,S.useState)(`Image`);(0,S.useEffect)(()=>(e.some(e=>e.status!==`Failed`&&e.status!==`Active`)&&n?r.current||=window.setInterval(()=>{n()},3e3):r.current&&=(clearInterval(r.current),null),()=>{r.current&&=(clearInterval(r.current),null)}),[e,n]);let u=e=>{let t=q7(e);t&&(s(t),l(e.assetType===`Video`?`Video`:`Image`),a(!0))};return e.length?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(220px, 1fr))`,gap:14},children:e.map(e=>{let n=e.assetType===`Video`,r=q7(e);return(0,$.jsx)(DL,{hoverable:!0,bodyStyle:{padding:12},style:{borderRadius:16,overflow:`hidden`,borderColor:`#eef2f7`},cover:(0,$.jsxs)(`div`,{style:{height:170,background:`#f8fafc`,display:`flex`,alignItems:`center`,justifyContent:`center`,position:`relative`},children:[r?n&&e.videoCoverUrl?(0,$.jsx)(`img`,{src:r,alt:e.name||`视频封面`,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):n?(0,$.jsx)(`video`,{src:r,muted:!0,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(`img`,{src:r,alt:e.name||``,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):n?(0,$.jsx)(t5,{style:{fontSize:42,color:`#64748b`}}):(0,$.jsx)(R6,{style:{fontSize:42,color:`#64748b`}}),n&&(0,$.jsx)(XQ,{color:`blue`,style:{position:`absolute`,left:10,top:10},children:`视频`}),r&&(0,$.jsx)(X,{size:`small`,shape:`circle`,icon:(0,$.jsx)(mW,{}),style:{position:`absolute`,right:10,top:10},onClick:()=>u(e)}),n&&(0,$.jsx)(`div`,{style:{position:`absolute`,left:10,bottom:10,padding:`2px 6px`,borderRadius:8,background:`rgba(15,23,42,0.72)`,color:`#fff`,fontSize:12},children:joe(e.videoDuration)})]}),children:(0,$.jsxs)(sH,{direction:`vertical`,size:8,style:{width:`100%`},children:[(0,$.jsx)(gw,{title:e.name||e.remoteAssetId||e.id,children:(0,$.jsx)(`div`,{style:{fontWeight:600,color:`#1e293b`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:e.name||e.remoteAssetId||`未命名素材`})}),(0,$.jsxs)(sH,{wrap:!0,size:4,children:[(0,$.jsx)(XQ,{color:koe[e.status]||`default`,children:Aoe[e.status]||e.status}),(0,$.jsx)(XQ,{color:n?`blue`:`default`,children:n?`视频`:`图片`})]}),(0,$.jsx)(sH,{size:6,wrap:!0,children:(0,$.jsx)(vK,{title:`确认删除这个素材吗?`,onConfirm:()=>t(e.id),children:(0,$.jsx)(X,{size:`small`,danger:!0,icon:(0,$.jsx)(u$,{}),children:`删除`})})})]})},e.id)})}),(0,$.jsx)(mK,{title:`素材预览`,open:i,onCancel:()=>a(!1),footer:null,width:760,destroyOnClose:!0,children:(0,$.jsx)(`div`,{style:{minHeight:420,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`#0f172a`,borderRadius:12,overflow:`hidden`},children:c===`Video`?(0,$.jsx)(`video`,{src:o,controls:!0,autoPlay:!0,style:{maxWidth:`100%`,maxHeight:520}}):(0,$.jsx)(`img`,{src:o,alt:`素材预览`,style:{maxWidth:`100%`,maxHeight:520,objectFit:`contain`}})})})]}):(0,$.jsx)(XS,{description:`暂无素材`})},J7=(0,S.createContext)(void 0),Noe=({children:e,refreshConfig:t})=>(0,$.jsx)(J7.Provider,{value:{refreshConfig:t},children:e}),Y7=()=>{let e=(0,S.useContext)(J7);if(!e)throw Error(`useLibrary must be used within a LibraryProvider`);return e},X7=2,Z7=15,Poe=e=>new Promise(t=>{if(!e.type.startsWith(`video/`)){t(null);return}let n=URL.createObjectURL(e),r=document.createElement(`video`);r.preload=`metadata`,r.onloadedmetadata=()=>{let e=Number.isFinite(r.duration)?r.duration:null;URL.revokeObjectURL(n),t(e)},r.onerror=()=>{URL.revokeObjectURL(n),t(null)},r.src=n}),Foe=e=>e==null||!Number.isFinite(e)||e<=0?(Z.error(`无法读取视频秒数,请检查视频文件是否损坏`),!1):eZ7?(Z.error(`视频素材最长不能超过 ${Z7} 秒`),!1):!0,Ioe=({projectId:e,open:t,onClose:n,onSuccess:r})=>{let{refreshConfig:i}=Y7(),[a,o]=(0,S.useState)([]),[s,c]=(0,S.useState)({}),[l,u]=(0,S.useState)({}),[d,f]=(0,S.useState)({}),[p,m]=(0,S.useState)({}),[h,g]=(0,S.useState)(!1),_=()=>{o([]),c({}),u({}),f({}),m({})};return(0,$.jsx)(mK,{title:`上传真人素材`,open:t,onCancel:()=>{_(),n()},onOk:async()=>{let t=a.filter(e=>l[e.uid]===`uploaded`);if(t.length===0){Z.warning(`请等待文件上传完成后再提交入库`);return}g(!0);try{for(let n of t){let t=n.originFileObj;if(!t)continue;let r=d[n.uid];if(!r)continue;m(e=>({...e,[n.uid]:`importing`}));let i=t.type.startsWith(`image/`)?`Image`:`Video`;await Aae(e,{url:r.url,assetType:i,name:s[n.uid]?.trim()||t.name,videoDuration:r.duration_seconds,fileSize:r.file_size_bytes??t.size,mimeType:t.type||null,uploadResourceId:r.resource_id||null}),m(e=>({...e,[n.uid]:`imported`}))}Z.success(`已成功提交 ${t.length} 个素材入库,处理中`),i(),setTimeout(()=>{_(),r(),n()},1500)}catch(e){Z.error(e?.message||`提交入库失败`)}finally{g(!1)}},confirmLoading:h,okText:`提交入库`,destroyOnHidden:!0,width:650,okButtonProps:{disabled:a.length===0||a.some(e=>l[e.uid]!==`uploaded`)},children:(0,$.jsx)(`div`,{style:{maxHeight:600,overflow:`auto`,marginTop:30},children:(0,$.jsxs)(sH,{direction:`vertical`,style:{width:`100%`},size:14,children:[(0,$.jsx)(b0,{accept:`image/*,video/*`,fileList:a,multiple:!0,beforeUpload:async e=>{let t=`${Date.now()}-${Math.random().toString(36).substr(2,9)}`,n=e.type.startsWith(`image/`),r=URL.createObjectURL(e),i={uid:t,name:e.name,status:`uploading`,originFileObj:e,thumbUrl:r,type:e.type};o(e=>[...e,i]),c(e=>({...e,[t]:``})),u(e=>({...e,[t]:`uploading`}));try{let r=n?`Image`:`Video`,i=r===`Video`?await Poe(e):null;if(r===`Video`&&!Foe(i))return u(e=>({...e,[t]:`error`})),!1;let a=r===`Video`?await Eie(e,i||void 0):await Tie(e);f(e=>({...e,[t]:{url:a.url,duration_seconds:a.duration_seconds,file_size_bytes:a.file_size_bytes,resource_id:a.resource_id}})),u(e=>({...e,[t]:`uploaded`}))}catch{u(e=>({...e,[t]:`error`})),Z.error(`文件 ${e.name} 上传失败`)}return!1},listType:`picture`,itemRender:(e,t,n)=>{let r=t.type?.startsWith(`video/`)||t.name.match(/\.(mp4|mov|avi|webm)$/i),i=l[t.uid],a=p[t.uid];return(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,padding:12,border:`1px solid #e5e7eb`,borderRadius:8,marginBottom:8},children:[(0,$.jsx)(`div`,{style:{width:64,height:64,borderRadius:8,overflow:`hidden`,flexShrink:0},children:t.thumbUrl||t.url?r?(0,$.jsx)(`video`,{src:t.thumbUrl||t.url,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(`img`,{src:t.thumbUrl||t.url,alt:t.name,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,backgroundColor:`#f1f5f9`},children:r?(0,$.jsx)(t5,{style:{color:`#94a3b8`,fontSize:20}}):(0,$.jsx)(R6,{style:{color:`#94a3b8`,fontSize:20}})})}),(0,$.jsx)(`span`,{style:{width:`20%`,overflow:`hidden`,whiteSpace:`nowrap`,textOverflow:`ellipsis`,fontSize:13,color:`#64748b`,flexShrink:0},children:t.name}),(0,$.jsx)(IW,{style:{width:200,flexShrink:0},value:s[t.uid]||``,onChange:e=>c({...s,[t.uid]:e.target.value}),placeholder:`素材名称,默认使用文件名`,maxLength:256}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[i===`uploading`&&(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,$.jsx)(UG,{size:`small`,style:{color:`#6366f1`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#6366f1`},children:`上传中`})]}),i===`uploaded`&&!a&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#10b981`},children:`✓ 上传完成`}),i===`error`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#ef4444`},children:`✗ 上传失败`}),a===`importing`&&(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,$.jsx)(UG,{size:`small`,style:{color:`#6366f1`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#6366f1`},children:`入库中`})]}),a===`imported`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#10b981`},children:`✓ 已入库校验`}),a===`error`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#ef4444`},children:`✗ 入库失败`})]}),(0,$.jsx)(`button`,{onClick:e=>{e.stopPropagation(),o(e=>e.filter(e=>e.uid!==t.uid)),c(e=>{let n={...e};return delete n[t.uid],n}),u(e=>{let n={...e};return delete n[t.uid],n}),f(e=>{let n={...e};return delete n[t.uid],n}),m(e=>{let n={...e};return delete n[t.uid],n})},style:{width:28,height:28,borderRadius:`50%`,backgroundColor:`#f1f5f9`,border:`none`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0},children:(0,$.jsx)(u$,{style:{color:`#64748b`,fontSize:14}})})]})},children:(0,$.jsx)(X,{icon:(0,$.jsx)(X8,{}),children:`选择图片或视频`})}),(0,$.jsxs)(`div`,{style:{padding:12,background:`#f8fafc`,borderRadius:12,color:`#64748b`,fontSize:13},children:[`当前开放图片和视频,音频暂不接入。视频素材必须在 `,X7,`~`,Z7,` 秒内;入库后会经过火山真人一致性校验,入库校验成功 后才可用于 AI 创作。`]})]})})})},Loe=({project:e,onDeleted:t,onChanged:n})=>{let{refreshConfig:r}=Y7(),[i,a]=(0,S.useState)([]),[o,s]=(0,S.useState)(!1),[c,l]=(0,S.useState)(!1),[u,d]=(0,S.useState)(``),[f,p]=(0,S.useState)(),[m,h]=(0,S.useState)(),[g,_]=(0,S.useState)(1),[v,y]=(0,S.useState)(20),[b,x]=(0,S.useState)(0),C=async(t=g,n=v)=>{s(!0);try{let r=await jae(e.id,{page:t,pageSize:n,keyword:u,status:f,assetType:m});a(r.items),x(r.total||0),_(t),y(n)}catch(e){Z.error(e?.message||`加载素材失败`)}finally{s(!1)}};(0,S.useEffect)(()=>{C(1,v)},[e.id,u,f,m]);let w=async e=>{try{await Mae(e),await C(g,v),n(),r(),Z.success(`素材已删除`)}catch(e){Z.error(e?.message||`删除素材失败`)}},T=async()=>{try{await Oae(e.id),Z.success(`项目组已删除`),t()}catch(e){Z.error(e?.message||`删除项目组失败`)}},E=e.status===`active`;return(0,$.jsxs)(DL,{title:(0,$.jsx)(sH,{children:(0,$.jsx)(`span`,{children:e.name})}),extra:(0,$.jsxs)(sH,{children:[(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(X8,{}),disabled:!E,onClick:()=>l(!0),children:`上传素材`}),(0,$.jsx)(vK,{title:`确认删除这个真人素材项目组吗?`,onConfirm:T,children:(0,$.jsx)(X,{danger:!0,icon:(0,$.jsx)(u$,{}),children:`删除项目组`})})]}),style:{borderRadius:16},children:[!E&&(0,$.jsx)(Q.Paragraph,{style:{color:`#f97316`},children:`项目组未完成真人认证,暂不能上传素材。请重新创建项目组并完成手机扫码认证。`}),(0,$.jsxs)(sH,{style:{width:`100%`,marginBottom:16},wrap:!0,children:[(0,$.jsx)(IW.Search,{allowClear:!0,placeholder:`搜索素材名称`,value:u,onChange:e=>d(e.target.value),onSearch:()=>C(1,v),style:{width:240}}),(0,$.jsx)(EC,{allowClear:!0,placeholder:`素材状态`,value:f,onChange:e=>p(e),style:{width:150},options:[{value:`Processing`,label:`处理中`},{value:`Active`,label:`可用`},{value:`Failed`,label:`失败`}]}),(0,$.jsx)(EC,{allowClear:!0,placeholder:`素材类型`,value:m,onChange:e=>h(e),style:{width:130},options:[{value:`Image`,label:`图片`},{value:`Video`,label:`视频`}]}),(0,$.jsx)(X,{onClick:()=>C(1,v),children:`筛选`})]}),(0,$.jsx)(UG,{spinning:o,children:i.length===0?(0,$.jsx)(XS,{description:`暂无素材,上传图片/视频后会异步入库`,style:{marginTop:80}}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Moe,{items:i,loading:o,onDelete:w,onRefresh:()=>C(g,v)}),(0,$.jsx)(`div`,{style:{textAlign:`right`,marginTop:16},children:(0,$.jsx)(SG,{current:g,pageSize:v,total:b,showSizeChanger:!0,showTotal:e=>`共 ${e} 个素材`,onChange:(e,t)=>C(e,t)})})]})}),(0,$.jsx)(Ioe,{projectId:e.id,open:c,onClose:()=>l(!1),onSuccess:()=>{C(1,v),n()}})]})},Q7=`group_active`,$7=2e3,Roe=()=>{let[e,t]=(0,S.useState)([]),[n,r]=(0,S.useState)(null),[i,a]=(0,S.useState)(!1),[o,s]=(0,S.useState)(!1),[c,l]=(0,S.useState)(!1),[u,d]=(0,S.useState)(null),[f,p]=(0,S.useState)(null),[m,h]=(0,S.useState)(!1),[g]=tU.useForm(),_=(0,S.useRef)(null),v=()=>{_.current&&=(window.clearInterval(_.current),null)},y=()=>{v(),s(!1),l(!1),h(!1),d(null),p(null),g.resetFields()},b=async()=>{a(!0);try{let e=await m7({pageSize:100,status:`active`});t(e.items),r(t=>t?e.items.find(e=>e.id===t.id)||e.items[0]||null:e.items[0]||null)}catch(e){Z.error(e?.message||`加载真人素材项目组失败`)}finally{a(!1)}};(0,S.useEffect)(()=>{b()},[]),(0,S.useEffect)(()=>()=>v(),[]);let x=async e=>{v(),h(!1),Z.success(`真人认证完成,项目组已创建成功`),s(!1),p(null),d(null),g.resetFields();let n=await m7({pageSize:100,status:`active`});t(n.items),r(n.items.find(t=>t.id===e)||n.items[0]||null)},C=(e,t,n)=>{v(),h(!0);let r=async()=>{try{let n=await kae(e);if(p(n),n.status===Q7){await x(t);return}[`callback_failed`,`failed`,`expired`].includes(n.status)&&(v(),h(!1),Z.error(n.errorMessage||`真人认证未完成,请重新创建项目组`))}catch(e){v(),h(!1),Z.error(e?.message||`轮询真人认证状态失败`)}};_.current=window.setInterval(r,Math.max(1e3,n||$7)),r()},w=async()=>{let e=await g.validateFields();l(!0);try{let t=`${window.location.origin}/private-portrait-authorized`,n=await Dae({...e,callbackRedirectUrl:t});d(n.project),p(n.validateSession),Z.success(`请使用手机扫码完成人脸认证`),n.validateSession?.id&&C(n.validateSession.id,n.project.id,n.pollIntervalMs||$7)}catch(e){Z.error(e?.message||`创建项目组认证二维码失败`)}finally{l(!1)}},T=f?.h5Link||``,E=f?.status===Q7;return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{marginBottom:16,display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Title,{level:4,style:{margin:0},children:`真人素材库`}),(0,$.jsx)(Q.Text,{type:`secondary`,children:`创建项目组时先完成真人认证,认证成功后项目组才会正式创建并可上传素材。`})]}),(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(rL,{}),onClick:()=>s(!0),style:{borderRadius:8,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`创建项目组`})]}),(0,$.jsxs)(Yq,{gutter:16,children:[(0,$.jsx)(JR,{xs:24,lg:5,children:(0,$.jsx)(DL,{style:{borderRadius:16,minHeight:520},children:(0,$.jsx)(UG,{spinning:i,children:e.length===0?(0,$.jsx)(XS,{description:`暂无真人项目组`}):(0,$.jsx)(Ooe,{items:e,selectedId:n?.id,onSelect:r})})})}),(0,$.jsx)(JR,{xs:24,lg:19,children:n?(0,$.jsx)(Loe,{project:n,onDeleted:()=>{r(null),b()},onChanged:b}):(0,$.jsx)(DL,{style:{borderRadius:16,minHeight:520,textAlign:`center`,color:`#94a3b8`},children:`请先创建或选择一个真人素材项目组`})})]}),(0,$.jsx)(mK,{title:`新建真人素材项目组`,open:o,onCancel:y,footer:f?[(0,$.jsx)(X,{onClick:y,children:`关闭`},`close`)]:void 0,onOk:f?void 0:w,okText:`开始认证并创建`,confirmLoading:c,mask:{closable:!m},children:f?(0,$.jsxs)(sH,{direction:`vertical`,align:`center`,size:16,style:{width:`100%`},children:[E?(0,$.jsx)(d4,{style:{fontSize:54,color:`#22c55e`}}):T?(0,$.jsx)(kq,{value:T,size:220}):(0,$.jsx)(UG,{}),(0,$.jsxs)(`div`,{style:{textAlign:`center`},children:[(0,$.jsx)(Q.Title,{level:5,style:{marginBottom:8},children:u?.name||`真人素材项目组`}),(0,$.jsx)(Q.Text,{type:E?`success`:`secondary`,children:E?`认证成功,项目组正在刷新`:`请使用手机扫码完成人脸认证,成功后回到电脑端查看项目组。`})]})]}):(0,$.jsxs)(tU,{form:g,layout:`vertical`,children:[(0,$.jsx)(tU.Item,{label:`项目组名称`,name:`name`,rules:[{required:!0,message:`请输入项目组名称`}],children:(0,$.jsx)(IW,{placeholder:`例如:达人A、客户B、张三人像`})}),(0,$.jsx)(tU.Item,{label:`描述`,name:`description`,children:(0,$.jsx)(IW.TextArea,{rows:3,placeholder:`可选`})}),(0,$.jsx)(Q.Paragraph,{type:`secondary`,style:{marginBottom:0},children:`点击后会生成真人认证二维码。手机扫码认证成功后,项目组才会出现在项目列表中。`})]})})]})},{Text:e9}=Q,t9=2,n9=15,zoe={creating:{label:`本地创建中`,color:`processing`},Processing:{label:`入库处理中`,color:`processing`},Active:{label:`入库成功`,color:`success`},Failed:{label:`入库失败`,color:`error`},local_deleted:{label:`本地已删`,color:`default`},remote_deleted:{label:`远端已删`,color:`default`},delete_failed:{label:`远端删除失败`,color:`error`}},Boe=e=>{let t=Number(e||0);return!Number.isFinite(t)||t<=0?`-`:`${t.toFixed(t>=10?0:1)}s`},r9=e=>e?e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`data:`)||e.startsWith(`blob:`)?e:`${`http://ceshi.apiforeign.minzhong.cn`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`:``,i9=e=>e.assetType===`Video`?r9(e.videoCoverUrl||e.previewUrl||e.displayUrl||e.remoteUrl||e.sourceUrl):r9(e.previewUrl||e.displayUrl||e.videoCoverUrl||e.remoteUrl||e.sourceUrl),Voe=e=>new Promise(t=>{if(!e.type.startsWith(`video/`)){t(null);return}let n=URL.createObjectURL(e),r=document.createElement(`video`);r.preload=`metadata`,r.onloadedmetadata=()=>{let e=Number.isFinite(r.duration)?r.duration:null;URL.revokeObjectURL(n),t(e)},r.onerror=()=>{URL.revokeObjectURL(n),t(null)},r.src=n}),Hoe=(e,t)=>e==null||!Number.isFinite(e)||e<=0?(t(`无法读取视频秒数,请检查视频文件是否损坏`),!1):en9?(t(`视频素材最长不能超过 ${n9} 秒`),!1):!0,Uoe=({status:e})=>{let t=e||`-`,n=zoe[t];return(0,$.jsx)(XQ,{color:n?.color||`default`,children:n?.label||t})},Woe=()=>{let{message:e}=Vb.useApp(),{refreshConfig:t}=Y7(),[n,r]=(0,S.useState)([]),[i,a]=(0,S.useState)(),[o,s]=(0,S.useState)([]),[c,l]=(0,S.useState)(!1),[u,d]=(0,S.useState)(!1),[f,p]=(0,S.useState)(1),[m,h]=(0,S.useState)(20),[g,_]=(0,S.useState)(0),[v,y]=(0,S.useState)(``),[b,x]=(0,S.useState)(),[C,w]=(0,S.useState)(),[T,E]=(0,S.useState)(!1),[D,O]=(0,S.useState)(!1),[k,A]=(0,S.useState)(!1),[j,M]=(0,S.useState)(!1),[N,P]=(0,S.useState)([]),[F,I]=(0,S.useState)({}),[L,R]=(0,S.useState)({}),[z,B]=(0,S.useState)({}),[V,H]=(0,S.useState)({}),[U,W]=(0,S.useState)(!1),[ee,te]=(0,S.useState)(``),[G,ne]=(0,S.useState)(`Image`),[re]=tU.useForm(),ie=(0,S.useRef)(null),ae=(0,S.useMemo)(()=>n.find(e=>e.id===i)||null,[n,i]),oe=async()=>{l(!0);try{let e=(await g7({page:1,pageSize:100,status:`active`})).items||[];r(e),a(t=>t&&e.some(e=>e.id===t)?t:e[0]?.id)}catch(t){e.error(t?.message||`加载虚拟人像项目组失败`)}finally{l(!1)}},K=async(t=f,n=m)=>{if(!i){s([]),_(0);return}d(!0);try{let e=await Lae(i,{page:t,pageSize:n,keyword:v.trim()||void 0,status:b,assetType:C});s(e.items||[]),_(e.total||0),p(t),h(n)}catch(t){e.error(t?.message||`加载虚拟人像素材失败`)}finally{d(!1)}},q=async()=>{await oe()};(0,S.useEffect)(()=>{q()},[]),(0,S.useEffect)(()=>{i&&K(1,m)},[i]),(0,S.useEffect)(()=>(o.some(e=>e.status!==`Failed`&&e.status!==`Active`)&&i?ie.current||=window.setInterval(()=>{K(f,m)},3e3):ie.current&&=(clearInterval(ie.current),null),()=>{ie.current&&=(clearInterval(ie.current),null)}),[o,i,f,m]);let se=async()=>{let t=await re.validateFields();O(!0);try{let n=await Pae(t);e.success(`虚拟人像项目组已创建`),E(!1),re.resetFields(),await oe(),a(n.id)}catch(t){e.error(t?.message||`创建项目组失败`)}finally{O(!1)}},ce=async()=>{if(!i){e.warning(`请先创建或选择项目组`);return}if(N.length===0){e.warning(`请先选择图片或视频素材`);return}let n=N.filter(e=>L[e.uid]===`uploaded`);if(n.length===0){e.warning(`请等待文件上传完成后再提交入库`);return}M(!0);try{for(let e of n){let t=e.originFileObj;if(!t)continue;let n=z[e.uid];if(!n)continue;H(t=>({...t,[e.uid]:`importing`}));let r=t.type.startsWith(`image/`)?`Image`:`Video`;await Iae(i,{url:n.url,assetType:r,name:F[e.uid]?.trim()||t.name,videoDuration:n.duration_seconds,fileSize:n.file_size_bytes??t.size,mimeType:t.type||null,uploadResourceId:n.resource_id||null}),H(t=>({...t,[e.uid]:`imported`}))}e.success(`已成功提交 ${n.length} 个素材入库,处理中`),setTimeout(()=>{A(!1),P([]),I({}),R({}),B({}),H({})},1500),await Promise.all([oe(),K(1,m),t()])}catch(t){e.error(t?.message||`提交入库失败`)}finally{M(!1)}},le=async n=>{try{await Rae(n),e.success(`素材已删除,远端删除将异步执行`),await Promise.all([oe(),K(f,m),t()])}catch(t){e.error(t?.message||`删除素材失败`)}},ue=async()=>{if(i)try{await Fae(i),e.success(`项目组已删除,远端资产组将异步删除`),a(void 0),await q()}catch(t){e.error(t?.message||`删除项目组失败`)}},de=t=>{let n=i9(t);if(!n){e.warning(`暂无可预览地址`);return}te(n),ne(t.assetType===`Video`?`Video`:`Image`),W(!0)};return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{marginBottom:16,display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Title,{level:4,style:{margin:0},children:`虚拟素材库`}),(0,$.jsx)(Q.Text,{type:`secondary`,children:`可提前上传虚拟人像素材,后续生成视频时可直接使用。`})]}),(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(rL,{}),onClick:()=>E(!0),style:{borderRadius:8,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`创建项目组`})]}),(0,$.jsxs)(Yq,{gutter:[10,10],children:[(0,$.jsx)(JR,{xs:24,lg:5,children:(0,$.jsx)(DL,{style:{borderRadius:16,minHeight:520,margin:`0 auto`,maxWidth:1200},children:(0,$.jsx)(UG,{spinning:c,children:n.length===0?(0,$.jsx)(XS,{description:`暂无虚拟人像项目组`}):(0,$.jsx)(sH,{orientation:`vertical`,style:{width:`100%`},size:10,children:n.map(e=>{let t=i===e.id;return(0,$.jsxs)(`div`,{onClick:()=>a(e.id),style:{padding:14,borderRadius:14,cursor:`pointer`,border:t?`1px solid #8b5cf6`:`1px solid #e2e8f0`,background:t?`#f5f3ff`:`#fff`},children:[(0,$.jsx)(sH,{style:{width:`100%`,justifyContent:`space-between`},align:`start`,children:(0,$.jsxs)(`div`,{style:{minWidth:0},children:[(0,$.jsx)(e9,{strong:!0,ellipsis:!0,style:{display:`block`},children:e.name}),e.description&&(0,$.jsx)(e9,{type:`secondary`,ellipsis:!0,style:{display:`block`,fontSize:12},children:e.description})]})}),(0,$.jsxs)(sH,{wrap:!0,size:4,style:{marginTop:10},children:[(0,$.jsxs)(XQ,{children:[`总 `,e.assetCount||0]}),(0,$.jsxs)(XQ,{color:`green`,children:[`图 `,e.imageAssetCount||0]}),(0,$.jsxs)(XQ,{color:`blue`,children:[`视频 `,e.videoAssetCount||0]})]})]},e.id)})})})})}),(0,$.jsx)(JR,{xs:24,lg:19,children:(0,$.jsxs)(DL,{title:ae?ae.name:`素材资产`,extra:(0,$.jsxs)(sH,{wrap:!0,children:[(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(X8,{}),disabled:!i,onClick:()=>A(!0),style:{borderRadius:8,fontWeight:600,borderColor:`transparent`},children:`上传图片/视频`}),i&&(0,$.jsx)(vK,{title:`确认删除当前虚拟人像项目组吗?`,onConfirm:ue,children:(0,$.jsx)(X,{danger:!0,icon:(0,$.jsx)(u$,{}),style:{borderRadius:8,fontWeight:600},children:`删除项目组`})})]}),style:{borderRadius:16,minHeight:520},children:[(0,$.jsxs)(sH,{style:{width:`100%`,marginBottom:16},wrap:!0,children:[(0,$.jsx)(IW.Search,{allowClear:!0,placeholder:`搜索素材名称`,value:v,onChange:e=>y(e.target.value),onSearch:()=>K(1,m),style:{width:240,borderRadius:8},enterButton:!0}),(0,$.jsx)(EC,{allowClear:!0,placeholder:`素材状态`,value:b,onChange:e=>x(e),style:{width:140,borderRadius:8},options:[{value:`Processing`,label:`处理中`},{value:`Active`,label:`可用`},{value:`Failed`,label:`失败`}]}),(0,$.jsx)(EC,{allowClear:!0,placeholder:`素材类型`,value:C,onChange:e=>w(e),style:{width:120,borderRadius:8},options:[{value:`Image`,label:`图片`},{value:`Video`,label:`视频`}]}),(0,$.jsx)(X,{type:`primary`,onClick:()=>K(1,m),style:{borderRadius:8,fontWeight:600,borderColor:`transparent`},children:`筛选`})]}),(0,$.jsx)(UG,{spinning:u,children:i?o.length===0?(0,$.jsx)(XS,{description:`暂无素材,上传图片/视频后会异步入库`,style:{marginTop:80}}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(220px, 1fr))`,gap:14},children:o.map(e=>{let t=i9(e),n=e.assetType===`Video`;return(0,$.jsx)(DL,{hoverable:!0,styles:{body:{padding:12}},style:{borderRadius:16,overflow:`hidden`,borderColor:`#eef2f7`},cover:(0,$.jsxs)(`div`,{style:{height:170,background:`#f8fafc`,display:`flex`,alignItems:`center`,justifyContent:`center`,position:`relative`},children:[t?n&&e.videoCoverUrl?(0,$.jsx)(`img`,{src:t,alt:e.name||`视频封面`,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):n?(0,$.jsx)(`video`,{src:t,muted:!0,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(`img`,{src:t,alt:e.name||`虚拟人像素材`,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):n?(0,$.jsx)(t5,{style:{fontSize:42,color:`#64748b`}}):(0,$.jsx)(R6,{style:{fontSize:42,color:`#64748b`}}),n&&(0,$.jsx)(XQ,{color:`blue`,style:{position:`absolute`,left:10,top:10},children:`视频`}),t&&(0,$.jsx)(X,{size:`small`,shape:`circle`,icon:(0,$.jsx)(mW,{}),style:{position:`absolute`,right:10,top:10},onClick:()=>de(e)}),n&&(0,$.jsx)(`div`,{style:{position:`absolute`,left:10,bottom:10,padding:`2px 6px`,borderRadius:8,background:`rgba(15,23,42,0.72)`,color:`#fff`,fontSize:12},children:Boe(e.videoDuration)})]}),children:(0,$.jsxs)(sH,{direction:`vertical`,size:8,style:{width:`100%`},children:[(0,$.jsx)(gw,{title:e.name||e.remoteAssetId||e.id,children:(0,$.jsx)(`div`,{style:{fontWeight:600,color:`#1e293b`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:e.name||e.remoteAssetId||`未命名素材`})}),(0,$.jsxs)(sH,{wrap:!0,size:4,children:[(0,$.jsx)(Uoe,{status:e.status}),(0,$.jsx)(XQ,{color:n?`blue`:`default`,children:n?`视频`:`图片`})]}),(0,$.jsx)(sH,{size:6,wrap:!0,children:(0,$.jsx)(vK,{title:`确认删除这个虚拟人像素材吗?`,onConfirm:()=>le(e.id),children:(0,$.jsx)(X,{size:`small`,danger:!0,icon:(0,$.jsx)(u$,{}),children:`删除`})})})]})},e.id)})}),(0,$.jsx)(`div`,{style:{textAlign:`right`,marginTop:16},children:(0,$.jsx)(SG,{current:f,pageSize:m,total:g,showSizeChanger:!0,showTotal:e=>`共 ${e} 个素材`,onChange:(e,t)=>K(e,t)})})]}):(0,$.jsx)(XS,{description:`请先创建或选择项目组`,style:{marginTop:80}})})]})})]}),(0,$.jsx)(mK,{title:`创建虚拟人像项目组`,open:T,onCancel:()=>E(!1),onOk:se,confirmLoading:D,okText:`创建项目组`,children:(0,$.jsxs)(tU,{form:re,layout:`vertical`,children:[(0,$.jsx)(tU.Item,{name:`name`,label:`项目组名称`,rules:[{required:!0,message:`请输入项目组名称`}],children:(0,$.jsx)(IW,{placeholder:`例如:虚拟主播A / 品牌代言人B`,maxLength:128})}),(0,$.jsx)(tU.Item,{name:`description`,label:`描述`,children:(0,$.jsx)(IW.TextArea,{placeholder:`可填写人物设定、服装风格、素材要求等`,maxLength:2e3,rows:4})})]})}),(0,$.jsx)(mK,{title:`上传虚拟人像素材`,open:k,onCancel:()=>A(!1),onOk:ce,confirmLoading:j,okText:`提交入库`,width:650,okButtonProps:{disabled:N.length===0||N.some(e=>L[e.uid]!==`uploaded`)},children:(0,$.jsx)(`div`,{style:{maxHeight:600,overflow:`auto`,marginTop:30},children:(0,$.jsxs)(sH,{direction:`vertical`,style:{width:`100%`},size:14,children:[(0,$.jsx)(b0,{accept:`image/*,video/*`,fileList:N,multiple:!0,beforeUpload:async t=>{let n=`${Date.now()}-${Math.random().toString(36).substr(2,9)}`,r=t.type.startsWith(`image/`),i=URL.createObjectURL(t),a={uid:n,name:t.name,status:`uploading`,originFileObj:t,thumbUrl:i,type:t.type};P(e=>[...e,a]),I(e=>({...e,[n]:``})),R(e=>({...e,[n]:`uploading`}));try{let i=r?`Image`:`Video`,a=i===`Video`?await Voe(t):null;if(i===`Video`&&!Hoe(a,e.error))return R(e=>({...e,[n]:`error`})),!1;let o=i===`Video`?await Oie(t,a||void 0):await Die(t);B(e=>({...e,[n]:{url:o.url,duration_seconds:o.duration_seconds,file_size_bytes:o.file_size_bytes,resource_id:o.resource_id}})),R(e=>({...e,[n]:`uploaded`}))}catch{R(e=>({...e,[n]:`error`})),e.error(`文件 ${t.name} 上传失败`)}return!1},listType:`picture`,itemRender:(e,t,n)=>{let r=t.type?.startsWith(`video/`)||t.name.match(/\.(mp4|mov|avi|webm)$/i),i=L[t.uid],a=V[t.uid];return(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,padding:12,border:`1px solid #e5e7eb`,borderRadius:8,marginBottom:8},children:[(0,$.jsx)(`div`,{style:{width:64,height:64,borderRadius:8,overflow:`hidden`,flexShrink:0},children:t.thumbUrl||t.url?r?(0,$.jsx)(`video`,{src:t.thumbUrl||t.url,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(`img`,{src:t.thumbUrl||t.url,alt:t.name,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,backgroundColor:`#f1f5f9`},children:r?(0,$.jsx)(t5,{style:{color:`#94a3b8`,fontSize:20}}):(0,$.jsx)(R6,{style:{color:`#94a3b8`,fontSize:20}})})}),(0,$.jsx)(`span`,{style:{width:`20%`,overflow:`hidden`,whiteSpace:`nowrap`,textOverflow:`ellipsis`,fontSize:13,color:`#64748b`,flexShrink:0},children:t.name}),(0,$.jsx)(IW,{style:{width:200,flexShrink:0},value:F[t.uid]||``,onChange:e=>I({...F,[t.uid]:e.target.value}),placeholder:`素材名称,默认使用文件名`,maxLength:256}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[i===`uploading`&&(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,$.jsx)(UG,{size:`small`,style:{color:`#6366f1`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#6366f1`},children:`上传中`})]}),i===`uploaded`&&!a&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#10b981`},children:`✓ 上传完成`}),i===`error`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#ef4444`},children:`✗ 上传失败`}),a===`importing`&&(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[(0,$.jsx)(UG,{size:`small`,style:{color:`#6366f1`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#6366f1`},children:`入库中`})]}),a===`imported`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#10b981`},children:`✓ 已入库校验`}),a===`error`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#ef4444`},children:`✗ 入库失败`})]}),(0,$.jsx)(`button`,{onClick:e=>{e.stopPropagation(),P(e=>e.filter(e=>e.uid!==t.uid)),I(e=>{let n={...e};return delete n[t.uid],n}),R(e=>{let n={...e};return delete n[t.uid],n}),B(e=>{let n={...e};return delete n[t.uid],n}),H(e=>{let n={...e};return delete n[t.uid],n})},style:{width:28,height:28,borderRadius:`50%`,backgroundColor:`#f1f5f9`,border:`none`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0},children:(0,$.jsx)(u$,{style:{color:`#64748b`,fontSize:14}})})]})},children:(0,$.jsx)(X,{icon:(0,$.jsx)(X8,{}),children:`选择图片或视频`})}),(0,$.jsxs)(`div`,{style:{padding:12,background:`#f8fafc`,borderRadius:12,color:`#64748b`,fontSize:13},children:[`当前开放图片和视频,视频素材必须在 `,t9,`~`,n9,` 秒内;提交后会调用火山 CreateAsset 异步处理,状态变为 入库校验成功 后才可用于 AI 创作。`]})]})})}),(0,$.jsx)(mK,{title:`素材预览`,open:U,onCancel:()=>W(!1),footer:null,width:760,destroyOnHidden:!0,children:(0,$.jsx)(`div`,{style:{minHeight:420,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`#0f172a`,borderRadius:12,overflow:`hidden`},children:G===`Video`?(0,$.jsx)(`video`,{src:ee,controls:!0,autoPlay:!0,style:{maxWidth:`100%`,maxHeight:520}}):(0,$.jsx)(`img`,{src:ee,alt:`素材预览`,style:{maxWidth:`100%`,maxHeight:520,objectFit:`contain`}})})})]})},{Title:Goe,Text:Koe,Paragraph:qoe}=Q,a9=e=>e===`aigc_virtual`?`aigc_virtual`:`real_person`,Joe=()=>{let[e,t]=On(),[n,r]=(0,S.useState)(()=>a9(e.get(`portraitTab`))),[i,a]=(0,S.useState)(null),[o,s]=(0,S.useState)([]),[c,l]=(0,S.useState)(),u=async()=>{try{a(n===`aigc_virtual`?await h7():await p7())}catch(e){Z.error(e?.message||`加载配置失败`)}};(0,S.useEffect)(()=>{(async()=>{try{if(n===`aigc_virtual`){let[e,t]=await Promise.all([h7(),g7({page:1,pageSize:100,status:`active`})]);a(e);let n=t.items||[];s(n),l(e=>e&&n.some(t=>t.id===e)?e:n[0]?.id)}else{let[e,t]=await Promise.all([p7(),m7({pageSize:100,status:`active`})]);a(e);let n=t.items||[];s(n),l(e=>e&&n.some(t=>t.id===e)?e:n[0]?.id)}}catch(e){Z.error(e?.message||`加载数据失败`)}})()},[n]),(0,S.useMemo)(()=>o.find(e=>e.id===c)||null,[o,c]);let d=(0,S.useMemo)(()=>i?`已用 ${i.usedAssetCount||0} / ${i.assetLimit||0} 个素材,剩余 ${i.remainingAssetCount||0}`:`额度加载中`,[i]),f=(0,S.useMemo)(()=>[{key:`real_person`,label:`真人素材库`,children:(0,$.jsx)(Roe,{})},{key:`aigc_virtual`,label:`虚拟素材库`,children:(0,$.jsx)(Woe,{})}],[]);return(0,$.jsx)(Noe,{refreshConfig:u,children:(0,$.jsx)(`div`,{children:(0,$.jsx)(TL,{activeKey:n,onChange:n=>{let i=a9(n);r(i);let a=new URLSearchParams(e);a.set(`filterType`,`private_portrait`),a.set(`portraitTab`,i),t(a,{replace:!0})},items:f,destroyOnHidden:!1,tabBarExtraContent:(0,$.jsxs)(`div`,{style:{fontSize:14,fontWeight:700,color:`#4f46e5`,marginTop:8},children:[d,`。真人/虚拟共用,图片/视频共用。`]})})})})},{Header:Yoe,Sider:Xoe,Content:Zoe}=GW,{TextArea:Qoe}=IW,{Option:$oe}=EC,{Text:o9}=Q,ese=`http://ceshi.apiforeign.minzhong.cn`.replace(/\/api\/?$/i,``).replace(/\/$/,``),tse=e=>{if(!e)return``;let t=String(e).trim();return t?/^(https?:)?\/\//i.test(t)||/^(blob|data):/i.test(t)?t:`${ese}${t.startsWith(`/`)?t:`/${t}`}`:``},nse=()=>{let{message:e}=Vb.useApp(),t=Ke(),[n,r]=(0,S.useState)(!1),[i,a]=(0,S.useState)(`1`),[o,s]=(0,S.useState)([]),{mediaType:c,countType:l,generationCount:u,selectedRatio:d,selectedResolution:f,width:p,height:m,videoDuration:h,videoAspectRatio:g,videoResolution:_,engineOptions:v,enginesele:y,inputValue:b,setMediaType:x,setCountType:C,setGenerationCount:w,setSelectedRatio:T,setSelectedResolution:E,setWidth:D,setHeight:O,setVideoDuration:k,setVideoAspectRatio:A,setVideoResolution:j,setEngineOptions:M,setEnginesele:N,setInputValue:P,currentMedia:F,setCurrentMedia:I}=C7(),L=Array.isArray(y)?{}:y,R=(c===`image`?L.image:L.video)?.find(e=>e.id===l),z=R?.maxImageCount??4,B=R?.maxVideoCount??1,V=!!R?.multiGenerationEnabled,H=V?Math.max(1,Math.min(5,Number(R?.maxGenerationCount||1))):1,U=c===`image`?F.filter(e=>e.type===`image`).length:0,W=c===`image`?Math.max(1,Number(R?.multiImageMaxImages||15)-U):5,ee=Math.max(1,Math.min(5,H,c===`image`?W:5)),[te,G]=(0,S.useState)(!1),[ne,re]=(0,S.useState)(!1),[ie,ae]=(0,S.useState)(!1),[oe,K]=(0,S.useState)(`universal`),[q,se]=(0,S.useState)(null),[ce,le]=(0,S.useState)(null),[ue,de]=(0,S.useState)(null),[fe,pe]=(0,S.useState)(!1),[me,he]=(0,S.useState)(!1),[ge,_e]=(0,S.useState)(`real_person`),[ve,ye]=(0,S.useState)(!1),be=(0,S.useRef)(null),xe=(0,S.useCallback)(()=>{be.current&&=(window.clearTimeout(be.current),null),ye(!0)},[]),Se=(0,S.useCallback)(()=>{be.current&&window.clearTimeout(be.current),be.current=window.setTimeout(()=>{ye(!1),be.current=null},260)},[]),[Ce,we]=(0,S.useState)(!1),Te=(0,S.useRef)(null),Ee=(0,S.useRef)(!1),[De,Oe]=(0,S.useState)({top:0,left:0}),ke=e=>{let t=0,n=0,r=0;return e.map(e=>e.type===`image`?(t++,`图片${t}`):e.type===`video`?(n++,`视频${n}`):(r++,`音频${r}`))},[Ae,je]=(0,S.useState)(!1),[Me,Ne]=(0,S.useState)(``),[Pe,Fe]=(0,S.useState)(`image`),Ie=(0,S.useRef)(null);(0,S.useEffect)(()=>{if(Ae&&Pe===`video`){let e=()=>{Ie.current&&Ie.current.play().catch(()=>{})};Ie.current&&(Ie.current.readyState>=2?e():Ie.current.addEventListener(`loadedmetadata`,e));let t=setTimeout(e,300);return()=>{clearTimeout(t),Ie.current&&(Ie.current.removeEventListener(`loadedmetadata`,e),Ie.current.pause())}}else Ie.current&&Ie.current.pause()},[Ae,Pe]);let[Le,Re]=(0,S.useState)(new Set),ze=e=>{if(!e)return null;try{let t=new URL(e).searchParams.get(`exp`);return t?parseInt(t,10):null}catch{try{let t=e.indexOf(`?`);if(t!==-1){let n=e.substring(t+1),r=new URLSearchParams(n).get(`exp`);if(r)return parseInt(r,10)}return null}catch{return null}}},Be=e=>{let t=ze(e);return t?Math.floor(Date.now()/1e3)>t:!1},[Ve,He]=(0,S.useState)(!1),[Ue,We]=(0,S.useState)(``),[Ge,qe]=(0,S.useState)(`image`),[Je,Ye]=(0,S.useState)(``),Xe=(0,S.useRef)(null);(0,S.useEffect)(()=>{if(Ve&&Ge===`video`&&Xe.current){let e=Xe.current;e.currentTime=0,e.muted=!1;let t=e.play();t&&typeof t.catch==`function`&&t.catch(()=>{e.muted=!0,e.play().catch(()=>{})})}else if(!Ve&&Xe.current){let e=Xe.current;e.pause(),e.muted=!0,e.currentTime=0}},[Ve,Ge,Ue]);let[Ze,Qe]=(0,S.useState)(null),[$e,et]=(0,S.useState)(0),[tt,nt]=(0,S.useState)(!1),[rt,it]=(0,S.useState)(null),[at,ot]=(0,S.useState)({x:0,y:0}),[st,ct]=(0,S.useState)(!1),[lt,ut]=(0,S.useState)(!1),[dt,ft]=(0,S.useState)([]),[pt,mt]=(0,S.useState)([]),[ht,gt]=(0,S.useState)({}),[_t,vt]=(0,S.useState)(!1),[yt,bt]=(0,S.useState)(!1),[xt,St]=(0,S.useState)([]),[Ct,wt]=(0,S.useState)([]),[Tt,Et]=(0,S.useState)([]),Dt=()=>{let e={};if(e=Tt.find(e=>e.modelConfigId===l&&e.genType===c&&e.resolution===(c===`video`?_:f)),e||(c===`video`?(e={perSecondCredits:2,baseCredits:60,ratio:1.3,inputVideoRatio:1.3,inputVideoBaseCredits:0,inputVideoPerSecondCredits:15,inputImageRatio:1,inputImageBaseCredits:0,inputImagePerImageCredits:0},(_===`1080p`||_===`720p`||_===`480p`)&&(e.ratio=1.3)):(e={perSecondCredits:.1,baseCredits:2,ratio:3,inputImageRatio:1,inputImageBaseCredits:0,inputImagePerImageCredits:0},(f===`2K`||f===`4K`||f===`1K`)&&(e.ratio=3))),c===`video`){let t=(h*e.perSecondCredits+e.baseCredits)*e.ratio,n=F.filter(e=>e.type===`video`).reduce((e,t)=>e+(t.duration||0),0);if(n>0){let r=((e.inputVideoBaseCredits||0)+(e.inputVideoPerSecondCredits||0)*n)*(e.inputVideoRatio||1);t+=r}let r=F.filter(e=>e.type===`image`).length;if(r>0){let n=((e.inputImageBaseCredits||0)+(e.inputImagePerImageCredits||0)*r)*(e.inputImageRatio||1);t+=n}return Number((t*u).toFixed(2))}else{let t=e.baseCredits*e.ratio,n=F.filter(e=>e.type===`image`).length;if(n>0){let r=((e.inputImageBaseCredits||0)+(e.inputImagePerImageCredits||0)*n)*(e.inputImageRatio||1);t+=r}return Number((t*u).toFixed(2))}},Ot=(0,S.useRef)(null),kt=(0,S.useRef)(null),At=(0,S.useRef)(null);(0,S.useRef)(!0);let jt=(0,S.useRef)(!1),Mt=(0,S.useRef)(0);o.find(e=>e.id===i);let[Nt,Pt]=(0,S.useState)([]),[Ft,It]=(0,S.useState)({page:1,pageSize:20}),[Lt,Rt]=(0,S.useState)(0),[zt,Bt]=(0,S.useState)(!1);(0,S.useEffect)(()=>{let e=t.state;e&&(e.generationPrompt&&P(e.generationPrompt),e.mediaReferences&&Array.isArray(e.mediaReferences)&&e.mediaReferences.length>0&&I(e.mediaReferences.map(e=>{let t=e.url||e.resourceUrl||e.previewUrl||``,n=t.startsWith(`http`)?t:`http://ceshi.apiforeign.minzhong.cn${t}`;return{...e,name:e.name||`参考${e.type}`,type:e.type===`video`?`video`:e.type===`audio`?`audio`:`image`,url:n,duration:e.duration||0,label:e.label||``}})),e.aspectRatio&&A(e.aspectRatio),window.history.replaceState({},``,window.location.pathname))},[t.state]),(0,S.useEffect)(()=>()=>{be.current&&window.clearTimeout(be.current)},[]);let Vt=(0,S.useCallback)((e=`instant`)=>{let t=kt.current;t&&(Mt.current=Date.now(),requestAnimationFrame(()=>{t.scrollTo({top:t.scrollHeight,behavior:e})}))},[]);(0,S.useEffect)(()=>{if(Nt.length>0&&!jt.current){let e=setTimeout(()=>{Vt(`smooth`),jt.current=!0},300);return()=>clearTimeout(e)}},[Nt.length,Vt]),(0,S.useEffect)(()=>{if(Ee.current){Ee.current=!1;return}if(!ie)return;let e=Array.isArray(y)?{}:y,t=c===`image`?e.image:e.video;t&&t.length>0&&(t.some(e=>e.id===l)||C(t[0].id))},[c,y,ie]),(0,S.useEffect)(()=>{ie&&w(1)},[c,l,ie,w]),(0,S.useEffect)(()=>{u>ee&&(w(ee),c===`image`&&e.info(`受当前引擎或参考图数量限制,本次最多生成 ${ee} 份`))},[u,ee,c,w,e]),(0,S.useEffect)(()=>{let e=e=>{let t=e.target;yt&&!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&bt(!1),_t&&!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&vt(!1),st&&!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&ct(!1),lt&&!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&ut(!1),fe&&!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&pe(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[yt,_t,st,lt,fe]),(0,S.useEffect)(()=>{if(Ee.current){Ee.current=!1;return}if(c!==`video`)return;let e=L.video?.find(e=>e.id===l);if(!e)return;let t=e.supportsFirstLastFrame??!1,n=e.supportsUniversalReference??!0;K(e=>n?`universal`:e===`universal`&&!n&&t?`first_last_frame`:e)},[l,c,y]),(0,S.useEffect)(()=>{z5().then(e=>{if(N(e.engine),ae(!0),e.engine.video&&e.engine.video.length>0){let t=e.engine.video[0],n=e.engine.video.find(e=>e.id===l)||t;M({ratios:n.supportedRatios||[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:n.supportedResolutions||[`480p`,`720p`,`1080p`],durations:n.supportedDurations||[5,8,10,12,15]}),n.supportedRatios?.includes(g)||A(n.supportedRatios?.[0]||`16:9`),n.supportedResolutions?.includes(_)||j(n.supportedResolutions?.[0]||`720p`),n.supportedDurations?.includes(h)||k(n.supportedDurations?.[0]||5),l===`请选择`&&C(n.id)}if(e.engine.image&&e.engine.image.length>0){let t=e.engine.image.find(e=>e.id===l)||e.engine.image[0],n=t.supportedSizes||{},r=Object.keys(n).sort((e,t)=>{let n={"1K":0,"2K":1,"4K":2};return(n[e]||0)-(n[t]||0)}),i=r[0]||`2K`,a=Object.keys(n[i]||{});if(ft(a.map(e=>({value:e,label:e}))),gt(n),mt(r.map(e=>{let t=e.match(/(\d+)K/);return{value:e,label:`${{1:`标清`,2:`高清`,4:`超清`}[t?parseInt(t[1]):1]||`高清`} ${e}`}})),n[i]&&n[i][a[0]]){let[e,t]=n[i][a[0]].split(/[×x]/);D(Number(e)),O(Number(t)),T(a[0]),E(i)}l===`请选择`&&C(t.id)}}).catch(()=>{}),H5().then(e=>{Et(e)}),B5(Ft).then(e=>{let t=e.total;Pt(e.items),Rt(t)})},[]),(0,S.useEffect)(()=>{if(At.current&&=(clearInterval(At.current),null),Nt.some(e=>e.status===`generating`))return At.current=window.setInterval(()=>{B5(Ft).then(e=>{Pt(t=>t.map(t=>t.status===`generating`&&e.items.find(e=>e.id===t.id)||t)),Rt(e.total)}).catch(e=>{})},1e4),()=>{At.current&&=(clearInterval(At.current),null)}},[Nt,Ft]),(0,S.useEffect)(()=>{if(!st)return;let e=e=>{let t=e.target;!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&ct(!1)};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[st]),(0,S.useEffect)(()=>{if(!lt)return;let e=e=>{let t=e.target;!t.closest(`.image-settings-popover`)&&!t.closest(`.image-settings-trigger`)&&ut(!1)};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[lt]);let Ht=e=>{let t=Object.keys(ht).sort((e,t)=>{let n={"1K":0,"2K":1,"4K":2};return(n[e]||0)-(n[t]||0)}),n=ht[f]&&ht[f][e]?f:t.find(t=>ht[t]&&ht[t][e])||t[0];if(n&&ht[n]&&ht[n][e]){let[t,r]=ht[n][e].split(/[×x]/);D(Number(t)),O(Number(r)),T(e),E(n)}},Ut=e=>{ht[e]||(e=Object.keys(ht).sort((e,t)=>{let n={"1K":0,"2K":1,"4K":2};return(n[e]||0)-(n[t]||0)})[0]||e);let t=ht[e]?Object.keys(ht[e]):[];ft(t.map(e=>({value:e,label:e})));let n=t.includes(d)?d:t[0]||``;if(n&&ht[e]&&ht[e][n]){let[t,r]=ht[e][n].split(/[×x]/);D(Number(t)),O(Number(r)),T(n),E(e)}},Wt=()=>{D(m),O(p)},Gt=y?.video?.find(e=>e.id===l),Kt=Gt?.supportsFirstLastFrame??!1,qt=Gt?.supportsUniversalReference??!0,Jt=e=>{e===`first_last_frame`&&!Kt||e===`universal`&&!qt||(K(e),pe(!1),I([]),P(``))},Yt=()=>{let e=q;se(ce),le(e)},Xt=()=>{se(null),le(null)},Zt=()=>{le(null)},Qt=async()=>{let t=c===`video`&&oe===`first_last_frame`;if(t){if(!b.trim()){e.warning(`请输入内容`);return}}else if(!b.trim()&&F.length===0){e.warning(`请输入内容或上传图片/视频`);return}let n=e=>e.replace(/([A-Z])/g,`_$1`).toLowerCase(),r=e=>!e||typeof e!=`object`?e:Array.isArray(e)?e.map(r):Object.fromEntries(Object.entries(e).map(([e,t])=>[n(e),r(t)])),i;t?(i=[],q&&i.push(r({...q,role:`first_frame`})),ce&&i.push(r({...ce,role:`last_frame`})),i.length===0&&(i=void 0)):i=F.length>0?F.map(e=>{if(e.type===`image`){let{duration:t,...n}=e;return r(n)}return r(e)}):void 0;let a={id:``,gen_type:c,original_prompt:b.trim(),engine_id:l,idempotency_key:new Date().toLocaleString(`zh-CN`),generation_count:u,media_references:i,...c===`image`&&{image_size:f,image_proportion:d,image_px:p+`x`+m},...c===`video`&&{duration:h,aspect_ratio:g,resolution:_}};console.log(a),re(!0),Hie(a).then(()=>{P(``),I([]),se(null),le(null),w(1);let e={...Ft,page:1};It(e),B5(e).then(e=>{let t=e.items.map(e=>(e.media_references&&Array.isArray(e.media_references)&&(e.mediaReferences=e.media_references.map(e=>({...e,display_url:e.display_url||e.displayUrl,preview_url:e.preview_url||e.previewUrl,private_asset_id:e.private_asset_id||e.privateAssetId,provider_url:e.provider_url||e.providerUrl,remote_asset_id:e.remote_asset_id||e.remoteAssetId}))),e)),n=Array.isArray(t)&&t.length>0?t[t.length-1]:null;n&&Pt(e=>[...e,n]),Rt(e.total),setTimeout(()=>{Ot.current?.scrollIntoView({behavior:`smooth`})},100)}).catch(e=>{})}).catch(t=>{let n=`创建任务失败`;t?.response?.data?.detail?n=t.response.data.detail:t?.data?.detail?n=t.data.detail:t?.detail?n=t.detail:t?.message&&(n=t.message),e.error({content:n,duration:3})}).finally(()=>{re(!1)}),setTimeout(()=>{re(!1)},3e3)},$t=async()=>{if(Nt.length>=Lt)return;let e=kt.current;if(!e)return;let t=e.scrollTop,n=e.scrollHeight;Bt(!0);try{let r=Ft.page+1,i=await B5({...Ft,page:r}),a=Array.isArray(i)?{items:i,total:i.length}:i;a.total&&Rt(a.total),It(e=>({...e,page:r})),Pt(e=>{let t=new Set(e.map(e=>e.id));return[...(a.items||[]).filter(e=>!e.id||t.has(e.id)?!1:(t.add(e.id),!0)).reverse(),...e]}),setTimeout(()=>{e.scrollTop=t+(e.scrollHeight-n)},200)}catch{}finally{Bt(!1)}},en=e=>new Promise((t,n)=>{let r=document.createElement(`video`);r.preload=`metadata`,r.onloadedmetadata=()=>{window.URL.revokeObjectURL(r.src),t(r.duration)},r.onerror=()=>{window.URL.revokeObjectURL(r.src),n(Error(`无法获取视频时长`))},r.src=URL.createObjectURL(e)}),tn=e=>new Promise((t,n)=>{let r=document.createElement(`audio`);r.preload=`metadata`,r.onloadedmetadata=()=>{URL.revokeObjectURL(r.src),t(r.duration)},r.onerror=()=>{URL.revokeObjectURL(r.src),n(Error(`无法获取音频时长`))},r.src=URL.createObjectURL(e)}),nn=e=>{let t=e.startsWith(`http`)?e:`http://ceshi.apiforeign.minzhong.cn${e}`;if(Ze===t){let e=document.getElementById(`audio-player`);e&&e.pause(),Qe(null)}else Qe(t)},rn=e=>new Promise((t,n)=>{let r=new Image;r.onload=()=>{window.URL.revokeObjectURL(r.src),t({width:r.naturalWidth,height:r.naturalHeight})},r.onerror=()=>{window.URL.revokeObjectURL(r.src),n(Error(`无法读取图片尺寸`))},r.src=URL.createObjectURL(e)}),an=e=>new Promise((t,n)=>{let r=document.createElement(`video`);r.preload=`metadata`,r.onloadedmetadata=()=>{window.URL.revokeObjectURL(r.src),t({width:r.videoWidth,height:r.videoHeight,duration:r.duration})},r.onerror=()=>{window.URL.revokeObjectURL(r.src),n(Error(`无法读取视频尺寸`))},r.src=URL.createObjectURL(e)}),on=(e,t)=>{if(e<300||e>6e3)return`图片宽度需在 300~6000px 之间,当前为 ${e}px`;if(t<300||t>6e3)return`图片高度需在 300~6000px 之间,当前为 ${t}px`;let n=e/t;return n<.4||n>2.5?`图片宽高比需在 0.4~2.5 之间,当前为 ${n.toFixed(2)}`:null},sn=(e,t)=>{if(e<300||e>6e3)return`视频宽度需在 300~6000px 之间,当前为 ${e}px`;if(t<300||t>6e3)return`视频高度需在 300~6000px 之间,当前为 ${t}px`;let n=e/t;if(n<.4||n>2.5)return`视频宽高比需在 0.4~2.5 之间,当前为 ${n.toFixed(2)}`;let r=e*t;return r<409600?`视频总像素数过小(${e}×${t}=${r}),需 ≥ 640×640=409600`:r>8295044?`视频总像素数过大(${e}×${t}=${r}),需 ≤ 3326×2494=8295044`:null},cn=async(t,n)=>{let r=t.type.startsWith(`image/`),i=t.type.startsWith(`video/`);if(c===`video`&&oe===`first_last_frame`){if(!r)return e.error(`首尾帧模式仅支持上传图片`),!1;if(t.size/1024/1024>10)return e.error(`图片大小不能超过10MB`),!1;try{let{width:n,height:r}=await rn(t),i=on(n,r);if(i)return e.error(i),!1}catch{return e.error(`无法读取图片尺寸,请检查文件是否损坏`),!1}let i=n||ue;if(!i)return e.error(`请选择首帧或尾帧上传位置`),!1;G(!0);try{let n=await E5(t),r={name:t.name,type:`image`,url:n.url,role:i===`first`?`first_frame`:`last_frame`};i===`first`?se(r):le(r),e.success(`图片上传成功`)}catch(t){let n=t?.response?.data?.message||t?.response?.data?.detail||t?.message||`上传失败`;e.error(n)}finally{G(!1),de(null)}return!1}let a=t.type.startsWith(`audio/`);if(!r&&!i&&!a)return e.error(`仅支持图片、视频或音频文件`),!1;if(a){let n=t.name.split(`.`).pop()?.toLowerCase();if(![`wav`,`mp3`].includes(n||``))return e.error(`音频仅支持wav和mp3格式`),!1}if(c===`image`&&(i||a))return e.error(`图片模式仅支持上传图片`),!1;if(a&&c!==`video`)return e.error(`仅视频模式支持上传音频`),!1;let o=i?100:a?50:10,s=i?`视频`:a?`音频`:`图片`;if(t.size/1024/1024>o)return e.error(`${s}大小不能超过${o}MB`),!1;if(r)try{let{width:n,height:r}=await rn(t),i=on(n,r);if(i)return e.error(i),!1}catch{return e.error(`无法读取图片尺寸,请检查文件是否损坏`),!1}let l=F.filter(e=>e.type===`image`).length;if(r&&l>=Mn)return e.error(`该引擎最多上传${Mn}张图片`),!1;let u=F.filter(e=>e.type===`video`).length;if(i&&u>=Nn)return e.error(`该引擎最多上传${Nn}个视频`),!1;let d=F.filter(e=>e.type===`audio`).length;if(a&&d>=Pn)return e.error(`该引擎最多上传${Pn}个音频`),!1;let f=0,p=0;if(i)try{if(f=await en(t),f<2)return e.error(`视频素材最短不能少于 2 秒`),!1;let n=F.filter(e=>e.type===`video`).reduce((e,t)=>e+(t.duration||0),0);if(n+f>15)return e.error(`所有视频素材总时长不能超过 15 秒,当前 ${(n+f).toFixed(1)} 秒`),!1;let{width:r,height:i}=await an(t),a=sn(r,i);if(a)return e.error(a),!1}catch{return e.error(`无法获取视频信息,请检查文件是否损坏`),!1}if(a)try{if(p=await tn(t),p<2)return e.error(`音频素材最短不能少于 2 秒`),!1;let n=F.filter(e=>e.type===`audio`).reduce((e,t)=>e+(t.duration||0),0);if(n+p>15)return e.error(`所有音频素材总时长不能超过 15 秒,当前 ${(n+p).toFixed(1)} 秒`),!1}catch{return e.error(`无法获取音频信息,请检查文件是否损坏`),!1}G(!0);try{let e;e=r?await E5(t):a?await T5(t,p):await D5(t,f);let n=r?`image`:a?`audio`:`video`,o=[...F,{name:t.name,type:n,url:e.url,label:``,...i&&{duration:f},...a&&{duration:p}}],s=ke(o);I(o.map((e,t)=>({...e,label:s[t]})))}catch(t){let n=t?.response?.data?.message||t?.response?.data?.detail||t?.message||`上传失败`;e.error(n)}finally{G(!1)}return!1},ln=async t=>{let n=t.type.startsWith(`image/`),r=t.type.startsWith(`video/`),i=t.type.startsWith(`audio/`);if(!n&&!r&&!i)return e.error(`仅支持图片、视频或音频文件`),!1;let a=r?100:i?50:30;if(t.size/1024/1024>a)return e.error(`${r?`视频`:i?`音频`:`图片`}大小不能超过${a}MB`),!1;if(n||r){let n=C7.getState().currentMedia.filter(e=>e.type===`image`||e.type===`video`).reduce((e,t)=>e+(Number(t.fileSizeBytes)||0),0),r=(n+t.size)/1024/1024;if(r>64)return e.error(`所有图片和视频总大小不能超过64MB,当前已${(n/1024/1024).toFixed(1)}MB,加上此文件后${r.toFixed(1)}MB`),!1}if(i){let n=t.name.split(`.`).pop()?.toLowerCase();if(![`wav`,`mp3`].includes(n||``))return e.error(`音频仅支持wav和mp3格式`),!1}if(n)try{let{width:n,height:r}=await rn(t),i=on(n,r);if(i)return e.error(i),!1}catch{return e.error(`无法读取图片尺寸,请检查文件是否损坏`),!1}let o=0,s=0;if(r)try{if(o=await en(t),o<2)return e.error(`视频素材最短不能少于 2 秒`),!1;let n=C7.getState().currentMedia.filter(e=>e.type===`video`).reduce((e,t)=>e+(t.duration||0),0);if(n+o>15)return e.error(`所有视频素材总时长不能超过 15 秒,当前 ${(n+o).toFixed(1)} 秒`),!1}catch{return e.error(`无法获取视频信息,请检查文件是否损坏`),!1}if(i)try{if(s=await tn(t),s<2)return e.error(`音频素材最短不能少于 2 秒`),!1;let n=C7.getState().currentMedia.filter(e=>e.type===`audio`).reduce((e,t)=>e+(t.duration||0),0);if(n+s>15)return e.error(`所有音频素材总时长不能超过 15 秒,当前 ${(n+s).toFixed(1)} 秒`),!1}catch{return e.error(`无法获取音频信息,请检查文件是否损坏`),!1}let c=n?`image`:i?`audio`:`video`,l={name:t.name,type:c,url:``,label:``,...r&&{duration:o},...i&&{duration:s}},u=C7.getState().currentMedia;if(!fn(u,[l]))return!1;try{let e;return e=n?await E5(t):i?await T5(t,s):await D5(t,o),{name:l.name,type:l.type,url:e.url,label:l.label||``,fileSizeBytes:t.size,...l.duration!==void 0&&{duration:l.duration}}}catch(t){let n=t?.response?.data?.message||t?.response?.data?.detail||t?.message||`上传失败`;return e.error(n),!1}},un=async t=>{let n=0,r=0;G(!0);for(let e of t){let t=await ln(e);if(t){let e=[...C7.getState().currentMedia,t],r=ke(e);I(e.map((e,t)=>({...e,label:r[t]}))),n++}else r++}G(!1),n>0&&e.success(`成功上传${n}个文件${r>0?`,${r}个文件上传失败`:``}`)},dn=(e,t)=>e.filter(e=>e.type===t).reduce((e,t)=>e+(Number(t.duration)||0),0),fn=(t,n)=>{if(!n.length)return!1;if(c===`image`&&n.some(e=>e.type!==`image`))return e.error(`图片模式仅支持添加图片素材`),!1;if(n.some(e=>e.type===`audio`)&&c!==`video`)return e.error(`仅视频模式支持添加音频素材`),!1;let r=t.filter(e=>e.type===`image`).length,i=t.filter(e=>e.type===`video`).length,a=t.filter(e=>e.type===`audio`).length,o=n.filter(e=>e.type===`image`).length,s=n.filter(e=>e.type===`video`).length,l=n.filter(e=>e.type===`audio`).length;if(r+o>Mn)return e.error(`该引擎最多上传${Mn}张图片,当前还能添加 ${Math.max(0,Mn-r)} 张`),!1;if(i+s>Nn)return e.error(`该引擎最多上传${Nn}个视频,当前还能添加 ${Math.max(0,Nn-i)} 个`),!1;if(a+l>Pn)return e.error(`该引擎最多上传${Pn}个音频,当前还能添加 ${Math.max(0,Pn-a)} 个`),!1;for(let t of n){if(t.type!==`video`)continue;let n=Number(t.duration);if(!Number.isFinite(n)||n<=0)return e.error(`${t.name||`视频素材`}缺少视频秒数,不能用于 AI 创作`),!1;if(n<2)return e.error(`${t.name||`视频素材`}最短不能少于 2 秒`),!1;if(n>15)return e.error(`${t.name||`视频素材`}最长不能超过 15 秒`),!1}let u=dn(t,`video`)+dn(n,`video`);if(u>15)return e.error(`所有视频素材总时长不能超过 15 秒,当前 ${u.toFixed(1)} 秒`),!1;let d=dn(t,`audio`)+dn(n,`audio`);return d>15?(e.error(`所有音频素材总时长不能超过 15 秒,当前 ${d.toFixed(1)} 秒`),!1):!0},pn=t=>{let n=t.mediaReference,r=n?.type||t.resourceType,i=n?.url||t.resourceUrl||t.displayUrl||t.previewUrl||``;if(!i)return e.error(`${t.fileName||t.id} 缺少素材地址,不能用于 AI 创作`),null;if(r===`audio`&&c!==`video`)return e.error(`仅视频模式支持添加音频素材`),null;let a=Number(n?.duration??t.durationSeconds);return{name:n?.name||t.fileName||t.id,type:r,url:i,source:`upload_resource`,upload_resource_id:t.id,label:``,...(r===`video`||r===`audio`)&&Number.isFinite(a)&&a>0?{duration:a}:{}}},mn=t=>{let n=t.map(pn).filter(Boolean);if(!n.length)return;let r=C7.getState().currentMedia;if(!fn(r,n))return;let i=[...r,...n],a=ke(i);I(i.map((e,t)=>({...e,label:a[t]}))),e.success(`已添加 ${n.length} 个历史上传素材参考`)},hn=t=>{if(t.assetType===`Audio`)return e.error(`音频私域素材暂不支持用于 AI 创作`),null;let n=t.assetType===`Video`?`video`:`image`,r=ge===`aigc_virtual`?`虚拟素材`:`真人素材`,i=n===`video`?t.videoCoverUrl||t.previewUrl||t.displayUrl||t.providerUrl||``:t.previewUrl||t.displayUrl||t.videoCoverUrl||t.providerUrl||``;return{name:t.name||r,type:n,url:i,source:`private_portrait_asset`,private_asset_id:t.id,label:``,...n===`video`&&{duration:Number(t.videoDuration)||void 0}}},gn=e=>{_e(e),he(!0)},_n=t=>{let n=t.map(hn).filter(Boolean),r=C7.getState().currentMedia;if(!fn(r,n))return;let i=[...r,...n],a=ke(i);I(i.map((e,t)=>({...e,label:a[t]}))),e.success(`已添加 ${n.length} 个${ge===`aigc_virtual`?`虚拟`:`真人`}素材参考`)},vn=e=>e?e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`data:`)||e.startsWith(`blob:`)?e:`${`http://ceshi.apiforeign.minzhong.cn`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`:``,yn=e=>{let t=F.filter((t,n)=>n!==e),n=ke(t);I(t.map((e,t)=>({...e,label:n[t]})))},bn=(e,t)=>{let n=e.selectionStart;return t.slice(0,n).match(/@([^@\s]*)$/)&&F.length>0?(we(!0),!0):(we(!1),!1)},xn=e=>{let t=e.target.value;P(t);let n=e.target;bn(n,t)},Sn=e=>{Ce&&e.key===`Escape`&&we(!1)},Cn=e=>{let t=Te.current?.resizableTextArea?.textArea;if(!t)return;let n=t.selectionStart,r=b.slice(0,n),i=b.slice(n),a=r.lastIndexOf(`@`);if(a===-1){we(!1);return}P(r.slice(0,a)+`@${e} `+i),we(!1),setTimeout(()=>{let n=a+e.length+2;t.focus(),t.setSelectionRange(n,n)},0)},wn=()=>{je(!1),Ne(``),Ie.current&&Ie.current.pause()},Tn=e=>{if(e.preventDefault(),e.stopPropagation(),!Me)return;let t=Me.replace(`/static`,``).replace(/&w=\d+/i,``).replace(/&q=\d+/i,``);t.includes(`download=1`)||(t+=`&download=1`);let n=document.createElement(`a`);n.href=t,console.log(t),n.download=Pe===`image`?`image.png`:`video.mp4`,document.body.appendChild(n),n.click(),document.body.removeChild(n)},En=e=>{let t=String(e?.type||``).toLowerCase(),n=String(e?.url||e?.name||``).toLowerCase();return t.includes(`video`)||/\.(mp4|mov|avi|webm|m4v)(\?|$)/.test(n)?`video`:t.includes(`audio`)||/\.(mp3|wav|ogg|aac|m4a)(\?|$)/.test(n)?`audio`:`image`},Dn=e=>e?/^https?:\/\//i.test(e)?e:`http://ceshi.apiforeign.minzhong.cn${e}`:``,On=e=>{e?.url&&(We(e.url),qe(En(e)),Ye(e.name||`附件`),He(!0))},kn=c===`video`&&oe===`first_last_frame`,An=!te&&(kn?!!(b.trim()||q):!!(b.trim()||F.length>0)),jn=c===`image`?`输入画面描述,或上传图片参考风格、构图、主体与光影。例:@图片1 参考色调,生成一张简洁高级的产品海报。`:kn?`首帧尾帧可以不传,如需传入建议描述首帧到尾帧的主体动作、镜头运动、节奏与转场。例:从首帧自然推进到尾帧,产品居中突出,动作平滑连贯。`:`上传最多12个参考素材,输入文字或 @ 引用参考内容,自由组合图、文、视频。例:@图片1 模仿 @视频1 的动作。`,Mn=z,Nn=B,Pn=R?.maxAudioCount??1;return(0,$.jsxs)(GW,{className:`ai-create-page`,style:{margin:`-24px -32px -32px`,borderRadius:22,height:`calc(100vh - 34px)`,background:`rgba(255, 255, 255, 0.52)`,overflow:`hidden`},children:[(0,$.jsx)(`audio`,{id:`audio-player`,src:Ze||null,autoPlay:!0,onEnded:()=>Qe(null),style:{display:`none`}}),(0,$.jsxs)(GW,{style:{display:`flex`,flex:1,background:`rgba(255, 255, 255, 0.52)`},children:[(0,$.jsx)(`div`,{className:`animate-fadeInUp`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,padding:`16px 24px`,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(139, 92, 246, 0.04) 100%)`,backdropFilter:`blur(22px)`,border:`1px solid rgba(231, 234, 240, 0.82)`,position:`relative`,overflow:`hidden`,flexWrap:`wrap`,gap:12},children:(0,$.jsxs)(`div`,{style:{width:`100%`,display:`flex`,alignItems:`center`,gap:16},children:[(0,$.jsx)(`div`,{style:{width:`15%`,height:1,background:`linear-gradient(90deg, transparent, rgba(117,106,136,0.18), rgba(232,227,236,0.48), transparent)`,borderRadius:1}}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:0,textAlign:`center`},children:[(0,$.jsx)(`h2`,{style:{margin:0,fontSize:18,fontWeight:700,color:`#8b5cf6`,letterSpacing:.4},children:`AI创作`}),(0,$.jsx)(`p`,{style:{fontSize:13,color:`#667085`,margin:`4px 0 0 0`},children:`输入想法、剧本或上传参考,智能生成视频/图片`})]}),(0,$.jsx)(`div`,{style:{width:`15%`,height:1,background:`linear-gradient(90deg, transparent, rgba(232,227,236,0.48), rgba(117,106,136,0.18), transparent)`,borderRadius:1}})]})}),(0,$.jsxs)(Zoe,{style:{flex:1,margin:0,padding:`20px 24px 22px`,boxSizing:`border-box`,display:`flex`,flexDirection:`column`,overflow:`hidden`,minHeight:0},children:[Nt.length===0&&(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`},children:[(0,$.jsx)(`div`,{style:{width:80,height:80,borderRadius:50,background:`linear-gradient(135deg, #8b5cf6 0%, #ddd6fe 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,marginBottom:16},children:(0,$.jsx)(c8,{style:{fontSize:40,color:`#fff`}})}),(0,$.jsx)(`h2`,{style:{margin:0,fontSize:18,fontWeight:500,color:`#2f3440`},children:`你好,想创作什么?`}),(0,$.jsx)(`p`,{style:{margin:8,fontSize:13,color:`#98a2b3`},children:`输入想法、剧本或上传参考,开始你的创作之旅`})]}),Nt.length>0&&(0,$.jsxs)(`div`,{ref:kt,className:`ai-create-scroll`,style:{flex:1,overflowY:`auto`,paddingRight:10,paddingBottom:18},onScroll:e=>{let t=e.currentTarget;!(Date.now()-Mt.current<500)&&jt.current&&t.scrollTop<=50&&!zt&&Nt.length{let t=e;return Nt.map(e=>(0,$.jsx)(`div`,{style:{width:`100%`,display:`flex`,justifyContent:`flex-start`,marginBottom:16},children:(0,$.jsxs)(`div`,{style:{width:`100%`,display:`flex`,gap:10},children:[(0,$.jsx)(`div`,{style:{width:36,height:36,borderRadius:12,background:`linear-gradient(135deg, #8b5cf6 0%, #ddd6fe 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0},children:(0,$.jsx)(c8,{style:{color:`#fff`,fontSize:16}})}),(0,$.jsx)(`div`,{style:{flex:1},children:(0,$.jsxs)(`div`,{style:{background:`rgb(255, 255, 255)`,backdropFilter:`blur(18px)`,borderRadius:`22px`,padding:`14px 16px`,width:`70%`,minWidth:500,boxSizing:`border-box`,boxShadow:`0 18px 50px rgba(47, 52, 64, 0.075)`,position:`relative`,border:`1px solid rgba(231, 234, 240, 0.9)`},children:[(0,$.jsxs)(`div`,{style:{margin:4,fontSize:11,color:`#98a2b3`,textAlign:`left`,display:`flex`,flexWrap:`wrap`,gap:8,alignItems:`center`},children:[(0,$.jsx)(`span`,{children:e.createdAt?.replace(`T`,` `).split(`.`)[0]}),(0,$.jsx)(`span`,{style:{background:(e.genType,`rgba(139, 92, 246, 0.10)`),color:(e.genType,`#8b5cf6`),padding:`2px 8px`,borderRadius:12,fontWeight:500,fontSize:11,marginLeft:8},children:e.genType===`image`?`图片生成`:`视频生成`})]}),e.mediaReferences&&e.mediaReferences.length>0&&(0,$.jsx)(`div`,{style:{position:`absolute`,top:8,right:8,zIndex:100},children:(0,$.jsx)(`span`,{style:{padding:`4px 12px`,borderRadius:16,color:`#8b5cf6`,cursor:`pointer`,fontWeight:500,border:`1px solid rgba(139, 92, 246, 0.2)`,background:`rgba(139, 92, 246, 0.04)`},onClick:t=>{t.stopPropagation();let n=t.currentTarget.getBoundingClientRect();ot({x:n.left,y:n.top-10}),it(e.id),nt(!0)},children:`附件详情`})}),(0,$.jsxs)(`div`,{style:{position:`absolute`,bottom:8,right:8,zIndex:100,display:`flex`,gap:6},children:[(0,$.jsxs)(`button`,{onClick:n=>{n.stopPropagation(),P(e.originalPrompt||``);let r=!0,i=e.engineId||e.engineSnapshot?.id||e.engine_id;if(i&&e.genType){let n=Array.isArray(y)?{}:y,a=(e.genType===`image`?n.image:n.video)?.find(e=>e.id===i);if(a){if(C(a.id),e.genType===`video`&&M({ratios:a.supportedRatios||[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:a.supportedResolutions||[`480p`,`720p`,`1080p`],durations:a.supportedDurations||[5,8,10,12,15]}),e.genType===`image`){let e=a.supportedSizes||{},t=Object.keys(e).sort((e,t)=>{let n={"1K":0,"2K":1,"4K":2};return(n[e]||0)-(n[t]||0)}),n=t[0]||`2K`,r=Object.keys(e[n]||{});if(ft(r.map(e=>({value:e,label:e}))),gt(e),mt(t.map(e=>{let t=e.match(/(\d+)K/);return{value:e,label:`${{1:`标清`,2:`高清`,4:`超清`}[t?parseInt(t[1]):1]||`高清`} ${e}`}})),e[n]&&e[n][r[0]]){let[t,i]=e[n][r[0]].split(/[×x]/);D(Number(t)),O(Number(i)),T(r[0]),E(n)}}}else t.error(`该引擎已删除,无法重新编辑`),r=!1}if(r){if(e.genType&&(Ee.current=!0,x(e.genType)),e.mediaReferences&&e.mediaReferences.length>0)if(e.mediaReferences.some(e=>e.role===`first_frame`||e.role===`last_frame`)&&e.genType===`video`){let t=e.mediaReferences.find(e=>e.role===`first_frame`),n=e.mediaReferences.find(e=>e.role===`last_frame`);se(t?{...t,label:t.label||``,duration:t.duration}:null),le(n?{...n,label:n.label||``,duration:n.duration}:null),I([]),K(`first_last_frame`)}else if(I(e.mediaReferences.map(e=>({...e,name:e.name,type:e.type,url:e.url,label:e.label||``,role:e.role,duration:e.duration}))),se(null),le(null),e.genType===`video`){let e=L.video?.find(e=>e.id===i);if(e){let t=e.supportsUniversalReference??!0,n=e.supportsFirstLastFrame??!1;K(t?`universal`:n?`first_last_frame`:`universal`)}else K(`universal`)}else K(`universal`);else if(I([]),se(null),le(null),e.genType===`video`){let e=y?.video?.find(e=>e.id===i);if(e){let t=e.supportsUniversalReference??!0,n=e.supportsFirstLastFrame??!1;K(t?`universal`:n?`first_last_frame`:`universal`)}}t.success(`已加载到编辑区`)}},style:{height:28,padding:`0 10px`,borderRadius:10,border:`none`,background:`rgba(139, 92, 246, 0.08)`,color:`#8b5cf6`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,transition:`all 0.2s ease`,gap:4,fontSize:12},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(139, 92, 246, 0.15)`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(139, 92, 246, 0.08)`},children:[(0,$.jsx)(wq,{style:{fontSize:12}}),`重新编辑`]}),(0,$.jsx)(vK,{title:`确定要删除吗?`,onConfirm:async()=>{try{await Wie(e.id),t.success(`删除成功`),Pt(t=>t.filter(t=>t.id!==e.id)),Rt(e=>e-1)}catch(e){let n=e?.response?.data?.message||e?.message||`删除失败`;t.error(n)}},okText:`确定`,cancelText:`取消`,children:(0,$.jsxs)(`button`,{onClick:e=>e.stopPropagation(),style:{height:28,padding:`0 10px`,borderRadius:10,border:`none`,background:`rgba(139, 92, 246, 0.08)`,color:`#8b5cf6`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,transition:`all 0.2s ease`,gap:4,fontSize:12},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(164, 91, 91, 0.1)`,e.currentTarget.style.color=`#A45B5B`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(139, 92, 246, 0.08)`,e.currentTarget.style.color=`#8b5cf6`},children:[(0,$.jsx)(u$,{style:{fontSize:12}}),`删除`]})})]}),(e.status===`generating`||e.status===`failed`||e.status===`completed`)&&(0,$.jsxs)(`div`,{style:{display:`flex`,gap:16,marginBottom:16,marginTop:16,width:`100%`,alignItems:`flex-start`},children:[(0,$.jsx)(`div`,{style:{width:`50%`,overflow:`hidden`,borderRadius:12,position:`relative`,height:220,border:`1px solid #E7EAF0`,boxShadow:`0 4px 12px rgba(139, 92, 246, 0.08)`,background:`linear-gradient(135deg, #ffffff 0%, #FAFBFC 100%)`},children:(0,$.jsx)(Doe,{task:e,resolveUrl:tse,onPreview:(e,t)=>{Ne(e),Fe(t),je(!0)}})}),(0,$.jsxs)(`div`,{style:{width:`50%`,display:`flex`,flexDirection:`column`,gap:12},children:[(0,$.jsx)(`div`,{style:{background:`#FFFFFF`,borderRadius:12,padding:12,border:`1px solid #E7EAF0`,flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`p`,{style:{width:`100%`,height:150,overflow:`auto`,padding:0,marginTop:0,marginBottom:0,lineHeight:2,color:`#475467`,fontSize:13},children:e.originalPrompt})}),(0,$.jsxs)(`div`,{style:{fontSize:12,color:`#667085`,textAlign:`left`,display:`flex`,flexWrap:`wrap`,gap:12,alignItems:`center`,justifyContent:`space-between`,marginBottom:12},children:[(0,$.jsx)(`span`,{style:{borderRadius:16,color:`#8b5cf6`,fontWeight:500},children:e.engineSnapshot?.name||`未知引擎`}),(0,$.jsx)(`span`,{style:{borderRadius:16,color:`#667085`},children:e.genType===`image`?`${e.imageProportion||``} · ${e.imagePx||``} · ${e.imageSize||``}`:`${e.duration||``}秒 · ${e.aspectRatio||``} · ${e.resolution||``}`}),(0,$.jsxs)(`span`,{style:{fontSize:14,borderRadius:16,color:`#8b5cf6`},children:[`消耗积分:`,e.creditsCost]})]})]})]})]})})]})},e.id))})(),(0,$.jsx)(`div`,{ref:Ot})]}),tt&&rt&&(()=>{let e=Nt.find(e=>e.id===rt)?.mediaReferences||[];return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{position:`fixed`,top:0,left:0,right:0,bottom:0,background:`transparent`,zIndex:9998},onClick:()=>{nt(!1),it(null)}}),(0,$.jsxs)(`div`,{className:`ai-reference-expanded-tray ai-attachment-popover`,style:{position:`fixed`,top:`max(84px, ${at.y-96}px)`,left:`max(24px, min(${at.x-250}px, calc(100vw - 456px)))`,width:424,padding:`12px 12px 10px`,borderRadius:18,background:`rgba(255,255,255,0.98)`,border:`1px solid #E7EAF0`,boxShadow:`0 24px 60px rgba(31, 41, 55, 0.12)`,backdropFilter:`blur(18px)`,zIndex:9999,pointerEvents:`auto`},onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:10},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:2},children:[(0,$.jsx)(`span`,{style:{fontSize:13,color:`#344054`,fontWeight:800},children:`参考附件`}),(0,$.jsx)(`span`,{style:{fontSize:11,color:`#98A2B3`,fontWeight:600},children:`点击素材查看,或直接下载原文件`})]}),(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:(0,$.jsx)(`button`,{onClick:()=>{nt(!1),it(null)},style:{width:26,height:26,borderRadius:`50%`,border:`1px solid transparent`,background:`#F6F7FA`,cursor:`pointer`,color:`#98a2b3`,display:`flex`,alignItems:`center`,justifyContent:`center`,transition:`all 0.2s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`#EEF1F6`,e.currentTarget.style.color=`#2f3440`},onMouseLeave:e=>{e.currentTarget.style.background=`#F6F7FA`,e.currentTarget.style.color=`#98a2b3`},children:(0,$.jsx)(ju,{style:{fontSize:12}})})})]}),(0,$.jsx)(`div`,{className:`ai-reference-tray-scroll`,style:{display:`flex`,gap:10,overflowX:`auto`,padding:`2px 2px 4px`},children:e.map((e,t)=>{let n=En(e),r=e.label||(e.role===`first_frame`?`首帧`:e.role===`last_frame`?`尾帧`:`${n===`image`?`图片`:n===`video`?`视频`:`音频`}${t+1}`);return(0,$.jsxs)(`div`,{style:{flex:`0 0 92px`,width:92,borderRadius:16,background:`#FFFFFF`,border:`1px solid #E7EAF0`,boxShadow:`0 8px 18px rgba(31, 41, 55, 0.06)`,padding:7,boxSizing:`border-box`},children:[(0,$.jsx)(`div`,{onClick:t=>{n===`audio`?(t.stopPropagation(),nn(e.url)):(On(e),nt(!1),it(null))},style:{position:`relative`,width:`100%`,height:70,borderRadius:12,overflow:`hidden`,cursor:`pointer`,background:`#F7F8FA`,border:`1px solid rgba(231, 234, 240, 0.9)`},children:n===`image`?(0,$.jsx)(`img`,{src:Dn(e.url),alt:e.name||r,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}}):n===`video`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`video`,{src:Dn(e.url),muted:!0,playsInline:!0,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`rgba(31, 41, 55, 0.08)`},children:(0,$.jsx)(`div`,{style:{width:28,height:28,borderRadius:`50%`,background:`rgba(47, 52, 64, 0.72)`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 8px 18px rgba(31, 41, 55, 0.22)`},children:(0,$.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`#fff`,children:(0,$.jsx)(`path`,{d:`M8 5v14l11-7z`})})})})]}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%)`},children:Ze===(e.url.startsWith(`http`)?e.url:`http://ceshi.apiforeign.minzhong.cn${e.url}`)?(0,$.jsx)(k6,{style:{fontSize:24,color:`#fff`}}):(0,$.jsx)(k2,{style:{fontSize:24,color:`#fff`}})})}),(0,$.jsx)(`div`,{title:e.name||r,style:{marginTop:6,color:`#667085`,fontSize:10,fontWeight:700,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,textAlign:`center`},children:e.name||r}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:5,marginTop:7},children:(0,$.jsx)(`button`,{onClick:()=>{On(e),nt(!1),it(null)},style:{flex:1,height:24,borderRadius:9,border:`1px solid #E7EAF0`,background:`#F8FAFC`,color:`#8b5cf6`,fontSize:11,fontWeight:700,cursor:`pointer`,transition:`all 0.2s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`#EEF1F6`},onMouseLeave:e=>{e.currentTarget.style.background=`#F8FAFC`},children:`查看`})})]},`${e.url||e.name||t}-${t}`)})})]})]})})(),(0,$.jsxs)(`div`,{style:{position:`relative`,background:`rgba(255, 255, 255, 0.52)`,borderRadius:24,padding:`18px 72px 16px 20px`,boxShadow:`0 22px 64px rgba(31, 41, 55, 0.08), 0 1px 0 rgba(255,255,255,0.98) inset`,transition:`all 0.25s ease`,border:`1px solid rgba(231, 234, 240, 0.78)`,backdropFilter:`blur(24px)`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,gap:18,alignItems:`flex-end`,marginBottom:14},children:[(0,$.jsx)(`div`,{style:{width:kn?220:70,minWidth:kn?220:70,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`flex-start`,paddingTop:2,gap:8},children:c===`video`&&oe===`first_last_frame`?(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`row`,alignItems:`stretch`,gap:12,width:`100%`,height:100},children:[(0,$.jsxs)(`div`,{style:{position:`relative`,flex:1,minWidth:0,height:100,borderRadius:12,border:`1px solid #E7EAF0`,background:`#ffffff`,boxShadow:`0 6px 16px rgba(47, 52, 64, 0.04)`,overflow:`hidden`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:8,left:10,right:10,display:`flex`,alignItems:`center`,justifyContent:`space-between`,zIndex:2},children:(0,$.jsx)(`span`,{style:{fontSize:11,fontWeight:600,color:`#8b5cf6`,lineHeight:1},children:`首帧(可选)`})}),q?(0,$.jsxs)(`div`,{style:{position:`absolute`,left:10,right:10,bottom:10,height:64},children:[(0,$.jsx)(`img`,{src:vn(q.url),alt:q.name,onClick:()=>{We(q.url),qe(`image`),Ye(q.name),He(!0)},style:{width:`100%`,height:`100%`,objectFit:`cover`,borderRadius:8,cursor:`pointer`,border:`1px solid rgba(139, 92, 246, 0.2)`,boxShadow:`0 3px 10px rgba(47, 52, 64, 0.06)`}}),(0,$.jsx)(`button`,{onClick:Xt,style:{position:`absolute`,top:-6,right:-6,width:18,height:18,border:`none`,background:`#A45B5B`,borderRadius:50,cursor:`pointer`,color:`#fff`,fontSize:9,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 2px 4px rgba(164, 91, 91, 0.3)`,zIndex:10},children:(0,$.jsx)(u$,{style:{fontSize:9}})})]}):(0,$.jsx)(R7,{accept:`image/*`,multiple:!1,onLocalSelect:e=>{e.length>0&&cn(e[0],`first`)},onHistorySelect:t=>{if(t.length>0){let n=t[0];se({name:n.fileName||``,type:`image`,url:n.resourceUrl||n.previewUrl||n.displayUrl||``,role:`first_frame`,label:``}),e.success(`成功添加首帧`)}},onPortraitSelect:t=>{if(t.length>0){let n=t[0],r=n.previewUrl||n.displayUrl||n.videoCoverUrl||n.providerUrl||``;se({name:n.name||`首帧图片`,type:`image`,url:r,role:`first_frame`,label:``,source:`private_portrait_asset`,private_asset_id:n.id}),e.success(`成功添加首帧`)}},uploading:te,children:(0,$.jsxs)(`div`,{style:{position:`absolute`,left:10,right:10,bottom:10,height:64,borderRadius:8,border:`1px dashed rgba(139, 92, 246, 0.28)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,transition:`all 0.25s ease`,backgroundColor:`rgba(139, 92, 246, 0.04)`,flexDirection:`column`,gap:4},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#a78bfa`,e.currentTarget.style.backgroundColor=`rgba(139, 92, 246, 0.08)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`rgba(139, 92, 246, 0.28)`,e.currentTarget.style.backgroundColor=`rgba(139, 92, 246, 0.04)`},children:[(0,$.jsx)(rL,{style:{fontSize:18,color:`#8b5cf6`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#8b5cf6`,fontWeight:500},children:`上传首帧`})]})})]}),(0,$.jsx)(`button`,{onClick:Yt,disabled:!q||!ce,title:`调换首尾帧`,style:{width:32,height:32,alignSelf:`center`,borderRadius:50,border:`1px solid rgba(231, 234, 240, 0.95)`,background:q&&ce?`linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%)`:`#F3F5F8`,cursor:q&&ce?`pointer`:`not-allowed`,color:q&&ce?`#fff`:`#98A2B3`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:q&&ce?`0 6px 14px rgba(139, 92, 246, 0.24)`:`none`,transition:`all 0.2s ease`,flexShrink:0},onMouseEnter:e=>{q&&ce&&(e.currentTarget.style.transform=`scale(1.06)`)},onMouseLeave:e=>{e.currentTarget.style.transform=`scale(1)`},children:(0,$.jsx)(BU,{style:{fontSize:14}})}),(0,$.jsxs)(`div`,{style:{position:`relative`,flex:1,minWidth:0,height:100,borderRadius:12,border:`1px solid #E7EAF0`,background:`#ffffff`,boxShadow:`0 6px 16px rgba(47, 52, 64, 0.04)`,overflow:`hidden`,opacity:q?1:.5},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:8,left:10,right:10,display:`flex`,alignItems:`center`,justifyContent:`space-between`,zIndex:2},children:(0,$.jsx)(`span`,{style:{fontSize:11,fontWeight:600,color:`#8b5cf6`,lineHeight:1},children:`尾帧`})}),ce?(0,$.jsxs)(`div`,{style:{position:`absolute`,left:10,right:10,bottom:10,height:64},children:[(0,$.jsx)(`img`,{src:vn(ce.url),alt:ce.name,onClick:()=>{We(ce.url),qe(`image`),Ye(ce.name),He(!0)},style:{width:`100%`,height:`100%`,objectFit:`cover`,borderRadius:8,cursor:`pointer`,border:`1px solid rgba(139, 92, 246, 0.2)`,boxShadow:`0 3px 10px rgba(47, 52, 64, 0.06)`}}),(0,$.jsx)(`button`,{onClick:Zt,style:{position:`absolute`,top:-6,right:-6,width:18,height:18,border:`none`,background:`#A45B5B`,borderRadius:50,cursor:`pointer`,color:`#fff`,fontSize:9,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 2px 4px rgba(164, 91, 91, 0.3)`,zIndex:10},children:(0,$.jsx)(u$,{style:{fontSize:9}})})]}):q?(0,$.jsx)(R7,{accept:`image/*`,multiple:!1,onLocalSelect:e=>{e.length>0&&cn(e[0],`last`)},onHistorySelect:t=>{if(t.length>0){let n=t[0];le({name:n.fileName||``,type:`image`,url:n.resourceUrl||n.previewUrl||n.displayUrl||``,role:`last_frame`,label:``}),e.success(`成功添加尾帧`)}},onPortraitSelect:t=>{if(t.length>0){let n=t[0],r=n.previewUrl||n.displayUrl||n.videoCoverUrl||n.providerUrl||``;le({name:n.name||`尾帧图片`,type:`image`,url:r,role:`last_frame`,label:``,source:`private_portrait_asset`,private_asset_id:n.id}),e.success(`成功添加尾帧`)}},uploading:te,children:(0,$.jsxs)(`div`,{style:{position:`absolute`,left:10,right:10,bottom:10,height:64,borderRadius:8,border:`1px dashed rgba(139, 92, 246, 0.24)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,transition:`all 0.25s ease`,backgroundColor:`rgba(139, 92, 246, 0.04)`,flexDirection:`column`,gap:4},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#a78bfa`,e.currentTarget.style.backgroundColor=`rgba(139, 92, 246, 0.08)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`rgba(139, 92, 246, 0.24)`,e.currentTarget.style.backgroundColor=`rgba(139, 92, 246, 0.04)`},children:[(0,$.jsx)(rL,{style:{fontSize:18,color:`#8b5cf6`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#8b5cf6`,fontWeight:500},children:`上传尾帧`})]})}):(0,$.jsxs)(`div`,{style:{position:`absolute`,left:10,right:10,bottom:10,height:64,borderRadius:8,border:`1px dashed rgba(226, 232, 240, 0.4)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`not-allowed`,backgroundColor:`rgba(241, 245, 249, 0.5)`,flexDirection:`column`,gap:4},children:[(0,$.jsx)(rL,{style:{fontSize:18,color:`#cbd5e1`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#94a3b8`,fontWeight:500},children:`请先上传首帧`})]})]})]}):(0,$.jsx)($.Fragment,{children:!(c===`video`&&oe===`first_last_frame`)&&(0,$.jsxs)(`div`,{style:{position:`relative`,width:64,height:72,marginTop:`-10`},onMouseEnter:xe,onMouseLeave:Se,children:[F.length===0&&(0,$.jsx)(R7,{accept:c===`image`?`image/*`:`image/*,video/*,audio/*`,onLocalSelect:un,onHistorySelect:mn,onPortraitLibrarySelect:e=>{gn(e)},uploading:te,tooltipTitle:c===`image`?`图片${F.filter(e=>e.type===`image`).length}/${z}`:`图片${F.filter(e=>e.type===`image`).length}/${z}, 视频${F.filter(e=>e.type===`video`).length}/${B}${Pn>0?`, 音频${F.filter(e=>e.type===`audio`).length}/${Pn}`:``}`,maxImageCount:z,maxVideoCount:B,usedImageCount:F.filter(e=>e.type===`image`).length,usedVideoCount:F.filter(e=>e.type===`video`).length,usedVideoDuration:F.filter(e=>e.type===`video`).reduce((e,t)=>e+(t.duration||0),0),maxVideoDuration:15,maxAudioCount:Pn>0?Pn:void 0,usedAudioCount:F.filter(e=>e.type===`audio`).length,maxAudioDuration:15,usedAudioDuration:F.filter(e=>e.type===`audio`).reduce((e,t)=>e+(t.duration||0),0),hideLimitHint:c===`image`,mediaType:c,children:(0,$.jsx)(`div`,{style:{width:54,height:74,borderRadius:7,border:`1px solid rgba(231, 234, 240, 0.95)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,transition:`all 0.25s ease`,background:`#f4f4f4`,flexDirection:`column`,gap:5,transform:`rotate(-7deg)`},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#D7DDE7`,e.currentTarget.style.background=`#f4f4f4`,e.currentTarget.style.transform=`rotate(0deg) translateY(-2px)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`rgba(231, 234, 240, 0.95)`,e.currentTarget.style.background=`#f4f4f4`,e.currentTarget.style.transform=`rotate(-7deg)`},children:te?(0,$.jsx)(Xm,{style:{fontSize:17,color:`#667085`}}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(rL,{style:{fontSize:18,color:`#667085`,lineHeight:1}}),(0,$.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(2, 14px)`,columnGap:2,justifyContent:`center`,color:`#344054`,fontSize:12,fontWeight:700,lineHeight:1.05,letterSpacing:0},children:[(0,$.jsxs)(`span`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,gap:1},children:[(0,$.jsx)(`span`,{children:`参`}),(0,$.jsx)(`span`,{children:`考`})]}),(0,$.jsxs)(`span`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,gap:1},children:[(0,$.jsx)(`span`,{children:`内`}),(0,$.jsx)(`span`,{children:`容`})]})]})]})})}),F.length>0&&(0,$.jsx)($.Fragment,{children:F.map((e,t)=>{let n=Math.min(F.length,3)-1-t,r=ve?t*58:t<3?t*6:18,i=ve?!0:t<3;return(0,$.jsx)(`div`,{style:{position:`absolute`,left:r,bottom:0,zIndex:t+1,transition:`all 0.28s cubic-bezier(0.4, 0, 0.2, 1)`,transform:ve?`scale(1) rotate(0deg)`:`scale(${t<3?1-n*.08:0}) rotate(${t<3?-3+t*1.5:0}deg)`,opacity:i?ve?1:1-n*.15:0,pointerEvents:i?`auto`:`none`},children:(0,$.jsxs)(`div`,{style:{position:`relative`,width:52,height:60},children:[e.type===`image`?(0,$.jsx)(`img`,{src:vn(e.url),alt:e.name,onClick:()=>{We(e.url),qe(`image`),Ye(e.name),He(!0)},style:{width:52,height:60,objectFit:`cover`,borderRadius:10,cursor:`pointer`,border:`1px solid rgba(255,255,255,0.98)`,boxShadow:`0 4px 12px rgba(31,41,55,0.15)`}}):e.type===`video`?(0,$.jsx)(`video`,{src:vn(e.url),muted:!0,onClick:()=>{We(e.url),qe(`video`),Ye(e.name),He(!0)},style:{width:52,height:60,objectFit:`cover`,borderRadius:10,cursor:`pointer`,border:`1px solid rgba(255,255,255,0.98)`,boxShadow:`0 4px 12px rgba(31,41,55,0.15)`}}):(0,$.jsx)(`div`,{onClick:t=>{t.stopPropagation(),nn(e.url)},style:{width:52,height:60,objectFit:`cover`,borderRadius:10,cursor:`pointer`,border:`1px solid rgba(255,255,255,0.98)`,boxShadow:`0 4px 12px rgba(31,41,55,0.15)`,background:`linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:Ze===vn(e.url)?(0,$.jsx)(k6,{style:{fontSize:20,color:`#fff`}}):(0,$.jsx)(k2,{style:{fontSize:20,color:`#fff`}})}),(0,$.jsx)(`button`,{onClick:()=>yn(t),style:{position:`absolute`,top:-6,right:-6,width:20,height:20,borderRadius:50,background:`#1f2937`,border:`none`,color:`#fff`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 2px 6px rgba(0,0,0,0.2)`,zIndex:10,transition:`all 0.2s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`#dc2626`,e.currentTarget.style.transform=`scale(1.1)`},onMouseLeave:e=>{e.currentTarget.style.background=`#1f2937`,e.currentTarget.style.transform=`scale(1)`},children:(0,$.jsx)(u$,{style:{fontSize:10}})})]})},`stack-${t}`)})}),F.length>0&&(0,$.jsx)(R7,{accept:c===`image`?`image/*`:`image/*,video/*,audio/*`,onLocalSelect:un,onHistorySelect:mn,onPortraitLibrarySelect:e=>{gn(e)},uploading:te,tooltipTitle:c===`image`?`图片${F.filter(e=>e.type===`image`).length}/${z}`:`图片${F.filter(e=>e.type===`image`).length}/${z}, 视频${F.filter(e=>e.type===`video`).length}/${B}${Pn>0?`, @@ -523,16 +579,16 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho from { opacity: 0; transform: translateY(6px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } } - `}),(0,$.jsx)(mK,{open:Ae,title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(180deg, #8b5cf6 0%, #ddd6fe 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:700,color:`#8b5cf6`,letterSpacing:.4},children:`预览`})]}),onCancel:wn,width:800,footer:(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:12,padding:`16px 24px`,background:`rgba(255,255,255,0.6)`,borderTop:`1px solid rgba(139, 92, 246, 0.08)`},children:(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(m0,{}),onClick:Tn,style:{borderRadius:10,background:`linear-gradient(135deg, #8b5cf6 0%, #ddd6fe 100%)`,border:`none`,boxShadow:`0 8px 18px rgba(47, 52, 64, 0.15)`},disabled:Be(Me),children:Be(Me)?`资源已过期`:`下载`})}),centered:!0,style:{borderRadius:16},styles:{body:{display:`flex`,alignItems:`center`,justifyContent:`center`,minHeight:`400px`},header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(139, 92, 246, 0.08)`,padding:`16px 24px`}},children:(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:`100%`,height:`100%`},children:Be(Me)?(0,$.jsx)(`div`,{style:{textAlign:`center`,padding:`40px`},children:(0,$.jsx)(`p`,{style:{fontSize:16,color:`#A45B5B`,marginBottom:16},children:`图片/视频资源已过期,请刷新重新加载~`})}):Pe===`image`?(0,$.jsx)(`img`,{src:`${Me}`,alt:`预览`,style:{width:`100%`,maxHeight:`400px`,objectFit:`contain`}}):(0,$.jsx)(`video`,{ref:Ie,src:`${Me}`,controls:!0,style:{maxWidth:`100%`,maxHeight:`400px`}})})}),(0,$.jsx)(mK,{open:Ve,title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(180deg, #8b5cf6 0%, #ddd6fe 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:700,color:`#8b5cf6`,letterSpacing:.4},children:`附件预览`})]}),onCancel:()=>{if(Xe.current){let e=Xe.current;e.pause(),e.muted=!0,e.currentTime=0}He(!1)},afterClose:()=>{if(Xe.current){let e=Xe.current;e.pause(),e.muted=!0}},width:800,footer:(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:12,padding:`16px 24px`,background:`rgba(255,255,255,0.6)`,borderTop:`1px solid rgba(139, 92, 246, 0.08)`},children:(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(m0,{}),onClick:()=>{if(!Ue)return;let e=document.createElement(`a`);e.href=`http://ceshi.apiforeign.minzhong.cn${Ue}&download=1`,e.download=Je||(Ge===`image`?`image.png`:`video.mp4`),document.body.appendChild(e),e.click(),document.body.removeChild(e)},style:{borderRadius:10,background:`linear-gradient(135deg, #8b5cf6 0%, #ddd6fe 100%)`,border:`none`,boxShadow:`0 8px 18px rgba(47, 52, 64, 0.15)`},children:`下载`})}),centered:!0,style:{borderRadius:16},styles:{body:{display:`flex`,alignItems:`center`,justifyContent:`center`,minHeight:`400px`},header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(139, 92, 246, 0.08)`,padding:`16px 24px`}},children:(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:`100%`,height:`100%`},children:Ge===`image`?(0,$.jsx)(`img`,{src:vn(Ue),alt:`预览`,style:{width:`100%`,maxHeight:`400px`,objectFit:`contain`}}):(0,$.jsx)(`video`,{ref:Xe,src:vn(Ue),controls:!0,playsInline:!0,style:{maxWidth:`100%`,maxHeight:`400px`}})})}),(0,$.jsx)(M7,{open:me,libraryType:ge,onClose:()=>he(!1),onSelect:_n,selectedIds:F.map(e=>e.private_asset_id).filter(Boolean),maxCount:Math.max(1,Mn+Nn),maxImageCount:z,maxVideoCount:B,usedImageCount:F.filter(e=>e.type===`image`).length,usedVideoCount:F.filter(e=>e.type===`video`).length,usedVideoDuration:F.filter(e=>e.type===`video`).reduce((e,t)=>e+(t.duration||0),0),maxVideoDuration:15,accept:c===`image`?`image/*`:`image/*,video/*`})]})},{Header:rse,Content:ise}=GW,{TextArea:ase}=IW,ose=`http://ceshi.apiforeign.minzhong.cn`,s9=e=>e?/^https?:\/\//i.test(e)||e.startsWith(`blob:`)?e:`${ose}${e}`:``,sse=()=>{let e=Ye(),[t,n]=(0,S.useState)([]),[r,i]=(0,S.useState)(1),[a,o]=(0,S.useState)(20),[s,c]=(0,S.useState)(0),[l,u]=(0,S.useState)(``),[d,f]=(0,S.useState)([]),[p,m]=(0,S.useState)(1),[h,g]=(0,S.useState)(8),[_,v]=(0,S.useState)(0),[y,b]=(0,S.useState)(``),[x,C]=(0,S.useState)(``),[w,T]=(0,S.useState)(``),[E,D]=(0,S.useState)(null),[O,k]=(0,S.useState)(``),[A,j]=(0,S.useState)(``),[M,N]=(0,S.useState)(null),[P,F]=(0,S.useState)(null),[I,L]=(0,S.useState)(``),[R,z]=(0,S.useState)(``),[B,V]=(0,S.useState)(!1),[H,U]=(0,S.useState)(!1),[W,ee]=(0,S.useState)(!1),te=(0,S.useRef)(null),G=(0,S.useRef)(null),ne=(e,t,n=!1)=>{U5(e,t).then(e=>{if(e.items){f(n?t=>t.map(t=>{let n=e.items.find(e=>e.id===t.id);return n&&n.status!==t.status?n:t}):e.items);let t=e.items.some(e=>e.status===`processing`);t&&!te.current?te.current=setInterval(()=>{ne(p,h,!0)},5e3):!t&&te.current&&(clearInterval(te.current),te.current=null)}e.total!==void 0&&v(e.total)}).catch(e=>{})},re=e=>{m(e),ne(e,h)},ie=(e,t,i=!1,o)=>{U5(e,t,o).then(e=>{if(e.items){n(i?t=>t.map(t=>{let n=e.items.find(e=>e.id===t.id);return n&&n.status!==t.status?n:t}):e.items);let t=e.items.some(e=>e.status===`processing`);t&&!G.current?G.current=setInterval(()=>{ie(r,a,!0,l)},5e3):!t&&G.current&&(clearInterval(G.current),G.current=null)}e.total!==void 0&&c(e.total)}).catch(e=>{})};(0,S.useEffect)(()=>(ie(r,a),ne(p,h),()=>{te.current&&=(clearInterval(te.current),null),G.current&&=(clearInterval(G.current),null)}),[]);let ae=(e,t)=>{i(e),o(t),ie(e,t,!1,l)},oe=()=>{i(1),ie(1,a,!1,l)};return(0,$.jsxs)(`div`,{className:`replication-container`,style:{margin:`-24px -32px -32px`,height:`calc(100vh - 34px)`,display:`flex`,justifyContent:`space-between`,alignItems:`stretch`,gap:`2%`,position:`relative`,boxSizing:`border-box`},children:[(0,$.jsxs)(`div`,{className:`replication-preview`,style:{width:`70%`,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(20px)`,display:`flex`,flexDirection:`column`,borderRadius:20,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`,position:`relative`,zIndex:10},children:[(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,padding:`16px 24px`,paddingBottom:0,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(139, 92, 246, 0.04) 100%)`,backdropFilter:`blur(10px)`,border:`1px solid rgba(99, 102, 241, 0.08)`,position:`relative`,overflow:`hidden`,flexWrap:`wrap`,gap:12},children:[(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16,paddingBottom:12},children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{style:{margin:0,fontSize:18,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`爆款复刻`}),(0,$.jsx)(`p`,{style:{fontSize:13,color:`#64748b`,margin:`4px 0 0 0`},children:`上传参考视频与产品图片,一键复刻爆款视频开头`})]})}),(0,$.jsx)(X,{type:`primary`,ghost:!0,style:{borderRadius:10,padding:`6px 16px`,fontSize:13,background:`rgba(99, 102, 241, 0.1)`,borderColor:`rgba(99, 102, 241, 0.2)`,color:`#6366f1`},onClick:()=>ee(!0),children:`创作记录`})]}),(0,$.jsx)(`div`,{style:{flex:1,background:`rgba(248, 250, 252, 0.5)`,borderRight:`1px solid rgba(99, 102, 241, 0.08)`,overflowY:`auto`},children:d.length>0?(0,$.jsxs)(`div`,{style:{height:`100%`,padding:`24px`},children:[(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:24},children:(0,$.jsx)(`h2`,{style:{margin:0,fontSize:16,fontWeight:600,color:`#1e293b`},children:`历史生成作品`})}),(0,$.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(190px, 1fr))`,gap:16},children:d.map(t=>(0,$.jsxs)(`div`,{style:{background:`rgba(255,255,255,0.9)`,border:`1px solid rgba(99, 102, 241, 0.6)`,backdropFilter:`blur(10px)`,borderRadius:16,overflow:`hidden`,boxShadow:`0 4px 16px rgba(99, 102, 241, 0.06)`,cursor:`pointer`,transition:`transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1)`},onClick:()=>e(`/initial/${t.id}/initialinfo`),onMouseEnter:e=>{e.currentTarget.style.transform=`translateY(-6px)`,e.currentTarget.style.boxShadow=`0 12px 32px rgba(99, 102, 241, 0.12)`},onMouseLeave:e=>{e.currentTarget.style.transform=`translateY(0)`,e.currentTarget.style.boxShadow=`0 4px 16px rgba(99, 102, 241, 0.06)`},children:[(0,$.jsxs)(`div`,{style:{position:`relative`,aspectRatio:`1/1`,background:`#f8fafc`},children:[t.finalVideoUrl?(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn${t.finalVideoCoverUrl}`,alt:t.targetProjectName,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`div`,{style:{width:60,height:60,borderRadius:`50%`,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(t5,{style:{fontSize:24,color:`#fff`}})})}),(0,$.jsx)(`div`,{style:{position:`absolute`,bottom:8,right:8,padding:`4px 12px`,background:`rgba(0,0,0,0.7)`,borderRadius:16,fontSize:10,color:`#fff`,backdropFilter:`blur(4px)`},children:(()=>{let e=t.status,n=t.current_step_code||t.currentStepCode;if(n===`image_prompt_optimize`)switch(e){case`waiting_user`:return`等待融合图生成`;case`processing`:return`图片提示词生成中`;case`completed`:return`图片提示词生成成功`;case`failed`:return`图片提示词生成失败`;default:return e||`待处理`}else if(n===`image_generate`)switch(e){case`waiting_user`:return`等待生成视频提示词`;case`processing`:return`融合图生成中`;case`completed`:return`融合图生成成功`;case`failed`:return`融合图生成失败`;default:return e||`待处理`}else if(n===`video_prompt_optimize`)switch(e){case`waiting_user`:return`等待最终视频生成`;case`processing`:return`视频提示词生成中`;case`completed`:return`视频提示词生成成功`;case`failed`:return`视频提示词生成失败`;default:return e||`待处理`}else if(n===`video_generate`)switch(e){case`waiting_user`:return``;case`processing`:return`最终视频生成中`;case`completed`:return`最终视频生成成功`;case`failed`:return`最终视频生成失败`;default:return e||`待处理`}else if(n===`material_input`)switch(e){case`waiting_user`:return`等待生成图片提示词`;case`processing`:return`素材处理中`;case`completed`:return`素材上传成功`;case`failed`:return`素材上传失败`;default:return e||`待处理`}else return{pending:`子任务待处理`,waiting_user:`等待用户确认或触发`,processing:`子任务处理中`,completed:`子任务完成`,failed:`子任务失败`,cancelled:`子任务取消`}[e]||e||`待处理`})()})]}),(0,$.jsxs)(`div`,{style:{padding:14},children:[(0,$.jsx)(`h4`,{style:{margin:0,fontSize:14,fontWeight:600,color:`#1e293b`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:t.targetProjectName||`未命名作品`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginTop:6},children:[(0,$.jsx)(`p`,{style:{margin:0,fontSize:12,color:`#64748b`},children:t.createdAt?new Date(t.createdAt).toLocaleDateString(`zh-CN`):``}),(()=>{let e=t.status;return e===`waiting_user`?(0,$.jsx)(`span`,{style:{fontSize:11,color:`#f59e0b`},children:`等待下一步`}):e===`processing`?(0,$.jsxs)(`span`,{style:{fontSize:11,color:`#6366f1`,display:`flex`,alignItems:`center`},children:[(0,$.jsx)(`span`,{children:`进行中`}),(0,$.jsx)(`span`,{style:{animation:`dots 1s infinite`},children:`...`}),(0,$.jsx)(`style`,{children:` + `}),(0,$.jsx)(mK,{open:Ae,title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(180deg, #8b5cf6 0%, #ddd6fe 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:700,color:`#8b5cf6`,letterSpacing:.4},children:`预览`})]}),onCancel:wn,width:800,footer:(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:12,padding:`16px 24px`,background:`rgba(255,255,255,0.6)`,borderTop:`1px solid rgba(139, 92, 246, 0.08)`},children:(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(m0,{}),onClick:Tn,style:{borderRadius:10,background:`linear-gradient(135deg, #8b5cf6 0%, #ddd6fe 100%)`,border:`none`,boxShadow:`0 8px 18px rgba(47, 52, 64, 0.15)`},disabled:Be(Me),children:Be(Me)?`资源已过期`:`下载`})}),centered:!0,style:{borderRadius:16},styles:{body:{display:`flex`,alignItems:`center`,justifyContent:`center`,minHeight:`400px`},header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(139, 92, 246, 0.08)`,padding:`16px 24px`}},children:(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:`100%`,height:`100%`},children:Be(Me)?(0,$.jsx)(`div`,{style:{textAlign:`center`,padding:`40px`},children:(0,$.jsx)(`p`,{style:{fontSize:16,color:`#A45B5B`,marginBottom:16},children:`图片/视频资源已过期,请刷新重新加载~`})}):Pe===`image`?(0,$.jsx)(`img`,{src:`${Me}`,alt:`预览`,style:{width:`100%`,maxHeight:`400px`,objectFit:`contain`}}):(0,$.jsx)(`video`,{ref:Ie,src:`${Me}`,controls:!0,style:{maxWidth:`100%`,maxHeight:`400px`}})})}),(0,$.jsx)(mK,{open:Ve,title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(180deg, #8b5cf6 0%, #ddd6fe 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:700,color:`#8b5cf6`,letterSpacing:.4},children:`附件预览`})]}),onCancel:()=>{if(Xe.current){let e=Xe.current;e.pause(),e.muted=!0,e.currentTime=0}He(!1)},afterClose:()=>{if(Xe.current){let e=Xe.current;e.pause(),e.muted=!0}},width:800,footer:(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:12,padding:`16px 24px`,background:`rgba(255,255,255,0.6)`,borderTop:`1px solid rgba(139, 92, 246, 0.08)`},children:(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(m0,{}),onClick:()=>{if(!Ue)return;let e=document.createElement(`a`);e.href=`http://ceshi.apiforeign.minzhong.cn${Ue}&download=1`,e.download=Je||(Ge===`image`?`image.png`:`video.mp4`),document.body.appendChild(e),e.click(),document.body.removeChild(e)},style:{borderRadius:10,background:`linear-gradient(135deg, #8b5cf6 0%, #ddd6fe 100%)`,border:`none`,boxShadow:`0 8px 18px rgba(47, 52, 64, 0.15)`},children:`下载`})}),centered:!0,style:{borderRadius:16},styles:{body:{display:`flex`,alignItems:`center`,justifyContent:`center`,minHeight:`400px`},header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(139, 92, 246, 0.08)`,padding:`16px 24px`}},children:(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:`100%`,height:`100%`},children:Ge===`image`?(0,$.jsx)(`img`,{src:vn(Ue),alt:`预览`,style:{width:`100%`,maxHeight:`400px`,objectFit:`contain`}}):(0,$.jsx)(`video`,{ref:Xe,src:vn(Ue),controls:!0,playsInline:!0,style:{maxWidth:`100%`,maxHeight:`400px`}})})}),(0,$.jsx)(M7,{open:me,libraryType:ge,onClose:()=>he(!1),onSelect:_n,selectedIds:F.map(e=>e.private_asset_id).filter(Boolean),maxCount:Math.max(1,Mn+Nn),maxImageCount:z,maxVideoCount:B,usedImageCount:F.filter(e=>e.type===`image`).length,usedVideoCount:F.filter(e=>e.type===`video`).length,usedVideoDuration:F.filter(e=>e.type===`video`).reduce((e,t)=>e+(t.duration||0),0),maxVideoDuration:15,accept:c===`image`?`image/*`:`image/*,video/*`})]})},{Header:rse,Content:ise}=GW,{TextArea:ase}=IW,ose=`http://ceshi.apiforeign.minzhong.cn`,s9=e=>e?/^https?:\/\//i.test(e)||e.startsWith(`blob:`)?e:`${ose}${e}`:``,sse=()=>{let e=Ye(),[t,n]=(0,S.useState)([]),[r,i]=(0,S.useState)(1),[a,o]=(0,S.useState)(20),[s,c]=(0,S.useState)(0),[l,u]=(0,S.useState)(``),[d,f]=(0,S.useState)([]),[p,m]=(0,S.useState)(1),[h,g]=(0,S.useState)(8),[_,v]=(0,S.useState)(0),[y,b]=(0,S.useState)(``),[x,C]=(0,S.useState)(``),[w,T]=(0,S.useState)(``),[E,D]=(0,S.useState)(null),[O,k]=(0,S.useState)(``),[A,j]=(0,S.useState)(``),[M,N]=(0,S.useState)(null),[P,F]=(0,S.useState)(null),[I,L]=(0,S.useState)(``),[R,z]=(0,S.useState)(``),[B,V]=(0,S.useState)(!1),[H,U]=(0,S.useState)(!1),[W,ee]=(0,S.useState)(!1),te=(0,S.useRef)(null),G=(0,S.useRef)(null),ne=(e,t,n=!1)=>{U5(e,t).then(e=>{if(e.items){f(n?t=>t.map(t=>{let n=e.items.find(e=>e.id===t.id);return n&&n.status!==t.status?n:t}):e.items);let t=e.items.some(e=>e.status===`processing`);t&&!te.current?te.current=setInterval(()=>{ne(p,h,!0)},5e3):!t&&te.current&&(clearInterval(te.current),te.current=null)}e.total!==void 0&&v(e.total)}).catch(e=>{})},re=e=>{m(e),ne(e,h)},ie=(e,t,i=!1,o)=>{U5(e,t,o).then(e=>{if(e.items){n(i?t=>t.map(t=>{let n=e.items.find(e=>e.id===t.id);return n&&n.status!==t.status?n:t}):e.items);let t=e.items.some(e=>e.status===`processing`);t&&!G.current?G.current=setInterval(()=>{ie(r,a,!0,l)},5e3):!t&&G.current&&(clearInterval(G.current),G.current=null)}e.total!==void 0&&c(e.total)}).catch(e=>{})};(0,S.useEffect)(()=>(ie(r,a),ne(p,h),()=>{te.current&&=(clearInterval(te.current),null),G.current&&=(clearInterval(G.current),null)}),[]);let ae=(e,t)=>{i(e),o(t),ie(e,t,!1,l)},oe=()=>{i(1),ie(1,a,!1,l)};return(0,$.jsxs)(`div`,{className:`replication-container`,style:{margin:`-24px -32px -32px`,height:`calc(100vh - 34px)`,display:`flex`,justifyContent:`space-between`,alignItems:`stretch`,gap:`2%`,position:`relative`,boxSizing:`border-box`},children:[(0,$.jsxs)(`div`,{className:`replication-preview`,style:{width:`70%`,background:`#f1f2f3`,backdropFilter:`blur(20px)`,display:`flex`,flexDirection:`column`,borderRadius:20,overflow:`hidden`,position:`relative`,zIndex:10},children:[(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,padding:`16px 24px`,paddingBottom:0,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(139, 92, 246, 0.04) 100%)`,backdropFilter:`blur(10px)`,border:`1px solid rgba(99, 102, 241, 0.08)`,position:`relative`,overflow:`hidden`,flexWrap:`wrap`,gap:12},children:[(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16,paddingBottom:12},children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{style:{margin:0,fontSize:18,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`爆款复刻`}),(0,$.jsx)(`p`,{style:{fontSize:13,color:`#64748b`,margin:`4px 0 0 0`},children:`上传参考视频与产品图片,一键复刻爆款视频开头`})]})}),(0,$.jsx)(X,{type:`primary`,ghost:!0,style:{borderRadius:10,padding:`6px 16px`,fontSize:13,background:`rgba(99, 102, 241, 0.1)`,borderColor:`rgba(99, 102, 241, 0.2)`,color:`#6366f1`},onClick:()=>ee(!0),children:`创作记录`})]}),(0,$.jsx)(`div`,{style:{flex:1,background:`transparent`,borderRight:`1px solid rgba(99, 102, 241, 0.08)`,overflowY:`auto`,scrollbarWidth:`none`},children:d.length>0?(0,$.jsxs)(`div`,{style:{height:`100%`,padding:`24px`},children:[(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:24},children:(0,$.jsx)(`h2`,{style:{margin:0,fontSize:16,fontWeight:600,color:`#1e293b`},children:`历史生成作品`})}),(0,$.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fill, minmax(190px, 1fr))`,gap:16},children:d.map(t=>(0,$.jsxs)(`div`,{style:{border:`1px solid rgba(99, 102, 241, 0.6)`,backdropFilter:`blur(10px)`,borderRadius:16,overflow:`hidden`,boxShadow:`0 4px 16px rgba(99, 102, 241, 0.06)`,cursor:`pointer`,transition:`transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1)`},onClick:()=>e(`/initial/${t.id}/initialinfo`),onMouseEnter:e=>{e.currentTarget.style.transform=`translateY(-6px)`,e.currentTarget.style.boxShadow=`0 12px 32px rgba(99, 102, 241, 0.12)`},onMouseLeave:e=>{e.currentTarget.style.transform=`translateY(0)`,e.currentTarget.style.boxShadow=`0 4px 16px rgba(99, 102, 241, 0.06)`},children:[(0,$.jsxs)(`div`,{style:{position:`relative`,aspectRatio:`1/1`},children:[t.finalVideoUrl?(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn${t.finalVideoCoverUrl}`,alt:t.targetProjectName,style:{width:`100%`,height:`100%`,objectFit:`cover`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`div`,{style:{width:60,height:60,borderRadius:`50%`,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(t5,{style:{fontSize:24,color:`#fff`}})})}),(0,$.jsx)(`div`,{style:{position:`absolute`,bottom:8,right:8,padding:`4px 12px`,background:`rgba(0,0,0,0.7)`,borderRadius:16,fontSize:10,color:`#fff`,backdropFilter:`blur(4px)`},children:(()=>{let e=t.status,n=t.current_step_code||t.currentStepCode;if(n===`image_prompt_optimize`)switch(e){case`waiting_user`:return`等待融合图生成`;case`processing`:return`图片提示词生成中`;case`completed`:return`图片提示词生成成功`;case`failed`:return`图片提示词生成失败`;default:return e||`待处理`}else if(n===`image_generate`)switch(e){case`waiting_user`:return`等待生成视频提示词`;case`processing`:return`融合图生成中`;case`completed`:return`融合图生成成功`;case`failed`:return`融合图生成失败`;default:return e||`待处理`}else if(n===`video_prompt_optimize`)switch(e){case`waiting_user`:return`等待最终视频生成`;case`processing`:return`视频提示词生成中`;case`completed`:return`视频提示词生成成功`;case`failed`:return`视频提示词生成失败`;default:return e||`待处理`}else if(n===`video_generate`)switch(e){case`waiting_user`:return``;case`processing`:return`最终视频生成中`;case`completed`:return`最终视频生成成功`;case`failed`:return`最终视频生成失败`;default:return e||`待处理`}else if(n===`material_input`)switch(e){case`waiting_user`:return`等待生成图片提示词`;case`processing`:return`素材处理中`;case`completed`:return`素材上传成功`;case`failed`:return`素材上传失败`;default:return e||`待处理`}else return{pending:`子任务待处理`,waiting_user:`等待用户确认或触发`,processing:`子任务处理中`,completed:`子任务完成`,failed:`子任务失败`,cancelled:`子任务取消`}[e]||e||`待处理`})()})]}),(0,$.jsxs)(`div`,{style:{padding:14},children:[(0,$.jsx)(`h4`,{style:{margin:0,fontSize:14,fontWeight:600,color:`#1e293b`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:t.targetProjectName||`未命名作品`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginTop:6},children:[(0,$.jsx)(`p`,{style:{margin:0,fontSize:12,color:`#64748b`},children:t.createdAt?new Date(t.createdAt).toLocaleDateString(`zh-CN`):``}),(()=>{let e=t.status;return e===`waiting_user`?(0,$.jsx)(`span`,{style:{fontSize:11,color:`#f59e0b`},children:`等待下一步`}):e===`processing`?(0,$.jsxs)(`span`,{style:{fontSize:11,color:`#6366f1`,display:`flex`,alignItems:`center`},children:[(0,$.jsx)(`span`,{children:`进行中`}),(0,$.jsx)(`span`,{style:{animation:`dots 1s infinite`},children:`...`}),(0,$.jsx)(`style`,{children:` @keyframes dots { 0%, 20% { opacity: 0; } 50% { opacity: 1; } 100% { opacity: 0; } } - `})]}):e===`failed`?(0,$.jsx)(`span`,{style:{fontSize:11,color:`#ef4444`},children:`失败`}):e===`completed`&&t.finalVideoUrl?(0,$.jsx)(`span`,{style:{fontSize:11,color:`#10b981`},children:`任务完成`}):null})()]})]})]},t.id))}),(0,$.jsx)(`div`,{style:{paddingTop:20,paddingBottom:20,display:`flex`,justifyContent:`center`},children:(0,$.jsx)(SG,{current:p,pageSize:h,total:_,onChange:re,showSizeChanger:!1,showQuickJumper:!1,showTotal:e=>`共 ${e} 条`,itemRender:(e,t,n)=>t===`prev`?(0,$.jsx)(`button`,{style:{minWidth:32,height:32,border:`1px solid #e5e7eb`,borderRadius:6,background:p===1?`#f9fafb`:`#fff`,cursor:p===1?`not-allowed`:`pointer`,color:p===1?`#d1d5db`:`#6b7280`,fontSize:14},disabled:p===1,children:`‹`}):t===`next`?(0,$.jsx)(`button`,{style:{minWidth:32,height:32,border:`1px solid #e5e7eb`,borderRadius:6,background:p>=Math.ceil(_/h)?`#f9fafb`:`#fff`,cursor:p>=Math.ceil(_/h)?`not-allowed`:`pointer`,color:p>=Math.ceil(_/h)?`#d1d5db`:`#6b7280`,fontSize:14},disabled:p>=Math.ceil(_/h),children:`›`}):t===`page`?(0,$.jsx)(`button`,{style:{minWidth:32,height:32,border:`none`,borderRadius:6,background:e===p?`#6366f1`:`#fff`,color:e===p?`#fff`:`#374151`,fontWeight:e===p?500:400,cursor:`pointer`,fontSize:14},children:e}):n})})]}):(0,$.jsxs)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,padding:`40px`},children:[(0,$.jsxs)(`div`,{style:{width:120,height:120,display:`flex`,alignItems:`center`,justifyContent:`center`,marginBottom:24,position:`relative`},children:[(0,$.jsx)(`div`,{style:{width:60,height:60,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%)`,borderRadius:20,position:`absolute`,bottom:0,right:10}}),(0,$.jsx)(`div`,{style:{width:50,height:50,border:`2px solid rgba(99, 102, 241, 0.2)`,borderRadius:16,position:`absolute`,top:0,left:10}}),(0,$.jsx)(`div`,{style:{width:56,height:56,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:18,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 8px 24px rgba(99, 102, 241, 0.25)`},children:(0,$.jsx)(t5,{style:{fontSize:28,color:`#fff`}})})]}),(0,$.jsx)(`h3`,{style:{margin:0,fontSize:16,fontWeight:600,color:`#1e293b`,marginBottom:8},children:`暂无生成内容`}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:13,color:`#64748b`,textAlign:`center`,padding:`0 40px`,lineHeight:1.6},children:`请完善素材与卖点,生成专属爆款复刻视频`})]})})]}),(0,$.jsx)(`div`,{className:`replication-form`,style:{flex:1,overflow:`auto`,width:`28%`,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(20px)`,borderRadius:20,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`,position:`relative`,zIndex:10},children:(0,$.jsxs)(`div`,{className:`replication-form-content`,style:{width:`100%`,height:`100%`,background:`rgba(248, 250, 252, 0.5)`,padding:24,overflowY:`auto`},children:[(0,$.jsxs)(`div`,{style:{marginBottom:20},children:[(0,$.jsx)(`p`,{style:{margin:0,fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10},children:`上传复刻视频`}),O?(0,$.jsxs)(`div`,{style:{position:`relative`},children:[(0,$.jsx)(`video`,{src:s9(O),controls:!0,style:{width:`100%`,borderRadius:12,maxHeight:200,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.08)`}}),(0,$.jsx)(`button`,{onClick:()=>{O&&URL.revokeObjectURL(O),D(null),k(``)},style:{position:`absolute`,top:8,right:8,width:28,height:28,border:`none`,background:`rgba(239, 68, 68, 0.9)`,borderRadius:`50%`,cursor:`pointer`,color:`#fff`,fontSize:16,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:10,transition:`all 0.2s`},children:`×`}),(0,$.jsxs)(`div`,{style:{marginTop:10,display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(t5,{style:{color:`#6366f1`,fontSize:14}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#475569`},children:E?.name}),(0,$.jsxs)(`span`,{style:{fontSize:11,color:`#94a3b8`},children:[`(`,E?.size?(E.size/1024/1024).toFixed(2):0,`MB)`]})]})]}):(0,$.jsx)(b0,{style:{width:`100%`},beforeUpload:async e=>{if(!e.type.startsWith(`video/`))return Z.error(`只能上传视频文件`),!1;if(!(e.size/1024/1024<50))return Z.error(`视频大小不能超过50MB`),!1;let t=document.createElement(`video`);return t.preload=`metadata`,new Promise(n=>{t.onloadedmetadata=async()=>{if(t.duration<2){Z.error(`视频时长不能少于2秒`),URL.revokeObjectURL(t.src),n(!1);return}if(t.duration>=16){Z.error(`视频时长不能超过15秒`),URL.revokeObjectURL(t.src),n(!1);return}V(!0);try{let r=await Aie(e,t.duration);D(e),k(r.url),j(r.resource_id||``),N(t.duration),Z.success(`视频上传成功`),n(!1)}catch(e){let t=``;if(e instanceof Error)try{t=JSON.parse(e.message).detail||e.message}catch{t=e.message}Z.error(t||`视频上传失败`),n(!1)}finally{V(!1),URL.revokeObjectURL(t.src)}},t.onerror=()=>{Z.error(`视频文件无效`),URL.revokeObjectURL(t.src),n(!1)},t.src=URL.createObjectURL(e)})},showUploadList:!1,accept:`video/mp4,video/quicktime,.mp4,.mov`,children:(0,$.jsx)(`div`,{style:{border:`2px dashed rgba(99, 102, 241, 0.3)`,borderRadius:12,padding:24,textAlign:`center`,cursor:`pointer`,transition:`all 0.25s cubic-bezier(0.4, 0, 0.2, 1)`,background:`rgba(99, 102, 241, 0.02)`},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#6366f1`,e.currentTarget.style.background=`rgba(99, 102, 241, 0.05)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.3)`,e.currentTarget.style.background=`rgba(99, 102, 241, 0.02)`},children:B?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{width:40,height:40,margin:`0 auto 12px`,border:`3px solid rgba(99, 102, 241, 0.2)`,borderTopColor:`#6366f1`,borderRadius:`50%`,animation:`spin 1s linear infinite`}}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:13,color:`#6366f1`,fontWeight:500},children:`上传中...`}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:11,color:`#94a3b8`,marginTop:4},children:`支持的文件类型:MP4、MOV | 视频最大时长:15 秒 | 最大大小:50M`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{width:48,height:48,margin:`0 auto 12px`,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%)`,borderRadius:16,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(t5,{style:{fontSize:24,color:`#6366f1`}})}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:13,color:`#475569`,fontWeight:500},children:`点击或拖拽上传视频`}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:11,color:`#94a3b8`,marginTop:4},children:`支持的文件类型:MP4、MOV | 视频最大时长:15 秒 | 最大大小:50M`})]})})})]}),(0,$.jsxs)(`div`,{style:{marginBottom:20},children:[(0,$.jsx)(`p`,{style:{margin:0,fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10},children:`上传产品图片`}),I?(0,$.jsxs)(`div`,{style:{position:`relative`},children:[(0,$.jsx)(`img`,{src:s9(I),alt:`产品图片`,style:{width:`100%`,borderRadius:12,maxHeight:200,objectFit:`contain`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.08)`}}),(0,$.jsx)(`button`,{onClick:()=>{I&&URL.revokeObjectURL(I),F(null),L(``)},style:{position:`absolute`,top:8,right:8,width:28,height:28,border:`none`,background:`rgba(239, 68, 68, 0.9)`,borderRadius:`50%`,cursor:`pointer`,color:`#fff`,fontSize:16,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:10,transition:`all 0.2s`},children:`×`}),(0,$.jsxs)(`div`,{style:{marginTop:10,display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(R6,{style:{color:`#6366f1`,fontSize:14}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#475569`},children:P?.name}),(0,$.jsxs)(`span`,{style:{fontSize:11,color:`#94a3b8`},children:[`(`,P?.size?(P.size/1024/1024).toFixed(2):0,`MB)`]})]})]}):(0,$.jsx)(b0,{style:{width:`100%`},beforeUpload:async e=>{if(!e.type.startsWith(`image/`))return Z.error(`只能上传图片文件`),!1;if(!(e.size/1024/1024<10))return Z.error(`图片大小不能超过10MB`),!1;let t=new Image;return new Promise(n=>{t.onload=async()=>{let r=t.width/t.height;Math.abs(r-.75)<.1||Math.abs(r-.5625),U(!0);try{let t=await kie(e);F(e),L(t.url),z(t.resource_id||``),Z.success(`图片上传成功`),n(!1)}catch(e){let t=``;if(e instanceof Error)try{t=JSON.parse(e.message).detail||e.message}catch{t=e.message}Z.error(t||`图片上传失败`),n(!1)}finally{U(!1),URL.revokeObjectURL(t.src)}},t.onerror=()=>{Z.error(`图片文件无效`),URL.revokeObjectURL(t.src),n(!1)},t.src=URL.createObjectURL(e)})},showUploadList:!1,accept:`image/jpeg,image/jpg,image/png,.jpg,.jpeg,.png`,children:(0,$.jsx)(`div`,{style:{border:`2px dashed rgba(99, 102, 241, 0.3)`,borderRadius:12,padding:20,textAlign:`center`,cursor:`pointer`,transition:`all 0.25s cubic-bezier(0.4, 0, 0.2, 1)`,background:`rgba(99, 102, 241, 0.02)`},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#6366f1`,e.currentTarget.style.background=`rgba(99, 102, 241, 0.05)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.3)`,e.currentTarget.style.background=`rgba(99, 102, 241, 0.02)`},children:H?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{width:36,height:36,margin:`0 auto 10px`,border:`3px solid rgba(99, 102, 241, 0.2)`,borderTopColor:`#6366f1`,borderRadius:`50%`,animation:`spin 1s linear infinite`}}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:13,color:`#6366f1`,fontWeight:500},children:`上传中...`}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:11,color:`#94a3b8`,marginTop:4},children:`支持 JPG, JPEG, PNG 格式,图片比例为 3:4 或 9:16 效果最佳`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{width:44,height:44,margin:`0 auto 10px`,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%)`,borderRadius:14,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(R6,{style:{fontSize:22,color:`#6366f1`}})}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:13,color:`#475569`,fontWeight:500},children:`+ 点击上传`}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:11,color:`#94a3b8`,marginTop:4},children:`支持 JPG, JPEG, PNG 格式,图片比例为 3:4 或 9:16 效果最佳`})]})})})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`p`,{style:{margin:0,fontSize:13,fontWeight:500,color:`#475569`,marginBottom:8},children:`原视频产品名称`}),(0,$.jsx)(IW,{value:y,onChange:e=>b(e.target.value),placeholder:`请输入原视频产品名称`,style:{borderRadius:10,height:40,fontSize:13,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`},maxLength:10,suffix:(0,$.jsxs)(`span`,{style:{color:`#94a3b8`,fontSize:12},children:[y.length,`/10`]})})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`p`,{style:{margin:0,fontSize:13,fontWeight:500,color:`#475569`,marginBottom:8},children:`自有产品名称`}),(0,$.jsx)(IW,{value:x,onChange:e=>C(e.target.value),placeholder:`请输入自有产品名称`,style:{borderRadius:10,height:40,fontSize:13,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`},maxLength:10,suffix:(0,$.jsxs)(`span`,{style:{color:`#94a3b8`,fontSize:12},children:[x.length,`/10`]})})]}),(0,$.jsxs)(`div`,{style:{marginBottom:24},children:[(0,$.jsx)(`p`,{style:{margin:0,fontSize:13,fontWeight:500,color:`#475569`,marginBottom:8},children:`产品卖点`}),(0,$.jsxs)(`div`,{style:{position:`relative`},children:[(0,$.jsx)(ase,{value:w,onChange:e=>T(e.target.value),placeholder:`请输入产品卖点`,style:{borderRadius:10,fontSize:13,height:80,resize:`none`,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`},rows:3,maxLength:30}),(0,$.jsxs)(`span`,{style:{position:`absolute`,right:10,bottom:8,color:`#94a3b8`,fontSize:12},children:[w.length,`/30`]})]})]}),(0,$.jsx)(X,{type:`primary`,block:!0,size:`large`,onClick:()=>{if(!O){Z.warning(`请上传复刻视频`);return}if(!I){Z.warning(`请上传产品图片`);return}if(!y.trim()){Z.warning(`请输入原视频产品名称`);return}if(!x.trim()){Z.warning(`请输入自有产品名称`);return}if(!w.trim()){Z.warning(`请输入产品卖点`);return}Gie({material_video_url:O,material_image_url:I,material_video_resource_id:A||void 0,material_image_resource_id:R||void 0,material_video_duration_seconds:M||void 0,source_project_name:y,target_project_name:x,core_content_point:w,idempotency_key:Date.now().toString()}).then(t=>{let r=``,i=``;k(``),j(``),N(null),L(``),z(``),b(``),C(``),T(``),ne(1,8),U5(1,20).then(t=>{if(t.items){let a=t.items[0].id;n(t.items),W5(t.items[0].id).then(t=>{r=t.id,i=t.steps[0].id,Kie(r,i).then(t=>{Z.loading(`创建中...`,3),setTimeout(()=>{e(`/initial/${a}/initialinfo`)},3e3)})}).catch(e=>{})}}).catch(e=>{})}).catch(e=>{Z.error(`视频开头复刻失败`)})},style:{borderRadius:12,height:44,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%)`,border:`none`,fontSize:15,boxShadow:`0 4px 16px rgba(99, 102, 241, 0.3)`,transition:`all 0.25s cubic-bezier(0.4, 0, 0.2, 1)`},children:`立即生成+`})]})}),(0,$.jsxs)(mK,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`创作记录`})]}),open:W,onCancel:()=>ee(!1),width:850,footer:null,style:{borderRadius:20},styles:{body:{height:580,display:`flex`,flexDirection:`column`,padding:0},header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,padding:`16px 24px`}},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,margin:`16px 24px`,flexShrink:0},children:[(0,$.jsx)(IW,{placeholder:`搜索产品名称`,value:l,onChange:e=>u(e.target.value),onPressEnter:oe,style:{width:220,borderRadius:10,marginRight:10,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`}}),(0,$.jsx)(X,{type:`primary`,onClick:oe,style:{borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`搜索`})]}),(0,$.jsx)(`div`,{style:{flex:1,overflow:`auto`,padding:`0 24px 24px`},children:(0,$.jsx)(`div`,{style:{background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(10px)`,borderRadius:16,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.08)`,boxShadow:`0 4px 16px rgba(99, 102, 241, 0.06)`},children:(0,$.jsx)(LQ,{columns:[{title:`产品名称`,dataIndex:`targetProjectName`,key:`targetProjectName`,align:`center`,width:100,render:e=>(0,$.jsx)(`span`,{style:{fontSize:13,color:`#1e293b`,fontWeight:500},children:e||`-`})},{title:`状态`,dataIndex:`status`,key:`status`,align:`center`,width:220,render:(e,t)=>{let n=e,r=t.current_step_code||t.currentStepCode,i=(()=>{if(r===`image_prompt_optimize`)switch(n){case`waiting_user`:return{text:`等待融合图生成`,color:`#f59e0b`};case`processing`:return{text:`图片提示词生成中`,color:`#f59e0b`};case`completed`:return{text:`图片提示词生成成功`,color:`#10b981`};case`failed`:return{text:`图片提示词生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#64748b`}}else if(r===`image_generate`)switch(n){case`waiting_user`:return{text:`等待生成视频提示词`,color:`#f59e0b`};case`processing`:return{text:`融合图生成中`,color:`#f59e0b`};case`completed`:return{text:`融合图生成成功`,color:`#10b981`};case`failed`:return{text:`融合图生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#64748b`}}else if(r===`video_prompt_optimize`)switch(n){case`waiting_user`:return{text:`等待最终视频生成`,color:`#f59e0b`};case`processing`:return{text:`视频提示词生成中`,color:`#f59e0b`};case`completed`:return{text:`视频提示词生成成功`,color:`#10b981`};case`failed`:return{text:`视频提示词生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#64748b`}}else if(r===`video_generate`)switch(n){case`waiting_user`:return{text:``,color:`#64748b`};case`processing`:return{text:`最终视频生成中`,color:`#f59e0b`};case`completed`:return{text:`任务完成`,color:`#10b981`};case`failed`:return{text:`最终视频生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#64748b`}}else if(r===`material_input`)switch(n){case`waiting_user`:return{text:`等待生成图片提示词`,color:`#f59e0b`};case`processing`:return{text:`素材处理中`,color:`#f59e0b`};case`completed`:return{text:`素材上传成功`,color:`#10b981`};case`failed`:return{text:`素材上传失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#64748b`}}else return{pending:{text:`子任务待处理`,color:`#f59e0b`},waiting_user:{text:`等待用户确认或触发`,color:`#f59e0b`},processing:{text:`子任务处理中`,color:`#f59e0b`},completed:{text:`子任务完成`,color:`#10b981`},failed:{text:`子任务失败`,color:`#ef4444`},cancelled:{text:`子任务取消`,color:`#94a3b8`}}[n]||{text:n||`-`,color:`#64748b`}})();return(0,$.jsx)(`span`,{style:{fontSize:12,color:i.color,fontWeight:500},children:i.text})}},{title:`创建时间`,dataIndex:`createdAt`,key:`createdAt`,align:`center`,width:200,render:e=>{if(!e)return`-`;let t=new Date(e);return(0,$.jsx)(`span`,{style:{fontSize:12,color:`#64748b`},children:`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)} ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`})}},{title:`操作`,key:`action`,align:`center`,width:220,render:(t,n)=>(0,$.jsxs)(sH,{children:[(0,$.jsx)(`button`,{onClick:()=>e(`/initial/${n.id}/initialinfo`),style:{color:`#6366f1`,textDecoration:`none`,fontSize:13,border:`none`,background:`rgba(99, 102, 241, 0.08)`,padding:`4px 12px`,borderRadius:8,cursor:`pointer`,transition:`all 0.2s`},children:`查看详情`}),(0,$.jsx)(vK,{title:`确认删除这个爆款开头复刻任务吗?`,onConfirm:async()=>{try{await pae(n.id),Z.success(`删除成功`),ie(1,a,!1,l)}catch{Z.error(`删除失败`)}},children:(0,$.jsx)(`button`,{style:{color:`#ef4444`,textDecoration:`none`,fontSize:13,border:`none`,background:`rgba(239, 68, 68, 0.08)`,padding:`4px 12px`,borderRadius:8,cursor:`pointer`,transition:`all 0.2s`},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(239, 68, 68, 0.12)`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(239, 68, 68, 0.08)`},children:`删除`})})]})}],dataSource:t,rowKey:`id`,pagination:{current:r,pageSize:a,total:s,showSizeChanger:!0,showQuickJumper:!0,showTotal:e=>`共 ${e} 条`,onChange:ae,itemRender:(e,t,n)=>t===`prev`?(0,$.jsx)(`button`,{style:{minWidth:32,height:32,border:`1px solid rgba(99, 102, 241, 0.15)`,borderRadius:8,background:r===1?`rgba(243, 244, 246, 0.5)`:`#fff`,cursor:r===1?`not-allowed`:`pointer`,color:r===1?`#94a3b8`:`#6366f1`,fontSize:14},disabled:r===1,children:`‹`}):t===`next`?(0,$.jsx)(`button`,{style:{minWidth:32,height:32,border:`1px solid rgba(99, 102, 241, 0.15)`,borderRadius:8,background:r>=Math.ceil(s/a)?`rgba(243, 244, 246, 0.5)`:`#fff`,cursor:r>=Math.ceil(s/a)?`not-allowed`:`pointer`,color:r>=Math.ceil(s/a)?`#94a3b8`:`#6366f1`,fontSize:14},disabled:r>=Math.ceil(s/a),children:`›`}):t===`page`?(0,$.jsx)(`button`,{style:{minWidth:32,height:32,border:`none`,borderRadius:8,background:e===r?`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`:`#fff`,color:e===r?`#fff`:`#475569`,fontWeight:e===r?600:400,cursor:`pointer`,fontSize:14},children:e}):n},style:{fontSize:13},scroll:{y:350}})})})]})]})};function c9(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function l9(e,...t){for(let n of t){let t=e[n];if(t!=null&&String(t).trim()!==``)return String(t)}return``}function u9(e,t,...n){for(let t of n){let n=e[t];if(n===!0||n===!1)return n;if(n===`true`)return!0;if(n===`false`)return!1}return t}function cse(e,...t){for(let n of t){let t=e[n];if(typeof t==`number`&&Number.isFinite(t)&&t>0)return t;if(typeof t==`string`&&t.trim()){let e=Number(t);if(Number.isFinite(e)&&e>0)return e}}}function d9(e){if(!c9(e))return null;let t=l9(e,`key`);return t?{key:t,label:l9(e,`label`)||t,type:l9(e,`type`)||void 0,enabled:u9(e,!0,`enabled`),editable:u9(e,!0,`editable`),maxLength:cse(e,`maxLength`,`max_length`)}:null}function f9(e){if(!c9(e))return null;let t=e.data;return c9(t)?t:Array.isArray(e.sections)?e:null}function lse(e){return!!f9(e)}function p9(e){let t=f9(e);return(Array.isArray(t?.sections)?t.sections:[]).map(e=>{let t=d9(e);if(!t||!c9(e))return null;let n=Array.isArray(e.children)?e.children.map(d9).filter(Boolean):[],r=Array.isArray(e.itemFields)?e.itemFields.map(d9).filter(Boolean):Array.isArray(e.item_fields)?e.item_fields.map(d9).filter(Boolean):[];return{...t,contentKey:l9(e,`contentKey`,`content_key`)||void 0,children:n,itemFields:r}}).filter(e=>!!e&&e.enabled)}function m9(e){if(e==null)return``;if(typeof e==`object`)try{return JSON.stringify(e,null,2)}catch{return String(e)}return String(e)}function h9(e){let t=m9(e);return t.length>40||t.includes(` -`)||t.includes(`,`)||t.includes(`。`)||t.includes(`;`)||t.includes(`;`)}function g9(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function _9(e,t,n,r){let i=g9(e||{});return c9(i[t])||(i[t]={}),i[t][n]=r,i}function v9(e,t,n,r,i){let a=g9(e||{});return Array.isArray(a[t])||(a[t]=[]),c9(a[t][n])||(a[t][n]={}),a[t][n][r]=i,a}function y9(e,t){if(!c9(e))return`视频提示词不能为空`;let n=p9(t);if(!n.length)return`视频提词配置缺失,无法保存`;for(let t of n){if(!t.editable)continue;let n=e[t.key];if(t.type===`object`){if(!c9(n))continue;for(let e of t.children)if(!(!e.enabled||!e.editable||!e.maxLength)&&m9(n[e.key]).length>e.maxLength)return`字段【${t.label}.${e.label}】长度不能超过 ${e.maxLength} 个字符`;continue}if(t.type===`flow`){if(!Array.isArray(n))continue;for(let e=0;en.maxLength)return`字段【${t.label} 第 ${e+1} 项.${n.label}】长度不能超过 ${n.maxLength} 个字符`}}continue}if(t.editable&&t.maxLength&&m9(n).length>t.maxLength)return`字段【${t.label}】长度不能超过 ${t.maxLength} 个字符`}return null}var{Text:b9}=Q,{TextArea:x9}=IW;function S9(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function C9({value:e}){let t=e===`true`?`是`:e===`false`?`否`:m9(e);return h9(e)?(0,$.jsx)(x9,{value:t,rows:Math.min(6,Math.max(2,Math.ceil(t.length/42))),disabled:!0,style:{borderRadius:8,color:`#64748b`}}):(0,$.jsx)(IW,{value:t,disabled:!0,style:{borderRadius:8,color:`#64748b`}})}function w9({value:e,maxLength:t,onChange:n}){let r=m9(e),i={value:r,maxLength:t,showCount:!!t,onChange:e=>n(e.target.value),style:{borderRadius:8}};return h9(e)?(0,$.jsx)(x9,{...i,rows:Math.min(8,Math.max(3,Math.ceil(r.length/42)))}):(0,$.jsx)(IW,{...i})}function T9({value:e,onChange:t}){let n=e===!0||e===`true`;return(0,$.jsxs)(jI.Group,{value:n,onChange:e=>t(e.target.value),style:{display:`flex`,gap:24},children:[(0,$.jsx)(jI,{value:!0,style:{fontSize:14,color:`#475569`},children:`是`}),(0,$.jsx)(jI,{value:!1,style:{fontSize:14,color:`#475569`},children:`否`})]})}var E9=({value:e,schemaConfigSnapshot:t,onChange:n})=>{let r=S9(e)?e:{},i=p9(t);if(!lse(t))return(0,$.jsxs)(sH,{direction:`vertical`,size:12,style:{width:`100%`},children:[(0,$.jsx)(Jf,{type:`warning`,showIcon:!0,message:`视频提词配置缺失,暂不能编辑`,description:`请刷新详情后重试;如果仍然缺失,请联系管理员排查第4步 schema_config_snapshot 返回。`}),Object.keys(r).length?(0,$.jsx)(`pre`,{style:{margin:0,padding:12,borderRadius:10,background:`#f8fafc`,maxHeight:420,overflow:`auto`,color:`#475569`},children:JSON.stringify(r,null,2)}):null]});if(!i.length)return(0,$.jsx)(Jf,{type:`warning`,showIcon:!0,message:`视频提词配置为空`,description:`当前 Schema 配置没有可展示字段。`});let a=e=>{let t=S9(r[e.key])?r[e.key]:{},i=e.children.filter(e=>e.enabled);return i.length?(0,$.jsxs)(`div`,{style:{marginBottom:18},children:[(0,$.jsx)(sH,{style:{marginBottom:8},children:(0,$.jsx)(b9,{strong:!0,style:{color:`#334155`,fontSize:13},children:e.label})}),(0,$.jsx)(`div`,{style:{borderLeft:`3px solid #6366f1`,paddingLeft:12,marginLeft:4},children:i.map(i=>(0,$.jsxs)(`div`,{style:{marginBottom:12},children:[(0,$.jsx)(sH,{style:{marginBottom:4},children:(0,$.jsx)(b9,{style:{color:`#64748b`,fontSize:12},children:i.label})}),i.editable?i.type===`boolean`?(0,$.jsx)(T9,{value:t[i.key],onChange:t=>n(_9(r,e.key,i.key,t))}):(0,$.jsx)(w9,{value:t[i.key],maxLength:i.maxLength,onChange:t=>n(_9(r,e.key,i.key,t))}):(0,$.jsx)(C9,{value:t[i.key]})]},i.key))})]},e.key):null},o=e=>{let t=Array.isArray(r[e.key])?r[e.key]:[],i=[{key:`时间段`,label:`时间段`,enabled:!0,editable:!1},...e.itemFields.filter(e=>e.enabled)];return(0,$.jsxs)(`div`,{style:{marginBottom:18},children:[(0,$.jsxs)(sH,{style:{marginBottom:8},children:[(0,$.jsx)(b9,{strong:!0,style:{color:`#334155`,fontSize:13},children:e.label}),(0,$.jsx)(XQ,{color:`default`,children:`锁定条目和时间段`})]}),(0,$.jsx)(`div`,{style:{border:`1px solid #e5e7eb`,borderRadius:10,padding:12,background:`#fff`},children:t.length===0?(0,$.jsx)(b9,{style:{color:`#94a3b8`,fontSize:12},children:`暂无内容`}):t.map((a,o)=>{let s=S9(a)?a:{};return(0,$.jsxs)(`div`,{style:{marginBottom:o===t.length-1?0:14,paddingBottom:o===t.length-1?0:14,borderBottom:o===t.length-1?`none`:`1px dashed #e2e8f0`},children:[(0,$.jsxs)(b9,{strong:!0,style:{display:`block`,marginBottom:8,color:`#475569`,fontSize:12},children:[`第 `,o+1,` 段`]}),i.map(t=>(0,$.jsxs)(`div`,{style:{marginBottom:10},children:[(0,$.jsx)(sH,{style:{marginBottom:4},children:(0,$.jsx)(b9,{style:{color:`#64748b`,fontSize:12},children:t.label})}),t.editable?t.type===`boolean`?(0,$.jsx)(T9,{value:s[t.key],onChange:i=>n(v9(r,e.key,o,t.key,i))}):(0,$.jsx)(w9,{value:s[t.key],maxLength:t.maxLength,onChange:i=>n(v9(r,e.key,o,t.key,i))}):(0,$.jsx)(C9,{value:s[t.key]})]},t.key))]},`${e.key}-${o}`)})})]},e.key)},s=e=>e.key in r?(0,$.jsxs)(`div`,{style:{marginBottom:18},children:[(0,$.jsx)(sH,{style:{marginBottom:8},children:(0,$.jsx)(b9,{strong:!0,style:{color:`#334155`,fontSize:13},children:e.label})}),e.editable?(0,$.jsx)(w9,{value:r[e.key],maxLength:e.maxLength,onChange:t=>{let i=g9(r);i[e.key]=t,n(i)}}):(0,$.jsx)(C9,{value:r[e.key]})]},e.key):null;return(0,$.jsx)(`div`,{children:i.map(e=>e.key in r?e.type===`object`?a(e):e.type===`flow`?o(e):s(e):null)})},{Title:use,Text:D9}=Q,{TextArea:dse}=IW;function fse(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}var O9=e=>e?/^https?:\/\//i.test(e)?e:`${`http://ceshi.apiforeign.minzhong.cn`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`:``;function pse(){let e=Ye(),{creatID:t}=$e(),{user:n}=_7(),[r,i]=(0,S.useState)(!1),[a,o]=(0,S.useState)(``),[s,c]=(0,S.useState)(!1),[l,u]=(0,S.useState)(`image`),[d,f]=(0,S.useState)({}),[p,m]=(0,S.useState)(null),[h,g]=(0,S.useState)(``),[_,v]=(0,S.useState)(!1),[y,b]=(0,S.useState)(null),[x,C]=(0,S.useState)({}),[w,T]=(0,S.useState)(``),[E,D]=(0,S.useState)(``),[O,k]=(0,S.useState)(!1),[A,j]=(0,S.useState)(!1),[M,N]=(0,S.useState)(5),[P,F]=(0,S.useState)(`16:9`),[I,L]=(0,S.useState)(`480p`),[R,z]=(0,S.useState)({ratios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:[`480p`,`720p`,`1080p`],durations:[5,8,10,12,15]}),[B,V]=(0,S.useState)([]),[H,U]=(0,S.useState)(0),[W,ee]=(0,S.useState)([]),[te,G]=(0,S.useState)(1),[ne,re]=(0,S.useState)(20),[ie,ae]=(0,S.useState)(0),[oe,K]=(0,S.useState)(``),[q,se]=(0,S.useState)({}),[ce,le]=(0,S.useState)([]),[ue,de]=(0,S.useState)([]),[fe,pe]=(0,S.useState)(!1),[me,he]=(0,S.useState)(``),[ge,_e]=(0,S.useState)(`image`),ve=S.useRef(null);(0,S.useEffect)(()=>{if(fe&&ge===`video`){let e=()=>{ve.current&&ve.current.play().catch(()=>{})};ve.current&&(ve.current.readyState>=2?e():ve.current.addEventListener(`loadedmetadata`,e));let t=setTimeout(e,300);return()=>{clearTimeout(t),ve.current&&(ve.current.removeEventListener(`loadedmetadata`,e),ve.current.pause())}}else ve.current&&ve.current.pause()},[fe,ge]);let ye=(e,t)=>{he(e),_e(t),pe(!0)},be=()=>{pe(!1),he(``),ve.current&&ve.current.pause()},xe=e=>{if(e.preventDefault(),e.stopPropagation(),!me)return;let t=document.createElement(`a`);t.href=`http://ceshi.apiforeign.minzhong.cn${me}&download=1`,t.download=ge===`image`?`image.png`:`video.mp4`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},Se=[{id:1,title:`原始素材`,description:`上传原始视频素材`,childId:1},{id:2,title:`生成提示词`,description:`根据素材生成描述词`,childId:2},{id:3,title:`生成产品融合图`,description:`生成产品与场景融合图`,childId:3},{id:4,title:`生成视频提示词`,description:`生成视频生成提示词`,childId:4},{id:5,title:`生成最终视频`,description:`合成最终视频`,childId:5}].map((e,t)=>({...e,status:ce[t]?.status||``,id:ce[t]?.id||t,output:ce[t]?.output||``,engineId:ce[t]?.input?.payload?.videoConfig?.engineId||``}));(0,S.useEffect)(()=>{let e=new Set;ue.forEach(t=>{let n=Se.find(e=>String(e.childId)===t);n&&(n.status===`completed`||n.status===`failed`)&&e.add(t)});for(let t=Se.length-1;t>=0;t--)if(Se[t].status===`completed`||Se[t].status===`failed`){e.add(String(Se[t].childId));break}e.size>0?de(Array.from(e)):de([])},[ce]);let Ce=(e,t,n)=>{U5(e,t,n).then(e=>{e.items&&ee(e.items),e.total!==void 0&&ae(e.total)}).catch(e=>{})},we=(e,t)=>{G(e),re(t),Ce(e,t,oe)},Te=()=>{G(1),Ce(1,ne,oe)};(0,S.useEffect)(()=>{Ce(te,ne)},[]),(0,S.useEffect)(()=>{z5().then(e=>{let t=(e.engine?.video||[]).filter(e=>e.supportsUniversalReference!==!1),n=(e.engine?.image||[]).filter(e=>e.supportsUniversalReference!==!1);if(C({video:t,image:n}),t.length>0){T(t[0].id);let e=t[0];z({ratios:e.supportedRatios||[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:e.supportedResolutions||[`480p`,`720p`,`1080p`],durations:e.supportedDurations||[5,8,10,12,15]})}n.length>0&&D(n[0].id)}).catch(e=>{})},[]),(0,S.useEffect)(()=>{H5().then(e=>{V(e)}).catch(()=>{})},[]);let Ee=()=>{let e={};e=B.find(e=>e.modelConfigId===w&&e.genType===`video`&&e.resolution===I),e||(e={perSecondCredits:2,baseCredits:60,ratio:1.3,inputVideoRatio:1.3,inputVideoBaseCredits:0,inputVideoPerSecondCredits:15,inputImageRatio:1,inputImageBaseCredits:0,inputImagePerImageCredits:0},(I===`1080p`||I===`720p`||I===`480p`)&&(e.ratio=1.3));let t=(M*e.perSecondCredits+e.baseCredits)*e.ratio,n=q?.videoGeneration?.inputMedia?.video?.duration||0;if(n>0){let r=((e.inputVideoBaseCredits||0)+(e.inputVideoPerSecondCredits||0)*n)*(e.inputVideoRatio||1);t+=r}let r=q?.videoGeneration?.inputMedia?.image?.length||0;if(r>0){let n=((e.inputImageBaseCredits||0)+(e.inputImagePerImageCredits||0)*r)*(e.inputImageRatio||1);t+=n}U(Number(t.toFixed(2)))};(0,S.useEffect)(()=>{B.length>0&&w&&Ee()},[B,w,M,I,q]),(0,S.useEffect)(()=>()=>{y&&(clearInterval(y),b(null))},[y]),(0,S.useEffect)(()=>{let e=e=>{let t=e.target;!t.closest(`.image-settings-trigger`)&&!t.closest(`.image-settings-popover`)&&(k(!1),j(!1))};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,S.useEffect)(()=>{t&&W5(t).then(e=>{se(e),e.steps&&le(e.steps)}).catch(e=>{})},[t]),(0,S.useEffect)(()=>{let e=Se[4];e&&e.status!==`completed`&&e.status!==`failed`?y||b(setInterval(ke,15e3)):e&&y&&(clearInterval(y),b(null))},[Se]);let De=(e,t,n,r)=>{u(t||`image`),g(n?String(n):``),t===`video`?(m(r||null),f(e&&typeof e==`object`?fse(e):{}),o(``)):(m(null),o(e||``),f({})),i(!0)},Oe=async()=>{if(l===`image`){if(!q?.id||!h){Z.warning(`缺少任务或步骤 ID,无法保存图片提示词`);return}if(!a||!a.trim()){Z.warning(`图片提示词不能为空`);return}v(!0);try{await qie(q.id,h,{prompt:a.trim()}),Z.success(`图片提示词已保存`),Ae(),i(!1),g(``)}catch(e){Z.error(e?.message||`保存图片提示词失败`)}finally{v(!1)}return}if(!q?.id||!h){Z.warning(`缺少任务或步骤 ID,无法保存视频提示词`);return}if(!d||typeof d!=`object`||Object.keys(d).length===0){Z.warning(`视频提示词不能为空`);return}if(!p){Z.warning(`视频提词配置缺失,暂不能保存`);return}let e=y9(d,p);if(e){Z.warning(e);return}v(!0);try{await $ie(q.id,h,{prompt_schema:d}),Z.success(`视频提示词已保存`),Ae(),i(!1),g(``)}catch(e){Z.error(e?.message||`保存视频提示词失败`)}finally{v(!1)}},ke=()=>{t&&W5(t).then(e=>{se(e),e.steps&&le(e.steps)}).catch(e=>{})},Ae=()=>{t&&W5(t).then(e=>{se(e),e.steps&&le(e.steps)}).catch(e=>{})},je=e=>{let t={engine_id:E,image_proportion:`1:1`,image_px:`2048x2048`,image_size:`2K`};G5(q.id,e.toString(),t).then(e=>{Z.info(`正在生成图片,请稍候...`),Ae()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Z.error(t)})},Me=()=>{let e={engine_id:E,image_proportion:`1:1`,image_px:`2048x2048`,image_size:`2K`};G5(q.id,Se[1].id.toString(),e).then(e=>{Z.info(`正在生成图片,请稍候...`),Ae()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Z.error(t)})},Ne=e=>{let t={engine_id:w,duration:M,aspect_ratio:P,resolution:I,target_platform:`抖音`};Jie(q.id,e.toString(),t).then(e=>{Ae(),Z.info(`正在生成视频提示词,请稍候...`)}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Z.error(t)})},Pe=(e,t)=>{K5(q.id,e.toString(),{engine_id:``}).then(e=>{Z.info(`正在生成视频,请稍候...`),Ae()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Z.error(t)})},Fe=()=>{K5(q.id,Se[3].id.toString(),{engine_id:``}).then(e=>{Z.info(`正在生成视频,请稍候...`),Ae()}).catch(e=>{})};return(0,$.jsxs)(S.Fragment,{children:[(0,$.jsx)(`div`,{className:`initialinfo-container`,style:{margin:`-24px -32px -32px`,height:`calc(100vh - 34px)`,position:`relative`,boxSizing:`border-box`,overflow:`hidden`,display:`flex`,flexDirection:`column`},children:(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,justifyContent:`space-between`,alignItems:`stretch`,gap:`2%`,position:`relative`,zIndex:1,minHeight:0},children:[(0,$.jsxs)(`div`,{className:`replication-preview`,style:{flex:4,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(20px)`,borderRadius:20,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`,display:`flex`,flexDirection:`column`,minHeight:0},children:[(0,$.jsxs)(`div`,{style:{borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`16px 24px`,background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,boxSizing:`border-box`},children:[(0,$.jsx)(X,{icon:(0,$.jsx)(b2,{}),onClick:()=>e(-1),style:{borderRadius:10,fontSize:13,height:32,background:`rgba(99, 102, 241, 0.1)`,border:`1px solid rgba(99, 102, 241, 0.2)`,color:`#6366f1`},children:`返回`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #6366f1, #8b5cf6, transparent)`,borderRadius:1}}),(0,$.jsx)(`h3`,{style:{margin:0,fontSize:16,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`爆款复刻 - 任务详情`}),(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #8b5cf6, #6366f1, transparent)`,borderRadius:1}})]}),(0,$.jsx)(X,{type:`primary`,ghost:!0,style:{borderRadius:10,padding:`4px 16px`,fontSize:13,background:`rgba(99, 102, 241, 0.1)`,borderColor:`rgba(99, 102, 241, 0.2)`,color:`#6366f1`},onClick:()=>c(!0),children:`创作记录`})]}),(0,$.jsx)(`div`,{style:{flex:1,overflowY:`auto`},children:(0,$.jsxs)(`div`,{className:`material_box`,children:[(0,$.jsxs)(`div`,{style:{display:`flex`,gap:24,flexWrap:`wrap`,alignItems:`flex-start`},children:[(0,$.jsxs)(`div`,{style:{flex:1,minWidth:250},children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`视频`]}),(0,$.jsx)(`div`,{className:`medio_box`,style:{aspectRatio:`16/9`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`,cursor:q?.material?.materialVideoUrl?`pointer`:`default`},onClick:()=>q?.material?.materialVideoUrl&&ye(q.material.materialVideoUrl,`video`),children:q?.material?.materialVideoUrl?(0,$.jsx)(`video`,{src:O9(q.material.materialVideoUrl),style:{width:`100%`,height:`100%`,objectFit:`contain`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:13},children:`暂无视频`})})]}),(0,$.jsxs)(`div`,{className:`product_img`,style:{flex:1,minWidth:250},children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`产品图片`]}),(0,$.jsx)(`div`,{className:`medio_box`,style:{aspectRatio:`1/1`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`,cursor:q?.material?.materialImageUrl?`pointer`:`default`},onClick:()=>q?.material?.materialImageUrl&&ye(q.material.materialImageUrl,`image`),children:q?.material?.materialImageUrl?(0,$.jsx)(`img`,{src:O9(q.material.materialImageUrl),alt:``,style:{width:`100%`,height:`100%`,objectFit:`contain`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:13},children:`暂无图片`})})]})]}),(0,$.jsx)(`div`,{style:{margin:`20px 0`,height:1,background:`linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.15), transparent)`,borderRadius:.5}}),q?.finalImageUrl&&(0,$.jsx)(`div`,{style:{marginTop:16},children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`生成图片`]}),(0,$.jsx)(`div`,{className:`medio_box`,style:{aspectRatio:`1/1`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`,cursor:`pointer`},onClick:()=>ye(q.finalImageUrl,`image`),children:(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn${q.finalImageUrl}`,alt:``,style:{width:`100%`,height:`100%`,objectFit:`contain`}})})]})}),q?.finalVideoUrl&&(0,$.jsx)(`div`,{style:{marginTop:16},children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`生成视频`]}),(0,$.jsx)(`div`,{className:`medio_box`,style:{aspectRatio:`16/9`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`,cursor:`pointer`},onClick:()=>ye(q.finalVideoUrl,`video`),children:(0,$.jsx)(`video`,{src:`http://ceshi.apiforeign.minzhong.cn${q.finalVideoUrl}`,style:{width:`100%`,height:`100%`,objectFit:`contain`}})})]})})]})})]}),(0,$.jsxs)(`div`,{className:`replication-form`,style:{flex:1,minWidth:`450px`,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(20px)`,borderRadius:20,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`,display:`flex`,flexDirection:`column`,minHeight:0},children:[(0,$.jsxs)(`div`,{style:{padding:`16px 24px`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,display:`flex`,alignItems:`center`,gap:10,background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`},children:[(0,$.jsx)(`div`,{style:{width:4,height:18,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:15,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`生成步骤`})]}),(0,$.jsx)(`div`,{style:{flex:1,overflowY:`auto`,padding:`8px 16px 16px`},children:(0,$.jsx)($g,{activeKey:ue,onChange:de,ghost:!0,bordered:!1,style:{background:`transparent`},expandIconPlacement:`end`,items:Se.map(e=>({key:String(e.childId),label:(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,width:`100%`,justifyContent:`space-between`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:16,height:16},children:e.status===`completed`?(0,$.jsx)(d4,{style:{fontSize:16,color:`#22c55e`}}):e.status===`processing`?(0,$.jsx)(`div`,{style:{width:16,height:16,borderRadius:`50%`,border:`2px solid #e2e8f0`,borderTopColor:`#6366f1`,animation:`spinSlow 1s linear infinite`}}):e.status===`failed`?(0,$.jsx)(`div`,{style:{width:16,height:16,borderRadius:`50%`,background:`#ef4444`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`span`,{style:{color:`#fff`,fontSize:10},children:`×`})}):(0,$.jsx)(`div`,{style:{width:8,height:8,borderRadius:`50%`,background:`#cbd5e1`}})}),(0,$.jsx)(`span`,{style:{fontSize:14,color:e.status===`processing`||e.status===`waiting_user`?`#6366f1`:`#1e293b`,fontWeight:500},children:e.title}),(e.status===`processing`||e.status===`waiting_user`)&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#6366f1`,marginLeft:8},children:`生成中`}),e.status===`failed`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#ef4444`,marginLeft:8},children:`失败`}),e.status===``&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#717d8b`,marginLeft:8},children:`待生成`})]})}),children:(0,$.jsxs)(`div`,{style:{padding:`16px`,background:`linear-gradient(135deg, rgba(248,250,252,0.6) 0%, rgba(238,242,255,0.4) 100%)`,borderRadius:12,marginTop:8,border:`1px solid rgba(99, 102, 241, 0.06)`},children:[e.childId===1&&(0,$.jsx)($.Fragment,{children:(0,$.jsxs)(`div`,{style:{display:`flex`,gap:20,marginBottom:20,alignItems:`flex-start`,flexWrap:`wrap`},children:[(0,$.jsxs)(`div`,{style:{flex:1,minWidth:200},children:[(0,$.jsx)(D9,{style:{color:`#475569`,fontSize:13,marginBottom:10,display:`block`,fontWeight:500},children:`原视频`}),(0,$.jsx)(`div`,{style:{height:180,borderRadius:12,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,border:`1px solid rgba(99, 102, 241, 0.08)`,boxShadow:`0 2px 8px rgba(99, 102, 241, 0.04)`},children:q?.material?.materialVideoUrl?(0,$.jsx)(`video`,{src:O9(q.material.materialVideoUrl),style:{maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`,borderRadius:10},controls:!0}):(0,$.jsxs)(`div`,{style:{textAlign:`center`,color:`#94a3b8`},children:[(0,$.jsxs)(`svg`,{width:`32`,height:`32`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,style:{marginBottom:8},children:[(0,$.jsx)(`rect`,{x:`2`,y:`2`,width:`20`,height:`16`,rx:`2`,ry:`2`}),(0,$.jsx)(`path`,{d:`M8 12l4 2 4-2`})]}),(0,$.jsx)(`div`,{style:{fontSize:13},children:`暂无视频`})]})})]}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:200},children:[(0,$.jsx)(D9,{style:{color:`#64748b`,fontSize:13,marginBottom:10,display:`block`,fontWeight:500},children:`产品图片`}),(0,$.jsx)(`div`,{style:{height:180,borderRadius:10,background:`#f1f5f9`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:q?.material?.materialImageUrl?(0,$.jsx)(`img`,{src:O9(q.material.materialImageUrl),alt:`产品图片`,style:{maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`,borderRadius:10}}):(0,$.jsxs)(`div`,{style:{textAlign:`center`,color:`#94a3b8`},children:[(0,$.jsxs)(`svg`,{width:`32`,height:`32`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,style:{marginBottom:8},children:[(0,$.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,ry:`2`}),(0,$.jsx)(`circle`,{cx:`8.5`,cy:`8.5`,r:`1.5`,fill:`currentColor`}),(0,$.jsx)(`path`,{d:`M21 15l-5-5L5 21`})]}),(0,$.jsx)(`div`,{style:{fontSize:13},children:`暂无图片`})]})})]})]})}),e.childId===2&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{padding:`12px 14px`,background:`rgba(255,255,255,0.6)`,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.08)`,marginBottom:4},children:(0,$.jsx)(D9,{style:{color:`#475569`,fontSize:13,lineHeight:1.8,whiteSpace:`pre-wrap`},children:e?.output?.payload?.prompt||`暂无提示词`})}),(0,$.jsxs)(sH,{style:{marginTop:16,gap:12,width:`100%`},children:[(0,$.jsx)(X,{type:`default`,icon:(0,$.jsx)(M$,{}),onClick:()=>De(e?.output?.payload?.prompt,`image`,e.id),style:{flex:1,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500,background:`rgba(99, 102, 241, 0.04)`},disabled:e.status!==`completed`,children:`修改提示词`}),(0,$.jsx)(X,{onClick:()=>{je(e.id)},type:`primary`,style:{flex:1,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,height:36,fontWeight:500,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},disabled:e.status!==`completed`,children:`下一步:生成图片`})]})]}),e.childId===3&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{borderRadius:12,overflow:`hidden`,marginBottom:16,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,border:`1px solid rgba(99, 102, 241, 0.08)`,boxShadow:`0 2px 8px rgba(99, 102, 241, 0.04)`,position:`relative`},children:[q.finalImageUrl?(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn${q.finalImageUrl}`,alt:`融合图`,style:{width:`100%`,height:180,objectFit:`cover`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:180,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:14},children:`暂无融合图`}),(0,$.jsx)(X,{type:`default`,icon:(0,$.jsx)(M$,{}),onClick:()=>Me(),disabled:e.status!==`completed`,style:{position:`absolute`,bottom:8,left:8,borderRadius:8,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:30,fontWeight:500,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(4px)`,padding:`0 12px`,fontSize:12},children:`重新生成`})]}),(0,$.jsx)(`p`,{style:{marginBottom:6,fontSize:14,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`视频参数选择:`}),(0,$.jsxs)(`div`,{style:{width:`100%`,display:`flex`,justifyContent:`space-between`,marginBottom:16},children:[(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>{k(!O),j(!1)},className:`image-settings-trigger`,style:{width:`100%`,padding:`4px 12px`,height:34,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,backgroundColor:`rgba(255,255,255,0.7)`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(C8,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsx)(D9,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:x.video?.find(e=>e.id===w)?.name||`选择引擎`})]}),O&&(0,$.jsx)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:-10,width:350,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:16,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:(0,$.jsxs)(`div`,{style:{marginBottom:8},children:[(0,$.jsx)(D9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择引擎`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:x.video?.map(e=>(0,$.jsxs)(`button`,{onClick:()=>{T(e.id),z({ratios:e.supportedRatios||[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:e.supportedResolutions||[`480p`,`720p`,`1080p`],durations:e.supportedDurations||[5,8,10,12,15]}),e.supportedRatios?.includes(P)||F(e.supportedRatios?.[0]||`16:9`),e.supportedResolutions?.includes(I)||L(e.supportedResolutions?.[0]||`720p`),e.supportedDurations?.includes(M)||N(e.supportedDurations?.[0]||5),k(!1)},style:{flex:1,minHeight:48,borderRadius:8,border:w===e.id?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:w===e.id?`#fff`:`#f9fafb`,cursor:`pointer`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`flex-start`,padding:`8px 12px`,transition:`all 0.2s`,textAlign:`left`},children:[(0,$.jsx)(`span`,{style:{fontSize:13,fontWeight:w===e.id?600:500,color:w===e.id?`#6366f1`:`#4b5563`,marginBottom:2},children:e.name}),(0,$.jsx)(`span`,{style:{fontSize:11,color:`#9ca3af`}})]},e.id))})]})})]}),(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>{j(!A),k(!1)},className:`image-settings-trigger`,style:{width:`100%`,padding:`4px 12px`,height:34,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,backgroundColor:`rgba(255,255,255,0.7)`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(V3,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsxs)(D9,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:[P,` · `,M,`s · `,I]})]}),A&&(0,$.jsxs)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:-160,width:350,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:16,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(D9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择比例`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:4},children:R.ratios.map(e=>(0,$.jsxs)(`button`,{onClick:()=>F(e),style:{flex:`0 0 calc(14.28% - 4px)`,minWidth:44,height:52,borderRadius:6,border:P===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:P===e?`#fff`:`#f9fafb`,cursor:`pointer`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:[(0,$.jsx)(`div`,{style:{width:18,height:18,border:`2px solid ${P===e?`#6366f1`:`#9ca3af`}`,borderRadius:2,marginBottom:2}}),(0,$.jsx)(`span`,{style:{fontSize:9,color:P===e?`#6366f1`:`#6b7280`,fontWeight:P===e?600:400},children:e})]},e))})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(D9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择时长`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,height:24,display:`flex`,alignItems:`center`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:`50%`,left:0,right:0,height:6,borderRadius:3,background:`#e5e7eb`,transform:`translateY(-50%)`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:`50%`,left:0,height:6,borderRadius:3,background:`#6366f1`,width:`${(M-Math.min(...R.durations))/(Math.max(...R.durations)-Math.min(...R.durations))*100}%`,transform:`translateY(-50%)`}}),(0,$.jsx)(`input`,{type:`range`,min:Math.min(...R.durations),max:Math.max(...R.durations),value:M,onChange:e=>N(Number(e.target.value)),style:{position:`relative`,width:`100%`,height:24,borderRadius:3,background:`transparent`,outline:`none`,appearance:`none`,cursor:`pointer`,zIndex:1}})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4,padding:`4px 12px`,backgroundColor:`#f1f5f9`,borderRadius:6},children:[(0,$.jsx)(`span`,{style:{fontSize:14,fontWeight:600,color:`#64748b`},children:M}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#9ca3af`},children:`秒`})]})]})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(D9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择分辨率`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:6},children:R.resolutions.map(e=>(0,$.jsx)(`button`,{onClick:()=>L(e),style:{flex:1,height:42,borderRadius:6,border:I===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:I===e?`#6366f1`:`#f9fafb`,cursor:`pointer`,display:`flex`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:600,color:I===e?`#fff`:`#4b5563`},children:e})},e))})]})]})]})]}),(0,$.jsx)(gw,{title:(n?.credits||0){if((n?.credits||0)De(q?.videoGeneration?.promptSchema,`video`,e.id,q?.videoGeneration?.schemaConfigSnapshot),style:{flex:1,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500,background:`rgba(99, 102, 241, 0.04)`},disabled:e.status!==`completed`||!q?.videoGeneration?.promptSchema||!q?.videoGeneration?.schemaConfigSnapshot,children:`查看/修改视频提词`}),(0,$.jsx)(X,{onClick:()=>{Pe(e.id,e.engineId)},type:`primary`,style:{flex:1,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,height:36,fontWeight:500,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},disabled:e.status!==`completed`,children:`下一步:生成视频`})]})]}),e.childId===5&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{borderRadius:12,overflow:`hidden`,marginBottom:16,position:`relative`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,border:`1px solid rgba(99, 102, 241, 0.08)`,boxShadow:`0 2px 8px rgba(99, 102, 241, 0.04)`},children:e.status===`completed`&&q?.finalVideoUrl?(0,$.jsx)(`video`,{src:`http://ceshi.apiforeign.minzhong.cn${q.finalVideoUrl}`,style:{width:`100%`,height:180,objectFit:`cover`},controls:!0}):e.status===`processing`?(0,$.jsxs)(`div`,{style:{width:`100%`,height:180,display:`flex`,alignItems:`center`,justifyContent:`center`,flexDirection:`column`,gap:8},children:[(0,$.jsx)(`div`,{style:{width:20,height:20,borderRadius:`50%`,border:`2px solid #e2e8f0`,borderTopColor:`#6366f1`,animation:`spinSlow 1s linear infinite`}}),(0,$.jsx)(`span`,{style:{color:`#6366f1`,fontSize:14},children:`视频生成中...`})]}):e.status===`failed`?(0,$.jsx)(`div`,{style:{width:`100%`,height:180,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#ef4444`,fontSize:14},children:`视频生成失败`}):(0,$.jsx)(`div`,{style:{width:`100%`,height:180,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:14},children:`暂无视频`})}),(0,$.jsxs)(sH,{style:{width:`100%`,gap:12},children:[(0,$.jsx)(X,{onClick:()=>Fe(),type:`default`,icon:(0,$.jsx)(M$,{}),style:{flex:1,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500,background:`rgba(99, 102, 241, 0.04)`},disabled:e.status!==`completed`,children:`重新生成`}),(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(m0,{}),style:{flex:1,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,height:36,fontWeight:500,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},disabled:e.status!==`completed`,onClick:()=>{let e=`http://ceshi.apiforeign.minzhong.cn${q?.finalVideoUrl}&download=1`,t=document.createElement(`a`);t.href=e,t.download=`video_${Date.now()}.mp4`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},children:`下载视频`})]})]})]})}))})})]})]})}),(0,$.jsx)(mK,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,$.jsx)(`div`,{style:{width:4,height:18,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:15,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:l===`video`?`查看/编辑视频提词`:`修改提示词`})]}),open:r,onCancel:()=>{_||i(!1)},footer:[(0,$.jsx)(X,{onClick:()=>i(!1),disabled:_,style:{borderRadius:8},children:`取消`},`cancel`),(0,$.jsx)(X,{type:`primary`,onClick:Oe,loading:_,disabled:_,style:{borderRadius:8,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`确认`},`confirm`)],width:800,style:{borderRadius:16},styles:{header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,padding:`16px 24px`},body:{background:`linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #f0f9ff 100%)`,padding:`20px 24px`}},children:l===`image`?(0,$.jsx)(dse,{value:a,onChange:e=>o(e.target.value),rows:8,style:{width:`100%`,height:300,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`},placeholder:`请输入提示词`}):(0,$.jsx)(`div`,{style:{maxHeight:500,overflowY:`auto`,paddingRight:10},children:(0,$.jsx)(E9,{value:d,schemaConfigSnapshot:p,onChange:f})})}),(0,$.jsxs)(mK,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`创作记录`})]}),open:s,onCancel:()=>c(!1),width:850,footer:null,style:{borderRadius:20},styles:{body:{height:580,display:`flex`,flexDirection:`column`,padding:0},header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,padding:`16px 24px`}},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,margin:`16px 24px`,flexShrink:0},children:[(0,$.jsx)(IW,{placeholder:`搜索产品名称`,value:oe,onChange:e=>K(e.target.value),onPressEnter:Te,style:{width:220,borderRadius:10,marginRight:10,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`}}),(0,$.jsx)(X,{type:`primary`,onClick:Te,style:{borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`搜索`})]}),(0,$.jsx)(LQ,{columns:[{title:`产品名称`,dataIndex:`targetProjectName`,key:`targetProjectName`,align:`center`},{title:`状态`,dataIndex:`status`,key:`status`,align:`center`,render:(e,t)=>{let n=e,r=t.current_step_code||t.currentStepCode,i=(()=>{if(r===`image_prompt_optimize`)switch(n){case`waiting_user`:return{text:`等待融合图生成`,color:`#f59e0b`};case`processing`:return{text:`图片提示词生成中`,color:`#f59e0b`};case`completed`:return{text:`图片提示词生成成功`,color:`#10b981`};case`failed`:return{text:`图片提示词生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`image_generate`)switch(n){case`waiting_user`:return{text:`等待生成视频提示词`,color:`#f59e0b`};case`processing`:return{text:`融合图生成中`,color:`#f59e0b`};case`completed`:return{text:`融合图生成成功`,color:`#10b981`};case`failed`:return{text:`融合图生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`video_prompt_optimize`)switch(n){case`waiting_user`:return{text:`等待最终视频生成`,color:`#f59e0b`};case`processing`:return{text:`视频提示词生成中`,color:`#f59e0b`};case`completed`:return{text:`视频提示词生成成功`,color:`#10b981`};case`failed`:return{text:`视频提示词生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`video_generate`)switch(n){case`waiting_user`:return{text:``,color:`#666`};case`processing`:return{text:`最终视频生成中`,color:`#f59e0b`};case`completed`:return{text:`任务完成`,color:`#10b981`};case`failed`:return{text:`最终视频生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`material_input`)switch(n){case`waiting_user`:return{text:`等待生成图片提示词`,color:`#f59e0b`};case`processing`:return{text:`素材处理中`,color:`#f59e0b`};case`completed`:return{text:`素材上传成功`,color:`#10b981`};case`failed`:return{text:`素材上传失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else return{pending:{text:`子任务待处理`,color:`#f59e0b`},waiting_user:{text:`等待用户确认或触发`,color:`#f59e0b`},processing:{text:`子任务处理中`,color:`#f59e0b`},completed:{text:`子任务完成`,color:`#10b981`},failed:{text:`子任务失败`,color:`#ef4444`},cancelled:{text:`子任务取消`,color:`#94a3b8`}}[n]||{text:n||`-`,color:`#666`}})();return typeof i==`string`?(0,$.jsx)(`span`,{style:{fontSize:12,color:`#666`,fontWeight:500},children:i}):(0,$.jsx)(`span`,{style:{fontSize:12,color:i.color,fontWeight:500},children:i.text})}},{title:`创建时间`,dataIndex:`createdAt`,key:`createdAt`,align:`center`,render:e=>{if(!e)return`-`;let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)} ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`}},{title:`操作`,key:`action`,align:`center`,render:(t,n)=>(0,$.jsx)(`button`,{onClick:()=>e(`/initial/${n.id}/initialinfo`),style:{color:`#6366f1`,textDecoration:`none`,fontSize:12,border:`none`,background:`rgba(99, 102, 241, 0.08)`,padding:`4px 12px`,borderRadius:8,cursor:`pointer`,transition:`all 0.2s`,fontWeight:500},children:`查看详情`})}],dataSource:W,rowKey:`id`,pagination:{current:te,pageSize:ne,total:ie,showSizeChanger:!0,showQuickJumper:!0,showTotal:e=>`共 ${e} 条`,onChange:we},style:{fontSize:13},scroll:{y:350}})]}),(0,$.jsx)(mK,{open:fe,title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(180deg, #8b5cf6 0%, #ddd6fe 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:700,color:`#8b5cf6`,letterSpacing:.4},children:`预览`})]}),onCancel:be,width:800,footer:(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:12,padding:`16px 24px`,background:`rgba(255,255,255,0.6)`,borderTop:`1px solid rgba(139, 92, 246, 0.08)`},children:(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(m0,{}),onClick:xe,style:{borderRadius:10,background:`linear-gradient(135deg, #8b5cf6 0%, #ddd6fe 100%)`,border:`none`,boxShadow:`0 8px 18px rgba(47, 52, 64, 0.15)`},children:`下载`})}),centered:!0,style:{borderRadius:16},styles:{body:{display:`flex`,alignItems:`center`,justifyContent:`center`,minHeight:`400px`},header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(139, 92, 246, 0.08)`,padding:`16px 24px`}},children:(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:`100%`,height:`100%`},children:ge===`image`?(0,$.jsx)(`img`,{src:me.startsWith(`http`)?me:`http://ceshi.apiforeign.minzhong.cn${me}`,alt:`预览`,style:{width:`100%`,maxHeight:`400px`,objectFit:`contain`}}):(0,$.jsx)(`video`,{ref:ve,src:me.startsWith(`http`)?me:`http://ceshi.apiforeign.minzhong.cn${me}`,controls:!0,style:{maxWidth:`100%`,maxHeight:`400px`}})})})]})}var mse={pending_analysis:{label:`等待分析`,color:`default`},analyzing:{label:`分析中`,color:`processing`},analysis_completed:{label:`分析完成`,color:`blue`},analysis_failed:{label:`分析失败`,color:`red`},splitting:{label:`拆镜中`,color:`processing`},split_completed:{label:`拆镜完成`,color:`green`},partial_failed:{label:`部分失败`,color:`orange`},failed:{label:`失败`,color:`red`},deleted:{label:`已软删`,color:`default`}},hse=e=>{let t=mse[e]||{label:e,color:`default`};return(0,$.jsx)(XQ,{color:t.color,children:t.label})};function gse(){let e=Ye(),[t,n]=(0,S.useState)(``),[r,i]=(0,S.useState)(``),[a,o]=(0,S.useState)(``),[s,c]=(0,S.useState)(!1),[l,u]=(0,S.useState)(``),[d,f]=(0,S.useState)(0),[p,m]=(0,S.useState)(!1),[h,g]=(0,S.useState)([]),[_,v]=(0,S.useState)(1),[y,b]=(0,S.useState)(10),[x,C]=(0,S.useState)(0),[w,T]=(0,S.useState)(``),E=(0,S.useRef)(null),D=(0,S.useRef)(null),O=(0,S.useCallback)(()=>{t&&URL.revokeObjectURL(t),n(``),i(``),o(``),f(0),u(``)},[t]),k=async e=>{if(!e.type.startsWith(`video/`))return o(`请选择视频文件`),!1;if(e.size>100*1024*1024)return o(`视频文件大小不能超过 100MB`),!1;let t=await new Promise(t=>{let n=document.createElement(`video`);n.preload=`metadata`,n.onloadedmetadata=()=>{t(n.duration),URL.revokeObjectURL(n.src)},n.onerror=()=>{t(0)},n.src=URL.createObjectURL(e)});if(t>60)return o(`视频时长不能超过 1分钟`),!1;O(),m(!0);try{let r=await Mie(e,t);n(r.url),i(r.resource_id||``),o(``),Z.success(`视频上传成功`)}catch{o(`视频上传失败,请重试`),Z.error(`视频上传失败`)}finally{m(!1)}return!1},A=(0,S.useCallback)(()=>{E.current&&f(E.current.duration)},[]),j=async()=>{if(!t||!l.trim()){Z.warning(`请先上传视频并输入产品名称`);return}m(!0);try{eae({video_url:t,video_duration_seconds:d,video_resource_id:r||void 0,title:l.trim(),idempotency_key:`shot_${Date.now()}`}).then(t=>{Q5(1,20,w).then(t=>{Z.loading(`创建中...`,3),setTimeout(()=>{e(`/removelens/${t.items[0].id}/removeinfo`)},3e3)})}),O()}catch{Z.error(`任务创建失败,请重试`)}finally{m(!1)}},M=async(e,t,n)=>{try{let r=await Q5(e,t,n);g(r.items||[]),C(r.total||0),v(e),b(t)}catch{Z.error(`获取列表失败`)}},N=(e,t)=>{M(e,t,w)},P=()=>{M(1,10,w)};return(0,$.jsx)(`div`,{style:{margin:`-24px -32px -32px`,borderRadius:20,minHeight:`calc(100vh - 34px)`,overflow:`auto`,background:`linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #f0f9ff 100%)`,position:`relative`,padding:`20px 32px`,backgroundImage:`url(${xoe})`,backgroundRepeat:`no-repeat`,backgroundSize:`100% 100%`,backgroundPosition:`center`},children:(0,$.jsxs)(`div`,{style:{maxWidth:1200,margin:`0 auto`,position:`relative`,zIndex:10},children:[(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:24,padding:`16px 24px`,borderRadius:16,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(139, 92, 246, 0.04) 100%)`,backdropFilter:`blur(10px)`,border:`1px solid rgba(99, 102, 241, 0.08)`,position:`relative`,overflow:`hidden`,flexWrap:`wrap`,gap:12},children:[(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16},children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{style:{margin:0,fontSize:18,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`AI视频拆镜工作台`}),(0,$.jsx)(`p`,{style:{fontSize:13,color:`#64748b`,margin:`4px 0 0 0`},children:`精细化镜头复刻工具,拆分参考视频单镜头独立复刻,提升素材原创度,规避素材同质化`})]})}),(0,$.jsx)(X,{type:`primary`,ghost:!0,icon:(0,$.jsx)(fH,{}),onClick:()=>{c(!0),M(1,10,w)},style:{borderRadius:10,padding:`6px 16px`,fontSize:13,background:`rgba(99, 102, 241, 0.1)`,borderColor:`rgba(99, 102, 241, 0.2)`,color:`#6366f1`},children:`创作记录`})]}),(0,$.jsxs)(`div`,{style:{width:`100%`,maxWidth:720,margin:`0 auto`},children:[a&&(0,$.jsx)(`div`,{style:{background:`linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%)`,backdropFilter:`blur(10px)`,border:`1px solid rgba(239, 68, 68, 0.2)`,borderRadius:12,padding:`14px 20px`,marginBottom:24,color:`#ef4444`,fontSize:14,textAlign:`center`,fontWeight:500},children:a}),!t&&(0,$.jsxs)(`div`,{style:{background:`linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.85) 100%)`,backdropFilter:`blur(20px)`,borderRadius:24,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`,position:`relative`,overflow:`hidden`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:-50,right:-50,width:200,height:200,background:`radial-gradient(circle, rgba(99,102,241,0.05) 0%, transparent 70%)`,borderRadius:`50%`}}),(0,$.jsx)(b0.Dragger,{accept:`video/*`,beforeUpload:k,showUploadList:!1,disabled:p,style:{background:p?`rgba(243, 244, 246, 0.3)`:`transparent`,border:`2px dashed ${p?`rgba(209, 213, 219, 0.5)`:`rgba(99, 102, 241, 0.3)`}`,borderRadius:24,padding:`56px 20px`,cursor:p?`not-allowed`:`pointer`,margin:0},children:p?(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`},children:[(0,$.jsx)(`div`,{style:{width:100,height:100,margin:`0 auto 20px`,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%)`,borderRadius:24,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`div`,{style:{width:40,height:40,border:`4px solid #6366f1`,borderTopColor:`transparent`,borderRadius:`50%`,animation:`spin 1s linear infinite`}})}),(0,$.jsx)(`p`,{style:{fontSize:16,color:`#6366f1`,margin:`0 0 8px 0`,fontWeight:600},children:`上传中...`}),(0,$.jsx)(`p`,{style:{fontSize:13,color:`#64748b`,margin:0},children:`请稍候,视频正在上传`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{width:100,height:100,margin:`0 auto 20px`,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%)`,borderRadius:24,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(C4,{style:{fontSize:40,color:`#6366f1`}})}),(0,$.jsx)(`p`,{style:{fontSize:16,color:`#1e293b`,margin:`0 0 8px 0`,fontWeight:600},children:`点击或拖拽到此上传视频文件`}),(0,$.jsx)(`p`,{style:{fontSize:13,color:`#64748b`,margin:0},children:`支持 MP4、MOV 格式视频,最大支持 100MB 的文件,支持上传 1 分钟内的视频`})]})})]}),t&&(0,$.jsxs)(`div`,{style:{background:`linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.85) 100%)`,backdropFilter:`blur(20px)`,borderRadius:24,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`,overflow:`hidden`,position:`relative`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:-50,right:-50,width:200,height:200,background:`radial-gradient(circle, rgba(99,102,241,0.05) 0%, transparent 70%)`,borderRadius:`50%`}}),(0,$.jsxs)(`div`,{style:{borderRadius:22,background:`#ffffff`,padding:`24px`,position:`relative`,zIndex:1},children:[(0,$.jsx)(vK,{title:`确定要删除吗?`,okText:`确定`,cancelText:`取消`,onConfirm:O,children:(0,$.jsx)(`button`,{style:{position:`absolute`,top:20,right:20,width:36,height:36,border:`1px solid rgba(99, 102, 241, 0.2)`,background:`rgba(99, 102, 241, 0.05)`,borderRadius:10,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:16,color:`#6366f1`,zIndex:10,transition:`all 0.2s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(239, 68, 68, 0.1)`,e.currentTarget.style.borderColor=`rgba(239, 68, 68, 0.3)`,e.currentTarget.style.color=`#ef4444`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(99, 102, 241, 0.05)`,e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.2)`,e.currentTarget.style.color=`#6366f1`},children:`🗑️`})}),(0,$.jsx)(`div`,{style:{textAlign:`center`,marginBottom:20},children:(0,$.jsx)(`video`,{ref:E,src:`http://ceshi.apiforeign.minzhong.cn${t}`,controls:!0,onLoadedMetadata:A,style:{maxWidth:`100%`,maxHeight:320,borderRadius:12,background:`#000`,boxShadow:`0 4px 16px rgba(0,0,0,0.1)`}})}),(0,$.jsxs)(`div`,{style:{marginBottom:24},children:[(0,$.jsxs)(`label`,{style:{display:`block`,fontSize:14,fontWeight:500,color:`#334155`,marginBottom:8},children:[`产品名称 `,(0,$.jsx)(`span`,{style:{color:`#ef4444`},children:`*`})]}),(0,$.jsx)(IW,{placeholder:`请输入产品名称`,value:l,onChange:e=>u(e.target.value),style:{width:`100%`,height:44,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.2)`,transition:`all 0.2s ease`},onMouseEnter:e=>{e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.4)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.2)`}})]}),(0,$.jsx)(`div`,{style:{textAlign:`center`,marginTop:16},children:(0,$.jsx)(`button`,{onClick:j,disabled:!t||!l.trim()||p,style:{padding:`14px 56px`,background:t&&l.trim()&&!p?`linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%)`:`#e2e8f0`,color:`white`,border:`none`,borderRadius:12,fontSize:15,fontWeight:600,cursor:t&&l.trim()&&!p?`pointer`:`not-allowed`,boxShadow:t&&l.trim()&&!p?`0 6px 20px rgba(99, 102, 241, 0.3)`:`none`,display:`inline-flex`,alignItems:`center`,gap:10,transition:`all 0.3s ease`},onMouseEnter:e=>{t&&l.trim()&&!p&&(e.currentTarget.style.transform=`translateY(-2px)`,e.currentTarget.style.boxShadow=`0 8px 25px rgba(99, 102, 241, 0.4)`)},onMouseLeave:e=>{t&&l.trim()&&!p&&(e.currentTarget.style.transform=`translateY(0)`,e.currentTarget.style.boxShadow=`0 6px 20px rgba(99, 102, 241, 0.3)`)},children:(0,$.jsx)(`span`,{children:p?`创建中...`:`创建`})})})]})]}),(0,$.jsx)(`canvas`,{ref:D,style:{display:`none`}}),(0,$.jsxs)(mK,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`创作记录`})]}),open:s,onCancel:()=>c(!1),width:850,footer:null,style:{borderRadius:20},styles:{body:{height:580,display:`flex`,flexDirection:`column`,padding:0},header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,padding:`16px 24px`}},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,margin:`16px 24px`,flexShrink:0},children:[(0,$.jsx)(IW,{placeholder:`搜索产品名称`,value:w,onChange:e=>T(e.target.value),onPressEnter:P,style:{width:220,borderRadius:10,marginRight:10,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`}}),(0,$.jsx)(X,{type:`primary`,onClick:P,style:{borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`搜索`})]}),(0,$.jsx)(`div`,{style:{flex:1,overflow:`auto`,padding:`0 24px 24px`},children:(0,$.jsx)(`div`,{style:{background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(10px)`,borderRadius:16,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.08)`,boxShadow:`0 4px 16px rgba(99, 102, 241, 0.06)`},children:(0,$.jsx)(LQ,{columns:[{dataIndex:`title`,key:`title`,render:e=>(0,$.jsx)(`span`,{style:{fontSize:14,color:`#1e293b`,fontWeight:500},children:e})},{title:`状态`,dataIndex:`status`,key:`status`,render:e=>hse(e)},{title:`创建时间`,dataIndex:`createdAt`,key:`createdAt`,render:e=>{if(!e)return`-`;let t=new Date(e);return(0,$.jsx)(`span`,{style:{fontSize:13,color:`#64748b`},children:`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)} ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`})}},{title:`操作`,key:`action`,align:`center`,render:t=>(0,$.jsxs)(sH,{children:[(0,$.jsx)(X,{type:`text`,onClick:()=>e(`/removelens/${t.id}/removeinfo`),style:{color:`#6366f1`,fontSize:13,padding:`4px 12px`,borderRadius:6,background:`rgba(99, 102, 241, 0.1)`},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(99, 102, 241, 0.15)`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(99, 102, 241, 0.1)`},children:`查看详情`}),(0,$.jsx)(vK,{title:`确认删除这个拆镜项目吗?`,onConfirm:async()=>{try{await fae(t.id),Z.success(`删除成功`),M(_,y,w)}catch{Z.error(`删除失败`)}},children:(0,$.jsx)(X,{type:`text`,danger:!0,style:{color:`#ef4444`,fontSize:13,padding:`4px 12px`,borderRadius:6,background:`rgba(239, 68, 68, 0.1)`},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(239, 68, 68, 0.15)`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(239, 68, 68, 0.1)`},children:`删除`})})]})}],dataSource:h,rowKey:`id`,pagination:{current:_,pageSize:y,total:x,showSizeChanger:!0,showQuickJumper:!0,showTotal:e=>`共 ${e} 条`,onChange:N,style:{padding:`16px 24px`,borderTop:`1px solid rgba(99, 102, 241, 0.1)`}},style:{fontSize:13},scroll:{y:300},components:{body:{row:({className:e,style:t,...n})=>(0,$.jsx)(`tr`,{...n,className:e,style:{...t,transition:`all 0.2s ease`,borderBottom:`1px solid rgba(99, 102, 241, 0.05)`}}),cell:({className:e,style:t,...n})=>(0,$.jsx)(`td`,{...n,className:e,style:{...t,padding:`16px 24px`}})},header:{cell:({className:e,style:t,...n})=>(0,$.jsx)(`th`,{...n,className:e,style:{...t,background:`rgba(99, 102, 241, 0.03)`,color:`#64748b`,fontWeight:500,fontSize:13,padding:`16px 24px`,borderBottom:`none`}})}}})})})]})]})]})})}var _se=c(o(((e,t)=>{(function(n){typeof e==`object`&&t!==void 0?t.exports=n():typeof define==`function`&&define.amd?define([],n):(typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:this).JSZip=n()})(function(){return function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var c=typeof l==`function`&&l;if(!s&&c)return c(o,!0);if(a)return a(o,!0);var u=Error(`Cannot find module '`+o+`'`);throw u.code=`MODULE_NOT_FOUND`,u}var d=n[o]={exports:{}};t[o][0].call(d.exports,function(e){var n=t[o][1][e];return i(n||e)},d,d.exports,e,t,n,r)}return n[o].exports}for(var a=typeof l==`function`&&l,o=0;o>2,s=(3&t)<<4|n>>4,c=1>6:64,l=2>4,n=(15&o)<<4|(s=a.indexOf(e.charAt(l++)))>>2,r=(3&s)<<6|(c=a.indexOf(e.charAt(l++))),f[u++]=t,s!==64&&(f[u++]=n),c!==64&&(f[u++]=r);return f}},{"./support":30,"./utils":32}],2:[function(e,t,n){var r=e(`./external`),i=e(`./stream/DataWorker`),a=e(`./stream/Crc32Probe`),o=e(`./stream/DataLengthProbe`);function s(e,t,n,r,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=r,this.compressedContent=i}s.prototype={getContentWorker:function(){var e=new i(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o(`data_length`)),t=this;return e.on(`end`,function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw Error(`Bug : uncompressed data size mismatch`)}),e},getCompressedWorker:function(){return new i(r.Promise.resolve(this.compressedContent)).withStreamInfo(`compressedSize`,this.compressedSize).withStreamInfo(`uncompressedSize`,this.uncompressedSize).withStreamInfo(`crc32`,this.crc32).withStreamInfo(`compression`,this.compression)}},s.createWorkerFrom=function(e,t,n){return e.pipe(new a).pipe(new o(`uncompressedSize`)).pipe(t.compressWorker(n)).pipe(new o(`compressedSize`)).withStreamInfo(`compression`,t)},t.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){var r=e(`./stream/GenericWorker`);n.STORE={magic:`\0\0`,compressWorker:function(){return new r(`STORE compression`)},uncompressWorker:function(){return new r(`STORE decompression`)}},n.DEFLATE=e(`./flate`)},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,n){var r=e(`./utils`),i=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t){return e!==void 0&&e.length?r.getTypeOf(e)===`string`?function(e,t,n,r){var a=i,o=r+n;e^=-1;for(var s=r;s>>8^a[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length,0):function(e,t,n,r){var a=i,o=r+n;e^=-1;for(var s=r;s>>8^a[255&(e^t[s])];return-1^e}(0|t,e,e.length,0):0}},{"./utils":32}],5:[function(e,t,n){n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,t,n){var r=null;r=typeof Promise<`u`?Promise:e(`lie`),t.exports={Promise:r}},{lie:37}],7:[function(e,t,n){var r=typeof Uint8Array<`u`&&typeof Uint16Array<`u`&&typeof Uint32Array<`u`,i=e(`pako`),a=e(`./utils`),o=e(`./stream/GenericWorker`),s=r?`uint8array`:`array`;function c(e,t){o.call(this,`FlateWorker/`+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}n.magic=`\b\0`,a.inherits(c,o),c.prototype.processChunk=function(e){this.meta=e.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(s,e.data),!1)},c.prototype.flush=function(){o.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},c.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},c.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},n.compressWorker=function(e){return new c(`Deflate`,e)},n.uncompressWorker=function(){return new c(`Inflate`,{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,n){function r(e,t){var n,r=``;for(n=0;n>>=8;return r}function i(e,t,n,i,o,u){var d,f,p=e.file,m=e.compression,h=u!==s.utf8encode,g=a.transformTo(`string`,u(p.name)),_=a.transformTo(`string`,s.utf8encode(p.name)),v=p.comment,y=a.transformTo(`string`,u(v)),b=a.transformTo(`string`,s.utf8encode(v)),x=_.length!==p.name.length,S=b.length!==v.length,C=``,w=``,T=``,E=p.dir,D=p.date,O={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(O.crc32=e.crc32,O.compressedSize=e.compressedSize,O.uncompressedSize=e.uncompressedSize);var k=0;t&&(k|=8),h||!x&&!S||(k|=2048);var A=0,j=0;E&&(A|=16),o===`UNIX`?(j=798,A|=function(e,t){var n=e;return e||(n=t?16893:33204),(65535&n)<<16}(p.unixPermissions,E)):(j=20,A|=function(e){return 63&(e||0)}(p.dosPermissions)),d=D.getUTCHours(),d<<=6,d|=D.getUTCMinutes(),d<<=5,d|=D.getUTCSeconds()/2,f=D.getUTCFullYear()-1980,f<<=4,f|=D.getUTCMonth()+1,f<<=5,f|=D.getUTCDate(),x&&(w=r(1,1)+r(c(g),4)+_,C+=`up`+r(w.length,2)+w),S&&(T=r(1,1)+r(c(y),4)+b,C+=`uc`+r(T.length,2)+T);var M=``;return M+=` -\0`,M+=r(k,2),M+=m.magic,M+=r(d,2),M+=r(f,2),M+=r(O.crc32,4),M+=r(O.compressedSize,4),M+=r(O.uncompressedSize,4),M+=r(g.length,2),M+=r(C.length,2),{fileRecord:l.LOCAL_FILE_HEADER+M+g+C,dirRecord:l.CENTRAL_FILE_HEADER+r(j,2)+M+r(y.length,2)+`\0\0\0\0`+r(A,4)+r(i,4)+g+C+y}}var a=e(`../utils`),o=e(`../stream/GenericWorker`),s=e(`../utf8`),c=e(`../crc32`),l=e(`../signature`);function u(e,t,n,r){o.call(this,`ZipFileWorker`),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=r,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(u,o),u.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,o.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-r-1))/n:100}}))},u.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},u.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,n=i(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),t)this.push({data:function(e){return l.DATA_DESCRIPTOR+r(e.crc32,4)+r(e.compressedSize,4)+r(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},u.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return r.transformTo(`string`,this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{"../utils":32}],19:[function(e,t,n){var r=e(`./Uint8ArrayReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,n){var r=e(`./DataReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],21:[function(e,t,n){var r=e(`./ArrayReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.readData=function(e){if(this.checkOffset(e),e===0)return new Uint8Array;var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,n){var r=e(`../utils`),i=e(`../support`),a=e(`./ArrayReader`),o=e(`./StringReader`),s=e(`./NodeBufferReader`),c=e(`./Uint8ArrayReader`);t.exports=function(e){var t=r.getTypeOf(e);return r.checkSupport(t),t!==`string`||i.uint8array?t===`nodebuffer`?new s(e):i.uint8array?new c(r.transformTo(`uint8array`,e)):new a(r.transformTo(`array`,e)):new o(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,n){n.LOCAL_FILE_HEADER=`PK`,n.CENTRAL_FILE_HEADER=`PK`,n.CENTRAL_DIRECTORY_END=`PK`,n.ZIP64_CENTRAL_DIRECTORY_LOCATOR=`PK\x07`,n.ZIP64_CENTRAL_DIRECTORY_END=`PK`,n.DATA_DESCRIPTOR=`PK\x07\b`},{}],24:[function(e,t,n){var r=e(`./GenericWorker`),i=e(`../utils`);function a(e){r.call(this,`ConvertWorker to `+e),this.destType=e}i.inherits(a,r),a.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,n){var r=e(`./GenericWorker`),i=e(`../crc32`);function a(){r.call(this,`Crc32Probe`),this.withStreamInfo(`crc32`,0)}e(`../utils`).inherits(a,r),a.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,n){var r=e(`../utils`),i=e(`./GenericWorker`);function a(e){i.call(this,`DataLengthProbe for `+e),this.propName=e,this.withStreamInfo(e,0)}r.inherits(a,i),a.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,n){var r=e(`../utils`),i=e(`./GenericWorker`);function a(e){i.call(this,`DataWorker`);var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type=``,this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=r.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}r.inherits(a,i),a.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,r.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case`string`:e=this.data.substring(this.index,t);break;case`uint8array`:e=this.data.subarray(this.index,t);break;case`array`:case`nodebuffer`:e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,n){function r(e){this.name=e||`default`,this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}r.prototype={push:function(e){this.emit(`data`,e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit(`end`),this.cleanUp(),this.isFinished=!0}catch(e){this.emit(`error`,e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit(`error`,e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var n=0;n `+e:e}},t.exports=r},{}],29:[function(e,t,n){var r=e(`../utils`),i=e(`./ConvertWorker`),a=e(`./GenericWorker`),o=e(`../base64`),s=e(`../support`),c=e(`../external`),l=null;if(s.nodestream)try{l=e(`../nodejs/NodejsStreamOutputAdapter`)}catch{}function u(e,t){return new c.Promise(function(n,i){var a=[],s=e._internalType,c=e._outputType,l=e._mimeType;e.on(`data`,function(e,n){a.push(e),t&&t(n)}).on(`error`,function(e){a=[],i(e)}).on(`end`,function(){try{n(function(e,t,n){switch(e){case`blob`:return r.newBlob(r.transformTo(`arraybuffer`,t),n);case`base64`:return o.encode(t);default:return r.transformTo(e,t)}}(c,function(e,t){var n,r=0,i=null,a=0;for(n=0;n`u`)n.blob=!1;else{var r=new ArrayBuffer(0);try{n.blob=new Blob([r],{type:`application/zip`}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(r),n.blob=i.getBlob(`application/zip`).size===0}catch{n.blob=!1}}}try{n.nodestream=!!e(`readable-stream`).Readable}catch{n.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,n){for(var r=e(`./utils`),i=e(`./support`),a=e(`./nodejsUtils`),o=e(`./stream/GenericWorker`),s=Array(256),c=0;c<256;c++)s[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;s[254]=s[254]=1;function l(){o.call(this,`utf-8 decode`),this.leftOver=null}function u(){o.call(this,`utf-8 encode`)}n.utf8encode=function(e){return i.nodebuffer?a.newBufferFrom(e,`utf-8`):function(e){var t,n,r,a,o,s=e.length,c=0;for(a=0;a>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t}(e)},n.utf8decode=function(e){return i.nodebuffer?r.transformTo(`nodebuffer`,e).toString(`utf-8`):function(e){var t,n,i,a,o=e.length,c=Array(2*o);for(t=n=0;t>10&1023,c[n++]=56320|1023&i)}return c.length!==n&&(c.subarray?c=c.subarray(0,n):c.length=n),r.applyFromCharCode(c)}(e=r.transformTo(i.uint8array?`uint8array`:`array`,e))},r.inherits(l,o),l.prototype.processChunk=function(e){var t=r.transformTo(i.uint8array?`uint8array`:`array`,e.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var a=t;(t=new Uint8Array(a.length+this.leftOver.length)).set(this.leftOver,0),t.set(a,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var o=function(e,t){var n;for((t||=e.length)>e.length&&(t=e.length),n=t-1;0<=n&&(192&e[n])==128;)n--;return n<0||n===0?t:n+s[e[n]]>t?n:t}(t),c=t;o!==t.length&&(i.uint8array?(c=t.subarray(0,o),this.leftOver=t.subarray(o,t.length)):(c=t.slice(0,o),this.leftOver=t.slice(o,t.length))),this.push({data:n.utf8decode(c),meta:e.meta})},l.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=l,r.inherits(u,o),u.prototype.processChunk=function(e){this.push({data:n.utf8encode(e.data),meta:e.meta})},n.Utf8EncodeWorker=u},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,n){var r=e(`./support`),i=e(`./base64`),a=e(`./nodejsUtils`),o=e(`./external`);function s(e){return e}function c(e,t){for(var n=0;n>8;this.dir=!!(16&this.externalFileAttributes),e==0&&(this.dosPermissions=63&this.externalFileAttributes),e==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!==`/`||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=r(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,n,r,i=e.index+this.extraFieldsLength;for(this.extraFields||={};e.index+4>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t},n.buf2binstring=function(e){return c(e,e.length)},n.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,i=t.length;n>10&1023,l[r++]=56320|1023&i)}return c(l,r)},n.utf8border=function(e,t){var n;for((t||=e.length)>e.length&&(t=e.length),n=t-1;0<=n&&(192&e[n])==128;)n--;return n<0||n===0?t:n+o[e[n]]>t?n:t}},{"./common":41}],43:[function(e,t,n){t.exports=function(e,t,n,r){for(var i=65535&e|0,a=e>>>16&65535|0,o=0;n!==0;){for(n-=o=2e3>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,i){var a=r,o=i+n;e^=-1;for(var s=i;s>>8^a[255&(e^t[s])];return-1^e}},{}],46:[function(e,t,n){var r,i=e(`../utils/common`),a=e(`./trees`),o=e(`./adler32`),s=e(`./crc32`),c=e(`./messages`),l=0,u=4,d=0,f=-2,p=-1,m=4,h=2,g=8,_=9,v=286,y=30,b=19,x=2*v+1,S=15,C=3,w=258,T=w+C+1,E=42,D=113,O=1,k=2,A=3,j=4;function M(e,t){return e.msg=c[t],t}function N(e){return(e<<1)-(4e.avail_out&&(n=e.avail_out),n!==0&&(i.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))}function I(e,t){a._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,F(e.strm)}function L(e,t){e.pending_buf[e.pending++]=t}function R(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function z(e,t){var n,r,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-T?e.strstart-(e.w_size-T):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+w,p=l[a+o-1],m=l[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do if(l[(n=t)+o]===m&&l[n+o-1]===p&&l[n]===l[a]&&l[++n]===l[a+1]){a+=2,n++;do;while(l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&ac&&--i!=0);return o<=e.lookahead?o:e.lookahead}function B(e){var t,n,r,a,c,l,u,d,f,p,m=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=m+(m-T)){for(i.arraySet(e.window,e.window,m,m,0),e.match_start-=m,e.strstart-=m,e.block_start-=m,t=n=e.hash_size;r=e.head[--t],e.head[t]=m<=r?r-m:0,--n;);for(t=n=m;r=e.prev[--t],e.prev[t]=m<=r?r-m:0,--n;);a+=m}if(e.strm.avail_in===0)break;if(l=e.strm,u=e.window,d=e.strstart+e.lookahead,f=a,p=void 0,p=l.avail_in,f=C)for(c=e.strstart-e.insert,e.ins_h=e.window[c],e.ins_h=(e.ins_h<=C&&(e.ins_h=(e.ins_h<=C)if(r=a._tr_tally(e,e.strstart-e.match_start,e.match_length-C),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=C){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=C&&(e.ins_h=(e.ins_h<=C&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-C,r=a._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-C),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(B(e),e.lookahead===0&&t===l)return O;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,I(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-T&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(I(e,!0),e.strm.avail_out===0?A:j):(e.strstart>e.block_start&&(I(e,!1),e.strm.avail_out),O)}),new U(4,4,8,4,V),new U(4,5,16,8,V),new U(4,6,32,32,V),new U(4,4,16,16,H),new U(8,16,32,32,H),new U(8,16,128,128,H),new U(8,32,128,256,H),new U(32,128,258,1024,H),new U(32,258,258,4096,H)],n.deflateInit=function(e,t){return G(e,t,g,15,8,0)},n.deflateInit2=G,n.deflateReset=te,n.deflateResetKeep=ee,n.deflateSetHeader=function(e,t){return e&&e.state&&e.state.wrap===2?(e.state.gzhead=t,d):f},n.deflate=function(e,t){var n,i,o,c;if(!e||!e.state||5>8&255),L(i,i.gzhead.time>>16&255),L(i,i.gzhead.time>>24&255),L(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),L(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(L(i,255&i.gzhead.extra.length),L(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(L(i,0),L(i,0),L(i,0),L(i,0),L(i,0),L(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),L(i,3),i.status=D);else{var p=g+(i.w_bits-8<<4)<<8;p|=(2<=i.strategy||i.level<2?0:i.level<6?1:i.level===6?2:3)<<6,i.strstart!==0&&(p|=32),p+=31-p%31,i.status=D,R(i,p),i.strstart!==0&&(R(i,e.adler>>>16),R(i,65535&e.adler)),e.adler=1}if(i.status===69)if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),F(e),o=i.pending,i.pending!==i.pending_buf_size));)L(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(i.status===73)if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),F(e),o=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindexo&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),c===0&&(i.gzindex=0,i.status=91)}else i.status=91;if(i.status===91)if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),F(e),o=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindexo&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),c===0&&(i.status=103)}else i.status=103;if(i.status===103&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&F(e),i.pending+2<=i.pending_buf_size&&(L(i,255&e.adler),L(i,e.adler>>8&255),e.adler=0,i.status=D)):i.status=D),i.pending!==0){if(F(e),e.avail_out===0)return i.last_flush=-1,d}else if(e.avail_in===0&&N(t)<=N(n)&&t!==u)return M(e,-5);if(i.status===666&&e.avail_in!==0)return M(e,-5);if(e.avail_in!==0||i.lookahead!==0||t!==l&&i.status!==666){var m=i.strategy===2?function(e,t){for(var n;;){if(e.lookahead===0&&(B(e),e.lookahead===0)){if(t===l)return O;break}if(e.match_length=0,n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(I(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(I(e,!1),e.strm.avail_out===0)?O:k}(i,t):i.strategy===3?function(e,t){for(var n,r,i,o,s=e.window;;){if(e.lookahead<=w){if(B(e),e.lookahead<=w&&t===l)return O;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=C&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=C?(n=a._tr_tally(e,1,e.match_length-C),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(I(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(I(e,!1),e.strm.avail_out===0)?O:k}(i,t):r[i.level].func(i,t);if(m!==A&&m!==j||(i.status=666),m===O||m===A)return e.avail_out===0&&(i.last_flush=-1),d;if(m===k&&(t===1?a._tr_align(i):t!==5&&(a._tr_stored_block(i,0,0,!1),t===3&&(P(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),F(e),e.avail_out===0))return i.last_flush=-1,d}return t===u?i.wrap<=0?1:(i.wrap===2?(L(i,255&e.adler),L(i,e.adler>>8&255),L(i,e.adler>>16&255),L(i,e.adler>>24&255),L(i,255&e.total_in),L(i,e.total_in>>8&255),L(i,e.total_in>>16&255),L(i,e.total_in>>24&255)):(R(i,e.adler>>>16),R(i,65535&e.adler)),F(e),0=n.w_size&&(s===0&&(P(n.head),n.strstart=0,n.block_start=0,n.insert=0),p=new i.Buf8(n.w_size),i.arraySet(p,t,m-n.w_size,n.w_size,0),t=p,m=n.w_size),c=e.avail_in,l=e.next_in,u=e.input,e.avail_in=m,e.next_in=0,e.input=t,B(n);n.lookahead>=C;){for(r=n.strstart,a=n.lookahead-(C-1);n.ins_h=(n.ins_h<>>=b=y>>>24,m-=b,(b=y>>>16&255)==0)E[a++]=65535&y;else{if(!(16&b)){if(!(64&b)){y=h[(65535&y)+(p&(1<>>=b,m-=b),m<15&&(p+=T[r++]<>>=b=y>>>24,m-=b,!(16&(b=y>>>16&255))){if(!(64&b)){y=g[(65535&y)+(p&(1<>>=b,m-=b,(b=a-o)>3,p&=(1<<(m-=x<<3))-1,e.next_in=r,e.next_out=a,e.avail_in=r>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function g(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg=``,t.wrap&&(e.adler=1&t.wrap),t.mode=f,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new r.Buf32(p),t.distcode=t.distdyn=new r.Buf32(m),t.sane=1,t.back=-1,u):d}function v(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,_(e)):d}function y(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=o.wsize?(r.arraySet(o.window,t,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i<(a=o.wsize-o.wnext)&&(a=i),r.arraySet(o.window,t,n-i,a,o.wnext),(i-=a)?(r.arraySet(o.window,t,n-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,n.check=a(n.check,B,2,0),x=b=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&b)<<8)+(b>>8))%31){e.msg=`incorrect header check`,n.mode=30;break}if((15&b)!=8){e.msg=`unknown compression method`,n.mode=30;break}if(x-=4,F=8+(15&(b>>>=4)),n.wbits===0)n.wbits=F;else if(F>n.wbits){e.msg=`invalid window size`,n.mode=30;break}n.dmax=1<>8&1),512&n.flags&&(B[0]=255&b,B[1]=b>>>8&255,n.check=a(n.check,B,2,0)),x=b=0,n.mode=3;case 3:for(;x<32;){if(v===0)break e;v--,b+=p[g++]<>>8&255,B[2]=b>>>16&255,B[3]=b>>>24&255,n.check=a(n.check,B,4,0)),x=b=0,n.mode=4;case 4:for(;x<16;){if(v===0)break e;v--,b+=p[g++]<>8),512&n.flags&&(B[0]=255&b,B[1]=b>>>8&255,n.check=a(n.check,B,2,0)),x=b=0,n.mode=5;case 5:if(1024&n.flags){for(;x<16;){if(v===0)break e;v--,b+=p[g++]<>>8&255,n.check=a(n.check,B,2,0)),x=b=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(v<(E=n.length)&&(E=v),E&&(n.head&&(F=n.head.extra_len-n.length,n.head.extra||(n.head.extra=Array(n.head.extra_len)),r.arraySet(n.head.extra,p,g,E,F)),512&n.flags&&(n.check=a(n.check,p,E,g)),v-=E,g+=E,n.length-=E),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(v===0)break e;for(E=0;F=p[g+ E++],n.head&&F&&n.length<65536&&(n.head.name+=String.fromCharCode(F)),F&&E>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;x<32;){if(v===0)break e;v--,b+=p[g++]<>>=7&x,x-=7&x,n.mode=27;break}for(;x<3;){if(v===0)break e;v--,b+=p[g++]<>>=1)){case 0:n.mode=14;break;case 1:if(w(n),n.mode=20,t!==6)break;b>>>=2,x-=2;break e;case 2:n.mode=17;break;case 3:e.msg=`invalid block type`,n.mode=30}b>>>=2,x-=2;break;case 14:for(b>>>=7&x,x-=7&x;x<32;){if(v===0)break e;v--,b+=p[g++]<>>16^65535)){e.msg=`invalid stored block lengths`,n.mode=30;break}if(n.length=65535&b,x=b=0,n.mode=15,t===6)break e;case 15:n.mode=16;case 16:if(E=n.length){if(v>>=5,x-=5,n.ndist=1+(31&b),b>>>=5,x-=5,n.ncode=4+(15&b),b>>>=4,x-=4,286>>=3,x-=3}for(;n.have<19;)n.lens[V[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,L={bits:n.lenbits},I=s(0,n.lens,0,19,n.lencode,0,n.work,L),n.lenbits=L.bits,I){e.msg=`invalid code lengths set`,n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have>>16&255,j=65535&z,!((k=z>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=k,x-=k,n.lens[n.have++]=j;else{if(j===16){for(R=k+2;x>>=k,x-=k,n.have===0){e.msg=`invalid bit length repeat`,n.mode=30;break}F=n.lens[n.have-1],E=3+(3&b),b>>>=2,x-=2}else if(j===17){for(R=k+3;x>>=k)),b>>>=3,x-=3}else{for(R=k+7;x>>=k)),b>>>=7,x-=7}if(n.have+E>n.nlen+n.ndist){e.msg=`invalid bit length repeat`,n.mode=30;break}for(;E--;)n.lens[n.have++]=F}}if(n.mode===30)break;if(n.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,n.mode=30;break}if(n.lenbits=9,L={bits:n.lenbits},I=s(c,n.lens,0,n.nlen,n.lencode,0,n.work,L),n.lenbits=L.bits,I){e.msg=`invalid literal/lengths set`,n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,L={bits:n.distbits},I=s(l,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,L),n.distbits=L.bits,I){e.msg=`invalid distances set`,n.mode=30;break}if(n.mode=20,t===6)break e;case 20:n.mode=21;case 21:if(6<=v&&258<=y){e.next_out=_,e.avail_out=y,e.next_in=g,e.avail_in=v,n.hold=b,n.bits=x,o(e,C),_=e.next_out,m=e.output,y=e.avail_out,g=e.next_in,p=e.input,v=e.avail_in,b=n.hold,x=n.bits,n.mode===12&&(n.back=-1);break}for(n.back=0;A=(z=n.lencode[b&(1<>>16&255,j=65535&z,!((k=z>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>M)])>>>16&255,j=65535&z,!(M+(k=z>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=M,x-=M,n.back+=M}if(b>>>=k,x-=k,n.back+=k,n.length=j,A===0){n.mode=26;break}if(32&A){n.back=-1,n.mode=12;break}if(64&A){e.msg=`invalid literal/length code`,n.mode=30;break}n.extra=15&A,n.mode=22;case 22:if(n.extra){for(R=n.extra;x>>=n.extra,x-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;A=(z=n.distcode[b&(1<>>16&255,j=65535&z,!((k=z>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>M)])>>>16&255,j=65535&z,!(M+(k=z>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=M,x-=M,n.back+=M}if(b>>>=k,x-=k,n.back+=k,64&A){e.msg=`invalid distance code`,n.mode=30;break}n.offset=j,n.extra=15&A,n.mode=24;case 24:if(n.extra){for(R=n.extra;x>>=n.extra,x-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg=`invalid distance too far back`,n.mode=30;break}n.mode=25;case 25:if(y===0)break e;if(E=C-y,n.offset>E){if((E=n.offset-E)>n.whave&&n.sane){e.msg=`invalid distance too far back`,n.mode=30;break}D=E>n.wnext?(E-=n.wnext,n.wsize-E):n.wnext-E,E>n.length&&(E=n.length),O=n.window}else O=m,D=_-n.offset,E=n.length;for(yv?(b=L[R+d[w]],N[P+d[w]]):(b=96,0),p=1<>k)+(m-=p)]=y<<24|b<<16|x|0,m!==0;);for(p=1<>=1;if(p===0?M=0:(M&=p-1,M+=p),w++,--F[C]==0){if(C===E)break;C=t[n+d[w]]}if(D>>7)]}function L(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function R(e,t,n){e.bi_valid>h-n?(e.bi_buf|=t<>h-e.bi_valid,e.bi_valid+=n-h):(e.bi_buf|=t<>>=1,n<<=1,0<--t;);return n>>>1}function V(e,t,n){var r,i,a=Array(m+1),o=0;for(r=1;r<=m;r++)a[r]=o=o+n[r-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];s!==0&&(e[2*i]=B(a[s]++,s))}}function H(e){var t;for(t=0;t>1;1<=n;n--)ee(e,a,n);for(i=c;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ee(e,a,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,a[2*i]=a[2*n]+a[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,a[2*n+1]=a[2*r+1]=i,e.heap[1]=i++,ee(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,i,a,o,s,c=t.dyn_tree,l=t.max_code,u=t.stat_desc.static_tree,d=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,g=t.stat_desc.max_length,_=0;for(a=0;a<=m;a++)e.bl_count[a]=0;for(c[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n>=7;r>>=1)if(1&n&&e.dyn_ltree[2*t]!==0)return i;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return a;for(t=32;t>>3,(s=e.static_len+3+7>>>3)<=o&&(o=s)):o=s=n+5,n+4<=o&&t!==-1?ae(e,t,n,r):e.strategy===4||s===o?(R(e,2+ +!!r,3),te(e,T,E)):(R(e,4+ +!!r,3),function(e,t,n,r){var i;for(R(e,t-257,5),R(e,n-1,5),R(e,r-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,t===0?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(O[n]+l+1)]++,e.dyn_dtree[2*I(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){R(e,2,3),z(e,_,T),function(e){e.bi_valid===16?(L(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,n){t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=``,this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,n){(function(e){(function(e,t){if(!e.setImmediate){var n,r,i,a,o=1,s={},c=!1,l=e.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(e);u=u&&u.setTimeout?u:e,n={}.toString.call(e.process)===`[object process]`?function(e){process.nextTick(function(){f(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage(``,`*`),e.onmessage=n,t}}()?(a=`setImmediate$`+Math.random()+`$`,e.addEventListener?e.addEventListener(`message`,p,!1):e.attachEvent(`onmessage`,p),function(t){e.postMessage(a+t,`*`)}):e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){f(e.data)},function(e){i.port2.postMessage(e)}):l&&`onreadystatechange`in l.createElement(`script`)?(r=l.documentElement,function(e){var t=l.createElement(`script`);t.onreadystatechange=function(){f(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):function(e){setTimeout(f,0,e)},u.setImmediate=function(e){typeof e!=`function`&&(e=Function(``+e));for(var t=Array(arguments.length-1),r=0;r`u`?e===void 0?this:e:self)}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{})},{}]},{},[10])(10)})}))(),1),{Text:vse}=Q,k9=e=>e?/^(https?:|data:|blob:)/i.test(e)?e:`${`http://ceshi.apiforeign.minzhong.cn`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`:``,yse=e=>e===`video`?(0,$.jsx)(t5,{}):e===`audio`?(0,$.jsx)(k2,{}):(0,$.jsx)(R6,{}),bse=e=>e===`video`?`视频`:e===`audio`?`音频`:`图片`,A9=e=>{let t=Number(e||0);return t>=1024*1024?`${(t/1024/1024).toFixed(1)} MB`:t>=1024?`${(t/1024).toFixed(1)} KB`:`${t} B`},xse=()=>{let[e,t]=(0,S.useState)(``),[n,r]=(0,S.useState)(``),[i,a]=(0,S.useState)(1),[o,s]=(0,S.useState)(10),[c,l]=(0,S.useState)(!1),[u,d]=(0,S.useState)([]),[f,p]=(0,S.useState)(0),[m,h]=(0,S.useState)(new Set),[g,_]=(0,S.useState)(null),[v,y]=(0,S.useState)(!1),b=(0,S.useMemo)(()=>u.flatMap(e=>e.items||[]),[u]),x=(0,S.useCallback)(async()=>{l(!0);try{let t=await d7({resourceType:e||void 0,keyword:n||void 0,page:i,pageSize:o,scene:`record`});d(t.groups||[]),p(t.totalDays||0),h(new Set)}catch(e){Z.error(e?.message||`加载历史上传素材失败`),d([]),p(0)}finally{l(!1)}},[n,i,o,e]);(0,S.useEffect)(()=>{x()},[x]);let C=e=>{h(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},w=()=>{let e=b.map(e=>e.id);h(t=>t.size===e.length?new Set:new Set(e))},T=async t=>{let r=(t.page||1)+1;try{let i=await f7(t.generatedDate,{resourceType:e||void 0,keyword:n||void 0,page:r,pageSize:10,scene:`record`});d(e=>e.map(e=>e.generatedDate===t.generatedDate?{...e,page:r,items:[...e.items,...i.items||[]]}:e))}catch(e){Z.error(e?.message||`加载更多失败`)}},E=e=>{mK.confirm({title:`确认删除历史上传素材`,content:`确定删除 ${e.fileName||e.id} 吗?删除后会释放上传容量,并在提交成功后清理真实文件。`,okText:`删除`,okButtonProps:{danger:!0},cancelText:`取消`,onOk:async()=>{try{await k5(e.resourceUrl),Z.success(`删除成功`),x()}catch(e){Z.error(e?.message||`删除失败`)}}})},D=()=>{if(m.size===0){Z.warning(`请先选择要删除的上传素材`);return}if(m.size>30){Z.warning(`一次最多删除 30 条上传素材`);return}let e=Array.from(m);mK.confirm({title:`确认批量删除历史上传素材`,content:`确定删除选中的 ${e.length} 条上传素材吗?删除后会释放上传容量,并在提交成功后清理真实文件。`,okText:`删除`,okButtonProps:{danger:!0},cancelText:`取消`,onOk:async()=>{try{let t=await Eae(e);Z.success(`删除成功,释放 ${A9(t?.releasedSizeBytes||0)}`),x()}catch(e){Z.error(e?.message||`批量删除失败`)}}})},O=e=>{let t=document.createElement(`a`);t.href=k9(e.resourceUrl),t.download=e.fileName||e.id,document.body.appendChild(t),t.click(),document.body.removeChild(t)},k=(e,t=`card`)=>{let n=k9(e.previewUrl||e.displayUrl||e.resourceUrl),r=t===`card`?{width:`100%`,height:130,objectFit:`cover`}:{width:`100%`,maxHeight:620,objectFit:`contain`};return e.resourceType===`image`?(0,$.jsx)(`img`,{src:n,alt:e.fileName||e.id,style:r}):e.resourceType===`video`?(0,$.jsx)(`video`,{src:n,controls:t===`preview`,muted:t===`card`,style:r}):(0,$.jsx)(N7,{src:n,size:t===`card`?`small`:`normal`})};return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,justifyContent:`space-between`,alignItems:`center`,gap:12,marginBottom:16,padding:`12px 16px`,borderRadius:12,background:`#fff`,border:`1px solid #f0f0f5`},children:[(0,$.jsxs)(sH,{size:8,wrap:!0,children:[(0,$.jsx)(Q.Text,{style:{color:`#94a3b8`,fontSize:14,marginRight:4},children:`媒体类型:`}),(0,$.jsx)(X,{type:e===``?`primary`:`default`,onClick:()=>{t(``),a(1)},style:{borderRadius:8,fontWeight:600,borderColor:e===``?`transparent`:`#e2e8f0`,color:e===``?`#fff`:`#64748b`},children:`全部`}),(0,$.jsx)(X,{type:e===`image`?`primary`:`default`,onClick:()=>{t(`image`),a(1)},style:{borderRadius:8,fontWeight:600,borderColor:e===`image`?`transparent`:`#e2e8f0`,color:e===`image`?`#fff`:`#64748b`},children:`图片`}),(0,$.jsx)(X,{type:e===`video`?`primary`:`default`,onClick:()=>{t(`video`),a(1)},style:{borderRadius:8,fontWeight:600,borderColor:e===`video`?`transparent`:`#e2e8f0`,color:e===`video`?`#fff`:`#64748b`},children:`视频`}),(0,$.jsx)(X,{type:e===`audio`?`primary`:`default`,onClick:()=>{t(`audio`),a(1)},style:{borderRadius:8,fontWeight:600,borderColor:e===`audio`?`transparent`:`#e2e8f0`,color:e===`audio`?`#fff`:`#64748b`},children:`音频`})]}),(0,$.jsxs)(sH,{size:8,wrap:!0,children:[(0,$.jsx)(IW.Search,{allowClear:!0,value:n,placeholder:`搜索文件名或URL`,onChange:e=>r(e.target.value),onSearch:()=>{a(1),x()},style:{width:240,borderRadius:8},enterButton:!0}),v?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(X,{onClick:w,style:{borderRadius:8,fontWeight:600,background:`#f8f9fc`,border:`1px solid #e2e8f0`,color:`#334155`},children:m.size&&m.size===b.length?`取消全选`:`全选`}),(0,$.jsxs)(X,{danger:!0,onClick:D,style:{borderRadius:8,fontWeight:600,background:`linear-gradient(135deg, #ef4444, #dc2626)`,border:`none`,color:`#fff`},children:[`批量删除 `,m.size>0&&`(${m.size})`]}),(0,$.jsx)(X,{onClick:()=>{y(!1),h(new Set)},style:{borderRadius:8,fontWeight:600,background:`#f8f9fc`,border:`1px solid #e2e8f0`,color:`#64748b`},children:`取消选择`})]}):(0,$.jsx)(X,{type:`primary`,onClick:()=>y(!0),style:{borderRadius:8,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`批量操作`})]})]}),(0,$.jsx)(UG,{spinning:c,children:u.length===0?(0,$.jsx)(XS,{description:`暂无可展示的历史上传素材`,style:{padding:`60px 0`}}):(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:28},children:u.map(e=>(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:12},children:[(0,$.jsx)(`div`,{style:{fontSize:18,fontWeight:700,color:`#1e293b`},children:e.generatedDate}),(0,$.jsxs)(vse,{type:`secondary`,children:[`共 `,e.total,` 个素材`]})]}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,justifyContent:`flex-start`},children:e.items.map(e=>{let t=m.has(e.id);return(0,$.jsxs)(`div`,{style:{width:`17%`,minWidth:240,margin:16,border:t?`2px solid #8b5cf6`:`1px solid #e2e8f0`,borderRadius:16,overflow:`hidden`,background:`#fff`,boxShadow:`0 10px 24px rgba(15,23,42,0.06)`},children:[(0,$.jsxs)(`div`,{style:{position:`relative`,background:`#f1f5f9`,cursor:v?`pointer`:`default`},onClick:()=>v&&C(e.id),children:[k(e),v&&(0,$.jsx)(VR,{checked:t,onChange:()=>C(e.id),style:{position:`absolute`,top:10,left:10,background:`#fff`,borderRadius:6,padding:4}}),(0,$.jsx)(XQ,{color:`purple`,icon:yse(e.resourceType),style:{position:`absolute`,top:10,right:10,margin:0},children:bse(e.resourceType)})]}),(0,$.jsxs)(`div`,{style:{padding:12,paddingTop:0},children:[(0,$.jsxs)(sH,{size:4,wrap:!0,style:{marginTop:8},children:[(0,$.jsx)(XQ,{style:{margin:0},children:e.moduleLabel}),(0,$.jsx)(XQ,{style:{margin:0},children:A9(e.fileSizeBytes)}),e.durationSeconds?(0,$.jsxs)(XQ,{style:{margin:0},children:[Number(e.durationSeconds).toFixed(1),`s`]}):null]}),(0,$.jsxs)(sH,{style:{marginTop:12},children:[(0,$.jsx)(X,{size:`small`,icon:(0,$.jsx)(mW,{}),onClick:()=>_(e),children:`预览`}),(0,$.jsx)(X,{size:`small`,icon:(0,$.jsx)(m0,{}),onClick:()=>O(e),children:`下载`}),(0,$.jsx)(X,{size:`small`,danger:!0,icon:(0,$.jsx)(u$,{}),onClick:()=>E(e),children:`删除`})]})]})]},e.id)})}),e.items.lengthT(e),children:`加载更多`})})]},e.generatedDate))})}),(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,marginTop:24},children:(0,$.jsx)(SG,{current:i,pageSize:o,total:f,showSizeChanger:!0,pageSizeOptions:[5,10],onChange:(e,t)=>{a(e),s(t)}})}),(0,$.jsx)(mK,{open:!!g,title:`预览`,footer:null,width:900,centered:!0,destroyOnHidden:!0,onCancel:()=>_(null),children:g?k(g,`preview`):null})]})},{Search:Sse}=IW,{Text:Cse}=Q,wse=e=>{let t=S.useRef(!1);(0,S.useEffect)(()=>{if(t.current)return;let n=()=>{t.current||(t.current=!0,e?.())};return document.readyState===`complete`?n():window.addEventListener(`load`,n),()=>{window.removeEventListener(`load`,n)}},[e])},Tse=()=>{let[e,t]=(0,S.useState)(!1);wse(()=>{t(!0)});let[n]=On(),[r,i]=(0,S.useState)(n.get(`filterType`)===`private_portrait`?`private_portrait`:n.get(`filterType`)===`upload_resource`?`upload_resource`:`project`),[a,o]=(0,S.useState)(`video`),[s,c]=(0,S.useState)([]),[l,u]=(0,S.useState)({page:1,pageSize:10}),[d,f]=(0,S.useState)(0),[p,m]=(0,S.useState)(!1),[h,g]=(0,S.useState)(new Set),[_,v]=(0,S.useState)(!1),[y,b]=(0,S.useState)(null),x=S.createRef(),[C,w]=(0,S.useState)(``),[T,E]=(0,S.useState)(``),[D,O]=(0,S.useState)(!1),[k,A]=(0,S.useState)(!1),[j,M]=(0,S.useState)([[]]),[N,P]=(0,S.useState)([``]),[F,I]=(0,S.useState)([]),[L,R]=(0,S.useState)(!1),[z,B]=(0,S.useState)(0),[V,H]=(0,S.useState)([void 0]),[U,W]=(0,S.useState)(new Map),[ee,te]=(0,S.useState)(``),[G,ne]=(0,S.useState)(new Map),re=(0,S.useRef)(new Map);(0,S.useEffect)(()=>()=>{re.current.forEach(e=>clearTimeout(e)),re.current.clear()},[]);let[ie,ae]=(0,S.useState)(1),[oe,K]=(0,S.useState)(10),[q,se]=(0,S.useState)([!1]),[ce,le]=(0,S.useState)(`new`),[ue,de]=(0,S.useState)([]),[fe,pe]=(0,S.useState)(!1),[me,he]=(0,S.useState)([]),[ge,_e]=(0,S.useState)({}),[ve,ye]=(0,S.useState)(`2`),[be,xe]=(0,S.useState)(``),[Se,Ce]=(0,S.useState)([]),[we,Te]=(0,S.useState)(!1),[Ee,De]=(0,S.useState)(!1),[Oe,ke]=(0,S.useState)([]),[Ae,je]=(0,S.useState)(0),[Me,Ne]=(0,S.useState)(1),[Pe,Fe]=(0,S.useState)(10),[Ie,Le]=(0,S.useState)(!1),[Re,ze]=(0,S.useState)(``),[Be,Ve]=(0,S.useState)(!1),[He,Ue]=(0,S.useState)(new Set),We=e=>{if(!e)return null;try{let t=new URL(e).searchParams.get(`exp`);return t?parseInt(t,10):null}catch{try{let t=e.indexOf(`?`);if(t!==-1){let n=e.substring(t+1),r=new URLSearchParams(n).get(`exp`);if(r)return parseInt(r,10)}return null}catch{return null}}},Ge=e=>{let t=We(e);return t?Math.floor(Date.now()/1e3)>t:!1},Ke=(e,t=!1)=>{let n=`http://ceshi.apiforeign.minzhong.cn`,r=e.startsWith(`/`)?e.slice(1):e,i=n.endsWith(`/`)?n.slice(0,-1):n;return t?`${i}/static/${r}&w=300&q=50`:`${i}/${r}`},qe=async e=>{if(b(e),v(!0),window.dispatchEvent(new Event(`previewOpen`)),e.videoUrl&&e.videoUrl.trim()&&!e.imagePx)try{let t=await ht(e.videoUrl);t&&b(e=>e&&{...e,imagePx:t})}catch{}},Je=()=>{x.current&&(x.current.pause(),x.current.currentTime=0),document.querySelectorAll(`video`).forEach(e=>{e.pause(),e.currentTime=0}),v(!1)},Ye=e=>e.generatedResourceId||e.id,Xe=e=>!!e.generatedResourceId,Ze=e=>{if(!e)return!0;let t=e.match(/^(\d+)x(\d+)$/);if(!t)return!0;let n=parseInt(t[1],10),r=parseInt(t[2],10),i=n/r;return n>=r?n>=480&&n<=2560&&r>=270&&r<=1440&&i>=1.775&&i<=1.784:n>=270&&n<=1440&&r>=480&&r<=2560&&i>=.555&&i<=.564},Qe=e=>{Ue(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},$e=()=>{let e=s.flatMap(e=>e.items.map(e=>Ye(e)));He.size===e.length?Ue(new Set):Ue(new Set(e))},et=async()=>{if(He.size===0){Z.warning(`请先选择要下载的媒体`);return}if(He.size>30){Z.warning(`最多只能单次下载30个文件`);return}let e=[];s.forEach(t=>{t.items.forEach(t=>{He.has(Ye(t))&&e.push(t)})});let t=new _se.default,n=`http://ceshi.apiforeign.minzhong.cn`,r=t.folder(`downloads`),i=!1,a=0;Z.loading({content:`下载中,请稍候...`,key:`downloadProgress`});for(let t of e){let e=`${n}${t.videoUrl||t.imageUrl}`,o=((t.videoUrl||t.imageUrl).split(`/`).pop()||`file_${Date.now()}`).split(`?`)[0];try{let t=await fetch(e);if(!t.ok)throw Error(`Network response was not ok`);let n=await t.blob();r?.file(o,n),a++}catch{i=!0;break}}if(i){Z.destroy(`downloadProgress`),Z.info(`由于跨域限制,将逐个下载文件`),e.forEach((e,t)=>{setTimeout(()=>{let t=`${n}${e.videoUrl||e.imageUrl}&download=1`,r=document.createElement(`a`);r.href=t,r.download=``,document.body.appendChild(r),r.click(),document.body.removeChild(r)},t*500)});return}let o=await t.generateAsync({type:`blob`}),c=document.createElement(`a`);c.href=URL.createObjectURL(o),c.download=`downloads_${Date.now()}.zip`,c.click(),URL.revokeObjectURL(c.href),Z.destroy(`downloadProgress`),Z.success(`下载完成,共 ${a} 个文件`),Ve(!1),Ue(new Set)},tt=async()=>{if(He.size===0){Z.warning(`请先选择要删除的媒体`);return}if(He.size>30){Z.warning(`最多只能单次删除30个文件`);return}let e=s.flatMap(e=>e.items.filter(e=>He.has(Ye(e)))),t=``;t=r===`shot_replicate`?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{marginBottom:8},children:`以下内容所连带的图片和视频都将被删除:`}),(0,$.jsx)(`ul`,{style:{margin:0,paddingLeft:20},children:e.map((e,t)=>(0,$.jsxs)(`li`,{style:{marginBottom:4,color:`#334155`},children:[e.shotReplicateProjectTitle,`— —`,e.shotSegmentLabel]},t))}),(0,$.jsx)(`div`,{style:{marginTop:12},children:`确定删除吗?`})]}):r===`hot_opening_replicate`?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{marginBottom:8},children:`爆款开头复刻中以下内容所连带的图片和视频都将被删除:`}),(0,$.jsx)(`ul`,{style:{margin:0,paddingLeft:20},children:e.map((e,t)=>(0,$.jsx)(`li`,{style:{marginBottom:4,color:`#334155`},children:e.moduleProjectTitle},t))}),(0,$.jsx)(`div`,{style:{marginTop:12},children:`确定删除吗?`})]}):`确定删除选中的 ${He.size} 条记录吗?`,mK.confirm({title:`确认删除`,content:t,okText:`确定删除`,cancelText:`取消`,okButtonProps:{danger:!0},onOk:async()=>{let e=``;r===`project`?e=`generation_record`:r===`creation`?e=`chat_task`:r===`hot_opening_replicate`?e=`hot_opening_replicate`:r===`shot_replicate`&&(e=`shot_replicate`);let t=[];s.forEach(e=>{e.items.forEach(e=>{He.has(Ye(e))&&t.push(e)})});let n=[];e===`generation_record`||e===`chat_task`?n=t.map(e=>e.id):e===`hot_opening_replicate`?n=t.map(e=>e.moduleProjectId):e===`shot_replicate`&&(n=t.map(e=>e.shotSegmentId));let i={history_source:e,ids:n};try{await l7(i),Z.success(`删除成功`),Ve(!1),Ue(new Set),u(e=>({...e,page:1})),gt()}catch{Z.error(`删除失败,请重试`)}}})},nt=async()=>{Te(!0);try{let e=await Y5({page:1,pageSize:100});Ce(e.data?.data||e.data||[])}catch{}finally{Te(!1)}},rt=()=>{if(He.size===0){Z.warning(`请先选择要推送的媒体`);return}M([[]]),P([``]),H([void 0]),ye(`2`),xe(``),nt(),A(!0)},it=()=>{if(!y)return;let e=Ye(y);Ue(new Set([e])),M([[]]),P([``]),H([void 0]),W(new Map),te(``),ye(`2`),xe(``),nt(),A(!0)},at=async(e,t)=>{R(!0);try{let n=await J5({page:e,page_size:t});I(n?.data||n||[]),B(n.pagination.total||0)}catch{I([]),B(0)}finally{R(!1)}},ot=async()=>{pe(!0);try{let[e,t]=await Promise.all([Cae(),s7()]);de(e?.data||[]);let n=t?.data||[],r={};n.forEach(e=>{r[e.openType]=e.typeName}),_e(r)}catch{de([]),_e({})}finally{pe(!1)}},st=async()=>{Le(!0);try{let e=await hae({status:Re||void 0,page:Me,pageSize:Pe});ke(e?.data||e||[]),je(e.pagination?.total||e.total||0)}catch{ke([]),je(0)}finally{Le(!1)}},ct=()=>{De(!0),Ne(1),ze(``),st()},lt=()=>{Ne(1),st()},ut=(e,t)=>{Ne(e),Fe(t),st()},dt=async()=>{if(He.size===0){Z.warning(`请先选择要推送的媒体`);return}let e=new Map;s.forEach(t=>{t.items.forEach(t=>{let n=Ye(t);e.set(n,t)})});let t=[];if(ce===`new`){let n=V.filter(e=>e!==void 0);if(n.length===0){Z.warning(`请先选择授权账户`);return}for(let r=0;re.accountId)||[];if(a.length===0){Z.warning(`第 ${r+1} 组授权账户未设置账户ID,已跳过`);continue}let o=new Map;for(let t of He){let n=e.get(t),r;n&&Xe(n)&&(r=`generated_resources`),o.has(r)||o.set(r,[]),o.get(r).push(t)}o.forEach((e,n)=>{t.push({advertiser_ids:a,resource_ids:e,oauth_id:i.value,source_model:n,is_pre_test:ve,pre_test_template:be})})}}else{if(me.length===0){Z.warning(`请先选择历史账户`);return}for(let n of me){let i=new Map;for(let t of He){let n=e.get(t),a;a=n&&Xe(n)?`generated_resources`:r===`project`?`generation_records`:`chat_generation_tasks`,i.has(a)||i.set(a,[]),i.get(a).push(t)}i.forEach((e,r)=>{t.push({advertiser_ids:[n.advertiserId],resource_ids:e,oauth_id:String(n.oauthId),source_model:r,is_pre_test:ve,pre_test_template:be})})}}O(!0);try{let e=await mae({tasks:t});e.errors?.length>0?Z.warning(e.message):e.code===0?Z.success(e.message):Z.error(e.message),Ve(!1),Ue(new Set),A(!1),M([[]]),P([``]),H([void 0]),he([]),W(new Map),te(``),ye(`2`),xe(``)}catch(e){Z.error(e.message||`批量推送失败`)}finally{O(!1)}},ft=async(e,t)=>{if(t.trim())try{let n=(await a7({filenames:[{source_id:e,file_name:t}]}))?.results?.find(t=>t.source_id===e)?.new_file_name||t;c(t=>t.map(t=>({...t,items:t.items.map(t=>Ye(t)===e?{...t,fileName:n}:t)}))),Z.success(`文件名更新成功`)}catch(e){Z.error(e.message||`文件名更新失败`)}},pt=async(e,t)=>{if(!(!t.trim()||e.length===0))try{let n=await a7({filenames:e.map(e=>({source_id:e,file_name:t}))}),r=new Map;n?.results?.forEach(e=>{e.success&&e.newFileName&&r.set(e.sourceId,e.newFileName)}),c(n=>{let i=new Set(e);return n.map(e=>({...e,items:e.items.map(e=>{let n=Ye(e);if(i.has(n)){let i=r.get(n)||t;return{...e,fileName:i}}return e})}))});let i=n?.successCount||0;Z.success(`已更新 ${i} 个文件名`)}catch(e){Z.error(e.message||`文件名更新失败`)}},mt=e=>{w(e)},ht=e=>new Promise(t=>{let n=document.createElement(`video`),r=`http://ceshi.apiforeign.minzhong.cn`,i=e.startsWith(`/`)?e.slice(1):e;n.src=`${r.endsWith(`/`)?r.slice(0,-1):r}/${i}`,n.crossOrigin=`anonymous`,n.onloadedmetadata=()=>{let e=n.videoWidth,r=n.videoHeight;n.remove(),t(`${e}x${r}`)},n.onerror=()=>{n.remove(),t(``)},n.onabort=()=>{n.remove(),t(``)},setTimeout(()=>{n.remove(),t(``)},5e3)}),gt=()=>{if(r===`private_portrait`||r===`upload_resource`){m(!1),c([]);return}m(!0);let e=``;r===`project`?e=`generation_record`:r===`hot_opening_replicate`?e=`hot_opening_replicate`:r===`shot_replicate`&&(e=`shot_replicate`);let t=`?gen_type=${a}&page=${l.page}&page_size=${l.pageSize}`;if(e&&(t=`?gen_type=${a}&history_source=${e}&page=${l.page}&page_size=${l.pageSize}`),T&&T.trim()&&(t+=`&keyword=${encodeURIComponent(T.trim())}`),C){let t=`${C}?gen_type=${a}&page=${l.page}&page_size=${l.pageSize}`;e&&(t=`${C}?gen_type=${a}&history_source=${e}&page=${l.page}&page_size=${l.pageSize}`),T&&T.trim()&&(t+=`&keyword=${encodeURIComponent(T.trim())}`),V5(t).then(e=>{let t=Array.isArray(e)?e:e?.items||[],n=[{generatedDate:e.generatedDate,items:t,total:e.total,page:e.page}];n&&n[0].items.length>0?c(n):c([])}).catch(e=>{}).finally(()=>{m(!1)})}else Uie(t).then(e=>{let t=Array.isArray(e)?e:e?.groups||[];t.forEach(e=>{e.page=1}),l.page===1?c(t):c(e=>[...e,...t]),f(e?.totalDays||0)}).catch(e=>{l.page===1&&c([])}).finally(()=>{m(!1)})};(0,S.useEffect)(()=>{gt()},[r,a,l.page,C]);let _t=()=>{p||u(e=>({...e,page:e.page+1}))},vt=async(e,t,n)=>{if(h.has(t))return;g(e=>new Set([...e,t]));let i=n+1,o=``;r===`project`?o=`generation_record`:r===`hot_opening_replicate`?o=`hot_opening_replicate`:r===`shot_replicate`&&(o=`shot_replicate`);let s=`${e}?gen_type=${a}&page=${i}&page_size=${l.pageSize}`;o&&(s=`${e}?gen_type=${a}&history_source=${o}&page=${i}&page_size=${l.pageSize}`),T&&T.trim()&&(s+=`&keyword=${encodeURIComponent(T.trim())}`);try{let t=(await V5(s)).items||[];t&&t.length>0&&c(n=>n.map(n=>n.generatedDate===e?{...n,items:[...n.items,...t],page:i}:n))}catch{}finally{g(e=>{let n=new Set(e);return n.delete(t),n})}};return(0,S.useEffect)(()=>{u(e=>({...e,page:1})),E(``)},[r,a]),(0,$.jsxs)(`div`,{className:`content_box`,children:[(0,$.jsx)(TL,{activeKey:r,onChange:e=>{i(e),Ve(!1),Ue(new Set)},items:[{key:`project`,label:(0,$.jsxs)(`span`,{children:[(0,$.jsx)(KX,{}),` 项目记录`]})},{key:`creation`,label:(0,$.jsxs)(`span`,{children:[(0,$.jsx)(fH,{}),` 创作记录`]})},{key:`hot_opening_replicate`,label:(0,$.jsxs)(`span`,{children:[(0,$.jsx)(R8,{}),` 爆款复刻`]})},{key:`shot_replicate`,label:(0,$.jsxs)(`span`,{children:[(0,$.jsx)(q6,{}),` 拆镜复刻`]})},{key:`private_portrait`,label:(0,$.jsxs)(`span`,{children:[(0,$.jsx)($8,{}),` 私域素材库`]})},{key:`upload_resource`,label:(0,$.jsxs)(`span`,{children:[(0,$.jsx)(X8,{}),` 历史素材`]})}],size:`middle`,style:{marginBottom:12}}),r===`private_portrait`?(0,$.jsx)(Joe,{}):r===`upload_resource`?(0,$.jsx)(xse,{}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,justifyContent:`space-between`,alignItems:`center`,gap:12,marginBottom:16,padding:`12px 16px`,borderRadius:12,background:`#fff`,border:`1px solid #f0f0f5`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(Q.Text,{style:{color:`#94a3b8`,fontSize:14,marginRight:4},children:`媒体类型:`}),(0,$.jsx)(X,{type:a===`video`?`primary`:`default`,onClick:()=>{o(`video`),Ve(!1),Ue(new Set)},style:{borderRadius:8,fontWeight:600,borderColor:a===`video`?`transparent`:`#e2e8f0`,color:a===`video`?`#fff`:`#64748b`},icon:(0,$.jsx)(t5,{}),children:`视频`}),(0,$.jsx)(X,{type:a===`image`?`primary`:`default`,onClick:()=>{o(`image`),Ve(!1),Ue(new Set)},style:{borderRadius:8,fontWeight:600,borderColor:a===`image`?`transparent`:`#e2e8f0`,color:a===`image`?`#fff`:`#64748b`},icon:(0,$.jsx)(R6,{}),children:`图片`})]}),(0,$.jsxs)(sH,{size:8,wrap:!0,children:[(0,$.jsx)(hV,{picker:`date`,value:C?(0,bE.default)(C):void 0,onChange:(e,t)=>mt(t||``),format:`YYYY-MM-DD`,style:{width:160,borderRadius:8,border:`1px solid #e2e8f0`},placeholder:`选择日期`,allowClear:!0}),(0,$.jsx)(IW.Search,{placeholder:`搜索提示词`,allowClear:!0,value:T,onChange:e=>{let t=e.target.value;E(t),t||(u(e=>({...e,page:1})),gt())},onSearch:()=>{u(e=>({...e,page:1})),gt()},style:{width:240,borderRadius:8},enterButton:!0}),(0,$.jsx)(X,{icon:(0,$.jsx)(cV,{}),onClick:ct,style:{borderRadius:8,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,color:`#fff`},children:`推送任务历史`}),Be?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(X,{onClick:He.size===s.reduce((e,t)=>e+t.items.length,0)&&s.length>0?()=>{Ue(new Set)}:$e,style:{borderRadius:8,fontWeight:600,background:`#f8f9fc`,border:`1px solid #e2e8f0`,color:`#334155`},children:He.size===s.reduce((e,t)=>e+t.items.length,0)&&s.length>0?`取消全选`:`全选`}),(0,$.jsx)(X,{onClick:()=>{Ve(!1),Ue(new Set)},style:{borderRadius:8,fontWeight:600,background:`#f8f9fc`,border:`1px solid #e2e8f0`,color:`#64748b`},children:`取消选择`}),(0,$.jsxs)(X,{danger:!0,onClick:tt,style:{borderRadius:8,fontWeight:600,background:`linear-gradient(135deg, #ef4444, #dc2626)`,border:`none`,color:`#fff`},children:[`删除 `,He.size>0&&`(${He.size})`]}),(0,$.jsxs)(X,{onClick:et,style:{borderRadius:8,fontWeight:600,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`,color:`#fff`},children:[`下载 `,He.size>0&&`(${He.size})`]}),(0,$.jsx)(X,{type:`primary`,onClick:rt,loading:D,disabled:D||He.size===0,style:{borderRadius:8,fontWeight:600,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`,color:`#fff`},children:D?`推送中...`:`推送至账户 ${He.size>0?`(${He.size})`:``}`})]}):(0,$.jsx)(X,{type:`primary`,onClick:()=>Ve(!0),style:{borderRadius:8,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`批量操作`})]})]}),p?(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,minHeight:`400px`},children:(0,$.jsx)(UG,{indicator:(0,$.jsx)(Xm,{style:{fontSize:24,color:`#64748b`},spin:!0}),description:`加载中...`,size:`large`})}):s.length===0?(0,$.jsx)(XS,{image:XS.PRESENTED_IMAGE_SIMPLE,description:`暂无生成记录`,style:{padding:`60px 0`}}):(0,$.jsxs)(`div`,{style:{padding:`0 4px`},children:[s.map((e,t)=>(0,$.jsxs)(`div`,{style:{marginBottom:32},children:[(0,$.jsx)(`div`,{style:{fontSize:14,fontWeight:600,color:`#64748b`,marginBottom:12,paddingLeft:8},children:e.generatedDate}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:8},children:e.items.map(e=>{let t=a===`video`&&e.videoCoverUrl?Ke(e.videoCoverUrl,!0):Ke(a===`video`?e.videoUrl:e.imageUrl,!0),n=a===`video`&&e.videoCoverUrl||a===`image`,r=He.has(Ye(e));return(0,$.jsxs)(`div`,{className:`media-card`,style:{width:160,height:120,position:`relative`,borderRadius:4,cursor:`pointer`,overflow:`hidden`,boxShadow:`0 2px 8px rgba(0,0,0,0.1)`,transition:`transform 0.2s, box-shadow 0.2s`},onClick:()=>Be?Qe(Ye(e)):qe(e),onMouseEnter:e=>{Be||(e.currentTarget.style.transform=`scale(1.05)`,e.currentTarget.style.boxShadow=`0 4px 16px rgba(0,0,0,0.2)`)},onMouseLeave:e=>{Be||(e.currentTarget.style.transform=`scale(1)`,e.currentTarget.style.boxShadow=`0 2px 8px rgba(0,0,0,0.1)`)},children:[n?(0,$.jsxs)(`div`,{style:{width:`100%`,height:`100%`,position:`relative`},children:[(0,$.jsx)(`img`,{src:t,alt:`预览`,loading:`lazy`,style:{width:`100%`,height:`100%`,objectFit:`cover`,opacity:+(G.get(Ye(e))===`loaded`),transition:`opacity 0.3s`},onLoad:()=>{ne(t=>{let n=new Map(t);return n.set(Ye(e),`loaded`),n})},onError:()=>{ne(t=>{let n=new Map(t);return n.set(Ye(e),`error`),n})}}),G.get(Ye(e))!==`loaded`&&(0,$.jsx)(`div`,{style:{position:`absolute`,top:0,left:0,width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%)`},children:(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:8,backgroundColor:`#cbd5e1`,display:`flex`,alignItems:`center`,justifyContent:`center`,animation:G.get(Ye(e))===`loading`?`pulse 1.5s infinite`:`none`},children:e.mediaType===`video`?(0,$.jsx)(t5,{style:{color:`#64748b`,fontSize:16}}):(0,$.jsx)(R6,{style:{color:`#64748b`,fontSize:16}})})})]}):(0,$.jsxs)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,backgroundColor:`#1e293b`},children:[(0,$.jsx)(t5,{style:{color:`#64748b`,fontSize:24}}),(0,$.jsx)(Cse,{style:{fontSize:12,color:`#94a3b8`,marginTop:4},children:`暂无封面`})]}),Be&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:6,left:6,width:22,height:22,borderRadius:`50%`,backgroundColor:r?`#6366f1`:`rgba(255,255,255,0.92)`,border:r?`2px solid #6366f1`:`2px solid #cbd5e1`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,zIndex:10,boxShadow:r?`0 2px 8px rgba(99,102,241,0.4)`:`0 1px 3px rgba(0,0,0,0.1)`,transition:`all 0.15s ease`},onClick:t=>{t.stopPropagation(),Qe(Ye(e))},children:r&&(0,$.jsx)(`svg`,{width:12,height:12,viewBox:`0 0 12 12`,fill:`none`,children:(0,$.jsx)(`path`,{d:`M10 3L4.5 8.5L2 6`,stroke:`white`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`})})}),r&&a===`video`&&e.imagePx&&!Ze(e.imagePx)&&(0,$.jsx)(`div`,{style:{position:`absolute`,top:36,left:8,right:8,padding:`4px 8px`,backgroundColor:`rgba(239, 68, 68, 0.9)`,color:`#fff`,fontSize:12,borderRadius:4,zIndex:10},children:`视频实际尺寸可能不符合平台推送要求`})]}),!Be&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{position:`absolute`,bottom:0,left:0,right:0,background:`linear-gradient(transparent, rgba(0,0,0,0.5))`,padding:`8px`,color:`#fff`,fontSize:12,opacity:0,transition:`opacity 0.2s`},onMouseEnter:e=>{e.currentTarget.style.opacity=`1`},onMouseLeave:e=>{e.currentTarget.style.opacity=`0`},children:`点击预览`}),(0,$.jsx)(`div`,{className:`media-download-btn`,children:(0,$.jsx)(gw,{title:`下载`,children:(0,$.jsx)(`div`,{style:{width:28,height:28,borderRadius:`50%`,background:`rgba(0,0,0,0.5)`,backdropFilter:`blur(4px)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,transition:`background 0.15s`},onClick:t=>{t.stopPropagation();let n=`http://ceshi.apiforeign.minzhong.cn${e.videoUrl||e.imageUrl}&download=1`,r=document.createElement(`a`);r.href=n,r.download=``,document.body.appendChild(r),r.click(),document.body.removeChild(r)},children:(0,$.jsx)(m0,{style:{color:`#fff`,fontSize:14}})})})})]}),Be&&r&&(0,$.jsx)(`div`,{style:{position:`absolute`,top:0,left:0,right:0,bottom:0,border:`3px solid #6366f1`,borderRadius:4,pointerEvents:`none`,zIndex:5,boxShadow:`inset 0 0 0 1px rgba(99,102,241,0.2)`}})]},Ye(e))})}),e.total&&e.total>e.items.length&&(0,$.jsx)(`div`,{style:{padding:`12px 0`,textAlign:`left`},children:(0,$.jsx)(X,{onClick:()=>vt(e.generatedDate,e.items,e.page),loading:h.has(e.generatedDate),disabled:h.has(e.generatedDate),size:`small`,style:{borderRadius:6,background:`transparent`,border:`1px dashed #cbd5e1`,color:`#64748b`,fontSize:12},children:h.has(e.date)?`加载中...`:`查看全部 (${e.total})`})})]},t)),s.length>0&&d>s.length&&(0,$.jsx)(`div`,{style:{textAlign:`center`,padding:`20px 0`},children:(0,$.jsx)(X,{onClick:_t,loading:p,disabled:p,style:{borderRadius:8,background:`#f8f9fc`,border:`1px solid #e2e8f0`,color:`#64748b`,fontWeight:500},children:p?`加载中...`:`加载更多`})})]})]}),(0,$.jsxs)(mK,{title:`推送任务历史`,open:Ee,onCancel:()=>De(!1),footer:null,width:800,style:{borderRadius:8},mask:{closable:!1},children:[(0,$.jsxs)(`div`,{style:{marginBottom:16,display:`flex`,gap:4},children:[(0,$.jsx)(EC,{value:Re,onChange:e=>ze(e),placeholder:`选择状态`,style:{width:200,marginRight:12},options:[{value:`1`,label:`待推送`},{value:`2`,label:`推送中`},{value:`3`,label:`推送成功`},{value:`4`,label:`推送失败`}],allowClear:!0}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:4},children:[(0,$.jsx)(X,{type:`primary`,onClick:lt,style:{borderRadius:8},children:`查询`}),(0,$.jsx)(X,{icon:(0,$.jsx)(wq,{}),onClick:lt,style:{borderRadius:8},children:`刷新`})]})]}),(0,$.jsx)(LQ,{dataSource:Oe,columns:[{title:`素材名称`,dataIndex:`fileName`,key:`fileName`,width:200},{title:`账户ID`,dataIndex:`advertiserId`,key:`advertiserId`,width:180},{title:`状态`,dataIndex:`status`,key:`status`,width:100,render:e=>(0,$.jsx)(XQ,{color:{1:`#f59e0b`,2:`#6366f1`,3:`#10b981`,4:`#ef4444`}[e]||`#64748b`,style:{borderRadius:4},children:{1:`待推送`,2:`推送中`,3:`推送成功`,4:`推送失败`}[e]||e})},{title:`备注`,dataIndex:`note`,key:`note`,width:160,ellipsis:!0,render:e=>(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:e||`-`})},{title:`创建时间`,dataIndex:`createdAt`,key:`createdAt`,width:180,render:e=>M9(e)},{title:`更新时间`,dataIndex:`updatedAt`,key:`updatedAt`,width:180,render:e=>M9(e)}],loading:Ie,scroll:{x:`max-content`},pagination:{current:Me,pageSize:Pe,total:Ae,showSizeChanger:!0,showTotal:e=>`共 ${e} 条记录`,onChange:ut},rowKey:(e,t)=>e.task_id||e.resource_id||t,size:`small`})]}),_&&y&&(0,$.jsx)(mK,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:y.title||`预览`})]}),open:_,onCancel:Je,width:1200,footer:(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:12,padding:`16px 24px`,background:`#fff`,borderTop:`1px solid #f1f5f9`},children:[(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(m0,{}),onClick:()=>{x.current&&x.current.pause();let e=`http://ceshi.apiforeign.minzhong.cn${y.videoUrl||y.imageUrl}&download=1`,t=document.createElement(`a`);t.href=e,t.download=``,document.body.appendChild(t),t.click(),document.body.removeChild(t)},style:{borderRadius:8,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,boxShadow:`0 4px 16px rgba(99, 102, 241, 0.35)`,fontWeight:600,padding:`8px 24px`},disabled:Ge(y.videoUrl||y.imageUrl),children:Ge(y.videoUrl||y.imageUrl)?`资源已过期`:`下载`}),(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(u$,{}),onClick:()=>{let e=``,t=``;if(r===`shot_replicate`?(e=y.shotSegmentId,t=(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{marginBottom:8},children:`以下内容所连带的图片和视频都将被删除:`}),(0,$.jsx)(`ul`,{style:{margin:0,paddingLeft:20},children:(0,$.jsxs)(`li`,{style:{marginBottom:4,color:`#334155`},children:[y.shotReplicateProjectTitle,`— —`,y.shotSegmentLabel]})}),(0,$.jsx)(`div`,{style:{marginTop:12},children:`确定删除吗?`})]})):r===`hot_opening_replicate`?(e=y.moduleProjectId,t=(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{marginBottom:8},children:`爆款开头复刻中以下内容所连带的图片和视频都将被删除:`}),(0,$.jsx)(`ul`,{style:{margin:0,paddingLeft:20},children:(0,$.jsx)(`li`,{style:{marginBottom:4,color:`#334155`},children:y.moduleProjectTitle})}),(0,$.jsx)(`div`,{style:{marginTop:12},children:`确定删除吗?`})]})):(e=y.id,t=`确定删除该记录吗?`),!e){Z.warning(`无法获取删除ID`);return}mK.confirm({title:`确认删除`,content:t,okText:`确定删除`,cancelText:`取消`,okButtonProps:{danger:!0},onOk:async()=>{let t=``;r===`project`?t=`generation_record`:r===`creation`?t=`chat_task`:r===`hot_opening_replicate`?t=`hot_opening_replicate`:r===`shot_replicate`&&(t=`shot_replicate`);let n={history_source:t,ids:[e]};try{await l7(n),Z.success(`删除成功`),Je(),u(e=>({...e,page:1})),gt()}catch{Z.error(`删除失败,请重试`)}}})},style:{borderRadius:8,background:`linear-gradient(135deg, #bf0b0a 0%, #ff8165 100%)`,fontWeight:600,padding:`8px 24px`},disabled:Ge(y.videoUrl||y.imageUrl),children:`删除`}),(0,$.jsx)(X,{onClick:it,style:{borderRadius:8,background:`#f8f9fc`,border:`1px solid #e2e8f0`,color:`#64748b`,fontWeight:600,padding:`8px 24px`},disabled:Ge(y.videoUrl||y.imageUrl),children:`推送媒体后台`})]}),style:{borderRadius:16,overflow:`hidden`},styles:{body:{height:500,display:`flex`,flexDirection:`column`,padding:0},header:{background:`#fff`,borderBottom:`1px solid #f1f5f9`,padding:`16px 24px`},mask:{backgroundColor:`rgba(0, 0, 0, 0.5)`}},children:(0,$.jsxs)(`div`,{style:{width:`100%`,display:`flex`,height:`100%`,background:`#f8fafc`},children:[(0,$.jsx)(`div`,{style:{width:`70%`,height:`100%`,display:`flex`,justifyContent:`center`,alignItems:`center`,padding:20},children:Ge(y.videoUrl||y.imageUrl)?(0,$.jsxs)(`div`,{style:{textAlign:`center`,padding:`40px`,backgroundColor:`#fff`,borderRadius:12},children:[(0,$.jsx)(`div`,{style:{fontSize:48,marginBottom:16},children:`⚠️`}),(0,$.jsx)(`p`,{style:{fontSize:15,color:`#ef4444`,fontWeight:500,marginBottom:8},children:`资源已过期`}),(0,$.jsx)(`p`,{style:{fontSize:13,color:`#94a3b8`},children:`请刷新页面重新加载`})]}):a===`video`?(0,$.jsx)(`video`,{ref:x,src:`http://ceshi.apiforeign.minzhong.cn${y.videoUrl}`,controls:!0,autoPlay:!0,style:{maxWidth:`100%`,maxHeight:`100%`,borderRadius:12,objectFit:`contain`}}):(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn/static${y.imageUrl}&w=300&q=50`,alt:`预览`,style:{maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`,borderRadius:12}})}),(0,$.jsxs)(`div`,{style:{width:`30%`,height:`100%`,overflowY:`auto`,scrollbarWidth:`none`,backgroundColor:`#fff`,padding:24,borderLeft:`1px solid #f1f5f9`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:20},children:[(0,$.jsx)(`div`,{style:{width:2,height:18,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:1}}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:15,color:`#1e293b`,fontWeight:600},children:`文件信息`})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:14},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`类型`}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:600},children:a===`video`?`视频`:`图片`})]}),r===`hot_opening_replicate`&&(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,gap:4},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`类属`}),(0,$.jsxs)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:500,wordBreak:`break-all`,lineHeight:`1.5`},children:[`爆款复刻——`,y.moduleProjectTitle]})]}),r===`shot_replicate`&&(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,gap:4},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`类属`}),(0,$.jsxs)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:500,wordBreak:`break-all`,lineHeight:`1.5`},children:[y.shotReplicateProjectTitle,`— —`,y.shotSegmentLabel]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`请求`}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:500,wordBreak:`break-all`,lineHeight:`1.5`},children:y.originalPrompt})]}),a===`image`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`比例`}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:600},children:y.imageProportion})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`分辨率`}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:600},children:y.imageSize})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`尺寸`}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:600},children:y.imagePx})]})]}),a===`video`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`比例`}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:600},children:y.aspectRatio})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`分辨率`}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:600},children:y.resolution})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`时长`}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:600},children:`${y.duration}秒`||`-`})]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`创建时间`}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:600},children:M9(y.createdAt||y.generatedDate)})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`生成引擎`}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:600},children:y.engine||y.engineName||`-`})]})]}),(0,$.jsx)(`div`,{style:{borderTop:`1px solid #f1f5f9`,margin:`20px 0`}}),y.mediaReferences&&y.mediaReferences.length>0&&![`hot_opening_replicate`,`shot_replicate`].includes(r)&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:16},children:[(0,$.jsx)(`div`,{style:{width:2,height:18,background:`linear-gradient(180deg, #3b82f6 0%, #60a5fa 100%)`,borderRadius:1}}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:15,color:`#1e293b`,fontWeight:600},children:`依靠附件`})]}),y.mediaReferences.map((e,t)=>(0,$.jsxs)(`div`,{onClick:()=>{x.current&&x.current.pause();let t=`http://ceshi.apiforeign.minzhong.cn${e.url}`;window.open(t,`_blank`)},style:{display:`flex`,alignItems:`center`,gap:10,padding:`10px 12px`,borderRadius:8,cursor:`pointer`,backgroundColor:`#f8fafc`,marginBottom:8,transition:`all 0.25s ease`,border:`1px solid transparent`},onMouseEnter:e=>{let t=e.currentTarget;t.style.backgroundColor=`#e0f2fe`,t.style.borderColor=`#bae6fd`},onMouseLeave:e=>{let t=e.currentTarget;t.style.backgroundColor=`#f8fafc`,t.style.borderColor=`transparent`},children:[e.type===`image`?(0,$.jsx)(R6,{style:{color:`#3b82f6`,fontSize:16}}):(0,$.jsx)(t5,{style:{color:`#f59e0b`,fontSize:16}}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:500},children:e.name||`媒体${t+1}`})]},e.url))]})]})]})}),(0,$.jsx)(mK,{title:He.size===1?`推送配置`:`批量推送配置`,open:k,onCancel:()=>{A(!1),M([[]]),P([``]),H([void 0]),W(new Map),te(``)},footer:null,width:900,mask:{closable:!1},children:(0,$.jsxs)(`div`,{style:{padding:`16px 0`},children:[(0,$.jsxs)(Q.Text,{strong:!0,style:{fontSize:14,color:`#475569`,marginBottom:8,display:`block`},children:[`选中素材 (`,He.size,`个)`]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8,marginBottom:12,alignItems:`center`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#64748b`},children:`统一修改名称:`}),(0,$.jsx)(IW,{value:ee,onChange:e=>te(e.target.value),placeholder:`输入名称后点击应用`,style:{flex:1,borderRadius:8},size:`small`}),(0,$.jsx)(X,{type:`primary`,size:`small`,onClick:()=>{ee.trim()&&He.size>0&&pt(Array.from(He),ee)},disabled:!ee.trim()||He.size===0,style:{borderRadius:8},children:`应用`})]}),(0,$.jsx)(`div`,{style:{maxHeight:300,overflow:`auto`,border:`1px solid #f0f0f0`,borderRadius:8,padding:12},children:(()=>{let e=new Map;return s.forEach(t=>{t.items.forEach(t=>{let n=Ye(t);e.set(n,t)})}),Array.from(He).map(t=>{let n=e.get(t);return(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,padding:`8px 0`,borderBottom:`1px solid #f5f5f5`},children:[(0,$.jsx)(`div`,{style:{width:60,height:40,borderRadius:4,backgroundColor:`#f5f5f5`,display:`flex`,alignItems:`center`,justifyContent:`center`,overflow:`hidden`,flexShrink:0},children:(()=>{let e=a===`video`?n?.videoCoverUrl:n?.imageUrl;if(!e)return(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#94a3b8`},children:`预览`});let t=`http://ceshi.apiforeign.minzhong.cn`,r=e.startsWith(`/`)?e.slice(1):e;return(0,$.jsx)(`img`,{src:`${t.endsWith(`/`)?t.slice(0,-1):t}/static/${r}&w=300&q=50`,alt:``,style:{width:`100%`,height:`100%`,objectFit:`cover`}})})()}),(0,$.jsx)(`div`,{style:{flex:1,minWidth:0},children:(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#1e293b`},children:n?.fileName||`素材 ${n.id}`})}),(0,$.jsx)(IW,{value:U.has(t)?U.get(t):n?.fileName||``,onChange:e=>{let n=e.target.value,r=new Map(U);r.set(t,n),W(r)},onBlur:()=>{let e=U.get(t)||n?.fileName||``;e.trim()&&ft(t,e)},onKeyDown:e=>{if(e.key===`Enter`){let e=U.get(t)||n?.fileName||``;e.trim()&&ft(t,e)}},placeholder:`输入新名称`,style:{width:200,borderRadius:4},size:`small`})]},t)})})()})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:16,marginBottom:16},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(Q.Text,{style:{fontSize:14,color:`#475569`},children:`是否开启前测:`}),(0,$.jsx)(EC,{value:ve,onChange:e=>{ye(e),e===`1`?Z5().then(e=>{xe(e?.data?.id||``)}).catch(()=>{}):xe(``)},style:{width:120},options:[{value:`1`,label:`是`},{value:`2`,label:`否`}]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(Q.Text,{style:{fontSize:14,color:`#475569`},children:`前测模板:`}),(0,$.jsx)(EC,{value:be,onChange:e=>xe(e),style:{width:200},disabled:ve!==`1`,loading:we,placeholder:ve===`1`?`选择前测模板`:`请先开启前测`,options:Se.map(e=>({value:e.id,label:e.name}))})]})]}),(0,$.jsx)(TL,{size:`small`,activeKey:ce,onChange:e=>{le(e),e===`history`&&ot()},items:[{key:`new`,label:`新增账户`},{key:`history`,label:`历史账户`}]}),ce===`new`&&(0,$.jsxs)(`div`,{children:[V.map((e,t)=>(0,$.jsxs)(`div`,{style:{marginBottom:16,padding:12,border:`1px solid #e2e8f0`,borderRadius:8},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:8},children:[(0,$.jsxs)(Q.Text,{strong:!0,style:{fontSize:14,color:`#475569`},children:[`授权账户 `,t+1]}),V.length>1&&(0,$.jsx)(X,{type:`text`,danger:!0,onClick:()=>{let e=[...V],n=[...N],r=[...j],i=[...q];e.splice(t,1),n.splice(t,1),r.splice(t,1),i.splice(t,1),H(e),P(n),M(r),se(i)},children:`删除`})]}),(0,$.jsx)(EC,{value:e,onChange:e=>{let n=[...V];n[t]=e,H(n)},placeholder:`点击选择授权账户`,style:{width:`100%`,marginBottom:12,borderRadius:8},popupRender:()=>(0,$.jsx)(`div`,{style:{padding:8,width:800,maxHeight:500,overflow:`auto`},children:(0,$.jsx)(LQ,{dataSource:F,columns:[{title:`授权账户ID`,dataIndex:`accountId`,key:`accountId`,width:120},{title:`授权账户名称`,dataIndex:`accountName`,key:`accountName`,width:120},{title:`授权账户角色`,dataIndex:`accountRole`,key:`accountRole`,width:160,render:e=>({ADVERTISER:`客户`,CUSTOMER_ADMIN:`普通版工作台-管理员`,CUSTOMER_OPERATOR:`普通版工作台-协作者`,AGENT:`代理商`,CHILD_AGENT:`二级代理商`,PLATFORM_ROLE_STAR:`星图账户`,PLATFORM_ROLE_SHOP_ACCOUNT:`抖音店铺账户`,PLATFORM_ROLE_QIANCHUAN_AGENT:`千川代理商`,PLATFORM_ROLE_STAR_AGENT:`星图代理商`,PLATFORM_ROLE_AWEME:`抖音号`,PLATFORM_ROLE_STAR_MCN:`星图MCN机构`,PLATFORM_ROLE_STAR_ISV:`星图服务商`,AGENT_SYSTEM_ACCOUNT:`代理商系统账户`,PLATFORM_ROLE_LOCAL_AGENT:`本地推代理商`,PLATFORM_ROLE_YUNTU_BRAND_ISV_ADMIN:`云图品牌服务商管理员`,PLATFORM_ROLE_LIFE:`抖音来客账户`,PLATFORM_ROLE_ENTERPRISE_BP_ADMIN:`升级版工作台管理员`,PLATFORM_ROLE_ENTERPRISE_BP_OPERATOR:`升级版工作台协作者`})[e]||e},{title:`授权账户用户名`,dataIndex:`accountUsername`,key:`accountUsername`,width:120,render:e=>(0,$.jsx)(`span`,{style:{color:e?`#1e293b`:`#94a3b8`},children:e||`-`})},{title:`授权用户ID`,dataIndex:`accountUserid`,key:`accountUserid`,width:120}],loading:L,pagination:{current:ie,pageSize:oe,total:z,showSizeChanger:!0,showTotal:e=>`共 ${e} 条记录`,onChange:(e,t)=>{ae(e),K(t),at(e,t)}},rowKey:`id`,size:`small`,scroll:{x:`max-content`},onRow:n=>({onClick:()=>{let e=String(n.id),r=[...V];r[t]={value:e,label:String(n.accountId)+`-`+(n.accountName||`-`)},H(r);let i=[...q];i[t]=!1,se(i)},style:{cursor:`pointer`,backgroundColor:e?.value===String(n.id)?`#e6f7ff`:void 0}})})}),open:q[t],onOpenChange:e=>{let n=[...q];n[t]=e,se(n),e&&at(1,oe)},labelInValue:!0,fieldNames:{label:`accountUserid`,value:`id`}}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:14,color:`#475569`,marginBottom:8,display:`block`},children:`粘贴账户ID(每行一个或用逗号分隔)`}),(0,$.jsx)(IW.TextArea,{value:N[t],onChange:e=>{let n=e.target.value,r=[...N];r[t]=n,P(r);let i=n.split(/[\n,]/).map(e=>e.trim()).filter(e=>e.length>0),a=[...new Set(i)].map(e=>({accountId:e})),o=new Set,s=a.filter(e=>o.has(e.accountId)?!1:(o.add(e.accountId),!0)),c=[...j];c[t]=s,M(c)},placeholder:`粘贴账户ID,每行一个或用逗号分隔,例如: - 10001,10002,10003 + `})]}):e===`failed`?(0,$.jsx)(`span`,{style:{fontSize:11,color:`#ef4444`},children:`失败`}):e===`completed`&&t.finalVideoUrl?(0,$.jsx)(`span`,{style:{fontSize:11,color:`#10b981`},children:`任务完成`}):null})()]})]})]},t.id))}),(0,$.jsx)(`div`,{style:{paddingTop:20,paddingBottom:20,display:`flex`,justifyContent:`center`},children:(0,$.jsx)(SG,{current:p,pageSize:h,total:_,onChange:re,showSizeChanger:!1,showQuickJumper:!1,showTotal:e=>`共 ${e} 条`,itemRender:(e,t,n)=>t===`prev`?(0,$.jsx)(`button`,{style:{minWidth:32,height:32,border:`1px solid #e5e7eb`,borderRadius:6,background:p===1?`#f9fafb`:`#fff`,cursor:p===1?`not-allowed`:`pointer`,color:p===1?`#d1d5db`:`#6b7280`,fontSize:14},disabled:p===1,children:`‹`}):t===`next`?(0,$.jsx)(`button`,{style:{minWidth:32,height:32,border:`1px solid #e5e7eb`,borderRadius:6,background:p>=Math.ceil(_/h)?`#f9fafb`:`#fff`,cursor:p>=Math.ceil(_/h)?`not-allowed`:`pointer`,color:p>=Math.ceil(_/h)?`#d1d5db`:`#6b7280`,fontSize:14},disabled:p>=Math.ceil(_/h),children:`›`}):t===`page`?(0,$.jsx)(`button`,{style:{minWidth:32,height:32,border:`none`,borderRadius:6,background:e===p?`#6366f1`:`#fff`,color:e===p?`#fff`:`#374151`,fontWeight:e===p?500:400,cursor:`pointer`,fontSize:14},children:e}):n})})]}):(0,$.jsxs)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,padding:`40px`},children:[(0,$.jsxs)(`div`,{style:{width:120,height:120,display:`flex`,alignItems:`center`,justifyContent:`center`,marginBottom:24,position:`relative`},children:[(0,$.jsx)(`div`,{style:{width:60,height:60,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%)`,borderRadius:20,position:`absolute`,bottom:0,right:10}}),(0,$.jsx)(`div`,{style:{width:50,height:50,border:`2px solid rgba(99, 102, 241, 0.2)`,borderRadius:16,position:`absolute`,top:0,left:10}}),(0,$.jsx)(`div`,{style:{width:56,height:56,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:18,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 8px 24px rgba(99, 102, 241, 0.25)`},children:(0,$.jsx)(t5,{style:{fontSize:28,color:`#fff`}})})]}),(0,$.jsx)(`h3`,{style:{margin:0,fontSize:16,fontWeight:600,color:`#1e293b`,marginBottom:8},children:`暂无生成内容`}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:13,color:`#64748b`,textAlign:`center`,padding:`0 40px`,lineHeight:1.6},children:`请完善素材与卖点,生成专属爆款复刻视频`})]})})]}),(0,$.jsx)(`div`,{className:`replication-form`,style:{flex:1,overflow:`auto`,width:`28%`,background:`transparent`,backdropFilter:`blur(20px)`,borderRadius:20,position:`relative`,zIndex:10},children:(0,$.jsxs)(`div`,{className:`replication-form-content`,style:{width:`100%`,height:`100%`,background:`rgba(258, 250, 252, 0.2)`,padding:24,overflowY:`auto`},children:[(0,$.jsxs)(`div`,{style:{marginBottom:20},children:[(0,$.jsx)(`p`,{style:{margin:0,fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10},children:`上传复刻视频`}),O?(0,$.jsxs)(`div`,{style:{position:`relative`},children:[(0,$.jsx)(`video`,{src:s9(O),controls:!0,style:{width:`100%`,borderRadius:12,maxHeight:200,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.08)`}}),(0,$.jsx)(`button`,{onClick:()=>{O&&URL.revokeObjectURL(O),D(null),k(``)},style:{position:`absolute`,top:8,right:8,width:28,height:28,border:`none`,background:`rgba(239, 68, 68, 0.9)`,borderRadius:`50%`,cursor:`pointer`,color:`#fff`,fontSize:16,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:10,transition:`all 0.2s`},children:`×`}),(0,$.jsxs)(`div`,{style:{marginTop:10,display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(t5,{style:{color:`#6366f1`,fontSize:14}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#475569`},children:E?.name}),(0,$.jsxs)(`span`,{style:{fontSize:11,color:`#94a3b8`},children:[`(`,E?.size?(E.size/1024/1024).toFixed(2):0,`MB)`]})]})]}):(0,$.jsx)(b0,{style:{width:`100%`},beforeUpload:async e=>{if(!e.type.startsWith(`video/`))return Z.error(`只能上传视频文件`),!1;if(!(e.size/1024/1024<50))return Z.error(`视频大小不能超过50MB`),!1;let t=document.createElement(`video`);return t.preload=`metadata`,new Promise(n=>{t.onloadedmetadata=async()=>{if(t.duration<2){Z.error(`视频时长不能少于2秒`),URL.revokeObjectURL(t.src),n(!1);return}if(t.duration>=16){Z.error(`视频时长不能超过15秒`),URL.revokeObjectURL(t.src),n(!1);return}V(!0);try{let r=await Aie(e,t.duration);D(e),k(r.url),j(r.resource_id||``),N(t.duration),Z.success(`视频上传成功`),n(!1)}catch(e){let t=``;if(e instanceof Error)try{t=JSON.parse(e.message).detail||e.message}catch{t=e.message}Z.error(t||`视频上传失败`),n(!1)}finally{V(!1),URL.revokeObjectURL(t.src)}},t.onerror=()=>{Z.error(`视频文件无效`),URL.revokeObjectURL(t.src),n(!1)},t.src=URL.createObjectURL(e)})},showUploadList:!1,accept:`video/mp4,video/quicktime,.mp4,.mov`,children:(0,$.jsx)(`div`,{style:{border:`2px dashed rgba(99, 102, 241, 0.3)`,borderRadius:12,padding:24,textAlign:`center`,cursor:`pointer`,transition:`all 0.25s cubic-bezier(0.4, 0, 0.2, 1)`,background:`rgba(99, 102, 241, 0.02)`},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#6366f1`,e.currentTarget.style.background=`rgba(99, 102, 241, 0.05)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.3)`,e.currentTarget.style.background=`rgba(99, 102, 241, 0.02)`},children:B?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{width:40,height:40,margin:`0 auto 12px`,border:`3px solid rgba(99, 102, 241, 0.2)`,borderTopColor:`#6366f1`,borderRadius:`50%`,animation:`spin 1s linear infinite`}}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:13,color:`#6366f1`,fontWeight:500},children:`上传中...`}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:11,color:`#94a3b8`,marginTop:4},children:`支持的文件类型:MP4、MOV | 视频最大时长:15 秒 | 最大大小:50M`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{width:48,height:48,margin:`0 auto 12px`,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%)`,borderRadius:16,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(t5,{style:{fontSize:24,color:`#6366f1`}})}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:13,color:`#475569`,fontWeight:500},children:`点击或拖拽上传视频`}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:11,color:`#94a3b8`,marginTop:4},children:`支持的文件类型:MP4、MOV | 视频最大时长:15 秒 | 最大大小:50M`})]})})})]}),(0,$.jsxs)(`div`,{style:{marginBottom:20},children:[(0,$.jsx)(`p`,{style:{margin:0,fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10},children:`上传产品图片`}),I?(0,$.jsxs)(`div`,{style:{position:`relative`},children:[(0,$.jsx)(`img`,{src:s9(I),alt:`产品图片`,style:{width:`100%`,borderRadius:12,maxHeight:200,objectFit:`contain`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.08)`}}),(0,$.jsx)(`button`,{onClick:()=>{I&&URL.revokeObjectURL(I),F(null),L(``)},style:{position:`absolute`,top:8,right:8,width:28,height:28,border:`none`,background:`rgba(239, 68, 68, 0.9)`,borderRadius:`50%`,cursor:`pointer`,color:`#fff`,fontSize:16,display:`flex`,alignItems:`center`,justifyContent:`center`,zIndex:10,transition:`all 0.2s`},children:`×`}),(0,$.jsxs)(`div`,{style:{marginTop:10,display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(R6,{style:{color:`#6366f1`,fontSize:14}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#475569`},children:P?.name}),(0,$.jsxs)(`span`,{style:{fontSize:11,color:`#94a3b8`},children:[`(`,P?.size?(P.size/1024/1024).toFixed(2):0,`MB)`]})]})]}):(0,$.jsx)(b0,{style:{width:`100%`},beforeUpload:async e=>{if(!e.type.startsWith(`image/`))return Z.error(`只能上传图片文件`),!1;if(!(e.size/1024/1024<10))return Z.error(`图片大小不能超过10MB`),!1;let t=new Image;return new Promise(n=>{t.onload=async()=>{let r=t.width/t.height;Math.abs(r-.75)<.1||Math.abs(r-.5625),U(!0);try{let t=await kie(e);F(e),L(t.url),z(t.resource_id||``),Z.success(`图片上传成功`),n(!1)}catch(e){let t=``;if(e instanceof Error)try{t=JSON.parse(e.message).detail||e.message}catch{t=e.message}Z.error(t||`图片上传失败`),n(!1)}finally{U(!1),URL.revokeObjectURL(t.src)}},t.onerror=()=>{Z.error(`图片文件无效`),URL.revokeObjectURL(t.src),n(!1)},t.src=URL.createObjectURL(e)})},showUploadList:!1,accept:`image/jpeg,image/jpg,image/png,.jpg,.jpeg,.png`,children:(0,$.jsx)(`div`,{style:{border:`2px dashed rgba(99, 102, 241, 0.3)`,borderRadius:12,padding:20,textAlign:`center`,cursor:`pointer`,transition:`all 0.25s cubic-bezier(0.4, 0, 0.2, 1)`,background:`rgba(99, 102, 241, 0.02)`},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#6366f1`,e.currentTarget.style.background=`rgba(99, 102, 241, 0.05)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.3)`,e.currentTarget.style.background=`rgba(99, 102, 241, 0.02)`},children:H?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{width:36,height:36,margin:`0 auto 10px`,border:`3px solid rgba(99, 102, 241, 0.2)`,borderTopColor:`#6366f1`,borderRadius:`50%`,animation:`spin 1s linear infinite`}}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:13,color:`#6366f1`,fontWeight:500},children:`上传中...`}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:11,color:`#94a3b8`,marginTop:4},children:`支持 JPG, JPEG, PNG 格式,图片比例为 3:4 或 9:16 效果最佳`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{width:44,height:44,margin:`0 auto 10px`,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%)`,borderRadius:14,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(R6,{style:{fontSize:22,color:`#6366f1`}})}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:13,color:`#475569`,fontWeight:500},children:`+ 点击上传`}),(0,$.jsx)(`p`,{style:{margin:0,fontSize:11,color:`#94a3b8`,marginTop:4},children:`支持 JPG, JPEG, PNG 格式,图片比例为 3:4 或 9:16 效果最佳`})]})})})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`p`,{style:{margin:0,fontSize:13,fontWeight:500,color:`#475569`,marginBottom:8},children:`原视频产品名称`}),(0,$.jsx)(IW,{value:y,onChange:e=>b(e.target.value),placeholder:`请输入原视频产品名称`,style:{borderRadius:10,height:40,fontSize:13,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`},maxLength:10,suffix:(0,$.jsxs)(`span`,{style:{color:`#94a3b8`,fontSize:12},children:[y.length,`/10`]})})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`p`,{style:{margin:0,fontSize:13,fontWeight:500,color:`#475569`,marginBottom:8},children:`自有产品名称`}),(0,$.jsx)(IW,{value:x,onChange:e=>C(e.target.value),placeholder:`请输入自有产品名称`,style:{borderRadius:10,height:40,fontSize:13,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`},maxLength:10,suffix:(0,$.jsxs)(`span`,{style:{color:`#94a3b8`,fontSize:12},children:[x.length,`/10`]})})]}),(0,$.jsxs)(`div`,{style:{marginBottom:24},children:[(0,$.jsx)(`p`,{style:{margin:0,fontSize:13,fontWeight:500,color:`#475569`,marginBottom:8},children:`产品卖点`}),(0,$.jsxs)(`div`,{style:{position:`relative`},children:[(0,$.jsx)(ase,{value:w,onChange:e=>T(e.target.value),placeholder:`请输入产品卖点`,style:{borderRadius:10,fontSize:13,height:80,resize:`none`,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`},rows:3,maxLength:30}),(0,$.jsxs)(`span`,{style:{position:`absolute`,right:10,bottom:8,color:`#94a3b8`,fontSize:12},children:[w.length,`/30`]})]})]}),(0,$.jsx)(X,{type:`primary`,block:!0,size:`large`,onClick:()=>{if(!O){Z.warning(`请上传复刻视频`);return}if(!I){Z.warning(`请上传产品图片`);return}if(!y.trim()){Z.warning(`请输入原视频产品名称`);return}if(!x.trim()){Z.warning(`请输入自有产品名称`);return}if(!w.trim()){Z.warning(`请输入产品卖点`);return}Gie({material_video_url:O,material_image_url:I,material_video_resource_id:A||void 0,material_image_resource_id:R||void 0,material_video_duration_seconds:M||void 0,source_project_name:y,target_project_name:x,core_content_point:w,idempotency_key:Date.now().toString()}).then(t=>{let r=``,i=``;k(``),j(``),N(null),L(``),z(``),b(``),C(``),T(``),ne(1,8),U5(1,20).then(t=>{if(t.items){let a=t.items[0].id;n(t.items),W5(t.items[0].id).then(t=>{r=t.id,i=t.steps[0].id,Kie(r,i).then(t=>{Z.loading(`创建中...`,3),setTimeout(()=>{e(`/initial/${a}/initialinfo`)},3e3)})}).catch(e=>{})}}).catch(e=>{})}).catch(e=>{Z.error(`视频开头复刻失败`)})},style:{borderRadius:12,height:44,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%)`,border:`none`,fontSize:15,boxShadow:`0 4px 16px rgba(99, 102, 241, 0.3)`,transition:`all 0.25s cubic-bezier(0.4, 0, 0.2, 1)`},children:`立即生成+`})]})}),(0,$.jsxs)(mK,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`创作记录`})]}),open:W,onCancel:()=>ee(!1),width:850,footer:null,style:{borderRadius:20},styles:{body:{height:580,display:`flex`,flexDirection:`column`,padding:0},header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,padding:`16px 24px`}},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,margin:`16px 24px`,flexShrink:0},children:[(0,$.jsx)(IW,{placeholder:`搜索产品名称`,value:l,onChange:e=>u(e.target.value),onPressEnter:oe,style:{width:220,borderRadius:10,marginRight:10,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`}}),(0,$.jsx)(X,{type:`primary`,onClick:oe,style:{borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`搜索`})]}),(0,$.jsx)(`div`,{style:{flex:1,overflow:`auto`,padding:`0 24px 24px`},children:(0,$.jsx)(`div`,{style:{background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(10px)`,borderRadius:16,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.08)`,boxShadow:`0 4px 16px rgba(99, 102, 241, 0.06)`},children:(0,$.jsx)(LQ,{columns:[{title:`产品名称`,dataIndex:`targetProjectName`,key:`targetProjectName`,align:`center`,width:100,render:e=>(0,$.jsx)(`span`,{style:{fontSize:13,color:`#1e293b`,fontWeight:500},children:e||`-`})},{title:`状态`,dataIndex:`status`,key:`status`,align:`center`,width:220,render:(e,t)=>{let n=e,r=t.current_step_code||t.currentStepCode,i=(()=>{if(r===`image_prompt_optimize`)switch(n){case`waiting_user`:return{text:`等待融合图生成`,color:`#f59e0b`};case`processing`:return{text:`图片提示词生成中`,color:`#f59e0b`};case`completed`:return{text:`图片提示词生成成功`,color:`#10b981`};case`failed`:return{text:`图片提示词生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#64748b`}}else if(r===`image_generate`)switch(n){case`waiting_user`:return{text:`等待生成视频提示词`,color:`#f59e0b`};case`processing`:return{text:`融合图生成中`,color:`#f59e0b`};case`completed`:return{text:`融合图生成成功`,color:`#10b981`};case`failed`:return{text:`融合图生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#64748b`}}else if(r===`video_prompt_optimize`)switch(n){case`waiting_user`:return{text:`等待最终视频生成`,color:`#f59e0b`};case`processing`:return{text:`视频提示词生成中`,color:`#f59e0b`};case`completed`:return{text:`视频提示词生成成功`,color:`#10b981`};case`failed`:return{text:`视频提示词生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#64748b`}}else if(r===`video_generate`)switch(n){case`waiting_user`:return{text:``,color:`#64748b`};case`processing`:return{text:`最终视频生成中`,color:`#f59e0b`};case`completed`:return{text:`任务完成`,color:`#10b981`};case`failed`:return{text:`最终视频生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#64748b`}}else if(r===`material_input`)switch(n){case`waiting_user`:return{text:`等待生成图片提示词`,color:`#f59e0b`};case`processing`:return{text:`素材处理中`,color:`#f59e0b`};case`completed`:return{text:`素材上传成功`,color:`#10b981`};case`failed`:return{text:`素材上传失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#64748b`}}else return{pending:{text:`子任务待处理`,color:`#f59e0b`},waiting_user:{text:`等待用户确认或触发`,color:`#f59e0b`},processing:{text:`子任务处理中`,color:`#f59e0b`},completed:{text:`子任务完成`,color:`#10b981`},failed:{text:`子任务失败`,color:`#ef4444`},cancelled:{text:`子任务取消`,color:`#94a3b8`}}[n]||{text:n||`-`,color:`#64748b`}})();return(0,$.jsx)(`span`,{style:{fontSize:12,color:i.color,fontWeight:500},children:i.text})}},{title:`创建时间`,dataIndex:`createdAt`,key:`createdAt`,align:`center`,width:200,render:e=>{if(!e)return`-`;let t=new Date(e);return(0,$.jsx)(`span`,{style:{fontSize:12,color:`#64748b`},children:`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)} ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`})}},{title:`操作`,key:`action`,align:`center`,width:220,render:(t,n)=>(0,$.jsxs)(sH,{children:[(0,$.jsx)(`button`,{onClick:()=>e(`/initial/${n.id}/initialinfo`),style:{color:`#6366f1`,textDecoration:`none`,fontSize:13,border:`none`,background:`rgba(99, 102, 241, 0.08)`,padding:`4px 12px`,borderRadius:8,cursor:`pointer`,transition:`all 0.2s`},children:`查看详情`}),(0,$.jsx)(vK,{title:`确认删除这个爆款开头复刻任务吗?`,onConfirm:async()=>{try{await pae(n.id),Z.success(`删除成功`),ie(1,a,!1,l)}catch{Z.error(`删除失败`)}},children:(0,$.jsx)(`button`,{style:{color:`#ef4444`,textDecoration:`none`,fontSize:13,border:`none`,background:`rgba(239, 68, 68, 0.08)`,padding:`4px 12px`,borderRadius:8,cursor:`pointer`,transition:`all 0.2s`},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(239, 68, 68, 0.12)`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(239, 68, 68, 0.08)`},children:`删除`})})]})}],dataSource:t,rowKey:`id`,pagination:{current:r,pageSize:a,total:s,showSizeChanger:!0,showQuickJumper:!0,showTotal:e=>`共 ${e} 条`,onChange:ae,itemRender:(e,t,n)=>t===`prev`?(0,$.jsx)(`button`,{style:{minWidth:32,height:32,border:`1px solid rgba(99, 102, 241, 0.15)`,borderRadius:8,background:r===1?`rgba(243, 244, 246, 0.5)`:`#fff`,cursor:r===1?`not-allowed`:`pointer`,color:r===1?`#94a3b8`:`#6366f1`,fontSize:14},disabled:r===1,children:`‹`}):t===`next`?(0,$.jsx)(`button`,{style:{minWidth:32,height:32,border:`1px solid rgba(99, 102, 241, 0.15)`,borderRadius:8,background:r>=Math.ceil(s/a)?`rgba(243, 244, 246, 0.5)`:`#fff`,cursor:r>=Math.ceil(s/a)?`not-allowed`:`pointer`,color:r>=Math.ceil(s/a)?`#94a3b8`:`#6366f1`,fontSize:14},disabled:r>=Math.ceil(s/a),children:`›`}):t===`page`?(0,$.jsx)(`button`,{style:{minWidth:32,height:32,border:`none`,borderRadius:8,background:e===r?`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`:`#fff`,color:e===r?`#fff`:`#475569`,fontWeight:e===r?600:400,cursor:`pointer`,fontSize:14},children:e}):n},style:{fontSize:13},scroll:{y:350}})})})]})]})};function c9(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function l9(e,...t){for(let n of t){let t=e[n];if(t!=null&&String(t).trim()!==``)return String(t)}return``}function u9(e,t,...n){for(let t of n){let n=e[t];if(n===!0||n===!1)return n;if(n===`true`)return!0;if(n===`false`)return!1}return t}function cse(e,...t){for(let n of t){let t=e[n];if(typeof t==`number`&&Number.isFinite(t)&&t>0)return t;if(typeof t==`string`&&t.trim()){let e=Number(t);if(Number.isFinite(e)&&e>0)return e}}}function d9(e){if(!c9(e))return null;let t=l9(e,`key`);return t?{key:t,label:l9(e,`label`)||t,type:l9(e,`type`)||void 0,enabled:u9(e,!0,`enabled`),editable:u9(e,!0,`editable`),maxLength:cse(e,`maxLength`,`max_length`)}:null}function f9(e){if(!c9(e))return null;let t=e.data;return c9(t)?t:Array.isArray(e.sections)?e:null}function lse(e){return!!f9(e)}function p9(e){let t=f9(e);return(Array.isArray(t?.sections)?t.sections:[]).map(e=>{let t=d9(e);if(!t||!c9(e))return null;let n=Array.isArray(e.children)?e.children.map(d9).filter(Boolean):[],r=Array.isArray(e.itemFields)?e.itemFields.map(d9).filter(Boolean):Array.isArray(e.item_fields)?e.item_fields.map(d9).filter(Boolean):[];return{...t,contentKey:l9(e,`contentKey`,`content_key`)||void 0,children:n,itemFields:r}}).filter(e=>!!e&&e.enabled)}function m9(e){if(e==null)return``;if(typeof e==`object`)try{return JSON.stringify(e,null,2)}catch{return String(e)}return String(e)}function h9(e){let t=m9(e);return t.length>40||t.includes(` +`)||t.includes(`,`)||t.includes(`。`)||t.includes(`;`)||t.includes(`;`)}function g9(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function _9(e,t,n,r){let i=g9(e||{});return c9(i[t])||(i[t]={}),i[t][n]=r,i}function v9(e,t,n,r,i){let a=g9(e||{});return Array.isArray(a[t])||(a[t]=[]),c9(a[t][n])||(a[t][n]={}),a[t][n][r]=i,a}function y9(e,t){if(!c9(e))return`视频提示词不能为空`;let n=p9(t);if(!n.length)return`视频提词配置缺失,无法保存`;for(let t of n){if(!t.editable)continue;let n=e[t.key];if(t.type===`object`){if(!c9(n))continue;for(let e of t.children)if(!(!e.enabled||!e.editable||!e.maxLength)&&m9(n[e.key]).length>e.maxLength)return`字段【${t.label}.${e.label}】长度不能超过 ${e.maxLength} 个字符`;continue}if(t.type===`flow`){if(!Array.isArray(n))continue;for(let e=0;en.maxLength)return`字段【${t.label} 第 ${e+1} 项.${n.label}】长度不能超过 ${n.maxLength} 个字符`}}continue}if(t.editable&&t.maxLength&&m9(n).length>t.maxLength)return`字段【${t.label}】长度不能超过 ${t.maxLength} 个字符`}return null}var{Text:b9}=Q,{TextArea:x9}=IW;function S9(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function C9({value:e}){let t=e===`true`?`是`:e===`false`?`否`:m9(e);return h9(e)?(0,$.jsx)(x9,{value:t,rows:Math.min(6,Math.max(2,Math.ceil(t.length/42))),disabled:!0,style:{borderRadius:8,color:`#64748b`}}):(0,$.jsx)(IW,{value:t,disabled:!0,style:{borderRadius:8,color:`#64748b`}})}function w9({value:e,maxLength:t,onChange:n}){let r=m9(e),i={value:r,maxLength:t,showCount:!!t,onChange:e=>n(e.target.value),style:{borderRadius:8}};return h9(e)?(0,$.jsx)(x9,{...i,rows:Math.min(8,Math.max(3,Math.ceil(r.length/42)))}):(0,$.jsx)(IW,{...i})}function T9({value:e,onChange:t}){let n=e===!0||e===`true`;return(0,$.jsxs)(jI.Group,{value:n,onChange:e=>t(e.target.value),style:{display:`flex`,gap:24},children:[(0,$.jsx)(jI,{value:!0,style:{fontSize:14,color:`#475569`},children:`是`}),(0,$.jsx)(jI,{value:!1,style:{fontSize:14,color:`#475569`},children:`否`})]})}var E9=({value:e,schemaConfigSnapshot:t,onChange:n})=>{let r=S9(e)?e:{},i=p9(t);if(!lse(t))return(0,$.jsxs)(sH,{direction:`vertical`,size:12,style:{width:`100%`},children:[(0,$.jsx)(Jf,{type:`warning`,showIcon:!0,message:`视频提词配置缺失,暂不能编辑`,description:`请刷新详情后重试;如果仍然缺失,请联系管理员排查第4步 schema_config_snapshot 返回。`}),Object.keys(r).length?(0,$.jsx)(`pre`,{style:{margin:0,padding:12,borderRadius:10,background:`#f8fafc`,maxHeight:420,overflow:`auto`,color:`#475569`},children:JSON.stringify(r,null,2)}):null]});if(!i.length)return(0,$.jsx)(Jf,{type:`warning`,showIcon:!0,message:`视频提词配置为空`,description:`当前 Schema 配置没有可展示字段。`});let a=e=>{let t=S9(r[e.key])?r[e.key]:{},i=e.children.filter(e=>e.enabled);return i.length?(0,$.jsxs)(`div`,{style:{marginBottom:18},children:[(0,$.jsx)(sH,{style:{marginBottom:8},children:(0,$.jsx)(b9,{strong:!0,style:{color:`#334155`,fontSize:13},children:e.label})}),(0,$.jsx)(`div`,{style:{borderLeft:`3px solid #6366f1`,paddingLeft:12,marginLeft:4},children:i.map(i=>(0,$.jsxs)(`div`,{style:{marginBottom:12},children:[(0,$.jsx)(sH,{style:{marginBottom:4},children:(0,$.jsx)(b9,{style:{color:`#64748b`,fontSize:12},children:i.label})}),i.editable?i.type===`boolean`?(0,$.jsx)(T9,{value:t[i.key],onChange:t=>n(_9(r,e.key,i.key,t))}):(0,$.jsx)(w9,{value:t[i.key],maxLength:i.maxLength,onChange:t=>n(_9(r,e.key,i.key,t))}):(0,$.jsx)(C9,{value:t[i.key]})]},i.key))})]},e.key):null},o=e=>{let t=Array.isArray(r[e.key])?r[e.key]:[],i=[{key:`时间段`,label:`时间段`,enabled:!0,editable:!1},...e.itemFields.filter(e=>e.enabled)];return(0,$.jsxs)(`div`,{style:{marginBottom:18},children:[(0,$.jsxs)(sH,{style:{marginBottom:8},children:[(0,$.jsx)(b9,{strong:!0,style:{color:`#334155`,fontSize:13},children:e.label}),(0,$.jsx)(XQ,{color:`default`,children:`锁定条目和时间段`})]}),(0,$.jsx)(`div`,{style:{border:`1px solid #e5e7eb`,borderRadius:10,padding:12,background:`#fff`},children:t.length===0?(0,$.jsx)(b9,{style:{color:`#94a3b8`,fontSize:12},children:`暂无内容`}):t.map((a,o)=>{let s=S9(a)?a:{};return(0,$.jsxs)(`div`,{style:{marginBottom:o===t.length-1?0:14,paddingBottom:o===t.length-1?0:14,borderBottom:o===t.length-1?`none`:`1px dashed #e2e8f0`},children:[(0,$.jsxs)(b9,{strong:!0,style:{display:`block`,marginBottom:8,color:`#475569`,fontSize:12},children:[`第 `,o+1,` 段`]}),i.map(t=>(0,$.jsxs)(`div`,{style:{marginBottom:10},children:[(0,$.jsx)(sH,{style:{marginBottom:4},children:(0,$.jsx)(b9,{style:{color:`#64748b`,fontSize:12},children:t.label})}),t.editable?t.type===`boolean`?(0,$.jsx)(T9,{value:s[t.key],onChange:i=>n(v9(r,e.key,o,t.key,i))}):(0,$.jsx)(w9,{value:s[t.key],maxLength:t.maxLength,onChange:i=>n(v9(r,e.key,o,t.key,i))}):(0,$.jsx)(C9,{value:s[t.key]})]},t.key))]},`${e.key}-${o}`)})})]},e.key)},s=e=>e.key in r?(0,$.jsxs)(`div`,{style:{marginBottom:18},children:[(0,$.jsx)(sH,{style:{marginBottom:8},children:(0,$.jsx)(b9,{strong:!0,style:{color:`#334155`,fontSize:13},children:e.label})}),e.editable?(0,$.jsx)(w9,{value:r[e.key],maxLength:e.maxLength,onChange:t=>{let i=g9(r);i[e.key]=t,n(i)}}):(0,$.jsx)(C9,{value:r[e.key]})]},e.key):null;return(0,$.jsx)(`div`,{children:i.map(e=>e.key in r?e.type===`object`?a(e):e.type===`flow`?o(e):s(e):null)})},{Title:use,Text:D9}=Q,{TextArea:dse}=IW;function fse(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}var O9=e=>e?/^https?:\/\//i.test(e)?e:`${`http://ceshi.apiforeign.minzhong.cn`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`:``;function pse(){let e=Ye(),{creatID:t}=$e(),{user:n}=_7(),[r,i]=(0,S.useState)(!1),[a,o]=(0,S.useState)(``),[s,c]=(0,S.useState)(!1),[l,u]=(0,S.useState)(`image`),[d,f]=(0,S.useState)({}),[p,m]=(0,S.useState)(null),[h,g]=(0,S.useState)(``),[_,v]=(0,S.useState)(!1),[y,b]=(0,S.useState)(null),[x,C]=(0,S.useState)({}),[w,T]=(0,S.useState)(``),[E,D]=(0,S.useState)(``),[O,k]=(0,S.useState)(!1),[A,j]=(0,S.useState)(!1),[M,N]=(0,S.useState)(5),[P,F]=(0,S.useState)(`16:9`),[I,L]=(0,S.useState)(`480p`),[R,z]=(0,S.useState)({ratios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:[`480p`,`720p`,`1080p`],durations:[5,8,10,12,15]}),[B,V]=(0,S.useState)([]),[H,U]=(0,S.useState)(0),[W,ee]=(0,S.useState)([]),[te,G]=(0,S.useState)(1),[ne,re]=(0,S.useState)(20),[ie,ae]=(0,S.useState)(0),[oe,K]=(0,S.useState)(``),[q,se]=(0,S.useState)({}),[ce,le]=(0,S.useState)([]),[ue,de]=(0,S.useState)([]),[fe,pe]=(0,S.useState)(!1),[me,he]=(0,S.useState)(``),[ge,_e]=(0,S.useState)(`image`),ve=S.useRef(null);(0,S.useEffect)(()=>{if(fe&&ge===`video`){let e=()=>{ve.current&&ve.current.play().catch(()=>{})};ve.current&&(ve.current.readyState>=2?e():ve.current.addEventListener(`loadedmetadata`,e));let t=setTimeout(e,300);return()=>{clearTimeout(t),ve.current&&(ve.current.removeEventListener(`loadedmetadata`,e),ve.current.pause())}}else ve.current&&ve.current.pause()},[fe,ge]);let ye=(e,t)=>{he(e),_e(t),pe(!0)},be=()=>{pe(!1),he(``),ve.current&&ve.current.pause()},xe=e=>{if(e.preventDefault(),e.stopPropagation(),!me)return;let t=document.createElement(`a`);t.href=`http://ceshi.apiforeign.minzhong.cn${me}&download=1`,t.download=ge===`image`?`image.png`:`video.mp4`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},Se=[{id:1,title:`原始素材`,description:`上传原始视频素材`,childId:1},{id:2,title:`生成提示词`,description:`根据素材生成描述词`,childId:2},{id:3,title:`生成产品融合图`,description:`生成产品与场景融合图`,childId:3},{id:4,title:`生成视频提示词`,description:`生成视频生成提示词`,childId:4},{id:5,title:`生成最终视频`,description:`合成最终视频`,childId:5}].map((e,t)=>({...e,status:ce[t]?.status||``,id:ce[t]?.id||t,output:ce[t]?.output||``,engineId:ce[t]?.input?.payload?.videoConfig?.engineId||``}));(0,S.useEffect)(()=>{let e=new Set;ue.forEach(t=>{let n=Se.find(e=>String(e.childId)===t);n&&(n.status===`completed`||n.status===`failed`)&&e.add(t)});for(let t=Se.length-1;t>=0;t--)if(Se[t].status===`completed`||Se[t].status===`failed`){e.add(String(Se[t].childId));break}e.size>0?de(Array.from(e)):de([])},[ce]);let Ce=(e,t,n)=>{U5(e,t,n).then(e=>{e.items&&ee(e.items),e.total!==void 0&&ae(e.total)}).catch(e=>{})},we=(e,t)=>{G(e),re(t),Ce(e,t,oe)},Te=()=>{G(1),Ce(1,ne,oe)};(0,S.useEffect)(()=>{Ce(te,ne)},[]),(0,S.useEffect)(()=>{z5().then(e=>{let t=(e.engine?.video||[]).filter(e=>e.supportsUniversalReference!==!1),n=(e.engine?.image||[]).filter(e=>e.supportsUniversalReference!==!1);if(C({video:t,image:n}),t.length>0){T(t[0].id);let e=t[0];z({ratios:e.supportedRatios||[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:e.supportedResolutions||[`480p`,`720p`,`1080p`],durations:e.supportedDurations||[5,8,10,12,15]})}n.length>0&&D(n[0].id)}).catch(e=>{})},[]),(0,S.useEffect)(()=>{H5().then(e=>{V(e)}).catch(()=>{})},[]);let Ee=()=>{let e={};e=B.find(e=>e.modelConfigId===w&&e.genType===`video`&&e.resolution===I),e||(e={perSecondCredits:2,baseCredits:60,ratio:1.3,inputVideoRatio:1.3,inputVideoBaseCredits:0,inputVideoPerSecondCredits:15,inputImageRatio:1,inputImageBaseCredits:0,inputImagePerImageCredits:0},(I===`1080p`||I===`720p`||I===`480p`)&&(e.ratio=1.3));let t=(M*e.perSecondCredits+e.baseCredits)*e.ratio,n=q?.videoGeneration?.inputMedia?.video?.duration||0;if(n>0){let r=((e.inputVideoBaseCredits||0)+(e.inputVideoPerSecondCredits||0)*n)*(e.inputVideoRatio||1);t+=r}let r=q?.videoGeneration?.inputMedia?.image?.length||0;if(r>0){let n=((e.inputImageBaseCredits||0)+(e.inputImagePerImageCredits||0)*r)*(e.inputImageRatio||1);t+=n}U(Number(t.toFixed(2)))};(0,S.useEffect)(()=>{B.length>0&&w&&Ee()},[B,w,M,I,q]),(0,S.useEffect)(()=>()=>{y&&(clearInterval(y),b(null))},[y]),(0,S.useEffect)(()=>{let e=e=>{let t=e.target;!t.closest(`.image-settings-trigger`)&&!t.closest(`.image-settings-popover`)&&(k(!1),j(!1))};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,S.useEffect)(()=>{t&&W5(t).then(e=>{se(e),e.steps&&le(e.steps)}).catch(e=>{})},[t]),(0,S.useEffect)(()=>{let e=Se[4];e&&e.status!==`completed`&&e.status!==`failed`?y||b(setInterval(ke,15e3)):e&&y&&(clearInterval(y),b(null))},[Se]);let De=(e,t,n,r)=>{u(t||`image`),g(n?String(n):``),t===`video`?(m(r||null),f(e&&typeof e==`object`?fse(e):{}),o(``)):(m(null),o(e||``),f({})),i(!0)},Oe=async()=>{if(l===`image`){if(!q?.id||!h){Z.warning(`缺少任务或步骤 ID,无法保存图片提示词`);return}if(!a||!a.trim()){Z.warning(`图片提示词不能为空`);return}v(!0);try{await qie(q.id,h,{prompt:a.trim()}),Z.success(`图片提示词已保存`),Ae(),i(!1),g(``)}catch(e){Z.error(e?.message||`保存图片提示词失败`)}finally{v(!1)}return}if(!q?.id||!h){Z.warning(`缺少任务或步骤 ID,无法保存视频提示词`);return}if(!d||typeof d!=`object`||Object.keys(d).length===0){Z.warning(`视频提示词不能为空`);return}if(!p){Z.warning(`视频提词配置缺失,暂不能保存`);return}let e=y9(d,p);if(e){Z.warning(e);return}v(!0);try{await $ie(q.id,h,{prompt_schema:d}),Z.success(`视频提示词已保存`),Ae(),i(!1),g(``)}catch(e){Z.error(e?.message||`保存视频提示词失败`)}finally{v(!1)}},ke=()=>{t&&W5(t).then(e=>{se(e),e.steps&&le(e.steps)}).catch(e=>{})},Ae=()=>{t&&W5(t).then(e=>{se(e),e.steps&&le(e.steps)}).catch(e=>{})},je=e=>{let t={engine_id:E,image_proportion:`1:1`,image_px:`2048x2048`,image_size:`2K`};G5(q.id,e.toString(),t).then(e=>{Z.info(`正在生成图片,请稍候...`),Ae()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Z.error(t)})},Me=()=>{let e={engine_id:E,image_proportion:`1:1`,image_px:`2048x2048`,image_size:`2K`};G5(q.id,Se[1].id.toString(),e).then(e=>{Z.info(`正在生成图片,请稍候...`),Ae()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Z.error(t)})},Ne=e=>{let t={engine_id:w,duration:M,aspect_ratio:P,resolution:I,target_platform:`抖音`};Jie(q.id,e.toString(),t).then(e=>{Ae(),Z.info(`正在生成视频提示词,请稍候...`)}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Z.error(t)})},Pe=(e,t)=>{K5(q.id,e.toString(),{engine_id:``}).then(e=>{Z.info(`正在生成视频,请稍候...`),Ae()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Z.error(t)})},Fe=()=>{K5(q.id,Se[3].id.toString(),{engine_id:``}).then(e=>{Z.info(`正在生成视频,请稍候...`),Ae()}).catch(e=>{})};return(0,$.jsxs)(S.Fragment,{children:[(0,$.jsx)(`div`,{className:`initialinfo-container`,style:{margin:`-24px -32px -32px`,height:`calc(100vh - 34px)`,position:`relative`,boxSizing:`border-box`,overflow:`hidden`,display:`flex`,flexDirection:`column`},children:(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,justifyContent:`space-between`,alignItems:`stretch`,gap:`2%`,position:`relative`,zIndex:1,minHeight:0},children:[(0,$.jsxs)(`div`,{className:`replication-preview`,style:{flex:4,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(20px)`,borderRadius:20,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`,display:`flex`,flexDirection:`column`,minHeight:0},children:[(0,$.jsxs)(`div`,{style:{borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`16px 24px`,background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,boxSizing:`border-box`},children:[(0,$.jsx)(X,{icon:(0,$.jsx)(b2,{}),onClick:()=>e(-1),style:{borderRadius:10,fontSize:13,height:32,background:`rgba(99, 102, 241, 0.1)`,border:`1px solid rgba(99, 102, 241, 0.2)`,color:`#6366f1`},children:`返回`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #6366f1, #8b5cf6, transparent)`,borderRadius:1}}),(0,$.jsx)(`h3`,{style:{margin:0,fontSize:16,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`爆款复刻 - 任务详情`}),(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #8b5cf6, #6366f1, transparent)`,borderRadius:1}})]}),(0,$.jsx)(X,{type:`primary`,ghost:!0,style:{borderRadius:10,padding:`4px 16px`,fontSize:13,background:`rgba(99, 102, 241, 0.1)`,borderColor:`rgba(99, 102, 241, 0.2)`,color:`#6366f1`},onClick:()=>c(!0),children:`创作记录`})]}),(0,$.jsx)(`div`,{style:{flex:1,overflowY:`auto`},children:(0,$.jsxs)(`div`,{className:`material_box`,children:[(0,$.jsxs)(`div`,{style:{display:`flex`,gap:24,flexWrap:`wrap`,alignItems:`flex-start`},children:[(0,$.jsxs)(`div`,{style:{flex:1,minWidth:250},children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`视频`]}),(0,$.jsx)(`div`,{className:`medio_box`,style:{aspectRatio:`16/9`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`,cursor:q?.material?.materialVideoUrl?`pointer`:`default`},onClick:()=>q?.material?.materialVideoUrl&&ye(q.material.materialVideoUrl,`video`),children:q?.material?.materialVideoUrl?(0,$.jsx)(`video`,{src:O9(q.material.materialVideoUrl),style:{width:`100%`,height:`100%`,objectFit:`contain`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:13},children:`暂无视频`})})]}),(0,$.jsxs)(`div`,{className:`product_img`,style:{flex:1,minWidth:250},children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`产品图片`]}),(0,$.jsx)(`div`,{className:`medio_box`,style:{aspectRatio:`1/1`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`,cursor:q?.material?.materialImageUrl?`pointer`:`default`},onClick:()=>q?.material?.materialImageUrl&&ye(q.material.materialImageUrl,`image`),children:q?.material?.materialImageUrl?(0,$.jsx)(`img`,{src:O9(q.material.materialImageUrl),alt:``,style:{width:`100%`,height:`100%`,objectFit:`contain`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:13},children:`暂无图片`})})]})]}),(0,$.jsx)(`div`,{style:{margin:`20px 0`,height:1,background:`linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.15), transparent)`,borderRadius:.5}}),q?.finalImageUrl&&(0,$.jsx)(`div`,{style:{marginTop:16},children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`生成图片`]}),(0,$.jsx)(`div`,{className:`medio_box`,style:{aspectRatio:`1/1`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`,cursor:`pointer`},onClick:()=>ye(q.finalImageUrl,`image`),children:(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn${q.finalImageUrl}`,alt:``,style:{width:`100%`,height:`100%`,objectFit:`contain`}})})]})}),q?.finalVideoUrl&&(0,$.jsx)(`div`,{style:{marginTop:16},children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`生成视频`]}),(0,$.jsx)(`div`,{className:`medio_box`,style:{aspectRatio:`16/9`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`,cursor:`pointer`},onClick:()=>ye(q.finalVideoUrl,`video`),children:(0,$.jsx)(`video`,{src:`http://ceshi.apiforeign.minzhong.cn${q.finalVideoUrl}`,style:{width:`100%`,height:`100%`,objectFit:`contain`}})})]})})]})})]}),(0,$.jsxs)(`div`,{className:`replication-form`,style:{flex:1,minWidth:`450px`,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(20px)`,borderRadius:20,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`,display:`flex`,flexDirection:`column`,minHeight:0},children:[(0,$.jsxs)(`div`,{style:{padding:`16px 24px`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,display:`flex`,alignItems:`center`,gap:10,background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`},children:[(0,$.jsx)(`div`,{style:{width:4,height:18,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:15,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`生成步骤`})]}),(0,$.jsx)(`div`,{style:{flex:1,overflowY:`auto`,padding:`8px 16px 16px`},children:(0,$.jsx)($g,{activeKey:ue,onChange:de,ghost:!0,bordered:!1,style:{background:`transparent`},expandIconPlacement:`end`,items:Se.map(e=>({key:String(e.childId),label:(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,width:`100%`,justifyContent:`space-between`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:16,height:16},children:e.status===`completed`?(0,$.jsx)(d4,{style:{fontSize:16,color:`#22c55e`}}):e.status===`processing`?(0,$.jsx)(`div`,{style:{width:16,height:16,borderRadius:`50%`,border:`2px solid #e2e8f0`,borderTopColor:`#6366f1`,animation:`spinSlow 1s linear infinite`}}):e.status===`failed`?(0,$.jsx)(`div`,{style:{width:16,height:16,borderRadius:`50%`,background:`#ef4444`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`span`,{style:{color:`#fff`,fontSize:10},children:`×`})}):(0,$.jsx)(`div`,{style:{width:8,height:8,borderRadius:`50%`,background:`#cbd5e1`}})}),(0,$.jsx)(`span`,{style:{fontSize:14,color:e.status===`processing`||e.status===`waiting_user`?`#6366f1`:`#1e293b`,fontWeight:500},children:e.title}),(e.status===`processing`||e.status===`waiting_user`)&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#6366f1`,marginLeft:8},children:`生成中`}),e.status===`failed`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#ef4444`,marginLeft:8},children:`失败`}),e.status===``&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#717d8b`,marginLeft:8},children:`待生成`})]})}),children:(0,$.jsxs)(`div`,{style:{padding:`16px`,background:`linear-gradient(135deg, rgba(248,250,252,0.6) 0%, rgba(238,242,255,0.4) 100%)`,borderRadius:12,marginTop:8,border:`1px solid rgba(99, 102, 241, 0.06)`},children:[e.childId===1&&(0,$.jsx)($.Fragment,{children:(0,$.jsxs)(`div`,{style:{display:`flex`,gap:20,marginBottom:20,alignItems:`flex-start`,flexWrap:`wrap`},children:[(0,$.jsxs)(`div`,{style:{flex:1,minWidth:200},children:[(0,$.jsx)(D9,{style:{color:`#475569`,fontSize:13,marginBottom:10,display:`block`,fontWeight:500},children:`原视频`}),(0,$.jsx)(`div`,{style:{height:180,borderRadius:12,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,border:`1px solid rgba(99, 102, 241, 0.08)`,boxShadow:`0 2px 8px rgba(99, 102, 241, 0.04)`},children:q?.material?.materialVideoUrl?(0,$.jsx)(`video`,{src:O9(q.material.materialVideoUrl),style:{maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`,borderRadius:10},controls:!0}):(0,$.jsxs)(`div`,{style:{textAlign:`center`,color:`#94a3b8`},children:[(0,$.jsxs)(`svg`,{width:`32`,height:`32`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,style:{marginBottom:8},children:[(0,$.jsx)(`rect`,{x:`2`,y:`2`,width:`20`,height:`16`,rx:`2`,ry:`2`}),(0,$.jsx)(`path`,{d:`M8 12l4 2 4-2`})]}),(0,$.jsx)(`div`,{style:{fontSize:13},children:`暂无视频`})]})})]}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:200},children:[(0,$.jsx)(D9,{style:{color:`#64748b`,fontSize:13,marginBottom:10,display:`block`,fontWeight:500},children:`产品图片`}),(0,$.jsx)(`div`,{style:{height:180,borderRadius:10,background:`#f1f5f9`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:q?.material?.materialImageUrl?(0,$.jsx)(`img`,{src:O9(q.material.materialImageUrl),alt:`产品图片`,style:{maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`,borderRadius:10}}):(0,$.jsxs)(`div`,{style:{textAlign:`center`,color:`#94a3b8`},children:[(0,$.jsxs)(`svg`,{width:`32`,height:`32`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,style:{marginBottom:8},children:[(0,$.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,ry:`2`}),(0,$.jsx)(`circle`,{cx:`8.5`,cy:`8.5`,r:`1.5`,fill:`currentColor`}),(0,$.jsx)(`path`,{d:`M21 15l-5-5L5 21`})]}),(0,$.jsx)(`div`,{style:{fontSize:13},children:`暂无图片`})]})})]})]})}),e.childId===2&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{padding:`12px 14px`,background:`rgba(255,255,255,0.6)`,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.08)`,marginBottom:4},children:(0,$.jsx)(D9,{style:{color:`#475569`,fontSize:13,lineHeight:1.8,whiteSpace:`pre-wrap`},children:e?.output?.payload?.prompt||`暂无提示词`})}),(0,$.jsxs)(sH,{style:{marginTop:16,gap:12,width:`100%`},children:[(0,$.jsx)(X,{type:`default`,icon:(0,$.jsx)(M$,{}),onClick:()=>De(e?.output?.payload?.prompt,`image`,e.id),style:{flex:1,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500,background:`rgba(99, 102, 241, 0.04)`},disabled:e.status!==`completed`,children:`修改提示词`}),(0,$.jsx)(X,{onClick:()=>{je(e.id)},type:`primary`,style:{flex:1,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,height:36,fontWeight:500,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},disabled:e.status!==`completed`,children:`下一步:生成图片`})]})]}),e.childId===3&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{borderRadius:12,overflow:`hidden`,marginBottom:16,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,border:`1px solid rgba(99, 102, 241, 0.08)`,boxShadow:`0 2px 8px rgba(99, 102, 241, 0.04)`,position:`relative`},children:[q.finalImageUrl?(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn${q.finalImageUrl}`,alt:`融合图`,style:{width:`100%`,height:180,objectFit:`cover`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:180,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:14},children:`暂无融合图`}),(0,$.jsx)(X,{type:`default`,icon:(0,$.jsx)(M$,{}),onClick:()=>Me(),disabled:e.status!==`completed`,style:{position:`absolute`,bottom:8,left:8,borderRadius:8,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:30,fontWeight:500,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(4px)`,padding:`0 12px`,fontSize:12},children:`重新生成`})]}),(0,$.jsx)(`p`,{style:{marginBottom:6,fontSize:14,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`视频参数选择:`}),(0,$.jsxs)(`div`,{style:{width:`100%`,display:`flex`,justifyContent:`space-between`,marginBottom:16},children:[(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>{k(!O),j(!1)},className:`image-settings-trigger`,style:{width:`100%`,padding:`4px 12px`,height:34,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,backgroundColor:`rgba(255,255,255,0.7)`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(C8,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsx)(D9,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:x.video?.find(e=>e.id===w)?.name||`选择引擎`})]}),O&&(0,$.jsx)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:-10,width:350,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:16,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:(0,$.jsxs)(`div`,{style:{marginBottom:8},children:[(0,$.jsx)(D9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择引擎`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:x.video?.map(e=>(0,$.jsxs)(`button`,{onClick:()=>{T(e.id),z({ratios:e.supportedRatios||[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:e.supportedResolutions||[`480p`,`720p`,`1080p`],durations:e.supportedDurations||[5,8,10,12,15]}),e.supportedRatios?.includes(P)||F(e.supportedRatios?.[0]||`16:9`),e.supportedResolutions?.includes(I)||L(e.supportedResolutions?.[0]||`720p`),e.supportedDurations?.includes(M)||N(e.supportedDurations?.[0]||5),k(!1)},style:{flex:1,minHeight:48,borderRadius:8,border:w===e.id?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:w===e.id?`#fff`:`#f9fafb`,cursor:`pointer`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`flex-start`,padding:`8px 12px`,transition:`all 0.2s`,textAlign:`left`},children:[(0,$.jsx)(`span`,{style:{fontSize:13,fontWeight:w===e.id?600:500,color:w===e.id?`#6366f1`:`#4b5563`,marginBottom:2},children:e.name}),(0,$.jsx)(`span`,{style:{fontSize:11,color:`#9ca3af`}})]},e.id))})]})})]}),(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>{j(!A),k(!1)},className:`image-settings-trigger`,style:{width:`100%`,padding:`4px 12px`,height:34,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,backgroundColor:`rgba(255,255,255,0.7)`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(V3,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsxs)(D9,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:[P,` · `,M,`s · `,I]})]}),A&&(0,$.jsxs)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:-160,width:350,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:16,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(D9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择比例`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:4},children:R.ratios.map(e=>(0,$.jsxs)(`button`,{onClick:()=>F(e),style:{flex:`0 0 calc(14.28% - 4px)`,minWidth:44,height:52,borderRadius:6,border:P===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:P===e?`#fff`:`#f9fafb`,cursor:`pointer`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:[(0,$.jsx)(`div`,{style:{width:18,height:18,border:`2px solid ${P===e?`#6366f1`:`#9ca3af`}`,borderRadius:2,marginBottom:2}}),(0,$.jsx)(`span`,{style:{fontSize:9,color:P===e?`#6366f1`:`#6b7280`,fontWeight:P===e?600:400},children:e})]},e))})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(D9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择时长`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,height:24,display:`flex`,alignItems:`center`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:`50%`,left:0,right:0,height:6,borderRadius:3,background:`#e5e7eb`,transform:`translateY(-50%)`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:`50%`,left:0,height:6,borderRadius:3,background:`#6366f1`,width:`${(M-Math.min(...R.durations))/(Math.max(...R.durations)-Math.min(...R.durations))*100}%`,transform:`translateY(-50%)`}}),(0,$.jsx)(`input`,{type:`range`,min:Math.min(...R.durations),max:Math.max(...R.durations),value:M,onChange:e=>N(Number(e.target.value)),style:{position:`relative`,width:`100%`,height:24,borderRadius:3,background:`transparent`,outline:`none`,appearance:`none`,cursor:`pointer`,zIndex:1}})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4,padding:`4px 12px`,backgroundColor:`#f1f5f9`,borderRadius:6},children:[(0,$.jsx)(`span`,{style:{fontSize:14,fontWeight:600,color:`#64748b`},children:M}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#9ca3af`},children:`秒`})]})]})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(D9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择分辨率`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:6},children:R.resolutions.map(e=>(0,$.jsx)(`button`,{onClick:()=>L(e),style:{flex:1,height:42,borderRadius:6,border:I===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:I===e?`#6366f1`:`#f9fafb`,cursor:`pointer`,display:`flex`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:600,color:I===e?`#fff`:`#4b5563`},children:e})},e))})]})]})]})]}),(0,$.jsx)(gw,{title:(n?.credits||0){if((n?.credits||0)De(q?.videoGeneration?.promptSchema,`video`,e.id,q?.videoGeneration?.schemaConfigSnapshot),style:{flex:1,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500,background:`rgba(99, 102, 241, 0.04)`},disabled:e.status!==`completed`||!q?.videoGeneration?.promptSchema||!q?.videoGeneration?.schemaConfigSnapshot,children:`查看/修改视频提词`}),(0,$.jsx)(X,{onClick:()=>{Pe(e.id,e.engineId)},type:`primary`,style:{flex:1,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,height:36,fontWeight:500,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},disabled:e.status!==`completed`,children:`下一步:生成视频`})]})]}),e.childId===5&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{borderRadius:12,overflow:`hidden`,marginBottom:16,position:`relative`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,border:`1px solid rgba(99, 102, 241, 0.08)`,boxShadow:`0 2px 8px rgba(99, 102, 241, 0.04)`},children:e.status===`completed`&&q?.finalVideoUrl?(0,$.jsx)(`video`,{src:`http://ceshi.apiforeign.minzhong.cn${q.finalVideoUrl}`,style:{width:`100%`,height:180,objectFit:`cover`},controls:!0}):e.status===`processing`?(0,$.jsxs)(`div`,{style:{width:`100%`,height:180,display:`flex`,alignItems:`center`,justifyContent:`center`,flexDirection:`column`,gap:8},children:[(0,$.jsx)(`div`,{style:{width:20,height:20,borderRadius:`50%`,border:`2px solid #e2e8f0`,borderTopColor:`#6366f1`,animation:`spinSlow 1s linear infinite`}}),(0,$.jsx)(`span`,{style:{color:`#6366f1`,fontSize:14},children:`视频生成中...`})]}):e.status===`failed`?(0,$.jsx)(`div`,{style:{width:`100%`,height:180,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#ef4444`,fontSize:14},children:`视频生成失败`}):(0,$.jsx)(`div`,{style:{width:`100%`,height:180,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:14},children:`暂无视频`})}),(0,$.jsxs)(sH,{style:{width:`100%`,gap:12},children:[(0,$.jsx)(X,{onClick:()=>Fe(),type:`default`,icon:(0,$.jsx)(M$,{}),style:{flex:1,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500,background:`rgba(99, 102, 241, 0.04)`},disabled:e.status!==`completed`,children:`重新生成`}),(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(m0,{}),style:{flex:1,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,height:36,fontWeight:500,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},disabled:e.status!==`completed`,onClick:()=>{let e=`http://ceshi.apiforeign.minzhong.cn${q?.finalVideoUrl}&download=1`,t=document.createElement(`a`);t.href=e,t.download=`video_${Date.now()}.mp4`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},children:`下载视频`})]})]})]})}))})})]})]})}),(0,$.jsx)(mK,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,$.jsx)(`div`,{style:{width:4,height:18,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:15,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:l===`video`?`查看/编辑视频提词`:`修改提示词`})]}),open:r,onCancel:()=>{_||i(!1)},footer:[(0,$.jsx)(X,{onClick:()=>i(!1),disabled:_,style:{borderRadius:8},children:`取消`},`cancel`),(0,$.jsx)(X,{type:`primary`,onClick:Oe,loading:_,disabled:_,style:{borderRadius:8,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`确认`},`confirm`)],width:800,style:{borderRadius:16},styles:{header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,padding:`16px 24px`},body:{background:`linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #f0f9ff 100%)`,padding:`20px 24px`}},children:l===`image`?(0,$.jsx)(dse,{value:a,onChange:e=>o(e.target.value),rows:8,style:{width:`100%`,height:300,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`},placeholder:`请输入提示词`}):(0,$.jsx)(`div`,{style:{maxHeight:500,overflowY:`auto`,paddingRight:10},children:(0,$.jsx)(E9,{value:d,schemaConfigSnapshot:p,onChange:f})})}),(0,$.jsxs)(mK,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`创作记录`})]}),open:s,onCancel:()=>c(!1),width:850,footer:null,style:{borderRadius:20},styles:{body:{height:580,display:`flex`,flexDirection:`column`,padding:0},header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,padding:`16px 24px`}},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,margin:`16px 24px`,flexShrink:0},children:[(0,$.jsx)(IW,{placeholder:`搜索产品名称`,value:oe,onChange:e=>K(e.target.value),onPressEnter:Te,style:{width:220,borderRadius:10,marginRight:10,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`}}),(0,$.jsx)(X,{type:`primary`,onClick:Te,style:{borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`搜索`})]}),(0,$.jsx)(LQ,{columns:[{title:`产品名称`,dataIndex:`targetProjectName`,key:`targetProjectName`,align:`center`},{title:`状态`,dataIndex:`status`,key:`status`,align:`center`,render:(e,t)=>{let n=e,r=t.current_step_code||t.currentStepCode,i=(()=>{if(r===`image_prompt_optimize`)switch(n){case`waiting_user`:return{text:`等待融合图生成`,color:`#f59e0b`};case`processing`:return{text:`图片提示词生成中`,color:`#f59e0b`};case`completed`:return{text:`图片提示词生成成功`,color:`#10b981`};case`failed`:return{text:`图片提示词生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`image_generate`)switch(n){case`waiting_user`:return{text:`等待生成视频提示词`,color:`#f59e0b`};case`processing`:return{text:`融合图生成中`,color:`#f59e0b`};case`completed`:return{text:`融合图生成成功`,color:`#10b981`};case`failed`:return{text:`融合图生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`video_prompt_optimize`)switch(n){case`waiting_user`:return{text:`等待最终视频生成`,color:`#f59e0b`};case`processing`:return{text:`视频提示词生成中`,color:`#f59e0b`};case`completed`:return{text:`视频提示词生成成功`,color:`#10b981`};case`failed`:return{text:`视频提示词生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`video_generate`)switch(n){case`waiting_user`:return{text:``,color:`#666`};case`processing`:return{text:`最终视频生成中`,color:`#f59e0b`};case`completed`:return{text:`任务完成`,color:`#10b981`};case`failed`:return{text:`最终视频生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`material_input`)switch(n){case`waiting_user`:return{text:`等待生成图片提示词`,color:`#f59e0b`};case`processing`:return{text:`素材处理中`,color:`#f59e0b`};case`completed`:return{text:`素材上传成功`,color:`#10b981`};case`failed`:return{text:`素材上传失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else return{pending:{text:`子任务待处理`,color:`#f59e0b`},waiting_user:{text:`等待用户确认或触发`,color:`#f59e0b`},processing:{text:`子任务处理中`,color:`#f59e0b`},completed:{text:`子任务完成`,color:`#10b981`},failed:{text:`子任务失败`,color:`#ef4444`},cancelled:{text:`子任务取消`,color:`#94a3b8`}}[n]||{text:n||`-`,color:`#666`}})();return typeof i==`string`?(0,$.jsx)(`span`,{style:{fontSize:12,color:`#666`,fontWeight:500},children:i}):(0,$.jsx)(`span`,{style:{fontSize:12,color:i.color,fontWeight:500},children:i.text})}},{title:`创建时间`,dataIndex:`createdAt`,key:`createdAt`,align:`center`,render:e=>{if(!e)return`-`;let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)} ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`}},{title:`操作`,key:`action`,align:`center`,render:(t,n)=>(0,$.jsx)(`button`,{onClick:()=>e(`/initial/${n.id}/initialinfo`),style:{color:`#6366f1`,textDecoration:`none`,fontSize:12,border:`none`,background:`rgba(99, 102, 241, 0.08)`,padding:`4px 12px`,borderRadius:8,cursor:`pointer`,transition:`all 0.2s`,fontWeight:500},children:`查看详情`})}],dataSource:W,rowKey:`id`,pagination:{current:te,pageSize:ne,total:ie,showSizeChanger:!0,showQuickJumper:!0,showTotal:e=>`共 ${e} 条`,onChange:we},style:{fontSize:13},scroll:{y:350}})]}),(0,$.jsx)(mK,{open:fe,title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(180deg, #8b5cf6 0%, #ddd6fe 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:700,color:`#8b5cf6`,letterSpacing:.4},children:`预览`})]}),onCancel:be,width:800,footer:(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:12,padding:`16px 24px`,background:`rgba(255,255,255,0.6)`,borderTop:`1px solid rgba(139, 92, 246, 0.08)`},children:(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(m0,{}),onClick:xe,style:{borderRadius:10,background:`linear-gradient(135deg, #8b5cf6 0%, #ddd6fe 100%)`,border:`none`,boxShadow:`0 8px 18px rgba(47, 52, 64, 0.15)`},children:`下载`})}),centered:!0,style:{borderRadius:16},styles:{body:{display:`flex`,alignItems:`center`,justifyContent:`center`,minHeight:`400px`},header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(139, 92, 246, 0.08)`,padding:`16px 24px`}},children:(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:`100%`,height:`100%`},children:ge===`image`?(0,$.jsx)(`img`,{src:me.startsWith(`http`)?me:`http://ceshi.apiforeign.minzhong.cn${me}`,alt:`预览`,style:{width:`100%`,maxHeight:`400px`,objectFit:`contain`}}):(0,$.jsx)(`video`,{ref:ve,src:me.startsWith(`http`)?me:`http://ceshi.apiforeign.minzhong.cn${me}`,controls:!0,style:{maxWidth:`100%`,maxHeight:`400px`}})})})]})}var mse={pending_analysis:{label:`等待分析`,color:`default`},analyzing:{label:`分析中`,color:`processing`},analysis_completed:{label:`分析完成`,color:`blue`},analysis_failed:{label:`分析失败`,color:`red`},splitting:{label:`拆镜中`,color:`processing`},split_completed:{label:`拆镜完成`,color:`green`},partial_failed:{label:`部分失败`,color:`orange`},failed:{label:`失败`,color:`red`},deleted:{label:`已软删`,color:`default`}},hse=e=>{let t=mse[e]||{label:e,color:`default`};return(0,$.jsx)(XQ,{color:t.color,children:t.label})};function gse(){let e=Ye(),[t,n]=(0,S.useState)(``),[r,i]=(0,S.useState)(``),[a,o]=(0,S.useState)(``),[s,c]=(0,S.useState)(!1),[l,u]=(0,S.useState)(``),[d,f]=(0,S.useState)(0),[p,m]=(0,S.useState)(!1),[h,g]=(0,S.useState)([]),[_,v]=(0,S.useState)(1),[y,b]=(0,S.useState)(10),[x,C]=(0,S.useState)(0),[w,T]=(0,S.useState)(``),E=(0,S.useRef)(null),D=(0,S.useRef)(null),O=(0,S.useCallback)(()=>{t&&URL.revokeObjectURL(t),n(``),i(``),o(``),f(0),u(``)},[t]),k=async e=>{if(!e.type.startsWith(`video/`))return o(`请选择视频文件`),!1;if(e.size>100*1024*1024)return o(`视频文件大小不能超过 100MB`),!1;let t=await new Promise(t=>{let n=document.createElement(`video`);n.preload=`metadata`,n.onloadedmetadata=()=>{t(n.duration),URL.revokeObjectURL(n.src)},n.onerror=()=>{t(0)},n.src=URL.createObjectURL(e)});if(t>60)return o(`视频时长不能超过 1分钟`),!1;O(),m(!0);try{let r=await Mie(e,t);n(r.url),i(r.resource_id||``),o(``),Z.success(`视频上传成功`)}catch{o(`视频上传失败,请重试`),Z.error(`视频上传失败`)}finally{m(!1)}return!1},A=(0,S.useCallback)(()=>{E.current&&f(E.current.duration)},[]),j=async()=>{if(!t||!l.trim()){Z.warning(`请先上传视频并输入产品名称`);return}m(!0);try{eae({video_url:t,video_duration_seconds:d,video_resource_id:r||void 0,title:l.trim(),idempotency_key:`shot_${Date.now()}`}).then(t=>{Q5(1,20,w).then(t=>{Z.loading(`创建中...`,3),setTimeout(()=>{e(`/removelens/${t.items[0].id}/removeinfo`)},3e3)})}),O()}catch{Z.error(`任务创建失败,请重试`)}finally{m(!1)}},M=async(e,t,n)=>{try{let r=await Q5(e,t,n);g(r.items||[]),C(r.total||0),v(e),b(t)}catch{Z.error(`获取列表失败`)}},N=(e,t)=>{M(e,t,w)},P=()=>{M(1,10,w)};return(0,$.jsx)(`div`,{style:{margin:`-24px -32px -32px`,borderRadius:20,minHeight:`calc(100vh - 34px)`,overflow:`auto`,background:`transparent`,position:`relative`,padding:`20px 32px`},children:(0,$.jsxs)(`div`,{style:{maxWidth:1200,margin:`0 auto`,position:`relative`,zIndex:10},children:[(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:24,padding:`16px 24px`,borderRadius:16,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(139, 92, 246, 0.04) 100%)`,backdropFilter:`blur(10px)`,border:`1px solid rgba(99, 102, 241, 0.08)`,position:`relative`,overflow:`hidden`,flexWrap:`wrap`,gap:12},children:[(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16},children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{style:{margin:0,fontSize:18,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`AI视频拆镜工作台`}),(0,$.jsx)(`p`,{style:{fontSize:13,color:`#64748b`,margin:`4px 0 0 0`},children:`精细化镜头复刻工具,拆分参考视频单镜头独立复刻,提升素材原创度,规避素材同质化`})]})}),(0,$.jsx)(X,{type:`primary`,ghost:!0,icon:(0,$.jsx)(fH,{}),onClick:()=>{c(!0),M(1,10,w)},style:{borderRadius:10,padding:`6px 16px`,fontSize:13,background:`rgba(99, 102, 241, 0.1)`,borderColor:`rgba(99, 102, 241, 0.2)`,color:`#6366f1`},children:`创作记录`})]}),(0,$.jsxs)(`div`,{style:{width:`100%`,maxWidth:720,margin:`0 auto`},children:[a&&(0,$.jsx)(`div`,{style:{background:`linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%)`,backdropFilter:`blur(10px)`,border:`1px solid rgba(239, 68, 68, 0.2)`,borderRadius:12,padding:`14px 20px`,marginBottom:24,color:`#ef4444`,fontSize:14,textAlign:`center`,fontWeight:500},children:a}),!t&&(0,$.jsxs)(`div`,{style:{background:`linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.85) 100%)`,backdropFilter:`blur(20px)`,borderRadius:24,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`,position:`relative`,overflow:`hidden`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:-50,right:-50,width:200,height:200,background:`radial-gradient(circle, rgba(99,102,241,0.05) 0%, transparent 70%)`,borderRadius:`50%`}}),(0,$.jsx)(b0.Dragger,{accept:`video/*`,beforeUpload:k,showUploadList:!1,disabled:p,style:{background:p?`rgba(243, 244, 246, 0.3)`:`transparent`,border:`2px dashed ${p?`rgba(209, 213, 219, 0.5)`:`rgba(99, 102, 241, 0.3)`}`,borderRadius:24,padding:`56px 20px`,cursor:p?`not-allowed`:`pointer`,margin:0},children:p?(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`},children:[(0,$.jsx)(`div`,{style:{width:100,height:100,margin:`0 auto 20px`,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%)`,borderRadius:24,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`div`,{style:{width:40,height:40,border:`4px solid #6366f1`,borderTopColor:`transparent`,borderRadius:`50%`,animation:`spin 1s linear infinite`}})}),(0,$.jsx)(`p`,{style:{fontSize:16,color:`#6366f1`,margin:`0 0 8px 0`,fontWeight:600},children:`上传中...`}),(0,$.jsx)(`p`,{style:{fontSize:13,color:`#64748b`,margin:0},children:`请稍候,视频正在上传`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{width:100,height:100,margin:`0 auto 20px`,background:`linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%)`,borderRadius:24,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(C4,{style:{fontSize:40,color:`#6366f1`}})}),(0,$.jsx)(`p`,{style:{fontSize:16,color:`#1e293b`,margin:`0 0 8px 0`,fontWeight:600},children:`点击或拖拽到此上传视频文件`}),(0,$.jsx)(`p`,{style:{fontSize:13,color:`#64748b`,margin:0},children:`支持 MP4、MOV 格式视频,最大支持 100MB 的文件,支持上传 1 分钟内的视频`})]})})]}),t&&(0,$.jsxs)(`div`,{style:{background:`linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.85) 100%)`,backdropFilter:`blur(20px)`,borderRadius:24,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`,overflow:`hidden`,position:`relative`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:-50,right:-50,width:200,height:200,background:`radial-gradient(circle, rgba(99,102,241,0.05) 0%, transparent 70%)`,borderRadius:`50%`}}),(0,$.jsxs)(`div`,{style:{borderRadius:22,background:`#ffffff`,padding:`24px`,position:`relative`,zIndex:1},children:[(0,$.jsx)(vK,{title:`确定要删除吗?`,okText:`确定`,cancelText:`取消`,onConfirm:O,children:(0,$.jsx)(`button`,{style:{position:`absolute`,top:20,right:20,width:36,height:36,border:`1px solid rgba(99, 102, 241, 0.2)`,background:`rgba(99, 102, 241, 0.05)`,borderRadius:10,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:16,color:`#6366f1`,zIndex:10,transition:`all 0.2s ease`},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(239, 68, 68, 0.1)`,e.currentTarget.style.borderColor=`rgba(239, 68, 68, 0.3)`,e.currentTarget.style.color=`#ef4444`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(99, 102, 241, 0.05)`,e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.2)`,e.currentTarget.style.color=`#6366f1`},children:`🗑️`})}),(0,$.jsx)(`div`,{style:{textAlign:`center`,marginBottom:20},children:(0,$.jsx)(`video`,{ref:E,src:`http://ceshi.apiforeign.minzhong.cn${t}`,controls:!0,onLoadedMetadata:A,style:{maxWidth:`100%`,maxHeight:320,borderRadius:12,background:`#000`,boxShadow:`0 4px 16px rgba(0,0,0,0.1)`}})}),(0,$.jsxs)(`div`,{style:{marginBottom:24},children:[(0,$.jsxs)(`label`,{style:{display:`block`,fontSize:14,fontWeight:500,color:`#334155`,marginBottom:8},children:[`产品名称 `,(0,$.jsx)(`span`,{style:{color:`#ef4444`},children:`*`})]}),(0,$.jsx)(IW,{placeholder:`请输入产品名称`,value:l,onChange:e=>u(e.target.value),style:{width:`100%`,height:44,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.2)`,transition:`all 0.2s ease`},onMouseEnter:e=>{e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.4)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.2)`}})]}),(0,$.jsx)(`div`,{style:{textAlign:`center`,marginTop:16},children:(0,$.jsx)(`button`,{onClick:j,disabled:!t||!l.trim()||p,style:{padding:`14px 56px`,background:t&&l.trim()&&!p?`linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%)`:`#e2e8f0`,color:`white`,border:`none`,borderRadius:12,fontSize:15,fontWeight:600,cursor:t&&l.trim()&&!p?`pointer`:`not-allowed`,boxShadow:t&&l.trim()&&!p?`0 6px 20px rgba(99, 102, 241, 0.3)`:`none`,display:`inline-flex`,alignItems:`center`,gap:10,transition:`all 0.3s ease`},onMouseEnter:e=>{t&&l.trim()&&!p&&(e.currentTarget.style.transform=`translateY(-2px)`,e.currentTarget.style.boxShadow=`0 8px 25px rgba(99, 102, 241, 0.4)`)},onMouseLeave:e=>{t&&l.trim()&&!p&&(e.currentTarget.style.transform=`translateY(0)`,e.currentTarget.style.boxShadow=`0 6px 20px rgba(99, 102, 241, 0.3)`)},children:(0,$.jsx)(`span`,{children:p?`创建中...`:`创建`})})})]})]}),(0,$.jsx)(`canvas`,{ref:D,style:{display:`none`}}),(0,$.jsxs)(mK,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`创作记录`})]}),open:s,onCancel:()=>c(!1),width:850,footer:null,style:{borderRadius:20},styles:{body:{height:580,display:`flex`,flexDirection:`column`,padding:0},header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,padding:`16px 24px`}},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,margin:`16px 24px`,flexShrink:0},children:[(0,$.jsx)(IW,{placeholder:`搜索产品名称`,value:w,onChange:e=>T(e.target.value),onPressEnter:P,style:{width:220,borderRadius:10,marginRight:10,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`}}),(0,$.jsx)(X,{type:`primary`,onClick:P,style:{borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`搜索`})]}),(0,$.jsx)(`div`,{style:{flex:1,overflow:`auto`,padding:`0 24px 24px`},children:(0,$.jsx)(`div`,{style:{background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(10px)`,borderRadius:16,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.08)`,boxShadow:`0 4px 16px rgba(99, 102, 241, 0.06)`},children:(0,$.jsx)(LQ,{columns:[{dataIndex:`title`,key:`title`,render:e=>(0,$.jsx)(`span`,{style:{fontSize:14,color:`#1e293b`,fontWeight:500},children:e})},{title:`状态`,dataIndex:`status`,key:`status`,render:e=>hse(e)},{title:`创建时间`,dataIndex:`createdAt`,key:`createdAt`,render:e=>{if(!e)return`-`;let t=new Date(e);return(0,$.jsx)(`span`,{style:{fontSize:13,color:`#64748b`},children:`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)} ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`})}},{title:`操作`,key:`action`,align:`center`,render:t=>(0,$.jsxs)(sH,{children:[(0,$.jsx)(X,{type:`text`,onClick:()=>e(`/removelens/${t.id}/removeinfo`),style:{color:`#6366f1`,fontSize:13,padding:`4px 12px`,borderRadius:6,background:`rgba(99, 102, 241, 0.1)`},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(99, 102, 241, 0.15)`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(99, 102, 241, 0.1)`},children:`查看详情`}),(0,$.jsx)(vK,{title:`确认删除这个拆镜项目吗?`,onConfirm:async()=>{try{await fae(t.id),Z.success(`删除成功`),M(_,y,w)}catch{Z.error(`删除失败`)}},children:(0,$.jsx)(X,{type:`text`,danger:!0,style:{color:`#ef4444`,fontSize:13,padding:`4px 12px`,borderRadius:6,background:`rgba(239, 68, 68, 0.1)`},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(239, 68, 68, 0.15)`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(239, 68, 68, 0.1)`},children:`删除`})})]})}],dataSource:h,rowKey:`id`,pagination:{current:_,pageSize:y,total:x,showSizeChanger:!0,showQuickJumper:!0,showTotal:e=>`共 ${e} 条`,onChange:N,style:{padding:`16px 24px`,borderTop:`1px solid rgba(99, 102, 241, 0.1)`}},style:{fontSize:13},scroll:{y:300},components:{body:{row:({className:e,style:t,...n})=>(0,$.jsx)(`tr`,{...n,className:e,style:{...t,transition:`all 0.2s ease`,borderBottom:`1px solid rgba(99, 102, 241, 0.05)`}}),cell:({className:e,style:t,...n})=>(0,$.jsx)(`td`,{...n,className:e,style:{...t,padding:`16px 24px`}})},header:{cell:({className:e,style:t,...n})=>(0,$.jsx)(`th`,{...n,className:e,style:{...t,background:`rgba(99, 102, 241, 0.03)`,color:`#64748b`,fontWeight:500,fontSize:13,padding:`16px 24px`,borderBottom:`none`}})}}})})})]})]})]})})}var _se=c(o(((e,t)=>{(function(n){typeof e==`object`&&t!==void 0?t.exports=n():typeof define==`function`&&define.amd?define([],n):(typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:this).JSZip=n()})(function(){return function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var c=typeof l==`function`&&l;if(!s&&c)return c(o,!0);if(a)return a(o,!0);var u=Error(`Cannot find module '`+o+`'`);throw u.code=`MODULE_NOT_FOUND`,u}var d=n[o]={exports:{}};t[o][0].call(d.exports,function(e){var n=t[o][1][e];return i(n||e)},d,d.exports,e,t,n,r)}return n[o].exports}for(var a=typeof l==`function`&&l,o=0;o>2,s=(3&t)<<4|n>>4,c=1>6:64,l=2>4,n=(15&o)<<4|(s=a.indexOf(e.charAt(l++)))>>2,r=(3&s)<<6|(c=a.indexOf(e.charAt(l++))),f[u++]=t,s!==64&&(f[u++]=n),c!==64&&(f[u++]=r);return f}},{"./support":30,"./utils":32}],2:[function(e,t,n){var r=e(`./external`),i=e(`./stream/DataWorker`),a=e(`./stream/Crc32Probe`),o=e(`./stream/DataLengthProbe`);function s(e,t,n,r,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=r,this.compressedContent=i}s.prototype={getContentWorker:function(){var e=new i(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o(`data_length`)),t=this;return e.on(`end`,function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw Error(`Bug : uncompressed data size mismatch`)}),e},getCompressedWorker:function(){return new i(r.Promise.resolve(this.compressedContent)).withStreamInfo(`compressedSize`,this.compressedSize).withStreamInfo(`uncompressedSize`,this.uncompressedSize).withStreamInfo(`crc32`,this.crc32).withStreamInfo(`compression`,this.compression)}},s.createWorkerFrom=function(e,t,n){return e.pipe(new a).pipe(new o(`uncompressedSize`)).pipe(t.compressWorker(n)).pipe(new o(`compressedSize`)).withStreamInfo(`compression`,t)},t.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){var r=e(`./stream/GenericWorker`);n.STORE={magic:`\0\0`,compressWorker:function(){return new r(`STORE compression`)},uncompressWorker:function(){return new r(`STORE decompression`)}},n.DEFLATE=e(`./flate`)},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,n){var r=e(`./utils`),i=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t){return e!==void 0&&e.length?r.getTypeOf(e)===`string`?function(e,t,n,r){var a=i,o=r+n;e^=-1;for(var s=r;s>>8^a[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length,0):function(e,t,n,r){var a=i,o=r+n;e^=-1;for(var s=r;s>>8^a[255&(e^t[s])];return-1^e}(0|t,e,e.length,0):0}},{"./utils":32}],5:[function(e,t,n){n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,t,n){var r=null;r=typeof Promise<`u`?Promise:e(`lie`),t.exports={Promise:r}},{lie:37}],7:[function(e,t,n){var r=typeof Uint8Array<`u`&&typeof Uint16Array<`u`&&typeof Uint32Array<`u`,i=e(`pako`),a=e(`./utils`),o=e(`./stream/GenericWorker`),s=r?`uint8array`:`array`;function c(e,t){o.call(this,`FlateWorker/`+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}n.magic=`\b\0`,a.inherits(c,o),c.prototype.processChunk=function(e){this.meta=e.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(s,e.data),!1)},c.prototype.flush=function(){o.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},c.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},c.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},n.compressWorker=function(e){return new c(`Deflate`,e)},n.uncompressWorker=function(){return new c(`Inflate`,{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,n){function r(e,t){var n,r=``;for(n=0;n>>=8;return r}function i(e,t,n,i,o,u){var d,f,p=e.file,m=e.compression,h=u!==s.utf8encode,g=a.transformTo(`string`,u(p.name)),_=a.transformTo(`string`,s.utf8encode(p.name)),v=p.comment,y=a.transformTo(`string`,u(v)),b=a.transformTo(`string`,s.utf8encode(v)),x=_.length!==p.name.length,S=b.length!==v.length,C=``,w=``,T=``,E=p.dir,D=p.date,O={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(O.crc32=e.crc32,O.compressedSize=e.compressedSize,O.uncompressedSize=e.uncompressedSize);var k=0;t&&(k|=8),h||!x&&!S||(k|=2048);var A=0,j=0;E&&(A|=16),o===`UNIX`?(j=798,A|=function(e,t){var n=e;return e||(n=t?16893:33204),(65535&n)<<16}(p.unixPermissions,E)):(j=20,A|=function(e){return 63&(e||0)}(p.dosPermissions)),d=D.getUTCHours(),d<<=6,d|=D.getUTCMinutes(),d<<=5,d|=D.getUTCSeconds()/2,f=D.getUTCFullYear()-1980,f<<=4,f|=D.getUTCMonth()+1,f<<=5,f|=D.getUTCDate(),x&&(w=r(1,1)+r(c(g),4)+_,C+=`up`+r(w.length,2)+w),S&&(T=r(1,1)+r(c(y),4)+b,C+=`uc`+r(T.length,2)+T);var M=``;return M+=` +\0`,M+=r(k,2),M+=m.magic,M+=r(d,2),M+=r(f,2),M+=r(O.crc32,4),M+=r(O.compressedSize,4),M+=r(O.uncompressedSize,4),M+=r(g.length,2),M+=r(C.length,2),{fileRecord:l.LOCAL_FILE_HEADER+M+g+C,dirRecord:l.CENTRAL_FILE_HEADER+r(j,2)+M+r(y.length,2)+`\0\0\0\0`+r(A,4)+r(i,4)+g+C+y}}var a=e(`../utils`),o=e(`../stream/GenericWorker`),s=e(`../utf8`),c=e(`../crc32`),l=e(`../signature`);function u(e,t,n,r){o.call(this,`ZipFileWorker`),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=r,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(u,o),u.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,o.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-r-1))/n:100}}))},u.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},u.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,n=i(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),t)this.push({data:function(e){return l.DATA_DESCRIPTOR+r(e.crc32,4)+r(e.compressedSize,4)+r(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},u.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return r.transformTo(`string`,this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{"../utils":32}],19:[function(e,t,n){var r=e(`./Uint8ArrayReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,n){var r=e(`./DataReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],21:[function(e,t,n){var r=e(`./ArrayReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.readData=function(e){if(this.checkOffset(e),e===0)return new Uint8Array;var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,n){var r=e(`../utils`),i=e(`../support`),a=e(`./ArrayReader`),o=e(`./StringReader`),s=e(`./NodeBufferReader`),c=e(`./Uint8ArrayReader`);t.exports=function(e){var t=r.getTypeOf(e);return r.checkSupport(t),t!==`string`||i.uint8array?t===`nodebuffer`?new s(e):i.uint8array?new c(r.transformTo(`uint8array`,e)):new a(r.transformTo(`array`,e)):new o(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,n){n.LOCAL_FILE_HEADER=`PK`,n.CENTRAL_FILE_HEADER=`PK`,n.CENTRAL_DIRECTORY_END=`PK`,n.ZIP64_CENTRAL_DIRECTORY_LOCATOR=`PK\x07`,n.ZIP64_CENTRAL_DIRECTORY_END=`PK`,n.DATA_DESCRIPTOR=`PK\x07\b`},{}],24:[function(e,t,n){var r=e(`./GenericWorker`),i=e(`../utils`);function a(e){r.call(this,`ConvertWorker to `+e),this.destType=e}i.inherits(a,r),a.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,n){var r=e(`./GenericWorker`),i=e(`../crc32`);function a(){r.call(this,`Crc32Probe`),this.withStreamInfo(`crc32`,0)}e(`../utils`).inherits(a,r),a.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,n){var r=e(`../utils`),i=e(`./GenericWorker`);function a(e){i.call(this,`DataLengthProbe for `+e),this.propName=e,this.withStreamInfo(e,0)}r.inherits(a,i),a.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,n){var r=e(`../utils`),i=e(`./GenericWorker`);function a(e){i.call(this,`DataWorker`);var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type=``,this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=r.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}r.inherits(a,i),a.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,r.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case`string`:e=this.data.substring(this.index,t);break;case`uint8array`:e=this.data.subarray(this.index,t);break;case`array`:case`nodebuffer`:e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,n){function r(e){this.name=e||`default`,this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}r.prototype={push:function(e){this.emit(`data`,e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit(`end`),this.cleanUp(),this.isFinished=!0}catch(e){this.emit(`error`,e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit(`error`,e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var n=0;n `+e:e}},t.exports=r},{}],29:[function(e,t,n){var r=e(`../utils`),i=e(`./ConvertWorker`),a=e(`./GenericWorker`),o=e(`../base64`),s=e(`../support`),c=e(`../external`),l=null;if(s.nodestream)try{l=e(`../nodejs/NodejsStreamOutputAdapter`)}catch{}function u(e,t){return new c.Promise(function(n,i){var a=[],s=e._internalType,c=e._outputType,l=e._mimeType;e.on(`data`,function(e,n){a.push(e),t&&t(n)}).on(`error`,function(e){a=[],i(e)}).on(`end`,function(){try{n(function(e,t,n){switch(e){case`blob`:return r.newBlob(r.transformTo(`arraybuffer`,t),n);case`base64`:return o.encode(t);default:return r.transformTo(e,t)}}(c,function(e,t){var n,r=0,i=null,a=0;for(n=0;n`u`)n.blob=!1;else{var r=new ArrayBuffer(0);try{n.blob=new Blob([r],{type:`application/zip`}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(r),n.blob=i.getBlob(`application/zip`).size===0}catch{n.blob=!1}}}try{n.nodestream=!!e(`readable-stream`).Readable}catch{n.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,n){for(var r=e(`./utils`),i=e(`./support`),a=e(`./nodejsUtils`),o=e(`./stream/GenericWorker`),s=Array(256),c=0;c<256;c++)s[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;s[254]=s[254]=1;function l(){o.call(this,`utf-8 decode`),this.leftOver=null}function u(){o.call(this,`utf-8 encode`)}n.utf8encode=function(e){return i.nodebuffer?a.newBufferFrom(e,`utf-8`):function(e){var t,n,r,a,o,s=e.length,c=0;for(a=0;a>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t}(e)},n.utf8decode=function(e){return i.nodebuffer?r.transformTo(`nodebuffer`,e).toString(`utf-8`):function(e){var t,n,i,a,o=e.length,c=Array(2*o);for(t=n=0;t>10&1023,c[n++]=56320|1023&i)}return c.length!==n&&(c.subarray?c=c.subarray(0,n):c.length=n),r.applyFromCharCode(c)}(e=r.transformTo(i.uint8array?`uint8array`:`array`,e))},r.inherits(l,o),l.prototype.processChunk=function(e){var t=r.transformTo(i.uint8array?`uint8array`:`array`,e.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var a=t;(t=new Uint8Array(a.length+this.leftOver.length)).set(this.leftOver,0),t.set(a,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var o=function(e,t){var n;for((t||=e.length)>e.length&&(t=e.length),n=t-1;0<=n&&(192&e[n])==128;)n--;return n<0||n===0?t:n+s[e[n]]>t?n:t}(t),c=t;o!==t.length&&(i.uint8array?(c=t.subarray(0,o),this.leftOver=t.subarray(o,t.length)):(c=t.slice(0,o),this.leftOver=t.slice(o,t.length))),this.push({data:n.utf8decode(c),meta:e.meta})},l.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=l,r.inherits(u,o),u.prototype.processChunk=function(e){this.push({data:n.utf8encode(e.data),meta:e.meta})},n.Utf8EncodeWorker=u},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,n){var r=e(`./support`),i=e(`./base64`),a=e(`./nodejsUtils`),o=e(`./external`);function s(e){return e}function c(e,t){for(var n=0;n>8;this.dir=!!(16&this.externalFileAttributes),e==0&&(this.dosPermissions=63&this.externalFileAttributes),e==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!==`/`||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=r(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,n,r,i=e.index+this.extraFieldsLength;for(this.extraFields||={};e.index+4>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t},n.buf2binstring=function(e){return c(e,e.length)},n.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,i=t.length;n>10&1023,l[r++]=56320|1023&i)}return c(l,r)},n.utf8border=function(e,t){var n;for((t||=e.length)>e.length&&(t=e.length),n=t-1;0<=n&&(192&e[n])==128;)n--;return n<0||n===0?t:n+o[e[n]]>t?n:t}},{"./common":41}],43:[function(e,t,n){t.exports=function(e,t,n,r){for(var i=65535&e|0,a=e>>>16&65535|0,o=0;n!==0;){for(n-=o=2e3>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,i){var a=r,o=i+n;e^=-1;for(var s=i;s>>8^a[255&(e^t[s])];return-1^e}},{}],46:[function(e,t,n){var r,i=e(`../utils/common`),a=e(`./trees`),o=e(`./adler32`),s=e(`./crc32`),c=e(`./messages`),l=0,u=4,d=0,f=-2,p=-1,m=4,h=2,g=8,_=9,v=286,y=30,b=19,x=2*v+1,S=15,C=3,w=258,T=w+C+1,E=42,D=113,O=1,k=2,A=3,j=4;function M(e,t){return e.msg=c[t],t}function N(e){return(e<<1)-(4e.avail_out&&(n=e.avail_out),n!==0&&(i.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))}function I(e,t){a._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,F(e.strm)}function L(e,t){e.pending_buf[e.pending++]=t}function R(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function z(e,t){var n,r,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-T?e.strstart-(e.w_size-T):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+w,p=l[a+o-1],m=l[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do if(l[(n=t)+o]===m&&l[n+o-1]===p&&l[n]===l[a]&&l[++n]===l[a+1]){a+=2,n++;do;while(l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&ac&&--i!=0);return o<=e.lookahead?o:e.lookahead}function B(e){var t,n,r,a,c,l,u,d,f,p,m=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=m+(m-T)){for(i.arraySet(e.window,e.window,m,m,0),e.match_start-=m,e.strstart-=m,e.block_start-=m,t=n=e.hash_size;r=e.head[--t],e.head[t]=m<=r?r-m:0,--n;);for(t=n=m;r=e.prev[--t],e.prev[t]=m<=r?r-m:0,--n;);a+=m}if(e.strm.avail_in===0)break;if(l=e.strm,u=e.window,d=e.strstart+e.lookahead,f=a,p=void 0,p=l.avail_in,f=C)for(c=e.strstart-e.insert,e.ins_h=e.window[c],e.ins_h=(e.ins_h<=C&&(e.ins_h=(e.ins_h<=C)if(r=a._tr_tally(e,e.strstart-e.match_start,e.match_length-C),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=C){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=C&&(e.ins_h=(e.ins_h<=C&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-C,r=a._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-C),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(B(e),e.lookahead===0&&t===l)return O;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,I(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-T&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(I(e,!0),e.strm.avail_out===0?A:j):(e.strstart>e.block_start&&(I(e,!1),e.strm.avail_out),O)}),new U(4,4,8,4,V),new U(4,5,16,8,V),new U(4,6,32,32,V),new U(4,4,16,16,H),new U(8,16,32,32,H),new U(8,16,128,128,H),new U(8,32,128,256,H),new U(32,128,258,1024,H),new U(32,258,258,4096,H)],n.deflateInit=function(e,t){return G(e,t,g,15,8,0)},n.deflateInit2=G,n.deflateReset=te,n.deflateResetKeep=ee,n.deflateSetHeader=function(e,t){return e&&e.state&&e.state.wrap===2?(e.state.gzhead=t,d):f},n.deflate=function(e,t){var n,i,o,c;if(!e||!e.state||5>8&255),L(i,i.gzhead.time>>16&255),L(i,i.gzhead.time>>24&255),L(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),L(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(L(i,255&i.gzhead.extra.length),L(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(L(i,0),L(i,0),L(i,0),L(i,0),L(i,0),L(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),L(i,3),i.status=D);else{var p=g+(i.w_bits-8<<4)<<8;p|=(2<=i.strategy||i.level<2?0:i.level<6?1:i.level===6?2:3)<<6,i.strstart!==0&&(p|=32),p+=31-p%31,i.status=D,R(i,p),i.strstart!==0&&(R(i,e.adler>>>16),R(i,65535&e.adler)),e.adler=1}if(i.status===69)if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),F(e),o=i.pending,i.pending!==i.pending_buf_size));)L(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(i.status===73)if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),F(e),o=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindexo&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),c===0&&(i.gzindex=0,i.status=91)}else i.status=91;if(i.status===91)if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),F(e),o=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindexo&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),c===0&&(i.status=103)}else i.status=103;if(i.status===103&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&F(e),i.pending+2<=i.pending_buf_size&&(L(i,255&e.adler),L(i,e.adler>>8&255),e.adler=0,i.status=D)):i.status=D),i.pending!==0){if(F(e),e.avail_out===0)return i.last_flush=-1,d}else if(e.avail_in===0&&N(t)<=N(n)&&t!==u)return M(e,-5);if(i.status===666&&e.avail_in!==0)return M(e,-5);if(e.avail_in!==0||i.lookahead!==0||t!==l&&i.status!==666){var m=i.strategy===2?function(e,t){for(var n;;){if(e.lookahead===0&&(B(e),e.lookahead===0)){if(t===l)return O;break}if(e.match_length=0,n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(I(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(I(e,!1),e.strm.avail_out===0)?O:k}(i,t):i.strategy===3?function(e,t){for(var n,r,i,o,s=e.window;;){if(e.lookahead<=w){if(B(e),e.lookahead<=w&&t===l)return O;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=C&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=C?(n=a._tr_tally(e,1,e.match_length-C),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(I(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(I(e,!1),e.strm.avail_out===0)?O:k}(i,t):r[i.level].func(i,t);if(m!==A&&m!==j||(i.status=666),m===O||m===A)return e.avail_out===0&&(i.last_flush=-1),d;if(m===k&&(t===1?a._tr_align(i):t!==5&&(a._tr_stored_block(i,0,0,!1),t===3&&(P(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),F(e),e.avail_out===0))return i.last_flush=-1,d}return t===u?i.wrap<=0?1:(i.wrap===2?(L(i,255&e.adler),L(i,e.adler>>8&255),L(i,e.adler>>16&255),L(i,e.adler>>24&255),L(i,255&e.total_in),L(i,e.total_in>>8&255),L(i,e.total_in>>16&255),L(i,e.total_in>>24&255)):(R(i,e.adler>>>16),R(i,65535&e.adler)),F(e),0=n.w_size&&(s===0&&(P(n.head),n.strstart=0,n.block_start=0,n.insert=0),p=new i.Buf8(n.w_size),i.arraySet(p,t,m-n.w_size,n.w_size,0),t=p,m=n.w_size),c=e.avail_in,l=e.next_in,u=e.input,e.avail_in=m,e.next_in=0,e.input=t,B(n);n.lookahead>=C;){for(r=n.strstart,a=n.lookahead-(C-1);n.ins_h=(n.ins_h<>>=b=y>>>24,m-=b,(b=y>>>16&255)==0)E[a++]=65535&y;else{if(!(16&b)){if(!(64&b)){y=h[(65535&y)+(p&(1<>>=b,m-=b),m<15&&(p+=T[r++]<>>=b=y>>>24,m-=b,!(16&(b=y>>>16&255))){if(!(64&b)){y=g[(65535&y)+(p&(1<>>=b,m-=b,(b=a-o)>3,p&=(1<<(m-=x<<3))-1,e.next_in=r,e.next_out=a,e.avail_in=r>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function g(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg=``,t.wrap&&(e.adler=1&t.wrap),t.mode=f,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new r.Buf32(p),t.distcode=t.distdyn=new r.Buf32(m),t.sane=1,t.back=-1,u):d}function v(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,_(e)):d}function y(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=o.wsize?(r.arraySet(o.window,t,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i<(a=o.wsize-o.wnext)&&(a=i),r.arraySet(o.window,t,n-i,a,o.wnext),(i-=a)?(r.arraySet(o.window,t,n-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,n.check=a(n.check,B,2,0),x=b=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&b)<<8)+(b>>8))%31){e.msg=`incorrect header check`,n.mode=30;break}if((15&b)!=8){e.msg=`unknown compression method`,n.mode=30;break}if(x-=4,F=8+(15&(b>>>=4)),n.wbits===0)n.wbits=F;else if(F>n.wbits){e.msg=`invalid window size`,n.mode=30;break}n.dmax=1<>8&1),512&n.flags&&(B[0]=255&b,B[1]=b>>>8&255,n.check=a(n.check,B,2,0)),x=b=0,n.mode=3;case 3:for(;x<32;){if(v===0)break e;v--,b+=p[g++]<>>8&255,B[2]=b>>>16&255,B[3]=b>>>24&255,n.check=a(n.check,B,4,0)),x=b=0,n.mode=4;case 4:for(;x<16;){if(v===0)break e;v--,b+=p[g++]<>8),512&n.flags&&(B[0]=255&b,B[1]=b>>>8&255,n.check=a(n.check,B,2,0)),x=b=0,n.mode=5;case 5:if(1024&n.flags){for(;x<16;){if(v===0)break e;v--,b+=p[g++]<>>8&255,n.check=a(n.check,B,2,0)),x=b=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(v<(E=n.length)&&(E=v),E&&(n.head&&(F=n.head.extra_len-n.length,n.head.extra||(n.head.extra=Array(n.head.extra_len)),r.arraySet(n.head.extra,p,g,E,F)),512&n.flags&&(n.check=a(n.check,p,E,g)),v-=E,g+=E,n.length-=E),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(v===0)break e;for(E=0;F=p[g+ E++],n.head&&F&&n.length<65536&&(n.head.name+=String.fromCharCode(F)),F&&E>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;x<32;){if(v===0)break e;v--,b+=p[g++]<>>=7&x,x-=7&x,n.mode=27;break}for(;x<3;){if(v===0)break e;v--,b+=p[g++]<>>=1)){case 0:n.mode=14;break;case 1:if(w(n),n.mode=20,t!==6)break;b>>>=2,x-=2;break e;case 2:n.mode=17;break;case 3:e.msg=`invalid block type`,n.mode=30}b>>>=2,x-=2;break;case 14:for(b>>>=7&x,x-=7&x;x<32;){if(v===0)break e;v--,b+=p[g++]<>>16^65535)){e.msg=`invalid stored block lengths`,n.mode=30;break}if(n.length=65535&b,x=b=0,n.mode=15,t===6)break e;case 15:n.mode=16;case 16:if(E=n.length){if(v>>=5,x-=5,n.ndist=1+(31&b),b>>>=5,x-=5,n.ncode=4+(15&b),b>>>=4,x-=4,286>>=3,x-=3}for(;n.have<19;)n.lens[V[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,L={bits:n.lenbits},I=s(0,n.lens,0,19,n.lencode,0,n.work,L),n.lenbits=L.bits,I){e.msg=`invalid code lengths set`,n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have>>16&255,j=65535&z,!((k=z>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=k,x-=k,n.lens[n.have++]=j;else{if(j===16){for(R=k+2;x>>=k,x-=k,n.have===0){e.msg=`invalid bit length repeat`,n.mode=30;break}F=n.lens[n.have-1],E=3+(3&b),b>>>=2,x-=2}else if(j===17){for(R=k+3;x>>=k)),b>>>=3,x-=3}else{for(R=k+7;x>>=k)),b>>>=7,x-=7}if(n.have+E>n.nlen+n.ndist){e.msg=`invalid bit length repeat`,n.mode=30;break}for(;E--;)n.lens[n.have++]=F}}if(n.mode===30)break;if(n.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,n.mode=30;break}if(n.lenbits=9,L={bits:n.lenbits},I=s(c,n.lens,0,n.nlen,n.lencode,0,n.work,L),n.lenbits=L.bits,I){e.msg=`invalid literal/lengths set`,n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,L={bits:n.distbits},I=s(l,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,L),n.distbits=L.bits,I){e.msg=`invalid distances set`,n.mode=30;break}if(n.mode=20,t===6)break e;case 20:n.mode=21;case 21:if(6<=v&&258<=y){e.next_out=_,e.avail_out=y,e.next_in=g,e.avail_in=v,n.hold=b,n.bits=x,o(e,C),_=e.next_out,m=e.output,y=e.avail_out,g=e.next_in,p=e.input,v=e.avail_in,b=n.hold,x=n.bits,n.mode===12&&(n.back=-1);break}for(n.back=0;A=(z=n.lencode[b&(1<>>16&255,j=65535&z,!((k=z>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>M)])>>>16&255,j=65535&z,!(M+(k=z>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=M,x-=M,n.back+=M}if(b>>>=k,x-=k,n.back+=k,n.length=j,A===0){n.mode=26;break}if(32&A){n.back=-1,n.mode=12;break}if(64&A){e.msg=`invalid literal/length code`,n.mode=30;break}n.extra=15&A,n.mode=22;case 22:if(n.extra){for(R=n.extra;x>>=n.extra,x-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;A=(z=n.distcode[b&(1<>>16&255,j=65535&z,!((k=z>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>M)])>>>16&255,j=65535&z,!(M+(k=z>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=M,x-=M,n.back+=M}if(b>>>=k,x-=k,n.back+=k,64&A){e.msg=`invalid distance code`,n.mode=30;break}n.offset=j,n.extra=15&A,n.mode=24;case 24:if(n.extra){for(R=n.extra;x>>=n.extra,x-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg=`invalid distance too far back`,n.mode=30;break}n.mode=25;case 25:if(y===0)break e;if(E=C-y,n.offset>E){if((E=n.offset-E)>n.whave&&n.sane){e.msg=`invalid distance too far back`,n.mode=30;break}D=E>n.wnext?(E-=n.wnext,n.wsize-E):n.wnext-E,E>n.length&&(E=n.length),O=n.window}else O=m,D=_-n.offset,E=n.length;for(yv?(b=L[R+d[w]],N[P+d[w]]):(b=96,0),p=1<>k)+(m-=p)]=y<<24|b<<16|x|0,m!==0;);for(p=1<>=1;if(p===0?M=0:(M&=p-1,M+=p),w++,--F[C]==0){if(C===E)break;C=t[n+d[w]]}if(D>>7)]}function L(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function R(e,t,n){e.bi_valid>h-n?(e.bi_buf|=t<>h-e.bi_valid,e.bi_valid+=n-h):(e.bi_buf|=t<>>=1,n<<=1,0<--t;);return n>>>1}function V(e,t,n){var r,i,a=Array(m+1),o=0;for(r=1;r<=m;r++)a[r]=o=o+n[r-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];s!==0&&(e[2*i]=B(a[s]++,s))}}function H(e){var t;for(t=0;t>1;1<=n;n--)ee(e,a,n);for(i=c;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ee(e,a,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,a[2*i]=a[2*n]+a[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,a[2*n+1]=a[2*r+1]=i,e.heap[1]=i++,ee(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,i,a,o,s,c=t.dyn_tree,l=t.max_code,u=t.stat_desc.static_tree,d=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,g=t.stat_desc.max_length,_=0;for(a=0;a<=m;a++)e.bl_count[a]=0;for(c[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n>=7;r>>=1)if(1&n&&e.dyn_ltree[2*t]!==0)return i;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return a;for(t=32;t>>3,(s=e.static_len+3+7>>>3)<=o&&(o=s)):o=s=n+5,n+4<=o&&t!==-1?ae(e,t,n,r):e.strategy===4||s===o?(R(e,2+ +!!r,3),te(e,T,E)):(R(e,4+ +!!r,3),function(e,t,n,r){var i;for(R(e,t-257,5),R(e,n-1,5),R(e,r-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,t===0?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(O[n]+l+1)]++,e.dyn_dtree[2*I(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){R(e,2,3),z(e,_,T),function(e){e.bi_valid===16?(L(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,n){t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=``,this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,n){(function(e){(function(e,t){if(!e.setImmediate){var n,r,i,a,o=1,s={},c=!1,l=e.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(e);u=u&&u.setTimeout?u:e,n={}.toString.call(e.process)===`[object process]`?function(e){process.nextTick(function(){f(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage(``,`*`),e.onmessage=n,t}}()?(a=`setImmediate$`+Math.random()+`$`,e.addEventListener?e.addEventListener(`message`,p,!1):e.attachEvent(`onmessage`,p),function(t){e.postMessage(a+t,`*`)}):e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){f(e.data)},function(e){i.port2.postMessage(e)}):l&&`onreadystatechange`in l.createElement(`script`)?(r=l.documentElement,function(e){var t=l.createElement(`script`);t.onreadystatechange=function(){f(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):function(e){setTimeout(f,0,e)},u.setImmediate=function(e){typeof e!=`function`&&(e=Function(``+e));for(var t=Array(arguments.length-1),r=0;r`u`?e===void 0?this:e:self)}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{})},{}]},{},[10])(10)})}))(),1),{Text:vse}=Q,k9=e=>e?/^(https?:|data:|blob:)/i.test(e)?e:`${`http://ceshi.apiforeign.minzhong.cn`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`:``,yse=e=>e===`video`?(0,$.jsx)(t5,{}):e===`audio`?(0,$.jsx)(k2,{}):(0,$.jsx)(R6,{}),bse=e=>e===`video`?`视频`:e===`audio`?`音频`:`图片`,A9=e=>{let t=Number(e||0);return t>=1024*1024?`${(t/1024/1024).toFixed(1)} MB`:t>=1024?`${(t/1024).toFixed(1)} KB`:`${t} B`},xse=()=>{let[e,t]=(0,S.useState)(``),[n,r]=(0,S.useState)(``),[i,a]=(0,S.useState)(1),[o,s]=(0,S.useState)(10),[c,l]=(0,S.useState)(!1),[u,d]=(0,S.useState)([]),[f,p]=(0,S.useState)(0),[m,h]=(0,S.useState)(new Set),[g,_]=(0,S.useState)(null),[v,y]=(0,S.useState)(!1),b=(0,S.useMemo)(()=>u.flatMap(e=>e.items||[]),[u]),x=(0,S.useCallback)(async()=>{l(!0);try{let t=await d7({resourceType:e||void 0,keyword:n||void 0,page:i,pageSize:o,scene:`record`});d(t.groups||[]),p(t.totalDays||0),h(new Set)}catch(e){Z.error(e?.message||`加载历史上传素材失败`),d([]),p(0)}finally{l(!1)}},[n,i,o,e]);(0,S.useEffect)(()=>{x()},[x]);let C=e=>{h(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},w=()=>{let e=b.map(e=>e.id);h(t=>t.size===e.length?new Set:new Set(e))},T=async t=>{let r=(t.page||1)+1;try{let i=await f7(t.generatedDate,{resourceType:e||void 0,keyword:n||void 0,page:r,pageSize:10,scene:`record`});d(e=>e.map(e=>e.generatedDate===t.generatedDate?{...e,page:r,items:[...e.items,...i.items||[]]}:e))}catch(e){Z.error(e?.message||`加载更多失败`)}},E=e=>{mK.confirm({title:`确认删除历史上传素材`,content:`确定删除 ${e.fileName||e.id} 吗?删除后会释放上传容量,并在提交成功后清理真实文件。`,okText:`删除`,okButtonProps:{danger:!0},cancelText:`取消`,onOk:async()=>{try{await k5(e.resourceUrl),Z.success(`删除成功`),x()}catch(e){Z.error(e?.message||`删除失败`)}}})},D=()=>{if(m.size===0){Z.warning(`请先选择要删除的上传素材`);return}if(m.size>30){Z.warning(`一次最多删除 30 条上传素材`);return}let e=Array.from(m);mK.confirm({title:`确认批量删除历史上传素材`,content:`确定删除选中的 ${e.length} 条上传素材吗?删除后会释放上传容量,并在提交成功后清理真实文件。`,okText:`删除`,okButtonProps:{danger:!0},cancelText:`取消`,onOk:async()=>{try{let t=await Eae(e);Z.success(`删除成功,释放 ${A9(t?.releasedSizeBytes||0)}`),x()}catch(e){Z.error(e?.message||`批量删除失败`)}}})},O=e=>{let t=document.createElement(`a`);t.href=k9(e.resourceUrl),t.download=e.fileName||e.id,document.body.appendChild(t),t.click(),document.body.removeChild(t)},k=(e,t=`card`)=>{let n=k9(e.previewUrl||e.displayUrl||e.resourceUrl),r=t===`card`?{width:`100%`,height:130,objectFit:`cover`}:{width:`100%`,maxHeight:620,objectFit:`contain`};return e.resourceType===`image`?(0,$.jsx)(`img`,{src:n,alt:e.fileName||e.id,style:r}):e.resourceType===`video`?(0,$.jsx)(`video`,{src:n,controls:t===`preview`,muted:t===`card`,style:r}):(0,$.jsx)(N7,{src:n,size:t===`card`?`small`:`normal`})};return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,justifyContent:`space-between`,alignItems:`center`,gap:12,marginBottom:16,padding:`12px 16px`,borderRadius:12,background:`#fff`,border:`1px solid #f0f0f5`},children:[(0,$.jsxs)(sH,{size:8,wrap:!0,children:[(0,$.jsx)(Q.Text,{style:{color:`#94a3b8`,fontSize:14,marginRight:4},children:`媒体类型:`}),(0,$.jsx)(X,{type:e===``?`primary`:`default`,onClick:()=>{t(``),a(1)},style:{borderRadius:8,fontWeight:600,borderColor:e===``?`transparent`:`#e2e8f0`,color:e===``?`#fff`:`#64748b`},children:`全部`}),(0,$.jsx)(X,{type:e===`image`?`primary`:`default`,onClick:()=>{t(`image`),a(1)},style:{borderRadius:8,fontWeight:600,borderColor:e===`image`?`transparent`:`#e2e8f0`,color:e===`image`?`#fff`:`#64748b`},children:`图片`}),(0,$.jsx)(X,{type:e===`video`?`primary`:`default`,onClick:()=>{t(`video`),a(1)},style:{borderRadius:8,fontWeight:600,borderColor:e===`video`?`transparent`:`#e2e8f0`,color:e===`video`?`#fff`:`#64748b`},children:`视频`}),(0,$.jsx)(X,{type:e===`audio`?`primary`:`default`,onClick:()=>{t(`audio`),a(1)},style:{borderRadius:8,fontWeight:600,borderColor:e===`audio`?`transparent`:`#e2e8f0`,color:e===`audio`?`#fff`:`#64748b`},children:`音频`})]}),(0,$.jsxs)(sH,{size:8,wrap:!0,children:[(0,$.jsx)(IW.Search,{allowClear:!0,value:n,placeholder:`搜索文件名或URL`,onChange:e=>r(e.target.value),onSearch:()=>{a(1),x()},style:{width:240,borderRadius:8},enterButton:!0}),v?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(X,{onClick:w,style:{borderRadius:8,fontWeight:600,background:`#f8f9fc`,border:`1px solid #e2e8f0`,color:`#334155`},children:m.size&&m.size===b.length?`取消全选`:`全选`}),(0,$.jsxs)(X,{danger:!0,onClick:D,style:{borderRadius:8,fontWeight:600,background:`linear-gradient(135deg, #ef4444, #dc2626)`,border:`none`,color:`#fff`},children:[`批量删除 `,m.size>0&&`(${m.size})`]}),(0,$.jsx)(X,{onClick:()=>{y(!1),h(new Set)},style:{borderRadius:8,fontWeight:600,background:`#f8f9fc`,border:`1px solid #e2e8f0`,color:`#64748b`},children:`取消选择`})]}):(0,$.jsx)(X,{type:`primary`,onClick:()=>y(!0),style:{borderRadius:8,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`批量操作`})]})]}),(0,$.jsx)(UG,{spinning:c,children:u.length===0?(0,$.jsx)(XS,{description:`暂无可展示的历史上传素材`,style:{padding:`60px 0`}}):(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:28},children:u.map(e=>(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:12},children:[(0,$.jsx)(`div`,{style:{fontSize:18,fontWeight:700,color:`#1e293b`},children:e.generatedDate}),(0,$.jsxs)(vse,{type:`secondary`,children:[`共 `,e.total,` 个素材`]})]}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,justifyContent:`flex-start`},children:e.items.map(e=>{let t=m.has(e.id);return(0,$.jsxs)(`div`,{style:{width:`17%`,minWidth:240,margin:16,border:t?`2px solid #8b5cf6`:`1px solid #e2e8f0`,borderRadius:16,overflow:`hidden`,background:`#fff`,boxShadow:`0 10px 24px rgba(15,23,42,0.06)`},children:[(0,$.jsxs)(`div`,{style:{position:`relative`,background:`#f1f5f9`,cursor:v?`pointer`:`default`},onClick:()=>v&&C(e.id),children:[k(e),v&&(0,$.jsx)(VR,{checked:t,onChange:()=>C(e.id),style:{position:`absolute`,top:10,left:10,background:`#fff`,borderRadius:6,padding:4}}),(0,$.jsx)(XQ,{color:`purple`,icon:yse(e.resourceType),style:{position:`absolute`,top:10,right:10,margin:0},children:bse(e.resourceType)})]}),(0,$.jsxs)(`div`,{style:{padding:12,paddingTop:0},children:[(0,$.jsxs)(sH,{size:4,wrap:!0,style:{marginTop:8},children:[(0,$.jsx)(XQ,{style:{margin:0},children:e.moduleLabel}),(0,$.jsx)(XQ,{style:{margin:0},children:A9(e.fileSizeBytes)}),e.durationSeconds?(0,$.jsxs)(XQ,{style:{margin:0},children:[Number(e.durationSeconds).toFixed(1),`s`]}):null]}),(0,$.jsxs)(sH,{style:{marginTop:12},children:[(0,$.jsx)(X,{size:`small`,icon:(0,$.jsx)(mW,{}),onClick:()=>_(e),children:`预览`}),(0,$.jsx)(X,{size:`small`,icon:(0,$.jsx)(m0,{}),onClick:()=>O(e),children:`下载`}),(0,$.jsx)(X,{size:`small`,danger:!0,icon:(0,$.jsx)(u$,{}),onClick:()=>E(e),children:`删除`})]})]})]},e.id)})}),e.items.lengthT(e),children:`加载更多`})})]},e.generatedDate))})}),(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,marginTop:24},children:(0,$.jsx)(SG,{current:i,pageSize:o,total:f,showSizeChanger:!0,pageSizeOptions:[5,10],onChange:(e,t)=>{a(e),s(t)}})}),(0,$.jsx)(mK,{open:!!g,title:`预览`,footer:null,width:900,centered:!0,destroyOnHidden:!0,onCancel:()=>_(null),children:g?k(g,`preview`):null})]})},{Search:Sse}=IW,{Text:Cse}=Q,wse=e=>{let t=S.useRef(!1);(0,S.useEffect)(()=>{if(t.current)return;let n=()=>{t.current||(t.current=!0,e?.())};return document.readyState===`complete`?n():window.addEventListener(`load`,n),()=>{window.removeEventListener(`load`,n)}},[e])},Tse=()=>{let[e,t]=(0,S.useState)(!1);wse(()=>{t(!0)});let[n]=On(),[r,i]=(0,S.useState)(n.get(`filterType`)===`private_portrait`?`private_portrait`:n.get(`filterType`)===`upload_resource`?`upload_resource`:`project`),[a,o]=(0,S.useState)(`video`),[s,c]=(0,S.useState)([]),[l,u]=(0,S.useState)({page:1,pageSize:10}),[d,f]=(0,S.useState)(0),[p,m]=(0,S.useState)(!1),[h,g]=(0,S.useState)(new Set),[_,v]=(0,S.useState)(!1),[y,b]=(0,S.useState)(null),x=S.createRef(),[C,w]=(0,S.useState)(``),[T,E]=(0,S.useState)(``),[D,O]=(0,S.useState)(!1),[k,A]=(0,S.useState)(!1),[j,M]=(0,S.useState)([[]]),[N,P]=(0,S.useState)([``]),[F,I]=(0,S.useState)([]),[L,R]=(0,S.useState)(!1),[z,B]=(0,S.useState)(0),[V,H]=(0,S.useState)([void 0]),[U,W]=(0,S.useState)(new Map),[ee,te]=(0,S.useState)(``),[G,ne]=(0,S.useState)(new Map),re=(0,S.useRef)(new Map);(0,S.useEffect)(()=>()=>{re.current.forEach(e=>clearTimeout(e)),re.current.clear()},[]);let[ie,ae]=(0,S.useState)(1),[oe,K]=(0,S.useState)(10),[q,se]=(0,S.useState)([!1]),[ce,le]=(0,S.useState)(`new`),[ue,de]=(0,S.useState)([]),[fe,pe]=(0,S.useState)(!1),[me,he]=(0,S.useState)([]),[ge,_e]=(0,S.useState)({}),[ve,ye]=(0,S.useState)(`2`),[be,xe]=(0,S.useState)(``),[Se,Ce]=(0,S.useState)([]),[we,Te]=(0,S.useState)(!1),[Ee,De]=(0,S.useState)(!1),[Oe,ke]=(0,S.useState)([]),[Ae,je]=(0,S.useState)(0),[Me,Ne]=(0,S.useState)(1),[Pe,Fe]=(0,S.useState)(10),[Ie,Le]=(0,S.useState)(!1),[Re,ze]=(0,S.useState)(``),[Be,Ve]=(0,S.useState)(!1),[He,Ue]=(0,S.useState)(new Set),We=e=>{if(!e)return null;try{let t=new URL(e).searchParams.get(`exp`);return t?parseInt(t,10):null}catch{try{let t=e.indexOf(`?`);if(t!==-1){let n=e.substring(t+1),r=new URLSearchParams(n).get(`exp`);if(r)return parseInt(r,10)}return null}catch{return null}}},Ge=e=>{let t=We(e);return t?Math.floor(Date.now()/1e3)>t:!1},Ke=(e,t=!1)=>{let n=`http://ceshi.apiforeign.minzhong.cn`,r=e.startsWith(`/`)?e.slice(1):e,i=n.endsWith(`/`)?n.slice(0,-1):n;return t?`${i}/static/${r}&w=300&q=50`:`${i}/${r}`},qe=async e=>{if(b(e),v(!0),window.dispatchEvent(new Event(`previewOpen`)),e.videoUrl&&e.videoUrl.trim()&&!e.imagePx)try{let t=await ht(e.videoUrl);t&&b(e=>e&&{...e,imagePx:t})}catch{}},Je=()=>{x.current&&(x.current.pause(),x.current.currentTime=0),document.querySelectorAll(`video`).forEach(e=>{e.pause(),e.currentTime=0}),v(!1)},Ye=e=>e.generatedResourceId||e.id,Xe=e=>!!e.generatedResourceId,Ze=e=>{if(!e)return!0;let t=e.match(/^(\d+)x(\d+)$/);if(!t)return!0;let n=parseInt(t[1],10),r=parseInt(t[2],10),i=n/r;return n>=r?n>=480&&n<=2560&&r>=270&&r<=1440&&i>=1.775&&i<=1.784:n>=270&&n<=1440&&r>=480&&r<=2560&&i>=.555&&i<=.564},Qe=e=>{Ue(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},$e=()=>{let e=s.flatMap(e=>e.items.map(e=>Ye(e)));He.size===e.length?Ue(new Set):Ue(new Set(e))},et=async()=>{if(He.size===0){Z.warning(`请先选择要下载的媒体`);return}if(He.size>30){Z.warning(`最多只能单次下载30个文件`);return}let e=[];s.forEach(t=>{t.items.forEach(t=>{He.has(Ye(t))&&e.push(t)})});let t=new _se.default,n=`http://ceshi.apiforeign.minzhong.cn`,r=t.folder(`downloads`),i=!1,a=0;Z.loading({content:`下载中,请稍候...`,key:`downloadProgress`});for(let t of e){let e=`${n}${t.videoUrl||t.imageUrl}`,o=((t.videoUrl||t.imageUrl).split(`/`).pop()||`file_${Date.now()}`).split(`?`)[0];try{let t=await fetch(e);if(!t.ok)throw Error(`Network response was not ok`);let n=await t.blob();r?.file(o,n),a++}catch{i=!0;break}}if(i){Z.destroy(`downloadProgress`),Z.info(`由于跨域限制,将逐个下载文件`),e.forEach((e,t)=>{setTimeout(()=>{let t=`${n}${e.videoUrl||e.imageUrl}&download=1`,r=document.createElement(`a`);r.href=t,r.download=``,document.body.appendChild(r),r.click(),document.body.removeChild(r)},t*500)});return}let o=await t.generateAsync({type:`blob`}),c=document.createElement(`a`);c.href=URL.createObjectURL(o),c.download=`downloads_${Date.now()}.zip`,c.click(),URL.revokeObjectURL(c.href),Z.destroy(`downloadProgress`),Z.success(`下载完成,共 ${a} 个文件`),Ve(!1),Ue(new Set)},tt=async()=>{if(He.size===0){Z.warning(`请先选择要删除的媒体`);return}if(He.size>30){Z.warning(`最多只能单次删除30个文件`);return}let e=s.flatMap(e=>e.items.filter(e=>He.has(Ye(e)))),t=``;t=r===`shot_replicate`?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{marginBottom:8},children:`以下内容所连带的图片和视频都将被删除:`}),(0,$.jsx)(`ul`,{style:{margin:0,paddingLeft:20},children:e.map((e,t)=>(0,$.jsxs)(`li`,{style:{marginBottom:4,color:`#334155`},children:[e.shotReplicateProjectTitle,`— —`,e.shotSegmentLabel]},t))}),(0,$.jsx)(`div`,{style:{marginTop:12},children:`确定删除吗?`})]}):r===`hot_opening_replicate`?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{marginBottom:8},children:`爆款开头复刻中以下内容所连带的图片和视频都将被删除:`}),(0,$.jsx)(`ul`,{style:{margin:0,paddingLeft:20},children:e.map((e,t)=>(0,$.jsx)(`li`,{style:{marginBottom:4,color:`#334155`},children:e.moduleProjectTitle},t))}),(0,$.jsx)(`div`,{style:{marginTop:12},children:`确定删除吗?`})]}):`确定删除选中的 ${He.size} 条记录吗?`,mK.confirm({title:`确认删除`,content:t,okText:`确定删除`,cancelText:`取消`,okButtonProps:{danger:!0},onOk:async()=>{let e=``;r===`project`?e=`generation_record`:r===`creation`?e=`chat_task`:r===`hot_opening_replicate`?e=`hot_opening_replicate`:r===`shot_replicate`&&(e=`shot_replicate`);let t=[];s.forEach(e=>{e.items.forEach(e=>{He.has(Ye(e))&&t.push(e)})});let n=[];e===`generation_record`||e===`chat_task`?n=t.map(e=>e.id):e===`hot_opening_replicate`?n=t.map(e=>e.moduleProjectId):e===`shot_replicate`&&(n=t.map(e=>e.shotSegmentId));let i={history_source:e,ids:n};try{await l7(i),Z.success(`删除成功`),Ve(!1),Ue(new Set),u(e=>({...e,page:1})),gt()}catch{Z.error(`删除失败,请重试`)}}})},nt=async()=>{Te(!0);try{let e=await Y5({page:1,pageSize:100});Ce(e.data?.data||e.data||[])}catch{}finally{Te(!1)}},rt=()=>{if(He.size===0){Z.warning(`请先选择要推送的媒体`);return}M([[]]),P([``]),H([void 0]),ye(`2`),xe(``),nt(),A(!0)},it=()=>{if(!y)return;let e=Ye(y);Ue(new Set([e])),M([[]]),P([``]),H([void 0]),W(new Map),te(``),ye(`2`),xe(``),nt(),A(!0)},at=async(e,t)=>{R(!0);try{let n=await J5({page:e,page_size:t});I(n?.data||n||[]),B(n.pagination.total||0)}catch{I([]),B(0)}finally{R(!1)}},ot=async()=>{pe(!0);try{let[e,t]=await Promise.all([Cae(),s7()]);de(e?.data||[]);let n=t?.data||[],r={};n.forEach(e=>{r[e.openType]=e.typeName}),_e(r)}catch{de([]),_e({})}finally{pe(!1)}},st=async()=>{Le(!0);try{let e=await hae({status:Re||void 0,page:Me,pageSize:Pe});ke(e?.data||e||[]),je(e.pagination?.total||e.total||0)}catch{ke([]),je(0)}finally{Le(!1)}},ct=()=>{De(!0),Ne(1),ze(``),st()},lt=()=>{Ne(1),st()},ut=(e,t)=>{Ne(e),Fe(t),st()},dt=async()=>{if(He.size===0){Z.warning(`请先选择要推送的媒体`);return}let e=new Map;s.forEach(t=>{t.items.forEach(t=>{let n=Ye(t);e.set(n,t)})});let t=[];if(ce===`new`){let n=V.filter(e=>e!==void 0);if(n.length===0){Z.warning(`请先选择授权账户`);return}for(let r=0;re.accountId)||[];if(a.length===0){Z.warning(`第 ${r+1} 组授权账户未设置账户ID,已跳过`);continue}let o=new Map;for(let t of He){let n=e.get(t),r;n&&Xe(n)&&(r=`generated_resources`),o.has(r)||o.set(r,[]),o.get(r).push(t)}o.forEach((e,n)=>{t.push({advertiser_ids:a,resource_ids:e,oauth_id:i.value,source_model:n,is_pre_test:ve,pre_test_template:be})})}}else{if(me.length===0){Z.warning(`请先选择历史账户`);return}for(let n of me){let i=new Map;for(let t of He){let n=e.get(t),a;a=n&&Xe(n)?`generated_resources`:r===`project`?`generation_records`:`chat_generation_tasks`,i.has(a)||i.set(a,[]),i.get(a).push(t)}i.forEach((e,r)=>{t.push({advertiser_ids:[n.advertiserId],resource_ids:e,oauth_id:String(n.oauthId),source_model:r,is_pre_test:ve,pre_test_template:be})})}}O(!0);try{let e=await mae({tasks:t});e.errors?.length>0?Z.warning(e.message):e.code===0?Z.success(e.message):Z.error(e.message),Ve(!1),Ue(new Set),A(!1),M([[]]),P([``]),H([void 0]),he([]),W(new Map),te(``),ye(`2`),xe(``)}catch(e){Z.error(e.message||`批量推送失败`)}finally{O(!1)}},ft=async(e,t)=>{if(t.trim())try{let n=(await a7({filenames:[{source_id:e,file_name:t}]}))?.results?.find(t=>t.source_id===e)?.new_file_name||t;c(t=>t.map(t=>({...t,items:t.items.map(t=>Ye(t)===e?{...t,fileName:n}:t)}))),Z.success(`文件名更新成功`)}catch(e){Z.error(e.message||`文件名更新失败`)}},pt=async(e,t)=>{if(!(!t.trim()||e.length===0))try{let n=await a7({filenames:e.map(e=>({source_id:e,file_name:t}))}),r=new Map;n?.results?.forEach(e=>{e.success&&e.newFileName&&r.set(e.sourceId,e.newFileName)}),c(n=>{let i=new Set(e);return n.map(e=>({...e,items:e.items.map(e=>{let n=Ye(e);if(i.has(n)){let i=r.get(n)||t;return{...e,fileName:i}}return e})}))});let i=n?.successCount||0;Z.success(`已更新 ${i} 个文件名`)}catch(e){Z.error(e.message||`文件名更新失败`)}},mt=e=>{w(e)},ht=e=>new Promise(t=>{let n=document.createElement(`video`),r=`http://ceshi.apiforeign.minzhong.cn`,i=e.startsWith(`/`)?e.slice(1):e;n.src=`${r.endsWith(`/`)?r.slice(0,-1):r}/${i}`,n.crossOrigin=`anonymous`,n.onloadedmetadata=()=>{let e=n.videoWidth,r=n.videoHeight;n.remove(),t(`${e}x${r}`)},n.onerror=()=>{n.remove(),t(``)},n.onabort=()=>{n.remove(),t(``)},setTimeout(()=>{n.remove(),t(``)},5e3)}),gt=()=>{if(r===`private_portrait`||r===`upload_resource`){m(!1),c([]);return}m(!0);let e=``;r===`project`?e=`generation_record`:r===`hot_opening_replicate`?e=`hot_opening_replicate`:r===`shot_replicate`&&(e=`shot_replicate`);let t=`?gen_type=${a}&page=${l.page}&page_size=${l.pageSize}`;if(e&&(t=`?gen_type=${a}&history_source=${e}&page=${l.page}&page_size=${l.pageSize}`),T&&T.trim()&&(t+=`&keyword=${encodeURIComponent(T.trim())}`),C){let t=`${C}?gen_type=${a}&page=${l.page}&page_size=${l.pageSize}`;e&&(t=`${C}?gen_type=${a}&history_source=${e}&page=${l.page}&page_size=${l.pageSize}`),T&&T.trim()&&(t+=`&keyword=${encodeURIComponent(T.trim())}`),V5(t).then(e=>{let t=Array.isArray(e)?e:e?.items||[],n=[{generatedDate:e.generatedDate,items:t,total:e.total,page:e.page}];n&&n[0].items.length>0?c(n):c([])}).catch(e=>{}).finally(()=>{m(!1)})}else Uie(t).then(e=>{let t=Array.isArray(e)?e:e?.groups||[];t.forEach(e=>{e.page=1}),l.page===1?c(t):c(e=>[...e,...t]),f(e?.totalDays||0)}).catch(e=>{l.page===1&&c([])}).finally(()=>{m(!1)})};(0,S.useEffect)(()=>{gt()},[r,a,l.page,C]);let _t=()=>{p||u(e=>({...e,page:e.page+1}))},vt=async(e,t,n)=>{if(h.has(t))return;g(e=>new Set([...e,t]));let i=n+1,o=``;r===`project`?o=`generation_record`:r===`hot_opening_replicate`?o=`hot_opening_replicate`:r===`shot_replicate`&&(o=`shot_replicate`);let s=`${e}?gen_type=${a}&page=${i}&page_size=${l.pageSize}`;o&&(s=`${e}?gen_type=${a}&history_source=${o}&page=${i}&page_size=${l.pageSize}`),T&&T.trim()&&(s+=`&keyword=${encodeURIComponent(T.trim())}`);try{let t=(await V5(s)).items||[];t&&t.length>0&&c(n=>n.map(n=>n.generatedDate===e?{...n,items:[...n.items,...t],page:i}:n))}catch{}finally{g(e=>{let n=new Set(e);return n.delete(t),n})}};return(0,S.useEffect)(()=>{u(e=>({...e,page:1})),E(``)},[r,a]),(0,$.jsxs)(`div`,{className:`content_box`,children:[(0,$.jsx)(TL,{activeKey:r,onChange:e=>{i(e),Ve(!1),Ue(new Set)},items:[{key:`project`,label:(0,$.jsxs)(`span`,{children:[(0,$.jsx)(KX,{}),` 项目记录`]})},{key:`creation`,label:(0,$.jsxs)(`span`,{children:[(0,$.jsx)(fH,{}),` 创作记录`]})},{key:`hot_opening_replicate`,label:(0,$.jsxs)(`span`,{children:[(0,$.jsx)(R8,{}),` 爆款复刻`]})},{key:`shot_replicate`,label:(0,$.jsxs)(`span`,{children:[(0,$.jsx)(q6,{}),` 拆镜复刻`]})},{key:`private_portrait`,label:(0,$.jsxs)(`span`,{children:[(0,$.jsx)($8,{}),` 私域素材库`]})},{key:`upload_resource`,label:(0,$.jsxs)(`span`,{children:[(0,$.jsx)(X8,{}),` 历史素材`]})}],size:`middle`,style:{marginBottom:12}}),r===`private_portrait`?(0,$.jsx)(Joe,{}):r===`upload_resource`?(0,$.jsx)(xse,{}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,justifyContent:`space-between`,alignItems:`center`,gap:12,marginBottom:16,padding:`12px 16px`,borderRadius:12,background:`#fff`,border:`1px solid #f0f0f5`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(Q.Text,{style:{color:`#94a3b8`,fontSize:14,marginRight:4},children:`媒体类型:`}),(0,$.jsx)(X,{type:a===`video`?`primary`:`default`,onClick:()=>{o(`video`),Ve(!1),Ue(new Set)},style:{borderRadius:8,fontWeight:600,borderColor:a===`video`?`transparent`:`#e2e8f0`,color:a===`video`?`#fff`:`#64748b`},icon:(0,$.jsx)(t5,{}),children:`视频`}),(0,$.jsx)(X,{type:a===`image`?`primary`:`default`,onClick:()=>{o(`image`),Ve(!1),Ue(new Set)},style:{borderRadius:8,fontWeight:600,borderColor:a===`image`?`transparent`:`#e2e8f0`,color:a===`image`?`#fff`:`#64748b`},icon:(0,$.jsx)(R6,{}),children:`图片`})]}),(0,$.jsxs)(sH,{size:8,wrap:!0,children:[(0,$.jsx)(hV,{picker:`date`,value:C?(0,bE.default)(C):void 0,onChange:(e,t)=>mt(t||``),format:`YYYY-MM-DD`,style:{width:160,borderRadius:8,border:`1px solid #e2e8f0`},placeholder:`选择日期`,allowClear:!0}),(0,$.jsx)(IW.Search,{placeholder:`搜索提示词`,allowClear:!0,value:T,onChange:e=>{let t=e.target.value;E(t),t||(u(e=>({...e,page:1})),gt())},onSearch:()=>{u(e=>({...e,page:1})),gt()},style:{width:240,borderRadius:8},enterButton:!0}),(0,$.jsx)(X,{icon:(0,$.jsx)(cV,{}),onClick:ct,style:{borderRadius:8,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,color:`#fff`},children:`推送任务历史`}),Be?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(X,{onClick:He.size===s.reduce((e,t)=>e+t.items.length,0)&&s.length>0?()=>{Ue(new Set)}:$e,style:{borderRadius:8,fontWeight:600,background:`#f8f9fc`,border:`1px solid #e2e8f0`,color:`#334155`},children:He.size===s.reduce((e,t)=>e+t.items.length,0)&&s.length>0?`取消全选`:`全选`}),(0,$.jsx)(X,{onClick:()=>{Ve(!1),Ue(new Set)},style:{borderRadius:8,fontWeight:600,background:`#f8f9fc`,border:`1px solid #e2e8f0`,color:`#64748b`},children:`取消选择`}),(0,$.jsxs)(X,{danger:!0,onClick:tt,style:{borderRadius:8,fontWeight:600,background:`linear-gradient(135deg, #ef4444, #dc2626)`,border:`none`,color:`#fff`},children:[`删除 `,He.size>0&&`(${He.size})`]}),(0,$.jsxs)(X,{onClick:et,style:{borderRadius:8,fontWeight:600,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`,color:`#fff`},children:[`下载 `,He.size>0&&`(${He.size})`]}),(0,$.jsx)(X,{type:`primary`,onClick:rt,loading:D,disabled:D||He.size===0,style:{borderRadius:8,fontWeight:600,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,border:`none`,color:`#fff`},children:D?`推送中...`:`推送至账户 ${He.size>0?`(${He.size})`:``}`})]}):(0,$.jsx)(X,{type:`primary`,onClick:()=>Ve(!0),style:{borderRadius:8,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`批量操作`})]})]}),p?(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,minHeight:`400px`},children:(0,$.jsx)(UG,{indicator:(0,$.jsx)(Xm,{style:{fontSize:24,color:`#64748b`},spin:!0}),description:`加载中...`,size:`large`})}):s.length===0?(0,$.jsx)(XS,{image:XS.PRESENTED_IMAGE_SIMPLE,description:`暂无生成记录`,style:{padding:`60px 0`}}):(0,$.jsxs)(`div`,{style:{padding:`0 4px`},children:[s.map((e,t)=>(0,$.jsxs)(`div`,{style:{marginBottom:32},children:[(0,$.jsx)(`div`,{style:{fontSize:14,fontWeight:600,color:`#64748b`,marginBottom:12,paddingLeft:8},children:e.generatedDate}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:8},children:e.items.map(e=>{let t=a===`video`&&e.videoCoverUrl?Ke(e.videoCoverUrl,!0):Ke(a===`video`?e.videoUrl:e.imageUrl,!0),n=a===`video`&&e.videoCoverUrl||a===`image`,r=He.has(Ye(e));return(0,$.jsxs)(`div`,{className:`media-card`,style:{width:160,height:120,position:`relative`,borderRadius:4,cursor:`pointer`,overflow:`hidden`,boxShadow:`0 2px 8px rgba(0,0,0,0.1)`,transition:`transform 0.2s, box-shadow 0.2s`},onClick:()=>Be?Qe(Ye(e)):qe(e),onMouseEnter:e=>{Be||(e.currentTarget.style.transform=`scale(1.05)`,e.currentTarget.style.boxShadow=`0 4px 16px rgba(0,0,0,0.2)`)},onMouseLeave:e=>{Be||(e.currentTarget.style.transform=`scale(1)`,e.currentTarget.style.boxShadow=`0 2px 8px rgba(0,0,0,0.1)`)},children:[n?(0,$.jsxs)(`div`,{style:{width:`100%`,height:`100%`,position:`relative`},children:[(0,$.jsx)(`img`,{src:t,alt:`预览`,loading:`lazy`,style:{width:`100%`,height:`100%`,objectFit:`cover`,opacity:+(G.get(Ye(e))===`loaded`),transition:`opacity 0.3s`},onLoad:()=>{ne(t=>{let n=new Map(t);return n.set(Ye(e),`loaded`),n})},onError:()=>{ne(t=>{let n=new Map(t);return n.set(Ye(e),`error`),n})}}),G.get(Ye(e))!==`loaded`&&(0,$.jsx)(`div`,{style:{position:`absolute`,top:0,left:0,width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%)`},children:(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:8,backgroundColor:`#cbd5e1`,display:`flex`,alignItems:`center`,justifyContent:`center`,animation:G.get(Ye(e))===`loading`?`pulse 1.5s infinite`:`none`},children:e.mediaType===`video`?(0,$.jsx)(t5,{style:{color:`#64748b`,fontSize:16}}):(0,$.jsx)(R6,{style:{color:`#64748b`,fontSize:16}})})})]}):(0,$.jsxs)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,backgroundColor:`#1e293b`},children:[(0,$.jsx)(t5,{style:{color:`#64748b`,fontSize:24}}),(0,$.jsx)(Cse,{style:{fontSize:12,color:`#94a3b8`,marginTop:4},children:`暂无封面`})]}),Be&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:6,left:6,width:22,height:22,borderRadius:`50%`,backgroundColor:r?`#6366f1`:`rgba(255,255,255,0.92)`,border:r?`2px solid #6366f1`:`2px solid #cbd5e1`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,zIndex:10,boxShadow:r?`0 2px 8px rgba(99,102,241,0.4)`:`0 1px 3px rgba(0,0,0,0.1)`,transition:`all 0.15s ease`},onClick:t=>{t.stopPropagation(),Qe(Ye(e))},children:r&&(0,$.jsx)(`svg`,{width:12,height:12,viewBox:`0 0 12 12`,fill:`none`,children:(0,$.jsx)(`path`,{d:`M10 3L4.5 8.5L2 6`,stroke:`white`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`})})}),r&&a===`video`&&e.imagePx&&!Ze(e.imagePx)&&(0,$.jsx)(`div`,{style:{position:`absolute`,top:36,left:8,right:8,padding:`4px 8px`,backgroundColor:`rgba(239, 68, 68, 0.9)`,color:`#fff`,fontSize:12,borderRadius:4,zIndex:10},children:`视频实际尺寸可能不符合平台推送要求`})]}),!Be&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{position:`absolute`,bottom:0,left:0,right:0,background:`linear-gradient(transparent, rgba(0,0,0,0.5))`,padding:`8px`,color:`#fff`,fontSize:12,opacity:0,transition:`opacity 0.2s`},onMouseEnter:e=>{e.currentTarget.style.opacity=`1`},onMouseLeave:e=>{e.currentTarget.style.opacity=`0`},children:`点击预览`}),(0,$.jsx)(`div`,{className:`media-download-btn`,children:(0,$.jsx)(gw,{title:`下载`,children:(0,$.jsx)(`div`,{style:{width:28,height:28,borderRadius:`50%`,background:`rgba(0,0,0,0.5)`,backdropFilter:`blur(4px)`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,transition:`background 0.15s`},onClick:t=>{t.stopPropagation();let n=`http://ceshi.apiforeign.minzhong.cn${e.videoUrl||e.imageUrl}&download=1`,r=document.createElement(`a`);r.href=n,r.download=``,document.body.appendChild(r),r.click(),document.body.removeChild(r)},children:(0,$.jsx)(m0,{style:{color:`#fff`,fontSize:14}})})})})]}),Be&&r&&(0,$.jsx)(`div`,{style:{position:`absolute`,top:0,left:0,right:0,bottom:0,border:`3px solid #6366f1`,borderRadius:4,pointerEvents:`none`,zIndex:5,boxShadow:`inset 0 0 0 1px rgba(99,102,241,0.2)`}})]},Ye(e))})}),e.total&&e.total>e.items.length&&(0,$.jsx)(`div`,{style:{padding:`12px 0`,textAlign:`left`},children:(0,$.jsx)(X,{onClick:()=>vt(e.generatedDate,e.items,e.page),loading:h.has(e.generatedDate),disabled:h.has(e.generatedDate),size:`small`,style:{borderRadius:6,background:`transparent`,border:`1px dashed #cbd5e1`,color:`#64748b`,fontSize:12},children:h.has(e.date)?`加载中...`:`查看全部 (${e.total})`})})]},t)),s.length>0&&d>s.length&&(0,$.jsx)(`div`,{style:{textAlign:`center`,padding:`20px 0`},children:(0,$.jsx)(X,{onClick:_t,loading:p,disabled:p,style:{borderRadius:8,background:`#f8f9fc`,border:`1px solid #e2e8f0`,color:`#64748b`,fontWeight:500},children:p?`加载中...`:`加载更多`})})]})]}),(0,$.jsxs)(mK,{title:`推送任务历史`,open:Ee,onCancel:()=>De(!1),footer:null,width:800,style:{borderRadius:8},mask:{closable:!1},children:[(0,$.jsxs)(`div`,{style:{marginBottom:16,display:`flex`,gap:4},children:[(0,$.jsx)(EC,{value:Re,onChange:e=>ze(e),placeholder:`选择状态`,style:{width:200,marginRight:12},options:[{value:`1`,label:`待推送`},{value:`2`,label:`推送中`},{value:`3`,label:`推送成功`},{value:`4`,label:`推送失败`}],allowClear:!0}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:4},children:[(0,$.jsx)(X,{type:`primary`,onClick:lt,style:{borderRadius:8},children:`查询`}),(0,$.jsx)(X,{icon:(0,$.jsx)(wq,{}),onClick:lt,style:{borderRadius:8},children:`刷新`})]})]}),(0,$.jsx)(LQ,{dataSource:Oe,columns:[{title:`素材名称`,dataIndex:`fileName`,key:`fileName`,width:200},{title:`账户ID`,dataIndex:`advertiserId`,key:`advertiserId`,width:180},{title:`状态`,dataIndex:`status`,key:`status`,width:100,render:e=>(0,$.jsx)(XQ,{color:{1:`#f59e0b`,2:`#6366f1`,3:`#10b981`,4:`#ef4444`}[e]||`#64748b`,style:{borderRadius:4},children:{1:`待推送`,2:`推送中`,3:`推送成功`,4:`推送失败`}[e]||e})},{title:`备注`,dataIndex:`note`,key:`note`,width:160,ellipsis:!0,render:e=>(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:e||`-`})},{title:`创建时间`,dataIndex:`createdAt`,key:`createdAt`,width:180,render:e=>M9(e)},{title:`更新时间`,dataIndex:`updatedAt`,key:`updatedAt`,width:180,render:e=>M9(e)}],loading:Ie,scroll:{x:`max-content`},pagination:{current:Me,pageSize:Pe,total:Ae,showSizeChanger:!0,showTotal:e=>`共 ${e} 条记录`,onChange:ut},rowKey:(e,t)=>e.task_id||e.resource_id||t,size:`small`})]}),_&&y&&(0,$.jsx)(mK,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:y.title||`预览`})]}),open:_,onCancel:Je,width:1200,footer:(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:12,padding:`16px 24px`,background:`#fff`,borderTop:`1px solid #f1f5f9`},children:[(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(m0,{}),onClick:()=>{x.current&&x.current.pause();let e=`http://ceshi.apiforeign.minzhong.cn${y.videoUrl||y.imageUrl}&download=1`,t=document.createElement(`a`);t.href=e,t.download=``,document.body.appendChild(t),t.click(),document.body.removeChild(t)},style:{borderRadius:8,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,boxShadow:`0 4px 16px rgba(99, 102, 241, 0.35)`,fontWeight:600,padding:`8px 24px`},disabled:Ge(y.videoUrl||y.imageUrl),children:Ge(y.videoUrl||y.imageUrl)?`资源已过期`:`下载`}),(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(u$,{}),onClick:()=>{let e=``,t=``;if(r===`shot_replicate`?(e=y.shotSegmentId,t=(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{marginBottom:8},children:`以下内容所连带的图片和视频都将被删除:`}),(0,$.jsx)(`ul`,{style:{margin:0,paddingLeft:20},children:(0,$.jsxs)(`li`,{style:{marginBottom:4,color:`#334155`},children:[y.shotReplicateProjectTitle,`— —`,y.shotSegmentLabel]})}),(0,$.jsx)(`div`,{style:{marginTop:12},children:`确定删除吗?`})]})):r===`hot_opening_replicate`?(e=y.moduleProjectId,t=(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{marginBottom:8},children:`爆款开头复刻中以下内容所连带的图片和视频都将被删除:`}),(0,$.jsx)(`ul`,{style:{margin:0,paddingLeft:20},children:(0,$.jsx)(`li`,{style:{marginBottom:4,color:`#334155`},children:y.moduleProjectTitle})}),(0,$.jsx)(`div`,{style:{marginTop:12},children:`确定删除吗?`})]})):(e=y.id,t=`确定删除该记录吗?`),!e){Z.warning(`无法获取删除ID`);return}mK.confirm({title:`确认删除`,content:t,okText:`确定删除`,cancelText:`取消`,okButtonProps:{danger:!0},onOk:async()=>{let t=``;r===`project`?t=`generation_record`:r===`creation`?t=`chat_task`:r===`hot_opening_replicate`?t=`hot_opening_replicate`:r===`shot_replicate`&&(t=`shot_replicate`);let n={history_source:t,ids:[e]};try{await l7(n),Z.success(`删除成功`),Je(),u(e=>({...e,page:1})),gt()}catch{Z.error(`删除失败,请重试`)}}})},style:{borderRadius:8,background:`linear-gradient(135deg, #bf0b0a 0%, #ff8165 100%)`,fontWeight:600,padding:`8px 24px`},disabled:Ge(y.videoUrl||y.imageUrl),children:`删除`}),(0,$.jsx)(X,{onClick:it,style:{borderRadius:8,background:`#f8f9fc`,border:`1px solid #e2e8f0`,color:`#64748b`,fontWeight:600,padding:`8px 24px`},disabled:Ge(y.videoUrl||y.imageUrl),children:`推送媒体后台`})]}),style:{borderRadius:16,overflow:`hidden`},styles:{body:{height:500,display:`flex`,flexDirection:`column`,padding:0},header:{background:`#fff`,borderBottom:`1px solid #f1f5f9`,padding:`16px 24px`},mask:{backgroundColor:`rgba(0, 0, 0, 0.5)`}},children:(0,$.jsxs)(`div`,{style:{width:`100%`,display:`flex`,height:`100%`,background:`#f8fafc`},children:[(0,$.jsx)(`div`,{style:{width:`70%`,height:`100%`,display:`flex`,justifyContent:`center`,alignItems:`center`,padding:20},children:Ge(y.videoUrl||y.imageUrl)?(0,$.jsxs)(`div`,{style:{textAlign:`center`,padding:`40px`,backgroundColor:`#fff`,borderRadius:12},children:[(0,$.jsx)(`div`,{style:{fontSize:48,marginBottom:16},children:`⚠️`}),(0,$.jsx)(`p`,{style:{fontSize:15,color:`#ef4444`,fontWeight:500,marginBottom:8},children:`资源已过期`}),(0,$.jsx)(`p`,{style:{fontSize:13,color:`#94a3b8`},children:`请刷新页面重新加载`})]}):a===`video`?(0,$.jsx)(`video`,{ref:x,src:`http://ceshi.apiforeign.minzhong.cn${y.videoUrl}`,controls:!0,autoPlay:!0,style:{maxWidth:`100%`,maxHeight:`100%`,borderRadius:12,objectFit:`contain`}}):(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn/static${y.imageUrl}&w=300&q=50`,alt:`预览`,style:{maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`,borderRadius:12}})}),(0,$.jsxs)(`div`,{style:{width:`30%`,height:`100%`,overflowY:`auto`,scrollbarWidth:`none`,backgroundColor:`#fff`,padding:24,borderLeft:`1px solid #f1f5f9`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:20},children:[(0,$.jsx)(`div`,{style:{width:2,height:18,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:1}}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:15,color:`#1e293b`,fontWeight:600},children:`文件信息`})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:14},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`类型`}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:600},children:a===`video`?`视频`:`图片`})]}),r===`hot_opening_replicate`&&(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,gap:4},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`类属`}),(0,$.jsxs)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:500,wordBreak:`break-all`,lineHeight:`1.5`},children:[`爆款复刻——`,y.moduleProjectTitle]})]}),r===`shot_replicate`&&(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,gap:4},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`类属`}),(0,$.jsxs)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:500,wordBreak:`break-all`,lineHeight:`1.5`},children:[y.shotReplicateProjectTitle,`— —`,y.shotSegmentLabel]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`请求`}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:500,wordBreak:`break-all`,lineHeight:`1.5`},children:y.originalPrompt})]}),a===`image`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`比例`}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:600},children:y.imageProportion})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`分辨率`}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:600},children:y.imageSize})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`尺寸`}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:600},children:y.imagePx})]})]}),a===`video`&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`比例`}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:600},children:y.aspectRatio})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`分辨率`}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:600},children:y.resolution})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`时长`}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:600},children:`${y.duration}秒`||`-`})]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`创建时间`}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:600},children:M9(y.createdAt||y.generatedDate)})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:13,fontWeight:500},children:`生成引擎`}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:600},children:y.engine||y.engineName||`-`})]})]}),(0,$.jsx)(`div`,{style:{borderTop:`1px solid #f1f5f9`,margin:`20px 0`}}),y.mediaReferences&&y.mediaReferences.length>0&&![`hot_opening_replicate`,`shot_replicate`].includes(r)&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:16},children:[(0,$.jsx)(`div`,{style:{width:2,height:18,background:`linear-gradient(180deg, #3b82f6 0%, #60a5fa 100%)`,borderRadius:1}}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:15,color:`#1e293b`,fontWeight:600},children:`依靠附件`})]}),y.mediaReferences.map((e,t)=>(0,$.jsxs)(`div`,{onClick:()=>{x.current&&x.current.pause();let t=`http://ceshi.apiforeign.minzhong.cn${e.url}`;window.open(t,`_blank`)},style:{display:`flex`,alignItems:`center`,gap:10,padding:`10px 12px`,borderRadius:8,cursor:`pointer`,backgroundColor:`#f8fafc`,marginBottom:8,transition:`all 0.25s ease`,border:`1px solid transparent`},onMouseEnter:e=>{let t=e.currentTarget;t.style.backgroundColor=`#e0f2fe`,t.style.borderColor=`#bae6fd`},onMouseLeave:e=>{let t=e.currentTarget;t.style.backgroundColor=`#f8fafc`,t.style.borderColor=`transparent`},children:[e.type===`image`?(0,$.jsx)(R6,{style:{color:`#3b82f6`,fontSize:16}}):(0,$.jsx)(t5,{style:{color:`#f59e0b`,fontSize:16}}),(0,$.jsx)(`span`,{style:{color:`#334155`,fontSize:13,fontWeight:500},children:e.name||`媒体${t+1}`})]},e.url))]})]})]})}),(0,$.jsx)(mK,{title:He.size===1?`推送配置`:`批量推送配置`,open:k,onCancel:()=>{A(!1),M([[]]),P([``]),H([void 0]),W(new Map),te(``)},footer:null,width:900,mask:{closable:!1},children:(0,$.jsxs)(`div`,{style:{padding:`16px 0`},children:[(0,$.jsxs)(Q.Text,{strong:!0,style:{fontSize:14,color:`#475569`,marginBottom:8,display:`block`},children:[`选中素材 (`,He.size,`个)`]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8,marginBottom:12,alignItems:`center`},children:[(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#64748b`},children:`统一修改名称:`}),(0,$.jsx)(IW,{value:ee,onChange:e=>te(e.target.value),placeholder:`输入名称后点击应用`,style:{flex:1,borderRadius:8},size:`small`}),(0,$.jsx)(X,{type:`primary`,size:`small`,onClick:()=>{ee.trim()&&He.size>0&&pt(Array.from(He),ee)},disabled:!ee.trim()||He.size===0,style:{borderRadius:8},children:`应用`})]}),(0,$.jsx)(`div`,{style:{maxHeight:300,overflow:`auto`,border:`1px solid #f0f0f0`,borderRadius:8,padding:12},children:(()=>{let e=new Map;return s.forEach(t=>{t.items.forEach(t=>{let n=Ye(t);e.set(n,t)})}),Array.from(He).map(t=>{let n=e.get(t);return(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12,padding:`8px 0`,borderBottom:`1px solid #f5f5f5`},children:[(0,$.jsx)(`div`,{style:{width:60,height:40,borderRadius:4,backgroundColor:`#f5f5f5`,display:`flex`,alignItems:`center`,justifyContent:`center`,overflow:`hidden`,flexShrink:0},children:(()=>{let e=a===`video`?n?.videoCoverUrl:n?.imageUrl;if(!e)return(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#94a3b8`},children:`预览`});let t=`http://ceshi.apiforeign.minzhong.cn`,r=e.startsWith(`/`)?e.slice(1):e;return(0,$.jsx)(`img`,{src:`${t.endsWith(`/`)?t.slice(0,-1):t}/static/${r}&w=300&q=50`,alt:``,style:{width:`100%`,height:`100%`,objectFit:`cover`}})})()}),(0,$.jsx)(`div`,{style:{flex:1,minWidth:0},children:(0,$.jsx)(Q.Text,{style:{fontSize:12,color:`#1e293b`},children:n?.fileName||`素材 ${n.id}`})}),(0,$.jsx)(IW,{value:U.has(t)?U.get(t):n?.fileName||``,onChange:e=>{let n=e.target.value,r=new Map(U);r.set(t,n),W(r)},onBlur:()=>{let e=U.get(t)||n?.fileName||``;e.trim()&&ft(t,e)},onKeyDown:e=>{if(e.key===`Enter`){let e=U.get(t)||n?.fileName||``;e.trim()&&ft(t,e)}},placeholder:`输入新名称`,style:{width:200,borderRadius:4},size:`small`})]},t)})})()})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:16,marginBottom:16},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(Q.Text,{style:{fontSize:14,color:`#475569`},children:`是否开启前测:`}),(0,$.jsx)(EC,{value:ve,onChange:e=>{ye(e),e===`1`?Z5().then(e=>{xe(e?.data?.id||``)}).catch(()=>{}):xe(``)},style:{width:120},options:[{value:`1`,label:`是`},{value:`2`,label:`否`}]})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(Q.Text,{style:{fontSize:14,color:`#475569`},children:`前测模板:`}),(0,$.jsx)(EC,{value:be,onChange:e=>xe(e),style:{width:200},disabled:ve!==`1`,loading:we,placeholder:ve===`1`?`选择前测模板`:`请先开启前测`,options:Se.map(e=>({value:e.id,label:e.name}))})]})]}),(0,$.jsx)(TL,{size:`small`,activeKey:ce,onChange:e=>{le(e),e===`history`&&ot()},items:[{key:`new`,label:`新增账户`},{key:`history`,label:`历史账户`}]}),ce===`new`&&(0,$.jsxs)(`div`,{children:[V.map((e,t)=>(0,$.jsxs)(`div`,{style:{marginBottom:16,padding:12,border:`1px solid #e2e8f0`,borderRadius:8},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:8},children:[(0,$.jsxs)(Q.Text,{strong:!0,style:{fontSize:14,color:`#475569`},children:[`授权账户 `,t+1]}),V.length>1&&(0,$.jsx)(X,{type:`text`,danger:!0,onClick:()=>{let e=[...V],n=[...N],r=[...j],i=[...q];e.splice(t,1),n.splice(t,1),r.splice(t,1),i.splice(t,1),H(e),P(n),M(r),se(i)},children:`删除`})]}),(0,$.jsx)(EC,{value:e,onChange:e=>{let n=[...V];n[t]=e,H(n)},placeholder:`点击选择授权账户`,style:{width:`100%`,marginBottom:12,borderRadius:8},popupRender:()=>(0,$.jsx)(`div`,{style:{padding:8,width:800,maxHeight:500,overflow:`auto`},children:(0,$.jsx)(LQ,{dataSource:F,columns:[{title:`授权账户ID`,dataIndex:`accountId`,key:`accountId`,width:120},{title:`授权账户名称`,dataIndex:`accountName`,key:`accountName`,width:120},{title:`授权账户角色`,dataIndex:`accountRole`,key:`accountRole`,width:160,render:e=>({ADVERTISER:`客户`,CUSTOMER_ADMIN:`普通版工作台-管理员`,CUSTOMER_OPERATOR:`普通版工作台-协作者`,AGENT:`代理商`,CHILD_AGENT:`二级代理商`,PLATFORM_ROLE_STAR:`星图账户`,PLATFORM_ROLE_SHOP_ACCOUNT:`抖音店铺账户`,PLATFORM_ROLE_QIANCHUAN_AGENT:`千川代理商`,PLATFORM_ROLE_STAR_AGENT:`星图代理商`,PLATFORM_ROLE_AWEME:`抖音号`,PLATFORM_ROLE_STAR_MCN:`星图MCN机构`,PLATFORM_ROLE_STAR_ISV:`星图服务商`,AGENT_SYSTEM_ACCOUNT:`代理商系统账户`,PLATFORM_ROLE_LOCAL_AGENT:`本地推代理商`,PLATFORM_ROLE_YUNTU_BRAND_ISV_ADMIN:`云图品牌服务商管理员`,PLATFORM_ROLE_LIFE:`抖音来客账户`,PLATFORM_ROLE_ENTERPRISE_BP_ADMIN:`升级版工作台管理员`,PLATFORM_ROLE_ENTERPRISE_BP_OPERATOR:`升级版工作台协作者`})[e]||e},{title:`授权账户用户名`,dataIndex:`accountUsername`,key:`accountUsername`,width:120,render:e=>(0,$.jsx)(`span`,{style:{color:e?`#1e293b`:`#94a3b8`},children:e||`-`})},{title:`授权用户ID`,dataIndex:`accountUserid`,key:`accountUserid`,width:120}],loading:L,pagination:{current:ie,pageSize:oe,total:z,showSizeChanger:!0,showTotal:e=>`共 ${e} 条记录`,onChange:(e,t)=>{ae(e),K(t),at(e,t)}},rowKey:`id`,size:`small`,scroll:{x:`max-content`},onRow:n=>({onClick:()=>{let e=String(n.id),r=[...V];r[t]={value:e,label:String(n.accountId)+`-`+(n.accountName||`-`)},H(r);let i=[...q];i[t]=!1,se(i)},style:{cursor:`pointer`,backgroundColor:e?.value===String(n.id)?`#e6f7ff`:void 0}})})}),open:q[t],onOpenChange:e=>{let n=[...q];n[t]=e,se(n),e&&at(1,oe)},labelInValue:!0,fieldNames:{label:`accountUserid`,value:`id`}}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:14,color:`#475569`,marginBottom:8,display:`block`},children:`粘贴账户ID(每行一个或用逗号分隔)`}),(0,$.jsx)(IW.TextArea,{value:N[t],onChange:e=>{let n=e.target.value,r=[...N];r[t]=n,P(r);let i=n.split(/[\n,]/).map(e=>e.trim()).filter(e=>e.length>0),a=[...new Set(i)].map(e=>({accountId:e})),o=new Set,s=a.filter(e=>o.has(e.accountId)?!1:(o.add(e.accountId),!0)),c=[...j];c[t]=s,M(c)},placeholder:`粘贴账户ID,每行一个或用逗号分隔,例如:\r + 10001,10002,10003\r 10004`,rows:3,style:{borderRadius:8}})]},t)),(0,$.jsx)(X,{type:`dashed`,block:!0,onClick:()=>{H([...V,void 0]),P([...N,``]),M([...j,[]]),se([...q,!1])},style:{borderRadius:8,marginBottom:16},children:`+ 新增授权账户组`})]}),ce===`history`&&(0,$.jsx)(`div`,{style:{padding:8},children:fe?(0,$.jsx)(`div`,{style:{textAlign:`center`,padding:40},children:`加载中...`}):ue.length===0?(0,$.jsx)(XS,{description:`暂无可选账户`}):(0,$.jsx)(k$,{style:{width:`100%`},dataSource:ue.filter(e=>e.advertiserId).map((e,t)=>({key:String(e.advertiserId)||`item-${t}`,title:String(e.advertiserId),description:e.advertiserName||``,...e})),targetKeys:me.filter(e=>e.advertiserId).map(e=>String(e.advertiserId)),onChange:e=>{he(ue.filter(t=>t.advertiserId&&e.includes(String(t.advertiserId))))},titles:[`可选账户列表`,`已选账户列表`],showSearch:!0,filterOption:(e,t)=>String(t.advertiserId).toLowerCase().includes(e.toLowerCase())||t.advertiserName&&t.advertiserName.toLowerCase().includes(e.toLowerCase()),children:({direction:e,filteredItems:t,onItemSelect:n,onItemSelectAll:r,selectedKeys:i,disabled:a})=>(0,$.jsx)(LQ,{rowSelection:{getCheckboxProps:()=>({disabled:a}),onChange:e=>{r(e,`replace`)},selectedRowKeys:i,selections:[LQ.SELECTION_ALL,LQ.SELECTION_INVERT,LQ.SELECTION_NONE]},columns:[{title:`账户ID`,dataIndex:`advertiserId`,key:`advertiserId`,width:120},{title:`账户名称`,dataIndex:`advertiserName`,key:`advertiserName`,width:150}],dataSource:t,size:`small`,style:{pointerEvents:a?`none`:void 0},pagination:!1,scroll:{x:`max-content`,y:400},onRow:({key:e,disabled:t})=>({onClick:()=>{t||a||n(e,!i.includes(e))}})})})}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:12,justifyContent:`flex-end`},children:[(0,$.jsx)(X,{onClick:()=>{A(!1),M([[]]),P([``]),H([void 0]),W(new Map),te(``)},style:{borderRadius:8},children:`取消`}),(0,$.jsx)(X,{type:`primary`,onClick:dt,loading:D,disabled:D||(ce===`new`?j.every(e=>e.length===0):me.length===0),style:{borderRadius:8},children:D?`推送中...`:`开始推送`})]})]})})]})},j9=document.createElement(`style`);j9.textContent=` @keyframes spin { from { transform: rotate(0deg); } @@ -554,4 +610,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho div::-webkit-scrollbar { display: none; } - `}),(0,$.jsx)(`div`,{style:{margin:`auto`,display:`flex`,flexDirection:`column`,width:y.length>0?`${y.length*80+Math.max(0,y.length-1)*1}px`:`100%`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,height:86,borderRadius:12,background:`#fff`,gap:1,position:`relative`},children:[x&&y.length===0?(0,$.jsxs)(`div`,{style:{flex:`1 1 auto`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:[(0,$.jsx)(UG,{size:`small`}),(0,$.jsx)(Rse,{style:{marginLeft:8,color:`#64748b`},children:`正在抽取每秒帧...`})]}):y.length>0?y.map(e=>{let t=e.second>=_[0]&&e.second<_[1];return(0,$.jsxs)(`button`,{type:`button`,onClick:()=>I(e.second),title:`${e.second}s${e.fallback?`,实际取帧 ${e.captureSecond?.toFixed(1)}s`:``}`,style:{minWidth:80,flex:`0 0 80px`,height:86,borderTop:t?`5px solid #6366f1`:`none`,borderBottom:t?`5px solid #6366f1`:`none`,padding:0,background:`transparent`,overflow:`hidden`,cursor:A?`not-allowed`:`pointer`,position:`relative`},children:[e.status===`success`&&e.image?(0,$.jsx)(`img`,{src:e.image,alt:`${e.second}s`,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}}):e.status===`loading`?(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(UG,{size:`small`})}):(0,$.jsxs)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,color:`#64748b`,fontSize:12,background:`#fff`},children:[(0,$.jsxs)(`span`,{children:[e.second,`s`]}),(0,$.jsx)(`span`,{style:{fontSize:11},children:`无有效帧`})]}),(0,$.jsxs)(`span`,{style:{position:`absolute`,left:0,bottom:3,color:`#ffffffff`,fontSize:16,textShadow:`0 1px 3px rgba(0,0,0,.7)`},children:[e.second,`s`]})]},e.second)}):(0,$.jsx)(`div`,{style:{flex:`1 1 auto`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#64748b`},children:`暂无帧预览,请确认视频是否加载完成`}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:-10,left:0,right:0,bottom:0},children:(0,$.jsx)(zB,{range:!0,min:0,max:O||a,step:1,value:_,onChange:P,onChangeComplete:F,tooltip:{formatter:e=>`${B9(Number(e||0))}s`},disabled:!O||A,styles:{track:{background:`#6969dd63`,height:86,borderRadius:12,margin:`0 `},rail:{height:86,borderRadius:12},handle:{width:20,height:86,marginTop:0,borderRadius:`50%`}}})})]})})]}),(0,$.jsxs)(`div`,{style:{marginTop:16,textAlign:`center`,color:`#64748b`,fontSize:14},children:[`已选取 `,k,`s`]}),E&&(0,$.jsx)(`div`,{style:{marginTop:12,padding:`10px 14px`,borderRadius:8,background:`rgba(239, 68, 68, 0.08)`,border:`1px solid rgba(239, 68, 68, 0.15)`,color:`#ef4444`,fontSize:13,textAlign:`center`},children:E})]})]})})},{TextArea:qse}=IW,Jse=`http://ceshi.apiforeign.minzhong.cn`,G9=2,K9=15;function q9(e){return e?/^https?:\/\//i.test(e)?e:`${Jse}${e}`:``}function Yse(){let{creatID:e}=$e(),t=Ye(),[n,r]=(0,S.useState)(!1),[i,a]=(0,S.useState)(!1),[o,s]=(0,S.useState)(null),[c,l]=(0,S.useState)(null),[u,d]=(0,S.useState)(null),[f,p]=(0,S.useState)(!1),m=(0,S.useRef)(null),[h,g]=(0,S.useState)(``),[_,v]=(0,S.useState)(``),[y,b]=(0,S.useState)(``),[x,C]=(0,S.useState)(``),[w,T]=(0,S.useState)(null),[E,D]=(0,S.useState)([]),[O,k]=(0,S.useState)(!1),[A,j]=(0,S.useState)(!1),[M,N]=(0,S.useState)(!1),P=(0,S.useRef)(null),F=(0,S.useRef)(null),I=(0,S.useMemo)(()=>q9(w?.videoUrl),[w?.videoUrl]),L=(0,S.useMemo)(()=>E.length===0?`AI自动拆分`:E.some(e=>e.sourceMode===`ai_suggestion`)?`AI重拆`:`AI自动拆分`,[E]),R=(0,S.useCallback)(async()=>{if(e)try{T(await $5(e))}catch{Z.error(`获取任务详情失败`)}},[e]),z=(0,S.useCallback)(async()=>{if(e)try{let t=(await e7(e)).items||[];D(t),t.some(e=>e.moduleProjectCurrentStepCode!==`video_generate`&&e.moduleProjectStatus!==`completed`&&e.moduleProjectStatus!==`failed`)?P.current||=window.setInterval(async()=>{try{let t=(await e7(e)).items||[];D(e=>e.map(e=>{let n=t.find(t=>t.id===e.id);return n&&(e.split_status||e.splitStatus,n.split_status||n.splitStatus,e.moduleProjectCurrentStepCode!==`video_generate`||e.moduleProjectStatus!==`completed`&&e.moduleProjectStatus!==`failed`)?n:e})),t.every(e=>e.moduleProjectCurrentStepCode===`video_generate`||e.moduleProjectStatus===`completed`||e.moduleProjectStatus===`failed`)&&(P.current&&=(clearInterval(P.current),null))}catch{}},3e4):P.current&&=(clearInterval(P.current),null)}catch{Z.error(`获取拆镜列表失败`)}},[e]),B=(0,S.useCallback)(async()=>{if(e)try{await cae(e),Z.success(`重新分析已提交`),R(),F.current||=window.setInterval(async()=>{try{let t=await $5(e);T(t),(t.analysisStatus===`completed`||t.analysisStatus===`failed`)&&(F.current&&=(clearInterval(F.current),null))}catch{}},3e3)}catch(e){Z.error(e?.message||`重新分析失败`)}},[e,R]),V=(0,S.useCallback)(async e=>{try{await uae(e),Z.success(`重新分析已提交`),z()}catch(e){Z.error(e?.message||`重新分析失败`)}},[z]),H=(0,S.useCallback)(async t=>{try{await dae(t),Z.success(`重新切割已提交`),await z(),!P.current&&e&&(P.current=window.setInterval(async()=>{try{let t=(await e7(e)).items||[];D(e=>e.map(e=>{let n=t.find(t=>t.id===e.id);return n&&(e.moduleProjectCurrentStepCode!==`video_generate`||e.moduleProjectStatus!==`completed`&&e.moduleProjectStatus!==`failed`)?n:e})),t.every(e=>e.moduleProjectCurrentStepCode===`video_generate`||e.moduleProjectStatus===`completed`||e.moduleProjectStatus===`failed`)&&(P.current&&=(clearInterval(P.current),null))}catch{P.current&&=(clearInterval(P.current),null)}},3e3))}catch(e){Z.error(e?.message||`重新切割失败`)}},[e,z]),U=(0,S.useCallback)(async e=>{try{await lae(e),Z.success(`删除成功`),z()}catch(e){Z.error(e?.message||`删除失败`)}},[z]),W=(0,S.useCallback)(async()=>{await Promise.all([R(),z()])},[R,z]);(0,S.useEffect)(()=>(W(),()=>{P.current&&=(clearInterval(P.current),null),F.current&&=(clearInterval(F.current),null)}),[W]),(0,S.useEffect)(()=>{if(w)return w.analysisStatus===`processing`?F.current=window.setInterval(async()=>{try{T(await $5(e))}catch{}},3e3):F.current&&=(clearInterval(F.current),null),()=>{F.current&&=(clearInterval(F.current),null)}},[w?.analysisStatus,e]);let ee=(e,t)=>{s(e),l(t),r(!0)},te=()=>{r(!1),s(null),g(``),l(``),v(``),b(``),C(``)},G=async e=>{try{let t=await jie(e);b(t.url),C(t.resource_id||``),Z.success(`图片上传成功`)}catch{Z.error(`图片上传失败,请重试`)}return!1},ne=async()=>{if(!o){Z.warning(`请先选择拆镜片段`);return}if(!y){Z.warning(`请上传产品图`);return}if(!h.trim()){Z.warning(`请输入产品名称`);return}if(!_.trim()){Z.warning(`请输入产品卖点`);return}let n={target_project_name:h.trim(),core_content_point:_.trim(),material_image_url:y,material_image_resource_id:x||void 0,idempotency_key:`replication_${Date.now()}`};k(!0);try{await rae(o,n),Z.success(`视频生成任务创建成功`),te(),e7(e).then(e=>{let n=e.items.find(e=>e.id===o);Z.loading(`创建中...`,3),setTimeout(()=>{t(`/removelens/${n.moduleProjectId}/removefenbu`)},3e3)})}catch(e){Z.error(e?.message||`创建失败,请重试`)}finally{k(!1)}},re=async()=>{if(e){N(!0);try{let t=E.some(e=>e.sourceMode===`ai_suggestion`);await tae(e,{selected_indices:[],replace_existing:t}),Z.success(t?`AI 重拆任务已提交`:`AI 拆镜任务已提交`),await W()}catch(e){Z.error(e?.message||`拆镜失败`)}finally{N(!1)}}},ie=()=>{if(!I){Z.warning(`原视频地址不存在`);return}a(!0)},ae=async t=>{if(e){if(t.durationSecondK9){Z.warning(`拆镜片段不能超过 ${K9} 秒`);return}j(!0);try{await nae(e,{start_second:t.startSecond,end_second:t.endSecond}),Z.success(`手动拆镜任务已提交`),a(!1),await W()}catch(e){Z.error(e?.message||`手动拆镜失败`)}finally{j(!1)}}},oe=e=>e?.splitStatus===`completed`&&!!e?.segmentVideoUrl;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{margin:`-24px -32px -32px`,borderRadius:20,minHeight:`calc(100vh - 34px)`,display:`flex`,flexDirection:`column`,overflow:`hidden`,background:`linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #f0f9ff 100%)`,position:`relative`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:-100,right:-100,width:300,height:300,background:`radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%)`,borderRadius:`50%`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,bottom:-100,left:-100,width:300,height:300,background:`radial-gradient(circle, rgba(167,139,250,0.08) 0%, transparent 70%)`,borderRadius:`50%`}}),(0,$.jsx)(`div`,{style:{padding:`16px 24px`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,borderRadius:16,background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,border:`1px solid rgba(99, 102, 241, 0.08)`,position:`relative`,zIndex:10},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16},children:[(0,$.jsx)(X,{icon:(0,$.jsx)(b2,{}),onClick:()=>t(-1),style:{borderRadius:10,fontSize:13,height:32,background:`rgba(99, 102, 241, 0.1)`,border:`1px solid rgba(99, 102, 241, 0.2)`,color:`#6366f1`},children:`返回`}),(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #6366f1, #8b5cf6, transparent)`,borderRadius:1}}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h1`,{style:{fontSize:18,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,margin:0},children:`AI视频拆镜工作台`}),(0,$.jsx)(`p`,{style:{fontSize:13,color:`#64748b`,margin:`4px 0 0 0`},children:`一键拆解画面分镜,助力仿拍或创作`})]}),(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #8b5cf6, #6366f1, transparent)`,borderRadius:1}})]})}),w?(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,justifyContent:`space-between`,overflow:`hidden`},children:[(0,$.jsxs)(`div`,{style:{flex:1,background:`linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.6) 100%)`,backdropFilter:`blur(20px)`,borderRadius:20,display:`flex`,alignItems:`center`,gap:30,padding:24,border:`1px solid rgba(99, 102, 241, 0.1)`,position:`relative`,overflow:`hidden`},children:[(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{position:`relative`,width:280,height:160,borderRadius:12,overflow:`hidden`,flexShrink:0,boxShadow:`0 4px 16px rgba(0,0,0,0.1)`,cursor:`pointer`},onClick:()=>{d(I),p(!0)},onMouseEnter:e=>{let t=e.currentTarget.querySelector(`div:last-child`);t&&(t.style.opacity=`1`)},onMouseLeave:e=>{let t=e.currentTarget.querySelector(`div:last-child`);t&&(t.style.opacity=`0`)},children:[(0,$.jsx)(`video`,{src:I,style:{width:`100%`,height:`100%`,objectFit:`cover`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:0,left:0,right:0,bottom:0,background:`rgba(0,0,0,0.2)`,display:`flex`,alignItems:`center`,justifyContent:`center`,opacity:0,transition:`opacity 0.2s`},children:(0,$.jsx)(`div`,{style:{width:40,height:40,borderRadius:`50%`,background:`rgba(255,255,255,0.9)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`#6366f1`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,$.jsx)(`polygon`,{points:`5 3 19 12 5 21 5 3`})})})})]}),w.analysisStatus===`failed`&&(0,$.jsx)(`div`,{style:{marginTop:12,textAlign:`center`},children:(0,$.jsx)(X,{onClick:B,style:{width:`100%`,padding:`6px 16px`,borderRadius:8,fontSize:12,border:`1px solid #ef4444`,color:`#ef4444`,background:`rgba(239, 68, 68, 0.05)`,cursor:w.analysisStatus===`processing`?`not-allowed`:`pointer`,transition:`all 0.2s`},onMouseEnter:e=>{w.analysisStatus!==`processing`&&(e.currentTarget.style.background=`rgba(239, 68, 68, 0.1)`)},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(239, 68, 68, 0.05)`},children:w.analysisStatus===`processing`?`分析中...`:`重新分析`})})]}),(0,$.jsx)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,justifyContent:`space-between`,position:`relative`,zIndex:1},children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,$.jsx)(`h2`,{style:{fontSize:20,fontWeight:600,marginBottom:16,background:`linear-gradient(135deg, #1e293b 0%, #334155 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`},children:`视频总结`}),(0,$.jsx)(`div`,{style:{textAlign:`right`},children:(0,$.jsxs)(`span`,{style:{color:`#94a3b8`,fontSize:12},children:[`上传时间: `,w.createdAt?new Date(w.createdAt).toLocaleString(`zh-CN`,{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}):`-`]})})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,marginBottom:12},children:[(0,$.jsx)(`span`,{style:{color:`#64748b`,fontSize:14,marginRight:12,width:80,flexShrink:0},children:`产品名称:`}),(0,$.jsx)(`span`,{style:{color:`#1e293b`,fontWeight:500},children:w.title})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,marginBottom:12},children:[(0,$.jsx)(`span`,{style:{color:`#64748b`,fontSize:14,marginRight:12,width:80,flexShrink:0},children:`受众群体:`}),w.analysisStatus===`processing`?(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(UG,{size:`small`,style:{color:`#f59e0b`}}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#f59e0b`},children:`分析中`})]}):w.analysisStatus===`completed`?(0,$.jsx)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`},children:(w.originalVideoAudience?.split(`、`)||[]).map((e,t)=>(0,$.jsx)(XQ,{style:{fontSize:12,background:`rgba(99, 102, 241, 0.1)`,color:`#6366f1`,border:`none`,borderRadius:20},children:e},t))}):w.analysisStatus===`failed`?(0,$.jsx)(`span`,{style:{color:`#ef4444`,fontSize:14},children:`分析失败`}):null]}),(0,$.jsxs)(`div`,{style:{display:`flex`},children:[(0,$.jsx)(`span`,{style:{color:`#64748b`,fontSize:14,marginRight:12,width:80,flexShrink:0},children:`视频内容:`}),w.analysisStatus===`processing`?(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(UG,{size:`small`,style:{color:`#f59e0b`}}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#f59e0b`},children:`分析中`})]}):w.analysisStatus===`completed`?(0,$.jsx)(`span`,{style:{color:`#475569`,lineHeight:1.6,height:100,overflowY:`auto`},children:w.originalVideoContent}):w.analysisStatus===`failed`?(0,$.jsx)(`span`,{style:{color:`#ef4444`,fontSize:14},children:`分析失败`}):null]})]})})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:16,marginBottom:20,marginTop:20},children:[(0,$.jsx)(X,{type:`default`,onClick:ie,disabled:!I||A,style:{flex:1,height:52,borderRadius:12,border:`2px solid rgba(99, 102, 241, 0.3)`,color:`#6366f1`,fontWeight:600,fontSize:15,background:`rgba(255, 255, 255, 0.9)`,backdropFilter:`blur(10px)`,transition:`all 0.3s cubic-bezier(0.4, 0, 0.2, 1)`},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#6366f1`,e.currentTarget.style.boxShadow=`0 4px 20px rgba(99, 102, 241, 0.2)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.3)`,e.currentTarget.style.boxShadow=`none`},children:`手动`}),(0,$.jsx)(vK,{title:L===`AI重拆`?`确定要AI重拆吗?`:`确定要AI拆分吗?`,okText:`确定`,cancelText:`取消`,onConfirm:re,children:(0,$.jsxs)(X,{type:`primary`,loading:M,disabled:M,style:{flex:1,height:52,borderRadius:12,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%)`,fontWeight:600,fontSize:15,border:`none`,boxShadow:`0 4px 20px rgba(99, 102, 241, 0.3)`,transition:`all 0.3s cubic-bezier(0.4, 0, 0.2, 1)`,position:`relative`,overflow:`hidden`},onMouseEnter:e=>{e.currentTarget.style.transform=`translateY(-2px)`,e.currentTarget.style.boxShadow=`0 6px 25px rgba(99, 102, 241, 0.4)`},onMouseLeave:e=>{e.currentTarget.style.transform=`translateY(0)`,e.currentTarget.style.boxShadow=`0 4px 20px rgba(99, 102, 241, 0.3)`},children:[(0,$.jsx)(`span`,{style:{position:`relative`,zIndex:1},children:L}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:0,left:`-100%`,width:`100%`,height:`100%`,background:`linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent)`,transition:`left 0.5s ease`},onMouseEnter:e=>{e.currentTarget.style.left=`100%`}}),w?.aiSuggestions&&w.aiSuggestions.length>0&&(0,$.jsx)(gw,{title:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{fontWeight:600,marginBottom:8,color:`#6366f1`},children:`AI拆分方案`}),(w?.ai_suggestions||w?.aiSuggestions||[]).map(e=>(0,$.jsxs)(`div`,{style:{marginBottom:8,fontSize:13,lineHeight:1.5},children:[(0,$.jsxs)(`span`,{style:{fontWeight:500,color:`#6366f1`},children:[e.index,`.`]}),(0,$.jsx)(`span`,{style:{marginLeft:4,color:`#000000ff`},children:e.timeNode}),(0,$.jsx)(`br`,{}),(0,$.jsx)(`span`,{style:{color:`#666`},children:e.content})]},e.index))]}),placement:`top`,trigger:`hover`,overlayInnerStyle:{backgroundColor:`#fff`,height:300,overflowY:`auto`,border:`1px solid rgba(99, 102, 241, 0.1)`,borderRadius:12,boxShadow:`0 8px 24px rgba(99, 102, 241, 0.12)`},children:(0,$.jsx)(`span`,{style:{marginLeft:8,fontSize:13,opacity:.9},children:`(AI 镜头拆分方案)`})})]})})]}),(0,$.jsxs)(`div`,{style:{flex:2,background:`linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%)`,backdropFilter:`blur(20px)`,borderRadius:20,overflow:`hidden`,display:`flex`,flexDirection:`column`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`},children:[(0,$.jsxs)(`div`,{style:{padding:`16px 24px`,borderBottom:`1px solid rgba(99, 102, 241, 0.1)`,background:`linear-gradient(135deg, rgba(99,102,241,0.02) 0%, transparent 100%)`},children:[(0,$.jsx)(`h3`,{style:{fontSize:16,fontWeight:600,color:`#1e293b`,margin:0},children:`拆镜片段列表`}),(0,$.jsxs)(`span`,{style:{fontSize:12,color:`#64748b`,marginLeft:12},children:[`共 `,E.length,` 个片段`]})]}),(0,$.jsx)(LQ,{columns:[{title:`片段`,width:100,fixed:`left`,align:`center`,render:(e,t)=>(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{fontSize:16,fontWeight:600,color:`#333`},children:t.segmentName||`片段${t.segmentIndex||``}`}),(0,$.jsx)(`div`,{style:{fontSize:12,color:`#999`},children:t.timeNode}),t.sourceMode===`custom`&&(0,$.jsx)(XQ,{color:`blue`,style:{marginTop:6},children:`手动`}),t.sourceMode===`ai_suggestion`&&(0,$.jsx)(XQ,{color:`orange`,style:{marginTop:6},children:`自动`})]})},{title:`片段视频`,width:150,align:`center`,render:(e,t)=>(0,$.jsx)(`div`,{style:{position:`relative`,width:120,height:80,borderRadius:6,overflow:`hidden`,background:`#f1f5f9`,cursor:`pointer`},onClick:()=>{t.segmentVideoUrl&&(d(q9(t.segmentVideoUrl)),p(!0))},children:t.segmentVideoUrl?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`video`,{src:q9(t.segmentVideoUrl),style:{width:`100%`,height:`100%`,objectFit:`cover`,pointerEvents:`none`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:0,left:0,right:0,bottom:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`rgba(0,0,0,0.3)`},children:(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:`50%`,background:`rgba(255,255,255,0.9)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`div`,{style:{width:0,height:0,borderTop:`8px solid transparent`,borderBottom:`8px solid transparent`,borderLeft:`14px solid #6366f1`,marginLeft:2}})})})]}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:6,fontSize:12},children:t.splitStatus===`failed`?(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`切割失败`}):(t.splitStatus,(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(UG,{size:`small`,style:{color:`#f59e0b`}}),(0,$.jsx)(`span`,{style:{color:`#f59e0b`},children:`切割中`})]}))})})},{title:`视频内容`,width:500,align:`left`,render:(e,t)=>{let n=t.split_status||t.splitStatus;if(n===`pending`)return(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(UG,{size:`small`,style:{color:`#f59e0b`}}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#f59e0b`},children:`切割中`})]});if(n===`processing`)return(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(UG,{size:`small`}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#f59e0b`},children:`切割中`})]});if(t.source_mode===`ai_suggestion`||t.sourceMode===`ai_suggestion`)return(0,$.jsx)(`div`,{style:{fontSize:14,color:`#333`,lineHeight:1.6},children:t.segmentContent||t.lastError||`-`});let r=t.analysis_status||t.analysisStatus,i={not_required:`无需单独分析`,pending:`等待分析`,processing:`分析中`,failed:`分析失败`};return r===`processing`?(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(UG,{size:`small`}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#f59e0b`},children:`分析中`})]}):r===`failed`?(0,$.jsx)(`div`,{style:{fontSize:14,color:`#ef4444`,lineHeight:1.6},children:`分析失败`}):(0,$.jsx)(`div`,{style:{fontSize:14,color:`#333`,lineHeight:1.6},children:r&&i[r]?i[r]:t.segmentContent||t.lastError||`-`})}},{title:`视频类型`,width:120,align:`center`,render:(e,t)=>(0,$.jsx)(`div`,{style:{fontSize:14,color:`#333`,fontWeight:500},children:t.segmentCategory||`-`})},{title:`状态`,width:120,align:`center`,dataIndex:`moduleProjectStatus`,render:(e,t)=>{let n=e,r=t.moduleProjectCurrentStepCode||t.currentStepCode,i=(()=>{if(r===`image_prompt_optimize`)switch(n){case`waiting_user`:return{text:`等待融合图生成`,color:`#f59e0b`};case`processing`:return{text:`图片提示词生成中`,color:`#f59e0b`};case`completed`:return{text:`图片提示词生成成功`,color:`#10b981`};case`failed`:return{text:`图片提示词生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`image_generate`)switch(n){case`waiting_user`:return{text:`等待生成视频提示词`,color:`#f59e0b`};case`processing`:return{text:`融合图生成中`,color:`#f59e0b`};case`completed`:return{text:`融合图生成成功`,color:`#10b981`};case`failed`:return{text:`融合图生成失败`,color:`#ef4444`};default:return n||`-`}else if(r===`video_prompt_optimize`)switch(n){case`waiting_user`:return{text:`等待最终视频生成`,color:`#f59e0b`};case`processing`:return{text:`视频提示词生成中`,color:`#f59e0b`};case`completed`:return{text:`视频提示词生成成功`,color:`#10b981`};case`failed`:return{text:`视频提示词生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`video_generate`)switch(n){case`waiting_user`:return{text:``,color:`#666`};case`processing`:return{text:`最终视频生成中`,color:`#f59e0b`};case`completed`:return{text:`任务完成`,color:`#10b981`};case`failed`:return{text:`最终视频生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`material_input`)switch(n){case`waiting_user`:return{text:`等待生成图片提示词`,color:`#f59e0b`};case`processing`:return{text:`素材处理中`,color:`#f59e0b`};case`completed`:return{text:`素材上传成功`,color:`#10b981`};case`failed`:return{text:`素材上传失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else return t.moduleProjectId?{pending:{text:`子任务待处理`,color:`#f59e0b`},waiting_user:{text:`等待用户确认或触发`,color:`#f59e0b`},processing:{text:`子任务处理中`,color:`#f59e0b`},completed:{text:`子任务完成`,color:`#10b981`},failed:{text:`子任务失败`,color:`#ef4444`},cancelled:{text:`子任务取消`,color:`#94a3b8`}}[n]||{text:n||`-`,color:`#666`}:{text:`待生成任务`,color:`#94a3b8`}})();return typeof i==`string`?(0,$.jsx)(`span`,{style:{fontSize:12,color:`#666`,fontWeight:500},children:i}):(0,$.jsx)(`span`,{style:{fontSize:12,color:i.color,fontWeight:500},children:i.text})}},{title:`操作`,width:200,fixed:`right`,align:`center`,render:(e,n)=>(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[n.moduleProjectId?(0,$.jsx)(X,{type:`text`,onClick:()=>t(`/removelens/${n.moduleProjectId}/removefenbu`),style:{color:`#10b981`,fontSize:12,padding:0,display:`flex`,alignItems:`center`,gap:4},children:`详情任务`}):(0,$.jsx)(X,{type:`text`,onClick:()=>ee(String(n.id),n.segmentName),disabled:!oe(n),style:{color:oe(n)?`#f59e0b`:`#94a3b8`,fontSize:12,padding:0,display:`flex`,alignItems:`center`,gap:4},children:oe(n)?`视频生成`:`待切割完成`}),n.analysisStatus===`failed`&&(0,$.jsx)(X,{type:`text`,onClick:()=>V(String(n.id)),style:{color:`#f89411ff`,fontSize:12,padding:0,display:`flex`,alignItems:`center`,gap:4},children:`重新分析`}),n.splitStatus===`failed`&&(0,$.jsx)(X,{type:`text`,onClick:()=>H(String(n.id)),style:{color:`#f89411ff`,fontSize:12,padding:0,display:`flex`,alignItems:`center`,gap:4},children:`重新切割`}),(0,$.jsx)(vK,{title:`确定删除此片段?`,onConfirm:()=>U(String(n.id)),okText:`确定`,cancelText:`取消`,children:(0,$.jsx)(X,{type:`text`,style:{color:`#ef4444`,fontSize:12,padding:0,display:`flex`,alignItems:`center`,gap:4},children:`删除`})})]})}],dataSource:E,pagination:!1,bordered:!1,rowKey:`id`,scroll:{y:300},style:{flex:1},components:{body:{row:({className:e,style:t,...n})=>(0,$.jsx)(`tr`,{...n,className:e,style:{...t,transition:`all 0.2s ease`,borderBottom:`1px solid rgba(99, 102, 241, 0.05)`,height:80,overflow:`auto`}}),cell:({className:e,style:t,...n})=>(0,$.jsx)(`td`,{...n,className:e,style:{...t,padding:`16px 24px`}})},header:{cell:({className:e,style:t,...n})=>(0,$.jsx)(`th`,{...n,className:e,style:{...t,background:`rgba(255, 255, 255, 1)`,color:`#64748b`,fontWeight:500,fontSize:13,padding:`16px 24px`,borderBottom:`none`}})}}})]})]}):(0,$.jsx)(`div`,{style:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`span`,{style:{fontSize:16,color:`#999`},children:`加载中...`})})]}),(0,$.jsx)(Kse,{open:i,videoUrl:I,title:`手动视频切片`,loading:A,minDuration:G9,maxDuration:K9,onCancel:()=>a(!1),onConfirm:ae}),(0,$.jsx)(QV,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,width:`100%`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:18,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`},children:`智能视频复刻`}),c&&(0,$.jsxs)(`span`,{style:{fontSize:14,color:`#64748b`},children:[`- `,c]})]}),(0,$.jsx)(X,{type:`text`,icon:(0,$.jsx)(c5,{}),onClick:te,style:{padding:0,color:`#64748b`,fontSize:14}})]}),placement:`right`,closable:!1,onClose:te,open:n,size:480,styles:{body:{padding:`24px`,background:`linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%)`},header:{background:`#fff`,borderBottom:`1px solid rgba(99, 102, 241, 0.1)`,padding:`20px 24px`},section:{borderRadius:`20px 0 0 20px`,overflow:`hidden`}},children:(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:20},children:[(0,$.jsxs)(`div`,{style:{background:`#fff`,borderRadius:12,padding:16,border:`1px solid rgba(99, 102, 241, 0.1)`},children:[(0,$.jsxs)(`label`,{style:{fontWeight:500,color:`#334155`,marginBottom:8,display:`block`,fontSize:14},children:[`产品白底图 `,(0,$.jsx)(`span`,{style:{color:`#ef4444`},children:`*`})]}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:12},children:(0,$.jsx)(`div`,{style:{width:120,height:120,borderRadius:8,border:`2px dashed rgba(99, 102, 241, 0.3)`,background:`rgba(99, 102, 241, 0.02)`,position:`relative`,overflow:`hidden`},children:y?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`img`,{src:q9(y),alt:`产品图`,style:{width:`100%`,height:`100%`,objectFit:`cover`}}),(0,$.jsx)(`button`,{onClick:()=>{b(``),C(``)},style:{position:`absolute`,bottom:4,right:4,width:24,height:24,borderRadius:`50%`,backgroundColor:`rgba(0, 0, 0, 0.5)`,border:`none`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(u$,{style:{color:`#fff`,fontSize:12}})})]}):(0,$.jsx)(b0,{beforeUpload:G,maxCount:1,accept:`image/*`,style:{width:`100%`,height:`100%`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:6,width:`100%`,height:`100%`},children:[(0,$.jsx)(rL,{style:{fontSize:20,color:`#6366f1`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#64748b`},children:`上传产品图`})]})})})})]}),(0,$.jsxs)(`div`,{style:{background:`#fff`,borderRadius:12,padding:16,border:`1px solid rgba(99, 102, 241, 0.1)`},children:[(0,$.jsxs)(`label`,{style:{fontWeight:500,color:`#334155`,marginBottom:8,display:`block`,fontSize:14},children:[`产品名称 `,(0,$.jsx)(`span`,{style:{color:`#ef4444`},children:`*`})]}),(0,$.jsx)(IW,{value:h,onChange:e=>g(e.target.value),placeholder:`请输入产品名称`,style:{height:44,borderRadius:8,border:`1px solid rgba(99, 102, 241, 0.2)`},maxLength:10,showCount:!0})]}),(0,$.jsxs)(`div`,{style:{background:`#fff`,borderRadius:12,padding:16,border:`1px solid rgba(99, 102, 241, 0.1)`},children:[(0,$.jsxs)(`label`,{style:{fontWeight:500,color:`#334155`,marginBottom:8,display:`block`,fontSize:14},children:[`产品卖点 `,(0,$.jsx)(`span`,{style:{color:`#ef4444`},children:`*`})]}),(0,$.jsx)(qse,{value:_,onChange:e=>v(e.target.value),placeholder:`请输入产品卖点`,style:{borderRadius:8,border:`1px solid rgba(99, 102, 241, 0.2)`},maxLength:100,showCount:!0,rows:3})]}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:12,marginTop:8},children:(0,$.jsx)(X,{type:`primary`,onClick:ne,loading:O,disabled:O,style:{flex:1,height:48,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,fontWeight:600,fontSize:15,border:`none`,boxShadow:`0 4px 15px rgba(99, 102, 241, 0.3)`,transition:`all 0.2s ease`},onMouseEnter:e=>{e.currentTarget.style.boxShadow=`0 6px 20px rgba(99, 102, 241, 0.4)`,e.currentTarget.style.transform=`translateY(-1px)`},onMouseLeave:e=>{e.currentTarget.style.boxShadow=`0 4px 15px rgba(99, 102, 241, 0.3)`,e.currentTarget.style.transform=`translateY(0)`},children:O?`生成中...`:`手动生成`})})]})}),(0,$.jsx)(mK,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`},children:`视频预览`})]}),open:f,onCancel:()=>p(!1),afterClose:()=>{m.current&&(m.current.pause(),m.current.currentTime=0)},footer:null,width:640,centered:!0,styles:{body:{padding:24},header:{borderBottom:`1px solid #e0e0e0`,padding:`20px 24px`}},children:(0,$.jsx)(`div`,{style:{borderRadius:12,overflow:`hidden`},children:(0,$.jsx)(`video`,{ref:m,controls:!0,src:u||``,style:{width:`100%`,maxHeight:420,objectFit:`contain`,backgroundColor:`#000`},playsInline:!0,"webkit-playsinline":`true`,autoPlay:!0})})})]})}var{Title:Xse,Text:J9}=Q,{TextArea:Zse}=IW;function Qse(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}var Y9=e=>e?/^https?:\/\//i.test(e)?e:`${`http://ceshi.apiforeign.minzhong.cn`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`:``;function X9(){let e=Ye(),{creatID:t}=$e(),{user:n}=_7(),[r,i]=(0,S.useState)(!1),[a,o]=(0,S.useState)([]),[s,c]=(0,S.useState)(0),[l,u]=(0,S.useState)(``),[d,f]=(0,S.useState)(!1),[p,m]=(0,S.useState)(`image`),[h,g]=(0,S.useState)({}),[_,v]=(0,S.useState)(null),[y,b]=(0,S.useState)(null),[x,C]=(0,S.useState)(``),[w,T]=(0,S.useState)(!1),[E,D]=(0,S.useState)({}),[O,k]=(0,S.useState)(``),[A,j]=(0,S.useState)(``),[M,N]=(0,S.useState)(!1),[P,F]=(0,S.useState)(!1),[I,L]=(0,S.useState)(5),[R,z]=(0,S.useState)(`16:9`),[B,V]=(0,S.useState)(`480p`),[H,U]=(0,S.useState)({ratios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:[`480p`,`720p`,`1080p`],durations:[5,8,10,12,15]}),[W,ee]=(0,S.useState)([]),[te,G]=(0,S.useState)(1),[ne,re]=(0,S.useState)(20),[ie,ae]=(0,S.useState)(0),[oe,K]=(0,S.useState)(``),[q,se]=(0,S.useState)({}),[ce,le]=(0,S.useState)([]),[ue,de]=(0,S.useState)([]),[fe,pe]=(0,S.useState)(!1),[me,he]=(0,S.useState)(``),[ge,_e]=(0,S.useState)(`image`),ve=S.useRef(null);(0,S.useEffect)(()=>{if(fe&&ge===`video`){let e=()=>{ve.current&&ve.current.play().catch(()=>{})};ve.current&&(ve.current.readyState>=2?e():ve.current.addEventListener(`loadedmetadata`,e));let t=setTimeout(e,300);return()=>{clearTimeout(t),ve.current&&(ve.current.removeEventListener(`loadedmetadata`,e),ve.current.pause())}}else ve.current&&ve.current.pause()},[fe,ge]);let ye=[{id:1,title:`原始素材`,description:`上传原始视频素材`,childId:1},{id:2,title:`生成提示词`,description:`根据素材生成描述词`,childId:2},{id:3,title:`生成产品融合图`,description:`生成产品与场景融合图`,childId:3},{id:4,title:`生成视频提示词`,description:`生成视频生成提示词`,childId:4},{id:5,title:`生成最终视频`,description:`合成最终视频`,childId:5}].map((e,t)=>({...e,status:ce[t]?.status||``,id:ce[t]?.id||t,output:ce[t]?.output||``,engineId:ce[t]?.input?.payload?.videoConfig?.engineId||``}));(0,S.useEffect)(()=>{let e=new Set;ue.forEach(t=>{let n=ye.find(e=>String(e.childId)===t);n&&(n.status===`completed`||n.status===`failed`)&&e.add(t)});for(let t=ye.length-1;t>=0;t--)if(ye[t].status===`completed`||ye[t].status===`failed`){e.add(String(ye[t].childId));break}e.size>0?de(Array.from(e)):de([])},[ce]);let be=(e,t,n)=>{Q5(e,t,n).then(e=>{e.items&&ee(e.items),e.total!==void 0&&ae(e.total)}).catch(e=>{})},xe=(e,t)=>{G(e),re(t),be(e,t,oe)},Se=()=>{be(1,20,oe)};(0,S.useEffect)(()=>{be(te,ne,oe)},[]),(0,S.useEffect)(()=>{z5().then(e=>{let t=(e.engine?.video||[]).filter(e=>e.supportsUniversalReference!==!1),n=(e.engine?.image||[]).filter(e=>e.supportsUniversalReference!==!1);if(D({video:t,image:n}),t.length>0){k(t[0].id);let e=t[0];U({ratios:e.supportedRatios||[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:e.supportedResolutions||[`480p`,`720p`,`1080p`],durations:e.supportedDurations||[5,8,10,12,15]})}n.length>0&&j(n[0].id)}).catch(e=>{})},[]),(0,S.useEffect)(()=>()=>{y&&(clearInterval(y),b(null))},[y]),(0,S.useEffect)(()=>{let e=e=>{let t=e.target;!t.closest(`.image-settings-trigger`)&&!t.closest(`.image-settings-popover`)&&(N(!1),F(!1))};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,S.useEffect)(()=>{t&&t7(t).then(e=>{se(e),e.steps&&le(e.steps)}).catch(e=>{})},[t]),(0,S.useEffect)(()=>{let e=ye[4];e&&e.status!==`completed`&&e.status!==`failed`?y||b(setInterval(Ee,3e4)):e&&y&&(clearInterval(y),b(null))},[ye]),(0,S.useEffect)(()=>{H5().then(e=>{o(e)}).catch(()=>{})},[]);let Ce=()=>{let e={};e=a.find(e=>e.modelConfigId===O&&e.genType===`video`&&e.resolution===B),e||={perSecondCredits:2,baseCredits:60,ratio:1.3,inputVideoRatio:1.3,inputVideoBaseCredits:0,inputVideoPerSecondCredits:15,inputImageRatio:1,inputImageBaseCredits:0,inputImagePerImageCredits:0};let t=(I*e.perSecondCredits+e.baseCredits)*e.ratio,n=q?.videoGeneration?.inputMedia?.video?.duration||0;if(n>0){let r=((e.inputVideoBaseCredits||0)+(e.inputVideoPerSecondCredits||0)*n)*(e.inputVideoRatio||1);t+=r}let r=q?.videoGeneration?.inputMedia?.image?.length||0;if(r>0){let n=((e.inputImageBaseCredits||0)+(e.inputImagePerImageCredits||0)*r)*(e.inputImageRatio||1);t+=n}c(Number(t.toFixed(2)))};(0,S.useEffect)(()=>{a.length>0&&O&&Ce()},[a,O,I,B,q]);let we=(e,t,n,r)=>{m(t||`image`),C(n?String(n):``),t===`video`?(v(r||null),g(e&&typeof e==`object`?Qse(e):{}),u(``)):(v(null),u(e||``),g({})),i(!0)},Te=async()=>{if(p===`image`){if(!q?.id||!x){Z.warning(`缺少任务或步骤 ID,无法保存图片提示词`);return}if(!l||!l.trim()){Z.warning(`图片提示词不能为空`);return}T(!0);try{await aae(q.id,x,{prompt:l.trim()}),Z.success(`图片提示词已保存`),De(),i(!1),C(``)}catch(e){Z.error(e?.message||`保存图片提示词失败`)}finally{T(!1)}return}if(!q?.id||!x){Z.warning(`缺少任务或步骤 ID,无法保存视频提示词`);return}if(!h||typeof h!=`object`||Object.keys(h).length===0){Z.warning(`视频提示词不能为空`);return}if(!_){Z.warning(`视频提词配置缺失,暂不能保存`);return}let e=y9(h,_);if(e){Z.warning(e);return}T(!0);try{await oae(q.id,x,{prompt_schema:h}),Z.success(`视频提示词已保存`),De(),i(!1),C(``)}catch(e){Z.error(e?.message||`保存视频提示词失败`)}finally{T(!1)}},Ee=()=>{t&&t7(t).then(e=>{se(e),e.steps&&le(e.steps)}).catch(e=>{})},De=()=>{t&&t7(t).then(e=>{se(e),e.steps&&le(e.steps)}).catch(e=>{})},Oe=(e,t)=>{he(e),_e(t),pe(!0)},ke=()=>{pe(!1),he(``),ve.current&&ve.current.pause()},Ae=e=>{if(e.preventDefault(),e.stopPropagation(),!me)return;let t=document.createElement(`a`);t.href=`http://ceshi.apiforeign.minzhong.cn${me}&download=1`,t.download=ge===`image`?`image.png`:`video.mp4`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},je=e=>{iae(q.id,e.toString()).then(e=>{Z.info(`正在生成图片提示词,请稍候...`),De()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Z.error(t)})},Me=e=>{let t={engine_id:A,image_proportion:`1:1`,image_px:`2048x2048`,image_size:`2K`};n7(q.id,e.toString(),t).then(e=>{Z.info(`正在生成图片,请稍候...`),De()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Z.error(t)})},Ne=()=>{let e={engine_id:A,image_proportion:`1:1`,image_px:`2048x2048`,image_size:`2K`};n7(q.id,ye[1].id.toString(),e).then(e=>{Z.info(`正在生成图片,请稍候...`),De()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Z.error(t)})},Pe=e=>{let t={engine_id:O,duration:I,aspect_ratio:R,resolution:B,target_platform:`抖音`};sae(q.id,e.toString(),t).then(e=>{Z.info(`正在生成视频提示词,请稍候...`),De()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Z.error(t)})},Fe=(e,t)=>{r7(q.id,e.toString(),{engine_id:``}).then(e=>{Z.info(`正在生成视频,请稍候...`),De()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Z.error(t)})},Ie=()=>{r7(q.id,ye[3].id.toString(),{engine_id:``}).then(e=>{De()}).catch(e=>{})};return(0,$.jsxs)(S.Fragment,{children:[(0,$.jsxs)(`div`,{className:`initialinfo-container`,style:{margin:`-24px -32px -32px`,height:`calc(100vh - 34px)`,position:`relative`,boxSizing:`border-box`,overflow:`hidden`,display:`flex`,flexDirection:`column`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:-100,right:-100,width:300,height:300,background:`radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%)`,borderRadius:`50%`,pointerEvents:`none`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,bottom:-100,left:-100,width:300,height:300,background:`radial-gradient(circle, rgba(167,139,250,0.08) 0%, transparent 70%)`,borderRadius:`50%`,pointerEvents:`none`}}),(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,justifyContent:`space-between`,alignItems:`stretch`,gap:`2%`,position:`relative`,zIndex:1,minHeight:0},children:[(0,$.jsxs)(`div`,{className:`replication-preview`,style:{flex:4,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(20px)`,borderRadius:20,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`,display:`flex`,flexDirection:`column`,minHeight:0},children:[(0,$.jsxs)(`div`,{style:{borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`16px 24px`,background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,boxSizing:`border-box`},children:[(0,$.jsx)(X,{icon:(0,$.jsx)(b2,{}),onClick:()=>window.history.back(),style:{borderRadius:10,fontSize:13,height:32,background:`rgba(99, 102, 241, 0.1)`,border:`1px solid rgba(99, 102, 241, 0.2)`,color:`#6366f1`},children:`返回`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #6366f1, #8b5cf6, transparent)`,borderRadius:1}}),(0,$.jsx)(`h3`,{style:{margin:0,fontSize:16,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`拆镜复刻 - 任务详情`}),(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #8b5cf6, #6366f1, transparent)`,borderRadius:1}})]}),(0,$.jsx)(X,{type:`primary`,ghost:!0,style:{borderRadius:10,padding:`4px 16px`,fontSize:13,background:`rgba(99, 102, 241, 0.1)`,borderColor:`rgba(99, 102, 241, 0.2)`,color:`#6366f1`},onClick:()=>f(!0),children:`创作记录`})]}),(0,$.jsx)(`div`,{style:{flex:1,overflowY:`auto`},children:(0,$.jsxs)(`div`,{className:`material_box`,children:[(0,$.jsxs)(`div`,{style:{display:`flex`,gap:24,flexWrap:`wrap`,alignItems:`flex-start`},children:[(0,$.jsxs)(`div`,{style:{flex:1,minWidth:250},children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`视频`]}),(0,$.jsx)(`div`,{className:`medio_box`,style:{aspectRatio:`16/9`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`,cursor:q?.material?.materialVideoUrl?`pointer`:`default`},onClick:()=>q?.material?.materialVideoUrl&&Oe(q.material.materialVideoUrl,`video`),children:q?.material?.materialVideoUrl?(0,$.jsx)(`video`,{src:Y9(q.material.materialVideoUrl),style:{width:`100%`,height:`100%`,objectFit:`contain`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:13},children:`暂无视频`})})]}),(0,$.jsxs)(`div`,{className:`product_img`,style:{flex:1,minWidth:250},children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`产品图片`]}),(0,$.jsx)(`div`,{className:`medio_box`,style:{aspectRatio:`1/1`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`,cursor:q?.material?.materialImageUrl?`pointer`:`default`},onClick:()=>q?.material?.materialImageUrl&&Oe(q.material.materialImageUrl,`image`),children:q?.material?.materialImageUrl?(0,$.jsx)(`img`,{src:Y9(q.material.materialImageUrl),alt:``,style:{width:`100%`,height:`100%`,objectFit:`contain`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:13},children:`暂无图片`})})]})]}),q?.finalImageUrl&&(0,$.jsx)(`div`,{style:{marginTop:24},children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`生成图片`]}),(0,$.jsx)(`div`,{className:`medio_box`,style:{aspectRatio:`1/1`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`,cursor:`pointer`},onClick:()=>Oe(q.finalImageUrl,`image`),children:(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn${q.finalImageUrl}`,alt:``,style:{width:`100%`,height:`100%`,objectFit:`contain`}})})]})}),q?.finalVideoUrl&&(0,$.jsx)(`div`,{style:{marginTop:24},children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`生成视频`]}),(0,$.jsx)(`div`,{className:`medio_box`,style:{aspectRatio:`16/9`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`,cursor:`pointer`},onClick:()=>Oe(q.finalVideoUrl,`video`),children:(0,$.jsx)(`video`,{src:`http://ceshi.apiforeign.minzhong.cn${q.finalVideoUrl}`,style:{width:`100%`,height:`100%`,objectFit:`contain`}})})]})})]})})]}),(0,$.jsxs)(`div`,{className:`replication-form`,style:{flex:1,minWidth:`450px`,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(20px)`,borderRadius:20,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`,display:`flex`,flexDirection:`column`,minHeight:0},children:[(0,$.jsxs)(`div`,{style:{padding:`16px 24px`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,display:`flex`,alignItems:`center`,gap:10,background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`},children:[(0,$.jsx)(`div`,{style:{width:4,height:18,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:15,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`生成步骤`})]}),(0,$.jsx)(`div`,{style:{flex:1,overflowY:`auto`,padding:`8px 16px 16px`},children:(0,$.jsx)($g,{activeKey:ue,onChange:de,ghost:!0,bordered:!1,style:{background:`transparent`},expandIconPlacement:`end`,items:ye.map(e=>({key:String(e.childId),label:(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,width:`100%`,justifyContent:`space-between`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:16,height:16},children:e.status===`completed`?(0,$.jsx)(d4,{style:{fontSize:16,color:`#22c55e`}}):e.status===`processing`?(0,$.jsx)(`div`,{style:{width:16,height:16,borderRadius:`50%`,border:`2px solid #e2e8f0`,borderTopColor:`#6366f1`,animation:`spinSlow 1s linear infinite`}}):e.status===`failed`?(0,$.jsx)(`div`,{style:{width:16,height:16,borderRadius:`50%`,background:`#ef4444`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`span`,{style:{color:`#fff`,fontSize:10},children:`×`})}):(0,$.jsx)(`div`,{style:{width:8,height:8,borderRadius:`50%`,background:`#cbd5e1`}})}),(0,$.jsx)(`span`,{style:{fontSize:14,color:e.status===`processing`||e.status===`waiting_user`?`#6366f1`:`#1e293b`,fontWeight:500},children:e.title}),(e.status===`processing`||e.status===`waiting_user`)&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#6366f1`,marginLeft:8},children:`生成中`}),e.status===`failed`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#ef4444`,marginLeft:8},children:`失败`}),e.status===``&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#717d8b`,marginLeft:8},children:`待生成`})]})}),children:(0,$.jsxs)(`div`,{style:{padding:`16px`,background:`linear-gradient(135deg, rgba(248,250,252,0.6) 0%, rgba(238,242,255,0.4) 100%)`,borderRadius:12,marginTop:8,border:`1px solid rgba(99, 102, 241, 0.06)`},children:[e.childId===1&&(0,$.jsx)($.Fragment,{children:(0,$.jsxs)(`div`,{style:{display:`flex`,gap:20,marginBottom:20,alignItems:`flex-start`,flexWrap:`wrap`},children:[(0,$.jsxs)(`div`,{style:{flex:1,minWidth:200},children:[(0,$.jsx)(J9,{style:{color:`#64748b`,fontSize:13,marginBottom:10,display:`block`,fontWeight:500},children:`原视频`}),(0,$.jsx)(`div`,{style:{height:180,borderRadius:12,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,border:`1px solid rgba(99, 102, 241, 0.06)`},children:q?.material?.materialVideoUrl?(0,$.jsx)(`video`,{src:Y9(q.material.materialVideoUrl),style:{maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`,borderRadius:10},controls:!0}):(0,$.jsxs)(`div`,{style:{textAlign:`center`,color:`#94a3b8`},children:[(0,$.jsxs)(`svg`,{width:`32`,height:`32`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,style:{marginBottom:8},children:[(0,$.jsx)(`rect`,{x:`2`,y:`2`,width:`20`,height:`16`,rx:`2`,ry:`2`}),(0,$.jsx)(`path`,{d:`M8 12l4 2 4-2`})]}),(0,$.jsx)(`div`,{style:{fontSize:13},children:`暂无视频`})]})})]}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:200},children:[(0,$.jsx)(J9,{style:{color:`#64748b`,fontSize:13,marginBottom:10,display:`block`,fontWeight:500},children:`产品图片`}),(0,$.jsx)(`div`,{style:{height:180,borderRadius:12,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,border:`1px solid rgba(99, 102, 241, 0.06)`},children:q?.material?.materialImageUrl?(0,$.jsx)(`img`,{src:Y9(q.material.materialImageUrl),alt:`产品图片`,style:{maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`,borderRadius:10}}):(0,$.jsxs)(`div`,{style:{textAlign:`center`,color:`#94a3b8`},children:[(0,$.jsxs)(`svg`,{width:`32`,height:`32`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,style:{marginBottom:8},children:[(0,$.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,ry:`2`}),(0,$.jsx)(`circle`,{cx:`8.5`,cy:`8.5`,r:`1.5`,fill:`currentColor`}),(0,$.jsx)(`path`,{d:`M21 15l-5-5L5 21`})]}),(0,$.jsx)(`div`,{style:{fontSize:13},children:`暂无图片`})]})})]}),(0,$.jsx)(X,{onClick:()=>{je(e.id)},type:`primary`,style:{flex:1,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,height:36,fontWeight:500,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},disabled:e.status!==`completed`,children:`下一步:生成图片提示词`})]})}),e.childId===2&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{padding:`12px 14px`,background:`rgba(255,255,255,0.6)`,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.08)`,marginBottom:4},children:(0,$.jsx)(J9,{style:{color:`#475569`,fontSize:13,lineHeight:1.8,whiteSpace:`pre-wrap`},children:e?.output?.payload?.prompt||`暂无提示词`})}),(0,$.jsxs)(sH,{style:{marginTop:16,gap:12,width:`100%`},children:[(0,$.jsx)(X,{type:`default`,icon:(0,$.jsx)(M$,{}),onClick:()=>we(e?.output?.payload?.prompt,`image`,e.id),style:{flex:1,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500,background:`rgba(99, 102, 241, 0.04)`},disabled:e.status!==`completed`,children:`修改提示词`}),(0,$.jsx)(X,{onClick:()=>{Me(e.id)},type:`primary`,style:{flex:1,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,height:36,fontWeight:500,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},disabled:e.status!==`completed`,children:`下一步:生成图片`})]})]}),e.childId===3&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{borderRadius:12,overflow:`hidden`,marginBottom:16,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,border:`1px solid rgba(99, 102, 241, 0.08)`,boxShadow:`0 2px 8px rgba(99, 102, 241, 0.04)`,position:`relative`},children:[q.finalImageUrl?(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn${q.finalImageUrl}`,alt:`融合图`,style:{width:`100%`,height:180,objectFit:`cover`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:180,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:14},children:`暂无融合图`}),(0,$.jsx)(X,{type:`default`,icon:(0,$.jsx)(M$,{}),onClick:()=>Ne(),disabled:e.status!==`completed`,style:{position:`absolute`,bottom:8,left:8,borderRadius:8,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:30,fontWeight:500,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(4px)`,padding:`0 12px`,fontSize:12},children:`重新生成`})]}),(0,$.jsx)(`p`,{style:{marginBottom:6,fontSize:14,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`视频参数选择:`}),(0,$.jsxs)(`div`,{style:{width:`100%`,display:`flex`,justifyContent:`space-between`,marginBottom:16},children:[(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>{N(!M),F(!1)},className:`image-settings-trigger`,style:{width:`100%`,padding:`4px 12px`,height:34,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,backgroundColor:`rgba(255,255,255,0.7)`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(C8,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsx)(J9,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:E.video?.find(e=>e.id===O)?.name||`选择引擎`})]}),M&&(0,$.jsx)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:-10,width:350,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:16,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:(0,$.jsxs)(`div`,{style:{marginBottom:8},children:[(0,$.jsx)(J9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择引擎`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:E.video?.map(e=>(0,$.jsxs)(`button`,{onClick:()=>{k(e.id),U({ratios:e.supportedRatios||[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:e.supportedResolutions||[`480p`,`720p`,`1080p`],durations:e.supportedDurations||[5,8,10,12,15]}),e.supportedRatios?.includes(R)||z(e.supportedRatios?.[0]||`16:9`),e.supportedResolutions?.includes(B)||V(e.supportedResolutions?.[0]||`720p`),e.supportedDurations?.includes(I)||L(e.supportedDurations?.[0]||5),N(!1)},style:{flex:1,minHeight:48,borderRadius:8,border:O===e.id?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:O===e.id?`#fff`:`#f9fafb`,cursor:`pointer`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`flex-start`,padding:`8px 12px`,transition:`all 0.2s`,textAlign:`left`},children:[(0,$.jsx)(`span`,{style:{fontSize:13,fontWeight:O===e.id?600:500,color:O===e.id?`#6366f1`:`#4b5563`,marginBottom:2},children:e.name}),(0,$.jsx)(`span`,{style:{fontSize:11,color:`#9ca3af`}})]},e.id))})]})})]}),(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>{F(!P),N(!1)},className:`image-settings-trigger`,style:{width:`100%`,padding:`4px 12px`,height:34,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,backgroundColor:`rgba(255,255,255,0.7)`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(V3,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsxs)(J9,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:[R,` · `,I,`s · `,B]})]}),P&&(0,$.jsxs)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:-160,width:350,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:16,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(J9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择比例`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:4},children:H.ratios.map(e=>(0,$.jsxs)(`button`,{onClick:()=>z(e),style:{flex:`0 0 calc(14.28% - 4px)`,minWidth:44,height:52,borderRadius:6,border:R===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:R===e?`#fff`:`#f9fafb`,cursor:`pointer`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:[(0,$.jsx)(`div`,{style:{width:18,height:18,border:`2px solid ${R===e?`#6366f1`:`#9ca3af`}`,borderRadius:2,marginBottom:2}}),(0,$.jsx)(`span`,{style:{fontSize:9,color:R===e?`#6366f1`:`#6b7280`,fontWeight:R===e?600:400},children:e})]},e))})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(J9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择时长`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,height:24,display:`flex`,alignItems:`center`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:`50%`,left:0,right:0,height:6,borderRadius:3,background:`#e5e7eb`,transform:`translateY(-50%)`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:`50%`,left:0,height:6,borderRadius:3,background:`#6366f1`,width:`${(I-Math.min(...H.durations))/(Math.max(...H.durations)-Math.min(...H.durations))*100}%`,transform:`translateY(-50%)`}}),(0,$.jsx)(`input`,{type:`range`,min:Math.min(...H.durations),max:Math.max(...H.durations),value:I,onChange:e=>L(Number(e.target.value)),style:{position:`relative`,width:`100%`,height:24,borderRadius:3,background:`transparent`,outline:`none`,appearance:`none`,cursor:`pointer`,zIndex:1}})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4,padding:`4px 12px`,backgroundColor:`#f1f5f9`,borderRadius:6},children:[(0,$.jsx)(`span`,{style:{fontSize:14,fontWeight:600,color:`#64748b`},children:I}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#9ca3af`},children:`秒`})]})]})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(J9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择分辨率`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:6},children:H.resolutions.map(e=>(0,$.jsx)(`button`,{onClick:()=>V(e),style:{flex:1,height:42,borderRadius:6,border:B===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:B===e?`#6366f1`:`#f9fafb`,cursor:`pointer`,display:`flex`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:600,color:B===e?`#fff`:`#4b5563`},children:e})},e))})]})]})]})]}),(0,$.jsx)(gw,{title:(n?.credits||0){if((n?.credits||0)we(q?.videoGeneration?.promptSchema,`video`,e.id,q?.videoGeneration?.schemaConfigSnapshot),style:{flex:1,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500,background:`rgba(99, 102, 241, 0.04)`},disabled:e.status!==`completed`||!q?.videoGeneration?.promptSchema||!q?.videoGeneration?.schemaConfigSnapshot,children:`查看/修改视频提词`}),(0,$.jsx)(X,{onClick:()=>{Fe(e.id,e.engineId)},type:`primary`,style:{flex:1,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,height:36,fontWeight:500,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},disabled:e.status!==`completed`,children:`下一步:生成视频`})]})]}),e.childId===5&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{borderRadius:12,overflow:`hidden`,marginBottom:16,position:`relative`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,border:`1px solid rgba(99, 102, 241, 0.08)`,boxShadow:`0 2px 8px rgba(99, 102, 241, 0.04)`},children:e.status===`completed`&&q?.finalVideoUrl?(0,$.jsx)(`video`,{src:`http://ceshi.apiforeign.minzhong.cn${q.finalVideoUrl}`,style:{width:`100%`,height:180,objectFit:`cover`},controls:!0}):e.status===`processing`?(0,$.jsxs)(`div`,{style:{width:`100%`,height:180,display:`flex`,alignItems:`center`,justifyContent:`center`,flexDirection:`column`,gap:8},children:[(0,$.jsx)(`div`,{style:{width:20,height:20,borderRadius:`50%`,border:`2px solid #e2e8f0`,borderTopColor:`#6366f1`,animation:`spinSlow 1s linear infinite`}}),(0,$.jsx)(`span`,{style:{color:`#6366f1`,fontSize:14},children:`视频生成中...`})]}):e.status===`failed`?(0,$.jsx)(`div`,{style:{width:`100%`,height:180,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#ef4444`,fontSize:14},children:`视频生成失败`}):(0,$.jsx)(`div`,{style:{width:`100%`,height:180,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:14},children:`暂无视频`})}),(0,$.jsxs)(sH,{style:{width:`100%`,gap:12},children:[(0,$.jsx)(X,{onClick:()=>Ie(),type:`default`,icon:(0,$.jsx)(M$,{}),style:{flex:1,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500,background:`rgba(99, 102, 241, 0.04)`},disabled:e.status!==`completed`,children:`重新生成`}),(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(m0,{}),style:{flex:1,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,height:36,fontWeight:500,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},disabled:e.status!==`completed`,onClick:()=>{let e=`http://ceshi.apiforeign.minzhong.cn${q?.finalVideoUrl}&download=1`,t=document.createElement(`a`);t.href=e,t.download=`video_${Date.now()}.mp4`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},children:`下载视频`})]})]})]})}))})})]})]})]}),(0,$.jsx)(mK,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,$.jsx)(`div`,{style:{width:4,height:18,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:15,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:p===`video`?`查看/编辑视频提词`:`修改提示词`})]}),open:r,onCancel:()=>{w||i(!1)},footer:[(0,$.jsx)(X,{onClick:()=>i(!1),disabled:w,style:{borderRadius:8},children:`取消`},`cancel`),(0,$.jsx)(X,{type:`primary`,onClick:Te,loading:w,disabled:w,style:{borderRadius:8,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`确认`},`confirm`)],width:800,style:{borderRadius:16},styles:{header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,padding:`16px 24px`},body:{background:`linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #f0f9ff 100%)`,padding:`20px 24px`}},children:p===`image`?(0,$.jsx)(Zse,{value:l,onChange:e=>u(e.target.value),rows:8,style:{width:`100%`,height:300,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`},placeholder:`请输入提示词`}):(0,$.jsx)(`div`,{style:{maxHeight:500,overflowY:`auto`,paddingRight:10},children:(0,$.jsx)(E9,{value:h,schemaConfigSnapshot:_,onChange:g})})}),(0,$.jsxs)(mK,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`},children:`创作记录`})]}),open:d,onCancel:()=>f(!1),width:800,footer:null,styles:{body:{background:`linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%)`},header:{background:`#fff`,borderBottom:`1px solid rgba(99, 102, 241, 0.1)`,padding:`20px 24px`}},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,marginBottom:16,gap:8},children:[(0,$.jsx)(IW,{placeholder:`搜索产品名称`,value:oe,onChange:e=>K(e.target.value),onPressEnter:Se,style:{width:200,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.2)`,height:40}}),(0,$.jsx)(X,{type:`primary`,onClick:Se,style:{borderRadius:10,height:40,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`搜索`})]}),(0,$.jsx)(`div`,{style:{background:`linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%)`,backdropFilter:`blur(20px)`,borderRadius:16,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`},children:(0,$.jsx)(LQ,{columns:[{title:`产品名称`,dataIndex:`title`,key:`title`,render:e=>(0,$.jsx)(`span`,{style:{fontSize:14,color:`#1e293b`,fontWeight:500},children:e})},{title:`创建时间`,dataIndex:`createdAt`,key:`createdAt`,render:e=>{if(!e)return`-`;let t=new Date(e);return(0,$.jsx)(`span`,{style:{fontSize:13,color:`#64748b`},children:`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)} ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`})}},{title:`操作`,key:`action`,align:`center`,render:t=>(0,$.jsx)(X,{type:`text`,onClick:()=>e(`/removelens/${t.id}/removeinfo`),style:{color:`#6366f1`,fontSize:13,padding:`4px 12px`,borderRadius:6,background:`rgba(99, 102, 241, 0.1)`},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(99, 102, 241, 0.15)`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(99, 102, 241, 0.1)`},children:`查看详情`})}],dataSource:W,rowKey:`id`,pagination:{current:te,pageSize:ne,total:ie,showSizeChanger:!0,showQuickJumper:!0,showTotal:e=>`共 ${e} 条`,onChange:xe,style:{padding:`16px 24px`,borderTop:`1px solid rgba(99, 102, 241, 0.1)`}},style:{fontSize:13},scroll:{y:350},components:{body:{row:({className:e,style:t,...n})=>(0,$.jsx)(`tr`,{...n,className:e,style:{...t,transition:`all 0.2s ease`,borderBottom:`1px solid rgba(99, 102, 241, 0.05)`}}),cell:({className:e,style:t,...n})=>(0,$.jsx)(`td`,{...n,className:e,style:{...t,padding:`16px 24px`}})},header:{cell:({className:e,style:t,...n})=>(0,$.jsx)(`th`,{...n,className:e,style:{...t,background:`rgba(99, 102, 241, 0.03)`,color:`#64748b`,fontWeight:500,fontSize:13,padding:`16px 24px`,borderBottom:`none`}})}}})})]}),(0,$.jsx)(mK,{open:fe,title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(180deg, #8b5cf6 0%, #ddd6fe 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:700,color:`#8b5cf6`,letterSpacing:.4},children:`预览`})]}),onCancel:ke,width:800,footer:(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:12,padding:`16px 24px`,background:`rgba(255,255,255,0.6)`,borderTop:`1px solid rgba(139, 92, 246, 0.08)`},children:(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(m0,{}),onClick:Ae,style:{borderRadius:10,background:`linear-gradient(135deg, #8b5cf6 0%, #ddd6fe 100%)`,border:`none`,boxShadow:`0 8px 18px rgba(47, 52, 64, 0.15)`},children:`下载`})}),centered:!0,style:{borderRadius:16},styles:{body:{display:`flex`,alignItems:`center`,justifyContent:`center`,minHeight:`400px`},header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(139, 92, 246, 0.08)`,padding:`16px 24px`}},children:(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:`100%`,height:`100%`},children:ge===`image`?(0,$.jsx)(`img`,{src:me.startsWith(`http`)?me:`http://ceshi.apiforeign.minzhong.cn${me}`,alt:`预览`,style:{width:`100%`,maxHeight:`400px`,objectFit:`contain`}}):(0,$.jsx)(`video`,{ref:ve,src:me.startsWith(`http`)?me:`http://ceshi.apiforeign.minzhong.cn${me}`,controls:!0,style:{maxWidth:`100%`,maxHeight:`400px`}})})})]})}var $se=({asset:e,index:t,onPreview:n})=>{let[r,i]=(0,S.useState)(!1);return(0,$.jsx)(`div`,{className:`project-card`,onClick:()=>n(e),onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),style:{borderRadius:12,overflow:`hidden`,cursor:`pointer`,flexShrink:0,width:`18%`,position:`relative`},children:(0,$.jsx)(`div`,{style:{position:`relative`,aspectRatio:`9/16`},children:e.mediaType===`video`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`video`,{src:`http://ceshi.apiforeign.minzhong.cn${e.url}`,style:{width:`100%`,height:`100%`,objectFit:`cover`},muted:!0,playsInline:!0}),(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`div`,{style:{width:40,height:40,borderRadius:`50%`,background:`rgba(0,0,0,0.5)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(q6,{style:{fontSize:24,color:`#fff`}})})})]}):(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn${e.url}`,alt:e.title||`素材 ${t+1}`,style:{width:`100%`,height:`100%`,objectFit:`cover`}})})})};function ece(e){if(!e)return`-`;let t=String(e).trim();t.includes(`T`)||(t=t.replace(` `,`T`));let n=t.indexOf(`.`);n>0&&(t=t.slice(0,n)),t=t.replace(/[+-]\d{2}:?\d{0,2}$/,``).replace(/Z$/,``);let[r=``,i=``]=t.split(`T`),[,a=``,o=``]=r.split(`-`),s=i.slice(0,5);return!a||!o?`-`:`${a}-${o} ${s}`}var tce=()=>{let e=Ye(),[t,n]=(0,S.useState)(`project`),[r,i]=(0,S.useState)(``),[a,o]=(0,S.useState)([]),[s,c]=(0,S.useState)([]),[l,u]=(0,S.useState)(``),[d,f]=(0,S.useState)([]),[p,m]=(0,S.useState)(null),[h,g]=(0,S.useState)(``),_=(0,S.useRef)(null),v=(0,S.useRef)(``),[y,b]=(0,S.useState)(`cases`),[x,C]=(0,S.useState)(null),[w,T]=(0,S.useState)(null),E=(0,S.useRef)(null);(0,S.useEffect)(()=>{Tae().then(e=>{if(e?.items?.length>0){c(e.items);let t=e.items[0].id;u(t),c7(t).then(e=>{e?.categories?.[0]?.assets&&f(e.categories[0].assets)})}})},[]),(0,S.useEffect)(()=>()=>{E.current&&=(E.current.pause(),null),T(null),C(null),document.querySelectorAll(`.preview-video-item`).forEach(e=>{e.pause()})},[]),(0,S.useEffect)(()=>{if(!p){E.current&&=(E.current.pause(),null),T(null),C(null),g(``),v.current=``,document.querySelectorAll(`.preview-video-item`).forEach(e=>{e.pause()});return}let e=p.id||p.url;v.current=e;let t=(e,n)=>n===0?e:t(n,e%n),n=p.width||p.videoWidth||p.imageWidth||0,r=p.height||p.videoHeight||p.imageHeight||0;if(n&&r){let e=t(n,r);g(`${n/e}:${r/e}`);return}if(g(``),p.mediaType===`video`){let n=_.current,r=()=>{if(v.current!==e)return;let r=n.videoWidth,i=n.videoHeight;if(!r||!i)return;let a=t(r,i);g(`${r/a}:${i/a}`)};if(n?.removeEventListener(`loadedmetadata`,r),n&&n.videoWidth&&n.videoHeight){let e=t(n.videoWidth,n.videoHeight);g(`${n.videoWidth/e}:${n.videoHeight/e}`)}else n?.addEventListener(`loadedmetadata`,r);return()=>{n?.removeEventListener(`loadedmetadata`,r)}}else{let n=new Image;n.crossOrigin=`anonymous`,n.onload=()=>{if(v.current!==e)return;let r=n.width,i=n.height;if(!r||!i){g(`未知`);return}let a=t(r,i);g(`${r/a}:${i/a}`)},n.onerror=()=>{v.current===e&&g(`未知`)},n.src=`http://ceshi.apiforeign.minzhong.cn${p.url}`}},[p]),(0,S.useEffect)(()=>{(async()=>{try{bae(10).then(e=>{for(let t in e)e[t].forEach(e=>{e.type=t,o(t=>[...t,e])});o(e=>e)})}catch{}})()},[]);let D=e=>{n(e)},O=[{icon:(0,$.jsx)(fH,{style:{fontSize:24}}),title:`行业智造`,description:`新建项目、设置图文视频参数、核对信息并生成素材`,action:`立即创作`,path:`/projects`},{icon:(0,$.jsx)(c8,{style:{fontSize:24}}),title:`AI创作`,description:`输入想法、剧本或上传参考,智能生成视频/图片`,action:`立即生成`,path:`/conversation`},{icon:(0,$.jsx)(fH,{style:{fontSize:24}}),title:`爆款复刻`,description:`上传参考视频与产品图片,一键复刻爆款`,action:`立即创作`,path:`/initial`},{icon:(0,$.jsx)(_8,{style:{fontSize:24}}),title:`拆镜复刻`,description:`精细化镜头复刻工具,拆分参考视频单镜头独立复刻,提升素材原创度,规避素材同质化`,action:`开始拆镜`,path:`/removelens`}],k=[{key:`all`,label:`全部`},{key:`project`,label:`项目媒体`},{key:`chatAi`,label:`AI成片`},{key:`hotOpeningReplicate`,label:`爆款复刻`},{key:`shotReplicate`,label:`拆镜复刻`}],A=t===`all`?a:a.filter(e=>e.type===t);return(0,$.jsxs)(`div`,{className:`content_box`,children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:16},children:[(0,$.jsx)(`h3`,{children:`首页工作台 `}),(0,$.jsxs)(`p`,{style:{cursor:`pointer`,fontSize:12,letterSpacing:.3,padding:`10px 16px`,backgroundColor:`#ffffffff`,borderRadius:30,boxShadow:`0px 4px 12px 0px rgba(0, 0, 0, 0.1)`},children:[`如需进行账户素材推送:`,(0,$.jsxs)(`span`,{style:{color:`#1a50bbff`},onClick:()=>{e(`/authorization`)},children:[`一键推送`,(0,$.jsx)(C2,{style:{marginLeft:8,transform:`rotate(0deg)`}})]})]})]}),(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{padding:`20px`,borderRadius:16,background:`#fff`,border:`1px solid #e2e8f0`,marginBottom:20},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:16},children:[(0,$.jsx)(`div`,{style:{width:4,height:18,borderRadius:2,background:`linear-gradient(180deg, #6366f1, #a855f7)`}}),(0,$.jsx)(`div`,{style:{fontSize:17,fontWeight:700,color:`#1f2937`,letterSpacing:.3},children:`AI 创作入口`}),(0,$.jsx)(`div`,{style:{fontSize:12,color:`#94a3b8`,marginLeft:8},children:`一键开启智能创作`})]}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:12},children:O.map((t,n)=>{let r=[{color:`#3b82f6`,light:`rgba(59,130,246,0.12)`,tag:`项目`},{color:`#6366f1`,light:`rgba(99,102,241,0.12)`,tag:`复刻`},{color:`#f97316`,light:`rgba(249,115,22,0.12)`,tag:`拆镜`},{color:`#10b981`,light:`rgba(16,185,129,0.12)`,tag:`云创`}],i=r[n]||r[0];return(0,$.jsxs)(`div`,{onClick:()=>e(t.path),className:`project-card`,style:{flex:`1 1 280px`,minWidth:280,padding:`16px 20px`,borderRadius:16,background:`#fff`,border:`1px solid #e2e8f0`,cursor:`pointer`,transition:`all 0.3s cubic-bezier(0.4,0,0.2,1)`,position:`relative`,display:`flex`,alignItems:`center`,gap:14,minHeight:96},onMouseEnter:e=>{e.currentTarget.style.borderColor=i.color,e.currentTarget.style.boxShadow=`0 8px 24px ${i.light}`,e.currentTarget.style.background=i.light,e.currentTarget.style.transform=`translateY(-2px)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`#e2e8f0`,e.currentTarget.style.boxShadow=`none`,e.currentTarget.style.background=`#fff`,e.currentTarget.style.transform=`translateY(0)`},children:[(0,$.jsx)(`div`,{style:{width:48,height:48,borderRadius:12,background:i.light,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,transition:`all 0.3s ease`,color:i.color},onMouseEnter:e=>{e.currentTarget.style.background=i.color,e.currentTarget.style.color=`#fff`},onMouseLeave:e=>{e.currentTarget.style.background=i.light,e.currentTarget.style.color=i.color},children:(0,$.jsx)(`span`,{style:{fontSize:20,display:`flex`,transition:`all 0.3s ease`},children:t.icon})}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:0,display:`flex`,flexDirection:`column`,gap:4},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{fontSize:15,fontWeight:600,color:`#1e293b`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,flex:1,minWidth:0},children:t.title}),(0,$.jsx)(`span`,{style:{fontSize:10,color:i.color,padding:`2px 7px`,borderRadius:4,background:i.light,fontWeight:600,flexShrink:0},children:i.tag})]}),(0,$.jsx)(`div`,{style:{fontSize:12,color:`#64748b`,lineHeight:1.5,display:`-webkit-box`,WebkitLineClamp:2,WebkitBoxOrient:`vertical`,overflow:`hidden`},children:t.description})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4,color:i.color,fontSize:13,fontWeight:600,flexShrink:0},children:[t.action,(0,$.jsx)(C2,{style:{fontSize:12}})]})]},n)})})]}),(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{padding:`24px 28px`,borderRadius:16,background:`#fff`,border:`1px solid #e2e8f0`},children:[(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:16},children:(0,$.jsx)(`div`,{style:{display:`flex`,gap:8},children:[{key:`cases`,label:`素材案例`},{key:`works`,label:`近期作品`}].map(e=>(0,$.jsx)(`button`,{onClick:()=>b(e.key),style:{padding:`6px 16px`,borderRadius:8,fontSize:13,fontWeight:500,border:`none`,cursor:`pointer`,transition:`all 0.25s ease`,background:y===e.key?`linear-gradient(135deg, #6366f1, #8b5cf6)`:`#f1f5f9`,color:y===e.key?`#fff`:`#64748b`},children:e.label},e.key))})}),y===`works`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{marginBottom:20},children:(0,$.jsx)(TL,{activeKey:t,onChange:D,items:k.map(e=>({key:e.key,label:e.label})),className:`homepage-tabs`})}),(0,$.jsx)(`div`,{className:`stagger-children`,style:{display:`grid`,gridTemplateColumns:`repeat(5, 1fr)`,gap:16},children:A.length===0?(0,$.jsxs)(`div`,{style:{gridColumn:`1 / -1`,padding:`60px 0`,textAlign:`center`,color:`#94a3b8`,fontSize:14},children:[(0,$.jsx)(R6,{style:{fontSize:36,color:`#cbd5e1`,marginBottom:8}}),(0,$.jsx)(`div`,{children:`暂无作品`})]}):A.map(t=>(0,$.jsxs)(`div`,{className:`project-card`,onClick:()=>{let n=t.moduleProjectId;t.type===`hotOpeningReplicate`&&n!=null?e(`/initial/${n}/initialinfo`):t.type===`shotReplicate`&&n!=null?e(`/removelens/${n}/removefenbu`):t.type===`chatAi`?e(`/conversation`):t.type===`project`&&e(`/project`)},style:{borderRadius:12,overflow:`hidden`,cursor:`pointer`,background:`#fff`,border:`1px solid #e2e8f0`},children:[(0,$.jsxs)(`div`,{style:{position:`relative`,aspectRatio:`16/9`},children:[(()=>{let e=t.type!==`hotOpeningReplicate`&&(String(t.resourceType??``).toLowerCase()===`image`||t.resourceType===1||String(t.resourceType??``)===`1`),n=``;return n=e?`/static`+t.resultUrl+`&w=300&p=50`||``:(t.type,t.coverUrl||t.resultUrl||t.resultUrl||``),(0,$.jsx)(`img`,{src:n?n.startsWith(`http`)?n:`http://ceshi.apiforeign.minzhong.cn`+n:``,alt:t.title||t.name||`作品`,style:{width:`100%`,height:`100%`,objectFit:`cover`}})})(),String(t.resourceType??``).toLowerCase()===`image`?null:(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`rgba(0,0,0,0.2)`},children:(0,$.jsx)(t5,{style:{fontSize:28,color:`#fff`}})})]}),(0,$.jsx)(`div`,{style:{padding:`10px 12px`,background:`#f8fafc`,paddingTop:0},children:(0,$.jsxs)(`div`,{style:{marginTop:6,display:`flex`,alignItems:`center`,gap:6,fontSize:12,color:`#64748b`},children:[(0,$.jsx)(`span`,{style:{display:`inline-block`,padding:`1px 6px`,border:`1px solid #3b82f6`,borderRadius:4,color:`#3b82f6`,fontSize:11,fontWeight:500,background:`#fff`,lineHeight:1.4,whiteSpace:`nowrap`},children:{project:`项目媒体`,chatAi:`AI成片`,hotOpeningReplicate:`爆款复刻`,shotReplicate:`拆镜复刻`}[t.type]||`其他`}),(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`·`}),(0,$.jsx)(`span`,{style:{whiteSpace:`nowrap`},children:ece(t.generatedTime)})]})})]},t.id||`${t.type}-${Math.random()}`))})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{marginBottom:20},children:(0,$.jsx)(TL,{activeKey:l,onChange:e=>{u(e),c7(e).then(e=>{e?.categories?.[0]?.assets?f(e.categories[0].assets):f([])})},items:s.map(e=>({key:e.id,label:e.name})),className:`homepage-tabs`})}),(0,$.jsx)(`div`,{className:`stagger-children`,style:{display:`flex`,flexWrap:`wrap`,gap:16,justifyContent:`flex-start`,overflowX:`auto`,paddingBottom:8},children:d.length===0?(0,$.jsxs)(`div`,{style:{flex:1,padding:`60px 0`,textAlign:`center`,color:`#94a3b8`,fontSize:14},children:[(0,$.jsx)(R6,{style:{fontSize:36,color:`#cbd5e1`,marginBottom:8}}),(0,$.jsx)(`div`,{children:`暂无素材`})]}):d.map((e,t)=>(0,$.jsx)($se,{asset:e,index:t,onPreview:m},e.id||t))})]})]}),(0,$.jsxs)(mK,{open:!!p,onCancel:()=>{_.current?.pause(),m(null),g(``),v.current=``},footer:null,width:900,centered:!0,className:`preview-modal`,style:{borderRadius:16,overflow:`hidden`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,height:580,paddingTop:30},children:[(0,$.jsx)(`div`,{style:{flex:1,position:`relative`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:24},children:(0,$.jsxs)(`div`,{style:{maxWidth:`100%`,maxHeight:500,borderRadius:12,overflow:`hidden`,background:`#0f172a`},children:[p?.mediaType===`video`?(0,$.jsx)(`video`,{ref:_,src:`http://ceshi.apiforeign.minzhong.cn${p.url}`,controls:!0,autoPlay:!0,style:{maxWidth:`100%`,maxHeight:500,objectFit:`contain`},"webkit-playsinline":`true`}):(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn${p?.url}`,alt:p?.title,style:{maxWidth:`100%`,maxHeight:500,objectFit:`contain`}}),p?.mediaType===`video`&&(0,$.jsx)(`div`,{style:{position:`absolute`,top:32,right:32,fontSize:11,color:`#fff`,background:`rgba(0,0,0,0.6)`,padding:`3px 8px`,borderRadius:4},children:`AI生成`})]})}),(0,$.jsxs)(`div`,{style:{flex:1,padding:24,overflowY:`auto`},children:[(0,$.jsx)(`div`,{style:{fontSize:16,fontWeight:600,color:`#fff`,marginBottom:16},children:`创意详情`}),(0,$.jsxs)(`div`,{style:{fontSize:12,color:`#94a3b8`,marginBottom:16},children:[(0,$.jsx)(`span`,{style:{color:`#6366f1`},children:`比例:`}),h||`计算中...`]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`div`,{style:{fontSize:12,color:`#000000ff`,marginBottom:8},children:`视频提示词`}),(0,$.jsx)(`div`,{style:{fontSize:13,color:`#000000ff`,lineHeight:1.6},children:p?.generationPrompt})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`div`,{style:{fontSize:12,color:`#94a3b8`,marginBottom:8},children:`视频参考图`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`},children:p?.mediaReferences&&p.mediaReferences.length>0?p.mediaReferences.map((e,t)=>{let n=e.url||e.resourceUrl||e.previewUrl||``,r=n.startsWith(`http`)?n:`http://ceshi.apiforeign.minzhong.cn${n}`;return e.type===`video`?(0,$.jsxs)(`div`,{style:{width:80,height:80,borderRadius:8,overflow:`hidden`,cursor:`pointer`,position:`relative`},children:[(0,$.jsx)(`video`,{src:r,muted:!0,onClick:e=>{e.stopPropagation();let n=e.currentTarget;x===t?(n.pause(),C(null)):(document.querySelectorAll(`.preview-video-item`).forEach(e=>{e.pause()}),n.play(),C(t))},className:`preview-video-item`,style:{width:`100%`,height:`100%`,objectFit:`cover`}}),x!==t&&(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`rgba(0,0,0,0.3)`},children:(0,$.jsx)(t5,{style:{fontSize:18,color:`#fff`}})})]},t):e.type===`audio`?(0,$.jsx)(`div`,{onClick:e=>{if(e.stopPropagation(),w===r)E.current&&E.current.pause(),T(null);else{E.current&&E.current.pause();let e=new Audio(r);E.current=e,e.onended=()=>{T(null)},e.play(),T(r)}},style:{width:80,height:80,borderRadius:8,overflow:`hidden`,cursor:`pointer`,background:`linear-gradient(135deg, #8b5cf6, #a78bfa)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:w===r?(0,$.jsx)(k6,{style:{fontSize:24,color:`#fff`}}):(0,$.jsx)(k2,{style:{fontSize:24,color:`#fff`}})},t):(0,$.jsx)(`div`,{style:{width:80,height:80,borderRadius:8,overflow:`hidden`,cursor:`pointer`},children:(0,$.jsx)(`img`,{src:r,alt:`参考图 ${t+1}`,style:{width:`100%`,height:`100%`,objectFit:`cover`}})},t)}):(0,$.jsx)($.Fragment,{})})]})]})]}),(0,$.jsx)(`div`,{style:{padding:`16px 24px`,borderTop:`1px solid #334155`,display:`flex`,alignItems:`center`,justifyContent:`flex-end`},children:(0,$.jsx)(`div`,{style:{display:`flex`,gap:12},children:(0,$.jsx)(X,{onClick:()=>{e(`/conversation`,{state:{generationPrompt:p?.generationPrompt,mediaReferences:p?.mediaReferences,aspectRatio:h}})},style:{padding:`8px 24px`,borderRadius:8,background:`#3b82f6`,border:`none`,color:`#fff`,fontSize:13,fontWeight:500},children:`去AI创作`})})})]})]})},{RangePicker:nce}=hV,Z9={borderRadius:8,fontWeight:600},Q9=e=>e.replace(/_([a-z])/g,(e,t)=>t.toUpperCase()),rce=()=>{let e=Ye(),[t]=On(),{message:n}=Vb.useApp(),[r,i]=(0,S.useState)([]),[a,o]=(0,S.useState)(0),[s,c]=(0,S.useState)(!1),[l,u]=(0,S.useState)(!1),[d,f]=(0,S.useState)(!1),[p,m]=(0,S.useState)([]),[h,g]=(0,S.useState)([]),[_,v]=(0,S.useState)(``),[y,b]=(0,S.useState)(1),[x,C]=(0,S.useState)(10),[w,T]=(0,S.useState)(t.get(`advertiserId`)||``),[E,D]=(0,S.useState)(),[O,k]=(0,S.useState)((0,bE.default)().subtract(1,`day`).format(`YYYY-MM-DD`)),[A,j]=(0,S.useState)(``);(0,S.useEffect)(()=>{N(),M()},[]);let M=async(e=1,t=10,r,a)=>{c(!0);try{let n=await gae({advertiser_id:a??w,consume_date:r??E,page:e,page_size:t});i(n.data||[]),o(n.pagination?.total||0),b(n.pagination?.page||1),C(n.pagination?.pageSize||10)}catch{n.error(`加载数据失败`)}finally{c(!1)}},N=async()=>{try{let e=((await o7()).data||[]).map(e=>({name:Q9(e.field),description:e.description}));m(e);let t=localStorage.getItem(`consumeColumns`);g(t?JSON.parse(t):e.map(e=>e.name))}catch{n.error(`加载表头字段失败`)}},P=r.map((e,t)=>({...e,index:t+1,key:e.id})),F=()=>{document.referrer.includes(window.location.origin)?e(-1):e(`/materials`)},I=()=>{b(1),M(1,x)},L=()=>{mK.confirm({title:`拉取消耗数据`,content:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{marginBottom:12},children:[(0,$.jsx)(Q.Text,{style:{display:`block`,marginBottom:8},children:`同步日期:`}),(0,$.jsx)(hV,{value:(0,bE.default)(O),onChange:e=>k(e?e.format(`YYYY-MM-DD`):(0,bE.default)().subtract(1,`day`).format(`YYYY-MM-DD`)),style:{width:`100%`}})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Text,{style:{display:`block`,marginBottom:8},children:`广告主ID(可选):`}),(0,$.jsx)(IW,{placeholder:`不指定则同步所有授权的广告主`,value:A,onChange:e=>j(e.target.value)})]})]}),onOk:async()=>{u(!0);try{await _ae({date:O,advertiser_id:A||void 0}),n.success(`拉取消耗数据成功`),M(y,x)}catch{n.error(`拉取消耗数据失败`)}finally{u(!1)}},okText:`开始拉取`,cancelText:`取消`})},R=h.map(e=>p.find(t=>t.name===e)).filter(e=>!!e).map(e=>({title:e.description,dataIndex:e.name,key:e.name,ellipsis:!0}));return(0,$.jsxs)(`div`,{style:{minHeight:`94vh`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12},children:[t.get(`advertiserId`)&&(0,$.jsx)(X,{type:`text`,icon:(0,$.jsx)(b2,{}),onClick:F}),(0,$.jsx)(X4,{style:{color:`#6366f1`,fontSize:16}}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:16},children:`消耗记录`})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,justifyContent:`space-between`,alignItems:`center`,gap:12,marginBottom:16,padding:`12px 16px`,borderRadius:12,background:`#fff`,border:`1px solid #f0f0f5`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`},children:[(0,$.jsx)(IW,{placeholder:`广告主ID`,value:w,onChange:e=>T(e.target.value),style:{width:180,borderRadius:8},allowClear:!0,onPressEnter:()=>{b(1),M(1,x)}}),(0,$.jsx)(nce,{value:E?[(0,bE.default)(E[0]),(0,bE.default)(E[1])]:void 0,onChange:e=>{e&&e[0]&&e[1]?D([e[0].format(`YYYY-MM-DD`),e[1].format(`YYYY-MM-DD`)]):D(void 0)},style:{borderRadius:8}}),(0,$.jsx)(X,{type:`primary`,onClick:I,style:{...Z9,borderColor:`transparent`},children:`搜索`})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,$.jsx)(X,{icon:(0,$.jsx)(zre,{}),onClick:L,loading:l,style:Z9,children:`拉取消耗`}),(0,$.jsx)(X,{icon:(0,$.jsx)(C8,{}),onClick:()=>f(!0),style:{...Z9,background:`#f8f9fc`,border:`1px solid #e2e8f0`,color:`#334155`},children:`自定义表头`})]})]}),(0,$.jsxs)(`div`,{style:{background:`#fff`,borderRadius:12,boxShadow:`0 1px 3px rgba(0,0,0,0.05)`},children:[(0,$.jsx)(LQ,{dataSource:P,columns:R,loading:s,pagination:!1,rowKey:`id`,bordered:!1,scroll:{x:`max-content`}}),(0,$.jsx)(`div`,{style:{padding:`16px`,textAlign:`right`},children:(0,$.jsx)(SG,{current:y,pageSize:x,total:a,showSizeChanger:!0,showTotal:e=>`共 ${e} 条记录`,onChange:(e,t)=>{b(e),C(t),M(e,t)},size:`small`})})]}),(0,$.jsx)(mK,{title:`自定义表头`,open:d,onOk:()=>{localStorage.setItem(`consumeColumns`,JSON.stringify(h)),n.success(`表头设置已保存`),f(!1)},onCancel:()=>{f(!1),v(``)},okText:`确定`,cancelText:`取消`,width:800,children:(0,$.jsxs)(`div`,{style:{display:`flex`,gap:20,height:400},children:[(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`},children:[(0,$.jsx)(IW,{placeholder:`搜索指标...`,value:_,allowClear:!0,onChange:e=>v(e.target.value),style:{marginBottom:8}}),(0,$.jsx)(Q.Text,{type:`secondary`,style:{fontSize:12,marginBottom:12,display:`block`},children:`输入指标名称进行搜索`}),(0,$.jsxs)(`div`,{style:{flex:1,overflowY:`auto`,border:`1px solid #f0f0f5`,borderRadius:8,padding:12},children:[(0,$.jsx)(`div`,{style:{marginBottom:16},children:(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:14,color:`#1e293b`},children:`任务详情指标`})}),(0,$.jsx)(VR,{checked:h.length===p.length&&p.length>0,indeterminate:h.length>0&&h.length{e.target.checked?g(p.map(e=>e.name)):g([])},style:{marginBottom:12},children:`全选`}),(0,$.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:8},children:p.filter(e=>e.description.toLowerCase().includes(_.toLowerCase())||e.name.toLowerCase().includes(_.toLowerCase())).map(e=>(0,$.jsx)(VR,{checked:h.includes(e.name),onChange:t=>{t.target.checked?g(t=>[...t,e.name]):g(t=>t.filter(t=>t!==e.name))},children:e.description},e.name))})]})]}),(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:12},children:[(0,$.jsxs)(Q.Text,{strong:!0,style:{fontSize:14,color:`#1e293b`},children:[`已添加(`,h.length,`)`]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,$.jsx)(X,{size:`small`,onClick:()=>g([]),disabled:h.length===0,children:`清空`}),(0,$.jsx)(X,{size:`small`,onClick:async()=>{try{let e=((await o7()).data||[]).map(e=>({name:Q9(e.field),description:e.description}));m(e),g(e.map(e=>e.name)),localStorage.removeItem(`consumeColumns`),n.success(`表头字段已更新`)}catch{n.error(`更新表头字段失败`)}},children:`更新表头字段`})]})]}),(0,$.jsx)(`div`,{style:{flex:1,overflowY:`auto`,border:`1px solid #f0f0f5`,borderRadius:8,padding:12},children:h.length===0?(0,$.jsx)(Q.Text,{type:`secondary`,style:{fontSize:14,textAlign:`center`,display:`block`,padding:`40px 0`},children:`暂无已选指标`}):(0,$.jsx)(`div`,{children:h.map((e,t)=>{let n=p.find(t=>t.name===e);return(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,padding:`8px 12px`,borderBottom:`1px solid #f0f0f5`,cursor:`move`,userSelect:`none`},draggable:!0,onDragStart:e=>{e.dataTransfer.setData(`index`,String(t))},onDragOver:e=>{e.preventDefault()},onDrop:e=>{let n=parseInt(e.dataTransfer.getData(`index`)),r=t;if(n!==r){let e=[...h],[t]=e.splice(n,1);e.splice(r,0,t),g(e)}},children:[(0,$.jsx)(Q.Text,{children:n?.description||e}),(0,$.jsx)(Q.Text,{type:`secondary`,style:{fontSize:12},children:t+1})]},e)})})})]})]})})]})},ice=()=>{let e=Ye(),[t]=On(),{message:n}=Vb.useApp(),[r,i]=(0,S.useState)(0),[a,o]=(0,S.useState)(!0),[s,c]=(0,S.useState)(!1),[l,u]=(0,S.useState)(``);(0,S.useEffect)(()=>{let r=t.get(`auth_code`),a=t.get(`state`);if(!r||!a){o(!1),i(10);return}let s={auth_code:r,state:a,app_id:t.get(`app_id`)||void 0,material_auth_status:t.get(`material_auth_status`)||void 0,scope:t.get(`scope`)||void 0,uid:t.get(`uid`)||void 0};(async()=>{try{let t=await Yie(s);c(!0),o(!1),n.success(t?.message||`授权成功`),setTimeout(()=>{e(`/authorization`)},1500)}catch(e){let t=e?.message||`授权失败`;u(t),o(!1),n.error(t)}})();let l=setInterval(()=>{i(e=>e>=11?(o(!1),e):e+1)},1e3);return()=>{clearInterval(l)}},[e,t,n]);let d=()=>{i(0),o(!0),c(!1),u(``),window.location.href=`/authorization`};return s?(0,$.jsx)(`div`,{style:{minHeight:`100vh`,display:`flex`,justifyContent:`center`,alignItems:`center`,background:`linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%)`},children:(0,$.jsxs)(`div`,{style:{textAlign:`center`,padding:`60px 80px`,background:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.1)`},children:[(0,$.jsx)(`div`,{style:{width:80,height:80,background:`#dcfce7`,borderRadius:`50%`,display:`flex`,justifyContent:`center`,alignItems:`center`,margin:`0 auto 24px`},children:(0,$.jsx)(Q.Text,{style:{fontSize:40,color:`#22c55e`},children:`✓`})}),(0,$.jsx)(Q.Title,{level:3,style:{marginBottom:16,color:`#1e293b`},children:`授权成功`}),(0,$.jsx)(Q.Text,{style:{color:`#64748b`},children:`正在跳转至授权管理页面...`})]})}):(0,$.jsx)(`div`,{style:{minHeight:`100vh`,display:`flex`,justifyContent:`center`,alignItems:`center`,background:`linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%)`},children:(0,$.jsxs)(`div`,{style:{textAlign:`center`,padding:`60px 80px`,background:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.1)`},children:[(0,$.jsx)(`div`,{style:{width:80,height:80,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:`50%`,display:`flex`,justifyContent:`center`,alignItems:`center`,margin:`0 auto 24px`},children:a&&r<10?(0,$.jsx)(UG,{size:`large`,description:`加载中`,style:{color:`#fff`}}):(0,$.jsx)(cV,{style:{fontSize:40,color:`#fff`}})}),l?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Q.Title,{level:3,style:{marginBottom:16,color:`#ef4444`},children:`授权失败`}),(0,$.jsx)(Q.Text,{style:{color:`#64748b`,marginBottom:24,display:`block`},children:l}),(0,$.jsx)(X,{type:`primary`,size:`large`,icon:(0,$.jsx)(wq,{}),onClick:d,style:{borderRadius:8,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,fontWeight:600,padding:`12px 32px`},children:`重新授权`})]}):r>=10?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Q.Title,{level:3,style:{marginBottom:16,color:`#ef4444`},children:`授权无响应`}),(0,$.jsx)(Q.Text,{style:{color:`#64748b`,marginBottom:24,display:`block`},children:`请重新授权`}),(0,$.jsx)(X,{type:`primary`,size:`large`,icon:(0,$.jsx)(wq,{}),onClick:d,style:{borderRadius:8,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,fontWeight:600,padding:`12px 32px`},children:`重新授权`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Q.Title,{level:3,style:{marginBottom:16,color:`#1e293b`},children:`授权中,请等待`}),(0,$.jsx)(Q.Text,{style:{color:`#64748b`,marginBottom:24,display:`block`},children:`正在等待平台完成授权操作`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,gap:8},children:[(0,$.jsx)(cV,{style:{color:`#6366f1`}}),(0,$.jsxs)(Q.Text,{style:{color:`#6366f1`,fontWeight:500,fontSize:16},children:[r,`s`]})]})]})]})})},ace=()=>(0,$.jsxs)(`div`,{className:`content_box`,children:[(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{padding:`28px 32px`,borderRadius:16,background:`linear-gradient(135deg, #fffbeb 0%, #fef3c7 50%, #fed7aa 100%)`,border:`1px solid rgba(245, 158, 11, 0.18)`,marginBottom:24,position:`relative`,overflow:`hidden`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14,marginBottom:12},children:[(0,$.jsx)(`div`,{style:{width:52,height:52,borderRadius:14,background:`linear-gradient(135deg, #f59e0b 0%, #d97706 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 6px 20px rgba(245, 158, 11, 0.3)`},children:(0,$.jsx)(R2,{style:{fontSize:24,color:`#fff`}})}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`shiny-text-container`,style:{marginBottom:4},children:(0,$.jsx)(`span`,{className:`shiny-text`,style:{fontSize:26,fontWeight:700,backgroundImage:`linear-gradient(90deg, #f59e0b 0%, #d97706 30%, #ea580c 50%, #d97706 70%, #f59e0b 100%)`},children:`行业爆款大盘`})}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:13,color:`#b45309`},children:[(0,$.jsx)(a8,{style:{fontSize:12}}),(0,$.jsx)(`span`,{children:`实时追踪全网热门素材趋势`})]})]})]}),(0,$.jsx)(Q.Text,{style:{color:`#78716c`,fontSize:14,lineHeight:1.7},children:`实时追踪各行业爆款素材,把握创作风向,打造热门内容`})]}),(0,$.jsx)(`div`,{style:{position:`relative`},children:(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{padding:`24px 28px`,borderRadius:16,background:`#fff`},children:[(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:20},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`},children:[(0,$.jsx)(`div`,{style:{width:4,height:18,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,marginRight:10}}),(0,$.jsx)(q8,{style:{marginRight:8,color:`#6366f1`,fontSize:16}}),(0,$.jsx)(`span`,{style:{fontSize:17,fontWeight:600,color:`#1f2937`},children:`爆款素材榜单`}),(0,$.jsx)(`span`,{style:{marginLeft:10,fontSize:12,fontWeight:400,color:`#94a3b8`}})]})}),(0,$.jsxs)(`div`,{className:`stagger-children`,style:{display:`grid`,gridTemplateColumns:`repeat(2, 1fr)`,gap:16,position:`relative`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,zIndex:1,inset:0,background:`rgb(255,255,255)`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexDirection:`column`,gap:2,color:`#fff`,borderRadius:6},children:(0,$.jsxs)(X,{type:`primary`,size:`middle`,onClick:()=>{Z.info(`请联系客服开通会员`)},style:{borderRadius:10,fontWeight:500,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,boxShadow:`0 4px 14px rgba(99, 102, 241, 0.28)`},children:[(0,$.jsx)(X3,{style:{marginRight:6}}),`立即解锁全部`,(0,$.jsx)(C2,{style:{marginLeft:4,fontSize:12}})]})}),[{rank:1,title:`夏日美妆教程:3 步打造奶油肌`,author:`美妆博主·小雅`,views:`128.4w`,likes:`12.6w`,comments:`8,234`,tag:`NO.1`,tagColor:`#f59e0b`},{rank:2,title:`平价穿搭 | 学生党一周不重样`,author:`穿搭达人·Miki`,views:`96.2w`,likes:`9.8w`,comments:`6,128`,tag:`NO.2`,tagColor:`#a78bfa`},{rank:3,title:`探店 vlog | 网红咖啡馆测评`,author:`美食探店·阿伦`,views:`78.5w`,likes:`7.4w`,comments:`4,892`,tag:`NO.3`,tagColor:`#6366f1`},{rank:4,title:`iPhone 16 Pro 一周深度体验`,author:`数码评测·老王`,views:`65.7w`,likes:`6.1w`,comments:`3,847`,tag:`NO.4`,tagColor:`#94a3b8`}].map(e=>(0,$.jsxs)(`div`,{className:`project-card animate-fadeInUp`,style:{display:`flex`,gap:14,padding:14,borderRadius:14,background:`#fff`,border:`1px solid #e2e8f0`,cursor:`pointer`},children:[(0,$.jsxs)(`div`,{style:{position:`relative`,width:140,height:80,flexShrink:0,borderRadius:10,overflow:`hidden`,background:`linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:[(0,$.jsx)(q6,{style:{fontSize:28,color:`rgba(255,255,255,0.6)`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:6,left:6,padding:`2px 8px`,borderRadius:6,background:e.tagColor,color:`#fff`,fontSize:11,fontWeight:600},children:e.tag})]}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:0,display:`flex`,flexDirection:`column`},children:[(0,$.jsx)(`div`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:4,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:e.title}),(0,$.jsx)(`div`,{style:{fontSize:12,color:`#94a3b8`,marginBottom:8},children:e.author}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:12,fontSize:12,color:`#64748b`},children:[(0,$.jsxs)(`span`,{children:[(0,$.jsx)(mW,{style:{marginRight:3}}),e.views]}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(W3,{style:{marginRight:3}}),e.likes]}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(M4,{style:{marginRight:3}}),e.comments]})]})]})]},e.rank))]})]})})]}),oce=()=>(0,$.jsxs)(`div`,{className:`content_box`,children:[(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{padding:`28px 32px`,borderRadius:16,background:`linear-gradient(135deg, #f5f3ff 0%, #ede9fe 50%, #fce7f3 100%)`,border:`1px solid rgba(139, 92, 246, 0.12)`,marginBottom:24,position:`relative`,overflow:`hidden`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14,marginBottom:12},children:[(0,$.jsx)(`div`,{style:{width:52,height:52,borderRadius:14,background:`linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 6px 20px rgba(139, 92, 246, 0.3)`},children:(0,$.jsx)(m3,{style:{fontSize:24,color:`#fff`}})}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`shiny-text-container`,style:{marginBottom:4},children:(0,$.jsx)(`span`,{className:`shiny-text`,style:{fontSize:26,fontWeight:700},children:`创意素材案例`})}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:13,color:`#7c3aed`},children:[(0,$.jsx)(V4,{style:{fontSize:12}}),(0,$.jsx)(`span`,{children:`探索 AI 创作无限可能`})]})]})]}),(0,$.jsx)(Q.Text,{style:{color:`#64748b`,fontSize:14,lineHeight:1.7},children:`精选 AI 生成的优秀素材案例,展示 AI 创作的无限潜力与创意灵感`})]}),(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{padding:`24px 28px`,borderRadius:16,background:`#fff`,position:`relative`},children:[(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:20},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`},children:[(0,$.jsx)(`div`,{style:{width:4,height:18,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,marginRight:10}}),(0,$.jsx)(R8,{style:{marginRight:8,color:`#f59e0b`,fontSize:16}}),(0,$.jsx)(`span`,{style:{fontSize:17,fontWeight:600,color:`#1f2937`},children:`精选案例展示`})]})}),(0,$.jsxs)(`div`,{className:`stagger-children`,style:{display:`grid`,gridTemplateColumns:`repeat(3, 1fr)`,gap:16,marginBottom:16,position:`relative`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,zIndex:1,background:`rgb(255,255,255)`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexDirection:`column`,borderRadius:14,gap:4,color:`#fff`},children:(0,$.jsxs)(X,{type:`primary`,size:`middle`,onClick:()=>{Z.info(`请联系客服开通会员`)},style:{borderRadius:10,fontWeight:500,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,boxShadow:`0 4px 14px rgba(99, 102, 241, 0.28)`},children:[(0,$.jsx)(X3,{style:{marginRight:6}}),`解锁全部案例`,(0,$.jsx)(C2,{style:{marginLeft:4,fontSize:12}})]})}),[{title:`美妆直播切片`,tag:`热门`,tagColor:`#ef4444`},{title:`3C 数码测评`,tag:`推荐`,tagColor:`#6366f1`},{title:`美食探店 vlog`,tag:`推荐`,tagColor:`#6366f1`},{title:`服饰穿搭合集`,tag:`热门`,tagColor:`#ef4444`},{title:`家居场景展示`,tag:`推荐`,tagColor:`#6366f1`},{title:`母婴亲子内容`,tag:`热门`,tagColor:`#ef4444`}].map((e,t)=>(0,$.jsxs)(`div`,{className:`project-card animate-fadeInUp`,style:{position:`relative`,borderRadius:14,overflow:`hidden`,cursor:`pointer`,border:`1px solid #e2e8f0`,background:`#fff`},children:[(0,$.jsxs)(`div`,{style:{position:`relative`,aspectRatio:`16/9`,background:`linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:[(0,$.jsx)(q6,{style:{fontSize:36,color:`rgba(255,255,255,0.6)`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:10,left:10,padding:`2px 8px`,borderRadius:6,background:e.tagColor,color:`#fff`,fontSize:11,fontWeight:500},children:e.tag})]}),(0,$.jsxs)(`div`,{style:{padding:`10px 14px`,background:`#f8fafc`,display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,$.jsx)(`span`,{style:{fontSize:13,color:`#334155`,fontWeight:500,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:e.title}),(0,$.jsx)(mW,{style:{fontSize:13,color:`#94a3b8`}})]})]},t))]})]})]}),{RangePicker:sce}=hV;function $9(e){if(!e)return`-`;try{return new Date(e).toLocaleString(`zh-CN`,{hour12:!1})}catch{return`-`}}var cce={recharge:{color:`green`,label:`充值`},consume:{color:`red`,label:`消费`},refund:{color:`orange`,label:`退款`},team_internal:{color:`blue`,label:`团队内部`}},lce=()=>{let[e,t]=(0,S.useState)(null),[n,r]=(0,S.useState)(!1),i=(0,S.useCallback)(async()=>{r(!0);try{t(await Bae())}catch(e){Z.error(e?.message||`获取团队信息失败`)}finally{r(!1)}},[]);(0,S.useEffect)(()=>{i()},[i]);let[a,o]=(0,S.useState)([]),[s,c]=(0,S.useState)(0),[l,u]=(0,S.useState)(!1),[d,f]=(0,S.useState)(1),p=(0,S.useCallback)(async()=>{if(e){u(!0);try{let e=await Vae(d);o(e.items||[]),c(e.total||0)}catch(e){Z.error(e?.message||`加载成员失败`)}finally{u(!1)}}},[e,d]);(0,S.useEffect)(()=>{p()},[p]);let[m,h]=(0,S.useState)({open:!1,member:null}),[g]=tU.useForm(),[_,v]=(0,S.useState)(!1),y=async()=>{if(m.member)try{let e=await g.validateFields(),t=Number(e.amount);if(!t||t<=0||t>9999999){Z.error(`请输入有效的正数积分数量`);return}v(!0),await Hae(m.member.id,t,e.direction||`increase`,e.description),Z.success(e.direction===`decrease`?`积分扣减成功`:`积分增加成功`),h({open:!1,member:null}),g.resetFields(),p(),he()}catch(e){if(e?.errorFields)return;Z.error(e?.message||`操作失败`)}finally{v(!1)}},[b,x]=(0,S.useState)([]),[C,w]=(0,S.useState)(!1),[T,E]=(0,S.useState)(!1),[D]=tU.useForm(),[O,k]=(0,S.useState)(!1),A=(0,S.useCallback)(async()=>{w(!0);try{x(await Uae()||[])}catch(e){Z.error(e?.message||`加载邀请码失败`)}finally{w(!1)}},[]);(0,S.useEffect)(()=>{A()},[A]);let j=async()=>{try{let e=await D.validateFields();k(!0),await Wae(e.maxUses||null,null),Z.success(`邀请码已生成`),E(!1),D.resetFields(),A()}catch(e){if(e?.errorFields)return;Z.error(e?.message||`创建失败`)}finally{k(!1)}},M=async e=>{try{await Gae(e),Z.success(`已撤销`),A()}catch(e){Z.error(e?.message||`撤销失败`)}},N=e=>{navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(e).then(()=>{Z.success(`邀请链接已复制`)}).catch(()=>{P(e)}):P(e)},P=e=>{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.left=`-9999px`,t.style.top=`-9999px`,document.body.appendChild(t),t.focus(),t.select();try{document.execCommand(`copy`),Z.success(`邀请链接已复制`)}catch{Z.warning(`复制失败,请手动复制`)}document.body.removeChild(t)},[F,I]=(0,S.useState)([]),[L,R]=(0,S.useState)(!1),[z,B]=(0,S.useState)(`pending`),[V,H]=(0,S.useState)(`members`),U=(0,S.useRef)(!1),W=(0,S.useRef)(0),ee=(0,S.useCallback)(async(e,t=!1)=>{R(!0);try{let n=await Kae(e),r=n?.length||0;I(n||[]),e===`pending`&&r>0&&(t&&!U.current?(U.current=!0,mK.confirm({title:(0,$.jsxs)(sH,{children:[(0,$.jsx)(V2,{style:{color:`#f59e0b`}}),`待处理的加入申请`]}),content:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`p`,{children:[`您有 `,(0,$.jsx)(`strong`,{style:{color:`#ef4444`},children:r}),` 条待处理的团队加入申请。`]}),(0,$.jsx)(`p`,{style:{color:`#64748b`,fontSize:13,marginBottom:0},children:`请及时处理新成员的加入申请。`})]}),okText:`立即处理`,cancelText:`稍后处理`,onOk:()=>{H(`requests`)}})):!t&&r>W.current&&Z.info({content:`有 ${r-W.current} 条新的加入申请待处理`,duration:5})),e===`pending`&&(W.current=r)}catch(e){Z.error(e?.message||`加载申请失败`)}finally{R(!1)}},[]);(0,S.useEffect)(()=>{ee(`pending`,!0)},[ee]),(0,S.useEffect)(()=>{if(!e)return;let t=setInterval(()=>{ee(`pending`,!1)},6e4);return()=>clearInterval(t)},[e,ee]);let te=async(e,t,n)=>{try{await qae(e,t,n),Z.success(t===`approve`?`已通过`:`已拒绝`),ee(z),p()}catch(e){Z.error(e?.message||`操作失败`)}},[G,ne]=(0,S.useState)([]),[re,ie]=(0,S.useState)(0),[ae,oe]=(0,S.useState)(null),[K,q]=(0,S.useState)(!1),[se,ce]=(0,S.useState)(1),[le,ue]=(0,S.useState)(``),[de,fe]=(0,S.useState)(``),[pe,me]=(0,S.useState)(()=>{let e=(0,bE.default)().format(`YYYY-MM-DD`);return[e,e]}),he=(0,S.useCallback)(async()=>{q(!0);try{let e=await Zae({page:se,pageSize:10,phone:de||void 0,recordType:le||void 0,startDate:pe?.[0]||void 0,endDate:pe?.[1]||void 0});ne(e.items||[]),ie(e.total||0),oe(e.summary||null)}catch(e){Z.error(e?.message||`加载积分记录失败`)}finally{q(!1)}},[se,le,de,pe]);(0,S.useEffect)(()=>{he()},[he]);let ge=()=>{ue(``),fe(``);let e=(0,bE.default)().format(`YYYY-MM-DD`);me([e,e]),ce(1)},_e=()=>{let e=Qae({phone:de||void 0,recordType:le||void 0,startDate:pe?.[0]||void 0,endDate:pe?.[1]||void 0}),t=localStorage.getItem(`auth_token`),n=t?{Authorization:`Bearer ${t}`}:{};fetch(e,{headers:n}).then(e=>e.blob()).then(e=>{let t=document.createElement(`a`);t.href=URL.createObjectURL(e),t.download=`团队积分_${(0,bE.default)().format(`YYYYMMDD_HHmmss`)}.csv`,t.click(),URL.revokeObjectURL(t.href)}).catch(()=>Z.error(`导出失败`))},ve=[{title:`用户名`,dataIndex:`username`,width:140,render:e=>(0,$.jsx)(Q.Text,{strong:!0,children:e})},{title:`手机号`,dataIndex:`phone`,width:130,render:e=>e||`-`},{title:`积分`,dataIndex:`credits`,width:100,render:e=>(0,$.jsx)(Q.Text,{style:{color:`#6366f1`},children:(e??0).toFixed(2)})},{title:`状态`,dataIndex:`isActive`,width:80,render:e=>(0,$.jsx)(XQ,{color:e?`green`:`red`,children:e?`启用`:`禁用`})},{title:`加入时间`,dataIndex:`joinedAt`,width:170,render:e=>$9(e)},{title:`操作`,key:`action`,width:100,render:(e,t)=>{let n=_7.getState().user?.id;return t.id===n?(0,$.jsx)(gw,{title:`不能给自己调整积分`,children:(0,$.jsx)(X,{size:`small`,type:`link`,style:{padding:0,color:`#999`,cursor:`not-allowed`},disabled:!0,children:`调整积分`})}):(0,$.jsx)(X,{size:`small`,type:`link`,style:{padding:0},onClick:()=>{h({open:!0,member:t}),g.resetFields()},children:`调整积分`})}}],ye=e=>`${window.location.origin}/join-team?code=${e}`,be=[{title:`邀请码`,dataIndex:`code`,width:200,render:e=>(0,$.jsx)(Q.Text,{copyable:!0,style:{fontFamily:`monospace`},children:e})},{title:`邀请链接`,dataIndex:`code`,render:e=>{let t=ye(e);return(0,$.jsxs)(sH,{style:{width:`100%`},children:[(0,$.jsx)(Q.Text,{style:{flex:1,fontSize:12,wordBreak:`break-all`,fontFamily:`monospace`,color:`#64748b`},children:t}),(0,$.jsx)(gw,{title:`复制链接`,children:(0,$.jsx)(X,{size:`small`,type:`text`,icon:(0,$.jsx)(t1,{}),onClick:()=>N(t)})})]})}},{title:`状态`,dataIndex:`status`,width:80,render:e=>(0,$.jsx)(XQ,{color:e===`active`?`green`:`default`,children:e===`active`?`有效`:`已撤销`})},{title:`使用次数`,key:`uses`,width:100,render:(e,t)=>`${t.useCount}${t.maxUses?`/${t.maxUses}`:``}`},{title:`过期时间`,dataIndex:`expiresAt`,width:170,render:e=>e?$9(e):`永不过期`},{title:`操作`,key:`action`,width:80,render:(e,t)=>t.status===`active`?(0,$.jsx)(X,{size:`small`,type:`link`,danger:!0,onClick:()=>M(t.id),children:`撤销`}):null}],xe=e=>{let t={pending:{color:`orange`,text:`待处理`},approved:{color:`green`,text:`已通过`},rejected:{color:`red`,text:`已拒绝`}}[e]||{color:`default`,text:e};return(0,$.jsx)(XQ,{color:t.color,children:t.text})},Se=[{title:`申请人`,dataIndex:`username`,width:140,render:e=>(0,$.jsx)(Q.Text,{strong:!0,children:e})},{title:`手机号`,dataIndex:`phone`,width:130,render:e=>e||`-`},{title:`状态`,dataIndex:`status`,width:100,render:e=>xe(e)},{title:`申请时间`,dataIndex:`createdAt`,width:170,render:e=>$9(e)},{title:`处理时间`,dataIndex:`handledAt`,width:170,render:e=>e?$9(e):`-`},{title:`备注`,dataIndex:`note`,width:180,ellipsis:!0,render:e=>e||`-`},{title:`操作`,key:`action`,width:160,render:(e,t)=>t.status===`pending`?(0,$.jsxs)(sH,{size:4,children:[(0,$.jsx)(X,{size:`small`,type:`link`,icon:(0,$.jsx)(hC,{}),style:{color:`#16a34a`,padding:0},onClick:()=>te(t.id,`approve`),children:`通过`}),(0,$.jsx)(X,{size:`small`,type:`link`,icon:(0,$.jsx)(ju,{}),danger:!0,style:{padding:0},onClick:()=>{mK.confirm({title:`拒绝申请`,content:(0,$.jsx)(tU,{layout:`vertical`,style:{marginTop:12},children:(0,$.jsx)(tU.Item,{name:`note`,label:`拒绝原因(可选)`,children:(0,$.jsx)(IW.TextArea,{rows:2,placeholder:`选填`,id:`reject-note-input`})})}),onOk:()=>{let e=document.getElementById(`reject-note-input`)?.value||void 0;te(t.id,`reject`,e)}})},children:`拒绝`})]}):(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:12},children:`已处理`})}],Ce=[{title:`用户名`,dataIndex:`username`,width:120,render:e=>(0,$.jsx)(Q.Text,{strong:!0,children:e||`-`})},{title:`手机号`,dataIndex:`phone`,width:120,render:e=>e||`-`},{title:`类型`,dataIndex:`type`,width:100,render:(e,t)=>{let n=cce[t.type]||{color:`default`,label:t.type||`-`};return(0,$.jsx)(XQ,{color:n.color,children:n.label})}},{title:`变动积分`,dataIndex:`amount`,width:110,align:`right`,render:(e,t)=>(0,$.jsxs)(Q.Text,{strong:!0,style:{color:t.amount>=0?`#10b981`:`#ef4444`,fontSize:14},children:[t.amount>=0?`+`:``,(t.amount??0).toFixed(2)]})},{title:`余额`,dataIndex:`balanceAfter`,width:100,align:`right`,render:e=>(e??0).toFixed(2)},{title:`说明`,dataIndex:`description`,ellipsis:!0,minWidth:160,render:e=>e||`-`},{title:`时间`,dataIndex:`createdAt`,width:170,render:e=>$9(e)}],we={borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,overflow:`hidden`},Te={padding:`16px`,textAlign:`right`},Ee=[{key:`members`,label:(0,$.jsxs)(sH,{children:[(0,$.jsx)($8,{}),`成员列表`,s>0&&(0,$.jsxs)(`span`,{style:{color:`#94a3b8`,fontSize:12},children:[`(`,s,`)`]})]}),children:(0,$.jsxs)(`div`,{style:we,children:[(0,$.jsx)(LQ,{columns:ve,dataSource:a,rowKey:`id`,loading:l,pagination:!1,bordered:!1,scroll:{x:800},locale:{emptyText:(0,$.jsx)(XS,{description:`暂无成员`})}}),s>0&&(0,$.jsx)(`div`,{style:Te,children:(0,$.jsx)(SG,{current:d,pageSize:20,total:s,onChange:e=>f(e),size:`small`})})]})},{key:`credits`,label:(0,$.jsxs)(sH,{children:[(0,$.jsx)(r5,{}),`团队积分变动`]}),children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{marginBottom:12,display:`flex`,gap:8,flexWrap:`wrap`,alignItems:`center`},children:[(0,$.jsx)(EC,{value:le||void 0,onChange:e=>{ue(e||``),ce(1)},allowClear:!0,placeholder:`交易类型`,style:{width:130},options:[{value:`recharge`,label:`充值`},{value:`consume`,label:`消费`},{value:`team_internal`,label:`团队内部`},{value:`refund`,label:`退款`}]}),(0,$.jsx)(IW,{placeholder:`搜索手机号`,value:de,onChange:e=>{fe(e.target.value),ce(1)},style:{width:160},allowClear:!0}),(0,$.jsx)(sce,{value:pe?[(0,bE.default)(pe[0]),(0,bE.default)(pe[1])]:void 0,onChange:e=>{e&&e[0]&&e[1]?me([e[0].format(`YYYY-MM-DD`),e[1].format(`YYYY-MM-DD`)]):me(null),ce(1)}}),(0,$.jsx)(X,{onClick:ge,children:`重置`}),(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(m0,{}),onClick:_e,children:`导出 Excel`})]}),(0,$.jsx)(`div`,{style:{marginBottom:12,padding:`8px 16px`,background:`#f8f9fc`,borderRadius:8,display:`flex`,gap:24,flexWrap:`wrap`,fontSize:13},children:(0,$.jsxs)(`span`,{children:[`总消耗积分:`,(0,$.jsx)(`strong`,{style:{color:`#ef4444`,fontSize:15},children:ae?.totalConsume??0})]})}),(0,$.jsxs)(`div`,{style:we,children:[(0,$.jsx)(LQ,{rowKey:`id`,loading:K,dataSource:G,pagination:!1,bordered:!1,scroll:{x:950},columns:Ce,locale:{emptyText:(0,$.jsx)(XS,{description:`暂无积分记录`})}}),re>0&&(0,$.jsx)(`div`,{style:Te,children:(0,$.jsx)(SG,{current:se,pageSize:10,total:re,onChange:e=>ce(e),size:`small`,showTotal:e=>`共 ${e} 条`})})]})]})},{key:`invitations`,label:(0,$.jsxs)(sH,{children:[(0,$.jsx)(t1,{}),`邀请管理`]}),children:(0,$.jsxs)(`div`,{style:we,children:[(0,$.jsx)(`div`,{style:{padding:16,paddingBottom:0},children:(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(rL,{}),onClick:()=>E(!0),children:`生成邀请码`})}),(0,$.jsx)(LQ,{columns:be,dataSource:b,rowKey:`id`,loading:C,pagination:!1,bordered:!1,scroll:{x:900},locale:{emptyText:(0,$.jsx)(XS,{description:`暂无邀请码`})}})]})},{key:`requests`,label:(0,$.jsxs)(sH,{children:[(0,$.jsx)(E3,{}),`加入申请`,F.length>0&&z===`pending`&&(0,$.jsx)(XQ,{color:`red`,children:F.length})]}),children:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{marginBottom:16,display:`flex`,alignItems:`center`},children:(0,$.jsx)(cz,{value:z,onChange:e=>{B(e),ee(e)},options:[{label:`待处理`,value:`pending`},{label:`已通过`,value:`approved`},{label:`已拒绝`,value:`rejected`},{label:`全部`,value:``}],style:{borderRadius:12,border:`1px solid #e2e8f0`,padding:3,background:`#f8fafc`,boxShadow:`0 2px 8px rgba(0,0,0,0.06)`,"--ant-segmented-item-selected-bg":`#6366f1`,"--ant-segmented-item-selected-color":`#ffffff`},size:`middle`})}),(0,$.jsx)(`div`,{style:we,children:(0,$.jsx)(LQ,{columns:Se,dataSource:F,rowKey:`id`,loading:L,pagination:!1,bordered:!1,scroll:{x:1e3},locale:{emptyText:(0,$.jsx)(XS,{description:z===`pending`?`暂无待审批申请`:`暂无记录`})}})})]})}];return(0,$.jsxs)(`div`,{style:{padding:24},children:[(0,$.jsx)(`div`,{style:{marginBottom:24},children:n?(0,$.jsx)(Q.Text,{type:`secondary`,children:`加载中...`}):e?(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,flexWrap:`wrap`,gap:12},children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Title,{level:4,style:{margin:0},children:e.name}),(0,$.jsxs)(Q.Text,{type:`secondary`,children:[`代码: `,e.code||`-`,` 成员: `,e.memberCount,` 人`]})]}),(0,$.jsx)(X,{icon:(0,$.jsx)(wq,{}),onClick:()=>{i(),p(),A(),ee(z),he()},children:`刷新`})]}):(0,$.jsx)(Q.Text,{type:`secondary`,children:`无法获取团队信息`})}),(0,$.jsx)(TL,{items:Ee,activeKey:V,onChange:H,size:`large`}),(0,$.jsx)(mK,{title:(0,$.jsxs)(sH,{children:[(0,$.jsx)($8,{}),`调整成员积分 - `,m.member?.username]}),open:m.open,confirmLoading:_,onOk:y,onCancel:()=>h({open:!1,member:null}),okText:`确认`,width:480,children:(0,$.jsxs)(tU,{form:g,layout:`vertical`,style:{marginTop:16},initialValues:{direction:`increase`},children:[(0,$.jsxs)(`div`,{style:{marginBottom:16,padding:`10px 16px`,background:`#f0f4ff`,borderRadius:8,display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(Q.Text,{type:`secondary`,children:`我的当前积分`}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:20,color:`#6366f1`},children:_7.getState().user?.credits?.toFixed(2)??`0.00`})]}),(0,$.jsx)(tU.Item,{name:`direction`,label:`操作类型`,rules:[{required:!0,message:`请选择操作类型`}],children:(0,$.jsxs)(jI.Group,{buttonStyle:`solid`,size:`large`,style:{width:`100%`},children:[(0,$.jsx)(jI.Button,{value:`increase`,style:{width:`50%`,textAlign:`center`},children:`增加成员积分`}),(0,$.jsx)(jI.Button,{value:`decrease`,style:{width:`50%`,textAlign:`center`},children:`扣减成员积分`})]})}),(0,$.jsx)(tU.Item,{name:`amount`,label:`积分数量`,required:!0,rules:[{required:!0,message:`请输入积分数量`},{type:`number`,min:.01,message:`必须大于 0`},{type:`number`,max:9999999,message:`单次不能超过 9999999`}],validateTrigger:[`onChange`,`onBlur`],children:(0,$.jsx)(Yz,{style:{width:`100%`},step:1,min:.01,max:9999999,precision:2,placeholder:`请输入正数积分数量`,size:`large`,formatter:e=>{if(!e)return``;let t=`${e}`.replace(/[^0-9.]/g,``);return t=t.replace(/^0+(?=\d)/,``),t},parser:e=>{if(!e||e===`.`)return``;let t=parseFloat(e);return isNaN(t)||t<=0?``:Math.min(t,9999999)},onKeyDown:e=>{(e.key===`-`||e.key===`e`||e.key===`E`)&&e.preventDefault()},onChange:e=>{e??g.validateFields([`amount`])}})}),(0,$.jsx)(tU.Item,{name:`description`,label:`备注`,children:(0,$.jsx)(IW.TextArea,{rows:2,maxLength:256,placeholder:`选填,例如:活动奖励`})})]})}),(0,$.jsx)(mK,{title:(0,$.jsxs)(sH,{children:[(0,$.jsx)(t1,{}),`生成邀请码`]}),open:T,confirmLoading:O,onOk:j,onCancel:()=>{E(!1),D.resetFields()},okText:`生成`,width:480,children:(0,$.jsxs)(tU,{form:D,layout:`vertical`,style:{marginTop:16},children:[(0,$.jsx)(tU.Item,{name:`maxUses`,label:`最大使用次数`,children:(0,$.jsx)(Yz,{style:{width:`100%`},min:1,placeholder:`留空表示不限`,size:`large`})}),(0,$.jsxs)(`div`,{style:{padding:`12px 16px`,background:`#eef2ff`,borderRadius:8,fontSize:13,color:`#4f46e5`,display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(cV,{}),(0,$.jsxs)(`span`,{children:[`邀请码自生成起 `,(0,$.jsx)(`strong`,{children:`24 小时`}),` 内有效,过期自动失效。`]})]})]})})]})},uce=()=>{let[e]=On(),t=Ye(),n=e.get(`code`)||``,{user:r,loading:i,checkAuth:a}=_7(),[o,s]=(0,S.useState)(!0),[c,l]=(0,S.useState)(null),[u,d]=(0,S.useState)(!1),[f,p]=(0,S.useState)(!1),[m,h]=(0,S.useState)(!1),[g,_]=(0,S.useState)(`VideoGen.AI`),[v,y]=(0,S.useState)(``);return(0,S.useEffect)(()=>{a(),j5().then(e=>{_(e.siteName),y(e.siteLogo)}).catch(()=>{})},[a]),(0,S.useEffect)(()=>{if(!n){s(!1);return}i||(s(!0),(r?Jae(n):Yae(n)).then(e=>{l(e),e?.valid&&r&&!e.alreadyInTeam&&!e.hasPendingRequest&&h(!0)}).catch(()=>l(null)).finally(()=>s(!1)))},[n,r,i]),i||o?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,alignItems:`center`,minHeight:`60vh`},children:(0,$.jsx)(UG,{size:`large`})}):f?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:40},children:(0,$.jsx)(Jq,{status:`success`,icon:(0,$.jsx)(d4,{style:{color:`#6366f1`}}),title:`申请已提交`,subTitle:`您的加入申请已提交,请等待团队管理人审批。审批通过后将自动加入团队。`,extra:(0,$.jsx)(sH,{children:(0,$.jsx)(X,{type:`primary`,onClick:()=>t(`/projects`),children:`返回首页`})})})}):!n||!c?.valid?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:40},children:(0,$.jsx)(Jq,{status:`error`,title:`邀请链接无效`,subTitle:`该邀请链接可能已过期或不存在,请联系团队管理人重新获取。`,extra:(0,$.jsx)(X,{type:`primary`,onClick:()=>t(`/projects`),children:`返回首页`})})}):c.alreadyInTeam?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:40},children:(0,$.jsx)(Jq,{status:`info`,title:`您已在此团队中`,subTitle:`您已经是「${c.teamName}」的成员了,无需再次加入。`,extra:(0,$.jsx)(sH,{children:(0,$.jsx)(X,{type:`primary`,onClick:()=>t(`/projects`),children:`返回首页`})})})}):c.hasPendingRequest?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:40},children:(0,$.jsx)(Jq,{status:`info`,title:`申请待审批`,subTitle:`您已提交加入「${c.teamName}」的申请,请等待团队管理人审批。`,extra:(0,$.jsx)(sH,{children:(0,$.jsx)(X,{type:`primary`,onClick:()=>t(`/projects`),children:`返回首页`})})})}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:`40px 20px`},children:(0,$.jsxs)(`div`,{style:{width:`100%`,maxWidth:480},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,gap:12,marginBottom:32},children:[v?(0,$.jsx)(`img`,{src:v,alt:`logo`,style:{width:40,height:40,borderRadius:10}}):(0,$.jsx)(`div`,{style:{width:40,height:40,borderRadius:10,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(W8,{style:{fontSize:20,color:`#fff`}})}),(0,$.jsx)(`span`,{style:{fontSize:22,fontWeight:700,color:`#1e293b`,letterSpacing:.5},children:g})]}),(0,$.jsxs)(DL,{variant:`outlined`,style:{borderRadius:16,width:`100%`,textAlign:`center`},children:[(0,$.jsx)(H8,{style:{fontSize:48,color:`#6366f1`,marginBottom:16}}),(0,$.jsx)(Q.Title,{level:3,children:`加入团队`}),(0,$.jsx)(Q.Text,{style:{fontSize:16,color:`#475569`,display:`block`,marginBottom:8},children:`您被邀请加入团队`}),(0,$.jsxs)(Q.Title,{level:4,style:{color:`#6366f1`,margin:`16px 0 24px`},children:[`「`,c.teamName,`」`]}),(0,$.jsx)(Q.Text,{type:`secondary`,style:{display:`block`,marginBottom:24},children:`加入后团队管理人可以为您分配积分、查看您的积分使用情况。`}),r?(0,$.jsx)(X,{type:`primary`,size:`large`,block:!0,loading:u,onClick:()=>h(!0),children:`申请加入`}):(0,$.jsxs)(sH,{direction:`vertical`,style:{width:`100%`},size:12,children:[(0,$.jsx)(X,{type:`primary`,size:`large`,block:!0,icon:(0,$.jsx)($3,{}),onClick:()=>{t(`/login?redirect=${encodeURIComponent(window.location.pathname+window.location.search)}`)},children:`登录后申请加入`}),(0,$.jsx)(X,{size:`large`,block:!0,icon:(0,$.jsx)(Zre,{}),onClick:()=>{t(`/login?tab=register&redirect=${encodeURIComponent(window.location.pathname+window.location.search)}`)},children:`注册新账号`}),(0,$.jsx)(Q.Text,{type:`secondary`,style:{fontSize:12},children:`登录或注册后将自动提交加入申请`})]})]})]})}),(0,$.jsxs)(mK,{title:(0,$.jsxs)(sH,{children:[(0,$.jsx)(H8,{style:{color:`#6366f1`}}),`确认加入团队`]}),open:m,onOk:async()=>{if(n)try{d(!0),await Xae(n),p(!0),h(!1),Z.success(`申请已提交`)}catch(e){Z.error(e?.message||`申请失败`)}finally{d(!1)}},onCancel:()=>h(!1),okText:`确认加入`,cancelText:`取消`,confirmLoading:u,width:420,children:[(0,$.jsxs)(`p`,{style:{marginBottom:0},children:[`您确定要加入团队 `,(0,$.jsxs)(`strong`,{style:{color:`#6366f1`},children:[`「`,c.teamName,`」`]}),` 吗?`]}),(0,$.jsx)(`p`,{style:{marginTop:8,color:`#64748b`,fontSize:13},children:`提交后需等待团队管理人审批,审批通过后将自动加入团队。`})]})]})},dce=new Set([`group_active`,`callback_success`]),fce=()=>{let e=(0,S.useMemo)(()=>new URLSearchParams(window.location.search),[]),t=e.get(`status`)||``,n=e.get(`resultCode`)||``,r=dce.has(t)||n===`10000`;return(0,$.jsx)(`div`,{style:{minHeight:`100vh`,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`#f8fafc`,padding:20},children:(0,$.jsxs)(DL,{style:{width:`100%`,maxWidth:520,borderRadius:18},children:[(0,$.jsx)(Jq,{status:r?`success`:`error`,title:r?`真人认证已完成`:`真人认证未完成`,subTitle:r?`请回到电脑端查看,项目组已创建成功。`:`请回到电脑端重新发起创建项目组。`,extra:[(0,$.jsx)(X,{type:`primary`,onClick:()=>{let e=/MicroMessenger/i.test(navigator.userAgent),t=/AlipayClient/i.test(navigator.userAgent),n=/Android|iPhone|iPad/i.test(navigator.userAgent);if(e)try{window.opener=null,window.open(``,`_self`),window.close()}catch{Z.info(`请点击右上角关闭按钮`)}else if(t)try{window.close()}catch{Z.info(`请点击左上角返回`)}else if(n)try{window.history.back()}catch{window.location.href=`/`}else try{window.close()}catch{window.location.href=`/`}},children:`关闭页面`},`close`)]}),(0,$.jsx)(Q.Paragraph,{type:`secondary`,style:{textAlign:`center`,marginBottom:0,fontSize:13,marginTop:12},children:`如无法自动关闭,请手动关闭页面`})]})})};bE.default.locale(`zh-cn`);var pce=({children:e})=>{let{user:t,loading:n,checkAuth:r}=_7();return(0,S.useEffect)(()=>{!localStorage.getItem(`auth_token`)&&!n&&!t&&(window.location.href=`/login`)},[t,n]),n?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,alignItems:`center`,height:`100vh`},children:(0,$.jsx)(UG,{size:`large`})}):t?(0,$.jsx)($.Fragment,{children:e}):(window.location.href=`/login`,null)};(0,_.createRoot)(document.getElementById(`root`)).render((0,$.jsx)(()=>{let{checkAuth:e}=_7();return(0,S.useEffect)(()=>{e()},[]),(0,$.jsx)(Fm,{locale:M0.default,theme:{token:{colorPrimary:`#6366f1`,borderRadius:8,fontFamily:`'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif`},components:{Button:{controlHeight:36,controlHeightLG:44},Card:{boxShadow:`0 1px 3px rgba(0,0,0,0.04)`},Table:{headerBg:`#fafbfc`}}},children:(0,$.jsx)(Vb,{children:(0,$.jsx)(_n,{children:(0,$.jsxs)(Dt,{children:[(0,$.jsx)(Tt,{path:`/login`,element:(0,$.jsx)(roe,{})}),(0,$.jsx)(Tt,{path:`/join-team`,element:(0,$.jsx)(uce,{})}),(0,$.jsx)(Tt,{path:`/private-portrait-authorized`,element:(0,$.jsx)(fce,{})}),(0,$.jsxs)(Tt,{path:`/`,element:(0,$.jsx)(pce,{children:(0,$.jsx)(toe,{})}),children:[(0,$.jsx)(Tt,{index:!0,element:(0,$.jsx)(Ct,{to:`/projects`,replace:!0})}),(0,$.jsx)(Tt,{path:`projects`,element:(0,$.jsx)(aoe,{})}),(0,$.jsx)(Tt,{path:`projects/:projectId/generate`,element:(0,$.jsx)(hoe,{})}),(0,$.jsx)(Tt,{path:`records`,element:(0,$.jsx)(goe,{})}),(0,$.jsx)(Tt,{path:`credits`,element:(0,$.jsx)(_oe,{})}),(0,$.jsx)(Tt,{path:`credit-records`,element:(0,$.jsx)(H7,{})}),(0,$.jsx)(Tt,{path:`order-records`,element:(0,$.jsx)(H7,{})}),(0,$.jsx)(Tt,{path:`user-center`,element:(0,$.jsx)(H7,{})}),(0,$.jsx)(Tt,{path:`messages`,element:(0,$.jsx)(boe,{})}),(0,$.jsx)(Tt,{path:`home`,element:(0,$.jsx)(tce,{})}),(0,$.jsx)(Tt,{path:`conversation`,element:(0,$.jsx)(nse,{})}),(0,$.jsx)(Tt,{path:`initial`,element:(0,$.jsx)(sse,{})}),(0,$.jsx)(Tt,{path:`initial/:creatID/initialinfo`,element:(0,$.jsx)(pse,{})}),(0,$.jsx)(Tt,{path:`removelens`,element:(0,$.jsx)(gse,{})}),(0,$.jsx)(Tt,{path:`removelens/:creatID/removeinfo`,element:(0,$.jsx)(Yse,{})}),(0,$.jsx)(Tt,{path:`removelens/:creatID/removefenbu`,element:(0,$.jsx)(X9,{})}),(0,$.jsx)(Tt,{path:`generated`,element:(0,$.jsx)(Tse,{})}),(0,$.jsx)(Tt,{path:`pretest`,element:(0,$.jsx)(Dse,{})}),(0,$.jsx)(Tt,{path:`authorization`,element:(0,$.jsx)(kse,{})}),(0,$.jsx)(Tt,{path:`authoriza-waiting`,element:(0,$.jsx)(ice,{})}),(0,$.jsx)(Tt,{path:`materials`,element:(0,$.jsx)(Lse,{})}),(0,$.jsx)(Tt,{path:`materials/private-portrait-virtual`,element:(0,$.jsx)(Ct,{to:`/generated?filterType=private_portrait&portraitTab=aigc_virtual`,replace:!0})}),(0,$.jsx)(Tt,{path:`consume`,element:(0,$.jsx)(rce,{})}),(0,$.jsx)(Tt,{path:`popular`,element:(0,$.jsx)(ace,{})}),(0,$.jsx)(Tt,{path:`authacc`,element:(0,$.jsx)(jse,{})}),(0,$.jsx)(Tt,{path:`creativeplaza`,element:(0,$.jsx)(oce,{})}),(0,$.jsx)(Tt,{path:`team-management`,element:(0,$.jsx)(lce,{})})]}),(0,$.jsx)(Tt,{path:`*`,element:(0,$.jsx)(Ct,{to:`/projects`,replace:!0})})]})})})})},{})); \ No newline at end of file + `}),(0,$.jsx)(`div`,{style:{margin:`auto`,display:`flex`,flexDirection:`column`,width:y.length>0?`${y.length*80+Math.max(0,y.length-1)*1}px`:`100%`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,height:86,borderRadius:12,background:`#fff`,gap:1,position:`relative`},children:[x&&y.length===0?(0,$.jsxs)(`div`,{style:{flex:`1 1 auto`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:[(0,$.jsx)(UG,{size:`small`}),(0,$.jsx)(Rse,{style:{marginLeft:8,color:`#64748b`},children:`正在抽取每秒帧...`})]}):y.length>0?y.map(e=>{let t=e.second>=_[0]&&e.second<_[1];return(0,$.jsxs)(`button`,{type:`button`,onClick:()=>I(e.second),title:`${e.second}s${e.fallback?`,实际取帧 ${e.captureSecond?.toFixed(1)}s`:``}`,style:{minWidth:80,flex:`0 0 80px`,height:86,borderTop:t?`5px solid #6366f1`:`none`,borderBottom:t?`5px solid #6366f1`:`none`,padding:0,background:`transparent`,overflow:`hidden`,cursor:A?`not-allowed`:`pointer`,position:`relative`},children:[e.status===`success`&&e.image?(0,$.jsx)(`img`,{src:e.image,alt:`${e.second}s`,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}}):e.status===`loading`?(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(UG,{size:`small`})}):(0,$.jsxs)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,color:`#64748b`,fontSize:12,background:`#fff`},children:[(0,$.jsxs)(`span`,{children:[e.second,`s`]}),(0,$.jsx)(`span`,{style:{fontSize:11},children:`无有效帧`})]}),(0,$.jsxs)(`span`,{style:{position:`absolute`,left:0,bottom:3,color:`#ffffffff`,fontSize:16,textShadow:`0 1px 3px rgba(0,0,0,.7)`},children:[e.second,`s`]})]},e.second)}):(0,$.jsx)(`div`,{style:{flex:`1 1 auto`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#64748b`},children:`暂无帧预览,请确认视频是否加载完成`}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:-10,left:0,right:0,bottom:0},children:(0,$.jsx)(zB,{range:!0,min:0,max:O||a,step:1,value:_,onChange:P,onChangeComplete:F,tooltip:{formatter:e=>`${B9(Number(e||0))}s`},disabled:!O||A,styles:{track:{background:`#6969dd63`,height:86,borderRadius:12,margin:`0 `},rail:{height:86,borderRadius:12},handle:{width:20,height:86,marginTop:0,borderRadius:`50%`}}})})]})})]}),(0,$.jsxs)(`div`,{style:{marginTop:16,textAlign:`center`,color:`#64748b`,fontSize:14},children:[`已选取 `,k,`s`]}),E&&(0,$.jsx)(`div`,{style:{marginTop:12,padding:`10px 14px`,borderRadius:8,background:`rgba(239, 68, 68, 0.08)`,border:`1px solid rgba(239, 68, 68, 0.15)`,color:`#ef4444`,fontSize:13,textAlign:`center`},children:E})]})]})})},{TextArea:qse}=IW,Jse=`http://ceshi.apiforeign.minzhong.cn`,G9=2,K9=15;function q9(e){return e?/^https?:\/\//i.test(e)?e:`${Jse}${e}`:``}function Yse(){let{creatID:e}=$e(),t=Ye(),[n,r]=(0,S.useState)(!1),[i,a]=(0,S.useState)(!1),[o,s]=(0,S.useState)(null),[c,l]=(0,S.useState)(null),[u,d]=(0,S.useState)(null),[f,p]=(0,S.useState)(!1),m=(0,S.useRef)(null),[h,g]=(0,S.useState)(``),[_,v]=(0,S.useState)(``),[y,b]=(0,S.useState)(``),[x,C]=(0,S.useState)(``),[w,T]=(0,S.useState)(null),[E,D]=(0,S.useState)([]),[O,k]=(0,S.useState)(!1),[A,j]=(0,S.useState)(!1),[M,N]=(0,S.useState)(!1),P=(0,S.useRef)(null),F=(0,S.useRef)(null),I=(0,S.useMemo)(()=>q9(w?.videoUrl),[w?.videoUrl]),L=(0,S.useMemo)(()=>E.length===0?`AI自动拆分`:E.some(e=>e.sourceMode===`ai_suggestion`)?`AI重拆`:`AI自动拆分`,[E]),R=(0,S.useCallback)(async()=>{if(e)try{T(await $5(e))}catch{Z.error(`获取任务详情失败`)}},[e]),z=(0,S.useCallback)(async()=>{if(e)try{let t=(await e7(e)).items||[];D(t),t.some(e=>e.moduleProjectCurrentStepCode!==`video_generate`&&e.moduleProjectStatus!==`completed`&&e.moduleProjectStatus!==`failed`)?P.current||=window.setInterval(async()=>{try{let t=(await e7(e)).items||[];D(e=>e.map(e=>{let n=t.find(t=>t.id===e.id);return n&&(e.split_status||e.splitStatus,n.split_status||n.splitStatus,e.moduleProjectCurrentStepCode!==`video_generate`||e.moduleProjectStatus!==`completed`&&e.moduleProjectStatus!==`failed`)?n:e})),t.every(e=>e.moduleProjectCurrentStepCode===`video_generate`||e.moduleProjectStatus===`completed`||e.moduleProjectStatus===`failed`)&&(P.current&&=(clearInterval(P.current),null))}catch{}},3e4):P.current&&=(clearInterval(P.current),null)}catch{Z.error(`获取拆镜列表失败`)}},[e]),B=(0,S.useCallback)(async()=>{if(e)try{await cae(e),Z.success(`重新分析已提交`),R(),F.current||=window.setInterval(async()=>{try{let t=await $5(e);T(t),(t.analysisStatus===`completed`||t.analysisStatus===`failed`)&&(F.current&&=(clearInterval(F.current),null))}catch{}},3e3)}catch(e){Z.error(e?.message||`重新分析失败`)}},[e,R]),V=(0,S.useCallback)(async e=>{try{await uae(e),Z.success(`重新分析已提交`),z()}catch(e){Z.error(e?.message||`重新分析失败`)}},[z]),H=(0,S.useCallback)(async t=>{try{await dae(t),Z.success(`重新切割已提交`),await z(),!P.current&&e&&(P.current=window.setInterval(async()=>{try{let t=(await e7(e)).items||[];D(e=>e.map(e=>{let n=t.find(t=>t.id===e.id);return n&&(e.moduleProjectCurrentStepCode!==`video_generate`||e.moduleProjectStatus!==`completed`&&e.moduleProjectStatus!==`failed`)?n:e})),t.every(e=>e.moduleProjectCurrentStepCode===`video_generate`||e.moduleProjectStatus===`completed`||e.moduleProjectStatus===`failed`)&&(P.current&&=(clearInterval(P.current),null))}catch{P.current&&=(clearInterval(P.current),null)}},3e3))}catch(e){Z.error(e?.message||`重新切割失败`)}},[e,z]),U=(0,S.useCallback)(async e=>{try{await lae(e),Z.success(`删除成功`),z()}catch(e){Z.error(e?.message||`删除失败`)}},[z]),W=(0,S.useCallback)(async()=>{await Promise.all([R(),z()])},[R,z]);(0,S.useEffect)(()=>(W(),()=>{P.current&&=(clearInterval(P.current),null),F.current&&=(clearInterval(F.current),null)}),[W]),(0,S.useEffect)(()=>{if(w)return w.analysisStatus===`processing`?F.current=window.setInterval(async()=>{try{T(await $5(e))}catch{}},3e3):F.current&&=(clearInterval(F.current),null),()=>{F.current&&=(clearInterval(F.current),null)}},[w?.analysisStatus,e]);let ee=(e,t)=>{s(e),l(t),r(!0)},te=()=>{r(!1),s(null),g(``),l(``),v(``),b(``),C(``)},G=async e=>{try{let t=await jie(e);b(t.url),C(t.resource_id||``),Z.success(`图片上传成功`)}catch{Z.error(`图片上传失败,请重试`)}return!1},ne=async()=>{if(!o){Z.warning(`请先选择拆镜片段`);return}if(!y){Z.warning(`请上传产品图`);return}if(!h.trim()){Z.warning(`请输入产品名称`);return}if(!_.trim()){Z.warning(`请输入产品卖点`);return}let n={target_project_name:h.trim(),core_content_point:_.trim(),material_image_url:y,material_image_resource_id:x||void 0,idempotency_key:`replication_${Date.now()}`};k(!0);try{await rae(o,n),Z.success(`视频生成任务创建成功`),te(),e7(e).then(e=>{let n=e.items.find(e=>e.id===o);Z.loading(`创建中...`,3),setTimeout(()=>{t(`/removelens/${n.moduleProjectId}/removefenbu`)},3e3)})}catch(e){Z.error(e?.message||`创建失败,请重试`)}finally{k(!1)}},re=async()=>{if(e){N(!0);try{let t=E.some(e=>e.sourceMode===`ai_suggestion`);await tae(e,{selected_indices:[],replace_existing:t}),Z.success(t?`AI 重拆任务已提交`:`AI 拆镜任务已提交`),await W()}catch(e){Z.error(e?.message||`拆镜失败`)}finally{N(!1)}}},ie=()=>{if(!I){Z.warning(`原视频地址不存在`);return}a(!0)},ae=async t=>{if(e){if(t.durationSecondK9){Z.warning(`拆镜片段不能超过 ${K9} 秒`);return}j(!0);try{await nae(e,{start_second:t.startSecond,end_second:t.endSecond}),Z.success(`手动拆镜任务已提交`),a(!1),await W()}catch(e){Z.error(e?.message||`手动拆镜失败`)}finally{j(!1)}}},oe=e=>e?.splitStatus===`completed`&&!!e?.segmentVideoUrl;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{margin:`-24px -32px -32px`,borderRadius:20,minHeight:`calc(100vh - 34px)`,display:`flex`,flexDirection:`column`,overflow:`hidden`,background:`linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #f0f9ff 100%)`,position:`relative`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:-100,right:-100,width:300,height:300,background:`radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%)`,borderRadius:`50%`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,bottom:-100,left:-100,width:300,height:300,background:`radial-gradient(circle, rgba(167,139,250,0.08) 0%, transparent 70%)`,borderRadius:`50%`}}),(0,$.jsx)(`div`,{style:{padding:`16px 24px`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,borderRadius:16,background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,border:`1px solid rgba(99, 102, 241, 0.08)`,position:`relative`,zIndex:10},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:16},children:[(0,$.jsx)(X,{icon:(0,$.jsx)(b2,{}),onClick:()=>t(-1),style:{borderRadius:10,fontSize:13,height:32,background:`rgba(99, 102, 241, 0.1)`,border:`1px solid rgba(99, 102, 241, 0.2)`,color:`#6366f1`},children:`返回`}),(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #6366f1, #8b5cf6, transparent)`,borderRadius:1}}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h1`,{style:{fontSize:18,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,margin:0},children:`AI视频拆镜工作台`}),(0,$.jsx)(`p`,{style:{fontSize:13,color:`#64748b`,margin:`4px 0 0 0`},children:`一键拆解画面分镜,助力仿拍或创作`})]}),(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #8b5cf6, #6366f1, transparent)`,borderRadius:1}})]})}),w?(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,justifyContent:`space-between`,overflow:`hidden`},children:[(0,$.jsxs)(`div`,{style:{flex:1,background:`linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.6) 100%)`,backdropFilter:`blur(20px)`,borderRadius:20,display:`flex`,alignItems:`center`,gap:30,padding:24,border:`1px solid rgba(99, 102, 241, 0.1)`,position:`relative`,overflow:`hidden`},children:[(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{position:`relative`,width:280,height:160,borderRadius:12,overflow:`hidden`,flexShrink:0,boxShadow:`0 4px 16px rgba(0,0,0,0.1)`,cursor:`pointer`},onClick:()=>{d(I),p(!0)},onMouseEnter:e=>{let t=e.currentTarget.querySelector(`div:last-child`);t&&(t.style.opacity=`1`)},onMouseLeave:e=>{let t=e.currentTarget.querySelector(`div:last-child`);t&&(t.style.opacity=`0`)},children:[(0,$.jsx)(`video`,{src:I,style:{width:`100%`,height:`100%`,objectFit:`cover`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:0,left:0,right:0,bottom:0,background:`rgba(0,0,0,0.2)`,display:`flex`,alignItems:`center`,justifyContent:`center`,opacity:0,transition:`opacity 0.2s`},children:(0,$.jsx)(`div`,{style:{width:40,height:40,borderRadius:`50%`,background:`rgba(255,255,255,0.9)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`#6366f1`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,$.jsx)(`polygon`,{points:`5 3 19 12 5 21 5 3`})})})})]}),w.analysisStatus===`failed`&&(0,$.jsx)(`div`,{style:{marginTop:12,textAlign:`center`},children:(0,$.jsx)(X,{onClick:B,style:{width:`100%`,padding:`6px 16px`,borderRadius:8,fontSize:12,border:`1px solid #ef4444`,color:`#ef4444`,background:`rgba(239, 68, 68, 0.05)`,cursor:w.analysisStatus===`processing`?`not-allowed`:`pointer`,transition:`all 0.2s`},onMouseEnter:e=>{w.analysisStatus!==`processing`&&(e.currentTarget.style.background=`rgba(239, 68, 68, 0.1)`)},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(239, 68, 68, 0.05)`},children:w.analysisStatus===`processing`?`分析中...`:`重新分析`})})]}),(0,$.jsx)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,justifyContent:`space-between`,position:`relative`,zIndex:1},children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,$.jsx)(`h2`,{style:{fontSize:20,fontWeight:600,marginBottom:16,background:`linear-gradient(135deg, #1e293b 0%, #334155 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`},children:`视频总结`}),(0,$.jsx)(`div`,{style:{textAlign:`right`},children:(0,$.jsxs)(`span`,{style:{color:`#94a3b8`,fontSize:12},children:[`上传时间: `,w.createdAt?new Date(w.createdAt).toLocaleString(`zh-CN`,{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}):`-`]})})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,marginBottom:12},children:[(0,$.jsx)(`span`,{style:{color:`#64748b`,fontSize:14,marginRight:12,width:80,flexShrink:0},children:`产品名称:`}),(0,$.jsx)(`span`,{style:{color:`#1e293b`,fontWeight:500},children:w.title})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,marginBottom:12},children:[(0,$.jsx)(`span`,{style:{color:`#64748b`,fontSize:14,marginRight:12,width:80,flexShrink:0},children:`受众群体:`}),w.analysisStatus===`processing`?(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(UG,{size:`small`,style:{color:`#f59e0b`}}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#f59e0b`},children:`分析中`})]}):w.analysisStatus===`completed`?(0,$.jsx)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`},children:(w.originalVideoAudience?.split(`、`)||[]).map((e,t)=>(0,$.jsx)(XQ,{style:{fontSize:12,background:`rgba(99, 102, 241, 0.1)`,color:`#6366f1`,border:`none`,borderRadius:20},children:e},t))}):w.analysisStatus===`failed`?(0,$.jsx)(`span`,{style:{color:`#ef4444`,fontSize:14},children:`分析失败`}):null]}),(0,$.jsxs)(`div`,{style:{display:`flex`},children:[(0,$.jsx)(`span`,{style:{color:`#64748b`,fontSize:14,marginRight:12,width:80,flexShrink:0},children:`视频内容:`}),w.analysisStatus===`processing`?(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(UG,{size:`small`,style:{color:`#f59e0b`}}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#f59e0b`},children:`分析中`})]}):w.analysisStatus===`completed`?(0,$.jsx)(`span`,{style:{color:`#475569`,lineHeight:1.6,height:100,overflowY:`auto`},children:w.originalVideoContent}):w.analysisStatus===`failed`?(0,$.jsx)(`span`,{style:{color:`#ef4444`,fontSize:14},children:`分析失败`}):null]})]})})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:16,marginBottom:20,marginTop:20},children:[(0,$.jsx)(X,{type:`default`,onClick:ie,disabled:!I||A,style:{flex:1,height:52,borderRadius:12,border:`2px solid rgba(99, 102, 241, 0.3)`,color:`#6366f1`,fontWeight:600,fontSize:15,background:`rgba(255, 255, 255, 0.9)`,backdropFilter:`blur(10px)`,transition:`all 0.3s cubic-bezier(0.4, 0, 0.2, 1)`},onMouseEnter:e=>{e.currentTarget.style.borderColor=`#6366f1`,e.currentTarget.style.boxShadow=`0 4px 20px rgba(99, 102, 241, 0.2)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`rgba(99, 102, 241, 0.3)`,e.currentTarget.style.boxShadow=`none`},children:`手动`}),(0,$.jsx)(vK,{title:L===`AI重拆`?`确定要AI重拆吗?`:`确定要AI拆分吗?`,okText:`确定`,cancelText:`取消`,onConfirm:re,children:(0,$.jsxs)(X,{type:`primary`,loading:M,disabled:M,style:{flex:1,height:52,borderRadius:12,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%)`,fontWeight:600,fontSize:15,border:`none`,boxShadow:`0 4px 20px rgba(99, 102, 241, 0.3)`,transition:`all 0.3s cubic-bezier(0.4, 0, 0.2, 1)`,position:`relative`,overflow:`hidden`},onMouseEnter:e=>{e.currentTarget.style.transform=`translateY(-2px)`,e.currentTarget.style.boxShadow=`0 6px 25px rgba(99, 102, 241, 0.4)`},onMouseLeave:e=>{e.currentTarget.style.transform=`translateY(0)`,e.currentTarget.style.boxShadow=`0 4px 20px rgba(99, 102, 241, 0.3)`},children:[(0,$.jsx)(`span`,{style:{position:`relative`,zIndex:1},children:L}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:0,left:`-100%`,width:`100%`,height:`100%`,background:`linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent)`,transition:`left 0.5s ease`},onMouseEnter:e=>{e.currentTarget.style.left=`100%`}}),w?.aiSuggestions&&w.aiSuggestions.length>0&&(0,$.jsx)(gw,{title:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{fontWeight:600,marginBottom:8,color:`#6366f1`},children:`AI拆分方案`}),(w?.ai_suggestions||w?.aiSuggestions||[]).map(e=>(0,$.jsxs)(`div`,{style:{marginBottom:8,fontSize:13,lineHeight:1.5},children:[(0,$.jsxs)(`span`,{style:{fontWeight:500,color:`#6366f1`},children:[e.index,`.`]}),(0,$.jsx)(`span`,{style:{marginLeft:4,color:`#000000ff`},children:e.timeNode}),(0,$.jsx)(`br`,{}),(0,$.jsx)(`span`,{style:{color:`#666`},children:e.content})]},e.index))]}),placement:`top`,trigger:`hover`,overlayInnerStyle:{backgroundColor:`#fff`,height:300,overflowY:`auto`,border:`1px solid rgba(99, 102, 241, 0.1)`,borderRadius:12,boxShadow:`0 8px 24px rgba(99, 102, 241, 0.12)`},children:(0,$.jsx)(`span`,{style:{marginLeft:8,fontSize:13,opacity:.9},children:`(AI 镜头拆分方案)`})})]})})]}),(0,$.jsxs)(`div`,{style:{flex:2,background:`linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%)`,backdropFilter:`blur(20px)`,borderRadius:20,overflow:`hidden`,display:`flex`,flexDirection:`column`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`},children:[(0,$.jsxs)(`div`,{style:{padding:`16px 24px`,borderBottom:`1px solid rgba(99, 102, 241, 0.1)`,background:`linear-gradient(135deg, rgba(99,102,241,0.02) 0%, transparent 100%)`},children:[(0,$.jsx)(`h3`,{style:{fontSize:16,fontWeight:600,color:`#1e293b`,margin:0},children:`拆镜片段列表`}),(0,$.jsxs)(`span`,{style:{fontSize:12,color:`#64748b`,marginLeft:12},children:[`共 `,E.length,` 个片段`]})]}),(0,$.jsx)(LQ,{columns:[{title:`片段`,width:100,fixed:`left`,align:`center`,render:(e,t)=>(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{style:{fontSize:16,fontWeight:600,color:`#333`},children:t.segmentName||`片段${t.segmentIndex||``}`}),(0,$.jsx)(`div`,{style:{fontSize:12,color:`#999`},children:t.timeNode}),t.sourceMode===`custom`&&(0,$.jsx)(XQ,{color:`blue`,style:{marginTop:6},children:`手动`}),t.sourceMode===`ai_suggestion`&&(0,$.jsx)(XQ,{color:`orange`,style:{marginTop:6},children:`自动`})]})},{title:`片段视频`,width:150,align:`center`,render:(e,t)=>(0,$.jsx)(`div`,{style:{position:`relative`,width:120,height:80,borderRadius:6,overflow:`hidden`,background:`#f1f5f9`,cursor:`pointer`},onClick:()=>{t.segmentVideoUrl&&(d(q9(t.segmentVideoUrl)),p(!0))},children:t.segmentVideoUrl?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`video`,{src:q9(t.segmentVideoUrl),style:{width:`100%`,height:`100%`,objectFit:`cover`,pointerEvents:`none`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:0,left:0,right:0,bottom:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`rgba(0,0,0,0.3)`},children:(0,$.jsx)(`div`,{style:{width:32,height:32,borderRadius:`50%`,background:`rgba(255,255,255,0.9)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`div`,{style:{width:0,height:0,borderTop:`8px solid transparent`,borderBottom:`8px solid transparent`,borderLeft:`14px solid #6366f1`,marginLeft:2}})})})]}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:6,fontSize:12},children:t.splitStatus===`failed`?(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`切割失败`}):(t.splitStatus,(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(UG,{size:`small`,style:{color:`#f59e0b`}}),(0,$.jsx)(`span`,{style:{color:`#f59e0b`},children:`切割中`})]}))})})},{title:`视频内容`,width:500,align:`left`,render:(e,t)=>{let n=t.split_status||t.splitStatus;if(n===`pending`)return(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(UG,{size:`small`,style:{color:`#f59e0b`}}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#f59e0b`},children:`切割中`})]});if(n===`processing`)return(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(UG,{size:`small`}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#f59e0b`},children:`切割中`})]});if(t.source_mode===`ai_suggestion`||t.sourceMode===`ai_suggestion`)return(0,$.jsx)(`div`,{style:{fontSize:14,color:`#333`,lineHeight:1.6},children:t.segmentContent||t.lastError||`-`});let r=t.analysis_status||t.analysisStatus,i={not_required:`无需单独分析`,pending:`等待分析`,processing:`分析中`,failed:`分析失败`};return r===`processing`?(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(UG,{size:`small`}),(0,$.jsx)(`span`,{style:{fontSize:14,color:`#f59e0b`},children:`分析中`})]}):r===`failed`?(0,$.jsx)(`div`,{style:{fontSize:14,color:`#ef4444`,lineHeight:1.6},children:`分析失败`}):(0,$.jsx)(`div`,{style:{fontSize:14,color:`#333`,lineHeight:1.6},children:r&&i[r]?i[r]:t.segmentContent||t.lastError||`-`})}},{title:`视频类型`,width:120,align:`center`,render:(e,t)=>(0,$.jsx)(`div`,{style:{fontSize:14,color:`#333`,fontWeight:500},children:t.segmentCategory||`-`})},{title:`状态`,width:120,align:`center`,dataIndex:`moduleProjectStatus`,render:(e,t)=>{let n=e,r=t.moduleProjectCurrentStepCode||t.currentStepCode,i=(()=>{if(r===`image_prompt_optimize`)switch(n){case`waiting_user`:return{text:`等待融合图生成`,color:`#f59e0b`};case`processing`:return{text:`图片提示词生成中`,color:`#f59e0b`};case`completed`:return{text:`图片提示词生成成功`,color:`#10b981`};case`failed`:return{text:`图片提示词生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`image_generate`)switch(n){case`waiting_user`:return{text:`等待生成视频提示词`,color:`#f59e0b`};case`processing`:return{text:`融合图生成中`,color:`#f59e0b`};case`completed`:return{text:`融合图生成成功`,color:`#10b981`};case`failed`:return{text:`融合图生成失败`,color:`#ef4444`};default:return n||`-`}else if(r===`video_prompt_optimize`)switch(n){case`waiting_user`:return{text:`等待最终视频生成`,color:`#f59e0b`};case`processing`:return{text:`视频提示词生成中`,color:`#f59e0b`};case`completed`:return{text:`视频提示词生成成功`,color:`#10b981`};case`failed`:return{text:`视频提示词生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`video_generate`)switch(n){case`waiting_user`:return{text:``,color:`#666`};case`processing`:return{text:`最终视频生成中`,color:`#f59e0b`};case`completed`:return{text:`任务完成`,color:`#10b981`};case`failed`:return{text:`最终视频生成失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else if(r===`material_input`)switch(n){case`waiting_user`:return{text:`等待生成图片提示词`,color:`#f59e0b`};case`processing`:return{text:`素材处理中`,color:`#f59e0b`};case`completed`:return{text:`素材上传成功`,color:`#10b981`};case`failed`:return{text:`素材上传失败`,color:`#ef4444`};default:return{text:n||`-`,color:`#666`}}else return t.moduleProjectId?{pending:{text:`子任务待处理`,color:`#f59e0b`},waiting_user:{text:`等待用户确认或触发`,color:`#f59e0b`},processing:{text:`子任务处理中`,color:`#f59e0b`},completed:{text:`子任务完成`,color:`#10b981`},failed:{text:`子任务失败`,color:`#ef4444`},cancelled:{text:`子任务取消`,color:`#94a3b8`}}[n]||{text:n||`-`,color:`#666`}:{text:`待生成任务`,color:`#94a3b8`}})();return typeof i==`string`?(0,$.jsx)(`span`,{style:{fontSize:12,color:`#666`,fontWeight:500},children:i}):(0,$.jsx)(`span`,{style:{fontSize:12,color:i.color,fontWeight:500},children:i.text})}},{title:`操作`,width:200,fixed:`right`,align:`center`,render:(e,n)=>(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[n.moduleProjectId?(0,$.jsx)(X,{type:`text`,onClick:()=>t(`/removelens/${n.moduleProjectId}/removefenbu`),style:{color:`#10b981`,fontSize:12,padding:0,display:`flex`,alignItems:`center`,gap:4},children:`详情任务`}):(0,$.jsx)(X,{type:`text`,onClick:()=>ee(String(n.id),n.segmentName),disabled:!oe(n),style:{color:oe(n)?`#f59e0b`:`#94a3b8`,fontSize:12,padding:0,display:`flex`,alignItems:`center`,gap:4},children:oe(n)?`视频生成`:`待切割完成`}),n.analysisStatus===`failed`&&(0,$.jsx)(X,{type:`text`,onClick:()=>V(String(n.id)),style:{color:`#f89411ff`,fontSize:12,padding:0,display:`flex`,alignItems:`center`,gap:4},children:`重新分析`}),n.splitStatus===`failed`&&(0,$.jsx)(X,{type:`text`,onClick:()=>H(String(n.id)),style:{color:`#f89411ff`,fontSize:12,padding:0,display:`flex`,alignItems:`center`,gap:4},children:`重新切割`}),(0,$.jsx)(vK,{title:`确定删除此片段?`,onConfirm:()=>U(String(n.id)),okText:`确定`,cancelText:`取消`,children:(0,$.jsx)(X,{type:`text`,style:{color:`#ef4444`,fontSize:12,padding:0,display:`flex`,alignItems:`center`,gap:4},children:`删除`})})]})}],dataSource:E,pagination:!1,bordered:!1,rowKey:`id`,scroll:{y:300},style:{flex:1},components:{body:{row:({className:e,style:t,...n})=>(0,$.jsx)(`tr`,{...n,className:e,style:{...t,transition:`all 0.2s ease`,borderBottom:`1px solid rgba(99, 102, 241, 0.05)`,height:80,overflow:`auto`}}),cell:({className:e,style:t,...n})=>(0,$.jsx)(`td`,{...n,className:e,style:{...t,padding:`16px 24px`}})},header:{cell:({className:e,style:t,...n})=>(0,$.jsx)(`th`,{...n,className:e,style:{...t,background:`rgba(255, 255, 255, 1)`,color:`#64748b`,fontWeight:500,fontSize:13,padding:`16px 24px`,borderBottom:`none`}})}}})]})]}):(0,$.jsx)(`div`,{style:{flex:1,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`span`,{style:{fontSize:16,color:`#999`},children:`加载中...`})})]}),(0,$.jsx)(Kse,{open:i,videoUrl:I,title:`手动视频切片`,loading:A,minDuration:G9,maxDuration:K9,onCancel:()=>a(!1),onConfirm:ae}),(0,$.jsx)(QV,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,width:`100%`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:18,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`},children:`智能视频复刻`}),c&&(0,$.jsxs)(`span`,{style:{fontSize:14,color:`#64748b`},children:[`- `,c]})]}),(0,$.jsx)(X,{type:`text`,icon:(0,$.jsx)(c5,{}),onClick:te,style:{padding:0,color:`#64748b`,fontSize:14}})]}),placement:`right`,closable:!1,onClose:te,open:n,size:480,styles:{body:{padding:`24px`,background:`linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%)`},header:{background:`#fff`,borderBottom:`1px solid rgba(99, 102, 241, 0.1)`,padding:`20px 24px`},section:{borderRadius:`20px 0 0 20px`,overflow:`hidden`}},children:(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:20},children:[(0,$.jsxs)(`div`,{style:{background:`#fff`,borderRadius:12,padding:16,border:`1px solid rgba(99, 102, 241, 0.1)`},children:[(0,$.jsxs)(`label`,{style:{fontWeight:500,color:`#334155`,marginBottom:8,display:`block`,fontSize:14},children:[`产品白底图 `,(0,$.jsx)(`span`,{style:{color:`#ef4444`},children:`*`})]}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:12},children:(0,$.jsx)(`div`,{style:{width:120,height:120,borderRadius:8,border:`2px dashed rgba(99, 102, 241, 0.3)`,background:`rgba(99, 102, 241, 0.02)`,position:`relative`,overflow:`hidden`},children:y?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`img`,{src:q9(y),alt:`产品图`,style:{width:`100%`,height:`100%`,objectFit:`cover`}}),(0,$.jsx)(`button`,{onClick:()=>{b(``),C(``)},style:{position:`absolute`,bottom:4,right:4,width:24,height:24,borderRadius:`50%`,backgroundColor:`rgba(0, 0, 0, 0.5)`,border:`none`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(u$,{style:{color:`#fff`,fontSize:12}})})]}):(0,$.jsx)(b0,{beforeUpload:G,maxCount:1,accept:`image/*`,style:{width:`100%`,height:`100%`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:6,width:`100%`,height:`100%`},children:[(0,$.jsx)(rL,{style:{fontSize:20,color:`#6366f1`}}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#64748b`},children:`上传产品图`})]})})})})]}),(0,$.jsxs)(`div`,{style:{background:`#fff`,borderRadius:12,padding:16,border:`1px solid rgba(99, 102, 241, 0.1)`},children:[(0,$.jsxs)(`label`,{style:{fontWeight:500,color:`#334155`,marginBottom:8,display:`block`,fontSize:14},children:[`产品名称 `,(0,$.jsx)(`span`,{style:{color:`#ef4444`},children:`*`})]}),(0,$.jsx)(IW,{value:h,onChange:e=>g(e.target.value),placeholder:`请输入产品名称`,style:{height:44,borderRadius:8,border:`1px solid rgba(99, 102, 241, 0.2)`},maxLength:10,showCount:!0})]}),(0,$.jsxs)(`div`,{style:{background:`#fff`,borderRadius:12,padding:16,border:`1px solid rgba(99, 102, 241, 0.1)`},children:[(0,$.jsxs)(`label`,{style:{fontWeight:500,color:`#334155`,marginBottom:8,display:`block`,fontSize:14},children:[`产品卖点 `,(0,$.jsx)(`span`,{style:{color:`#ef4444`},children:`*`})]}),(0,$.jsx)(qse,{value:_,onChange:e=>v(e.target.value),placeholder:`请输入产品卖点`,style:{borderRadius:8,border:`1px solid rgba(99, 102, 241, 0.2)`},maxLength:100,showCount:!0,rows:3})]}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:12,marginTop:8},children:(0,$.jsx)(X,{type:`primary`,onClick:ne,loading:O,disabled:O,style:{flex:1,height:48,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,fontWeight:600,fontSize:15,border:`none`,boxShadow:`0 4px 15px rgba(99, 102, 241, 0.3)`,transition:`all 0.2s ease`},onMouseEnter:e=>{e.currentTarget.style.boxShadow=`0 6px 20px rgba(99, 102, 241, 0.4)`,e.currentTarget.style.transform=`translateY(-1px)`},onMouseLeave:e=>{e.currentTarget.style.boxShadow=`0 4px 15px rgba(99, 102, 241, 0.3)`,e.currentTarget.style.transform=`translateY(0)`},children:O?`生成中...`:`手动生成`})})]})}),(0,$.jsx)(mK,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`},children:`视频预览`})]}),open:f,onCancel:()=>p(!1),afterClose:()=>{m.current&&(m.current.pause(),m.current.currentTime=0)},footer:null,width:640,centered:!0,styles:{body:{padding:24},header:{borderBottom:`1px solid #e0e0e0`,padding:`20px 24px`}},children:(0,$.jsx)(`div`,{style:{borderRadius:12,overflow:`hidden`},children:(0,$.jsx)(`video`,{ref:m,controls:!0,src:u||``,style:{width:`100%`,maxHeight:420,objectFit:`contain`,backgroundColor:`#000`},playsInline:!0,"webkit-playsinline":`true`,autoPlay:!0})})})]})}var{Title:Xse,Text:J9}=Q,{TextArea:Zse}=IW;function Qse(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}var Y9=e=>e?/^https?:\/\//i.test(e)?e:`${`http://ceshi.apiforeign.minzhong.cn`.replace(/\/$/,``)}${e.startsWith(`/`)?``:`/`}${e}`:``;function X9(){let e=Ye(),{creatID:t}=$e(),{user:n}=_7(),[r,i]=(0,S.useState)(!1),[a,o]=(0,S.useState)([]),[s,c]=(0,S.useState)(0),[l,u]=(0,S.useState)(``),[d,f]=(0,S.useState)(!1),[p,m]=(0,S.useState)(`image`),[h,g]=(0,S.useState)({}),[_,v]=(0,S.useState)(null),[y,b]=(0,S.useState)(null),[x,C]=(0,S.useState)(``),[w,T]=(0,S.useState)(!1),[E,D]=(0,S.useState)({}),[O,k]=(0,S.useState)(``),[A,j]=(0,S.useState)(``),[M,N]=(0,S.useState)(!1),[P,F]=(0,S.useState)(!1),[I,L]=(0,S.useState)(5),[R,z]=(0,S.useState)(`16:9`),[B,V]=(0,S.useState)(`480p`),[H,U]=(0,S.useState)({ratios:[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:[`480p`,`720p`,`1080p`],durations:[5,8,10,12,15]}),[W,ee]=(0,S.useState)([]),[te,G]=(0,S.useState)(1),[ne,re]=(0,S.useState)(20),[ie,ae]=(0,S.useState)(0),[oe,K]=(0,S.useState)(``),[q,se]=(0,S.useState)({}),[ce,le]=(0,S.useState)([]),[ue,de]=(0,S.useState)([]),[fe,pe]=(0,S.useState)(!1),[me,he]=(0,S.useState)(``),[ge,_e]=(0,S.useState)(`image`),ve=S.useRef(null);(0,S.useEffect)(()=>{if(fe&&ge===`video`){let e=()=>{ve.current&&ve.current.play().catch(()=>{})};ve.current&&(ve.current.readyState>=2?e():ve.current.addEventListener(`loadedmetadata`,e));let t=setTimeout(e,300);return()=>{clearTimeout(t),ve.current&&(ve.current.removeEventListener(`loadedmetadata`,e),ve.current.pause())}}else ve.current&&ve.current.pause()},[fe,ge]);let ye=[{id:1,title:`原始素材`,description:`上传原始视频素材`,childId:1},{id:2,title:`生成提示词`,description:`根据素材生成描述词`,childId:2},{id:3,title:`生成产品融合图`,description:`生成产品与场景融合图`,childId:3},{id:4,title:`生成视频提示词`,description:`生成视频生成提示词`,childId:4},{id:5,title:`生成最终视频`,description:`合成最终视频`,childId:5}].map((e,t)=>({...e,status:ce[t]?.status||``,id:ce[t]?.id||t,output:ce[t]?.output||``,engineId:ce[t]?.input?.payload?.videoConfig?.engineId||``}));(0,S.useEffect)(()=>{let e=new Set;ue.forEach(t=>{let n=ye.find(e=>String(e.childId)===t);n&&(n.status===`completed`||n.status===`failed`)&&e.add(t)});for(let t=ye.length-1;t>=0;t--)if(ye[t].status===`completed`||ye[t].status===`failed`){e.add(String(ye[t].childId));break}e.size>0?de(Array.from(e)):de([])},[ce]);let be=(e,t,n)=>{Q5(e,t,n).then(e=>{e.items&&ee(e.items),e.total!==void 0&&ae(e.total)}).catch(e=>{})},xe=(e,t)=>{G(e),re(t),be(e,t,oe)},Se=()=>{be(1,20,oe)};(0,S.useEffect)(()=>{be(te,ne,oe)},[]),(0,S.useEffect)(()=>{z5().then(e=>{let t=(e.engine?.video||[]).filter(e=>e.supportsUniversalReference!==!1),n=(e.engine?.image||[]).filter(e=>e.supportsUniversalReference!==!1);if(D({video:t,image:n}),t.length>0){k(t[0].id);let e=t[0];U({ratios:e.supportedRatios||[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:e.supportedResolutions||[`480p`,`720p`,`1080p`],durations:e.supportedDurations||[5,8,10,12,15]})}n.length>0&&j(n[0].id)}).catch(e=>{})},[]),(0,S.useEffect)(()=>()=>{y&&(clearInterval(y),b(null))},[y]),(0,S.useEffect)(()=>{let e=e=>{let t=e.target;!t.closest(`.image-settings-trigger`)&&!t.closest(`.image-settings-popover`)&&(N(!1),F(!1))};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,S.useEffect)(()=>{t&&t7(t).then(e=>{se(e),e.steps&&le(e.steps)}).catch(e=>{})},[t]),(0,S.useEffect)(()=>{let e=ye[4];e&&e.status!==`completed`&&e.status!==`failed`?y||b(setInterval(Ee,3e4)):e&&y&&(clearInterval(y),b(null))},[ye]),(0,S.useEffect)(()=>{H5().then(e=>{o(e)}).catch(()=>{})},[]);let Ce=()=>{let e={};e=a.find(e=>e.modelConfigId===O&&e.genType===`video`&&e.resolution===B),e||={perSecondCredits:2,baseCredits:60,ratio:1.3,inputVideoRatio:1.3,inputVideoBaseCredits:0,inputVideoPerSecondCredits:15,inputImageRatio:1,inputImageBaseCredits:0,inputImagePerImageCredits:0};let t=(I*e.perSecondCredits+e.baseCredits)*e.ratio,n=q?.videoGeneration?.inputMedia?.video?.duration||0;if(n>0){let r=((e.inputVideoBaseCredits||0)+(e.inputVideoPerSecondCredits||0)*n)*(e.inputVideoRatio||1);t+=r}let r=q?.videoGeneration?.inputMedia?.image?.length||0;if(r>0){let n=((e.inputImageBaseCredits||0)+(e.inputImagePerImageCredits||0)*r)*(e.inputImageRatio||1);t+=n}c(Number(t.toFixed(2)))};(0,S.useEffect)(()=>{a.length>0&&O&&Ce()},[a,O,I,B,q]);let we=(e,t,n,r)=>{m(t||`image`),C(n?String(n):``),t===`video`?(v(r||null),g(e&&typeof e==`object`?Qse(e):{}),u(``)):(v(null),u(e||``),g({})),i(!0)},Te=async()=>{if(p===`image`){if(!q?.id||!x){Z.warning(`缺少任务或步骤 ID,无法保存图片提示词`);return}if(!l||!l.trim()){Z.warning(`图片提示词不能为空`);return}T(!0);try{await aae(q.id,x,{prompt:l.trim()}),Z.success(`图片提示词已保存`),De(),i(!1),C(``)}catch(e){Z.error(e?.message||`保存图片提示词失败`)}finally{T(!1)}return}if(!q?.id||!x){Z.warning(`缺少任务或步骤 ID,无法保存视频提示词`);return}if(!h||typeof h!=`object`||Object.keys(h).length===0){Z.warning(`视频提示词不能为空`);return}if(!_){Z.warning(`视频提词配置缺失,暂不能保存`);return}let e=y9(h,_);if(e){Z.warning(e);return}T(!0);try{await oae(q.id,x,{prompt_schema:h}),Z.success(`视频提示词已保存`),De(),i(!1),C(``)}catch(e){Z.error(e?.message||`保存视频提示词失败`)}finally{T(!1)}},Ee=()=>{t&&t7(t).then(e=>{se(e),e.steps&&le(e.steps)}).catch(e=>{})},De=()=>{t&&t7(t).then(e=>{se(e),e.steps&&le(e.steps)}).catch(e=>{})},Oe=(e,t)=>{he(e),_e(t),pe(!0)},ke=()=>{pe(!1),he(``),ve.current&&ve.current.pause()},Ae=e=>{if(e.preventDefault(),e.stopPropagation(),!me)return;let t=document.createElement(`a`);t.href=`http://ceshi.apiforeign.minzhong.cn${me}&download=1`,t.download=ge===`image`?`image.png`:`video.mp4`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},je=e=>{iae(q.id,e.toString()).then(e=>{Z.info(`正在生成图片提示词,请稍候...`),De()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Z.error(t)})},Me=e=>{let t={engine_id:A,image_proportion:`1:1`,image_px:`2048x2048`,image_size:`2K`};n7(q.id,e.toString(),t).then(e=>{Z.info(`正在生成图片,请稍候...`),De()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Z.error(t)})},Ne=()=>{let e={engine_id:A,image_proportion:`1:1`,image_px:`2048x2048`,image_size:`2K`};n7(q.id,ye[1].id.toString(),e).then(e=>{Z.info(`正在生成图片,请稍候...`),De()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Z.error(t)})},Pe=e=>{let t={engine_id:O,duration:I,aspect_ratio:R,resolution:B,target_platform:`抖音`};sae(q.id,e.toString(),t).then(e=>{Z.info(`正在生成视频提示词,请稍候...`),De()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Z.error(t)})},Fe=(e,t)=>{r7(q.id,e.toString(),{engine_id:``}).then(e=>{Z.info(`正在生成视频,请稍候...`),De()}).catch(e=>{let t=e?.message?.split(`: `)?.[1]||e?.message||`生成失败`;Z.error(t)})},Ie=()=>{r7(q.id,ye[3].id.toString(),{engine_id:``}).then(e=>{De()}).catch(e=>{})};return(0,$.jsxs)(S.Fragment,{children:[(0,$.jsxs)(`div`,{className:`initialinfo-container`,style:{margin:`-24px -32px -32px`,height:`calc(100vh - 34px)`,position:`relative`,boxSizing:`border-box`,overflow:`hidden`,display:`flex`,flexDirection:`column`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:-100,right:-100,width:300,height:300,background:`radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%)`,borderRadius:`50%`,pointerEvents:`none`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,bottom:-100,left:-100,width:300,height:300,background:`radial-gradient(circle, rgba(167,139,250,0.08) 0%, transparent 70%)`,borderRadius:`50%`,pointerEvents:`none`}}),(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,justifyContent:`space-between`,alignItems:`stretch`,gap:`2%`,position:`relative`,zIndex:1,minHeight:0},children:[(0,$.jsxs)(`div`,{className:`replication-preview`,style:{flex:4,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(20px)`,borderRadius:20,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`,display:`flex`,flexDirection:`column`,minHeight:0},children:[(0,$.jsxs)(`div`,{style:{borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`16px 24px`,background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,boxSizing:`border-box`},children:[(0,$.jsx)(X,{icon:(0,$.jsx)(b2,{}),onClick:()=>window.history.back(),style:{borderRadius:10,fontSize:13,height:32,background:`rgba(99, 102, 241, 0.1)`,border:`1px solid rgba(99, 102, 241, 0.2)`,color:`#6366f1`},children:`返回`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #6366f1, #8b5cf6, transparent)`,borderRadius:1}}),(0,$.jsx)(`h3`,{style:{margin:0,fontSize:16,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`拆镜复刻 - 任务详情`}),(0,$.jsx)(`div`,{style:{width:32,height:2,background:`linear-gradient(90deg, transparent, #8b5cf6, #6366f1, transparent)`,borderRadius:1}})]}),(0,$.jsx)(X,{type:`primary`,ghost:!0,style:{borderRadius:10,padding:`4px 16px`,fontSize:13,background:`rgba(99, 102, 241, 0.1)`,borderColor:`rgba(99, 102, 241, 0.2)`,color:`#6366f1`},onClick:()=>f(!0),children:`创作记录`})]}),(0,$.jsx)(`div`,{style:{flex:1,overflowY:`auto`},children:(0,$.jsxs)(`div`,{className:`material_box`,children:[(0,$.jsxs)(`div`,{style:{display:`flex`,gap:24,flexWrap:`wrap`,alignItems:`flex-start`},children:[(0,$.jsxs)(`div`,{style:{flex:1,minWidth:250},children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`视频`]}),(0,$.jsx)(`div`,{className:`medio_box`,style:{aspectRatio:`16/9`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`,cursor:q?.material?.materialVideoUrl?`pointer`:`default`},onClick:()=>q?.material?.materialVideoUrl&&Oe(q.material.materialVideoUrl,`video`),children:q?.material?.materialVideoUrl?(0,$.jsx)(`video`,{src:Y9(q.material.materialVideoUrl),style:{width:`100%`,height:`100%`,objectFit:`contain`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:13},children:`暂无视频`})})]}),(0,$.jsxs)(`div`,{className:`product_img`,style:{flex:1,minWidth:250},children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`产品图片`]}),(0,$.jsx)(`div`,{className:`medio_box`,style:{aspectRatio:`1/1`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`,cursor:q?.material?.materialImageUrl?`pointer`:`default`},onClick:()=>q?.material?.materialImageUrl&&Oe(q.material.materialImageUrl,`image`),children:q?.material?.materialImageUrl?(0,$.jsx)(`img`,{src:Y9(q.material.materialImageUrl),alt:``,style:{width:`100%`,height:`100%`,objectFit:`contain`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:13},children:`暂无图片`})})]})]}),q?.finalImageUrl&&(0,$.jsx)(`div`,{style:{marginTop:24},children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`生成图片`]}),(0,$.jsx)(`div`,{className:`medio_box`,style:{aspectRatio:`1/1`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`,cursor:`pointer`},onClick:()=>Oe(q.finalImageUrl,`image`),children:(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn${q.finalImageUrl}`,alt:``,style:{width:`100%`,height:`100%`,objectFit:`contain`}})})]})}),q?.finalVideoUrl&&(0,$.jsx)(`div`,{style:{marginTop:24},children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`span`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:10,display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{width:3,height:14,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,display:`inline-block`}}),`生成视频`]}),(0,$.jsx)(`div`,{className:`medio_box`,style:{aspectRatio:`16/9`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,borderRadius:14,overflow:`hidden`,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.06)`,border:`1px solid rgba(99, 102, 241, 0.08)`,cursor:`pointer`},onClick:()=>Oe(q.finalVideoUrl,`video`),children:(0,$.jsx)(`video`,{src:`http://ceshi.apiforeign.minzhong.cn${q.finalVideoUrl}`,style:{width:`100%`,height:`100%`,objectFit:`contain`}})})]})})]})})]}),(0,$.jsxs)(`div`,{className:`replication-form`,style:{flex:1,minWidth:`450px`,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(20px)`,borderRadius:20,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`,display:`flex`,flexDirection:`column`,minHeight:0},children:[(0,$.jsxs)(`div`,{style:{padding:`16px 24px`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,display:`flex`,alignItems:`center`,gap:10,background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`},children:[(0,$.jsx)(`div`,{style:{width:4,height:18,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:15,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`生成步骤`})]}),(0,$.jsx)(`div`,{style:{flex:1,overflowY:`auto`,padding:`8px 16px 16px`},children:(0,$.jsx)($g,{activeKey:ue,onChange:de,ghost:!0,bordered:!1,style:{background:`transparent`},expandIconPlacement:`end`,items:ye.map(e=>({key:String(e.childId),label:(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,width:`100%`,justifyContent:`space-between`},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:16,height:16},children:e.status===`completed`?(0,$.jsx)(d4,{style:{fontSize:16,color:`#22c55e`}}):e.status===`processing`?(0,$.jsx)(`div`,{style:{width:16,height:16,borderRadius:`50%`,border:`2px solid #e2e8f0`,borderTopColor:`#6366f1`,animation:`spinSlow 1s linear infinite`}}):e.status===`failed`?(0,$.jsx)(`div`,{style:{width:16,height:16,borderRadius:`50%`,background:`#ef4444`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`span`,{style:{color:`#fff`,fontSize:10},children:`×`})}):(0,$.jsx)(`div`,{style:{width:8,height:8,borderRadius:`50%`,background:`#cbd5e1`}})}),(0,$.jsx)(`span`,{style:{fontSize:14,color:e.status===`processing`||e.status===`waiting_user`?`#6366f1`:`#1e293b`,fontWeight:500},children:e.title}),(e.status===`processing`||e.status===`waiting_user`)&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#6366f1`,marginLeft:8},children:`生成中`}),e.status===`failed`&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#ef4444`,marginLeft:8},children:`失败`}),e.status===``&&(0,$.jsx)(`span`,{style:{fontSize:12,color:`#717d8b`,marginLeft:8},children:`待生成`})]})}),children:(0,$.jsxs)(`div`,{style:{padding:`16px`,background:`linear-gradient(135deg, rgba(248,250,252,0.6) 0%, rgba(238,242,255,0.4) 100%)`,borderRadius:12,marginTop:8,border:`1px solid rgba(99, 102, 241, 0.06)`},children:[e.childId===1&&(0,$.jsx)($.Fragment,{children:(0,$.jsxs)(`div`,{style:{display:`flex`,gap:20,marginBottom:20,alignItems:`flex-start`,flexWrap:`wrap`},children:[(0,$.jsxs)(`div`,{style:{flex:1,minWidth:200},children:[(0,$.jsx)(J9,{style:{color:`#64748b`,fontSize:13,marginBottom:10,display:`block`,fontWeight:500},children:`原视频`}),(0,$.jsx)(`div`,{style:{height:180,borderRadius:12,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,border:`1px solid rgba(99, 102, 241, 0.06)`},children:q?.material?.materialVideoUrl?(0,$.jsx)(`video`,{src:Y9(q.material.materialVideoUrl),style:{maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`,borderRadius:10},controls:!0}):(0,$.jsxs)(`div`,{style:{textAlign:`center`,color:`#94a3b8`},children:[(0,$.jsxs)(`svg`,{width:`32`,height:`32`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,style:{marginBottom:8},children:[(0,$.jsx)(`rect`,{x:`2`,y:`2`,width:`20`,height:`16`,rx:`2`,ry:`2`}),(0,$.jsx)(`path`,{d:`M8 12l4 2 4-2`})]}),(0,$.jsx)(`div`,{style:{fontSize:13},children:`暂无视频`})]})})]}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:200},children:[(0,$.jsx)(J9,{style:{color:`#64748b`,fontSize:13,marginBottom:10,display:`block`,fontWeight:500},children:`产品图片`}),(0,$.jsx)(`div`,{style:{height:180,borderRadius:12,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,border:`1px solid rgba(99, 102, 241, 0.06)`},children:q?.material?.materialImageUrl?(0,$.jsx)(`img`,{src:Y9(q.material.materialImageUrl),alt:`产品图片`,style:{maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`,borderRadius:10}}):(0,$.jsxs)(`div`,{style:{textAlign:`center`,color:`#94a3b8`},children:[(0,$.jsxs)(`svg`,{width:`32`,height:`32`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,style:{marginBottom:8},children:[(0,$.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,ry:`2`}),(0,$.jsx)(`circle`,{cx:`8.5`,cy:`8.5`,r:`1.5`,fill:`currentColor`}),(0,$.jsx)(`path`,{d:`M21 15l-5-5L5 21`})]}),(0,$.jsx)(`div`,{style:{fontSize:13},children:`暂无图片`})]})})]}),(0,$.jsx)(X,{onClick:()=>{je(e.id)},type:`primary`,style:{flex:1,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,height:36,fontWeight:500,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},disabled:e.status!==`completed`,children:`下一步:生成图片提示词`})]})}),e.childId===2&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{padding:`12px 14px`,background:`rgba(255,255,255,0.6)`,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.08)`,marginBottom:4},children:(0,$.jsx)(J9,{style:{color:`#475569`,fontSize:13,lineHeight:1.8,whiteSpace:`pre-wrap`},children:e?.output?.payload?.prompt||`暂无提示词`})}),(0,$.jsxs)(sH,{style:{marginTop:16,gap:12,width:`100%`},children:[(0,$.jsx)(X,{type:`default`,icon:(0,$.jsx)(M$,{}),onClick:()=>we(e?.output?.payload?.prompt,`image`,e.id),style:{flex:1,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500,background:`rgba(99, 102, 241, 0.04)`},disabled:e.status!==`completed`,children:`修改提示词`}),(0,$.jsx)(X,{onClick:()=>{Me(e.id)},type:`primary`,style:{flex:1,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,height:36,fontWeight:500,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},disabled:e.status!==`completed`,children:`下一步:生成图片`})]})]}),e.childId===3&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{style:{borderRadius:12,overflow:`hidden`,marginBottom:16,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,border:`1px solid rgba(99, 102, 241, 0.08)`,boxShadow:`0 2px 8px rgba(99, 102, 241, 0.04)`,position:`relative`},children:[q.finalImageUrl?(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn${q.finalImageUrl}`,alt:`融合图`,style:{width:`100%`,height:180,objectFit:`cover`}}):(0,$.jsx)(`div`,{style:{width:`100%`,height:180,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:14},children:`暂无融合图`}),(0,$.jsx)(X,{type:`default`,icon:(0,$.jsx)(M$,{}),onClick:()=>Ne(),disabled:e.status!==`completed`,style:{position:`absolute`,bottom:8,left:8,borderRadius:8,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:30,fontWeight:500,background:`rgba(255,255,255,0.85)`,backdropFilter:`blur(4px)`,padding:`0 12px`,fontSize:12},children:`重新生成`})]}),(0,$.jsx)(`p`,{style:{marginBottom:6,fontSize:14,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:`视频参数选择:`}),(0,$.jsxs)(`div`,{style:{width:`100%`,display:`flex`,justifyContent:`space-between`,marginBottom:16},children:[(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>{N(!M),F(!1)},className:`image-settings-trigger`,style:{width:`100%`,padding:`4px 12px`,height:34,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,backgroundColor:`rgba(255,255,255,0.7)`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(C8,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsx)(J9,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:E.video?.find(e=>e.id===O)?.name||`选择引擎`})]}),M&&(0,$.jsx)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:-10,width:350,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:16,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:(0,$.jsxs)(`div`,{style:{marginBottom:8},children:[(0,$.jsx)(J9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择引擎`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:E.video?.map(e=>(0,$.jsxs)(`button`,{onClick:()=>{k(e.id),U({ratios:e.supportedRatios||[`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`],resolutions:e.supportedResolutions||[`480p`,`720p`,`1080p`],durations:e.supportedDurations||[5,8,10,12,15]}),e.supportedRatios?.includes(R)||z(e.supportedRatios?.[0]||`16:9`),e.supportedResolutions?.includes(B)||V(e.supportedResolutions?.[0]||`720p`),e.supportedDurations?.includes(I)||L(e.supportedDurations?.[0]||5),N(!1)},style:{flex:1,minHeight:48,borderRadius:8,border:O===e.id?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:O===e.id?`#fff`:`#f9fafb`,cursor:`pointer`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`flex-start`,padding:`8px 12px`,transition:`all 0.2s`,textAlign:`left`},children:[(0,$.jsx)(`span`,{style:{fontSize:13,fontWeight:O===e.id?600:500,color:O===e.id?`#6366f1`:`#4b5563`,marginBottom:2},children:e.name}),(0,$.jsx)(`span`,{style:{fontSize:11,color:`#9ca3af`}})]},e.id))})]})})]}),(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,display:`inline-block`},children:[(0,$.jsxs)(`button`,{onClick:()=>{F(!P),N(!1)},className:`image-settings-trigger`,style:{width:`100%`,padding:`4px 12px`,height:34,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,backgroundColor:`rgba(255,255,255,0.7)`,cursor:`pointer`,display:`inline-flex`,alignItems:`center`,gap:6,transition:`all 0.2s`},children:[(0,$.jsx)(V3,{style:{fontSize:14,color:`#6366f1`}}),(0,$.jsxs)(J9,{style:{fontSize:14,fontWeight:500,color:`#64748b`},children:[R,` · `,I,`s · `,B]})]}),P&&(0,$.jsxs)(`div`,{className:`image-settings-popover`,style:{position:`absolute`,bottom:`calc(100% + 8px)`,left:-160,width:350,backgroundColor:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.15)`,padding:16,border:`none`,zIndex:9999},onClick:e=>e.stopPropagation(),children:[(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(J9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择比例`}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:4},children:H.ratios.map(e=>(0,$.jsxs)(`button`,{onClick:()=>z(e),style:{flex:`0 0 calc(14.28% - 4px)`,minWidth:44,height:52,borderRadius:6,border:R===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:R===e?`#fff`:`#f9fafb`,cursor:`pointer`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:[(0,$.jsx)(`div`,{style:{width:18,height:18,border:`2px solid ${R===e?`#6366f1`:`#9ca3af`}`,borderRadius:2,marginBottom:2}}),(0,$.jsx)(`span`,{style:{fontSize:9,color:R===e?`#6366f1`:`#6b7280`,fontWeight:R===e?600:400},children:e})]},e))})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(J9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择时长`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsxs)(`div`,{style:{flex:1,position:`relative`,height:24,display:`flex`,alignItems:`center`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,top:`50%`,left:0,right:0,height:6,borderRadius:3,background:`#e5e7eb`,transform:`translateY(-50%)`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:`50%`,left:0,height:6,borderRadius:3,background:`#6366f1`,width:`${(I-Math.min(...H.durations))/(Math.max(...H.durations)-Math.min(...H.durations))*100}%`,transform:`translateY(-50%)`}}),(0,$.jsx)(`input`,{type:`range`,min:Math.min(...H.durations),max:Math.max(...H.durations),value:I,onChange:e=>L(Number(e.target.value)),style:{position:`relative`,width:`100%`,height:24,borderRadius:3,background:`transparent`,outline:`none`,appearance:`none`,cursor:`pointer`,zIndex:1}})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4,padding:`4px 12px`,backgroundColor:`#f1f5f9`,borderRadius:6},children:[(0,$.jsx)(`span`,{style:{fontSize:14,fontWeight:600,color:`#64748b`},children:I}),(0,$.jsx)(`span`,{style:{fontSize:12,color:`#9ca3af`},children:`秒`})]})]})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(J9,{style:{display:`block`,marginBottom:8,fontSize:12,fontWeight:500,color:`#666666`},children:`选择分辨率`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:6},children:H.resolutions.map(e=>(0,$.jsx)(`button`,{onClick:()=>V(e),style:{flex:1,height:42,borderRadius:6,border:B===e?`2px solid #6366f1`:`1px solid #e5e7eb`,backgroundColor:B===e?`#6366f1`:`#f9fafb`,cursor:`pointer`,display:`flex`,justifyContent:`center`,alignItems:`center`,transition:`all 0.2s`},children:(0,$.jsx)(`span`,{style:{fontSize:12,fontWeight:600,color:B===e?`#fff`:`#4b5563`},children:e})},e))})]})]})]})]}),(0,$.jsx)(gw,{title:(n?.credits||0){if((n?.credits||0)we(q?.videoGeneration?.promptSchema,`video`,e.id,q?.videoGeneration?.schemaConfigSnapshot),style:{flex:1,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500,background:`rgba(99, 102, 241, 0.04)`},disabled:e.status!==`completed`||!q?.videoGeneration?.promptSchema||!q?.videoGeneration?.schemaConfigSnapshot,children:`查看/修改视频提词`}),(0,$.jsx)(X,{onClick:()=>{Fe(e.id,e.engineId)},type:`primary`,style:{flex:1,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,height:36,fontWeight:500,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},disabled:e.status!==`completed`,children:`下一步:生成视频`})]})]}),e.childId===5&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{borderRadius:12,overflow:`hidden`,marginBottom:16,position:`relative`,background:`linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)`,border:`1px solid rgba(99, 102, 241, 0.08)`,boxShadow:`0 2px 8px rgba(99, 102, 241, 0.04)`},children:e.status===`completed`&&q?.finalVideoUrl?(0,$.jsx)(`video`,{src:`http://ceshi.apiforeign.minzhong.cn${q.finalVideoUrl}`,style:{width:`100%`,height:180,objectFit:`cover`},controls:!0}):e.status===`processing`?(0,$.jsxs)(`div`,{style:{width:`100%`,height:180,display:`flex`,alignItems:`center`,justifyContent:`center`,flexDirection:`column`,gap:8},children:[(0,$.jsx)(`div`,{style:{width:20,height:20,borderRadius:`50%`,border:`2px solid #e2e8f0`,borderTopColor:`#6366f1`,animation:`spinSlow 1s linear infinite`}}),(0,$.jsx)(`span`,{style:{color:`#6366f1`,fontSize:14},children:`视频生成中...`})]}):e.status===`failed`?(0,$.jsx)(`div`,{style:{width:`100%`,height:180,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#ef4444`,fontSize:14},children:`视频生成失败`}):(0,$.jsx)(`div`,{style:{width:`100%`,height:180,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#94a3b8`,fontSize:14},children:`暂无视频`})}),(0,$.jsxs)(sH,{style:{width:`100%`,gap:12},children:[(0,$.jsx)(X,{onClick:()=>Ie(),type:`default`,icon:(0,$.jsx)(M$,{}),style:{flex:1,borderRadius:10,borderColor:`rgba(99, 102, 241, 0.3)`,color:`#6366f1`,height:36,fontWeight:500,background:`rgba(99, 102, 241, 0.04)`},disabled:e.status!==`completed`,children:`重新生成`}),(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(m0,{}),style:{flex:1,borderRadius:10,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,height:36,fontWeight:500,boxShadow:`0 4px 12px rgba(99, 102, 241, 0.3)`},disabled:e.status!==`completed`,onClick:()=>{let e=`http://ceshi.apiforeign.minzhong.cn${q?.finalVideoUrl}&download=1`,t=document.createElement(`a`);t.href=e,t.download=`video_${Date.now()}.mp4`,document.body.appendChild(t),t.click(),document.body.removeChild(t)},children:`下载视频`})]})]})]})}))})})]})]})]}),(0,$.jsx)(mK,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,$.jsx)(`div`,{style:{width:4,height:18,background:`linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:15,fontWeight:700,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},children:p===`video`?`查看/编辑视频提词`:`修改提示词`})]}),open:r,onCancel:()=>{w||i(!1)},footer:[(0,$.jsx)(X,{onClick:()=>i(!1),disabled:w,style:{borderRadius:8},children:`取消`},`cancel`),(0,$.jsx)(X,{type:`primary`,onClick:Te,loading:w,disabled:w,style:{borderRadius:8,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`确认`},`confirm`)],width:800,style:{borderRadius:16},styles:{header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(99, 102, 241, 0.08)`,padding:`16px 24px`},body:{background:`linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #f0f9ff 100%)`,padding:`20px 24px`}},children:p===`image`?(0,$.jsx)(Zse,{value:l,onChange:e=>u(e.target.value),rows:8,style:{width:`100%`,height:300,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.15)`,background:`rgba(255,255,255,0.8)`},placeholder:`请输入提示词`}):(0,$.jsx)(`div`,{style:{maxHeight:500,overflowY:`auto`,paddingRight:10},children:(0,$.jsx)(E9,{value:h,schemaConfigSnapshot:_,onChange:g})})}),(0,$.jsxs)(mK,{title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:600,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`},children:`创作记录`})]}),open:d,onCancel:()=>f(!1),width:800,footer:null,styles:{body:{background:`linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%)`},header:{background:`#fff`,borderBottom:`1px solid rgba(99, 102, 241, 0.1)`,padding:`20px 24px`}},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,marginBottom:16,gap:8},children:[(0,$.jsx)(IW,{placeholder:`搜索产品名称`,value:oe,onChange:e=>K(e.target.value),onPressEnter:Se,style:{width:200,borderRadius:10,border:`1px solid rgba(99, 102, 241, 0.2)`,height:40}}),(0,$.jsx)(X,{type:`primary`,onClick:Se,style:{borderRadius:10,height:40,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`},children:`搜索`})]}),(0,$.jsx)(`div`,{style:{background:`linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%)`,backdropFilter:`blur(20px)`,borderRadius:16,overflow:`hidden`,border:`1px solid rgba(99, 102, 241, 0.1)`,boxShadow:`0 8px 32px rgba(99, 102, 241, 0.08)`},children:(0,$.jsx)(LQ,{columns:[{title:`产品名称`,dataIndex:`title`,key:`title`,render:e=>(0,$.jsx)(`span`,{style:{fontSize:14,color:`#1e293b`,fontWeight:500},children:e})},{title:`创建时间`,dataIndex:`createdAt`,key:`createdAt`,render:e=>{if(!e)return`-`;let t=new Date(e);return(0,$.jsx)(`span`,{style:{fontSize:13,color:`#64748b`},children:`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)} ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}`})}},{title:`操作`,key:`action`,align:`center`,render:t=>(0,$.jsx)(X,{type:`text`,onClick:()=>e(`/removelens/${t.id}/removeinfo`),style:{color:`#6366f1`,fontSize:13,padding:`4px 12px`,borderRadius:6,background:`rgba(99, 102, 241, 0.1)`},onMouseEnter:e=>{e.currentTarget.style.background=`rgba(99, 102, 241, 0.15)`},onMouseLeave:e=>{e.currentTarget.style.background=`rgba(99, 102, 241, 0.1)`},children:`查看详情`})}],dataSource:W,rowKey:`id`,pagination:{current:te,pageSize:ne,total:ie,showSizeChanger:!0,showQuickJumper:!0,showTotal:e=>`共 ${e} 条`,onChange:xe,style:{padding:`16px 24px`,borderTop:`1px solid rgba(99, 102, 241, 0.1)`}},style:{fontSize:13},scroll:{y:350},components:{body:{row:({className:e,style:t,...n})=>(0,$.jsx)(`tr`,{...n,className:e,style:{...t,transition:`all 0.2s ease`,borderBottom:`1px solid rgba(99, 102, 241, 0.05)`}}),cell:({className:e,style:t,...n})=>(0,$.jsx)(`td`,{...n,className:e,style:{...t,padding:`16px 24px`}})},header:{cell:({className:e,style:t,...n})=>(0,$.jsx)(`th`,{...n,className:e,style:{...t,background:`rgba(99, 102, 241, 0.03)`,color:`#64748b`,fontWeight:500,fontSize:13,padding:`16px 24px`,borderBottom:`none`}})}}})})]}),(0,$.jsx)(mK,{open:fe,title:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,$.jsx)(`div`,{style:{width:4,height:20,background:`linear-gradient(180deg, #8b5cf6 0%, #ddd6fe 100%)`,borderRadius:2}}),(0,$.jsx)(`span`,{style:{fontSize:16,fontWeight:700,color:`#8b5cf6`,letterSpacing:.4},children:`预览`})]}),onCancel:ke,width:800,footer:(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:12,padding:`16px 24px`,background:`rgba(255,255,255,0.6)`,borderTop:`1px solid rgba(139, 92, 246, 0.08)`},children:(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(m0,{}),onClick:Ae,style:{borderRadius:10,background:`linear-gradient(135deg, #8b5cf6 0%, #ddd6fe 100%)`,border:`none`,boxShadow:`0 8px 18px rgba(47, 52, 64, 0.15)`},children:`下载`})}),centered:!0,style:{borderRadius:16},styles:{body:{display:`flex`,alignItems:`center`,justifyContent:`center`,minHeight:`400px`},header:{background:`rgba(255,255,255,0.6)`,backdropFilter:`blur(10px)`,borderBottom:`1px solid rgba(139, 92, 246, 0.08)`,padding:`16px 24px`}},children:(0,$.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:`100%`,height:`100%`},children:ge===`image`?(0,$.jsx)(`img`,{src:me.startsWith(`http`)?me:`http://ceshi.apiforeign.minzhong.cn${me}`,alt:`预览`,style:{width:`100%`,maxHeight:`400px`,objectFit:`contain`}}):(0,$.jsx)(`video`,{ref:ve,src:me.startsWith(`http`)?me:`http://ceshi.apiforeign.minzhong.cn${me}`,controls:!0,style:{maxWidth:`100%`,maxHeight:`400px`}})})})]})}var $se=({asset:e,index:t,onPreview:n})=>{let[r,i]=(0,S.useState)(!1);return(0,$.jsx)(`div`,{className:`project-card`,onClick:()=>n(e),onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),style:{borderRadius:12,overflow:`hidden`,cursor:`pointer`,flexShrink:0,width:`18%`,position:`relative`},children:(0,$.jsx)(`div`,{style:{position:`relative`,aspectRatio:`9/16`},children:e.mediaType===`video`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`video`,{src:`http://ceshi.apiforeign.minzhong.cn${e.url}`,style:{width:`100%`,height:`100%`,objectFit:`cover`},muted:!0,playsInline:!0}),(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(`div`,{style:{width:40,height:40,borderRadius:`50%`,background:`rgba(0,0,0,0.5)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(q6,{style:{fontSize:24,color:`#fff`}})})})]}):(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn${e.url}`,alt:e.title||`素材 ${t+1}`,style:{width:`100%`,height:`100%`,objectFit:`cover`}})})})};function ece(e){if(!e)return`-`;let t=String(e).trim();t.includes(`T`)||(t=t.replace(` `,`T`));let n=t.indexOf(`.`);n>0&&(t=t.slice(0,n)),t=t.replace(/[+-]\d{2}:?\d{0,2}$/,``).replace(/Z$/,``);let[r=``,i=``]=t.split(`T`),[,a=``,o=``]=r.split(`-`),s=i.slice(0,5);return!a||!o?`-`:`${a}-${o} ${s}`}var tce=()=>{let e=Ye(),[t,n]=(0,S.useState)(`project`),[r,i]=(0,S.useState)(``),[a,o]=(0,S.useState)([]),[s,c]=(0,S.useState)([]),[l,u]=(0,S.useState)(``),[d,f]=(0,S.useState)([]),[p,m]=(0,S.useState)(null),[h,g]=(0,S.useState)(``),_=(0,S.useRef)(null),v=(0,S.useRef)(``),[y,b]=(0,S.useState)(`cases`),[x,C]=(0,S.useState)(null),[w,T]=(0,S.useState)(null),E=(0,S.useRef)(null);(0,S.useEffect)(()=>{Tae().then(e=>{if(e?.items?.length>0){c(e.items);let t=e.items[0].id;u(t),c7(t).then(e=>{e?.categories?.[0]?.assets&&f(e.categories[0].assets)})}})},[]),(0,S.useEffect)(()=>()=>{E.current&&=(E.current.pause(),null),T(null),C(null),document.querySelectorAll(`.preview-video-item`).forEach(e=>{e.pause()})},[]),(0,S.useEffect)(()=>{if(!p){E.current&&=(E.current.pause(),null),T(null),C(null),g(``),v.current=``,document.querySelectorAll(`.preview-video-item`).forEach(e=>{e.pause()});return}let e=p.id||p.url;v.current=e;let t=(e,n)=>n===0?e:t(n,e%n),n=p.width||p.videoWidth||p.imageWidth||0,r=p.height||p.videoHeight||p.imageHeight||0;if(n&&r){let e=t(n,r);g(`${n/e}:${r/e}`);return}if(g(``),p.mediaType===`video`){let n=_.current,r=()=>{if(v.current!==e)return;let r=n.videoWidth,i=n.videoHeight;if(!r||!i)return;let a=t(r,i);g(`${r/a}:${i/a}`)};if(n?.removeEventListener(`loadedmetadata`,r),n&&n.videoWidth&&n.videoHeight){let e=t(n.videoWidth,n.videoHeight);g(`${n.videoWidth/e}:${n.videoHeight/e}`)}else n?.addEventListener(`loadedmetadata`,r);return()=>{n?.removeEventListener(`loadedmetadata`,r)}}else{let n=new Image;n.crossOrigin=`anonymous`,n.onload=()=>{if(v.current!==e)return;let r=n.width,i=n.height;if(!r||!i){g(`未知`);return}let a=t(r,i);g(`${r/a}:${i/a}`)},n.onerror=()=>{v.current===e&&g(`未知`)},n.src=`http://ceshi.apiforeign.minzhong.cn${p.url}`}},[p]),(0,S.useEffect)(()=>{(async()=>{try{bae(10).then(e=>{for(let t in e)e[t].forEach(e=>{e.type=t,o(t=>[...t,e])});o(e=>e)})}catch{}})()},[]);let D=e=>{n(e)},O=[{icon:(0,$.jsx)(fH,{style:{fontSize:24}}),title:`行业智造`,description:`新建项目、设置图文视频参数、核对信息并生成素材`,action:`立即创作`,path:`/projects`},{icon:(0,$.jsx)(c8,{style:{fontSize:24}}),title:`AI创作`,description:`输入想法、剧本或上传参考,智能生成视频/图片`,action:`立即生成`,path:`/conversation`},{icon:(0,$.jsx)(fH,{style:{fontSize:24}}),title:`爆款复刻`,description:`上传参考视频与产品图片,一键复刻爆款`,action:`立即创作`,path:`/initial`},{icon:(0,$.jsx)(_8,{style:{fontSize:24}}),title:`拆镜复刻`,description:`精细化镜头复刻工具,拆分参考视频单镜头独立复刻,提升素材原创度,规避素材同质化`,action:`开始拆镜`,path:`/removelens`}],k=[{key:`all`,label:`全部`},{key:`project`,label:`项目媒体`},{key:`chatAi`,label:`AI成片`},{key:`hotOpeningReplicate`,label:`爆款复刻`},{key:`shotReplicate`,label:`拆镜复刻`}],A=t===`all`?a:a.filter(e=>e.type===t);return(0,$.jsxs)(`div`,{className:`content_box`,children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:16},children:[(0,$.jsx)(`h3`,{children:`首页工作台 `}),(0,$.jsxs)(`p`,{style:{cursor:`pointer`,fontSize:12,letterSpacing:.3,padding:`10px 16px`,backgroundColor:`#ffffffff`,borderRadius:30,boxShadow:`0px 4px 12px 0px rgba(0, 0, 0, 0.1)`},children:[`如需进行账户素材推送:`,(0,$.jsxs)(`span`,{style:{color:`#1a50bbff`},onClick:()=>{e(`/authorization`)},children:[`一键推送`,(0,$.jsx)(C2,{style:{marginLeft:8,transform:`rotate(0deg)`}})]})]})]}),(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{padding:`20px`,borderRadius:16,background:`#fff`,border:`1px solid #e2e8f0`,marginBottom:20},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:16},children:[(0,$.jsx)(`div`,{style:{width:4,height:18,borderRadius:2,background:`linear-gradient(180deg, #6366f1, #a855f7)`}}),(0,$.jsx)(`div`,{style:{fontSize:17,fontWeight:700,color:`#1f2937`,letterSpacing:.3},children:`AI 创作入口`}),(0,$.jsx)(`div`,{style:{fontSize:12,color:`#94a3b8`,marginLeft:8},children:`一键开启智能创作`})]}),(0,$.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:12},children:O.map((t,n)=>{let r=[{color:`#3b82f6`,light:`rgba(59,130,246,0.12)`,tag:`项目`},{color:`#6366f1`,light:`rgba(99,102,241,0.12)`,tag:`复刻`},{color:`#f97316`,light:`rgba(249,115,22,0.12)`,tag:`拆镜`},{color:`#10b981`,light:`rgba(16,185,129,0.12)`,tag:`云创`}],i=r[n]||r[0];return(0,$.jsxs)(`div`,{onClick:()=>e(t.path),className:`project-card`,style:{flex:`1 1 280px`,minWidth:280,padding:`16px 20px`,borderRadius:16,background:`#fff`,border:`1px solid #e2e8f0`,cursor:`pointer`,transition:`all 0.3s cubic-bezier(0.4,0,0.2,1)`,position:`relative`,display:`flex`,alignItems:`center`,gap:14,minHeight:96},onMouseEnter:e=>{e.currentTarget.style.borderColor=i.color,e.currentTarget.style.boxShadow=`0 8px 24px ${i.light}`,e.currentTarget.style.background=i.light,e.currentTarget.style.transform=`translateY(-2px)`},onMouseLeave:e=>{e.currentTarget.style.borderColor=`#e2e8f0`,e.currentTarget.style.boxShadow=`none`,e.currentTarget.style.background=`#fff`,e.currentTarget.style.transform=`translateY(0)`},children:[(0,$.jsx)(`div`,{style:{width:48,height:48,borderRadius:12,background:i.light,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,transition:`all 0.3s ease`,color:i.color},onMouseEnter:e=>{e.currentTarget.style.background=i.color,e.currentTarget.style.color=`#fff`},onMouseLeave:e=>{e.currentTarget.style.background=i.light,e.currentTarget.style.color=i.color},children:(0,$.jsx)(`span`,{style:{fontSize:20,display:`flex`,transition:`all 0.3s ease`},children:t.icon})}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:0,display:`flex`,flexDirection:`column`,gap:4},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,$.jsx)(`span`,{style:{fontSize:15,fontWeight:600,color:`#1e293b`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,flex:1,minWidth:0},children:t.title}),(0,$.jsx)(`span`,{style:{fontSize:10,color:i.color,padding:`2px 7px`,borderRadius:4,background:i.light,fontWeight:600,flexShrink:0},children:i.tag})]}),(0,$.jsx)(`div`,{style:{fontSize:12,color:`#64748b`,lineHeight:1.5,display:`-webkit-box`,WebkitLineClamp:2,WebkitBoxOrient:`vertical`,overflow:`hidden`},children:t.description})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:4,color:i.color,fontSize:13,fontWeight:600,flexShrink:0},children:[t.action,(0,$.jsx)(C2,{style:{fontSize:12}})]})]},n)})})]}),(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{padding:`24px 28px`,borderRadius:16,background:`#fff`,border:`1px solid #e2e8f0`},children:[(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:16},children:(0,$.jsx)(`div`,{style:{display:`flex`,gap:8},children:[{key:`cases`,label:`素材案例`},{key:`works`,label:`近期作品`}].map(e=>(0,$.jsx)(`button`,{onClick:()=>b(e.key),style:{padding:`6px 16px`,borderRadius:8,fontSize:13,fontWeight:500,border:`none`,cursor:`pointer`,transition:`all 0.25s ease`,background:y===e.key?`linear-gradient(135deg, #6366f1, #8b5cf6)`:`#f1f5f9`,color:y===e.key?`#fff`:`#64748b`},children:e.label},e.key))})}),y===`works`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{marginBottom:20},children:(0,$.jsx)(TL,{activeKey:t,onChange:D,items:k.map(e=>({key:e.key,label:e.label})),className:`homepage-tabs`})}),(0,$.jsx)(`div`,{className:`stagger-children`,style:{display:`grid`,gridTemplateColumns:`repeat(5, 1fr)`,gap:16},children:A.length===0?(0,$.jsxs)(`div`,{style:{gridColumn:`1 / -1`,padding:`60px 0`,textAlign:`center`,color:`#94a3b8`,fontSize:14},children:[(0,$.jsx)(R6,{style:{fontSize:36,color:`#cbd5e1`,marginBottom:8}}),(0,$.jsx)(`div`,{children:`暂无作品`})]}):A.map(t=>(0,$.jsxs)(`div`,{className:`project-card`,onClick:()=>{let n=t.moduleProjectId;t.type===`hotOpeningReplicate`&&n!=null?e(`/initial/${n}/initialinfo`):t.type===`shotReplicate`&&n!=null?e(`/removelens/${n}/removefenbu`):t.type===`chatAi`?e(`/conversation`):t.type===`project`&&e(`/project`)},style:{borderRadius:12,overflow:`hidden`,cursor:`pointer`,background:`#fff`,border:`1px solid #e2e8f0`},children:[(0,$.jsxs)(`div`,{style:{position:`relative`,aspectRatio:`16/9`},children:[(()=>{let e=t.type!==`hotOpeningReplicate`&&(String(t.resourceType??``).toLowerCase()===`image`||t.resourceType===1||String(t.resourceType??``)===`1`),n=``;return n=e?`/static`+t.resultUrl+`&w=300&p=50`||``:(t.type,t.coverUrl||t.resultUrl||t.resultUrl||``),(0,$.jsx)(`img`,{src:n?n.startsWith(`http`)?n:`http://ceshi.apiforeign.minzhong.cn`+n:``,alt:t.title||t.name||`作品`,style:{width:`100%`,height:`100%`,objectFit:`cover`}})})(),String(t.resourceType??``).toLowerCase()===`image`?null:(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`rgba(0,0,0,0.2)`},children:(0,$.jsx)(t5,{style:{fontSize:28,color:`#fff`}})})]}),(0,$.jsx)(`div`,{style:{padding:`10px 12px`,background:`#f8fafc`,paddingTop:0},children:(0,$.jsxs)(`div`,{style:{marginTop:6,display:`flex`,alignItems:`center`,gap:6,fontSize:12,color:`#64748b`},children:[(0,$.jsx)(`span`,{style:{display:`inline-block`,padding:`1px 6px`,border:`1px solid #3b82f6`,borderRadius:4,color:`#3b82f6`,fontSize:11,fontWeight:500,background:`#fff`,lineHeight:1.4,whiteSpace:`nowrap`},children:{project:`项目媒体`,chatAi:`AI成片`,hotOpeningReplicate:`爆款复刻`,shotReplicate:`拆镜复刻`}[t.type]||`其他`}),(0,$.jsx)(`span`,{style:{color:`#94a3b8`},children:`·`}),(0,$.jsx)(`span`,{style:{whiteSpace:`nowrap`},children:ece(t.generatedTime)})]})})]},t.id||`${t.type}-${Math.random()}`))})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{marginBottom:20},children:(0,$.jsx)(TL,{activeKey:l,onChange:e=>{u(e),c7(e).then(e=>{e?.categories?.[0]?.assets?f(e.categories[0].assets):f([])})},items:s.map(e=>({key:e.id,label:e.name})),className:`homepage-tabs`})}),(0,$.jsx)(`div`,{className:`stagger-children`,style:{display:`flex`,flexWrap:`wrap`,gap:16,justifyContent:`flex-start`,overflowX:`auto`,paddingBottom:8},children:d.length===0?(0,$.jsxs)(`div`,{style:{flex:1,padding:`60px 0`,textAlign:`center`,color:`#94a3b8`,fontSize:14},children:[(0,$.jsx)(R6,{style:{fontSize:36,color:`#cbd5e1`,marginBottom:8}}),(0,$.jsx)(`div`,{children:`暂无素材`})]}):d.map((e,t)=>(0,$.jsx)($se,{asset:e,index:t,onPreview:m},e.id||t))})]})]}),(0,$.jsxs)(mK,{open:!!p,onCancel:()=>{_.current?.pause(),m(null),g(``),v.current=``},footer:null,width:900,centered:!0,className:`preview-modal`,style:{borderRadius:16,overflow:`hidden`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,height:580,paddingTop:30},children:[(0,$.jsx)(`div`,{style:{flex:1,position:`relative`,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:24},children:(0,$.jsxs)(`div`,{style:{maxWidth:`100%`,maxHeight:500,borderRadius:12,overflow:`hidden`,background:`#0f172a`},children:[p?.mediaType===`video`?(0,$.jsx)(`video`,{ref:_,src:`http://ceshi.apiforeign.minzhong.cn${p.url}`,controls:!0,autoPlay:!0,style:{maxWidth:`100%`,maxHeight:500,objectFit:`contain`},"webkit-playsinline":`true`}):(0,$.jsx)(`img`,{src:`http://ceshi.apiforeign.minzhong.cn${p?.url}`,alt:p?.title,style:{maxWidth:`100%`,maxHeight:500,objectFit:`contain`}}),p?.mediaType===`video`&&(0,$.jsx)(`div`,{style:{position:`absolute`,top:32,right:32,fontSize:11,color:`#fff`,background:`rgba(0,0,0,0.6)`,padding:`3px 8px`,borderRadius:4},children:`AI生成`})]})}),(0,$.jsxs)(`div`,{style:{flex:1,padding:24,overflowY:`auto`},children:[(0,$.jsx)(`div`,{style:{fontSize:16,fontWeight:600,color:`#fff`,marginBottom:16},children:`创意详情`}),(0,$.jsxs)(`div`,{style:{fontSize:12,color:`#94a3b8`,marginBottom:16},children:[(0,$.jsx)(`span`,{style:{color:`#6366f1`},children:`比例:`}),h||`计算中...`]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`div`,{style:{fontSize:12,color:`#000000ff`,marginBottom:8},children:`视频提示词`}),(0,$.jsx)(`div`,{style:{fontSize:13,color:`#000000ff`,lineHeight:1.6},children:p?.generationPrompt})]}),(0,$.jsxs)(`div`,{style:{marginBottom:16},children:[(0,$.jsx)(`div`,{style:{fontSize:12,color:`#94a3b8`,marginBottom:8},children:`视频参考图`}),(0,$.jsx)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`},children:p?.mediaReferences&&p.mediaReferences.length>0?p.mediaReferences.map((e,t)=>{let n=e.url||e.resourceUrl||e.previewUrl||``,r=n.startsWith(`http`)?n:`http://ceshi.apiforeign.minzhong.cn${n}`;return e.type===`video`?(0,$.jsxs)(`div`,{style:{width:80,height:80,borderRadius:8,overflow:`hidden`,cursor:`pointer`,position:`relative`},children:[(0,$.jsx)(`video`,{src:r,muted:!0,onClick:e=>{e.stopPropagation();let n=e.currentTarget;x===t?(n.pause(),C(null)):(document.querySelectorAll(`.preview-video-item`).forEach(e=>{e.pause()}),n.play(),C(t))},className:`preview-video-item`,style:{width:`100%`,height:`100%`,objectFit:`cover`}}),x!==t&&(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`rgba(0,0,0,0.3)`},children:(0,$.jsx)(t5,{style:{fontSize:18,color:`#fff`}})})]},t):e.type===`audio`?(0,$.jsx)(`div`,{onClick:e=>{if(e.stopPropagation(),w===r)E.current&&E.current.pause(),T(null);else{E.current&&E.current.pause();let e=new Audio(r);E.current=e,e.onended=()=>{T(null)},e.play(),T(r)}},style:{width:80,height:80,borderRadius:8,overflow:`hidden`,cursor:`pointer`,background:`linear-gradient(135deg, #8b5cf6, #a78bfa)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:w===r?(0,$.jsx)(k6,{style:{fontSize:24,color:`#fff`}}):(0,$.jsx)(k2,{style:{fontSize:24,color:`#fff`}})},t):(0,$.jsx)(`div`,{style:{width:80,height:80,borderRadius:8,overflow:`hidden`,cursor:`pointer`},children:(0,$.jsx)(`img`,{src:r,alt:`参考图 ${t+1}`,style:{width:`100%`,height:`100%`,objectFit:`cover`}})},t)}):(0,$.jsx)($.Fragment,{})})]})]})]}),(0,$.jsx)(`div`,{style:{padding:`16px 24px`,borderTop:`1px solid #334155`,display:`flex`,alignItems:`center`,justifyContent:`flex-end`},children:(0,$.jsx)(`div`,{style:{display:`flex`,gap:12},children:(0,$.jsx)(X,{onClick:()=>{e(`/conversation`,{state:{generationPrompt:p?.generationPrompt,mediaReferences:p?.mediaReferences,aspectRatio:h}})},style:{padding:`8px 24px`,borderRadius:8,background:`#3b82f6`,border:`none`,color:`#fff`,fontSize:13,fontWeight:500},children:`去AI创作`})})})]})]})},{RangePicker:nce}=hV,Z9={borderRadius:8,fontWeight:600},Q9=e=>e.replace(/_([a-z])/g,(e,t)=>t.toUpperCase()),rce=()=>{let e=Ye(),[t]=On(),{message:n}=Vb.useApp(),[r,i]=(0,S.useState)([]),[a,o]=(0,S.useState)(0),[s,c]=(0,S.useState)(!1),[l,u]=(0,S.useState)(!1),[d,f]=(0,S.useState)(!1),[p,m]=(0,S.useState)([]),[h,g]=(0,S.useState)([]),[_,v]=(0,S.useState)(``),[y,b]=(0,S.useState)(1),[x,C]=(0,S.useState)(10),[w,T]=(0,S.useState)(t.get(`advertiserId`)||``),[E,D]=(0,S.useState)(),[O,k]=(0,S.useState)((0,bE.default)().subtract(1,`day`).format(`YYYY-MM-DD`)),[A,j]=(0,S.useState)(``);(0,S.useEffect)(()=>{N(),M()},[]);let M=async(e=1,t=10,r,a)=>{c(!0);try{let n=await gae({advertiser_id:a??w,consume_date:r??E,page:e,page_size:t});i(n.data||[]),o(n.pagination?.total||0),b(n.pagination?.page||1),C(n.pagination?.pageSize||10)}catch{n.error(`加载数据失败`)}finally{c(!1)}},N=async()=>{try{let e=((await o7()).data||[]).map(e=>({name:Q9(e.field),description:e.description}));m(e);let t=localStorage.getItem(`consumeColumns`);g(t?JSON.parse(t):e.map(e=>e.name))}catch{n.error(`加载表头字段失败`)}},P=r.map((e,t)=>({...e,index:t+1,key:e.id})),F=()=>{document.referrer.includes(window.location.origin)?e(-1):e(`/materials`)},I=()=>{b(1),M(1,x)},L=()=>{mK.confirm({title:`拉取消耗数据`,content:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{marginBottom:12},children:[(0,$.jsx)(Q.Text,{style:{display:`block`,marginBottom:8},children:`同步日期:`}),(0,$.jsx)(hV,{value:(0,bE.default)(O),onChange:e=>k(e?e.format(`YYYY-MM-DD`):(0,bE.default)().subtract(1,`day`).format(`YYYY-MM-DD`)),style:{width:`100%`}})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Text,{style:{display:`block`,marginBottom:8},children:`广告主ID(可选):`}),(0,$.jsx)(IW,{placeholder:`不指定则同步所有授权的广告主`,value:A,onChange:e=>j(e.target.value)})]})]}),onOk:async()=>{u(!0);try{await _ae({date:O,advertiser_id:A||void 0}),n.success(`拉取消耗数据成功`),M(y,x)}catch{n.error(`拉取消耗数据失败`)}finally{u(!1)}},okText:`开始拉取`,cancelText:`取消`})},R=h.map(e=>p.find(t=>t.name===e)).filter(e=>!!e).map(e=>({title:e.description,dataIndex:e.name,key:e.name,ellipsis:!0}));return(0,$.jsxs)(`div`,{style:{minHeight:`94vh`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginBottom:12},children:[t.get(`advertiserId`)&&(0,$.jsx)(X,{type:`text`,icon:(0,$.jsx)(b2,{}),onClick:F}),(0,$.jsx)(X4,{style:{color:`#6366f1`,fontSize:16}}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:16},children:`消耗记录`})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,justifyContent:`space-between`,alignItems:`center`,gap:12,marginBottom:16,padding:`12px 16px`,borderRadius:12,background:`#fff`,border:`1px solid #f0f0f5`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`},children:[(0,$.jsx)(IW,{placeholder:`广告主ID`,value:w,onChange:e=>T(e.target.value),style:{width:180,borderRadius:8},allowClear:!0,onPressEnter:()=>{b(1),M(1,x)}}),(0,$.jsx)(nce,{value:E?[(0,bE.default)(E[0]),(0,bE.default)(E[1])]:void 0,onChange:e=>{e&&e[0]&&e[1]?D([e[0].format(`YYYY-MM-DD`),e[1].format(`YYYY-MM-DD`)]):D(void 0)},style:{borderRadius:8}}),(0,$.jsx)(X,{type:`primary`,onClick:I,style:{...Z9,borderColor:`transparent`},children:`搜索`})]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,$.jsx)(X,{icon:(0,$.jsx)(zre,{}),onClick:L,loading:l,style:Z9,children:`拉取消耗`}),(0,$.jsx)(X,{icon:(0,$.jsx)(C8,{}),onClick:()=>f(!0),style:{...Z9,background:`#f8f9fc`,border:`1px solid #e2e8f0`,color:`#334155`},children:`自定义表头`})]})]}),(0,$.jsxs)(`div`,{style:{background:`#fff`,borderRadius:12,boxShadow:`0 1px 3px rgba(0,0,0,0.05)`},children:[(0,$.jsx)(LQ,{dataSource:P,columns:R,loading:s,pagination:!1,rowKey:`id`,bordered:!1,scroll:{x:`max-content`}}),(0,$.jsx)(`div`,{style:{padding:`16px`,textAlign:`right`},children:(0,$.jsx)(SG,{current:y,pageSize:x,total:a,showSizeChanger:!0,showTotal:e=>`共 ${e} 条记录`,onChange:(e,t)=>{b(e),C(t),M(e,t)},size:`small`})})]}),(0,$.jsx)(mK,{title:`自定义表头`,open:d,onOk:()=>{localStorage.setItem(`consumeColumns`,JSON.stringify(h)),n.success(`表头设置已保存`),f(!1)},onCancel:()=>{f(!1),v(``)},okText:`确定`,cancelText:`取消`,width:800,children:(0,$.jsxs)(`div`,{style:{display:`flex`,gap:20,height:400},children:[(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`},children:[(0,$.jsx)(IW,{placeholder:`搜索指标...`,value:_,allowClear:!0,onChange:e=>v(e.target.value),style:{marginBottom:8}}),(0,$.jsx)(Q.Text,{type:`secondary`,style:{fontSize:12,marginBottom:12,display:`block`},children:`输入指标名称进行搜索`}),(0,$.jsxs)(`div`,{style:{flex:1,overflowY:`auto`,border:`1px solid #f0f0f5`,borderRadius:8,padding:12},children:[(0,$.jsx)(`div`,{style:{marginBottom:16},children:(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:14,color:`#1e293b`},children:`任务详情指标`})}),(0,$.jsx)(VR,{checked:h.length===p.length&&p.length>0,indeterminate:h.length>0&&h.length{e.target.checked?g(p.map(e=>e.name)):g([])},style:{marginBottom:12},children:`全选`}),(0,$.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`1fr 1fr`,gap:8},children:p.filter(e=>e.description.toLowerCase().includes(_.toLowerCase())||e.name.toLowerCase().includes(_.toLowerCase())).map(e=>(0,$.jsx)(VR,{checked:h.includes(e.name),onChange:t=>{t.target.checked?g(t=>[...t,e.name]):g(t=>t.filter(t=>t!==e.name))},children:e.description},e.name))})]})]}),(0,$.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:12},children:[(0,$.jsxs)(Q.Text,{strong:!0,style:{fontSize:14,color:`#1e293b`},children:[`已添加(`,h.length,`)`]}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,$.jsx)(X,{size:`small`,onClick:()=>g([]),disabled:h.length===0,children:`清空`}),(0,$.jsx)(X,{size:`small`,onClick:async()=>{try{let e=((await o7()).data||[]).map(e=>({name:Q9(e.field),description:e.description}));m(e),g(e.map(e=>e.name)),localStorage.removeItem(`consumeColumns`),n.success(`表头字段已更新`)}catch{n.error(`更新表头字段失败`)}},children:`更新表头字段`})]})]}),(0,$.jsx)(`div`,{style:{flex:1,overflowY:`auto`,border:`1px solid #f0f0f5`,borderRadius:8,padding:12},children:h.length===0?(0,$.jsx)(Q.Text,{type:`secondary`,style:{fontSize:14,textAlign:`center`,display:`block`,padding:`40px 0`},children:`暂无已选指标`}):(0,$.jsx)(`div`,{children:h.map((e,t)=>{let n=p.find(t=>t.name===e);return(0,$.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,padding:`8px 12px`,borderBottom:`1px solid #f0f0f5`,cursor:`move`,userSelect:`none`},draggable:!0,onDragStart:e=>{e.dataTransfer.setData(`index`,String(t))},onDragOver:e=>{e.preventDefault()},onDrop:e=>{let n=parseInt(e.dataTransfer.getData(`index`)),r=t;if(n!==r){let e=[...h],[t]=e.splice(n,1);e.splice(r,0,t),g(e)}},children:[(0,$.jsx)(Q.Text,{children:n?.description||e}),(0,$.jsx)(Q.Text,{type:`secondary`,style:{fontSize:12},children:t+1})]},e)})})})]})]})})]})},ice=()=>{let e=Ye(),[t]=On(),{message:n}=Vb.useApp(),[r,i]=(0,S.useState)(0),[a,o]=(0,S.useState)(!0),[s,c]=(0,S.useState)(!1),[l,u]=(0,S.useState)(``);(0,S.useEffect)(()=>{let r=t.get(`auth_code`),a=t.get(`state`);if(!r||!a){o(!1),i(10);return}let s={auth_code:r,state:a,app_id:t.get(`app_id`)||void 0,material_auth_status:t.get(`material_auth_status`)||void 0,scope:t.get(`scope`)||void 0,uid:t.get(`uid`)||void 0};(async()=>{try{let t=await Yie(s);c(!0),o(!1),n.success(t?.message||`授权成功`),setTimeout(()=>{e(`/authorization`)},1500)}catch(e){let t=e?.message||`授权失败`;u(t),o(!1),n.error(t)}})();let l=setInterval(()=>{i(e=>e>=11?(o(!1),e):e+1)},1e3);return()=>{clearInterval(l)}},[e,t,n]);let d=()=>{i(0),o(!0),c(!1),u(``),window.location.href=`/authorization`};return s?(0,$.jsx)(`div`,{style:{minHeight:`100vh`,display:`flex`,justifyContent:`center`,alignItems:`center`,background:`linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%)`},children:(0,$.jsxs)(`div`,{style:{textAlign:`center`,padding:`60px 80px`,background:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.1)`},children:[(0,$.jsx)(`div`,{style:{width:80,height:80,background:`#dcfce7`,borderRadius:`50%`,display:`flex`,justifyContent:`center`,alignItems:`center`,margin:`0 auto 24px`},children:(0,$.jsx)(Q.Text,{style:{fontSize:40,color:`#22c55e`},children:`✓`})}),(0,$.jsx)(Q.Title,{level:3,style:{marginBottom:16,color:`#1e293b`},children:`授权成功`}),(0,$.jsx)(Q.Text,{style:{color:`#64748b`},children:`正在跳转至授权管理页面...`})]})}):(0,$.jsx)(`div`,{style:{minHeight:`100vh`,display:`flex`,justifyContent:`center`,alignItems:`center`,background:`linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%)`},children:(0,$.jsxs)(`div`,{style:{textAlign:`center`,padding:`60px 80px`,background:`#fff`,borderRadius:16,boxShadow:`0 10px 40px rgba(0,0,0,0.1)`},children:[(0,$.jsx)(`div`,{style:{width:80,height:80,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,borderRadius:`50%`,display:`flex`,justifyContent:`center`,alignItems:`center`,margin:`0 auto 24px`},children:a&&r<10?(0,$.jsx)(UG,{size:`large`,description:`加载中`,style:{color:`#fff`}}):(0,$.jsx)(cV,{style:{fontSize:40,color:`#fff`}})}),l?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Q.Title,{level:3,style:{marginBottom:16,color:`#ef4444`},children:`授权失败`}),(0,$.jsx)(Q.Text,{style:{color:`#64748b`,marginBottom:24,display:`block`},children:l}),(0,$.jsx)(X,{type:`primary`,size:`large`,icon:(0,$.jsx)(wq,{}),onClick:d,style:{borderRadius:8,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,fontWeight:600,padding:`12px 32px`},children:`重新授权`})]}):r>=10?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Q.Title,{level:3,style:{marginBottom:16,color:`#ef4444`},children:`授权无响应`}),(0,$.jsx)(Q.Text,{style:{color:`#64748b`,marginBottom:24,display:`block`},children:`请重新授权`}),(0,$.jsx)(X,{type:`primary`,size:`large`,icon:(0,$.jsx)(wq,{}),onClick:d,style:{borderRadius:8,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,fontWeight:600,padding:`12px 32px`},children:`重新授权`})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Q.Title,{level:3,style:{marginBottom:16,color:`#1e293b`},children:`授权中,请等待`}),(0,$.jsx)(Q.Text,{style:{color:`#64748b`,marginBottom:24,display:`block`},children:`正在等待平台完成授权操作`}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,gap:8},children:[(0,$.jsx)(cV,{style:{color:`#6366f1`}}),(0,$.jsxs)(Q.Text,{style:{color:`#6366f1`,fontWeight:500,fontSize:16},children:[r,`s`]})]})]})]})})},ace=()=>(0,$.jsxs)(`div`,{className:`content_box`,children:[(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{padding:`28px 32px`,borderRadius:16,background:`linear-gradient(135deg, #fffbeb 0%, #fef3c7 50%, #fed7aa 100%)`,border:`1px solid rgba(245, 158, 11, 0.18)`,marginBottom:24,position:`relative`,overflow:`hidden`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14,marginBottom:12},children:[(0,$.jsx)(`div`,{style:{width:52,height:52,borderRadius:14,background:`linear-gradient(135deg, #f59e0b 0%, #d97706 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 6px 20px rgba(245, 158, 11, 0.3)`},children:(0,$.jsx)(R2,{style:{fontSize:24,color:`#fff`}})}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`shiny-text-container`,style:{marginBottom:4},children:(0,$.jsx)(`span`,{className:`shiny-text`,style:{fontSize:26,fontWeight:700,backgroundImage:`linear-gradient(90deg, #f59e0b 0%, #d97706 30%, #ea580c 50%, #d97706 70%, #f59e0b 100%)`},children:`行业爆款大盘`})}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:13,color:`#b45309`},children:[(0,$.jsx)(a8,{style:{fontSize:12}}),(0,$.jsx)(`span`,{children:`实时追踪全网热门素材趋势`})]})]})]}),(0,$.jsx)(Q.Text,{style:{color:`#78716c`,fontSize:14,lineHeight:1.7},children:`实时追踪各行业爆款素材,把握创作风向,打造热门内容`})]}),(0,$.jsx)(`div`,{style:{position:`relative`},children:(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{padding:`24px 28px`,borderRadius:16,background:`#fff`},children:[(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:20},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`},children:[(0,$.jsx)(`div`,{style:{width:4,height:18,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,marginRight:10}}),(0,$.jsx)(q8,{style:{marginRight:8,color:`#6366f1`,fontSize:16}}),(0,$.jsx)(`span`,{style:{fontSize:17,fontWeight:600,color:`#1f2937`},children:`爆款素材榜单`}),(0,$.jsx)(`span`,{style:{marginLeft:10,fontSize:12,fontWeight:400,color:`#94a3b8`}})]})}),(0,$.jsxs)(`div`,{className:`stagger-children`,style:{display:`grid`,gridTemplateColumns:`repeat(2, 1fr)`,gap:16,position:`relative`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,zIndex:1,inset:0,background:`rgb(255,255,255)`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexDirection:`column`,gap:2,color:`#fff`,borderRadius:6},children:(0,$.jsxs)(X,{type:`primary`,size:`middle`,onClick:()=>{Z.info(`请联系客服开通会员`)},style:{borderRadius:10,fontWeight:500,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,boxShadow:`0 4px 14px rgba(99, 102, 241, 0.28)`},children:[(0,$.jsx)(X3,{style:{marginRight:6}}),`立即解锁全部`,(0,$.jsx)(C2,{style:{marginLeft:4,fontSize:12}})]})}),[{rank:1,title:`夏日美妆教程:3 步打造奶油肌`,author:`美妆博主·小雅`,views:`128.4w`,likes:`12.6w`,comments:`8,234`,tag:`NO.1`,tagColor:`#f59e0b`},{rank:2,title:`平价穿搭 | 学生党一周不重样`,author:`穿搭达人·Miki`,views:`96.2w`,likes:`9.8w`,comments:`6,128`,tag:`NO.2`,tagColor:`#a78bfa`},{rank:3,title:`探店 vlog | 网红咖啡馆测评`,author:`美食探店·阿伦`,views:`78.5w`,likes:`7.4w`,comments:`4,892`,tag:`NO.3`,tagColor:`#6366f1`},{rank:4,title:`iPhone 16 Pro 一周深度体验`,author:`数码评测·老王`,views:`65.7w`,likes:`6.1w`,comments:`3,847`,tag:`NO.4`,tagColor:`#94a3b8`}].map(e=>(0,$.jsxs)(`div`,{className:`project-card animate-fadeInUp`,style:{display:`flex`,gap:14,padding:14,borderRadius:14,background:`#fff`,border:`1px solid #e2e8f0`,cursor:`pointer`},children:[(0,$.jsxs)(`div`,{style:{position:`relative`,width:140,height:80,flexShrink:0,borderRadius:10,overflow:`hidden`,background:`linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:[(0,$.jsx)(q6,{style:{fontSize:28,color:`rgba(255,255,255,0.6)`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:6,left:6,padding:`2px 8px`,borderRadius:6,background:e.tagColor,color:`#fff`,fontSize:11,fontWeight:600},children:e.tag})]}),(0,$.jsxs)(`div`,{style:{flex:1,minWidth:0,display:`flex`,flexDirection:`column`},children:[(0,$.jsx)(`div`,{style:{fontSize:14,fontWeight:600,color:`#1e293b`,marginBottom:4,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:e.title}),(0,$.jsx)(`div`,{style:{fontSize:12,color:`#94a3b8`,marginBottom:8},children:e.author}),(0,$.jsxs)(`div`,{style:{display:`flex`,gap:12,fontSize:12,color:`#64748b`},children:[(0,$.jsxs)(`span`,{children:[(0,$.jsx)(mW,{style:{marginRight:3}}),e.views]}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(W3,{style:{marginRight:3}}),e.likes]}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(M4,{style:{marginRight:3}}),e.comments]})]})]})]},e.rank))]})]})})]}),oce=()=>(0,$.jsxs)(`div`,{className:`content_box`,children:[(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{padding:`28px 32px`,borderRadius:16,background:`linear-gradient(135deg, #f5f3ff 0%, #ede9fe 50%, #fce7f3 100%)`,border:`1px solid rgba(139, 92, 246, 0.12)`,marginBottom:24,position:`relative`,overflow:`hidden`},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14,marginBottom:12},children:[(0,$.jsx)(`div`,{style:{width:52,height:52,borderRadius:14,background:`linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxShadow:`0 6px 20px rgba(139, 92, 246, 0.3)`},children:(0,$.jsx)(m3,{style:{fontSize:24,color:`#fff`}})}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`div`,{className:`shiny-text-container`,style:{marginBottom:4},children:(0,$.jsx)(`span`,{className:`shiny-text`,style:{fontSize:26,fontWeight:700},children:`创意素材案例`})}),(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:13,color:`#7c3aed`},children:[(0,$.jsx)(V4,{style:{fontSize:12}}),(0,$.jsx)(`span`,{children:`探索 AI 创作无限可能`})]})]})]}),(0,$.jsx)(Q.Text,{style:{color:`#64748b`,fontSize:14,lineHeight:1.7},children:`精选 AI 生成的优秀素材案例,展示 AI 创作的无限潜力与创意灵感`})]}),(0,$.jsxs)(`div`,{className:`animate-fadeInUp`,style:{padding:`24px 28px`,borderRadius:16,background:`#fff`,position:`relative`},children:[(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:20},children:(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`},children:[(0,$.jsx)(`div`,{style:{width:4,height:18,background:`linear-gradient(180deg, #6366f1, #8b5cf6)`,borderRadius:2,marginRight:10}}),(0,$.jsx)(R8,{style:{marginRight:8,color:`#f59e0b`,fontSize:16}}),(0,$.jsx)(`span`,{style:{fontSize:17,fontWeight:600,color:`#1f2937`},children:`精选案例展示`})]})}),(0,$.jsxs)(`div`,{className:`stagger-children`,style:{display:`grid`,gridTemplateColumns:`repeat(3, 1fr)`,gap:16,marginBottom:16,position:`relative`},children:[(0,$.jsx)(`div`,{style:{position:`absolute`,inset:0,zIndex:1,background:`rgb(255,255,255)`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexDirection:`column`,borderRadius:14,gap:4,color:`#fff`},children:(0,$.jsxs)(X,{type:`primary`,size:`middle`,onClick:()=>{Z.info(`请联系客服开通会员`)},style:{borderRadius:10,fontWeight:500,background:`linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)`,border:`none`,boxShadow:`0 4px 14px rgba(99, 102, 241, 0.28)`},children:[(0,$.jsx)(X3,{style:{marginRight:6}}),`解锁全部案例`,(0,$.jsx)(C2,{style:{marginLeft:4,fontSize:12}})]})}),[{title:`美妆直播切片`,tag:`热门`,tagColor:`#ef4444`},{title:`3C 数码测评`,tag:`推荐`,tagColor:`#6366f1`},{title:`美食探店 vlog`,tag:`推荐`,tagColor:`#6366f1`},{title:`服饰穿搭合集`,tag:`热门`,tagColor:`#ef4444`},{title:`家居场景展示`,tag:`推荐`,tagColor:`#6366f1`},{title:`母婴亲子内容`,tag:`热门`,tagColor:`#ef4444`}].map((e,t)=>(0,$.jsxs)(`div`,{className:`project-card animate-fadeInUp`,style:{position:`relative`,borderRadius:14,overflow:`hidden`,cursor:`pointer`,border:`1px solid #e2e8f0`,background:`#fff`},children:[(0,$.jsxs)(`div`,{style:{position:`relative`,aspectRatio:`16/9`,background:`linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:[(0,$.jsx)(q6,{style:{fontSize:36,color:`rgba(255,255,255,0.6)`}}),(0,$.jsx)(`div`,{style:{position:`absolute`,top:10,left:10,padding:`2px 8px`,borderRadius:6,background:e.tagColor,color:`#fff`,fontSize:11,fontWeight:500},children:e.tag})]}),(0,$.jsxs)(`div`,{style:{padding:`10px 14px`,background:`#f8fafc`,display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,$.jsx)(`span`,{style:{fontSize:13,color:`#334155`,fontWeight:500,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:e.title}),(0,$.jsx)(mW,{style:{fontSize:13,color:`#94a3b8`}})]})]},t))]})]})]}),{RangePicker:sce}=hV;function $9(e){if(!e)return`-`;try{return new Date(e).toLocaleString(`zh-CN`,{hour12:!1})}catch{return`-`}}var cce={recharge:{color:`green`,label:`充值`},consume:{color:`red`,label:`消费`},refund:{color:`orange`,label:`退款`},team_internal:{color:`blue`,label:`团队内部`}},lce=()=>{let[e,t]=(0,S.useState)(null),[n,r]=(0,S.useState)(!1),i=(0,S.useCallback)(async()=>{r(!0);try{t(await Bae())}catch(e){Z.error(e?.message||`获取团队信息失败`)}finally{r(!1)}},[]);(0,S.useEffect)(()=>{i()},[i]);let[a,o]=(0,S.useState)([]),[s,c]=(0,S.useState)(0),[l,u]=(0,S.useState)(!1),[d,f]=(0,S.useState)(1),p=(0,S.useCallback)(async()=>{if(e){u(!0);try{let e=await Vae(d);o(e.items||[]),c(e.total||0)}catch(e){Z.error(e?.message||`加载成员失败`)}finally{u(!1)}}},[e,d]);(0,S.useEffect)(()=>{p()},[p]);let[m,h]=(0,S.useState)({open:!1,member:null}),[g]=tU.useForm(),[_,v]=(0,S.useState)(!1),y=async()=>{if(m.member)try{let e=await g.validateFields(),t=Number(e.amount);if(!t||t<=0||t>9999999){Z.error(`请输入有效的正数积分数量`);return}v(!0),await Hae(m.member.id,t,e.direction||`increase`,e.description),Z.success(e.direction===`decrease`?`积分扣减成功`:`积分增加成功`),h({open:!1,member:null}),g.resetFields(),p(),he()}catch(e){if(e?.errorFields)return;Z.error(e?.message||`操作失败`)}finally{v(!1)}},[b,x]=(0,S.useState)([]),[C,w]=(0,S.useState)(!1),[T,E]=(0,S.useState)(!1),[D]=tU.useForm(),[O,k]=(0,S.useState)(!1),A=(0,S.useCallback)(async()=>{w(!0);try{x(await Uae()||[])}catch(e){Z.error(e?.message||`加载邀请码失败`)}finally{w(!1)}},[]);(0,S.useEffect)(()=>{A()},[A]);let j=async()=>{try{let e=await D.validateFields();k(!0),await Wae(e.maxUses||null,null),Z.success(`邀请码已生成`),E(!1),D.resetFields(),A()}catch(e){if(e?.errorFields)return;Z.error(e?.message||`创建失败`)}finally{k(!1)}},M=async e=>{try{await Gae(e),Z.success(`已撤销`),A()}catch(e){Z.error(e?.message||`撤销失败`)}},N=e=>{navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(e).then(()=>{Z.success(`邀请链接已复制`)}).catch(()=>{P(e)}):P(e)},P=e=>{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.left=`-9999px`,t.style.top=`-9999px`,document.body.appendChild(t),t.focus(),t.select();try{document.execCommand(`copy`),Z.success(`邀请链接已复制`)}catch{Z.warning(`复制失败,请手动复制`)}document.body.removeChild(t)},[F,I]=(0,S.useState)([]),[L,R]=(0,S.useState)(!1),[z,B]=(0,S.useState)(`pending`),[V,H]=(0,S.useState)(`members`),U=(0,S.useRef)(!1),W=(0,S.useRef)(0),ee=(0,S.useCallback)(async(e,t=!1)=>{R(!0);try{let n=await Kae(e),r=n?.length||0;I(n||[]),e===`pending`&&r>0&&(t&&!U.current?(U.current=!0,mK.confirm({title:(0,$.jsxs)(sH,{children:[(0,$.jsx)(V2,{style:{color:`#f59e0b`}}),`待处理的加入申请`]}),content:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`p`,{children:[`您有 `,(0,$.jsx)(`strong`,{style:{color:`#ef4444`},children:r}),` 条待处理的团队加入申请。`]}),(0,$.jsx)(`p`,{style:{color:`#64748b`,fontSize:13,marginBottom:0},children:`请及时处理新成员的加入申请。`})]}),okText:`立即处理`,cancelText:`稍后处理`,onOk:()=>{H(`requests`)}})):!t&&r>W.current&&Z.info({content:`有 ${r-W.current} 条新的加入申请待处理`,duration:5})),e===`pending`&&(W.current=r)}catch(e){Z.error(e?.message||`加载申请失败`)}finally{R(!1)}},[]);(0,S.useEffect)(()=>{ee(`pending`,!0)},[ee]),(0,S.useEffect)(()=>{if(!e)return;let t=setInterval(()=>{ee(`pending`,!1)},6e4);return()=>clearInterval(t)},[e,ee]);let te=async(e,t,n)=>{try{await qae(e,t,n),Z.success(t===`approve`?`已通过`:`已拒绝`),ee(z),p()}catch(e){Z.error(e?.message||`操作失败`)}},[G,ne]=(0,S.useState)([]),[re,ie]=(0,S.useState)(0),[ae,oe]=(0,S.useState)(null),[K,q]=(0,S.useState)(!1),[se,ce]=(0,S.useState)(1),[le,ue]=(0,S.useState)(``),[de,fe]=(0,S.useState)(``),[pe,me]=(0,S.useState)(()=>{let e=(0,bE.default)().format(`YYYY-MM-DD`);return[e,e]}),he=(0,S.useCallback)(async()=>{q(!0);try{let e=await Zae({page:se,pageSize:10,phone:de||void 0,recordType:le||void 0,startDate:pe?.[0]||void 0,endDate:pe?.[1]||void 0});ne(e.items||[]),ie(e.total||0),oe(e.summary||null)}catch(e){Z.error(e?.message||`加载积分记录失败`)}finally{q(!1)}},[se,le,de,pe]);(0,S.useEffect)(()=>{he()},[he]);let ge=()=>{ue(``),fe(``);let e=(0,bE.default)().format(`YYYY-MM-DD`);me([e,e]),ce(1)},_e=()=>{let e=Qae({phone:de||void 0,recordType:le||void 0,startDate:pe?.[0]||void 0,endDate:pe?.[1]||void 0}),t=localStorage.getItem(`auth_token`),n=t?{Authorization:`Bearer ${t}`}:{};fetch(e,{headers:n}).then(e=>e.blob()).then(e=>{let t=document.createElement(`a`);t.href=URL.createObjectURL(e),t.download=`团队积分_${(0,bE.default)().format(`YYYYMMDD_HHmmss`)}.csv`,t.click(),URL.revokeObjectURL(t.href)}).catch(()=>Z.error(`导出失败`))},ve=[{title:`用户名`,dataIndex:`username`,width:140,render:e=>(0,$.jsx)(Q.Text,{strong:!0,children:e})},{title:`手机号`,dataIndex:`phone`,width:130,render:e=>e||`-`},{title:`积分`,dataIndex:`credits`,width:100,render:e=>(0,$.jsx)(Q.Text,{style:{color:`#6366f1`},children:(e??0).toFixed(2)})},{title:`状态`,dataIndex:`isActive`,width:80,render:e=>(0,$.jsx)(XQ,{color:e?`green`:`red`,children:e?`启用`:`禁用`})},{title:`加入时间`,dataIndex:`joinedAt`,width:170,render:e=>$9(e)},{title:`操作`,key:`action`,width:100,render:(e,t)=>{let n=_7.getState().user?.id;return t.id===n?(0,$.jsx)(gw,{title:`不能给自己调整积分`,children:(0,$.jsx)(X,{size:`small`,type:`link`,style:{padding:0,color:`#999`,cursor:`not-allowed`},disabled:!0,children:`调整积分`})}):(0,$.jsx)(X,{size:`small`,type:`link`,style:{padding:0},onClick:()=>{h({open:!0,member:t}),g.resetFields()},children:`调整积分`})}}],ye=e=>`${window.location.origin}/join-team?code=${e}`,be=[{title:`邀请码`,dataIndex:`code`,width:200,render:e=>(0,$.jsx)(Q.Text,{copyable:!0,style:{fontFamily:`monospace`},children:e})},{title:`邀请链接`,dataIndex:`code`,render:e=>{let t=ye(e);return(0,$.jsxs)(sH,{style:{width:`100%`},children:[(0,$.jsx)(Q.Text,{style:{flex:1,fontSize:12,wordBreak:`break-all`,fontFamily:`monospace`,color:`#64748b`},children:t}),(0,$.jsx)(gw,{title:`复制链接`,children:(0,$.jsx)(X,{size:`small`,type:`text`,icon:(0,$.jsx)(t1,{}),onClick:()=>N(t)})})]})}},{title:`状态`,dataIndex:`status`,width:80,render:e=>(0,$.jsx)(XQ,{color:e===`active`?`green`:`default`,children:e===`active`?`有效`:`已撤销`})},{title:`使用次数`,key:`uses`,width:100,render:(e,t)=>`${t.useCount}${t.maxUses?`/${t.maxUses}`:``}`},{title:`过期时间`,dataIndex:`expiresAt`,width:170,render:e=>e?$9(e):`永不过期`},{title:`操作`,key:`action`,width:80,render:(e,t)=>t.status===`active`?(0,$.jsx)(X,{size:`small`,type:`link`,danger:!0,onClick:()=>M(t.id),children:`撤销`}):null}],xe=e=>{let t={pending:{color:`orange`,text:`待处理`},approved:{color:`green`,text:`已通过`},rejected:{color:`red`,text:`已拒绝`}}[e]||{color:`default`,text:e};return(0,$.jsx)(XQ,{color:t.color,children:t.text})},Se=[{title:`申请人`,dataIndex:`username`,width:140,render:e=>(0,$.jsx)(Q.Text,{strong:!0,children:e})},{title:`手机号`,dataIndex:`phone`,width:130,render:e=>e||`-`},{title:`状态`,dataIndex:`status`,width:100,render:e=>xe(e)},{title:`申请时间`,dataIndex:`createdAt`,width:170,render:e=>$9(e)},{title:`处理时间`,dataIndex:`handledAt`,width:170,render:e=>e?$9(e):`-`},{title:`备注`,dataIndex:`note`,width:180,ellipsis:!0,render:e=>e||`-`},{title:`操作`,key:`action`,width:160,render:(e,t)=>t.status===`pending`?(0,$.jsxs)(sH,{size:4,children:[(0,$.jsx)(X,{size:`small`,type:`link`,icon:(0,$.jsx)(hC,{}),style:{color:`#16a34a`,padding:0},onClick:()=>te(t.id,`approve`),children:`通过`}),(0,$.jsx)(X,{size:`small`,type:`link`,icon:(0,$.jsx)(ju,{}),danger:!0,style:{padding:0},onClick:()=>{mK.confirm({title:`拒绝申请`,content:(0,$.jsx)(tU,{layout:`vertical`,style:{marginTop:12},children:(0,$.jsx)(tU.Item,{name:`note`,label:`拒绝原因(可选)`,children:(0,$.jsx)(IW.TextArea,{rows:2,placeholder:`选填`,id:`reject-note-input`})})}),onOk:()=>{let e=document.getElementById(`reject-note-input`)?.value||void 0;te(t.id,`reject`,e)}})},children:`拒绝`})]}):(0,$.jsx)(`span`,{style:{color:`#94a3b8`,fontSize:12},children:`已处理`})}],Ce=[{title:`用户名`,dataIndex:`username`,width:120,render:e=>(0,$.jsx)(Q.Text,{strong:!0,children:e||`-`})},{title:`手机号`,dataIndex:`phone`,width:120,render:e=>e||`-`},{title:`类型`,dataIndex:`type`,width:100,render:(e,t)=>{let n=cce[t.type]||{color:`default`,label:t.type||`-`};return(0,$.jsx)(XQ,{color:n.color,children:n.label})}},{title:`变动积分`,dataIndex:`amount`,width:110,align:`right`,render:(e,t)=>(0,$.jsxs)(Q.Text,{strong:!0,style:{color:t.amount>=0?`#10b981`:`#ef4444`,fontSize:14},children:[t.amount>=0?`+`:``,(t.amount??0).toFixed(2)]})},{title:`余额`,dataIndex:`balanceAfter`,width:100,align:`right`,render:e=>(e??0).toFixed(2)},{title:`说明`,dataIndex:`description`,ellipsis:!0,minWidth:160,render:e=>e||`-`},{title:`时间`,dataIndex:`createdAt`,width:170,render:e=>$9(e)}],we={borderRadius:16,background:`#fff`,border:`1px solid #f0f0f5`,overflow:`hidden`},Te={padding:`16px`,textAlign:`right`},Ee=[{key:`members`,label:(0,$.jsxs)(sH,{children:[(0,$.jsx)($8,{}),`成员列表`,s>0&&(0,$.jsxs)(`span`,{style:{color:`#94a3b8`,fontSize:12},children:[`(`,s,`)`]})]}),children:(0,$.jsxs)(`div`,{style:we,children:[(0,$.jsx)(LQ,{columns:ve,dataSource:a,rowKey:`id`,loading:l,pagination:!1,bordered:!1,scroll:{x:800},locale:{emptyText:(0,$.jsx)(XS,{description:`暂无成员`})}}),s>0&&(0,$.jsx)(`div`,{style:Te,children:(0,$.jsx)(SG,{current:d,pageSize:20,total:s,onChange:e=>f(e),size:`small`})})]})},{key:`credits`,label:(0,$.jsxs)(sH,{children:[(0,$.jsx)(r5,{}),`团队积分变动`]}),children:(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{style:{marginBottom:12,display:`flex`,gap:8,flexWrap:`wrap`,alignItems:`center`},children:[(0,$.jsx)(EC,{value:le||void 0,onChange:e=>{ue(e||``),ce(1)},allowClear:!0,placeholder:`交易类型`,style:{width:130},options:[{value:`recharge`,label:`充值`},{value:`consume`,label:`消费`},{value:`team_internal`,label:`团队内部`},{value:`refund`,label:`退款`}]}),(0,$.jsx)(IW,{placeholder:`搜索手机号`,value:de,onChange:e=>{fe(e.target.value),ce(1)},style:{width:160},allowClear:!0}),(0,$.jsx)(sce,{value:pe?[(0,bE.default)(pe[0]),(0,bE.default)(pe[1])]:void 0,onChange:e=>{e&&e[0]&&e[1]?me([e[0].format(`YYYY-MM-DD`),e[1].format(`YYYY-MM-DD`)]):me(null),ce(1)}}),(0,$.jsx)(X,{onClick:ge,children:`重置`}),(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(m0,{}),onClick:_e,children:`导出 Excel`})]}),(0,$.jsx)(`div`,{style:{marginBottom:12,padding:`8px 16px`,background:`#f8f9fc`,borderRadius:8,display:`flex`,gap:24,flexWrap:`wrap`,fontSize:13},children:(0,$.jsxs)(`span`,{children:[`总消耗积分:`,(0,$.jsx)(`strong`,{style:{color:`#ef4444`,fontSize:15},children:ae?.totalConsume??0})]})}),(0,$.jsxs)(`div`,{style:we,children:[(0,$.jsx)(LQ,{rowKey:`id`,loading:K,dataSource:G,pagination:!1,bordered:!1,scroll:{x:950},columns:Ce,locale:{emptyText:(0,$.jsx)(XS,{description:`暂无积分记录`})}}),re>0&&(0,$.jsx)(`div`,{style:Te,children:(0,$.jsx)(SG,{current:se,pageSize:10,total:re,onChange:e=>ce(e),size:`small`,showTotal:e=>`共 ${e} 条`})})]})]})},{key:`invitations`,label:(0,$.jsxs)(sH,{children:[(0,$.jsx)(t1,{}),`邀请管理`]}),children:(0,$.jsxs)(`div`,{style:we,children:[(0,$.jsx)(`div`,{style:{padding:16,paddingBottom:0},children:(0,$.jsx)(X,{type:`primary`,icon:(0,$.jsx)(rL,{}),onClick:()=>E(!0),children:`生成邀请码`})}),(0,$.jsx)(LQ,{columns:be,dataSource:b,rowKey:`id`,loading:C,pagination:!1,bordered:!1,scroll:{x:900},locale:{emptyText:(0,$.jsx)(XS,{description:`暂无邀请码`})}})]})},{key:`requests`,label:(0,$.jsxs)(sH,{children:[(0,$.jsx)(E3,{}),`加入申请`,F.length>0&&z===`pending`&&(0,$.jsx)(XQ,{color:`red`,children:F.length})]}),children:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{marginBottom:16,display:`flex`,alignItems:`center`},children:(0,$.jsx)(cz,{value:z,onChange:e=>{B(e),ee(e)},options:[{label:`待处理`,value:`pending`},{label:`已通过`,value:`approved`},{label:`已拒绝`,value:`rejected`},{label:`全部`,value:``}],style:{borderRadius:12,border:`1px solid #e2e8f0`,padding:3,background:`#f8fafc`,boxShadow:`0 2px 8px rgba(0,0,0,0.06)`,"--ant-segmented-item-selected-bg":`#6366f1`,"--ant-segmented-item-selected-color":`#ffffff`},size:`middle`})}),(0,$.jsx)(`div`,{style:we,children:(0,$.jsx)(LQ,{columns:Se,dataSource:F,rowKey:`id`,loading:L,pagination:!1,bordered:!1,scroll:{x:1e3},locale:{emptyText:(0,$.jsx)(XS,{description:z===`pending`?`暂无待审批申请`:`暂无记录`})}})})]})}];return(0,$.jsxs)(`div`,{style:{padding:24},children:[(0,$.jsx)(`div`,{style:{marginBottom:24},children:n?(0,$.jsx)(Q.Text,{type:`secondary`,children:`加载中...`}):e?(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,flexWrap:`wrap`,gap:12},children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(Q.Title,{level:4,style:{margin:0},children:e.name}),(0,$.jsxs)(Q.Text,{type:`secondary`,children:[`代码: `,e.code||`-`,` 成员: `,e.memberCount,` 人`]})]}),(0,$.jsx)(X,{icon:(0,$.jsx)(wq,{}),onClick:()=>{i(),p(),A(),ee(z),he()},children:`刷新`})]}):(0,$.jsx)(Q.Text,{type:`secondary`,children:`无法获取团队信息`})}),(0,$.jsx)(TL,{items:Ee,activeKey:V,onChange:H,size:`large`}),(0,$.jsx)(mK,{title:(0,$.jsxs)(sH,{children:[(0,$.jsx)($8,{}),`调整成员积分 - `,m.member?.username]}),open:m.open,confirmLoading:_,onOk:y,onCancel:()=>h({open:!1,member:null}),okText:`确认`,width:480,children:(0,$.jsxs)(tU,{form:g,layout:`vertical`,style:{marginTop:16},initialValues:{direction:`increase`},children:[(0,$.jsxs)(`div`,{style:{marginBottom:16,padding:`10px 16px`,background:`#f0f4ff`,borderRadius:8,display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[(0,$.jsx)(Q.Text,{type:`secondary`,children:`我的当前积分`}),(0,$.jsx)(Q.Text,{strong:!0,style:{fontSize:20,color:`#6366f1`},children:_7.getState().user?.credits?.toFixed(2)??`0.00`})]}),(0,$.jsx)(tU.Item,{name:`direction`,label:`操作类型`,rules:[{required:!0,message:`请选择操作类型`}],children:(0,$.jsxs)(jI.Group,{buttonStyle:`solid`,size:`large`,style:{width:`100%`},children:[(0,$.jsx)(jI.Button,{value:`increase`,style:{width:`50%`,textAlign:`center`},children:`增加成员积分`}),(0,$.jsx)(jI.Button,{value:`decrease`,style:{width:`50%`,textAlign:`center`},children:`扣减成员积分`})]})}),(0,$.jsx)(tU.Item,{name:`amount`,label:`积分数量`,required:!0,rules:[{required:!0,message:`请输入积分数量`},{type:`number`,min:.01,message:`必须大于 0`},{type:`number`,max:9999999,message:`单次不能超过 9999999`}],validateTrigger:[`onChange`,`onBlur`],children:(0,$.jsx)(Yz,{style:{width:`100%`},step:1,min:.01,max:9999999,precision:2,placeholder:`请输入正数积分数量`,size:`large`,formatter:e=>{if(!e)return``;let t=`${e}`.replace(/[^0-9.]/g,``);return t=t.replace(/^0+(?=\d)/,``),t},parser:e=>{if(!e||e===`.`)return``;let t=parseFloat(e);return isNaN(t)||t<=0?``:Math.min(t,9999999)},onKeyDown:e=>{(e.key===`-`||e.key===`e`||e.key===`E`)&&e.preventDefault()},onChange:e=>{e??g.validateFields([`amount`])}})}),(0,$.jsx)(tU.Item,{name:`description`,label:`备注`,children:(0,$.jsx)(IW.TextArea,{rows:2,maxLength:256,placeholder:`选填,例如:活动奖励`})})]})}),(0,$.jsx)(mK,{title:(0,$.jsxs)(sH,{children:[(0,$.jsx)(t1,{}),`生成邀请码`]}),open:T,confirmLoading:O,onOk:j,onCancel:()=>{E(!1),D.resetFields()},okText:`生成`,width:480,children:(0,$.jsxs)(tU,{form:D,layout:`vertical`,style:{marginTop:16},children:[(0,$.jsx)(tU.Item,{name:`maxUses`,label:`最大使用次数`,children:(0,$.jsx)(Yz,{style:{width:`100%`},min:1,placeholder:`留空表示不限`,size:`large`})}),(0,$.jsxs)(`div`,{style:{padding:`12px 16px`,background:`#eef2ff`,borderRadius:8,fontSize:13,color:`#4f46e5`,display:`flex`,alignItems:`center`,gap:8},children:[(0,$.jsx)(cV,{}),(0,$.jsxs)(`span`,{children:[`邀请码自生成起 `,(0,$.jsx)(`strong`,{children:`24 小时`}),` 内有效,过期自动失效。`]})]})]})})]})},uce=()=>{let[e]=On(),t=Ye(),n=e.get(`code`)||``,{user:r,loading:i,checkAuth:a}=_7(),[o,s]=(0,S.useState)(!0),[c,l]=(0,S.useState)(null),[u,d]=(0,S.useState)(!1),[f,p]=(0,S.useState)(!1),[m,h]=(0,S.useState)(!1),[g,_]=(0,S.useState)(`VideoGen.AI`),[v,y]=(0,S.useState)(``);return(0,S.useEffect)(()=>{a(),j5().then(e=>{_(e.siteName),y(e.siteLogo)}).catch(()=>{})},[a]),(0,S.useEffect)(()=>{if(!n){s(!1);return}i||(s(!0),(r?Jae(n):Yae(n)).then(e=>{l(e),e?.valid&&r&&!e.alreadyInTeam&&!e.hasPendingRequest&&h(!0)}).catch(()=>l(null)).finally(()=>s(!1)))},[n,r,i]),i||o?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,alignItems:`center`,minHeight:`60vh`},children:(0,$.jsx)(UG,{size:`large`})}):f?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:40},children:(0,$.jsx)(Jq,{status:`success`,icon:(0,$.jsx)(d4,{style:{color:`#6366f1`}}),title:`申请已提交`,subTitle:`您的加入申请已提交,请等待团队管理人审批。审批通过后将自动加入团队。`,extra:(0,$.jsx)(sH,{children:(0,$.jsx)(X,{type:`primary`,onClick:()=>t(`/projects`),children:`返回首页`})})})}):!n||!c?.valid?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:40},children:(0,$.jsx)(Jq,{status:`error`,title:`邀请链接无效`,subTitle:`该邀请链接可能已过期或不存在,请联系团队管理人重新获取。`,extra:(0,$.jsx)(X,{type:`primary`,onClick:()=>t(`/projects`),children:`返回首页`})})}):c.alreadyInTeam?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:40},children:(0,$.jsx)(Jq,{status:`info`,title:`您已在此团队中`,subTitle:`您已经是「${c.teamName}」的成员了,无需再次加入。`,extra:(0,$.jsx)(sH,{children:(0,$.jsx)(X,{type:`primary`,onClick:()=>t(`/projects`),children:`返回首页`})})})}):c.hasPendingRequest?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:40},children:(0,$.jsx)(Jq,{status:`info`,title:`申请待审批`,subTitle:`您已提交加入「${c.teamName}」的申请,请等待团队管理人审批。`,extra:(0,$.jsx)(sH,{children:(0,$.jsx)(X,{type:`primary`,onClick:()=>t(`/projects`),children:`返回首页`})})})}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:`40px 20px`},children:(0,$.jsxs)(`div`,{style:{width:`100%`,maxWidth:480},children:[(0,$.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,gap:12,marginBottom:32},children:[v?(0,$.jsx)(`img`,{src:v,alt:`logo`,style:{width:40,height:40,borderRadius:10}}):(0,$.jsx)(`div`,{style:{width:40,height:40,borderRadius:10,background:`linear-gradient(135deg, #6366f1, #8b5cf6)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,$.jsx)(W8,{style:{fontSize:20,color:`#fff`}})}),(0,$.jsx)(`span`,{style:{fontSize:22,fontWeight:700,color:`#1e293b`,letterSpacing:.5},children:g})]}),(0,$.jsxs)(DL,{variant:`outlined`,style:{borderRadius:16,width:`100%`,textAlign:`center`},children:[(0,$.jsx)(H8,{style:{fontSize:48,color:`#6366f1`,marginBottom:16}}),(0,$.jsx)(Q.Title,{level:3,children:`加入团队`}),(0,$.jsx)(Q.Text,{style:{fontSize:16,color:`#475569`,display:`block`,marginBottom:8},children:`您被邀请加入团队`}),(0,$.jsxs)(Q.Title,{level:4,style:{color:`#6366f1`,margin:`16px 0 24px`},children:[`「`,c.teamName,`」`]}),(0,$.jsx)(Q.Text,{type:`secondary`,style:{display:`block`,marginBottom:24},children:`加入后团队管理人可以为您分配积分、查看您的积分使用情况。`}),r?(0,$.jsx)(X,{type:`primary`,size:`large`,block:!0,loading:u,onClick:()=>h(!0),children:`申请加入`}):(0,$.jsxs)(sH,{direction:`vertical`,style:{width:`100%`},size:12,children:[(0,$.jsx)(X,{type:`primary`,size:`large`,block:!0,icon:(0,$.jsx)($3,{}),onClick:()=>{t(`/login?redirect=${encodeURIComponent(window.location.pathname+window.location.search)}`)},children:`登录后申请加入`}),(0,$.jsx)(X,{size:`large`,block:!0,icon:(0,$.jsx)(Zre,{}),onClick:()=>{t(`/login?tab=register&redirect=${encodeURIComponent(window.location.pathname+window.location.search)}`)},children:`注册新账号`}),(0,$.jsx)(Q.Text,{type:`secondary`,style:{fontSize:12},children:`登录或注册后将自动提交加入申请`})]})]})]})}),(0,$.jsxs)(mK,{title:(0,$.jsxs)(sH,{children:[(0,$.jsx)(H8,{style:{color:`#6366f1`}}),`确认加入团队`]}),open:m,onOk:async()=>{if(n)try{d(!0),await Xae(n),p(!0),h(!1),Z.success(`申请已提交`)}catch(e){Z.error(e?.message||`申请失败`)}finally{d(!1)}},onCancel:()=>h(!1),okText:`确认加入`,cancelText:`取消`,confirmLoading:u,width:420,children:[(0,$.jsxs)(`p`,{style:{marginBottom:0},children:[`您确定要加入团队 `,(0,$.jsxs)(`strong`,{style:{color:`#6366f1`},children:[`「`,c.teamName,`」`]}),` 吗?`]}),(0,$.jsx)(`p`,{style:{marginTop:8,color:`#64748b`,fontSize:13},children:`提交后需等待团队管理人审批,审批通过后将自动加入团队。`})]})]})},dce=new Set([`group_active`,`callback_success`]),fce=()=>{let e=(0,S.useMemo)(()=>new URLSearchParams(window.location.search),[]),t=e.get(`status`)||``,n=e.get(`resultCode`)||``,r=dce.has(t)||n===`10000`;return(0,$.jsx)(`div`,{style:{minHeight:`100vh`,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`#f8fafc`,padding:20},children:(0,$.jsxs)(DL,{style:{width:`100%`,maxWidth:520,borderRadius:18},children:[(0,$.jsx)(Jq,{status:r?`success`:`error`,title:r?`真人认证已完成`:`真人认证未完成`,subTitle:r?`请回到电脑端查看,项目组已创建成功。`:`请回到电脑端重新发起创建项目组。`,extra:[(0,$.jsx)(X,{type:`primary`,onClick:()=>{let e=/MicroMessenger/i.test(navigator.userAgent),t=/AlipayClient/i.test(navigator.userAgent),n=/Android|iPhone|iPad/i.test(navigator.userAgent);if(e)try{window.opener=null,window.open(``,`_self`),window.close()}catch{Z.info(`请点击右上角关闭按钮`)}else if(t)try{window.close()}catch{Z.info(`请点击左上角返回`)}else if(n)try{window.history.back()}catch{window.location.href=`/`}else try{window.close()}catch{window.location.href=`/`}},children:`关闭页面`},`close`)]}),(0,$.jsx)(Q.Paragraph,{type:`secondary`,style:{textAlign:`center`,marginBottom:0,fontSize:13,marginTop:12},children:`如无法自动关闭,请手动关闭页面`})]})})};bE.default.locale(`zh-cn`);var pce=({children:e})=>{let{user:t,loading:n,checkAuth:r}=_7();return(0,S.useEffect)(()=>{!localStorage.getItem(`auth_token`)&&!n&&!t&&(window.location.href=`/login`)},[t,n]),n?(0,$.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,alignItems:`center`,height:`100vh`},children:(0,$.jsx)(UG,{size:`large`})}):t?(0,$.jsx)($.Fragment,{children:e}):(window.location.href=`/login`,null)};(0,_.createRoot)(document.getElementById(`root`)).render((0,$.jsx)(()=>{let{checkAuth:e}=_7();return(0,S.useEffect)(()=>{e()},[]),(0,$.jsx)(Fm,{locale:M0.default,theme:{token:{colorPrimary:`#6366f1`,borderRadius:8,fontFamily:`'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif`},components:{Button:{controlHeight:36,controlHeightLG:44},Card:{boxShadow:`0 1px 3px rgba(0,0,0,0.04)`},Table:{headerBg:`#fafbfc`}}},children:(0,$.jsx)(Vb,{children:(0,$.jsx)(_n,{children:(0,$.jsxs)(Dt,{children:[(0,$.jsx)(Tt,{path:`/login`,element:(0,$.jsx)(roe,{})}),(0,$.jsx)(Tt,{path:`/join-team`,element:(0,$.jsx)(uce,{})}),(0,$.jsx)(Tt,{path:`/private-portrait-authorized`,element:(0,$.jsx)(fce,{})}),(0,$.jsxs)(Tt,{path:`/`,element:(0,$.jsx)(pce,{children:(0,$.jsx)(toe,{})}),children:[(0,$.jsx)(Tt,{index:!0,element:(0,$.jsx)(Ct,{to:`/projects`,replace:!0})}),(0,$.jsx)(Tt,{path:`projects`,element:(0,$.jsx)(ooe,{})}),(0,$.jsx)(Tt,{path:`projects/:projectId/generate`,element:(0,$.jsx)(goe,{})}),(0,$.jsx)(Tt,{path:`records`,element:(0,$.jsx)(_oe,{})}),(0,$.jsx)(Tt,{path:`credits`,element:(0,$.jsx)(voe,{})}),(0,$.jsx)(Tt,{path:`credit-records`,element:(0,$.jsx)(H7,{})}),(0,$.jsx)(Tt,{path:`order-records`,element:(0,$.jsx)(H7,{})}),(0,$.jsx)(Tt,{path:`user-center`,element:(0,$.jsx)(H7,{})}),(0,$.jsx)(Tt,{path:`messages`,element:(0,$.jsx)(xoe,{})}),(0,$.jsx)(Tt,{path:`home`,element:(0,$.jsx)(tce,{})}),(0,$.jsx)(Tt,{path:`conversation`,element:(0,$.jsx)(nse,{})}),(0,$.jsx)(Tt,{path:`initial`,element:(0,$.jsx)(sse,{})}),(0,$.jsx)(Tt,{path:`initial/:creatID/initialinfo`,element:(0,$.jsx)(pse,{})}),(0,$.jsx)(Tt,{path:`removelens`,element:(0,$.jsx)(gse,{})}),(0,$.jsx)(Tt,{path:`removelens/:creatID/removeinfo`,element:(0,$.jsx)(Yse,{})}),(0,$.jsx)(Tt,{path:`removelens/:creatID/removefenbu`,element:(0,$.jsx)(X9,{})}),(0,$.jsx)(Tt,{path:`generated`,element:(0,$.jsx)(Tse,{})}),(0,$.jsx)(Tt,{path:`pretest`,element:(0,$.jsx)(Dse,{})}),(0,$.jsx)(Tt,{path:`authorization`,element:(0,$.jsx)(kse,{})}),(0,$.jsx)(Tt,{path:`authoriza-waiting`,element:(0,$.jsx)(ice,{})}),(0,$.jsx)(Tt,{path:`materials`,element:(0,$.jsx)(Lse,{})}),(0,$.jsx)(Tt,{path:`materials/private-portrait-virtual`,element:(0,$.jsx)(Ct,{to:`/generated?filterType=private_portrait&portraitTab=aigc_virtual`,replace:!0})}),(0,$.jsx)(Tt,{path:`consume`,element:(0,$.jsx)(rce,{})}),(0,$.jsx)(Tt,{path:`popular`,element:(0,$.jsx)(ace,{})}),(0,$.jsx)(Tt,{path:`authacc`,element:(0,$.jsx)(jse,{})}),(0,$.jsx)(Tt,{path:`creativeplaza`,element:(0,$.jsx)(oce,{})}),(0,$.jsx)(Tt,{path:`team-management`,element:(0,$.jsx)(lce,{})})]}),(0,$.jsx)(Tt,{path:`*`,element:(0,$.jsx)(Ct,{to:`/projects`,replace:!0})})]})})})})},{})); \ No newline at end of file diff --git a/video-gen-app/dist/index.html b/video-gen-app/dist/index.html index bcd1d5e3..0849d404 100644 --- a/video-gen-app/dist/index.html +++ b/video-gen-app/dist/index.html @@ -28,8 +28,8 @@ } })(); - - + +
diff --git a/video-gen-app/src/components/Layout/AppLayout.tsx b/video-gen-app/src/components/Layout/AppLayout.tsx index 0acf8d84..387c0645 100644 --- a/video-gen-app/src/components/Layout/AppLayout.tsx +++ b/video-gen-app/src/components/Layout/AppLayout.tsx @@ -66,6 +66,8 @@ import { useAuthStore } from '../../store/useAuthStore'; import { getMenuConfigs, getRechargePackages, getPaymentMethods, createRechargeOrder, getPaymentOrder, cancelPaymentOrder, getSiteInfo, getUnreadCount, createContactRequest, getUser, changePassword, changeUsername } from '../../api'; import NotificationPopup from '../NotificationPopup'; import './AppLayout.css'; +import bg1 from '../../assets/bg1.png'; + // ── ResourceCapacity 类型(与 src/types/index.ts 保持一致) ── type ResourceCapacityData = { @@ -153,9 +155,9 @@ const StorageCard: React.FC<{ data: ResourceCapacityData | null }> = ({ data }) {data.enabled ? ( <> ) : ( - + - + 当前使用 {usedAuto.val} {usedAuto.unit} @@ -163,7 +165,7 @@ const StorageCard: React.FC<{ data: ResourceCapacityData | null }> = ({ data }) {data.enabled && ( <> - +
= ({ data }) fontSize: 12, color: isOver ? '#000000ff' : '#000000ff', padding: '0 8px', - + }}> - + {rawPercent.toFixed(1)}% {data.enabled ? ( @@ -206,7 +208,7 @@ const StorageCard: React.FC<{ data: ResourceCapacityData | null }> = ({ data }) : `剩余 ${available.toFixed(2)} ${unit}`} */} {/* {rawPercent.toFixed(1)}% */} - +
= ({ data }) borderRadius: 50, overflow: 'hidden', position: 'relative', - + }} > - +
{ }; return ( - +
{ animation: 'borderShimmer 2.5s linear infinite', pointerEvents: 'none', }} /> - + } style={{ background: 'linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)', @@ -979,7 +984,7 @@ const AppLayout: React.FC = () => { animation: 'creditGlow 1.5s ease-in-out infinite', }}>积分: {user?.credits || 0}
- +
{ }}>
- +