PageSourceSearch

https://meloty.ai/_nuxt/Cz4n60eI.js

js meloty.ai collected 2026-10-05 14:56:44 UTC 11,777 bytes, 1 lines download raw bytes

1import{a as Pe}from"./CkMVqNS-.js";import{O as Je,u as Ee,a as Ae,S as ze,V as Ge,b as $e,r as g,am as Be,p as Fe,k as E,s as K,t as we,o as He,a9 as v,f as L,g as h,z as f,B as b,y as j,T as ie,v as A,l as r,x as T,H as Ke,an as Qe,Q as oe,j as ne,ap as Ye,C as qe,$ as re,a0 as We,aB as Xe,aC as Ze,b9 as et,L as tt}from"#entry";import{_ as it,u as se,g as ot,l as nt,c as rt,a as st}from"./BLqrvU2F.js";import{_ as at}from"./KiJqPDkQ.js";import{u as lt}from"./C8xx2_84.js";import"./D2XkZG31.js";import"./tt7Tzpiz.js";import"./nB_ZMyDn.js";import"./CigmA4o3.js";import"./BSkXbdsh.js";import"./BgKqAQUU.js";import"./Dfxjlz8d.js";import"./COI-fY5B.js";const ct=["aria-label"],ut={key:0,class:"generate-lip-sync-layout"},dt={class:"generate-lip-sync-left"},ft={class:"generate-lip-sync-left__header"},pt={class:"generate-lip-sync-left__title"},mt={class:"generate-lip-sync-left__body"},vt={class:"generate-lip-sync-left__footer"},yt={key:0,class:"generate-lip-sync-right"},gt={class:"generate-lip-sync-right__header"},_t={class:"generate-lip-sync-right__title"},ht={class:"generate-lip-sync-right__body"},St=["aria-busy"],Mt={key:1,class:"generate-lip-sync-empty"},bt={key:0,class:"generateLipSync-loading-mask"},Vt={class:"generateLipSync-loading-content"},It={key:0,class:"generateLipSync-loading-text"},ae="meloty_character_recent_used",Lt={__name:"[id]",setup(xt){const Q=Ee(),le=Ae(),z=ze(),{t:l}=Ge(),{isTemp:x}=lt(),ce=$e(),p=g(String(Q.params.id||"")),S=g(0),i=Be({type:"lip-sync",version:"v1",style:{image_url:""},music:null,character:null,resolution:"720p",aspectRatio:"16:9",videoModel:"",idea:""}),Y=Fe(),M=g(!1),N=g(!0),m=g([]),V=new Map,R=g(!1),D=g({}),_=g(!1),k=g(null);E(()=>M.value);const q=E(()=>M.value?l("base.processing"):""),ue=["16:9","4:3","3:4","9:16"],de=["720p","1080p"];function fe(e=[]){if(!e||!e.length)return;const t=Date.now();let o={};try{const n=localStorage.getItem(ae);if(n){const s=JSON.parse(n);s&&typeof s=="object"&&(o=s)}}catch{o={}}for(const n of e){if(n==null||n==="auto")continue;const s=String(n);s&&(o[s]=t)}try{localStorage.setItem(ae,JSON.stringify(o))}catch{}}const O=E(()=>z.videoModelList||[]),U=g(null);function pe(e){const t=Number(e||0);return t?t>1e3?Math.round(t/1e3):Math.round(t):0}function me(e){if(!e)return{};if(typeof e=="object")return e;try{return JSON.parse(e)}catch{return{}}}function ve(e="",t=""){const o=(O.value||[]).find(d=>String(d?.modelVersion||"")===String(e||"")),s=me(o?.json)?.lip_sync||{},u=Number(s.duration_mode||1);let c=0;if(u===2){const d=s.max_duration_by_resolution||{},y=String(t||"").trim();c=Number(y&&d[y]?d[y]:0)}return c||(c=Number(s.max_duration||0)),!Number.isFinite(c)||c<=0?0:Math.max(0,Math.round(c))}function ye(e){const t=Math.max(0,Math.round(Number(e||0)));return t?l("error.lipSyncDurationExceeded",{seconds:t}):""}function C(e){e&&(i.type=e.type||"lip-sync",i.version=e.version||"v1",e.style&&typeof e.style=="object"&&Object.assign(i.style,e.style),i.music=e.music||null,i.character=e.character||null,i.resolution=e.resolution||i.resolution,i.aspectRatio=e.aspectRatio||i.aspectRatio,i.videoModel=e.videoModel||i.videoModel,i.idea=e.idea||i.idea)}function ge(e){const t=String(e||"").trim();return t?t.replace(/[`"]/g,"").trim():""}function G(...e){for(const t of e){const o=ge(t);if(o)return o}return""}function I(e={}){return Number(e.musicVideoId||e.music_video_id||e.id||0)}function _e(e){const t=String(e||"").toLowerCase();return["succeeded","failed","timeouted","cancelled"].includes(t)}function $(e={}){const t=Number(e.status??-1);return t===1||t===4?!0:_e(e.generate_status||e.generateStatus)}function he(e){if(!e)return{};if(typeof e=="object")return e;if(typeof e!="string")return{};try{return JSON.parse(e)}catch{return{}}}function W(e={}){const t=he(e.json),o={...e||{},json:t};return!o.videoUrl&&t.videoUrl&&(o.videoUrl=t.videoUrl),o}function Se(e){const t=Array.isArray(e)?e:[];if(!t.length)return;const n=[...m.value||[]];t.forEach(s=>{const u=W(s||{}),c=I(u);if(!c)return;const d=n.findIndex(y=>I(y)===c);d>-1?n[d]={...n[d]||{},...u||{}}:n.unshift(u)}),m.value=n}function Me(e,t){if(!e)return;const o=m.value||[],n=o.findIndex(u=>I(u)===e);if(n<0)return;const s=[...o];s[n]={...s[n]||{},...t||{}},m.value=s}function be(e){D.value=e||{},R.value=!0}function Ve(e){const t=Number(e||0);t&&(m.value=(m.value||[]).filter(o=>I(o)!==t),Number(D.value?.id||D.value?.musicVideoId||0)===t&&(R.value=!1,D.value={}))}function B(e){const t=String(e||"");if(!t)return;const o=V.get(t);o&&(o.timerId&&clearTimeout(o.timerId),V.delete(t))}
1function Ie(){V.forEach(e=>{e&&e.timerId&&clearTimeout(e.timerId)}),V.clear()}function Le(e){const t=String(e||"");if(!t||V.has(t))return;const o={timerId:null,attempts:0,inFlight:!1};V.set(t,o);const n=(u=5e3)=>{o.timerId=setTimeout(s,u)},s=async()=>{if(!V.has(t))return;if(o.inFlight){n();return}const u=(m.value||[]).find(c=>String(I(c))===t);if(!u){B(t);return}if($(u)){B(t);return}o.inFlight=!0,o.attempts+=1;try{const c=await st({id:Number(t)}),d=W(c?.data||{});if(Me(Number(t),d),$(d)){B(t);return}n()}catch{n()}finally{o.inFlight=!1}};n(0)}function X(e){(Array.isArray(e)?e:[]).forEach(t=>{const o=I(t);o&&($(t)||Le(o))})}async function Z(){if(!(!p.value||x(p.value))){N.value=!0;try{const{data:e}=await nt({sid:p.value});S.value=Number(e?.id||e?.lipSyncGenerateId||0);const t=e?.json;if(_.value=!0,t&&typeof t=="object")C(t);else if(t&&typeof t=="string")try{C(JSON.parse(t))}catch{}else C(e||{});await tt(),_.value=!1,m.value=e?.musicVideoList||e?.music_video_list||[],X(m.value)}catch{m.value=[]}finally{_.value=!1,N.value=!1}}}function xe(){_.value||M.value||x(p.value)||S.value&&(k.value&&clearTimeout(k.value),k.value=setTimeout(()=>{Ne()},600))}async function Ne(){if(!_.value&&!M.value&&!x(p.value)&&S.value)try{await se({id:S.value,type:i.type,version:i.version,idea:i.idea||"",aspectRatio:i.aspectRatio,resolution:i.resolution,videoModelVersion:i.videoModel,json:P()})}catch{}}const Ue=E(()=>JSON.stringify({style:i.style,music:i.music,character:i.character,resolution:i.resolution,aspectRatio:i.aspectRatio,videoModel:i.videoModel,idea:i.idea}));K(Ue,()=>{xe()});function P(){try{return JSON.parse(JSON.stringify(i))}catch{return{}}}function je(e){return e===!0||e===1||e==="1"||e==="true"}function Re(e={}){const t=pe(e.durationSeconds||e.duration_seconds||e.duration||e.length||0);return Number(t||0)}function De(e={}){return G(e.reference_url,e.referenceUrl,e.music_url,e.musicUrl,e.url,e.audioUrl)}function ke(e={}){return G(e.image_url,e.imageUrl,e.image,e.url)}function Ce(e={}){return G(e.image_url,e.imageUrl,e.url)}function Te(e={}){return String(e.imageModelVersion||e.image_model_version||e.image_modelVersion||"").trim()}async function Oe(){if(S.value)return S.value;const e={type:i.type,version:i.version,idea:i.idea||"",json:P(),aspectRatio:i.aspectRatio,resolution:i.resolution,videoModelVersion:i.videoModel},o=(await rt(e))?.data||{};S.value=Number(o?.id||0);const n=o?.sid;if(n&&x(p.value)){try{localStorage.removeItem(p.value)}catch{}p.value=String(n),le.replace(ce(`/generateLipSync/${n}`))}return S.value}function F(){if(M.value)return;if(!i.videoModel){v.error(l("error.modelSelect")),U.value?.openVideoModelPopover?.();return}const e=i.music||{},t=i.character||{},o=i.style||{},n=De(e),s=Re(e),u=ke(t),c=je(o.isOriginal)?1:0,d=Ce(o),y=Te(o),a={clipAudioUrl:n};if(e.json?.stylePrompts&&(a.stylePrompts=e.json.stylePrompts),e.json?.lineLyric&&(a.lineLyric=e.json.lineLyric),e.json?.songDescription&&(a.songDescription=e.json.songDescription),!n){v.error(`${l("create.select")} ${l("video.music")}`),U.value?.openMusicDialog?.("history");return}if(!s){v.error(`${l("create.select")} ${l("video.music")}`),U.value?.openMusicDialog?.("history");return}const w=ve(i.videoModel,i.resolution);if(w&&s>w){v.error(ye(w));return}if(!u){v.error(`${l("create.select")} ${l("video.character")}`),U.value?.openCharacterDialog?.();return}if(!c){if(!d){v.error(l("error.styleSelect")),U.value?.openStyleDialog?.();return}if(!y){v.error(l("error.modelSelect"));return}}M.value=!0,(async()=>{try{const J=await Oe();if(!J){v.error(l("base.failed"));return}try{await se({id:J,type:i.type,version:i.version,idea:i.idea||"",aspectRatio:i.aspectRatio,resolution:i.resolution,videoModelVersion:i.videoModel,json:P()})}catch{}const H={lipSyncGenerateId:J,type:i.type,version:i.version,videoModelVersion:i.videoModel,audioUrl:n,duration:s,resolution:i.resolution,aspectRatio:i.aspectRatio,characterImageUrl:u,useOriginal:c,idea:i.idea||"",json:P(),num:1,musicClip:a};c||(H.styleImageUrl=d,H.imageModelVersion=y),t&&t.id!==void 0&&fe([t.id]);const ee=(await ot(H))?.data||{},te=ee?.musicVideoList||ee?.music_video_list||[];Se(te),X(te),Y.getInfo(),Y.getHistoryList()}catch{v.error(l("base.failed"))}finally{M.value=!1}})()}return we(()=>{Ie(),k.value&&clearTimeout(k.value)}),He(()=>{if(z.videoModelList?.length||z.getVideoModelList(),x(p.value)){const e=localStorage.getItem(p.value);if(e)try{const t=JSON.parse(e);_.value=!0,C(t),_.value=!1,F()}catch{v.error(l("error.ideaSensitive"))}}else Z()}),K(()=>O.value.length,e=>{e&&(i.videoModel||(i.videoModel=O.value[0]?.modelVersion||""))}),K(()=>Q.params.id,e=>{if(e)if(p.value=String(e||""),x(p.value)){const t=localStorage.getItem(p.value);if(t)try{const o=JSON.parse(t);_.value=!0,C(o),_.value=!1,F()}catch{v.error(l("error.ideaSensitive"))}}else Z()},{immediate:!1}),(e,t)=>{const o=Pe,n=Qe,s=it,u=Ye,c=Xe,d=at,y=et;return h(),L(re,null,[f("main",{class:"generateLipSync","aria-label":r(l)("video.lip-sync")},[b(u,{"view-style":{height:"100%"},height:"calc(100%)"},{default:j(()=>[b(ie,{name:"el-fade-in-linear"},{default:j(()=>[r(N)?A("",!0):(h(),L("div",ut,[f("section",dt,[f("header",ft,[f("div",pt,T(r(l)("video.lip-sync")),1)]),f("div",mt,[b(o,{ref_key:"lipSyncInputRef",ref:U,"show-start":!1,style:Ke(r(i).style),"onUpdate:style":t[0]||(t[0]=a=>r(i).style=a),music:r(i).music,"onUpdate:music":t[1]||(t[1]=a=>r(i).music=a),character:r(i).character,"onUpdate:character":t[2]||(t[2]=a=>r(i).character=a),"aspect-ratio":r(i).aspectRatio,"onUpdate:aspectRatio":t[3]||(t[3]=a=>r(i).aspectRatio=a),resolution:r(i).resolution,"onUpdate:resolution":t[4]||(t[4]=a=>r(i).resolution=a),"model-version":r(i).videoModel,"onUpdate:modelVersion":t[5]||
1(t[5]=a=>r(i).videoModel=a),"aspect-ratio-list":ue,"resolution-list":de,"video-model-list":r(O),type:"lip-sync"},null,8,["style","music","character","aspect-ratio","resolution","model-version","video-model-list"])]),f("div",vt,[b(n,{loading:r(M),customStyle:{"border-radius":"12px","font-weight":700,"font-size":"16px"},onClick:F},{default:j(()=>[oe(T(r(l)("create.create")),1)]),_:1},8,["loading"])])]),r(m).length?(h(),L("section",yt,[f("header",gt,[f("div",_t,T(r(l)("create.creations")),1)]),f("div",ht,[r(m).length?(h(),ne(u,{key:0,"view-style":{height:"100%"},height:"calc(100%)",class:"generate-lip-sync-right__scroll"},{default:j(()=>[f("div",{class:qe(["library-grid",{"library-grid--refreshing":r(N)}]),"aria-label":"Library works","aria-busy":r(N)?"true":"false"},[(h(!0),L(re,null,We(r(m),a=>(h(),ne(s,{key:I(a),item:a,onPreview:be,onDeleted:Ve},null,8,["item"]))),128))],10,St)]),_:1})):(h(),L("div",Mt,T(r(l)("base.noData")),1))])])):A("",!0)]))]),_:1})]),_:1}),b(ie,{name:"el-fade-in-linear"},{default:j(()=>[r(N)?(h(),L("div",bt,[f("div",Vt,[b(c,{width:"50",height:"50"}),r(q)?(h(),L("div",It,[oe(T(r(q))+" ",1),t[7]||(t[7]=f("span",{class:"svg-cycle-ellipsis","aria-hidden":"true"},[f("span",null,"."),f("span",null,"."),f("span",null,".")],-1))])):A("",!0)])])):A("",!0)]),_:1})],8,ct),b(y,null,{default:j(()=>[b(d,{visible:r(R),"onUpdate:visible":t[6]||(t[6]=a=>Ze(R)?R.value=a:null),item:r(D)},null,8,["visible","item"])]),_:1})],64)}}},Gt=Je(Lt,[["__scopeId","data-v-acc4350e"]]);export{Gt as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.