@acedatacloud/nexior 3.138.0 → 3.139.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-ce3rdRmZ.js → Auth-BcQ1S9H9.js} +1 -1
- package/dist/assets/{BotPlaceholder-jDf8T7ol.js → BotPlaceholder-C_IGBMvq.js} +1 -1
- package/dist/assets/{Callback-DpIhEpMc.js → Callback-Dz16AydU.js} +1 -1
- package/dist/assets/{Console-D5Wc8XjW.js → Console-BnxnCxbr.js} +1 -1
- package/dist/assets/{Consumption-F9vhwk03.js → Consumption-BEd757XD.js} +1 -1
- package/dist/assets/{Conversation-BOhG8w7f.js → Conversation-D62UlIlf.js} +1 -1
- package/dist/assets/{CopyToClipboard-UjbBZ_ac.js → CopyToClipboard-BOQ-Zpxe.js} +1 -1
- package/dist/assets/{Detail-DeALY2Ko.js → Detail-BSPDrQ4n.js} +2 -2
- package/dist/assets/{EditArray-CQCTrb4Y.js → EditArray-aUvIq-M5.js} +1 -1
- package/dist/assets/{Extra-DuPu2cIH.js → Extra-C1ookCUb.js} +1 -1
- package/dist/assets/{FilePreview-LbYKIcSs.js → FilePreview-BPuB0Ku4.js} +1 -1
- package/dist/assets/{History-o0EcSv3q.js → History-CfteuFc8.js} +1 -1
- package/dist/assets/{IconPark.vue_vue_type_script_setup_true_lang-4YLqaqth.js → IconPark.vue_vue_type_script_setup_true_lang-C16E7ag1.js} +1 -1
- package/dist/assets/{ImagePreview-CLAIXPcM.js → ImagePreview-DZPTnmBT.js} +1 -1
- package/dist/assets/{ImageWrapper-C8ang_Wj.js → ImageWrapper-CdB5Q-Ka.js} +1 -1
- package/dist/assets/{Index-C1KDpY6C.js → Index-B-cqMD92.js} +1 -1
- package/dist/assets/{Index-D25PMiYa.js → Index-B6yXqiYj.js} +1 -1
- package/dist/assets/{Index-BURfwB3I.js → Index-BJJD4l0P.js} +1 -1
- package/dist/assets/{Index-Dy5wg0fw.js → Index-BN-nFqQK.js} +1 -1
- package/dist/assets/{Index-BQnGFOKH.js → Index-BhEpE8tc.js} +1 -1
- package/dist/assets/{Index-DMsHr9rJ.js → Index-BsKBrjYc.js} +1 -1
- package/dist/assets/{Index-CeBegiSh.js → Index-BwlLyeaJ.js} +1 -1
- package/dist/assets/{Index-JE5YYUMV.js → Index-C-9jSiYb.js} +1 -1
- package/dist/assets/{Index-Cy5DS50I.js → Index-CI3jIfMT.js} +1 -1
- package/dist/assets/{Index-CJ29A5rX.js → Index-CIbeLVBD.js} +1 -1
- package/dist/assets/{Index-Bbv5JR8H.js → Index-CLs_tNwl.js} +1 -1
- package/dist/assets/{Index-CEv6yGxY.js → Index-CQZFL0L3.js} +1 -1
- package/dist/assets/{Index-D9ASCqPb.js → Index-CX3EufLS.js} +1 -1
- package/dist/assets/{Index-BYspsqa3.js → Index-CgSkF6bt.js} +1 -1
- package/dist/assets/{Index-D8duFiej.js → Index-Ci-SgZmI.js} +1 -1
- package/dist/assets/{Index-BkdZj0oV.js → Index-CwOYFPiY.js} +1 -1
- package/dist/assets/{Index-F8wnRAUn.js → Index-D4jtO-fT.js} +1 -1
- package/dist/assets/{Index-DzFcIN7G.js → Index-D5vK1_4H.js} +1 -1
- package/dist/assets/{Index-DDhCYbL9.js → Index-DBZrlV97.js} +1 -1
- package/dist/assets/{Index-Bbmtgx3l.js → Index-DVZ3UetX.js} +1 -1
- package/dist/assets/{Index-CbHYW1tI.js → Index-DZZa_urE.js} +1 -1
- package/dist/assets/{Index-D6IAh2bo.js → Index-JrH_Q54i.js} +1 -1
- package/dist/assets/{Index-DRPyyBix.js → Index-sny0MAza.js} +1 -1
- package/dist/assets/{Index-TiP24BFQ.js → Index-uomT0RjQ.js} +1 -1
- package/dist/assets/{Invitees-B5ed4KTr.js → Invitees-Db6Dxut-.js} +1 -1
- package/dist/assets/{List-C7vv74f_.js → List-CaXnAiSo.js} +1 -1
- package/dist/assets/{List-C8qcs0Hp.js → List-DCGr1rPv.js} +1 -1
- package/dist/assets/{List-lxOJoJK4.js → List-i1Rkc8b8.js} +1 -1
- package/dist/assets/{Main-BIzlwttm.js → Main-CJKRE4Tr.js} +1 -1
- package/dist/assets/{Navigator-CZjanqUK.js → Navigator-CanPOnR8.js} +1 -1
- package/dist/assets/{NoTasks-sYq9Zr2G.js → NoTasks-Cb8ntRPy.js} +1 -1
- package/dist/assets/{NotFound-BtNPwVRy.js → NotFound-Dn7TxStw.js} +1 -1
- package/dist/assets/{OAuthCallback-CtMLctuA.js → OAuthCallback-CtK2eM-l.js} +1 -1
- package/dist/assets/{Pagination-Ph0T0Z8v.js → Pagination-Css2FfsE.js} +1 -1
- package/dist/assets/{ScrollList-COWNfBjK.js → ScrollList-WqruYG0f.js} +1 -1
- package/dist/assets/{Status-RsS_AjOU.js → Status-BzogBLiU.js} +1 -1
- package/dist/assets/{Subscribe-CLzay7tc.js → Subscribe-C2ca0SqG.js} +1 -1
- package/dist/assets/{TransportWebHID-_Z-zoQ7l.js → TransportWebHID-DbqbOno1.js} +1 -1
- package/dist/assets/{VideoPlayer-CzcMT9AZ.js → VideoPlayer-QZYuahlJ.js} +1 -1
- package/dist/assets/{_Uint8Array-DYoXPfzZ.js → _Uint8Array-a5wCK152.js} +1 -1
- package/dist/assets/{_baseClone-BHq6vhwI.js → _baseClone-JK1xFj5u.js} +1 -1
- package/dist/assets/{_baseIteratee-CCpRH0CC.js → _baseIteratee-DtAKlqKl.js} +1 -1
- package/dist/assets/{_initCloneObject-D8dKrUgV.js → _initCloneObject-UCIzaue4.js} +1 -1
- package/dist/assets/{add-BGXMA_8T.js → add-QVRWn1iw.js} +1 -1
- package/dist/assets/{all-wallets-DCYmLWJE.js → all-wallets-BKwiZxeX.js} +1 -1
- package/dist/assets/{app-store-DcNXK_08.js → app-store-DBUYzS1y.js} +1 -1
- package/dist/assets/{apple--YwSBZ1p.js → apple-ou_pLfoC.js} +1 -1
- package/dist/assets/{arrow-bottom-BWJcxbY1.js → arrow-bottom-DTlTOT5l.js} +1 -1
- package/dist/assets/{arrow-bottom-circle-CfhDDcRG.js → arrow-bottom-circle-BeNaJNvj.js} +1 -1
- package/dist/assets/{arrow-left-BZ9eYo63.js → arrow-left-BHXUjiM5.js} +1 -1
- package/dist/assets/{arrow-right-Ce2Q2tqR.js → arrow-right-Cf97-mBs.js} +1 -1
- package/dist/assets/{arrow-top-agqLmKzp.js → arrow-top-BL34vU22.js} +1 -1
- package/dist/assets/{avatar-C5rMPMQA.js → avatar-X_3IZNep.js} +1 -1
- package/dist/assets/{bank-DazleBXQ.js → bank-D-pEEZ2w.js} +1 -1
- package/dist/assets/{basic-BEd45NJt.js → basic-BpgD8dCA.js} +1 -1
- package/dist/assets/{browser-CAJChiMD.js → browser-u_I0YhFk.js} +1 -1
- package/dist/assets/{byokCredential-DHAgK6la.js → byokCredential-0hyiBdDM.js} +1 -1
- package/dist/assets/{card-BN1OJOl7.js → card-CYbV5JPB.js} +1 -1
- package/dist/assets/{castArray-kDnnxK3Y.js → castArray-DzT6pvlU.js} +1 -1
- package/dist/assets/{chat-DMv_1H1X.js → chat-DzSt93mP.js} +1 -1
- package/dist/assets/{checkmark-DI3hWSni.js → checkmark-BoXliZGr.js} +1 -1
- package/dist/assets/{checkmark-bold-Wx3_nn8v.js → checkmark-bold-C1JzdrUo.js} +1 -1
- package/dist/assets/{chevron-bottom-CNHfS4XU.js → chevron-bottom-BpAljN8x.js} +1 -1
- package/dist/assets/{chevron-left-33wOwNSY.js → chevron-left-DVA9nvRk.js} +1 -1
- package/dist/assets/{chevron-right-DXC2DAp1.js → chevron-right-fZiHOaDk.js} +1 -1
- package/dist/assets/{chevron-top-C6b9DzK6.js → chevron-top-BFXUUzRJ.js} +1 -1
- package/dist/assets/{chrome-store-c28WhCBV.js → chrome-store-B8pHxrlI.js} +1 -1
- package/dist/assets/{clock-DSFmzL5w.js → clock-D75NRQeg.js} +1 -1
- package/dist/assets/{close-DKeW9KpM.js → close-DU2uEqVl.js} +1 -1
- package/dist/assets/{coinPlaceholder-B06ZmATh.js → coinPlaceholder-BFWtzmEH.js} +1 -1
- package/dist/assets/{compass-ESre6PfN.js → compass-DEfiiAQI.js} +1 -1
- package/dist/assets/{copy-CYlCEN_q.js → copy-BrO81wpX.js} +1 -1
- package/dist/assets/{cursor-N1JE2Bw0.js → cursor-C23-tuDG.js} +1 -1
- package/dist/assets/{cursor-transparent-CSFf2ehP.js → cursor-transparent-DxbpsUOe.js} +1 -1
- package/dist/assets/{debounce-B3qQloOM.js → debounce-B74p5Dx9.js} +1 -1
- package/dist/assets/{desktop-DBhXcxk0.js → desktop-D2rgpW7k.js} +1 -1
- package/dist/assets/{disconnect-C59zYEFS.js → disconnect-CZEZvwjC.js} +1 -1
- package/dist/assets/{discord-DXIBRlvC.js → discord-DhdiQziW.js} +1 -1
- package/dist/assets/{distribution-DT9fOzPO.js → distribution-CC2znxi6.js} +1 -1
- package/dist/assets/{dropdown-CMUX2QKQ.js → dropdown-n3tVKADr.js} +1 -1
- package/dist/assets/{etherscan-DB3HK--R.js → etherscan-D2RVk6lc.js} +1 -1
- package/dist/assets/{exclamation-triangle-C1lRCtWt.js → exclamation-triangle-Btv2M3vT.js} +1 -1
- package/dist/assets/{extension-BOZrGfQI.js → extension-D4LXx9Dx.js} +1 -1
- package/dist/assets/{external-link-Cj3_kBJO.js → external-link-VB8uZUlN.js} +1 -1
- package/dist/assets/{facebook-D6l_0ap0.js → facebook-3nJoCU-F.js} +1 -1
- package/dist/assets/{farcaster-ChEQZGBw.js → farcaster-5iph5pnV.js} +1 -1
- package/dist/assets/{filters-LpZcVQBi.js → filters--HNUDh6h.js} +1 -1
- package/dist/assets/{flux-CPR5vnEI.js → flux-GaPULWYi.js} +1 -1
- package/dist/assets/{github-0Rkb_QWC.js → github-DLuZx3mb.js} +1 -1
- package/dist/assets/{google-DbVZ6Fqy.js → google-BWHWz_y1.js} +1 -1
- package/dist/assets/{hailuo-BLJIV_7y.js → hailuo-6Z4cpEsW.js} +1 -1
- package/dist/assets/{headshots-Bx_UIc8L.js → headshots-Ruy6voFN.js} +1 -1
- package/dist/assets/{help-circle-Dmmd_SNC.js → help-circle-etlKP3he.js} +1 -1
- package/dist/assets/{id-D4BuZaYx.js → id-Cohk1pUu.js} +1 -1
- package/dist/assets/{image-Dx-DY7U2.js → image-D7gezCa8.js} +1 -1
- package/dist/assets/{index-B_59vVR6.js → index-0EOEDiT5.js} +1 -1
- package/dist/assets/{index-7HuuBLDY.js → index-4IhcC2Q5.js} +1 -1
- package/dist/assets/{index-BeptfZWv.js → index-B8EULjap.js} +1 -1
- package/dist/assets/{index-BeJ6JfNM.js → index-B8cqf9M7.js} +1 -1
- package/dist/assets/{index-CrrePoOF.js → index-BB3zbewL.js} +1 -1
- package/dist/assets/{index-CJJYXPH3.js → index-BFSfwxgu.js} +6 -6
- package/dist/assets/{index-GRDTUL4i.js → index-BKLbg2aH.js} +1 -1
- package/dist/assets/{index-CMrxr9s5.js → index-BP_sbpCK.js} +1 -1
- package/dist/assets/{index-Ci2kDHK1.js → index-BQ7zd-Q3.js} +1 -1
- package/dist/assets/{index-D4_8u5Xr.js → index-BTuB9iOI.js} +1 -1
- package/dist/assets/{index-D9-nLyZk.js → index-BZTdivI9.js} +1 -1
- package/dist/assets/{index-B3xHboRT.js → index-BZsK4TAg.js} +1 -1
- package/dist/assets/{index-B6wCkhcv.js → index-Be1d4-PD.js} +1 -1
- package/dist/assets/{index-4dcAEEAI.js → index-Boh7ZLmt.js} +1 -1
- package/dist/assets/{index-CudWSSy4.js → index-Bpq8VeIE.js} +1 -1
- package/dist/assets/{index-DKlUKxnB.js → index-Bti47OvL.js} +3 -3
- package/dist/assets/{index-BRTqKX2j.js → index-C8bVV1-3.js} +1 -1
- package/dist/assets/{index-y8_Rqhz8.js → index-CAL96Kmg.js} +1 -1
- package/dist/assets/{index-CDP5BcG3.js → index-CBwGaapG.js} +1 -1
- package/dist/assets/{index-wOnlnU-2.js → index-CC1kUoBp.js} +1 -1
- package/dist/assets/{index-DTZY5KH9.js → index-CDj4oGhc.js} +1 -1
- package/dist/assets/{index-CDb5I0Er.js → index-CKbdz8TX.js} +1 -1
- package/dist/assets/{index-C5k5XrNd.js → index-CMZC1LbK.js} +1 -1
- package/dist/assets/{index-Dyd6KG-o.js → index-COsB5e28.js} +1 -1
- package/dist/assets/{index-Dxtss4Aw.js → index-CR3JtPGV.js} +1 -1
- package/dist/assets/{index-DugzSlEH.js → index-CTIaxaSN.js} +1 -1
- package/dist/assets/{index-SNhtZZZY.js → index-CYK_ZjxI.js} +1 -1
- package/dist/assets/{index-DFSMTET3.js → index-C_hLTYV6.js} +1 -1
- package/dist/assets/{index-B4Ov55Re.js → index-CbDuQQJI.js} +1 -1
- package/dist/assets/{index-DFloj7qj.js → index-CgUi3x9C.js} +1 -1
- package/dist/assets/{index-BMDbvDvb.js → index-ClhulR7R.js} +1 -1
- package/dist/assets/{index-z4KYoIkr.js → index-CoLmEdHw.js} +1 -1
- package/dist/assets/{index-vn4ig8tm.js → index-CqqR619c.js} +1 -1
- package/dist/assets/{index-KYiQ64-R.js → index-Cx7TciE9.js} +1 -1
- package/dist/assets/{index-mIRybi7_.js → index-Cxez0rJF.js} +1 -1
- package/dist/assets/{index-Bk7uGYgD.js → index-D2fVgLXM.js} +1 -1
- package/dist/assets/{index-DWRzkHl-.js → index-D7r--JBO.js} +1 -1
- package/dist/assets/{index-BnFifvyP.js → index-DALRzfG8.js} +1 -1
- package/dist/assets/{index-DEerCStc.js → index-DDnVlL0U.js} +1 -1
- package/dist/assets/{index-B2zgIuN-.js → index-DGT2UyCh.js} +1 -1
- package/dist/assets/{index-DD7PDhJt.js → index-DNJ0Deds.js} +1 -1
- package/dist/assets/{index-CroNukia.js → index-DXYQTkD2.js} +1 -1
- package/dist/assets/{index-g1qbc9hT.js → index-DXevThxR.js} +1 -1
- package/dist/assets/{index-BiWHgAHp.js → index-Das9vD7Z.js} +1 -1
- package/dist/assets/{index-k1IBAXDd.js → index-De-s_9_p.js} +1 -1
- package/dist/assets/{index-BMRSApyp.js → index-DmqdsYe_.js} +1 -1
- package/dist/assets/{index-DCjTjFFq.js → index-DrCIdlLh.js} +1 -1
- package/dist/assets/{index-ByzOFVtn.js → index-DutrdntU.js} +1 -1
- package/dist/assets/{index-DldHTE2z.js → index-PvtlKQGB.js} +1 -1
- package/dist/assets/{index-D9fXTOdx.js → index-QotPuZu5.js} +1 -1
- package/dist/assets/{index-CFRgclbH.js → index-TGVp909n.js} +1 -1
- package/dist/assets/{index-D3IlXm3d.js → index-TjvIRT2V.js} +1 -1
- package/dist/assets/{index-CU7Tkmoe.js → index-UIVyWmYx.js} +1 -1
- package/dist/assets/{index-JFdmI4KS.js → index-WqSt4SLK.js} +1 -1
- package/dist/assets/{index-CW2ML0Zo.js → index-gY0_GLnY.js} +1 -1
- package/dist/assets/{index-BVrGyG9B.js → index-iGAJ0EBY.js} +1 -1
- package/dist/assets/{index-DP0aQPsL.js → index-n3RmhGtc.js} +1 -1
- package/dist/assets/{index-PP8LGD_B.js → index-p6eQKJae.js} +1 -1
- package/dist/assets/{index-QRqt1QsU.js → index-t4Oimm-h.js} +1 -1
- package/dist/assets/{index-tL2fvVMN.js → index-wdE_vu7w.js} +3 -3
- package/dist/assets/{index-DrmqP8Ga.js → index-xKgpRyD9.js} +1 -1
- package/dist/assets/{index-DJTe9ay4.js → index-z0g7nVX-.js} +1 -1
- package/dist/assets/{index.browser.esm-C4XPCfcW.js → index.browser.esm-BMfcuYyV.js} +1 -1
- package/dist/assets/{index.es-DWP0WL9I.js → index.es-DkM2OF-9.js} +1 -1
- package/dist/assets/{info-DDbQ9AB9.js → info-CozxeMPh.js} +1 -1
- package/dist/assets/{info-circle-PMuT3QMW.js → info-circle-CD7PIB6e.js} +1 -1
- package/dist/assets/{isEqual-DGwqaOMZ.js → isEqual-CXlvduGT.js} +1 -1
- package/dist/assets/{isPlainObject-CzIy6uEw.js → isPlainObject-CxqZzpxw.js} +1 -1
- package/dist/assets/{kling-BIWAA77k.js → kling-CVouiR4n.js} +1 -1
- package/dist/assets/{lightbulb-Duxr4J7a.js → lightbulb-WadZYbB6.js} +1 -1
- package/dist/assets/{luma-vgv1N1AU.js → luma-UDDJf5GR.js} +1 -1
- package/dist/assets/{mail-C-bKcDjS.js → mail-DmskLNtJ.js} +1 -1
- package/dist/assets/{midjourney-DFmIRaLT.js → midjourney-CTA4775i.js} +1 -1
- package/dist/assets/{mobile-DrQqOJxz.js → mobile-Ds2LzBga.js} +1 -1
- package/dist/assets/{more-wHNaoE-o.js → more-Duf5FuKz.js} +1 -1
- package/dist/assets/{nanobanana-Czv7NSZ9.js → nanobanana-DdgZPViA.js} +1 -1
- package/dist/assets/{network-placeholder-CdEfBd7w.js → network-placeholder-CaU1sV5T.js} +1 -1
- package/dist/assets/{nftPlaceholder-BfhBj2DU.js → nftPlaceholder-2czTzqOn.js} +1 -1
- package/dist/assets/{off-B6Giq2oS.js → off-n4ukqXYJ.js} +1 -1
- package/dist/assets/{openaiimage-CPL-k0ta.js → openaiimage-DCwhO-Da.js} +1 -1
- package/dist/assets/{order-C8mb3rj3.js → order-Q1BxnUnM.js} +1 -1
- package/dist/assets/{pika-BIeozJai.js → pika-BAz8qBb0.js} +1 -1
- package/dist/assets/{pixverse-D-aoq3eL.js → pixverse-BsAQ-4Tt.js} +1 -1
- package/dist/assets/{play-store-DLbZCRda.js → play-store-BUOZKz8F.js} +1 -1
- package/dist/assets/{plus-uG-Jnl_X.js → plus-D6Vf6WPk.js} +1 -1
- package/dist/assets/{price-BLWWDZIp.js → price-CT1CtNhJ.js} +1 -1
- package/dist/assets/{producer-D59483ZS.js → producer-CYviysKm.js} +1 -1
- package/dist/assets/{qr-code-C-mIdQB9.js → qr-code-Bq2s3a5P.js} +1 -1
- package/dist/assets/{qrart-D3KRo_eW.js → qrart-BW1p7eKq.js} +1 -1
- package/dist/assets/{recycle-horizontal-xhmF_zJB.js → recycle-horizontal-DeZpuq-V.js} +1 -1
- package/dist/assets/{refresh-DXIBzwQQ.js → refresh-DuDPdN9q.js} +1 -1
- package/dist/assets/{reown-logo-0hj7lfvM.js → reown-logo-OQqY4IFR.js} +1 -1
- package/dist/assets/{search-D8BPON0e.js → search-CQWMyWrI.js} +1 -1
- package/dist/assets/{secp256k1-BYnnD9dN.js → secp256k1-BEDv1Dha.js} +1 -1
- package/dist/assets/{secp256k1-DQVVKY0l.js → secp256k1-BQhkAvy8.js} +1 -1
- package/dist/assets/{seedance-hnQutmCk.js → seedance-C5qFou8t.js} +1 -1
- package/dist/assets/{seedream-MX_il-6f.js → seedream-BM2C5q-d.js} +1 -1
- package/dist/assets/{send-Caw5detS.js → send-Bcn8FywM.js} +1 -1
- package/dist/assets/{service-BOZ_G8ev.js → service-BgOg7AKm.js} +1 -1
- package/dist/assets/{solana-wallets-qwTlbPkW.js → solana-wallets-DwuGoV-R.js} +2 -2
- package/dist/assets/{solana-wallets-vue-yTedoLeg.js → solana-wallets-vue-BkU3BDHc.js} +1 -1
- package/dist/assets/{solanaEmbed.esm-CPiwcJGn.js → solanaEmbed.esm-DGZjuWLD.js} +1 -1
- package/dist/assets/{sora-CQJ9mlK7.js → sora-DMKv1bNU.js} +1 -1
- package/dist/assets/{string_decoder-jRfZl5dK.js → string_decoder-CCfRUbt-.js} +1 -1
- package/dist/assets/{suno-CX8Vb7de.js → suno-BZ2rTza4.js} +1 -1
- package/dist/assets/{swapHorizontal-CUwiHAuo.js → swapHorizontal-CNXk9-lb.js} +1 -1
- package/dist/assets/{swapHorizontalBold-CzStE7sA.js → swapHorizontalBold-Ccavc1fv.js} +1 -1
- package/dist/assets/{swapHorizontalMedium-m0KKrGJo.js → swapHorizontalMedium-BuiULgEB.js} +1 -1
- package/dist/assets/{swapHorizontalRoundedBold-N3YLtR6L.js → swapHorizontalRoundedBold-DEBmn91T.js} +1 -1
- package/dist/assets/{swapVertical-QfKCnEff.js → swapVertical-DpDA5U0Z.js} +1 -1
- package/dist/assets/{telegram-BomdT1Pr.js → telegram-uK7IWH2o.js} +1 -1
- package/dist/assets/{three-dots-BX4pRDU5.js → three-dots-Dmkv9Avd.js} +1 -1
- package/dist/assets/{twitch-DUyuvUlT.js → twitch-bdPOWdJE.js} +1 -1
- package/dist/assets/{twitterIcon-BbQNR1PA.js → twitterIcon-BSGEZN8C.js} +1 -1
- package/dist/assets/{typescript-DEARewO1.js → typescript-2au3Mu9J.js} +1 -1
- package/dist/assets/{use-form-item-BR1a3Xvf.js → use-form-item-Clq-JJlb.js} +1 -1
- package/dist/assets/validator-DqeyweMw.js +1 -0
- package/dist/assets/{veo-B0_jjzRC.js → veo-zEO9V_gH.js} +1 -1
- package/dist/assets/{verify-filled-DDZUFx8U.js → verify-filled-BNrV7WvJ.js} +1 -1
- package/dist/assets/{verify-3Lisxc3k.js → verify-h_egHiFx.js} +1 -1
- package/dist/assets/{w3m-modal-ZorJACpV.js → w3m-modal-BY41QIjx.js} +1 -1
- package/dist/assets/{wallet-B7s267s2.js → wallet-B5waSIW7.js} +1 -1
- package/dist/assets/{wallet-placeholder-DA03mR05.js → wallet-placeholder-CluYqRXp.js} +1 -1
- package/dist/assets/{walletconnect-DPcUXR0J.js → walletconnect-CPJdBF2w.js} +1 -1
- package/dist/assets/{wan-CrFiliGM.js → wan-BB0GmTnO.js} +1 -1
- package/dist/assets/{warning-circle-z9GWBh3-.js → warning-circle-BN7F7HtP.js} +1 -1
- package/dist/assets/{web-BfsiDNlq.js → web-B296qwhE.js} +1 -1
- package/dist/assets/{web-D42Ugk3p.js → web-DZqGkCtR.js} +1 -1
- package/dist/assets/{x-Buebc_Mi.js → x-D_Ph4UU9.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/validator-395EcdVg.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as D}from"./CopyToClipboard-
|
|
1
|
+
import{C as D}from"./CopyToClipboard-BOQ-Zpxe.js";import{ar as I,as as F,at as T,au as N,E as P}from"./index-Bti47OvL.js";import{g as q}from"./price-CT1CtNhJ.js";import{d as B,a as w,s as O}from"./distribution-CC2znxi6.js";import{F as M}from"./index.es-DkM2OF-9.js";import{a as R}from"./index-iGAJ0EBY.js";import{E as z,a as U}from"./index-DDnVlL0U.js";import{E as V}from"./index-gY0_GLnY.js";import{E as H}from"./index-BB3zbewL.js";import{E as A}from"./index-CC1kUoBp.js";import{E as G}from"./index-DNJ0Deds.js";import{E as Q,a as J}from"./index-D7r--JBO.js";import{E as W}from"./index-B8cqf9M7.js";import{d as Y,x as l,y as o,C as i,E as e,F as s,H as p,I as m,J as k,D as r,q as n}from"./vendor-vue-NSDaktjZ.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-Cvgzdobq.js";import"./vendor-vue-router-Kg6s1a65.js";import"./index-t4Oimm-h.js";import"./typescript-2au3Mu9J.js";import"./index-CbDuQQJI.js";import"./_Uint8Array-a5wCK152.js";import"./_initCloneObject-UCIzaue4.js";import"./isPlainObject-CxqZzpxw.js";import"./_baseIteratee-DtAKlqKl.js";import"./isEqual-CXlvduGT.js";import"./castArray-DzT6pvlU.js";import"./debounce-B74p5Dx9.js";import"./index-Be1d4-PD.js";import"./use-form-item-Clq-JJlb.js";import"./index-DmqdsYe_.js";import"./index-BuyEbX8F.js";const j=Y({name:"ConsoleDistributionList",components:{CopyToClipboard:D,FontAwesomeIcon:M,QrCode:I,ElProgress:W,ElRow:J,ElCol:Q,ElButton:G,ElDivider:A,ElCard:H,ElTooltip:V,ElTable:U,ElTableColumn:z,ElSkeleton:R},data(){return{invitees:[],inviteesCount:void 0,distributionLevels:[],distributionLink:void 0,distributionStatus:void 0,loading:!1}},computed:{redirect(){return this.$route.query.redirect},page(){return parseInt(this.$route.query.page?.toString()||"1")},qrColor(){const t=document.documentElement.classList.contains("dark");return{dark:t?"#ffffff":"#000000",light:t?"#1e1e1e":"#ffffff"}},distributionLevelMap(){let t={};return this.distributionLevels.forEach(a=>{t[a.level]=a}),t}},watch:{page:{handler(){this.onFetchData()}}},async mounted(){this.onFetchData(),this.onGenerateDistributionLink()},methods:{getPriceString:q,goHistory(){this.$router.push({name:N})},goInvitees(){this.$router.push({name:T})},onPageChange(t){this.$router.push({name:this.$route.name?.toString(),query:{page:t}})},getPercentageForNextLevel(){const t=this.distributionLevelMap[this.distributionStatus?.level?.level]?.threshold,a=this.distributionLevelMap[this.distributionStatus?.level?.level+1]?.threshold;return Math.floor((this.distributionStatus?.price-t)/(a-t)*100)},getDeltaForNextLevel(){const t=this.distributionLevelMap[this.distributionStatus?.level?.level+1]?.threshold;return Math.floor(t-this.distributionStatus?.price)},async onFetchData(){this.loading=!0,await w.initialize(),Promise.all([this.onFetchDistributionStatus(),this.onFetchDistributionLevels(),this.onFetchInvitees()]).finally(()=>{this.loading=!1})},async onGenerateDistributionLink(){const a=`${window.location.origin}?inviter_id=${this.$store.getters.user.id}`;try{const f=(await O.create(a))?.data?.data?.url;this.distributionLink=(f||a).replace("surl.id","share.acedata.cloud")}catch{this.distributionLink=a}},async onFetchDistributionStatus(){const{data:t}=await w.getAll({user_id:this.$store.getters.user.id});t.items&&t.items.length>0&&(this.distributionStatus=t.items[0])},async onFetchDistributionLevels(){const{data:t}=await B.getAll({limit:20,user_id:this.$store.getters.user.id});this.distributionLevels=t.items},async onFetchInvitees(){const{data:t}=await F.getInvitees({});this.invitees=t.items,this.inviteesCount=t.count}}}),K={class:"title"},X={key:1},Z={class:"icon-wrapper"},x={class:"text-left"},tt={class:"description"},et={class:"value"},it={key:1},st={class:"icon-wrapper"},ot={class:"text-left"},nt={class:"description"},rt={class:"value"},at={key:1},lt={class:"icon-wrapper"},dt={class:"text-left"},ct={class:"description"},ut={class:"value"},pt={key:1},ht={class:"icon-wrapper"},mt={class:"text-left"},_t={class:"description"},bt={class:"value"},ft={key:1},vt={class:"title"},gt={class:"clear-both overflow-hidden"},kt={class:"float-left description"},yt={class:"float-right description"},$t={class:"description"},wt={class:"level"},Lt={class:"level"},St={class:"level"},Et={key:1},Ct={class:"title"},Dt={class:"link-wrapper text-center"},It=["href"],Ft={class:"qr-wrapper ml-auto mr-auto"},Tt={class:"mt-0"},Nt={class:"description"},Pt={class:"more"};function qt(t,a,f,Bt,Ot,Mt){const d=r("el-col"),_=r("el-row"),c=r("el-skeleton"),b=r("font-awesome-icon"),v=r("el-button"),u=r("el-card"),y=r("el-tooltip"),L=r("el-progress"),$=r("el-divider"),g=r("el-table-column"),S=r("el-table"),E=r("copy-to-clipboard"),C=r("qr-code");return n(),l(_,{class:"panel"},{default:o(()=>[i(d,{span:24},{default:o(()=>[i(_,null,{default:o(()=>[i(d,{span:24},{default:o(()=>[e("h2",K,s(t.$t("common.title.distribution")),1)]),_:1})]),_:1}),i(_,{gutter:15},{default:o(()=>[i(d,{md:6,xs:24},{default:o(()=>[i(u,{shadow:"hover",class:"item-mini mb-4"},{default:o(()=>[t.loading?(n(),l(c,{key:0})):(n(),p("div",X,[e("div",Z,[i(b,{icon:"fa-solid fa-wallet",class:"icon"})]),e("div",x,[e("p",tt,s(t.$t("distribution.title.price")),1),e("p",et,s(t.getPriceString({value:t.distributionStatus?.price})),1)]),i(v,{type:"primary",round:"",size:"small",class:"btn",onClick:t.goHistory},{default:o(()=>[m(s(t.$t("distribution.button.detail")),1)]),_:1},8,["onClick"])]))]),_:1})]),_:1}),i(d,{md:6,xs:24},{default:o(()=>[i(u,{shadow:"hover",class:"item-mini mb-4"},{default:o(()=>[t.loading?(n(),l(c,{key:0})):(n(),p("div",it,[e("div",st,[i(b,{icon:"fa-solid fa-coins",class:"icon"})]),e("div",ot,[e("p",nt,s(t.$t("distribution.title.reward")),1),e("p",rt,s(t.getPriceString({value:t.distributionStatus?.reward})),1)]),i(y,{effect:"dark",content:t.$t("distribution.message.developingWithDrawal"),placement:"top"},{default:o(()=>[i(v,{type:"primary",round:"",size:"small",class:"btn"},{default:o(()=>[m(s(t.$t("distribution.button.withdrawal")),1)]),_:1})]),_:1},8,["content"])]))]),_:1})]),_:1}),i(d,{md:6,xs:24},{default:o(()=>[i(u,{shadow:"hover",class:"item-mini mb-4"},{default:o(()=>[t.loading?(n(),l(c,{key:0})):(n(),p("div",at,[e("div",lt,[i(b,{icon:"fa-solid fa-percent",class:"icon"})]),e("div",dt,[e("p",ct,s(t.$t("distribution.title.percentage")),1),e("p",ut,s(t.distributionStatus?.level?.percentage)+"%",1)])]))]),_:1})]),_:1}),i(d,{md:6,xs:24},{default:o(()=>[i(u,{shadow:"hover",class:"item-mini mb-4"},{default:o(()=>[t.loading?(n(),l(c,{key:0})):(n(),p("div",pt,[e("div",ht,[i(b,{icon:"fa-regular fa-user",class:"icon"})]),e("div",mt,[e("p",_t,s(t.$t("distribution.title.inviteesCount")),1),e("p",bt,s(t.inviteesCount),1)]),i(v,{type:"primary",round:"",size:"small",class:"btn",onClick:t.goInvitees},{default:o(()=>[m(s(t.$t("distribution.button.detail")),1)]),_:1},8,["onClick"])]))]),_:1})]),_:1})]),_:1}),i(_,{gutter:15},{default:o(()=>[i(d,{md:12,xs:24},{default:o(()=>[i(u,{shadow:"hover",class:"level-info mb-4"},{default:o(()=>[t.loading?(n(),l(c,{key:0})):(n(),p("div",ft,[e("h4",vt,s(t.$t("distribution.title.levelInfo")),1),e("div",gt,[e("div",kt,[e("p",null,s(t.$t("distribution.title.currentLevel"))+": L"+s(t.distributionStatus?.level?.level),1),e("p",null,s(t.$t("distribution.title.currentPercentage"))+": "+s(t.distributionLevelMap[t.distributionStatus?.level?.level]?.percentage)+"% ",1)]),e("div",yt,[e("p",null,s(t.$t("distribution.title.nextLevel"))+": L"+s(t.distributionStatus?.level?.level+1),1),e("p",null,s(t.$t("distribution.title.nextPercentage"))+": "+s(t.distributionLevelMap[t.distributionStatus?.level?.level+1]?.percentage)+"% ",1)])]),i(L,{"text-inside":!0,"stroke-width":20,percentage:t.getPercentageForNextLevel(),class:"mb-2"},null,8,["percentage"]),e("p",$t,s(t.$t("distribution.message.deltaPriceForNextLevel"))+": $"+s(t.getDeltaForNextLevel()),1),i($),t.distributionLevels?(n(),l(S,{key:0,data:t.distributionLevels,stripe:""},{default:o(()=>[i(g,{label:t.$t("distribution.field.level")},{default:o(h=>[e("span",wt,"L"+s(h.row?.level),1)]),_:1},8,["label"]),i(g,{label:t.$t("distribution.field.threshold")},{default:o(h=>[e("span",Lt,"$"+s(h.row?.threshold),1)]),_:1},8,["label"]),i(g,{label:t.$t("distribution.field.percentage")},{default:o(h=>[e("span",St,s(h.row?.percentage)+"%",1)]),_:1},8,["label"])]),_:1},8,["data"])):k("",!0)]))]),_:1})]),_:1}),i(d,{md:12,xs:24},{default:o(()=>[i(u,{shadow:"hover",class:"distribution-info mb-4"},{default:o(()=>[t.loading?(n(),l(c,{key:0})):(n(),p("div",Et,[e("h4",Ct,s(t.$t("distribution.title.distributionLink")),1),i($),e("div",Dt,[k("",!0),e("a",{href:t.distributionLink,class:"link"},s(t.distributionLink),9,It),i(E,{content:t.distributionLink},null,8,["content"])]),e("div",Ft,[t.distributionLink?(n(),l(C,{key:0,value:t.distributionLink,size:180,margin:2,class:"block mb-2 ml-auto mr-auto",type:"image/png",color:t.qrColor},null,8,["value","color"])):k("",!0),e("p",Tt,s(t.$t("distribution.message.distributionQrDescription")),1)]),e("p",Nt,[m(s(t.$t("distribution.message.distributionLinkDescription"))+" ",1),e("span",Pt,[i(y,{effect:"dark",content:t.$t("distribution.message.distributionLinkDescription2"),placement:"top"},{default:o(()=>[m(s(t.$t("distribution.message.technicalDetail")),1)]),_:1},8,["content"])])])]))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}const _e=P(j,[["render",qt],["__scopeId","data-v-1ca0740d"]]);export{_e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as E}from"./index.es-DWP0WL9I.js";import{E as L}from"./index-DD7PDhJt.js";import{E as me}from"./index-CMrxr9s5.js";import{d as b,H as m,E as i,z as j,C as n,y as h,D as o,q as l,F as r,x as V,O as T,N as I,Q as R,J as k,R as ye,I as w,M as we}from"./vendor-vue-NSDaktjZ.js";import{E as y,b7 as A,a0 as Ce,F as Ve,cd as te,aw as oe}from"./index-DKlUKxnB.js";import{b as Se,c as ne,d as F,e as N,f as Te,g as Ie,h as Ee}from"./kling-CtoPhhA9.js";import{E as P,a as D}from"./index-D9-nLyZk.js";import{E as q}from"./index-DFSMTET3.js";import{E as C}from"./index-Ci2kDHK1.js";import{I as S,S as Le}from"./ScrollList-COWNfBjK.js";import{E as H}from"./index-PP8LGD_B.js";import{p as W}from"./pasteUploadMixin-BurWbGNQ.js";import{I as G}from"./ImagePreview-CLAIXPcM.js";import{E as J}from"./index-CW2ML0Zo.js";import{E as K}from"./index-DTZY5KH9.js";import{C as pe}from"./Consumption-F9vhwk03.js";import{E as ue}from"./index-Bk7uGYgD.js";import{E as ge}from"./index-g1qbc9hT.js";import{E as Q}from"./index-Dyd6KG-o.js";import{a as fe}from"./price-BLWWDZIp.js";import{F as Me}from"./FilePreview-LbYKIcSs.js";import{E as Ue,a as Re}from"./index-BMDbvDvb.js";import{E as Ae,a as Pe}from"./index-DrmqP8Ga.js";import{b as se}from"./errorCode-Cqj9Td_Z.js";import{k as ie}from"./kling-BIWAA77k.js";import{C as De}from"./CopyToClipboard-UjbBZ_ac.js";import{V as Ge}from"./VideoPlayer-CzcMT9AZ.js";import{E as Ke}from"./index-ByzOFVtn.js";import{E as Oe}from"./index-B_59vVR6.js";import{B as je}from"./BotPlaceholder-jDf8T7ol.js";import{N as Ne}from"./NoTasks-sYq9Zr2G.js";import{l as Be}from"./pagination-Cnc6Oeyx.js";import"./use-form-item-BR1a3Xvf.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-Cvgzdobq.js";import"./vendor-vue-router-Kg6s1a65.js";import"./index-QRqt1QsU.js";import"./typescript-DEARewO1.js";import"./index-B4Ov55Re.js";import"./strings-beZM2Y-f.js";import"./isEqual-DGwqaOMZ.js";import"./_Uint8Array-DYoXPfzZ.js";import"./castArray-kDnnxK3Y.js";import"./debounce-B3qQloOM.js";import"./_baseIteratee-CCpRH0CC.js";import"./index-BMRSApyp.js";import"./validator-395EcdVg.js";import"./index-BeJ6JfNM.js";import"./_baseClone-BHq6vhwI.js";import"./_initCloneObject-D8dKrUgV.js";import"./index-Cu41y2Fl.js";import"./index-DFloj7qj.js";import"./isPlainObject-CzIy6uEw.js";import"./vue-plyr-BO2nlN4c.js";import"./index-BVrGyG9B.js";const ze=b({name:"LayoutKling",components:{ElDrawer:me,ElButton:L,FontAwesomeIcon:E},data(){return{drawer:!1}}}),Fe={class:"main flex flex-row flex-1 min-h-0"},qe={class:"config w-[320px] flex-none h-full flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},He={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function We(e,t,s,a,u,$){const c=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),m("div",Fe,[i("div",qe,[j(e.$slots,"config",{},void 0,!0)]),i("div",He,[j(e.$slots,"result",{},void 0,!0)]),n(p,{circle:"",class:"menu",onClick:t[0]||(t[0]=d=>e.drawer=!0)},{default:h(()=>[n(c,{icon:"fa-solid fa-magic"})]),_:1}),n(f,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=d=>e.drawer=d),direction:"ltr","with-header":!1,size:"350px"},{default:h(()=>[j(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Je=y(ze,[["render",We],["__scopeId","data-v-8fa7523c"]]),Qe={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function he(e,t,s){const a=t||"std",u=s??5;switch(e){case"kling-v1":return{text2video:!0,image2video:!0,endImage:u===5,audio:!1,motionControl:u===5};case"kling-v1-6":case"kling-v2-5-turbo":return{text2video:!0,image2video:!0,endImage:a==="pro",audio:!1,motionControl:!1};case"kling-v2-6":return{text2video:!0,image2video:!0,endImage:a==="pro",audio:a==="pro",motionControl:!1};case"kling-v2-master":case"kling-v2-1-master":return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};case"kling-v3":return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:a!=="4k"};case"kling-v3-omni":return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1};case"kling-video-o1":return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1};default:return Qe}}function Y(e,t){if(!e)return[];const s=t.model??e.model,a=t.mode??e.mode,u=t.duration??e.duration;if(!s)return[];const $=he(s,a,u),c=[];return e.end_image_url&&!$.endImage&&c.push({field:"end_image_url",i18nLabel:"kling.name.endImage"}),e.generate_audio&&!$.audio&&c.push({field:"generate_audio",i18nLabel:"kling.name.generateAudio"}),e.camera_control?.type&&!$.motionControl&&c.push({field:"camera_control",i18nLabel:"kling.name.cameraControl"}),c}function X(e,t){const s={...e};for(const a of t)a.field==="end_image_url"&&(s.end_image_url=void 0),a.field==="generate_audio"&&(s.generate_audio=!1),a.field==="camera_control"&&(s.camera_control=void 0);return s}const Ye=b({name:"ModelSelector",components:{ElSelect:D,ElOption:P},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{revertKey:0,options:[{value:"kling-v3",label:"v3"},{value:"kling-v3-omni",label:"v3-Omni"},{value:"kling-v2-6",label:"v2.6"},{value:"kling-v2-5-turbo",label:"v2.5-Turbo"},{value:"kling-v2-1-master",label:"v2.1-Master"},{value:"kling-v2-master",label:"v2-Master"},{value:"kling-v1-6",label:"v1.6"},{value:"kling-v1",label:"v1"},{value:"kling-video-o1",label:"Video-o1"}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(Se)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Y(t,{model:e});if(s.length===0){this.applyModel(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=X({...t,model:e},s);this.$store.commit("kling/setConfig",u),C.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,model:e})}}}),Xe={class:"field"},Ze={class:"title font-bold"};function xe(e,t,s,a,u,$){const c=o("el-option"),p=o("el-select");return l(),m("div",Xe,[i("h2",Ze,r(e.$t("pika.name.model")),1),(l(),V(p,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("pika.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),m(T,null,I(e.options,f=>(l(),V(c,{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const et=y(Ye,[["render",xe],["__scopeId","data-v-04059875"]]),tt=b({name:"ModeSelector",components:{ElSelect:D,ElOption:P,InfoIcon:S},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},cameraControlSet(){return!!this.$store.state.kling?.config?.camera_control?.type},fourKReason(){return F.includes(this.selectedModel)?this.cameraControlSet?this.$t("kling.description.mode4kIncompatibleCamera"):"":this.$t("kling.description.mode4kRequiresV3")},options(){return[{value:"std",label:this.$t("kling.name.modeStd"),disabled:!1,disabledReason:""},{value:"pro",label:this.$t("kling.name.modePro"),disabled:!1,disabledReason:""},{value:"4k",label:this.$t("kling.name.mode4k"),disabled:!!this.fourKReason,disabledReason:this.fourKReason}]},value(){return this.$store.state.kling?.config?.mode}},watch:{fourKReason(e){e&&this.value==="4k"&&this.applyMode(ne)}},mounted(){this.value||this.applyMode(ne)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Y(t,{mode:e});if(s.length===0){this.applyMode(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=X({...t,mode:e},s);this.$store.commit("kling/setConfig",u),C.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyMode(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,mode:e})}}}),ot={class:"field"},nt={class:"header"},st={class:"title font-bold"},it={key:0,class:"opt-tip"};function lt(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),m("div",ot,[i("div",nt,[i("h2",st,r(e.$t("kling.name.mode")),1),n(c,{content:e.$t("kling.description.mode"),class:"info-icon"},null,8,["content"])]),(l(),V(f,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("kling.placeholder.select"),clearable:!0,onChange:e.onChange},{default:h(()=>[(l(!0),m(T,null,I(e.options,d=>(l(),V(p,{key:d.value,label:d.label,value:d.value,disabled:d.disabled},{default:h(()=>[i("span",{class:R({"opt-disabled":d.disabled})},r(d.label),3),d.disabled&&d.disabledReason?(l(),m("span",it,r(d.disabledReason),1)):k("",!0)]),_:2},1032,["label","value","disabled"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const at=y(tt,[["render",lt],["__scopeId","data-v-9a8fa3c5"]]),le=[3,5,8,10,12,15],ae=[5,10],rt=b({name:"DurationSelector",components:{ElSlider:H,InfoIcon:S},props:{modelValue:{type:Number,default:void 0}},emits:["update:modelValue"],data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},isV3Model(){return F.includes(this.selectedModel)},sliderMin(){return this.isV3Model?3:5},sliderMax(){return this.isV3Model?15:10},sliderStep(){return this.isV3Model?1:5},marks(){const e=this.isV3Model?le:ae,t={};for(const s of e)t[s]=`${s}s`;return t},value(){return this.$store.state.kling?.config?.duration??N},sliderValue(){const e=this.value;return e<this.sliderMin?this.sliderMin:e>this.sliderMax?this.sliderMax:e}},watch:{isV3Model(e){(this.isV3Model?le:ae).includes(this.value)||this.applyDuration(N)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(N)},methods:{async onChange(e){const t=Array.isArray(e)?e[0]:e,s=this.$store.state.kling?.config||{},a=Y(s,{duration:t});if(a.length===0){this.applyDuration(t);return}const u=a.map($=>this.$t($.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:u}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const $=X({...s,duration:t},a);this.$store.commit("kling/setConfig",$),C.success(this.$t("kling.message.featureRemovedNotice",{fields:u}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,duration:e})}}}),ct={class:"field"},dt={class:"header"},mt={class:"title font-bold"},pt={class:"value-display"};function ut(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-slider");return l(),m("div",ct,[i("div",dt,[i("h2",mt,r(e.$t("kling.name.duration")),1),n(c,{content:e.$t("kling.description.duration"),class:"info-icon ml-1"},null,8,["content"]),i("span",pt,r(e.value)+"s",1)]),(l(),V(p,{key:e.revertKey,"model-value":e.sliderValue,class:"slider",min:e.sliderMin,max:e.sliderMax,step:e.sliderStep,marks:e.marks,"show-tooltip":!1,onChange:e.onChange},null,8,["model-value","min","max","step","marks","onChange"]))])}const gt=y(rt,[["render",ut],["__scopeId","data-v-aa1a22a1"]]),ft=b({name:"RatioSelector",data(){return{options:[{value:"1:1",label:"1:1",width:20,height:20},{value:"16:9",label:"16:9",width:25,height:13},{value:"9:16",label:"9:16",width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){return this.$store.state?.kling?.config?.aspect_ratio},set(e){console.debug("set ratio",e),this.$store.commit("kling/setConfig",{...this.$store.state?.kling?.config,aspect_ratio:e})}}},mounted(){this.value||(this.value=Te)}}),ht={class:"text-sm font-bold mb-2 block"},_t={class:"items"},$t=["onClick"],vt={class:"name"};function kt(e,t,s,a,u,$){return l(),m("div",null,[i("span",ht,r(e.$t("kling.name.ratio")),1),i("div",_t,[(l(!0),m(T,null,I(e.options,(c,p)=>(l(),m("div",{key:p,class:R({active:e.active===p,item:!0}),onClick:f=>e.value=c.value},[i("div",{class:R(["preview",c.label])},[i("div",{class:"rect",style:ye({width:c.width+"px",height:c.height+"px"})},null,4)],2),i("p",vt,r(c.label),1)],10,$t))),128))])])}const bt=y(ft,[["render",kt],["__scopeId","data-v-cdb14b2f"]]),yt=b({name:"StartImage",components:{ElUpload:K,ElButton:L,ElTooltip:J,InfoIcon:S,FontAwesomeIcon:E,ImagePreview:G},mixins:[W],emits:["change"],data(){return{fileList:[],uploadUrl:A()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},value:{get(){return this.$store.state?.kling?.config?.start_image_url},set(){}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.error(this.$t("kling.message.uploadReferencesError"))},onSetStartImageUrl(){const e=this.urls?.[0];this.$store.commit("kling/setConfig",{...this.$store.state?.kling?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),wt={class:"relative"},Ct={class:"flex justify-between"},Vt={class:"flex justify-start items-center"},St={class:"text-sm font-bold"};function Tt(e,t,s,a,u,$){const c=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),d=o("el-button"),v=o("el-tooltip"),g=o("el-upload");return l(),m("div",wt,[i("div",Ct,[i("div",Vt,[i("span",St,r(e.$t("kling.name.startImage")),1),n(c,{content:e.$t("kling.description.uploadStartImage")},null,8,["content"])])]),n(g,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,disabled:e.reachedLimit,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:_})=>[_.url&&_.percentage!==void 0?(l(),V(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(v,{content:e.$t("kling.message.uploadReferencesExceed"),disabled:!e.reachedLimit,placement:"top"},{default:h(()=>[i("span",null,[n(d,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.reachedLimit},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadReferences")),1)]),_:1},8,["disabled"])])]),_:1},8,["content","disabled"])]),_:1},8,["file-list","disabled","action","on-exceed","on-error","on-success","headers"])])}const It=y(yt,[["render",Tt],["__scopeId","data-v-40832274"]]),Et=b({name:"EndImage",components:{ElUpload:K,ElButton:L,ElTooltip:J,ImagePreview:G,InfoIcon:S,FontAwesomeIcon:E},mixins:[W],data(){return{fileList:[],uploadUrl:A()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},klingConfig(){return this.$store.state?.kling?.config||{}},endImageSupported(){return he(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},uploadDisabled(){return this.reachedLimit||!this.endImageSupported},uploadTooltip(){return this.endImageSupported?this.reachedLimit?this.$t("kling.message.uploadReferencesExceed"):"":this.$t("kling.message.endImageNotSupported")},storeValue(){return this.klingConfig.end_image_url},value:{get(){return this.storeValue},set(){}}},watch:{storeValue(e){!e&&this.fileList.length>0&&(this.fileList=[])}},mounted(){this.value||(this.value=void 0),this.onSetEndImageUrl()},methods:{onBeforeUpload(){return this.endImageSupported?!0:(C.warning(this.$t("kling.message.endImageNotSupported")),!1)},onExceed(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.error(this.$t("kling.message.uploadReferencesError"))},onSetEndImageUrl(){const e=this.urls?.[0];this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),Lt={class:"relative"},Mt={class:"flex justify-between"},Ut={class:"flex justify-start items-center"},Rt={class:"text-sm font-bold"};function At(e,t,s,a,u,$){const c=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),d=o("el-button"),v=o("el-tooltip"),g=o("el-upload");return l(),m("div",Lt,[i("div",Mt,[i("div",Ut,[i("span",Rt,r(e.$t("kling.name.endImage")),1),n(c,{content:e.$t("kling.description.uploadEndImage")},null,8,["content"])])]),n(g,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,disabled:e.uploadDisabled,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","before-upload":e.onBeforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:_})=>[_.url&&_.percentage!==void 0?(l(),V(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(v,{content:e.uploadTooltip,disabled:!e.uploadDisabled,placement:"top"},{default:h(()=>[i("span",null,[n(d,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.uploadDisabled},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadReferences")),1)]),_:1},8,["disabled"])])]),_:1},8,["content","disabled"])]),_:1},8,["file-list","disabled","action","before-upload","on-exceed","on-error","on-success","headers"])])}const Pt=y(Et,[["render",At],["__scopeId","data-v-6959ad44"]]),Dt=b({name:"CfgScaleSelector",components:{ElSlider:H,InfoIcon:S,ElInputNumber:ue},computed:{value:{get(){return this.$store.state?.kling?.config?.cfg_scale},set(e){console.debug("set cfg_scale",e),this.$store.commit("kling/setConfig",{...this.$store.state?.kling?.config,cfg_scale:e})}}},mounted(){this.value||(this.value=Ie)}}),Gt={class:"flex justify-between"},Kt={class:"flex justify-start items-center"},Ot={class:"text-sm font-bold"},jt={class:"flex justify-end items-center"},Nt={class:"w-full"};function Bt(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-input-number"),f=o("el-slider");return l(),m("div",null,[i("div",Gt,[i("div",Kt,[i("span",Ot,r(e.$t("kling.name.cfgScale")),1),n(c,{content:e.$t("kling.description.cfgScale")},null,8,["content"])]),i("div",jt,[n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),"controls-position":"right"},null,8,["modelValue"])])]),i("div",Nt,[n(f,{modelValue:e.value,"onUpdate:modelValue":t[1]||(t[1]=d=>e.value=d),min:0,max:1,step:.1},null,8,["modelValue"])])])}const zt=y(Dt,[["render",Bt]]),Ft=b({name:"GenerateAudioSelector",components:{ElSwitch:ge,InfoIcon:S},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},selectedMode(){return this.$store.state.kling?.config?.mode||""},supported(){return!!(F.includes(this.selectedModel)||this.selectedModel==="kling-v2-6"&&this.selectedMode==="pro")},tooltipContent(){return this.supported?this.$t("kling.description.generateAudio"):this.$t("kling.description.generateAudioUnsupported")},value:{get(){return this.supported?this.$store.state.kling?.config?.generate_audio??Ee:!1},set(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,generate_audio:e})}}},watch:{supported(e){!e&&this.$store.state.kling?.config?.generate_audio&&this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,generate_audio:!1})}}}),qt={class:"relative"},Ht={class:"flex justify-between items-center"},Wt={class:"flex justify-start items-center"},Jt={class:"text-sm font-bold"};function Qt(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-switch");return l(),m("div",qt,[i("div",Ht,[i("div",Wt,[i("span",Jt,r(e.$t("kling.name.generateAudio")),1),n(c,{content:e.tooltipContent},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=f=>e.value=f),class:"value",disabled:!e.supported},null,8,["modelValue","disabled"])])])}const Yt=y(Ft,[["render",Qt]]),Xt=["horizontal","vertical","pan","tilt","roll","zoom"],Zt=b({name:"CameraControlSelector",components:{ElSelect:D,ElOption:P,ElSlider:H,ElInputNumber:ue,InfoIcon:S},data(){return{configKeys:Xt}},computed:{typeOptions(){return[{value:"",label:this.$t("kling.name.cameraTypeNone")},{value:"simple",label:this.$t("kling.name.cameraTypeSimple")},{value:"down_back",label:this.$t("kling.name.cameraTypeDownBack")},{value:"forward_up",label:this.$t("kling.name.cameraTypeForwardUp")},{value:"left_turn_forward",label:this.$t("kling.name.cameraTypeLeftTurnForward")},{value:"right_turn_forward",label:this.$t("kling.name.cameraTypeRightTurnForward")}]},selectedMode(){return this.$store.state.kling?.config?.mode||""},disabled(){return this.selectedMode==="4k"},tooltipContent(){return this.disabled?this.$t("kling.description.cameraControlDisabled4k"):this.$t("kling.description.cameraControl")},selectedType(){return this.$store.state.kling?.config?.camera_control?.type},selectedTypeRaw:{get(){return this.selectedType??""},set(e){const t=this.$store.state.kling?.config||{};if(!e){const a={...t};delete a.camera_control,this.$store.commit("kling/setConfig",a);return}const s=e;this.$store.commit("kling/setConfig",{...t,camera_control:{type:s,config:s==="simple"?t.camera_control?.config||{}:void 0}})}},configValues(){return this.$store.state.kling?.config?.camera_control?.config||{}}},watch:{disabled(e){e&&this.selectedType!==void 0&&(this.selectedTypeRaw="")}},methods:{writeConfig(e,t){const s=this.$store.state.kling?.config||{},a=s.camera_control||{type:"simple"},u={...a.config||{}};t==null?delete u[e]:u[e]=t,this.$store.commit("kling/setConfig",{...s,camera_control:{...a,type:"simple",config:u}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),xt={class:"field"},eo={class:"header"},to={class:"text-sm font-bold"},oo={key:0,class:"config-grid"},no={class:"cfg-row-head"},so={class:"cfg-name"};function io(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-option"),f=o("el-select"),d=o("el-input-number"),v=o("el-slider");return l(),m("div",xt,[i("div",eo,[i("span",to,r(e.$t("kling.name.cameraControl")),1),n(c,{content:e.tooltipContent},null,8,["content"])]),n(f,{modelValue:e.selectedTypeRaw,"onUpdate:modelValue":t[0]||(t[0]=g=>e.selectedTypeRaw=g),class:"value",placeholder:e.$t("kling.placeholder.cameraType"),clearable:!0,disabled:e.disabled},{default:h(()=>[(l(!0),m(T,null,I(e.typeOptions,g=>(l(),V(p,{key:g.value,label:g.label,value:g.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","disabled"]),e.selectedType==="simple"&&!e.disabled?(l(),m("div",oo,[(l(!0),m(T,null,I(e.configKeys,g=>(l(),m("div",{key:g,class:"cfg-row"},[i("div",no,[i("span",so,r(e.$t(`kling.name.cc_${g}`)),1),n(d,{modelValue:e.configValues[g],"onUpdate:modelValue":_=>e.configValues[g]=_,min:-1,max:1,step:.1,precision:1,"controls-position":"right",size:"small",class:"cfg-num",onChange:_=>e.onNumberChange(g,_)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),n(v,{"model-value":e.configValues[g]??0,min:-1,max:1,step:.1,onInput:_=>e.onSliderChange(g,_)},null,8,["model-value","onInput"])]))),128))])):k("",!0)])}const lo=y(Zt,[["render",io],["__scopeId","data-v-fb7b34d0"]]),_e=[{groupKey:"cameraMovements",chipKeys:["rotateAround","stationary","handheld","zoomOut","zoomIn","follow","panRight","tiltUp","tiltDown","orbit"]},{groupKey:"cameraSpeed",chipKeys:["speedSlow","speedMedium","speedFast"]},{groupKey:"shotType",chipKeys:["shotClose","shotMedium","shotLong","shotLowAngle","shotHighAngle","shotShallowDof","shotFront","shotProfile","shotCloseUp","shotDrone"]},{groupKey:"light",chipKeys:["lightSunlight","lightSoft","lightNeon","lightWarm","lightNature","lightCandle","lightCityNight"]},{groupKey:"frame",chipKeys:["frameRichDetails","frameSimpleBg"]},{groupKey:"atmosphere",chipKeys:["atmosphereMysterious","atmospherePeaceful","atmosphereHeartwarming","atmosphereVivid","atmosphereColorful"]}],B=", ";function ao(e,t){const s=(e||"").trim();return s?s.includes(t)?s:`${s}${B}${t}`:t}function z(e,t){if(!e||!t)return e||"";const s=[`${t}${B}`,`${B}${t}`,t];let a=e;for(const u of s)if(a.includes(u)){a=a.replace(u,"");break}return a.replace(/(?:,\s*)+$/,"").replace(/^(?:,\s*)+/,"")}const ro=b({name:"InspirationPills",components:{FontAwesomeIcon:E},computed:{prompt(){return this.$store.state.kling?.config?.prompt||""},allChipTexts(){return _e.flatMap(e=>e.chipKeys.map(t=>this.$t(`kling.inspiration.chip.${t}`)))},selected(){const e=this.prompt;if(!e)return[];const t=[];for(const s of this.allChipTexts){const a=e.indexOf(s);a!==-1&&t.push({text:s,idx:a})}return t.sort((s,a)=>s.idx-a.idx).map(s=>s.text)}},methods:{onRemove(e){const t=z(this.prompt,e);this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:t})}}}),co={key:0,class:"pills",role:"list"},mo={class:"pill-text"},po=["aria-label","onClick"];function uo(e,t,s,a,u,$){const c=o("font-awesome-icon");return e.selected.length>0?(l(),m("div",co,[(l(!0),m(T,null,I(e.selected,p=>(l(),m("div",{key:p,class:"pill",role:"listitem"},[i("span",mo,r(p),1),i("button",{type:"button",class:"pill-remove","aria-label":e.$t("kling.inspiration.removeChip"),onClick:we(f=>e.onRemove(p),["stop"])},[n(c,{icon:"fa-solid fa-xmark"})],8,po)]))),128))])):k("",!0)}const go=y(ro,[["render",uo],["__scopeId","data-v-5fc4fa65"]]),fo="",ho=b({name:"PromptInput",components:{ElInput:Q,ElButton:L,FontAwesomeIcon:E,InfoIcon:S,InspirationPills:go},emits:["open-inspiration"],computed:{prompt:{get(){return this.$store.state.kling?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=fo)}}),_o={class:"field"},$o={class:"box"},vo={class:"title font-bold"},ko={class:"actions"};function bo(e,t,s,a,u,$){const c=o("font-awesome-icon"),p=o("el-button"),f=o("info-icon"),d=o("inspiration-pills"),v=o("el-input");return l(),m("div",_o,[i("div",$o,[i("h2",vo,r(e.$t("kling.name.prompt")),1),i("div",ko,[n(p,{text:"",size:"small",class:"inspiration-btn",onClick:t[0]||(t[0]=g=>e.$emit("open-inspiration"))},{default:h(()=>[n(c,{icon:"fa-regular fa-lightbulb",class:"mr-1"}),w(" "+r(e.$t("kling.inspiration.openButton")),1)]),_:1}),n(f,{content:e.$t("kling.description.prompt"),class:"info"},null,8,["content"])])]),n(d),n(v,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||(t[1]=g=>e.prompt=g),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const yo=y(ho,[["render",bo],["__scopeId","data-v-0a5c57b8"]]),wo="",Co=b({name:"NegativePromptInput",components:{ElInput:Q,InfoIcon:S},computed:{prompt:{get(){return this.$store.state.kling?.config?.negative_prompt},set(e){console.debug("set prompt",e),this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,negative_prompt:e})}}},mounted(){this.prompt||(this.prompt=wo)}}),Vo={class:"field"},So={class:"box"},To={class:"title font-bold"};function Io(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-input");return l(),m("div",Vo,[i("div",So,[i("h2",To,r(e.$t("kling.name.negativePrompt")),1),n(c,{content:e.$t("kling.description.negativePrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=f=>e.prompt=f),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.negativePrompt")},null,8,["modelValue","placeholder"])])}const Eo=y(Co,[["render",Io],["__scopeId","data-v-de98cf01"]]),Lo=b({name:"InspirationDrawer",components:{ElDrawer:me,ElButton:L,FontAwesomeIcon:E},props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],data(){return{groups:_e,Close:Ce}},computed:{visible:{get(){return this.modelValue},set(e){this.$emit("update:modelValue",e)}},drawerSize(){return window.innerWidth<768?"100%":"380px"},prompt(){return this.$store.state.kling?.config?.prompt||""},allChipTexts(){return this.groups.flatMap(e=>e.chipKeys.map(t=>this.$t(`kling.inspiration.chip.${t}`)))},selectedCount(){return this.allChipTexts.filter(e=>this.isSelected(e)).length}},methods:{chipText(e){return this.$t(`kling.inspiration.chip.${e}`)},isSelected(e){return e?this.prompt.includes(e):!1},setPrompt(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:e})},onToggle(e){e&&(this.isSelected(e)?this.setPrompt(z(this.prompt,e)):this.setPrompt(ao(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(const t of this.allChipTexts)for(;e.includes(t);)e=z(e,t);this.setPrompt(e)}}}),Mo={class:"drawer-content"},Uo={class:"drawer-header"},Ro={class:"title-row"},Ao={class:"title"},Po={class:"hint"},Do={key:0,class:"selected-bar"},Go={class:"selected-text"},Ko={class:"groups"},Oo={class:"group-title"},jo={class:"chip-grid"},No=["onClick"];function Bo(e,t,s,a,u,$){const c=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),V(f,{modelValue:e.visible,"onUpdate:modelValue":t[1]||(t[1]=d=>e.visible=d),direction:"rtl","with-header":!1,size:e.drawerSize,"custom-class":"kling-inspiration-drawer","destroy-on-close":!1},{default:h(()=>[i("div",Mo,[i("div",Uo,[i("div",Ro,[n(c,{icon:"fa-regular fa-lightbulb",class:"mr-2"}),i("span",Ao,r(e.$t("kling.inspiration.title")),1)]),n(p,{text:"",icon:e.Close,class:"close-btn",onClick:t[0]||(t[0]=d=>e.visible=!1)},null,8,["icon"])]),i("div",Po,r(e.$t("kling.inspiration.hint")),1),e.selectedCount>0?(l(),m("div",Do,[i("span",Go,r(e.$t("kling.inspiration.selectedSummary",{count:e.selectedCount})),1),n(p,{text:"",size:"small",class:"clear-btn",onClick:e.onClearSelected},{default:h(()=>[w(r(e.$t("kling.inspiration.clearSelected")),1)]),_:1},8,["onClick"])])):k("",!0),i("div",Ko,[(l(!0),m(T,null,I(e.groups,d=>(l(),m("div",{key:d.groupKey,class:"group"},[i("div",Oo,r(e.$t(`kling.inspiration.group.${d.groupKey}`)),1),i("div",jo,[(l(!0),m(T,null,I(d.chipKeys,v=>(l(),m("button",{key:v,type:"button",class:R({chip:!0,active:e.isSelected(e.chipText(v))}),onClick:g=>e.onToggle(e.chipText(v))},r(e.chipText(v)),11,No))),128))])]))),128))])])]),_:1},8,["modelValue","size"])}const zo=y(Lo,[["render",Bo],["__scopeId","data-v-7d457a69"]]),Fo={"kling-v3":"v3","kling-v3-omni":"v3-Omni","kling-v2-6":"v2.6","kling-v2-5-turbo":"v2.5-Turbo","kling-v2-1-master":"v2.1-Master","kling-v2-master":"v2-Master","kling-v1-6":"v1.6","kling-v1":"v1","kling-video-o1":"Video-o1"},qo={std:"720p",pro:"1080p","4k":"4K"},Ho=b({name:"SummaryChip",components:{FontAwesomeIcon:E},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){const e=this.config?.model||"kling-v2-5-turbo";return Fo[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||""},modeLabel(){const e=this.config?.mode||"std";return qo[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),Wo={class:"summary-chip"},Jo=["title"],Qo=["title"],Yo=["title"],Xo=["title"],Zo=["title"];function xo(e,t,s,a,u,$){const c=o("font-awesome-icon");return l(),m("div",Wo,[i("span",{class:"part",title:e.$t("kling.name.model")},r(e.modelLabel),9,Jo),t[0]||(t[0]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.duration")},r(e.durationLabel),9,Qo),t[1]||(t[1]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.ratio")},r(e.aspectRatio||"16:9"),9,Yo),t[2]||(t[2]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.mode")},r(e.modeLabel),9,Xo),e.generateAudio?(l(),m("span",{key:0,class:"audio",title:e.$t("kling.name.generateAudio")},[n(c,{icon:"fa-solid fa-headphones"})],8,Zo)):k("",!0)])}const en=y(Ho,[["render",xo],["__scopeId","data-v-418a6733"]]),tn=b({name:"ConfigPanel",components:{ElButton:L,Consumption:pe,FontAwesomeIcon:E,PromptInput:yo,NegativePromptInput:Eo,ModelSelector:et,ModeSelector:at,DurationSelector:gt,RatioSelector:bt,StartImage:It,CfgScaleSelector:zt,GenerateAudioSelector:Yt,CameraControlSelector:lo,InspirationDrawer:zo,SummaryChip:en,EndImage:Pt},emits:["generate"],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},consumption(){return fe(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit("generate")}}}),on={class:"flex flex-col h-full"},nn={class:"flex-1 overflow-y-auto p-5"},sn={class:"flex flex-col items-center justify-center px-5 pb-5"};function ln(e,t,s,a,u,$){const c=o("prompt-input"),p=o("model-selector"),f=o("ratio-selector"),d=o("start-image"),v=o("end-image"),g=o("duration-selector"),_=o("mode-selector"),M=o("generate-audio-selector"),U=o("camera-control-selector"),O=o("cfg-scale-selector"),$e=o("negative-prompt-input"),ve=o("summary-chip"),ke=o("consumption"),Z=o("font-awesome-icon"),x=o("el-button"),be=o("inspiration-drawer");return l(),m("div",on,[i("div",nn,[n(c,{class:"mb-4",onOpenInspiration:t[0]||(t[0]=ee=>e.inspirationOpen=!0)}),n(p,{class:"mb-4"}),n(f,{class:"mb-4"}),n(d,{class:"mb-2"}),n(v,{class:"mb-2"}),n(g,{class:"mb-4"}),n(_,{class:"mb-4"}),n(M,{class:"mb-4"}),n(U,{class:"mb-4"}),n(O,{class:"mb-4"}),n($e,{class:"mb-4"})]),i("div",sn,[n(ve),n(ke,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(l(),V(x,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(Z,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.extend")),1)]),_:1},8,["onClick"])):(l(),V(x,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(Z,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.generate")),1)]),_:1},8,["onClick"]))]),n(be,{modelValue:e.inspirationOpen,"onUpdate:modelValue":t[1]||(t[1]=ee=>e.inspirationOpen=ee)},null,8,["modelValue"])])}const an=y(tn,[["render",ln]]),rn=b({name:"MotionImage",components:{ElUpload:K,ElButton:L,InfoIcon:S,FontAwesomeIcon:E,ImagePreview:G},mixins:[W],data(){return{fileList:[],uploadUrl:A()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetImageUrl()},methods:{onExceed(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.error(this.$t("kling.message.uploadReferencesError"))},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,image_url:void 0})},onSetImageUrl(){const e=this.urls?.[0];this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,image_url:e})},async onSuccess(){this.onSetImageUrl()}}}),cn={class:"relative"},dn={class:"flex justify-between"},mn={class:"flex justify-start items-center"},pn={class:"text-sm font-bold"};function un(e,t,s,a,u,$){const c=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),d=o("el-button"),v=o("el-upload");return l(),m("div",cn,[i("div",dn,[i("div",mn,[i("span",pn,r(e.$t("kling.name.motionImage")),1),n(c,{content:e.$t("kling.description.motionImage")},null,8,["content"])])]),n(v,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=g=>e.fileList=g),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:g})=>[g.url&&g.percentage!==void 0?(l(),V(p,{key:0,url:g.url,name:g.name,percentage:g.percentage,onRemove:_=>e.onRemove(g)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(d,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadReferences")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const gn=y(rn,[["render",un],["__scopeId","data-v-37d42da7"]]),fn=b({name:"MotionVideo",components:{ElUpload:K,ElButton:L,InfoIcon:S,FilePreview:Me,FontAwesomeIcon:E},data(){return{fileList:[],uploadUrl:A()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetVideoUrl()},methods:{onExceed(){C.warning(this.$t("kling.message.uploadVideoExceed"))},onError(){C.error(this.$t("kling.message.uploadVideoError"))},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,video_url:void 0})},beforeUpload(e){const t=e.type==="video/mp4"||e.type==="video/quicktime",s=e.size/1024/1024<100;return t?s?!0:(C.error(this.$t("kling.message.uploadVideoSizeExceed")),!1):(C.error(this.$t("kling.message.uploadVideoTypeFailed")),!1)},onSetVideoUrl(){const e=this.urls?.[0];this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,video_url:e})},async onSuccess(){this.onSetVideoUrl()}}}),hn={class:"relative"},_n={class:"flex justify-between"},$n={class:"flex justify-start items-center"},vn={class:"text-sm font-bold"};function kn(e,t,s,a,u,$){const c=o("info-icon"),p=o("file-preview"),f=o("font-awesome-icon"),d=o("el-button"),v=o("el-upload");return l(),m("div",hn,[i("div",_n,[i("div",$n,[i("span",vn,r(e.$t("kling.name.motionVideo")),1),n(c,{content:e.$t("kling.description.motionVideo")},null,8,["content"])])]),n(v,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=g=>e.fileList=g),accept:".mp4,.mov",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"before-upload":e.beforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:g})=>[g.percentage!==void 0?(l(),V(p,{key:0,url:g.url||g.response?.file_url,name:g.name,percentage:g.percentage,onRemove:_=>e.onRemove(g)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(d,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadVideoUrl")),1)]),_:1})]),_:1},8,["file-list","action","before-upload","on-exceed","on-error","on-success","headers"])])}const bn=y(fn,[["render",kn],["__scopeId","data-v-5cf93212"]]),yn=b({name:"MotionPromptInput",components:{ElInput:Q,InfoIcon:S},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||""},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),wn={class:"field"},Cn={class:"box"},Vn={class:"title font-bold"};function Sn(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-input");return l(),m("div",wn,[i("div",Cn,[i("h2",Vn,r(e.$t("kling.name.motionPrompt")),1),n(c,{content:e.$t("kling.description.motionPrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=f=>e.prompt=f),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.motionPrompt")},null,8,["modelValue","placeholder"])])}const Tn=y(yn,[["render",Sn],["__scopeId","data-v-ca9fdbe5"]]),re="video",In=b({name:"CharacterOrientationSelector",components:{ElRadioGroup:Re,ElRadioButton:Ue,InfoIcon:S},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||re},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,character_orientation:e})}}},mounted(){this.$store.state.kling?.motionConfig?.character_orientation||(this.value=re)}}),En={class:"field"},Ln={class:"header"},Mn={class:"text-sm font-bold"};function Un(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-radio-button"),f=o("el-radio-group");return l(),m("div",En,[i("div",Ln,[i("span",Mn,r(e.$t("kling.name.characterOrientation")),1),n(c,{content:e.$t("kling.description.characterOrientation")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),size:"small",class:"value"},{default:h(()=>[n(p,{label:"image"},{default:h(()=>[w(r(e.$t("kling.name.orientationImage")),1)]),_:1}),n(p,{label:"video"},{default:h(()=>[w(r(e.$t("kling.name.orientationVideo")),1)]),_:1})]),_:1},8,["modelValue"])])}const Rn=y(In,[["render",Un],["__scopeId","data-v-7a91195b"]]),ce="std",An=b({name:"MotionModeSelector",components:{ElSelect:D,ElOption:P,InfoIcon:S},computed:{options(){return[{value:"std",label:this.$t("kling.name.modeStd")},{value:"pro",label:this.$t("kling.name.modePro")}]},value:{get(){return this.$store.state.kling?.motionConfig?.mode||ce},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=ce)}}),Pn={class:"field"},Dn={class:"header"},Gn={class:"title font-bold"};function Kn(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),m("div",Pn,[i("div",Dn,[i("h2",Gn,r(e.$t("kling.name.mode")),1),n(c,{content:e.$t("kling.description.motionMode")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),class:"value",placeholder:e.$t("kling.placeholder.select")},{default:h(()=>[(l(!0),m(T,null,I(e.options,d=>(l(),V(p,{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const On=y(An,[["render",Kn],["__scopeId","data-v-1295688c"]]),jn=b({name:"KeepOriginalSoundSelector",components:{ElSwitch:ge,InfoIcon:S},computed:{value:{get(){return(this.$store.state.kling?.motionConfig?.keep_original_sound??"yes")==="yes"},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,keep_original_sound:e?"yes":"no"})}}}}),Nn={class:"relative"},Bn={class:"flex justify-between items-center"},zn={class:"flex justify-start items-center"},Fn={class:"text-sm font-bold"};function qn(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-switch");return l(),m("div",Nn,[i("div",Bn,[i("div",zn,[i("span",Fn,r(e.$t("kling.name.keepOriginalSound")),1),n(c,{content:e.$t("kling.description.keepOriginalSound")},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=f=>e.value=f)},null,8,["modelValue"])])])}const Hn=y(jn,[["render",qn]]),Wn=b({name:"MotionPanel",components:{ElButton:L,FontAwesomeIcon:E,Consumption:pe,MotionImage:gn,MotionVideo:bn,MotionPromptInput:Tn,CharacterOrientationSelector:Rn,MotionModeSelector:On,KeepOriginalSoundSelector:Hn},emits:["generate"],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return fe(this.motionConfig,this.service?.cost)},service(){return this.$store.state.kling?.service},canGenerate(){const e=this.motionConfig;return!!(e?.image_url&&e?.video_url)}},methods:{onGenerate(){this.$emit("generate")}}}),Jn={class:"flex flex-col h-full"},Qn={class:"flex-1 overflow-y-auto p-5"},Yn={class:"flex flex-col items-center justify-center px-5 pb-5"};function Xn(e,t,s,a,u,$){const c=o("motion-image"),p=o("motion-video"),f=o("motion-prompt-input"),d=o("character-orientation-selector"),v=o("motion-mode-selector"),g=o("keep-original-sound-selector"),_=o("consumption"),M=o("font-awesome-icon"),U=o("el-button");return l(),m("div",Jn,[i("div",Qn,[n(c,{class:"mb-3"}),n(p,{class:"mb-3"}),n(f,{class:"mb-4"}),n(d,{class:"mb-4"}),n(v,{class:"mb-4"}),n(g,{class:"mb-4"})]),i("div",Yn,[n(_,{value:e.consumption,service:e.service},null,8,["value","service"]),n(U,{type:"primary",class:"btn w-full",round:"",disabled:!e.canGenerate,onClick:e.onGenerate},{default:h(()=>[n(M,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.generateMotion")),1)]),_:1},8,["disabled","onClick"])])])}const Zn=y(Wn,[["render",Xn]]),xn=b({name:"KlingTabSwitcher",components:{ElTabs:Pe,ElTabPane:Ae,ElTag:Ve},props:{modelValue:{type:String,default:"videos"}},emits:["update:modelValue"],computed:{tabs(){return[{value:"videos",label:this.$t("kling.tab.videoGeneration")},{value:"motion",label:this.$t("kling.tab.motionControl")}]}},methods:{onUpdate(e){this.$emit("update:modelValue",e)}}}),es=["title"],ts={class:"text"};function os(e,t,s,a,u,$){const c=o("el-tag"),p=o("el-tab-pane"),f=o("el-tabs");return l(),V(f,{"model-value":e.modelValue,class:"kling-tabs",stretch:"","onUpdate:modelValue":e.onUpdate},{default:h(()=>[(l(!0),m(T,null,I(e.tabs,d=>(l(),V(p,{key:d.value,name:d.value,disabled:d.disabled},{label:h(()=>[i("span",{class:"tab-label",title:d.disabled?d.disabledReason:void 0},[i("span",ts,r(d.label),1),d.badge?(l(),V(c,{key:0,size:"small",type:"warning",class:"badge"},{default:h(()=>[w(r(d.badge),1)]),_:2},1024)):k("",!0)],8,es)]),_:2},1032,["name","disabled"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])}const ns=y(xn,[["render",os],["__scopeId","data-v-bf00c27e"]]),ss=b({name:"TaskPreview",components:{ElImage:Oe,CopyToClipboard:De,FontAwesomeIcon:E,ElAlert:Ke,VideoPlayer:Ge,ElTooltip:J,ElButton:L,ImagePreview:G},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},referenceImages(){const e=[],t=this.modelValue?.request?.start_image_url,s=this.modelValue?.request?.end_image_url;return t&&e.push({url:t,name:"start-image"}),s&&e.push({url:s,name:"end-image"}),e}},methods:{onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onOpenVideo(e){window.open(e,"_blank")}}}),is={class:"preview"},ls={class:"left"},as={class:"main"},rs={class:"bot"},cs={class:"datetime"},ds={class:"info"},ms={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},ps={key:1,class:"prompt mt-2"},us={key:0},gs={key:1},fs={key:0,class:R({content:!0,failed:!0})},hs={key:0,class:"mb-4"},_s={key:1,class:R({operations:!0,"mt-2":!0})},$s={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},vs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ks={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},bs={key:1,class:R({content:!0})},ys={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ws={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Cs={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Vs={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Ss={key:2,class:R({content:!0})},Ts={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Is={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Es(e,t,s,a,u,$){const c=o("el-image"),p=o("image-preview"),f=o("video-player"),d=o("el-button"),v=o("el-tooltip"),g=o("font-awesome-icon"),_=o("copy-to-clipboard"),M=o("el-alert");return l(),m("div",is,[i("div",ls,[n(c,{src:"https://cdn.acedata.cloud/qpbbbb.jpg",class:"avatar"})]),i("div",as,[i("div",rs,[w(r(e.$t("kling.name.klingBot"))+" ",1),i("span",cs,r(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),i("div",ds,[e.referenceImages.length>0?(l(),m("div",ms,[(l(!0),m(T,null,I(e.referenceImages,(U,O)=>(l(),V(p,{key:O,url:U.url,name:U.name,closable:!1},null,8,["url","name"]))),128))])):k("",!0),e.modelValue?.request?.prompt?(l(),m("p",ps,[w(r(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?k("",!0):(l(),m("span",us," - ("+r(e.$t("kling.status.pending"))+") ",1)),e.modelValue?.response?.state==="submitted"||e.modelValue?.response?.state==="processing"||e.modelValue?.response?.state==="pending"||e.modelValue?.response?.state==="completed"?(l(),m("span",gs," - ("+r(e.$t("kling.status.processing"))+") ",1)):k("",!0)])):k("",!0)]),e.modelValue?.response?.success===!0?(l(),m("div",fs,[e.modelValue?.response.video_url?(l(),m("div",hs,[n(f,{src:e.modelValue?.response.video_url},null,8,["src"])])):k("",!0),e.modelValue?.response.success?(l(),m("div",_s,[n(v,{class:"box-item",effect:"dark",content:e.$t("kling.message.downloadVideo"),placement:"top-start"},{default:h(()=>[e.modelValue?.response.video_url?(l(),V(d,{key:0,type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=U=>e.onDownload(U,e.modelValue?.response.video_url))},{default:h(()=>[w(r(e.$t("kling.button.download")),1)]),_:1})):k("",!0)]),_:1},8,["content"])])):k("",!0),n(M,{closable:!1,class:"mt-2 success"},{default:h(()=>[i("p",$s,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.model"))+": "+r(e.modelValue?.request?.model),1)]),i("p",vs,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(l(),m("p",ks,[n(g,{icon:"fa-solid fa-clock",class:"mr-1"}),w(" "+r(e.$t("kling.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):k("",!0)]),_:1})])):k("",!0),e.modelValue?.response?.success===!1?(l(),m("div",bs,[n(M,{closable:!1,class:"failure"},{template:h(()=>[n(g,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),w(" "+r(e.$t("kling.name.failure")),1)]),default:h(()=>[i("p",ys,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),i("p",ws,[n(g,{icon:"fa-solid fa-circle-info",class:"mr-1"}),w(" "+r(e.$t("kling.name.failureReason"))+": "+r(e.modelValue?.response?.error?.message)+" ",1),n(_,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(l(),m("p",Cs,[n(g,{icon:"fa-solid fa-clock",class:"mr-1"}),w(" "+r(e.$t("kling.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):k("",!0),e.modelValue?.response?.trace_id?(l(),m("p",Vs,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(_,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):k("",!0)]),_:1})])):k("",!0),e.modelValue?.response?.success===void 0?(l(),m("div",Ss,[n(M,{closable:!1,class:"info"},{template:h(()=>[n(g,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),w(" "+r(e.$t("kling.name.failure")),1)]),default:h(()=>[i("p",Ts,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.response?.trace_id?(l(),m("p",Is,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(_,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):k("",!0)]),_:1})])):k("",!0)])])}const Ls=y(ss,[["render",Es],["__scopeId","data-v-e8e87659"]]),Ms=b({name:"RecentPanel",components:{TaskPreview:Ls,NoTasks:Ne,BotPlaceholder:je,ScrollList:Le},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.kling?.tasks,items:this.$store.state.kling?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Us={key:0},Rs={key:2,class:"w-full h-full flex items-center justify-center"};function As(e,t,s,a,u,$){const c=o("bot-placeholder"),p=o("task-preview"),f=o("scroll-list"),d=o("no-tasks");return l(),m(T,null,[e.tasks?.items===void 0?(l(),m("div",Us,[n(c)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(l(),V(f,{key:1,ref:"scrollList",class:"h-full w-full overflow-y-auto tasks",loading:e.loading,onReachTop:t[0]||(t[0]=v=>e.$emit("reach-top"))},{default:h(()=>[(l(!0),m(T,null,I(e.tasks?.items,v=>(l(),V(p,{key:v.id,"model-value":v},null,8,["model-value"]))),128))]),_:1},8,["loading"])):k("",!0),e.tasks?.items?.length===0?(l(),m("div",Rs,[n(d)])):k("",!0)],64)}const Ps=y(Ms,[["render",As]]),de="https://webhook.acedata.cloud/kling",Ds=b({name:"KlingIndex",components:{ConfigPanel:an,MotionPanel:Zn,TabSwitcher:ns,Layout:Je,RecentPanel:Ps},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===oe.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===oe.Request||this.fetchingTasks},credential(){return this.$store.state.kling.credential},config(){return this.$store.state.kling.config},motionConfig(){return this.$store.state.kling.motionConfig},taskType(){return this.$store.state.kling.taskType||"videos"},tasks(){return this.$store.state.kling.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 Be({tasks: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("kling/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("kling/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:s,createdAtMax:a}=e||{};console.debug("limit",t,"createdAtMin",s,"createdAtMax",a),this.fetchingTasks=!0;try{await this.$store.dispatch("kling/getTasks",{limit:t,createdAtMin:s,createdAtMax:a})}finally{this.fetchingTasks=!1}},async onGenerate(){const{camera_control:e,...t}=this.config||{},s={...t,callback_url:de};if(!s.video_id&&!t.video_url&&!s.start_image_url&&s.end_image_url){C.warning(this.$t("kling.message.endImageRequiresStart"));return}s.action||(s.video_id||t.video_url?s.action="extend":s.start_image_url?s.action="image2video":s.action="text2video"),s.action==="text2video"&&s.end_image_url&&delete s.end_image_url,e?.type&&(s.camera_control={type:e.type,...e.type==="simple"&&e.config?{config:Object.fromEntries(Object.entries(e.config).filter(([,u])=>u!=null))}:{}});const a=this.credential?.token;if(!a){console.error("no token specified");return}C.info(this.$t("kling.message.startingTask")),te("kling",ie.generate(s,{token:a})).then(()=>{C.success(this.$t("kling.message.startTaskSuccess"))}).catch(u=>{u?.response?.data?.error?.code===se?C.error(this.$t("kling.message.usedUp")):C.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},async onTabChange(e){e!==this.taskType&&(await this.$store.dispatch("kling/setTaskType",e),await this.onGetTasks(),await this.onScrollDown())},async onGenerateMotion(){const e=this.motionConfig||{};if(!e.image_url||!e.video_url){C.warning(this.$t("kling.message.motionMissingInputs"));return}const t={image_url:e.image_url,video_url:e.video_url,character_orientation:e.character_orientation||"video",mode:e.mode||"std",keep_original_sound:e.keep_original_sound??"yes",...e.prompt?{prompt:e.prompt}:{},callback_url:de},s=this.credential?.token;if(!s){console.error("no token specified");return}C.info(this.$t("kling.message.startingTask")),te("kling",ie.motion(t,{token:s})).then(()=>{C.success(this.$t("kling.message.startTaskSuccess"))}).catch(a=>{a?.response?.data?.error?.code===se?C.error(this.$t("kling.message.usedUp")):C.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),Gs={class:"flex flex-col h-full"},Ks={class:"flex-1 min-h-0"};function Os(e,t,s,a,u,$){const c=o("tab-switcher"),p=o("config-panel"),f=o("motion-panel"),d=o("recent-panel"),v=o("layout");return l(),V(v,null,{config:h(()=>[i("div",Gs,[n(c,{"model-value":e.taskType,"onUpdate:modelValue":e.onTabChange},null,8,["model-value","onUpdate:modelValue"]),i("div",Ks,[e.taskType==="videos"?(l(),V(p,{key:0,onGenerate:e.onGenerate},null,8,["onGenerate"])):e.taskType==="motion"?(l(),V(f,{key:1,onGenerate:e.onGenerateMotion},null,8,["onGenerate"])):k("",!0)])])]),result:h(()=>[n(d,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Bi=y(Ds,[["render",Os]]);export{Bi as default};
|
|
1
|
+
import{F as E}from"./index.es-DkM2OF-9.js";import{E as L}from"./index-DNJ0Deds.js";import{E as me}from"./index-BP_sbpCK.js";import{d as b,H as m,E as i,z as j,C as n,y as h,D as o,q as l,F as r,x as V,O as T,N as I,Q as R,J as k,R as ye,I as w,M as we}from"./vendor-vue-NSDaktjZ.js";import{E as y,b7 as A,a0 as Ce,F as Ve,cd as te,aw as oe}from"./index-Bti47OvL.js";import{b as Se,c as ne,d as F,e as N,f as Te,g as Ie,h as Ee}from"./kling-CtoPhhA9.js";import{E as P,a as D}from"./index-BZTdivI9.js";import{E as q}from"./index-C_hLTYV6.js";import{E as C}from"./index-BQ7zd-Q3.js";import{I as S,S as Le}from"./ScrollList-WqruYG0f.js";import{E as H}from"./index-p6eQKJae.js";import{p as W}from"./pasteUploadMixin-BurWbGNQ.js";import{I as G}from"./ImagePreview-DZPTnmBT.js";import{E as J}from"./index-gY0_GLnY.js";import{E as K}from"./index-CDj4oGhc.js";import{C as pe}from"./Consumption-BEd757XD.js";import{E as ue}from"./index-D2fVgLXM.js";import{E as ge}from"./index-DXevThxR.js";import{E as Q}from"./index-COsB5e28.js";import{a as fe}from"./price-CT1CtNhJ.js";import{F as Me}from"./FilePreview-BPuB0Ku4.js";import{E as Ue,a as Re}from"./index-ClhulR7R.js";import{E as Ae,a as Pe}from"./index-xKgpRyD9.js";import{b as se}from"./errorCode-Cqj9Td_Z.js";import{k as ie}from"./kling-CVouiR4n.js";import{C as De}from"./CopyToClipboard-BOQ-Zpxe.js";import{V as Ge}from"./VideoPlayer-QZYuahlJ.js";import{E as Ke}from"./index-DutrdntU.js";import{E as Oe}from"./index-0EOEDiT5.js";import{B as je}from"./BotPlaceholder-C_IGBMvq.js";import{N as Ne}from"./NoTasks-Cb8ntRPy.js";import{l as Be}from"./pagination-Cnc6Oeyx.js";import"./use-form-item-Clq-JJlb.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-Cvgzdobq.js";import"./vendor-vue-router-Kg6s1a65.js";import"./index-t4Oimm-h.js";import"./typescript-2au3Mu9J.js";import"./index-CbDuQQJI.js";import"./strings-beZM2Y-f.js";import"./isEqual-CXlvduGT.js";import"./_Uint8Array-a5wCK152.js";import"./castArray-DzT6pvlU.js";import"./debounce-B74p5Dx9.js";import"./_baseIteratee-DtAKlqKl.js";import"./index-DmqdsYe_.js";import"./validator-DqeyweMw.js";import"./index-B8cqf9M7.js";import"./_baseClone-JK1xFj5u.js";import"./_initCloneObject-UCIzaue4.js";import"./index-Cu41y2Fl.js";import"./index-CgUi3x9C.js";import"./isPlainObject-CxqZzpxw.js";import"./vue-plyr-BO2nlN4c.js";import"./index-iGAJ0EBY.js";const ze=b({name:"LayoutKling",components:{ElDrawer:me,ElButton:L,FontAwesomeIcon:E},data(){return{drawer:!1}}}),Fe={class:"main flex flex-row flex-1 min-h-0"},qe={class:"config w-[320px] flex-none h-full flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},He={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function We(e,t,s,a,u,$){const c=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),m("div",Fe,[i("div",qe,[j(e.$slots,"config",{},void 0,!0)]),i("div",He,[j(e.$slots,"result",{},void 0,!0)]),n(p,{circle:"",class:"menu",onClick:t[0]||(t[0]=d=>e.drawer=!0)},{default:h(()=>[n(c,{icon:"fa-solid fa-magic"})]),_:1}),n(f,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=d=>e.drawer=d),direction:"ltr","with-header":!1,size:"350px"},{default:h(()=>[j(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Je=y(ze,[["render",We],["__scopeId","data-v-8fa7523c"]]),Qe={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function he(e,t,s){const a=t||"std",u=s??5;switch(e){case"kling-v1":return{text2video:!0,image2video:!0,endImage:u===5,audio:!1,motionControl:u===5};case"kling-v1-6":case"kling-v2-5-turbo":return{text2video:!0,image2video:!0,endImage:a==="pro",audio:!1,motionControl:!1};case"kling-v2-6":return{text2video:!0,image2video:!0,endImage:a==="pro",audio:a==="pro",motionControl:!1};case"kling-v2-master":case"kling-v2-1-master":return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};case"kling-v3":return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:a!=="4k"};case"kling-v3-omni":return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1};case"kling-video-o1":return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1};default:return Qe}}function Y(e,t){if(!e)return[];const s=t.model??e.model,a=t.mode??e.mode,u=t.duration??e.duration;if(!s)return[];const $=he(s,a,u),c=[];return e.end_image_url&&!$.endImage&&c.push({field:"end_image_url",i18nLabel:"kling.name.endImage"}),e.generate_audio&&!$.audio&&c.push({field:"generate_audio",i18nLabel:"kling.name.generateAudio"}),e.camera_control?.type&&!$.motionControl&&c.push({field:"camera_control",i18nLabel:"kling.name.cameraControl"}),c}function X(e,t){const s={...e};for(const a of t)a.field==="end_image_url"&&(s.end_image_url=void 0),a.field==="generate_audio"&&(s.generate_audio=!1),a.field==="camera_control"&&(s.camera_control=void 0);return s}const Ye=b({name:"ModelSelector",components:{ElSelect:D,ElOption:P},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{revertKey:0,options:[{value:"kling-v3",label:"v3"},{value:"kling-v3-omni",label:"v3-Omni"},{value:"kling-v2-6",label:"v2.6"},{value:"kling-v2-5-turbo",label:"v2.5-Turbo"},{value:"kling-v2-1-master",label:"v2.1-Master"},{value:"kling-v2-master",label:"v2-Master"},{value:"kling-v1-6",label:"v1.6"},{value:"kling-v1",label:"v1"},{value:"kling-video-o1",label:"Video-o1"}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(Se)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Y(t,{model:e});if(s.length===0){this.applyModel(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=X({...t,model:e},s);this.$store.commit("kling/setConfig",u),C.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,model:e})}}}),Xe={class:"field"},Ze={class:"title font-bold"};function xe(e,t,s,a,u,$){const c=o("el-option"),p=o("el-select");return l(),m("div",Xe,[i("h2",Ze,r(e.$t("pika.name.model")),1),(l(),V(p,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("pika.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),m(T,null,I(e.options,f=>(l(),V(c,{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const et=y(Ye,[["render",xe],["__scopeId","data-v-04059875"]]),tt=b({name:"ModeSelector",components:{ElSelect:D,ElOption:P,InfoIcon:S},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},cameraControlSet(){return!!this.$store.state.kling?.config?.camera_control?.type},fourKReason(){return F.includes(this.selectedModel)?this.cameraControlSet?this.$t("kling.description.mode4kIncompatibleCamera"):"":this.$t("kling.description.mode4kRequiresV3")},options(){return[{value:"std",label:this.$t("kling.name.modeStd"),disabled:!1,disabledReason:""},{value:"pro",label:this.$t("kling.name.modePro"),disabled:!1,disabledReason:""},{value:"4k",label:this.$t("kling.name.mode4k"),disabled:!!this.fourKReason,disabledReason:this.fourKReason}]},value(){return this.$store.state.kling?.config?.mode}},watch:{fourKReason(e){e&&this.value==="4k"&&this.applyMode(ne)}},mounted(){this.value||this.applyMode(ne)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Y(t,{mode:e});if(s.length===0){this.applyMode(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=X({...t,mode:e},s);this.$store.commit("kling/setConfig",u),C.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyMode(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,mode:e})}}}),ot={class:"field"},nt={class:"header"},st={class:"title font-bold"},it={key:0,class:"opt-tip"};function lt(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),m("div",ot,[i("div",nt,[i("h2",st,r(e.$t("kling.name.mode")),1),n(c,{content:e.$t("kling.description.mode"),class:"info-icon"},null,8,["content"])]),(l(),V(f,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("kling.placeholder.select"),clearable:!0,onChange:e.onChange},{default:h(()=>[(l(!0),m(T,null,I(e.options,d=>(l(),V(p,{key:d.value,label:d.label,value:d.value,disabled:d.disabled},{default:h(()=>[i("span",{class:R({"opt-disabled":d.disabled})},r(d.label),3),d.disabled&&d.disabledReason?(l(),m("span",it,r(d.disabledReason),1)):k("",!0)]),_:2},1032,["label","value","disabled"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const at=y(tt,[["render",lt],["__scopeId","data-v-9a8fa3c5"]]),le=[3,5,8,10,12,15],ae=[5,10],rt=b({name:"DurationSelector",components:{ElSlider:H,InfoIcon:S},props:{modelValue:{type:Number,default:void 0}},emits:["update:modelValue"],data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},isV3Model(){return F.includes(this.selectedModel)},sliderMin(){return this.isV3Model?3:5},sliderMax(){return this.isV3Model?15:10},sliderStep(){return this.isV3Model?1:5},marks(){const e=this.isV3Model?le:ae,t={};for(const s of e)t[s]=`${s}s`;return t},value(){return this.$store.state.kling?.config?.duration??N},sliderValue(){const e=this.value;return e<this.sliderMin?this.sliderMin:e>this.sliderMax?this.sliderMax:e}},watch:{isV3Model(e){(this.isV3Model?le:ae).includes(this.value)||this.applyDuration(N)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(N)},methods:{async onChange(e){const t=Array.isArray(e)?e[0]:e,s=this.$store.state.kling?.config||{},a=Y(s,{duration:t});if(a.length===0){this.applyDuration(t);return}const u=a.map($=>this.$t($.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:u}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const $=X({...s,duration:t},a);this.$store.commit("kling/setConfig",$),C.success(this.$t("kling.message.featureRemovedNotice",{fields:u}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,duration:e})}}}),ct={class:"field"},dt={class:"header"},mt={class:"title font-bold"},pt={class:"value-display"};function ut(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-slider");return l(),m("div",ct,[i("div",dt,[i("h2",mt,r(e.$t("kling.name.duration")),1),n(c,{content:e.$t("kling.description.duration"),class:"info-icon ml-1"},null,8,["content"]),i("span",pt,r(e.value)+"s",1)]),(l(),V(p,{key:e.revertKey,"model-value":e.sliderValue,class:"slider",min:e.sliderMin,max:e.sliderMax,step:e.sliderStep,marks:e.marks,"show-tooltip":!1,onChange:e.onChange},null,8,["model-value","min","max","step","marks","onChange"]))])}const gt=y(rt,[["render",ut],["__scopeId","data-v-aa1a22a1"]]),ft=b({name:"RatioSelector",data(){return{options:[{value:"1:1",label:"1:1",width:20,height:20},{value:"16:9",label:"16:9",width:25,height:13},{value:"9:16",label:"9:16",width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){return this.$store.state?.kling?.config?.aspect_ratio},set(e){console.debug("set ratio",e),this.$store.commit("kling/setConfig",{...this.$store.state?.kling?.config,aspect_ratio:e})}}},mounted(){this.value||(this.value=Te)}}),ht={class:"text-sm font-bold mb-2 block"},_t={class:"items"},$t=["onClick"],vt={class:"name"};function kt(e,t,s,a,u,$){return l(),m("div",null,[i("span",ht,r(e.$t("kling.name.ratio")),1),i("div",_t,[(l(!0),m(T,null,I(e.options,(c,p)=>(l(),m("div",{key:p,class:R({active:e.active===p,item:!0}),onClick:f=>e.value=c.value},[i("div",{class:R(["preview",c.label])},[i("div",{class:"rect",style:ye({width:c.width+"px",height:c.height+"px"})},null,4)],2),i("p",vt,r(c.label),1)],10,$t))),128))])])}const bt=y(ft,[["render",kt],["__scopeId","data-v-cdb14b2f"]]),yt=b({name:"StartImage",components:{ElUpload:K,ElButton:L,ElTooltip:J,InfoIcon:S,FontAwesomeIcon:E,ImagePreview:G},mixins:[W],emits:["change"],data(){return{fileList:[],uploadUrl:A()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},value:{get(){return this.$store.state?.kling?.config?.start_image_url},set(){}}},mounted(){this.value||(this.value=void 0),this.onSetStartImageUrl()},methods:{onExceed(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.error(this.$t("kling.message.uploadReferencesError"))},onSetStartImageUrl(){const e=this.urls?.[0];this.$store.commit("kling/setConfig",{...this.$store.state?.kling?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),wt={class:"relative"},Ct={class:"flex justify-between"},Vt={class:"flex justify-start items-center"},St={class:"text-sm font-bold"};function Tt(e,t,s,a,u,$){const c=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),d=o("el-button"),v=o("el-tooltip"),g=o("el-upload");return l(),m("div",wt,[i("div",Ct,[i("div",Vt,[i("span",St,r(e.$t("kling.name.startImage")),1),n(c,{content:e.$t("kling.description.uploadStartImage")},null,8,["content"])])]),n(g,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,disabled:e.reachedLimit,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:_})=>[_.url&&_.percentage!==void 0?(l(),V(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(v,{content:e.$t("kling.message.uploadReferencesExceed"),disabled:!e.reachedLimit,placement:"top"},{default:h(()=>[i("span",null,[n(d,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.reachedLimit},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadReferences")),1)]),_:1},8,["disabled"])])]),_:1},8,["content","disabled"])]),_:1},8,["file-list","disabled","action","on-exceed","on-error","on-success","headers"])])}const It=y(yt,[["render",Tt],["__scopeId","data-v-40832274"]]),Et=b({name:"EndImage",components:{ElUpload:K,ElButton:L,ElTooltip:J,ImagePreview:G,InfoIcon:S,FontAwesomeIcon:E},mixins:[W],data(){return{fileList:[],uploadUrl:A()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},klingConfig(){return this.$store.state?.kling?.config||{}},endImageSupported(){return he(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},uploadDisabled(){return this.reachedLimit||!this.endImageSupported},uploadTooltip(){return this.endImageSupported?this.reachedLimit?this.$t("kling.message.uploadReferencesExceed"):"":this.$t("kling.message.endImageNotSupported")},storeValue(){return this.klingConfig.end_image_url},value:{get(){return this.storeValue},set(){}}},watch:{storeValue(e){!e&&this.fileList.length>0&&(this.fileList=[])}},mounted(){this.value||(this.value=void 0),this.onSetEndImageUrl()},methods:{onBeforeUpload(){return this.endImageSupported?!0:(C.warning(this.$t("kling.message.endImageNotSupported")),!1)},onExceed(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.error(this.$t("kling.message.uploadReferencesError"))},onSetEndImageUrl(){const e=this.urls?.[0];this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),Lt={class:"relative"},Mt={class:"flex justify-between"},Ut={class:"flex justify-start items-center"},Rt={class:"text-sm font-bold"};function At(e,t,s,a,u,$){const c=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),d=o("el-button"),v=o("el-tooltip"),g=o("el-upload");return l(),m("div",Lt,[i("div",Mt,[i("div",Ut,[i("span",Rt,r(e.$t("kling.name.endImage")),1),n(c,{content:e.$t("kling.description.uploadEndImage")},null,8,["content"])])]),n(g,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=_=>e.fileList=_),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,disabled:e.uploadDisabled,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","before-upload":e.onBeforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:_})=>[_.url&&_.percentage!==void 0?(l(),V(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(v,{content:e.uploadTooltip,disabled:!e.uploadDisabled,placement:"top"},{default:h(()=>[i("span",null,[n(d,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.uploadDisabled},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadReferences")),1)]),_:1},8,["disabled"])])]),_:1},8,["content","disabled"])]),_:1},8,["file-list","disabled","action","before-upload","on-exceed","on-error","on-success","headers"])])}const Pt=y(Et,[["render",At],["__scopeId","data-v-6959ad44"]]),Dt=b({name:"CfgScaleSelector",components:{ElSlider:H,InfoIcon:S,ElInputNumber:ue},computed:{value:{get(){return this.$store.state?.kling?.config?.cfg_scale},set(e){console.debug("set cfg_scale",e),this.$store.commit("kling/setConfig",{...this.$store.state?.kling?.config,cfg_scale:e})}}},mounted(){this.value||(this.value=Ie)}}),Gt={class:"flex justify-between"},Kt={class:"flex justify-start items-center"},Ot={class:"text-sm font-bold"},jt={class:"flex justify-end items-center"},Nt={class:"w-full"};function Bt(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-input-number"),f=o("el-slider");return l(),m("div",null,[i("div",Gt,[i("div",Kt,[i("span",Ot,r(e.$t("kling.name.cfgScale")),1),n(c,{content:e.$t("kling.description.cfgScale")},null,8,["content"])]),i("div",jt,[n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),"controls-position":"right"},null,8,["modelValue"])])]),i("div",Nt,[n(f,{modelValue:e.value,"onUpdate:modelValue":t[1]||(t[1]=d=>e.value=d),min:0,max:1,step:.1},null,8,["modelValue"])])])}const zt=y(Dt,[["render",Bt]]),Ft=b({name:"GenerateAudioSelector",components:{ElSwitch:ge,InfoIcon:S},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},selectedMode(){return this.$store.state.kling?.config?.mode||""},supported(){return!!(F.includes(this.selectedModel)||this.selectedModel==="kling-v2-6"&&this.selectedMode==="pro")},tooltipContent(){return this.supported?this.$t("kling.description.generateAudio"):this.$t("kling.description.generateAudioUnsupported")},value:{get(){return this.supported?this.$store.state.kling?.config?.generate_audio??Ee:!1},set(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,generate_audio:e})}}},watch:{supported(e){!e&&this.$store.state.kling?.config?.generate_audio&&this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,generate_audio:!1})}}}),qt={class:"relative"},Ht={class:"flex justify-between items-center"},Wt={class:"flex justify-start items-center"},Jt={class:"text-sm font-bold"};function Qt(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-switch");return l(),m("div",qt,[i("div",Ht,[i("div",Wt,[i("span",Jt,r(e.$t("kling.name.generateAudio")),1),n(c,{content:e.tooltipContent},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=f=>e.value=f),class:"value",disabled:!e.supported},null,8,["modelValue","disabled"])])])}const Yt=y(Ft,[["render",Qt]]),Xt=["horizontal","vertical","pan","tilt","roll","zoom"],Zt=b({name:"CameraControlSelector",components:{ElSelect:D,ElOption:P,ElSlider:H,ElInputNumber:ue,InfoIcon:S},data(){return{configKeys:Xt}},computed:{typeOptions(){return[{value:"",label:this.$t("kling.name.cameraTypeNone")},{value:"simple",label:this.$t("kling.name.cameraTypeSimple")},{value:"down_back",label:this.$t("kling.name.cameraTypeDownBack")},{value:"forward_up",label:this.$t("kling.name.cameraTypeForwardUp")},{value:"left_turn_forward",label:this.$t("kling.name.cameraTypeLeftTurnForward")},{value:"right_turn_forward",label:this.$t("kling.name.cameraTypeRightTurnForward")}]},selectedMode(){return this.$store.state.kling?.config?.mode||""},disabled(){return this.selectedMode==="4k"},tooltipContent(){return this.disabled?this.$t("kling.description.cameraControlDisabled4k"):this.$t("kling.description.cameraControl")},selectedType(){return this.$store.state.kling?.config?.camera_control?.type},selectedTypeRaw:{get(){return this.selectedType??""},set(e){const t=this.$store.state.kling?.config||{};if(!e){const a={...t};delete a.camera_control,this.$store.commit("kling/setConfig",a);return}const s=e;this.$store.commit("kling/setConfig",{...t,camera_control:{type:s,config:s==="simple"?t.camera_control?.config||{}:void 0}})}},configValues(){return this.$store.state.kling?.config?.camera_control?.config||{}}},watch:{disabled(e){e&&this.selectedType!==void 0&&(this.selectedTypeRaw="")}},methods:{writeConfig(e,t){const s=this.$store.state.kling?.config||{},a=s.camera_control||{type:"simple"},u={...a.config||{}};t==null?delete u[e]:u[e]=t,this.$store.commit("kling/setConfig",{...s,camera_control:{...a,type:"simple",config:u}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),xt={class:"field"},eo={class:"header"},to={class:"text-sm font-bold"},oo={key:0,class:"config-grid"},no={class:"cfg-row-head"},so={class:"cfg-name"};function io(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-option"),f=o("el-select"),d=o("el-input-number"),v=o("el-slider");return l(),m("div",xt,[i("div",eo,[i("span",to,r(e.$t("kling.name.cameraControl")),1),n(c,{content:e.tooltipContent},null,8,["content"])]),n(f,{modelValue:e.selectedTypeRaw,"onUpdate:modelValue":t[0]||(t[0]=g=>e.selectedTypeRaw=g),class:"value",placeholder:e.$t("kling.placeholder.cameraType"),clearable:!0,disabled:e.disabled},{default:h(()=>[(l(!0),m(T,null,I(e.typeOptions,g=>(l(),V(p,{key:g.value,label:g.label,value:g.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","disabled"]),e.selectedType==="simple"&&!e.disabled?(l(),m("div",oo,[(l(!0),m(T,null,I(e.configKeys,g=>(l(),m("div",{key:g,class:"cfg-row"},[i("div",no,[i("span",so,r(e.$t(`kling.name.cc_${g}`)),1),n(d,{modelValue:e.configValues[g],"onUpdate:modelValue":_=>e.configValues[g]=_,min:-1,max:1,step:.1,precision:1,"controls-position":"right",size:"small",class:"cfg-num",onChange:_=>e.onNumberChange(g,_)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),n(v,{"model-value":e.configValues[g]??0,min:-1,max:1,step:.1,onInput:_=>e.onSliderChange(g,_)},null,8,["model-value","onInput"])]))),128))])):k("",!0)])}const lo=y(Zt,[["render",io],["__scopeId","data-v-fb7b34d0"]]),_e=[{groupKey:"cameraMovements",chipKeys:["rotateAround","stationary","handheld","zoomOut","zoomIn","follow","panRight","tiltUp","tiltDown","orbit"]},{groupKey:"cameraSpeed",chipKeys:["speedSlow","speedMedium","speedFast"]},{groupKey:"shotType",chipKeys:["shotClose","shotMedium","shotLong","shotLowAngle","shotHighAngle","shotShallowDof","shotFront","shotProfile","shotCloseUp","shotDrone"]},{groupKey:"light",chipKeys:["lightSunlight","lightSoft","lightNeon","lightWarm","lightNature","lightCandle","lightCityNight"]},{groupKey:"frame",chipKeys:["frameRichDetails","frameSimpleBg"]},{groupKey:"atmosphere",chipKeys:["atmosphereMysterious","atmospherePeaceful","atmosphereHeartwarming","atmosphereVivid","atmosphereColorful"]}],B=", ";function ao(e,t){const s=(e||"").trim();return s?s.includes(t)?s:`${s}${B}${t}`:t}function z(e,t){if(!e||!t)return e||"";const s=[`${t}${B}`,`${B}${t}`,t];let a=e;for(const u of s)if(a.includes(u)){a=a.replace(u,"");break}return a.replace(/(?:,\s*)+$/,"").replace(/^(?:,\s*)+/,"")}const ro=b({name:"InspirationPills",components:{FontAwesomeIcon:E},computed:{prompt(){return this.$store.state.kling?.config?.prompt||""},allChipTexts(){return _e.flatMap(e=>e.chipKeys.map(t=>this.$t(`kling.inspiration.chip.${t}`)))},selected(){const e=this.prompt;if(!e)return[];const t=[];for(const s of this.allChipTexts){const a=e.indexOf(s);a!==-1&&t.push({text:s,idx:a})}return t.sort((s,a)=>s.idx-a.idx).map(s=>s.text)}},methods:{onRemove(e){const t=z(this.prompt,e);this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:t})}}}),co={key:0,class:"pills",role:"list"},mo={class:"pill-text"},po=["aria-label","onClick"];function uo(e,t,s,a,u,$){const c=o("font-awesome-icon");return e.selected.length>0?(l(),m("div",co,[(l(!0),m(T,null,I(e.selected,p=>(l(),m("div",{key:p,class:"pill",role:"listitem"},[i("span",mo,r(p),1),i("button",{type:"button",class:"pill-remove","aria-label":e.$t("kling.inspiration.removeChip"),onClick:we(f=>e.onRemove(p),["stop"])},[n(c,{icon:"fa-solid fa-xmark"})],8,po)]))),128))])):k("",!0)}const go=y(ro,[["render",uo],["__scopeId","data-v-5fc4fa65"]]),fo="",ho=b({name:"PromptInput",components:{ElInput:Q,ElButton:L,FontAwesomeIcon:E,InfoIcon:S,InspirationPills:go},emits:["open-inspiration"],computed:{prompt:{get(){return this.$store.state.kling?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=fo)}}),_o={class:"field"},$o={class:"box"},vo={class:"title font-bold"},ko={class:"actions"};function bo(e,t,s,a,u,$){const c=o("font-awesome-icon"),p=o("el-button"),f=o("info-icon"),d=o("inspiration-pills"),v=o("el-input");return l(),m("div",_o,[i("div",$o,[i("h2",vo,r(e.$t("kling.name.prompt")),1),i("div",ko,[n(p,{text:"",size:"small",class:"inspiration-btn",onClick:t[0]||(t[0]=g=>e.$emit("open-inspiration"))},{default:h(()=>[n(c,{icon:"fa-regular fa-lightbulb",class:"mr-1"}),w(" "+r(e.$t("kling.inspiration.openButton")),1)]),_:1}),n(f,{content:e.$t("kling.description.prompt"),class:"info"},null,8,["content"])])]),n(d),n(v,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||(t[1]=g=>e.prompt=g),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const yo=y(ho,[["render",bo],["__scopeId","data-v-0a5c57b8"]]),wo="",Co=b({name:"NegativePromptInput",components:{ElInput:Q,InfoIcon:S},computed:{prompt:{get(){return this.$store.state.kling?.config?.negative_prompt},set(e){console.debug("set prompt",e),this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,negative_prompt:e})}}},mounted(){this.prompt||(this.prompt=wo)}}),Vo={class:"field"},So={class:"box"},To={class:"title font-bold"};function Io(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-input");return l(),m("div",Vo,[i("div",So,[i("h2",To,r(e.$t("kling.name.negativePrompt")),1),n(c,{content:e.$t("kling.description.negativePrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=f=>e.prompt=f),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.negativePrompt")},null,8,["modelValue","placeholder"])])}const Eo=y(Co,[["render",Io],["__scopeId","data-v-de98cf01"]]),Lo=b({name:"InspirationDrawer",components:{ElDrawer:me,ElButton:L,FontAwesomeIcon:E},props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],data(){return{groups:_e,Close:Ce}},computed:{visible:{get(){return this.modelValue},set(e){this.$emit("update:modelValue",e)}},drawerSize(){return window.innerWidth<768?"100%":"380px"},prompt(){return this.$store.state.kling?.config?.prompt||""},allChipTexts(){return this.groups.flatMap(e=>e.chipKeys.map(t=>this.$t(`kling.inspiration.chip.${t}`)))},selectedCount(){return this.allChipTexts.filter(e=>this.isSelected(e)).length}},methods:{chipText(e){return this.$t(`kling.inspiration.chip.${e}`)},isSelected(e){return e?this.prompt.includes(e):!1},setPrompt(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:e})},onToggle(e){e&&(this.isSelected(e)?this.setPrompt(z(this.prompt,e)):this.setPrompt(ao(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(const t of this.allChipTexts)for(;e.includes(t);)e=z(e,t);this.setPrompt(e)}}}),Mo={class:"drawer-content"},Uo={class:"drawer-header"},Ro={class:"title-row"},Ao={class:"title"},Po={class:"hint"},Do={key:0,class:"selected-bar"},Go={class:"selected-text"},Ko={class:"groups"},Oo={class:"group-title"},jo={class:"chip-grid"},No=["onClick"];function Bo(e,t,s,a,u,$){const c=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),V(f,{modelValue:e.visible,"onUpdate:modelValue":t[1]||(t[1]=d=>e.visible=d),direction:"rtl","with-header":!1,size:e.drawerSize,"custom-class":"kling-inspiration-drawer","destroy-on-close":!1},{default:h(()=>[i("div",Mo,[i("div",Uo,[i("div",Ro,[n(c,{icon:"fa-regular fa-lightbulb",class:"mr-2"}),i("span",Ao,r(e.$t("kling.inspiration.title")),1)]),n(p,{text:"",icon:e.Close,class:"close-btn",onClick:t[0]||(t[0]=d=>e.visible=!1)},null,8,["icon"])]),i("div",Po,r(e.$t("kling.inspiration.hint")),1),e.selectedCount>0?(l(),m("div",Do,[i("span",Go,r(e.$t("kling.inspiration.selectedSummary",{count:e.selectedCount})),1),n(p,{text:"",size:"small",class:"clear-btn",onClick:e.onClearSelected},{default:h(()=>[w(r(e.$t("kling.inspiration.clearSelected")),1)]),_:1},8,["onClick"])])):k("",!0),i("div",Ko,[(l(!0),m(T,null,I(e.groups,d=>(l(),m("div",{key:d.groupKey,class:"group"},[i("div",Oo,r(e.$t(`kling.inspiration.group.${d.groupKey}`)),1),i("div",jo,[(l(!0),m(T,null,I(d.chipKeys,v=>(l(),m("button",{key:v,type:"button",class:R({chip:!0,active:e.isSelected(e.chipText(v))}),onClick:g=>e.onToggle(e.chipText(v))},r(e.chipText(v)),11,No))),128))])]))),128))])])]),_:1},8,["modelValue","size"])}const zo=y(Lo,[["render",Bo],["__scopeId","data-v-7d457a69"]]),Fo={"kling-v3":"v3","kling-v3-omni":"v3-Omni","kling-v2-6":"v2.6","kling-v2-5-turbo":"v2.5-Turbo","kling-v2-1-master":"v2.1-Master","kling-v2-master":"v2-Master","kling-v1-6":"v1.6","kling-v1":"v1","kling-video-o1":"Video-o1"},qo={std:"720p",pro:"1080p","4k":"4K"},Ho=b({name:"SummaryChip",components:{FontAwesomeIcon:E},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){const e=this.config?.model||"kling-v2-5-turbo";return Fo[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||""},modeLabel(){const e=this.config?.mode||"std";return qo[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),Wo={class:"summary-chip"},Jo=["title"],Qo=["title"],Yo=["title"],Xo=["title"],Zo=["title"];function xo(e,t,s,a,u,$){const c=o("font-awesome-icon");return l(),m("div",Wo,[i("span",{class:"part",title:e.$t("kling.name.model")},r(e.modelLabel),9,Jo),t[0]||(t[0]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.duration")},r(e.durationLabel),9,Qo),t[1]||(t[1]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.ratio")},r(e.aspectRatio||"16:9"),9,Yo),t[2]||(t[2]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.mode")},r(e.modeLabel),9,Xo),e.generateAudio?(l(),m("span",{key:0,class:"audio",title:e.$t("kling.name.generateAudio")},[n(c,{icon:"fa-solid fa-headphones"})],8,Zo)):k("",!0)])}const en=y(Ho,[["render",xo],["__scopeId","data-v-418a6733"]]),tn=b({name:"ConfigPanel",components:{ElButton:L,Consumption:pe,FontAwesomeIcon:E,PromptInput:yo,NegativePromptInput:Eo,ModelSelector:et,ModeSelector:at,DurationSelector:gt,RatioSelector:bt,StartImage:It,CfgScaleSelector:zt,GenerateAudioSelector:Yt,CameraControlSelector:lo,InspirationDrawer:zo,SummaryChip:en,EndImage:Pt},emits:["generate"],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},consumption(){return fe(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit("generate")}}}),on={class:"flex flex-col h-full"},nn={class:"flex-1 overflow-y-auto p-5"},sn={class:"flex flex-col items-center justify-center px-5 pb-5"};function ln(e,t,s,a,u,$){const c=o("prompt-input"),p=o("model-selector"),f=o("ratio-selector"),d=o("start-image"),v=o("end-image"),g=o("duration-selector"),_=o("mode-selector"),M=o("generate-audio-selector"),U=o("camera-control-selector"),O=o("cfg-scale-selector"),$e=o("negative-prompt-input"),ve=o("summary-chip"),ke=o("consumption"),Z=o("font-awesome-icon"),x=o("el-button"),be=o("inspiration-drawer");return l(),m("div",on,[i("div",nn,[n(c,{class:"mb-4",onOpenInspiration:t[0]||(t[0]=ee=>e.inspirationOpen=!0)}),n(p,{class:"mb-4"}),n(f,{class:"mb-4"}),n(d,{class:"mb-2"}),n(v,{class:"mb-2"}),n(g,{class:"mb-4"}),n(_,{class:"mb-4"}),n(M,{class:"mb-4"}),n(U,{class:"mb-4"}),n(O,{class:"mb-4"}),n($e,{class:"mb-4"})]),i("div",sn,[n(ve),n(ke,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(l(),V(x,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(Z,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.extend")),1)]),_:1},8,["onClick"])):(l(),V(x,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(Z,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.generate")),1)]),_:1},8,["onClick"]))]),n(be,{modelValue:e.inspirationOpen,"onUpdate:modelValue":t[1]||(t[1]=ee=>e.inspirationOpen=ee)},null,8,["modelValue"])])}const an=y(tn,[["render",ln]]),rn=b({name:"MotionImage",components:{ElUpload:K,ElButton:L,InfoIcon:S,FontAwesomeIcon:E,ImagePreview:G},mixins:[W],data(){return{fileList:[],uploadUrl:A()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetImageUrl()},methods:{onExceed(){C.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){C.error(this.$t("kling.message.uploadReferencesError"))},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,image_url:void 0})},onSetImageUrl(){const e=this.urls?.[0];this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,image_url:e})},async onSuccess(){this.onSetImageUrl()}}}),cn={class:"relative"},dn={class:"flex justify-between"},mn={class:"flex justify-start items-center"},pn={class:"text-sm font-bold"};function un(e,t,s,a,u,$){const c=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),d=o("el-button"),v=o("el-upload");return l(),m("div",cn,[i("div",dn,[i("div",mn,[i("span",pn,r(e.$t("kling.name.motionImage")),1),n(c,{content:e.$t("kling.description.motionImage")},null,8,["content"])])]),n(v,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=g=>e.fileList=g),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:1,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:g})=>[g.url&&g.percentage!==void 0?(l(),V(p,{key:0,url:g.url,name:g.name,percentage:g.percentage,onRemove:_=>e.onRemove(g)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(d,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadReferences")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const gn=y(rn,[["render",un],["__scopeId","data-v-37d42da7"]]),fn=b({name:"MotionVideo",components:{ElUpload:K,ElButton:L,InfoIcon:S,FilePreview:Me,FontAwesomeIcon:E},data(){return{fileList:[],uploadUrl:A()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},mounted(){this.onSetVideoUrl()},methods:{onExceed(){C.warning(this.$t("kling.message.uploadVideoExceed"))},onError(){C.error(this.$t("kling.message.uploadVideoError"))},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,video_url:void 0})},beforeUpload(e){const t=e.type==="video/mp4"||e.type==="video/quicktime",s=e.size/1024/1024<100;return t?s?!0:(C.error(this.$t("kling.message.uploadVideoSizeExceed")),!1):(C.error(this.$t("kling.message.uploadVideoTypeFailed")),!1)},onSetVideoUrl(){const e=this.urls?.[0];this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,video_url:e})},async onSuccess(){this.onSetVideoUrl()}}}),hn={class:"relative"},_n={class:"flex justify-between"},$n={class:"flex justify-start items-center"},vn={class:"text-sm font-bold"};function kn(e,t,s,a,u,$){const c=o("info-icon"),p=o("file-preview"),f=o("font-awesome-icon"),d=o("el-button"),v=o("el-upload");return l(),m("div",hn,[i("div",_n,[i("div",$n,[i("span",vn,r(e.$t("kling.name.motionVideo")),1),n(c,{content:e.$t("kling.description.motionVideo")},null,8,["content"])])]),n(v,{"file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=g=>e.fileList=g),accept:".mp4,.mov",name:"file",class:"value","show-file-list":!0,limit:1,multiple:!1,action:e.uploadUrl,"before-upload":e.beforeUpload,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:h(({file:g})=>[g.percentage!==void 0?(l(),V(p,{key:0,url:g.url||g.response?.file_url,name:g.name,percentage:g.percentage,onRemove:_=>e.onRemove(g)},null,8,["url","name","percentage","onRemove"])):k("",!0)]),default:h(()=>[n(d,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:h(()=>[n(f,{icon:"fa-solid fa-upload",class:"icon mr-1"}),w(" "+r(e.$t("kling.button.uploadVideoUrl")),1)]),_:1})]),_:1},8,["file-list","action","before-upload","on-exceed","on-error","on-success","headers"])])}const bn=y(fn,[["render",kn],["__scopeId","data-v-5cf93212"]]),yn=b({name:"MotionPromptInput",components:{ElInput:Q,InfoIcon:S},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||""},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),wn={class:"field"},Cn={class:"box"},Vn={class:"title font-bold"};function Sn(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-input");return l(),m("div",wn,[i("div",Cn,[i("h2",Vn,r(e.$t("kling.name.motionPrompt")),1),n(c,{content:e.$t("kling.description.motionPrompt"),class:"info"},null,8,["content"])]),n(p,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=f=>e.prompt=f),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.motionPrompt")},null,8,["modelValue","placeholder"])])}const Tn=y(yn,[["render",Sn],["__scopeId","data-v-ca9fdbe5"]]),re="video",In=b({name:"CharacterOrientationSelector",components:{ElRadioGroup:Re,ElRadioButton:Ue,InfoIcon:S},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||re},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,character_orientation:e})}}},mounted(){this.$store.state.kling?.motionConfig?.character_orientation||(this.value=re)}}),En={class:"field"},Ln={class:"header"},Mn={class:"text-sm font-bold"};function Un(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-radio-button"),f=o("el-radio-group");return l(),m("div",En,[i("div",Ln,[i("span",Mn,r(e.$t("kling.name.characterOrientation")),1),n(c,{content:e.$t("kling.description.characterOrientation")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),size:"small",class:"value"},{default:h(()=>[n(p,{label:"image"},{default:h(()=>[w(r(e.$t("kling.name.orientationImage")),1)]),_:1}),n(p,{label:"video"},{default:h(()=>[w(r(e.$t("kling.name.orientationVideo")),1)]),_:1})]),_:1},8,["modelValue"])])}const Rn=y(In,[["render",Un],["__scopeId","data-v-7a91195b"]]),ce="std",An=b({name:"MotionModeSelector",components:{ElSelect:D,ElOption:P,InfoIcon:S},computed:{options(){return[{value:"std",label:this.$t("kling.name.modeStd")},{value:"pro",label:this.$t("kling.name.modePro")}]},value:{get(){return this.$store.state.kling?.motionConfig?.mode||ce},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=ce)}}),Pn={class:"field"},Dn={class:"header"},Gn={class:"title font-bold"};function Kn(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),m("div",Pn,[i("div",Dn,[i("h2",Gn,r(e.$t("kling.name.mode")),1),n(c,{content:e.$t("kling.description.motionMode")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=d=>e.value=d),class:"value",placeholder:e.$t("kling.placeholder.select")},{default:h(()=>[(l(!0),m(T,null,I(e.options,d=>(l(),V(p,{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const On=y(An,[["render",Kn],["__scopeId","data-v-1295688c"]]),jn=b({name:"KeepOriginalSoundSelector",components:{ElSwitch:ge,InfoIcon:S},computed:{value:{get(){return(this.$store.state.kling?.motionConfig?.keep_original_sound??"yes")==="yes"},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,keep_original_sound:e?"yes":"no"})}}}}),Nn={class:"relative"},Bn={class:"flex justify-between items-center"},zn={class:"flex justify-start items-center"},Fn={class:"text-sm font-bold"};function qn(e,t,s,a,u,$){const c=o("info-icon"),p=o("el-switch");return l(),m("div",Nn,[i("div",Bn,[i("div",zn,[i("span",Fn,r(e.$t("kling.name.keepOriginalSound")),1),n(c,{content:e.$t("kling.description.keepOriginalSound")},null,8,["content"])]),n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=f=>e.value=f)},null,8,["modelValue"])])])}const Hn=y(jn,[["render",qn]]),Wn=b({name:"MotionPanel",components:{ElButton:L,FontAwesomeIcon:E,Consumption:pe,MotionImage:gn,MotionVideo:bn,MotionPromptInput:Tn,CharacterOrientationSelector:Rn,MotionModeSelector:On,KeepOriginalSoundSelector:Hn},emits:["generate"],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return fe(this.motionConfig,this.service?.cost)},service(){return this.$store.state.kling?.service},canGenerate(){const e=this.motionConfig;return!!(e?.image_url&&e?.video_url)}},methods:{onGenerate(){this.$emit("generate")}}}),Jn={class:"flex flex-col h-full"},Qn={class:"flex-1 overflow-y-auto p-5"},Yn={class:"flex flex-col items-center justify-center px-5 pb-5"};function Xn(e,t,s,a,u,$){const c=o("motion-image"),p=o("motion-video"),f=o("motion-prompt-input"),d=o("character-orientation-selector"),v=o("motion-mode-selector"),g=o("keep-original-sound-selector"),_=o("consumption"),M=o("font-awesome-icon"),U=o("el-button");return l(),m("div",Jn,[i("div",Qn,[n(c,{class:"mb-3"}),n(p,{class:"mb-3"}),n(f,{class:"mb-4"}),n(d,{class:"mb-4"}),n(v,{class:"mb-4"}),n(g,{class:"mb-4"})]),i("div",Yn,[n(_,{value:e.consumption,service:e.service},null,8,["value","service"]),n(U,{type:"primary",class:"btn w-full",round:"",disabled:!e.canGenerate,onClick:e.onGenerate},{default:h(()=>[n(M,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.generateMotion")),1)]),_:1},8,["disabled","onClick"])])])}const Zn=y(Wn,[["render",Xn]]),xn=b({name:"KlingTabSwitcher",components:{ElTabs:Pe,ElTabPane:Ae,ElTag:Ve},props:{modelValue:{type:String,default:"videos"}},emits:["update:modelValue"],computed:{tabs(){return[{value:"videos",label:this.$t("kling.tab.videoGeneration")},{value:"motion",label:this.$t("kling.tab.motionControl")}]}},methods:{onUpdate(e){this.$emit("update:modelValue",e)}}}),es=["title"],ts={class:"text"};function os(e,t,s,a,u,$){const c=o("el-tag"),p=o("el-tab-pane"),f=o("el-tabs");return l(),V(f,{"model-value":e.modelValue,class:"kling-tabs",stretch:"","onUpdate:modelValue":e.onUpdate},{default:h(()=>[(l(!0),m(T,null,I(e.tabs,d=>(l(),V(p,{key:d.value,name:d.value,disabled:d.disabled},{label:h(()=>[i("span",{class:"tab-label",title:d.disabled?d.disabledReason:void 0},[i("span",ts,r(d.label),1),d.badge?(l(),V(c,{key:0,size:"small",type:"warning",class:"badge"},{default:h(()=>[w(r(d.badge),1)]),_:2},1024)):k("",!0)],8,es)]),_:2},1032,["name","disabled"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])}const ns=y(xn,[["render",os],["__scopeId","data-v-bf00c27e"]]),ss=b({name:"TaskPreview",components:{ElImage:Oe,CopyToClipboard:De,FontAwesomeIcon:E,ElAlert:Ke,VideoPlayer:Ge,ElTooltip:J,ElButton:L,ImagePreview:G},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},referenceImages(){const e=[],t=this.modelValue?.request?.start_image_url,s=this.modelValue?.request?.end_image_url;return t&&e.push({url:t,name:"start-image"}),s&&e.push({url:s,name:"end-image"}),e}},methods:{onDownload(e,t){e.stopPropagation(),console.log("on download"),window.open(t,"_blank")},onOpenVideo(e){window.open(e,"_blank")}}}),is={class:"preview"},ls={class:"left"},as={class:"main"},rs={class:"bot"},cs={class:"datetime"},ds={class:"info"},ms={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},ps={key:1,class:"prompt mt-2"},us={key:0},gs={key:1},fs={key:0,class:R({content:!0,failed:!0})},hs={key:0,class:"mb-4"},_s={key:1,class:R({operations:!0,"mt-2":!0})},$s={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},vs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ks={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},bs={key:1,class:R({content:!0})},ys={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ws={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Cs={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Vs={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Ss={key:2,class:R({content:!0})},Ts={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Is={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Es(e,t,s,a,u,$){const c=o("el-image"),p=o("image-preview"),f=o("video-player"),d=o("el-button"),v=o("el-tooltip"),g=o("font-awesome-icon"),_=o("copy-to-clipboard"),M=o("el-alert");return l(),m("div",is,[i("div",ls,[n(c,{src:"https://cdn.acedata.cloud/qpbbbb.jpg",class:"avatar"})]),i("div",as,[i("div",rs,[w(r(e.$t("kling.name.klingBot"))+" ",1),i("span",cs,r(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),i("div",ds,[e.referenceImages.length>0?(l(),m("div",ms,[(l(!0),m(T,null,I(e.referenceImages,(U,O)=>(l(),V(p,{key:O,url:U.url,name:U.name,closable:!1},null,8,["url","name"]))),128))])):k("",!0),e.modelValue?.request?.prompt?(l(),m("p",ps,[w(r(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?k("",!0):(l(),m("span",us," - ("+r(e.$t("kling.status.pending"))+") ",1)),e.modelValue?.response?.state==="submitted"||e.modelValue?.response?.state==="processing"||e.modelValue?.response?.state==="pending"||e.modelValue?.response?.state==="completed"?(l(),m("span",gs," - ("+r(e.$t("kling.status.processing"))+") ",1)):k("",!0)])):k("",!0)]),e.modelValue?.response?.success===!0?(l(),m("div",fs,[e.modelValue?.response.video_url?(l(),m("div",hs,[n(f,{src:e.modelValue?.response.video_url},null,8,["src"])])):k("",!0),e.modelValue?.response.success?(l(),m("div",_s,[n(v,{class:"box-item",effect:"dark",content:e.$t("kling.message.downloadVideo"),placement:"top-start"},{default:h(()=>[e.modelValue?.response.video_url?(l(),V(d,{key:0,type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=U=>e.onDownload(U,e.modelValue?.response.video_url))},{default:h(()=>[w(r(e.$t("kling.button.download")),1)]),_:1})):k("",!0)]),_:1},8,["content"])])):k("",!0),n(M,{closable:!1,class:"mt-2 success"},{default:h(()=>[i("p",$s,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.model"))+": "+r(e.modelValue?.request?.model),1)]),i("p",vs,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(l(),m("p",ks,[n(g,{icon:"fa-solid fa-clock",class:"mr-1"}),w(" "+r(e.$t("kling.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):k("",!0)]),_:1})])):k("",!0),e.modelValue?.response?.success===!1?(l(),m("div",bs,[n(M,{closable:!1,class:"failure"},{template:h(()=>[n(g,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),w(" "+r(e.$t("kling.name.failure")),1)]),default:h(()=>[i("p",ys,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),i("p",ws,[n(g,{icon:"fa-solid fa-circle-info",class:"mr-1"}),w(" "+r(e.$t("kling.name.failureReason"))+": "+r(e.modelValue?.response?.error?.message)+" ",1),n(_,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(l(),m("p",Cs,[n(g,{icon:"fa-solid fa-clock",class:"mr-1"}),w(" "+r(e.$t("kling.name.elapsed"))+": "+r(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):k("",!0),e.modelValue?.response?.trace_id?(l(),m("p",Vs,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(_,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):k("",!0)]),_:1})])):k("",!0),e.modelValue?.response?.success===void 0?(l(),m("div",Ss,[n(M,{closable:!1,class:"info"},{template:h(()=>[n(g,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),w(" "+r(e.$t("kling.name.failure")),1)]),default:h(()=>[i("p",Ts,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.response?.trace_id?(l(),m("p",Is,[n(g,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(_,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):k("",!0)]),_:1})])):k("",!0)])])}const Ls=y(ss,[["render",Es],["__scopeId","data-v-e8e87659"]]),Ms=b({name:"RecentPanel",components:{TaskPreview:Ls,NoTasks:Ne,BotPlaceholder:je,ScrollList:Le},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.kling?.tasks,items:this.$store.state.kling?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Us={key:0},Rs={key:2,class:"w-full h-full flex items-center justify-center"};function As(e,t,s,a,u,$){const c=o("bot-placeholder"),p=o("task-preview"),f=o("scroll-list"),d=o("no-tasks");return l(),m(T,null,[e.tasks?.items===void 0?(l(),m("div",Us,[n(c)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(l(),V(f,{key:1,ref:"scrollList",class:"h-full w-full overflow-y-auto tasks",loading:e.loading,onReachTop:t[0]||(t[0]=v=>e.$emit("reach-top"))},{default:h(()=>[(l(!0),m(T,null,I(e.tasks?.items,v=>(l(),V(p,{key:v.id,"model-value":v},null,8,["model-value"]))),128))]),_:1},8,["loading"])):k("",!0),e.tasks?.items?.length===0?(l(),m("div",Rs,[n(d)])):k("",!0)],64)}const Ps=y(Ms,[["render",As]]),de="https://webhook.acedata.cloud/kling",Ds=b({name:"KlingIndex",components:{ConfigPanel:an,MotionPanel:Zn,TabSwitcher:ns,Layout:Je,RecentPanel:Ps},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===oe.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===oe.Request||this.fetchingTasks},credential(){return this.$store.state.kling.credential},config(){return this.$store.state.kling.config},motionConfig(){return this.$store.state.kling.motionConfig},taskType(){return this.$store.state.kling.taskType||"videos"},tasks(){return this.$store.state.kling.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 Be({tasks: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("kling/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("kling/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:s,createdAtMax:a}=e||{};console.debug("limit",t,"createdAtMin",s,"createdAtMax",a),this.fetchingTasks=!0;try{await this.$store.dispatch("kling/getTasks",{limit:t,createdAtMin:s,createdAtMax:a})}finally{this.fetchingTasks=!1}},async onGenerate(){const{camera_control:e,...t}=this.config||{},s={...t,callback_url:de};if(!s.video_id&&!t.video_url&&!s.start_image_url&&s.end_image_url){C.warning(this.$t("kling.message.endImageRequiresStart"));return}s.action||(s.video_id||t.video_url?s.action="extend":s.start_image_url?s.action="image2video":s.action="text2video"),s.action==="text2video"&&s.end_image_url&&delete s.end_image_url,e?.type&&(s.camera_control={type:e.type,...e.type==="simple"&&e.config?{config:Object.fromEntries(Object.entries(e.config).filter(([,u])=>u!=null))}:{}});const a=this.credential?.token;if(!a){console.error("no token specified");return}C.info(this.$t("kling.message.startingTask")),te("kling",ie.generate(s,{token:a})).then(()=>{C.success(this.$t("kling.message.startTaskSuccess"))}).catch(u=>{u?.response?.data?.error?.code===se?C.error(this.$t("kling.message.usedUp")):C.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},async onTabChange(e){e!==this.taskType&&(await this.$store.dispatch("kling/setTaskType",e),await this.onGetTasks(),await this.onScrollDown())},async onGenerateMotion(){const e=this.motionConfig||{};if(!e.image_url||!e.video_url){C.warning(this.$t("kling.message.motionMissingInputs"));return}const t={image_url:e.image_url,video_url:e.video_url,character_orientation:e.character_orientation||"video",mode:e.mode||"std",keep_original_sound:e.keep_original_sound??"yes",...e.prompt?{prompt:e.prompt}:{},callback_url:de},s=this.credential?.token;if(!s){console.error("no token specified");return}C.info(this.$t("kling.message.startingTask")),te("kling",ie.motion(t,{token:s})).then(()=>{C.success(this.$t("kling.message.startTaskSuccess"))}).catch(a=>{a?.response?.data?.error?.code===se?C.error(this.$t("kling.message.usedUp")):C.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),Gs={class:"flex flex-col h-full"},Ks={class:"flex-1 min-h-0"};function Os(e,t,s,a,u,$){const c=o("tab-switcher"),p=o("config-panel"),f=o("motion-panel"),d=o("recent-panel"),v=o("layout");return l(),V(v,null,{config:h(()=>[i("div",Gs,[n(c,{"model-value":e.taskType,"onUpdate:modelValue":e.onTabChange},null,8,["model-value","onUpdate:modelValue"]),i("div",Ks,[e.taskType==="videos"?(l(),V(p,{key:0,onGenerate:e.onGenerate},null,8,["onGenerate"])):e.taskType==="motion"?(l(),V(f,{key:1,onGenerate:e.onGenerateMotion},null,8,["onGenerate"])):k("",!0)])])]),result:h(()=>[n(d,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Bi=y(Ds,[["render",Os]]);export{Bi as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as P}from"./index.es-DWP0WL9I.js";import{E as U}from"./index-DD7PDhJt.js";import{E as Y}from"./index-CMrxr9s5.js";import{d as b,H as i,E as r,z as L,C as a,y as p,D as n,q as t,F as l,O as E,N as T,x as m,Q as A,R as J,J as d,I as _}from"./vendor-vue-NSDaktjZ.js";import{E as k,b7 as Q,cd as K,aw as M}from"./index-DKlUKxnB.js";import{a as W,b as Z,c as x,d as ee,e as oe,f as te,g as G,h as se,i as ne,j as ae}from"./veo-Dg8Zhpd-.js";import{E as C,a as O}from"./index-D9-nLyZk.js";import{I as j,S as le}from"./ScrollList-COWNfBjK.js";import{E as ie}from"./index-g1qbc9hT.js";import{V as D}from"./VideoPlayer-CzcMT9AZ.js";import{E as R}from"./index-Dyd6KG-o.js";import{p as re}from"./pasteUploadMixin-BurWbGNQ.js";import{I as ce}from"./ImagePreview-CLAIXPcM.js";import{E as de}from"./index-DTZY5KH9.js";import{E as I}from"./index-Ci2kDHK1.js";import{C as ue}from"./Consumption-F9vhwk03.js";import{a as pe}from"./price-BLWWDZIp.js";import{b as me}from"./errorCode-Cqj9Td_Z.js";import{v as ve}from"./veo-B0_jjzRC.js";import{C as fe}from"./CopyToClipboard-UjbBZ_ac.js";import{E as _e}from"./index-CW2ML0Zo.js";import{E as he}from"./index-ByzOFVtn.js";import{E as $e}from"./index-B_59vVR6.js";import{B as ge}from"./BotPlaceholder-jDf8T7ol.js";import{N as be}from"./NoTasks-sYq9Zr2G.js";import{l as ke}from"./pagination-Cnc6Oeyx.js";import"./use-form-item-BR1a3Xvf.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-Cvgzdobq.js";import"./vendor-vue-router-Kg6s1a65.js";import"./index-QRqt1QsU.js";import"./typescript-DEARewO1.js";import"./index-B4Ov55Re.js";import"./strings-beZM2Y-f.js";import"./isEqual-DGwqaOMZ.js";import"./_Uint8Array-DYoXPfzZ.js";import"./castArray-kDnnxK3Y.js";import"./debounce-B3qQloOM.js";import"./_baseIteratee-CCpRH0CC.js";import"./index-BMRSApyp.js";import"./validator-395EcdVg.js";import"./vue-plyr-BO2nlN4c.js";import"./index-DFloj7qj.js";import"./index-BeJ6JfNM.js";import"./_baseClone-BHq6vhwI.js";import"./_initCloneObject-D8dKrUgV.js";import"./index-BVrGyG9B.js";const ye=b({name:"LayoutVeo",components:{ElDrawer:Y,ElButton:U,FontAwesomeIcon:P},data(){return{drawer:!1}}}),Ve={class:"main flex flex-row flex-1"},we={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},Ee={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,o,v,f,y,V){const c=n("font-awesome-icon"),u=n("el-button"),s=n("el-drawer");return t(),i("div",Ve,[r("div",we,[L(e.$slots,"config",{},void 0,!0)]),r("div",Ee,[L(e.$slots,"result",{},void 0,!0)]),a(u,{circle:"",class:"menu",onClick:o[0]||(o[0]=w=>e.drawer=!0)},{default:p(()=>[a(c,{icon:"fa-solid fa-magic"})]),_:1}),a(s,{modelValue:e.drawer,"onUpdate:modelValue":o[1]||(o[1]=w=>e.drawer=w),direction:"ltr","with-header":!1,size:"350px"},{default:p(()=>[L(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Te=k(ye,[["render",Ie],["__scopeId","data-v-816b984c"]]),Se=b({name:"ModelSelector",components:{ElSelect:O,ElOption:C},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{options:[{value:"veo2",label:"veo2"},{value:"veo2-fast",label:"veo2-fast"},{value:"veo3",label:"veo3"},{value:"veo3-fast",label:"veo3-fast"},{value:"veo31-fast",label:"veo31-fast"},{value:"veo31",label:"veo31"},{value:"veo31-fast-ingredients",label:"veo31-fast-ingredients"}]}},computed:{value:{get(){return this.$store.state.veo?.config?.model},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,model:e})}}},mounted(){this.value||(this.value=W)}}),Ae={class:"field"},Ce={class:"title font-bold"};function Oe(e,o,v,f,y,V){const c=n("el-option"),u=n("el-select");return t(),i("div",Ae,[r("h2",Ce,l(e.$t("veo.name.model")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s),class:"value",placeholder:e.$t("veo.placeholder.select")},{default:p(()=>[(t(!0),i(E,null,T(e.options,s=>(t(),m(c,{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Pe=k(Se,[["render",Oe],["__scopeId","data-v-a59d89c9"]]),Ue=b({name:"ActionSelector",components:{ElSelect:O,ElOption:C},data(){return{}},computed:{options(){return[{value:"text2video",label:this.$t("veo.button.action1")},{value:"image2video",label:this.$t("veo.button.action2")},{value:"ingredients2video",label:this.$t("veo.button.actionIngredients")},{value:"upsample",label:this.$t("veo.button.actionUpsample")},{value:"extend",label:this.$t("veo.button.actionExtend")},{value:"reshoot",label:this.$t("veo.button.actionReshoot")},{value:"object_insert",label:this.$t("veo.button.actionObjectInsert")},{value:"object_remove",label:this.$t("veo.button.actionObjectRemove")}]},value:{get(){return this.$store.state.veo?.config?.action},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,action:e})}}},mounted(){this.value||(this.value=Z)}}),Le={class:"field"},je={class:"title font-bold"},Re={class:"float-left"};function Me(e,o,v,f,y,V){const c=n("el-option"),u=n("el-select");return t(),i("div",Le,[r("h2",je,l(e.$t("veo.name.action")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s),class:"value",placeholder:e.$t("veo.placeholder.select"),clearable:""},{default:p(()=>[(t(!0),i(E,null,T(e.options,s=>(t(),m(c,{key:s.value,label:s.label,value:s.value},{default:p(()=>[r("span",Re,l(s.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Ge=k(Ue,[["render",Me],["__scopeId","data-v-f4d8785c"]]),De=b({name:"TranslationSelector",components:{ElSwitch:ie,InfoIcon:j},computed:{value:{get(){return this.$store.state.veo?.config?.translation},set(e){console.debug("set translation",e),this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,translation:e})}}},mounted(){this.value===void 0&&(this.value=x)}}),Ne={class:"relative"},Fe={class:"flex justify-between"},ze={class:"flex justify-start items-center"},Be={class:"text-sm font-bold"},qe={class:"flex justify-end items-center"};function He(e,o,v,f,y,V){const c=n("info-icon"),u=n("el-switch");return t(),i("div",Ne,[r("div",Fe,[r("div",ze,[r("span",Be,l(e.$t("veo.name.translation")),1),a(c,{content:e.$t("veo.description.translation")},null,8,["content"])]),r("div",qe,[a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s),class:"value"},null,8,["modelValue"])])])])}const Xe=k(De,[["render",He]]),Ye=b({name:"AspectRatioSelector",data(){return{options:[{value:"1:1",label:"1:1",width:20,height:20},{value:"4:3",label:"4:3",width:20,height:15},{value:"3:4",label:"3:4",width:15,height:20},{value:"16:9",label:"16:9",width:25,height:13},{value:"9:16",label:"9:16",width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){return this.$store.state.veo?.config?.aspect_ratio},set(e){console.debug("set aspect_ratio",e),this.$store.commit("veo/setConfig",{...this.$store.state?.veo?.config,aspect_ratio:e})}}},mounted(){this.value||(this.value=ee)}}),Je={class:"text-sm font-bold mb-2 block"},Qe={class:"items"},Ke=["onClick"],We={class:"name"};function Ze(e,o,v,f,y,V){return t(),i("div",null,[r("span",Je,l(e.$t("veo.name.ratio")),1),r("div",Qe,[(t(!0),i(E,null,T(e.options,(c,u)=>(t(),i("div",{key:u,class:A({active:e.active===u,item:!0}),onClick:s=>e.value=c.value},[r("div",{class:A(["preview",c.label])},[r("div",{class:"rect",style:J({width:c.width+"px",height:c.height+"px"})},null,4)],2),r("p",We,l(c.label),1)],10,Ke))),128))])])}const xe=k(Ye,[["render",Ze],["__scopeId","data-v-0f16be77"]]),eo=b({name:"VideoFromInput",components:{VideoPlayer:D},props:{modelValue:{type:Object,required:!1,default:void 0}},data(){return{options:{quality:{default:"1080p"}}}},computed:{config(){return this.$store.state.veo?.config}}}),oo={class:"relative"},to={class:"flex mb-2"},so={class:"text-sm font-bold"};function no(e,o,v,f,y,V){const c=n("video-player");return t(),i("div",oo,[r("div",to,[r("span",so,l(e.$t("veo.name.action3")),1)]),r("div",null,[e.config?.video_url?(t(),m(c,{key:0,src:e.config?.video_url},null,8,["src"])):d("",!0)])])}const ao=k(eo,[["render",no]]),lo=b({name:"VideoIdInput",components:{ElInput:R},computed:{value:{get(){return this.$store.state.veo?.config?.video_id},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,video_id:e})}}}}),io={class:"field"},ro={class:"title font-bold"};function co(e,o,v,f,y,V){const c=n("el-input");return t(),i("div",io,[r("h2",ro,l(e.$t("veo.name.videoId")),1),a(c,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=u=>e.value=u),class:"value",type:"text",placeholder:e.$t("veo.placeholder.videoId"),clearable:""},null,8,["modelValue","placeholder"])])}const uo=k(lo,[["render",co],["__scopeId","data-v-6eba4026"]]),po=b({name:"StartEndImage",components:{ElUpload:de,ElButton:U,InfoIcon:j,FontAwesomeIcon:P,ImagePreview:ce},mixins:[re],emits:["change"],data(){return{fileList:[],uploadUrl:Q()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.veo?.config?.image_urls},set(){}}},mounted(){this.value||(this.value=void 0),this.onSetStartEndImageUrl()},methods:{onExceed(){I.warning(this.$t("veo.message.uploadReferencesExceed"))},onError(){I.error(this.$t("veo.message.uploadReferencesError"))},onSetStartEndImageUrl(){const e=this.urls;this.$store.commit("veo/setConfig",{...this.$store.state?.veo?.config,image_urls:e})},async onSuccess(){this.onSetStartEndImageUrl()}}}),mo={class:"relative"},vo={class:"flex justify-between"},fo={class:"flex justify-start items-center"},_o={class:"text-sm font-bold"};function ho(e,o,v,f,y,V){const c=n("info-icon"),u=n("image-preview"),s=n("font-awesome-icon"),w=n("el-button"),$=n("el-upload");return t(),i("div",mo,[r("div",vo,[r("div",fo,[r("span",_o,l(e.$t("veo.name.startEndImage")),1),a(c,{content:e.$t("veo.description.uploadStartEndImage")},null,8,["content"])])]),a($,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":o[0]||(o[0]=h=>e.fileList=h),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:2,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:p(({file:h})=>[h.url&&h.percentage!==void 0?(t(),m(u,{key:0,url:h.url,name:h.name,percentage:h.percentage,onRemove:S=>e.fileList.splice(e.fileList.indexOf(h),1)},null,8,["url","name","percentage","onRemove"])):d("",!0)]),default:p(()=>[a(w,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:p(()=>[a(s,{icon:"fa-solid fa-upload",class:"icon mr-1"}),_(" "+l(e.$t("veo.button.uploadReferences")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const $o=k(po,[["render",ho],["__scopeId","data-v-b8ddb8fb"]]),go=b({name:"UpsampleActionSelector",components:{ElSelect:O,ElOption:C},computed:{options(){return te.map(e=>({value:e,label:e}))},value:{get(){return this.$store.state.veo?.config?.upsample_action},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,upsample_action:e})}}},mounted(){this.value||(this.value=oe)}}),bo={class:"field"},ko={class:"title font-bold"};function yo(e,o,v,f,y,V){const c=n("el-option"),u=n("el-select");return t(),i("div",bo,[r("h2",ko,l(e.$t("veo.name.upsampleAction")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s),class:"value",placeholder:e.$t("veo.placeholder.select")},{default:p(()=>[(t(!0),i(E,null,T(e.options,s=>(t(),m(c,{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Vo=k(go,[["render",yo],["__scopeId","data-v-8b74a7ae"]]),wo=b({name:"ExtendModelSelector",components:{ElSelect:O,ElOption:C},computed:{options(){return G.map(e=>({value:e,label:e}))},value:{get(){return this.$store.state.veo?.config?.model},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,model:e})}}},mounted(){(!this.value||!G.includes(this.value))&&(this.value=se)}}),Eo={class:"field"},Io={class:"title font-bold"};function To(e,o,v,f,y,V){const c=n("el-option"),u=n("el-select");return t(),i("div",Eo,[r("h2",Io,l(e.$t("veo.name.model")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s),class:"value",placeholder:e.$t("veo.placeholder.select")},{default:p(()=>[(t(!0),i(E,null,T(e.options,s=>(t(),m(c,{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const So=k(wo,[["render",To],["__scopeId","data-v-cc3f9355"]]),Ao=b({name:"MotionTypeSelector",components:{ElSelect:O,ElOption:C},computed:{options(){return ae.map(e=>({value:e,label:e}))},value:{get(){return this.$store.state.veo?.config?.motion_type},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,motion_type:e})}}},mounted(){this.value||(this.value=ne)}}),Co={class:"field"},Oo={class:"title font-bold"};function Po(e,o,v,f,y,V){const c=n("el-option"),u=n("el-select");return t(),i("div",Co,[r("h2",Oo,l(e.$t("veo.name.motionType")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s),class:"value",placeholder:e.$t("veo.placeholder.select"),filterable:""},{default:p(()=>[(t(!0),i(E,null,T(e.options,s=>(t(),m(c,{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Uo=k(Ao,[["render",Po],["__scopeId","data-v-3affff3c"]]),Lo=b({name:"ImageMaskInput",components:{ElInput:R},computed:{value:{get(){return this.$store.state.veo?.config?.image_mask},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,image_mask:e})}}}}),jo={class:"field"},Ro={class:"title font-bold"};function Mo(e,o,v,f,y,V){const c=n("el-input");return t(),i("div",jo,[r("h2",Ro,l(e.$t("veo.name.imageMask")),1),a(c,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=u=>e.value=u),class:"value",type:"text",placeholder:e.$t("veo.placeholder.imageMask"),clearable:""},null,8,["modelValue","placeholder"])])}const Go=k(Lo,[["render",Mo],["__scopeId","data-v-6cc27c68"]]),Do="",No=b({name:"PromptInput",components:{ElInput:R,InfoIcon:j},computed:{prompt:{get(){return this.$store.state.veo?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=Do)}}),Fo={class:"field"},zo={class:"box"},Bo={class:"title font-bold"};function qo(e,o,v,f,y,V){const c=n("info-icon"),u=n("el-input");return t(),i("div",Fo,[r("div",zo,[r("h2",Bo,l(e.$t("veo.name.prompt")),1),a(c,{content:e.$t("veo.description.prompt"),class:"info"},null,8,["content"])]),a(u,{modelValue:e.prompt,"onUpdate:modelValue":o[0]||(o[0]=s=>e.prompt=s),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("veo.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const Ho=k(No,[["render",qo],["__scopeId","data-v-84c55ea0"]]),Xo=["upsample","extend","reshoot","object_insert","object_remove","get1080p"],Yo=["text2video","image2video","ingredients2video"],Jo=b({name:"ConfigPanel",components:{ElButton:U,Consumption:ue,FontAwesomeIcon:P,PromptInput:Ho,ModelSelector:Pe,StartEndImage:$o,ActionSelector:Ge,VideoFromInput:ao,VideoIdInput:uo,UpsampleActionSelector:Vo,ExtendModelSelector:So,MotionTypeSelector:Uo,ImageMaskInput:Go,TranslationSelector:Xe,AspectRatioSelector:xe},emits:["generate"],computed:{config(){return this.$store.state.veo?.config},consumption(){return pe(this.config,this.service?.cost)},service(){return this.$store.state.veo?.service},isPostProcessing(){return Xo.includes(this.config?.action??"")},isGeneration(){return Yo.includes(this.config?.action??"")}},methods:{onGenerate(){this.$emit("generate")}}}),Qo={class:"flex flex-col h-full"},Ko={class:"flex-1 overflow-y-auto p-5"},Wo={class:"flex flex-col items-center justify-center px-5 pb-5"};function Zo(e,o,v,f,y,V){const c=n("action-selector"),u=n("video-from-input"),s=n("video-id-input"),w=n("upsample-action-selector"),$=n("extend-model-selector"),h=n("prompt-input"),S=n("motion-type-selector"),g=n("image-mask-input"),N=n("translation-selector"),F=n("aspect-ratio-selector"),z=n("model-selector"),B=n("start-end-image"),q=n("consumption"),H=n("font-awesome-icon"),X=n("el-button");return t(),i("div",Qo,[r("div",Ko,[a(c,{class:"mb-4"}),e.isPostProcessing?(t(),i(E,{key:0},[e.config?.video_url?(t(),m(u,{key:0,class:"mb-4"})):d("",!0),a(s,{class:"mb-4"})],64)):d("",!0),e.config?.action==="upsample"?(t(),m(w,{key:1,class:"mb-4"})):d("",!0),e.config?.action==="extend"?(t(),m($,{key:2,class:"mb-4"})):d("",!0),e.config?.action==="extend"?(t(),m(h,{key:3,class:"mb-4"})):d("",!0),e.config?.action==="reshoot"?(t(),m(S,{key:4,class:"mb-4"})):d("",!0),e.config?.action==="object_insert"?(t(),m(h,{key:5,class:"mb-4"})):d("",!0),e.config?.action==="object_insert"||e.config?.action==="object_remove"?(t(),m(g,{key:6,class:"mb-4"})):d("",!0),e.config?.action==="object_remove"?(t(),m(h,{key:7,class:"mb-4"})):d("",!0),e.isGeneration?(t(),i(E,{key:8},[a(N,{class:"mb-4"}),e.config?.action==="image2video"||e.config?.action==="ingredients2video"?(t(),m(F,{key:0,class:"mb-4"})):d("",!0),a(h,{class:"mb-4"}),e.config?.action!=="ingredients2video"?(t(),m(z,{key:1,class:"mb-4"})):d("",!0),e.config?.action==="image2video"||e.config?.action==="ingredients2video"?(t(),m(B,{key:2,class:"mb-2"})):d("",!0)],64)):d("",!0)]),r("div",Wo,[a(q,{value:e.consumption,service:e.service},null,8,["value","service"]),a(X,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:p(()=>[a(H,{icon:"fa-solid fa-magic",class:"mr-2"}),_(" "+l(e.$t("veo.button.generate")),1)]),_:1},8,["onClick"])])])}const xo=k(Jo,[["render",Zo]]),et=b({name:"TaskPreview",components:{ElImage:$e,CopyToClipboard:fe,FontAwesomeIcon:P,ElAlert:he,VideoPlayer:D,ElTooltip:_e,ElButton:U},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.veo?.application},config(){return this.$store.state.veo?.config}},methods:{onPickAction(e,o,v,f){console.debug("seed config from preview",{action:v,upsampleAction:f,response:o}),this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,action:v,video_id:o?.data?.[0]?.id,video_url:o?.data?.[0]?.video_url,...f?{upsample_action:f}:{}})},onDownload(e,o){e.stopPropagation(),console.log("on download"),window.open(o,"_blank")},onOpenVideo(e){window.open(e,"_blank")}}}),ot={class:"preview"},tt={class:"left"},st={class:"main"},nt={class:"bot"},at={class:"datetime"},lt={class:"info"},it={key:0,class:"prompt mt-2"},rt={key:0},ct={key:1},dt={key:0,class:A({content:!0,failed:!0})},ut={key:0,class:"mb-4"},pt={key:1,class:A({operations:!0,"mt-2":!0})},mt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},vt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ft={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},_t={key:1,class:A({content:!0})},ht={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},$t={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},gt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},bt={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},kt={key:2,class:A({content:!0})},yt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Vt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function wt(e,o,v,f,y,V){const c=n("el-image"),u=n("video-player"),s=n("el-button"),w=n("el-tooltip"),$=n("font-awesome-icon"),h=n("copy-to-clipboard"),S=n("el-alert");return t(),i("div",ot,[r("div",tt,[a(c,{src:"https://cdn.acedata.cloud/8nxyy9.jpg",class:"avatar"})]),r("div",st,[r("div",nt,[_(l(e.$t("veo.name.veoBot"))+" ",1),r("span",at,l(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),r("div",lt,[e.modelValue?.request?.prompt?(t(),i("p",it,[_(l(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?d("",!0):(t(),i("span",rt," - ("+l(e.$t("veo.status.pending"))+") ",1)),Array.isArray(e.modelValue?.response?.data)&&e.modelValue?.response?.data[0]?.state==="running"?(t(),i("span",ct," - ("+l(e.$t("veo.status.processing"))+") ",1)):d("",!0)])):d("",!0)]),e.modelValue?.response?.success===!0&&e.modelValue?.response?.data?(t(),i("div",dt,[e.modelValue?.response?.data[0]?.video_url?(t(),i("div",ut,[a(u,{src:e.modelValue?.response?.data[0]?.video_url},null,8,["src"])])):d("",!0),e.modelValue?.response.success?(t(),i("div",pt,[e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:0,type:"info",size:"small",class:"btn-action",onClick:o[0]||(o[0]=g=>e.onPickAction(g,e.modelValue?.response,"upsample","1080p"))},{default:p(()=>[_(l(e.$t("veo.button.actionUpsample1080p")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:1,type:"info",size:"small",class:"btn-action",onClick:o[1]||(o[1]=g=>e.onPickAction(g,e.modelValue?.response,"upsample","4k"))},{default:p(()=>[_(l(e.$t("veo.button.actionUpsample4k")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:2,type:"info",size:"small",class:"btn-action",onClick:o[2]||(o[2]=g=>e.onPickAction(g,e.modelValue?.response,"upsample","gif"))},{default:p(()=>[_(l(e.$t("veo.button.actionUpsampleGif")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:3,type:"info",size:"small",class:"btn-action",onClick:o[3]||(o[3]=g=>e.onPickAction(g,e.modelValue?.response,"extend"))},{default:p(()=>[_(l(e.$t("veo.button.actionExtend")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:4,type:"info",size:"small",class:"btn-action",onClick:o[4]||(o[4]=g=>e.onPickAction(g,e.modelValue?.response,"reshoot"))},{default:p(()=>[_(l(e.$t("veo.button.actionReshoot")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:5,type:"info",size:"small",class:"btn-action",onClick:o[5]||(o[5]=g=>e.onPickAction(g,e.modelValue?.response,"object_insert"))},{default:p(()=>[_(l(e.$t("veo.button.actionObjectInsert")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:6,type:"info",size:"small",class:"btn-action",onClick:o[6]||(o[6]=g=>e.onPickAction(g,e.modelValue?.response,"object_remove"))},{default:p(()=>[_(l(e.$t("veo.button.actionObjectRemove")),1)]),_:1})):d("",!0),a(w,{class:"box-item",effect:"dark",content:e.$t("veo.message.downloadVideo"),placement:"top-start"},{default:p(()=>[e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:0,type:"info",size:"small",class:"btn-action",onClick:o[7]||(o[7]=g=>e.onDownload(g,e.modelValue?.response?.data[0]?.video_url))},{default:p(()=>[_(l(e.$t("veo.button.download")),1)]),_:1})):d("",!0)]),_:1},8,["content"])])):d("",!0),a(S,{closable:!1,class:"mt-2 success"},{default:p(()=>[r("p",mt,[a($,{icon:"fa-solid fa-hashtag",class:"mr-1"}),_(" "+l(e.$t("veo.name.model"))+": "+l(e.modelValue?.request?.model),1)]),r("p",vt,[a($,{icon:"fa-solid fa-magic",class:"mr-1"}),_(" "+l(e.$t("veo.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),a(h,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(t(),i("p",ft,[a($,{icon:"fa-solid fa-clock",class:"mr-1"}),_(" "+l(e.$t("veo.name.elapsed"))+": "+l(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):d("",!0)]),_:1})])):d("",!0),e.modelValue?.response?.success===!1?(t(),i("div",_t,[a(S,{closable:!1,class:"failure"},{template:p(()=>[a($,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),_(" "+l(e.$t("veo.name.failure")),1)]),default:p(()=>[r("p",ht,[a($,{icon:"fa-solid fa-magic",class:"mr-1"}),_(" "+l(e.$t("veo.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),a(h,{content:e.modelValue?.id},null,8,["content"])]),r("p",$t,[a($,{icon:"fa-solid fa-circle-info",class:"mr-1"}),_(" "+l(e.$t("veo.name.failureReason"))+": "+l(e.modelValue?.response?.error?.message)+" ",1),a(h,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(t(),i("p",gt,[a($,{icon:"fa-solid fa-clock",class:"mr-1"}),_(" "+l(e.$t("veo.name.elapsed"))+": "+l(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):d("",!0),e.modelValue?.response?.trace_id?(t(),i("p",bt,[a($,{icon:"fa-solid fa-hashtag",class:"mr-1"}),_(" "+l(e.$t("veo.name.traceId"))+": "+l(e.modelValue?.response?.trace_id)+" ",1),a(h,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):d("",!0)]),_:1})])):d("",!0),e.modelValue?.response?.success===void 0?(t(),i("div",kt,[a(S,{closable:!1,class:"info"},{template:p(()=>[a($,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),_(" "+l(e.$t("veo.name.failure")),1)]),default:p(()=>[r("p",yt,[a($,{icon:"fa-solid fa-magic",class:"mr-1"}),_(" "+l(e.$t("veo.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),a(h,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.response?.trace_id?(t(),i("p",Vt,[a($,{icon:"fa-solid fa-hashtag",class:"mr-1"}),_(" "+l(e.$t("veo.name.traceId"))+": "+l(e.modelValue?.response?.trace_id)+" ",1),a(h,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):d("",!0)]),_:1})])):d("",!0)])])}const Et=k(et,[["render",wt],["__scopeId","data-v-83f2991f"]]),It=b({name:"RecentPanel",components:{TaskPreview:Et,NoTasks:be,BotPlaceholder:ge,ScrollList:le},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.veo?.tasks,items:this.$store.state.veo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Tt={key:0},St={key:2,class:"w-full h-full flex items-center justify-center"};function At(e,o,v,f,y,V){const c=n("bot-placeholder"),u=n("task-preview"),s=n("scroll-list"),w=n("no-tasks");return t(),i(E,null,[e.tasks?.items===void 0?(t(),i("div",Tt,[a(c)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(t(),m(s,{key:1,ref:"scrollList",class:"tasks h-full w-full overflow-y-auto",loading:e.loading,onReachTop:o[0]||(o[0]=$=>e.$emit("reach-top"))},{default:p(()=>[(t(!0),i(E,null,T(e.tasks?.items,($,h)=>(t(),m(u,{key:h,"model-value":$},null,8,["model-value"]))),128))]),_:1},8,["loading"])):d("",!0),e.tasks?.items?.length===0?(t(),i("div",St,[a(w)])):d("",!0)],64)}const Ct=k(It,[["render",At]]),Ot="https://webhook.acedata.cloud/veo",Pt=b({name:"VeoIndex",components:{ConfigPanel:xo,Layout:Te,RecentPanel:Ct},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.veo?.status?.getApplications===M.Request},tasksLoading(){return this.$store.state.veo?.status?.getTasks===M.Request||this.fetchingTasks},credential(){return this.$store.state.veo.credential},config(){return this.$store.state.veo.config},tasks(){return this.$store.state.veo.tasks}},watch:{tasks:{handler(e,o){e?.items?.length>o?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ke({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("veo/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("veo/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:o=5,createdAtMin:v,createdAtMax:f}=e||{};console.debug("limit",o,"createdAtMin",v,"createdAtMax",f),this.fetchingTasks=!0;try{await this.$store.dispatch("veo/getTasks",{limit:o,createdAtMin:v,createdAtMax:f})}finally{this.fetchingTasks=!1}},async onGenerate(){const e={...this.config,callback_url:Ot},o=this.credential?.token;if(!o){console.error("no token specified");return}if(e.action==="image2video"&&!(e.image_urls&&e.image_urls.length>0)){I.warning(this.$t("veo.message.imageRequired"));return}(!e.image_urls||e.image_urls.length===0)&&delete e.image_urls,I.info(this.$t("veo.message.startingTask")),K("veo",ve.generate(e,{token:o})).then(()=>{I.success(this.$t("veo.message.startTaskSuccess"))}).catch(v=>{v?.response?.data?.error?.code===me?I.error(this.$t("veo.message.usedUp")):I.error(this.$t("veo.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Ut(e,o,v,f,y,V){const c=n("config-panel"),u=n("recent-panel"),s=n("layout");return t(),m(s,null,{config:p(()=>[a(c,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:p(()=>[a(u,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Ss=k(Pt,[["render",Ut]]);export{Ss as default};
|
|
1
|
+
import{F as P}from"./index.es-DkM2OF-9.js";import{E as U}from"./index-DNJ0Deds.js";import{E as Y}from"./index-BP_sbpCK.js";import{d as b,H as i,E as r,z as L,C as a,y as p,D as n,q as t,F as l,O as E,N as T,x as m,Q as A,R as J,J as d,I as _}from"./vendor-vue-NSDaktjZ.js";import{E as k,b7 as Q,cd as K,aw as M}from"./index-Bti47OvL.js";import{a as W,b as Z,c as x,d as ee,e as oe,f as te,g as G,h as se,i as ne,j as ae}from"./veo-Dg8Zhpd-.js";import{E as C,a as O}from"./index-BZTdivI9.js";import{I as j,S as le}from"./ScrollList-WqruYG0f.js";import{E as ie}from"./index-DXevThxR.js";import{V as D}from"./VideoPlayer-QZYuahlJ.js";import{E as R}from"./index-COsB5e28.js";import{p as re}from"./pasteUploadMixin-BurWbGNQ.js";import{I as ce}from"./ImagePreview-DZPTnmBT.js";import{E as de}from"./index-CDj4oGhc.js";import{E as I}from"./index-BQ7zd-Q3.js";import{C as ue}from"./Consumption-BEd757XD.js";import{a as pe}from"./price-CT1CtNhJ.js";import{b as me}from"./errorCode-Cqj9Td_Z.js";import{v as ve}from"./veo-zEO9V_gH.js";import{C as fe}from"./CopyToClipboard-BOQ-Zpxe.js";import{E as _e}from"./index-gY0_GLnY.js";import{E as he}from"./index-DutrdntU.js";import{E as $e}from"./index-0EOEDiT5.js";import{B as ge}from"./BotPlaceholder-C_IGBMvq.js";import{N as be}from"./NoTasks-Cb8ntRPy.js";import{l as ke}from"./pagination-Cnc6Oeyx.js";import"./use-form-item-Clq-JJlb.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-Cvgzdobq.js";import"./vendor-vue-router-Kg6s1a65.js";import"./index-t4Oimm-h.js";import"./typescript-2au3Mu9J.js";import"./index-CbDuQQJI.js";import"./strings-beZM2Y-f.js";import"./isEqual-CXlvduGT.js";import"./_Uint8Array-a5wCK152.js";import"./castArray-DzT6pvlU.js";import"./debounce-B74p5Dx9.js";import"./_baseIteratee-DtAKlqKl.js";import"./index-DmqdsYe_.js";import"./validator-DqeyweMw.js";import"./vue-plyr-BO2nlN4c.js";import"./index-CgUi3x9C.js";import"./index-B8cqf9M7.js";import"./_baseClone-JK1xFj5u.js";import"./_initCloneObject-UCIzaue4.js";import"./index-iGAJ0EBY.js";const ye=b({name:"LayoutVeo",components:{ElDrawer:Y,ElButton:U,FontAwesomeIcon:P},data(){return{drawer:!1}}}),Ve={class:"main flex flex-row flex-1"},we={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},Ee={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,o,v,f,y,V){const c=n("font-awesome-icon"),u=n("el-button"),s=n("el-drawer");return t(),i("div",Ve,[r("div",we,[L(e.$slots,"config",{},void 0,!0)]),r("div",Ee,[L(e.$slots,"result",{},void 0,!0)]),a(u,{circle:"",class:"menu",onClick:o[0]||(o[0]=w=>e.drawer=!0)},{default:p(()=>[a(c,{icon:"fa-solid fa-magic"})]),_:1}),a(s,{modelValue:e.drawer,"onUpdate:modelValue":o[1]||(o[1]=w=>e.drawer=w),direction:"ltr","with-header":!1,size:"350px"},{default:p(()=>[L(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Te=k(ye,[["render",Ie],["__scopeId","data-v-816b984c"]]),Se=b({name:"ModelSelector",components:{ElSelect:O,ElOption:C},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{options:[{value:"veo2",label:"veo2"},{value:"veo2-fast",label:"veo2-fast"},{value:"veo3",label:"veo3"},{value:"veo3-fast",label:"veo3-fast"},{value:"veo31-fast",label:"veo31-fast"},{value:"veo31",label:"veo31"},{value:"veo31-fast-ingredients",label:"veo31-fast-ingredients"}]}},computed:{value:{get(){return this.$store.state.veo?.config?.model},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,model:e})}}},mounted(){this.value||(this.value=W)}}),Ae={class:"field"},Ce={class:"title font-bold"};function Oe(e,o,v,f,y,V){const c=n("el-option"),u=n("el-select");return t(),i("div",Ae,[r("h2",Ce,l(e.$t("veo.name.model")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s),class:"value",placeholder:e.$t("veo.placeholder.select")},{default:p(()=>[(t(!0),i(E,null,T(e.options,s=>(t(),m(c,{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Pe=k(Se,[["render",Oe],["__scopeId","data-v-a59d89c9"]]),Ue=b({name:"ActionSelector",components:{ElSelect:O,ElOption:C},data(){return{}},computed:{options(){return[{value:"text2video",label:this.$t("veo.button.action1")},{value:"image2video",label:this.$t("veo.button.action2")},{value:"ingredients2video",label:this.$t("veo.button.actionIngredients")},{value:"upsample",label:this.$t("veo.button.actionUpsample")},{value:"extend",label:this.$t("veo.button.actionExtend")},{value:"reshoot",label:this.$t("veo.button.actionReshoot")},{value:"object_insert",label:this.$t("veo.button.actionObjectInsert")},{value:"object_remove",label:this.$t("veo.button.actionObjectRemove")}]},value:{get(){return this.$store.state.veo?.config?.action},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,action:e})}}},mounted(){this.value||(this.value=Z)}}),Le={class:"field"},je={class:"title font-bold"},Re={class:"float-left"};function Me(e,o,v,f,y,V){const c=n("el-option"),u=n("el-select");return t(),i("div",Le,[r("h2",je,l(e.$t("veo.name.action")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s),class:"value",placeholder:e.$t("veo.placeholder.select"),clearable:""},{default:p(()=>[(t(!0),i(E,null,T(e.options,s=>(t(),m(c,{key:s.value,label:s.label,value:s.value},{default:p(()=>[r("span",Re,l(s.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Ge=k(Ue,[["render",Me],["__scopeId","data-v-f4d8785c"]]),De=b({name:"TranslationSelector",components:{ElSwitch:ie,InfoIcon:j},computed:{value:{get(){return this.$store.state.veo?.config?.translation},set(e){console.debug("set translation",e),this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,translation:e})}}},mounted(){this.value===void 0&&(this.value=x)}}),Ne={class:"relative"},Fe={class:"flex justify-between"},ze={class:"flex justify-start items-center"},Be={class:"text-sm font-bold"},qe={class:"flex justify-end items-center"};function He(e,o,v,f,y,V){const c=n("info-icon"),u=n("el-switch");return t(),i("div",Ne,[r("div",Fe,[r("div",ze,[r("span",Be,l(e.$t("veo.name.translation")),1),a(c,{content:e.$t("veo.description.translation")},null,8,["content"])]),r("div",qe,[a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s),class:"value"},null,8,["modelValue"])])])])}const Xe=k(De,[["render",He]]),Ye=b({name:"AspectRatioSelector",data(){return{options:[{value:"1:1",label:"1:1",width:20,height:20},{value:"4:3",label:"4:3",width:20,height:15},{value:"3:4",label:"3:4",width:15,height:20},{value:"16:9",label:"16:9",width:25,height:13},{value:"9:16",label:"9:16",width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){return this.$store.state.veo?.config?.aspect_ratio},set(e){console.debug("set aspect_ratio",e),this.$store.commit("veo/setConfig",{...this.$store.state?.veo?.config,aspect_ratio:e})}}},mounted(){this.value||(this.value=ee)}}),Je={class:"text-sm font-bold mb-2 block"},Qe={class:"items"},Ke=["onClick"],We={class:"name"};function Ze(e,o,v,f,y,V){return t(),i("div",null,[r("span",Je,l(e.$t("veo.name.ratio")),1),r("div",Qe,[(t(!0),i(E,null,T(e.options,(c,u)=>(t(),i("div",{key:u,class:A({active:e.active===u,item:!0}),onClick:s=>e.value=c.value},[r("div",{class:A(["preview",c.label])},[r("div",{class:"rect",style:J({width:c.width+"px",height:c.height+"px"})},null,4)],2),r("p",We,l(c.label),1)],10,Ke))),128))])])}const xe=k(Ye,[["render",Ze],["__scopeId","data-v-0f16be77"]]),eo=b({name:"VideoFromInput",components:{VideoPlayer:D},props:{modelValue:{type:Object,required:!1,default:void 0}},data(){return{options:{quality:{default:"1080p"}}}},computed:{config(){return this.$store.state.veo?.config}}}),oo={class:"relative"},to={class:"flex mb-2"},so={class:"text-sm font-bold"};function no(e,o,v,f,y,V){const c=n("video-player");return t(),i("div",oo,[r("div",to,[r("span",so,l(e.$t("veo.name.action3")),1)]),r("div",null,[e.config?.video_url?(t(),m(c,{key:0,src:e.config?.video_url},null,8,["src"])):d("",!0)])])}const ao=k(eo,[["render",no]]),lo=b({name:"VideoIdInput",components:{ElInput:R},computed:{value:{get(){return this.$store.state.veo?.config?.video_id},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,video_id:e})}}}}),io={class:"field"},ro={class:"title font-bold"};function co(e,o,v,f,y,V){const c=n("el-input");return t(),i("div",io,[r("h2",ro,l(e.$t("veo.name.videoId")),1),a(c,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=u=>e.value=u),class:"value",type:"text",placeholder:e.$t("veo.placeholder.videoId"),clearable:""},null,8,["modelValue","placeholder"])])}const uo=k(lo,[["render",co],["__scopeId","data-v-6eba4026"]]),po=b({name:"StartEndImage",components:{ElUpload:de,ElButton:U,InfoIcon:j,FontAwesomeIcon:P,ImagePreview:ce},mixins:[re],emits:["change"],data(){return{fileList:[],uploadUrl:Q()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.veo?.config?.image_urls},set(){}}},mounted(){this.value||(this.value=void 0),this.onSetStartEndImageUrl()},methods:{onExceed(){I.warning(this.$t("veo.message.uploadReferencesExceed"))},onError(){I.error(this.$t("veo.message.uploadReferencesError"))},onSetStartEndImageUrl(){const e=this.urls;this.$store.commit("veo/setConfig",{...this.$store.state?.veo?.config,image_urls:e})},async onSuccess(){this.onSetStartEndImageUrl()}}}),mo={class:"relative"},vo={class:"flex justify-between"},fo={class:"flex justify-start items-center"},_o={class:"text-sm font-bold"};function ho(e,o,v,f,y,V){const c=n("info-icon"),u=n("image-preview"),s=n("font-awesome-icon"),w=n("el-button"),$=n("el-upload");return t(),i("div",mo,[r("div",vo,[r("div",fo,[r("span",_o,l(e.$t("veo.name.startEndImage")),1),a(c,{content:e.$t("veo.description.uploadStartEndImage")},null,8,["content"])])]),a($,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":o[0]||(o[0]=h=>e.fileList=h),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:2,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:p(({file:h})=>[h.url&&h.percentage!==void 0?(t(),m(u,{key:0,url:h.url,name:h.name,percentage:h.percentage,onRemove:S=>e.fileList.splice(e.fileList.indexOf(h),1)},null,8,["url","name","percentage","onRemove"])):d("",!0)]),default:p(()=>[a(w,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:p(()=>[a(s,{icon:"fa-solid fa-upload",class:"icon mr-1"}),_(" "+l(e.$t("veo.button.uploadReferences")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const $o=k(po,[["render",ho],["__scopeId","data-v-b8ddb8fb"]]),go=b({name:"UpsampleActionSelector",components:{ElSelect:O,ElOption:C},computed:{options(){return te.map(e=>({value:e,label:e}))},value:{get(){return this.$store.state.veo?.config?.upsample_action},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,upsample_action:e})}}},mounted(){this.value||(this.value=oe)}}),bo={class:"field"},ko={class:"title font-bold"};function yo(e,o,v,f,y,V){const c=n("el-option"),u=n("el-select");return t(),i("div",bo,[r("h2",ko,l(e.$t("veo.name.upsampleAction")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s),class:"value",placeholder:e.$t("veo.placeholder.select")},{default:p(()=>[(t(!0),i(E,null,T(e.options,s=>(t(),m(c,{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Vo=k(go,[["render",yo],["__scopeId","data-v-8b74a7ae"]]),wo=b({name:"ExtendModelSelector",components:{ElSelect:O,ElOption:C},computed:{options(){return G.map(e=>({value:e,label:e}))},value:{get(){return this.$store.state.veo?.config?.model},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,model:e})}}},mounted(){(!this.value||!G.includes(this.value))&&(this.value=se)}}),Eo={class:"field"},Io={class:"title font-bold"};function To(e,o,v,f,y,V){const c=n("el-option"),u=n("el-select");return t(),i("div",Eo,[r("h2",Io,l(e.$t("veo.name.model")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s),class:"value",placeholder:e.$t("veo.placeholder.select")},{default:p(()=>[(t(!0),i(E,null,T(e.options,s=>(t(),m(c,{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const So=k(wo,[["render",To],["__scopeId","data-v-cc3f9355"]]),Ao=b({name:"MotionTypeSelector",components:{ElSelect:O,ElOption:C},computed:{options(){return ae.map(e=>({value:e,label:e}))},value:{get(){return this.$store.state.veo?.config?.motion_type},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,motion_type:e})}}},mounted(){this.value||(this.value=ne)}}),Co={class:"field"},Oo={class:"title font-bold"};function Po(e,o,v,f,y,V){const c=n("el-option"),u=n("el-select");return t(),i("div",Co,[r("h2",Oo,l(e.$t("veo.name.motionType")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s),class:"value",placeholder:e.$t("veo.placeholder.select"),filterable:""},{default:p(()=>[(t(!0),i(E,null,T(e.options,s=>(t(),m(c,{key:s.value,label:s.label,value:s.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Uo=k(Ao,[["render",Po],["__scopeId","data-v-3affff3c"]]),Lo=b({name:"ImageMaskInput",components:{ElInput:R},computed:{value:{get(){return this.$store.state.veo?.config?.image_mask},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,image_mask:e})}}}}),jo={class:"field"},Ro={class:"title font-bold"};function Mo(e,o,v,f,y,V){const c=n("el-input");return t(),i("div",jo,[r("h2",Ro,l(e.$t("veo.name.imageMask")),1),a(c,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=u=>e.value=u),class:"value",type:"text",placeholder:e.$t("veo.placeholder.imageMask"),clearable:""},null,8,["modelValue","placeholder"])])}const Go=k(Lo,[["render",Mo],["__scopeId","data-v-6cc27c68"]]),Do="",No=b({name:"PromptInput",components:{ElInput:R,InfoIcon:j},computed:{prompt:{get(){return this.$store.state.veo?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=Do)}}),Fo={class:"field"},zo={class:"box"},Bo={class:"title font-bold"};function qo(e,o,v,f,y,V){const c=n("info-icon"),u=n("el-input");return t(),i("div",Fo,[r("div",zo,[r("h2",Bo,l(e.$t("veo.name.prompt")),1),a(c,{content:e.$t("veo.description.prompt"),class:"info"},null,8,["content"])]),a(u,{modelValue:e.prompt,"onUpdate:modelValue":o[0]||(o[0]=s=>e.prompt=s),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("veo.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const Ho=k(No,[["render",qo],["__scopeId","data-v-84c55ea0"]]),Xo=["upsample","extend","reshoot","object_insert","object_remove","get1080p"],Yo=["text2video","image2video","ingredients2video"],Jo=b({name:"ConfigPanel",components:{ElButton:U,Consumption:ue,FontAwesomeIcon:P,PromptInput:Ho,ModelSelector:Pe,StartEndImage:$o,ActionSelector:Ge,VideoFromInput:ao,VideoIdInput:uo,UpsampleActionSelector:Vo,ExtendModelSelector:So,MotionTypeSelector:Uo,ImageMaskInput:Go,TranslationSelector:Xe,AspectRatioSelector:xe},emits:["generate"],computed:{config(){return this.$store.state.veo?.config},consumption(){return pe(this.config,this.service?.cost)},service(){return this.$store.state.veo?.service},isPostProcessing(){return Xo.includes(this.config?.action??"")},isGeneration(){return Yo.includes(this.config?.action??"")}},methods:{onGenerate(){this.$emit("generate")}}}),Qo={class:"flex flex-col h-full"},Ko={class:"flex-1 overflow-y-auto p-5"},Wo={class:"flex flex-col items-center justify-center px-5 pb-5"};function Zo(e,o,v,f,y,V){const c=n("action-selector"),u=n("video-from-input"),s=n("video-id-input"),w=n("upsample-action-selector"),$=n("extend-model-selector"),h=n("prompt-input"),S=n("motion-type-selector"),g=n("image-mask-input"),N=n("translation-selector"),F=n("aspect-ratio-selector"),z=n("model-selector"),B=n("start-end-image"),q=n("consumption"),H=n("font-awesome-icon"),X=n("el-button");return t(),i("div",Qo,[r("div",Ko,[a(c,{class:"mb-4"}),e.isPostProcessing?(t(),i(E,{key:0},[e.config?.video_url?(t(),m(u,{key:0,class:"mb-4"})):d("",!0),a(s,{class:"mb-4"})],64)):d("",!0),e.config?.action==="upsample"?(t(),m(w,{key:1,class:"mb-4"})):d("",!0),e.config?.action==="extend"?(t(),m($,{key:2,class:"mb-4"})):d("",!0),e.config?.action==="extend"?(t(),m(h,{key:3,class:"mb-4"})):d("",!0),e.config?.action==="reshoot"?(t(),m(S,{key:4,class:"mb-4"})):d("",!0),e.config?.action==="object_insert"?(t(),m(h,{key:5,class:"mb-4"})):d("",!0),e.config?.action==="object_insert"||e.config?.action==="object_remove"?(t(),m(g,{key:6,class:"mb-4"})):d("",!0),e.config?.action==="object_remove"?(t(),m(h,{key:7,class:"mb-4"})):d("",!0),e.isGeneration?(t(),i(E,{key:8},[a(N,{class:"mb-4"}),e.config?.action==="image2video"||e.config?.action==="ingredients2video"?(t(),m(F,{key:0,class:"mb-4"})):d("",!0),a(h,{class:"mb-4"}),e.config?.action!=="ingredients2video"?(t(),m(z,{key:1,class:"mb-4"})):d("",!0),e.config?.action==="image2video"||e.config?.action==="ingredients2video"?(t(),m(B,{key:2,class:"mb-2"})):d("",!0)],64)):d("",!0)]),r("div",Wo,[a(q,{value:e.consumption,service:e.service},null,8,["value","service"]),a(X,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:p(()=>[a(H,{icon:"fa-solid fa-magic",class:"mr-2"}),_(" "+l(e.$t("veo.button.generate")),1)]),_:1},8,["onClick"])])])}const xo=k(Jo,[["render",Zo]]),et=b({name:"TaskPreview",components:{ElImage:$e,CopyToClipboard:fe,FontAwesomeIcon:P,ElAlert:he,VideoPlayer:D,ElTooltip:_e,ElButton:U},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.veo?.application},config(){return this.$store.state.veo?.config}},methods:{onPickAction(e,o,v,f){console.debug("seed config from preview",{action:v,upsampleAction:f,response:o}),this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,action:v,video_id:o?.data?.[0]?.id,video_url:o?.data?.[0]?.video_url,...f?{upsample_action:f}:{}})},onDownload(e,o){e.stopPropagation(),console.log("on download"),window.open(o,"_blank")},onOpenVideo(e){window.open(e,"_blank")}}}),ot={class:"preview"},tt={class:"left"},st={class:"main"},nt={class:"bot"},at={class:"datetime"},lt={class:"info"},it={key:0,class:"prompt mt-2"},rt={key:0},ct={key:1},dt={key:0,class:A({content:!0,failed:!0})},ut={key:0,class:"mb-4"},pt={key:1,class:A({operations:!0,"mt-2":!0})},mt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},vt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ft={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},_t={key:1,class:A({content:!0})},ht={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},$t={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},gt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},bt={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},kt={key:2,class:A({content:!0})},yt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Vt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function wt(e,o,v,f,y,V){const c=n("el-image"),u=n("video-player"),s=n("el-button"),w=n("el-tooltip"),$=n("font-awesome-icon"),h=n("copy-to-clipboard"),S=n("el-alert");return t(),i("div",ot,[r("div",tt,[a(c,{src:"https://cdn.acedata.cloud/8nxyy9.jpg",class:"avatar"})]),r("div",st,[r("div",nt,[_(l(e.$t("veo.name.veoBot"))+" ",1),r("span",at,l(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),r("div",lt,[e.modelValue?.request?.prompt?(t(),i("p",it,[_(l(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?d("",!0):(t(),i("span",rt," - ("+l(e.$t("veo.status.pending"))+") ",1)),Array.isArray(e.modelValue?.response?.data)&&e.modelValue?.response?.data[0]?.state==="running"?(t(),i("span",ct," - ("+l(e.$t("veo.status.processing"))+") ",1)):d("",!0)])):d("",!0)]),e.modelValue?.response?.success===!0&&e.modelValue?.response?.data?(t(),i("div",dt,[e.modelValue?.response?.data[0]?.video_url?(t(),i("div",ut,[a(u,{src:e.modelValue?.response?.data[0]?.video_url},null,8,["src"])])):d("",!0),e.modelValue?.response.success?(t(),i("div",pt,[e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:0,type:"info",size:"small",class:"btn-action",onClick:o[0]||(o[0]=g=>e.onPickAction(g,e.modelValue?.response,"upsample","1080p"))},{default:p(()=>[_(l(e.$t("veo.button.actionUpsample1080p")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:1,type:"info",size:"small",class:"btn-action",onClick:o[1]||(o[1]=g=>e.onPickAction(g,e.modelValue?.response,"upsample","4k"))},{default:p(()=>[_(l(e.$t("veo.button.actionUpsample4k")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:2,type:"info",size:"small",class:"btn-action",onClick:o[2]||(o[2]=g=>e.onPickAction(g,e.modelValue?.response,"upsample","gif"))},{default:p(()=>[_(l(e.$t("veo.button.actionUpsampleGif")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:3,type:"info",size:"small",class:"btn-action",onClick:o[3]||(o[3]=g=>e.onPickAction(g,e.modelValue?.response,"extend"))},{default:p(()=>[_(l(e.$t("veo.button.actionExtend")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:4,type:"info",size:"small",class:"btn-action",onClick:o[4]||(o[4]=g=>e.onPickAction(g,e.modelValue?.response,"reshoot"))},{default:p(()=>[_(l(e.$t("veo.button.actionReshoot")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:5,type:"info",size:"small",class:"btn-action",onClick:o[5]||(o[5]=g=>e.onPickAction(g,e.modelValue?.response,"object_insert"))},{default:p(()=>[_(l(e.$t("veo.button.actionObjectInsert")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:6,type:"info",size:"small",class:"btn-action",onClick:o[6]||(o[6]=g=>e.onPickAction(g,e.modelValue?.response,"object_remove"))},{default:p(()=>[_(l(e.$t("veo.button.actionObjectRemove")),1)]),_:1})):d("",!0),a(w,{class:"box-item",effect:"dark",content:e.$t("veo.message.downloadVideo"),placement:"top-start"},{default:p(()=>[e.modelValue?.response?.data[0]?.video_url?(t(),m(s,{key:0,type:"info",size:"small",class:"btn-action",onClick:o[7]||(o[7]=g=>e.onDownload(g,e.modelValue?.response?.data[0]?.video_url))},{default:p(()=>[_(l(e.$t("veo.button.download")),1)]),_:1})):d("",!0)]),_:1},8,["content"])])):d("",!0),a(S,{closable:!1,class:"mt-2 success"},{default:p(()=>[r("p",mt,[a($,{icon:"fa-solid fa-hashtag",class:"mr-1"}),_(" "+l(e.$t("veo.name.model"))+": "+l(e.modelValue?.request?.model),1)]),r("p",vt,[a($,{icon:"fa-solid fa-magic",class:"mr-1"}),_(" "+l(e.$t("veo.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),a(h,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(t(),i("p",ft,[a($,{icon:"fa-solid fa-clock",class:"mr-1"}),_(" "+l(e.$t("veo.name.elapsed"))+": "+l(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):d("",!0)]),_:1})])):d("",!0),e.modelValue?.response?.success===!1?(t(),i("div",_t,[a(S,{closable:!1,class:"failure"},{template:p(()=>[a($,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),_(" "+l(e.$t("veo.name.failure")),1)]),default:p(()=>[r("p",ht,[a($,{icon:"fa-solid fa-magic",class:"mr-1"}),_(" "+l(e.$t("veo.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),a(h,{content:e.modelValue?.id},null,8,["content"])]),r("p",$t,[a($,{icon:"fa-solid fa-circle-info",class:"mr-1"}),_(" "+l(e.$t("veo.name.failureReason"))+": "+l(e.modelValue?.response?.error?.message)+" ",1),a(h,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(t(),i("p",gt,[a($,{icon:"fa-solid fa-clock",class:"mr-1"}),_(" "+l(e.$t("veo.name.elapsed"))+": "+l(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):d("",!0),e.modelValue?.response?.trace_id?(t(),i("p",bt,[a($,{icon:"fa-solid fa-hashtag",class:"mr-1"}),_(" "+l(e.$t("veo.name.traceId"))+": "+l(e.modelValue?.response?.trace_id)+" ",1),a(h,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):d("",!0)]),_:1})])):d("",!0),e.modelValue?.response?.success===void 0?(t(),i("div",kt,[a(S,{closable:!1,class:"info"},{template:p(()=>[a($,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),_(" "+l(e.$t("veo.name.failure")),1)]),default:p(()=>[r("p",yt,[a($,{icon:"fa-solid fa-magic",class:"mr-1"}),_(" "+l(e.$t("veo.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),a(h,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.response?.trace_id?(t(),i("p",Vt,[a($,{icon:"fa-solid fa-hashtag",class:"mr-1"}),_(" "+l(e.$t("veo.name.traceId"))+": "+l(e.modelValue?.response?.trace_id)+" ",1),a(h,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):d("",!0)]),_:1})])):d("",!0)])])}const Et=k(et,[["render",wt],["__scopeId","data-v-83f2991f"]]),It=b({name:"RecentPanel",components:{TaskPreview:Et,NoTasks:be,BotPlaceholder:ge,ScrollList:le},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.veo?.tasks,items:this.$store.state.veo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Tt={key:0},St={key:2,class:"w-full h-full flex items-center justify-center"};function At(e,o,v,f,y,V){const c=n("bot-placeholder"),u=n("task-preview"),s=n("scroll-list"),w=n("no-tasks");return t(),i(E,null,[e.tasks?.items===void 0?(t(),i("div",Tt,[a(c)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(t(),m(s,{key:1,ref:"scrollList",class:"tasks h-full w-full overflow-y-auto",loading:e.loading,onReachTop:o[0]||(o[0]=$=>e.$emit("reach-top"))},{default:p(()=>[(t(!0),i(E,null,T(e.tasks?.items,($,h)=>(t(),m(u,{key:h,"model-value":$},null,8,["model-value"]))),128))]),_:1},8,["loading"])):d("",!0),e.tasks?.items?.length===0?(t(),i("div",St,[a(w)])):d("",!0)],64)}const Ct=k(It,[["render",At]]),Ot="https://webhook.acedata.cloud/veo",Pt=b({name:"VeoIndex",components:{ConfigPanel:xo,Layout:Te,RecentPanel:Ct},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.veo?.status?.getApplications===M.Request},tasksLoading(){return this.$store.state.veo?.status?.getTasks===M.Request||this.fetchingTasks},credential(){return this.$store.state.veo.credential},config(){return this.$store.state.veo.config},tasks(){return this.$store.state.veo.tasks}},watch:{tasks:{handler(e,o){e?.items?.length>o?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ke({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("veo/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("veo/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:o=5,createdAtMin:v,createdAtMax:f}=e||{};console.debug("limit",o,"createdAtMin",v,"createdAtMax",f),this.fetchingTasks=!0;try{await this.$store.dispatch("veo/getTasks",{limit:o,createdAtMin:v,createdAtMax:f})}finally{this.fetchingTasks=!1}},async onGenerate(){const e={...this.config,callback_url:Ot},o=this.credential?.token;if(!o){console.error("no token specified");return}if(e.action==="image2video"&&!(e.image_urls&&e.image_urls.length>0)){I.warning(this.$t("veo.message.imageRequired"));return}(!e.image_urls||e.image_urls.length===0)&&delete e.image_urls,I.info(this.$t("veo.message.startingTask")),K("veo",ve.generate(e,{token:o})).then(()=>{I.success(this.$t("veo.message.startTaskSuccess"))}).catch(v=>{v?.response?.data?.error?.code===me?I.error(this.$t("veo.message.usedUp")):I.error(this.$t("veo.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Ut(e,o,v,f,y,V){const c=n("config-panel"),u=n("recent-panel"),s=n("layout");return t(),m(s,null,{config:p(()=>[a(c,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:p(()=>[a(u,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Ss=k(Pt,[["render",Ut]]);export{Ss as default};
|