@acedatacloud/nexior 3.138.0 → 3.140.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-_LymSVHY.js} +1 -1
- package/dist/assets/{BotPlaceholder-jDf8T7ol.js → BotPlaceholder-BJ5FbY4i.js} +1 -1
- package/dist/assets/{Callback-DpIhEpMc.js → Callback-D8VLVbwT.js} +1 -1
- package/dist/assets/{Console-D5Wc8XjW.js → Console-CG2HSHPy.js} +1 -1
- package/dist/assets/{Consumption-F9vhwk03.js → Consumption-DbcJR769.js} +1 -1
- package/dist/assets/{Conversation-DP1owmgR.css → Conversation-8QQpKxQ2.css} +1 -1
- package/dist/assets/Conversation-qiP7Ljvl.js +25 -0
- package/dist/assets/{CopyToClipboard-UjbBZ_ac.js → CopyToClipboard-SvDri6QJ.js} +1 -1
- package/dist/assets/{Detail-DeALY2Ko.js → Detail-CaZ-hDL7.js} +2 -2
- package/dist/assets/{EditArray-CQCTrb4Y.js → EditArray-CbQP4S-F.js} +1 -1
- package/dist/assets/{Extra-DuPu2cIH.js → Extra-BULn0zDY.js} +1 -1
- package/dist/assets/{FilePreview-LbYKIcSs.js → FilePreview-Cwpu3SIj.js} +1 -1
- package/dist/assets/{History-o0EcSv3q.js → History-CtH_1ws4.js} +1 -1
- package/dist/assets/{IconPark.vue_vue_type_script_setup_true_lang-4YLqaqth.js → IconPark.vue_vue_type_script_setup_true_lang-CgTVojOA.js} +1 -1
- package/dist/assets/{ImagePreview-CLAIXPcM.js → ImagePreview-BO9qxdtw.js} +1 -1
- package/dist/assets/{ImageWrapper-C8ang_Wj.js → ImageWrapper-B52RJa5L.js} +1 -1
- package/dist/assets/{Index-CJ29A5rX.js → Index-1KACE6bz.js} +1 -1
- package/dist/assets/{Index-JE5YYUMV.js → Index-B69Ve09b.js} +1 -1
- package/dist/assets/{Index-D25PMiYa.js → Index-B7rY2idV.js} +1 -1
- package/dist/assets/{Index-CeBegiSh.js → Index-BYcvXPty.js} +1 -1
- package/dist/assets/{Index-DDhCYbL9.js → Index-Bl5aio-K.js} +1 -1
- package/dist/assets/{Index-Cy5DS50I.js → Index-Bw1M_Jfd.js} +1 -1
- package/dist/assets/{Index-DzFcIN7G.js → Index-C8eA4wu8.js} +1 -1
- package/dist/assets/{Index-D8duFiej.js → Index-CMBHe-G0.js} +1 -1
- package/dist/assets/{Index-BURfwB3I.js → Index-Ce_F15ff.js} +1 -1
- package/dist/assets/{Index-DMsHr9rJ.js → Index-D5G8wpCZ.js} +1 -1
- package/dist/assets/{Index-Bbmtgx3l.js → Index-D8cI9nhp.js} +1 -1
- package/dist/assets/{Index-DRPyyBix.js → Index-DG70VeAA.js} +1 -1
- package/dist/assets/{Index-TiP24BFQ.js → Index-DTXHqDrW.js} +1 -1
- package/dist/assets/{Index-D6IAh2bo.js → Index-DmMs4bpd.js} +1 -1
- package/dist/assets/{Index-CEv6yGxY.js → Index-DrFuy0Sc.js} +1 -1
- package/dist/assets/{Index-D9ASCqPb.js → Index-Dy7i1mMI.js} +1 -1
- package/dist/assets/{Index-Bbv5JR8H.js → Index-FS0NwQFu.js} +1 -1
- package/dist/assets/{Index-Dy5wg0fw.js → Index-IOQUEktk.js} +1 -1
- package/dist/assets/{Index-BkdZj0oV.js → Index-ZW0l-gSU.js} +1 -1
- package/dist/assets/{Index-CbHYW1tI.js → Index-eTuQDUed.js} +1 -1
- package/dist/assets/{Index-BYspsqa3.js → Index-iDsCEz7i.js} +1 -1
- package/dist/assets/{Index-F8wnRAUn.js → Index-oD07FM19.js} +1 -1
- package/dist/assets/{Index-C1KDpY6C.js → Index-plSIOh0T.js} +1 -1
- package/dist/assets/{Index-BQnGFOKH.js → Index-whALR0m6.js} +1 -1
- package/dist/assets/{Invitees-B5ed4KTr.js → Invitees-D7z44jFi.js} +1 -1
- package/dist/assets/{List-C7vv74f_.js → List-8YQXVuQf.js} +1 -1
- package/dist/assets/{List-C8qcs0Hp.js → List-BIj3Qdm4.js} +1 -1
- package/dist/assets/{List-lxOJoJK4.js → List-BaUq86Oo.js} +1 -1
- package/dist/assets/{Main-BIzlwttm.js → Main-C1JQ53J6.js} +1 -1
- package/dist/assets/{Navigator-CZjanqUK.js → Navigator-4m9v9-V1.js} +1 -1
- package/dist/assets/{NoTasks-sYq9Zr2G.js → NoTasks-B3OHHyLX.js} +1 -1
- package/dist/assets/{NotFound-BtNPwVRy.js → NotFound-DKHombag.js} +1 -1
- package/dist/assets/{OAuthCallback-CtMLctuA.js → OAuthCallback-DWXJd5LX.js} +1 -1
- package/dist/assets/{Pagination-Ph0T0Z8v.js → Pagination-CE1vXzka.js} +1 -1
- package/dist/assets/{ScrollList-COWNfBjK.js → ScrollList-BdIMpJr2.js} +1 -1
- package/dist/assets/{Status-RsS_AjOU.js → Status-Zg7HPSWQ.js} +1 -1
- package/dist/assets/{Subscribe-CLzay7tc.js → Subscribe-uUIr88Kf.js} +1 -1
- package/dist/assets/{TransportWebHID-_Z-zoQ7l.js → TransportWebHID-BcFo5JW0.js} +1 -1
- package/dist/assets/{VideoPlayer-CzcMT9AZ.js → VideoPlayer-DLau3K08.js} +1 -1
- package/dist/assets/{_Uint8Array-DYoXPfzZ.js → _Uint8Array-d0PfytAk.js} +1 -1
- package/dist/assets/{_baseClone-BHq6vhwI.js → _baseClone-fTTPu5Nv.js} +1 -1
- package/dist/assets/{_baseIteratee-CCpRH0CC.js → _baseIteratee-CbQQ2vi2.js} +1 -1
- package/dist/assets/{_initCloneObject-D8dKrUgV.js → _initCloneObject-BrlQCApt.js} +1 -1
- package/dist/assets/{add-BGXMA_8T.js → add-B93qtnGy.js} +1 -1
- package/dist/assets/{all-wallets-DCYmLWJE.js → all-wallets-DNoBZlZA.js} +1 -1
- package/dist/assets/{app-store-DcNXK_08.js → app-store-D9AI4Dxh.js} +1 -1
- package/dist/assets/{apple--YwSBZ1p.js → apple-BYjbzrtS.js} +1 -1
- package/dist/assets/{arrow-bottom-BWJcxbY1.js → arrow-bottom-BKepjcWR.js} +1 -1
- package/dist/assets/{arrow-bottom-circle-CfhDDcRG.js → arrow-bottom-circle-GkX0k7HO.js} +1 -1
- package/dist/assets/{arrow-left-BZ9eYo63.js → arrow-left-B0sBDTr7.js} +1 -1
- package/dist/assets/{arrow-right-Ce2Q2tqR.js → arrow-right-C1278OeZ.js} +1 -1
- package/dist/assets/{arrow-top-agqLmKzp.js → arrow-top-yFQQo-bC.js} +1 -1
- package/dist/assets/{avatar-C5rMPMQA.js → avatar-C9rdhiY6.js} +1 -1
- package/dist/assets/{bank-DazleBXQ.js → bank-Bk9B55lW.js} +1 -1
- package/dist/assets/{basic-BEd45NJt.js → basic-CpXv-Ouc.js} +1 -1
- package/dist/assets/{browser-CAJChiMD.js → browser-C72wDNfD.js} +1 -1
- package/dist/assets/{byokCredential-DHAgK6la.js → byokCredential-COoNuDGk.js} +1 -1
- package/dist/assets/{card-BN1OJOl7.js → card-ijgyk8uK.js} +1 -1
- package/dist/assets/{castArray-kDnnxK3Y.js → castArray-B4IZIXMJ.js} +1 -1
- package/dist/assets/{chat-DSQB5EZd.js → chat-BreiLx2Y.js} +1 -1
- package/dist/assets/{chat-CSWRFf4v.js → chat-CEFfFUFV.js} +1 -1
- package/dist/assets/chat-hszNYhcY.js +2 -0
- package/dist/assets/{checkmark-DI3hWSni.js → checkmark-BC_u9LvK.js} +1 -1
- package/dist/assets/{checkmark-bold-Wx3_nn8v.js → checkmark-bold-CJTeENay.js} +1 -1
- package/dist/assets/{chevron-bottom-CNHfS4XU.js → chevron-bottom-BLAb99fm.js} +1 -1
- package/dist/assets/{chevron-left-33wOwNSY.js → chevron-left-C-KaZ8Ii.js} +1 -1
- package/dist/assets/{chevron-right-DXC2DAp1.js → chevron-right-CW7obEBt.js} +1 -1
- package/dist/assets/{chevron-top-C6b9DzK6.js → chevron-top-Gwhy1WXI.js} +1 -1
- package/dist/assets/{chrome-store-c28WhCBV.js → chrome-store-D6C_VxZP.js} +1 -1
- package/dist/assets/{clock-DSFmzL5w.js → clock-BZzsJnBh.js} +1 -1
- package/dist/assets/{close-DKeW9KpM.js → close-D5AUrs1t.js} +1 -1
- package/dist/assets/{coinPlaceholder-B06ZmATh.js → coinPlaceholder-Betr_qsF.js} +1 -1
- package/dist/assets/{compass-ESre6PfN.js → compass-C1XwaPjY.js} +1 -1
- package/dist/assets/{copy-CYlCEN_q.js → copy-BRLdvVl1.js} +1 -1
- package/dist/assets/{cursor-N1JE2Bw0.js → cursor-Csz4ImSz.js} +1 -1
- package/dist/assets/{cursor-transparent-CSFf2ehP.js → cursor-transparent-BAeup_qF.js} +1 -1
- package/dist/assets/{debounce-B3qQloOM.js → debounce-BA7XqfxN.js} +1 -1
- package/dist/assets/{desktop-DBhXcxk0.js → desktop-B5qQ-34S.js} +1 -1
- package/dist/assets/{disconnect-C59zYEFS.js → disconnect-ITeinKwI.js} +1 -1
- package/dist/assets/{discord-DXIBRlvC.js → discord-CQuq4CF0.js} +1 -1
- package/dist/assets/{distribution-DT9fOzPO.js → distribution-CrhODU4b.js} +1 -1
- package/dist/assets/{dropdown-CMUX2QKQ.js → dropdown-CNDQXnop.js} +1 -1
- package/dist/assets/{etherscan-DB3HK--R.js → etherscan-DraWsHGP.js} +1 -1
- package/dist/assets/{exclamation-triangle-C1lRCtWt.js → exclamation-triangle-D8XUY8Dn.js} +1 -1
- package/dist/assets/{extension-BOZrGfQI.js → extension-CV4hDiKR.js} +1 -1
- package/dist/assets/{external-link-Cj3_kBJO.js → external-link-Rd2NH-lT.js} +1 -1
- package/dist/assets/{facebook-D6l_0ap0.js → facebook-Do0kYthD.js} +1 -1
- package/dist/assets/{farcaster-ChEQZGBw.js → farcaster-tacff7nd.js} +1 -1
- package/dist/assets/{filters-LpZcVQBi.js → filters-BBkb4u6P.js} +1 -1
- package/dist/assets/{flux-CPR5vnEI.js → flux-6wSvMgLC.js} +1 -1
- package/dist/assets/{github-0Rkb_QWC.js → github-CpcxQW5n.js} +1 -1
- package/dist/assets/{google-DbVZ6Fqy.js → google-C9RSC2CH.js} +1 -1
- package/dist/assets/{hailuo-BLJIV_7y.js → hailuo-BU4hGWPk.js} +1 -1
- package/dist/assets/{headshots-Bx_UIc8L.js → headshots-B7u83Q7g.js} +1 -1
- package/dist/assets/{help-circle-Dmmd_SNC.js → help-circle-CY06i_BS.js} +1 -1
- package/dist/assets/{id-D4BuZaYx.js → id-DaHsBZvc.js} +1 -1
- package/dist/assets/{image-Dx-DY7U2.js → image-DQ4sXWI0.js} +1 -1
- package/dist/assets/{index-DJTe9ay4.js → index-0whYJzw3.js} +1 -1
- package/dist/assets/{index-wOnlnU-2.js → index-31IXHWou.js} +1 -1
- package/dist/assets/{index-D4_8u5Xr.js → index-B2lOppkd.js} +1 -1
- package/dist/assets/{index-BeptfZWv.js → index-B34AK5IJ.js} +1 -1
- package/dist/assets/{index-DKlUKxnB.js → index-B5VThxFx.js} +4 -4
- package/dist/assets/{index-B2zgIuN-.js → index-B8HUVpGf.js} +1 -1
- package/dist/assets/{index-DCjTjFFq.js → index-BC_JWoDT.js} +1 -1
- package/dist/assets/{index-g1qbc9hT.js → index-BG8woF1-.js} +1 -1
- package/dist/assets/{index-DD7PDhJt.js → index-BIKYfCNm.js} +1 -1
- package/dist/assets/{index-JFdmI4KS.js → index-BILP-M8E.js} +1 -1
- package/dist/assets/{index-CDb5I0Er.js → index-BOQt7rnX.js} +1 -1
- package/dist/assets/{index-DFSMTET3.js → index-BUq14ZPa.js} +1 -1
- package/dist/assets/{index-Bk7uGYgD.js → index-B_dZSh1V.js} +1 -1
- package/dist/assets/{index-DWRzkHl-.js → index-B_ur4XP_.js} +1 -1
- package/dist/assets/{index-DEerCStc.js → index-Ba8GdmXg.js} +1 -1
- package/dist/assets/{index-D9-nLyZk.js → index-BcFuJFD4.js} +1 -1
- package/dist/assets/{index-QRqt1QsU.js → index-Bcez2XRv.js} +1 -1
- package/dist/assets/{index-C5k5XrNd.js → index-Be_dGkoS.js} +1 -1
- package/dist/assets/{index-CU7Tkmoe.js → index-Bguan4wd.js} +1 -1
- package/dist/assets/{index-Dyd6KG-o.js → index-Bsa0Z5HA.js} +1 -1
- package/dist/assets/{index-B_59vVR6.js → index-BthUaHYA.js} +1 -1
- package/dist/assets/{index-KYiQ64-R.js → index-Bz6BMWRu.js} +1 -1
- package/dist/assets/{index-mIRybi7_.js → index-C-CXdBJG.js} +1 -1
- package/dist/assets/{index-CDP5BcG3.js → index-C2xIzhRm.js} +1 -1
- package/dist/assets/{index-BeJ6JfNM.js → index-C6VAcwnH.js} +1 -1
- package/dist/assets/{index-4dcAEEAI.js → index-C7Ek_Jhd.js} +1 -1
- package/dist/assets/{index-DugzSlEH.js → index-CAk1ZtSG.js} +1 -1
- package/dist/assets/{index-DP0aQPsL.js → index-CDqYmEPq.js} +1 -1
- package/dist/assets/{index-ByzOFVtn.js → index-CKXwdWS1.js} +1 -1
- package/dist/assets/{index-CW2ML0Zo.js → index-CPQzwH96.js} +1 -1
- package/dist/assets/{index-DldHTE2z.js → index-CUIaVEEQ.js} +1 -1
- package/dist/assets/{index-vn4ig8tm.js → index-CWieNN1E.js} +1 -1
- package/dist/assets/{index-DFloj7qj.js → index-C_u-Xh_j.js} +1 -1
- package/dist/assets/{index-BMDbvDvb.js → index-CcP0tlvX.js} +1 -1
- package/dist/assets/{index-k1IBAXDd.js → index-Cci1tT0O.js} +1 -1
- package/dist/assets/{index-BMRSApyp.js → index-CdSLN7HB.js} +1 -1
- package/dist/assets/{index-Ci2kDHK1.js → index-CixKTx1D.js} +1 -1
- package/dist/assets/{index-B3xHboRT.js → index-D5oeXKkE.js} +1 -1
- package/dist/assets/{index-CMrxr9s5.js → index-D8fds_1u.js} +1 -1
- package/dist/assets/{index-CrrePoOF.js → index-DH9G37nk.js} +1 -1
- package/dist/assets/{index-B6wCkhcv.js → index-DInwVxS4.js} +1 -1
- package/dist/assets/{index-GRDTUL4i.js → index-DNp_zr5x.js} +1 -1
- package/dist/assets/{index-y8_Rqhz8.js → index-DWBo0ly2.js} +1 -1
- package/dist/assets/{index-5lJZrwJi.css → index-DZIBVLbD.css} +1 -1
- package/dist/assets/{index-z4KYoIkr.js → index-DfEh6JbL.js} +1 -1
- package/dist/assets/{index-BnFifvyP.js → index-DlU-8lli.js} +1 -1
- package/dist/assets/{index-D3IlXm3d.js → index-DoWnluw7.js} +1 -1
- package/dist/assets/{index-PP8LGD_B.js → index-DswOcPEa.js} +1 -1
- package/dist/assets/{index-CJJYXPH3.js → index-DxPLAFH3.js} +6 -6
- package/dist/assets/{index-7HuuBLDY.js → index-DxoEG6lW.js} +1 -1
- package/dist/assets/{index-D9fXTOdx.js → index-DxxbHbIm.js} +1 -1
- package/dist/assets/{index-tL2fvVMN.js → index-Dy0qED3w.js} +3 -3
- package/dist/assets/{index-CroNukia.js → index-Egbcg_-M.js} +1 -1
- package/dist/assets/{index-BiWHgAHp.js → index-Mv1rryhx.js} +1 -1
- package/dist/assets/{index-SNhtZZZY.js → index-N-6pnqez.js} +1 -1
- package/dist/assets/{index-BVrGyG9B.js → index-Y6Hpp21c.js} +1 -1
- package/dist/assets/{index-DTZY5KH9.js → index-Z1E1odYA.js} +1 -1
- package/dist/assets/{index-DrmqP8Ga.js → index-_smvFLQP.js} +1 -1
- package/dist/assets/{index-CudWSSy4.js → index-dRUpg9As.js} +1 -1
- package/dist/assets/{index-B4Ov55Re.js → index-jKSTpmaL.js} +1 -1
- package/dist/assets/{index-BRTqKX2j.js → index-oU9_V6oJ.js} +1 -1
- package/dist/assets/{index-CFRgclbH.js → index-osFi-BCF.js} +1 -1
- package/dist/assets/{index-Dxtss4Aw.js → index-y2mM1cgT.js} +1 -1
- package/dist/assets/{index.browser.esm-C4XPCfcW.js → index.browser.esm-DZx_8qLl.js} +1 -1
- package/dist/assets/{index.es-DWP0WL9I.js → index.es-B8_8wmrH.js} +1 -1
- package/dist/assets/{info-DDbQ9AB9.js → info-Bj4o9GoD.js} +1 -1
- package/dist/assets/{info-circle-PMuT3QMW.js → info-circle-CBE6UHzd.js} +1 -1
- package/dist/assets/{isEqual-DGwqaOMZ.js → isEqual-BvJig0uU.js} +1 -1
- package/dist/assets/{isPlainObject-CzIy6uEw.js → isPlainObject-C9zmKCkE.js} +1 -1
- package/dist/assets/{kling-BIWAA77k.js → kling-DWJvDB11.js} +1 -1
- package/dist/assets/{lightbulb-Duxr4J7a.js → lightbulb-xdtRWsiI.js} +1 -1
- package/dist/assets/{luma-vgv1N1AU.js → luma-BQ8tyV3i.js} +1 -1
- package/dist/assets/{mail-C-bKcDjS.js → mail-CE8DuNsx.js} +1 -1
- package/dist/assets/{midjourney-DFmIRaLT.js → midjourney-Cddrv9Xo.js} +1 -1
- package/dist/assets/{mobile-DrQqOJxz.js → mobile-Cv7uklzk.js} +1 -1
- package/dist/assets/{more-wHNaoE-o.js → more-CvrKWk4v.js} +1 -1
- package/dist/assets/{nanobanana-Czv7NSZ9.js → nanobanana-DSIlRYud.js} +1 -1
- package/dist/assets/{network-placeholder-CdEfBd7w.js → network-placeholder-BSbY-_5z.js} +1 -1
- package/dist/assets/{nftPlaceholder-BfhBj2DU.js → nftPlaceholder-D-NECGNr.js} +1 -1
- package/dist/assets/{off-B6Giq2oS.js → off-DpR4B8lE.js} +1 -1
- package/dist/assets/{openaiimage-CPL-k0ta.js → openaiimage-B9UxqgmS.js} +1 -1
- package/dist/assets/{order-C8mb3rj3.js → order-ClaX22ro.js} +1 -1
- package/dist/assets/{pika-BIeozJai.js → pika-v05SyYq8.js} +1 -1
- package/dist/assets/{pixverse-D-aoq3eL.js → pixverse-DjSyVx-S.js} +1 -1
- package/dist/assets/{play-store-DLbZCRda.js → play-store-BugAN8rJ.js} +1 -1
- package/dist/assets/{plus-uG-Jnl_X.js → plus-BhaipuHz.js} +1 -1
- package/dist/assets/{price-BLWWDZIp.js → price-D-PQQgbY.js} +1 -1
- package/dist/assets/{producer-D59483ZS.js → producer-BY35pUwo.js} +1 -1
- package/dist/assets/{qr-code-C-mIdQB9.js → qr-code-CFDziJ7e.js} +1 -1
- package/dist/assets/{qrart-D3KRo_eW.js → qrart-AFGt2xmM.js} +1 -1
- package/dist/assets/{recycle-horizontal-xhmF_zJB.js → recycle-horizontal-DptpMyQ_.js} +1 -1
- package/dist/assets/{refresh-DXIBzwQQ.js → refresh-DsMBrtLt.js} +1 -1
- package/dist/assets/{reown-logo-0hj7lfvM.js → reown-logo-CggG85vM.js} +1 -1
- package/dist/assets/{search-D8BPON0e.js → search-kXX3d3ZC.js} +1 -1
- package/dist/assets/{secp256k1-BYnnD9dN.js → secp256k1-BQNrEMrg.js} +1 -1
- package/dist/assets/{secp256k1-DQVVKY0l.js → secp256k1-D72bvHEY.js} +1 -1
- package/dist/assets/{seedance-hnQutmCk.js → seedance-DCDhpgtJ.js} +1 -1
- package/dist/assets/{seedream-MX_il-6f.js → seedream-Cmgunzu1.js} +1 -1
- package/dist/assets/{send-Caw5detS.js → send-CR0294Ci.js} +1 -1
- package/dist/assets/{service-BOZ_G8ev.js → service-CAd9yoJh.js} +1 -1
- package/dist/assets/{solana-wallets-qwTlbPkW.js → solana-wallets-DHVNhXnl.js} +2 -2
- package/dist/assets/{solana-wallets-vue-yTedoLeg.js → solana-wallets-vue-dS1vBppj.js} +1 -1
- package/dist/assets/{solanaEmbed.esm-CPiwcJGn.js → solanaEmbed.esm-B_3uUCzY.js} +1 -1
- package/dist/assets/{sora-CQJ9mlK7.js → sora-CXr-RfWX.js} +1 -1
- package/dist/assets/{string_decoder-jRfZl5dK.js → string_decoder-Bv1TnyvQ.js} +1 -1
- package/dist/assets/{suno-CX8Vb7de.js → suno-fOp1B614.js} +1 -1
- package/dist/assets/{swapHorizontal-CUwiHAuo.js → swapHorizontal-Bxo1zohh.js} +1 -1
- package/dist/assets/{swapHorizontalBold-CzStE7sA.js → swapHorizontalBold-BoS8aZC6.js} +1 -1
- package/dist/assets/{swapHorizontalMedium-m0KKrGJo.js → swapHorizontalMedium-CFhfc9Gm.js} +1 -1
- package/dist/assets/{swapHorizontalRoundedBold-N3YLtR6L.js → swapHorizontalRoundedBold-Ev1g03EH.js} +1 -1
- package/dist/assets/{swapVertical-QfKCnEff.js → swapVertical-iPxCqeqj.js} +1 -1
- package/dist/assets/{telegram-BomdT1Pr.js → telegram-Dl9BvNpd.js} +1 -1
- package/dist/assets/{three-dots-BX4pRDU5.js → three-dots-Cak17HyR.js} +1 -1
- package/dist/assets/{twitch-DUyuvUlT.js → twitch-CCZ1y_XY.js} +1 -1
- package/dist/assets/{twitterIcon-BbQNR1PA.js → twitterIcon-YEXNg-1W.js} +1 -1
- package/dist/assets/{typescript-DEARewO1.js → typescript-Ch72LBtj.js} +1 -1
- package/dist/assets/{use-form-item-BR1a3Xvf.js → use-form-item-DOEGLSGe.js} +1 -1
- package/dist/assets/validator-DgDQ8pCz.js +1 -0
- package/dist/assets/{veo-B0_jjzRC.js → veo-IaIv3GnY.js} +1 -1
- package/dist/assets/{verify-3Lisxc3k.js → verify-D_sPvM-I.js} +1 -1
- package/dist/assets/{verify-filled-DDZUFx8U.js → verify-filled-CwgDxfrN.js} +1 -1
- package/dist/assets/{w3m-modal-ZorJACpV.js → w3m-modal-E6_oVWC8.js} +1 -1
- package/dist/assets/{wallet-B7s267s2.js → wallet-bvnR7pdh.js} +1 -1
- package/dist/assets/{wallet-placeholder-DA03mR05.js → wallet-placeholder-D0ikURGc.js} +1 -1
- package/dist/assets/{walletconnect-DPcUXR0J.js → walletconnect-O8ZXqM5K.js} +1 -1
- package/dist/assets/{wan-CrFiliGM.js → wan-CMwds55r.js} +1 -1
- package/dist/assets/{warning-circle-z9GWBh3-.js → warning-circle-Ds_ecbxX.js} +1 -1
- package/dist/assets/{web-BfsiDNlq.js → web-BaZ2l6QY.js} +1 -1
- package/dist/assets/{web-D42Ugk3p.js → web-DRdhM3qM.js} +1 -1
- package/dist/assets/{x-Buebc_Mi.js → x-BcZzviI5.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/Conversation-BOhG8w7f.js +0 -25
- package/dist/assets/chat-DMv_1H1X.js +0 -2
- package/dist/assets/validator-395EcdVg.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as C}from"./index.es-DWP0WL9I.js";import{E as D}from"./index-DD7PDhJt.js";import{E as H}from"./index-CMrxr9s5.js";import{d as E,H as i,E as l,z as q,C as s,y as g,D as n,q as a,F as o,I as u,O as y,N as V,x as w,J as $,M as W,Q as A}from"./vendor-vue-NSDaktjZ.js";import{E as k,b7 as K,cA as Z,cB as J,cC as X,cD as Q,cE as Y,cF as ee,cG as te,cH as z,cI as G,cJ as U,cK as P,cL as se,cM as O,cN as oe,cO as F,cd as ae,aw as j}from"./index-DKlUKxnB.js";import{I as L,S as ne}from"./ScrollList-COWNfBjK.js";import{E as re}from"./index-Dyd6KG-o.js";import{p as le}from"./pasteUploadMixin-BurWbGNQ.js";import{I as B}from"./ImagePreview-CLAIXPcM.js";import{E as ie}from"./index-DTZY5KH9.js";import{E as I}from"./index-Ci2kDHK1.js";import{C as ce}from"./Consumption-F9vhwk03.js";import{a as me}from"./price-BLWWDZIp.js";import{E as x,a as N}from"./index-D9-nLyZk.js";import{E as de}from"./index-Bk7uGYgD.js";import{b as ue}from"./errorCode-Cqj9Td_Z.js";import{s as pe}from"./seedream-MX_il-6f.js";import{C as fe}from"./CopyToClipboard-UjbBZ_ac.js";import{I as _e}from"./ImageWrapper-C8ang_Wj.js";import{E as he}from"./index-CW2ML0Zo.js";import{E as ge}from"./index-ByzOFVtn.js";import{E as $e}from"./index-B_59vVR6.js";import{B as ve}from"./BotPlaceholder-jDf8T7ol.js";import{N as be}from"./NoTasks-sYq9Zr2G.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"./typescript-DEARewO1.js";import"./index-B4Ov55Re.js";import"./index-DFloj7qj.js";import"./index-BeJ6JfNM.js";import"./_baseClone-BHq6vhwI.js";import"./_Uint8Array-DYoXPfzZ.js";import"./_initCloneObject-D8dKrUgV.js";import"./isEqual-DGwqaOMZ.js";import"./index-QRqt1QsU.js";import"./strings-beZM2Y-f.js";import"./castArray-kDnnxK3Y.js";import"./debounce-B3qQloOM.js";import"./_baseIteratee-CCpRH0CC.js";import"./index-BMRSApyp.js";import"./index-Cu41y2Fl.js";import"./index-BVrGyG9B.js";const Ee=E({name:"LayoutSeedream",components:{ElDrawer:H,ElButton:D,FontAwesomeIcon:C},data(){return{drawer:!1}}}),ke={class:"main flex flex-row flex-1"},ye={class:"config w-[320px] h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},we={class:"result h-full p-6 flex-1 flex flex-col bg-[var(--app-content-bg)]"};function Se(e,t,d,c,p,f){const _=n("font-awesome-icon"),h=n("el-button"),r=n("el-drawer");return a(),i("div",ke,[l("div",ye,[q(e.$slots,"config",{},void 0,!0)]),l("div",we,[q(e.$slots,"result",{},void 0,!0)]),s(h,{circle:"",class:"menu",onClick:t[0]||(t[0]=m=>e.drawer=!0)},{default:g(()=>[s(_,{icon:"fa-solid fa-magic"})]),_:1}),s(r,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=m=>e.drawer=m),direction:"ltr","with-header":!1,size:"340px",class:"drawer"},{default:g(()=>[q(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Ie=k(Ee,[["render",Se],["__scopeId","data-v-5ff0c320"]]),Ve="",Me=E({name:"SeedreamPromptInput",components:{ElInput:re,InfoIcon:L},computed:{prompt:{get(){return this.$store.state.seedream?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=Ve)}}),Ae={class:"field"},Le={class:"box"},Re={class:"title font-bold"};function Te(e,t,d,c,p,f){const _=n("info-icon"),h=n("el-input");return a(),i("div",Ae,[l("div",Le,[l("h2",Re,o(e.$t("seedream.name.prompt")),1),s(_,{content:e.$t("seedream.description.prompt"),class:"info"},null,8,["content"])]),s(h,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=r=>e.prompt=r),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("seedream.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const Ce=k(Me,[["render",Te],["__scopeId","data-v-5559520a"]]),De=E({name:"SeedreamImageInput",components:{ElUpload:ie,ElButton:D,InfoIcon:L,ImagePreview:B,FontAwesomeIcon:C},mixins:[le],data(){return{fileList:[],uploadUrl:K()+"/api/v1/files/",suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.seedream?.config?.image}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){const c=(this.fileList||[]).filter(p=>!p?.response?.file_url);this.fileList=c.length?c:[];return}const t=[];e.forEach(c=>{const p=this.fileList.find(f=>f?.response?.file_url===c||f?.url===c);p?t.push(p):t.push({name:c.split("/").pop()||c,url:c,status:"success",percentage:100,response:{file_url:c}})}),(this.fileList||[]).filter(c=>!c?.response?.file_url).forEach(c=>{t.some(f=>f===c||f?.url===c?.url||f?.response?.file_url===c?.response?.file_url)||t.push(c)}),this.fileList=t}}},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url=="string"&&e.url.startsWith("blob:"))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImages()},onExceed(){I.warning(this.$t("seedream.message.uploadImageExceed"))},onError(){I.error(this.$t("seedream.message.uploadImageError"))},onSetImages(){const e=this.urls;this.suppressWatch=!0,this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,image:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImages()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url=="string"&&t.url.startsWith("blob:"))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImages()}}}),qe={class:"field"},ze={class:"label"},Ge={class:"box"},Ue={class:"title font-bold"},Pe={class:"value"},Oe={class:"file-list mt-2 flex flex-wrap gap-[10px]"};function je(e,t,d,c,p,f){const _=n("info-icon"),h=n("font-awesome-icon"),r=n("el-button"),m=n("el-upload"),b=n("image-preview");return a(),i(y,null,[l("div",qe,[l("div",ze,[l("div",Ge,[l("h2",Ue,o(e.$t("seedream.name.imageUrls")),1),s(_,{content:e.$t("seedream.description.imageUrls"),class:"info"},null,8,["content"])])]),l("div",Pe,[s(m,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=v=>e.fileList=v),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",limit:14,multiple:!0,"show-file-list":!1,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,"on-change":e.onChange,"on-remove":e.onRemove,headers:e.headers},{default:g(()=>[s(r,{size:"small",type:"primary",round:""},{default:g(()=>[s(h,{icon:"fa-solid fa-upload",class:"mr-1"}),u(" "+o(e.$t("seedream.button.uploadImageUrls")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","on-change","on-remove","headers"])])]),l("div",Oe,[(a(!0),i(y,null,V(e.fileList,(v,S)=>(a(),w(b,{key:v.uid||v?.response?.file_url||v.url||S,url:v.url||v?.response?.file_url,name:v.name,percentage:v.percentage,onRemove:R=>e.onRemovePreview(S,v)},null,8,["url","name","percentage","onRemove"]))),128))])],64)}const Fe=k(De,[["render",je],["__scopeId","data-v-dc18c674"]]),Be=E({name:"SeedreamModelSelector",components:{ElSelect:N,ElOption:x,InfoIcon:L},data(){return{options:[{value:J,label:this.$t("seedream.model.seedream50")},{value:X,label:this.$t("seedream.model.seedream45")},{value:Q,label:this.$t("seedream.model.seedream40")},{value:Y,label:this.$t("seedream.model.seedream30t2i")},{value:ee,label:this.$t("seedream.model.seededit30i2i")}]}},computed:{value:{get(){return this.$store.state.seedream?.config?.model},set(e){this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,model:e})}}},mounted(){this.value||(this.value=Z)}}),xe={class:"field"},Ne={class:"label"},He={class:"box"},We={class:"title font-bold"};function Ke(e,t,d,c,p,f){const _=n("info-icon"),h=n("el-option"),r=n("el-select");return a(),i("div",xe,[l("div",Ne,[l("div",He,[l("h2",We,o(e.$t("seedream.name.model")),1),s(_,{content:e.$t("seedream.description.model"),class:"info"},null,8,["content"])])]),s(r,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=m=>e.value=m),class:"value",placeholder:e.$t("seedream.placeholder.select")},{default:g(()=>[(a(!0),i(y,null,V(e.options,m=>(a(),w(h,{key:m.value,label:m.label,value:m.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Ze=k(Be,[["render",Ke],["__scopeId","data-v-609ade55"]]),Je=E({name:"SeedreamSizeSelector",components:{ElSelect:N,ElOption:x,InfoIcon:L},data(){return{options:[{value:z,label:z},{value:G,label:G},{value:U,label:U},{value:P,label:P}]}},computed:{value:{get(){return this.$store.state.seedream?.config?.size},set(e){this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,size:e})}}},mounted(){this.value||(this.value=te)}}),Xe={class:"field"},Qe={class:"label"},Ye={class:"box"},et={class:"title font-bold"};function tt(e,t,d,c,p,f){const _=n("info-icon"),h=n("el-option"),r=n("el-select");return a(),i("div",Xe,[l("div",Qe,[l("div",Ye,[l("h2",et,o(e.$t("seedream.name.size")),1),s(_,{content:e.$t("seedream.description.size"),class:"info"},null,8,["content"])])]),s(r,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=m=>e.value=m),class:"value",placeholder:e.$t("seedream.placeholder.select"),filterable:"","allow-create":"","default-first-option":""},{default:g(()=>[(a(!0),i(y,null,V(e.options,m=>(a(),w(h,{key:m.value,label:m.label,value:m.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const st=k(Je,[["render",tt],["__scopeId","data-v-44d5c9d9"]]),ot=E({name:"SeedreamMaxImagesSelector",components:{ElInputNumber:de,InfoIcon:L},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return oe(this.config?.model)},referenceImageCount(){const e=this.config?.image;return Array.isArray(e)?e.length:0},effectiveMax(){const e=O-this.referenceImageCount;return Math.max(1,Math.min(O,e))},value:{get(){const e=this.config?.sequential_image_generation_options?.max_images;return typeof e=="number"&&e>=1?e:se},set(e){const t={...this.config||{}},d=Math.max(1,Math.min(this.effectiveMax,Math.floor(e||1)));d>1?(t.sequential_image_generation="auto",t.sequential_image_generation_options={...t.sequential_image_generation_options||{},max_images:d}):(t.sequential_image_generation="disabled",t.sequential_image_generation_options&&delete t.sequential_image_generation_options),this.$store.commit("seedream/setConfig",t)}}},watch:{supported:{immediate:!0,handler(e){if(e)return;const t={...this.config||{}};let d=!1;t.sequential_image_generation&&(delete t.sequential_image_generation,d=!0),t.sequential_image_generation_options&&(delete t.sequential_image_generation_options,d=!0),d&&this.$store.commit("seedream/setConfig",t)}},effectiveMax(e){this.value>e&&(this.value=e)}}}),at={key:0,class:"field"},nt={class:"label"},rt={class:"box"},lt={class:"title font-bold"},it={class:"value"};function ct(e,t,d,c,p,f){const _=n("info-icon"),h=n("el-input-number");return e.supported?(a(),i("div",at,[l("div",nt,[l("div",rt,[l("h2",lt,o(e.$t("seedream.name.maxImages")),1),s(_,{content:e.$t("seedream.description.maxImages"),class:"info"},null,8,["content"])])]),l("div",it,[s(h,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=r=>e.value=r),min:1,max:e.effectiveMax,step:1,size:"default","controls-position":"right",class:"counter"},null,8,["modelValue","max"])])])):$("",!0)}const mt=k(ot,[["render",ct],["__scopeId","data-v-17ef8d1a"]]),dt=E({name:"SeedreamConfigPanel",components:{ElButton:D,FontAwesomeIcon:C,PromptInput:Ce,Consumption:ce,ImageInput:Fe,ModelSelector:Ze,SizeSelector:st,MaxImagesSelector:mt},emits:["generate"],computed:{config(){return this.$store.state.seedream?.config},consumption(){const e={...this.config||{}},t=Array.isArray(e?.image)&&e.image.length>0,d=e?.sequential_image_generation==="auto"?Math.max(1,Math.floor(e?.sequential_image_generation_options?.max_images||1)):1;return me({...e,action:t?"edit":"generate",model:F(e?.model),count:d},this.service?.cost)},service(){return this.$store.state.seedream?.service}},methods:{onGenerate(){this.$emit("generate")}}}),ut={class:"flex flex-col h-full"},pt={class:"flex-1 overflow-y-auto p-5"},ft={class:"flex flex-col items-center justify-center px-5 pb-5"};function _t(e,t,d,c,p,f){const _=n("model-selector"),h=n("size-selector"),r=n("max-images-selector"),m=n("prompt-input"),b=n("image-input"),v=n("consumption"),S=n("font-awesome-icon"),R=n("el-button");return a(),i("div",ut,[l("div",pt,[s(_,{class:"mb-4"}),s(h,{class:"mb-4"}),s(r,{class:"mb-4"}),s(m,{class:"mb-4"}),s(b,{class:"mb-4"})]),l("div",ft,[s(v,{value:e.consumption,service:e.service},null,8,["value","service"]),s(R,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:g(()=>[s(S,{icon:"fa-solid fa-magic",class:"mr-2"}),u(" "+o(e.$t("seedream.button.generate")),1)]),_:1},8,["onClick"])])])}const ht=k(dt,[["render",_t]]),gt=E({name:"SeedreamTaskPreview",components:{ElImage:$e,CopyToClipboard:fe,FontAwesomeIcon:C,ElAlert:ge,ImageWrapper:_e,ElButton:D,ElTooltip:he,ImagePreview:B},props:{modelValue:{type:Object,required:!0}},computed:{isEdit(){return Array.isArray(this.modelValue?.request?.image)&&(this.modelValue?.request?.image?.length||0)>0},images(){const e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{e.push(t)}),e}},methods:{shortModel(e){return F(e)||e},onEdit(e){if(!e)return;console.debug("Edit image:",e);const t={...this.$store.state.seedream?.config||{}};t.image=[e],this.$store.commit("seedream/setConfig",t)}}}),$t={class:"preview"},vt={class:"left"},bt={class:"main"},Et={class:"bot"},kt={class:"datetime"},yt={class:"info"},wt={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},St={key:1,class:"prompt mt-2"},It={key:0},Vt={key:0,class:A({content:!0})},Mt={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},At={key:1,class:A({content:!0,failed:!0})},Lt={class:"flex justify-start items-center gap-4 w-full overflow-x-auto"},Rt={class:A({operations:!0,"mt-2":!0,"mb-2":!0})},Tt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ct={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Dt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},qt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},zt={key:2,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Gt={key:3,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Ut={key:2,class:A({content:!0})},Pt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ot={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},jt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ft={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Bt={key:2,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},xt={key:3,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Nt={key:4,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Ht={key:3,class:A({content:!0})},Wt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Kt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Zt(e,t,d,c,p,f){const _=n("el-image"),h=n("image-preview"),r=n("font-awesome-icon"),m=n("copy-to-clipboard"),b=n("el-alert"),v=n("image-wrapper"),S=n("el-button"),R=n("el-tooltip");return a(),i("div",$t,[l("div",vt,[s(_,{src:"https://cdn.acedata.cloud/9egrbn.png",class:"avatar"})]),l("div",bt,[l("div",Et,[u(o(e.$t("seedream.name.seedreamBot"))+" ",1),l("span",kt,o(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),l("div",yt,[Array.isArray(e.modelValue?.request?.image)&&e.modelValue?.request?.image.length>0?(a(),i("div",wt,[(a(!0),i(y,null,V(e.modelValue?.request?.image,(M,T)=>(a(),w(h,{key:T,url:M,name:`image-${T+1}`,closable:!1},null,8,["url","name"]))),128))])):$("",!0),e.modelValue?.request?.prompt?(a(),i("p",St,[u(o(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?$("",!0):(a(),i("span",It," - ("+o(e.$t("seedream.status.pending"))+") ",1))])):$("",!0)]),e.modelValue?.response?e.modelValue?.response?.success===!0?(a(),i("div",At,[l("div",Lt,[(a(!0),i(y,null,V(e.images,(M,T)=>(a(),w(v,{key:T,src:M?.image_url,"raw-src":M?.image_url},null,8,["src","raw-src"]))),128))]),l("div",Rt,[s(R,{class:"box-item",effect:"dark",content:e.$t("common.button.edit"),placement:"top-start"},{default:g(()=>[s(S,{type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=W(M=>e.onEdit(e.images?.[0]?.image_url),["stop"]))},{default:g(()=>[u(o(e.$t("common.button.edit")),1)]),_:1})]),_:1},8,["content"])]),s(b,{closable:!1,class:"mt-2 success"},{default:g(()=>[e.modelValue?.request?.model?(a(),i("p",Tt,[s(r,{icon:"fa-solid fa-cube",class:"mr-1"}),u(" "+o(e.$t("seedream.name.model"))+": "+o(e.shortModel(e.modelValue?.request?.model)),1)])):$("",!0),e.modelValue?.request?.size?(a(),i("p",Ct,[s(r,{icon:"fa-solid fa-image",class:"mr-1"}),u(" "+o(e.$t("seedream.name.size"))+": "+o(e.modelValue?.request?.size),1)])):$("",!0),l("p",Dt,[s(r,{icon:"fa-solid fa-bolt",class:"mr-1"}),u(" "+o(e.$t("seedream.name.task"))+": "+o(e.isEdit?e.$t("seedream.name.edits"):e.$t("seedream.name.generate")),1)]),l("p",qt,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])]),e.modelValue?.elapsed?(a(),i("p",zt,[s(r,{icon:"fa-solid fa-clock",class:"mr-1"}),u(" "+o(e.$t("seedream.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0),e.modelValue?.response?.trace_id?(a(),i("p",Gt,[s(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),u(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),s(m,{content:e.modelValue?.response?.trace_id,class:"btn-copy inline-block"},null,8,["content"])])):$("",!0)]),_:1})])):e.modelValue?.response?.success===!1?(a(),i("div",Ut,[s(b,{closable:!1,class:"failure"},{template:g(()=>[s(r,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),u(" "+o(e.$t("seedream.name.failure")),1)]),default:g(()=>[e.modelValue?.request?.model?(a(),i("p",Pt,[s(r,{icon:"fa-solid fa-cube",class:"mr-1"}),u(" "+o(e.$t("seedream.name.model"))+": "+o(e.shortModel(e.modelValue?.request?.model)),1)])):$("",!0),e.modelValue?.request?.size?(a(),i("p",Ot,[s(r,{icon:"fa-solid fa-image",class:"mr-1"}),u(" "+o(e.$t("seedream.name.size"))+": "+o(e.modelValue?.request?.size),1)])):$("",!0),l("p",jt,[s(r,{icon:"fa-solid fa-bolt",class:"mr-1"}),u(" "+o(e.$t("seedream.name.task"))+": "+o(e.isEdit?e.$t("seedream.name.edits"):e.$t("seedream.name.generate")),1)]),l("p",Ft,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.response?.error?.message?(a(),i("p",Bt,[s(r,{icon:"fa-solid fa-circle-info",class:"mr-1"}),u(" "+o(e.$t("seedream.name.failureReason"))+": "+o(e.modelValue?.response?.error?.message)+" ",1),s(m,{content:e.modelValue?.response?.error?.message,class:"btn-copy"},null,8,["content"])])):$("",!0),e.modelValue?.elapsed?(a(),i("p",xt,[s(r,{icon:"fa-solid fa-clock",class:"mr-1"}),u(" "+o(e.$t("seedream.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0),e.modelValue?.response?.trace_id?(a(),i("p",Nt,[s(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),u(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),s(m,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])):$("",!0)]),_:1})])):(a(),i("div",Ht,[s(b,{closable:!1,class:"info"},{template:g(()=>[s(r,{icon:"fa-solid fa-circle-info",class:"mr-1"}),u(" "+o(e.$t("seedream.name.status")),1)]),default:g(()=>[l("p",Wt,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.response?.trace_id?(a(),i("p",Kt,[s(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),u(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),s(m,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])):$("",!0)]),_:1})])):(a(),i("div",Vt,[s(b,{closable:!1,class:"info"},{template:g(()=>[s(r,{icon:"fa-regular fa-clock",class:"mr-1"}),u(" "+o(e.$t("seedream.status.pending")),1)]),default:g(()=>[l("p",Mt,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])])]),_:1})]))])])}const Jt=k(gt,[["render",Zt],["__scopeId","data-v-0dfc6a09"]]),Xt=E({name:"SeedreamRecentPanel",components:{TaskPreview:Jt,BotPlaceholder:ve,NoTasks:be,ScrollList:ne},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],computed:{tasks(){return{...this.$store.state.seedream?.tasks,items:this.$store.state.seedream?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Qt={key:0},Yt={key:2,class:"w-full h-full flex items-center justify-center"};function es(e,t,d,c,p,f){const _=n("bot-placeholder"),h=n("task-preview"),r=n("scroll-list"),m=n("no-tasks");return a(),i(y,null,[e.tasks?.items===void 0?(a(),i("div",Qt,[s(_)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(a(),w(r,{key:1,ref:"scrollList",class:"tasks h-full w-full overflow-y-auto",loading:e.loading,onReachTop:t[0]||(t[0]=b=>e.$emit("reach-top"))},{default:g(()=>[(a(!0),i(y,null,V(e.tasks?.items,b=>(a(),w(h,{key:b.id,"model-value":b},null,8,["model-value"]))),128))]),_:1},8,["loading"])):$("",!0),e.tasks?.items?.length===0?(a(),i("div",Yt,[s(m)])):$("",!0)],64)}const ts=k(Xt,[["render",es]]),ss="https://webhook.acedata.cloud/seedream",os=E({name:"SeedreamIndex",components:{ConfigPanel:ht,Layout:Ie,RecentPanel:ts},inject:["initialized"],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.seedream?.status?.getApplications===j.Request},tasksLoading(){return this.$store.state.seedream?.status?.getTasks===j.Request},credential(){return this.$store.state.seedream?.credential},config(){return this.$store.state.seedream?.config},application(){return this.$store.state.seedream?.application},tasks(){return this.$store.state.seedream?.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){if(console.debug("reached top"),this.loading||this.tasksLoading)return;const e=this.tasks?.total,t=this.tasks?.items?.length||0;if(e!==void 0&&e<=t)return;const d=this.tasks?.items?.[0];if(!d?.created_at)return;const p=this.$refs.recentPanel?.getScrollElement?.(),f=p?.scrollHeight||0,_=p?.scrollTop||0;this.loading=!0;try{if(await this.onGetTasks({createdAtMax:d.created_at}),await this.$nextTick(),p){const h=p.scrollHeight;p.scrollTop=h-f+_}}finally{this.loading=!1}},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("seedream/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("seedream/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.tasksLoading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=20,createdAtMin:d,createdAtMax:c}=e||{};console.debug("limit",t,"createdAtMin",d,"createdAtMax",c),await this.$store.dispatch("seedream/getTasks",{limit:t,createdAtMin:d,createdAtMax:c})},async onGenerate(){const e={...this.config||{}};!(Array.isArray(e?.image)&&e.image.length>0)&&"image"in e&&delete e.image,e?.size||delete e.size;const d={...e,callback_url:ss},c=this.credential?.token;if(!c){console.error("no token specified");return}I.info(this.$t("seedream.message.startingTask")),ae("seedream",pe.generate(d,{token:c})).then(()=>{I.success(this.$t("seedream.message.startTaskSuccess"))}).catch(p=>{const f=p?.response?.data;f?.error?.code===ue?I.error(this.$t("seedream.message.usedUp")):I.error(this.$t("seedream.message.startTaskFailed")+(f?.error?.message||""))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function as(e,t,d,c,p,f){const _=n("config-panel"),h=n("recent-panel"),r=n("layout");return a(),w(r,null,{config:g(()=>[s(_,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:g(()=>[s(h,{ref:"recentPanel",loading:e.loading,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Js=k(os,[["render",as]]);export{Js as default};
|
|
1
|
+
import{F as C}from"./index.es-B8_8wmrH.js";import{E as D}from"./index-BIKYfCNm.js";import{E as H}from"./index-D8fds_1u.js";import{d as E,H as i,E as l,z as q,C as s,y as g,D as n,q as a,F as o,I as u,O as y,N as V,x as w,J as $,M as W,Q as A}from"./vendor-vue-NSDaktjZ.js";import{E as k,b7 as K,cA as Z,cB as J,cC as X,cD as Q,cE as Y,cF as ee,cG as te,cH as z,cI as G,cJ as U,cK as P,cL as se,cM as O,cN as oe,cO as F,cd as ae,aw as j}from"./index-B5VThxFx.js";import{I as L,S as ne}from"./ScrollList-BdIMpJr2.js";import{E as re}from"./index-Bsa0Z5HA.js";import{p as le}from"./pasteUploadMixin-BurWbGNQ.js";import{I as B}from"./ImagePreview-BO9qxdtw.js";import{E as ie}from"./index-Z1E1odYA.js";import{E as I}from"./index-CixKTx1D.js";import{C as ce}from"./Consumption-DbcJR769.js";import{a as me}from"./price-D-PQQgbY.js";import{E as x,a as N}from"./index-BcFuJFD4.js";import{E as de}from"./index-B_dZSh1V.js";import{b as ue}from"./errorCode-Cqj9Td_Z.js";import{s as pe}from"./seedream-Cmgunzu1.js";import{C as fe}from"./CopyToClipboard-SvDri6QJ.js";import{I as _e}from"./ImageWrapper-B52RJa5L.js";import{E as he}from"./index-CPQzwH96.js";import{E as ge}from"./index-CKXwdWS1.js";import{E as $e}from"./index-BthUaHYA.js";import{B as ve}from"./BotPlaceholder-BJ5FbY4i.js";import{N as be}from"./NoTasks-B3OHHyLX.js";import"./use-form-item-DOEGLSGe.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-Cvgzdobq.js";import"./vendor-vue-router-Kg6s1a65.js";import"./typescript-Ch72LBtj.js";import"./index-jKSTpmaL.js";import"./index-C_u-Xh_j.js";import"./index-C6VAcwnH.js";import"./_baseClone-fTTPu5Nv.js";import"./_Uint8Array-d0PfytAk.js";import"./_initCloneObject-BrlQCApt.js";import"./isEqual-BvJig0uU.js";import"./index-Bcez2XRv.js";import"./strings-beZM2Y-f.js";import"./castArray-B4IZIXMJ.js";import"./debounce-BA7XqfxN.js";import"./_baseIteratee-CbQQ2vi2.js";import"./index-CdSLN7HB.js";import"./index-Cu41y2Fl.js";import"./index-Y6Hpp21c.js";const Ee=E({name:"LayoutSeedream",components:{ElDrawer:H,ElButton:D,FontAwesomeIcon:C},data(){return{drawer:!1}}}),ke={class:"main flex flex-row flex-1"},ye={class:"config w-[320px] h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},we={class:"result h-full p-6 flex-1 flex flex-col bg-[var(--app-content-bg)]"};function Se(e,t,d,c,p,f){const _=n("font-awesome-icon"),h=n("el-button"),r=n("el-drawer");return a(),i("div",ke,[l("div",ye,[q(e.$slots,"config",{},void 0,!0)]),l("div",we,[q(e.$slots,"result",{},void 0,!0)]),s(h,{circle:"",class:"menu",onClick:t[0]||(t[0]=m=>e.drawer=!0)},{default:g(()=>[s(_,{icon:"fa-solid fa-magic"})]),_:1}),s(r,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=m=>e.drawer=m),direction:"ltr","with-header":!1,size:"340px",class:"drawer"},{default:g(()=>[q(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Ie=k(Ee,[["render",Se],["__scopeId","data-v-5ff0c320"]]),Ve="",Me=E({name:"SeedreamPromptInput",components:{ElInput:re,InfoIcon:L},computed:{prompt:{get(){return this.$store.state.seedream?.config?.prompt},set(e){console.debug("set prompt",e),this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=Ve)}}),Ae={class:"field"},Le={class:"box"},Re={class:"title font-bold"};function Te(e,t,d,c,p,f){const _=n("info-icon"),h=n("el-input");return a(),i("div",Ae,[l("div",Le,[l("h2",Re,o(e.$t("seedream.name.prompt")),1),s(_,{content:e.$t("seedream.description.prompt"),class:"info"},null,8,["content"])]),s(h,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||(t[0]=r=>e.prompt=r),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("seedream.placeholder.prompt")},null,8,["modelValue","placeholder"])])}const Ce=k(Me,[["render",Te],["__scopeId","data-v-5559520a"]]),De=E({name:"SeedreamImageInput",components:{ElUpload:ie,ElButton:D,InfoIcon:L,ImagePreview:B,FontAwesomeIcon:C},mixins:[le],data(){return{fileList:[],uploadUrl:K()+"/api/v1/files/",suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.seedream?.config?.image}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){const c=(this.fileList||[]).filter(p=>!p?.response?.file_url);this.fileList=c.length?c:[];return}const t=[];e.forEach(c=>{const p=this.fileList.find(f=>f?.response?.file_url===c||f?.url===c);p?t.push(p):t.push({name:c.split("/").pop()||c,url:c,status:"success",percentage:100,response:{file_url:c}})}),(this.fileList||[]).filter(c=>!c?.response?.file_url).forEach(c=>{t.some(f=>f===c||f?.url===c?.url||f?.response?.file_url===c?.response?.file_url)||t.push(c)}),this.fileList=t}}},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url=="string"&&e.url.startsWith("blob:"))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImages()},onExceed(){I.warning(this.$t("seedream.message.uploadImageExceed"))},onError(){I.error(this.$t("seedream.message.uploadImageError"))},onSetImages(){const e=this.urls;this.suppressWatch=!0,this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,image:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImages()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url=="string"&&t.url.startsWith("blob:"))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImages()}}}),qe={class:"field"},ze={class:"label"},Ge={class:"box"},Ue={class:"title font-bold"},Pe={class:"value"},Oe={class:"file-list mt-2 flex flex-wrap gap-[10px]"};function je(e,t,d,c,p,f){const _=n("info-icon"),h=n("font-awesome-icon"),r=n("el-button"),m=n("el-upload"),b=n("image-preview");return a(),i(y,null,[l("div",qe,[l("div",ze,[l("div",Ge,[l("h2",Ue,o(e.$t("seedream.name.imageUrls")),1),s(_,{content:e.$t("seedream.description.imageUrls"),class:"info"},null,8,["content"])])]),l("div",Pe,[s(m,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":t[0]||(t[0]=v=>e.fileList=v),accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",name:"file",limit:14,multiple:!0,"show-file-list":!1,action:e.uploadUrl,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,"on-change":e.onChange,"on-remove":e.onRemove,headers:e.headers},{default:g(()=>[s(r,{size:"small",type:"primary",round:""},{default:g(()=>[s(h,{icon:"fa-solid fa-upload",class:"mr-1"}),u(" "+o(e.$t("seedream.button.uploadImageUrls")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","on-change","on-remove","headers"])])]),l("div",Oe,[(a(!0),i(y,null,V(e.fileList,(v,S)=>(a(),w(b,{key:v.uid||v?.response?.file_url||v.url||S,url:v.url||v?.response?.file_url,name:v.name,percentage:v.percentage,onRemove:R=>e.onRemovePreview(S,v)},null,8,["url","name","percentage","onRemove"]))),128))])],64)}const Fe=k(De,[["render",je],["__scopeId","data-v-dc18c674"]]),Be=E({name:"SeedreamModelSelector",components:{ElSelect:N,ElOption:x,InfoIcon:L},data(){return{options:[{value:J,label:this.$t("seedream.model.seedream50")},{value:X,label:this.$t("seedream.model.seedream45")},{value:Q,label:this.$t("seedream.model.seedream40")},{value:Y,label:this.$t("seedream.model.seedream30t2i")},{value:ee,label:this.$t("seedream.model.seededit30i2i")}]}},computed:{value:{get(){return this.$store.state.seedream?.config?.model},set(e){this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,model:e})}}},mounted(){this.value||(this.value=Z)}}),xe={class:"field"},Ne={class:"label"},He={class:"box"},We={class:"title font-bold"};function Ke(e,t,d,c,p,f){const _=n("info-icon"),h=n("el-option"),r=n("el-select");return a(),i("div",xe,[l("div",Ne,[l("div",He,[l("h2",We,o(e.$t("seedream.name.model")),1),s(_,{content:e.$t("seedream.description.model"),class:"info"},null,8,["content"])])]),s(r,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=m=>e.value=m),class:"value",placeholder:e.$t("seedream.placeholder.select")},{default:g(()=>[(a(!0),i(y,null,V(e.options,m=>(a(),w(h,{key:m.value,label:m.label,value:m.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Ze=k(Be,[["render",Ke],["__scopeId","data-v-609ade55"]]),Je=E({name:"SeedreamSizeSelector",components:{ElSelect:N,ElOption:x,InfoIcon:L},data(){return{options:[{value:z,label:z},{value:G,label:G},{value:U,label:U},{value:P,label:P}]}},computed:{value:{get(){return this.$store.state.seedream?.config?.size},set(e){this.$store.commit("seedream/setConfig",{...this.$store.state.seedream?.config,size:e})}}},mounted(){this.value||(this.value=te)}}),Xe={class:"field"},Qe={class:"label"},Ye={class:"box"},et={class:"title font-bold"};function tt(e,t,d,c,p,f){const _=n("info-icon"),h=n("el-option"),r=n("el-select");return a(),i("div",Xe,[l("div",Qe,[l("div",Ye,[l("h2",et,o(e.$t("seedream.name.size")),1),s(_,{content:e.$t("seedream.description.size"),class:"info"},null,8,["content"])])]),s(r,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=m=>e.value=m),class:"value",placeholder:e.$t("seedream.placeholder.select"),filterable:"","allow-create":"","default-first-option":""},{default:g(()=>[(a(!0),i(y,null,V(e.options,m=>(a(),w(h,{key:m.value,label:m.label,value:m.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const st=k(Je,[["render",tt],["__scopeId","data-v-44d5c9d9"]]),ot=E({name:"SeedreamMaxImagesSelector",components:{ElInputNumber:de,InfoIcon:L},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return oe(this.config?.model)},referenceImageCount(){const e=this.config?.image;return Array.isArray(e)?e.length:0},effectiveMax(){const e=O-this.referenceImageCount;return Math.max(1,Math.min(O,e))},value:{get(){const e=this.config?.sequential_image_generation_options?.max_images;return typeof e=="number"&&e>=1?e:se},set(e){const t={...this.config||{}},d=Math.max(1,Math.min(this.effectiveMax,Math.floor(e||1)));d>1?(t.sequential_image_generation="auto",t.sequential_image_generation_options={...t.sequential_image_generation_options||{},max_images:d}):(t.sequential_image_generation="disabled",t.sequential_image_generation_options&&delete t.sequential_image_generation_options),this.$store.commit("seedream/setConfig",t)}}},watch:{supported:{immediate:!0,handler(e){if(e)return;const t={...this.config||{}};let d=!1;t.sequential_image_generation&&(delete t.sequential_image_generation,d=!0),t.sequential_image_generation_options&&(delete t.sequential_image_generation_options,d=!0),d&&this.$store.commit("seedream/setConfig",t)}},effectiveMax(e){this.value>e&&(this.value=e)}}}),at={key:0,class:"field"},nt={class:"label"},rt={class:"box"},lt={class:"title font-bold"},it={class:"value"};function ct(e,t,d,c,p,f){const _=n("info-icon"),h=n("el-input-number");return e.supported?(a(),i("div",at,[l("div",nt,[l("div",rt,[l("h2",lt,o(e.$t("seedream.name.maxImages")),1),s(_,{content:e.$t("seedream.description.maxImages"),class:"info"},null,8,["content"])])]),l("div",it,[s(h,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=r=>e.value=r),min:1,max:e.effectiveMax,step:1,size:"default","controls-position":"right",class:"counter"},null,8,["modelValue","max"])])])):$("",!0)}const mt=k(ot,[["render",ct],["__scopeId","data-v-17ef8d1a"]]),dt=E({name:"SeedreamConfigPanel",components:{ElButton:D,FontAwesomeIcon:C,PromptInput:Ce,Consumption:ce,ImageInput:Fe,ModelSelector:Ze,SizeSelector:st,MaxImagesSelector:mt},emits:["generate"],computed:{config(){return this.$store.state.seedream?.config},consumption(){const e={...this.config||{}},t=Array.isArray(e?.image)&&e.image.length>0,d=e?.sequential_image_generation==="auto"?Math.max(1,Math.floor(e?.sequential_image_generation_options?.max_images||1)):1;return me({...e,action:t?"edit":"generate",model:F(e?.model),count:d},this.service?.cost)},service(){return this.$store.state.seedream?.service}},methods:{onGenerate(){this.$emit("generate")}}}),ut={class:"flex flex-col h-full"},pt={class:"flex-1 overflow-y-auto p-5"},ft={class:"flex flex-col items-center justify-center px-5 pb-5"};function _t(e,t,d,c,p,f){const _=n("model-selector"),h=n("size-selector"),r=n("max-images-selector"),m=n("prompt-input"),b=n("image-input"),v=n("consumption"),S=n("font-awesome-icon"),R=n("el-button");return a(),i("div",ut,[l("div",pt,[s(_,{class:"mb-4"}),s(h,{class:"mb-4"}),s(r,{class:"mb-4"}),s(m,{class:"mb-4"}),s(b,{class:"mb-4"})]),l("div",ft,[s(v,{value:e.consumption,service:e.service},null,8,["value","service"]),s(R,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:g(()=>[s(S,{icon:"fa-solid fa-magic",class:"mr-2"}),u(" "+o(e.$t("seedream.button.generate")),1)]),_:1},8,["onClick"])])])}const ht=k(dt,[["render",_t]]),gt=E({name:"SeedreamTaskPreview",components:{ElImage:$e,CopyToClipboard:fe,FontAwesomeIcon:C,ElAlert:ge,ImageWrapper:_e,ElButton:D,ElTooltip:he,ImagePreview:B},props:{modelValue:{type:Object,required:!0}},computed:{isEdit(){return Array.isArray(this.modelValue?.request?.image)&&(this.modelValue?.request?.image?.length||0)>0},images(){const e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{e.push(t)}),e}},methods:{shortModel(e){return F(e)||e},onEdit(e){if(!e)return;console.debug("Edit image:",e);const t={...this.$store.state.seedream?.config||{}};t.image=[e],this.$store.commit("seedream/setConfig",t)}}}),$t={class:"preview"},vt={class:"left"},bt={class:"main"},Et={class:"bot"},kt={class:"datetime"},yt={class:"info"},wt={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},St={key:1,class:"prompt mt-2"},It={key:0},Vt={key:0,class:A({content:!0})},Mt={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},At={key:1,class:A({content:!0,failed:!0})},Lt={class:"flex justify-start items-center gap-4 w-full overflow-x-auto"},Rt={class:A({operations:!0,"mt-2":!0,"mb-2":!0})},Tt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ct={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Dt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},qt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},zt={key:2,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Gt={key:3,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Ut={key:2,class:A({content:!0})},Pt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ot={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},jt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ft={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Bt={key:2,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},xt={key:3,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Nt={key:4,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Ht={key:3,class:A({content:!0})},Wt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Kt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Zt(e,t,d,c,p,f){const _=n("el-image"),h=n("image-preview"),r=n("font-awesome-icon"),m=n("copy-to-clipboard"),b=n("el-alert"),v=n("image-wrapper"),S=n("el-button"),R=n("el-tooltip");return a(),i("div",$t,[l("div",vt,[s(_,{src:"https://cdn.acedata.cloud/9egrbn.png",class:"avatar"})]),l("div",bt,[l("div",Et,[u(o(e.$t("seedream.name.seedreamBot"))+" ",1),l("span",kt,o(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),l("div",yt,[Array.isArray(e.modelValue?.request?.image)&&e.modelValue?.request?.image.length>0?(a(),i("div",wt,[(a(!0),i(y,null,V(e.modelValue?.request?.image,(M,T)=>(a(),w(h,{key:T,url:M,name:`image-${T+1}`,closable:!1},null,8,["url","name"]))),128))])):$("",!0),e.modelValue?.request?.prompt?(a(),i("p",St,[u(o(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?$("",!0):(a(),i("span",It," - ("+o(e.$t("seedream.status.pending"))+") ",1))])):$("",!0)]),e.modelValue?.response?e.modelValue?.response?.success===!0?(a(),i("div",At,[l("div",Lt,[(a(!0),i(y,null,V(e.images,(M,T)=>(a(),w(v,{key:T,src:M?.image_url,"raw-src":M?.image_url},null,8,["src","raw-src"]))),128))]),l("div",Rt,[s(R,{class:"box-item",effect:"dark",content:e.$t("common.button.edit"),placement:"top-start"},{default:g(()=>[s(S,{type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=W(M=>e.onEdit(e.images?.[0]?.image_url),["stop"]))},{default:g(()=>[u(o(e.$t("common.button.edit")),1)]),_:1})]),_:1},8,["content"])]),s(b,{closable:!1,class:"mt-2 success"},{default:g(()=>[e.modelValue?.request?.model?(a(),i("p",Tt,[s(r,{icon:"fa-solid fa-cube",class:"mr-1"}),u(" "+o(e.$t("seedream.name.model"))+": "+o(e.shortModel(e.modelValue?.request?.model)),1)])):$("",!0),e.modelValue?.request?.size?(a(),i("p",Ct,[s(r,{icon:"fa-solid fa-image",class:"mr-1"}),u(" "+o(e.$t("seedream.name.size"))+": "+o(e.modelValue?.request?.size),1)])):$("",!0),l("p",Dt,[s(r,{icon:"fa-solid fa-bolt",class:"mr-1"}),u(" "+o(e.$t("seedream.name.task"))+": "+o(e.isEdit?e.$t("seedream.name.edits"):e.$t("seedream.name.generate")),1)]),l("p",qt,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])]),e.modelValue?.elapsed?(a(),i("p",zt,[s(r,{icon:"fa-solid fa-clock",class:"mr-1"}),u(" "+o(e.$t("seedream.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0),e.modelValue?.response?.trace_id?(a(),i("p",Gt,[s(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),u(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),s(m,{content:e.modelValue?.response?.trace_id,class:"btn-copy inline-block"},null,8,["content"])])):$("",!0)]),_:1})])):e.modelValue?.response?.success===!1?(a(),i("div",Ut,[s(b,{closable:!1,class:"failure"},{template:g(()=>[s(r,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),u(" "+o(e.$t("seedream.name.failure")),1)]),default:g(()=>[e.modelValue?.request?.model?(a(),i("p",Pt,[s(r,{icon:"fa-solid fa-cube",class:"mr-1"}),u(" "+o(e.$t("seedream.name.model"))+": "+o(e.shortModel(e.modelValue?.request?.model)),1)])):$("",!0),e.modelValue?.request?.size?(a(),i("p",Ot,[s(r,{icon:"fa-solid fa-image",class:"mr-1"}),u(" "+o(e.$t("seedream.name.size"))+": "+o(e.modelValue?.request?.size),1)])):$("",!0),l("p",jt,[s(r,{icon:"fa-solid fa-bolt",class:"mr-1"}),u(" "+o(e.$t("seedream.name.task"))+": "+o(e.isEdit?e.$t("seedream.name.edits"):e.$t("seedream.name.generate")),1)]),l("p",Ft,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.response?.error?.message?(a(),i("p",Bt,[s(r,{icon:"fa-solid fa-circle-info",class:"mr-1"}),u(" "+o(e.$t("seedream.name.failureReason"))+": "+o(e.modelValue?.response?.error?.message)+" ",1),s(m,{content:e.modelValue?.response?.error?.message,class:"btn-copy"},null,8,["content"])])):$("",!0),e.modelValue?.elapsed?(a(),i("p",xt,[s(r,{icon:"fa-solid fa-clock",class:"mr-1"}),u(" "+o(e.$t("seedream.name.elapsed"))+": "+o(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):$("",!0),e.modelValue?.response?.trace_id?(a(),i("p",Nt,[s(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),u(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),s(m,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])):$("",!0)]),_:1})])):(a(),i("div",Ht,[s(b,{closable:!1,class:"info"},{template:g(()=>[s(r,{icon:"fa-solid fa-circle-info",class:"mr-1"}),u(" "+o(e.$t("seedream.name.status")),1)]),default:g(()=>[l("p",Wt,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy"},null,8,["content"])]),e.modelValue?.response?.trace_id?(a(),i("p",Kt,[s(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),u(" "+o(e.$t("seedream.name.traceId"))+": "+o(e.modelValue?.response?.trace_id)+" ",1),s(m,{content:e.modelValue?.response?.trace_id,class:"btn-copy"},null,8,["content"])])):$("",!0)]),_:1})])):(a(),i("div",Vt,[s(b,{closable:!1,class:"info"},{template:g(()=>[s(r,{icon:"fa-regular fa-clock",class:"mr-1"}),u(" "+o(e.$t("seedream.status.pending")),1)]),default:g(()=>[l("p",Mt,[s(r,{icon:"fa-solid fa-magic",class:"mr-1"}),u(" "+o(e.$t("seedream.name.taskId"))+": "+o(e.modelValue?.id)+" ",1),s(m,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])])]),_:1})]))])])}const Jt=k(gt,[["render",Zt],["__scopeId","data-v-0dfc6a09"]]),Xt=E({name:"SeedreamRecentPanel",components:{TaskPreview:Jt,BotPlaceholder:ve,NoTasks:be,ScrollList:ne},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],computed:{tasks(){return{...this.$store.state.seedream?.tasks,items:this.$store.state.seedream?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Qt={key:0},Yt={key:2,class:"w-full h-full flex items-center justify-center"};function es(e,t,d,c,p,f){const _=n("bot-placeholder"),h=n("task-preview"),r=n("scroll-list"),m=n("no-tasks");return a(),i(y,null,[e.tasks?.items===void 0?(a(),i("div",Qt,[s(_)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(a(),w(r,{key:1,ref:"scrollList",class:"tasks h-full w-full overflow-y-auto",loading:e.loading,onReachTop:t[0]||(t[0]=b=>e.$emit("reach-top"))},{default:g(()=>[(a(!0),i(y,null,V(e.tasks?.items,b=>(a(),w(h,{key:b.id,"model-value":b},null,8,["model-value"]))),128))]),_:1},8,["loading"])):$("",!0),e.tasks?.items?.length===0?(a(),i("div",Yt,[s(m)])):$("",!0)],64)}const ts=k(Xt,[["render",es]]),ss="https://webhook.acedata.cloud/seedream",os=E({name:"SeedreamIndex",components:{ConfigPanel:ht,Layout:Ie,RecentPanel:ts},inject:["initialized"],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.seedream?.status?.getApplications===j.Request},tasksLoading(){return this.$store.state.seedream?.status?.getTasks===j.Request},credential(){return this.$store.state.seedream?.credential},config(){return this.$store.state.seedream?.config},application(){return this.$store.state.seedream?.application},tasks(){return this.$store.state.seedream?.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){if(console.debug("reached top"),this.loading||this.tasksLoading)return;const e=this.tasks?.total,t=this.tasks?.items?.length||0;if(e!==void 0&&e<=t)return;const d=this.tasks?.items?.[0];if(!d?.created_at)return;const p=this.$refs.recentPanel?.getScrollElement?.(),f=p?.scrollHeight||0,_=p?.scrollTop||0;this.loading=!0;try{if(await this.onGetTasks({createdAtMax:d.created_at}),await this.$nextTick(),p){const h=p.scrollHeight;p.scrollTop=h-f+_}}finally{this.loading=!1}},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("seedream/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("seedream/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.tasksLoading){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=20,createdAtMin:d,createdAtMax:c}=e||{};console.debug("limit",t,"createdAtMin",d,"createdAtMax",c),await this.$store.dispatch("seedream/getTasks",{limit:t,createdAtMin:d,createdAtMax:c})},async onGenerate(){const e={...this.config||{}};!(Array.isArray(e?.image)&&e.image.length>0)&&"image"in e&&delete e.image,e?.size||delete e.size;const d={...e,callback_url:ss},c=this.credential?.token;if(!c){console.error("no token specified");return}I.info(this.$t("seedream.message.startingTask")),ae("seedream",pe.generate(d,{token:c})).then(()=>{I.success(this.$t("seedream.message.startTaskSuccess"))}).catch(p=>{const f=p?.response?.data;f?.error?.code===ue?I.error(this.$t("seedream.message.usedUp")):I.error(this.$t("seedream.message.startTaskFailed")+(f?.error?.message||""))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function as(e,t,d,c,p,f){const _=n("config-panel"),h=n("recent-panel"),r=n("layout");return a(),w(r,null,{config:g(()=>[s(_,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:g(()=>[s(h,{ref:"recentPanel",loading:e.loading,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Js=k(os,[["render",as]]);export{Js 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-B8_8wmrH.js";import{E as L}from"./index-BIKYfCNm.js";import{E as me}from"./index-D8fds_1u.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-B5VThxFx.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-BcFuJFD4.js";import{E as q}from"./index-BUq14ZPa.js";import{E as C}from"./index-CixKTx1D.js";import{I as S,S as Le}from"./ScrollList-BdIMpJr2.js";import{E as H}from"./index-DswOcPEa.js";import{p as W}from"./pasteUploadMixin-BurWbGNQ.js";import{I as G}from"./ImagePreview-BO9qxdtw.js";import{E as J}from"./index-CPQzwH96.js";import{E as K}from"./index-Z1E1odYA.js";import{C as pe}from"./Consumption-DbcJR769.js";import{E as ue}from"./index-B_dZSh1V.js";import{E as ge}from"./index-BG8woF1-.js";import{E as Q}from"./index-Bsa0Z5HA.js";import{a as fe}from"./price-D-PQQgbY.js";import{F as Me}from"./FilePreview-Cwpu3SIj.js";import{E as Ue,a as Re}from"./index-CcP0tlvX.js";import{E as Ae,a as Pe}from"./index-_smvFLQP.js";import{b as se}from"./errorCode-Cqj9Td_Z.js";import{k as ie}from"./kling-DWJvDB11.js";import{C as De}from"./CopyToClipboard-SvDri6QJ.js";import{V as Ge}from"./VideoPlayer-DLau3K08.js";import{E as Ke}from"./index-CKXwdWS1.js";import{E as Oe}from"./index-BthUaHYA.js";import{B as je}from"./BotPlaceholder-BJ5FbY4i.js";import{N as Ne}from"./NoTasks-B3OHHyLX.js";import{l as Be}from"./pagination-Cnc6Oeyx.js";import"./use-form-item-DOEGLSGe.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-Cvgzdobq.js";import"./vendor-vue-router-Kg6s1a65.js";import"./index-Bcez2XRv.js";import"./typescript-Ch72LBtj.js";import"./index-jKSTpmaL.js";import"./strings-beZM2Y-f.js";import"./isEqual-BvJig0uU.js";import"./_Uint8Array-d0PfytAk.js";import"./castArray-B4IZIXMJ.js";import"./debounce-BA7XqfxN.js";import"./_baseIteratee-CbQQ2vi2.js";import"./index-CdSLN7HB.js";import"./validator-DgDQ8pCz.js";import"./index-C6VAcwnH.js";import"./_baseClone-fTTPu5Nv.js";import"./_initCloneObject-BrlQCApt.js";import"./index-Cu41y2Fl.js";import"./index-C_u-Xh_j.js";import"./isPlainObject-C9zmKCkE.js";import"./vue-plyr-BO2nlN4c.js";import"./index-Y6Hpp21c.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};
|