@acedatacloud/nexior 3.5.0 → 3.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/assets/{Auth.0c0816f7.js → Auth.a90cc399.js} +1 -1
  2. package/dist/assets/{Callback.4ee50c3a.js → Callback.a82acc75.js} +1 -1
  3. package/dist/assets/{Chatdoc.0d355719.js → Chatdoc.5263125f.js} +1 -1
  4. package/dist/assets/{Console.1508b2bb.js → Console.83a7d90a.js} +1 -1
  5. package/dist/assets/{Conversation.7750a789.js → Conversation.33a8676d.js} +1 -1
  6. package/dist/assets/Conversation.fc58efa8.js +1 -0
  7. package/dist/assets/{CopyToClipboard.2d20734e.js → CopyToClipboard.dcbf7182.js} +1 -1
  8. package/dist/assets/{Detail.4e297711.js → Detail.24cd6940.js} +1 -1
  9. package/dist/assets/{EditArray.4e85afd6.js → EditArray.fc90290f.js} +1 -1
  10. package/dist/assets/{Extra.d5cd3529.js → Extra.d9e8ad3d.js} +1 -1
  11. package/dist/assets/{History.49f74045.js → History.d91b1f04.js} +1 -1
  12. package/dist/assets/{ImagePreview.d6abc713.js → ImagePreview.025cfc09.js} +1 -1
  13. package/dist/assets/{Index.35aec0de.js → Index.19d318b4.js} +1 -1
  14. package/dist/assets/Index.3d4c7011.js +1 -0
  15. package/dist/assets/Index.40702b91.js +1 -0
  16. package/dist/assets/{Index.bc14909f.js → Index.49dc3c46.js} +1 -1
  17. package/dist/assets/Index.503e0f7b.js +1 -0
  18. package/dist/assets/Index.5a7e5cc0.js +3 -0
  19. package/dist/assets/{Index.a960a1be.js → Index.646d79c3.js} +1 -1
  20. package/dist/assets/{Index.3c60148f.js → Index.6edc0543.js} +1 -1
  21. package/dist/assets/Index.76db79a3.js +1 -0
  22. package/dist/assets/{Index.e470bccd.js → Index.77acf7ce.js} +1 -1
  23. package/dist/assets/{Index.9a0bc85d.js → Index.7dada60b.js} +1 -1
  24. package/dist/assets/Index.9edce037.js +1 -0
  25. package/dist/assets/{Index.01f67d91.js → Index.f10f48b2.js} +1 -1
  26. package/dist/assets/{InfoIcon.5a350f1f.js → InfoIcon.b6bd8d58.js} +1 -1
  27. package/dist/assets/{Invitees.7decaaca.js → Invitees.9fba250b.js} +1 -1
  28. package/dist/assets/{List.91afc11f.js → List.011b2c71.js} +1 -1
  29. package/dist/assets/{List.86d591dc.js → List.67c11343.js} +1 -1
  30. package/dist/assets/{List.cebbf55e.js → List.69d56b67.js} +1 -1
  31. package/dist/assets/{Login.2228fb31.js → Login.4c26f374.js} +1 -1
  32. package/dist/assets/{Main.54e04e19.js → Main.421f61bd.js} +1 -1
  33. package/dist/assets/{Manage.db7fe09d.js → Manage.f12c92bd.js} +1 -1
  34. package/dist/assets/{MarkdownRenderer.2bf00ae2.js → MarkdownRenderer.3fb8276a.js} +1 -1
  35. package/dist/assets/{Navigator.778b9aca.js → Navigator.3204ea1d.js} +1 -1
  36. package/dist/assets/{Pagination.e3c91ab4.js → Pagination.3c242094.js} +1 -1
  37. package/dist/assets/{Setting.8a4e8a39.js → Setting.6cf3ec08.js} +1 -1
  38. package/dist/assets/Status.ce9bc4cb.js +1 -0
  39. package/dist/assets/{Subscribe.a2f42d1b.js → Subscribe.8bf14b5c.js} +1 -1
  40. package/dist/assets/{distribution.62c0b679.js → distribution.fd10b951.js} +1 -1
  41. package/dist/assets/{index.60bb4e0a.js → index.97386539.js} +3 -3
  42. package/dist/assets/{order.1ca24c7f.js → order.f1773d29.js} +1 -1
  43. package/dist/assets/{price.c9d715ac.js → price.cb59d1b0.js} +1 -1
  44. package/dist/index.html +1 -1
  45. package/package.json +2 -1
  46. package/dist/assets/Conversation.ea9a6ab9.js +0 -1
  47. package/dist/assets/Index.15439550.js +0 -1
  48. package/dist/assets/Index.279159eb.js +0 -1
  49. package/dist/assets/Index.34f31b25.js +0 -1
  50. package/dist/assets/Index.7dc5f524.js +0 -1
  51. package/dist/assets/Index.7e50d1f1.js +0 -3
  52. package/dist/assets/Index.c25e9222.js +0 -1
  53. package/dist/assets/Status.54e386d8.js +0 -1
@@ -1 +1 @@
1
- import"./vendor-others.cdfefb59.js";import{C as U}from"./CopyToClipboard.2d20734e.js";import{_ as A,ag as Q,ah as G,ai as W}from"./index.60bb4e0a.js";import{d as R,s as Y,a as j}from"./distribution.62c0b679.js";import{g as J}from"./price.c9d715ac.js";import{ar as K}from"./vendor-fortawesome.2b54ad1b.js";import{Q as X}from"./vendor-qrcode.6ab44f81.js";import{S as Z,A as x,B as tt,u as et,l as it,F as st,s as ot,C as nt,D as at,H as lt}from"./vendor-element-plus.1fa87efb.js";import{H as rt,al as l,L as _,M as o,o as a,V as i,f as e,T as s,e as g,S as y,R as C}from"./vendor-@vue.6c0309d3.js";import"./vendor-markdown.cf3e96ae.js";import"./vendor-axios.168e6950.js";const dt=rt({name:"ConsoleDistributionList",components:{CopyToClipboard:U,FontAwesomeIcon:K,QrCode:X,ElProgress:Z,ElRow:x,ElCol:tt,ElButton:et,ElDivider:it,ElCard:st,ElTooltip:ot,ElTable:nt,ElTableColumn:at,ElSkeleton:lt},data(){return{invitees:[],inviteesCount:void 0,distributionLevels:[],distributionLink:void 0,distributionStatus:void 0,loading:!1}},computed:{redirect(){return this.$route.query.redirect},page(){var t;return parseInt(((t=this.$route.query.page)==null?void 0:t.toString())||"1")},distributionLevelMap(){let t={};return this.distributionLevels.forEach(n=>{t[n.level]=n}),t}},watch:{page:{handler(){this.onFetchData()}}},async mounted(){this.onFetchData(),this.onGenerateDistributionLink()},methods:{getPriceString:J,goHistory(){this.$router.push({name:Q})},goInvitees(){this.$router.push({name:G})},onPageChange(t){var n;this.$router.push({name:(n=this.$route.name)==null?void 0:n.toString(),query:{page:t}})},getPercentageForNextLevel(){var c,u,p,b,r,v,h;const t=(p=this.distributionLevelMap[(u=(c=this.distributionStatus)==null?void 0:c.level)==null?void 0:u.level])==null?void 0:p.threshold,n=(v=this.distributionLevelMap[((r=(b=this.distributionStatus)==null?void 0:b.level)==null?void 0:r.level)+1])==null?void 0:v.threshold;return Math.floor((((h=this.distributionStatus)==null?void 0:h.price)-t)/(n-t)*100)},getDeltaForNextLevel(){var n,c,u,p;const t=(u=this.distributionLevelMap[((c=(n=this.distributionStatus)==null?void 0:n.level)==null?void 0:c.level)+1])==null?void 0:u.threshold;return Math.floor(t-((p=this.distributionStatus)==null?void 0:p.price))},async onFetchData(){this.loading=!0,await R.initialize(),Promise.all([this.onFetchDistributionStatus(),this.onFetchDistributionLevels(),this.onFetchInvitees()]).finally(()=>{this.loading=!1})},async onGenerateDistributionLink(){var c,u,p;const n=`${window.location.origin}?inviter_id=${this.$store.getters.user.id}`;try{const b=(p=(u=(c=await Y.create(n))==null?void 0:c.data)==null?void 0:u.data)==null?void 0:p.url;this.distributionLink=(b||n).replace("surl.id","share.acedata.cloud")}catch{this.distributionLink=n}},async onFetchDistributionStatus(){const{data:t}=await R.getAll({user_id:this.$store.getters.user.id});t.items&&t.items.length>0&&(this.distributionStatus=t.items[0])},async onFetchDistributionLevels(){const{data:t}=await j.getAll({limit:20,user_id:this.$store.getters.user.id});this.distributionLevels=t.items},async onFetchInvitees(){const{data:t}=await W.getInvitees({});this.invitees=t.items,this.inviteesCount=t.count}}}),ct={class:"title"},ut={key:1},pt={class:"icon-wrapper"},ht={class:"text-left"},_t={class:"description"},mt={class:"value"},vt={key:1},bt={class:"icon-wrapper"},ft={class:"text-left"},gt={class:"description"},kt={class:"value"},wt={key:1},yt={class:"icon-wrapper"},$t={class:"text-left"},Lt={class:"description"},St={class:"value"},Ct={key:1},Dt={class:"icon-wrapper"},It={class:"text-left"},Tt={class:"description"},Et={class:"value"},Ft={key:1},Nt={class:"title"},Pt={class:"clear-both overflow-hidden"},Bt={class:"float-left description"},Mt={class:"float-right description"},Ot={class:"description"},Rt={class:"level"},qt={class:"level"},Vt={class:"level"},zt={key:1},Ht={class:"title"},Ut={class:"link-wrapper text-center"},At=["href"],Qt={class:"qr-wrapper ml-auto mr-auto"},Gt={class:"mt-0"},Wt={class:"description"},Yt={class:"more"};function jt(t,n,c,u,p,b){const r=l("el-col"),v=l("el-row"),h=l("el-skeleton"),$=l("font-awesome-icon"),L=l("el-button"),f=l("el-card"),D=l("el-tooltip"),q=l("el-progress"),I=l("el-divider"),S=l("el-table-column"),V=l("el-table"),z=l("copy-to-clipboard"),H=l("qr-code");return a(),_(v,{class:"panel"},{default:o(()=>[i(r,{span:24},{default:o(()=>[i(v,null,{default:o(()=>[i(r,{span:24},{default:o(()=>[e("h2",ct,s(t.$t("common.title.distribution")),1)]),_:1})]),_:1}),i(v,{gutter:15},{default:o(()=>[i(r,{md:6,xs:24},{default:o(()=>[i(f,{shadow:"hover",class:"item-mini mb-4"},{default:o(()=>{var d;return[t.loading?(a(),_(h,{key:0})):(a(),g("div",ut,[e("div",pt,[i($,{icon:"fa-solid fa-wallet",class:"icon"})]),e("div",ht,[e("p",_t,s(t.$t("distribution.title.price")),1),e("p",mt,s(t.getPriceString({value:(d=t.distributionStatus)==null?void 0:d.price})),1)]),i(L,{type:"primary",round:"",size:"small",class:"btn",onClick:t.goHistory},{default:o(()=>[y(s(t.$t("distribution.button.detail")),1)]),_:1},8,["onClick"])]))]}),_:1})]),_:1}),i(r,{md:6,xs:24},{default:o(()=>[i(f,{shadow:"hover",class:"item-mini mb-4"},{default:o(()=>{var d;return[t.loading?(a(),_(h,{key:0})):(a(),g("div",vt,[e("div",bt,[i($,{icon:"fa-solid fa-coins",class:"icon"})]),e("div",ft,[e("p",gt,s(t.$t("distribution.title.reward")),1),e("p",kt,s(t.getPriceString({value:(d=t.distributionStatus)==null?void 0:d.reward})),1)]),i(D,{effect:"dark",content:t.$t("distribution.message.developingWithDrawal"),placement:"top"},{default:o(()=>[i(L,{type:"primary",round:"",size:"small",class:"btn"},{default:o(()=>[y(s(t.$t("distribution.button.withdrawal")),1)]),_:1})]),_:1},8,["content"])]))]}),_:1})]),_:1}),i(r,{md:6,xs:24},{default:o(()=>[i(f,{shadow:"hover",class:"item-mini mb-4"},{default:o(()=>{var d,k;return[t.loading?(a(),_(h,{key:0})):(a(),g("div",wt,[e("div",yt,[i($,{icon:"fa-solid fa-percent",class:"icon"})]),e("div",$t,[e("p",Lt,s(t.$t("distribution.title.percentage")),1),e("p",St,s((k=(d=t.distributionStatus)==null?void 0:d.level)==null?void 0:k.percentage)+"%",1)])]))]}),_:1})]),_:1}),i(r,{md:6,xs:24},{default:o(()=>[i(f,{shadow:"hover",class:"item-mini mb-4"},{default:o(()=>[t.loading?(a(),_(h,{key:0})):(a(),g("div",Ct,[e("div",Dt,[i($,{icon:"fa-regular fa-user",class:"icon"})]),e("div",It,[e("p",Tt,s(t.$t("distribution.title.inviteesCount")),1),e("p",Et,s(t.inviteesCount),1)]),i(L,{type:"primary",round:"",size:"small",class:"btn",onClick:t.goInvitees},{default:o(()=>[y(s(t.$t("distribution.button.detail")),1)]),_:1},8,["onClick"])]))]),_:1})]),_:1})]),_:1}),i(v,{gutter:15},{default:o(()=>[i(r,{md:12,xs:24},{default:o(()=>[i(f,{shadow:"hover",class:"level-info mb-4"},{default:o(()=>{var d,k,T,E,F,N,P,B,M,O;return[t.loading?(a(),_(h,{key:0})):(a(),g("div",Ft,[e("h4",Nt,s(t.$t("distribution.title.levelInfo")),1),e("div",Pt,[e("div",Bt,[e("p",null,s(t.$t("distribution.title.currentLevel"))+": L"+s((k=(d=t.distributionStatus)==null?void 0:d.level)==null?void 0:k.level),1),e("p",null,s(t.$t("distribution.title.currentPercentage"))+": "+s((F=t.distributionLevelMap[(E=(T=t.distributionStatus)==null?void 0:T.level)==null?void 0:E.level])==null?void 0:F.percentage)+"% ",1)]),e("div",Mt,[e("p",null,s(t.$t("distribution.title.nextLevel"))+": L"+s(((P=(N=t.distributionStatus)==null?void 0:N.level)==null?void 0:P.level)+1),1),e("p",null,s(t.$t("distribution.title.nextPercentage"))+": "+s((O=t.distributionLevelMap[((M=(B=t.distributionStatus)==null?void 0:B.level)==null?void 0:M.level)+1])==null?void 0:O.percentage)+"% ",1)])]),i(q,{"text-inside":!0,"stroke-width":20,percentage:t.getPercentageForNextLevel(),class:"mb-2"},null,8,["percentage"]),e("p",Ot,s(t.$t("distribution.message.deltaPriceForNextLevel"))+": $"+s(t.getDeltaForNextLevel()),1),i(I),t.distributionLevels?(a(),_(V,{key:0,data:t.distributionLevels,stripe:""},{default:o(()=>[i(S,{label:t.$t("distribution.field.level")},{default:o(w=>{var m;return[e("span",Rt,"L"+s((m=w.row)==null?void 0:m.level),1)]}),_:1},8,["label"]),i(S,{label:t.$t("distribution.field.threshold")},{default:o(w=>{var m;return[e("span",qt,"$"+s((m=w.row)==null?void 0:m.threshold),1)]}),_:1},8,["label"]),i(S,{label:t.$t("distribution.field.percentage")},{default:o(w=>{var m;return[e("span",Vt,s((m=w.row)==null?void 0:m.percentage)+"%",1)]}),_:1},8,["label"])]),_:1},8,["data"])):C("v-if",!0)]))]}),_:1})]),_:1}),i(r,{md:12,xs:24},{default:o(()=>[i(f,{shadow:"hover",class:"distribution-info mb-4"},{default:o(()=>[t.loading?(a(),_(h,{key:0})):(a(),g("div",zt,[e("h4",Ht,s(t.$t("distribution.title.distributionLink")),1),i(I),e("div",Ut,[C("v-if",!0),e("a",{href:t.distributionLink,class:"link"},s(t.distributionLink),9,At),i(z,{content:t.distributionLink},null,8,["content"])]),e("div",Qt,[t.distributionLink?(a(),_(H,{key:0,value:t.distributionLink,size:180,margin:2,class:"block mb-2 ml-auto mr-auto"},null,8,["value"])):C("v-if",!0),e("p",Gt,s(t.$t("distribution.message.distributionQrDescription")),1)]),e("p",Wt,[y(s(t.$t("distribution.message.distributionLinkDescription"))+" ",1),e("span",Yt,[i(D,{effect:"dark",content:t.$t("distribution.message.distributionLinkDescription2"),placement:"top"},{default:o(()=>[y(s(t.$t("distribution.message.technicalDetail")),1)]),_:1},8,["content"])])])]))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}var ae=A(dt,[["render",jt],["__scopeId","data-v-732e1b6b"],["__file","/home/runner/work/Nexior/Nexior/src/pages/distribution/Index.vue"]]);export{ae as default};
1
+ import"./vendor-others.cdfefb59.js";import{C as U}from"./CopyToClipboard.dcbf7182.js";import{_ as A,ag as Q,ah as G,ai as W}from"./index.97386539.js";import{d as R,s as Y,a as j}from"./distribution.fd10b951.js";import{g as J}from"./price.cb59d1b0.js";import{ar as K}from"./vendor-fortawesome.2b54ad1b.js";import{Q as X}from"./vendor-qrcode.6ab44f81.js";import{S as Z,A as x,B as tt,u as et,l as it,F as st,s as ot,C as nt,D as at,H as lt}from"./vendor-element-plus.1fa87efb.js";import{H as rt,al as l,L as _,M as o,o as a,V as i,f as e,T as s,e as g,S as y,R as C}from"./vendor-@vue.6c0309d3.js";import"./vendor-markdown.cf3e96ae.js";import"./vendor-axios.168e6950.js";const dt=rt({name:"ConsoleDistributionList",components:{CopyToClipboard:U,FontAwesomeIcon:K,QrCode:X,ElProgress:Z,ElRow:x,ElCol:tt,ElButton:et,ElDivider:it,ElCard:st,ElTooltip:ot,ElTable:nt,ElTableColumn:at,ElSkeleton:lt},data(){return{invitees:[],inviteesCount:void 0,distributionLevels:[],distributionLink:void 0,distributionStatus:void 0,loading:!1}},computed:{redirect(){return this.$route.query.redirect},page(){var t;return parseInt(((t=this.$route.query.page)==null?void 0:t.toString())||"1")},distributionLevelMap(){let t={};return this.distributionLevels.forEach(n=>{t[n.level]=n}),t}},watch:{page:{handler(){this.onFetchData()}}},async mounted(){this.onFetchData(),this.onGenerateDistributionLink()},methods:{getPriceString:J,goHistory(){this.$router.push({name:Q})},goInvitees(){this.$router.push({name:G})},onPageChange(t){var n;this.$router.push({name:(n=this.$route.name)==null?void 0:n.toString(),query:{page:t}})},getPercentageForNextLevel(){var c,u,p,b,r,v,h;const t=(p=this.distributionLevelMap[(u=(c=this.distributionStatus)==null?void 0:c.level)==null?void 0:u.level])==null?void 0:p.threshold,n=(v=this.distributionLevelMap[((r=(b=this.distributionStatus)==null?void 0:b.level)==null?void 0:r.level)+1])==null?void 0:v.threshold;return Math.floor((((h=this.distributionStatus)==null?void 0:h.price)-t)/(n-t)*100)},getDeltaForNextLevel(){var n,c,u,p;const t=(u=this.distributionLevelMap[((c=(n=this.distributionStatus)==null?void 0:n.level)==null?void 0:c.level)+1])==null?void 0:u.threshold;return Math.floor(t-((p=this.distributionStatus)==null?void 0:p.price))},async onFetchData(){this.loading=!0,await R.initialize(),Promise.all([this.onFetchDistributionStatus(),this.onFetchDistributionLevels(),this.onFetchInvitees()]).finally(()=>{this.loading=!1})},async onGenerateDistributionLink(){var c,u,p;const n=`${window.location.origin}?inviter_id=${this.$store.getters.user.id}`;try{const b=(p=(u=(c=await Y.create(n))==null?void 0:c.data)==null?void 0:u.data)==null?void 0:p.url;this.distributionLink=(b||n).replace("surl.id","share.acedata.cloud")}catch{this.distributionLink=n}},async onFetchDistributionStatus(){const{data:t}=await R.getAll({user_id:this.$store.getters.user.id});t.items&&t.items.length>0&&(this.distributionStatus=t.items[0])},async onFetchDistributionLevels(){const{data:t}=await j.getAll({limit:20,user_id:this.$store.getters.user.id});this.distributionLevels=t.items},async onFetchInvitees(){const{data:t}=await W.getInvitees({});this.invitees=t.items,this.inviteesCount=t.count}}}),ct={class:"title"},ut={key:1},pt={class:"icon-wrapper"},ht={class:"text-left"},_t={class:"description"},mt={class:"value"},vt={key:1},bt={class:"icon-wrapper"},ft={class:"text-left"},gt={class:"description"},kt={class:"value"},wt={key:1},yt={class:"icon-wrapper"},$t={class:"text-left"},Lt={class:"description"},St={class:"value"},Ct={key:1},Dt={class:"icon-wrapper"},It={class:"text-left"},Tt={class:"description"},Et={class:"value"},Ft={key:1},Nt={class:"title"},Pt={class:"clear-both overflow-hidden"},Bt={class:"float-left description"},Mt={class:"float-right description"},Ot={class:"description"},Rt={class:"level"},qt={class:"level"},Vt={class:"level"},zt={key:1},Ht={class:"title"},Ut={class:"link-wrapper text-center"},At=["href"],Qt={class:"qr-wrapper ml-auto mr-auto"},Gt={class:"mt-0"},Wt={class:"description"},Yt={class:"more"};function jt(t,n,c,u,p,b){const r=l("el-col"),v=l("el-row"),h=l("el-skeleton"),$=l("font-awesome-icon"),L=l("el-button"),f=l("el-card"),D=l("el-tooltip"),q=l("el-progress"),I=l("el-divider"),S=l("el-table-column"),V=l("el-table"),z=l("copy-to-clipboard"),H=l("qr-code");return a(),_(v,{class:"panel"},{default:o(()=>[i(r,{span:24},{default:o(()=>[i(v,null,{default:o(()=>[i(r,{span:24},{default:o(()=>[e("h2",ct,s(t.$t("common.title.distribution")),1)]),_:1})]),_:1}),i(v,{gutter:15},{default:o(()=>[i(r,{md:6,xs:24},{default:o(()=>[i(f,{shadow:"hover",class:"item-mini mb-4"},{default:o(()=>{var d;return[t.loading?(a(),_(h,{key:0})):(a(),g("div",ut,[e("div",pt,[i($,{icon:"fa-solid fa-wallet",class:"icon"})]),e("div",ht,[e("p",_t,s(t.$t("distribution.title.price")),1),e("p",mt,s(t.getPriceString({value:(d=t.distributionStatus)==null?void 0:d.price})),1)]),i(L,{type:"primary",round:"",size:"small",class:"btn",onClick:t.goHistory},{default:o(()=>[y(s(t.$t("distribution.button.detail")),1)]),_:1},8,["onClick"])]))]}),_:1})]),_:1}),i(r,{md:6,xs:24},{default:o(()=>[i(f,{shadow:"hover",class:"item-mini mb-4"},{default:o(()=>{var d;return[t.loading?(a(),_(h,{key:0})):(a(),g("div",vt,[e("div",bt,[i($,{icon:"fa-solid fa-coins",class:"icon"})]),e("div",ft,[e("p",gt,s(t.$t("distribution.title.reward")),1),e("p",kt,s(t.getPriceString({value:(d=t.distributionStatus)==null?void 0:d.reward})),1)]),i(D,{effect:"dark",content:t.$t("distribution.message.developingWithDrawal"),placement:"top"},{default:o(()=>[i(L,{type:"primary",round:"",size:"small",class:"btn"},{default:o(()=>[y(s(t.$t("distribution.button.withdrawal")),1)]),_:1})]),_:1},8,["content"])]))]}),_:1})]),_:1}),i(r,{md:6,xs:24},{default:o(()=>[i(f,{shadow:"hover",class:"item-mini mb-4"},{default:o(()=>{var d,k;return[t.loading?(a(),_(h,{key:0})):(a(),g("div",wt,[e("div",yt,[i($,{icon:"fa-solid fa-percent",class:"icon"})]),e("div",$t,[e("p",Lt,s(t.$t("distribution.title.percentage")),1),e("p",St,s((k=(d=t.distributionStatus)==null?void 0:d.level)==null?void 0:k.percentage)+"%",1)])]))]}),_:1})]),_:1}),i(r,{md:6,xs:24},{default:o(()=>[i(f,{shadow:"hover",class:"item-mini mb-4"},{default:o(()=>[t.loading?(a(),_(h,{key:0})):(a(),g("div",Ct,[e("div",Dt,[i($,{icon:"fa-regular fa-user",class:"icon"})]),e("div",It,[e("p",Tt,s(t.$t("distribution.title.inviteesCount")),1),e("p",Et,s(t.inviteesCount),1)]),i(L,{type:"primary",round:"",size:"small",class:"btn",onClick:t.goInvitees},{default:o(()=>[y(s(t.$t("distribution.button.detail")),1)]),_:1},8,["onClick"])]))]),_:1})]),_:1})]),_:1}),i(v,{gutter:15},{default:o(()=>[i(r,{md:12,xs:24},{default:o(()=>[i(f,{shadow:"hover",class:"level-info mb-4"},{default:o(()=>{var d,k,T,E,F,N,P,B,M,O;return[t.loading?(a(),_(h,{key:0})):(a(),g("div",Ft,[e("h4",Nt,s(t.$t("distribution.title.levelInfo")),1),e("div",Pt,[e("div",Bt,[e("p",null,s(t.$t("distribution.title.currentLevel"))+": L"+s((k=(d=t.distributionStatus)==null?void 0:d.level)==null?void 0:k.level),1),e("p",null,s(t.$t("distribution.title.currentPercentage"))+": "+s((F=t.distributionLevelMap[(E=(T=t.distributionStatus)==null?void 0:T.level)==null?void 0:E.level])==null?void 0:F.percentage)+"% ",1)]),e("div",Mt,[e("p",null,s(t.$t("distribution.title.nextLevel"))+": L"+s(((P=(N=t.distributionStatus)==null?void 0:N.level)==null?void 0:P.level)+1),1),e("p",null,s(t.$t("distribution.title.nextPercentage"))+": "+s((O=t.distributionLevelMap[((M=(B=t.distributionStatus)==null?void 0:B.level)==null?void 0:M.level)+1])==null?void 0:O.percentage)+"% ",1)])]),i(q,{"text-inside":!0,"stroke-width":20,percentage:t.getPercentageForNextLevel(),class:"mb-2"},null,8,["percentage"]),e("p",Ot,s(t.$t("distribution.message.deltaPriceForNextLevel"))+": $"+s(t.getDeltaForNextLevel()),1),i(I),t.distributionLevels?(a(),_(V,{key:0,data:t.distributionLevels,stripe:""},{default:o(()=>[i(S,{label:t.$t("distribution.field.level")},{default:o(w=>{var m;return[e("span",Rt,"L"+s((m=w.row)==null?void 0:m.level),1)]}),_:1},8,["label"]),i(S,{label:t.$t("distribution.field.threshold")},{default:o(w=>{var m;return[e("span",qt,"$"+s((m=w.row)==null?void 0:m.threshold),1)]}),_:1},8,["label"]),i(S,{label:t.$t("distribution.field.percentage")},{default:o(w=>{var m;return[e("span",Vt,s((m=w.row)==null?void 0:m.percentage)+"%",1)]}),_:1},8,["label"])]),_:1},8,["data"])):C("v-if",!0)]))]}),_:1})]),_:1}),i(r,{md:12,xs:24},{default:o(()=>[i(f,{shadow:"hover",class:"distribution-info mb-4"},{default:o(()=>[t.loading?(a(),_(h,{key:0})):(a(),g("div",zt,[e("h4",Ht,s(t.$t("distribution.title.distributionLink")),1),i(I),e("div",Ut,[C("v-if",!0),e("a",{href:t.distributionLink,class:"link"},s(t.distributionLink),9,At),i(z,{content:t.distributionLink},null,8,["content"])]),e("div",Qt,[t.distributionLink?(a(),_(H,{key:0,value:t.distributionLink,size:180,margin:2,class:"block mb-2 ml-auto mr-auto"},null,8,["value"])):C("v-if",!0),e("p",Gt,s(t.$t("distribution.message.distributionQrDescription")),1)]),e("p",Wt,[y(s(t.$t("distribution.message.distributionLinkDescription"))+" ",1),e("span",Yt,[i(D,{effect:"dark",content:t.$t("distribution.message.distributionLinkDescription2"),placement:"top"},{default:o(()=>[y(s(t.$t("distribution.message.technicalDetail")),1)]),_:1},8,["content"])])])]))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}var ae=A(dt,[["render",jt],["__scopeId","data-v-732e1b6b"],["__file","/home/runner/work/Nexior/Nexior/src/pages/distribution/Index.vue"]]);export{ae as default};
@@ -0,0 +1 @@
1
+ import"./vendor-others.cdfefb59.js";import{ar as j}from"./vendor-fortawesome.2b54ad1b.js";import{_ as w,A as ne,K as L,F as ie,M as le,aV as re,Z as ce}from"./index.97386539.js";import{T as de,u as O,x as pe,y as T,M as me,L as ue,W as he,X as _e,m as oe,I as ge,H as fe,R as ve}from"./vendor-element-plus.1fa87efb.js";import{H as I,al as r,o,e as c,f as p,I as M,V as t,M as u,T as l,S as $,U as A,ai as E,L as D,R as g,P as U,m as $e}from"./vendor-@vue.6c0309d3.js";import{I as ye}from"./InfoIcon.b6bd8d58.js";import{A as be}from"./Status.ce9bc4cb.js";import{C as ke}from"./CopyToClipboard.dcbf7182.js";import"./vendor-markdown.cf3e96ae.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.6ab44f81.js";const we=I({name:"LayoutHeadshots",components:{ElDrawer:de,ElButton:O,FontAwesomeIcon:j},data(){return{drawer:!1}}}),Ie={class:"main"},Se={class:"config"},Te={class:"result"};function Ve(e,s,a,n,_,f){const d=r("font-awesome-icon"),h=r("el-button"),i=r("el-drawer");return o(),c("div",Ie,[p("div",Se,[M(e.$slots,"config",{},void 0,!0)]),p("div",Te,[M(e.$slots,"result",{},void 0,!0)]),t(h,{round:"",class:"menu",onClick:s[0]||(s[0]=m=>e.drawer=!0)},{default:u(()=>[t(d,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),t(i,{modelValue:e.drawer,"onUpdate:modelValue":s[1]||(s[1]=m=>e.drawer=m),"with-header":!1,size:"340px",class:"drawer"},{default:u(()=>[M(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var Ce=w(we,[["render",Ve],["__scopeId","data-v-3e896eaa"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Headshots.vue"]]);const Ae=I({name:"ImageUrlsInput",components:{ElUpload:pe,ElButton:O,InfoIcon:ye},data(){return{fileList:[],uploadUrl:ne()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>{var s;return(s=e==null?void 0:e.response)==null?void 0:s.file_url})},value:{get(){var e,s;return(s=(e=this.$store.state.headshots)==null?void 0:e.config)==null?void 0:s.image_urls},set(e){var a;const s=this.urls;this.$store.commit("headshots/setConfig",{...(a=this.$store.state.headshots)==null?void 0:a.config,image_urls:s})}}},mounted(){this.value||(this.value=void 0),this.onSetImageUrls()},methods:{onExceed(){T.warning(this.$t("headshots.message.uploadImageExceed"))},onError(){T.error(this.$t("headshots.message.uploadImageError"))},onSetImageUrls(){var s;const e=this.urls;this.$store.commit("headshots/setConfig",{...(s=this.$store.state.headshots)==null?void 0:s.config,image_urls:e})},async onSuccess(){this.onSetImageUrls()}}}),Ee={class:"field"},Pe={class:"title font-bold"},Ge={class:"upload-wrapper"};function Re(e,s,a,n,_,f){const d=r("el-button"),h=r("el-upload"),i=r("info-icon");return o(),c("div",Ee,[p("h2",Pe,l(e.$t("headshots.name.endImageUrls")),1),p("div",Ge,[t(h,{"file-list":e.fileList,"onUpdate:fileList":s[0]||(s[0]=m=>e.fileList=m),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"value","show-file-list":!0,limit:2,multiple:!0,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{default:u(()=>[t(d,{size:"small",type:"primary",round:""},{default:u(()=>[$(l(e.$t("headshots.button.uploadImageUrls")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])]),t(i,{content:e.$t("headshots.description.endImageUrls"),class:"info"},null,8,["content"])])}var Ue=w(Ae,[["render",Re],["__scopeId","data-v-69ae8722"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/config/ImageUrlsInput.vue"]]);const Ne="fast",De=I({name:"ModeSelector",components:{ElRadioButton:me,ElRadioGroup:ue},data(){return{options:[{label:this.$t("headshots.button.fast"),value:"fast"},{label:this.$t("headshots.button.relax"),value:"relax"}]}},computed:{value:{get(){var e;return(e=this.$store.state.headshots.config)==null?void 0:e.mode},set(e){console.debug("set mode",e),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots.config,mode:e})}}},mounted(){this.value||(this.value=Ne)}}),Le={class:"field"},Me={class:"title font-bold"};function je(e,s,a,n,_,f){const d=r("el-radio-button"),h=r("el-radio-group");return o(),c("div",Le,[p("h2",Me,l(e.$t("headshots.name.mode")),1),t(h,{modelValue:e.value,"onUpdate:modelValue":s[0]||(s[0]=i=>e.value=i),size:"small",class:"mode"},{default:u(()=>[(o(!0),c(A,null,E(e.options,i=>(o(),D(d,{key:i.value,label:i.value},{default:u(()=>[$(l(i.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])])}var Oe=w(De,[["render",je],["__scopeId","data-v-5ec8e3d9"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/config/ModeSelector.vue"]]);const ze=I({name:"StylizeSelector",components:{ElTabs:he,ElTabPane:_e,ElImage:oe},data(){return{tab:"styles",value:"",elements:{styles:{displayName:this.$t("headshots.styleCategory.styles"),items:[{image:"https://static.aipedias.com/aicamera/common/20241008/20241008202314260779439.png",label:this.$t("headshots.styleTag.malePportrait"),value:"male_portrait"},{image:"https://static.aipedias.com/aicamera/common/20241008/202410082022241e9755548.png",label:this.$t("headshots.styleTag.malePportrait2"),value:"male_portrait2"},{image:"https://static.aipedias.com/aicamera/common/20241101/20241101170130d78f66521.png",label:this.$t("headshots.styleTag.kindergarten"),value:"kindergarten"},{image:"https://static.aipedias.com/aicamera/common/20240923/20240923123233accf60398.webp",label:this.$t("headshots.styleTag.logoTshirt"),value:"logo_tshirt"},{image:"https://static.aipedias.com/aicamera/common/20241025/202410252012329472d0656.jpg",label:this.$t("headshots.styleTag.wedding"),value:"wedding"},{image:"https://static.aipedias.com/aicamera/common/20240915/20240915145045254931400.webp",label:this.$t("headshots.styleTag.businessPphoto"),value:"business_photo"},{image:"https://static.aipedias.com/aicamera/common/20240810/20240810194526040341795.jpg",label:this.$t("headshots.styleTag.bobSuit"),value:"bob_suit"},{image:"https://static.aipedias.com/aicamera/common/20240717/20240717152654e0b348173.webp",label:this.$t("headshots.styleTag.femalePortrait"),value:"female_portrait"}]}}}},watch:{value(e){var s;console.debug("set template",e),this.$store.commit("headshots/setConfig",{...(s=this.$store.state.headshots)==null?void 0:s.config,template:e})}},mounted(){var e;this.value||(this.value=""),console.debug("set template",this.value),this.$store.commit("headshots/setConfig",{...(e=this.$store.state.headshots)==null?void 0:e.config,template:this.value})},methods:{onToggle(e){var s;this.value===e?this.value="":this.value=e,console.debug("set template",this.value),this.$store.commit("headshots/setConfig",{...(s=this.$store.state.headshots)==null?void 0:s.config,template:this.value})}}}),Be={class:"field"},He=["onClick"],qe={class:"name"};function Fe(e,s,a,n,_,f){const d=r("el-image"),h=r("el-tab-pane"),i=r("el-tabs");return o(),c("div",Be,[g(` <h2 class="title">{{ $t('headshots.field.elements') }}</h2> `),t(i,{modelValue:e.tab,"onUpdate:modelValue":s[0]||(s[0]=m=>e.tab=m)},{default:u(()=>[(o(!0),c(A,null,E(e.elements,(m,v)=>(o(),D(h,{key:v,label:m.displayName,name:v,class:"pane"},{default:u(()=>[(o(!0),c(A,null,E(m.items,(k,V)=>(o(),c("div",{key:V,class:U({item:!0,active:e.value===k.value}),onClick:C=>e.onToggle(k.value)},[t(d,{src:k.image,fit:"fill",class:"preview"},null,8,["src"]),p("span",qe,l(k.label),1)],10,He))),128))]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])])}var Ke=w(ze,[["render",Fe],["__scopeId","data-v-7e0125ad"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/config/ElementsSelector.vue"]]);const We=I({name:"PresetPanel",components:{ModeSelector:Oe,ImageUrlsInput:Ue,ElButton:O,FontAwesomeIcon:j,ElementsSelector:Ke},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.headshots)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),Xe={class:"panel"},Ze={class:"config"},Je={class:"actions"};function Qe(e,s,a,n,_,f){const d=r("elements-selector"),h=r("mode-selector"),i=r("image-urls-input"),m=r("font-awesome-icon"),v=r("el-button");return o(),c("div",Xe,[p("div",Ze,[t(d,{class:"mb-4"}),t(h,{class:"mb-4"}),t(i,{class:"mb-4"}),p("div",Je,[t(v,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:u(()=>[t(m,{icon:"fa-solid fa-magic",class:"mr-2"}),$(" "+l(e.$t("headshots.button.generate")),1)]),_:1},8,["onClick"])])])])}var Ye=w(We,[["render",Qe],["__scopeId","data-v-6a264fac"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/ConfigPanel.vue"]]);const xe=I({name:"ImageGallery",props:{modelValue:{type:Object,required:!0}},setup(e){return{images:$e(()=>{var n,_,f;return((f=(_=(n=e.modelValue)==null?void 0:n.response)==null?void 0:_.data)==null?void 0:f.slice(0,2))||[]}),viewImage:n=>{window.open(n,"_blank")}}}}),es={class:"image-gallery"},ss=["src"],ts=["onClick"];function as(e,s,a,n,_,f){return o(),c("div",es,[(o(!0),c(A,null,E(e.images,(d,h)=>(o(),c("div",{key:h,class:"image-container"},[p("img",{src:d.image_url,alt:"Image"},null,8,ss),d.image_url?(o(),c("button",{key:0,class:"view-button",onClick:i=>e.viewImage(d.image_url)},l(e.$t("headshots.button.viewImage")),9,ts)):g("v-if",!0)]))),128))])}var os=w(xe,[["render",as],["__scopeId","data-v-0187109d"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/ImageGallery.vue"]]);const ns=I({name:"TaskPreview",components:{ElImage:oe,CopyToClipboard:ke,FontAwesomeIcon:j,ElAlert:ge,ImageGallery:os},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){var e;return(e=this.$store.state.headshots)==null?void 0:e.application},config(){var e;return(e=this.$store.state.headshots)==null?void 0:e.config}},methods:{onDownload(e,s){e.stopPropagation(),console.log("on download"),window.open(s,"_blank")},onReload(e){const s=e.target,a=new URL(s.src),n=a.searchParams.get("retry");if(!n)a.searchParams.set("retry","1");else if(parseInt(n)<2)a.searchParams.set("retry",(parseInt(n)+1).toString());else return;s.src=a.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),is={class:"preview"},ls={class:"left"},rs={class:"main"},cs={class:"bot"},ds={class:"datetime"},ps={class:"info"},ms={key:0,class:"prompt mt-2"},us={key:0},hs={key:1},_s={key:0,class:U({content:!0,failed:!0})},gs={class:"image-wrapper"},fs={class:"description"},vs={key:1,class:U({content:!0})},$s={class:"description"},ys={class:"description"},bs={class:"description"},ks={key:2,class:U({content:!0})},ws={class:"description"},Is={key:3,class:U({content:!0})},Ss={class:"description"};function Ts(e,s,a,n,_,f){var k,V,C,P,G,R,S,N,z,B,H,q,F,K,W;const d=r("el-image"),h=r("image-gallery"),i=r("font-awesome-icon"),m=r("copy-to-clipboard"),v=r("el-alert");return o(),c("div",is,[p("div",ls,[t(d,{src:"https://cdn.acedata.cloud/isxyfw.png",class:"avatar"})]),p("div",rs,[p("div",cs,[$(l(e.$t("headshots.name.headshotsBot"))+" ",1),p("span",ds,l(e.$dayjs.format(""+new Date(parseFloat(((k=e.modelValue)==null?void 0:k.created_at)||"")*1e3))),1)]),p("div",ps,[(C=(V=e.modelValue)==null?void 0:V.request)!=null&&C.template?(o(),c("p",ms,[$(l((G=(P=e.modelValue)==null?void 0:P.request)==null?void 0:G.template)+" ",1),(R=e.modelValue)!=null&&R.response?g("v-if",!0):(o(),c("span",us," - ("+l(e.$t("headshots.status.pending"))+") ",1)),((N=(S=e.modelValue)==null?void 0:S.response)==null?void 0:N.status)==="unknown"?(o(),c("span",hs," - ("+l(e.$t("headshots.status.processing"))+") ",1)):g("v-if",!0)])):g("v-if",!0)]),g(" Display success message "),((B=(z=e.modelValue)==null?void 0:z.response)==null?void 0:B.success)===!0?(o(),c("div",_s,[p("div",gs,[t(h,{"model-value":e.modelValue},null,8,["model-value"])]),t(v,{closable:!1,class:"mt-2 success"},{default:u(()=>{var y,b;return[p("p",fs,[t(i,{icon:"fa-solid fa-magic",class:"mr-1"}),$(" "+l(e.$t("headshots.name.taskId"))+": "+l((y=e.modelValue)==null?void 0:y.id)+" ",1),t(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):g("v-if",!0),g(" Display error message "),((q=(H=e.modelValue)==null?void 0:H.response)==null?void 0:q.success)===!1?(o(),c("div",vs,[t(v,{closable:!1,class:"failure"},{template:u(()=>[t(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),$(" "+l(e.$t("headshots.name.failure")),1)]),default:u(()=>{var y,b,X,Z,J,Q,Y,x,ee,se,te,ae;return[p("p",$s,[t(i,{icon:"fa-solid fa-magic",class:"mr-1"}),$(" "+l(e.$t("headshots.name.taskId"))+": "+l((y=e.modelValue)==null?void 0:y.id)+" ",1),t(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])]),p("p",ys,[t(i,{icon:"fa-solid fa-circle-info",class:"mr-1"}),$(" "+l(e.$t("headshots.name.failureReason"))+": "+l((J=(Z=(X=e.modelValue)==null?void 0:X.response)==null?void 0:Z.error)==null?void 0:J.message)+" ",1),t(m,{content:(x=(Y=(Q=e.modelValue)==null?void 0:Q.response)==null?void 0:Y.error)==null?void 0:x.message,class:"btn-copy"},null,8,["content"])]),p("p",bs,[t(i,{icon:"fa-solid fa-hashtag",class:"mr-1"}),$(" "+l(e.$t("headshots.name.traceId"))+": "+l((se=(ee=e.modelValue)==null?void 0:ee.response)==null?void 0:se.trace_id)+" ",1),t(m,{content:(ae=(te=e.modelValue)==null?void 0:te.response)==null?void 0:ae.trace_id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):g("v-if",!0),g(" Display error message "),(F=e.modelValue)!=null&&F.response?g("v-if",!0):(o(),c("div",ks,[t(v,{closable:!1,class:"info"},{template:u(()=>[t(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),$(" "+l(e.$t("headshots.name.failure")),1)]),default:u(()=>{var y,b;return[p("p",ws,[t(i,{icon:"fa-solid fa-magic",class:"mr-1"}),$(" "+l(e.$t("headshots.name.taskId"))+": "+l((y=e.modelValue)==null?void 0:y.id)+" ",1),t(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])),((W=(K=e.modelValue)==null?void 0:K.response)==null?void 0:W.status)==="unknown"?(o(),c("div",Is,[t(v,{closable:!1,class:"info"},{template:u(()=>[t(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),$(" "+l(e.$t("headshots.name.failure")),1)]),default:u(()=>{var y,b;return[p("p",Ss,[t(i,{icon:"fa-solid fa-magic",class:"mr-1"}),$(" "+l(e.$t("headshots.name.taskId"))+": "+l((y=e.modelValue)==null?void 0:y.id)+" ",1),t(m,{content:(b=e.modelValue)==null?void 0:b.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):g("v-if",!0)])])}var Vs=w(ns,[["render",Ts],["__scopeId","data-v-43e1feb8"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/task/Preview.vue"]]);const Cs=I({name:"RecentPanel",components:{TaskPreview:Vs,ElSkeleton:fe,ElSkeletonItem:ve},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){var e,s,a,n;return{...(e=this.$store.state.headshots)==null?void 0:e.tasks,items:(n=(a=(s=this.$store.state.headshots)==null?void 0:s.tasks)==null?void 0:a.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")}}}),As={key:0,class:"tasks"},Es={class:"left"},Ps={class:"main"},Gs={key:1,class:"tasks"},Rs={key:2,class:"description"};function Us(e,s,a,n,_,f){var m,v,k,V,C,P,G,R;const d=r("el-skeleton-item"),h=r("el-skeleton"),i=r("task-preview");return o(),c("div",{ref:"panel",class:"panel recent",onScroll:s[0]||(s[0]=(...S)=>e.onHandleScroll&&e.onHandleScroll(...S))},[((m=e.tasks)==null?void 0:m.items)===void 0?(o(),c("div",As,[(o(),c(A,null,E(3,S=>p("div",{key:S,class:"task placeholder"},[p("div",Es,[t(h,{animated:""},{template:u(()=>[t(d,{variant:"image",class:"avatar"})]),_:1})]),p("div",Ps,[t(h,{animated:""},{template:u(()=>[t(d,{variant:"p",class:"title"}),t(d,{variant:"image",class:"icon"})]),_:1})])])),64))])):((k=(v=e.tasks)==null?void 0:v.items)==null?void 0:k.length)&&((C=(V=e.tasks)==null?void 0:V.items)==null?void 0:C.length)>0?(o(),c("div",Gs,[(o(!0),c(A,null,E((P=e.tasks)==null?void 0:P.items,(S,N)=>(o(),D(i,{key:N,"model-value":S,class:"preview"},null,8,["model-value"]))),128))])):g("v-if",!0),((R=(G=e.tasks)==null?void 0:G.items)==null?void 0:R.length)===0?(o(),c("p",Rs,l(e.$t("headshots.message.noTasks")),1)):g("v-if",!0)],544)}var Ns=w(Cs,[["render",Us],["__scopeId","data-v-37920e9a"],["__file","/home/runner/work/Nexior/Nexior/src/components/headshots/RecentPanel.vue"]]);const Ds="https://webhook.acedata.cloud/headshots",Ls=I({name:"HeadshotsIndex",components:{ConfigPanel:Ye,Layout:Ce,ApplicationStatus:be,RecentPanel:Ns},data(){return{task:void 0,job:0,timer:void 0}},computed:{loading(){var e,s;return((s=(e=this.$store.state.headshots)==null?void 0:e.status)==null?void 0:s.getApplications)===L.Request},service(){return this.$store.state.headshots.service},credential(){return this.$store.state.headshots.credential},config(){return this.$store.state.headshots.config},initializing(){return this.$store.state.headshots.status.getApplications===L.Request},needApply(){return this.$store.state.headshots.status.getApplications===L.Success&&!this.application},application(){return this.$store.state.headshots.application},applications(){return this.$store.state.headshots.applications},tasks(){return this.$store.state.headshots.tasks}},watch:{tasks:{handler(e,s){var a,n;((a=e==null?void 0:e.items)==null?void 0:a.length)>((n=s==null?void 0:s.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,s,a;console.debug("reached top"),await this.onGetTasks({createdAtMax:(a=(s=(e=this.tasks)==null?void 0:e.items)==null?void 0:s[0])==null?void 0:a.created_at})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("headshots/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("headshots/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){ie.create({application:this.application}).then(({data:e})=>{this.application=e,T.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{var s,a;((a=(s=e==null?void 0:e.response)==null?void 0:s.data)==null?void 0:a.code)===le&&T.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".recent");e&&(e.scrollTop=e.scrollHeight)},500)},async onGetTasks(e){if(this.loading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:s=5,createdAtMin:a,createdAtMax:n}=e||{};console.debug("limit",s,"createdAtMin",a,"createdAtMax",n),await this.$store.dispatch("headshots/getTasks",{limit:s,createdAtMin:a,createdAtMax:n})},async onGeneratePicture(){var a;const e={...this.config,callback_url:Ds},s=(a=this.credential)==null?void 0:a.token;if(!s){console.error("no token specified");return}T.info(this.$t("headshots.message.startingTask")),re.generate(e,{token:s}).then(()=>{T.success(this.$t("headshots.message.startTaskSuccess")),this.$store.commit("headshots/setConfig",{config:void 0})}).catch(n=>{var f,d;const _=(f=n==null?void 0:n.response)==null?void 0:f.data;((d=_==null?void 0:_.error)==null?void 0:d.code)===ce?T.error(this.$t("headshots.message.usedUp")):T.error(this.$t("headshots.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function Ms(e,s,a,n,_,f){const d=r("config-panel"),h=r("application-status"),i=r("recent-panel"),m=r("layout");return o(),D(m,null,{config:u(()=>[t(d,{onGenerate:e.onGeneratePicture},null,8,["onGenerate"])]),result:u(()=>[t(h,{initializing:e.initializing,application:e.application,applications:e.applications,service:e.service,"need-apply":e.needApply,class:"mb-4",onRefresh:e.onGetApplication,onSelect:s[0]||(s[0]=v=>e.$store.dispatch("headshots/setApplication",v))},null,8,["initializing","application","applications","service","need-apply","onRefresh"]),t(i,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"]),g(' <operation-panel class="panel operation" @generate="onGenerate" /> ')]),_:1})}var Js=w(Ls,[["render",Ms],["__scopeId","data-v-62da1b28"],["__file","/home/runner/work/Nexior/Nexior/src/pages/headshots/Index.vue"]]);export{Js as default};
@@ -1 +1 @@
1
- import{an as Ve}from"./vendor-others.cdfefb59.js";import{ar as z}from"./vendor-fortawesome.2b54ad1b.js";import{_ as y,aL as Se,aM as Ee,aN as Ne,aO as Pe,A as ye,aP as Te,K as H,F as Ce,M as Re,aQ as Le,Z as Ue}from"./index.60bb4e0a.js";import{T as Ae,u as B,N as Z,O as J,x as be,y as E,U as De,V as Ge,t as we,m as Me,I as Oe,s as je,H as Fe,R as qe}from"./vendor-element-plus.1fa87efb.js";import{H as b,al as n,o as l,e as p,f as a,I as Q,V as o,M as _,T as c,U,ai as A,L,P as D,a0 as ze,S as k,R as $}from"./vendor-@vue.6c0309d3.js";import{I as K}from"./InfoIcon.5a350f1f.js";import{I as Ie}from"./ImagePreview.d6abc713.js";import{C as Be}from"./CopyToClipboard.2d20734e.js";import"./vendor-markdown.cf3e96ae.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.6ab44f81.js";const Ke=b({name:"LayoutKling",components:{ElDrawer:Ae,ElButton:B,FontAwesomeIcon:z},data(){return{drawer:!1}}}),He={class:"main"},Qe={class:"config"},Ze={class:"result"};function Je(e,t,s,d,g,f){const i=n("font-awesome-icon"),u=n("el-button"),r=n("el-drawer");return l(),p("div",He,[a("div",Qe,[Q(e.$slots,"config",{},void 0,!0)]),a("div",Ze,[Q(e.$slots,"result",{},void 0,!0)]),o(u,{round:"",class:"menu",onClick:t[0]||(t[0]=v=>e.drawer=!0)},{default:_(()=>[o(i,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),o(r,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=v=>e.drawer=v),"with-header":!1,size:"340px",class:"drawer"},{default:_(()=>[Q(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var We=y(Ke,[["render",Je],["__scopeId","data-v-50bc0f32"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Kling.vue"]]);const Xe=b({name:"ModelSelector",components:{ElSelect:Z,ElOption:J},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{options:[{value:"kling-v1",label:"V1"},{value:"kling-v1-5",label:"V1.5"},{value:"kling-v1-6",label:"V1.6"}]}},computed:{value:{get(){var e,t;return(t=(e=this.$store.state.kling)==null?void 0:e.config)==null?void 0:t.model},set(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,model:e})}}},mounted(){this.value||(this.value=Se)}}),Ye={class:"field"},xe={class:"title font-bold"};function et(e,t,s,d,g,f){const i=n("el-option"),u=n("el-select");return l(),p("div",Ye,[a("h2",xe,c(e.$t("pika.name.model")),1),o(u,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=r=>e.value=r),class:"value",placeholder:e.$t("pika.placeholder.select")},{default:_(()=>[(l(!0),p(U,null,A(e.options,r=>(l(),L(i,{key:r.value,label:r.label,value:r.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}var tt=y(Xe,[["render",et],["__scopeId","data-v-13cacdf9"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/config/ModelSelector.vue"]]);const ot=b({name:"ModeSelector",components:{ElSelect:Z,ElOption:J},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{options:[{value:"std",label:"\u6807\u51C6"},{value:"pro",label:"\u9AD8\u901F"}]}},computed:{value:{get(){var e,t;return(t=(e=this.$store.state.kling)==null?void 0:e.config)==null?void 0:t.mode},set(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,mode:e})}}},mounted(){this.value||(this.value=Ee)}}),st={class:"field"},nt={class:"title font-bold"};function at(e,t,s,d,g,f){const i=n("el-option"),u=n("el-select");return l(),p("div",st,[a("h2",nt,c(e.$t("kling.name.mode")),1),o(u,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=r=>e.value=r),class:"value",placeholder:e.$t("kling.placeholder.select")},{default:_(()=>[(l(!0),p(U,null,A(e.options,r=>(l(),L(i,{key:r.value,label:r.label,value:r.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}var lt=y(ot,[["render",at],["__scopeId","data-v-3af5203e"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/config/ModeSelector.vue"]]);const it=b({name:"DurationSelector",components:{ElSelect:Z,ElOption:J},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{options:[{value:5,label:"5\u79D2"},{value:10,label:"10\u79D2"}]}},computed:{value:{get(){var e,t;return(t=(e=this.$store.state.kling)==null?void 0:e.config)==null?void 0:t.duration},set(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,duration:e})}}},mounted(){this.value||(this.value=Ne)}}),rt={class:"field"},ct={class:"title font-bold"};function dt(e,t,s,d,g,f){const i=n("el-option"),u=n("el-select");return l(),p("div",rt,[a("h2",ct,c(e.$t("kling.name.duration")),1),o(u,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=r=>e.value=r),class:"value",placeholder:e.$t("kling.placeholder.select")},{default:_(()=>[(l(!0),p(U,null,A(e.options,r=>(l(),L(i,{key:r.value,label:r.label,value:r.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}var pt=y(it,[["render",dt],["__scopeId","data-v-6434f6d2"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/config/DurationSelector.vue"]]);const ut=b({name:"RatioSelector",data(){return{options:[{value:"1:1",label:"1:1",width:20,height:20},{value:"16:9",label:"16:9",width:25,height:13},{value:"9:16",label:"9:16",width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){var e,t,s;return(s=(t=(e=this.$store.state)==null?void 0:e.kling)==null?void 0:t.config)==null?void 0:s.aspect_ratio},set(e){var t,s;console.debug("set ratio",e),this.$store.commit("kling/setConfig",{...(s=(t=this.$store.state)==null?void 0:t.kling)==null?void 0:s.config,aspect_ratio:e})}}},mounted(){this.value||(this.value=Pe)}}),mt={class:"text-sm font-bold mb-2 block"},_t={class:"items"},gt=["onClick"],ft={class:"name"};function vt(e,t,s,d,g,f){return l(),p("div",null,[a("span",mt,c(e.$t("kling.name.ratio")),1),a("div",_t,[(l(!0),p(U,null,A(e.options,(i,u)=>(l(),p("div",{key:u,class:D({active:e.active===u,item:!0}),onClick:r=>e.value=i.value},[a("div",{class:D(["preview",i.label])},[a("div",{class:"rect",style:ze({width:i.width+"px",height:i.height+"px"})},null,4)],2),a("p",ft,c(i.label),1)],10,gt))),128))])])}var ht=y(ut,[["render",vt],["__scopeId","data-v-41d8dfdb"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/config/RatioSelector.vue"]]);const $t=b({name:"StartImage",components:{ElUpload:be,ElButton:B,InfoIcon:K,FontAwesomeIcon:z,ImagePreview:Ie},emits:["change"],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,s;return(s=(t=(e=this.$store.state)==null?void 0:e.kling)==null?void 0:t.config)==null?void 0:s.start_image_url},set(e){}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){E.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){E.error(this.$t("kling.message.uploadReferencesError"))},onSetStartImageUrl(){var t,s,d;const e=(t=this.urls)==null?void 0:t[0];this.$store.commit("kling/setConfig",{...(d=(s=this.$store.state)==null?void 0:s.kling)==null?void 0:d.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),kt={class:"relative"},yt={class:"flex justify-between"},bt={class:"flex justify-start items-center"},wt={class:"text-sm font-bold"};function It(e,t,s,d,g,f){const i=n("info-icon"),u=n("image-preview"),r=n("font-awesome-icon"),v=n("el-button"),h=n("el-upload");return l(),p("div",kt,[a("div",yt,[a("div",bt,[a("span",wt,c(e.$t("kling.name.startImage")),1),o(i,{content:e.$t("kling.description.uploadStartImage")},null,8,["content"])])]),o(h,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=m=>e.fileList=m),name:"file",limit:5,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:_(({file:m})=>{var w;return[o(u,{url:m.url||((w=m.response)==null?void 0:w.file_url),name:m.name,percentage:m.percentage,onRemove:N=>e.fileList.splice(e.fileList.indexOf(m),1)},null,8,["url","name","percentage","onRemove"])]}),default:_(()=>[o(v,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:_(()=>[o(r,{icon:"fa-solid fa-upload",class:"icon mr-1"}),k(" "+c(e.$t("kling.button.uploadReferences")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}var Vt=y($t,[["render",It],["__scopeId","data-v-6e6084d0"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/config/StartImage.vue"]]);const St=b({name:"EndImage",components:{ElUpload:be,ElButton:B,ImagePreview:Ie,InfoIcon:K,FontAwesomeIcon:z},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,s;return(s=(t=(e=this.$store.state)==null?void 0:e.kling)==null?void 0:t.config)==null?void 0:s.start_image_url},set(e){}}},mounted(){this.value||(this.value=void 0),this.onSetEndImageUrl()},methods:{onExceed(){E.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){E.error(this.$t("kling.message.uploadReferencesError"))},onSetEndImageUrl(){var t,s;const e=(t=this.urls)==null?void 0:t[0];this.$store.commit("kling/setConfig",{...(s=this.$store.state.kling)==null?void 0:s.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),Et={class:"relative"},Nt={class:"flex justify-between"},Pt={class:"flex justify-start items-center"},Tt={class:"text-sm font-bold"};function Ct(e,t,s,d,g,f){const i=n("info-icon"),u=n("image-preview"),r=n("font-awesome-icon"),v=n("el-button"),h=n("el-upload");return l(),p("div",Et,[a("div",Nt,[a("div",Pt,[a("span",Tt,c(e.$t("kling.name.endImage")),1),o(i,{content:e.$t("kling.description.uploadEndImage")},null,8,["content"])])]),o(h,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=m=>e.fileList=m),name:"file",limit:5,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:_(({file:m})=>{var w;return[o(u,{url:m.url||((w=m.response)==null?void 0:w.file_url),name:m.name,percentage:m.percentage,onRemove:N=>e.fileList.splice(e.fileList.indexOf(m),1)},null,8,["url","name","percentage","onRemove"])]}),default:_(()=>[o(v,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:_(()=>[o(r,{icon:"fa-solid fa-upload",class:"icon mr-1"}),k(" "+c(e.$t("kling.button.uploadReferences")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}var Rt=y(St,[["render",Ct],["__scopeId","data-v-72a21eff"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/config/EndImage.vue"]]);const Lt=b({name:"CfgScaleSelector",components:{ElSlider:De,InfoIcon:K,ElInputNumber:Ge},computed:{value:{get(){var e,t,s;return(s=(t=(e=this.$store.state)==null?void 0:e.kling)==null?void 0:t.config)==null?void 0:s.cfg_scale},set(e){var t,s;console.debug("set cfg_scale",e),this.$store.commit("kling/setConfig",{...(s=(t=this.$store.state)==null?void 0:t.kling)==null?void 0:s.config,cfg_scale:e})}}},mounted(){this.value||(this.value=Te)}}),Ut={class:"flex justify-between"},At={class:"flex justify-start items-center"},Dt={class:"text-sm font-bold"},Gt={class:"flex justify-end items-center"},Mt={class:"w-full"};function Ot(e,t,s,d,g,f){const i=n("info-icon"),u=n("el-input-number"),r=n("el-slider");return l(),p("div",null,[a("div",Ut,[a("div",At,[a("span",Dt,c(e.$t("kling.name.cfgScale")),1),o(i,{content:e.$t("kling.description.cfgScale")},null,8,["content"])]),a("div",Gt,[o(u,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=v=>e.value=v),"controls-position":"right"},null,8,["modelValue"])])]),a("div",Mt,[o(r,{modelValue:e.value,"onUpdate:modelValue":t[1]||(t[1]=v=>e.value=v),min:0,max:1,step:.1},null,8,["modelValue"])])])}var jt=y(Lt,[["render",Ot],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/config/CfgScaleSelector.vue"]]);const Ft="",qt=b({name:"PromptInput",components:{ElInput:we,InfoIcon:K},computed:{prompt:{get(){var e,t;return(t=(e=this.$store.state.kling)==null?void 0:e.config)==null?void 0:t.prompt},set(e){var t;console.debug("set prompt",e),this.$store.commit("kling/setConfig",{...(t=this.$store.state.kling)==null?void 0:t.config,prompt:e})}}},mounted(){this.value||(this.value=Ft)}}),zt={class:"field"},Bt={class:"box"},Kt={class:"title font-bold"};function Ht(e,t,s,d,g,f){const i=n("info-icon"),u=n("el-input");return l(),p("div",zt,[a("div",Bt,[a("h2",Kt,c(e.$t("kling.name.prompt")),1),o(i,{content:e.$t("kling.description.prompt"),class:"info"},null,8,["content"])]),o(u,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=r=>e.prompt=r),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.prompt"),maxlength:500,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var Qt=y(qt,[["render",Ht],["__scopeId","data-v-fd830852"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/config/PromptInput.vue"]]);const Zt="",Jt=b({name:"NegativePromptInput",components:{ElInput:we,InfoIcon:K},computed:{prompt:{get(){var e,t;return(t=(e=this.$store.state.kling)==null?void 0:e.config)==null?void 0:t.negative_prompt},set(e){var t;console.debug("set prompt",e),this.$store.commit("kling/setConfig",{...(t=this.$store.state.kling)==null?void 0:t.config,negative_prompt:e})}}},mounted(){this.value||(this.value=Zt)}}),Wt={class:"field"},Xt={class:"box"},Yt={class:"title font-bold"};function xt(e,t,s,d,g,f){const i=n("info-icon"),u=n("el-input");return l(),p("div",Wt,[a("div",Xt,[a("h2",Yt,c(e.$t("kling.name.negativePrompt")),1),o(i,{content:e.$t("kling.description.negativePrompt"),class:"info"},null,8,["content"])]),o(u,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=r=>e.prompt=r),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.negativePrompt"),maxlength:200,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var eo=y(Jt,[["render",xt],["__scopeId","data-v-6c3d0de2"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/config/NegativePromptInput.vue"]]);const to=b({name:"PresetPanel",components:{ElButton:B,FontAwesomeIcon:z,PromptInput:Qt,NegativePromptInput:eo,ModelSelector:tt,ModeSelector:lt,DurationSelector:pt,RatioSelector:ht,StartImage:Vt,CfgScaleSelector:jt,EndImage:Rt},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.kling)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),oo={class:"panel"},so={class:"config"},no={class:"actions"};function ao(e,t,s,d,g,f){var I,R;const i=n("prompt-input"),u=n("model-selector"),r=n("mode-selector"),v=n("ratio-selector"),h=n("start-image"),m=n("end-image"),w=n("cfg-scale-selector"),N=n("duration-selector"),C=n("negative-prompt-input"),P=n("font-awesome-icon"),T=n("el-button");return l(),p("div",oo,[a("div",so,[o(i,{class:"mb-4"}),o(u,{class:"mb-4"}),o(r,{class:"mb-4"}),o(v,{class:"mb-4"}),o(h,{class:"mb-2"}),o(m,{class:"mb-2"}),o(w,{class:"mb-4"}),o(N,{class:"mb-4"}),o(C,{class:"mb-4"}),a("div",no,[((I=e.config)==null?void 0:I.video_url)!==void 0||((R=e.config)==null?void 0:R.custom)?(l(),L(T,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:_(()=>[o(P,{icon:"fa-solid fa-magic",class:"mr-2"}),k(" "+c(e.$t("kling.button.extend")),1)]),_:1},8,["onClick"])):(l(),L(T,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:_(()=>[o(P,{icon:"fa-solid fa-magic",class:"mr-2"}),k(" "+c(e.$t("kling.button.generate")),1)]),_:1},8,["onClick"]))])])])}var lo=y(to,[["render",ao],["__scopeId","data-v-301363b4"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/ConfigPanel.vue"]]);const io=b({name:"VideoPlayer",components:{VuePlyr:Ve},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:"1080p"}}}}}),ro={controls:"",crossorigin:"",playsinline:""},co=["src"];function po(e,t,s,d,g,f){const i=n("vue-plyr");return l(),p("div",null,[o(i,{options:e.options,class:"video"},{default:_(()=>{var u;return[a("video",ro,[a("source",{size:"1080",src:(u=e.modelValue)==null?void 0:u.video_url,type:"video/mp4"},null,8,co)])]}),_:1},8,["options"])])}var uo=y(io,[["render",po],["__scopeId","data-v-3fd1ea0e"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/VideoPlayer.vue"]]);const mo=b({name:"TaskPreview",components:{ElImage:Me,CopyToClipboard:Be,FontAwesomeIcon:z,ElAlert:Oe,VideoPlayer:uo,ElTooltip:je,ElButton:B},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){var e;return(e=this.$store.state.kling)==null?void 0:e.application},config(){var e;return(e=this.$store.state.kling)==null?void 0:e.config}},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),d=s.searchParams.get("retry");if(!d)s.searchParams.set("retry","1");else if(parseInt(d)<2)s.searchParams.set("retry",(parseInt(d)+1).toString());else return;t.src=s.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),_o={class:"preview"},go={class:"left"},fo={class:"main"},vo={class:"bot"},ho={class:"datetime"},$o={class:"info"},ko={key:0,class:"prompt mt-2"},yo={key:0},bo={key:1},wo={key:0,class:D({content:!0,failed:!0})},Io={class:"image-wrapper"},Vo={key:0,class:D({operations:!0,"mt-2":!0})},So={class:"description"},Eo={key:1,class:D({content:!0})},No={class:"description"},Po={class:"description"},To={key:0,class:"description"},Co={key:2,class:D({content:!0})},Ro={class:"description"},Lo={key:0,class:"description"};function Uo(e,t,s,d,g,f){var N,C,P,T,I,R,W,X,Y,x,ee,te,oe,se,ne,ae,le,ie,re,ce,de,pe,ue,me,_e;const i=n("el-image"),u=n("VideoPlayer"),r=n("el-button"),v=n("el-tooltip"),h=n("font-awesome-icon"),m=n("copy-to-clipboard"),w=n("el-alert");return l(),p("div",_o,[a("div",go,[o(i,{src:"https://cdn.acedata.cloud/qpbbbb.jpg",class:"avatar"})]),a("div",fo,[a("div",vo,[k(c(e.$t("kling.name.klingBot"))+" ",1),a("span",ho,c(e.$dayjs.format(""+new Date(parseFloat(((N=e.modelValue)==null?void 0:N.created_at)||"")*1e3))),1)]),a("div",$o,[(P=(C=e.modelValue)==null?void 0:C.request)!=null&&P.prompt?(l(),p("p",ko,[k(c((I=(T=e.modelValue)==null?void 0:T.request)==null?void 0:I.prompt)+" ",1),(R=e.modelValue)!=null&&R.response?$("v-if",!0):(l(),p("span",yo," - ("+c(e.$t("kling.status.pending"))+") ",1)),((X=(W=e.modelValue)==null?void 0:W.response)==null?void 0:X.state)==="submitted"||((x=(Y=e.modelValue)==null?void 0:Y.response)==null?void 0:x.state)==="processing"||((te=(ee=e.modelValue)==null?void 0:ee.response)==null?void 0:te.state)==="pending"||((se=(oe=e.modelValue)==null?void 0:oe.response)==null?void 0:se.state)==="completed"?(l(),p("span",bo," - ("+c(e.$t("kling.status.processing"))+") ",1)):$("v-if",!0)])):$("v-if",!0)]),$(" Display success message "),((ae=(ne=e.modelValue)==null?void 0:ne.response)==null?void 0:ae.success)===!0?(l(),p("div",wo,[a("div",Io,[o(u,{"model-value":(le=e.modelValue)==null?void 0:le.response},null,8,["model-value"])]),(ie=e.modelValue)!=null&&ie.response.success?(l(),p("div",Vo,[o(v,{class:"box-item",effect:"dark",content:e.$t("kling.message.downloadVideo"),placement:"top-start"},{default:_(()=>[o(r,{type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=S=>{var V;return e.onDownload(S,(V=e.modelValue)==null?void 0:V.response.video_url)})},{default:_(()=>[k(c(e.$t("kling.button.download")),1)]),_:1})]),_:1},8,["content"])])):$("v-if",!0),o(w,{closable:!1,class:"mt-2 success"},{default:_(()=>{var S,V;return[a("p",So,[o(h,{icon:"fa-solid fa-magic",class:"mr-1"}),k(" "+c(e.$t("kling.name.taskId"))+": "+c((S=e.modelValue)==null?void 0:S.id)+" ",1),o(m,{content:(V=e.modelValue)==null?void 0:V.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):$("v-if",!0),$(" Display error message "),((ce=(re=e.modelValue)==null?void 0:re.response)==null?void 0:ce.success)===!1?(l(),p("div",Eo,[o(w,{closable:!1,class:"failure"},{template:_(()=>[o(h,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),k(" "+c(e.$t("kling.name.failure")),1)]),default:_(()=>{var S,V,G,M,O,j,F,q,ge,fe,ve,he,$e,ke;return[a("p",No,[o(h,{icon:"fa-solid fa-magic",class:"mr-1"}),k(" "+c(e.$t("kling.name.taskId"))+": "+c((S=e.modelValue)==null?void 0:S.id)+" ",1),o(m,{content:(V=e.modelValue)==null?void 0:V.id,class:"btn-copy"},null,8,["content"])]),a("p",Po,[o(h,{icon:"fa-solid fa-circle-info",class:"mr-1"}),k(" "+c(e.$t("kling.name.failureReason"))+": "+c((O=(M=(G=e.modelValue)==null?void 0:G.response)==null?void 0:M.error)==null?void 0:O.message)+" ",1),o(m,{content:(q=(F=(j=e.modelValue)==null?void 0:j.response)==null?void 0:F.error)==null?void 0:q.message,class:"btn-copy"},null,8,["content"])]),(fe=(ge=e.modelValue)==null?void 0:ge.response)!=null&&fe.trace_id?(l(),p("p",To,[o(h,{icon:"fa-solid fa-hashtag",class:"mr-1"}),k(" "+c(e.$t("kling.name.traceId"))+": "+c((he=(ve=e.modelValue)==null?void 0:ve.response)==null?void 0:he.trace_id)+" ",1),o(m,{content:(ke=($e=e.modelValue)==null?void 0:$e.response)==null?void 0:ke.trace_id,class:"btn-copy"},null,8,["content"])])):$("v-if",!0)]}),_:1})])):$("v-if",!0),$(" Display error message "),!((de=e.modelValue)!=null&&de.response)||((ue=(pe=e.modelValue)==null?void 0:pe.response)==null?void 0:ue.state)==="processing"||((_e=(me=e.modelValue)==null?void 0:me.response)==null?void 0:_e.state)==="pending"?(l(),p("div",Co,[o(w,{closable:!1,class:"info"},{template:_(()=>[o(h,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),k(" "+c(e.$t("kling.name.failure")),1)]),default:_(()=>{var S,V,G,M,O,j,F,q;return[a("p",Ro,[o(h,{icon:"fa-solid fa-magic",class:"mr-1"}),k(" "+c(e.$t("kling.name.taskId"))+": "+c((S=e.modelValue)==null?void 0:S.id)+" ",1),o(m,{content:(V=e.modelValue)==null?void 0:V.id,class:"btn-copy"},null,8,["content"])]),(M=(G=e.modelValue)==null?void 0:G.response)!=null&&M.trace_id?(l(),p("p",Lo,[o(h,{icon:"fa-solid fa-hashtag",class:"mr-1"}),k(" "+c(e.$t("kling.name.traceId"))+": "+c((j=(O=e.modelValue)==null?void 0:O.response)==null?void 0:j.trace_id)+" ",1),o(m,{content:(q=(F=e.modelValue)==null?void 0:F.response)==null?void 0:q.trace_id,class:"btn-copy"},null,8,["content"])])):$("v-if",!0)]}),_:1})])):$("v-if",!0)])])}var Ao=y(mo,[["render",Uo],["__scopeId","data-v-547724c8"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/task/Preview.vue"]]);const Do=b({name:"RecentPanel",components:{TaskPreview:Ao,ElSkeleton:Fe,ElSkeletonItem:qe},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){var e,t,s,d;return{...(e=this.$store.state.kling)==null?void 0:e.tasks,items:(d=(s=(t=this.$store.state.kling)==null?void 0:t.tasks)==null?void 0:s.items)==null?void 0:d.slice()}}},methods:{onHandleScroll(){const e=this.$refs.panel;console.log("reach-top reach-top reach-top"),e.scrollTop===0&&this.$emit("reach-top")}}}),Go={key:0,class:"tasks"},Mo={class:"left"},Oo={class:"main"},jo={key:1,class:"tasks"},Fo={key:2,class:"description"};function qo(e,t,s,d,g,f){var v,h,m,w,N,C,P,T;const i=n("el-skeleton-item"),u=n("el-skeleton"),r=n("task-preview");return l(),p("div",{ref:"panel",class:"panel recent",onScroll:t[0]||(t[0]=(...I)=>e.onHandleScroll&&e.onHandleScroll(...I))},[((v=e.tasks)==null?void 0:v.items)===void 0?(l(),p("div",Go,[(l(),p(U,null,A(3,I=>a("div",{key:I,class:"task placeholder"},[a("div",Mo,[o(u,{animated:""},{template:_(()=>[o(i,{variant:"image",class:"avatar"})]),_:1})]),a("div",Oo,[o(u,{animated:""},{template:_(()=>[o(i,{variant:"p",class:"title"}),o(i,{variant:"image",class:"icon"})]),_:1})])])),64))])):((m=(h=e.tasks)==null?void 0:h.items)==null?void 0:m.length)&&((N=(w=e.tasks)==null?void 0:w.items)==null?void 0:N.length)>0?(l(),p("div",jo,[$(" {{ tasks?.items }} "),(l(!0),p(U,null,A((C=e.tasks)==null?void 0:C.items,(I,R)=>(l(),L(r,{key:R,"model-value":I,class:"preview"},null,8,["model-value"]))),128))])):$("v-if",!0),((T=(P=e.tasks)==null?void 0:P.items)==null?void 0:T.length)===0?(l(),p("p",Fo,c(e.$t("kling.message.noTasks")),1)):$("v-if",!0)],544)}var zo=y(Do,[["render",qo],["__scopeId","data-v-abb7e68a"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/RecentPanel.vue"]]);const Bo="https://webhook.acedata.cloud/kling",Ko=b({name:"KlingIndex",components:{ConfigPanel:lo,Layout:We,RecentPanel:zo},data(){return{task:void 0,job:0,timer:void 0}},computed:{loading(){var e,t;return((t=(e=this.$store.state.kling)==null?void 0:e.status)==null?void 0:t.getApplications)===H.Request},service(){return this.$store.state.kling.service},credential(){return this.$store.state.kling.credential},config(){return this.$store.state.kling.config},initializing(){return this.$store.state.kling.status.getApplications===H.Request},needApply(){return this.$store.state.kling.status.getApplications===H.Success&&!this.application},application(){return this.$store.state.kling.application},applications(){return this.$store.state.kling.applications},tasks(){return this.$store.state.kling.tasks}},watch:{tasks:{handler(e,t){var s,d;((s=e==null?void 0:e.items)==null?void 0:s.length)>((d=t==null?void 0:t.items)==null?void 0:d.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("kling/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("kling/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){Ce.create({application:this.application}).then(({data:e})=>{this.application=e,E.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)===Re&&E.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".recent");e&&(e.scrollTop=e.scrollHeight)},500)},async onGetTasks(e){if(this.loading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:s,createdAtMax:d}=e||{};console.debug("limit",t,"createdAtMin",s,"createdAtMax",d),await this.$store.dispatch("kling/getTasks",{limit:t,createdAtMin:s,createdAtMax:d})},async onGenerate(){var s;const e={...this.config,callback_url:Bo},t=(s=this.credential)==null?void 0:s.token;if(!t){console.error("no token specified");return}E.info(this.$t("kling.message.startingTask")),Le.generate(e,{token:t}).then(()=>{E.success(this.$t("kling.message.startTaskSuccess")),this.$store.commit("kling/setConfig",{config:void 0})}).catch(d=>{var f,i;const g=(f=d==null?void 0:d.response)==null?void 0:f.data;((i=g==null?void 0:g.error)==null?void 0:i.code)===Ue?E.error(this.$t("kling.message.usedUp")):E.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function Ho(e,t,s,d,g,f){const i=n("config-panel"),u=n("recent-panel"),r=n("layout");return l(),L(r,null,{config:_(()=>[o(i,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:_(()=>[o(u,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"])]),_:1})}var ns=y(Ko,[["render",Ho],["__scopeId","data-v-e48d89a0"],["__file","/home/runner/work/Nexior/Nexior/src/pages/kling/Index.vue"]]);export{ns as default};
1
+ import{an as Ve}from"./vendor-others.cdfefb59.js";import{ar as z}from"./vendor-fortawesome.2b54ad1b.js";import{_ as y,aL as Se,aM as Ee,aN as Ne,aO as Pe,A as ye,aP as Te,K as H,F as Ce,M as Re,aQ as Le,Z as Ue}from"./index.97386539.js";import{T as Ae,u as B,N as Z,O as J,x as be,y as E,U as De,V as Ge,t as we,m as Me,I as Oe,s as je,H as Fe,R as qe}from"./vendor-element-plus.1fa87efb.js";import{H as b,al as n,o as l,e as p,f as a,I as Q,V as o,M as _,T as c,U,ai as A,L,P as D,a0 as ze,S as k,R as $}from"./vendor-@vue.6c0309d3.js";import{I as K}from"./InfoIcon.b6bd8d58.js";import{I as Ie}from"./ImagePreview.025cfc09.js";import{C as Be}from"./CopyToClipboard.dcbf7182.js";import"./vendor-markdown.cf3e96ae.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.6ab44f81.js";const Ke=b({name:"LayoutKling",components:{ElDrawer:Ae,ElButton:B,FontAwesomeIcon:z},data(){return{drawer:!1}}}),He={class:"main"},Qe={class:"config"},Ze={class:"result"};function Je(e,t,s,d,g,f){const i=n("font-awesome-icon"),u=n("el-button"),r=n("el-drawer");return l(),p("div",He,[a("div",Qe,[Q(e.$slots,"config",{},void 0,!0)]),a("div",Ze,[Q(e.$slots,"result",{},void 0,!0)]),o(u,{round:"",class:"menu",onClick:t[0]||(t[0]=v=>e.drawer=!0)},{default:_(()=>[o(i,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),o(r,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=v=>e.drawer=v),"with-header":!1,size:"340px",class:"drawer"},{default:_(()=>[Q(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}var We=y(Ke,[["render",Je],["__scopeId","data-v-50bc0f32"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Kling.vue"]]);const Xe=b({name:"ModelSelector",components:{ElSelect:Z,ElOption:J},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{options:[{value:"kling-v1",label:"V1"},{value:"kling-v1-5",label:"V1.5"},{value:"kling-v1-6",label:"V1.6"}]}},computed:{value:{get(){var e,t;return(t=(e=this.$store.state.kling)==null?void 0:e.config)==null?void 0:t.model},set(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,model:e})}}},mounted(){this.value||(this.value=Se)}}),Ye={class:"field"},xe={class:"title font-bold"};function et(e,t,s,d,g,f){const i=n("el-option"),u=n("el-select");return l(),p("div",Ye,[a("h2",xe,c(e.$t("pika.name.model")),1),o(u,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=r=>e.value=r),class:"value",placeholder:e.$t("pika.placeholder.select")},{default:_(()=>[(l(!0),p(U,null,A(e.options,r=>(l(),L(i,{key:r.value,label:r.label,value:r.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}var tt=y(Xe,[["render",et],["__scopeId","data-v-13cacdf9"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/config/ModelSelector.vue"]]);const ot=b({name:"ModeSelector",components:{ElSelect:Z,ElOption:J},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{options:[{value:"std",label:"\u6807\u51C6"},{value:"pro",label:"\u9AD8\u901F"}]}},computed:{value:{get(){var e,t;return(t=(e=this.$store.state.kling)==null?void 0:e.config)==null?void 0:t.mode},set(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,mode:e})}}},mounted(){this.value||(this.value=Ee)}}),st={class:"field"},nt={class:"title font-bold"};function at(e,t,s,d,g,f){const i=n("el-option"),u=n("el-select");return l(),p("div",st,[a("h2",nt,c(e.$t("kling.name.mode")),1),o(u,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=r=>e.value=r),class:"value",placeholder:e.$t("kling.placeholder.select")},{default:_(()=>[(l(!0),p(U,null,A(e.options,r=>(l(),L(i,{key:r.value,label:r.label,value:r.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}var lt=y(ot,[["render",at],["__scopeId","data-v-3af5203e"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/config/ModeSelector.vue"]]);const it=b({name:"DurationSelector",components:{ElSelect:Z,ElOption:J},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{options:[{value:5,label:"5\u79D2"},{value:10,label:"10\u79D2"}]}},computed:{value:{get(){var e,t;return(t=(e=this.$store.state.kling)==null?void 0:e.config)==null?void 0:t.duration},set(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,duration:e})}}},mounted(){this.value||(this.value=Ne)}}),rt={class:"field"},ct={class:"title font-bold"};function dt(e,t,s,d,g,f){const i=n("el-option"),u=n("el-select");return l(),p("div",rt,[a("h2",ct,c(e.$t("kling.name.duration")),1),o(u,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=r=>e.value=r),class:"value",placeholder:e.$t("kling.placeholder.select")},{default:_(()=>[(l(!0),p(U,null,A(e.options,r=>(l(),L(i,{key:r.value,label:r.label,value:r.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}var pt=y(it,[["render",dt],["__scopeId","data-v-6434f6d2"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/config/DurationSelector.vue"]]);const ut=b({name:"RatioSelector",data(){return{options:[{value:"1:1",label:"1:1",width:20,height:20},{value:"16:9",label:"16:9",width:25,height:13},{value:"9:16",label:"9:16",width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){var e,t,s;return(s=(t=(e=this.$store.state)==null?void 0:e.kling)==null?void 0:t.config)==null?void 0:s.aspect_ratio},set(e){var t,s;console.debug("set ratio",e),this.$store.commit("kling/setConfig",{...(s=(t=this.$store.state)==null?void 0:t.kling)==null?void 0:s.config,aspect_ratio:e})}}},mounted(){this.value||(this.value=Pe)}}),mt={class:"text-sm font-bold mb-2 block"},_t={class:"items"},gt=["onClick"],ft={class:"name"};function vt(e,t,s,d,g,f){return l(),p("div",null,[a("span",mt,c(e.$t("kling.name.ratio")),1),a("div",_t,[(l(!0),p(U,null,A(e.options,(i,u)=>(l(),p("div",{key:u,class:D({active:e.active===u,item:!0}),onClick:r=>e.value=i.value},[a("div",{class:D(["preview",i.label])},[a("div",{class:"rect",style:ze({width:i.width+"px",height:i.height+"px"})},null,4)],2),a("p",ft,c(i.label),1)],10,gt))),128))])])}var ht=y(ut,[["render",vt],["__scopeId","data-v-41d8dfdb"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/config/RatioSelector.vue"]]);const $t=b({name:"StartImage",components:{ElUpload:be,ElButton:B,InfoIcon:K,FontAwesomeIcon:z,ImagePreview:Ie},emits:["change"],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,s;return(s=(t=(e=this.$store.state)==null?void 0:e.kling)==null?void 0:t.config)==null?void 0:s.start_image_url},set(e){}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){E.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){E.error(this.$t("kling.message.uploadReferencesError"))},onSetStartImageUrl(){var t,s,d;const e=(t=this.urls)==null?void 0:t[0];this.$store.commit("kling/setConfig",{...(d=(s=this.$store.state)==null?void 0:s.kling)==null?void 0:d.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),kt={class:"relative"},yt={class:"flex justify-between"},bt={class:"flex justify-start items-center"},wt={class:"text-sm font-bold"};function It(e,t,s,d,g,f){const i=n("info-icon"),u=n("image-preview"),r=n("font-awesome-icon"),v=n("el-button"),h=n("el-upload");return l(),p("div",kt,[a("div",yt,[a("div",bt,[a("span",wt,c(e.$t("kling.name.startImage")),1),o(i,{content:e.$t("kling.description.uploadStartImage")},null,8,["content"])])]),o(h,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=m=>e.fileList=m),name:"file",limit:5,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:_(({file:m})=>{var w;return[o(u,{url:m.url||((w=m.response)==null?void 0:w.file_url),name:m.name,percentage:m.percentage,onRemove:N=>e.fileList.splice(e.fileList.indexOf(m),1)},null,8,["url","name","percentage","onRemove"])]}),default:_(()=>[o(v,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:_(()=>[o(r,{icon:"fa-solid fa-upload",class:"icon mr-1"}),k(" "+c(e.$t("kling.button.uploadReferences")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}var Vt=y($t,[["render",It],["__scopeId","data-v-6e6084d0"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/config/StartImage.vue"]]);const St=b({name:"EndImage",components:{ElUpload:be,ElButton:B,ImagePreview:Ie,InfoIcon:K,FontAwesomeIcon:z},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,s;return(s=(t=(e=this.$store.state)==null?void 0:e.kling)==null?void 0:t.config)==null?void 0:s.start_image_url},set(e){}}},mounted(){this.value||(this.value=void 0),this.onSetEndImageUrl()},methods:{onExceed(){E.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){E.error(this.$t("kling.message.uploadReferencesError"))},onSetEndImageUrl(){var t,s;const e=(t=this.urls)==null?void 0:t[0];this.$store.commit("kling/setConfig",{...(s=this.$store.state.kling)==null?void 0:s.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),Et={class:"relative"},Nt={class:"flex justify-between"},Pt={class:"flex justify-start items-center"},Tt={class:"text-sm font-bold"};function Ct(e,t,s,d,g,f){const i=n("info-icon"),u=n("image-preview"),r=n("font-awesome-icon"),v=n("el-button"),h=n("el-upload");return l(),p("div",Et,[a("div",Nt,[a("div",Pt,[a("span",Tt,c(e.$t("kling.name.endImage")),1),o(i,{content:e.$t("kling.description.uploadEndImage")},null,8,["content"])])]),o(h,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=m=>e.fileList=m),name:"file",limit:5,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:_(({file:m})=>{var w;return[o(u,{url:m.url||((w=m.response)==null?void 0:w.file_url),name:m.name,percentage:m.percentage,onRemove:N=>e.fileList.splice(e.fileList.indexOf(m),1)},null,8,["url","name","percentage","onRemove"])]}),default:_(()=>[o(v,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:_(()=>[o(r,{icon:"fa-solid fa-upload",class:"icon mr-1"}),k(" "+c(e.$t("kling.button.uploadReferences")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}var Rt=y(St,[["render",Ct],["__scopeId","data-v-72a21eff"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/config/EndImage.vue"]]);const Lt=b({name:"CfgScaleSelector",components:{ElSlider:De,InfoIcon:K,ElInputNumber:Ge},computed:{value:{get(){var e,t,s;return(s=(t=(e=this.$store.state)==null?void 0:e.kling)==null?void 0:t.config)==null?void 0:s.cfg_scale},set(e){var t,s;console.debug("set cfg_scale",e),this.$store.commit("kling/setConfig",{...(s=(t=this.$store.state)==null?void 0:t.kling)==null?void 0:s.config,cfg_scale:e})}}},mounted(){this.value||(this.value=Te)}}),Ut={class:"flex justify-between"},At={class:"flex justify-start items-center"},Dt={class:"text-sm font-bold"},Gt={class:"flex justify-end items-center"},Mt={class:"w-full"};function Ot(e,t,s,d,g,f){const i=n("info-icon"),u=n("el-input-number"),r=n("el-slider");return l(),p("div",null,[a("div",Ut,[a("div",At,[a("span",Dt,c(e.$t("kling.name.cfgScale")),1),o(i,{content:e.$t("kling.description.cfgScale")},null,8,["content"])]),a("div",Gt,[o(u,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=v=>e.value=v),"controls-position":"right"},null,8,["modelValue"])])]),a("div",Mt,[o(r,{modelValue:e.value,"onUpdate:modelValue":t[1]||(t[1]=v=>e.value=v),min:0,max:1,step:.1},null,8,["modelValue"])])])}var jt=y(Lt,[["render",Ot],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/config/CfgScaleSelector.vue"]]);const Ft="",qt=b({name:"PromptInput",components:{ElInput:we,InfoIcon:K},computed:{prompt:{get(){var e,t;return(t=(e=this.$store.state.kling)==null?void 0:e.config)==null?void 0:t.prompt},set(e){var t;console.debug("set prompt",e),this.$store.commit("kling/setConfig",{...(t=this.$store.state.kling)==null?void 0:t.config,prompt:e})}}},mounted(){this.value||(this.value=Ft)}}),zt={class:"field"},Bt={class:"box"},Kt={class:"title font-bold"};function Ht(e,t,s,d,g,f){const i=n("info-icon"),u=n("el-input");return l(),p("div",zt,[a("div",Bt,[a("h2",Kt,c(e.$t("kling.name.prompt")),1),o(i,{content:e.$t("kling.description.prompt"),class:"info"},null,8,["content"])]),o(u,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=r=>e.prompt=r),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.prompt"),maxlength:500,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var Qt=y(qt,[["render",Ht],["__scopeId","data-v-fd830852"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/config/PromptInput.vue"]]);const Zt="",Jt=b({name:"NegativePromptInput",components:{ElInput:we,InfoIcon:K},computed:{prompt:{get(){var e,t;return(t=(e=this.$store.state.kling)==null?void 0:e.config)==null?void 0:t.negative_prompt},set(e){var t;console.debug("set prompt",e),this.$store.commit("kling/setConfig",{...(t=this.$store.state.kling)==null?void 0:t.config,negative_prompt:e})}}},mounted(){this.value||(this.value=Zt)}}),Wt={class:"field"},Xt={class:"box"},Yt={class:"title font-bold"};function xt(e,t,s,d,g,f){const i=n("info-icon"),u=n("el-input");return l(),p("div",Wt,[a("div",Xt,[a("h2",Yt,c(e.$t("kling.name.negativePrompt")),1),o(i,{content:e.$t("kling.description.negativePrompt"),class:"info"},null,8,["content"])]),o(u,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=r=>e.prompt=r),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.negativePrompt"),maxlength:200,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var eo=y(Jt,[["render",xt],["__scopeId","data-v-6c3d0de2"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/config/NegativePromptInput.vue"]]);const to=b({name:"PresetPanel",components:{ElButton:B,FontAwesomeIcon:z,PromptInput:Qt,NegativePromptInput:eo,ModelSelector:tt,ModeSelector:lt,DurationSelector:pt,RatioSelector:ht,StartImage:Vt,CfgScaleSelector:jt,EndImage:Rt},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.kling)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),oo={class:"panel"},so={class:"config"},no={class:"actions"};function ao(e,t,s,d,g,f){var I,R;const i=n("prompt-input"),u=n("model-selector"),r=n("mode-selector"),v=n("ratio-selector"),h=n("start-image"),m=n("end-image"),w=n("cfg-scale-selector"),N=n("duration-selector"),C=n("negative-prompt-input"),P=n("font-awesome-icon"),T=n("el-button");return l(),p("div",oo,[a("div",so,[o(i,{class:"mb-4"}),o(u,{class:"mb-4"}),o(r,{class:"mb-4"}),o(v,{class:"mb-4"}),o(h,{class:"mb-2"}),o(m,{class:"mb-2"}),o(w,{class:"mb-4"}),o(N,{class:"mb-4"}),o(C,{class:"mb-4"}),a("div",no,[((I=e.config)==null?void 0:I.video_url)!==void 0||((R=e.config)==null?void 0:R.custom)?(l(),L(T,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:_(()=>[o(P,{icon:"fa-solid fa-magic",class:"mr-2"}),k(" "+c(e.$t("kling.button.extend")),1)]),_:1},8,["onClick"])):(l(),L(T,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:_(()=>[o(P,{icon:"fa-solid fa-magic",class:"mr-2"}),k(" "+c(e.$t("kling.button.generate")),1)]),_:1},8,["onClick"]))])])])}var lo=y(to,[["render",ao],["__scopeId","data-v-301363b4"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/ConfigPanel.vue"]]);const io=b({name:"VideoPlayer",components:{VuePlyr:Ve},props:{modelValue:{type:Object,required:!0}},data(){return{options:{quality:{default:"1080p"}}}}}),ro={controls:"",crossorigin:"",playsinline:""},co=["src"];function po(e,t,s,d,g,f){const i=n("vue-plyr");return l(),p("div",null,[o(i,{options:e.options,class:"video"},{default:_(()=>{var u;return[a("video",ro,[a("source",{size:"1080",src:(u=e.modelValue)==null?void 0:u.video_url,type:"video/mp4"},null,8,co)])]}),_:1},8,["options"])])}var uo=y(io,[["render",po],["__scopeId","data-v-3fd1ea0e"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/VideoPlayer.vue"]]);const mo=b({name:"TaskPreview",components:{ElImage:Me,CopyToClipboard:Be,FontAwesomeIcon:z,ElAlert:Oe,VideoPlayer:uo,ElTooltip:je,ElButton:B},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){var e;return(e=this.$store.state.kling)==null?void 0:e.application},config(){var e;return(e=this.$store.state.kling)==null?void 0:e.config}},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),d=s.searchParams.get("retry");if(!d)s.searchParams.set("retry","1");else if(parseInt(d)<2)s.searchParams.set("retry",(parseInt(d)+1).toString());else return;t.src=s.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),_o={class:"preview"},go={class:"left"},fo={class:"main"},vo={class:"bot"},ho={class:"datetime"},$o={class:"info"},ko={key:0,class:"prompt mt-2"},yo={key:0},bo={key:1},wo={key:0,class:D({content:!0,failed:!0})},Io={class:"image-wrapper"},Vo={key:0,class:D({operations:!0,"mt-2":!0})},So={class:"description"},Eo={key:1,class:D({content:!0})},No={class:"description"},Po={class:"description"},To={key:0,class:"description"},Co={key:2,class:D({content:!0})},Ro={class:"description"},Lo={key:0,class:"description"};function Uo(e,t,s,d,g,f){var N,C,P,T,I,R,W,X,Y,x,ee,te,oe,se,ne,ae,le,ie,re,ce,de,pe,ue,me,_e;const i=n("el-image"),u=n("VideoPlayer"),r=n("el-button"),v=n("el-tooltip"),h=n("font-awesome-icon"),m=n("copy-to-clipboard"),w=n("el-alert");return l(),p("div",_o,[a("div",go,[o(i,{src:"https://cdn.acedata.cloud/qpbbbb.jpg",class:"avatar"})]),a("div",fo,[a("div",vo,[k(c(e.$t("kling.name.klingBot"))+" ",1),a("span",ho,c(e.$dayjs.format(""+new Date(parseFloat(((N=e.modelValue)==null?void 0:N.created_at)||"")*1e3))),1)]),a("div",$o,[(P=(C=e.modelValue)==null?void 0:C.request)!=null&&P.prompt?(l(),p("p",ko,[k(c((I=(T=e.modelValue)==null?void 0:T.request)==null?void 0:I.prompt)+" ",1),(R=e.modelValue)!=null&&R.response?$("v-if",!0):(l(),p("span",yo," - ("+c(e.$t("kling.status.pending"))+") ",1)),((X=(W=e.modelValue)==null?void 0:W.response)==null?void 0:X.state)==="submitted"||((x=(Y=e.modelValue)==null?void 0:Y.response)==null?void 0:x.state)==="processing"||((te=(ee=e.modelValue)==null?void 0:ee.response)==null?void 0:te.state)==="pending"||((se=(oe=e.modelValue)==null?void 0:oe.response)==null?void 0:se.state)==="completed"?(l(),p("span",bo," - ("+c(e.$t("kling.status.processing"))+") ",1)):$("v-if",!0)])):$("v-if",!0)]),$(" Display success message "),((ae=(ne=e.modelValue)==null?void 0:ne.response)==null?void 0:ae.success)===!0?(l(),p("div",wo,[a("div",Io,[o(u,{"model-value":(le=e.modelValue)==null?void 0:le.response},null,8,["model-value"])]),(ie=e.modelValue)!=null&&ie.response.success?(l(),p("div",Vo,[o(v,{class:"box-item",effect:"dark",content:e.$t("kling.message.downloadVideo"),placement:"top-start"},{default:_(()=>[o(r,{type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=S=>{var V;return e.onDownload(S,(V=e.modelValue)==null?void 0:V.response.video_url)})},{default:_(()=>[k(c(e.$t("kling.button.download")),1)]),_:1})]),_:1},8,["content"])])):$("v-if",!0),o(w,{closable:!1,class:"mt-2 success"},{default:_(()=>{var S,V;return[a("p",So,[o(h,{icon:"fa-solid fa-magic",class:"mr-1"}),k(" "+c(e.$t("kling.name.taskId"))+": "+c((S=e.modelValue)==null?void 0:S.id)+" ",1),o(m,{content:(V=e.modelValue)==null?void 0:V.id,class:"btn-copy"},null,8,["content"])])]}),_:1})])):$("v-if",!0),$(" Display error message "),((ce=(re=e.modelValue)==null?void 0:re.response)==null?void 0:ce.success)===!1?(l(),p("div",Eo,[o(w,{closable:!1,class:"failure"},{template:_(()=>[o(h,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),k(" "+c(e.$t("kling.name.failure")),1)]),default:_(()=>{var S,V,G,M,O,j,F,q,ge,fe,ve,he,$e,ke;return[a("p",No,[o(h,{icon:"fa-solid fa-magic",class:"mr-1"}),k(" "+c(e.$t("kling.name.taskId"))+": "+c((S=e.modelValue)==null?void 0:S.id)+" ",1),o(m,{content:(V=e.modelValue)==null?void 0:V.id,class:"btn-copy"},null,8,["content"])]),a("p",Po,[o(h,{icon:"fa-solid fa-circle-info",class:"mr-1"}),k(" "+c(e.$t("kling.name.failureReason"))+": "+c((O=(M=(G=e.modelValue)==null?void 0:G.response)==null?void 0:M.error)==null?void 0:O.message)+" ",1),o(m,{content:(q=(F=(j=e.modelValue)==null?void 0:j.response)==null?void 0:F.error)==null?void 0:q.message,class:"btn-copy"},null,8,["content"])]),(fe=(ge=e.modelValue)==null?void 0:ge.response)!=null&&fe.trace_id?(l(),p("p",To,[o(h,{icon:"fa-solid fa-hashtag",class:"mr-1"}),k(" "+c(e.$t("kling.name.traceId"))+": "+c((he=(ve=e.modelValue)==null?void 0:ve.response)==null?void 0:he.trace_id)+" ",1),o(m,{content:(ke=($e=e.modelValue)==null?void 0:$e.response)==null?void 0:ke.trace_id,class:"btn-copy"},null,8,["content"])])):$("v-if",!0)]}),_:1})])):$("v-if",!0),$(" Display error message "),!((de=e.modelValue)!=null&&de.response)||((ue=(pe=e.modelValue)==null?void 0:pe.response)==null?void 0:ue.state)==="processing"||((_e=(me=e.modelValue)==null?void 0:me.response)==null?void 0:_e.state)==="pending"?(l(),p("div",Co,[o(w,{closable:!1,class:"info"},{template:_(()=>[o(h,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),k(" "+c(e.$t("kling.name.failure")),1)]),default:_(()=>{var S,V,G,M,O,j,F,q;return[a("p",Ro,[o(h,{icon:"fa-solid fa-magic",class:"mr-1"}),k(" "+c(e.$t("kling.name.taskId"))+": "+c((S=e.modelValue)==null?void 0:S.id)+" ",1),o(m,{content:(V=e.modelValue)==null?void 0:V.id,class:"btn-copy"},null,8,["content"])]),(M=(G=e.modelValue)==null?void 0:G.response)!=null&&M.trace_id?(l(),p("p",Lo,[o(h,{icon:"fa-solid fa-hashtag",class:"mr-1"}),k(" "+c(e.$t("kling.name.traceId"))+": "+c((j=(O=e.modelValue)==null?void 0:O.response)==null?void 0:j.trace_id)+" ",1),o(m,{content:(q=(F=e.modelValue)==null?void 0:F.response)==null?void 0:q.trace_id,class:"btn-copy"},null,8,["content"])])):$("v-if",!0)]}),_:1})])):$("v-if",!0)])])}var Ao=y(mo,[["render",Uo],["__scopeId","data-v-547724c8"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/task/Preview.vue"]]);const Do=b({name:"RecentPanel",components:{TaskPreview:Ao,ElSkeleton:Fe,ElSkeletonItem:qe},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){var e,t,s,d;return{...(e=this.$store.state.kling)==null?void 0:e.tasks,items:(d=(s=(t=this.$store.state.kling)==null?void 0:t.tasks)==null?void 0:s.items)==null?void 0:d.slice()}}},methods:{onHandleScroll(){const e=this.$refs.panel;console.log("reach-top reach-top reach-top"),e.scrollTop===0&&this.$emit("reach-top")}}}),Go={key:0,class:"tasks"},Mo={class:"left"},Oo={class:"main"},jo={key:1,class:"tasks"},Fo={key:2,class:"description"};function qo(e,t,s,d,g,f){var v,h,m,w,N,C,P,T;const i=n("el-skeleton-item"),u=n("el-skeleton"),r=n("task-preview");return l(),p("div",{ref:"panel",class:"panel recent",onScroll:t[0]||(t[0]=(...I)=>e.onHandleScroll&&e.onHandleScroll(...I))},[((v=e.tasks)==null?void 0:v.items)===void 0?(l(),p("div",Go,[(l(),p(U,null,A(3,I=>a("div",{key:I,class:"task placeholder"},[a("div",Mo,[o(u,{animated:""},{template:_(()=>[o(i,{variant:"image",class:"avatar"})]),_:1})]),a("div",Oo,[o(u,{animated:""},{template:_(()=>[o(i,{variant:"p",class:"title"}),o(i,{variant:"image",class:"icon"})]),_:1})])])),64))])):((m=(h=e.tasks)==null?void 0:h.items)==null?void 0:m.length)&&((N=(w=e.tasks)==null?void 0:w.items)==null?void 0:N.length)>0?(l(),p("div",jo,[$(" {{ tasks?.items }} "),(l(!0),p(U,null,A((C=e.tasks)==null?void 0:C.items,(I,R)=>(l(),L(r,{key:R,"model-value":I,class:"preview"},null,8,["model-value"]))),128))])):$("v-if",!0),((T=(P=e.tasks)==null?void 0:P.items)==null?void 0:T.length)===0?(l(),p("p",Fo,c(e.$t("kling.message.noTasks")),1)):$("v-if",!0)],544)}var zo=y(Do,[["render",qo],["__scopeId","data-v-abb7e68a"],["__file","/home/runner/work/Nexior/Nexior/src/components/kling/RecentPanel.vue"]]);const Bo="https://webhook.acedata.cloud/kling",Ko=b({name:"KlingIndex",components:{ConfigPanel:lo,Layout:We,RecentPanel:zo},data(){return{task:void 0,job:0,timer:void 0}},computed:{loading(){var e,t;return((t=(e=this.$store.state.kling)==null?void 0:e.status)==null?void 0:t.getApplications)===H.Request},service(){return this.$store.state.kling.service},credential(){return this.$store.state.kling.credential},config(){return this.$store.state.kling.config},initializing(){return this.$store.state.kling.status.getApplications===H.Request},needApply(){return this.$store.state.kling.status.getApplications===H.Success&&!this.application},application(){return this.$store.state.kling.application},applications(){return this.$store.state.kling.applications},tasks(){return this.$store.state.kling.tasks}},watch:{tasks:{handler(e,t){var s,d;((s=e==null?void 0:e.items)==null?void 0:s.length)>((d=t==null?void 0:t.items)==null?void 0:d.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("kling/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("kling/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){Ce.create({application:this.application}).then(({data:e})=>{this.application=e,E.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)===Re&&E.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".recent");e&&(e.scrollTop=e.scrollHeight)},500)},async onGetTasks(e){if(this.loading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:s,createdAtMax:d}=e||{};console.debug("limit",t,"createdAtMin",s,"createdAtMax",d),await this.$store.dispatch("kling/getTasks",{limit:t,createdAtMin:s,createdAtMax:d})},async onGenerate(){var s;const e={...this.config,callback_url:Bo},t=(s=this.credential)==null?void 0:s.token;if(!t){console.error("no token specified");return}E.info(this.$t("kling.message.startingTask")),Le.generate(e,{token:t}).then(()=>{E.success(this.$t("kling.message.startTaskSuccess")),this.$store.commit("kling/setConfig",{config:void 0})}).catch(d=>{var f,i;const g=(f=d==null?void 0:d.response)==null?void 0:f.data;((i=g==null?void 0:g.error)==null?void 0:i.code)===Ue?E.error(this.$t("kling.message.usedUp")):E.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}});function Ho(e,t,s,d,g,f){const i=n("config-panel"),u=n("recent-panel"),r=n("layout");return l(),L(r,null,{config:_(()=>[o(i,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:_(()=>[o(u,{class:"panel recent",onReachTop:e.onReachTop},null,8,["onReachTop"])]),_:1})}var ns=y(Ko,[["render",Ho],["__scopeId","data-v-e48d89a0"],["__file","/home/runner/work/Nexior/Nexior/src/pages/kling/Index.vue"]]);export{ns as default};
@@ -1 +1 @@
1
- import"./vendor-others.cdfefb59.js";import{ar as c}from"./vendor-fortawesome.2b54ad1b.js";import{_ as r}from"./index.60bb4e0a.js";import{s as a}from"./vendor-element-plus.1fa87efb.js";import{H as s,al as o,o as p,L as _,M as i,V as m}from"./vendor-@vue.6c0309d3.js";const f=s({name:"InfoIcon",components:{FontAwesomeIcon:c,ElTooltip:a},props:{content:{type:String,required:!0}}});function l(e,d,u,I,v,x){const n=o("font-awesome-icon"),t=o("el-tooltip");return p(),_(t,{effect:"dark",content:e.content,placement:"top"},{default:i(()=>[m(n,{icon:"fa-solid fa-info",class:"icon icon-rotate"})]),_:1},8,["content"])}var C=r(f,[["render",l],["__scopeId","data-v-43d426ab"],["__file","/home/runner/work/Nexior/Nexior/src/components/common/InfoIcon.vue"]]);export{C as I};
1
+ import"./vendor-others.cdfefb59.js";import{ar as c}from"./vendor-fortawesome.2b54ad1b.js";import{_ as r}from"./index.97386539.js";import{s as a}from"./vendor-element-plus.1fa87efb.js";import{H as s,al as o,o as p,L as _,M as i,V as m}from"./vendor-@vue.6c0309d3.js";const f=s({name:"InfoIcon",components:{FontAwesomeIcon:c,ElTooltip:a},props:{content:{type:String,required:!0}}});function l(e,d,u,I,v,x){const n=o("font-awesome-icon"),t=o("el-tooltip");return p(),_(t,{effect:"dark",content:e.content,placement:"top"},{default:i(()=>[m(n,{icon:"fa-solid fa-info",class:"icon icon-rotate"})]),_:1},8,["content"])}var C=r(f,[["render",l],["__scopeId","data-v-43d426ab"],["__file","/home/runner/work/Nexior/Nexior/src/components/common/InfoIcon.vue"]]);export{C as I};
@@ -1 +1 @@
1
- import"./vendor-others.cdfefb59.js";import{P as b}from"./Pagination.e3c91ab4.js";import{C as w}from"./CopyToClipboard.2d20734e.js";import{_ as C,ai as $}from"./index.60bb4e0a.js";import{A as y,B as I,C as D,D as k,F}from"./vendor-element-plus.1fa87efb.js";import{H as E,al as s,av as P,L as _,M as t,o as u,V as a,f as n,T as i,O as B}from"./vendor-@vue.6c0309d3.js";import"./vendor-markdown.cf3e96ae.js";import"./vendor-fortawesome.2b54ad1b.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.6ab44f81.js";const N=E({name:"ConsoleDistributionInvitees",components:{Pagination:b,CopyToClipboard:w,ElRow:y,ElCol:I,ElTable:D,ElTableColumn:k,ElCard:F},data(){return{invitees:[],loading:!1,total:void 0,limit:10}},computed:{redirect(){return this.$route.query.redirect},page(){var e;return parseInt(((e=this.$route.query.page)==null?void 0:e.toString())||"1")}},watch:{page:{handler(){this.onFetchData()}}},mounted(){this.onFetchData()},methods:{onPageChange(e){var p;this.$router.push({name:(p=this.$route.name)==null?void 0:p.toString(),query:{page:e}})},onFetchData(){this.loading=!0,Promise.all([this.onFetchInvitees()]).finally(()=>{this.loading=!1})},async onFetchInvitees(){const{data:e}=await $.getInvitees({limit:this.limit,offset:(this.page-1)*this.limit,ordering:"-created_at"});this.invitees=e.items,this.total=e.count}}}),T={class:"title"},q={class:"key"},S={class:"copy"},V={class:"description"},j={class:"description"},z={class:"description"},O={class:"created-at"},A={class:"pagination m-v-lg"};function H(e,p,J,L,M,R){const d=s("el-col"),c=s("el-row"),m=s("copy-to-clipboard"),l=s("el-table-column"),h=s("el-table"),f=s("el-card"),g=s("pagination"),v=P("loading");return u(),_(c,{class:"panel"},{default:t(()=>[a(d,{span:24},{default:t(()=>[a(c,null,{default:t(()=>[a(d,{span:24},{default:t(()=>[n("h2",T,i(e.$t("common.title.invitee")),1)]),_:1})]),_:1}),a(c,null,{default:t(()=>[a(d,{span:24},{default:t(()=>[a(f,{shadow:"hover"},{default:t(()=>[B((u(),_(h,{data:e.invitees,stripe:""},{default:t(()=>[a(l,{prop:"id",label:e.$t("user.field.id"),"class-name":"text-center",width:"350px"},{default:t(o=>[n("span",q,i(o.row.id),1),n("span",S,[a(m,{content:o.row.id},null,8,["content"])])]),_:1},8,["label"]),a(l,{label:e.$t("user.field.username"),width:"300px"},{default:t(o=>{var r;return[n("span",V,i((r=o.row)==null?void 0:r.username),1)]}),_:1},8,["label"]),a(l,{label:e.$t("user.field.email"),width:"300px"},{default:t(o=>{var r;return[n("span",j,i((r=o.row)==null?void 0:r.email),1)]}),_:1},8,["label"]),a(l,{label:e.$t("user.field.nickname"),width:"200px"},{default:t(o=>[n("span",z,i(o.row.nickname),1)]),_:1},8,["label"]),a(l,{label:e.$t("user.field.dateJoined")},{default:t(o=>[n("span",O,i(e.$dayjs.format(o.row.date_joined)),1)]),_:1},8,["label"])]),_:1},8,["data"])),[[v,e.loading]])]),_:1})]),_:1})]),_:1}),a(c,null,{default:t(()=>[a(d,{span:10,offset:14},{default:t(()=>[n("div",A,[a(g,{"current-page":e.page,"page-size":e.limit,total:e.total,onChange:e.onPageChange},null,8,["current-page","page-size","total","onChange"])])]),_:1})]),_:1})]),_:1})]),_:1})}var te=C(N,[["render",H],["__scopeId","data-v-7cfed024"],["__file","/home/runner/work/Nexior/Nexior/src/pages/distribution/Invitees.vue"]]);export{te as default};
1
+ import"./vendor-others.cdfefb59.js";import{P as b}from"./Pagination.3c242094.js";import{C as w}from"./CopyToClipboard.dcbf7182.js";import{_ as C,ai as $}from"./index.97386539.js";import{A as y,B as I,C as D,D as k,F}from"./vendor-element-plus.1fa87efb.js";import{H as E,al as s,av as P,L as _,M as t,o as u,V as a,f as n,T as i,O as B}from"./vendor-@vue.6c0309d3.js";import"./vendor-markdown.cf3e96ae.js";import"./vendor-fortawesome.2b54ad1b.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.6ab44f81.js";const N=E({name:"ConsoleDistributionInvitees",components:{Pagination:b,CopyToClipboard:w,ElRow:y,ElCol:I,ElTable:D,ElTableColumn:k,ElCard:F},data(){return{invitees:[],loading:!1,total:void 0,limit:10}},computed:{redirect(){return this.$route.query.redirect},page(){var e;return parseInt(((e=this.$route.query.page)==null?void 0:e.toString())||"1")}},watch:{page:{handler(){this.onFetchData()}}},mounted(){this.onFetchData()},methods:{onPageChange(e){var p;this.$router.push({name:(p=this.$route.name)==null?void 0:p.toString(),query:{page:e}})},onFetchData(){this.loading=!0,Promise.all([this.onFetchInvitees()]).finally(()=>{this.loading=!1})},async onFetchInvitees(){const{data:e}=await $.getInvitees({limit:this.limit,offset:(this.page-1)*this.limit,ordering:"-created_at"});this.invitees=e.items,this.total=e.count}}}),T={class:"title"},q={class:"key"},S={class:"copy"},V={class:"description"},j={class:"description"},z={class:"description"},O={class:"created-at"},A={class:"pagination m-v-lg"};function H(e,p,J,L,M,R){const d=s("el-col"),c=s("el-row"),m=s("copy-to-clipboard"),l=s("el-table-column"),h=s("el-table"),f=s("el-card"),g=s("pagination"),v=P("loading");return u(),_(c,{class:"panel"},{default:t(()=>[a(d,{span:24},{default:t(()=>[a(c,null,{default:t(()=>[a(d,{span:24},{default:t(()=>[n("h2",T,i(e.$t("common.title.invitee")),1)]),_:1})]),_:1}),a(c,null,{default:t(()=>[a(d,{span:24},{default:t(()=>[a(f,{shadow:"hover"},{default:t(()=>[B((u(),_(h,{data:e.invitees,stripe:""},{default:t(()=>[a(l,{prop:"id",label:e.$t("user.field.id"),"class-name":"text-center",width:"350px"},{default:t(o=>[n("span",q,i(o.row.id),1),n("span",S,[a(m,{content:o.row.id},null,8,["content"])])]),_:1},8,["label"]),a(l,{label:e.$t("user.field.username"),width:"300px"},{default:t(o=>{var r;return[n("span",V,i((r=o.row)==null?void 0:r.username),1)]}),_:1},8,["label"]),a(l,{label:e.$t("user.field.email"),width:"300px"},{default:t(o=>{var r;return[n("span",j,i((r=o.row)==null?void 0:r.email),1)]}),_:1},8,["label"]),a(l,{label:e.$t("user.field.nickname"),width:"200px"},{default:t(o=>[n("span",z,i(o.row.nickname),1)]),_:1},8,["label"]),a(l,{label:e.$t("user.field.dateJoined")},{default:t(o=>[n("span",O,i(e.$dayjs.format(o.row.date_joined)),1)]),_:1},8,["label"])]),_:1},8,["data"])),[[v,e.loading]])]),_:1})]),_:1})]),_:1}),a(c,null,{default:t(()=>[a(d,{span:10,offset:14},{default:t(()=>[n("div",A,[a(g,{"current-page":e.page,"page-size":e.limit,total:e.total,onChange:e.onPageChange},null,8,["current-page","page-size","total","onChange"])])]),_:1})]),_:1})]),_:1})]),_:1})}var te=C(N,[["render",H],["__scopeId","data-v-7cfed024"],["__file","/home/runner/work/Nexior/Nexior/src/pages/distribution/Invitees.vue"]]);export{te as default};
@@ -1 +1 @@
1
- import"./vendor-others.cdfefb59.js";import{_ as E,E as B,F as T}from"./index.60bb4e0a.js";import{I as D}from"./credential.26787c24.js";import{P as F}from"./Pagination.e3c91ab4.js";import{C as N}from"./CopyToClipboard.2d20734e.js";import{C as P,A as x,u as I,B as L,b as S,D as O,F as R}from"./vendor-element-plus.1fa87efb.js";import{H as U,al as i,av as V,L as c,M as a,o as _,V as n,f as s,T as l,O as q,S as y,R as g,e as M}from"./vendor-@vue.6c0309d3.js";import"./vendor-markdown.cf3e96ae.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.6ab44f81.js";import"./vendor-fortawesome.2b54ad1b.js";const z=U({name:"ConsoleApplicationList",components:{Pagination:F,CopyToClipboard:N,ElTable:P,ElRow:x,ElButton:I,ElCol:L,ElTag:S,ElTableColumn:O,ElCard:R},data(){return{credentialType:D,applications:[],loading:!1,total:void 0,buying:!1,limit:10,form:{amount:1},active:{service:void 0,application:void 0}}},computed:{redirect(){var e;return(e=this.$route.query)==null?void 0:e.redirect},page(){var e;return parseInt(((e=this.$route.query.page)==null?void 0:e.toString())||"1")}},watch:{page:{handler(){this.onFetchData()}},type:{handler(){this.onFetchData()}}},mounted(){this.onFetchData()},methods:{onBuyMore(e){this.$router.push({name:B,params:{id:e.id}})},onPageChange(e){var d;this.$router.push({name:(d=this.$route.name)==null?void 0:d.toString(),query:{...this.$route.query,page:e}})},onFetchData(){this.loading=!0,T.getAll({limit:this.limit,offset:(this.page-1)*this.limit,user_id:this.$store.getters.user.id,ordering:"-created_at"}).then(({data:e})=>{this.applications=e.items,this.loading=!1,this.total=e.count}).catch(()=>{this.loading=!1})},getRemainingAmount(e){var p,m;if(e.remaining_amount===void 0||e.remaining_amount===null)return"";const d=this.$t(`service.unit.${(p=e==null?void 0:e.service)==null?void 0:p.unit}s`);return`${(m=e.remaining_amount)==null?void 0:m.toFixed(6)} ${d}`},getUsedAmount(e){var p,m;if(e.used_amount===void 0||e.used_amount===null)return"";const d=this.$t(`service.unit.${(p=e==null?void 0:e.service)==null?void 0:p.unit}s`);return`${(m=e.used_amount)==null?void 0:m.toFixed(6)} ${d}`}}}),j={class:"title"},H={class:"copy"},G={key:0,class:"expired-at"},J={class:"float-right"},K={class:"pagination"};function Q(e,d,p,m,W,X){const f=i("el-col"),h=i("el-row"),$=i("copy-to-clipboard"),u=i("el-table-column"),v=i("el-tag"),b=i("el-button"),w=i("el-table"),C=i("el-card"),k=i("pagination"),A=V("loading");return _(),c(h,{class:"panel"},{default:a(()=>[n(f,{span:24},{default:a(()=>[n(h,null,{default:a(()=>[n(f,{span:24},{default:a(()=>[s("h2",j,l(e.$t("common.title.allApplications")),1)]),_:1})]),_:1}),n(h,null,{default:a(()=>[n(f,{span:24},{default:a(()=>[n(C,{shadow:"hover"},{default:a(()=>[q((_(),c(w,{data:e.applications,stripe:"","table-layout":"fixed","empty-text":e.$t("common.message.noData")},{default:a(()=>[n(u,{prop:"id",label:e.$t("application.field.id"),width:"280px","class-name":"text-center"},{default:a(t=>{var o;return[s("span",null,l(t.row.id),1),s("span",H,[n($,{content:(o=t==null?void 0:t.row)==null?void 0:o.id,class:"inline-block"},null,8,["content"])])]}),_:1},8,["label"]),n(u,{label:e.$t("application.field.type"),width:"80px"},{default:a(t=>{var o,r;return[((o=t.row)==null?void 0:o.type)==="Period"?(_(),c(v,{key:0,type:"success",effect:"dark"},{default:a(()=>[y(l(e.$t("application.type.period")),1)]),_:1})):g("v-if",!0),((r=t.row)==null?void 0:r.type)==="Usage"?(_(),c(v,{key:1,effect:"dark"},{default:a(()=>[y(l(e.$t("application.type.usage")),1)]),_:1})):g("v-if",!0)]}),_:1},8,["label"]),n(u,{label:e.$t("application.field.name"),width:"180px"},{default:a(t=>{var o,r;return[s("span",null,l((r=(o=t.row)==null?void 0:o.service)==null?void 0:r.title),1)]}),_:1},8,["label"]),n(u,{prop:"remaining_amount",label:e.$t("application.field.remainingAmount"),width:"160px","class-name":"text-center"},{default:a(t=>[s("span",null,l(e.getRemainingAmount(t.row)),1)]),_:1},8,["label"]),n(u,{prop:"used_amount",label:e.$t("application.field.usedAmount"),width:"160px","class-name":"text-center"},{default:a(t=>[s("span",null,l(e.getUsedAmount(t.row)),1)]),_:1},8,["label"]),n(u,{label:e.$t("application.field.expiredAt"),width:"200px"},{default:a(t=>[t.row.expired_at?(_(),M("span",G,l(e.$dayjs.format(t.row.expired_at)),1)):g("v-if",!0)]),_:1},8,["label"]),n(u,{fixed:"right",width:"120px"},{default:a(t=>{var o,r;return[s("div",J,[((o=t==null?void 0:t.row)==null?void 0:o.type)==="Period"||((r=t==null?void 0:t.row)==null?void 0:r.type)==="Usage"?(_(),c(b,{key:0,type:"primary",round:"",size:"small",onClick:Y=>e.onBuyMore(t==null?void 0:t.row)},{default:a(()=>[y(l(e.$t("application.button.buyMore")),1)]),_:2},1032,["onClick"])):g("v-if",!0)])]}),_:1})]),_:1},8,["data","empty-text"])),[[A,e.loading]])]),_:1})]),_:1})]),_:1}),n(h,null,{default:a(()=>[n(f,null,{default:a(()=>[s("div",K,[n(k,{"current-page":e.page,"page-size":e.limit,total:e.total,onChange:e.onPageChange},null,8,["current-page","page-size","total","onChange"])])]),_:1})]),_:1})]),_:1})]),_:1})}var ue=E(z,[["render",Q],["__scopeId","data-v-31a091d9"],["__file","/home/runner/work/Nexior/Nexior/src/pages/console/application/List.vue"]]);export{ue as default};
1
+ import"./vendor-others.cdfefb59.js";import{_ as E,E as B,F as T}from"./index.97386539.js";import{I as D}from"./credential.26787c24.js";import{P as F}from"./Pagination.3c242094.js";import{C as N}from"./CopyToClipboard.dcbf7182.js";import{C as P,A as x,u as I,B as L,b as S,D as O,F as R}from"./vendor-element-plus.1fa87efb.js";import{H as U,al as i,av as V,L as c,M as a,o as _,V as n,f as s,T as l,O as q,S as y,R as g,e as M}from"./vendor-@vue.6c0309d3.js";import"./vendor-markdown.cf3e96ae.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.6ab44f81.js";import"./vendor-fortawesome.2b54ad1b.js";const z=U({name:"ConsoleApplicationList",components:{Pagination:F,CopyToClipboard:N,ElTable:P,ElRow:x,ElButton:I,ElCol:L,ElTag:S,ElTableColumn:O,ElCard:R},data(){return{credentialType:D,applications:[],loading:!1,total:void 0,buying:!1,limit:10,form:{amount:1},active:{service:void 0,application:void 0}}},computed:{redirect(){var e;return(e=this.$route.query)==null?void 0:e.redirect},page(){var e;return parseInt(((e=this.$route.query.page)==null?void 0:e.toString())||"1")}},watch:{page:{handler(){this.onFetchData()}},type:{handler(){this.onFetchData()}}},mounted(){this.onFetchData()},methods:{onBuyMore(e){this.$router.push({name:B,params:{id:e.id}})},onPageChange(e){var d;this.$router.push({name:(d=this.$route.name)==null?void 0:d.toString(),query:{...this.$route.query,page:e}})},onFetchData(){this.loading=!0,T.getAll({limit:this.limit,offset:(this.page-1)*this.limit,user_id:this.$store.getters.user.id,ordering:"-created_at"}).then(({data:e})=>{this.applications=e.items,this.loading=!1,this.total=e.count}).catch(()=>{this.loading=!1})},getRemainingAmount(e){var p,m;if(e.remaining_amount===void 0||e.remaining_amount===null)return"";const d=this.$t(`service.unit.${(p=e==null?void 0:e.service)==null?void 0:p.unit}s`);return`${(m=e.remaining_amount)==null?void 0:m.toFixed(6)} ${d}`},getUsedAmount(e){var p,m;if(e.used_amount===void 0||e.used_amount===null)return"";const d=this.$t(`service.unit.${(p=e==null?void 0:e.service)==null?void 0:p.unit}s`);return`${(m=e.used_amount)==null?void 0:m.toFixed(6)} ${d}`}}}),j={class:"title"},H={class:"copy"},G={key:0,class:"expired-at"},J={class:"float-right"},K={class:"pagination"};function Q(e,d,p,m,W,X){const f=i("el-col"),h=i("el-row"),$=i("copy-to-clipboard"),u=i("el-table-column"),v=i("el-tag"),b=i("el-button"),w=i("el-table"),C=i("el-card"),k=i("pagination"),A=V("loading");return _(),c(h,{class:"panel"},{default:a(()=>[n(f,{span:24},{default:a(()=>[n(h,null,{default:a(()=>[n(f,{span:24},{default:a(()=>[s("h2",j,l(e.$t("common.title.allApplications")),1)]),_:1})]),_:1}),n(h,null,{default:a(()=>[n(f,{span:24},{default:a(()=>[n(C,{shadow:"hover"},{default:a(()=>[q((_(),c(w,{data:e.applications,stripe:"","table-layout":"fixed","empty-text":e.$t("common.message.noData")},{default:a(()=>[n(u,{prop:"id",label:e.$t("application.field.id"),width:"280px","class-name":"text-center"},{default:a(t=>{var o;return[s("span",null,l(t.row.id),1),s("span",H,[n($,{content:(o=t==null?void 0:t.row)==null?void 0:o.id,class:"inline-block"},null,8,["content"])])]}),_:1},8,["label"]),n(u,{label:e.$t("application.field.type"),width:"80px"},{default:a(t=>{var o,r;return[((o=t.row)==null?void 0:o.type)==="Period"?(_(),c(v,{key:0,type:"success",effect:"dark"},{default:a(()=>[y(l(e.$t("application.type.period")),1)]),_:1})):g("v-if",!0),((r=t.row)==null?void 0:r.type)==="Usage"?(_(),c(v,{key:1,effect:"dark"},{default:a(()=>[y(l(e.$t("application.type.usage")),1)]),_:1})):g("v-if",!0)]}),_:1},8,["label"]),n(u,{label:e.$t("application.field.name"),width:"180px"},{default:a(t=>{var o,r;return[s("span",null,l((r=(o=t.row)==null?void 0:o.service)==null?void 0:r.title),1)]}),_:1},8,["label"]),n(u,{prop:"remaining_amount",label:e.$t("application.field.remainingAmount"),width:"160px","class-name":"text-center"},{default:a(t=>[s("span",null,l(e.getRemainingAmount(t.row)),1)]),_:1},8,["label"]),n(u,{prop:"used_amount",label:e.$t("application.field.usedAmount"),width:"160px","class-name":"text-center"},{default:a(t=>[s("span",null,l(e.getUsedAmount(t.row)),1)]),_:1},8,["label"]),n(u,{label:e.$t("application.field.expiredAt"),width:"200px"},{default:a(t=>[t.row.expired_at?(_(),M("span",G,l(e.$dayjs.format(t.row.expired_at)),1)):g("v-if",!0)]),_:1},8,["label"]),n(u,{fixed:"right",width:"120px"},{default:a(t=>{var o,r;return[s("div",J,[((o=t==null?void 0:t.row)==null?void 0:o.type)==="Period"||((r=t==null?void 0:t.row)==null?void 0:r.type)==="Usage"?(_(),c(b,{key:0,type:"primary",round:"",size:"small",onClick:Y=>e.onBuyMore(t==null?void 0:t.row)},{default:a(()=>[y(l(e.$t("application.button.buyMore")),1)]),_:2},1032,["onClick"])):g("v-if",!0)])]}),_:1})]),_:1},8,["data","empty-text"])),[[A,e.loading]])]),_:1})]),_:1})]),_:1}),n(h,null,{default:a(()=>[n(f,null,{default:a(()=>[s("div",K,[n(k,{"current-page":e.page,"page-size":e.limit,total:e.total,onChange:e.onPageChange},null,8,["current-page","page-size","total","onChange"])])]),_:1})]),_:1})]),_:1})]),_:1})}var ue=E(z,[["render",Q],["__scopeId","data-v-31a091d9"],["__file","/home/runner/work/Nexior/Nexior/src/pages/console/application/List.vue"]]);export{ue as default};
@@ -1 +1 @@
1
- import"./vendor-others.cdfefb59.js";import{o as E}from"./order.1ca24c7f.js";import{P as O}from"./Pagination.e3c91ab4.js";import{C as I}from"./CopyToClipboard.2d20734e.js";import{O as P}from"./order.aa35b6fb.js";import{_ as N}from"./index.60bb4e0a.js";import{g as F}from"./price.c9d715ac.js";import{A,B,C as L,D as T,u as V,b as z,F as H}from"./vendor-element-plus.1fa87efb.js";import{H as R,al as s,av as q,L as f,M as t,o as l,V as a,f as n,T as r,O as M,e as u,S as d,R as X}from"./vendor-@vue.6c0309d3.js";import"./vendor-markdown.cf3e96ae.js";import"./vendor-fortawesome.2b54ad1b.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.6ab44f81.js";const j=R({name:"ConsoleOrderList",components:{Pagination:O,CopyToClipboard:I,ElRow:A,ElCol:B,ElTable:L,ElTableColumn:T,ElButton:V,ElTag:z,ElCard:H},data(){return{OrderState:P,orders:[],loading:!1,total:void 0,limit:Math.floor((window.innerHeight-300)/50)}},computed:{redirect(){return this.$route.query.redirect},page(){var e;return parseInt(((e=this.$route.query.page)==null?void 0:e.toString())||"1")}},watch:{page:{handler(){this.onFetchData()}}},mounted(){this.onFetchData()},methods:{getPriceString:F,onPageChange(e){var h;this.$router.push({name:(h=this.$route.name)==null?void 0:h.toString(),query:{page:e}})},onFetchData(){this.loading=!0,E.getAll({ordering:"-created_at",limit:this.limit,offset:(this.page-1)*this.limit,user_id:this.$store.getters.user.id}).then(({data:e})=>{this.orders=e.items,this.loading=!1,this.total=e.count}).catch(()=>{this.loading=!1})}}}),G={class:"title"},J={class:"key"},K={class:"copy"},Q={class:"price"},U={key:0},W={key:1,class:"state state-paid"},Y={key:2,class:"state state-finished"},Z={key:3,class:"state state-expired"},x={key:4,class:"state state-failed"},ee={class:"description"},te={class:"created-at"},ae={class:"float-right"},oe={class:"pagination"};function re(e,h,se,le,ne,ie){const _=s("el-col"),m=s("el-row"),k=s("copy-to-clipboard"),p=s("el-table-column"),c=s("el-tag"),g=s("el-button"),v=s("el-table"),C=s("el-card"),S=s("pagination"),D=q("loading");return l(),f(m,{class:"panel"},{default:t(()=>[a(_,{span:24},{default:t(()=>[a(m,null,{default:t(()=>[a(_,{span:24},{default:t(()=>[n("h2",G,r(e.$t("common.title.allOrders")),1)]),_:1})]),_:1}),a(m,null,{default:t(()=>[a(_,{span:24},{default:t(()=>[a(C,{shadow:"hover"},{default:t(()=>[M((l(),f(v,{data:e.orders,stripe:""},{default:t(()=>[a(p,{prop:"id",label:e.$t("order.field.id"),"class-name":"text-center",width:"350px"},{default:t(o=>[n("span",J,r(o.row.id),1),n("span",K,[a(k,{content:o.row.id},null,8,["content"])])]),_:1},8,["label"]),a(p,{label:e.$t("order.field.price"),width:"100px"},{default:t(o=>{var i;return[n("span",Q,r(e.getPriceString({value:(i=o.row)==null?void 0:i.price})),1)]}),_:1},8,["label"]),a(p,{prop:"state",label:e.$t("order.field.state"),"class-name":"text-center",width:"150px"},{default:t(o=>{var i,w,y,$,b;return[o.row.state===((i=e.OrderState)==null?void 0:i.PENDING)?(l(),u("span",U,[a(c,{type:"info",class:"mx-1",effect:"dark"},{default:t(()=>[d(r(e.$t("order.state.pending")),1)]),_:1})])):o.row.state===((w=e.OrderState)==null?void 0:w.PAID)?(l(),u("span",W,[a(c,{type:"success",class:"mx-1",effect:"dark"},{default:t(()=>[d(r(e.$t("order.state.paid")),1)]),_:1})])):o.row.state===((y=e.OrderState)==null?void 0:y.FINISHED)?(l(),u("span",Y,[a(c,{type:"success",class:"mx-1",effect:"dark"},{default:t(()=>[d(r(e.$t("order.state.finished")),1)]),_:1})])):o.row.state===(($=e.OrderState)==null?void 0:$.EXPIRED)?(l(),u("span",Z,[a(c,{type:"danger",class:"mx-1",effect:"dark"},{default:t(()=>[d(r(e.$t("order.state.expired")),1)]),_:1})])):o.row.state===((b=e.OrderState)==null?void 0:b.FAILED)?(l(),u("span",x,[a(c,{type:"danger",class:"mx-1",effect:"dark"},{default:t(()=>[d(r(e.$t("order.state.failed")),1)]),_:1})])):X("v-if",!0)]}),_:1},8,["label"]),a(p,{label:e.$t("order.field.description"),width:"300px"},{default:t(o=>[n("span",ee,r(o.row.description),1)]),_:1},8,["label"]),a(p,{label:e.$t("order.field.createdAt"),width:"180px"},{default:t(o=>[n("span",te,r(e.$dayjs.format(o.row.created_at)),1)]),_:1},8,["label"]),a(p,{fixed:"right","min-width":"120px"},{default:t(o=>[n("div",ae,[o.row.state!==e.OrderState.PAID&&o.row.state!==e.OrderState.FINISHED&&o.row.state!==e.OrderState.EXPIRED?(l(),f(g,{key:0,type:"primary",size:"small",round:"",onClick:i=>e.$router.push({name:"console-order-detail",params:{id:o.row.id}})},{default:t(()=>[d(r(e.$t("order.button.continuePay")),1)]),_:2},1032,["onClick"])):(l(),f(g,{key:1,size:"small",round:"",onClick:i=>e.$router.push({name:"console-order-detail",params:{id:o.row.id}})},{default:t(()=>[d(r(e.$t("order.button.checkDetail")),1)]),_:2},1032,["onClick"]))])]),_:1})]),_:1},8,["data"])),[[D,e.loading]])]),_:1})]),_:1})]),_:1}),a(m,null,{default:t(()=>[a(_,null,{default:t(()=>[n("div",oe,[a(S,{"current-page":e.page,"page-size":e.limit,total:e.total,onChange:e.onPageChange},null,8,["current-page","page-size","total","onChange"])])]),_:1})]),_:1})]),_:1})]),_:1})}var ke=N(j,[["render",re],["__scopeId","data-v-388af89b"],["__file","/home/runner/work/Nexior/Nexior/src/pages/console/order/List.vue"]]);export{ke as default};
1
+ import"./vendor-others.cdfefb59.js";import{o as E}from"./order.f1773d29.js";import{P as O}from"./Pagination.3c242094.js";import{C as I}from"./CopyToClipboard.dcbf7182.js";import{O as P}from"./order.aa35b6fb.js";import{_ as N}from"./index.97386539.js";import{g as F}from"./price.cb59d1b0.js";import{A,B,C as L,D as T,u as V,b as z,F as H}from"./vendor-element-plus.1fa87efb.js";import{H as R,al as s,av as q,L as f,M as t,o as l,V as a,f as n,T as r,O as M,e as u,S as d,R as X}from"./vendor-@vue.6c0309d3.js";import"./vendor-markdown.cf3e96ae.js";import"./vendor-fortawesome.2b54ad1b.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.6ab44f81.js";const j=R({name:"ConsoleOrderList",components:{Pagination:O,CopyToClipboard:I,ElRow:A,ElCol:B,ElTable:L,ElTableColumn:T,ElButton:V,ElTag:z,ElCard:H},data(){return{OrderState:P,orders:[],loading:!1,total:void 0,limit:Math.floor((window.innerHeight-300)/50)}},computed:{redirect(){return this.$route.query.redirect},page(){var e;return parseInt(((e=this.$route.query.page)==null?void 0:e.toString())||"1")}},watch:{page:{handler(){this.onFetchData()}}},mounted(){this.onFetchData()},methods:{getPriceString:F,onPageChange(e){var h;this.$router.push({name:(h=this.$route.name)==null?void 0:h.toString(),query:{page:e}})},onFetchData(){this.loading=!0,E.getAll({ordering:"-created_at",limit:this.limit,offset:(this.page-1)*this.limit,user_id:this.$store.getters.user.id}).then(({data:e})=>{this.orders=e.items,this.loading=!1,this.total=e.count}).catch(()=>{this.loading=!1})}}}),G={class:"title"},J={class:"key"},K={class:"copy"},Q={class:"price"},U={key:0},W={key:1,class:"state state-paid"},Y={key:2,class:"state state-finished"},Z={key:3,class:"state state-expired"},x={key:4,class:"state state-failed"},ee={class:"description"},te={class:"created-at"},ae={class:"float-right"},oe={class:"pagination"};function re(e,h,se,le,ne,ie){const _=s("el-col"),m=s("el-row"),k=s("copy-to-clipboard"),p=s("el-table-column"),c=s("el-tag"),g=s("el-button"),v=s("el-table"),C=s("el-card"),S=s("pagination"),D=q("loading");return l(),f(m,{class:"panel"},{default:t(()=>[a(_,{span:24},{default:t(()=>[a(m,null,{default:t(()=>[a(_,{span:24},{default:t(()=>[n("h2",G,r(e.$t("common.title.allOrders")),1)]),_:1})]),_:1}),a(m,null,{default:t(()=>[a(_,{span:24},{default:t(()=>[a(C,{shadow:"hover"},{default:t(()=>[M((l(),f(v,{data:e.orders,stripe:""},{default:t(()=>[a(p,{prop:"id",label:e.$t("order.field.id"),"class-name":"text-center",width:"350px"},{default:t(o=>[n("span",J,r(o.row.id),1),n("span",K,[a(k,{content:o.row.id},null,8,["content"])])]),_:1},8,["label"]),a(p,{label:e.$t("order.field.price"),width:"100px"},{default:t(o=>{var i;return[n("span",Q,r(e.getPriceString({value:(i=o.row)==null?void 0:i.price})),1)]}),_:1},8,["label"]),a(p,{prop:"state",label:e.$t("order.field.state"),"class-name":"text-center",width:"150px"},{default:t(o=>{var i,w,y,$,b;return[o.row.state===((i=e.OrderState)==null?void 0:i.PENDING)?(l(),u("span",U,[a(c,{type:"info",class:"mx-1",effect:"dark"},{default:t(()=>[d(r(e.$t("order.state.pending")),1)]),_:1})])):o.row.state===((w=e.OrderState)==null?void 0:w.PAID)?(l(),u("span",W,[a(c,{type:"success",class:"mx-1",effect:"dark"},{default:t(()=>[d(r(e.$t("order.state.paid")),1)]),_:1})])):o.row.state===((y=e.OrderState)==null?void 0:y.FINISHED)?(l(),u("span",Y,[a(c,{type:"success",class:"mx-1",effect:"dark"},{default:t(()=>[d(r(e.$t("order.state.finished")),1)]),_:1})])):o.row.state===(($=e.OrderState)==null?void 0:$.EXPIRED)?(l(),u("span",Z,[a(c,{type:"danger",class:"mx-1",effect:"dark"},{default:t(()=>[d(r(e.$t("order.state.expired")),1)]),_:1})])):o.row.state===((b=e.OrderState)==null?void 0:b.FAILED)?(l(),u("span",x,[a(c,{type:"danger",class:"mx-1",effect:"dark"},{default:t(()=>[d(r(e.$t("order.state.failed")),1)]),_:1})])):X("v-if",!0)]}),_:1},8,["label"]),a(p,{label:e.$t("order.field.description"),width:"300px"},{default:t(o=>[n("span",ee,r(o.row.description),1)]),_:1},8,["label"]),a(p,{label:e.$t("order.field.createdAt"),width:"180px"},{default:t(o=>[n("span",te,r(e.$dayjs.format(o.row.created_at)),1)]),_:1},8,["label"]),a(p,{fixed:"right","min-width":"120px"},{default:t(o=>[n("div",ae,[o.row.state!==e.OrderState.PAID&&o.row.state!==e.OrderState.FINISHED&&o.row.state!==e.OrderState.EXPIRED?(l(),f(g,{key:0,type:"primary",size:"small",round:"",onClick:i=>e.$router.push({name:"console-order-detail",params:{id:o.row.id}})},{default:t(()=>[d(r(e.$t("order.button.continuePay")),1)]),_:2},1032,["onClick"])):(l(),f(g,{key:1,size:"small",round:"",onClick:i=>e.$router.push({name:"console-order-detail",params:{id:o.row.id}})},{default:t(()=>[d(r(e.$t("order.button.checkDetail")),1)]),_:2},1032,["onClick"]))])]),_:1})]),_:1},8,["data"])),[[D,e.loading]])]),_:1})]),_:1})]),_:1}),a(m,null,{default:t(()=>[a(_,null,{default:t(()=>[n("div",oe,[a(S,{"current-page":e.page,"page-size":e.limit,total:e.total,onChange:e.onPageChange},null,8,["current-page","page-size","total","onChange"])])]),_:1})]),_:1})]),_:1})]),_:1})}var ke=N(j,[["render",re],["__scopeId","data-v-388af89b"],["__file","/home/runner/work/Nexior/Nexior/src/pages/console/order/List.vue"]]);export{ke as default};
@@ -1 +1 @@
1
- var S=Object.defineProperty;var T=(e,t,o)=>t in e?S(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var w=(e,t,o)=>(T(e,typeof t!="symbol"?t+"":t,o),o);import"./vendor-others.cdfefb59.js";import{I as D}from"./credential.26787c24.js";import{B as C,_ as N,F as B}from"./index.60bb4e0a.js";import{P as L}from"./Pagination.e3c91ab4.js";import{C as O}from"./CopyToClipboard.2d20734e.js";import{b as P,C as R,N as z,O as j,A as H,B as M,D as G,F as J}from"./vendor-element-plus.1fa87efb.js";import{H as K,al as i,av as Q,L as g,M as n,o as u,V as l,f as r,T as s,e as f,ai as $,U as b,O as W,S as X,R as Y}from"./vendor-@vue.6c0309d3.js";import"./vendor-markdown.cf3e96ae.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.6ab44f81.js";import"./vendor-fortawesome.2b54ad1b.js";class Z{constructor(){w(this,"key","usage/apis")}async getAll(t){return await C.get(`/${this.key}/`,{params:t})}async get(t){return await C.get(`/${this.key}/${t}`)}}const x=new Z;const U=K({name:"ConsoleUsageList",components:{Pagination:L,ElTag:P,ElTable:R,ElSelect:z,ElOption:j,CopyToClipboard:O,ElRow:H,ElCol:M,ElTableColumn:G,ElCard:J},data(){var e,t;return{applicationId:(e=this.$route.query.application_id)==null?void 0:e.toString(),apiId:(t=this.$route.query.api_id)==null?void 0:t.toString(),applications:[],credentialType:D,apiUsages:[],loading:!1,total:void 0,limit:15}},computed:{redirect(){var e;return(e=this.$route.query)==null?void 0:e.redirect},page(){var e;return parseInt(((e=this.$route.query.page)==null?void 0:e.toString())||"1")},apis(){return this.applications.filter(e=>this.applicationId?e.id===this.applicationId:!0).map(e=>{var t;return(t=e.service)==null?void 0:t.apis}).flat()}},watch:{page:{handler(){this.onFetchApiUsages()}},type:{handler(){this.onFetchApiUsages()}}},mounted(){this.onFetchApplications(),this.onFetchApiUsages()},methods:{async onApiChange(e){var t;await this.$router.push({name:(t=this.$route.name)==null?void 0:t.toString(),query:{...this.$route.query,api_id:e}}),this.onFetchApiUsages()},async onApplicationChange(e){var t;await this.$router.push({name:(t=this.$route.name)==null?void 0:t.toString(),query:{...this.$route.query,application_id:e}}),this.onFetchApiUsages()},onPageChange(e){var t;this.$router.push({name:(t=this.$route.name)==null?void 0:t.toString(),query:{...this.$route.query,page:e}})},getRemainingAmount(e){var o,d;if(e.remaining_amount===void 0||e.remaining_amount===null)return"";const t=this.$t(`service.unit.${(o=e==null?void 0:e.service)==null?void 0:o.unit}s`);return`${(d=e.remaining_amount)==null?void 0:d.toFixed(6)} ${t}`},getUsedAmount(e){var o,d;if(e.used_amount===void 0||e.used_amount===null)return"";const t=this.$t(`service.unit.${(o=e==null?void 0:e.service)==null?void 0:o.unit}s`);return`${(d=e.used_amount)==null?void 0:d.toFixed(6)} ${t}`},getDeductedAmount(e){var o,d;if((e==null?void 0:e.deducted_amount)===void 0||(e==null?void 0:e.deducted_amount)===null)return"";const t=this.$t(`service.unit.${(o=e==null?void 0:e.service)==null?void 0:o.unit}s`);return`${(d=e.deducted_amount)==null?void 0:d.toFixed(6)} ${t}`},onFetchApplications(){B.getAll({limit:100,offset:0,user_id:this.$store.getters.user.id,ordering:"-created_at"}).then(({data:e})=>{this.applications=e.items,this.total=e.count}).catch(()=>{})},onFetchApiUsages(){this.loading=!0,x.getAll({limit:this.limit,offset:(this.page-1)*this.limit,user_id:this.$store.getters.user.id,ordering:"-created_at",...this.applicationId?{application_id:this.applicationId}:{},...this.apiId?{api_id:this.apiId}:{}}).then(({data:e})=>{this.apiUsages=e.items,this.loading=!1,this.total=e.count}).catch(()=>{this.loading=!1})}}}),ee={class:"title"},te={class:"inline-block mr-3"},ae={class:"inline-block mr-3"},ne={class:"key"},le={key:0,class:"copy"},oe={class:"created-at"},ie={class:"pagination"};function se(e,t,o,d,re,de){const A=i("help-entry"),h=i("el-col"),m=i("el-row"),y=i("el-option"),v=i("el-select"),p=i("el-table-column"),I=i("el-tag"),F=i("copy-to-clipboard"),k=i("el-table"),V=i("el-card"),q=i("pagination"),E=Q("loading");return u(),g(m,{class:"panel"},{default:n(()=>[l(A,{class:"help"}),l(h,{span:24},{default:n(()=>[l(m,null,{default:n(()=>[l(h,{span:24},{default:n(()=>[r("h2",ee,s(e.$t("common.title.allUsages")),1)]),_:1})]),_:1}),l(m,null,{default:n(()=>[l(h,{md:8,sm:12,class:"mb-4"},{default:n(()=>[r("span",te,s(e.$t("usage.field.application")),1),l(v,{modelValue:e.applicationId,"onUpdate:modelValue":t[0]||(t[0]=a=>e.applicationId=a),placeholder:e.$t("usage.field.application"),clearable:"",onChange:e.onApplicationChange},{default:n(()=>[(u(!0),f(b,null,$(e.applications,a=>{var c;return u(),g(y,{key:a.id,label:(c=a.service)==null?void 0:c.title,value:a==null?void 0:a.id},null,8,["label","value"])}),128))]),_:1},8,["modelValue","placeholder","onChange"])]),_:1}),l(h,{md:8,sm:12,class:"mb-4"},{default:n(()=>[r("span",ae,s(e.$t("usage.field.api")),1),l(v,{modelValue:e.apiId,"onUpdate:modelValue":t[1]||(t[1]=a=>e.apiId=a),placeholder:e.$t("usage.field.api"),clearable:"",onChange:e.onApiChange},{default:n(()=>[(u(!0),f(b,null,$(e.apis,a=>(u(),g(y,{key:a==null?void 0:a.id,label:a==null?void 0:a.title,value:a==null?void 0:a.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","onChange"])]),_:1})]),_:1}),l(m,null,{default:n(()=>[l(h,{span:24},{default:n(()=>[l(V,{shadow:"hover"},{default:n(()=>[W((u(),g(k,{data:e.apiUsages,stripe:"","table-layout":"fixed","empty-text":e.$t("common.message.noData")},{default:n(()=>[l(p,{label:e.$t("application.field.name"),width:"160px"},{default:n(a=>{var c,_;return[r("span",null,s((_=(c=a.row)==null?void 0:c.api)==null?void 0:_.title),1)]}),_:1},8,["label"]),l(p,{label:e.$t("usage.field.statusCode"),width:"120px"},{default:n(a=>[r("span",null,s(a.row.status_code),1)]),_:1},8,["label"]),l(p,{prop:"remaining_amount",label:e.$t("usage.field.remainingAmount"),width:"160px","class-name":"text-center"},{default:n(a=>[r("span",null,s(e.getRemainingAmount(a.row)),1)]),_:1},8,["label"]),l(p,{prop:"deducted_amount",label:e.$t("usage.field.deductedAmount"),width:"150px","class-name":"text-center"},{default:n(a=>[r("span",null,s(e.getDeductedAmount(a.row)),1)]),_:1},8,["label"]),l(p,{prop:"metadata",label:e.$t("usage.field.metadata"),width:"200px","class-name":"text-center"},{default:n(a=>[(u(!0),f(b,null,$(a.row.metadata,(c,_)=>(u(),g(I,{key:_,class:"mb-2"},{default:n(()=>[X(s(_)+": "+s(c),1)]),_:2},1024))),128))]),_:1},8,["label"]),l(p,{prop:"trace_id",label:e.$t("application.field.traceId"),width:"200px","class-name":"text-center"},{default:n(a=>[r("span",ne,s(a.row.trace_id),1),a.row.trace_id?(u(),f("span",le,[l(F,{content:a.row.trace_id,class:"inline-block"},null,8,["content"])])):Y("v-if",!0)]),_:1},8,["label"]),l(p,{label:e.$t("usage.field.createdAt"),width:"200px"},{default:n(a=>[r("span",oe,s(e.$dayjs.format(a.row.created_at)),1)]),_:1},8,["label"])]),_:1},8,["data","empty-text"])),[[E,e.loading]])]),_:1})]),_:1})]),_:1}),l(m,null,{default:n(()=>[l(h,null,{default:n(()=>[r("div",ie,[l(q,{"current-page":e.page,"page-size":e.limit,total:e.total,onChange:e.onPageChange},null,8,["current-page","page-size","total","onChange"])])]),_:1})]),_:1})]),_:1})]),_:1})}var we=N(U,[["render",se],["__scopeId","data-v-1d3a6fa8"],["__file","/home/runner/work/Nexior/Nexior/src/pages/console/usage/List.vue"]]);export{we as default};
1
+ var S=Object.defineProperty;var T=(e,t,o)=>t in e?S(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var w=(e,t,o)=>(T(e,typeof t!="symbol"?t+"":t,o),o);import"./vendor-others.cdfefb59.js";import{I as D}from"./credential.26787c24.js";import{B as C,_ as N,F as B}from"./index.97386539.js";import{P as L}from"./Pagination.3c242094.js";import{C as O}from"./CopyToClipboard.dcbf7182.js";import{b as P,C as R,N as z,O as j,A as H,B as M,D as G,F as J}from"./vendor-element-plus.1fa87efb.js";import{H as K,al as i,av as Q,L as g,M as n,o as u,V as l,f as r,T as s,e as f,ai as $,U as b,O as W,S as X,R as Y}from"./vendor-@vue.6c0309d3.js";import"./vendor-markdown.cf3e96ae.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.6ab44f81.js";import"./vendor-fortawesome.2b54ad1b.js";class Z{constructor(){w(this,"key","usage/apis")}async getAll(t){return await C.get(`/${this.key}/`,{params:t})}async get(t){return await C.get(`/${this.key}/${t}`)}}const x=new Z;const U=K({name:"ConsoleUsageList",components:{Pagination:L,ElTag:P,ElTable:R,ElSelect:z,ElOption:j,CopyToClipboard:O,ElRow:H,ElCol:M,ElTableColumn:G,ElCard:J},data(){var e,t;return{applicationId:(e=this.$route.query.application_id)==null?void 0:e.toString(),apiId:(t=this.$route.query.api_id)==null?void 0:t.toString(),applications:[],credentialType:D,apiUsages:[],loading:!1,total:void 0,limit:15}},computed:{redirect(){var e;return(e=this.$route.query)==null?void 0:e.redirect},page(){var e;return parseInt(((e=this.$route.query.page)==null?void 0:e.toString())||"1")},apis(){return this.applications.filter(e=>this.applicationId?e.id===this.applicationId:!0).map(e=>{var t;return(t=e.service)==null?void 0:t.apis}).flat()}},watch:{page:{handler(){this.onFetchApiUsages()}},type:{handler(){this.onFetchApiUsages()}}},mounted(){this.onFetchApplications(),this.onFetchApiUsages()},methods:{async onApiChange(e){var t;await this.$router.push({name:(t=this.$route.name)==null?void 0:t.toString(),query:{...this.$route.query,api_id:e}}),this.onFetchApiUsages()},async onApplicationChange(e){var t;await this.$router.push({name:(t=this.$route.name)==null?void 0:t.toString(),query:{...this.$route.query,application_id:e}}),this.onFetchApiUsages()},onPageChange(e){var t;this.$router.push({name:(t=this.$route.name)==null?void 0:t.toString(),query:{...this.$route.query,page:e}})},getRemainingAmount(e){var o,d;if(e.remaining_amount===void 0||e.remaining_amount===null)return"";const t=this.$t(`service.unit.${(o=e==null?void 0:e.service)==null?void 0:o.unit}s`);return`${(d=e.remaining_amount)==null?void 0:d.toFixed(6)} ${t}`},getUsedAmount(e){var o,d;if(e.used_amount===void 0||e.used_amount===null)return"";const t=this.$t(`service.unit.${(o=e==null?void 0:e.service)==null?void 0:o.unit}s`);return`${(d=e.used_amount)==null?void 0:d.toFixed(6)} ${t}`},getDeductedAmount(e){var o,d;if((e==null?void 0:e.deducted_amount)===void 0||(e==null?void 0:e.deducted_amount)===null)return"";const t=this.$t(`service.unit.${(o=e==null?void 0:e.service)==null?void 0:o.unit}s`);return`${(d=e.deducted_amount)==null?void 0:d.toFixed(6)} ${t}`},onFetchApplications(){B.getAll({limit:100,offset:0,user_id:this.$store.getters.user.id,ordering:"-created_at"}).then(({data:e})=>{this.applications=e.items,this.total=e.count}).catch(()=>{})},onFetchApiUsages(){this.loading=!0,x.getAll({limit:this.limit,offset:(this.page-1)*this.limit,user_id:this.$store.getters.user.id,ordering:"-created_at",...this.applicationId?{application_id:this.applicationId}:{},...this.apiId?{api_id:this.apiId}:{}}).then(({data:e})=>{this.apiUsages=e.items,this.loading=!1,this.total=e.count}).catch(()=>{this.loading=!1})}}}),ee={class:"title"},te={class:"inline-block mr-3"},ae={class:"inline-block mr-3"},ne={class:"key"},le={key:0,class:"copy"},oe={class:"created-at"},ie={class:"pagination"};function se(e,t,o,d,re,de){const A=i("help-entry"),h=i("el-col"),m=i("el-row"),y=i("el-option"),v=i("el-select"),p=i("el-table-column"),I=i("el-tag"),F=i("copy-to-clipboard"),k=i("el-table"),V=i("el-card"),q=i("pagination"),E=Q("loading");return u(),g(m,{class:"panel"},{default:n(()=>[l(A,{class:"help"}),l(h,{span:24},{default:n(()=>[l(m,null,{default:n(()=>[l(h,{span:24},{default:n(()=>[r("h2",ee,s(e.$t("common.title.allUsages")),1)]),_:1})]),_:1}),l(m,null,{default:n(()=>[l(h,{md:8,sm:12,class:"mb-4"},{default:n(()=>[r("span",te,s(e.$t("usage.field.application")),1),l(v,{modelValue:e.applicationId,"onUpdate:modelValue":t[0]||(t[0]=a=>e.applicationId=a),placeholder:e.$t("usage.field.application"),clearable:"",onChange:e.onApplicationChange},{default:n(()=>[(u(!0),f(b,null,$(e.applications,a=>{var c;return u(),g(y,{key:a.id,label:(c=a.service)==null?void 0:c.title,value:a==null?void 0:a.id},null,8,["label","value"])}),128))]),_:1},8,["modelValue","placeholder","onChange"])]),_:1}),l(h,{md:8,sm:12,class:"mb-4"},{default:n(()=>[r("span",ae,s(e.$t("usage.field.api")),1),l(v,{modelValue:e.apiId,"onUpdate:modelValue":t[1]||(t[1]=a=>e.apiId=a),placeholder:e.$t("usage.field.api"),clearable:"",onChange:e.onApiChange},{default:n(()=>[(u(!0),f(b,null,$(e.apis,a=>(u(),g(y,{key:a==null?void 0:a.id,label:a==null?void 0:a.title,value:a==null?void 0:a.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","onChange"])]),_:1})]),_:1}),l(m,null,{default:n(()=>[l(h,{span:24},{default:n(()=>[l(V,{shadow:"hover"},{default:n(()=>[W((u(),g(k,{data:e.apiUsages,stripe:"","table-layout":"fixed","empty-text":e.$t("common.message.noData")},{default:n(()=>[l(p,{label:e.$t("application.field.name"),width:"160px"},{default:n(a=>{var c,_;return[r("span",null,s((_=(c=a.row)==null?void 0:c.api)==null?void 0:_.title),1)]}),_:1},8,["label"]),l(p,{label:e.$t("usage.field.statusCode"),width:"120px"},{default:n(a=>[r("span",null,s(a.row.status_code),1)]),_:1},8,["label"]),l(p,{prop:"remaining_amount",label:e.$t("usage.field.remainingAmount"),width:"160px","class-name":"text-center"},{default:n(a=>[r("span",null,s(e.getRemainingAmount(a.row)),1)]),_:1},8,["label"]),l(p,{prop:"deducted_amount",label:e.$t("usage.field.deductedAmount"),width:"150px","class-name":"text-center"},{default:n(a=>[r("span",null,s(e.getDeductedAmount(a.row)),1)]),_:1},8,["label"]),l(p,{prop:"metadata",label:e.$t("usage.field.metadata"),width:"200px","class-name":"text-center"},{default:n(a=>[(u(!0),f(b,null,$(a.row.metadata,(c,_)=>(u(),g(I,{key:_,class:"mb-2"},{default:n(()=>[X(s(_)+": "+s(c),1)]),_:2},1024))),128))]),_:1},8,["label"]),l(p,{prop:"trace_id",label:e.$t("application.field.traceId"),width:"200px","class-name":"text-center"},{default:n(a=>[r("span",ne,s(a.row.trace_id),1),a.row.trace_id?(u(),f("span",le,[l(F,{content:a.row.trace_id,class:"inline-block"},null,8,["content"])])):Y("v-if",!0)]),_:1},8,["label"]),l(p,{label:e.$t("usage.field.createdAt"),width:"200px"},{default:n(a=>[r("span",oe,s(e.$dayjs.format(a.row.created_at)),1)]),_:1},8,["label"])]),_:1},8,["data","empty-text"])),[[E,e.loading]])]),_:1})]),_:1})]),_:1}),l(m,null,{default:n(()=>[l(h,null,{default:n(()=>[r("div",ie,[l(q,{"current-page":e.page,"page-size":e.limit,total:e.total,onChange:e.onPageChange},null,8,["current-page","page-size","total","onChange"])])]),_:1})]),_:1})]),_:1})]),_:1})}var we=N(U,[["render",se],["__scopeId","data-v-1d3a6fa8"],["__file","/home/runner/work/Nexior/Nexior/src/pages/console/usage/List.vue"]]);export{we as default};
@@ -1 +1 @@
1
- import"./vendor-others.cdfefb59.js";import{_ as r}from"./index.60bb4e0a.js";import{H as e}from"./vendor-@vue.6c0309d3.js";import"./vendor-element-plus.1fa87efb.js";import"./vendor-markdown.cf3e96ae.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.6ab44f81.js";import"./vendor-fortawesome.2b54ad1b.js";const o=e({name:"AuthLogin",data(){var t;return{redirect:(t=this.$route.query.redirect)==null?void 0:t.toString()}},async mounted(){this.$store.state.token.access?this.$router.push(this.redirect||"/"):this.$store.dispatch("login")}});var h=r(o,[["__file","/home/runner/work/Nexior/Nexior/src/pages/auth/Login.vue"]]);export{h as default};
1
+ import"./vendor-others.cdfefb59.js";import{_ as r}from"./index.97386539.js";import{H as e}from"./vendor-@vue.6c0309d3.js";import"./vendor-element-plus.1fa87efb.js";import"./vendor-markdown.cf3e96ae.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.6ab44f81.js";import"./vendor-fortawesome.2b54ad1b.js";const o=e({name:"AuthLogin",data(){var t;return{redirect:(t=this.$route.query.redirect)==null?void 0:t.toString()}},async mounted(){this.$store.state.token.access?this.$router.push(this.redirect||"/"):this.$store.dispatch("login")}});var h=r(o,[["__file","/home/runner/work/Nexior/Nexior/src/pages/auth/Login.vue"]]);export{h as default};
@@ -1 +1 @@
1
- import"./vendor-others.cdfefb59.js";import{N as c}from"./Navigator.778b9aca.js";import{A as m}from"./Status.54e386d8.js";import{_ as u,K as i}from"./index.60bb4e0a.js";import{H as d,al as a,e as h,V as s,L as v,R as $,o as n}from"./vendor-@vue.6c0309d3.js";import"./vendor-element-plus.1fa87efb.js";import"./vendor-markdown.cf3e96ae.js";import"./vendor-fortawesome.2b54ad1b.js";import"./EditArray.4e85afd6.js";import"./CopyToClipboard.2d20734e.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.6ab44f81.js";const N=d({name:"LayoutMain",components:{Navigator:c,ApplicationStatus:m},data(){return{mobile:window.innerWidth<768}},computed:{appName(){return this.$route.meta.appName},initializing(){var t;return((t=this.$store.state[this.appName])==null?void 0:t.status.getApplications)===i.Request},needApply(){return this.$store.state[this.appName].status.getApplications===i.Success&&!this.application},application(){return this.$store.state[this.appName].application},applications(){return this.$store.state[this.appName].applications},loading(){var t,e;return((e=(t=this.$store.state[this.appName])==null?void 0:t.status)==null?void 0:e.getApplications)===i.Request},service(){var t;return(t=this.$store.state[this.appName])==null?void 0:t.service}},mounted(){window.addEventListener("resize",()=>{this.mobile=window.innerWidth<768})}}),_={class:"wrapper"};function f(t,e,g,w,y,A){const p=a("router-view"),r=a("navigator"),l=a("application-status");return n(),h("div",_,[s(p,{class:"main"}),s(r,{class:"navigator",direction:t.mobile?"row":"column"},null,8,["direction"]),t.application?(n(),v(l,{key:0,class:"fixed right-2 top-2",application:t.application,applications:t.applications,initializing:t.initializing,"show-price":!1,authenticated:!!t.$store.state.token.access,service:t.service,"need-apply":t.needApply,onSelect:e[0]||(e[0]=o=>t.$store.dispatch(`${t.appName}/setApplication`,o)),onRefresh:e[1]||(e[1]=o=>t.$store.dispatch(`${t.appName}/getApplications`))},null,8,["application","applications","initializing","authenticated","service","need-apply"])):$("v-if",!0)])}var W=u(N,[["render",f],["__scopeId","data-v-63155678"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Main.vue"]]);export{W as default};
1
+ import"./vendor-others.cdfefb59.js";import{N as c}from"./Navigator.3204ea1d.js";import{A as m}from"./Status.ce9bc4cb.js";import{_ as u,K as i}from"./index.97386539.js";import{H as d,al as a,e as h,V as s,L as v,R as $,o as n}from"./vendor-@vue.6c0309d3.js";import"./vendor-element-plus.1fa87efb.js";import"./vendor-markdown.cf3e96ae.js";import"./vendor-fortawesome.2b54ad1b.js";import"./EditArray.fc90290f.js";import"./CopyToClipboard.dcbf7182.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.6ab44f81.js";const N=d({name:"LayoutMain",components:{Navigator:c,ApplicationStatus:m},data(){return{mobile:window.innerWidth<768}},computed:{appName(){return this.$route.meta.appName},initializing(){var t;return((t=this.$store.state[this.appName])==null?void 0:t.status.getApplications)===i.Request},needApply(){return this.$store.state[this.appName].status.getApplications===i.Success&&!this.application},application(){return this.$store.state[this.appName].application},applications(){return this.$store.state[this.appName].applications},loading(){var t,e;return((e=(t=this.$store.state[this.appName])==null?void 0:t.status)==null?void 0:e.getApplications)===i.Request},service(){var t;return(t=this.$store.state[this.appName])==null?void 0:t.service}},mounted(){window.addEventListener("resize",()=>{this.mobile=window.innerWidth<768})}}),_={class:"wrapper"};function f(t,e,g,w,y,A){const p=a("router-view"),r=a("navigator"),l=a("application-status");return n(),h("div",_,[s(p,{class:"main"}),s(r,{class:"navigator",direction:t.mobile?"row":"column"},null,8,["direction"]),t.application?(n(),v(l,{key:0,class:"fixed right-2 top-2",application:t.application,applications:t.applications,initializing:t.initializing,"show-price":!1,authenticated:!!t.$store.state.token.access,service:t.service,"need-apply":t.needApply,onSelect:e[0]||(e[0]=o=>t.$store.dispatch(`${t.appName}/setApplication`,o)),onRefresh:e[1]||(e[1]=o=>t.$store.dispatch(`${t.appName}/getApplications`))},null,8,["application","applications","initializing","authenticated","service","need-apply"])):$("v-if",!0)])}var W=u(N,[["render",f],["__scopeId","data-v-63155678"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Main.vue"]]);export{W as default};
@@ -1 +1 @@
1
- import"./vendor-others.cdfefb59.js";import{L as S}from"./Chatdoc.0d355719.js";import{u as D,E as L,x as N,k as z,Y as B,y as p,C as T,b as F,D as M}from"./vendor-element-plus.1fa87efb.js";import{A as P,_ as k,K as w}from"./index.60bb4e0a.js";import{H as E,al as l,o as n,e as b,V as s,M as o,P as K,L as m,R as h,f as c,T as a,S as d,U as R,av as O,O as j}from"./vendor-@vue.6c0309d3.js";import{A as q}from"./Status.54e386d8.js";import"./vendor-markdown.cf3e96ae.js";import"./vendor-fortawesome.2b54ad1b.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.6ab44f81.js";import"./CopyToClipboard.2d20734e.js";const H=E({name:"UploadDocument",components:{ElButton:D,ElDialog:L,ElUpload:N,ElIcon:z,UploadFilled:B},data(){return{dialogVisible:!1,fileList:[],learning:!1,uploadUrl:P()+"/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})}},async mounted(){},methods:{onExceed(){p.warning(this.$t("chatdoc.message.uploadDocumentsExceed"))},onError(){p.error(this.$t("chatdoc.message.uploadDocumentsError"))},async onSuccess(){p.success(this.$t("chatdoc.message.uploadDocumentsSuccess")),p.info(this.$t("chatdoc.message.startCreateDocument")),this.learning=!0,this.$store.dispatch("chatdoc/createDocument",{repositoryId:this.$route.params.repositoryId,fileUrl:this.urls[0],fileName:this.fileList[0].name}).then(()=>{p.success(this.$t("chatdoc.message.createDocumentSuccess")),this.dialogVisible=!1,this.$store.dispatch("chatdoc/getDocuments",{repositoryId:this.$route.params.repositoryId}),this.$store.dispatch("chatdoc/getApplications")}).catch(()=>{p.error(this.$t("chatdoc.message.createDocumentError"))}).finally(()=>{this.fileList=[],this.learning=!1})}}}),Y={key:1,class:"el-upload__text"},G={key:2};function J(e,t,_,$,C,I){const v=l("upload-filled"),y=l("el-icon"),r=l("el-upload"),f=l("el-dialog"),g=l("el-button");return n(),b(R,null,[s(f,{modelValue:e.dialogVisible,"onUpdate:modelValue":t[1]||(t[1]=u=>e.dialogVisible=u)},{default:o(()=>[s(r,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=u=>e.fileList=u),accept:".docx,.doc,.pdf,.txt,.csv,.enex,.epub,.eml,.html,.htm,.shtml,.md,.odt,.ppt,.pptx,.txt",drag:"",class:K({upload:!0}),name:"file","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:o(()=>[e.learning?h("v-if",!0):(n(),m(y,{key:0,class:"el-icon--upload"},{default:o(()=>[s(v)]),_:1})),e.learning?h("v-if",!0):(n(),b("div",Y,[c("p",null,a(e.$t("chatdoc.message.dragOrClickToUpload")),1),c("p",null,a(e.$t("chatdoc.message.supportedFiles")),1)])),e.learning?(n(),b("div",G,a(e.$t("chatdoc.message.learningDocument")),1)):h("v-if",!0)]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])]),_:1},8,["modelValue"]),s(g,{type:"primary",round:"",onClick:t[2]||(t[2]=u=>e.dialogVisible=!0)},{default:o(()=>[d(a(e.$t("chatdoc.button.uploadDocuments")),1)]),_:1})],64)}var Q=k(H,[["render",J],["__scopeId","data-v-4a88fdfb"],["__file","/home/runner/work/Nexior/Nexior/src/components/chatdoc/UploadDocument.vue"]]);const W=E({name:"ChatdocKnowledge",components:{Layout:S,ElButton:D,ElTable:T,ElTag:F,ApplicationStatus:q,ElTableColumn:M,UploadDocument:Q},data(){return{loading:!1,repositoryId:this.$route.params.repositoryId.toString()}},computed:{repository(){var e,t,_;return(_=(t=(e=this.$store.state)==null?void 0:e.chatdoc)==null?void 0:t.repositories)==null?void 0:_.find($=>$.id===this.repositoryId)},documents(){var e;return(e=this.repository)==null?void 0:e.documents},needApply(){return this.$store.state.chatdoc.status.getApplications===w.Success&&!this.application},service(){return this.$store.state.chatdoc.service},application(){return this.$store.state.chatdoc.application},initializing(){return this.$store.state.chatdoc.status.getApplications===w.Request}},async mounted(){console.log("start get documents"),this.loading=!0,this.$store.dispatch("chatdoc/getDocuments",{repositoryId:this.repositoryId}).then(()=>{this.loading=!1}).catch(()=>{this.loading=!1})},methods:{onDelete(e){this.$store.dispatch("chatdoc/deleteDocument",{id:e}).then(()=>{p.success(this.$t("chatdoc.message.deleteDocumentSuccess")),this.$store.dispatch("chatdoc/getDocuments",{repositoryId:this.repositoryId})})},onPreview(e){window.open(e,"_blank")}}}),X={class:"wrapper"},Z={class:"title"},x={class:"introduction"},ee={class:"status"},te={class:"operations"},oe={class:"documents"};function se(e,t,_,$,C,I){const v=l("application-status"),y=l("upload-document"),r=l("el-table-column"),f=l("el-tag"),g=l("el-button"),u=l("el-table"),U=l("layout"),V=O("loading");return n(),m(U,null,{chatdoc:o(()=>[c("div",X,[c("div",Z,a(e.$t("chatdoc.title.manage")),1),c("div",x,a(e.$t("chatdoc.message.introductionForKnowledge")),1),c("div",ee,[s(v,{"show-price":!1,initializing:e.initializing,application:e.application,"need-apply":e.needApply,service:e.service,onRefresh:t[0]||(t[0]=i=>e.$store.dispatch("chatdoc/getApplications"))},null,8,["initializing","application","need-apply","service"])]),c("div",te,[s(y)]),c("div",oe,[j((n(),m(u,{data:e.documents,border:""},{default:o(()=>[s(r,{prop:"id",label:"ID"}),s(r,{prop:"file_name",label:e.$t("chatdoc.field.fileName")},null,8,["label"]),s(r,{label:e.$t("chatdoc.field.fileExtension"),width:"100px"},{default:o(i=>[d(a(i.row.file_name.split(".").pop()),1)]),_:1},8,["label"]),s(r,{label:e.$t("chatdoc.field.createdAt"),width:"200px"},{default:o(i=>[d(a(i.row.created_at?e.$dayjs.format(i.row.created_at):""),1)]),_:1},8,["label"]),s(r,{label:e.$t("chatdoc.field.state"),width:"180px"},{default:o(i=>[i.row.state==="processing"?(n(),m(f,{key:0,type:"info"},{default:o(()=>[d(a(e.$t("chatdoc.field.stateProcessing")),1)]),_:1})):h("v-if",!0),i.row.state==="failed"?(n(),m(f,{key:1,type:"danger"},{default:o(()=>[d(a(e.$t("chatdoc.field.stateFailed")),1)]),_:1})):h("v-if",!0),i.row.state==="completed"?(n(),m(f,{key:2,type:"success"},{default:o(()=>[d(a(e.$t("chatdoc.field.stateCompleted")),1)]),_:1})):h("v-if",!0)]),_:1},8,["label"]),s(r,null,{default:o(i=>[s(g,{type:"primary",round:"",size:"small",onClick:A=>e.onPreview(i.row.file_url)},{default:o(()=>[d(a(e.$t("common.button.preview")),1)]),_:2},1032,["onClick"]),s(g,{type:"danger",round:"",size:"small",onClick:A=>e.onDelete(i.row.id)},{default:o(()=>[d(a(e.$t("common.button.delete")),1)]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])),[[V,e.loading]])])])]),_:1})}var fe=k(W,[["render",se],["__scopeId","data-v-69ae9518"],["__file","/home/runner/work/Nexior/Nexior/src/pages/chatdoc/Manage.vue"]]);export{fe as default};
1
+ import"./vendor-others.cdfefb59.js";import{L as S}from"./Chatdoc.5263125f.js";import{u as D,E as L,x as N,k as z,Y as B,y as p,C as T,b as F,D as M}from"./vendor-element-plus.1fa87efb.js";import{A as P,_ as k,K as w}from"./index.97386539.js";import{H as E,al as l,o as n,e as b,V as s,M as o,P as K,L as m,R as h,f as c,T as a,S as d,U as R,av as O,O as j}from"./vendor-@vue.6c0309d3.js";import{A as q}from"./Status.ce9bc4cb.js";import"./vendor-markdown.cf3e96ae.js";import"./vendor-fortawesome.2b54ad1b.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.6ab44f81.js";import"./CopyToClipboard.dcbf7182.js";const H=E({name:"UploadDocument",components:{ElButton:D,ElDialog:L,ElUpload:N,ElIcon:z,UploadFilled:B},data(){return{dialogVisible:!1,fileList:[],learning:!1,uploadUrl:P()+"/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})}},async mounted(){},methods:{onExceed(){p.warning(this.$t("chatdoc.message.uploadDocumentsExceed"))},onError(){p.error(this.$t("chatdoc.message.uploadDocumentsError"))},async onSuccess(){p.success(this.$t("chatdoc.message.uploadDocumentsSuccess")),p.info(this.$t("chatdoc.message.startCreateDocument")),this.learning=!0,this.$store.dispatch("chatdoc/createDocument",{repositoryId:this.$route.params.repositoryId,fileUrl:this.urls[0],fileName:this.fileList[0].name}).then(()=>{p.success(this.$t("chatdoc.message.createDocumentSuccess")),this.dialogVisible=!1,this.$store.dispatch("chatdoc/getDocuments",{repositoryId:this.$route.params.repositoryId}),this.$store.dispatch("chatdoc/getApplications")}).catch(()=>{p.error(this.$t("chatdoc.message.createDocumentError"))}).finally(()=>{this.fileList=[],this.learning=!1})}}}),Y={key:1,class:"el-upload__text"},G={key:2};function J(e,t,_,$,C,I){const v=l("upload-filled"),y=l("el-icon"),r=l("el-upload"),f=l("el-dialog"),g=l("el-button");return n(),b(R,null,[s(f,{modelValue:e.dialogVisible,"onUpdate:modelValue":t[1]||(t[1]=u=>e.dialogVisible=u)},{default:o(()=>[s(r,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=u=>e.fileList=u),accept:".docx,.doc,.pdf,.txt,.csv,.enex,.epub,.eml,.html,.htm,.shtml,.md,.odt,.ppt,.pptx,.txt",drag:"",class:K({upload:!0}),name:"file","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:o(()=>[e.learning?h("v-if",!0):(n(),m(y,{key:0,class:"el-icon--upload"},{default:o(()=>[s(v)]),_:1})),e.learning?h("v-if",!0):(n(),b("div",Y,[c("p",null,a(e.$t("chatdoc.message.dragOrClickToUpload")),1),c("p",null,a(e.$t("chatdoc.message.supportedFiles")),1)])),e.learning?(n(),b("div",G,a(e.$t("chatdoc.message.learningDocument")),1)):h("v-if",!0)]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])]),_:1},8,["modelValue"]),s(g,{type:"primary",round:"",onClick:t[2]||(t[2]=u=>e.dialogVisible=!0)},{default:o(()=>[d(a(e.$t("chatdoc.button.uploadDocuments")),1)]),_:1})],64)}var Q=k(H,[["render",J],["__scopeId","data-v-4a88fdfb"],["__file","/home/runner/work/Nexior/Nexior/src/components/chatdoc/UploadDocument.vue"]]);const W=E({name:"ChatdocKnowledge",components:{Layout:S,ElButton:D,ElTable:T,ElTag:F,ApplicationStatus:q,ElTableColumn:M,UploadDocument:Q},data(){return{loading:!1,repositoryId:this.$route.params.repositoryId.toString()}},computed:{repository(){var e,t,_;return(_=(t=(e=this.$store.state)==null?void 0:e.chatdoc)==null?void 0:t.repositories)==null?void 0:_.find($=>$.id===this.repositoryId)},documents(){var e;return(e=this.repository)==null?void 0:e.documents},needApply(){return this.$store.state.chatdoc.status.getApplications===w.Success&&!this.application},service(){return this.$store.state.chatdoc.service},application(){return this.$store.state.chatdoc.application},initializing(){return this.$store.state.chatdoc.status.getApplications===w.Request}},async mounted(){console.log("start get documents"),this.loading=!0,this.$store.dispatch("chatdoc/getDocuments",{repositoryId:this.repositoryId}).then(()=>{this.loading=!1}).catch(()=>{this.loading=!1})},methods:{onDelete(e){this.$store.dispatch("chatdoc/deleteDocument",{id:e}).then(()=>{p.success(this.$t("chatdoc.message.deleteDocumentSuccess")),this.$store.dispatch("chatdoc/getDocuments",{repositoryId:this.repositoryId})})},onPreview(e){window.open(e,"_blank")}}}),X={class:"wrapper"},Z={class:"title"},x={class:"introduction"},ee={class:"status"},te={class:"operations"},oe={class:"documents"};function se(e,t,_,$,C,I){const v=l("application-status"),y=l("upload-document"),r=l("el-table-column"),f=l("el-tag"),g=l("el-button"),u=l("el-table"),U=l("layout"),V=O("loading");return n(),m(U,null,{chatdoc:o(()=>[c("div",X,[c("div",Z,a(e.$t("chatdoc.title.manage")),1),c("div",x,a(e.$t("chatdoc.message.introductionForKnowledge")),1),c("div",ee,[s(v,{"show-price":!1,initializing:e.initializing,application:e.application,"need-apply":e.needApply,service:e.service,onRefresh:t[0]||(t[0]=i=>e.$store.dispatch("chatdoc/getApplications"))},null,8,["initializing","application","need-apply","service"])]),c("div",te,[s(y)]),c("div",oe,[j((n(),m(u,{data:e.documents,border:""},{default:o(()=>[s(r,{prop:"id",label:"ID"}),s(r,{prop:"file_name",label:e.$t("chatdoc.field.fileName")},null,8,["label"]),s(r,{label:e.$t("chatdoc.field.fileExtension"),width:"100px"},{default:o(i=>[d(a(i.row.file_name.split(".").pop()),1)]),_:1},8,["label"]),s(r,{label:e.$t("chatdoc.field.createdAt"),width:"200px"},{default:o(i=>[d(a(i.row.created_at?e.$dayjs.format(i.row.created_at):""),1)]),_:1},8,["label"]),s(r,{label:e.$t("chatdoc.field.state"),width:"180px"},{default:o(i=>[i.row.state==="processing"?(n(),m(f,{key:0,type:"info"},{default:o(()=>[d(a(e.$t("chatdoc.field.stateProcessing")),1)]),_:1})):h("v-if",!0),i.row.state==="failed"?(n(),m(f,{key:1,type:"danger"},{default:o(()=>[d(a(e.$t("chatdoc.field.stateFailed")),1)]),_:1})):h("v-if",!0),i.row.state==="completed"?(n(),m(f,{key:2,type:"success"},{default:o(()=>[d(a(e.$t("chatdoc.field.stateCompleted")),1)]),_:1})):h("v-if",!0)]),_:1},8,["label"]),s(r,null,{default:o(i=>[s(g,{type:"primary",round:"",size:"small",onClick:A=>e.onPreview(i.row.file_url)},{default:o(()=>[d(a(e.$t("common.button.preview")),1)]),_:2},1032,["onClick"]),s(g,{type:"danger",round:"",size:"small",onClick:A=>e.onDelete(i.row.id)},{default:o(()=>[d(a(e.$t("common.button.delete")),1)]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])),[[V,e.loading]])])])]),_:1})}var fe=k(W,[["render",se],["__scopeId","data-v-69ae9518"],["__file","/home/runner/work/Nexior/Nexior/src/pages/chatdoc/Manage.vue"]]);export{fe as default};
@@ -1 +1 @@
1
- import{a9 as l,al as u,am as p}from"./vendor-others.cdfefb59.js";import{M as _}from"./vendor-markdown.cf3e96ae.js";import{a8 as m,_ as c}from"./index.60bb4e0a.js";import{H as i,m as h,ah as v,al as f,av as g,O as k,o as w,L as y}from"./vendor-@vue.6c0309d3.js";import"./vendor-highlight.js.6ee9ffbc.js";const M=async r=>{const n=(await l(()=>import("./vendor-highlight.js.6ee9ffbc.js"),["assets/vendor-highlight.js.6ee9ffbc.js","assets/vendor-highlight.js.4e8df926.css"])).default;console.debug("highlight.js loaded"),r.querySelectorAll("pre code").forEach(e=>{var s,a;const o=document.createElement("button");o.innerHTML=m.global.t("common.button.copy").toString(),o.addEventListener("click",()=>{u(e.innerText)}),(s=e.parentElement)!=null&&s.querySelector("button")||(a=e.parentElement)==null||a.prepend(o),n.highlightBlock(e)})},x=i({name:"VueMarkdown",props:{source:{type:String,required:!0},options:{type:Object,default:()=>({}),required:!1}},setup(r,{attrs:n}){const t=new _({...r.options,html:!0}).use(p,{delimiters:"all",throwOnError:!1,errorColor:"#cc0000",mathFence:!0}),e=h(()=>{const o=r.source;return t==null?void 0:t.render(o).replace(/<think>/g,'<div class="think">').replace(/<\/think>/g,"</div>")});return()=>v("div",{...n,innerHTML:e.value})}});var E=c(x,[["__file","/home/runner/work/Nexior/Nexior/src/components/common/VueMarkdown.vue"]]);const b=i({name:"ApiCode",directives:{highlight:M},components:{VueMarkdown:E},props:{content:{type:String,required:!1,default:""}},data(){},watch:{}});function $(r,n,t,e,o,s){const a=f("vue-markdown"),d=g("highlight");return k((w(),y(a,{source:r.content,class:"markdown-body"},null,8,["source"])),[[d]])}var T=c(b,[["render",$],["__scopeId","data-v-8173dc94"],["__file","/home/runner/work/Nexior/Nexior/src/components/common/MarkdownRenderer.vue"]]);export{T as M};
1
+ import{a9 as l,al as u,am as p}from"./vendor-others.cdfefb59.js";import{M as _}from"./vendor-markdown.cf3e96ae.js";import{a8 as m,_ as c}from"./index.97386539.js";import{H as i,m as h,ah as v,al as f,av as g,O as k,o as w,L as y}from"./vendor-@vue.6c0309d3.js";import"./vendor-highlight.js.6ee9ffbc.js";const M=async r=>{const n=(await l(()=>import("./vendor-highlight.js.6ee9ffbc.js"),["assets/vendor-highlight.js.6ee9ffbc.js","assets/vendor-highlight.js.4e8df926.css"])).default;console.debug("highlight.js loaded"),r.querySelectorAll("pre code").forEach(e=>{var s,a;const o=document.createElement("button");o.innerHTML=m.global.t("common.button.copy").toString(),o.addEventListener("click",()=>{u(e.innerText)}),(s=e.parentElement)!=null&&s.querySelector("button")||(a=e.parentElement)==null||a.prepend(o),n.highlightBlock(e)})},x=i({name:"VueMarkdown",props:{source:{type:String,required:!0},options:{type:Object,default:()=>({}),required:!1}},setup(r,{attrs:n}){const t=new _({...r.options,html:!0}).use(p,{delimiters:"all",throwOnError:!1,errorColor:"#cc0000",mathFence:!0}),e=h(()=>{const o=r.source;return t==null?void 0:t.render(o).replace(/<think>/g,'<div class="think">').replace(/<\/think>/g,"</div>")});return()=>v("div",{...n,innerHTML:e.value})}});var E=c(x,[["__file","/home/runner/work/Nexior/Nexior/src/components/common/VueMarkdown.vue"]]);const b=i({name:"ApiCode",directives:{highlight:M},components:{VueMarkdown:E},props:{content:{type:String,required:!1,default:""}},data(){},watch:{}});function $(r,n,t,e,o,s){const a=f("vue-markdown"),d=g("highlight");return k((w(),y(a,{source:r.content,class:"markdown-body"},null,8,["source"])),[[d]])}var T=c(b,[["render",$],["__scopeId","data-v-8173dc94"],["__file","/home/runner/work/Nexior/Nexior/src/components/common/MarkdownRenderer.vue"]]);export{T as M};