@acedatacloud/nexior 3.153.0 → 3.155.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 (306) hide show
  1. package/dist/assets/{Auth-DDrnBE0l.js → Auth-C5yxZX8u.js} +1 -1
  2. package/dist/assets/{BotPlaceholder-BaXQOlUu.js → BotPlaceholder-MWeT2hk0.js} +1 -1
  3. package/dist/assets/{Callback-DvCOO19G.js → Callback-Bg8rAQOD.js} +1 -1
  4. package/dist/assets/Console-B6tllD-d.js +1 -0
  5. package/dist/assets/{Consumption-DFTH_HGK.js → Consumption-D8YBErjq.js} +1 -1
  6. package/dist/assets/{Conversation-Dztwlkuu.js → Conversation-BOpr84nc.js} +1 -1
  7. package/dist/assets/{CopyToClipboard-D0h1kZtr.js → CopyToClipboard-BBeUorYq.js} +1 -1
  8. package/dist/assets/{Detail-OzReBvPD.js → Detail-BjU6DC1a.js} +2 -2
  9. package/dist/assets/{EditArray-4hN22N2P.js → EditArray-DdvjUw6y.js} +1 -1
  10. package/dist/assets/Extra-D5RyEfPk.js +1 -0
  11. package/dist/assets/{FilePreview-BxQ2ui-K.js → FilePreview-Dsm7gTht.js} +1 -1
  12. package/dist/assets/{History-BYZCLuZX.js → History-CRcdipmT.js} +1 -1
  13. package/dist/assets/{IconPark.vue_vue_type_script_setup_true_lang-BceOaJ6J.js → IconPark.vue_vue_type_script_setup_true_lang-DuxQ9KTF.js} +1 -1
  14. package/dist/assets/{ImagePreview-7naWf_Hk.js → ImagePreview-DlwroH_y.js} +1 -1
  15. package/dist/assets/{ImageWrapper-DBP8OPPq.js → ImageWrapper-BtYQEZCS.js} +1 -1
  16. package/dist/assets/Index--0WmZwGx.js +1 -0
  17. package/dist/assets/{Index-DMnHU_Dy.js → Index-AcKTWDy1.js} +1 -1
  18. package/dist/assets/Index-BENMm8C5.js +1 -0
  19. package/dist/assets/Index-BKfute4h.js +1 -0
  20. package/dist/assets/Index-BRJy9SeT.js +1 -0
  21. package/dist/assets/Index-Bg3oLcmZ.js +1 -0
  22. package/dist/assets/Index-Bj0EBQLt.js +1 -0
  23. package/dist/assets/Index-Bm4h0ACz.js +1 -0
  24. package/dist/assets/Index-C-swsTPi.js +4 -0
  25. package/dist/assets/Index-C4bbcIQ3.js +1 -0
  26. package/dist/assets/Index-C6Jw_A0k.js +1 -0
  27. package/dist/assets/Index-C9a-wXjj.js +1 -0
  28. package/dist/assets/Index-CE25P8dV.js +1 -0
  29. package/dist/assets/{Index-CeHXUEmf.js → Index-CPfrthRw.js} +1 -1
  30. package/dist/assets/Index-CkZV1dAh.js +1 -0
  31. package/dist/assets/Index-D3Us6kU1.js +1 -0
  32. package/dist/assets/{Index-Nt1Go49-.js → Index-DNaZrc_p.js} +1 -1
  33. package/dist/assets/{Index-huSQWKoj.js → Index-DUlfA5Uv.js} +1 -1
  34. package/dist/assets/{Index-CBZ_nBax.js → Index-DX6pnsnZ.js} +1 -1
  35. package/dist/assets/Index-Dw6VUYGr.js +1 -0
  36. package/dist/assets/Index-OOHJfB35.js +1 -0
  37. package/dist/assets/Index-SVt10BCK.js +1 -0
  38. package/dist/assets/Index-gSjGw7ck.js +1 -0
  39. package/dist/assets/{Index-CEhs61BD.js → Index-iyJPWuKq.js} +1 -1
  40. package/dist/assets/Index-p4zdKBty.css +1 -0
  41. package/dist/assets/{Invitees-CnWhvZr5.js → Invitees-CiRGdPPA.js} +1 -1
  42. package/dist/assets/{List-DoWXT5_l.js → List-B3ZXxGdN.js} +1 -1
  43. package/dist/assets/{List-CeizYvZn.js → List-D1lduJcF.js} +1 -1
  44. package/dist/assets/List-DiNRSl0K.js +1 -0
  45. package/dist/assets/Main-CFB5kNAp.js +1 -0
  46. package/dist/assets/{Navigator-Bxv_BuuW.js → Navigator-e-SJ5i-a.js} +1 -1
  47. package/dist/assets/{NoTasks-Cz8zUMc6.js → NoTasks-Biw7HgNs.js} +1 -1
  48. package/dist/assets/{NotFound-CcLwqyOI.js → NotFound-CM3gb5dm.js} +1 -1
  49. package/dist/assets/{OAuthCallback-DSac96G7.js → OAuthCallback-BP8kK65m.js} +1 -1
  50. package/dist/assets/Pagination-Bk6HSjD_.js +1 -0
  51. package/dist/assets/Status-I904AAcd.js +1 -0
  52. package/dist/assets/Subscribe-BYTxmSv3.js +1 -0
  53. package/dist/assets/{VideoPlayer-DvxHqPgh.js → VideoPlayer-DF0852ZT.js} +1 -1
  54. package/dist/assets/_Uint8Array-DFE3Z4no.js +1 -0
  55. package/dist/assets/{_baseClone-BSjA72P_.js → _baseClone-BxlA9WX_.js} +1 -1
  56. package/dist/assets/_baseIteratee-BXXZkHgC.js +1 -0
  57. package/dist/assets/_initCloneObject-CciJTtIB.js +1 -0
  58. package/dist/assets/{add-CmzXze0M.js → add-CCCHnhv-.js} +1 -1
  59. package/dist/assets/{all-wallets-CHn9xAYZ.js → all-wallets-Es8Cu1En.js} +1 -1
  60. package/dist/assets/{app-store-DwfOf35z.js → app-store-Ce-BFhN9.js} +1 -1
  61. package/dist/assets/{apple-WGS8lnCY.js → apple-DHFvMD5w.js} +1 -1
  62. package/dist/assets/{arrow-bottom-B6gMY2Yk.js → arrow-bottom-BSPjUbXf.js} +1 -1
  63. package/dist/assets/{arrow-bottom-circle-Dgb64PUh.js → arrow-bottom-circle-BUjiVTLi.js} +1 -1
  64. package/dist/assets/{arrow-left-DKh7wE7H.js → arrow-left-CXEcL7G2.js} +1 -1
  65. package/dist/assets/{arrow-right-Dhn7TV75.js → arrow-right-DipL0wv7.js} +1 -1
  66. package/dist/assets/{arrow-top-BCxTClC8.js → arrow-top-Cp8TXP5R.js} +1 -1
  67. package/dist/assets/{avatar-Cb5CH4yp.js → avatar-s-boZsoA.js} +1 -1
  68. package/dist/assets/{bank-GXZKJABB.js → bank-8t8YPe3Q.js} +1 -1
  69. package/dist/assets/{basic-C8e8PUsP.js → basic-KkNz8HNF.js} +1 -1
  70. package/dist/assets/{browser-DZOA5Fb1.js → browser-DKL1Nupz.js} +1 -1
  71. package/dist/assets/{byokCredential-BNuLDPcq.js → byokCredential-BBTveysV.js} +1 -1
  72. package/dist/assets/{card-kkVz6uYW.js → card-CKuyZ6wB.js} +1 -1
  73. package/dist/assets/{castArray-BX_tt0Nx.js → castArray-DADNwHSf.js} +1 -1
  74. package/dist/assets/{chat-DN4tkl6w.js → chat-DQWvycPD.js} +1 -1
  75. package/dist/assets/{checkmark-DQGYaEiK.js → checkmark-CUI0FzH1.js} +1 -1
  76. package/dist/assets/{checkmark-bold-CBNi3JJb.js → checkmark-bold-DThoZ1Xi.js} +1 -1
  77. package/dist/assets/{chevron-bottom-Ce4m3o_N.js → chevron-bottom--C8S5x9o.js} +1 -1
  78. package/dist/assets/{chevron-left-B0zJ6X2c.js → chevron-left-CaRJt8Xk.js} +1 -1
  79. package/dist/assets/{chevron-right-DTHItDA_.js → chevron-right-BZbvcFsn.js} +1 -1
  80. package/dist/assets/{chevron-top-D_Y09Sio.js → chevron-top-CfgvujHE.js} +1 -1
  81. package/dist/assets/{chrome-store-C4J6giMT.js → chrome-store-CVpoO0VZ.js} +1 -1
  82. package/dist/assets/{clock-Cnmy4Mg4.js → clock-B4MFCMdq.js} +1 -1
  83. package/dist/assets/{close-BNNr7R7x.js → close-CSlHNdVb.js} +1 -1
  84. package/dist/assets/{coinPlaceholder-CPKbed1I.js → coinPlaceholder-DCRLPcfd.js} +1 -1
  85. package/dist/assets/{compass-C8uRNySO.js → compass-CB3R_H0M.js} +1 -1
  86. package/dist/assets/{copy-BzENNvfZ.js → copy-B5kBuP8W.js} +1 -1
  87. package/dist/assets/createTaskActions-DW1GZ8ni.js +1 -0
  88. package/dist/assets/{cursor-CzDjQptI.js → cursor-CeMAjiCP.js} +1 -1
  89. package/dist/assets/{cursor-transparent-61abU7S5.js → cursor-transparent-ePCrakg8.js} +1 -1
  90. package/dist/assets/{debounce-UL-c7F9u.js → debounce-Diil38Ii.js} +1 -1
  91. package/dist/assets/{desktop-BeMecIbL.js → desktop-qYYf6Lq4.js} +1 -1
  92. package/dist/assets/{disconnect-C7XNqZWW.js → disconnect-CZBE4Zbc.js} +1 -1
  93. package/dist/assets/{discord-D8WnFAX-.js → discord-Ds2oxNgu.js} +1 -1
  94. package/dist/assets/{distribution-Bnckplw8.js → distribution-CwMEvkV8.js} +1 -1
  95. package/dist/assets/{dropdown-CceaRCWn.js → dropdown-_acD3R8Y.js} +1 -1
  96. package/dist/assets/{etherscan-DhZklXvZ.js → etherscan-wR0u9qrq.js} +1 -1
  97. package/dist/assets/{exclamation-triangle-jZ8xmQ9s.js → exclamation-triangle-jVqDMCf0.js} +1 -1
  98. package/dist/assets/{extension-Dqto-7Q3.js → extension-D8xX_gaR.js} +1 -1
  99. package/dist/assets/{external-link-D7sPhBkD.js → external-link-B1g4l_Su.js} +1 -1
  100. package/dist/assets/{facebook-DXl0ugAc.js → facebook-zcE8ssOX.js} +1 -1
  101. package/dist/assets/{farcaster-Dy4GUuoj.js → farcaster-CKX4dEE7.js} +1 -1
  102. package/dist/assets/{filters-Dz0Dvkaj.js → filters-Cqe0ZNOc.js} +1 -1
  103. package/dist/assets/{github-D6u20woO.js → github-wH0NBB9C.js} +1 -1
  104. package/dist/assets/{google-BMcMZGbf.js → google-XEmlVo7x.js} +1 -1
  105. package/dist/assets/{help-circle-Mr50g_Jj.js → help-circle-Cn__xtwB.js} +1 -1
  106. package/dist/assets/{id-Dtd5UYku.js → id-Dfxh9Gfy.js} +1 -1
  107. package/dist/assets/{image-db1KE6i7.js → image-Cw3JTUuY.js} +1 -1
  108. package/dist/assets/index-B2GB0KO2.js +1 -0
  109. package/dist/assets/index-B2daJOL4.js +1 -0
  110. package/dist/assets/index-B4loSzbq.js +6 -0
  111. package/dist/assets/{index-BlbUCciE.js → index-B9TevwRm.js} +1 -1
  112. package/dist/assets/{index-VJ8AehQ6.js → index-BAA4zDOa.js} +1 -1
  113. package/dist/assets/index-BHBukY2x.js +1 -0
  114. package/dist/assets/{index-Dg898uio.js → index-BMq0egm5.js} +1 -1
  115. package/dist/assets/{index-CqUYE69O.js → index-BMuncW0x.js} +1 -1
  116. package/dist/assets/{index-Duu82c2E.js → index-BT-9sMfC.js} +1 -1
  117. package/dist/assets/{index-DUTwzVsl.js → index-Bg7ZTTvi.js} +1 -1
  118. package/dist/assets/{index-MHtwWAGL.js → index-Bh75O2Ev.js} +5 -5
  119. package/dist/assets/index-Bh_CWocK.js +1 -0
  120. package/dist/assets/index-Bmect7J5.js +1 -0
  121. package/dist/assets/index-BmiT04Wy.js +1 -0
  122. package/dist/assets/{index-BP5BsZj2.js → index-Bmv541UJ.js} +1 -1
  123. package/dist/assets/{index-mkyH6aAj.js → index-BnvpbMOG.js} +1 -1
  124. package/dist/assets/index-BoRxbdW2.js +1 -0
  125. package/dist/assets/{index-Ce2SVQ2-.js → index-C7RTFnM6.js} +1 -1
  126. package/dist/assets/index-CBQuA3gp.js +1 -0
  127. package/dist/assets/{index-D3kwEdCO.js → index-CBfqsHGh.js} +1 -1
  128. package/dist/assets/{index-DlFN-E6q.js → index-CLYkf2LF.js} +1 -1
  129. package/dist/assets/index-CM_5D1wm.js +1 -0
  130. package/dist/assets/index-CO3EHocy.js +1 -0
  131. package/dist/assets/{index-BLenW2IQ.js → index-COYixNRd.js} +2 -2
  132. package/dist/assets/{index-BPFxCcBU.js → index-CRn19J03.js} +3 -3
  133. package/dist/assets/index-CU9q6a9R.js +1 -0
  134. package/dist/assets/{index-CP1XocLG.js → index-CaoCMuT8.js} +1 -1
  135. package/dist/assets/index-Cbobj5pH.js +1 -0
  136. package/dist/assets/index-Cfi1Y4Yt.js +1 -0
  137. package/dist/assets/{index-Dffxw0ff.js → index-CptSkKy6.js} +1 -1
  138. package/dist/assets/index-CsIY1sFD.js +1 -0
  139. package/dist/assets/{index-CUMrI3uM.js → index-Cxzu3p6D.js} +14 -14
  140. package/dist/assets/index-CyjIgKl3.js +1 -0
  141. package/dist/assets/index-D11Ra7Ih.js +1 -0
  142. package/dist/assets/index-D4mL6fA_.js +1 -0
  143. package/dist/assets/{index-DF9s3sJR.js → index-DJomZFMl.js} +1 -1
  144. package/dist/assets/{index-noiKsTkE.js → index-DMhUwz4K.js} +1 -1
  145. package/dist/assets/index-DPPPRCYV.js +1 -0
  146. package/dist/assets/index-DTShxeQ8.js +1 -0
  147. package/dist/assets/index-DXsi-Nbo.js +1 -0
  148. package/dist/assets/index-DacX-iLC.js +1 -0
  149. package/dist/assets/index-DcYLY5pc.js +1 -0
  150. package/dist/assets/index-DeKlpOxv.js +1 -0
  151. package/dist/assets/index-DgYDpqtG.js +1 -0
  152. package/dist/assets/index-Djxb2dU9.js +1 -0
  153. package/dist/assets/index-Do-C8-MO.js +1 -0
  154. package/dist/assets/index-DoxNGxb6.js +1 -0
  155. package/dist/assets/index-DsXMatd8.js +1 -0
  156. package/dist/assets/{index-CK4Gkg3p.js → index-DvRyeyjU.js} +1 -1
  157. package/dist/assets/{index-yn55RwAP.js → index-Dx5Bt7uM.js} +1 -1
  158. package/dist/assets/index-Dy9rDuZd.js +1 -0
  159. package/dist/assets/{index-CaNkjkZ8.js → index-DyFVEFKN.js} +1 -1
  160. package/dist/assets/{index-BC2_g7Ww.js → index-PZksrf5l.js} +1 -1
  161. package/dist/assets/index-TDaWy-9e.js +1 -0
  162. package/dist/assets/{index-Bb7Nk44w.js → index-X0-EF8Ss.js} +2 -2
  163. package/dist/assets/index-_HYMyS6B.js +1 -0
  164. package/dist/assets/index-bUDicda4.js +1 -0
  165. package/dist/assets/{index-BKAOJrxY.js → index-k2vqkrUd.js} +1 -1
  166. package/dist/assets/index-q6texU62.js +1 -0
  167. package/dist/assets/index-scIuLPKj.js +1 -0
  168. package/dist/assets/{index.browser.esm-ClaN3zpF.js → index.browser.esm-C-zoQVQf.js} +3 -3
  169. package/dist/assets/{index.es-PxkVTVul.js → index.es-r9pvLLwr.js} +1 -1
  170. package/dist/assets/{info-BXBLa64z.js → info-BcWb8ezO.js} +1 -1
  171. package/dist/assets/{info-circle-B4eNlDK0.js → info-circle-8fgqZITT.js} +1 -1
  172. package/dist/assets/{isEqual-DyhHzzXY.js → isEqual-C-ffp0KB.js} +1 -1
  173. package/dist/assets/{isPlainObject-CcKl5vVw.js → isPlainObject-Di6klIrD.js} +1 -1
  174. package/dist/assets/{lightbulb-e04CjglQ.js → lightbulb-7tEN9KhQ.js} +1 -1
  175. package/dist/assets/{mail-DCbmXlLv.js → mail-DMvFP1aR.js} +1 -1
  176. package/dist/assets/{midjourney-J2fcjKsM.js → midjourney-CN0lLPO6.js} +1 -1
  177. package/dist/assets/{mobile-D3Vr08QE.js → mobile-BerpxTqX.js} +1 -1
  178. package/dist/assets/{more-CzmowcGv.js → more-Bq8kv13j.js} +1 -1
  179. package/dist/assets/{network-placeholder-S4xr_Ish.js → network-placeholder-DkqtckZu.js} +1 -1
  180. package/dist/assets/{nftPlaceholder-CFpKbiYU.js → nftPlaceholder-BKyxfdCp.js} +1 -1
  181. package/dist/assets/{off-D6wSDq5r.js → off-Bsk8mLFe.js} +1 -1
  182. package/dist/assets/{order-CQMesFjP.js → order-J9gbCC7-.js} +1 -1
  183. package/dist/assets/{pagination-DnskqQUw.js → pagination-CZb0hbZ1.js} +1 -1
  184. package/dist/assets/pika-DpzVVVef.js +1 -0
  185. package/dist/assets/{play-store-BOLDPeK6.js → play-store-iLe6i_e3.js} +1 -1
  186. package/dist/assets/{plus-BzqztpJW.js → plus-CLSzYu4A.js} +1 -1
  187. package/dist/assets/{price-CxhDvSzR.js → price-Gt41kpjf.js} +1 -1
  188. package/dist/assets/{producer-DI_UGu92.js → producer-B6lgmDAY.js} +1 -1
  189. package/dist/assets/{qr-code-Cu_jrN04.js → qr-code-B7D4uY_R.js} +1 -1
  190. package/dist/assets/qrart-C9yTZSh5.js +1 -0
  191. package/dist/assets/{recycle-horizontal-6jZ5yRQX.js → recycle-horizontal-D8bXhJHH.js} +1 -1
  192. package/dist/assets/{refresh-DecfBxuF.js → refresh-DU2QbBHD.js} +1 -1
  193. package/dist/assets/{reown-logo-z7BX-Lbw.js → reown-logo-BVa1mOkx.js} +1 -1
  194. package/dist/assets/{search-DX2otVBy.js → search-CQCTwFMi.js} +1 -1
  195. package/dist/assets/{secp256k1-DeElS5sK.js → secp256k1-BCifYuud.js} +1 -1
  196. package/dist/assets/{secp256k1-ChFo7qze.js → secp256k1-wTwOPCKI.js} +1 -1
  197. package/dist/assets/{seedream-auGCEdqn.js → seedream-DK57LdMp.js} +1 -1
  198. package/dist/assets/{send-Czo3iJAL.js → send-tDMSeUFw.js} +1 -1
  199. package/dist/assets/{service-XY-3uR2r.js → service-CAWO3P43.js} +1 -1
  200. package/dist/assets/{solana-wallets-DvUT0YeD.js → solana-wallets-Cy1pyRVt.js} +2 -2
  201. package/dist/assets/{solana-wallets-vue-D-Nx9CE8.js → solana-wallets-vue-NBqLu-UJ.js} +1 -1
  202. package/dist/assets/{suno-xZL8iGhM.js → suno-CPV373Zg.js} +1 -1
  203. package/dist/assets/{swapHorizontal-DeqQuIFf.js → swapHorizontal-DnBz3eV5.js} +1 -1
  204. package/dist/assets/{swapHorizontalBold-CoVrmJrd.js → swapHorizontalBold-FSyxKitq.js} +1 -1
  205. package/dist/assets/{swapHorizontalMedium-BjQIr8b8.js → swapHorizontalMedium-CJolRSz4.js} +1 -1
  206. package/dist/assets/{swapHorizontalRoundedBold-BtDng4q7.js → swapHorizontalRoundedBold-D0PUdas5.js} +1 -1
  207. package/dist/assets/{swapVertical-5jgvn930.js → swapVertical-BQYDAwsG.js} +1 -1
  208. package/dist/assets/{telegram-Cf21BUrY.js → telegram-_xOshMPG.js} +1 -1
  209. package/dist/assets/{three-dots-z5KfuaCE.js → three-dots-CAu5VAe9.js} +1 -1
  210. package/dist/assets/{twitch-tXRadvQe.js → twitch-CibH0dB6.js} +1 -1
  211. package/dist/assets/{twitterIcon-BkDj0hBx.js → twitterIcon-37qP_hjw.js} +1 -1
  212. package/dist/assets/typescript-xdzIxq8N.js +1 -0
  213. package/dist/assets/{use-form-item-BCUliaxT.js → use-form-item-ByR72rLs.js} +1 -1
  214. package/dist/assets/validator-B-vGzVTA.js +1 -0
  215. package/dist/assets/{verify-D8DxLVRM.js → verify-DbC_zxsB.js} +1 -1
  216. package/dist/assets/{verify-filled-B7kwzlnV.js → verify-filled-DqcJtWbR.js} +1 -1
  217. package/dist/assets/{w3m-modal-22dEVCrg.js → w3m-modal-DpvmHPNT.js} +1 -1
  218. package/dist/assets/{wallet-Ce4orrbn.js → wallet-BZMCuPjo.js} +1 -1
  219. package/dist/assets/{wallet-placeholder-DZBPAI-m.js → wallet-placeholder-C7KaRiGh.js} +1 -1
  220. package/dist/assets/{walletconnect-wg_6yCCU.js → walletconnect-D7HaaNd8.js} +1 -1
  221. package/dist/assets/{warning-circle-tQco1wm8.js → warning-circle-CCZkhkzy.js} +1 -1
  222. package/dist/assets/{web-dEhOij-c.js → web-B6Dhg7n-.js} +1 -1
  223. package/dist/assets/{web-0M91Tp1S.js → web-V12AcwBa.js} +1 -1
  224. package/dist/assets/{x-DSlNv2tZ.js → x-BfCAZ8Sf.js} +1 -1
  225. package/dist/index.html +1 -1
  226. package/package.json +1 -1
  227. package/dist/assets/Console-j13poOpt.js +0 -1
  228. package/dist/assets/Extra-HDM3iAIL.js +0 -1
  229. package/dist/assets/Index-5dnM7IVQ.js +0 -1
  230. package/dist/assets/Index-6gLsddki.js +0 -1
  231. package/dist/assets/Index-B5kWayK1.js +0 -4
  232. package/dist/assets/Index-BD79lwki.js +0 -1
  233. package/dist/assets/Index-BF9bRDwY.js +0 -1
  234. package/dist/assets/Index-BIh7lrcj.js +0 -1
  235. package/dist/assets/Index-Bc41k2MH.js +0 -1
  236. package/dist/assets/Index-BdS9JUut.js +0 -1
  237. package/dist/assets/Index-BdW_y_4k.js +0 -1
  238. package/dist/assets/Index-Bxip2nWO.js +0 -1
  239. package/dist/assets/Index-D1uVD7MJ.js +0 -1
  240. package/dist/assets/Index-DCC8V8ZY.css +0 -1
  241. package/dist/assets/Index-DSYePGan.js +0 -1
  242. package/dist/assets/Index-DhyU728T.js +0 -1
  243. package/dist/assets/Index-Dk3_OwNx.js +0 -1
  244. package/dist/assets/Index-DtSSjduU.js +0 -1
  245. package/dist/assets/Index-YWCXBkrX.js +0 -1
  246. package/dist/assets/Index-ZbFDulyj.js +0 -1
  247. package/dist/assets/Index-yr6aKo3J.js +0 -1
  248. package/dist/assets/List-CoF-LEif.js +0 -1
  249. package/dist/assets/Main-CmtvT7sQ.js +0 -1
  250. package/dist/assets/Pagination-DuiwOQtA.js +0 -1
  251. package/dist/assets/Status-BI5eG15k.js +0 -1
  252. package/dist/assets/Subscribe-DMQsOiFE.js +0 -1
  253. package/dist/assets/_Uint8Array-xXOLJRhg.js +0 -1
  254. package/dist/assets/_baseIteratee-A9x3WSjV.js +0 -1
  255. package/dist/assets/_initCloneObject-CI8Xd2KA.js +0 -1
  256. package/dist/assets/flux-DCbjWSi3.js +0 -1
  257. package/dist/assets/hailuo-dnC-ATKI.js +0 -1
  258. package/dist/assets/headshots-i-IWtbB1.js +0 -1
  259. package/dist/assets/index-4gKTHL4m.js +0 -1
  260. package/dist/assets/index-ANiQ8hRa.js +0 -1
  261. package/dist/assets/index-B0UU8wtf.js +0 -1
  262. package/dist/assets/index-B5uViYWu.js +0 -1
  263. package/dist/assets/index-B7yyoRtz.js +0 -1
  264. package/dist/assets/index-BLPj-bFo.js +0 -1
  265. package/dist/assets/index-BV7Onq3z.js +0 -1
  266. package/dist/assets/index-BX75bHZZ.js +0 -1
  267. package/dist/assets/index-BgGOtUyI.js +0 -1
  268. package/dist/assets/index-BhgPr4v6.js +0 -1
  269. package/dist/assets/index-Bj1Qrw3o.js +0 -1
  270. package/dist/assets/index-Bk3keCL7.js +0 -1
  271. package/dist/assets/index-BpuPZd0a.js +0 -1
  272. package/dist/assets/index-C07tODnb.js +0 -1
  273. package/dist/assets/index-C9pmXydD.js +0 -1
  274. package/dist/assets/index-CTf4CCHb.js +0 -1
  275. package/dist/assets/index-CYoskRTt.js +0 -1
  276. package/dist/assets/index-CeFV0MI6.js +0 -1
  277. package/dist/assets/index-Csl-HYyf.js +0 -1
  278. package/dist/assets/index-D5t7Lgdc.js +0 -1
  279. package/dist/assets/index-DECR9Z-S.js +0 -1
  280. package/dist/assets/index-DP4m7gwj.js +0 -1
  281. package/dist/assets/index-DWeJByu5.js +0 -1
  282. package/dist/assets/index-DceoqtRa.js +0 -1
  283. package/dist/assets/index-DhLR2kZI.js +0 -1
  284. package/dist/assets/index-DltP2bfN.js +0 -1
  285. package/dist/assets/index-DpWh3pWV.js +0 -1
  286. package/dist/assets/index-Dzglb-UN.js +0 -1
  287. package/dist/assets/index-FLb7lvpT.js +0 -1
  288. package/dist/assets/index-Iywsl7Po.js +0 -1
  289. package/dist/assets/index-LHAPoElI.js +0 -1
  290. package/dist/assets/index-LJD4KxHk.js +0 -1
  291. package/dist/assets/index-NhMzhO2I.js +0 -6
  292. package/dist/assets/index-gQsYSS6T.js +0 -1
  293. package/dist/assets/index-vtX69hlH.js +0 -1
  294. package/dist/assets/kling-DDzHSkML.js +0 -1
  295. package/dist/assets/luma-CEGrL_1K.js +0 -1
  296. package/dist/assets/nanobanana-CiVbVjBG.js +0 -1
  297. package/dist/assets/openaiimage-KrdkLxHF.js +0 -1
  298. package/dist/assets/pika-DarXnIXV.js +0 -1
  299. package/dist/assets/pixverse-DtqGUyUX.js +0 -1
  300. package/dist/assets/qrart-Ba5RkjjA.js +0 -1
  301. package/dist/assets/seedance-DgsqaYbQ.js +0 -1
  302. package/dist/assets/sora-CaAJTxIc.js +0 -1
  303. package/dist/assets/typescript-DeTjW0DO.js +0 -1
  304. package/dist/assets/validator-Bzrp9xMi.js +0 -1
  305. package/dist/assets/veo-Dw_2Kbq1.js +0 -1
  306. package/dist/assets/wan-41cXgfvK.js +0 -1
@@ -0,0 +1 @@
1
+ import{F as C}from"./index.es-r9pvLLwr.js";import{E as T}from"./index-_HYMyS6B.js";import{E as M}from"./index-CptSkKy6.js";import{d as v,H as r,E as c,z as L,C as t,y as d,D as o,q as s,F as l,O as I,N as S,x as $,I as f,J as m,M as O,Q as U}from"./vendor-vue-NSDaktjZ.js";import{G as w,bl as j,cr as B,b4 as F,S as D,cs as N}from"./index-Cxzu3p6D.js";import{a as q,b as z}from"./wan-DKq-jYOo.js";import{E as R,a as G}from"./index-BoRxbdW2.js";import{p as W}from"./pasteUploadMixin-BurWbGNQ.js";import{I as P,S as H,l as J}from"./pagination-CZb0hbZ1.js";import{I as K}from"./ImagePreview-DlwroH_y.js";import{E as Q}from"./index-DTShxeQ8.js";import{E as V}from"./index-CBfqsHGh.js";import{E as X}from"./index-Bh_CWocK.js";import{C as Y}from"./Consumption-D8YBErjq.js";import{a as Z}from"./price-Gt41kpjf.js";import{b as x}from"./errorCode-Cqj9Td_Z.js";import{C as ee}from"./CopyToClipboard-BBeUorYq.js";import{V as te}from"./VideoPlayer-DF0852ZT.js";import{E as oe}from"./index-CBQuA3gp.js";import{E as se}from"./index-DeKlpOxv.js";import{E as ne}from"./index-DacX-iLC.js";import{B as ae}from"./BotPlaceholder-MWeT2hk0.js";import{N as le}from"./NoTasks-Biw7HgNs.js";import"./use-form-item-ByR72rLs.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./index-Bg7ZTTvi.js";import"./typescript-xdzIxq8N.js";import"./index-Bmect7J5.js";import"./strings-beZM2Y-f.js";import"./isEqual-C-ffp0KB.js";import"./_Uint8Array-DFE3Z4no.js";import"./castArray-DADNwHSf.js";import"./debounce-Diil38Ii.js";import"./_baseIteratee-BXXZkHgC.js";import"./index-BAA4zDOa.js";import"./index-B4loSzbq.js";import"./_baseClone-BxlA9WX_.js";import"./_initCloneObject-CciJTtIB.js";import"./index-BMuncW0x.js";import"./vue-plyr-BO2nlN4c.js";import"./index-CsIY1sFD.js";const re=v({name:"LayoutWan",components:{ElDrawer:M,ElButton:T,FontAwesomeIcon:C},data(){return{drawer:!1}}}),ie={class:"main flex flex-row flex-1"},ce={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},de={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function ue(e,n,h,_,b,k){const u=o("font-awesome-icon"),p=o("el-button"),a=o("el-drawer");return s(),r("div",ie,[c("div",ce,[L(e.$slots,"config",{},void 0,!0)]),c("div",de,[L(e.$slots,"result",{},void 0,!0)]),t(p,{circle:"",class:"menu",onClick:n[0]||(n[0]=g=>e.drawer=!0)},{default:d(()=>[t(u,{icon:"fa-solid fa-magic"})]),_:1}),t(a,{modelValue:e.drawer,"onUpdate:modelValue":n[1]||(n[1]=g=>e.drawer=g),direction:"ltr","with-header":!1,size:"340px"},{default:d(()=>[L(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const pe=w(re,[["render",ue],["__scopeId","data-v-98681d9b"]]),me=v({name:"ModelSelector",components:{ElSelect:G,ElOption:R},data(){return{}},computed:{options(){return[{value:"wan2.6-t2v",label:this.$t("wan.button.modelT2v")},{value:"wan2.6-i2v",label:this.$t("wan.button.modelI2v")},{value:"wan2.6-i2v-flash",label:this.$t("wan.button.modelI2vFlash")},{value:"wan2.6-r2v",label:this.$t("wan.button.modelR2v")}]},value:{get(){return this.$store.state.wan?.config?.model},set(e){this.$store.commit("wan/setConfig",{...this.$store.state.wan?.config,model:e})}}},mounted(){this.value||(this.value=q)}}),fe={class:"field"},he={class:"title font-bold"},_e={class:"float-left"};function ge(e,n,h,_,b,k){const u=o("el-option"),p=o("el-select");return s(),r("div",fe,[c("h2",he,l(e.$t("wan.name.model")),1),t(p,{modelValue:e.value,"onUpdate:modelValue":n[0]||(n[0]=a=>e.value=a),class:"value",placeholder:e.$t("wan.placeholder.select"),clearable:""},{default:d(()=>[(s(!0),r(I,null,S(e.options,a=>(s(),$(u,{key:a.value,label:a.label,value:a.value},{default:d(()=>[c("span",_e,l(a.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const $e=w(me,[["render",ge],["__scopeId","data-v-eb090beb"]]),ve="720p",we=v({name:"ResolutionSelector",components:{ElSelect:G,ElOption:R},computed:{options(){return[{value:"480p",label:this.$t("wan.name.resolution480p")},{value:"720p",label:this.$t("wan.name.resolution720p")},{value:"1080p",label:this.$t("wan.name.resolution1080p")}]},value:{get(){return this.$store.state.wan?.config?.resolution},set(e){this.$store.commit("wan/setConfig",{...this.$store.state.wan?.config,resolution:e})}}},mounted(){this.value||(this.value=ve)}}),be={class:"field"},ke={class:"title font-bold"},ye={class:"float-left"};function Ve(e,n,h,_,b,k){const u=o("el-option"),p=o("el-select");return s(),r("div",be,[c("h2",ke,l(e.$t("wan.name.resolution")),1),t(p,{modelValue:e.value,"onUpdate:modelValue":n[0]||(n[0]=a=>e.value=a),class:"value",placeholder:e.$t("wan.placeholder.select"),clearable:""},{default:d(()=>[(s(!0),r(I,null,S(e.options,a=>(s(),$(u,{key:a.value,label:a.label,value:a.value},{default:d(()=>[c("span",ye,l(a.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Ee=w(we,[["render",Ve],["__scopeId","data-v-3e39f44e"]]),Ie=5,Te=v({name:"DurationSelector",components:{ElSelect:G,ElOption:R},computed:{options(){return[{value:5,label:this.$t("wan.name.duration5s")},{value:10,label:this.$t("wan.name.duration10s")},{value:15,label:this.$t("wan.name.duration15s")}]},value:{get(){return this.$store.state.wan?.config?.duration},set(e){this.$store.commit("wan/setConfig",{...this.$store.state.wan?.config,duration:e})}}},mounted(){this.value||(this.value=Ie)}}),Se={class:"field"},Ue={class:"title font-bold"},Le={class:"float-left"};function Ce(e,n,h,_,b,k){const u=o("el-option"),p=o("el-select");return s(),r("div",Se,[c("h2",Ue,l(e.$t("wan.name.duration")),1),t(p,{modelValue:e.value,"onUpdate:modelValue":n[0]||(n[0]=a=>e.value=a),class:"value",placeholder:e.$t("wan.placeholder.select"),clearable:""},{default:d(()=>[(s(!0),r(I,null,S(e.options,a=>(s(),$(u,{key:a.value,label:a.label,value:a.value},{default:d(()=>[c("span",Le,l(a.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Re=w(Te,[["render",Ce],["__scopeId","data-v-5f35a2cf"]]),Ge=v({name:"ImageUrlInput",components:{ElUpload:Q,ElButton:T,InfoIcon:P,ImagePreview:K},mixins:[W],data(){return{fileList:[],uploadUrl:j()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e.url).filter(e=>e!==void 0)},value:{get(){return this.$store.state.wan?.config?.image_url},set(){const e=this.urls?.[0];this.$store.commit("wan/setConfig",{...this.$store.state.wan?.config,image_url:e})}}},mounted(){this.value||(this.value=void 0),this.onSetImageUrl()},methods:{onExceed(){V.warning(this.$t("wan.message.uploadImageExceed"))},onError(){V.error(this.$t("wan.message.uploadImageError"))},async onRemove(){V.error(this.$t("wan.message.uploadImageError"))},onSetImageUrl(){const e=this.urls?.[0];this.$store.commit("wan/setConfig",{...this.$store.state.wan?.config,image_url:e})},async onSuccess(){this.onSetImageUrl()}}}),Ae={class:"relative"},De={class:"flex justify-between"},Pe={class:"flex justify-start items-center"},Me={class:"text-sm font-bold"};function Oe(e,n,h,_,b,k){const u=o("info-icon"),p=o("image-preview"),a=o("el-button"),g=o("el-upload");return s(),r("div",Ae,[c("div",De,[c("div",Pe,[c("span",Me,l(e.$t("wan.name.imageUrl")),1),t(u,{content:e.$t("wan.description.imageUrl"),class:"info"},null,8,["content"])])]),t(g,{"file-list":e.fileList,"onUpdate:fileList":n[0]||(n[0]=i=>e.fileList=i),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file","show-file-list":!0,limit:1,multiple:!1,"list-type":"picture",action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-remove":e.onRemove,"on-success":e.onSuccess,headers:e.headers},{file:d(({file:i})=>[i.url&&i.percentage!==void 0?(s(),$(p,{key:0,url:i.url,name:i.name,percentage:i.percentage,onRemove:y=>e.fileList.splice(e.fileList.indexOf(i),1)},null,8,["url","name","percentage","onRemove"])):m("",!0)]),default:d(()=>[t(a,{size:"small",type:"primary",class:"btn btn-upload",round:""},{default:d(()=>[f(l(e.$t("wan.button.uploadImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-remove","on-success","headers"])])}const je=w(Ge,[["render",Oe],["__scopeId","data-v-c9ebe1b1"]]),Be="",Fe=v({name:"PromptInput",components:{ElInput:X,InfoIcon:P},computed:{prompt:{get(){return this.$store.state.wan?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("wan/setConfig",{...this.$store.state.wan?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=Be)}}),Ne={class:"field"},qe={class:"box"},ze={class:"title font-bold"};function We(e,n,h,_,b,k){const u=o("info-icon"),p=o("el-input");return s(),r("div",Ne,[c("div",qe,[c("h2",ze,l(e.$t("wan.name.prompt")),1),t(u,{content:e.$t("wan.description.prompt"),class:"info"},null,8,["content"])]),t(p,{modelValue:e.prompt,"onUpdate:modelValue":n[0]||(n[0]=a=>e.prompt=a),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("wan.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const He=w(Fe,[["render",We],["__scopeId","data-v-45557a2d"]]),Je=v({name:"PresetPanel",components:{ElButton:T,FontAwesomeIcon:C,PromptInput:He,ImageUrlInput:je,ModelSelector:$e,ResolutionSelector:Ee,DurationSelector:Re,Consumption:Y},emits:["generate"],computed:{config(){return this.$store.state.wan?.config},consumption(){return Z(this.config,this.service?.cost)},service(){return this.$store.state.wan?.service},supportsResolution(){const e=this.config?.model;return e==="wan2.6-t2v"||e==="wan2.6-i2v"||e==="wan2.6-i2v-flash"},supportsDuration(){return this.config?.model==="wan2.6-t2v"},supportsImageUrl(){const e=this.config?.model;return e==="wan2.6-i2v"||e==="wan2.6-i2v-flash"}},methods:{onGenerate(){this.$emit("generate")}}}),Ke={class:"flex flex-col h-full"},Qe={class:"flex-1 overflow-y-auto p-5"},Xe={class:"flex flex-col items-center justify-center px-5 pb-5"};function Ye(e,n,h,_,b,k){const u=o("prompt-input"),p=o("model-selector"),a=o("resolution-selector"),g=o("duration-selector"),i=o("image-url-input"),y=o("consumption"),E=o("font-awesome-icon"),A=o("el-button");return s(),r("div",Ke,[c("div",Qe,[t(u,{class:"mb-4"}),t(p,{class:"mb-4"}),e.supportsResolution?(s(),$(a,{key:0,class:"mb-4"})):m("",!0),e.supportsDuration?(s(),$(g,{key:1,class:"mb-4"})):m("",!0),e.supportsImageUrl?(s(),$(i,{key:2,class:"mb-2"})):m("",!0)]),c("div",Xe,[t(y,{value:e.consumption,service:e.service},null,8,["value","service"]),t(A,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:d(()=>[t(E,{icon:"fa-solid fa-magic",class:"mr-2"}),f(" "+l(e.$t("wan.button.generate")),1)]),_:1},8,["onClick"])])])}const Ze=w(Je,[["render",Ye]]),xe=v({name:"TaskPreview",components:{ElImage:ne,CopyToClipboard:ee,FontAwesomeIcon:C,ElAlert:se,VideoPlayer:te,ElTooltip:oe,ElButton:T},props:{modelValue:{type:Object,required:!0}},setup(){return{WAN_LOGO:z}},computed:{application(){return this.$store.state.wan?.application},config(){return this.$store.state.wan?.config}},methods:{onDownload(e){console.debug("on download wan video",e),window.open(e,"_blank")}}}),et={class:"preview"},tt={class:"left"},ot={class:"main"},st={class:"bot"},nt={class:"datetime"},at={class:"info"},lt={key:0,class:"prompt mt-2"},rt={key:0},it={key:1},ct={key:0,class:U({content:!0,failed:!0})},dt={key:0,class:"mb-4"},ut={key:1,class:U({operations:!0,"mt-2":!0})},pt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},mt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ft={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},ht={key:1,class:U({content:!0})},_t={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},gt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},$t={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},vt={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},wt={key:2,class:U({content:!0})},bt={class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function kt(e,n,h,_,b,k){const u=o("el-image"),p=o("video-player"),a=o("el-button"),g=o("el-tooltip"),i=o("font-awesome-icon"),y=o("copy-to-clipboard"),E=o("el-alert");return s(),r("div",et,[c("div",tt,[t(u,{src:e.WAN_LOGO,class:"avatar"},null,8,["src"])]),c("div",ot,[c("div",st,[f(l(e.$t("wan.name.wanBot"))+" ",1),c("span",nt,l(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),c("div",at,[e.modelValue?.request?.prompt?(s(),r("p",lt,[f(l(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?m("",!0):(s(),r("span",rt," - ("+l(e.$t("wan.status.pending"))+") ",1)),e.modelValue?.response?.state==="processing"||e.modelValue?.response?.state==="pending"||e.modelValue?.response?.state==="running"?(s(),r("span",it," - ("+l(e.$t("wan.status.processing"))+") ",1)):m("",!0)])):m("",!0)]),e.modelValue?.response?.success===!0?(s(),r("div",ct,[e.modelValue?.response?.video_url?(s(),r("div",dt,[t(p,{src:e.modelValue?.response?.video_url},null,8,["src"])])):m("",!0),e.modelValue?.response?.video_url?(s(),r("div",ut,[t(g,{class:"box-item",effect:"dark",content:e.$t("wan.message.downloadVideo"),placement:"top-start"},{default:d(()=>[t(a,{type:"info",size:"small",class:"mb-2",onClick:n[0]||(n[0]=O(A=>e.onDownload(e.modelValue?.response?.video_url),["stop"]))},{default:d(()=>[f(l(e.$t("wan.button.download")),1)]),_:1})]),_:1},8,["content"])])):m("",!0),t(E,{closable:!1,class:"mt-2 success"},{default:d(()=>[e.modelValue?.request?.model?(s(),r("p",pt,[t(i,{icon:"fa-solid fa-hashtag",class:"mr-1"}),f(" "+l(e.$t("wan.name.model"))+": "+l(e.modelValue?.request?.model)+" ",1),t(y,{content:e.modelValue?.id},null,8,["content"])])):m("",!0),c("p",mt,[t(i,{icon:"fa-solid fa-magic",class:"mr-1"}),f(" "+l(e.$t("wan.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),t(y,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(s(),r("p",ft,[t(i,{icon:"fa-solid fa-clock",class:"mr-1"}),f(" "+l(e.$t("wan.name.elapsed"))+": "+l(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):m("",!0)]),_:1})])):m("",!0),e.modelValue?.response?.success===!1?(s(),r("div",ht,[t(E,{closable:!1,class:"failure"},{template:d(()=>[t(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),f(" "+l(e.$t("wan.name.failure")),1)]),default:d(()=>[c("p",_t,[t(i,{icon:"fa-solid fa-magic",class:"mr-1"}),f(" "+l(e.$t("wan.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),t(y,{content:e.modelValue?.id},null,8,["content"])]),c("p",gt,[t(i,{icon:"fa-solid fa-circle-info",class:"mr-1"}),f(" "+l(e.$t("wan.name.failureReason"))+": "+l(e.modelValue?.response?.error?.message)+" ",1),t(y,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(s(),r("p",$t,[t(i,{icon:"fa-solid fa-clock",class:"mr-1"}),f(" "+l(e.$t("wan.name.elapsed"))+": "+l(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):m("",!0),c("p",vt,[t(i,{icon:"fa-solid fa-hashtag",class:"mr-1"}),f(" "+l(e.$t("wan.name.traceId"))+": "+l(e.modelValue?.response?.trace_id)+" ",1),t(y,{content:e.modelValue?.response?.trace_id},null,8,["content"])])]),_:1})])):m("",!0),e.modelValue?.response?.success===void 0?(s(),r("div",wt,[t(E,{closable:!1,class:"info"},{template:d(()=>[t(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),f(" "+l(e.$t("wan.name.failure")),1)]),default:d(()=>[c("p",bt,[t(i,{icon:"fa-solid fa-magic",class:"mr-1"}),f(" "+l(e.$t("wan.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),t(y,{content:e.modelValue?.id},null,8,["content"])])]),_:1})])):m("",!0)])])}const yt=w(xe,[["render",kt],["__scopeId","data-v-6d1d636e"]]),Vt=v({name:"RecentPanel",components:{TaskPreview:yt,BotPlaceholder:ae,NoTasks:le,ScrollList:H},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.wan?.tasks,items:this.$store.state.wan?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Et={key:0},It={key:2,class:"w-full h-full flex items-center justify-center"};function Tt(e,n,h,_,b,k){const u=o("bot-placeholder"),p=o("task-preview"),a=o("scroll-list"),g=o("no-tasks");return s(),r(I,null,[e.tasks?.items===void 0?(s(),r("div",Et,[t(u)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(s(),$(a,{key:1,ref:"scrollList",class:"tasks w-full h-full overflow-y-auto",loading:e.loading,onReachTop:n[0]||(n[0]=i=>e.$emit("reach-top"))},{default:d(()=>[(s(!0),r(I,null,S(e.tasks?.items,i=>(s(),$(p,{key:i.id,"model-value":i},null,8,["model-value"]))),128))]),_:1},8,["loading"])):m("",!0),e.tasks?.items?.length===0?(s(),r("div",It,[t(g)])):m("",!0)],64)}const St=w(Vt,[["render",Tt]]),Ut=N("wan"),Lt=v({name:"WanIndex",components:{ConfigPanel:Ze,Layout:pe,RecentPanel:St},inject:["initialized"],data(){return{task:void 0,job:0,timer:void 0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.wan?.status?.getApplications===D.Request},tasksLoading(){return this.$store.state.wan?.status?.getTasks===D.Request||this.fetchingTasks},credential(){return this.$store.state.wan.credential},config(){return this.$store.state.wan.config},application(){return this.$store.state.wan.application},tasks(){return this.$store.state.wan.tasks}},watch:{tasks:{handler(e,n){e?.items?.length>n?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await J({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("wan/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("wan/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:n=5,createdAtMin:h,createdAtMax:_}=e||{};console.debug("limit",n,"createdAtMin",h,"createdAtMax",_),this.fetchingTasks=!0;try{await this.$store.dispatch("wan/getTasks",{limit:n,createdAtMin:h,createdAtMax:_})}finally{this.fetchingTasks=!1}},async onGenerate(){const e={...this.config,callback_url:Ut},n=this.credential?.token;if(!n){console.error("no token specified");return}V.info(this.$t("wan.message.startingTask")),B("wan",F.generate(e,{token:n})).then(()=>{V.success(this.$t("wan.message.startTaskSuccess"))}).catch(h=>{h?.response?.data?.error?.code===x?V.error(this.$t("wan.message.usedUp")):V.error(this.$t("wan.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Ct(e,n,h,_,b,k){const u=o("config-panel"),p=o("recent-panel"),a=o("layout");return s(),$(a,null,{config:d(()=>[t(u,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:d(()=>[t(p,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const yo=w(Lt,[["render",Ct]]);export{yo as default};
@@ -0,0 +1 @@
1
+ import{F as P}from"./index.es-r9pvLLwr.js";import{E as U}from"./index-_HYMyS6B.js";import{E as X}from"./index-CptSkKy6.js";import{d as b,H as i,E as r,z as L,C as a,y as p,D as n,q as t,F as l,O as E,N as T,x as m,Q as C,R as Y,J as d,I as _}from"./vendor-vue-NSDaktjZ.js";import{G as k,bl as Q,cr as W,aJ as K,S as M,cs as Z}from"./index-Cxzu3p6D.js";import{a as x,b as ee,c as oe,d as te,e as se,f as ne,g as G,h as ae,i as le,j as ie}from"./veo-Dg8Zhpd-.js";import{E as A,a as O}from"./index-BoRxbdW2.js";import{I as j,S as re,l as ce}from"./pagination-CZb0hbZ1.js";import{E as de}from"./index-Cfi1Y4Yt.js";import{V as D}from"./VideoPlayer-DF0852ZT.js";import{E as R}from"./index-Bh_CWocK.js";import{p as ue}from"./pasteUploadMixin-BurWbGNQ.js";import{I as pe}from"./ImagePreview-DlwroH_y.js";import{E as me}from"./index-DTShxeQ8.js";import{E as I}from"./index-CBfqsHGh.js";import{C as ve}from"./Consumption-D8YBErjq.js";import{a as fe}from"./price-Gt41kpjf.js";import{b as _e}from"./errorCode-Cqj9Td_Z.js";import{C as he}from"./CopyToClipboard-BBeUorYq.js";import{E as $e}from"./index-CBQuA3gp.js";import{E as ge}from"./index-DeKlpOxv.js";import{E as be}from"./index-DacX-iLC.js";import{B as ke}from"./BotPlaceholder-MWeT2hk0.js";import{N as ye}from"./NoTasks-Biw7HgNs.js";import"./use-form-item-ByR72rLs.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./index-Bg7ZTTvi.js";import"./typescript-xdzIxq8N.js";import"./index-Bmect7J5.js";import"./strings-beZM2Y-f.js";import"./isEqual-C-ffp0KB.js";import"./_Uint8Array-DFE3Z4no.js";import"./castArray-DADNwHSf.js";import"./debounce-Diil38Ii.js";import"./_baseIteratee-BXXZkHgC.js";import"./index-BAA4zDOa.js";import"./validator-B-vGzVTA.js";import"./vue-plyr-BO2nlN4c.js";import"./index-BMuncW0x.js";import"./index-B4loSzbq.js";import"./_baseClone-BxlA9WX_.js";import"./_initCloneObject-CciJTtIB.js";import"./index-CsIY1sFD.js";const Ve=b({name:"LayoutVeo",components:{ElDrawer:X,ElButton:U,FontAwesomeIcon:P},data(){return{drawer:!1}}}),we={class:"main flex flex-row flex-1"},Ee={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},Ie={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function Te(e,o,v,f,y,V){const c=n("font-awesome-icon"),u=n("el-button"),s=n("el-drawer");return t(),i("div",we,[r("div",Ee,[L(e.$slots,"config",{},void 0,!0)]),r("div",Ie,[L(e.$slots,"result",{},void 0,!0)]),a(u,{circle:"",class:"menu",onClick:o[0]||(o[0]=w=>e.drawer=!0)},{default:p(()=>[a(c,{icon:"fa-solid fa-magic"})]),_:1}),a(s,{modelValue:e.drawer,"onUpdate:modelValue":o[1]||(o[1]=w=>e.drawer=w),direction:"ltr","with-header":!1,size:"350px"},{default:p(()=>[L(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Se=k(Ve,[["render",Te],["__scopeId","data-v-816b984c"]]),Ce=b({name:"ModelSelector",components:{ElSelect:O,ElOption:A},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{options:[{value:"veo2",label:"veo2"},{value:"veo2-fast",label:"veo2-fast"},{value:"veo3",label:"veo3"},{value:"veo3-fast",label:"veo3-fast"},{value:"veo31-fast",label:"veo31-fast"},{value:"veo31",label:"veo31"},{value:"veo31-fast-ingredients",label:"veo31-fast-ingredients"}]}},computed:{value:{get(){return this.$store.state.veo?.config?.model},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,model:e})}}},mounted(){this.value||(this.value=x)}}),Ae={class:"field"},Oe={class:"title font-bold"};function Pe(e,o,v,f,y,V){const c=n("el-option"),u=n("el-select");return t(),i("div",Ae,[r("h2",Oe,l(e.$t("veo.name.model")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s),class:"value",placeholder:e.$t("veo.placeholder.select")},{default:p(()=>[(t(!0),i(E,null,T(e.options,s=>(t(),m(c,{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Ue=k(Ce,[["render",Pe],["__scopeId","data-v-a59d89c9"]]),Le=b({name:"ActionSelector",components:{ElSelect:O,ElOption:A},data(){return{}},computed:{options(){return[{value:"text2video",label:this.$t("veo.button.action1")},{value:"image2video",label:this.$t("veo.button.action2")},{value:"ingredients2video",label:this.$t("veo.button.actionIngredients")},{value:"upsample",label:this.$t("veo.button.actionUpsample")},{value:"extend",label:this.$t("veo.button.actionExtend")},{value:"reshoot",label:this.$t("veo.button.actionReshoot")},{value:"object_insert",label:this.$t("veo.button.actionObjectInsert")},{value:"object_remove",label:this.$t("veo.button.actionObjectRemove")}]},value:{get(){return this.$store.state.veo?.config?.action},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,action:e})}}},mounted(){this.value||(this.value=ee)}}),je={class:"field"},Re={class:"title font-bold"},Me={class:"float-left"};function Ge(e,o,v,f,y,V){const c=n("el-option"),u=n("el-select");return t(),i("div",je,[r("h2",Re,l(e.$t("veo.name.action")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s),class:"value",placeholder:e.$t("veo.placeholder.select"),clearable:""},{default:p(()=>[(t(!0),i(E,null,T(e.options,s=>(t(),m(c,{key:s.value,label:s.label,value:s.value},{default:p(()=>[r("span",Me,l(s.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const De=k(Le,[["render",Ge],["__scopeId","data-v-f4d8785c"]]),Ne=b({name:"TranslationSelector",components:{ElSwitch:de,InfoIcon:j},computed:{value:{get(){return this.$store.state.veo?.config?.translation},set(e){console.debug("set translation",e),this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,translation:e})}}},mounted(){this.value===void 0&&(this.value=oe)}}),Fe={class:"relative"},ze={class:"flex justify-between"},Be={class:"flex justify-start items-center"},qe={class:"text-sm font-bold"},He={class:"flex justify-end items-center"};function Je(e,o,v,f,y,V){const c=n("info-icon"),u=n("el-switch");return t(),i("div",Fe,[r("div",ze,[r("div",Be,[r("span",qe,l(e.$t("veo.name.translation")),1),a(c,{content:e.$t("veo.description.translation")},null,8,["content"])]),r("div",He,[a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s),class:"value"},null,8,["modelValue"])])])])}const Xe=k(Ne,[["render",Je]]),Ye=b({name:"AspectRatioSelector",data(){return{options:[{value:"1:1",label:"1:1",width:20,height:20},{value:"4:3",label:"4:3",width:20,height:15},{value:"3:4",label:"3:4",width:15,height:20},{value:"16:9",label:"16:9",width:25,height:13},{value:"9:16",label:"9:16",width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){return this.$store.state.veo?.config?.aspect_ratio},set(e){console.debug("set aspect_ratio",e),this.$store.commit("veo/setConfig",{...this.$store.state?.veo?.config,aspect_ratio:e})}}},mounted(){this.value||(this.value=te)}}),Qe={class:"text-sm font-bold mb-2 block"},We={class:"items"},Ke=["onClick"],Ze={class:"name"};function xe(e,o,v,f,y,V){return t(),i("div",null,[r("span",Qe,l(e.$t("veo.name.ratio")),1),r("div",We,[(t(!0),i(E,null,T(e.options,(c,u)=>(t(),i("div",{key:u,class:C({active:e.active===u,item:!0}),onClick:s=>e.value=c.value},[r("div",{class:C(["preview",c.label])},[r("div",{class:"rect",style:Y({width:c.width+"px",height:c.height+"px"})},null,4)],2),r("p",Ze,l(c.label),1)],10,Ke))),128))])])}const eo=k(Ye,[["render",xe],["__scopeId","data-v-0f16be77"]]),oo=b({name:"VideoFromInput",components:{VideoPlayer:D},props:{modelValue:{type:Object,required:!1,default:void 0}},data(){return{options:{quality:{default:"1080p"}}}},computed:{config(){return this.$store.state.veo?.config}}}),to={class:"relative"},so={class:"flex mb-2"},no={class:"text-sm font-bold"};function ao(e,o,v,f,y,V){const c=n("video-player");return t(),i("div",to,[r("div",so,[r("span",no,l(e.$t("veo.name.action3")),1)]),r("div",null,[e.config?.video_url?(t(),m(c,{key:0,src:e.config?.video_url},null,8,["src"])):d("",!0)])])}const lo=k(oo,[["render",ao]]),io=b({name:"VideoIdInput",components:{ElInput:R},computed:{value:{get(){return this.$store.state.veo?.config?.video_id},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,video_id:e})}}}}),ro={class:"field"},co={class:"title font-bold"};function uo(e,o,v,f,y,V){const c=n("el-input");return t(),i("div",ro,[r("h2",co,l(e.$t("veo.name.videoId")),1),a(c,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=u=>e.value=u),class:"value",type:"text",placeholder:e.$t("veo.placeholder.videoId"),clearable:""},null,8,["modelValue","placeholder"])])}const po=k(io,[["render",uo],["__scopeId","data-v-6eba4026"]]),mo=b({name:"StartEndImage",components:{ElUpload:me,ElButton:U,InfoIcon:j,FontAwesomeIcon:P,ImagePreview:pe},mixins:[ue],emits:["change"],data(){return{fileList:[],uploadUrl:Q()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.veo?.config?.image_urls},set(){}}},mounted(){this.value||(this.value=void 0),this.onSetStartEndImageUrl()},methods:{onExceed(){I.warning(this.$t("veo.message.uploadReferencesExceed"))},onError(){I.error(this.$t("veo.message.uploadReferencesError"))},onSetStartEndImageUrl(){const e=this.urls;this.$store.commit("veo/setConfig",{...this.$store.state?.veo?.config,image_urls:e})},async onSuccess(){this.onSetStartEndImageUrl()}}}),vo={class:"relative"},fo={class:"flex justify-between"},_o={class:"flex justify-start items-center"},ho={class:"text-sm font-bold"};function $o(e,o,v,f,y,V){const c=n("info-icon"),u=n("image-preview"),s=n("font-awesome-icon"),w=n("el-button"),$=n("el-upload");return t(),i("div",vo,[r("div",fo,[r("div",_o,[r("span",ho,l(e.$t("veo.name.startEndImage")),1),a(c,{content:e.$t("veo.description.uploadStartEndImage")},null,8,["content"])])]),a($,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":o[0]||(o[0]=h=>e.fileList=h),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:2,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:p(({file:h})=>[h.url&&h.percentage!==void 0?(t(),m(u,{key:0,url:h.url,name:h.name,percentage:h.percentage,onRemove:S=>e.fileList.splice(e.fileList.indexOf(h),1)},null,8,["url","name","percentage","onRemove"])):d("",!0)]),default:p(()=>[a(w,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:p(()=>[a(s,{icon:"fa-solid fa-upload",class:"icon mr-1"}),_(" "+l(e.$t("veo.button.uploadReferences")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const go=k(mo,[["render",$o],["__scopeId","data-v-b8ddb8fb"]]),bo=b({name:"UpsampleActionSelector",components:{ElSelect:O,ElOption:A},computed:{options(){return ne.map(e=>({value:e,label:e}))},value:{get(){return this.$store.state.veo?.config?.upsample_action},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,upsample_action:e})}}},mounted(){this.value||(this.value=se)}}),ko={class:"field"},yo={class:"title font-bold"};function Vo(e,o,v,f,y,V){const c=n("el-option"),u=n("el-select");return t(),i("div",ko,[r("h2",yo,l(e.$t("veo.name.upsampleAction")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s),class:"value",placeholder:e.$t("veo.placeholder.select")},{default:p(()=>[(t(!0),i(E,null,T(e.options,s=>(t(),m(c,{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const wo=k(bo,[["render",Vo],["__scopeId","data-v-8b74a7ae"]]),Eo=b({name:"ExtendModelSelector",components:{ElSelect:O,ElOption:A},computed:{options(){return G.map(e=>({value:e,label:e}))},value:{get(){return this.$store.state.veo?.config?.model},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,model:e})}}},mounted(){(!this.value||!G.includes(this.value))&&(this.value=ae)}}),Io={class:"field"},To={class:"title font-bold"};function So(e,o,v,f,y,V){const c=n("el-option"),u=n("el-select");return t(),i("div",Io,[r("h2",To,l(e.$t("veo.name.model")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s),class:"value",placeholder:e.$t("veo.placeholder.select")},{default:p(()=>[(t(!0),i(E,null,T(e.options,s=>(t(),m(c,{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Co=k(Eo,[["render",So],["__scopeId","data-v-cc3f9355"]]),Ao=b({name:"MotionTypeSelector",components:{ElSelect:O,ElOption:A},computed:{options(){return ie.map(e=>({value:e,label:e}))},value:{get(){return this.$store.state.veo?.config?.motion_type},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,motion_type:e})}}},mounted(){this.value||(this.value=le)}}),Oo={class:"field"},Po={class:"title font-bold"};function Uo(e,o,v,f,y,V){const c=n("el-option"),u=n("el-select");return t(),i("div",Oo,[r("h2",Po,l(e.$t("veo.name.motionType")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s),class:"value",placeholder:e.$t("veo.placeholder.select"),filterable:""},{default:p(()=>[(t(!0),i(E,null,T(e.options,s=>(t(),m(c,{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Lo=k(Ao,[["render",Uo],["__scopeId","data-v-3affff3c"]]),jo=b({name:"ImageMaskInput",components:{ElInput:R},computed:{value:{get(){return this.$store.state.veo?.config?.image_mask},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,image_mask:e})}}}}),Ro={class:"field"},Mo={class:"title font-bold"};function Go(e,o,v,f,y,V){const c=n("el-input");return t(),i("div",Ro,[r("h2",Mo,l(e.$t("veo.name.imageMask")),1),a(c,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=u=>e.value=u),class:"value",type:"text",placeholder:e.$t("veo.placeholder.imageMask"),clearable:""},null,8,["modelValue","placeholder"])])}const Do=k(jo,[["render",Go],["__scopeId","data-v-6cc27c68"]]),No="",Fo=b({name:"PromptInput",components:{ElInput:R,InfoIcon:j},computed:{prompt:{get(){return this.$store.state.veo?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=No)}}),zo={class:"field"},Bo={class:"box"},qo={class:"title font-bold"};function Ho(e,o,v,f,y,V){const c=n("info-icon"),u=n("el-input");return t(),i("div",zo,[r("div",Bo,[r("h2",qo,l(e.$t("veo.name.prompt")),1),a(c,{content:e.$t("veo.description.prompt"),class:"info"},null,8,["content"])]),a(u,{modelValue:e.prompt,"onUpdate:modelValue":o[0]||(o[0]=s=>e.prompt=s),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("veo.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const Jo=k(Fo,[["render",Ho],["__scopeId","data-v-84c55ea0"]]),Xo=["upsample","extend","reshoot","object_insert","object_remove","get1080p"],Yo=["text2video","image2video","ingredients2video"],Qo=b({name:"ConfigPanel",components:{ElButton:U,Consumption:ve,FontAwesomeIcon:P,PromptInput:Jo,ModelSelector:Ue,StartEndImage:go,ActionSelector:De,VideoFromInput:lo,VideoIdInput:po,UpsampleActionSelector:wo,ExtendModelSelector:Co,MotionTypeSelector:Lo,ImageMaskInput:Do,TranslationSelector:Xe,AspectRatioSelector:eo},emits:["generate"],computed:{config(){return this.$store.state.veo?.config},consumption(){return fe(this.config,this.service?.cost)},service(){return this.$store.state.veo?.service},isPostProcessing(){return Xo.includes(this.config?.action??"")},isGeneration(){return Yo.includes(this.config?.action??"")}},methods:{onGenerate(){this.$emit("generate")}}}),Wo={class:"flex flex-col h-full"},Ko={class:"flex-1 overflow-y-auto p-5"},Zo={class:"flex flex-col items-center justify-center px-5 pb-5"};function xo(e,o,v,f,y,V){const c=n("action-selector"),u=n("video-from-input"),s=n("video-id-input"),w=n("upsample-action-selector"),$=n("extend-model-selector"),h=n("prompt-input"),S=n("motion-type-selector"),g=n("image-mask-input"),N=n("translation-selector"),F=n("aspect-ratio-selector"),z=n("model-selector"),B=n("start-end-image"),q=n("consumption"),H=n("font-awesome-icon"),J=n("el-button");return t(),i("div",Wo,[r("div",Ko,[a(c,{class:"mb-4"}),e.isPostProcessing?(t(),i(E,{key:0},[e.config?.video_url?(t(),m(u,{key:0,class:"mb-4"})):d("",!0),a(s,{class:"mb-4"})],64)):d("",!0),e.config?.action==="upsample"?(t(),m(w,{key:1,class:"mb-4"})):d("",!0),e.config?.action==="extend"?(t(),m($,{key:2,class:"mb-4"})):d("",!0),e.config?.action==="extend"?(t(),m(h,{key:3,class:"mb-4"})):d("",!0),e.config?.action==="reshoot"?(t(),m(S,{key:4,class:"mb-4"})):d("",!0),e.config?.action==="object_insert"?(t(),m(h,{key:5,class:"mb-4"})):d("",!0),e.config?.action==="object_insert"||e.config?.action==="object_remove"?(t(),m(g,{key:6,class:"mb-4"})):d("",!0),e.config?.action==="object_remove"?(t(),m(h,{key:7,class:"mb-4"})):d("",!0),e.isGeneration?(t(),i(E,{key:8},[a(N,{class:"mb-4"}),e.config?.action==="image2video"||e.config?.action==="ingredients2video"?(t(),m(F,{key:0,class:"mb-4"})):d("",!0),a(h,{class:"mb-4"}),e.config?.action!=="ingredients2video"?(t(),m(z,{key:1,class:"mb-4"})):d("",!0),e.config?.action==="image2video"||e.config?.action==="ingredients2video"?(t(),m(B,{key:2,class:"mb-2"})):d("",!0)],64)):d("",!0)]),r("div",Zo,[a(q,{value:e.consumption,service:e.service},null,8,["value","service"]),a(J,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:p(()=>[a(H,{icon:"fa-solid fa-magic",class:"mr-2"}),_(" "+l(e.$t("veo.button.generate")),1)]),_:1},8,["onClick"])])])}const et=k(Qo,[["render",xo]]),ot=b({name:"TaskPreview",components:{ElImage:be,CopyToClipboard:he,FontAwesomeIcon:P,ElAlert:ge,VideoPlayer:D,ElTooltip:$e,ElButton:U},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.veo?.application},config(){return this.$store.state.veo?.config}},methods:{onPickAction(e,o,v,f){console.debug("seed config from preview",{action:v,upsampleAction:f,response:o}),this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,action:v,video_id:o?.data?.[0]?.id,video_url:o?.data?.[0]?.video_url,...f?{upsample_action:f}:{}})},onDownload(e,o){e.stopPropagation(),console.log("on download"),window.open(o,"_blank")},onOpenVideo(e){window.open(e,"_blank")}}}),tt={class:"preview"},st={class:"left"},nt={class:"main"},at={class:"bot"},lt={class:"datetime"},it={class:"info"},rt={key:0,class:"prompt mt-2"},ct={key:0},dt={key:1},ut={key:0,class:C({content:!0,failed:!0})},pt={key:0,class:"mb-4"},mt={key:1,class:C({operations:!0,"mt-2":!0})},vt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ft={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},_t={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},ht={key:1,class:C({content:!0})},$t={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},gt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},bt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},kt={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},yt={key:2,class:C({content:!0})},Vt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},wt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Et(e,o,v,f,y,V){const c=n("el-image"),u=n("video-player"),s=n("el-button"),w=n("el-tooltip"),$=n("font-awesome-icon"),h=n("copy-to-clipboard"),S=n("el-alert");return t(),i("div",tt,[r("div",st,[a(c,{src:"https://cdn.acedata.cloud/8nxyy9.jpg",class:"avatar"})]),r("div",nt,[r("div",at,[_(l(e.$t("veo.name.veoBot"))+" ",1),r("span",lt,l(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),r("div",it,[e.modelValue?.request?.prompt?(t(),i("p",rt,[_(l(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?d("",!0):(t(),i("span",ct," - ("+l(e.$t("veo.status.pending"))+") ",1)),Array.isArray(e.modelValue?.response?.data)&&e.modelValue?.response?.data[0]?.state==="running"?(t(),i("span",dt," - ("+l(e.$t("veo.status.processing"))+") ",1)):d("",!0)])):d("",!0)]),e.modelValue?.response?.success===!0&&e.modelValue?.response?.data?(t(),i("div",ut,[e.modelValue?.response?.data[0]?.video_url?(t(),i("div",pt,[a(u,{src:e.modelValue?.response?.data[0]?.video_url},null,8,["src"])])):d("",!0),e.modelValue?.response.success?(t(),i("div",mt,[e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:0,type:"info",size:"small",class:"btn-action",onClick:o[0]||(o[0]=g=>e.onPickAction(g,e.modelValue?.response,"upsample","1080p"))},{default:p(()=>[_(l(e.$t("veo.button.actionUpsample1080p")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:1,type:"info",size:"small",class:"btn-action",onClick:o[1]||(o[1]=g=>e.onPickAction(g,e.modelValue?.response,"upsample","4k"))},{default:p(()=>[_(l(e.$t("veo.button.actionUpsample4k")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:2,type:"info",size:"small",class:"btn-action",onClick:o[2]||(o[2]=g=>e.onPickAction(g,e.modelValue?.response,"upsample","gif"))},{default:p(()=>[_(l(e.$t("veo.button.actionUpsampleGif")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:3,type:"info",size:"small",class:"btn-action",onClick:o[3]||(o[3]=g=>e.onPickAction(g,e.modelValue?.response,"extend"))},{default:p(()=>[_(l(e.$t("veo.button.actionExtend")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:4,type:"info",size:"small",class:"btn-action",onClick:o[4]||(o[4]=g=>e.onPickAction(g,e.modelValue?.response,"reshoot"))},{default:p(()=>[_(l(e.$t("veo.button.actionReshoot")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:5,type:"info",size:"small",class:"btn-action",onClick:o[5]||(o[5]=g=>e.onPickAction(g,e.modelValue?.response,"object_insert"))},{default:p(()=>[_(l(e.$t("veo.button.actionObjectInsert")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:6,type:"info",size:"small",class:"btn-action",onClick:o[6]||(o[6]=g=>e.onPickAction(g,e.modelValue?.response,"object_remove"))},{default:p(()=>[_(l(e.$t("veo.button.actionObjectRemove")),1)]),_:1})):d("",!0),a(w,{class:"box-item",effect:"dark",content:e.$t("veo.message.downloadVideo"),placement:"top-start"},{default:p(()=>[e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:0,type:"info",size:"small",class:"btn-action",onClick:o[7]||(o[7]=g=>e.onDownload(g,e.modelValue?.response?.data[0]?.video_url))},{default:p(()=>[_(l(e.$t("veo.button.download")),1)]),_:1})):d("",!0)]),_:1},8,["content"])])):d("",!0),a(S,{closable:!1,class:"mt-2 success"},{default:p(()=>[r("p",vt,[a($,{icon:"fa-solid fa-hashtag",class:"mr-1"}),_(" "+l(e.$t("veo.name.model"))+": "+l(e.modelValue?.request?.model),1)]),r("p",ft,[a($,{icon:"fa-solid fa-magic",class:"mr-1"}),_(" "+l(e.$t("veo.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),a(h,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(t(),i("p",_t,[a($,{icon:"fa-solid fa-clock",class:"mr-1"}),_(" "+l(e.$t("veo.name.elapsed"))+": "+l(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):d("",!0)]),_:1})])):d("",!0),e.modelValue?.response?.success===!1?(t(),i("div",ht,[a(S,{closable:!1,class:"failure"},{template:p(()=>[a($,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),_(" "+l(e.$t("veo.name.failure")),1)]),default:p(()=>[r("p",$t,[a($,{icon:"fa-solid fa-magic",class:"mr-1"}),_(" "+l(e.$t("veo.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),a(h,{content:e.modelValue?.id},null,8,["content"])]),r("p",gt,[a($,{icon:"fa-solid fa-circle-info",class:"mr-1"}),_(" "+l(e.$t("veo.name.failureReason"))+": "+l(e.modelValue?.response?.error?.message)+" ",1),a(h,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(t(),i("p",bt,[a($,{icon:"fa-solid fa-clock",class:"mr-1"}),_(" "+l(e.$t("veo.name.elapsed"))+": "+l(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):d("",!0),e.modelValue?.response?.trace_id?(t(),i("p",kt,[a($,{icon:"fa-solid fa-hashtag",class:"mr-1"}),_(" "+l(e.$t("veo.name.traceId"))+": "+l(e.modelValue?.response?.trace_id)+" ",1),a(h,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):d("",!0)]),_:1})])):d("",!0),e.modelValue?.response?.success===void 0?(t(),i("div",yt,[a(S,{closable:!1,class:"info"},{template:p(()=>[a($,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),_(" "+l(e.$t("veo.name.failure")),1)]),default:p(()=>[r("p",Vt,[a($,{icon:"fa-solid fa-magic",class:"mr-1"}),_(" "+l(e.$t("veo.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),a(h,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.response?.trace_id?(t(),i("p",wt,[a($,{icon:"fa-solid fa-hashtag",class:"mr-1"}),_(" "+l(e.$t("veo.name.traceId"))+": "+l(e.modelValue?.response?.trace_id)+" ",1),a(h,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):d("",!0)]),_:1})])):d("",!0)])])}const It=k(ot,[["render",Et],["__scopeId","data-v-83f2991f"]]),Tt=b({name:"RecentPanel",components:{TaskPreview:It,NoTasks:ye,BotPlaceholder:ke,ScrollList:re},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.veo?.tasks,items:this.$store.state.veo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),St={key:0},Ct={key:2,class:"w-full h-full flex items-center justify-center"};function At(e,o,v,f,y,V){const c=n("bot-placeholder"),u=n("task-preview"),s=n("scroll-list"),w=n("no-tasks");return t(),i(E,null,[e.tasks?.items===void 0?(t(),i("div",St,[a(c)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(t(),m(s,{key:1,ref:"scrollList",class:"tasks h-full w-full overflow-y-auto",loading:e.loading,onReachTop:o[0]||(o[0]=$=>e.$emit("reach-top"))},{default:p(()=>[(t(!0),i(E,null,T(e.tasks?.items,($,h)=>(t(),m(u,{key:h,"model-value":$},null,8,["model-value"]))),128))]),_:1},8,["loading"])):d("",!0),e.tasks?.items?.length===0?(t(),i("div",Ct,[a(w)])):d("",!0)],64)}const Ot=k(Tt,[["render",At]]),Pt=Z("veo"),Ut=b({name:"VeoIndex",components:{ConfigPanel:et,Layout:Se,RecentPanel:Ot},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.veo?.status?.getApplications===M.Request},tasksLoading(){return this.$store.state.veo?.status?.getTasks===M.Request||this.fetchingTasks},credential(){return this.$store.state.veo.credential},config(){return this.$store.state.veo.config},tasks(){return this.$store.state.veo.tasks}},watch:{tasks:{handler(e,o){e?.items?.length>o?.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 ce({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("veo/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("veo/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:o=5,createdAtMin:v,createdAtMax:f}=e||{};console.debug("limit",o,"createdAtMin",v,"createdAtMax",f),this.fetchingTasks=!0;try{await this.$store.dispatch("veo/getTasks",{limit:o,createdAtMin:v,createdAtMax:f})}finally{this.fetchingTasks=!1}},async onGenerate(){const e={...this.config,callback_url:Pt},o=this.credential?.token;if(!o){console.error("no token specified");return}if(e.action==="image2video"&&!(e.image_urls&&e.image_urls.length>0)){I.warning(this.$t("veo.message.imageRequired"));return}(!e.image_urls||e.image_urls.length===0)&&delete e.image_urls,I.info(this.$t("veo.message.startingTask")),W("veo",K.generate(e,{token:o})).then(()=>{I.success(this.$t("veo.message.startTaskSuccess"))}).catch(v=>{v?.response?.data?.error?.code===_e?I.error(this.$t("veo.message.usedUp")):I.error(this.$t("veo.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Lt(e,o,v,f,y,V){const c=n("config-panel"),u=n("recent-panel"),s=n("layout");return t(),m(s,null,{config:p(()=>[a(c,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:p(()=>[a(u,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Ts=k(Ut,[["render",Lt]]);export{Ts as default};
@@ -0,0 +1,4 @@
1
+ import{F as D}from"./index.es-r9pvLLwr.js";import{E as G}from"./index-_HYMyS6B.js";import{E as Ce}from"./index-CptSkKy6.js";import{d as A,H as u,E as s,z as se,C as o,y as i,D as l,q as n,F as a,O as M,N as z,J as c,x as y,Q as K,I as v,U as ne,G as B,K as H,M as P,u as j,c as N,w as Le,L as Re}from"./vendor-vue-NSDaktjZ.js";import{G as E,bm as le,bl as Me,et as re,eu as de,X as x,J as Ve,S as X,cs as Se,ev as ee,ew as Fe,cr as ze,n as De}from"./index-Cxzu3p6D.js";import{a as je}from"./errorCode-Cqj9Td_Z.js";import{s as R}from"./suno-CPV373Zg.js";import{b as Ge}from"./suno-DFuCGH70.js";import{E as Be}from"./index-Cfi1Y4Yt.js";import{E as ue,a as ce}from"./index-BoRxbdW2.js";import{I as F,S as Oe,l as Ne}from"./pagination-CZb0hbZ1.js";import{E as te,a as Q,b as He}from"./index-PZksrf5l.js";import{E as me,a as pe}from"./index-BmiT04Wy.js";import{E as We}from"./index-DTShxeQ8.js";import{E as w}from"./index-CBfqsHGh.js";import{E as W}from"./index-Bh_CWocK.js";import{E as fe}from"./index-CBQuA3gp.js";import{u as Z,F as qe,O as Ke,_ as _e,P as Je,a as Qe,V as Ye,E as Xe}from"./IconPark.vue_vue_type_script_setup_true_lang-DuxQ9KTF.js";import{E as oe}from"./index-C7RTFnM6.js";import{E as O}from"./index-DacX-iLC.js";import{E as he}from"./index-k2vqkrUd.js";import{E as Ze,a as xe}from"./index-Cbobj5pH.js";import{E as et,a as tt}from"./index-COYixNRd.js";import{E as Te}from"./index-DcYLY5pc.js";import{C as ot}from"./Consumption-D8YBErjq.js";import{a as st}from"./price-Gt41kpjf.js";import{E as nt}from"./index-B9TevwRm.js";import{E as it}from"./index-B4loSzbq.js";import{E as Ae,b as Ue,a as Pe}from"./index-DsXMatd8.js";import{E as Ee}from"./index-Dx5Bt7uM.js";import{N as at}from"./NoTasks-Biw7HgNs.js";import{a as lt,E as rt}from"./index-CsIY1sFD.js";import"./use-form-item-ByR72rLs.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./validator-B-vGzVTA.js";import"./index-Bmect7J5.js";import"./index-Bg7ZTTvi.js";import"./typescript-xdzIxq8N.js";import"./strings-beZM2Y-f.js";import"./isEqual-C-ffp0KB.js";import"./_Uint8Array-DFE3Z4no.js";import"./castArray-DADNwHSf.js";import"./debounce-Diil38Ii.js";import"./_baseIteratee-BXXZkHgC.js";import"./index-BAA4zDOa.js";import"./_baseClone-BxlA9WX_.js";import"./_initCloneObject-CciJTtIB.js";import"./isPlainObject-Di6klIrD.js";import"./index-BMuncW0x.js";import"./index-Cu41y2Fl.js";import"./index-CaoCMuT8.js";import"./dropdown-_acD3R8Y.js";const dt=A({name:"LayoutSuno",components:{ElDrawer:Ce,ElButton:G,FontAwesomeIcon:D},data(){return{drawer:!1,preview:!1}},computed:{}}),ut={class:"main flex flex-row flex-1"},ct={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},mt={class:"result h-full flex flex-col flex-1 min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"},pt={class:"preview h-full w-[300px] flex flex-col"};function ft(e,t,d,r,p,b){const g=l("font-awesome-icon"),m=l("el-button"),f=l("el-drawer");return n(),u("div",ut,[s("div",ct,[se(e.$slots,"config",{},void 0,!0)]),s("div",mt,[se(e.$slots,"result",{},void 0,!0)]),s("div",pt,[se(e.$slots,"preview",{},void 0,!0)]),o(m,{circle:"",class:"menu",onClick:t[0]||(t[0]=$=>e.drawer=!0)},{default:i(()=>[o(g,{icon:"fa-solid fa-magic"})]),_:1}),o(f,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=$=>e.drawer=$),direction:"ltr","with-header":!1,size:"340px",class:"drawer"},{default:i(()=>[se(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const ht=E(dt,[["render",ft],["__scopeId","data-v-c6c85757"]]),gt=A({name:"TypeSelector",components:{ElSelect:ce,ElOption:ue,ElSwitch:Be},data(){return{options:[{label:"v5.5",value:"chirp-v5-5",desc:this.$t("suno.model.v55desc")},{label:"v5",value:"chirp-v5",desc:this.$t("suno.model.v5desc")},{label:"v4.5+",value:"chirp-v4-5-plus",desc:this.$t("suno.model.v45plusdesc")},{label:"v4.5",value:"chirp-v4-5",desc:this.$t("suno.model.v45desc"),dividerAfter:!0},{label:"v4",value:"chirp-v4",desc:this.$t("suno.model.v4desc")},{label:"v3.5",value:"chirp-v3-5",desc:this.$t("suno.model.v35desc")},{label:"v3",value:"chirp-v3-0",desc:this.$t("suno.model.v3desc")}]}},computed:{custom:{get(){return this.$store.state.suno?.config?.custom||!1},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,custom:e})}},instrumental:{get(){return this.$store.state.suno?.config?.instrumental||!1},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,instrumental:e})}},model:{get(){return this.$store.state.suno?.config?.model},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:e})}}},mounted(){this.model||(this.model=Ge)}}),$t={class:"mb-3"},_t={class:"flex items-center mb-1"},vt={class:"text-sm font-bold"},yt={class:"model-option"},bt={class:"model-option-left"},kt={class:"model-option-name"},wt={class:"model-option-desc"},Ct={key:0,class:"flex items-center justify-between mb-3"},Vt={class:"text-sm font-bold"};function St(e,t,d,r,p,b){const g=l("el-option"),m=l("el-select"),f=l("el-switch");return n(),u("div",null,[s("div",$t,[s("div",_t,[s("span",vt,a(e.$t("suno.name.model")),1)]),o(m,{modelValue:e.model,"onUpdate:modelValue":t[0]||(t[0]=$=>e.model=$),class:"w-full model-select",size:"default",placeholder:e.$t("suno.placeholder.select")},{default:i(()=>[(n(!0),u(M,null,z(e.options,$=>(n(),y(g,{key:$.value,label:$.label,value:$.value,class:K({"model-option-divider":$.dividerAfter})},{default:i(()=>[s("div",yt,[s("div",bt,[s("span",kt,a($.label),1)]),s("span",wt,a($.desc),1)])]),_:2},1032,["label","value","class"]))),128))]),_:1},8,["modelValue","placeholder"])]),e.custom?(n(),u("div",Ct,[s("span",Vt,a(e.$t("suno.name.instrumental")),1),o(f,{modelValue:e.instrumental,"onUpdate:modelValue":t[1]||(t[1]=$=>e.instrumental=$)},null,8,["modelValue"])])):c("",!0)])}const Tt=E(gt,[["render",St],["__scopeId","data-v-16e4d6fc"]]),At=A({name:"UploadAudio",components:{ElUpload:We,ElButton:G,ElDialog:le,ElTabs:pe,ElTabPane:me,InfoIcon:F,FontAwesomeIcon:D,ElRadioGroup:Q,ElRadioButton:te},emits:["change"],data(){return{fileList:[],uploadUrl:Me()+"/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 p=r.data?.data.audio_id;this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,audio_id:p,action:"upload_extend"}),w.success(this.$t("suno.message.startUploadAudioSuccess"))}catch(r){w.error(r?.response?.data?.error?.message||this.$t("suno.message.startUploadAudioFailed"))}},async startRecording(){if(!navigator.mediaDevices?.getUserMedia||typeof MediaRecorder>"u"){w.error(this.$t("suno.message.recordingUnsupported"));return}try{this.mediaStream=await navigator.mediaDevices.getUserMedia({audio:!0}),this.recordedChunks=[],this.mediaRecorder=new MediaRecorder(this.mediaStream),this.mediaRecorder.ondataavailable=e=>{e.data&&e.data.size>0&&this.recordedChunks.push(e.data)},this.mediaRecorder.onstop=()=>{const e=new Blob(this.recordedChunks,{type:"audio/webm"});this.recordedBlob=e,this.recordedAudioUrl&&URL.revokeObjectURL(this.recordedAudioUrl),this.recordedAudioUrl=URL.createObjectURL(e),this.releaseStream()},this.mediaRecorder.start(),this.recording=!0,this.recordSeconds=0,this.recordTimer=window.setInterval(()=>{this.recordSeconds+=1,this.recordSeconds>=600&&this.stopRecording()},1e3)}catch(e){console.error("record error",e),w.error(this.$t("suno.message.recordingPermissionDenied"))}},stopRecording(){this.recordTimer&&(window.clearInterval(this.recordTimer),this.recordTimer=null),this.mediaRecorder&&this.mediaRecorder.state!=="inactive"&&this.mediaRecorder.stop(),this.recording=!1},resetRecording(){this.recordedAudioUrl&&URL.revokeObjectURL(this.recordedAudioUrl),this.recordedBlob=null,this.recordedAudioUrl=null,this.recordSeconds=0},async uploadRecording(){if(this.recordedBlob){this.uploadingRecord=!0;try{const e=new FormData,t=`recording-${Date.now()}.webm`;e.append("file",this.recordedBlob,t);const d=await fetch(this.uploadUrl,{method:"POST",headers:{Authorization:`Bearer ${this.$store.state.token.access}`},body:e});if(!d.ok)throw new Error(`upload failed: ${d.status}`);const r=await d.json(),p=r?.file_url||r?.data?.file_url;if(!p)throw new Error("no file_url in response");this.audioPreviewUrl=p,await this.onGenerateAudioId(p),this.dialogVisible=!1,this.resetRecording()}catch(e){console.error(e),w.error(e?.message||this.$t("suno.message.uploadReferencesError"))}finally{this.uploadingRecord=!1}}},releaseStream(){this.mediaStream&&(this.mediaStream.getTracks().forEach(e=>e.stop()),this.mediaStream=null)},cleanupRecording(){this.recordTimer&&(window.clearInterval(this.recordTimer),this.recordTimer=null),this.releaseStream(),this.recordedAudioUrl&&(URL.revokeObjectURL(this.recordedAudioUrl),this.recordedAudioUrl=null)}}}),Ut={class:"relative"},Pt={class:"flex justify-between items-center mb-2"},Et={class:"flex justify-start items-center"},It={class:"text-sm font-bold"},Lt={key:0,class:"mb-2"},Rt=["src"],Mt={key:1,class:"mt-2"},Ft={class:"py-4"},zt={class:"text-center py-6"},Dt={class:"text-sm"},jt={class:"text-xs text-gray-400 mt-1"},Gt={class:"py-4 text-center"},Bt={class:"recorder-display mb-4"},Ot={key:0,class:"text-red-500 flex items-center justify-center gap-2"},Nt={class:"text-2xl font-mono"},Ht={key:1,class:"text-green-600"},Wt={key:2,class:"text-gray-400 text-2xl font-mono"},qt={key:0,class:"mb-4"},Kt=["src"],Jt={class:"flex justify-center gap-3"};function Qt(e,t,d,r,p,b){const g=l("info-icon"),m=l("font-awesome-icon"),f=l("el-button"),$=l("el-radio-button"),k=l("el-radio-group"),T=l("el-upload"),_=l("el-tab-pane"),V=l("el-tabs"),C=l("el-dialog");return n(),u("div",Ut,[s("div",Pt,[s("div",Et,[s("span",It,a(e.$t("suno.name.referenceAudios")),1),o(g,{content:e.$t("suno.description.uploadAudios")},null,8,["content"])]),o(f,{round:"",type:"primary",size:"small",onClick:t[0]||(t[0]=I=>e.dialogVisible=!0)},{default:i(()=>[o(m,{icon:"fa-solid fa-plus",class:"icon mr-1"}),v(" "+a(e.$t("suno.button.addAudio")),1)]),_:1})]),e.audioPreviewUrl?(n(),u("div",Lt,[s("audio",{src:e.audioPreviewUrl,controls:"",class:"w-full"},null,8,Rt)])):c("",!0),e.hasUploadedAudio?(n(),u("div",Mt,[o(k,{modelValue:e.uploadAction,"onUpdate:modelValue":t[1]||(t[1]=I=>e.uploadAction=I),size:"small"},{default:i(()=>[o($,{value:"upload_extend"},{default:i(()=>[v(a(e.$t("suno.button.extend")),1)]),_:1}),o($,{value:"upload_cover"},{default:i(()=>[v(a(e.$t("suno.button.upload_cover")),1)]),_:1})]),_:1},8,["modelValue"])])):c("",!0),o(C,{modelValue:e.dialogVisible,"onUpdate:modelValue":t[4]||(t[4]=I=>e.dialogVisible=I),title:e.$t("suno.name.addAudio"),width:"520px","close-on-click-modal":!1,"append-to-body":""},{default:i(()=>[o(V,{modelValue:e.activeTab,"onUpdate:modelValue":t[3]||(t[3]=I=>e.activeTab=I),class:"add-audio-tabs"},{default:i(()=>[o(_,{name:"browse",label:e.$t("suno.tab.browse")},{default:i(()=>[s("div",Ft,[o(T,{"file-list":e.fileList,"onUpdate:fileList":t[2]||(t[2]=I=>e.fileList=I),name:"file",limit:1,class:"upload-wrapper",action:e.uploadUrl,accept:".mp3,.wav,.m4a,audio/*","show-file-list":!0,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onBrowseSuccess,headers:e.headers,drag:""},{default:i(()=>[s("div",zt,[o(m,{icon:"fa-solid fa-upload",class:"text-4xl text-gray-400 mb-3"}),s("div",Dt,a(e.$t("suno.description.dropAudioHere")),1),s("div",jt,a(e.$t("suno.description.audioFormats")),1)])]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])]),_:1},8,["label"]),o(_,{name:"record",label:e.$t("suno.tab.record")},{default:i(()=>[s("div",Gt,[s("div",Bt,[e.recording?(n(),u("div",Ot,[t[5]||(t[5]=s("span",{class:"recording-dot"},null,-1)),s("span",Nt,a(e.formattedTime),1)])):e.recordedBlob?(n(),u("div",Ht,[o(m,{icon:"fa-solid fa-check-circle",class:"text-2xl mr-2"}),s("span",null,a(e.$t("suno.message.recordingReady"))+" ("+a(e.formattedTime)+")",1)])):(n(),u("div",Wt,"00:00"))]),e.recordedAudioUrl&&!e.recording?(n(),u("div",qt,[s("audio",{src:e.recordedAudioUrl,controls:"",class:"w-full"},null,8,Kt)])):c("",!0),s("div",Jt,[!e.recording&&!e.recordedBlob?(n(),y(f,{key:0,type:"primary",round:"",onClick:e.startRecording},{default:i(()=>[o(m,{icon:"fa-solid fa-microphone",class:"mr-1"}),v(" "+a(e.$t("suno.button.startRecord")),1)]),_:1},8,["onClick"])):c("",!0),e.recording?(n(),y(f,{key:1,type:"danger",round:"",onClick:e.stopRecording},{default:i(()=>[o(m,{icon:"fa-solid fa-stop",class:"mr-1"}),v(" "+a(e.$t("suno.button.stopRecord")),1)]),_:1},8,["onClick"])):c("",!0),e.recordedBlob&&!e.recording?(n(),u(M,{key:2},[o(f,{round:"",onClick:e.resetRecording},{default:i(()=>[o(m,{icon:"fa-solid fa-rotate-left",class:"mr-1"}),v(" "+a(e.$t("suno.button.reRecord")),1)]),_:1},8,["onClick"]),o(f,{type:"primary",round:"",loading:e.uploadingRecord,onClick:e.uploadRecording},{default:i(()=>[o(m,{icon:"fa-solid fa-upload",class:"mr-1"}),v(" "+a(e.$t("suno.button.useRecording")),1)]),_:1},8,["loading","onClick"])],64)):c("",!0)])])]),_:1},8,["label"])]),_:1},8,["modelValue"])]),_:1},8,["modelValue","title"])])}const Yt=E(At,[["render",Qt],["__scopeId","data-v-bfb6b53d"]]),Xt="",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"}],Zt=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 xt=A({name:"PromptInput",components:{ElInput:W,FontAwesomeIcon:D,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,Zt)}},mounted(){this.prompt||(this.prompt=Xt)},methods:{onTagClick(e){this.prompt=e.prompt},onRefreshTags(){this.shuffledTags=ye(ve)}}}),eo={class:"field"},to={class:"flex items-center mb-1"},oo={class:"text-sm font-bold"},so={class:"inspo-tags"},no=["onClick"];function io(e,t,d,r,p,b){const g=l("info-icon"),m=l("el-input"),f=l("font-awesome-icon");return n(),u("div",eo,[s("div",to,[s("span",oo,a(e.$t("suno.name.songDescription")),1),o(g,{content:e.$t("suno.description.prompt")},null,8,["content"])]),o(m,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=$=>e.prompt=$),rows:4,type:"textarea",placeholder:e.$t("suno.placeholder.prompt")},null,8,["modelValue","placeholder"]),s("div",so,[(n(!0),u(M,null,z(e.visibleTags,$=>(n(),u("button",{key:$.key,class:"inspo-tag",onClick:k=>e.onTagClick($)},a($.label),9,no))),128)),s("button",{class:"inspo-tag inspo-tag-refresh",onClick:t[1]||(t[1]=(...$)=>e.onRefreshTags&&e.onRefreshTags(...$))},[o(f,{icon:"fa-solid fa-arrows-rotate"})])])])}const ao=E(xt,[["render",io],["__scopeId","data-v-378e4372"]]),lo="",ro=A({name:"LyricInput",components:{ElInput:W,ElButton:G,ElTooltip:fe,ElDialog:le,FontAwesomeIcon:D,InfoIcon:F},data(){return{generatingLyrics:!1,enhancingLyrics:!1,enhancePrompt:"",lyricHistory:[],expanded:!1}},computed:{lyric:{get(){return this.$store.state.suno?.config?.lyric},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,lyric:e})}},config(){return this.$store.state.suno?.config},credential(){return this.$store.state.suno?.credential}},mounted(){this.lyric||(this.lyric=lo)},methods:{pushHistory(){this.lyric&&(this.lyricHistory.push(this.lyric),this.lyricHistory.length>20&&this.lyricHistory.shift())},onUndo(){const e=this.lyricHistory.pop();e!==void 0&&(this.lyric=e)},onClear(){this.pushHistory(),this.lyric=""},async onEnhanceLyrics(){const e=this.credential?.token;if(!(!e||!this.lyric||!this.enhancePrompt)){this.pushHistory(),this.enhancingLyrics=!0,w.info(this.$t("suno.message.enhancingLyrics"));try{const t=`${this.enhancePrompt}
2
+
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}}}}),uo={class:"field"},co={class:"flex items-center justify-between mb-1"},mo={class:"flex items-center"},po={class:"text-sm font-bold"},fo={class:"flex items-center gap-1"},ho={class:"relative"},go={class:"text-xs text-right text-[var(--el-text-color-secondary)] mt-1"},$o={key:0,class:"enhance-bar"},_o={key:0,class:"enhance-bar mt-3"},vo={class:"flex items-center justify-between"},yo={class:"flex items-center gap-1"};function bo(e,t,d,r,p,b){const g=l("info-icon"),m=l("font-awesome-icon"),f=l("el-button"),$=l("el-tooltip"),k=l("el-input"),T=l("el-dialog");return n(),u("div",uo,[s("div",co,[s("div",mo,[s("span",po,a(e.$t("suno.name.lyrics")),1),o(g,{content:e.$t("suno.description.lyrics")},null,8,["content"])]),s("div",fo,[e.lyricHistory.length>0?(n(),y($,{key:0,content:e.$t("suno.button.undo"),placement:"top"},{default:i(()=>[o(f,{size:"small",circle:"",onClick:e.onUndo},{default:i(()=>[o(m,{icon:"fa-solid fa-rotate-left"})]),_:1},8,["onClick"])]),_:1},8,["content"])):c("",!0),e.lyric?(n(),y($,{key:1,content:e.$t("suno.button.clear_lyrics"),placement:"top"},{default:i(()=>[o(f,{size:"small",circle:"",onClick:e.onClear},{default:i(()=>[o(m,{icon:"fa-solid fa-eraser"})]),_:1},8,["onClick"])]),_:1},8,["content"])):c("",!0),o($,{content:e.$t("suno.button.expand_lyrics"),placement:"top"},{default:i(()=>[o(f,{size:"small",circle:"",onClick:t[0]||(t[0]=_=>e.expanded=!0)},{default:i(()=>[o(m,{icon:"fa-solid fa-expand"})]),_:1})]),_:1},8,["content"]),e.config?.action!=="extend"?(n(),y(f,{key:2,size:"small",loading:e.generatingLyrics,round:"",onClick:e.onGenerateLyrics},{default:i(()=>[e.generatingLyrics?c("",!0):(n(),y(m,{key:0,icon:"fa-solid fa-wand-magic-sparkles",class:"mr-1"})),v(" "+a(e.$t("suno.button.generate_lyrics")),1)]),_:1},8,["loading","onClick"])):c("",!0)])]),s("div",ho,[e.config?.action!=="extend"?(n(),y(k,{key:0,modelValue:e.lyric,"onUpdate:modelValue":t[1]||(t[1]=_=>e.lyric=_),rows:5,type:"textarea",class:"lyrics",placeholder:e.$t("suno.placeholder.lyrics")},null,8,["modelValue","placeholder"])):(n(),y(k,{key:1,modelValue:e.lyric,"onUpdate:modelValue":t[2]||(t[2]=_=>e.lyric=_),rows:5,type:"textarea",class:"lyrics",placeholder:e.$t("suno.placeholder.extend.lyrics")},null,8,["modelValue","placeholder"])),s("div",go,a(e.lyric?.length||0)+"/5000",1)]),e.lyric&&e.config?.action!=="extend"?(n(),u("div",$o,[o(k,{modelValue:e.enhancePrompt,"onUpdate:modelValue":t[3]||(t[3]=_=>e.enhancePrompt=_),size:"small",placeholder:e.$t("suno.placeholder.enhanceLyrics"),class:"enhance-input",onKeyup:ne(e.onEnhanceLyrics,["enter"])},{append:i(()=>[o(f,{loading:e.enhancingLyrics,onClick:e.onEnhanceLyrics},{default:i(()=>[e.enhancingLyrics?c("",!0):(n(),y(m,{key:0,icon:"fa-solid fa-wand-magic-sparkles",class:"mr-1"})),v(" "+a(e.$t("suno.button.enhance_lyrics")),1)]),_:1},8,["loading","onClick"])]),_:1},8,["modelValue","placeholder","onKeyup"])])):c("",!0),o(T,{modelValue:e.expanded,"onUpdate:modelValue":t[7]||(t[7]=_=>e.expanded=_),title:e.$t("suno.name.lyrics"),width:"720px",top:"5vh","close-on-click-modal":!1,class:"lyrics-expand-dialog"},{footer:i(()=>[s("div",vo,[s("div",yo,[e.lyricHistory.length>0?(n(),y(f,{key:0,size:"small",onClick:e.onUndo},{default:i(()=>[o(m,{icon:"fa-solid fa-rotate-left",class:"mr-1"}),v(" "+a(e.$t("suno.button.undo")),1)]),_:1},8,["onClick"])):c("",!0),e.lyric?(n(),y(f,{key:1,size:"small",onClick:e.onClear},{default:i(()=>[o(m,{icon:"fa-solid fa-eraser",class:"mr-1"}),v(" "+a(e.$t("suno.button.clear_lyrics")),1)]),_:1},8,["onClick"])):c("",!0),e.config?.action!=="extend"?(n(),y(f,{key:2,size:"small",loading:e.generatingLyrics,onClick:e.onGenerateLyrics},{default:i(()=>[e.generatingLyrics?c("",!0):(n(),y(m,{key:0,icon:"fa-solid fa-wand-magic-sparkles",class:"mr-1"})),v(" "+a(e.$t("suno.button.generate_lyrics")),1)]),_:1},8,["loading","onClick"])):c("",!0)]),o(f,{type:"primary",onClick:t[6]||(t[6]=_=>e.expanded=!1)},{default:i(()=>[v(a(e.$t("common.button.confirm")),1)]),_:1})])]),default:i(()=>[o(k,{modelValue:e.lyric,"onUpdate:modelValue":t[4]||(t[4]=_=>e.lyric=_),type:"textarea",rows:20,class:"lyrics-expanded",placeholder:e.$t("suno.placeholder.lyrics"),autofocus:""},null,8,["modelValue","placeholder"]),e.config?.action!=="extend"?(n(),u("div",_o,[o(k,{modelValue:e.enhancePrompt,"onUpdate:modelValue":t[5]||(t[5]=_=>e.enhancePrompt=_),size:"small",placeholder:e.$t("suno.placeholder.enhanceLyrics"),class:"enhance-input",onKeyup:ne(e.onEnhanceLyrics,["enter"])},{append:i(()=>[o(f,{loading:e.enhancingLyrics,onClick:e.onEnhanceLyrics},{default:i(()=>[e.enhancingLyrics?c("",!0):(n(),y(m,{key:0,icon:"fa-solid fa-wand-magic-sparkles",class:"mr-1"})),v(" "+a(e.$t("suno.button.enhance_lyrics")),1)]),_:1},8,["loading","onClick"])]),_:1},8,["modelValue","placeholder","onKeyup"])])):c("",!0)]),_:1},8,["modelValue","title"])])}const ko=E(ro,[["render",bo],["__scopeId","data-v-7182be81"]]),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"],wo=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 Co=A({name:"StyleInput",components:{ElInput:W,ElButton:G,FontAwesomeIcon:D,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,wo)}},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}}}}}),Vo={class:"field"},So={class:"flex items-center justify-between mb-1"},To={class:"flex items-center"},Ao={class:"text-sm font-bold"},Uo={class:"relative"},Po={class:"text-xs text-right text-[var(--el-text-color-secondary)] mt-1"},Eo={class:"style-tags"},Io=["onClick"];function Lo(e,t,d,r,p,b){const g=l("info-icon"),m=l("font-awesome-icon"),f=l("el-button"),$=l("el-input");return n(),u("div",Vo,[s("div",So,[s("div",To,[s("span",Ao,a(e.$t("suno.name.style")),1),o(g,{content:e.$t("suno.description.style")},null,8,["content"])]),o(f,{size:"small",loading:e.optimizing,round:"",onClick:e.onOptimizeStyle},{default:i(()=>[e.optimizing?c("",!0):(n(),y(m,{key:0,icon:"fa-solid fa-wand-magic-sparkles",class:"mr-1"})),v(" "+a(e.$t("suno.button.optimize_style")),1)]),_:1},8,["loading","onClick"])]),s("div",Uo,[o($,{modelValue:e.style,"onUpdate:modelValue":t[0]||(t[0]=k=>e.style=k),rows:2,type:"textarea",placeholder:e.$t("suno.placeholder.style")},null,8,["modelValue","placeholder"]),s("div",Po,a(e.style?.length||0)+"/1000",1)]),s("div",Eo,[(n(!0),u(M,null,z(e.visibleTags,k=>(n(),u("button",{key:k,class:"style-tag",onClick:T=>e.onTagClick(k)},a(k),9,Io))),128)),s("button",{class:"style-tag style-tag-refresh",onClick:t[1]||(t[1]=(...k)=>e.onRefreshTags&&e.onRefreshTags(...k))},[o(m,{icon:"fa-solid fa-arrows-rotate"})])])])}const Ro=E(Co,[["render",Lo],["__scopeId","data-v-ddebb076"]]),Mo=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})}}}}),Fo={class:"field"},zo={class:"flex items-center mb-1"},Do={class:"text-sm font-bold"};function jo(e,t,d,r,p,b){const g=l("info-icon"),m=l("el-input");return n(),u("div",Fo,[s("div",zo,[s("span",Do,a(e.$t("suno.name.title")),1),o(g,{content:e.$t("suno.description.title")},null,8,["content"])]),o(m,{modelValue:e.title,"onUpdate:modelValue":t[0]||(t[0]=f=>e.title=f),placeholder:e.$t("suno.placeholder.title")},null,8,["modelValue","placeholder"])])}const Go=E(Mo,[["render",jo]]),Bo=A({name:"ExtendFromInput",components:{ElImage:O,ElIcon:x,ElInputNumber:oe,VideoPlay:de,VideoPause:re},data(){return{}},computed:{audio(){return this.$store.state.suno?.config?.audio},value:{get(){return this.$store.state.suno?.config?.continue_at},set(e){console.debug("set continue_at",e),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,continue_at:e?parseInt(e):void 0})}}},mounted(){this.value||(this.value=void 0)},methods:{handleChange(e){if(e===void 0){this.value=void 0;return}e<0?this.value=0:e>this.audio?.duration?this.value=this.audio?.duration:this.value=e},useFormatDuring:Z,onPlay(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){this.$store.state?.suno?.audio?.id!==e.id&&this.onPlay({...e,progress:0})}}}),Oo={class:"field"},No={class:"box"},Ho={class:"title font-bold"},Wo={class:"input-wrapper"},qo={class:"task"},Ko={class:"left"},Jo={key:2,class:"duration"},Qo={class:"info"},Yo={class:"title"},Xo={class:"style"};function Zo(e,t,d,r,p,b){const g=l("el-input-number"),m=l("el-image"),f=l("video-pause"),$=l("el-icon"),k=l("video-play"),T=H("loading");return n(),u("div",Oo,[s("div",No,[s("h2",Ho,a(e.$t("suno.name.extend")),1),s("div",Wo,[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",qo,[e.audio?(n(),u("div",{key:0,class:"audio",onClick:t[3]||(t[3]=_=>e.onClick(e.audio))},[B((n(),u("div",Ko,[o(m,{src:e.audio?.image_url,class:"cover",fit:"cover"},null,8,["src"]),e.audio?.audio_url&&e.$store.state?.suno?.audio?.id===e.audio.id&&e.$store.state?.suno?.audio?.state==="playing"?(n(),u("div",{key:0,class:"overlay",onClick:t[1]||(t[1]=_=>e.onPause(e.audio))},[o($,null,{default:i(()=>[o(f)]),_:1})])):c("",!0),e.audio?.audio_url&&(e.$store.state?.suno?.audio?.id!==e.audio.id||e.$store.state?.suno?.audio?.id===e.audio.id&&e.$store.state?.suno?.audio?.state==="paused")?(n(),u("div",{key:1,class:"overlay",onClick:t[2]||(t[2]=_=>e.onPlay(e.audio))},[o($,null,{default:i(()=>[o(k)]),_:1})])):c("",!0),e.audio?.duration?(n(),u("div",Jo,a(e.useFormatDuring(e.audio?.duration)),1)):c("",!0)])),[[T,!e.audio?.audio_url]]),s("div",Qo,[s("h2",Yo,a(e.audio?.title),1),s("p",Xo,a(e.audio?.style),1)])])):c("",!0)])])}const xo=E(Bo,[["render",Zo],["__scopeId","data-v-bcce4821"]]),es=A({name:"CoverFromInput",components:{ElImage:O,ElIcon:x,VideoPlay:de,VideoPause:re},data(){return{}},computed:{audio(){return this.$store.state.suno?.config?.audio},value:{get(){return this.$store.state.suno?.config?.continue_at},set(e){console.debug("set continue_at",e),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,continue_at:e?parseInt(e):void 0})}}},mounted(){this.value||(this.value=void 0)},methods:{handleChange(e){e<0?this.value=0:e>this.audio?.duration?this.value=this.audio?.duration:this.value=e},useFormatDuring:Z,onPlay(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){this.$store.state?.suno?.audio?.id!==e.id&&this.onPlay({...e,progress:0})}}}),ts={class:"field"},os={class:"box"},ss={class:"title font-bold"},ns={class:"task"},is={class:"left"},as={key:2,class:"duration"},ls={class:"info"},rs={class:"title"},ds={class:"style"};function us(e,t,d,r,p,b){const g=l("el-image"),m=l("video-pause"),f=l("el-icon"),$=l("video-play"),k=H("loading");return n(),u("div",ts,[s("div",os,[s("h2",ss,a(e.$t("suno.name.cover")),1)]),s("div",ns,[e.audio?(n(),u("div",{key:0,class:"audio",onClick:t[2]||(t[2]=T=>e.onClick(e.audio))},[B((n(),u("div",is,[o(g,{src:e.audio?.image_url,class:"cover",fit:"cover"},null,8,["src"]),e.audio?.audio_url&&e.$store.state?.suno?.audio?.id===e.audio.id&&e.$store.state?.suno?.audio?.state==="playing"?(n(),u("div",{key:0,class:"overlay",onClick:t[0]||(t[0]=T=>e.onPause(e.audio))},[o(f,null,{default:i(()=>[o(m)]),_:1})])):c("",!0),e.audio?.audio_url&&(e.$store.state?.suno?.audio?.id!==e.audio.id||e.$store.state?.suno?.audio?.id===e.audio.id&&e.$store.state?.suno?.audio?.state==="paused")?(n(),u("div",{key:1,class:"overlay",onClick:t[1]||(t[1]=T=>e.onPlay(e.audio))},[o(f,null,{default:i(()=>[o($)]),_:1})])):c("",!0),e.audio?.duration?(n(),u("div",as,a(e.useFormatDuring(e.audio?.duration)),1)):c("",!0)])),[[k,!e.audio?.audio_url]]),s("div",ls,[s("h2",rs,a(e.audio?.title),1),s("p",ds,a(e.audio?.style),1)])])):c("",!0)])])}const cs=E(es,[["render",us],["__scopeId","data-v-06640216"]]),ms=A({name:"VocalGenderSelector",components:{ElRadioGroup:Q,ElRadioButton:te,InfoIcon:F},computed:{vocalGender:{get(){return this.$store.state.suno?.config?.vocal_gender||""},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,vocal_gender:e||void 0})}}}}),ps={class:"flex items-center mb-1"},fs={class:"text-sm font-bold"};function hs(e,t,d,r,p,b){const g=l("info-icon"),m=l("el-radio-button"),f=l("el-radio-group");return n(),u("div",null,[s("div",ps,[s("span",fs,a(e.$t("suno.name.vocalGender")),1),o(g,{content:e.$t("suno.description.vocalGender")},null,8,["content"])]),o(f,{modelValue:e.vocalGender,"onUpdate:modelValue":t[0]||(t[0]=$=>e.vocalGender=$),size:"small"},{default:i(()=>[o(m,{value:""},{default:i(()=>[v(a(e.$t("suno.gender.auto")),1)]),_:1}),o(m,{value:"f"},{default:i(()=>[v(a(e.$t("suno.gender.female")),1)]),_:1}),o(m,{value:"m"},{default:i(()=>[v(a(e.$t("suno.gender.male")),1)]),_:1})]),_:1},8,["modelValue"])])}const gs=E(ms,[["render",hs]]),$s=A({name:"AdvancedParams",components:{ElCollapse:xe,ElCollapseItem:Ze,ElInput:W,ElSlider:he,ElRadioGroup:Q,ElRadioButton:te},data(){return{activeNames:[]}},computed:{config(){return this.$store.state.suno?.config},isV5OrAbove(){const e=this.config?.model||"";return["chirp-v5","chirp-v5-5"].includes(e)},styleNegative:{get(){return this.$store.state.suno?.config?.style_negative||""},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,style_negative:e||void 0})}},lyricPrompt:{get(){return this.$store.state.suno?.config?.lyric_prompt||""},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,lyric_prompt:e||void 0})}},weirdness:{get(){return this.$store.state.suno?.config?.weirdness??0},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,weirdness:e||void 0})}},styleInfluence:{get(){return this.$store.state.suno?.config?.style_influence??50},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,style_influence:e})}},variationCategory:{get(){return this.$store.state.suno?.config?.variation_category||""},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,variation_category:e||void 0})}},audioWeight:{get(){return this.$store.state.suno?.config?.audio_weight??50},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,audio_weight:e})}},lyricsMode:{get(){return this.$store.state.suno?.config?.lyrics_mode||"manual"},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,lyrics_mode:e})}}}}),_s={key:0,class:"mb-3"},vs={class:"flex items-center mb-1"},ys={class:"text-xs font-bold"},bs={key:1,class:"mb-3"},ks={class:"flex items-center mb-1"},ws={class:"text-xs font-bold"},Cs={key:2,class:"mb-3"},Vs={class:"flex items-center justify-between mb-1"},Ss={class:"text-xs font-bold"},Ts={class:"text-xs text-[var(--el-text-color-secondary)]"},As={key:3,class:"mb-3"},Us={class:"flex items-center justify-between mb-1"},Ps={class:"text-xs font-bold"},Es={class:"text-xs text-[var(--el-text-color-secondary)]"},Is={key:4,class:"mb-3"},Ls={class:"flex items-center mb-1"},Rs={class:"text-xs font-bold"},Ms={key:5,class:"mb-3"},Fs={class:"flex items-center justify-between mb-1"},zs={class:"text-xs font-bold"},Ds={class:"text-xs text-[var(--el-text-color-secondary)]"},js={key:6,class:"mb-3"},Gs={class:"flex items-center mb-1"},Bs={class:"text-xs font-bold"};function Os(e,t,d,r,p,b){const g=l("el-input"),m=l("el-slider"),f=l("el-radio-button"),$=l("el-radio-group"),k=l("el-collapse-item"),T=l("el-collapse");return n(),y(T,{modelValue:e.activeNames,"onUpdate:modelValue":t[7]||(t[7]=_=>e.activeNames=_),class:"advanced-collapse"},{default:i(()=>[o(k,{title:e.$t("suno.name.advancedParams"),name:"advanced"},{default:i(()=>[e.config?.custom?(n(),u("div",_s,[s("div",vs,[s("span",ys,a(e.$t("suno.name.styleNegative")),1)]),o(g,{modelValue:e.styleNegative,"onUpdate:modelValue":t[0]||(t[0]=_=>e.styleNegative=_),size:"small",placeholder:e.$t("suno.placeholder.styleNegative")},null,8,["modelValue","placeholder"])])):c("",!0),e.config?.custom&&!e.config?.instrumental?(n(),u("div",bs,[s("div",ks,[s("span",ws,a(e.$t("suno.name.lyricPrompt")),1)]),o(g,{modelValue:e.lyricPrompt,"onUpdate:modelValue":t[1]||(t[1]=_=>e.lyricPrompt=_),size:"small",placeholder:e.$t("suno.placeholder.lyricPrompt")},null,8,["modelValue","placeholder"])])):c("",!0),e.config?.custom?(n(),u("div",Cs,[s("div",Vs,[s("span",Ss,a(e.$t("suno.name.weirdness")),1),s("span",Ts,a(e.weirdness??0),1)]),o(m,{modelValue:e.weirdness,"onUpdate:modelValue":t[2]||(t[2]=_=>e.weirdness=_),min:0,max:100,step:1},null,8,["modelValue"])])):c("",!0),e.config?.custom?(n(),u("div",As,[s("div",Us,[s("span",Ps,a(e.$t("suno.name.styleInfluence")),1),s("span",Es,a(e.styleInfluence??50),1)]),o(m,{modelValue:e.styleInfluence,"onUpdate:modelValue":t[3]||(t[3]=_=>e.styleInfluence=_),min:0,max:100,step:1},null,8,["modelValue"])])):c("",!0),e.isV5OrAbove?(n(),u("div",Is,[s("div",Ls,[s("span",Rs,a(e.$t("suno.name.variationCategory")),1)]),o($,{modelValue:e.variationCategory,"onUpdate:modelValue":t[4]||(t[4]=_=>e.variationCategory=_),size:"small"},{default:i(()=>[o(f,{value:""},{default:i(()=>[v(a(e.$t("suno.gender.auto")),1)]),_:1}),o(f,{value:"high"},{default:i(()=>[v(a(e.$t("suno.variation.high")),1)]),_:1}),o(f,{value:"low"},{default:i(()=>[v(a(e.$t("suno.variation.low")),1)]),_:1})]),_:1},8,["modelValue"])])):c("",!0),e.config?.action==="cover"?(n(),u("div",Ms,[s("div",Fs,[s("span",zs,a(e.$t("suno.name.audioWeight")),1),s("span",Ds,a(e.audioWeight??50),1)]),o(m,{modelValue:e.audioWeight,"onUpdate:modelValue":t[5]||(t[5]=_=>e.audioWeight=_),min:0,max:100,step:1},null,8,["modelValue"])])):c("",!0),e.config?.custom&&!e.config?.instrumental?(n(),u("div",js,[s("div",Gs,[s("span",Bs,a(e.$t("suno.name.lyricsMode")),1)]),o($,{modelValue:e.lyricsMode,"onUpdate:modelValue":t[6]||(t[6]=_=>e.lyricsMode=_),size:"small"},{default:i(()=>[o(f,{value:"manual"},{default:i(()=>[v(a(e.$t("suno.lyricsMode.manual")),1)]),_:1}),o(f,{value:"auto"},{default:i(()=>[v(a(e.$t("suno.lyricsMode.auto")),1)]),_:1})]),_:1},8,["modelValue"])])):c("",!0)]),_:1},8,["title"])]),_:1},8,["modelValue"])}const Ns=E($s,[["render",Os],["__scopeId","data-v-1e19b619"]]),Hs=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"})}}}),Ws={class:"field"},qs={class:"flex items-center mb-2"},Ks={class:"text-sm font-bold m-0"},Js={key:0,class:"task mb-2"},Qs={class:"left relative w-[50px] h-[50px] mr-3 flex-shrink-0"},Ys={class:"info flex-1 min-w-0"},Xs={class:"text-sm font-bold m-0 truncate"},Zs={class:"text-xs text-[var(--el-text-color-secondary)] m-0 truncate"},xs={class:"flex gap-2"};function en(e,t,d,r,p,b){const g=l("info-icon"),m=l("el-image"),f=l("el-input-number"),$=H("loading");return n(),u("div",Ws,[s("div",qs,[s("h2",Ks,a(e.$t("suno.name.replaceSection")),1),o(g,{content:e.$t("suno.description.replaceSection")},null,8,["content"])]),e.audio?(n(),u("div",Js,[s("div",{class:"audio flex items-center",onClick:t[0]||(t[0]=k=>e.onClick(e.audio))},[B((n(),u("div",Qs,[o(m,{src:e.audio?.image_url,class:"w-full h-full rounded",fit:"cover"},null,8,["src"])])),[[$,!e.audio?.audio_url]]),s("div",Ys,[s("h2",Xs,a(e.audio?.title),1),s("p",Zs,a(e.audio?.style),1)])])])):c("",!0),s("div",xs,[o(f,{modelValue:e.replaceSectionStart,"onUpdate:modelValue":t[1]||(t[1]=k=>e.replaceSectionStart=k),class:"flex-1",min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.replaceSectionStart")},null,8,["modelValue","max","placeholder"]),o(f,{modelValue:e.replaceSectionEnd,"onUpdate:modelValue":t[2]||(t[2]=k=>e.replaceSectionEnd=k),class:"flex-1",min:e.replaceSectionStart||0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.replaceSectionEnd")},null,8,["modelValue","min","max","placeholder"])])])}const tn=E(Hs,[["render",en]]),on=A({name:"OverpaintingInput",components:{ElInputNumber:oe,ElImage:O,InfoIcon:F},computed:{audio(){return this.$store.state.suno?.config?.audio},overpaintingStart:{get(){return this.$store.state.suno?.config?.overpainting_start},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,overpainting_start:e})}},overpaintingEnd:{get(){return this.$store.state.suno?.config?.overpainting_end},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,overpainting_end:e})}}},methods:{onClick(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"})}}}),sn={class:"field"},nn={class:"flex items-center mb-2"},an={class:"text-sm font-bold m-0"},ln={key:0,class:"task mb-2"},rn={class:"left relative w-[50px] h-[50px] mr-3 flex-shrink-0"},dn={class:"info flex-1 min-w-0"},un={class:"text-sm font-bold m-0 truncate"},cn={class:"text-xs text-[var(--el-text-color-secondary)] m-0 truncate"},mn={class:"flex gap-2"};function pn(e,t,d,r,p,b){const g=l("info-icon"),m=l("el-image"),f=l("el-input-number"),$=H("loading");return n(),u("div",sn,[s("div",nn,[s("h2",an,a(e.$t("suno.name.overpaintingRange")),1),o(g,{content:e.$t("suno.description.overpainting")},null,8,["content"])]),e.audio?(n(),u("div",ln,[s("div",{class:"audio flex items-center",onClick:t[0]||(t[0]=k=>e.onClick(e.audio))},[B((n(),u("div",rn,[o(m,{src:e.audio?.image_url,class:"w-full h-full rounded",fit:"cover"},null,8,["src"])])),[[$,!e.audio?.audio_url]]),s("div",dn,[s("h2",un,a(e.audio?.title),1),s("p",cn,a(e.audio?.style),1)])])])):c("",!0),s("div",mn,[o(f,{modelValue:e.overpaintingStart,"onUpdate:modelValue":t[1]||(t[1]=k=>e.overpaintingStart=k),class:"flex-1",size:"small",min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.overpaintingStart")},null,8,["modelValue","max","placeholder"]),o(f,{modelValue:e.overpaintingEnd,"onUpdate:modelValue":t[2]||(t[2]=k=>e.overpaintingEnd=k),class:"flex-1",size:"small",min:e.overpaintingStart||0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.overpaintingEnd")},null,8,["modelValue","min","max","placeholder"])])])}const fn=E(on,[["render",pn]]),hn=A({name:"UnderpaintingInput",components:{ElInputNumber:oe,ElImage:O,InfoIcon:F},computed:{audio(){return this.$store.state.suno?.config?.audio},underpaintingStart:{get(){return this.$store.state.suno?.config?.underpainting_start},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,underpainting_start:e})}},underpaintingEnd:{get(){return this.$store.state.suno?.config?.underpainting_end},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,underpainting_end:e})}}},methods:{onClick(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"})}}}),gn={class:"field"},$n={class:"flex items-center mb-2"},_n={class:"text-sm font-bold m-0"},vn={key:0,class:"task mb-2"},yn={class:"left relative w-[50px] h-[50px] mr-3 flex-shrink-0"},bn={class:"info flex-1 min-w-0"},kn={class:"text-sm font-bold m-0 truncate"},wn={class:"text-xs text-[var(--el-text-color-secondary)] m-0 truncate"},Cn={class:"flex gap-2"};function Vn(e,t,d,r,p,b){const g=l("info-icon"),m=l("el-image"),f=l("el-input-number"),$=H("loading");return n(),u("div",gn,[s("div",$n,[s("h2",_n,a(e.$t("suno.name.underpaintingRange")),1),o(g,{content:e.$t("suno.description.underpainting")},null,8,["content"])]),e.audio?(n(),u("div",vn,[s("div",{class:"audio flex items-center",onClick:t[0]||(t[0]=k=>e.onClick(e.audio))},[B((n(),u("div",yn,[o(m,{src:e.audio?.image_url,class:"w-full h-full rounded",fit:"cover"},null,8,["src"])])),[[$,!e.audio?.audio_url]]),s("div",bn,[s("h2",kn,a(e.audio?.title),1),s("p",wn,a(e.audio?.style),1)])])])):c("",!0),s("div",Cn,[o(f,{modelValue:e.underpaintingStart,"onUpdate:modelValue":t[1]||(t[1]=k=>e.underpaintingStart=k),class:"flex-1",size:"small",min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.underpaintingStart")},null,8,["modelValue","max","placeholder"]),o(f,{modelValue:e.underpaintingEnd,"onUpdate:modelValue":t[2]||(t[2]=k=>e.underpaintingEnd=k),class:"flex-1",size:"small",min:e.underpaintingStart||0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.underpaintingEnd")},null,8,["modelValue","min","max","placeholder"])])])}const Sn=E(hn,[["render",Vn]]),Tn=A({name:"SamplesInput",components:{ElInputNumber:oe,ElImage:O,InfoIcon:F},computed:{audio(){return this.$store.state.suno?.config?.audio},samplesStart:{get(){return this.$store.state.suno?.config?.samples_start},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,samples_start:e})}},samplesEnd:{get(){return this.$store.state.suno?.config?.samples_end},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,samples_end:e})}}},methods:{onClick(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"})}}}),An={class:"field"},Un={class:"flex items-center mb-2"},Pn={class:"text-sm font-bold m-0"},En={key:0,class:"task mb-2"},In={class:"left relative w-[50px] h-[50px] mr-3 flex-shrink-0"},Ln={class:"info flex-1 min-w-0"},Rn={class:"text-sm font-bold m-0 truncate"},Mn={class:"text-xs text-[var(--el-text-color-secondary)] m-0 truncate"},Fn={class:"flex gap-2"};function zn(e,t,d,r,p,b){const g=l("info-icon"),m=l("el-image"),f=l("el-input-number"),$=H("loading");return n(),u("div",An,[s("div",Un,[s("h2",Pn,a(e.$t("suno.name.samplesRange")),1),o(g,{content:e.$t("suno.description.samples")},null,8,["content"])]),e.audio?(n(),u("div",En,[s("div",{class:"audio flex items-center",onClick:t[0]||(t[0]=k=>e.onClick(e.audio))},[B((n(),u("div",In,[o(m,{src:e.audio?.image_url,class:"w-full h-full rounded",fit:"cover"},null,8,["src"])])),[[$,!e.audio?.audio_url]]),s("div",Ln,[s("h2",Rn,a(e.audio?.title),1),s("p",Mn,a(e.audio?.style),1)])])])):c("",!0),s("div",Fn,[o(f,{modelValue:e.samplesStart,"onUpdate:modelValue":t[1]||(t[1]=k=>e.samplesStart=k),class:"flex-1",size:"small",min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.samplesStart")},null,8,["modelValue","max","placeholder"]),o(f,{modelValue:e.samplesEnd,"onUpdate:modelValue":t[2]||(t[2]=k=>e.samplesEnd=k),class:"flex-1",size:"small",min:e.samplesStart||0,max:e.audio?.duration,controls:!1,placeholder:e.$t("suno.placeholder.samplesEnd")},null,8,["modelValue","min","max","placeholder"])])])}const Dn=E(Tn,[["render",zn]]),jn=[.5,.75,1,1.25,1.5,2],Gn=A({name:"AdjustSpeedInput",components:{ElRadioGroup:Q,ElRadioButton:te,ElImage:O,InfoIcon:F},data(){return{options:jn}},computed:{audio(){return this.$store.state.suno?.config?.audio},speed:{get(){const e=this.$store.state.suno?.config?.speed;return typeof e=="number"?e:1},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,speed:e})}}},methods:{onClick(e){this.$store.dispatch("suno/setAudio",{...this.$store.state.suno.audio,...e,state:"playing"})}}}),Bn={class:"field"},On={class:"flex items-center mb-2"},Nn={class:"text-sm font-bold m-0"},Hn={key:0,class:"task mb-2"},Wn={class:"left relative w-[50px] h-[50px] mr-3 flex-shrink-0"},qn={class:"info flex-1 min-w-0"},Kn={class:"text-sm font-bold m-0 truncate"},Jn={class:"text-xs text-[var(--el-text-color-secondary)] m-0 truncate"};function Qn(e,t,d,r,p,b){const g=l("info-icon"),m=l("el-image"),f=l("el-radio-button"),$=l("el-radio-group"),k=H("loading");return n(),u("div",Bn,[s("div",On,[s("h2",Nn,a(e.$t("suno.name.adjustSpeed")),1),o(g,{content:e.$t("suno.description.adjustSpeed")},null,8,["content"])]),e.audio?(n(),u("div",Hn,[s("div",{class:"audio flex items-center",onClick:t[0]||(t[0]=T=>e.onClick(e.audio))},[B((n(),u("div",Wn,[o(m,{src:e.audio?.image_url,class:"w-full h-full rounded",fit:"cover"},null,8,["src"])])),[[k,!e.audio?.audio_url]]),s("div",qn,[s("h2",Kn,a(e.audio?.title),1),s("p",Jn,a(e.audio?.style),1)])])])):c("",!0),o($,{modelValue:e.speed,"onUpdate:modelValue":t[1]||(t[1]=T=>e.speed=T),size:"small",class:"speed-group"},{default:i(()=>[(n(!0),u(M,null,z(e.options,T=>(n(),y(f,{key:T,value:T},{default:i(()=>[v(a(T)+"x",1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])])}const Yn=E(Gn,[["render",Qn],["__scopeId","data-v-ba834628"]]),Xn=A({name:"VoiceCreateDialog",components:{ElDialog:le,ElForm:tt,ElFormItem:et,ElInput:W,ElButton:G,ElRadioGroup:Q,ElRadio:He},props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue","created"],data(){return{sourceType:"song",form:{name:"",description:"",audio_id:"",audio_url:""},loading:!1}},computed:{visible:{get(){return this.modelValue},set(e){this.$emit("update:modelValue",e)}},token(){return this.$store.state.suno?.credential?.token},canSubmit(){return!(!this.form.name||this.sourceType==="song"&&!this.form.audio_id||this.sourceType==="upload"&&!this.form.audio_url)}},methods:{onClose(){this.visible=!1,this.resetForm()},resetForm(){this.form={name:"",description:"",audio_id:"",audio_url:""},this.sourceType="song"},async onSubmit(){if(this.token){this.loading=!0;try{this.sourceType==="song"?await 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 Zn(e,t,d,r,p,b){const g=l("el-input"),m=l("el-form-item"),f=l("el-radio"),$=l("el-radio-group"),k=l("el-form"),T=l("el-button"),_=l("el-dialog");return n(),y(_,{modelValue:e.visible,"onUpdate:modelValue":t[5]||(t[5]=V=>e.visible=V),title:e.$t("suno.voice.createTitle"),width:"480px","close-on-click-modal":!1,onClose:e.onClose},{footer:i(()=>[o(T,{onClick:e.onClose},{default:i(()=>[v(a(e.$t("common.button.cancel")),1)]),_:1},8,["onClick"]),o(T,{type:"primary",loading:e.loading,disabled:!e.canSubmit,onClick:e.onSubmit},{default:i(()=>[v(a(e.$t("suno.voice.create")),1)]),_:1},8,["loading","disabled","onClick"])]),default:i(()=>[o(k,{"label-position":"top",class:"voice-create-form"},{default:i(()=>[o(m,{label:e.$t("suno.voice.name")},{default:i(()=>[o(g,{modelValue:e.form.name,"onUpdate:modelValue":t[0]||(t[0]=V=>e.form.name=V),placeholder:e.$t("suno.voice.namePlaceholder"),maxlength:"50"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),o(m,{label:e.$t("suno.voice.description")},{default:i(()=>[o(g,{modelValue:e.form.description,"onUpdate:modelValue":t[1]||(t[1]=V=>e.form.description=V),type:"textarea",rows:2,placeholder:e.$t("suno.voice.descriptionPlaceholder"),maxlength:"200"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),o(m,{label:e.$t("suno.voice.sourceType")},{default:i(()=>[o($,{modelValue:e.sourceType,"onUpdate:modelValue":t[2]||(t[2]=V=>e.sourceType=V),class:"w-full"},{default:i(()=>[o(f,{value:"song"},{default:i(()=>[v(a(e.$t("suno.voice.fromSong")),1)]),_:1}),o(f,{value:"upload"},{default:i(()=>[v(a(e.$t("suno.voice.fromUpload")),1)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["label"]),e.sourceType==="song"?(n(),y(m,{key:0,label:e.$t("suno.voice.audioId")},{default:i(()=>[o(g,{modelValue:e.form.audio_id,"onUpdate:modelValue":t[3]||(t[3]=V=>e.form.audio_id=V),placeholder:e.$t("suno.voice.audioIdPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])):c("",!0),e.sourceType==="upload"?(n(),y(m,{key:1,label:e.$t("suno.voice.audioUrl")},{default:i(()=>[o(g,{modelValue:e.form.audio_url,"onUpdate:modelValue":t[4]||(t[4]=V=>e.form.audio_url=V),placeholder:e.$t("suno.voice.audioUrlPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])):c("",!0)]),_:1})]),_:1},8,["modelValue","title","onClose"])}const xn=E(Xn,[["render",Zn]]),ei=A({name:"VoiceManager",components:{ElButton:G,ElIcon:x,ElTabs:pe,ElTabPane:me,ElTooltip:fe,Loading:Ve,FontAwesomeIcon:D,VoiceCreateDialog:xn},data(){return{showCreateDialog:!1,loading:!1,deletingId:null,activeTab:"all"}},computed:{personas(){return this.$store.state.suno?.personas||[]},favoriteIds(){return this.$store.state.suno?.favoritePersonaIds||[]},favoritePersonas(){return this.personas.filter(e=>e.persona_id&&this.favoriteIds.includes(e.persona_id))},visiblePersonas(){return this.activeTab==="favorites"?this.favoritePersonas:this.personas},selectedPersonaId(){return this.$store.state.suno?.config?.persona_id}},watch:{"$store.state.suno.credential":{handler(){this.loadPersonas()},immediate:!0}},methods:{isFavorite(e){return!!e&&this.favoriteIds.includes(e)},onToggleFavorite(e){e.persona_id&&this.$store.commit("suno/togglePersonaFavorite",e.persona_id)},async loadPersonas(){if(this.$store.state.suno?.credential?.token){this.loading=!0;try{await this.$store.dispatch("suno/getPersonas")}finally{this.loading=!1}}},selectPersona(e){const t={...this.$store.state.suno?.config};t.persona_id===e.persona_id?t.persona_id=void 0:t.persona_id=e.persona_id,this.$store.dispatch("suno/setConfig",t)},async onDelete(e){try{await 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()}}}),ti={class:"voice-manager"},oi={class:"flex items-center justify-between mb-3"},si={class:"text-sm font-medium"},ni={key:0,class:"text-center py-6"},ii={key:1,class:"text-center py-6 text-gray-400 text-sm"},ai={key:2,class:"voice-list"},li=["onClick"],ri={class:"flex-1 min-w-0"},di={class:"voice-name"},ui={key:0,class:"voice-desc"};function ci(e,t,d,r,p,b){const g=l("font-awesome-icon"),m=l("el-button"),f=l("el-tab-pane"),$=l("el-tabs"),k=l("loading"),T=l("el-icon"),_=l("el-tooltip"),V=l("voice-create-dialog");return n(),u("div",ti,[s("div",oi,[s("span",si,a(e.$t("suno.voice.title")),1),o(m,{type:"primary",size:"small",onClick:t[0]||(t[0]=C=>e.showCreateDialog=!0)},{default:i(()=>[o(g,{icon:"fa-solid fa-plus",class:"mr-1"}),v(" "+a(e.$t("suno.voice.create")),1)]),_:1})]),o($,{modelValue:e.activeTab,"onUpdate:modelValue":t[1]||(t[1]=C=>e.activeTab=C),class:"voice-tabs",size:"small"},{default:i(()=>[o(f,{name:"all",label:e.$t("suno.voice.tabAll")+" ("+(e.personas?.length||0)+")"},null,8,["label"]),o(f,{name:"favorites",label:e.$t("suno.voice.tabFavorites")+" ("+e.favoritePersonas.length+")"},null,8,["label"])]),_:1},8,["modelValue"]),e.loading?(n(),u("div",ni,[o(T,{class:"is-loading"},{default:i(()=>[o(k)]),_:1})])):e.visiblePersonas.length===0?(n(),u("div",ii,a(e.activeTab==="favorites"?e.$t("suno.voice.emptyFavorites"):e.$t("suno.voice.empty")),1)):(n(),u("div",ai,[(n(!0),u(M,null,z(e.visiblePersonas,C=>(n(),u("div",{key:C.persona_id,class:K(["voice-item",{active:e.selectedPersonaId===C.persona_id}]),onClick:I=>e.selectPersona(C)},[s("div",ri,[s("div",di,[o(g,{icon:C.source_type==="voice"?"fa-solid fa-microphone":"fa-solid fa-music",class:"mr-1.5 text-xs opacity-60"},null,8,["icon"]),v(" "+a(C.name||C.persona_id),1)]),C.description?(n(),u("div",ui,a(C.description),1)):c("",!0)]),s("div",{class:"voice-actions",onClick:t[2]||(t[2]=P(()=>{},["stop"]))},[o(_,{content:e.isFavorite(C.persona_id)?e.$t("suno.voice.unfavorite"):e.$t("suno.voice.favorite"),placement:"top"},{default:i(()=>[o(m,{size:"small",text:"",class:K({"voice-fav-active":e.isFavorite(C.persona_id)}),onClick:I=>e.onToggleFavorite(C)},{default:i(()=>[o(g,{icon:e.isFavorite(C.persona_id)?"fa-solid fa-star":"fa-regular fa-star"},null,8,["icon"])]),_:2},1032,["class","onClick"])]),_:2},1032,["content"]),o(m,{type:"danger",size:"small",text:"",loading:e.deletingId===C.persona_id,onClick:I=>e.onDelete(C)},{default:i(()=>[o(g,{icon:"fa-solid fa-trash"})]),_:1},8,["loading","onClick"])])],10,li))),128))])),o(V,{modelValue:e.showCreateDialog,"onUpdate:modelValue":t[3]||(t[3]=C=>e.showCreateDialog=C),onCreated:e.onCreated},null,8,["modelValue","onCreated"])])}const mi=E(ei,[["render",ci],["__scopeId","data-v-8b8e36d9"]]),pi=A({name:"PersonaInput",components:{ElSelect:ce,ElOption:ue,ElButton:G,ElDrawer:Ce,FontAwesomeIcon:D,InfoIcon:F,VoiceManager:mi},data(){return{showManager:!1}},computed:{personaId:{get(){return this.$store.state.suno?.config?.persona_id||""},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,persona_id:e||void 0})}},personas(){return this.$store.state.suno?.personas||[]}}}),fi={class:"field"},hi={class:"flex items-center justify-between mb-2"},gi={class:"flex items-center"},$i={class:"text-sm font-bold"},_i={class:"flex items-center justify-between w-full"},vi={key:0,class:"text-xs text-gray-400 ml-2"};function yi(e,t,d,r,p,b){const g=l("info-icon"),m=l("font-awesome-icon"),f=l("el-button"),$=l("el-option"),k=l("el-select"),T=l("voice-manager"),_=l("el-drawer");return n(),u("div",fi,[s("div",hi,[s("div",gi,[s("span",$i,a(e.$t("suno.name.persona")),1),o(g,{content:e.$t("suno.description.persona")},null,8,["content"])]),o(f,{size:"small",round:"",onClick:t[0]||(t[0]=V=>e.showManager=!0)},{default:i(()=>[o(m,{icon:"fa-solid fa-microphone",class:"mr-1"}),v(" "+a(e.$t("suno.voice.manage")),1)]),_:1})]),o(k,{modelValue:e.personaId,"onUpdate:modelValue":t[1]||(t[1]=V=>e.personaId=V),placeholder:e.$t("suno.placeholder.personaId"),clearable:"",filterable:"",class:"w-full"},{default:i(()=>[(n(!0),u(M,null,z(e.personas,V=>(n(),y($,{key:V.persona_id||"",value:V.persona_id||"",label:V.name||V.persona_id||""},{default:i(()=>[s("div",_i,[s("span",null,a(V.name||V.persona_id),1),V.source_type?(n(),u("span",vi,a(V.source_type),1)):c("",!0)])]),_:2},1032,["value","label"]))),128))]),_:1},8,["modelValue","placeholder"]),o(_,{modelValue:e.showManager,"onUpdate:modelValue":t[2]||(t[2]=V=>e.showManager=V),title:e.$t("suno.voice.title"),size:"380px",direction:"rtl"},{default:i(()=>[o(T)]),_:1},8,["modelValue","title"])])}const bi=E(pi,[["render",yi]]),ki=A({name:"PresetPanel",components:{TypeSelector:Tt,PromptInput:ao,LyricInput:ko,StyleInput:Ro,TitleInput:Go,ExtendFromInput:xo,CoverFromInput:cs,UploadAudio:Yt,VocalGenderSelector:gs,AdvancedParams:Ns,ReplaceSectionInput:tn,OverpaintingInput:fn,UnderpaintingInput:Sn,SamplesInput:Dn,AdjustSpeedInput:Yn,PersonaInput:bi,FontAwesomeIcon:D,ElButton:G,ElTabs:pe,ElTabPane:me,Consumption:ot},emits:["generate"],computed:{config(){return this.$store.state.suno?.config},mode:{get(){return this.$store.state.suno?.config?.custom?"custom":"simple"},set(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,custom:e==="custom"})}},consumption(){return st(this.config,this.service?.cost)},service(){return this.$store.state.suno?.service},supportsVocalGender(){const e=this.config?.model||"";return["chirp-v4-5-plus","chirp-v5","chirp-v5-5"].includes(e)},supportsPersona(){const e=this.config?.action;return!e||e==="generate"||e==="artist_consistency"||e==="artist_consistency_vox"},generateButtonText(){const e=this.config?.action;return e==="extend"?this.$t("suno.button.extend"):e==="cover"?this.$t("suno.button.cover_music"):e==="remaster"?this.$t("suno.button.remaster"):e==="replace_section"?this.$t("suno.button.replace_section"):e==="mashup"?this.$t("suno.button.mashup"):e==="stems"?this.$t("suno.button.get_stems"):e==="concat"?this.$t("suno.button.concat_music"):e==="upload_cover"?this.$t("suno.button.upload_cover"):e==="artist_consistency"?this.$t("suno.button.artist_consistency"):e==="artist_consistency_vox"?this.$t("suno.button.artist_consistency_vox"):e==="overpainting"?this.$t("suno.button.overpainting"):e==="underpainting"?this.$t("suno.button.underpainting"):e==="samples"?this.$t("suno.button.samples"):e==="adjust_speed"?this.$t("suno.button.adjust_speed"):this.$t("suno.button.generate")}},methods:{onGenerate(){this.$emit("generate")},onClearAll(){this.$store.commit("suno/setConfig",{custom:!1,sounds:!1,instrumental:!1,lyric:"",style:"",title:"",lyrics_mode:"manual",model:this.$store.state.suno?.config?.model})}}}),wi={class:"flex flex-col h-full"},Ci={class:"flex-1 overflow-y-auto p-5"},Vi={class:"pt-2 px-1"},Si={class:"pt-2 px-1"},Ti={class:"flex flex-col items-center justify-center px-5 pb-5 gap-2"},Ai={class:"flex gap-2 w-full"};function Ui(e,t,d,r,p,b){const g=l("type-selector"),m=l("upload-audio"),f=l("prompt-input"),$=l("extend-from-input"),k=l("cover-from-input"),T=l("replace-section-input"),_=l("overpainting-input"),V=l("underpainting-input"),C=l("samples-input"),I=l("adjust-speed-input"),U=l("advanced-params"),q=l("el-tab-pane"),J=l("lyric-input"),Y=l("style-input"),h=l("title-input"),S=l("vocal-gender-selector"),ie=l("persona-input"),L=l("el-tabs"),ae=l("consumption"),ge=l("font-awesome-icon"),$e=l("el-button");return n(),u("div",wi,[s("div",Ci,[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",Vi,[o(g,{class:"mb-4"}),o(m,{class:"mb-4"}),o(f,{class:"mb-4"}),e.config?.action==="extend"?(n(),y($,{key:0,class:"mb-4"})):c("",!0),e.config?.action==="cover"?(n(),y(k,{key:1,class:"mb-4"})):c("",!0),e.config?.action==="replace_section"?(n(),y(T,{key:2,class:"mb-4"})):c("",!0),e.config?.action==="overpainting"?(n(),y(_,{key:3,class:"mb-4"})):c("",!0),e.config?.action==="underpainting"?(n(),y(V,{key:4,class:"mb-4"})):c("",!0),e.config?.action==="samples"?(n(),y(C,{key:5,class:"mb-4"})):c("",!0),e.config?.action==="adjust_speed"?(n(),y(I,{key:6,class:"mb-4"})):c("",!0),o(U,{class:"mb-4"})])]),_:1},8,["label"]),o(q,{label:e.$t("suno.mode.custom"),name:"custom"},{default:i(()=>[s("div",Si,[o(g,{class:"mb-4"}),o(m,{class:"mb-4"}),e.config?.instrumental?c("",!0):(n(),y(J,{key:0,class:"mb-4"})),o(Y,{class:"mb-4"}),o(h,{class:"mb-4"}),!e.config?.instrumental&&e.supportsVocalGender?(n(),y(S,{key:1,class:"mb-4"})):c("",!0),e.supportsPersona?(n(),y(ie,{key:2,class:"mb-4"})):c("",!0),e.config?.action==="extend"?(n(),y($,{key:3,class:"mb-4"})):c("",!0),e.config?.action==="cover"?(n(),y(k,{key:4,class:"mb-4"})):c("",!0),e.config?.action==="replace_section"?(n(),y(T,{key:5,class:"mb-4"})):c("",!0),e.config?.action==="overpainting"?(n(),y(_,{key:6,class:"mb-4"})):c("",!0),e.config?.action==="underpainting"?(n(),y(V,{key:7,class:"mb-4"})):c("",!0),e.config?.action==="samples"?(n(),y(C,{key:8,class:"mb-4"})):c("",!0),e.config?.action==="adjust_speed"?(n(),y(I,{key:9,class:"mb-4"})):c("",!0),o(U,{class:"mb-4"})])]),_:1},8,["label"])]),_:1},8,["modelValue"])]),s("div",Ti,[o(ae,{value:e.consumption,service:e.service},null,8,["value","service"]),s("div",Ai,[o($e,{class:"flex-1",onClick:e.onClearAll},{default:i(()=>[o(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 Pi=E(ki,[["render",Ui],["__scopeId","data-v-c62324e6"]]),we=Se("suno"),Ei=A({name:"TaskPreview",components:{ElImage:O,ElIcon:x,ElTooltip:fe,FontAwesomeIcon:D,VideoPlay:de,VideoPause:re,ElDropdown:Pe,ElDropdownMenu:Ue,ElDropdownItem:Ae,ElInput:W,ElProgress:it,ElCheckbox:nt,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,p=r.substring(r.lastIndexOf("/")+1);console.log("on preview",p),fetch(t).then(b=>b.blob()).then(b=>{qe.saveAs(b,p)})},async handleVideoDownload(e){if(e.video_url){this.onDownload(null,e.video_url);return}if(!this.isFetchingVideoUrl)try{this.isFetchingVideoUrl=!0;const t=await this.fetchVideoUrlFromApi(e?.id);console.log(`get videoUrl: ${t}`),e.video_url=t,this.onDownload(null,t)}catch(t){console.error("get videoUrl failed:",t),w.error(this.$t("suno.message.getVideoUrlFailed"))}finally{this.isFetchingVideoUrl=!1}},async fetchVideoUrlFromApi(e){return new Promise((t,d)=>{const r={audio_id:e},p=this.credential?.token;if(!p){console.error("no token specified"),d(new Error("No token specified"));return}R.mp4(r,{token:p}).then(b=>{const g=b.data?.data?.video_url;g?t(g):d(new Error("Video URL not found in response"))}).catch(b=>{d(b)})})},onPreview(e,t){e.stopPropagation(),console.log("on preview",t),window.open(t,"_blank")},async onGetStems(e){await this.onGenerateAudioUrl("stems",e)},onCover(e){console.log("on cover"),console.debug("set config",e),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:e.model,custom:!0,instrumental:!1,style:e.style,action:"cover",audio:e,audio_id:e.id})},async onConcatMusic(e){await this.onGenerateAudioUrl("concat",e)},async onRemaster(e){await this.onGenerateAudioUrl("remaster",e)},async onGetAllStems(e){await this.onGenerateAudioUrl("all_stems",e)},onReplaceSection(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:e.model,custom:!0,instrumental:!1,style:e.style,action:"replace_section",audio:e,audio_id:e.id,replace_section_start:0,replace_section_end:Math.min(30,e.duration||30)})},onMashup(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:"mashup",audio:e,audio_id:e.id,mashup_audio_ids:[e.id]})},onOverpainting(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:"overpainting",audio:e,audio_id:e.id,overpainting_start:0,overpainting_end:Math.min(30,e.duration||30)})},onUnderpainting(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:"underpainting",audio:e,audio_id:e.id,underpainting_start:0,underpainting_end:Math.min(30,e.duration||30)})},onSamples(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:"samples",audio:e,audio_id:e.id,samples_start:0,samples_end:Math.min(30,e.duration||30)})},onArtistConsistency(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:"artist_consistency",audio:e,audio_id:e.id})},onAdjustSpeed(e){this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:e.model,custom:!0,style:e.style,action:"adjust_speed",audio:e,audio_id:e.id,speed:1})},onReusePrompt(e){const t=this.modelValue?.request??{};if(!(t.prompt||t.lyric||t.style||t.title||t.lyric_prompt||t.style_negative||t.persona_id)){w.warning(this.$t("suno.message.reusePromptEmpty"));return}this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,model:t.model??e.model,custom:t.custom??!1,instrumental:t.instrumental??!1,prompt:t.prompt??"",lyric:t.lyric??"",lyric_prompt:t.lyric_prompt??"",lyrics_mode:t.lyrics_mode??"manual",title:t.title??"",style:t.style??"",style_negative:t.style_negative??"",vocal_gender:t.vocal_gender,weirdness:t.weirdness,style_influence:t.style_influence,variation_category:t.variation_category,audio_weight:t.audio_weight,persona_id:t.persona_id,action:void 0,audio:void 0,audio_id:void 0,mashup_audio_ids:void 0,continue_at:void 0,speed:void 0,replace_section_start:void 0,replace_section_end:void 0,overpainting_start:void 0,overpainting_end:void 0,underpainting_start:void 0,underpainting_end:void 0,samples_start:void 0,samples_end:void 0}),w.success(this.$t("suno.message.reusePromptSuccess"))},async onExtractVocals(e){const t=this.credential?.token;t&&(w.info(this.$t("suno.message.extractingVocals")),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(p=>{w.error(p?.response?.data?.error?.message||this.$t("suno.message.startTaskFailed"))}).finally(async()=>{await this.onGetTasks(),await this.onScrollDown()})},isMashupSelected(e){return!!e.id&&this.mashupAudioIds.includes(e.id)},onToggleMashup(e){if(!e.id)return;const t=[...this.mashupAudioIds],d=t.indexOf(e.id);d!==-1?t.splice(d,1):t.push(e.id),this.$store.commit("suno/setConfig",{...this.$store.state.suno?.config,mashup_audio_ids:t})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".tasks");e&&(e.scrollTop=e.scrollHeight)},1e3)},onStartTitleEdit(e){this.editingAudioId=e.id??null,this.editingTitle=e.title||"",this.$nextTick(()=>{this.$refs.titleInput?.focus?.()})},onSaveTitleEdit(e){if(this.editingAudioId!==e.id)return;const t=this.editingTitle.trim();if(t&&t!==e.title){const d=this.$store.state.suno?.tasks;if(d?.items)for(const r of d.items){const b=(r?.response?.data??[]).find(g=>g.id===e.id);if(b){b.title=t;break}}}this.editingAudioId=null,this.editingTitle=""},onCancelTitleEdit(){this.editingAudioId=null,this.editingTitle=""},async onDelete(e){try{await 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??[],p=r.findIndex(b=>b.id===e.id);if(p!==-1){if(r.splice(p,1),r.length===0){const b=t.items.indexOf(d);b!==-1&&t.items.splice(b,1)}break}}this.$store.state?.suno?.audio?.id===e.id&&this.$store.dispatch("suno/setAudio",null),w.success(this.$t("suno.message.deleteSuccess"))},async onGetTasks(){if(this.loading){console.debug("loading");return}await this.$store.dispatch("suno/getTasks",{limit:30,offset:0})}}}),Ii={class:"task"},Li=["onClick"],Ri=["onClick"],Mi={class:"left"},Fi=["onClick"],zi=["onClick"],Di={key:2,class:"duration"},ji={class:"info"},Gi={key:1,class:"title-row"},Bi={class:"title"},Oi={class:"style"},Ni={key:2,class:"progress-row"},Hi={class:"progress-text"},Wi={class:"right"},qi={class:"el-dropdown-link"},Ki={class:"flex items-center min-w-[120px]"},Ji={class:"flex items-center min-w-[120px]"},Qi={class:"flex items-center min-w-[120px]"},Yi={class:"el-dropdown-link"};function Xi(e,t,d,r,p,b){const g=l("el-checkbox"),m=l("el-image"),f=l("video-pause"),$=l("el-icon"),k=l("video-play"),T=l("el-input"),_=l("font-awesome-icon"),V=l("el-progress"),C=l("el-tooltip"),I=l("Loading"),U=l("el-dropdown-item"),q=l("el-dropdown-menu"),J=l("el-dropdown"),Y=H("loading");return n(),u("div",Ii,[(n(!0),u(M,null,z(e.audios,h=>(n(),u("div",{key:h.id,class:K(["audio",{"mashup-selected":e.isMashupSelected(h)}]),onClick: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,Ri)):c("",!0),B((n(),u("div",Mi,[o(m,{src:h?.image_url,class:"cover",fit:"cover",lazy:""},null,8,["src"]),h?.audio_url&&e.$store.state?.suno?.audio?.id===h.id&&e.$store.state?.suno?.audio?.state==="playing"?(n(),u("div",{key:0,class:"overlay",onClick:P(S=>e.onPause(h),["stop"])},[o($,null,{default:i(()=>[o(f)]),_:1})],8,Fi)):c("",!0),h?.audio_url&&(e.$store.state?.suno?.audio?.id!==h.id||e.$store.state?.suno?.audio?.id===h.id&&e.$store.state?.suno?.audio?.state==="paused")?(n(),u("div",{key:1,class:"overlay",onClick:P(S=>e.onPlay(h),["stop"])},[o($,null,{default:i(()=>[o(k)]),_:1})],8,zi)):c("",!0),h?.duration?(n(),u("div",Di,a(e.useFormatDuring(h?.duration)),1)):c("",!0)])),[[Y,!h?.audio_url]]),s("div",ji,[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",Gi,[s("h2",Bi,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",Oi,a(h?.style),1),!h?.audio_url&&h?.progress!=null&&h?.progress<100?(n(),u("div",Ni,[o(V,{percentage:Math.round(h.progress),"stroke-width":4,"show-text":!1,status:"warning",class:"progress-bar"},null,8,["percentage"]),s("span",Hi,a(e.$t("suno.name.generating"))+" "+a(Math.round(h.progress))+"%",1)])):c("",!0)]),s("div",Wi,[o(J,null,{dropdown:i(()=>[o(q,null,{default:i(()=>[o(U,{disabled:e.isFetchingVideoUrl,onClick:S=>e.handleVideoDownload(h)},{default:i(()=>[s("div",Ki,[e.isFetchingVideoUrl?(n(),y($,{key:0,class:"is-loading mr-2"},{default:i(()=>[o(I)]),_:1})):c("",!0),s("span",null,a(e.$t("suno.button.download_video")),1)])]),_:1},8,["disabled","onClick"]),h?.audio_url?(n(),y(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",Ji,[e.isFetchingWav?(n(),y($,{key:0,class:"is-loading mr-2"},{default:i(()=>[o(I)]),_:1})):c("",!0),s("span",null,a(e.$t("suno.button.download_wav")),1)])]),_:1},8,["disabled","onClick"]),o(U,{disabled:e.isFetchingMidi,onClick:S=>e.handleMidiDownload(h)},{default:i(()=>[s("div",Qi,[e.isFetchingMidi?(n(),y($,{key:0,class:"is-loading mr-2"},{default:i(()=>[o(I)]),_:1})):c("",!0),s("span",null,a(e.$t("suno.button.download_midi")),1)])]),_:1},8,["disabled","onClick"])]),_:2},1024)]),default:i(()=>[s("span",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(J,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",Yi,[o(C,{effect:"dark",content:e.$t("suno.button.more"),placement:"top"},{default:i(()=>[h?.audio_url||h?.video_url?(n(),y(_,{key:0,icon:"fa-solid fa-ellipsis",class:"icon icon-ellipsis"})):c("",!0)]),_:2},1032,["content"])])]),_:2},1024)])],10,Li))),128))])}const Zi=E(Ei,[["render",Xi]]),xi={class:"player-slider"},ea=A({__name:"PlayerSlider",setup(e){const t=ee(),d=N({get:()=>t.state.suno?.audio?.progress,set:g=>t.commit("suno/setAudio",{...t.state.suno.audio,progress:g})}),r=N({get:()=>t.state.suno?.audio?.duration,set:g=>t.commit("suno/setAudio",{...t.state.suno.audio,duration:g})}),p=()=>{},b=g=>t.dispatch("suno/setAudio",{...t.state.suno.audio,progress:g});return(g,m)=>(n(),u("div",xi,[o(j(he),{modelValue:d.value,"onUpdate:modelValue":m[0]||(m[0]=f=>d.value=f),"show-tooltip":!1,min:0,max:r.value,onChange:b,onInput:p},null,8,["modelValue","max"])]))}}),ta={class:"flex player-song"},oa=["src"],sa={class:"ml-2 text-xs flex flex-col justify-between"},na={class:"w-52 2xl:w-96 cursor-pointer truncate"},ia={class:"flex"},aa={class:"ml-2 text-dc"},la=A({__name:"PlayerSong",setup(e){const t=ee(),d=N({get:()=>t.state.suno.audio,set:r=>t.commit("suno/setAudio",r)});return Le(d,(r,p)=>{if(r?.audio_url!==p?.audio_url){console.log("audio changed",r),r.object&&(console.log("111",r.object),r.object.pause(),delete r.object);const b=new Audio(r.audio_url);r.state==="playing"?b.play():b.pause(),b.addEventListener("loadedmetadata",()=>{b.currentTime=0,b.addEventListener("timeupdate",()=>{t.commit("suno/setAudio",{...t.state.suno.audio,progress:b.currentTime})})}),t.commit("suno/setAudio",{...t.state.suno.audio,object:b})}else if(r?.progress!==p?.progress&&Math.abs(r.progress-r.object.currentTime)>2){console.log("progress changed",r.progress);const b=t.state.suno.audio;b.object&&(b.object.currentTime=b.progress)}else r?.state!==p?.state&&(console.log("state changed",r.state),r.object&&(r.state==="playing"?r.object.play():r.object.pause()));r?.volume!==p?.volume&&(console.log("volume changed",r.volume),r.object&&(r.object.volume=r.volume/100))}),(r,p)=>(n(),u("div",ta,[s("img",{alt:"",class:"w-11 h-11 rounded",src:d.value?.image_url||j(Ke)},null,8,oa),s("div",sa,[s("div",na,[s("div",ia,[s("span",null,a(d.value?.title||"Music"),1),s("span",aa,"- "+a(d.value?.style||"SmallRuralDog"),1)])])])]))}}),ra={class:"flex justify-end items-center gap-x-2.5"},da={class:"text-xs"},ua=A({__name:"PlayerAction",setup(e){const t=ee(),d=N({get:()=>t.state.suno?.audio?.progress,set:p=>t.commit("suno/setAudio",{...t.state.suno.audio,progress:p})}),r=N({get:()=>t.state.suno?.audio?.duration,set:p=>t.commit("suno/setAudio",{...t.state.suno.audio,duration:p})});return(p,b)=>(n(),u("div",ra,[s("span",da,a(j(Z)(d.value))+" / "+a(j(Z)(r.value)),1)]))}}),ca={class:"player-volume flex flex-col items-center pt-2"},ma={class:"text-sm mt-3"},pa=A({__name:"PlayerVolumeSlider",setup(e){const t=ee(),d=N({get:()=>t.state.suno.audio?.volume,set:b=>t.commit("suno/setAudio",{...t.state.suno.audio,volume:b})}),r=N({get:()=>t.state.suno.audio?.muted,set:b=>t.commit("suno/setAudio",{...t.state.suno.audio,muted:b})}),p=b=>t.dispatch("suno/setVolume",b);return(b,g)=>(n(),u("div",ca,[o(j(he),{modelValue:d.value,"onUpdate:modelValue":g[0]||(g[0]=m=>d.value=m),vertical:"",height:"100px","show-tooltip":!1,max:100,min:0,size:"small",disabled:r.value,onInput:p},null,8,["modelValue","disabled"]),s("div",ma,a(d.value),1)]))}}),fa={class:"flex items-center justify-center gap-x-3"},ha=A({__name:"PlayerController",setup(e){const t=ee(),d=()=>t.dispatch("suno/setAudio",{...t.state.suno.audio,state:t.state.suno.audio.state==="playing"?"paused":"playing"}),r=N(()=>t.state.suno.audio);return(p,b)=>(n(),u("div",fa,[o(_e,{icon:r.value?.state==="playing"?j(Je):j(Qe),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(Ye),size:"20","stroke-width":2,class:"cursor-pointer"},null,8,["icon"])]),default:i(()=>[o(pa)]),_:1})]))}}),ga={class:"flex flex-col items-stretch h-20"},$a={class:"flex grow px-5 items-center"},_a={class:"flex-1"},va={class:"flex-1"},ya={class:"flex-1"},ba=A({__name:"Player",setup(e){return(t,d)=>(n(),u("div",ga,[o(ea),s("div",$a,[s("div",_a,[o(la)]),s("div",va,[o(ha)]),s("div",ya,[o(ua)])])]))}}),ka=A({name:"RecentPanel",components:{ElSkeletonItem:rt,ElSkeleton:lt,ElInput:W,ElButton:G,ElDropdown:Pe,ElDropdownMenu:Ue,ElDropdownItem:Ae,ElPopover:Ee,ElRadioGroup:Q,ElRadioButton:te,ElSelect:ce,ElOption:ue,FontAwesomeIcon:D,TaskPreview:Zi,Player:ba,NoTasks:at,ScrollList:Oe},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0,searchQuery:"",sortBy:"newest",filterType:"all",filterDuration:"all",filterVideo:"all",filterModel:"all"}},computed:{tasks(){return{...this.$store.state.suno?.tasks,items:this.$store.state.suno?.tasks?.items?.slice()}},sortLabel(){return this.sortBy==="newest"?this.$t("suno.sort.newest"):this.$t("suno.sort.oldest")},activeFilterCount(){let e=0;return this.filterType!=="all"&&e++,this.filterDuration!=="all"&&e++,this.filterVideo!=="all"&&e++,this.filterModel&&this.filterModel!=="all"&&e++,e},availableModels(){const e=this.tasks?.items||[],t=new Set;for(const d of e){const r=d?.response?.data??[];for(const p of r)p.model&&t.add(p.model)}return Array.from(t).sort()},filteredTasks(){let e=this.tasks?.items||[];if(this.searchQuery){const t=this.searchQuery.toLowerCase();e=e.filter(d=>(d?.response?.data??[]).some(p=>p.title?.toLowerCase().includes(t)||p.style?.toLowerCase().includes(t)||p.prompt?.toLowerCase().includes(t)))}return this.activeFilterCount>0&&(e=e.filter(t=>{const d=t?.request??{},r=t?.response?.data??[];return this.filterType==="vocal"&&d.instrumental===!0||this.filterType==="instrumental"&&d.instrumental!==!0?!1:this.filterDuration!=="all"||this.filterVideo!=="all"||this.filterModel&&this.filterModel!=="all"?r.some(p=>!(this.filterDuration==="short"&&!(typeof p.duration=="number"&&p.duration<60)||this.filterDuration==="medium"&&!(typeof p.duration=="number"&&p.duration>=60&&p.duration<=180)||this.filterDuration==="long"&&!(typeof p.duration=="number"&&p.duration>180)||this.filterVideo==="with"&&!p.video_url||this.filterVideo==="without"&&p.video_url||this.filterModel&&this.filterModel!=="all"&&p.model!==this.filterModel)):!0})),this.sortBy==="oldest"&&(e=[...e].reverse()),e}},methods:{onSortChange(e){this.sortBy=e},onResetFilters(){this.filterType="all",this.filterDuration="all",this.filterVideo="all",this.filterModel="all"},getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),wa={key:0,class:"tasks"},Ca={class:"left w-[70px] p-[10px] flex items-center"},Va={class:"main w-[calc(100%-70px)] flex-1 p-[10px]"},Sa={key:0,class:"task-toolbar"},Ta={key:0,class:"filter-badge"},Aa={class:"filter-popover"},Ua={class:"filter-row"},Pa={class:"filter-label"},Ea={class:"filter-row"},Ia={class:"filter-label"},La={class:"filter-row"},Ra={class:"filter-label"},Ma={key:0,class:"filter-row"},Fa={class:"filter-label"},za={class:"filter-actions"},Da={key:2,class:"w-full flex-1 flex items-center justify-center"},ja={class:"text-sm text-gray-400"},Ga={key:3,class:"w-full flex-1 flex flex-col items-center justify-center gap-2"},Ba={class:"text-sm text-gray-400"},Oa={key:4,class:"w-full flex-1 flex items-center justify-center"},Na={class:"h-20"};function Ha(e,t,d,r,p,b){const g=l("el-skeleton-item"),m=l("el-skeleton"),f=l("font-awesome-icon"),$=l("el-input"),k=l("el-button"),T=l("el-dropdown-item"),_=l("el-dropdown-menu"),V=l("el-dropdown"),C=l("el-radio-button"),I=l("el-radio-group"),U=l("el-option"),q=l("el-select"),J=l("el-popover"),Y=l("task-preview"),h=l("scroll-list"),S=l("no-tasks"),ie=l("player");return n(),u(M,null,[e.tasks?.items===void 0?(n(),u("div",wa,[(n(),u(M,null,z(3,L=>s("div",{key:L,class:"flex"},[s("div",Ca,[o(m,{animated:""},{template:i(()=>[o(g,{variant:"image",class:"avatar w-[50px] h-[50px]"})]),_:1})]),s("div",Va,[o(m,{animated:""},{template:i(()=>[o(g,{variant:"p",class:"w-[200px] h-[15px] mb-[5px] mt-[10px]"}),o(g,{variant:"text"})]),_:1})])])),64))])):(n(),u(M,{key:1},[e.tasks?.items?.length?(n(),u("div",Sa,[o($,{modelValue:e.searchQuery,"onUpdate:modelValue":t[0]||(t[0]=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(k,{size:"small",class:"sort-btn"},{default:i(()=>[o(f,{icon:"fa-solid fa-arrow-down-wide-short",class:"mr-1"}),v(" "+a(e.sortLabel),1)]),_:1})]),_:1},8,["onCommand"]),o(J,{trigger:"click",placement:"bottom-end",width:260},{reference:i(()=>[o(k,{size:"small",class:K(["filter-btn",{"has-active-filter":e.activeFilterCount>0}])},{default:i(()=>[o(f,{icon:"fa-solid fa-filter",class:"mr-1"}),v(" "+a(e.$t("suno.filter.title"))+" ",1),e.activeFilterCount>0?(n(),u("span",Ta,a(e.activeFilterCount),1)):c("",!0)]),_:1},8,["class"])]),default:i(()=>[s("div",Aa,[s("div",Ua,[s("div",Pa,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",Ea,[s("div",Ia,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",La,[s("div",Ra,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",Ma,[s("div",Fa,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,z(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",za,[o(k,{size:"small",text:"",onClick:e.onResetFilters},{default:i(()=>[v(a(e.$t("suno.filter.reset")),1)]),_:1},8,["onClick"])])])]),_:1})])):c("",!0),e.filteredTasks?.length>0?(n(),y(h,{key:1,ref:"scrollList",class:"flex-1 w-full overflow-y-auto tasks p-2",loading:e.loading,onReachTop:t[5]||(t[5]=L=>e.$emit("reach-top"))},{default:i(()=>[(n(!0),u(M,null,z(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",Da,[s("p",ja,a(e.$t("suno.message.noSearchResults")),1)])):e.activeFilterCount>0&&e.tasks?.items?.length>0?(n(),u("div",Ga,[s("p",Ba,a(e.$t("suno.message.noFilterResults")),1),o(k,{size:"small",text:"",onClick:e.onResetFilters},{default:i(()=>[v(a(e.$t("suno.filter.reset")),1)]),_:1},8,["onClick"])])):e.tasks?.items?.length===0?(n(),u("div",Oa,[o(S)])):c("",!0)],64)),B(s("div",Na,[o(ie)],512),[[Re,!!e.$store?.state?.suno?.audio?.object]])],64)}const Wa=E(ka,[["render",Ha],["__scopeId","data-v-4ab3f8f2"]]),qa=A({name:"TaskPreview",components:{IconPicture:Fe,ElImage:O,ElAvatar:Xe,ElIcon:x},computed:{audio(){return this.$store.state.suno?.audio}}}),Ka={key:0,class:"size-full overflow-hidden"},Ja={class:"relative h-[300px]"},Qa={class:"flex items-center justify-center size-full bg-[var(--el-bg-color)]"},Ya={class:"absolute bottom-0 left-0 right-0 m-0 p-4 text-white z-10 bg-gradient-to-t from-black/70 to-transparent"},Xa={class:"p-4"},Za={class:"flex items-center font-bold mb-2"},xa={class:"text-[var(--el-text-color-regular)] mb-2"},el={class:"text-xs text-[var(--el-text-color-regular)]"},tl={class:"mt-4 text-sm leading-[25px] whitespace-pre-wrap"},ol={key:1,class:"w-full h-full"};function sl(e,t,d,r,p,b){const g=l("icon-picture"),m=l("el-icon"),f=l("el-image"),$=l("el-avatar");return e.audio?.object?(n(),u("div",Ka,[s("div",Ja,[o(f,{src:e.audio.image_url,fit:"cover",class:"size-full"},{error:i(()=>[s("div",Qa,[o(m,{class:"text-3xl"},{default:i(()=>[o(g)]),_:1})])]),_:1},8,["src"]),s("h2",Ya,a(e.audio?.title),1)]),s("div",Xa,[s("div",Za,[o($,{size:30,src:e.audio?.image_url,class:"mr-2"},null,8,["src"]),s("span",null,a(e.audio?.title),1)]),s("p",xa,a(e.audio?.style),1),s("p",el,a(e.$dayjs.format(e.audio?.created_at)),1),s("div",tl,[s("p",null,a(e.audio?.lyric),1)])])])):(n(),u("div",ol))}const nl=E(qa,[["render",sl]]),il=Se("suno"),al=A({name:"SunoIndex",components:{Layout:ht,ConfigPanel:Pi,RecentPanel:Wa,PreviewPanel:nl},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.suno?.status?.getApplications===X.Request},tasksLoading(){return this.$store.state.suno?.status?.getTasks===X.Request||this.fetchingTasks},service(){return this.$store.state.suno.service},credential(){return this.$store.state.suno.credential},config(){return this.$store.state.suno.config},initializing(){return this.$store.state.suno.status.getApplications===X.Request},needApply(){return this.$store.state.suno.status.getApplications===X.Success&&!this.application},application(){return this.$store.state.suno.application},tasks(){return this.$store.state.suno.tasks},applications(){return this.$store.state.suno.applications}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await Ne({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("suno/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplications"),await this.$store.dispatch("suno/getApplications"),console.debug("end onGetApplications"),await this.onGetTasks()},onApply(){De.create({application:this.application}).then(({data:e})=>{this.application=e,w.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{e?.response?.data?.code===je&&w.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:d,createdAtMax:r}=e||{};console.debug("limit",t,"createdAtMin",d,"createdAtMax",r),this.fetchingTasks=!0;try{await this.$store.dispatch("suno/getTasks",{limit:t,createdAtMin:d,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerateAudio(){const e={...this.config,callback_url:il},t=this.credential?.token;if(!t){console.error("no token specified");return}w.info(this.$t("suno.message.startingTask")),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 ll(e,t,d,r,p,b){const g=l("config-panel"),m=l("recent-panel"),f=l("preview-panel"),$=l("layout");return n(),y($,null,{config:i(()=>[o(g,{onGenerate:e.onGenerateAudio},null,8,["onGenerate"])]),result:i(()=>[o(m,{ref:"recentPanel",class:"panel recent",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),preview:i(()=>[o(f)]),_:1})}const dr=E(al,[["render",ll],["__scopeId","data-v-933ac61a"]]);export{dr as default};
@@ -0,0 +1 @@
1
+ import{F as L}from"./index.es-r9pvLLwr.js";import{E}from"./index-_HYMyS6B.js";import{E as R}from"./index-CptSkKy6.js";import{d as b,H as i,E as r,z as T,C as t,y as u,D as a,q as s,F as o,O as C,N as G,x as v,I as d,J as m,M as A,Q as S}from"./vendor-vue-NSDaktjZ.js";import{G as k,bl as M,cr as D,aR as j,S as U,cs as B}from"./index-Cxzu3p6D.js";import{a as q}from"./hailuo-C8Dw-0xR.js";import{E as F,a as O}from"./index-BoRxbdW2.js";import{p as z}from"./pasteUploadMixin-BurWbGNQ.js";import{I as P,S as N,l as H}from"./pagination-CZb0hbZ1.js";import{I as J}from"./ImagePreview-DlwroH_y.js";import{E as K}from"./index-DTShxeQ8.js";import{E as V}from"./index-CBfqsHGh.js";import{E as Q}from"./index-Bh_CWocK.js";import{C as W}from"./Consumption-D8YBErjq.js";import{a as X}from"./price-Gt41kpjf.js";import{b as Y}from"./errorCode-Cqj9Td_Z.js";import{C as Z}from"./CopyToClipboard-BBeUorYq.js";import{V as x}from"./VideoPlayer-DF0852ZT.js";import{E as ee}from"./index-CBQuA3gp.js";import{E as te}from"./index-DeKlpOxv.js";import{E as oe}from"./index-DacX-iLC.js";import{B as se}from"./BotPlaceholder-MWeT2hk0.js";import{N as ae}from"./NoTasks-Biw7HgNs.js";import"./use-form-item-ByR72rLs.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./index-Bg7ZTTvi.js";import"./typescript-xdzIxq8N.js";import"./index-Bmect7J5.js";import"./strings-beZM2Y-f.js";import"./isEqual-C-ffp0KB.js";import"./_Uint8Array-DFE3Z4no.js";import"./castArray-DADNwHSf.js";import"./debounce-Diil38Ii.js";import"./_baseIteratee-BXXZkHgC.js";import"./index-BAA4zDOa.js";import"./index-B4loSzbq.js";import"./_baseClone-BxlA9WX_.js";import"./_initCloneObject-CciJTtIB.js";import"./index-BMuncW0x.js";import"./vue-plyr-BO2nlN4c.js";import"./index-CsIY1sFD.js";const ne=b({name:"LayoutHailuo",components:{ElDrawer:R,ElButton:E,FontAwesomeIcon:L},data(){return{drawer:!1}}}),le={class:"main flex flex-row flex-1"},ie={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},re={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function ce(e,n,f,g,w,y){const p=a("font-awesome-icon"),h=a("el-button"),c=a("el-drawer");return s(),i("div",le,[r("div",ie,[T(e.$slots,"config",{},void 0,!0)]),r("div",re,[T(e.$slots,"result",{},void 0,!0)]),t(h,{circle:"",class:"menu",onClick:n[0]||(n[0]=_=>e.drawer=!0)},{default:u(()=>[t(p,{icon:"fa-solid fa-magic"})]),_:1}),t(c,{modelValue:e.drawer,"onUpdate:modelValue":n[1]||(n[1]=_=>e.drawer=_),direction:"ltr","with-header":!1,size:"340px"},{default:u(()=>[T(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const ue=k(ne,[["render",ce],["__scopeId","data-v-fa61db7a"]]),de=b({name:"ModelSelector",components:{ElSelect:O,ElOption:F},data(){return{}},computed:{options(){return[{value:"minimax-t2v",label:this.$t("hailuo.button.model1")},{value:"minimax-i2v",label:this.$t("hailuo.button.model2")},{value:"minimax-i2v-director",label:this.$t("hailuo.button.model3")}]},value:{get(){return this.$store.state.hailuo?.config?.model},set(e){this.$store.commit("hailuo/setConfig",{...this.$store.state.hailuo?.config,model:e})}}},mounted(){this.value||(this.value=q)}}),me={class:"field"},pe={class:"title font-bold"},he={class:"float-left"};function fe(e,n,f,g,w,y){const p=a("el-option"),h=a("el-select");return s(),i("div",me,[r("h2",pe,o(e.$t("hailuo.name.model")),1),t(h,{modelValue:e.value,"onUpdate:modelValue":n[0]||(n[0]=c=>e.value=c),class:"value",placeholder:e.$t("hailuo.placeholder.select"),clearable:""},{default:u(()=>[(s(!0),i(C,null,G(e.options,c=>(s(),v(p,{key:c.value,label:c.label,value:c.value},{default:u(()=>[r("span",he,o(c.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const ge=k(de,[["render",fe],["__scopeId","data-v-a768fbd9"]]),_e=b({name:"StartImageUrlInput",components:{ElUpload:K,ElButton:E,InfoIcon:P,ImagePreview:J},mixins:[z],data(){return{fileList:[],uploadUrl:M()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e.url).filter(e=>e!==void 0)},value:{get(){return this.$store.state.hailuo?.config?.first_image_url},set(){const e=this.urls?.[0];this.$store.commit("hailuo/setConfig",{...this.$store.state.hailuo?.config,first_image_url:e})}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){V.warning(this.$t("hailuo.message.uploadStartImageExceed"))},onError(){V.error(this.$t("hailuo.message.uploadStartImageError"))},async onRemove(){V.error(this.$t("hailuo.message.uploadStartImageError"))},onSetStartImageUrl(){const e=this.urls?.[0];this.$store.commit("hailuo/setConfig",{...this.$store.state.hailuo?.config,first_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),$e={class:"relative"},ve={class:"flex justify-between"},be={class:"flex justify-start items-center"},ke={class:"text-sm font-bold"};function we(e,n,f,g,w,y){const p=a("info-icon"),h=a("image-preview"),c=a("el-button"),_=a("el-upload");return s(),i("div",$e,[r("div",ve,[r("div",be,[r("span",ke,o(e.$t("hailuo.name.startImageUrl")),1),t(p,{content:e.$t("hailuo.description.startImageUrl"),class:"info"},null,8,["content"])])]),t(_,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":n[0]||(n[0]=l=>e.fileList=l),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file","show-file-list":!0,limit:1,multiple:!1,"list-type":"picture",action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-remove":e.onRemove,"on-success":e.onSuccess,headers:e.headers},{file:u(({file:l})=>[l.url&&l.percentage!==void 0?(s(),v(h,{key:0,url:l.url,name:l.name,percentage:l.percentage,onRemove:$=>e.fileList.splice(e.fileList.indexOf(l),1)},null,8,["url","name","percentage","onRemove"])):m("",!0)]),default:u(()=>[t(c,{size:"small",type:"primary",class:"btn btn-upload",round:""},{default:u(()=>[d(o(e.$t("hailuo.button.uploadStartImageUrl")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-remove","on-success","headers"])])}const ye=k(_e,[["render",we],["__scopeId","data-v-48f4a681"]]),Ve="",Ee=b({name:"PromptInput",components:{ElInput:Q,InfoIcon:P},computed:{prompt:{get(){return this.$store.state.hailuo?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("hailuo/setConfig",{...this.$store.state.hailuo?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=Ve)}}),Se={class:"field"},Ie={class:"box"},Te={class:"title font-bold"};function Ce(e,n,f,g,w,y){const p=a("info-icon"),h=a("el-input");return s(),i("div",Se,[r("div",Ie,[r("h2",Te,o(e.$t("hailuo.name.prompt")),1),t(p,{content:e.$t("hailuo.description.prompt"),class:"info"},null,8,["content"])]),t(h,{modelValue:e.prompt,"onUpdate:modelValue":n[0]||(n[0]=c=>e.prompt=c),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("hailuo.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const Le=k(Ee,[["render",Ce],["__scopeId","data-v-c601bcba"]]),Ue=b({name:"PresetPanel",components:{ElButton:E,FontAwesomeIcon:L,PromptInput:Le,StartImageUrlInput:ye,ModelSelector:ge,Consumption:W},emits:["generate"],computed:{config(){return this.$store.state.hailuo?.config},consumption(){return X(this.config,this.service?.cost)},service(){return this.$store.state.hailuo?.service}},methods:{onGenerate(){this.$emit("generate")}}}),Ge={class:"flex flex-col h-full"},Pe={class:"flex-1 overflow-y-auto p-5"},Re={class:"flex flex-col items-center justify-center px-5 pb-5"};function Ae(e,n,f,g,w,y){const p=a("prompt-input"),h=a("model-selector"),c=a("start-image-url-input"),_=a("consumption"),l=a("font-awesome-icon"),$=a("el-button");return s(),i("div",Ge,[r("div",Pe,[t(p,{class:"mb-4"}),t(h,{class:"mb-4"}),e.config?.model==="minimax-i2v"?(s(),v(c,{key:0,class:"mb-2"})):m("",!0)]),r("div",Re,[t(_,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(s(),v($,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:u(()=>[t(l,{icon:"fa-solid fa-magic",class:"mr-2"}),d(" "+o(e.$t("hailuo.button.extend")),1)]),_:1},8,["onClick"])):(s(),v($,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:u(()=>[t(l,{icon:"fa-solid fa-magic",class:"mr-2"}),d(" "+o(e.$t("hailuo.button.generate")),1)]),_:1},8,["onClick"]))])])}const Me=k(Ue,[["render",Ae]]),De=b({name:"TaskPreview",components:{ElImage:oe,CopyToClipboard:Z,FontAwesomeIcon:L,ElAlert:te,VideoPlayer:x,ElTooltip:ee,ElButton:E},props:{modelValue:{type:Object,required:!0}},computed:{application(){return this.$store.state.hailuo?.application},config(){return this.$store.state.hailuo?.config},video(){return this.modelValue?.response?.data?.[0]}},methods:{onDownload(e){console.debug("on download hailuo video",e),window.open(e,"_blank")}}}),je={class:"preview"},Be={class:"left"},qe={class:"main"},Fe={class:"bot"},Oe={class:"datetime"},ze={class:"info"},Ne={key:0,class:"prompt mt-2"},He={key:0},Je={key:1},Ke={key:0,class:S({content:!0,failed:!0})},Qe={key:0,class:"mb-4"},We={key:1,class:S({operations:!0,"mt-2":!0})},Xe={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ye={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ze={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},xe={key:1,class:S({content:!0})},et={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},tt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ot={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},st={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},at={key:2,class:S({content:!0})},nt={class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function lt(e,n,f,g,w,y){const p=a("el-image"),h=a("video-player"),c=a("el-button"),_=a("el-tooltip"),l=a("font-awesome-icon"),$=a("copy-to-clipboard"),I=a("el-alert");return s(),i("div",je,[r("div",Be,[t(p,{src:"https://cdn.acedata.cloud/0qg4gp.png",class:"avatar"})]),r("div",qe,[r("div",Fe,[d(o(e.$t("hailuo.name.hailuoBot"))+" ",1),r("span",Oe,o(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),r("div",ze,[e.modelValue?.request?.prompt?(s(),i("p",Ne,[d(o(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?m("",!0):(s(),i("span",He," - ("+o(e.$t("hailuo.status.pending"))+") ",1)),e.video?.state==="processing"||e.video?.state==="pending"||e.video?.state==="running"?(s(),i("span",Je," - ("+o(e.$t("hailuo.status.processing"))+") ",1)):m("",!0)])):m("",!0)]),e.modelValue?.response?.success===!0?(s(),i("div",Ke,[e.video?.video_url?(s(),i("div",Qe,[t(h,{src:e.video?.video_url},null,8,["src"])])):m("",!0),e.video?(s(),i("div",We,[t(_,{class:"box-item",effect:"dark",content:e.$t("hailuo.message.downloadVideo"),placement:"top-start"},{default:u(()=>[e.video?.video_url?(s(),v(c,{key:0,type:"info",size:"small",class:"mb-2",onClick:n[0]||(n[0]=A(gt=>e.onDownload(e.video?.video_url),["stop"]))},{default:u(()=>[d(o(e.$t("hailuo.button.download")),1)]),_:1})):m("",!0)]),_:1},8,["content"])])):m("",!0),t(I,{closable:!1,class:"mt-2 success"},{default:u(()=>[e.modelValue?.request?.model?(s(),i("p",Xe,[t(l,{icon:"fa-solid fa-hashtag",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.model"))+": "+o(e.modelValue?.request?.model)+" ",1),t($,{content:e.modelValue?.id},null,8,["content"])])):m("",!0),r("p",Ye,[t(l,{icon:"fa-solid fa-magic",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),t($,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(s(),i("p",Ze,[t(l,{icon:"fa-solid fa-clock",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):m("",!0)]),_:1})])):m("",!0),e.modelValue?.response?.success===!1?(s(),i("div",xe,[t(I,{closable:!1,class:"failure"},{template:u(()=>[t(l,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.failure")),1)]),default:u(()=>[r("p",et,[t(l,{icon:"fa-solid fa-magic",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),t($,{content:e.modelValue?.id},null,8,["content"])]),r("p",tt,[t(l,{icon:"fa-solid fa-circle-info",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.failureReason"))+": "+o(e.modelValue?.response?.error?.message)+" ",1),t($,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(s(),i("p",ot,[t(l,{icon:"fa-solid fa-clock",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):m("",!0),r("p",st,[t(l,{icon:"fa-solid fa-hashtag",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),t($,{content:e.modelValue?.response?.trace_id},null,8,["content"])])]),_:1})])):m("",!0),e.modelValue?.response?.success===void 0?(s(),i("div",at,[t(I,{closable:!1,class:"info"},{template:u(()=>[t(l,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.failure")),1)]),default:u(()=>[r("p",nt,[t(l,{icon:"fa-solid fa-magic",class:"mr-1"}),d(" "+o(e.$t("hailuo.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),t($,{content:e.modelValue?.id},null,8,["content"])])]),_:1})])):m("",!0)])])}const it=k(De,[["render",lt],["__scopeId","data-v-1ff65585"]]),rt=b({name:"RecentPanel",components:{TaskPreview:it,BotPlaceholder:se,NoTasks:ae,ScrollList:N},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.hailuo?.tasks,items:this.$store.state.hailuo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),ct={key:0},ut={key:2,class:"w-full h-full flex items-center justify-center"};function dt(e,n,f,g,w,y){const p=a("bot-placeholder"),h=a("task-preview"),c=a("scroll-list"),_=a("no-tasks");return s(),i(C,null,[e.tasks?.items===void 0?(s(),i("div",ct,[t(p)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(s(),v(c,{key:1,ref:"scrollList",class:"tasks w-full h-full overflow-y-auto",loading:e.loading,onReachTop:n[0]||(n[0]=l=>e.$emit("reach-top"))},{default:u(()=>[(s(!0),i(C,null,G(e.tasks?.items,l=>(s(),v(h,{key:l.id,"model-value":l},null,8,["model-value"]))),128))]),_:1},8,["loading"])):m("",!0),e.tasks?.items?.length===0?(s(),i("div",ut,[t(_)])):m("",!0)],64)}const mt=k(rt,[["render",dt]]),pt=B("hailuo"),ht=b({name:"HailuoIndex",components:{ConfigPanel:Me,Layout:ue,RecentPanel:mt},inject:["initialized"],data(){return{task:void 0,job:0,timer:void 0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.hailuo?.status?.getApplications===U.Request},tasksLoading(){return this.$store.state.hailuo?.status?.getTasks===U.Request||this.fetchingTasks},credential(){return this.$store.state.hailuo.credential},config(){return this.$store.state.hailuo.config},application(){return this.$store.state.hailuo.application},tasks(){return this.$store.state.hailuo.tasks}},watch:{tasks:{handler(e,n){e?.items?.length>n?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await H({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("hailuo/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("hailuo/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:n=5,createdAtMin:f,createdAtMax:g}=e||{};console.debug("limit",n,"createdAtMin",f,"createdAtMax",g),this.fetchingTasks=!0;try{await this.$store.dispatch("hailuo/getTasks",{limit:n,createdAtMin:f,createdAtMax:g})}finally{this.fetchingTasks=!1}},async onGenerate(){const e={...this.config,callback_url:pt},n=this.credential?.token;if(!n){console.error("no token specified");return}V.info(this.$t("hailuo.message.startingTask")),D("hailuo",j.generate(e,{token:n})).then(()=>{V.success(this.$t("hailuo.message.startTaskSuccess"))}).catch(f=>{f?.response?.data?.error?.code===Y?V.error(this.$t("hailuo.message.usedUp")):V.error(this.$t("hailuo.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function ft(e,n,f,g,w,y){const p=a("config-panel"),h=a("recent-panel"),c=a("layout");return s(),v(c,null,{config:u(()=>[t(p,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:u(()=>[t(h,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const io=k(ht,[["render",ft]]);export{io as default};
@@ -0,0 +1 @@
1
+ import{F as C}from"./index.es-r9pvLLwr.js";import{E as q}from"./index-_HYMyS6B.js";import{E as N}from"./index-CptSkKy6.js";import{d as E,H as i,E as l,z as D,C as s,y as g,D as n,q as a,F as o,I as u,O as y,N as V,x as w,J as $,M as Z,Q as A}from"./vendor-vue-NSDaktjZ.js";import{G as k,bl as K,cQ as X,cR as H,cS as Q,cT as J,cU as Y,cV as ee,cW as te,cX as U,cY as z,cZ as G,c_ as P,c$ as se,d0 as O,d1 as oe,d2 as B,cr as ae,S as j,cs as ne}from"./index-Cxzu3p6D.js";import{I as L,S as re,l as le}from"./pagination-CZb0hbZ1.js";import{E as ie}from"./index-Bh_CWocK.js";import{p as ce}from"./pasteUploadMixin-BurWbGNQ.js";import{I as F}from"./ImagePreview-DlwroH_y.js";import{E as me}from"./index-DTShxeQ8.js";import{E as I}from"./index-CBfqsHGh.js";import{C as de}from"./Consumption-D8YBErjq.js";import{a as ue}from"./price-Gt41kpjf.js";import{E as x,a as W}from"./index-BoRxbdW2.js";import{E as pe}from"./index-C7RTFnM6.js";import{b as fe}from"./errorCode-Cqj9Td_Z.js";import{s as _e}from"./seedream-DK57LdMp.js";import{C as ge}from"./CopyToClipboard-BBeUorYq.js";import{I as he}from"./ImageWrapper-BtYQEZCS.js";import{E as $e}from"./index-CBQuA3gp.js";import{E as ve}from"./index-DeKlpOxv.js";import{E as be}from"./index-DacX-iLC.js";import{B as Ee}from"./BotPlaceholder-MWeT2hk0.js";import{N as ke}from"./NoTasks-Biw7HgNs.js";import"./use-form-item-ByR72rLs.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./typescript-xdzIxq8N.js";import"./index-Bmect7J5.js";import"./index-BMuncW0x.js";import"./index-B4loSzbq.js";import"./_baseClone-BxlA9WX_.js";import"./_Uint8Array-DFE3Z4no.js";import"./_initCloneObject-CciJTtIB.js";import"./isEqual-C-ffp0KB.js";import"./index-Bg7ZTTvi.js";import"./strings-beZM2Y-f.js";import"./castArray-DADNwHSf.js";import"./debounce-Diil38Ii.js";import"./_baseIteratee-BXXZkHgC.js";import"./index-BAA4zDOa.js";import"./index-Cu41y2Fl.js";import"./index-CsIY1sFD.js";const ye=E({name:"LayoutSeedream",components:{ElDrawer:N,ElButton:q,FontAwesomeIcon:C},data(){return{drawer:!1}}}),we={class:"main flex flex-row flex-1"},Se={class:"config w-[320px] h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},Ie={class:"result h-full p-6 flex-1 flex flex-col bg-[var(--app-content-bg)]"};function Ve(e,t,d,c,h,p){const f=n("font-awesome-icon"),_=n("el-button"),r=n("el-drawer");return a(),i("div",we,[l("div",Se,[D(e.$slots,"config",{},void 0,!0)]),l("div",Ie,[D(e.$slots,"result",{},void 0,!0)]),s(_,{circle:"",class:"menu",onClick:t[0]||(t[0]=m=>e.drawer=!0)},{default:g(()=>[s(f,{icon:"fa-solid fa-magic"})]),_:1}),s(r,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=m=>e.drawer=m),direction:"ltr","with-header":!1,size:"340px",class:"drawer"},{default:g(()=>[D(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Me=k(ye,[["render",Ve],["__scopeId","data-v-5ff0c320"]]),Ae="",Le=E({name:"SeedreamPromptInput",components:{ElInput:ie,InfoIcon:L},computed:{prompt:{get(){return this.$store.state.seedream?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=Ae)}}),Re={class:"field"},Te={class:"box"},Ce={class:"title font-bold"};function qe(e,t,d,c,h,p){const f=n("info-icon"),_=n("el-input");return a(),i("div",Re,[l("div",Te,[l("h2",Ce,o(e.$t("seedream.name.prompt")),1),s(f,{content:e.$t("seedream.description.prompt"),class:"info"},null,8,["content"])]),s(_,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=r=>e.prompt=r),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("seedream.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const De=k(Le,[["render",qe],["__scopeId","data-v-5559520a"]]),Ue=E({name:"SeedreamImageInput",components:{ElUpload:me,ElButton:q,InfoIcon:L,ImagePreview:F,FontAwesomeIcon:C},mixins:[ce],data(){return{fileList:[],uploadUrl:K()+"/api/v1/files/",suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.seedream?.config?.image}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){const c=(this.fileList||[]).filter(h=>!h?.response?.file_url);this.fileList=c.length?c:[];return}const t=[];e.forEach(c=>{const h=this.fileList.find(p=>p?.response?.file_url===c||p?.url===c);h?t.push(h):t.push({name:c.split("/").pop()||c,url:c,status:"success",percentage:100,response:{file_url:c}})}),(this.fileList||[]).filter(c=>!c?.response?.file_url).forEach(c=>{t.some(p=>p===c||p?.url===c?.url||p?.response?.file_url===c?.response?.file_url)||t.push(c)}),this.fileList=t}}},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url=="string"&&e.url.startsWith("blob:"))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImages()},onExceed(){I.warning(this.$t("seedream.message.uploadImageExceed"))},onError(){I.error(this.$t("seedream.message.uploadImageError"))},onSetImages(){const e=this.urls;this.suppressWatch=!0,this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,image:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImages()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url=="string"&&t.url.startsWith("blob:"))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImages()}}}),ze={class:"field"},Ge={class:"label"},Pe={class:"box"},Oe={class:"title font-bold"},je={class:"value"},Be={class:"file-list mt-2 flex flex-wrap gap-[10px]"};function Fe(e,t,d,c,h,p){const f=n("info-icon"),_=n("font-awesome-icon"),r=n("el-button"),m=n("el-upload"),b=n("image-preview");return a(),i(y,null,[l("div",ze,[l("div",Ge,[l("div",Pe,[l("h2",Oe,o(e.$t("seedream.name.imageUrls")),1),s(f,{content:e.$t("seedream.description.imageUrls"),class:"info"},null,8,["content"])])]),l("div",je,[s(m,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=v=>e.fileList=v),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",limit:14,multiple:!0,"show-file-list":!1,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,"on-change":e.onChange,"on-remove":e.onRemove,headers:e.headers},{default:g(()=>[s(r,{size:"small",type:"primary",round:""},{default:g(()=>[s(_,{icon:"fa-solid fa-upload",class:"mr-1"}),u(" "+o(e.$t("seedream.button.uploadImageUrls")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","on-change","on-remove","headers"])])]),l("div",Be,[(a(!0),i(y,null,V(e.fileList,(v,S)=>(a(),w(b,{key:v.uid||v?.response?.file_url||v.url||S,url:v.url||v?.response?.file_url,name:v.name,percentage:v.percentage,onRemove:R=>e.onRemovePreview(S,v)},null,8,["url","name","percentage","onRemove"]))),128))])],64)}const xe=k(Ue,[["render",Fe],["__scopeId","data-v-dc18c674"]]),We=E({name:"SeedreamModelSelector",components:{ElSelect:W,ElOption:x,InfoIcon:L},data(){return{options:[{value:H,label:this.$t("seedream.model.seedream50")},{value:Q,label:this.$t("seedream.model.seedream45")},{value:J,label:this.$t("seedream.model.seedream40")},{value:Y,label:this.$t("seedream.model.seedream30t2i")},{value:ee,label:this.$t("seedream.model.seededit30i2i")}]}},computed:{value:{get(){return this.$store.state.seedream?.config?.model},set(e){this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,model:e})}}},mounted(){this.value||(this.value=X)}}),Ne={class:"field"},Ze={class:"label"},Ke={class:"box"},Xe={class:"title font-bold"};function He(e,t,d,c,h,p){const f=n("info-icon"),_=n("el-option"),r=n("el-select");return a(),i("div",Ne,[l("div",Ze,[l("div",Ke,[l("h2",Xe,o(e.$t("seedream.name.model")),1),s(f,{content:e.$t("seedream.description.model"),class:"info"},null,8,["content"])])]),s(r,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=m=>e.value=m),class:"value",placeholder:e.$t("seedream.placeholder.select")},{default:g(()=>[(a(!0),i(y,null,V(e.options,m=>(a(),w(_,{key:m.value,label:m.label,value:m.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Qe=k(We,[["render",He],["__scopeId","data-v-609ade55"]]),Je=E({name:"SeedreamSizeSelector",components:{ElSelect:W,ElOption:x,InfoIcon:L},data(){return{options:[{value:U,label:U},{value:z,label:z},{value:G,label:G},{value:P,label:P}]}},computed:{value:{get(){return this.$store.state.seedream?.config?.size},set(e){this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,size:e})}}},mounted(){this.value||(this.value=te)}}),Ye={class:"field"},et={class:"label"},tt={class:"box"},st={class:"title font-bold"};function ot(e,t,d,c,h,p){const f=n("info-icon"),_=n("el-option"),r=n("el-select");return a(),i("div",Ye,[l("div",et,[l("div",tt,[l("h2",st,o(e.$t("seedream.name.size")),1),s(f,{content:e.$t("seedream.description.size"),class:"info"},null,8,["content"])])]),s(r,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=m=>e.value=m),class:"value",placeholder:e.$t("seedream.placeholder.select"),filterable:"","allow-create":"","default-first-option":""},{default:g(()=>[(a(!0),i(y,null,V(e.options,m=>(a(),w(_,{key:m.value,label:m.label,value:m.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const at=k(Je,[["render",ot],["__scopeId","data-v-44d5c9d9"]]),nt=E({name:"SeedreamMaxImagesSelector",components:{ElInputNumber:pe,InfoIcon:L},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return oe(this.config?.model)},referenceImageCount(){const e=this.config?.image;return Array.isArray(e)?e.length:0},effectiveMax(){const e=O-this.referenceImageCount;return Math.max(1,Math.min(O,e))},value:{get(){const e=this.config?.sequential_image_generation_options?.max_images;return typeof e=="number"&&e>=1?e:se},set(e){const t={...this.config||{}},d=Math.max(1,Math.min(this.effectiveMax,Math.floor(e||1)));d>1?(t.sequential_image_generation="auto",t.sequential_image_generation_options={...t.sequential_image_generation_options||{},max_images:d}):(t.sequential_image_generation="disabled",t.sequential_image_generation_options&&delete t.sequential_image_generation_options),this.$store.commit("seedream/setConfig",t)}}},watch:{supported:{immediate:!0,handler(e){if(e)return;const t={...this.config||{}};let d=!1;t.sequential_image_generation&&(delete t.sequential_image_generation,d=!0),t.sequential_image_generation_options&&(delete t.sequential_image_generation_options,d=!0),d&&this.$store.commit("seedream/setConfig",t)}},effectiveMax(e){this.value>e&&(this.value=e)}}}),rt={key:0,class:"field"},lt={class:"label"},it={class:"box"},ct={class:"title font-bold"},mt={class:"value"};function dt(e,t,d,c,h,p){const f=n("info-icon"),_=n("el-input-number");return e.supported?(a(),i("div",rt,[l("div",lt,[l("div",it,[l("h2",ct,o(e.$t("seedream.name.maxImages")),1),s(f,{content:e.$t("seedream.description.maxImages"),class:"info"},null,8,["content"])])]),l("div",mt,[s(_,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=r=>e.value=r),min:1,max:e.effectiveMax,step:1,size:"default","controls-position":"right",class:"counter"},null,8,["modelValue","max"])])])):$("",!0)}const ut=k(nt,[["render",dt],["__scopeId","data-v-17ef8d1a"]]),pt=E({name:"SeedreamConfigPanel",components:{ElButton:q,FontAwesomeIcon:C,PromptInput:De,Consumption:de,ImageInput:xe,ModelSelector:Qe,SizeSelector:at,MaxImagesSelector:ut},emits:["generate"],computed:{config(){return this.$store.state.seedream?.config},consumption(){const e={...this.config||{}},t=Array.isArray(e?.image)&&e.image.length>0,d=e?.sequential_image_generation==="auto"?Math.max(1,Math.floor(e?.sequential_image_generation_options?.max_images||1)):1;return ue({...e,action:t?"edit":"generate",model:B(e?.model),count:d},this.service?.cost)},service(){return this.$store.state.seedream?.service}},methods:{onGenerate(){this.$emit("generate")}}}),ft={class:"flex flex-col h-full"},_t={class:"flex-1 overflow-y-auto p-5"},gt={class:"flex flex-col items-center justify-center px-5 pb-5"};function ht(e,t,d,c,h,p){const f=n("model-selector"),_=n("size-selector"),r=n("max-images-selector"),m=n("prompt-input"),b=n("image-input"),v=n("consumption"),S=n("font-awesome-icon"),R=n("el-button");return a(),i("div",ft,[l("div",_t,[s(f,{class:"mb-4"}),s(_,{class:"mb-4"}),s(r,{class:"mb-4"}),s(m,{class:"mb-4"}),s(b,{class:"mb-4"})]),l("div",gt,[s(v,{value:e.consumption,service:e.service},null,8,["value","service"]),s(R,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:g(()=>[s(S,{icon:"fa-solid fa-magic",class:"mr-2"}),u(" "+o(e.$t("seedream.button.generate")),1)]),_:1},8,["onClick"])])])}const $t=k(pt,[["render",ht]]),vt=E({name:"SeedreamTaskPreview",components:{ElImage:be,CopyToClipboard:ge,FontAwesomeIcon:C,ElAlert:ve,ImageWrapper:he,ElButton:q,ElTooltip:$e,ImagePreview:F},props:{modelValue:{type:Object,required:!0}},computed:{isEdit(){return Array.isArray(this.modelValue?.request?.image)&&(this.modelValue?.request?.image?.length||0)>0},images(){const e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{e.push(t)}),e}},methods:{shortModel(e){return B(e)||e},onEdit(e){if(!e)return;console.debug("Edit image:",e);const t={...this.$store.state.seedream?.config||{}};t.image=[e],this.$store.commit("seedream/setConfig",t)}}}),bt={class:"preview"},Et={class:"left"},kt={class:"main"},yt={class:"bot"},wt={class:"datetime"},St={class:"info"},It={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},Vt={key:1,class:"prompt mt-2"},Mt={key:0},At={key:0,class:A({content:!0})},Lt={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Rt={key:1,class:A({content:!0,failed:!0})},Tt={class:"flex justify-start items-center gap-4 w-full overflow-x-auto"},Ct={class:A({operations:!0,"mt-2":!0,"mb-2":!0})},qt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Dt={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ut={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},zt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Gt={key:2,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Pt={key:3,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Ot={key:2,class:A({content:!0})},jt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Bt={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ft={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},xt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Wt={key:2,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Nt={key:3,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Zt={key:4,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Kt={key:3,class:A({content:!0})},Xt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ht={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Qt(e,t,d,c,h,p){const f=n("el-image"),_=n("image-preview"),r=n("font-awesome-icon"),m=n("copy-to-clipboard"),b=n("el-alert"),v=n("image-wrapper"),S=n("el-button"),R=n("el-tooltip");return a(),i("div",bt,[l("div",Et,[s(f,{src:"https://cdn.acedata.cloud/9egrbn.png",class:"avatar"})]),l("div",kt,[l("div",yt,[u(o(e.$t("seedream.name.seedreamBot"))+" ",1),l("span",wt,o(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),l("div",St,[Array.isArray(e.modelValue?.request?.image)&&e.modelValue?.request?.image.length>0?(a(),i("div",It,[(a(!0),i(y,null,V(e.modelValue?.request?.image,(M,T)=>(a(),w(_,{key:T,url:M,name:`image-${T+1}`,closable:!1},null,8,["url","name"]))),128))])):$("",!0),e.modelValue?.request?.prompt?(a(),i("p",Vt,[u(o(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?$("",!0):(a(),i("span",Mt," - ("+o(e.$t("seedream.status.pending"))+") ",1))])):$("",!0)]),e.modelValue?.response?e.modelValue?.response?.success===!0?(a(),i("div",Rt,[l("div",Tt,[(a(!0),i(y,null,V(e.images,(M,T)=>(a(),w(v,{key:T,src:M?.image_url,"raw-src":M?.image_url},null,8,["src","raw-src"]))),128))]),l("div",Ct,[s(R,{class:"box-item",effect:"dark",content:e.$t("common.button.edit"),placement:"top-start"},{default:g(()=>[s(S,{type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=Z(M=>e.onEdit(e.images?.[0]?.image_url),["stop"]))},{default:g(()=>[u(o(e.$t("common.button.edit")),1)]),_:1})]),_:1},8,["content"])]),s(b,{closable:!1,class:"mt-2 success"},{default:g(()=>[e.modelValue?.request?.model?(a(),i("p",qt,[s(r,{icon:"fa-solid fa-cube",class:"mr-1"}),u(" "+o(e.$t("seedream.name.model"))+": "+o(e.shortModel(e.modelValue?.request?.model)),1)])):$("",!0),e.modelValue?.request?.size?(a(),i("p",Dt,[s(r,{icon:"fa-solid fa-image",class:"mr-1"}),u(" "+o(e.$t("seedream.name.size"))+": "+o(e.modelValue?.request?.size),1)])):$("",!0),l("p",Ut,[s(r,{icon:"fa-solid fa-bolt",class:"mr-1"}),u(" "+o(e.$t("seedream.name.task"))+": "+o(e.isEdit?e.$t("seedream.name.edits"):e.$t("seedream.name.generate")),1)]),l("p",zt,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])]),e.modelValue?.elapsed?(a(),i("p",Gt,[s(r,{icon:"fa-solid fa-clock",class:"mr-1"}),u(" "+o(e.$t("seedream.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0),e.modelValue?.response?.trace_id?(a(),i("p",Pt,[s(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),u(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),s(m,{content:e.modelValue?.response?.trace_id,class:"btn-copy inline-block"},null,8,["content"])])):$("",!0)]),_:1})])):e.modelValue?.response?.success===!1?(a(),i("div",Ot,[s(b,{closable:!1,class:"failure"},{template:g(()=>[s(r,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),u(" "+o(e.$t("seedream.name.failure")),1)]),default:g(()=>[e.modelValue?.request?.model?(a(),i("p",jt,[s(r,{icon:"fa-solid fa-cube",class:"mr-1"}),u(" "+o(e.$t("seedream.name.model"))+": "+o(e.shortModel(e.modelValue?.request?.model)),1)])):$("",!0),e.modelValue?.request?.size?(a(),i("p",Bt,[s(r,{icon:"fa-solid fa-image",class:"mr-1"}),u(" "+o(e.$t("seedream.name.size"))+": "+o(e.modelValue?.request?.size),1)])):$("",!0),l("p",Ft,[s(r,{icon:"fa-solid fa-bolt",class:"mr-1"}),u(" "+o(e.$t("seedream.name.task"))+": "+o(e.isEdit?e.$t("seedream.name.edits"):e.$t("seedream.name.generate")),1)]),l("p",xt,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.response?.error?.message?(a(),i("p",Wt,[s(r,{icon:"fa-solid fa-circle-info",class:"mr-1"}),u(" "+o(e.$t("seedream.name.failureReason"))+": "+o(e.modelValue?.response?.error?.message)+" ",1),s(m,{content:e.modelValue?.response?.error?.message,class:"btn-copy"},null,8,["content"])])):$("",!0),e.modelValue?.elapsed?(a(),i("p",Nt,[s(r,{icon:"fa-solid fa-clock",class:"mr-1"}),u(" "+o(e.$t("seedream.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0),e.modelValue?.response?.trace_id?(a(),i("p",Zt,[s(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),u(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),s(m,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])):$("",!0)]),_:1})])):(a(),i("div",Kt,[s(b,{closable:!1,class:"info"},{template:g(()=>[s(r,{icon:"fa-solid fa-circle-info",class:"mr-1"}),u(" "+o(e.$t("seedream.name.status")),1)]),default:g(()=>[l("p",Xt,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.response?.trace_id?(a(),i("p",Ht,[s(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),u(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),s(m,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])):$("",!0)]),_:1})])):(a(),i("div",At,[s(b,{closable:!1,class:"info"},{template:g(()=>[s(r,{icon:"fa-regular fa-clock",class:"mr-1"}),u(" "+o(e.$t("seedream.status.pending")),1)]),default:g(()=>[l("p",Lt,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])])]),_:1})]))])])}const Jt=k(vt,[["render",Qt],["__scopeId","data-v-0dfc6a09"]]),Yt=E({name:"SeedreamRecentPanel",components:{TaskPreview:Jt,BotPlaceholder:Ee,NoTasks:ke,ScrollList:re},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],computed:{tasks(){return{...this.$store.state.seedream?.tasks,items:this.$store.state.seedream?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),es={key:0},ts={key:2,class:"w-full h-full flex items-center justify-center"};function ss(e,t,d,c,h,p){const f=n("bot-placeholder"),_=n("task-preview"),r=n("scroll-list"),m=n("no-tasks");return a(),i(y,null,[e.tasks?.items===void 0?(a(),i("div",es,[s(f)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(a(),w(r,{key:1,ref:"scrollList",class:"tasks h-full w-full overflow-y-auto",loading:e.loading,onReachTop:t[0]||(t[0]=b=>e.$emit("reach-top"))},{default:g(()=>[(a(!0),i(y,null,V(e.tasks?.items,b=>(a(),w(_,{key:b.id,"model-value":b},null,8,["model-value"]))),128))]),_:1},8,["loading"])):$("",!0),e.tasks?.items?.length===0?(a(),i("div",ts,[s(m)])):$("",!0)],64)}const os=k(Yt,[["render",ss]]),as=ne("seedream"),ns=E({name:"SeedreamIndex",components:{ConfigPanel:$t,Layout:Me,RecentPanel:os},inject:["initialized"],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.seedream?.status?.getApplications===j.Request},tasksLoading(){return this.$store.state.seedream?.status?.getTasks===j.Request},credential(){return this.$store.state.seedream?.credential},config(){return this.$store.state.seedream?.config},application(){return this.$store.state.seedream?.application},tasks(){return this.$store.state.seedream?.tasks}},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 le({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loading,setLoading:e=>this.loading=e,isBlocked:()=>this.tasksLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("seedream/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("seedream/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.tasksLoading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=20,createdAtMin:d,createdAtMax:c}=e||{};console.debug("limit",t,"createdAtMin",d,"createdAtMax",c),await this.$store.dispatch("seedream/getTasks",{limit:t,createdAtMin:d,createdAtMax:c})},async onGenerate(){const e={...this.config||{}};!(Array.isArray(e?.image)&&e.image.length>0)&&"image"in e&&delete e.image,e?.size||delete e.size;const d={...e,callback_url:as},c=this.credential?.token;if(!c){console.error("no token specified");return}I.info(this.$t("seedream.message.startingTask")),ae("seedream",_e.generate(d,{token:c})).then(()=>{I.success(this.$t("seedream.message.startTaskSuccess"))}).catch(h=>{const p=h?.response?.data;p?.error?.code===fe?I.error(this.$t("seedream.message.usedUp")):I.error(this.$t("seedream.message.startTaskFailed")+(p?.error?.message||""))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function rs(e,t,d,c,h,p){const f=n("config-panel"),_=n("recent-panel"),r=n("layout");return a(),w(r,null,{config:g(()=>[s(f,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:g(()=>[s(_,{ref:"recentPanel",loading:e.loading,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Js=k(ns,[["render",rs]]);export{Js as default};