@acedatacloud/nexior 3.150.0 → 3.151.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 (240) hide show
  1. package/dist/assets/{Auth-W8GW-GDm.js → Auth-IW4p46L3.js} +1 -1
  2. package/dist/assets/{BotPlaceholder-D689G_E8.js → BotPlaceholder-T1JnFchM.js} +1 -1
  3. package/dist/assets/{Callback-B-RHwAO0.js → Callback-DZpL7SXU.js} +1 -1
  4. package/dist/assets/{Console-B_yJ_mG_.js → Console-Dzj1R1XE.js} +1 -1
  5. package/dist/assets/{Consumption-Ddq_1dsG.js → Consumption-D5MPVVSr.js} +1 -1
  6. package/dist/assets/{Conversation-dILeDaMk.js → Conversation-vSkRjEQR.js} +1 -1
  7. package/dist/assets/{CopyToClipboard-CDbXsPpE.js → CopyToClipboard-6msgbpJQ.js} +1 -1
  8. package/dist/assets/{Detail-CBhgksxU.js → Detail-BlJR1KH0.js} +2 -2
  9. package/dist/assets/{EditArray-Cz-dHw2Z.js → EditArray-RWm7mnEU.js} +1 -1
  10. package/dist/assets/{Extra-BMyAOEQ0.js → Extra-DBx8BLAN.js} +1 -1
  11. package/dist/assets/{FilePreview-CUuA49zH.js → FilePreview-D0RSGfej.js} +1 -1
  12. package/dist/assets/{History-7nunF3Nk.js → History-CD7QjkBt.js} +1 -1
  13. package/dist/assets/{IconPark.vue_vue_type_script_setup_true_lang-WxSr67sW.js → IconPark.vue_vue_type_script_setup_true_lang-BwGTLkUK.js} +1 -1
  14. package/dist/assets/{ImagePreview-LoZpT38c.js → ImagePreview-BwVG4xnq.js} +1 -1
  15. package/dist/assets/{ImageWrapper-CeIntWtS.js → ImageWrapper-fMrdkLXq.js} +1 -1
  16. package/dist/assets/{Index-CAl3nTMN.js → Index-AN9ex6Xt.js} +1 -1
  17. package/dist/assets/{Index-DqUsLzyy.js → Index-B21qPHOv.js} +1 -1
  18. package/dist/assets/{Index-BRz_NmQz.js → Index-B5na7_yk.js} +1 -1
  19. package/dist/assets/{Index-CrMQx2kT.js → Index-BPhPX9bS.js} +1 -1
  20. package/dist/assets/{Index-BLhSb684.js → Index-BgUpBrqX.js} +1 -1
  21. package/dist/assets/{Index-DwRwYab8.js → Index-BhH9mKdz.js} +1 -1
  22. package/dist/assets/{Index-DJ1Fk0TF.js → Index-BkPfXezd.js} +1 -1
  23. package/dist/assets/{Index-OUvBIQcH.js → Index-BuzCdZZQ.js} +1 -1
  24. package/dist/assets/{Index-sc--ZS4A.js → Index-BvAJNWOC.js} +1 -1
  25. package/dist/assets/{Index-CXvGtjzb.js → Index-CI8sMx5-.js} +1 -1
  26. package/dist/assets/{Index-CH3gp7_J.js → Index-CjK0DQSB.js} +1 -1
  27. package/dist/assets/{Index-CBG-GkRJ.js → Index-CxptMB1N.js} +1 -1
  28. package/dist/assets/Index-D339DAO3.js +4 -0
  29. package/dist/assets/{Index-BDTXaOU5.js → Index-D5ZlRdKz.js} +1 -1
  30. package/dist/assets/{Index-BjeZob1n.js → Index-DN3QcXm9.js} +1 -1
  31. package/dist/assets/{Index-DulZ6Ios.js → Index-DVfjg8Di.js} +1 -1
  32. package/dist/assets/Index-DhgkZiHZ.css +1 -0
  33. package/dist/assets/{Index-D_Ci4AvM.js → Index-Dos1Dsdr.js} +1 -1
  34. package/dist/assets/{Index-D0FnNl9I.js → Index-Dpeull2n.js} +1 -1
  35. package/dist/assets/{Index-CBKuJcXu.js → Index-DqhmurZ3.js} +1 -1
  36. package/dist/assets/{Index-z75ZCAgY.js → Index-Dwa_SRdi.js} +1 -1
  37. package/dist/assets/{Index-SEZtecy1.js → Index-K4Z9iTaE.js} +1 -1
  38. package/dist/assets/{Index-sdkt8wDy.js → Index-LcNO6a4K.js} +1 -1
  39. package/dist/assets/{Index-C0S4cSHQ.js → Index-aPj5352f.js} +1 -1
  40. package/dist/assets/{Index-ddFSM2lm.js → Index-nqpU6mNL.js} +1 -1
  41. package/dist/assets/{Invitees-l-YnXQk6.js → Invitees-Dps7WsXH.js} +1 -1
  42. package/dist/assets/{List-CsCHWZfR.js → List-Dv_uNXCi.js} +1 -1
  43. package/dist/assets/{List-BKnSlpvs.js → List-Omdv5kgz.js} +1 -1
  44. package/dist/assets/{List-9NE9X5xw.js → List-uwx33X7a.js} +1 -1
  45. package/dist/assets/{Main-BmlSfwFe.js → Main-C5cn0znX.js} +1 -1
  46. package/dist/assets/{Navigator-DhIdWTC7.js → Navigator-Ci2f2XkT.js} +1 -1
  47. package/dist/assets/{NoTasks-BL9-0YOm.js → NoTasks-DKhvXOog.js} +1 -1
  48. package/dist/assets/{NotFound-B206I0ye.js → NotFound-B-kP2wTa.js} +1 -1
  49. package/dist/assets/{OAuthCallback-BUFAisr1.js → OAuthCallback-tDbQvOP3.js} +1 -1
  50. package/dist/assets/{Pagination-Cs2yd3in.js → Pagination-Dmvf8sBr.js} +1 -1
  51. package/dist/assets/{Status-D6b9MaoH.js → Status-C_XbhQF0.js} +1 -1
  52. package/dist/assets/{Subscribe-D82evcT7.js → Subscribe-Zaf-hMj0.js} +1 -1
  53. package/dist/assets/{VideoPlayer-DH10Nw7l.js → VideoPlayer-B3iDYyIj.js} +1 -1
  54. package/dist/assets/{_Uint8Array-BndSMjzA.js → _Uint8Array-BeRfpqL7.js} +1 -1
  55. package/dist/assets/{_baseClone-CaNqBOJq.js → _baseClone-DquV2Mnx.js} +1 -1
  56. package/dist/assets/{_baseIteratee-B6KL1Ia9.js → _baseIteratee-DuHUzj8X.js} +1 -1
  57. package/dist/assets/{_initCloneObject-D3DOodS1.js → _initCloneObject-9PUJFEMx.js} +1 -1
  58. package/dist/assets/{add-wnSEQAf8.js → add-749h5WaZ.js} +1 -1
  59. package/dist/assets/{all-wallets-B4B6c5-P.js → all-wallets-Dg7SoSdi.js} +1 -1
  60. package/dist/assets/{app-store-CBNqXlCb.js → app-store-DEOmNkJF.js} +1 -1
  61. package/dist/assets/{apple-B-j5VL3o.js → apple-C5Q8VTnL.js} +1 -1
  62. package/dist/assets/{arrow-bottom-Cci7CP97.js → arrow-bottom-CcpU3-jy.js} +1 -1
  63. package/dist/assets/{arrow-bottom-circle-Cs3E_fGs.js → arrow-bottom-circle-D9I_u6-f.js} +1 -1
  64. package/dist/assets/{arrow-left-DZQymsq9.js → arrow-left-14k15Es2.js} +1 -1
  65. package/dist/assets/{arrow-right-BXuyy3kE.js → arrow-right-tabS5fOU.js} +1 -1
  66. package/dist/assets/{arrow-top-CLZiWtfX.js → arrow-top-Bzjm8_fQ.js} +1 -1
  67. package/dist/assets/{avatar-qkSiXAGA.js → avatar-GoazyYZC.js} +1 -1
  68. package/dist/assets/{bank-BvwT8bKH.js → bank-D8slqZcY.js} +1 -1
  69. package/dist/assets/{basic-ls6MWyfs.js → basic-ib0zx_R6.js} +1 -1
  70. package/dist/assets/{browser-Dr6NGrOw.js → browser-D3T4Qxmu.js} +1 -1
  71. package/dist/assets/{byokCredential-D0ZWf5xM.js → byokCredential-C444ihHU.js} +1 -1
  72. package/dist/assets/{card-Yu2wU8D2.js → card-wgzi2_K3.js} +1 -1
  73. package/dist/assets/{castArray-D_LQYGBx.js → castArray-278F4M9m.js} +1 -1
  74. package/dist/assets/{chat-CYQ-xCYR.js → chat-Beqa711x.js} +1 -1
  75. package/dist/assets/{checkmark-DClMiLYp.js → checkmark-YfgLhX0a.js} +1 -1
  76. package/dist/assets/{checkmark-bold-CRE6BIos.js → checkmark-bold-C0QOMGqK.js} +1 -1
  77. package/dist/assets/{chevron-bottom-DZu2sxsf.js → chevron-bottom-DM8wShkR.js} +1 -1
  78. package/dist/assets/{chevron-left-BE13runL.js → chevron-left-BOqtomeY.js} +1 -1
  79. package/dist/assets/{chevron-right--u0K90Hq.js → chevron-right-BlXJLGf3.js} +1 -1
  80. package/dist/assets/{chevron-top-BrNJXL1K.js → chevron-top-CZZtUbqX.js} +1 -1
  81. package/dist/assets/{chrome-store-CMsYkMSo.js → chrome-store-DemBQCh4.js} +1 -1
  82. package/dist/assets/{clock-XEYOr6AD.js → clock-DzoriQ7e.js} +1 -1
  83. package/dist/assets/{close-DHRXdzB9.js → close-DNkI7Hoj.js} +1 -1
  84. package/dist/assets/{coinPlaceholder-D7kkcaiZ.js → coinPlaceholder-BHV1kB0q.js} +1 -1
  85. package/dist/assets/{compass-COAh5sDS.js → compass-BXwccwCc.js} +1 -1
  86. package/dist/assets/{copy-DkNWLUKr.js → copy-DcYHLBXe.js} +1 -1
  87. package/dist/assets/{cursor-CD0-vqOx.js → cursor-BSu3MxsP.js} +1 -1
  88. package/dist/assets/{cursor-transparent-BTxxvET0.js → cursor-transparent-BBN4rW12.js} +1 -1
  89. package/dist/assets/{debounce-Q951B-04.js → debounce-CnPBB63_.js} +1 -1
  90. package/dist/assets/{desktop-D4H4PBcz.js → desktop-B_910BSl.js} +1 -1
  91. package/dist/assets/{disconnect-i9ZYp-Jk.js → disconnect-M-CWCAts.js} +1 -1
  92. package/dist/assets/{discord-CTTP9nNr.js → discord-De9ru4ub.js} +1 -1
  93. package/dist/assets/{distribution-BLLesJ9A.js → distribution-t88XJU6n.js} +1 -1
  94. package/dist/assets/{dropdown-BxxFE-4o.js → dropdown-DsiaFkVQ.js} +1 -1
  95. package/dist/assets/{etherscan-CKR_x1bE.js → etherscan-DUyJ-j3y.js} +1 -1
  96. package/dist/assets/{exclamation-triangle-D3GHAhxI.js → exclamation-triangle-D5XmHy0Q.js} +1 -1
  97. package/dist/assets/{extension-Cg2cZtJT.js → extension-BDe8RDat.js} +1 -1
  98. package/dist/assets/{external-link-Ce9oTbAr.js → external-link-Dj83m2Tn.js} +1 -1
  99. package/dist/assets/{facebook-BOfSP8a-.js → facebook-DTXZWUPL.js} +1 -1
  100. package/dist/assets/{farcaster-BMC6TV1e.js → farcaster-B4ywG9kN.js} +1 -1
  101. package/dist/assets/{filters-YSD1TQBe.js → filters-KhMH9xMD.js} +1 -1
  102. package/dist/assets/{flux-CMjql7XW.js → flux-CvJ11x9W.js} +1 -1
  103. package/dist/assets/{github-D4CLxVOl.js → github-CXXeZ_Kw.js} +1 -1
  104. package/dist/assets/{google-BoUV4Cvk.js → google-BsIi8wyP.js} +1 -1
  105. package/dist/assets/{hailuo-DJC92ae-.js → hailuo-QzKr-VaK.js} +1 -1
  106. package/dist/assets/{headshots-DsSmcysy.js → headshots-LEA5j4eI.js} +1 -1
  107. package/dist/assets/{help-circle-B7HaqKAM.js → help-circle-EmqU81Ca.js} +1 -1
  108. package/dist/assets/{id-C2HcCaKs.js → id-v24Dlyyx.js} +1 -1
  109. package/dist/assets/{image-WOM9cj0w.js → image-CW_VC-BP.js} +1 -1
  110. package/dist/assets/{index-DABtE8Kg.js → index-4fr3w0JV.js} +1 -1
  111. package/dist/assets/{index-BhYfKF9B.js → index-6Sl08ozG.js} +1 -1
  112. package/dist/assets/{index-8wdN2CVl.js → index-7N7m57AB.js} +1 -1
  113. package/dist/assets/{index-ghtwKyp5.js → index-8pgYKRxD.js} +1 -1
  114. package/dist/assets/{index-CENmXkEH.js → index-B4wQAP5g.js} +1 -1
  115. package/dist/assets/{index-BER5GLYf.js → index-BCps6OLj.js} +1 -1
  116. package/dist/assets/{index-CvKWKElQ.js → index-BJ8z356Q.js} +1 -1
  117. package/dist/assets/{index-wNJRYy43.js → index-BT5uG3nT.js} +1 -1
  118. package/dist/assets/{index-D8enB3pc.js → index-BeTHuND8.js} +1 -1
  119. package/dist/assets/{index-Chv0_uti.js → index-BfzztZ3C.js} +1 -1
  120. package/dist/assets/{index-MjbV39N3.js → index-BjURKchk.js} +1 -1
  121. package/dist/assets/{index-DGD-ZdYv.js → index-Blv6QaIk.js} +1 -1
  122. package/dist/assets/{index-B2fjG9pt.js → index-BynkfymK.js} +1 -1
  123. package/dist/assets/{index-wq679Ja0.js → index-C0A5tXrS.js} +1 -1
  124. package/dist/assets/{index-BRq9Qxe7.js → index-C4AqIojV.js} +1 -1
  125. package/dist/assets/{index-erzegoOv.js → index-C88z658e.js} +1 -1
  126. package/dist/assets/{index-C7YZwThL.js → index-CIHBGnWH.js} +1 -1
  127. package/dist/assets/{index-D29qI8YC.js → index-CIYBrWl1.js} +1 -1
  128. package/dist/assets/{index-CDE0P5Mz.js → index-CNDbe5I7.js} +1 -1
  129. package/dist/assets/{index-DuFa2upU.js → index-CNr3cL-X.js} +1 -1
  130. package/dist/assets/{index-CuwmZbiT.js → index-CPETW0B-.js} +1 -1
  131. package/dist/assets/{index-z8UjZ-D6.js → index-CX7Ebwoy.js} +1 -1
  132. package/dist/assets/{index-2ujDGB3I.js → index-C_buhEqX.js} +1 -1
  133. package/dist/assets/{index-exzQytIQ.js → index-Cdxyx1g2.js} +1 -1
  134. package/dist/assets/{index-Ca6sg_R5.js → index-ChPPFHWB.js} +1 -1
  135. package/dist/assets/{index-H9W12Q1V.js → index-CjRED359.js} +1 -1
  136. package/dist/assets/{index-C5mj_UQP.js → index-CsHz-uZs.js} +1 -1
  137. package/dist/assets/{index-CdN-RSFo.js → index-Csdbp49a.js} +1 -1
  138. package/dist/assets/{index-7nG1mAiU.js → index-CxG5ioHr.js} +1 -1
  139. package/dist/assets/{index-BoZCTCj-.js → index-D20nK0rh.js} +5 -5
  140. package/dist/assets/{index-CvYaN3Sr.js → index-D3T5KIo9.js} +1 -1
  141. package/dist/assets/{index-CGOzi3CN.js → index-D3jddmZ3.js} +1 -1
  142. package/dist/assets/{index-CL9b57Qt.js → index-D9WB_FIQ.js} +1 -1
  143. package/dist/assets/{index-CUYwPErF.js → index-DAGo6502.js} +1 -1
  144. package/dist/assets/{index-bNG4qRSn.js → index-DKxUcPQb.js} +1 -1
  145. package/dist/assets/{index-CM3keCyh.js → index-DPm01hu4.js} +1 -1
  146. package/dist/assets/{index-_8XrioVn.js → index-DQYZ_GtK.js} +1 -1
  147. package/dist/assets/{index-eEZgCgxz.js → index-DRmqH2DV.js} +1 -1
  148. package/dist/assets/{index-HXiSR2EH.js → index-DZa1Dmz4.js} +1 -1
  149. package/dist/assets/{index-B6WtGxiK.js → index-DgVbYko9.js} +1 -1
  150. package/dist/assets/{index-BzueuBi_.js → index-DgZFp1tl.js} +3 -3
  151. package/dist/assets/{index-BPL82gwt.js → index-DjP71bdI.js} +1 -1
  152. package/dist/assets/{index-32edyhra.js → index-DlBU2sRW.js} +1 -1
  153. package/dist/assets/{index-D0GM_1ZF.js → index-Dm0MxC20.js} +1 -1
  154. package/dist/assets/{index-zFiz41F1.js → index-DnX3iGId.js} +1 -1
  155. package/dist/assets/{index-BHWp6bRR.js → index-Dt3sdSti.js} +1 -1
  156. package/dist/assets/{index-DnKNQOKq.js → index-DuxWRWiB.js} +1 -1
  157. package/dist/assets/{index-8PMbXyxV.js → index-Dx8VSsv9.js} +1 -1
  158. package/dist/assets/{index-2tHwsFmK.js → index-GcNUxMuw.js} +1 -1
  159. package/dist/assets/{index-DTlEzSfV.js → index-H9tv5CGK.js} +1 -1
  160. package/dist/assets/{index-C7bC5Zyg.js → index-HqBS33mo.js} +1 -1
  161. package/dist/assets/{index-HpF2hGVR.js → index-MeXqAg39.js} +1 -1
  162. package/dist/assets/{index-8b7758X2.js → index-X_xat7xF.js} +1 -1
  163. package/dist/assets/{index-DLyOQfa5.js → index-aB7y_QWB.js} +1 -1
  164. package/dist/assets/{index-BSii-ySb.js → index-jw2b7c0m.js} +1 -1
  165. package/dist/assets/{index-C1t3zEik.js → index-n3ttmqbC.js} +2 -2
  166. package/dist/assets/{index-DTTgiRJO.js → index-r1WlQTkd.js} +1 -1
  167. package/dist/assets/{index-C1XlU4PJ.js → index-tspOPlR8.js} +3 -3
  168. package/dist/assets/{index-iYmNuXNi.js → index-xmDVAsJN.js} +1 -1
  169. package/dist/assets/{index-CHU1WLpe.js → index-xsqbwBtd.js} +1 -1
  170. package/dist/assets/{index.browser.esm-AJjKsrkH.js → index.browser.esm-CGJ9CRCU.js} +1 -1
  171. package/dist/assets/{index.es-Cj7JhB9l.js → index.es-BDOMZBHy.js} +1 -1
  172. package/dist/assets/{info-CtYUOW2b.js → info-XR00I-oO.js} +1 -1
  173. package/dist/assets/{info-circle-I-tg_JB0.js → info-circle-CCCEF-RV.js} +1 -1
  174. package/dist/assets/{isEqual-CAlLUdzO.js → isEqual-CRG_uQtW.js} +1 -1
  175. package/dist/assets/{isPlainObject-DftgPqzf.js → isPlainObject-eZxKDVqq.js} +1 -1
  176. package/dist/assets/{kling-w9kmKF5H.js → kling-B6TGjz_d.js} +1 -1
  177. package/dist/assets/{lightbulb-CqdkAURs.js → lightbulb-qMJha2UV.js} +1 -1
  178. package/dist/assets/{luma-CtPiCzmT.js → luma-CavTBkcx.js} +1 -1
  179. package/dist/assets/{mail-f9797AH0.js → mail-CDUHBELa.js} +1 -1
  180. package/dist/assets/{midjourney-CTDUXSs-.js → midjourney-CJKpkJZD.js} +1 -1
  181. package/dist/assets/{mobile-U3LCpn7z.js → mobile-CkDJWMBw.js} +1 -1
  182. package/dist/assets/{more-xoaSpumH.js → more-COpJz5uH.js} +1 -1
  183. package/dist/assets/{nanobanana-3IRvpMZA.js → nanobanana-BxT0wXzK.js} +1 -1
  184. package/dist/assets/{network-placeholder-DdhBvB7j.js → network-placeholder-CiJpRps3.js} +1 -1
  185. package/dist/assets/{nftPlaceholder-Z8MOgP96.js → nftPlaceholder-znEa5PAZ.js} +1 -1
  186. package/dist/assets/{off-DGZVyPsI.js → off-B7CrDGyD.js} +1 -1
  187. package/dist/assets/{openaiimage-DohLc_wV.js → openaiimage-Dbes_Vs4.js} +1 -1
  188. package/dist/assets/{order-DijgFZEz.js → order-DhhOiI0E.js} +1 -1
  189. package/dist/assets/{pagination-781R2MGE.js → pagination-DEnicVya.js} +1 -1
  190. package/dist/assets/{pika-BjzeOhLm.js → pika-BPoPkkGj.js} +1 -1
  191. package/dist/assets/{pixverse-DAR5soul.js → pixverse-DYt5He4G.js} +1 -1
  192. package/dist/assets/{play-store-CMAyC6Ur.js → play-store-xKKd8X5F.js} +1 -1
  193. package/dist/assets/{plus-D7gPL2E4.js → plus-Dx28_E-Q.js} +1 -1
  194. package/dist/assets/{price-DmDMgPIs.js → price-kWAt8zxX.js} +1 -1
  195. package/dist/assets/{producer-1J203KMp.js → producer-BXowpSi3.js} +1 -1
  196. package/dist/assets/{qr-code-C98nDSBI.js → qr-code-m7N3oFAD.js} +1 -1
  197. package/dist/assets/{qrart-LHv0TIhz.js → qrart-CHaysam6.js} +1 -1
  198. package/dist/assets/{recycle-horizontal-PrdG35YB.js → recycle-horizontal-DDXgzaAY.js} +1 -1
  199. package/dist/assets/{refresh-D3C8VK1v.js → refresh-LgyLUes7.js} +1 -1
  200. package/dist/assets/{reown-logo-jgWqHA6_.js → reown-logo-CkvQLZzl.js} +1 -1
  201. package/dist/assets/{search-Cvv69ufn.js → search-CTf1SeSv.js} +1 -1
  202. package/dist/assets/{secp256k1-DO8xukug.js → secp256k1-BTpVhM_m.js} +1 -1
  203. package/dist/assets/{secp256k1-B-u65EIl.js → secp256k1-CNdXyQHR.js} +1 -1
  204. package/dist/assets/{seedance-C5F8rvrf.js → seedance-Drvwshel.js} +1 -1
  205. package/dist/assets/{seedream-C6UWyMfO.js → seedream-Bp_B6_q7.js} +1 -1
  206. package/dist/assets/{send-DIdoa2bc.js → send-Di9e-410.js} +1 -1
  207. package/dist/assets/{service-CYdwDlv6.js → service-Ba2U6I3k.js} +1 -1
  208. package/dist/assets/{solana-wallets-rretdvIM.js → solana-wallets-C9-nHWg6.js} +2 -2
  209. package/dist/assets/{solana-wallets-vue-Bcolo3PJ.js → solana-wallets-vue-v2vlesUk.js} +1 -1
  210. package/dist/assets/{sora-BX4pTksl.js → sora-BR4Ve51x.js} +1 -1
  211. package/dist/assets/{suno-DK262lff.js → suno-D0MT1lkL.js} +1 -1
  212. package/dist/assets/{swapHorizontal-CskL56Yv.js → swapHorizontal-zaiHanOz.js} +1 -1
  213. package/dist/assets/{swapHorizontalBold-BuUIOPAm.js → swapHorizontalBold-DQXWfau9.js} +1 -1
  214. package/dist/assets/{swapHorizontalMedium-BPw-_TdB.js → swapHorizontalMedium-ZDw5Mo24.js} +1 -1
  215. package/dist/assets/{swapHorizontalRoundedBold-tC1pU8e0.js → swapHorizontalRoundedBold-DchBfN54.js} +1 -1
  216. package/dist/assets/{swapVertical-OinxYLDX.js → swapVertical-BwEeDCkJ.js} +1 -1
  217. package/dist/assets/{telegram-5SNxmVDO.js → telegram-79iqGO1e.js} +1 -1
  218. package/dist/assets/{three-dots-c3MfJxg5.js → three-dots-B8fGWYhK.js} +1 -1
  219. package/dist/assets/{twitch-BrDe8I52.js → twitch-BH8XG9JM.js} +1 -1
  220. package/dist/assets/{twitterIcon-DnPfGlm_.js → twitterIcon-BUNaVT2Y.js} +1 -1
  221. package/dist/assets/{typescript-DCNCCMox.js → typescript-VAjzYBVV.js} +1 -1
  222. package/dist/assets/{use-form-item-RrqgHY2m.js → use-form-item-CiGuYlwo.js} +1 -1
  223. package/dist/assets/validator-DruHczS_.js +1 -0
  224. package/dist/assets/{veo-Dm_XHtPV.js → veo-BThctip4.js} +1 -1
  225. package/dist/assets/{verify-BrAYkOc5.js → verify-CJVopDQE.js} +1 -1
  226. package/dist/assets/{verify-filled-DuS2pRA3.js → verify-filled-ATC6I0Y_.js} +1 -1
  227. package/dist/assets/{w3m-modal-BoFyRMdn.js → w3m-modal-CXzRqLSL.js} +1 -1
  228. package/dist/assets/{wallet-7ZIfce4o.js → wallet-BVG7gwu4.js} +1 -1
  229. package/dist/assets/{wallet-placeholder-CJnKkcqa.js → wallet-placeholder-Bd153rJq.js} +1 -1
  230. package/dist/assets/{walletconnect-CbVsEj0v.js → walletconnect-Dn4STW44.js} +1 -1
  231. package/dist/assets/{wan-TL_E7-70.js → wan-DqK9nL9r.js} +1 -1
  232. package/dist/assets/{warning-circle-DN9kfa_m.js → warning-circle-CL4r1SS-.js} +1 -1
  233. package/dist/assets/{web-NGVV4NXn.js → web-I_XATx91.js} +1 -1
  234. package/dist/assets/{web-DEpC-mnN.js → web-jWaF3GsK.js} +1 -1
  235. package/dist/assets/{x-CE857r5d.js → x-CuG12d0t.js} +1 -1
  236. package/dist/index.html +1 -1
  237. package/package.json +1 -1
  238. package/dist/assets/Index-BiQ4xtTO.js +0 -4
  239. package/dist/assets/Index-DD_3SAvG.css +0 -1
  240. package/dist/assets/validator-CKXSZi1B.js +0 -1
@@ -1 +1 @@
1
- import{F as D}from"./index.es-Cj7JhB9l.js";import{E as W}from"./index-DTTgiRJO.js";import{E as se}from"./index-DGD-ZdYv.js";import{d as b,H as c,E as o,z as B,C as s,y as d,D as r,q as n,F as a,O as G,N as q,J as f,x as v,I as U,G as R,K as H,M as P,u as A,c as T,w as ne,L as re}from"./vendor-vue-NSDaktjZ.js";import{E as V,b7 as ie,ef as Y,eg as Q,S as K,H as ae,aw as L,ce as te,eh as Z,ei as le,cd as ce,a7 as de}from"./index-C1XlU4PJ.js";import{a as ue}from"./errorCode-Cqj9Td_Z.js";import{p as I}from"./producer-1J203KMp.js";import{b as pe}from"./producer-DP85fuAq.js";import{E as me}from"./index-D0GM_1ZF.js";import{E as fe,a as he}from"./index-HXiSR2EH.js";import{I as F,S as _e,l as $e}from"./pagination-781R2MGE.js";import{E as ge}from"./index-zFiz41F1.js";import{E as w}from"./index-CvKWKElQ.js";import{E as z}from"./index-CL9b57Qt.js";import{u as j,F as ve,O as ye,_ as ee,P as ke,a as be,V as we,E as Ce}from"./IconPark.vue_vue_type_script_setup_true_lang-WxSr67sW.js";import{E as X}from"./index-2ujDGB3I.js";import{E as N}from"./index-CDE0P5Mz.js";import{E as Ve,a as Se}from"./index-DLyOQfa5.js";import{E as x}from"./index-B2fjG9pt.js";import{E as Ue,a as Ee}from"./index-BhYfKF9B.js";import{C as Pe}from"./Consumption-Ddq_1dsG.js";import{a as Ae}from"./price-DmDMgPIs.js";import{E as Te,b as Fe,a as Ie}from"./index-B6WtGxiK.js";import{E as Le}from"./index-BER5GLYf.js";import{E as Ge}from"./index-Ca6sg_R5.js";import{N as je}from"./NoTasks-BL9-0YOm.js";import{a as De,E as Re}from"./index-BHWp6bRR.js";import"./use-form-item-RrqgHY2m.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./validator-CKXSZi1B.js";import"./index-H9W12Q1V.js";import"./index-HpF2hGVR.js";import"./typescript-DCNCCMox.js";import"./strings-beZM2Y-f.js";import"./isEqual-CAlLUdzO.js";import"./_Uint8Array-BndSMjzA.js";import"./castArray-D_LQYGBx.js";import"./debounce-Q951B-04.js";import"./_baseIteratee-B6KL1Ia9.js";import"./index-C7YZwThL.js";import"./index-C7bC5Zyg.js";import"./_baseClone-CaNqBOJq.js";import"./_initCloneObject-D3DOodS1.js";import"./index-CuwmZbiT.js";import"./index-Cu41y2Fl.js";import"./index-CdN-RSFo.js";import"./dropdown-BxxFE-4o.js";const Ze=b({name:"LayoutProducer",components:{ElDrawer:se,ElButton:W,FontAwesomeIcon:D},data(){return{drawer:!1,preview:!1}},computed:{}}),ze={class:"main flex flex-row flex-1"},Ne={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},Me={class:"result h-full flex flex-col flex-1 min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"},Oe={class:"preview h-full w-[300px] flex flex-col"};function Be(e,t,l,i,h,p){const u=r("font-awesome-icon"),m=r("el-button"),_=r("el-drawer");return n(),c("div",ze,[o("div",Ne,[B(e.$slots,"config",{},void 0,!0)]),o("div",Me,[B(e.$slots,"result",{},void 0,!0)]),o("div",Oe,[B(e.$slots,"preview",{},void 0,!0)]),s(m,{circle:"",class:"menu",onClick:t[0]||(t[0]=$=>e.drawer=!0)},{default:d(()=>[s(u,{icon:"fa-solid fa-magic"})]),_:1}),s(_,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=$=>e.drawer=$),direction:"ltr","with-header":!1,size:"340px",class:"drawer"},{default:d(()=>[B(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const qe=V(Ze,[["render",Be],["__scopeId","data-v-7453886f"]]),We=b({name:"TypeSelector",components:{ElSelect:he,ElOption:fe,ElSwitch:me},data(){return{options:[{label:"FUZZ-2.0 Pro",value:"FUZZ-2.0 Pro",info:"8 min"},{label:"FUZZ-2.0",value:"FUZZ-2.0",info:"8 min"},{label:"FUZZ-2.0 Raw",value:"FUZZ-2.0 Raw",info:"8 min"},{label:"FUZZ-1.1 Pro",value:"FUZZ-1.1 Pro",info:"4 min"},{label:"FUZZ-1.0 Pro",value:"FUZZ-1.0 Pro",info:"4 min"},{label:"FUZZ-1.1",value:"FUZZ-1.1",info:"4 min"},{label:"FUZZ-1.0",value:"FUZZ-1.0",info:"2 min"},{label:"FUZZ-0.8",value:"FUZZ-0.8",info:"2 min"}]}},computed:{custom:{get(){return this.$store.state.producer?.config?.custom||!1},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,custom:e})}},instrumental:{get(){return this.$store.state.producer?.config?.instrumental||!1},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,instrumental:e})}},model:{get(){return this.$store.state.producer?.config?.model},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,model:e})}}},mounted(){this.model||(this.model=pe)}}),He={class:"flex items-center justify-between mb-3"},Ke={class:"text-sm font-bold"},Je={class:"mb-3"},Ye={class:"flex items-center mb-1"},Qe={class:"text-sm font-bold"},Xe={class:"flex items-center justify-between w-full"},xe={class:"text-xs text-[var(--el-text-color-placeholder)]"},et={key:0,class:"flex items-center justify-between mb-3"},tt={class:"text-sm font-bold"};function ot(e,t,l,i,h,p){const u=r("el-switch"),m=r("el-option"),_=r("el-select");return n(),c("div",null,[o("div",He,[o("span",Ke,a(e.$t("producer.name.type")),1),s(u,{modelValue:e.custom,"onUpdate:modelValue":t[0]||(t[0]=$=>e.custom=$)},null,8,["modelValue"])]),o("div",Je,[o("div",Ye,[o("span",Qe,a(e.$t("producer.name.model")),1)]),s(_,{modelValue:e.model,"onUpdate:modelValue":t[1]||(t[1]=$=>e.model=$),class:"w-full",size:"default",placeholder:e.$t("producer.placeholder.select")},{default:d(()=>[(n(!0),c(G,null,q(e.options,$=>(n(),v(m,{key:$.value,label:$.label,value:$.value},{default:d(()=>[o("div",Xe,[o("span",null,a($.label),1),o("span",xe,a($.info),1)])]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),e.custom?(n(),c("div",et,[o("span",tt,a(e.$t("producer.name.instrumental")),1),s(u,{modelValue:e.instrumental,"onUpdate:modelValue":t[2]||(t[2]=$=>e.instrumental=$)},null,8,["modelValue"])])):f("",!0)])}const st=V(We,[["render",ot]]),nt=b({name:"UploadAudio",components:{ElUpload:ge,ElButton:W,InfoIcon:F,FontAwesomeIcon:D},emits:["change"],data(){return{fileList:[],uploadUrl:ie()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},credential(){return this.$store.state.producer.credential},config(){return this.$store.state.producer.config},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.producer?.config?.audio_id},set(){}}},watch:{urls:{handler(e){this.$emit("change",e)}}},mounted(){this.value||(this.value=void 0),this.onSetAudio()},methods:{onExceed(){w.warning(this.$t("producer.message.uploadReferencesExceed"))},onError(){w.error(this.$t("producer.message.uploadReferencesError"))},async onSuccess(){const e=this.urls?.[0];await this.onGenerateAudioId(e)},async onGenerateAudioId(e){const t={audio_url:e},l=this.credential?.token;if(!l){console.error("no token specified");return}w.info(this.$t("producer.message.startingUploadAudio")),I.upload(t,{token:l}).then(i=>{console.debug("get upload music success",i.data);const h=i.data?.data.audio_id;this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,audio_id:h,action:"upload_extend"}),w.success(this.$t("producer.message.startUploadAudioSuccess"))}).catch(i=>{w.error(i?.response?.data?.error?.message||this.$t("producer.message.startUploadAudioFailed"))})},onSetAudio(){}}}),rt={class:"relative"},it={class:"flex justify-between"},at={class:"flex justify-start items-center"},lt={class:"text-sm font-bold"};function ct(e,t,l,i,h,p){const u=r("info-icon"),m=r("font-awesome-icon"),_=r("el-button"),$=r("el-upload");return n(),c("div",rt,[o("div",it,[o("div",at,[o("span",lt,a(e.$t("producer.name.referenceAudios")),1),s(u,{content:e.$t("producer.description.uploadAudios")},null,8,["content"])])]),s($,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=k=>e.fileList=k),name:"file",limit:1,class:"upload-wrapper",action:e.uploadUrl,accept:".mp3","show-file-list":!0,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{default:d(()=>[s(_,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:d(()=>[s(m,{icon:"fa-solid fa-upload",class:"icon mr-1"}),U(" "+a(e.$t("producer.button.uploadAudios")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const dt=V(nt,[["render",ct],["__scopeId","data-v-e4cd0467"]]),ut="",pt=b({name:"PromptInput",components:{ElInput:z,InfoIcon:F},computed:{prompt:{get(){return this.$store.state.producer?.config?.prompt},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=ut)}}),mt={class:"field"},ft={class:"flex items-center mb-1"},ht={class:"text-sm font-bold"};function _t(e,t,l,i,h,p){const u=r("info-icon"),m=r("el-input");return n(),c("div",mt,[o("div",ft,[o("span",ht,a(e.$t("producer.name.songDescription")),1),s(u,{content:e.$t("producer.description.prompt")},null,8,["content"])]),s(m,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=_=>e.prompt=_),rows:4,type:"textarea",placeholder:e.$t("producer.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const $t=V(pt,[["render",_t]]),gt="",vt=b({name:"LyricInput",components:{ElInput:z,ElButton:W,FontAwesomeIcon:D,InfoIcon:F},data(){return{generatingLyrics:!1}},computed:{lyric:{get(){return this.$store.state.producer?.config?.lyric},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,lyric:e})}},config(){return this.$store.state.producer?.config},credential(){return this.$store.state.producer?.credential}},mounted(){this.lyric||(this.lyric=gt)},methods:{async onGenerateLyrics(){const e=this.credential?.token;if(!e)return;const t=this.config?.style||this.config?.title||"a beautiful song";this.generatingLyrics=!0,w.info(this.$t("producer.message.generatingLyrics"));try{const i=(await I.lyric({prompt:t},{token:e})).data?.data;i?.text&&(this.lyric=i.text,i?.title&&!this.config?.title&&this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,lyric:i.text,title:i.title}),w.success(this.$t("producer.message.generateLyricsSuccess")))}catch{w.error(this.$t("producer.message.generateLyricsFailed"))}finally{this.generatingLyrics=!1}}}}),yt={class:"field"},kt={class:"flex items-center justify-between mb-1"},bt={class:"flex items-center"},wt={class:"text-sm font-bold"};function Ct(e,t,l,i,h,p){const u=r("info-icon"),m=r("font-awesome-icon"),_=r("el-button"),$=r("el-input");return n(),c("div",yt,[o("div",kt,[o("div",bt,[o("span",wt,a(e.$t("producer.name.lyrics")),1),s(u,{content:e.$t("producer.description.lyrics")},null,8,["content"])]),e.config?.action!=="extend"?(n(),v(_,{key:0,size:"small",loading:e.generatingLyrics,round:"",onClick:e.onGenerateLyrics},{default:d(()=>[e.generatingLyrics?f("",!0):(n(),v(m,{key:0,icon:"fa-solid fa-wand-magic-sparkles",class:"mr-1"})),U(" "+a(e.$t("producer.button.generate_lyrics")),1)]),_:1},8,["loading","onClick"])):f("",!0)]),e.config?.action!=="extend"?(n(),v($,{key:0,modelValue:e.lyric,"onUpdate:modelValue":t[0]||(t[0]=k=>e.lyric=k),rows:5,type:"textarea",class:"lyrics",placeholder:e.$t("producer.placeholder.lyrics")},null,8,["modelValue","placeholder"])):(n(),v($,{key:1,modelValue:e.lyric,"onUpdate:modelValue":t[1]||(t[1]=k=>e.lyric=k),rows:5,type:"textarea",class:"lyrics",placeholder:e.$t("producer.placeholder.extend.lyrics")},null,8,["modelValue","placeholder"]))])}const Vt=V(vt,[["render",Ct],["__scopeId","data-v-88c6da2b"]]),St=b({name:"StyleInput",components:{ElInput:z,InfoIcon:F},computed:{style:{get(){return this.$store.state.producer?.config?.style},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,style:e})}}}}),Ut={class:"field"},Et={class:"flex items-center justify-between mb-1"},Pt={class:"flex items-center"},At={class:"text-sm font-bold"};function Tt(e,t,l,i,h,p){const u=r("info-icon"),m=r("el-input");return n(),c("div",Ut,[o("div",Et,[o("div",Pt,[o("span",At,a(e.$t("producer.name.style")),1),s(u,{content:e.$t("producer.description.style")},null,8,["content"])])]),s(m,{modelValue:e.style,"onUpdate:modelValue":t[0]||(t[0]=_=>e.style=_),rows:2,type:"textarea",placeholder:e.$t("producer.placeholder.style")},null,8,["modelValue","placeholder"])])}const Ft=V(St,[["render",Tt]]),It=b({name:"TitleInput",components:{ElInput:z,InfoIcon:F},computed:{title:{get(){return this.$store.state.producer?.config?.title},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,title:e})}}}}),Lt={class:"field"},Gt={class:"flex items-center mb-1"},jt={class:"text-sm font-bold"};function Dt(e,t,l,i,h,p){const u=r("info-icon"),m=r("el-input");return n(),c("div",Lt,[o("div",Gt,[o("span",jt,a(e.$t("producer.name.title")),1),s(u,{content:e.$t("producer.description.title")},null,8,["content"])]),s(m,{modelValue:e.title,"onUpdate:modelValue":t[0]||(t[0]=_=>e.title=_),placeholder:e.$t("producer.placeholder.title")},null,8,["modelValue","placeholder"])])}const Rt=V(It,[["render",Dt]]),Zt=b({name:"ExtendFromInput",components:{ElImage:N,ElIcon:K,ElInputNumber:X,VideoPlay:Q,VideoPause:Y},data(){return{}},computed:{audio(){return this.$store.state.producer?.config?.audio},value:{get(){return this.$store.state.producer?.config?.continue_at},set(e){console.debug("set continue_at",e),this.$store.commit("producer/setConfig",{...this.$store.state.producer?.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:j,onPlay(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){this.$store.state?.producer?.audio?.id!==e.id&&this.onPlay({...e,progress:0})}}}),zt={class:"field"},Nt={class:"box"},Mt={class:"title font-bold"},Ot={class:"input-wrapper"},Bt={class:"task"},qt={class:"left"},Wt={key:2,class:"duration"},Ht={class:"info"},Kt={class:"title"},Jt={class:"style"};function Yt(e,t,l,i,h,p){const u=r("el-input-number"),m=r("el-image"),_=r("video-pause"),$=r("el-icon"),k=r("video-play"),y=H("loading");return n(),c("div",zt,[o("div",Nt,[o("h2",Mt,a(e.$t("producer.name.extend")),1),o("div",Ot,[s(u,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=E=>e.value=E),class:"value",min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t("producer.placeholder.extend.continue_at"),onChange:e.handleChange},null,8,["modelValue","max","placeholder","onChange"])])]),o("div",Bt,[e.audio?(n(),c("div",{key:0,class:"audio",onClick:t[3]||(t[3]=E=>e.onClick(e.audio))},[R((n(),c("div",qt,[s(m,{src:e.audio?.image_url,class:"cover",fit:"cover"},null,8,["src"]),e.audio?.audio_url&&e.$store.state?.producer?.audio?.id===e.audio.id&&e.$store.state?.producer?.audio?.state==="playing"?(n(),c("div",{key:0,class:"overlay",onClick:t[1]||(t[1]=E=>e.onPause(e.audio))},[s($,null,{default:d(()=>[s(_)]),_:1})])):f("",!0),e.audio?.audio_url&&(e.$store.state?.producer?.audio?.id!==e.audio.id||e.$store.state?.producer?.audio?.id===e.audio.id&&e.$store.state?.producer?.audio?.state==="paused")?(n(),c("div",{key:1,class:"overlay",onClick:t[2]||(t[2]=E=>e.onPlay(e.audio))},[s($,null,{default:d(()=>[s(k)]),_:1})])):f("",!0),e.audio?.duration?(n(),c("div",Wt,a(e.useFormatDuring(e.audio?.duration)),1)):f("",!0)])),[[y,!e.audio?.audio_url]]),o("div",Ht,[o("h2",Kt,a(e.audio?.title),1),o("p",Jt,a(e.audio?.style),1)])])):f("",!0)])])}const Qt=V(Zt,[["render",Yt],["__scopeId","data-v-26d43480"]]),Xt=b({name:"CoverFromInput",components:{ElImage:N,ElIcon:K,VideoPlay:Q,VideoPause:Y},data(){return{}},computed:{audio(){return this.$store.state.producer?.config?.audio},value:{get(){return this.$store.state.producer?.config?.continue_at},set(e){console.debug("set continue_at",e),this.$store.commit("producer/setConfig",{...this.$store.state.producer?.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:j,onPlay(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){this.$store.state?.producer?.audio?.id!==e.id&&this.onPlay({...e,progress:0})}}}),xt={class:"field"},eo={class:"box"},to={class:"title font-bold"},oo={class:"task"},so={class:"left"},no={key:2,class:"duration"},ro={class:"info"},io={class:"title"},ao={class:"style"};function lo(e,t,l,i,h,p){const u=r("el-image"),m=r("video-pause"),_=r("el-icon"),$=r("video-play"),k=H("loading");return n(),c("div",xt,[o("div",eo,[o("h2",to,a(e.$t("producer.name.cover")),1)]),o("div",oo,[e.audio?(n(),c("div",{key:0,class:"audio",onClick:t[2]||(t[2]=y=>e.onClick(e.audio))},[R((n(),c("div",so,[s(u,{src:e.audio?.image_url,class:"cover",fit:"cover"},null,8,["src"]),e.audio?.audio_url&&e.$store.state?.producer?.audio?.id===e.audio.id&&e.$store.state?.producer?.audio?.state==="playing"?(n(),c("div",{key:0,class:"overlay",onClick:t[0]||(t[0]=y=>e.onPause(e.audio))},[s(_,null,{default:d(()=>[s(m)]),_:1})])):f("",!0),e.audio?.audio_url&&(e.$store.state?.producer?.audio?.id!==e.audio.id||e.$store.state?.producer?.audio?.id===e.audio.id&&e.$store.state?.producer?.audio?.state==="paused")?(n(),c("div",{key:1,class:"overlay",onClick:t[1]||(t[1]=y=>e.onPlay(e.audio))},[s(_,null,{default:d(()=>[s($)]),_:1})])):f("",!0),e.audio?.duration?(n(),c("div",no,a(e.useFormatDuring(e.audio?.duration)),1)):f("",!0)])),[[k,!e.audio?.audio_url]]),o("div",ro,[o("h2",io,a(e.audio?.title),1),o("p",ao,a(e.audio?.style),1)])])):f("",!0)])])}const co=V(Xt,[["render",lo],["__scopeId","data-v-d8a8e583"]]),uo=b({name:"VocalGenderSelector",components:{ElRadioGroup:Se,ElRadioButton:Ve,InfoIcon:F},computed:{vocalGender:{get(){return this.$store.state.producer?.config?.vocal_gender||""},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,vocal_gender:e||void 0})}}}}),po={class:"mb-2"},mo={class:"flex items-center mb-1"},fo={class:"text-sm font-bold"};function ho(e,t,l,i,h,p){const u=r("info-icon"),m=r("el-radio-button"),_=r("el-radio-group");return n(),c("div",po,[o("div",mo,[o("span",fo,a(e.$t("producer.name.vocalGender")),1),s(u,{content:e.$t("producer.description.vocalGender")},null,8,["content"])]),s(_,{modelValue:e.vocalGender,"onUpdate:modelValue":t[0]||(t[0]=$=>e.vocalGender=$)},{default:d(()=>[s(m,{value:""},{default:d(()=>[U(a(e.$t("producer.gender.auto")),1)]),_:1}),s(m,{value:"f"},{default:d(()=>[U(a(e.$t("producer.gender.female")),1)]),_:1}),s(m,{value:"m"},{default:d(()=>[U(a(e.$t("producer.gender.male")),1)]),_:1})]),_:1},8,["modelValue"])])}const _o=V(uo,[["render",ho]]),$o=b({name:"AdvancedParams",components:{ElCollapse:Ee,ElCollapseItem:Ue,ElInput:z,ElSlider:x,ElInputNumber:X},data(){return{activeNames:[]}},computed:{config(){return this.$store.state.producer?.config},styleNegative:{get(){return this.$store.state.producer?.config?.style_negative||""},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,style_negative:e||void 0})}},lyricPrompt:{get(){return this.$store.state.producer?.config?.lyric_prompt||""},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,lyric_prompt:e||void 0})}},weirdness:{get(){return this.$store.state.producer?.config?.weirdness??0},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,weirdness:e||void 0})}},soundStrength:{get(){return this.$store.state.producer?.config?.sound_strength??50},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,sound_strength:e})}},lyricsStrength:{get(){return this.$store.state.producer?.config?.lyrics_strength??50},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,lyrics_strength:e})}},seed:{get(){return this.$store.state.producer?.config?.seed},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,seed:e})}}}}),go={key:0,class:"mb-3"},vo={class:"flex items-center mb-1"},yo={class:"text-xs font-bold"},ko={key:1,class:"mb-3"},bo={class:"flex items-center mb-1"},wo={class:"text-xs font-bold"},Co={key:2,class:"mb-3"},Vo={class:"flex items-center justify-between mb-1"},So={class:"text-xs font-bold"},Uo={class:"text-xs text-[var(--el-text-color-secondary)]"},Eo={key:3,class:"mb-3"},Po={class:"flex items-center justify-between mb-1"},Ao={class:"text-xs font-bold"},To={class:"text-xs text-[var(--el-text-color-secondary)]"},Fo={key:4,class:"mb-3"},Io={class:"flex items-center justify-between mb-1"},Lo={class:"text-xs font-bold"},Go={class:"text-xs text-[var(--el-text-color-secondary)]"},jo={key:5,class:"mb-3"},Do={class:"flex items-center mb-1"},Ro={class:"text-xs font-bold"};function Zo(e,t,l,i,h,p){const u=r("el-input"),m=r("el-slider"),_=r("el-input-number"),$=r("el-collapse-item"),k=r("el-collapse");return n(),v(k,{modelValue:e.activeNames,"onUpdate:modelValue":t[6]||(t[6]=y=>e.activeNames=y),class:"advanced-collapse"},{default:d(()=>[s($,{title:e.$t("producer.name.advancedParams"),name:"advanced"},{default:d(()=>[e.config?.custom?(n(),c("div",go,[o("div",vo,[o("span",yo,a(e.$t("producer.name.styleNegative")),1)]),s(u,{modelValue:e.styleNegative,"onUpdate:modelValue":t[0]||(t[0]=y=>e.styleNegative=y),placeholder:e.$t("producer.placeholder.styleNegative")},null,8,["modelValue","placeholder"])])):f("",!0),e.config?.custom&&!e.config?.instrumental?(n(),c("div",ko,[o("div",bo,[o("span",wo,a(e.$t("producer.name.lyricPrompt")),1)]),s(u,{modelValue:e.lyricPrompt,"onUpdate:modelValue":t[1]||(t[1]=y=>e.lyricPrompt=y),placeholder:e.$t("producer.placeholder.lyricPrompt")},null,8,["modelValue","placeholder"])])):f("",!0),e.config?.custom?(n(),c("div",Co,[o("div",Vo,[o("span",So,a(e.$t("producer.name.weirdness")),1),o("span",Uo,a(e.weirdness??0),1)]),s(m,{modelValue:e.weirdness,"onUpdate:modelValue":t[2]||(t[2]=y=>e.weirdness=y),min:0,max:100,step:1},null,8,["modelValue"])])):f("",!0),e.config?.custom?(n(),c("div",Eo,[o("div",Po,[o("span",Ao,a(e.$t("producer.name.soundStrength")),1),o("span",To,a(e.soundStrength??50),1)]),s(m,{modelValue:e.soundStrength,"onUpdate:modelValue":t[3]||(t[3]=y=>e.soundStrength=y),min:0,max:100,step:1},null,8,["modelValue"])])):f("",!0),e.config?.custom&&!e.config?.instrumental?(n(),c("div",Fo,[o("div",Io,[o("span",Lo,a(e.$t("producer.name.lyricsStrength")),1),o("span",Go,a(e.lyricsStrength??50),1)]),s(m,{modelValue:e.lyricsStrength,"onUpdate:modelValue":t[4]||(t[4]=y=>e.lyricsStrength=y),min:0,max:100,step:1},null,8,["modelValue"])])):f("",!0),e.config?.custom?(n(),c("div",jo,[o("div",Do,[o("span",Ro,a(e.$t("producer.name.seed")),1)]),s(_,{modelValue:e.seed,"onUpdate:modelValue":t[5]||(t[5]=y=>e.seed=y),min:0,controls:!1,placeholder:e.$t("producer.placeholder.seed"),class:"w-full"},null,8,["modelValue","placeholder"])])):f("",!0)]),_:1},8,["title"])]),_:1},8,["modelValue"])}const zo=V($o,[["render",Zo],["__scopeId","data-v-88e65aee"]]),No=b({name:"ReplaceSectionInput",components:{ElInputNumber:X,ElImage:N,InfoIcon:F},computed:{audio(){return this.$store.state.producer?.config?.audio},replaceSectionStart:{get(){return this.$store.state.producer?.config?.replace_section_start},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,replace_section_start:e})}},replaceSectionEnd:{get(){return this.$store.state.producer?.config?.replace_section_end},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,replace_section_end:e})}}},methods:{onClick(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"playing"})}}}),Mo={class:"field"},Oo={class:"flex items-center mb-2"},Bo={class:"text-sm font-bold m-0"},qo={key:0,class:"task mb-2"},Wo={class:"left relative w-[50px] h-[50px] mr-3 flex-shrink-0"},Ho={class:"info flex-1 min-w-0"},Ko={class:"text-sm font-bold m-0 truncate"},Jo={class:"text-xs text-[var(--el-text-color-secondary)] m-0 truncate"},Yo={class:"flex gap-2"};function Qo(e,t,l,i,h,p){const u=r("info-icon"),m=r("el-image"),_=r("el-input-number"),$=H("loading");return n(),c("div",Mo,[o("div",Oo,[o("h2",Bo,a(e.$t("producer.name.replaceSection")),1),s(u,{content:e.$t("producer.description.replaceSection")},null,8,["content"])]),e.audio?(n(),c("div",qo,[o("div",{class:"audio flex items-center",onClick:t[0]||(t[0]=k=>e.onClick(e.audio))},[R((n(),c("div",Wo,[s(m,{src:e.audio?.image_url,class:"w-full h-full rounded",fit:"cover"},null,8,["src"])])),[[$,!e.audio?.audio_url]]),o("div",Ho,[o("h2",Ko,a(e.audio?.title),1),o("p",Jo,a(e.audio?.style),1)])])])):f("",!0),o("div",Yo,[s(_,{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("producer.placeholder.replaceSectionStart")},null,8,["modelValue","max","placeholder"]),s(_,{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("producer.placeholder.replaceSectionEnd")},null,8,["modelValue","min","max","placeholder"])])])}const Xo=V(No,[["render",Qo]]),xo=b({name:"PresetPanel",components:{TypeSelector:st,PromptInput:$t,LyricInput:Vt,StyleInput:Ft,TitleInput:Rt,ExtendFromInput:Qt,CoverFromInput:co,UploadAudio:dt,VocalGenderSelector:_o,AdvancedParams:zo,ReplaceSectionInput:Xo,FontAwesomeIcon:D,ElButton:W,Consumption:Pe},emits:["generate"],computed:{config(){return this.$store.state.producer?.config},consumption(){return Ae(this.config,this.service?.cost)},service(){return this.$store.state.producer?.service},generateButtonText(){const e=this.config?.action;return e==="extend"?this.$t("producer.button.extend"):e==="cover"?this.$t("producer.button.cover_music"):e==="variation"?this.$t("producer.button.variation"):e==="replace_section"?this.$t("producer.button.replace_section"):e==="stems"?this.$t("producer.button.get_stems"):e==="swap_vocals"?this.$t("producer.button.swap_vocals"):e==="swap_instrumentals"?this.$t("producer.button.swap_instrumentals"):this.$t("producer.button.generate")}},methods:{onGenerate(){this.$emit("generate")}}}),es={class:"flex flex-col h-full"},ts={class:"flex-1 overflow-y-auto p-5"},os={class:"flex flex-col items-center justify-center px-5 pb-5"};function ss(e,t,l,i,h,p){const u=r("type-selector"),m=r("upload-audio"),_=r("prompt-input"),$=r("lyric-input"),k=r("style-input"),y=r("title-input"),E=r("vocal-gender-selector"),S=r("extend-from-input"),M=r("cover-from-input"),O=r("replace-section-input"),J=r("advanced-params"),g=r("consumption"),C=r("font-awesome-icon"),oe=r("el-button");return n(),c("div",es,[o("div",ts,[s(u,{class:"mb-4"}),s(m,{class:"mb-4"}),e.config?.custom?f("",!0):(n(),v(_,{key:0,class:"mb-4"})),e.config?.custom&&!e.config.instrumental?(n(),v($,{key:1,class:"mb-4"})):f("",!0),e.config?.custom?(n(),v(k,{key:2,class:"mb-4"})):f("",!0),e.config?.custom?(n(),v(y,{key:3,class:"mb-4"})):f("",!0),e.config?.custom&&!e.config.instrumental?(n(),v(E,{key:4,class:"mb-4"})):f("",!0),e.config?.action==="extend"?(n(),v(S,{key:5,class:"mb-4"})):f("",!0),e.config?.action==="cover"?(n(),v(M,{key:6,class:"mb-4"})):f("",!0),e.config?.action==="replace_section"?(n(),v(O,{key:7,class:"mb-4"})):f("",!0),s(J,{class:"mb-4"})]),o("div",os,[s(g,{value:e.consumption,service:e.service},null,8,["value","service"]),s(oe,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:d(()=>[s(C,{icon:"fa-solid fa-magic",class:"mr-2"}),U(" "+a(e.generateButtonText),1)]),_:1},8,["onClick"])])])}const ns=V(xo,[["render",ss],["__scopeId","data-v-6642bb3c"]]),rs=te("producer"),is=b({name:"TaskPreview",components:{ElImage:N,ElIcon:K,ElTooltip:Le,FontAwesomeIcon:D,VideoPlay:Q,VideoPause:Y,ElDropdown:Ie,ElDropdownMenu:Fe,ElDropdownItem:Te,Loading:ae},props:{modelValue:{type:Object,required:!0}},data(){return{isFetchingVideoUrl:!1,isFetchingWav:!1}},computed:{loading(){return this.$store.state.producer?.status?.getApplications===L.Request},credential(){return this.$store.state.producer.credential},config(){return this.$store.state.producer.config},task(){return this.$store.state.producer?.tasks},audios(){const e=this.modelValue?.response?.data??[],t=this.modelValue?.request?.action;return t?e.map(l=>({...l,action:t})):e},application(){return this.$store.state.producer?.application},active(){return this.$store.state.producer?.tasks?.active}},methods:{useFormatDuring:j,onPlay(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){this.$store.state?.producer?.audio?.id!==e.id&&this.onPlay({...e,progress:0})},onExtend(e,t){e.stopPropagation(),console.debug("set config",t),this.$store.commit("producer/setConfig",{...this.$store.state.producer?.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();const i=new URL(t).pathname,h=i.substring(i.lastIndexOf("/")+1);fetch(t).then(p=>p.blob()).then(p=>{ve.saveAs(p,h)})},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("producer.message.getVideoUrlFailed"))}finally{this.isFetchingVideoUrl=!1}},async fetchVideoUrlFromApi(e){return new Promise((t,l)=>{const i={audio_id:e},h=this.credential?.token;if(!h){console.error("no token specified"),l(new Error("No token specified"));return}I.video(i,{token:h}).then(p=>{const u=p.data?.data?.video_url;u?t(u):l(new Error("Video URL not found in response"))}).catch(p=>{l(p)})})},onPreview(e,t){e.stopPropagation(),window.open(t,"_blank")},async onGetStems(e){await this.onGenerateAudioUrl("stems",e)},onCover(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,model:e.model,custom:!0,instrumental:!1,style:e.style,action:"cover",audio:e,audio_id:e.id})},onVariation(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,model:e.model,custom:!0,style:e.style,action:"variation",audio:e,audio_id:e.id})},async onSwapVocals(e){await this.onGenerateAudioUrl("swap_vocals",e)},async onSwapInstrumentals(e){await this.onGenerateAudioUrl("swap_instrumentals",e)},async onGetAllStems(e){await this.onGenerateAudioUrl("all_stems",e)},onReplaceSection(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.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)})},async handleWavDownload(e){if(!e?.id||this.isFetchingWav)return;const t=this.credential?.token;if(t)try{this.isFetchingWav=!0,w.info(this.$t("producer.message.fetchingWav"));const i=(await I.wav({audio_id:e.id},{token:t})).data?.data?.audio_url;i?this.onDownload(null,i):w.error(this.$t("producer.message.fetchWavFailed"))}catch{w.error(this.$t("producer.message.fetchWavFailed"))}finally{this.isFetchingWav=!1}},async onGenerateAudioUrl(e,t){const l={action:e,audio_id:t,callback_url:rs},i=this.credential?.token;if(!i){console.error("no token specified");return}w.info(this.$t("producer.message.startingTask")),I.audio(l,{token:i}).then(()=>{w.success(this.$t("producer.message.startTaskSuccess"))}).catch(h=>{w.error(h?.response?.data?.error?.message||this.$t("producer.message.startTaskFailed"))}).finally(async()=>{await this.onGetTasks(),await this.onScrollDown()})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".tasks");e&&(e.scrollTop=e.scrollHeight)},1e3)},async onGetTasks(){if(this.loading){console.debug("loading");return}await this.$store.dispatch("producer/getTasks",{limit:30,offset:0})}}}),as={class:"task"},ls=["onClick"],cs={class:"left"},ds=["onClick"],us=["onClick"],ps={key:2,class:"duration"},ms={class:"info"},fs={class:"title"},hs={class:"style"},_s={class:"right"},$s={class:"el-dropdown-link"},gs={class:"flex items-center min-w-[120px]"},vs={class:"flex items-center min-w-[120px]"},ys={class:"el-dropdown-link"};function ks(e,t,l,i,h,p){const u=r("el-image"),m=r("video-pause"),_=r("el-icon"),$=r("video-play"),k=r("font-awesome-icon"),y=r("el-tooltip"),E=r("Loading"),S=r("el-dropdown-item"),M=r("el-dropdown-menu"),O=r("el-dropdown"),J=H("loading");return n(),c("div",as,[(n(!0),c(G,null,q(e.audios,g=>(n(),c("div",{key:g.id,class:"audio",onClick:P(C=>e.onClick(g),["stop"])},[R((n(),c("div",cs,[s(u,{src:g?.image_url,class:"cover",fit:"cover",lazy:""},null,8,["src"]),g?.audio_url&&e.$store.state?.producer?.audio?.id===g.id&&e.$store.state?.producer?.audio?.state==="playing"?(n(),c("div",{key:0,class:"overlay",onClick:P(C=>e.onPause(g),["stop"])},[s(_,null,{default:d(()=>[s(m)]),_:1})],8,ds)):f("",!0),g?.audio_url&&(e.$store.state?.producer?.audio?.id!==g.id||e.$store.state?.producer?.audio?.id===g.id&&e.$store.state?.producer?.audio?.state==="paused")?(n(),c("div",{key:1,class:"overlay",onClick:P(C=>e.onPlay(g),["stop"])},[s(_,null,{default:d(()=>[s($)]),_:1})],8,us)):f("",!0),g?.duration?(n(),c("div",ps,a(e.useFormatDuring(g?.duration)),1)):f("",!0)])),[[J,!g?.audio_url]]),o("div",ms,[o("h2",fs,a(g?.title),1),o("p",hs,a(g?.style),1)]),o("div",_s,[s(O,null,{dropdown:d(()=>[s(M,null,{default:d(()=>[s(S,{disabled:e.isFetchingVideoUrl,onClick:C=>e.handleVideoDownload(g)},{default:d(()=>[o("div",gs,[e.isFetchingVideoUrl?(n(),v(_,{key:0,class:"is-loading mr-2"},{default:d(()=>[s(E)]),_:1})):f("",!0),o("span",null,a(e.$t("producer.button.download_video")),1)])]),_:1},8,["disabled","onClick"]),g?.audio_url?(n(),v(S,{key:0,onClick:P(C=>e.onDownload(C,g?.audio_url),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.download_audio")),1)]),_:1},8,["onClick"])):f("",!0),s(S,{disabled:e.isFetchingWav,onClick:C=>e.handleWavDownload(g)},{default:d(()=>[o("div",vs,[e.isFetchingWav?(n(),v(_,{key:0,class:"is-loading mr-2"},{default:d(()=>[s(E)]),_:1})):f("",!0),o("span",null,a(e.$t("producer.button.download_wav")),1)])]),_:1},8,["disabled","onClick"])]),_:2},1024)]),default:d(()=>[o("span",$s,[s(y,{effect:"dark",content:e.$t("producer.button.download"),placement:"top"},{default:d(()=>[g?.audio_url||g?.video_url?(n(),v(k,{key:0,icon:"fa-solid fa-download",class:"icon icon-download"})):f("",!0)]),_:2},1032,["content"])])]),_:2},1024),s(O,null,{dropdown:d(()=>[s(M,null,{default:d(()=>[g?.audio_url?(n(),v(S,{key:0,onClick:P(C=>e.onExtend(C,g),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.extend")),1)]),_:1},8,["onClick"])):f("",!0),g.id?(n(),v(S,{key:1,onClick:P(C=>e.onGetStems(g.id),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.get_stems")),1)]),_:1},8,["onClick"])):f("",!0),g.id?(n(),v(S,{key:2,onClick:P(C=>e.onGetAllStems(g.id),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.all_stems")),1)]),_:1},8,["onClick"])):f("",!0),s(S,{onClick:P(C=>e.onCover(g),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.cover_music")),1)]),_:1},8,["onClick"]),g?.id?(n(),v(S,{key:3,onClick:P(C=>e.onVariation(g),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.variation")),1)]),_:1},8,["onClick"])):f("",!0),g?.id?(n(),v(S,{key:4,onClick:P(C=>e.onSwapVocals(g.id),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.swap_vocals")),1)]),_:1},8,["onClick"])):f("",!0),g?.id?(n(),v(S,{key:5,onClick:P(C=>e.onSwapInstrumentals(g.id),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.swap_instrumentals")),1)]),_:1},8,["onClick"])):f("",!0),g?.id?(n(),v(S,{key:6,onClick:P(C=>e.onReplaceSection(g),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.replace_section")),1)]),_:1},8,["onClick"])):f("",!0)]),_:2},1024)]),default:d(()=>[o("span",ys,[s(y,{effect:"dark",content:e.$t("producer.button.more"),placement:"top"},{default:d(()=>[g?.audio_url||g?.video_url?(n(),v(k,{key:0,icon:"fa-solid fa-ellipsis",class:"icon icon-ellipsis"})):f("",!0)]),_:2},1032,["content"])])]),_:2},1024)])],8,ls))),128))])}const bs=V(is,[["render",ks]]),ws={class:"player-slider"},Cs=b({__name:"PlayerSlider",setup(e){const t=Z(),l=T({get:()=>t.state.producer?.audio?.progress,set:u=>t.commit("producer/setAudio",{...t.state.producer.audio,progress:u})}),i=T({get:()=>t.state.producer?.audio?.duration,set:u=>t.commit("producer/setAudio",{...t.state.producer.audio,duration:u})}),h=()=>{},p=u=>t.dispatch("producer/setAudio",{...t.state.producer.audio,progress:u});return(u,m)=>(n(),c("div",ws,[s(A(x),{modelValue:l.value,"onUpdate:modelValue":m[0]||(m[0]=_=>l.value=_),"show-tooltip":!1,min:0,max:i.value,onChange:p,onInput:h},null,8,["modelValue","max"])]))}}),Vs={class:"flex player-song"},Ss=["src"],Us={class:"ml-2 text-xs flex flex-col justify-between"},Es={class:"w-52 2xl:w-96 cursor-pointer truncate"},Ps={class:"flex"},As={class:"ml-2 text-dc"},Ts=b({__name:"PlayerSong",setup(e){const t=Z(),l=T({get:()=>t.state.producer.audio,set:i=>t.commit("producer/setAudio",i)});return ne(l,(i,h)=>{if(i?.audio_url!==h?.audio_url){console.log("audio changed",i),i.object&&(console.log("111",i.object),i.object.pause(),delete i.object);const p=new Audio(i.audio_url);i.state==="playing"?p.play():p.pause(),p.addEventListener("loadedmetadata",()=>{p.currentTime=0,p.addEventListener("timeupdate",()=>{t.commit("producer/setAudio",{...t.state.producer.audio,progress:p.currentTime})})}),t.commit("producer/setAudio",{...t.state.producer.audio,object:p})}else if(i?.progress!==h?.progress&&Math.abs(i.progress-i.object.currentTime)>2){console.log("progress changed",i.progress);const p=t.state.producer.audio;p.object&&(p.object.currentTime=p.progress)}else i?.state!==h?.state&&(console.log("state changed",i.state),i.object&&(i.state==="playing"?i.object.play():i.object.pause()));i?.volume!==h?.volume&&(console.log("volume changed",i.volume),i.object&&(i.object.volume=i.volume/100))}),(i,h)=>(n(),c("div",Vs,[o("img",{alt:"",class:"w-11 h-11 rounded",src:l.value?.image_url||A(ye)},null,8,Ss),o("div",Us,[o("div",Es,[o("div",Ps,[o("span",null,a(l.value?.title||"Music"),1),o("span",As,"- "+a(l.value?.style||"SmallRuralDog"),1)])])])]))}}),Fs={class:"flex justify-end items-center gap-x-2.5"},Is={class:"text-xs"},Ls=b({__name:"PlayerAction",setup(e){const t=Z(),l=T({get:()=>t.state.producer?.audio?.progress,set:h=>t.commit("producer/setAudio",{...t.state.producer.audio,progress:h})}),i=T({get:()=>t.state.producer?.audio?.duration,set:h=>t.commit("producer/setAudio",{...t.state.producer.audio,duration:h})});return(h,p)=>(n(),c("div",Fs,[o("span",Is,a(A(j)(l.value))+" / "+a(A(j)(i.value)),1)]))}}),Gs={class:"player-volume flex flex-col items-center pt-2"},js={class:"text-sm mt-3"},Ds=b({__name:"PlayerVolumeSlider",setup(e){const t=Z(),l=T({get:()=>t.state.producer.audio?.volume,set:p=>t.commit("producer/setAudio",{...t.state.producer.audio,volume:p})}),i=T({get:()=>t.state.producer.audio?.muted,set:p=>t.commit("producer/setAudio",{...t.state.producer.audio,muted:p})}),h=p=>t.dispatch("producer/setVolume",p);return(p,u)=>(n(),c("div",Gs,[s(A(x),{modelValue:l.value,"onUpdate:modelValue":u[0]||(u[0]=m=>l.value=m),vertical:"",height:"100px","show-tooltip":!1,max:100,min:0,size:"small",disabled:i.value,onInput:h},null,8,["modelValue","disabled"]),o("div",js,a(l.value),1)]))}}),Rs={class:"flex items-center justify-center gap-x-3"},Zs=b({__name:"PlayerController",setup(e){const t=Z(),l=()=>t.dispatch("producer/setAudio",{...t.state.producer.audio,state:t.state.producer.audio.state==="playing"?"paused":"playing"}),i=T(()=>t.state.producer.audio);return(h,p)=>(n(),c("div",Rs,[s(ee,{icon:i.value?.state==="playing"?A(ke):A(be),size:"45",theme:"filled",class:"text-[var(--el-color-primary)] cursor-pointer",onClick:l},null,8,["icon"]),s(A(Ge),{placement:"top",width:"50px",trigger:"click"},{reference:d(()=>[s(ee,{icon:A(we),size:"20","stroke-width":2,class:"cursor-pointer"},null,8,["icon"])]),default:d(()=>[s(Ds)]),_:1})]))}}),zs={class:"flex flex-col items-stretch h-20"},Ns={class:"flex grow px-5 items-center"},Ms={class:"flex-1"},Os={class:"flex-1"},Bs={class:"flex-1"},qs=b({__name:"Player",setup(e){return(t,l)=>(n(),c("div",zs,[s(Cs),o("div",Ns,[o("div",Ms,[s(Ts)]),o("div",Os,[s(Zs)]),o("div",Bs,[s(Ls)])])]))}}),Ws=b({name:"RecentPanel",components:{ElSkeletonItem:Re,ElSkeleton:De,TaskPreview:bs,Player:qs,NoTasks:je,ScrollList:_e},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.producer?.tasks,items:this.$store.state.producer?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Hs={key:0,class:"tasks"},Ks={class:"left w-[70px] p-[10px] flex items-center"},Js={class:"main w-[calc(100%-70px)] flex-1 p-[10px]"},Ys={key:2,class:"w-full flex-1 flex items-center justify-center"},Qs={class:"h-20"};function Xs(e,t,l,i,h,p){const u=r("el-skeleton-item"),m=r("el-skeleton"),_=r("task-preview"),$=r("scroll-list"),k=r("no-tasks"),y=r("player");return n(),c(G,null,[e.tasks?.items===void 0?(n(),c("div",Hs,[(n(),c(G,null,q(3,E=>o("div",{key:E,class:"flex"},[o("div",Ks,[s(m,{animated:""},{template:d(()=>[s(u,{variant:"image",class:"avatar w-[50px] h-[50px]"})]),_:1})]),o("div",Js,[s(m,{animated:""},{template:d(()=>[s(u,{variant:"p",class:"w-[200px] h-[15px] mb-[5px] mt-[10px]"}),s(u,{variant:"text"})]),_:1})])])),64))])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(n(),v($,{key:1,ref:"scrollList",class:"flex-1 w-full overflow-y-auto tasks p-2",loading:e.loading,onReachTop:t[0]||(t[0]=E=>e.$emit("reach-top"))},{default:d(()=>[(n(!0),c(G,null,q(e.tasks?.items,(E,S)=>(n(),v(_,{key:S,"model-value":E,class:"preview"},null,8,["model-value"]))),128))]),_:1},8,["loading"])):f("",!0),e.tasks?.items?.length===0?(n(),c("div",Ys,[s(k)])):f("",!0),R(o("div",Qs,[s(y)],512),[[re,!!e.$store?.state?.producer?.audio?.object]])],64)}const xs=V(Ws,[["render",Xs]]),en=b({name:"TaskPreview",components:{IconPicture:le,ElImage:N,ElAvatar:Ce,ElIcon:K},computed:{audio(){return this.$store.state.producer?.audio}}}),tn={key:0,class:"size-full overflow-hidden"},on={class:"relative h-[300px]"},sn={class:"flex items-center justify-center size-full bg-[var(--el-bg-color)]"},nn={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"},rn={class:"p-4"},an={class:"flex items-center font-bold mb-2"},ln={class:"text-[var(--el-text-color-regular)] mb-2"},cn={class:"text-xs text-[var(--el-text-color-regular)]"},dn={class:"mt-4 text-sm leading-[25px] whitespace-pre-wrap"},un={key:1,class:"w-full h-full"};function pn(e,t,l,i,h,p){const u=r("icon-picture"),m=r("el-icon"),_=r("el-image"),$=r("el-avatar");return e.audio?.object?(n(),c("div",tn,[o("div",on,[s(_,{src:e.audio.image_url,fit:"cover",class:"size-full"},{error:d(()=>[o("div",sn,[s(m,{class:"text-3xl"},{default:d(()=>[s(u)]),_:1})])]),_:1},8,["src"]),o("h2",nn,a(e.audio?.title),1)]),o("div",rn,[o("div",an,[s($,{size:30,src:e.audio?.image_url,class:"mr-2"},null,8,["src"]),o("span",null,a(e.audio?.title),1)]),o("p",ln,a(e.audio?.style),1),o("p",cn,a(e.$dayjs.format(e.audio?.created_at)),1),o("div",dn,[o("p",null,a(e.audio?.lyric),1)])])])):(n(),c("div",un))}const mn=V(en,[["render",pn]]),fn=te("producer"),hn=b({name:"ProducerIndex",components:{Layout:qe,ConfigPanel:ns,RecentPanel:xs,PreviewPanel:mn},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.producer?.status?.getApplications===L.Request},tasksLoading(){return this.$store.state.producer?.status?.getTasks===L.Request||this.fetchingTasks},service(){return this.$store.state.producer.service},credential(){return this.$store.state.producer.credential},config(){return this.$store.state.producer.config},initializing(){return this.$store.state.producer.status.getApplications===L.Request},needApply(){return this.$store.state.producer.status.getApplications===L.Success&&!this.application},application(){return this.$store.state.producer.application},tasks(){return this.$store.state.producer.tasks},applications(){return this.$store.state.producer.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 $e({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("producer/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplications"),await this.$store.dispatch("producer/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===ue&&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:l,createdAtMax:i}=e||{};console.debug("limit",t,"createdAtMin",l,"createdAtMax",i),this.fetchingTasks=!0;try{await this.$store.dispatch("producer/getTasks",{limit:t,createdAtMin:l,createdAtMax:i})}finally{this.fetchingTasks=!1}},async onGenerateAudio(){const e={...this.config,callback_url:fn},t=this.credential?.token;if(!t){console.error("no token specified");return}w.info(this.$t("producer.message.startingTask")),ce("producer",I.audio(e,{token:t})).then(()=>{w.success(this.$t("producer.message.startTaskSuccess"))}).catch(l=>{w.error(l?.response?.data?.error?.message||this.$t("producer.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function _n(e,t,l,i,h,p){const u=r("config-panel"),m=r("recent-panel"),_=r("preview-panel"),$=r("layout");return n(),v($,null,{config:d(()=>[s(u,{onGenerate:e.onGenerateAudio},null,8,["onGenerate"])]),result:d(()=>[s(m,{ref:"recentPanel",class:"panel recent",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),preview:d(()=>[s(_)]),_:1})}const mr=V(hn,[["render",_n],["__scopeId","data-v-d6806962"]]);export{mr as default};
1
+ import{F as D}from"./index.es-BDOMZBHy.js";import{E as W}from"./index-r1WlQTkd.js";import{E as se}from"./index-Blv6QaIk.js";import{d as b,H as c,E as o,z as B,C as s,y as d,D as r,q as n,F as a,O as G,N as q,J as f,x as v,I as U,G as R,K as H,M as P,u as A,c as T,w as ne,L as re}from"./vendor-vue-NSDaktjZ.js";import{E as V,b7 as ie,ef as Y,eg as Q,S as K,H as ae,aw as L,ce as te,eh as Z,ei as le,cd as ce,a7 as de}from"./index-tspOPlR8.js";import{a as ue}from"./errorCode-Cqj9Td_Z.js";import{p as I}from"./producer-BXowpSi3.js";import{b as pe}from"./producer-DP85fuAq.js";import{E as me}from"./index-Dm0MxC20.js";import{E as fe,a as he}from"./index-DZa1Dmz4.js";import{I as F,S as _e,l as $e}from"./pagination-DEnicVya.js";import{E as ge}from"./index-DnX3iGId.js";import{E as w}from"./index-BJ8z356Q.js";import{E as z}from"./index-D9WB_FIQ.js";import{u as j,F as ve,O as ye,_ as ee,P as ke,a as be,V as we,E as Ce}from"./IconPark.vue_vue_type_script_setup_true_lang-BwGTLkUK.js";import{E as X}from"./index-C_buhEqX.js";import{E as N}from"./index-CNDbe5I7.js";import{E as Ve,a as Se}from"./index-aB7y_QWB.js";import{E as x}from"./index-BynkfymK.js";import{E as Ue,a as Ee}from"./index-6Sl08ozG.js";import{C as Pe}from"./Consumption-D5MPVVSr.js";import{a as Ae}from"./price-kWAt8zxX.js";import{E as Te,b as Fe,a as Ie}from"./index-DgVbYko9.js";import{E as Le}from"./index-BCps6OLj.js";import{E as Ge}from"./index-ChPPFHWB.js";import{N as je}from"./NoTasks-DKhvXOog.js";import{a as De,E as Re}from"./index-Dt3sdSti.js";import"./use-form-item-CiGuYlwo.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./validator-DruHczS_.js";import"./index-CjRED359.js";import"./index-MeXqAg39.js";import"./typescript-VAjzYBVV.js";import"./strings-beZM2Y-f.js";import"./isEqual-CRG_uQtW.js";import"./_Uint8Array-BeRfpqL7.js";import"./castArray-278F4M9m.js";import"./debounce-CnPBB63_.js";import"./_baseIteratee-DuHUzj8X.js";import"./index-CIHBGnWH.js";import"./index-HqBS33mo.js";import"./_baseClone-DquV2Mnx.js";import"./_initCloneObject-9PUJFEMx.js";import"./index-CPETW0B-.js";import"./index-Cu41y2Fl.js";import"./index-Csdbp49a.js";import"./dropdown-DsiaFkVQ.js";const Ze=b({name:"LayoutProducer",components:{ElDrawer:se,ElButton:W,FontAwesomeIcon:D},data(){return{drawer:!1,preview:!1}},computed:{}}),ze={class:"main flex flex-row flex-1"},Ne={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},Me={class:"result h-full flex flex-col flex-1 min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"},Oe={class:"preview h-full w-[300px] flex flex-col"};function Be(e,t,l,i,h,p){const u=r("font-awesome-icon"),m=r("el-button"),_=r("el-drawer");return n(),c("div",ze,[o("div",Ne,[B(e.$slots,"config",{},void 0,!0)]),o("div",Me,[B(e.$slots,"result",{},void 0,!0)]),o("div",Oe,[B(e.$slots,"preview",{},void 0,!0)]),s(m,{circle:"",class:"menu",onClick:t[0]||(t[0]=$=>e.drawer=!0)},{default:d(()=>[s(u,{icon:"fa-solid fa-magic"})]),_:1}),s(_,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=$=>e.drawer=$),direction:"ltr","with-header":!1,size:"340px",class:"drawer"},{default:d(()=>[B(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const qe=V(Ze,[["render",Be],["__scopeId","data-v-7453886f"]]),We=b({name:"TypeSelector",components:{ElSelect:he,ElOption:fe,ElSwitch:me},data(){return{options:[{label:"FUZZ-2.0 Pro",value:"FUZZ-2.0 Pro",info:"8 min"},{label:"FUZZ-2.0",value:"FUZZ-2.0",info:"8 min"},{label:"FUZZ-2.0 Raw",value:"FUZZ-2.0 Raw",info:"8 min"},{label:"FUZZ-1.1 Pro",value:"FUZZ-1.1 Pro",info:"4 min"},{label:"FUZZ-1.0 Pro",value:"FUZZ-1.0 Pro",info:"4 min"},{label:"FUZZ-1.1",value:"FUZZ-1.1",info:"4 min"},{label:"FUZZ-1.0",value:"FUZZ-1.0",info:"2 min"},{label:"FUZZ-0.8",value:"FUZZ-0.8",info:"2 min"}]}},computed:{custom:{get(){return this.$store.state.producer?.config?.custom||!1},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,custom:e})}},instrumental:{get(){return this.$store.state.producer?.config?.instrumental||!1},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,instrumental:e})}},model:{get(){return this.$store.state.producer?.config?.model},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,model:e})}}},mounted(){this.model||(this.model=pe)}}),He={class:"flex items-center justify-between mb-3"},Ke={class:"text-sm font-bold"},Je={class:"mb-3"},Ye={class:"flex items-center mb-1"},Qe={class:"text-sm font-bold"},Xe={class:"flex items-center justify-between w-full"},xe={class:"text-xs text-[var(--el-text-color-placeholder)]"},et={key:0,class:"flex items-center justify-between mb-3"},tt={class:"text-sm font-bold"};function ot(e,t,l,i,h,p){const u=r("el-switch"),m=r("el-option"),_=r("el-select");return n(),c("div",null,[o("div",He,[o("span",Ke,a(e.$t("producer.name.type")),1),s(u,{modelValue:e.custom,"onUpdate:modelValue":t[0]||(t[0]=$=>e.custom=$)},null,8,["modelValue"])]),o("div",Je,[o("div",Ye,[o("span",Qe,a(e.$t("producer.name.model")),1)]),s(_,{modelValue:e.model,"onUpdate:modelValue":t[1]||(t[1]=$=>e.model=$),class:"w-full",size:"default",placeholder:e.$t("producer.placeholder.select")},{default:d(()=>[(n(!0),c(G,null,q(e.options,$=>(n(),v(m,{key:$.value,label:$.label,value:$.value},{default:d(()=>[o("div",Xe,[o("span",null,a($.label),1),o("span",xe,a($.info),1)])]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),e.custom?(n(),c("div",et,[o("span",tt,a(e.$t("producer.name.instrumental")),1),s(u,{modelValue:e.instrumental,"onUpdate:modelValue":t[2]||(t[2]=$=>e.instrumental=$)},null,8,["modelValue"])])):f("",!0)])}const st=V(We,[["render",ot]]),nt=b({name:"UploadAudio",components:{ElUpload:ge,ElButton:W,InfoIcon:F,FontAwesomeIcon:D},emits:["change"],data(){return{fileList:[],uploadUrl:ie()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},credential(){return this.$store.state.producer.credential},config(){return this.$store.state.producer.config},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.producer?.config?.audio_id},set(){}}},watch:{urls:{handler(e){this.$emit("change",e)}}},mounted(){this.value||(this.value=void 0),this.onSetAudio()},methods:{onExceed(){w.warning(this.$t("producer.message.uploadReferencesExceed"))},onError(){w.error(this.$t("producer.message.uploadReferencesError"))},async onSuccess(){const e=this.urls?.[0];await this.onGenerateAudioId(e)},async onGenerateAudioId(e){const t={audio_url:e},l=this.credential?.token;if(!l){console.error("no token specified");return}w.info(this.$t("producer.message.startingUploadAudio")),I.upload(t,{token:l}).then(i=>{console.debug("get upload music success",i.data);const h=i.data?.data.audio_id;this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,audio_id:h,action:"upload_extend"}),w.success(this.$t("producer.message.startUploadAudioSuccess"))}).catch(i=>{w.error(i?.response?.data?.error?.message||this.$t("producer.message.startUploadAudioFailed"))})},onSetAudio(){}}}),rt={class:"relative"},it={class:"flex justify-between"},at={class:"flex justify-start items-center"},lt={class:"text-sm font-bold"};function ct(e,t,l,i,h,p){const u=r("info-icon"),m=r("font-awesome-icon"),_=r("el-button"),$=r("el-upload");return n(),c("div",rt,[o("div",it,[o("div",at,[o("span",lt,a(e.$t("producer.name.referenceAudios")),1),s(u,{content:e.$t("producer.description.uploadAudios")},null,8,["content"])])]),s($,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=k=>e.fileList=k),name:"file",limit:1,class:"upload-wrapper",action:e.uploadUrl,accept:".mp3","show-file-list":!0,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{default:d(()=>[s(_,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:d(()=>[s(m,{icon:"fa-solid fa-upload",class:"icon mr-1"}),U(" "+a(e.$t("producer.button.uploadAudios")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const dt=V(nt,[["render",ct],["__scopeId","data-v-e4cd0467"]]),ut="",pt=b({name:"PromptInput",components:{ElInput:z,InfoIcon:F},computed:{prompt:{get(){return this.$store.state.producer?.config?.prompt},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=ut)}}),mt={class:"field"},ft={class:"flex items-center mb-1"},ht={class:"text-sm font-bold"};function _t(e,t,l,i,h,p){const u=r("info-icon"),m=r("el-input");return n(),c("div",mt,[o("div",ft,[o("span",ht,a(e.$t("producer.name.songDescription")),1),s(u,{content:e.$t("producer.description.prompt")},null,8,["content"])]),s(m,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=_=>e.prompt=_),rows:4,type:"textarea",placeholder:e.$t("producer.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const $t=V(pt,[["render",_t]]),gt="",vt=b({name:"LyricInput",components:{ElInput:z,ElButton:W,FontAwesomeIcon:D,InfoIcon:F},data(){return{generatingLyrics:!1}},computed:{lyric:{get(){return this.$store.state.producer?.config?.lyric},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,lyric:e})}},config(){return this.$store.state.producer?.config},credential(){return this.$store.state.producer?.credential}},mounted(){this.lyric||(this.lyric=gt)},methods:{async onGenerateLyrics(){const e=this.credential?.token;if(!e)return;const t=this.config?.style||this.config?.title||"a beautiful song";this.generatingLyrics=!0,w.info(this.$t("producer.message.generatingLyrics"));try{const i=(await I.lyric({prompt:t},{token:e})).data?.data;i?.text&&(this.lyric=i.text,i?.title&&!this.config?.title&&this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,lyric:i.text,title:i.title}),w.success(this.$t("producer.message.generateLyricsSuccess")))}catch{w.error(this.$t("producer.message.generateLyricsFailed"))}finally{this.generatingLyrics=!1}}}}),yt={class:"field"},kt={class:"flex items-center justify-between mb-1"},bt={class:"flex items-center"},wt={class:"text-sm font-bold"};function Ct(e,t,l,i,h,p){const u=r("info-icon"),m=r("font-awesome-icon"),_=r("el-button"),$=r("el-input");return n(),c("div",yt,[o("div",kt,[o("div",bt,[o("span",wt,a(e.$t("producer.name.lyrics")),1),s(u,{content:e.$t("producer.description.lyrics")},null,8,["content"])]),e.config?.action!=="extend"?(n(),v(_,{key:0,size:"small",loading:e.generatingLyrics,round:"",onClick:e.onGenerateLyrics},{default:d(()=>[e.generatingLyrics?f("",!0):(n(),v(m,{key:0,icon:"fa-solid fa-wand-magic-sparkles",class:"mr-1"})),U(" "+a(e.$t("producer.button.generate_lyrics")),1)]),_:1},8,["loading","onClick"])):f("",!0)]),e.config?.action!=="extend"?(n(),v($,{key:0,modelValue:e.lyric,"onUpdate:modelValue":t[0]||(t[0]=k=>e.lyric=k),rows:5,type:"textarea",class:"lyrics",placeholder:e.$t("producer.placeholder.lyrics")},null,8,["modelValue","placeholder"])):(n(),v($,{key:1,modelValue:e.lyric,"onUpdate:modelValue":t[1]||(t[1]=k=>e.lyric=k),rows:5,type:"textarea",class:"lyrics",placeholder:e.$t("producer.placeholder.extend.lyrics")},null,8,["modelValue","placeholder"]))])}const Vt=V(vt,[["render",Ct],["__scopeId","data-v-88c6da2b"]]),St=b({name:"StyleInput",components:{ElInput:z,InfoIcon:F},computed:{style:{get(){return this.$store.state.producer?.config?.style},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,style:e})}}}}),Ut={class:"field"},Et={class:"flex items-center justify-between mb-1"},Pt={class:"flex items-center"},At={class:"text-sm font-bold"};function Tt(e,t,l,i,h,p){const u=r("info-icon"),m=r("el-input");return n(),c("div",Ut,[o("div",Et,[o("div",Pt,[o("span",At,a(e.$t("producer.name.style")),1),s(u,{content:e.$t("producer.description.style")},null,8,["content"])])]),s(m,{modelValue:e.style,"onUpdate:modelValue":t[0]||(t[0]=_=>e.style=_),rows:2,type:"textarea",placeholder:e.$t("producer.placeholder.style")},null,8,["modelValue","placeholder"])])}const Ft=V(St,[["render",Tt]]),It=b({name:"TitleInput",components:{ElInput:z,InfoIcon:F},computed:{title:{get(){return this.$store.state.producer?.config?.title},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,title:e})}}}}),Lt={class:"field"},Gt={class:"flex items-center mb-1"},jt={class:"text-sm font-bold"};function Dt(e,t,l,i,h,p){const u=r("info-icon"),m=r("el-input");return n(),c("div",Lt,[o("div",Gt,[o("span",jt,a(e.$t("producer.name.title")),1),s(u,{content:e.$t("producer.description.title")},null,8,["content"])]),s(m,{modelValue:e.title,"onUpdate:modelValue":t[0]||(t[0]=_=>e.title=_),placeholder:e.$t("producer.placeholder.title")},null,8,["modelValue","placeholder"])])}const Rt=V(It,[["render",Dt]]),Zt=b({name:"ExtendFromInput",components:{ElImage:N,ElIcon:K,ElInputNumber:X,VideoPlay:Q,VideoPause:Y},data(){return{}},computed:{audio(){return this.$store.state.producer?.config?.audio},value:{get(){return this.$store.state.producer?.config?.continue_at},set(e){console.debug("set continue_at",e),this.$store.commit("producer/setConfig",{...this.$store.state.producer?.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:j,onPlay(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){this.$store.state?.producer?.audio?.id!==e.id&&this.onPlay({...e,progress:0})}}}),zt={class:"field"},Nt={class:"box"},Mt={class:"title font-bold"},Ot={class:"input-wrapper"},Bt={class:"task"},qt={class:"left"},Wt={key:2,class:"duration"},Ht={class:"info"},Kt={class:"title"},Jt={class:"style"};function Yt(e,t,l,i,h,p){const u=r("el-input-number"),m=r("el-image"),_=r("video-pause"),$=r("el-icon"),k=r("video-play"),y=H("loading");return n(),c("div",zt,[o("div",Nt,[o("h2",Mt,a(e.$t("producer.name.extend")),1),o("div",Ot,[s(u,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=E=>e.value=E),class:"value",min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t("producer.placeholder.extend.continue_at"),onChange:e.handleChange},null,8,["modelValue","max","placeholder","onChange"])])]),o("div",Bt,[e.audio?(n(),c("div",{key:0,class:"audio",onClick:t[3]||(t[3]=E=>e.onClick(e.audio))},[R((n(),c("div",qt,[s(m,{src:e.audio?.image_url,class:"cover",fit:"cover"},null,8,["src"]),e.audio?.audio_url&&e.$store.state?.producer?.audio?.id===e.audio.id&&e.$store.state?.producer?.audio?.state==="playing"?(n(),c("div",{key:0,class:"overlay",onClick:t[1]||(t[1]=E=>e.onPause(e.audio))},[s($,null,{default:d(()=>[s(_)]),_:1})])):f("",!0),e.audio?.audio_url&&(e.$store.state?.producer?.audio?.id!==e.audio.id||e.$store.state?.producer?.audio?.id===e.audio.id&&e.$store.state?.producer?.audio?.state==="paused")?(n(),c("div",{key:1,class:"overlay",onClick:t[2]||(t[2]=E=>e.onPlay(e.audio))},[s($,null,{default:d(()=>[s(k)]),_:1})])):f("",!0),e.audio?.duration?(n(),c("div",Wt,a(e.useFormatDuring(e.audio?.duration)),1)):f("",!0)])),[[y,!e.audio?.audio_url]]),o("div",Ht,[o("h2",Kt,a(e.audio?.title),1),o("p",Jt,a(e.audio?.style),1)])])):f("",!0)])])}const Qt=V(Zt,[["render",Yt],["__scopeId","data-v-26d43480"]]),Xt=b({name:"CoverFromInput",components:{ElImage:N,ElIcon:K,VideoPlay:Q,VideoPause:Y},data(){return{}},computed:{audio(){return this.$store.state.producer?.config?.audio},value:{get(){return this.$store.state.producer?.config?.continue_at},set(e){console.debug("set continue_at",e),this.$store.commit("producer/setConfig",{...this.$store.state.producer?.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:j,onPlay(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){this.$store.state?.producer?.audio?.id!==e.id&&this.onPlay({...e,progress:0})}}}),xt={class:"field"},eo={class:"box"},to={class:"title font-bold"},oo={class:"task"},so={class:"left"},no={key:2,class:"duration"},ro={class:"info"},io={class:"title"},ao={class:"style"};function lo(e,t,l,i,h,p){const u=r("el-image"),m=r("video-pause"),_=r("el-icon"),$=r("video-play"),k=H("loading");return n(),c("div",xt,[o("div",eo,[o("h2",to,a(e.$t("producer.name.cover")),1)]),o("div",oo,[e.audio?(n(),c("div",{key:0,class:"audio",onClick:t[2]||(t[2]=y=>e.onClick(e.audio))},[R((n(),c("div",so,[s(u,{src:e.audio?.image_url,class:"cover",fit:"cover"},null,8,["src"]),e.audio?.audio_url&&e.$store.state?.producer?.audio?.id===e.audio.id&&e.$store.state?.producer?.audio?.state==="playing"?(n(),c("div",{key:0,class:"overlay",onClick:t[0]||(t[0]=y=>e.onPause(e.audio))},[s(_,null,{default:d(()=>[s(m)]),_:1})])):f("",!0),e.audio?.audio_url&&(e.$store.state?.producer?.audio?.id!==e.audio.id||e.$store.state?.producer?.audio?.id===e.audio.id&&e.$store.state?.producer?.audio?.state==="paused")?(n(),c("div",{key:1,class:"overlay",onClick:t[1]||(t[1]=y=>e.onPlay(e.audio))},[s(_,null,{default:d(()=>[s($)]),_:1})])):f("",!0),e.audio?.duration?(n(),c("div",no,a(e.useFormatDuring(e.audio?.duration)),1)):f("",!0)])),[[k,!e.audio?.audio_url]]),o("div",ro,[o("h2",io,a(e.audio?.title),1),o("p",ao,a(e.audio?.style),1)])])):f("",!0)])])}const co=V(Xt,[["render",lo],["__scopeId","data-v-d8a8e583"]]),uo=b({name:"VocalGenderSelector",components:{ElRadioGroup:Se,ElRadioButton:Ve,InfoIcon:F},computed:{vocalGender:{get(){return this.$store.state.producer?.config?.vocal_gender||""},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,vocal_gender:e||void 0})}}}}),po={class:"mb-2"},mo={class:"flex items-center mb-1"},fo={class:"text-sm font-bold"};function ho(e,t,l,i,h,p){const u=r("info-icon"),m=r("el-radio-button"),_=r("el-radio-group");return n(),c("div",po,[o("div",mo,[o("span",fo,a(e.$t("producer.name.vocalGender")),1),s(u,{content:e.$t("producer.description.vocalGender")},null,8,["content"])]),s(_,{modelValue:e.vocalGender,"onUpdate:modelValue":t[0]||(t[0]=$=>e.vocalGender=$)},{default:d(()=>[s(m,{value:""},{default:d(()=>[U(a(e.$t("producer.gender.auto")),1)]),_:1}),s(m,{value:"f"},{default:d(()=>[U(a(e.$t("producer.gender.female")),1)]),_:1}),s(m,{value:"m"},{default:d(()=>[U(a(e.$t("producer.gender.male")),1)]),_:1})]),_:1},8,["modelValue"])])}const _o=V(uo,[["render",ho]]),$o=b({name:"AdvancedParams",components:{ElCollapse:Ee,ElCollapseItem:Ue,ElInput:z,ElSlider:x,ElInputNumber:X},data(){return{activeNames:[]}},computed:{config(){return this.$store.state.producer?.config},styleNegative:{get(){return this.$store.state.producer?.config?.style_negative||""},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,style_negative:e||void 0})}},lyricPrompt:{get(){return this.$store.state.producer?.config?.lyric_prompt||""},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,lyric_prompt:e||void 0})}},weirdness:{get(){return this.$store.state.producer?.config?.weirdness??0},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,weirdness:e||void 0})}},soundStrength:{get(){return this.$store.state.producer?.config?.sound_strength??50},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,sound_strength:e})}},lyricsStrength:{get(){return this.$store.state.producer?.config?.lyrics_strength??50},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,lyrics_strength:e})}},seed:{get(){return this.$store.state.producer?.config?.seed},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,seed:e})}}}}),go={key:0,class:"mb-3"},vo={class:"flex items-center mb-1"},yo={class:"text-xs font-bold"},ko={key:1,class:"mb-3"},bo={class:"flex items-center mb-1"},wo={class:"text-xs font-bold"},Co={key:2,class:"mb-3"},Vo={class:"flex items-center justify-between mb-1"},So={class:"text-xs font-bold"},Uo={class:"text-xs text-[var(--el-text-color-secondary)]"},Eo={key:3,class:"mb-3"},Po={class:"flex items-center justify-between mb-1"},Ao={class:"text-xs font-bold"},To={class:"text-xs text-[var(--el-text-color-secondary)]"},Fo={key:4,class:"mb-3"},Io={class:"flex items-center justify-between mb-1"},Lo={class:"text-xs font-bold"},Go={class:"text-xs text-[var(--el-text-color-secondary)]"},jo={key:5,class:"mb-3"},Do={class:"flex items-center mb-1"},Ro={class:"text-xs font-bold"};function Zo(e,t,l,i,h,p){const u=r("el-input"),m=r("el-slider"),_=r("el-input-number"),$=r("el-collapse-item"),k=r("el-collapse");return n(),v(k,{modelValue:e.activeNames,"onUpdate:modelValue":t[6]||(t[6]=y=>e.activeNames=y),class:"advanced-collapse"},{default:d(()=>[s($,{title:e.$t("producer.name.advancedParams"),name:"advanced"},{default:d(()=>[e.config?.custom?(n(),c("div",go,[o("div",vo,[o("span",yo,a(e.$t("producer.name.styleNegative")),1)]),s(u,{modelValue:e.styleNegative,"onUpdate:modelValue":t[0]||(t[0]=y=>e.styleNegative=y),placeholder:e.$t("producer.placeholder.styleNegative")},null,8,["modelValue","placeholder"])])):f("",!0),e.config?.custom&&!e.config?.instrumental?(n(),c("div",ko,[o("div",bo,[o("span",wo,a(e.$t("producer.name.lyricPrompt")),1)]),s(u,{modelValue:e.lyricPrompt,"onUpdate:modelValue":t[1]||(t[1]=y=>e.lyricPrompt=y),placeholder:e.$t("producer.placeholder.lyricPrompt")},null,8,["modelValue","placeholder"])])):f("",!0),e.config?.custom?(n(),c("div",Co,[o("div",Vo,[o("span",So,a(e.$t("producer.name.weirdness")),1),o("span",Uo,a(e.weirdness??0),1)]),s(m,{modelValue:e.weirdness,"onUpdate:modelValue":t[2]||(t[2]=y=>e.weirdness=y),min:0,max:100,step:1},null,8,["modelValue"])])):f("",!0),e.config?.custom?(n(),c("div",Eo,[o("div",Po,[o("span",Ao,a(e.$t("producer.name.soundStrength")),1),o("span",To,a(e.soundStrength??50),1)]),s(m,{modelValue:e.soundStrength,"onUpdate:modelValue":t[3]||(t[3]=y=>e.soundStrength=y),min:0,max:100,step:1},null,8,["modelValue"])])):f("",!0),e.config?.custom&&!e.config?.instrumental?(n(),c("div",Fo,[o("div",Io,[o("span",Lo,a(e.$t("producer.name.lyricsStrength")),1),o("span",Go,a(e.lyricsStrength??50),1)]),s(m,{modelValue:e.lyricsStrength,"onUpdate:modelValue":t[4]||(t[4]=y=>e.lyricsStrength=y),min:0,max:100,step:1},null,8,["modelValue"])])):f("",!0),e.config?.custom?(n(),c("div",jo,[o("div",Do,[o("span",Ro,a(e.$t("producer.name.seed")),1)]),s(_,{modelValue:e.seed,"onUpdate:modelValue":t[5]||(t[5]=y=>e.seed=y),min:0,controls:!1,placeholder:e.$t("producer.placeholder.seed"),class:"w-full"},null,8,["modelValue","placeholder"])])):f("",!0)]),_:1},8,["title"])]),_:1},8,["modelValue"])}const zo=V($o,[["render",Zo],["__scopeId","data-v-88e65aee"]]),No=b({name:"ReplaceSectionInput",components:{ElInputNumber:X,ElImage:N,InfoIcon:F},computed:{audio(){return this.$store.state.producer?.config?.audio},replaceSectionStart:{get(){return this.$store.state.producer?.config?.replace_section_start},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,replace_section_start:e})}},replaceSectionEnd:{get(){return this.$store.state.producer?.config?.replace_section_end},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,replace_section_end:e})}}},methods:{onClick(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"playing"})}}}),Mo={class:"field"},Oo={class:"flex items-center mb-2"},Bo={class:"text-sm font-bold m-0"},qo={key:0,class:"task mb-2"},Wo={class:"left relative w-[50px] h-[50px] mr-3 flex-shrink-0"},Ho={class:"info flex-1 min-w-0"},Ko={class:"text-sm font-bold m-0 truncate"},Jo={class:"text-xs text-[var(--el-text-color-secondary)] m-0 truncate"},Yo={class:"flex gap-2"};function Qo(e,t,l,i,h,p){const u=r("info-icon"),m=r("el-image"),_=r("el-input-number"),$=H("loading");return n(),c("div",Mo,[o("div",Oo,[o("h2",Bo,a(e.$t("producer.name.replaceSection")),1),s(u,{content:e.$t("producer.description.replaceSection")},null,8,["content"])]),e.audio?(n(),c("div",qo,[o("div",{class:"audio flex items-center",onClick:t[0]||(t[0]=k=>e.onClick(e.audio))},[R((n(),c("div",Wo,[s(m,{src:e.audio?.image_url,class:"w-full h-full rounded",fit:"cover"},null,8,["src"])])),[[$,!e.audio?.audio_url]]),o("div",Ho,[o("h2",Ko,a(e.audio?.title),1),o("p",Jo,a(e.audio?.style),1)])])])):f("",!0),o("div",Yo,[s(_,{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("producer.placeholder.replaceSectionStart")},null,8,["modelValue","max","placeholder"]),s(_,{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("producer.placeholder.replaceSectionEnd")},null,8,["modelValue","min","max","placeholder"])])])}const Xo=V(No,[["render",Qo]]),xo=b({name:"PresetPanel",components:{TypeSelector:st,PromptInput:$t,LyricInput:Vt,StyleInput:Ft,TitleInput:Rt,ExtendFromInput:Qt,CoverFromInput:co,UploadAudio:dt,VocalGenderSelector:_o,AdvancedParams:zo,ReplaceSectionInput:Xo,FontAwesomeIcon:D,ElButton:W,Consumption:Pe},emits:["generate"],computed:{config(){return this.$store.state.producer?.config},consumption(){return Ae(this.config,this.service?.cost)},service(){return this.$store.state.producer?.service},generateButtonText(){const e=this.config?.action;return e==="extend"?this.$t("producer.button.extend"):e==="cover"?this.$t("producer.button.cover_music"):e==="variation"?this.$t("producer.button.variation"):e==="replace_section"?this.$t("producer.button.replace_section"):e==="stems"?this.$t("producer.button.get_stems"):e==="swap_vocals"?this.$t("producer.button.swap_vocals"):e==="swap_instrumentals"?this.$t("producer.button.swap_instrumentals"):this.$t("producer.button.generate")}},methods:{onGenerate(){this.$emit("generate")}}}),es={class:"flex flex-col h-full"},ts={class:"flex-1 overflow-y-auto p-5"},os={class:"flex flex-col items-center justify-center px-5 pb-5"};function ss(e,t,l,i,h,p){const u=r("type-selector"),m=r("upload-audio"),_=r("prompt-input"),$=r("lyric-input"),k=r("style-input"),y=r("title-input"),E=r("vocal-gender-selector"),S=r("extend-from-input"),M=r("cover-from-input"),O=r("replace-section-input"),J=r("advanced-params"),g=r("consumption"),C=r("font-awesome-icon"),oe=r("el-button");return n(),c("div",es,[o("div",ts,[s(u,{class:"mb-4"}),s(m,{class:"mb-4"}),e.config?.custom?f("",!0):(n(),v(_,{key:0,class:"mb-4"})),e.config?.custom&&!e.config.instrumental?(n(),v($,{key:1,class:"mb-4"})):f("",!0),e.config?.custom?(n(),v(k,{key:2,class:"mb-4"})):f("",!0),e.config?.custom?(n(),v(y,{key:3,class:"mb-4"})):f("",!0),e.config?.custom&&!e.config.instrumental?(n(),v(E,{key:4,class:"mb-4"})):f("",!0),e.config?.action==="extend"?(n(),v(S,{key:5,class:"mb-4"})):f("",!0),e.config?.action==="cover"?(n(),v(M,{key:6,class:"mb-4"})):f("",!0),e.config?.action==="replace_section"?(n(),v(O,{key:7,class:"mb-4"})):f("",!0),s(J,{class:"mb-4"})]),o("div",os,[s(g,{value:e.consumption,service:e.service},null,8,["value","service"]),s(oe,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:d(()=>[s(C,{icon:"fa-solid fa-magic",class:"mr-2"}),U(" "+a(e.generateButtonText),1)]),_:1},8,["onClick"])])])}const ns=V(xo,[["render",ss],["__scopeId","data-v-6642bb3c"]]),rs=te("producer"),is=b({name:"TaskPreview",components:{ElImage:N,ElIcon:K,ElTooltip:Le,FontAwesomeIcon:D,VideoPlay:Q,VideoPause:Y,ElDropdown:Ie,ElDropdownMenu:Fe,ElDropdownItem:Te,Loading:ae},props:{modelValue:{type:Object,required:!0}},data(){return{isFetchingVideoUrl:!1,isFetchingWav:!1}},computed:{loading(){return this.$store.state.producer?.status?.getApplications===L.Request},credential(){return this.$store.state.producer.credential},config(){return this.$store.state.producer.config},task(){return this.$store.state.producer?.tasks},audios(){const e=this.modelValue?.response?.data??[],t=this.modelValue?.request?.action;return t?e.map(l=>({...l,action:t})):e},application(){return this.$store.state.producer?.application},active(){return this.$store.state.producer?.tasks?.active}},methods:{useFormatDuring:j,onPlay(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){this.$store.state?.producer?.audio?.id!==e.id&&this.onPlay({...e,progress:0})},onExtend(e,t){e.stopPropagation(),console.debug("set config",t),this.$store.commit("producer/setConfig",{...this.$store.state.producer?.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();const i=new URL(t).pathname,h=i.substring(i.lastIndexOf("/")+1);fetch(t).then(p=>p.blob()).then(p=>{ve.saveAs(p,h)})},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("producer.message.getVideoUrlFailed"))}finally{this.isFetchingVideoUrl=!1}},async fetchVideoUrlFromApi(e){return new Promise((t,l)=>{const i={audio_id:e},h=this.credential?.token;if(!h){console.error("no token specified"),l(new Error("No token specified"));return}I.video(i,{token:h}).then(p=>{const u=p.data?.data?.video_url;u?t(u):l(new Error("Video URL not found in response"))}).catch(p=>{l(p)})})},onPreview(e,t){e.stopPropagation(),window.open(t,"_blank")},async onGetStems(e){await this.onGenerateAudioUrl("stems",e)},onCover(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,model:e.model,custom:!0,instrumental:!1,style:e.style,action:"cover",audio:e,audio_id:e.id})},onVariation(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,model:e.model,custom:!0,style:e.style,action:"variation",audio:e,audio_id:e.id})},async onSwapVocals(e){await this.onGenerateAudioUrl("swap_vocals",e)},async onSwapInstrumentals(e){await this.onGenerateAudioUrl("swap_instrumentals",e)},async onGetAllStems(e){await this.onGenerateAudioUrl("all_stems",e)},onReplaceSection(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.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)})},async handleWavDownload(e){if(!e?.id||this.isFetchingWav)return;const t=this.credential?.token;if(t)try{this.isFetchingWav=!0,w.info(this.$t("producer.message.fetchingWav"));const i=(await I.wav({audio_id:e.id},{token:t})).data?.data?.audio_url;i?this.onDownload(null,i):w.error(this.$t("producer.message.fetchWavFailed"))}catch{w.error(this.$t("producer.message.fetchWavFailed"))}finally{this.isFetchingWav=!1}},async onGenerateAudioUrl(e,t){const l={action:e,audio_id:t,callback_url:rs},i=this.credential?.token;if(!i){console.error("no token specified");return}w.info(this.$t("producer.message.startingTask")),I.audio(l,{token:i}).then(()=>{w.success(this.$t("producer.message.startTaskSuccess"))}).catch(h=>{w.error(h?.response?.data?.error?.message||this.$t("producer.message.startTaskFailed"))}).finally(async()=>{await this.onGetTasks(),await this.onScrollDown()})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".tasks");e&&(e.scrollTop=e.scrollHeight)},1e3)},async onGetTasks(){if(this.loading){console.debug("loading");return}await this.$store.dispatch("producer/getTasks",{limit:30,offset:0})}}}),as={class:"task"},ls=["onClick"],cs={class:"left"},ds=["onClick"],us=["onClick"],ps={key:2,class:"duration"},ms={class:"info"},fs={class:"title"},hs={class:"style"},_s={class:"right"},$s={class:"el-dropdown-link"},gs={class:"flex items-center min-w-[120px]"},vs={class:"flex items-center min-w-[120px]"},ys={class:"el-dropdown-link"};function ks(e,t,l,i,h,p){const u=r("el-image"),m=r("video-pause"),_=r("el-icon"),$=r("video-play"),k=r("font-awesome-icon"),y=r("el-tooltip"),E=r("Loading"),S=r("el-dropdown-item"),M=r("el-dropdown-menu"),O=r("el-dropdown"),J=H("loading");return n(),c("div",as,[(n(!0),c(G,null,q(e.audios,g=>(n(),c("div",{key:g.id,class:"audio",onClick:P(C=>e.onClick(g),["stop"])},[R((n(),c("div",cs,[s(u,{src:g?.image_url,class:"cover",fit:"cover",lazy:""},null,8,["src"]),g?.audio_url&&e.$store.state?.producer?.audio?.id===g.id&&e.$store.state?.producer?.audio?.state==="playing"?(n(),c("div",{key:0,class:"overlay",onClick:P(C=>e.onPause(g),["stop"])},[s(_,null,{default:d(()=>[s(m)]),_:1})],8,ds)):f("",!0),g?.audio_url&&(e.$store.state?.producer?.audio?.id!==g.id||e.$store.state?.producer?.audio?.id===g.id&&e.$store.state?.producer?.audio?.state==="paused")?(n(),c("div",{key:1,class:"overlay",onClick:P(C=>e.onPlay(g),["stop"])},[s(_,null,{default:d(()=>[s($)]),_:1})],8,us)):f("",!0),g?.duration?(n(),c("div",ps,a(e.useFormatDuring(g?.duration)),1)):f("",!0)])),[[J,!g?.audio_url]]),o("div",ms,[o("h2",fs,a(g?.title),1),o("p",hs,a(g?.style),1)]),o("div",_s,[s(O,null,{dropdown:d(()=>[s(M,null,{default:d(()=>[s(S,{disabled:e.isFetchingVideoUrl,onClick:C=>e.handleVideoDownload(g)},{default:d(()=>[o("div",gs,[e.isFetchingVideoUrl?(n(),v(_,{key:0,class:"is-loading mr-2"},{default:d(()=>[s(E)]),_:1})):f("",!0),o("span",null,a(e.$t("producer.button.download_video")),1)])]),_:1},8,["disabled","onClick"]),g?.audio_url?(n(),v(S,{key:0,onClick:P(C=>e.onDownload(C,g?.audio_url),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.download_audio")),1)]),_:1},8,["onClick"])):f("",!0),s(S,{disabled:e.isFetchingWav,onClick:C=>e.handleWavDownload(g)},{default:d(()=>[o("div",vs,[e.isFetchingWav?(n(),v(_,{key:0,class:"is-loading mr-2"},{default:d(()=>[s(E)]),_:1})):f("",!0),o("span",null,a(e.$t("producer.button.download_wav")),1)])]),_:1},8,["disabled","onClick"])]),_:2},1024)]),default:d(()=>[o("span",$s,[s(y,{effect:"dark",content:e.$t("producer.button.download"),placement:"top"},{default:d(()=>[g?.audio_url||g?.video_url?(n(),v(k,{key:0,icon:"fa-solid fa-download",class:"icon icon-download"})):f("",!0)]),_:2},1032,["content"])])]),_:2},1024),s(O,null,{dropdown:d(()=>[s(M,null,{default:d(()=>[g?.audio_url?(n(),v(S,{key:0,onClick:P(C=>e.onExtend(C,g),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.extend")),1)]),_:1},8,["onClick"])):f("",!0),g.id?(n(),v(S,{key:1,onClick:P(C=>e.onGetStems(g.id),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.get_stems")),1)]),_:1},8,["onClick"])):f("",!0),g.id?(n(),v(S,{key:2,onClick:P(C=>e.onGetAllStems(g.id),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.all_stems")),1)]),_:1},8,["onClick"])):f("",!0),s(S,{onClick:P(C=>e.onCover(g),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.cover_music")),1)]),_:1},8,["onClick"]),g?.id?(n(),v(S,{key:3,onClick:P(C=>e.onVariation(g),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.variation")),1)]),_:1},8,["onClick"])):f("",!0),g?.id?(n(),v(S,{key:4,onClick:P(C=>e.onSwapVocals(g.id),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.swap_vocals")),1)]),_:1},8,["onClick"])):f("",!0),g?.id?(n(),v(S,{key:5,onClick:P(C=>e.onSwapInstrumentals(g.id),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.swap_instrumentals")),1)]),_:1},8,["onClick"])):f("",!0),g?.id?(n(),v(S,{key:6,onClick:P(C=>e.onReplaceSection(g),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.replace_section")),1)]),_:1},8,["onClick"])):f("",!0)]),_:2},1024)]),default:d(()=>[o("span",ys,[s(y,{effect:"dark",content:e.$t("producer.button.more"),placement:"top"},{default:d(()=>[g?.audio_url||g?.video_url?(n(),v(k,{key:0,icon:"fa-solid fa-ellipsis",class:"icon icon-ellipsis"})):f("",!0)]),_:2},1032,["content"])])]),_:2},1024)])],8,ls))),128))])}const bs=V(is,[["render",ks]]),ws={class:"player-slider"},Cs=b({__name:"PlayerSlider",setup(e){const t=Z(),l=T({get:()=>t.state.producer?.audio?.progress,set:u=>t.commit("producer/setAudio",{...t.state.producer.audio,progress:u})}),i=T({get:()=>t.state.producer?.audio?.duration,set:u=>t.commit("producer/setAudio",{...t.state.producer.audio,duration:u})}),h=()=>{},p=u=>t.dispatch("producer/setAudio",{...t.state.producer.audio,progress:u});return(u,m)=>(n(),c("div",ws,[s(A(x),{modelValue:l.value,"onUpdate:modelValue":m[0]||(m[0]=_=>l.value=_),"show-tooltip":!1,min:0,max:i.value,onChange:p,onInput:h},null,8,["modelValue","max"])]))}}),Vs={class:"flex player-song"},Ss=["src"],Us={class:"ml-2 text-xs flex flex-col justify-between"},Es={class:"w-52 2xl:w-96 cursor-pointer truncate"},Ps={class:"flex"},As={class:"ml-2 text-dc"},Ts=b({__name:"PlayerSong",setup(e){const t=Z(),l=T({get:()=>t.state.producer.audio,set:i=>t.commit("producer/setAudio",i)});return ne(l,(i,h)=>{if(i?.audio_url!==h?.audio_url){console.log("audio changed",i),i.object&&(console.log("111",i.object),i.object.pause(),delete i.object);const p=new Audio(i.audio_url);i.state==="playing"?p.play():p.pause(),p.addEventListener("loadedmetadata",()=>{p.currentTime=0,p.addEventListener("timeupdate",()=>{t.commit("producer/setAudio",{...t.state.producer.audio,progress:p.currentTime})})}),t.commit("producer/setAudio",{...t.state.producer.audio,object:p})}else if(i?.progress!==h?.progress&&Math.abs(i.progress-i.object.currentTime)>2){console.log("progress changed",i.progress);const p=t.state.producer.audio;p.object&&(p.object.currentTime=p.progress)}else i?.state!==h?.state&&(console.log("state changed",i.state),i.object&&(i.state==="playing"?i.object.play():i.object.pause()));i?.volume!==h?.volume&&(console.log("volume changed",i.volume),i.object&&(i.object.volume=i.volume/100))}),(i,h)=>(n(),c("div",Vs,[o("img",{alt:"",class:"w-11 h-11 rounded",src:l.value?.image_url||A(ye)},null,8,Ss),o("div",Us,[o("div",Es,[o("div",Ps,[o("span",null,a(l.value?.title||"Music"),1),o("span",As,"- "+a(l.value?.style||"SmallRuralDog"),1)])])])]))}}),Fs={class:"flex justify-end items-center gap-x-2.5"},Is={class:"text-xs"},Ls=b({__name:"PlayerAction",setup(e){const t=Z(),l=T({get:()=>t.state.producer?.audio?.progress,set:h=>t.commit("producer/setAudio",{...t.state.producer.audio,progress:h})}),i=T({get:()=>t.state.producer?.audio?.duration,set:h=>t.commit("producer/setAudio",{...t.state.producer.audio,duration:h})});return(h,p)=>(n(),c("div",Fs,[o("span",Is,a(A(j)(l.value))+" / "+a(A(j)(i.value)),1)]))}}),Gs={class:"player-volume flex flex-col items-center pt-2"},js={class:"text-sm mt-3"},Ds=b({__name:"PlayerVolumeSlider",setup(e){const t=Z(),l=T({get:()=>t.state.producer.audio?.volume,set:p=>t.commit("producer/setAudio",{...t.state.producer.audio,volume:p})}),i=T({get:()=>t.state.producer.audio?.muted,set:p=>t.commit("producer/setAudio",{...t.state.producer.audio,muted:p})}),h=p=>t.dispatch("producer/setVolume",p);return(p,u)=>(n(),c("div",Gs,[s(A(x),{modelValue:l.value,"onUpdate:modelValue":u[0]||(u[0]=m=>l.value=m),vertical:"",height:"100px","show-tooltip":!1,max:100,min:0,size:"small",disabled:i.value,onInput:h},null,8,["modelValue","disabled"]),o("div",js,a(l.value),1)]))}}),Rs={class:"flex items-center justify-center gap-x-3"},Zs=b({__name:"PlayerController",setup(e){const t=Z(),l=()=>t.dispatch("producer/setAudio",{...t.state.producer.audio,state:t.state.producer.audio.state==="playing"?"paused":"playing"}),i=T(()=>t.state.producer.audio);return(h,p)=>(n(),c("div",Rs,[s(ee,{icon:i.value?.state==="playing"?A(ke):A(be),size:"45",theme:"filled",class:"text-[var(--el-color-primary)] cursor-pointer",onClick:l},null,8,["icon"]),s(A(Ge),{placement:"top",width:"50px",trigger:"click"},{reference:d(()=>[s(ee,{icon:A(we),size:"20","stroke-width":2,class:"cursor-pointer"},null,8,["icon"])]),default:d(()=>[s(Ds)]),_:1})]))}}),zs={class:"flex flex-col items-stretch h-20"},Ns={class:"flex grow px-5 items-center"},Ms={class:"flex-1"},Os={class:"flex-1"},Bs={class:"flex-1"},qs=b({__name:"Player",setup(e){return(t,l)=>(n(),c("div",zs,[s(Cs),o("div",Ns,[o("div",Ms,[s(Ts)]),o("div",Os,[s(Zs)]),o("div",Bs,[s(Ls)])])]))}}),Ws=b({name:"RecentPanel",components:{ElSkeletonItem:Re,ElSkeleton:De,TaskPreview:bs,Player:qs,NoTasks:je,ScrollList:_e},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.producer?.tasks,items:this.$store.state.producer?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Hs={key:0,class:"tasks"},Ks={class:"left w-[70px] p-[10px] flex items-center"},Js={class:"main w-[calc(100%-70px)] flex-1 p-[10px]"},Ys={key:2,class:"w-full flex-1 flex items-center justify-center"},Qs={class:"h-20"};function Xs(e,t,l,i,h,p){const u=r("el-skeleton-item"),m=r("el-skeleton"),_=r("task-preview"),$=r("scroll-list"),k=r("no-tasks"),y=r("player");return n(),c(G,null,[e.tasks?.items===void 0?(n(),c("div",Hs,[(n(),c(G,null,q(3,E=>o("div",{key:E,class:"flex"},[o("div",Ks,[s(m,{animated:""},{template:d(()=>[s(u,{variant:"image",class:"avatar w-[50px] h-[50px]"})]),_:1})]),o("div",Js,[s(m,{animated:""},{template:d(()=>[s(u,{variant:"p",class:"w-[200px] h-[15px] mb-[5px] mt-[10px]"}),s(u,{variant:"text"})]),_:1})])])),64))])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(n(),v($,{key:1,ref:"scrollList",class:"flex-1 w-full overflow-y-auto tasks p-2",loading:e.loading,onReachTop:t[0]||(t[0]=E=>e.$emit("reach-top"))},{default:d(()=>[(n(!0),c(G,null,q(e.tasks?.items,(E,S)=>(n(),v(_,{key:S,"model-value":E,class:"preview"},null,8,["model-value"]))),128))]),_:1},8,["loading"])):f("",!0),e.tasks?.items?.length===0?(n(),c("div",Ys,[s(k)])):f("",!0),R(o("div",Qs,[s(y)],512),[[re,!!e.$store?.state?.producer?.audio?.object]])],64)}const xs=V(Ws,[["render",Xs]]),en=b({name:"TaskPreview",components:{IconPicture:le,ElImage:N,ElAvatar:Ce,ElIcon:K},computed:{audio(){return this.$store.state.producer?.audio}}}),tn={key:0,class:"size-full overflow-hidden"},on={class:"relative h-[300px]"},sn={class:"flex items-center justify-center size-full bg-[var(--el-bg-color)]"},nn={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"},rn={class:"p-4"},an={class:"flex items-center font-bold mb-2"},ln={class:"text-[var(--el-text-color-regular)] mb-2"},cn={class:"text-xs text-[var(--el-text-color-regular)]"},dn={class:"mt-4 text-sm leading-[25px] whitespace-pre-wrap"},un={key:1,class:"w-full h-full"};function pn(e,t,l,i,h,p){const u=r("icon-picture"),m=r("el-icon"),_=r("el-image"),$=r("el-avatar");return e.audio?.object?(n(),c("div",tn,[o("div",on,[s(_,{src:e.audio.image_url,fit:"cover",class:"size-full"},{error:d(()=>[o("div",sn,[s(m,{class:"text-3xl"},{default:d(()=>[s(u)]),_:1})])]),_:1},8,["src"]),o("h2",nn,a(e.audio?.title),1)]),o("div",rn,[o("div",an,[s($,{size:30,src:e.audio?.image_url,class:"mr-2"},null,8,["src"]),o("span",null,a(e.audio?.title),1)]),o("p",ln,a(e.audio?.style),1),o("p",cn,a(e.$dayjs.format(e.audio?.created_at)),1),o("div",dn,[o("p",null,a(e.audio?.lyric),1)])])])):(n(),c("div",un))}const mn=V(en,[["render",pn]]),fn=te("producer"),hn=b({name:"ProducerIndex",components:{Layout:qe,ConfigPanel:ns,RecentPanel:xs,PreviewPanel:mn},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.producer?.status?.getApplications===L.Request},tasksLoading(){return this.$store.state.producer?.status?.getTasks===L.Request||this.fetchingTasks},service(){return this.$store.state.producer.service},credential(){return this.$store.state.producer.credential},config(){return this.$store.state.producer.config},initializing(){return this.$store.state.producer.status.getApplications===L.Request},needApply(){return this.$store.state.producer.status.getApplications===L.Success&&!this.application},application(){return this.$store.state.producer.application},tasks(){return this.$store.state.producer.tasks},applications(){return this.$store.state.producer.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 $e({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("producer/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplications"),await this.$store.dispatch("producer/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===ue&&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:l,createdAtMax:i}=e||{};console.debug("limit",t,"createdAtMin",l,"createdAtMax",i),this.fetchingTasks=!0;try{await this.$store.dispatch("producer/getTasks",{limit:t,createdAtMin:l,createdAtMax:i})}finally{this.fetchingTasks=!1}},async onGenerateAudio(){const e={...this.config,callback_url:fn},t=this.credential?.token;if(!t){console.error("no token specified");return}w.info(this.$t("producer.message.startingTask")),ce("producer",I.audio(e,{token:t})).then(()=>{w.success(this.$t("producer.message.startTaskSuccess"))}).catch(l=>{w.error(l?.response?.data?.error?.message||this.$t("producer.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function _n(e,t,l,i,h,p){const u=r("config-panel"),m=r("recent-panel"),_=r("preview-panel"),$=r("layout");return n(),v($,null,{config:d(()=>[s(u,{onGenerate:e.onGenerateAudio},null,8,["onGenerate"])]),result:d(()=>[s(m,{ref:"recentPanel",class:"panel recent",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),preview:d(()=>[s(_)]),_:1})}const mr=V(hn,[["render",_n],["__scopeId","data-v-d6806962"]]);export{mr as default};
@@ -0,0 +1,4 @@
1
+ import{F as z}from"./index.es-BDOMZBHy.js";import{E as G}from"./index-r1WlQTkd.js";import{E as Ce}from"./index-Blv6QaIk.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 D,J as c,x as y,Q as K,I as v,U as ne,G as B,K as H,M as P,u as j,c as N,w as Le,L as Re}from"./vendor-vue-NSDaktjZ.js";import{E,F as Me,b8 as le,b7 as Fe,ef as re,eg as de,S as x,H as Ve,aw as X,ce as Se,eh as ee,ei as De,cd as ze,a7 as je}from"./index-tspOPlR8.js";import{a as Ge}from"./errorCode-Cqj9Td_Z.js";import{s as R}from"./suno-D0MT1lkL.js";import{b as Be}from"./suno-DFuCGH70.js";import{E as Oe}from"./index-Dm0MxC20.js";import{E as ue,a as ce}from"./index-DZa1Dmz4.js";import{I as F,S as Ne,l as He}from"./pagination-DEnicVya.js";import{E as te,a as J,b as We}from"./index-aB7y_QWB.js";import{E as pe,a as me}from"./index-C4AqIojV.js";import{E as qe}from"./index-DnX3iGId.js";import{E as w}from"./index-BJ8z356Q.js";import{E as W}from"./index-D9WB_FIQ.js";import{E as fe}from"./index-BCps6OLj.js";import{u as Z,F as Ke,O as Qe,_ as _e,P as Je,a as Ye,V as Xe,E as Ze}from"./IconPark.vue_vue_type_script_setup_true_lang-BwGTLkUK.js";import{E as oe}from"./index-C_buhEqX.js";import{E as O}from"./index-CNDbe5I7.js";import{E as he}from"./index-BynkfymK.js";import{E as xe,a as et}from"./index-6Sl08ozG.js";import{E as tt,a as ot}from"./index-Cdxyx1g2.js";import{E as Te}from"./index-DlBU2sRW.js";import{C as st}from"./Consumption-D5MPVVSr.js";import{a as nt}from"./price-kWAt8zxX.js";import{E as it}from"./index-8pgYKRxD.js";import{E as at}from"./index-HqBS33mo.js";import{E as Ae,b as Ue,a as Pe}from"./index-DgVbYko9.js";import{E as Ee}from"./index-ChPPFHWB.js";import{N as lt}from"./NoTasks-DKhvXOog.js";import{a as rt,E as dt}from"./index-Dt3sdSti.js";import"./use-form-item-CiGuYlwo.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./validator-DruHczS_.js";import"./index-CjRED359.js";import"./index-MeXqAg39.js";import"./typescript-VAjzYBVV.js";import"./strings-beZM2Y-f.js";import"./isEqual-CRG_uQtW.js";import"./_Uint8Array-BeRfpqL7.js";import"./castArray-278F4M9m.js";import"./debounce-CnPBB63_.js";import"./_baseIteratee-DuHUzj8X.js";import"./index-CIHBGnWH.js";import"./_baseClone-DquV2Mnx.js";import"./_initCloneObject-9PUJFEMx.js";import"./isPlainObject-eZxKDVqq.js";import"./index-CPETW0B-.js";import"./index-Cu41y2Fl.js";import"./index-Csdbp49a.js";import"./dropdown-DsiaFkVQ.js";const ut=A({name:"LayoutSuno",components:{ElDrawer:Ce,ElButton:G,FontAwesomeIcon:z},data(){return{drawer:!1,preview:!1}},computed:{}}),ct={class:"main flex flex-row flex-1"},pt={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)]"},ft={class:"preview h-full w-[300px] flex flex-col"};function ht(e,t,d,r,m,b){const g=l("font-awesome-icon"),p=l("el-button"),f=l("el-drawer");return n(),u("div",ct,[s("div",pt,[se(e.$slots,"config",{},void 0,!0)]),s("div",mt,[se(e.$slots,"result",{},void 0,!0)]),s("div",ft,[se(e.$slots,"preview",{},void 0,!0)]),o(p,{circle:"",class:"menu",onClick:t[0]||(t[0]=k=>e.drawer=!0)},{default:i(()=>[o(g,{icon:"fa-solid fa-magic"})]),_:1}),o(f,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=k=>e.drawer=k),direction:"ltr","with-header":!1,size:"340px",class:"drawer"},{default:i(()=>[se(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const gt=E(ut,[["render",ht],["__scopeId","data-v-c6c85757"]]),$t=A({name:"TypeSelector",components:{ElSelect:ce,ElOption:ue,ElSwitch:Oe,ElTag:Me},data(){return{options:[{label:"v5.5",value:"chirp-v5-5",desc:this.$t("suno.model.v55desc"),pro:!0},{label:"v5",value:"chirp-v5",desc:this.$t("suno.model.v5desc"),pro:!0},{label:"v4.5+",value:"chirp-v4-5-plus",desc:this.$t("suno.model.v45plusdesc"),pro:!0},{label:"v4.5",value:"chirp-v4-5",desc:this.$t("suno.model.v45desc"),pro:!0,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"},vt={class:"flex items-center mb-1"},yt={class:"text-sm font-bold"},bt={class:"model-option"},kt={class:"model-option-left"},wt={class:"model-option-name"},Ct={class:"model-option-desc"},Vt={key:0,class:"flex items-center justify-between mb-3"},St={class:"text-sm font-bold"};function Tt(e,t,d,r,m,b){const g=l("el-tag"),p=l("el-option"),f=l("el-select"),k=l("el-switch");return n(),u("div",null,[s("div",_t,[s("div",vt,[s("span",yt,a(e.$t("suno.name.model")),1)]),o(f,{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,D(e.options,$=>(n(),y(p,{key:$.value,label:$.label,value:$.value,class:K({"model-option-divider":$.dividerAfter})},{default:i(()=>[s("div",bt,[s("div",kt,[s("span",wt,a($.label),1),$.pro?(n(),y(g,{key:0,size:"small",type:"warning",effect:"plain",class:"model-option-pro"},{default:i(()=>[...t[2]||(t[2]=[v("Pro",-1)])]),_:1})):c("",!0)]),s("span",Ct,a($.desc),1)])]),_:2},1032,["label","value","class"]))),128))]),_:1},8,["modelValue","placeholder"])]),e.custom?(n(),u("div",Vt,[s("span",St,a(e.$t("suno.name.instrumental")),1),o(k,{modelValue:e.instrumental,"onUpdate:modelValue":t[1]||(t[1]=$=>e.instrumental=$)},null,8,["modelValue"])])):c("",!0)])}const At=E($t,[["render",Tt],["__scopeId","data-v-63f400aa"]]),Ut=A({name:"UploadAudio",components:{ElUpload:qe,ElButton:G,ElDialog:le,ElTabs:me,ElTabPane:pe,InfoIcon:F,FontAwesomeIcon:z,ElRadioGroup:J,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 R.upload(t,{token:d});console.debug("get upload music success",r.data);const m=r.data?.data.audio_id;this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,audio_id:m,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(),m=r?.file_url||r?.data?.file_url;if(!m)throw new Error("no file_url in response");this.audioPreviewUrl=m,await this.onGenerateAudioId(m),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"},Et={class:"flex justify-between items-center mb-2"},It={class:"flex justify-start items-center"},Lt={class:"text-sm font-bold"},Rt={key:0,class:"mb-2"},Mt=["src"],Ft={key:1,class:"mt-2"},Dt={class:"py-4"},zt={class:"text-center py-6"},jt={class:"text-sm"},Gt={class:"text-xs text-gray-400 mt-1"},Bt={class:"py-4 text-center"},Ot={class:"recorder-display mb-4"},Nt={key:0,class:"text-red-500 flex items-center justify-center gap-2"},Ht={class:"text-2xl font-mono"},Wt={key:1,class:"text-green-600"},qt={key:2,class:"text-gray-400 text-2xl font-mono"},Kt={key:0,class:"mb-4"},Qt=["src"],Jt={class:"flex justify-center gap-3"};function Yt(e,t,d,r,m,b){const g=l("info-icon"),p=l("font-awesome-icon"),f=l("el-button"),k=l("el-radio-button"),$=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",Et,[s("div",It,[s("span",Lt,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(p,{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,Mt)])):c("",!0),e.hasUploadedAudio?(n(),u("div",Ft,[o($,{modelValue:e.uploadAction,"onUpdate:modelValue":t[1]||(t[1]=I=>e.uploadAction=I),size:"small"},{default:i(()=>[o(k,{value:"upload_extend"},{default:i(()=>[v(a(e.$t("suno.button.extend")),1)]),_:1}),o(k,{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",Dt,[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(p,{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",Gt,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",Bt,[s("div",Ot,[e.recording?(n(),u("div",Nt,[t[5]||(t[5]=s("span",{class:"recording-dot"},null,-1)),s("span",Ht,a(e.formattedTime),1)])):e.recordedBlob?(n(),u("div",Wt,[o(p,{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",qt,"00:00"))]),e.recordedAudioUrl&&!e.recording?(n(),u("div",Kt,[s("audio",{src:e.recordedAudioUrl,controls:"",class:"w-full"},null,8,Qt)])):c("",!0),s("div",Jt,[!e.recording&&!e.recordedBlob?(n(),y(f,{key:0,type:"primary",round:"",onClick:e.startRecording},{default:i(()=>[o(p,{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(p,{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(p,{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(p,{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 Xt=E(Ut,[["render",Yt],["__scopeId","data-v-bfb6b53d"]]),Zt="",ve=[{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"}],xt=8;function ye(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 eo=A({name:"PromptInput",components:{ElInput:W,FontAwesomeIcon:z,InfoIcon:F},data(){return{shuffledTags:ye(ve)}},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,xt)}},mounted(){this.prompt||(this.prompt=Zt)},methods:{onTagClick(e){this.prompt=e.prompt},onRefreshTags(){this.shuffledTags=ye(ve)}}}),to={class:"field"},oo={class:"flex items-center mb-1"},so={class:"text-sm font-bold"},no={class:"inspo-tags"},io=["onClick"];function ao(e,t,d,r,m,b){const g=l("info-icon"),p=l("el-input"),f=l("font-awesome-icon");return n(),u("div",to,[s("div",oo,[s("span",so,a(e.$t("suno.name.songDescription")),1),o(g,{content:e.$t("suno.description.prompt")},null,8,["content"])]),o(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=k=>e.prompt=k),rows:4,type:"textarea",placeholder:e.$t("suno.placeholder.prompt")},null,8,["modelValue","placeholder"]),s("div",no,[(n(!0),u(M,null,D(e.visibleTags,k=>(n(),u("button",{key:k.key,class:"inspo-tag",onClick:$=>e.onTagClick(k)},a(k.label),9,io))),128)),s("button",{class:"inspo-tag inspo-tag-refresh",onClick:t[1]||(t[1]=(...k)=>e.onRefreshTags&&e.onRefreshTags(...k))},[o(f,{icon:"fa-solid fa-arrows-rotate"})])])])}const lo=E(eo,[["render",ao],["__scopeId","data-v-378e4372"]]),ro="",uo=A({name:"LyricInput",components:{ElInput:W,ElButton:G,ElTooltip:fe,ElDialog:le,FontAwesomeIcon:z,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=ro)},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
+
3
+ Original lyrics:
4
+ ${this.lyric}`,r=(await R.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;this.pushHistory();const t=this.config?.style||this.config?.title||"a beautiful song";this.generatingLyrics=!0,w.info(this.$t("suno.message.generatingLyrics"));try{const r=(await R.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}}}}),co={class:"field"},po={class:"flex items-center justify-between mb-1"},mo={class:"flex items-center"},fo={class:"text-sm font-bold"},ho={class:"flex items-center gap-1"},go={class:"relative"},$o={class:"text-xs text-right text-[var(--el-text-color-secondary)] mt-1"},_o={key:0,class:"enhance-bar"},vo={key:0,class:"enhance-bar mt-3"},yo={class:"flex items-center justify-between"},bo={class:"flex items-center gap-1"};function ko(e,t,d,r,m,b){const g=l("info-icon"),p=l("font-awesome-icon"),f=l("el-button"),k=l("el-tooltip"),$=l("el-input"),T=l("el-dialog");return n(),u("div",co,[s("div",po,[s("div",mo,[s("span",fo,a(e.$t("suno.name.lyrics")),1),o(g,{content:e.$t("suno.description.lyrics")},null,8,["content"])]),s("div",ho,[e.lyricHistory.length>0?(n(),y(k,{key:0,content:e.$t("suno.button.undo"),placement:"top"},{default:i(()=>[o(f,{size:"small",circle:"",onClick:e.onUndo},{default:i(()=>[o(p,{icon:"fa-solid fa-rotate-left"})]),_:1},8,["onClick"])]),_:1},8,["content"])):c("",!0),e.lyric?(n(),y(k,{key:1,content:e.$t("suno.button.clear_lyrics"),placement:"top"},{default:i(()=>[o(f,{size:"small",circle:"",onClick:e.onClear},{default:i(()=>[o(p,{icon:"fa-solid fa-eraser"})]),_:1},8,["onClick"])]),_:1},8,["content"])):c("",!0),o(k,{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(p,{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(p,{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",go,[e.config?.action!=="extend"?(n(),y($,{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($,{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",$o,a(e.lyric?.length||0)+"/5000",1)]),e.lyric&&e.config?.action!=="extend"?(n(),u("div",_o,[o($,{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(p,{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",yo,[s("div",bo,[e.lyricHistory.length>0?(n(),y(f,{key:0,size:"small",onClick:e.onUndo},{default:i(()=>[o(p,{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(p,{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(p,{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($,{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",vo,[o($,{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(p,{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 wo=E(uo,[["render",ko],["__scopeId","data-v-2b97a493"]]),be=["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"],Co=12;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 Vo=A({name:"StyleInput",components:{ElInput:W,ElButton:G,FontAwesomeIcon:z,InfoIcon:F},data(){return{optimizing:!1,shuffledTags:ke(be)}},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,Co)}},methods:{onTagClick(e){const t=this.style||"";t.toLowerCase().includes(e.toLowerCase())||(this.style=t?`${t}, ${e}`:e)},onRefreshTags(){this.shuffledTags=ke(be)},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 R.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}}}}}),So={class:"field"},To={class:"flex items-center justify-between mb-1"},Ao={class:"flex items-center"},Uo={class:"text-sm font-bold"},Po={class:"relative"},Eo={class:"text-xs text-right text-[var(--el-text-color-secondary)] mt-1"},Io={class:"style-tags"},Lo=["onClick"];function Ro(e,t,d,r,m,b){const g=l("info-icon"),p=l("font-awesome-icon"),f=l("el-button"),k=l("el-input");return n(),u("div",So,[s("div",To,[s("div",Ao,[s("span",Uo,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(p,{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(k,{modelValue:e.style,"onUpdate:modelValue":t[0]||(t[0]=$=>e.style=$),rows:2,type:"textarea",placeholder:e.$t("suno.placeholder.style")},null,8,["modelValue","placeholder"]),s("div",Eo,a(e.style?.length||0)+"/1000",1)]),s("div",Io,[(n(!0),u(M,null,D(e.visibleTags,$=>(n(),u("button",{key:$,class:"style-tag",onClick:T=>e.onTagClick($)},a($),9,Lo))),128)),s("button",{class:"style-tag style-tag-refresh",onClick:t[1]||(t[1]=(...$)=>e.onRefreshTags&&e.onRefreshTags(...$))},[o(p,{icon:"fa-solid fa-arrows-rotate"})])])])}const Mo=E(Vo,[["render",Ro],["__scopeId","data-v-ddebb076"]]),Fo=A({name:"TitleInput",components:{ElInput:W,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})}}}}),Do={class:"field"},zo={class:"flex items-center mb-1"},jo={class:"text-sm font-bold"};function Go(e,t,d,r,m,b){const g=l("info-icon"),p=l("el-input");return n(),u("div",Do,[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(p,{modelValue:e.title,"onUpdate:modelValue":t[0]||(t[0]=f=>e.title=f),placeholder:e.$t("suno.placeholder.title")},null,8,["modelValue","placeholder"])])}const Bo=E(Fo,[["render",Go]]),Oo=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})}}}),No={class:"field"},Ho={class:"box"},Wo={class:"title font-bold"},qo={class:"input-wrapper"},Ko={class:"task"},Qo={class:"left"},Jo={key:2,class:"duration"},Yo={class:"info"},Xo={class:"title"},Zo={class:"style"};function xo(e,t,d,r,m,b){const g=l("el-input-number"),p=l("el-image"),f=l("video-pause"),k=l("el-icon"),$=l("video-play"),T=H("loading");return n(),u("div",No,[s("div",Ho,[s("h2",Wo,a(e.$t("suno.name.extend")),1),s("div",qo,[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",Ko,[e.audio?(n(),u("div",{key:0,class:"audio",onClick:t[3]||(t[3]=_=>e.onClick(e.audio))},[B((n(),u("div",Qo,[o(p,{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(k,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(k,null,{default:i(()=>[o($)]),_: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",Yo,[s("h2",Xo,a(e.audio?.title),1),s("p",Zo,a(e.audio?.style),1)])])):c("",!0)])])}const es=E(Oo,[["render",xo],["__scopeId","data-v-bcce4821"]]),ts=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})}}}),os={class:"field"},ss={class:"box"},ns={class:"title font-bold"},is={class:"task"},as={class:"left"},ls={key:2,class:"duration"},rs={class:"info"},ds={class:"title"},us={class:"style"};function cs(e,t,d,r,m,b){const g=l("el-image"),p=l("video-pause"),f=l("el-icon"),k=l("video-play"),$=H("loading");return n(),u("div",os,[s("div",ss,[s("h2",ns,a(e.$t("suno.name.cover")),1)]),s("div",is,[e.audio?(n(),u("div",{key:0,class:"audio",onClick:t[2]||(t[2]=T=>e.onClick(e.audio))},[B((n(),u("div",as,[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(p)]),_: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(k)]),_:1})])):c("",!0),e.audio?.duration?(n(),u("div",ls,a(e.useFormatDuring(e.audio?.duration)),1)):c("",!0)])),[[$,!e.audio?.audio_url]]),s("div",rs,[s("h2",ds,a(e.audio?.title),1),s("p",us,a(e.audio?.style),1)])])):c("",!0)])])}const ps=E(ts,[["render",cs],["__scopeId","data-v-06640216"]]),ms=A({name:"VocalGenderSelector",components:{ElRadioGroup:J,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})}}}}),fs={class:"mb-2"},hs={class:"flex items-center mb-1"},gs={class:"text-sm font-bold"};function $s(e,t,d,r,m,b){const g=l("info-icon"),p=l("el-radio-button"),f=l("el-radio-group");return n(),u("div",fs,[s("div",hs,[s("span",gs,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]=k=>e.vocalGender=k)},{default:i(()=>[o(p,{value:""},{default:i(()=>[v(a(e.$t("suno.gender.auto")),1)]),_:1}),o(p,{value:"f"},{default:i(()=>[v(a(e.$t("suno.gender.female")),1)]),_:1}),o(p,{value:"m"},{default:i(()=>[v(a(e.$t("suno.gender.male")),1)]),_:1})]),_:1},8,["modelValue"])])}const _s=E(ms,[["render",$s]]),vs=A({name:"AdvancedParams",components:{ElCollapse:et,ElCollapseItem:xe,ElInput:W,ElSlider:he,ElRadioGroup:J,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})}}}}),ys={key:0,class:"mb-3"},bs={class:"flex items-center mb-1"},ks={class:"text-xs font-bold"},ws={key:1,class:"mb-3"},Cs={class:"flex items-center mb-1"},Vs={class:"text-xs font-bold"},Ss={key:2,class:"mb-3"},Ts={class:"flex items-center justify-between mb-1"},As={class:"text-xs font-bold"},Us={class:"text-xs text-[var(--el-text-color-secondary)]"},Ps={key:3,class:"mb-3"},Es={class:"flex items-center justify-between mb-1"},Is={class:"text-xs font-bold"},Ls={class:"text-xs text-[var(--el-text-color-secondary)]"},Rs={key:4,class:"mb-3"},Ms={class:"flex items-center mb-1"},Fs={class:"text-xs font-bold"},Ds={key:5,class:"mb-3"},zs={class:"flex items-center justify-between mb-1"},js={class:"text-xs font-bold"},Gs={class:"text-xs text-[var(--el-text-color-secondary)]"},Bs={key:6,class:"mb-3"},Os={class:"flex items-center mb-1"},Ns={class:"text-xs font-bold"};function Hs(e,t,d,r,m,b){const g=l("el-input"),p=l("el-slider"),f=l("el-radio-button"),k=l("el-radio-group"),$=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($,{title:e.$t("suno.name.advancedParams"),name:"advanced"},{default:i(()=>[e.config?.custom?(n(),u("div",ys,[s("div",bs,[s("span",ks,a(e.$t("suno.name.styleNegative")),1)]),o(g,{modelValue:e.styleNegative,"onUpdate:modelValue":t[0]||(t[0]=_=>e.styleNegative=_),placeholder:e.$t("suno.placeholder.styleNegative")},null,8,["modelValue","placeholder"])])):c("",!0),e.config?.custom&&!e.config?.instrumental?(n(),u("div",ws,[s("div",Cs,[s("span",Vs,a(e.$t("suno.name.lyricPrompt")),1)]),o(g,{modelValue:e.lyricPrompt,"onUpdate:modelValue":t[1]||(t[1]=_=>e.lyricPrompt=_),placeholder:e.$t("suno.placeholder.lyricPrompt")},null,8,["modelValue","placeholder"])])):c("",!0),e.config?.custom?(n(),u("div",Ss,[s("div",Ts,[s("span",As,a(e.$t("suno.name.weirdness")),1),s("span",Us,a(e.weirdness??0),1)]),o(p,{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",Ps,[s("div",Es,[s("span",Is,a(e.$t("suno.name.styleInfluence")),1),s("span",Ls,a(e.styleInfluence??50),1)]),o(p,{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",Rs,[s("div",Ms,[s("span",Fs,a(e.$t("suno.name.variationCategory")),1)]),o(k,{modelValue:e.variationCategory,"onUpdate:modelValue":t[4]||(t[4]=_=>e.variationCategory=_)},{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",Ds,[s("div",zs,[s("span",js,a(e.$t("suno.name.audioWeight")),1),s("span",Gs,a(e.audioWeight??50),1)]),o(p,{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",Bs,[s("div",Os,[s("span",Ns,a(e.$t("suno.name.lyricsMode")),1)]),o(k,{modelValue:e.lyricsMode,"onUpdate:modelValue":t[6]||(t[6]=_=>e.lyricsMode=_)},{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 Ws=E(vs,[["render",Hs],["__scopeId","data-v-505f8fc7"]]),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"})}}}),Ks={class:"field"},Qs={class:"flex items-center mb-2"},Js={class:"text-sm font-bold m-0"},Ys={key:0,class:"task mb-2"},Xs={class:"left relative w-[50px] h-[50px] mr-3 flex-shrink-0"},Zs={class:"info flex-1 min-w-0"},xs={class:"text-sm font-bold m-0 truncate"},en={class:"text-xs text-[var(--el-text-color-secondary)] m-0 truncate"},tn={class:"flex gap-2"};function on(e,t,d,r,m,b){const g=l("info-icon"),p=l("el-image"),f=l("el-input-number"),k=H("loading");return n(),u("div",Ks,[s("div",Qs,[s("h2",Js,a(e.$t("suno.name.replaceSection")),1),o(g,{content:e.$t("suno.description.replaceSection")},null,8,["content"])]),e.audio?(n(),u("div",Ys,[s("div",{class:"audio flex items-center",onClick:t[0]||(t[0]=$=>e.onClick(e.audio))},[B((n(),u("div",Xs,[o(p,{src:e.audio?.image_url,class:"w-full h-full rounded",fit:"cover"},null,8,["src"])])),[[k,!e.audio?.audio_url]]),s("div",Zs,[s("h2",xs,a(e.audio?.title),1),s("p",en,a(e.audio?.style),1)])])])):c("",!0),s("div",tn,[o(f,{modelValue:e.replaceSectionStart,"onUpdate:modelValue":t[1]||(t[1]=$=>e.replaceSectionStart=$),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]=$=>e.replaceSectionEnd=$),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 sn=E(qs,[["render",on]]),nn=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"})}}}),an={class:"field"},ln={class:"flex items-center mb-2"},rn={class:"text-sm font-bold m-0"},dn={key:0,class:"task mb-2"},un={class:"left relative w-[50px] h-[50px] mr-3 flex-shrink-0"},cn={class:"info flex-1 min-w-0"},pn={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 hn(e,t,d,r,m,b){const g=l("info-icon"),p=l("el-image"),f=l("el-input-number"),k=H("loading");return n(),u("div",an,[s("div",ln,[s("h2",rn,a(e.$t("suno.name.overpaintingRange")),1),o(g,{content:e.$t("suno.description.overpainting")},null,8,["content"])]),e.audio?(n(),u("div",dn,[s("div",{class:"audio flex items-center",onClick:t[0]||(t[0]=$=>e.onClick(e.audio))},[B((n(),u("div",un,[o(p,{src:e.audio?.image_url,class:"w-full h-full rounded",fit:"cover"},null,8,["src"])])),[[k,!e.audio?.audio_url]]),s("div",cn,[s("h2",pn,a(e.audio?.title),1),s("p",mn,a(e.audio?.style),1)])])])):c("",!0),s("div",fn,[o(f,{modelValue:e.overpaintingStart,"onUpdate:modelValue":t[1]||(t[1]=$=>e.overpaintingStart=$),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]=$=>e.overpaintingEnd=$),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 gn=E(nn,[["render",hn]]),$n=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"})}}}),_n={class:"field"},vn={class:"flex items-center mb-2"},yn={class:"text-sm font-bold m-0"},bn={key:0,class:"task mb-2"},kn={class:"left relative w-[50px] h-[50px] mr-3 flex-shrink-0"},wn={class:"info flex-1 min-w-0"},Cn={class:"text-sm font-bold m-0 truncate"},Vn={class:"text-xs text-[var(--el-text-color-secondary)] m-0 truncate"},Sn={class:"flex gap-2"};function Tn(e,t,d,r,m,b){const g=l("info-icon"),p=l("el-image"),f=l("el-input-number"),k=H("loading");return n(),u("div",_n,[s("div",vn,[s("h2",yn,a(e.$t("suno.name.underpaintingRange")),1),o(g,{content:e.$t("suno.description.underpainting")},null,8,["content"])]),e.audio?(n(),u("div",bn,[s("div",{class:"audio flex items-center",onClick:t[0]||(t[0]=$=>e.onClick(e.audio))},[B((n(),u("div",kn,[o(p,{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",Cn,a(e.audio?.title),1),s("p",Vn,a(e.audio?.style),1)])])])):c("",!0),s("div",Sn,[o(f,{modelValue:e.underpaintingStart,"onUpdate:modelValue":t[1]||(t[1]=$=>e.underpaintingStart=$),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]=$=>e.underpaintingEnd=$),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 An=E($n,[["render",Tn]]),Un=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"})}}}),Pn={class:"field"},En={class:"flex items-center mb-2"},In={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"},Mn={class:"info flex-1 min-w-0"},Fn={class:"text-sm font-bold m-0 truncate"},Dn={class:"text-xs text-[var(--el-text-color-secondary)] m-0 truncate"},zn={class:"flex gap-2"};function jn(e,t,d,r,m,b){const g=l("info-icon"),p=l("el-image"),f=l("el-input-number"),k=H("loading");return n(),u("div",Pn,[s("div",En,[s("h2",In,a(e.$t("suno.name.samplesRange")),1),o(g,{content:e.$t("suno.description.samples")},null,8,["content"])]),e.audio?(n(),u("div",Ln,[s("div",{class:"audio flex items-center",onClick:t[0]||(t[0]=$=>e.onClick(e.audio))},[B((n(),u("div",Rn,[o(p,{src:e.audio?.image_url,class:"w-full h-full rounded",fit:"cover"},null,8,["src"])])),[[k,!e.audio?.audio_url]]),s("div",Mn,[s("h2",Fn,a(e.audio?.title),1),s("p",Dn,a(e.audio?.style),1)])])])):c("",!0),s("div",zn,[o(f,{modelValue:e.samplesStart,"onUpdate:modelValue":t[1]||(t[1]=$=>e.samplesStart=$),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]=$=>e.samplesEnd=$),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 Gn=E(Un,[["render",jn]]),Bn=[.5,.75,1,1.25,1.5,2],On=A({name:"AdjustSpeedInput",components:{ElRadioGroup:J,ElRadioButton:te,ElImage:O,InfoIcon:F},data(){return{options:Bn}},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"})}}}),Nn={class:"field"},Hn={class:"flex items-center mb-2"},Wn={class:"text-sm font-bold m-0"},qn={key:0,class:"task mb-2"},Kn={class:"left relative w-[50px] h-[50px] mr-3 flex-shrink-0"},Qn={class:"info flex-1 min-w-0"},Jn={class:"text-sm font-bold m-0 truncate"},Yn={class:"text-xs text-[var(--el-text-color-secondary)] m-0 truncate"};function Xn(e,t,d,r,m,b){const g=l("info-icon"),p=l("el-image"),f=l("el-radio-button"),k=l("el-radio-group"),$=H("loading");return n(),u("div",Nn,[s("div",Hn,[s("h2",Wn,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",Kn,[o(p,{src:e.audio?.image_url,class:"w-full h-full rounded",fit:"cover"},null,8,["src"])])),[[$,!e.audio?.audio_url]]),s("div",Qn,[s("h2",Jn,a(e.audio?.title),1),s("p",Yn,a(e.audio?.style),1)])])])):c("",!0),o(k,{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,D(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 Zn=E(On,[["render",Xn],["__scopeId","data-v-ba834628"]]),xn=A({name:"VoiceCreateDialog",components:{ElDialog:le,ElForm:ot,ElFormItem:tt,ElInput:W,ElButton:G,ElRadioGroup:J,ElRadio:We},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 R.persona({audio_id:this.form.audio_id,name:this.form.name,description:this.form.description},{token:this.token}):await R.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 ei(e,t,d,r,m,b){const g=l("el-input"),p=l("el-form-item"),f=l("el-radio"),k=l("el-radio-group"),$=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($,{"label-position":"top",class:"voice-create-form"},{default:i(()=>[o(p,{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(p,{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(p,{label:e.$t("suno.voice.sourceType")},{default:i(()=>[o(k,{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(p,{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(p,{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 ti=E(xn,[["render",ei]]),oi=A({name:"VoiceManager",components:{ElButton:G,ElIcon:x,ElTabs:me,ElTabPane:pe,ElTooltip:fe,Loading:Ve,FontAwesomeIcon:z,VoiceCreateDialog:ti},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 Te.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()}}}),si={class:"voice-manager"},ni={class:"flex items-center justify-between mb-3"},ii={class:"text-sm font-medium"},ai={key:0,class:"text-center py-6"},li={key:1,class:"text-center py-6 text-gray-400 text-sm"},ri={key:2,class:"voice-list"},di=["onClick"],ui={class:"flex-1 min-w-0"},ci={class:"voice-name"},pi={key:0,class:"voice-desc"};function mi(e,t,d,r,m,b){const g=l("font-awesome-icon"),p=l("el-button"),f=l("el-tab-pane"),k=l("el-tabs"),$=l("loading"),T=l("el-icon"),_=l("el-tooltip"),V=l("voice-create-dialog");return n(),u("div",si,[s("div",ni,[s("span",ii,a(e.$t("suno.voice.title")),1),o(p,{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(k,{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",ai,[o(T,{class:"is-loading"},{default:i(()=>[o($)]),_:1})])):e.visiblePersonas.length===0?(n(),u("div",li,a(e.activeTab==="favorites"?e.$t("suno.voice.emptyFavorites"):e.$t("suno.voice.empty")),1)):(n(),u("div",ri,[(n(!0),u(M,null,D(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",ui,[s("div",ci,[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",pi,a(C.description),1)):c("",!0)]),s("div",{class:"voice-actions",onClick:t[2]||(t[2]=P(()=>{},["stop"]))},[o(_,{content:e.isFavorite(C.persona_id)?e.$t("suno.voice.unfavorite"):e.$t("suno.voice.favorite"),placement:"top"},{default:i(()=>[o(p,{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(p,{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,di))),128))])),o(V,{modelValue:e.showCreateDialog,"onUpdate:modelValue":t[3]||(t[3]=C=>e.showCreateDialog=C),onCreated:e.onCreated},null,8,["modelValue","onCreated"])])}const fi=E(oi,[["render",mi],["__scopeId","data-v-8b8e36d9"]]),hi=A({name:"PersonaInput",components:{ElSelect:ce,ElOption:ue,ElButton:G,ElDrawer:Ce,FontAwesomeIcon:z,InfoIcon:F,VoiceManager:fi},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||[]}}}),gi={class:"field"},$i={class:"flex items-center justify-between mb-2"},_i={class:"flex items-center"},vi={class:"text-sm font-bold m-0"},yi={class:"flex items-center justify-between w-full"},bi={key:0,class:"text-xs text-gray-400 ml-2"};function ki(e,t,d,r,m,b){const g=l("info-icon"),p=l("font-awesome-icon"),f=l("el-button"),k=l("el-option"),$=l("el-select"),T=l("voice-manager"),_=l("el-drawer");return n(),u("div",gi,[s("div",$i,[s("div",_i,[s("h2",vi,a(e.$t("suno.name.persona")),1),o(g,{content:e.$t("suno.description.persona")},null,8,["content"])]),o(f,{type:"primary",size:"small",text:"",onClick:t[0]||(t[0]=V=>e.showManager=!0)},{default:i(()=>[o(p,{icon:"fa-solid fa-microphone",class:"mr-1"}),v(" "+a(e.$t("suno.voice.manage")),1)]),_:1})]),o($,{modelValue:e.personaId,"onUpdate:modelValue":t[1]||(t[1]=V=>e.personaId=V),size:"small",placeholder:e.$t("suno.placeholder.personaId"),clearable:"",filterable:"",class:"w-full"},{default:i(()=>[(n(!0),u(M,null,D(e.personas,V=>(n(),y(k,{key:V.persona_id||"",value:V.persona_id||"",label:V.name||V.persona_id||""},{default:i(()=>[s("div",yi,[s("span",null,a(V.name||V.persona_id),1),V.source_type?(n(),u("span",bi,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 wi=E(hi,[["render",ki]]),Ci=A({name:"PresetPanel",components:{TypeSelector:At,PromptInput:lo,LyricInput:wo,StyleInput:Mo,TitleInput:Bo,ExtendFromInput:es,CoverFromInput:ps,UploadAudio:Xt,VocalGenderSelector:_s,AdvancedParams:Ws,ReplaceSectionInput:sn,OverpaintingInput:gn,UnderpaintingInput:An,SamplesInput:Gn,AdjustSpeedInput:Zn,PersonaInput:wi,FontAwesomeIcon:z,ElButton:G,ElTabs:me,ElTabPane:pe,Consumption:st},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 nt(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})}}}),Vi={class:"flex flex-col h-full"},Si={class:"flex-1 overflow-y-auto p-5"},Ti={class:"pt-2 px-1"},Ai={class:"pt-2 px-1"},Ui={class:"flex flex-col items-center justify-center px-5 pb-5 gap-2"},Pi={class:"flex gap-2 w-full"};function Ei(e,t,d,r,m,b){const g=l("type-selector"),p=l("upload-audio"),f=l("prompt-input"),k=l("extend-from-input"),$=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"),U=l("advanced-params"),q=l("el-tab-pane"),Q=l("lyric-input"),Y=l("style-input"),h=l("title-input"),S=l("vocal-gender-selector"),ie=l("persona-input"),L=l("el-tabs"),ae=l("consumption"),ge=l("font-awesome-icon"),$e=l("el-button");return n(),u("div",Vi,[s("div",Si,[o(L,{modelValue:e.mode,"onUpdate:modelValue":t[0]||(t[0]=Ie=>e.mode=Ie),class:"suno-mode-tabs",stretch:""},{default:i(()=>[o(q,{label:e.$t("suno.mode.simple"),name:"simple"},{default:i(()=>[s("div",Ti,[o(g,{class:"mb-4"}),o(p,{class:"mb-4"}),o(f,{class:"mb-4"}),e.config?.action==="extend"?(n(),y(k,{key:0,class:"mb-4"})):c("",!0),e.config?.action==="cover"?(n(),y($,{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(U,{class:"mb-4"})])]),_:1},8,["label"]),o(q,{label:e.$t("suno.mode.custom"),name:"custom"},{default:i(()=>[s("div",Ai,[o(g,{class:"mb-4"}),o(p,{class:"mb-4"}),e.config?.instrumental?c("",!0):(n(),y(Q,{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(k,{key:3,class:"mb-4"})):c("",!0),e.config?.action==="cover"?(n(),y($,{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(U,{class:"mb-4"})])]),_:1},8,["label"])]),_:1},8,["modelValue"])]),s("div",Ui,[o(ae,{value:e.consumption,service:e.service},null,8,["value","service"]),s("div",Pi,[o($e,{class:"flex-1",onClick:e.onClearAll},{default:i(()=>[o(ge,{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(ge,{icon:"fa-solid fa-magic",class:"mr-2"}),v(" "+a(e.generateButtonText),1)]),_:1},8,["onClick"])])])])}const Ii=E(Ci,[["render",Ei],["__scopeId","data-v-c62324e6"]]),we=Se("suno"),Li=A({name:"TaskPreview",components:{ElImage:O,ElIcon:x,ElTooltip:fe,FontAwesomeIcon:z,VideoPlay:de,VideoPause:re,ElDropdown:Pe,ElDropdownMenu:Ue,ElDropdownItem:Ae,ElInput:W,ElProgress:at,ElCheckbox:it,Loading:Ve},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,m=r.substring(r.lastIndexOf("/")+1);console.log("on preview",m),fetch(t).then(b=>b.blob()).then(b=>{Ke.saveAs(b,m)})},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},m=this.credential?.token;if(!m){console.error("no token specified"),d(new Error("No token specified"));return}R.mp4(r,{token:m}).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")),R.vox({audio_id:e,callback_url:we},{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")),R.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 R.wav({audio_id:e.id},{token:t})).data?.data?.audio_url;r?this.onDownload(null,r):w.error(this.$t("suno.message.fetchWavFailed"))}catch{w.error(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 R.midi({audio_id:e.id},{token:t})).data?.data?.midi_url;r?this.onDownload(null,r):w.error(this.$t("suno.message.fetchMidiFailed"))}catch{w.error(this.$t("suno.message.fetchMidiFailed"))}finally{this.isFetchingMidi=!1}},async onGenerateAudioUrl(e,t){const d={action:e,audio_id:t,callback_url:we},r=this.credential?.token;if(!r){console.error("no token specified");return}w.info(this.$t("suno.message.startingTask")),R.audio(d,{token:r}).then(()=>{w.success(this.$t("suno.message.startTaskSuccess"))}).catch(m=>{w.error(m?.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 Te.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??[],m=r.findIndex(b=>b.id===e.id);if(m!==-1){if(r.splice(m,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})}}}),Ri={class:"task"},Mi=["onClick"],Fi=["onClick"],Di={class:"left"},zi=["onClick"],ji=["onClick"],Gi={key:2,class:"duration"},Bi={class:"info"},Oi={key:1,class:"title-row"},Ni={class:"title"},Hi={class:"style"},Wi={key:2,class:"progress-row"},qi={class:"progress-text"},Ki={class:"right"},Qi={class:"el-dropdown-link"},Ji={class:"flex items-center min-w-[120px]"},Yi={class:"flex items-center min-w-[120px]"},Xi={class:"flex items-center min-w-[120px]"},Zi={class:"el-dropdown-link"};function xi(e,t,d,r,m,b){const g=l("el-checkbox"),p=l("el-image"),f=l("video-pause"),k=l("el-icon"),$=l("video-play"),T=l("el-input"),_=l("font-awesome-icon"),V=l("el-progress"),C=l("el-tooltip"),I=l("Loading"),U=l("el-dropdown-item"),q=l("el-dropdown-menu"),Q=l("el-dropdown"),Y=H("loading");return n(),u("div",Ri,[(n(!0),u(M,null,D(e.audios,h=>(n(),u("div",{key:h.id,class:K(["audio",{"mashup-selected":e.isMashupSelected(h)}]),onClick:P(S=>e.onClick(h),["stop"])},[e.isMashupMode&&h?.audio_url?(n(),u("div",{key:0,class:"mashup-check",onClick:P(S=>e.onToggleMashup(h),["stop"])},[o(g,{"model-value":e.isMashupSelected(h),onClick:t[0]||(t[0]=P(()=>{},["stop"]))},null,8,["model-value"])],8,Fi)):c("",!0),B((n(),u("div",Di,[o(p,{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:P(S=>e.onPause(h),["stop"])},[o(k,null,{default:i(()=>[o(f)]),_:1})],8,zi)):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:P(S=>e.onPlay(h),["stop"])},[o(k,null,{default:i(()=>[o($)]),_:1})],8,ji)):c("",!0),h?.duration?(n(),u("div",Gi,a(e.useFormatDuring(h?.duration)),1)):c("",!0)])),[[Y,!h?.audio_url]]),s("div",Bi,[e.editingAudioId===h.id?(n(),u("div",{key:0,class:"title-edit",onClick:t[2]||(t[2]=P(()=>{},["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",Oi,[s("h2",Ni,a(h?.title),1),h?.audio_url?(n(),y(_,{key:0,icon:"fa-solid fa-pen",class:"edit-icon",onClick:P(S=>e.onStartTitleEdit(h),["stop"])},null,8,["onClick"])):c("",!0)])),s("p",Hi,a(h?.style),1),!h?.audio_url&&h?.progress!=null&&h?.progress<100?(n(),u("div",Wi,[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",Ki,[o(Q,null,{dropdown:i(()=>[o(q,null,{default:i(()=>[o(U,{disabled:e.isFetchingVideoUrl,onClick:S=>e.handleVideoDownload(h)},{default:i(()=>[s("div",Ji,[e.isFetchingVideoUrl?(n(),y(k,{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(U,{key:0,onClick:P(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(U,{disabled:e.isFetchingWav,onClick:S=>e.handleWavDownload(h)},{default:i(()=>[s("div",Yi,[e.isFetchingWav?(n(),y(k,{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(U,{disabled:e.isFetchingMidi,onClick:S=>e.handleMidiDownload(h)},{default:i(()=>[s("div",Xi,[e.isFetchingMidi?(n(),y(k,{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",Qi,[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(Q,null,{dropdown:i(()=>[o(q,{class:"suno-action-menu"},{default:i(()=>[h?.audio_url?(n(),y(U,{key:0,onClick:P(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(U,{onClick:P(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(U,{key:1,onClick:P(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(U,{key:2,onClick:P(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(U,{key:3,onClick:P(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(U,{key:4,onClick:P(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(U,{key:5,onClick:P(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(U,{key:6,onClick:P(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(U,{key:7,onClick:P(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(U,{key:8,onClick:P(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(U,{key:9,onClick:P(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(U,{key:10,onClick:P(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(U,{key:11,onClick:P(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(U,{key:12,onClick:P(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(U,{onClick:P(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(U,{key:13,onClick:P(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(U,{key:14,class:"delete-item",onClick:P(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",Zi,[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,Mi))),128))])}const ea=E(Li,[["render",xi]]),ta={class:"player-slider"},oa=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})}),m=()=>{},b=g=>t.dispatch("suno/setAudio",{...t.state.suno.audio,progress:g});return(g,p)=>(n(),u("div",ta,[o(j(he),{modelValue:d.value,"onUpdate:modelValue":p[0]||(p[0]=f=>d.value=f),"show-tooltip":!1,min:0,max:r.value,onChange:b,onInput:m},null,8,["modelValue","max"])]))}}),sa={class:"flex player-song"},na=["src"],ia={class:"ml-2 text-xs flex flex-col justify-between"},aa={class:"w-52 2xl:w-96 cursor-pointer truncate"},la={class:"flex"},ra={class:"ml-2 text-dc"},da=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,m)=>{if(r?.audio_url!==m?.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!==m?.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!==m?.state&&(console.log("state changed",r.state),r.object&&(r.state==="playing"?r.object.play():r.object.pause()));r?.volume!==m?.volume&&(console.log("volume changed",r.volume),r.object&&(r.object.volume=r.volume/100))}),(r,m)=>(n(),u("div",sa,[s("img",{alt:"",class:"w-11 h-11 rounded",src:d.value?.image_url||j(Qe)},null,8,na),s("div",ia,[s("div",aa,[s("div",la,[s("span",null,a(d.value?.title||"Music"),1),s("span",ra,"- "+a(d.value?.style||"SmallRuralDog"),1)])])])]))}}),ua={class:"flex justify-end items-center gap-x-2.5"},ca={class:"text-xs"},pa=A({__name:"PlayerAction",setup(e){const t=ee(),d=N({get:()=>t.state.suno?.audio?.progress,set:m=>t.commit("suno/setAudio",{...t.state.suno.audio,progress:m})}),r=N({get:()=>t.state.suno?.audio?.duration,set:m=>t.commit("suno/setAudio",{...t.state.suno.audio,duration:m})});return(m,b)=>(n(),u("div",ua,[s("span",ca,a(j(Z)(d.value))+" / "+a(j(Z)(r.value)),1)]))}}),ma={class:"player-volume flex flex-col items-center pt-2"},fa={class:"text-sm mt-3"},ha=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})}),m=b=>t.dispatch("suno/setVolume",b);return(b,g)=>(n(),u("div",ma,[o(j(he),{modelValue:d.value,"onUpdate:modelValue":g[0]||(g[0]=p=>d.value=p),vertical:"",height:"100px","show-tooltip":!1,max:100,min:0,size:"small",disabled:r.value,onInput:m},null,8,["modelValue","disabled"]),s("div",fa,a(d.value),1)]))}}),ga={class:"flex items-center justify-center gap-x-3"},$a=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(m,b)=>(n(),u("div",ga,[o(_e,{icon:r.value?.state==="playing"?j(Je):j(Ye),size:"45",theme:"filled",class:"text-[var(--el-color-primary)] cursor-pointer",onClick:d},null,8,["icon"]),o(j(Ee),{placement:"top",width:"50px",trigger:"click"},{reference:i(()=>[o(_e,{icon:j(Xe),size:"20","stroke-width":2,class:"cursor-pointer"},null,8,["icon"])]),default:i(()=>[o(ha)]),_:1})]))}}),_a={class:"flex flex-col items-stretch h-20"},va={class:"flex grow px-5 items-center"},ya={class:"flex-1"},ba={class:"flex-1"},ka={class:"flex-1"},wa=A({__name:"Player",setup(e){return(t,d)=>(n(),u("div",_a,[o(oa),s("div",va,[s("div",ya,[o(da)]),s("div",ba,[o($a)]),s("div",ka,[o(pa)])])]))}}),Ca=A({name:"RecentPanel",components:{ElSkeletonItem:dt,ElSkeleton:rt,ElInput:W,ElButton:G,ElDropdown:Pe,ElDropdownMenu:Ue,ElDropdownItem:Ae,ElPopover:Ee,ElRadioGroup:J,ElRadioButton:te,ElSelect:ce,ElOption:ue,FontAwesomeIcon:z,TaskPreview:ea,Player:wa,NoTasks:lt,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 m of r)m.model&&t.add(m.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(m=>m.title?.toLowerCase().includes(t)||m.style?.toLowerCase().includes(t)||m.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(m=>!(this.filterDuration==="short"&&!(typeof m.duration=="number"&&m.duration<60)||this.filterDuration==="medium"&&!(typeof m.duration=="number"&&m.duration>=60&&m.duration<=180)||this.filterDuration==="long"&&!(typeof m.duration=="number"&&m.duration>180)||this.filterVideo==="with"&&!m.video_url||this.filterVideo==="without"&&m.video_url||this.filterModel&&this.filterModel!=="all"&&m.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?.()}}}),Va={key:0,class:"tasks"},Sa={class:"left w-[70px] p-[10px] flex items-center"},Ta={class:"main w-[calc(100%-70px)] flex-1 p-[10px]"},Aa={key:0,class:"task-toolbar"},Ua={key:0,class:"filter-badge"},Pa={class:"filter-popover"},Ea={class:"filter-row"},Ia={class:"filter-label"},La={class:"filter-row"},Ra={class:"filter-label"},Ma={class:"filter-row"},Fa={class:"filter-label"},Da={key:0,class:"filter-row"},za={class:"filter-label"},ja={class:"filter-actions"},Ga={key:2,class:"w-full flex-1 flex items-center justify-center"},Ba={class:"text-sm text-gray-400"},Oa={key:3,class:"w-full flex-1 flex flex-col items-center justify-center gap-2"},Na={class:"text-sm text-gray-400"},Ha={key:4,class:"w-full flex-1 flex items-center justify-center"},Wa={class:"h-20"};function qa(e,t,d,r,m,b){const g=l("el-skeleton-item"),p=l("el-skeleton"),f=l("font-awesome-icon"),k=l("el-input"),$=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"),U=l("el-option"),q=l("el-select"),Q=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",Va,[(n(),u(M,null,D(3,L=>s("div",{key:L,class:"flex"},[s("div",Sa,[o(p,{animated:""},{template:i(()=>[o(g,{variant:"image",class:"avatar w-[50px] h-[50px]"})]),_:1})]),s("div",Ta,[o(p,{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",Aa,[o(k,{modelValue:e.searchQuery,"onUpdate:modelValue":t[0]||(t[0]=L=>e.searchQuery=L),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($,{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(Q,{trigger:"click",placement:"bottom-end",width:260},{reference:i(()=>[o($,{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",Ua,a(e.activeFilterCount),1)):c("",!0)]),_:1},8,["class"])]),default:i(()=>[s("div",Pa,[s("div",Ea,[s("div",Ia,a(e.$t("suno.filter.type")),1),o(I,{modelValue:e.filterType,"onUpdate:modelValue":t[1]||(t[1]=L=>e.filterType=L),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",La,[s("div",Ra,a(e.$t("suno.filter.duration")),1),o(I,{modelValue:e.filterDuration,"onUpdate:modelValue":t[2]||(t[2]=L=>e.filterDuration=L),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",Ma,[s("div",Fa,a(e.$t("suno.filter.video")),1),o(I,{modelValue:e.filterVideo,"onUpdate:modelValue":t[3]||(t[3]=L=>e.filterVideo=L),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",Da,[s("div",za,a(e.$t("suno.filter.model")),1),o(q,{modelValue:e.filterModel,"onUpdate:modelValue":t[4]||(t[4]=L=>e.filterModel=L),size:"small",placeholder:e.$t("suno.filter.modelAll"),clearable:""},{default:i(()=>[o(U,{label:e.$t("suno.filter.modelAll"),value:"all"},null,8,["label"]),(n(!0),u(M,null,D(e.availableModels,L=>(n(),y(U,{key:L,label:L,value:L},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])):c("",!0),s("div",ja,[o($,{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]=L=>e.$emit("reach-top"))},{default:i(()=>[(n(!0),u(M,null,D(e.filteredTasks,(L,ae)=>(n(),y(Y,{key:ae,"model-value":L,class:"preview"},null,8,["model-value"]))),128))]),_:1},8,["loading"])):e.searchQuery&&e.tasks?.items?.length>0?(n(),u("div",Ga,[s("p",Ba,a(e.$t("suno.message.noSearchResults")),1)])):e.activeFilterCount>0&&e.tasks?.items?.length>0?(n(),u("div",Oa,[s("p",Na,a(e.$t("suno.message.noFilterResults")),1),o($,{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",Ha,[o(S)])):c("",!0)],64)),B(s("div",Wa,[o(ie)],512),[[Re,!!e.$store?.state?.suno?.audio?.object]])],64)}const Ka=E(Ca,[["render",qa],["__scopeId","data-v-4ab3f8f2"]]),Qa=A({name:"TaskPreview",components:{IconPicture:De,ElImage:O,ElAvatar:Ze,ElIcon:x},computed:{audio(){return this.$store.state.suno?.audio}}}),Ja={key:0,class:"size-full overflow-hidden"},Ya={class:"relative h-[300px]"},Xa={class:"flex items-center justify-center size-full bg-[var(--el-bg-color)]"},Za={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"},el={class:"flex items-center font-bold mb-2"},tl={class:"text-[var(--el-text-color-regular)] mb-2"},ol={class:"text-xs text-[var(--el-text-color-regular)]"},sl={class:"mt-4 text-sm leading-[25px] whitespace-pre-wrap"},nl={key:1,class:"w-full h-full"};function il(e,t,d,r,m,b){const g=l("icon-picture"),p=l("el-icon"),f=l("el-image"),k=l("el-avatar");return e.audio?.object?(n(),u("div",Ja,[s("div",Ya,[o(f,{src:e.audio.image_url,fit:"cover",class:"size-full"},{error:i(()=>[s("div",Xa,[o(p,{class:"text-3xl"},{default:i(()=>[o(g)]),_:1})])]),_:1},8,["src"]),s("h2",Za,a(e.audio?.title),1)]),s("div",xa,[s("div",el,[o(k,{size:30,src:e.audio?.image_url,class:"mr-2"},null,8,["src"]),s("span",null,a(e.audio?.title),1)]),s("p",tl,a(e.audio?.style),1),s("p",ol,a(e.$dayjs.format(e.audio?.created_at)),1),s("div",sl,[s("p",null,a(e.audio?.lyric),1)])])])):(n(),u("div",nl))}const al=E(Qa,[["render",il]]),ll=Se("suno"),rl=A({name:"SunoIndex",components:{Layout:gt,ConfigPanel:Ii,RecentPanel:Ka,PreviewPanel:al},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 He({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(){je.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:ll},t=this.credential?.token;if(!t){console.error("no token specified");return}w.info(this.$t("suno.message.startingTask")),ze("suno",R.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 dl(e,t,d,r,m,b){const g=l("config-panel"),p=l("recent-panel"),f=l("preview-panel"),k=l("layout");return n(),y(k,null,{config:i(()=>[o(g,{onGenerate:e.onGenerateAudio},null,8,["onGenerate"])]),result:i(()=>[o(p,{ref:"recentPanel",class:"panel recent",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),preview:i(()=>[o(f)]),_:1})}const cr=E(rl,[["render",dl],["__scopeId","data-v-933ac61a"]]);export{cr as default};