@acedatacloud/nexior 2.8.0 → 2.9.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 (44) hide show
  1. package/dist/assets/{Auth.0ab7a42b.js → Auth.1d9e1883.js} +1 -1
  2. package/dist/assets/{Buy.a9312c76.js → Buy.a480d5ae.js} +1 -1
  3. package/dist/assets/{Buy.bca71bf8.js → Buy.db3c3a35.js} +1 -1
  4. package/dist/assets/{Callback.db8a3b8c.js → Callback.e8593bc6.js} +1 -1
  5. package/dist/assets/{Chatdoc.322d56b7.js → Chatdoc.d92e31d9.js} +1 -1
  6. package/dist/assets/{Console.ae003280.js → Console.7272066c.js} +1 -1
  7. package/dist/assets/Conversation.19fd9196.js +1 -0
  8. package/dist/assets/{Conversation.5b74853a.js → Conversation.d74519a1.js} +1 -1
  9. package/dist/assets/Conversation.e5220a3e.css +1 -0
  10. package/dist/assets/{CopyToClipboard.9458c7ff.js → CopyToClipboard.bdaf37e1.js} +1 -1
  11. package/dist/assets/{DarkSelector.20da3ddd.js → DarkSelector.686af2ad.js} +1 -1
  12. package/dist/assets/{Detail.a54bf995.js → Detail.262f03eb.js} +1 -1
  13. package/dist/assets/{History.3d4724fd.js → History.b8aeeca3.js} +1 -1
  14. package/dist/assets/{Index.d42f1974.js → Index.0227d49e.js} +1 -1
  15. package/dist/assets/{Index.8bc7c157.js → Index.65fd9959.js} +1 -1
  16. package/dist/assets/{Index.0dbc4202.js → Index.8454498a.js} +1 -1
  17. package/dist/assets/{Index.92bec00e.js → Index.b0971511.js} +1 -1
  18. package/dist/assets/{Index.8bf38d75.js → Index.cf070f55.js} +1 -1
  19. package/dist/assets/{Index.39074534.js → Index.d9269569.js} +1 -1
  20. package/dist/assets/Index.d9d522c8.js +3 -0
  21. package/dist/assets/{Index.cf1296ab.js → Index.dd7ad5e9.js} +1 -1
  22. package/dist/assets/{Index.3feb39ad.js → Index.eab8ef52.js} +1 -1
  23. package/dist/assets/{InfoIcon.16163325.js → InfoIcon.d1d763b6.js} +1 -1
  24. package/dist/assets/{Invitees.8dd2bf95.js → Invitees.cf5c6125.js} +1 -1
  25. package/dist/assets/{List.6e0bac98.js → List.56d13fc3.js} +1 -1
  26. package/dist/assets/{List.54dabcaf.js → List.6651195c.js} +1 -1
  27. package/dist/assets/{List.71801dbf.js → List.d3e63b86.js} +1 -1
  28. package/dist/assets/{Login.029adcbd.js → Login.3fe3d3d3.js} +1 -1
  29. package/dist/assets/{Main.a63936c7.js → Main.404079ee.js} +1 -1
  30. package/dist/assets/{Manage.39acab72.js → Manage.27f62931.js} +1 -1
  31. package/dist/assets/{MarkdownRenderer.7e0ac07f.js → MarkdownRenderer.21611e61.js} +1 -1
  32. package/dist/assets/{Navigator.ed427897.js → Navigator.0711d62c.js} +1 -1
  33. package/dist/assets/{Pagination.f7cb85aa.js → Pagination.f8c7e5aa.js} +1 -1
  34. package/dist/assets/{Setting.1088ad6f.js → Setting.a27e3545.js} +1 -1
  35. package/dist/assets/{Status.04dd9835.js → Status.86c90468.js} +1 -1
  36. package/dist/assets/{distribution.d79c000a.js → distribution.597498b7.js} +1 -1
  37. package/dist/assets/{index.59dae3bf.js → index.ad85555c.js} +3 -3
  38. package/dist/assets/{order.16fb5c61.js → order.f0bd3b0f.js} +1 -1
  39. package/dist/assets/{price.c915742c.js → price.62c2d413.js} +1 -1
  40. package/dist/index.html +1 -1
  41. package/package.json +1 -1
  42. package/dist/assets/Conversation.1efa670e.css +0 -1
  43. package/dist/assets/Conversation.665a276f.js +0 -1
  44. package/dist/assets/Index.6f2c0d82.js +0 -3
@@ -1 +1 @@
1
- var i=Object.defineProperty;var n=(r,t,e)=>t in r?i(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var s=(r,t,e)=>(n(r,typeof t!="symbol"?t+"":t,e),e);import{r as a}from"./index.59dae3bf.js";class y{constructor(){s(this,"key","orders")}async getAll(t){return await a.get(`/${this.key}/`,{params:t})}async get(t){return await a.get(`/${this.key}/${t}`)}async create(t){return await a.post(`/${this.key}/`,t)}async update(t,e){return await a.put(`/${this.key}/${t}`,e)}async refresh(t){return await a.post(`/${this.key}/${t}/refresh/`)}async pay(t,e){return await a.post(`/${this.key}/${t}/pay/`,e)}async updatePrice(t,e){return await a.post(`/${this.key}/${t}/update-price/`,e)}async finish(t){return await a.post(`/${this.key}/${t}/finish/`)}async delete(t){return await a.delete(`/${this.key}/${t}`)}}const c=new y;export{c as o};
1
+ var i=Object.defineProperty;var n=(r,t,e)=>t in r?i(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var s=(r,t,e)=>(n(r,typeof t!="symbol"?t+"":t,e),e);import{r as a}from"./index.ad85555c.js";class y{constructor(){s(this,"key","orders")}async getAll(t){return await a.get(`/${this.key}/`,{params:t})}async get(t){return await a.get(`/${this.key}/${t}`)}async create(t){return await a.post(`/${this.key}/`,t)}async update(t,e){return await a.put(`/${this.key}/${t}`,e)}async refresh(t){return await a.post(`/${this.key}/${t}/refresh/`)}async pay(t,e){return await a.post(`/${this.key}/${t}/pay/`,e)}async updatePrice(t,e){return await a.post(`/${this.key}/${t}/update-price/`,e)}async finish(t){return await a.post(`/${this.key}/${t}/finish/`)}async delete(t){return await a.delete(`/${this.key}/${t}`)}}const c=new y;export{c as o};
@@ -1 +1 @@
1
- import{t as s,C as i}from"./index.59dae3bf.js";const l=n=>{const t=s.state.exchange;let{value:r,currency:e=s.state.currency||"usd"}=n;const c=i[e];if(!t)return{value:r,currency:e,label:c};const a=`usd-${e}`,o=t[a];return o&&(r=r*o),console.log("new price",{value:r,currency:e}),{value:r,currency:e,label:c}},g=n=>{var c;let{value:t,defaultValue:r}=n;if(t===void 0&&(t=r),t===void 0)return"";const e=l({value:t});return`${e.label}${(c=e.value)==null?void 0:c.toFixed(2)}`};export{g};
1
+ import{t as s,C as i}from"./index.ad85555c.js";const l=n=>{const t=s.state.exchange;let{value:r,currency:e=s.state.currency||"usd"}=n;const c=i[e];if(!t)return{value:r,currency:e,label:c};const a=`usd-${e}`,o=t[a];return o&&(r=r*o),console.log("new price",{value:r,currency:e}),{value:r,currency:e,label:c}},g=n=>{var c;let{value:t,defaultValue:r}=n;if(t===void 0&&(t=r),t===void 0)return"";const e=l({value:t});return`${e.label}${(c=e.value)==null?void 0:c.toFixed(2)}`};export{g};
package/dist/index.html CHANGED
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
6
6
  <title>Nexior</title>
7
- <script type="module" crossorigin src="/assets/index.59dae3bf.js"></script>
7
+ <script type="module" crossorigin src="/assets/index.ad85555c.js"></script>
8
8
  <link rel="modulepreload" href="/assets/vendor-@vue.f0bb489b.js">
9
9
  <link rel="modulepreload" href="/assets/vendor-element-plus.0968c254.js">
10
10
  <link rel="modulepreload" href="/assets/vendor-others.45931466.js">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acedatacloud/nexior",
3
- "version": "2.8.0",
3
+ "version": "2.9.1",
4
4
  "author": "Germey Technology <dev@germey.tech>",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1 +0,0 @@
1
- @charset "UTF-8";@keyframes blink{0%{opacity:1}50%{opacity:0}to{opacity:1}}.mark{width:2px;height:16px;margin-top:3px;background-color:var(--el-text-color-primary);animation:blink 1s infinite}.icon-check[data-v-11fc7fcb],.icon-copy[data-v-11fc7fcb]{margin-left:5px;cursor:pointer;color:inherit}.error[data-v-f0476f80]{width:-moz-fit-content;width:fit-content;padding:10px 5px 8px;height:45px;border-radius:10px 10px 10px 0}.btn-buy[data-v-f0476f80]{margin:10px auto;border-radius:20px}.message[data-v-f0476f80]{display:flex;flex-direction:row;margin-bottom:15px}.message[role=system][data-v-f0476f80],.message.hidden[data-v-f0476f80]{display:none}.message .author[data-v-f0476f80]{width:50px;padding:10px}.message .author .avatar[data-v-f0476f80]{width:30px;height:30px;border-radius:50%;border:1px solid var(--el-border-color)}.message .main[data-v-f0476f80]{flex:1;width:calc(100% - 50px);display:flex;flex-direction:column}.message.assistant[data-v-f0476f80]{align-items:start}.message.assistant .content[data-v-f0476f80]{color:var(--el-text-color-primary)}.message.assistant .btn-buy[data-v-f0476f80]{display:inline-block;margin-left:5px}.message.user .main[data-v-f0476f80]{align-items:end}.message.user .content[data-v-f0476f80]{background-color:var(--el-bg-color-page);color:var(--el-text-color-primary);width:-moz-fit-content;width:fit-content;text-align:left;max-width:100%;position:relative}.message.user .content .edit-left[data-v-f0476f80]{position:absolute;left:-25px;top:50%;transform:translateY(-50%)}.message.user .content .chat-container[data-v-f0476f80]{padding:10px;min-width:400px;width:100%;height:100%}.message.user .content .chat-container .chat-input[data-v-f0476f80]{padding-bottom:30px}.message.user .content .chat-container .button-group[data-v-f0476f80]{position:absolute;bottom:10px;right:10px}.message .content[data-v-f0476f80]{border-radius:20px;padding:8px;width:100%;max-width:800px}.message .content .image[data-v-f0476f80]{max-width:100%;max-height:300px;margin:5px 0;border-radius:10px}.message .content .edit-area[data-v-f0476f80]{width:100%;min-height:100px;border-radius:10px;padding:8px;margin-bottom:10px}.message .content .edit-buttons[data-v-f0476f80]{display:flex;justify-content:flex-end;gap:10px}.message .operations[data-v-f0476f80]{display:flex;gap:10px;margin-left:5px}.message .operations .btn-restart[data-v-f0476f80],.message .operations .btn-copy[data-v-f0476f80]{color:var(--el-text-color-regular);font-size:14px}textarea.input{font-size:14px;min-height:35px;max-height:350px;border:none;background:none;box-shadow:none;resize:none;line-height:25px;width:calc(100% - 80px);margin-left:30px;font-family:var(--el-font-family);padding-top:6px}textarea.input:focus{outline:none}.input-box{position:relative}.input-box .input textarea{max-height:100px;border:none;background:none;box-shadow:none;resize:none;line-height:35px}.input-box .el-upload-list{position:absolute;width:400px;bottom:45px}.input-box .el-textarea.is-disabled .el-textarea__inner{background-color:initial}.input-box[data-v-020f4eb8]{width:100%;max-width:800px;margin:auto;position:relative;border-radius:20px;background:var(--el-bg-color-page);padding:5px}.input-box .upload[data-v-020f4eb8]{display:inline-block}.input-box .upload.disabled .btn-upload[data-v-020f4eb8]{cursor:not-allowed}.input-box .upload.disabled .btn-upload .icon-attachment[data-v-020f4eb8]{color:var(--el-text-color-disabled)}.input-box .input[data-v-020f4eb8]{border:none;width:calc(100% - 80px);margin-left:35px}.input-box .btn[data-v-020f4eb8]{display:block;z-index:100;cursor:pointer;bottom:15px;position:absolute}.input-box .btn.btn-upload[data-v-020f4eb8]{left:15px}.input-box .btn.btn-upload .icon-attachment[data-v-020f4eb8]{font-size:16px;color:var(--el-text-color-primary)}.input-box .btn.btn-send[data-v-020f4eb8]{right:15px}.input-box .btn.btn-send.disabled[data-v-020f4eb8]{cursor:not-allowed}.input-box .btn.btn-send.disabled .icon-send[data-v-020f4eb8]{color:var(--el-text-color-disabled)}.input-box .btn.btn-send .icon-send[data-v-020f4eb8]{font-size:16px;color:var(--el-text-color-primary)}.info[data-v-020f4eb8]{display:block;font-size:12px;color:var(--el-text-color-secondary);margin-top:5px;text-align:center;margin-bottom:0}.popper{border-radius:20px;overflow:hidden}.selector[data-v-358d65be]{cursor:pointer;padding:7px 6px;border-radius:15px;margin-bottom:10px}.selector .name[data-v-358d65be]{font-size:16px;font-weight:700;display:inline-block;margin-right:5px}.selector .angle[data-v-358d65be]{display:inline-block;max-width:5px}.item[data-v-358d65be]{display:flex;flex-direction:row}.item .icon[data-v-358d65be]{width:15px;display:flex;align-items:flex-start;justify-content:center;margin-right:5px;margin-top:3px}.item .icon.base[data-v-358d65be]{color:#f90}.item .icon.plus[data-v-358d65be]{color:#ce65e6}.item .info[data-v-358d65be]{width:calc(100% - 15px)}.item .info .name[data-v-358d65be]{font-size:14px;font-weight:700;color:var(--el-text-color-primary);margin:0}.item .info .description[data-v-358d65be]{font-size:12px;color:var(--el-text-color-secondary);margin:0}.item[data-v-bc919b38]{height:100px;font-size:14px;background-color:var(--el-color-color);color:var(--el-text-color-primary);border:1px solid var(--el-border-color-lighter);padding:10px 20px;border-radius:20px;margin-bottom:15px}.item[data-v-bc919b38]:hover{background-color:var(--el-bg-color-page)}.item .icon[data-v-bc919b38]{font-size:14px;margin-bottom:10px}.introduction[data-v-52040931]{width:100%;height:100%;flex:1;display:flex;align-items:center;justify-content:center}.introduction .items[data-v-52040931]{max-width:800px;width:100%;margin:auto}@media (max-width: 767px){.introduction[data-v-52040931]{position:relative;top:initial;left:initial;transform:initial;width:90%;margin:auto}}.panel[data-v-d866c834]{display:flex;flex-direction:column;align-items:flex-end;padding:10px;width:250px;height:100%}@media (max-width: 767px){.panel[data-v-d866c834]{border-right:none}}.panel .conversations[data-v-d866c834]{width:100%;display:flex;flex-direction:column;align-items:center}.panel .conversations .group[data-v-d866c834]{width:100%;display:flex;flex-direction:column;margin-top:10px}.panel .conversations .group .key[data-v-d866c834]{font-size:12px;font-weight:600;width:100%;line-height:40px;padding-left:10px;color:var(--el-text-color-secondary)}.panel .conversations .conversation[data-v-d866c834]{width:100%;height:40px;display:flex;flex-direction:row;line-height:40px;border-radius:10px;padding:0 10px;color:var(--el-text-color-primary);cursor:pointer}.panel .conversations .conversation.active[data-v-d866c834],.panel .conversations .conversation[data-v-d866c834]:hover{background-color:var(--el-bg-color-page)}.panel .conversations .conversation.active .operations[data-v-d866c834],.panel .conversations .conversation:hover .operations[data-v-d866c834]{display:block}.panel .conversations .conversation .icons[data-v-d866c834]{width:30px;padding-left:10px}.panel .conversations .conversation .icons .icon[data-v-d866c834]{font-size:14px}.panel .conversations .conversation .title[data-v-d866c834]{flex:1;font-size:14px;line-height:40px;overflow:hidden;text-overflow:ellipsis;padding-right:8px;color:var(--el-text-color-primary)}.panel .conversations .conversation .operations[data-v-d866c834]{display:none;width:40px;color:var(--el-text-color-regular)}.panel .conversations .conversation .operations .icon[data-v-d866c834]{cursor:pointer;font-size:14px;margin-right:6px}.main[data-v-8d7a06d2]{flex:1;display:flex;flex-direction:row}.main .side[data-v-8d7a06d2]{width:250px;height:100%;overflow-y:scroll;border-right:1px solid var(--el-border-color)}.main .chat[data-v-8d7a06d2]{padding:15px;flex:1;width:calc(100% - 250px);height:100%;display:flex;flex-direction:column;position:relative}.menu[data-v-8d7a06d2]{display:none}@media (max-width: 767px){.side[data-v-8d7a06d2]{display:none}.chat[data-v-8d7a06d2]{width:100%}.menu[data-v-8d7a06d2]{display:block;position:fixed;right:20px;top:20px;z-index:2000}}.selector[data-v-3ab2fb26]{width:-moz-max-content;width:max-content;margin-bottom:10px;position:absolute;left:10px;top:10px}.setting[data-v-3ab2fb26]{position:absolute;top:10px;right:10px;margin-bottom:10px}@media (max-width: 767px){.setting[data-v-3ab2fb26]{display:none}}.dialogue[data-v-3ab2fb26]{flex:1;width:100%;overflow-y:auto;position:relative;padding:0 calc(50% - 400px)}.dialogue .messages[data-v-3ab2fb26]{padding-top:10px}.dialogue .messages .message[data-v-3ab2fb26]{margin-bottom:15px}.bottom[data-v-3ab2fb26]{width:100%}
@@ -1 +0,0 @@
1
- var ue=Object.defineProperty;var Z=Object.getOwnPropertySymbols;var he=Object.prototype.hasOwnProperty,me=Object.prototype.propertyIsEnumerable;var x=(e,t,i)=>t in e?ue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,M=(e,t)=>{for(var i in t||(t={}))he.call(t,i)&&x(e,i,t[i]);if(Z)for(var i of Z(t))me.call(t,i)&&x(e,i,t[i]);return e};import{a as P}from"./vendor-axios.168e6950.js";import{I as pe}from"./vendor-others.45931466.js";import{_ as I,A as E,D,u as _e,E as ge,F as z,G as ee,H as te,J as se,K as oe,L as j,i as re,N as V,j as le,O as U}from"./index.59dae3bf.js";import{H as S,o as n,e as p,al as d,L as f,M as y,V as _,f as c,S as k,W as N,ai as T,as as K,$ as O,T as H,U as C,Q as B,O as fe,aw as $e,a0 as J,I as ne}from"./vendor-@vue.f0bb489b.js";import{M as ye,i as F}from"./MarkdownRenderer.7e0ac07f.js";import{aj as q}from"./vendor-fortawesome.d80f1808.js";import{C as we}from"./CopyToClipboard.9458c7ff.js";import{s as Q,C as ve,k as de,q as ke,L as ce,M as Ce,K as ae,f as be,N as Ee,j as Ie,e as Se,d as Re,A as Ne,O as qe}from"./vendor-element-plus.0968c254.js";import{E as G,a as L,b as Ae,c as De,d as Oe,e as Te,f as Me,g as ie,A as Ve,h as W}from"./Status.04dd9835.js";import"./vendor-qrcode.40fbc994.js";import"./vendor-markdown.cc2fe066.js";import"./vendor-highlight.js.6ee9ffbc.js";const Ue=S({name:"AnsweringMark",data(){return{}},computed:{conversationId(){var e,t;return(t=(e=this.$route.params)==null?void 0:e.id)==null?void 0:t.toString()}}}),Ge={class:"mark"};function Le(e,t,i,u,$,o){return n(),p("div",Ge)}var Be=I(Ue,[["render",Le],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/AnsweringMark.vue"]]);const Pe=S({name:"CopyToClipboard",components:{FontAwesomeIcon:q,ElTooltip:Q},props:{messages:{type:Array,required:!1,default:()=>[]}},emits:["restart"],data(){return{copied:!1}},methods:{onRestart(){this.$emit("restart")}}});function He(e,t,i,u,$,o){const a=d("font-awesome-icon"),r=d("el-tooltip");return n(),f(r,{effect:"dark",content:e.$t("common.button.restart"),placement:"top-start"},{default:y(()=>[_(a,{icon:"fa-solid fa-sync",class:"icon-sync",onClick:e.onRestart},null,8,["onClick"])]),_:1},8,["content"])}var Fe=I(Pe,[["render",He],["__scopeId","data-v-11fc7fcb"],["__file","/home/runner/work/Nexior/Nexior/src/components/common/RestartToGenerate.vue"]]);const We=S({name:"Message",components:{CopyToClipboard:we,RestartToGenerate:Fe,AnsweringMark:Be,MarkdownRenderer:ye,ElAlert:ve,ElButton:de,ElImage:ke,ElTooltip:Q,FontAwesomeIcon:q,ElInput:ce},props:{messages:{type:Array,required:!1,default:()=>[]},message:{type:Object,required:!0},application:{type:Object,required:!0}},emits:["stop","edit","restart"],data(){return{copied:!1,isEditing:!1,questionValue:this.message.content,messageState:E}},computed:{errorText(){var e,t;if(!(!this.message.error||!((e=this.message.error)!=null&&e.code)))switch((t=this.message.error)==null?void 0:t.code){case ie:return this.$t("chat.message.errorUsedUp");case Me:return this.$t("chat.message.errorApiError");case Te:return this.$t("chat.message.errorBadRequest");case Oe:return this.$t("chat.message.errorTimeout");case De:return this.$t("chat.message.errorTooManyRequests");case Ae:return this.$t("chat.message.errorContentTooLarge");case L:return this.$t("chat.message.errorNotApplied");case G:default:return this.$t("chat.message.errorUnknown")}},showBuyMore(){var e;return this.message.role===D&&((e=this.message.error)==null?void 0:e.code)===ie}},watch:{},methods:{startEditing(){this.isEditing=!0,this.questionValue=this.message.content,console.debug("start to get answer",this.message)},cancelEdit(){this.isEditing=!1},sendRestart(){this.$emit("restart",this.message)},sendEdit(){this.isEditing=!1,this.onSubmit()},onSubmit(){this.$emit("edit",this.message,this.questionValue)},onCopy(){pe(this.message.content.toString(),{debug:!0}),this.copied=!0,setTimeout(()=>{this.copied=!1},3e3)},onBuyMore(){var e;this.$router.push({name:_e,params:{id:(e=this.application)==null?void 0:e.id}})}}}),ze=["role"],je={class:"author"},Ke={key:0,class:"main"},Je={class:"content"},Qe={class:"edit-left"},Xe={key:0,class:"message-content"},Ye={key:1},Ze=["src"],xe={key:1,class:"chat-container"},et={class:"button-group"},tt={class:"operations"};function st(e,t,i,u,$,o){var A;const a=d("el-image"),r=d("font-awesome-icon"),m=d("el-tooltip"),l=d("markdown-renderer"),h=d("el-input"),s=d("el-button"),v=d("answering-mark"),R=d("copy-to-clipboard"),g=d("restart-to-generate"),w=d("el-alert");return n(),p("div",{class:B({message:!0,[e.message.role]:!0}),role:e.message.role},[c("div",je,[e.message.role==="assistant"?(n(),f(a,{key:0,src:"https://cdn.acedata.cloud/7dljuv.png",fit:"cover",class:"avatar"})):k("v-if",!0)]),e.errorText?(n(),f(w,{key:1,class:"error",title:e.errorText,type:"error",closable:!1},null,8,["title"])):(n(),p("div",Ke,[c("div",Je,[c("div",Qe,[e.message.role==="user"&&!e.isEditing?(n(),f(m,{key:0,effect:"dark",content:e.$t("chat.button.edit"),placement:"bottom"},{default:y(()=>[_(r,{icon:"fa-solid fa-edit",class:"icon icon-edit",onClick:e.startEditing},null,8,["onClick"])]),_:1},8,["content"])):k("v-if",!0)]),e.isEditing?(n(),p("div",xe,[_(h,{modelValue:e.questionValue,"onUpdate:modelValue":t[0]||(t[0]=b=>e.questionValue=b),type:"textarea",class:"chat-input",onKeydown:K(O(e.sendEdit,["exact","prevent"]),["enter"])},null,8,["modelValue","onKeydown"]),c("div",et,[_(s,{size:"small",round:"",onClick:e.cancelEdit},{default:y(()=>[H(C(e.$t("common.button.cancel")),1)]),_:1},8,["onClick"]),_(s,{type:"primary",size:"small",round:"",onClick:e.sendEdit},{default:y(()=>[H(C(e.$t("common.button.confirm")),1)]),_:1},8,["onClick"])])])):(n(),p("div",Xe,[Array.isArray(e.message.content)?(n(),p("div",Ye,[(n(!0),p(N,null,T(e.message.content,(b,X)=>{var Y;return n(),p("div",{key:X},[b.type==="image_url"?(n(),p("img",{key:0,src:typeof(b==null?void 0:b.image_url)=="string"?b.image_url:(Y=b.image_url)==null?void 0:Y.url,fit:"cover",class:"image"},null,8,Ze)):k("v-if",!0),b.type==="text"?(n(),f(l,{key:X,content:b.text},null,8,["content"])):k("v-if",!0)])}),128))])):(n(),f(l,{key:0,content:(A=e.message)==null?void 0:A.content},null,8,["content"]))])),e.message.state===e.messageState.PENDING?(n(),f(v,{key:2})):k("v-if",!0)]),c("div",tt,[Array.isArray(e.message.content)?k("v-if",!0):(n(),f(R,{key:0,content:e.message.content,class:"btn-copy"},null,8,["content"])),!Array.isArray(e.message.content)&&e.message.role==="assistant"&&e.message===e.messages[e.messages.length-1]?(n(),f(g,{key:1,class:"btn-restart",messages:e.messages,onRestart:e.sendRestart},null,8,["messages","onRestart"])):k("v-if",!0)])])),e.showBuyMore?(n(),f(s,{key:2,round:"",type:"primary",class:"btn btn-buy",size:"small",onClick:e.onBuyMore},{default:y(()=>[H(C(e.$t("common.button.buyMore")),1)]),_:1},8,["onClick"])):k("v-if",!0)],10,ze)}var ot=I(We,[["render",st],["__scopeId","data-v-f0476f80"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/Message.vue"]]);const nt=S({name:"InputBox",components:{ElTooltip:Q,FontAwesomeIcon:q,ElUpload:Ce},props:{disabled:{type:Boolean,required:!1,default:!1},references:{type:Array,required:!1,default:()=>[]},question:{type:String,required:!0}},emits:["update:question","update:references","submit"],data(){return{inputHeight:"35px",questionValue:this.question,fileList:[],uploadUrl:ge()+"/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})},canUpload(){return[z.name].includes(this.model.name)},model(){return this.$store.state.chat.model}},watch:{urls(e){this.$emit("update:references",e)},questionValue(e){this.$emit("update:question",e)},question(e){e!==this.questionValue&&(this.questionValue=e)},references(e){e.length===0&&(this.fileList=[])}},methods:{adjustTextareaHeight(){this.$nextTick(()=>{const e=this.$refs.textarea;e&&(e.style.height="35px",e.style.height=e.scrollHeight+"px")})},onSubmit(){!this.question||this.$emit("submit")},onExceed(){ae.warning(this.$t("chat.message.uploadReferencesExceed"))},onError(){ae.error(this.$t("chat.message.uploadReferencesError"))}}}),at={class:"input-box"},it={class:"btn btn-upload"},rt=["disabled","placeholder"],lt={class:"info"};function dt(e,t,i,u,$,o){const a=d("font-awesome-icon"),r=d("el-tooltip"),m=d("el-upload");return n(),p(N,null,[c("div",at,[_(m,{"file-list":e.fileList,"onUpdate:file-list":t[0]||(t[0]=l=>e.fileList=l),class:B({upload:!0,disabled:!e.canUpload}),disabled:!e.canUpload,name:"file","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,headers:e.headers},{default:y(()=>[_(r,{class:"box-item",effect:"dark",content:e.$t("chat.message.uploadFile"),placement:"top"},{default:y(()=>[c("span",it,[_(a,{icon:"fa-solid fa-paperclip",class:"icon icon-attachment"})])]),_:1},8,["content"])]),_:1},8,["file-list","class","disabled","action","on-exceed","on-error","headers"]),c("span",{class:B({btn:!0,"btn-send":!0,disabled:!e.questionValue}),onClick:t[1]||(t[1]=(...l)=>e.onSubmit&&e.onSubmit(...l))},[_(a,{icon:"fa-solid fa-location-arrow",class:"icon icon-send"})],2),k(" add this textarea "),fe(c("textarea",{ref:"textarea","onUpdate:modelValue":t[2]||(t[2]=l=>e.questionValue=l),disabled:e.disabled,class:"input",placeholder:e.$t("chat.message.newMessagePlaceholder"),style:J({height:e.inputHeight}),onKeydown:t[3]||(t[3]=K(O((...l)=>e.onSubmit&&e.onSubmit(...l),["exact","prevent"]),["enter"])),onInput:t[4]||(t[4]=(...l)=>e.adjustTextareaHeight&&e.adjustTextareaHeight(...l))},null,44,rt),[[$e,e.questionValue]])]),c("p",lt,C(e.$t("chat.message.howToUse")),1)],64)}var ct=I(nt,[["render",dt],["__scopeId","data-v-020f4eb8"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/InputBox.vue"]]);const ut=S({name:"ModelSelector",components:{ElDropdown:be,ElDropdownMenu:Ee,ElDropdownItem:Ie,FontAwesomeIcon:q},emits:["update:modelValue","select"],data(){return{options:[{icon:"fa-solid fa-bolt",color:"#ff9900",model:ee},{icon:"fa-solid fa-bolt",color:"#ff9900",model:te},{icon:"fa-solid fa-wand-magic-sparkles",color:"#ce65e6",model:se},{icon:"fa-solid fa-wand-magic-sparkles",color:"#ce65e6",model:oe},{icon:"fa-solid fa-wand-magic-sparkles",color:"#ce65e6",model:z}]}},computed:{model(){const e=this.$store.state.chat.model.name;return[ee,te,se,oe,z].find(i=>i.name===e)}},methods:{onCommandChange(e){this.$emit("select",e),this.$store.dispatch("chat/setModel",e)}}}),ht={class:"selector"},mt={class:"name"},pt={class:"angle"},_t={class:"item"},gt={class:"info"},ft={class:"name"},$t={class:"description"};function yt(e,t,i,u,$,o){const a=d("font-awesome-icon"),r=d("el-dropdown-item"),m=d("el-dropdown-menu"),l=d("el-dropdown");return n(),p("div",ht,[_(l,{trigger:"click","popper-class":"popper"},{dropdown:y(()=>[_(m,null,{default:y(()=>[(n(!0),p(N,null,T(e.options,(h,s)=>(n(),f(r,{key:s,onClick:v=>e.onCommandChange(h.model)},{default:y(()=>[c("div",_t,[c("div",{class:"icon",style:J({color:h.color})},[_(a,{icon:h.icon},null,8,["icon"])],4),c("div",gt,[c("p",ft,C(h.model.getDisplayName()),1),c("p",$t,C(h.model.getDescription()),1)])])]),_:2},1032,["onClick"]))),128))]),_:1})]),default:y(()=>{var h;return[c("div",null,[c("span",mt,C((h=e.model)==null?void 0:h.getDisplayName()),1),c("span",pt,[_(a,{icon:"fa-solid fa-angle-down"})])])]}),_:1})])}var wt=I(ut,[["render",yt],["__scopeId","data-v-358d65be"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/ModelSelector.vue"]]);const vt=S({name:"ConversationIntroductionItem",components:{FontAwesomeIcon:q},props:{content:{type:String,required:!0},icon:{type:String,required:!0},color:{type:String,default:"rgb(0, 0, 0)"}},data(){return{}},computed:{}}),kt={class:"item"},Ct={class:"icon"},bt={class:"content"};function Et(e,t,i,u,$,o){const a=d("font-awesome-icon");return n(),p("div",kt,[c("div",Ct,[_(a,{icon:e.icon,style:J({color:e.color})},null,8,["icon","style"])]),c("div",bt,C(e.content),1)])}var It=I(vt,[["render",Et],["__scopeId","data-v-bc919b38"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/IntroductionItem.vue"]]);const St=S({name:"ConversationIntroduction",components:{IntroductionItem:It,ElRow:Se,ElCol:Re},emits:["draft"],data(){return{items:[{icon:"fa-solid fa-pen-nib",content:this.$t("chat.message.question1"),color:"rgb(226, 197, 65)"},{icon:"fa-solid fa-laptop-code",content:this.$t("chat.message.question2"),color:"rgb(203, 139, 208)"},{icon:"fa-solid fa-fan",content:this.$t("chat.message.question3"),color:"rgb(118, 208, 235)"},{icon:"fa-solid fa-plane-departure",content:this.$t("chat.message.question4"),color:"rgb(237, 98, 98)"}].sort(()=>Math.random()-.5)}},computed:{}}),Rt={class:"introduction"};function Nt(e,t,i,u,$,o){const a=d("introduction-item"),r=d("el-col"),m=d("el-row");return n(),p("div",Rt,[_(m,{class:"items",justify:"center",gutter:15},{default:y(()=>[(n(!0),p(N,null,T(e.items,(l,h)=>(n(),f(r,{key:h,md:6,sm:12,xs:12},{default:y(()=>[_(a,{content:l.content,icon:l.icon,color:l.color,class:"cursor-pointer",onClick:s=>e.$emit("draft",l.content)},null,8,["content","icon","color","onClick"])]),_:2},1024))),128))]),_:1})])}var qt=I(St,[["render",Nt],["__scopeId","data-v-52040931"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/Introduction.vue"]]);const At=S({name:"SidePanel",components:{ElInput:ce,FontAwesomeIcon:q,ElSkeleton:Ne},props:{},emits:["click"],computed:{conversationId(){var e,t;return(t=(e=this.$route.params)==null?void 0:e.id)==null?void 0:t.toString()},conversationGroups(){var a,r,m,l,h,s,v,R;const e=this.$store.state.chat.conversations,t=new Date;t.setHours(0,0,0,0);const i=new Date(t);i.setDate(i.getDate()-1);const u=new Date(t);u.setDate(u.getDate()-t.getDay());const $=new Date(u);$.setDate($.getDate()-7);const o=e==null?void 0:e.reduce((g,w)=>{const A=new Date(w.updated_at*1e3);return A>=t?g.today.push(w):A>=i?g.yesterday.push(w):A>=u?g.thisWeek.push(w):g.earlier.push(w),g},{today:[],yesterday:[],thisWeek:[],earlier:[]});return M(M(M(M({},((a=o==null?void 0:o.today)==null?void 0:a.length)>0?{today:(r=o==null?void 0:o.today)==null?void 0:r.sort((g,w)=>w.updated_at-g.updated_at)}:{}),((m=o==null?void 0:o.yesterday)==null?void 0:m.length)>0?{yesterday:(l=o==null?void 0:o.yesterday)==null?void 0:l.sort((g,w)=>w.updated_at-g.updated_at)}:{}),((h=o==null?void 0:o.thisWeek)==null?void 0:h.length)>0?{thisWeek:(s=o==null?void 0:o.thisWeek)==null?void 0:s.sort((g,w)=>w.updated_at-g.updated_at)}:{}),((v=o==null?void 0:o.earlier)==null?void 0:v.length)>0?{earlier:(R=o==null?void 0:o.earlier)==null?void 0:R.sort((g,w)=>w.updated_at-g.updated_at)}:{})},application(){return this.$store.state.chat.application},loading(){return this.$store.state.chat.status.getConversations===j.Request},token(){var e,t;return(t=(e=this.$store.state.chat)==null?void 0:e.credential)==null?void 0:t.token}},methods:{async onNewConversation(){this.$router.push({name:re})},async onConfirm(e){const t=this.token;if(!t){console.error("Token is not found");return}e!=null&&e.deleting?(await V.deleteConversation(e.id,{token:t}),await this.$store.dispatch("chat/getConversations")):e!=null&&e.editing?(await V.updateConversation(e,{token:t}),await this.$store.dispatch("chat/getConversations")):e.editing=!0},onClick(e){!e||(this.$router.push({name:le,params:{id:e}}),this.$emit("click",e))}}}),Dt={class:"panel"},Ot={key:1,class:"conversations"},Tt={class:"icons"},Mt={class:"title"},Vt={class:"key"},Ut=["onClick"],Gt={class:"title"},Lt={key:0},Bt={key:1},Pt={key:2},Ht={class:"operations"};function Ft(e,t,i,u,$,o){const a=d("el-skeleton"),r=d("font-awesome-icon"),m=d("el-input");return n(),p("div",Dt,[e.loading&&e.conversationGroups===void 0?(n(),f(a,{key:0})):(n(),p("div",Ot,[c("div",{class:"conversation",onClick:t[0]||(t[0]=(...l)=>e.onNewConversation&&e.onNewConversation(...l))},[c("div",Tt,[_(r,{icon:"fa-solid fa-plus",class:"icon"})]),c("div",Mt,C(e.$t("chat.message.startNewChat")),1)]),(n(!0),p(N,null,T(e.conversationGroups,(l,h)=>(n(),p("div",{key:h,class:"group"},[c("div",Vt,C(e.$t(`chat.group.${h}`)),1),(n(!0),p(N,null,T(l,(s,v)=>{var R;return n(),p("div",{key:v,class:B({conversation:!0,active:s.id===e.conversationId}),onClick:g=>e.onClick(s.id)},[c("div",Gt,[s!=null&&s.deleting?(n(),p("span",Lt,C(`${e.$t("chat.message.confirmDelete")}?`),1)):s!=null&&s.editing?(n(),p("span",Bt,[_(m,{modelValue:s.title,"onUpdate:modelValue":g=>s.title=g,onKeydown:K(g=>e.onConfirm(s),["enter"])},null,8,["modelValue","onUpdate:modelValue","onKeydown"])])):(s==null?void 0:s.title)||(s==null?void 0:s.messages)?(n(),p("span",Pt,C((s==null?void 0:s.title)||((R=s==null?void 0:s.messages[(s==null?void 0:s.messages.length)-1])==null?void 0:R.content)),1)):k("v-if",!0)]),c("div",Ht,[!(s!=null&&s.editing)&&!s.deleting?(n(),f(r,{key:0,icon:"fa-solid fa-edit",class:"icon icon-edit",onClick:O(g=>s.editing=!0,["stop"])},null,8,["onClick"])):k("v-if",!0),!(s!=null&&s.editing)&&!s.deleting?(n(),f(r,{key:1,icon:"fa-solid fa-trash",class:"icon icon-delete",onClick:O(g=>s.deleting=!0,["stop"])},null,8,["onClick"])):k("v-if",!0),(s==null?void 0:s.editing)||s.deleting?(n(),f(r,{key:2,icon:"fa-solid fa-check",class:"icon icon-confirm",onClick:O(g=>e.onConfirm(s),["stop"])},null,8,["onClick"])):k("v-if",!0),(s==null?void 0:s.editing)||s.deleting?(n(),f(r,{key:3,icon:"fa-solid fa-xmark",class:"icon icon-cancel",onClick:O(g=>{s.editing=!1,s.deleting=!1},["stop"])},null,8,["onClick"])):k("v-if",!0)])],10,Ut)}),128))]))),128))]))])}var Wt=I(At,[["render",Ft],["__scopeId","data-v-d866c834"],["__file","/home/runner/work/Nexior/Nexior/src/components/chat/SidePanel.vue"]]);const zt=S({name:"LayoutChat",components:{SidePanel:Wt,ElDrawer:qe,ElButton:de,FontAwesomeIcon:q},data(){return{drawer:!1}}}),jt={class:"main"},Kt={class:"side"},Jt={class:"chat"};function Qt(e,t,i,u,$,o){const a=d("side-panel"),r=d("font-awesome-icon"),m=d("el-button"),l=d("el-drawer");return n(),p("div",jt,[c("div",Kt,[ne(e.$slots,"side",{},()=>[_(a)],!0)]),c("div",Jt,[ne(e.$slots,"chat",{},void 0,!0)]),_(m,{round:"",class:"menu",onClick:t[0]||(t[0]=h=>e.drawer=!0)},{default:y(()=>[_(r,{icon:"fa-solid fa-bars",class:"icon-menu"})]),_:1}),_(l,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=h=>e.drawer=h),"with-header":!1,size:"290px",class:"drawer"},{default:y(()=>[_(a)]),_:1},8,["modelValue"])])}var Xt=I(zt,[["render",Qt],["__scopeId","data-v-8d7a06d2"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Chat.vue"]]);const Yt=S({name:"ChatConversation",components:{InputBox:ct,Introduction:qt,ModelSelector:wt,Message:ot,ApplicationStatus:Ve,Layout:Xt},data(){var e,t;return{drawer:!1,question:"",references:[],answering:!1,messages:((t=(e=this.$store.state.chat.conversations)==null?void 0:e.find(i=>{var u;return i.id===((u=this.$route.params.id)==null?void 0:u.toString())}))==null?void 0:t.messages)||[]}},computed:{model(){return this.$store.state.chat.model},conversationId(){var e;return(e=this.$route.params.id)==null?void 0:e.toString()},conversation(){var e;return(e=this.$store.state.chat.conversations)==null?void 0:e.find(t=>t.id===this.conversationId)},service(){return this.$store.state.chat.service},application(){return this.$store.state.chat.application},credential(){var e;return(e=this.$store.state.chat)==null?void 0:e.credential},needApply(){return this.$store.state.chat.status.getApplications===j.Success&&!this.application},conversations(){return this.$store.state.chat.conversations},initializing(){return this.$store.state.chat.status.getApplications===j.Request}},watch:{model(e){e&&this.onModelChanged()},conversationId(e){var t,i;e?(this.messages=((i=(t=this.conversations)==null?void 0:t.find(u=>u.id===e))==null?void 0:i.messages)||[],this.onScrollDown()):this.messages=[]}},async mounted(){await this.onGetService(),await this.onGetApplication(),await this.onGetConversations(),await this.onScrollDown()},methods:{async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("chat/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("chat/getApplications"),console.debug("end onGetApplication")},async onGetConversations(){console.debug("start onGetConversations"),await this.$store.dispatch("chat/getConversations"),console.debug("end onGetConversations")},async onDraft(e){this.question=e,this.onSubmit()},async onRestart(e){var a;const t=this.messages.findIndex(r=>r===e),i=this.messages[t-1];t!==-1&&(this.messages=this.messages.slice(0,t-1),this.question=i.content);const u=(a=this.credential)==null?void 0:a.token,$=this.question;if(!u||!$){console.error("no token or endpoint or question"),this.messages.push({error:{code:L},role:D,state:E.FAILED});return}let o=this.conversationId;V.updateConversation({id:this.conversationId,messages:this.messages},{token:u}).then(async()=>{await this.$store.dispatch("chat/setConversation",{id:o,messages:this.messages}),console.debug("finished update conversation",this.messages),this.messages.push({content:this.question,role:U}),console.debug("onRestart",this.question),await this.onFetchAnswer()}).catch(r=>{var m,l;if(this.messages&&this.messages.length>0&&(this.messages[this.messages.length-1].state=E.FAILED),console.error(r),P.isCancel(r))this.messages[this.messages.length-1].error={code:W};else if((m=r==null?void 0:r.response)!=null&&m.data){let h=(l=r==null?void 0:r.response)==null?void 0:l.data;F(h)&&(h=JSON.parse(h)),console.debug("error",h),this.messages&&this.messages.length>0&&(this.messages[this.messages.length-1].error=h.error)}else this.messages&&this.messages.length>0&&(this.messages[this.messages.length-1].error={code:G});this.answering=!1})},async onEdit(e,t){var o;const i=this.messages.findIndex(a=>a===e);i!==-1&&(this.messages=this.messages.slice(0,i)),this.question=t;const u=(o=this.credential)==null?void 0:o.token;if(!u){console.error("no token or endpoint or question"),this.messages.push({error:{code:L},role:D,state:E.FAILED});return}let $=this.conversationId;V.updateConversation({id:this.conversationId,messages:this.messages},{token:u}).then(async()=>{await this.$store.dispatch("chat/setConversation",{id:$,messages:this.messages}),console.debug("finished update conversation",this.messages),this.messages.push({content:this.question,role:U}),console.debug("onEdit",this.question),await this.onFetchAnswer()}).catch(a=>{var r,m;if(this.messages&&this.messages.length>0&&(this.messages[this.messages.length-1].state=E.FAILED),console.error(a),P.isCancel(a))this.messages[this.messages.length-1].error={code:W};else if((r=a==null?void 0:a.response)!=null&&r.data){let l=(m=a==null?void 0:a.response)==null?void 0:m.data;F(l)&&(l=JSON.parse(l)),console.debug("error",l),this.messages&&this.messages.length>0&&(this.messages[this.messages.length-1].error=l.error)}else this.messages&&this.messages.length>0&&(this.messages[this.messages.length-1].error={code:G});this.answering=!1})},async onCreateNewConversation(){await this.$router.push({name:re})},async onModelChanged(){await this.onCreateNewConversation(),await this.$store.dispatch("chat/getApplications")},async onSubmit(){if(this.references.length>0){let e=[];e.push({type:"text",text:this.question});for(let t=0;t<this.references.length;t++)e.push({type:"image_url",image_url:this.references[t]});this.messages.push({content:e,role:U})}else this.messages.push({content:this.question,role:U});console.debug("onSubmit",this.question,this.references),await this.onFetchAnswer()},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".dialogue");!e||!this.messages||this.messages.length===0||(e.scrollTop=e==null?void 0:e.scrollHeight)},0)},async onFetchAnswer(){var $;console.debug("start to get answer",this.messages);const e=($=this.credential)==null?void 0:$.token,t=this.question,i=this.references;if(console.debug("validated",t,i),this.question="",this.references=[],!e||!t){console.error("no token or endpoint or question"),this.messages.push({error:{code:L},role:D,state:E.FAILED});return}let u=this.conversationId;this.messages.push({content:"",role:D,state:E.PENDING}),console.debug("start to get answer",this.messages),this.onScrollDown(),this.answering=!0,V.chatConversation({question:t,model:this.model.name,references:i,id:this.conversationId,stateful:!0},{token:e,stream:o=>{console.debug("stream response",o),this.messages[this.messages.length-1]={role:D,content:o.answer,state:E.ANSWERING},u=o==null?void 0:o.id,this.onScrollDown()}}).then(async()=>{console.debug("finished fetch answer",this.messages),this.messages[this.messages.length-1].state=E.FINISHED,await this.$store.dispatch("chat/setConversation",{id:u,messages:this.messages}),console.log("messages",JSON.stringify(this.messages)),this.answering=!1,this.conversationId||await this.$router.push({name:le,params:{id:u}}),this.onScrollDown(),await this.$store.dispatch("chat/getConversations"),await this.$store.dispatch("chat/getApplications")}).catch(o=>{var a,r;if(this.messages&&this.messages.length>0&&(this.messages[this.messages.length-1].state=E.FAILED),console.error(o),P.isCancel(o))this.messages[this.messages.length-1].error={code:W};else if((a=o==null?void 0:o.response)!=null&&a.data){let m=(r=o==null?void 0:o.response)==null?void 0:r.data;F(m)&&(m=JSON.parse(m)),console.debug("error",m),this.messages&&this.messages.length>0&&(this.messages[this.messages.length-1].error=m.error)}else this.messages&&this.messages.length>0&&(this.messages[this.messages.length-1].error={code:G});this.answering=!1})}}}),Zt={class:"dialogue"},xt={key:1,class:"messages"},es={class:"bottom"};function ts(e,t,i,u,$,o){const a=d("model-selector"),r=d("application-status"),m=d("introduction"),l=d("message"),h=d("input-box"),s=d("layout");return n(),f(s,null,{chat:y(()=>[_(a,{class:"selector"}),_(r,{initializing:e.initializing,application:e.application,"need-apply":e.needApply,service:e.service,onRefresh:t[0]||(t[0]=v=>e.$store.dispatch("chat/getApplications"))},null,8,["initializing","application","need-apply","service"]),c("div",Zt,[e.messages.length===0?(n(),f(m,{key:0,onDraft:e.onDraft},null,8,["onDraft"])):(n(),p("div",xt,[(n(!0),p(N,null,T(e.messages,(v,R)=>(n(),f(l,{key:R,message:v,messages:e.messages,question:e.question,application:e.application,class:"message","onUpdate:question":t[1]||(t[1]=g=>e.question=g),onEdit:e.onEdit,onRestart:e.onRestart},null,8,["message","messages","question","application","onEdit","onRestart"]))),128))]))]),c("div",es,[_(h,{disabled:e.answering,question:e.question,references:e.references,"onUpdate:question":t[2]||(t[2]=v=>e.question=v),"onUpdate:references":t[3]||(t[3]=v=>e.references=v),onSubmit:e.onSubmit},null,8,["disabled","question","references","onSubmit"])])]),_:1})}var _s=I(Yt,[["render",ts],["__scopeId","data-v-3ab2fb26"],["__file","/home/runner/work/Nexior/Nexior/src/pages/chat/Conversation.vue"]]);export{_s as default};
@@ -1,3 +0,0 @@
1
- var Ie=Object.defineProperty,Ce=Object.defineProperties;var Se=Object.getOwnPropertyDescriptors;var he=Object.getOwnPropertySymbols;var Ae=Object.prototype.hasOwnProperty,Ne=Object.prototype.propertyIsEnumerable;var fe=(e,t,s)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,m=(e,t)=>{for(var s in t||(t={}))Ae.call(t,s)&&fe(e,s,t[s]);if(he)for(var s of he(t))Ne.call(t,s)&&fe(e,s,t[s]);return e},f=(e,t)=>Ce(e,Se(t));import{J as Y,V as Ee,K as $e,P as Te,L as xe}from"./vendor-others.45931466.js";import{aj as ie}from"./vendor-fortawesome.d80f1808.js";import{_ as k,an as ve,L as se,v as Ve,ao as je}from"./index.59dae3bf.js";import{O as Le,k as ae,t as De,u as Fe,S as ge,L as ee,q as re,W as le,Y as Ue,Z as ye,_ as ke,s as Ge,R as we,r as Re,A as ze,Q as Oe,$ as qe,a0 as Me,a1 as Be,K}from"./vendor-element-plus.0968c254.js";import{H as w,al as c,o as l,e as _,S as b,f as a,I as Q,V as r,M as y,U as $,W as H,ai as Z,L as P,av as be,O as ce,T as oe,m as U,u as g,A as Pe,s as We,R as Ke,P as He}from"./vendor-@vue.f0bb489b.js";import{A as Ye,i as Je}from"./Status.04dd9835.js";import{I as te}from"./InfoIcon.16163325.js";import"./vendor-axios.168e6950.js";import"./vendor-qrcode.40fbc994.js";const Qe=w({name:"LayoutSuno",components:{ElDrawer:Le,ElButton:ae,FontAwesomeIcon:ie},data(){return{drawer:!1,preview:!1}},computed:{isPlaying(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.player)==null?void 0:t.isPlaying}}}),Ze={class:"main"},Xe={class:"config"},et={class:"result"},tt={class:"preview"};function st(e,t,s,o,u,p){const n=c("font-awesome-icon"),d=c("el-button"),h=c("el-drawer");return l(),_("div",Ze,[b(" \u6700\u5DE6\u4FA7\u914D\u7F6E\u680F "),a("div",Xe,[Q(e.$slots,"config",{},void 0,!0)]),b(" \u4E2D\u95F4\u6B4C\u66F2\u5217\u8868\u680F "),a("div",et,[Q(e.$slots,"result",{},void 0,!0)]),b(" \u6700\u53F3\u8FB9\u6B4C\u66F2\u9884\u89C8\u680F "),a("div",tt,[Q(e.$slots,"preview",{},void 0,!0)]),r(d,{round:"",class:"menu",onClick:t[0]||(t[0]=v=>e.drawer=!0)},{default:y(()=>[r(n,{icon:"fa-solid fa-gear",class:"icon-menu"})]),_:1}),r(h,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=v=>e.drawer=v),"with-header":!1,size:"340px",class:"drawer"},{default:y(()=>[Q(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"]),b(` <el-drawer v-model="isPlaying" :with-header="false" size="340px" class="preview_drawer">
2
- <slot name="preview" />
3
- </el-drawer> `)])}var ot=k(Qe,[["render",st],["__scopeId","data-v-0621513c"],["__file","/home/runner/work/Nexior/Nexior/src/layouts/Suno.vue"]]);const nt=w({name:"VersionSelector",components:{ElSelect:De,ElOption:Fe,ElSwitch:ge},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{options:[{label:this.$t("suno.model.model1"),value:"chirp-v2-xxl-alpha"},{label:this.$t("suno.model.model2"),value:"chirp-v3-0"},{label:this.$t("suno.model.model3"),value:"chirp-v3-5"}]}},computed:{custom:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.custom},set(e){var t;console.debug("set custom",e),this.$store.commit("suno/setConfig",f(m({},(t=this.$store.state.suno)==null?void 0:t.config),{custom:e}))}},model:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.model},set(e){var t;console.debug("set model",e),this.$store.commit("suno/setConfig",f(m({},(t=this.$store.state.suno)==null?void 0:t.config),{model:e}))}}},mounted(){this.model||(console.debug("set default type",ve),this.model=ve)}}),it={class:"field"},at={class:"title"};function rt(e,t,s,o,u,p){const n=c("el-switch"),d=c("el-option"),h=c("el-select");return l(),_("div",it,[a("h2",at,$(e.$t("suno.name.type")),1),r(n,{modelValue:e.custom,"onUpdate:modelValue":t[0]||(t[0]=v=>e.custom=v),class:"value"},null,8,["modelValue"]),r(h,{modelValue:e.model,"onUpdate:modelValue":t[1]||(t[1]=v=>e.model=v),class:"value",placeholder:e.$t("suno.placeholder.select")},{default:y(()=>[(l(!0),_(H,null,Z(e.options,v=>(l(),P(d,{key:v.value,label:v.label,value:v.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}var lt=k(nt,[["render",rt],["__scopeId","data-v-6d5f21aa"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/TypeSelector.vue"]]);const ct="",ut=w({name:"PromptInput",components:{ElInput:ee,InfoIcon:te},data(){return{}},computed:{prompt:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.prompt},set(e){var t;console.debug("set prompt",e),this.$store.commit("suno/setConfig",f(m({},(t=this.$store.state.suno)==null?void 0:t.config),{prompt:e}))}}},mounted(){this.value||(this.value=ct)}}),dt={class:"field"},pt={class:"box"},_t={class:"title"};function mt(e,t,s,o,u,p){const n=c("info-icon"),d=c("el-input");return l(),_("div",dt,[a("div",pt,[a("h2",_t,$(e.$t("suno.name.prompt")),1),r(n,{content:e.$t("suno.description.prompt"),class:"info"},null,8,["content"])]),r(d,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=h=>e.prompt=h),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("suno.placeholder.prompt"),maxlength:300,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var ht=k(ut,[["render",mt],["__scopeId","data-v-11b65236"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/PromptInput.vue"]]);const ft="",vt=w({name:"LyricInput",components:{ElInput:ee,InfoIcon:te},data(){return{}},computed:{lyric:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.lyric},set(e){var t;console.debug("set lyric",e),this.$store.commit("suno/setConfig",f(m({},(t=this.$store.state.suno)==null?void 0:t.config),{lyric:e}))}},config(){var e;return(e=this.$store.state.suno)==null?void 0:e.config}},mounted(){this.value||(this.value=ft)}}),$t={class:"field"},gt={class:"box"},yt={class:"title"};function kt(e,t,s,o,u,p){var h;const n=c("info-icon"),d=c("el-input");return l(),_("div",$t,[a("div",gt,[a("h2",yt,$(e.$t("suno.name.lyrics")),1),r(n,{content:e.$t("suno.description.lyrics"),class:"info"},null,8,["content"])]),((h=e.config)==null?void 0:h.action)!=="extend"?(l(),P(d,{key:0,modelValue:e.lyric,"onUpdate:modelValue":t[0]||(t[0]=v=>e.lyric=v),rows:3,type:"textarea",class:"lyrics",placeholder:e.$t("suno.placeholder.lyrics"),maxlength:3e3,"show-word-limit":""},null,8,["modelValue","placeholder"])):(l(),P(d,{key:1,modelValue:e.lyric,"onUpdate:modelValue":t[1]||(t[1]=v=>e.lyric=v),rows:3,type:"textarea",class:"lyrics",placeholder:e.$t("suno.placeholder.extend.lyrics"),maxlength:3e3,"show-word-limit":""},null,8,["modelValue","placeholder"]))])}var wt=k(vt,[["render",kt],["__scopeId","data-v-b47f1748"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/LyricInput.vue"]]);const bt=w({name:"StyleInput",components:{ElInput:ee,InfoIcon:te},data(){return{}},computed:{style:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.style},set(e){var t;console.debug("set style",e),this.$store.commit("suno/setConfig",f(m({},(t=this.$store.state.suno)==null?void 0:t.config),{style:e}))}},config(){var e;return(e=this.$store.state.suno)==null?void 0:e.config}}}),Pt={class:"field"},It={class:"title-container"},Ct={class:"title"};function St(e,t,s,o,u,p){const n=c("info-icon"),d=c("el-input");return l(),_("div",Pt,[a("div",It,[a("h2",Ct,$(e.$t("suno.name.style")),1),r(n,{content:e.$t("suno.description.style"),class:"info"},null,8,["content"])]),r(d,{modelValue:e.style,"onUpdate:modelValue":t[0]||(t[0]=h=>e.style=h),rows:3,type:"textarea",class:"style",placeholder:e.$t("suno.placeholder.style"),maxlength:300,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var At=k(bt,[["render",St],["__scopeId","data-v-075e574a"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/StyleInput.vue"]]);const Nt="",Et=w({name:"TitleInput",components:{ElInput:ee,InfoIcon:te},data(){return{}},computed:{title:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.title},set(e){var t;console.debug("set title",e),this.$store.commit("suno/setConfig",f(m({},(t=this.$store.state.suno)==null?void 0:t.config),{title:e}))}},instrumental:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.instrumental},set(e){var t;console.debug("set instrumental",e),this.$store.commit("suno/setConfig",f(m({},(t=this.$store.state.suno)==null?void 0:t.config),{instrumental:e}))}}},mounted(){this.value||(this.value=Nt)}}),Tt={class:"field"},xt={class:"title-container"},Vt={class:"title"};function jt(e,t,s,o,u,p){const n=c("info-icon"),d=c("el-input");return l(),_("div",Tt,[a("div",xt,[a("h2",Vt,$(e.$t("suno.name.title")),1),r(n,{content:e.$t("suno.description.title"),class:"info"},null,8,["content"])]),r(d,{modelValue:e.title,"onUpdate:modelValue":t[0]||(t[0]=h=>e.title=h),rows:3,type:"textarea",class:"title",placeholder:e.$t("suno.placeholder.title"),maxlength:300,"show-word-limit":""},null,8,["modelValue","placeholder"])])}var Lt=k(Et,[["render",jt],["__scopeId","data-v-f9bac2fa"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/TitleInput.vue"]]);function X(e){const t=Math.floor(e)%60;e=Math.floor(e/60);const s=e%60,o=s<10?`0${s}`:s,u=t<10?`0${t}`:t;return o+":"+u}const Dt=w({name:"ExtendFromInput",components:{ElImage:re,ElIcon:le,ElInputNumber:Ue,VideoPlay:ye,VideoPause:ke},data(){return{}},computed:{audio(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.audio},value:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.continue_at},set(e){var t;console.debug("set continue_at",e),this.$store.commit("suno/setConfig",f(m({},(t=this.$store.state.suno)==null?void 0:t.config),{continue_at:e?parseInt(e):void 0}))}}},mounted(){this.value||(this.value=void 0)},methods:{handleChange(e){var t,s;e<0?this.value=0:e>((t=this.audio)==null?void 0:t.duration)?this.value=(s=this.audio)==null?void 0:s.duration:this.value=e},useFormatDuring:X,onPlay(e){this.$store.dispatch("suno/setAudio",f(m(m({},this.$store.state.suno.audio),e),{state:"playing"})),console.log("on play")},onPause(e){this.$store.dispatch("suno/setAudio",f(m(m({},this.$store.state.suno.audio),e),{state:"paused"})),console.log("on pause")},onClick(e){var t,s,o;((o=(s=(t=this.$store.state)==null?void 0:t.suno)==null?void 0:s.audio)==null?void 0:o.id)!==e.id&&this.onPlay(f(m({},e),{progress:0}))}}}),Ft={class:"field"},Ut={class:"box"},Gt={class:"title"},Rt={class:"input-wrapper"},zt={class:"task"},Ot={class:"left"},qt={key:2,class:"duration"},Mt={class:"info"},Bt={class:"title"},Wt={class:"style"};function Kt(e,t,s,o,u,p){var S,A,i,N,I,C,x,V,j,F,D,G,R,z,O,q,M,B,W,L,ue,de,pe,_e,me;const n=c("el-input-number"),d=c("el-image"),h=c("video-pause"),v=c("el-icon"),E=c("video-play"),T=be("loading");return l(),_("div",Ft,[a("div",Ut,[a("h2",Gt,$(e.$t("suno.name.extend")),1),a("div",Rt,[r(n,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=J=>e.value=J),class:"value",min:0,max:(S=e.audio)==null?void 0:S.duration,controls:!1,placeholder:e.$t("suno.placeholder.extend.continue_at"),onChange:e.handleChange},null,8,["modelValue","max","placeholder","onChange"])])]),a("div",zt,[a("div",{class:"audio",onClick:t[3]||(t[3]=J=>e.onClick(e.audio))},[ce((l(),_("div",Ot,[r(d,{src:(A=e.audio)==null?void 0:A.image_url,class:"cover",fit:"cover"},null,8,["src"]),((i=e.audio)==null?void 0:i.audio_url)&&((C=(I=(N=e.$store.state)==null?void 0:N.suno)==null?void 0:I.audio)==null?void 0:C.id)===e.audio.id&&((j=(V=(x=e.$store.state)==null?void 0:x.suno)==null?void 0:V.audio)==null?void 0:j.state)==="playing"?(l(),_("div",{key:0,class:"overlay",onClick:t[1]||(t[1]=J=>e.onPause(e.audio))},[r(v,null,{default:y(()=>[r(h)]),_:1})])):b("v-if",!0),((F=e.audio)==null?void 0:F.audio_url)&&(((R=(G=(D=e.$store.state)==null?void 0:D.suno)==null?void 0:G.audio)==null?void 0:R.id)!==e.audio.id||((q=(O=(z=e.$store.state)==null?void 0:z.suno)==null?void 0:O.audio)==null?void 0:q.id)===e.audio.id&&((W=(B=(M=e.$store.state)==null?void 0:M.suno)==null?void 0:B.audio)==null?void 0:W.state)==="paused")?(l(),_("div",{key:1,class:"overlay",onClick:t[2]||(t[2]=J=>e.onPlay(e.audio))},[r(v,null,{default:y(()=>[r(E)]),_:1})])):b("v-if",!0),(L=e.audio)!=null&&L.duration?(l(),_("div",qt,$(e.useFormatDuring((ue=e.audio)==null?void 0:ue.duration)),1)):b("v-if",!0)])),[[T,!((de=e.audio)!=null&&de.audio_url)||!((pe=e.audio)!=null&&pe.video_url)]]),a("div",Mt,[a("h2",Bt,$((_e=e.audio)==null?void 0:_e.title),1),a("p",Wt,$((me=e.audio)==null?void 0:me.style),1)])])])])}var Ht=k(Dt,[["render",Kt],["__scopeId","data-v-040b76e5"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/ExtendFromInput.vue"]]);const Yt=!1,Jt=w({name:"InstrumentSwitch",components:{ElSwitch:ge},data(){return{}},computed:{instrumental:{get(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.config)==null?void 0:t.instrumental},set(e){var t;console.debug("set instrumental",e),this.$store.commit("suno/setConfig",f(m({},(t=this.$store.state.suno)==null?void 0:t.config),{instrumental:e}))}}},mounted(){this.instrumental===void 0&&(this.instrumental=Yt)}}),Qt={class:"field"},Zt={class:"title inline-block"};function Xt(e,t,s,o,u,p){const n=c("el-switch");return l(),_("div",Qt,[r(n,{modelValue:e.instrumental,"onUpdate:modelValue":t[0]||(t[0]=d=>e.instrumental=d),class:"value mr-2"},null,8,["modelValue"]),a("h2",Zt,$(e.$t("suno.name.instrumental")),1)])}var es=k(Jt,[["render",Xt],["__scopeId","data-v-78764cec"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/config/InstrumentSwitch.vue"]]);const ts=w({name:"PresetPanel",components:{TypeSelector:lt,PromptInput:ht,LyricInput:wt,InstrumentSwitch:es,StyleInput:At,TitleInput:Lt,ExtendFromInput:Ht,FontAwesomeIcon:ie,ElButton:ae},emits:["generate"],computed:{config(){var e;return(e=this.$store.state.suno)==null?void 0:e.config}},methods:{onGenerate(){this.$emit("generate")}}}),ss={class:"panel"},os={class:"config"},ns={class:"actions"};function is(e,t,s,o,u,p){var N,I,C,x,V,j;const n=c("type-selector"),d=c("instrument-switch"),h=c("prompt-input"),v=c("lyric-input"),E=c("style-input"),T=c("title-input"),S=c("extend-from-input"),A=c("font-awesome-icon"),i=c("el-button");return l(),_("div",ss,[a("div",os,[r(n,{class:"mb-4"}),r(d,{class:"mb-4 instrument"}),(N=e.config)!=null&&N.custom?b("v-if",!0):(l(),P(h,{key:0,class:"mb-4"})),((I=e.config)==null?void 0:I.custom)&&!e.config.instrumental?(l(),P(v,{key:1,class:"mb-4"})):b("v-if",!0),(C=e.config)!=null&&C.custom?(l(),P(E,{key:2,class:"mb-4"})):b("v-if",!0),(x=e.config)!=null&&x.custom?(l(),P(T,{key:3,class:"mb-4"})):b("v-if",!0),((V=e.config)==null?void 0:V.action)==="extend"?(l(),P(S,{key:4,class:"mb-4"})):b("v-if",!0),a("div",ns,[((j=e.config)==null?void 0:j.action)!=="extend"?(l(),P(i,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:y(()=>[r(A,{icon:"fa-solid fa-magic",class:"mr-2"}),oe(" "+$(e.$t("suno.button.generate")),1)]),_:1},8,["onClick"])):(l(),P(i,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:y(()=>[r(A,{icon:"fa-solid fa-magic",class:"mr-2"}),oe(" "+$(e.$t("suno.button.extend")),1)]),_:1},8,["onClick"]))])])])}var as=k(ts,[["render",is],["__scopeId","data-v-38bb3c66"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/ConfigPanel.vue"]]);const rs=w({name:"TaskPreview",components:{ElImage:re,ElIcon:le,ElTooltip:Ge,ElButton:ae,FontAwesomeIcon:ie,VideoPlay:ye,VideoPause:ke},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{task(){var e;return(e=this.$store.state.suno)==null?void 0:e.tasks},audios(){var t,s,o,u,p;let e=[];return Array.isArray((s=(t=this.modelValue)==null?void 0:t.response)==null?void 0:s.data)&&((p=(u=(o=this.modelValue)==null?void 0:o.response)==null?void 0:u.data)==null||p.forEach(n=>{let d=n;e.push(d)})),console.log("audios",e),e},application(){var e;return(e=this.$store.state.suno)==null?void 0:e.application},active(){var e,t;return(t=(e=this.$store.state.suno)==null?void 0:e.tasks)==null?void 0:t.active}},methods:{useFormatDuring:X,onPlay(e){this.$store.dispatch("suno/setAudio",f(m(m({},this.$store.state.suno.audio),e),{state:"playing"})),console.log("on play")},onPause(e){this.$store.dispatch("suno/setAudio",f(m(m({},this.$store.state.suno.audio),e),{state:"paused"})),console.log("on pause")},onClick(e){var t,s,o;((o=(s=(t=this.$store.state)==null?void 0:t.suno)==null?void 0:s.audio)==null?void 0:o.id)!==e.id&&this.onPlay(f(m({},e),{progress:0}))},onExtend(e,t){var s;e.stopPropagation(),console.log("on extend"),console.debug("set config",t),this.$store.commit("suno/setConfig",f(m({},(s=this.$store.state.suno)==null?void 0:s.config),{model:t.model,custom:!0,instrumental:!1,style:t.style,action:"extend",audio:t,audio_id:t.id,continue_at:t.duration}))},onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onPreview(e,t){e.stopPropagation(),console.log("on preview"),window.open(t,"_blank")}}}),ls={class:"task"},cs=["onClick"],us={class:"left"},ds=["onClick"],ps=["onClick"],_s={key:2,class:"duration"},ms={class:"info"},hs={class:"title"},fs={class:"style"},vs={class:"right"};function $s(e,t,s,o,u,p){const n=c("el-image"),d=c("video-pause"),h=c("el-icon"),v=c("video-play"),E=c("el-button"),T=c("font-awesome-icon"),S=c("el-tooltip"),A=be("loading");return l(),_("div",ls,[(l(!0),_(H,null,Z(e.audios,(i,N)=>{var I,C,x,V,j,F,D,G,R,z,O,q,M,B,W;return l(),_("div",{key:N,class:"audio",onClick:L=>e.onClick(i)},[ce((l(),_("div",us,[r(n,{src:i==null?void 0:i.image_url,class:"cover",fit:"cover"},null,8,["src"]),(i==null?void 0:i.audio_url)&&((x=(C=(I=e.$store.state)==null?void 0:I.suno)==null?void 0:C.audio)==null?void 0:x.id)===i.id&&((F=(j=(V=e.$store.state)==null?void 0:V.suno)==null?void 0:j.audio)==null?void 0:F.state)==="playing"?(l(),_("div",{key:0,class:"overlay",onClick:L=>e.onPause(i)},[r(h,null,{default:y(()=>[r(d)]),_:1})],8,ds)):b("v-if",!0),(i==null?void 0:i.audio_url)&&(((R=(G=(D=e.$store.state)==null?void 0:D.suno)==null?void 0:G.audio)==null?void 0:R.id)!==i.id||((q=(O=(z=e.$store.state)==null?void 0:z.suno)==null?void 0:O.audio)==null?void 0:q.id)===i.id&&((W=(B=(M=e.$store.state)==null?void 0:M.suno)==null?void 0:B.audio)==null?void 0:W.state)==="paused")?(l(),_("div",{key:1,class:"overlay",onClick:L=>e.onPlay(i)},[r(h,null,{default:y(()=>[r(v)]),_:1})],8,ps)):b("v-if",!0),i!=null&&i.duration?(l(),_("div",_s,$(e.useFormatDuring(i==null?void 0:i.duration)),1)):b("v-if",!0)])),[[A,!(i!=null&&i.audio_url)||!(i!=null&&i.video_url)]]),a("div",ms,[a("h2",hs,$(i==null?void 0:i.title),1),a("p",fs,$(i==null?void 0:i.style),1)]),a("div",vs,[r(E,{size:"small",round:"",onClick:L=>e.onExtend(L,i)},{default:y(()=>[oe($(e.$t("suno.button.extend")),1)]),_:2},1032,["onClick"]),r(S,{effect:"dark",content:e.$t("suno.button.download"),placement:"top"},{default:y(()=>[i!=null&&i.audio_url?(l(),P(T,{key:0,icon:"fa-solid fa-download",class:"icon icon-download",onClick:L=>e.onDownload(L,i==null?void 0:i.audio_url)},null,8,["onClick"])):b("v-if",!0)]),_:2},1032,["content"]),r(S,{effect:"dark",content:e.$t("suno.button.video"),placement:"top"},{default:y(()=>[i!=null&&i.video_url?(l(),P(T,{key:0,icon:"fa-solid fa-clapperboard",class:"icon icon-preview",onClick:L=>e.onPreview(L,i==null?void 0:i.video_url)},null,8,["onClick"])):b("v-if",!0)]),_:2},1032,["content"])])],8,cs)}),128))])}var gs=k(rs,[["render",$s],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/task/Preview.vue"]]);const ys={class:"player-slider"},ks=w({setup(e){const t=Y(),s=U({get:()=>{var n,d;return(d=(n=t.state.suno)==null?void 0:n.audio)==null?void 0:d.progress},set:n=>t.commit("suno/setAudio",f(m({},t.state.suno.audio),{progress:n}))}),o=U({get:()=>{var n,d;return(d=(n=t.state.suno)==null?void 0:n.audio)==null?void 0:d.duration},set:n=>t.commit("suno/setAudio",f(m({},t.state.suno.audio),{duration:n}))}),u=()=>{},p=n=>t.dispatch("suno/setAudio",f(m({},t.state.suno.audio),{progress:n}));return(n,d)=>(l(),_("div",ys,[r(g(we),{modelValue:g(s),"onUpdate:modelValue":d[0]||(d[0]=h=>Pe(s)?s.value=h:null),"show-tooltip":!1,min:0,max:g(o),onChange:p,onInput:u},null,8,["modelValue","max"])]))}});var ws=k(ks,[["__file","/home/runner/work/Nexior/Nexior/src/components/suno/player/PlayerSlider.vue"]]),bs="/assets/disk.4907c891.png";const Ps={class:"flex player-song"},Is=["src"],Cs={class:"ml-2 text-xs flex flex-col justify-between"},Ss={class:"w-52 2xl:w-96 cursor-pointer truncate"},As={class:"flex"},Ns={class:"ml-2 text-dc"},Es=w({setup(e){const t=Y(),s=U({get:()=>t.state.suno.audio,set:o=>t.commit("suno/setAudio",o)});return We(s,(o,u)=>{if((o==null?void 0:o.audio_url)!==(u==null?void 0:u.audio_url)){console.log("audio changed",o),o.object&&(console.log("111",o.object),o.object.pause(),delete o.object);const p=new Audio(o.audio_url);o.state==="playing"?p.play():p.pause(),p.addEventListener("loadedmetadata",()=>{p.currentTime=0,p.addEventListener("timeupdate",()=>{t.commit("suno/setAudio",f(m({},t.state.suno.audio),{progress:p.currentTime}))})}),t.commit("suno/setAudio",f(m({},t.state.suno.audio),{object:p}))}else if((o==null?void 0:o.progress)!==(u==null?void 0:u.progress)&&Math.abs(o.progress-o.object.currentTime)>2){console.log("progress changed",o.progress);const p=t.state.suno.audio;p.object&&(p.object.currentTime=p.progress)}else(o==null?void 0:o.state)!==(u==null?void 0:u.state)&&(console.log("state changed",o.state),o.object&&(o.state==="playing"?o.object.play():o.object.pause()));(o==null?void 0:o.volume)!==(u==null?void 0:u.volume)&&(console.log("volume changed",o.volume),o.object&&(o.object.volume=o.volume/100))}),(o,u)=>{var p,n,d;return l(),_("div",Ps,[a("img",{alt:"",class:"w-11 h-11 rounded",src:((p=g(s))==null?void 0:p.image_url)||g(bs)},null,8,Is),a("div",Cs,[a("div",Ss,[a("div",As,[a("span",null,$(((n=g(s))==null?void 0:n.title)||"Music"),1),a("span",Ns,"- "+$(((d=g(s))==null?void 0:d.style)||"SmallRuralDog"),1)])])])])}}});var Ts=k(Es,[["__file","/home/runner/work/Nexior/Nexior/src/components/suno/player/PlayerSong.vue"]]);const xs={class:"flex justify-end items-center gap-x-2.5"},Vs={class:"text-xs"},js=w({setup(e){const t=Y(),s=U({get:()=>{var u,p;return(p=(u=t.state.suno)==null?void 0:u.audio)==null?void 0:p.progress},set:u=>t.commit("suno/setAudio",f(m({},t.state.suno.audio),{progress:u}))}),o=U({get:()=>{var u,p;return(p=(u=t.state.suno)==null?void 0:u.audio)==null?void 0:p.duration},set:u=>t.commit("suno/setAudio",f(m({},t.state.suno.audio),{duration:u}))});return(u,p)=>(l(),_("div",xs,[a("span",Vs,$(g(X)(g(s)))+" / "+$(g(X)(g(o))),1)]))}});var Ls=k(js,[["__file","/home/runner/work/Nexior/Nexior/src/components/suno/player/PlayerAction.vue"]]);const Ds=w({props:{icon:{type:null,required:!0},theme:{type:String,required:!1},size:{type:[Number,String],required:!1},spin:{type:Boolean,required:!1},fill:{type:[String,Array],required:!1},strokeLinecap:{type:String,required:!1},strokeLinejoin:{type:String,required:!1},strokeWidth:{type:Number,required:!1}},setup(e){return(t,s)=>(l(),P(Ke(e.icon),{theme:e.theme,size:e.size,spin:e.spin,fill:e.fill,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin,"stroke-width":e.strokeWidth},null,8,["theme","size","spin","fill","stroke-linecap","stroke-linejoin","stroke-width"]))}});var ne=k(Ds,[["__file","/home/runner/work/Nexior/Nexior/src/components/common/IconPark.vue"]]);const Fs={class:"player-volume flex flex-col items-center pt-2"},Us={class:"text-sm mt-3"},Gs={class:"mt-2"},Rs=w({setup(e){const t=Y(),s=U({get:()=>{var n;return(n=t.state.suno.audio)==null?void 0:n.volume},set:n=>t.commit("suno/setAudio",f(m({},t.state.suno.audio),{volume:n}))}),o=U({get:()=>{var n;return(n=t.state.suno.audio)==null?void 0:n.muted},set:n=>t.commit("suno/setAudio",f(m({},t.state.suno.audio),{muted:n}))}),u=()=>t.dispatch("suno/toggleMuted"),p=n=>t.dispatch("suno/setVolume",n);return(n,d)=>(l(),_("div",Fs,[a("div",null,[r(g(we),{modelValue:g(s),"onUpdate:modelValue":d[0]||(d[0]=h=>Pe(s)?s.value=h:null),vertical:"",height:"100px","show-tooltip":!1,max:100,min:0,size:"small",disabled:g(o),onInput:p},null,8,["modelValue","disabled"])]),a("div",Us,$(g(s)),1),a("div",Gs,[r(ne,{icon:g(o)?g(Ee):g($e),size:"16",theme:"filled",class:"hover-text",onClick:u},null,8,["icon"])])]))}});var zs=k(Rs,[["__file","/home/runner/work/Nexior/Nexior/src/components/suno/player/PlayerVolumeSlider.vue"]]);const Os={class:"flex items-center justify-center gap-x-3"},qs=w({setup(e){const t=Y(),s=()=>t.dispatch("suno/setAudio",f(m({},t.state.suno.audio),{state:t.state.suno.audio.state==="playing"?"paused":"playing"})),o=U(()=>t.state.suno.audio);return(u,p)=>{var n;return l(),_("div",Os,[r(ne,{icon:((n=g(o))==null?void 0:n.state)==="playing"?g(Te):g(xe),size:"45",theme:"filled",class:"control",onClick:s},null,8,["icon"]),r(g(Re),{placement:"top",width:"50px"},{reference:y(()=>[r(ne,{icon:g($e),size:"20","stroke-width":3,class:"hover-text"},null,8,["icon"])]),default:y(()=>[r(zs)]),_:1})])}}});var Ms=k(qs,[["__file","/home/runner/work/Nexior/Nexior/src/components/suno/player/PlayerController.vue"]]);const Bs={class:"flex flex-col items-stretch h-20"},Ws={class:"flex grow px-5 items-center"},Ks={class:"flex-1"},Hs={class:"flex-1"},Ys={class:"flex-1"},Js=w({setup(e){return(t,s)=>(l(),_("div",Bs,[r(ws),a("div",Ws,[a("div",Ks,[r(Ts)]),a("div",Hs,[r(Ms)]),a("div",Ys,[r(Ls)])])]))}});var Qs=k(Js,[["__file","/home/runner/work/Nexior/Nexior/src/components/suno/player/Player.vue"]]);const Zs=w({name:"RecentPanel",components:{TaskPreview:gs,ElSkeleton:ze,ElSkeletonItem:Oe,Player:Qs},data(){return{job:0}},computed:{tasks(){var e,t,s,o;return f(m({},(e=this.$store.state.suno)==null?void 0:e.tasks),{items:(o=(s=(t=this.$store.state.suno)==null?void 0:t.tasks)==null?void 0:s.items)==null?void 0:o.slice().reverse()})}}}),Xs={class:"panel recent"},eo={key:0,class:"tasks"},to={class:"left"},so={class:"main"},oo={key:1,class:"tasks"},no={key:2,class:"description"},io={class:"flex-1 flex flex-col"},ao={class:"h-20"};function ro(e,t,s,o,u,p){var E,T,S,A,i,N,I,C,x,V,j,F;const n=c("el-skeleton-item"),d=c("el-skeleton"),h=c("task-preview"),v=c("player");return l(),_(H,null,[a("div",Xs,[((E=e.tasks)==null?void 0:E.items)===void 0?(l(),_("div",eo,[(l(),_(H,null,Z(3,D=>a("div",{key:D,class:"task placeholder"},[a("div",to,[r(d,{animated:""},{template:y(()=>[r(n,{variant:"image",class:"avatar"})]),_:1})]),a("div",so,[r(d,{animated:""},{template:y(()=>[r(n,{variant:"p",class:"title"}),r(n,{variant:"text",style:{"margin-right":"16px"}}),r(n,{variant:"text",style:{width:"80%"}})]),_:1})])])),64))])):((S=(T=e.tasks)==null?void 0:T.items)==null?void 0:S.length)&&((i=(A=e.tasks)==null?void 0:A.items)==null?void 0:i.length)>0?(l(),_("div",oo,[(l(!0),_(H,null,Z((N=e.tasks)==null?void 0:N.items,(D,G)=>(l(),P(h,{key:G,"model-value":D,class:"preview"},null,8,["model-value"]))),128))])):b("v-if",!0),((C=(I=e.tasks)==null?void 0:I.items)==null?void 0:C.length)===0?(l(),_("p",no,$(e.$t("suno.message.noTasks")),1)):b("v-if",!0)]),ce(a("div",io,[a("div",ao,[r(v)])],512),[[He,!!((F=(j=(V=(x=e.$store)==null?void 0:x.state)==null?void 0:V.suno)==null?void 0:j.audio)!=null&&F.object)]])],64)}var lo=k(Zs,[["render",ro],["__scopeId","data-v-9a683526"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/RecentPanel.vue"]]);const co=w({name:"TaskPreview",components:{ElScrollbar:qe,IconPicture:Me,ElImage:re,ElAvatar:Be,ElIcon:le},data(){return{showCloseIcon:!0}},computed:{audio(){var e;return(e=this.$store.state.suno)==null?void 0:e.audio}},methods:{closeCard(){this.showCloseIcon=!this.showCloseIcon}}}),uo={key:0,class:"card"},po={class:"image-container"},_o={class:"image-slot"},mo={class:"title"},ho={class:"content"},fo={class:"artist"},vo={class:"style"},$o={class:"time"},go={class:"lyrics"},yo={key:1,class:"gradient-background"};function ko(e,t,s,o,u,p){const n=c("icon-picture"),d=c("el-icon"),h=c("el-image"),v=c("el-avatar"),E=c("el-scrollbar");return l(),P(E,{class:"right-panel"},{default:y(()=>{var T,S,A,i,N,I,C;return[(T=e.audio)!=null&&T.object?(l(),_("div",uo,[a("div",po,[r(h,{src:e.audio.image_url,fit:"cover"},{error:y(()=>[a("div",_o,[r(d,null,{default:y(()=>[r(n)]),_:1})])]),_:1},8,["src"]),a("h2",mo,$((S=e.audio)==null?void 0:S.title),1)]),a("div",ho,[a("div",fo,[r(v,{size:30,src:(A=e.audio)==null?void 0:A.image_url},null,8,["src"]),a("span",null,$((i=e.audio)==null?void 0:i.prompt),1)]),a("p",vo,$((N=e.audio)==null?void 0:N.style),1),a("p",$o,$(e.$dayjs.format((I=e.audio)==null?void 0:I.created_at)),1),a("div",go,[a("p",null,$((C=e.audio)==null?void 0:C.lyric),1)])])])):(l(),_("div",yo))]}),_:1})}var wo=k(co,[["render",ko],["__scopeId","data-v-19e67a48"],["__file","/home/runner/work/Nexior/Nexior/src/components/suno/PreviewPanel.vue"]]);const bo="https://webhook.acedata.cloud/suno",Po=w({name:"SunoIndex",components:{Layout:ot,ApplicationStatus:Ye,ConfigPanel:as,RecentPanel:lo,PreviewPanel:wo},data(){return{task:void 0,job:0,timer:void 0}},computed:{loading(){var e,t;return((t=(e=this.$store.state.suno)==null?void 0:e.status)==null?void 0:t.getApplication)===se.Request},service(){return this.$store.state.suno.service},credential(){return this.$store.state.suno.credential},config(){return this.$store.state.suno.config},initializing(){return this.$store.state.suno.status.getApplications===se.Request},needApply(){return this.$store.state.suno.status.getApplications===se.Success&&!this.application},application(){return this.$store.state.suno.application},tasks(){return this.$store.state.suno.tasks}},watch:{tasks:{handler(e,t){var s,o;((s=e==null?void 0:e.items)==null?void 0:s.length)>((o=t==null?void 0:t.items)==null?void 0:o.length)&&(console.debug("new tasks detected"),this.onScrollDown())},deep:!0}},async mounted(){await this.onGetService(),await this.onGetApplication(),await this.onScrollDown(),await this.onGetTasks(),await this.onScrollDown(),this.job=setInterval(()=>{this.onGetTasks()},5e3)},async unmounted(){clearInterval(this.job),clearInterval(this.timer)},methods:{async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("suno/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplications"),await this.$store.dispatch("suno/getApplications"),console.debug("end onGetApplications"),await this.onGetTasks()},onApply(){Ve.create({application:this.application}).then(({data:e})=>{this.application=e,K.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)===Je&&K.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".recent");e&&(e.scrollTop=e.scrollHeight)},1e3)},async onGetTasks(){if(this.loading){console.debug("loading");return}await this.$store.dispatch("suno/getTasks",{limit:30,offset:0})},async onGenerateAudio(){var s;const e=f(m({},this.config),{callback_url:bo}),t=(s=this.credential)==null?void 0:s.token;if(!t){console.error("no token specified");return}K.success(this.$t("suno.message.startingTask")),je.audio(e,{token:t}).then(()=>{K.success(this.$t("suno.message.startTaskSuccess"))}).catch(()=>{K.error(this.$t("suno.message.startTaskFailed"))}).finally(async()=>{await this.onGetTasks(),await this.onScrollDown()})}}});function Io(e,t,s,o,u,p){const n=c("config-panel"),d=c("application-status"),h=c("recent-panel"),v=c("preview-panel"),E=c("layout");return l(),P(E,null,{config:y(()=>[r(n,{onGenerate:e.onGenerateAudio},null,8,["onGenerate"])]),result:y(()=>[r(d,{initializing:e.initializing,application:e.application,service:e.service,"need-apply":e.needApply,class:"mb-4",onRefresh:e.onGetApplication},null,8,["initializing","application","service","need-apply","onRefresh"]),r(h,{class:"panel recent"})]),preview:y(()=>[r(v)]),_:1})}var Do=k(Po,[["render",Io],["__scopeId","data-v-11d62c6c"],["__file","/home/runner/work/Nexior/Nexior/src/pages/suno/Index.vue"]]);export{Do as default};