@acedatacloud/nexior 3.203.0 → 3.205.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (230) hide show
  1. package/dist/assets/{Auth-DUFzetw2.js → Auth-Btt6pTzH.js} +1 -1
  2. package/dist/assets/{BotPlaceholder-CRRj0hwS.js → BotPlaceholder-GbwaSlCU.js} +1 -1
  3. package/dist/assets/{Callback-B4EUvaCL.js → Callback-6bnjihNg.js} +1 -1
  4. package/dist/assets/{Console-BShnH0ti.js → Console-Bn90NCY-.js} +1 -1
  5. package/dist/assets/{Consumption-DXWduK4n.js → Consumption-u-UR3f-q.js} +1 -1
  6. package/dist/assets/{Conversation-BsahwswE.js → Conversation-B236gz7t.js} +2 -2
  7. package/dist/assets/{Conversation-D3YIT_VZ.css → Conversation-gooHvzqo.css} +1 -1
  8. package/dist/assets/{CopyToClipboard-CuF3QZ08.js → CopyToClipboard-D2Ga1c-u.js} +1 -1
  9. package/dist/assets/{Detail-BTBqxKg4.js → Detail-oNEtAZgY.js} +2 -2
  10. package/dist/assets/{Extra-DRENV3G9.js → Extra-CMvAIjee.js} +1 -1
  11. package/dist/assets/{FilePreview-CbuZ_q3W.js → FilePreview-Yk89uJgC.js} +1 -1
  12. package/dist/assets/{History-DMiuEJ4T.js → History-DO_r5ZBS.js} +1 -1
  13. package/dist/assets/{IconPark.vue_vue_type_script_setup_true_lang-zzS6mdH2.js → IconPark.vue_vue_type_script_setup_true_lang-nuNysgL0.js} +1 -1
  14. package/dist/assets/{ImagePreview-Cpvb69ki.js → ImagePreview-D1oWKxPX.js} +1 -1
  15. package/dist/assets/{ImageWrapper-gJPufYGz.js → ImageWrapper-Dbzrv2-m.js} +1 -1
  16. package/dist/assets/{Index-BH-OJpve.js → Index-A_818KJU.js} +1 -1
  17. package/dist/assets/{Index-BR6CNirR.js → Index-B3FK7MLi.js} +1 -1
  18. package/dist/assets/{Index-Bus3UQhi.js → Index-BA6dCZyp.js} +1 -1
  19. package/dist/assets/{Index-7pYyBR9w.js → Index-BEYXqwoX.js} +1 -1
  20. package/dist/assets/{Index-ByLrdaWH.js → Index-BU42x1W5.js} +1 -1
  21. package/dist/assets/{Index-B33qjy50.js → Index-BaHzFWAO.js} +1 -1
  22. package/dist/assets/{Index-C2R1OZlQ.css → Index-BcDDMvCj.css} +1 -1
  23. package/dist/assets/{Index-DbbogiFB.js → Index-Bog-6D8K.js} +1 -1
  24. package/dist/assets/Index-CANAzSKl.js +1 -0
  25. package/dist/assets/{Index-BEEe3pDK.js → Index-CMjs-Qul.js} +1 -1
  26. package/dist/assets/{Index-BVHr_YF1.js → Index-CxTnIz2F.js} +1 -1
  27. package/dist/assets/{Index-BtY-Lr1k.js → Index-CzYaOkvn.js} +1 -1
  28. package/dist/assets/{Index-HrUzK942.js → Index-D3UpAz6H.js} +1 -1
  29. package/dist/assets/{Index-CfehYZGs.js → Index-D4esh723.js} +1 -1
  30. package/dist/assets/{Index-DM3DYz3f.js → Index-DFsyexVb.js} +1 -1
  31. package/dist/assets/{Index-CA4q5rLq.js → Index-DQdtAMmP.js} +1 -1
  32. package/dist/assets/{Index-4ewuY1y1.js → Index-Dnhq1F1O.js} +1 -1
  33. package/dist/assets/{Index-A_rmhMO1.js → Index-DuSZYydg.js} +1 -1
  34. package/dist/assets/{Index-B6LbPipT.js → Index-NrPbPLrH.js} +1 -1
  35. package/dist/assets/{Index-CHEo7crO.js → Index-guCuU9Rs.js} +1 -1
  36. package/dist/assets/{Index-N2sxatf4.js → Index-intZBKTu.js} +1 -1
  37. package/dist/assets/{Index-DbCP2kOv.js → Index-maB8zCCx.js} +1 -1
  38. package/dist/assets/{Index-D0jrtdoW.js → Index-o_IsP2YJ.js} +1 -1
  39. package/dist/assets/{Index-dQ6j-Tqr.js → Index-qaq-7Ral.js} +1 -1
  40. package/dist/assets/{Index-0SI2_IeX.js → Index-zY-gqgEu.js} +1 -1
  41. package/dist/assets/{Invitees-BwIvG-dc.js → Invitees-C80sJA3k.js} +1 -1
  42. package/dist/assets/{List-DvZBL0iT.js → List-BOh2SJ43.js} +1 -1
  43. package/dist/assets/{List-B5Pwy4Jn.js → List-I9SkQS_G.js} +1 -1
  44. package/dist/assets/{List-BpoEU7cw.js → List-pzJh_k1y.js} +1 -1
  45. package/dist/assets/{Main-DANw_LB6.js → Main-CRYuEUBO.js} +1 -1
  46. package/dist/assets/{Navigator-DT5wYM9i.js → Navigator-Dc6k1r-K.js} +1 -1
  47. package/dist/assets/{NoTasks-2V-AkMAB.js → NoTasks-COwD2YRA.js} +1 -1
  48. package/dist/assets/{NotFound-Dg6aEeLg.js → NotFound-BMpwg9qq.js} +1 -1
  49. package/dist/assets/{OAuthCallback-D8POZ8LG.js → OAuthCallback-PTvOC1Gl.js} +1 -1
  50. package/dist/assets/{Pagination-Cqnc5WiV.js → Pagination-C-hIzPuE.js} +1 -1
  51. package/dist/assets/{Status-klykZMmH.js → Status-BYtt2-8H.js} +1 -1
  52. package/dist/assets/{Subscribe-COhpiaG9.js → Subscribe-B8s-qAbr.js} +1 -1
  53. package/dist/assets/{VideoPlayer-CL8By14M.js → VideoPlayer-BOBrupFS.js} +1 -1
  54. package/dist/assets/{_Uint8Array-ByQwykQe.js → _Uint8Array-DiKiqj6b.js} +1 -1
  55. package/dist/assets/{_baseClone-CVuCG1nJ.js → _baseClone-C7mAsPbg.js} +1 -1
  56. package/dist/assets/{_baseIteratee-NPUbMVeM.js → _baseIteratee-CCcx0UCd.js} +1 -1
  57. package/dist/assets/{_initCloneObject-DuTLs5Xf.js → _initCloneObject-DHUwupd_.js} +1 -1
  58. package/dist/assets/{add-D7RYZqqC.js → add-CSsqG6iy.js} +1 -1
  59. package/dist/assets/{all-wallets-DCozoJ9E.js → all-wallets-1OJm3jva.js} +1 -1
  60. package/dist/assets/{app-store-Qpon0uyr.js → app-store-DwcBjzfw.js} +1 -1
  61. package/dist/assets/{apple-CqSfKtiL.js → apple-Capy_-dR.js} +1 -1
  62. package/dist/assets/{arrow-bottom-circle-C_FYvfgO.js → arrow-bottom-circle-jqUJnDqL.js} +1 -1
  63. package/dist/assets/{arrow-bottom-BG-oHL4h.js → arrow-bottom-q2UE3M6K.js} +1 -1
  64. package/dist/assets/{arrow-left-D3FTAsgT.js → arrow-left-CerC92Jn.js} +1 -1
  65. package/dist/assets/{arrow-right-GgQ3YkNb.js → arrow-right-sSGRyesI.js} +1 -1
  66. package/dist/assets/{arrow-top-CYG8-QbH.js → arrow-top-CyE3s4u-.js} +1 -1
  67. package/dist/assets/{avatar-1gs2ZrkM.js → avatar-DpWKzwfa.js} +1 -1
  68. package/dist/assets/{bank-8E-UIlMh.js → bank-5oUKAhup.js} +1 -1
  69. package/dist/assets/{basic-DzL0o1K4.js → basic-CWywewhV.js} +1 -1
  70. package/dist/assets/{browser-C9Q5nASq.js → browser-yYidcVNO.js} +1 -1
  71. package/dist/assets/{byokCredential-B86s6zs-.js → byokCredential-BcQvQTIB.js} +1 -1
  72. package/dist/assets/{card-qufqUxv8.js → card-DHXL-Qg2.js} +1 -1
  73. package/dist/assets/{castArray-DSy3F7mH.js → castArray-DbfVevQg.js} +1 -1
  74. package/dist/assets/{chat-BIsCQqq-.js → chat-z19dTmYH.js} +1 -1
  75. package/dist/assets/{checkmark-DbODpJfz.js → checkmark-CRou_fdo.js} +1 -1
  76. package/dist/assets/{checkmark-bold-Be3Fld0Z.js → checkmark-bold--Izc2Ajz.js} +1 -1
  77. package/dist/assets/{chevron-bottom-C0iPmRnr.js → chevron-bottom-CZmGJFDf.js} +1 -1
  78. package/dist/assets/{chevron-left-DtRe95p9.js → chevron-left-HROvGwkU.js} +1 -1
  79. package/dist/assets/{chevron-right-BjoN7RB_.js → chevron-right-C9KoNV5n.js} +1 -1
  80. package/dist/assets/{chevron-top-DlnWxMcB.js → chevron-top-DTdArReJ.js} +1 -1
  81. package/dist/assets/{chrome-store-B7jS85Hd.js → chrome-store-BoA_e9cR.js} +1 -1
  82. package/dist/assets/{clock-BGAbxmeL.js → clock-yRQK7DSS.js} +1 -1
  83. package/dist/assets/{close-eFMryeK5.js → close-BcIEenO0.js} +1 -1
  84. package/dist/assets/{coinPlaceholder-CAlf91Ni.js → coinPlaceholder-EORJQyP2.js} +1 -1
  85. package/dist/assets/{compass-N-9WbXYy.js → compass-f-RMWYy7.js} +1 -1
  86. package/dist/assets/{copy-CjXY2DNa.js → copy-Cn5Tw6Rm.js} +1 -1
  87. package/dist/assets/{createTaskActions-CsyYZHHP.js → createTaskActions-Slgod3XK.js} +1 -1
  88. package/dist/assets/{cursor-Yle3tVYh.js → cursor-Df5BNRuc.js} +1 -1
  89. package/dist/assets/{cursor-transparent-DofGz4K6.js → cursor-transparent-DK7kEr72.js} +1 -1
  90. package/dist/assets/{debounce-CbU1MTVp.js → debounce-B-jn60n6.js} +1 -1
  91. package/dist/assets/{desktop-CnTgCH4E.js → desktop-C0WJURcd.js} +1 -1
  92. package/dist/assets/{disconnect-DKWBdElb.js → disconnect-H9Q2ggqk.js} +1 -1
  93. package/dist/assets/{discord-Ck_aPA-Y.js → discord-IeB0eQXY.js} +1 -1
  94. package/dist/assets/{distribution-BnkgnnAN.js → distribution-BtThzIIU.js} +1 -1
  95. package/dist/assets/{dropdown-KEOvlncg.js → dropdown-C7n2JFJ_.js} +1 -1
  96. package/dist/assets/{etherscan-DgVc_bjV.js → etherscan-DmPkk5ZH.js} +1 -1
  97. package/dist/assets/{exclamation-triangle-Dehq1szL.js → exclamation-triangle-CaSPxuc8.js} +1 -1
  98. package/dist/assets/{extension-W8jqJyub.js → extension-D_lQmWk_.js} +1 -1
  99. package/dist/assets/{external-link-D_Uz4J1I.js → external-link-BPp-vd1d.js} +1 -1
  100. package/dist/assets/{facebook-Dy_Dw4vN.js → facebook-DU8HW7fL.js} +1 -1
  101. package/dist/assets/{farcaster-BhCexQ7k.js → farcaster-BCDodja_.js} +1 -1
  102. package/dist/assets/{filters-BYzDtbTu.js → filters-CAQNbjLT.js} +1 -1
  103. package/dist/assets/{github-D-beXVIq.js → github-BRBavveb.js} +1 -1
  104. package/dist/assets/{google--8k0V5PL.js → google-BTV7MOZy.js} +1 -1
  105. package/dist/assets/{help-circle-m6j9e9tz.js → help-circle-CXPct6kV.js} +1 -1
  106. package/dist/assets/{id-06DKxLBv.js → id-CWX0WcMk.js} +1 -1
  107. package/dist/assets/{image-BOx5I_fA.js → image-CEgaw_wF.js} +1 -1
  108. package/dist/assets/{index-CrTOkZ2r.js → index--wj6jIMm.js} +1 -1
  109. package/dist/assets/{index-BUqlYyrf.js → index-1ShHusMJ.js} +1 -1
  110. package/dist/assets/{index-BMxdobCB.js → index-8PxRxOr7.js} +1 -1
  111. package/dist/assets/{index-wI0q60KJ.js → index-AY_a57-2.js} +1 -1
  112. package/dist/assets/{index-CS3X4mU1.js → index-B0Cwb-D-.js} +1 -1
  113. package/dist/assets/{index-DKcZ1-1z.js → index-B3rcDSvw.js} +1 -1
  114. package/dist/assets/{index-Cu0Fq87q.js → index-BLpimmhu.js} +1 -1
  115. package/dist/assets/{index-CrP99DNt.js → index-BNnRgS-m.js} +1 -1
  116. package/dist/assets/{index-BGvu5xO5.js → index-BPk2ZoOA.js} +1 -1
  117. package/dist/assets/{index-BKIdgOsV.js → index-BRkjZCA9.js} +1 -1
  118. package/dist/assets/{index-bGou8-zw.js → index-BXRm1Wkj.js} +1 -1
  119. package/dist/assets/{index-C1X4AkSR.js → index-Barfweya.js} +1 -1
  120. package/dist/assets/{index-Cxyt7zfv.js → index-BbSliDK4.js} +1 -1
  121. package/dist/assets/{index-DnSC7fOc.js → index-BcNn3Owf.js} +1 -1
  122. package/dist/assets/{index-d_EebTax.js → index-BexlGeiF.js} +1 -1
  123. package/dist/assets/{index-BX0VGV5m.js → index-BezIKGY2.js} +1 -1
  124. package/dist/assets/{index-DPDsvcmI.js → index-BiY8NhQz.js} +1 -1
  125. package/dist/assets/{index-B2GV1dfF.js → index-BjCVlRvR.js} +1 -1
  126. package/dist/assets/{index-BoDGWIdj.js → index-Bj_l3YE1.js} +1 -1
  127. package/dist/assets/{index-CjlOGyuX.js → index-BxqWObY-.js} +1 -1
  128. package/dist/assets/{index-Dw0XlXd5.js → index-CC1GYYiO.js} +1 -1
  129. package/dist/assets/{index-CTqycz8P.js → index-CF3WiTXj.js} +1 -1
  130. package/dist/assets/{index-CXYP5r_e.js → index-CJ8YZq-e.js} +1 -1
  131. package/dist/assets/{index-B12PJ7rt.js → index-CJU1rzzV.js} +1 -1
  132. package/dist/assets/{index-RnvG4OW2.js → index-CL16wKMg.js} +1 -1
  133. package/dist/assets/{index-BKwE2jLz.js → index-CYNlas3C.js} +2 -2
  134. package/dist/assets/{index-CELEr2lq.js → index-CfLu_-DC.js} +1 -1
  135. package/dist/assets/{index-mx88Dn1t.js → index-CkfWRF3i.js} +1 -1
  136. package/dist/assets/{index-pdB6FbDq.js → index-CoxAL6cY.js} +1 -1
  137. package/dist/assets/{index-DO-dSlMQ.js → index-CrHljC3L.js} +1 -1
  138. package/dist/assets/{index-D-BXHPQ4.js → index-CrrjzMcm.js} +1 -1
  139. package/dist/assets/{index-DMcEMxEA.js → index-CvXuDec2.js} +1 -1
  140. package/dist/assets/{index-DpIaX31v.js → index-Czr8KjFL.js} +1 -1
  141. package/dist/assets/{index-BS4HjKz4.js → index-D-KZRZPp.js} +1 -1
  142. package/dist/assets/{index-Cw6BPE5r.js → index-D-SiG2bP.js} +1 -1
  143. package/dist/assets/{index-tUkDSIGW.js → index-D4Nfwhot.js} +1 -1
  144. package/dist/assets/{index-vb_jrfN_.js → index-DBQvlqm3.js} +1 -1
  145. package/dist/assets/{index-CL7TuUOi.js → index-DDJccgho.js} +14 -14
  146. package/dist/assets/{index-Dpp2dMoW.js → index-DEzoxp4P.js} +1 -1
  147. package/dist/assets/{index-CtGSe2nE.js → index-DK4DFfU5.js} +1 -1
  148. package/dist/assets/{index-Lac4MwOY.js → index-DPTJ434_.js} +1 -1
  149. package/dist/assets/{index-BIA72oCF.js → index-DRml_940.js} +1 -1
  150. package/dist/assets/{index-BzX9_Qk6.js → index-Db5A7UiS.js} +1 -1
  151. package/dist/assets/{index-BYl8yk8N.js → index-Dh9cN3MT.js} +1 -1
  152. package/dist/assets/{index-ByKCvx-V.js → index-DhEXa3rl.js} +5 -5
  153. package/dist/assets/{index-ClMIGtYN.js → index-DkEDXKbD.js} +1 -1
  154. package/dist/assets/{index-iGjQBm25.js → index-DtUQgyoo.js} +1 -1
  155. package/dist/assets/{index-CCpR9SnF.js → index-DvAK66cN.js} +3 -3
  156. package/dist/assets/{index-Bmql6UmY.js → index-DwdzCCvr.js} +1 -1
  157. package/dist/assets/{index-CqG0SCZo.js → index-E1-z9_FO.js} +1 -1
  158. package/dist/assets/{index-DpTT0-5Q.js → index-Fsk4KlF3.js} +1 -1
  159. package/dist/assets/{index-Cumii8lh.js → index-KTCvYGRT.js} +1 -1
  160. package/dist/assets/{index-96m-hkYP.js → index-NKZy8Kup.js} +1 -1
  161. package/dist/assets/{index-WoXPm836.js → index-WR344acd.js} +1 -1
  162. package/dist/assets/{index-DonhImCq.js → index-XldQDSvy.js} +1 -1
  163. package/dist/assets/{index-DKw5cX1v.js → index-jDtcXBDh.js} +1 -1
  164. package/dist/assets/{index-BdHsLCZe.js → index-jfd6yJXw.js} +1 -1
  165. package/dist/assets/{index-iJy9ihbA.js → index-tp_8uoOw.js} +1 -1
  166. package/dist/assets/{index-Dpr-Jz6A.js → index-vXv88WGu.js} +1 -1
  167. package/dist/assets/{index-CEzHDHOG.js → index-wrqbgHKw.js} +1 -1
  168. package/dist/assets/{index.browser.esm-HvzBt-NK.js → index.browser.esm-BL2Ey0-n.js} +1 -1
  169. package/dist/assets/{index.es-bLqkOFPJ.js → index.es-rfDbxZpm.js} +1 -1
  170. package/dist/assets/{info-I3mKbeQR.js → info-D2l7QzjY.js} +1 -1
  171. package/dist/assets/{info-circle-BqKzuJUA.js → info-circle-BxIOOm5L.js} +1 -1
  172. package/dist/assets/{isEqual-B4Ey1Jwt.js → isEqual-CC5LQv_R.js} +1 -1
  173. package/dist/assets/{isPlainObject-CW75USoc.js → isPlainObject-CJWHXdHh.js} +1 -1
  174. package/dist/assets/{lightbulb-wZEsyk_t.js → lightbulb-BSeFOGXJ.js} +1 -1
  175. package/dist/assets/{mail-ClI9mkBc.js → mail-DpqsFv2K.js} +1 -1
  176. package/dist/assets/{midjourney-1vwKx0X2.js → midjourney-l-1NrC29.js} +1 -1
  177. package/dist/assets/{mobile-Dak0eXSh.js → mobile-Ds7c2ZWr.js} +1 -1
  178. package/dist/assets/{more-D5sPsQvs.js → more-C68tjgQk.js} +1 -1
  179. package/dist/assets/{network-placeholder-txs2_mWx.js → network-placeholder-CwtTGGhG.js} +1 -1
  180. package/dist/assets/{nftPlaceholder-CkjqubsJ.js → nftPlaceholder-BgF5Rv2q.js} +1 -1
  181. package/dist/assets/{off-BTF1zVpp.js → off-DMfVr4lB.js} +1 -1
  182. package/dist/assets/{order-BagVAiAn.js → order-CpYUdg6S.js} +1 -1
  183. package/dist/assets/{pagination-Bk-2VIGU.js → pagination-CDk6ho1i.js} +1 -1
  184. package/dist/assets/{play-store-BwfzpeSG.js → play-store-_lTFJbfW.js} +1 -1
  185. package/dist/assets/{plus-Dz2rbEuo.js → plus-esh9-Ccz.js} +1 -1
  186. package/dist/assets/{price-WUodxvCk.js → price-C2VbzPrG.js} +1 -1
  187. package/dist/assets/{producer-DjwUXBL3.js → producer-CsUqKcEm.js} +1 -1
  188. package/dist/assets/{qr-code-ClaMdLGv.js → qr-code-DJTYtaHd.js} +1 -1
  189. package/dist/assets/{recycle-horizontal-Bcotym0-.js → recycle-horizontal-gDTg51lY.js} +1 -1
  190. package/dist/assets/{refresh-robIIU8x.js → refresh-CkcCQL4X.js} +1 -1
  191. package/dist/assets/{reown-logo-D28SUBV6.js → reown-logo-DhnFwfFL.js} +1 -1
  192. package/dist/assets/{search-DtQXJHVx.js → search-B2klky-Z.js} +1 -1
  193. package/dist/assets/{secp256k1-JLyayAU0.js → secp256k1-Dw7MKfuz.js} +1 -1
  194. package/dist/assets/{secp256k1-P4pdsm_P.js → secp256k1-fj9osoWp.js} +1 -1
  195. package/dist/assets/seedance-BQaoYSWv.js +1 -0
  196. package/dist/assets/seedance-DtUFVb8o.js +1 -0
  197. package/dist/assets/{seedream-C8GNHDAz.js → seedream-BbmlG6zu.js} +1 -1
  198. package/dist/assets/{send-DYV3QOV9.js → send-ssAMcrG8.js} +1 -1
  199. package/dist/assets/{service-Bc0-Godi.js → service-DtKFC7nd.js} +1 -1
  200. package/dist/assets/{solana-wallets-B2WZnqh4.js → solana-wallets-CK9PVGbr.js} +2 -2
  201. package/dist/assets/{solana-wallets-vue-DzZNMPxx.js → solana-wallets-vue-Cmevmy6S.js} +1 -1
  202. package/dist/assets/{suno-SHEJ4RD_.js → suno-DGo39dBP.js} +1 -1
  203. package/dist/assets/{swapHorizontal-B-_zoruq.js → swapHorizontal-BsiptE8y.js} +1 -1
  204. package/dist/assets/{swapHorizontalBold-E9xx3-r0.js → swapHorizontalBold-CGHH4dd4.js} +1 -1
  205. package/dist/assets/{swapHorizontalMedium-CNsLGtwF.js → swapHorizontalMedium-Clk0CMTO.js} +1 -1
  206. package/dist/assets/{swapHorizontalRoundedBold-BxXsBZSd.js → swapHorizontalRoundedBold-DrAICN4o.js} +1 -1
  207. package/dist/assets/{swapVertical-DsMqQLt9.js → swapVertical-QPfaf4dn.js} +1 -1
  208. package/dist/assets/{telegram-Dy9Kb6eZ.js → telegram-B0jmmXS4.js} +1 -1
  209. package/dist/assets/{three-dots-Cwf7_QGO.js → three-dots-DoBM-RdY.js} +1 -1
  210. package/dist/assets/{twitch-DLdAbSj-.js → twitch-5b4vnuPN.js} +1 -1
  211. package/dist/assets/{twitterIcon-BX0Max3r.js → twitterIcon-CEdcIRtK.js} +1 -1
  212. package/dist/assets/{typescript-IWpxm_CC.js → typescript-CCF0uyn2.js} +1 -1
  213. package/dist/assets/{use-form-item-D-4pUYPe.js → use-form-item-1C5uFRHv.js} +1 -1
  214. package/dist/assets/validator-BmyjrUCG.js +1 -0
  215. package/dist/assets/{verify-DcKct_pN.js → verify-D-axKCsE.js} +1 -1
  216. package/dist/assets/{verify-filled-Dy3ODKeC.js → verify-filled-CuVnLSqO.js} +1 -1
  217. package/dist/assets/{w3m-modal-ClehJL7s.js → w3m-modal-vGq_64Af.js} +1 -1
  218. package/dist/assets/{wallet-CMZIsnYx.js → wallet-BH7EYkWk.js} +1 -1
  219. package/dist/assets/{wallet-placeholder-Bv1WlQ_b.js → wallet-placeholder-B0IdRDyC.js} +1 -1
  220. package/dist/assets/{walletconnect-u89e9fil.js → walletconnect-SLf0tztt.js} +1 -1
  221. package/dist/assets/{warning-circle-87x1OBae.js → warning-circle-XnAyhDSJ.js} +1 -1
  222. package/dist/assets/{web-Dmc3cb3N.js → web-DbKxzxyW.js} +1 -1
  223. package/dist/assets/{web-6imsxyib.js → web-U6fQOFKs.js} +1 -1
  224. package/dist/assets/{x-dgIc6Z_5.js → x-DJuIDGAr.js} +1 -1
  225. package/dist/index.html +1 -1
  226. package/package.json +1 -1
  227. package/dist/assets/Index-BmldxyXx.js +0 -1
  228. package/dist/assets/seedance-CT1bTq9V.js +0 -1
  229. package/dist/assets/seedance-D7pgNCSU.js +0 -1
  230. package/dist/assets/validator-B_kytv0P.js +0 -1
@@ -1 +1 @@
1
- import{F as O}from"./index.es-bLqkOFPJ.js";import{E as U}from"./index-vb_jrfN_.js";import{E as Y}from"./index-BS4HjKz4.js";import{d as b,H as i,E as c,z as L,C as a,y as p,D as s,q as t,F as l,O as E,N as I,x as m,Q as C,R as J,J as d,I as _}from"./vendor-vue-NSDaktjZ.js";import{G as k,bj as Q,co as W,aH as K,S as j,cp as Z}from"./index-CL7TuUOi.js";import{a as x,b as ee,c as oe,d as te,e as se,f as ne,g as R,h as ae,i as le,j as ie}from"./veo-Dg8Zhpd-.js";import{E as A,a as P}from"./index-CXYP5r_e.js";import{I as M,S as re,l as ce}from"./pagination-Bk-2VIGU.js";import{E as de}from"./index-DonhImCq.js";import{V as G}from"./VideoPlayer-CL8By14M.js";import{E as D}from"./index-Cw6BPE5r.js";import{p as ue}from"./pasteUploadMixin-BurWbGNQ.js";import{I as pe}from"./ImagePreview-Cpvb69ki.js";import{E as me}from"./index-BzX9_Qk6.js";import{E as T}from"./index-iGjQBm25.js";import{C as ve}from"./Consumption-DXWduK4n.js";import{P as fe,N as _e}from"./NoTasks-2V-AkMAB.js";import{a as he}from"./price-WUodxvCk.js";import{b as $e}from"./errorCode-Cqj9Td_Z.js";import{C as ge}from"./CopyToClipboard-CuF3QZ08.js";import{E as be}from"./index-CtGSe2nE.js";import{E as ke}from"./index-CEzHDHOG.js";import{E as ye}from"./index-mx88Dn1t.js";import{B as Ve}from"./BotPlaceholder-CRRj0hwS.js";import"./use-form-item-D-4pUYPe.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Df5ITouH.js";import"./index-ClMIGtYN.js";import"./typescript-IWpxm_CC.js";import"./index-BGvu5xO5.js";import"./strings-beZM2Y-f.js";import"./isEqual-B4Ey1Jwt.js";import"./_Uint8Array-ByQwykQe.js";import"./castArray-DSy3F7mH.js";import"./debounce-CbU1MTVp.js";import"./_baseIteratee-NPUbMVeM.js";import"./index-CS3X4mU1.js";import"./validator-B_kytv0P.js";import"./vue-plyr-BO2nlN4c.js";import"./index-CqG0SCZo.js";import"./index-B2GV1dfF.js";import"./_baseClone-CVuCG1nJ.js";import"./_initCloneObject-DuTLs5Xf.js";import"./index-DnSC7fOc.js";const we=b({name:"LayoutVeo",components:{ElDrawer:Y,ElButton:U,FontAwesomeIcon:O},data(){return{drawer:!1}}}),Ee={class:"main flex flex-row flex-1"},Te={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},Ie={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function Se(e,o,v,f,y,V){const r=s("font-awesome-icon"),u=s("el-button"),n=s("el-drawer");return t(),i("div",Ee,[c("div",Te,[L(e.$slots,"config",{},void 0,!0)]),c("div",Ie,[L(e.$slots,"result",{},void 0,!0)]),a(u,{circle:"",class:"menu",onClick:o[0]||(o[0]=w=>e.drawer=!0)},{default:p(()=>[a(r,{icon:"fa-solid fa-magic"})]),_:1}),a(n,{modelValue:e.drawer,"onUpdate:modelValue":o[1]||(o[1]=w=>e.drawer=w),direction:"ltr","with-header":!1,size:"350px"},{default:p(()=>[L(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Ce=k(we,[["render",Se],["__scopeId","data-v-9b26d591"]]),Ae=b({name:"ModelSelector",components:{ElSelect:P,ElOption:A},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{options:[{value:"veo2",label:"veo2"},{value:"veo2-fast",label:"veo2-fast"},{value:"veo3",label:"veo3"},{value:"veo3-fast",label:"veo3-fast"},{value:"veo31-fast",label:"veo31-fast"},{value:"veo31",label:"veo31"},{value:"veo31-fast-ingredients",label:"veo31-fast-ingredients"}]}},computed:{value:{get(){return this.$store.state.veo?.config?.model},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,model:e})}}},mounted(){this.value||(this.value=x)}}),Pe={class:"field"},Oe={class:"title font-bold"};function Ue(e,o,v,f,y,V){const r=s("el-option"),u=s("el-select");return t(),i("div",Pe,[c("h2",Oe,l(e.$t("veo.name.model")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=n=>e.value=n),class:"value",placeholder:e.$t("veo.placeholder.select")},{default:p(()=>[(t(!0),i(E,null,I(e.options,n=>(t(),m(r,{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Le=k(Ae,[["render",Ue],["__scopeId","data-v-a59d89c9"]]),je=b({name:"ActionSelector",components:{ElSelect:P,ElOption:A},data(){return{}},computed:{options(){return[{value:"text2video",label:this.$t("veo.button.action1")},{value:"image2video",label:this.$t("veo.button.action2")},{value:"ingredients2video",label:this.$t("veo.button.actionIngredients")},{value:"upsample",label:this.$t("veo.button.actionUpsample")},{value:"extend",label:this.$t("veo.button.actionExtend")},{value:"reshoot",label:this.$t("veo.button.actionReshoot")},{value:"object_insert",label:this.$t("veo.button.actionObjectInsert")},{value:"object_remove",label:this.$t("veo.button.actionObjectRemove")}]},value:{get(){return this.$store.state.veo?.config?.action},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,action:e})}}},mounted(){this.value||(this.value=ee)}}),Re={class:"field"},Me={class:"title font-bold"},Ge={class:"float-left"};function De(e,o,v,f,y,V){const r=s("el-option"),u=s("el-select");return t(),i("div",Re,[c("h2",Me,l(e.$t("veo.name.action")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=n=>e.value=n),class:"value",placeholder:e.$t("veo.placeholder.select"),clearable:""},{default:p(()=>[(t(!0),i(E,null,I(e.options,n=>(t(),m(r,{key:n.value,label:n.label,value:n.value},{default:p(()=>[c("span",Ge,l(n.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Ne=k(je,[["render",De],["__scopeId","data-v-f4d8785c"]]),Fe=b({name:"TranslationSelector",components:{ElSwitch:de,InfoIcon:M},computed:{value:{get(){return this.$store.state.veo?.config?.translation},set(e){console.debug("set translation",e),this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,translation:e})}}},mounted(){this.value===void 0&&(this.value=oe)}}),ze={class:"relative"},Be={class:"flex justify-between"},qe={class:"flex justify-start items-center"},He={class:"text-sm font-bold"},Xe={class:"flex justify-end items-center"};function Ye(e,o,v,f,y,V){const r=s("info-icon"),u=s("el-switch");return t(),i("div",ze,[c("div",Be,[c("div",qe,[c("span",He,l(e.$t("veo.name.translation")),1),a(r,{content:e.$t("veo.description.translation")},null,8,["content"])]),c("div",Xe,[a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=n=>e.value=n),class:"value"},null,8,["modelValue"])])])])}const Je=k(Fe,[["render",Ye]]),Qe=b({name:"AspectRatioSelector",data(){return{options:[{value:"1:1",label:"1:1",width:20,height:20},{value:"4:3",label:"4:3",width:20,height:15},{value:"3:4",label:"3:4",width:15,height:20},{value:"16:9",label:"16:9",width:25,height:13},{value:"9:16",label:"9:16",width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){return this.$store.state.veo?.config?.aspect_ratio},set(e){console.debug("set aspect_ratio",e),this.$store.commit("veo/setConfig",{...this.$store.state?.veo?.config,aspect_ratio:e})}}},mounted(){this.value||(this.value=te)}}),We={class:"text-sm font-bold mb-2 block"},Ke={class:"items"},Ze=["onClick"],xe={class:"name"};function eo(e,o,v,f,y,V){return t(),i("div",null,[c("span",We,l(e.$t("veo.name.ratio")),1),c("div",Ke,[(t(!0),i(E,null,I(e.options,(r,u)=>(t(),i("div",{key:u,class:C({active:e.active===u,item:!0}),onClick:n=>e.value=r.value},[c("div",{class:C(["preview",r.label])},[c("div",{class:"rect",style:J({width:r.width+"px",height:r.height+"px"})},null,4)],2),c("p",xe,l(r.label),1)],10,Ze))),128))])])}const oo=k(Qe,[["render",eo],["__scopeId","data-v-0f16be77"]]),to=b({name:"VideoFromInput",components:{VideoPlayer:G},props:{modelValue:{type:Object,required:!1,default:void 0}},data(){return{options:{quality:{default:"1080p"}}}},computed:{config(){return this.$store.state.veo?.config}}}),so={class:"relative"},no={class:"flex mb-2"},ao={class:"text-sm font-bold"};function lo(e,o,v,f,y,V){const r=s("video-player");return t(),i("div",so,[c("div",no,[c("span",ao,l(e.$t("veo.name.action3")),1)]),c("div",null,[e.config?.video_url?(t(),m(r,{key:0,src:e.config?.video_url},null,8,["src"])):d("",!0)])])}const io=k(to,[["render",lo]]),ro=b({name:"VideoIdInput",components:{ElInput:D},computed:{value:{get(){return this.$store.state.veo?.config?.video_id},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,video_id:e})}}}}),co={class:"field"},uo={class:"title font-bold"};function po(e,o,v,f,y,V){const r=s("el-input");return t(),i("div",co,[c("h2",uo,l(e.$t("veo.name.videoId")),1),a(r,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=u=>e.value=u),class:"value",type:"text",placeholder:e.$t("veo.placeholder.videoId"),clearable:""},null,8,["modelValue","placeholder"])])}const mo=k(ro,[["render",po],["__scopeId","data-v-6eba4026"]]),vo=b({name:"StartEndImage",components:{ElUpload:me,ElButton:U,InfoIcon:M,FontAwesomeIcon:O,ImagePreview:pe},mixins:[ue],emits:["change"],data(){return{fileList:[],uploadUrl:Q()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.veo?.config?.image_urls},set(){}}},mounted(){this.value||(this.value=void 0),this.onSetStartEndImageUrl()},methods:{onExceed(){T.warning(this.$t("veo.message.uploadReferencesExceed"))},onError(){T.error(this.$t("veo.message.uploadReferencesError"))},onSetStartEndImageUrl(){const e=this.urls;this.$store.commit("veo/setConfig",{...this.$store.state?.veo?.config,image_urls:e})},async onSuccess(){this.onSetStartEndImageUrl()}}}),fo={class:"relative"},_o={class:"flex justify-between"},ho={class:"flex justify-start items-center"},$o={class:"text-sm font-bold"};function go(e,o,v,f,y,V){const r=s("info-icon"),u=s("image-preview"),n=s("font-awesome-icon"),w=s("el-button"),$=s("el-upload");return t(),i("div",fo,[c("div",_o,[c("div",ho,[c("span",$o,l(e.$t("veo.name.startEndImage")),1),a(r,{content:e.$t("veo.description.uploadStartEndImage")},null,8,["content"])])]),a($,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":o[0]||(o[0]=h=>e.fileList=h),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:2,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:p(({file:h})=>[h.url&&h.percentage!==void 0?(t(),m(u,{key:0,url:h.url,name:h.name,percentage:h.percentage,onRemove:S=>e.fileList.splice(e.fileList.indexOf(h),1)},null,8,["url","name","percentage","onRemove"])):d("",!0)]),default:p(()=>[a(w,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:p(()=>[a(n,{icon:"fa-solid fa-upload",class:"icon mr-1"}),_(" "+l(e.$t("veo.button.uploadReferences")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const bo=k(vo,[["render",go],["__scopeId","data-v-b8ddb8fb"]]),ko=b({name:"UpsampleActionSelector",components:{ElSelect:P,ElOption:A},computed:{options(){return ne.map(e=>({value:e,label:e}))},value:{get(){return this.$store.state.veo?.config?.upsample_action},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,upsample_action:e})}}},mounted(){this.value||(this.value=se)}}),yo={class:"field"},Vo={class:"title font-bold"};function wo(e,o,v,f,y,V){const r=s("el-option"),u=s("el-select");return t(),i("div",yo,[c("h2",Vo,l(e.$t("veo.name.upsampleAction")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=n=>e.value=n),class:"value",placeholder:e.$t("veo.placeholder.select")},{default:p(()=>[(t(!0),i(E,null,I(e.options,n=>(t(),m(r,{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Eo=k(ko,[["render",wo],["__scopeId","data-v-8b74a7ae"]]),To=b({name:"ExtendModelSelector",components:{ElSelect:P,ElOption:A},computed:{options(){return R.map(e=>({value:e,label:e}))},value:{get(){return this.$store.state.veo?.config?.model},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,model:e})}}},mounted(){(!this.value||!R.includes(this.value))&&(this.value=ae)}}),Io={class:"field"},So={class:"title font-bold"};function Co(e,o,v,f,y,V){const r=s("el-option"),u=s("el-select");return t(),i("div",Io,[c("h2",So,l(e.$t("veo.name.model")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=n=>e.value=n),class:"value",placeholder:e.$t("veo.placeholder.select")},{default:p(()=>[(t(!0),i(E,null,I(e.options,n=>(t(),m(r,{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Ao=k(To,[["render",Co],["__scopeId","data-v-cc3f9355"]]),Po=b({name:"MotionTypeSelector",components:{ElSelect:P,ElOption:A},computed:{options(){return ie.map(e=>({value:e,label:e}))},value:{get(){return this.$store.state.veo?.config?.motion_type},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,motion_type:e})}}},mounted(){this.value||(this.value=le)}}),Oo={class:"field"},Uo={class:"title font-bold"};function Lo(e,o,v,f,y,V){const r=s("el-option"),u=s("el-select");return t(),i("div",Oo,[c("h2",Uo,l(e.$t("veo.name.motionType")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=n=>e.value=n),class:"value",placeholder:e.$t("veo.placeholder.select"),filterable:""},{default:p(()=>[(t(!0),i(E,null,I(e.options,n=>(t(),m(r,{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const jo=k(Po,[["render",Lo],["__scopeId","data-v-3affff3c"]]),Ro=b({name:"ImageMaskInput",components:{ElInput:D},computed:{value:{get(){return this.$store.state.veo?.config?.image_mask},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,image_mask:e})}}}}),Mo={class:"field"},Go={class:"title font-bold"};function Do(e,o,v,f,y,V){const r=s("el-input");return t(),i("div",Mo,[c("h2",Go,l(e.$t("veo.name.imageMask")),1),a(r,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=u=>e.value=u),class:"value",type:"text",placeholder:e.$t("veo.placeholder.imageMask"),clearable:""},null,8,["modelValue","placeholder"])])}const No=k(Ro,[["render",Do],["__scopeId","data-v-6cc27c68"]]),Fo="",zo=b({name:"PromptInput",components:{PromptTextarea:fe},computed:{prompt:{get(){return this.$store.state.veo?.config?.prompt},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=Fo)}});function Bo(e,o,v,f,y,V){const r=s("prompt-textarea");return t(),m(r,{modelValue:e.prompt,"onUpdate:modelValue":o[0]||(o[0]=u=>e.prompt=u),title:e.$t("veo.name.prompt"),info:e.$t("veo.description.prompt"),placeholder:e.$t("veo.placeholder.prompt")},null,8,["modelValue","title","info","placeholder"])}const qo=k(zo,[["render",Bo]]),Ho=["upsample","extend","reshoot","object_insert","object_remove","get1080p"],Xo=["text2video","image2video","ingredients2video"],Yo=b({name:"ConfigPanel",components:{ElButton:U,Consumption:ve,FontAwesomeIcon:O,PromptInput:qo,ModelSelector:Le,StartEndImage:bo,ActionSelector:Ne,VideoFromInput:io,VideoIdInput:mo,UpsampleActionSelector:Eo,ExtendModelSelector:Ao,MotionTypeSelector:jo,ImageMaskInput:No,TranslationSelector:Je,AspectRatioSelector:oo},emits:["generate"],computed:{config(){return this.$store.state.veo?.config},consumption(){return he(this.config,this.service?.cost)},service(){return this.$store.state.veo?.service},isPostProcessing(){return Ho.includes(this.config?.action??"")},isGeneration(){return Xo.includes(this.config?.action??"")}},methods:{onGenerate(){this.$emit("generate")}}}),Jo={class:"flex flex-col h-full"},Qo={class:"flex-1 overflow-y-auto p-5"},Wo={class:"flex flex-col items-center justify-center px-5 pb-5"};function Ko(e,o,v,f,y,V){const r=s("action-selector"),u=s("video-from-input"),n=s("video-id-input"),w=s("upsample-action-selector"),$=s("extend-model-selector"),h=s("prompt-input"),S=s("motion-type-selector"),g=s("image-mask-input"),N=s("translation-selector"),F=s("aspect-ratio-selector"),z=s("model-selector"),B=s("start-end-image"),q=s("consumption"),H=s("font-awesome-icon"),X=s("el-button");return t(),i("div",Jo,[c("div",Qo,[a(r,{class:"mb-4"}),e.isPostProcessing?(t(),i(E,{key:0},[e.config?.video_url?(t(),m(u,{key:0,class:"mb-4"})):d("",!0),a(n,{class:"mb-4"})],64)):d("",!0),e.config?.action==="upsample"?(t(),m(w,{key:1,class:"mb-4"})):d("",!0),e.config?.action==="extend"?(t(),m($,{key:2,class:"mb-4"})):d("",!0),e.config?.action==="extend"?(t(),m(h,{key:3,class:"mb-4"})):d("",!0),e.config?.action==="reshoot"?(t(),m(S,{key:4,class:"mb-4"})):d("",!0),e.config?.action==="object_insert"?(t(),m(h,{key:5,class:"mb-4"})):d("",!0),e.config?.action==="object_insert"||e.config?.action==="object_remove"?(t(),m(g,{key:6,class:"mb-4"})):d("",!0),e.config?.action==="object_remove"?(t(),m(h,{key:7,class:"mb-4"})):d("",!0),e.isGeneration?(t(),i(E,{key:8},[a(N,{class:"mb-4"}),a(F,{class:"mb-4"}),a(h,{class:"mb-4"}),e.config?.action!=="ingredients2video"?(t(),m(z,{key:0,class:"mb-4"})):d("",!0),e.config?.action==="image2video"||e.config?.action==="ingredients2video"?(t(),m(B,{key:1,class:"mb-2"})):d("",!0)],64)):d("",!0)]),c("div",Wo,[a(q,{value:e.consumption,service:e.service},null,8,["value","service"]),a(X,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:p(()=>[a(H,{icon:"fa-solid fa-magic",class:"mr-2"}),_(" "+l(e.$t("veo.button.generate")),1)]),_:1},8,["onClick"])])])}const Zo=k(Yo,[["render",Ko]]),xo=b({name:"TaskPreview",components:{ElImage:ye,CopyToClipboard:ge,FontAwesomeIcon:O,ElAlert:ke,VideoPlayer:G,ElTooltip:be,ElButton:U},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.veo?.application},config(){return this.$store.state.veo?.config}},methods:{onPickAction(e,o,v,f){console.debug("seed config from preview",{action:v,upsampleAction:f,response:o}),this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,action:v,video_id:o?.data?.[0]?.id,video_url:o?.data?.[0]?.video_url,...f?{upsample_action:f}:{}})},onDownload(e,o){e.stopPropagation(),console.log("on download"),window.open(o,"_blank")},onOpenVideo(e){window.open(e,"_blank")}}}),et={class:"preview"},ot={class:"left"},tt={class:"main"},st={class:"bot"},nt={class:"datetime"},at={class:"info"},lt={key:0,class:"prompt mt-2"},it={key:0},rt={key:1},ct={key:0,class:C({content:!0,failed:!0})},dt={key:0,class:"mb-4"},ut={key:1,class:C({operations:!0,"mt-2":!0})},pt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},mt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},vt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},ft={key:1,class:C({content:!0})},_t={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ht={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},$t={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},gt={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},bt={key:2,class:C({content:!0})},kt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},yt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Vt(e,o,v,f,y,V){const r=s("el-image"),u=s("video-player"),n=s("el-button"),w=s("el-tooltip"),$=s("font-awesome-icon"),h=s("copy-to-clipboard"),S=s("el-alert");return t(),i("div",et,[c("div",ot,[a(r,{src:"https://cdn.acedata.cloud/8nxyy9.jpg",class:"avatar"})]),c("div",tt,[c("div",st,[_(l(e.$t("veo.name.veoBot"))+" ",1),c("span",nt,l(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),c("div",at,[e.modelValue?.request?.prompt?(t(),i("p",lt,[_(l(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?d("",!0):(t(),i("span",it," - ("+l(e.$t("veo.status.pending"))+") ",1)),Array.isArray(e.modelValue?.response?.data)&&e.modelValue?.response?.data[0]?.state==="running"?(t(),i("span",rt," - ("+l(e.$t("veo.status.processing"))+") ",1)):d("",!0)])):d("",!0)]),e.modelValue?.response?.success===!0&&e.modelValue?.response?.data?(t(),i("div",ct,[e.modelValue?.response?.data[0]?.video_url?(t(),i("div",dt,[a(u,{src:e.modelValue?.response?.data[0]?.video_url},null,8,["src"])])):d("",!0),e.modelValue?.response.success?(t(),i("div",ut,[e.modelValue?.response?.data[0]?.video_url?(t(),m(n,{key:0,type:"info",size:"small",class:"btn-action",onClick:o[0]||(o[0]=g=>e.onPickAction(g,e.modelValue?.response,"upsample","1080p"))},{default:p(()=>[_(l(e.$t("veo.button.actionUpsample1080p")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(n,{key:1,type:"info",size:"small",class:"btn-action",onClick:o[1]||(o[1]=g=>e.onPickAction(g,e.modelValue?.response,"upsample","4k"))},{default:p(()=>[_(l(e.$t("veo.button.actionUpsample4k")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(n,{key:2,type:"info",size:"small",class:"btn-action",onClick:o[2]||(o[2]=g=>e.onPickAction(g,e.modelValue?.response,"upsample","gif"))},{default:p(()=>[_(l(e.$t("veo.button.actionUpsampleGif")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(n,{key:3,type:"info",size:"small",class:"btn-action",onClick:o[3]||(o[3]=g=>e.onPickAction(g,e.modelValue?.response,"extend"))},{default:p(()=>[_(l(e.$t("veo.button.actionExtend")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(n,{key:4,type:"info",size:"small",class:"btn-action",onClick:o[4]||(o[4]=g=>e.onPickAction(g,e.modelValue?.response,"reshoot"))},{default:p(()=>[_(l(e.$t("veo.button.actionReshoot")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(n,{key:5,type:"info",size:"small",class:"btn-action",onClick:o[5]||(o[5]=g=>e.onPickAction(g,e.modelValue?.response,"object_insert"))},{default:p(()=>[_(l(e.$t("veo.button.actionObjectInsert")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(n,{key:6,type:"info",size:"small",class:"btn-action",onClick:o[6]||(o[6]=g=>e.onPickAction(g,e.modelValue?.response,"object_remove"))},{default:p(()=>[_(l(e.$t("veo.button.actionObjectRemove")),1)]),_:1})):d("",!0),a(w,{class:"box-item",effect:"dark",content:e.$t("veo.message.downloadVideo"),placement:"top-start"},{default:p(()=>[e.modelValue?.response?.data[0]?.video_url?(t(),m(n,{key:0,type:"info",size:"small",class:"btn-action",onClick:o[7]||(o[7]=g=>e.onDownload(g,e.modelValue?.response?.data[0]?.video_url))},{default:p(()=>[_(l(e.$t("veo.button.download")),1)]),_:1})):d("",!0)]),_:1},8,["content"])])):d("",!0),a(S,{closable:!1,class:"mt-2 success"},{default:p(()=>[c("p",pt,[a($,{icon:"fa-solid fa-hashtag",class:"mr-1"}),_(" "+l(e.$t("veo.name.model"))+": "+l(e.modelValue?.request?.model),1)]),c("p",mt,[a($,{icon:"fa-solid fa-magic",class:"mr-1"}),_(" "+l(e.$t("veo.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),a(h,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(t(),i("p",vt,[a($,{icon:"fa-solid fa-clock",class:"mr-1"}),_(" "+l(e.$t("veo.name.elapsed"))+": "+l(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):d("",!0)]),_:1})])):d("",!0),e.modelValue?.response?.success===!1?(t(),i("div",ft,[a(S,{closable:!1,class:"failure"},{template:p(()=>[a($,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),_(" "+l(e.$t("veo.name.failure")),1)]),default:p(()=>[c("p",_t,[a($,{icon:"fa-solid fa-magic",class:"mr-1"}),_(" "+l(e.$t("veo.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),a(h,{content:e.modelValue?.id},null,8,["content"])]),c("p",ht,[a($,{icon:"fa-solid fa-circle-info",class:"mr-1"}),_(" "+l(e.$t("veo.name.failureReason"))+": "+l(e.modelValue?.response?.error?.message)+" ",1),a(h,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(t(),i("p",$t,[a($,{icon:"fa-solid fa-clock",class:"mr-1"}),_(" "+l(e.$t("veo.name.elapsed"))+": "+l(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):d("",!0),e.modelValue?.response?.trace_id?(t(),i("p",gt,[a($,{icon:"fa-solid fa-hashtag",class:"mr-1"}),_(" "+l(e.$t("veo.name.traceId"))+": "+l(e.modelValue?.response?.trace_id)+" ",1),a(h,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):d("",!0)]),_:1})])):d("",!0),e.modelValue?.response?.success===void 0?(t(),i("div",bt,[a(S,{closable:!1,class:"info"},{template:p(()=>[a($,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),_(" "+l(e.$t("veo.name.failure")),1)]),default:p(()=>[c("p",kt,[a($,{icon:"fa-solid fa-magic",class:"mr-1"}),_(" "+l(e.$t("veo.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),a(h,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.response?.trace_id?(t(),i("p",yt,[a($,{icon:"fa-solid fa-hashtag",class:"mr-1"}),_(" "+l(e.$t("veo.name.traceId"))+": "+l(e.modelValue?.response?.trace_id)+" ",1),a(h,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):d("",!0)]),_:1})])):d("",!0)])])}const wt=k(xo,[["render",Vt],["__scopeId","data-v-83f2991f"]]),Et=b({name:"RecentPanel",components:{TaskPreview:wt,NoTasks:_e,BotPlaceholder:Ve,ScrollList:re},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.veo?.tasks,items:this.$store.state.veo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Tt={key:0},It={key:2,class:"w-full h-full flex items-center justify-center"};function St(e,o,v,f,y,V){const r=s("bot-placeholder"),u=s("task-preview"),n=s("scroll-list"),w=s("no-tasks");return t(),i(E,null,[e.tasks?.items===void 0?(t(),i("div",Tt,[a(r)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(t(),m(n,{key:1,ref:"scrollList",class:"tasks h-full w-full overflow-y-auto",loading:e.loading,onReachTop:o[0]||(o[0]=$=>e.$emit("reach-top"))},{default:p(()=>[(t(!0),i(E,null,I(e.tasks?.items,($,h)=>(t(),m(u,{key:h,"model-value":$},null,8,["model-value"]))),128))]),_:1},8,["loading"])):d("",!0),e.tasks?.items?.length===0?(t(),i("div",It,[a(w)])):d("",!0)],64)}const Ct=k(Et,[["render",St]]),At=Z("veo"),Pt=b({name:"VeoIndex",components:{ConfigPanel:Zo,Layout:Ce,RecentPanel:Ct},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.veo?.status?.getApplications===j.Request},tasksLoading(){return this.$store.state.veo?.status?.getTasks===j.Request||this.fetchingTasks},credential(){return this.$store.state.veo.credential},config(){return this.$store.state.veo.config},tasks(){return this.$store.state.veo.tasks}},watch:{tasks:{handler(e,o){e?.items?.length>o?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ce({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("veo/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("veo/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:o=5,createdAtMin:v,createdAtMax:f}=e||{};console.debug("limit",o,"createdAtMin",v,"createdAtMax",f),this.fetchingTasks=!0;try{await this.$store.dispatch("veo/getTasks",{limit:o,createdAtMin:v,createdAtMax:f})}finally{this.fetchingTasks=!1}},async onGenerate(){const e={...this.config,callback_url:At},o=this.credential?.token;if(!o){console.error("no token specified");return}if(e.action==="image2video"&&!(e.image_urls&&e.image_urls.length>0)){T.warning(this.$t("veo.message.imageRequired"));return}(!e.image_urls||e.image_urls.length===0)&&delete e.image_urls,T.info(this.$t("veo.message.startingTask")),W("veo",K.generate(e,{token:o})).then(()=>{T.success(this.$t("veo.message.startTaskSuccess"))}).catch(v=>{v?.response?.data?.error?.code===$e?T.error(this.$t("veo.message.usedUp")):T.error(this.$t("veo.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Ot(e,o,v,f,y,V){const r=s("config-panel"),u=s("recent-panel"),n=s("layout");return t(),m(n,null,{config:p(()=>[a(r,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:p(()=>[a(u,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Es=k(Pt,[["render",Ot]]);export{Es as default};
1
+ import{F as O}from"./index.es-rfDbxZpm.js";import{E as U}from"./index-DBQvlqm3.js";import{E as Y}from"./index-D-KZRZPp.js";import{d as b,H as i,E as c,z as L,C as a,y as p,D as s,q as t,F as l,O as E,N as I,x as m,Q as C,R as J,J as d,I as _}from"./vendor-vue-NSDaktjZ.js";import{G as k,bj as Q,co as W,aH as K,S as j,cp as Z}from"./index-DDJccgho.js";import{a as x,b as ee,c as oe,d as te,e as se,f as ne,g as R,h as ae,i as le,j as ie}from"./veo-Dg8Zhpd-.js";import{E as A,a as P}from"./index-CJ8YZq-e.js";import{I as M,S as re,l as ce}from"./pagination-CDk6ho1i.js";import{E as de}from"./index-XldQDSvy.js";import{V as G}from"./VideoPlayer-BOBrupFS.js";import{E as D}from"./index-D-SiG2bP.js";import{p as ue}from"./pasteUploadMixin-BurWbGNQ.js";import{I as pe}from"./ImagePreview-D1oWKxPX.js";import{E as me}from"./index-Db5A7UiS.js";import{E as T}from"./index-DtUQgyoo.js";import{C as ve}from"./Consumption-u-UR3f-q.js";import{P as fe,N as _e}from"./NoTasks-COwD2YRA.js";import{a as he}from"./price-C2VbzPrG.js";import{b as $e}from"./errorCode-Cqj9Td_Z.js";import{C as ge}from"./CopyToClipboard-D2Ga1c-u.js";import{E as be}from"./index-DK4DFfU5.js";import{E as ke}from"./index-wrqbgHKw.js";import{E as ye}from"./index-CkfWRF3i.js";import{B as Ve}from"./BotPlaceholder-GbwaSlCU.js";import"./use-form-item-1C5uFRHv.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Df5ITouH.js";import"./index-DkEDXKbD.js";import"./typescript-CCF0uyn2.js";import"./index-BPk2ZoOA.js";import"./strings-beZM2Y-f.js";import"./isEqual-CC5LQv_R.js";import"./_Uint8Array-DiKiqj6b.js";import"./castArray-DbfVevQg.js";import"./debounce-B-jn60n6.js";import"./_baseIteratee-CCcx0UCd.js";import"./index-B0Cwb-D-.js";import"./validator-BmyjrUCG.js";import"./vue-plyr-BO2nlN4c.js";import"./index-E1-z9_FO.js";import"./index-BjCVlRvR.js";import"./_baseClone-C7mAsPbg.js";import"./_initCloneObject-DHUwupd_.js";import"./index-BcNn3Owf.js";const we=b({name:"LayoutVeo",components:{ElDrawer:Y,ElButton:U,FontAwesomeIcon:O},data(){return{drawer:!1}}}),Ee={class:"main flex flex-row flex-1"},Te={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},Ie={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function Se(e,o,v,f,y,V){const r=s("font-awesome-icon"),u=s("el-button"),n=s("el-drawer");return t(),i("div",Ee,[c("div",Te,[L(e.$slots,"config",{},void 0,!0)]),c("div",Ie,[L(e.$slots,"result",{},void 0,!0)]),a(u,{circle:"",class:"menu",onClick:o[0]||(o[0]=w=>e.drawer=!0)},{default:p(()=>[a(r,{icon:"fa-solid fa-magic"})]),_:1}),a(n,{modelValue:e.drawer,"onUpdate:modelValue":o[1]||(o[1]=w=>e.drawer=w),direction:"ltr","with-header":!1,size:"350px"},{default:p(()=>[L(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Ce=k(we,[["render",Se],["__scopeId","data-v-9b26d591"]]),Ae=b({name:"ModelSelector",components:{ElSelect:P,ElOption:A},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{options:[{value:"veo2",label:"veo2"},{value:"veo2-fast",label:"veo2-fast"},{value:"veo3",label:"veo3"},{value:"veo3-fast",label:"veo3-fast"},{value:"veo31-fast",label:"veo31-fast"},{value:"veo31",label:"veo31"},{value:"veo31-fast-ingredients",label:"veo31-fast-ingredients"}]}},computed:{value:{get(){return this.$store.state.veo?.config?.model},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,model:e})}}},mounted(){this.value||(this.value=x)}}),Pe={class:"field"},Oe={class:"title font-bold"};function Ue(e,o,v,f,y,V){const r=s("el-option"),u=s("el-select");return t(),i("div",Pe,[c("h2",Oe,l(e.$t("veo.name.model")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=n=>e.value=n),class:"value",placeholder:e.$t("veo.placeholder.select")},{default:p(()=>[(t(!0),i(E,null,I(e.options,n=>(t(),m(r,{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Le=k(Ae,[["render",Ue],["__scopeId","data-v-a59d89c9"]]),je=b({name:"ActionSelector",components:{ElSelect:P,ElOption:A},data(){return{}},computed:{options(){return[{value:"text2video",label:this.$t("veo.button.action1")},{value:"image2video",label:this.$t("veo.button.action2")},{value:"ingredients2video",label:this.$t("veo.button.actionIngredients")},{value:"upsample",label:this.$t("veo.button.actionUpsample")},{value:"extend",label:this.$t("veo.button.actionExtend")},{value:"reshoot",label:this.$t("veo.button.actionReshoot")},{value:"object_insert",label:this.$t("veo.button.actionObjectInsert")},{value:"object_remove",label:this.$t("veo.button.actionObjectRemove")}]},value:{get(){return this.$store.state.veo?.config?.action},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,action:e})}}},mounted(){this.value||(this.value=ee)}}),Re={class:"field"},Me={class:"title font-bold"},Ge={class:"float-left"};function De(e,o,v,f,y,V){const r=s("el-option"),u=s("el-select");return t(),i("div",Re,[c("h2",Me,l(e.$t("veo.name.action")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=n=>e.value=n),class:"value",placeholder:e.$t("veo.placeholder.select"),clearable:""},{default:p(()=>[(t(!0),i(E,null,I(e.options,n=>(t(),m(r,{key:n.value,label:n.label,value:n.value},{default:p(()=>[c("span",Ge,l(n.label),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Ne=k(je,[["render",De],["__scopeId","data-v-f4d8785c"]]),Fe=b({name:"TranslationSelector",components:{ElSwitch:de,InfoIcon:M},computed:{value:{get(){return this.$store.state.veo?.config?.translation},set(e){console.debug("set translation",e),this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,translation:e})}}},mounted(){this.value===void 0&&(this.value=oe)}}),ze={class:"relative"},Be={class:"flex justify-between"},qe={class:"flex justify-start items-center"},He={class:"text-sm font-bold"},Xe={class:"flex justify-end items-center"};function Ye(e,o,v,f,y,V){const r=s("info-icon"),u=s("el-switch");return t(),i("div",ze,[c("div",Be,[c("div",qe,[c("span",He,l(e.$t("veo.name.translation")),1),a(r,{content:e.$t("veo.description.translation")},null,8,["content"])]),c("div",Xe,[a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=n=>e.value=n),class:"value"},null,8,["modelValue"])])])])}const Je=k(Fe,[["render",Ye]]),Qe=b({name:"AspectRatioSelector",data(){return{options:[{value:"1:1",label:"1:1",width:20,height:20},{value:"4:3",label:"4:3",width:20,height:15},{value:"3:4",label:"3:4",width:15,height:20},{value:"16:9",label:"16:9",width:25,height:13},{value:"9:16",label:"9:16",width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){return this.$store.state.veo?.config?.aspect_ratio},set(e){console.debug("set aspect_ratio",e),this.$store.commit("veo/setConfig",{...this.$store.state?.veo?.config,aspect_ratio:e})}}},mounted(){this.value||(this.value=te)}}),We={class:"text-sm font-bold mb-2 block"},Ke={class:"items"},Ze=["onClick"],xe={class:"name"};function eo(e,o,v,f,y,V){return t(),i("div",null,[c("span",We,l(e.$t("veo.name.ratio")),1),c("div",Ke,[(t(!0),i(E,null,I(e.options,(r,u)=>(t(),i("div",{key:u,class:C({active:e.active===u,item:!0}),onClick:n=>e.value=r.value},[c("div",{class:C(["preview",r.label])},[c("div",{class:"rect",style:J({width:r.width+"px",height:r.height+"px"})},null,4)],2),c("p",xe,l(r.label),1)],10,Ze))),128))])])}const oo=k(Qe,[["render",eo],["__scopeId","data-v-0f16be77"]]),to=b({name:"VideoFromInput",components:{VideoPlayer:G},props:{modelValue:{type:Object,required:!1,default:void 0}},data(){return{options:{quality:{default:"1080p"}}}},computed:{config(){return this.$store.state.veo?.config}}}),so={class:"relative"},no={class:"flex mb-2"},ao={class:"text-sm font-bold"};function lo(e,o,v,f,y,V){const r=s("video-player");return t(),i("div",so,[c("div",no,[c("span",ao,l(e.$t("veo.name.action3")),1)]),c("div",null,[e.config?.video_url?(t(),m(r,{key:0,src:e.config?.video_url},null,8,["src"])):d("",!0)])])}const io=k(to,[["render",lo]]),ro=b({name:"VideoIdInput",components:{ElInput:D},computed:{value:{get(){return this.$store.state.veo?.config?.video_id},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,video_id:e})}}}}),co={class:"field"},uo={class:"title font-bold"};function po(e,o,v,f,y,V){const r=s("el-input");return t(),i("div",co,[c("h2",uo,l(e.$t("veo.name.videoId")),1),a(r,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=u=>e.value=u),class:"value",type:"text",placeholder:e.$t("veo.placeholder.videoId"),clearable:""},null,8,["modelValue","placeholder"])])}const mo=k(ro,[["render",po],["__scopeId","data-v-6eba4026"]]),vo=b({name:"StartEndImage",components:{ElUpload:me,ElButton:U,InfoIcon:M,FontAwesomeIcon:O,ImagePreview:pe},mixins:[ue],emits:["change"],data(){return{fileList:[],uploadUrl:Q()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.veo?.config?.image_urls},set(){}}},mounted(){this.value||(this.value=void 0),this.onSetStartEndImageUrl()},methods:{onExceed(){T.warning(this.$t("veo.message.uploadReferencesExceed"))},onError(){T.error(this.$t("veo.message.uploadReferencesError"))},onSetStartEndImageUrl(){const e=this.urls;this.$store.commit("veo/setConfig",{...this.$store.state?.veo?.config,image_urls:e})},async onSuccess(){this.onSetStartEndImageUrl()}}}),fo={class:"relative"},_o={class:"flex justify-between"},ho={class:"flex justify-start items-center"},$o={class:"text-sm font-bold"};function go(e,o,v,f,y,V){const r=s("info-icon"),u=s("image-preview"),n=s("font-awesome-icon"),w=s("el-button"),$=s("el-upload");return t(),i("div",fo,[c("div",_o,[c("div",ho,[c("span",$o,l(e.$t("veo.name.startEndImage")),1),a(r,{content:e.$t("veo.description.uploadStartEndImage")},null,8,["content"])])]),a($,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":o[0]||(o[0]=h=>e.fileList=h),name:"file",accept:".png,.jpg,.jpeg,.gif,.bmp,.webp",limit:2,class:"upload-wrapper",multiple:!1,action:e.uploadUrl,"list-type":"picture","on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onSuccess,headers:e.headers},{file:p(({file:h})=>[h.url&&h.percentage!==void 0?(t(),m(u,{key:0,url:h.url,name:h.name,percentage:h.percentage,onRemove:S=>e.fileList.splice(e.fileList.indexOf(h),1)},null,8,["url","name","percentage","onRemove"])):d("",!0)]),default:p(()=>[a(w,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:p(()=>[a(n,{icon:"fa-solid fa-upload",class:"icon mr-1"}),_(" "+l(e.$t("veo.button.uploadReferences")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","headers"])])}const bo=k(vo,[["render",go],["__scopeId","data-v-b8ddb8fb"]]),ko=b({name:"UpsampleActionSelector",components:{ElSelect:P,ElOption:A},computed:{options(){return ne.map(e=>({value:e,label:e}))},value:{get(){return this.$store.state.veo?.config?.upsample_action},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,upsample_action:e})}}},mounted(){this.value||(this.value=se)}}),yo={class:"field"},Vo={class:"title font-bold"};function wo(e,o,v,f,y,V){const r=s("el-option"),u=s("el-select");return t(),i("div",yo,[c("h2",Vo,l(e.$t("veo.name.upsampleAction")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=n=>e.value=n),class:"value",placeholder:e.$t("veo.placeholder.select")},{default:p(()=>[(t(!0),i(E,null,I(e.options,n=>(t(),m(r,{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Eo=k(ko,[["render",wo],["__scopeId","data-v-8b74a7ae"]]),To=b({name:"ExtendModelSelector",components:{ElSelect:P,ElOption:A},computed:{options(){return R.map(e=>({value:e,label:e}))},value:{get(){return this.$store.state.veo?.config?.model},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,model:e})}}},mounted(){(!this.value||!R.includes(this.value))&&(this.value=ae)}}),Io={class:"field"},So={class:"title font-bold"};function Co(e,o,v,f,y,V){const r=s("el-option"),u=s("el-select");return t(),i("div",Io,[c("h2",So,l(e.$t("veo.name.model")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=n=>e.value=n),class:"value",placeholder:e.$t("veo.placeholder.select")},{default:p(()=>[(t(!0),i(E,null,I(e.options,n=>(t(),m(r,{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Ao=k(To,[["render",Co],["__scopeId","data-v-cc3f9355"]]),Po=b({name:"MotionTypeSelector",components:{ElSelect:P,ElOption:A},computed:{options(){return ie.map(e=>({value:e,label:e}))},value:{get(){return this.$store.state.veo?.config?.motion_type},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,motion_type:e})}}},mounted(){this.value||(this.value=le)}}),Oo={class:"field"},Uo={class:"title font-bold"};function Lo(e,o,v,f,y,V){const r=s("el-option"),u=s("el-select");return t(),i("div",Oo,[c("h2",Uo,l(e.$t("veo.name.motionType")),1),a(u,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=n=>e.value=n),class:"value",placeholder:e.$t("veo.placeholder.select"),filterable:""},{default:p(()=>[(t(!0),i(E,null,I(e.options,n=>(t(),m(r,{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const jo=k(Po,[["render",Lo],["__scopeId","data-v-3affff3c"]]),Ro=b({name:"ImageMaskInput",components:{ElInput:D},computed:{value:{get(){return this.$store.state.veo?.config?.image_mask},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo.config,image_mask:e})}}}}),Mo={class:"field"},Go={class:"title font-bold"};function Do(e,o,v,f,y,V){const r=s("el-input");return t(),i("div",Mo,[c("h2",Go,l(e.$t("veo.name.imageMask")),1),a(r,{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=u=>e.value=u),class:"value",type:"text",placeholder:e.$t("veo.placeholder.imageMask"),clearable:""},null,8,["modelValue","placeholder"])])}const No=k(Ro,[["render",Do],["__scopeId","data-v-6cc27c68"]]),Fo="",zo=b({name:"PromptInput",components:{PromptTextarea:fe},computed:{prompt:{get(){return this.$store.state.veo?.config?.prompt},set(e){this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=Fo)}});function Bo(e,o,v,f,y,V){const r=s("prompt-textarea");return t(),m(r,{modelValue:e.prompt,"onUpdate:modelValue":o[0]||(o[0]=u=>e.prompt=u),title:e.$t("veo.name.prompt"),info:e.$t("veo.description.prompt"),placeholder:e.$t("veo.placeholder.prompt")},null,8,["modelValue","title","info","placeholder"])}const qo=k(zo,[["render",Bo]]),Ho=["upsample","extend","reshoot","object_insert","object_remove","get1080p"],Xo=["text2video","image2video","ingredients2video"],Yo=b({name:"ConfigPanel",components:{ElButton:U,Consumption:ve,FontAwesomeIcon:O,PromptInput:qo,ModelSelector:Le,StartEndImage:bo,ActionSelector:Ne,VideoFromInput:io,VideoIdInput:mo,UpsampleActionSelector:Eo,ExtendModelSelector:Ao,MotionTypeSelector:jo,ImageMaskInput:No,TranslationSelector:Je,AspectRatioSelector:oo},emits:["generate"],computed:{config(){return this.$store.state.veo?.config},consumption(){return he(this.config,this.service?.cost)},service(){return this.$store.state.veo?.service},isPostProcessing(){return Ho.includes(this.config?.action??"")},isGeneration(){return Xo.includes(this.config?.action??"")}},methods:{onGenerate(){this.$emit("generate")}}}),Jo={class:"flex flex-col h-full"},Qo={class:"flex-1 overflow-y-auto p-5"},Wo={class:"flex flex-col items-center justify-center px-5 pb-5"};function Ko(e,o,v,f,y,V){const r=s("action-selector"),u=s("video-from-input"),n=s("video-id-input"),w=s("upsample-action-selector"),$=s("extend-model-selector"),h=s("prompt-input"),S=s("motion-type-selector"),g=s("image-mask-input"),N=s("translation-selector"),F=s("aspect-ratio-selector"),z=s("model-selector"),B=s("start-end-image"),q=s("consumption"),H=s("font-awesome-icon"),X=s("el-button");return t(),i("div",Jo,[c("div",Qo,[a(r,{class:"mb-4"}),e.isPostProcessing?(t(),i(E,{key:0},[e.config?.video_url?(t(),m(u,{key:0,class:"mb-4"})):d("",!0),a(n,{class:"mb-4"})],64)):d("",!0),e.config?.action==="upsample"?(t(),m(w,{key:1,class:"mb-4"})):d("",!0),e.config?.action==="extend"?(t(),m($,{key:2,class:"mb-4"})):d("",!0),e.config?.action==="extend"?(t(),m(h,{key:3,class:"mb-4"})):d("",!0),e.config?.action==="reshoot"?(t(),m(S,{key:4,class:"mb-4"})):d("",!0),e.config?.action==="object_insert"?(t(),m(h,{key:5,class:"mb-4"})):d("",!0),e.config?.action==="object_insert"||e.config?.action==="object_remove"?(t(),m(g,{key:6,class:"mb-4"})):d("",!0),e.config?.action==="object_remove"?(t(),m(h,{key:7,class:"mb-4"})):d("",!0),e.isGeneration?(t(),i(E,{key:8},[a(N,{class:"mb-4"}),a(F,{class:"mb-4"}),a(h,{class:"mb-4"}),e.config?.action!=="ingredients2video"?(t(),m(z,{key:0,class:"mb-4"})):d("",!0),e.config?.action==="image2video"||e.config?.action==="ingredients2video"?(t(),m(B,{key:1,class:"mb-2"})):d("",!0)],64)):d("",!0)]),c("div",Wo,[a(q,{value:e.consumption,service:e.service},null,8,["value","service"]),a(X,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:p(()=>[a(H,{icon:"fa-solid fa-magic",class:"mr-2"}),_(" "+l(e.$t("veo.button.generate")),1)]),_:1},8,["onClick"])])])}const Zo=k(Yo,[["render",Ko]]),xo=b({name:"TaskPreview",components:{ElImage:ye,CopyToClipboard:ge,FontAwesomeIcon:O,ElAlert:ke,VideoPlayer:G,ElTooltip:be,ElButton:U},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.veo?.application},config(){return this.$store.state.veo?.config}},methods:{onPickAction(e,o,v,f){console.debug("seed config from preview",{action:v,upsampleAction:f,response:o}),this.$store.commit("veo/setConfig",{...this.$store.state.veo?.config,action:v,video_id:o?.data?.[0]?.id,video_url:o?.data?.[0]?.video_url,...f?{upsample_action:f}:{}})},onDownload(e,o){e.stopPropagation(),console.log("on download"),window.open(o,"_blank")},onOpenVideo(e){window.open(e,"_blank")}}}),et={class:"preview"},ot={class:"left"},tt={class:"main"},st={class:"bot"},nt={class:"datetime"},at={class:"info"},lt={key:0,class:"prompt mt-2"},it={key:0},rt={key:1},ct={key:0,class:C({content:!0,failed:!0})},dt={key:0,class:"mb-4"},ut={key:1,class:C({operations:!0,"mt-2":!0})},pt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},mt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},vt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},ft={key:1,class:C({content:!0})},_t={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ht={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},$t={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},gt={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},bt={key:2,class:C({content:!0})},kt={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},yt={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Vt(e,o,v,f,y,V){const r=s("el-image"),u=s("video-player"),n=s("el-button"),w=s("el-tooltip"),$=s("font-awesome-icon"),h=s("copy-to-clipboard"),S=s("el-alert");return t(),i("div",et,[c("div",ot,[a(r,{src:"https://cdn.acedata.cloud/8nxyy9.jpg",class:"avatar"})]),c("div",tt,[c("div",st,[_(l(e.$t("veo.name.veoBot"))+" ",1),c("span",nt,l(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),c("div",at,[e.modelValue?.request?.prompt?(t(),i("p",lt,[_(l(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?d("",!0):(t(),i("span",it," - ("+l(e.$t("veo.status.pending"))+") ",1)),Array.isArray(e.modelValue?.response?.data)&&e.modelValue?.response?.data[0]?.state==="running"?(t(),i("span",rt," - ("+l(e.$t("veo.status.processing"))+") ",1)):d("",!0)])):d("",!0)]),e.modelValue?.response?.success===!0&&e.modelValue?.response?.data?(t(),i("div",ct,[e.modelValue?.response?.data[0]?.video_url?(t(),i("div",dt,[a(u,{src:e.modelValue?.response?.data[0]?.video_url},null,8,["src"])])):d("",!0),e.modelValue?.response.success?(t(),i("div",ut,[e.modelValue?.response?.data[0]?.video_url?(t(),m(n,{key:0,type:"info",size:"small",class:"btn-action",onClick:o[0]||(o[0]=g=>e.onPickAction(g,e.modelValue?.response,"upsample","1080p"))},{default:p(()=>[_(l(e.$t("veo.button.actionUpsample1080p")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(n,{key:1,type:"info",size:"small",class:"btn-action",onClick:o[1]||(o[1]=g=>e.onPickAction(g,e.modelValue?.response,"upsample","4k"))},{default:p(()=>[_(l(e.$t("veo.button.actionUpsample4k")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(n,{key:2,type:"info",size:"small",class:"btn-action",onClick:o[2]||(o[2]=g=>e.onPickAction(g,e.modelValue?.response,"upsample","gif"))},{default:p(()=>[_(l(e.$t("veo.button.actionUpsampleGif")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(n,{key:3,type:"info",size:"small",class:"btn-action",onClick:o[3]||(o[3]=g=>e.onPickAction(g,e.modelValue?.response,"extend"))},{default:p(()=>[_(l(e.$t("veo.button.actionExtend")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(n,{key:4,type:"info",size:"small",class:"btn-action",onClick:o[4]||(o[4]=g=>e.onPickAction(g,e.modelValue?.response,"reshoot"))},{default:p(()=>[_(l(e.$t("veo.button.actionReshoot")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(n,{key:5,type:"info",size:"small",class:"btn-action",onClick:o[5]||(o[5]=g=>e.onPickAction(g,e.modelValue?.response,"object_insert"))},{default:p(()=>[_(l(e.$t("veo.button.actionObjectInsert")),1)]),_:1})):d("",!0),e.modelValue?.response?.data[0]?.video_url?(t(),m(n,{key:6,type:"info",size:"small",class:"btn-action",onClick:o[6]||(o[6]=g=>e.onPickAction(g,e.modelValue?.response,"object_remove"))},{default:p(()=>[_(l(e.$t("veo.button.actionObjectRemove")),1)]),_:1})):d("",!0),a(w,{class:"box-item",effect:"dark",content:e.$t("veo.message.downloadVideo"),placement:"top-start"},{default:p(()=>[e.modelValue?.response?.data[0]?.video_url?(t(),m(n,{key:0,type:"info",size:"small",class:"btn-action",onClick:o[7]||(o[7]=g=>e.onDownload(g,e.modelValue?.response?.data[0]?.video_url))},{default:p(()=>[_(l(e.$t("veo.button.download")),1)]),_:1})):d("",!0)]),_:1},8,["content"])])):d("",!0),a(S,{closable:!1,class:"mt-2 success"},{default:p(()=>[c("p",pt,[a($,{icon:"fa-solid fa-hashtag",class:"mr-1"}),_(" "+l(e.$t("veo.name.model"))+": "+l(e.modelValue?.request?.model),1)]),c("p",mt,[a($,{icon:"fa-solid fa-magic",class:"mr-1"}),_(" "+l(e.$t("veo.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),a(h,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(t(),i("p",vt,[a($,{icon:"fa-solid fa-clock",class:"mr-1"}),_(" "+l(e.$t("veo.name.elapsed"))+": "+l(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):d("",!0)]),_:1})])):d("",!0),e.modelValue?.response?.success===!1?(t(),i("div",ft,[a(S,{closable:!1,class:"failure"},{template:p(()=>[a($,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),_(" "+l(e.$t("veo.name.failure")),1)]),default:p(()=>[c("p",_t,[a($,{icon:"fa-solid fa-magic",class:"mr-1"}),_(" "+l(e.$t("veo.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),a(h,{content:e.modelValue?.id},null,8,["content"])]),c("p",ht,[a($,{icon:"fa-solid fa-circle-info",class:"mr-1"}),_(" "+l(e.$t("veo.name.failureReason"))+": "+l(e.modelValue?.response?.error?.message)+" ",1),a(h,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(t(),i("p",$t,[a($,{icon:"fa-solid fa-clock",class:"mr-1"}),_(" "+l(e.$t("veo.name.elapsed"))+": "+l(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):d("",!0),e.modelValue?.response?.trace_id?(t(),i("p",gt,[a($,{icon:"fa-solid fa-hashtag",class:"mr-1"}),_(" "+l(e.$t("veo.name.traceId"))+": "+l(e.modelValue?.response?.trace_id)+" ",1),a(h,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):d("",!0)]),_:1})])):d("",!0),e.modelValue?.response?.success===void 0?(t(),i("div",bt,[a(S,{closable:!1,class:"info"},{template:p(()=>[a($,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),_(" "+l(e.$t("veo.name.failure")),1)]),default:p(()=>[c("p",kt,[a($,{icon:"fa-solid fa-magic",class:"mr-1"}),_(" "+l(e.$t("veo.name.taskId"))+": "+l(e.modelValue?.id)+" ",1),a(h,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.response?.trace_id?(t(),i("p",yt,[a($,{icon:"fa-solid fa-hashtag",class:"mr-1"}),_(" "+l(e.$t("veo.name.traceId"))+": "+l(e.modelValue?.response?.trace_id)+" ",1),a(h,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):d("",!0)]),_:1})])):d("",!0)])])}const wt=k(xo,[["render",Vt],["__scopeId","data-v-83f2991f"]]),Et=b({name:"RecentPanel",components:{TaskPreview:wt,NoTasks:_e,BotPlaceholder:Ve,ScrollList:re},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.veo?.tasks,items:this.$store.state.veo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Tt={key:0},It={key:2,class:"w-full h-full flex items-center justify-center"};function St(e,o,v,f,y,V){const r=s("bot-placeholder"),u=s("task-preview"),n=s("scroll-list"),w=s("no-tasks");return t(),i(E,null,[e.tasks?.items===void 0?(t(),i("div",Tt,[a(r)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(t(),m(n,{key:1,ref:"scrollList",class:"tasks h-full w-full overflow-y-auto",loading:e.loading,onReachTop:o[0]||(o[0]=$=>e.$emit("reach-top"))},{default:p(()=>[(t(!0),i(E,null,I(e.tasks?.items,($,h)=>(t(),m(u,{key:h,"model-value":$},null,8,["model-value"]))),128))]),_:1},8,["loading"])):d("",!0),e.tasks?.items?.length===0?(t(),i("div",It,[a(w)])):d("",!0)],64)}const Ct=k(Et,[["render",St]]),At=Z("veo"),Pt=b({name:"VeoIndex",components:{ConfigPanel:Zo,Layout:Ce,RecentPanel:Ct},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.veo?.status?.getApplications===j.Request},tasksLoading(){return this.$store.state.veo?.status?.getTasks===j.Request||this.fetchingTasks},credential(){return this.$store.state.veo.credential},config(){return this.$store.state.veo.config},tasks(){return this.$store.state.veo.tasks}},watch:{tasks:{handler(e,o){e?.items?.length>o?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ce({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("veo/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("veo/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:o=5,createdAtMin:v,createdAtMax:f}=e||{};console.debug("limit",o,"createdAtMin",v,"createdAtMax",f),this.fetchingTasks=!0;try{await this.$store.dispatch("veo/getTasks",{limit:o,createdAtMin:v,createdAtMax:f})}finally{this.fetchingTasks=!1}},async onGenerate(){const e={...this.config,callback_url:At},o=this.credential?.token;if(!o){console.error("no token specified");return}if(e.action==="image2video"&&!(e.image_urls&&e.image_urls.length>0)){T.warning(this.$t("veo.message.imageRequired"));return}(!e.image_urls||e.image_urls.length===0)&&delete e.image_urls,T.info(this.$t("veo.message.startingTask")),W("veo",K.generate(e,{token:o})).then(()=>{T.success(this.$t("veo.message.startTaskSuccess"))}).catch(v=>{v?.response?.data?.error?.code===$e?T.error(this.$t("veo.message.usedUp")):T.error(this.$t("veo.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Ot(e,o,v,f,y,V){const r=s("config-panel"),u=s("recent-panel"),n=s("layout");return t(),m(n,null,{config:p(()=>[a(r,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:p(()=>[a(u,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Es=k(Pt,[["render",Ot]]);export{Es as default};
@@ -1 +1 @@
1
- import{F as E}from"./index.es-bLqkOFPJ.js";import{E as L}from"./index-vb_jrfN_.js";import{E as re}from"./index-BS4HjKz4.js";import{d as b,H as m,E as i,z as N,C as n,y as h,D as o,q as l,F as r,x as C,O as V,N as T,Q as U,J as v,R as ve,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 ee,aF as te,S as oe,cp as Ce}from"./index-CL7TuUOi.js";import{b as Se,c as ne,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-CXYP5r_e.js";import{E as q}from"./index-DKw5cX1v.js";import{E as S}from"./index-iGjQBm25.js";import{I,S as Ee,l as Le}from"./pagination-Bk-2VIGU.js";import{p as H}from"./pasteUploadMixin-BurWbGNQ.js";import{I as K}from"./ImagePreview-Cpvb69ki.js";import{E as W}from"./index-CtGSe2nE.js";import{E as O}from"./index-BzX9_Qk6.js";import{C as ce}from"./Consumption-DXWduK4n.js";import{E as de}from"./index-d_EebTax.js";import{E as me}from"./index-BMxdobCB.js";import{E as ue}from"./index-DonhImCq.js";import{P as Me,N as Re}from"./NoTasks-2V-AkMAB.js";import{E as pe}from"./index-Cw6BPE5r.js";import{a as ge}from"./price-WUodxvCk.js";import{F as Ue}from"./FilePreview-CbuZ_q3W.js";import{E as De,a as Ae}from"./index-RnvG4OW2.js";import{E as Pe,a as Ge}from"./index-Cxyt7zfv.js";import{b as se}from"./errorCode-Cqj9Td_Z.js";import{C as Ke}from"./CopyToClipboard-CuF3QZ08.js";import{V as Oe}from"./VideoPlayer-CL8By14M.js";import{E as je}from"./index-CEzHDHOG.js";import{E as Ne}from"./index-mx88Dn1t.js";import{B as Be}from"./BotPlaceholder-CRRj0hwS.js";import"./use-form-item-D-4pUYPe.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Df5ITouH.js";import"./index-ClMIGtYN.js";import"./typescript-IWpxm_CC.js";import"./index-BGvu5xO5.js";import"./strings-beZM2Y-f.js";import"./isEqual-B4Ey1Jwt.js";import"./_Uint8Array-ByQwykQe.js";import"./castArray-DSy3F7mH.js";import"./debounce-CbU1MTVp.js";import"./_baseIteratee-NPUbMVeM.js";import"./index-CS3X4mU1.js";import"./validator-B_kytv0P.js";import"./index-B2GV1dfF.js";import"./_baseClone-CVuCG1nJ.js";import"./_initCloneObject-DuTLs5Xf.js";import"./index-Cu41y2Fl.js";import"./index-CqG0SCZo.js";import"./isPlainObject-CW75USoc.js";import"./vue-plyr-BO2nlN4c.js";import"./index-DnSC7fOc.js";const ze=b({name:"LayoutKling",components:{ElDrawer:re,ElButton:L,FontAwesomeIcon:E},data(){return{drawer:!1}}}),Fe={class:"main flex flex-row flex-1 min-h-0"},qe={class:"config w-[320px] flex-none h-full flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},He={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function We(e,t,s,a,u,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),m("div",Fe,[i("div",qe,[N(e.$slots,"config",{},void 0,!0)]),i("div",He,[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 Je=y(ze,[["render",We],["__scopeId","data-v-be4bb0df"]]),Qe={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function J(e,t,s){const a=t||"std",u=s??5;switch(e){case"kling-v1":return{text2video:!0,image2video:!0,endImage:u===5,audio:!1,motionControl:u===5};case"kling-v1-6":case"kling-v2-5-turbo":return{text2video:!0,image2video:!0,endImage:a==="pro",audio:!1,motionControl:!1};case"kling-v2-6":return{text2video:!0,image2video:!0,endImage:a==="pro",audio:a==="pro",motionControl:!1};case"kling-v2-master":case"kling-v2-1-master":return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};case"kling-v3":return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:a!=="4k"};case"kling-v3-omni":return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1};case"kling-video-o1":return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1};default:return Qe}}function Q(e,t){if(!e)return[];const s=t.model??e.model,a=t.mode??e.mode,u=t.duration??e.duration;if(!s)return[];const $=J(s,a,u),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 Y(e,t){const s={...e};for(const a of t)a.field==="end_image_url"&&(s.end_image_url=void 0),a.field==="generate_audio"&&(s.generate_audio=!1),a.field==="camera_control"&&(s.camera_control=void 0);return s}const Ye=b({name:"ModelSelector",components:{ElSelect: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=Q(t,{model:e});if(s.length===0){this.applyModel(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=Y({...t,model:e},s);this.$store.commit("kling/setConfig",u),S.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,model:e})}}}),Xe={class:"field"},Ze={class:"title font-bold"};function xe(e,t,s,a,u,$){const d=o("el-option"),p=o("el-select");return l(),m("div",Xe,[i("h2",Ze,r(e.$t("pika.name.model")),1),(l(),C(p,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("pika.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),m(V,null,T(e.options,f=>(l(),C(d,{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const et=y(Ye,[["render",xe],["__scopeId","data-v-04059875"]]),tt=b({name:"ModeSelector",components:{ElSelect:P,ElOption:A,InfoIcon:I},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},cameraControlSet(){return!!this.$store.state.kling?.config?.camera_control?.type},fourKReason(){return F.includes(this.selectedModel)?this.cameraControlSet?this.$t("kling.description.mode4kIncompatibleCamera"):"":this.$t("kling.description.mode4kRequiresV3")},options(){return[{value:"std",label:this.$t("kling.name.modeStd"),disabled:!1,disabledReason:""},{value:"pro",label:this.$t("kling.name.modePro"),disabled:!1,disabledReason:""},{value:"4k",label:this.$t("kling.name.mode4k"),disabled:!!this.fourKReason,disabledReason:this.fourKReason}]},value(){return this.$store.state.kling?.config?.mode}},watch:{fourKReason(e){e&&this.value==="4k"&&this.applyMode(ne)}},mounted(){this.value||this.applyMode(ne)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Q(t,{mode:e});if(s.length===0){this.applyMode(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=Y({...t,mode:e},s);this.$store.commit("kling/setConfig",u),S.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyMode(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,mode:e})}}}),ot={class:"field"},nt={class:"header"},st={class:"title font-bold"},it={key:0,class:"opt-tip"};function lt(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),m("div",ot,[i("div",nt,[i("h2",st,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.mode"),class:"info-icon"},null,8,["content"])]),(l(),C(f,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("kling.placeholder.select"),clearable:!0,onChange:e.onChange},{default:h(()=>[(l(!0),m(V,null,T(e.options,c=>(l(),C(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(),m("span",it,r(c.disabledReason),1)):v("",!0)]),_:2},1032,["label","value","disabled"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const at=y(tt,[["render",lt],["__scopeId","data-v-9a8fa3c5"]]),rt=[3,5,8,10,12,15],ct=[5,10],dt=b({name:"DurationSelector",components:{ElSelect:P,ElOption:A,InfoIcon:I},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},isV3Model(){return F.includes(this.selectedModel)},allowedDurations(){return this.isV3Model?rt:ct},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=Q(t,{duration:e});if(s.length===0){this.applyDuration(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=Y({...t,duration:e},s);this.$store.commit("kling/setConfig",u),S.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})}}}),mt={class:"field"},ut={class:"control"},pt={class:"label"},gt={class:"title font-bold"};function ft(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),m("div",mt,[i("div",ut,[i("div",pt,[i("h2",gt,r(e.$t("kling.name.duration")),1),n(d,{content:e.$t("kling.description.duration"),class:"info-icon ml-1"},null,8,["content"])]),(l(),C(f,{key:e.revertKey,"model-value":e.selectValue,class:"value",placeholder:e.$t("kling.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),m(V,null,T(e.allowedDurations,c=>(l(),C(p,{key:c,label:`${c}s`,value:c},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])])}const ht=y(dt,[["render",ft],["__scopeId","data-v-5ae55e28"]]),_t=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"},kt={class:"items"},vt=["onClick"],bt={class:"name"};function yt(e,t,s,a,u,$){return l(),m("div",null,[i("span",$t,r(e.$t("kling.name.ratio")),1),i("div",kt,[(l(!0),m(V,null,T(e.options,(d,p)=>(l(),m("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:ve({width:d.width+"px",height:d.height+"px"})},null,4)],2),i("p",bt,r(d.label),1)],10,vt))),128))])])}const wt=y(_t,[["render",yt],["__scopeId","data-v-cdb14b2f"]]),Ct=b({name:"StartImage",components:{ElUpload:O,ElButton:L,ElTooltip:W,InfoIcon:I,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(){S.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){S.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()}}}),St={class:"relative"},Vt={class:"flex justify-between"},It={class:"flex justify-start items-center"},Tt={class:"text-sm font-bold"};function Et(e,t,s,a,u,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),k=o("el-tooltip"),g=o("el-upload");return l(),m("div",St,[i("div",Vt,[i("div",It,[i("span",Tt,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(),C(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:h(()=>[n(k,{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 Lt=y(Ct,[["render",Et],["__scopeId","data-v-68cf38f5"]]),Mt=b({name:"EndImage",components:{ElUpload:O,ElButton:L,ElTooltip:W,ImagePreview:K,InfoIcon:I,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 J(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:(S.warning(this.$t("kling.message.endImageRequiresStart")),!1):(S.warning(this.$t("kling.message.endImageNotSupported")),!1)},onExceed(){S.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){S.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()}}}),Rt={class:"relative"},Ut={class:"flex justify-between"},Dt={class:"flex justify-start items-center"},At={class:"text-sm font-bold"};function Pt(e,t,s,a,u,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),k=o("el-tooltip"),g=o("el-upload");return l(),m("div",Rt,[i("div",Ut,[i("div",Dt,[i("span",At,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(),C(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:h(()=>[n(k,{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(Mt,[["render",Pt],["__scopeId","data-v-593c3bde"]]),Kt=b({name:"CfgScaleSelector",components:{ElSlider:me,InfoIcon:I,ElInputNumber:de},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)}}),Ot={class:"flex justify-between"},jt={class:"flex justify-start items-center"},Nt={class:"text-sm font-bold"},Bt={class:"flex justify-end items-center"},zt={class:"w-full"};function Ft(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-input-number"),f=o("el-slider");return l(),m("div",null,[i("div",Ot,[i("div",jt,[i("span",Nt,r(e.$t("kling.name.cfgScale")),1),n(d,{content:e.$t("kling.description.cfgScale")},null,8,["content"])]),i("div",Bt,[n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),"controls-position":"right"},null,8,["modelValue"])])]),i("div",zt,[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 qt=y(Kt,[["render",Ft]]),Ht=b({name:"GenerateAudioSelector",components:{ElSwitch:ue,InfoIcon:I},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})}}}),Wt={class:"relative"},Jt={class:"flex justify-between items-center"},Qt={class:"flex justify-start items-center"},Yt={class:"text-sm font-bold"};function Xt(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-switch");return l(),m("div",Wt,[i("div",Jt,[i("div",Qt,[i("span",Yt,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 Zt=y(Ht,[["render",Xt]]),xt=["horizontal","vertical","pan","tilt","roll","zoom"],eo=b({name:"CameraControlSelector",components:{ElSelect:P,ElOption:A,ElSlider:me,ElInputNumber:de,InfoIcon:I},data(){return{configKeys:xt}},computed:{typeOptions(){return[{value:"",label:this.$t("kling.name.cameraTypeNone")},{value:"simple",label:this.$t("kling.name.cameraTypeSimple")},{value:"down_back",label:this.$t("kling.name.cameraTypeDownBack")},{value:"forward_up",label:this.$t("kling.name.cameraTypeForwardUp")},{value:"left_turn_forward",label:this.$t("kling.name.cameraTypeLeftTurnForward")},{value:"right_turn_forward",label:this.$t("kling.name.cameraTypeRightTurnForward")}]},selectedMode(){return this.$store.state.kling?.config?.mode||""},selectedModel(){return this.$store.state.kling?.config?.model||""},selectedDuration(){return this.$store.state.kling?.config?.duration},motionControlSupported(){return J(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"},u={...a.config||{}};t==null?delete u[e]:u[e]=t,this.$store.commit("kling/setConfig",{...s,camera_control:{...a,type:"simple",config:u}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),to={class:"field"},oo={class:"header"},no={class:"text-sm font-bold"},so={key:0,class:"config-grid"},io={class:"cfg-row-head"},lo={class:"cfg-name"};function ao(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select"),c=o("el-input-number"),k=o("el-slider");return l(),m("div",to,[i("div",oo,[i("span",no,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),m(V,null,T(e.typeOptions,g=>(l(),C(p,{key:g.value,label:g.label,value:g.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","disabled"]),e.selectedType==="simple"&&!e.disabled?(l(),m("div",so,[(l(!0),m(V,null,T(e.configKeys,g=>(l(),m("div",{key:g,class:"cfg-row"},[i("div",io,[i("span",lo,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(k,{"model-value":e.configValues[g]??0,min:-1,max:1,step:.1,onInput:_=>e.onSliderChange(g,_)},null,8,["model-value","onInput"])]))),128))])):v("",!0)])}const ro=y(eo,[["render",ao],["__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 co(e,t){const s=(e||"").trim();return s?s.includes(t)?s:`${s}${B}${t}`:t}function z(e,t){if(!e||!t)return e||"";const s=[`${t}${B}`,`${B}${t}`,t];let a=e;for(const u of s)if(a.includes(u)){a=a.replace(u,"");break}return a.replace(/(?:,\s*)+$/,"").replace(/^(?:,\s*)+/,"")}const mo=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"},po={class:"pill-text"},go=["aria-label","onClick"];function fo(e,t,s,a,u,$){const d=o("font-awesome-icon");return e.selected.length>0?(l(),m("div",uo,[(l(!0),m(V,null,T(e.selected,p=>(l(),m("div",{key:p,class:"pill",role:"listitem"},[i("span",po,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,go)]))),128))])):v("",!0)}const ho=y(mo,[["render",fo],["__scopeId","data-v-5fc4fa65"]]),_o="",$o=b({name:"PromptInput",components:{ElButton:L,FontAwesomeIcon:E,PromptTextarea:Me,InspirationPills:ho},emits:["open-inspiration"],computed:{prompt:{get(){return this.$store.state.kling?.config?.prompt},set(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=_o)}});function ko(e,t,s,a,u,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("inspiration-pills"),c=o("prompt-textarea");return l(),C(c,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||(t[1]=k=>e.prompt=k),title:e.$t("kling.name.prompt"),info:e.$t("kling.description.prompt"),placeholder:e.$t("kling.placeholder.prompt")},{actions:h(()=>[n(p,{text:"",size:"small",class:"inspiration-btn",onClick:t[0]||(t[0]=k=>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})]),before:h(()=>[n(f)]),_:1},8,["modelValue","title","info","placeholder"])}const vo=y($o,[["render",ko],["__scopeId","data-v-c01fc1a6"]]),bo="",yo=b({name:"NegativePromptInput",components:{ElInput:pe,InfoIcon:I},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=bo)}}),wo={class:"field"},Co={class:"box"},So={class:"title font-bold"};function Vo(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-input");return l(),m("div",wo,[i("div",Co,[i("h2",So,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 Io=y(yo,[["render",Vo],["__scopeId","data-v-de98cf01"]]),To=b({name:"InspirationDrawer",components:{ElDrawer:re,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(co(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)}}}),Eo={class:"drawer-content"},Lo={class:"drawer-header"},Mo={class:"title-row"},Ro={class:"title"},Uo={class:"hint"},Do={key:0,class:"selected-bar"},Ao={class:"selected-text"},Po={class:"groups"},Go={class:"group-title"},Ko={class:"chip-grid"},Oo=["onClick"];function jo(e,t,s,a,u,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),C(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",Eo,[i("div",Lo,[i("div",Mo,[n(d,{icon:"fa-regular fa-lightbulb",class:"mr-2"}),i("span",Ro,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",Uo,r(e.$t("kling.inspiration.hint")),1),e.selectedCount>0?(l(),m("div",Do,[i("span",Ao,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"])])):v("",!0),i("div",Po,[(l(!0),m(V,null,T(e.groups,c=>(l(),m("div",{key:c.groupKey,class:"group"},[i("div",Go,r(e.$t(`kling.inspiration.group.${c.groupKey}`)),1),i("div",Ko,[(l(!0),m(V,null,T(c.chipKeys,k=>(l(),m("button",{key:k,type:"button",class:U({chip:!0,active:e.isSelected(e.chipText(k))}),onClick:g=>e.onToggle(e.chipText(k))},r(e.chipText(k)),11,Oo))),128))])]))),128))])])]),_:1},8,["modelValue","size"])}const No=y(To,[["render",jo],["__scopeId","data-v-7d457a69"]]),Bo={"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"},zo={std:"720p",pro:"1080p","4k":"4K"},Fo=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 Bo[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||""},modeLabel(){const e=this.config?.mode||"std";return zo[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),qo={class:"summary-chip"},Ho=["title"],Wo=["title"],Jo=["title"],Qo=["title"],Yo=["title"];function Xo(e,t,s,a,u,$){const d=o("font-awesome-icon");return l(),m("div",qo,[i("span",{class:"part",title:e.$t("kling.name.model")},r(e.modelLabel),9,Ho),t[0]||(t[0]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.duration")},r(e.durationLabel),9,Wo),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,Jo),t[2]||(t[2]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.mode")},r(e.modeLabel),9,Qo),e.generateAudio?(l(),m("span",{key:0,class:"audio",title:e.$t("kling.name.generateAudio")},[n(d,{icon:"fa-solid fa-headphones"})],8,Yo)):v("",!0)])}const Zo=y(Fo,[["render",Xo],["__scopeId","data-v-418a6733"]]),xo=b({name:"ConfigPanel",components:{ElButton:L,Consumption:ce,FontAwesomeIcon:E,PromptInput:vo,NegativePromptInput:Io,ModelSelector:et,ModeSelector:at,DurationSelector:ht,RatioSelector:wt,StartImage:Lt,CfgScaleSelector:qt,GenerateAudioSelector:Zt,CameraControlSelector:ro,InspirationDrawer:No,SummaryChip:Zo,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")}}}),en={class:"flex flex-col h-full"},tn={class:"flex-1 overflow-y-auto p-5"},on={class:"flex flex-col items-center justify-center px-5 pb-5"};function nn(e,t,s,a,u,$){const d=o("prompt-input"),p=o("model-selector"),f=o("ratio-selector"),c=o("start-image"),k=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"),X=o("font-awesome-icon"),Z=o("el-button"),ke=o("inspiration-drawer");return l(),m("div",en,[i("div",tn,[n(d,{class:"mb-4",onOpenInspiration:t[0]||(t[0]=x=>e.inspirationOpen=!0)}),n(p,{class:"mb-4"}),n(f,{class:"mb-4"}),n(c,{class:"mb-2"}),n(k,{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",on,[n(_e),n($e,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(l(),C(Z,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(X,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.extend")),1)]),_:1},8,["onClick"])):(l(),C(Z,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(X,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.generate")),1)]),_:1},8,["onClick"]))]),n(ke,{modelValue:e.inspirationOpen,"onUpdate:modelValue":t[1]||(t[1]=x=>e.inspirationOpen=x)},null,8,["modelValue"])])}const sn=y(xo,[["render",nn]]),ln=b({name:"MotionImage",components:{ElUpload:O,ElButton:L,InfoIcon:I,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(){S.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){S.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()}}}),an={class:"relative"},rn={class:"flex justify-between"},cn={class:"flex justify-start items-center"},dn={class:"text-sm font-bold"};function mn(e,t,s,a,u,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),k=o("el-upload");return l(),m("div",an,[i("div",rn,[i("div",cn,[i("span",dn,r(e.$t("kling.name.motionImage")),1),n(d,{content:e.$t("kling.description.motionImage")},null,8,["content"])])]),n(k,{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(),C(p,{key:0,url:g.url,name:g.name,percentage:g.percentage,onRemove:_=>e.onRemove(g)},null,8,["url","name","percentage","onRemove"])):v("",!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 un=y(ln,[["render",mn],["__scopeId","data-v-37d42da7"]]),pn=b({name:"MotionVideo",components:{ElUpload:O,ElButton:L,InfoIcon:I,FilePreview:Ue,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(){S.warning(this.$t("kling.message.uploadVideoExceed"))},onError(){S.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:(S.error(this.$t("kling.message.uploadVideoSizeExceed")),!1):(S.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()}}}),gn={class:"relative"},fn={class:"flex justify-between"},hn={class:"flex justify-start items-center"},_n={class:"text-sm font-bold"};function $n(e,t,s,a,u,$){const d=o("info-icon"),p=o("file-preview"),f=o("font-awesome-icon"),c=o("el-button"),k=o("el-upload");return l(),m("div",gn,[i("div",fn,[i("div",hn,[i("span",_n,r(e.$t("kling.name.motionVideo")),1),n(d,{content:e.$t("kling.description.motionVideo")},null,8,["content"])])]),n(k,{"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(),C(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"])):v("",!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 kn=y(pn,[["render",$n],["__scopeId","data-v-5cf93212"]]),vn=b({name:"MotionPromptInput",components:{ElInput:pe,InfoIcon:I},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||""},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),bn={class:"field"},yn={class:"box"},wn={class:"title font-bold"};function Cn(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-input");return l(),m("div",bn,[i("div",yn,[i("h2",wn,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 Sn=y(vn,[["render",Cn],["__scopeId","data-v-ca9fdbe5"]]),ie="video",Vn=b({name:"CharacterOrientationSelector",components:{ElRadioGroup:Ae,ElRadioButton:De,InfoIcon:I},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||ie},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=ie)}}),In={class:"field"},Tn={class:"header"},En={class:"text-sm font-bold"};function Ln(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-radio-button"),f=o("el-radio-group");return l(),m("div",In,[i("div",Tn,[i("span",En,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 Mn=y(Vn,[["render",Ln],["__scopeId","data-v-7a91195b"]]),le="std",Rn=b({name:"MotionModeSelector",components:{ElSelect:P,ElOption:A,InfoIcon:I},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||le},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=le)}}),Un={class:"field"},Dn={class:"header"},An={class:"title font-bold"};function Pn(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),m("div",Un,[i("div",Dn,[i("h2",An,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),m(V,null,T(e.options,c=>(l(),C(p,{key:c.value,label:c.label,value:c.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Gn=y(Rn,[["render",Pn],["__scopeId","data-v-1295688c"]]),Kn=b({name:"KeepOriginalSoundSelector",components:{ElSwitch:ue,InfoIcon:I},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"})}}}}),On={class:"relative"},jn={class:"flex justify-between items-center"},Nn={class:"flex justify-start items-center"},Bn={class:"text-sm font-bold"};function zn(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-switch");return l(),m("div",On,[i("div",jn,[i("div",Nn,[i("span",Bn,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 Fn=y(Kn,[["render",zn]]),qn=b({name:"MotionPanel",components:{ElButton:L,FontAwesomeIcon:E,Consumption:ce,MotionImage:un,MotionVideo:kn,MotionPromptInput:Sn,CharacterOrientationSelector:Mn,MotionModeSelector:Gn,KeepOriginalSoundSelector:Fn},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")}}}),Hn={class:"flex flex-col h-full"},Wn={class:"flex-1 overflow-y-auto p-5"},Jn={class:"flex flex-col items-center justify-center px-5 pb-5"};function Qn(e,t,s,a,u,$){const d=o("motion-image"),p=o("motion-video"),f=o("motion-prompt-input"),c=o("character-orientation-selector"),k=o("motion-mode-selector"),g=o("keep-original-sound-selector"),_=o("consumption"),M=o("font-awesome-icon"),R=o("el-button");return l(),m("div",Hn,[i("div",Wn,[n(d,{class:"mb-3"}),n(p,{class:"mb-3"}),n(f,{class:"mb-4"}),n(c,{class:"mb-4"}),n(k,{class:"mb-4"}),n(g,{class:"mb-4"})]),i("div",Jn,[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 Yn=y(qn,[["render",Qn]]),Xn=b({name:"KlingTabSwitcher",components:{ElTabs:Ge,ElTabPane:Pe,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)}}}),Zn=["title"],xn={class:"text"};function es(e,t,s,a,u,$){const d=o("el-tag"),p=o("el-tab-pane"),f=o("el-tabs");return l(),C(f,{"model-value":e.modelValue,class:"kling-tabs",stretch:"","onUpdate:modelValue":e.onUpdate},{default:h(()=>[(l(!0),m(V,null,T(e.tabs,c=>(l(),C(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",xn,r(c.label),1),c.badge?(l(),C(d,{key:0,size:"small",type:"warning",class:"badge"},{default:h(()=>[w(r(c.badge),1)]),_:2},1024)):v("",!0)],8,Zn)]),_:2},1032,["name","disabled"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])}const ts=y(Xn,[["render",es],["__scopeId","data-v-bf00c27e"]]),os=b({name:"TaskPreview",components:{ElImage:Ne,CopyToClipboard:Ke,FontAwesomeIcon:E,ElAlert:je,VideoPlayer:Oe,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")}}}),ns={class:"preview"},ss={class:"left"},is={class:"main"},ls={class:"bot"},as={class:"datetime"},rs={class:"info"},cs={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},ds={key:1,class:"prompt mt-2"},ms={key:0},us={key:1},ps={key:0,class:U({content:!0,failed:!0})},gs={key:0,class:"mb-4"},fs={key:1,class:U({operations:!0,"mt-2":!0})},hs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},_s={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},$s={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},ks={key:1,class:U({content:!0})},vs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},bs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ys={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ws={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Cs={key:2,class:U({content:!0})},Ss={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Vs={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Is(e,t,s,a,u,$){const d=o("el-image"),p=o("image-preview"),f=o("video-player"),c=o("el-button"),k=o("el-tooltip"),g=o("font-awesome-icon"),_=o("copy-to-clipboard"),M=o("el-alert");return l(),m("div",ns,[i("div",ss,[n(d,{src:"https://cdn.acedata.cloud/qpbbbb.jpg",class:"avatar"})]),i("div",is,[i("div",ls,[w(r(e.$t("kling.name.klingBot"))+" ",1),i("span",as,r(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),i("div",rs,[e.referenceImages.length>0?(l(),m("div",cs,[(l(!0),m(V,null,T(e.referenceImages,(R,j)=>(l(),C(p,{key:j,url:R.url,name:R.name,closable:!1},null,8,["url","name"]))),128))])):v("",!0),e.modelValue?.request?.prompt?(l(),m("p",ds,[w(r(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?v("",!0):(l(),m("span",ms," - ("+r(e.$t("kling.status.pending"))+") ",1)),e.modelValue?.response?.state==="submitted"||e.modelValue?.response?.state==="processing"||e.modelValue?.response?.state==="pending"||e.modelValue?.response?.state==="completed"?(l(),m("span",us," - ("+r(e.$t("kling.status.processing"))+") ",1)):v("",!0)])):v("",!0)]),e.modelValue?.response?.success===!0?(l(),m("div",ps,[e.modelValue?.response.video_url?(l(),m("div",gs,[n(f,{src:e.modelValue?.response.video_url},null,8,["src"])])):v("",!0),e.modelValue?.response.success?(l(),m("div",fs,[n(k,{class:"box-item",effect:"dark",content:e.$t("kling.message.downloadVideo"),placement:"top-start"},{default:h(()=>[e.modelValue?.response.video_url?(l(),C(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})):v("",!0)]),_:1},8,["content"])])):v("",!0),n(M,{closable:!1,class:"mt-2 success"},{default:h(()=>[i("p",hs,[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",_s,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(l(),m("p",$s,[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)])):v("",!0)]),_:1})])):v("",!0),e.modelValue?.response?.success===!1?(l(),m("div",ks,[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",vs,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),i("p",bs,[n(g,{icon:"fa-solid fa-circle-info",class:"mr-1"}),w(" "+r(e.$t("kling.name.failureReason"))+": "+r(e.modelValue?.response?.error?.message)+" ",1),n(_,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(l(),m("p",ys,[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)])):v("",!0),e.modelValue?.response?.trace_id?(l(),m("p",ws,[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"])])):v("",!0)]),_:1})])):v("",!0),e.modelValue?.response?.success===void 0?(l(),m("div",Cs,[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",Ss,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.response?.trace_id?(l(),m("p",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"])])):v("",!0)]),_:1})])):v("",!0)])])}const Ts=y(os,[["render",Is],["__scopeId","data-v-e8e87659"]]),Es=b({name:"RecentPanel",components:{TaskPreview:Ts,NoTasks:Re,BotPlaceholder:Be,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?.()}}}),Ls={key:0},Ms={key:2,class:"w-full h-full flex items-center justify-center"};function Rs(e,t,s,a,u,$){const d=o("bot-placeholder"),p=o("task-preview"),f=o("scroll-list"),c=o("no-tasks");return l(),m(V,null,[e.tasks?.items===void 0?(l(),m("div",Ls,[n(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(l(),C(f,{key:1,ref:"scrollList",class:"h-full w-full overflow-y-auto tasks",loading:e.loading,onReachTop:t[0]||(t[0]=k=>e.$emit("reach-top"))},{default:h(()=>[(l(!0),m(V,null,T(e.tasks?.items,k=>(l(),C(p,{key:k.id,"model-value":k},null,8,["model-value"]))),128))]),_:1},8,["loading"])):v("",!0),e.tasks?.items?.length===0?(l(),m("div",Ms,[n(c)])):v("",!0)],64)}const Us=y(Es,[["render",Rs]]),ae=Ce("kling"),Ds=b({name:"KlingIndex",components:{ConfigPanel:sn,MotionPanel:Yn,TabSwitcher:ts,Layout:Je,RecentPanel:Us},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===oe.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===oe.Request||this.fetchingTasks},credential(){return this.$store.state.kling.credential},config(){return this.$store.state.kling.config},motionConfig(){return this.$store.state.kling.motionConfig},taskType(){return this.$store.state.kling.taskType||"videos"},tasks(){return this.$store.state.kling.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await 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:ae};if(!s.video_id&&!t.video_url&&!s.start_image_url&&s.end_image_url){S.warning(this.$t("kling.message.endImageRequiresStart"));return}s.action||(s.video_id||t.video_url?s.action="extend":s.start_image_url?s.action="image2video":s.action="text2video"),s.action==="text2video"&&s.end_image_url&&delete s.end_image_url,e?.type&&(s.camera_control={type:e.type,...e.type==="simple"&&e.config?{config:Object.fromEntries(Object.entries(e.config).filter(([,u])=>u!=null))}:{}});const a=this.credential?.token;if(!a){console.error("no token specified");return}S.info(this.$t("kling.message.startingTask")),ee("kling",te.generate(s,{token:a})).then(()=>{S.success(this.$t("kling.message.startTaskSuccess"))}).catch(u=>{u?.response?.data?.error?.code===se?S.error(this.$t("kling.message.usedUp")):S.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){S.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:ae},s=this.credential?.token;if(!s){console.error("no token specified");return}S.info(this.$t("kling.message.startingTask")),ee("kling",te.motion(t,{token:s})).then(()=>{S.success(this.$t("kling.message.startTaskSuccess"))}).catch(a=>{a?.response?.data?.error?.code===se?S.error(this.$t("kling.message.usedUp")):S.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),As={class:"flex flex-col h-full"},Ps={class:"flex-1 min-h-0"};function Gs(e,t,s,a,u,$){const d=o("tab-switcher"),p=o("config-panel"),f=o("motion-panel"),c=o("recent-panel"),k=o("layout");return l(),C(k,null,{config:h(()=>[i("div",As,[n(d,{"model-value":e.taskType,"onUpdate:modelValue":e.onTabChange},null,8,["model-value","onUpdate:modelValue"]),i("div",Ps,[e.taskType==="videos"?(l(),C(p,{key:0,onGenerate:e.onGenerate},null,8,["onGenerate"])):e.taskType==="motion"?(l(),C(f,{key:1,onGenerate:e.onGenerateMotion},null,8,["onGenerate"])):v("",!0)])])]),result:h(()=>[n(c,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Ki=y(Ds,[["render",Gs]]);export{Ki as default};
1
+ import{F as E}from"./index.es-rfDbxZpm.js";import{E as L}from"./index-DBQvlqm3.js";import{E as re}from"./index-D-KZRZPp.js";import{d as b,H as m,E as i,z as N,C as n,y as h,D as o,q as l,F as r,x as C,O as V,N as T,Q as U,J as v,R as ve,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 ee,aF as te,S as oe,cp as Ce}from"./index-DDJccgho.js";import{b as Se,c as ne,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-CJ8YZq-e.js";import{E as q}from"./index-jDtcXBDh.js";import{E as S}from"./index-DtUQgyoo.js";import{I,S as Ee,l as Le}from"./pagination-CDk6ho1i.js";import{p as H}from"./pasteUploadMixin-BurWbGNQ.js";import{I as K}from"./ImagePreview-D1oWKxPX.js";import{E as W}from"./index-DK4DFfU5.js";import{E as O}from"./index-Db5A7UiS.js";import{C as ce}from"./Consumption-u-UR3f-q.js";import{E as de}from"./index-BexlGeiF.js";import{E as me}from"./index-8PxRxOr7.js";import{E as ue}from"./index-XldQDSvy.js";import{P as Me,N as Re}from"./NoTasks-COwD2YRA.js";import{E as pe}from"./index-D-SiG2bP.js";import{a as ge}from"./price-C2VbzPrG.js";import{F as Ue}from"./FilePreview-Yk89uJgC.js";import{E as De,a as Ae}from"./index-CL16wKMg.js";import{E as Pe,a as Ge}from"./index-BbSliDK4.js";import{b as se}from"./errorCode-Cqj9Td_Z.js";import{C as Ke}from"./CopyToClipboard-D2Ga1c-u.js";import{V as Oe}from"./VideoPlayer-BOBrupFS.js";import{E as je}from"./index-wrqbgHKw.js";import{E as Ne}from"./index-CkfWRF3i.js";import{B as Be}from"./BotPlaceholder-GbwaSlCU.js";import"./use-form-item-1C5uFRHv.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Df5ITouH.js";import"./index-DkEDXKbD.js";import"./typescript-CCF0uyn2.js";import"./index-BPk2ZoOA.js";import"./strings-beZM2Y-f.js";import"./isEqual-CC5LQv_R.js";import"./_Uint8Array-DiKiqj6b.js";import"./castArray-DbfVevQg.js";import"./debounce-B-jn60n6.js";import"./_baseIteratee-CCcx0UCd.js";import"./index-B0Cwb-D-.js";import"./validator-BmyjrUCG.js";import"./index-BjCVlRvR.js";import"./_baseClone-C7mAsPbg.js";import"./_initCloneObject-DHUwupd_.js";import"./index-Cu41y2Fl.js";import"./index-E1-z9_FO.js";import"./isPlainObject-CJWHXdHh.js";import"./vue-plyr-BO2nlN4c.js";import"./index-BcNn3Owf.js";const ze=b({name:"LayoutKling",components:{ElDrawer:re,ElButton:L,FontAwesomeIcon:E},data(){return{drawer:!1}}}),Fe={class:"main flex flex-row flex-1 min-h-0"},qe={class:"config w-[320px] flex-none h-full flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},He={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function We(e,t,s,a,u,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),m("div",Fe,[i("div",qe,[N(e.$slots,"config",{},void 0,!0)]),i("div",He,[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 Je=y(ze,[["render",We],["__scopeId","data-v-be4bb0df"]]),Qe={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function J(e,t,s){const a=t||"std",u=s??5;switch(e){case"kling-v1":return{text2video:!0,image2video:!0,endImage:u===5,audio:!1,motionControl:u===5};case"kling-v1-6":case"kling-v2-5-turbo":return{text2video:!0,image2video:!0,endImage:a==="pro",audio:!1,motionControl:!1};case"kling-v2-6":return{text2video:!0,image2video:!0,endImage:a==="pro",audio:a==="pro",motionControl:!1};case"kling-v2-master":case"kling-v2-1-master":return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};case"kling-v3":return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:a!=="4k"};case"kling-v3-omni":return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1};case"kling-video-o1":return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1};default:return Qe}}function Q(e,t){if(!e)return[];const s=t.model??e.model,a=t.mode??e.mode,u=t.duration??e.duration;if(!s)return[];const $=J(s,a,u),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 Y(e,t){const s={...e};for(const a of t)a.field==="end_image_url"&&(s.end_image_url=void 0),a.field==="generate_audio"&&(s.generate_audio=!1),a.field==="camera_control"&&(s.camera_control=void 0);return s}const Ye=b({name:"ModelSelector",components:{ElSelect: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=Q(t,{model:e});if(s.length===0){this.applyModel(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=Y({...t,model:e},s);this.$store.commit("kling/setConfig",u),S.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,model:e})}}}),Xe={class:"field"},Ze={class:"title font-bold"};function xe(e,t,s,a,u,$){const d=o("el-option"),p=o("el-select");return l(),m("div",Xe,[i("h2",Ze,r(e.$t("pika.name.model")),1),(l(),C(p,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("pika.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),m(V,null,T(e.options,f=>(l(),C(d,{key:f.value,label:f.label,value:f.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const et=y(Ye,[["render",xe],["__scopeId","data-v-04059875"]]),tt=b({name:"ModeSelector",components:{ElSelect:P,ElOption:A,InfoIcon:I},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},cameraControlSet(){return!!this.$store.state.kling?.config?.camera_control?.type},fourKReason(){return F.includes(this.selectedModel)?this.cameraControlSet?this.$t("kling.description.mode4kIncompatibleCamera"):"":this.$t("kling.description.mode4kRequiresV3")},options(){return[{value:"std",label:this.$t("kling.name.modeStd"),disabled:!1,disabledReason:""},{value:"pro",label:this.$t("kling.name.modePro"),disabled:!1,disabledReason:""},{value:"4k",label:this.$t("kling.name.mode4k"),disabled:!!this.fourKReason,disabledReason:this.fourKReason}]},value(){return this.$store.state.kling?.config?.mode}},watch:{fourKReason(e){e&&this.value==="4k"&&this.applyMode(ne)}},mounted(){this.value||this.applyMode(ne)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Q(t,{mode:e});if(s.length===0){this.applyMode(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=Y({...t,mode:e},s);this.$store.commit("kling/setConfig",u),S.success(this.$t("kling.message.featureRemovedNotice",{fields:a}))}catch{this.revertKey+=1}},applyMode(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling.config,mode:e})}}}),ot={class:"field"},nt={class:"header"},st={class:"title font-bold"},it={key:0,class:"opt-tip"};function lt(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),m("div",ot,[i("div",nt,[i("h2",st,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.mode"),class:"info-icon"},null,8,["content"])]),(l(),C(f,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("kling.placeholder.select"),clearable:!0,onChange:e.onChange},{default:h(()=>[(l(!0),m(V,null,T(e.options,c=>(l(),C(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(),m("span",it,r(c.disabledReason),1)):v("",!0)]),_:2},1032,["label","value","disabled"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const at=y(tt,[["render",lt],["__scopeId","data-v-9a8fa3c5"]]),rt=[3,5,8,10,12,15],ct=[5,10],dt=b({name:"DurationSelector",components:{ElSelect:P,ElOption:A,InfoIcon:I},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},isV3Model(){return F.includes(this.selectedModel)},allowedDurations(){return this.isV3Model?rt:ct},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=Q(t,{duration:e});if(s.length===0){this.applyDuration(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await q.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=Y({...t,duration:e},s);this.$store.commit("kling/setConfig",u),S.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})}}}),mt={class:"field"},ut={class:"control"},pt={class:"label"},gt={class:"title font-bold"};function ft(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),m("div",mt,[i("div",ut,[i("div",pt,[i("h2",gt,r(e.$t("kling.name.duration")),1),n(d,{content:e.$t("kling.description.duration"),class:"info-icon ml-1"},null,8,["content"])]),(l(),C(f,{key:e.revertKey,"model-value":e.selectValue,class:"value",placeholder:e.$t("kling.placeholder.select"),onChange:e.onChange},{default:h(()=>[(l(!0),m(V,null,T(e.allowedDurations,c=>(l(),C(p,{key:c,label:`${c}s`,value:c},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])])}const ht=y(dt,[["render",ft],["__scopeId","data-v-5ae55e28"]]),_t=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"},kt={class:"items"},vt=["onClick"],bt={class:"name"};function yt(e,t,s,a,u,$){return l(),m("div",null,[i("span",$t,r(e.$t("kling.name.ratio")),1),i("div",kt,[(l(!0),m(V,null,T(e.options,(d,p)=>(l(),m("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:ve({width:d.width+"px",height:d.height+"px"})},null,4)],2),i("p",bt,r(d.label),1)],10,vt))),128))])])}const wt=y(_t,[["render",yt],["__scopeId","data-v-cdb14b2f"]]),Ct=b({name:"StartImage",components:{ElUpload:O,ElButton:L,ElTooltip:W,InfoIcon:I,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(){S.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){S.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()}}}),St={class:"relative"},Vt={class:"flex justify-between"},It={class:"flex justify-start items-center"},Tt={class:"text-sm font-bold"};function Et(e,t,s,a,u,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),k=o("el-tooltip"),g=o("el-upload");return l(),m("div",St,[i("div",Vt,[i("div",It,[i("span",Tt,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(),C(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:h(()=>[n(k,{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 Lt=y(Ct,[["render",Et],["__scopeId","data-v-68cf38f5"]]),Mt=b({name:"EndImage",components:{ElUpload:O,ElButton:L,ElTooltip:W,ImagePreview:K,InfoIcon:I,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 J(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:(S.warning(this.$t("kling.message.endImageRequiresStart")),!1):(S.warning(this.$t("kling.message.endImageNotSupported")),!1)},onExceed(){S.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){S.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()}}}),Rt={class:"relative"},Ut={class:"flex justify-between"},Dt={class:"flex justify-start items-center"},At={class:"text-sm font-bold"};function Pt(e,t,s,a,u,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),k=o("el-tooltip"),g=o("el-upload");return l(),m("div",Rt,[i("div",Ut,[i("div",Dt,[i("span",At,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(),C(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:M=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:h(()=>[n(k,{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(Mt,[["render",Pt],["__scopeId","data-v-593c3bde"]]),Kt=b({name:"CfgScaleSelector",components:{ElSlider:me,InfoIcon:I,ElInputNumber:de},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)}}),Ot={class:"flex justify-between"},jt={class:"flex justify-start items-center"},Nt={class:"text-sm font-bold"},Bt={class:"flex justify-end items-center"},zt={class:"w-full"};function Ft(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-input-number"),f=o("el-slider");return l(),m("div",null,[i("div",Ot,[i("div",jt,[i("span",Nt,r(e.$t("kling.name.cfgScale")),1),n(d,{content:e.$t("kling.description.cfgScale")},null,8,["content"])]),i("div",Bt,[n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),"controls-position":"right"},null,8,["modelValue"])])]),i("div",zt,[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 qt=y(Kt,[["render",Ft]]),Ht=b({name:"GenerateAudioSelector",components:{ElSwitch:ue,InfoIcon:I},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})}}}),Wt={class:"relative"},Jt={class:"flex justify-between items-center"},Qt={class:"flex justify-start items-center"},Yt={class:"text-sm font-bold"};function Xt(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-switch");return l(),m("div",Wt,[i("div",Jt,[i("div",Qt,[i("span",Yt,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 Zt=y(Ht,[["render",Xt]]),xt=["horizontal","vertical","pan","tilt","roll","zoom"],eo=b({name:"CameraControlSelector",components:{ElSelect:P,ElOption:A,ElSlider:me,ElInputNumber:de,InfoIcon:I},data(){return{configKeys:xt}},computed:{typeOptions(){return[{value:"",label:this.$t("kling.name.cameraTypeNone")},{value:"simple",label:this.$t("kling.name.cameraTypeSimple")},{value:"down_back",label:this.$t("kling.name.cameraTypeDownBack")},{value:"forward_up",label:this.$t("kling.name.cameraTypeForwardUp")},{value:"left_turn_forward",label:this.$t("kling.name.cameraTypeLeftTurnForward")},{value:"right_turn_forward",label:this.$t("kling.name.cameraTypeRightTurnForward")}]},selectedMode(){return this.$store.state.kling?.config?.mode||""},selectedModel(){return this.$store.state.kling?.config?.model||""},selectedDuration(){return this.$store.state.kling?.config?.duration},motionControlSupported(){return J(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"},u={...a.config||{}};t==null?delete u[e]:u[e]=t,this.$store.commit("kling/setConfig",{...s,camera_control:{...a,type:"simple",config:u}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),to={class:"field"},oo={class:"header"},no={class:"text-sm font-bold"},so={key:0,class:"config-grid"},io={class:"cfg-row-head"},lo={class:"cfg-name"};function ao(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select"),c=o("el-input-number"),k=o("el-slider");return l(),m("div",to,[i("div",oo,[i("span",no,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),m(V,null,T(e.typeOptions,g=>(l(),C(p,{key:g.value,label:g.label,value:g.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","disabled"]),e.selectedType==="simple"&&!e.disabled?(l(),m("div",so,[(l(!0),m(V,null,T(e.configKeys,g=>(l(),m("div",{key:g,class:"cfg-row"},[i("div",io,[i("span",lo,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(k,{"model-value":e.configValues[g]??0,min:-1,max:1,step:.1,onInput:_=>e.onSliderChange(g,_)},null,8,["model-value","onInput"])]))),128))])):v("",!0)])}const ro=y(eo,[["render",ao],["__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 co(e,t){const s=(e||"").trim();return s?s.includes(t)?s:`${s}${B}${t}`:t}function z(e,t){if(!e||!t)return e||"";const s=[`${t}${B}`,`${B}${t}`,t];let a=e;for(const u of s)if(a.includes(u)){a=a.replace(u,"");break}return a.replace(/(?:,\s*)+$/,"").replace(/^(?:,\s*)+/,"")}const mo=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"},po={class:"pill-text"},go=["aria-label","onClick"];function fo(e,t,s,a,u,$){const d=o("font-awesome-icon");return e.selected.length>0?(l(),m("div",uo,[(l(!0),m(V,null,T(e.selected,p=>(l(),m("div",{key:p,class:"pill",role:"listitem"},[i("span",po,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,go)]))),128))])):v("",!0)}const ho=y(mo,[["render",fo],["__scopeId","data-v-5fc4fa65"]]),_o="",$o=b({name:"PromptInput",components:{ElButton:L,FontAwesomeIcon:E,PromptTextarea:Me,InspirationPills:ho},emits:["open-inspiration"],computed:{prompt:{get(){return this.$store.state.kling?.config?.prompt},set(e){this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=_o)}});function ko(e,t,s,a,u,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("inspiration-pills"),c=o("prompt-textarea");return l(),C(c,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||(t[1]=k=>e.prompt=k),title:e.$t("kling.name.prompt"),info:e.$t("kling.description.prompt"),placeholder:e.$t("kling.placeholder.prompt")},{actions:h(()=>[n(p,{text:"",size:"small",class:"inspiration-btn",onClick:t[0]||(t[0]=k=>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})]),before:h(()=>[n(f)]),_:1},8,["modelValue","title","info","placeholder"])}const vo=y($o,[["render",ko],["__scopeId","data-v-c01fc1a6"]]),bo="",yo=b({name:"NegativePromptInput",components:{ElInput:pe,InfoIcon:I},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=bo)}}),wo={class:"field"},Co={class:"box"},So={class:"title font-bold"};function Vo(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-input");return l(),m("div",wo,[i("div",Co,[i("h2",So,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 Io=y(yo,[["render",Vo],["__scopeId","data-v-de98cf01"]]),To=b({name:"InspirationDrawer",components:{ElDrawer:re,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(co(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)}}}),Eo={class:"drawer-content"},Lo={class:"drawer-header"},Mo={class:"title-row"},Ro={class:"title"},Uo={class:"hint"},Do={key:0,class:"selected-bar"},Ao={class:"selected-text"},Po={class:"groups"},Go={class:"group-title"},Ko={class:"chip-grid"},Oo=["onClick"];function jo(e,t,s,a,u,$){const d=o("font-awesome-icon"),p=o("el-button"),f=o("el-drawer");return l(),C(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",Eo,[i("div",Lo,[i("div",Mo,[n(d,{icon:"fa-regular fa-lightbulb",class:"mr-2"}),i("span",Ro,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",Uo,r(e.$t("kling.inspiration.hint")),1),e.selectedCount>0?(l(),m("div",Do,[i("span",Ao,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"])])):v("",!0),i("div",Po,[(l(!0),m(V,null,T(e.groups,c=>(l(),m("div",{key:c.groupKey,class:"group"},[i("div",Go,r(e.$t(`kling.inspiration.group.${c.groupKey}`)),1),i("div",Ko,[(l(!0),m(V,null,T(c.chipKeys,k=>(l(),m("button",{key:k,type:"button",class:U({chip:!0,active:e.isSelected(e.chipText(k))}),onClick:g=>e.onToggle(e.chipText(k))},r(e.chipText(k)),11,Oo))),128))])]))),128))])])]),_:1},8,["modelValue","size"])}const No=y(To,[["render",jo],["__scopeId","data-v-7d457a69"]]),Bo={"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"},zo={std:"720p",pro:"1080p","4k":"4K"},Fo=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 Bo[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||""},modeLabel(){const e=this.config?.mode||"std";return zo[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),qo={class:"summary-chip"},Ho=["title"],Wo=["title"],Jo=["title"],Qo=["title"],Yo=["title"];function Xo(e,t,s,a,u,$){const d=o("font-awesome-icon");return l(),m("div",qo,[i("span",{class:"part",title:e.$t("kling.name.model")},r(e.modelLabel),9,Ho),t[0]||(t[0]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.duration")},r(e.durationLabel),9,Wo),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,Jo),t[2]||(t[2]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.mode")},r(e.modeLabel),9,Qo),e.generateAudio?(l(),m("span",{key:0,class:"audio",title:e.$t("kling.name.generateAudio")},[n(d,{icon:"fa-solid fa-headphones"})],8,Yo)):v("",!0)])}const Zo=y(Fo,[["render",Xo],["__scopeId","data-v-418a6733"]]),xo=b({name:"ConfigPanel",components:{ElButton:L,Consumption:ce,FontAwesomeIcon:E,PromptInput:vo,NegativePromptInput:Io,ModelSelector:et,ModeSelector:at,DurationSelector:ht,RatioSelector:wt,StartImage:Lt,CfgScaleSelector:qt,GenerateAudioSelector:Zt,CameraControlSelector:ro,InspirationDrawer:No,SummaryChip:Zo,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")}}}),en={class:"flex flex-col h-full"},tn={class:"flex-1 overflow-y-auto p-5"},on={class:"flex flex-col items-center justify-center px-5 pb-5"};function nn(e,t,s,a,u,$){const d=o("prompt-input"),p=o("model-selector"),f=o("ratio-selector"),c=o("start-image"),k=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"),X=o("font-awesome-icon"),Z=o("el-button"),ke=o("inspiration-drawer");return l(),m("div",en,[i("div",tn,[n(d,{class:"mb-4",onOpenInspiration:t[0]||(t[0]=x=>e.inspirationOpen=!0)}),n(p,{class:"mb-4"}),n(f,{class:"mb-4"}),n(c,{class:"mb-2"}),n(k,{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",on,[n(_e),n($e,{value:e.consumption,service:e.service},null,8,["value","service"]),e.config?.video_url!==void 0||e.config?.custom?(l(),C(Z,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(X,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.extend")),1)]),_:1},8,["onClick"])):(l(),C(Z,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:h(()=>[n(X,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.generate")),1)]),_:1},8,["onClick"]))]),n(ke,{modelValue:e.inspirationOpen,"onUpdate:modelValue":t[1]||(t[1]=x=>e.inspirationOpen=x)},null,8,["modelValue"])])}const sn=y(xo,[["render",nn]]),ln=b({name:"MotionImage",components:{ElUpload:O,ElButton:L,InfoIcon:I,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(){S.warning(this.$t("kling.message.uploadReferencesExceed"))},onError(){S.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()}}}),an={class:"relative"},rn={class:"flex justify-between"},cn={class:"flex justify-start items-center"},dn={class:"text-sm font-bold"};function mn(e,t,s,a,u,$){const d=o("info-icon"),p=o("image-preview"),f=o("font-awesome-icon"),c=o("el-button"),k=o("el-upload");return l(),m("div",an,[i("div",rn,[i("div",cn,[i("span",dn,r(e.$t("kling.name.motionImage")),1),n(d,{content:e.$t("kling.description.motionImage")},null,8,["content"])])]),n(k,{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(),C(p,{key:0,url:g.url,name:g.name,percentage:g.percentage,onRemove:_=>e.onRemove(g)},null,8,["url","name","percentage","onRemove"])):v("",!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 un=y(ln,[["render",mn],["__scopeId","data-v-37d42da7"]]),pn=b({name:"MotionVideo",components:{ElUpload:O,ElButton:L,InfoIcon:I,FilePreview:Ue,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(){S.warning(this.$t("kling.message.uploadVideoExceed"))},onError(){S.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:(S.error(this.$t("kling.message.uploadVideoSizeExceed")),!1):(S.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()}}}),gn={class:"relative"},fn={class:"flex justify-between"},hn={class:"flex justify-start items-center"},_n={class:"text-sm font-bold"};function $n(e,t,s,a,u,$){const d=o("info-icon"),p=o("file-preview"),f=o("font-awesome-icon"),c=o("el-button"),k=o("el-upload");return l(),m("div",gn,[i("div",fn,[i("div",hn,[i("span",_n,r(e.$t("kling.name.motionVideo")),1),n(d,{content:e.$t("kling.description.motionVideo")},null,8,["content"])])]),n(k,{"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(),C(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"])):v("",!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 kn=y(pn,[["render",$n],["__scopeId","data-v-5cf93212"]]),vn=b({name:"MotionPromptInput",components:{ElInput:pe,InfoIcon:I},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||""},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),bn={class:"field"},yn={class:"box"},wn={class:"title font-bold"};function Cn(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-input");return l(),m("div",bn,[i("div",yn,[i("h2",wn,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 Sn=y(vn,[["render",Cn],["__scopeId","data-v-ca9fdbe5"]]),ie="video",Vn=b({name:"CharacterOrientationSelector",components:{ElRadioGroup:Ae,ElRadioButton:De,InfoIcon:I},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||ie},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=ie)}}),In={class:"field"},Tn={class:"header"},En={class:"text-sm font-bold"};function Ln(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-radio-button"),f=o("el-radio-group");return l(),m("div",In,[i("div",Tn,[i("span",En,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 Mn=y(Vn,[["render",Ln],["__scopeId","data-v-7a91195b"]]),le="std",Rn=b({name:"MotionModeSelector",components:{ElSelect:P,ElOption:A,InfoIcon:I},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||le},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=le)}}),Un={class:"field"},Dn={class:"header"},An={class:"title font-bold"};function Pn(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-option"),f=o("el-select");return l(),m("div",Un,[i("div",Dn,[i("h2",An,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),m(V,null,T(e.options,c=>(l(),C(p,{key:c.value,label:c.label,value:c.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Gn=y(Rn,[["render",Pn],["__scopeId","data-v-1295688c"]]),Kn=b({name:"KeepOriginalSoundSelector",components:{ElSwitch:ue,InfoIcon:I},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"})}}}}),On={class:"relative"},jn={class:"flex justify-between items-center"},Nn={class:"flex justify-start items-center"},Bn={class:"text-sm font-bold"};function zn(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-switch");return l(),m("div",On,[i("div",jn,[i("div",Nn,[i("span",Bn,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 Fn=y(Kn,[["render",zn]]),qn=b({name:"MotionPanel",components:{ElButton:L,FontAwesomeIcon:E,Consumption:ce,MotionImage:un,MotionVideo:kn,MotionPromptInput:Sn,CharacterOrientationSelector:Mn,MotionModeSelector:Gn,KeepOriginalSoundSelector:Fn},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")}}}),Hn={class:"flex flex-col h-full"},Wn={class:"flex-1 overflow-y-auto p-5"},Jn={class:"flex flex-col items-center justify-center px-5 pb-5"};function Qn(e,t,s,a,u,$){const d=o("motion-image"),p=o("motion-video"),f=o("motion-prompt-input"),c=o("character-orientation-selector"),k=o("motion-mode-selector"),g=o("keep-original-sound-selector"),_=o("consumption"),M=o("font-awesome-icon"),R=o("el-button");return l(),m("div",Hn,[i("div",Wn,[n(d,{class:"mb-3"}),n(p,{class:"mb-3"}),n(f,{class:"mb-4"}),n(c,{class:"mb-4"}),n(k,{class:"mb-4"}),n(g,{class:"mb-4"})]),i("div",Jn,[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 Yn=y(qn,[["render",Qn]]),Xn=b({name:"KlingTabSwitcher",components:{ElTabs:Ge,ElTabPane:Pe,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)}}}),Zn=["title"],xn={class:"text"};function es(e,t,s,a,u,$){const d=o("el-tag"),p=o("el-tab-pane"),f=o("el-tabs");return l(),C(f,{"model-value":e.modelValue,class:"kling-tabs",stretch:"","onUpdate:modelValue":e.onUpdate},{default:h(()=>[(l(!0),m(V,null,T(e.tabs,c=>(l(),C(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",xn,r(c.label),1),c.badge?(l(),C(d,{key:0,size:"small",type:"warning",class:"badge"},{default:h(()=>[w(r(c.badge),1)]),_:2},1024)):v("",!0)],8,Zn)]),_:2},1032,["name","disabled"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])}const ts=y(Xn,[["render",es],["__scopeId","data-v-bf00c27e"]]),os=b({name:"TaskPreview",components:{ElImage:Ne,CopyToClipboard:Ke,FontAwesomeIcon:E,ElAlert:je,VideoPlayer:Oe,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")}}}),ns={class:"preview"},ss={class:"left"},is={class:"main"},ls={class:"bot"},as={class:"datetime"},rs={class:"info"},cs={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},ds={key:1,class:"prompt mt-2"},ms={key:0},us={key:1},ps={key:0,class:U({content:!0,failed:!0})},gs={key:0,class:"mb-4"},fs={key:1,class:U({operations:!0,"mt-2":!0})},hs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},_s={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},$s={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},ks={key:1,class:U({content:!0})},vs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},bs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ys={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ws={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Cs={key:2,class:U({content:!0})},Ss={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Vs={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Is(e,t,s,a,u,$){const d=o("el-image"),p=o("image-preview"),f=o("video-player"),c=o("el-button"),k=o("el-tooltip"),g=o("font-awesome-icon"),_=o("copy-to-clipboard"),M=o("el-alert");return l(),m("div",ns,[i("div",ss,[n(d,{src:"https://cdn.acedata.cloud/qpbbbb.jpg",class:"avatar"})]),i("div",is,[i("div",ls,[w(r(e.$t("kling.name.klingBot"))+" ",1),i("span",as,r(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),i("div",rs,[e.referenceImages.length>0?(l(),m("div",cs,[(l(!0),m(V,null,T(e.referenceImages,(R,j)=>(l(),C(p,{key:j,url:R.url,name:R.name,closable:!1},null,8,["url","name"]))),128))])):v("",!0),e.modelValue?.request?.prompt?(l(),m("p",ds,[w(r(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?v("",!0):(l(),m("span",ms," - ("+r(e.$t("kling.status.pending"))+") ",1)),e.modelValue?.response?.state==="submitted"||e.modelValue?.response?.state==="processing"||e.modelValue?.response?.state==="pending"||e.modelValue?.response?.state==="completed"?(l(),m("span",us," - ("+r(e.$t("kling.status.processing"))+") ",1)):v("",!0)])):v("",!0)]),e.modelValue?.response?.success===!0?(l(),m("div",ps,[e.modelValue?.response.video_url?(l(),m("div",gs,[n(f,{src:e.modelValue?.response.video_url},null,8,["src"])])):v("",!0),e.modelValue?.response.success?(l(),m("div",fs,[n(k,{class:"box-item",effect:"dark",content:e.$t("kling.message.downloadVideo"),placement:"top-start"},{default:h(()=>[e.modelValue?.response.video_url?(l(),C(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})):v("",!0)]),_:1},8,["content"])])):v("",!0),n(M,{closable:!1,class:"mt-2 success"},{default:h(()=>[i("p",hs,[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",_s,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(l(),m("p",$s,[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)])):v("",!0)]),_:1})])):v("",!0),e.modelValue?.response?.success===!1?(l(),m("div",ks,[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",vs,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),i("p",bs,[n(g,{icon:"fa-solid fa-circle-info",class:"mr-1"}),w(" "+r(e.$t("kling.name.failureReason"))+": "+r(e.modelValue?.response?.error?.message)+" ",1),n(_,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(l(),m("p",ys,[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)])):v("",!0),e.modelValue?.response?.trace_id?(l(),m("p",ws,[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"])])):v("",!0)]),_:1})])):v("",!0),e.modelValue?.response?.success===void 0?(l(),m("div",Cs,[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",Ss,[n(g,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(_,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.response?.trace_id?(l(),m("p",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"])])):v("",!0)]),_:1})])):v("",!0)])])}const Ts=y(os,[["render",Is],["__scopeId","data-v-e8e87659"]]),Es=b({name:"RecentPanel",components:{TaskPreview:Ts,NoTasks:Re,BotPlaceholder:Be,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?.()}}}),Ls={key:0},Ms={key:2,class:"w-full h-full flex items-center justify-center"};function Rs(e,t,s,a,u,$){const d=o("bot-placeholder"),p=o("task-preview"),f=o("scroll-list"),c=o("no-tasks");return l(),m(V,null,[e.tasks?.items===void 0?(l(),m("div",Ls,[n(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(l(),C(f,{key:1,ref:"scrollList",class:"h-full w-full overflow-y-auto tasks",loading:e.loading,onReachTop:t[0]||(t[0]=k=>e.$emit("reach-top"))},{default:h(()=>[(l(!0),m(V,null,T(e.tasks?.items,k=>(l(),C(p,{key:k.id,"model-value":k},null,8,["model-value"]))),128))]),_:1},8,["loading"])):v("",!0),e.tasks?.items?.length===0?(l(),m("div",Ms,[n(c)])):v("",!0)],64)}const Us=y(Es,[["render",Rs]]),ae=Ce("kling"),Ds=b({name:"KlingIndex",components:{ConfigPanel:sn,MotionPanel:Yn,TabSwitcher:ts,Layout:Je,RecentPanel:Us},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===oe.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===oe.Request||this.fetchingTasks},credential(){return this.$store.state.kling.credential},config(){return this.$store.state.kling.config},motionConfig(){return this.$store.state.kling.motionConfig},taskType(){return this.$store.state.kling.taskType||"videos"},tasks(){return this.$store.state.kling.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await 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:ae};if(!s.video_id&&!t.video_url&&!s.start_image_url&&s.end_image_url){S.warning(this.$t("kling.message.endImageRequiresStart"));return}s.action||(s.video_id||t.video_url?s.action="extend":s.start_image_url?s.action="image2video":s.action="text2video"),s.action==="text2video"&&s.end_image_url&&delete s.end_image_url,e?.type&&(s.camera_control={type:e.type,...e.type==="simple"&&e.config?{config:Object.fromEntries(Object.entries(e.config).filter(([,u])=>u!=null))}:{}});const a=this.credential?.token;if(!a){console.error("no token specified");return}S.info(this.$t("kling.message.startingTask")),ee("kling",te.generate(s,{token:a})).then(()=>{S.success(this.$t("kling.message.startTaskSuccess"))}).catch(u=>{u?.response?.data?.error?.code===se?S.error(this.$t("kling.message.usedUp")):S.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){S.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:ae},s=this.credential?.token;if(!s){console.error("no token specified");return}S.info(this.$t("kling.message.startingTask")),ee("kling",te.motion(t,{token:s})).then(()=>{S.success(this.$t("kling.message.startTaskSuccess"))}).catch(a=>{a?.response?.data?.error?.code===se?S.error(this.$t("kling.message.usedUp")):S.error(this.$t("kling.message.startTaskFailed"))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),As={class:"flex flex-col h-full"},Ps={class:"flex-1 min-h-0"};function Gs(e,t,s,a,u,$){const d=o("tab-switcher"),p=o("config-panel"),f=o("motion-panel"),c=o("recent-panel"),k=o("layout");return l(),C(k,null,{config:h(()=>[i("div",As,[n(d,{"model-value":e.taskType,"onUpdate:modelValue":e.onTabChange},null,8,["model-value","onUpdate:modelValue"]),i("div",Ps,[e.taskType==="videos"?(l(),C(p,{key:0,onGenerate:e.onGenerate},null,8,["onGenerate"])):e.taskType==="motion"?(l(),C(f,{key:1,onGenerate:e.onGenerateMotion},null,8,["onGenerate"])):v("",!0)])])]),result:h(()=>[n(c,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const Ki=y(Ds,[["render",Gs]]);export{Ki as default};