@acedatacloud/nexior 3.196.0 → 3.198.0

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 (225) hide show
  1. package/dist/assets/{Auth-Mbih7X4A.js → Auth-CaLcT3FS.js} +1 -1
  2. package/dist/assets/{BotPlaceholder-BeyeAf9f.js → BotPlaceholder-Cjk9ezqQ.js} +1 -1
  3. package/dist/assets/{Callback-D6RMgDn7.js → Callback-qx4HIw6H.js} +1 -1
  4. package/dist/assets/{Console-BWZpJyGW.js → Console-jt3wi3wo.js} +1 -1
  5. package/dist/assets/{Consumption-DVBEzfCm.js → Consumption-BTGrt-H6.js} +1 -1
  6. package/dist/assets/{Conversation-CobktRJ6.js → Conversation-BzvG6dbG.js} +1 -1
  7. package/dist/assets/{CopyToClipboard-C2THHT8U.js → CopyToClipboard-DvQT_E6_.js} +1 -1
  8. package/dist/assets/{Detail-DN9xyEPZ.js → Detail-BSjGc7qb.js} +2 -2
  9. package/dist/assets/{Extra-D-71nFix.js → Extra-imh6fuZa.js} +1 -1
  10. package/dist/assets/{FilePreview-8FQKYkYM.js → FilePreview-l8OCb5Th.js} +1 -1
  11. package/dist/assets/{History-CI0IKBCT.js → History-ugh0qxRo.js} +1 -1
  12. package/dist/assets/{IconPark.vue_vue_type_script_setup_true_lang-DHCP0oBC.js → IconPark.vue_vue_type_script_setup_true_lang-cWO93xyF.js} +1 -1
  13. package/dist/assets/{ImagePreview-BID-4kFX.js → ImagePreview--9ujFwpd.js} +1 -1
  14. package/dist/assets/{ImageWrapper-J09Vd3aW.js → ImageWrapper-BNXqLRNZ.js} +1 -1
  15. package/dist/assets/{Index-Cx7kcFuO.js → Index--TgYCuJg.js} +1 -1
  16. package/dist/assets/{Index-CI-BXcSh.js → Index-5nhSoMko.js} +1 -1
  17. package/dist/assets/{Index-Cr92DtzA.js → Index-8yKTjd0-.js} +1 -1
  18. package/dist/assets/{Index-BpicSvEQ.js → Index-BDDdC6JS.js} +1 -1
  19. package/dist/assets/{Index-zKdQEm_3.js → Index-BDQB8Sq4.js} +1 -1
  20. package/dist/assets/{Index-BfMalOjb.js → Index-BEyggGah.js} +1 -1
  21. package/dist/assets/{Index-BmNsS978.js → Index-BXez8_P1.js} +1 -1
  22. package/dist/assets/{Index-BQjHXYmE.js → Index-BXoLx4Al.js} +1 -1
  23. package/dist/assets/{Index-DNYHKHC1.js → Index-Bwl8Q11-.js} +1 -1
  24. package/dist/assets/{Index-C9pD7aCg.js → Index-C5Xm7NCq.js} +1 -1
  25. package/dist/assets/{Index-BS6-CC3d.js → Index-CH0ZBR0g.js} +1 -1
  26. package/dist/assets/{Index-DFKPlxg7.js → Index-CP2r7l4u.js} +1 -1
  27. package/dist/assets/{Index-CznZ8rbX.js → Index-CQqFgZiG.js} +1 -1
  28. package/dist/assets/{Index-r4n3zgQH.js → Index-CS_D-5PX.js} +1 -1
  29. package/dist/assets/{Index-BqX8Johs.js → Index-CT7NVm3I.js} +1 -1
  30. package/dist/assets/{Index-DKPhnKXX.js → Index-CjCC_0ZE.js} +1 -1
  31. package/dist/assets/{Index-DtSMo1Vh.js → Index-Cs9HokAK.js} +1 -1
  32. package/dist/assets/{Index-Cg4ZUVhh.js → Index-CxZC-W5r.js} +1 -1
  33. package/dist/assets/{Index-EAvEmHbz.js → Index-D5CYFCbj.js} +1 -1
  34. package/dist/assets/{Index-BhwVL3x4.js → Index-DC8J2nTy.js} +1 -1
  35. package/dist/assets/{Index-Cv7J3Ye-.js → Index-D_pKU4-9.js} +1 -1
  36. package/dist/assets/{Index-oBw4wPZu.js → Index-Dh6O3rrz.js} +1 -1
  37. package/dist/assets/{Index-Bf5O9LDS.js → Index-qDlTMaA-.js} +1 -1
  38. package/dist/assets/{Index-DEBuwX7a.js → Index-tP6UUxnY.js} +1 -1
  39. package/dist/assets/{Invitees-xtfk7PEx.js → Invitees-o3mWKY_c.js} +1 -1
  40. package/dist/assets/{List-CAvGw-0h.js → List-C2lT-pwX.js} +1 -1
  41. package/dist/assets/{List-DCcIEA6m.js → List-CSD5fUdN.js} +1 -1
  42. package/dist/assets/{List-C0yUFjtR.js → List-cPkwlnK0.js} +1 -1
  43. package/dist/assets/{Main-xk5uPe74.js → Main-CHnTvHB_.js} +1 -1
  44. package/dist/assets/Navigator-IL1jxOeb.css +1 -0
  45. package/dist/assets/{Navigator-BQlhmrkb.js → Navigator-ipXTYPXS.js} +3 -3
  46. package/dist/assets/{NoTasks-COJAQuGK.js → NoTasks-B83CvG_8.js} +1 -1
  47. package/dist/assets/{NotFound-waTf2F4N.js → NotFound-BwrE1irB.js} +1 -1
  48. package/dist/assets/{OAuthCallback-DpZC8fKk.js → OAuthCallback-DI2MrojU.js} +1 -1
  49. package/dist/assets/{Pagination-LPTyBWbU.js → Pagination-J3-cUToX.js} +1 -1
  50. package/dist/assets/{Status-Blr6rj5w.js → Status-Dy2DjuOO.js} +1 -1
  51. package/dist/assets/{Subscribe-DVJayY3f.js → Subscribe-BLjuu6L3.js} +1 -1
  52. package/dist/assets/{VideoPlayer-B27B1Ug2.js → VideoPlayer-CvbYoanK.js} +1 -1
  53. package/dist/assets/{_Uint8Array-CI8yFZ43.js → _Uint8Array-B-ZN-HZ5.js} +1 -1
  54. package/dist/assets/{_baseClone-I702BQXP.js → _baseClone-DTM-dJi9.js} +1 -1
  55. package/dist/assets/{_baseIteratee-BU-JT24z.js → _baseIteratee-DLk1_nEJ.js} +1 -1
  56. package/dist/assets/{_initCloneObject-DtaxLMaj.js → _initCloneObject-D2_NhBTJ.js} +1 -1
  57. package/dist/assets/{add-DnlsS2ka.js → add-CEPNIa-u.js} +1 -1
  58. package/dist/assets/{all-wallets-MtxE6BLv.js → all-wallets-CtX7ccPK.js} +1 -1
  59. package/dist/assets/{app-store-DTecGWMj.js → app-store-DnLrQMqK.js} +1 -1
  60. package/dist/assets/{apple-CLkUFspW.js → apple-NafES0Il.js} +1 -1
  61. package/dist/assets/{arrow-bottom-BRpsJeV5.js → arrow-bottom-DYvuYbsU.js} +1 -1
  62. package/dist/assets/{arrow-bottom-circle-DpV1vrfs.js → arrow-bottom-circle-BWvUxG_F.js} +1 -1
  63. package/dist/assets/{arrow-left-DHZH4tyD.js → arrow-left-DI3YjOKj.js} +1 -1
  64. package/dist/assets/{arrow-right-tlMNfHBv.js → arrow-right-DzFrWEv6.js} +1 -1
  65. package/dist/assets/{arrow-top-DrBwhspQ.js → arrow-top-CqVoLqvI.js} +1 -1
  66. package/dist/assets/{avatar-yPfoVaqm.js → avatar-CpR684Iy.js} +1 -1
  67. package/dist/assets/{bank-CSAhfi2i.js → bank-PNGF22AH.js} +1 -1
  68. package/dist/assets/{basic-BQDMuSfm.js → basic-CDqRBBXL.js} +1 -1
  69. package/dist/assets/{browser-B2P1lCFH.js → browser-CrOADZP5.js} +1 -1
  70. package/dist/assets/{byokCredential-DE1qzDd9.js → byokCredential-Dx6mONn_.js} +1 -1
  71. package/dist/assets/{card-C2aNLDAe.js → card-CfjtmvYw.js} +1 -1
  72. package/dist/assets/{castArray-mQ1tkxyC.js → castArray-B2ZOzEca.js} +1 -1
  73. package/dist/assets/{chat-B11j-8KQ.js → chat-iPkOgyvM.js} +1 -1
  74. package/dist/assets/{checkmark-DMk3TaWM.js → checkmark-CqVDLJAu.js} +1 -1
  75. package/dist/assets/{checkmark-bold-INE9TErX.js → checkmark-bold-3Z3OY6Wc.js} +1 -1
  76. package/dist/assets/{chevron-bottom-xDO8NQ9R.js → chevron-bottom-QRbojW08.js} +1 -1
  77. package/dist/assets/{chevron-left-C7fyUOv2.js → chevron-left-BcS3giOC.js} +1 -1
  78. package/dist/assets/{chevron-right-tmCO_gYJ.js → chevron-right-Dt4TWYaa.js} +1 -1
  79. package/dist/assets/{chevron-top-BH5GFnck.js → chevron-top-CTK3HJn0.js} +1 -1
  80. package/dist/assets/{chrome-store-9_n1tQOa.js → chrome-store-CZ9eMB1e.js} +1 -1
  81. package/dist/assets/{clock-cZin1nOI.js → clock-ovDVg5-s.js} +1 -1
  82. package/dist/assets/{close-dkQku9ea.js → close-CaTMT67T.js} +1 -1
  83. package/dist/assets/{coinPlaceholder-DuX6kR-6.js → coinPlaceholder-DoPbr1XG.js} +1 -1
  84. package/dist/assets/{compass-CncojspH.js → compass-DyLPS9u4.js} +1 -1
  85. package/dist/assets/{copy-CNVTpgOk.js → copy-BBly_0qn.js} +1 -1
  86. package/dist/assets/{createTaskActions-BN6-V8Nz.js → createTaskActions-DQlyT2tQ.js} +1 -1
  87. package/dist/assets/{cursor-C7U0M9kc.js → cursor-D_uAcvEe.js} +1 -1
  88. package/dist/assets/{cursor-transparent-CDYSCF15.js → cursor-transparent-B4oP9vWn.js} +1 -1
  89. package/dist/assets/{debounce-Dh8RqSlB.js → debounce-DPcjcYAp.js} +1 -1
  90. package/dist/assets/{desktop-CfihbARa.js → desktop-B8AgmGUN.js} +1 -1
  91. package/dist/assets/{disconnect-CA2ykC_x.js → disconnect-kHOy7ZBM.js} +1 -1
  92. package/dist/assets/{discord-CcoV_FRK.js → discord-CaGDRkFk.js} +1 -1
  93. package/dist/assets/{distribution-Ct_ANw3m.js → distribution-ChIPkO1D.js} +1 -1
  94. package/dist/assets/{dropdown-DR031DEl.js → dropdown-FfWf6mGF.js} +1 -1
  95. package/dist/assets/{etherscan-BhuyS-zL.js → etherscan-VQ8_S2xs.js} +1 -1
  96. package/dist/assets/{exclamation-triangle-DPLPdw6s.js → exclamation-triangle-CQUtDR5o.js} +1 -1
  97. package/dist/assets/{extension-B4J5H7n8.js → extension-ChvMEjxo.js} +1 -1
  98. package/dist/assets/{external-link-fjyUTYeb.js → external-link-VW4NUANY.js} +1 -1
  99. package/dist/assets/{facebook-CiadvA8D.js → facebook-yrkZgnnA.js} +1 -1
  100. package/dist/assets/{farcaster-_otB0AZo.js → farcaster-DPpCwIme.js} +1 -1
  101. package/dist/assets/{filters-D_6dW1Wu.js → filters-DQWPjChM.js} +1 -1
  102. package/dist/assets/{github-BYNMPfhl.js → github-Bl0M_eTa.js} +1 -1
  103. package/dist/assets/{google-DU3q9NFA.js → google-CmuRaaU8.js} +1 -1
  104. package/dist/assets/{help-circle-DKNUyWSv.js → help-circle-BLJtlEPK.js} +1 -1
  105. package/dist/assets/{id-BxCPp99k.js → id-DaeXwVgD.js} +1 -1
  106. package/dist/assets/{image-Bbd91L5U.js → image-BnHkZm3A.js} +1 -1
  107. package/dist/assets/{index-CqcFDQ_G.js → index-1krlZQmJ.js} +1 -1
  108. package/dist/assets/{index-8otrg1ss.js → index-5nTLszPD.js} +1 -1
  109. package/dist/assets/{index-DKwJd-cN.js → index-680HyGHp.js} +1 -1
  110. package/dist/assets/{index-BLdEuIsD.js → index-7dngn8kE.js} +1 -1
  111. package/dist/assets/{index-D12rbAaK.js → index-B-WY-_9q.js} +1 -1
  112. package/dist/assets/{index-Ck6171A8.js → index-B2g4JUER.js} +1 -1
  113. package/dist/assets/{index-BtuNRDJF.js → index-B4ilm3LC.js} +1 -1
  114. package/dist/assets/{index-BttYw7zE.js → index-BAiyxU02.js} +1 -1
  115. package/dist/assets/{index-D3Nml2aS.js → index-BB6hDLIE.js} +1 -1
  116. package/dist/assets/{index-C2-gUTzR.js → index-BCYj3n6w.js} +1 -1
  117. package/dist/assets/{index-Cp5Vilw1.js → index-BHwfxSyw.js} +1 -1
  118. package/dist/assets/{index-sMArUCsN.js → index-BUWKmD9b.js} +1 -1
  119. package/dist/assets/{index-B73VNuAm.js → index-BV07Wvw8.js} +1 -1
  120. package/dist/assets/{index-CRa1r1FF.js → index-BZNL_Qx3.js} +1 -1
  121. package/dist/assets/{index-CgQGwr_3.js → index-BZxcgFcJ.js} +1 -1
  122. package/dist/assets/{index-DYODEtlg.js → index-Bbp80plT.js} +1 -1
  123. package/dist/assets/{index-DWuZyOZ-.js → index-Bd6dMPQ8.js} +1 -1
  124. package/dist/assets/{index-C46TTxpf.js → index-BjBYK4Ze.js} +1 -1
  125. package/dist/assets/{index-CdR8PFV2.js → index-BoaNY_bf.js} +1 -1
  126. package/dist/assets/{index-Ck3CsOLd.js → index-BsEUG0QP.js} +1 -1
  127. package/dist/assets/{index-BjD_dt7j.js → index-Bsmy5WvR.js} +1 -1
  128. package/dist/assets/{index-CaNU8q02.js → index-Bv4rsi1Q.js} +3 -3
  129. package/dist/assets/{index-fxj2Ya9s.js → index-Bx7FbIQL.js} +1 -1
  130. package/dist/assets/{index-D-6cfpdQ.js → index-C6uM2Rea.js} +1 -1
  131. package/dist/assets/{index-Dd8z6DSj.js → index-CEp9Sokl.js} +1 -1
  132. package/dist/assets/{index-DKJuDgcJ.js → index-CLenm0Oo.js} +1 -1
  133. package/dist/assets/{index-CtWa2yYi.js → index-CMx7Aa_C.js} +1 -1
  134. package/dist/assets/{index-GZSNU0N9.js → index-CNKAU2hd.js} +5 -5
  135. package/dist/assets/{index-DolbUkC_.js → index-CQByYNhZ.js} +1 -1
  136. package/dist/assets/{index-CEdD59-J.js → index-CTxoJE8p.js} +1 -1
  137. package/dist/assets/{index-Eq5AqKg5.js → index-CXJ4c9ty.js} +1 -1
  138. package/dist/assets/{index-Btf_IFYC.js → index-CX_dHZ5K.js} +1 -1
  139. package/dist/assets/{index-DJpzDqQ4.js → index-CZbJIaMU.js} +1 -1
  140. package/dist/assets/{index-BaiEmqCP.js → index-CnNmOPsS.js} +1 -1
  141. package/dist/assets/{index-Dw4DHrde.js → index-Cs_y8rKw.js} +1 -1
  142. package/dist/assets/{index-DeIqVUBN.js → index-CtAFJcCQ.js} +1 -1
  143. package/dist/assets/{index-BP5RfV51.js → index-CxnOTdw3.js} +1 -1
  144. package/dist/assets/{index-CUVDfnmG.js → index-CyXD74zd.js} +1 -1
  145. package/dist/assets/{index-B1G8khkk.js → index-D0IWbTmc.js} +1 -1
  146. package/dist/assets/{index-BeI_IAX0.js → index-D4RMQl1T.js} +2 -2
  147. package/dist/assets/{index-B3Az8tWL.js → index-DAj_cPV6.js} +1 -1
  148. package/dist/assets/{index-B7NNNKnx.js → index-DBPyoENQ.js} +1 -1
  149. package/dist/assets/{index-MCEIpvm0.js → index-DJPtK30Q.js} +1 -1
  150. package/dist/assets/{index-C2wvnUt2.js → index-DNlfwHae.js} +1 -1
  151. package/dist/assets/{index-Dnwh_UKJ.js → index-DNoXj9Ub.js} +1 -1
  152. package/dist/assets/{index-D7h6kSUL.js → index-DX1-ZPM6.js} +1 -1
  153. package/dist/assets/{index-vIRnBdhG.js → index-Dik0zb61.js} +1 -1
  154. package/dist/assets/{index-CXk4y1bt.js → index-DquRJRdr.js} +1 -1
  155. package/dist/assets/{index-CjojA4Ra.js → index-DxoBnN6J.js} +1 -1
  156. package/dist/assets/{index-DigorHCU.js → index-E7vzpNhz.js} +1 -1
  157. package/dist/assets/{index-BrMwzvlw.js → index-Hm1b7vk2.js} +1 -1
  158. package/dist/assets/{index-OifGQVvF.js → index-Uir5BTvN.js} +1 -1
  159. package/dist/assets/{index-bhWRuh9o.js → index-aczexur0.js} +1 -1
  160. package/dist/assets/{index-UEQ4C95J.js → index-aooXG--L.js} +3 -3
  161. package/dist/assets/{index-C9aSwap6.js → index-jbtGsKSC.js} +1 -1
  162. package/dist/assets/{index-Cf8vZqdt.js → index-ljHoqzND.js} +1 -1
  163. package/dist/assets/{index-5Q_ntzEA.js → index-sPHwxi6w.js} +1 -1
  164. package/dist/assets/{index-SK2Q_jIx.js → index-sm-OeZpc.js} +1 -1
  165. package/dist/assets/{index-BlNGp7j6.js → index-uRwikEa2.js} +1 -1
  166. package/dist/assets/{index-DK4RusQa.js → index-xNZmTJSG.js} +1 -1
  167. package/dist/assets/{index.browser.esm-DknHpLjZ.js → index.browser.esm-BJaTvasq.js} +1 -1
  168. package/dist/assets/{index.es-DCL3aYjw.js → index.es-CkYpkM9I.js} +1 -1
  169. package/dist/assets/{info-CfypWIYB.js → info-DGDrOZge.js} +1 -1
  170. package/dist/assets/{info-circle-DWxelnV5.js → info-circle-BkppT2YM.js} +1 -1
  171. package/dist/assets/{isEqual-Djnx406d.js → isEqual-CEli5aE1.js} +1 -1
  172. package/dist/assets/{isPlainObject-C0M2uYU9.js → isPlainObject-o8IjV5He.js} +1 -1
  173. package/dist/assets/{lightbulb-CnEat2Mh.js → lightbulb-B1l7Af1n.js} +1 -1
  174. package/dist/assets/{mail-BcX2d7Ma.js → mail-5Fp-fPBb.js} +1 -1
  175. package/dist/assets/{midjourney-C69CJAOf.js → midjourney-CSVOWCM6.js} +1 -1
  176. package/dist/assets/{mobile-bhvaXp0M.js → mobile-CTaDi3n6.js} +1 -1
  177. package/dist/assets/{more-itNtiPEs.js → more-ByU4eeRm.js} +1 -1
  178. package/dist/assets/{network-placeholder-D4d60HAN.js → network-placeholder-XkUpossk.js} +1 -1
  179. package/dist/assets/{nftPlaceholder-D4dIg165.js → nftPlaceholder-BiN9VXoq.js} +1 -1
  180. package/dist/assets/{off-BoQa4bQQ.js → off-BATmJLtE.js} +1 -1
  181. package/dist/assets/{order-BLDMSc8e.js → order-B7eiHVej.js} +1 -1
  182. package/dist/assets/{pagination-wUSdmOzL.js → pagination-DXTVpMVH.js} +1 -1
  183. package/dist/assets/{play-store-QEHStvxm.js → play-store-HPQUaS7A.js} +1 -1
  184. package/dist/assets/{plus-hzhxvCID.js → plus-C7Pq_Vn_.js} +1 -1
  185. package/dist/assets/{price-CabnHqB_.js → price-DPlr0oEm.js} +1 -1
  186. package/dist/assets/{producer-DTWhlOOc.js → producer-CROtd8iX.js} +1 -1
  187. package/dist/assets/{qr-code-fd3A-so8.js → qr-code-DieoKBZ9.js} +1 -1
  188. package/dist/assets/{recycle-horizontal-BPlQktI5.js → recycle-horizontal-CSangAH5.js} +1 -1
  189. package/dist/assets/{refresh-BBUZq0rj.js → refresh-CLOFgt7U.js} +1 -1
  190. package/dist/assets/{reown-logo-EtMlHxPn.js → reown-logo-DZvBlFJw.js} +1 -1
  191. package/dist/assets/{search-DpoXHlBs.js → search-rVHzHsG1.js} +1 -1
  192. package/dist/assets/{secp256k1-tLAc6PuD.js → secp256k1-CsB_9Jf8.js} +1 -1
  193. package/dist/assets/{secp256k1-BLBVoYYl.js → secp256k1-F-_kvdTS.js} +1 -1
  194. package/dist/assets/{seedream-Co0VK0Ot.js → seedream-Ct7JP75W.js} +1 -1
  195. package/dist/assets/{send-CcIyE-F4.js → send-DJZ5krwP.js} +1 -1
  196. package/dist/assets/{service-BTTv5kGB.js → service-XPSRXLHU.js} +1 -1
  197. package/dist/assets/{solana-wallets-Cr7geZHD.js → solana-wallets-Bj1hUUDc.js} +2 -2
  198. package/dist/assets/{solana-wallets-vue-BB0_ubk2.js → solana-wallets-vue-DxmRMjNJ.js} +1 -1
  199. package/dist/assets/{suno-RzNRcSnE.js → suno-Ur2NAo9K.js} +1 -1
  200. package/dist/assets/{swapHorizontal-Cd2y4G-i.js → swapHorizontal-CM-E5T3B.js} +1 -1
  201. package/dist/assets/{swapHorizontalBold-SVQPX73l.js → swapHorizontalBold-BwodPO73.js} +1 -1
  202. package/dist/assets/{swapHorizontalMedium-BaojsUtd.js → swapHorizontalMedium-CPNhg0ty.js} +1 -1
  203. package/dist/assets/{swapHorizontalRoundedBold-Br4zZFe2.js → swapHorizontalRoundedBold--TPYknKO.js} +1 -1
  204. package/dist/assets/{swapVertical-CiwHgJcc.js → swapVertical-BZGWf4-9.js} +1 -1
  205. package/dist/assets/{telegram-BqJh1ayX.js → telegram-BqLyc-lK.js} +1 -1
  206. package/dist/assets/{three-dots-DCznbj2f.js → three-dots-CMgGQwMI.js} +1 -1
  207. package/dist/assets/{twitch-C-dpEZna.js → twitch-Btd2Krny.js} +1 -1
  208. package/dist/assets/{twitterIcon-BpiWaGTT.js → twitterIcon--X0shC5h.js} +1 -1
  209. package/dist/assets/{typescript-tDSPj8Z9.js → typescript-BuyFDxA9.js} +1 -1
  210. package/dist/assets/{use-form-item-CLq3ss4x.js → use-form-item-aMEij-44.js} +1 -1
  211. package/dist/assets/validator-DrdbAnRf.js +1 -0
  212. package/dist/assets/{verify-CwL2WmQA.js → verify-B2rk8BbH.js} +1 -1
  213. package/dist/assets/{verify-filled-Delosfd0.js → verify-filled-DnyQTE5K.js} +1 -1
  214. package/dist/assets/{w3m-modal-7WkfMU8q.js → w3m-modal-BUXf9Yyo.js} +1 -1
  215. package/dist/assets/{wallet-CGJYue9A.js → wallet-ChJnrL2s.js} +1 -1
  216. package/dist/assets/{wallet-placeholder-Bk8smVwV.js → wallet-placeholder-DA7ZuqYj.js} +1 -1
  217. package/dist/assets/{walletconnect-C3APs1Ej.js → walletconnect-9WZQeTrK.js} +1 -1
  218. package/dist/assets/{warning-circle-Cb1zI58D.js → warning-circle-CWtzIrvy.js} +1 -1
  219. package/dist/assets/{web-wzlpY75j.js → web-DZdDyGoT.js} +1 -1
  220. package/dist/assets/{web-cssymKTe.js → web-hP6xZ7yk.js} +1 -1
  221. package/dist/assets/{x-DIZ3Jpjd.js → x-MWwjdsZL.js} +1 -1
  222. package/dist/index.html +1 -1
  223. package/package.json +1 -1
  224. package/dist/assets/Navigator-DHVStqnV.css +0 -1
  225. package/dist/assets/validator-CmOZ_UpT.js +0 -1
@@ -1 +1 @@
1
- import{F as c}from"./index.es-DCL3aYjw.js";import{I as p,G as m}from"./index-UEQ4C95J.js";import{E as f}from"./index-CRa1r1FF.js";import{d,H as a,E as t,C as o,G as x,L as u,F as g,J as h,D as n,q as i}from"./vendor-vue-NSDaktjZ.js";const _=d({name:"FilePreview",components:{FontAwesomeIcon:c,ElProgress:f},props:{name:{type:String,required:!0},percentage:{type:Number,required:!1,default:void 0},closable:{type:Boolean,required:!1,default:!0}},emits:["remove"],methods:{isImageUrl:p}}),v={class:"file cursor-pointer relative rounded-[10px] h-[50px] w-[250px] flex flex-row items-center justify-start bg-[var(--el-bg-color)]"},w={class:"left h-[50px] w-[50px] flex items-center justify-center"},y={class:"wrapper relative w-[35px] h-[35px] flex items-center justify-center rounded-[10px] text-white bg-[#10a37f] m-auto"},b={class:"right flex-1 h-[50px] flex items-center justify-start pl-[2px] text-[14px] text-[var(--el-text-color-primary)] truncate"},k={class:"text-xs font-bold truncate"},F={key:0,class:"close absolute cursor-pointer top-[5px] right-[5px] bg-[rgba(0,0,0,0.7)] text-white w-[15px] rounded-full h-[15px] flex text-[10px] text-center items-center justify-center"};function $(e,s,j,C,q,B){const r=n("font-awesome-icon"),l=n("el-progress");return i(),a("div",v,[t("div",w,[t("div",y,[o(r,{icon:"fa-regular fa-file-alt"}),x(o(l,{type:"circle","stroke-width":3,percentage:e.percentage,width:25,class:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[25px] h-[25px] z-[10] m-auto"},null,8,["percentage"]),[[u,e.percentage&&e.percentage<100]])])]),t("div",b,[t("span",k,g(e.name),1)]),e.closable?(i(),a("div",F,[o(r,{icon:"fa-solid fa-xmark",class:"icon icon-close",onClick:s[0]||(s[0]=E=>e.$emit("remove"))})])):h("",!0)])}const S=m(_,[["render",$]]);export{S as F};
1
+ import{F as c}from"./index.es-CkYpkM9I.js";import{I as p,G as m}from"./index-aooXG--L.js";import{E as f}from"./index-BZNL_Qx3.js";import{d,H as a,E as t,C as o,G as x,L as u,F as g,J as h,D as n,q as i}from"./vendor-vue-NSDaktjZ.js";const _=d({name:"FilePreview",components:{FontAwesomeIcon:c,ElProgress:f},props:{name:{type:String,required:!0},percentage:{type:Number,required:!1,default:void 0},closable:{type:Boolean,required:!1,default:!0}},emits:["remove"],methods:{isImageUrl:p}}),v={class:"file cursor-pointer relative rounded-[10px] h-[50px] w-[250px] flex flex-row items-center justify-start bg-[var(--el-bg-color)]"},w={class:"left h-[50px] w-[50px] flex items-center justify-center"},y={class:"wrapper relative w-[35px] h-[35px] flex items-center justify-center rounded-[10px] text-white bg-[#10a37f] m-auto"},b={class:"right flex-1 h-[50px] flex items-center justify-start pl-[2px] text-[14px] text-[var(--el-text-color-primary)] truncate"},k={class:"text-xs font-bold truncate"},F={key:0,class:"close absolute cursor-pointer top-[5px] right-[5px] bg-[rgba(0,0,0,0.7)] text-white w-[15px] rounded-full h-[15px] flex text-[10px] text-center items-center justify-center"};function $(e,s,j,C,q,B){const r=n("font-awesome-icon"),l=n("el-progress");return i(),a("div",v,[t("div",w,[t("div",y,[o(r,{icon:"fa-regular fa-file-alt"}),x(o(l,{type:"circle","stroke-width":3,percentage:e.percentage,width:25,class:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[25px] h-[25px] z-[10] m-auto"},null,8,["percentage"]),[[u,e.percentage&&e.percentage<100]])])]),t("div",b,[t("span",k,g(e.name),1)]),e.closable?(i(),a("div",F,[o(r,{icon:"fa-solid fa-xmark",class:"icon icon-close",onClick:s[0]||(s[0]=E=>e.$emit("remove"))})])):h("",!0)])}const S=m(_,[["render",$]]);export{S as F};
@@ -1 +1 @@
1
- import{P as g}from"./Pagination-LPTyBWbU.js";import{C as b}from"./CopyToClipboard-C2THHT8U.js";import{b as w}from"./distribution-Ct_ANw3m.js";import{G as y}from"./index-UEQ4C95J.js";import{g as $}from"./price-CabnHqB_.js";import{E as C}from"./index-OifGQVvF.js";import{E as v,a as D}from"./index-vIRnBdhG.js";import{E,a as H}from"./index-Dd8z6DSj.js";import{d as P,x as c,y as o,C as e,E as a,F as s,G as S,D as r,K as F,q as m}from"./vendor-vue-NSDaktjZ.js";import"./index-D3Nml2aS.js";import"./index-DYODEtlg.js";import"./index-fxj2Ya9s.js";import"./typescript-tDSPj8Z9.js";import"./index-DJpzDqQ4.js";import"./strings-beZM2Y-f.js";import"./isEqual-Djnx406d.js";import"./_Uint8Array-CI8yFZ43.js";import"./castArray-mQ1tkxyC.js";import"./use-form-item-CLq3ss4x.js";import"./index-8otrg1ss.js";import"./index-CtWa2yYi.js";import"./debounce-Dh8RqSlB.js";import"./_baseIteratee-BU-JT24z.js";import"./index-CqcFDQ_G.js";import"./index.es-DCL3aYjw.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Df5ITouH.js";import"./_initCloneObject-DtaxLMaj.js";import"./isPlainObject-C0M2uYU9.js";import"./index-Ck6171A8.js";const k=P({name:"ConsoleDistributionList",components:{Pagination:g,CopyToClipboard:b,ElRow:H,ElCol:E,ElTable:D,ElTableColumn:v,ElCard:C},data(){return{distributionHistories:[],distributionStatus:void 0,loading:!1,total:void 0,limit:10}},computed:{redirect(){return this.$route.query.redirect},page(){return parseInt(this.$route.query.page?.toString()||"1")}},watch:{page:{handler(){this.onFetchData()}}},mounted(){this.onFetchData()},methods:{getPriceString:$,onPageChange(t){this.$router.push({name:this.$route.name?.toString(),query:{page:t}})},onFetchData(){this.loading=!0,Promise.all([this.onFetchDistributionHistory()]).finally(()=>{this.loading=!1})},async onFetchDistributionHistory(){const{data:t}=await w.getAll({user_id:this.$store.getters.user.id,ordering:"-created_at",limit:this.limit,offset:(this.page-1)*this.limit});this.distributionHistories=t.items,this.total=t.count}}}),q={class:"title"},B={class:"key"},I={class:"copy"},T={class:"key"},z={class:"copy"},A={class:"price"},G={class:"description"},N={class:"description"},V={class:"created-at"},j={class:"pagination m-v-lg"};function K(t,L,O,R,J,M){const l=r("el-col"),d=r("el-row"),p=r("copy-to-clipboard"),n=r("el-table-column"),u=r("el-table"),_=r("el-card"),h=r("pagination"),f=F("loading");return m(),c(d,{class:"panel"},{default:o(()=>[e(l,{span:24},{default:o(()=>[e(d,null,{default:o(()=>[e(l,{span:24},{default:o(()=>[a("h2",q,s(t.$t("common.title.distributionHistory")),1)]),_:1})]),_:1}),e(d,null,{default:o(()=>[e(l,{span:24},{default:o(()=>[e(_,{shadow:"hover"},{default:o(()=>[S((m(),c(u,{data:t.distributionHistories,stripe:""},{default:o(()=>[e(n,{prop:"id",label:t.$t("distribution.field.id"),"class-name":"text-center",width:"350px"},{default:o(i=>[a("span",B,s(i.row.id),1),a("span",I,[e(p,{content:i.row.id},null,8,["content"])])]),_:1},8,["label"]),e(n,{prop:"id",label:t.$t("distribution.field.userId"),"class-name":"text-center",width:"350px"},{default:o(i=>[a("span",T,s(i.row.user_id),1),a("span",z,[e(p,{content:i.row.user_id},null,8,["content"])])]),_:1},8,["label"]),e(n,{label:t.$t("distribution.field.price"),width:"100px"},{default:o(i=>[a("span",A,s(t.getPriceString({value:i.row?.price})),1)]),_:1},8,["label"]),e(n,{label:t.$t("distribution.field.reward"),width:"100px"},{default:o(i=>[a("span",G,s(t.getPriceString({value:i.row?.reward})),1)]),_:1},8,["label"]),e(n,{label:t.$t("distribution.field.percentage"),width:"120px"},{default:o(i=>[a("span",N,s(i.row.percentage)+"%",1)]),_:1},8,["label"]),e(n,{label:t.$t("distribution.field.createdAt"),width:"200px"},{default:o(i=>[a("span",V,s(t.$dayjs.format(i.row.created_at)),1)]),_:1},8,["label"])]),_:1},8,["data"])),[[f,t.loading]])]),_:1})]),_:1})]),_:1}),e(d,null,{default:o(()=>[e(l,{span:10,offset:14},{default:o(()=>[a("div",j,[e(h,{"current-page":t.page,"page-size":t.limit,total:t.total,onChange:t.onPageChange},null,8,["current-page","page-size","total","onChange"])])]),_:1})]),_:1})]),_:1})]),_:1})}const Dt=y(k,[["render",K],["__scopeId","data-v-74b9e778"]]);export{Dt as default};
1
+ import{P as g}from"./Pagination-J3-cUToX.js";import{C as b}from"./CopyToClipboard-DvQT_E6_.js";import{b as w}from"./distribution-ChIPkO1D.js";import{G as y}from"./index-aooXG--L.js";import{g as $}from"./price-DPlr0oEm.js";import{E as C}from"./index-Uir5BTvN.js";import{E as v,a as D}from"./index-Dik0zb61.js";import{E,a as H}from"./index-CEp9Sokl.js";import{d as P,x as c,y as o,C as e,E as a,F as s,G as S,D as r,K as F,q as m}from"./vendor-vue-NSDaktjZ.js";import"./index-BB6hDLIE.js";import"./index-Bbp80plT.js";import"./index-Bx7FbIQL.js";import"./typescript-BuyFDxA9.js";import"./index-CZbJIaMU.js";import"./strings-beZM2Y-f.js";import"./isEqual-CEli5aE1.js";import"./_Uint8Array-B-ZN-HZ5.js";import"./castArray-B2ZOzEca.js";import"./use-form-item-aMEij-44.js";import"./index-5nTLszPD.js";import"./index-CMx7Aa_C.js";import"./debounce-DPcjcYAp.js";import"./_baseIteratee-DLk1_nEJ.js";import"./index-1krlZQmJ.js";import"./index.es-CkYpkM9I.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Df5ITouH.js";import"./_initCloneObject-D2_NhBTJ.js";import"./isPlainObject-o8IjV5He.js";import"./index-B2g4JUER.js";const k=P({name:"ConsoleDistributionList",components:{Pagination:g,CopyToClipboard:b,ElRow:H,ElCol:E,ElTable:D,ElTableColumn:v,ElCard:C},data(){return{distributionHistories:[],distributionStatus:void 0,loading:!1,total:void 0,limit:10}},computed:{redirect(){return this.$route.query.redirect},page(){return parseInt(this.$route.query.page?.toString()||"1")}},watch:{page:{handler(){this.onFetchData()}}},mounted(){this.onFetchData()},methods:{getPriceString:$,onPageChange(t){this.$router.push({name:this.$route.name?.toString(),query:{page:t}})},onFetchData(){this.loading=!0,Promise.all([this.onFetchDistributionHistory()]).finally(()=>{this.loading=!1})},async onFetchDistributionHistory(){const{data:t}=await w.getAll({user_id:this.$store.getters.user.id,ordering:"-created_at",limit:this.limit,offset:(this.page-1)*this.limit});this.distributionHistories=t.items,this.total=t.count}}}),q={class:"title"},B={class:"key"},I={class:"copy"},T={class:"key"},z={class:"copy"},A={class:"price"},G={class:"description"},N={class:"description"},V={class:"created-at"},j={class:"pagination m-v-lg"};function K(t,L,O,R,J,M){const l=r("el-col"),d=r("el-row"),p=r("copy-to-clipboard"),n=r("el-table-column"),u=r("el-table"),_=r("el-card"),h=r("pagination"),f=F("loading");return m(),c(d,{class:"panel"},{default:o(()=>[e(l,{span:24},{default:o(()=>[e(d,null,{default:o(()=>[e(l,{span:24},{default:o(()=>[a("h2",q,s(t.$t("common.title.distributionHistory")),1)]),_:1})]),_:1}),e(d,null,{default:o(()=>[e(l,{span:24},{default:o(()=>[e(_,{shadow:"hover"},{default:o(()=>[S((m(),c(u,{data:t.distributionHistories,stripe:""},{default:o(()=>[e(n,{prop:"id",label:t.$t("distribution.field.id"),"class-name":"text-center",width:"350px"},{default:o(i=>[a("span",B,s(i.row.id),1),a("span",I,[e(p,{content:i.row.id},null,8,["content"])])]),_:1},8,["label"]),e(n,{prop:"id",label:t.$t("distribution.field.userId"),"class-name":"text-center",width:"350px"},{default:o(i=>[a("span",T,s(i.row.user_id),1),a("span",z,[e(p,{content:i.row.user_id},null,8,["content"])])]),_:1},8,["label"]),e(n,{label:t.$t("distribution.field.price"),width:"100px"},{default:o(i=>[a("span",A,s(t.getPriceString({value:i.row?.price})),1)]),_:1},8,["label"]),e(n,{label:t.$t("distribution.field.reward"),width:"100px"},{default:o(i=>[a("span",G,s(t.getPriceString({value:i.row?.reward})),1)]),_:1},8,["label"]),e(n,{label:t.$t("distribution.field.percentage"),width:"120px"},{default:o(i=>[a("span",N,s(i.row.percentage)+"%",1)]),_:1},8,["label"]),e(n,{label:t.$t("distribution.field.createdAt"),width:"200px"},{default:o(i=>[a("span",V,s(t.$dayjs.format(i.row.created_at)),1)]),_:1},8,["label"])]),_:1},8,["data"])),[[f,t.loading]])]),_:1})]),_:1})]),_:1}),e(d,null,{default:o(()=>[e(l,{span:10,offset:14},{default:o(()=>[a("div",j,[e(h,{"current-page":t.page,"page-size":t.limit,total:t.total,onChange:t.onPageChange},null,8,["current-page","page-size","total","onChange"])])]),_:1})]),_:1})]),_:1})]),_:1})}const Dt=y(k,[["render",K],["__scopeId","data-v-74b9e778"]]);export{Dt as default};
@@ -1 +1 @@
1
- import{K as A,Q as R,h as B,L as V,O,D as U,E as I,X as P,Y as _,F as D}from"./index-UEQ4C95J.js";import{d as E,w as H,q as v,H as x,R as W,u as y,x as g,y as N,V as T,z as q,Q as $,b as G,c as S,S as X,i as Z,C as h}from"./vendor-vue-NSDaktjZ.js";import{c as L}from"./vendor-dayjs-v0j1UNZp.js";const K=A({size:{type:[Number,String],values:B,default:"",validator:e=>O(e)},shape:{type:String,values:["circle","square"],default:"circle"},icon:{type:R},src:{type:String,default:""},alt:String,srcSet:String,fit:{type:V(String),default:"cover"}}),Q={error:e=>e instanceof Event},Y=E({name:"ElAvatar"}),J=E({...Y,props:K,emits:Q,setup(e,{emit:a}){const s=e,o=I("avatar"),r=G(!1),l=S(()=>{const{size:t,icon:n,shape:c}=s,i=[o.b()];return X(t)&&i.push(o.m(t)),n&&i.push(o.m("icon")),c&&i.push(o.m(c)),i}),f=S(()=>{const{size:t}=s;return O(t)?o.cssVarBlock({size:_(t)||""}):void 0}),d=S(()=>({objectFit:s.fit}));H(()=>s.src,()=>r.value=!1);function k(t){r.value=!0,a("error",t)}return(t,n)=>(v(),x("span",{class:$(y(l)),style:W(y(f))},[(t.src||t.srcSet)&&!r.value?(v(),x("img",{key:0,src:t.src,alt:t.alt,srcset:t.srcSet,style:W(y(d)),onError:k},null,44,["src","alt","srcset"])):t.icon?(v(),g(y(P),{key:1},{default:N(()=>[(v(),g(T(t.icon)))]),_:1})):q(t.$slots,"default",{key:2})],6))}});var ee=U(J,[["__file","avatar.vue"]]);const ue=D(ee);function fe(e){const a=Math.floor(e)%60;e=Math.floor(e/60);const s=e%60,o=s<10?`0${s}`:s,r=a<10?`0${a}`:a;return o+":"+r}var C={exports:{}},te=C.exports,M;function oe(){return M||(M=1,(function(e,a){(function(s,o){o()})(te,function(){function s(t,n){return typeof n>"u"?n={autoBom:!1}:typeof n!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),n={autoBom:!n}),n.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\uFEFF",t],{type:t.type}):t}function o(t,n,c){var i=new XMLHttpRequest;i.open("GET",t),i.responseType="blob",i.onload=function(){k(i.response,n,c)},i.onerror=function(){console.error("could not download file")},i.send()}function r(t){var n=new XMLHttpRequest;n.open("HEAD",t,!1);try{n.send()}catch{}return 200<=n.status&&299>=n.status}function l(t){try{t.dispatchEvent(new MouseEvent("click"))}catch{var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(n)}}var f=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof L=="object"&&L.global===L?L:void 0,d=f.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),k=f.saveAs||(typeof window!="object"||window!==f?function(){}:"download"in HTMLAnchorElement.prototype&&!d?function(t,n,c){var i=f.URL||f.webkitURL,u=document.createElement("a");n=n||t.name||"download",u.download=n,u.rel="noopener",typeof t=="string"?(u.href=t,u.origin===location.origin?l(u):r(u.href)?o(t,n,c):l(u,u.target="_blank")):(u.href=i.createObjectURL(t),setTimeout(function(){i.revokeObjectURL(u.href)},4e4),setTimeout(function(){l(u)},0))}:"msSaveOrOpenBlob"in navigator?function(t,n,c){if(n=n||t.name||"download",typeof t!="string")navigator.msSaveOrOpenBlob(s(t,c),n);else if(r(t))o(t,n,c);else{var i=document.createElement("a");i.href=t,i.target="_blank",setTimeout(function(){l(i)})}}:function(t,n,c,i){if(i=i||open("","_blank"),i&&(i.document.title=i.document.body.innerText="downloading..."),typeof t=="string")return o(t,n,c);var u=t.type==="application/octet-stream",j=/constructor/i.test(f.HTMLElement)||f.safari,w=/CriOS\/[\d]+/.test(navigator.userAgent);if((w||u&&j||d)&&typeof FileReader<"u"){var m=new FileReader;m.onloadend=function(){var p=m.result;p=w?p:p.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=p:location=p,i=null},m.readAsDataURL(t)}else{var z=f.URL||f.webkitURL,F=z.createObjectURL(t);i?i.location=F:location.href=F,i=null,setTimeout(function(){z.revokeObjectURL(F)},4e4)}});f.saveAs=k.saveAs=k,e.exports=k})})(C)),C.exports}var de=oe();const he="/assets/disk-XFRmVAfp.png";var ne={size:"1em",strokeWidth:4,strokeLinecap:"round",strokeLinejoin:"round",rtl:!1,theme:"outline",colors:{outline:{fill:"#333",background:"transparent"},filled:{fill:"#333",background:"#FFF"},twoTone:{fill:"#333",twoTone:"#2F88FF"},multiColor:{outStrokeColor:"#333",outFillColor:"#2F88FF",innerStrokeColor:"#FFF",innerFillColor:"#43CCF8"}},prefix:"i"};function ie(){return"icon-"+((1+Math.random())*4294967296|0).toString(16).substring(1)}function re(e,a,s){var o=typeof a.fill=="string"?[a.fill]:a.fill||[],r=[],l=a.theme||s.theme;switch(l){case"outline":r.push(typeof o[0]=="string"?o[0]:"currentColor"),r.push("none"),r.push(typeof o[0]=="string"?o[0]:"currentColor"),r.push("none");break;case"filled":r.push(typeof o[0]=="string"?o[0]:"currentColor"),r.push(typeof o[0]=="string"?o[0]:"currentColor"),r.push("#FFF"),r.push("#FFF");break;case"two-tone":r.push(typeof o[0]=="string"?o[0]:"currentColor"),r.push(typeof o[1]=="string"?o[1]:s.colors.twoTone.twoTone),r.push(typeof o[0]=="string"?o[0]:"currentColor"),r.push(typeof o[1]=="string"?o[1]:s.colors.twoTone.twoTone);break;case"multi-color":r.push(typeof o[0]=="string"?o[0]:"currentColor"),r.push(typeof o[1]=="string"?o[1]:s.colors.multiColor.outFillColor),r.push(typeof o[2]=="string"?o[2]:s.colors.multiColor.innerStrokeColor),r.push(typeof o[3]=="string"?o[3]:s.colors.multiColor.innerFillColor);break}return{size:a.size||s.size,strokeWidth:a.strokeWidth||s.strokeWidth,strokeLinecap:a.strokeLinecap||s.strokeLinecap,strokeLinejoin:a.strokeLinejoin||s.strokeLinejoin,colors:r,id:e}}var se=Symbol("icon-context");function b(e,a,s){var o={name:"icon-"+e,props:["size","strokeWidth","strokeLinecap","strokeLinejoin","theme","fill","spin"],setup:function(l){var f=ie(),d=Z(se,ne);return function(){var k=l.size,t=l.strokeWidth,n=l.strokeLinecap,c=l.strokeLinejoin,i=l.theme,u=l.fill,j=l.spin,w=re(f,{size:k,strokeWidth:t,strokeLinecap:n,strokeLinejoin:c,theme:i,fill:u},d),m=[d.prefix+"-icon"];return m.push(d.prefix+"-icon-"+e),a&&d.rtl&&m.push(d.prefix+"-icon-rtl"),j&&m.push(d.prefix+"-icon-spin"),h("span",{class:m.join(" ")},[s(w)])}}};return o}const ke=b("pause-one",!1,function(e){return h("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},[h("path",{d:"M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z",fill:e.colors[1],stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linejoin":e.strokeLinejoin},null),h("path",{d:"M19 18V30",stroke:e.colors[2],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null),h("path",{d:"M29 18V30",stroke:e.colors[2],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null)])}),me=b("play",!0,function(e){return h("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},[h("path",{d:"M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z",fill:e.colors[1],stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linejoin":e.strokeLinejoin},null),h("path",{d:"M20 24V17.0718L26 20.5359L32 24L26 27.4641L20 30.9282V24Z",fill:e.colors[3],stroke:e.colors[2],"stroke-width":e.strokeWidth,"stroke-linejoin":e.strokeLinejoin},null)])}),pe=b("volume-small",!0,function(e){return h("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},[h("path",{d:"M24 6V42C17 42 11.7985 32.8391 11.7985 32.8391H6C4.89543 32.8391 4 31.9437 4 30.8391V17.0108C4 15.9062 4.89543 15.0108 6 15.0108H11.7985C11.7985 15.0108 17 6 24 6Z",fill:e.colors[1],stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linejoin":e.strokeLinejoin},null),h("path",{d:"M32 15L32 15C32.6232 15.5565 33.1881 16.1797 33.6841 16.8588C35.1387 18.8504 36 21.3223 36 24C36 26.6545 35.1535 29.1067 33.7218 31.0893C33.2168 31.7885 32.6391 32.4293 32 33",stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null)])}),ve=E({__name:"IconPark",props:{icon:{type:[Object,Function]},theme:{},size:{},spin:{type:Boolean},fill:{},strokeLinecap:{},strokeLinejoin:{},strokeWidth:{}},setup(e){return(a,s)=>(v(),g(T(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"]))}});export{ue as E,de as F,he as O,ke as P,pe as V,ve as _,me as a,fe as u};
1
+ import{K as A,Q as R,h as B,L as V,O,D as U,E as I,X as P,Y as _,F as D}from"./index-aooXG--L.js";import{d as E,w as H,q as v,H as x,R as W,u as y,x as g,y as N,V as T,z as q,Q as $,b as G,c as S,S as X,i as Z,C as h}from"./vendor-vue-NSDaktjZ.js";import{c as L}from"./vendor-dayjs-v0j1UNZp.js";const K=A({size:{type:[Number,String],values:B,default:"",validator:e=>O(e)},shape:{type:String,values:["circle","square"],default:"circle"},icon:{type:R},src:{type:String,default:""},alt:String,srcSet:String,fit:{type:V(String),default:"cover"}}),Q={error:e=>e instanceof Event},Y=E({name:"ElAvatar"}),J=E({...Y,props:K,emits:Q,setup(e,{emit:a}){const s=e,o=I("avatar"),r=G(!1),l=S(()=>{const{size:t,icon:n,shape:c}=s,i=[o.b()];return X(t)&&i.push(o.m(t)),n&&i.push(o.m("icon")),c&&i.push(o.m(c)),i}),f=S(()=>{const{size:t}=s;return O(t)?o.cssVarBlock({size:_(t)||""}):void 0}),d=S(()=>({objectFit:s.fit}));H(()=>s.src,()=>r.value=!1);function k(t){r.value=!0,a("error",t)}return(t,n)=>(v(),x("span",{class:$(y(l)),style:W(y(f))},[(t.src||t.srcSet)&&!r.value?(v(),x("img",{key:0,src:t.src,alt:t.alt,srcset:t.srcSet,style:W(y(d)),onError:k},null,44,["src","alt","srcset"])):t.icon?(v(),g(y(P),{key:1},{default:N(()=>[(v(),g(T(t.icon)))]),_:1})):q(t.$slots,"default",{key:2})],6))}});var ee=U(J,[["__file","avatar.vue"]]);const ue=D(ee);function fe(e){const a=Math.floor(e)%60;e=Math.floor(e/60);const s=e%60,o=s<10?`0${s}`:s,r=a<10?`0${a}`:a;return o+":"+r}var C={exports:{}},te=C.exports,M;function oe(){return M||(M=1,(function(e,a){(function(s,o){o()})(te,function(){function s(t,n){return typeof n>"u"?n={autoBom:!1}:typeof n!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),n={autoBom:!n}),n.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\uFEFF",t],{type:t.type}):t}function o(t,n,c){var i=new XMLHttpRequest;i.open("GET",t),i.responseType="blob",i.onload=function(){k(i.response,n,c)},i.onerror=function(){console.error("could not download file")},i.send()}function r(t){var n=new XMLHttpRequest;n.open("HEAD",t,!1);try{n.send()}catch{}return 200<=n.status&&299>=n.status}function l(t){try{t.dispatchEvent(new MouseEvent("click"))}catch{var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(n)}}var f=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof L=="object"&&L.global===L?L:void 0,d=f.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),k=f.saveAs||(typeof window!="object"||window!==f?function(){}:"download"in HTMLAnchorElement.prototype&&!d?function(t,n,c){var i=f.URL||f.webkitURL,u=document.createElement("a");n=n||t.name||"download",u.download=n,u.rel="noopener",typeof t=="string"?(u.href=t,u.origin===location.origin?l(u):r(u.href)?o(t,n,c):l(u,u.target="_blank")):(u.href=i.createObjectURL(t),setTimeout(function(){i.revokeObjectURL(u.href)},4e4),setTimeout(function(){l(u)},0))}:"msSaveOrOpenBlob"in navigator?function(t,n,c){if(n=n||t.name||"download",typeof t!="string")navigator.msSaveOrOpenBlob(s(t,c),n);else if(r(t))o(t,n,c);else{var i=document.createElement("a");i.href=t,i.target="_blank",setTimeout(function(){l(i)})}}:function(t,n,c,i){if(i=i||open("","_blank"),i&&(i.document.title=i.document.body.innerText="downloading..."),typeof t=="string")return o(t,n,c);var u=t.type==="application/octet-stream",j=/constructor/i.test(f.HTMLElement)||f.safari,w=/CriOS\/[\d]+/.test(navigator.userAgent);if((w||u&&j||d)&&typeof FileReader<"u"){var m=new FileReader;m.onloadend=function(){var p=m.result;p=w?p:p.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=p:location=p,i=null},m.readAsDataURL(t)}else{var z=f.URL||f.webkitURL,F=z.createObjectURL(t);i?i.location=F:location.href=F,i=null,setTimeout(function(){z.revokeObjectURL(F)},4e4)}});f.saveAs=k.saveAs=k,e.exports=k})})(C)),C.exports}var de=oe();const he="/assets/disk-XFRmVAfp.png";var ne={size:"1em",strokeWidth:4,strokeLinecap:"round",strokeLinejoin:"round",rtl:!1,theme:"outline",colors:{outline:{fill:"#333",background:"transparent"},filled:{fill:"#333",background:"#FFF"},twoTone:{fill:"#333",twoTone:"#2F88FF"},multiColor:{outStrokeColor:"#333",outFillColor:"#2F88FF",innerStrokeColor:"#FFF",innerFillColor:"#43CCF8"}},prefix:"i"};function ie(){return"icon-"+((1+Math.random())*4294967296|0).toString(16).substring(1)}function re(e,a,s){var o=typeof a.fill=="string"?[a.fill]:a.fill||[],r=[],l=a.theme||s.theme;switch(l){case"outline":r.push(typeof o[0]=="string"?o[0]:"currentColor"),r.push("none"),r.push(typeof o[0]=="string"?o[0]:"currentColor"),r.push("none");break;case"filled":r.push(typeof o[0]=="string"?o[0]:"currentColor"),r.push(typeof o[0]=="string"?o[0]:"currentColor"),r.push("#FFF"),r.push("#FFF");break;case"two-tone":r.push(typeof o[0]=="string"?o[0]:"currentColor"),r.push(typeof o[1]=="string"?o[1]:s.colors.twoTone.twoTone),r.push(typeof o[0]=="string"?o[0]:"currentColor"),r.push(typeof o[1]=="string"?o[1]:s.colors.twoTone.twoTone);break;case"multi-color":r.push(typeof o[0]=="string"?o[0]:"currentColor"),r.push(typeof o[1]=="string"?o[1]:s.colors.multiColor.outFillColor),r.push(typeof o[2]=="string"?o[2]:s.colors.multiColor.innerStrokeColor),r.push(typeof o[3]=="string"?o[3]:s.colors.multiColor.innerFillColor);break}return{size:a.size||s.size,strokeWidth:a.strokeWidth||s.strokeWidth,strokeLinecap:a.strokeLinecap||s.strokeLinecap,strokeLinejoin:a.strokeLinejoin||s.strokeLinejoin,colors:r,id:e}}var se=Symbol("icon-context");function b(e,a,s){var o={name:"icon-"+e,props:["size","strokeWidth","strokeLinecap","strokeLinejoin","theme","fill","spin"],setup:function(l){var f=ie(),d=Z(se,ne);return function(){var k=l.size,t=l.strokeWidth,n=l.strokeLinecap,c=l.strokeLinejoin,i=l.theme,u=l.fill,j=l.spin,w=re(f,{size:k,strokeWidth:t,strokeLinecap:n,strokeLinejoin:c,theme:i,fill:u},d),m=[d.prefix+"-icon"];return m.push(d.prefix+"-icon-"+e),a&&d.rtl&&m.push(d.prefix+"-icon-rtl"),j&&m.push(d.prefix+"-icon-spin"),h("span",{class:m.join(" ")},[s(w)])}}};return o}const ke=b("pause-one",!1,function(e){return h("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},[h("path",{d:"M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z",fill:e.colors[1],stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linejoin":e.strokeLinejoin},null),h("path",{d:"M19 18V30",stroke:e.colors[2],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null),h("path",{d:"M29 18V30",stroke:e.colors[2],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null)])}),me=b("play",!0,function(e){return h("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},[h("path",{d:"M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z",fill:e.colors[1],stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linejoin":e.strokeLinejoin},null),h("path",{d:"M20 24V17.0718L26 20.5359L32 24L26 27.4641L20 30.9282V24Z",fill:e.colors[3],stroke:e.colors[2],"stroke-width":e.strokeWidth,"stroke-linejoin":e.strokeLinejoin},null)])}),pe=b("volume-small",!0,function(e){return h("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},[h("path",{d:"M24 6V42C17 42 11.7985 32.8391 11.7985 32.8391H6C4.89543 32.8391 4 31.9437 4 30.8391V17.0108C4 15.9062 4.89543 15.0108 6 15.0108H11.7985C11.7985 15.0108 17 6 24 6Z",fill:e.colors[1],stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linejoin":e.strokeLinejoin},null),h("path",{d:"M32 15L32 15C32.6232 15.5565 33.1881 16.1797 33.6841 16.8588C35.1387 18.8504 36 21.3223 36 24C36 26.6545 35.1535 29.1067 33.7218 31.0893C33.2168 31.7885 32.6391 32.4293 32 33",stroke:e.colors[0],"stroke-width":e.strokeWidth,"stroke-linecap":e.strokeLinecap,"stroke-linejoin":e.strokeLinejoin},null)])}),ve=E({__name:"IconPark",props:{icon:{type:[Object,Function]},theme:{},size:{},spin:{type:Boolean},fill:{},strokeLinecap:{},strokeLinejoin:{},strokeWidth:{}},setup(e){return(a,s)=>(v(),g(T(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"]))}});export{ue as E,de as F,he as O,ke as P,pe as V,ve as _,me as a,fe as u};
@@ -1 +1 @@
1
- import{F as m}from"./index.es-DCL3aYjw.js";import{E as d}from"./index-CRa1r1FF.js";import{d as u,H as r,E as t,G as s,L as a,C as n,M as f,J as g,D as l,q as i}from"./vendor-vue-NSDaktjZ.js";import{G as v}from"./index-UEQ4C95J.js";const h=u({name:"ImagePreview",components:{FontAwesomeIcon:m,ElProgress:d},props:{url:{type:String,required:!0},name:{type:String,required:!0},percentage:{type:Number,required:!1,default:void 0},closable:{type:Boolean,required:!1,default:!0}},emits:["remove"]}),b={class:"image w-[50px] h-[50px] relative rounded-[var(--el-border-radius-base)] overflow-hidden shadow-sm bg-[var(--el-fill-color-lighter)]"},w=["src","alt"],x={class:"overlay absolute inset-0 bg-[var(--el-mask-color)] backdrop-blur-[1px]"},_={key:0,class:"close absolute cursor-pointer top-[4px] right-[4px] bg-[rgba(0,0,0,0.65)] text-white w-[16px] h-[16px] rounded-full flex text-[10px] text-center items-center justify-center hover:bg-[rgba(0,0,0,0.8)]"};function y(e,o,k,$,q,C){const c=l("el-progress"),p=l("font-awesome-icon");return i(),r("div",b,[t("img",{class:"w-full h-full object-cover",src:e.url,alt:e.name},null,8,w),s(t("div",x,null,512),[[a,e.percentage&&e.percentage<100]]),s(n(c,{type:"circle","stroke-width":4,percentage:e.percentage,width:34,class:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[34px] h-[34px] z-[10] m-auto text-[12px]"},null,8,["percentage"]),[[a,e.percentage&&e.percentage<100]]),e.closable?(i(),r("div",_,[n(p,{icon:"fa-solid fa-xmark",class:"icon icon-close",onClick:o[0]||(o[0]=f(B=>e.$emit("remove"),["stop"]))})])):g("",!0)])}const S=v(h,[["render",y]]);export{S as I};
1
+ import{F as m}from"./index.es-CkYpkM9I.js";import{E as d}from"./index-BZNL_Qx3.js";import{d as u,H as r,E as t,G as s,L as a,C as n,M as f,J as g,D as l,q as i}from"./vendor-vue-NSDaktjZ.js";import{G as v}from"./index-aooXG--L.js";const h=u({name:"ImagePreview",components:{FontAwesomeIcon:m,ElProgress:d},props:{url:{type:String,required:!0},name:{type:String,required:!0},percentage:{type:Number,required:!1,default:void 0},closable:{type:Boolean,required:!1,default:!0}},emits:["remove"]}),b={class:"image w-[50px] h-[50px] relative rounded-[var(--el-border-radius-base)] overflow-hidden shadow-sm bg-[var(--el-fill-color-lighter)]"},w=["src","alt"],x={class:"overlay absolute inset-0 bg-[var(--el-mask-color)] backdrop-blur-[1px]"},_={key:0,class:"close absolute cursor-pointer top-[4px] right-[4px] bg-[rgba(0,0,0,0.65)] text-white w-[16px] h-[16px] rounded-full flex text-[10px] text-center items-center justify-center hover:bg-[rgba(0,0,0,0.8)]"};function y(e,o,k,$,q,C){const c=l("el-progress"),p=l("font-awesome-icon");return i(),r("div",b,[t("img",{class:"w-full h-full object-cover",src:e.url,alt:e.name},null,8,w),s(t("div",x,null,512),[[a,e.percentage&&e.percentage<100]]),s(n(c,{type:"circle","stroke-width":4,percentage:e.percentage,width:34,class:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[34px] h-[34px] z-[10] m-auto text-[12px]"},null,8,["percentage"]),[[a,e.percentage&&e.percentage<100]]),e.closable?(i(),r("div",_,[n(p,{icon:"fa-solid fa-xmark",class:"icon icon-close",onClick:o[0]||(o[0]=f(B=>e.$emit("remove"),["stop"]))})])):g("",!0)])}const S=v(h,[["render",y]]);export{S as I};
@@ -1 +1 @@
1
- import{E as i}from"./index-CXk4y1bt.js";import{d as m,H as a,J as p,x as l,y as d,I as u,F as f,D as g,q as s}from"./vendor-vue-NSDaktjZ.js";import{G as y}from"./index-UEQ4C95J.js";const w=m({name:"ImageWrapper",components:{ElButton:i},props:{src:{type:String,required:!0},rawSrc:{type:String,required:!1,default:void 0}},methods:{onOpenUrl(e){window.open(e,"_blank")},onReload(e){const r=e.target,t=new URL(r.src),o=t.searchParams.get("retry");if(!o)t.searchParams.set("retry","1");else if(parseInt(o)<2)t.searchParams.set("retry",(parseInt(o)+1).toString());else return;r.src=t.toString()}}}),I={class:"image-wrapper"},S=["src"];function _(e,r,t,o,k,$){const c=g("el-button");return s(),a("div",I,[e.src?(s(),a("img",{key:0,src:e.src,class:"image",onError:r[0]||(r[0]=n=>e.onReload(n))},null,40,S)):p("",!0),e.rawSrc?(s(),l(c,{key:1,type:"info",round:"",class:"btn-raw",onClick:r[1]||(r[1]=n=>e.onOpenUrl(e.rawSrc))},{default:d(()=>[u(f(e.$t("common.button.seeRawImage")),1)]),_:1})):p("",!0)])}const h=y(w,[["render",_],["__scopeId","data-v-4deff0d6"]]);export{h as I};
1
+ import{E as i}from"./index-DquRJRdr.js";import{d as m,H as a,J as p,x as l,y as d,I as u,F as f,D as g,q as s}from"./vendor-vue-NSDaktjZ.js";import{G as y}from"./index-aooXG--L.js";const w=m({name:"ImageWrapper",components:{ElButton:i},props:{src:{type:String,required:!0},rawSrc:{type:String,required:!1,default:void 0}},methods:{onOpenUrl(e){window.open(e,"_blank")},onReload(e){const r=e.target,t=new URL(r.src),o=t.searchParams.get("retry");if(!o)t.searchParams.set("retry","1");else if(parseInt(o)<2)t.searchParams.set("retry",(parseInt(o)+1).toString());else return;r.src=t.toString()}}}),I={class:"image-wrapper"},S=["src"];function _(e,r,t,o,k,$){const c=g("el-button");return s(),a("div",I,[e.src?(s(),a("img",{key:0,src:e.src,class:"image",onError:r[0]||(r[0]=n=>e.onReload(n))},null,40,S)):p("",!0),e.rawSrc?(s(),l(c,{key:1,type:"info",round:"",class:"btn-raw",onClick:r[1]||(r[1]=n=>e.onOpenUrl(e.rawSrc))},{default:d(()=>[u(f(e.$t("common.button.seeRawImage")),1)]),_:1})):p("",!0)])}const h=y(w,[["render",_],["__scopeId","data-v-4deff0d6"]]);export{h as I};
@@ -1,4 +1,4 @@
1
- import{F as j}from"./index.es-DCL3aYjw.js";import{E as G}from"./index-CXk4y1bt.js";import{E as Se}from"./index-C2-gUTzR.js";import{d as A,H as u,E as s,z as se,C as o,y as i,D as l,q as n,F as a,O as M,N as z,J as c,x as y,Q as K,I as v,U as ne,G as B,K as q,M as U,u as D,c as N,w as Le,L as Me}from"./vendor-vue-NSDaktjZ.js";import{G as E,bk as le,bj as Fe,dC as re,dD as de,X as x,J as Te,S as X,cp as Ae,dE as ee,dF as ze,co as je,n as De}from"./index-UEQ4C95J.js";import{a as Ge}from"./errorCode-Cqj9Td_Z.js";import{s as L}from"./suno-RzNRcSnE.js";import{b as Be}from"./suno-DFuCGH70.js";import{E as Oe}from"./index-C46TTxpf.js";import{E as ue,a as ce}from"./index-D3Nml2aS.js";import{I as F,S as Ne,l as qe}from"./pagination-wUSdmOzL.js";import{E as te,a as Q,b as He}from"./index-BjD_dt7j.js";import{E as me,a as pe}from"./index-Dw4DHrde.js";import{E as We}from"./index-DKJuDgcJ.js";import{E as w}from"./index-B73VNuAm.js";import{E as H}from"./index-8otrg1ss.js";import{E as fe}from"./index-DYODEtlg.js";import{E as he}from"./index-Cf8vZqdt.js";import{u as Z,F as ve,O as Ke,_ as ye,P as Je,a as Qe,V as Ye,E as Xe}from"./IconPark.vue_vue_type_script_setup_true_lang-DHCP0oBC.js";import{E as oe}from"./index-CUVDfnmG.js";import{E as O}from"./index-B3Az8tWL.js";import{E as ge}from"./index-sMArUCsN.js";import{E as Ze,a as xe}from"./index-BaiEmqCP.js";import{E as et,a as tt}from"./index-Ck3CsOLd.js";import{C as ot}from"./Consumption-DVBEzfCm.js";import{a as st}from"./price-CabnHqB_.js";import{E as nt}from"./index-Ck6171A8.js";import{E as it}from"./index-CRa1r1FF.js";import{E as Pe,b as Ue,a as Ee}from"./index-C9aSwap6.js";import{E as Ie}from"./index-DeIqVUBN.js";import{N as at}from"./NoTasks-COJAQuGK.js";import{a as lt,E as rt}from"./index-Btf_IFYC.js";import"./use-form-item-CLq3ss4x.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Df5ITouH.js";import"./validator-CmOZ_UpT.js";import"./index-fxj2Ya9s.js";import"./index-DJpzDqQ4.js";import"./typescript-tDSPj8Z9.js";import"./strings-beZM2Y-f.js";import"./isEqual-Djnx406d.js";import"./_Uint8Array-CI8yFZ43.js";import"./castArray-mQ1tkxyC.js";import"./debounce-Dh8RqSlB.js";import"./_baseIteratee-BU-JT24z.js";import"./index-CqcFDQ_G.js";import"./_baseClone-I702BQXP.js";import"./_initCloneObject-DtaxLMaj.js";import"./isPlainObject-C0M2uYU9.js";import"./index-CtWa2yYi.js";import"./index-Cu41y2Fl.js";import"./index-Eq5AqKg5.js";import"./dropdown-DR031DEl.js";const dt=A({name:"LayoutSuno",components:{ElDrawer:Se,ElButton:G,FontAwesomeIcon:j},data(){return{drawer:!1,preview:!1}},computed:{}}),ut={class:"main flex flex-row flex-1"},ct={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},mt={class:"result h-full flex flex-col flex-1 min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"},pt={class:"preview h-full w-[300px] flex flex-col"};function ft(e,t,d,r,p,b){const g=l("font-awesome-icon"),m=l("el-button"),f=l("el-drawer");return n(),u("div",ut,[s("div",ct,[se(e.$slots,"config",{},void 0,!0)]),s("div",mt,[se(e.$slots,"result",{},void 0,!0)]),s("div",pt,[se(e.$slots,"preview",{},void 0,!0)]),o(m,{circle:"",class:"menu",onClick:t[0]||(t[0]=$=>e.drawer=!0)},{default:i(()=>[o(g,{icon:"fa-solid fa-magic"})]),_:1}),o(f,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=$=>e.drawer=$),direction:"ltr","with-header":!1,size:"340px",class:"drawer"},{default:i(()=>[se(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const ht=E(dt,[["render",ft],["__scopeId","data-v-96d59120"]]),gt=A({name:"TypeSelector",components:{ElSelect:ce,ElOption:ue,ElSwitch:Oe},data(){return{options:[{label:"v5.5",value:"chirp-v5-5",desc:this.$t("suno.model.v55desc")},{label:"v5",value:"chirp-v5",desc:this.$t("suno.model.v5desc")},{label:"v4.5+",value:"chirp-v4-5-plus",desc:this.$t("suno.model.v45plusdesc")},{label:"v4.5",value:"chirp-v4-5",desc:this.$t("suno.model.v45desc"),dividerAfter:!0},{label:"v4",value:"chirp-v4",desc:this.$t("suno.model.v4desc")},{label:"v3.5",value:"chirp-v3-5",desc:this.$t("suno.model.v35desc")},{label:"v3",value:"chirp-v3-0",desc:this.$t("suno.model.v3desc")}]}},computed:{custom:{get(){return this.$store.state.suno?.config?.custom||!1},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,custom:e})}},instrumental:{get(){return this.$store.state.suno?.config?.instrumental||!1},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,instrumental:e})}},model:{get(){return this.$store.state.suno?.config?.model},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:e})}}},mounted(){this.model||(this.model=Be)}}),$t={class:"mb-3"},_t={class:"flex items-center mb-1"},vt={class:"text-sm font-bold"},yt={class:"model-option"},bt={class:"model-option-left"},kt={class:"model-option-name"},wt={class:"model-option-desc"},Ct={key:0,class:"flex items-center justify-between mb-3"},Vt={class:"text-sm font-bold"};function St(e,t,d,r,p,b){const g=l("el-option"),m=l("el-select"),f=l("el-switch");return n(),u("div",null,[s("div",$t,[s("div",_t,[s("span",vt,a(e.$t("suno.name.model")),1)]),o(m,{modelValue:e.model,"onUpdate:modelValue":t[0]||(t[0]=$=>e.model=$),class:"w-full model-select",size:"default",placeholder:e.$t("suno.placeholder.select")},{default:i(()=>[(n(!0),u(M,null,z(e.options,$=>(n(),y(g,{key:$.value,label:$.label,value:$.value,class:K({"model-option-divider":$.dividerAfter})},{default:i(()=>[s("div",yt,[s("div",bt,[s("span",kt,a($.label),1)]),s("span",wt,a($.desc),1)])]),_:2},1032,["label","value","class"]))),128))]),_:1},8,["modelValue","placeholder"])]),e.custom?(n(),u("div",Ct,[s("span",Vt,a(e.$t("suno.name.instrumental")),1),o(f,{modelValue:e.instrumental,"onUpdate:modelValue":t[1]||(t[1]=$=>e.instrumental=$)},null,8,["modelValue"])])):c("",!0)])}const Tt=E(gt,[["render",St],["__scopeId","data-v-16e4d6fc"]]),At=A({name:"UploadAudio",components:{ElUpload:We,ElButton:G,ElDialog:le,ElTabs:pe,ElTabPane:me,InfoIcon:F,FontAwesomeIcon:j,ElRadioGroup:Q,ElRadioButton:te},emits:["change"],data(){return{fileList:[],uploadUrl:Fe()+"/api/v1/files/",dialogVisible:!1,activeTab:"browse",recording:!1,recordedBlob:null,recordedAudioUrl:null,audioPreviewUrl:null,recordTimer:null,recordSeconds:0,mediaRecorder:null,mediaStream:null,recordedChunks:[],uploadingRecord:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},credential(){return this.$store.state.suno.credential},config(){return this.$store.state.suno.config},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.suno?.config?.audio_id},set(){}},hasUploadedAudio(){const e=this.$store.state.suno?.config?.action;return e==="upload_extend"||e==="upload_cover"},uploadAction:{get(){return this.$store.state.suno?.config?.action||"upload_extend"},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,action:e})}},formattedTime(){const e=Math.floor(this.recordSeconds/60).toString().padStart(2,"0"),t=(this.recordSeconds%60).toString().padStart(2,"0");return`${e}:${t}`}},watch:{urls:{handler(e){this.$emit("change",e)}}},beforeUnmount(){this.cleanupRecording()},methods:{onExceed(){w.warning(this.$t("suno.message.uploadReferencesExceed"))},onError(){w.error(this.$t("suno.message.uploadReferencesError"))},async onBrowseSuccess(){const e=this.urls?.[0];e&&(this.audioPreviewUrl=e,await this.onGenerateAudioId(e),this.dialogVisible=!1)},async onGenerateAudioId(e){const t={audio_url:e},d=this.credential?.token;if(!d){console.error("no token specified");return}w.info(this.$t("suno.message.startingUploadAudio"));try{const r=await L.upload(t,{token:d});console.debug("get upload music success",r.data);const p=r.data?.data.audio_id;this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,audio_id:p,action:"upload_extend"}),w.success(this.$t("suno.message.startUploadAudioSuccess"))}catch(r){w.error(r?.response?.data?.error?.message||this.$t("suno.message.startUploadAudioFailed"))}},async startRecording(){if(!navigator.mediaDevices?.getUserMedia||typeof MediaRecorder>"u"){w.error(this.$t("suno.message.recordingUnsupported"));return}try{this.mediaStream=await navigator.mediaDevices.getUserMedia({audio:!0}),this.recordedChunks=[],this.mediaRecorder=new MediaRecorder(this.mediaStream),this.mediaRecorder.ondataavailable=e=>{e.data&&e.data.size>0&&this.recordedChunks.push(e.data)},this.mediaRecorder.onstop=()=>{const e=new Blob(this.recordedChunks,{type:"audio/webm"});this.recordedBlob=e,this.recordedAudioUrl&&URL.revokeObjectURL(this.recordedAudioUrl),this.recordedAudioUrl=URL.createObjectURL(e),this.releaseStream()},this.mediaRecorder.start(),this.recording=!0,this.recordSeconds=0,this.recordTimer=window.setInterval(()=>{this.recordSeconds+=1,this.recordSeconds>=600&&this.stopRecording()},1e3)}catch(e){console.error("record error",e),w.error(this.$t("suno.message.recordingPermissionDenied"))}},stopRecording(){this.recordTimer&&(window.clearInterval(this.recordTimer),this.recordTimer=null),this.mediaRecorder&&this.mediaRecorder.state!=="inactive"&&this.mediaRecorder.stop(),this.recording=!1},resetRecording(){this.recordedAudioUrl&&URL.revokeObjectURL(this.recordedAudioUrl),this.recordedBlob=null,this.recordedAudioUrl=null,this.recordSeconds=0},async uploadRecording(){if(this.recordedBlob){this.uploadingRecord=!0;try{const e=new FormData,t=`recording-${Date.now()}.webm`;e.append("file",this.recordedBlob,t);const d=await fetch(this.uploadUrl,{method:"POST",headers:{Authorization:`Bearer ${this.$store.state.token.access}`},body:e});if(!d.ok)throw new Error(`upload failed: ${d.status}`);const r=await d.json(),p=r?.file_url||r?.data?.file_url;if(!p)throw new Error("no file_url in response");this.audioPreviewUrl=p,await this.onGenerateAudioId(p),this.dialogVisible=!1,this.resetRecording()}catch(e){console.error(e),w.error(e?.message||this.$t("suno.message.uploadReferencesError"))}finally{this.uploadingRecord=!1}}},releaseStream(){this.mediaStream&&(this.mediaStream.getTracks().forEach(e=>e.stop()),this.mediaStream=null)},cleanupRecording(){this.recordTimer&&(window.clearInterval(this.recordTimer),this.recordTimer=null),this.releaseStream(),this.recordedAudioUrl&&(URL.revokeObjectURL(this.recordedAudioUrl),this.recordedAudioUrl=null)}}}),Pt={class:"relative"},Ut={class:"flex justify-between items-center mb-2"},Et={class:"flex justify-start items-center"},It={class:"text-sm font-bold"},Rt={key:0,class:"mb-2"},Lt=["src"],Mt={key:1,class:"mt-2"},Ft={class:"py-4"},zt={class:"text-center py-6"},jt={class:"text-sm"},Dt={class:"text-xs text-gray-400 mt-1"},Gt={class:"py-4 text-center"},Bt={class:"recorder-display mb-4"},Ot={key:0,class:"text-red-500 flex items-center justify-center gap-2"},Nt={class:"text-2xl font-mono"},qt={key:1,class:"text-green-600"},Ht={key:2,class:"text-gray-400 text-2xl font-mono"},Wt={key:0,class:"mb-4"},Kt=["src"],Jt={class:"flex justify-center gap-3"};function Qt(e,t,d,r,p,b){const g=l("info-icon"),m=l("font-awesome-icon"),f=l("el-button"),$=l("el-radio-button"),k=l("el-radio-group"),T=l("el-upload"),_=l("el-tab-pane"),V=l("el-tabs"),C=l("el-dialog");return n(),u("div",Pt,[s("div",Ut,[s("div",Et,[s("span",It,a(e.$t("suno.name.referenceAudios")),1),o(g,{content:e.$t("suno.description.uploadAudios")},null,8,["content"])]),o(f,{round:"",type:"primary",size:"small",onClick:t[0]||(t[0]=I=>e.dialogVisible=!0)},{default:i(()=>[o(m,{icon:"fa-solid fa-plus",class:"icon mr-1"}),v(" "+a(e.$t("suno.button.addAudio")),1)]),_:1})]),e.audioPreviewUrl?(n(),u("div",Rt,[s("audio",{src:e.audioPreviewUrl,controls:"",class:"w-full"},null,8,Lt)])):c("",!0),e.hasUploadedAudio?(n(),u("div",Mt,[o(k,{modelValue:e.uploadAction,"onUpdate:modelValue":t[1]||(t[1]=I=>e.uploadAction=I),size:"small"},{default:i(()=>[o($,{value:"upload_extend"},{default:i(()=>[v(a(e.$t("suno.button.extend")),1)]),_:1}),o($,{value:"upload_cover"},{default:i(()=>[v(a(e.$t("suno.button.upload_cover")),1)]),_:1})]),_:1},8,["modelValue"])])):c("",!0),o(C,{modelValue:e.dialogVisible,"onUpdate:modelValue":t[4]||(t[4]=I=>e.dialogVisible=I),title:e.$t("suno.name.addAudio"),width:"520px","close-on-click-modal":!1,"append-to-body":""},{default:i(()=>[o(V,{modelValue:e.activeTab,"onUpdate:modelValue":t[3]||(t[3]=I=>e.activeTab=I),class:"add-audio-tabs"},{default:i(()=>[o(_,{name:"browse",label:e.$t("suno.tab.browse")},{default:i(()=>[s("div",Ft,[o(T,{"file-list":e.fileList,"onUpdate:fileList":t[2]||(t[2]=I=>e.fileList=I),name:"file",limit:1,class:"upload-wrapper",action:e.uploadUrl,accept:".mp3,.wav,.m4a,audio/*","show-file-list":!0,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onBrowseSuccess,headers:e.headers,drag:""},{default:i(()=>[s("div",zt,[o(m,{icon:"fa-solid fa-upload",class:"text-4xl text-gray-400 mb-3"}),s("div",jt,a(e.$t("suno.description.dropAudioHere")),1),s("div",Dt,a(e.$t("suno.description.audioFormats")),1)])]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])]),_:1},8,["label"]),o(_,{name:"record",label:e.$t("suno.tab.record")},{default:i(()=>[s("div",Gt,[s("div",Bt,[e.recording?(n(),u("div",Ot,[t[5]||(t[5]=s("span",{class:"recording-dot"},null,-1)),s("span",Nt,a(e.formattedTime),1)])):e.recordedBlob?(n(),u("div",qt,[o(m,{icon:"fa-solid fa-check-circle",class:"text-2xl mr-2"}),s("span",null,a(e.$t("suno.message.recordingReady"))+" ("+a(e.formattedTime)+")",1)])):(n(),u("div",Ht,"00:00"))]),e.recordedAudioUrl&&!e.recording?(n(),u("div",Wt,[s("audio",{src:e.recordedAudioUrl,controls:"",class:"w-full"},null,8,Kt)])):c("",!0),s("div",Jt,[!e.recording&&!e.recordedBlob?(n(),y(f,{key:0,type:"primary",round:"",onClick:e.startRecording},{default:i(()=>[o(m,{icon:"fa-solid fa-microphone",class:"mr-1"}),v(" "+a(e.$t("suno.button.startRecord")),1)]),_:1},8,["onClick"])):c("",!0),e.recording?(n(),y(f,{key:1,type:"danger",round:"",onClick:e.stopRecording},{default:i(()=>[o(m,{icon:"fa-solid fa-stop",class:"mr-1"}),v(" "+a(e.$t("suno.button.stopRecord")),1)]),_:1},8,["onClick"])):c("",!0),e.recordedBlob&&!e.recording?(n(),u(M,{key:2},[o(f,{round:"",onClick:e.resetRecording},{default:i(()=>[o(m,{icon:"fa-solid fa-rotate-left",class:"mr-1"}),v(" "+a(e.$t("suno.button.reRecord")),1)]),_:1},8,["onClick"]),o(f,{type:"primary",round:"",loading:e.uploadingRecord,onClick:e.uploadRecording},{default:i(()=>[o(m,{icon:"fa-solid fa-upload",class:"mr-1"}),v(" "+a(e.$t("suno.button.useRecording")),1)]),_:1},8,["loading","onClick"])],64)):c("",!0)])])]),_:1},8,["label"])]),_:1},8,["modelValue"])]),_:1},8,["modelValue","title"])])}const Yt=E(At,[["render",Qt],["__scopeId","data-v-bfb6b53d"]]),Xt="",be=[{key:"lofi",label:"🎧 Lo-fi Chill",prompt:"a relaxing lo-fi hip hop beat for studying"},{key:"pop-love",label:"💕 Pop Love Song",prompt:"a catchy pop love song with sweet melodies"},{key:"rock-anthem",label:"🎸 Rock Anthem",prompt:"an energetic rock anthem with electric guitars"},{key:"jazz-night",label:"🎷 Jazz Night",prompt:"a smooth late-night jazz piece with saxophone"},{key:"edm-drop",label:"⚡ EDM Drop",prompt:"an intense EDM track with a massive drop"},{key:"folk-story",label:"🪕 Folk Story",prompt:"a warm folk song telling a story about traveling"},{key:"rnb-groove",label:"🎤 R&B Groove",prompt:"a smooth R&B groove with soulful vocals"},{key:"classical",label:"🎻 Classical",prompt:"an elegant classical piece for orchestra"},{key:"hip-hop",label:"🎤 Hip Hop",prompt:"a hard-hitting hip hop beat with bass"},{key:"country",label:"🤠 Country",prompt:"an upbeat country song with acoustic guitar and banjo"},{key:"reggae",label:"🌴 Reggae",prompt:"a laid-back reggae tune with island vibes"},{key:"latin",label:"💃 Latin",prompt:"a vibrant Latin dance track with percussion"},{key:"ambient",label:"🌊 Ambient",prompt:"a dreamy ambient soundscape for relaxation"},{key:"metal",label:"🤘 Metal",prompt:"a powerful metal song with heavy riffs and double bass drums"},{key:"soul",label:"🎵 Soul",prompt:"a heartfelt soul ballad with gospel harmonies"},{key:"synthwave",label:"🌃 Synthwave",prompt:"a retro synthwave track with 80s vibes"},{key:"kpop",label:"🇰🇷 K-Pop",prompt:"a catchy K-pop dance track with hook"},{key:"lullaby",label:"🌙 Lullaby",prompt:"a gentle lullaby for bedtime with soft piano"},{key:"cinematic",label:"🎬 Cinematic",prompt:"an epic cinematic orchestral score for a movie trailer"},{key:"blues",label:"🎸 Blues",prompt:"a soulful blues song with electric guitar bends"},{key:"disco",label:"🕺 Disco",prompt:"a funky disco track with groovy bassline"},{key:"punk",label:"🔥 Punk Rock",prompt:"a fast punk rock song with raw energy"},{key:"gospel",label:"⛪ Gospel",prompt:"an uplifting gospel choir song with piano"},{key:"trap",label:"🔊 Trap",prompt:"a dark trap beat with 808s and hi-hats"},{key:"bossa",label:"☕ Bossa Nova",prompt:"a gentle bossa nova with nylon guitar"},{key:"indie",label:"🎶 Indie",prompt:"a dreamy indie track with ethereal vocals"},{key:"cpop",label:"🇨🇳 C-Pop",prompt:"a beautiful Chinese pop ballad with emotional vocals"},{key:"jpop",label:"🇯🇵 J-Pop",prompt:"a cheerful J-pop song with anime vibes"},{key:"afrobeat",label:"🥁 Afrobeat",prompt:"a groovy Afrobeat track with layered percussion"},{key:"game",label:"🎮 Game BGM",prompt:"an adventurous video game background music"}],Zt=8;function ke(e){const t=[...e];for(let d=t.length-1;d>0;d--){const r=Math.floor(Math.random()*(d+1));[t[d],t[r]]=[t[r],t[d]]}return t}const xt=A({name:"PromptInput",components:{ElInput:H,FontAwesomeIcon:j,InfoIcon:F},data(){return{shuffledTags:ke(be)}},computed:{prompt:{get(){return this.$store.state.suno?.config?.prompt},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,prompt:e})}},visibleTags(){return this.shuffledTags.slice(0,Zt)}},mounted(){this.prompt||(this.prompt=Xt)},methods:{onTagClick(e){this.prompt=e.prompt},onRefreshTags(){this.shuffledTags=ke(be)}}}),eo={class:"field"},to={class:"flex items-center mb-1"},oo={class:"text-sm font-bold"},so={class:"inspo-tags"},no=["onClick"];function io(e,t,d,r,p,b){const g=l("info-icon"),m=l("el-input"),f=l("font-awesome-icon");return n(),u("div",eo,[s("div",to,[s("span",oo,a(e.$t("suno.name.songDescription")),1),o(g,{content:e.$t("suno.description.prompt")},null,8,["content"])]),o(m,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=$=>e.prompt=$),rows:4,type:"textarea",placeholder:e.$t("suno.placeholder.prompt")},null,8,["modelValue","placeholder"]),s("div",so,[(n(!0),u(M,null,z(e.visibleTags,$=>(n(),u("button",{key:$.key,class:"inspo-tag",onClick:k=>e.onTagClick($)},a($.label),9,no))),128)),s("button",{class:"inspo-tag inspo-tag-refresh",onClick:t[1]||(t[1]=(...$)=>e.onRefreshTags&&e.onRefreshTags(...$))},[o(f,{icon:"fa-solid fa-arrows-rotate"})])])])}const ao=E(xt,[["render",io],["__scopeId","data-v-378e4372"]]),lo="",ro=A({name:"LyricInput",components:{ElInput:H,ElButton:G,ElTooltip:fe,ElDialog:le,FontAwesomeIcon:j,InfoIcon:F},data(){return{generatingLyrics:!1,enhancingLyrics:!1,enhancePrompt:"",lyricHistory:[],expanded:!1}},computed:{lyric:{get(){return this.$store.state.suno?.config?.lyric},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,lyric:e})}},config(){return this.$store.state.suno?.config},credential(){return this.$store.state.suno?.credential}},mounted(){this.lyric||(this.lyric=lo)},methods:{pushHistory(){this.lyric&&(this.lyricHistory.push(this.lyric),this.lyricHistory.length>20&&this.lyricHistory.shift())},onUndo(){const e=this.lyricHistory.pop();e!==void 0&&(this.lyric=e)},onClear(){this.pushHistory(),this.lyric=""},async onEnhanceLyrics(){const e=this.credential?.token;if(!(!e||!this.lyric||!this.enhancePrompt)){this.pushHistory(),this.enhancingLyrics=!0,w.info(this.$t("suno.message.enhancingLyrics"));try{const t=`${this.enhancePrompt}
1
+ import{F as j}from"./index.es-CkYpkM9I.js";import{E as G}from"./index-DquRJRdr.js";import{E as Se}from"./index-BCYj3n6w.js";import{d as A,H as u,E as s,z as se,C as o,y as i,D as l,q as n,F as a,O as M,N as z,J as c,x as y,Q as K,I as v,U as ne,G as B,K as q,M as U,u as D,c as N,w as Le,L as Me}from"./vendor-vue-NSDaktjZ.js";import{G as E,bk as le,bj as Fe,dC as re,dD as de,X as x,J as Te,S as X,cp as Ae,dE as ee,dF as ze,co as je,n as De}from"./index-aooXG--L.js";import{a as Ge}from"./errorCode-Cqj9Td_Z.js";import{s as L}from"./suno-Ur2NAo9K.js";import{b as Be}from"./suno-DFuCGH70.js";import{E as Oe}from"./index-BjBYK4Ze.js";import{E as ue,a as ce}from"./index-BB6hDLIE.js";import{I as F,S as Ne,l as qe}from"./pagination-DXTVpMVH.js";import{E as te,a as Q,b as He}from"./index-Bsmy5WvR.js";import{E as me,a as pe}from"./index-Cs_y8rKw.js";import{E as We}from"./index-CLenm0Oo.js";import{E as w}from"./index-BV07Wvw8.js";import{E as H}from"./index-5nTLszPD.js";import{E as fe}from"./index-Bbp80plT.js";import{E as he}from"./index-ljHoqzND.js";import{u as Z,F as ve,O as Ke,_ as ye,P as Je,a as Qe,V as Ye,E as Xe}from"./IconPark.vue_vue_type_script_setup_true_lang-cWO93xyF.js";import{E as oe}from"./index-CyXD74zd.js";import{E as O}from"./index-DAj_cPV6.js";import{E as ge}from"./index-BUWKmD9b.js";import{E as Ze,a as xe}from"./index-CnNmOPsS.js";import{E as et,a as tt}from"./index-BsEUG0QP.js";import{C as ot}from"./Consumption-BTGrt-H6.js";import{a as st}from"./price-DPlr0oEm.js";import{E as nt}from"./index-B2g4JUER.js";import{E as it}from"./index-BZNL_Qx3.js";import{E as Pe,b as Ue,a as Ee}from"./index-jbtGsKSC.js";import{E as Ie}from"./index-CtAFJcCQ.js";import{N as at}from"./NoTasks-B83CvG_8.js";import{a as lt,E as rt}from"./index-CX_dHZ5K.js";import"./use-form-item-aMEij-44.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Df5ITouH.js";import"./validator-DrdbAnRf.js";import"./index-Bx7FbIQL.js";import"./index-CZbJIaMU.js";import"./typescript-BuyFDxA9.js";import"./strings-beZM2Y-f.js";import"./isEqual-CEli5aE1.js";import"./_Uint8Array-B-ZN-HZ5.js";import"./castArray-B2ZOzEca.js";import"./debounce-DPcjcYAp.js";import"./_baseIteratee-DLk1_nEJ.js";import"./index-1krlZQmJ.js";import"./_baseClone-DTM-dJi9.js";import"./_initCloneObject-D2_NhBTJ.js";import"./isPlainObject-o8IjV5He.js";import"./index-CMx7Aa_C.js";import"./index-Cu41y2Fl.js";import"./index-CXJ4c9ty.js";import"./dropdown-FfWf6mGF.js";const dt=A({name:"LayoutSuno",components:{ElDrawer:Se,ElButton:G,FontAwesomeIcon:j},data(){return{drawer:!1,preview:!1}},computed:{}}),ut={class:"main flex flex-row flex-1"},ct={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},mt={class:"result h-full flex flex-col flex-1 min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"},pt={class:"preview h-full w-[300px] flex flex-col"};function ft(e,t,d,r,p,b){const g=l("font-awesome-icon"),m=l("el-button"),f=l("el-drawer");return n(),u("div",ut,[s("div",ct,[se(e.$slots,"config",{},void 0,!0)]),s("div",mt,[se(e.$slots,"result",{},void 0,!0)]),s("div",pt,[se(e.$slots,"preview",{},void 0,!0)]),o(m,{circle:"",class:"menu",onClick:t[0]||(t[0]=$=>e.drawer=!0)},{default:i(()=>[o(g,{icon:"fa-solid fa-magic"})]),_:1}),o(f,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=$=>e.drawer=$),direction:"ltr","with-header":!1,size:"340px",class:"drawer"},{default:i(()=>[se(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const ht=E(dt,[["render",ft],["__scopeId","data-v-96d59120"]]),gt=A({name:"TypeSelector",components:{ElSelect:ce,ElOption:ue,ElSwitch:Oe},data(){return{options:[{label:"v5.5",value:"chirp-v5-5",desc:this.$t("suno.model.v55desc")},{label:"v5",value:"chirp-v5",desc:this.$t("suno.model.v5desc")},{label:"v4.5+",value:"chirp-v4-5-plus",desc:this.$t("suno.model.v45plusdesc")},{label:"v4.5",value:"chirp-v4-5",desc:this.$t("suno.model.v45desc"),dividerAfter:!0},{label:"v4",value:"chirp-v4",desc:this.$t("suno.model.v4desc")},{label:"v3.5",value:"chirp-v3-5",desc:this.$t("suno.model.v35desc")},{label:"v3",value:"chirp-v3-0",desc:this.$t("suno.model.v3desc")}]}},computed:{custom:{get(){return this.$store.state.suno?.config?.custom||!1},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,custom:e})}},instrumental:{get(){return this.$store.state.suno?.config?.instrumental||!1},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,instrumental:e})}},model:{get(){return this.$store.state.suno?.config?.model},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:e})}}},mounted(){this.model||(this.model=Be)}}),$t={class:"mb-3"},_t={class:"flex items-center mb-1"},vt={class:"text-sm font-bold"},yt={class:"model-option"},bt={class:"model-option-left"},kt={class:"model-option-name"},wt={class:"model-option-desc"},Ct={key:0,class:"flex items-center justify-between mb-3"},Vt={class:"text-sm font-bold"};function St(e,t,d,r,p,b){const g=l("el-option"),m=l("el-select"),f=l("el-switch");return n(),u("div",null,[s("div",$t,[s("div",_t,[s("span",vt,a(e.$t("suno.name.model")),1)]),o(m,{modelValue:e.model,"onUpdate:modelValue":t[0]||(t[0]=$=>e.model=$),class:"w-full model-select",size:"default",placeholder:e.$t("suno.placeholder.select")},{default:i(()=>[(n(!0),u(M,null,z(e.options,$=>(n(),y(g,{key:$.value,label:$.label,value:$.value,class:K({"model-option-divider":$.dividerAfter})},{default:i(()=>[s("div",yt,[s("div",bt,[s("span",kt,a($.label),1)]),s("span",wt,a($.desc),1)])]),_:2},1032,["label","value","class"]))),128))]),_:1},8,["modelValue","placeholder"])]),e.custom?(n(),u("div",Ct,[s("span",Vt,a(e.$t("suno.name.instrumental")),1),o(f,{modelValue:e.instrumental,"onUpdate:modelValue":t[1]||(t[1]=$=>e.instrumental=$)},null,8,["modelValue"])])):c("",!0)])}const Tt=E(gt,[["render",St],["__scopeId","data-v-16e4d6fc"]]),At=A({name:"UploadAudio",components:{ElUpload:We,ElButton:G,ElDialog:le,ElTabs:pe,ElTabPane:me,InfoIcon:F,FontAwesomeIcon:j,ElRadioGroup:Q,ElRadioButton:te},emits:["change"],data(){return{fileList:[],uploadUrl:Fe()+"/api/v1/files/",dialogVisible:!1,activeTab:"browse",recording:!1,recordedBlob:null,recordedAudioUrl:null,audioPreviewUrl:null,recordTimer:null,recordSeconds:0,mediaRecorder:null,mediaStream:null,recordedChunks:[],uploadingRecord:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},credential(){return this.$store.state.suno.credential},config(){return this.$store.state.suno.config},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.suno?.config?.audio_id},set(){}},hasUploadedAudio(){const e=this.$store.state.suno?.config?.action;return e==="upload_extend"||e==="upload_cover"},uploadAction:{get(){return this.$store.state.suno?.config?.action||"upload_extend"},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,action:e})}},formattedTime(){const e=Math.floor(this.recordSeconds/60).toString().padStart(2,"0"),t=(this.recordSeconds%60).toString().padStart(2,"0");return`${e}:${t}`}},watch:{urls:{handler(e){this.$emit("change",e)}}},beforeUnmount(){this.cleanupRecording()},methods:{onExceed(){w.warning(this.$t("suno.message.uploadReferencesExceed"))},onError(){w.error(this.$t("suno.message.uploadReferencesError"))},async onBrowseSuccess(){const e=this.urls?.[0];e&&(this.audioPreviewUrl=e,await this.onGenerateAudioId(e),this.dialogVisible=!1)},async onGenerateAudioId(e){const t={audio_url:e},d=this.credential?.token;if(!d){console.error("no token specified");return}w.info(this.$t("suno.message.startingUploadAudio"));try{const r=await L.upload(t,{token:d});console.debug("get upload music success",r.data);const p=r.data?.data.audio_id;this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,audio_id:p,action:"upload_extend"}),w.success(this.$t("suno.message.startUploadAudioSuccess"))}catch(r){w.error(r?.response?.data?.error?.message||this.$t("suno.message.startUploadAudioFailed"))}},async startRecording(){if(!navigator.mediaDevices?.getUserMedia||typeof MediaRecorder>"u"){w.error(this.$t("suno.message.recordingUnsupported"));return}try{this.mediaStream=await navigator.mediaDevices.getUserMedia({audio:!0}),this.recordedChunks=[],this.mediaRecorder=new MediaRecorder(this.mediaStream),this.mediaRecorder.ondataavailable=e=>{e.data&&e.data.size>0&&this.recordedChunks.push(e.data)},this.mediaRecorder.onstop=()=>{const e=new Blob(this.recordedChunks,{type:"audio/webm"});this.recordedBlob=e,this.recordedAudioUrl&&URL.revokeObjectURL(this.recordedAudioUrl),this.recordedAudioUrl=URL.createObjectURL(e),this.releaseStream()},this.mediaRecorder.start(),this.recording=!0,this.recordSeconds=0,this.recordTimer=window.setInterval(()=>{this.recordSeconds+=1,this.recordSeconds>=600&&this.stopRecording()},1e3)}catch(e){console.error("record error",e),w.error(this.$t("suno.message.recordingPermissionDenied"))}},stopRecording(){this.recordTimer&&(window.clearInterval(this.recordTimer),this.recordTimer=null),this.mediaRecorder&&this.mediaRecorder.state!=="inactive"&&this.mediaRecorder.stop(),this.recording=!1},resetRecording(){this.recordedAudioUrl&&URL.revokeObjectURL(this.recordedAudioUrl),this.recordedBlob=null,this.recordedAudioUrl=null,this.recordSeconds=0},async uploadRecording(){if(this.recordedBlob){this.uploadingRecord=!0;try{const e=new FormData,t=`recording-${Date.now()}.webm`;e.append("file",this.recordedBlob,t);const d=await fetch(this.uploadUrl,{method:"POST",headers:{Authorization:`Bearer ${this.$store.state.token.access}`},body:e});if(!d.ok)throw new Error(`upload failed: ${d.status}`);const r=await d.json(),p=r?.file_url||r?.data?.file_url;if(!p)throw new Error("no file_url in response");this.audioPreviewUrl=p,await this.onGenerateAudioId(p),this.dialogVisible=!1,this.resetRecording()}catch(e){console.error(e),w.error(e?.message||this.$t("suno.message.uploadReferencesError"))}finally{this.uploadingRecord=!1}}},releaseStream(){this.mediaStream&&(this.mediaStream.getTracks().forEach(e=>e.stop()),this.mediaStream=null)},cleanupRecording(){this.recordTimer&&(window.clearInterval(this.recordTimer),this.recordTimer=null),this.releaseStream(),this.recordedAudioUrl&&(URL.revokeObjectURL(this.recordedAudioUrl),this.recordedAudioUrl=null)}}}),Pt={class:"relative"},Ut={class:"flex justify-between items-center mb-2"},Et={class:"flex justify-start items-center"},It={class:"text-sm font-bold"},Rt={key:0,class:"mb-2"},Lt=["src"],Mt={key:1,class:"mt-2"},Ft={class:"py-4"},zt={class:"text-center py-6"},jt={class:"text-sm"},Dt={class:"text-xs text-gray-400 mt-1"},Gt={class:"py-4 text-center"},Bt={class:"recorder-display mb-4"},Ot={key:0,class:"text-red-500 flex items-center justify-center gap-2"},Nt={class:"text-2xl font-mono"},qt={key:1,class:"text-green-600"},Ht={key:2,class:"text-gray-400 text-2xl font-mono"},Wt={key:0,class:"mb-4"},Kt=["src"],Jt={class:"flex justify-center gap-3"};function Qt(e,t,d,r,p,b){const g=l("info-icon"),m=l("font-awesome-icon"),f=l("el-button"),$=l("el-radio-button"),k=l("el-radio-group"),T=l("el-upload"),_=l("el-tab-pane"),V=l("el-tabs"),C=l("el-dialog");return n(),u("div",Pt,[s("div",Ut,[s("div",Et,[s("span",It,a(e.$t("suno.name.referenceAudios")),1),o(g,{content:e.$t("suno.description.uploadAudios")},null,8,["content"])]),o(f,{round:"",type:"primary",size:"small",onClick:t[0]||(t[0]=I=>e.dialogVisible=!0)},{default:i(()=>[o(m,{icon:"fa-solid fa-plus",class:"icon mr-1"}),v(" "+a(e.$t("suno.button.addAudio")),1)]),_:1})]),e.audioPreviewUrl?(n(),u("div",Rt,[s("audio",{src:e.audioPreviewUrl,controls:"",class:"w-full"},null,8,Lt)])):c("",!0),e.hasUploadedAudio?(n(),u("div",Mt,[o(k,{modelValue:e.uploadAction,"onUpdate:modelValue":t[1]||(t[1]=I=>e.uploadAction=I),size:"small"},{default:i(()=>[o($,{value:"upload_extend"},{default:i(()=>[v(a(e.$t("suno.button.extend")),1)]),_:1}),o($,{value:"upload_cover"},{default:i(()=>[v(a(e.$t("suno.button.upload_cover")),1)]),_:1})]),_:1},8,["modelValue"])])):c("",!0),o(C,{modelValue:e.dialogVisible,"onUpdate:modelValue":t[4]||(t[4]=I=>e.dialogVisible=I),title:e.$t("suno.name.addAudio"),width:"520px","close-on-click-modal":!1,"append-to-body":""},{default:i(()=>[o(V,{modelValue:e.activeTab,"onUpdate:modelValue":t[3]||(t[3]=I=>e.activeTab=I),class:"add-audio-tabs"},{default:i(()=>[o(_,{name:"browse",label:e.$t("suno.tab.browse")},{default:i(()=>[s("div",Ft,[o(T,{"file-list":e.fileList,"onUpdate:fileList":t[2]||(t[2]=I=>e.fileList=I),name:"file",limit:1,class:"upload-wrapper",action:e.uploadUrl,accept:".mp3,.wav,.m4a,audio/*","show-file-list":!0,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onBrowseSuccess,headers:e.headers,drag:""},{default:i(()=>[s("div",zt,[o(m,{icon:"fa-solid fa-upload",class:"text-4xl text-gray-400 mb-3"}),s("div",jt,a(e.$t("suno.description.dropAudioHere")),1),s("div",Dt,a(e.$t("suno.description.audioFormats")),1)])]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])]),_:1},8,["label"]),o(_,{name:"record",label:e.$t("suno.tab.record")},{default:i(()=>[s("div",Gt,[s("div",Bt,[e.recording?(n(),u("div",Ot,[t[5]||(t[5]=s("span",{class:"recording-dot"},null,-1)),s("span",Nt,a(e.formattedTime),1)])):e.recordedBlob?(n(),u("div",qt,[o(m,{icon:"fa-solid fa-check-circle",class:"text-2xl mr-2"}),s("span",null,a(e.$t("suno.message.recordingReady"))+" ("+a(e.formattedTime)+")",1)])):(n(),u("div",Ht,"00:00"))]),e.recordedAudioUrl&&!e.recording?(n(),u("div",Wt,[s("audio",{src:e.recordedAudioUrl,controls:"",class:"w-full"},null,8,Kt)])):c("",!0),s("div",Jt,[!e.recording&&!e.recordedBlob?(n(),y(f,{key:0,type:"primary",round:"",onClick:e.startRecording},{default:i(()=>[o(m,{icon:"fa-solid fa-microphone",class:"mr-1"}),v(" "+a(e.$t("suno.button.startRecord")),1)]),_:1},8,["onClick"])):c("",!0),e.recording?(n(),y(f,{key:1,type:"danger",round:"",onClick:e.stopRecording},{default:i(()=>[o(m,{icon:"fa-solid fa-stop",class:"mr-1"}),v(" "+a(e.$t("suno.button.stopRecord")),1)]),_:1},8,["onClick"])):c("",!0),e.recordedBlob&&!e.recording?(n(),u(M,{key:2},[o(f,{round:"",onClick:e.resetRecording},{default:i(()=>[o(m,{icon:"fa-solid fa-rotate-left",class:"mr-1"}),v(" "+a(e.$t("suno.button.reRecord")),1)]),_:1},8,["onClick"]),o(f,{type:"primary",round:"",loading:e.uploadingRecord,onClick:e.uploadRecording},{default:i(()=>[o(m,{icon:"fa-solid fa-upload",class:"mr-1"}),v(" "+a(e.$t("suno.button.useRecording")),1)]),_:1},8,["loading","onClick"])],64)):c("",!0)])])]),_:1},8,["label"])]),_:1},8,["modelValue"])]),_:1},8,["modelValue","title"])])}const Yt=E(At,[["render",Qt],["__scopeId","data-v-bfb6b53d"]]),Xt="",be=[{key:"lofi",label:"🎧 Lo-fi Chill",prompt:"a relaxing lo-fi hip hop beat for studying"},{key:"pop-love",label:"💕 Pop Love Song",prompt:"a catchy pop love song with sweet melodies"},{key:"rock-anthem",label:"🎸 Rock Anthem",prompt:"an energetic rock anthem with electric guitars"},{key:"jazz-night",label:"🎷 Jazz Night",prompt:"a smooth late-night jazz piece with saxophone"},{key:"edm-drop",label:"⚡ EDM Drop",prompt:"an intense EDM track with a massive drop"},{key:"folk-story",label:"🪕 Folk Story",prompt:"a warm folk song telling a story about traveling"},{key:"rnb-groove",label:"🎤 R&B Groove",prompt:"a smooth R&B groove with soulful vocals"},{key:"classical",label:"🎻 Classical",prompt:"an elegant classical piece for orchestra"},{key:"hip-hop",label:"🎤 Hip Hop",prompt:"a hard-hitting hip hop beat with bass"},{key:"country",label:"🤠 Country",prompt:"an upbeat country song with acoustic guitar and banjo"},{key:"reggae",label:"🌴 Reggae",prompt:"a laid-back reggae tune with island vibes"},{key:"latin",label:"💃 Latin",prompt:"a vibrant Latin dance track with percussion"},{key:"ambient",label:"🌊 Ambient",prompt:"a dreamy ambient soundscape for relaxation"},{key:"metal",label:"🤘 Metal",prompt:"a powerful metal song with heavy riffs and double bass drums"},{key:"soul",label:"🎵 Soul",prompt:"a heartfelt soul ballad with gospel harmonies"},{key:"synthwave",label:"🌃 Synthwave",prompt:"a retro synthwave track with 80s vibes"},{key:"kpop",label:"🇰🇷 K-Pop",prompt:"a catchy K-pop dance track with hook"},{key:"lullaby",label:"🌙 Lullaby",prompt:"a gentle lullaby for bedtime with soft piano"},{key:"cinematic",label:"🎬 Cinematic",prompt:"an epic cinematic orchestral score for a movie trailer"},{key:"blues",label:"🎸 Blues",prompt:"a soulful blues song with electric guitar bends"},{key:"disco",label:"🕺 Disco",prompt:"a funky disco track with groovy bassline"},{key:"punk",label:"🔥 Punk Rock",prompt:"a fast punk rock song with raw energy"},{key:"gospel",label:"⛪ Gospel",prompt:"an uplifting gospel choir song with piano"},{key:"trap",label:"🔊 Trap",prompt:"a dark trap beat with 808s and hi-hats"},{key:"bossa",label:"☕ Bossa Nova",prompt:"a gentle bossa nova with nylon guitar"},{key:"indie",label:"🎶 Indie",prompt:"a dreamy indie track with ethereal vocals"},{key:"cpop",label:"🇨🇳 C-Pop",prompt:"a beautiful Chinese pop ballad with emotional vocals"},{key:"jpop",label:"🇯🇵 J-Pop",prompt:"a cheerful J-pop song with anime vibes"},{key:"afrobeat",label:"🥁 Afrobeat",prompt:"a groovy Afrobeat track with layered percussion"},{key:"game",label:"🎮 Game BGM",prompt:"an adventurous video game background music"}],Zt=8;function ke(e){const t=[...e];for(let d=t.length-1;d>0;d--){const r=Math.floor(Math.random()*(d+1));[t[d],t[r]]=[t[r],t[d]]}return t}const xt=A({name:"PromptInput",components:{ElInput:H,FontAwesomeIcon:j,InfoIcon:F},data(){return{shuffledTags:ke(be)}},computed:{prompt:{get(){return this.$store.state.suno?.config?.prompt},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,prompt:e})}},visibleTags(){return this.shuffledTags.slice(0,Zt)}},mounted(){this.prompt||(this.prompt=Xt)},methods:{onTagClick(e){this.prompt=e.prompt},onRefreshTags(){this.shuffledTags=ke(be)}}}),eo={class:"field"},to={class:"flex items-center mb-1"},oo={class:"text-sm font-bold"},so={class:"inspo-tags"},no=["onClick"];function io(e,t,d,r,p,b){const g=l("info-icon"),m=l("el-input"),f=l("font-awesome-icon");return n(),u("div",eo,[s("div",to,[s("span",oo,a(e.$t("suno.name.songDescription")),1),o(g,{content:e.$t("suno.description.prompt")},null,8,["content"])]),o(m,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=$=>e.prompt=$),rows:4,type:"textarea",placeholder:e.$t("suno.placeholder.prompt")},null,8,["modelValue","placeholder"]),s("div",so,[(n(!0),u(M,null,z(e.visibleTags,$=>(n(),u("button",{key:$.key,class:"inspo-tag",onClick:k=>e.onTagClick($)},a($.label),9,no))),128)),s("button",{class:"inspo-tag inspo-tag-refresh",onClick:t[1]||(t[1]=(...$)=>e.onRefreshTags&&e.onRefreshTags(...$))},[o(f,{icon:"fa-solid fa-arrows-rotate"})])])])}const ao=E(xt,[["render",io],["__scopeId","data-v-378e4372"]]),lo="",ro=A({name:"LyricInput",components:{ElInput:H,ElButton:G,ElTooltip:fe,ElDialog:le,FontAwesomeIcon:j,InfoIcon:F},data(){return{generatingLyrics:!1,enhancingLyrics:!1,enhancePrompt:"",lyricHistory:[],expanded:!1}},computed:{lyric:{get(){return this.$store.state.suno?.config?.lyric},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,lyric:e})}},config(){return this.$store.state.suno?.config},credential(){return this.$store.state.suno?.credential}},mounted(){this.lyric||(this.lyric=lo)},methods:{pushHistory(){this.lyric&&(this.lyricHistory.push(this.lyric),this.lyricHistory.length>20&&this.lyricHistory.shift())},onUndo(){const e=this.lyricHistory.pop();e!==void 0&&(this.lyric=e)},onClear(){this.pushHistory(),this.lyric=""},async onEnhanceLyrics(){const e=this.credential?.token;if(!(!e||!this.lyric||!this.enhancePrompt)){this.pushHistory(),this.enhancingLyrics=!0,w.info(this.$t("suno.message.enhancingLyrics"));try{const t=`${this.enhancePrompt}
2
2
 
3
3
  Original lyrics:
4
4
  ${this.lyric}`,r=(await L.lyric({prompt:t},{token:e})).data?.data;r?.text&&(this.lyric=r.text,this.enhancePrompt="",w.success(this.$t("suno.message.enhanceLyricsSuccess")))}catch{w.error(this.$t("suno.message.enhanceLyricsFailed"))}finally{this.enhancingLyrics=!1}}},async onGenerateLyrics(){const e=this.credential?.token;if(!e)return;let t;try{t=((await he.prompt(this.$t("suno.message.lyricsThemePromptMessage"),this.$t("suno.message.lyricsThemePromptTitle"),{confirmButtonText:this.$t("common.button.confirm"),cancelButtonText:this.$t("common.button.cancel"),inputPlaceholder:this.$t("suno.placeholder.lyricsTheme"),inputValue:this.config?.title||"",inputType:"textarea",inputValidator:r=>typeof r=="string"&&r.trim().length>0||this.$t("suno.message.lyricsThemeRequired")})).value||"").trim()}catch{return}if(t){this.pushHistory(),this.generatingLyrics=!0,w.info(this.$t("suno.message.generatingLyrics"));try{const r=(await L.lyric({prompt:t},{token:e})).data?.data;r?.text&&(this.lyric=r.text,r?.title&&!this.config?.title&&this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,lyric:r.text,title:r.title}),w.success(this.$t("suno.message.generateLyricsSuccess")))}catch{w.error(this.$t("suno.message.generateLyricsFailed"))}finally{this.generatingLyrics=!1}}}}}),uo={class:"field"},co={class:"flex items-center justify-between mb-1"},mo={class:"flex items-center"},po={class:"text-sm font-bold"},fo={class:"flex items-center gap-1"},ho={class:"relative"},go={class:"text-xs text-right text-[var(--el-text-color-secondary)] mt-1"},$o={key:0,class:"enhance-bar"},_o={key:0,class:"enhance-bar mt-3"},vo={class:"flex items-center justify-between"},yo={class:"flex items-center gap-1"};function bo(e,t,d,r,p,b){const g=l("info-icon"),m=l("font-awesome-icon"),f=l("el-button"),$=l("el-tooltip"),k=l("el-input"),T=l("el-dialog");return n(),u("div",uo,[s("div",co,[s("div",mo,[s("span",po,a(e.$t("suno.name.lyrics")),1),o(g,{content:e.$t("suno.description.lyrics")},null,8,["content"])]),s("div",fo,[e.lyricHistory.length>0?(n(),y($,{key:0,content:e.$t("suno.button.undo"),placement:"top"},{default:i(()=>[o(f,{size:"small",circle:"",onClick:e.onUndo},{default:i(()=>[o(m,{icon:"fa-solid fa-rotate-left"})]),_:1},8,["onClick"])]),_:1},8,["content"])):c("",!0),e.lyric?(n(),y($,{key:1,content:e.$t("suno.button.clear_lyrics"),placement:"top"},{default:i(()=>[o(f,{size:"small",circle:"",onClick:e.onClear},{default:i(()=>[o(m,{icon:"fa-solid fa-eraser"})]),_:1},8,["onClick"])]),_:1},8,["content"])):c("",!0),o($,{content:e.$t("suno.button.expand_lyrics"),placement:"top"},{default:i(()=>[o(f,{size:"small",circle:"",onClick:t[0]||(t[0]=_=>e.expanded=!0)},{default:i(()=>[o(m,{icon:"fa-solid fa-expand"})]),_:1})]),_:1},8,["content"]),e.config?.action!=="extend"?(n(),y(f,{key:2,size:"small",loading:e.generatingLyrics,round:"",onClick:e.onGenerateLyrics},{default:i(()=>[e.generatingLyrics?c("",!0):(n(),y(m,{key:0,icon:"fa-solid fa-wand-magic-sparkles",class:"mr-1"})),v(" "+a(e.$t("suno.button.generate_lyrics")),1)]),_:1},8,["loading","onClick"])):c("",!0)])]),s("div",ho,[e.config?.action!=="extend"?(n(),y(k,{key:0,modelValue:e.lyric,"onUpdate:modelValue":t[1]||(t[1]=_=>e.lyric=_),rows:5,type:"textarea",class:"lyrics",placeholder:e.$t("suno.placeholder.lyrics")},null,8,["modelValue","placeholder"])):(n(),y(k,{key:1,modelValue:e.lyric,"onUpdate:modelValue":t[2]||(t[2]=_=>e.lyric=_),rows:5,type:"textarea",class:"lyrics",placeholder:e.$t("suno.placeholder.extend.lyrics")},null,8,["modelValue","placeholder"])),s("div",go,a(e.lyric?.length||0)+"/5000",1)]),e.lyric&&e.config?.action!=="extend"?(n(),u("div",$o,[o(k,{modelValue:e.enhancePrompt,"onUpdate:modelValue":t[3]||(t[3]=_=>e.enhancePrompt=_),size:"small",placeholder:e.$t("suno.placeholder.enhanceLyrics"),class:"enhance-input",onKeyup:ne(e.onEnhanceLyrics,["enter"])},{append:i(()=>[o(f,{loading:e.enhancingLyrics,onClick:e.onEnhanceLyrics},{default:i(()=>[e.enhancingLyrics?c("",!0):(n(),y(m,{key:0,icon:"fa-solid fa-wand-magic-sparkles",class:"mr-1"})),v(" "+a(e.$t("suno.button.enhance_lyrics")),1)]),_:1},8,["loading","onClick"])]),_:1},8,["modelValue","placeholder","onKeyup"])])):c("",!0),o(T,{modelValue:e.expanded,"onUpdate:modelValue":t[7]||(t[7]=_=>e.expanded=_),title:e.$t("suno.name.lyrics"),width:"720px",top:"5vh","close-on-click-modal":!1,class:"lyrics-expand-dialog"},{footer:i(()=>[s("div",vo,[s("div",yo,[e.lyricHistory.length>0?(n(),y(f,{key:0,size:"small",onClick:e.onUndo},{default:i(()=>[o(m,{icon:"fa-solid fa-rotate-left",class:"mr-1"}),v(" "+a(e.$t("suno.button.undo")),1)]),_:1},8,["onClick"])):c("",!0),e.lyric?(n(),y(f,{key:1,size:"small",onClick:e.onClear},{default:i(()=>[o(m,{icon:"fa-solid fa-eraser",class:"mr-1"}),v(" "+a(e.$t("suno.button.clear_lyrics")),1)]),_:1},8,["onClick"])):c("",!0),e.config?.action!=="extend"?(n(),y(f,{key:2,size:"small",loading:e.generatingLyrics,onClick:e.onGenerateLyrics},{default:i(()=>[e.generatingLyrics?c("",!0):(n(),y(m,{key:0,icon:"fa-solid fa-wand-magic-sparkles",class:"mr-1"})),v(" "+a(e.$t("suno.button.generate_lyrics")),1)]),_:1},8,["loading","onClick"])):c("",!0)]),o(f,{type:"primary",onClick:t[6]||(t[6]=_=>e.expanded=!1)},{default:i(()=>[v(a(e.$t("common.button.confirm")),1)]),_:1})])]),default:i(()=>[o(k,{modelValue:e.lyric,"onUpdate:modelValue":t[4]||(t[4]=_=>e.lyric=_),type:"textarea",rows:20,class:"lyrics-expanded",placeholder:e.$t("suno.placeholder.lyrics"),autofocus:""},null,8,["modelValue","placeholder"]),e.config?.action!=="extend"?(n(),u("div",_o,[o(k,{modelValue:e.enhancePrompt,"onUpdate:modelValue":t[5]||(t[5]=_=>e.enhancePrompt=_),size:"small",placeholder:e.$t("suno.placeholder.enhanceLyrics"),class:"enhance-input",onKeyup:ne(e.onEnhanceLyrics,["enter"])},{append:i(()=>[o(f,{loading:e.enhancingLyrics,onClick:e.onEnhanceLyrics},{default:i(()=>[e.enhancingLyrics?c("",!0):(n(),y(m,{key:0,icon:"fa-solid fa-wand-magic-sparkles",class:"mr-1"})),v(" "+a(e.$t("suno.button.enhance_lyrics")),1)]),_:1},8,["loading","onClick"])]),_:1},8,["modelValue","placeholder","onKeyup"])])):c("",!0)]),_:1},8,["modelValue","title"])])}const ko=E(ro,[["render",bo],["__scopeId","data-v-d7d2ec74"]]),we=["Pop","Rock","Jazz","R&B","Hip Hop","Lo-fi","Electronic","Classical","Country","Blues","Folk","Reggae","Metal","Punk","Soul","Funk","Ambient","Indie","Latin","Acoustic","Dance","Disco","Gospel","K-Pop","J-Pop","C-Pop","Bossa Nova","Trap","Drill","House","Techno","Dubstep","Synthwave","Chill","Dreamy","Upbeat","Melancholic","Romantic","Epic","Cinematic","Orchestral","Piano","Guitar","Saxophone","Violin","Tribal","World Music","Afrobeat","Ska","Grunge"],wo=12;function Ce(e){const t=[...e];for(let d=t.length-1;d>0;d--){const r=Math.floor(Math.random()*(d+1));[t[d],t[r]]=[t[r],t[d]]}return t}const Co=A({name:"StyleInput",components:{ElInput:H,ElButton:G,FontAwesomeIcon:j,InfoIcon:F},data(){return{optimizing:!1,shuffledTags:Ce(we)}},computed:{style:{get(){return this.$store.state.suno?.config?.style},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,style:e})}},credential(){return this.$store.state.suno?.credential},visibleTags(){return this.shuffledTags.slice(0,wo)}},methods:{onTagClick(e){const t=this.style||"";t.toLowerCase().includes(e.toLowerCase())||(this.style=t?`${t}, ${e}`:e)},onRefreshTags(){this.shuffledTags=Ce(we)},async onOptimizeStyle(){const e=this.credential?.token;if(!(!e||!this.style)){this.optimizing=!0,w.info(this.$t("suno.message.optimizingStyle"));try{const t=await L.style({prompt:this.style},{token:e}),d=t.data?.text||t.data?.data?.text;d&&(this.style=d,w.success(this.$t("suno.message.optimizeStyleSuccess")))}catch{w.error(this.$t("suno.message.optimizeStyleFailed"))}finally{this.optimizing=!1}}}}}),Vo={class:"field"},So={class:"flex items-center justify-between mb-1"},To={class:"flex items-center"},Ao={class:"text-sm font-bold"},Po={class:"relative"},Uo={class:"text-xs text-right text-[var(--el-text-color-secondary)] mt-1"},Eo={class:"style-tags"},Io=["onClick"];function Ro(e,t,d,r,p,b){const g=l("info-icon"),m=l("font-awesome-icon"),f=l("el-button"),$=l("el-input");return n(),u("div",Vo,[s("div",So,[s("div",To,[s("span",Ao,a(e.$t("suno.name.style")),1),o(g,{content:e.$t("suno.description.style")},null,8,["content"])]),o(f,{size:"small",loading:e.optimizing,round:"",onClick:e.onOptimizeStyle},{default:i(()=>[e.optimizing?c("",!0):(n(),y(m,{key:0,icon:"fa-solid fa-wand-magic-sparkles",class:"mr-1"})),v(" "+a(e.$t("suno.button.optimize_style")),1)]),_:1},8,["loading","onClick"])]),s("div",Po,[o($,{modelValue:e.style,"onUpdate:modelValue":t[0]||(t[0]=k=>e.style=k),rows:2,type:"textarea",placeholder:e.$t("suno.placeholder.style")},null,8,["modelValue","placeholder"]),s("div",Uo,a(e.style?.length||0)+"/1000",1)]),s("div",Eo,[(n(!0),u(M,null,z(e.visibleTags,k=>(n(),u("button",{key:k,class:"style-tag",onClick:T=>e.onTagClick(k)},a(k),9,Io))),128)),s("button",{class:"style-tag style-tag-refresh",onClick:t[1]||(t[1]=(...k)=>e.onRefreshTags&&e.onRefreshTags(...k))},[o(m,{icon:"fa-solid fa-arrows-rotate"})])])])}const Lo=E(Co,[["render",Ro],["__scopeId","data-v-ddebb076"]]),Mo=A({name:"TitleInput",components:{ElInput:H,InfoIcon:F},computed:{title:{get(){return this.$store.state.suno?.config?.title},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,title:e})}}}}),Fo={class:"field"},zo={class:"flex items-center mb-1"},jo={class:"text-sm font-bold"};function Do(e,t,d,r,p,b){const g=l("info-icon"),m=l("el-input");return n(),u("div",Fo,[s("div",zo,[s("span",jo,a(e.$t("suno.name.title")),1),o(g,{content:e.$t("suno.description.title")},null,8,["content"])]),o(m,{modelValue:e.title,"onUpdate:modelValue":t[0]||(t[0]=f=>e.title=f),placeholder:e.$t("suno.placeholder.title")},null,8,["modelValue","placeholder"])])}const Go=E(Mo,[["render",Do]]),Bo=A({name:"ExtendFromInput",components:{ElImage:O,ElIcon:x,ElInputNumber:oe,VideoPlay:de,VideoPause:re},data(){return{}},computed:{audio(){return this.$store.state.suno?.config?.audio},value:{get(){return this.$store.state.suno?.config?.continue_at},set(e){console.debug("set continue_at",e),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,continue_at:e?parseInt(e):void 0})}}},mounted(){this.value||(this.value=void 0)},methods:{handleChange(e){if(e===void 0){this.value=void 0;return}e<0?this.value=0:e>this.audio?.duration?this.value=this.audio?.duration:this.value=e},useFormatDuring:Z,onPlay(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){this.$store.state?.suno?.audio?.id!==e.id&&this.onPlay({...e,progress:0})}}}),Oo={class:"field"},No={class:"box"},qo={class:"title font-bold"},Ho={class:"input-wrapper"},Wo={class:"task"},Ko={class:"left"},Jo={key:2,class:"duration"},Qo={class:"info"},Yo={class:"title"},Xo={class:"style"};function Zo(e,t,d,r,p,b){const g=l("el-input-number"),m=l("el-image"),f=l("video-pause"),$=l("el-icon"),k=l("video-play"),T=q("loading");return n(),u("div",Oo,[s("div",No,[s("h2",qo,a(e.$t("suno.name.extend")),1),s("div",Ho,[o(g,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=_=>e.value=_),class:"value",min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.extend.continue_at"),onChange:e.handleChange},null,8,["modelValue","max","placeholder","onChange"])])]),s("div",Wo,[e.audio?(n(),u("div",{key:0,class:"audio",onClick:t[3]||(t[3]=_=>e.onClick(e.audio))},[B((n(),u("div",Ko,[o(m,{src:e.audio?.image_url,class:"cover",fit:"cover"},null,8,["src"]),e.audio?.audio_url&&e.$store.state?.suno?.audio?.id===e.audio.id&&e.$store.state?.suno?.audio?.state==="playing"?(n(),u("div",{key:0,class:"overlay",onClick:t[1]||(t[1]=_=>e.onPause(e.audio))},[o($,null,{default:i(()=>[o(f)]),_:1})])):c("",!0),e.audio?.audio_url&&(e.$store.state?.suno?.audio?.id!==e.audio.id||e.$store.state?.suno?.audio?.id===e.audio.id&&e.$store.state?.suno?.audio?.state==="paused")?(n(),u("div",{key:1,class:"overlay",onClick:t[2]||(t[2]=_=>e.onPlay(e.audio))},[o($,null,{default:i(()=>[o(k)]),_:1})])):c("",!0),e.audio?.duration?(n(),u("div",Jo,a(e.useFormatDuring(e.audio?.duration)),1)):c("",!0)])),[[T,!e.audio?.audio_url]]),s("div",Qo,[s("h2",Yo,a(e.audio?.title),1),s("p",Xo,a(e.audio?.style),1)])])):c("",!0)])])}const xo=E(Bo,[["render",Zo],["__scopeId","data-v-bcce4821"]]),es=A({name:"CoverFromInput",components:{ElImage:O,ElIcon:x,VideoPlay:de,VideoPause:re},data(){return{}},computed:{audio(){return this.$store.state.suno?.config?.audio},value:{get(){return this.$store.state.suno?.config?.continue_at},set(e){console.debug("set continue_at",e),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,continue_at:e?parseInt(e):void 0})}}},mounted(){this.value||(this.value=void 0)},methods:{handleChange(e){e<0?this.value=0:e>this.audio?.duration?this.value=this.audio?.duration:this.value=e},useFormatDuring:Z,onPlay(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){this.$store.state?.suno?.audio?.id!==e.id&&this.onPlay({...e,progress:0})}}}),ts={class:"field"},os={class:"box"},ss={class:"title font-bold"},ns={class:"task"},is={class:"left"},as={key:2,class:"duration"},ls={class:"info"},rs={class:"title"},ds={class:"style"};function us(e,t,d,r,p,b){const g=l("el-image"),m=l("video-pause"),f=l("el-icon"),$=l("video-play"),k=q("loading");return n(),u("div",ts,[s("div",os,[s("h2",ss,a(e.$t("suno.name.cover")),1)]),s("div",ns,[e.audio?(n(),u("div",{key:0,class:"audio",onClick:t[2]||(t[2]=T=>e.onClick(e.audio))},[B((n(),u("div",is,[o(g,{src:e.audio?.image_url,class:"cover",fit:"cover"},null,8,["src"]),e.audio?.audio_url&&e.$store.state?.suno?.audio?.id===e.audio.id&&e.$store.state?.suno?.audio?.state==="playing"?(n(),u("div",{key:0,class:"overlay",onClick:t[0]||(t[0]=T=>e.onPause(e.audio))},[o(f,null,{default:i(()=>[o(m)]),_:1})])):c("",!0),e.audio?.audio_url&&(e.$store.state?.suno?.audio?.id!==e.audio.id||e.$store.state?.suno?.audio?.id===e.audio.id&&e.$store.state?.suno?.audio?.state==="paused")?(n(),u("div",{key:1,class:"overlay",onClick:t[1]||(t[1]=T=>e.onPlay(e.audio))},[o(f,null,{default:i(()=>[o($)]),_:1})])):c("",!0),e.audio?.duration?(n(),u("div",as,a(e.useFormatDuring(e.audio?.duration)),1)):c("",!0)])),[[k,!e.audio?.audio_url]]),s("div",ls,[s("h2",rs,a(e.audio?.title),1),s("p",ds,a(e.audio?.style),1)])])):c("",!0)])])}const cs=E(es,[["render",us],["__scopeId","data-v-06640216"]]),ms=A({name:"VocalGenderSelector",components:{ElRadioGroup:Q,ElRadioButton:te,InfoIcon:F},computed:{vocalGender:{get(){return this.$store.state.suno?.config?.vocal_gender||""},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,vocal_gender:e||void 0})}}}}),ps={class:"flex items-center mb-1"},fs={class:"text-sm font-bold"};function hs(e,t,d,r,p,b){const g=l("info-icon"),m=l("el-radio-button"),f=l("el-radio-group");return n(),u("div",null,[s("div",ps,[s("span",fs,a(e.$t("suno.name.vocalGender")),1),o(g,{content:e.$t("suno.description.vocalGender")},null,8,["content"])]),o(f,{modelValue:e.vocalGender,"onUpdate:modelValue":t[0]||(t[0]=$=>e.vocalGender=$),size:"small"},{default:i(()=>[o(m,{value:""},{default:i(()=>[v(a(e.$t("suno.gender.auto")),1)]),_:1}),o(m,{value:"f"},{default:i(()=>[v(a(e.$t("suno.gender.female")),1)]),_:1}),o(m,{value:"m"},{default:i(()=>[v(a(e.$t("suno.gender.male")),1)]),_:1})]),_:1},8,["modelValue"])])}const gs=E(ms,[["render",hs]]),$s=A({name:"AdvancedParams",components:{ElCollapse:xe,ElCollapseItem:Ze,ElInput:H,ElSlider:ge,ElRadioGroup:Q,ElRadioButton:te},data(){return{activeNames:[]}},computed:{config(){return this.$store.state.suno?.config},isV5OrAbove(){const e=this.config?.model||"";return["chirp-v5","chirp-v5-5"].includes(e)},styleNegative:{get(){return this.$store.state.suno?.config?.style_negative||""},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,style_negative:e||void 0})}},lyricPrompt:{get(){return this.$store.state.suno?.config?.lyric_prompt||""},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,lyric_prompt:e||void 0})}},weirdness:{get(){return this.$store.state.suno?.config?.weirdness??0},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,weirdness:e||void 0})}},styleInfluence:{get(){return this.$store.state.suno?.config?.style_influence??50},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,style_influence:e})}},variationCategory:{get(){return this.$store.state.suno?.config?.variation_category||""},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,variation_category:e||void 0})}},audioWeight:{get(){return this.$store.state.suno?.config?.audio_weight??50},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,audio_weight:e})}},lyricsMode:{get(){return this.$store.state.suno?.config?.lyrics_mode||"manual"},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,lyrics_mode:e})}}}}),_s={key:0,class:"mb-3"},vs={class:"flex items-center mb-1"},ys={class:"text-xs font-bold"},bs={key:1,class:"mb-3"},ks={class:"flex items-center mb-1"},ws={class:"text-xs font-bold"},Cs={key:2,class:"mb-3"},Vs={class:"flex items-center justify-between mb-1"},Ss={class:"text-xs font-bold"},Ts={class:"text-xs text-[var(--el-text-color-secondary)]"},As={key:3,class:"mb-3"},Ps={class:"flex items-center justify-between mb-1"},Us={class:"text-xs font-bold"},Es={class:"text-xs text-[var(--el-text-color-secondary)]"},Is={key:4,class:"mb-3"},Rs={class:"flex items-center mb-1"},Ls={class:"text-xs font-bold"},Ms={key:5,class:"mb-3"},Fs={class:"flex items-center justify-between mb-1"},zs={class:"text-xs font-bold"},js={class:"text-xs text-[var(--el-text-color-secondary)]"},Ds={key:6,class:"mb-3"},Gs={class:"flex items-center mb-1"},Bs={class:"text-xs font-bold"};function Os(e,t,d,r,p,b){const g=l("el-input"),m=l("el-slider"),f=l("el-radio-button"),$=l("el-radio-group"),k=l("el-collapse-item"),T=l("el-collapse");return n(),y(T,{modelValue:e.activeNames,"onUpdate:modelValue":t[7]||(t[7]=_=>e.activeNames=_),class:"advanced-collapse"},{default:i(()=>[o(k,{title:e.$t("suno.name.advancedParams"),name:"advanced"},{default:i(()=>[e.config?.custom?(n(),u("div",_s,[s("div",vs,[s("span",ys,a(e.$t("suno.name.styleNegative")),1)]),o(g,{modelValue:e.styleNegative,"onUpdate:modelValue":t[0]||(t[0]=_=>e.styleNegative=_),size:"small",placeholder:e.$t("suno.placeholder.styleNegative")},null,8,["modelValue","placeholder"])])):c("",!0),e.config?.custom&&!e.config?.instrumental?(n(),u("div",bs,[s("div",ks,[s("span",ws,a(e.$t("suno.name.lyricPrompt")),1)]),o(g,{modelValue:e.lyricPrompt,"onUpdate:modelValue":t[1]||(t[1]=_=>e.lyricPrompt=_),size:"small",placeholder:e.$t("suno.placeholder.lyricPrompt")},null,8,["modelValue","placeholder"])])):c("",!0),e.config?.custom?(n(),u("div",Cs,[s("div",Vs,[s("span",Ss,a(e.$t("suno.name.weirdness")),1),s("span",Ts,a(e.weirdness??0),1)]),o(m,{modelValue:e.weirdness,"onUpdate:modelValue":t[2]||(t[2]=_=>e.weirdness=_),min:0,max:100,step:1},null,8,["modelValue"])])):c("",!0),e.config?.custom?(n(),u("div",As,[s("div",Ps,[s("span",Us,a(e.$t("suno.name.styleInfluence")),1),s("span",Es,a(e.styleInfluence??50),1)]),o(m,{modelValue:e.styleInfluence,"onUpdate:modelValue":t[3]||(t[3]=_=>e.styleInfluence=_),min:0,max:100,step:1},null,8,["modelValue"])])):c("",!0),e.isV5OrAbove?(n(),u("div",Is,[s("div",Rs,[s("span",Ls,a(e.$t("suno.name.variationCategory")),1)]),o($,{modelValue:e.variationCategory,"onUpdate:modelValue":t[4]||(t[4]=_=>e.variationCategory=_),size:"small"},{default:i(()=>[o(f,{value:""},{default:i(()=>[v(a(e.$t("suno.gender.auto")),1)]),_:1}),o(f,{value:"high"},{default:i(()=>[v(a(e.$t("suno.variation.high")),1)]),_:1}),o(f,{value:"low"},{default:i(()=>[v(a(e.$t("suno.variation.low")),1)]),_:1})]),_:1},8,["modelValue"])])):c("",!0),e.config?.action==="cover"?(n(),u("div",Ms,[s("div",Fs,[s("span",zs,a(e.$t("suno.name.audioWeight")),1),s("span",js,a(e.audioWeight??50),1)]),o(m,{modelValue:e.audioWeight,"onUpdate:modelValue":t[5]||(t[5]=_=>e.audioWeight=_),min:0,max:100,step:1},null,8,["modelValue"])])):c("",!0),e.config?.custom&&!e.config?.instrumental?(n(),u("div",Ds,[s("div",Gs,[s("span",Bs,a(e.$t("suno.name.lyricsMode")),1)]),o($,{modelValue:e.lyricsMode,"onUpdate:modelValue":t[6]||(t[6]=_=>e.lyricsMode=_),size:"small"},{default:i(()=>[o(f,{value:"manual"},{default:i(()=>[v(a(e.$t("suno.lyricsMode.manual")),1)]),_:1}),o(f,{value:"auto"},{default:i(()=>[v(a(e.$t("suno.lyricsMode.auto")),1)]),_:1})]),_:1},8,["modelValue"])])):c("",!0)]),_:1},8,["title"])]),_:1},8,["modelValue"])}const Ns=E($s,[["render",Os],["__scopeId","data-v-1e19b619"]]),qs=A({name:"ReplaceSectionInput",components:{ElInputNumber:oe,ElImage:O,InfoIcon:F},computed:{audio(){return this.$store.state.suno?.config?.audio},replaceSectionStart:{get(){return this.$store.state.suno?.config?.replace_section_start},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,replace_section_start:e})}},replaceSectionEnd:{get(){return this.$store.state.suno?.config?.replace_section_end},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,replace_section_end:e})}}},methods:{onClick(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"})}}}),Hs={class:"field"},Ws={class:"flex items-center mb-2"},Ks={class:"text-sm font-bold m-0"},Js={key:0,class:"task mb-2"},Qs={class:"left relative w-[50px] h-[50px] mr-3 flex-shrink-0"},Ys={class:"info flex-1 min-w-0"},Xs={class:"text-sm font-bold m-0 truncate"},Zs={class:"text-xs text-[var(--el-text-color-secondary)] m-0 truncate"},xs={class:"flex gap-2"};function en(e,t,d,r,p,b){const g=l("info-icon"),m=l("el-image"),f=l("el-input-number"),$=q("loading");return n(),u("div",Hs,[s("div",Ws,[s("h2",Ks,a(e.$t("suno.name.replaceSection")),1),o(g,{content:e.$t("suno.description.replaceSection")},null,8,["content"])]),e.audio?(n(),u("div",Js,[s("div",{class:"audio flex items-center",onClick:t[0]||(t[0]=k=>e.onClick(e.audio))},[B((n(),u("div",Qs,[o(m,{src:e.audio?.image_url,class:"w-full h-full rounded",fit:"cover"},null,8,["src"])])),[[$,!e.audio?.audio_url]]),s("div",Ys,[s("h2",Xs,a(e.audio?.title),1),s("p",Zs,a(e.audio?.style),1)])])])):c("",!0),s("div",xs,[o(f,{modelValue:e.replaceSectionStart,"onUpdate:modelValue":t[1]||(t[1]=k=>e.replaceSectionStart=k),class:"flex-1",min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.replaceSectionStart")},null,8,["modelValue","max","placeholder"]),o(f,{modelValue:e.replaceSectionEnd,"onUpdate:modelValue":t[2]||(t[2]=k=>e.replaceSectionEnd=k),class:"flex-1",min:e.replaceSectionStart||0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.replaceSectionEnd")},null,8,["modelValue","min","max","placeholder"])])])}const tn=E(qs,[["render",en]]),on=A({name:"OverpaintingInput",components:{ElInputNumber:oe,ElImage:O,InfoIcon:F},computed:{audio(){return this.$store.state.suno?.config?.audio},overpaintingStart:{get(){return this.$store.state.suno?.config?.overpainting_start},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,overpainting_start:e})}},overpaintingEnd:{get(){return this.$store.state.suno?.config?.overpainting_end},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,overpainting_end:e})}}},methods:{onClick(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"})}}}),sn={class:"field"},nn={class:"flex items-center mb-2"},an={class:"text-sm font-bold m-0"},ln={key:0,class:"task mb-2"},rn={class:"left relative w-[50px] h-[50px] mr-3 flex-shrink-0"},dn={class:"info flex-1 min-w-0"},un={class:"text-sm font-bold m-0 truncate"},cn={class:"text-xs text-[var(--el-text-color-secondary)] m-0 truncate"},mn={class:"flex gap-2"};function pn(e,t,d,r,p,b){const g=l("info-icon"),m=l("el-image"),f=l("el-input-number"),$=q("loading");return n(),u("div",sn,[s("div",nn,[s("h2",an,a(e.$t("suno.name.overpaintingRange")),1),o(g,{content:e.$t("suno.description.overpainting")},null,8,["content"])]),e.audio?(n(),u("div",ln,[s("div",{class:"audio flex items-center",onClick:t[0]||(t[0]=k=>e.onClick(e.audio))},[B((n(),u("div",rn,[o(m,{src:e.audio?.image_url,class:"w-full h-full rounded",fit:"cover"},null,8,["src"])])),[[$,!e.audio?.audio_url]]),s("div",dn,[s("h2",un,a(e.audio?.title),1),s("p",cn,a(e.audio?.style),1)])])])):c("",!0),s("div",mn,[o(f,{modelValue:e.overpaintingStart,"onUpdate:modelValue":t[1]||(t[1]=k=>e.overpaintingStart=k),class:"flex-1",size:"small",min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.overpaintingStart")},null,8,["modelValue","max","placeholder"]),o(f,{modelValue:e.overpaintingEnd,"onUpdate:modelValue":t[2]||(t[2]=k=>e.overpaintingEnd=k),class:"flex-1",size:"small",min:e.overpaintingStart||0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.overpaintingEnd")},null,8,["modelValue","min","max","placeholder"])])])}const fn=E(on,[["render",pn]]),hn=A({name:"UnderpaintingInput",components:{ElInputNumber:oe,ElImage:O,InfoIcon:F},computed:{audio(){return this.$store.state.suno?.config?.audio},underpaintingStart:{get(){return this.$store.state.suno?.config?.underpainting_start},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,underpainting_start:e})}},underpaintingEnd:{get(){return this.$store.state.suno?.config?.underpainting_end},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,underpainting_end:e})}}},methods:{onClick(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"})}}}),gn={class:"field"},$n={class:"flex items-center mb-2"},_n={class:"text-sm font-bold m-0"},vn={key:0,class:"task mb-2"},yn={class:"left relative w-[50px] h-[50px] mr-3 flex-shrink-0"},bn={class:"info flex-1 min-w-0"},kn={class:"text-sm font-bold m-0 truncate"},wn={class:"text-xs text-[var(--el-text-color-secondary)] m-0 truncate"},Cn={class:"flex gap-2"};function Vn(e,t,d,r,p,b){const g=l("info-icon"),m=l("el-image"),f=l("el-input-number"),$=q("loading");return n(),u("div",gn,[s("div",$n,[s("h2",_n,a(e.$t("suno.name.underpaintingRange")),1),o(g,{content:e.$t("suno.description.underpainting")},null,8,["content"])]),e.audio?(n(),u("div",vn,[s("div",{class:"audio flex items-center",onClick:t[0]||(t[0]=k=>e.onClick(e.audio))},[B((n(),u("div",yn,[o(m,{src:e.audio?.image_url,class:"w-full h-full rounded",fit:"cover"},null,8,["src"])])),[[$,!e.audio?.audio_url]]),s("div",bn,[s("h2",kn,a(e.audio?.title),1),s("p",wn,a(e.audio?.style),1)])])])):c("",!0),s("div",Cn,[o(f,{modelValue:e.underpaintingStart,"onUpdate:modelValue":t[1]||(t[1]=k=>e.underpaintingStart=k),class:"flex-1",size:"small",min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.underpaintingStart")},null,8,["modelValue","max","placeholder"]),o(f,{modelValue:e.underpaintingEnd,"onUpdate:modelValue":t[2]||(t[2]=k=>e.underpaintingEnd=k),class:"flex-1",size:"small",min:e.underpaintingStart||0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.underpaintingEnd")},null,8,["modelValue","min","max","placeholder"])])])}const Sn=E(hn,[["render",Vn]]),Tn=A({name:"SamplesInput",components:{ElInputNumber:oe,ElImage:O,InfoIcon:F},computed:{audio(){return this.$store.state.suno?.config?.audio},samplesStart:{get(){return this.$store.state.suno?.config?.samples_start},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,samples_start:e})}},samplesEnd:{get(){return this.$store.state.suno?.config?.samples_end},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,samples_end:e})}}},methods:{onClick(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"})}}}),An={class:"field"},Pn={class:"flex items-center mb-2"},Un={class:"text-sm font-bold m-0"},En={key:0,class:"task mb-2"},In={class:"left relative w-[50px] h-[50px] mr-3 flex-shrink-0"},Rn={class:"info flex-1 min-w-0"},Ln={class:"text-sm font-bold m-0 truncate"},Mn={class:"text-xs text-[var(--el-text-color-secondary)] m-0 truncate"},Fn={class:"flex gap-2"};function zn(e,t,d,r,p,b){const g=l("info-icon"),m=l("el-image"),f=l("el-input-number"),$=q("loading");return n(),u("div",An,[s("div",Pn,[s("h2",Un,a(e.$t("suno.name.samplesRange")),1),o(g,{content:e.$t("suno.description.samples")},null,8,["content"])]),e.audio?(n(),u("div",En,[s("div",{class:"audio flex items-center",onClick:t[0]||(t[0]=k=>e.onClick(e.audio))},[B((n(),u("div",In,[o(m,{src:e.audio?.image_url,class:"w-full h-full rounded",fit:"cover"},null,8,["src"])])),[[$,!e.audio?.audio_url]]),s("div",Rn,[s("h2",Ln,a(e.audio?.title),1),s("p",Mn,a(e.audio?.style),1)])])])):c("",!0),s("div",Fn,[o(f,{modelValue:e.samplesStart,"onUpdate:modelValue":t[1]||(t[1]=k=>e.samplesStart=k),class:"flex-1",size:"small",min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.samplesStart")},null,8,["modelValue","max","placeholder"]),o(f,{modelValue:e.samplesEnd,"onUpdate:modelValue":t[2]||(t[2]=k=>e.samplesEnd=k),class:"flex-1",size:"small",min:e.samplesStart||0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.samplesEnd")},null,8,["modelValue","min","max","placeholder"])])])}const jn=E(Tn,[["render",zn]]),Dn=[.5,.75,1,1.25,1.5,2],Gn=A({name:"AdjustSpeedInput",components:{ElRadioGroup:Q,ElRadioButton:te,ElImage:O,InfoIcon:F},data(){return{options:Dn}},computed:{audio(){return this.$store.state.suno?.config?.audio},speed:{get(){const e=this.$store.state.suno?.config?.speed;return typeof e=="number"?e:1},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,speed:e})}}},methods:{onClick(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"})}}}),Bn={class:"field"},On={class:"flex items-center mb-2"},Nn={class:"text-sm font-bold m-0"},qn={key:0,class:"task mb-2"},Hn={class:"left relative w-[50px] h-[50px] mr-3 flex-shrink-0"},Wn={class:"info flex-1 min-w-0"},Kn={class:"text-sm font-bold m-0 truncate"},Jn={class:"text-xs text-[var(--el-text-color-secondary)] m-0 truncate"};function Qn(e,t,d,r,p,b){const g=l("info-icon"),m=l("el-image"),f=l("el-radio-button"),$=l("el-radio-group"),k=q("loading");return n(),u("div",Bn,[s("div",On,[s("h2",Nn,a(e.$t("suno.name.adjustSpeed")),1),o(g,{content:e.$t("suno.description.adjustSpeed")},null,8,["content"])]),e.audio?(n(),u("div",qn,[s("div",{class:"audio flex items-center",onClick:t[0]||(t[0]=T=>e.onClick(e.audio))},[B((n(),u("div",Hn,[o(m,{src:e.audio?.image_url,class:"w-full h-full rounded",fit:"cover"},null,8,["src"])])),[[k,!e.audio?.audio_url]]),s("div",Wn,[s("h2",Kn,a(e.audio?.title),1),s("p",Jn,a(e.audio?.style),1)])])])):c("",!0),o($,{modelValue:e.speed,"onUpdate:modelValue":t[1]||(t[1]=T=>e.speed=T),size:"small",class:"speed-group"},{default:i(()=>[(n(!0),u(M,null,z(e.options,T=>(n(),y(f,{key:T,value:T},{default:i(()=>[v(a(T)+"x",1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])])}const Yn=E(Gn,[["render",Qn],["__scopeId","data-v-ba834628"]]),Xn=A({name:"VoiceCreateDialog",components:{ElDialog:le,ElForm:tt,ElFormItem:et,ElInput:H,ElButton:G,ElRadioGroup:Q,ElRadio:He},props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue","created"],data(){return{sourceType:"song",form:{name:"",description:"",audio_id:"",audio_url:""},loading:!1}},computed:{visible:{get(){return this.modelValue},set(e){this.$emit("update:modelValue",e)}},token(){return this.$store.state.suno?.credential?.token},canSubmit(){return!(!this.form.name||this.sourceType==="song"&&!this.form.audio_id||this.sourceType==="upload"&&!this.form.audio_url)}},methods:{onClose(){this.visible=!1,this.resetForm()},resetForm(){this.form={name:"",description:"",audio_id:"",audio_url:""},this.sourceType="song"},async onSubmit(){if(this.token){this.loading=!0;try{this.sourceType==="song"?await L.persona({audio_id:this.form.audio_id,name:this.form.name,description:this.form.description},{token:this.token}):await L.voices({audio_url:this.form.audio_url,name:this.form.name,description:this.form.description},{token:this.token}),w.success(this.$t("suno.voice.createSuccess")),this.$emit("created"),this.onClose()}catch{w.error(this.$t("suno.voice.createFailed"))}finally{this.loading=!1}}}}});function Zn(e,t,d,r,p,b){const g=l("el-input"),m=l("el-form-item"),f=l("el-radio"),$=l("el-radio-group"),k=l("el-form"),T=l("el-button"),_=l("el-dialog");return n(),y(_,{modelValue:e.visible,"onUpdate:modelValue":t[5]||(t[5]=V=>e.visible=V),title:e.$t("suno.voice.createTitle"),width:"480px","close-on-click-modal":!1,onClose:e.onClose},{footer:i(()=>[o(T,{onClick:e.onClose},{default:i(()=>[v(a(e.$t("common.button.cancel")),1)]),_:1},8,["onClick"]),o(T,{type:"primary",loading:e.loading,disabled:!e.canSubmit,onClick:e.onSubmit},{default:i(()=>[v(a(e.$t("suno.voice.create")),1)]),_:1},8,["loading","disabled","onClick"])]),default:i(()=>[o(k,{"label-position":"top",class:"voice-create-form"},{default:i(()=>[o(m,{label:e.$t("suno.voice.name")},{default:i(()=>[o(g,{modelValue:e.form.name,"onUpdate:modelValue":t[0]||(t[0]=V=>e.form.name=V),placeholder:e.$t("suno.voice.namePlaceholder"),maxlength:"50"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),o(m,{label:e.$t("suno.voice.description")},{default:i(()=>[o(g,{modelValue:e.form.description,"onUpdate:modelValue":t[1]||(t[1]=V=>e.form.description=V),type:"textarea",rows:2,placeholder:e.$t("suno.voice.descriptionPlaceholder"),maxlength:"200"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),o(m,{label:e.$t("suno.voice.sourceType")},{default:i(()=>[o($,{modelValue:e.sourceType,"onUpdate:modelValue":t[2]||(t[2]=V=>e.sourceType=V),class:"w-full"},{default:i(()=>[o(f,{value:"song"},{default:i(()=>[v(a(e.$t("suno.voice.fromSong")),1)]),_:1}),o(f,{value:"upload"},{default:i(()=>[v(a(e.$t("suno.voice.fromUpload")),1)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["label"]),e.sourceType==="song"?(n(),y(m,{key:0,label:e.$t("suno.voice.audioId")},{default:i(()=>[o(g,{modelValue:e.form.audio_id,"onUpdate:modelValue":t[3]||(t[3]=V=>e.form.audio_id=V),placeholder:e.$t("suno.voice.audioIdPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])):c("",!0),e.sourceType==="upload"?(n(),y(m,{key:1,label:e.$t("suno.voice.audioUrl")},{default:i(()=>[o(g,{modelValue:e.form.audio_url,"onUpdate:modelValue":t[4]||(t[4]=V=>e.form.audio_url=V),placeholder:e.$t("suno.voice.audioUrlPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])):c("",!0)]),_:1})]),_:1},8,["modelValue","title","onClose"])}const xn=E(Xn,[["render",Zn]]),ei=A({name:"VoiceManager",components:{ElButton:G,ElIcon:x,ElTabs:pe,ElTabPane:me,ElTooltip:fe,Loading:Te,FontAwesomeIcon:j,VoiceCreateDialog:xn},data(){return{showCreateDialog:!1,loading:!1,deletingId:null,activeTab:"all"}},computed:{personas(){return this.$store.state.suno?.personas||[]},favoriteIds(){return this.$store.state.suno?.favoritePersonaIds||[]},favoritePersonas(){return this.personas.filter(e=>e.persona_id&&this.favoriteIds.includes(e.persona_id))},visiblePersonas(){return this.activeTab==="favorites"?this.favoritePersonas:this.personas},selectedPersonaId(){return this.$store.state.suno?.config?.persona_id}},watch:{"$store.state.suno.credential":{handler(){this.loadPersonas()},immediate:!0}},methods:{isFavorite(e){return!!e&&this.favoriteIds.includes(e)},onToggleFavorite(e){e.persona_id&&this.$store.commit("suno/togglePersonaFavorite",e.persona_id)},async loadPersonas(){if(this.$store.state.suno?.credential?.token){this.loading=!0;try{await this.$store.dispatch("suno/getPersonas")}finally{this.loading=!1}}},selectPersona(e){const t={...this.$store.state.suno?.config};t.persona_id===e.persona_id?t.persona_id=void 0:t.persona_id=e.persona_id,this.$store.dispatch("suno/setConfig",t)},async onDelete(e){try{await he.confirm(this.$t("suno.voice.confirmDelete"),this.$t("suno.voice.delete"),{type:"warning",confirmButtonText:this.$t("common.button.confirm"),cancelButtonText:this.$t("common.button.cancel")})}catch{return}if(!e.persona_id)return;this.deletingId=e.persona_id;const t=await this.$store.dispatch("suno/deletePersona",e.persona_id);if(this.deletingId=null,t){if(w.success(this.$t("suno.voice.deleteSuccess")),this.selectedPersonaId===e.persona_id){const d={...this.$store.state.suno?.config,persona_id:void 0};this.$store.dispatch("suno/setConfig",d)}this.favoriteIds.includes(e.persona_id)&&this.$store.commit("suno/togglePersonaFavorite",e.persona_id)}else w.error(this.$t("suno.voice.deleteFailed"))},async onCreated(){await this.loadPersonas()}}}),ti={class:"voice-manager"},oi={class:"flex items-center justify-between mb-3"},si={class:"text-sm font-medium"},ni={key:0,class:"text-center py-6"},ii={key:1,class:"text-center py-6 text-gray-400 text-sm"},ai={key:2,class:"voice-list"},li=["onClick"],ri={class:"flex-1 min-w-0"},di={class:"voice-name"},ui={key:0,class:"voice-desc"};function ci(e,t,d,r,p,b){const g=l("font-awesome-icon"),m=l("el-button"),f=l("el-tab-pane"),$=l("el-tabs"),k=l("loading"),T=l("el-icon"),_=l("el-tooltip"),V=l("voice-create-dialog");return n(),u("div",ti,[s("div",oi,[s("span",si,a(e.$t("suno.voice.title")),1),o(m,{type:"primary",size:"small",onClick:t[0]||(t[0]=C=>e.showCreateDialog=!0)},{default:i(()=>[o(g,{icon:"fa-solid fa-plus",class:"mr-1"}),v(" "+a(e.$t("suno.voice.create")),1)]),_:1})]),o($,{modelValue:e.activeTab,"onUpdate:modelValue":t[1]||(t[1]=C=>e.activeTab=C),class:"voice-tabs",size:"small"},{default:i(()=>[o(f,{name:"all",label:e.$t("suno.voice.tabAll")+" ("+(e.personas?.length||0)+")"},null,8,["label"]),o(f,{name:"favorites",label:e.$t("suno.voice.tabFavorites")+" ("+e.favoritePersonas.length+")"},null,8,["label"])]),_:1},8,["modelValue"]),e.loading?(n(),u("div",ni,[o(T,{class:"is-loading"},{default:i(()=>[o(k)]),_:1})])):e.visiblePersonas.length===0?(n(),u("div",ii,a(e.activeTab==="favorites"?e.$t("suno.voice.emptyFavorites"):e.$t("suno.voice.empty")),1)):(n(),u("div",ai,[(n(!0),u(M,null,z(e.visiblePersonas,C=>(n(),u("div",{key:C.persona_id,class:K(["voice-item",{active:e.selectedPersonaId===C.persona_id}]),onClick:I=>e.selectPersona(C)},[s("div",ri,[s("div",di,[o(g,{icon:C.source_type==="voice"?"fa-solid fa-microphone":"fa-solid fa-music",class:"mr-1.5 text-xs opacity-60"},null,8,["icon"]),v(" "+a(C.name||C.persona_id),1)]),C.description?(n(),u("div",ui,a(C.description),1)):c("",!0)]),s("div",{class:"voice-actions",onClick:t[2]||(t[2]=U(()=>{},["stop"]))},[o(_,{content:e.isFavorite(C.persona_id)?e.$t("suno.voice.unfavorite"):e.$t("suno.voice.favorite"),placement:"top"},{default:i(()=>[o(m,{size:"small",text:"",class:K({"voice-fav-active":e.isFavorite(C.persona_id)}),onClick:I=>e.onToggleFavorite(C)},{default:i(()=>[o(g,{icon:e.isFavorite(C.persona_id)?"fa-solid fa-star":"fa-regular fa-star"},null,8,["icon"])]),_:2},1032,["class","onClick"])]),_:2},1032,["content"]),o(m,{type:"danger",size:"small",text:"",loading:e.deletingId===C.persona_id,onClick:I=>e.onDelete(C)},{default:i(()=>[o(g,{icon:"fa-solid fa-trash"})]),_:1},8,["loading","onClick"])])],10,li))),128))])),o(V,{modelValue:e.showCreateDialog,"onUpdate:modelValue":t[3]||(t[3]=C=>e.showCreateDialog=C),onCreated:e.onCreated},null,8,["modelValue","onCreated"])])}const mi=E(ei,[["render",ci],["__scopeId","data-v-8b8e36d9"]]),pi=A({name:"PersonaInput",components:{ElSelect:ce,ElOption:ue,ElButton:G,ElDrawer:Se,FontAwesomeIcon:j,InfoIcon:F,VoiceManager:mi},data(){return{showManager:!1}},computed:{personaId:{get(){return this.$store.state.suno?.config?.persona_id||""},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,persona_id:e||void 0})}},personas(){return this.$store.state.suno?.personas||[]}}}),fi={class:"field"},hi={class:"flex items-center justify-between mb-2"},gi={class:"flex items-center"},$i={class:"text-sm font-bold"},_i={class:"flex items-center justify-between w-full"},vi={key:0,class:"text-xs text-gray-400 ml-2"};function yi(e,t,d,r,p,b){const g=l("info-icon"),m=l("font-awesome-icon"),f=l("el-button"),$=l("el-option"),k=l("el-select"),T=l("voice-manager"),_=l("el-drawer");return n(),u("div",fi,[s("div",hi,[s("div",gi,[s("span",$i,a(e.$t("suno.name.persona")),1),o(g,{content:e.$t("suno.description.persona")},null,8,["content"])]),o(f,{size:"small",round:"",onClick:t[0]||(t[0]=V=>e.showManager=!0)},{default:i(()=>[o(m,{icon:"fa-solid fa-microphone",class:"mr-1"}),v(" "+a(e.$t("suno.voice.manage")),1)]),_:1})]),o(k,{modelValue:e.personaId,"onUpdate:modelValue":t[1]||(t[1]=V=>e.personaId=V),placeholder:e.$t("suno.placeholder.personaId"),clearable:"",filterable:"",class:"w-full"},{default:i(()=>[(n(!0),u(M,null,z(e.personas,V=>(n(),y($,{key:V.persona_id||"",value:V.persona_id||"",label:V.name||V.persona_id||""},{default:i(()=>[s("div",_i,[s("span",null,a(V.name||V.persona_id),1),V.source_type?(n(),u("span",vi,a(V.source_type),1)):c("",!0)])]),_:2},1032,["value","label"]))),128))]),_:1},8,["modelValue","placeholder"]),o(_,{modelValue:e.showManager,"onUpdate:modelValue":t[2]||(t[2]=V=>e.showManager=V),title:e.$t("suno.voice.title"),size:"380px",direction:"rtl"},{default:i(()=>[o(T)]),_:1},8,["modelValue","title"])])}const bi=E(pi,[["render",yi]]),ki=A({name:"PresetPanel",components:{TypeSelector:Tt,PromptInput:ao,LyricInput:ko,StyleInput:Lo,TitleInput:Go,ExtendFromInput:xo,CoverFromInput:cs,UploadAudio:Yt,VocalGenderSelector:gs,AdvancedParams:Ns,ReplaceSectionInput:tn,OverpaintingInput:fn,UnderpaintingInput:Sn,SamplesInput:jn,AdjustSpeedInput:Yn,PersonaInput:bi,FontAwesomeIcon:j,ElButton:G,ElTabs:pe,ElTabPane:me,Consumption:ot},emits:["generate"],computed:{config(){return this.$store.state.suno?.config},mode:{get(){return this.$store.state.suno?.config?.custom?"custom":"simple"},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,custom:e==="custom"})}},consumption(){return st(this.config,this.service?.cost)},service(){return this.$store.state.suno?.service},supportsVocalGender(){const e=this.config?.model||"";return["chirp-v4-5-plus","chirp-v5","chirp-v5-5"].includes(e)},supportsPersona(){const e=this.config?.action;return!e||e==="generate"||e==="artist_consistency"||e==="artist_consistency_vox"},generateButtonText(){const e=this.config?.action;return e==="extend"?this.$t("suno.button.extend"):e==="cover"?this.$t("suno.button.cover_music"):e==="remaster"?this.$t("suno.button.remaster"):e==="replace_section"?this.$t("suno.button.replace_section"):e==="mashup"?this.$t("suno.button.mashup"):e==="stems"?this.$t("suno.button.get_stems"):e==="concat"?this.$t("suno.button.concat_music"):e==="upload_cover"?this.$t("suno.button.upload_cover"):e==="artist_consistency"?this.$t("suno.button.artist_consistency"):e==="artist_consistency_vox"?this.$t("suno.button.artist_consistency_vox"):e==="overpainting"?this.$t("suno.button.overpainting"):e==="underpainting"?this.$t("suno.button.underpainting"):e==="samples"?this.$t("suno.button.samples"):e==="adjust_speed"?this.$t("suno.button.adjust_speed"):this.$t("suno.button.generate")}},methods:{onGenerate(){this.$emit("generate")},onClearAll(){this.$store.commit("suno/setConfig",{custom:!1,sounds:!1,instrumental:!1,lyric:"",style:"",title:"",lyrics_mode:"manual",model:this.$store.state.suno?.config?.model})}}}),wi={class:"flex flex-col h-full"},Ci={class:"flex-1 overflow-y-auto p-5"},Vi={class:"pt-2 px-1"},Si={class:"pt-2 px-1"},Ti={class:"flex flex-col items-center justify-center px-5 pb-5 gap-2"},Ai={class:"flex gap-2 w-full"};function Pi(e,t,d,r,p,b){const g=l("type-selector"),m=l("upload-audio"),f=l("prompt-input"),$=l("extend-from-input"),k=l("cover-from-input"),T=l("replace-section-input"),_=l("overpainting-input"),V=l("underpainting-input"),C=l("samples-input"),I=l("adjust-speed-input"),P=l("advanced-params"),W=l("el-tab-pane"),J=l("lyric-input"),Y=l("style-input"),h=l("title-input"),S=l("vocal-gender-selector"),ie=l("persona-input"),R=l("el-tabs"),ae=l("consumption"),$e=l("font-awesome-icon"),_e=l("el-button");return n(),u("div",wi,[s("div",Ci,[o(R,{modelValue:e.mode,"onUpdate:modelValue":t[0]||(t[0]=Re=>e.mode=Re),class:"suno-mode-tabs",stretch:""},{default:i(()=>[o(W,{label:e.$t("suno.mode.simple"),name:"simple"},{default:i(()=>[s("div",Vi,[o(g,{class:"mb-4"}),o(m,{class:"mb-4"}),o(f,{class:"mb-4"}),e.config?.action==="extend"?(n(),y($,{key:0,class:"mb-4"})):c("",!0),e.config?.action==="cover"?(n(),y(k,{key:1,class:"mb-4"})):c("",!0),e.config?.action==="replace_section"?(n(),y(T,{key:2,class:"mb-4"})):c("",!0),e.config?.action==="overpainting"?(n(),y(_,{key:3,class:"mb-4"})):c("",!0),e.config?.action==="underpainting"?(n(),y(V,{key:4,class:"mb-4"})):c("",!0),e.config?.action==="samples"?(n(),y(C,{key:5,class:"mb-4"})):c("",!0),e.config?.action==="adjust_speed"?(n(),y(I,{key:6,class:"mb-4"})):c("",!0),o(P,{class:"mb-4"})])]),_:1},8,["label"]),o(W,{label:e.$t("suno.mode.custom"),name:"custom"},{default:i(()=>[s("div",Si,[o(g,{class:"mb-4"}),o(m,{class:"mb-4"}),e.config?.instrumental?c("",!0):(n(),y(J,{key:0,class:"mb-4"})),o(Y,{class:"mb-4"}),o(h,{class:"mb-4"}),!e.config?.instrumental&&e.supportsVocalGender?(n(),y(S,{key:1,class:"mb-4"})):c("",!0),e.supportsPersona?(n(),y(ie,{key:2,class:"mb-4"})):c("",!0),e.config?.action==="extend"?(n(),y($,{key:3,class:"mb-4"})):c("",!0),e.config?.action==="cover"?(n(),y(k,{key:4,class:"mb-4"})):c("",!0),e.config?.action==="replace_section"?(n(),y(T,{key:5,class:"mb-4"})):c("",!0),e.config?.action==="overpainting"?(n(),y(_,{key:6,class:"mb-4"})):c("",!0),e.config?.action==="underpainting"?(n(),y(V,{key:7,class:"mb-4"})):c("",!0),e.config?.action==="samples"?(n(),y(C,{key:8,class:"mb-4"})):c("",!0),e.config?.action==="adjust_speed"?(n(),y(I,{key:9,class:"mb-4"})):c("",!0),o(P,{class:"mb-4"})])]),_:1},8,["label"])]),_:1},8,["modelValue"])]),s("div",Ti,[o(ae,{value:e.consumption,service:e.service},null,8,["value","service"]),s("div",Ai,[o(_e,{class:"flex-1",onClick:e.onClearAll},{default:i(()=>[o($e,{icon:"fa-solid fa-broom",class:"mr-1"}),v(" "+a(e.$t("suno.button.clear_all")),1)]),_:1},8,["onClick"]),o(_e,{type:"primary",class:"flex-1",round:"",onClick:e.onGenerate},{default:i(()=>[o($e,{icon:"fa-solid fa-magic",class:"mr-2"}),v(" "+a(e.generateButtonText),1)]),_:1},8,["onClick"])])])])}const Ui=E(ki,[["render",Pi],["__scopeId","data-v-c62324e6"]]),Ve=Ae("suno"),Ei=A({name:"TaskPreview",components:{ElImage:O,ElIcon:x,ElTooltip:fe,FontAwesomeIcon:j,VideoPlay:de,VideoPause:re,ElDropdown:Ee,ElDropdownMenu:Ue,ElDropdownItem:Pe,ElInput:H,ElProgress:it,ElCheckbox:nt,Loading:Te},props:{modelValue:{type:Object,required:!0}},data(){return{isFetchingVideoUrl:!1,isFetchingWav:!1,isFetchingMidi:!1,editingAudioId:null,editingTitle:""}},computed:{loading(){return this.$store.state.suno?.status?.getApplications===X.Request},credential(){return this.$store.state.suno.credential},config(){return this.$store.state.suno.config},task(){return this.$store.state.suno?.tasks},audios(){const e=this.modelValue?.response?.data??[],t=this.modelValue?.request?.action;return t?e.map(d=>({...d,action:t})):e},application(){return this.$store.state.suno?.application},active(){return this.$store.state.suno?.tasks?.active},isMashupMode(){return this.$store.state.suno?.config?.action==="mashup"},mashupAudioIds(){return this.$store.state.suno?.config?.mashup_audio_ids||[]}},methods:{useFormatDuring:Z,onPlay(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){this.$store.state?.suno?.audio?.id!==e.id&&this.onPlay({...e,progress:0})},onExtend(e,t){e.stopPropagation(),console.log("on extend"),console.debug("set config",t),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.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&&e.stopPropagation(),console.log("on download",t);const r=new URL(t).pathname,p=r.substring(r.lastIndexOf("/")+1);console.log("on preview",p),fetch(t).then(b=>b.blob()).then(b=>{ve.saveAs(b,p)})},async handleVideoDownload(e){if(e.video_url){this.onDownload(null,e.video_url);return}if(!this.isFetchingVideoUrl)try{this.isFetchingVideoUrl=!0;const t=await this.fetchVideoUrlFromApi(e?.id);console.log(`get videoUrl: ${t}`),e.video_url=t,this.onDownload(null,t)}catch(t){console.error("get videoUrl failed:",t),w.error(this.$t("suno.message.getVideoUrlFailed"))}finally{this.isFetchingVideoUrl=!1}},async fetchVideoUrlFromApi(e){return new Promise((t,d)=>{const r={audio_id:e},p=this.credential?.token;if(!p){console.error("no token specified"),d(new Error("No token specified"));return}L.mp4(r,{token:p}).then(b=>{const g=b.data?.data?.video_url;g?t(g):d(new Error("Video URL not found in response"))}).catch(b=>{d(b)})})},onPreview(e,t){e.stopPropagation(),console.log("on preview",t),window.open(t,"_blank")},async onGetStems(e){await this.onGenerateAudioUrl("stems",e)},onCover(e){console.log("on cover"),console.debug("set config",e),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:e.model,custom:!0,instrumental:!1,style:e.style,action:"cover",audio:e,audio_id:e.id})},async onConcatMusic(e){await this.onGenerateAudioUrl("concat",e)},async onRemaster(e){await this.onGenerateAudioUrl("remaster",e)},async onGetAllStems(e){await this.onGenerateAudioUrl("all_stems",e)},onReplaceSection(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:e.model,custom:!0,instrumental:!1,style:e.style,action:"replace_section",audio:e,audio_id:e.id,replace_section_start:0,replace_section_end:Math.min(30,e.duration||30)})},onMashup(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:"mashup",audio:e,audio_id:e.id,mashup_audio_ids:[e.id]})},onOverpainting(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:"overpainting",audio:e,audio_id:e.id,overpainting_start:0,overpainting_end:Math.min(30,e.duration||30)})},onUnderpainting(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:"underpainting",audio:e,audio_id:e.id,underpainting_start:0,underpainting_end:Math.min(30,e.duration||30)})},onSamples(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:"samples",audio:e,audio_id:e.id,samples_start:0,samples_end:Math.min(30,e.duration||30)})},onArtistConsistency(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:"artist_consistency",audio:e,audio_id:e.id})},onAdjustSpeed(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:"adjust_speed",audio:e,audio_id:e.id,speed:1})},onReusePrompt(e){const t=this.modelValue?.request??{};if(!(t.prompt||t.lyric||t.style||t.title||t.lyric_prompt||t.style_negative||t.persona_id)){w.warning(this.$t("suno.message.reusePromptEmpty"));return}this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:t.model??e.model,custom:t.custom??!1,instrumental:t.instrumental??!1,prompt:t.prompt??"",lyric:t.lyric??"",lyric_prompt:t.lyric_prompt??"",lyrics_mode:t.lyrics_mode??"manual",title:t.title??"",style:t.style??"",style_negative:t.style_negative??"",vocal_gender:t.vocal_gender,weirdness:t.weirdness,style_influence:t.style_influence,variation_category:t.variation_category,audio_weight:t.audio_weight,persona_id:t.persona_id,action:void 0,audio:void 0,audio_id:void 0,mashup_audio_ids:void 0,continue_at:void 0,speed:void 0,replace_section_start:void 0,replace_section_end:void 0,overpainting_start:void 0,overpainting_end:void 0,underpainting_start:void 0,underpainting_end:void 0,samples_start:void 0,samples_end:void 0}),w.success(this.$t("suno.message.reusePromptSuccess"))},async onExtractVocals(e){const t=this.credential?.token;t&&(w.info(this.$t("suno.message.extractingVocals")),L.vox({audio_id:e,callback_url:Ve},{token:t}).then(()=>{w.success(this.$t("suno.message.extractVocalsSuccess"))}).catch(d=>{w.error(d?.response?.data?.error?.message||this.$t("suno.message.extractVocalsFailed"))}).finally(async()=>{await this.onGetTasks(),await this.onScrollDown()}))},async onGetTiming(e){const t=this.credential?.token;t&&(w.info(this.$t("suno.message.fetchingTiming")),L.timing({audio_id:e},{token:t}).then(d=>{w.success(this.$t("suno.message.fetchTimingSuccess")),console.debug("timing data",d.data)}).catch(d=>{w.error(d?.response?.data?.error?.message||this.$t("suno.message.fetchTimingFailed"))}))},async handleWavDownload(e){if(!e?.id||this.isFetchingWav)return;const t=this.credential?.token;if(t)try{this.isFetchingWav=!0,w.info(this.$t("suno.message.fetchingWav"));const r=(await L.wav({audio_id:e.id},{token:t})).data?.data?.[0]?.file_url;r?this.onDownload(null,r):w.error(this.$t("suno.message.fetchWavFailed"))}catch(d){const r=d?.response?.data?.error?.message;w.error(r||this.$t("suno.message.fetchWavFailed"))}finally{this.isFetchingWav=!1}},async handleMidiDownload(e){if(!e?.id||this.isFetchingMidi)return;const t=this.credential?.token;if(t)try{this.isFetchingMidi=!0,w.info(this.$t("suno.message.fetchingMidi"));const r=(await L.midi({audio_id:e.id},{token:t})).data?.data;if(!r?.length){w.error(this.$t("suno.message.fetchMidiFailed"));return}const p=(e.title||e.id||"suno").replace(/[^\w.-]+/g,"_")+".json",b=new Blob([JSON.stringify(r,null,2)],{type:"application/json"});ve.saveAs(b,p)}catch(d){const r=d?.response?.data?.error?.message;w.error(r||this.$t("suno.message.fetchMidiFailed"))}finally{this.isFetchingMidi=!1}},async onGenerateAudioUrl(e,t){const d={action:e,audio_id:t,callback_url:Ve},r=this.credential?.token;if(!r){console.error("no token specified");return}w.info(this.$t("suno.message.startingTask")),L.audio(d,{token:r}).then(()=>{w.success(this.$t("suno.message.startTaskSuccess"))}).catch(p=>{w.error(p?.response?.data?.error?.message||this.$t("suno.message.startTaskFailed"))}).finally(async()=>{await this.onGetTasks(),await this.onScrollDown()})},isMashupSelected(e){return!!e.id&&this.mashupAudioIds.includes(e.id)},onToggleMashup(e){if(!e.id)return;const t=[...this.mashupAudioIds],d=t.indexOf(e.id);d!==-1?t.splice(d,1):t.push(e.id),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,mashup_audio_ids:t})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".tasks");e&&(e.scrollTop=e.scrollHeight)},1e3)},onStartTitleEdit(e){this.editingAudioId=e.id??null,this.editingTitle=e.title||"",this.$nextTick(()=>{this.$refs.titleInput?.focus?.()})},onSaveTitleEdit(e){if(this.editingAudioId!==e.id)return;const t=this.editingTitle.trim();if(t&&t!==e.title){const d=this.$store.state.suno?.tasks;if(d?.items)for(const r of d.items){const b=(r?.response?.data??[]).find(g=>g.id===e.id);if(b){b.title=t;break}}}this.editingAudioId=null,this.editingTitle=""},onCancelTitleEdit(){this.editingAudioId=null,this.editingTitle=""},async onDelete(e){try{await he.confirm(this.$t("suno.message.confirmDelete"),{confirmButtonText:this.$t("suno.button.delete"),cancelButtonText:this.$t("common.button.cancel"),type:"warning"})}catch{return}const t=this.$store.state.suno?.tasks;if(t?.items)for(const d of t.items){const r=d?.response?.data??[],p=r.findIndex(b=>b.id===e.id);if(p!==-1){if(r.splice(p,1),r.length===0){const b=t.items.indexOf(d);b!==-1&&t.items.splice(b,1)}break}}this.$store.state?.suno?.audio?.id===e.id&&this.$store.dispatch("suno/setAudio",null),w.success(this.$t("suno.message.deleteSuccess"))},async onGetTasks(){if(this.loading){console.debug("loading");return}await this.$store.dispatch("suno/getTasks",{limit:30,offset:0})}}}),Ii={class:"task"},Ri=["onClick"],Li=["onClick"],Mi={class:"left"},Fi=["onClick"],zi=["onClick"],ji={key:2,class:"duration"},Di={class:"info"},Gi={key:1,class:"title-row"},Bi={class:"title"},Oi={class:"style"},Ni={key:2,class:"progress-row"},qi={class:"progress-text"},Hi={class:"right"},Wi={class:"el-dropdown-link"},Ki={class:"flex items-center min-w-[120px]"},Ji={class:"flex items-center min-w-[120px]"},Qi={class:"flex items-center min-w-[120px]"},Yi={class:"el-dropdown-link"};function Xi(e,t,d,r,p,b){const g=l("el-checkbox"),m=l("el-image"),f=l("video-pause"),$=l("el-icon"),k=l("video-play"),T=l("el-input"),_=l("font-awesome-icon"),V=l("el-progress"),C=l("el-tooltip"),I=l("Loading"),P=l("el-dropdown-item"),W=l("el-dropdown-menu"),J=l("el-dropdown"),Y=q("loading");return n(),u("div",Ii,[(n(!0),u(M,null,z(e.audios,h=>(n(),u("div",{key:h.id,class:K(["audio",{"mashup-selected":e.isMashupSelected(h)}]),onClick:U(S=>e.onClick(h),["stop"])},[e.isMashupMode&&h?.audio_url?(n(),u("div",{key:0,class:"mashup-check",onClick:U(S=>e.onToggleMashup(h),["stop"])},[o(g,{"model-value":e.isMashupSelected(h),onClick:t[0]||(t[0]=U(()=>{},["stop"]))},null,8,["model-value"])],8,Li)):c("",!0),B((n(),u("div",Mi,[o(m,{src:h?.image_url,class:"cover",fit:"cover",lazy:""},null,8,["src"]),h?.audio_url&&e.$store.state?.suno?.audio?.id===h.id&&e.$store.state?.suno?.audio?.state==="playing"?(n(),u("div",{key:0,class:"overlay",onClick:U(S=>e.onPause(h),["stop"])},[o($,null,{default:i(()=>[o(f)]),_:1})],8,Fi)):c("",!0),h?.audio_url&&(e.$store.state?.suno?.audio?.id!==h.id||e.$store.state?.suno?.audio?.id===h.id&&e.$store.state?.suno?.audio?.state==="paused")?(n(),u("div",{key:1,class:"overlay",onClick:U(S=>e.onPlay(h),["stop"])},[o($,null,{default:i(()=>[o(k)]),_:1})],8,zi)):c("",!0),h?.duration?(n(),u("div",ji,a(e.useFormatDuring(h?.duration)),1)):c("",!0)])),[[Y,!h?.audio_url]]),s("div",Di,[e.editingAudioId===h.id?(n(),u("div",{key:0,class:"title-edit",onClick:t[2]||(t[2]=U(()=>{},["stop"]))},[o(T,{ref_for:!0,ref:"titleInput",modelValue:e.editingTitle,"onUpdate:modelValue":t[1]||(t[1]=S=>e.editingTitle=S),size:"small",onKeyup:[ne(S=>e.onSaveTitleEdit(h),["enter"]),ne(e.onCancelTitleEdit,["escape"])],onBlur:S=>e.onSaveTitleEdit(h)},null,8,["modelValue","onKeyup","onBlur"])])):(n(),u("div",Gi,[s("h2",Bi,a(h?.title),1),h?.audio_url?(n(),y(_,{key:0,icon:"fa-solid fa-pen",class:"edit-icon",onClick:U(S=>e.onStartTitleEdit(h),["stop"])},null,8,["onClick"])):c("",!0)])),s("p",Oi,a(h?.style),1),!h?.audio_url&&h?.progress!=null&&h?.progress<100?(n(),u("div",Ni,[o(V,{percentage:Math.round(h.progress),"stroke-width":4,"show-text":!1,status:"warning",class:"progress-bar"},null,8,["percentage"]),s("span",qi,a(e.$t("suno.name.generating"))+" "+a(Math.round(h.progress))+"%",1)])):c("",!0)]),s("div",Hi,[o(J,null,{dropdown:i(()=>[o(W,null,{default:i(()=>[o(P,{disabled:e.isFetchingVideoUrl,onClick:S=>e.handleVideoDownload(h)},{default:i(()=>[s("div",Ki,[e.isFetchingVideoUrl?(n(),y($,{key:0,class:"is-loading mr-2"},{default:i(()=>[o(I)]),_:1})):c("",!0),s("span",null,a(e.$t("suno.button.download_video")),1)])]),_:1},8,["disabled","onClick"]),h?.audio_url?(n(),y(P,{key:0,onClick:U(S=>e.onDownload(S,h?.audio_url),["stop"])},{default:i(()=>[v(a(e.$t("suno.button.download_audio")),1)]),_:1},8,["onClick"])):c("",!0),o(P,{disabled:e.isFetchingWav,onClick:S=>e.handleWavDownload(h)},{default:i(()=>[s("div",Ji,[e.isFetchingWav?(n(),y($,{key:0,class:"is-loading mr-2"},{default:i(()=>[o(I)]),_:1})):c("",!0),s("span",null,a(e.$t("suno.button.download_wav")),1)])]),_:1},8,["disabled","onClick"]),o(P,{disabled:e.isFetchingMidi,onClick:S=>e.handleMidiDownload(h)},{default:i(()=>[s("div",Qi,[e.isFetchingMidi?(n(),y($,{key:0,class:"is-loading mr-2"},{default:i(()=>[o(I)]),_:1})):c("",!0),s("span",null,a(e.$t("suno.button.download_midi")),1)])]),_:1},8,["disabled","onClick"])]),_:2},1024)]),default:i(()=>[s("span",Wi,[o(C,{effect:"dark",content:e.$t("suno.button.download"),placement:"top"},{default:i(()=>[h?.audio_url||h?.video_url?(n(),y(_,{key:0,icon:"fa-solid fa-download",class:"icon icon-download"})):c("",!0)]),_:2},1032,["content"])])]),_:2},1024),o(J,null,{dropdown:i(()=>[o(W,{class:"suno-action-menu"},{default:i(()=>[h?.audio_url?(n(),y(P,{key:0,onClick:U(S=>e.onExtend(S,h),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-forward",class:"menu-icon"}),v(" "+a(e.$t("suno.button.extend")),1)]),_:1},8,["onClick"])):c("",!0),o(P,{onClick:U(S=>e.onCover(h),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-music",class:"menu-icon"}),v(" "+a(e.$t("suno.button.cover_music")),1)]),_:1},8,["onClick"]),h?.id?(n(),y(P,{key:1,onClick:U(S=>e.onMashup(h),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-shuffle",class:"menu-icon"}),v(" "+a(e.$t("suno.button.mashup")),1)]),_:1},8,["onClick"])):c("",!0),h?.id&&h?.action==="extend"?(n(),y(P,{key:2,onClick:U(S=>e.onConcatMusic(h?.id),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-link",class:"menu-icon"}),v(" "+a(e.$t("suno.button.concat_music")),1)]),_:1},8,["onClick"])):c("",!0),t[3]||(t[3]=s("div",{class:"menu-divider"},null,-1)),h?.id?(n(),y(P,{key:3,onClick:U(S=>e.onReplaceSection(h),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-scissors",class:"menu-icon"}),v(" "+a(e.$t("suno.button.replace_section")),1)]),_:1},8,["onClick"])):c("",!0),h?.id?(n(),y(P,{key:4,onClick:U(S=>e.onOverpainting(h),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-microphone",class:"menu-icon"}),v(" "+a(e.$t("suno.button.overpainting")),1)]),_:1},8,["onClick"])):c("",!0),h?.id?(n(),y(P,{key:5,onClick:U(S=>e.onUnderpainting(h),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-guitar",class:"menu-icon"}),v(" "+a(e.$t("suno.button.underpainting")),1)]),_:1},8,["onClick"])):c("",!0),h?.id?(n(),y(P,{key:6,onClick:U(S=>e.onSamples(h),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-drum",class:"menu-icon"}),v(" "+a(e.$t("suno.button.samples")),1)]),_:1},8,["onClick"])):c("",!0),t[4]||(t[4]=s("div",{class:"menu-divider"},null,-1)),h.id?(n(),y(P,{key:7,onClick:U(S=>e.onGetStems(h.id),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-layer-group",class:"menu-icon"}),v(" "+a(e.$t("suno.button.get_stems")),1)]),_:1},8,["onClick"])):c("",!0),h.id?(n(),y(P,{key:8,onClick:U(S=>e.onGetAllStems(h.id),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-bars-staggered",class:"menu-icon"}),v(" "+a(e.$t("suno.button.all_stems")),1)]),_:1},8,["onClick"])):c("",!0),h?.id?(n(),y(P,{key:9,onClick:U(S=>e.onRemaster(h.id),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-wand-magic-sparkles",class:"menu-icon"}),v(" "+a(e.$t("suno.button.remaster")),1)]),_:1},8,["onClick"])):c("",!0),h?.id?(n(),y(P,{key:10,onClick:U(S=>e.onExtractVocals(h.id),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-headphones",class:"menu-icon"}),v(" "+a(e.$t("suno.button.extract_vocals")),1)]),_:1},8,["onClick"])):c("",!0),h?.id?(n(),y(P,{key:11,onClick:U(S=>e.onArtistConsistency(h),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-palette",class:"menu-icon"}),v(" "+a(e.$t("suno.button.artist_consistency")),1)]),_:1},8,["onClick"])):c("",!0),h?.id?(n(),y(P,{key:12,onClick:U(S=>e.onAdjustSpeed(h),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-gauge-high",class:"menu-icon"}),v(" "+a(e.$t("suno.button.adjust_speed")),1)]),_:1},8,["onClick"])):c("",!0),t[5]||(t[5]=s("div",{class:"menu-divider"},null,-1)),o(P,{onClick:U(S=>e.onReusePrompt(h),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-rotate-left",class:"menu-icon"}),v(" "+a(e.$t("suno.button.reuse_prompt")),1)]),_:1},8,["onClick"]),h?.id?(n(),y(P,{key:13,onClick:U(S=>e.onGetTiming(h.id),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-clock",class:"menu-icon"}),v(" "+a(e.$t("suno.button.get_timing")),1)]),_:1},8,["onClick"])):c("",!0),t[6]||(t[6]=s("div",{class:"menu-divider"},null,-1)),h?.id?(n(),y(P,{key:14,class:"delete-item",onClick:U(S=>e.onDelete(h),["stop"])},{default:i(()=>[o(_,{icon:"fa-solid fa-trash",class:"menu-icon delete-icon"}),v(" "+a(e.$t("suno.button.delete")),1)]),_:1},8,["onClick"])):c("",!0)]),_:2},1024)]),default:i(()=>[s("span",Yi,[o(C,{effect:"dark",content:e.$t("suno.button.more"),placement:"top"},{default:i(()=>[h?.audio_url||h?.video_url?(n(),y(_,{key:0,icon:"fa-solid fa-ellipsis",class:"icon icon-ellipsis"})):c("",!0)]),_:2},1032,["content"])])]),_:2},1024)])],10,Ri))),128))])}const Zi=E(Ei,[["render",Xi]]),xi={class:"player-slider"},ea=A({__name:"PlayerSlider",setup(e){const t=ee(),d=N({get:()=>t.state.suno?.audio?.progress,set:g=>t.commit("suno/setAudio",{...t.state.suno.audio,progress:g})}),r=N({get:()=>t.state.suno?.audio?.duration,set:g=>t.commit("suno/setAudio",{...t.state.suno.audio,duration:g})}),p=()=>{},b=g=>t.dispatch("suno/setAudio",{...t.state.suno.audio,progress:g});return(g,m)=>(n(),u("div",xi,[o(D(ge),{modelValue:d.value,"onUpdate:modelValue":m[0]||(m[0]=f=>d.value=f),"show-tooltip":!1,min:0,max:r.value,onChange:b,onInput:p},null,8,["modelValue","max"])]))}}),ta={class:"flex player-song"},oa=["src"],sa={class:"ml-2 text-xs flex flex-col justify-between"},na={class:"w-52 2xl:w-96 cursor-pointer truncate"},ia={class:"flex"},aa={class:"ml-2 text-dc"},la=A({__name:"PlayerSong",setup(e){const t=ee(),d=N({get:()=>t.state.suno.audio,set:r=>t.commit("suno/setAudio",r)});return Le(d,(r,p)=>{if(r?.audio_url!==p?.audio_url){console.log("audio changed",r),r.object&&(console.log("111",r.object),r.object.pause(),delete r.object);const b=new Audio(r.audio_url);r.state==="playing"?b.play():b.pause(),b.addEventListener("loadedmetadata",()=>{b.currentTime=0,b.addEventListener("timeupdate",()=>{t.commit("suno/setAudio",{...t.state.suno.audio,progress:b.currentTime})})}),t.commit("suno/setAudio",{...t.state.suno.audio,object:b})}else if(r?.progress!==p?.progress&&Math.abs(r.progress-r.object.currentTime)>2){console.log("progress changed",r.progress);const b=t.state.suno.audio;b.object&&(b.object.currentTime=b.progress)}else r?.state!==p?.state&&(console.log("state changed",r.state),r.object&&(r.state==="playing"?r.object.play():r.object.pause()));r?.volume!==p?.volume&&(console.log("volume changed",r.volume),r.object&&(r.object.volume=r.volume/100))}),(r,p)=>(n(),u("div",ta,[s("img",{alt:"",class:"w-11 h-11 rounded",src:d.value?.image_url||D(Ke)},null,8,oa),s("div",sa,[s("div",na,[s("div",ia,[s("span",null,a(d.value?.title||"Music"),1),s("span",aa,"- "+a(d.value?.style||"SmallRuralDog"),1)])])])]))}}),ra={class:"flex justify-end items-center gap-x-2.5"},da={class:"text-xs"},ua=A({__name:"PlayerAction",setup(e){const t=ee(),d=N({get:()=>t.state.suno?.audio?.progress,set:p=>t.commit("suno/setAudio",{...t.state.suno.audio,progress:p})}),r=N({get:()=>t.state.suno?.audio?.duration,set:p=>t.commit("suno/setAudio",{...t.state.suno.audio,duration:p})});return(p,b)=>(n(),u("div",ra,[s("span",da,a(D(Z)(d.value))+" / "+a(D(Z)(r.value)),1)]))}}),ca={class:"player-volume flex flex-col items-center pt-2"},ma={class:"text-sm mt-3"},pa=A({__name:"PlayerVolumeSlider",setup(e){const t=ee(),d=N({get:()=>t.state.suno.audio?.volume,set:b=>t.commit("suno/setAudio",{...t.state.suno.audio,volume:b})}),r=N({get:()=>t.state.suno.audio?.muted,set:b=>t.commit("suno/setAudio",{...t.state.suno.audio,muted:b})}),p=b=>t.dispatch("suno/setVolume",b);return(b,g)=>(n(),u("div",ca,[o(D(ge),{modelValue:d.value,"onUpdate:modelValue":g[0]||(g[0]=m=>d.value=m),vertical:"",height:"100px","show-tooltip":!1,max:100,min:0,size:"small",disabled:r.value,onInput:p},null,8,["modelValue","disabled"]),s("div",ma,a(d.value),1)]))}}),fa={class:"flex items-center justify-center gap-x-3"},ha=A({__name:"PlayerController",setup(e){const t=ee(),d=()=>t.dispatch("suno/setAudio",{...t.state.suno.audio,state:t.state.suno.audio.state==="playing"?"paused":"playing"}),r=N(()=>t.state.suno.audio);return(p,b)=>(n(),u("div",fa,[o(ye,{icon:r.value?.state==="playing"?D(Je):D(Qe),size:"45",theme:"filled",class:"text-[var(--el-color-primary)] cursor-pointer",onClick:d},null,8,["icon"]),o(D(Ie),{placement:"top",width:"50px",trigger:"click"},{reference:i(()=>[o(ye,{icon:D(Ye),size:"20","stroke-width":2,class:"cursor-pointer"},null,8,["icon"])]),default:i(()=>[o(pa)]),_:1})]))}}),ga={class:"flex flex-col items-stretch h-20"},$a={class:"flex grow px-5 items-center"},_a={class:"flex-1"},va={class:"flex-1"},ya={class:"flex-1"},ba=A({__name:"Player",setup(e){return(t,d)=>(n(),u("div",ga,[o(ea),s("div",$a,[s("div",_a,[o(la)]),s("div",va,[o(ha)]),s("div",ya,[o(ua)])])]))}}),ka=A({name:"RecentPanel",components:{ElSkeletonItem:rt,ElSkeleton:lt,ElInput:H,ElButton:G,ElDropdown:Ee,ElDropdownMenu:Ue,ElDropdownItem:Pe,ElPopover:Ie,ElRadioGroup:Q,ElRadioButton:te,ElSelect:ce,ElOption:ue,FontAwesomeIcon:j,TaskPreview:Zi,Player:ba,NoTasks:at,ScrollList:Ne},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0,searchQuery:"",sortBy:"newest",filterType:"all",filterDuration:"all",filterVideo:"all",filterModel:"all"}},computed:{tasks(){return{...this.$store.state.suno?.tasks,items:this.$store.state.suno?.tasks?.items?.slice()}},sortLabel(){return this.sortBy==="newest"?this.$t("suno.sort.newest"):this.$t("suno.sort.oldest")},activeFilterCount(){let e=0;return this.filterType!=="all"&&e++,this.filterDuration!=="all"&&e++,this.filterVideo!=="all"&&e++,this.filterModel&&this.filterModel!=="all"&&e++,e},availableModels(){const e=this.tasks?.items||[],t=new Set;for(const d of e){const r=d?.response?.data??[];for(const p of r)p.model&&t.add(p.model)}return Array.from(t).sort()},filteredTasks(){let e=this.tasks?.items||[];if(this.searchQuery){const t=this.searchQuery.toLowerCase();e=e.filter(d=>(d?.response?.data??[]).some(p=>p.title?.toLowerCase().includes(t)||p.style?.toLowerCase().includes(t)||p.prompt?.toLowerCase().includes(t)))}return this.activeFilterCount>0&&(e=e.filter(t=>{const d=t?.request??{},r=t?.response?.data??[];return this.filterType==="vocal"&&d.instrumental===!0||this.filterType==="instrumental"&&d.instrumental!==!0?!1:this.filterDuration!=="all"||this.filterVideo!=="all"||this.filterModel&&this.filterModel!=="all"?r.some(p=>!(this.filterDuration==="short"&&!(typeof p.duration=="number"&&p.duration<60)||this.filterDuration==="medium"&&!(typeof p.duration=="number"&&p.duration>=60&&p.duration<=180)||this.filterDuration==="long"&&!(typeof p.duration=="number"&&p.duration>180)||this.filterVideo==="with"&&!p.video_url||this.filterVideo==="without"&&p.video_url||this.filterModel&&this.filterModel!=="all"&&p.model!==this.filterModel)):!0})),this.sortBy==="oldest"&&(e=[...e].reverse()),e}},methods:{onSortChange(e){this.sortBy=e},onResetFilters(){this.filterType="all",this.filterDuration="all",this.filterVideo="all",this.filterModel="all"},getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),wa={key:0,class:"tasks"},Ca={class:"left w-[70px] p-[10px] flex items-center"},Va={class:"main w-[calc(100%-70px)] flex-1 p-[10px]"},Sa={key:0,class:"task-toolbar"},Ta={key:0,class:"filter-badge"},Aa={class:"filter-popover"},Pa={class:"filter-row"},Ua={class:"filter-label"},Ea={class:"filter-row"},Ia={class:"filter-label"},Ra={class:"filter-row"},La={class:"filter-label"},Ma={key:0,class:"filter-row"},Fa={class:"filter-label"},za={class:"filter-actions"},ja={key:2,class:"w-full flex-1 flex items-center justify-center"},Da={class:"text-sm text-gray-400"},Ga={key:3,class:"w-full flex-1 flex flex-col items-center justify-center gap-2"},Ba={class:"text-sm text-gray-400"},Oa={key:4,class:"w-full flex-1 flex items-center justify-center"},Na={class:"h-20"};function qa(e,t,d,r,p,b){const g=l("el-skeleton-item"),m=l("el-skeleton"),f=l("font-awesome-icon"),$=l("el-input"),k=l("el-button"),T=l("el-dropdown-item"),_=l("el-dropdown-menu"),V=l("el-dropdown"),C=l("el-radio-button"),I=l("el-radio-group"),P=l("el-option"),W=l("el-select"),J=l("el-popover"),Y=l("task-preview"),h=l("scroll-list"),S=l("no-tasks"),ie=l("player");return n(),u(M,null,[e.tasks?.items===void 0?(n(),u("div",wa,[(n(),u(M,null,z(3,R=>s("div",{key:R,class:"flex"},[s("div",Ca,[o(m,{animated:""},{template:i(()=>[o(g,{variant:"image",class:"avatar w-[50px] h-[50px]"})]),_:1})]),s("div",Va,[o(m,{animated:""},{template:i(()=>[o(g,{variant:"p",class:"w-[200px] h-[15px] mb-[5px] mt-[10px]"}),o(g,{variant:"text"})]),_:1})])])),64))])):(n(),u(M,{key:1},[e.tasks?.items?.length?(n(),u("div",Sa,[o($,{modelValue:e.searchQuery,"onUpdate:modelValue":t[0]||(t[0]=R=>e.searchQuery=R),size:"small",placeholder:e.$t("suno.placeholder.searchSongs"),clearable:"",class:"task-search"},{prefix:i(()=>[o(f,{icon:"fa-solid fa-magnifying-glass",class:"text-xs"})]),_:1},8,["modelValue","placeholder"]),o(V,{trigger:"click",onCommand:e.onSortChange},{dropdown:i(()=>[o(_,null,{default:i(()=>[o(T,{command:"newest",class:K({"is-active":e.sortBy==="newest"})},{default:i(()=>[v(a(e.$t("suno.sort.newest")),1)]),_:1},8,["class"]),o(T,{command:"oldest",class:K({"is-active":e.sortBy==="oldest"})},{default:i(()=>[v(a(e.$t("suno.sort.oldest")),1)]),_:1},8,["class"])]),_:1})]),default:i(()=>[o(k,{size:"small",class:"sort-btn"},{default:i(()=>[o(f,{icon:"fa-solid fa-arrow-down-wide-short",class:"mr-1"}),v(" "+a(e.sortLabel),1)]),_:1})]),_:1},8,["onCommand"]),o(J,{trigger:"click",placement:"bottom-end",width:260},{reference:i(()=>[o(k,{size:"small",class:K(["filter-btn",{"has-active-filter":e.activeFilterCount>0}])},{default:i(()=>[o(f,{icon:"fa-solid fa-filter",class:"mr-1"}),v(" "+a(e.$t("suno.filter.title"))+" ",1),e.activeFilterCount>0?(n(),u("span",Ta,a(e.activeFilterCount),1)):c("",!0)]),_:1},8,["class"])]),default:i(()=>[s("div",Aa,[s("div",Pa,[s("div",Ua,a(e.$t("suno.filter.type")),1),o(I,{modelValue:e.filterType,"onUpdate:modelValue":t[1]||(t[1]=R=>e.filterType=R),size:"small"},{default:i(()=>[o(C,{value:"all"},{default:i(()=>[v(a(e.$t("suno.filter.typeAll")),1)]),_:1}),o(C,{value:"vocal"},{default:i(()=>[v(a(e.$t("suno.filter.typeVocal")),1)]),_:1}),o(C,{value:"instrumental"},{default:i(()=>[v(a(e.$t("suno.filter.typeInstrumental")),1)]),_:1})]),_:1},8,["modelValue"])]),s("div",Ea,[s("div",Ia,a(e.$t("suno.filter.duration")),1),o(I,{modelValue:e.filterDuration,"onUpdate:modelValue":t[2]||(t[2]=R=>e.filterDuration=R),size:"small"},{default:i(()=>[o(C,{value:"all"},{default:i(()=>[v(a(e.$t("suno.filter.durationAll")),1)]),_:1}),o(C,{value:"short"},{default:i(()=>[v(a(e.$t("suno.filter.durationShort")),1)]),_:1}),o(C,{value:"medium"},{default:i(()=>[v(a(e.$t("suno.filter.durationMedium")),1)]),_:1}),o(C,{value:"long"},{default:i(()=>[v(a(e.$t("suno.filter.durationLong")),1)]),_:1})]),_:1},8,["modelValue"])]),s("div",Ra,[s("div",La,a(e.$t("suno.filter.video")),1),o(I,{modelValue:e.filterVideo,"onUpdate:modelValue":t[3]||(t[3]=R=>e.filterVideo=R),size:"small"},{default:i(()=>[o(C,{value:"all"},{default:i(()=>[v(a(e.$t("suno.filter.videoAll")),1)]),_:1}),o(C,{value:"with"},{default:i(()=>[v(a(e.$t("suno.filter.videoWith")),1)]),_:1}),o(C,{value:"without"},{default:i(()=>[v(a(e.$t("suno.filter.videoWithout")),1)]),_:1})]),_:1},8,["modelValue"])]),e.availableModels.length>0?(n(),u("div",Ma,[s("div",Fa,a(e.$t("suno.filter.model")),1),o(W,{modelValue:e.filterModel,"onUpdate:modelValue":t[4]||(t[4]=R=>e.filterModel=R),size:"small",placeholder:e.$t("suno.filter.modelAll"),clearable:""},{default:i(()=>[o(P,{label:e.$t("suno.filter.modelAll"),value:"all"},null,8,["label"]),(n(!0),u(M,null,z(e.availableModels,R=>(n(),y(P,{key:R,label:R,value:R},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])):c("",!0),s("div",za,[o(k,{size:"small",text:"",onClick:e.onResetFilters},{default:i(()=>[v(a(e.$t("suno.filter.reset")),1)]),_:1},8,["onClick"])])])]),_:1})])):c("",!0),e.filteredTasks?.length>0?(n(),y(h,{key:1,ref:"scrollList",class:"flex-1 w-full overflow-y-auto tasks p-2",loading:e.loading,onReachTop:t[5]||(t[5]=R=>e.$emit("reach-top"))},{default:i(()=>[(n(!0),u(M,null,z(e.filteredTasks,(R,ae)=>(n(),y(Y,{key:ae,"model-value":R,class:"preview"},null,8,["model-value"]))),128))]),_:1},8,["loading"])):e.searchQuery&&e.tasks?.items?.length>0?(n(),u("div",ja,[s("p",Da,a(e.$t("suno.message.noSearchResults")),1)])):e.activeFilterCount>0&&e.tasks?.items?.length>0?(n(),u("div",Ga,[s("p",Ba,a(e.$t("suno.message.noFilterResults")),1),o(k,{size:"small",text:"",onClick:e.onResetFilters},{default:i(()=>[v(a(e.$t("suno.filter.reset")),1)]),_:1},8,["onClick"])])):e.tasks?.items?.length===0?(n(),u("div",Oa,[o(S)])):c("",!0)],64)),B(s("div",Na,[o(ie)],512),[[Me,!!e.$store?.state?.suno?.audio?.object]])],64)}const Ha=E(ka,[["render",qa],["__scopeId","data-v-4ab3f8f2"]]),Wa=A({name:"TaskPreview",components:{IconPicture:ze,ElImage:O,ElAvatar:Xe,ElIcon:x},computed:{audio(){return this.$store.state.suno?.audio}}}),Ka={key:0,class:"size-full overflow-hidden"},Ja={class:"relative h-[300px]"},Qa={class:"flex items-center justify-center size-full bg-[var(--el-bg-color)]"},Ya={class:"absolute bottom-0 left-0 right-0 m-0 p-4 text-white z-10 bg-gradient-to-t from-black/70 to-transparent"},Xa={class:"p-4"},Za={class:"flex items-center font-bold mb-2"},xa={class:"text-[var(--el-text-color-regular)] mb-2"},el={class:"text-xs text-[var(--el-text-color-regular)]"},tl={class:"mt-4 text-sm leading-[25px] whitespace-pre-wrap"},ol={key:1,class:"w-full h-full"};function sl(e,t,d,r,p,b){const g=l("icon-picture"),m=l("el-icon"),f=l("el-image"),$=l("el-avatar");return e.audio?.object?(n(),u("div",Ka,[s("div",Ja,[o(f,{src:e.audio.image_url,fit:"cover",class:"size-full"},{error:i(()=>[s("div",Qa,[o(m,{class:"text-3xl"},{default:i(()=>[o(g)]),_:1})])]),_:1},8,["src"]),s("h2",Ya,a(e.audio?.title),1)]),s("div",Xa,[s("div",Za,[o($,{size:30,src:e.audio?.image_url,class:"mr-2"},null,8,["src"]),s("span",null,a(e.audio?.title),1)]),s("p",xa,a(e.audio?.style),1),s("p",el,a(e.$dayjs.format(e.audio?.created_at)),1),s("div",tl,[s("p",null,a(e.audio?.lyric),1)])])])):(n(),u("div",ol))}const nl=E(Wa,[["render",sl]]),il=Ae("suno"),al=A({name:"SunoIndex",components:{Layout:ht,ConfigPanel:Ui,RecentPanel:Ha,PreviewPanel:nl},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.suno?.status?.getApplications===X.Request},tasksLoading(){return this.$store.state.suno?.status?.getTasks===X.Request||this.fetchingTasks},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===X.Request},needApply(){return this.$store.state.suno.status.getApplications===X.Success&&!this.application},application(){return this.$store.state.suno.application},tasks(){return this.$store.state.suno.tasks},applications(){return this.$store.state.suno.applications}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await qe({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("suno/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplications"),await this.$store.dispatch("suno/getApplications"),console.debug("end onGetApplications"),await this.onGetTasks()},onApply(){De.create({application:this.application}).then(({data:e})=>{this.application=e,w.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{e?.response?.data?.code===Ge&&w.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:d,createdAtMax:r}=e||{};console.debug("limit",t,"createdAtMin",d,"createdAtMax",r),this.fetchingTasks=!0;try{await this.$store.dispatch("suno/getTasks",{limit:t,createdAtMin:d,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerateAudio(){const e={...this.config,callback_url:il},t=this.credential?.token;if(!t){console.error("no token specified");return}w.info(this.$t("suno.message.startingTask")),je("suno",L.audio(e,{token:t})).then(()=>{w.success(this.$t("suno.message.startTaskSuccess"))}).catch(d=>{w.error(d?.response?.data?.error?.message||this.$t("suno.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function ll(e,t,d,r,p,b){const g=l("config-panel"),m=l("recent-panel"),f=l("preview-panel"),$=l("layout");return n(),y($,null,{config:i(()=>[o(g,{onGenerate:e.onGenerateAudio},null,8,["onGenerate"])]),result:i(()=>[o(m,{ref:"recentPanel",class:"panel recent",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),preview:i(()=>[o(f)]),_:1})}const dr=E(al,[["render",ll],["__scopeId","data-v-933ac61a"]]);export{dr as default};
@@ -1 +1 @@
1
- import{F as L}from"./index.es-DCL3aYjw.js";import{E}from"./index-CXk4y1bt.js";import{E as R}from"./index-C2-gUTzR.js";import{d as b,H as i,E as r,z as T,C as t,y as u,D as a,q as s,F as o,O as C,N as G,x as v,I as d,J as m,M as A,Q as S}from"./vendor-vue-NSDaktjZ.js";import{G as k,bj as M,co as j,aP as D,S as U,cp as B}from"./index-UEQ4C95J.js";import{a as q}from"./hailuo-C8Dw-0xR.js";import{E as F,a as O}from"./index-D3Nml2aS.js";import{p as z}from"./pasteUploadMixin-BurWbGNQ.js";import{I as P,S as N,l as H}from"./pagination-wUSdmOzL.js";import{I as J}from"./ImagePreview-BID-4kFX.js";import{E as K}from"./index-DKJuDgcJ.js";import{E as V}from"./index-B73VNuAm.js";import{E as Q}from"./index-8otrg1ss.js";import{C as W}from"./Consumption-DVBEzfCm.js";import{a as X}from"./price-CabnHqB_.js";import{b as Y}from"./errorCode-Cqj9Td_Z.js";import{C as Z}from"./CopyToClipboard-C2THHT8U.js";import{V as x}from"./VideoPlayer-B27B1Ug2.js";import{E as ee}from"./index-DYODEtlg.js";import{E as te}from"./index-BLdEuIsD.js";import{E as oe}from"./index-B3Az8tWL.js";import{B as se}from"./BotPlaceholder-BeyeAf9f.js";import{N as ae}from"./NoTasks-COJAQuGK.js";import"./use-form-item-CLq3ss4x.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Df5ITouH.js";import"./index-DJpzDqQ4.js";import"./typescript-tDSPj8Z9.js";import"./index-fxj2Ya9s.js";import"./strings-beZM2Y-f.js";import"./isEqual-Djnx406d.js";import"./_Uint8Array-CI8yFZ43.js";import"./castArray-mQ1tkxyC.js";import"./debounce-Dh8RqSlB.js";import"./_baseIteratee-BU-JT24z.js";import"./index-CqcFDQ_G.js";import"./index-CRa1r1FF.js";import"./_baseClone-I702BQXP.js";import"./_initCloneObject-DtaxLMaj.js";import"./index-CtWa2yYi.js";import"./vue-plyr-BO2nlN4c.js";import"./index-Btf_IFYC.js";const ne=b({name:"LayoutHailuo",components:{ElDrawer:R,ElButton:E,FontAwesomeIcon:L},data(){return{drawer:!1}}}),le={class:"main flex flex-row flex-1"},ie={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},re={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function ce(e,n,f,g,w,y){const p=a("font-awesome-icon"),h=a("el-button"),c=a("el-drawer");return s(),i("div",le,[r("div",ie,[T(e.$slots,"config",{},void 0,!0)]),r("div",re,[T(e.$slots,"result",{},void 0,!0)]),t(h,{circle:"",class:"menu",onClick:n[0]||(n[0]=_=>e.drawer=!0)},{default:u(()=>[t(p,{icon:"fa-solid fa-magic"})]),_:1}),t(c,{modelValue:e.drawer,"onUpdate:modelValue":n[1]||(n[1]=_=>e.drawer=_),direction:"ltr","with-header":!1,size:"340px"},{default:u(()=>[T(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const ue=k(ne,[["render",ce],["__scopeId","data-v-c84c5888"]]),de=b({name:"ModelSelector",components:{ElSelect:O,ElOption:F},data(){return{}},computed:{options(){return[{value:"minimax-t2v",label:this.$t("hailuo.button.model1")},{value:"minimax-i2v",label:this.$t("hailuo.button.model2")},{value:"minimax-i2v-director",label:this.$t("hailuo.button.model3")}]},value:{get(){return this.$store.state.hailuo?.config?.model},set(e){this.$store.commit("hailuo/setConfig",{...this.$store.state.hailuo?.config,model:e})}}},mounted(){this.value||(this.value=q)}}),me={class:"field"},pe={class:"title font-bold"},he={class:"float-left"};function fe(e,n,f,g,w,y){const p=a("el-option"),h=a("el-select");return s(),i("div",me,[r("h2",pe,o(e.$t("hailuo.name.model")),1),t(h,{modelValue:e.value,"onUpdate:modelValue":n[0]||(n[0]=c=>e.value=c),class:"value",placeholder:e.$t("hailuo.placeholder.select"),clearable:""},{default:u(()=>[(s(!0),i(C,null,G(e.options,c=>(s(),v(p,{key:c.value,label:c.label,value:c.value},{default:u(()=>[r("span",he,o(c.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const ge=k(de,[["render",fe],["__scopeId","data-v-a768fbd9"]]),_e=b({name:"StartImageUrlInput",components:{ElUpload:K,ElButton:E,InfoIcon:P,ImagePreview:J},mixins:[z],data(){return{fileList:[],uploadUrl:M()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e.url).filter(e=>e!==void 0)},value:{get(){return this.$store.state.hailuo?.config?.first_image_url},set(){const e=this.urls?.[0];this.$store.commit("hailuo/setConfig",{...this.$store.state.hailuo?.config,first_image_url:e})}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){V.warning(this.$t("hailuo.message.uploadStartImageExceed"))},onError(){V.error(this.$t("hailuo.message.uploadStartImageError"))},async onRemove(){V.error(this.$t("hailuo.message.uploadStartImageError"))},onSetStartImageUrl(){const e=this.urls?.[0];this.$store.commit("hailuo/setConfig",{...this.$store.state.hailuo?.config,first_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),$e={class:"relative"},ve={class:"flex justify-between"},be={class:"flex justify-start items-center"},ke={class:"text-sm font-bold"};function we(e,n,f,g,w,y){const p=a("info-icon"),h=a("image-preview"),c=a("el-button"),_=a("el-upload");return s(),i("div",$e,[r("div",ve,[r("div",be,[r("span",ke,o(e.$t("hailuo.name.startImageUrl")),1),t(p,{content:e.$t("hailuo.description.startImageUrl"),class:"info"},null,8,["content"])])]),t(_,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":n[0]||(n[0]=l=>e.fileList=l),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file","show-file-list":!0,limit:1,multiple:!1,"list-type":"picture",action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-remove":e.onRemove,"on-success":e.onSuccess,headers:e.headers},{file:u(({file:l})=>[l.url&&l.percentage!==void 0?(s(),v(h,{key:0,url:l.url,name:l.name,percentage:l.percentage,onRemove:$=>e.fileList.splice(e.fileList.indexOf(l),1)},null,8,["url","name","percentage","onRemove"])):m("",!0)]),default:u(()=>[t(c,{size:"small",type:"primary",class:"btn btn-upload",round:""},{default:u(()=>[d(o(e.$t("hailuo.button.uploadStartImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-remove","on-success","headers"])])}const ye=k(_e,[["render",we],["__scopeId","data-v-48f4a681"]]),Ve="",Ee=b({name:"PromptInput",components:{ElInput:Q,InfoIcon:P},computed:{prompt:{get(){return this.$store.state.hailuo?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("hailuo/setConfig",{...this.$store.state.hailuo?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=Ve)}}),Se={class:"field"},Ie={class:"box"},Te={class:"title font-bold"};function Ce(e,n,f,g,w,y){const p=a("info-icon"),h=a("el-input");return s(),i("div",Se,[r("div",Ie,[r("h2",Te,o(e.$t("hailuo.name.prompt")),1),t(p,{content:e.$t("hailuo.description.prompt"),class:"info"},null,8,["content"])]),t(h,{modelValue:e.prompt,"onUpdate:modelValue":n[0]||(n[0]=c=>e.prompt=c),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("hailuo.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const Le=k(Ee,[["render",Ce],["__scopeId","data-v-c601bcba"]]),Ue=b({name:"PresetPanel",components:{ElButton:E,FontAwesomeIcon:L,PromptInput:Le,StartImageUrlInput:ye,ModelSelector:ge,Consumption:W},emits:["generate"],computed:{config(){return this.$store.state.hailuo?.config},consumption(){return X(this.config,this.service?.cost)},service(){return this.$store.state.hailuo?.service}},methods:{onGenerate(){this.$emit("generate")}}}),Ge={class:"flex flex-col h-full"},Pe={class:"flex-1 overflow-y-auto p-5"},Re={class:"flex flex-col items-center justify-center px-5 pb-5"};function Ae(e,n,f,g,w,y){const p=a("prompt-input"),h=a("model-selector"),c=a("start-image-url-input"),_=a("consumption"),l=a("font-awesome-icon"),$=a("el-button");return s(),i("div",Ge,[r("div",Pe,[t(p,{class:"mb-4"}),t(h,{class:"mb-4"}),e.config?.model==="minimax-i2v"?(s(),v(c,{key:0,class:"mb-2"})):m("",!0)]),r("div",Re,[t(_,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(s(),v($,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:u(()=>[t(l,{icon:"fa-solid fa-magic",class:"mr-2"}),d(" "+o(e.$t("hailuo.button.extend")),1)]),_:1},8,["onClick"])):(s(),v($,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:u(()=>[t(l,{icon:"fa-solid fa-magic",class:"mr-2"}),d(" "+o(e.$t("hailuo.button.generate")),1)]),_:1},8,["onClick"]))])])}const Me=k(Ue,[["render",Ae]]),je=b({name:"TaskPreview",components:{ElImage:oe,CopyToClipboard:Z,FontAwesomeIcon:L,ElAlert:te,VideoPlayer:x,ElTooltip:ee,ElButton:E},props:{modelValue:{type:Object,required:!0}},computed:{application(){return this.$store.state.hailuo?.application},config(){return this.$store.state.hailuo?.config},video(){return this.modelValue?.response?.data?.[0]}},methods:{onDownload(e){console.debug("on download hailuo video",e),window.open(e,"_blank")}}}),De={class:"preview"},Be={class:"left"},qe={class:"main"},Fe={class:"bot"},Oe={class:"datetime"},ze={class:"info"},Ne={key:0,class:"prompt mt-2"},He={key:0},Je={key:1},Ke={key:0,class:S({content:!0,failed:!0})},Qe={key:0,class:"mb-4"},We={key:1,class:S({operations:!0,"mt-2":!0})},Xe={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ye={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ze={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},xe={key:1,class:S({content:!0})},et={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},tt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ot={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},st={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},at={key:2,class:S({content:!0})},nt={class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function lt(e,n,f,g,w,y){const p=a("el-image"),h=a("video-player"),c=a("el-button"),_=a("el-tooltip"),l=a("font-awesome-icon"),$=a("copy-to-clipboard"),I=a("el-alert");return s(),i("div",De,[r("div",Be,[t(p,{src:"https://cdn.acedata.cloud/0qg4gp.png",class:"avatar"})]),r("div",qe,[r("div",Fe,[d(o(e.$t("hailuo.name.hailuoBot"))+" ",1),r("span",Oe,o(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),r("div",ze,[e.modelValue?.request?.prompt?(s(),i("p",Ne,[d(o(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?m("",!0):(s(),i("span",He," - ("+o(e.$t("hailuo.status.pending"))+") ",1)),e.video?.state==="processing"||e.video?.state==="pending"||e.video?.state==="running"?(s(),i("span",Je," - ("+o(e.$t("hailuo.status.processing"))+") ",1)):m("",!0)])):m("",!0)]),e.modelValue?.response?.success===!0?(s(),i("div",Ke,[e.video?.video_url?(s(),i("div",Qe,[t(h,{src:e.video?.video_url},null,8,["src"])])):m("",!0),e.video?(s(),i("div",We,[t(_,{class:"box-item",effect:"dark",content:e.$t("hailuo.message.downloadVideo"),placement:"top-start"},{default:u(()=>[e.video?.video_url?(s(),v(c,{key:0,type:"info",size:"small",class:"mb-2",onClick:n[0]||(n[0]=A(gt=>e.onDownload(e.video?.video_url),["stop"]))},{default:u(()=>[d(o(e.$t("hailuo.button.download")),1)]),_:1})):m("",!0)]),_:1},8,["content"])])):m("",!0),t(I,{closable:!1,class:"mt-2 success"},{default:u(()=>[e.modelValue?.request?.model?(s(),i("p",Xe,[t(l,{icon:"fa-solid fa-hashtag",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.model"))+": "+o(e.modelValue?.request?.model)+" ",1),t($,{content:e.modelValue?.id},null,8,["content"])])):m("",!0),r("p",Ye,[t(l,{icon:"fa-solid fa-magic",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),t($,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(s(),i("p",Ze,[t(l,{icon:"fa-solid fa-clock",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):m("",!0)]),_:1})])):m("",!0),e.modelValue?.response?.success===!1?(s(),i("div",xe,[t(I,{closable:!1,class:"failure"},{template:u(()=>[t(l,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.failure")),1)]),default:u(()=>[r("p",et,[t(l,{icon:"fa-solid fa-magic",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),t($,{content:e.modelValue?.id},null,8,["content"])]),r("p",tt,[t(l,{icon:"fa-solid fa-circle-info",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.failureReason"))+": "+o(e.modelValue?.response?.error?.message)+" ",1),t($,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(s(),i("p",ot,[t(l,{icon:"fa-solid fa-clock",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):m("",!0),r("p",st,[t(l,{icon:"fa-solid fa-hashtag",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),t($,{content:e.modelValue?.response?.trace_id},null,8,["content"])])]),_:1})])):m("",!0),e.modelValue?.response?.success===void 0?(s(),i("div",at,[t(I,{closable:!1,class:"info"},{template:u(()=>[t(l,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.failure")),1)]),default:u(()=>[r("p",nt,[t(l,{icon:"fa-solid fa-magic",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),t($,{content:e.modelValue?.id},null,8,["content"])])]),_:1})])):m("",!0)])])}const it=k(je,[["render",lt],["__scopeId","data-v-1ff65585"]]),rt=b({name:"RecentPanel",components:{TaskPreview:it,BotPlaceholder:se,NoTasks:ae,ScrollList:N},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.hailuo?.tasks,items:this.$store.state.hailuo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),ct={key:0},ut={key:2,class:"w-full h-full flex items-center justify-center"};function dt(e,n,f,g,w,y){const p=a("bot-placeholder"),h=a("task-preview"),c=a("scroll-list"),_=a("no-tasks");return s(),i(C,null,[e.tasks?.items===void 0?(s(),i("div",ct,[t(p)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(s(),v(c,{key:1,ref:"scrollList",class:"tasks w-full h-full overflow-y-auto",loading:e.loading,onReachTop:n[0]||(n[0]=l=>e.$emit("reach-top"))},{default:u(()=>[(s(!0),i(C,null,G(e.tasks?.items,l=>(s(),v(h,{key:l.id,"model-value":l},null,8,["model-value"]))),128))]),_:1},8,["loading"])):m("",!0),e.tasks?.items?.length===0?(s(),i("div",ut,[t(_)])):m("",!0)],64)}const mt=k(rt,[["render",dt]]),pt=B("hailuo"),ht=b({name:"HailuoIndex",components:{ConfigPanel:Me,Layout:ue,RecentPanel:mt},inject:["initialized"],data(){return{task:void 0,job:0,timer:void 0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.hailuo?.status?.getApplications===U.Request},tasksLoading(){return this.$store.state.hailuo?.status?.getTasks===U.Request||this.fetchingTasks},credential(){return this.$store.state.hailuo.credential},config(){return this.$store.state.hailuo.config},application(){return this.$store.state.hailuo.application},tasks(){return this.$store.state.hailuo.tasks}},watch:{tasks:{handler(e,n){e?.items?.length>n?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await H({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("hailuo/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("hailuo/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:n=5,createdAtMin:f,createdAtMax:g}=e||{};console.debug("limit",n,"createdAtMin",f,"createdAtMax",g),this.fetchingTasks=!0;try{await this.$store.dispatch("hailuo/getTasks",{limit:n,createdAtMin:f,createdAtMax:g})}finally{this.fetchingTasks=!1}},async onGenerate(){const e={...this.config,callback_url:pt},n=this.credential?.token;if(!n){console.error("no token specified");return}V.info(this.$t("hailuo.message.startingTask")),j("hailuo",D.generate(e,{token:n})).then(()=>{V.success(this.$t("hailuo.message.startTaskSuccess"))}).catch(f=>{f?.response?.data?.error?.code===Y?V.error(this.$t("hailuo.message.usedUp")):V.error(this.$t("hailuo.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function ft(e,n,f,g,w,y){const p=a("config-panel"),h=a("recent-panel"),c=a("layout");return s(),v(c,null,{config:u(()=>[t(p,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:u(()=>[t(h,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const io=k(ht,[["render",ft]]);export{io as default};
1
+ import{F as L}from"./index.es-CkYpkM9I.js";import{E}from"./index-DquRJRdr.js";import{E as R}from"./index-BCYj3n6w.js";import{d as b,H as i,E as r,z as T,C as t,y as u,D as a,q as s,F as o,O as C,N as G,x as v,I as d,J as m,M as A,Q as S}from"./vendor-vue-NSDaktjZ.js";import{G as k,bj as M,co as j,aP as D,S as U,cp as B}from"./index-aooXG--L.js";import{a as q}from"./hailuo-C8Dw-0xR.js";import{E as F,a as O}from"./index-BB6hDLIE.js";import{p as z}from"./pasteUploadMixin-BurWbGNQ.js";import{I as P,S as N,l as H}from"./pagination-DXTVpMVH.js";import{I as J}from"./ImagePreview--9ujFwpd.js";import{E as K}from"./index-CLenm0Oo.js";import{E as V}from"./index-BV07Wvw8.js";import{E as Q}from"./index-5nTLszPD.js";import{C as W}from"./Consumption-BTGrt-H6.js";import{a as X}from"./price-DPlr0oEm.js";import{b as Y}from"./errorCode-Cqj9Td_Z.js";import{C as Z}from"./CopyToClipboard-DvQT_E6_.js";import{V as x}from"./VideoPlayer-CvbYoanK.js";import{E as ee}from"./index-Bbp80plT.js";import{E as te}from"./index-7dngn8kE.js";import{E as oe}from"./index-DAj_cPV6.js";import{B as se}from"./BotPlaceholder-Cjk9ezqQ.js";import{N as ae}from"./NoTasks-B83CvG_8.js";import"./use-form-item-aMEij-44.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Df5ITouH.js";import"./index-CZbJIaMU.js";import"./typescript-BuyFDxA9.js";import"./index-Bx7FbIQL.js";import"./strings-beZM2Y-f.js";import"./isEqual-CEli5aE1.js";import"./_Uint8Array-B-ZN-HZ5.js";import"./castArray-B2ZOzEca.js";import"./debounce-DPcjcYAp.js";import"./_baseIteratee-DLk1_nEJ.js";import"./index-1krlZQmJ.js";import"./index-BZNL_Qx3.js";import"./_baseClone-DTM-dJi9.js";import"./_initCloneObject-D2_NhBTJ.js";import"./index-CMx7Aa_C.js";import"./vue-plyr-BO2nlN4c.js";import"./index-CX_dHZ5K.js";const ne=b({name:"LayoutHailuo",components:{ElDrawer:R,ElButton:E,FontAwesomeIcon:L},data(){return{drawer:!1}}}),le={class:"main flex flex-row flex-1"},ie={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},re={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function ce(e,n,f,g,w,y){const p=a("font-awesome-icon"),h=a("el-button"),c=a("el-drawer");return s(),i("div",le,[r("div",ie,[T(e.$slots,"config",{},void 0,!0)]),r("div",re,[T(e.$slots,"result",{},void 0,!0)]),t(h,{circle:"",class:"menu",onClick:n[0]||(n[0]=_=>e.drawer=!0)},{default:u(()=>[t(p,{icon:"fa-solid fa-magic"})]),_:1}),t(c,{modelValue:e.drawer,"onUpdate:modelValue":n[1]||(n[1]=_=>e.drawer=_),direction:"ltr","with-header":!1,size:"340px"},{default:u(()=>[T(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const ue=k(ne,[["render",ce],["__scopeId","data-v-c84c5888"]]),de=b({name:"ModelSelector",components:{ElSelect:O,ElOption:F},data(){return{}},computed:{options(){return[{value:"minimax-t2v",label:this.$t("hailuo.button.model1")},{value:"minimax-i2v",label:this.$t("hailuo.button.model2")},{value:"minimax-i2v-director",label:this.$t("hailuo.button.model3")}]},value:{get(){return this.$store.state.hailuo?.config?.model},set(e){this.$store.commit("hailuo/setConfig",{...this.$store.state.hailuo?.config,model:e})}}},mounted(){this.value||(this.value=q)}}),me={class:"field"},pe={class:"title font-bold"},he={class:"float-left"};function fe(e,n,f,g,w,y){const p=a("el-option"),h=a("el-select");return s(),i("div",me,[r("h2",pe,o(e.$t("hailuo.name.model")),1),t(h,{modelValue:e.value,"onUpdate:modelValue":n[0]||(n[0]=c=>e.value=c),class:"value",placeholder:e.$t("hailuo.placeholder.select"),clearable:""},{default:u(()=>[(s(!0),i(C,null,G(e.options,c=>(s(),v(p,{key:c.value,label:c.label,value:c.value},{default:u(()=>[r("span",he,o(c.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const ge=k(de,[["render",fe],["__scopeId","data-v-a768fbd9"]]),_e=b({name:"StartImageUrlInput",components:{ElUpload:K,ElButton:E,InfoIcon:P,ImagePreview:J},mixins:[z],data(){return{fileList:[],uploadUrl:M()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e.url).filter(e=>e!==void 0)},value:{get(){return this.$store.state.hailuo?.config?.first_image_url},set(){const e=this.urls?.[0];this.$store.commit("hailuo/setConfig",{...this.$store.state.hailuo?.config,first_image_url:e})}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){V.warning(this.$t("hailuo.message.uploadStartImageExceed"))},onError(){V.error(this.$t("hailuo.message.uploadStartImageError"))},async onRemove(){V.error(this.$t("hailuo.message.uploadStartImageError"))},onSetStartImageUrl(){const e=this.urls?.[0];this.$store.commit("hailuo/setConfig",{...this.$store.state.hailuo?.config,first_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),$e={class:"relative"},ve={class:"flex justify-between"},be={class:"flex justify-start items-center"},ke={class:"text-sm font-bold"};function we(e,n,f,g,w,y){const p=a("info-icon"),h=a("image-preview"),c=a("el-button"),_=a("el-upload");return s(),i("div",$e,[r("div",ve,[r("div",be,[r("span",ke,o(e.$t("hailuo.name.startImageUrl")),1),t(p,{content:e.$t("hailuo.description.startImageUrl"),class:"info"},null,8,["content"])])]),t(_,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":n[0]||(n[0]=l=>e.fileList=l),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file","show-file-list":!0,limit:1,multiple:!1,"list-type":"picture",action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-remove":e.onRemove,"on-success":e.onSuccess,headers:e.headers},{file:u(({file:l})=>[l.url&&l.percentage!==void 0?(s(),v(h,{key:0,url:l.url,name:l.name,percentage:l.percentage,onRemove:$=>e.fileList.splice(e.fileList.indexOf(l),1)},null,8,["url","name","percentage","onRemove"])):m("",!0)]),default:u(()=>[t(c,{size:"small",type:"primary",class:"btn btn-upload",round:""},{default:u(()=>[d(o(e.$t("hailuo.button.uploadStartImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-remove","on-success","headers"])])}const ye=k(_e,[["render",we],["__scopeId","data-v-48f4a681"]]),Ve="",Ee=b({name:"PromptInput",components:{ElInput:Q,InfoIcon:P},computed:{prompt:{get(){return this.$store.state.hailuo?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("hailuo/setConfig",{...this.$store.state.hailuo?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=Ve)}}),Se={class:"field"},Ie={class:"box"},Te={class:"title font-bold"};function Ce(e,n,f,g,w,y){const p=a("info-icon"),h=a("el-input");return s(),i("div",Se,[r("div",Ie,[r("h2",Te,o(e.$t("hailuo.name.prompt")),1),t(p,{content:e.$t("hailuo.description.prompt"),class:"info"},null,8,["content"])]),t(h,{modelValue:e.prompt,"onUpdate:modelValue":n[0]||(n[0]=c=>e.prompt=c),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("hailuo.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const Le=k(Ee,[["render",Ce],["__scopeId","data-v-c601bcba"]]),Ue=b({name:"PresetPanel",components:{ElButton:E,FontAwesomeIcon:L,PromptInput:Le,StartImageUrlInput:ye,ModelSelector:ge,Consumption:W},emits:["generate"],computed:{config(){return this.$store.state.hailuo?.config},consumption(){return X(this.config,this.service?.cost)},service(){return this.$store.state.hailuo?.service}},methods:{onGenerate(){this.$emit("generate")}}}),Ge={class:"flex flex-col h-full"},Pe={class:"flex-1 overflow-y-auto p-5"},Re={class:"flex flex-col items-center justify-center px-5 pb-5"};function Ae(e,n,f,g,w,y){const p=a("prompt-input"),h=a("model-selector"),c=a("start-image-url-input"),_=a("consumption"),l=a("font-awesome-icon"),$=a("el-button");return s(),i("div",Ge,[r("div",Pe,[t(p,{class:"mb-4"}),t(h,{class:"mb-4"}),e.config?.model==="minimax-i2v"?(s(),v(c,{key:0,class:"mb-2"})):m("",!0)]),r("div",Re,[t(_,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(s(),v($,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:u(()=>[t(l,{icon:"fa-solid fa-magic",class:"mr-2"}),d(" "+o(e.$t("hailuo.button.extend")),1)]),_:1},8,["onClick"])):(s(),v($,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:u(()=>[t(l,{icon:"fa-solid fa-magic",class:"mr-2"}),d(" "+o(e.$t("hailuo.button.generate")),1)]),_:1},8,["onClick"]))])])}const Me=k(Ue,[["render",Ae]]),je=b({name:"TaskPreview",components:{ElImage:oe,CopyToClipboard:Z,FontAwesomeIcon:L,ElAlert:te,VideoPlayer:x,ElTooltip:ee,ElButton:E},props:{modelValue:{type:Object,required:!0}},computed:{application(){return this.$store.state.hailuo?.application},config(){return this.$store.state.hailuo?.config},video(){return this.modelValue?.response?.data?.[0]}},methods:{onDownload(e){console.debug("on download hailuo video",e),window.open(e,"_blank")}}}),De={class:"preview"},Be={class:"left"},qe={class:"main"},Fe={class:"bot"},Oe={class:"datetime"},ze={class:"info"},Ne={key:0,class:"prompt mt-2"},He={key:0},Je={key:1},Ke={key:0,class:S({content:!0,failed:!0})},Qe={key:0,class:"mb-4"},We={key:1,class:S({operations:!0,"mt-2":!0})},Xe={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ye={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ze={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},xe={key:1,class:S({content:!0})},et={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},tt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ot={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},st={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},at={key:2,class:S({content:!0})},nt={class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function lt(e,n,f,g,w,y){const p=a("el-image"),h=a("video-player"),c=a("el-button"),_=a("el-tooltip"),l=a("font-awesome-icon"),$=a("copy-to-clipboard"),I=a("el-alert");return s(),i("div",De,[r("div",Be,[t(p,{src:"https://cdn.acedata.cloud/0qg4gp.png",class:"avatar"})]),r("div",qe,[r("div",Fe,[d(o(e.$t("hailuo.name.hailuoBot"))+" ",1),r("span",Oe,o(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),r("div",ze,[e.modelValue?.request?.prompt?(s(),i("p",Ne,[d(o(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?m("",!0):(s(),i("span",He," - ("+o(e.$t("hailuo.status.pending"))+") ",1)),e.video?.state==="processing"||e.video?.state==="pending"||e.video?.state==="running"?(s(),i("span",Je," - ("+o(e.$t("hailuo.status.processing"))+") ",1)):m("",!0)])):m("",!0)]),e.modelValue?.response?.success===!0?(s(),i("div",Ke,[e.video?.video_url?(s(),i("div",Qe,[t(h,{src:e.video?.video_url},null,8,["src"])])):m("",!0),e.video?(s(),i("div",We,[t(_,{class:"box-item",effect:"dark",content:e.$t("hailuo.message.downloadVideo"),placement:"top-start"},{default:u(()=>[e.video?.video_url?(s(),v(c,{key:0,type:"info",size:"small",class:"mb-2",onClick:n[0]||(n[0]=A(gt=>e.onDownload(e.video?.video_url),["stop"]))},{default:u(()=>[d(o(e.$t("hailuo.button.download")),1)]),_:1})):m("",!0)]),_:1},8,["content"])])):m("",!0),t(I,{closable:!1,class:"mt-2 success"},{default:u(()=>[e.modelValue?.request?.model?(s(),i("p",Xe,[t(l,{icon:"fa-solid fa-hashtag",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.model"))+": "+o(e.modelValue?.request?.model)+" ",1),t($,{content:e.modelValue?.id},null,8,["content"])])):m("",!0),r("p",Ye,[t(l,{icon:"fa-solid fa-magic",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),t($,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(s(),i("p",Ze,[t(l,{icon:"fa-solid fa-clock",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):m("",!0)]),_:1})])):m("",!0),e.modelValue?.response?.success===!1?(s(),i("div",xe,[t(I,{closable:!1,class:"failure"},{template:u(()=>[t(l,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.failure")),1)]),default:u(()=>[r("p",et,[t(l,{icon:"fa-solid fa-magic",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),t($,{content:e.modelValue?.id},null,8,["content"])]),r("p",tt,[t(l,{icon:"fa-solid fa-circle-info",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.failureReason"))+": "+o(e.modelValue?.response?.error?.message)+" ",1),t($,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(s(),i("p",ot,[t(l,{icon:"fa-solid fa-clock",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):m("",!0),r("p",st,[t(l,{icon:"fa-solid fa-hashtag",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),t($,{content:e.modelValue?.response?.trace_id},null,8,["content"])])]),_:1})])):m("",!0),e.modelValue?.response?.success===void 0?(s(),i("div",at,[t(I,{closable:!1,class:"info"},{template:u(()=>[t(l,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.failure")),1)]),default:u(()=>[r("p",nt,[t(l,{icon:"fa-solid fa-magic",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),t($,{content:e.modelValue?.id},null,8,["content"])])]),_:1})])):m("",!0)])])}const it=k(je,[["render",lt],["__scopeId","data-v-1ff65585"]]),rt=b({name:"RecentPanel",components:{TaskPreview:it,BotPlaceholder:se,NoTasks:ae,ScrollList:N},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.hailuo?.tasks,items:this.$store.state.hailuo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),ct={key:0},ut={key:2,class:"w-full h-full flex items-center justify-center"};function dt(e,n,f,g,w,y){const p=a("bot-placeholder"),h=a("task-preview"),c=a("scroll-list"),_=a("no-tasks");return s(),i(C,null,[e.tasks?.items===void 0?(s(),i("div",ct,[t(p)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(s(),v(c,{key:1,ref:"scrollList",class:"tasks w-full h-full overflow-y-auto",loading:e.loading,onReachTop:n[0]||(n[0]=l=>e.$emit("reach-top"))},{default:u(()=>[(s(!0),i(C,null,G(e.tasks?.items,l=>(s(),v(h,{key:l.id,"model-value":l},null,8,["model-value"]))),128))]),_:1},8,["loading"])):m("",!0),e.tasks?.items?.length===0?(s(),i("div",ut,[t(_)])):m("",!0)],64)}const mt=k(rt,[["render",dt]]),pt=B("hailuo"),ht=b({name:"HailuoIndex",components:{ConfigPanel:Me,Layout:ue,RecentPanel:mt},inject:["initialized"],data(){return{task:void 0,job:0,timer:void 0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.hailuo?.status?.getApplications===U.Request},tasksLoading(){return this.$store.state.hailuo?.status?.getTasks===U.Request||this.fetchingTasks},credential(){return this.$store.state.hailuo.credential},config(){return this.$store.state.hailuo.config},application(){return this.$store.state.hailuo.application},tasks(){return this.$store.state.hailuo.tasks}},watch:{tasks:{handler(e,n){e?.items?.length>n?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await H({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("hailuo/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("hailuo/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:n=5,createdAtMin:f,createdAtMax:g}=e||{};console.debug("limit",n,"createdAtMin",f,"createdAtMax",g),this.fetchingTasks=!0;try{await this.$store.dispatch("hailuo/getTasks",{limit:n,createdAtMin:f,createdAtMax:g})}finally{this.fetchingTasks=!1}},async onGenerate(){const e={...this.config,callback_url:pt},n=this.credential?.token;if(!n){console.error("no token specified");return}V.info(this.$t("hailuo.message.startingTask")),j("hailuo",D.generate(e,{token:n})).then(()=>{V.success(this.$t("hailuo.message.startTaskSuccess"))}).catch(f=>{f?.response?.data?.error?.code===Y?V.error(this.$t("hailuo.message.usedUp")):V.error(this.$t("hailuo.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function ft(e,n,f,g,w,y){const p=a("config-panel"),h=a("recent-panel"),c=a("layout");return s(),v(c,null,{config:u(()=>[t(p,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:u(()=>[t(h,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const io=k(ht,[["render",ft]]);export{io as default};