@acedatacloud/nexior 2.19.0 → 2.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{Auth.64e0884d.js → Auth.18d3dbd5.js} +1 -1
- package/dist/assets/Callback.b89dfb68.js +1 -0
- package/dist/assets/Chatdoc.63a6a5c8.js +1 -0
- package/dist/assets/Console.7aaee105.js +1 -0
- package/dist/assets/Conversation.4a7dd645.css +1 -0
- package/dist/assets/Conversation.8c058528.js +1 -0
- package/dist/assets/Conversation.ed4ff65e.js +1 -0
- package/dist/assets/CopyToClipboard.6e4cac07.js +1 -0
- package/dist/assets/Detail.31de63ae.js +1 -0
- package/dist/assets/EditArray.08567600.js +1 -0
- package/dist/assets/{Extra.b503c03e.js → Extra.00254e05.js} +1 -1
- package/dist/assets/{History.528eebac.js → History.cc982078.js} +1 -1
- package/dist/assets/{ImageNavigator.8ae3c29d.js → ImageNavigator.7fe0f2bc.js} +1 -1
- package/dist/assets/Index.0c212684.js +1 -0
- package/dist/assets/Index.1095b265.js +1 -0
- package/dist/assets/Index.2c1dcf22.js +1 -0
- package/dist/assets/Index.352d4874.js +1 -0
- package/dist/assets/Index.493dc291.js +1 -0
- package/dist/assets/Index.5a74ff3b.js +1 -0
- package/dist/assets/Index.68e84490.js +1 -0
- package/dist/assets/Index.7c686768.js +1 -0
- package/dist/assets/{Index.78516be3.js → Index.9e8b4725.js} +1 -1
- package/dist/assets/Index.b56d15c8.js +1 -0
- package/dist/assets/Index.bb3c0047.js +3 -0
- package/dist/assets/Index.cbb50d9d.js +1 -0
- package/dist/assets/Index.cd660277.js +1 -0
- package/dist/assets/Index.da3788da.js +1 -0
- package/dist/assets/Index.e9a66783.js +1 -0
- package/dist/assets/{InfoIcon.746e870f.js → InfoIcon.0718f348.js} +1 -1
- package/dist/assets/{Invitees.8db308b3.js → Invitees.6b5b327c.js} +1 -1
- package/dist/assets/{List.f210c6ae.js → List.09132375.js} +1 -1
- package/dist/assets/{List.5c29e93f.js → List.341e4858.js} +1 -1
- package/dist/assets/{List.177ec32f.js → List.73ea2bd7.js} +1 -1
- package/dist/assets/Login.7793d6d2.js +1 -0
- package/dist/assets/{Main.ffbff9fc.js → Main.695c88ad.js} +1 -1
- package/dist/assets/{Manage.d4ab17f1.js → Manage.eead0b8e.js} +1 -1
- package/dist/assets/MarkdownRenderer.4ef5808c.js +1 -0
- package/dist/assets/Navigator.4b986b5a.js +1 -0
- package/dist/assets/{Pagination.34aa4625.js → Pagination.ba076c41.js} +1 -1
- package/dist/assets/Setting.566798d1.js +1 -0
- package/dist/assets/Status.dd04dd16.js +1 -0
- package/dist/assets/{Subscribe.377fd5bc.js → Subscribe.da97f0fe.js} +1 -1
- package/dist/assets/{VideoNavigator.92fd5341.js → VideoNavigator.6d07cfaa.js} +1 -1
- package/dist/assets/chat.af057bac.js +1 -0
- package/dist/assets/{distribution.26850a62.js → distribution.6dfc77cd.js} +1 -1
- package/dist/assets/index.a3bc0f28.js +3 -0
- package/dist/assets/index.ca27ae74.css +1 -0
- package/dist/assets/{order.bbc47927.js → order.cbc3bdd0.js} +1 -1
- package/dist/assets/{price.248044ea.js → price.662dc55d.js} +1 -1
- package/dist/assets/vendor-@vue.66ea933c.js +39 -0
- package/dist/assets/{vendor-element-plus.bb793053.js → vendor-element-plus.6158e0fe.js} +4 -4
- package/dist/assets/{vendor-fortawesome.56f9a0ee.js → vendor-fortawesome.fe21f86d.js} +6 -6
- package/dist/assets/vendor-markdown.b22db477.js +16 -0
- package/dist/assets/vendor-others.2105a885.js +110 -0
- package/dist/assets/{vendor-qrcode.7d3be879.js → vendor-qrcode.46bc4fb1.js} +1 -1
- package/dist/assets/{vendor-vue-dark-switch.1e49b842.js → vendor-vue-dark-switch.02bf2bfe.js} +1 -1
- package/dist/index.html +7 -7
- package/package.json +3 -2
- package/dist/assets/Callback.d1ff3fda.js +0 -1
- package/dist/assets/Chatdoc.ad1bb23a.js +0 -1
- package/dist/assets/Console.6ecf98e7.js +0 -1
- package/dist/assets/Conversation.1b15b0e3.css +0 -1
- package/dist/assets/Conversation.57cd4a9a.js +0 -1
- package/dist/assets/Conversation.b136d1f7.js +0 -1
- package/dist/assets/CopyToClipboard.aaa1969a.js +0 -1
- package/dist/assets/Detail.bbbb293d.js +0 -1
- package/dist/assets/EditArray.855cb2c4.js +0 -1
- package/dist/assets/Index.035b0796.js +0 -1
- package/dist/assets/Index.048731c6.js +0 -1
- package/dist/assets/Index.26604696.js +0 -1
- package/dist/assets/Index.4c7e04ff.js +0 -1
- package/dist/assets/Index.5438ce5d.js +0 -1
- package/dist/assets/Index.62c55f59.js +0 -1
- package/dist/assets/Index.68d8ea99.js +0 -1
- package/dist/assets/Index.958a2510.js +0 -1
- package/dist/assets/Index.9a773bd4.js +0 -3
- package/dist/assets/Index.9fcf59d2.js +0 -1
- package/dist/assets/Index.a57d9a61.js +0 -1
- package/dist/assets/Index.a58823db.js +0 -1
- package/dist/assets/Index.e9964743.js +0 -1
- package/dist/assets/Index.fc0e9c5b.js +0 -1
- package/dist/assets/Login.742c2427.js +0 -1
- package/dist/assets/MarkdownRenderer.d956756a.js +0 -1
- package/dist/assets/Navigator.7038eabf.js +0 -1
- package/dist/assets/Setting.e70603e7.js +0 -1
- package/dist/assets/Status.a2dea48a.js +0 -1
- package/dist/assets/chat.9dd962f4.js +0 -1
- package/dist/assets/index.1562347c.css +0 -1
- package/dist/assets/index.c5936939.js +0 -3
- package/dist/assets/vendor-@vue.37ef86f0.js +0 -18
- package/dist/assets/vendor-markdown.adb5f0c8.js +0 -15
- package/dist/assets/vendor-others.908494e8.js +0 -107
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./vendor-others.908494e8.js";import{aq as j}from"./vendor-fortawesome.56f9a0ee.js";import{_ as w,M as ne,T as L,F as ie,aV as le}from"./index.c5936939.js";import{R as re,l as B,N as ce,J as T,I as de,H as pe,X as me,Y as ue,s as oe,B as he,y as _e,T as ge}from"./vendor-element-plus.bb793053.js";import{H as I,al as r,o as n,e as c,f as d,I as M,V as t,M as u,U as l,T as v,W as E,ai as A,L as D,S as $,Q as U,m as fe}from"./vendor-@vue.37ef86f0.js";import{I as ve}from"./InfoIcon.746e870f.js";import{A as $e,i as ye,h as be}from"./Status.a2dea48a.js";import{C as ke}from"./CopyToClipboard.aaa1969a.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.7d3be879.js";const we=I({name:"LayoutHeadshots",components:{ElDrawer:re,ElButton:B,FontAwesomeIcon:j},data(){return{drawer:!1}}}),Ie={class:"main"},Se={class:"config"},Te={class:"result"};function Ve(e,s,a,o,_,g){const p=r("font-awesome-icon"),h=r("el-button"),i=r("el-drawer");return n(),c("div",Ie,[d("div",Se,[M(e.$slots,"config",{},void 0,!0)]),d("div",Te,[M(e.$slots,"result",{},void 0,!0)]),t(h,{round:"",class:"menu",onClick:s[0]||(s[0]=m=>e.drawer=!0)},{default:u(()=>[t(p,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),t(i,{modelValue:e.drawer,"onUpdate:modelValue":s[1]||(s[1]=m=>e.drawer=m),"with-header":!1,size:"340px",class:"drawer"},{default:u(()=>[M(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var Ce=w(we,[["render",Ve],["__scopeId","data-v-3e896eaa"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Headshots.vue"]]);const Ee=I({name:"ImageUrlsInput",components:{ElUpload:ce,ElButton:B,InfoIcon:ve},data(){return{fileList:[],uploadUrl:ne()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>{var s;return(s=e==null?void 0:e.response)==null?void 0:s.file_url})},value:{get(){var e,s;return(s=(e=this.$store.state.headshots)==null?void 0:e.config)==null?void 0:s.image_urls},set(e){var a;const s=this.urls;this.$store.commit("headshots/setConfig",{...(a=this.$store.state.headshots)==null?void 0:a.config,image_urls:s})}}},mounted(){this.value||(this.value=void 0),this.onSetImageUrls()},methods:{onExceed(){T.warning(this.$t("headshots.message.uploadImageExceed"))},onError(){T.error(this.$t("headshots.message.uploadImageError"))},onSetImageUrls(){var s;const e=this.urls;this.$store.commit("headshots/setConfig",{...(s=this.$store.state.headshots)==null?void 0:s.config,image_urls:e})},async onSuccess(){this.onSetImageUrls()}}}),Ae={class:"field"},Ge={class:"title font-bold"},Pe={class:"upload-wrapper"};function Ne(e,s,a,o,_,g){const p=r("el-button"),h=r("el-upload"),i=r("info-icon");return n(),c("div",Ae,[d("h2",Ge,l(e.$t("headshots.name.endImageUrls")),1),d("div",Pe,[t(h,{"file-list":e.fileList,"onUpdate:file-list":s[0]||(s[0]=m=>e.fileList=m),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"value","show-file-list":!0,limit:2,multiple:!0,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{default:u(()=>[t(p,{size:"small",type:"primary",round:""},{default:u(()=>[v(l(e.$t("headshots.button.uploadImageUrls")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])]),t(i,{content:e.$t("headshots.description.endImageUrls"),class:"info"},null,8,["content"])])}var Ue=w(Ee,[["render",Ne],["__scopeId","data-v-69ae8722"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/config/ImageUrlsInput.vue"]]);const Re="fast",De=I({name:"ModeSelector",components:{ElRadioButton:de,ElRadioGroup:pe},data(){return{options:[{label:this.$t("headshots.button.fast"),value:"fast"},{label:this.$t("headshots.button.relax"),value:"relax"}]}},computed:{value:{get(){var e;return(e=this.$store.state.headshots.config)==null?void 0:e.mode},set(e){console.debug("set mode",e),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots.config,mode:e})}}},mounted(){this.value||(this.value=Re)}}),Le={class:"field"},Me={class:"title font-bold"};function je(e,s,a,o,_,g){const p=r("el-radio-button"),h=r("el-radio-group");return n(),c("div",Le,[d("h2",Me,l(e.$t("headshots.name.mode")),1),t(h,{modelValue:e.value,"onUpdate:modelValue":s[0]||(s[0]=i=>e.value=i),size:"small",class:"mode"},{default:u(()=>[(n(!0),c(E,null,A(e.options,i=>(n(),D(p,{key:i.value,label:i.value},{default:u(()=>[v(l(i.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])])}var Be=w(De,[["render",je],["__scopeId","data-v-5ec8e3d9"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/config/ModeSelector.vue"]]);const Oe=I({name:"StylizeSelector",components:{ElTabs:me,ElTabPane:ue,ElImage:oe},data(){return{tab:"styles",value:"",elements:{styles:{displayName:this.$t("headshots.styleCategory.styles"),items:[{image:"https://static.aipedias.com/aicamera/common/20241008/20241008202314260779439.png",label:this.$t("headshots.styleTag.malePportrait"),value:"male_portrait"},{image:"https://static.aipedias.com/aicamera/common/20241008/202410082022241e9755548.png",label:this.$t("headshots.styleTag.malePportrait2"),value:"male_portrait2"},{image:"https://static.aipedias.com/aicamera/common/20241101/20241101170130d78f66521.png",label:this.$t("headshots.styleTag.kindergarten"),value:"kindergarten"},{image:"https://static.aipedias.com/aicamera/common/20240923/20240923123233accf60398.webp",label:this.$t("headshots.styleTag.logoTshirt"),value:"logo_tshirt"},{image:"https://static.aipedias.com/aicamera/common/20241025/202410252012329472d0656.jpg",label:this.$t("headshots.styleTag.wedding"),value:"wedding"},{image:"https://static.aipedias.com/aicamera/common/20240915/20240915145045254931400.webp",label:this.$t("headshots.styleTag.businessPphoto"),value:"business_photo"},{image:"https://static.aipedias.com/aicamera/common/20240810/20240810194526040341795.jpg",label:this.$t("headshots.styleTag.bobSuit"),value:"bob_suit"},{image:"https://static.aipedias.com/aicamera/common/20240717/20240717152654e0b348173.webp",label:this.$t("headshots.styleTag.femalePortrait"),value:"female_portrait"}]}}}},watch:{value(e){var s;console.debug("set template",e),this.$store.commit("headshots/setConfig",{...(s=this.$store.state.headshots)==null?void 0:s.config,template:e})}},mounted(){var e;this.value||(this.value=""),console.debug("set template",this.value),this.$store.commit("headshots/setConfig",{...(e=this.$store.state.headshots)==null?void 0:e.config,template:this.value})},methods:{onToggle(e){var s;this.value===e?this.value="":this.value=e,console.debug("set template",this.value),this.$store.commit("headshots/setConfig",{...(s=this.$store.state.headshots)==null?void 0:s.config,template:this.value})}}}),ze={class:"field"},He=["onClick"],qe={class:"name"};function Fe(e,s,a,o,_,g){const p=r("el-image"),h=r("el-tab-pane"),i=r("el-tabs");return n(),c("div",ze,[$(` <h2 class="title">{{ $t('headshots.field.elements') }}</h2> `),t(i,{modelValue:e.tab,"onUpdate:modelValue":s[0]||(s[0]=m=>e.tab=m)},{default:u(()=>[(n(!0),c(E,null,A(e.elements,(m,f)=>(n(),D(h,{key:f,label:m.displayName,name:f,class:"pane"},{default:u(()=>[(n(!0),c(E,null,A(m.items,(k,V)=>(n(),c("div",{key:V,class:U({item:!0,active:e.value===k.value}),onClick:C=>e.onToggle(k.value)},[t(p,{src:k.image,fit:"fill",class:"preview"},null,8,["src"]),d("span",qe,l(k.label),1)],10,He))),128))]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])])}var Je=w(Oe,[["render",Fe],["__scopeId","data-v-7e0125ad"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/config/ElementsSelector.vue"]]);const Qe=I({name:"PresetPanel",components:{ModeSelector:Be,ImageUrlsInput:Ue,ElButton:B,FontAwesomeIcon:j,ElementsSelector:Je},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.headshots)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),We={class:"panel"},Xe={class:"config"},Ye={class:"actions"};function Ke(e,s,a,o,_,g){const p=r("elements-selector"),h=r("mode-selector"),i=r("image-urls-input"),m=r("font-awesome-icon"),f=r("el-button");return n(),c("div",We,[d("div",Xe,[t(p,{class:"mb-4"}),t(h,{class:"mb-4"}),t(i,{class:"mb-4"}),d("div",Ye,[t(f,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:u(()=>[t(m,{icon:"fa-solid fa-magic",class:"mr-2"}),v(" "+l(e.$t("headshots.button.generate")),1)]),_:1},8,["onClick"])])])])}var Ze=w(Qe,[["render",Ke],["__scopeId","data-v-6a264fac"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/ConfigPanel.vue"]]);const xe=I({name:"ImageGallery",props:{modelValue:{type:Object,required:!0}},setup(e){return{images:fe(()=>{var o,_,g;return((g=(_=(o=e.modelValue)==null?void 0:o.response)==null?void 0:_.data)==null?void 0:g.slice(0,2))||[]}),viewImage:o=>{window.open(o,"_blank")}}}}),es={class:"image-gallery"},ss=["src"],ts=["onClick"];function as(e,s,a,o,_,g){return n(),c("div",es,[(n(!0),c(E,null,A(e.images,(p,h)=>(n(),c("div",{key:h,class:"image-container"},[d("img",{src:p.image_url,alt:"Image"},null,8,ss),d("button",{class:"view-button",onClick:i=>e.viewImage(p.image_url)},l(e.$t("headshots.button.viewImage")),9,ts)]))),128))])}var os=w(xe,[["render",as],["__scopeId","data-v-0187109d"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/ImageGallery.vue"]]);const ns=I({name:"TaskPreview",components:{ElImage:oe,CopyToClipboard:ke,FontAwesomeIcon:j,ElAlert:he,ImageGallery:os},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){var e;return(e=this.$store.state.headshots)==null?void 0:e.application},config(){var e;return(e=this.$store.state.headshots)==null?void 0:e.config}},methods:{onDownload(e,s){e.stopPropagation(),console.log("on download"),window.open(s,"_blank")},onReload(e){const s=e.target,a=new URL(s.src),o=a.searchParams.get("retry");if(!o)a.searchParams.set("retry","1");else if(parseInt(o)<2)a.searchParams.set("retry",(parseInt(o)+1).toString());else return;s.src=a.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),is={class:"preview"},ls={class:"left"},rs={class:"main"},cs={class:"bot"},ds={class:"datetime"},ps={class:"info"},ms={key:0,class:"prompt mt-2"},us={key:0},hs={key:1},_s={key:0,class:U({content:!0,failed:!0})},gs={class:"image-wrapper"},fs={class:"description"},vs={key:1,class:U({content:!0})},$s={class:"description"},ys={class:"description"},bs={class:"description"},ks={key:2,class:U({content:!0})},ws={class:"description"},Is={key:3,class:U({content:!0})},Ss={class:"description"};function Ts(e,s,a,o,_,g){var k,V,C,G,P,N,S,R,O,z,H,q,F,J,Q;const p=r("el-image"),h=r("image-gallery"),i=r("font-awesome-icon"),m=r("copy-to-clipboard"),f=r("el-alert");return n(),c("div",is,[d("div",ls,[t(p,{src:"https://cdn.acedata.cloud/isxyfw.png",class:"avatar"})]),d("div",rs,[d("div",cs,[v(l(e.$t("headshots.name.headshotsBot"))+" ",1),d("span",ds,l(e.$dayjs.format(""+new Date(parseFloat(((k=e.modelValue)==null?void 0:k.created_at)||"")*1e3))),1)]),d("div",ps,[(C=(V=e.modelValue)==null?void 0:V.request)!=null&&C.template?(n(),c("p",ms,[v(l((P=(G=e.modelValue)==null?void 0:G.request)==null?void 0:P.template)+" ",1),(N=e.modelValue)!=null&&N.response?$("v-if",!0):(n(),c("span",us," - ("+l(e.$t("headshots.status.pending"))+") ",1)),((R=(S=e.modelValue)==null?void 0:S.response)==null?void 0:R.status)==="unknown"?(n(),c("span",hs," - ("+l(e.$t("headshots.status.processing"))+") ",1)):$("v-if",!0)])):$("v-if",!0)]),$(" Display success message "),((z=(O=e.modelValue)==null?void 0:O.response)==null?void 0:z.success)===!0?(n(),c("div",_s,[d("div",gs,[t(h,{"model-value":e.modelValue},null,8,["model-value"])]),t(f,{closable:!1,class:"mt-2 success"},{default:u(()=>{var y,b;return[d("p",fs,[t(i,{icon:"fa-solid fa-magic",class:"mr-1"}),v(" "+l(e.$t("headshots.name.taskId"))+": "+l((y=e.modelValue)==null?void 0:y.id)+" ",1),t(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):$("v-if",!0),$(" Display error message "),((q=(H=e.modelValue)==null?void 0:H.response)==null?void 0:q.success)===!1?(n(),c("div",vs,[t(f,{closable:!1,class:"failure"},{template:u(()=>[t(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),v(" "+l(e.$t("headshots.name.failure")),1)]),default:u(()=>{var y,b,W,X,Y,K,Z,x,ee,se,te,ae;return[d("p",$s,[t(i,{icon:"fa-solid fa-magic",class:"mr-1"}),v(" "+l(e.$t("headshots.name.taskId"))+": "+l((y=e.modelValue)==null?void 0:y.id)+" ",1),t(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])]),d("p",ys,[t(i,{icon:"fa-solid fa-circle-info",class:"mr-1"}),v(" "+l(e.$t("headshots.name.failureReason"))+": "+l((Y=(X=(W=e.modelValue)==null?void 0:W.response)==null?void 0:X.error)==null?void 0:Y.message)+" ",1),t(m,{content:(x=(Z=(K=e.modelValue)==null?void 0:K.response)==null?void 0:Z.error)==null?void 0:x.message,class:"btn-copy"},null,8,["content"])]),d("p",bs,[t(i,{icon:"fa-solid fa-hashtag",class:"mr-1"}),v(" "+l(e.$t("headshots.name.traceId"))+": "+l((se=(ee=e.modelValue)==null?void 0:ee.response)==null?void 0:se.trace_id)+" ",1),t(m,{content:(ae=(te=e.modelValue)==null?void 0:te.response)==null?void 0:ae.trace_id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):$("v-if",!0),$(" Display error message "),(F=e.modelValue)!=null&&F.response?$("v-if",!0):(n(),c("div",ks,[t(f,{closable:!1,class:"info"},{template:u(()=>[t(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),v(" "+l(e.$t("headshots.name.failure")),1)]),default:u(()=>{var y,b;return[d("p",ws,[t(i,{icon:"fa-solid fa-magic",class:"mr-1"}),v(" "+l(e.$t("headshots.name.taskId"))+": "+l((y=e.modelValue)==null?void 0:y.id)+" ",1),t(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])),((Q=(J=e.modelValue)==null?void 0:J.response)==null?void 0:Q.status)==="unknown"?(n(),c("div",Is,[t(f,{closable:!1,class:"info"},{template:u(()=>[t(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),v(" "+l(e.$t("headshots.name.failure")),1)]),default:u(()=>{var y,b;return[d("p",Ss,[t(i,{icon:"fa-solid fa-magic",class:"mr-1"}),v(" "+l(e.$t("headshots.name.taskId"))+": "+l((y=e.modelValue)==null?void 0:y.id)+" ",1),t(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):$("v-if",!0)])])}var Vs=w(ns,[["render",Ts],["__scopeId","data-v-43e1feb8"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/task/Preview.vue"]]);const Cs=I({name:"RecentPanel",components:{TaskPreview:Vs,ElSkeleton:_e,ElSkeletonItem:ge},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){var e,s,a,o;return{...(e=this.$store.state.headshots)==null?void 0:e.tasks,items:(o=(a=(s=this.$store.state.headshots)==null?void 0:s.tasks)==null?void 0:a.items)==null?void 0:o.slice()}}},methods:{onHandleScroll(){const e=this.$refs.panel;console.log("reach-top reach-top reach-top"),e.scrollTop===0&&this.$emit("reach-top")}}}),Es={key:0,class:"tasks"},As={class:"left"},Gs={class:"main"},Ps={key:1,class:"tasks"},Ns={key:2,class:"description"};function Us(e,s,a,o,_,g){var m,f,k,V,C,G,P,N;const p=r("el-skeleton-item"),h=r("el-skeleton"),i=r("task-preview");return n(),c("div",{ref:"panel",class:"panel recent",onScroll:s[0]||(s[0]=(...S)=>e.onHandleScroll&&e.onHandleScroll(...S))},[((m=e.tasks)==null?void 0:m.items)===void 0?(n(),c("div",Es,[(n(),c(E,null,A(3,S=>d("div",{key:S,class:"task placeholder"},[d("div",As,[t(h,{animated:""},{template:u(()=>[t(p,{variant:"image",class:"avatar"})]),_:1})]),d("div",Gs,[t(h,{animated:""},{template:u(()=>[t(p,{variant:"p",class:"title"}),t(p,{variant:"image",class:"icon"})]),_:1})])])),64))])):((k=(f=e.tasks)==null?void 0:f.items)==null?void 0:k.length)&&((C=(V=e.tasks)==null?void 0:V.items)==null?void 0:C.length)>0?(n(),c("div",Ps,[(n(!0),c(E,null,A((G=e.tasks)==null?void 0:G.items,(S,R)=>(n(),D(i,{key:R,"model-value":S,class:"preview"},null,8,["model-value"]))),128))])):$("v-if",!0),((N=(P=e.tasks)==null?void 0:P.items)==null?void 0:N.length)===0?(n(),c("p",Ns,l(e.$t("headshots.message.noTasks")),1)):$("v-if",!0)],544)}var Rs=w(Cs,[["render",Us],["__scopeId","data-v-37920e9a"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/RecentPanel.vue"]]);const Ds="https://webhook.acedata.cloud/headshots",Ls=I({name:"HeadshotsIndex",components:{ConfigPanel:Ze,Layout:Ce,ApplicationStatus:$e,RecentPanel:Rs},data(){return{task:void 0,job:0,timer:void 0}},computed:{loading(){var e,s;return((s=(e=this.$store.state.headshots)==null?void 0:e.status)==null?void 0:s.getApplications)===L.Request},service(){return this.$store.state.headshots.service},credential(){return this.$store.state.headshots.credential},config(){return this.$store.state.headshots.config},initializing(){return this.$store.state.headshots.status.getApplications===L.Request},needApply(){return this.$store.state.headshots.status.getApplications===L.Success&&!this.application},application(){return this.$store.state.headshots.application},applications(){return this.$store.state.headshots.applications},tasks(){return this.$store.state.headshots.tasks}},watch:{tasks:{handler(e,s){var a,o;((a=e==null?void 0:e.items)==null?void 0:a.length)>((o=s==null?void 0:s.items)==null?void 0:o.length)&&console.debug("new tasks detected")},deep:!0}},async mounted(){await this.onGetService(),await this.onGetApplication(),await this.onScrollDown(),await this.onGetTasks(),this.job=setInterval(()=>{this.onGetTasks()},5e3)},async unmounted(){clearInterval(this.job),clearInterval(this.timer)},methods:{async onReachTop(){var e,s,a;console.debug("reached top"),await this.onGetTasks({createdAtMax:(a=(s=(e=this.tasks)==null?void 0:e.items)==null?void 0:s[0])==null?void 0:a.created_at})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("headshots/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("headshots/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){ie.create({application:this.application}).then(({data:e})=>{this.application=e,T.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{var s,a;((a=(s=e==null?void 0:e.response)==null?void 0:s.data)==null?void 0:a.code)===ye&&T.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".recent");e&&(e.scrollTop=e.scrollHeight)},500)},async onGetTasks(e){if(this.loading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:s=5,createdAtMin:a,createdAtMax:o}=e||{};console.debug("limit",s,"createdAtMin",a,"createdAtMax",o),await this.$store.dispatch("headshots/getTasks",{limit:s,createdAtMin:a,createdAtMax:o})},async onGeneratePicture(){var a;const e={...this.config,callback_url:Ds},s=(a=this.credential)==null?void 0:a.token;if(!s){console.error("no token specified");return}T.info(this.$t("headshots.message.startingTask")),le.generate(e,{token:s}).then(()=>{T.success(this.$t("headshots.message.startTaskSuccess")),this.$store.commit("headshots/setConfig",{config:void 0})}).catch(o=>{var g,p;const _=(g=o==null?void 0:o.response)==null?void 0:g.data;((p=_==null?void 0:_.error)==null?void 0:p.code)===be?T.error(this.$t("headshots.message.usedUp")):T.error(this.$t("headshots.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function Ms(e,s,a,o,_,g){const p=r("config-panel"),h=r("application-status"),i=r("recent-panel"),m=r("layout");return n(),D(m,null,{config:u(()=>[t(p,{onGenerate:e.onGeneratePicture},null,8,["onGenerate"])]),result:u(()=>[t(h,{initializing:e.initializing,application:e.application,applications:e.applications,service:e.service,"need-apply":e.needApply,class:"mb-4",onRefresh:e.onGetApplication,onSelect:s[0]||(s[0]=f=>e.$store.dispatch("headshots/setApplication",f))},null,8,["initializing","application","applications","service","need-apply","onRefresh"]),t(i,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"]),$(' <operation-panel class="panel operation" @generate="onGenerate" /> ')]),_:1})}var Xs=w(Ls,[["render",Ms],["__scopeId","data-v-62da1b28"],["__file","/home/runner/work/Nexior/Nexior/src/pages/headshots/Index.vue"]]);export{Xs as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./vendor-others.908494e8.js";import{aq as O}from"./vendor-fortawesome.56f9a0ee.js";import{I as ne}from"./ImageNavigator.8ae3c29d.js";import{_ as I,aR as ae,T as M,F as le,aS as ie}from"./index.c5936939.js";import{R as re,l as F,K as ce,L as pe,M as ue,s as de,B as me,t as _e,y as fe,T as he,J as T}from"./vendor-element-plus.bb793053.js";import{H as V,al as a,o as n,e as m,f as i,V as o,I as L,M as f,U as l,W as N,ai as E,L as C,T as y,S as g,Q as D}from"./vendor-@vue.37ef86f0.js";import{I as ve}from"./InfoIcon.746e870f.js";import{A as $e,i as ge,h as ye}from"./Status.a2dea48a.js";import{C as ke}from"./CopyToClipboard.aaa1969a.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.7d3be879.js";const we=V({name:"LayoutFlux",components:{ElDrawer:re,ElButton:F,FontAwesomeIcon:O,ImageNavigator:ne},data(){return{drawer:!1}}}),be={class:"main"},xe={class:"config"},Ie={class:"result"};function Ve(e,t,s,r,h,v){const p=a("image-navigator"),_=a("font-awesome-icon"),u=a("el-button"),$=a("el-drawer");return n(),m("div",be,[i("div",xe,[o(p),L(e.$slots,"config",{},void 0,!0)]),i("div",Ie,[L(e.$slots,"result",{},void 0,!0)]),o(u,{round:"",class:"menu",onClick:t[0]||(t[0]=d=>e.drawer=!0)},{default:f(()=>[o(_,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),o($,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=d=>e.drawer=d),"with-header":!1,size:"340px",class:"drawer"},{default:f(()=>[L(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var Se=I(we,[["render",Ve],["__scopeId","data-v-324e8ab0"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Flux.vue"]]);const Te=V({name:"ModelSelector",components:{ElSelect:ce,ElOption:pe},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{options:[{value:"flux",label:"flux"},{value:"flux-schnell",label:"flux-schnell"},{value:"flux-dev",label:"flux-dev"},{value:"flux-pro",label:"flux-pro"}]}},computed:{value:{get(){var e,t;return(t=(e=this.$store.state.flux)==null?void 0:e.config)==null?void 0:t.model},set(e){this.$store.commit("flux/setConfig",{...this.$store.state.flux.config,model:e})}}},mounted(){this.value||(this.value=ae)}}),Ae={class:"field"},Ge={class:"title font-bold"};function Ce(e,t,s,r,h,v){const p=a("el-option"),_=a("el-select");return n(),m("div",Ae,[i("h2",Ge,l(e.$t("flux.name.model")),1),o(_,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=u=>e.value=u),class:"value",placeholder:e.$t("flux.placeholder.select")},{default:f(()=>[(n(!0),m(N,null,E(e.options,u=>(n(),C(p,{key:u.value,label:u.label,value:u.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}var Pe=I(Te,[["render",Ce],["__scopeId","data-v-8a0bbbfe"],["__file","/home/runner/work/Nexior/Nexior/src/components/flux/config/ModelSelector.vue"]]);const Re="",Ne=V({name:"PromptInput",components:{ElInput:ue,InfoIcon:ve},computed:{prompt:{get(){var e,t;return(t=(e=this.$store.state.flux)==null?void 0:e.config)==null?void 0:t.prompt},set(e){var t;console.debug("set prompt",e),this.$store.commit("flux/setConfig",{...(t=this.$store.state.flux)==null?void 0:t.config,prompt:e})}}},mounted(){this.value||(this.value=Re)}}),Ee={class:"field"},De={class:"box"},Me={class:"title font-bold"};function Le(e,t,s,r,h,v){const p=a("info-icon"),_=a("el-input");return n(),m("div",Ee,[i("div",De,[i("h2",Me,l(e.$t("flux.name.prompt")),1),o(p,{content:e.$t("flux.description.prompt"),class:"info"},null,8,["content"])]),o(_,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=u=>e.prompt=u),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("flux.placeholder.prompt"),maxlength:300,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var Oe=I(Ne,[["render",Le],["__scopeId","data-v-76c331df"],["__file","/home/runner/work/Nexior/Nexior/src/components/flux/config/PromptInput.vue"]]);const Fe=V({name:"PresetPanel",components:{ElButton:F,FontAwesomeIcon:O,PromptInput:Oe,ModelSelector:Pe},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.flux)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),Ue={class:"panel"},qe={class:"config"},Be={class:"actions"};function je(e,t,s,r,h,v){var d,k;const p=a("prompt-input"),_=a("model-selector"),u=a("font-awesome-icon"),$=a("el-button");return n(),m("div",Ue,[i("div",qe,[o(p,{class:"mb-4"}),o(_,{class:"mb-4"}),i("div",Be,[((d=e.config)==null?void 0:d.video_url)!==void 0||((k=e.config)==null?void 0:k.custom)?(n(),C($,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:f(()=>[o(u,{icon:"fa-solid fa-magic",class:"mr-2"}),y(" "+l(e.$t("flux.button.extend")),1)]),_:1},8,["onClick"])):(n(),C($,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:f(()=>[o(u,{icon:"fa-solid fa-magic",class:"mr-2"}),y(" "+l(e.$t("flux.button.generate")),1)]),_:1},8,["onClick"]))])])])}var ze=I(Fe,[["render",je],["__scopeId","data-v-707be6ac"],["__file","/home/runner/work/Nexior/Nexior/src/components/flux/ConfigPanel.vue"]]);const He=V({name:"ImageGallery",props:{modelValue:{type:Object,required:!0}},setup(e){return{viewImage:s=>{window.open(s,"_blank")}}}}),Ke={class:"image-gallery"},Je={class:"image-container"},Qe=["src"];function We(e,t,s,r,h,v){return n(),m("div",Ke,[i("div",Je,[i("img",{src:e.modelValue.image_url,alt:"Image"},null,8,Qe),i("button",{class:"view-button",onClick:t[0]||(t[0]=p=>e.viewImage(e.modelValue.image_url))},l(e.$t("flux.button.viewImage")),1)])])}var Xe=I(He,[["render",We],["__scopeId","data-v-74374cc6"],["__file","/home/runner/work/Nexior/Nexior/src/components/flux/ImageGallery.vue"]]);const Ye=V({name:"TaskPreview",components:{ElImage:de,CopyToClipboard:ke,FontAwesomeIcon:O,ElAlert:me,ElTooltip:_e,ElButton:F,ImageGallery:Xe},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){var e;return(e=this.$store.state.flux)==null?void 0:e.application},config(){var e;return(e=this.$store.state.flux)==null?void 0:e.config},images(){var s,r,h,v,p,_,u;let e=[];const t=(r=(s=this.modelValue)==null?void 0:s.request)==null?void 0:r.action;return Array.isArray((v=(h=this.modelValue)==null?void 0:h.response)==null?void 0:v.data)&&((u=(_=(p=this.modelValue)==null?void 0:p.response)==null?void 0:_.data)==null||u.forEach($=>{let d=$;t&&(d.action=t),e.push(d)})),e}},methods:{onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onOpenImage(e){window.open(e,"_blank")}}}),Ze={class:"left"},et={class:"main"},tt={class:"bot"},ot={class:"datetime"},st={class:"info"},nt={key:0,class:"prompt mt-2"},at={key:0},lt={key:1},it={key:0,class:D({content:!0,failed:!0})},rt={class:"image-wrapper"},ct={key:0,class:D({operations:!0,"mt-2":!0})},pt={class:"description"},ut={key:1,class:D({content:!0})},dt={class:"description"},mt={class:"description"},_t={class:"description"},ft={key:2,class:D({content:!0})},ht={class:"description"};function vt(e,t,s,r,h,v){const p=a("el-image"),_=a("image-gallery"),u=a("el-button"),$=a("el-tooltip"),d=a("font-awesome-icon"),k=a("copy-to-clipboard"),S=a("el-alert");return n(!0),m(N,null,E(e.images,(c,P)=>{var A,G,b,R,U,q,B,j,z,H,K;return n(),m("div",{key:P,class:"preview"},[i("div",Ze,[o(p,{src:"https://cdn.acedata.cloud/ogm2oa.png",class:"avatar"})]),i("div",et,[i("div",tt,[y(l(e.$t("flux.name.fluxBot"))+" ",1),i("span",ot,l(e.$dayjs.format(""+new Date(parseFloat(((A=e.modelValue)==null?void 0:A.created_at)||"")*1e3))),1)]),i("div",st,[(b=(G=e.modelValue)==null?void 0:G.request)!=null&&b.prompt?(n(),m("p",nt,[y(l((U=(R=e.modelValue)==null?void 0:R.request)==null?void 0:U.prompt)+" ",1),(q=e.modelValue)!=null&&q.response?g("v-if",!0):(n(),m("span",at," - ("+l(e.$t("flux.status.pending"))+") ",1)),(c==null?void 0:c.state)==="processing"||(c==null?void 0:c.state)==="pending"||(c==null?void 0:c.state)==="completed"?(n(),m("span",lt," - ("+l(e.$t("flux.status.processing"))+") ",1)):g("v-if",!0)])):g("v-if",!0)]),g(" Display success message "),((j=(B=e.modelValue)==null?void 0:B.response)==null?void 0:j.success)===!0?(n(),m("div",it,[i("div",rt,[o(_,{"model-value":c},null,8,["model-value"])]),c?(n(),m("div",ct,[o($,{class:"box-item",effect:"dark",content:e.$t("flux.message.downloadImage"),placement:"top-start"},{default:f(()=>[o(u,{type:"info",size:"small",class:"btn-action",onClick:w=>e.onDownload(w,c==null?void 0:c.image_url)},{default:f(()=>[y(l(e.$t("flux.button.download")),1)]),_:2},1032,["onClick"])]),_:2},1032,["content"])])):g("v-if",!0),o(S,{closable:!1,class:"mt-2 success"},{default:f(()=>{var w,x;return[i("p",pt,[o(d,{icon:"fa-solid fa-magic",class:"mr-1"}),y(" "+l(e.$t("flux.name.taskId"))+": "+l((w=e.modelValue)==null?void 0:w.id)+" ",1),o(k,{content:(x=e.modelValue)==null?void 0:x.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):g("v-if",!0),g(" Display error message "),((H=(z=e.modelValue)==null?void 0:z.response)==null?void 0:H.success)===!1?(n(),m("div",ut,[o(S,{closable:!1,class:"failure"},{template:f(()=>[o(d,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),y(" "+l(e.$t("flux.name.failure")),1)]),default:f(()=>{var w,x,J,Q,W,X,Y,Z,ee,te,oe,se;return[i("p",dt,[o(d,{icon:"fa-solid fa-magic",class:"mr-1"}),y(" "+l(e.$t("flux.name.taskId"))+": "+l((w=e.modelValue)==null?void 0:w.id)+" ",1),o(k,{content:(x=e.modelValue)==null?void 0:x.id,class:"btn-copy"},null,8,["content"])]),i("p",mt,[o(d,{icon:"fa-solid fa-circle-info",class:"mr-1"}),y(" "+l(e.$t("flux.name.failureReason"))+": "+l((W=(Q=(J=e.modelValue)==null?void 0:J.response)==null?void 0:Q.error)==null?void 0:W.message)+" ",1),o(k,{content:(Z=(Y=(X=e.modelValue)==null?void 0:X.response)==null?void 0:Y.error)==null?void 0:Z.message,class:"btn-copy"},null,8,["content"])]),i("p",_t,[o(d,{icon:"fa-solid fa-hashtag",class:"mr-1"}),y(" "+l(e.$t("flux.name.traceId"))+": "+l((te=(ee=e.modelValue)==null?void 0:ee.response)==null?void 0:te.trace_id)+" ",1),o(k,{content:(se=(oe=e.modelValue)==null?void 0:oe.response)==null?void 0:se.trace_id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):g("v-if",!0),g(" Display error message "),!((K=e.modelValue)!=null&&K.response)||(c==null?void 0:c.state)==="processing"||(c==null?void 0:c.state)==="pending"?(n(),m("div",ft,[o(S,{closable:!1,class:"info"},{template:f(()=>[o(d,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),y(" "+l(e.$t("flux.name.failure")),1)]),default:f(()=>{var w,x;return[i("p",ht,[o(d,{icon:"fa-solid fa-magic",class:"mr-1"}),y(" "+l(e.$t("flux.name.taskId"))+": "+l((w=e.modelValue)==null?void 0:w.id)+" ",1),o(k,{content:(x=e.modelValue)==null?void 0:x.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):g("v-if",!0)])])}),128)}var $t=I(Ye,[["render",vt],["__scopeId","data-v-bb276cb8"],["__file","/home/runner/work/Nexior/Nexior/src/components/flux/task/Preview.vue"]]);const gt=V({name:"RecentPanel",components:{TaskPreview:$t,ElSkeleton:fe,ElSkeletonItem:he},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){var e,t,s,r;return{...(e=this.$store.state.flux)==null?void 0:e.tasks,items:(r=(s=(t=this.$store.state.flux)==null?void 0:t.tasks)==null?void 0:s.items)==null?void 0:r.slice()}}},methods:{onHandleScroll(){const e=this.$refs.panel;console.log("reach-top reach-top reach-top"),e.scrollTop===0&&this.$emit("reach-top")}}}),yt={key:0,class:"tasks"},kt={class:"left"},wt={class:"main"},bt={key:1,class:"tasks"},xt={key:2,class:"description"};function It(e,t,s,r,h,v){var $,d,k,S,c,P,A,G;const p=a("el-skeleton-item"),_=a("el-skeleton"),u=a("task-preview");return n(),m("div",{ref:"panel",class:"panel recent",onScroll:t[0]||(t[0]=(...b)=>e.onHandleScroll&&e.onHandleScroll(...b))},[(($=e.tasks)==null?void 0:$.items)===void 0?(n(),m("div",yt,[(n(),m(N,null,E(3,b=>i("div",{key:b,class:"task placeholder"},[i("div",kt,[o(_,{animated:""},{template:f(()=>[o(p,{variant:"image",class:"avatar"})]),_:1})]),i("div",wt,[o(_,{animated:""},{template:f(()=>[o(p,{variant:"p",class:"title"}),o(p,{variant:"image",class:"icon"})]),_:1})])])),64))])):((k=(d=e.tasks)==null?void 0:d.items)==null?void 0:k.length)&&((c=(S=e.tasks)==null?void 0:S.items)==null?void 0:c.length)>0?(n(),m("div",bt,[(n(!0),m(N,null,E((P=e.tasks)==null?void 0:P.items,(b,R)=>(n(),C(u,{key:R,"model-value":b,class:"preview"},null,8,["model-value"]))),128))])):g("v-if",!0),((G=(A=e.tasks)==null?void 0:A.items)==null?void 0:G.length)===0?(n(),m("p",xt,l(e.$t("flux.message.noTasks")),1)):g("v-if",!0)],544)}var Vt=I(gt,[["render",It],["__scopeId","data-v-2ae6e09a"],["__file","/home/runner/work/Nexior/Nexior/src/components/flux/RecentPanel.vue"]]);const St="https://webhook.acedata.cloud/flux",Tt=V({name:"FluxIndex",components:{ConfigPanel:ze,Layout:Se,ApplicationStatus:$e,RecentPanel:Vt},data(){return{task:void 0,job:0,timer:void 0}},computed:{loading(){var e,t;return((t=(e=this.$store.state.flux)==null?void 0:e.status)==null?void 0:t.getApplications)===M.Request},service(){var e;return(e=this.$store.state.flux)==null?void 0:e.service},credential(){var e;return(e=this.$store.state.flux)==null?void 0:e.credential},config(){var e;return(e=this.$store.state.flux)==null?void 0:e.config},initializing(){var e,t;return((t=(e=this.$store.state.flux)==null?void 0:e.status)==null?void 0:t.getApplications)===M.Request},needApply(){var e,t;return((t=(e=this.$store.state.flux)==null?void 0:e.status)==null?void 0:t.getApplications)===M.Success&&!this.application},application(){var e;return(e=this.$store.state.flux)==null?void 0:e.application},applications(){var e;return(e=this.$store.state.flux)==null?void 0:e.applications},tasks(){var e;return(e=this.$store.state.flux)==null?void 0:e.tasks}},watch:{tasks:{handler(e,t){var s,r;((s=e==null?void 0:e.items)==null?void 0:s.length)>((r=t==null?void 0:t.items)==null?void 0:r.length)&&console.debug("new tasks detected")},deep:!0}},async mounted(){await this.onGetService(),await this.onGetApplication(),await this.onScrollDown(),await this.onGetTasks(),this.job=setInterval(()=>{this.onGetTasks()},5e3)},async unmounted(){clearInterval(this.job),clearInterval(this.timer)},methods:{async onReachTop(){var e,t,s;console.debug("reached top"),await this.onGetTasks({createdAtMax:(s=(t=(e=this.tasks)==null?void 0:e.items)==null?void 0:t[0])==null?void 0:s.created_at})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("flux/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("flux/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){le.create({application:this.application}).then(({data:e})=>{this.application=e,T.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{var t,s;((s=(t=e==null?void 0:e.response)==null?void 0:t.data)==null?void 0:s.code)===ge&&T.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".recent");e&&(e.scrollTop=e.scrollHeight)},500)},async onGetTasks(e){if(this.loading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:s,createdAtMax:r}=e||{};console.debug("limit",t,"createdAtMin",s,"createdAtMax",r),await this.$store.dispatch("flux/getTasks",{limit:t,createdAtMin:s,createdAtMax:r})},async onGenerateVideo(){var s;const e={...this.config,callback_url:St},t=(s=this.credential)==null?void 0:s.token;if(!t){console.error("no token specified");return}T.info(this.$t("flux.message.startingTask")),ie.generate(e,{token:t}).then(()=>{T.success(this.$t("flux.message.startTaskSuccess")),this.$store.commit("flux/setConfig",{config:void 0})}).catch(r=>{var v,p;const h=(v=r==null?void 0:r.response)==null?void 0:v.data;((p=h==null?void 0:h.error)==null?void 0:p.code)===ye?T.error(this.$t("flux.message.usedUp")):T.error(this.$t("flux.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function At(e,t,s,r,h,v){const p=a("config-panel"),_=a("application-status"),u=a("recent-panel"),$=a("layout");return n(),C($,null,{config:f(()=>[o(p,{onGenerate:e.onGenerateVideo},null,8,["onGenerate"])]),result:f(()=>[o(_,{initializing:e.initializing,application:e.application,applications:e.applications,service:e.service,"need-apply":e.needApply,class:"mb-4",onRefresh:e.onGetApplication,onSelect:t[0]||(t[0]=d=>e.$store.dispatch("flux/setApplication",d))},null,8,["initializing","application","applications","service","need-apply","onRefresh"]),o(u,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"]),g(' <operation-panel class="panel operation" @generate="onGenerate" /> ')]),_:1})}var Ut=I(Tt,[["render",At],["__scopeId","data-v-e3c77ee0"],["__file","/home/runner/work/Nexior/Nexior/src/pages/flux/Index.vue"]]);export{Ut as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as A,x as M}from"./vendor-others.908494e8.js";import{S as q,s as j,g as U,_ as L,A as P,c as z,d as F,e as X,f as J,z as W,M as G,R as K}from"./index.c5936939.js";import{aq as R}from"./vendor-fortawesome.56f9a0ee.js";import{E as N,K as Q,L as Y,s as B,a1 as Z,j as ee,k as te}from"./vendor-element-plus.bb793053.js";import{H as I,al as o,o as u,L as $,M as d,V as s,e as S,ai as V,W as H,T as O,U as x,S as T,f as _,a0 as oe,Q as se}from"./vendor-@vue.37ef86f0.js";import{h as ae,C as ne,a as D}from"./vendor-vue-dark-switch.1e49b842.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.7d3be879.js";const le=I({name:"LocaleSelector",components:{ElDialog:N,ElSelect:Q,ElOption:Y},props:{visible:{type:Boolean,default:!1}},emits:["close"],data(){return{value:this.$i18n.locale,locales:q}},methods:{async onSelectLocale(e){this.$router.push({query:{...this.$route.query,locale:void 0}}),await j(e),this.setCookie(e),window.location.reload()},setCookie(e){A("LOCALE",e,{path:"/",domain:U()})}}});function re(e,t,a,n,m,g){const c=o("el-option"),l=o("el-select"),p=o("el-dialog");return u(),$(p,{"model-value":e.visible,width:300,class:"text-center",onClose:t[1]||(t[1]=r=>e.$emit("close"))},{default:d(()=>[s(l,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=r=>e.value=r),onChange:e.onSelectLocale},{default:d(()=>[(u(!0),S(H,null,V(e.locales,(r,f)=>(u(),$(c,{key:f,label:r.label,value:r.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1},8,["model-value"])}var ie=L(le,[["render",re],["__scopeId","data-v-32a102bd"],["__file","/home/runner/work/Nexior/Nexior/src/components/common/LocaleSelector.vue"]]);const ce=I({components:{DarkSwitch:ae,ElDialog:N},props:{visible:{type:Boolean,default:!0}},emits:["update:dark","close"],computed:{dark(){return M("THEME")==="dark"},switchValue(){return ne.value}},watch:{switchValue(e){this.setCookie(e)},dark(e){document.documentElement.classList.toggle("dark",e),this.setCookie(this.dark)}},mounted(){this.dark?(D(!0),document.documentElement.classList.add("dark")):(D(!1),document.documentElement.classList.remove("dark"))},methods:{setCookie(e){A("THEME",e?"dark":"light",{path:"/",domain:U()})}}});function de(e,t,a,n,m,g){const c=o("dark-switch"),l=o("el-dialog");return u(),$(l,{"model-value":e.visible,width:200,class:"text-center",onClose:t[0]||(t[0]=p=>e.$emit("close"))},{default:d(()=>[s(c,{class:"switch","dark-background":"#333","light-background":"#fff"})]),_:1},8,["model-value"])}var ue=L(ce,[["render",de],["__file","/home/runner/work/Nexior/Nexior/src/components/common/DarkSelector.vue"]]);const me=I({name:"HelpEntry",components:{ElImage:B,ElDialog:N,ElPopover:Z,ElMenu:ee,ElMenuItem:te,FontAwesomeIcon:R},props:{visible:{type:Boolean,default:!0}},emits:["close"],computed:{site(){return this.$store.state.site}},methods:{onJoin(){var e,t,a,n;window.open((n=(a=(t=(e=this.$store.state.site)==null?void 0:e.features)==null?void 0:t.support)==null?void 0:a.discord)==null?void 0:n.url,"_blank")},onProfit(){this.$router.push({name:P})}}}),pe={class:"flex"},_e={class:"flex-1 text-center"};function fe(e,t,a,n,m,g){const c=o("font-awesome-icon"),l=o("el-menu-item"),p=o("el-image"),r=o("el-popover"),f=o("el-menu"),i=o("el-dialog");return u(),$(i,{"model-value":e.visible,width:200,class:"text-center",onClose:t[0]||(t[0]=h=>e.$emit("close"))},{default:d(()=>[s(f,{collapse:!1,class:"menu"},{default:d(()=>{var h,k,w,b;return[(b=(w=(k=(h=e.site)==null?void 0:h.features)==null?void 0:k.support)==null?void 0:w.discord)!=null&&b.enabled?(u(),$(l,{key:0,index:"1",onClick:e.onJoin},{title:d(()=>[O(x(e.$t("common.message.joinDiscord")),1)]),default:d(()=>[s(c,{icon:"fa-brands fa-discord",class:"mr-2"})]),_:1},8,["onClick"])):T("v-if",!0),s(r,{width:350,trigger:"hover"},{reference:d(()=>{var v,y,E,C;return[(C=(E=(y=(v=e.site)==null?void 0:v.features)==null?void 0:y.support)==null?void 0:E.wechat)!=null&&C.enabled?(u(),$(l,{key:0,index:"2"},{title:d(()=>[O(x(e.$t("common.message.addWeChat")),1)]),default:d(()=>[s(c,{icon:"fa-brands fa-weixin",class:"mr-2"})]),_:1})):T("v-if",!0)]}),default:d(()=>{var v,y,E,C;return[_("div",pe,[_("div",_e,[s(p,{src:(C=(E=(y=(v=e.site)==null?void 0:v.features)==null?void 0:y.support)==null?void 0:E.wechat)==null?void 0:C.qr},null,8,["src"])])])]}),_:1})]}),_:1})]),_:1},8,["model-value"])}var he=L(me,[["render",fe],["__scopeId","data-v-2800d84d"],["__file","/home/runner/work/Nexior/Nexior/src/components/common/HelpDialog.vue"]]);const ve=I({name:"ProfileIndex",components:{ElImage:B,HelpDialog:he,FontAwesomeIcon:R,LocaleSelector:ie,DarkSelector:ue},data(){return{operating:{locale:!1,dark:!1,help:!1}}},computed:{user(){return this.$store.getters.user},showSupport(){var e,t,a,n,m,g,c,l,p,r,f,i,h,k,w,b,v;return((m=(n=(a=(t=(e=this.$store)==null?void 0:e.state)==null?void 0:t.site)==null?void 0:a.features)==null?void 0:n.support)==null?void 0:m.enabled)&&(((f=(r=(p=(l=(c=(g=this.$store)==null?void 0:g.state)==null?void 0:c.site)==null?void 0:l.features)==null?void 0:p.support)==null?void 0:r.discord)==null?void 0:f.enabled)||((v=(b=(w=(k=(h=(i=this.$store)==null?void 0:i.state)==null?void 0:h.site)==null?void 0:k.features)==null?void 0:w.support)==null?void 0:b.wechat)==null?void 0:v.enabled))},showSite(){var e,t,a,n,m;return(m=(a=(t=(e=this.$store)==null?void 0:e.state)==null?void 0:t.site)==null?void 0:a.admins)==null?void 0:m.includes((n=this.$store.getters.user)==null?void 0:n.id)},links(){return[{key:"profile",text:this.$t("console.menu.userProfile"),href:`${z()}/user/profile`,icon:"fa-regular fa-user"},{key:"application-list",text:this.$t("console.menu.applicationList"),name:F,icon:"fa-solid fa-cube"},{key:"order-list",text:this.$t("console.menu.orderList"),name:X,icon:"fa-solid fa-store"},{key:"usage-list",text:this.$t("console.menu.usageList"),name:J,icon:"fa-solid fa-rotate-left"},{key:"distribution-index",text:this.$t("console.menu.distributionIndex"),name:P,icon:"fa-solid fa-coins"},...this.showSite?[{key:"site-index",text:this.$t("common.nav.site"),name:W,icon:"fa-solid fa-gear"}]:[],{key:"dark-setting",text:this.$t("common.nav.darkMode"),icon:"fa-solid fa-moon",callback:()=>{this.operating.dark=!0}},{key:"locale-setting",text:this.$t("common.nav.locale"),icon:"fa-solid fa-language",callback:()=>{this.operating.locale=!0}},{key:"developerPlatform",text:this.$t("console.menu.developerPlatform"),href:G(),icon:"fa-solid fa-laptop-code"},...this.showSupport?[{key:"support",text:this.$t("common.nav.support"),callback:()=>{this.operating.help=!0},icon:"fa-solid fa-question"}]:[],{key:"logout",text:this.$t("common.nav.logOut"),icon:"fa-solid fa-arrow-right-from-bracket",callback:async()=>{await this.$store.dispatch("resetAll"),await this.$store.dispatch("chat/resetAll"),await this.$store.dispatch("midjourney/resetAll"),await this.$store.dispatch("chatdoc/resetAll"),await this.$store.dispatch("qrart/resetAll"),await this.$store.dispatch("login")}}]}},methods:{onHome(){this.$router.push({name:K})},onNavigate(e){e.name?this.$router.push({name:e.name}):e.href?window.open(e.href,"_blank"):e.callback&&e.callback()}}}),ge={class:"profile"},ke={class:"info"},$e={class:"links"},we=["onClick"],be={class:"icon"},ye={class:"text"},Ee={class:"suffix"};function Ce(e,t,a,n,m,g){const c=o("el-image"),l=o("font-awesome-icon"),p=o("locale-selector"),r=o("dark-selector"),f=o("help-dialog");return u(),S("div",ge,[_("div",ke,[s(c,{src:e.user.avatar,fit:"cover",class:"avatar"},null,8,["src"]),_("h2",null,x(e.user.username),1),_("div",{style:oe({backgroundImage:"url("+e.user.avatar+")"}),class:"background"},null,4)]),_("div",$e,[(u(!0),S(H,null,V(e.links,(i,h)=>(u(),S("a",{key:h,class:se({link:!0,active:e.$route.name===i.name}),onClick:k=>e.onNavigate(i)},[_("span",be,[s(l,{icon:i.icon,class:"text-sm"},null,8,["icon"])]),_("span",ye,x(i.text),1),_("span",Ee,[s(l,{icon:"fa-solid fa-chevron-right",class:"text-sm"})])],10,we))),128))]),s(p,{visible:e.operating.locale==!0,onClose:t[0]||(t[0]=i=>e.operating.locale=!1)},null,8,["visible"]),s(r,{visible:e.operating.dark==!0,onClose:t[1]||(t[1]=i=>e.operating.dark=!1)},null,8,["visible"]),s(f,{visible:e.operating.help==!0,onClose:t[2]||(t[2]=i=>e.operating.help=!1)},null,8,["visible"])])}var Ae=L(ve,[["render",Ce],["__scopeId","data-v-0a2212f8"],["__file","/home/runner/work/Nexior/Nexior/src/pages/profile/Index.vue"]]);export{Ae as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{K as le}from"./vendor-others.908494e8.js";import{aq as q}from"./vendor-fortawesome.56f9a0ee.js";import{V as re}from"./VideoNavigator.92fd5341.js";import{_ as y,aH as ce,aI as pe,aJ as de,M as ue,T as L,F as _e,aK as me}from"./index.c5936939.js";import{R as fe,l as D,Q as he,K as ne,L as ie,I as ge,H as ke,N as ve,J as E,M as $e,s as ye,B as be,t as we,y as Ie,T as Se}from"./vendor-element-plus.bb793053.js";import{H as b,al as n,o as i,e as u,f as p,V as s,I as O,M as m,U as c,W as U,ai as R,L as P,S as k,T as $,Q as M}from"./vendor-@vue.37ef86f0.js";import{I as z}from"./InfoIcon.746e870f.js";import{A as Ve,i as Ee,h as Pe}from"./Status.a2dea48a.js";import{C as Te}from"./CopyToClipboard.aaa1969a.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.7d3be879.js";const Ae=b({name:"LayoutPika",components:{ElDrawer:fe,ElButton:D,FontAwesomeIcon:q,VideoNavigator:re},data(){return{drawer:!1}}}),Ce={class:"main"},Ne={class:"config"},Ue={class:"result"};function Re(e,t,o,l,h,g){const r=n("video-navigator"),d=n("font-awesome-icon"),a=n("el-button"),v=n("el-drawer");return i(),u("div",Ce,[p("div",Ne,[s(r),O(e.$slots,"config",{},void 0,!0)]),p("div",Ue,[O(e.$slots,"result",{},void 0,!0)]),s(a,{round:"",class:"menu",onClick:t[0]||(t[0]=f=>e.drawer=!0)},{default:m(()=>[s(d,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),s(v,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=f=>e.drawer=f),"with-header":!1,size:"340px",class:"drawer"},{default:m(()=>[O(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var Ge=y(Ae,[["render",Re],["__scopeId","data-v-449d36ce"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Pika.vue"]]);const De=b({name:"IngredientsSelector",components:{ElSwitch:he,InfoIcon:z},computed:{value:{get(){var e,t;return(t=(e=this.$store.state.pika)==null?void 0:e.config)==null?void 0:t.ingredients},set(e){var t,o;console.debug("set ingredients",e),e||this.$store.commit("pika/setConfig",{...(t=this.$store.state.pika)==null?void 0:t.config,ingredients:e,ingredients_mode:void 0,image_url:void 0}),this.$store.commit("pika/setConfig",{...(o=this.$store.state.pika)==null?void 0:o.config,ingredients:e,model:"2.0"})}}},mounted(){this.value===void 0&&(this.value=ce)}}),Me={class:"field"},Le={class:"title font-bold"};function Oe(e,t,o,l,h,g){const r=n("el-switch"),d=n("info-icon");return i(),u("div",Me,[p("h2",Le,c(e.$t("pika.name.ingredients")),1),s(r,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=a=>e.value=a),class:"value"},null,8,["modelValue"]),s(d,{content:e.$t("pika.description.ingredients"),class:"info"},null,8,["content"])])}var qe=y(De,[["render",Oe],["__scopeId","data-v-798cb974"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/config/IngredientsSelector.vue"]]);const ze=b({name:"EffectSelector",components:{ElSelect:ne,ElOption:ie},data(){return{}},computed:{options(){return[{value:"Levitate",label:this.$t("pika.style.effect1")},{value:"Decapitate",label:this.$t("pika.style.effect2")},{value:"Eye-pop",label:this.$t("pika.style.effect3")},{value:"Ta-da",label:this.$t("pika.style.effect4")},{value:"Deflate",label:this.$t("pika.style.effect5")},{value:"Crumble",label:this.$t("pika.style.effect6")},{value:"Dissolve",label:this.$t("pika.style.effect7")},{value:"Squish",label:this.$t("pika.style.effect8")},{value:"Inflate",label:this.$t("pika.style.effect9")},{value:"Melt",label:this.$t("pika.style.effect10")},{value:"Cake-ify",label:this.$t("pika.style.effect11")},{value:"Crush",label:this.$t("pika.style.effect12")},{value:"Explode",label:this.$t("pika.style.effect13")}]},value:{get(){var e,t;return(t=(e=this.$store.state.pika)==null?void 0:e.config)==null?void 0:t.effect},set(e){var t;this.$store.commit("pika/setConfig",{...(t=this.$store.state.pika)==null?void 0:t.config,effect:e})}}},watch:{},mounted(){}}),Be={class:"field"},je={class:"title font-bold"},Fe={class:"float-left"};function He(e,t,o,l,h,g){const r=n("el-option"),d=n("el-select");return i(),u("div",Be,[p("h2",je,c(e.$t("pika.name.effect")),1),s(d,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=a=>e.value=a),class:"value",placeholder:e.$t("pika.placeholder.select"),clearable:""},{default:m(()=>[(i(!0),u(U,null,R(e.options,a=>(i(),P(r,{key:a.value,label:a.label,value:a.value},{default:m(()=>[p("span",Fe,c(a.label),1),k(' <span class="float-right">{{ item.value }}</span> ')]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}var Ke=y(ze,[["render",He],["__scopeId","data-v-db9ed4a6"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/config/EffectSelector.vue"]]);const Je=b({name:"IngredientsModelSelector",components:{ElRadioButton:ge,ElRadioGroup:ke},data(){return{options:[{label:this.$t("pika.button.precise"),value:"precise"},{label:this.$t("pika.button.creative"),value:"creative"}]}},computed:{value:{get(){var e,t;return(t=(e=this.$store.state.pika)==null?void 0:e.config)==null?void 0:t.ingredients_mode},set(e){var t;this.$store.commit("pika/setConfig",{...(t=this.$store.state.pika)==null?void 0:t.config,ingredients_mode:e})}}},mounted(){this.value||(this.value=pe)}}),Qe={class:"field"},We={class:"title font-bold"};function Xe(e,t,o,l,h,g){const r=n("el-radio-button"),d=n("el-radio-group");return i(),u("div",Qe,[p("h2",We,c(e.$t("pika.name.ingredientsModel")),1),s(d,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=a=>e.value=a),size:"small",class:"quality"},{default:m(()=>[(i(!0),u(U,null,R(e.options,a=>(i(),P(r,{key:a.value,label:a.value},{default:m(()=>[$(c(a.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])])}var Ye=y(Je,[["render",Xe],["__scopeId","data-v-12df6463"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/config/IngredientsModelSelector.vue"]]);const Ze=b({name:"ModelSelector",components:{ElSelect:ne,ElOption:ie},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{options:[{value:"2.0",label:"2.0"},{value:"1.5",label:"1.5"}]}},computed:{value:{get(){var e,t;return(t=(e=this.$store.state.pika)==null?void 0:e.config)==null?void 0:t.model},set(e){this.$store.commit("pika/setConfig",{...this.$store.state.pika.config,model:e})}}},mounted(){this.value||(this.value=de)}}),xe={class:"field"},et={class:"title font-bold"};function tt(e,t,o,l,h,g){const r=n("el-option"),d=n("el-select");return i(),u("div",xe,[p("h2",et,c(e.$t("pika.name.model")),1),s(d,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=a=>e.value=a),class:"value",placeholder:e.$t("pika.placeholder.select")},{default:m(()=>[(i(!0),u(U,null,R(e.options,a=>(i(),P(r,{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}var st=y(Ze,[["render",tt],["__scopeId","data-v-1df4d99b"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/config/ModelSelector.vue"]]);const ot=b({name:"ImageUrlInput",components:{ElUpload:ve,ElButton:D,InfoIcon:z},data(){return{fileList:[],uploadUrl:ue()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>{var t;return(t=e==null?void 0:e.response)==null?void 0:t.file_url})},value:{get(){var e,t;return(t=(e=this.$store.state.pika)==null?void 0:e.config)==null?void 0:t.image_url},set(e){var t,o;(t=this.urls)==null||t[0],this.$store.commit("pika/setConfig",{...(o=this.$store.state.pika)==null?void 0:o.config,image_url:this.urls})}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){E.warning(this.$t("pika.message.uploadStartImageExceed"))},onError(){E.error(this.$t("pika.message.uploadStartImageError"))},async onRemove(){E.error(this.$t("pika.message.uploadStartImageError"))},onSetStartImageUrl(){var e;this.$store.commit("pika/setConfig",{...(e=this.$store.state.pika)==null?void 0:e.config,image_url:this.urls})},async onSuccess(){this.onSetStartImageUrl()}}}),at={class:"field"},nt={class:"title font-bold"},it={class:"upload-wrapper"};function lt(e,t,o,l,h,g){const r=n("el-button"),d=n("el-upload"),a=n("info-icon");return i(),u("div",at,[p("h2",nt,c(e.$t("pika.name.imageUrl")),1),p("div",it,[s(d,{"file-list":e.fileList,"onUpdate:file-list":t[0]||(t[0]=v=>e.fileList=v),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"value","show-file-list":!0,limit:3,multiple:!0,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-remove":e.onRemove,"on-success":e.onSuccess,headers:e.headers},{default:m(()=>[s(r,{size:"small",type:"primary",round:""},{default:m(()=>[$(c(e.$t("pika.button.uploadImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-remove","on-success","headers"])]),s(a,{content:e.$t("pika.description.imageUrl"),class:"info"},null,8,["content"])])}var rt=y(ot,[["render",lt],["__scopeId","data-v-5daf4a89"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/config/ImageUrlInput.vue"]]);const ct="",pt=b({name:"PromptInput",components:{ElInput:$e,InfoIcon:z},computed:{prompt:{get(){var e,t;return(t=(e=this.$store.state.pika)==null?void 0:e.config)==null?void 0:t.prompt},set(e){var t;console.debug("set prompt",e),this.$store.commit("pika/setConfig",{...(t=this.$store.state.pika)==null?void 0:t.config,prompt:e})}}},mounted(){this.value||(this.value=ct)}}),dt={class:"field"},ut={class:"box"},_t={class:"title font-bold"};function mt(e,t,o,l,h,g){const r=n("info-icon"),d=n("el-input");return i(),u("div",dt,[p("div",ut,[p("h2",_t,c(e.$t("pika.name.prompt")),1),s(r,{content:e.$t("pika.description.prompt"),class:"info"},null,8,["content"])]),s(d,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=a=>e.prompt=a),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("pika.placeholder.prompt"),maxlength:300,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var ft=y(pt,[["render",mt],["__scopeId","data-v-3f49f00e"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/config/PromptInput.vue"]]);const ht=b({name:"PresetPanel",components:{ImageUrlInput:rt,ElButton:D,FontAwesomeIcon:q,PromptInput:ft,IngredientsSelector:qe,IngredientsModelSelector:Ye,ModelSelector:st,EffectSelector:Ke},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.pika)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),gt={class:"panel"},kt={class:"config"},vt={class:"actions"};function $t(e,t,o,l,h,g){var N,T,A,w;const r=n("prompt-input"),d=n("model-selector"),a=n("ingredients-selector"),v=n("effect-selector"),f=n("image-url-input"),I=n("ingredients-model-selector"),V=n("font-awesome-icon"),_=n("el-button");return i(),u("div",gt,[p("div",kt,[s(r,{class:"mb-4"}),s(d,{class:"mb-4"}),s(a,{class:"mb-4"}),s(v,{class:"mb-4"}),(N=e.config)!=null&&N.ingredients?(i(),P(f,{key:0,class:"mb-4"})):k("v-if",!0),(T=e.config)!=null&&T.ingredients?(i(),P(I,{key:1,class:"mb-4"})):k("v-if",!0),p("div",vt,[((A=e.config)==null?void 0:A.video_url)!==void 0||((w=e.config)==null?void 0:w.custom)?(i(),P(_,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:m(()=>[s(V,{icon:"fa-solid fa-magic",class:"mr-2"}),$(" "+c(e.$t("pika.button.extend")),1)]),_:1},8,["onClick"])):(i(),P(_,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:m(()=>[s(V,{icon:"fa-solid fa-magic",class:"mr-2"}),$(" "+c(e.$t("pika.button.generate")),1)]),_:1},8,["onClick"]))])])])}var yt=y(ht,[["render",$t],["__scopeId","data-v-26d959d2"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/ConfigPanel.vue"]]);const bt=b({name:"VideoPlayer",components:{VuePlyr:le},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:"1080p"}}}}}),wt=["data-poster"],It=["src"];function St(e,t,o,l,h,g){const r=n("vue-plyr");return i(),u("div",null,[s(r,{options:e.options,class:"video"},{default:m(()=>{var d,a;return[p("video",{controls:"",crossorigin:"",playsinline:"","data-poster":(d=e.modelValue)==null?void 0:d.image_url},[p("source",{size:"1080",src:(a=e.modelValue)==null?void 0:a.video_url,type:"video/mp4"},null,8,It)],8,wt)]}),_:1},8,["options"])])}var Vt=y(bt,[["render",St],["__scopeId","data-v-3697e02c"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/VideoPlayer.vue"]]);const Et=b({name:"TaskPreview",components:{ElImage:ye,CopyToClipboard:Te,FontAwesomeIcon:q,ElAlert:be,VideoPlayer:Vt,ElTooltip:we,ElButton:D},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){var e;return(e=this.$store.state.pika)==null?void 0:e.application},config(){var e;return(e=this.$store.state.pika)==null?void 0:e.config},videos(){var o,l,h,g,r,d,a;let e=[];const t=(l=(o=this.modelValue)==null?void 0:o.request)==null?void 0:l.action;return Array.isArray((g=(h=this.modelValue)==null?void 0:h.response)==null?void 0:g.data)&&((a=(d=(r=this.modelValue)==null?void 0:r.response)==null?void 0:d.data)==null||a.forEach(v=>{let f=v;t&&(f.action=t),e.push(f)})),e}},methods:{onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onReload(e){const t=e.target,o=new URL(t.src),l=o.searchParams.get("retry");if(!l)o.searchParams.set("retry","1");else if(parseInt(l)<2)o.searchParams.set("retry",(parseInt(l)+1).toString());else return;t.src=o.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),Pt={class:"left"},Tt={class:"main"},At={class:"bot"},Ct={class:"datetime"},Nt={class:"info"},Ut={key:0,class:"prompt mt-2"},Rt={key:0},Gt={key:1},Dt={key:0,class:M({content:!0,failed:!0})},Mt={class:"image-wrapper"},Lt={key:0,class:M({operations:!0,"mt-2":!0})},Ot={class:"description"},qt={key:1,class:M({content:!0})},zt={class:"description"},Bt={class:"description"},jt={class:"description"},Ft={key:2,class:M({content:!0})},Ht={class:"description"};function Kt(e,t,o,l,h,g){const r=n("el-image"),d=n("VideoPlayer"),a=n("el-button"),v=n("el-tooltip"),f=n("font-awesome-icon"),I=n("copy-to-clipboard"),V=n("el-alert");return i(!0),u(U,null,R(e.videos,(_,N)=>{var T,A,w,G,B,j,F,H,K,J,Q;return i(),u("div",{key:N,class:"preview"},[p("div",Pt,[s(r,{src:"https://cdn.acedata.cloud/i80tgn.png",class:"avatar"})]),p("div",Tt,[p("div",At,[$(c(e.$t("pika.name.pikaBot"))+" ",1),p("span",Ct,c(e.$dayjs.format(""+new Date(parseFloat(((T=e.modelValue)==null?void 0:T.created_at)||"")*1e3))),1)]),p("div",Nt,[(w=(A=e.modelValue)==null?void 0:A.request)!=null&&w.prompt?(i(),u("p",Ut,[$(c((B=(G=e.modelValue)==null?void 0:G.request)==null?void 0:B.prompt)+" ",1),(j=e.modelValue)!=null&&j.response?k("v-if",!0):(i(),u("span",Rt," - ("+c(e.$t("pika.status.pending"))+") ",1)),(_==null?void 0:_.state)==="processing"||(_==null?void 0:_.state)==="pending"||(_==null?void 0:_.state)==="completed"?(i(),u("span",Gt," - ("+c(e.$t("pika.status.processing"))+") ",1)):k("v-if",!0)])):k("v-if",!0)]),k(" Display success message "),((H=(F=e.modelValue)==null?void 0:F.response)==null?void 0:H.success)===!0?(i(),u("div",Dt,[p("div",Mt,[s(d,{"model-value":_},null,8,["model-value"])]),_?(i(),u("div",Lt,[s(v,{class:"box-item",effect:"dark",content:e.$t("pika.message.downloadVideo"),placement:"top-start"},{default:m(()=>[s(a,{type:"info",size:"small",class:"btn-action",onClick:S=>e.onDownload(S,_==null?void 0:_.video_url)},{default:m(()=>[$(c(e.$t("pika.button.download")),1)]),_:2},1032,["onClick"])]),_:2},1032,["content"])])):k("v-if",!0),s(V,{closable:!1,class:"mt-2 success"},{default:m(()=>{var S,C;return[p("p",Ot,[s(f,{icon:"fa-solid fa-magic",class:"mr-1"}),$(" "+c(e.$t("pika.name.taskId"))+": "+c((S=e.modelValue)==null?void 0:S.id)+" ",1),s(I,{content:(C=e.modelValue)==null?void 0:C.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):k("v-if",!0),k(" Display error message "),((J=(K=e.modelValue)==null?void 0:K.response)==null?void 0:J.success)===!1?(i(),u("div",qt,[s(V,{closable:!1,class:"failure"},{template:m(()=>[s(f,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),$(" "+c(e.$t("pika.name.failure")),1)]),default:m(()=>{var S,C,W,X,Y,Z,x,ee,te,se,oe,ae;return[p("p",zt,[s(f,{icon:"fa-solid fa-magic",class:"mr-1"}),$(" "+c(e.$t("pika.name.taskId"))+": "+c((S=e.modelValue)==null?void 0:S.id)+" ",1),s(I,{content:(C=e.modelValue)==null?void 0:C.id,class:"btn-copy"},null,8,["content"])]),p("p",Bt,[s(f,{icon:"fa-solid fa-circle-info",class:"mr-1"}),$(" "+c(e.$t("pika.name.failureReason"))+": "+c((Y=(X=(W=e.modelValue)==null?void 0:W.response)==null?void 0:X.error)==null?void 0:Y.message)+" ",1),s(I,{content:(ee=(x=(Z=e.modelValue)==null?void 0:Z.response)==null?void 0:x.error)==null?void 0:ee.message,class:"btn-copy"},null,8,["content"])]),p("p",jt,[s(f,{icon:"fa-solid fa-hashtag",class:"mr-1"}),$(" "+c(e.$t("pika.name.traceId"))+": "+c((se=(te=e.modelValue)==null?void 0:te.response)==null?void 0:se.trace_id)+" ",1),s(I,{content:(ae=(oe=e.modelValue)==null?void 0:oe.response)==null?void 0:ae.trace_id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):k("v-if",!0),k(" Display error message "),!((Q=e.modelValue)!=null&&Q.response)||(_==null?void 0:_.state)==="processing"||(_==null?void 0:_.state)==="pending"?(i(),u("div",Ft,[s(V,{closable:!1,class:"info"},{template:m(()=>[s(f,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),$(" "+c(e.$t("pika.name.failure")),1)]),default:m(()=>{var S,C;return[p("p",Ht,[s(f,{icon:"fa-solid fa-magic",class:"mr-1"}),$(" "+c(e.$t("pika.name.taskId"))+": "+c((S=e.modelValue)==null?void 0:S.id)+" ",1),s(I,{content:(C=e.modelValue)==null?void 0:C.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):k("v-if",!0)])])}),128)}var Jt=y(Et,[["render",Kt],["__scopeId","data-v-90858984"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/task/Preview.vue"]]);const Qt=b({name:"RecentPanel",components:{TaskPreview:Jt,ElSkeleton:Ie,ElSkeletonItem:Se},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){var e,t,o,l;return{...(e=this.$store.state.pika)==null?void 0:e.tasks,items:(l=(o=(t=this.$store.state.pika)==null?void 0:t.tasks)==null?void 0:o.items)==null?void 0:l.slice()}}},methods:{onHandleScroll(){const e=this.$refs.panel;console.log("reach-top reach-top reach-top"),e.scrollTop===0&&this.$emit("reach-top")}}}),Wt={key:0,class:"tasks"},Xt={class:"left"},Yt={class:"main"},Zt={key:1,class:"tasks"},xt={key:2,class:"description"};function es(e,t,o,l,h,g){var v,f,I,V,_,N,T,A;const r=n("el-skeleton-item"),d=n("el-skeleton"),a=n("task-preview");return i(),u("div",{ref:"panel",class:"panel recent",onScroll:t[0]||(t[0]=(...w)=>e.onHandleScroll&&e.onHandleScroll(...w))},[((v=e.tasks)==null?void 0:v.items)===void 0?(i(),u("div",Wt,[(i(),u(U,null,R(3,w=>p("div",{key:w,class:"task placeholder"},[p("div",Xt,[s(d,{animated:""},{template:m(()=>[s(r,{variant:"image",class:"avatar"})]),_:1})]),p("div",Yt,[s(d,{animated:""},{template:m(()=>[s(r,{variant:"p",class:"title"}),s(r,{variant:"image",class:"icon"})]),_:1})])])),64))])):((I=(f=e.tasks)==null?void 0:f.items)==null?void 0:I.length)&&((_=(V=e.tasks)==null?void 0:V.items)==null?void 0:_.length)>0?(i(),u("div",Zt,[(i(!0),u(U,null,R((N=e.tasks)==null?void 0:N.items,(w,G)=>(i(),P(a,{key:G,"model-value":w,class:"preview"},null,8,["model-value"]))),128))])):k("v-if",!0),((A=(T=e.tasks)==null?void 0:T.items)==null?void 0:A.length)===0?(i(),u("p",xt,c(e.$t("pika.message.noTasks")),1)):k("v-if",!0)],544)}var ts=y(Qt,[["render",es],["__scopeId","data-v-be2bfa4e"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/RecentPanel.vue"]]);const ss="https://webhook.acedata.cloud/pika",os=b({name:"PikaIndex",components:{ConfigPanel:yt,Layout:Ge,ApplicationStatus:Ve,RecentPanel:ts},data(){return{task:void 0,job:0,timer:void 0}},computed:{loading(){var e,t;return((t=(e=this.$store.state.pika)==null?void 0:e.status)==null?void 0:t.getApplications)===L.Request},service(){return this.$store.state.pika.service},credential(){return this.$store.state.pika.credential},config(){return this.$store.state.pika.config},initializing(){return this.$store.state.pika.status.getApplications===L.Request},needApply(){return this.$store.state.pika.status.getApplications===L.Success&&!this.application},application(){return this.$store.state.pika.application},applications(){return this.$store.state.pika.applications},tasks(){return this.$store.state.pika.tasks}},watch:{tasks:{handler(e,t){var o,l;((o=e==null?void 0:e.items)==null?void 0:o.length)>((l=t==null?void 0:t.items)==null?void 0:l.length)&&console.debug("new tasks detected")},deep:!0}},async mounted(){await this.onGetService(),await this.onGetApplication(),await this.onScrollDown(),await this.onGetTasks(),this.job=setInterval(()=>{this.onGetTasks()},5e3)},async unmounted(){clearInterval(this.job),clearInterval(this.timer)},methods:{async onReachTop(){var e,t,o;console.debug("reached top"),await this.onGetTasks({createdAtMax:(o=(t=(e=this.tasks)==null?void 0:e.items)==null?void 0:t[0])==null?void 0:o.created_at})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("pika/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("pika/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){_e.create({application:this.application}).then(({data:e})=>{this.application=e,E.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{var t,o;((o=(t=e==null?void 0:e.response)==null?void 0:t.data)==null?void 0:o.code)===Ee&&E.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".recent");e&&(e.scrollTop=e.scrollHeight)},500)},async onGetTasks(e){if(this.loading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:o,createdAtMax:l}=e||{};console.debug("limit",t,"createdAtMin",o,"createdAtMax",l),await this.$store.dispatch("pika/getTasks",{limit:t,createdAtMin:o,createdAtMax:l})},async onGenerateVideo(){var o;const e={...this.config,callback_url:ss},t=(o=this.credential)==null?void 0:o.token;if(!t){console.error("no token specified");return}E.info(this.$t("pika.message.startingTask")),me.generate(e,{token:t}).then(()=>{E.success(this.$t("pika.message.startTaskSuccess")),this.$store.commit("pika/setConfig",{config:void 0})}).catch(l=>{var g,r;const h=(g=l==null?void 0:l.response)==null?void 0:g.data;((r=h==null?void 0:h.error)==null?void 0:r.code)===Pe?E.error(this.$t("pika.message.usedUp")):E.error(this.$t("pika.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function as(e,t,o,l,h,g){const r=n("config-panel"),d=n("application-status"),a=n("recent-panel"),v=n("layout");return i(),P(v,null,{config:m(()=>[s(r,{onGenerate:e.onGenerateVideo},null,8,["onGenerate"])]),result:m(()=>[s(d,{initializing:e.initializing,application:e.application,applications:e.applications,service:e.service,"need-apply":e.needApply,class:"mb-4",onRefresh:e.onGetApplication,onSelect:t[0]||(t[0]=f=>e.$store.dispatch("pika/setApplication",f))},null,8,["initializing","application","applications","service","need-apply","onRefresh"]),s(a,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"]),k(' <operation-panel class="panel operation" @generate="onGenerate" /> ')]),_:1})}var hs=y(os,[["render",as],["__scopeId","data-v-307eef94"],["__file","/home/runner/work/Nexior/Nexior/src/pages/pika/Index.vue"]]);export{hs as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{K as ne}from"./vendor-others.908494e8.js";import{aq as q}from"./vendor-fortawesome.56f9a0ee.js";import{V as ie}from"./VideoNavigator.92fd5341.js";import{_ as S,aT as le,M as re,T as M,F as ce,aU as ue}from"./index.c5936939.js";import{R as pe,l as D,K as de,L as me,N as _e,J as I,M as he,s as fe,B as ge,t as $e,y as ve,T as ye}from"./vendor-element-plus.bb793053.js";import{H as V,al as n,o as l,e as m,f as u,V as s,I as O,M as h,U as c,W as N,ai as G,L as A,T as y,S as v,Q as L}from"./vendor-@vue.37ef86f0.js";import{I as ae}from"./InfoIcon.746e870f.js";import{A as ke,i as we,h as be}from"./Status.a2dea48a.js";import{C as Ie}from"./CopyToClipboard.aaa1969a.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.7d3be879.js";const Se=V({name:"LayoutHailuo",components:{ElDrawer:pe,ElButton:D,FontAwesomeIcon:q,VideoNavigator:ie},data(){return{drawer:!1}}}),Ve={class:"main"},Pe={class:"config"},Te={class:"result"};function Ae(e,t,o,a,f,$){const p=n("video-navigator"),d=n("font-awesome-icon"),r=n("el-button"),g=n("el-drawer");return l(),m("div",Ve,[u("div",Pe,[s(p),O(e.$slots,"config",{},void 0,!0)]),u("div",Te,[O(e.$slots,"result",{},void 0,!0)]),s(r,{round:"",class:"menu",onClick:t[0]||(t[0]=_=>e.drawer=!0)},{default:h(()=>[s(d,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),s(g,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=_=>e.drawer=_),"with-header":!1,size:"340px",class:"drawer"},{default:h(()=>[O(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var Ee=S(Se,[["render",Ae],["__scopeId","data-v-3c8363f5"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Hailuo.vue"]]);const Ce=V({name:"ModelSelector",components:{ElSelect:de,ElOption:me},data(){return{}},computed:{options(){return[{value:"minimax-t2v",label:this.$t("hailuo.button.model1")},{value:"minimax-i2v",label:this.$t("hailuo.button.model2")}]},value:{get(){var e,t;return(t=(e=this.$store.state.hailuo)==null?void 0:e.config)==null?void 0:t.model},set(e){var t;this.$store.commit("hailuo/setConfig",{...(t=this.$store.state.hailuo)==null?void 0:t.config,model:e})}}},mounted(){this.value||(this.value=le)}}),Ue={class:"field"},Re={class:"title font-bold"},Ne={class:"float-left"};function Ge(e,t,o,a,f,$){const p=n("el-option"),d=n("el-select");return l(),m("div",Ue,[u("h2",Re,c(e.$t("hailuo.name.model")),1),s(d,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=r=>e.value=r),class:"value",placeholder:e.$t("hailuo.placeholder.select"),clearable:""},{default:h(()=>[(l(!0),m(N,null,G(e.options,r=>(l(),A(p,{key:r.value,label:r.label,value:r.value},{default:h(()=>[u("span",Ne,c(r.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}var De=S(Ce,[["render",Ge],["__scopeId","data-v-62190314"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/config/ModelSelector.vue"]]);const Le=V({name:"StartImageUrlInput",components:{ElUpload:_e,ElButton:D,InfoIcon:ae},data(){return{fileList:[],uploadUrl:re()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>{var t;return(t=e==null?void 0:e.response)==null?void 0:t.file_url})},value:{get(){var e,t;return(t=(e=this.$store.state.hailuo)==null?void 0:e.config)==null?void 0:t.first_image_url},set(e){var o,a;const t=(o=this.urls)==null?void 0:o[0];this.$store.commit("hailuo/setConfig",{...(a=this.$store.state.hailuo)==null?void 0:a.config,first_image_url:t})}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){I.warning(this.$t("hailuo.message.uploadStartImageExceed"))},onError(){I.error(this.$t("hailuo.message.uploadStartImageError"))},async onRemove(){I.error(this.$t("hailuo.message.uploadStartImageError"))},onSetStartImageUrl(){var t,o;const e=(t=this.urls)==null?void 0:t[0];this.$store.commit("hailuo/setConfig",{...(o=this.$store.state.hailuo)==null?void 0:o.config,first_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),Me={class:"field"},Oe={class:"title font-bold"},qe={class:"upload-wrapper"};function ze(e,t,o,a,f,$){const p=n("el-button"),d=n("el-upload"),r=n("info-icon");return l(),m("div",Me,[u("h2",Oe,c(e.$t("hailuo.name.startImageUrl")),1),u("div",qe,[s(d,{"file-list":e.fileList,"onUpdate:file-list":t[0]||(t[0]=g=>e.fileList=g),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-remove":e.onRemove,"on-success":e.onSuccess,headers:e.headers},{default:h(()=>[s(p,{size:"small",type:"primary",round:""},{default:h(()=>[y(c(e.$t("hailuo.button.uploadStartImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-remove","on-success","headers"])]),s(r,{content:e.$t("hailuo.description.startImageUrl"),class:"info"},null,8,["content"])])}var Be=S(Le,[["render",ze],["__scopeId","data-v-6c6b80d0"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/config/StartImageUrlInput.vue"]]);const He="",je=V({name:"PromptInput",components:{ElInput:he,InfoIcon:ae},computed:{prompt:{get(){var e,t;return(t=(e=this.$store.state.hailuo)==null?void 0:e.config)==null?void 0:t.prompt},set(e){var t;console.debug("set prompt",e),this.$store.commit("hailuo/setConfig",{...(t=this.$store.state.hailuo)==null?void 0:t.config,prompt:e})}}},mounted(){this.value||(this.value=He)}}),Fe={class:"field"},Ke={class:"box"},Je={class:"title font-bold"};function Qe(e,t,o,a,f,$){const p=n("info-icon"),d=n("el-input");return l(),m("div",Fe,[u("div",Ke,[u("h2",Je,c(e.$t("hailuo.name.prompt")),1),s(p,{content:e.$t("hailuo.description.prompt"),class:"info"},null,8,["content"])]),s(d,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=r=>e.prompt=r),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("hailuo.placeholder.prompt"),maxlength:300,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var We=S(je,[["render",Qe],["__scopeId","data-v-d785889c"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/config/PromptInput.vue"]]);const Xe=V({name:"PresetPanel",components:{ElButton:D,FontAwesomeIcon:q,PromptInput:We,StartImageUrlInput:Be,ModelSelector:De},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.hailuo)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),Ye={class:"panel"},Ze={class:"config"},xe={class:"actions"};function et(e,t,o,a,f,$){var k,b,i;const p=n("prompt-input"),d=n("model-selector"),r=n("start-image-url-input"),g=n("font-awesome-icon"),_=n("el-button");return l(),m("div",Ye,[u("div",Ze,[s(p,{class:"mb-4"}),s(d,{class:"mb-4"}),((k=e.config)==null?void 0:k.model)==="minimax-i2v"?(l(),A(r,{key:0,class:"mb-4"})):v("v-if",!0),u("div",xe,[((b=e.config)==null?void 0:b.video_url)!==void 0||((i=e.config)==null?void 0:i.custom)?(l(),A(_,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[s(g,{icon:"fa-solid fa-magic",class:"mr-2"}),y(" "+c(e.$t("hailuo.button.extend")),1)]),_:1},8,["onClick"])):(l(),A(_,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[s(g,{icon:"fa-solid fa-magic",class:"mr-2"}),y(" "+c(e.$t("hailuo.button.generate")),1)]),_:1},8,["onClick"]))])])])}var tt=S(Xe,[["render",et],["__scopeId","data-v-01eef439"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/ConfigPanel.vue"]]);const ot=V({name:"VideoPlayer",components:{VuePlyr:ne},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:"1080p"}}}}}),st=["data-poster"],at=["src"];function nt(e,t,o,a,f,$){const p=n("vue-plyr");return l(),m("div",null,[s(p,{options:e.options,class:"video"},{default:h(()=>{var d,r;return[u("video",{controls:"",crossorigin:"",playsinline:"","data-poster":(d=e.modelValue)==null?void 0:d.image_url},[u("source",{size:"1080",src:(r=e.modelValue)==null?void 0:r.video_url,type:"video/mp4"},null,8,at)],8,st)]}),_:1},8,["options"])])}var it=S(ot,[["render",nt],["__scopeId","data-v-11ad7a93"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/VideoPlayer.vue"]]);const lt=V({name:"TaskPreview",components:{ElImage:fe,CopyToClipboard:Ie,FontAwesomeIcon:q,ElAlert:ge,VideoPlayer:it,ElTooltip:$e,ElButton:D},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){var e;return(e=this.$store.state.hailuo)==null?void 0:e.application},config(){var e;return(e=this.$store.state.hailuo)==null?void 0:e.config},videos(){var o,a,f,$,p,d,r;let e=[];const t=(a=(o=this.modelValue)==null?void 0:o.request)==null?void 0:a.action;return Array.isArray(($=(f=this.modelValue)==null?void 0:f.response)==null?void 0:$.data)&&((r=(d=(p=this.modelValue)==null?void 0:p.response)==null?void 0:d.data)==null||r.forEach(g=>{let _=g;t&&(_.action=t),e.push(_)})),e}},methods:{onExtend(e,t){var o;e.stopPropagation(),console.debug("set config",t),this.$store.commit("hailuo/setConfig",{...(o=this.$store.state.hailuo)==null?void 0:o.config,video_id:t.video_id,prompt:t.prompt,action:"extend",thumbnail_url:t.thumbnail_url,video_url:t.video_url})},onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onReload(e){const t=e.target,o=new URL(t.src),a=o.searchParams.get("retry");if(!a)o.searchParams.set("retry","1");else if(parseInt(a)<2)o.searchParams.set("retry",(parseInt(a)+1).toString());else return;t.src=o.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),rt={class:"left"},ct={class:"main"},ut={class:"bot"},pt={class:"datetime"},dt={class:"info"},mt={key:0,class:"prompt mt-2"},_t={key:0},ht={key:1},ft={key:0,class:L({content:!0,failed:!0})},gt={class:"image-wrapper"},$t={key:0,class:L({operations:!0,"mt-2":!0})},vt={class:"description"},yt={key:1,class:L({content:!0})},kt={class:"description"},wt={class:"description"},bt={class:"description"},It={key:2,class:L({content:!0})},St={class:"description"};function Vt(e,t,o,a,f,$){const p=n("el-image"),d=n("VideoPlayer"),r=n("el-button"),g=n("el-tooltip"),_=n("font-awesome-icon"),k=n("copy-to-clipboard"),b=n("el-alert");return l(!0),m(N,null,G(e.videos,(i,U)=>{var E,C,P,R,z,B,H,j,F,K,J;return l(),m("div",{key:U,class:"preview"},[u("div",rt,[s(p,{src:"https://cdn.acedata.cloud/4tfwwz.png",class:"avatar"})]),u("div",ct,[u("div",ut,[y(c(e.$t("hailuo.name.hailuoBot"))+" ",1),u("span",pt,c(e.$dayjs.format(""+new Date(parseFloat(((E=e.modelValue)==null?void 0:E.created_at)||"")*1e3))),1)]),u("div",dt,[(P=(C=e.modelValue)==null?void 0:C.request)!=null&&P.prompt?(l(),m("p",mt,[y(c((z=(R=e.modelValue)==null?void 0:R.request)==null?void 0:z.prompt)+" ",1),(B=e.modelValue)!=null&&B.response?v("v-if",!0):(l(),m("span",_t," - ("+c(e.$t("hailuo.status.pending"))+") ",1)),(i==null?void 0:i.state)==="processing"||(i==null?void 0:i.state)==="pending"||(i==null?void 0:i.state)==="running"?(l(),m("span",ht," - ("+c(e.$t("hailuo.status.processing"))+") ",1)):v("v-if",!0)])):v("v-if",!0)]),v(" Display success message "),((j=(H=e.modelValue)==null?void 0:H.response)==null?void 0:j.success)===!0?(l(),m("div",ft,[u("div",gt,[s(d,{"model-value":i},null,8,["model-value"])]),i?(l(),m("div",$t,[s(g,{class:"box-item",effect:"dark",content:e.$t("hailuo.message.downloadVideo"),placement:"top-start"},{default:h(()=>[s(r,{type:"info",size:"small",class:"btn-action",onClick:w=>e.onDownload(w,i==null?void 0:i.video_url)},{default:h(()=>[y(c(e.$t("hailuo.button.download")),1)]),_:2},1032,["onClick"])]),_:2},1032,["content"])])):v("v-if",!0),s(b,{closable:!1,class:"mt-2 success"},{default:h(()=>{var w,T;return[u("p",vt,[s(_,{icon:"fa-solid fa-magic",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.taskId"))+": "+c((w=e.modelValue)==null?void 0:w.id)+" ",1),s(k,{content:(T=e.modelValue)==null?void 0:T.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):v("v-if",!0),v(" Display error message "),((K=(F=e.modelValue)==null?void 0:F.response)==null?void 0:K.success)===!1?(l(),m("div",yt,[s(b,{closable:!1,class:"failure"},{template:h(()=>[s(_,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.failure")),1)]),default:h(()=>{var w,T,Q,W,X,Y,Z,x,ee,te,oe,se;return[u("p",kt,[s(_,{icon:"fa-solid fa-magic",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.taskId"))+": "+c((w=e.modelValue)==null?void 0:w.id)+" ",1),s(k,{content:(T=e.modelValue)==null?void 0:T.id,class:"btn-copy"},null,8,["content"])]),u("p",wt,[s(_,{icon:"fa-solid fa-circle-info",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.failureReason"))+": "+c((X=(W=(Q=e.modelValue)==null?void 0:Q.response)==null?void 0:W.error)==null?void 0:X.message)+" ",1),s(k,{content:(x=(Z=(Y=e.modelValue)==null?void 0:Y.response)==null?void 0:Z.error)==null?void 0:x.message,class:"btn-copy"},null,8,["content"])]),u("p",bt,[s(_,{icon:"fa-solid fa-hashtag",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.traceId"))+": "+c((te=(ee=e.modelValue)==null?void 0:ee.response)==null?void 0:te.trace_id)+" ",1),s(k,{content:(se=(oe=e.modelValue)==null?void 0:oe.response)==null?void 0:se.trace_id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):v("v-if",!0),v(" Display error message "),!((J=e.modelValue)!=null&&J.response)||(i==null?void 0:i.state)==="processing"||(i==null?void 0:i.state)==="pending"||(i==null?void 0:i.state)==="running"?(l(),m("div",It,[s(b,{closable:!1,class:"info"},{template:h(()=>[s(_,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.failure")),1)]),default:h(()=>{var w,T;return[u("p",St,[s(_,{icon:"fa-solid fa-magic",class:"mr-1"}),y(" "+c(e.$t("hailuo.name.taskId"))+": "+c((w=e.modelValue)==null?void 0:w.id)+" ",1),s(k,{content:(T=e.modelValue)==null?void 0:T.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):v("v-if",!0)])])}),128)}var Pt=S(lt,[["render",Vt],["__scopeId","data-v-3f5aedb7"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/task/Preview.vue"]]);const Tt=V({name:"RecentPanel",components:{TaskPreview:Pt,ElSkeleton:ve,ElSkeletonItem:ye},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){var e,t,o,a;return{...(e=this.$store.state.hailuo)==null?void 0:e.tasks,items:(a=(o=(t=this.$store.state.hailuo)==null?void 0:t.tasks)==null?void 0:o.items)==null?void 0:a.slice()}}},methods:{onHandleScroll(){const e=this.$refs.panel;console.log("reach-top reach-top reach-top"),e.scrollTop===0&&this.$emit("reach-top")}}}),At={key:0,class:"tasks"},Et={class:"left"},Ct={class:"main"},Ut={key:1,class:"tasks"},Rt={key:2,class:"description"};function Nt(e,t,o,a,f,$){var g,_,k,b,i,U,E,C;const p=n("el-skeleton-item"),d=n("el-skeleton"),r=n("task-preview");return l(),m("div",{ref:"panel",class:"panel recent",onScroll:t[0]||(t[0]=(...P)=>e.onHandleScroll&&e.onHandleScroll(...P))},[((g=e.tasks)==null?void 0:g.items)===void 0?(l(),m("div",At,[(l(),m(N,null,G(3,P=>u("div",{key:P,class:"task placeholder"},[u("div",Et,[s(d,{animated:""},{template:h(()=>[s(p,{variant:"image",class:"avatar"})]),_:1})]),u("div",Ct,[s(d,{animated:""},{template:h(()=>[s(p,{variant:"p",class:"title"}),s(p,{variant:"image",class:"icon"})]),_:1})])])),64))])):((k=(_=e.tasks)==null?void 0:_.items)==null?void 0:k.length)&&((i=(b=e.tasks)==null?void 0:b.items)==null?void 0:i.length)>0?(l(),m("div",Ut,[(l(!0),m(N,null,G((U=e.tasks)==null?void 0:U.items,(P,R)=>(l(),A(r,{key:R,"model-value":P,class:"preview"},null,8,["model-value"]))),128))])):v("v-if",!0),((C=(E=e.tasks)==null?void 0:E.items)==null?void 0:C.length)===0?(l(),m("p",Rt,c(e.$t("hailuo.message.noTasks")),1)):v("v-if",!0)],544)}var Gt=S(Tt,[["render",Nt],["__scopeId","data-v-7bff9d40"],["__file","/home/runner/work/Nexior/Nexior/src/components/hailuo/RecentPanel.vue"]]);const Dt="https://webhook.acedata.cloud/hailuo",Lt=V({name:"HailuoIndex",components:{ConfigPanel:tt,Layout:Ee,ApplicationStatus:ke,RecentPanel:Gt},data(){return{task:void 0,job:0,timer:void 0}},computed:{loading(){var e,t;return((t=(e=this.$store.state.hailuo)==null?void 0:e.status)==null?void 0:t.getApplications)===M.Request},service(){return this.$store.state.hailuo.service},credential(){return this.$store.state.hailuo.credential},config(){return this.$store.state.hailuo.config},initializing(){return this.$store.state.hailuo.status.getApplications===M.Request},needApply(){return this.$store.state.hailuo.status.getApplications===M.Success&&!this.application},application(){return this.$store.state.hailuo.application},applications(){return this.$store.state.hailuo.applications},tasks(){return this.$store.state.hailuo.tasks}},watch:{tasks:{handler(e,t){var o,a;((o=e==null?void 0:e.items)==null?void 0:o.length)>((a=t==null?void 0:t.items)==null?void 0:a.length)&&console.debug("new tasks detected")},deep:!0}},async mounted(){await this.onGetService(),await this.onGetApplication(),await this.onScrollDown(),await this.onGetTasks(),await this.onScrollDown(),this.job=setInterval(()=>{this.onGetTasks()},5e3)},async unmounted(){clearInterval(this.job),clearInterval(this.timer)},methods:{async onReachTop(){var e,t,o;console.debug("reached top"),await this.onGetTasks({createdAtMax:(o=(t=(e=this.tasks)==null?void 0:e.items)==null?void 0:t[0])==null?void 0:o.created_at})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("hailuo/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("hailuo/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){ce.create({application:this.application}).then(({data:e})=>{this.application=e,I.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{var t,o;((o=(t=e==null?void 0:e.response)==null?void 0:t.data)==null?void 0:o.code)===we&&I.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".recent");e&&(e.scrollTop=e.scrollHeight)},500)},async onGetTasks(e){if(this.loading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:o,createdAtMax:a}=e||{};console.debug("limit",t,"createdAtMin",o,"createdAtMax",a),await this.$store.dispatch("hailuo/getTasks",{limit:t,createdAtMin:o,createdAtMax:a})},async onGenerateVideo(){var o;const e={...this.config,callback_url:Dt},t=(o=this.credential)==null?void 0:o.token;if(!t){console.error("no token specified");return}I.info(this.$t("hailuo.message.startingTask")),ue.generate(e,{token:t}).then(()=>{I.success(this.$t("hailuo.message.startTaskSuccess")),this.$store.commit("hailuo/setConfig",{config:void 0})}).catch(a=>{var $,p;const f=($=a==null?void 0:a.response)==null?void 0:$.data;((p=f==null?void 0:f.error)==null?void 0:p.code)===be?I.error(this.$t("hailuo.message.usedUp")):I.error(this.$t("hailuo.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function Mt(e,t,o,a,f,$){const p=n("config-panel"),d=n("application-status"),r=n("recent-panel"),g=n("layout");return l(),A(g,null,{config:h(()=>[s(p,{onGenerate:e.onGenerateVideo},null,8,["onGenerate"])]),result:h(()=>[s(d,{initializing:e.initializing,application:e.application,applications:e.applications,service:e.service,"need-apply":e.needApply,class:"mb-4",onRefresh:e.onGetApplication,onSelect:t[0]||(t[0]=_=>e.$store.dispatch("hailuo/setApplication",_))},null,8,["initializing","application","applications","service","need-apply","onRefresh"]),s(r,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"]),v(' <operation-panel class="panel operation" @generate="onGenerate" /> ')]),_:1})}var Xt=S(Lt,[["render",Mt],["__scopeId","data-v-1f8aa246"],["__file","/home/runner/work/Nexior/Nexior/src/pages/hailuo/Index.vue"]]);export{Xt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./vendor-others.908494e8.js";import{L as N}from"./Chatdoc.ad1bb23a.js";import{_ as y,T as g,ak as D}from"./index.c5936939.js";import{aq as v}from"./vendor-fortawesome.56f9a0ee.js";import{l as S,E as F,F as B,G as M,M as T,J as u,r as U,i as z,h as L,d as q,e as G,f as H}from"./vendor-element-plus.bb793053.js";import{H as w,al as o,o as _,e as C,V as t,M as s,T as R,U as r,f as i,W as b,L as $,ai as O,S as J}from"./vendor-@vue.37ef86f0.js";import{A as K}from"./Status.a2dea48a.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.7d3be879.js";const W=w({name:"CreateRepository",components:{ElButton:S,ElDialog:F,ElForm:B,ElFormItem:M,ElInput:T,FontAwesomeIcon:v},data(){return{dialogVisible:!1,creating:!1,form:{name:"",description:""}}},computed:{},methods:{async onSubmit(){if(!this.form.name){u.error(this.$t("chatdoc.message.nameRequired"));return}this.creating=!0,this.$store.dispatch("chatdoc/createRepository",{name:this.form.name,description:this.form.description}).then(()=>{this.creating=!1,u.success(this.$t("chatdoc.message.createRepositorySuccess")),this.dialogVisible=!1,this.$store.dispatch("chatdoc/getRepositories")}).catch(()=>{this.creating=!1,u.error(this.$t("chatdoc.message.createRepositoryFailed"))})}}});function j(e,a,V,k,E,A){const p=o("el-input"),l=o("el-form-item"),d=o("el-button"),m=o("el-form"),h=o("el-dialog"),f=o("font-awesome-icon");return _(),C(b,null,[t(h,{modelValue:e.dialogVisible,"onUpdate:modelValue":a[2]||(a[2]=n=>e.dialogVisible=n),width:"400px"},{default:s(()=>[t(m,{ref:"form","label-width":"60px"},{default:s(()=>[t(l,{label:e.$t("chatdoc.field.name"),prop:e.form.name},{default:s(()=>[t(p,{modelValue:e.form.name,"onUpdate:modelValue":a[0]||(a[0]=n=>e.form.name=n),placeholder:e.$t("chatdoc.message.inputRepositoryName")},null,8,["modelValue","placeholder"])]),_:1},8,["label","prop"]),t(l,{label:e.$t("chatdoc.field.description"),prop:e.form.description},{default:s(()=>[t(p,{modelValue:e.form.description,"onUpdate:modelValue":a[1]||(a[1]=n=>e.form.description=n),placeholder:e.$t("chatdoc.message.inputRepositoryDescription")},null,8,["modelValue","placeholder"])]),_:1},8,["label","prop"]),t(l,null,{default:s(()=>[t(d,{type:"primary",round:"",onClick:e.onSubmit},{default:s(()=>[R(r(e.$t("common.button.create")),1)]),_:1},8,["onClick"])]),_:1})]),_:1},512)]),_:1},8,["modelValue"]),i("button",{class:"btn btn-create",onClick:a[3]||(a[3]=n=>e.dialogVisible=!0)},[t(f,{icon:["fas","plus"]})])],64)}var P=y(W,[["render",j],["__scopeId","data-v-41eec665"],["__file","/home/runner/work/Nexior/Nexior/src/components/chatdoc/CreateRepository.vue"]]);const Q=w({name:"ChatdocKnowledge",components:{Layout:N,ElCard:U,ElRow:z,ElCol:L,CreateRepository:P,FontAwesomeIcon:v,ElDropdown:q,ElDropdownItem:G,ElDropdownMenu:H,ApplicationStatus:K},data(){return{}},computed:{repositories(){return this.$store.state.chatdoc.repositories},needApply(){return this.$store.state.chatdoc.status.getApplications===g.Success&&!this.application},application(){return this.$store.state.chatdoc.application},service(){return this.$store.state.chatdoc.service},initializing(){return this.$store.state.chatdoc.status.getApplications===g.Request}},async mounted(){},methods:{onClick(e){this.$router.push({name:D,params:{repositoryId:e.id}})},onDelete(e){this.$store.dispatch("chatdoc/deleteRepository",{id:e}).then(()=>{u.success(this.$t("chatdoc.message.deleteRepositorySuccess")),this.$store.dispatch("chatdoc/getRepositories")})}}}),X={class:"wrapper"},Y={class:"title"},Z={class:"introduction"},x={class:"status"},ee={class:"operation"},oe={class:"name"},te={class:"id"},se={class:"description"};function ae(e,a,V,k,E,A){const p=o("application-status"),l=o("create-repository"),d=o("el-card"),m=o("el-col"),h=o("font-awesome-icon");o("el-dropdown-item"),o("el-dropdown-menu"),o("el-dropdown");const f=o("el-row"),n=o("layout");return _(),$(n,null,{chatdoc:s(()=>[i("div",X,[i("div",Y,r(e.$t("chatdoc.title.repositories")),1),i("div",Z,r(e.$t("chatdoc.message.introductionForRepository")),1),i("div",x,[t(p,{"show-price":!1,initializing:e.initializing,application:e.application,"need-apply":e.needApply,service:e.service,onRefresh:a[0]||(a[0]=c=>e.$store.dispatch("chatdoc/getApplications"))},null,8,["initializing","application","need-apply","service"])]),t(f,{class:"repositories",gutter:15},{default:s(()=>[t(m,{xl:4,md:6,sm:12,xs:24},{default:s(()=>[t(d,{class:"repository text-center",shadow:"hover",onClick:e.onCreate},{default:s(()=>[t(l),i("p",ee,r(e.$t("chatdoc.title.createRepository")),1)]),_:1},8,["onClick"])]),_:1}),(_(!0),C(b,null,O(e.repositories,(c,I)=>(_(),$(m,{key:I,xl:4,md:6,sm:12,xs:24},{default:s(()=>[t(d,{class:"repository",shadow:"hover",onClick:ie=>e.onClick(c)},{default:s(()=>[J("v-if",!0),i("h2",oe,r(c.name),1),i("p",te,[t(h,{icon:["fas","book"]}),R(" ID: "+r(c.id),1)]),i("p",se,r(c.description),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1})])]),_:1})}var he=y(Q,[["render",ae],["__scopeId","data-v-52a67922"],["__file","/home/runner/work/Nexior/Nexior/src/pages/chatdoc/Index.vue"]]);export{he as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{K as ve}from"./vendor-others.908494e8.js";import{aq as K}from"./vendor-fortawesome.56f9a0ee.js";import{V as ge}from"./VideoNavigator.92fd5341.js";import{_ as k,aD as $e,aE as ye,aF as be,M as Q,T as B,F as ke,aG as we}from"./index.c5936939.js";import{R as Ie,l as R,Q as J,N as W,J as y,M as Ve,s as Se,B as Ee,t as Ue,y as Ce,T as Le}from"./vendor-element-plus.bb793053.js";import{H as w,al as n,o as r,e as p,f as i,V as s,I as H,M as m,U as l,T as $,L as N,S as v,Q as q,W as fe,ai as he}from"./vendor-@vue.37ef86f0.js";import{I as T}from"./InfoIcon.746e870f.js";import{A as Ne,i as Pe,h as Ae}from"./Status.a2dea48a.js";import{C as Te}from"./CopyToClipboard.aaa1969a.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.7d3be879.js";const Re=w({name:"LayoutLuma",components:{ElDrawer:Ie,ElButton:R,FontAwesomeIcon:K,VideoNavigator:ge},data(){return{drawer:!1}}}),Ge={class:"main"},De={class:"config"},ze={class:"result"};function Me(e,t,o,a,h,g){const c=n("video-navigator"),u=n("font-awesome-icon"),d=n("el-button"),_=n("el-drawer");return r(),p("div",Ge,[i("div",De,[s(c),H(e.$slots,"config",{},void 0,!0)]),i("div",ze,[H(e.$slots,"result",{},void 0,!0)]),s(d,{round:"",class:"menu",onClick:t[0]||(t[0]=f=>e.drawer=!0)},{default:m(()=>[s(u,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),s(_,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=f=>e.drawer=f),"with-header":!1,size:"340px",class:"drawer"},{default:m(()=>[H(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var Fe=k(Re,[["render",Me],["__scopeId","data-v-234cfb9c"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Luma.vue"]]);const Oe=w({name:"EnhancementSelector",components:{ElSwitch:J,InfoIcon:T},computed:{value:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.enhancement},set(e){var t;console.debug("set enhancement",e),this.$store.commit("luma/setConfig",{...(t=this.$store.state.luma)==null?void 0:t.config,enhancement:e})}}},mounted(){this.value===void 0&&(this.value=$e)}}),je={class:"field"},qe={class:"title font-bold"};function Be(e,t,o,a,h,g){const c=n("el-switch"),u=n("info-icon");return r(),p("div",je,[i("h2",qe,l(e.$t("luma.name.enhancement")),1),s(c,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),class:"value"},null,8,["modelValue"]),s(u,{content:e.$t("luma.description.enhancement"),class:"info"},null,8,["content"])])}var He=k(Oe,[["render",Be],["__scopeId","data-v-175365a0"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/EnhancementSelector.vue"]]);const Ke=w({name:"CustomSelector",components:{ElSwitch:J,InfoIcon:T},computed:{value:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.custom},set(e){var t;console.debug("set custom",e),this.$store.commit("luma/setConfig",{...(t=this.$store.state.luma)==null?void 0:t.config,custom:e})}}},mounted(){this.value===void 0&&(this.value=ye)}}),Qe={class:"field"},Je={class:"title font-bold"};function We(e,t,o,a,h,g){const c=n("el-switch"),u=n("info-icon");return r(),p("div",Qe,[i("h2",Je,l(e.$t("luma.name.custom")),1),s(c,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),class:"value"},null,8,["modelValue"]),s(u,{content:e.$t("luma.description.custom"),class:"info"},null,8,["content"])])}var Xe=k(Ke,[["render",We],["__scopeId","data-v-5ac2addb"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/CustomSelector.vue"]]);const Ye=w({name:"LoopSelector",components:{ElSwitch:J,InfoIcon:T},computed:{value:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.loop},set(e){var t;console.debug("set loop",e),this.$store.commit("luma/setConfig",{...(t=this.$store.state.luma)==null?void 0:t.config,loop:e})}}},mounted(){this.value===void 0&&(this.value=be)}}),Ze={class:"field"},xe={class:"title font-bold"};function et(e,t,o,a,h,g){const c=n("el-switch"),u=n("info-icon");return r(),p("div",Ze,[i("h2",xe,l(e.$t("luma.name.loop")),1),s(c,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),class:"value"},null,8,["modelValue"]),s(u,{content:e.$t("luma.description.loop"),class:"info"},null,8,["content"])])}var tt=k(Ye,[["render",et],["__scopeId","data-v-69cccd4e"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/LoopSelector.vue"]]);const ot=w({name:"ContentInput",components:{ElUpload:W,ElButton:R,InfoIcon:T},data(){return{fileList:[],uploadUrl:Q()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>{var t;return(t=e==null?void 0:e.response)==null?void 0:t.file_url})},value:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.end_image_url},set(e){var o,a;const t=(o=this.urls)==null?void 0:o[0];this.$store.commit("luma/setConfig",{...(a=this.$store.state.luma)==null?void 0:a.config,end_image_url:t})}}},mounted(){this.value||(this.value=void 0),this.onSetEndImageUrl()},methods:{onExceed(){y.warning(this.$t("luma.message.uploadEndImageExceed"))},onError(){y.error(this.$t("luma.message.uploadEndImageError"))},onSetEndImageUrl(){var t,o;const e=(t=this.urls)==null?void 0:t[0];this.$store.commit("luma/setConfig",{...(o=this.$store.state.luma)==null?void 0:o.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),st={class:"field"},nt={class:"title font-bold"},at={class:"upload-wrapper"};function it(e,t,o,a,h,g){const c=n("el-button"),u=n("el-upload"),d=n("info-icon");return r(),p("div",st,[i("h2",nt,l(e.$t("luma.name.endImageUrl")),1),i("div",at,[s(u,{"file-list":e.fileList,"onUpdate:file-list":t[0]||(t[0]=_=>e.fileList=_),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{default:m(()=>[s(c,{size:"small",type:"primary",round:""},{default:m(()=>[$(l(e.$t("luma.button.uploadEndImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])]),s(d,{content:e.$t("luma.description.endImageUrl"),class:"info"},null,8,["content"])])}var lt=k(ot,[["render",it],["__scopeId","data-v-97900bb4"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/EndImageUrlInput.vue"]]);const rt=w({name:"StartImageUrlInput",components:{ElUpload:W,ElButton:R,InfoIcon:T},data(){return{fileList:[],uploadUrl:Q()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>{var t;return(t=e==null?void 0:e.response)==null?void 0:t.file_url})},value:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.start_image_url},set(e){var o,a;const t=(o=this.urls)==null?void 0:o[0];this.$store.commit("luma/setConfig",{...(a=this.$store.state.luma)==null?void 0:a.config,start_image_url:t})}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){y.warning(this.$t("luma.message.uploadStartImageExceed"))},onError(){y.error(this.$t("luma.message.uploadStartImageError"))},async onRemove(){y.error(this.$t("luma.message.uploadStartImageError"))},onSetStartImageUrl(){var t,o;const e=(t=this.urls)==null?void 0:t[0];this.$store.commit("luma/setConfig",{...(o=this.$store.state.luma)==null?void 0:o.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),ct={class:"field"},ut={class:"title font-bold"},dt={class:"upload-wrapper"};function mt(e,t,o,a,h,g){const c=n("el-button"),u=n("el-upload"),d=n("info-icon");return r(),p("div",ct,[i("h2",ut,l(e.$t("luma.name.startImageUrl")),1),i("div",dt,[s(u,{"file-list":e.fileList,"onUpdate:file-list":t[0]||(t[0]=_=>e.fileList=_),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-remove":e.onRemove,"on-success":e.onSuccess,headers:e.headers},{default:m(()=>[s(c,{size:"small",type:"primary",round:""},{default:m(()=>[$(l(e.$t("luma.button.uploadStartImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-remove","on-success","headers"])]),s(d,{content:e.$t("luma.description.startImageUrl"),class:"info"},null,8,["content"])])}var pt=k(rt,[["render",mt],["__scopeId","data-v-5440a4bf"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/StartImageUrlInput.vue"]]);const _t=w({name:"UploadVideo",components:{ElUpload:W,ElButton:R,InfoIcon:T},data(){return{fileList:[],uploadUrl:Q()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>{var t;return(t=e==null?void 0:e.response)==null?void 0:t.file_url})},value:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.video_url},set(e){var o,a;const t=(o=this.urls)==null?void 0:o[0];this.$store.commit("luma/setConfig",{...(a=this.$store.state.luma)==null?void 0:a.config,video_url:t})}}},mounted(){this.value||(this.value=void 0)},methods:{onExceed(){y.warning(this.$t("luma.message.uploadVideoExceed"))},onError(){y.error(this.$t("luma.message.uploadVideoError"))},beforeUpload(e){const t=e.type==="video/mp4",o=e.size/1024/1024<10;return t?o?!0:(y.error(this.$t("luma.message.uploadVideoSizeExceed")),!1):(y.error(this.$t("luma.message.uploadVideoTypeFailed")),!1)},onSetVideoUrl(){var t,o;const e=(t=this.urls)==null?void 0:t[0];this.$store.commit("luma/setConfig",{...(o=this.$store.state.luma)==null?void 0:o.config,video_url:e,action:"extend"})},async onSuccess(){this.onSetVideoUrl()}}}),ft={class:"field"},ht={class:"title font-bold"},vt={class:"upload-wrapper"};function gt(e,t,o,a,h,g){const c=n("el-button"),u=n("el-upload"),d=n("info-icon");return r(),p("div",ft,[i("h2",ht,l(e.$t("luma.name.videoUrl")),1),i("div",vt,[s(u,{"file-list":e.fileList,"onUpdate:file-list":t[0]||(t[0]=_=>e.fileList=_),accept:".mp4",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"before-upload":e.beforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{default:m(()=>[s(c,{size:"small",type:"primary",round:""},{default:m(()=>[$(l(e.$t("luma.button.uploadVideoUrl")),1)]),_:1})]),_:1},8,["file-list","action","before-upload","on-exceed","on-error","on-success","headers"])]),s(d,{content:e.$t("luma.description.videoUrl"),class:"info"},null,8,["content"])])}var $t=k(_t,[["render",gt],["__scopeId","data-v-46c66c9f"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/UploadVideo.vue"]]);const yt="",bt=w({name:"PromptInput",components:{ElInput:Ve,InfoIcon:T},computed:{prompt:{get(){var e,t;return(t=(e=this.$store.state.luma)==null?void 0:e.config)==null?void 0:t.prompt},set(e){var t;console.debug("set prompt",e),this.$store.commit("luma/setConfig",{...(t=this.$store.state.luma)==null?void 0:t.config,prompt:e})}}},mounted(){this.value||(this.value=yt)}}),kt={class:"field"},wt={class:"box"},It={class:"title font-bold"};function Vt(e,t,o,a,h,g){const c=n("info-icon"),u=n("el-input");return r(),p("div",kt,[i("div",wt,[i("h2",It,l(e.$t("luma.name.prompt")),1),s(c,{content:e.$t("luma.description.prompt"),class:"info"},null,8,["content"])]),s(u,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=d=>e.prompt=d),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("luma.placeholder.prompt"),maxlength:2e3,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var St=k(bt,[["render",Vt],["__scopeId","data-v-19a7446b"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/PromptInput.vue"]]);const Et=w({name:"ExtendFromInput",components:{VuePlyr:ve},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:"1080p"}}}},computed:{config(){var e;return(e=this.$store.state.luma)==null?void 0:e.config}}}),Ut={class:"field"},Ct={class:"box"},Lt={class:"title font-bold"},Nt={class:"task"},Pt=["data-poster"],At=["src"];function Tt(e,t,o,a,h,g){const c=n("vue-plyr");return r(),p("div",Ut,[i("div",Ct,[i("h2",Lt,l(e.$t("luma.name.extend")),1)]),i("div",Nt,[i("div",null,[s(c,{options:e.options,class:"video"},{default:m(()=>{var u,d;return[i("video",{controls:"",crossorigin:"",playsinline:"","data-poster":(u=e.config)==null?void 0:u.thumbnail_url},[i("source",{size:"1080",src:(d=e.config)==null?void 0:d.video_url,type:"video/mp4"},null,8,At)],8,Pt)]}),_:1},8,["options"])])])])}var Rt=k(Et,[["render",Tt],["__scopeId","data-v-1cefb16b"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/ExtendFromInput.vue"]]);const Gt=w({name:"PresetPanel",components:{LoopSelector:tt,StartImageUrlInput:pt,EndImageUrlInput:lt,EnhancementSelector:He,ElButton:R,FontAwesomeIcon:K,PromptInput:St,ExtendFromInput:Rt,CustomSelector:Xe,UploadVideo:$t},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.luma)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),Dt={class:"panel"},zt={class:"config"},Mt={class:"actions"};function Ft(e,t,o,a,h,g){var L,V,A,G,D,z,M,F,O;const c=n("extend-from-input"),u=n("prompt-input"),d=n("custom-selector"),_=n("upload-video"),f=n("start-image-url-input"),S=n("end-image-url-input"),E=n("enhancement-selector"),P=n("loop-selector"),U=n("font-awesome-icon"),C=n("el-button");return r(),p("div",Dt,[i("div",zt,[((L=e.config)==null?void 0:L.video_id)||((V=e.config)==null?void 0:V.video_url)?(r(),N(c,{key:0,class:"mb-4"})):v("v-if",!0),s(u,{class:"mb-4"}),(A=e.config)!=null&&A.video_id?v("v-if",!0):(r(),N(d,{key:1,class:"mb-4"})),(G=e.config)!=null&&G.custom?(r(),N(_,{key:2,class:"mb-4"})):v("v-if",!0),!(((D=e.config)==null?void 0:D.video_id)||((z=e.config)==null?void 0:z.video_url))&&!((M=e.config)!=null&&M.custom)?(r(),N(f,{key:3,class:"mb-4"})):v("v-if",!0),s(S,{class:"mb-4"}),s(E,{class:"mb-4"}),s(P,{class:"mb-4"}),i("div",Mt,[((F=e.config)==null?void 0:F.video_url)!==void 0||((O=e.config)==null?void 0:O.custom)?(r(),N(C,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:m(()=>[s(U,{icon:"fa-solid fa-magic",class:"mr-2"}),$(" "+l(e.$t("luma.button.extend")),1)]),_:1},8,["onClick"])):(r(),N(C,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:m(()=>[s(U,{icon:"fa-solid fa-magic",class:"mr-2"}),$(" "+l(e.$t("luma.button.generate")),1)]),_:1},8,["onClick"]))])])])}var Ot=k(Gt,[["render",Ft],["__scopeId","data-v-951b4cc0"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/ConfigPanel.vue"]]);const jt=w({name:"VideoPlayer",components:{VuePlyr:ve},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:"1080p"}}}}}),qt=["data-poster"],Bt=["src"];function Ht(e,t,o,a,h,g){const c=n("vue-plyr");return r(),p("div",null,[s(c,{options:e.options,class:"video"},{default:m(()=>{var u,d,_,f;return[i("video",{controls:"",crossorigin:"",playsinline:"","data-poster":(d=(u=e.modelValue)==null?void 0:u.response)==null?void 0:d.thumbnail_url},[i("source",{size:"1080",src:(f=(_=e.modelValue)==null?void 0:_.response)==null?void 0:f.video_url,type:"video/mp4"},null,8,Bt)],8,qt)]}),_:1},8,["options"])])}var Kt=k(jt,[["render",Ht],["__scopeId","data-v-759e400c"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/VideoPlayer.vue"]]);const Qt=w({name:"TaskPreview",components:{ElImage:Se,CopyToClipboard:Te,FontAwesomeIcon:K,ElAlert:Ee,VideoPlayer:Kt,ElTooltip:Ue,ElButton:R},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){var e;return(e=this.$store.state.luma)==null?void 0:e.application},config(){var e;return(e=this.$store.state.luma)==null?void 0:e.config}},methods:{onExtend(e,t){var o;e.stopPropagation(),console.debug("set config",t),this.$store.commit("luma/setConfig",{...(o=this.$store.state.luma)==null?void 0:o.config,video_id:t.video_id,prompt:t.prompt,action:"extend",thumbnail_url:t.thumbnail_url,video_url:t.video_url})},onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onReload(e){const t=e.target,o=new URL(t.src),a=o.searchParams.get("retry");if(!a)o.searchParams.set("retry","1");else if(parseInt(a)<2)o.searchParams.set("retry",(parseInt(a)+1).toString());else return;t.src=o.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),Jt={class:"preview"},Wt={class:"left"},Xt={class:"main"},Yt={class:"bot"},Zt={class:"datetime"},xt={class:"info"},eo={key:0,class:"prompt mt-2"},to={key:0},oo={key:1},so={key:0,class:q({content:!0,failed:!0})},no={class:"image-wrapper"},ao={key:0,class:q({operations:!0,"mt-2":!0})},io={class:"description"},lo={key:1,class:q({content:!0})},ro={class:"description"},co={class:"description"},uo={class:"description"},mo={key:2,class:q({content:!0})},po={class:"description"};function _o(e,t,o,a,h,g){var P,U,C,L,V,A,G,D,z,M,F,O,X,Y,Z,x,ee,te,oe,se,ne,ae,ie;const c=n("el-image"),u=n("VideoPlayer"),d=n("el-button"),_=n("el-tooltip"),f=n("font-awesome-icon"),S=n("copy-to-clipboard"),E=n("el-alert");return r(),p("div",Jt,[i("div",Wt,[s(c,{src:"https://cdn.acedata.cloud/ahjfwi.png",class:"avatar"})]),i("div",Xt,[i("div",Yt,[$(l(e.$t("luma.name.lumaBot"))+" ",1),i("span",Zt,l(e.$dayjs.format(""+new Date(parseFloat(((P=e.modelValue)==null?void 0:P.created_at)||"")*1e3))),1)]),i("div",xt,[(C=(U=e.modelValue)==null?void 0:U.request)!=null&&C.prompt?(r(),p("p",eo,[$(l((V=(L=e.modelValue)==null?void 0:L.request)==null?void 0:V.prompt)+" ",1),(A=e.modelValue)!=null&&A.response?v("v-if",!0):(r(),p("span",to," - ("+l(e.$t("luma.status.pending"))+") ",1)),((D=(G=e.modelValue)==null?void 0:G.response)==null?void 0:D.state)==="processing"||((M=(z=e.modelValue)==null?void 0:z.response)==null?void 0:M.state)==="pending"?(r(),p("span",oo," - ("+l(e.$t("luma.status.processing"))+") ",1)):v("v-if",!0)])):v("v-if",!0)]),v(" Display success message "),((O=(F=e.modelValue)==null?void 0:F.response)==null?void 0:O.success)===!0?(r(),p("div",so,[i("div",no,[s(u,{"model-value":e.modelValue},null,8,["model-value"])]),((X=e.modelValue)==null?void 0:X.response)&&!((Y=e.config)!=null&&Y.custom)?(r(),p("div",ao,[s(_,{class:"box-item",effect:"dark",content:e.$t("luma.message.extendVideo"),placement:"top-start"},{default:m(()=>[s(d,{type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=I=>{var b;return e.onExtend(I,(b=e.modelValue)==null?void 0:b.response)})},{default:m(()=>[$(l(e.$t("luma.button.extend")),1)]),_:1})]),_:1},8,["content"]),s(_,{class:"box-item",effect:"dark",content:e.$t("luma.message.downloadVideo"),placement:"top-start"},{default:m(()=>[s(d,{type:"info",size:"small",class:"btn-action",onClick:t[1]||(t[1]=I=>{var b,j;return e.onDownload(I,(j=(b=e.modelValue)==null?void 0:b.response)==null?void 0:j.video_url)})},{default:m(()=>[$(l(e.$t("luma.button.download")),1)]),_:1})]),_:1},8,["content"])])):v("v-if",!0),s(E,{closable:!1,class:"mt-2 success"},{default:m(()=>{var I,b;return[i("p",io,[s(f,{icon:"fa-solid fa-magic",class:"mr-1"}),$(" "+l(e.$t("luma.name.taskId"))+": "+l((I=e.modelValue)==null?void 0:I.id)+" ",1),s(S,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):v("v-if",!0),v(" Display error message "),((x=(Z=e.modelValue)==null?void 0:Z.response)==null?void 0:x.state)==="failed"||((te=(ee=e.modelValue)==null?void 0:ee.response)==null?void 0:te.success)===!1?(r(),p("div",lo,[s(E,{closable:!1,class:"failure"},{template:m(()=>[s(f,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),$(" "+l(e.$t("luma.name.failure")),1)]),default:m(()=>{var I,b,j,le,re,ce,ue,de,me,pe,_e;return[i("p",ro,[s(f,{icon:"fa-solid fa-magic",class:"mr-1"}),$(" "+l(e.$t("luma.name.taskId"))+": "+l((I=e.modelValue)==null?void 0:I.id)+" ",1),s(S,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])]),i("p",co,[s(f,{icon:"fa-solid fa-circle-info",class:"mr-1"}),$(" "+l(e.$t("luma.name.failureReason"))+": "+l((re=(le=(j=e.modelValue)==null?void 0:j.response)==null?void 0:le.error)==null?void 0:re.message)+" ",1),s(S,{content:(de=(ue=(ce=e.modelValue)==null?void 0:ce.response)==null?void 0:ue.error)==null?void 0:de.message,class:"btn-copy"},null,8,["content"])]),i("p",uo,[s(f,{icon:"fa-solid fa-hashtag",class:"mr-1"}),$(" "+l(e.$t("luma.name.traceId"))+": "+l((me=e.modelValue)==null?void 0:me.trace_id)+" ",1),s(S,{content:(_e=(pe=e.modelValue)==null?void 0:pe.response)==null?void 0:_e.trace_id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):v("v-if",!0),v(" Display error message "),!((oe=e.modelValue)!=null&&oe.response)||((ne=(se=e.modelValue)==null?void 0:se.response)==null?void 0:ne.state)==="processing"||((ie=(ae=e.modelValue)==null?void 0:ae.response)==null?void 0:ie.state)==="pending"?(r(),p("div",mo,[s(E,{closable:!1,class:"info"},{template:m(()=>[s(f,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),$(" "+l(e.$t("luma.name.failure")),1)]),default:m(()=>{var I,b;return[i("p",po,[s(f,{icon:"fa-solid fa-magic",class:"mr-1"}),$(" "+l(e.$t("luma.name.taskId"))+": "+l((I=e.modelValue)==null?void 0:I.id)+" ",1),s(S,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):v("v-if",!0)])])}var fo=k(Qt,[["render",_o],["__scopeId","data-v-077795a0"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/task/Preview.vue"]]);const ho=w({name:"RecentPanel",components:{TaskPreview:fo,ElSkeleton:Ce,ElSkeletonItem:Le},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){var e,t,o,a;return{...(e=this.$store.state.luma)==null?void 0:e.tasks,items:(a=(o=(t=this.$store.state.luma)==null?void 0:t.tasks)==null?void 0:o.items)==null?void 0:a.slice()}}},methods:{onHandleScroll(){const e=this.$refs.panel;console.log("reach-top reach-top reach-top"),e.scrollTop===0&&this.$emit("reach-top")}}}),vo={key:0,class:"tasks"},go={class:"left"},$o={class:"main"},yo={key:1,class:"tasks"},bo={key:2,class:"description"};function ko(e,t,o,a,h,g){var _,f,S,E,P,U,C,L;const c=n("el-skeleton-item"),u=n("el-skeleton"),d=n("task-preview");return r(),p("div",{ref:"panel",class:"panel recent",onScroll:t[0]||(t[0]=(...V)=>e.onHandleScroll&&e.onHandleScroll(...V))},[((_=e.tasks)==null?void 0:_.items)===void 0?(r(),p("div",vo,[(r(),p(fe,null,he(3,V=>i("div",{key:V,class:"task placeholder"},[i("div",go,[s(u,{animated:""},{template:m(()=>[s(c,{variant:"image",class:"avatar"})]),_:1})]),i("div",$o,[s(u,{animated:""},{template:m(()=>[s(c,{variant:"p",class:"title"}),s(c,{variant:"image",class:"icon"})]),_:1})])])),64))])):((S=(f=e.tasks)==null?void 0:f.items)==null?void 0:S.length)&&((P=(E=e.tasks)==null?void 0:E.items)==null?void 0:P.length)>0?(r(),p("div",yo,[(r(!0),p(fe,null,he((U=e.tasks)==null?void 0:U.items,(V,A)=>(r(),N(d,{key:A,"model-value":V,class:"preview"},null,8,["model-value"]))),128))])):v("v-if",!0),((L=(C=e.tasks)==null?void 0:C.items)==null?void 0:L.length)===0?(r(),p("p",bo,l(e.$t("luma.message.noTasks")),1)):v("v-if",!0)],544)}var wo=k(ho,[["render",ko],["__scopeId","data-v-2f8302a7"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/RecentPanel.vue"]]);const Io="https://webhook.acedata.cloud/luma",Vo=w({name:"LumaIndex",components:{ConfigPanel:Ot,Layout:Fe,ApplicationStatus:Ne,RecentPanel:wo},data(){return{task:void 0,job:0,timer:void 0}},computed:{loading(){var e,t;return((t=(e=this.$store.state.luma)==null?void 0:e.status)==null?void 0:t.getApplications)===B.Request},service(){return this.$store.state.luma.service},credential(){return this.$store.state.luma.credential},config(){return this.$store.state.luma.config},initializing(){return this.$store.state.luma.status.getApplications===B.Request},needApply(){return this.$store.state.luma.status.getApplications===B.Success&&!this.application},application(){return this.$store.state.luma.application},applications(){return this.$store.state.luma.applications},tasks(){return this.$store.state.luma.tasks}},watch:{tasks:{handler(e,t){var o,a;((o=e==null?void 0:e.items)==null?void 0:o.length)>((a=t==null?void 0:t.items)==null?void 0:a.length)&&console.debug("new tasks detected")},deep:!0}},async mounted(){await this.onGetService(),await this.onGetApplication(),await this.onScrollDown(),await this.onGetTasks(),this.job=setInterval(()=>{this.onGetTasks()},5e3)},async unmounted(){clearInterval(this.job),clearInterval(this.timer)},methods:{async onReachTop(){var e,t,o;console.debug("reached top"),await this.onGetTasks({createdAtMax:(o=(t=(e=this.tasks)==null?void 0:e.items)==null?void 0:t[0])==null?void 0:o.created_at})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("luma/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("luma/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){ke.create({application:this.application}).then(({data:e})=>{this.application=e,y.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{var t,o;((o=(t=e==null?void 0:e.response)==null?void 0:t.data)==null?void 0:o.code)===Pe&&y.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".recent");e&&(e.scrollTop=e.scrollHeight)},500)},async onGetTasks(e){if(this.loading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:o,createdAtMax:a}=e||{};console.debug("limit",t,"createdAtMin",o,"createdAtMax",a),await this.$store.dispatch("luma/getTasks",{limit:t,createdAtMin:o,createdAtMax:a})},async onGenerateVideo(){var o;const e={...this.config,callback_url:Io},t=(o=this.credential)==null?void 0:o.token;if(!t){console.error("no token specified");return}y.info(this.$t("luma.message.startingTask")),we.generate(e,{token:t}).then(()=>{y.success(this.$t("luma.message.startTaskSuccess")),this.$store.commit("luma/setConfig",{config:void 0})}).catch(a=>{var g,c;const h=(g=a==null?void 0:a.response)==null?void 0:g.data;((c=h==null?void 0:h.error)==null?void 0:c.code)===Ae?y.error(this.$t("luma.message.usedUp")):y.error(this.$t("luma.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function So(e,t,o,a,h,g){const c=n("config-panel"),u=n("application-status"),d=n("recent-panel"),_=n("layout");return r(),N(_,null,{config:m(()=>[s(c,{onGenerate:e.onGenerateVideo},null,8,["onGenerate"])]),result:m(()=>[s(u,{initializing:e.initializing,application:e.application,applications:e.applications,service:e.service,"need-apply":e.needApply,class:"mb-4",onRefresh:e.onGetApplication,onSelect:t[0]||(t[0]=f=>e.$store.dispatch("luma/setApplication",f))},null,8,["initializing","application","applications","service","need-apply","onRefresh"]),s(d,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"]),v(' <operation-panel class="panel operation" @generate="onGenerate" /> ')]),_:1})}var zo=k(Vo,[["render",So],["__scopeId","data-v-c45e0af8"],["__file","/home/runner/work/Nexior/Nexior/src/pages/luma/Index.vue"]]);export{zo as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{L as we,M as Z,V as be,N as $e,P as Ce,O as Pe}from"./vendor-others.908494e8.js";import{aq as ie}from"./vendor-fortawesome.56f9a0ee.js";import{_ as w,aW as ve,M as Ae,aX as pe,T as se,F as Se}from"./index.c5936939.js";import{R as Ie,l as ae,K as Te,L as Ne,Q as ge,N as Ee,J as D,M as le,s as re,P as ce,W as Ve,$ as _e,a0 as me,t as Ue,d as Le,f as Fe,e as De,V as ye,a1 as Ge,y as je,T as Re,a2 as Me,a3 as qe,a4 as ze}from"./vendor-element-plus.bb793053.js";import{H as b,al as u,o as r,e as _,S as $,f as l,I as oe,V as a,M as h,U as f,W as X,ai as ne,L as g,T as j,av as he,O as ue,m as J,u as y,A as ke,s as Oe,R as Be,P as xe}from"./vendor-@vue.37ef86f0.js";import{A as He,i as We}from"./Status.a2dea48a.js";import{I as ee}from"./InfoIcon.746e870f.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.7d3be879.js";const Ke=b({name:"LayoutSuno",components:{ElDrawer:Ie,ElButton:ae,FontAwesomeIcon:ie},data(){return{drawer:!1,preview:!1}},computed:{isPlaying(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.player)==null?void 0:t.isPlaying}}}),Je={class:"main"},Qe={class:"config"},Xe={class:"result"},Ye={class:"preview"};function Ze(e,t,n,s,c,d){const i=u("font-awesome-icon"),p=u("el-button"),m=u("el-drawer");return r(),_("div",Je,[$(" \u6700\u5DE6\u4FA7\u914D\u7F6E\u680F "),l("div",Qe,[oe(e.$slots,"config",{},void 0,!0)]),$(" \u4E2D\u95F4\u6B4C\u66F2\u5217\u8868\u680F "),l("div",Xe,[oe(e.$slots,"result",{},void 0,!0)]),$(" \u6700\u53F3\u8FB9\u6B4C\u66F2\u9884\u89C8\u680F "),l("div",Ye,[oe(e.$slots,"preview",{},void 0,!0)]),a(p,{round:"",class:"menu",onClick:t[0]||(t[0]=v=>e.drawer=!0)},{default:h(()=>[a(i,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),a(m,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=v=>e.drawer=v),"with-header":!1,size:"340px",class:"drawer"},{default:h(()=>[oe(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"]),$(` <el-drawer v-model="isPlaying" :with-header="false" size="340px" class="preview_drawer">
|
|
2
|
-
<slot name="preview" />
|
|
3
|
-
</el-drawer> `)])}var et=w(Ke,[["render",Ze],["__scopeId","data-v-0621513c"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Suno.vue"]]);const tt=b({name:"VersionSelector",components:{ElSelect:Te,ElOption:Ne,ElSwitch:ge},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{options:[{label:this.$t("suno.model.model1"),value:"chirp-v2-xxl-alpha"},{label:this.$t("suno.model.model2"),value:"chirp-v3-0"},{label:this.$t("suno.model.model3"),value:"chirp-v3-5"},{label:this.$t("suno.model.model4"),value:"chirp-v4"}]}},computed:{custom:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.custom},set(e){var t;console.debug("set custom",e),this.$store.commit("suno/setConfig",{...(t=this.$store.state.suno)==null?void 0:t.config,custom:e})}},model:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.model},set(e){var t;console.debug("set model",e),this.$store.commit("suno/setConfig",{...(t=this.$store.state.suno)==null?void 0:t.config,model:e})}}},mounted(){this.model||(console.debug("set default type",ve),this.model=ve)}}),ot={class:"field"},st={class:"title font-bold"};function nt(e,t,n,s,c,d){const i=u("el-switch"),p=u("el-option"),m=u("el-select");return r(),_("div",ot,[l("h2",st,f(e.$t("suno.name.type")),1),a(i,{modelValue:e.custom,"onUpdate:modelValue":t[0]||(t[0]=v=>e.custom=v),class:"value"},null,8,["modelValue"]),a(m,{modelValue:e.model,"onUpdate:modelValue":t[1]||(t[1]=v=>e.model=v),class:"value",placeholder:e.$t("suno.placeholder.select")},{default:h(()=>[(r(!0),_(X,null,ne(e.options,v=>(r(),g(p,{key:v.value,label:v.label,value:v.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}var it=w(tt,[["render",nt],["__scopeId","data-v-6d5f21aa"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/TypeSelector.vue"]]);const at=b({name:"UploadAudio",components:{ElUpload:Ee,ElButton:ae,InfoIcon:ee,FontAwesomeIcon:ie},emits:["change"],data(){return{fileList:[],uploadUrl:Ae()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},credential(){return this.$store.state.suno.credential},config(){return this.$store.state.suno.config},urls(){return this.fileList.map(e=>{var t;return(t=e==null?void 0:e.response)==null?void 0:t.file_url})},value:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.audio_id},set(e){}}},watch:{urls:{handler(e){this.$emit("change",e)}}},mounted(){this.value||(this.value=void 0),this.onSetAudio()},methods:{onExceed(){D.warning(this.$t("suno.message.uploadReferencesExceed"))},onError(){D.error(this.$t("suno.message.uploadReferencesError"))},async onSuccess(){var t;const e=(t=this.urls)==null?void 0:t[0];await this.onGenerateAudioId(e)},async onGenerateAudioId(e){var s;const t={audio_url:e},n=(s=this.credential)==null?void 0:s.token;if(!n){console.error("no token specified");return}D.info(this.$t("suno.message.startingUploadAudio")),pe.upload(t,{token:n}).then(c=>{var i,p;console.debug("get upload music success",c.data);const d=(i=c.data)==null?void 0:i.data.audio_id;this.$store.commit("suno/setConfig",{...(p=this.$store.state.suno)==null?void 0:p.config,audio_id:d,action:"upload_extend"}),D.success(this.$t("suno.message.startUploadAudioSuccess"))}).catch(c=>{var d,i,p;D.error(((p=(i=(d=c==null?void 0:c.response)==null?void 0:d.data)==null?void 0:i.error)==null?void 0:p.message)||this.$t("suno.message.startUploadAudioFailed"))})},onSetAudio(){}}}),lt={class:"relative"},rt={class:"flex justify-between"},ct={class:"flex justify-start items-center"},ut={class:"text-sm font-bold"};function dt(e,t,n,s,c,d){const i=u("info-icon"),p=u("font-awesome-icon"),m=u("el-button"),v=u("el-upload");return r(),_("div",lt,[l("div",rt,[l("div",ct,[l("span",ut,f(e.$t("suno.name.referenceAudios")),1),a(i,{content:e.$t("suno.description.uploadAudios")},null,8,["content"])])]),a(v,{"file-list":e.fileList,"onUpdate:file-list":t[0]||(t[0]=C=>e.fileList=C),name:"file",limit:1,class:"upload-wrapper",action:e.uploadUrl,accept:".mp3","show-file-list":!0,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{default:h(()=>[a(m,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:h(()=>[a(p,{icon:"fa-solid fa-upload",class:"icon mr-1"}),j(" "+f(e.$t("suno.button.uploadAudios")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}var pt=w(at,[["render",dt],["__scopeId","data-v-3fef3e18"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/UploadAudio.vue"]]);const _t="",mt=b({name:"PromptInput",components:{ElInput:le,ElSwitch:ge,InfoIcon:ee},data(){return{}},computed:{prompt:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.prompt},set(e){var t;console.debug("set prompt",e),this.$store.commit("suno/setConfig",{...(t=this.$store.state.suno)==null?void 0:t.config,prompt:e})}},instrumental:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.instrumental},set(e){var t;console.debug("set instrumental",e),this.$store.commit("suno/setConfig",{...(t=this.$store.state.suno)==null?void 0:t.config,instrumental:e})}}},mounted(){this.value||(this.value=_t)}}),ht={class:"field"},ft={class:"box"},vt={class:"title-info"},$t={class:"title font-bold"},gt={class:"instrumental"},yt={class:"title inline-block"};function kt(e,t,n,s,c,d){const i=u("info-icon"),p=u("el-switch"),m=u("el-input");return r(),_("div",ht,[l("div",ft,[l("div",vt,[l("h2",$t,f(e.$t("suno.name.prompt")),1),a(i,{content:e.$t("suno.description.prompt"),class:"info"},null,8,["content"])]),l("div",gt,[a(p,{modelValue:e.instrumental,"onUpdate:modelValue":t[0]||(t[0]=v=>e.instrumental=v),class:"value mr-2"},null,8,["modelValue"]),l("h2",yt,f(e.$t("suno.name.instrumental")),1)])]),a(m,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||(t[1]=v=>e.prompt=v),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("suno.placeholder.prompt"),maxlength:200,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var wt=w(mt,[["render",kt],["__scopeId","data-v-11b65236"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/PromptInput.vue"]]);const bt="",Ct=b({name:"LyricInput",components:{ElInput:le,InfoIcon:ee},data(){return{}},computed:{lyric:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.lyric},set(e){var t;console.debug("set lyric",e),this.$store.commit("suno/setConfig",{...(t=this.$store.state.suno)==null?void 0:t.config,lyric:e})}},config(){var e;return(e=this.$store.state.suno)==null?void 0:e.config}},mounted(){this.value||(this.value=bt)}}),Pt={class:"field"},At={class:"box"},St={class:"title font-bold"};function It(e,t,n,s,c,d){var m;const i=u("info-icon"),p=u("el-input");return r(),_("div",Pt,[l("div",At,[l("h2",St,f(e.$t("suno.name.lyrics")),1),a(i,{content:e.$t("suno.description.lyrics"),class:"info"},null,8,["content"])]),((m=e.config)==null?void 0:m.action)!=="extend"?(r(),g(p,{key:0,modelValue:e.lyric,"onUpdate:modelValue":t[0]||(t[0]=v=>e.lyric=v),rows:3,type:"textarea",class:"lyrics",placeholder:e.$t("suno.placeholder.lyrics"),maxlength:3e3,"show-word-limit":""},null,8,["modelValue","placeholder"])):(r(),g(p,{key:1,modelValue:e.lyric,"onUpdate:modelValue":t[1]||(t[1]=v=>e.lyric=v),rows:3,type:"textarea",class:"lyrics",placeholder:e.$t("suno.placeholder.extend.lyrics"),maxlength:3e3,"show-word-limit":""},null,8,["modelValue","placeholder"]))])}var Tt=w(Ct,[["render",It],["__scopeId","data-v-b47f1748"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/LyricInput.vue"]]);const Nt=b({name:"StyleInput",components:{ElInput:le,InfoIcon:ee},data(){return{}},computed:{style:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.style},set(e){var t;console.debug("set style",e),this.$store.commit("suno/setConfig",{...(t=this.$store.state.suno)==null?void 0:t.config,style:e})}},config(){var e;return(e=this.$store.state.suno)==null?void 0:e.config}}}),Et={class:"field"},Vt={class:"title-container"},Ut={class:"titlefont-bold"};function Lt(e,t,n,s,c,d){const i=u("info-icon"),p=u("el-input");return r(),_("div",Et,[l("div",Vt,[l("h2",Ut,f(e.$t("suno.name.style")),1),a(i,{content:e.$t("suno.description.style"),class:"info"},null,8,["content"])]),a(p,{modelValue:e.style,"onUpdate:modelValue":t[0]||(t[0]=m=>e.style=m),rows:3,type:"textarea",class:"style",placeholder:e.$t("suno.placeholder.style"),maxlength:200,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var Ft=w(Nt,[["render",Lt],["__scopeId","data-v-075e574a"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/StyleInput.vue"]]);const Dt="",Gt=b({name:"TitleInput",components:{ElInput:le,InfoIcon:ee},data(){return{}},computed:{title:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.title},set(e){var t;console.debug("set title",e),this.$store.commit("suno/setConfig",{...(t=this.$store.state.suno)==null?void 0:t.config,title:e})}},instrumental:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.instrumental},set(e){var t;console.debug("set instrumental",e),this.$store.commit("suno/setConfig",{...(t=this.$store.state.suno)==null?void 0:t.config,instrumental:e})}}},mounted(){this.value||(this.value=Dt)}}),jt={class:"field"},Rt={class:"title-container"},Mt={class:"title font-bold"};function qt(e,t,n,s,c,d){const i=u("info-icon"),p=u("el-input");return r(),_("div",jt,[l("div",Rt,[l("h2",Mt,f(e.$t("suno.name.title")),1),a(i,{content:e.$t("suno.description.title"),class:"info"},null,8,["content"])]),a(p,{modelValue:e.title,"onUpdate:modelValue":t[0]||(t[0]=m=>e.title=m),rows:3,type:"textarea",class:"title",placeholder:e.$t("suno.placeholder.title"),maxlength:80,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var zt=w(Gt,[["render",qt],["__scopeId","data-v-f9bac2fa"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/TitleInput.vue"]]);function Y(e){const t=Math.floor(e)%60;e=Math.floor(e/60);const n=e%60,s=n<10?`0${n}`:n,c=t<10?`0${t}`:t;return s+":"+c}const Ot=b({name:"ExtendFromInput",components:{ElImage:re,ElIcon:ce,ElInputNumber:Ve,VideoPlay:_e,VideoPause:me},data(){return{}},computed:{audio(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.audio},value:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.continue_at},set(e){var t;console.debug("set continue_at",e),this.$store.commit("suno/setConfig",{...(t=this.$store.state.suno)==null?void 0:t.config,continue_at:e?parseInt(e):void 0})}}},mounted(){this.value||(this.value=void 0)},methods:{handleChange(e){var t,n;e<0?this.value=0:e>((t=this.audio)==null?void 0:t.duration)?this.value=(n=this.audio)==null?void 0:n.duration:this.value=e},useFormatDuring:Y,onPlay(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){var t,n,s;((s=(n=(t=this.$store.state)==null?void 0:t.suno)==null?void 0:n.audio)==null?void 0:s.id)!==e.id&&this.onPlay({...e,progress:0})}}}),Bt={class:"field"},xt={class:"box"},Ht={class:"title font-bold"},Wt={class:"input-wrapper"},Kt={class:"task"},Jt={class:"left"},Qt={key:2,class:"duration"},Xt={class:"info"},Yt={class:"title"},Zt={class:"style"};function eo(e,t,n,s,c,d){var S,P,I,T,E,o,F,V,U,L,N,G,R,M,q,z,O,B,x,H,W,K,k,Q,fe;const i=u("el-input-number"),p=u("el-image"),m=u("video-pause"),v=u("el-icon"),C=u("video-play"),A=he("loading");return r(),_("div",Bt,[l("div",xt,[l("h2",Ht,f(e.$t("suno.name.extend")),1),l("div",Wt,[a(i,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=te=>e.value=te),class:"value",min:0,max:(S=e.audio)==null?void 0:S.duration,controls:!1,placeholder:e.$t("suno.placeholder.extend.continue_at"),onChange:e.handleChange},null,8,["modelValue","max","placeholder","onChange"])])]),l("div",Kt,[l("div",{class:"audio",onClick:t[3]||(t[3]=te=>e.onClick(e.audio))},[ue((r(),_("div",Jt,[a(p,{src:(P=e.audio)==null?void 0:P.image_url,class:"cover",fit:"cover"},null,8,["src"]),((I=e.audio)==null?void 0:I.audio_url)&&((o=(E=(T=e.$store.state)==null?void 0:T.suno)==null?void 0:E.audio)==null?void 0:o.id)===e.audio.id&&((U=(V=(F=e.$store.state)==null?void 0:F.suno)==null?void 0:V.audio)==null?void 0:U.state)==="playing"?(r(),_("div",{key:0,class:"overlay",onClick:t[1]||(t[1]=te=>e.onPause(e.audio))},[a(v,null,{default:h(()=>[a(m)]),_:1})])):$("v-if",!0),((L=e.audio)==null?void 0:L.audio_url)&&(((R=(G=(N=e.$store.state)==null?void 0:N.suno)==null?void 0:G.audio)==null?void 0:R.id)!==e.audio.id||((z=(q=(M=e.$store.state)==null?void 0:M.suno)==null?void 0:q.audio)==null?void 0:z.id)===e.audio.id&&((x=(B=(O=e.$store.state)==null?void 0:O.suno)==null?void 0:B.audio)==null?void 0:x.state)==="paused")?(r(),_("div",{key:1,class:"overlay",onClick:t[2]||(t[2]=te=>e.onPlay(e.audio))},[a(v,null,{default:h(()=>[a(C)]),_:1})])):$("v-if",!0),(H=e.audio)!=null&&H.duration?(r(),_("div",Qt,f(e.useFormatDuring((W=e.audio)==null?void 0:W.duration)),1)):$("v-if",!0)])),[[A,!((K=e.audio)!=null&&K.audio_url)||!((k=e.audio)!=null&&k.video_url)]]),l("div",Xt,[l("h2",Yt,f((Q=e.audio)==null?void 0:Q.title),1),l("p",Zt,f((fe=e.audio)==null?void 0:fe.style),1)])])])])}var to=w(Ot,[["render",eo],["__scopeId","data-v-040b76e5"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/ExtendFromInput.vue"]]);const oo=b({name:"CoverFromInput",components:{ElImage:re,ElIcon:ce,VideoPlay:_e,VideoPause:me},data(){return{}},computed:{audio(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.audio},value:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.continue_at},set(e){var t;console.debug("set continue_at",e),this.$store.commit("suno/setConfig",{...(t=this.$store.state.suno)==null?void 0:t.config,continue_at:e?parseInt(e):void 0})}}},mounted(){this.value||(this.value=void 0)},methods:{handleChange(e){var t,n;e<0?this.value=0:e>((t=this.audio)==null?void 0:t.duration)?this.value=(n=this.audio)==null?void 0:n.duration:this.value=e},useFormatDuring:Y,onPlay(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){var t,n,s;((s=(n=(t=this.$store.state)==null?void 0:t.suno)==null?void 0:n.audio)==null?void 0:s.id)!==e.id&&this.onPlay({...e,progress:0})}}}),so={class:"field"},no={class:"box"},io={class:"title font-bold"},ao={class:"task"},lo={class:"left"},ro={key:2,class:"duration"},co={class:"info"},uo={class:"title"},po={class:"style"};function _o(e,t,n,s,c,d){var A,S,P,I,T,E,o,F,V,U,L,N,G,R,M,q,z,O,B,x,H,W,K,k;const i=u("el-image"),p=u("video-pause"),m=u("el-icon"),v=u("video-play"),C=he("loading");return r(),_("div",so,[l("div",no,[l("h2",io,f(e.$t("suno.name.cover")),1)]),l("div",ao,[e.audio?(r(),_("div",{key:0,class:"audio",onClick:t[2]||(t[2]=Q=>e.onClick(e.audio))},[ue((r(),_("div",lo,[a(i,{src:(A=e.audio)==null?void 0:A.image_url,class:"cover",fit:"cover"},null,8,["src"]),((S=e.audio)==null?void 0:S.audio_url)&&((T=(I=(P=e.$store.state)==null?void 0:P.suno)==null?void 0:I.audio)==null?void 0:T.id)===e.audio.id&&((F=(o=(E=e.$store.state)==null?void 0:E.suno)==null?void 0:o.audio)==null?void 0:F.state)==="playing"?(r(),_("div",{key:0,class:"overlay",onClick:t[0]||(t[0]=Q=>e.onPause(e.audio))},[a(m,null,{default:h(()=>[a(p)]),_:1})])):$("v-if",!0),((V=e.audio)==null?void 0:V.audio_url)&&(((N=(L=(U=e.$store.state)==null?void 0:U.suno)==null?void 0:L.audio)==null?void 0:N.id)!==e.audio.id||((M=(R=(G=e.$store.state)==null?void 0:G.suno)==null?void 0:R.audio)==null?void 0:M.id)===e.audio.id&&((O=(z=(q=e.$store.state)==null?void 0:q.suno)==null?void 0:z.audio)==null?void 0:O.state)==="paused")?(r(),_("div",{key:1,class:"overlay",onClick:t[1]||(t[1]=Q=>e.onPlay(e.audio))},[a(m,null,{default:h(()=>[a(v)]),_:1})])):$("v-if",!0),(B=e.audio)!=null&&B.duration?(r(),_("div",ro,f(e.useFormatDuring((x=e.audio)==null?void 0:x.duration)),1)):$("v-if",!0)])),[[C,!((H=e.audio)!=null&&H.audio_url)||!((W=e.audio)!=null&&W.video_url)]]),l("div",co,[l("h2",uo,f((K=e.audio)==null?void 0:K.title),1),l("p",po,f((k=e.audio)==null?void 0:k.style),1)])])):$("v-if",!0)])])}var mo=w(oo,[["render",_o],["__scopeId","data-v-68ea6e7a"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/CoverFromInput.vue"]]);const ho=b({name:"PresetPanel",components:{TypeSelector:it,PromptInput:wt,LyricInput:Tt,StyleInput:Ft,TitleInput:zt,ExtendFromInput:to,CoverFromInput:mo,UploadAudio:pt,FontAwesomeIcon:ie,ElButton:ae},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.suno)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),fo={class:"panel"},vo={class:"config"},$o={class:"actions"};function go(e,t,n,s,c,d){var E,o,F,V,U,L,N;const i=u("type-selector"),p=u("upload-audio"),m=u("prompt-input"),v=u("lyric-input"),C=u("style-input"),A=u("title-input"),S=u("extend-from-input"),P=u("cover-from-input"),I=u("font-awesome-icon"),T=u("el-button");return r(),_("div",fo,[l("div",vo,[a(i,{class:"mb-4"}),a(p,{class:"mb-4"}),(E=e.config)!=null&&E.custom?$("v-if",!0):(r(),g(m,{key:0,class:"mb-4"})),((o=e.config)==null?void 0:o.custom)&&!e.config.instrumental?(r(),g(v,{key:1,class:"mb-4"})):$("v-if",!0),(F=e.config)!=null&&F.custom?(r(),g(C,{key:2,class:"mb-4"})):$("v-if",!0),(V=e.config)!=null&&V.custom?(r(),g(A,{key:3,class:"mb-4"})):$("v-if",!0),((U=e.config)==null?void 0:U.action)==="extend"?(r(),g(S,{key:4,class:"mb-4"})):$("v-if",!0),((L=e.config)==null?void 0:L.action)==="cover"?(r(),g(P,{key:5,class:"mb-4"})):$("v-if",!0),l("div",$o,[((N=e.config)==null?void 0:N.action)!=="extend"?(r(),g(T,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[a(I,{icon:"fa-solid fa-magic",class:"mr-2"}),j(" "+f(e.$t("suno.button.generate")),1)]),_:1},8,["onClick"])):(r(),g(T,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[a(I,{icon:"fa-solid fa-magic",class:"mr-2"}),j(" "+f(e.$t("suno.button.extend")),1)]),_:1},8,["onClick"]))])])])}var yo=w(ho,[["render",go],["__scopeId","data-v-38bb3c66"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/ConfigPanel.vue"]]);const ko="https://webhook.acedata.cloud/suno",wo=b({name:"TaskPreview",components:{ElImage:re,ElIcon:ce,ElTooltip:Ue,ElButton:ae,FontAwesomeIcon:ie,VideoPlay:_e,VideoPause:me,ElDropdown:Le,ElDropdownMenu:Fe,ElDropdownItem:De},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{loading(){var e,t;return((t=(e=this.$store.state.suno)==null?void 0:e.status)==null?void 0:t.getApplications)===se.Request},credential(){return this.$store.state.suno.credential},config(){return this.$store.state.suno.config},task(){var e;return(e=this.$store.state.suno)==null?void 0:e.tasks},audios(){var n,s,c,d,i,p,m;let e=[];const t=(s=(n=this.modelValue)==null?void 0:n.request)==null?void 0:s.action;return Array.isArray((d=(c=this.modelValue)==null?void 0:c.response)==null?void 0:d.data)&&((m=(p=(i=this.modelValue)==null?void 0:i.response)==null?void 0:p.data)==null||m.forEach(v=>{let C=v;t&&(C.action=t),e.push(C)})),e},application(){var e;return(e=this.$store.state.suno)==null?void 0:e.application},active(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.tasks)==null?void 0:t.active}},methods:{useFormatDuring:Y,onPlay(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){var t,n,s;((s=(n=(t=this.$store.state)==null?void 0:t.suno)==null?void 0:n.audio)==null?void 0:s.id)!==e.id&&this.onPlay({...e,progress:0})},onExtend(e,t){var n;e.stopPropagation(),console.log("on extend"),console.debug("set config",t),this.$store.commit("suno/setConfig",{...(n=this.$store.state.suno)==null?void 0:n.config,model:t.model,custom:!0,instrumental:!1,style:t.style,action:"extend",audio:t,audio_id:t.id,continue_at:t.duration})},onDownload(e,t){e.stopPropagation(),console.log("on download",t);const s=new URL(t).pathname,c=s.substring(s.lastIndexOf("/")+1);console.log("on preview",c),fetch(t).then(d=>d.blob()).then(d=>{we.exports.saveAs(d,c)})},onPreview(e,t){e.stopPropagation(),console.log("on preview",t),window.open(t,"_blank")},async onGetStems(e,t){e.stopPropagation(),console.log("on get stems",t),await this.onGenerateAudioUrl("stems",t)},onCover(e,t){var n;e.stopPropagation(),console.log("on cover"),console.debug("set config",t),this.$store.commit("suno/setConfig",{...(n=this.$store.state.suno)==null?void 0:n.config,model:t.model,custom:!0,instrumental:!1,style:t.style,action:"cover",audio:t,audio_id:t.id})},async onConcatMusic(e,t){e.stopPropagation(),console.log("on get concat",t),await this.onGenerateAudioUrl("concat",t)},async onGenerateAudioUrl(e,t){var c;const n={action:e,audio_id:t,callback_url:ko},s=(c=this.credential)==null?void 0:c.token;if(!s){console.error("no token specified");return}D.info(this.$t("suno.message.startingTask")),pe.audio(n,{token:s}).then(()=>{D.success(this.$t("suno.message.startTaskSuccess"))}).catch(d=>{var i,p,m;D.error(((m=(p=(i=d==null?void 0:d.response)==null?void 0:i.data)==null?void 0:p.error)==null?void 0:m.message)||this.$t("suno.message.startTaskFailed"))}).finally(async()=>{await this.onGetTasks(),await this.onScrollDown()})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".recent");e&&(e.scrollTop=e.scrollHeight)},1e3)},async onGetTasks(){if(this.loading){console.debug("loading");return}await this.$store.dispatch("suno/getTasks",{limit:30,offset:0})}}}),bo={class:"task"},Co=["onClick"],Po={class:"left"},Ao=["onClick"],So=["onClick"],Io={key:2,class:"duration"},To={class:"info"},No={class:"title"},Eo={class:"style"},Vo={class:"right"},Uo={class:"el-dropdown-link"},Lo={class:"el-dropdown-link"};function Fo(e,t,n,s,c,d){const i=u("el-image"),p=u("video-pause"),m=u("el-icon"),v=u("video-play"),C=u("el-button"),A=u("font-awesome-icon"),S=u("el-tooltip"),P=u("el-dropdown-item"),I=u("el-dropdown-menu"),T=u("el-dropdown"),E=he("loading");return r(),_("div",bo,[(r(!0),_(X,null,ne(e.audios,(o,F)=>{var V,U,L,N,G,R,M,q,z,O,B,x,H,W,K;return r(),_("div",{key:F,class:"audio",onClick:k=>e.onClick(o)},[ue((r(),_("div",Po,[a(i,{src:o==null?void 0:o.image_url,class:"cover",fit:"cover"},null,8,["src"]),(o==null?void 0:o.audio_url)&&((L=(U=(V=e.$store.state)==null?void 0:V.suno)==null?void 0:U.audio)==null?void 0:L.id)===o.id&&((R=(G=(N=e.$store.state)==null?void 0:N.suno)==null?void 0:G.audio)==null?void 0:R.state)==="playing"?(r(),_("div",{key:0,class:"overlay",onClick:k=>e.onPause(o)},[a(m,null,{default:h(()=>[a(p)]),_:1})],8,Ao)):$("v-if",!0),(o==null?void 0:o.audio_url)&&(((z=(q=(M=e.$store.state)==null?void 0:M.suno)==null?void 0:q.audio)==null?void 0:z.id)!==o.id||((x=(B=(O=e.$store.state)==null?void 0:O.suno)==null?void 0:B.audio)==null?void 0:x.id)===o.id&&((K=(W=(H=e.$store.state)==null?void 0:H.suno)==null?void 0:W.audio)==null?void 0:K.state)==="paused")?(r(),_("div",{key:1,class:"overlay",onClick:k=>e.onPlay(o)},[a(m,null,{default:h(()=>[a(v)]),_:1})],8,So)):$("v-if",!0),o!=null&&o.duration?(r(),_("div",Io,f(e.useFormatDuring(o==null?void 0:o.duration)),1)):$("v-if",!0)])),[[E,!(o!=null&&o.audio_url)||!(o!=null&&o.video_url)]]),l("div",To,[l("h2",No,f(o==null?void 0:o.title),1),l("p",Eo,f(o==null?void 0:o.style),1)]),l("div",Vo,[(o==null?void 0:o.audio_url)&&(o==null?void 0:o.video_url)?(r(),g(C,{key:0,size:"small",round:"",onClick:k=>e.onExtend(k,o)},{default:h(()=>[j(f(e.$t("suno.button.extend")),1)]),_:2},1032,["onClick"])):$("v-if",!0),a(S,{effect:"dark",content:e.$t("suno.button.video"),placement:"top"},{default:h(()=>[o!=null&&o.video_url?(r(),g(A,{key:0,icon:"fa-solid fa-clapperboard",class:"icon icon-preview",onClick:k=>e.onPreview(k,o==null?void 0:o.video_url)},null,8,["onClick"])):$("v-if",!0)]),_:2},1032,["content"]),a(T,null,{dropdown:h(()=>[a(I,null,{default:h(()=>[o!=null&&o.video_url?(r(),g(P,{key:0,onClick:k=>e.onDownload(k,o==null?void 0:o.video_url)},{default:h(()=>[j(f(e.$t("suno.button.download_video")),1)]),_:2},1032,["onClick"])):$("v-if",!0),o!=null&&o.audio_url?(r(),g(P,{key:1,onClick:k=>e.onDownload(k,o==null?void 0:o.audio_url)},{default:h(()=>[j(f(e.$t("suno.button.download_audio")),1)]),_:2},1032,["onClick"])):$("v-if",!0)]),_:2},1024)]),default:h(()=>[l("span",Uo,[a(S,{effect:"dark",content:e.$t("suno.button.download"),placement:"top"},{default:h(()=>[(o==null?void 0:o.audio_url)||(o==null?void 0:o.video_url)?(r(),g(A,{key:0,icon:"fa-solid fa-download",class:"icon icon-download"})):$("v-if",!0)]),_:2},1032,["content"])])]),_:2},1024),a(T,null,{dropdown:h(()=>[a(I,null,{default:h(()=>[o!=null&&o.video_url?(r(),g(P,{key:0,onClick:k=>e.onGetStems(k,o==null?void 0:o.id)},{default:h(()=>[j(f(e.$t("suno.button.get_stems")),1)]),_:2},1032,["onClick"])):$("v-if",!0),(o==null?void 0:o.action)==="extend"?(r(),g(P,{key:1,onClick:k=>e.onCover(k,o)},{default:h(()=>[j(f(e.$t("suno.button.cover_music")),1)]),_:2},1032,["onClick"])):$("v-if",!0),(o==null?void 0:o.action)==="extend"?(r(),g(P,{key:2,onClick:k=>e.onConcatMusic(k,o==null?void 0:o.id)},{default:h(()=>[j(f(e.$t("suno.button.concat_music")),1)]),_:2},1032,["onClick"])):$("v-if",!0)]),_:2},1024)]),default:h(()=>[l("span",Lo,[a(S,{effect:"dark",content:e.$t("suno.button.more"),placement:"top"},{default:h(()=>[(o==null?void 0:o.audio_url)||(o==null?void 0:o.video_url)?(r(),g(A,{key:0,icon:"fa-solid fa-ellipsis",class:"icon icon-ellipsis"})):$("v-if",!0)]),_:2},1032,["content"])])]),_:2},1024)])],8,Co)}),128))])}var Do=w(wo,[["render",Fo],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/task/Preview.vue"]]);const Go={class:"player-slider"},jo=b({setup(e){const t=Z(),n=J({get:()=>{var i,p;return(p=(i=t.state.suno)==null?void 0:i.audio)==null?void 0:p.progress},set:i=>t.commit("suno/setAudio",{...t.state.suno.audio,progress:i})}),s=J({get:()=>{var i,p;return(p=(i=t.state.suno)==null?void 0:i.audio)==null?void 0:p.duration},set:i=>t.commit("suno/setAudio",{...t.state.suno.audio,duration:i})}),c=()=>{},d=i=>t.dispatch("suno/setAudio",{...t.state.suno.audio,progress:i});return(i,p)=>(r(),_("div",Go,[a(y(ye),{modelValue:y(n),"onUpdate:modelValue":p[0]||(p[0]=m=>ke(n)?n.value=m:null),"show-tooltip":!1,min:0,max:y(s),onChange:d,onInput:c},null,8,["modelValue","max"])]))}});var Ro=w(jo,[["__file","/home/runner/work/Nexior/Nexior/src/components/suno/player/PlayerSlider.vue"]]),Mo="/assets/disk.4907c891.png";const qo={class:"flex player-song"},zo=["src"],Oo={class:"ml-2 text-xs flex flex-col justify-between"},Bo={class:"w-52 2xl:w-96 cursor-pointer truncate"},xo={class:"flex"},Ho={class:"ml-2 text-dc"},Wo=b({setup(e){const t=Z(),n=J({get:()=>t.state.suno.audio,set:s=>t.commit("suno/setAudio",s)});return Oe(n,(s,c)=>{if((s==null?void 0:s.audio_url)!==(c==null?void 0:c.audio_url)){console.log("audio changed",s),s.object&&(console.log("111",s.object),s.object.pause(),delete s.object);const d=new Audio(s.audio_url);s.state==="playing"?d.play():d.pause(),d.addEventListener("loadedmetadata",()=>{d.currentTime=0,d.addEventListener("timeupdate",()=>{t.commit("suno/setAudio",{...t.state.suno.audio,progress:d.currentTime})})}),t.commit("suno/setAudio",{...t.state.suno.audio,object:d})}else if((s==null?void 0:s.progress)!==(c==null?void 0:c.progress)&&Math.abs(s.progress-s.object.currentTime)>2){console.log("progress changed",s.progress);const d=t.state.suno.audio;d.object&&(d.object.currentTime=d.progress)}else(s==null?void 0:s.state)!==(c==null?void 0:c.state)&&(console.log("state changed",s.state),s.object&&(s.state==="playing"?s.object.play():s.object.pause()));(s==null?void 0:s.volume)!==(c==null?void 0:c.volume)&&(console.log("volume changed",s.volume),s.object&&(s.object.volume=s.volume/100))}),(s,c)=>{var d,i,p;return r(),_("div",qo,[l("img",{alt:"",class:"w-11 h-11 rounded",src:((d=y(n))==null?void 0:d.image_url)||y(Mo)},null,8,zo),l("div",Oo,[l("div",Bo,[l("div",xo,[l("span",null,f(((i=y(n))==null?void 0:i.title)||"Music"),1),l("span",Ho,"- "+f(((p=y(n))==null?void 0:p.style)||"SmallRuralDog"),1)])])])])}}});var Ko=w(Wo,[["__file","/home/runner/work/Nexior/Nexior/src/components/suno/player/PlayerSong.vue"]]);const Jo={class:"flex justify-end items-center gap-x-2.5"},Qo={class:"text-xs"},Xo=b({setup(e){const t=Z(),n=J({get:()=>{var c,d;return(d=(c=t.state.suno)==null?void 0:c.audio)==null?void 0:d.progress},set:c=>t.commit("suno/setAudio",{...t.state.suno.audio,progress:c})}),s=J({get:()=>{var c,d;return(d=(c=t.state.suno)==null?void 0:c.audio)==null?void 0:d.duration},set:c=>t.commit("suno/setAudio",{...t.state.suno.audio,duration:c})});return(c,d)=>(r(),_("div",Jo,[l("span",Qo,f(y(Y)(y(n)))+" / "+f(y(Y)(y(s))),1)]))}});var Yo=w(Xo,[["__file","/home/runner/work/Nexior/Nexior/src/components/suno/player/PlayerAction.vue"]]);const Zo=b({props:{icon:{type:null,required:!0},theme:{type:String,required:!1},size:{type:[Number,String],required:!1},spin:{type:Boolean,required:!1},fill:{type:[String,Array],required:!1},strokeLinecap:{type:String,required:!1},strokeLinejoin:{type:String,required:!1},strokeWidth:{type:Number,required:!1}},setup(e){return(t,n)=>(r(),g(Be(e.icon),{theme:e.theme,size:e.size,spin:e.spin,fill:e.fill,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin,"stroke-width":e.strokeWidth},null,8,["theme","size","spin","fill","stroke-linecap","stroke-linejoin","stroke-width"]))}});var de=w(Zo,[["__file","/home/runner/work/Nexior/Nexior/src/components/common/IconPark.vue"]]);const es={class:"player-volume flex flex-col items-center pt-2"},ts={class:"text-sm mt-3"},os={class:"mt-2"},ss=b({setup(e){const t=Z(),n=J({get:()=>{var i;return(i=t.state.suno.audio)==null?void 0:i.volume},set:i=>t.commit("suno/setAudio",{...t.state.suno.audio,volume:i})}),s=J({get:()=>{var i;return(i=t.state.suno.audio)==null?void 0:i.muted},set:i=>t.commit("suno/setAudio",{...t.state.suno.audio,muted:i})}),c=()=>t.dispatch("suno/toggleMuted"),d=i=>t.dispatch("suno/setVolume",i);return(i,p)=>(r(),_("div",es,[l("div",null,[a(y(ye),{modelValue:y(n),"onUpdate:modelValue":p[0]||(p[0]=m=>ke(n)?n.value=m:null),vertical:"",height:"100px","show-tooltip":!1,max:100,min:0,size:"small",disabled:y(s),onInput:d},null,8,["modelValue","disabled"])]),l("div",ts,f(y(n)),1),l("div",os,[a(de,{icon:y(s)?y(be):y($e),size:"16",theme:"filled",class:"hover-text",onClick:c},null,8,["icon"])])]))}});var ns=w(ss,[["__file","/home/runner/work/Nexior/Nexior/src/components/suno/player/PlayerVolumeSlider.vue"]]);const is={class:"flex items-center justify-center gap-x-3"},as=b({setup(e){const t=Z(),n=()=>t.dispatch("suno/setAudio",{...t.state.suno.audio,state:t.state.suno.audio.state==="playing"?"paused":"playing"}),s=J(()=>t.state.suno.audio);return(c,d)=>{var i;return r(),_("div",is,[a(de,{icon:((i=y(s))==null?void 0:i.state)==="playing"?y(Ce):y(Pe),size:"45",theme:"filled",class:"control",onClick:n},null,8,["icon"]),a(y(Ge),{placement:"top",width:"50px"},{reference:h(()=>[a(de,{icon:y($e),size:"20","stroke-width":3,class:"hover-text"},null,8,["icon"])]),default:h(()=>[a(ns)]),_:1})])}}});var ls=w(as,[["__file","/home/runner/work/Nexior/Nexior/src/components/suno/player/PlayerController.vue"]]);const rs={class:"flex flex-col items-stretch h-20"},cs={class:"flex grow px-5 items-center"},us={class:"flex-1"},ds={class:"flex-1"},ps={class:"flex-1"},_s=b({setup(e){return(t,n)=>(r(),_("div",rs,[a(Ro),l("div",cs,[l("div",us,[a(Ko)]),l("div",ds,[a(ls)]),l("div",ps,[a(Yo)])])]))}});var ms=w(_s,[["__file","/home/runner/work/Nexior/Nexior/src/components/suno/player/Player.vue"]]);const hs=b({name:"RecentPanel",components:{TaskPreview:Do,ElSkeleton:je,ElSkeletonItem:Re,Player:ms},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){var e,t,n,s;return{...(e=this.$store.state.suno)==null?void 0:e.tasks,items:(s=(n=(t=this.$store.state.suno)==null?void 0:t.tasks)==null?void 0:n.items)==null?void 0:s.slice()}}},methods:{onHandleScroll(){const e=this.$refs.panel;console.log("reach-top reach-top reach-top"),e.scrollTop===0&&this.$emit("reach-top")}}}),fs={key:0,class:"tasks"},vs={class:"left"},$s={class:"main"},gs={key:1,class:"tasks"},ys={key:2,class:"description"},ks={class:"flex-1 flex flex-col"},ws={class:"h-20"};function bs(e,t,n,s,c,d){var C,A,S,P,I,T,E,o,F,V,U,L;const i=u("el-skeleton-item"),p=u("el-skeleton"),m=u("task-preview"),v=u("player");return r(),_(X,null,[l("div",{ref:"panel",class:"panel recent",onScroll:t[0]||(t[0]=(...N)=>e.onHandleScroll&&e.onHandleScroll(...N))},[((C=e.tasks)==null?void 0:C.items)===void 0?(r(),_("div",fs,[(r(),_(X,null,ne(3,N=>l("div",{key:N,class:"task placeholder"},[l("div",vs,[a(p,{animated:""},{template:h(()=>[a(i,{variant:"image",class:"avatar"})]),_:1})]),l("div",$s,[a(p,{animated:""},{template:h(()=>[a(i,{variant:"p",class:"title"}),a(i,{variant:"text",style:{"margin-right":"16px"}}),a(i,{variant:"text",style:{width:"80%"}})]),_:1})])])),64))])):((S=(A=e.tasks)==null?void 0:A.items)==null?void 0:S.length)&&((I=(P=e.tasks)==null?void 0:P.items)==null?void 0:I.length)>0?(r(),_("div",gs,[(r(!0),_(X,null,ne((T=e.tasks)==null?void 0:T.items,(N,G)=>(r(),g(m,{key:G,"model-value":N,class:"preview"},null,8,["model-value"]))),128))])):$("v-if",!0),((o=(E=e.tasks)==null?void 0:E.items)==null?void 0:o.length)===0?(r(),_("p",ys,f(e.$t("suno.message.noTasks")),1)):$("v-if",!0)],544),ue(l("div",ks,[l("div",ws,[a(v)])],512),[[xe,!!((L=(U=(V=(F=e.$store)==null?void 0:F.state)==null?void 0:V.suno)==null?void 0:U.audio)!=null&&L.object)]])],64)}var Cs=w(hs,[["render",bs],["__scopeId","data-v-9a683526"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/RecentPanel.vue"]]);const Ps=b({name:"TaskPreview",components:{ElScrollbar:Me,IconPicture:qe,ElImage:re,ElAvatar:ze,ElIcon:ce},data(){return{showCloseIcon:!0}},computed:{audio(){var e;return(e=this.$store.state.suno)==null?void 0:e.audio}},methods:{closeCard(){this.showCloseIcon=!this.showCloseIcon}}}),As={key:0,class:"card"},Ss={class:"image-container"},Is={class:"image-slot"},Ts={class:"title"},Ns={class:"content"},Es={class:"artist"},Vs={class:"style"},Us={class:"time"},Ls={class:"lyrics"},Fs={key:1,class:"gradient-background"};function Ds(e,t,n,s,c,d){const i=u("icon-picture"),p=u("el-icon"),m=u("el-image"),v=u("el-avatar"),C=u("el-scrollbar");return r(),g(C,{class:"right-panel"},{default:h(()=>{var A,S,P,I,T,E,o;return[(A=e.audio)!=null&&A.object?(r(),_("div",As,[l("div",Ss,[a(m,{src:e.audio.image_url,fit:"cover"},{error:h(()=>[l("div",Is,[a(p,null,{default:h(()=>[a(i)]),_:1})])]),_:1},8,["src"]),l("h2",Ts,f((S=e.audio)==null?void 0:S.title),1)]),l("div",Ns,[l("div",Es,[a(v,{size:30,src:(P=e.audio)==null?void 0:P.image_url},null,8,["src"]),l("span",null,f((I=e.audio)==null?void 0:I.prompt),1)]),l("p",Vs,f((T=e.audio)==null?void 0:T.style),1),l("p",Us,f(e.$dayjs.format((E=e.audio)==null?void 0:E.created_at)),1),l("div",Ls,[l("p",null,f((o=e.audio)==null?void 0:o.lyric),1)])])])):(r(),_("div",Fs))]}),_:1})}var Gs=w(Ps,[["render",Ds],["__scopeId","data-v-19e67a48"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/PreviewPanel.vue"]]);const js="https://webhook.acedata.cloud/suno",Rs=b({name:"SunoIndex",components:{Layout:et,ApplicationStatus:He,ConfigPanel:yo,RecentPanel:Cs,PreviewPanel:Gs},data(){return{task:void 0,job:0,timer:void 0}},computed:{loading(){var e,t;return((t=(e=this.$store.state.suno)==null?void 0:e.status)==null?void 0:t.getApplications)===se.Request},service(){return this.$store.state.suno.service},credential(){return this.$store.state.suno.credential},config(){return this.$store.state.suno.config},initializing(){return this.$store.state.suno.status.getApplications===se.Request},needApply(){return this.$store.state.suno.status.getApplications===se.Success&&!this.application},application(){return this.$store.state.suno.application},tasks(){return this.$store.state.suno.tasks},applications(){return this.$store.state.suno.applications}},watch:{tasks:{handler(e,t){var n,s;((n=e==null?void 0:e.items)==null?void 0:n.length)>((s=t==null?void 0:t.items)==null?void 0:s.length)&&console.debug("new tasks detected")},deep:!0}},async mounted(){await this.onGetService(),await this.onGetApplication(),await this.onScrollDown(),await this.onGetTasks(),this.job=setInterval(()=>{this.onGetTasks()},5e3)},async unmounted(){clearInterval(this.job),clearInterval(this.timer)},methods:{async onReachTop(){var e,t,n;console.debug("reached top"),await this.onGetTasks({createdAtMax:(n=(t=(e=this.tasks)==null?void 0:e.items)==null?void 0:t[0])==null?void 0:n.created_at})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("suno/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplications"),await this.$store.dispatch("suno/getApplications"),console.debug("end onGetApplications"),await this.onGetTasks()},onApply(){Se.create({application:this.application}).then(({data:e})=>{this.application=e,D.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{var t,n;((n=(t=e==null?void 0:e.response)==null?void 0:t.data)==null?void 0:n.code)===We&&D.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".recent");e&&(e.scrollTop=e.scrollHeight)},1e3)},async onGetTasks(e){if(this.loading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:n,createdAtMax:s}=e||{};console.debug("limit",t,"createdAtMin",n,"createdAtMax",s),await this.$store.dispatch("suno/getTasks",{limit:t,createdAtMin:n,createdAtMax:s})},async onGenerateAudio(){var n;const e={...this.config,callback_url:js},t=(n=this.credential)==null?void 0:n.token;if(!t){console.error("no token specified");return}D.info(this.$t("suno.message.startingTask")),pe.audio(e,{token:t}).then(()=>{D.success(this.$t("suno.message.startTaskSuccess"))}).catch(s=>{var c,d,i;D.error(((i=(d=(c=s==null?void 0:s.response)==null?void 0:c.data)==null?void 0:d.error)==null?void 0:i.message)||this.$t("suno.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function Ms(e,t,n,s,c,d){const i=u("config-panel"),p=u("application-status"),m=u("recent-panel"),v=u("preview-panel"),C=u("layout");return r(),g(C,null,{config:h(()=>[a(i,{onGenerate:e.onGenerateAudio},null,8,["onGenerate"])]),result:h(()=>[a(p,{initializing:e.initializing,application:e.application,applications:e.applications,service:e.service,"need-apply":e.needApply,class:"mb-4",onRefresh:e.onGetApplication,onSelect:t[0]||(t[0]=A=>e.$store.dispatch("suno/setApplication",A))},null,8,["initializing","application","applications","service","need-apply","onRefresh"]),a(m,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"])]),preview:h(()=>[a(v)]),_:1})}var Qs=w(Rs,[["render",Ms],["__scopeId","data-v-11d62c6c"],["__file","/home/runner/work/Nexior/Nexior/src/pages/suno/Index.vue"]]);export{Qs as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./vendor-others.908494e8.js";import{E as j,a as O,b as R}from"./EditArray.855cb2c4.js";import{_ as W,Q as G}from"./index.c5936939.js";import{A as H,i as K,s as M,h as P,r as z,F as J,Q as X,G as Y}from"./vendor-element-plus.bb793053.js";import{H as Z,al as p,L as x,M as s,o as E,V as i,f as l,U as o,T as v,e as Q,ai as ee,O as U,P as V,S as te,W as ie}from"./vendor-@vue.37ef86f0.js";import"./vendor-fortawesome.56f9a0ee.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.7d3be879.js";const se=Z({name:"SiteIndex",components:{EditText:j,EditImage:O,EditArray:R,ElDivider:H,ElRow:K,ElImage:M,ElCol:P,ElCard:z,ElForm:J,ElSwitch:X,ElFormItem:Y},data(){return{editing:{title:!1}}},computed:{site(){return this.$store.getters.site}},methods:{onSave(e){var C;const a={...this.site,...e};G.update((C=this.site)==null?void 0:C.id,a).then(()=>{var I;console.debug("getSite for id",(I=this.site)==null?void 0:I.id),this.$store.dispatch("getSite")})}}}),le={class:"title"},oe={class:"title"},ae={class:"block w-full"},de={class:"block tip"},ne={class:"block w-full"},re={class:"block tip"},ue={class:"block w-full"},me={class:"block tip"},pe={class:"block w-full"},fe={class:"block tip"},be={class:"block w-full"},ve={class:"block tip"},he={class:"title"},ce={class:"block w-full"},$e={class:"block tip"},ge={class:"block w-full"},we={class:"block tip"},ke={class:"title"},Ce={class:"block tip"},Ie={class:"block tip"},ye={class:"title"},Se={class:"w-full"},Te={class:"block tip w-full"},_e={key:0},De={class:"block w-full"},Ee={class:"block w-full"};function Ue(e,a,C,I,Ve,Fe){const g=p("el-col"),y=p("el-row"),h=p("el-divider"),d=p("el-form-item"),c=p("edit-text"),S=p("el-image"),T=p("edit-image"),F=p("edit-array"),w=p("el-form"),k=p("el-card"),_=p("el-switch");return E(),x(y,{class:"panel"},{default:s(()=>[i(g,{span:24},{default:s(()=>[i(y,null,{default:s(()=>[i(g,{span:24},{default:s(()=>[l("h2",le,o(e.$t("common.title.site")),1)]),_:1})]),_:1}),i(y,{gutter:15},{default:s(()=>[i(g,{md:12,xs:24},{default:s(()=>[i(k,{shadow:"hover",class:"mb-4"},{default:s(()=>[l("h4",oe,o(e.$t("site.title.basicConfig")),1),i(h),i(w,{model:e.site,class:"form","label-width":"auto",style:{"max-width":"600px"}},{default:s(()=>[i(d,{label:e.$t("site.field.origin")},{default:s(()=>[l("span",ae,o(e.site.origin),1),l("span",de,o(e.$t("site.message.originTip")),1)]),_:1},8,["label"]),i(d,{label:e.$t("site.field.title")},{default:s(()=>[l("span",ne,[v(o(e.site.title)+" ",1),i(c,{"model-value":e.site.title,title:e.$t("site.title.editTitle"),placeholder:e.$t("site.placeholder.title"),onConfirm:a[0]||(a[0]=t=>e.onSave({title:t}))},null,8,["model-value","title","placeholder"])]),l("span",re,o(e.$t("site.message.titleTip")),1)]),_:1},8,["label"]),i(d,{label:e.$t("site.field.logo")},{default:s(()=>[l("span",ue,[i(S,{src:e.site.logo,class:"logo"},null,8,["src"]),i(T,{"model-value":e.site.logo,title:e.$t("site.title.editLogo"),tip:e.$t("site.message.editLogoTip"),onConfirm:a[1]||(a[1]=t=>e.onSave({logo:t}))},null,8,["model-value","title","tip"])]),l("span",me,o(e.$t("site.message.logoTip")),1)]),_:1},8,["label"]),i(d,{label:e.$t("site.field.favicon")},{default:s(()=>[l("span",pe,[i(S,{src:e.site.favicon,class:"favicon"},null,8,["src"]),i(T,{"model-value":e.site.favicon,title:e.$t("site.title.editFavicon"),tip:e.$t("site.message.editFaviconTip"),onConfirm:a[2]||(a[2]=t=>e.onSave({favicon:t}))},null,8,["model-value","title","tip"])]),l("span",fe,o(e.$t("site.message.faviconTip")),1)]),_:1},8,["label"]),i(h,{"border-style":"dashed"}),i(d,{label:e.$t("site.field.admins")},{default:s(()=>{var t,n;return[l("span",be,[v(o((t=e.site.admins)==null?void 0:t.join(", "))+" ",1),i(F,{"model-value":((n=e.site)==null?void 0:n.admins)||[],title:e.$t("site.title.editAdmins"),placeholder:e.$t("site.placeholder.admins"),tip:e.$t("site.message.adminsTip2"),min:1,"min-error-message":e.$t("site.message.atLeastOneAdmin"),onConfirm:a[3]||(a[3]=f=>e.onSave({admins:f}))},null,8,["model-value","title","placeholder","tip","min-error-message"])]),l("span",ve,o(e.$t("site.message.adminsTip")),1)]}),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),i(k,{shadow:"hover"},{default:s(()=>[l("h4",he,o(e.$t("site.title.seoConfig")),1),i(h),i(w,{model:e.site,class:"form","label-width":"auto",style:{"max-width":"600px"}},{default:s(()=>[i(d,{label:e.$t("site.field.description")},{default:s(()=>[l("span",ce,[v(o(e.site.description)+" ",1),i(c,{"model-value":e.site.description,title:e.$t("site.title.editDescription"),placeholder:e.$t("site.placeholder.description"),onConfirm:a[4]||(a[4]=t=>e.onSave({description:t}))},null,8,["model-value","title","placeholder"])]),l("span",$e,o(e.$t("site.message.descriptionTip")),1)]),_:1},8,["label"]),i(d,{label:e.$t("site.field.keywords")},{default:s(()=>{var t,n;return[l("span",ge,[v(o((t=e.site.keywords)==null?void 0:t.join(", "))+" ",1),i(F,{"model-value":((n=e.site)==null?void 0:n.keywords)||[],title:e.$t("site.title.editKeywords"),placeholder:e.$t("site.placeholder.keywords"),tip:e.$t("site.message.keywordsTip2"),onConfirm:a[5]||(a[5]=f=>e.onSave({keywords:f}))},null,8,["model-value","title","placeholder","tip"])]),l("span",we,o(e.$t("site.message.keywordsTip")),1)]}),_:1},8,["label"])]),_:1},8,["model"])]),_:1})]),_:1}),i(g,{md:12,xs:24},{default:s(()=>[i(k,{shadow:"hover",class:"mb-4"},{default:s(()=>[l("h4",ke,o(e.$t("site.title.distributionConfig")),1),i(h),i(w,{model:e.site,class:"form","label-width":"auto",style:{"max-width":"600px"}},{default:s(()=>[i(d,{label:e.$t("site.field.distributionDefaultInviterId")},{default:s(()=>{var t,n;return[v(o((t=e.site.distribution)==null?void 0:t.default_inviter_id)+" ",1),i(c,{"model-value":(n=e.site.distribution)==null?void 0:n.default_inviter_id,title:e.$t("site.title.editDistributionDefaultInviterId"),placeholder:e.$t("site.placeholder.editDistributionDefaultInviterId"),onConfirm:a[6]||(a[6]=f=>e.onSave({distribution:{...e.site.distribution,default_inviter_id:f}}))},null,8,["model-value","title","placeholder"]),l("span",Ce,o(e.$t("site.message.distributionDefaultInviterIdTip")),1)]}),_:1},8,["label"]),i(d,{label:e.$t("site.field.distributionForceInviterId")},{default:s(()=>{var t,n;return[v(o((t=e.site.distribution)==null?void 0:t.force_inviter_id)+" ",1),i(c,{"model-value":(n=e.site.distribution)==null?void 0:n.force_inviter_id,title:e.$t("site.title.editDistributionForceInviterId"),placeholder:e.$t("site.placeholder.editDistributionForceInviterId"),onConfirm:a[7]||(a[7]=f=>e.onSave({distribution:{...e.site.distribution,force_inviter_id:f}}))},null,8,["model-value","title","placeholder"]),l("span",Ie,o(e.$t("site.message.distributionForceInviterIdTip")),1)]}),_:1},8,["label"])]),_:1},8,["model"])]),_:1}),i(k,{shadow:"hover"},{default:s(()=>[l("h4",ye,o(e.$t("site.title.featuresConfig")),1),i(h),i(w,{model:e.site,class:"form","label-width":"auto",style:{"max-width":"600px"}},{default:s(()=>[(E(),Q(ie,null,ee(["chat","midjourney","qrart","suno","luma","pika","kling","flux","hailuo","headshots","support"],(t,n)=>i(d,{key:n,label:e.$t("site.field.features"+t.charAt(0).toUpperCase()+t.slice(1))},{default:s(()=>{var f,A,N,q,L,B;return[l("div",Se,[i(_,{"model-value":((f=e.site.features[t])==null?void 0:f.enabled)||!1,"inline-prompt":"","active-text":e.$t("site.button.enabled"),"inactive-text":e.$t("site.button.disabled"),"onUpdate:modelValue":r=>e.onSave({features:{...e.site.features,[t]:{...e.site.features[t],enabled:r}}})},null,8,["model-value","active-text","inactive-text","onUpdate:modelValue"])]),l("span",Te,o(e.$t("site.message.features"+t.charAt(0).toUpperCase()+t.slice(1))),1),t==="support"?U((E(),Q("div",_e,[i(d,{label:"WeChat"},{default:s(()=>{var r,u;return[i(_,{"model-value":((u=(r=e.site.features[t])==null?void 0:r.wechat)==null?void 0:u.enabled)||!1,"inline-prompt":"","active-text":e.$t("site.button.enabled"),"inactive-text":e.$t("site.button.disabled"),"onUpdate:modelValue":b=>{var m;return e.onSave({features:{...e.site.features,[t]:{...e.site.features[t],wechat:{...(m=e.site.features[t])==null?void 0:m.wechat,enabled:b}}}})}},null,8,["model-value","active-text","inactive-text","onUpdate:modelValue"])]}),_:2},1024),U(i(d,{label:e.$t("site.field.qr")},{default:s(()=>{var r,u,b,m;return[l("span",De,[i(S,{src:(u=(r=e.site.features[t])==null?void 0:r.wechat)==null?void 0:u.qr},null,8,["src"]),i(T,{"model-value":(m=(b=e.site.features[t])==null?void 0:b.wechat)==null?void 0:m.qr,title:e.$t("site.title.editQR"),tip:e.$t("site.message.editQRTip"),onConfirm:D=>{var $;return e.onSave({features:{...e.site.features,[t]:{...e.site.features[t],wechat:{...($=e.site.features[t])==null?void 0:$.wechat,qr:D}}}})}},null,8,["model-value","title","tip","onConfirm"])])]}),_:2},1032,["label"]),[[V,(N=(A=e.site.features[t])==null?void 0:A.wechat)==null?void 0:N.enabled]]),i(d,{label:"Discord"},{default:s(()=>{var r,u;return[i(_,{"model-value":((u=(r=e.site.features[t])==null?void 0:r.discord)==null?void 0:u.enabled)||!1,"inline-prompt":"","active-text":e.$t("site.button.enabled"),"inactive-text":e.$t("site.button.disabled"),"onUpdate:modelValue":b=>{var m;return e.onSave({features:{...e.site.features,[t]:{...e.site.features[t],discord:{...(m=e.site.features[t])==null?void 0:m.discord,enabled:b}}}})}},null,8,["model-value","active-text","inactive-text","onUpdate:modelValue"])]}),_:2},1024),U(i(d,{label:e.$t("site.field.url")},{default:s(()=>{var r,u,b,m;return[l("span",Ee,[v(o((u=(r=e.site.features[t])==null?void 0:r.discord)==null?void 0:u.url)+" ",1),i(c,{"model-value":(m=(b=e.site.features[t])==null?void 0:b.discord)==null?void 0:m.url,title:e.$t("site.title.editUrl"),placeholder:e.$t("site.placeholder.editUrl"),onConfirm:D=>{var $;return e.onSave({features:{...e.site.features,[t]:{...e.site.features[t],discord:{...($=e.site.features[t])==null?void 0:$.discord,url:D}}}})}},null,8,["model-value","title","placeholder","onConfirm"])])]}),_:2},1032,["label"]),[[V,(L=(q=e.site.features[t])==null?void 0:q.discord)==null?void 0:L.enabled]])],512)),[[V,(B=e.site.features[t])==null?void 0:B.enabled]]):te("v-if",!0)]}),_:2},1032,["label"])),64))]),_:1},8,["model"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}var Re=W(se,[["render",Ue],["__scopeId","data-v-262b806e"],["__file","/home/runner/work/Nexior/Nexior/src/pages/site/Index.vue"]]);export{Re as default};
|