@acedatacloud/nexior 3.118.0 → 3.120.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.
- package/dist/assets/{Auth-BmYIe6qv.js → Auth-CYwTo8qe.js} +1 -1
- package/dist/assets/{BotPlaceholder-DqIyF893.js → BotPlaceholder-BwOm41PC.js} +1 -1
- package/dist/assets/{Callback-DoyIsOlk.js → Callback-CCChHcZW.js} +1 -1
- package/dist/assets/{Console-DRzuRf8S.js → Console-DgDBUubm.js} +1 -1
- package/dist/assets/{Consumption-BakyhCvI.js → Consumption-CZlzOFr-.js} +1 -1
- package/dist/assets/{Conversation-CECW65Zm.js → Conversation-DnJbc6Kw.js} +1 -1
- package/dist/assets/{CopyToClipboard-5g7lxAq1.js → CopyToClipboard-cz_FV7JQ.js} +1 -1
- package/dist/assets/{Detail-jCclKpMJ.js → Detail-D27_WuAD.js} +2 -2
- package/dist/assets/{EditArray-CE7uEg1C.js → EditArray-D7UKPefl.js} +1 -1
- package/dist/assets/{Extra-BZMuF4mq.js → Extra-kMzRXjay.js} +1 -1
- package/dist/assets/{FilePreview-Cw3KlBth.js → FilePreview-rb8o7Jwl.js} +1 -1
- package/dist/assets/{History-BU4KY0kt.js → History-BlXAIwHy.js} +1 -1
- package/dist/assets/{IconPark.vue_vue_type_script_setup_true_lang-D44ASjV4.js → IconPark.vue_vue_type_script_setup_true_lang-AVySoCwx.js} +1 -1
- package/dist/assets/{ImagePreview-BGS979RH.js → ImagePreview-CiFwyV10.js} +1 -1
- package/dist/assets/{ImageWrapper-6J7_ulX0.js → ImageWrapper-s0bq8vjW.js} +1 -1
- package/dist/assets/{Index-BPEAFJi-.js → Index--Cm0kCFO.js} +1 -1
- package/dist/assets/{Index-RCOtIT_Q.css → Index-BA8_9CQm.css} +1 -1
- package/dist/assets/{Index-HJSBx-At.js → Index-BBt2_8-s.js} +1 -1
- package/dist/assets/{Index-D-hCZPHx.js → Index-BE-Nx8rh.js} +1 -1
- package/dist/assets/{Index-BEqigbaz.js → Index-BKkzEbRa.js} +1 -1
- package/dist/assets/{Index-DRSoYNKJ.js → Index-Ba3u3B_x.js} +1 -1
- package/dist/assets/{Index-BZ7vlUqr.js → Index-BlQxYaQr.js} +1 -1
- package/dist/assets/{Index-DybbBd4T.js → Index-BwP8LiPg.js} +1 -1
- package/dist/assets/{Index-DKIrxd_q.js → Index-BxhicRkL.js} +1 -1
- package/dist/assets/{Index-cPPRtoM3.js → Index-C4gqvdPj.js} +1 -1
- package/dist/assets/{Index-CutKcZ7C.js → Index-C8VwXS0K.js} +1 -1
- package/dist/assets/{Index-CKSHcvGg.js → Index-CIsYHTXn.js} +1 -1
- package/dist/assets/{Index-Crfmld95.js → Index-CZzIt3NW.js} +1 -1
- package/dist/assets/{Index-BiQq1uP0.js → Index-CsiRcHQb.js} +1 -1
- package/dist/assets/{Index-BTzPkLA7.js → Index-CuNdVoF2.js} +1 -1
- package/dist/assets/{Index-D6uCeYhw.js → Index-D4KSe4PY.js} +1 -1
- package/dist/assets/{Index-BJG7rSJr.js → Index-DFe7Pl6m.js} +1 -1
- package/dist/assets/{Index-CN90lo0D.js → Index-DNZoq2a8.js} +1 -1
- package/dist/assets/{Index-CcvV_iY4.js → Index-DNdv2MZY.js} +1 -1
- package/dist/assets/{Index-J3gULBgj.js → Index-DakZs-ES.js} +1 -1
- package/dist/assets/{Index-CckS4kwl.js → Index-DzhD805f.js} +1 -1
- package/dist/assets/{Index-C2NPOh9g.js → Index-epHano7b.js} +1 -1
- package/dist/assets/Index-iQhmjlvE.js +1 -0
- package/dist/assets/{Index-8_FZs6Up.js → Index-vGOvv8iv.js} +1 -1
- package/dist/assets/{Index-DdF1Q4ic.js → Index-zSdwXPoC.js} +1 -1
- package/dist/assets/{Invitees-BbN8upCc.js → Invitees-XSKA2QJ-.js} +1 -1
- package/dist/assets/{List-ga6J2NGy.js → List-CAhthWWR.js} +1 -1
- package/dist/assets/{List-Bugm9ia8.js → List-CcqjYwhk.js} +1 -1
- package/dist/assets/{List-DzlgMJd1.js → List-DLPc5-69.js} +1 -1
- package/dist/assets/{Main-BZCjx_OM.js → Main-C-J7tl22.js} +1 -1
- package/dist/assets/{Navigator-DAd1dmYu.js → Navigator-MOwwsx7l.js} +1 -1
- package/dist/assets/{NoTasks-C5sE70CP.js → NoTasks-CNRFrdHu.js} +1 -1
- package/dist/assets/{NotFound-D7t9JPVd.js → NotFound-CFvNC29d.js} +1 -1
- package/dist/assets/{OAuthCallback-C--UOgDI.js → OAuthCallback-CmijAbLX.js} +1 -1
- package/dist/assets/{Pagination-Cx1fUJBk.js → Pagination-C8NwbK5Q.js} +1 -1
- package/dist/assets/{ScrollList-CovUKJRB.js → ScrollList-BBAzavyB.js} +1 -1
- package/dist/assets/{Status-CFh4F4qR.js → Status-C3r_aXgc.js} +1 -1
- package/dist/assets/{Subscribe-DCIcUfDh.js → Subscribe-StRjks43.js} +1 -1
- package/dist/assets/{TransportWebHID-ZDWBOufY.js → TransportWebHID-C2zxxAcY.js} +1 -1
- package/dist/assets/{VideoPlayer-DO0mQYq7.js → VideoPlayer-qCvWONkJ.js} +1 -1
- package/dist/assets/{_Uint8Array-CRruIzWx.js → _Uint8Array-Bq4W_aZw.js} +1 -1
- package/dist/assets/{_baseClone-c0H4QFpc.js → _baseClone-C0vKZ-2x.js} +1 -1
- package/dist/assets/{_baseIteratee-BP4ZRuLO.js → _baseIteratee-SXAlbslK.js} +1 -1
- package/dist/assets/{_initCloneObject-zrgKx4gY.js → _initCloneObject-nuejNsVF.js} +1 -1
- package/dist/assets/{add-Cb597n36.js → add-Dgk0WyjZ.js} +1 -1
- package/dist/assets/{all-wallets-IbE27jUn.js → all-wallets-3-hlYecl.js} +1 -1
- package/dist/assets/{app-store-DIQjzIb3.js → app-store-pBS3SQuq.js} +1 -1
- package/dist/assets/{apple-DN1NnQCF.js → apple-UJs1ZJkk.js} +1 -1
- package/dist/assets/{arrow-bottom-V6VSQgkg.js → arrow-bottom-CSK9z26u.js} +1 -1
- package/dist/assets/{arrow-bottom-circle-BvW84QO_.js → arrow-bottom-circle-D8bZK49i.js} +1 -1
- package/dist/assets/{arrow-left-CBtE2Txw.js → arrow-left-B2gK8CY3.js} +1 -1
- package/dist/assets/{arrow-right-DOWHXe1i.js → arrow-right-BcfzqA1e.js} +1 -1
- package/dist/assets/{arrow-top-DQxtYpBm.js → arrow-top-COa59CRx.js} +1 -1
- package/dist/assets/{avatar-DyMz4wGA.js → avatar-y_WWWaNU.js} +1 -1
- package/dist/assets/{bank-DdiWrbaf.js → bank-B_5OXJj_.js} +1 -1
- package/dist/assets/{basic-DQDrVtAG.js → basic-BaFuzVTq.js} +1 -1
- package/dist/assets/{browser-CMG1gd9x.js → browser-Dp2I4cjO.js} +1 -1
- package/dist/assets/{byokCredential-1ICPIwRi.js → byokCredential-Bgoo1msw.js} +1 -1
- package/dist/assets/{card-CY8tJhzs.js → card-hWQlNnl9.js} +1 -1
- package/dist/assets/{castArray-CeKiSygi.js → castArray-DrkJhRjQ.js} +1 -1
- package/dist/assets/{chat-hLBuCWzV.js → chat-nROAeDHL.js} +1 -1
- package/dist/assets/{checkmark-q-m5agxr.js → checkmark-4tnh7ZB3.js} +1 -1
- package/dist/assets/{checkmark-bold-BoNbmeDY.js → checkmark-bold-C9aqJFPA.js} +1 -1
- package/dist/assets/{chevron-bottom-ClP_2d_y.js → chevron-bottom-CKIYI4Ta.js} +1 -1
- package/dist/assets/{chevron-left-DTK1Yuln.js → chevron-left-CVrOmnvm.js} +1 -1
- package/dist/assets/{chevron-right-D0e7wH3b.js → chevron-right-DilwuAjY.js} +1 -1
- package/dist/assets/{chevron-top-8iCfLHM0.js → chevron-top-KC0_chEz.js} +1 -1
- package/dist/assets/{chrome-store-Ux6rItCd.js → chrome-store-BYUFhubi.js} +1 -1
- package/dist/assets/{clock-t3W1BXIh.js → clock-CAG3zRUS.js} +1 -1
- package/dist/assets/{close-BNuVA1uW.js → close-Ae3h9tf8.js} +1 -1
- package/dist/assets/{coinPlaceholder-CKSUf2iq.js → coinPlaceholder-CBkkFw4k.js} +1 -1
- package/dist/assets/{compass-2e128Rc8.js → compass-CMtty40M.js} +1 -1
- package/dist/assets/{copy-UaYt2SM1.js → copy-DyX72FTV.js} +1 -1
- package/dist/assets/{cursor-gJFN5iNw.js → cursor-CMc9wx_C.js} +1 -1
- package/dist/assets/{cursor-transparent-BRdK38hS.js → cursor-transparent-BCbpx56B.js} +1 -1
- package/dist/assets/{debounce-CoHXkWvt.js → debounce-B-0O6GZN.js} +1 -1
- package/dist/assets/{desktop-Bacat95K.js → desktop-CHj-uIA5.js} +1 -1
- package/dist/assets/{disconnect-DXkXFG-0.js → disconnect-BWhX0KIA.js} +1 -1
- package/dist/assets/{discord-CBcF2jgb.js → discord-CjEJ9rKg.js} +1 -1
- package/dist/assets/{distribution-Dok39KoO.js → distribution-BvrzxvYQ.js} +1 -1
- package/dist/assets/{dropdown-Cqvd8OOk.js → dropdown-Bb6oEVvP.js} +1 -1
- package/dist/assets/{etherscan-DcbI3RD2.js → etherscan-B64vUbSg.js} +1 -1
- package/dist/assets/{exclamation-triangle-Cp7PbNzW.js → exclamation-triangle-CB0-aIkB.js} +1 -1
- package/dist/assets/{extension-Cvn9hZcr.js → extension-JAF_QUt4.js} +1 -1
- package/dist/assets/{external-link-CC13l5Tt.js → external-link-Du8Af-Dj.js} +1 -1
- package/dist/assets/{facebook-BZv4k1bQ.js → facebook-BRdOHyhP.js} +1 -1
- package/dist/assets/{farcaster-034v1_fW.js → farcaster-BEz-HhTT.js} +1 -1
- package/dist/assets/{filters-FhCeIs4L.js → filters-Jv7GgXxn.js} +1 -1
- package/dist/assets/{flux-D0uLe2q_.js → flux-XleATL1u.js} +1 -1
- package/dist/assets/{github-BBXfS72c.js → github-CDZ1MlYy.js} +1 -1
- package/dist/assets/{google-stvxMwuS.js → google-CDrPUpvC.js} +1 -1
- package/dist/assets/{hailuo-DMp5cpnx.js → hailuo-BHyeB8iZ.js} +1 -1
- package/dist/assets/{headshots-2vMYlO90.js → headshots-B1Qvwswm.js} +1 -1
- package/dist/assets/{help-circle-BXW-1Ev9.js → help-circle-D7pkLN5j.js} +1 -1
- package/dist/assets/{id-DEjxsE4C.js → id-CGKftV8s.js} +1 -1
- package/dist/assets/{image-C8WkDWXs.js → image-YTdHUKL7.js} +1 -1
- package/dist/assets/{index-UaPXRl1u.js → index-0E3f8li8.js} +1 -1
- package/dist/assets/{index-BVYzn_oH.js → index-2g3eXsX4.js} +1 -1
- package/dist/assets/{index-8I9Xnblb.js → index-6JTB3PN2.js} +1 -1
- package/dist/assets/{index-Bs5rZiQM.js → index-6ULnuOMT.js} +1 -1
- package/dist/assets/{index-BTOLjvOo.js → index-B4PZq0-5.js} +1 -1
- package/dist/assets/{index-EDbdzYoK.js → index-B8NIXFXV.js} +3 -3
- package/dist/assets/{index-CU2U6n6t.js → index-B8fS9OSz.js} +1 -1
- package/dist/assets/{index-CrqDHQpz.js → index-B8kQljtZ.js} +1 -1
- package/dist/assets/{index-gKQ7GRqc.js → index-BMtDvXOO.js} +1 -1
- package/dist/assets/{index-D91I83SS.js → index-BQHpaNbw.js} +1 -1
- package/dist/assets/{index-CLBd6Tdd.js → index-BW0F2mHg.js} +1 -1
- package/dist/assets/{index-CSFjwfq-.js → index-BX73fyko.js} +1 -1
- package/dist/assets/{index-C3VQA1j1.js → index-BbkShjM6.js} +1 -1
- package/dist/assets/{index-CipihCqd.js → index-BdOrPkLK.js} +1 -1
- package/dist/assets/{index-DaQNHQUe.js → index-Bh0oZ9mi.js} +1 -1
- package/dist/assets/{index-DPUTXoQP.js → index-BibFvigx.js} +1 -1
- package/dist/assets/{index-BeWHkqSq.js → index-BieaRbcT.js} +1 -1
- package/dist/assets/{index-SY6waAaY.js → index-Bj2Qe7eT.js} +1 -1
- package/dist/assets/{index-JNYacQYq.js → index-BlaGrXYB.js} +1 -1
- package/dist/assets/{index-BkplJ7VJ.js → index-Bqsj8YvH.js} +6 -6
- package/dist/assets/{index-SooLWIlL.js → index-Bw530iUN.js} +1 -1
- package/dist/assets/{index-y0MqgLAp.js → index-BzKWMJA1.js} +3 -3
- package/dist/assets/{index-BlU0CedW.js → index-BzitVkNO.js} +1 -1
- package/dist/assets/{index-DhM_eB5T.js → index-C--_aDZb.js} +1 -1
- package/dist/assets/{index-BQJNMaIS.js → index-C1aEEHjh.js} +1 -1
- package/dist/assets/{index-DkM4K-wL.js → index-C3qbB2R4.js} +1 -1
- package/dist/assets/{index-gCyXhWG3.js → index-CAORddym.js} +1 -1
- package/dist/assets/{index-D91uKTD2.js → index-CBuVdRox.js} +1 -1
- package/dist/assets/{index-yPnDviqN.js → index-CCGOGjU5.js} +1 -1
- package/dist/assets/{index-CRx3Uhyj.js → index-CEErdlw2.js} +1 -1
- package/dist/assets/{index-CKOiAcBf.js → index-CLwZ6tD6.js} +1 -1
- package/dist/assets/{index-93XHy9Lx.js → index-CaGzZRoU.js} +1 -1
- package/dist/assets/{index-RS4-DC1h.js → index-CaJEx1sk.js} +1 -1
- package/dist/assets/{index-Ds9jhuB5.js → index-CcYxepTP.js} +1 -1
- package/dist/assets/{index-DZEJeNNH.js → index-Chv58u_M.js} +1 -1
- package/dist/assets/{index-B2_Pxf0k.js → index-Ckc_ntxz.js} +1 -1
- package/dist/assets/{index-tCoyl_xR.js → index-CkzwyQNU.js} +1 -1
- package/dist/assets/{index-jajVVnQ6.js → index-CqREBSIJ.js} +1 -1
- package/dist/assets/{index-D6ZTnX5Z.js → index-Cq_8nzqD.js} +1 -1
- package/dist/assets/{index-BqxJJthV.js → index-CsMsHthC.js} +1 -1
- package/dist/assets/{index-DoFKl5pm.js → index-CvlJmgAe.js} +1 -1
- package/dist/assets/{index-CGQV6ZLE.js → index-CzdTh66J.js} +1 -1
- package/dist/assets/{index-aVrSV2zx.js → index-D0p0AKt5.js} +1 -1
- package/dist/assets/{index-BCaOmwk2.js → index-D1BcqPOp.js} +1 -1
- package/dist/assets/{index-68PsVyJ2.js → index-D2epQ7R-.js} +1 -1
- package/dist/assets/{index-5H0Kze44.js → index-D2kYsNjd.js} +1 -1
- package/dist/assets/{index-C_MdcdVu.js → index-D86izC-h.js} +1 -1
- package/dist/assets/{index-DxblRLq7.js → index-DIHp8_U3.js} +1 -1
- package/dist/assets/{index-74s3nMyr.js → index-DJBaHoyj.js} +1 -1
- package/dist/assets/{index-Ckk9018y.js → index-DlZ-gpNs.js} +1 -1
- package/dist/assets/{index-BCVoAx7I.js → index-DniJBKnP.js} +1 -1
- package/dist/assets/{index-Bh_bEklr.js → index-DofykL40.js} +1 -1
- package/dist/assets/{index-8bx_5fOT.js → index-Dzmy_VcW.js} +1 -1
- package/dist/assets/{index-YeTjonVA.js → index-EOM9W62e.js} +1 -1
- package/dist/assets/{index-BrEa1c2p.js → index-IAptVusO.js} +1 -1
- package/dist/assets/{index-B68rTlxx.js → index-J1NaSPzr.js} +1 -1
- package/dist/assets/{index-ByxnnMNj.js → index-NPlB18tY.js} +1 -1
- package/dist/assets/{index-Ivkf5S3v.js → index-PVyd_UEc.js} +1 -1
- package/dist/assets/{index-DSt-jOkh.js → index-T3OpeE-1.js} +1 -1
- package/dist/assets/{index-MGZWwLx2.js → index-XCa7Ic7m.js} +1 -1
- package/dist/assets/{index-l-4qvBYE.js → index-qLx3hags.js} +1 -1
- package/dist/assets/{index.browser.esm-InCDsPou.js → index.browser.esm-D56QnXXy.js} +1 -1
- package/dist/assets/{index.es-DvoJym95.js → index.es-B8UAYPlu.js} +1 -1
- package/dist/assets/{info-DIb2H6YO.js → info-C0HWZ4h2.js} +1 -1
- package/dist/assets/{info-circle-BsoxXFXi.js → info-circle-DiJteffC.js} +1 -1
- package/dist/assets/{isEqual-DM0CxUu8.js → isEqual-CBKi-9mc.js} +1 -1
- package/dist/assets/{isPlainObject-WAUloOqg.js → isPlainObject-BwRYDkva.js} +1 -1
- package/dist/assets/{kling-B2WY_1is.js → kling-vFvGbyt0.js} +1 -1
- package/dist/assets/{lightbulb-spmgczGw.js → lightbulb-C4LRkde8.js} +1 -1
- package/dist/assets/{luma-Bx7X1hwN.js → luma-CUmCSNXw.js} +1 -1
- package/dist/assets/{mail-CJXrup9F.js → mail-DENHAVbZ.js} +1 -1
- package/dist/assets/{midjourney-BzGduqca.js → midjourney-DuMuF_ms.js} +1 -1
- package/dist/assets/{mobile-DFzNxY0n.js → mobile-BWTGsks8.js} +1 -1
- package/dist/assets/{more-BrHcyJPb.js → more-B20QHncQ.js} +1 -1
- package/dist/assets/{nanobanana-Buh4yZAX.js → nanobanana-D4DjlkFJ.js} +1 -1
- package/dist/assets/{network-placeholder-0dPt5suV.js → network-placeholder-bBOUjnB8.js} +1 -1
- package/dist/assets/{nftPlaceholder-Dlfcu9Gl.js → nftPlaceholder-CYiwjkHI.js} +1 -1
- package/dist/assets/{off-C3NQf72-.js → off-B7KKfCGK.js} +1 -1
- package/dist/assets/{openaiimage-CY0s2KkR.js → openaiimage-CTSU6NNS.js} +1 -1
- package/dist/assets/{order-DWL-qm4_.js → order-CQEKyshR.js} +1 -1
- package/dist/assets/{pika-BBlWpE9S.js → pika-CBMNxppT.js} +1 -1
- package/dist/assets/{pixverse-8d8-XO89.js → pixverse-mBArFZL2.js} +1 -1
- package/dist/assets/{play-store-Oo3-RqGz.js → play-store-DeT9CSEu.js} +1 -1
- package/dist/assets/{plus-C40Oj1IQ.js → plus-jluAoG4e.js} +1 -1
- package/dist/assets/{price-BA67S4AC.js → price-BdhJYmzp.js} +1 -1
- package/dist/assets/{producer-BKIvC5XG.js → producer-CRNJNhmQ.js} +1 -1
- package/dist/assets/{qr-code-uJzETDPZ.js → qr-code-Bh0zBpXx.js} +1 -1
- package/dist/assets/{qrart-B82OSLjf.js → qrart-UTN3rBYb.js} +1 -1
- package/dist/assets/{recycle-horizontal-D2KNL_Z9.js → recycle-horizontal-DSqLqSsR.js} +1 -1
- package/dist/assets/{refresh-uZz7EsV1.js → refresh-fbnzdu8X.js} +1 -1
- package/dist/assets/{reown-logo-C-Z1JJ4r.js → reown-logo-BTZrJ6f7.js} +1 -1
- package/dist/assets/{search-CBQ-Ssew.js → search-DNl8TDYJ.js} +1 -1
- package/dist/assets/{secp256k1-BJvrEDLz.js → secp256k1-aX_4rIwp.js} +1 -1
- package/dist/assets/{secp256k1-CuFyLRCT.js → secp256k1-bXwES021.js} +1 -1
- package/dist/assets/{seedance-Dz1Kl-WZ.js → seedance-B9w3dL_0.js} +1 -1
- package/dist/assets/{seedream-CR1mIvh1.js → seedream-CZ2kWGod.js} +1 -1
- package/dist/assets/{send-DUs-C_nT.js → send-DRJuzVpC.js} +1 -1
- package/dist/assets/{service-Xra-4UbK.js → service-D4ha82q6.js} +1 -1
- package/dist/assets/{solana-wallets-DbujC_0Z.js → solana-wallets-CpKTeVOj.js} +2 -2
- package/dist/assets/{solana-wallets-vue-Cc5WVSup.js → solana-wallets-vue-BkbbmCud.js} +1 -1
- package/dist/assets/{solanaEmbed.esm-DGKr7BHc.js → solanaEmbed.esm-m_tjbQuf.js} +1 -1
- package/dist/assets/{sora-DejxsHeB.js → sora-y39z0JOe.js} +1 -1
- package/dist/assets/{string_decoder-Bu7epOcB.js → string_decoder-DZHdHQp8.js} +1 -1
- package/dist/assets/{suno-C223Uz4o.js → suno-DJee24J_.js} +1 -1
- package/dist/assets/{swapHorizontal-CbJfWZEf.js → swapHorizontal-KMxZJsyw.js} +1 -1
- package/dist/assets/{swapHorizontalBold-CaG1nu1Y.js → swapHorizontalBold-CLNaouyi.js} +1 -1
- package/dist/assets/{swapHorizontalMedium-te2ySBWu.js → swapHorizontalMedium-DnmxZCZ6.js} +1 -1
- package/dist/assets/{swapHorizontalRoundedBold-Bwo96K-h.js → swapHorizontalRoundedBold-mXwUw7O1.js} +1 -1
- package/dist/assets/{swapVertical-TOwHnH9i.js → swapVertical-BFRDehmW.js} +1 -1
- package/dist/assets/{telegram-CDo_ZcjQ.js → telegram-DJpglsCT.js} +1 -1
- package/dist/assets/{three-dots-D0-bRNhm.js → three-dots-BBCYc6iX.js} +1 -1
- package/dist/assets/{twitch-DC4UKJ4t.js → twitch-CBc0_I84.js} +1 -1
- package/dist/assets/{twitterIcon-DTxtH5_L.js → twitterIcon-BPohEgWI.js} +1 -1
- package/dist/assets/{typescript-D6u-C9xv.js → typescript-kbBRrRi0.js} +1 -1
- package/dist/assets/{use-form-item-D2iN_ybD.js → use-form-item-Bsmkxazb.js} +1 -1
- package/dist/assets/validator-CUXs2Jta.js +1 -0
- package/dist/assets/{veo-C5cgHA5F.js → veo-Belt7kFg.js} +1 -1
- package/dist/assets/{verify-filled-BsRHBOVf.js → verify-filled-DfdsMKQo.js} +1 -1
- package/dist/assets/{verify-DEDrcDYl.js → verify-o7J-JiWe.js} +1 -1
- package/dist/assets/{w3m-modal-BiGWm6ZO.js → w3m-modal-BFcwqgiy.js} +1 -1
- package/dist/assets/{wallet-CBDY64H8.js → wallet-G4c8j8-r.js} +1 -1
- package/dist/assets/{wallet-placeholder-DcsWsIpu.js → wallet-placeholder-CAhGKRqm.js} +1 -1
- package/dist/assets/{walletconnect-gt7Gk4En.js → walletconnect-CRC7hA_P.js} +1 -1
- package/dist/assets/{wan-CUnVCPee.js → wan-DXqU5Jet.js} +1 -1
- package/dist/assets/{warning-circle-BRgH8Mn7.js → warning-circle-ChBhOOPs.js} +1 -1
- package/dist/assets/{web-C1MXKFkv.js → web-DXzx1W8-.js} +1 -1
- package/dist/assets/{web-M90bTvjp.js → web-yJ9XmF7F.js} +1 -1
- package/dist/assets/{x-BJs3xBR-.js → x-DDx_nQY_.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/Index-P-wMm6AI.js +0 -1
- package/dist/assets/validator-jTFG2Dtu.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as A}from"./index.es-DvoJym95.js";import{E as M}from"./index-CrqDHQpz.js";import{E as N}from"./index-CipihCqd.js";import{d as k,H as l,E as c,z as D,C as t,y as _,D as n,q as a,F as o,I as m,O as E,N as I,x as w,J as $,M as W,Q as R}from"./vendor-vue-DU0w5ewx.js";import{E as y,b1 as H,co as K,cp as Z,cq as J,cr as Q,cs as X,ct as Y,cu as U,cv as q,cw as G,cx as j,ap as P}from"./index-EDbdzYoK.js";import{I as C,S as x}from"./ScrollList-CovUKJRB.js";import{E as ee}from"./index-DkM4K-wL.js";import{p as te}from"./pasteUploadMixin-BurWbGNQ.js";import{I as O}from"./ImagePreview-BGS979RH.js";import{E as se}from"./index-5H0Kze44.js";import{E as V}from"./index-Ds9jhuB5.js";import{C as oe}from"./Consumption-BakyhCvI.js";import{a as ae}from"./price-BA67S4AC.js";import{E as B,a as F}from"./index-JNYacQYq.js";import{b as ne}from"./errorCode-Cqj9Td_Z.js";import{s as re}from"./seedream-CR1mIvh1.js";import{C as le}from"./CopyToClipboard-5g7lxAq1.js";import{I as ie}from"./ImageWrapper-6J7_ulX0.js";import{E as ce}from"./index-l-4qvBYE.js";import{E as de}from"./index-BqxJJthV.js";import{E as me}from"./index-BlU0CedW.js";import{B as ue}from"./BotPlaceholder-DqIyF893.js";import{N as pe}from"./NoTasks-C5sE70CP.js";import"./use-form-item-D2iN_ybD.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-Cvgzdobq.js";import"./vendor-vue-router-9TBHB1ku.js";import"./typescript-D6u-C9xv.js";import"./index-Ckk9018y.js";import"./index-tCoyl_xR.js";import"./index-D6ZTnX5Z.js";import"./_baseClone-c0H4QFpc.js";import"./_Uint8Array-CRruIzWx.js";import"./_initCloneObject-zrgKx4gY.js";import"./isEqual-DM0CxUu8.js";import"./index-CRx3Uhyj.js";import"./strings-DigWlKo9.js";import"./castArray-CeKiSygi.js";import"./debounce-CoHXkWvt.js";import"./_baseIteratee-BP4ZRuLO.js";import"./index-DPUTXoQP.js";import"./index-BrEa1c2p.js";const fe=k({name:"LayoutSeedream",components:{ElDrawer:N,ElButton:M,FontAwesomeIcon:A},data(){return{drawer:!1}}}),he={class:"main flex flex-row flex-1"},_e={class:"config w-[320px] h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},ge={class:"result h-full p-6 flex-1 flex flex-col bg-[var(--app-content-bg)]"};function $e(e,s,g,i,u,p){const f=n("font-awesome-icon"),h=n("el-button"),r=n("el-drawer");return a(),l("div",he,[c("div",_e,[D(e.$slots,"config",{},void 0,!0)]),c("div",ge,[D(e.$slots,"result",{},void 0,!0)]),t(h,{circle:"",class:"menu",onClick:s[0]||(s[0]=d=>e.drawer=!0)},{default:_(()=>[t(f,{icon:"fa-solid fa-magic"})]),_:1}),t(r,{modelValue:e.drawer,"onUpdate:modelValue":s[1]||(s[1]=d=>e.drawer=d),direction:"ltr","with-header":!1,size:"340px",class:"drawer"},{default:_(()=>[D(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const ve=y(fe,[["render",$e],["__scopeId","data-v-5ff0c320"]]),be="",ke=k({name:"SeedreamPromptInput",components:{ElInput:ee,InfoIcon:C},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=be)}}),ye={class:"field"},Ee={class:"box"},we={class:"title font-bold"};function Se(e,s,g,i,u,p){const f=n("info-icon"),h=n("el-input");return a(),l("div",ye,[c("div",Ee,[c("h2",we,o(e.$t("seedream.name.prompt")),1),t(f,{content:e.$t("seedream.description.prompt"),class:"info"},null,8,["content"])]),t(h,{modelValue:e.prompt,"onUpdate:modelValue":s[0]||(s[0]=r=>e.prompt=r),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("seedream.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const Ve=y(ke,[["render",Se],["__scopeId","data-v-5559520a"]]),Ie=k({name:"SeedreamImageInput",components:{ElUpload:se,ElButton:M,InfoIcon:C,ImagePreview:O,FontAwesomeIcon:A},mixins:[te],data(){return{fileList:[],uploadUrl:H()+"/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 i=(this.fileList||[]).filter(u=>!u?.response?.file_url);this.fileList=i.length?i:[];return}const s=[];e.forEach(i=>{const u=this.fileList.find(p=>p?.response?.file_url===i||p?.url===i);u?s.push(u):s.push({name:i.split("/").pop()||i,url:i,status:"success",percentage:100,response:{file_url:i}})}),(this.fileList||[]).filter(i=>!i?.response?.file_url).forEach(i=>{s.some(p=>p===i||p?.url===i?.url||p?.response?.file_url===i?.response?.file_url)||s.push(i)}),this.fileList=s}}},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(){V.warning(this.$t("seedream.message.uploadImageExceed"))},onError(){V.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,s){e?.file_url&&(s.url=e.file_url,s.response=e),this.onSetImages()},onRemovePreview(e,s){if(this.fileList.splice(e,1),s?.url&&typeof s.url=="string"&&s.url.startsWith("blob:"))try{URL.revokeObjectURL(s.url)}catch{}this.onSetImages()}}}),Le={class:"field"},Re={class:"label"},Te={class:"box"},Ae={class:"title font-bold"},Me={class:"value"},Ce={class:"file-list mt-2 flex flex-wrap gap-[10px]"};function De(e,s,g,i,u,p){const f=n("info-icon"),h=n("font-awesome-icon"),r=n("el-button"),d=n("el-upload"),b=n("image-preview");return a(),l(E,null,[c("div",Le,[c("div",Re,[c("div",Te,[c("h2",Ae,o(e.$t("seedream.name.imageUrls")),1),t(f,{content:e.$t("seedream.description.imageUrls"),class:"info"},null,8,["content"])])]),c("div",Me,[t(d,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":s[0]||(s[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:_(()=>[t(r,{size:"small",type:"primary",round:""},{default:_(()=>[t(h,{icon:"fa-solid fa-upload",class:"mr-1"}),m(" "+o(e.$t("seedream.button.uploadImageUrls")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","on-change","on-remove","headers"])])]),c("div",Ce,[(a(!0),l(E,null,I(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:z=>e.onRemovePreview(S,v)},null,8,["url","name","percentage","onRemove"]))),128))])],64)}const ze=y(Ie,[["render",De],["__scopeId","data-v-dc18c674"]]),Ue=k({name:"SeedreamModelSelector",components:{ElSelect:F,ElOption:B,InfoIcon:C},data(){return{options:[{value:Z,label:this.$t("seedream.model.seedream45")},{value:J,label:this.$t("seedream.model.seedream40")},{value:Q,label:this.$t("seedream.model.seedream30t2i")},{value:X,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=K)}}),qe={class:"field"},Ge={class:"label"},Pe={class:"box"},je={class:"title font-bold"};function Oe(e,s,g,i,u,p){const f=n("info-icon"),h=n("el-option"),r=n("el-select");return a(),l("div",qe,[c("div",Ge,[c("div",Pe,[c("h2",je,o(e.$t("seedream.name.model")),1),t(f,{content:e.$t("seedream.description.model"),class:"info"},null,8,["content"])])]),t(r,{modelValue:e.value,"onUpdate:modelValue":s[0]||(s[0]=d=>e.value=d),class:"value",placeholder:e.$t("seedream.placeholder.select")},{default:_(()=>[(a(!0),l(E,null,I(e.options,d=>(a(),w(h,{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Be=y(Ue,[["render",Oe],["__scopeId","data-v-3c3ca27d"]]),Fe=k({name:"SeedreamSizeSelector",components:{ElSelect:F,ElOption:B,InfoIcon:C},data(){return{options:[{value:U,label:U},{value:q,label:q},{value:G,label:G}]}},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=Y)}}),Ne={class:"field"},We={class:"label"},He={class:"box"},Ke={class:"title font-bold"};function Ze(e,s,g,i,u,p){const f=n("info-icon"),h=n("el-option"),r=n("el-select");return a(),l("div",Ne,[c("div",We,[c("div",He,[c("h2",Ke,o(e.$t("seedream.name.size")),1),t(f,{content:e.$t("seedream.description.size"),class:"info"},null,8,["content"])])]),t(r,{modelValue:e.value,"onUpdate:modelValue":s[0]||(s[0]=d=>e.value=d),class:"value",placeholder:e.$t("seedream.placeholder.select"),filterable:"","allow-create":"","default-first-option":""},{default:_(()=>[(a(!0),l(E,null,I(e.options,d=>(a(),w(h,{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Je=y(Fe,[["render",Ze],["__scopeId","data-v-54a9a469"]]),Qe=k({name:"SeedreamConfigPanel",components:{ElButton:M,FontAwesomeIcon:A,PromptInput:Ve,Consumption:oe,ImageInput:ze,ModelSelector:Be,SizeSelector:Je},emits:["generate"],computed:{config(){return this.$store.state.seedream?.config},consumption(){const e={...this.config||{}},s=Array.isArray(e?.image)&&e.image.length>0;return ae({...e,action:s?"edit":"generate",model:j(e?.model),count:1},this.service?.cost)},service(){return this.$store.state.seedream?.service}},methods:{onGenerate(){this.$emit("generate")}}}),Xe={class:"flex flex-col h-full"},Ye={class:"flex-1 overflow-y-auto p-5"},xe={class:"flex flex-col items-center justify-center px-5 pb-5"};function et(e,s,g,i,u,p){const f=n("model-selector"),h=n("size-selector"),r=n("prompt-input"),d=n("image-input"),b=n("consumption"),v=n("font-awesome-icon"),S=n("el-button");return a(),l("div",Xe,[c("div",Ye,[t(f,{class:"mb-4"}),t(h,{class:"mb-4"}),t(r,{class:"mb-4"}),t(d,{class:"mb-4"})]),c("div",xe,[t(b,{value:e.consumption,service:e.service},null,8,["value","service"]),t(S,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:_(()=>[t(v,{icon:"fa-solid fa-magic",class:"mr-2"}),m(" "+o(e.$t("seedream.button.generate")),1)]),_:1},8,["onClick"])])])}const tt=y(Qe,[["render",et]]),st=k({name:"SeedreamTaskPreview",components:{ElImage:me,CopyToClipboard:le,FontAwesomeIcon:A,ElAlert:de,ImageWrapper:ie,ElButton:M,ElTooltip:ce,ImagePreview:O},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(s=>{e.push(s)}),e}},methods:{shortModel(e){return j(e)||e},onEdit(e){if(!e)return;console.debug("Edit image:",e);const s={...this.$store.state.seedream?.config||{}};s.image=[e],this.$store.commit("seedream/setConfig",s)}}}),ot={class:"preview"},at={class:"left"},nt={class:"main"},rt={class:"bot"},lt={class:"datetime"},it={class:"info"},ct={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},dt={key:1,class:"prompt mt-2"},mt={key:0},ut={key:0,class:R({content:!0})},pt={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},ft={key:1,class:R({content:!0,failed:!0})},ht={class:"flex justify-start items-center gap-4 w-full overflow-x-auto"},_t={class:R({operations:!0,"mt-2":!0,"mb-2":!0})},gt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},$t={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},vt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},bt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},kt={key:2,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},yt={key:3,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Et={key:2,class:R({content:!0})},wt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},St={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Vt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},It={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Lt={key:2,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Rt={key:3,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Tt={key:4,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},At={key:3,class:R({content:!0})},Mt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ct={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Dt(e,s,g,i,u,p){const f=n("el-image"),h=n("image-preview"),r=n("font-awesome-icon"),d=n("copy-to-clipboard"),b=n("el-alert"),v=n("image-wrapper"),S=n("el-button"),z=n("el-tooltip");return a(),l("div",ot,[c("div",at,[t(f,{src:"https://cdn.acedata.cloud/9egrbn.png",class:"avatar"})]),c("div",nt,[c("div",rt,[m(o(e.$t("seedream.name.seedreamBot"))+" ",1),c("span",lt,o(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),c("div",it,[Array.isArray(e.modelValue?.request?.image)&&e.modelValue?.request?.image.length>0?(a(),l("div",ct,[(a(!0),l(E,null,I(e.modelValue?.request?.image,(L,T)=>(a(),w(h,{key:T,url:L,name:`image-${T+1}`,closable:!1},null,8,["url","name"]))),128))])):$("",!0),e.modelValue?.request?.prompt?(a(),l("p",dt,[m(o(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?$("",!0):(a(),l("span",mt," - ("+o(e.$t("seedream.status.pending"))+") ",1))])):$("",!0)]),e.modelValue?.response?e.modelValue?.response?.success===!0?(a(),l("div",ft,[c("div",ht,[(a(!0),l(E,null,I(e.images,(L,T)=>(a(),w(v,{key:T,src:L?.image_url,"raw-src":L?.image_url},null,8,["src","raw-src"]))),128))]),c("div",_t,[t(z,{class:"box-item",effect:"dark",content:e.$t("common.button.edit"),placement:"top-start"},{default:_(()=>[t(S,{type:"info",size:"small",class:"btn-action",onClick:s[0]||(s[0]=W(L=>e.onEdit(e.images?.[0]?.image_url),["stop"]))},{default:_(()=>[m(o(e.$t("common.button.edit")),1)]),_:1})]),_:1},8,["content"])]),t(b,{closable:!1,class:"mt-2 success"},{default:_(()=>[e.modelValue?.request?.model?(a(),l("p",gt,[t(r,{icon:"fa-solid fa-cube",class:"mr-1"}),m(" "+o(e.$t("seedream.name.model"))+": "+o(e.shortModel(e.modelValue?.request?.model)),1)])):$("",!0),e.modelValue?.request?.size?(a(),l("p",$t,[t(r,{icon:"fa-solid fa-image",class:"mr-1"}),m(" "+o(e.$t("seedream.name.size"))+": "+o(e.modelValue?.request?.size),1)])):$("",!0),c("p",vt,[t(r,{icon:"fa-solid fa-bolt",class:"mr-1"}),m(" "+o(e.$t("seedream.name.task"))+": "+o(e.isEdit?e.$t("seedream.name.edits"):e.$t("seedream.name.generate")),1)]),c("p",bt,[t(r,{icon:"fa-solid fa-magic",class:"mr-1"}),m(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),t(d,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])]),e.modelValue?.elapsed?(a(),l("p",kt,[t(r,{icon:"fa-solid fa-clock",class:"mr-1"}),m(" "+o(e.$t("seedream.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0),e.modelValue?.response?.trace_id?(a(),l("p",yt,[t(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),m(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),t(d,{content:e.modelValue?.response?.trace_id,class:"btn-copy inline-block"},null,8,["content"])])):$("",!0)]),_:1})])):e.modelValue?.response?.success===!1?(a(),l("div",Et,[t(b,{closable:!1,class:"failure"},{template:_(()=>[t(r,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),m(" "+o(e.$t("seedream.name.failure")),1)]),default:_(()=>[e.modelValue?.request?.model?(a(),l("p",wt,[t(r,{icon:"fa-solid fa-cube",class:"mr-1"}),m(" "+o(e.$t("seedream.name.model"))+": "+o(e.shortModel(e.modelValue?.request?.model)),1)])):$("",!0),e.modelValue?.request?.size?(a(),l("p",St,[t(r,{icon:"fa-solid fa-image",class:"mr-1"}),m(" "+o(e.$t("seedream.name.size"))+": "+o(e.modelValue?.request?.size),1)])):$("",!0),c("p",Vt,[t(r,{icon:"fa-solid fa-bolt",class:"mr-1"}),m(" "+o(e.$t("seedream.name.task"))+": "+o(e.isEdit?e.$t("seedream.name.edits"):e.$t("seedream.name.generate")),1)]),c("p",It,[t(r,{icon:"fa-solid fa-magic",class:"mr-1"}),m(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),t(d,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.response?.error?.message?(a(),l("p",Lt,[t(r,{icon:"fa-solid fa-circle-info",class:"mr-1"}),m(" "+o(e.$t("seedream.name.failureReason"))+": "+o(e.modelValue?.response?.error?.message)+" ",1),t(d,{content:e.modelValue?.response?.error?.message,class:"btn-copy"},null,8,["content"])])):$("",!0),e.modelValue?.elapsed?(a(),l("p",Rt,[t(r,{icon:"fa-solid fa-clock",class:"mr-1"}),m(" "+o(e.$t("seedream.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0),e.modelValue?.response?.trace_id?(a(),l("p",Tt,[t(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),m(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),t(d,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])):$("",!0)]),_:1})])):(a(),l("div",At,[t(b,{closable:!1,class:"info"},{template:_(()=>[t(r,{icon:"fa-solid fa-circle-info",class:"mr-1"}),m(" "+o(e.$t("seedream.name.status")),1)]),default:_(()=>[c("p",Mt,[t(r,{icon:"fa-solid fa-magic",class:"mr-1"}),m(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),t(d,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.response?.trace_id?(a(),l("p",Ct,[t(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),m(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),t(d,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])):$("",!0)]),_:1})])):(a(),l("div",ut,[t(b,{closable:!1,class:"info"},{template:_(()=>[t(r,{icon:"fa-regular fa-clock",class:"mr-1"}),m(" "+o(e.$t("seedream.status.pending")),1)]),default:_(()=>[c("p",pt,[t(r,{icon:"fa-solid fa-magic",class:"mr-1"}),m(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),t(d,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])])]),_:1})]))])])}const zt=y(st,[["render",Dt],["__scopeId","data-v-0dfc6a09"]]),Ut=k({name:"SeedreamRecentPanel",components:{TaskPreview:zt,BotPlaceholder:ue,NoTasks:pe,ScrollList:x},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?.()}}}),qt={key:0},Gt={key:2,class:"w-full h-full flex items-center justify-center"};function Pt(e,s,g,i,u,p){const f=n("bot-placeholder"),h=n("task-preview"),r=n("scroll-list"),d=n("no-tasks");return a(),l(E,null,[e.tasks?.items===void 0?(a(),l("div",qt,[t(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:s[0]||(s[0]=b=>e.$emit("reach-top"))},{default:_(()=>[(a(!0),l(E,null,I(e.tasks?.items,b=>(a(),w(h,{key:b.id,"model-value":b},null,8,["model-value"]))),128))]),_:1},8,["loading"])):$("",!0),e.tasks?.items?.length===0?(a(),l("div",Gt,[t(d)])):$("",!0)],64)}const jt=y(Ut,[["render",Pt]]),Ot="https://webhook.acedata.cloud/seedream",Bt=k({name:"SeedreamIndex",components:{ConfigPanel:tt,Layout:ve,RecentPanel:jt},inject:["initialized"],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.seedream?.status?.getApplications===P.Request},tasksLoading(){return this.$store.state.seedream?.status?.getTasks===P.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,s){e?.items?.length>s?.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(){if(console.debug("reached top"),this.loading||this.tasksLoading)return;const e=this.tasks?.total,s=this.tasks?.items?.length||0;if(e!==void 0&&e<=s)return;const g=this.tasks?.items?.[0];if(!g?.created_at)return;const u=this.$refs.recentPanel?.getScrollElement?.(),p=u?.scrollHeight||0,f=u?.scrollTop||0;this.loading=!0;try{if(await this.onGetTasks({createdAtMax:g.created_at}),await this.$nextTick(),u){const h=u.scrollHeight;u.scrollTop=h-p+f}}finally{this.loading=!1}},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:s=20,createdAtMin:g,createdAtMax:i}=e||{};console.debug("limit",s,"createdAtMin",g,"createdAtMax",i),await this.$store.dispatch("seedream/getTasks",{limit:s,createdAtMin:g,createdAtMax:i})},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 g={...e,callback_url:Ot},i=this.credential?.token;if(!i){console.error("no token specified");return}V.info(this.$t("seedream.message.startingTask")),re.generate(g,{token:i}).then(()=>{V.success(this.$t("seedream.message.startTaskSuccess"))}).catch(u=>{const p=u?.response?.data;p?.error?.code===ne?V.error(this.$t("seedream.message.usedUp")):V.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 Ft(e,s,g,i,u,p){const f=n("config-panel"),h=n("recent-panel"),r=n("layout");return a(),w(r,null,{config:_(()=>[t(f,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:_(()=>[t(h,{ref:"recentPanel",loading:e.loading,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Cs=y(Bt,[["render",Ft]]);export{Cs as default};
|
|
1
|
+
import{F as A}from"./index.es-B8UAYPlu.js";import{E as M}from"./index-B8kQljtZ.js";import{E as N}from"./index-BdOrPkLK.js";import{d as k,H as l,E as c,z as D,C as t,y as _,D as n,q as a,F as o,I as m,O as E,N as I,x as w,J as $,M as W,Q as R}from"./vendor-vue-DU0w5ewx.js";import{E as y,b1 as H,co as K,cp as Z,cq as J,cr as Q,cs as X,ct as Y,cu as U,cv as q,cw as G,cx as j,ap as P}from"./index-B8NIXFXV.js";import{I as C,S as x}from"./ScrollList-BBAzavyB.js";import{E as ee}from"./index-C3qbB2R4.js";import{p as te}from"./pasteUploadMixin-BurWbGNQ.js";import{I as O}from"./ImagePreview-CiFwyV10.js";import{E as se}from"./index-D2kYsNjd.js";import{E as V}from"./index-CcYxepTP.js";import{C as oe}from"./Consumption-CZlzOFr-.js";import{a as ae}from"./price-BdhJYmzp.js";import{E as B,a as F}from"./index-BlaGrXYB.js";import{b as ne}from"./errorCode-Cqj9Td_Z.js";import{s as re}from"./seedream-CZ2kWGod.js";import{C as le}from"./CopyToClipboard-cz_FV7JQ.js";import{I as ie}from"./ImageWrapper-s0bq8vjW.js";import{E as ce}from"./index-qLx3hags.js";import{E as de}from"./index-CsMsHthC.js";import{E as me}from"./index-BzitVkNO.js";import{B as ue}from"./BotPlaceholder-BwOm41PC.js";import{N as pe}from"./NoTasks-CNRFrdHu.js";import"./use-form-item-Bsmkxazb.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-Cvgzdobq.js";import"./vendor-vue-router-9TBHB1ku.js";import"./typescript-kbBRrRi0.js";import"./index-DlZ-gpNs.js";import"./index-CkzwyQNU.js";import"./index-Cq_8nzqD.js";import"./_baseClone-C0vKZ-2x.js";import"./_Uint8Array-Bq4W_aZw.js";import"./_initCloneObject-nuejNsVF.js";import"./isEqual-CBKi-9mc.js";import"./index-CEErdlw2.js";import"./strings-DigWlKo9.js";import"./castArray-DrkJhRjQ.js";import"./debounce-B-0O6GZN.js";import"./_baseIteratee-SXAlbslK.js";import"./index-BibFvigx.js";import"./index-IAptVusO.js";const fe=k({name:"LayoutSeedream",components:{ElDrawer:N,ElButton:M,FontAwesomeIcon:A},data(){return{drawer:!1}}}),he={class:"main flex flex-row flex-1"},_e={class:"config w-[320px] h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},ge={class:"result h-full p-6 flex-1 flex flex-col bg-[var(--app-content-bg)]"};function $e(e,s,g,i,u,p){const f=n("font-awesome-icon"),h=n("el-button"),r=n("el-drawer");return a(),l("div",he,[c("div",_e,[D(e.$slots,"config",{},void 0,!0)]),c("div",ge,[D(e.$slots,"result",{},void 0,!0)]),t(h,{circle:"",class:"menu",onClick:s[0]||(s[0]=d=>e.drawer=!0)},{default:_(()=>[t(f,{icon:"fa-solid fa-magic"})]),_:1}),t(r,{modelValue:e.drawer,"onUpdate:modelValue":s[1]||(s[1]=d=>e.drawer=d),direction:"ltr","with-header":!1,size:"340px",class:"drawer"},{default:_(()=>[D(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const ve=y(fe,[["render",$e],["__scopeId","data-v-5ff0c320"]]),be="",ke=k({name:"SeedreamPromptInput",components:{ElInput:ee,InfoIcon:C},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=be)}}),ye={class:"field"},Ee={class:"box"},we={class:"title font-bold"};function Se(e,s,g,i,u,p){const f=n("info-icon"),h=n("el-input");return a(),l("div",ye,[c("div",Ee,[c("h2",we,o(e.$t("seedream.name.prompt")),1),t(f,{content:e.$t("seedream.description.prompt"),class:"info"},null,8,["content"])]),t(h,{modelValue:e.prompt,"onUpdate:modelValue":s[0]||(s[0]=r=>e.prompt=r),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("seedream.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const Ve=y(ke,[["render",Se],["__scopeId","data-v-5559520a"]]),Ie=k({name:"SeedreamImageInput",components:{ElUpload:se,ElButton:M,InfoIcon:C,ImagePreview:O,FontAwesomeIcon:A},mixins:[te],data(){return{fileList:[],uploadUrl:H()+"/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 i=(this.fileList||[]).filter(u=>!u?.response?.file_url);this.fileList=i.length?i:[];return}const s=[];e.forEach(i=>{const u=this.fileList.find(p=>p?.response?.file_url===i||p?.url===i);u?s.push(u):s.push({name:i.split("/").pop()||i,url:i,status:"success",percentage:100,response:{file_url:i}})}),(this.fileList||[]).filter(i=>!i?.response?.file_url).forEach(i=>{s.some(p=>p===i||p?.url===i?.url||p?.response?.file_url===i?.response?.file_url)||s.push(i)}),this.fileList=s}}},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(){V.warning(this.$t("seedream.message.uploadImageExceed"))},onError(){V.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,s){e?.file_url&&(s.url=e.file_url,s.response=e),this.onSetImages()},onRemovePreview(e,s){if(this.fileList.splice(e,1),s?.url&&typeof s.url=="string"&&s.url.startsWith("blob:"))try{URL.revokeObjectURL(s.url)}catch{}this.onSetImages()}}}),Le={class:"field"},Re={class:"label"},Te={class:"box"},Ae={class:"title font-bold"},Me={class:"value"},Ce={class:"file-list mt-2 flex flex-wrap gap-[10px]"};function De(e,s,g,i,u,p){const f=n("info-icon"),h=n("font-awesome-icon"),r=n("el-button"),d=n("el-upload"),b=n("image-preview");return a(),l(E,null,[c("div",Le,[c("div",Re,[c("div",Te,[c("h2",Ae,o(e.$t("seedream.name.imageUrls")),1),t(f,{content:e.$t("seedream.description.imageUrls"),class:"info"},null,8,["content"])])]),c("div",Me,[t(d,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":s[0]||(s[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:_(()=>[t(r,{size:"small",type:"primary",round:""},{default:_(()=>[t(h,{icon:"fa-solid fa-upload",class:"mr-1"}),m(" "+o(e.$t("seedream.button.uploadImageUrls")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","on-change","on-remove","headers"])])]),c("div",Ce,[(a(!0),l(E,null,I(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:z=>e.onRemovePreview(S,v)},null,8,["url","name","percentage","onRemove"]))),128))])],64)}const ze=y(Ie,[["render",De],["__scopeId","data-v-dc18c674"]]),Ue=k({name:"SeedreamModelSelector",components:{ElSelect:F,ElOption:B,InfoIcon:C},data(){return{options:[{value:Z,label:this.$t("seedream.model.seedream45")},{value:J,label:this.$t("seedream.model.seedream40")},{value:Q,label:this.$t("seedream.model.seedream30t2i")},{value:X,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=K)}}),qe={class:"field"},Ge={class:"label"},Pe={class:"box"},je={class:"title font-bold"};function Oe(e,s,g,i,u,p){const f=n("info-icon"),h=n("el-option"),r=n("el-select");return a(),l("div",qe,[c("div",Ge,[c("div",Pe,[c("h2",je,o(e.$t("seedream.name.model")),1),t(f,{content:e.$t("seedream.description.model"),class:"info"},null,8,["content"])])]),t(r,{modelValue:e.value,"onUpdate:modelValue":s[0]||(s[0]=d=>e.value=d),class:"value",placeholder:e.$t("seedream.placeholder.select")},{default:_(()=>[(a(!0),l(E,null,I(e.options,d=>(a(),w(h,{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Be=y(Ue,[["render",Oe],["__scopeId","data-v-3c3ca27d"]]),Fe=k({name:"SeedreamSizeSelector",components:{ElSelect:F,ElOption:B,InfoIcon:C},data(){return{options:[{value:U,label:U},{value:q,label:q},{value:G,label:G}]}},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=Y)}}),Ne={class:"field"},We={class:"label"},He={class:"box"},Ke={class:"title font-bold"};function Ze(e,s,g,i,u,p){const f=n("info-icon"),h=n("el-option"),r=n("el-select");return a(),l("div",Ne,[c("div",We,[c("div",He,[c("h2",Ke,o(e.$t("seedream.name.size")),1),t(f,{content:e.$t("seedream.description.size"),class:"info"},null,8,["content"])])]),t(r,{modelValue:e.value,"onUpdate:modelValue":s[0]||(s[0]=d=>e.value=d),class:"value",placeholder:e.$t("seedream.placeholder.select"),filterable:"","allow-create":"","default-first-option":""},{default:_(()=>[(a(!0),l(E,null,I(e.options,d=>(a(),w(h,{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Je=y(Fe,[["render",Ze],["__scopeId","data-v-54a9a469"]]),Qe=k({name:"SeedreamConfigPanel",components:{ElButton:M,FontAwesomeIcon:A,PromptInput:Ve,Consumption:oe,ImageInput:ze,ModelSelector:Be,SizeSelector:Je},emits:["generate"],computed:{config(){return this.$store.state.seedream?.config},consumption(){const e={...this.config||{}},s=Array.isArray(e?.image)&&e.image.length>0;return ae({...e,action:s?"edit":"generate",model:j(e?.model),count:1},this.service?.cost)},service(){return this.$store.state.seedream?.service}},methods:{onGenerate(){this.$emit("generate")}}}),Xe={class:"flex flex-col h-full"},Ye={class:"flex-1 overflow-y-auto p-5"},xe={class:"flex flex-col items-center justify-center px-5 pb-5"};function et(e,s,g,i,u,p){const f=n("model-selector"),h=n("size-selector"),r=n("prompt-input"),d=n("image-input"),b=n("consumption"),v=n("font-awesome-icon"),S=n("el-button");return a(),l("div",Xe,[c("div",Ye,[t(f,{class:"mb-4"}),t(h,{class:"mb-4"}),t(r,{class:"mb-4"}),t(d,{class:"mb-4"})]),c("div",xe,[t(b,{value:e.consumption,service:e.service},null,8,["value","service"]),t(S,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:_(()=>[t(v,{icon:"fa-solid fa-magic",class:"mr-2"}),m(" "+o(e.$t("seedream.button.generate")),1)]),_:1},8,["onClick"])])])}const tt=y(Qe,[["render",et]]),st=k({name:"SeedreamTaskPreview",components:{ElImage:me,CopyToClipboard:le,FontAwesomeIcon:A,ElAlert:de,ImageWrapper:ie,ElButton:M,ElTooltip:ce,ImagePreview:O},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(s=>{e.push(s)}),e}},methods:{shortModel(e){return j(e)||e},onEdit(e){if(!e)return;console.debug("Edit image:",e);const s={...this.$store.state.seedream?.config||{}};s.image=[e],this.$store.commit("seedream/setConfig",s)}}}),ot={class:"preview"},at={class:"left"},nt={class:"main"},rt={class:"bot"},lt={class:"datetime"},it={class:"info"},ct={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},dt={key:1,class:"prompt mt-2"},mt={key:0},ut={key:0,class:R({content:!0})},pt={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},ft={key:1,class:R({content:!0,failed:!0})},ht={class:"flex justify-start items-center gap-4 w-full overflow-x-auto"},_t={class:R({operations:!0,"mt-2":!0,"mb-2":!0})},gt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},$t={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},vt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},bt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},kt={key:2,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},yt={key:3,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Et={key:2,class:R({content:!0})},wt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},St={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Vt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},It={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Lt={key:2,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Rt={key:3,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Tt={key:4,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},At={key:3,class:R({content:!0})},Mt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ct={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Dt(e,s,g,i,u,p){const f=n("el-image"),h=n("image-preview"),r=n("font-awesome-icon"),d=n("copy-to-clipboard"),b=n("el-alert"),v=n("image-wrapper"),S=n("el-button"),z=n("el-tooltip");return a(),l("div",ot,[c("div",at,[t(f,{src:"https://cdn.acedata.cloud/9egrbn.png",class:"avatar"})]),c("div",nt,[c("div",rt,[m(o(e.$t("seedream.name.seedreamBot"))+" ",1),c("span",lt,o(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),c("div",it,[Array.isArray(e.modelValue?.request?.image)&&e.modelValue?.request?.image.length>0?(a(),l("div",ct,[(a(!0),l(E,null,I(e.modelValue?.request?.image,(L,T)=>(a(),w(h,{key:T,url:L,name:`image-${T+1}`,closable:!1},null,8,["url","name"]))),128))])):$("",!0),e.modelValue?.request?.prompt?(a(),l("p",dt,[m(o(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?$("",!0):(a(),l("span",mt," - ("+o(e.$t("seedream.status.pending"))+") ",1))])):$("",!0)]),e.modelValue?.response?e.modelValue?.response?.success===!0?(a(),l("div",ft,[c("div",ht,[(a(!0),l(E,null,I(e.images,(L,T)=>(a(),w(v,{key:T,src:L?.image_url,"raw-src":L?.image_url},null,8,["src","raw-src"]))),128))]),c("div",_t,[t(z,{class:"box-item",effect:"dark",content:e.$t("common.button.edit"),placement:"top-start"},{default:_(()=>[t(S,{type:"info",size:"small",class:"btn-action",onClick:s[0]||(s[0]=W(L=>e.onEdit(e.images?.[0]?.image_url),["stop"]))},{default:_(()=>[m(o(e.$t("common.button.edit")),1)]),_:1})]),_:1},8,["content"])]),t(b,{closable:!1,class:"mt-2 success"},{default:_(()=>[e.modelValue?.request?.model?(a(),l("p",gt,[t(r,{icon:"fa-solid fa-cube",class:"mr-1"}),m(" "+o(e.$t("seedream.name.model"))+": "+o(e.shortModel(e.modelValue?.request?.model)),1)])):$("",!0),e.modelValue?.request?.size?(a(),l("p",$t,[t(r,{icon:"fa-solid fa-image",class:"mr-1"}),m(" "+o(e.$t("seedream.name.size"))+": "+o(e.modelValue?.request?.size),1)])):$("",!0),c("p",vt,[t(r,{icon:"fa-solid fa-bolt",class:"mr-1"}),m(" "+o(e.$t("seedream.name.task"))+": "+o(e.isEdit?e.$t("seedream.name.edits"):e.$t("seedream.name.generate")),1)]),c("p",bt,[t(r,{icon:"fa-solid fa-magic",class:"mr-1"}),m(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),t(d,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])]),e.modelValue?.elapsed?(a(),l("p",kt,[t(r,{icon:"fa-solid fa-clock",class:"mr-1"}),m(" "+o(e.$t("seedream.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0),e.modelValue?.response?.trace_id?(a(),l("p",yt,[t(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),m(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),t(d,{content:e.modelValue?.response?.trace_id,class:"btn-copy inline-block"},null,8,["content"])])):$("",!0)]),_:1})])):e.modelValue?.response?.success===!1?(a(),l("div",Et,[t(b,{closable:!1,class:"failure"},{template:_(()=>[t(r,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),m(" "+o(e.$t("seedream.name.failure")),1)]),default:_(()=>[e.modelValue?.request?.model?(a(),l("p",wt,[t(r,{icon:"fa-solid fa-cube",class:"mr-1"}),m(" "+o(e.$t("seedream.name.model"))+": "+o(e.shortModel(e.modelValue?.request?.model)),1)])):$("",!0),e.modelValue?.request?.size?(a(),l("p",St,[t(r,{icon:"fa-solid fa-image",class:"mr-1"}),m(" "+o(e.$t("seedream.name.size"))+": "+o(e.modelValue?.request?.size),1)])):$("",!0),c("p",Vt,[t(r,{icon:"fa-solid fa-bolt",class:"mr-1"}),m(" "+o(e.$t("seedream.name.task"))+": "+o(e.isEdit?e.$t("seedream.name.edits"):e.$t("seedream.name.generate")),1)]),c("p",It,[t(r,{icon:"fa-solid fa-magic",class:"mr-1"}),m(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),t(d,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.response?.error?.message?(a(),l("p",Lt,[t(r,{icon:"fa-solid fa-circle-info",class:"mr-1"}),m(" "+o(e.$t("seedream.name.failureReason"))+": "+o(e.modelValue?.response?.error?.message)+" ",1),t(d,{content:e.modelValue?.response?.error?.message,class:"btn-copy"},null,8,["content"])])):$("",!0),e.modelValue?.elapsed?(a(),l("p",Rt,[t(r,{icon:"fa-solid fa-clock",class:"mr-1"}),m(" "+o(e.$t("seedream.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0),e.modelValue?.response?.trace_id?(a(),l("p",Tt,[t(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),m(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),t(d,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])):$("",!0)]),_:1})])):(a(),l("div",At,[t(b,{closable:!1,class:"info"},{template:_(()=>[t(r,{icon:"fa-solid fa-circle-info",class:"mr-1"}),m(" "+o(e.$t("seedream.name.status")),1)]),default:_(()=>[c("p",Mt,[t(r,{icon:"fa-solid fa-magic",class:"mr-1"}),m(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),t(d,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.response?.trace_id?(a(),l("p",Ct,[t(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),m(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),t(d,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])):$("",!0)]),_:1})])):(a(),l("div",ut,[t(b,{closable:!1,class:"info"},{template:_(()=>[t(r,{icon:"fa-regular fa-clock",class:"mr-1"}),m(" "+o(e.$t("seedream.status.pending")),1)]),default:_(()=>[c("p",pt,[t(r,{icon:"fa-solid fa-magic",class:"mr-1"}),m(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),t(d,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])])]),_:1})]))])])}const zt=y(st,[["render",Dt],["__scopeId","data-v-0dfc6a09"]]),Ut=k({name:"SeedreamRecentPanel",components:{TaskPreview:zt,BotPlaceholder:ue,NoTasks:pe,ScrollList:x},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?.()}}}),qt={key:0},Gt={key:2,class:"w-full h-full flex items-center justify-center"};function Pt(e,s,g,i,u,p){const f=n("bot-placeholder"),h=n("task-preview"),r=n("scroll-list"),d=n("no-tasks");return a(),l(E,null,[e.tasks?.items===void 0?(a(),l("div",qt,[t(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:s[0]||(s[0]=b=>e.$emit("reach-top"))},{default:_(()=>[(a(!0),l(E,null,I(e.tasks?.items,b=>(a(),w(h,{key:b.id,"model-value":b},null,8,["model-value"]))),128))]),_:1},8,["loading"])):$("",!0),e.tasks?.items?.length===0?(a(),l("div",Gt,[t(d)])):$("",!0)],64)}const jt=y(Ut,[["render",Pt]]),Ot="https://webhook.acedata.cloud/seedream",Bt=k({name:"SeedreamIndex",components:{ConfigPanel:tt,Layout:ve,RecentPanel:jt},inject:["initialized"],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.seedream?.status?.getApplications===P.Request},tasksLoading(){return this.$store.state.seedream?.status?.getTasks===P.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,s){e?.items?.length>s?.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(){if(console.debug("reached top"),this.loading||this.tasksLoading)return;const e=this.tasks?.total,s=this.tasks?.items?.length||0;if(e!==void 0&&e<=s)return;const g=this.tasks?.items?.[0];if(!g?.created_at)return;const u=this.$refs.recentPanel?.getScrollElement?.(),p=u?.scrollHeight||0,f=u?.scrollTop||0;this.loading=!0;try{if(await this.onGetTasks({createdAtMax:g.created_at}),await this.$nextTick(),u){const h=u.scrollHeight;u.scrollTop=h-p+f}}finally{this.loading=!1}},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:s=20,createdAtMin:g,createdAtMax:i}=e||{};console.debug("limit",s,"createdAtMin",g,"createdAtMax",i),await this.$store.dispatch("seedream/getTasks",{limit:s,createdAtMin:g,createdAtMax:i})},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 g={...e,callback_url:Ot},i=this.credential?.token;if(!i){console.error("no token specified");return}V.info(this.$t("seedream.message.startingTask")),re.generate(g,{token:i}).then(()=>{V.success(this.$t("seedream.message.startTaskSuccess"))}).catch(u=>{const p=u?.response?.data;p?.error?.code===ne?V.error(this.$t("seedream.message.usedUp")):V.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 Ft(e,s,g,i,u,p){const f=n("config-panel"),h=n("recent-panel"),r=n("layout");return a(),w(r,null,{config:_(()=>[t(f,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:_(()=>[t(h,{ref:"recentPanel",loading:e.loading,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Cs=y(Bt,[["render",Ft]]);export{Cs as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as C}from"./index.es-DvoJym95.js";import{E as P}from"./index-CrqDHQpz.js";import{E as G}from"./index-CipihCqd.js";import{d as v,H as l,E as r,z as A,C as s,y as d,D as n,q as o,F as a,I as g,O as I,N as T,x as E,Q as S,c as U,J as $}from"./vendor-vue-DU0w5ewx.js";import{E as b,b1 as D,a7 as z,ap as V}from"./index-EDbdzYoK.js";import{p as M}from"./pasteUploadMixin-BurWbGNQ.js";import{I as O,S as j}from"./ScrollList-CovUKJRB.js";import{I as B}from"./ImagePreview-BGS979RH.js";import{E as q}from"./index-5H0Kze44.js";import{E as w}from"./index-Ds9jhuB5.js";import{a as F,E as N}from"./index-RS4-DC1h.js";import{E as L}from"./index-BlU0CedW.js";import{E as H,a as J}from"./index-BTOLjvOo.js";import{b as Q,a as K}from"./errorCode-Cqj9Td_Z.js";import{h as W}from"./headshots-2vMYlO90.js";import{A as X}from"./Status-CFh4F4qR.js";import{C as Y}from"./CopyToClipboard-5g7lxAq1.js";import{E as Z}from"./index-BqxJJthV.js";import{E as x,a as ee}from"./index-BrEa1c2p.js";import{l as se}from"./pagination-CcnL0MdN.js";import"./use-form-item-D2iN_ybD.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-Cvgzdobq.js";import"./vendor-vue-router-9TBHB1ku.js";import"./index-l-4qvBYE.js";import"./index-Ckk9018y.js";import"./typescript-D6u-C9xv.js";import"./index-D6ZTnX5Z.js";import"./_baseClone-c0H4QFpc.js";import"./_Uint8Array-CRruIzWx.js";import"./_initCloneObject-zrgKx4gY.js";import"./isEqual-DM0CxUu8.js";import"./debounce-CoHXkWvt.js";import"./index-tCoyl_xR.js";import"./strings-DigWlKo9.js";import"./isPlainObject-WAUloOqg.js";const te=v({name:"LayoutHeadshots",components:{ElDrawer:G,ElButton:P,FontAwesomeIcon:C},data(){return{drawer:!1}}}),oe={class:"main flex flex-row flex-1"},ae={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},ne={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function ie(e,t,m,h,k,y){const p=n("font-awesome-icon"),u=n("el-button"),i=n("el-drawer");return o(),l("div",oe,[r("div",ae,[A(e.$slots,"config",{},void 0,!0)]),r("div",ne,[A(e.$slots,"result",{},void 0,!0)]),s(u,{circle:"",class:"menu",onClick:t[0]||(t[0]=c=>e.drawer=!0)},{default:d(()=>[s(p,{icon:"fa-solid fa-gear"})]),_:1}),s(i,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=c=>e.drawer=c),"with-header":!1,size:"340px",class:"drawer"},{default:d(()=>[A(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const le=b(te,[["render",ie],["__scopeId","data-v-202b355b"]]),re=v({name:"ImageUrlsInput",components:{ElUpload:q,ElButton:P,InfoIcon:O,ImagePreview:B,FontAwesomeIcon:C},mixins:[M],data(){return{fileList:[],uploadUrl:D()+"/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.headshots?.config?.image_urls},set(){const e=this.urls;this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,image_urls:e})}}},mounted(){this.value||(this.value=void 0),this.onSetImageUrls()},methods:{onExceed(){w.warning(this.$t("headshots.message.uploadImageExceed"))},onError(){w.error(this.$t("headshots.message.uploadImageError"))},onSetImageUrls(){const e=this.urls;this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,image_urls:e})},async onSuccess(){this.onSetImageUrls()}}}),ce={class:"field"},de={class:"title font-bold"},pe={class:"upload-wrapper"};function me(e,t,m,h,k,y){const p=n("image-preview"),u=n("font-awesome-icon"),i=n("el-button"),c=n("el-upload"),f=n("info-icon");return o(),l("div",ce,[r("h2",de,a(e.$t("headshots.name.endImageUrls")),1),r("div",pe,[s(c,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"value upload-wrapper",limit:2,multiple:!0,"list-type":"picture",action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:d(({file:_})=>[s(p,{url:_.url||_.response?.file_url,name:_.name,percentage:_.percentage,onRemove:R=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])]),default:d(()=>[s(i,{size:"small",type:"primary",round:""},{default:d(()=>[s(u,{icon:"fa-solid fa-upload",class:"mr-1"}),g(" "+a(e.$t("headshots.button.uploadImageUrls")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])]),s(f,{content:e.$t("headshots.description.endImageUrls"),class:"info"},null,8,["content"])])}const he=b(re,[["render",me],["__scopeId","data-v-ca56051e"]]),ue="fast",fe=v({name:"ModeSelector",components:{ElRadioButton:N,ElRadioGroup:F},data(){return{options:[{label:this.$t("headshots.button.fast"),value:"fast"},{label:this.$t("headshots.button.relax"),value:"relax"}]}},computed:{value:{get(){return this.$store.state.headshots.config?.mode},set(e){console.debug("set mode",e),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots.config,mode:e})}}},mounted(){this.value||(this.value=ue)}}),ge={class:"field"},_e={class:"title font-bold"};function $e(e,t,m,h,k,y){const p=n("el-radio-button"),u=n("el-radio-group");return o(),l("div",ge,[r("h2",_e,a(e.$t("headshots.name.mode")),1),s(u,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=i=>e.value=i),class:"mode"},{default:d(()=>[(o(!0),l(I,null,T(e.options,i=>(o(),E(p,{key:i.value,label:i.value},{default:d(()=>[g(a(i.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])])}const ve=b(fe,[["render",$e],["__scopeId","data-v-e7702494"]]),be=v({name:"StylizeSelector",components:{ElTabs:J,ElTabPane:H,ElImage:L},data(){return{tab:"styles",value:"",elements:{styles:{displayName:this.$t("headshots.styleCategory.styles"),items:[{image:"https://static.aipedias.com/aicamera/common/20241008/20241008202314260779439.png",label:this.$t("headshots.styleTag.malePportrait"),value:"male_portrait"},{image:"https://static.aipedias.com/aicamera/common/20241008/202410082022241e9755548.png",label:this.$t("headshots.styleTag.malePportrait2"),value:"male_portrait2"},{image:"https://static.aipedias.com/aicamera/common/20241101/20241101170130d78f66521.png",label:this.$t("headshots.styleTag.kindergarten"),value:"kindergarten"},{image:"https://static.aipedias.com/aicamera/common/20240923/20240923123233accf60398.webp",label:this.$t("headshots.styleTag.logoTshirt"),value:"logo_tshirt"},{image:"https://static.aipedias.com/aicamera/common/20241025/202410252012329472d0656.jpg",label:this.$t("headshots.styleTag.wedding"),value:"wedding"},{image:"https://static.aipedias.com/aicamera/common/20240915/20240915145045254931400.webp",label:this.$t("headshots.styleTag.businessPphoto"),value:"business_photo"},{image:"https://static.aipedias.com/aicamera/common/20240810/20240810194526040341795.jpg",label:this.$t("headshots.styleTag.bobSuit"),value:"bob_suit"},{image:"https://static.aipedias.com/aicamera/common/20240717/20240717152654e0b348173.webp",label:this.$t("headshots.styleTag.femalePortrait"),value:"female_portrait"}]}}}},watch:{value(e){console.debug("set template",e),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,template:e})}},mounted(){this.value||(this.value=""),console.debug("set template",this.value),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,template:this.value})},methods:{onToggle(e){this.value===e?this.value="":this.value=e,console.debug("set template",this.value),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,template:this.value})}}}),ke={class:"field"},ye=["onClick"],we={class:"name"};function Ie(e,t,m,h,k,y){const p=n("el-image"),u=n("el-tab-pane"),i=n("el-tabs");return o(),l("div",ke,[s(i,{modelValue:e.tab,"onUpdate:modelValue":t[0]||(t[0]=c=>e.tab=c)},{default:d(()=>[(o(!0),l(I,null,T(e.elements,(c,f)=>(o(),E(u,{key:f,label:c.displayName,name:f,class:"pane"},{default:d(()=>[(o(!0),l(I,null,T(c.items,(_,R)=>(o(),l("div",{key:R,class:S({item:!0,active:e.value===_.value}),onClick:bs=>e.onToggle(_.value)},[s(p,{src:_.image,fit:"fill",class:"preview"},null,8,["src"]),r("span",we,a(_.label),1)],10,ye))),128))]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])])}const Te=b(be,[["render",Ie],["__scopeId","data-v-be4bd25d"]]),Ee=v({name:"PresetPanel",components:{ModeSelector:ve,ImageUrlsInput:he,ElButton:P,FontAwesomeIcon:C,ElementsSelector:Te},emits:["generate"],computed:{config(){return this.$store.state.headshots?.config}},methods:{onGenerate(){this.$emit("generate")}}}),Se={class:"panel"},Ve={class:"config"},Ce={class:"actions"};function Ae(e,t,m,h,k,y){const p=n("elements-selector"),u=n("mode-selector"),i=n("image-urls-input"),c=n("font-awesome-icon"),f=n("el-button");return o(),l("div",Se,[r("div",Ve,[s(p,{class:"mb-4"}),s(u,{class:"mb-4"}),s(i,{class:"mb-4"}),r("div",Ce,[s(f,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:d(()=>[s(c,{icon:"fa-solid fa-magic",class:"mr-2"}),g(" "+a(e.$t("headshots.button.generate")),1)]),_:1},8,["onClick"])])])])}const Pe=b(Ee,[["render",Ae],["__scopeId","data-v-848739f6"]]),Re=v({name:"ImageGallery",props:{modelValue:{type:Object,required:!0}},setup(e){return{images:U(()=>e.modelValue?.response?.data?.slice(0,2)||[]),viewImage:h=>{window.open(h,"_blank")}}}}),Le={class:"image-gallery"},Ge=["src"],Ue=["onClick"];function De(e,t,m,h,k,y){return o(),l("div",Le,[(o(!0),l(I,null,T(e.images,(p,u)=>(o(),l("div",{key:u,class:"image-container"},[r("img",{src:p.image_url,alt:"Image"},null,8,Ge),p.image_url?(o(),l("button",{key:0,class:"view-button",onClick:i=>e.viewImage(p.image_url)},a(e.$t("headshots.button.viewImage")),9,Ue)):$("",!0)]))),128))])}const ze=b(Re,[["render",De],["__scopeId","data-v-42f0a7be"]]),Me=v({name:"TaskPreview",components:{ElImage:L,CopyToClipboard:Y,FontAwesomeIcon:C,ElAlert:Z,ImageGallery:ze},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.headshots?.application},config(){return this.$store.state.headshots?.config}},methods:{onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onReload(e){const t=e.target,m=new URL(t.src),h=m.searchParams.get("retry");if(!h)m.searchParams.set("retry","1");else if(parseInt(h)<2)m.searchParams.set("retry",(parseInt(h)+1).toString());else return;t.src=m.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),Oe={class:"preview"},je={class:"left"},Be={class:"main"},qe={class:"bot"},Fe={class:"datetime"},Ne={class:"info"},He={key:0,class:"prompt mt-2"},Je={key:0},Qe={key:1},Ke={key:0,class:S({content:!0,failed:!0})},We={class:"image-wrapper"},Xe={class:"description"},Ye={key:0,class:"description"},Ze={key:1,class:S({content:!0})},xe={class:"description"},es={class:"description"},ss={key:0,class:"description"},ts={class:"description"},os={key:2,class:S({content:!0})},as={class:"description"},ns={key:3,class:S({content:!0})},is={class:"description"};function ls(e,t,m,h,k,y){const p=n("el-image"),u=n("image-gallery"),i=n("font-awesome-icon"),c=n("copy-to-clipboard"),f=n("el-alert");return o(),l("div",Oe,[r("div",je,[s(p,{src:"https://cdn.acedata.cloud/isxyfw.png",class:"avatar"})]),r("div",Be,[r("div",qe,[g(a(e.$t("headshots.name.headshotsBot"))+" ",1),r("span",Fe,a(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),r("div",Ne,[e.modelValue?.request?.template?(o(),l("p",He,[g(a(e.modelValue?.request?.template)+" ",1),e.modelValue?.response?$("",!0):(o(),l("span",Je," - ("+a(e.$t("headshots.status.pending"))+") ",1)),e.modelValue?.response?.status==="unknown"?(o(),l("span",Qe," - ("+a(e.$t("headshots.status.processing"))+") ",1)):$("",!0)])):$("",!0)]),e.modelValue?.response?.success===!0?(o(),l("div",Ke,[r("div",We,[s(u,{"model-value":e.modelValue},null,8,["model-value"])]),s(f,{closable:!1,class:"mt-2 success"},{default:d(()=>[r("p",Xe,[s(i,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+a(e.$t("headshots.name.taskId"))+": "+a(e.modelValue?.id)+" ",1),s(c,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.elapsed?(o(),l("p",Ye,[s(i,{icon:"fa-solid fa-clock",class:"mr-1"}),g(" "+a(e.$t("headshots.name.elapsed"))+": "+a(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0)]),_:1})])):$("",!0),e.modelValue?.response?.success===!1?(o(),l("div",Ze,[s(f,{closable:!1,class:"failure"},{template:d(()=>[s(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),g(" "+a(e.$t("headshots.name.failure")),1)]),default:d(()=>[r("p",xe,[s(i,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+a(e.$t("headshots.name.taskId"))+": "+a(e.modelValue?.id)+" ",1),s(c,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),r("p",es,[s(i,{icon:"fa-solid fa-circle-info",class:"mr-1"}),g(" "+a(e.$t("headshots.name.failureReason"))+": "+a(e.modelValue?.response?.error?.message)+" ",1),s(c,{content:e.modelValue?.response?.error?.message,class:"btn-copy"},null,8,["content"])]),e.modelValue?.elapsed?(o(),l("p",ss,[s(i,{icon:"fa-solid fa-clock",class:"mr-1"}),g(" "+a(e.$t("headshots.name.elapsed"))+": "+a(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0),r("p",ts,[s(i,{icon:"fa-solid fa-hashtag",class:"mr-1"}),g(" "+a(e.$t("headshots.name.traceId"))+": "+a(e.modelValue?.response?.trace_id)+" ",1),s(c,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])]),_:1})])):$("",!0),e.modelValue?.response?$("",!0):(o(),l("div",os,[s(f,{closable:!1,class:"info"},{template:d(()=>[s(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),g(" "+a(e.$t("headshots.name.failure")),1)]),default:d(()=>[r("p",as,[s(i,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+a(e.$t("headshots.name.taskId"))+": "+a(e.modelValue?.id)+" ",1),s(c,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])])]),_:1})])),e.modelValue?.response?.status==="unknown"?(o(),l("div",ns,[s(f,{closable:!1,class:"info"},{template:d(()=>[s(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),g(" "+a(e.$t("headshots.name.failure")),1)]),default:d(()=>[r("p",is,[s(i,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+a(e.$t("headshots.name.taskId"))+": "+a(e.modelValue?.id)+" ",1),s(c,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])])]),_:1})])):$("",!0)])])}const rs=b(Me,[["render",ls],["__scopeId","data-v-d286678e"]]),cs=v({name:"RecentPanel",components:{TaskPreview:rs,ElSkeleton:ee,ElSkeletonItem:x,ScrollList:j},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.headshots?.tasks,items:this.$store.state.headshots?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),ds={key:0,class:"tasks"},ps={class:"left"},ms={class:"main"},hs={key:1,class:"tasks"},us={key:2,class:"description"};function fs(e,t,m,h,k,y){const p=n("el-skeleton-item"),u=n("el-skeleton"),i=n("task-preview"),c=n("scroll-list");return o(),E(c,{ref:"scrollList",class:"panel recent",loading:e.loading,onReachTop:t[0]||(t[0]=f=>e.$emit("reach-top"))},{default:d(()=>[e.tasks?.items===void 0?(o(),l("div",ds,[(o(),l(I,null,T(3,f=>r("div",{key:f,class:"task placeholder"},[r("div",ps,[s(u,{animated:""},{template:d(()=>[s(p,{variant:"image",class:"avatar"})]),_:1})]),r("div",ms,[s(u,{animated:""},{template:d(()=>[s(p,{variant:"p",class:"title"}),s(p,{variant:"image",class:"icon"})]),_:1})])])),64))])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(o(),l("div",hs,[(o(!0),l(I,null,T(e.tasks?.items,(f,_)=>(o(),E(i,{key:_,"model-value":f,class:"preview"},null,8,["model-value"]))),128))])):$("",!0),e.tasks?.items?.length===0?(o(),l("p",us,a(e.$t("headshots.message.noTasks")),1)):$("",!0)]),_:1},8,["loading"])}const gs=b(cs,[["render",fs],["__scopeId","data-v-ffd55c16"]]),_s="https://webhook.acedata.cloud/headshots",$s=v({name:"HeadshotsIndex",components:{ConfigPanel:Pe,Layout:le,ApplicationStatus:X,RecentPanel:gs},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.headshots?.status?.getApplications===V.Request},tasksLoading(){return this.$store.state.headshots?.status?.getTasks===V.Request||this.fetchingTasks},service(){return this.$store.state.headshots.service},credential(){return this.$store.state.headshots.credential},config(){return this.$store.state.headshots.config},initializing(){return this.$store.state.headshots.status.getApplications===V.Request},needApply(){return this.$store.state.headshots.status.getApplications===V.Success&&!this.application},application(){return this.$store.state.headshots.application},applications(){return this.$store.state.headshots.applications},tasks(){return this.$store.state.headshots.tasks}},watch:{tasks:{handler(e,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 se({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("headshots/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("headshots/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){z.create({application:this.application}).then(({data:e})=>{this.application=e,w.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{e?.response?.data?.code===K&&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:m,createdAtMax:h}=e||{};console.debug("limit",t,"createdAtMin",m,"createdAtMax",h),this.fetchingTasks=!0;try{await this.$store.dispatch("headshots/getTasks",{limit:t,createdAtMin:m,createdAtMax:h})}finally{this.fetchingTasks=!1}},async onGeneratePicture(){const e={...this.config,callback_url:_s},t=this.credential?.token;if(!t){console.error("no token specified");return}w.info(this.$t("headshots.message.startingTask")),W.generate(e,{token:t}).then(()=>{w.success(this.$t("headshots.message.startTaskSuccess")),this.$store.commit("headshots/setConfig",{config:void 0})}).catch(m=>{m?.response?.data?.error?.code===Q?w.error(this.$t("headshots.message.usedUp")):w.error(this.$t("headshots.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function vs(e,t,m,h,k,y){const p=n("config-panel"),u=n("application-status"),i=n("recent-panel"),c=n("layout");return o(),E(c,null,{config:d(()=>[s(p,{onGenerate:e.onGeneratePicture},null,8,["onGenerate"])]),result:d(()=>[s(u,{initializing:e.initializing,application:e.application,applications:e.applications,service:e.service,"need-apply":e.needApply,class:"mb-4",onRefresh:e.onGetApplication,onSelect:t[0]||(t[0]=f=>e.$store.dispatch("headshots/setApplication",f))},null,8,["initializing","application","applications","service","need-apply","onRefresh"]),s(i,{ref:"recentPanel",class:"panel recent",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const at=b($s,[["render",vs],["__scopeId","data-v-6cafffbd"]]);export{at as default};
|
|
1
|
+
import{F as C}from"./index.es-B8UAYPlu.js";import{E as P}from"./index-B8kQljtZ.js";import{E as G}from"./index-BdOrPkLK.js";import{d as v,H as l,E as r,z as A,C as s,y as d,D as n,q as o,F as a,I as g,O as I,N as T,x as E,Q as S,c as U,J as $}from"./vendor-vue-DU0w5ewx.js";import{E as b,b1 as D,a7 as z,ap as V}from"./index-B8NIXFXV.js";import{p as M}from"./pasteUploadMixin-BurWbGNQ.js";import{I as O,S as j}from"./ScrollList-BBAzavyB.js";import{I as B}from"./ImagePreview-CiFwyV10.js";import{E as q}from"./index-D2kYsNjd.js";import{E as w}from"./index-CcYxepTP.js";import{a as F,E as N}from"./index-CaJEx1sk.js";import{E as L}from"./index-BzitVkNO.js";import{E as H,a as J}from"./index-B4PZq0-5.js";import{b as Q,a as K}from"./errorCode-Cqj9Td_Z.js";import{h as W}from"./headshots-B1Qvwswm.js";import{A as X}from"./Status-C3r_aXgc.js";import{C as Y}from"./CopyToClipboard-cz_FV7JQ.js";import{E as Z}from"./index-CsMsHthC.js";import{E as x,a as ee}from"./index-IAptVusO.js";import{l as se}from"./pagination-CcnL0MdN.js";import"./use-form-item-Bsmkxazb.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-Cvgzdobq.js";import"./vendor-vue-router-9TBHB1ku.js";import"./index-qLx3hags.js";import"./index-DlZ-gpNs.js";import"./typescript-kbBRrRi0.js";import"./index-Cq_8nzqD.js";import"./_baseClone-C0vKZ-2x.js";import"./_Uint8Array-Bq4W_aZw.js";import"./_initCloneObject-nuejNsVF.js";import"./isEqual-CBKi-9mc.js";import"./debounce-B-0O6GZN.js";import"./index-CkzwyQNU.js";import"./strings-DigWlKo9.js";import"./isPlainObject-BwRYDkva.js";const te=v({name:"LayoutHeadshots",components:{ElDrawer:G,ElButton:P,FontAwesomeIcon:C},data(){return{drawer:!1}}}),oe={class:"main flex flex-row flex-1"},ae={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},ne={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function ie(e,t,m,h,k,y){const p=n("font-awesome-icon"),u=n("el-button"),i=n("el-drawer");return o(),l("div",oe,[r("div",ae,[A(e.$slots,"config",{},void 0,!0)]),r("div",ne,[A(e.$slots,"result",{},void 0,!0)]),s(u,{circle:"",class:"menu",onClick:t[0]||(t[0]=c=>e.drawer=!0)},{default:d(()=>[s(p,{icon:"fa-solid fa-gear"})]),_:1}),s(i,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=c=>e.drawer=c),"with-header":!1,size:"340px",class:"drawer"},{default:d(()=>[A(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const le=b(te,[["render",ie],["__scopeId","data-v-202b355b"]]),re=v({name:"ImageUrlsInput",components:{ElUpload:q,ElButton:P,InfoIcon:O,ImagePreview:B,FontAwesomeIcon:C},mixins:[M],data(){return{fileList:[],uploadUrl:D()+"/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.headshots?.config?.image_urls},set(){const e=this.urls;this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,image_urls:e})}}},mounted(){this.value||(this.value=void 0),this.onSetImageUrls()},methods:{onExceed(){w.warning(this.$t("headshots.message.uploadImageExceed"))},onError(){w.error(this.$t("headshots.message.uploadImageError"))},onSetImageUrls(){const e=this.urls;this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,image_urls:e})},async onSuccess(){this.onSetImageUrls()}}}),ce={class:"field"},de={class:"title font-bold"},pe={class:"upload-wrapper"};function me(e,t,m,h,k,y){const p=n("image-preview"),u=n("font-awesome-icon"),i=n("el-button"),c=n("el-upload"),f=n("info-icon");return o(),l("div",ce,[r("h2",de,a(e.$t("headshots.name.endImageUrls")),1),r("div",pe,[s(c,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",class:"value upload-wrapper",limit:2,multiple:!0,"list-type":"picture",action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:d(({file:_})=>[s(p,{url:_.url||_.response?.file_url,name:_.name,percentage:_.percentage,onRemove:R=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])]),default:d(()=>[s(i,{size:"small",type:"primary",round:""},{default:d(()=>[s(u,{icon:"fa-solid fa-upload",class:"mr-1"}),g(" "+a(e.$t("headshots.button.uploadImageUrls")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])]),s(f,{content:e.$t("headshots.description.endImageUrls"),class:"info"},null,8,["content"])])}const he=b(re,[["render",me],["__scopeId","data-v-ca56051e"]]),ue="fast",fe=v({name:"ModeSelector",components:{ElRadioButton:N,ElRadioGroup:F},data(){return{options:[{label:this.$t("headshots.button.fast"),value:"fast"},{label:this.$t("headshots.button.relax"),value:"relax"}]}},computed:{value:{get(){return this.$store.state.headshots.config?.mode},set(e){console.debug("set mode",e),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots.config,mode:e})}}},mounted(){this.value||(this.value=ue)}}),ge={class:"field"},_e={class:"title font-bold"};function $e(e,t,m,h,k,y){const p=n("el-radio-button"),u=n("el-radio-group");return o(),l("div",ge,[r("h2",_e,a(e.$t("headshots.name.mode")),1),s(u,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=i=>e.value=i),class:"mode"},{default:d(()=>[(o(!0),l(I,null,T(e.options,i=>(o(),E(p,{key:i.value,label:i.value},{default:d(()=>[g(a(i.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])])}const ve=b(fe,[["render",$e],["__scopeId","data-v-e7702494"]]),be=v({name:"StylizeSelector",components:{ElTabs:J,ElTabPane:H,ElImage:L},data(){return{tab:"styles",value:"",elements:{styles:{displayName:this.$t("headshots.styleCategory.styles"),items:[{image:"https://static.aipedias.com/aicamera/common/20241008/20241008202314260779439.png",label:this.$t("headshots.styleTag.malePportrait"),value:"male_portrait"},{image:"https://static.aipedias.com/aicamera/common/20241008/202410082022241e9755548.png",label:this.$t("headshots.styleTag.malePportrait2"),value:"male_portrait2"},{image:"https://static.aipedias.com/aicamera/common/20241101/20241101170130d78f66521.png",label:this.$t("headshots.styleTag.kindergarten"),value:"kindergarten"},{image:"https://static.aipedias.com/aicamera/common/20240923/20240923123233accf60398.webp",label:this.$t("headshots.styleTag.logoTshirt"),value:"logo_tshirt"},{image:"https://static.aipedias.com/aicamera/common/20241025/202410252012329472d0656.jpg",label:this.$t("headshots.styleTag.wedding"),value:"wedding"},{image:"https://static.aipedias.com/aicamera/common/20240915/20240915145045254931400.webp",label:this.$t("headshots.styleTag.businessPphoto"),value:"business_photo"},{image:"https://static.aipedias.com/aicamera/common/20240810/20240810194526040341795.jpg",label:this.$t("headshots.styleTag.bobSuit"),value:"bob_suit"},{image:"https://static.aipedias.com/aicamera/common/20240717/20240717152654e0b348173.webp",label:this.$t("headshots.styleTag.femalePortrait"),value:"female_portrait"}]}}}},watch:{value(e){console.debug("set template",e),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,template:e})}},mounted(){this.value||(this.value=""),console.debug("set template",this.value),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,template:this.value})},methods:{onToggle(e){this.value===e?this.value="":this.value=e,console.debug("set template",this.value),this.$store.commit("headshots/setConfig",{...this.$store.state.headshots?.config,template:this.value})}}}),ke={class:"field"},ye=["onClick"],we={class:"name"};function Ie(e,t,m,h,k,y){const p=n("el-image"),u=n("el-tab-pane"),i=n("el-tabs");return o(),l("div",ke,[s(i,{modelValue:e.tab,"onUpdate:modelValue":t[0]||(t[0]=c=>e.tab=c)},{default:d(()=>[(o(!0),l(I,null,T(e.elements,(c,f)=>(o(),E(u,{key:f,label:c.displayName,name:f,class:"pane"},{default:d(()=>[(o(!0),l(I,null,T(c.items,(_,R)=>(o(),l("div",{key:R,class:S({item:!0,active:e.value===_.value}),onClick:bs=>e.onToggle(_.value)},[s(p,{src:_.image,fit:"fill",class:"preview"},null,8,["src"]),r("span",we,a(_.label),1)],10,ye))),128))]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])])}const Te=b(be,[["render",Ie],["__scopeId","data-v-be4bd25d"]]),Ee=v({name:"PresetPanel",components:{ModeSelector:ve,ImageUrlsInput:he,ElButton:P,FontAwesomeIcon:C,ElementsSelector:Te},emits:["generate"],computed:{config(){return this.$store.state.headshots?.config}},methods:{onGenerate(){this.$emit("generate")}}}),Se={class:"panel"},Ve={class:"config"},Ce={class:"actions"};function Ae(e,t,m,h,k,y){const p=n("elements-selector"),u=n("mode-selector"),i=n("image-urls-input"),c=n("font-awesome-icon"),f=n("el-button");return o(),l("div",Se,[r("div",Ve,[s(p,{class:"mb-4"}),s(u,{class:"mb-4"}),s(i,{class:"mb-4"}),r("div",Ce,[s(f,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:d(()=>[s(c,{icon:"fa-solid fa-magic",class:"mr-2"}),g(" "+a(e.$t("headshots.button.generate")),1)]),_:1},8,["onClick"])])])])}const Pe=b(Ee,[["render",Ae],["__scopeId","data-v-848739f6"]]),Re=v({name:"ImageGallery",props:{modelValue:{type:Object,required:!0}},setup(e){return{images:U(()=>e.modelValue?.response?.data?.slice(0,2)||[]),viewImage:h=>{window.open(h,"_blank")}}}}),Le={class:"image-gallery"},Ge=["src"],Ue=["onClick"];function De(e,t,m,h,k,y){return o(),l("div",Le,[(o(!0),l(I,null,T(e.images,(p,u)=>(o(),l("div",{key:u,class:"image-container"},[r("img",{src:p.image_url,alt:"Image"},null,8,Ge),p.image_url?(o(),l("button",{key:0,class:"view-button",onClick:i=>e.viewImage(p.image_url)},a(e.$t("headshots.button.viewImage")),9,Ue)):$("",!0)]))),128))])}const ze=b(Re,[["render",De],["__scopeId","data-v-42f0a7be"]]),Me=v({name:"TaskPreview",components:{ElImage:L,CopyToClipboard:Y,FontAwesomeIcon:C,ElAlert:Z,ImageGallery:ze},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.headshots?.application},config(){return this.$store.state.headshots?.config}},methods:{onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onReload(e){const t=e.target,m=new URL(t.src),h=m.searchParams.get("retry");if(!h)m.searchParams.set("retry","1");else if(parseInt(h)<2)m.searchParams.set("retry",(parseInt(h)+1).toString());else return;t.src=m.toString()},onOpenVideo(e){window.open(e,"_blank")}}}),Oe={class:"preview"},je={class:"left"},Be={class:"main"},qe={class:"bot"},Fe={class:"datetime"},Ne={class:"info"},He={key:0,class:"prompt mt-2"},Je={key:0},Qe={key:1},Ke={key:0,class:S({content:!0,failed:!0})},We={class:"image-wrapper"},Xe={class:"description"},Ye={key:0,class:"description"},Ze={key:1,class:S({content:!0})},xe={class:"description"},es={class:"description"},ss={key:0,class:"description"},ts={class:"description"},os={key:2,class:S({content:!0})},as={class:"description"},ns={key:3,class:S({content:!0})},is={class:"description"};function ls(e,t,m,h,k,y){const p=n("el-image"),u=n("image-gallery"),i=n("font-awesome-icon"),c=n("copy-to-clipboard"),f=n("el-alert");return o(),l("div",Oe,[r("div",je,[s(p,{src:"https://cdn.acedata.cloud/isxyfw.png",class:"avatar"})]),r("div",Be,[r("div",qe,[g(a(e.$t("headshots.name.headshotsBot"))+" ",1),r("span",Fe,a(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),r("div",Ne,[e.modelValue?.request?.template?(o(),l("p",He,[g(a(e.modelValue?.request?.template)+" ",1),e.modelValue?.response?$("",!0):(o(),l("span",Je," - ("+a(e.$t("headshots.status.pending"))+") ",1)),e.modelValue?.response?.status==="unknown"?(o(),l("span",Qe," - ("+a(e.$t("headshots.status.processing"))+") ",1)):$("",!0)])):$("",!0)]),e.modelValue?.response?.success===!0?(o(),l("div",Ke,[r("div",We,[s(u,{"model-value":e.modelValue},null,8,["model-value"])]),s(f,{closable:!1,class:"mt-2 success"},{default:d(()=>[r("p",Xe,[s(i,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+a(e.$t("headshots.name.taskId"))+": "+a(e.modelValue?.id)+" ",1),s(c,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.elapsed?(o(),l("p",Ye,[s(i,{icon:"fa-solid fa-clock",class:"mr-1"}),g(" "+a(e.$t("headshots.name.elapsed"))+": "+a(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0)]),_:1})])):$("",!0),e.modelValue?.response?.success===!1?(o(),l("div",Ze,[s(f,{closable:!1,class:"failure"},{template:d(()=>[s(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),g(" "+a(e.$t("headshots.name.failure")),1)]),default:d(()=>[r("p",xe,[s(i,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+a(e.$t("headshots.name.taskId"))+": "+a(e.modelValue?.id)+" ",1),s(c,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),r("p",es,[s(i,{icon:"fa-solid fa-circle-info",class:"mr-1"}),g(" "+a(e.$t("headshots.name.failureReason"))+": "+a(e.modelValue?.response?.error?.message)+" ",1),s(c,{content:e.modelValue?.response?.error?.message,class:"btn-copy"},null,8,["content"])]),e.modelValue?.elapsed?(o(),l("p",ss,[s(i,{icon:"fa-solid fa-clock",class:"mr-1"}),g(" "+a(e.$t("headshots.name.elapsed"))+": "+a(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0),r("p",ts,[s(i,{icon:"fa-solid fa-hashtag",class:"mr-1"}),g(" "+a(e.$t("headshots.name.traceId"))+": "+a(e.modelValue?.response?.trace_id)+" ",1),s(c,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])]),_:1})])):$("",!0),e.modelValue?.response?$("",!0):(o(),l("div",os,[s(f,{closable:!1,class:"info"},{template:d(()=>[s(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),g(" "+a(e.$t("headshots.name.failure")),1)]),default:d(()=>[r("p",as,[s(i,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+a(e.$t("headshots.name.taskId"))+": "+a(e.modelValue?.id)+" ",1),s(c,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])])]),_:1})])),e.modelValue?.response?.status==="unknown"?(o(),l("div",ns,[s(f,{closable:!1,class:"info"},{template:d(()=>[s(i,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),g(" "+a(e.$t("headshots.name.failure")),1)]),default:d(()=>[r("p",is,[s(i,{icon:"fa-solid fa-magic",class:"mr-1"}),g(" "+a(e.$t("headshots.name.taskId"))+": "+a(e.modelValue?.id)+" ",1),s(c,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])])]),_:1})])):$("",!0)])])}const rs=b(Me,[["render",ls],["__scopeId","data-v-d286678e"]]),cs=v({name:"RecentPanel",components:{TaskPreview:rs,ElSkeleton:ee,ElSkeletonItem:x,ScrollList:j},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.headshots?.tasks,items:this.$store.state.headshots?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),ds={key:0,class:"tasks"},ps={class:"left"},ms={class:"main"},hs={key:1,class:"tasks"},us={key:2,class:"description"};function fs(e,t,m,h,k,y){const p=n("el-skeleton-item"),u=n("el-skeleton"),i=n("task-preview"),c=n("scroll-list");return o(),E(c,{ref:"scrollList",class:"panel recent",loading:e.loading,onReachTop:t[0]||(t[0]=f=>e.$emit("reach-top"))},{default:d(()=>[e.tasks?.items===void 0?(o(),l("div",ds,[(o(),l(I,null,T(3,f=>r("div",{key:f,class:"task placeholder"},[r("div",ps,[s(u,{animated:""},{template:d(()=>[s(p,{variant:"image",class:"avatar"})]),_:1})]),r("div",ms,[s(u,{animated:""},{template:d(()=>[s(p,{variant:"p",class:"title"}),s(p,{variant:"image",class:"icon"})]),_:1})])])),64))])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(o(),l("div",hs,[(o(!0),l(I,null,T(e.tasks?.items,(f,_)=>(o(),E(i,{key:_,"model-value":f,class:"preview"},null,8,["model-value"]))),128))])):$("",!0),e.tasks?.items?.length===0?(o(),l("p",us,a(e.$t("headshots.message.noTasks")),1)):$("",!0)]),_:1},8,["loading"])}const gs=b(cs,[["render",fs],["__scopeId","data-v-ffd55c16"]]),_s="https://webhook.acedata.cloud/headshots",$s=v({name:"HeadshotsIndex",components:{ConfigPanel:Pe,Layout:le,ApplicationStatus:X,RecentPanel:gs},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.headshots?.status?.getApplications===V.Request},tasksLoading(){return this.$store.state.headshots?.status?.getTasks===V.Request||this.fetchingTasks},service(){return this.$store.state.headshots.service},credential(){return this.$store.state.headshots.credential},config(){return this.$store.state.headshots.config},initializing(){return this.$store.state.headshots.status.getApplications===V.Request},needApply(){return this.$store.state.headshots.status.getApplications===V.Success&&!this.application},application(){return this.$store.state.headshots.application},applications(){return this.$store.state.headshots.applications},tasks(){return this.$store.state.headshots.tasks}},watch:{tasks:{handler(e,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 se({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("headshots/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("headshots/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},onApply(){z.create({application:this.application}).then(({data:e})=>{this.application=e,w.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{e?.response?.data?.code===K&&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:m,createdAtMax:h}=e||{};console.debug("limit",t,"createdAtMin",m,"createdAtMax",h),this.fetchingTasks=!0;try{await this.$store.dispatch("headshots/getTasks",{limit:t,createdAtMin:m,createdAtMax:h})}finally{this.fetchingTasks=!1}},async onGeneratePicture(){const e={...this.config,callback_url:_s},t=this.credential?.token;if(!t){console.error("no token specified");return}w.info(this.$t("headshots.message.startingTask")),W.generate(e,{token:t}).then(()=>{w.success(this.$t("headshots.message.startTaskSuccess")),this.$store.commit("headshots/setConfig",{config:void 0})}).catch(m=>{m?.response?.data?.error?.code===Q?w.error(this.$t("headshots.message.usedUp")):w.error(this.$t("headshots.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function vs(e,t,m,h,k,y){const p=n("config-panel"),u=n("application-status"),i=n("recent-panel"),c=n("layout");return o(),E(c,null,{config:d(()=>[s(p,{onGenerate:e.onGeneratePicture},null,8,["onGenerate"])]),result:d(()=>[s(u,{initializing:e.initializing,application:e.application,applications:e.applications,service:e.service,"need-apply":e.needApply,class:"mb-4",onRefresh:e.onGetApplication,onSelect:t[0]||(t[0]=f=>e.$store.dispatch("headshots/setApplication",f))},null,8,["initializing","application","applications","service","need-apply","onRefresh"]),s(i,{ref:"recentPanel",class:"panel recent",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const at=b($s,[["render",vs],["__scopeId","data-v-6cafffbd"]]);export{at as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as D}from"./index.es-DvoJym95.js";import{E as W}from"./index-CrqDHQpz.js";import{E as oe}from"./index-CipihCqd.js";import{d as b,H as c,E as o,z as B,C as s,y as d,D as r,q as n,F as a,O as G,N as q,J as f,x as v,I as U,G as R,K as H,M as P,u as A,c as T,w as se,L as ne}from"./vendor-vue-DU0w5ewx.js";import{E as V,b1 as re,e5 as Y,e6 as Q,S as K,H as ie,ap as L,e7 as Z,e8 as ae,a7 as le}from"./index-EDbdzYoK.js";import{a as ce}from"./errorCode-Cqj9Td_Z.js";import{p as I}from"./producer-BKIvC5XG.js";import{b as de}from"./producer-DP85fuAq.js";import{E as ue}from"./index-CSFjwfq-.js";import{E as pe,a as me}from"./index-JNYacQYq.js";import{I as F,S as fe}from"./ScrollList-CovUKJRB.js";import{E as he}from"./index-5H0Kze44.js";import{E as w}from"./index-Ds9jhuB5.js";import{E as z}from"./index-DkM4K-wL.js";import{u as j,F as _e,O as $e,_ as ee,P as ge,a as ve,V as ye,E as ke}from"./IconPark.vue_vue_type_script_setup_true_lang-D44ASjV4.js";import{E as X,a as x}from"./index-D91uKTD2.js";import{E as N}from"./index-BlU0CedW.js";import{E as be,a as we}from"./index-RS4-DC1h.js";import{E as Ce,a as Ve}from"./index-yPnDviqN.js";import{C as Se}from"./Consumption-BakyhCvI.js";import{a as Ue}from"./price-BA67S4AC.js";import{E as Ee,b as Pe,a as Ae}from"./index-DxblRLq7.js";import{E as Te}from"./index-l-4qvBYE.js";import{E as Fe}from"./index-BVYzn_oH.js";import{N as Ie}from"./NoTasks-C5sE70CP.js";import{a as Le,E as Ge}from"./index-BrEa1c2p.js";import{l as je}from"./pagination-CcnL0MdN.js";import"./use-form-item-D2iN_ybD.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-Cvgzdobq.js";import"./vendor-vue-router-9TBHB1ku.js";import"./validator-jTFG2Dtu.js";import"./index-Ckk9018y.js";import"./index-CRx3Uhyj.js";import"./typescript-D6u-C9xv.js";import"./strings-DigWlKo9.js";import"./isEqual-DM0CxUu8.js";import"./_Uint8Array-CRruIzWx.js";import"./castArray-CeKiSygi.js";import"./debounce-CoHXkWvt.js";import"./_baseIteratee-BP4ZRuLO.js";import"./index-DPUTXoQP.js";import"./index-D6ZTnX5Z.js";import"./_baseClone-c0H4QFpc.js";import"./_initCloneObject-zrgKx4gY.js";import"./index-tCoyl_xR.js";import"./index-Bz0iDXPF.js";import"./index-Bs5rZiQM.js";import"./dropdown-Cqvd8OOk.js";const De=b({name:"LayoutProducer",components:{ElDrawer:oe,ElButton:W,FontAwesomeIcon:D},data(){return{drawer:!1,preview:!1}},computed:{}}),Re={class:"main flex flex-row flex-1"},Ze={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},ze={class:"result h-full flex flex-col flex-1 min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"},Ne={class:"preview h-full w-[300px] flex flex-col"};function Me(e,t,l,i,h,p){const u=r("font-awesome-icon"),m=r("el-button"),_=r("el-drawer");return n(),c("div",Re,[o("div",Ze,[B(e.$slots,"config",{},void 0,!0)]),o("div",ze,[B(e.$slots,"result",{},void 0,!0)]),o("div",Ne,[B(e.$slots,"preview",{},void 0,!0)]),s(m,{circle:"",class:"menu",onClick:t[0]||(t[0]=$=>e.drawer=!0)},{default:d(()=>[s(u,{icon:"fa-solid fa-magic"})]),_:1}),s(_,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=$=>e.drawer=$),direction:"ltr","with-header":!1,size:"340px",class:"drawer"},{default:d(()=>[B(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Oe=V(De,[["render",Me],["__scopeId","data-v-7453886f"]]),Be=b({name:"TypeSelector",components:{ElSelect:me,ElOption:pe,ElSwitch:ue},data(){return{options:[{label:"FUZZ-2.0 Pro",value:"FUZZ-2.0 Pro",info:"8 min"},{label:"FUZZ-2.0",value:"FUZZ-2.0",info:"8 min"},{label:"FUZZ-2.0 Raw",value:"FUZZ-2.0 Raw",info:"8 min"},{label:"FUZZ-1.1 Pro",value:"FUZZ-1.1 Pro",info:"4 min"},{label:"FUZZ-1.0 Pro",value:"FUZZ-1.0 Pro",info:"4 min"},{label:"FUZZ-1.1",value:"FUZZ-1.1",info:"4 min"},{label:"FUZZ-1.0",value:"FUZZ-1.0",info:"2 min"},{label:"FUZZ-0.8",value:"FUZZ-0.8",info:"2 min"}]}},computed:{custom:{get(){return this.$store.state.producer?.config?.custom||!1},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,custom:e})}},instrumental:{get(){return this.$store.state.producer?.config?.instrumental||!1},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,instrumental:e})}},model:{get(){return this.$store.state.producer?.config?.model},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,model:e})}}},mounted(){this.model||(this.model=de)}}),qe={class:"flex items-center justify-between mb-3"},We={class:"text-sm font-bold"},He={class:"mb-3"},Ke={class:"flex items-center mb-1"},Je={class:"text-sm font-bold"},Ye={class:"flex items-center justify-between w-full"},Qe={class:"text-xs text-[var(--el-text-color-placeholder)]"},Xe={key:0,class:"flex items-center justify-between mb-3"},xe={class:"text-sm font-bold"};function et(e,t,l,i,h,p){const u=r("el-switch"),m=r("el-option"),_=r("el-select");return n(),c("div",null,[o("div",qe,[o("span",We,a(e.$t("producer.name.type")),1),s(u,{modelValue:e.custom,"onUpdate:modelValue":t[0]||(t[0]=$=>e.custom=$)},null,8,["modelValue"])]),o("div",He,[o("div",Ke,[o("span",Je,a(e.$t("producer.name.model")),1)]),s(_,{modelValue:e.model,"onUpdate:modelValue":t[1]||(t[1]=$=>e.model=$),class:"w-full",size:"default",placeholder:e.$t("producer.placeholder.select")},{default:d(()=>[(n(!0),c(G,null,q(e.options,$=>(n(),v(m,{key:$.value,label:$.label,value:$.value},{default:d(()=>[o("div",Ye,[o("span",null,a($.label),1),o("span",Qe,a($.info),1)])]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),e.custom?(n(),c("div",Xe,[o("span",xe,a(e.$t("producer.name.instrumental")),1),s(u,{modelValue:e.instrumental,"onUpdate:modelValue":t[2]||(t[2]=$=>e.instrumental=$)},null,8,["modelValue"])])):f("",!0)])}const tt=V(Be,[["render",et]]),ot=b({name:"UploadAudio",components:{ElUpload:he,ElButton:W,InfoIcon:F,FontAwesomeIcon:D},emits:["change"],data(){return{fileList:[],uploadUrl:re()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},credential(){return this.$store.state.producer.credential},config(){return this.$store.state.producer.config},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.producer?.config?.audio_id},set(){}}},watch:{urls:{handler(e){this.$emit("change",e)}}},mounted(){this.value||(this.value=void 0),this.onSetAudio()},methods:{onExceed(){w.warning(this.$t("producer.message.uploadReferencesExceed"))},onError(){w.error(this.$t("producer.message.uploadReferencesError"))},async onSuccess(){const e=this.urls?.[0];await this.onGenerateAudioId(e)},async onGenerateAudioId(e){const t={audio_url:e},l=this.credential?.token;if(!l){console.error("no token specified");return}w.info(this.$t("producer.message.startingUploadAudio")),I.upload(t,{token:l}).then(i=>{console.debug("get upload music success",i.data);const h=i.data?.data.audio_id;this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,audio_id:h,action:"upload_extend"}),w.success(this.$t("producer.message.startUploadAudioSuccess"))}).catch(i=>{w.error(i?.response?.data?.error?.message||this.$t("producer.message.startUploadAudioFailed"))})},onSetAudio(){}}}),st={class:"relative"},nt={class:"flex justify-between"},rt={class:"flex justify-start items-center"},it={class:"text-sm font-bold"};function at(e,t,l,i,h,p){const u=r("info-icon"),m=r("font-awesome-icon"),_=r("el-button"),$=r("el-upload");return n(),c("div",st,[o("div",nt,[o("div",rt,[o("span",it,a(e.$t("producer.name.referenceAudios")),1),s(u,{content:e.$t("producer.description.uploadAudios")},null,8,["content"])])]),s($,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=k=>e.fileList=k),name:"file",limit:1,class:"upload-wrapper",action:e.uploadUrl,accept:".mp3","show-file-list":!0,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{default:d(()=>[s(_,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:d(()=>[s(m,{icon:"fa-solid fa-upload",class:"icon mr-1"}),U(" "+a(e.$t("producer.button.uploadAudios")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const lt=V(ot,[["render",at],["__scopeId","data-v-e4cd0467"]]),ct="",dt=b({name:"PromptInput",components:{ElInput:z,InfoIcon:F},computed:{prompt:{get(){return this.$store.state.producer?.config?.prompt},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=ct)}}),ut={class:"field"},pt={class:"flex items-center mb-1"},mt={class:"text-sm font-bold"};function ft(e,t,l,i,h,p){const u=r("info-icon"),m=r("el-input");return n(),c("div",ut,[o("div",pt,[o("span",mt,a(e.$t("producer.name.songDescription")),1),s(u,{content:e.$t("producer.description.prompt")},null,8,["content"])]),s(m,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=_=>e.prompt=_),rows:4,type:"textarea",placeholder:e.$t("producer.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const ht=V(dt,[["render",ft]]),_t="",$t=b({name:"LyricInput",components:{ElInput:z,ElButton:W,FontAwesomeIcon:D,InfoIcon:F},data(){return{generatingLyrics:!1}},computed:{lyric:{get(){return this.$store.state.producer?.config?.lyric},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,lyric:e})}},config(){return this.$store.state.producer?.config},credential(){return this.$store.state.producer?.credential}},mounted(){this.lyric||(this.lyric=_t)},methods:{async onGenerateLyrics(){const e=this.credential?.token;if(!e)return;const t=this.config?.style||this.config?.title||"a beautiful song";this.generatingLyrics=!0,w.info(this.$t("producer.message.generatingLyrics"));try{const i=(await I.lyric({prompt:t},{token:e})).data?.data;i?.text&&(this.lyric=i.text,i?.title&&!this.config?.title&&this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,lyric:i.text,title:i.title}),w.success(this.$t("producer.message.generateLyricsSuccess")))}catch{w.error(this.$t("producer.message.generateLyricsFailed"))}finally{this.generatingLyrics=!1}}}}),gt={class:"field"},vt={class:"flex items-center justify-between mb-1"},yt={class:"flex items-center"},kt={class:"text-sm font-bold"};function bt(e,t,l,i,h,p){const u=r("info-icon"),m=r("font-awesome-icon"),_=r("el-button"),$=r("el-input");return n(),c("div",gt,[o("div",vt,[o("div",yt,[o("span",kt,a(e.$t("producer.name.lyrics")),1),s(u,{content:e.$t("producer.description.lyrics")},null,8,["content"])]),e.config?.action!=="extend"?(n(),v(_,{key:0,size:"small",loading:e.generatingLyrics,round:"",onClick:e.onGenerateLyrics},{default:d(()=>[e.generatingLyrics?f("",!0):(n(),v(m,{key:0,icon:"fa-solid fa-wand-magic-sparkles",class:"mr-1"})),U(" "+a(e.$t("producer.button.generate_lyrics")),1)]),_:1},8,["loading","onClick"])):f("",!0)]),e.config?.action!=="extend"?(n(),v($,{key:0,modelValue:e.lyric,"onUpdate:modelValue":t[0]||(t[0]=k=>e.lyric=k),rows:5,type:"textarea",class:"lyrics",placeholder:e.$t("producer.placeholder.lyrics")},null,8,["modelValue","placeholder"])):(n(),v($,{key:1,modelValue:e.lyric,"onUpdate:modelValue":t[1]||(t[1]=k=>e.lyric=k),rows:5,type:"textarea",class:"lyrics",placeholder:e.$t("producer.placeholder.extend.lyrics")},null,8,["modelValue","placeholder"]))])}const wt=V($t,[["render",bt],["__scopeId","data-v-88c6da2b"]]),Ct=b({name:"StyleInput",components:{ElInput:z,InfoIcon:F},computed:{style:{get(){return this.$store.state.producer?.config?.style},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,style:e})}}}}),Vt={class:"field"},St={class:"flex items-center justify-between mb-1"},Ut={class:"flex items-center"},Et={class:"text-sm font-bold"};function Pt(e,t,l,i,h,p){const u=r("info-icon"),m=r("el-input");return n(),c("div",Vt,[o("div",St,[o("div",Ut,[o("span",Et,a(e.$t("producer.name.style")),1),s(u,{content:e.$t("producer.description.style")},null,8,["content"])])]),s(m,{modelValue:e.style,"onUpdate:modelValue":t[0]||(t[0]=_=>e.style=_),rows:2,type:"textarea",placeholder:e.$t("producer.placeholder.style")},null,8,["modelValue","placeholder"])])}const At=V(Ct,[["render",Pt]]),Tt=b({name:"TitleInput",components:{ElInput:z,InfoIcon:F},computed:{title:{get(){return this.$store.state.producer?.config?.title},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,title:e})}}}}),Ft={class:"field"},It={class:"flex items-center mb-1"},Lt={class:"text-sm font-bold"};function Gt(e,t,l,i,h,p){const u=r("info-icon"),m=r("el-input");return n(),c("div",Ft,[o("div",It,[o("span",Lt,a(e.$t("producer.name.title")),1),s(u,{content:e.$t("producer.description.title")},null,8,["content"])]),s(m,{modelValue:e.title,"onUpdate:modelValue":t[0]||(t[0]=_=>e.title=_),placeholder:e.$t("producer.placeholder.title")},null,8,["modelValue","placeholder"])])}const jt=V(Tt,[["render",Gt]]),Dt=b({name:"ExtendFromInput",components:{ElImage:N,ElIcon:K,ElInputNumber:X,VideoPlay:Q,VideoPause:Y},data(){return{}},computed:{audio(){return this.$store.state.producer?.config?.audio},value:{get(){return this.$store.state.producer?.config?.continue_at},set(e){console.debug("set continue_at",e),this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,continue_at:e?parseInt(e):void 0})}}},mounted(){this.value||(this.value=void 0)},methods:{handleChange(e){if(e===void 0){this.value=void 0;return}e<0?this.value=0:e>this.audio?.duration?this.value=this.audio?.duration:this.value=e},useFormatDuring:j,onPlay(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){this.$store.state?.producer?.audio?.id!==e.id&&this.onPlay({...e,progress:0})}}}),Rt={class:"field"},Zt={class:"box"},zt={class:"title font-bold"},Nt={class:"input-wrapper"},Mt={class:"task"},Ot={class:"left"},Bt={key:2,class:"duration"},qt={class:"info"},Wt={class:"title"},Ht={class:"style"};function Kt(e,t,l,i,h,p){const u=r("el-input-number"),m=r("el-image"),_=r("video-pause"),$=r("el-icon"),k=r("video-play"),y=H("loading");return n(),c("div",Rt,[o("div",Zt,[o("h2",zt,a(e.$t("producer.name.extend")),1),o("div",Nt,[s(u,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=E=>e.value=E),class:"value",min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t("producer.placeholder.extend.continue_at"),onChange:e.handleChange},null,8,["modelValue","max","placeholder","onChange"])])]),o("div",Mt,[e.audio?(n(),c("div",{key:0,class:"audio",onClick:t[3]||(t[3]=E=>e.onClick(e.audio))},[R((n(),c("div",Ot,[s(m,{src:e.audio?.image_url,class:"cover",fit:"cover"},null,8,["src"]),e.audio?.audio_url&&e.$store.state?.producer?.audio?.id===e.audio.id&&e.$store.state?.producer?.audio?.state==="playing"?(n(),c("div",{key:0,class:"overlay",onClick:t[1]||(t[1]=E=>e.onPause(e.audio))},[s($,null,{default:d(()=>[s(_)]),_:1})])):f("",!0),e.audio?.audio_url&&(e.$store.state?.producer?.audio?.id!==e.audio.id||e.$store.state?.producer?.audio?.id===e.audio.id&&e.$store.state?.producer?.audio?.state==="paused")?(n(),c("div",{key:1,class:"overlay",onClick:t[2]||(t[2]=E=>e.onPlay(e.audio))},[s($,null,{default:d(()=>[s(k)]),_:1})])):f("",!0),e.audio?.duration?(n(),c("div",Bt,a(e.useFormatDuring(e.audio?.duration)),1)):f("",!0)])),[[y,!e.audio?.audio_url]]),o("div",qt,[o("h2",Wt,a(e.audio?.title),1),o("p",Ht,a(e.audio?.style),1)])])):f("",!0)])])}const Jt=V(Dt,[["render",Kt],["__scopeId","data-v-26d43480"]]),Yt=b({name:"CoverFromInput",components:{ElImage:N,ElIcon:K,VideoPlay:Q,VideoPause:Y},data(){return{}},computed:{audio(){return this.$store.state.producer?.config?.audio},value:{get(){return this.$store.state.producer?.config?.continue_at},set(e){console.debug("set continue_at",e),this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,continue_at:e?parseInt(e):void 0})}}},mounted(){this.value||(this.value=void 0)},methods:{handleChange(e){e<0?this.value=0:e>this.audio?.duration?this.value=this.audio?.duration:this.value=e},useFormatDuring:j,onPlay(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){this.$store.state?.producer?.audio?.id!==e.id&&this.onPlay({...e,progress:0})}}}),Qt={class:"field"},Xt={class:"box"},xt={class:"title font-bold"},eo={class:"task"},to={class:"left"},oo={key:2,class:"duration"},so={class:"info"},no={class:"title"},ro={class:"style"};function io(e,t,l,i,h,p){const u=r("el-image"),m=r("video-pause"),_=r("el-icon"),$=r("video-play"),k=H("loading");return n(),c("div",Qt,[o("div",Xt,[o("h2",xt,a(e.$t("producer.name.cover")),1)]),o("div",eo,[e.audio?(n(),c("div",{key:0,class:"audio",onClick:t[2]||(t[2]=y=>e.onClick(e.audio))},[R((n(),c("div",to,[s(u,{src:e.audio?.image_url,class:"cover",fit:"cover"},null,8,["src"]),e.audio?.audio_url&&e.$store.state?.producer?.audio?.id===e.audio.id&&e.$store.state?.producer?.audio?.state==="playing"?(n(),c("div",{key:0,class:"overlay",onClick:t[0]||(t[0]=y=>e.onPause(e.audio))},[s(_,null,{default:d(()=>[s(m)]),_:1})])):f("",!0),e.audio?.audio_url&&(e.$store.state?.producer?.audio?.id!==e.audio.id||e.$store.state?.producer?.audio?.id===e.audio.id&&e.$store.state?.producer?.audio?.state==="paused")?(n(),c("div",{key:1,class:"overlay",onClick:t[1]||(t[1]=y=>e.onPlay(e.audio))},[s(_,null,{default:d(()=>[s($)]),_:1})])):f("",!0),e.audio?.duration?(n(),c("div",oo,a(e.useFormatDuring(e.audio?.duration)),1)):f("",!0)])),[[k,!e.audio?.audio_url]]),o("div",so,[o("h2",no,a(e.audio?.title),1),o("p",ro,a(e.audio?.style),1)])])):f("",!0)])])}const ao=V(Yt,[["render",io],["__scopeId","data-v-d8a8e583"]]),lo=b({name:"VocalGenderSelector",components:{ElRadioGroup:we,ElRadioButton:be,InfoIcon:F},computed:{vocalGender:{get(){return this.$store.state.producer?.config?.vocal_gender||""},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,vocal_gender:e||void 0})}}}}),co={class:"mb-2"},uo={class:"flex items-center mb-1"},po={class:"text-sm font-bold"};function mo(e,t,l,i,h,p){const u=r("info-icon"),m=r("el-radio-button"),_=r("el-radio-group");return n(),c("div",co,[o("div",uo,[o("span",po,a(e.$t("producer.name.vocalGender")),1),s(u,{content:e.$t("producer.description.vocalGender")},null,8,["content"])]),s(_,{modelValue:e.vocalGender,"onUpdate:modelValue":t[0]||(t[0]=$=>e.vocalGender=$)},{default:d(()=>[s(m,{value:""},{default:d(()=>[U(a(e.$t("producer.gender.auto")),1)]),_:1}),s(m,{value:"f"},{default:d(()=>[U(a(e.$t("producer.gender.female")),1)]),_:1}),s(m,{value:"m"},{default:d(()=>[U(a(e.$t("producer.gender.male")),1)]),_:1})]),_:1},8,["modelValue"])])}const fo=V(lo,[["render",mo]]),ho=b({name:"AdvancedParams",components:{ElCollapse:Ve,ElCollapseItem:Ce,ElInput:z,ElSlider:x,ElInputNumber:X},data(){return{activeNames:[]}},computed:{config(){return this.$store.state.producer?.config},styleNegative:{get(){return this.$store.state.producer?.config?.style_negative||""},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,style_negative:e||void 0})}},lyricPrompt:{get(){return this.$store.state.producer?.config?.lyric_prompt||""},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,lyric_prompt:e||void 0})}},weirdness:{get(){return this.$store.state.producer?.config?.weirdness??0},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,weirdness:e||void 0})}},soundStrength:{get(){return this.$store.state.producer?.config?.sound_strength??50},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,sound_strength:e})}},lyricsStrength:{get(){return this.$store.state.producer?.config?.lyrics_strength??50},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,lyrics_strength:e})}},seed:{get(){return this.$store.state.producer?.config?.seed},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,seed:e})}}}}),_o={key:0,class:"mb-3"},$o={class:"flex items-center mb-1"},go={class:"text-xs font-bold"},vo={key:1,class:"mb-3"},yo={class:"flex items-center mb-1"},ko={class:"text-xs font-bold"},bo={key:2,class:"mb-3"},wo={class:"flex items-center justify-between mb-1"},Co={class:"text-xs font-bold"},Vo={class:"text-xs text-[var(--el-text-color-secondary)]"},So={key:3,class:"mb-3"},Uo={class:"flex items-center justify-between mb-1"},Eo={class:"text-xs font-bold"},Po={class:"text-xs text-[var(--el-text-color-secondary)]"},Ao={key:4,class:"mb-3"},To={class:"flex items-center justify-between mb-1"},Fo={class:"text-xs font-bold"},Io={class:"text-xs text-[var(--el-text-color-secondary)]"},Lo={key:5,class:"mb-3"},Go={class:"flex items-center mb-1"},jo={class:"text-xs font-bold"};function Do(e,t,l,i,h,p){const u=r("el-input"),m=r("el-slider"),_=r("el-input-number"),$=r("el-collapse-item"),k=r("el-collapse");return n(),v(k,{modelValue:e.activeNames,"onUpdate:modelValue":t[6]||(t[6]=y=>e.activeNames=y),class:"advanced-collapse"},{default:d(()=>[s($,{title:e.$t("producer.name.advancedParams"),name:"advanced"},{default:d(()=>[e.config?.custom?(n(),c("div",_o,[o("div",$o,[o("span",go,a(e.$t("producer.name.styleNegative")),1)]),s(u,{modelValue:e.styleNegative,"onUpdate:modelValue":t[0]||(t[0]=y=>e.styleNegative=y),placeholder:e.$t("producer.placeholder.styleNegative")},null,8,["modelValue","placeholder"])])):f("",!0),e.config?.custom&&!e.config?.instrumental?(n(),c("div",vo,[o("div",yo,[o("span",ko,a(e.$t("producer.name.lyricPrompt")),1)]),s(u,{modelValue:e.lyricPrompt,"onUpdate:modelValue":t[1]||(t[1]=y=>e.lyricPrompt=y),placeholder:e.$t("producer.placeholder.lyricPrompt")},null,8,["modelValue","placeholder"])])):f("",!0),e.config?.custom?(n(),c("div",bo,[o("div",wo,[o("span",Co,a(e.$t("producer.name.weirdness")),1),o("span",Vo,a(e.weirdness??0),1)]),s(m,{modelValue:e.weirdness,"onUpdate:modelValue":t[2]||(t[2]=y=>e.weirdness=y),min:0,max:100,step:1},null,8,["modelValue"])])):f("",!0),e.config?.custom?(n(),c("div",So,[o("div",Uo,[o("span",Eo,a(e.$t("producer.name.soundStrength")),1),o("span",Po,a(e.soundStrength??50),1)]),s(m,{modelValue:e.soundStrength,"onUpdate:modelValue":t[3]||(t[3]=y=>e.soundStrength=y),min:0,max:100,step:1},null,8,["modelValue"])])):f("",!0),e.config?.custom&&!e.config?.instrumental?(n(),c("div",Ao,[o("div",To,[o("span",Fo,a(e.$t("producer.name.lyricsStrength")),1),o("span",Io,a(e.lyricsStrength??50),1)]),s(m,{modelValue:e.lyricsStrength,"onUpdate:modelValue":t[4]||(t[4]=y=>e.lyricsStrength=y),min:0,max:100,step:1},null,8,["modelValue"])])):f("",!0),e.config?.custom?(n(),c("div",Lo,[o("div",Go,[o("span",jo,a(e.$t("producer.name.seed")),1)]),s(_,{modelValue:e.seed,"onUpdate:modelValue":t[5]||(t[5]=y=>e.seed=y),min:0,controls:!1,placeholder:e.$t("producer.placeholder.seed"),class:"w-full"},null,8,["modelValue","placeholder"])])):f("",!0)]),_:1},8,["title"])]),_:1},8,["modelValue"])}const Ro=V(ho,[["render",Do],["__scopeId","data-v-88e65aee"]]),Zo=b({name:"ReplaceSectionInput",components:{ElInputNumber:X,ElImage:N,InfoIcon:F},computed:{audio(){return this.$store.state.producer?.config?.audio},replaceSectionStart:{get(){return this.$store.state.producer?.config?.replace_section_start},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,replace_section_start:e})}},replaceSectionEnd:{get(){return this.$store.state.producer?.config?.replace_section_end},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,replace_section_end:e})}}},methods:{onClick(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"playing"})}}}),zo={class:"field"},No={class:"flex items-center mb-2"},Mo={class:"text-sm font-bold m-0"},Oo={key:0,class:"task mb-2"},Bo={class:"left relative w-[50px] h-[50px] mr-3 flex-shrink-0"},qo={class:"info flex-1 min-w-0"},Wo={class:"text-sm font-bold m-0 truncate"},Ho={class:"text-xs text-[var(--el-text-color-secondary)] m-0 truncate"},Ko={class:"flex gap-2"};function Jo(e,t,l,i,h,p){const u=r("info-icon"),m=r("el-image"),_=r("el-input-number"),$=H("loading");return n(),c("div",zo,[o("div",No,[o("h2",Mo,a(e.$t("producer.name.replaceSection")),1),s(u,{content:e.$t("producer.description.replaceSection")},null,8,["content"])]),e.audio?(n(),c("div",Oo,[o("div",{class:"audio flex items-center",onClick:t[0]||(t[0]=k=>e.onClick(e.audio))},[R((n(),c("div",Bo,[s(m,{src:e.audio?.image_url,class:"w-full h-full rounded",fit:"cover"},null,8,["src"])])),[[$,!e.audio?.audio_url]]),o("div",qo,[o("h2",Wo,a(e.audio?.title),1),o("p",Ho,a(e.audio?.style),1)])])])):f("",!0),o("div",Ko,[s(_,{modelValue:e.replaceSectionStart,"onUpdate:modelValue":t[1]||(t[1]=k=>e.replaceSectionStart=k),class:"flex-1",min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t("producer.placeholder.replaceSectionStart")},null,8,["modelValue","max","placeholder"]),s(_,{modelValue:e.replaceSectionEnd,"onUpdate:modelValue":t[2]||(t[2]=k=>e.replaceSectionEnd=k),class:"flex-1",min:e.replaceSectionStart||0,max:e.audio?.duration,controls:!1,placeholder:e.$t("producer.placeholder.replaceSectionEnd")},null,8,["modelValue","min","max","placeholder"])])])}const Yo=V(Zo,[["render",Jo]]),Qo=b({name:"PresetPanel",components:{TypeSelector:tt,PromptInput:ht,LyricInput:wt,StyleInput:At,TitleInput:jt,ExtendFromInput:Jt,CoverFromInput:ao,UploadAudio:lt,VocalGenderSelector:fo,AdvancedParams:Ro,ReplaceSectionInput:Yo,FontAwesomeIcon:D,ElButton:W,Consumption:Se},emits:["generate"],computed:{config(){return this.$store.state.producer?.config},consumption(){return Ue(this.config,this.service?.cost)},service(){return this.$store.state.producer?.service},generateButtonText(){const e=this.config?.action;return e==="extend"?this.$t("producer.button.extend"):e==="cover"?this.$t("producer.button.cover_music"):e==="variation"?this.$t("producer.button.variation"):e==="replace_section"?this.$t("producer.button.replace_section"):e==="stems"?this.$t("producer.button.get_stems"):e==="swap_vocals"?this.$t("producer.button.swap_vocals"):e==="swap_instrumentals"?this.$t("producer.button.swap_instrumentals"):this.$t("producer.button.generate")}},methods:{onGenerate(){this.$emit("generate")}}}),Xo={class:"flex flex-col h-full"},xo={class:"flex-1 overflow-y-auto p-5"},es={class:"flex flex-col items-center justify-center px-5 pb-5"};function ts(e,t,l,i,h,p){const u=r("type-selector"),m=r("upload-audio"),_=r("prompt-input"),$=r("lyric-input"),k=r("style-input"),y=r("title-input"),E=r("vocal-gender-selector"),S=r("extend-from-input"),M=r("cover-from-input"),O=r("replace-section-input"),J=r("advanced-params"),g=r("consumption"),C=r("font-awesome-icon"),te=r("el-button");return n(),c("div",Xo,[o("div",xo,[s(u,{class:"mb-4"}),s(m,{class:"mb-4"}),e.config?.custom?f("",!0):(n(),v(_,{key:0,class:"mb-4"})),e.config?.custom&&!e.config.instrumental?(n(),v($,{key:1,class:"mb-4"})):f("",!0),e.config?.custom?(n(),v(k,{key:2,class:"mb-4"})):f("",!0),e.config?.custom?(n(),v(y,{key:3,class:"mb-4"})):f("",!0),e.config?.custom&&!e.config.instrumental?(n(),v(E,{key:4,class:"mb-4"})):f("",!0),e.config?.action==="extend"?(n(),v(S,{key:5,class:"mb-4"})):f("",!0),e.config?.action==="cover"?(n(),v(M,{key:6,class:"mb-4"})):f("",!0),e.config?.action==="replace_section"?(n(),v(O,{key:7,class:"mb-4"})):f("",!0),s(J,{class:"mb-4"})]),o("div",es,[s(g,{value:e.consumption,service:e.service},null,8,["value","service"]),s(te,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:d(()=>[s(C,{icon:"fa-solid fa-magic",class:"mr-2"}),U(" "+a(e.generateButtonText),1)]),_:1},8,["onClick"])])])}const os=V(Qo,[["render",ts],["__scopeId","data-v-6642bb3c"]]),ss="https://webhook.acedata.cloud/producer",ns=b({name:"TaskPreview",components:{ElImage:N,ElIcon:K,ElTooltip:Te,FontAwesomeIcon:D,VideoPlay:Q,VideoPause:Y,ElDropdown:Ae,ElDropdownMenu:Pe,ElDropdownItem:Ee,Loading:ie},props:{modelValue:{type:Object,required:!0}},data(){return{isFetchingVideoUrl:!1,isFetchingWav:!1}},computed:{loading(){return this.$store.state.producer?.status?.getApplications===L.Request},credential(){return this.$store.state.producer.credential},config(){return this.$store.state.producer.config},task(){return this.$store.state.producer?.tasks},audios(){const e=this.modelValue?.response?.data??[],t=this.modelValue?.request?.action;return t?e.map(l=>({...l,action:t})):e},application(){return this.$store.state.producer?.application},active(){return this.$store.state.producer?.tasks?.active}},methods:{useFormatDuring:j,onPlay(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){this.$store.state?.producer?.audio?.id!==e.id&&this.onPlay({...e,progress:0})},onExtend(e,t){e.stopPropagation(),console.debug("set config",t),this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,model:t.model,custom:!0,instrumental:!1,style:t.style,action:"extend",audio:t,audio_id:t.id,continue_at:t.duration})},onDownload(e,t){e&&e.stopPropagation();const i=new URL(t).pathname,h=i.substring(i.lastIndexOf("/")+1);fetch(t).then(p=>p.blob()).then(p=>{_e.saveAs(p,h)})},async handleVideoDownload(e){if(e.video_url){this.onDownload(null,e.video_url);return}if(!this.isFetchingVideoUrl)try{this.isFetchingVideoUrl=!0;const t=await this.fetchVideoUrlFromApi(e?.id);console.log(`get videoUrl: ${t}`),e.video_url=t,this.onDownload(null,t)}catch(t){console.error("get videoUrl failed:",t),w.error(this.$t("producer.message.getVideoUrlFailed"))}finally{this.isFetchingVideoUrl=!1}},async fetchVideoUrlFromApi(e){return new Promise((t,l)=>{const i={audio_id:e},h=this.credential?.token;if(!h){console.error("no token specified"),l(new Error("No token specified"));return}I.video(i,{token:h}).then(p=>{const u=p.data?.data?.video_url;u?t(u):l(new Error("Video URL not found in response"))}).catch(p=>{l(p)})})},onPreview(e,t){e.stopPropagation(),window.open(t,"_blank")},async onGetStems(e){await this.onGenerateAudioUrl("stems",e)},onCover(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,model:e.model,custom:!0,instrumental:!1,style:e.style,action:"cover",audio:e,audio_id:e.id})},onVariation(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,model:e.model,custom:!0,style:e.style,action:"variation",audio:e,audio_id:e.id})},async onSwapVocals(e){await this.onGenerateAudioUrl("swap_vocals",e)},async onSwapInstrumentals(e){await this.onGenerateAudioUrl("swap_instrumentals",e)},async onGetAllStems(e){await this.onGenerateAudioUrl("all_stems",e)},onReplaceSection(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,model:e.model,custom:!0,instrumental:!1,style:e.style,action:"replace_section",audio:e,audio_id:e.id,replace_section_start:0,replace_section_end:Math.min(30,e.duration||30)})},async handleWavDownload(e){if(!e?.id||this.isFetchingWav)return;const t=this.credential?.token;if(t)try{this.isFetchingWav=!0,w.info(this.$t("producer.message.fetchingWav"));const i=(await I.wav({audio_id:e.id},{token:t})).data?.data?.audio_url;i?this.onDownload(null,i):w.error(this.$t("producer.message.fetchWavFailed"))}catch{w.error(this.$t("producer.message.fetchWavFailed"))}finally{this.isFetchingWav=!1}},async onGenerateAudioUrl(e,t){const l={action:e,audio_id:t,callback_url:ss},i=this.credential?.token;if(!i){console.error("no token specified");return}w.info(this.$t("producer.message.startingTask")),I.audio(l,{token:i}).then(()=>{w.success(this.$t("producer.message.startTaskSuccess"))}).catch(h=>{w.error(h?.response?.data?.error?.message||this.$t("producer.message.startTaskFailed"))}).finally(async()=>{await this.onGetTasks(),await this.onScrollDown()})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".tasks");e&&(e.scrollTop=e.scrollHeight)},1e3)},async onGetTasks(){if(this.loading){console.debug("loading");return}await this.$store.dispatch("producer/getTasks",{limit:30,offset:0})}}}),rs={class:"task"},is=["onClick"],as={class:"left"},ls=["onClick"],cs=["onClick"],ds={key:2,class:"duration"},us={class:"info"},ps={class:"title"},ms={class:"style"},fs={class:"right"},hs={class:"el-dropdown-link"},_s={class:"flex items-center min-w-[120px]"},$s={class:"flex items-center min-w-[120px]"},gs={class:"el-dropdown-link"};function vs(e,t,l,i,h,p){const u=r("el-image"),m=r("video-pause"),_=r("el-icon"),$=r("video-play"),k=r("font-awesome-icon"),y=r("el-tooltip"),E=r("Loading"),S=r("el-dropdown-item"),M=r("el-dropdown-menu"),O=r("el-dropdown"),J=H("loading");return n(),c("div",rs,[(n(!0),c(G,null,q(e.audios,g=>(n(),c("div",{key:g.id,class:"audio",onClick:P(C=>e.onClick(g),["stop"])},[R((n(),c("div",as,[s(u,{src:g?.image_url,class:"cover",fit:"cover",lazy:""},null,8,["src"]),g?.audio_url&&e.$store.state?.producer?.audio?.id===g.id&&e.$store.state?.producer?.audio?.state==="playing"?(n(),c("div",{key:0,class:"overlay",onClick:P(C=>e.onPause(g),["stop"])},[s(_,null,{default:d(()=>[s(m)]),_:1})],8,ls)):f("",!0),g?.audio_url&&(e.$store.state?.producer?.audio?.id!==g.id||e.$store.state?.producer?.audio?.id===g.id&&e.$store.state?.producer?.audio?.state==="paused")?(n(),c("div",{key:1,class:"overlay",onClick:P(C=>e.onPlay(g),["stop"])},[s(_,null,{default:d(()=>[s($)]),_:1})],8,cs)):f("",!0),g?.duration?(n(),c("div",ds,a(e.useFormatDuring(g?.duration)),1)):f("",!0)])),[[J,!g?.audio_url]]),o("div",us,[o("h2",ps,a(g?.title),1),o("p",ms,a(g?.style),1)]),o("div",fs,[s(O,null,{dropdown:d(()=>[s(M,null,{default:d(()=>[s(S,{disabled:e.isFetchingVideoUrl,onClick:C=>e.handleVideoDownload(g)},{default:d(()=>[o("div",_s,[e.isFetchingVideoUrl?(n(),v(_,{key:0,class:"is-loading mr-2"},{default:d(()=>[s(E)]),_:1})):f("",!0),o("span",null,a(e.$t("producer.button.download_video")),1)])]),_:1},8,["disabled","onClick"]),g?.audio_url?(n(),v(S,{key:0,onClick:P(C=>e.onDownload(C,g?.audio_url),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.download_audio")),1)]),_:1},8,["onClick"])):f("",!0),s(S,{disabled:e.isFetchingWav,onClick:C=>e.handleWavDownload(g)},{default:d(()=>[o("div",$s,[e.isFetchingWav?(n(),v(_,{key:0,class:"is-loading mr-2"},{default:d(()=>[s(E)]),_:1})):f("",!0),o("span",null,a(e.$t("producer.button.download_wav")),1)])]),_:1},8,["disabled","onClick"])]),_:2},1024)]),default:d(()=>[o("span",hs,[s(y,{effect:"dark",content:e.$t("producer.button.download"),placement:"top"},{default:d(()=>[g?.audio_url||g?.video_url?(n(),v(k,{key:0,icon:"fa-solid fa-download",class:"icon icon-download"})):f("",!0)]),_:2},1032,["content"])])]),_:2},1024),s(O,null,{dropdown:d(()=>[s(M,null,{default:d(()=>[g?.audio_url?(n(),v(S,{key:0,onClick:P(C=>e.onExtend(C,g),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.extend")),1)]),_:1},8,["onClick"])):f("",!0),g.id?(n(),v(S,{key:1,onClick:P(C=>e.onGetStems(g.id),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.get_stems")),1)]),_:1},8,["onClick"])):f("",!0),g.id?(n(),v(S,{key:2,onClick:P(C=>e.onGetAllStems(g.id),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.all_stems")),1)]),_:1},8,["onClick"])):f("",!0),s(S,{onClick:P(C=>e.onCover(g),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.cover_music")),1)]),_:1},8,["onClick"]),g?.id?(n(),v(S,{key:3,onClick:P(C=>e.onVariation(g),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.variation")),1)]),_:1},8,["onClick"])):f("",!0),g?.id?(n(),v(S,{key:4,onClick:P(C=>e.onSwapVocals(g.id),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.swap_vocals")),1)]),_:1},8,["onClick"])):f("",!0),g?.id?(n(),v(S,{key:5,onClick:P(C=>e.onSwapInstrumentals(g.id),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.swap_instrumentals")),1)]),_:1},8,["onClick"])):f("",!0),g?.id?(n(),v(S,{key:6,onClick:P(C=>e.onReplaceSection(g),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.replace_section")),1)]),_:1},8,["onClick"])):f("",!0)]),_:2},1024)]),default:d(()=>[o("span",gs,[s(y,{effect:"dark",content:e.$t("producer.button.more"),placement:"top"},{default:d(()=>[g?.audio_url||g?.video_url?(n(),v(k,{key:0,icon:"fa-solid fa-ellipsis",class:"icon icon-ellipsis"})):f("",!0)]),_:2},1032,["content"])])]),_:2},1024)])],8,is))),128))])}const ys=V(ns,[["render",vs]]),ks={class:"player-slider"},bs=b({__name:"PlayerSlider",setup(e){const t=Z(),l=T({get:()=>t.state.producer?.audio?.progress,set:u=>t.commit("producer/setAudio",{...t.state.producer.audio,progress:u})}),i=T({get:()=>t.state.producer?.audio?.duration,set:u=>t.commit("producer/setAudio",{...t.state.producer.audio,duration:u})}),h=()=>{},p=u=>t.dispatch("producer/setAudio",{...t.state.producer.audio,progress:u});return(u,m)=>(n(),c("div",ks,[s(A(x),{modelValue:l.value,"onUpdate:modelValue":m[0]||(m[0]=_=>l.value=_),"show-tooltip":!1,min:0,max:i.value,onChange:p,onInput:h},null,8,["modelValue","max"])]))}}),ws={class:"flex player-song"},Cs=["src"],Vs={class:"ml-2 text-xs flex flex-col justify-between"},Ss={class:"w-52 2xl:w-96 cursor-pointer truncate"},Us={class:"flex"},Es={class:"ml-2 text-dc"},Ps=b({__name:"PlayerSong",setup(e){const t=Z(),l=T({get:()=>t.state.producer.audio,set:i=>t.commit("producer/setAudio",i)});return se(l,(i,h)=>{if(i?.audio_url!==h?.audio_url){console.log("audio changed",i),i.object&&(console.log("111",i.object),i.object.pause(),delete i.object);const p=new Audio(i.audio_url);i.state==="playing"?p.play():p.pause(),p.addEventListener("loadedmetadata",()=>{p.currentTime=0,p.addEventListener("timeupdate",()=>{t.commit("producer/setAudio",{...t.state.producer.audio,progress:p.currentTime})})}),t.commit("producer/setAudio",{...t.state.producer.audio,object:p})}else if(i?.progress!==h?.progress&&Math.abs(i.progress-i.object.currentTime)>2){console.log("progress changed",i.progress);const p=t.state.producer.audio;p.object&&(p.object.currentTime=p.progress)}else i?.state!==h?.state&&(console.log("state changed",i.state),i.object&&(i.state==="playing"?i.object.play():i.object.pause()));i?.volume!==h?.volume&&(console.log("volume changed",i.volume),i.object&&(i.object.volume=i.volume/100))}),(i,h)=>(n(),c("div",ws,[o("img",{alt:"",class:"w-11 h-11 rounded",src:l.value?.image_url||A($e)},null,8,Cs),o("div",Vs,[o("div",Ss,[o("div",Us,[o("span",null,a(l.value?.title||"Music"),1),o("span",Es,"- "+a(l.value?.style||"SmallRuralDog"),1)])])])]))}}),As={class:"flex justify-end items-center gap-x-2.5"},Ts={class:"text-xs"},Fs=b({__name:"PlayerAction",setup(e){const t=Z(),l=T({get:()=>t.state.producer?.audio?.progress,set:h=>t.commit("producer/setAudio",{...t.state.producer.audio,progress:h})}),i=T({get:()=>t.state.producer?.audio?.duration,set:h=>t.commit("producer/setAudio",{...t.state.producer.audio,duration:h})});return(h,p)=>(n(),c("div",As,[o("span",Ts,a(A(j)(l.value))+" / "+a(A(j)(i.value)),1)]))}}),Is={class:"player-volume flex flex-col items-center pt-2"},Ls={class:"text-sm mt-3"},Gs=b({__name:"PlayerVolumeSlider",setup(e){const t=Z(),l=T({get:()=>t.state.producer.audio?.volume,set:p=>t.commit("producer/setAudio",{...t.state.producer.audio,volume:p})}),i=T({get:()=>t.state.producer.audio?.muted,set:p=>t.commit("producer/setAudio",{...t.state.producer.audio,muted:p})}),h=p=>t.dispatch("producer/setVolume",p);return(p,u)=>(n(),c("div",Is,[s(A(x),{modelValue:l.value,"onUpdate:modelValue":u[0]||(u[0]=m=>l.value=m),vertical:"",height:"100px","show-tooltip":!1,max:100,min:0,size:"small",disabled:i.value,onInput:h},null,8,["modelValue","disabled"]),o("div",Ls,a(l.value),1)]))}}),js={class:"flex items-center justify-center gap-x-3"},Ds=b({__name:"PlayerController",setup(e){const t=Z(),l=()=>t.dispatch("producer/setAudio",{...t.state.producer.audio,state:t.state.producer.audio.state==="playing"?"paused":"playing"}),i=T(()=>t.state.producer.audio);return(h,p)=>(n(),c("div",js,[s(ee,{icon:i.value?.state==="playing"?A(ge):A(ve),size:"45",theme:"filled",class:"text-[var(--el-color-primary)] cursor-pointer",onClick:l},null,8,["icon"]),s(A(Fe),{placement:"top",width:"50px",trigger:"click"},{reference:d(()=>[s(ee,{icon:A(ye),size:"20","stroke-width":2,class:"cursor-pointer"},null,8,["icon"])]),default:d(()=>[s(Gs)]),_:1})]))}}),Rs={class:"flex flex-col items-stretch h-20"},Zs={class:"flex grow px-5 items-center"},zs={class:"flex-1"},Ns={class:"flex-1"},Ms={class:"flex-1"},Os=b({__name:"Player",setup(e){return(t,l)=>(n(),c("div",Rs,[s(bs),o("div",Zs,[o("div",zs,[s(Ps)]),o("div",Ns,[s(Ds)]),o("div",Ms,[s(Fs)])])]))}}),Bs=b({name:"RecentPanel",components:{ElSkeletonItem:Ge,ElSkeleton:Le,TaskPreview:ys,Player:Os,NoTasks:Ie,ScrollList:fe},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.producer?.tasks,items:this.$store.state.producer?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),qs={key:0,class:"tasks"},Ws={class:"left w-[70px] p-[10px] flex items-center"},Hs={class:"main w-[calc(100%-70px)] flex-1 p-[10px]"},Ks={key:2,class:"w-full flex-1 flex items-center justify-center"},Js={class:"h-20"};function Ys(e,t,l,i,h,p){const u=r("el-skeleton-item"),m=r("el-skeleton"),_=r("task-preview"),$=r("scroll-list"),k=r("no-tasks"),y=r("player");return n(),c(G,null,[e.tasks?.items===void 0?(n(),c("div",qs,[(n(),c(G,null,q(3,E=>o("div",{key:E,class:"flex"},[o("div",Ws,[s(m,{animated:""},{template:d(()=>[s(u,{variant:"image",class:"avatar w-[50px] h-[50px]"})]),_:1})]),o("div",Hs,[s(m,{animated:""},{template:d(()=>[s(u,{variant:"p",class:"w-[200px] h-[15px] mb-[5px] mt-[10px]"}),s(u,{variant:"text"})]),_:1})])])),64))])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(n(),v($,{key:1,ref:"scrollList",class:"flex-1 w-full overflow-y-auto tasks p-2",loading:e.loading,onReachTop:t[0]||(t[0]=E=>e.$emit("reach-top"))},{default:d(()=>[(n(!0),c(G,null,q(e.tasks?.items,(E,S)=>(n(),v(_,{key:S,"model-value":E,class:"preview"},null,8,["model-value"]))),128))]),_:1},8,["loading"])):f("",!0),e.tasks?.items?.length===0?(n(),c("div",Ks,[s(k)])):f("",!0),R(o("div",Js,[s(y)],512),[[ne,!!e.$store?.state?.producer?.audio?.object]])],64)}const Qs=V(Bs,[["render",Ys]]),Xs=b({name:"TaskPreview",components:{IconPicture:ae,ElImage:N,ElAvatar:ke,ElIcon:K},computed:{audio(){return this.$store.state.producer?.audio}}}),xs={key:0,class:"size-full overflow-hidden"},en={class:"relative h-[300px]"},tn={class:"flex items-center justify-center size-full bg-[var(--el-bg-color)]"},on={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"},sn={class:"p-4"},nn={class:"flex items-center font-bold mb-2"},rn={class:"text-[var(--el-text-color-regular)] mb-2"},an={class:"text-xs text-[var(--el-text-color-regular)]"},ln={class:"mt-4 text-sm leading-[25px] whitespace-pre-wrap"},cn={key:1,class:"w-full h-full"};function dn(e,t,l,i,h,p){const u=r("icon-picture"),m=r("el-icon"),_=r("el-image"),$=r("el-avatar");return e.audio?.object?(n(),c("div",xs,[o("div",en,[s(_,{src:e.audio.image_url,fit:"cover",class:"size-full"},{error:d(()=>[o("div",tn,[s(m,{class:"text-3xl"},{default:d(()=>[s(u)]),_:1})])]),_:1},8,["src"]),o("h2",on,a(e.audio?.title),1)]),o("div",sn,[o("div",nn,[s($,{size:30,src:e.audio?.image_url,class:"mr-2"},null,8,["src"]),o("span",null,a(e.audio?.title),1)]),o("p",rn,a(e.audio?.style),1),o("p",an,a(e.$dayjs.format(e.audio?.created_at)),1),o("div",ln,[o("p",null,a(e.audio?.lyric),1)])])])):(n(),c("div",cn))}const un=V(Xs,[["render",dn]]),pn="https://webhook.acedata.cloud/producer",mn=b({name:"ProducerIndex",components:{Layout:Oe,ConfigPanel:os,RecentPanel:Qs,PreviewPanel:un},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.producer?.status?.getApplications===L.Request},tasksLoading(){return this.$store.state.producer?.status?.getTasks===L.Request||this.fetchingTasks},service(){return this.$store.state.producer.service},credential(){return this.$store.state.producer.credential},config(){return this.$store.state.producer.config},initializing(){return this.$store.state.producer.status.getApplications===L.Request},needApply(){return this.$store.state.producer.status.getApplications===L.Success&&!this.application},application(){return this.$store.state.producer.application},tasks(){return this.$store.state.producer.tasks},applications(){return this.$store.state.producer.applications}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await je({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("producer/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplications"),await this.$store.dispatch("producer/getApplications"),console.debug("end onGetApplications"),await this.onGetTasks()},onApply(){le.create({application:this.application}).then(({data:e})=>{this.application=e,w.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{e?.response?.data?.code===ce&&w.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:l,createdAtMax:i}=e||{};console.debug("limit",t,"createdAtMin",l,"createdAtMax",i),this.fetchingTasks=!0;try{await this.$store.dispatch("producer/getTasks",{limit:t,createdAtMin:l,createdAtMax:i})}finally{this.fetchingTasks=!1}},async onGenerateAudio(){const e={...this.config,callback_url:pn},t=this.credential?.token;if(!t){console.error("no token specified");return}w.info(this.$t("producer.message.startingTask")),I.audio(e,{token:t}).then(()=>{w.success(this.$t("producer.message.startTaskSuccess"))}).catch(l=>{w.error(l?.response?.data?.error?.message||this.$t("producer.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function fn(e,t,l,i,h,p){const u=r("config-panel"),m=r("recent-panel"),_=r("preview-panel"),$=r("layout");return n(),v($,null,{config:d(()=>[s(u,{onGenerate:e.onGenerateAudio},null,8,["onGenerate"])]),result:d(()=>[s(m,{ref:"recentPanel",class:"panel recent",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),preview:d(()=>[s(_)]),_:1})}const ur=V(mn,[["render",fn],["__scopeId","data-v-638e0ac5"]]);export{ur as default};
|
|
1
|
+
import{F as D}from"./index.es-B8UAYPlu.js";import{E as W}from"./index-B8kQljtZ.js";import{E as oe}from"./index-BdOrPkLK.js";import{d as b,H as c,E as o,z as B,C as s,y as d,D as r,q as n,F as a,O as G,N as q,J as f,x as v,I as U,G as R,K as H,M as P,u as A,c as T,w as se,L as ne}from"./vendor-vue-DU0w5ewx.js";import{E as V,b1 as re,e5 as Y,e6 as Q,S as K,H as ie,ap as L,e7 as Z,e8 as ae,a7 as le}from"./index-B8NIXFXV.js";import{a as ce}from"./errorCode-Cqj9Td_Z.js";import{p as I}from"./producer-CRNJNhmQ.js";import{b as de}from"./producer-DP85fuAq.js";import{E as ue}from"./index-BX73fyko.js";import{E as pe,a as me}from"./index-BlaGrXYB.js";import{I as F,S as fe}from"./ScrollList-BBAzavyB.js";import{E as he}from"./index-D2kYsNjd.js";import{E as w}from"./index-CcYxepTP.js";import{E as z}from"./index-C3qbB2R4.js";import{u as j,F as _e,O as $e,_ as ee,P as ge,a as ve,V as ye,E as ke}from"./IconPark.vue_vue_type_script_setup_true_lang-AVySoCwx.js";import{E as X,a as x}from"./index-CBuVdRox.js";import{E as N}from"./index-BzitVkNO.js";import{E as be,a as we}from"./index-CaJEx1sk.js";import{E as Ce,a as Ve}from"./index-CCGOGjU5.js";import{C as Se}from"./Consumption-CZlzOFr-.js";import{a as Ue}from"./price-BdhJYmzp.js";import{E as Ee,b as Pe,a as Ae}from"./index-DIHp8_U3.js";import{E as Te}from"./index-qLx3hags.js";import{E as Fe}from"./index-2g3eXsX4.js";import{N as Ie}from"./NoTasks-CNRFrdHu.js";import{a as Le,E as Ge}from"./index-IAptVusO.js";import{l as je}from"./pagination-CcnL0MdN.js";import"./use-form-item-Bsmkxazb.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-Cvgzdobq.js";import"./vendor-vue-router-9TBHB1ku.js";import"./validator-CUXs2Jta.js";import"./index-DlZ-gpNs.js";import"./index-CEErdlw2.js";import"./typescript-kbBRrRi0.js";import"./strings-DigWlKo9.js";import"./isEqual-CBKi-9mc.js";import"./_Uint8Array-Bq4W_aZw.js";import"./castArray-DrkJhRjQ.js";import"./debounce-B-0O6GZN.js";import"./_baseIteratee-SXAlbslK.js";import"./index-BibFvigx.js";import"./index-Cq_8nzqD.js";import"./_baseClone-C0vKZ-2x.js";import"./_initCloneObject-nuejNsVF.js";import"./index-CkzwyQNU.js";import"./index-Bz0iDXPF.js";import"./index-6ULnuOMT.js";import"./dropdown-Bb6oEVvP.js";const De=b({name:"LayoutProducer",components:{ElDrawer:oe,ElButton:W,FontAwesomeIcon:D},data(){return{drawer:!1,preview:!1}},computed:{}}),Re={class:"main flex flex-row flex-1"},Ze={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},ze={class:"result h-full flex flex-col flex-1 min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"},Ne={class:"preview h-full w-[300px] flex flex-col"};function Me(e,t,l,i,h,p){const u=r("font-awesome-icon"),m=r("el-button"),_=r("el-drawer");return n(),c("div",Re,[o("div",Ze,[B(e.$slots,"config",{},void 0,!0)]),o("div",ze,[B(e.$slots,"result",{},void 0,!0)]),o("div",Ne,[B(e.$slots,"preview",{},void 0,!0)]),s(m,{circle:"",class:"menu",onClick:t[0]||(t[0]=$=>e.drawer=!0)},{default:d(()=>[s(u,{icon:"fa-solid fa-magic"})]),_:1}),s(_,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=$=>e.drawer=$),direction:"ltr","with-header":!1,size:"340px",class:"drawer"},{default:d(()=>[B(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Oe=V(De,[["render",Me],["__scopeId","data-v-7453886f"]]),Be=b({name:"TypeSelector",components:{ElSelect:me,ElOption:pe,ElSwitch:ue},data(){return{options:[{label:"FUZZ-2.0 Pro",value:"FUZZ-2.0 Pro",info:"8 min"},{label:"FUZZ-2.0",value:"FUZZ-2.0",info:"8 min"},{label:"FUZZ-2.0 Raw",value:"FUZZ-2.0 Raw",info:"8 min"},{label:"FUZZ-1.1 Pro",value:"FUZZ-1.1 Pro",info:"4 min"},{label:"FUZZ-1.0 Pro",value:"FUZZ-1.0 Pro",info:"4 min"},{label:"FUZZ-1.1",value:"FUZZ-1.1",info:"4 min"},{label:"FUZZ-1.0",value:"FUZZ-1.0",info:"2 min"},{label:"FUZZ-0.8",value:"FUZZ-0.8",info:"2 min"}]}},computed:{custom:{get(){return this.$store.state.producer?.config?.custom||!1},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,custom:e})}},instrumental:{get(){return this.$store.state.producer?.config?.instrumental||!1},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,instrumental:e})}},model:{get(){return this.$store.state.producer?.config?.model},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,model:e})}}},mounted(){this.model||(this.model=de)}}),qe={class:"flex items-center justify-between mb-3"},We={class:"text-sm font-bold"},He={class:"mb-3"},Ke={class:"flex items-center mb-1"},Je={class:"text-sm font-bold"},Ye={class:"flex items-center justify-between w-full"},Qe={class:"text-xs text-[var(--el-text-color-placeholder)]"},Xe={key:0,class:"flex items-center justify-between mb-3"},xe={class:"text-sm font-bold"};function et(e,t,l,i,h,p){const u=r("el-switch"),m=r("el-option"),_=r("el-select");return n(),c("div",null,[o("div",qe,[o("span",We,a(e.$t("producer.name.type")),1),s(u,{modelValue:e.custom,"onUpdate:modelValue":t[0]||(t[0]=$=>e.custom=$)},null,8,["modelValue"])]),o("div",He,[o("div",Ke,[o("span",Je,a(e.$t("producer.name.model")),1)]),s(_,{modelValue:e.model,"onUpdate:modelValue":t[1]||(t[1]=$=>e.model=$),class:"w-full",size:"default",placeholder:e.$t("producer.placeholder.select")},{default:d(()=>[(n(!0),c(G,null,q(e.options,$=>(n(),v(m,{key:$.value,label:$.label,value:$.value},{default:d(()=>[o("div",Ye,[o("span",null,a($.label),1),o("span",Qe,a($.info),1)])]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),e.custom?(n(),c("div",Xe,[o("span",xe,a(e.$t("producer.name.instrumental")),1),s(u,{modelValue:e.instrumental,"onUpdate:modelValue":t[2]||(t[2]=$=>e.instrumental=$)},null,8,["modelValue"])])):f("",!0)])}const tt=V(Be,[["render",et]]),ot=b({name:"UploadAudio",components:{ElUpload:he,ElButton:W,InfoIcon:F,FontAwesomeIcon:D},emits:["change"],data(){return{fileList:[],uploadUrl:re()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},credential(){return this.$store.state.producer.credential},config(){return this.$store.state.producer.config},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.producer?.config?.audio_id},set(){}}},watch:{urls:{handler(e){this.$emit("change",e)}}},mounted(){this.value||(this.value=void 0),this.onSetAudio()},methods:{onExceed(){w.warning(this.$t("producer.message.uploadReferencesExceed"))},onError(){w.error(this.$t("producer.message.uploadReferencesError"))},async onSuccess(){const e=this.urls?.[0];await this.onGenerateAudioId(e)},async onGenerateAudioId(e){const t={audio_url:e},l=this.credential?.token;if(!l){console.error("no token specified");return}w.info(this.$t("producer.message.startingUploadAudio")),I.upload(t,{token:l}).then(i=>{console.debug("get upload music success",i.data);const h=i.data?.data.audio_id;this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,audio_id:h,action:"upload_extend"}),w.success(this.$t("producer.message.startUploadAudioSuccess"))}).catch(i=>{w.error(i?.response?.data?.error?.message||this.$t("producer.message.startUploadAudioFailed"))})},onSetAudio(){}}}),st={class:"relative"},nt={class:"flex justify-between"},rt={class:"flex justify-start items-center"},it={class:"text-sm font-bold"};function at(e,t,l,i,h,p){const u=r("info-icon"),m=r("font-awesome-icon"),_=r("el-button"),$=r("el-upload");return n(),c("div",st,[o("div",nt,[o("div",rt,[o("span",it,a(e.$t("producer.name.referenceAudios")),1),s(u,{content:e.$t("producer.description.uploadAudios")},null,8,["content"])])]),s($,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=k=>e.fileList=k),name:"file",limit:1,class:"upload-wrapper",action:e.uploadUrl,accept:".mp3","show-file-list":!0,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{default:d(()=>[s(_,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:d(()=>[s(m,{icon:"fa-solid fa-upload",class:"icon mr-1"}),U(" "+a(e.$t("producer.button.uploadAudios")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const lt=V(ot,[["render",at],["__scopeId","data-v-e4cd0467"]]),ct="",dt=b({name:"PromptInput",components:{ElInput:z,InfoIcon:F},computed:{prompt:{get(){return this.$store.state.producer?.config?.prompt},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=ct)}}),ut={class:"field"},pt={class:"flex items-center mb-1"},mt={class:"text-sm font-bold"};function ft(e,t,l,i,h,p){const u=r("info-icon"),m=r("el-input");return n(),c("div",ut,[o("div",pt,[o("span",mt,a(e.$t("producer.name.songDescription")),1),s(u,{content:e.$t("producer.description.prompt")},null,8,["content"])]),s(m,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=_=>e.prompt=_),rows:4,type:"textarea",placeholder:e.$t("producer.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const ht=V(dt,[["render",ft]]),_t="",$t=b({name:"LyricInput",components:{ElInput:z,ElButton:W,FontAwesomeIcon:D,InfoIcon:F},data(){return{generatingLyrics:!1}},computed:{lyric:{get(){return this.$store.state.producer?.config?.lyric},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,lyric:e})}},config(){return this.$store.state.producer?.config},credential(){return this.$store.state.producer?.credential}},mounted(){this.lyric||(this.lyric=_t)},methods:{async onGenerateLyrics(){const e=this.credential?.token;if(!e)return;const t=this.config?.style||this.config?.title||"a beautiful song";this.generatingLyrics=!0,w.info(this.$t("producer.message.generatingLyrics"));try{const i=(await I.lyric({prompt:t},{token:e})).data?.data;i?.text&&(this.lyric=i.text,i?.title&&!this.config?.title&&this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,lyric:i.text,title:i.title}),w.success(this.$t("producer.message.generateLyricsSuccess")))}catch{w.error(this.$t("producer.message.generateLyricsFailed"))}finally{this.generatingLyrics=!1}}}}),gt={class:"field"},vt={class:"flex items-center justify-between mb-1"},yt={class:"flex items-center"},kt={class:"text-sm font-bold"};function bt(e,t,l,i,h,p){const u=r("info-icon"),m=r("font-awesome-icon"),_=r("el-button"),$=r("el-input");return n(),c("div",gt,[o("div",vt,[o("div",yt,[o("span",kt,a(e.$t("producer.name.lyrics")),1),s(u,{content:e.$t("producer.description.lyrics")},null,8,["content"])]),e.config?.action!=="extend"?(n(),v(_,{key:0,size:"small",loading:e.generatingLyrics,round:"",onClick:e.onGenerateLyrics},{default:d(()=>[e.generatingLyrics?f("",!0):(n(),v(m,{key:0,icon:"fa-solid fa-wand-magic-sparkles",class:"mr-1"})),U(" "+a(e.$t("producer.button.generate_lyrics")),1)]),_:1},8,["loading","onClick"])):f("",!0)]),e.config?.action!=="extend"?(n(),v($,{key:0,modelValue:e.lyric,"onUpdate:modelValue":t[0]||(t[0]=k=>e.lyric=k),rows:5,type:"textarea",class:"lyrics",placeholder:e.$t("producer.placeholder.lyrics")},null,8,["modelValue","placeholder"])):(n(),v($,{key:1,modelValue:e.lyric,"onUpdate:modelValue":t[1]||(t[1]=k=>e.lyric=k),rows:5,type:"textarea",class:"lyrics",placeholder:e.$t("producer.placeholder.extend.lyrics")},null,8,["modelValue","placeholder"]))])}const wt=V($t,[["render",bt],["__scopeId","data-v-88c6da2b"]]),Ct=b({name:"StyleInput",components:{ElInput:z,InfoIcon:F},computed:{style:{get(){return this.$store.state.producer?.config?.style},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,style:e})}}}}),Vt={class:"field"},St={class:"flex items-center justify-between mb-1"},Ut={class:"flex items-center"},Et={class:"text-sm font-bold"};function Pt(e,t,l,i,h,p){const u=r("info-icon"),m=r("el-input");return n(),c("div",Vt,[o("div",St,[o("div",Ut,[o("span",Et,a(e.$t("producer.name.style")),1),s(u,{content:e.$t("producer.description.style")},null,8,["content"])])]),s(m,{modelValue:e.style,"onUpdate:modelValue":t[0]||(t[0]=_=>e.style=_),rows:2,type:"textarea",placeholder:e.$t("producer.placeholder.style")},null,8,["modelValue","placeholder"])])}const At=V(Ct,[["render",Pt]]),Tt=b({name:"TitleInput",components:{ElInput:z,InfoIcon:F},computed:{title:{get(){return this.$store.state.producer?.config?.title},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,title:e})}}}}),Ft={class:"field"},It={class:"flex items-center mb-1"},Lt={class:"text-sm font-bold"};function Gt(e,t,l,i,h,p){const u=r("info-icon"),m=r("el-input");return n(),c("div",Ft,[o("div",It,[o("span",Lt,a(e.$t("producer.name.title")),1),s(u,{content:e.$t("producer.description.title")},null,8,["content"])]),s(m,{modelValue:e.title,"onUpdate:modelValue":t[0]||(t[0]=_=>e.title=_),placeholder:e.$t("producer.placeholder.title")},null,8,["modelValue","placeholder"])])}const jt=V(Tt,[["render",Gt]]),Dt=b({name:"ExtendFromInput",components:{ElImage:N,ElIcon:K,ElInputNumber:X,VideoPlay:Q,VideoPause:Y},data(){return{}},computed:{audio(){return this.$store.state.producer?.config?.audio},value:{get(){return this.$store.state.producer?.config?.continue_at},set(e){console.debug("set continue_at",e),this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,continue_at:e?parseInt(e):void 0})}}},mounted(){this.value||(this.value=void 0)},methods:{handleChange(e){if(e===void 0){this.value=void 0;return}e<0?this.value=0:e>this.audio?.duration?this.value=this.audio?.duration:this.value=e},useFormatDuring:j,onPlay(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){this.$store.state?.producer?.audio?.id!==e.id&&this.onPlay({...e,progress:0})}}}),Rt={class:"field"},Zt={class:"box"},zt={class:"title font-bold"},Nt={class:"input-wrapper"},Mt={class:"task"},Ot={class:"left"},Bt={key:2,class:"duration"},qt={class:"info"},Wt={class:"title"},Ht={class:"style"};function Kt(e,t,l,i,h,p){const u=r("el-input-number"),m=r("el-image"),_=r("video-pause"),$=r("el-icon"),k=r("video-play"),y=H("loading");return n(),c("div",Rt,[o("div",Zt,[o("h2",zt,a(e.$t("producer.name.extend")),1),o("div",Nt,[s(u,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=E=>e.value=E),class:"value",min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t("producer.placeholder.extend.continue_at"),onChange:e.handleChange},null,8,["modelValue","max","placeholder","onChange"])])]),o("div",Mt,[e.audio?(n(),c("div",{key:0,class:"audio",onClick:t[3]||(t[3]=E=>e.onClick(e.audio))},[R((n(),c("div",Ot,[s(m,{src:e.audio?.image_url,class:"cover",fit:"cover"},null,8,["src"]),e.audio?.audio_url&&e.$store.state?.producer?.audio?.id===e.audio.id&&e.$store.state?.producer?.audio?.state==="playing"?(n(),c("div",{key:0,class:"overlay",onClick:t[1]||(t[1]=E=>e.onPause(e.audio))},[s($,null,{default:d(()=>[s(_)]),_:1})])):f("",!0),e.audio?.audio_url&&(e.$store.state?.producer?.audio?.id!==e.audio.id||e.$store.state?.producer?.audio?.id===e.audio.id&&e.$store.state?.producer?.audio?.state==="paused")?(n(),c("div",{key:1,class:"overlay",onClick:t[2]||(t[2]=E=>e.onPlay(e.audio))},[s($,null,{default:d(()=>[s(k)]),_:1})])):f("",!0),e.audio?.duration?(n(),c("div",Bt,a(e.useFormatDuring(e.audio?.duration)),1)):f("",!0)])),[[y,!e.audio?.audio_url]]),o("div",qt,[o("h2",Wt,a(e.audio?.title),1),o("p",Ht,a(e.audio?.style),1)])])):f("",!0)])])}const Jt=V(Dt,[["render",Kt],["__scopeId","data-v-26d43480"]]),Yt=b({name:"CoverFromInput",components:{ElImage:N,ElIcon:K,VideoPlay:Q,VideoPause:Y},data(){return{}},computed:{audio(){return this.$store.state.producer?.config?.audio},value:{get(){return this.$store.state.producer?.config?.continue_at},set(e){console.debug("set continue_at",e),this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,continue_at:e?parseInt(e):void 0})}}},mounted(){this.value||(this.value=void 0)},methods:{handleChange(e){e<0?this.value=0:e>this.audio?.duration?this.value=this.audio?.duration:this.value=e},useFormatDuring:j,onPlay(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){this.$store.state?.producer?.audio?.id!==e.id&&this.onPlay({...e,progress:0})}}}),Qt={class:"field"},Xt={class:"box"},xt={class:"title font-bold"},eo={class:"task"},to={class:"left"},oo={key:2,class:"duration"},so={class:"info"},no={class:"title"},ro={class:"style"};function io(e,t,l,i,h,p){const u=r("el-image"),m=r("video-pause"),_=r("el-icon"),$=r("video-play"),k=H("loading");return n(),c("div",Qt,[o("div",Xt,[o("h2",xt,a(e.$t("producer.name.cover")),1)]),o("div",eo,[e.audio?(n(),c("div",{key:0,class:"audio",onClick:t[2]||(t[2]=y=>e.onClick(e.audio))},[R((n(),c("div",to,[s(u,{src:e.audio?.image_url,class:"cover",fit:"cover"},null,8,["src"]),e.audio?.audio_url&&e.$store.state?.producer?.audio?.id===e.audio.id&&e.$store.state?.producer?.audio?.state==="playing"?(n(),c("div",{key:0,class:"overlay",onClick:t[0]||(t[0]=y=>e.onPause(e.audio))},[s(_,null,{default:d(()=>[s(m)]),_:1})])):f("",!0),e.audio?.audio_url&&(e.$store.state?.producer?.audio?.id!==e.audio.id||e.$store.state?.producer?.audio?.id===e.audio.id&&e.$store.state?.producer?.audio?.state==="paused")?(n(),c("div",{key:1,class:"overlay",onClick:t[1]||(t[1]=y=>e.onPlay(e.audio))},[s(_,null,{default:d(()=>[s($)]),_:1})])):f("",!0),e.audio?.duration?(n(),c("div",oo,a(e.useFormatDuring(e.audio?.duration)),1)):f("",!0)])),[[k,!e.audio?.audio_url]]),o("div",so,[o("h2",no,a(e.audio?.title),1),o("p",ro,a(e.audio?.style),1)])])):f("",!0)])])}const ao=V(Yt,[["render",io],["__scopeId","data-v-d8a8e583"]]),lo=b({name:"VocalGenderSelector",components:{ElRadioGroup:we,ElRadioButton:be,InfoIcon:F},computed:{vocalGender:{get(){return this.$store.state.producer?.config?.vocal_gender||""},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,vocal_gender:e||void 0})}}}}),co={class:"mb-2"},uo={class:"flex items-center mb-1"},po={class:"text-sm font-bold"};function mo(e,t,l,i,h,p){const u=r("info-icon"),m=r("el-radio-button"),_=r("el-radio-group");return n(),c("div",co,[o("div",uo,[o("span",po,a(e.$t("producer.name.vocalGender")),1),s(u,{content:e.$t("producer.description.vocalGender")},null,8,["content"])]),s(_,{modelValue:e.vocalGender,"onUpdate:modelValue":t[0]||(t[0]=$=>e.vocalGender=$)},{default:d(()=>[s(m,{value:""},{default:d(()=>[U(a(e.$t("producer.gender.auto")),1)]),_:1}),s(m,{value:"f"},{default:d(()=>[U(a(e.$t("producer.gender.female")),1)]),_:1}),s(m,{value:"m"},{default:d(()=>[U(a(e.$t("producer.gender.male")),1)]),_:1})]),_:1},8,["modelValue"])])}const fo=V(lo,[["render",mo]]),ho=b({name:"AdvancedParams",components:{ElCollapse:Ve,ElCollapseItem:Ce,ElInput:z,ElSlider:x,ElInputNumber:X},data(){return{activeNames:[]}},computed:{config(){return this.$store.state.producer?.config},styleNegative:{get(){return this.$store.state.producer?.config?.style_negative||""},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,style_negative:e||void 0})}},lyricPrompt:{get(){return this.$store.state.producer?.config?.lyric_prompt||""},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,lyric_prompt:e||void 0})}},weirdness:{get(){return this.$store.state.producer?.config?.weirdness??0},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,weirdness:e||void 0})}},soundStrength:{get(){return this.$store.state.producer?.config?.sound_strength??50},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,sound_strength:e})}},lyricsStrength:{get(){return this.$store.state.producer?.config?.lyrics_strength??50},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,lyrics_strength:e})}},seed:{get(){return this.$store.state.producer?.config?.seed},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,seed:e})}}}}),_o={key:0,class:"mb-3"},$o={class:"flex items-center mb-1"},go={class:"text-xs font-bold"},vo={key:1,class:"mb-3"},yo={class:"flex items-center mb-1"},ko={class:"text-xs font-bold"},bo={key:2,class:"mb-3"},wo={class:"flex items-center justify-between mb-1"},Co={class:"text-xs font-bold"},Vo={class:"text-xs text-[var(--el-text-color-secondary)]"},So={key:3,class:"mb-3"},Uo={class:"flex items-center justify-between mb-1"},Eo={class:"text-xs font-bold"},Po={class:"text-xs text-[var(--el-text-color-secondary)]"},Ao={key:4,class:"mb-3"},To={class:"flex items-center justify-between mb-1"},Fo={class:"text-xs font-bold"},Io={class:"text-xs text-[var(--el-text-color-secondary)]"},Lo={key:5,class:"mb-3"},Go={class:"flex items-center mb-1"},jo={class:"text-xs font-bold"};function Do(e,t,l,i,h,p){const u=r("el-input"),m=r("el-slider"),_=r("el-input-number"),$=r("el-collapse-item"),k=r("el-collapse");return n(),v(k,{modelValue:e.activeNames,"onUpdate:modelValue":t[6]||(t[6]=y=>e.activeNames=y),class:"advanced-collapse"},{default:d(()=>[s($,{title:e.$t("producer.name.advancedParams"),name:"advanced"},{default:d(()=>[e.config?.custom?(n(),c("div",_o,[o("div",$o,[o("span",go,a(e.$t("producer.name.styleNegative")),1)]),s(u,{modelValue:e.styleNegative,"onUpdate:modelValue":t[0]||(t[0]=y=>e.styleNegative=y),placeholder:e.$t("producer.placeholder.styleNegative")},null,8,["modelValue","placeholder"])])):f("",!0),e.config?.custom&&!e.config?.instrumental?(n(),c("div",vo,[o("div",yo,[o("span",ko,a(e.$t("producer.name.lyricPrompt")),1)]),s(u,{modelValue:e.lyricPrompt,"onUpdate:modelValue":t[1]||(t[1]=y=>e.lyricPrompt=y),placeholder:e.$t("producer.placeholder.lyricPrompt")},null,8,["modelValue","placeholder"])])):f("",!0),e.config?.custom?(n(),c("div",bo,[o("div",wo,[o("span",Co,a(e.$t("producer.name.weirdness")),1),o("span",Vo,a(e.weirdness??0),1)]),s(m,{modelValue:e.weirdness,"onUpdate:modelValue":t[2]||(t[2]=y=>e.weirdness=y),min:0,max:100,step:1},null,8,["modelValue"])])):f("",!0),e.config?.custom?(n(),c("div",So,[o("div",Uo,[o("span",Eo,a(e.$t("producer.name.soundStrength")),1),o("span",Po,a(e.soundStrength??50),1)]),s(m,{modelValue:e.soundStrength,"onUpdate:modelValue":t[3]||(t[3]=y=>e.soundStrength=y),min:0,max:100,step:1},null,8,["modelValue"])])):f("",!0),e.config?.custom&&!e.config?.instrumental?(n(),c("div",Ao,[o("div",To,[o("span",Fo,a(e.$t("producer.name.lyricsStrength")),1),o("span",Io,a(e.lyricsStrength??50),1)]),s(m,{modelValue:e.lyricsStrength,"onUpdate:modelValue":t[4]||(t[4]=y=>e.lyricsStrength=y),min:0,max:100,step:1},null,8,["modelValue"])])):f("",!0),e.config?.custom?(n(),c("div",Lo,[o("div",Go,[o("span",jo,a(e.$t("producer.name.seed")),1)]),s(_,{modelValue:e.seed,"onUpdate:modelValue":t[5]||(t[5]=y=>e.seed=y),min:0,controls:!1,placeholder:e.$t("producer.placeholder.seed"),class:"w-full"},null,8,["modelValue","placeholder"])])):f("",!0)]),_:1},8,["title"])]),_:1},8,["modelValue"])}const Ro=V(ho,[["render",Do],["__scopeId","data-v-88e65aee"]]),Zo=b({name:"ReplaceSectionInput",components:{ElInputNumber:X,ElImage:N,InfoIcon:F},computed:{audio(){return this.$store.state.producer?.config?.audio},replaceSectionStart:{get(){return this.$store.state.producer?.config?.replace_section_start},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,replace_section_start:e})}},replaceSectionEnd:{get(){return this.$store.state.producer?.config?.replace_section_end},set(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,replace_section_end:e})}}},methods:{onClick(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"playing"})}}}),zo={class:"field"},No={class:"flex items-center mb-2"},Mo={class:"text-sm font-bold m-0"},Oo={key:0,class:"task mb-2"},Bo={class:"left relative w-[50px] h-[50px] mr-3 flex-shrink-0"},qo={class:"info flex-1 min-w-0"},Wo={class:"text-sm font-bold m-0 truncate"},Ho={class:"text-xs text-[var(--el-text-color-secondary)] m-0 truncate"},Ko={class:"flex gap-2"};function Jo(e,t,l,i,h,p){const u=r("info-icon"),m=r("el-image"),_=r("el-input-number"),$=H("loading");return n(),c("div",zo,[o("div",No,[o("h2",Mo,a(e.$t("producer.name.replaceSection")),1),s(u,{content:e.$t("producer.description.replaceSection")},null,8,["content"])]),e.audio?(n(),c("div",Oo,[o("div",{class:"audio flex items-center",onClick:t[0]||(t[0]=k=>e.onClick(e.audio))},[R((n(),c("div",Bo,[s(m,{src:e.audio?.image_url,class:"w-full h-full rounded",fit:"cover"},null,8,["src"])])),[[$,!e.audio?.audio_url]]),o("div",qo,[o("h2",Wo,a(e.audio?.title),1),o("p",Ho,a(e.audio?.style),1)])])])):f("",!0),o("div",Ko,[s(_,{modelValue:e.replaceSectionStart,"onUpdate:modelValue":t[1]||(t[1]=k=>e.replaceSectionStart=k),class:"flex-1",min:0,max:e.audio?.duration,controls:!1,placeholder:e.$t("producer.placeholder.replaceSectionStart")},null,8,["modelValue","max","placeholder"]),s(_,{modelValue:e.replaceSectionEnd,"onUpdate:modelValue":t[2]||(t[2]=k=>e.replaceSectionEnd=k),class:"flex-1",min:e.replaceSectionStart||0,max:e.audio?.duration,controls:!1,placeholder:e.$t("producer.placeholder.replaceSectionEnd")},null,8,["modelValue","min","max","placeholder"])])])}const Yo=V(Zo,[["render",Jo]]),Qo=b({name:"PresetPanel",components:{TypeSelector:tt,PromptInput:ht,LyricInput:wt,StyleInput:At,TitleInput:jt,ExtendFromInput:Jt,CoverFromInput:ao,UploadAudio:lt,VocalGenderSelector:fo,AdvancedParams:Ro,ReplaceSectionInput:Yo,FontAwesomeIcon:D,ElButton:W,Consumption:Se},emits:["generate"],computed:{config(){return this.$store.state.producer?.config},consumption(){return Ue(this.config,this.service?.cost)},service(){return this.$store.state.producer?.service},generateButtonText(){const e=this.config?.action;return e==="extend"?this.$t("producer.button.extend"):e==="cover"?this.$t("producer.button.cover_music"):e==="variation"?this.$t("producer.button.variation"):e==="replace_section"?this.$t("producer.button.replace_section"):e==="stems"?this.$t("producer.button.get_stems"):e==="swap_vocals"?this.$t("producer.button.swap_vocals"):e==="swap_instrumentals"?this.$t("producer.button.swap_instrumentals"):this.$t("producer.button.generate")}},methods:{onGenerate(){this.$emit("generate")}}}),Xo={class:"flex flex-col h-full"},xo={class:"flex-1 overflow-y-auto p-5"},es={class:"flex flex-col items-center justify-center px-5 pb-5"};function ts(e,t,l,i,h,p){const u=r("type-selector"),m=r("upload-audio"),_=r("prompt-input"),$=r("lyric-input"),k=r("style-input"),y=r("title-input"),E=r("vocal-gender-selector"),S=r("extend-from-input"),M=r("cover-from-input"),O=r("replace-section-input"),J=r("advanced-params"),g=r("consumption"),C=r("font-awesome-icon"),te=r("el-button");return n(),c("div",Xo,[o("div",xo,[s(u,{class:"mb-4"}),s(m,{class:"mb-4"}),e.config?.custom?f("",!0):(n(),v(_,{key:0,class:"mb-4"})),e.config?.custom&&!e.config.instrumental?(n(),v($,{key:1,class:"mb-4"})):f("",!0),e.config?.custom?(n(),v(k,{key:2,class:"mb-4"})):f("",!0),e.config?.custom?(n(),v(y,{key:3,class:"mb-4"})):f("",!0),e.config?.custom&&!e.config.instrumental?(n(),v(E,{key:4,class:"mb-4"})):f("",!0),e.config?.action==="extend"?(n(),v(S,{key:5,class:"mb-4"})):f("",!0),e.config?.action==="cover"?(n(),v(M,{key:6,class:"mb-4"})):f("",!0),e.config?.action==="replace_section"?(n(),v(O,{key:7,class:"mb-4"})):f("",!0),s(J,{class:"mb-4"})]),o("div",es,[s(g,{value:e.consumption,service:e.service},null,8,["value","service"]),s(te,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:d(()=>[s(C,{icon:"fa-solid fa-magic",class:"mr-2"}),U(" "+a(e.generateButtonText),1)]),_:1},8,["onClick"])])])}const os=V(Qo,[["render",ts],["__scopeId","data-v-6642bb3c"]]),ss="https://webhook.acedata.cloud/producer",ns=b({name:"TaskPreview",components:{ElImage:N,ElIcon:K,ElTooltip:Te,FontAwesomeIcon:D,VideoPlay:Q,VideoPause:Y,ElDropdown:Ae,ElDropdownMenu:Pe,ElDropdownItem:Ee,Loading:ie},props:{modelValue:{type:Object,required:!0}},data(){return{isFetchingVideoUrl:!1,isFetchingWav:!1}},computed:{loading(){return this.$store.state.producer?.status?.getApplications===L.Request},credential(){return this.$store.state.producer.credential},config(){return this.$store.state.producer.config},task(){return this.$store.state.producer?.tasks},audios(){const e=this.modelValue?.response?.data??[],t=this.modelValue?.request?.action;return t?e.map(l=>({...l,action:t})):e},application(){return this.$store.state.producer?.application},active(){return this.$store.state.producer?.tasks?.active}},methods:{useFormatDuring:j,onPlay(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"playing"}),console.log("on play")},onPause(e){this.$store.dispatch("producer/setAudio",{...this.$store.state.producer.audio,...e,state:"paused"}),console.log("on pause")},onClick(e){this.$store.state?.producer?.audio?.id!==e.id&&this.onPlay({...e,progress:0})},onExtend(e,t){e.stopPropagation(),console.debug("set config",t),this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,model:t.model,custom:!0,instrumental:!1,style:t.style,action:"extend",audio:t,audio_id:t.id,continue_at:t.duration})},onDownload(e,t){e&&e.stopPropagation();const i=new URL(t).pathname,h=i.substring(i.lastIndexOf("/")+1);fetch(t).then(p=>p.blob()).then(p=>{_e.saveAs(p,h)})},async handleVideoDownload(e){if(e.video_url){this.onDownload(null,e.video_url);return}if(!this.isFetchingVideoUrl)try{this.isFetchingVideoUrl=!0;const t=await this.fetchVideoUrlFromApi(e?.id);console.log(`get videoUrl: ${t}`),e.video_url=t,this.onDownload(null,t)}catch(t){console.error("get videoUrl failed:",t),w.error(this.$t("producer.message.getVideoUrlFailed"))}finally{this.isFetchingVideoUrl=!1}},async fetchVideoUrlFromApi(e){return new Promise((t,l)=>{const i={audio_id:e},h=this.credential?.token;if(!h){console.error("no token specified"),l(new Error("No token specified"));return}I.video(i,{token:h}).then(p=>{const u=p.data?.data?.video_url;u?t(u):l(new Error("Video URL not found in response"))}).catch(p=>{l(p)})})},onPreview(e,t){e.stopPropagation(),window.open(t,"_blank")},async onGetStems(e){await this.onGenerateAudioUrl("stems",e)},onCover(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,model:e.model,custom:!0,instrumental:!1,style:e.style,action:"cover",audio:e,audio_id:e.id})},onVariation(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,model:e.model,custom:!0,style:e.style,action:"variation",audio:e,audio_id:e.id})},async onSwapVocals(e){await this.onGenerateAudioUrl("swap_vocals",e)},async onSwapInstrumentals(e){await this.onGenerateAudioUrl("swap_instrumentals",e)},async onGetAllStems(e){await this.onGenerateAudioUrl("all_stems",e)},onReplaceSection(e){this.$store.commit("producer/setConfig",{...this.$store.state.producer?.config,model:e.model,custom:!0,instrumental:!1,style:e.style,action:"replace_section",audio:e,audio_id:e.id,replace_section_start:0,replace_section_end:Math.min(30,e.duration||30)})},async handleWavDownload(e){if(!e?.id||this.isFetchingWav)return;const t=this.credential?.token;if(t)try{this.isFetchingWav=!0,w.info(this.$t("producer.message.fetchingWav"));const i=(await I.wav({audio_id:e.id},{token:t})).data?.data?.audio_url;i?this.onDownload(null,i):w.error(this.$t("producer.message.fetchWavFailed"))}catch{w.error(this.$t("producer.message.fetchWavFailed"))}finally{this.isFetchingWav=!1}},async onGenerateAudioUrl(e,t){const l={action:e,audio_id:t,callback_url:ss},i=this.credential?.token;if(!i){console.error("no token specified");return}w.info(this.$t("producer.message.startingTask")),I.audio(l,{token:i}).then(()=>{w.success(this.$t("producer.message.startTaskSuccess"))}).catch(h=>{w.error(h?.response?.data?.error?.message||this.$t("producer.message.startTaskFailed"))}).finally(async()=>{await this.onGetTasks(),await this.onScrollDown()})},async onScrollDown(){setTimeout(()=>{const e=document.querySelector(".tasks");e&&(e.scrollTop=e.scrollHeight)},1e3)},async onGetTasks(){if(this.loading){console.debug("loading");return}await this.$store.dispatch("producer/getTasks",{limit:30,offset:0})}}}),rs={class:"task"},is=["onClick"],as={class:"left"},ls=["onClick"],cs=["onClick"],ds={key:2,class:"duration"},us={class:"info"},ps={class:"title"},ms={class:"style"},fs={class:"right"},hs={class:"el-dropdown-link"},_s={class:"flex items-center min-w-[120px]"},$s={class:"flex items-center min-w-[120px]"},gs={class:"el-dropdown-link"};function vs(e,t,l,i,h,p){const u=r("el-image"),m=r("video-pause"),_=r("el-icon"),$=r("video-play"),k=r("font-awesome-icon"),y=r("el-tooltip"),E=r("Loading"),S=r("el-dropdown-item"),M=r("el-dropdown-menu"),O=r("el-dropdown"),J=H("loading");return n(),c("div",rs,[(n(!0),c(G,null,q(e.audios,g=>(n(),c("div",{key:g.id,class:"audio",onClick:P(C=>e.onClick(g),["stop"])},[R((n(),c("div",as,[s(u,{src:g?.image_url,class:"cover",fit:"cover",lazy:""},null,8,["src"]),g?.audio_url&&e.$store.state?.producer?.audio?.id===g.id&&e.$store.state?.producer?.audio?.state==="playing"?(n(),c("div",{key:0,class:"overlay",onClick:P(C=>e.onPause(g),["stop"])},[s(_,null,{default:d(()=>[s(m)]),_:1})],8,ls)):f("",!0),g?.audio_url&&(e.$store.state?.producer?.audio?.id!==g.id||e.$store.state?.producer?.audio?.id===g.id&&e.$store.state?.producer?.audio?.state==="paused")?(n(),c("div",{key:1,class:"overlay",onClick:P(C=>e.onPlay(g),["stop"])},[s(_,null,{default:d(()=>[s($)]),_:1})],8,cs)):f("",!0),g?.duration?(n(),c("div",ds,a(e.useFormatDuring(g?.duration)),1)):f("",!0)])),[[J,!g?.audio_url]]),o("div",us,[o("h2",ps,a(g?.title),1),o("p",ms,a(g?.style),1)]),o("div",fs,[s(O,null,{dropdown:d(()=>[s(M,null,{default:d(()=>[s(S,{disabled:e.isFetchingVideoUrl,onClick:C=>e.handleVideoDownload(g)},{default:d(()=>[o("div",_s,[e.isFetchingVideoUrl?(n(),v(_,{key:0,class:"is-loading mr-2"},{default:d(()=>[s(E)]),_:1})):f("",!0),o("span",null,a(e.$t("producer.button.download_video")),1)])]),_:1},8,["disabled","onClick"]),g?.audio_url?(n(),v(S,{key:0,onClick:P(C=>e.onDownload(C,g?.audio_url),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.download_audio")),1)]),_:1},8,["onClick"])):f("",!0),s(S,{disabled:e.isFetchingWav,onClick:C=>e.handleWavDownload(g)},{default:d(()=>[o("div",$s,[e.isFetchingWav?(n(),v(_,{key:0,class:"is-loading mr-2"},{default:d(()=>[s(E)]),_:1})):f("",!0),o("span",null,a(e.$t("producer.button.download_wav")),1)])]),_:1},8,["disabled","onClick"])]),_:2},1024)]),default:d(()=>[o("span",hs,[s(y,{effect:"dark",content:e.$t("producer.button.download"),placement:"top"},{default:d(()=>[g?.audio_url||g?.video_url?(n(),v(k,{key:0,icon:"fa-solid fa-download",class:"icon icon-download"})):f("",!0)]),_:2},1032,["content"])])]),_:2},1024),s(O,null,{dropdown:d(()=>[s(M,null,{default:d(()=>[g?.audio_url?(n(),v(S,{key:0,onClick:P(C=>e.onExtend(C,g),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.extend")),1)]),_:1},8,["onClick"])):f("",!0),g.id?(n(),v(S,{key:1,onClick:P(C=>e.onGetStems(g.id),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.get_stems")),1)]),_:1},8,["onClick"])):f("",!0),g.id?(n(),v(S,{key:2,onClick:P(C=>e.onGetAllStems(g.id),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.all_stems")),1)]),_:1},8,["onClick"])):f("",!0),s(S,{onClick:P(C=>e.onCover(g),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.cover_music")),1)]),_:1},8,["onClick"]),g?.id?(n(),v(S,{key:3,onClick:P(C=>e.onVariation(g),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.variation")),1)]),_:1},8,["onClick"])):f("",!0),g?.id?(n(),v(S,{key:4,onClick:P(C=>e.onSwapVocals(g.id),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.swap_vocals")),1)]),_:1},8,["onClick"])):f("",!0),g?.id?(n(),v(S,{key:5,onClick:P(C=>e.onSwapInstrumentals(g.id),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.swap_instrumentals")),1)]),_:1},8,["onClick"])):f("",!0),g?.id?(n(),v(S,{key:6,onClick:P(C=>e.onReplaceSection(g),["stop"])},{default:d(()=>[U(a(e.$t("producer.button.replace_section")),1)]),_:1},8,["onClick"])):f("",!0)]),_:2},1024)]),default:d(()=>[o("span",gs,[s(y,{effect:"dark",content:e.$t("producer.button.more"),placement:"top"},{default:d(()=>[g?.audio_url||g?.video_url?(n(),v(k,{key:0,icon:"fa-solid fa-ellipsis",class:"icon icon-ellipsis"})):f("",!0)]),_:2},1032,["content"])])]),_:2},1024)])],8,is))),128))])}const ys=V(ns,[["render",vs]]),ks={class:"player-slider"},bs=b({__name:"PlayerSlider",setup(e){const t=Z(),l=T({get:()=>t.state.producer?.audio?.progress,set:u=>t.commit("producer/setAudio",{...t.state.producer.audio,progress:u})}),i=T({get:()=>t.state.producer?.audio?.duration,set:u=>t.commit("producer/setAudio",{...t.state.producer.audio,duration:u})}),h=()=>{},p=u=>t.dispatch("producer/setAudio",{...t.state.producer.audio,progress:u});return(u,m)=>(n(),c("div",ks,[s(A(x),{modelValue:l.value,"onUpdate:modelValue":m[0]||(m[0]=_=>l.value=_),"show-tooltip":!1,min:0,max:i.value,onChange:p,onInput:h},null,8,["modelValue","max"])]))}}),ws={class:"flex player-song"},Cs=["src"],Vs={class:"ml-2 text-xs flex flex-col justify-between"},Ss={class:"w-52 2xl:w-96 cursor-pointer truncate"},Us={class:"flex"},Es={class:"ml-2 text-dc"},Ps=b({__name:"PlayerSong",setup(e){const t=Z(),l=T({get:()=>t.state.producer.audio,set:i=>t.commit("producer/setAudio",i)});return se(l,(i,h)=>{if(i?.audio_url!==h?.audio_url){console.log("audio changed",i),i.object&&(console.log("111",i.object),i.object.pause(),delete i.object);const p=new Audio(i.audio_url);i.state==="playing"?p.play():p.pause(),p.addEventListener("loadedmetadata",()=>{p.currentTime=0,p.addEventListener("timeupdate",()=>{t.commit("producer/setAudio",{...t.state.producer.audio,progress:p.currentTime})})}),t.commit("producer/setAudio",{...t.state.producer.audio,object:p})}else if(i?.progress!==h?.progress&&Math.abs(i.progress-i.object.currentTime)>2){console.log("progress changed",i.progress);const p=t.state.producer.audio;p.object&&(p.object.currentTime=p.progress)}else i?.state!==h?.state&&(console.log("state changed",i.state),i.object&&(i.state==="playing"?i.object.play():i.object.pause()));i?.volume!==h?.volume&&(console.log("volume changed",i.volume),i.object&&(i.object.volume=i.volume/100))}),(i,h)=>(n(),c("div",ws,[o("img",{alt:"",class:"w-11 h-11 rounded",src:l.value?.image_url||A($e)},null,8,Cs),o("div",Vs,[o("div",Ss,[o("div",Us,[o("span",null,a(l.value?.title||"Music"),1),o("span",Es,"- "+a(l.value?.style||"SmallRuralDog"),1)])])])]))}}),As={class:"flex justify-end items-center gap-x-2.5"},Ts={class:"text-xs"},Fs=b({__name:"PlayerAction",setup(e){const t=Z(),l=T({get:()=>t.state.producer?.audio?.progress,set:h=>t.commit("producer/setAudio",{...t.state.producer.audio,progress:h})}),i=T({get:()=>t.state.producer?.audio?.duration,set:h=>t.commit("producer/setAudio",{...t.state.producer.audio,duration:h})});return(h,p)=>(n(),c("div",As,[o("span",Ts,a(A(j)(l.value))+" / "+a(A(j)(i.value)),1)]))}}),Is={class:"player-volume flex flex-col items-center pt-2"},Ls={class:"text-sm mt-3"},Gs=b({__name:"PlayerVolumeSlider",setup(e){const t=Z(),l=T({get:()=>t.state.producer.audio?.volume,set:p=>t.commit("producer/setAudio",{...t.state.producer.audio,volume:p})}),i=T({get:()=>t.state.producer.audio?.muted,set:p=>t.commit("producer/setAudio",{...t.state.producer.audio,muted:p})}),h=p=>t.dispatch("producer/setVolume",p);return(p,u)=>(n(),c("div",Is,[s(A(x),{modelValue:l.value,"onUpdate:modelValue":u[0]||(u[0]=m=>l.value=m),vertical:"",height:"100px","show-tooltip":!1,max:100,min:0,size:"small",disabled:i.value,onInput:h},null,8,["modelValue","disabled"]),o("div",Ls,a(l.value),1)]))}}),js={class:"flex items-center justify-center gap-x-3"},Ds=b({__name:"PlayerController",setup(e){const t=Z(),l=()=>t.dispatch("producer/setAudio",{...t.state.producer.audio,state:t.state.producer.audio.state==="playing"?"paused":"playing"}),i=T(()=>t.state.producer.audio);return(h,p)=>(n(),c("div",js,[s(ee,{icon:i.value?.state==="playing"?A(ge):A(ve),size:"45",theme:"filled",class:"text-[var(--el-color-primary)] cursor-pointer",onClick:l},null,8,["icon"]),s(A(Fe),{placement:"top",width:"50px",trigger:"click"},{reference:d(()=>[s(ee,{icon:A(ye),size:"20","stroke-width":2,class:"cursor-pointer"},null,8,["icon"])]),default:d(()=>[s(Gs)]),_:1})]))}}),Rs={class:"flex flex-col items-stretch h-20"},Zs={class:"flex grow px-5 items-center"},zs={class:"flex-1"},Ns={class:"flex-1"},Ms={class:"flex-1"},Os=b({__name:"Player",setup(e){return(t,l)=>(n(),c("div",Rs,[s(bs),o("div",Zs,[o("div",zs,[s(Ps)]),o("div",Ns,[s(Ds)]),o("div",Ms,[s(Fs)])])]))}}),Bs=b({name:"RecentPanel",components:{ElSkeletonItem:Ge,ElSkeleton:Le,TaskPreview:ys,Player:Os,NoTasks:Ie,ScrollList:fe},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.producer?.tasks,items:this.$store.state.producer?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),qs={key:0,class:"tasks"},Ws={class:"left w-[70px] p-[10px] flex items-center"},Hs={class:"main w-[calc(100%-70px)] flex-1 p-[10px]"},Ks={key:2,class:"w-full flex-1 flex items-center justify-center"},Js={class:"h-20"};function Ys(e,t,l,i,h,p){const u=r("el-skeleton-item"),m=r("el-skeleton"),_=r("task-preview"),$=r("scroll-list"),k=r("no-tasks"),y=r("player");return n(),c(G,null,[e.tasks?.items===void 0?(n(),c("div",qs,[(n(),c(G,null,q(3,E=>o("div",{key:E,class:"flex"},[o("div",Ws,[s(m,{animated:""},{template:d(()=>[s(u,{variant:"image",class:"avatar w-[50px] h-[50px]"})]),_:1})]),o("div",Hs,[s(m,{animated:""},{template:d(()=>[s(u,{variant:"p",class:"w-[200px] h-[15px] mb-[5px] mt-[10px]"}),s(u,{variant:"text"})]),_:1})])])),64))])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(n(),v($,{key:1,ref:"scrollList",class:"flex-1 w-full overflow-y-auto tasks p-2",loading:e.loading,onReachTop:t[0]||(t[0]=E=>e.$emit("reach-top"))},{default:d(()=>[(n(!0),c(G,null,q(e.tasks?.items,(E,S)=>(n(),v(_,{key:S,"model-value":E,class:"preview"},null,8,["model-value"]))),128))]),_:1},8,["loading"])):f("",!0),e.tasks?.items?.length===0?(n(),c("div",Ks,[s(k)])):f("",!0),R(o("div",Js,[s(y)],512),[[ne,!!e.$store?.state?.producer?.audio?.object]])],64)}const Qs=V(Bs,[["render",Ys]]),Xs=b({name:"TaskPreview",components:{IconPicture:ae,ElImage:N,ElAvatar:ke,ElIcon:K},computed:{audio(){return this.$store.state.producer?.audio}}}),xs={key:0,class:"size-full overflow-hidden"},en={class:"relative h-[300px]"},tn={class:"flex items-center justify-center size-full bg-[var(--el-bg-color)]"},on={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"},sn={class:"p-4"},nn={class:"flex items-center font-bold mb-2"},rn={class:"text-[var(--el-text-color-regular)] mb-2"},an={class:"text-xs text-[var(--el-text-color-regular)]"},ln={class:"mt-4 text-sm leading-[25px] whitespace-pre-wrap"},cn={key:1,class:"w-full h-full"};function dn(e,t,l,i,h,p){const u=r("icon-picture"),m=r("el-icon"),_=r("el-image"),$=r("el-avatar");return e.audio?.object?(n(),c("div",xs,[o("div",en,[s(_,{src:e.audio.image_url,fit:"cover",class:"size-full"},{error:d(()=>[o("div",tn,[s(m,{class:"text-3xl"},{default:d(()=>[s(u)]),_:1})])]),_:1},8,["src"]),o("h2",on,a(e.audio?.title),1)]),o("div",sn,[o("div",nn,[s($,{size:30,src:e.audio?.image_url,class:"mr-2"},null,8,["src"]),o("span",null,a(e.audio?.title),1)]),o("p",rn,a(e.audio?.style),1),o("p",an,a(e.$dayjs.format(e.audio?.created_at)),1),o("div",ln,[o("p",null,a(e.audio?.lyric),1)])])])):(n(),c("div",cn))}const un=V(Xs,[["render",dn]]),pn="https://webhook.acedata.cloud/producer",mn=b({name:"ProducerIndex",components:{Layout:Oe,ConfigPanel:os,RecentPanel:Qs,PreviewPanel:un},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.producer?.status?.getApplications===L.Request},tasksLoading(){return this.$store.state.producer?.status?.getTasks===L.Request||this.fetchingTasks},service(){return this.$store.state.producer.service},credential(){return this.$store.state.producer.credential},config(){return this.$store.state.producer.config},initializing(){return this.$store.state.producer.status.getApplications===L.Request},needApply(){return this.$store.state.producer.status.getApplications===L.Success&&!this.application},application(){return this.$store.state.producer.application},tasks(){return this.$store.state.producer.tasks},applications(){return this.$store.state.producer.applications}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await je({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("producer/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplications"),await this.$store.dispatch("producer/getApplications"),console.debug("end onGetApplications"),await this.onGetTasks()},onApply(){le.create({application:this.application}).then(({data:e})=>{this.application=e,w.success(this.$t("application.message.applySuccessfully"))}).catch(e=>{e?.response?.data?.code===ce&&w.error(this.$t("application.message.alreadyApplied"))})},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:l,createdAtMax:i}=e||{};console.debug("limit",t,"createdAtMin",l,"createdAtMax",i),this.fetchingTasks=!0;try{await this.$store.dispatch("producer/getTasks",{limit:t,createdAtMin:l,createdAtMax:i})}finally{this.fetchingTasks=!1}},async onGenerateAudio(){const e={...this.config,callback_url:pn},t=this.credential?.token;if(!t){console.error("no token specified");return}w.info(this.$t("producer.message.startingTask")),I.audio(e,{token:t}).then(()=>{w.success(this.$t("producer.message.startTaskSuccess"))}).catch(l=>{w.error(l?.response?.data?.error?.message||this.$t("producer.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function fn(e,t,l,i,h,p){const u=r("config-panel"),m=r("recent-panel"),_=r("preview-panel"),$=r("layout");return n(),v($,null,{config:d(()=>[s(u,{onGenerate:e.onGenerateAudio},null,8,["onGenerate"])]),result:d(()=>[s(m,{ref:"recentPanel",class:"panel recent",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),preview:d(()=>[s(_)]),_:1})}const ur=V(mn,[["render",fn],["__scopeId","data-v-638e0ac5"]]);export{ur as default};
|