@acedatacloud/nexior 3.190.0 → 3.191.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-DsRzEF-A.js → Auth-BFU8r34W.js} +1 -1
- package/dist/assets/{BotPlaceholder-Dvz4ZRyu.js → BotPlaceholder-CrP_V5ek.js} +1 -1
- package/dist/assets/{Callback-DbFOP0XD.js → Callback-CcivAFip.js} +1 -1
- package/dist/assets/{Console-BbYXorE8.js → Console-U9cS95Rk.js} +1 -1
- package/dist/assets/{Consumption-CqJZN5qA.js → Consumption-BhUnYfB3.js} +1 -1
- package/dist/assets/{Conversation-9uISrZWz.js → Conversation-BvfUpnOM.js} +3 -3
- package/dist/assets/CopyToClipboard-UbVnHanv.js +1 -0
- package/dist/assets/{Detail-B4dPn8SD.js → Detail-DGKskwcs.js} +2 -2
- package/dist/assets/{Extra-BTaDne-2.js → Extra-8_UUhbHy.js} +1 -1
- package/dist/assets/{FilePreview-C7fg38oZ.js → FilePreview-BD5s8QX7.js} +1 -1
- package/dist/assets/{History-DQAlCKbA.js → History-eQiC9a3p.js} +1 -1
- package/dist/assets/{IconPark.vue_vue_type_script_setup_true_lang-DV6vInhi.js → IconPark.vue_vue_type_script_setup_true_lang-4Uv6_7cA.js} +1 -1
- package/dist/assets/{ImagePreview-DI2VeDuz.js → ImagePreview-CkZKsGAi.js} +1 -1
- package/dist/assets/{ImageWrapper-Bb5Cfmy8.js → ImageWrapper-D3H8cAAM.js} +1 -1
- package/dist/assets/{Index-u19OPGhB.js → Index-89SvVASp.js} +1 -1
- package/dist/assets/{Index-DDfX0Yvs.js → Index-9mSaKlud.js} +2 -2
- package/dist/assets/{Index-Zx4mo3l2.js → Index-B5m-UkM6.js} +1 -1
- package/dist/assets/{Index-CTH6LGw3.js → Index-B6KB9903.js} +1 -1
- package/dist/assets/{Index-DiTST8P2.js → Index-BMUxhqoj.js} +1 -1
- package/dist/assets/{Index-BQdDBGCJ.js → Index-BPfaAhiB.js} +1 -1
- package/dist/assets/{Index-imQtgdZZ.js → Index-BjhATBqn.js} +1 -1
- package/dist/assets/{Index-DGJQBkeT.js → Index-ByXkUtOG.js} +1 -1
- package/dist/assets/{Index-DTZk84O7.js → Index-Bzf1odlG.js} +1 -1
- package/dist/assets/{Index-Bnf0xC9l.js → Index-BzzFdNvj.js} +1 -1
- package/dist/assets/{Index-D7JsknEv.js → Index-C6tftHAC.js} +1 -1
- package/dist/assets/{Index-lO8rWCJO.js → Index-C7X6NkKq.js} +1 -1
- package/dist/assets/{Index-DADCdGOp.js → Index-C9wdofAS.js} +1 -1
- package/dist/assets/Index-CJVCcWQA.js +1 -0
- package/dist/assets/{Index-CGrHVkki.js → Index-CQB_QYmV.js} +1 -1
- package/dist/assets/{Index-BHRZHgAa.js → Index-CbrqhE0f.js} +1 -1
- package/dist/assets/{Index-DvLMYEGC.js → Index-Chy3JGER.js} +1 -1
- package/dist/assets/{Index-5JNr6CWN.js → Index-Cl0icRGx.js} +1 -1
- package/dist/assets/{Index-DOkwpjfQ.js → Index-Cu42ri4Q.js} +1 -1
- package/dist/assets/{Index-Day9QMVl.js → Index-DDv75trO.js} +1 -1
- package/dist/assets/{Index-WDEKIcad.js → Index-DNP4snaT.js} +1 -1
- package/dist/assets/{Index-yX6fDSsH.js → Index-DiTQXOkX.js} +1 -1
- package/dist/assets/{Index-Ch-My3hi.js → Index-H8-ffMat.js} +1 -1
- package/dist/assets/{Index-szE0VC5Q.js → Index-In15RvhQ.js} +1 -1
- package/dist/assets/{Invitees-oE6OGwLk.js → Invitees-CPzH_YNo.js} +1 -1
- package/dist/assets/{List-BaeFn2dx.js → List-BM0X5Rkl.js} +1 -1
- package/dist/assets/List-BSLO7QUM.js +1 -0
- package/dist/assets/{List-CpTbr1_N.js → List-ETPq5oXU.js} +1 -1
- package/dist/assets/{Main-QR8cN_ch.js → Main-B_DCZN4j.js} +1 -1
- package/dist/assets/{Navigator-Dl5wBgej.js → Navigator-BQ7f448x.js} +1 -1
- package/dist/assets/{NoTasks-CllJt2H1.js → NoTasks-Dh1gQ2Mu.js} +1 -1
- package/dist/assets/{NotFound-BvN79fJI.js → NotFound-BpKfoyHp.js} +1 -1
- package/dist/assets/{OAuthCallback-BScp3oEA.js → OAuthCallback-DMreTmla.js} +1 -1
- package/dist/assets/Pagination-BH7rEPOQ.js +1 -0
- package/dist/assets/{Status-qGKdp5kC.js → Status-THQIlGZ1.js} +1 -1
- package/dist/assets/{Subscribe-Co1AzMMB.js → Subscribe-SKbubzNp.js} +1 -1
- package/dist/assets/{VideoPlayer-CO6S65En.js → VideoPlayer-BU0YUM_I.js} +1 -1
- package/dist/assets/{_Uint8Array-D_wulyVe.js → _Uint8Array-VDaSlXRk.js} +1 -1
- package/dist/assets/{_baseClone-BHIkIKEe.js → _baseClone-D1YwQEy7.js} +1 -1
- package/dist/assets/{_baseIteratee-De-W5dn-.js → _baseIteratee-Dwd75Nk1.js} +1 -1
- package/dist/assets/{_initCloneObject-CHBLIg3i.js → _initCloneObject-D6RxkML8.js} +1 -1
- package/dist/assets/{add-VRLKqVgA.js → add-D72y_MuI.js} +1 -1
- package/dist/assets/{all-wallets-ChjFDjUA.js → all-wallets-YllKewu7.js} +1 -1
- package/dist/assets/{app-store-D6UDJpT4.js → app-store-8uGrt-sc.js} +1 -1
- package/dist/assets/{apple-Bx2QMiW1.js → apple-BWeWx4SR.js} +1 -1
- package/dist/assets/{arrow-bottom-BQSiLZDw.js → arrow-bottom-CLp5hmJo.js} +1 -1
- package/dist/assets/{arrow-bottom-circle-D9zVls79.js → arrow-bottom-circle-BQQDY4_K.js} +1 -1
- package/dist/assets/{arrow-left-D_Q4SSEg.js → arrow-left-Ctb0kQDl.js} +1 -1
- package/dist/assets/{arrow-right-BGji2c6z.js → arrow-right-D7t76WoK.js} +1 -1
- package/dist/assets/{arrow-top-bx_mnx3k.js → arrow-top-6fU6e837.js} +1 -1
- package/dist/assets/{avatar-D2v8nOab.js → avatar-BhARhvTB.js} +1 -1
- package/dist/assets/{bank-O97FjYMk.js → bank-B7E1myE8.js} +1 -1
- package/dist/assets/{basic-Bk-WmzAO.js → basic-CgcDnYsO.js} +1 -1
- package/dist/assets/{browser-8PursVYL.js → browser-DdxyinH1.js} +1 -1
- package/dist/assets/{byokCredential-0JRi42Dr.js → byokCredential-DuZIqxyR.js} +1 -1
- package/dist/assets/{card-4XycQbsf.js → card-BCZKQZR-.js} +1 -1
- package/dist/assets/{castArray-D0mKqyiV.js → castArray-XMTACVks.js} +1 -1
- package/dist/assets/{chat-7CfS5SWy.js → chat-B4USEUzn.js} +1 -1
- package/dist/assets/{checkmark-CZ55R0Va.js → checkmark-Cp--3ch7.js} +1 -1
- package/dist/assets/{checkmark-bold-D0xlcqsf.js → checkmark-bold-CB7xAEu0.js} +1 -1
- package/dist/assets/{chevron-bottom-C9HRPT73.js → chevron-bottom-qDPnRY6w.js} +1 -1
- package/dist/assets/{chevron-left-DJMJG1sJ.js → chevron-left-D5XL0Bqj.js} +1 -1
- package/dist/assets/{chevron-right-CUKMUTDL.js → chevron-right-Dk5IXII6.js} +1 -1
- package/dist/assets/{chevron-top-CnUnV2ZE.js → chevron-top-D5O0DMED.js} +1 -1
- package/dist/assets/{chrome-store-4gz7pfVS.js → chrome-store-DxkNQwms.js} +1 -1
- package/dist/assets/{clock-Do0BNPNX.js → clock-yuuv28gX.js} +1 -1
- package/dist/assets/{close-B9NA7BaP.js → close-2PH95bv2.js} +1 -1
- package/dist/assets/{coinPlaceholder-DrI94kf9.js → coinPlaceholder-CEd1CkSq.js} +1 -1
- package/dist/assets/{compass-eV-8YJKM.js → compass-PE-2PiAX.js} +1 -1
- package/dist/assets/{copy-K3areOya.js → copy-Bgq9NMUP.js} +1 -1
- package/dist/assets/{createTaskActions-rH43I3Rp.js → createTaskActions-BPr49f-c.js} +1 -1
- package/dist/assets/{cursor-BtP4h95C.js → cursor-BYUmAvDP.js} +1 -1
- package/dist/assets/{cursor-transparent-tIAUMKt0.js → cursor-transparent-B04wkDZn.js} +1 -1
- package/dist/assets/debounce-BrYZ7_Ce.js +1 -0
- package/dist/assets/{desktop-Btx3STOq.js → desktop-rL__oBpb.js} +1 -1
- package/dist/assets/{disconnect-DRIA8B2y.js → disconnect-D3Dy7AuL.js} +1 -1
- package/dist/assets/{discord-B2V9RMfm.js → discord-DsEY_DJf.js} +1 -1
- package/dist/assets/{distribution-BkV7txSr.js → distribution-BQPTYLMk.js} +1 -1
- package/dist/assets/{dropdown-DJJ8eNjS.js → dropdown-DqLZ1-Vk.js} +1 -1
- package/dist/assets/{etherscan-CAiWSkrC.js → etherscan-BzIWP2oB.js} +1 -1
- package/dist/assets/{exclamation-triangle-DXKWIWle.js → exclamation-triangle-BlRXGNza.js} +1 -1
- package/dist/assets/{extension-DrpmQnXj.js → extension-C--503S4.js} +1 -1
- package/dist/assets/{external-link-D_AGWO4T.js → external-link-DA7xbncY.js} +1 -1
- package/dist/assets/{facebook-BaHSzLNe.js → facebook-BvO0COV8.js} +1 -1
- package/dist/assets/{farcaster-BVDQnLYv.js → farcaster-FJ4UO8Mh.js} +1 -1
- package/dist/assets/{filters-CEWrTcBI.js → filters-1SndfMQ8.js} +1 -1
- package/dist/assets/{github-Cah0OfLr.js → github-Cl5eTTzH.js} +1 -1
- package/dist/assets/{google-Bvsc7AbU.js → google-DvtY3w82.js} +1 -1
- package/dist/assets/{help-circle-CCxgtiMV.js → help-circle-DK4pElns.js} +1 -1
- package/dist/assets/{id-DL_kHf7y.js → id-D0BYZoJL.js} +1 -1
- package/dist/assets/{image-0_CQQsr8.js → image-DL-QxVhU.js} +1 -1
- package/dist/assets/{index-ps8GwsYU.js → index-B1dDWmoe.js} +1 -1
- package/dist/assets/{index-MVUWjEzl.js → index-B7q2j4Jq.js} +1 -1
- package/dist/assets/{index-DEv50S0G.js → index-BBi-Qo59.js} +1 -1
- package/dist/assets/{index-B3udtDQ0.js → index-BE0R6xyB.js} +3 -3
- package/dist/assets/{index-eNzrREFl.js → index-BFlG4wVb.js} +2 -2
- package/dist/assets/{index-K-oKZ-Oj.js → index-BIpBh34w.js} +1 -1
- package/dist/assets/{index-CQc9N-Uf.js → index-BNAXDrzd.js} +1 -1
- package/dist/assets/{index-CTctmeBw.js → index-BVzdLYdD.js} +1 -1
- package/dist/assets/{index-BFugXjgS.js → index-BaDopqvF.js} +1 -1
- package/dist/assets/{index-X-pA25HA.js → index-BeBTVXHV.js} +1 -1
- package/dist/assets/{index-CXZ2Kfo8.js → index-BhTb9fft.js} +1 -1
- package/dist/assets/{index-D10rXXmt.js → index-BhtHfUyq.js} +1 -1
- package/dist/assets/{index-DabXT8SU.js → index-Bir55vdU.js} +1 -1
- package/dist/assets/{index-B6LE-QrJ.js → index-BjwW016f.js} +1 -1
- package/dist/assets/{index-CrbnwRTo.js → index-Blp6nV-G.js} +5 -5
- package/dist/assets/{index-Dg3ihhnp.js → index-Bm4NB24j.js} +1 -1
- package/dist/assets/index-BshrH4mQ.js +1 -0
- package/dist/assets/{index-CiptUuV6.js → index-Bu0RJ9kR.js} +1 -1
- package/dist/assets/{index-CQXejj_Q.js → index-C3VomJKX.js} +1 -1
- package/dist/assets/{index-B6agP-Ra.js → index-C6-cjUfP.js} +1 -1
- package/dist/assets/index-C8i3BVbr.js +1 -0
- package/dist/assets/{index-BFzFBs_v.js → index-CEN8LKyF.js} +1 -1
- package/dist/assets/index-CGyDhzQ2.js +1 -0
- package/dist/assets/{index-DyX8xVPk.js → index-CJb_iPHR.js} +1 -1
- package/dist/assets/index-CLoBOm_T.js +1 -0
- package/dist/assets/{index-DUsafIiO.js → index-CM4nkCTV.js} +1 -1
- package/dist/assets/{index-D38caUdO.js → index-CN230R6D.js} +14 -14
- package/dist/assets/{index-CVSIXY8y.js → index-CRljgcPl.js} +1 -1
- package/dist/assets/{index-Blbf_79n.js → index-CYVWs9za.js} +1 -1
- package/dist/assets/index-CYeSxpcT.js +1 -0
- package/dist/assets/{index-Dt4BllUK.js → index-C_NNhcSN.js} +1 -1
- package/dist/assets/{index-CuVSy9S3.js → index-Cc79uzb6.js} +1 -1
- package/dist/assets/{index-D5kahTrl.js → index-CiOCQxy8.js} +1 -1
- package/dist/assets/{index-B007Wze9.js → index-CiRXmZS2.js} +1 -1
- package/dist/assets/{index-7fl1tK2h.js → index-CjQdKt6A.js} +1 -1
- package/dist/assets/index-ClC7QS_0.js +1 -0
- package/dist/assets/{index-BLAL1cr3.js → index-CuSfd4sz.js} +1 -1
- package/dist/assets/index-CziznbF0.js +1 -0
- package/dist/assets/{index-C1WeknGf.js → index-D0wq8uBN.js} +1 -1
- package/dist/assets/{index-DiDpFoq1.js → index-D6vuY3iJ.js} +1 -1
- package/dist/assets/{index-C2-gYDP0.js → index-DAv3rLeE.js} +1 -1
- package/dist/assets/{index-DbqmmmL8.js → index-DBQ7pxm0.js} +1 -1
- package/dist/assets/{index-C1ZfhX9x.js → index-DHYWAeqB.js} +1 -1
- package/dist/assets/{index-CgG9sIq6.js → index-DIUahV-h.js} +1 -1
- package/dist/assets/{index-DiPt_s2Y.js → index-DIdnLYWg.js} +1 -1
- package/dist/assets/index-DNRZxhyN.js +1 -0
- package/dist/assets/{index-CW80M4ve.js → index-DVwYx71J.js} +1 -1
- package/dist/assets/{index-BLgDmRII.js → index-DYWhE5KE.js} +1 -1
- package/dist/assets/index-Dg-7bpPq.js +1 -0
- package/dist/assets/{index-xveWH-Nj.js → index-Dmd3jQlg.js} +1 -1
- package/dist/assets/index-DsLRtP6j.js +1 -0
- package/dist/assets/{index-DF98wF07.js → index-Dv6Z30am.js} +1 -1
- package/dist/assets/{index-D59mR4BE.js → index-RstguZj7.js} +1 -1
- package/dist/assets/{index-kaZTZEIU.js → index-WlQTZP26.js} +1 -1
- package/dist/assets/{index-DNFN_ZFy.js → index-YBwyc48X.js} +1 -1
- package/dist/assets/{index-BkIKsx60.js → index-ZnDITjB5.js} +1 -1
- package/dist/assets/{index-DWhkWr6k.js → index-aKG5qBvI.js} +1 -1
- package/dist/assets/{index-C21TcEmh.js → index-cvQIu1l_.js} +1 -1
- package/dist/assets/{index-41FllExt.js → index-rQjoe_n5.js} +1 -1
- package/dist/assets/index-unzen9LK.js +1 -0
- package/dist/assets/{index.browser.esm-BbrFEb7D.js → index.browser.esm-CWpBNtXv.js} +1 -1
- package/dist/assets/{index.es-BLmzEmO2.js → index.es-GrqLuAny.js} +1 -1
- package/dist/assets/{info-0Y7zB6qe.js → info-C0h_ypDr.js} +1 -1
- package/dist/assets/{info-circle-B06P3h-i.js → info-circle-B3V3VKM6.js} +1 -1
- package/dist/assets/{isEqual-BVkGIvMj.js → isEqual-GWUuPjg7.js} +1 -1
- package/dist/assets/{isPlainObject-JrN91JkA.js → isPlainObject-C1JDgF-H.js} +1 -1
- package/dist/assets/{lightbulb-DXFj51Bn.js → lightbulb-C5WAEr0b.js} +1 -1
- package/dist/assets/{mail-Dhl2aAgA.js → mail-Dr-aaC6Y.js} +1 -1
- package/dist/assets/{midjourney-Y1hXwnQ4.js → midjourney-BTdSxN9h.js} +1 -1
- package/dist/assets/{mobile-ChptfvPa.js → mobile-Cozv0U-Z.js} +1 -1
- package/dist/assets/{more-CEqu1qMB.js → more-DYomjT4j.js} +1 -1
- package/dist/assets/{network-placeholder-BzE7kn9Q.js → network-placeholder-CRPaUime.js} +1 -1
- package/dist/assets/{nftPlaceholder-sJ-iFLyd.js → nftPlaceholder-DV6XF1Sk.js} +1 -1
- package/dist/assets/{off-lz1wJcwp.js → off-w5OS8yCI.js} +1 -1
- package/dist/assets/{order-WVFpG4EB.js → order-BKjD5zC1.js} +1 -1
- package/dist/assets/{pagination-C2o1t_-2.js → pagination-Dd7b5MDO.js} +1 -1
- package/dist/assets/{play-store-D42theHi.js → play-store-DOlyDF2h.js} +1 -1
- package/dist/assets/{plus-DANqTyGB.js → plus-D9Xq0pQk.js} +1 -1
- package/dist/assets/{price-BCBGswr1.js → price-D8EZsjEA.js} +1 -1
- package/dist/assets/{producer-ComYq25-.js → producer-BAXvHwXb.js} +1 -1
- package/dist/assets/{qr-code-BzXspjlj.js → qr-code-ZrbhTRd5.js} +1 -1
- package/dist/assets/{recycle-horizontal-DIyS2g4Z.js → recycle-horizontal-DjhiCoYP.js} +1 -1
- package/dist/assets/{refresh-mJSc9hkL.js → refresh-6ZC4uuUO.js} +1 -1
- package/dist/assets/{reown-logo-JMgx9S3z.js → reown-logo-C-BVfOgA.js} +1 -1
- package/dist/assets/{search-09fyDb4m.js → search-2cyYZX5L.js} +1 -1
- package/dist/assets/{secp256k1-DsE_DX-J.js → secp256k1-CKnNWiNU.js} +1 -1
- package/dist/assets/{secp256k1-ByjlwJcU.js → secp256k1-bV-zluaN.js} +1 -1
- package/dist/assets/{seedream-BzzDoMFn.js → seedream-Dw7T0f0L.js} +1 -1
- package/dist/assets/{send-28AlCo4N.js → send-CkAG6cCr.js} +1 -1
- package/dist/assets/{service-wJx-cFTZ.js → service-COGqr98d.js} +1 -1
- package/dist/assets/{solana-wallets-Cx87nT9h.js → solana-wallets-C-wKLsvH.js} +2 -2
- package/dist/assets/{solana-wallets-vue-BWEeX4il.js → solana-wallets-vue-CIrBQ5xN.js} +1 -1
- package/dist/assets/{suno-BHUVRPBN.js → suno-0Xq9KYle.js} +1 -1
- package/dist/assets/{swapHorizontal-DnAb8xCi.js → swapHorizontal-CTL8vzMH.js} +1 -1
- package/dist/assets/{swapHorizontalBold-md5Y2BAJ.js → swapHorizontalBold-CgGhxpZX.js} +1 -1
- package/dist/assets/{swapHorizontalMedium-0k-GNU_k.js → swapHorizontalMedium-DW4gChPb.js} +1 -1
- package/dist/assets/{swapHorizontalRoundedBold-Cgb7T60d.js → swapHorizontalRoundedBold-CfevqofV.js} +1 -1
- package/dist/assets/{swapVertical-BpwfoDkr.js → swapVertical-D1hw1wD5.js} +1 -1
- package/dist/assets/{telegram-B9bqj9Fd.js → telegram-RxCql3XC.js} +1 -1
- package/dist/assets/{three-dots-BGC1FfgM.js → three-dots-DKkBd0VP.js} +1 -1
- package/dist/assets/{twitch-D9MOzdji.js → twitch-BnaprhAD.js} +1 -1
- package/dist/assets/{twitterIcon-H9ncN5wR.js → twitterIcon-CNMhyldY.js} +1 -1
- package/dist/assets/{typescript-FU1ZSXfb.js → typescript-IOC2KlgE.js} +1 -1
- package/dist/assets/{use-form-item-D7fAyxsc.js → use-form-item-qsyQDNM_.js} +1 -1
- package/dist/assets/validator-C56AxRln.js +1 -0
- package/dist/assets/{verify-2Yf-yJwN.js → verify-BzRbIq3H.js} +1 -1
- package/dist/assets/{verify-filled-C8MQ8Whg.js → verify-filled-BO04fbtb.js} +1 -1
- package/dist/assets/{w3m-modal-DKSgXg_s.js → w3m-modal-CIatn880.js} +1 -1
- package/dist/assets/{wallet-B7OAHqlU.js → wallet-Pid3Mubx.js} +1 -1
- package/dist/assets/{wallet-placeholder-BdQJnrGK.js → wallet-placeholder-UfDo9IdC.js} +1 -1
- package/dist/assets/{walletconnect-C1JKodVW.js → walletconnect-iYDQpOmi.js} +1 -1
- package/dist/assets/{warning-circle-CwLJNdr4.js → warning-circle-BWjUzSE6.js} +1 -1
- package/dist/assets/{web-ChL7QSbo.js → web-BHkSOW21.js} +1 -1
- package/dist/assets/{web-CaEPVDX2.js → web-BtkLoHdZ.js} +1 -1
- package/dist/assets/{x-CrTJ1EQB.js → x-CyjYvfdl.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +2 -2
- package/dist/assets/CopyToClipboard-CPSWT5bR.js +0 -1
- package/dist/assets/Index-W5DDNmeA.js +0 -1
- package/dist/assets/List-DjluEK6s.js +0 -1
- package/dist/assets/Pagination-D4JIMyo6.js +0 -1
- package/dist/assets/debounce-krmvP0WB.js +0 -1
- package/dist/assets/index-B72mm_GJ.js +0 -1
- package/dist/assets/index-BK2DP5hm.js +0 -1
- package/dist/assets/index-BSR24ARk.js +0 -1
- package/dist/assets/index-BTCKDPp9.js +0 -1
- package/dist/assets/index-BXNbiklb.js +0 -1
- package/dist/assets/index-BsnJ0N7L.js +0 -1
- package/dist/assets/index-BxiW3Z0u.js +0 -1
- package/dist/assets/index-CbJfxJEv.js +0 -1
- package/dist/assets/index-KRN8hOH2.js +0 -1
- package/dist/assets/index-PeA8Xc37.js +0 -1
- package/dist/assets/index-oF4TPGEy.js +0 -1
- package/dist/assets/validator-DTOJbKt6.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as E}from"./index.es-BLmzEmO2.js";import{E as L}from"./index-B72mm_GJ.js";import{E as ce}from"./index-B6agP-Ra.js";import{d as b,H as u,E as i,z as N,C as n,y as h,D as o,q as l,F as r,x as S,O as I,N as T,Q as U,J as k,R as ke,I as w,M as be}from"./vendor-vue-NSDaktjZ.js";import{G as y,bk as P,ah as ye,H as we,cp as te,aG as oe,S as ne,cq as Ce}from"./index-D38caUdO.js";import{b as Se,c as se,d as F,e as D,f as Ve,g as Ie,h as Te}from"./kling-CtoPhhA9.js";import{E as A,a as G}from"./index-BK2DP5hm.js";import{E as q}from"./index-BsnJ0N7L.js";import{E as C}from"./index-C21TcEmh.js";import{I as V,S as Ee,l as Le}from"./pagination-C2o1t_-2.js";import{p as H}from"./pasteUploadMixin-BurWbGNQ.js";import{I as K}from"./ImagePreview-DI2VeDuz.js";import{E as W}from"./index-41FllExt.js";import{E as O}from"./index-CVSIXY8y.js";import{C as de}from"./Consumption-CqJZN5qA.js";import{E as ue}from"./index-BxiW3Z0u.js";import{E as me}from"./index-DabXT8SU.js";import{E as pe}from"./index-CXZ2Kfo8.js";import{E as J}from"./index-Dt4BllUK.js";import{a as ge}from"./price-BCBGswr1.js";import{F as Me}from"./FilePreview-C7fg38oZ.js";import{E as Re,a as Ue}from"./index-CQXejj_Q.js";import{E as De,a as Ae}from"./index-KRN8hOH2.js";import{b as ie}from"./errorCode-Cqj9Td_Z.js";import{C as Ge}from"./CopyToClipboard-CPSWT5bR.js";import{V as Pe}from"./VideoPlayer-CO6S65En.js";import{E as Ke}from"./index-BTCKDPp9.js";import{E as Oe}from"./index-X-pA25HA.js";import{B as je}from"./BotPlaceholder-Dvz4ZRyu.js";import{N as Ne}from"./NoTasks-CllJt2H1.js";import"./use-form-item-D7fAyxsc.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./index-DNFN_ZFy.js";import"./typescript-FU1ZSXfb.js";import"./index-DF98wF07.js";import"./strings-beZM2Y-f.js";import"./isEqual-BVkGIvMj.js";import"./_Uint8Array-D_wulyVe.js";import"./castArray-D0mKqyiV.js";import"./debounce-krmvP0WB.js";import"./_baseIteratee-De-W5dn-.js";import"./index-DEv50S0G.js";import"./validator-DTOJbKt6.js";import"./index-CuVSy9S3.js";import"./_baseClone-BHIkIKEe.js";import"./_initCloneObject-CHBLIg3i.js";import"./index-Cu41y2Fl.js";import"./index-CW80M4ve.js";import"./isPlainObject-JrN91JkA.js";import"./vue-plyr-BO2nlN4c.js";import"./index-CbJfxJEv.js";const Be=b({name:"LayoutKling",components:{ElDrawer:ce,ElButton:L,FontAwesomeIcon:E},data(){return{drawer:!1}}}),ze={class:"main flex flex-row flex-1 min-h-0"},Fe={class:"config w-[320px] flex-none h-full flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},qe={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function He(e,t,s,a,m,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),u("div",ze,[i("div",Fe,[N(e.$slots,"config",{},void 0,!0)]),i("div",qe,[N(e.$slots,"result",{},void 0,!0)]),n(p,{circle:"",class:"menu",onClick:t[0]||(t[0]=c=>e.drawer=!0)},{default:h(()=>[n(d,{icon:"fa-solid fa-magic"})]),_:1}),n(f,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=c=>e.drawer=c),direction:"ltr","with-header":!1,size:"350px"},{default:h(()=>[N(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const We=y(Be,[["render",He],["__scopeId","data-v-394a324b"]]),Je={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function Q(e,t,s){const a=t||"std",m=s??5;switch(e){case"kling-v1":return{text2video:!0,image2video:!0,endImage:m===5,audio:!1,motionControl:m===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 Je}}function Y(e,t){if(!e)return[];const s=t.model??e.model,a=t.mode??e.mode,m=t.duration??e.duration;if(!s)return[];const $=Q(s,a,m),d=[];return e.end_image_url&&!$.endImage&&d.push({field:"end_image_url",i18nLabel:"kling.name.endImage"}),e.generate_audio&&!$.audio&&d.push({field:"generate_audio",i18nLabel:"kling.name.generateAudio"}),e.camera_control?.type&&(!$.motionControl||e.start_image_url)&&d.push({field:"camera_control",i18nLabel:"kling.name.cameraControl"}),d}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 Qe=b({name:"ModelSelector",components:{ElSelect:G,ElOption:A},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(m=>this.$t(m.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 m=X({...t,model:e},s);this.$store.commit("kling/setConfig",m),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})}}}),Ye={class:"field"},Xe={class:"title font-bold"};function Ze(e,t,s,a,m,$){const d=o("el-option"),p=o("el-select");return l(),u("div",Ye,[i("h2",Xe,r(e.$t("pika.name.model")),1),(l(),S(p,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("pika.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),u(I,null,T(e.options,f=>(l(),S(d,{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const xe=y(Qe,[["render",Ze],["__scopeId","data-v-04059875"]]),et=b({name:"ModeSelector",components:{ElSelect:G,ElOption:A,InfoIcon:V},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(se)}},mounted(){this.value||this.applyMode(se)},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(m=>this.$t(m.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 m=X({...t,mode:e},s);this.$store.commit("kling/setConfig",m),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})}}}),tt={class:"field"},ot={class:"header"},nt={class:"title font-bold"},st={key:0,class:"opt-tip"};function it(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),u("div",tt,[i("div",ot,[i("h2",nt,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.mode"),class:"info-icon"},null,8,["content"])]),(l(),S(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),u(I,null,T(e.options,c=>(l(),S(p,{key:c.value,label:c.label,value:c.value,disabled:c.disabled},{default:h(()=>[i("span",{class:U({"opt-disabled":c.disabled})},r(c.label),3),c.disabled&&c.disabledReason?(l(),u("span",st,r(c.disabledReason),1)):k("",!0)]),_:2},1032,["label","value","disabled"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const lt=y(et,[["render",it],["__scopeId","data-v-9a8fa3c5"]]),at=[3,5,8,10,12,15],rt=[5,10],ct=b({name:"DurationSelector",components:{ElSelect:G,ElOption:A,InfoIcon:V},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},isV3Model(){return F.includes(this.selectedModel)},allowedDurations(){return this.isV3Model?at:rt},value(){return this.$store.state.kling?.config?.duration??D},selectValue(){const e=this.allowedDurations;return e.includes(this.value)?this.value:e.includes(D)?D:e[0]}},watch:{isV3Model(){this.allowedDurations.includes(this.value)||this.applyDuration(D)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(D)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Y(t,{duration:e});if(s.length===0){this.applyDuration(e);return}const a=s.map(m=>this.$t(m.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 m=X({...t,duration:e},s);this.$store.commit("kling/setConfig",m),C.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,duration:e})}}}),dt={class:"field"},ut={class:"control"},mt={class:"label"},pt={class:"title font-bold"};function gt(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),u("div",dt,[i("div",ut,[i("div",mt,[i("h2",pt,r(e.$t("kling.name.duration")),1),n(d,{content:e.$t("kling.description.duration"),class:"info-icon ml-1"},null,8,["content"])]),(l(),S(f,{key:e.revertKey,"model-value":e.selectValue,class:"value",placeholder:e.$t("kling.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),u(I,null,T(e.allowedDurations,c=>(l(),S(p,{key:c,label:`${c}s`,value:c},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])])}const ft=y(ct,[["render",gt],["__scopeId","data-v-5ae55e28"]]),ht=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=Ve)}}),_t={class:"text-sm font-bold mb-2 block"},$t={class:"items"},vt=["onClick"],kt={class:"name"};function bt(e,t,s,a,m,$){return l(),u("div",null,[i("span",_t,r(e.$t("kling.name.ratio")),1),i("div",$t,[(l(!0),u(I,null,T(e.options,(d,p)=>(l(),u("div",{key:p,class:U({active:e.active===p,item:!0}),onClick:f=>e.value=d.value},[i("div",{class:U(["preview",d.label])},[i("div",{class:"rect",style:ke({width:d.width+"px",height:d.height+"px"})},null,4)],2),i("p",kt,r(d.label),1)],10,vt))),128))])])}const yt=y(ht,[["render",bt],["__scopeId","data-v-cdb14b2f"]]),wt=b({name:"StartImage",components:{ElUpload:O,ElButton:L,ElTooltip:W,InfoIcon:V,FontAwesomeIcon:E,ImagePreview:K},mixins:[H],emits:["change"],data(){return{fileList:[],uploadUrl:P()+"/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()}}}),Ct={class:"relative"},St={class:"flex justify-between"},Vt={class:"flex justify-start items-center"},It={class:"text-sm font-bold"};function Tt(e,t,s,a,m,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),v=o("el-tooltip"),g=o("el-upload");return l(),u("div",Ct,[i("div",St,[i("div",Vt,[i("span",It,r(e.$t("kling.name.startImage")),1),n(d,{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(),S(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(c,{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 Et=y(wt,[["render",Tt],["__scopeId","data-v-68cf38f5"]]),Lt=b({name:"EndImage",components:{ElUpload:O,ElButton:L,ElTooltip:W,ImagePreview:K,InfoIcon:V,FontAwesomeIcon:E},mixins:[H],data(){return{fileList:[],uploadUrl:P()+"/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 Q(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},hasStartImage(){return!!this.klingConfig.start_image_url},uploadDisabled(){return this.reachedLimit||!this.endImageSupported||!this.hasStartImage},uploadTooltip(){return this.endImageSupported?this.hasStartImage?this.reachedLimit?this.$t("kling.message.uploadReferencesExceed"):"":this.$t("kling.message.endImageRequiresStart"):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=[])},hasStartImage(e){!e&&this.storeValue&&(this.fileList=[],this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,end_image_url:void 0}))}},mounted(){this.value||(this.value=void 0),this.onSetEndImageUrl()},methods:{onBeforeUpload(){return this.endImageSupported?this.hasStartImage?!0:(C.warning(this.$t("kling.message.endImageRequiresStart")),!1):(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()}}}),Mt={class:"relative"},Rt={class:"flex justify-between"},Ut={class:"flex justify-start items-center"},Dt={class:"text-sm font-bold"};function At(e,t,s,a,m,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),v=o("el-tooltip"),g=o("el-upload");return l(),u("div",Mt,[i("div",Rt,[i("div",Ut,[i("span",Dt,r(e.$t("kling.name.endImage")),1),n(d,{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(),S(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(c,{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 Gt=y(Lt,[["render",At],["__scopeId","data-v-593c3bde"]]),Pt=b({name:"CfgScaleSelector",components:{ElSlider:me,InfoIcon:V,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)}}),Kt={class:"flex justify-between"},Ot={class:"flex justify-start items-center"},jt={class:"text-sm font-bold"},Nt={class:"flex justify-end items-center"},Bt={class:"w-full"};function zt(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-input-number"),f=o("el-slider");return l(),u("div",null,[i("div",Kt,[i("div",Ot,[i("span",jt,r(e.$t("kling.name.cfgScale")),1),n(d,{content:e.$t("kling.description.cfgScale")},null,8,["content"])]),i("div",Nt,[n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),"controls-position":"right"},null,8,["modelValue"])])]),i("div",Bt,[n(f,{modelValue:e.value,"onUpdate:modelValue":t[1]||(t[1]=c=>e.value=c),min:0,max:1,step:.1},null,8,["modelValue"])])])}const Ft=y(Pt,[["render",zt]]),qt=b({name:"GenerateAudioSelector",components:{ElSwitch:pe,InfoIcon:V},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??Te:!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})}}}),Ht={class:"relative"},Wt={class:"flex justify-between items-center"},Jt={class:"flex justify-start items-center"},Qt={class:"text-sm font-bold"};function Yt(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-switch");return l(),u("div",Ht,[i("div",Wt,[i("div",Jt,[i("span",Qt,r(e.$t("kling.name.generateAudio")),1),n(d,{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 Xt=y(qt,[["render",Yt]]),Zt=["horizontal","vertical","pan","tilt","roll","zoom"],xt=b({name:"CameraControlSelector",components:{ElSelect:G,ElOption:A,ElSlider:me,ElInputNumber:ue,InfoIcon:V},data(){return{configKeys:Zt}},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||""},selectedModel(){return this.$store.state.kling?.config?.model||""},selectedDuration(){return this.$store.state.kling?.config?.duration},motionControlSupported(){return Q(this.selectedModel,this.selectedMode,this.selectedDuration).motionControl},hasStartImage(){return!!this.$store.state.kling?.config?.start_image_url},disabled(){return!this.motionControlSupported||this.hasStartImage},tooltipContent(){return this.motionControlSupported?this.hasStartImage?this.$t("kling.description.cameraControlDisabledImage2Video"):this.$t("kling.description.cameraControl"):this.$t("kling.description.cameraControlNotSupported")},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"},m={...a.config||{}};t==null?delete m[e]:m[e]=t,this.$store.commit("kling/setConfig",{...s,camera_control:{...a,type:"simple",config:m}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),eo={class:"field"},to={class:"header"},oo={class:"text-sm font-bold"},no={key:0,class:"config-grid"},so={class:"cfg-row-head"},io={class:"cfg-name"};function lo(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select"),c=o("el-input-number"),v=o("el-slider");return l(),u("div",eo,[i("div",to,[i("span",oo,r(e.$t("kling.name.cameraControl")),1),n(d,{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),u(I,null,T(e.typeOptions,g=>(l(),S(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(),u("div",no,[(l(!0),u(I,null,T(e.configKeys,g=>(l(),u("div",{key:g,class:"cfg-row"},[i("div",so,[i("span",io,r(e.$t(`kling.name.cc_${g}`)),1),n(c,{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 ao=y(xt,[["render",lo],["__scopeId","data-v-cd896060"]]),fe=[{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 ro(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 m of s)if(a.includes(m)){a=a.replace(m,"");break}return a.replace(/(?:,\s*)+$/,"").replace(/^(?:,\s*)+/,"")}const co=b({name:"InspirationPills",components:{FontAwesomeIcon:E},computed:{prompt(){return this.$store.state.kling?.config?.prompt||""},allChipTexts(){return fe.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})}}}),uo={key:0,class:"pills",role:"list"},mo={class:"pill-text"},po=["aria-label","onClick"];function go(e,t,s,a,m,$){const d=o("font-awesome-icon");return e.selected.length>0?(l(),u("div",uo,[(l(!0),u(I,null,T(e.selected,p=>(l(),u("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:be(f=>e.onRemove(p),["stop"])},[n(d,{icon:"fa-solid fa-xmark"})],8,po)]))),128))])):k("",!0)}const fo=y(co,[["render",go],["__scopeId","data-v-5fc4fa65"]]),ho="",_o=b({name:"PromptInput",components:{ElInput:J,ElButton:L,FontAwesomeIcon:E,InfoIcon:V,InspirationPills:fo},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=ho)}}),$o={class:"field"},vo={class:"box"},ko={class:"title font-bold"},bo={class:"actions"};function yo(e,t,s,a,m,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("info-icon"),c=o("inspiration-pills"),v=o("el-input");return l(),u("div",$o,[i("div",vo,[i("h2",ko,r(e.$t("kling.name.prompt")),1),i("div",bo,[n(p,{text:"",size:"small",class:"inspiration-btn",onClick:t[0]||(t[0]=g=>e.$emit("open-inspiration"))},{default:h(()=>[n(d,{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(c),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 wo=y(_o,[["render",yo],["__scopeId","data-v-0a5c57b8"]]),Co="",So=b({name:"NegativePromptInput",components:{ElInput:J,InfoIcon:V},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=Co)}}),Vo={class:"field"},Io={class:"box"},To={class:"title font-bold"};function Eo(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-input");return l(),u("div",Vo,[i("div",Io,[i("h2",To,r(e.$t("kling.name.negativePrompt")),1),n(d,{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 Lo=y(So,[["render",Eo],["__scopeId","data-v-de98cf01"]]),Mo=b({name:"InspirationDrawer",components:{ElDrawer:ce,ElButton:L,FontAwesomeIcon:E},props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],data(){return{groups:fe,Close:ye}},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(ro(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)}}}),Ro={class:"drawer-content"},Uo={class:"drawer-header"},Do={class:"title-row"},Ao={class:"title"},Go={class:"hint"},Po={key:0,class:"selected-bar"},Ko={class:"selected-text"},Oo={class:"groups"},jo={class:"group-title"},No={class:"chip-grid"},Bo=["onClick"];function zo(e,t,s,a,m,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),S(f,{modelValue:e.visible,"onUpdate:modelValue":t[1]||(t[1]=c=>e.visible=c),direction:"rtl","with-header":!1,size:e.drawerSize,"custom-class":"kling-inspiration-drawer","destroy-on-close":!1},{default:h(()=>[i("div",Ro,[i("div",Uo,[i("div",Do,[n(d,{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]=c=>e.visible=!1)},null,8,["icon"])]),i("div",Go,r(e.$t("kling.inspiration.hint")),1),e.selectedCount>0?(l(),u("div",Po,[i("span",Ko,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",Oo,[(l(!0),u(I,null,T(e.groups,c=>(l(),u("div",{key:c.groupKey,class:"group"},[i("div",jo,r(e.$t(`kling.inspiration.group.${c.groupKey}`)),1),i("div",No,[(l(!0),u(I,null,T(c.chipKeys,v=>(l(),u("button",{key:v,type:"button",class:U({chip:!0,active:e.isSelected(e.chipText(v))}),onClick:g=>e.onToggle(e.chipText(v))},r(e.chipText(v)),11,Bo))),128))])]))),128))])])]),_:1},8,["modelValue","size"])}const Fo=y(Mo,[["render",zo],["__scopeId","data-v-7d457a69"]]),qo={"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"},Ho={std:"720p",pro:"1080p","4k":"4K"},Wo=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 qo[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||""},modeLabel(){const e=this.config?.mode||"std";return Ho[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),Jo={class:"summary-chip"},Qo=["title"],Yo=["title"],Xo=["title"],Zo=["title"],xo=["title"];function en(e,t,s,a,m,$){const d=o("font-awesome-icon");return l(),u("div",Jo,[i("span",{class:"part",title:e.$t("kling.name.model")},r(e.modelLabel),9,Qo),t[0]||(t[0]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.duration")},r(e.durationLabel),9,Yo),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,Xo),t[2]||(t[2]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.mode")},r(e.modeLabel),9,Zo),e.generateAudio?(l(),u("span",{key:0,class:"audio",title:e.$t("kling.name.generateAudio")},[n(d,{icon:"fa-solid fa-headphones"})],8,xo)):k("",!0)])}const tn=y(Wo,[["render",en],["__scopeId","data-v-418a6733"]]),on=b({name:"ConfigPanel",components:{ElButton:L,Consumption:de,FontAwesomeIcon:E,PromptInput:wo,NegativePromptInput:Lo,ModelSelector:xe,ModeSelector:lt,DurationSelector:ft,RatioSelector:yt,StartImage:Et,CfgScaleSelector:Ft,GenerateAudioSelector:Xt,CameraControlSelector:ao,InspirationDrawer:Fo,SummaryChip:tn,EndImage:Gt},emits:["generate"],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},consumption(){return ge(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit("generate")}}}),nn={class:"flex flex-col h-full"},sn={class:"flex-1 overflow-y-auto p-5"},ln={class:"flex flex-col items-center justify-center px-5 pb-5"};function an(e,t,s,a,m,$){const d=o("prompt-input"),p=o("model-selector"),f=o("ratio-selector"),c=o("start-image"),v=o("end-image"),g=o("duration-selector"),_=o("mode-selector"),M=o("generate-audio-selector"),R=o("camera-control-selector"),j=o("cfg-scale-selector"),he=o("negative-prompt-input"),_e=o("summary-chip"),$e=o("consumption"),Z=o("font-awesome-icon"),x=o("el-button"),ve=o("inspiration-drawer");return l(),u("div",nn,[i("div",sn,[n(d,{class:"mb-4",onOpenInspiration:t[0]||(t[0]=ee=>e.inspirationOpen=!0)}),n(p,{class:"mb-4"}),n(f,{class:"mb-4"}),n(c,{class:"mb-2"}),n(v,{class:"mb-2"}),n(g,{class:"mb-4"}),n(_,{class:"mb-4"}),n(M,{class:"mb-4"}),n(R,{class:"mb-4"}),n(j,{class:"mb-4"}),n(he,{class:"mb-4"})]),i("div",ln,[n(_e),n($e,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(l(),S(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(),S(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(ve,{modelValue:e.inspirationOpen,"onUpdate:modelValue":t[1]||(t[1]=ee=>e.inspirationOpen=ee)},null,8,["modelValue"])])}const rn=y(on,[["render",an]]),cn=b({name:"MotionImage",components:{ElUpload:O,ElButton:L,InfoIcon:V,FontAwesomeIcon:E,ImagePreview:K},mixins:[H],data(){return{fileList:[],uploadUrl:P()+"/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()}}}),dn={class:"relative"},un={class:"flex justify-between"},mn={class:"flex justify-start items-center"},pn={class:"text-sm font-bold"};function gn(e,t,s,a,m,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),v=o("el-upload");return l(),u("div",dn,[i("div",un,[i("div",mn,[i("span",pn,r(e.$t("kling.name.motionImage")),1),n(d,{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(),S(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(c,{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 fn=y(cn,[["render",gn],["__scopeId","data-v-37d42da7"]]),hn=b({name:"MotionVideo",components:{ElUpload:O,ElButton:L,InfoIcon:V,FilePreview:Me,FontAwesomeIcon:E},data(){return{fileList:[],uploadUrl:P()+"/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()}}}),_n={class:"relative"},$n={class:"flex justify-between"},vn={class:"flex justify-start items-center"},kn={class:"text-sm font-bold"};function bn(e,t,s,a,m,$){const d=o("info-icon"),p=o("file-preview"),f=o("font-awesome-icon"),c=o("el-button"),v=o("el-upload");return l(),u("div",_n,[i("div",$n,[i("div",vn,[i("span",kn,r(e.$t("kling.name.motionVideo")),1),n(d,{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(),S(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(c,{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 yn=y(hn,[["render",bn],["__scopeId","data-v-5cf93212"]]),wn=b({name:"MotionPromptInput",components:{ElInput:J,InfoIcon:V},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||""},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),Cn={class:"field"},Sn={class:"box"},Vn={class:"title font-bold"};function In(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-input");return l(),u("div",Cn,[i("div",Sn,[i("h2",Vn,r(e.$t("kling.name.motionPrompt")),1),n(d,{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(wn,[["render",In],["__scopeId","data-v-ca9fdbe5"]]),le="video",En=b({name:"CharacterOrientationSelector",components:{ElRadioGroup:Ue,ElRadioButton:Re,InfoIcon:V},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||le},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=le)}}),Ln={class:"field"},Mn={class:"header"},Rn={class:"text-sm font-bold"};function Un(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-radio-button"),f=o("el-radio-group");return l(),u("div",Ln,[i("div",Mn,[i("span",Rn,r(e.$t("kling.name.characterOrientation")),1),n(d,{content:e.$t("kling.description.characterOrientation")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),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 Dn=y(En,[["render",Un],["__scopeId","data-v-7a91195b"]]),ae="std",An=b({name:"MotionModeSelector",components:{ElSelect:G,ElOption:A,InfoIcon:V},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||ae},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=ae)}}),Gn={class:"field"},Pn={class:"header"},Kn={class:"title font-bold"};function On(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),u("div",Gn,[i("div",Pn,[i("h2",Kn,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.motionMode")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),class:"value",placeholder:e.$t("kling.placeholder.select")},{default:h(()=>[(l(!0),u(I,null,T(e.options,c=>(l(),S(p,{key:c.value,label:c.label,value:c.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const jn=y(An,[["render",On],["__scopeId","data-v-1295688c"]]),Nn=b({name:"KeepOriginalSoundSelector",components:{ElSwitch:pe,InfoIcon:V},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"})}}}}),Bn={class:"relative"},zn={class:"flex justify-between items-center"},Fn={class:"flex justify-start items-center"},qn={class:"text-sm font-bold"};function Hn(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-switch");return l(),u("div",Bn,[i("div",zn,[i("div",Fn,[i("span",qn,r(e.$t("kling.name.keepOriginalSound")),1),n(d,{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 Wn=y(Nn,[["render",Hn]]),Jn=b({name:"MotionPanel",components:{ElButton:L,FontAwesomeIcon:E,Consumption:de,MotionImage:fn,MotionVideo:yn,MotionPromptInput:Tn,CharacterOrientationSelector:Dn,MotionModeSelector:jn,KeepOriginalSoundSelector:Wn},emits:["generate"],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return ge(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")}}}),Qn={class:"flex flex-col h-full"},Yn={class:"flex-1 overflow-y-auto p-5"},Xn={class:"flex flex-col items-center justify-center px-5 pb-5"};function Zn(e,t,s,a,m,$){const d=o("motion-image"),p=o("motion-video"),f=o("motion-prompt-input"),c=o("character-orientation-selector"),v=o("motion-mode-selector"),g=o("keep-original-sound-selector"),_=o("consumption"),M=o("font-awesome-icon"),R=o("el-button");return l(),u("div",Qn,[i("div",Yn,[n(d,{class:"mb-3"}),n(p,{class:"mb-3"}),n(f,{class:"mb-4"}),n(c,{class:"mb-4"}),n(v,{class:"mb-4"}),n(g,{class:"mb-4"})]),i("div",Xn,[n(_,{value:e.consumption,service:e.service},null,8,["value","service"]),n(R,{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 xn=y(Jn,[["render",Zn]]),es=b({name:"KlingTabSwitcher",components:{ElTabs:Ae,ElTabPane:De,ElTag:we},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)}}}),ts=["title"],os={class:"text"};function ns(e,t,s,a,m,$){const d=o("el-tag"),p=o("el-tab-pane"),f=o("el-tabs");return l(),S(f,{"model-value":e.modelValue,class:"kling-tabs",stretch:"","onUpdate:modelValue":e.onUpdate},{default:h(()=>[(l(!0),u(I,null,T(e.tabs,c=>(l(),S(p,{key:c.value,name:c.value,disabled:c.disabled},{label:h(()=>[i("span",{class:"tab-label",title:c.disabled?c.disabledReason:void 0},[i("span",os,r(c.label),1),c.badge?(l(),S(d,{key:0,size:"small",type:"warning",class:"badge"},{default:h(()=>[w(r(c.badge),1)]),_:2},1024)):k("",!0)],8,ts)]),_:2},1032,["name","disabled"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])}const ss=y(es,[["render",ns],["__scopeId","data-v-bf00c27e"]]),is=b({name:"TaskPreview",components:{ElImage:Oe,CopyToClipboard:Ge,FontAwesomeIcon:E,ElAlert:Ke,VideoPlayer:Pe,ElTooltip:W,ElButton:L,ImagePreview:K},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")}}}),ls={class:"preview"},as={class:"left"},rs={class:"main"},cs={class:"bot"},ds={class:"datetime"},us={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"},gs={key:0},fs={key:1},hs={key:0,class:U({content:!0,failed:!0})},_s={key:0,class:"mb-4"},$s={key:1,class:U({operations:!0,"mt-2":!0})},vs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ks={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},bs={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},ys={key:1,class:U({content:!0})},ws={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Cs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ss={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"},Is={key:2,class:U({content:!0})},Ts={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Es={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Ls(e,t,s,a,m,$){const d=o("el-image"),p=o("image-preview"),f=o("video-player"),c=o("el-button"),v=o("el-tooltip"),g=o("font-awesome-icon"),_=o("copy-to-clipboard"),M=o("el-alert");return l(),u("div",ls,[i("div",as,[n(d,{src:"https://cdn.acedata.cloud/qpbbbb.jpg",class:"avatar"})]),i("div",rs,[i("div",cs,[w(r(e.$t("kling.name.klingBot"))+" ",1),i("span",ds,r(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),i("div",us,[e.referenceImages.length>0?(l(),u("div",ms,[(l(!0),u(I,null,T(e.referenceImages,(R,j)=>(l(),S(p,{key:j,url:R.url,name:R.name,closable:!1},null,8,["url","name"]))),128))])):k("",!0),e.modelValue?.request?.prompt?(l(),u("p",ps,[w(r(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?k("",!0):(l(),u("span",gs," - ("+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(),u("span",fs," - ("+r(e.$t("kling.status.processing"))+") ",1)):k("",!0)])):k("",!0)]),e.modelValue?.response?.success===!0?(l(),u("div",hs,[e.modelValue?.response.video_url?(l(),u("div",_s,[n(f,{src:e.modelValue?.response.video_url},null,8,["src"])])):k("",!0),e.modelValue?.response.success?(l(),u("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(),S(c,{key:0,type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=R=>e.onDownload(R,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",vs,[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",ks,[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(),u("p",bs,[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(),u("div",ys,[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",ws,[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",Cs,[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(),u("p",Ss,[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(),u("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(),u("div",Is,[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(),u("p",Es,[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 Ms=y(is,[["render",Ls],["__scopeId","data-v-e8e87659"]]),Rs=b({name:"RecentPanel",components:{TaskPreview:Ms,NoTasks:Ne,BotPlaceholder:je,ScrollList:Ee},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},Ds={key:2,class:"w-full h-full flex items-center justify-center"};function As(e,t,s,a,m,$){const d=o("bot-placeholder"),p=o("task-preview"),f=o("scroll-list"),c=o("no-tasks");return l(),u(I,null,[e.tasks?.items===void 0?(l(),u("div",Us,[n(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(l(),S(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),u(I,null,T(e.tasks?.items,v=>(l(),S(p,{key:v.id,"model-value":v},null,8,["model-value"]))),128))]),_:1},8,["loading"])):k("",!0),e.tasks?.items?.length===0?(l(),u("div",Ds,[n(c)])):k("",!0)],64)}const Gs=y(Rs,[["render",As]]),re=Ce("kling"),Ps=b({name:"KlingIndex",components:{ConfigPanel:rn,MotionPanel:xn,TabSwitcher:ss,Layout:We,RecentPanel:Gs},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===ne.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===ne.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 Le({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:re};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(([,m])=>m!=null))}:{}});const a=this.credential?.token;if(!a){console.error("no token specified");return}C.info(this.$t("kling.message.startingTask")),te("kling",oe.generate(s,{token:a})).then(()=>{C.success(this.$t("kling.message.startTaskSuccess"))}).catch(m=>{m?.response?.data?.error?.code===ie?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:re},s=this.credential?.token;if(!s){console.error("no token specified");return}C.info(this.$t("kling.message.startingTask")),te("kling",oe.motion(t,{token:s})).then(()=>{C.success(this.$t("kling.message.startTaskSuccess"))}).catch(a=>{a?.response?.data?.error?.code===ie?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)})}}}),Ks={class:"flex flex-col h-full"},Os={class:"flex-1 min-h-0"};function js(e,t,s,a,m,$){const d=o("tab-switcher"),p=o("config-panel"),f=o("motion-panel"),c=o("recent-panel"),v=o("layout");return l(),S(v,null,{config:h(()=>[i("div",Ks,[n(d,{"model-value":e.taskType,"onUpdate:modelValue":e.onTabChange},null,8,["model-value","onUpdate:modelValue"]),i("div",Os,[e.taskType==="videos"?(l(),S(p,{key:0,onGenerate:e.onGenerate},null,8,["onGenerate"])):e.taskType==="motion"?(l(),S(f,{key:1,onGenerate:e.onGenerateMotion},null,8,["onGenerate"])):k("",!0)])])]),result:h(()=>[n(c,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Ni=y(Ps,[["render",js]]);export{Ni as default};
|
|
1
|
+
import{F as E}from"./index.es-GrqLuAny.js";import{E as L}from"./index-CLoBOm_T.js";import{E as ce}from"./index-C6-cjUfP.js";import{d as b,H as u,E as i,z as N,C as n,y as h,D as o,q as l,F as r,x as S,O as I,N as T,Q as U,J as k,R as ke,I as w,M as be}from"./vendor-vue-NSDaktjZ.js";import{G as y,bj as G,ag as ye,H as we,co as te,aF as oe,S as ne,cp as Ce}from"./index-CN230R6D.js";import{b as Se,c as se,d as F,e as D,f as Ve,g as Ie,h as Te}from"./kling-CtoPhhA9.js";import{E as A,a as P}from"./index-CYeSxpcT.js";import{E as q}from"./index-CziznbF0.js";import{E as C}from"./index-cvQIu1l_.js";import{I as V,S as Ee,l as Le}from"./pagination-Dd7b5MDO.js";import{p as H}from"./pasteUploadMixin-BurWbGNQ.js";import{I as K}from"./ImagePreview-CkZKsGAi.js";import{E as W}from"./index-rQjoe_n5.js";import{E as O}from"./index-CRljgcPl.js";import{C as de}from"./Consumption-BhUnYfB3.js";import{E as ue}from"./index-C8i3BVbr.js";import{E as me}from"./index-Bir55vdU.js";import{E as pe}from"./index-BhTb9fft.js";import{E as J}from"./index-C_NNhcSN.js";import{a as ge}from"./price-D8EZsjEA.js";import{F as Me}from"./FilePreview-BD5s8QX7.js";import{E as Re,a as Ue}from"./index-C3VomJKX.js";import{E as De,a as Ae}from"./index-unzen9LK.js";import{b as ie}from"./errorCode-Cqj9Td_Z.js";import{C as Pe}from"./CopyToClipboard-UbVnHanv.js";import{V as Ge}from"./VideoPlayer-BU0YUM_I.js";import{E as Ke}from"./index-DsLRtP6j.js";import{E as Oe}from"./index-BeBTVXHV.js";import{B as je}from"./BotPlaceholder-CrP_V5ek.js";import{N as Ne}from"./NoTasks-Dh1gQ2Mu.js";import"./use-form-item-qsyQDNM_.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Kg6s1a65.js";import"./index-YBwyc48X.js";import"./typescript-IOC2KlgE.js";import"./index-Dv6Z30am.js";import"./strings-beZM2Y-f.js";import"./isEqual-GWUuPjg7.js";import"./_Uint8Array-VDaSlXRk.js";import"./castArray-XMTACVks.js";import"./debounce-BrYZ7_Ce.js";import"./_baseIteratee-Dwd75Nk1.js";import"./index-BBi-Qo59.js";import"./validator-C56AxRln.js";import"./index-Cc79uzb6.js";import"./_baseClone-D1YwQEy7.js";import"./_initCloneObject-D6RxkML8.js";import"./index-Cu41y2Fl.js";import"./index-DVwYx71J.js";import"./isPlainObject-C1JDgF-H.js";import"./vue-plyr-BO2nlN4c.js";import"./index-DNRZxhyN.js";const Be=b({name:"LayoutKling",components:{ElDrawer:ce,ElButton:L,FontAwesomeIcon:E},data(){return{drawer:!1}}}),ze={class:"main flex flex-row flex-1 min-h-0"},Fe={class:"config w-[320px] flex-none h-full flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},qe={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function He(e,t,s,a,m,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),u("div",ze,[i("div",Fe,[N(e.$slots,"config",{},void 0,!0)]),i("div",qe,[N(e.$slots,"result",{},void 0,!0)]),n(p,{circle:"",class:"menu",onClick:t[0]||(t[0]=c=>e.drawer=!0)},{default:h(()=>[n(d,{icon:"fa-solid fa-magic"})]),_:1}),n(f,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=c=>e.drawer=c),direction:"ltr","with-header":!1,size:"350px"},{default:h(()=>[N(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const We=y(Be,[["render",He],["__scopeId","data-v-394a324b"]]),Je={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function Q(e,t,s){const a=t||"std",m=s??5;switch(e){case"kling-v1":return{text2video:!0,image2video:!0,endImage:m===5,audio:!1,motionControl:m===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 Je}}function Y(e,t){if(!e)return[];const s=t.model??e.model,a=t.mode??e.mode,m=t.duration??e.duration;if(!s)return[];const $=Q(s,a,m),d=[];return e.end_image_url&&!$.endImage&&d.push({field:"end_image_url",i18nLabel:"kling.name.endImage"}),e.generate_audio&&!$.audio&&d.push({field:"generate_audio",i18nLabel:"kling.name.generateAudio"}),e.camera_control?.type&&(!$.motionControl||e.start_image_url)&&d.push({field:"camera_control",i18nLabel:"kling.name.cameraControl"}),d}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 Qe=b({name:"ModelSelector",components:{ElSelect:P,ElOption:A},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(m=>this.$t(m.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 m=X({...t,model:e},s);this.$store.commit("kling/setConfig",m),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})}}}),Ye={class:"field"},Xe={class:"title font-bold"};function Ze(e,t,s,a,m,$){const d=o("el-option"),p=o("el-select");return l(),u("div",Ye,[i("h2",Xe,r(e.$t("pika.name.model")),1),(l(),S(p,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("pika.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),u(I,null,T(e.options,f=>(l(),S(d,{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const xe=y(Qe,[["render",Ze],["__scopeId","data-v-04059875"]]),et=b({name:"ModeSelector",components:{ElSelect:P,ElOption:A,InfoIcon:V},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(se)}},mounted(){this.value||this.applyMode(se)},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(m=>this.$t(m.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 m=X({...t,mode:e},s);this.$store.commit("kling/setConfig",m),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})}}}),tt={class:"field"},ot={class:"header"},nt={class:"title font-bold"},st={key:0,class:"opt-tip"};function it(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),u("div",tt,[i("div",ot,[i("h2",nt,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.mode"),class:"info-icon"},null,8,["content"])]),(l(),S(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),u(I,null,T(e.options,c=>(l(),S(p,{key:c.value,label:c.label,value:c.value,disabled:c.disabled},{default:h(()=>[i("span",{class:U({"opt-disabled":c.disabled})},r(c.label),3),c.disabled&&c.disabledReason?(l(),u("span",st,r(c.disabledReason),1)):k("",!0)]),_:2},1032,["label","value","disabled"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const lt=y(et,[["render",it],["__scopeId","data-v-9a8fa3c5"]]),at=[3,5,8,10,12,15],rt=[5,10],ct=b({name:"DurationSelector",components:{ElSelect:P,ElOption:A,InfoIcon:V},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},isV3Model(){return F.includes(this.selectedModel)},allowedDurations(){return this.isV3Model?at:rt},value(){return this.$store.state.kling?.config?.duration??D},selectValue(){const e=this.allowedDurations;return e.includes(this.value)?this.value:e.includes(D)?D:e[0]}},watch:{isV3Model(){this.allowedDurations.includes(this.value)||this.applyDuration(D)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(D)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Y(t,{duration:e});if(s.length===0){this.applyDuration(e);return}const a=s.map(m=>this.$t(m.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 m=X({...t,duration:e},s);this.$store.commit("kling/setConfig",m),C.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,duration:e})}}}),dt={class:"field"},ut={class:"control"},mt={class:"label"},pt={class:"title font-bold"};function gt(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),u("div",dt,[i("div",ut,[i("div",mt,[i("h2",pt,r(e.$t("kling.name.duration")),1),n(d,{content:e.$t("kling.description.duration"),class:"info-icon ml-1"},null,8,["content"])]),(l(),S(f,{key:e.revertKey,"model-value":e.selectValue,class:"value",placeholder:e.$t("kling.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),u(I,null,T(e.allowedDurations,c=>(l(),S(p,{key:c,label:`${c}s`,value:c},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])])}const ft=y(ct,[["render",gt],["__scopeId","data-v-5ae55e28"]]),ht=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=Ve)}}),_t={class:"text-sm font-bold mb-2 block"},$t={class:"items"},vt=["onClick"],kt={class:"name"};function bt(e,t,s,a,m,$){return l(),u("div",null,[i("span",_t,r(e.$t("kling.name.ratio")),1),i("div",$t,[(l(!0),u(I,null,T(e.options,(d,p)=>(l(),u("div",{key:p,class:U({active:e.active===p,item:!0}),onClick:f=>e.value=d.value},[i("div",{class:U(["preview",d.label])},[i("div",{class:"rect",style:ke({width:d.width+"px",height:d.height+"px"})},null,4)],2),i("p",kt,r(d.label),1)],10,vt))),128))])])}const yt=y(ht,[["render",bt],["__scopeId","data-v-cdb14b2f"]]),wt=b({name:"StartImage",components:{ElUpload:O,ElButton:L,ElTooltip:W,InfoIcon:V,FontAwesomeIcon:E,ImagePreview:K},mixins:[H],emits:["change"],data(){return{fileList:[],uploadUrl:G()+"/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()}}}),Ct={class:"relative"},St={class:"flex justify-between"},Vt={class:"flex justify-start items-center"},It={class:"text-sm font-bold"};function Tt(e,t,s,a,m,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),v=o("el-tooltip"),g=o("el-upload");return l(),u("div",Ct,[i("div",St,[i("div",Vt,[i("span",It,r(e.$t("kling.name.startImage")),1),n(d,{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(),S(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(c,{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 Et=y(wt,[["render",Tt],["__scopeId","data-v-68cf38f5"]]),Lt=b({name:"EndImage",components:{ElUpload:O,ElButton:L,ElTooltip:W,ImagePreview:K,InfoIcon:V,FontAwesomeIcon:E},mixins:[H],data(){return{fileList:[],uploadUrl:G()+"/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 Q(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},hasStartImage(){return!!this.klingConfig.start_image_url},uploadDisabled(){return this.reachedLimit||!this.endImageSupported||!this.hasStartImage},uploadTooltip(){return this.endImageSupported?this.hasStartImage?this.reachedLimit?this.$t("kling.message.uploadReferencesExceed"):"":this.$t("kling.message.endImageRequiresStart"):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=[])},hasStartImage(e){!e&&this.storeValue&&(this.fileList=[],this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,end_image_url:void 0}))}},mounted(){this.value||(this.value=void 0),this.onSetEndImageUrl()},methods:{onBeforeUpload(){return this.endImageSupported?this.hasStartImage?!0:(C.warning(this.$t("kling.message.endImageRequiresStart")),!1):(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()}}}),Mt={class:"relative"},Rt={class:"flex justify-between"},Ut={class:"flex justify-start items-center"},Dt={class:"text-sm font-bold"};function At(e,t,s,a,m,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),v=o("el-tooltip"),g=o("el-upload");return l(),u("div",Mt,[i("div",Rt,[i("div",Ut,[i("span",Dt,r(e.$t("kling.name.endImage")),1),n(d,{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(),S(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(c,{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(Lt,[["render",At],["__scopeId","data-v-593c3bde"]]),Gt=b({name:"CfgScaleSelector",components:{ElSlider:me,InfoIcon:V,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)}}),Kt={class:"flex justify-between"},Ot={class:"flex justify-start items-center"},jt={class:"text-sm font-bold"},Nt={class:"flex justify-end items-center"},Bt={class:"w-full"};function zt(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-input-number"),f=o("el-slider");return l(),u("div",null,[i("div",Kt,[i("div",Ot,[i("span",jt,r(e.$t("kling.name.cfgScale")),1),n(d,{content:e.$t("kling.description.cfgScale")},null,8,["content"])]),i("div",Nt,[n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),"controls-position":"right"},null,8,["modelValue"])])]),i("div",Bt,[n(f,{modelValue:e.value,"onUpdate:modelValue":t[1]||(t[1]=c=>e.value=c),min:0,max:1,step:.1},null,8,["modelValue"])])])}const Ft=y(Gt,[["render",zt]]),qt=b({name:"GenerateAudioSelector",components:{ElSwitch:pe,InfoIcon:V},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??Te:!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})}}}),Ht={class:"relative"},Wt={class:"flex justify-between items-center"},Jt={class:"flex justify-start items-center"},Qt={class:"text-sm font-bold"};function Yt(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-switch");return l(),u("div",Ht,[i("div",Wt,[i("div",Jt,[i("span",Qt,r(e.$t("kling.name.generateAudio")),1),n(d,{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 Xt=y(qt,[["render",Yt]]),Zt=["horizontal","vertical","pan","tilt","roll","zoom"],xt=b({name:"CameraControlSelector",components:{ElSelect:P,ElOption:A,ElSlider:me,ElInputNumber:ue,InfoIcon:V},data(){return{configKeys:Zt}},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||""},selectedModel(){return this.$store.state.kling?.config?.model||""},selectedDuration(){return this.$store.state.kling?.config?.duration},motionControlSupported(){return Q(this.selectedModel,this.selectedMode,this.selectedDuration).motionControl},hasStartImage(){return!!this.$store.state.kling?.config?.start_image_url},disabled(){return!this.motionControlSupported||this.hasStartImage},tooltipContent(){return this.motionControlSupported?this.hasStartImage?this.$t("kling.description.cameraControlDisabledImage2Video"):this.$t("kling.description.cameraControl"):this.$t("kling.description.cameraControlNotSupported")},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"},m={...a.config||{}};t==null?delete m[e]:m[e]=t,this.$store.commit("kling/setConfig",{...s,camera_control:{...a,type:"simple",config:m}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),eo={class:"field"},to={class:"header"},oo={class:"text-sm font-bold"},no={key:0,class:"config-grid"},so={class:"cfg-row-head"},io={class:"cfg-name"};function lo(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select"),c=o("el-input-number"),v=o("el-slider");return l(),u("div",eo,[i("div",to,[i("span",oo,r(e.$t("kling.name.cameraControl")),1),n(d,{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),u(I,null,T(e.typeOptions,g=>(l(),S(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(),u("div",no,[(l(!0),u(I,null,T(e.configKeys,g=>(l(),u("div",{key:g,class:"cfg-row"},[i("div",so,[i("span",io,r(e.$t(`kling.name.cc_${g}`)),1),n(c,{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 ao=y(xt,[["render",lo],["__scopeId","data-v-cd896060"]]),fe=[{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 ro(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 m of s)if(a.includes(m)){a=a.replace(m,"");break}return a.replace(/(?:,\s*)+$/,"").replace(/^(?:,\s*)+/,"")}const co=b({name:"InspirationPills",components:{FontAwesomeIcon:E},computed:{prompt(){return this.$store.state.kling?.config?.prompt||""},allChipTexts(){return fe.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})}}}),uo={key:0,class:"pills",role:"list"},mo={class:"pill-text"},po=["aria-label","onClick"];function go(e,t,s,a,m,$){const d=o("font-awesome-icon");return e.selected.length>0?(l(),u("div",uo,[(l(!0),u(I,null,T(e.selected,p=>(l(),u("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:be(f=>e.onRemove(p),["stop"])},[n(d,{icon:"fa-solid fa-xmark"})],8,po)]))),128))])):k("",!0)}const fo=y(co,[["render",go],["__scopeId","data-v-5fc4fa65"]]),ho="",_o=b({name:"PromptInput",components:{ElInput:J,ElButton:L,FontAwesomeIcon:E,InfoIcon:V,InspirationPills:fo},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=ho)}}),$o={class:"field"},vo={class:"box"},ko={class:"title font-bold"},bo={class:"actions"};function yo(e,t,s,a,m,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("info-icon"),c=o("inspiration-pills"),v=o("el-input");return l(),u("div",$o,[i("div",vo,[i("h2",ko,r(e.$t("kling.name.prompt")),1),i("div",bo,[n(p,{text:"",size:"small",class:"inspiration-btn",onClick:t[0]||(t[0]=g=>e.$emit("open-inspiration"))},{default:h(()=>[n(d,{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(c),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 wo=y(_o,[["render",yo],["__scopeId","data-v-0a5c57b8"]]),Co="",So=b({name:"NegativePromptInput",components:{ElInput:J,InfoIcon:V},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=Co)}}),Vo={class:"field"},Io={class:"box"},To={class:"title font-bold"};function Eo(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-input");return l(),u("div",Vo,[i("div",Io,[i("h2",To,r(e.$t("kling.name.negativePrompt")),1),n(d,{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 Lo=y(So,[["render",Eo],["__scopeId","data-v-de98cf01"]]),Mo=b({name:"InspirationDrawer",components:{ElDrawer:ce,ElButton:L,FontAwesomeIcon:E},props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],data(){return{groups:fe,Close:ye}},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(ro(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)}}}),Ro={class:"drawer-content"},Uo={class:"drawer-header"},Do={class:"title-row"},Ao={class:"title"},Po={class:"hint"},Go={key:0,class:"selected-bar"},Ko={class:"selected-text"},Oo={class:"groups"},jo={class:"group-title"},No={class:"chip-grid"},Bo=["onClick"];function zo(e,t,s,a,m,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),S(f,{modelValue:e.visible,"onUpdate:modelValue":t[1]||(t[1]=c=>e.visible=c),direction:"rtl","with-header":!1,size:e.drawerSize,"custom-class":"kling-inspiration-drawer","destroy-on-close":!1},{default:h(()=>[i("div",Ro,[i("div",Uo,[i("div",Do,[n(d,{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]=c=>e.visible=!1)},null,8,["icon"])]),i("div",Po,r(e.$t("kling.inspiration.hint")),1),e.selectedCount>0?(l(),u("div",Go,[i("span",Ko,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",Oo,[(l(!0),u(I,null,T(e.groups,c=>(l(),u("div",{key:c.groupKey,class:"group"},[i("div",jo,r(e.$t(`kling.inspiration.group.${c.groupKey}`)),1),i("div",No,[(l(!0),u(I,null,T(c.chipKeys,v=>(l(),u("button",{key:v,type:"button",class:U({chip:!0,active:e.isSelected(e.chipText(v))}),onClick:g=>e.onToggle(e.chipText(v))},r(e.chipText(v)),11,Bo))),128))])]))),128))])])]),_:1},8,["modelValue","size"])}const Fo=y(Mo,[["render",zo],["__scopeId","data-v-7d457a69"]]),qo={"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"},Ho={std:"720p",pro:"1080p","4k":"4K"},Wo=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 qo[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||""},modeLabel(){const e=this.config?.mode||"std";return Ho[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),Jo={class:"summary-chip"},Qo=["title"],Yo=["title"],Xo=["title"],Zo=["title"],xo=["title"];function en(e,t,s,a,m,$){const d=o("font-awesome-icon");return l(),u("div",Jo,[i("span",{class:"part",title:e.$t("kling.name.model")},r(e.modelLabel),9,Qo),t[0]||(t[0]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.duration")},r(e.durationLabel),9,Yo),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,Xo),t[2]||(t[2]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.mode")},r(e.modeLabel),9,Zo),e.generateAudio?(l(),u("span",{key:0,class:"audio",title:e.$t("kling.name.generateAudio")},[n(d,{icon:"fa-solid fa-headphones"})],8,xo)):k("",!0)])}const tn=y(Wo,[["render",en],["__scopeId","data-v-418a6733"]]),on=b({name:"ConfigPanel",components:{ElButton:L,Consumption:de,FontAwesomeIcon:E,PromptInput:wo,NegativePromptInput:Lo,ModelSelector:xe,ModeSelector:lt,DurationSelector:ft,RatioSelector:yt,StartImage:Et,CfgScaleSelector:Ft,GenerateAudioSelector:Xt,CameraControlSelector:ao,InspirationDrawer:Fo,SummaryChip:tn,EndImage:Pt},emits:["generate"],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},consumption(){return ge(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit("generate")}}}),nn={class:"flex flex-col h-full"},sn={class:"flex-1 overflow-y-auto p-5"},ln={class:"flex flex-col items-center justify-center px-5 pb-5"};function an(e,t,s,a,m,$){const d=o("prompt-input"),p=o("model-selector"),f=o("ratio-selector"),c=o("start-image"),v=o("end-image"),g=o("duration-selector"),_=o("mode-selector"),M=o("generate-audio-selector"),R=o("camera-control-selector"),j=o("cfg-scale-selector"),he=o("negative-prompt-input"),_e=o("summary-chip"),$e=o("consumption"),Z=o("font-awesome-icon"),x=o("el-button"),ve=o("inspiration-drawer");return l(),u("div",nn,[i("div",sn,[n(d,{class:"mb-4",onOpenInspiration:t[0]||(t[0]=ee=>e.inspirationOpen=!0)}),n(p,{class:"mb-4"}),n(f,{class:"mb-4"}),n(c,{class:"mb-2"}),n(v,{class:"mb-2"}),n(g,{class:"mb-4"}),n(_,{class:"mb-4"}),n(M,{class:"mb-4"}),n(R,{class:"mb-4"}),n(j,{class:"mb-4"}),n(he,{class:"mb-4"})]),i("div",ln,[n(_e),n($e,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(l(),S(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(),S(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(ve,{modelValue:e.inspirationOpen,"onUpdate:modelValue":t[1]||(t[1]=ee=>e.inspirationOpen=ee)},null,8,["modelValue"])])}const rn=y(on,[["render",an]]),cn=b({name:"MotionImage",components:{ElUpload:O,ElButton:L,InfoIcon:V,FontAwesomeIcon:E,ImagePreview:K},mixins:[H],data(){return{fileList:[],uploadUrl:G()+"/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()}}}),dn={class:"relative"},un={class:"flex justify-between"},mn={class:"flex justify-start items-center"},pn={class:"text-sm font-bold"};function gn(e,t,s,a,m,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),v=o("el-upload");return l(),u("div",dn,[i("div",un,[i("div",mn,[i("span",pn,r(e.$t("kling.name.motionImage")),1),n(d,{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(),S(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(c,{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 fn=y(cn,[["render",gn],["__scopeId","data-v-37d42da7"]]),hn=b({name:"MotionVideo",components:{ElUpload:O,ElButton:L,InfoIcon:V,FilePreview:Me,FontAwesomeIcon:E},data(){return{fileList:[],uploadUrl:G()+"/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()}}}),_n={class:"relative"},$n={class:"flex justify-between"},vn={class:"flex justify-start items-center"},kn={class:"text-sm font-bold"};function bn(e,t,s,a,m,$){const d=o("info-icon"),p=o("file-preview"),f=o("font-awesome-icon"),c=o("el-button"),v=o("el-upload");return l(),u("div",_n,[i("div",$n,[i("div",vn,[i("span",kn,r(e.$t("kling.name.motionVideo")),1),n(d,{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(),S(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(c,{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 yn=y(hn,[["render",bn],["__scopeId","data-v-5cf93212"]]),wn=b({name:"MotionPromptInput",components:{ElInput:J,InfoIcon:V},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||""},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),Cn={class:"field"},Sn={class:"box"},Vn={class:"title font-bold"};function In(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-input");return l(),u("div",Cn,[i("div",Sn,[i("h2",Vn,r(e.$t("kling.name.motionPrompt")),1),n(d,{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(wn,[["render",In],["__scopeId","data-v-ca9fdbe5"]]),le="video",En=b({name:"CharacterOrientationSelector",components:{ElRadioGroup:Ue,ElRadioButton:Re,InfoIcon:V},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||le},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=le)}}),Ln={class:"field"},Mn={class:"header"},Rn={class:"text-sm font-bold"};function Un(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-radio-button"),f=o("el-radio-group");return l(),u("div",Ln,[i("div",Mn,[i("span",Rn,r(e.$t("kling.name.characterOrientation")),1),n(d,{content:e.$t("kling.description.characterOrientation")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),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 Dn=y(En,[["render",Un],["__scopeId","data-v-7a91195b"]]),ae="std",An=b({name:"MotionModeSelector",components:{ElSelect:P,ElOption:A,InfoIcon:V},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||ae},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=ae)}}),Pn={class:"field"},Gn={class:"header"},Kn={class:"title font-bold"};function On(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),u("div",Pn,[i("div",Gn,[i("h2",Kn,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.motionMode")},null,8,["content"])]),n(f,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),class:"value",placeholder:e.$t("kling.placeholder.select")},{default:h(()=>[(l(!0),u(I,null,T(e.options,c=>(l(),S(p,{key:c.value,label:c.label,value:c.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const jn=y(An,[["render",On],["__scopeId","data-v-1295688c"]]),Nn=b({name:"KeepOriginalSoundSelector",components:{ElSwitch:pe,InfoIcon:V},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"})}}}}),Bn={class:"relative"},zn={class:"flex justify-between items-center"},Fn={class:"flex justify-start items-center"},qn={class:"text-sm font-bold"};function Hn(e,t,s,a,m,$){const d=o("info-icon"),p=o("el-switch");return l(),u("div",Bn,[i("div",zn,[i("div",Fn,[i("span",qn,r(e.$t("kling.name.keepOriginalSound")),1),n(d,{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 Wn=y(Nn,[["render",Hn]]),Jn=b({name:"MotionPanel",components:{ElButton:L,FontAwesomeIcon:E,Consumption:de,MotionImage:fn,MotionVideo:yn,MotionPromptInput:Tn,CharacterOrientationSelector:Dn,MotionModeSelector:jn,KeepOriginalSoundSelector:Wn},emits:["generate"],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return ge(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")}}}),Qn={class:"flex flex-col h-full"},Yn={class:"flex-1 overflow-y-auto p-5"},Xn={class:"flex flex-col items-center justify-center px-5 pb-5"};function Zn(e,t,s,a,m,$){const d=o("motion-image"),p=o("motion-video"),f=o("motion-prompt-input"),c=o("character-orientation-selector"),v=o("motion-mode-selector"),g=o("keep-original-sound-selector"),_=o("consumption"),M=o("font-awesome-icon"),R=o("el-button");return l(),u("div",Qn,[i("div",Yn,[n(d,{class:"mb-3"}),n(p,{class:"mb-3"}),n(f,{class:"mb-4"}),n(c,{class:"mb-4"}),n(v,{class:"mb-4"}),n(g,{class:"mb-4"})]),i("div",Xn,[n(_,{value:e.consumption,service:e.service},null,8,["value","service"]),n(R,{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 xn=y(Jn,[["render",Zn]]),es=b({name:"KlingTabSwitcher",components:{ElTabs:Ae,ElTabPane:De,ElTag:we},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)}}}),ts=["title"],os={class:"text"};function ns(e,t,s,a,m,$){const d=o("el-tag"),p=o("el-tab-pane"),f=o("el-tabs");return l(),S(f,{"model-value":e.modelValue,class:"kling-tabs",stretch:"","onUpdate:modelValue":e.onUpdate},{default:h(()=>[(l(!0),u(I,null,T(e.tabs,c=>(l(),S(p,{key:c.value,name:c.value,disabled:c.disabled},{label:h(()=>[i("span",{class:"tab-label",title:c.disabled?c.disabledReason:void 0},[i("span",os,r(c.label),1),c.badge?(l(),S(d,{key:0,size:"small",type:"warning",class:"badge"},{default:h(()=>[w(r(c.badge),1)]),_:2},1024)):k("",!0)],8,ts)]),_:2},1032,["name","disabled"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])}const ss=y(es,[["render",ns],["__scopeId","data-v-bf00c27e"]]),is=b({name:"TaskPreview",components:{ElImage:Oe,CopyToClipboard:Pe,FontAwesomeIcon:E,ElAlert:Ke,VideoPlayer:Ge,ElTooltip:W,ElButton:L,ImagePreview:K},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")}}}),ls={class:"preview"},as={class:"left"},rs={class:"main"},cs={class:"bot"},ds={class:"datetime"},us={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"},gs={key:0},fs={key:1},hs={key:0,class:U({content:!0,failed:!0})},_s={key:0,class:"mb-4"},$s={key:1,class:U({operations:!0,"mt-2":!0})},vs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ks={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},bs={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},ys={key:1,class:U({content:!0})},ws={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Cs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Ss={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"},Is={key:2,class:U({content:!0})},Ts={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Es={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Ls(e,t,s,a,m,$){const d=o("el-image"),p=o("image-preview"),f=o("video-player"),c=o("el-button"),v=o("el-tooltip"),g=o("font-awesome-icon"),_=o("copy-to-clipboard"),M=o("el-alert");return l(),u("div",ls,[i("div",as,[n(d,{src:"https://cdn.acedata.cloud/qpbbbb.jpg",class:"avatar"})]),i("div",rs,[i("div",cs,[w(r(e.$t("kling.name.klingBot"))+" ",1),i("span",ds,r(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),i("div",us,[e.referenceImages.length>0?(l(),u("div",ms,[(l(!0),u(I,null,T(e.referenceImages,(R,j)=>(l(),S(p,{key:j,url:R.url,name:R.name,closable:!1},null,8,["url","name"]))),128))])):k("",!0),e.modelValue?.request?.prompt?(l(),u("p",ps,[w(r(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?k("",!0):(l(),u("span",gs," - ("+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(),u("span",fs," - ("+r(e.$t("kling.status.processing"))+") ",1)):k("",!0)])):k("",!0)]),e.modelValue?.response?.success===!0?(l(),u("div",hs,[e.modelValue?.response.video_url?(l(),u("div",_s,[n(f,{src:e.modelValue?.response.video_url},null,8,["src"])])):k("",!0),e.modelValue?.response.success?(l(),u("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(),S(c,{key:0,type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=R=>e.onDownload(R,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",vs,[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",ks,[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(),u("p",bs,[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(),u("div",ys,[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",ws,[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",Cs,[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(),u("p",Ss,[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(),u("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(),u("div",Is,[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(),u("p",Es,[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 Ms=y(is,[["render",Ls],["__scopeId","data-v-e8e87659"]]),Rs=b({name:"RecentPanel",components:{TaskPreview:Ms,NoTasks:Ne,BotPlaceholder:je,ScrollList:Ee},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},Ds={key:2,class:"w-full h-full flex items-center justify-center"};function As(e,t,s,a,m,$){const d=o("bot-placeholder"),p=o("task-preview"),f=o("scroll-list"),c=o("no-tasks");return l(),u(I,null,[e.tasks?.items===void 0?(l(),u("div",Us,[n(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(l(),S(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),u(I,null,T(e.tasks?.items,v=>(l(),S(p,{key:v.id,"model-value":v},null,8,["model-value"]))),128))]),_:1},8,["loading"])):k("",!0),e.tasks?.items?.length===0?(l(),u("div",Ds,[n(c)])):k("",!0)],64)}const Ps=y(Rs,[["render",As]]),re=Ce("kling"),Gs=b({name:"KlingIndex",components:{ConfigPanel:rn,MotionPanel:xn,TabSwitcher:ss,Layout:We,RecentPanel:Ps},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===ne.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===ne.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 Le({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:re};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(([,m])=>m!=null))}:{}});const a=this.credential?.token;if(!a){console.error("no token specified");return}C.info(this.$t("kling.message.startingTask")),te("kling",oe.generate(s,{token:a})).then(()=>{C.success(this.$t("kling.message.startTaskSuccess"))}).catch(m=>{m?.response?.data?.error?.code===ie?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:re},s=this.credential?.token;if(!s){console.error("no token specified");return}C.info(this.$t("kling.message.startingTask")),te("kling",oe.motion(t,{token:s})).then(()=>{C.success(this.$t("kling.message.startTaskSuccess"))}).catch(a=>{a?.response?.data?.error?.code===ie?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)})}}}),Ks={class:"flex flex-col h-full"},Os={class:"flex-1 min-h-0"};function js(e,t,s,a,m,$){const d=o("tab-switcher"),p=o("config-panel"),f=o("motion-panel"),c=o("recent-panel"),v=o("layout");return l(),S(v,null,{config:h(()=>[i("div",Ks,[n(d,{"model-value":e.taskType,"onUpdate:modelValue":e.onTabChange},null,8,["model-value","onUpdate:modelValue"]),i("div",Os,[e.taskType==="videos"?(l(),S(p,{key:0,onGenerate:e.onGenerate},null,8,["onGenerate"])):e.taskType==="motion"?(l(),S(f,{key:1,onGenerate:e.onGenerateMotion},null,8,["onGenerate"])):k("",!0)])])]),result:h(()=>[n(c,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Ni=y(Gs,[["render",js]]);export{Ni as default};
|