@acedatacloud/nexior 2.16.2 → 2.16.3

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.
Files changed (49) hide show
  1. package/dist/assets/{Auth.c6bce8b3.js → Auth.ef589c26.js} +1 -1
  2. package/dist/assets/{Callback.563aa19a.js → Callback.bbf04476.js} +1 -1
  3. package/dist/assets/{Chatdoc.4c22c965.js → Chatdoc.7da6848c.js} +1 -1
  4. package/dist/assets/{Console.954af5f6.js → Console.fd79d5f2.js} +1 -1
  5. package/dist/assets/{Conversation.05e0b9a0.js → Conversation.05a0ac19.js} +1 -1
  6. package/dist/assets/{Conversation.ce51e7cb.js → Conversation.2005df6c.js} +1 -1
  7. package/dist/assets/{CopyToClipboard.70ad0a47.js → CopyToClipboard.698d5771.js} +1 -1
  8. package/dist/assets/{DarkSelector.c35769ce.js → DarkSelector.d2e7be0a.js} +1 -1
  9. package/dist/assets/{Detail.cb49d7b1.js → Detail.6fcb6061.js} +1 -1
  10. package/dist/assets/{Extra.172e8c07.js → Extra.cb137eb5.js} +1 -1
  11. package/dist/assets/{History.cb910879.js → History.182721c0.js} +1 -1
  12. package/dist/assets/{ImageNavigator.44e7645d.js → ImageNavigator.02955a2f.js} +1 -1
  13. package/dist/assets/{Index.36823bc5.js → Index.118af1c6.js} +1 -1
  14. package/dist/assets/{Index.c9f6843b.js → Index.190b47fc.js} +1 -1
  15. package/dist/assets/{Index.6c2ba8eb.js → Index.2921ff84.js} +1 -1
  16. package/dist/assets/{Index.91724f44.js → Index.660c133c.js} +1 -1
  17. package/dist/assets/{Index.08924a9d.js → Index.6cb8821e.js} +1 -1
  18. package/dist/assets/{Index.61730192.js → Index.7ac297cd.js} +1 -1
  19. package/dist/assets/{Index.6c2f87d2.js → Index.8e2e5a58.js} +1 -1
  20. package/dist/assets/{Index.dd914d26.js → Index.a947d9a0.js} +1 -1
  21. package/dist/assets/Index.b66ec671.js +1 -0
  22. package/dist/assets/Index.c278b881.js +3 -0
  23. package/dist/assets/{Index.1b95745d.js → Index.d6d71b03.js} +1 -1
  24. package/dist/assets/{Index.efd752d2.js → Index.d7a89f1e.js} +1 -1
  25. package/dist/assets/{Index.436505b7.js → Index.f5a66a09.js} +1 -1
  26. package/dist/assets/{Index.12fdceec.js → Index.fa1ee82e.js} +1 -1
  27. package/dist/assets/{InfoIcon.0d72ff26.js → InfoIcon.a96e69b0.js} +1 -1
  28. package/dist/assets/{Invitees.abc02851.js → Invitees.7485090c.js} +1 -1
  29. package/dist/assets/{List.5dacb543.js → List.a630f1c7.js} +1 -1
  30. package/dist/assets/{List.5c6b67b4.js → List.b709877b.js} +1 -1
  31. package/dist/assets/{List.f3c6c667.js → List.cf905026.js} +1 -1
  32. package/dist/assets/{Login.59cba0c8.js → Login.7a40d47f.js} +1 -1
  33. package/dist/assets/{Main.5f3b725c.js → Main.08c0d325.js} +1 -1
  34. package/dist/assets/{Manage.4c13d241.js → Manage.c23b36fc.js} +1 -1
  35. package/dist/assets/{MarkdownRenderer.f00d66e6.js → MarkdownRenderer.57e1d6dd.js} +1 -1
  36. package/dist/assets/{Navigator.38a6fdd9.js → Navigator.a6dea473.js} +1 -1
  37. package/dist/assets/{Pagination.10e8cfd1.js → Pagination.e46a3abe.js} +1 -1
  38. package/dist/assets/{Setting.8d81c3ff.js → Setting.9e6d0d4c.js} +1 -1
  39. package/dist/assets/{Status.3ed09234.js → Status.2748135c.js} +1 -1
  40. package/dist/assets/{Subscribe.92cd7a18.js → Subscribe.c3834e12.js} +1 -1
  41. package/dist/assets/{VideoNavigator.a5c28887.js → VideoNavigator.a4d102ea.js} +1 -1
  42. package/dist/assets/{distribution.ce22eb3a.js → distribution.3a065dae.js} +1 -1
  43. package/dist/assets/{index.54863a79.js → index.ca771f54.js} +1 -1
  44. package/dist/assets/{order.2e7291db.js → order.4041fa79.js} +1 -1
  45. package/dist/assets/{price.641fbd15.js → price.01d44e68.js} +1 -1
  46. package/dist/index.html +1 -1
  47. package/package.json +1 -1
  48. package/dist/assets/Index.59dc020b.js +0 -1
  49. package/dist/assets/Index.a95c90ad.js +0 -3
@@ -0,0 +1 @@
1
+ var ke=Object.defineProperty,we=Object.defineProperties;var Ie=Object.getOwnPropertyDescriptors;var ve=Object.getOwnPropertySymbols;var Ve=Object.prototype.hasOwnProperty,Se=Object.prototype.propertyIsEnumerable;var ge=(e,t,o)=>t in e?ke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,k=(e,t)=>{for(var o in t||(t={}))Ve.call(t,o)&&ge(e,o,t[o]);if(ve)for(var o of ve(t))Se.call(t,o)&&ge(e,o,t[o]);return e},w=(e,t)=>we(e,Ie(t));import{K as be}from"./vendor-others.179d4404.js";import{aq as W}from"./vendor-fortawesome.3e228e5c.js";import{V as Ee}from"./VideoNavigator.a4d102ea.js";import{_ as I,ax as Ue,ay as Ce,az as Pe,M as J,P as K,F as Ae,aA as Le}from"./index.ca771f54.js";import{P as Ne,l as z,_ as X,O as Y,M as y,N as Te,s as Re,F as Ge,u as ze,C as De,R as Me}from"./vendor-element-plus.f90d6803.js";import{H as V,al as n,o as r,e as p,f as l,V as s,I as Q,M as m,U as i,T as $,L as N,S as v,Q as H,W as $e,ai as ye}from"./vendor-@vue.fc29b169.js";import{I as G}from"./InfoIcon.a96e69b0.js";import{A as Oe,i as Fe,h as je}from"./Status.2748135c.js";import{C as qe}from"./CopyToClipboard.698d5771.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.8db51d62.js";const Be=V({name:"LayoutLuma",components:{ElDrawer:Ne,ElButton:z,FontAwesomeIcon:W,VideoNavigator:Ee},data(){return{drawer:!1}}}),He={class:"main"},Ke={class:"config"},Qe={class:"result"};function We(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",He,[l("div",Ke,[s(c),Q(e.$slots,"config",{},void 0,!0)]),l("div",Qe,[Q(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(()=>[Q(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var Je=I(Be,[["render",We],["__scopeId","data-v-234cfb9c"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Luma.vue"]]);const Xe=V({name:"EnhancementSelector",components:{ElSwitch:X,InfoIcon:G},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",w(k({},(t=this.$store.state.luma)==null?void 0:t.config),{enhancement:e}))}}},mounted(){this.value===void 0&&(this.value=Ue)}}),Ye={class:"field"},Ze={class:"title font-bold"};function xe(e,t,o,a,h,g){const c=n("el-switch"),u=n("info-icon");return r(),p("div",Ye,[l("h2",Ze,i(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 et=I(Xe,[["render",xe],["__scopeId","data-v-175365a0"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/EnhancementSelector.vue"]]);const tt=V({name:"CustomSelector",components:{ElSwitch:X,InfoIcon:G},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",w(k({},(t=this.$store.state.luma)==null?void 0:t.config),{custom:e}))}}},mounted(){this.value===void 0&&(this.value=Ce)}}),ot={class:"field"},st={class:"title font-bold"};function nt(e,t,o,a,h,g){const c=n("el-switch"),u=n("info-icon");return r(),p("div",ot,[l("h2",st,i(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 at=I(tt,[["render",nt],["__scopeId","data-v-5ac2addb"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/CustomSelector.vue"]]);const lt=V({name:"LoopSelector",components:{ElSwitch:X,InfoIcon:G},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",w(k({},(t=this.$store.state.luma)==null?void 0:t.config),{loop:e}))}}},mounted(){this.value===void 0&&(this.value=Pe)}}),it={class:"field"},rt={class:"title font-bold"};function ct(e,t,o,a,h,g){const c=n("el-switch"),u=n("info-icon");return r(),p("div",it,[l("h2",rt,i(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 ut=I(lt,[["render",ct],["__scopeId","data-v-69cccd4e"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/LoopSelector.vue"]]);const dt=V({name:"ContentInput",components:{ElUpload:Y,ElButton:z,InfoIcon:G},data(){return{fileList:[],uploadUrl:J()+"/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",w(k({},(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",w(k({},(o=this.$store.state.luma)==null?void 0:o.config),{end_image_url:e}))},async onSuccess(){this.onSetEndImageUrl()}}}),mt={class:"field"},pt={class:"title font-bold"},_t={class:"upload-wrapper"};function ft(e,t,o,a,h,g){const c=n("el-button"),u=n("el-upload"),d=n("info-icon");return r(),p("div",mt,[l("h2",pt,i(e.$t("luma.name.endImageUrl")),1),l("div",_t,[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(()=>[$(i(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 ht=I(dt,[["render",ft],["__scopeId","data-v-97900bb4"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/EndImageUrlInput.vue"]]);const vt=V({name:"StartImageUrlInput",components:{ElUpload:Y,ElButton:z,InfoIcon:G},data(){return{fileList:[],uploadUrl:J()+"/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",w(k({},(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",w(k({},(o=this.$store.state.luma)==null?void 0:o.config),{start_image_url:e}))},async onSuccess(){this.onSetStartImageUrl()}}}),gt={class:"field"},$t={class:"title font-bold"},yt={class:"upload-wrapper"};function bt(e,t,o,a,h,g){const c=n("el-button"),u=n("el-upload"),d=n("info-icon");return r(),p("div",gt,[l("h2",$t,i(e.$t("luma.name.startImageUrl")),1),l("div",yt,[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(()=>[$(i(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 kt=I(vt,[["render",bt],["__scopeId","data-v-5440a4bf"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/StartImageUrlInput.vue"]]);const wt=V({name:"UploadVideo",components:{ElUpload:Y,ElButton:z,InfoIcon:G},data(){return{fileList:[],uploadUrl:J()+"/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",w(k({},(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",w(k({},(o=this.$store.state.luma)==null?void 0:o.config),{video_url:e,action:"extend"}))},async onSuccess(){this.onSetVideoUrl()}}}),It={class:"field"},Vt={class:"title font-bold"},St={class:"upload-wrapper"};function Et(e,t,o,a,h,g){const c=n("el-button"),u=n("el-upload"),d=n("info-icon");return r(),p("div",It,[l("h2",Vt,i(e.$t("luma.name.videoUrl")),1),l("div",St,[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(()=>[$(i(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 Ut=I(wt,[["render",Et],["__scopeId","data-v-46c66c9f"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/UploadVideo.vue"]]);const Ct="",Pt=V({name:"PromptInput",components:{ElInput:Te,InfoIcon:G},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",w(k({},(t=this.$store.state.luma)==null?void 0:t.config),{prompt:e}))}}},mounted(){this.value||(this.value=Ct)}}),At={class:"field"},Lt={class:"box"},Nt={class:"title font-bold"};function Tt(e,t,o,a,h,g){const c=n("info-icon"),u=n("el-input");return r(),p("div",At,[l("div",Lt,[l("h2",Nt,i(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 Rt=I(Pt,[["render",Tt],["__scopeId","data-v-19a7446b"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/PromptInput.vue"]]);const Gt=V({name:"ExtendFromInput",components:{VuePlyr:be},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}}}),zt={class:"field"},Dt={class:"box"},Mt={class:"title font-bold"},Ot={class:"task"},Ft=["data-poster"],jt=["src"];function qt(e,t,o,a,h,g){const c=n("vue-plyr");return r(),p("div",zt,[l("div",Dt,[l("h2",Mt,i(e.$t("luma.name.extend")),1)]),l("div",Ot,[l("div",null,[s(c,{options:e.options,class:"video"},{default:m(()=>{var u,d;return[l("video",{controls:"",crossorigin:"",playsinline:"","data-poster":(u=e.config)==null?void 0:u.thumbnail_url},[l("source",{size:"1080",src:(d=e.config)==null?void 0:d.video_url,type:"video/mp4"},null,8,jt)],8,Ft)]}),_:1},8,["options"])])])])}var Bt=I(Gt,[["render",qt],["__scopeId","data-v-1cefb16b"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/config/ExtendFromInput.vue"]]);const Ht=V({name:"PresetPanel",components:{LoopSelector:ut,StartImageUrlInput:kt,EndImageUrlInput:ht,EnhancementSelector:et,ElButton:z,FontAwesomeIcon:W,PromptInput:Rt,ExtendFromInput:Bt,CustomSelector:at,UploadVideo:Ut},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.luma)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),Kt={class:"panel"},Qt={class:"config"},Wt={class:"actions"};function Jt(e,t,o,a,h,g){var L,E,R,D,M,O,F,j,q;const c=n("extend-from-input"),u=n("prompt-input"),d=n("custom-selector"),_=n("upload-video"),f=n("start-image-url-input"),U=n("end-image-url-input"),C=n("enhancement-selector"),T=n("loop-selector"),P=n("font-awesome-icon"),A=n("el-button");return r(),p("div",Kt,[l("div",Qt,[((L=e.config)==null?void 0:L.video_id)||((E=e.config)==null?void 0:E.video_url)?(r(),N(c,{key:0,class:"mb-4"})):v("v-if",!0),s(u,{class:"mb-4"}),(R=e.config)!=null&&R.video_id?v("v-if",!0):(r(),N(d,{key:1,class:"mb-4"})),(D=e.config)!=null&&D.custom?(r(),N(_,{key:2,class:"mb-4"})):v("v-if",!0),!(((M=e.config)==null?void 0:M.video_id)||((O=e.config)==null?void 0:O.video_url))&&!((F=e.config)!=null&&F.custom)?(r(),N(f,{key:3,class:"mb-4"})):v("v-if",!0),s(U,{class:"mb-4"}),s(C,{class:"mb-4"}),s(T,{class:"mb-4"}),l("div",Wt,[((j=e.config)==null?void 0:j.video_url)!==void 0||((q=e.config)==null?void 0:q.custom)?(r(),N(A,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:m(()=>[s(P,{icon:"fa-solid fa-magic",class:"mr-2"}),$(" "+i(e.$t("luma.button.extend")),1)]),_:1},8,["onClick"])):(r(),N(A,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:m(()=>[s(P,{icon:"fa-solid fa-magic",class:"mr-2"}),$(" "+i(e.$t("luma.button.generate")),1)]),_:1},8,["onClick"]))])])])}var Xt=I(Ht,[["render",Jt],["__scopeId","data-v-951b4cc0"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/ConfigPanel.vue"]]);const Yt=V({name:"VideoPlayer",components:{VuePlyr:be},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:"1080p"}}}}}),Zt=["data-poster"],xt=["src"];function eo(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[l("video",{controls:"",crossorigin:"",playsinline:"","data-poster":(d=(u=e.modelValue)==null?void 0:u.response)==null?void 0:d.thumbnail_url},[l("source",{size:"1080",src:(f=(_=e.modelValue)==null?void 0:_.response)==null?void 0:f.video_url,type:"video/mp4"},null,8,xt)],8,Zt)]}),_:1},8,["options"])])}var to=I(Yt,[["render",eo],["__scopeId","data-v-759e400c"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/VideoPlayer.vue"]]);const oo=V({name:"TaskPreview",components:{ElImage:Re,CopyToClipboard:qe,FontAwesomeIcon:W,ElAlert:Ge,VideoPlayer:to,ElTooltip:ze,ElButton:z},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",w(k({},(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")}}}),so={class:"preview"},no={class:"left"},ao={class:"main"},lo={class:"bot"},io={class:"datetime"},ro={class:"info"},co={key:0,class:"prompt mt-2"},uo={key:0},mo={key:1},po={key:0,class:H({content:!0,failed:!0})},_o={class:"image-wrapper"},fo={key:0,class:H({operations:!0,"mt-2":!0})},ho={class:"description"},vo={key:1,class:H({content:!0})},go={class:"description"},$o={class:"description"},yo={class:"description"},bo={key:2,class:H({content:!0})},ko={class:"description"};function wo(e,t,o,a,h,g){var T,P,A,L,E,R,D,M,O,F,j,q,Z,x,ee,te,oe,se,ne,ae,le,ie,re;const c=n("el-image"),u=n("VideoPlayer"),d=n("el-button"),_=n("el-tooltip"),f=n("font-awesome-icon"),U=n("copy-to-clipboard"),C=n("el-alert");return r(),p("div",so,[l("div",no,[s(c,{src:"https://cdn.acedata.cloud/ahjfwi.png",class:"avatar"})]),l("div",ao,[l("div",lo,[$(i(e.$t("luma.name.lumaBot"))+" ",1),l("span",io,i(e.$dayjs.format(""+new Date(parseFloat(((T=e.modelValue)==null?void 0:T.created_at)||"")*1e3))),1)]),l("div",ro,[(A=(P=e.modelValue)==null?void 0:P.request)!=null&&A.prompt?(r(),p("p",co,[$(i((E=(L=e.modelValue)==null?void 0:L.request)==null?void 0:E.prompt)+" ",1),(R=e.modelValue)!=null&&R.response?v("v-if",!0):(r(),p("span",uo," - ("+i(e.$t("luma.status.pending"))+") ",1)),((M=(D=e.modelValue)==null?void 0:D.response)==null?void 0:M.state)==="processing"||((F=(O=e.modelValue)==null?void 0:O.response)==null?void 0:F.state)==="pending"?(r(),p("span",mo," - ("+i(e.$t("luma.status.processing"))+") ",1)):v("v-if",!0)])):v("v-if",!0)]),v(" Display success message "),((q=(j=e.modelValue)==null?void 0:j.response)==null?void 0:q.success)===!0?(r(),p("div",po,[l("div",_o,[s(u,{"model-value":e.modelValue},null,8,["model-value"])]),((Z=e.modelValue)==null?void 0:Z.response)&&!((x=e.config)!=null&&x.custom)?(r(),p("div",fo,[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]=S=>{var b;return e.onExtend(S,(b=e.modelValue)==null?void 0:b.response)})},{default:m(()=>[$(i(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]=S=>{var b,B;return e.onDownload(S,(B=(b=e.modelValue)==null?void 0:b.response)==null?void 0:B.video_url)})},{default:m(()=>[$(i(e.$t("luma.button.download")),1)]),_:1})]),_:1},8,["content"])])):v("v-if",!0),s(C,{closable:!1,class:"mt-2 success"},{default:m(()=>{var S,b;return[l("p",ho,[s(f,{icon:"fa-solid fa-magic",class:"mr-1"}),$(" "+i(e.$t("luma.name.taskId"))+": "+i((S=e.modelValue)==null?void 0:S.id)+" ",1),s(U,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):v("v-if",!0),v(" Display error message "),((te=(ee=e.modelValue)==null?void 0:ee.response)==null?void 0:te.state)==="failed"||((se=(oe=e.modelValue)==null?void 0:oe.response)==null?void 0:se.success)===!1?(r(),p("div",vo,[s(C,{closable:!1,class:"failure"},{template:m(()=>[s(f,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),$(" "+i(e.$t("luma.name.failure")),1)]),default:m(()=>{var S,b,B,ce,ue,de,me,pe,_e,fe,he;return[l("p",go,[s(f,{icon:"fa-solid fa-magic",class:"mr-1"}),$(" "+i(e.$t("luma.name.taskId"))+": "+i((S=e.modelValue)==null?void 0:S.id)+" ",1),s(U,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])]),l("p",$o,[s(f,{icon:"fa-solid fa-circle-info",class:"mr-1"}),$(" "+i(e.$t("luma.name.failureReason"))+": "+i((ue=(ce=(B=e.modelValue)==null?void 0:B.response)==null?void 0:ce.error)==null?void 0:ue.message)+" ",1),s(U,{content:(pe=(me=(de=e.modelValue)==null?void 0:de.response)==null?void 0:me.error)==null?void 0:pe.message,class:"btn-copy"},null,8,["content"])]),l("p",yo,[s(f,{icon:"fa-solid fa-hashtag",class:"mr-1"}),$(" "+i(e.$t("luma.name.traceId"))+": "+i((_e=e.modelValue)==null?void 0:_e.trace_id)+" ",1),s(U,{content:(he=(fe=e.modelValue)==null?void 0:fe.response)==null?void 0:he.trace_id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):v("v-if",!0),v(" Display error message "),!((ne=e.modelValue)!=null&&ne.response)||((le=(ae=e.modelValue)==null?void 0:ae.response)==null?void 0:le.state)==="processing"||((re=(ie=e.modelValue)==null?void 0:ie.response)==null?void 0:re.state)==="pending"?(r(),p("div",bo,[s(C,{closable:!1,class:"info"},{template:m(()=>[s(f,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),$(" "+i(e.$t("luma.name.failure")),1)]),default:m(()=>{var S,b;return[l("p",ko,[s(f,{icon:"fa-solid fa-magic",class:"mr-1"}),$(" "+i(e.$t("luma.name.taskId"))+": "+i((S=e.modelValue)==null?void 0:S.id)+" ",1),s(U,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):v("v-if",!0)])])}var Io=I(oo,[["render",wo],["__scopeId","data-v-077795a0"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/task/Preview.vue"]]);const Vo=V({name:"RecentPanel",components:{TaskPreview:Io,ElSkeleton:De,ElSkeletonItem:Me},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){var e,t,o,a;return w(k({},(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")}}}),So={key:0,class:"tasks"},Eo={class:"left"},Uo={class:"main"},Co={key:1,class:"tasks"},Po={key:2,class:"description"};function Ao(e,t,o,a,h,g){var _,f,U,C,T,P,A,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]=(...E)=>e.onHandleScroll&&e.onHandleScroll(...E))},[((_=e.tasks)==null?void 0:_.items)===void 0?(r(),p("div",So,[(r(),p($e,null,ye(3,E=>l("div",{key:E,class:"task placeholder"},[l("div",Eo,[s(u,{animated:""},{template:m(()=>[s(c,{variant:"image",class:"avatar"})]),_:1})]),l("div",Uo,[s(u,{animated:""},{template:m(()=>[s(c,{variant:"p",class:"title"}),s(c,{variant:"image",class:"icon"})]),_:1})])])),64))])):((U=(f=e.tasks)==null?void 0:f.items)==null?void 0:U.length)&&((T=(C=e.tasks)==null?void 0:C.items)==null?void 0:T.length)>0?(r(),p("div",Co,[(r(!0),p($e,null,ye((P=e.tasks)==null?void 0:P.items,(E,R)=>(r(),N(d,{key:R,"model-value":E,class:"preview"},null,8,["model-value"]))),128))])):v("v-if",!0),((L=(A=e.tasks)==null?void 0:A.items)==null?void 0:L.length)===0?(r(),p("p",Po,i(e.$t("luma.message.noTasks")),1)):v("v-if",!0)],544)}var Lo=I(Vo,[["render",Ao],["__scopeId","data-v-2f8302a7"],["__file","/home/runner/work/Nexior/Nexior/src/components/luma/RecentPanel.vue"]]);const No="https://webhook.acedata.cloud/luma",To=V({name:"LumaIndex",components:{ConfigPanel:Xt,Layout:Je,ApplicationStatus:Oe,RecentPanel:Lo},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)===K.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===K.Request},needApply(){return this.$store.state.luma.status.getApplications===K.Success&&!this.application},application(){return this.$store.state.luma.application},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(){Ae.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)===Fe&&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=w(k({},this.config),{callback_url:No}),t=(o=this.credential)==null?void 0:o.token;if(!t){console.error("no token specified");return}y.info(this.$t("luma.message.startingTask")),Le.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)===je?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 Ro(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 Wo=I(To,[["render",Ro],["__scopeId","data-v-c45e0af8"],["__file","/home/runner/work/Nexior/Nexior/src/pages/luma/Index.vue"]]);export{Wo as default};
@@ -0,0 +1,3 @@
1
+ var Ae=Object.defineProperty,Se=Object.defineProperties;var Ie=Object.getOwnPropertyDescriptors;var ge=Object.getOwnPropertySymbols;var Ne=Object.prototype.hasOwnProperty,Te=Object.prototype.propertyIsEnumerable;var ye=(e,t,s)=>t in e?Ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,_=(e,t)=>{for(var s in t||(t={}))Ne.call(t,s)&&ye(e,s,t[s]);if(ge)for(var s of ge(t))Te.call(t,s)&&ye(e,s,t[s]);return e},g=(e,t)=>Se(e,Ie(t));import{L as Ee,M as te,V as Ve,N as we,P as Ue,O as Le}from"./vendor-others.179d4404.js";import{aq as le}from"./vendor-fortawesome.3e228e5c.js";import{_ as C,aK as ke,M as Fe,aL as me,P as ie,F as De}from"./index.ca771f54.js";import{P as Ge,l as re,w as je,x as Re,_ as be,O as Me,M as j,N as ce,s as ue,T as de,V as qe,$ as he,a0 as fe,u as ze,d as Oe,f as Be,e as xe,U as Ce,t as He,C as Ke,R as We,a1 as Ye,a2 as Je,a3 as Qe}from"./vendor-element-plus.f90d6803.js";import{H as P,al as u,o as r,e as m,S as y,f as l,I as ne,V as a,M as f,U as v,W as Z,ai as ae,L as k,T as M,av as ve,O as pe,m as Q,u as w,A as Pe,s as Xe,R as Ze,P as et}from"./vendor-@vue.fc29b169.js";import{A as tt,i as ot}from"./Status.2748135c.js";import{I as oe}from"./InfoIcon.a96e69b0.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.8db51d62.js";const st=P({name:"LayoutSuno",components:{ElDrawer:Ge,ElButton:re,FontAwesomeIcon:le},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}}}),nt={class:"main"},it={class:"config"},at={class:"result"},lt={class:"preview"};function rt(e,t,s,n,c,d){const i=u("font-awesome-icon"),p=u("el-button"),h=u("el-drawer");return r(),m("div",nt,[y(" \u6700\u5DE6\u4FA7\u914D\u7F6E\u680F "),l("div",it,[ne(e.$slots,"config",{},void 0,!0)]),y(" \u4E2D\u95F4\u6B4C\u66F2\u5217\u8868\u680F "),l("div",at,[ne(e.$slots,"result",{},void 0,!0)]),y(" \u6700\u53F3\u8FB9\u6B4C\u66F2\u9884\u89C8\u680F "),l("div",lt,[ne(e.$slots,"preview",{},void 0,!0)]),a(p,{round:"",class:"menu",onClick:t[0]||(t[0]=$=>e.drawer=!0)},{default:f(()=>[a(i,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),a(h,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=$=>e.drawer=$),"with-header":!1,size:"340px",class:"drawer"},{default:f(()=>[ne(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"]),y(` <el-drawer v-model="isPlaying" :with-header="false" size="340px" class="preview_drawer">
2
+ <slot name="preview" />
3
+ </el-drawer> `)])}var ct=C(st,[["render",rt],["__scopeId","data-v-0621513c"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Suno.vue"]]);const ut=P({name:"VersionSelector",components:{ElSelect:je,ElOption:Re,ElSwitch:be},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",g(_({},(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",g(_({},(t=this.$store.state.suno)==null?void 0:t.config),{model:e}))}}},mounted(){this.model||(console.debug("set default type",ke),this.model=ke)}}),dt={class:"field"},pt={class:"title font-bold"};function _t(e,t,s,n,c,d){const i=u("el-switch"),p=u("el-option"),h=u("el-select");return r(),m("div",dt,[l("h2",pt,v(e.$t("suno.name.type")),1),a(i,{modelValue:e.custom,"onUpdate:modelValue":t[0]||(t[0]=$=>e.custom=$),class:"value"},null,8,["modelValue"]),a(h,{modelValue:e.model,"onUpdate:modelValue":t[1]||(t[1]=$=>e.model=$),class:"value",placeholder:e.$t("suno.placeholder.select")},{default:f(()=>[(r(!0),m(Z,null,ae(e.options,$=>(r(),k(p,{key:$.value,label:$.label,value:$.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}var mt=C(ut,[["render",_t],["__scopeId","data-v-6d5f21aa"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/TypeSelector.vue"]]);const ht=P({name:"UploadAudio",components:{ElUpload:Me,ElButton:re,InfoIcon:oe,FontAwesomeIcon:le},emits:["change"],data(){return{fileList:[],uploadUrl:Fe()+"/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(){j.warning(this.$t("suno.message.uploadReferencesExceed"))},onError(){j.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 n;const t={audio_url:e},s=(n=this.credential)==null?void 0:n.token;if(!s){console.error("no token specified");return}j.info(this.$t("suno.message.startingUploadAudio")),me.upload(t,{token:s}).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",g(_({},(p=this.$store.state.suno)==null?void 0:p.config),{audio_id:d,action:"upload_extend"})),j.success(this.$t("suno.message.startUploadAudioSuccess"))}).catch(c=>{var d,i,p;j.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(){}}}),ft={class:"relative"},vt={class:"flex justify-between"},$t={class:"flex justify-start items-center"},gt={class:"text-sm font-bold"};function yt(e,t,s,n,c,d){const i=u("info-icon"),p=u("font-awesome-icon"),h=u("el-button"),$=u("el-upload");return r(),m("div",ft,[l("div",vt,[l("div",$t,[l("span",gt,v(e.$t("suno.name.referenceAudios")),1),a(i,{content:e.$t("suno.description.uploadAudios")},null,8,["content"])])]),a($,{"file-list":e.fileList,"onUpdate:file-list":t[0]||(t[0]=A=>e.fileList=A),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:f(()=>[a(h,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:f(()=>[a(p,{icon:"fa-solid fa-upload",class:"icon mr-1"}),M(" "+v(e.$t("suno.button.uploadAudios")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}var kt=C(ht,[["render",yt],["__scopeId","data-v-3fef3e18"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/UploadAudio.vue"]]);const wt="",bt=P({name:"PromptInput",components:{ElInput:ce,ElSwitch:be,InfoIcon:oe},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",g(_({},(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",g(_({},(t=this.$store.state.suno)==null?void 0:t.config),{instrumental:e}))}}},mounted(){this.value||(this.value=wt)}}),Ct={class:"field"},Pt={class:"box"},At={class:"title-info"},St={class:"title font-bold"},It={class:"instrumental"},Nt={class:"title inline-block"};function Tt(e,t,s,n,c,d){const i=u("info-icon"),p=u("el-switch"),h=u("el-input");return r(),m("div",Ct,[l("div",Pt,[l("div",At,[l("h2",St,v(e.$t("suno.name.prompt")),1),a(i,{content:e.$t("suno.description.prompt"),class:"info"},null,8,["content"])]),l("div",It,[a(p,{modelValue:e.instrumental,"onUpdate:modelValue":t[0]||(t[0]=$=>e.instrumental=$),class:"value mr-2"},null,8,["modelValue"]),l("h2",Nt,v(e.$t("suno.name.instrumental")),1)])]),a(h,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||(t[1]=$=>e.prompt=$),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("suno.placeholder.prompt"),maxlength:200,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var Et=C(bt,[["render",Tt],["__scopeId","data-v-11b65236"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/PromptInput.vue"]]);const Vt="",Ut=P({name:"LyricInput",components:{ElInput:ce,InfoIcon:oe},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",g(_({},(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=Vt)}}),Lt={class:"field"},Ft={class:"box"},Dt={class:"title font-bold"};function Gt(e,t,s,n,c,d){var h;const i=u("info-icon"),p=u("el-input");return r(),m("div",Lt,[l("div",Ft,[l("h2",Dt,v(e.$t("suno.name.lyrics")),1),a(i,{content:e.$t("suno.description.lyrics"),class:"info"},null,8,["content"])]),((h=e.config)==null?void 0:h.action)!=="extend"?(r(),k(p,{key:0,modelValue:e.lyric,"onUpdate:modelValue":t[0]||(t[0]=$=>e.lyric=$),rows:3,type:"textarea",class:"lyrics",placeholder:e.$t("suno.placeholder.lyrics"),maxlength:3e3,"show-word-limit":""},null,8,["modelValue","placeholder"])):(r(),k(p,{key:1,modelValue:e.lyric,"onUpdate:modelValue":t[1]||(t[1]=$=>e.lyric=$),rows:3,type:"textarea",class:"lyrics",placeholder:e.$t("suno.placeholder.extend.lyrics"),maxlength:3e3,"show-word-limit":""},null,8,["modelValue","placeholder"]))])}var jt=C(Ut,[["render",Gt],["__scopeId","data-v-b47f1748"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/LyricInput.vue"]]);const Rt=P({name:"StyleInput",components:{ElInput:ce,InfoIcon:oe},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",g(_({},(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}}}),Mt={class:"field"},qt={class:"title-container"},zt={class:"titlefont-bold"};function Ot(e,t,s,n,c,d){const i=u("info-icon"),p=u("el-input");return r(),m("div",Mt,[l("div",qt,[l("h2",zt,v(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]=h=>e.style=h),rows:3,type:"textarea",class:"style",placeholder:e.$t("suno.placeholder.style"),maxlength:200,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var Bt=C(Rt,[["render",Ot],["__scopeId","data-v-075e574a"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/StyleInput.vue"]]);const xt="",Ht=P({name:"TitleInput",components:{ElInput:ce,InfoIcon:oe},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",g(_({},(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",g(_({},(t=this.$store.state.suno)==null?void 0:t.config),{instrumental:e}))}}},mounted(){this.value||(this.value=xt)}}),Kt={class:"field"},Wt={class:"title-container"},Yt={class:"title font-bold"};function Jt(e,t,s,n,c,d){const i=u("info-icon"),p=u("el-input");return r(),m("div",Kt,[l("div",Wt,[l("h2",Yt,v(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]=h=>e.title=h),rows:3,type:"textarea",class:"title",placeholder:e.$t("suno.placeholder.title"),maxlength:80,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var Qt=C(Ht,[["render",Jt],["__scopeId","data-v-f9bac2fa"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/TitleInput.vue"]]);function ee(e){const t=Math.floor(e)%60;e=Math.floor(e/60);const s=e%60,n=s<10?`0${s}`:s,c=t<10?`0${t}`:t;return n+":"+c}const Xt=P({name:"ExtendFromInput",components:{ElImage:ue,ElIcon:de,ElInputNumber:qe,VideoPlay:he,VideoPause:fe},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",g(_({},(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,s;e<0?this.value=0:e>((t=this.audio)==null?void 0:t.duration)?this.value=(s=this.audio)==null?void 0:s.duration:this.value=e},useFormatDuring:ee,onPlay(e){this.$store.dispatch("suno/setAudio",g(_(_({},this.$store.state.suno.audio),e),{state:"playing"})),console.log("on play")},onPause(e){this.$store.dispatch("suno/setAudio",g(_(_({},this.$store.state.suno.audio),e),{state:"paused"})),console.log("on pause")},onClick(e){var t,s,n;((n=(s=(t=this.$store.state)==null?void 0:t.suno)==null?void 0:s.audio)==null?void 0:n.id)!==e.id&&this.onPlay(g(_({},e),{progress:0}))}}}),Zt={class:"field"},eo={class:"box"},to={class:"title font-bold"},oo={class:"input-wrapper"},so={class:"task"},no={class:"left"},io={key:2,class:"duration"},ao={class:"info"},lo={class:"title"},ro={class:"style"};function co(e,t,s,n,c,d){var N,S,T,E,U,o,G,L,F,D,V,R,q,z,O,B,x,H,K,W,Y,J,b,X,$e;const i=u("el-input-number"),p=u("el-image"),h=u("video-pause"),$=u("el-icon"),A=u("video-play"),I=ve("loading");return r(),m("div",Zt,[l("div",eo,[l("h2",to,v(e.$t("suno.name.extend")),1),l("div",oo,[a(i,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=se=>e.value=se),class:"value",min:0,max:(N=e.audio)==null?void 0:N.duration,controls:!1,placeholder:e.$t("suno.placeholder.extend.continue_at"),onChange:e.handleChange},null,8,["modelValue","max","placeholder","onChange"])])]),l("div",so,[l("div",{class:"audio",onClick:t[3]||(t[3]=se=>e.onClick(e.audio))},[pe((r(),m("div",no,[a(p,{src:(S=e.audio)==null?void 0:S.image_url,class:"cover",fit:"cover"},null,8,["src"]),((T=e.audio)==null?void 0:T.audio_url)&&((o=(U=(E=e.$store.state)==null?void 0:E.suno)==null?void 0:U.audio)==null?void 0:o.id)===e.audio.id&&((F=(L=(G=e.$store.state)==null?void 0:G.suno)==null?void 0:L.audio)==null?void 0:F.state)==="playing"?(r(),m("div",{key:0,class:"overlay",onClick:t[1]||(t[1]=se=>e.onPause(e.audio))},[a($,null,{default:f(()=>[a(h)]),_:1})])):y("v-if",!0),((D=e.audio)==null?void 0:D.audio_url)&&(((q=(R=(V=e.$store.state)==null?void 0:V.suno)==null?void 0:R.audio)==null?void 0:q.id)!==e.audio.id||((B=(O=(z=e.$store.state)==null?void 0:z.suno)==null?void 0:O.audio)==null?void 0:B.id)===e.audio.id&&((K=(H=(x=e.$store.state)==null?void 0:x.suno)==null?void 0:H.audio)==null?void 0:K.state)==="paused")?(r(),m("div",{key:1,class:"overlay",onClick:t[2]||(t[2]=se=>e.onPlay(e.audio))},[a($,null,{default:f(()=>[a(A)]),_:1})])):y("v-if",!0),(W=e.audio)!=null&&W.duration?(r(),m("div",io,v(e.useFormatDuring((Y=e.audio)==null?void 0:Y.duration)),1)):y("v-if",!0)])),[[I,!((J=e.audio)!=null&&J.audio_url)||!((b=e.audio)!=null&&b.video_url)]]),l("div",ao,[l("h2",lo,v((X=e.audio)==null?void 0:X.title),1),l("p",ro,v(($e=e.audio)==null?void 0:$e.style),1)])])])])}var uo=C(Xt,[["render",co],["__scopeId","data-v-040b76e5"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/ExtendFromInput.vue"]]);const po=P({name:"CoverFromInput",components:{ElImage:ue,ElIcon:de,VideoPlay:he,VideoPause:fe},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",g(_({},(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,s;e<0?this.value=0:e>((t=this.audio)==null?void 0:t.duration)?this.value=(s=this.audio)==null?void 0:s.duration:this.value=e},useFormatDuring:ee,onPlay(e){this.$store.dispatch("suno/setAudio",g(_(_({},this.$store.state.suno.audio),e),{state:"playing"})),console.log("on play")},onPause(e){this.$store.dispatch("suno/setAudio",g(_(_({},this.$store.state.suno.audio),e),{state:"paused"})),console.log("on pause")},onClick(e){var t,s,n;((n=(s=(t=this.$store.state)==null?void 0:t.suno)==null?void 0:s.audio)==null?void 0:n.id)!==e.id&&this.onPlay(g(_({},e),{progress:0}))}}}),_o={class:"field"},mo={class:"box"},ho={class:"title font-bold"},fo={class:"task"},vo={class:"left"},$o={key:2,class:"duration"},go={class:"info"},yo={class:"title"},ko={class:"style"};function wo(e,t,s,n,c,d){var I,N,S,T,E,U,o,G,L,F,D,V,R,q,z,O,B,x,H,K,W,Y,J,b;const i=u("el-image"),p=u("video-pause"),h=u("el-icon"),$=u("video-play"),A=ve("loading");return r(),m("div",_o,[l("div",mo,[l("h2",ho,v(e.$t("suno.name.cover")),1)]),l("div",fo,[e.audio?(r(),m("div",{key:0,class:"audio",onClick:t[2]||(t[2]=X=>e.onClick(e.audio))},[pe((r(),m("div",vo,[a(i,{src:(I=e.audio)==null?void 0:I.image_url,class:"cover",fit:"cover"},null,8,["src"]),((N=e.audio)==null?void 0:N.audio_url)&&((E=(T=(S=e.$store.state)==null?void 0:S.suno)==null?void 0:T.audio)==null?void 0:E.id)===e.audio.id&&((G=(o=(U=e.$store.state)==null?void 0:U.suno)==null?void 0:o.audio)==null?void 0:G.state)==="playing"?(r(),m("div",{key:0,class:"overlay",onClick:t[0]||(t[0]=X=>e.onPause(e.audio))},[a(h,null,{default:f(()=>[a(p)]),_:1})])):y("v-if",!0),((L=e.audio)==null?void 0:L.audio_url)&&(((V=(D=(F=e.$store.state)==null?void 0:F.suno)==null?void 0:D.audio)==null?void 0:V.id)!==e.audio.id||((z=(q=(R=e.$store.state)==null?void 0:R.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(),m("div",{key:1,class:"overlay",onClick:t[1]||(t[1]=X=>e.onPlay(e.audio))},[a(h,null,{default:f(()=>[a($)]),_:1})])):y("v-if",!0),(H=e.audio)!=null&&H.duration?(r(),m("div",$o,v(e.useFormatDuring((K=e.audio)==null?void 0:K.duration)),1)):y("v-if",!0)])),[[A,!((W=e.audio)!=null&&W.audio_url)||!((Y=e.audio)!=null&&Y.video_url)]]),l("div",go,[l("h2",yo,v((J=e.audio)==null?void 0:J.title),1),l("p",ko,v((b=e.audio)==null?void 0:b.style),1)])])):y("v-if",!0)])])}var bo=C(po,[["render",wo],["__scopeId","data-v-68ea6e7a"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/CoverFromInput.vue"]]);const Co=P({name:"PresetPanel",components:{TypeSelector:mt,PromptInput:Et,LyricInput:jt,StyleInput:Bt,TitleInput:Qt,ExtendFromInput:uo,CoverFromInput:bo,UploadAudio:kt,FontAwesomeIcon:le,ElButton:re},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.suno)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),Po={class:"panel"},Ao={class:"config"},So={class:"actions"};function Io(e,t,s,n,c,d){var U,o,G,L,F,D,V;const i=u("type-selector"),p=u("upload-audio"),h=u("prompt-input"),$=u("lyric-input"),A=u("style-input"),I=u("title-input"),N=u("extend-from-input"),S=u("cover-from-input"),T=u("font-awesome-icon"),E=u("el-button");return r(),m("div",Po,[l("div",Ao,[a(i,{class:"mb-4"}),a(p,{class:"mb-4"}),(U=e.config)!=null&&U.custom?y("v-if",!0):(r(),k(h,{key:0,class:"mb-4"})),((o=e.config)==null?void 0:o.custom)&&!e.config.instrumental?(r(),k($,{key:1,class:"mb-4"})):y("v-if",!0),(G=e.config)!=null&&G.custom?(r(),k(A,{key:2,class:"mb-4"})):y("v-if",!0),(L=e.config)!=null&&L.custom?(r(),k(I,{key:3,class:"mb-4"})):y("v-if",!0),((F=e.config)==null?void 0:F.action)==="extend"?(r(),k(N,{key:4,class:"mb-4"})):y("v-if",!0),((D=e.config)==null?void 0:D.action)==="cover"?(r(),k(S,{key:5,class:"mb-4"})):y("v-if",!0),l("div",So,[((V=e.config)==null?void 0:V.action)!=="extend"?(r(),k(E,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:f(()=>[a(T,{icon:"fa-solid fa-magic",class:"mr-2"}),M(" "+v(e.$t("suno.button.generate")),1)]),_:1},8,["onClick"])):(r(),k(E,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:f(()=>[a(T,{icon:"fa-solid fa-magic",class:"mr-2"}),M(" "+v(e.$t("suno.button.extend")),1)]),_:1},8,["onClick"]))])])])}var No=C(Co,[["render",Io],["__scopeId","data-v-38bb3c66"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/ConfigPanel.vue"]]);const To="https://webhook.acedata.cloud/suno",Eo=P({name:"TaskPreview",components:{ElImage:ue,ElIcon:de,ElTooltip:ze,ElButton:re,FontAwesomeIcon:le,VideoPlay:he,VideoPause:fe,ElDropdown:Oe,ElDropdownMenu:Be,ElDropdownItem:xe},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)===ie.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 s,n,c,d,i,p,h;let e=[];const t=(n=(s=this.modelValue)==null?void 0:s.request)==null?void 0:n.action;return Array.isArray((d=(c=this.modelValue)==null?void 0:c.response)==null?void 0:d.data)&&((h=(p=(i=this.modelValue)==null?void 0:i.response)==null?void 0:p.data)==null||h.forEach($=>{let A=$;t&&(A.action=t),e.push(A)})),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:ee,onPlay(e){this.$store.dispatch("suno/setAudio",g(_(_({},this.$store.state.suno.audio),e),{state:"playing"})),console.log("on play")},onPause(e){this.$store.dispatch("suno/setAudio",g(_(_({},this.$store.state.suno.audio),e),{state:"paused"})),console.log("on pause")},onClick(e){var t,s,n;((n=(s=(t=this.$store.state)==null?void 0:t.suno)==null?void 0:s.audio)==null?void 0:n.id)!==e.id&&this.onPlay(g(_({},e),{progress:0}))},onExtend(e,t){var s;e.stopPropagation(),console.log("on extend"),console.debug("set config",t),this.$store.commit("suno/setConfig",g(_({},(s=this.$store.state.suno)==null?void 0:s.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 n=new URL(t).pathname,c=n.substring(n.lastIndexOf("/")+1);console.log("on preview",c),fetch(t).then(d=>d.blob()).then(d=>{Ee.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 s;e.stopPropagation(),console.log("on cover"),console.debug("set config",t),this.$store.commit("suno/setConfig",g(_({},(s=this.$store.state.suno)==null?void 0:s.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 s={action:e,audio_id:t,callback_url:To},n=(c=this.credential)==null?void 0:c.token;if(!n){console.error("no token specified");return}j.info(this.$t("suno.message.startingTask")),me.audio(s,{token:n}).then(()=>{j.success(this.$t("suno.message.startTaskSuccess"))}).catch(d=>{var i,p,h;j.error(((h=(p=(i=d==null?void 0:d.response)==null?void 0:i.data)==null?void 0:p.error)==null?void 0:h.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})}}}),Vo={class:"task"},Uo=["onClick"],Lo={class:"left"},Fo=["onClick"],Do=["onClick"],Go={key:2,class:"duration"},jo={class:"info"},Ro={class:"title"},Mo={class:"style"},qo={class:"right"},zo={class:"el-dropdown-link"},Oo={class:"el-dropdown-link"};function Bo(e,t,s,n,c,d){const i=u("el-image"),p=u("video-pause"),h=u("el-icon"),$=u("video-play"),A=u("el-button"),I=u("font-awesome-icon"),N=u("el-tooltip"),S=u("el-dropdown-item"),T=u("el-dropdown-menu"),E=u("el-dropdown"),U=ve("loading");return r(),m("div",Vo,[(r(!0),m(Z,null,ae(e.audios,(o,G)=>{var L,F,D,V,R,q,z,O,B,x,H,K,W,Y,J;return r(),m("div",{key:G,class:"audio",onClick:b=>e.onClick(o)},[pe((r(),m("div",Lo,[a(i,{src:o==null?void 0:o.image_url,class:"cover",fit:"cover"},null,8,["src"]),(o==null?void 0:o.audio_url)&&((D=(F=(L=e.$store.state)==null?void 0:L.suno)==null?void 0:F.audio)==null?void 0:D.id)===o.id&&((q=(R=(V=e.$store.state)==null?void 0:V.suno)==null?void 0:R.audio)==null?void 0:q.state)==="playing"?(r(),m("div",{key:0,class:"overlay",onClick:b=>e.onPause(o)},[a(h,null,{default:f(()=>[a(p)]),_:1})],8,Fo)):y("v-if",!0),(o==null?void 0:o.audio_url)&&(((B=(O=(z=e.$store.state)==null?void 0:z.suno)==null?void 0:O.audio)==null?void 0:B.id)!==o.id||((K=(H=(x=e.$store.state)==null?void 0:x.suno)==null?void 0:H.audio)==null?void 0:K.id)===o.id&&((J=(Y=(W=e.$store.state)==null?void 0:W.suno)==null?void 0:Y.audio)==null?void 0:J.state)==="paused")?(r(),m("div",{key:1,class:"overlay",onClick:b=>e.onPlay(o)},[a(h,null,{default:f(()=>[a($)]),_:1})],8,Do)):y("v-if",!0),o!=null&&o.duration?(r(),m("div",Go,v(e.useFormatDuring(o==null?void 0:o.duration)),1)):y("v-if",!0)])),[[U,!(o!=null&&o.audio_url)||!(o!=null&&o.video_url)]]),l("div",jo,[l("h2",Ro,v(o==null?void 0:o.title),1),l("p",Mo,v(o==null?void 0:o.style),1)]),l("div",qo,[(o==null?void 0:o.audio_url)&&(o==null?void 0:o.video_url)?(r(),k(A,{key:0,size:"small",round:"",onClick:b=>e.onExtend(b,o)},{default:f(()=>[M(v(e.$t("suno.button.extend")),1)]),_:2},1032,["onClick"])):y("v-if",!0),a(N,{effect:"dark",content:e.$t("suno.button.video"),placement:"top"},{default:f(()=>[o!=null&&o.video_url?(r(),k(I,{key:0,icon:"fa-solid fa-clapperboard",class:"icon icon-preview",onClick:b=>e.onPreview(b,o==null?void 0:o.video_url)},null,8,["onClick"])):y("v-if",!0)]),_:2},1032,["content"]),a(E,null,{dropdown:f(()=>[a(T,null,{default:f(()=>[o!=null&&o.video_url?(r(),k(S,{key:0,onClick:b=>e.onDownload(b,o==null?void 0:o.video_url)},{default:f(()=>[M(v(e.$t("suno.button.download_video")),1)]),_:2},1032,["onClick"])):y("v-if",!0),o!=null&&o.audio_url?(r(),k(S,{key:1,onClick:b=>e.onDownload(b,o==null?void 0:o.audio_url)},{default:f(()=>[M(v(e.$t("suno.button.download_audio")),1)]),_:2},1032,["onClick"])):y("v-if",!0)]),_:2},1024)]),default:f(()=>[l("span",zo,[a(N,{effect:"dark",content:e.$t("suno.button.download"),placement:"top"},{default:f(()=>[(o==null?void 0:o.audio_url)||(o==null?void 0:o.video_url)?(r(),k(I,{key:0,icon:"fa-solid fa-download",class:"icon icon-download"})):y("v-if",!0)]),_:2},1032,["content"])])]),_:2},1024),a(E,null,{dropdown:f(()=>[a(T,null,{default:f(()=>[o!=null&&o.video_url?(r(),k(S,{key:0,onClick:b=>e.onGetStems(b,o==null?void 0:o.id)},{default:f(()=>[M(v(e.$t("suno.button.get_stems")),1)]),_:2},1032,["onClick"])):y("v-if",!0),(o==null?void 0:o.action)==="extend"?(r(),k(S,{key:1,onClick:b=>e.onCover(b,o)},{default:f(()=>[M(v(e.$t("suno.button.cover_music")),1)]),_:2},1032,["onClick"])):y("v-if",!0),(o==null?void 0:o.action)==="extend"?(r(),k(S,{key:2,onClick:b=>e.onConcatMusic(b,o==null?void 0:o.id)},{default:f(()=>[M(v(e.$t("suno.button.concat_music")),1)]),_:2},1032,["onClick"])):y("v-if",!0)]),_:2},1024)]),default:f(()=>[l("span",Oo,[a(N,{effect:"dark",content:e.$t("suno.button.more"),placement:"top"},{default:f(()=>[(o==null?void 0:o.audio_url)||(o==null?void 0:o.video_url)?(r(),k(I,{key:0,icon:"fa-solid fa-ellipsis",class:"icon icon-ellipsis"})):y("v-if",!0)]),_:2},1032,["content"])])]),_:2},1024)])],8,Uo)}),128))])}var xo=C(Eo,[["render",Bo],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/task/Preview.vue"]]);const Ho={class:"player-slider"},Ko=P({setup(e){const t=te(),s=Q({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",g(_({},t.state.suno.audio),{progress:i}))}),n=Q({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",g(_({},t.state.suno.audio),{duration:i}))}),c=()=>{},d=i=>t.dispatch("suno/setAudio",g(_({},t.state.suno.audio),{progress:i}));return(i,p)=>(r(),m("div",Ho,[a(w(Ce),{modelValue:w(s),"onUpdate:modelValue":p[0]||(p[0]=h=>Pe(s)?s.value=h:null),"show-tooltip":!1,min:0,max:w(n),onChange:d,onInput:c},null,8,["modelValue","max"])]))}});var Wo=C(Ko,[["__file","/home/runner/work/Nexior/Nexior/src/components/suno/player/PlayerSlider.vue"]]),Yo="/assets/disk.4907c891.png";const Jo={class:"flex player-song"},Qo=["src"],Xo={class:"ml-2 text-xs flex flex-col justify-between"},Zo={class:"w-52 2xl:w-96 cursor-pointer truncate"},es={class:"flex"},ts={class:"ml-2 text-dc"},os=P({setup(e){const t=te(),s=Q({get:()=>t.state.suno.audio,set:n=>t.commit("suno/setAudio",n)});return Xe(s,(n,c)=>{if((n==null?void 0:n.audio_url)!==(c==null?void 0:c.audio_url)){console.log("audio changed",n),n.object&&(console.log("111",n.object),n.object.pause(),delete n.object);const d=new Audio(n.audio_url);n.state==="playing"?d.play():d.pause(),d.addEventListener("loadedmetadata",()=>{d.currentTime=0,d.addEventListener("timeupdate",()=>{t.commit("suno/setAudio",g(_({},t.state.suno.audio),{progress:d.currentTime}))})}),t.commit("suno/setAudio",g(_({},t.state.suno.audio),{object:d}))}else if((n==null?void 0:n.progress)!==(c==null?void 0:c.progress)&&Math.abs(n.progress-n.object.currentTime)>2){console.log("progress changed",n.progress);const d=t.state.suno.audio;d.object&&(d.object.currentTime=d.progress)}else(n==null?void 0:n.state)!==(c==null?void 0:c.state)&&(console.log("state changed",n.state),n.object&&(n.state==="playing"?n.object.play():n.object.pause()));(n==null?void 0:n.volume)!==(c==null?void 0:c.volume)&&(console.log("volume changed",n.volume),n.object&&(n.object.volume=n.volume/100))}),(n,c)=>{var d,i,p;return r(),m("div",Jo,[l("img",{alt:"",class:"w-11 h-11 rounded",src:((d=w(s))==null?void 0:d.image_url)||w(Yo)},null,8,Qo),l("div",Xo,[l("div",Zo,[l("div",es,[l("span",null,v(((i=w(s))==null?void 0:i.title)||"Music"),1),l("span",ts,"- "+v(((p=w(s))==null?void 0:p.style)||"SmallRuralDog"),1)])])])])}}});var ss=C(os,[["__file","/home/runner/work/Nexior/Nexior/src/components/suno/player/PlayerSong.vue"]]);const ns={class:"flex justify-end items-center gap-x-2.5"},is={class:"text-xs"},as=P({setup(e){const t=te(),s=Q({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",g(_({},t.state.suno.audio),{progress:c}))}),n=Q({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",g(_({},t.state.suno.audio),{duration:c}))});return(c,d)=>(r(),m("div",ns,[l("span",is,v(w(ee)(w(s)))+" / "+v(w(ee)(w(n))),1)]))}});var ls=C(as,[["__file","/home/runner/work/Nexior/Nexior/src/components/suno/player/PlayerAction.vue"]]);const rs=P({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,s)=>(r(),k(Ze(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 _e=C(rs,[["__file","/home/runner/work/Nexior/Nexior/src/components/common/IconPark.vue"]]);const cs={class:"player-volume flex flex-col items-center pt-2"},us={class:"text-sm mt-3"},ds={class:"mt-2"},ps=P({setup(e){const t=te(),s=Q({get:()=>{var i;return(i=t.state.suno.audio)==null?void 0:i.volume},set:i=>t.commit("suno/setAudio",g(_({},t.state.suno.audio),{volume:i}))}),n=Q({get:()=>{var i;return(i=t.state.suno.audio)==null?void 0:i.muted},set:i=>t.commit("suno/setAudio",g(_({},t.state.suno.audio),{muted:i}))}),c=()=>t.dispatch("suno/toggleMuted"),d=i=>t.dispatch("suno/setVolume",i);return(i,p)=>(r(),m("div",cs,[l("div",null,[a(w(Ce),{modelValue:w(s),"onUpdate:modelValue":p[0]||(p[0]=h=>Pe(s)?s.value=h:null),vertical:"",height:"100px","show-tooltip":!1,max:100,min:0,size:"small",disabled:w(n),onInput:d},null,8,["modelValue","disabled"])]),l("div",us,v(w(s)),1),l("div",ds,[a(_e,{icon:w(n)?w(Ve):w(we),size:"16",theme:"filled",class:"hover-text",onClick:c},null,8,["icon"])])]))}});var _s=C(ps,[["__file","/home/runner/work/Nexior/Nexior/src/components/suno/player/PlayerVolumeSlider.vue"]]);const ms={class:"flex items-center justify-center gap-x-3"},hs=P({setup(e){const t=te(),s=()=>t.dispatch("suno/setAudio",g(_({},t.state.suno.audio),{state:t.state.suno.audio.state==="playing"?"paused":"playing"})),n=Q(()=>t.state.suno.audio);return(c,d)=>{var i;return r(),m("div",ms,[a(_e,{icon:((i=w(n))==null?void 0:i.state)==="playing"?w(Ue):w(Le),size:"45",theme:"filled",class:"control",onClick:s},null,8,["icon"]),a(w(He),{placement:"top",width:"50px"},{reference:f(()=>[a(_e,{icon:w(we),size:"20","stroke-width":3,class:"hover-text"},null,8,["icon"])]),default:f(()=>[a(_s)]),_:1})])}}});var fs=C(hs,[["__file","/home/runner/work/Nexior/Nexior/src/components/suno/player/PlayerController.vue"]]);const vs={class:"flex flex-col items-stretch h-20"},$s={class:"flex grow px-5 items-center"},gs={class:"flex-1"},ys={class:"flex-1"},ks={class:"flex-1"},ws=P({setup(e){return(t,s)=>(r(),m("div",vs,[a(Wo),l("div",$s,[l("div",gs,[a(ss)]),l("div",ys,[a(fs)]),l("div",ks,[a(ls)])])]))}});var bs=C(ws,[["__file","/home/runner/work/Nexior/Nexior/src/components/suno/player/Player.vue"]]);const Cs=P({name:"RecentPanel",components:{TaskPreview:xo,ElSkeleton:Ke,ElSkeletonItem:We,Player:bs},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){var e,t,s,n;return g(_({},(e=this.$store.state.suno)==null?void 0:e.tasks),{items:(n=(s=(t=this.$store.state.suno)==null?void 0:t.tasks)==null?void 0:s.items)==null?void 0:n.slice()})}},methods:{onHandleScroll(){const e=this.$refs.panel;console.log("reach-top reach-top reach-top"),e.scrollTop===0&&this.$emit("reach-top")}}}),Ps={key:0,class:"tasks"},As={class:"left"},Ss={class:"main"},Is={key:1,class:"tasks"},Ns={key:2,class:"description"},Ts={class:"flex-1 flex flex-col"},Es={class:"h-20"};function Vs(e,t,s,n,c,d){var A,I,N,S,T,E,U,o,G,L,F,D;const i=u("el-skeleton-item"),p=u("el-skeleton"),h=u("task-preview"),$=u("player");return r(),m(Z,null,[l("div",{ref:"panel",class:"panel recent",onScroll:t[0]||(t[0]=(...V)=>e.onHandleScroll&&e.onHandleScroll(...V))},[((A=e.tasks)==null?void 0:A.items)===void 0?(r(),m("div",Ps,[(r(),m(Z,null,ae(3,V=>l("div",{key:V,class:"task placeholder"},[l("div",As,[a(p,{animated:""},{template:f(()=>[a(i,{variant:"image",class:"avatar"})]),_:1})]),l("div",Ss,[a(p,{animated:""},{template:f(()=>[a(i,{variant:"p",class:"title"}),a(i,{variant:"text",style:{"margin-right":"16px"}}),a(i,{variant:"text",style:{width:"80%"}})]),_:1})])])),64))])):((N=(I=e.tasks)==null?void 0:I.items)==null?void 0:N.length)&&((T=(S=e.tasks)==null?void 0:S.items)==null?void 0:T.length)>0?(r(),m("div",Is,[(r(!0),m(Z,null,ae((E=e.tasks)==null?void 0:E.items,(V,R)=>(r(),k(h,{key:R,"model-value":V,class:"preview"},null,8,["model-value"]))),128))])):y("v-if",!0),((o=(U=e.tasks)==null?void 0:U.items)==null?void 0:o.length)===0?(r(),m("p",Ns,v(e.$t("suno.message.noTasks")),1)):y("v-if",!0)],544),pe(l("div",Ts,[l("div",Es,[a($)])],512),[[et,!!((D=(F=(L=(G=e.$store)==null?void 0:G.state)==null?void 0:L.suno)==null?void 0:F.audio)!=null&&D.object)]])],64)}var Us=C(Cs,[["render",Vs],["__scopeId","data-v-9a683526"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/RecentPanel.vue"]]);const Ls=P({name:"TaskPreview",components:{ElScrollbar:Ye,IconPicture:Je,ElImage:ue,ElAvatar:Qe,ElIcon:de},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}}}),Fs={key:0,class:"card"},Ds={class:"image-container"},Gs={class:"image-slot"},js={class:"title"},Rs={class:"content"},Ms={class:"artist"},qs={class:"style"},zs={class:"time"},Os={class:"lyrics"},Bs={key:1,class:"gradient-background"};function xs(e,t,s,n,c,d){const i=u("icon-picture"),p=u("el-icon"),h=u("el-image"),$=u("el-avatar"),A=u("el-scrollbar");return r(),k(A,{class:"right-panel"},{default:f(()=>{var I,N,S,T,E,U,o;return[(I=e.audio)!=null&&I.object?(r(),m("div",Fs,[l("div",Ds,[a(h,{src:e.audio.image_url,fit:"cover"},{error:f(()=>[l("div",Gs,[a(p,null,{default:f(()=>[a(i)]),_:1})])]),_:1},8,["src"]),l("h2",js,v((N=e.audio)==null?void 0:N.title),1)]),l("div",Rs,[l("div",Ms,[a($,{size:30,src:(S=e.audio)==null?void 0:S.image_url},null,8,["src"]),l("span",null,v((T=e.audio)==null?void 0:T.prompt),1)]),l("p",qs,v((E=e.audio)==null?void 0:E.style),1),l("p",zs,v(e.$dayjs.format((U=e.audio)==null?void 0:U.created_at)),1),l("div",Os,[l("p",null,v((o=e.audio)==null?void 0:o.lyric),1)])])])):(r(),m("div",Bs))]}),_:1})}var Hs=C(Ls,[["render",xs],["__scopeId","data-v-19e67a48"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/PreviewPanel.vue"]]);const Ks="https://webhook.acedata.cloud/suno",Ws=P({name:"SunoIndex",components:{Layout:ct,ApplicationStatus:tt,ConfigPanel:No,RecentPanel:Us,PreviewPanel:Hs},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)===ie.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===ie.Request},needApply(){return this.$store.state.suno.status.getApplications===ie.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 s,n;((s=e==null?void 0:e.items)==null?void 0:s.length)>((n=t==null?void 0:t.items)==null?void 0:n.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("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(){De.create({application:this.application}).then(({data:e})=>{this.application=e,j.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)===ot&&j.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:s,createdAtMax:n}=e||{};console.debug("limit",t,"createdAtMin",s,"createdAtMax",n),await this.$store.dispatch("suno/getTasks",{limit:t,createdAtMin:s,createdAtMax:n})},async onGenerateAudio(){var s;const e=g(_({},this.config),{callback_url:Ks}),t=(s=this.credential)==null?void 0:s.token;if(!t){console.error("no token specified");return}j.info(this.$t("suno.message.startingTask")),me.audio(e,{token:t}).then(()=>{j.success(this.$t("suno.message.startTaskSuccess"))}).catch(n=>{var c,d,i;j.error(((i=(d=(c=n==null?void 0:n.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 Ys(e,t,s,n,c,d){const i=u("config-panel"),p=u("application-status"),h=u("recent-panel"),$=u("preview-panel"),A=u("layout");return r(),k(A,null,{config:f(()=>[a(i,{onGenerate:e.onGenerateAudio},null,8,["onGenerate"])]),result:f(()=>[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]=I=>e.$store.dispatch("suno/setApplication",I))},null,8,["initializing","application","applications","service","need-apply","onRefresh"]),a(h,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"])]),preview:f(()=>[a($)]),_:1})}var ln=C(Ws,[["render",Ys],["__scopeId","data-v-11d62c6c"],["__file","/home/runner/work/Nexior/Nexior/src/pages/suno/Index.vue"]]);export{ln as default};
@@ -1 +1 @@
1
- var ce=Object.defineProperty,de=Object.defineProperties;var pe=Object.getOwnPropertyDescriptors;var ie=Object.getOwnPropertySymbols;var me=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable;var le=(e,s,t)=>s in e?ce(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,w=(e,s)=>{for(var t in s||(s={}))me.call(s,t)&&le(e,t,s[t]);if(ie)for(var t of ie(s))ue.call(s,t)&&le(e,t,s[t]);return e},I=(e,s)=>de(e,pe(s));import"./vendor-others.179d4404.js";import{aq as z}from"./vendor-fortawesome.3e228e5c.js";import{_ as S,M as he,P as O,F as _e,aJ as ge}from"./index.54863a79.js";import{P as fe,l as B,O as ve,M as C,L as $e,K as ye,W as be,X as ke,s as re,F as we,C as Ie,R as Se}from"./vendor-element-plus.f90d6803.js";import{H as T,al as r,o as n,e as c,f as d,I as j,V as a,M as u,U as l,T as v,W as A,ai as G,L as M,S as $,Q as D,m as Te}from"./vendor-@vue.fc29b169.js";import{I as Ve}from"./InfoIcon.0d72ff26.js";import{A as Ce,i as Pe,h as Ee}from"./Status.3ed09234.js";import{C as Ae}from"./CopyToClipboard.70ad0a47.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.8db51d62.js";const Ge=T({name:"LayoutHeadshots",components:{ElDrawer:fe,ElButton:B,FontAwesomeIcon:z},data(){return{drawer:!1}}}),Ue={class:"main"},Ne={class:"config"},Re={class:"result"};function De(e,s,t,o,_,g){const p=r("font-awesome-icon"),h=r("el-button"),i=r("el-drawer");return n(),c("div",Ue,[d("div",Ne,[j(e.$slots,"config",{},void 0,!0)]),d("div",Re,[j(e.$slots,"result",{},void 0,!0)]),a(h,{round:"",class:"menu",onClick:s[0]||(s[0]=m=>e.drawer=!0)},{default:u(()=>[a(p,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),a(i,{modelValue:e.drawer,"onUpdate:modelValue":s[1]||(s[1]=m=>e.drawer=m),"with-header":!1,size:"340px",class:"drawer"},{default:u(()=>[j(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var Le=S(Ge,[["render",De],["__scopeId","data-v-3e896eaa"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Headshots.vue"]]);const Me=T({name:"ImageUrlsInput",components:{ElUpload:ve,ElButton:B,InfoIcon:Ve},data(){return{fileList:[],uploadUrl:he()+"/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 t;const s=this.urls;this.$store.commit("headshots/setConfig",I(w({},(t=this.$store.state.headshots)==null?void 0:t.config),{image_urls:s}))}}},mounted(){this.value||(this.value=void 0),this.onSetImageUrls()},methods:{onExceed(){C.warning(this.$t("headshots.message.uploadImageExceed"))},onError(){C.error(this.$t("headshots.message.uploadImageError"))},onSetImageUrls(){var s;const e=this.urls;this.$store.commit("headshots/setConfig",I(w({},(s=this.$store.state.headshots)==null?void 0:s.config),{image_urls:e}))},async onSuccess(){this.onSetImageUrls()}}}),Oe={class:"field"},je={class:"title font-bold"},ze={class:"upload-wrapper"};function Be(e,s,t,o,_,g){const p=r("el-button"),h=r("el-upload"),i=r("info-icon");return n(),c("div",Oe,[d("h2",je,l(e.$t("headshots.name.endImageUrls")),1),d("div",ze,[a(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(()=>[a(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"])]),a(i,{content:e.$t("headshots.description.endImageUrls"),class:"info"},null,8,["content"])])}var qe=S(Me,[["render",Be],["__scopeId","data-v-69ae8722"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/config/ImageUrlsInput.vue"]]);const He="fast",Fe=T({name:"ModeSelector",components:{ElRadioButton:$e,ElRadioGroup:ye},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",I(w({},this.$store.state.headshots.config),{mode:e}))}}},mounted(){this.value||(this.value=He)}}),We={class:"field"},Je={class:"title font-bold"};function Ke(e,s,t,o,_,g){const p=r("el-radio-button"),h=r("el-radio-group");return n(),c("div",We,[d("h2",Je,l(e.$t("headshots.name.mode")),1),a(h,{modelValue:e.value,"onUpdate:modelValue":s[0]||(s[0]=i=>e.value=i),size:"small",class:"mode"},{default:u(()=>[(n(!0),c(A,null,G(e.options,i=>(n(),M(p,{key:i.value,label:i.value},{default:u(()=>[v(l(i.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])])}var Qe=S(Fe,[["render",Ke],["__scopeId","data-v-5ec8e3d9"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/config/ModeSelector.vue"]]);const Xe=T({name:"StylizeSelector",components:{ElTabs:be,ElTabPane:ke,ElImage:re},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",I(w({},(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",I(w({},(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",I(w({},(s=this.$store.state.headshots)==null?void 0:s.config),{template:this.value}))}}}),Ye={class:"field"},Ze=["onClick"],xe={class:"name"};function es(e,s,t,o,_,g){const p=r("el-image"),h=r("el-tab-pane"),i=r("el-tabs");return n(),c("div",Ye,[$(` <h2 class="title">{{ $t('headshots.field.elements') }}</h2> `),a(i,{modelValue:e.tab,"onUpdate:modelValue":s[0]||(s[0]=m=>e.tab=m)},{default:u(()=>[(n(!0),c(A,null,G(e.elements,(m,f)=>(n(),M(h,{key:f,label:m.displayName,name:f,class:"pane"},{default:u(()=>[(n(!0),c(A,null,G(m.items,(k,P)=>(n(),c("div",{key:P,class:D({item:!0,active:e.value===k.value}),onClick:E=>e.onToggle(k.value)},[a(p,{src:k.image,fit:"fill",class:"preview"},null,8,["src"]),d("span",xe,l(k.label),1)],10,Ze))),128))]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])])}var ss=S(Xe,[["render",es],["__scopeId","data-v-7e0125ad"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/config/ElementsSelector.vue"]]);const ts=T({name:"PresetPanel",components:{ModeSelector:Qe,ImageUrlsInput:qe,ElButton:B,FontAwesomeIcon:z,ElementsSelector:ss},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.headshots)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),as={class:"panel"},os={class:"config"},ns={class:"actions"};function is(e,s,t,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",as,[d("div",os,[a(p,{class:"mb-4"}),a(h,{class:"mb-4"}),a(i,{class:"mb-4"}),d("div",ns,[a(f,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:u(()=>[a(m,{icon:"fa-solid fa-magic",class:"mr-2"}),v(" "+l(e.$t("headshots.button.generate")),1)]),_:1},8,["onClick"])])])])}var ls=S(ts,[["render",is],["__scopeId","data-v-6a264fac"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/ConfigPanel.vue"]]);const rs=T({name:"ImageGallery",props:{modelValue:{type:Object,required:!0}},setup(e){return{images:Te(()=>{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")}}}}),cs={class:"image-gallery"},ds=["src"],ps=["onClick"];function ms(e,s,t,o,_,g){return n(),c("div",cs,[(n(!0),c(A,null,G(e.images,(p,h)=>(n(),c("div",{key:h,class:"image-container"},[d("img",{src:p.image_url,alt:"Image"},null,8,ds),d("button",{class:"view-button",onClick:i=>e.viewImage(p.image_url)},l(e.$t("headshots.button.viewImage")),9,ps)]))),128))])}var us=S(rs,[["render",ms],["__scopeId","data-v-0187109d"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/ImageGallery.vue"]]);const hs=T({name:"TaskPreview",components:{ElImage:re,CopyToClipboard:Ae,FontAwesomeIcon:z,ElAlert:we,ImageGallery:us},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,t=new URL(s.src),o=t.searchParams.get("retry");if(!o)t.searchParams.set("retry","1");else if(parseInt(o)<2)t.searchParams.set("retry",(parseInt(o)+1).toString());else return;s.src=t.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),_s={class:"preview"},gs={class:"left"},fs={class:"main"},vs={class:"bot"},$s={class:"datetime"},ys={class:"info"},bs={key:0,class:"prompt mt-2"},ks={key:0},ws={key:1},Is={key:0,class:D({content:!0,failed:!0})},Ss={class:"image-wrapper"},Ts={class:"description"},Vs={key:1,class:D({content:!0})},Cs={class:"description"},Ps={class:"description"},Es={class:"description"},As={key:2,class:D({content:!0})},Gs={class:"description"},Us={key:3,class:D({content:!0})},Ns={class:"description"};function Rs(e,s,t,o,_,g){var k,P,E,U,N,R,V,L,q,H,F,W,J,K,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",_s,[d("div",gs,[a(p,{src:"https://cdn.acedata.cloud/isxyfw.png",class:"avatar"})]),d("div",fs,[d("div",vs,[v(l(e.$t("headshots.name.headshotsBot"))+" ",1),d("span",$s,l(e.$dayjs.format(""+new Date(parseFloat(((k=e.modelValue)==null?void 0:k.created_at)||"")*1e3))),1)]),d("div",ys,[(E=(P=e.modelValue)==null?void 0:P.request)!=null&&E.template?(n(),c("p",bs,[v(l((N=(U=e.modelValue)==null?void 0:U.request)==null?void 0:N.template)+" ",1),(R=e.modelValue)!=null&&R.response?$("v-if",!0):(n(),c("span",ks," - ("+l(e.$t("headshots.status.pending"))+") ",1)),((L=(V=e.modelValue)==null?void 0:V.response)==null?void 0:L.status)==="unknown"?(n(),c("span",ws," - ("+l(e.$t("headshots.status.processing"))+") ",1)):$("v-if",!0)])):$("v-if",!0)]),$(" Display success message "),((H=(q=e.modelValue)==null?void 0:q.response)==null?void 0:H.success)===!0?(n(),c("div",Is,[d("div",Ss,[a(h,{"model-value":e.modelValue},null,8,["model-value"])]),a(f,{closable:!1,class:"mt-2 success"},{default:u(()=>{var y,b;return[d("p",Ts,[a(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),a(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):$("v-if",!0),$(" Display error message "),((W=(F=e.modelValue)==null?void 0:F.response)==null?void 0:W.success)===!1?(n(),c("div",Vs,[a(f,{closable:!1,class:"failure"},{template:u(()=>[a(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),v(" "+l(e.$t("headshots.name.failure")),1)]),default:u(()=>{var y,b,X,Y,Z,x,ee,se,te,ae,oe,ne;return[d("p",Cs,[a(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),a(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])]),d("p",Ps,[a(i,{icon:"fa-solid fa-circle-info",class:"mr-1"}),v(" "+l(e.$t("headshots.name.failureReason"))+": "+l((Z=(Y=(X=e.modelValue)==null?void 0:X.response)==null?void 0:Y.error)==null?void 0:Z.message)+" ",1),a(m,{content:(se=(ee=(x=e.modelValue)==null?void 0:x.response)==null?void 0:ee.error)==null?void 0:se.message,class:"btn-copy"},null,8,["content"])]),d("p",Es,[a(i,{icon:"fa-solid fa-hashtag",class:"mr-1"}),v(" "+l(e.$t("headshots.name.traceId"))+": "+l((ae=(te=e.modelValue)==null?void 0:te.response)==null?void 0:ae.trace_id)+" ",1),a(m,{content:(ne=(oe=e.modelValue)==null?void 0:oe.response)==null?void 0:ne.trace_id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):$("v-if",!0),$(" Display error message "),(J=e.modelValue)!=null&&J.response?$("v-if",!0):(n(),c("div",As,[a(f,{closable:!1,class:"info"},{template:u(()=>[a(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",Gs,[a(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),a(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])),((Q=(K=e.modelValue)==null?void 0:K.response)==null?void 0:Q.status)==="unknown"?(n(),c("div",Us,[a(f,{closable:!1,class:"info"},{template:u(()=>[a(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",Ns,[a(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),a(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):$("v-if",!0)])])}var Ds=S(hs,[["render",Rs],["__scopeId","data-v-43e1feb8"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/task/Preview.vue"]]);const Ls=T({name:"RecentPanel",components:{TaskPreview:Ds,ElSkeleton:Ie,ElSkeletonItem:Se},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){var e,s,t,o;return I(w({},(e=this.$store.state.headshots)==null?void 0:e.tasks),{items:(o=(t=(s=this.$store.state.headshots)==null?void 0:s.tasks)==null?void 0:t.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")}}}),Ms={key:0,class:"tasks"},Os={class:"left"},js={class:"main"},zs={key:1,class:"tasks"},Bs={key:2,class:"description"};function qs(e,s,t,o,_,g){var m,f,k,P,E,U,N,R;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]=(...V)=>e.onHandleScroll&&e.onHandleScroll(...V))},[((m=e.tasks)==null?void 0:m.items)===void 0?(n(),c("div",Ms,[(n(),c(A,null,G(3,V=>d("div",{key:V,class:"task placeholder"},[d("div",Os,[a(h,{animated:""},{template:u(()=>[a(p,{variant:"image",class:"avatar"})]),_:1})]),d("div",js,[a(h,{animated:""},{template:u(()=>[a(p,{variant:"p",class:"title"}),a(p,{variant:"image",class:"icon"})]),_:1})])])),64))])):((k=(f=e.tasks)==null?void 0:f.items)==null?void 0:k.length)&&((E=(P=e.tasks)==null?void 0:P.items)==null?void 0:E.length)>0?(n(),c("div",zs,[(n(!0),c(A,null,G((U=e.tasks)==null?void 0:U.items,(V,L)=>(n(),M(i,{key:L,"model-value":V,class:"preview"},null,8,["model-value"]))),128))])):$("v-if",!0),((R=(N=e.tasks)==null?void 0:N.items)==null?void 0:R.length)===0?(n(),c("p",Bs,l(e.$t("headshots.message.noTasks")),1)):$("v-if",!0)],544)}var Hs=S(Ls,[["render",qs],["__scopeId","data-v-37920e9a"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/RecentPanel.vue"]]);const Fs="https://webhook.acedata.cloud/headshots",Ws=T({name:"HeadshotsIndex",components:{ConfigPanel:ls,Layout:Le,ApplicationStatus:Ce,RecentPanel:Hs},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)===O.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===O.Request},needApply(){return this.$store.state.headshots.status.getApplications===O.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 t,o;((t=e==null?void 0:e.items)==null?void 0:t.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,t;console.debug("reached top"),await this.onGetTasks({createdAtMax:(t=(s=(e=this.tasks)==null?void 0:e.items)==null?void 0:s[0])==null?void 0:t.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(){_e.create({application:this.application}).then(({data:e})=>{this.application=e,C.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{var s,t;((t=(s=e==null?void 0:e.response)==null?void 0:s.data)==null?void 0:t.code)===Pe&&C.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:t,createdAtMax:o}=e||{};console.debug("limit",s,"createdAtMin",t,"createdAtMax",o),await this.$store.dispatch("headshots/getTasks",{limit:s,createdAtMin:t,createdAtMax:o})},async onGeneratePicture(){var t;const e=I(w({},this.config),{callback_url:Fs}),s=(t=this.credential)==null?void 0:t.token;if(!s){console.error("no token specified");return}C.info(this.$t("headshots.message.startingTask")),ge.generate(e,{token:s}).then(()=>{C.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)===Ee?C.error(this.$t("headshots.message.usedUp")):C.error(this.$t("headshots.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function Js(e,s,t,o,_,g){const p=r("config-panel"),h=r("application-status"),i=r("recent-panel"),m=r("layout");return n(),M(m,null,{config:u(()=>[a(p,{onGenerate:e.onGeneratePicture},null,8,["onGenerate"])]),result:u(()=>[a(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"]),a(i,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"]),$(' <operation-panel class="panel operation" @generate="onGenerate" /> ')]),_:1})}var nt=S(Ws,[["render",Js],["__scopeId","data-v-62da1b28"],["__file","/home/runner/work/Nexior/Nexior/src/pages/headshots/Index.vue"]]);export{nt as default};
1
+ var ce=Object.defineProperty,de=Object.defineProperties;var pe=Object.getOwnPropertyDescriptors;var ie=Object.getOwnPropertySymbols;var me=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable;var le=(e,s,t)=>s in e?ce(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,w=(e,s)=>{for(var t in s||(s={}))me.call(s,t)&&le(e,t,s[t]);if(ie)for(var t of ie(s))ue.call(s,t)&&le(e,t,s[t]);return e},I=(e,s)=>de(e,pe(s));import"./vendor-others.179d4404.js";import{aq as z}from"./vendor-fortawesome.3e228e5c.js";import{_ as S,M as he,P as O,F as _e,aJ as ge}from"./index.ca771f54.js";import{P as fe,l as B,O as ve,M as C,L as $e,K as ye,W as be,X as ke,s as re,F as we,C as Ie,R as Se}from"./vendor-element-plus.f90d6803.js";import{H as T,al as r,o as n,e as c,f as d,I as j,V as a,M as u,U as l,T as v,W as A,ai as G,L as M,S as $,Q as D,m as Te}from"./vendor-@vue.fc29b169.js";import{I as Ve}from"./InfoIcon.a96e69b0.js";import{A as Ce,i as Pe,h as Ee}from"./Status.2748135c.js";import{C as Ae}from"./CopyToClipboard.698d5771.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.8db51d62.js";const Ge=T({name:"LayoutHeadshots",components:{ElDrawer:fe,ElButton:B,FontAwesomeIcon:z},data(){return{drawer:!1}}}),Ue={class:"main"},Ne={class:"config"},Re={class:"result"};function De(e,s,t,o,_,g){const p=r("font-awesome-icon"),h=r("el-button"),i=r("el-drawer");return n(),c("div",Ue,[d("div",Ne,[j(e.$slots,"config",{},void 0,!0)]),d("div",Re,[j(e.$slots,"result",{},void 0,!0)]),a(h,{round:"",class:"menu",onClick:s[0]||(s[0]=m=>e.drawer=!0)},{default:u(()=>[a(p,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),a(i,{modelValue:e.drawer,"onUpdate:modelValue":s[1]||(s[1]=m=>e.drawer=m),"with-header":!1,size:"340px",class:"drawer"},{default:u(()=>[j(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var Le=S(Ge,[["render",De],["__scopeId","data-v-3e896eaa"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Headshots.vue"]]);const Me=T({name:"ImageUrlsInput",components:{ElUpload:ve,ElButton:B,InfoIcon:Ve},data(){return{fileList:[],uploadUrl:he()+"/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 t;const s=this.urls;this.$store.commit("headshots/setConfig",I(w({},(t=this.$store.state.headshots)==null?void 0:t.config),{image_urls:s}))}}},mounted(){this.value||(this.value=void 0),this.onSetImageUrls()},methods:{onExceed(){C.warning(this.$t("headshots.message.uploadImageExceed"))},onError(){C.error(this.$t("headshots.message.uploadImageError"))},onSetImageUrls(){var s;const e=this.urls;this.$store.commit("headshots/setConfig",I(w({},(s=this.$store.state.headshots)==null?void 0:s.config),{image_urls:e}))},async onSuccess(){this.onSetImageUrls()}}}),Oe={class:"field"},je={class:"title font-bold"},ze={class:"upload-wrapper"};function Be(e,s,t,o,_,g){const p=r("el-button"),h=r("el-upload"),i=r("info-icon");return n(),c("div",Oe,[d("h2",je,l(e.$t("headshots.name.endImageUrls")),1),d("div",ze,[a(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(()=>[a(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"])]),a(i,{content:e.$t("headshots.description.endImageUrls"),class:"info"},null,8,["content"])])}var qe=S(Me,[["render",Be],["__scopeId","data-v-69ae8722"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/config/ImageUrlsInput.vue"]]);const He="fast",Fe=T({name:"ModeSelector",components:{ElRadioButton:$e,ElRadioGroup:ye},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",I(w({},this.$store.state.headshots.config),{mode:e}))}}},mounted(){this.value||(this.value=He)}}),We={class:"field"},Je={class:"title font-bold"};function Ke(e,s,t,o,_,g){const p=r("el-radio-button"),h=r("el-radio-group");return n(),c("div",We,[d("h2",Je,l(e.$t("headshots.name.mode")),1),a(h,{modelValue:e.value,"onUpdate:modelValue":s[0]||(s[0]=i=>e.value=i),size:"small",class:"mode"},{default:u(()=>[(n(!0),c(A,null,G(e.options,i=>(n(),M(p,{key:i.value,label:i.value},{default:u(()=>[v(l(i.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])])}var Qe=S(Fe,[["render",Ke],["__scopeId","data-v-5ec8e3d9"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/config/ModeSelector.vue"]]);const Xe=T({name:"StylizeSelector",components:{ElTabs:be,ElTabPane:ke,ElImage:re},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",I(w({},(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",I(w({},(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",I(w({},(s=this.$store.state.headshots)==null?void 0:s.config),{template:this.value}))}}}),Ye={class:"field"},Ze=["onClick"],xe={class:"name"};function es(e,s,t,o,_,g){const p=r("el-image"),h=r("el-tab-pane"),i=r("el-tabs");return n(),c("div",Ye,[$(` <h2 class="title">{{ $t('headshots.field.elements') }}</h2> `),a(i,{modelValue:e.tab,"onUpdate:modelValue":s[0]||(s[0]=m=>e.tab=m)},{default:u(()=>[(n(!0),c(A,null,G(e.elements,(m,f)=>(n(),M(h,{key:f,label:m.displayName,name:f,class:"pane"},{default:u(()=>[(n(!0),c(A,null,G(m.items,(k,P)=>(n(),c("div",{key:P,class:D({item:!0,active:e.value===k.value}),onClick:E=>e.onToggle(k.value)},[a(p,{src:k.image,fit:"fill",class:"preview"},null,8,["src"]),d("span",xe,l(k.label),1)],10,Ze))),128))]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])])}var ss=S(Xe,[["render",es],["__scopeId","data-v-7e0125ad"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/config/ElementsSelector.vue"]]);const ts=T({name:"PresetPanel",components:{ModeSelector:Qe,ImageUrlsInput:qe,ElButton:B,FontAwesomeIcon:z,ElementsSelector:ss},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.headshots)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),as={class:"panel"},os={class:"config"},ns={class:"actions"};function is(e,s,t,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",as,[d("div",os,[a(p,{class:"mb-4"}),a(h,{class:"mb-4"}),a(i,{class:"mb-4"}),d("div",ns,[a(f,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:u(()=>[a(m,{icon:"fa-solid fa-magic",class:"mr-2"}),v(" "+l(e.$t("headshots.button.generate")),1)]),_:1},8,["onClick"])])])])}var ls=S(ts,[["render",is],["__scopeId","data-v-6a264fac"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/ConfigPanel.vue"]]);const rs=T({name:"ImageGallery",props:{modelValue:{type:Object,required:!0}},setup(e){return{images:Te(()=>{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")}}}}),cs={class:"image-gallery"},ds=["src"],ps=["onClick"];function ms(e,s,t,o,_,g){return n(),c("div",cs,[(n(!0),c(A,null,G(e.images,(p,h)=>(n(),c("div",{key:h,class:"image-container"},[d("img",{src:p.image_url,alt:"Image"},null,8,ds),d("button",{class:"view-button",onClick:i=>e.viewImage(p.image_url)},l(e.$t("headshots.button.viewImage")),9,ps)]))),128))])}var us=S(rs,[["render",ms],["__scopeId","data-v-0187109d"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/ImageGallery.vue"]]);const hs=T({name:"TaskPreview",components:{ElImage:re,CopyToClipboard:Ae,FontAwesomeIcon:z,ElAlert:we,ImageGallery:us},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,t=new URL(s.src),o=t.searchParams.get("retry");if(!o)t.searchParams.set("retry","1");else if(parseInt(o)<2)t.searchParams.set("retry",(parseInt(o)+1).toString());else return;s.src=t.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),_s={class:"preview"},gs={class:"left"},fs={class:"main"},vs={class:"bot"},$s={class:"datetime"},ys={class:"info"},bs={key:0,class:"prompt mt-2"},ks={key:0},ws={key:1},Is={key:0,class:D({content:!0,failed:!0})},Ss={class:"image-wrapper"},Ts={class:"description"},Vs={key:1,class:D({content:!0})},Cs={class:"description"},Ps={class:"description"},Es={class:"description"},As={key:2,class:D({content:!0})},Gs={class:"description"},Us={key:3,class:D({content:!0})},Ns={class:"description"};function Rs(e,s,t,o,_,g){var k,P,E,U,N,R,V,L,q,H,F,W,J,K,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",_s,[d("div",gs,[a(p,{src:"https://cdn.acedata.cloud/isxyfw.png",class:"avatar"})]),d("div",fs,[d("div",vs,[v(l(e.$t("headshots.name.headshotsBot"))+" ",1),d("span",$s,l(e.$dayjs.format(""+new Date(parseFloat(((k=e.modelValue)==null?void 0:k.created_at)||"")*1e3))),1)]),d("div",ys,[(E=(P=e.modelValue)==null?void 0:P.request)!=null&&E.template?(n(),c("p",bs,[v(l((N=(U=e.modelValue)==null?void 0:U.request)==null?void 0:N.template)+" ",1),(R=e.modelValue)!=null&&R.response?$("v-if",!0):(n(),c("span",ks," - ("+l(e.$t("headshots.status.pending"))+") ",1)),((L=(V=e.modelValue)==null?void 0:V.response)==null?void 0:L.status)==="unknown"?(n(),c("span",ws," - ("+l(e.$t("headshots.status.processing"))+") ",1)):$("v-if",!0)])):$("v-if",!0)]),$(" Display success message "),((H=(q=e.modelValue)==null?void 0:q.response)==null?void 0:H.success)===!0?(n(),c("div",Is,[d("div",Ss,[a(h,{"model-value":e.modelValue},null,8,["model-value"])]),a(f,{closable:!1,class:"mt-2 success"},{default:u(()=>{var y,b;return[d("p",Ts,[a(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),a(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):$("v-if",!0),$(" Display error message "),((W=(F=e.modelValue)==null?void 0:F.response)==null?void 0:W.success)===!1?(n(),c("div",Vs,[a(f,{closable:!1,class:"failure"},{template:u(()=>[a(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),v(" "+l(e.$t("headshots.name.failure")),1)]),default:u(()=>{var y,b,X,Y,Z,x,ee,se,te,ae,oe,ne;return[d("p",Cs,[a(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),a(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])]),d("p",Ps,[a(i,{icon:"fa-solid fa-circle-info",class:"mr-1"}),v(" "+l(e.$t("headshots.name.failureReason"))+": "+l((Z=(Y=(X=e.modelValue)==null?void 0:X.response)==null?void 0:Y.error)==null?void 0:Z.message)+" ",1),a(m,{content:(se=(ee=(x=e.modelValue)==null?void 0:x.response)==null?void 0:ee.error)==null?void 0:se.message,class:"btn-copy"},null,8,["content"])]),d("p",Es,[a(i,{icon:"fa-solid fa-hashtag",class:"mr-1"}),v(" "+l(e.$t("headshots.name.traceId"))+": "+l((ae=(te=e.modelValue)==null?void 0:te.response)==null?void 0:ae.trace_id)+" ",1),a(m,{content:(ne=(oe=e.modelValue)==null?void 0:oe.response)==null?void 0:ne.trace_id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):$("v-if",!0),$(" Display error message "),(J=e.modelValue)!=null&&J.response?$("v-if",!0):(n(),c("div",As,[a(f,{closable:!1,class:"info"},{template:u(()=>[a(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",Gs,[a(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),a(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])),((Q=(K=e.modelValue)==null?void 0:K.response)==null?void 0:Q.status)==="unknown"?(n(),c("div",Us,[a(f,{closable:!1,class:"info"},{template:u(()=>[a(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",Ns,[a(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),a(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):$("v-if",!0)])])}var Ds=S(hs,[["render",Rs],["__scopeId","data-v-43e1feb8"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/task/Preview.vue"]]);const Ls=T({name:"RecentPanel",components:{TaskPreview:Ds,ElSkeleton:Ie,ElSkeletonItem:Se},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){var e,s,t,o;return I(w({},(e=this.$store.state.headshots)==null?void 0:e.tasks),{items:(o=(t=(s=this.$store.state.headshots)==null?void 0:s.tasks)==null?void 0:t.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")}}}),Ms={key:0,class:"tasks"},Os={class:"left"},js={class:"main"},zs={key:1,class:"tasks"},Bs={key:2,class:"description"};function qs(e,s,t,o,_,g){var m,f,k,P,E,U,N,R;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]=(...V)=>e.onHandleScroll&&e.onHandleScroll(...V))},[((m=e.tasks)==null?void 0:m.items)===void 0?(n(),c("div",Ms,[(n(),c(A,null,G(3,V=>d("div",{key:V,class:"task placeholder"},[d("div",Os,[a(h,{animated:""},{template:u(()=>[a(p,{variant:"image",class:"avatar"})]),_:1})]),d("div",js,[a(h,{animated:""},{template:u(()=>[a(p,{variant:"p",class:"title"}),a(p,{variant:"image",class:"icon"})]),_:1})])])),64))])):((k=(f=e.tasks)==null?void 0:f.items)==null?void 0:k.length)&&((E=(P=e.tasks)==null?void 0:P.items)==null?void 0:E.length)>0?(n(),c("div",zs,[(n(!0),c(A,null,G((U=e.tasks)==null?void 0:U.items,(V,L)=>(n(),M(i,{key:L,"model-value":V,class:"preview"},null,8,["model-value"]))),128))])):$("v-if",!0),((R=(N=e.tasks)==null?void 0:N.items)==null?void 0:R.length)===0?(n(),c("p",Bs,l(e.$t("headshots.message.noTasks")),1)):$("v-if",!0)],544)}var Hs=S(Ls,[["render",qs],["__scopeId","data-v-37920e9a"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/RecentPanel.vue"]]);const Fs="https://webhook.acedata.cloud/headshots",Ws=T({name:"HeadshotsIndex",components:{ConfigPanel:ls,Layout:Le,ApplicationStatus:Ce,RecentPanel:Hs},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)===O.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===O.Request},needApply(){return this.$store.state.headshots.status.getApplications===O.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 t,o;((t=e==null?void 0:e.items)==null?void 0:t.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,t;console.debug("reached top"),await this.onGetTasks({createdAtMax:(t=(s=(e=this.tasks)==null?void 0:e.items)==null?void 0:s[0])==null?void 0:t.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(){_e.create({application:this.application}).then(({data:e})=>{this.application=e,C.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{var s,t;((t=(s=e==null?void 0:e.response)==null?void 0:s.data)==null?void 0:t.code)===Pe&&C.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:t,createdAtMax:o}=e||{};console.debug("limit",s,"createdAtMin",t,"createdAtMax",o),await this.$store.dispatch("headshots/getTasks",{limit:s,createdAtMin:t,createdAtMax:o})},async onGeneratePicture(){var t;const e=I(w({},this.config),{callback_url:Fs}),s=(t=this.credential)==null?void 0:t.token;if(!s){console.error("no token specified");return}C.info(this.$t("headshots.message.startingTask")),ge.generate(e,{token:s}).then(()=>{C.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)===Ee?C.error(this.$t("headshots.message.usedUp")):C.error(this.$t("headshots.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function Js(e,s,t,o,_,g){const p=r("config-panel"),h=r("application-status"),i=r("recent-panel"),m=r("layout");return n(),M(m,null,{config:u(()=>[a(p,{onGenerate:e.onGeneratePicture},null,8,["onGenerate"])]),result:u(()=>[a(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"]),a(i,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"]),$(' <operation-panel class="panel operation" @generate="onGenerate" /> ')]),_:1})}var nt=S(Ws,[["render",Js],["__scopeId","data-v-62da1b28"],["__file","/home/runner/work/Nexior/Nexior/src/pages/headshots/Index.vue"]]);export{nt as default};
@@ -1 +1 @@
1
- var ce=Object.defineProperty,ue=Object.defineProperties;var me=Object.getOwnPropertyDescriptors;var P=Object.getOwnPropertySymbols;var pe=Object.prototype.hasOwnProperty,_e=Object.prototype.propertyIsEnumerable;var q=(e,o,r)=>o in e?ce(e,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[o]=r,K=(e,o)=>{for(var r in o||(o={}))pe.call(o,r)&&q(e,r,o[r]);if(P)for(var r of P(o))_e.call(o,r)&&q(e,r,o[r]);return e},Z=(e,o)=>ue(e,me(o));import{x as I,F as ee}from"./vendor-others.179d4404.js";import{g as oe,_ as w,S as he,s as fe,i as ve,R as ke,a as ge,b as we,c as j}from"./index.54863a79.js";import{h as Le,C as xe,a as W}from"./vendor-vue-dark-switch.c8d2e590.js";import{H as b,al as a,o as s,L as d,e as E,V as t,M as n,W as Ae,ai as Ee,T as g,U as _,aK as be,aL as Ce,f as h,av as ye,O as p,S as k}from"./vendor-@vue.fc29b169.js";import{d as te,e as ne,f as Ie,h as ae,i as re,j as Oe,k as Ve,l as Se,m as Ue,n as se,o as Te,p as Ne,q as $e}from"./vendor-element-plus.f90d6803.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.8db51d62.js";import"./vendor-fortawesome.3e228e5c.js";var Re="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAMAAAAKE/YAAAAAMFBMVEX///+3t7f4+Pi8vLzAwMDExMTS0tLIyMjk5OTz8/PY2NjOzs7u7u7d3d3p6enh4eFVKkJDAAAIfUlEQVR4nNVd15akOAylyRRQ9f9/O02BZJtgBQszfR/2zPahsJCvguVUFJYop35ux66pq6r6+fn9T910bTv3U2najBXK9zw2PxE07fz+n0Qf+raOyetL3g9PS7vgzRUYULfvZyXuR5nAgLF/SuK3UuJN7gf0PbyErDiieuU1zKmLyFJ3Y9u+vmh//V9dXT/b5VN3f+HbFq82nGivHH6999Vv8rC7P+NFzfBlF56xvl/sEy1Xbc8mZ9m3R7bcrO0jl+vXJH7J0YY78UvYKNuDjpWNTQd9tzd5ks9ePUm92u877WMlp4dhR+Y2OYkYdh3XmKclc9iATVwoXyFLZouXIobuBpEXlK+QcYbK7gOF2NpMaN2Vmfdr71LGirAbW5N3lr4F1rckC0GQbQw6cqrM1XACvzOr5EjT+2q+L24Vk6/sRGL7no6t5un9eQE+7JG4r+wk3+e9iGfXwzyeZHLjzDGFt0fEBB564ymOeRwzCg8dHaZ9kx8NZGZ8+UyOv0bSW3o9q5Tac5+0luajjGfqpsT2krIuTeaKZGQf4UUIKpx6xFbo2nGD9HSlpJZAGfSQILVjV02Z4CQsJhD2UdbcJ/dwyRfpNvozwaLo4q/0nMhLIrMThJSZZ4EhiJd6Ugti43SvzCTlPKnZmUNZMV+u4cYKwp85XlfcTBi/s6Z+MZ2LxADhGZzUDU9m5zjIr0woQhLxasAHWS7E9TgZU/Z1EBEIjbzxQYYxOudOxu73qTBcUGEaIzqD1hi96W6JTgzRoDSI/UhmITP7yUPFSYqaagD1R4wJkP8VnT8nTwVQqnauN06QjvtCvYt2IL3Zm/Uk9jjDz0RmMLggwx3SOuIUSniGpJv3bAJo1SAFr9mKH8aI+LqkI0RFtoIh9/L76Cc8GLCDoxxSjyAHgxxFYSEzJ18Ggly4YHQHnCQ2LRoCGINXQirim0JYUJpDatf/p24PP4mVwSblSg6MEhDGuzNVg6J5o8nEvAPAGZiAfk5MDRXNqxcmx/AVHPMprx8G1TEHwOzqTByseTgoDRxYDT6akSh9YSMzr6aLidOeTGCj3EqDkdC8GU9Q9c6voYlyJzxy0sOxOnRs8C3sQpSR92DOO4EDCXkAzoA935bPTy8AIgTBCIIyvyZsExF/uM2Byfk9A7VafuksfdyygFmJcc35NZ7tT5xUYMNwJYcI/FouGP7xOyT1YBOh+aVcsCHHBWCHZHLTxOfxF6ZA8HP82P7ASv4BJj5PMNMO/g3+H9ghqrtnGm4hIJLAd7byVxg5asGCA+AH2N2meYHvKPxZmQRIGtyMaOMweC/ZXJJJdJE0CF27Bm0oK8kWLKSWHxeILB8s7xN8gmxFi0VIFAkNqd5KiI3S7JBqJ7Ssycb70vAL2LAofMiE9hkBrQvX4OTXNLS4eGpwA8KlaxaGKHOy4OWWcSVoXSZz9ohYYLaxpB8bv4V2aFGeFiYOvqTb74V2mHkQ8IXjBKhMuKrMJIoLOQlmVGIiIlyPmXdguwJ6d8J/CZ1H0m4iB1Gr4D569HjCZalPaNoxeWtd5jKf4TRkpy30syh3KbLXPVZsWdIIQUK6dO8Jl+dkbUB6GfRranwIWx3hUzeVi5fRmggtDA6b/dWO3ELkLiF4QldqoXOPxhe8QOjt57LUpXhguGUhtEUFUtq9EBzUQluQWrphIV1oA1JLm0R6VFqh0z21eH30XmjFdofbF14dgC5PG1zS0w9pjuYFF2UYL9KHiXJGYhhXJkwLEk1RvrEMZVWmpgvSVC1XtEtNlYOAL1JYrdESOg3lcGtFQsVGs+Nu++msHdiu0BNEQQ5vYKssIWxQx3JNc1AqnbTFmg3qSoKmYz0mb//S7QDU1k5Vdu+VSnUFyA3aBES1ca9zkqb4PPVQUUVG74OVRfUNSqencXh+UR1sUnfqgy6+qLrVn75QThRt0I26VG0FU4dbRNfE1ULpqVVBIZBTN/kJ0PBDxY6QEbpp5v27JFCxI5xm1k3oIxT+Q+Wowgl93dIJhHzqVrW5erd0QrdIxUE8wFXxcL9IBXSlSRcLuSnq3NR+OZBq4ZWD1FXr8sn9wivVEjcPwtVuKtd6XOKmWUzoQeY/dCczHBcTKpZtnr2QB104gN70ukm+QNaHzBJV7DhbIAt/040ERMMXnbUDAwOtgvZVsUo0KaCi9Omib/SCqleKhE7KSsNIIt7IkFXoi40MSBrNO28X+ooHOKxWqPpuoVHRh7FDo3+pyHsorOZyG5R0w5kPUZmJffYFIrLhTLi1DzFJT0X+aWaZ3JGtfcJNlCvesTOuIpAcLBrdRIms5g4s+jFlM0PFPYY6ul1VtDG4PJzwqQHnGGpKKlA1fVKN0VqxX31Tx1DjOTBXaRFvs3vaWdkniPIEF3hdGgEmxpev0VpeHNf8ZuiROMBhet0hMch9qkogR2wXbeSojHI22jd5ifp1cLbY9dHB8NWhJCbOgkYzBxpFzxH3wu74F++ro8ckWsM7a5l7/IuzVnAxJX1MojGQ3shHslKCPPimY+b+jYfmU0qONPIOj5rzK9lDi33OyQttVpEaglXXMFoabQVmqny3QxaBW4opM3o4CtwDJazWGZtAUMi12ONkAtGMrNGS/1QI5yb+CxciLmc8EwoDKEokefK6CBKPRf47Mj/MEIujvv+MzA/6kKQLCR7y18q5Y8AjiWryrR1T9uwp/RqJ3YUdGWBxYUeR2RzN7gThn6ifCrtLaA7X/dwG4xtusvg+24uVihzKtr/Cqrh7OFPdcVlYcXItmyHS7x67ROwyxxTceAHegqsLHVOQ4WLH00sdE5DhUsev2IbaznR95gKrCnDGi0oXDOmTRrmvhP3i712+u+LvXXO84u9dKL2Cf3V33X7+i6u7N/y5S9IdvOvoF0G/19GP9tfR/wPQ21eEI8clLwAAAABJRU5ErkJggg==";const Fe=b({components:{DarkSwitch:Le},emits:["update:dark"],computed:{dark(){return I("THEME")==="dark"},switchValue(){return xe.value}},watch:{switchValue(e){console.log("switchValue",e),this.setCookie(e)},dark(e){document.documentElement.classList.toggle("dark",e),this.setCookie(this.dark)}},mounted(){console.log("dark selector mounted"),this.dark?(W(!0),document.documentElement.classList.add("dark")):(W(!1),document.documentElement.classList.remove("dark"))},methods:{setCookie(e){ee("THEME",e?"dark":"light",{path:"/",domain:oe()})}}});function He(e,o,r,L,f,x){const i=a("dark-switch");return s(),d(i,{class:"switch","dark-background":"#333","light-background":"#fff"})}var Be=w(Fe,[["render",He],["__file","/home/runner/work/Nexior/Nexior/src/components/common/DarkSelector2.vue"]]);const Ge=b({name:"LanguageSelector",components:{ElDropdown:te,ElDropdownItem:ne,ElDropdownMenu:Ie},data(){return{locales:he}},methods:{async onSelectLocale(e){this.$router.push({query:Z(K({},this.$route.query),{locale:void 0})}),await fe(e),this.setCookie(e),window.location.reload()},setCookie(e){ee("LOCALE",e,{path:"/",domain:oe()})}}}),Je=e=>(be("data-v-716b17bb"),e=e(),Ce(),e),ze=Je(()=>h("i",{class:"icon"},[h("svg",{preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},[h("path",{fill:"currentColor",d:"m18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301a14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"})])],-1));function Me(e,o,r,L,f,x){const i=a("el-dropdown-item"),c=a("el-dropdown-menu"),l=a("el-dropdown");return s(),E("div",null,[t(l,{"max-height":"700",trigger:"click",onCommand:e.onSelectLocale},{dropdown:n(()=>[t(c,null,{default:n(()=>[(s(!0),E(Ae,null,Ee(e.locales,(v,A)=>(s(),d(i,{key:A,command:v.value},{default:n(()=>[g(_(v.label),1)]),_:2},1032,["command"]))),128))]),_:1})]),default:n(()=>[ze]),_:1},8,["onCommand"])])}var De=w(Ge,[["render",Me],["__scopeId","data-v-716b17bb"],["__file","/home/runner/work/Nexior/Nexior/src/components/common/LanguageSelector.vue"]]);const Qe={emits:["click"],data(){return{url1:"https://cdn.acedata.cloud/logo.png/thumb_450x_",url2:"https://cdn.acedata.cloud/logo2.png/thumb_450x_",dark:I("THEME")==="dark",url:"",isOfficial:ve(),interval:void 0}},watch:{dark(){this.updateUrl()}},mounted(){this.interval=window.setInterval(this.checkCookie,500),this.updateUrl()},unmounted(){this.interval&&clearInterval(this.interval)},methods:{checkCookie(){this.dark=I("THEME")==="dark"},updateUrl(){var e;this.isOfficial?this.url=this.dark?this.url2:this.url1:this.url=((e=this.$store.state.site)==null?void 0:e.logo)||""}}},Ye=["src"];function Xe(e,o,r,L,f,x){return s(),E("img",{src:f.url,class:"logo",onClick:o[0]||(o[0]=i=>e.$emit("click"))},null,8,Ye)}var Pe=w(Qe,[["render",Xe],["__file","/home/runner/work/Nexior/Nexior/src/components/common/Logo.vue"]]);const qe=b({name:"TopHeader",components:{ElCol:ae,Logo:Pe,ElRow:re,DarkSelector:Be,ElDropdown:te,ElMenu:Oe,ElMenuItem:Ve,ElDropdownItem:ne,ElButton:Se,ElSubMenu:Ue,LanguageSelector:De},data(){return{defaultAvatar:Re}},computed:{site(){var e;return(e=this.$store.state)==null?void 0:e.site},dark(){var e;return(e=this.$store.getters)==null?void 0:e.dark},active(){var e,o;return(o=(e=this.$route.matched)==null?void 0:e[0])==null?void 0:o.path},user(){var e;return(e=this.$store.getters)==null?void 0:e.user},authenticated(){var e;return(e=this.$store.getters)==null?void 0:e.authenticated}},methods:{openTab(e){window.open(e,"_blank")},onSelect(e){e&&this.$router.push(e)},onHome(){this.$router.push({name:ke})},onLogin(){this.$router.push({name:ge})},onProfile(){const e=j();window.open(`${e}/user/profile`,"_blank")},onVerify(){const e=j();window.open(`${e}/user/verify`,"_blank")},onConsole(){this.$router.push({name:we})},async onLogout(){this.$store.dispatch("logout")}}}),Ke={key:0,class:"mt-4 pr-10"},Ze={key:1,class:"float-right"},je=["src"];function We(e,o,r,L,f,x){const i=a("logo"),c=a("el-col"),l=a("el-menu-item"),v=a("el-sub-menu"),A=a("el-menu"),y=a("el-button"),C=a("language-selector"),O=a("dark-selector"),V=a("el-dropdown-item"),le=a("el-dropdown-menu"),ie=a("el-dropdown"),de=a("el-row"),m=ye("t");return s(),d(de,{class:"header"},{default:n(()=>[t(c,{md:4,xs:24},{default:n(()=>[t(i,{onClick:e.onHome},null,8,["onClick"])]),_:1}),t(c,{md:16,xs:13},{default:n(()=>[t(A,{"default-active":e.active,mode:"horizontal",class:"menu",ellipsis:!0,onSelect:e.onSelect},{default:n(()=>[t(v,{index:1},{title:n(()=>[g(_(e.$t("common.nav.products")),1)]),default:n(()=>{var u,S,U,T,N,$,R,F,H,B,G,J,z,M,D,Q,Y,X;return[(U=(S=(u=e.site)==null?void 0:u.features)==null?void 0:S.chat)!=null&&U.enabled?p((s(),d(l,{key:0,index:"/chat"},null,512)),[[m,"index.title.chat"]]):k("v-if",!0),($=(N=(T=e.site)==null?void 0:T.features)==null?void 0:N.midjourney)!=null&&$.enabled?p((s(),d(l,{key:1,index:"/midjourney"},null,512)),[[m,"index.title.midjourney"]]):k("v-if",!0),(H=(F=(R=e.site)==null?void 0:R.features)==null?void 0:F.qrart)!=null&&H.enabled?p((s(),d(l,{key:2,index:"/qrart"},null,512)),[[m,"index.title.qrart"]]):k("v-if",!0),(J=(G=(B=e.site)==null?void 0:B.features)==null?void 0:G.suno)!=null&&J.enabled?p((s(),d(l,{key:3,index:"/suno"},null,512)),[[m,"index.title.suno"]]):k("v-if",!0),(D=(M=(z=e.site)==null?void 0:z.features)==null?void 0:M.luma)!=null&&D.enabled?p((s(),d(l,{key:4,index:"/luma"},null,512)),[[m,"index.title.luma"]]):k("v-if",!0),(X=(Y=(Q=e.site)==null?void 0:Q.features)==null?void 0:Y.headshots)!=null&&X.enabled?p((s(),d(l,{key:5,index:"/headshots"},null,512)),[[m,"index.title.headshots"]]):k("v-if",!0)]}),_:1}),p(t(l,{onRoute:void 0,onClick:o[0]||(o[0]=u=>e.openTab("https://platform.acedata.cloud"))},null,512),[[m,"common.nav.apiPlatform"]]),p(t(l,{onRoute:void 0,onClick:o[1]||(o[1]=u=>e.openTab("https://platform.acedata.cloud/support"))},null,512),[[m,"common.nav.support"]]),p(t(l,{onRoute:void 0,onClick:o[2]||(o[2]=u=>e.openTab("https://platform.acedata.cloud/earning"))},null,512),[[m,"common.nav.referral"]])]),_:1},8,["default-active","onSelect"])]),_:1}),t(c,{md:4,xs:11},{default:n(()=>[e.authenticated?(s(),E("div",Ze,[t(O),t(C,{class:"locale"}),h("div",{class:"console",onClick:o[3]||(o[3]=(...u)=>e.onConsole&&e.onConsole(...u))},_(e.$t("common.button.console")),1),t(ie,{trigger:"click"},{dropdown:n(()=>[t(le,null,{default:n(()=>[t(V,{onClick:e.onProfile},{default:n(()=>[g(_(e.$t("common.button.profile")),1)]),_:1},8,["onClick"]),t(V,{onClick:e.onLogout},{default:n(()=>[g(_(e.$t("common.button.logout")),1)]),_:1},8,["onClick"])]),_:1})]),default:n(()=>{var u;return[h("img",{src:((u=e.user)==null?void 0:u.avatar)||e.defaultAvatar,class:"avatar"},null,8,je)]}),_:1})])):(s(),E("div",Ke,[t(y,{type:"primary",class:"float-right",size:"small",round:"",onClick:e.onLogin},{default:n(()=>[g(_(e.$t("common.button.login")),1)]),_:1},8,["onClick"]),t(C,{class:"locale float-right mr-4"}),t(O,{class:"float-right mr-4"})]))]),_:1})]),_:1})}var eo=w(qe,[["render",We],["__file","/home/runner/work/Nexior/Nexior/src/components/common/TopHeader.vue"]]);const oo=b({name:"BottomFooter",components:{ElContainer:se,ElRow:re,ElCol:ae},data(){return{}},computed:{},methods:{}}),to={href:"https://platform.acedata.cloud"};function no(e,o,r,L,f,x){const i=a("el-col"),c=a("el-row"),l=a("el-container");return s(),d(l,{id:"footer",class:"footer"},{default:n(()=>[t(c,{class:"w-full"},{default:n(()=>[t(i,{class:"container",span:18,offset:3},{default:n(()=>[t(c,null,{default:n(()=>[t(i,{span:24,class:"text-center"},{default:n(()=>[h("p",null,[h("a",to,_(e.$t("common.entity.website")),1),g(" \xA9 "+_(new Date().getFullYear())+" "+_(e.$t("common.entity.copyright")),1)])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}var ao=w(oo,[["render",no],["__scopeId","data-v-5c0f0aec"],["__file","/home/runner/work/Nexior/Nexior/src/components/common/BottomFooter.vue"]]);const ro=b({name:"LayoutIndex",components:{TopHeader:eo,BottomFooter:ao,ElContainer:se,ElMain:Te,ElFooter:Ne,ElHeader:$e}});function so(e,o,r,L,f,x){const i=a("top-header"),c=a("el-header"),l=a("router-view"),v=a("el-main"),A=a("bottom-footer"),y=a("el-footer"),C=a("el-container");return s(),d(C,{class:"wrapper"},{default:n(()=>[t(c,{class:"header"},{default:n(()=>[t(i)]),_:1}),t(v,{class:"main"},{default:n(()=>[t(l)]),_:1}),t(y,{class:"footer"},{default:n(()=>[t(A)]),_:1})]),_:1})}var vo=w(ro,[["render",so],["__scopeId","data-v-3deb56ba"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Index.vue"]]);export{vo as default};
1
+ var ce=Object.defineProperty,ue=Object.defineProperties;var me=Object.getOwnPropertyDescriptors;var P=Object.getOwnPropertySymbols;var pe=Object.prototype.hasOwnProperty,_e=Object.prototype.propertyIsEnumerable;var q=(e,o,r)=>o in e?ce(e,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[o]=r,K=(e,o)=>{for(var r in o||(o={}))pe.call(o,r)&&q(e,r,o[r]);if(P)for(var r of P(o))_e.call(o,r)&&q(e,r,o[r]);return e},Z=(e,o)=>ue(e,me(o));import{x as I,F as ee}from"./vendor-others.179d4404.js";import{g as oe,_ as w,S as he,s as fe,i as ve,R as ke,a as ge,b as we,c as j}from"./index.ca771f54.js";import{h as Le,C as xe,a as W}from"./vendor-vue-dark-switch.c8d2e590.js";import{H as b,al as a,o as s,L as d,e as E,V as t,M as n,W as Ae,ai as Ee,T as g,U as _,aK as be,aL as Ce,f as h,av as ye,O as p,S as k}from"./vendor-@vue.fc29b169.js";import{d as te,e as ne,f as Ie,h as ae,i as re,j as Oe,k as Ve,l as Se,m as Ue,n as se,o as Te,p as Ne,q as $e}from"./vendor-element-plus.f90d6803.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.8db51d62.js";import"./vendor-fortawesome.3e228e5c.js";var Re="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAMAAAAKE/YAAAAAMFBMVEX///+3t7f4+Pi8vLzAwMDExMTS0tLIyMjk5OTz8/PY2NjOzs7u7u7d3d3p6enh4eFVKkJDAAAIfUlEQVR4nNVd15akOAylyRRQ9f9/O02BZJtgBQszfR/2zPahsJCvguVUFJYop35ux66pq6r6+fn9T910bTv3U2najBXK9zw2PxE07fz+n0Qf+raOyetL3g9PS7vgzRUYULfvZyXuR5nAgLF/SuK3UuJN7gf0PbyErDiieuU1zKmLyFJ3Y9u+vmh//V9dXT/b5VN3f+HbFq82nGivHH6999Vv8rC7P+NFzfBlF56xvl/sEy1Xbc8mZ9m3R7bcrO0jl+vXJH7J0YY78UvYKNuDjpWNTQd9tzd5ks9ePUm92u877WMlp4dhR+Y2OYkYdh3XmKclc9iATVwoXyFLZouXIobuBpEXlK+QcYbK7gOF2NpMaN2Vmfdr71LGirAbW5N3lr4F1rckC0GQbQw6cqrM1XACvzOr5EjT+2q+L24Vk6/sRGL7no6t5un9eQE+7JG4r+wk3+e9iGfXwzyeZHLjzDGFt0fEBB564ymOeRwzCg8dHaZ9kx8NZGZ8+UyOv0bSW3o9q5Tac5+0luajjGfqpsT2krIuTeaKZGQf4UUIKpx6xFbo2nGD9HSlpJZAGfSQILVjV02Z4CQsJhD2UdbcJ/dwyRfpNvozwaLo4q/0nMhLIrMThJSZZ4EhiJd6Ugti43SvzCTlPKnZmUNZMV+u4cYKwp85XlfcTBi/s6Z+MZ2LxADhGZzUDU9m5zjIr0woQhLxasAHWS7E9TgZU/Z1EBEIjbzxQYYxOudOxu73qTBcUGEaIzqD1hi96W6JTgzRoDSI/UhmITP7yUPFSYqaagD1R4wJkP8VnT8nTwVQqnauN06QjvtCvYt2IL3Zm/Uk9jjDz0RmMLggwx3SOuIUSniGpJv3bAJo1SAFr9mKH8aI+LqkI0RFtoIh9/L76Cc8GLCDoxxSjyAHgxxFYSEzJ18Ggly4YHQHnCQ2LRoCGINXQirim0JYUJpDatf/p24PP4mVwSblSg6MEhDGuzNVg6J5o8nEvAPAGZiAfk5MDRXNqxcmx/AVHPMprx8G1TEHwOzqTByseTgoDRxYDT6akSh9YSMzr6aLidOeTGCj3EqDkdC8GU9Q9c6voYlyJzxy0sOxOnRs8C3sQpSR92DOO4EDCXkAzoA935bPTy8AIgTBCIIyvyZsExF/uM2Byfk9A7VafuksfdyygFmJcc35NZ7tT5xUYMNwJYcI/FouGP7xOyT1YBOh+aVcsCHHBWCHZHLTxOfxF6ZA8HP82P7ASv4BJj5PMNMO/g3+H9ghqrtnGm4hIJLAd7byVxg5asGCA+AH2N2meYHvKPxZmQRIGtyMaOMweC/ZXJJJdJE0CF27Bm0oK8kWLKSWHxeILB8s7xN8gmxFi0VIFAkNqd5KiI3S7JBqJ7Ssycb70vAL2LAofMiE9hkBrQvX4OTXNLS4eGpwA8KlaxaGKHOy4OWWcSVoXSZz9ohYYLaxpB8bv4V2aFGeFiYOvqTb74V2mHkQ8IXjBKhMuKrMJIoLOQlmVGIiIlyPmXdguwJ6d8J/CZ1H0m4iB1Gr4D569HjCZalPaNoxeWtd5jKf4TRkpy30syh3KbLXPVZsWdIIQUK6dO8Jl+dkbUB6GfRranwIWx3hUzeVi5fRmggtDA6b/dWO3ELkLiF4QldqoXOPxhe8QOjt57LUpXhguGUhtEUFUtq9EBzUQluQWrphIV1oA1JLm0R6VFqh0z21eH30XmjFdofbF14dgC5PG1zS0w9pjuYFF2UYL9KHiXJGYhhXJkwLEk1RvrEMZVWmpgvSVC1XtEtNlYOAL1JYrdESOg3lcGtFQsVGs+Nu++msHdiu0BNEQQ5vYKssIWxQx3JNc1AqnbTFmg3qSoKmYz0mb//S7QDU1k5Vdu+VSnUFyA3aBES1ca9zkqb4PPVQUUVG74OVRfUNSqencXh+UR1sUnfqgy6+qLrVn75QThRt0I26VG0FU4dbRNfE1ULpqVVBIZBTN/kJ0PBDxY6QEbpp5v27JFCxI5xm1k3oIxT+Q+Wowgl93dIJhHzqVrW5erd0QrdIxUE8wFXxcL9IBXSlSRcLuSnq3NR+OZBq4ZWD1FXr8sn9wivVEjcPwtVuKtd6XOKmWUzoQeY/dCczHBcTKpZtnr2QB104gN70ukm+QNaHzBJV7DhbIAt/040ERMMXnbUDAwOtgvZVsUo0KaCi9Omib/SCqleKhE7KSsNIIt7IkFXoi40MSBrNO28X+ooHOKxWqPpuoVHRh7FDo3+pyHsorOZyG5R0w5kPUZmJffYFIrLhTLi1DzFJT0X+aWaZ3JGtfcJNlCvesTOuIpAcLBrdRIms5g4s+jFlM0PFPYY6ul1VtDG4PJzwqQHnGGpKKlA1fVKN0VqxX31Tx1DjOTBXaRFvs3vaWdkniPIEF3hdGgEmxpev0VpeHNf8ZuiROMBhet0hMch9qkogR2wXbeSojHI22jd5ifp1cLbY9dHB8NWhJCbOgkYzBxpFzxH3wu74F++ro8ckWsM7a5l7/IuzVnAxJX1MojGQ3shHslKCPPimY+b+jYfmU0qONPIOj5rzK9lDi33OyQttVpEaglXXMFoabQVmqny3QxaBW4opM3o4CtwDJazWGZtAUMi12ONkAtGMrNGS/1QI5yb+CxciLmc8EwoDKEokefK6CBKPRf47Mj/MEIujvv+MzA/6kKQLCR7y18q5Y8AjiWryrR1T9uwp/RqJ3YUdGWBxYUeR2RzN7gThn6ifCrtLaA7X/dwG4xtusvg+24uVihzKtr/Cqrh7OFPdcVlYcXItmyHS7x67ROwyxxTceAHegqsLHVOQ4WLH00sdE5DhUsev2IbaznR95gKrCnDGi0oXDOmTRrmvhP3i712+u+LvXXO84u9dKL2Cf3V33X7+i6u7N/y5S9IdvOvoF0G/19GP9tfR/wPQ21eEI8clLwAAAABJRU5ErkJggg==";const Fe=b({components:{DarkSwitch:Le},emits:["update:dark"],computed:{dark(){return I("THEME")==="dark"},switchValue(){return xe.value}},watch:{switchValue(e){console.log("switchValue",e),this.setCookie(e)},dark(e){document.documentElement.classList.toggle("dark",e),this.setCookie(this.dark)}},mounted(){console.log("dark selector mounted"),this.dark?(W(!0),document.documentElement.classList.add("dark")):(W(!1),document.documentElement.classList.remove("dark"))},methods:{setCookie(e){ee("THEME",e?"dark":"light",{path:"/",domain:oe()})}}});function He(e,o,r,L,f,x){const i=a("dark-switch");return s(),d(i,{class:"switch","dark-background":"#333","light-background":"#fff"})}var Be=w(Fe,[["render",He],["__file","/home/runner/work/Nexior/Nexior/src/components/common/DarkSelector2.vue"]]);const Ge=b({name:"LanguageSelector",components:{ElDropdown:te,ElDropdownItem:ne,ElDropdownMenu:Ie},data(){return{locales:he}},methods:{async onSelectLocale(e){this.$router.push({query:Z(K({},this.$route.query),{locale:void 0})}),await fe(e),this.setCookie(e),window.location.reload()},setCookie(e){ee("LOCALE",e,{path:"/",domain:oe()})}}}),Je=e=>(be("data-v-716b17bb"),e=e(),Ce(),e),ze=Je(()=>h("i",{class:"icon"},[h("svg",{preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},[h("path",{fill:"currentColor",d:"m18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301a14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"})])],-1));function Me(e,o,r,L,f,x){const i=a("el-dropdown-item"),c=a("el-dropdown-menu"),l=a("el-dropdown");return s(),E("div",null,[t(l,{"max-height":"700",trigger:"click",onCommand:e.onSelectLocale},{dropdown:n(()=>[t(c,null,{default:n(()=>[(s(!0),E(Ae,null,Ee(e.locales,(v,A)=>(s(),d(i,{key:A,command:v.value},{default:n(()=>[g(_(v.label),1)]),_:2},1032,["command"]))),128))]),_:1})]),default:n(()=>[ze]),_:1},8,["onCommand"])])}var De=w(Ge,[["render",Me],["__scopeId","data-v-716b17bb"],["__file","/home/runner/work/Nexior/Nexior/src/components/common/LanguageSelector.vue"]]);const Qe={emits:["click"],data(){return{url1:"https://cdn.acedata.cloud/logo.png/thumb_450x_",url2:"https://cdn.acedata.cloud/logo2.png/thumb_450x_",dark:I("THEME")==="dark",url:"",isOfficial:ve(),interval:void 0}},watch:{dark(){this.updateUrl()}},mounted(){this.interval=window.setInterval(this.checkCookie,500),this.updateUrl()},unmounted(){this.interval&&clearInterval(this.interval)},methods:{checkCookie(){this.dark=I("THEME")==="dark"},updateUrl(){var e;this.isOfficial?this.url=this.dark?this.url2:this.url1:this.url=((e=this.$store.state.site)==null?void 0:e.logo)||""}}},Ye=["src"];function Xe(e,o,r,L,f,x){return s(),E("img",{src:f.url,class:"logo",onClick:o[0]||(o[0]=i=>e.$emit("click"))},null,8,Ye)}var Pe=w(Qe,[["render",Xe],["__file","/home/runner/work/Nexior/Nexior/src/components/common/Logo.vue"]]);const qe=b({name:"TopHeader",components:{ElCol:ae,Logo:Pe,ElRow:re,DarkSelector:Be,ElDropdown:te,ElMenu:Oe,ElMenuItem:Ve,ElDropdownItem:ne,ElButton:Se,ElSubMenu:Ue,LanguageSelector:De},data(){return{defaultAvatar:Re}},computed:{site(){var e;return(e=this.$store.state)==null?void 0:e.site},dark(){var e;return(e=this.$store.getters)==null?void 0:e.dark},active(){var e,o;return(o=(e=this.$route.matched)==null?void 0:e[0])==null?void 0:o.path},user(){var e;return(e=this.$store.getters)==null?void 0:e.user},authenticated(){var e;return(e=this.$store.getters)==null?void 0:e.authenticated}},methods:{openTab(e){window.open(e,"_blank")},onSelect(e){e&&this.$router.push(e)},onHome(){this.$router.push({name:ke})},onLogin(){this.$router.push({name:ge})},onProfile(){const e=j();window.open(`${e}/user/profile`,"_blank")},onVerify(){const e=j();window.open(`${e}/user/verify`,"_blank")},onConsole(){this.$router.push({name:we})},async onLogout(){this.$store.dispatch("logout")}}}),Ke={key:0,class:"mt-4 pr-10"},Ze={key:1,class:"float-right"},je=["src"];function We(e,o,r,L,f,x){const i=a("logo"),c=a("el-col"),l=a("el-menu-item"),v=a("el-sub-menu"),A=a("el-menu"),y=a("el-button"),C=a("language-selector"),O=a("dark-selector"),V=a("el-dropdown-item"),le=a("el-dropdown-menu"),ie=a("el-dropdown"),de=a("el-row"),m=ye("t");return s(),d(de,{class:"header"},{default:n(()=>[t(c,{md:4,xs:24},{default:n(()=>[t(i,{onClick:e.onHome},null,8,["onClick"])]),_:1}),t(c,{md:16,xs:13},{default:n(()=>[t(A,{"default-active":e.active,mode:"horizontal",class:"menu",ellipsis:!0,onSelect:e.onSelect},{default:n(()=>[t(v,{index:1},{title:n(()=>[g(_(e.$t("common.nav.products")),1)]),default:n(()=>{var u,S,U,T,N,$,R,F,H,B,G,J,z,M,D,Q,Y,X;return[(U=(S=(u=e.site)==null?void 0:u.features)==null?void 0:S.chat)!=null&&U.enabled?p((s(),d(l,{key:0,index:"/chat"},null,512)),[[m,"index.title.chat"]]):k("v-if",!0),($=(N=(T=e.site)==null?void 0:T.features)==null?void 0:N.midjourney)!=null&&$.enabled?p((s(),d(l,{key:1,index:"/midjourney"},null,512)),[[m,"index.title.midjourney"]]):k("v-if",!0),(H=(F=(R=e.site)==null?void 0:R.features)==null?void 0:F.qrart)!=null&&H.enabled?p((s(),d(l,{key:2,index:"/qrart"},null,512)),[[m,"index.title.qrart"]]):k("v-if",!0),(J=(G=(B=e.site)==null?void 0:B.features)==null?void 0:G.suno)!=null&&J.enabled?p((s(),d(l,{key:3,index:"/suno"},null,512)),[[m,"index.title.suno"]]):k("v-if",!0),(D=(M=(z=e.site)==null?void 0:z.features)==null?void 0:M.luma)!=null&&D.enabled?p((s(),d(l,{key:4,index:"/luma"},null,512)),[[m,"index.title.luma"]]):k("v-if",!0),(X=(Y=(Q=e.site)==null?void 0:Q.features)==null?void 0:Y.headshots)!=null&&X.enabled?p((s(),d(l,{key:5,index:"/headshots"},null,512)),[[m,"index.title.headshots"]]):k("v-if",!0)]}),_:1}),p(t(l,{onRoute:void 0,onClick:o[0]||(o[0]=u=>e.openTab("https://platform.acedata.cloud"))},null,512),[[m,"common.nav.apiPlatform"]]),p(t(l,{onRoute:void 0,onClick:o[1]||(o[1]=u=>e.openTab("https://platform.acedata.cloud/support"))},null,512),[[m,"common.nav.support"]]),p(t(l,{onRoute:void 0,onClick:o[2]||(o[2]=u=>e.openTab("https://platform.acedata.cloud/earning"))},null,512),[[m,"common.nav.referral"]])]),_:1},8,["default-active","onSelect"])]),_:1}),t(c,{md:4,xs:11},{default:n(()=>[e.authenticated?(s(),E("div",Ze,[t(O),t(C,{class:"locale"}),h("div",{class:"console",onClick:o[3]||(o[3]=(...u)=>e.onConsole&&e.onConsole(...u))},_(e.$t("common.button.console")),1),t(ie,{trigger:"click"},{dropdown:n(()=>[t(le,null,{default:n(()=>[t(V,{onClick:e.onProfile},{default:n(()=>[g(_(e.$t("common.button.profile")),1)]),_:1},8,["onClick"]),t(V,{onClick:e.onLogout},{default:n(()=>[g(_(e.$t("common.button.logout")),1)]),_:1},8,["onClick"])]),_:1})]),default:n(()=>{var u;return[h("img",{src:((u=e.user)==null?void 0:u.avatar)||e.defaultAvatar,class:"avatar"},null,8,je)]}),_:1})])):(s(),E("div",Ke,[t(y,{type:"primary",class:"float-right",size:"small",round:"",onClick:e.onLogin},{default:n(()=>[g(_(e.$t("common.button.login")),1)]),_:1},8,["onClick"]),t(C,{class:"locale float-right mr-4"}),t(O,{class:"float-right mr-4"})]))]),_:1})]),_:1})}var eo=w(qe,[["render",We],["__file","/home/runner/work/Nexior/Nexior/src/components/common/TopHeader.vue"]]);const oo=b({name:"BottomFooter",components:{ElContainer:se,ElRow:re,ElCol:ae},data(){return{}},computed:{},methods:{}}),to={href:"https://platform.acedata.cloud"};function no(e,o,r,L,f,x){const i=a("el-col"),c=a("el-row"),l=a("el-container");return s(),d(l,{id:"footer",class:"footer"},{default:n(()=>[t(c,{class:"w-full"},{default:n(()=>[t(i,{class:"container",span:18,offset:3},{default:n(()=>[t(c,null,{default:n(()=>[t(i,{span:24,class:"text-center"},{default:n(()=>[h("p",null,[h("a",to,_(e.$t("common.entity.website")),1),g(" \xA9 "+_(new Date().getFullYear())+" "+_(e.$t("common.entity.copyright")),1)])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}var ao=w(oo,[["render",no],["__scopeId","data-v-5c0f0aec"],["__file","/home/runner/work/Nexior/Nexior/src/components/common/BottomFooter.vue"]]);const ro=b({name:"LayoutIndex",components:{TopHeader:eo,BottomFooter:ao,ElContainer:se,ElMain:Te,ElFooter:Ne,ElHeader:$e}});function so(e,o,r,L,f,x){const i=a("top-header"),c=a("el-header"),l=a("router-view"),v=a("el-main"),A=a("bottom-footer"),y=a("el-footer"),C=a("el-container");return s(),d(C,{class:"wrapper"},{default:n(()=>[t(c,{class:"header"},{default:n(()=>[t(i)]),_:1}),t(v,{class:"main"},{default:n(()=>[t(l)]),_:1}),t(y,{class:"footer"},{default:n(()=>[t(A)]),_:1})]),_:1})}var vo=w(ro,[["render",so],["__scopeId","data-v-3deb56ba"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Index.vue"]]);export{vo as default};
@@ -1 +1 @@
1
- var de=Object.defineProperty,ue=Object.defineProperties;var _e=Object.getOwnPropertyDescriptors;var le=Object.getOwnPropertySymbols;var me=Object.prototype.hasOwnProperty,fe=Object.prototype.propertyIsEnumerable;var re=(e,t,s)=>t in e?de(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,I=(e,t)=>{for(var s in t||(t={}))me.call(t,s)&&re(e,s,t[s]);if(le)for(var s of le(t))fe.call(t,s)&&re(e,s,t[s]);return e},S=(e,t)=>ue(e,_e(t));import{K as he}from"./vendor-others.179d4404.js";import{aq as B}from"./vendor-fortawesome.3e228e5c.js";import{V as ge}from"./VideoNavigator.a5c28887.js";import{_ as y,aB as ke,aC as ve,aD as $e,M as ye,P as q,F as be,aE as we}from"./index.54863a79.js";import{P as Ie,l as L,_ as Se,w as ce,x as pe,L as Ve,K as Ee,O as Pe,M as C,N as Ce,s as Ae,F as Ne,u as Te,C as Ue,R as Re}from"./vendor-element-plus.f90d6803.js";import{H as b,al as n,o as i,e as u,f as p,V as o,I as z,M as m,U as c,W as D,ai as G,L as A,S as k,T as $,Q as O}from"./vendor-@vue.fc29b169.js";import{I as F}from"./InfoIcon.0d72ff26.js";import{A as De,i as Ge,h as Me}from"./Status.3ed09234.js";import{C as Le}from"./CopyToClipboard.70ad0a47.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.8db51d62.js";const Oe=b({name:"LayoutPika",components:{ElDrawer:Ie,ElButton:L,FontAwesomeIcon:B,VideoNavigator:ge},data(){return{drawer:!1}}}),qe={class:"main"},ze={class:"config"},Be={class:"result"};function Fe(e,t,s,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",qe,[p("div",ze,[o(r),z(e.$slots,"config",{},void 0,!0)]),p("div",Be,[z(e.$slots,"result",{},void 0,!0)]),o(a,{round:"",class:"menu",onClick:t[0]||(t[0]=f=>e.drawer=!0)},{default:m(()=>[o(d,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),o(v,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=f=>e.drawer=f),"with-header":!1,size:"340px",class:"drawer"},{default:m(()=>[z(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var je=y(Oe,[["render",Fe],["__scopeId","data-v-449d36ce"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Pika.vue"]]);const Ke=b({name:"IngredientsSelector",components:{ElSwitch:Se,InfoIcon:F},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,s;console.debug("set ingredients",e),e||this.$store.commit("pika/setConfig",S(I({},(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",S(I({},(s=this.$store.state.pika)==null?void 0:s.config),{ingredients:e,model:"2.0"}))}}},mounted(){this.value===void 0&&(this.value=ke)}}),He={class:"field"},Qe={class:"title font-bold"};function We(e,t,s,l,h,g){const r=n("el-switch"),d=n("info-icon");return i(),u("div",He,[p("h2",Qe,c(e.$t("pika.name.ingredients")),1),o(r,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=a=>e.value=a),class:"value"},null,8,["modelValue"]),o(d,{content:e.$t("pika.description.ingredients"),class:"info"},null,8,["content"])])}var Je=y(Ke,[["render",We],["__scopeId","data-v-798cb974"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/config/IngredientsSelector.vue"]]);const Xe=b({name:"EffectSelector",components:{ElSelect:ce,ElOption:pe},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",S(I({},(t=this.$store.state.pika)==null?void 0:t.config),{effect:e}))}}},watch:{},mounted(){}}),Ye={class:"field"},Ze={class:"title font-bold"},xe={class:"float-left"};function et(e,t,s,l,h,g){const r=n("el-option"),d=n("el-select");return i(),u("div",Ye,[p("h2",Ze,c(e.$t("pika.name.effect")),1),o(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(D,null,G(e.options,a=>(i(),A(r,{key:a.value,label:a.label,value:a.value},{default:m(()=>[p("span",xe,c(a.label),1),k(' <span class="float-right">{{ item.value }}</span> ')]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}var tt=y(Xe,[["render",et],["__scopeId","data-v-db9ed4a6"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/config/EffectSelector.vue"]]);const st=b({name:"IngredientsModelSelector",components:{ElRadioButton:Ve,ElRadioGroup:Ee},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",S(I({},(t=this.$store.state.pika)==null?void 0:t.config),{ingredients_mode:e}))}}},mounted(){this.value||(this.value=ve)}}),ot={class:"field"},at={class:"title font-bold"};function nt(e,t,s,l,h,g){const r=n("el-radio-button"),d=n("el-radio-group");return i(),u("div",ot,[p("h2",at,c(e.$t("pika.name.ingredientsModel")),1),o(d,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=a=>e.value=a),size:"small",class:"quality"},{default:m(()=>[(i(!0),u(D,null,G(e.options,a=>(i(),A(r,{key:a.value,label:a.value},{default:m(()=>[$(c(a.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])])}var it=y(st,[["render",nt],["__scopeId","data-v-12df6463"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/config/IngredientsModelSelector.vue"]]);const lt=b({name:"ModelSelector",components:{ElSelect:ce,ElOption:pe},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",S(I({},this.$store.state.pika.config),{model:e}))}}},mounted(){this.value||(this.value=$e)}}),rt={class:"field"},ct={class:"title font-bold"};function pt(e,t,s,l,h,g){const r=n("el-option"),d=n("el-select");return i(),u("div",rt,[p("h2",ct,c(e.$t("pika.name.model")),1),o(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(D,null,G(e.options,a=>(i(),A(r,{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}var dt=y(lt,[["render",pt],["__scopeId","data-v-1df4d99b"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/config/ModelSelector.vue"]]);const ut=b({name:"ImageUrlInput",components:{ElUpload:Pe,ElButton:L,InfoIcon:F},data(){return{fileList:[],uploadUrl:ye()+"/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,s;(t=this.urls)==null||t[0],this.$store.commit("pika/setConfig",S(I({},(s=this.$store.state.pika)==null?void 0:s.config),{image_url:this.urls}))}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){C.warning(this.$t("pika.message.uploadStartImageExceed"))},onError(){C.error(this.$t("pika.message.uploadStartImageError"))},async onRemove(){C.error(this.$t("pika.message.uploadStartImageError"))},onSetStartImageUrl(){var e;this.$store.commit("pika/setConfig",S(I({},(e=this.$store.state.pika)==null?void 0:e.config),{image_url:this.urls}))},async onSuccess(){this.onSetStartImageUrl()}}}),_t={class:"field"},mt={class:"title font-bold"},ft={class:"upload-wrapper"};function ht(e,t,s,l,h,g){const r=n("el-button"),d=n("el-upload"),a=n("info-icon");return i(),u("div",_t,[p("h2",mt,c(e.$t("pika.name.imageUrl")),1),p("div",ft,[o(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(()=>[o(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"])]),o(a,{content:e.$t("pika.description.imageUrl"),class:"info"},null,8,["content"])])}var gt=y(ut,[["render",ht],["__scopeId","data-v-5daf4a89"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/config/ImageUrlInput.vue"]]);const kt="",vt=b({name:"PromptInput",components:{ElInput:Ce,InfoIcon:F},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",S(I({},(t=this.$store.state.pika)==null?void 0:t.config),{prompt:e}))}}},mounted(){this.value||(this.value=kt)}}),$t={class:"field"},yt={class:"box"},bt={class:"title font-bold"};function wt(e,t,s,l,h,g){const r=n("info-icon"),d=n("el-input");return i(),u("div",$t,[p("div",yt,[p("h2",bt,c(e.$t("pika.name.prompt")),1),o(r,{content:e.$t("pika.description.prompt"),class:"info"},null,8,["content"])]),o(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 It=y(vt,[["render",wt],["__scopeId","data-v-3f49f00e"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/config/PromptInput.vue"]]);const St=b({name:"PresetPanel",components:{ImageUrlInput:gt,ElButton:L,FontAwesomeIcon:B,PromptInput:It,IngredientsSelector:Je,IngredientsModelSelector:it,ModelSelector:dt,EffectSelector:tt},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.pika)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),Vt={class:"panel"},Et={class:"config"},Pt={class:"actions"};function Ct(e,t,s,l,h,g){var R,N,T,w;const r=n("prompt-input"),d=n("model-selector"),a=n("ingredients-selector"),v=n("effect-selector"),f=n("image-url-input"),V=n("ingredients-model-selector"),P=n("font-awesome-icon"),_=n("el-button");return i(),u("div",Vt,[p("div",Et,[o(r,{class:"mb-4"}),o(d,{class:"mb-4"}),o(a,{class:"mb-4"}),o(v,{class:"mb-4"}),(R=e.config)!=null&&R.ingredients?(i(),A(f,{key:0,class:"mb-4"})):k("v-if",!0),(N=e.config)!=null&&N.ingredients?(i(),A(V,{key:1,class:"mb-4"})):k("v-if",!0),p("div",Pt,[((T=e.config)==null?void 0:T.video_url)!==void 0||((w=e.config)==null?void 0:w.custom)?(i(),A(_,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:m(()=>[o(P,{icon:"fa-solid fa-magic",class:"mr-2"}),$(" "+c(e.$t("pika.button.extend")),1)]),_:1},8,["onClick"])):(i(),A(_,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:m(()=>[o(P,{icon:"fa-solid fa-magic",class:"mr-2"}),$(" "+c(e.$t("pika.button.generate")),1)]),_:1},8,["onClick"]))])])])}var At=y(St,[["render",Ct],["__scopeId","data-v-26d959d2"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/ConfigPanel.vue"]]);const Nt=b({name:"VideoPlayer",components:{VuePlyr:he},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:"1080p"}}}}}),Tt=["data-poster"],Ut=["src"];function Rt(e,t,s,l,h,g){const r=n("vue-plyr");return i(),u("div",null,[o(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,Ut)],8,Tt)]}),_:1},8,["options"])])}var Dt=y(Nt,[["render",Rt],["__scopeId","data-v-3697e02c"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/VideoPlayer.vue"]]);const Gt=b({name:"TaskPreview",components:{ElImage:Ae,CopyToClipboard:Le,FontAwesomeIcon:B,ElAlert:Ne,VideoPlayer:Dt,ElTooltip:Te,ElButton:L},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 s,l,h,g,r,d,a;let e=[];const t=(l=(s=this.modelValue)==null?void 0:s.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,s=new URL(t.src),l=s.searchParams.get("retry");if(!l)s.searchParams.set("retry","1");else if(parseInt(l)<2)s.searchParams.set("retry",(parseInt(l)+1).toString());else return;t.src=s.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),Mt={class:"left"},Lt={class:"main"},Ot={class:"bot"},qt={class:"datetime"},zt={class:"info"},Bt={key:0,class:"prompt mt-2"},Ft={key:0},jt={key:1},Kt={key:0,class:O({content:!0,failed:!0})},Ht={class:"image-wrapper"},Qt={key:0,class:O({operations:!0,"mt-2":!0})},Wt={class:"description"},Jt={key:1,class:O({content:!0})},Xt={class:"description"},Yt={class:"description"},Zt={class:"description"},xt={key:2,class:O({content:!0})},es={class:"description"};function ts(e,t,s,l,h,g){const r=n("el-image"),d=n("VideoPlayer"),a=n("el-button"),v=n("el-tooltip"),f=n("font-awesome-icon"),V=n("copy-to-clipboard"),P=n("el-alert");return i(!0),u(D,null,G(e.videos,(_,R)=>{var N,T,w,M,j,K,H,Q,W,J,X;return i(),u("div",{key:R,class:"preview"},[p("div",Mt,[o(r,{src:"https://cdn.acedata.cloud/i80tgn.png",class:"avatar"})]),p("div",Lt,[p("div",Ot,[$(c(e.$t("pika.name.pikaBot"))+" ",1),p("span",qt,c(e.$dayjs.format(""+new Date(parseFloat(((N=e.modelValue)==null?void 0:N.created_at)||"")*1e3))),1)]),p("div",zt,[(w=(T=e.modelValue)==null?void 0:T.request)!=null&&w.prompt?(i(),u("p",Bt,[$(c((j=(M=e.modelValue)==null?void 0:M.request)==null?void 0:j.prompt)+" ",1),(K=e.modelValue)!=null&&K.response?k("v-if",!0):(i(),u("span",Ft," - ("+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",jt," - ("+c(e.$t("pika.status.processing"))+") ",1)):k("v-if",!0)])):k("v-if",!0)]),k(" Display success message "),((Q=(H=e.modelValue)==null?void 0:H.response)==null?void 0:Q.success)===!0?(i(),u("div",Kt,[p("div",Ht,[o(d,{"model-value":_},null,8,["model-value"])]),_?(i(),u("div",Qt,[o(v,{class:"box-item",effect:"dark",content:e.$t("pika.message.downloadVideo"),placement:"top-start"},{default:m(()=>[o(a,{type:"info",size:"small",class:"btn-action",onClick:E=>e.onDownload(E,_==null?void 0:_.video_url)},{default:m(()=>[$(c(e.$t("pika.button.download")),1)]),_:2},1032,["onClick"])]),_:2},1032,["content"])])):k("v-if",!0),o(P,{closable:!1,class:"mt-2 success"},{default:m(()=>{var E,U;return[p("p",Wt,[o(f,{icon:"fa-solid fa-magic",class:"mr-1"}),$(" "+c(e.$t("pika.name.taskId"))+": "+c((E=e.modelValue)==null?void 0:E.id)+" ",1),o(V,{content:(U=e.modelValue)==null?void 0:U.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):k("v-if",!0),k(" Display error message "),((J=(W=e.modelValue)==null?void 0:W.response)==null?void 0:J.success)===!1?(i(),u("div",Jt,[o(P,{closable:!1,class:"failure"},{template:m(()=>[o(f,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),$(" "+c(e.$t("pika.name.failure")),1)]),default:m(()=>{var E,U,Y,Z,x,ee,te,se,oe,ae,ne,ie;return[p("p",Xt,[o(f,{icon:"fa-solid fa-magic",class:"mr-1"}),$(" "+c(e.$t("pika.name.taskId"))+": "+c((E=e.modelValue)==null?void 0:E.id)+" ",1),o(V,{content:(U=e.modelValue)==null?void 0:U.id,class:"btn-copy"},null,8,["content"])]),p("p",Yt,[o(f,{icon:"fa-solid fa-circle-info",class:"mr-1"}),$(" "+c(e.$t("pika.name.failureReason"))+": "+c((x=(Z=(Y=e.modelValue)==null?void 0:Y.response)==null?void 0:Z.error)==null?void 0:x.message)+" ",1),o(V,{content:(se=(te=(ee=e.modelValue)==null?void 0:ee.response)==null?void 0:te.error)==null?void 0:se.message,class:"btn-copy"},null,8,["content"])]),p("p",Zt,[o(f,{icon:"fa-solid fa-hashtag",class:"mr-1"}),$(" "+c(e.$t("pika.name.traceId"))+": "+c((ae=(oe=e.modelValue)==null?void 0:oe.response)==null?void 0:ae.trace_id)+" ",1),o(V,{content:(ie=(ne=e.modelValue)==null?void 0:ne.response)==null?void 0:ie.trace_id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):k("v-if",!0),k(" Display error message "),!((X=e.modelValue)!=null&&X.response)||(_==null?void 0:_.state)==="processing"||(_==null?void 0:_.state)==="pending"?(i(),u("div",xt,[o(P,{closable:!1,class:"info"},{template:m(()=>[o(f,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),$(" "+c(e.$t("pika.name.failure")),1)]),default:m(()=>{var E,U;return[p("p",es,[o(f,{icon:"fa-solid fa-magic",class:"mr-1"}),$(" "+c(e.$t("pika.name.taskId"))+": "+c((E=e.modelValue)==null?void 0:E.id)+" ",1),o(V,{content:(U=e.modelValue)==null?void 0:U.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):k("v-if",!0)])])}),128)}var ss=y(Gt,[["render",ts],["__scopeId","data-v-90858984"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/task/Preview.vue"]]);const os=b({name:"RecentPanel",components:{TaskPreview:ss,ElSkeleton:Ue,ElSkeletonItem:Re},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){var e,t,s,l;return S(I({},(e=this.$store.state.pika)==null?void 0:e.tasks),{items:(l=(s=(t=this.$store.state.pika)==null?void 0:t.tasks)==null?void 0:s.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")}}}),as={key:0,class:"tasks"},ns={class:"left"},is={class:"main"},ls={key:1,class:"tasks"},rs={key:2,class:"description"};function cs(e,t,s,l,h,g){var v,f,V,P,_,R,N,T;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",as,[(i(),u(D,null,G(3,w=>p("div",{key:w,class:"task placeholder"},[p("div",ns,[o(d,{animated:""},{template:m(()=>[o(r,{variant:"image",class:"avatar"})]),_:1})]),p("div",is,[o(d,{animated:""},{template:m(()=>[o(r,{variant:"p",class:"title"}),o(r,{variant:"image",class:"icon"})]),_:1})])])),64))])):((V=(f=e.tasks)==null?void 0:f.items)==null?void 0:V.length)&&((_=(P=e.tasks)==null?void 0:P.items)==null?void 0:_.length)>0?(i(),u("div",ls,[(i(!0),u(D,null,G((R=e.tasks)==null?void 0:R.items,(w,M)=>(i(),A(a,{key:M,"model-value":w,class:"preview"},null,8,["model-value"]))),128))])):k("v-if",!0),((T=(N=e.tasks)==null?void 0:N.items)==null?void 0:T.length)===0?(i(),u("p",rs,c(e.$t("pika.message.noTasks")),1)):k("v-if",!0)],544)}var ps=y(os,[["render",cs],["__scopeId","data-v-be2bfa4e"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/RecentPanel.vue"]]);const ds="https://webhook.acedata.cloud/pika",us=b({name:"PikaIndex",components:{ConfigPanel:At,Layout:je,ApplicationStatus:De,RecentPanel:ps},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)===q.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===q.Request},needApply(){return this.$store.state.pika.status.getApplications===q.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 s,l;((s=e==null?void 0:e.items)==null?void 0:s.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,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("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(){be.create({application:this.application}).then(({data:e})=>{this.application=e,C.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&&C.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:l}=e||{};console.debug("limit",t,"createdAtMin",s,"createdAtMax",l),await this.$store.dispatch("pika/getTasks",{limit:t,createdAtMin:s,createdAtMax:l})},async onGenerateVideo(){var s;const e=S(I({},this.config),{callback_url:ds}),t=(s=this.credential)==null?void 0:s.token;if(!t){console.error("no token specified");return}C.info(this.$t("pika.message.startingTask")),we.generate(e,{token:t}).then(()=>{C.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)===Me?C.error(this.$t("pika.message.usedUp")):C.error(this.$t("pika.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function _s(e,t,s,l,h,g){const r=n("config-panel"),d=n("application-status"),a=n("recent-panel"),v=n("layout");return i(),A(v,null,{config:m(()=>[o(r,{onGenerate:e.onGenerateVideo},null,8,["onGenerate"])]),result:m(()=>[o(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"]),o(a,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"]),k(' <operation-panel class="panel operation" @generate="onGenerate" /> ')]),_:1})}var Vs=y(us,[["render",_s],["__scopeId","data-v-307eef94"],["__file","/home/runner/work/Nexior/Nexior/src/pages/pika/Index.vue"]]);export{Vs as default};
1
+ var de=Object.defineProperty,ue=Object.defineProperties;var _e=Object.getOwnPropertyDescriptors;var le=Object.getOwnPropertySymbols;var me=Object.prototype.hasOwnProperty,fe=Object.prototype.propertyIsEnumerable;var re=(e,t,s)=>t in e?de(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,I=(e,t)=>{for(var s in t||(t={}))me.call(t,s)&&re(e,s,t[s]);if(le)for(var s of le(t))fe.call(t,s)&&re(e,s,t[s]);return e},S=(e,t)=>ue(e,_e(t));import{K as he}from"./vendor-others.179d4404.js";import{aq as B}from"./vendor-fortawesome.3e228e5c.js";import{V as ge}from"./VideoNavigator.a4d102ea.js";import{_ as y,aB as ke,aC as ve,aD as $e,M as ye,P as q,F as be,aE as we}from"./index.ca771f54.js";import{P as Ie,l as L,_ as Se,w as ce,x as pe,L as Ve,K as Ee,O as Pe,M as C,N as Ce,s as Ae,F as Ne,u as Te,C as Ue,R as Re}from"./vendor-element-plus.f90d6803.js";import{H as b,al as n,o as i,e as u,f as p,V as o,I as z,M as m,U as c,W as D,ai as G,L as A,S as k,T as $,Q as O}from"./vendor-@vue.fc29b169.js";import{I as F}from"./InfoIcon.a96e69b0.js";import{A as De,i as Ge,h as Me}from"./Status.2748135c.js";import{C as Le}from"./CopyToClipboard.698d5771.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.8db51d62.js";const Oe=b({name:"LayoutPika",components:{ElDrawer:Ie,ElButton:L,FontAwesomeIcon:B,VideoNavigator:ge},data(){return{drawer:!1}}}),qe={class:"main"},ze={class:"config"},Be={class:"result"};function Fe(e,t,s,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",qe,[p("div",ze,[o(r),z(e.$slots,"config",{},void 0,!0)]),p("div",Be,[z(e.$slots,"result",{},void 0,!0)]),o(a,{round:"",class:"menu",onClick:t[0]||(t[0]=f=>e.drawer=!0)},{default:m(()=>[o(d,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),o(v,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=f=>e.drawer=f),"with-header":!1,size:"340px",class:"drawer"},{default:m(()=>[z(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var je=y(Oe,[["render",Fe],["__scopeId","data-v-449d36ce"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Pika.vue"]]);const Ke=b({name:"IngredientsSelector",components:{ElSwitch:Se,InfoIcon:F},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,s;console.debug("set ingredients",e),e||this.$store.commit("pika/setConfig",S(I({},(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",S(I({},(s=this.$store.state.pika)==null?void 0:s.config),{ingredients:e,model:"2.0"}))}}},mounted(){this.value===void 0&&(this.value=ke)}}),He={class:"field"},Qe={class:"title font-bold"};function We(e,t,s,l,h,g){const r=n("el-switch"),d=n("info-icon");return i(),u("div",He,[p("h2",Qe,c(e.$t("pika.name.ingredients")),1),o(r,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=a=>e.value=a),class:"value"},null,8,["modelValue"]),o(d,{content:e.$t("pika.description.ingredients"),class:"info"},null,8,["content"])])}var Je=y(Ke,[["render",We],["__scopeId","data-v-798cb974"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/config/IngredientsSelector.vue"]]);const Xe=b({name:"EffectSelector",components:{ElSelect:ce,ElOption:pe},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",S(I({},(t=this.$store.state.pika)==null?void 0:t.config),{effect:e}))}}},watch:{},mounted(){}}),Ye={class:"field"},Ze={class:"title font-bold"},xe={class:"float-left"};function et(e,t,s,l,h,g){const r=n("el-option"),d=n("el-select");return i(),u("div",Ye,[p("h2",Ze,c(e.$t("pika.name.effect")),1),o(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(D,null,G(e.options,a=>(i(),A(r,{key:a.value,label:a.label,value:a.value},{default:m(()=>[p("span",xe,c(a.label),1),k(' <span class="float-right">{{ item.value }}</span> ')]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}var tt=y(Xe,[["render",et],["__scopeId","data-v-db9ed4a6"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/config/EffectSelector.vue"]]);const st=b({name:"IngredientsModelSelector",components:{ElRadioButton:Ve,ElRadioGroup:Ee},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",S(I({},(t=this.$store.state.pika)==null?void 0:t.config),{ingredients_mode:e}))}}},mounted(){this.value||(this.value=ve)}}),ot={class:"field"},at={class:"title font-bold"};function nt(e,t,s,l,h,g){const r=n("el-radio-button"),d=n("el-radio-group");return i(),u("div",ot,[p("h2",at,c(e.$t("pika.name.ingredientsModel")),1),o(d,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=a=>e.value=a),size:"small",class:"quality"},{default:m(()=>[(i(!0),u(D,null,G(e.options,a=>(i(),A(r,{key:a.value,label:a.value},{default:m(()=>[$(c(a.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])])}var it=y(st,[["render",nt],["__scopeId","data-v-12df6463"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/config/IngredientsModelSelector.vue"]]);const lt=b({name:"ModelSelector",components:{ElSelect:ce,ElOption:pe},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",S(I({},this.$store.state.pika.config),{model:e}))}}},mounted(){this.value||(this.value=$e)}}),rt={class:"field"},ct={class:"title font-bold"};function pt(e,t,s,l,h,g){const r=n("el-option"),d=n("el-select");return i(),u("div",rt,[p("h2",ct,c(e.$t("pika.name.model")),1),o(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(D,null,G(e.options,a=>(i(),A(r,{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}var dt=y(lt,[["render",pt],["__scopeId","data-v-1df4d99b"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/config/ModelSelector.vue"]]);const ut=b({name:"ImageUrlInput",components:{ElUpload:Pe,ElButton:L,InfoIcon:F},data(){return{fileList:[],uploadUrl:ye()+"/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,s;(t=this.urls)==null||t[0],this.$store.commit("pika/setConfig",S(I({},(s=this.$store.state.pika)==null?void 0:s.config),{image_url:this.urls}))}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){C.warning(this.$t("pika.message.uploadStartImageExceed"))},onError(){C.error(this.$t("pika.message.uploadStartImageError"))},async onRemove(){C.error(this.$t("pika.message.uploadStartImageError"))},onSetStartImageUrl(){var e;this.$store.commit("pika/setConfig",S(I({},(e=this.$store.state.pika)==null?void 0:e.config),{image_url:this.urls}))},async onSuccess(){this.onSetStartImageUrl()}}}),_t={class:"field"},mt={class:"title font-bold"},ft={class:"upload-wrapper"};function ht(e,t,s,l,h,g){const r=n("el-button"),d=n("el-upload"),a=n("info-icon");return i(),u("div",_t,[p("h2",mt,c(e.$t("pika.name.imageUrl")),1),p("div",ft,[o(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(()=>[o(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"])]),o(a,{content:e.$t("pika.description.imageUrl"),class:"info"},null,8,["content"])])}var gt=y(ut,[["render",ht],["__scopeId","data-v-5daf4a89"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/config/ImageUrlInput.vue"]]);const kt="",vt=b({name:"PromptInput",components:{ElInput:Ce,InfoIcon:F},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",S(I({},(t=this.$store.state.pika)==null?void 0:t.config),{prompt:e}))}}},mounted(){this.value||(this.value=kt)}}),$t={class:"field"},yt={class:"box"},bt={class:"title font-bold"};function wt(e,t,s,l,h,g){const r=n("info-icon"),d=n("el-input");return i(),u("div",$t,[p("div",yt,[p("h2",bt,c(e.$t("pika.name.prompt")),1),o(r,{content:e.$t("pika.description.prompt"),class:"info"},null,8,["content"])]),o(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 It=y(vt,[["render",wt],["__scopeId","data-v-3f49f00e"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/config/PromptInput.vue"]]);const St=b({name:"PresetPanel",components:{ImageUrlInput:gt,ElButton:L,FontAwesomeIcon:B,PromptInput:It,IngredientsSelector:Je,IngredientsModelSelector:it,ModelSelector:dt,EffectSelector:tt},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.pika)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),Vt={class:"panel"},Et={class:"config"},Pt={class:"actions"};function Ct(e,t,s,l,h,g){var R,N,T,w;const r=n("prompt-input"),d=n("model-selector"),a=n("ingredients-selector"),v=n("effect-selector"),f=n("image-url-input"),V=n("ingredients-model-selector"),P=n("font-awesome-icon"),_=n("el-button");return i(),u("div",Vt,[p("div",Et,[o(r,{class:"mb-4"}),o(d,{class:"mb-4"}),o(a,{class:"mb-4"}),o(v,{class:"mb-4"}),(R=e.config)!=null&&R.ingredients?(i(),A(f,{key:0,class:"mb-4"})):k("v-if",!0),(N=e.config)!=null&&N.ingredients?(i(),A(V,{key:1,class:"mb-4"})):k("v-if",!0),p("div",Pt,[((T=e.config)==null?void 0:T.video_url)!==void 0||((w=e.config)==null?void 0:w.custom)?(i(),A(_,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:m(()=>[o(P,{icon:"fa-solid fa-magic",class:"mr-2"}),$(" "+c(e.$t("pika.button.extend")),1)]),_:1},8,["onClick"])):(i(),A(_,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:m(()=>[o(P,{icon:"fa-solid fa-magic",class:"mr-2"}),$(" "+c(e.$t("pika.button.generate")),1)]),_:1},8,["onClick"]))])])])}var At=y(St,[["render",Ct],["__scopeId","data-v-26d959d2"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/ConfigPanel.vue"]]);const Nt=b({name:"VideoPlayer",components:{VuePlyr:he},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:"1080p"}}}}}),Tt=["data-poster"],Ut=["src"];function Rt(e,t,s,l,h,g){const r=n("vue-plyr");return i(),u("div",null,[o(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,Ut)],8,Tt)]}),_:1},8,["options"])])}var Dt=y(Nt,[["render",Rt],["__scopeId","data-v-3697e02c"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/VideoPlayer.vue"]]);const Gt=b({name:"TaskPreview",components:{ElImage:Ae,CopyToClipboard:Le,FontAwesomeIcon:B,ElAlert:Ne,VideoPlayer:Dt,ElTooltip:Te,ElButton:L},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 s,l,h,g,r,d,a;let e=[];const t=(l=(s=this.modelValue)==null?void 0:s.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,s=new URL(t.src),l=s.searchParams.get("retry");if(!l)s.searchParams.set("retry","1");else if(parseInt(l)<2)s.searchParams.set("retry",(parseInt(l)+1).toString());else return;t.src=s.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),Mt={class:"left"},Lt={class:"main"},Ot={class:"bot"},qt={class:"datetime"},zt={class:"info"},Bt={key:0,class:"prompt mt-2"},Ft={key:0},jt={key:1},Kt={key:0,class:O({content:!0,failed:!0})},Ht={class:"image-wrapper"},Qt={key:0,class:O({operations:!0,"mt-2":!0})},Wt={class:"description"},Jt={key:1,class:O({content:!0})},Xt={class:"description"},Yt={class:"description"},Zt={class:"description"},xt={key:2,class:O({content:!0})},es={class:"description"};function ts(e,t,s,l,h,g){const r=n("el-image"),d=n("VideoPlayer"),a=n("el-button"),v=n("el-tooltip"),f=n("font-awesome-icon"),V=n("copy-to-clipboard"),P=n("el-alert");return i(!0),u(D,null,G(e.videos,(_,R)=>{var N,T,w,M,j,K,H,Q,W,J,X;return i(),u("div",{key:R,class:"preview"},[p("div",Mt,[o(r,{src:"https://cdn.acedata.cloud/i80tgn.png",class:"avatar"})]),p("div",Lt,[p("div",Ot,[$(c(e.$t("pika.name.pikaBot"))+" ",1),p("span",qt,c(e.$dayjs.format(""+new Date(parseFloat(((N=e.modelValue)==null?void 0:N.created_at)||"")*1e3))),1)]),p("div",zt,[(w=(T=e.modelValue)==null?void 0:T.request)!=null&&w.prompt?(i(),u("p",Bt,[$(c((j=(M=e.modelValue)==null?void 0:M.request)==null?void 0:j.prompt)+" ",1),(K=e.modelValue)!=null&&K.response?k("v-if",!0):(i(),u("span",Ft," - ("+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",jt," - ("+c(e.$t("pika.status.processing"))+") ",1)):k("v-if",!0)])):k("v-if",!0)]),k(" Display success message "),((Q=(H=e.modelValue)==null?void 0:H.response)==null?void 0:Q.success)===!0?(i(),u("div",Kt,[p("div",Ht,[o(d,{"model-value":_},null,8,["model-value"])]),_?(i(),u("div",Qt,[o(v,{class:"box-item",effect:"dark",content:e.$t("pika.message.downloadVideo"),placement:"top-start"},{default:m(()=>[o(a,{type:"info",size:"small",class:"btn-action",onClick:E=>e.onDownload(E,_==null?void 0:_.video_url)},{default:m(()=>[$(c(e.$t("pika.button.download")),1)]),_:2},1032,["onClick"])]),_:2},1032,["content"])])):k("v-if",!0),o(P,{closable:!1,class:"mt-2 success"},{default:m(()=>{var E,U;return[p("p",Wt,[o(f,{icon:"fa-solid fa-magic",class:"mr-1"}),$(" "+c(e.$t("pika.name.taskId"))+": "+c((E=e.modelValue)==null?void 0:E.id)+" ",1),o(V,{content:(U=e.modelValue)==null?void 0:U.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):k("v-if",!0),k(" Display error message "),((J=(W=e.modelValue)==null?void 0:W.response)==null?void 0:J.success)===!1?(i(),u("div",Jt,[o(P,{closable:!1,class:"failure"},{template:m(()=>[o(f,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),$(" "+c(e.$t("pika.name.failure")),1)]),default:m(()=>{var E,U,Y,Z,x,ee,te,se,oe,ae,ne,ie;return[p("p",Xt,[o(f,{icon:"fa-solid fa-magic",class:"mr-1"}),$(" "+c(e.$t("pika.name.taskId"))+": "+c((E=e.modelValue)==null?void 0:E.id)+" ",1),o(V,{content:(U=e.modelValue)==null?void 0:U.id,class:"btn-copy"},null,8,["content"])]),p("p",Yt,[o(f,{icon:"fa-solid fa-circle-info",class:"mr-1"}),$(" "+c(e.$t("pika.name.failureReason"))+": "+c((x=(Z=(Y=e.modelValue)==null?void 0:Y.response)==null?void 0:Z.error)==null?void 0:x.message)+" ",1),o(V,{content:(se=(te=(ee=e.modelValue)==null?void 0:ee.response)==null?void 0:te.error)==null?void 0:se.message,class:"btn-copy"},null,8,["content"])]),p("p",Zt,[o(f,{icon:"fa-solid fa-hashtag",class:"mr-1"}),$(" "+c(e.$t("pika.name.traceId"))+": "+c((ae=(oe=e.modelValue)==null?void 0:oe.response)==null?void 0:ae.trace_id)+" ",1),o(V,{content:(ie=(ne=e.modelValue)==null?void 0:ne.response)==null?void 0:ie.trace_id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):k("v-if",!0),k(" Display error message "),!((X=e.modelValue)!=null&&X.response)||(_==null?void 0:_.state)==="processing"||(_==null?void 0:_.state)==="pending"?(i(),u("div",xt,[o(P,{closable:!1,class:"info"},{template:m(()=>[o(f,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),$(" "+c(e.$t("pika.name.failure")),1)]),default:m(()=>{var E,U;return[p("p",es,[o(f,{icon:"fa-solid fa-magic",class:"mr-1"}),$(" "+c(e.$t("pika.name.taskId"))+": "+c((E=e.modelValue)==null?void 0:E.id)+" ",1),o(V,{content:(U=e.modelValue)==null?void 0:U.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):k("v-if",!0)])])}),128)}var ss=y(Gt,[["render",ts],["__scopeId","data-v-90858984"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/task/Preview.vue"]]);const os=b({name:"RecentPanel",components:{TaskPreview:ss,ElSkeleton:Ue,ElSkeletonItem:Re},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){var e,t,s,l;return S(I({},(e=this.$store.state.pika)==null?void 0:e.tasks),{items:(l=(s=(t=this.$store.state.pika)==null?void 0:t.tasks)==null?void 0:s.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")}}}),as={key:0,class:"tasks"},ns={class:"left"},is={class:"main"},ls={key:1,class:"tasks"},rs={key:2,class:"description"};function cs(e,t,s,l,h,g){var v,f,V,P,_,R,N,T;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",as,[(i(),u(D,null,G(3,w=>p("div",{key:w,class:"task placeholder"},[p("div",ns,[o(d,{animated:""},{template:m(()=>[o(r,{variant:"image",class:"avatar"})]),_:1})]),p("div",is,[o(d,{animated:""},{template:m(()=>[o(r,{variant:"p",class:"title"}),o(r,{variant:"image",class:"icon"})]),_:1})])])),64))])):((V=(f=e.tasks)==null?void 0:f.items)==null?void 0:V.length)&&((_=(P=e.tasks)==null?void 0:P.items)==null?void 0:_.length)>0?(i(),u("div",ls,[(i(!0),u(D,null,G((R=e.tasks)==null?void 0:R.items,(w,M)=>(i(),A(a,{key:M,"model-value":w,class:"preview"},null,8,["model-value"]))),128))])):k("v-if",!0),((T=(N=e.tasks)==null?void 0:N.items)==null?void 0:T.length)===0?(i(),u("p",rs,c(e.$t("pika.message.noTasks")),1)):k("v-if",!0)],544)}var ps=y(os,[["render",cs],["__scopeId","data-v-be2bfa4e"],["__file","/home/runner/work/Nexior/Nexior/src/components/pika/RecentPanel.vue"]]);const ds="https://webhook.acedata.cloud/pika",us=b({name:"PikaIndex",components:{ConfigPanel:At,Layout:je,ApplicationStatus:De,RecentPanel:ps},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)===q.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===q.Request},needApply(){return this.$store.state.pika.status.getApplications===q.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 s,l;((s=e==null?void 0:e.items)==null?void 0:s.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,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("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(){be.create({application:this.application}).then(({data:e})=>{this.application=e,C.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&&C.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:l}=e||{};console.debug("limit",t,"createdAtMin",s,"createdAtMax",l),await this.$store.dispatch("pika/getTasks",{limit:t,createdAtMin:s,createdAtMax:l})},async onGenerateVideo(){var s;const e=S(I({},this.config),{callback_url:ds}),t=(s=this.credential)==null?void 0:s.token;if(!t){console.error("no token specified");return}C.info(this.$t("pika.message.startingTask")),we.generate(e,{token:t}).then(()=>{C.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)===Me?C.error(this.$t("pika.message.usedUp")):C.error(this.$t("pika.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function _s(e,t,s,l,h,g){const r=n("config-panel"),d=n("application-status"),a=n("recent-panel"),v=n("layout");return i(),A(v,null,{config:m(()=>[o(r,{onGenerate:e.onGenerateVideo},null,8,["onGenerate"])]),result:m(()=>[o(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"]),o(a,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"]),k(' <operation-panel class="panel operation" @generate="onGenerate" /> ')]),_:1})}var Vs=y(us,[["render",_s],["__scopeId","data-v-307eef94"],["__file","/home/runner/work/Nexior/Nexior/src/pages/pika/Index.vue"]]);export{Vs as default};