@acedatacloud/nexior 3.218.0 → 3.220.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 (233) hide show
  1. package/dist/assets/ApiCodeButton-B7U80J_X.css +1 -0
  2. package/dist/assets/{ApiCodeButton-SH3-mzRZ.js → ApiCodeButton-DdERRoj0.js} +1 -1
  3. package/dist/assets/{Auth-DWUVa8Jl.js → Auth-BJd1rSsg.js} +1 -1
  4. package/dist/assets/{BotPlaceholder-BkzQvjfL.js → BotPlaceholder-CMs0qZF7.js} +1 -1
  5. package/dist/assets/{Callback-BxGaOewL.js → Callback-Dzomuvo8.js} +1 -1
  6. package/dist/assets/{Console-CyL1rCGt.js → Console-B2KWFwa8.js} +1 -1
  7. package/dist/assets/{Consumption-A912L03A.js → Consumption-BgQfeJho.js} +1 -1
  8. package/dist/assets/{Conversation-xpXg9WiT.js → Conversation-C7gLvGYl.js} +1 -1
  9. package/dist/assets/{CopyToClipboard-B14N8uGd.js → CopyToClipboard-B3FBgh3x.js} +1 -1
  10. package/dist/assets/{Detail-BbbPdpQE.js → Detail-JAWH2XZ9.js} +2 -2
  11. package/dist/assets/{Extra-C4aRQl-H.js → Extra-DmR1K9LZ.js} +1 -1
  12. package/dist/assets/{FilePreview-D48r5Clc.js → FilePreview-C6KMFmBi.js} +1 -1
  13. package/dist/assets/{Hailuo-BCKGqdOs.js → Hailuo-DKTim3hG.js} +1 -1
  14. package/dist/assets/{History-DPQtUf7x.js → History-C2xs-mhS.js} +1 -1
  15. package/dist/assets/{ImagePreview-Cqg3CCWb.js → ImagePreview-CYYwR4zK.js} +1 -1
  16. package/dist/assets/{ImageWrapper-BoVGmV3c.js → ImageWrapper-D9p7vy0W.js} +1 -1
  17. package/dist/assets/{Index-enQR_B75.js → Index-B1QQwbRw.js} +1 -1
  18. package/dist/assets/{Index-wrwrz49J.js → Index-B3DzYkpS.js} +1 -1
  19. package/dist/assets/{Index-DUOVp326.js → Index-BHwUw9Br.js} +1 -1
  20. package/dist/assets/{Index-Dfk0NO2y.js → Index-BQHNMNDb.js} +1 -1
  21. package/dist/assets/{Index-BrZWXzhT.js → Index-BcGsvHsN.js} +1 -1
  22. package/dist/assets/{Index-Bg3Ld6W9.js → Index-Bey6rNRd.js} +1 -1
  23. package/dist/assets/{Index-B0Mio_g9.js → Index-BhN8OcJH.js} +1 -1
  24. package/dist/assets/{Index-BPmSvfVx.js → Index-C02uk1N1.js} +1 -1
  25. package/dist/assets/{Index-DlZPk3gR.js → Index-C1VzAZF_.js} +1 -1
  26. package/dist/assets/{Index-CPP9e574.js → Index-C4hDoXPR.js} +1 -1
  27. package/dist/assets/{Index-xDC-ixQN.js → Index-C6xAHYHk.js} +1 -1
  28. package/dist/assets/{Index-Cx0xJTiJ.js → Index-CHhFlhF5.js} +1 -1
  29. package/dist/assets/{Index-C8r9qREH.js → Index-CIn2CzVu.js} +1 -1
  30. package/dist/assets/{Index-Ds3NSJ9n.js → Index-CM1FOamJ.js} +1 -1
  31. package/dist/assets/{Index-CiDm5OJc.js → Index-CPo5pIYF.js} +1 -1
  32. package/dist/assets/{Index-CvRI-P8u.js → Index-CdOcEqrx.js} +1 -1
  33. package/dist/assets/{Index-CHgg4E-y.js → Index-CmYdRyZ-.js} +1 -1
  34. package/dist/assets/{Index-JAx9LgHk.js → Index-D00557ih.js} +1 -1
  35. package/dist/assets/{Index-14qRLoq4.js → Index-D_dopSe4.js} +1 -1
  36. package/dist/assets/{Index-DkSyktrv.js → Index-DbpM7BrT.js} +1 -1
  37. package/dist/assets/{Index-B9ZpDD-f.js → Index-Dj277d_k.js} +1 -1
  38. package/dist/assets/{Index-cE-ChT9Z.js → Index-DrzVW2wu.js} +1 -1
  39. package/dist/assets/{Index-CWuu5Khy.js → Index-Dz50z1gP.js} +1 -1
  40. package/dist/assets/{Index-CEBvJOY3.js → Index-YqpvRteV.js} +1 -1
  41. package/dist/assets/{Invitees-j0wuuGIx.js → Invitees-DTht-4p7.js} +1 -1
  42. package/dist/assets/{List-C2iLuWI5.js → List-BPs1tTdL.js} +1 -1
  43. package/dist/assets/{List-BxGW6m2u.js → List-Br7iW5Vc.js} +1 -1
  44. package/dist/assets/{List-CHUxMfQr.js → List-Dm5feANQ.js} +1 -1
  45. package/dist/assets/{Main-BXqNrZKG.js → Main-B0OgmDWf.js} +1 -1
  46. package/dist/assets/{Navigator-DyioLgyO.js → Navigator-zHYmmGqA.js} +1 -1
  47. package/dist/assets/{NoTasks-q3Lv6tKO.js → NoTasks-d_8CfjZ-.js} +1 -1
  48. package/dist/assets/{NotFound-CenyZYlt.js → NotFound-cTfCurfy.js} +1 -1
  49. package/dist/assets/{Pagination-9FYeXcN9.js → Pagination-DV1doTgi.js} +1 -1
  50. package/dist/assets/{Player.vue_vue_type_script_setup_true_lang-CQ6CDVNZ.js → Player.vue_vue_type_script_setup_true_lang-DpHj4ZkA.js} +1 -1
  51. package/dist/assets/{Status-D8yNcfrx.js → Status-BYLfAQe1.js} +1 -1
  52. package/dist/assets/{Subscribe-CRyPSEgW.js → Subscribe-Dxhd12St.js} +1 -1
  53. package/dist/assets/{Tts-BwX4ozWk.js → Tts-DiuASxEn.js} +1 -1
  54. package/dist/assets/{VideoPlayer-JO6u-Leu.js → VideoPlayer-BwloPwzx.js} +1 -1
  55. package/dist/assets/{_Uint8Array-EI6rdDMg.js → _Uint8Array-BHztG1Lf.js} +1 -1
  56. package/dist/assets/{_baseClone-CWXDJGZm.js → _baseClone-DBPrtxYY.js} +1 -1
  57. package/dist/assets/{_baseIteratee-EE0Dhi3s.js → _baseIteratee-DawPdq6H.js} +1 -1
  58. package/dist/assets/{_initCloneObject-BLayr3wN.js → _initCloneObject-RQtwP1G5.js} +1 -1
  59. package/dist/assets/{add-d4S-WIOs.js → add-gm7meNsz.js} +1 -1
  60. package/dist/assets/{all-wallets-BoyIashq.js → all-wallets-CwkEyvGl.js} +1 -1
  61. package/dist/assets/{app-store-BSrQ50qF.js → app-store-Bjd3blij.js} +1 -1
  62. package/dist/assets/{apple-CjhH2Y5G.js → apple-DU5PAH0e.js} +1 -1
  63. package/dist/assets/{arrow-bottom-BYAs9wOA.js → arrow-bottom-BeB6Eowb.js} +1 -1
  64. package/dist/assets/{arrow-bottom-circle-CW-jw2ql.js → arrow-bottom-circle-DR-S_2BQ.js} +1 -1
  65. package/dist/assets/{arrow-left-BNo2LuST.js → arrow-left-MWUp6VIb.js} +1 -1
  66. package/dist/assets/{arrow-right-CTtSaaL8.js → arrow-right-qwzktYqm.js} +1 -1
  67. package/dist/assets/{arrow-top-CwUKBrtj.js → arrow-top-4tQI76OZ.js} +1 -1
  68. package/dist/assets/{avatar-DbXYENch.js → avatar-CvZ01KOx.js} +1 -1
  69. package/dist/assets/{bank-JOtdi6ZX.js → bank-Bd8UgbfX.js} +1 -1
  70. package/dist/assets/{basic-BpwyId9p.js → basic-CH4gFOSh.js} +1 -1
  71. package/dist/assets/{browser-D7ceVajX.js → browser-BT62Pti3.js} +1 -1
  72. package/dist/assets/{byokCredential-DHKVhHV4.js → byokCredential-Dl2EOLqj.js} +1 -1
  73. package/dist/assets/{card-DYJT1U3Z.js → card-DCTOPEOi.js} +1 -1
  74. package/dist/assets/{castArray-EsQaGbmV.js → castArray-CEKtna1X.js} +1 -1
  75. package/dist/assets/{chat-D3HGuPrP.js → chat-BEXqp_vI.js} +1 -1
  76. package/dist/assets/{checkmark-CYpFEe__.js → checkmark-ZotAD7qS.js} +1 -1
  77. package/dist/assets/{checkmark-bold-DK8FarYx.js → checkmark-bold-Y_3_YeQd.js} +1 -1
  78. package/dist/assets/{chevron-bottom-Dm08nbTJ.js → chevron-bottom-D9h3CQH4.js} +1 -1
  79. package/dist/assets/{chevron-left-b2YZDktm.js → chevron-left-C7bUEC6D.js} +1 -1
  80. package/dist/assets/{chevron-right-Uye_K76f.js → chevron-right-C7jDGbDi.js} +1 -1
  81. package/dist/assets/{chevron-top-CWafiU6a.js → chevron-top-Dwdkwh4m.js} +1 -1
  82. package/dist/assets/{chrome-store-CYJR13_M.js → chrome-store-C2-4VJeH.js} +1 -1
  83. package/dist/assets/{clock-c8-hYawt.js → clock-7-qd4DY4.js} +1 -1
  84. package/dist/assets/{close-DnHWKMVt.js → close-CZ5nk0uO.js} +1 -1
  85. package/dist/assets/{coinPlaceholder-CiHDTA5X.js → coinPlaceholder-BEFST07b.js} +1 -1
  86. package/dist/assets/{compass-CyJAKH7X.js → compass-BRNknpHl.js} +1 -1
  87. package/dist/assets/{console-BMaVS13S.js → console-BUNs3Es6.js} +1 -1
  88. package/dist/assets/{console-BQ-YUvXy.js → console-D1SCQiWp.js} +1 -1
  89. package/dist/assets/{console-CmJNJHm2.js → console-DqvFbtfO.js} +1 -1
  90. package/dist/assets/{copy-hbofgt9j.js → copy-BgMiLEu2.js} +1 -1
  91. package/dist/assets/{createTaskActions-ltp2ovsY.js → createTaskActions-D3r1bCNh.js} +1 -1
  92. package/dist/assets/{cursor-D2VF7WUg.js → cursor-CrBmCVZE.js} +1 -1
  93. package/dist/assets/{cursor-transparent-CGxoI42w.js → cursor-transparent-DNjfiNb8.js} +1 -1
  94. package/dist/assets/{debounce-CH187K9a.js → debounce-BzdywqWi.js} +1 -1
  95. package/dist/assets/{desktop-CiGduzk_.js → desktop-BFT26rWT.js} +1 -1
  96. package/dist/assets/{disconnect-BxECSEl3.js → disconnect-BTxfeV_B.js} +1 -1
  97. package/dist/assets/{discord-DG4Qz2fq.js → discord-BcB7XJ9T.js} +1 -1
  98. package/dist/assets/{distribution-BUg5uaiM.js → distribution-D9L2VvU8.js} +1 -1
  99. package/dist/assets/{dropdown-DNCyliAd.js → dropdown-CqVkry2k.js} +1 -1
  100. package/dist/assets/{etherscan-Bx940azW.js → etherscan-BL1G-Ktx.js} +1 -1
  101. package/dist/assets/{exclamation-triangle-D0mnhXrr.js → exclamation-triangle-Bi97HCgh.js} +1 -1
  102. package/dist/assets/{extension-BC9CaN7b.js → extension-BxZXCJF1.js} +1 -1
  103. package/dist/assets/{external-link-yAR_vGKi.js → external-link-8IiT5KI-.js} +1 -1
  104. package/dist/assets/{facebook-B0r3ippS.js → facebook-BBXf4bv2.js} +1 -1
  105. package/dist/assets/{farcaster-CK5DUs0A.js → farcaster-BoXXgHyq.js} +1 -1
  106. package/dist/assets/{filters-Bv8TXor7.js → filters-DC8IKfi7.js} +1 -1
  107. package/dist/assets/{github-_IueSZdY.js → github-CBf_njI8.js} +1 -1
  108. package/dist/assets/{google-BniYvPC9.js → google-DtjQp-Zf.js} +1 -1
  109. package/dist/assets/{help-circle-CfxWQvtC.js → help-circle-BA4vSPii.js} +1 -1
  110. package/dist/assets/{highlight-BdzcL-qA.js → highlight-D6Rf8-7-.js} +1 -1
  111. package/dist/assets/{id-BqTxkCM7.js → id-CL8aw1w3.js} +1 -1
  112. package/dist/assets/{image-BE5WYw9d.js → image-BTIVNhXO.js} +1 -1
  113. package/dist/assets/{index-mnfZ250E.js → index-9TnzSqSo.js} +1 -1
  114. package/dist/assets/{index-SYkNMXgC.js → index-B5i9I9D0.js} +1 -1
  115. package/dist/assets/{index-Buwygoh0.js → index-B8CSiOhn.js} +1 -1
  116. package/dist/assets/{index-CzwZ2UC6.js → index-BG-KAGL3.js} +1 -1
  117. package/dist/assets/{index-BjrsQBPY.js → index-BKiiWvXY.js} +1 -1
  118. package/dist/assets/{index-CV-Y1hCb.js → index-BM28BQge.js} +1 -1
  119. package/dist/assets/{index-orpPOzFA.js → index-BRfbHCvZ.js} +4 -4
  120. package/dist/assets/{index-B1BrvmAX.js → index-BSKrtLfD.js} +1 -1
  121. package/dist/assets/{index-BrpqKiow.js → index-BYNyqWl4.js} +1 -1
  122. package/dist/assets/{index-CRY-KoZ0.js → index-BYrMMM1u.js} +1 -1
  123. package/dist/assets/{index-BQXTC0Wr.js → index-BZkaFFuw.js} +1 -1
  124. package/dist/assets/{index-BULlJ3TF.js → index-Bav7i68F.js} +1 -1
  125. package/dist/assets/{index-CABDcFEC.js → index-BcIct0a2.js} +1 -1
  126. package/dist/assets/{index-Cyij_nx9.js → index-BckDmkd_.js} +1 -1
  127. package/dist/assets/{index-C61s_vms.js → index-BitIttnu.js} +1 -1
  128. package/dist/assets/{index-ChitGZ1D.js → index-BnLROHuz.js} +1 -1
  129. package/dist/assets/{index-KmnidV0q.js → index-BnfMUAmr.js} +1 -1
  130. package/dist/assets/{index-CNPDulRN.js → index-BtOQSaPZ.js} +1 -1
  131. package/dist/assets/{index-5aVmsxeg.js → index-ByRYubXn.js} +1 -1
  132. package/dist/assets/{index-D68kNANv.js → index-C-1t2sdo.js} +1 -1
  133. package/dist/assets/{index-lJMO2j3A.js → index-C8L4L2UR.js} +1 -1
  134. package/dist/assets/{index-By5OsweK.js → index-C9PmnSwM.js} +1 -1
  135. package/dist/assets/{index-BZ8UWpew.js → index-CBKsfw4L.js} +1 -1
  136. package/dist/assets/{index-BRM7VSJ7.js → index-CCD14HB5.js} +1 -1
  137. package/dist/assets/{index-BsF7tVO8.js → index-CJozFb-_.js} +1 -1
  138. package/dist/assets/{index-Bv1_89hb.js → index-CNtDq5Ox.js} +1 -1
  139. package/dist/assets/{index-DGYkSNcS.js → index-CVuadntg.js} +1 -1
  140. package/dist/assets/{index-BYaJzDVD.js → index-Cf4MWvor.js} +1 -1
  141. package/dist/assets/{index-Db21DbVw.js → index-CiUV6rQ6.js} +1 -1
  142. package/dist/assets/{index-n9wfcP3o.js → index-Cit52WsR.js} +3 -3
  143. package/dist/assets/{index-CUjbSh1u.js → index-CnsbSkfL.js} +1 -1
  144. package/dist/assets/{index-QLjR9Y9r.js → index-D0K3XkBZ.js} +5 -5
  145. package/dist/assets/{index-DLBPcYg6.js → index-D63t9suS.js} +1 -1
  146. package/dist/assets/{index-77eCDIG7.js → index-D6w9vM3v.js} +2 -2
  147. package/dist/assets/{index-B1hm-I4G.js → index-D7Dtp2wz.js} +1 -1
  148. package/dist/assets/{index-B2lhMpgd.js → index-DJVt4Jyx.js} +1 -1
  149. package/dist/assets/{index-DfEf3oRT.js → index-DMg5p5Q5.js} +1 -1
  150. package/dist/assets/{index-CA4OzbH-.js → index-DNgjX46H.js} +1 -1
  151. package/dist/assets/{index-Dwxqhbd4.js → index-DPqEZ0tz.js} +1 -1
  152. package/dist/assets/{index-C-1OqjJL.js → index-DfiGO-z3.js} +1 -1
  153. package/dist/assets/{index-D1DFTwxq.js → index-DiX4F22c.js} +1 -1
  154. package/dist/assets/{index-RF25EqYw.js → index-Dl-8_iZA.js} +1 -1
  155. package/dist/assets/{index-B6lKp5WL.js → index-DpqW15Ug.js} +1 -1
  156. package/dist/assets/{index-DBz8L3lb.js → index-Dw9EHqzV.js} +1 -1
  157. package/dist/assets/{index-BGbf2XI9.js → index-DyVpSxMe.js} +1 -1
  158. package/dist/assets/{index-BjQDU7Yx.js → index-LSBUkmpR.js} +1 -1
  159. package/dist/assets/{index-pihzsxFJ.js → index-ONqkRIuc.js} +1 -1
  160. package/dist/assets/{index-PXD6g-_z.js → index-PMRNSwyk.js} +1 -1
  161. package/dist/assets/{index-CieIazTO.js → index-TeXIMvfD.js} +1 -1
  162. package/dist/assets/{index-CR_Yj0hW.js → index-UCV6svvp.js} +1 -1
  163. package/dist/assets/{index-BxKbLOre.js → index-UNwJ0Soc.js} +1 -1
  164. package/dist/assets/{index-CH3yCHaX.js → index-UlQJ4CNe.js} +1 -1
  165. package/dist/assets/{index-BUO-Md2D.js → index-_SpxdH4J.js} +1 -1
  166. package/dist/assets/{index-BvZ7ZgVE.js → index-k55SX5kl.js} +1 -1
  167. package/dist/assets/{index-Csx64x23.js → index-k5f0I2au.js} +1 -1
  168. package/dist/assets/{index-BLA9-Jut.js → index-kShYQ4pa.js} +1 -1
  169. package/dist/assets/{index-qdxDTlvx.js → index-pflhI7Gn.js} +1 -1
  170. package/dist/assets/{index-CwJYqqQC.js → index-qrkNmBs4.js} +1 -1
  171. package/dist/assets/{index-BQK6psTe.js → index-r8zBJeUr.js} +1 -1
  172. package/dist/assets/{index-BWqhWiyg.js → index-sQcU36Zu.js} +1 -1
  173. package/dist/assets/{index-Cd_PhXbk.js → index-y6L6cZvE.js} +1 -1
  174. package/dist/assets/{index-IYCZlPkQ.js → index-zJe4TTTN.js} +1 -1
  175. package/dist/assets/{index.browser.esm-CjEeoYb5.js → index.browser.esm-B80jhgNq.js} +1 -1
  176. package/dist/assets/{index.es-BiVAkZvx.js → index.es-BXrnqbDc.js} +1 -1
  177. package/dist/assets/{info-circle-uFLIsgrI.js → info-circle-gZGPj5j1.js} +1 -1
  178. package/dist/assets/{info-B2muvAt6.js → info-qXczUfMj.js} +1 -1
  179. package/dist/assets/{isEqual-DrMqy2rp.js → isEqual-DdIQEpjm.js} +1 -1
  180. package/dist/assets/{isPlainObject-Dbl18ckc.js → isPlainObject-CG3miWf6.js} +1 -1
  181. package/dist/assets/{lightbulb-Dz8Xyl0J.js → lightbulb-DAV_SVzx.js} +1 -1
  182. package/dist/assets/{mail-ykbuMntu.js → mail-BSiQllr5.js} +1 -1
  183. package/dist/assets/{midjourney-C5N15hg0.js → midjourney-Bk0pQ1GK.js} +1 -1
  184. package/dist/assets/{mobile-C3PjsKfR.js → mobile-D3L4uFbS.js} +1 -1
  185. package/dist/assets/{more-CaSP9zHE.js → more-DDHf70dL.js} +1 -1
  186. package/dist/assets/{network-placeholder-BsJ4NdS7.js → network-placeholder-DFUCBmFT.js} +1 -1
  187. package/dist/assets/{nftPlaceholder-BqmUtnGM.js → nftPlaceholder-DG1XMQGo.js} +1 -1
  188. package/dist/assets/{off-D2jbrUt7.js → off-DoNg2U4X.js} +1 -1
  189. package/dist/assets/{order-COKuoHoP.js → order-KT2UQOVv.js} +1 -1
  190. package/dist/assets/{pagination-ByFwVm7b.js → pagination-BJFvnhlr.js} +1 -1
  191. package/dist/assets/{play-store-D5rE7tN2.js → play-store-BS1DM-xn.js} +1 -1
  192. package/dist/assets/{plus-CK0lmY6u.js → plus-BMI4G9vV.js} +1 -1
  193. package/dist/assets/{price-ClrI7Hj_.js → price-Be1B_bvo.js} +1 -1
  194. package/dist/assets/{producer-BbFPIshx.js → producer-QOy93416.js} +1 -1
  195. package/dist/assets/{qr-code-sDm2rRXV.js → qr-code-BohZYeDa.js} +1 -1
  196. package/dist/assets/{recycle-horizontal-mngmf8My.js → recycle-horizontal-m74Coduu.js} +1 -1
  197. package/dist/assets/{refresh-2uDNjbTZ.js → refresh-iCbrI8Sz.js} +1 -1
  198. package/dist/assets/{reown-logo-Bx2VKhMG.js → reown-logo-dZ2nrrUw.js} +1 -1
  199. package/dist/assets/{search-CfhdFXHJ.js → search-Cie0_ZrT.js} +1 -1
  200. package/dist/assets/{secp256k1-DNHPf5Ba.js → secp256k1-CuNBwmlc.js} +1 -1
  201. package/dist/assets/{secp256k1-C-8oUEy-.js → secp256k1-DPZfmnNX.js} +1 -1
  202. package/dist/assets/{seedream-Zc-k4Yvi.js → seedream-BsXIgMM0.js} +1 -1
  203. package/dist/assets/{send-DN5m6era.js → send-CN0Ny1u-.js} +1 -1
  204. package/dist/assets/{service-Bn1fC4yq.js → service-QotgjH1Q.js} +1 -1
  205. package/dist/assets/{solana-wallets-EI9B8WXJ.js → solana-wallets-B333h0KT.js} +2 -2
  206. package/dist/assets/{solana-wallets-vue-eO8v1kqB.js → solana-wallets-vue-C4a6USBR.js} +1 -1
  207. package/dist/assets/{suno-Dhk4KXIg.js → suno-D_uJA7kM.js} +1 -1
  208. package/dist/assets/{swapHorizontal-Cc6pV_yS.js → swapHorizontal-D5cg03dU.js} +1 -1
  209. package/dist/assets/{swapHorizontalBold-BnaQNYKu.js → swapHorizontalBold-DMMhbg1i.js} +1 -1
  210. package/dist/assets/{swapHorizontalMedium-CK4kcs-_.js → swapHorizontalMedium-B5SXjkLW.js} +1 -1
  211. package/dist/assets/{swapHorizontalRoundedBold-DYX77gig.js → swapHorizontalRoundedBold-j25a_yec.js} +1 -1
  212. package/dist/assets/{swapVertical-BDIa7h1T.js → swapVertical-ezx6dfbo.js} +1 -1
  213. package/dist/assets/{telegram-Bn7hrs-a.js → telegram-4eorNWcv.js} +1 -1
  214. package/dist/assets/{three-dots-7icWxbfb.js → three-dots-BgKSlsl7.js} +1 -1
  215. package/dist/assets/{twitch-D5pbF91-.js → twitch-DhNDAbk-.js} +1 -1
  216. package/dist/assets/{twitterIcon-CeVlovVs.js → twitterIcon-g88ngSFl.js} +1 -1
  217. package/dist/assets/{typescript-l14jPBBW.js → typescript-HOmQr8QU.js} +1 -1
  218. package/dist/assets/{use-form-item-BqTljuiK.js → use-form-item-gFrK0FVf.js} +1 -1
  219. package/dist/assets/validator-CRted-PS.js +1 -0
  220. package/dist/assets/{verify-DQrw-hvX.js → verify-asNJmMUr.js} +1 -1
  221. package/dist/assets/{verify-filled-CrMCFj5U.js → verify-filled-CixdipQ-.js} +1 -1
  222. package/dist/assets/{w3m-modal-CeSyPPRq.js → w3m-modal-CSQfGzwH.js} +1 -1
  223. package/dist/assets/{wallet-CxCpdFk1.js → wallet-fK1xJY87.js} +1 -1
  224. package/dist/assets/{wallet-placeholder-DiYWqN5x.js → wallet-placeholder-1i2FHh7s.js} +1 -1
  225. package/dist/assets/{walletconnect-CsMbaNDm.js → walletconnect-Cgec-pke.js} +1 -1
  226. package/dist/assets/{warning-circle-CvRMvkdN.js → warning-circle-CCX7rdZ5.js} +1 -1
  227. package/dist/assets/{web-h_V_1xVy.js → web-DfC_D4jz.js} +1 -1
  228. package/dist/assets/{web-2GWI6Iup.js → web-VZ_Nh7ej.js} +1 -1
  229. package/dist/assets/{x-CiEXs15B.js → x-CKC1jczW.js} +1 -1
  230. package/dist/index.html +1 -1
  231. package/package.json +1 -1
  232. package/dist/assets/ApiCodeButton-Fb8Q8veZ.css +0 -1
  233. package/dist/assets/validator-BBWGl-WT.js +0 -1
@@ -1 +1 @@
1
- import{F as L}from"./index.es-BiVAkZvx.js";import{E as M}from"./index-5aVmsxeg.js";import{E as ce}from"./index-PXD6g-_z.js";import{d as b,H as m,E as i,z as N,C as n,y as f,D as o,q as l,F as r,x as C,O as V,N as T,Q as R,J as v,R as ve,I as w,M as be}from"./vendor-vue-NSDaktjZ.js";import{H as y,bm as K,ah as ye,I as we,cp as te,aG as oe,S as ne,cq as Ce}from"./index-orpPOzFA.js";import{a as Se,b as se,c as q,d as D,e as Ve,f as Ie,g as Te}from"./kling-DwJwIwVI.js";import{E as P,a as G}from"./index-C-1OqjJL.js";import{E as H}from"./index-lJMO2j3A.js";import{E as S}from"./index-Buwygoh0.js";import{I,S as Ee,l as Le}from"./pagination-ByFwVm7b.js";import{p as W}from"./pasteUploadMixin-BurWbGNQ.js";import{I as O}from"./ImagePreview-Cqg3CCWb.js";import{E as J}from"./index-BQXTC0Wr.js";import{E as j}from"./index-DLBPcYg6.js";import{C as de}from"./Consumption-A912L03A.js";import{E as me}from"./index-CV-Y1hCb.js";import{E as ue}from"./index-mnfZ250E.js";import{E as pe}from"./index-CieIazTO.js";import{P as Me,N as Re}from"./NoTasks-q3Lv6tKO.js";import{E as ge}from"./index-BYaJzDVD.js";import{a as fe}from"./price-ClrI7Hj_.js";import{F as Ue}from"./FilePreview-D48r5Clc.js";import{E as Ae,a as De}from"./index-CRY-KoZ0.js";import{E as Pe,a as Ge}from"./index-BQK6psTe.js";import{b as ie}from"./errorCode-Cqj9Td_Z.js";import{C as Ke}from"./CopyToClipboard-B14N8uGd.js";import{V as Oe}from"./VideoPlayer-JO6u-Leu.js";import{A as je}from"./ApiCodeButton-SH3-mzRZ.js";import{E as Be}from"./index-BULlJ3TF.js";import{E as Ne}from"./index-DGYkSNcS.js";import{B as ze}from"./BotPlaceholder-BkzQvjfL.js";import"./use-form-item-BqTljuiK.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Df5ITouH.js";import"./index-CNPDulRN.js";import"./typescript-l14jPBBW.js";import"./index-BsF7tVO8.js";import"./strings-beZM2Y-f.js";import"./isEqual-DrMqy2rp.js";import"./_Uint8Array-EI6rdDMg.js";import"./castArray-EsQaGbmV.js";import"./debounce-CH187K9a.js";import"./_baseIteratee-EE0Dhi3s.js";import"./index-BjQDU7Yx.js";import"./validator-BBWGl-WT.js";import"./highlight-BdzcL-qA.js";import"./index-BLjywj98.js";import"./vendor-highlight-lEWW1Jxd.js";import"./index-ChitGZ1D.js";import"./_baseClone-CWXDJGZm.js";import"./_initCloneObject-BLayr3wN.js";import"./index-Cu41y2Fl.js";import"./index-IYCZlPkQ.js";import"./isPlainObject-Dbl18ckc.js";import"./vue-plyr-BO2nlN4c.js";import"./index-B1BrvmAX.js";const Fe=b({name:"LayoutKling",components:{ElDrawer:ce,ElButton:M,FontAwesomeIcon:L},data(){return{drawer:!1}}}),qe={class:"main flex flex-row flex-1 min-h-0"},He={class:"config w-[320px] flex-none h-full flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},We={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function Je(e,t,s,a,u,$){const d=o("font-awesome-icon"),p=o("el-button"),g=o("el-drawer");return l(),m("div",qe,[i("div",He,[N(e.$slots,"config",{},void 0,!0)]),i("div",We,[N(e.$slots,"result",{},void 0,!0)]),n(p,{circle:"",class:"menu",onClick:t[0]||(t[0]=c=>e.drawer=!0)},{default:f(()=>[n(d,{icon:"fa-solid fa-magic"})]),_:1}),n(g,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=c=>e.drawer=c),direction:"ltr","with-header":!1,size:"350px"},{default:f(()=>[N(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Qe=y(Fe,[["render",Je],["__scopeId","data-v-be4bb0df"]]),Ye={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function Q(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 Ye}}function Y(e,t){if(!e)return[];const s=t.model??e.model,a=t.mode??e.mode,u=t.duration??e.duration;if(!s)return[];const $=Q(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 X(e,t){const s={...e};for(const a of t)a.field==="end_image_url"&&(s.end_image_url=void 0),a.field==="generate_audio"&&(s.generate_audio=!1),a.field==="camera_control"&&(s.camera_control=void 0);return s}const Xe=b({name:"ModelSelector",components:{ElSelect:G,ElOption:P},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{revertKey:0,options:[{value:"kling-v3",label:"v3"},{value:"kling-v3-omni",label:"v3-Omni"},{value:"kling-v2-6",label:"v2.6"},{value:"kling-v2-5-turbo",label:"v2.5-Turbo"},{value:"kling-v2-1-master",label:"v2.1-Master"},{value:"kling-v2-master",label:"v2-Master"},{value:"kling-v1-6",label:"v1.6"},{value:"kling-v1",label:"v1"},{value:"kling-video-o1",label:"Video-o1"}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(Se)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Y(t,{model:e});if(s.length===0){this.applyModel(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await H.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=X({...t,model:e},s);this.$store.commit("kling/setConfig",u),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})}}}),Ze={class:"field"},xe={class:"title font-bold"};function et(e,t,s,a,u,$){const d=o("el-option"),p=o("el-select");return l(),m("div",Ze,[i("h2",xe,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:f(()=>[(l(!0),m(V,null,T(e.options,g=>(l(),C(d,{key:g.value,label:g.label,value:g.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const tt=y(Xe,[["render",et],["__scopeId","data-v-04059875"]]),ot=b({name:"ModeSelector",components:{ElSelect:G,ElOption:P,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 q.includes(this.selectedModel)?this.cameraControlSet?this.$t("kling.description.mode4kIncompatibleCamera"):"":this.$t("kling.description.mode4kRequiresV3")},options(){return[{value:"std",label:this.$t("kling.name.modeStd"),disabled:!1,disabledReason:""},{value:"pro",label:this.$t("kling.name.modePro"),disabled:!1,disabledReason:""},{value:"4k",label:this.$t("kling.name.mode4k"),disabled:!!this.fourKReason,disabledReason:this.fourKReason}]},value(){return this.$store.state.kling?.config?.mode}},watch:{fourKReason(e){e&&this.value==="4k"&&this.applyMode(se)}},mounted(){this.value||this.applyMode(se)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Y(t,{mode:e});if(s.length===0){this.applyMode(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await H.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=X({...t,mode:e},s);this.$store.commit("kling/setConfig",u),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})}}}),nt={class:"field"},st={class:"header"},it={class:"title font-bold"},lt={key:0,class:"opt-tip"};function at(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-option"),g=o("el-select");return l(),m("div",nt,[i("div",st,[i("h2",it,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.mode"),class:"info-icon"},null,8,["content"])]),(l(),C(g,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("kling.placeholder.select"),clearable:!0,onChange:e.onChange},{default:f(()=>[(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:f(()=>[i("span",{class:R({"opt-disabled":c.disabled})},r(c.label),3),c.disabled&&c.disabledReason?(l(),m("span",lt,r(c.disabledReason),1)):v("",!0)]),_:2},1032,["label","value","disabled"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const rt=y(ot,[["render",at],["__scopeId","data-v-9a8fa3c5"]]),ct=[3,5,8,10,12,15],dt=[5,10],mt=b({name:"DurationSelector",components:{ElSelect:G,ElOption:P,InfoIcon:I},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},isV3Model(){return q.includes(this.selectedModel)},allowedDurations(){return this.isV3Model?ct:dt},value(){return this.$store.state.kling?.config?.duration??D},selectValue(){const e=this.allowedDurations;return e.includes(this.value)?this.value:e.includes(D)?D:e[0]}},watch:{isV3Model(){this.allowedDurations.includes(this.value)||this.applyDuration(D)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(D)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Y(t,{duration:e});if(s.length===0){this.applyDuration(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await H.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=X({...t,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})}}}),ut={class:"field"},pt={class:"control"},gt={class:"label"},ft={class:"title font-bold"};function ht(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-option"),g=o("el-select");return l(),m("div",ut,[i("div",pt,[i("div",gt,[i("h2",ft,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(g,{key:e.revertKey,"model-value":e.selectValue,class:"value",placeholder:e.$t("kling.placeholder.select"),onChange:e.onChange},{default:f(()=>[(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 _t=y(mt,[["render",ht],["__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)}}),kt={class:"text-sm font-bold mb-2 block"},vt={class:"items"},bt=["onClick"],yt={class:"name"};function wt(e,t,s,a,u,$){return l(),m("div",null,[i("span",kt,r(e.$t("kling.name.ratio")),1),i("div",vt,[(l(!0),m(V,null,T(e.options,(d,p)=>(l(),m("div",{key:p,class:R({active:e.active===p,item:!0}),onClick:g=>e.value=d.value},[i("div",{class:R(["preview",d.label])},[i("div",{class:"rect",style:ve({width:d.width+"px",height:d.height+"px"})},null,4)],2),i("p",yt,r(d.label),1)],10,bt))),128))])])}const Ct=y($t,[["render",wt],["__scopeId","data-v-cdb14b2f"]]),St=b({name:"StartImage",components:{ElUpload:j,ElButton:M,ElTooltip:J,InfoIcon:I,FontAwesomeIcon:L,ImagePreview:O},mixins:[W],emits:["change"],data(){return{fileList:[],uploadUrl:K()+"/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()}}}),Vt={class:"relative"},It={class:"flex justify-between"},Tt={class:"flex justify-start items-center"},Et={class:"text-sm font-bold"};function Lt(e,t,s,a,u,$){const d=o("info-icon"),p=o("image-preview"),g=o("font-awesome-icon"),c=o("el-button"),k=o("el-tooltip"),h=o("el-upload");return l(),m("div",Vt,[i("div",It,[i("div",Tt,[i("span",Et,r(e.$t("kling.name.startImage")),1),n(d,{content:e.$t("kling.description.uploadStartImage")},null,8,["content"])])]),n(h,{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:f(({file:_})=>[_.url&&_.percentage!==void 0?(l(),C(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:E=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:f(()=>[n(k,{content:e.$t("kling.message.uploadReferencesExceed"),disabled:!e.reachedLimit,placement:"top"},{default:f(()=>[i("span",null,[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.reachedLimit},{default:f(()=>[n(g,{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 Mt=y(St,[["render",Lt],["__scopeId","data-v-68cf38f5"]]),Rt=b({name:"EndImage",components:{ElUpload:j,ElButton:M,ElTooltip:J,ImagePreview:O,InfoIcon:I,FontAwesomeIcon:L},mixins:[W],data(){return{fileList:[],uploadUrl:K()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},klingConfig(){return this.$store.state?.kling?.config||{}},endImageSupported(){return Q(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},hasStartImage(){return!!this.klingConfig.start_image_url},uploadDisabled(){return this.reachedLimit||!this.endImageSupported||!this.hasStartImage},uploadTooltip(){return this.endImageSupported?this.hasStartImage?this.reachedLimit?this.$t("kling.message.uploadReferencesExceed"):"":this.$t("kling.message.endImageRequiresStart"):this.$t("kling.message.endImageNotSupported")},storeValue(){return this.klingConfig.end_image_url},value:{get(){return this.storeValue},set(){}}},watch:{storeValue(e){!e&&this.fileList.length>0&&(this.fileList=[])},hasStartImage(e){!e&&this.storeValue&&(this.fileList=[],this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,end_image_url:void 0}))}},mounted(){this.value||(this.value=void 0),this.onSetEndImageUrl()},methods:{onBeforeUpload(){return this.endImageSupported?this.hasStartImage?!0:(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()}}}),Ut={class:"relative"},At={class:"flex justify-between"},Dt={class:"flex justify-start items-center"},Pt={class:"text-sm font-bold"};function Gt(e,t,s,a,u,$){const d=o("info-icon"),p=o("image-preview"),g=o("font-awesome-icon"),c=o("el-button"),k=o("el-tooltip"),h=o("el-upload");return l(),m("div",Ut,[i("div",At,[i("div",Dt,[i("span",Pt,r(e.$t("kling.name.endImage")),1),n(d,{content:e.$t("kling.description.uploadEndImage")},null,8,["content"])])]),n(h,{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:f(({file:_})=>[_.url&&_.percentage!==void 0?(l(),C(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:E=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:f(()=>[n(k,{content:e.uploadTooltip,disabled:!e.uploadDisabled,placement:"top"},{default:f(()=>[i("span",null,[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.uploadDisabled},{default:f(()=>[n(g,{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 Kt=y(Rt,[["render",Gt],["__scopeId","data-v-593c3bde"]]),Ot=b({name:"CfgScaleSelector",components:{ElSlider:ue,InfoIcon:I,ElInputNumber:me},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)}}),jt={class:"flex justify-between"},Bt={class:"flex justify-start items-center"},Nt={class:"text-sm font-bold"},zt={class:"flex justify-end items-center"},Ft={class:"w-full"};function qt(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-input-number"),g=o("el-slider");return l(),m("div",null,[i("div",jt,[i("div",Bt,[i("span",Nt,r(e.$t("kling.name.cfgScale")),1),n(d,{content:e.$t("kling.description.cfgScale")},null,8,["content"])]),i("div",zt,[n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),"controls-position":"right"},null,8,["modelValue"])])]),i("div",Ft,[n(g,{modelValue:e.value,"onUpdate:modelValue":t[1]||(t[1]=c=>e.value=c),min:0,max:1,step:.1},null,8,["modelValue"])])])}const Ht=y(Ot,[["render",qt]]),Wt=b({name:"GenerateAudioSelector",components:{ElSwitch:pe,InfoIcon:I},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},selectedMode(){return this.$store.state.kling?.config?.mode||""},supported(){return!!(q.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})}}}),Jt={class:"relative"},Qt={class:"flex justify-between items-center"},Yt={class:"flex justify-start items-center"},Xt={class:"text-sm font-bold"};function Zt(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-switch");return l(),m("div",Jt,[i("div",Qt,[i("div",Yt,[i("span",Xt,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]=g=>e.value=g),class:"value",disabled:!e.supported},null,8,["modelValue","disabled"])])])}const xt=y(Wt,[["render",Zt]]),eo=["horizontal","vertical","pan","tilt","roll","zoom"],to=b({name:"CameraControlSelector",components:{ElSelect:G,ElOption:P,ElSlider:ue,ElInputNumber:me,InfoIcon:I},data(){return{configKeys:eo}},computed:{typeOptions(){return[{value:"",label:this.$t("kling.name.cameraTypeNone")},{value:"simple",label:this.$t("kling.name.cameraTypeSimple")},{value:"down_back",label:this.$t("kling.name.cameraTypeDownBack")},{value:"forward_up",label:this.$t("kling.name.cameraTypeForwardUp")},{value:"left_turn_forward",label:this.$t("kling.name.cameraTypeLeftTurnForward")},{value:"right_turn_forward",label:this.$t("kling.name.cameraTypeRightTurnForward")}]},selectedMode(){return this.$store.state.kling?.config?.mode||""},selectedModel(){return this.$store.state.kling?.config?.model||""},selectedDuration(){return this.$store.state.kling?.config?.duration},motionControlSupported(){return Q(this.selectedModel,this.selectedMode,this.selectedDuration).motionControl},hasStartImage(){return!!this.$store.state.kling?.config?.start_image_url},disabled(){return!this.motionControlSupported||this.hasStartImage},tooltipContent(){return this.motionControlSupported?this.hasStartImage?this.$t("kling.description.cameraControlDisabledImage2Video"):this.$t("kling.description.cameraControl"):this.$t("kling.description.cameraControlNotSupported")},selectedType(){return this.$store.state.kling?.config?.camera_control?.type},selectedTypeRaw:{get(){return this.selectedType??""},set(e){const t=this.$store.state.kling?.config||{};if(!e){const a={...t};delete a.camera_control,this.$store.commit("kling/setConfig",a);return}const s=e;this.$store.commit("kling/setConfig",{...t,camera_control:{type:s,config:s==="simple"?t.camera_control?.config||{}:void 0}})}},configValues(){return this.$store.state.kling?.config?.camera_control?.config||{}}},watch:{disabled(e){e&&this.selectedType!==void 0&&(this.selectedTypeRaw="")}},methods:{writeConfig(e,t){const s=this.$store.state.kling?.config||{},a=s.camera_control||{type:"simple"},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)}}}),oo={class:"field"},no={class:"header"},so={class:"text-sm font-bold"},io={key:0,class:"config-grid"},lo={class:"cfg-row-head"},ao={class:"cfg-name"};function ro(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-option"),g=o("el-select"),c=o("el-input-number"),k=o("el-slider");return l(),m("div",oo,[i("div",no,[i("span",so,r(e.$t("kling.name.cameraControl")),1),n(d,{content:e.tooltipContent},null,8,["content"])]),n(g,{modelValue:e.selectedTypeRaw,"onUpdate:modelValue":t[0]||(t[0]=h=>e.selectedTypeRaw=h),class:"value",placeholder:e.$t("kling.placeholder.cameraType"),clearable:!0,disabled:e.disabled},{default:f(()=>[(l(!0),m(V,null,T(e.typeOptions,h=>(l(),C(p,{key:h.value,label:h.label,value:h.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","disabled"]),e.selectedType==="simple"&&!e.disabled?(l(),m("div",io,[(l(!0),m(V,null,T(e.configKeys,h=>(l(),m("div",{key:h,class:"cfg-row"},[i("div",lo,[i("span",ao,r(e.$t(`kling.name.cc_${h}`)),1),n(c,{modelValue:e.configValues[h],"onUpdate:modelValue":_=>e.configValues[h]=_,min:-1,max:1,step:.1,precision:1,"controls-position":"right",size:"small",class:"cfg-num",onChange:_=>e.onNumberChange(h,_)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),n(k,{"model-value":e.configValues[h]??0,min:-1,max:1,step:.1,onInput:_=>e.onSliderChange(h,_)},null,8,["model-value","onInput"])]))),128))])):v("",!0)])}const co=y(to,[["render",ro],["__scopeId","data-v-cd896060"]]),he=[{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"]}],z=", ";function mo(e,t){const s=(e||"").trim();return s?s.includes(t)?s:`${s}${z}${t}`:t}function F(e,t){if(!e||!t)return e||"";const s=[`${t}${z}`,`${z}${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 uo=b({name:"InspirationPills",components:{FontAwesomeIcon:L},computed:{prompt(){return this.$store.state.kling?.config?.prompt||""},allChipTexts(){return he.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=F(this.prompt,e);this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:t})}}}),po={key:0,class:"pills",role:"list"},go={class:"pill-text"},fo=["aria-label","onClick"];function ho(e,t,s,a,u,$){const d=o("font-awesome-icon");return e.selected.length>0?(l(),m("div",po,[(l(!0),m(V,null,T(e.selected,p=>(l(),m("div",{key:p,class:"pill",role:"listitem"},[i("span",go,r(p),1),i("button",{type:"button",class:"pill-remove","aria-label":e.$t("kling.inspiration.removeChip"),onClick:be(g=>e.onRemove(p),["stop"])},[n(d,{icon:"fa-solid fa-xmark"})],8,fo)]))),128))])):v("",!0)}const _o=y(uo,[["render",ho],["__scopeId","data-v-5fc4fa65"]]),$o="",ko=b({name:"PromptInput",components:{ElButton:M,FontAwesomeIcon:L,PromptTextarea:Me,InspirationPills:_o},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 vo(e,t,s,a,u,$){const d=o("font-awesome-icon"),p=o("el-button"),g=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:f(()=>[n(p,{text:"",size:"small",class:"inspiration-btn",onClick:t[0]||(t[0]=k=>e.$emit("open-inspiration"))},{default:f(()=>[n(d,{icon:"fa-regular fa-lightbulb",class:"mr-1"}),w(" "+r(e.$t("kling.inspiration.openButton")),1)]),_:1})]),before:f(()=>[n(g)]),_:1},8,["modelValue","title","info","placeholder"])}const bo=y(ko,[["render",vo],["__scopeId","data-v-c01fc1a6"]]),yo="",wo=b({name:"NegativePromptInput",components:{ElInput:ge,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=yo)}}),Co={class:"field"},So={class:"box"},Vo={class:"title font-bold"};function Io(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-input");return l(),m("div",Co,[i("div",So,[i("h2",Vo,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]=g=>e.prompt=g),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.negativePrompt")},null,8,["modelValue","placeholder"])])}const To=y(wo,[["render",Io],["__scopeId","data-v-de98cf01"]]),Eo=b({name:"InspirationDrawer",components:{ElDrawer:ce,ElButton:M,FontAwesomeIcon:L},props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],data(){return{groups:he,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(F(this.prompt,e)):this.setPrompt(mo(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(const t of this.allChipTexts)for(;e.includes(t);)e=F(e,t);this.setPrompt(e)}}}),Lo={class:"drawer-content"},Mo={class:"drawer-header"},Ro={class:"title-row"},Uo={class:"title"},Ao={class:"hint"},Do={key:0,class:"selected-bar"},Po={class:"selected-text"},Go={class:"groups"},Ko={class:"group-title"},Oo={class:"chip-grid"},jo=["onClick"];function Bo(e,t,s,a,u,$){const d=o("font-awesome-icon"),p=o("el-button"),g=o("el-drawer");return l(),C(g,{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:f(()=>[i("div",Lo,[i("div",Mo,[i("div",Ro,[n(d,{icon:"fa-regular fa-lightbulb",class:"mr-2"}),i("span",Uo,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",Ao,r(e.$t("kling.inspiration.hint")),1),e.selectedCount>0?(l(),m("div",Do,[i("span",Po,r(e.$t("kling.inspiration.selectedSummary",{count:e.selectedCount})),1),n(p,{text:"",size:"small",class:"clear-btn",onClick:e.onClearSelected},{default:f(()=>[w(r(e.$t("kling.inspiration.clearSelected")),1)]),_:1},8,["onClick"])])):v("",!0),i("div",Go,[(l(!0),m(V,null,T(e.groups,c=>(l(),m("div",{key:c.groupKey,class:"group"},[i("div",Ko,r(e.$t(`kling.inspiration.group.${c.groupKey}`)),1),i("div",Oo,[(l(!0),m(V,null,T(c.chipKeys,k=>(l(),m("button",{key:k,type:"button",class:R({chip:!0,active:e.isSelected(e.chipText(k))}),onClick:h=>e.onToggle(e.chipText(k))},r(e.chipText(k)),11,jo))),128))])]))),128))])])]),_:1},8,["modelValue","size"])}const No=y(Eo,[["render",Bo],["__scopeId","data-v-7d457a69"]]),zo={"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"},Fo={std:"720p",pro:"1080p","4k":"4K"},qo=b({name:"SummaryChip",components:{FontAwesomeIcon:L},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){const e=this.config?.model||"kling-v2-5-turbo";return zo[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||""},modeLabel(){const e=this.config?.mode||"std";return Fo[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),Ho={class:"summary-chip"},Wo=["title"],Jo=["title"],Qo=["title"],Yo=["title"],Xo=["title"];function Zo(e,t,s,a,u,$){const d=o("font-awesome-icon");return l(),m("div",Ho,[i("span",{class:"part",title:e.$t("kling.name.model")},r(e.modelLabel),9,Wo),t[0]||(t[0]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.duration")},r(e.durationLabel),9,Jo),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,Qo),t[2]||(t[2]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.mode")},r(e.modeLabel),9,Yo),e.generateAudio?(l(),m("span",{key:0,class:"audio",title:e.$t("kling.name.generateAudio")},[n(d,{icon:"fa-solid fa-headphones"})],8,Xo)):v("",!0)])}const xo=y(qo,[["render",Zo],["__scopeId","data-v-418a6733"]]),en=b({name:"ConfigPanel",components:{ElButton:M,Consumption:de,FontAwesomeIcon:L,PromptInput:bo,NegativePromptInput:To,ModelSelector:tt,ModeSelector:rt,DurationSelector:_t,RatioSelector:Ct,StartImage:Mt,CfgScaleSelector:Ht,GenerateAudioSelector:xt,CameraControlSelector:co,InspirationDrawer:No,SummaryChip:xo,EndImage:Kt},emits:["generate"],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},consumption(){return fe(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit("generate")}}}),tn={class:"flex flex-col h-full"},on={class:"flex-1 overflow-y-auto p-5"},nn={class:"flex flex-col items-center justify-center px-5 pb-5"};function sn(e,t,s,a,u,$){const d=o("prompt-input"),p=o("model-selector"),g=o("ratio-selector"),c=o("start-image"),k=o("end-image"),h=o("duration-selector"),_=o("mode-selector"),E=o("generate-audio-selector"),U=o("camera-control-selector"),A=o("cfg-scale-selector"),B=o("negative-prompt-input"),_e=o("summary-chip"),$e=o("consumption"),Z=o("font-awesome-icon"),x=o("el-button"),ke=o("inspiration-drawer");return l(),m("div",tn,[i("div",on,[n(d,{class:"mb-4",onOpenInspiration:t[0]||(t[0]=ee=>e.inspirationOpen=!0)}),n(p,{class:"mb-4"}),n(g,{class:"mb-4"}),n(c,{class:"mb-2"}),n(k,{class:"mb-2"}),n(h,{class:"mb-4"}),n(_,{class:"mb-4"}),n(E,{class:"mb-4"}),n(U,{class:"mb-4"}),n(A,{class:"mb-4"}),n(B,{class:"mb-4"})]),i("div",nn,[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(x,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:f(()=>[n(Z,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.extend")),1)]),_:1},8,["onClick"])):(l(),C(x,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:f(()=>[n(Z,{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]=ee=>e.inspirationOpen=ee)},null,8,["modelValue"])])}const ln=y(en,[["render",sn]]),an=b({name:"MotionImage",components:{ElUpload:j,ElButton:M,InfoIcon:I,FontAwesomeIcon:L,ImagePreview:O},mixins:[W],data(){return{fileList:[],uploadUrl:K()+"/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()}}}),rn={class:"relative"},cn={class:"flex justify-between"},dn={class:"flex justify-start items-center"},mn={class:"text-sm font-bold"};function un(e,t,s,a,u,$){const d=o("info-icon"),p=o("image-preview"),g=o("font-awesome-icon"),c=o("el-button"),k=o("el-upload");return l(),m("div",rn,[i("div",cn,[i("div",dn,[i("span",mn,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]=h=>e.fileList=h),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:f(({file:h})=>[h.url&&h.percentage!==void 0?(l(),C(p,{key:0,url:h.url,name:h.name,percentage:h.percentage,onRemove:_=>e.onRemove(h)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:f(()=>[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:f(()=>[n(g,{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 pn=y(an,[["render",un],["__scopeId","data-v-37d42da7"]]),gn=b({name:"MotionVideo",components:{ElUpload:j,ElButton:M,InfoIcon:I,FilePreview:Ue,FontAwesomeIcon:L},data(){return{fileList:[],uploadUrl:K()+"/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()}}}),fn={class:"relative"},hn={class:"flex justify-between"},_n={class:"flex justify-start items-center"},$n={class:"text-sm font-bold"};function kn(e,t,s,a,u,$){const d=o("info-icon"),p=o("file-preview"),g=o("font-awesome-icon"),c=o("el-button"),k=o("el-upload");return l(),m("div",fn,[i("div",hn,[i("div",_n,[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]=h=>e.fileList=h),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:f(({file:h})=>[h.percentage!==void 0?(l(),C(p,{key:0,url:h.url||h.response?.file_url,name:h.name,percentage:h.percentage,onRemove:_=>e.onRemove(h)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:f(()=>[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:f(()=>[n(g,{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 vn=y(gn,[["render",kn],["__scopeId","data-v-5cf93212"]]),bn=b({name:"MotionPromptInput",components:{ElInput:ge,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})}}}}),yn={class:"field"},wn={class:"box"},Cn={class:"title font-bold"};function Sn(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-input");return l(),m("div",yn,[i("div",wn,[i("h2",Cn,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]=g=>e.prompt=g),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.motionPrompt")},null,8,["modelValue","placeholder"])])}const Vn=y(bn,[["render",Sn],["__scopeId","data-v-ca9fdbe5"]]),le="video",In=b({name:"CharacterOrientationSelector",components:{ElRadioGroup:De,ElRadioButton:Ae,InfoIcon:I},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||le},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,character_orientation:e})}}},mounted(){this.$store.state.kling?.motionConfig?.character_orientation||(this.value=le)}}),Tn={class:"field"},En={class:"header"},Ln={class:"text-sm font-bold"};function Mn(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-radio-button"),g=o("el-radio-group");return l(),m("div",Tn,[i("div",En,[i("span",Ln,r(e.$t("kling.name.characterOrientation")),1),n(d,{content:e.$t("kling.description.characterOrientation")},null,8,["content"])]),n(g,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),size:"small",class:"value"},{default:f(()=>[n(p,{label:"image"},{default:f(()=>[w(r(e.$t("kling.name.orientationImage")),1)]),_:1}),n(p,{label:"video"},{default:f(()=>[w(r(e.$t("kling.name.orientationVideo")),1)]),_:1})]),_:1},8,["modelValue"])])}const Rn=y(In,[["render",Mn],["__scopeId","data-v-7a91195b"]]),ae="std",Un=b({name:"MotionModeSelector",components:{ElSelect:G,ElOption:P,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||ae},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=ae)}}),An={class:"field"},Dn={class:"header"},Pn={class:"title font-bold"};function Gn(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-option"),g=o("el-select");return l(),m("div",An,[i("div",Dn,[i("h2",Pn,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.motionMode")},null,8,["content"])]),n(g,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),class:"value",placeholder:e.$t("kling.placeholder.select")},{default:f(()=>[(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 Kn=y(Un,[["render",Gn],["__scopeId","data-v-1295688c"]]),On=b({name:"KeepOriginalSoundSelector",components:{ElSwitch:pe,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"})}}}}),jn={class:"relative"},Bn={class:"flex justify-between items-center"},Nn={class:"flex justify-start items-center"},zn={class:"text-sm font-bold"};function Fn(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-switch");return l(),m("div",jn,[i("div",Bn,[i("div",Nn,[i("span",zn,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]=g=>e.value=g)},null,8,["modelValue"])])])}const qn=y(On,[["render",Fn]]),Hn=b({name:"MotionPanel",components:{ElButton:M,FontAwesomeIcon:L,Consumption:de,MotionImage:pn,MotionVideo:vn,MotionPromptInput:Vn,CharacterOrientationSelector:Rn,MotionModeSelector:Kn,KeepOriginalSoundSelector:qn},emits:["generate"],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return fe(this.motionConfig,this.service?.cost)},service(){return this.$store.state.kling?.service},canGenerate(){const e=this.motionConfig;return!!(e?.image_url&&e?.video_url)}},methods:{onGenerate(){this.$emit("generate")}}}),Wn={class:"flex flex-col h-full"},Jn={class:"flex-1 overflow-y-auto p-5"},Qn={class:"flex flex-col items-center justify-center px-5 pb-5"};function Yn(e,t,s,a,u,$){const d=o("motion-image"),p=o("motion-video"),g=o("motion-prompt-input"),c=o("character-orientation-selector"),k=o("motion-mode-selector"),h=o("keep-original-sound-selector"),_=o("consumption"),E=o("font-awesome-icon"),U=o("el-button");return l(),m("div",Wn,[i("div",Jn,[n(d,{class:"mb-3"}),n(p,{class:"mb-3"}),n(g,{class:"mb-4"}),n(c,{class:"mb-4"}),n(k,{class:"mb-4"}),n(h,{class:"mb-4"})]),i("div",Qn,[n(_,{value:e.consumption,service:e.service},null,8,["value","service"]),n(U,{type:"primary",class:"btn w-full",round:"",disabled:!e.canGenerate,onClick:e.onGenerate},{default:f(()=>[n(E,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.generateMotion")),1)]),_:1},8,["disabled","onClick"])])])}const Xn=y(Hn,[["render",Yn]]),Zn=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)}}}),xn=["title"],es={class:"text"};function ts(e,t,s,a,u,$){const d=o("el-tag"),p=o("el-tab-pane"),g=o("el-tabs");return l(),C(g,{"model-value":e.modelValue,class:"kling-tabs",stretch:"","onUpdate:modelValue":e.onUpdate},{default:f(()=>[(l(!0),m(V,null,T(e.tabs,c=>(l(),C(p,{key:c.value,name:c.value,disabled:c.disabled},{label:f(()=>[i("span",{class:"tab-label",title:c.disabled?c.disabledReason:void 0},[i("span",es,r(c.label),1),c.badge?(l(),C(d,{key:0,size:"small",type:"warning",class:"badge"},{default:f(()=>[w(r(c.badge),1)]),_:2},1024)):v("",!0)],8,xn)]),_:2},1032,["name","disabled"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])}const os=y(Zn,[["render",ts],["__scopeId","data-v-bf00c27e"]]),ns=b({name:"TaskPreview",components:{ElImage:Ne,CopyToClipboard:Ke,FontAwesomeIcon:L,ElAlert:Be,VideoPlayer:Oe,ElTooltip:J,ElButton:M,ImagePreview:O,ApiCodeButton:je},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")}}}),ss={class:"preview"},is={class:"left"},ls={class:"main"},as={class:"bot"},rs={class:"datetime"},cs={class:"info"},ds={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},ms={key:1,class:"prompt mt-2"},us={key:0},ps={key:1},gs={key:0,class:R({content:!0,failed:!0})},fs={key:0,class:"mb-4"},hs={key:1,class:R({operations:!0,"mt-2":!0})},_s={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},$s={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ks={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},vs={key:1,class:R({content:!0})},bs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ys={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ws={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Cs={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Ss={key:2,class:R({content:!0})},Vs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Is={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Ts(e,t,s,a,u,$){const d=o("el-image"),p=o("image-preview"),g=o("video-player"),c=o("el-button"),k=o("el-tooltip"),h=o("api-code-button"),_=o("font-awesome-icon"),E=o("copy-to-clipboard"),U=o("el-alert");return l(),m("div",ss,[i("div",is,[n(d,{src:"https://cdn.acedata.cloud/qpbbbb.jpg",class:"avatar"})]),i("div",ls,[i("div",as,[w(r(e.$t("kling.name.klingBot"))+" ",1),i("span",rs,r(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),i("div",cs,[e.referenceImages.length>0?(l(),m("div",ds,[(l(!0),m(V,null,T(e.referenceImages,(A,B)=>(l(),C(p,{key:B,url:A.url,name:A.name,closable:!1},null,8,["url","name"]))),128))])):v("",!0),e.modelValue?.request?.prompt?(l(),m("p",ms,[w(r(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?v("",!0):(l(),m("span",us," - ("+r(e.$t("kling.status.pending"))+") ",1)),e.modelValue?.response?.state==="submitted"||e.modelValue?.response?.state==="processing"||e.modelValue?.response?.state==="pending"||e.modelValue?.response?.state==="completed"?(l(),m("span",ps," - ("+r(e.$t("kling.status.processing"))+") ",1)):v("",!0)])):v("",!0)]),e.modelValue?.response?.success===!0?(l(),m("div",gs,[e.modelValue?.response.video_url?(l(),m("div",fs,[n(g,{src:e.modelValue?.response.video_url},null,8,["src"])])):v("",!0),e.modelValue?.response.success?(l(),m("div",hs,[n(k,{class:"box-item",effect:"dark",content:e.$t("kling.message.downloadVideo"),placement:"top-start"},{default:f(()=>[e.modelValue?.response.video_url?(l(),C(c,{key:0,type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=A=>e.onDownload(A,e.modelValue?.response.video_url))},{default:f(()=>[w(r(e.$t("kling.button.download")),1)]),_:1})):v("",!0)]),_:1},8,["content"]),n(h,{path:"/kling/videos",body:e.modelValue?.request},null,8,["body"])])):v("",!0),n(U,{closable:!1,class:"mt-2 success"},{default:f(()=>[i("p",_s,[n(_,{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(_,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(E,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(l(),m("p",ks,[n(_,{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",vs,[n(U,{closable:!1,class:"failure"},{template:f(()=>[n(_,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),w(" "+r(e.$t("kling.name.failure")),1)]),default:f(()=>[i("p",bs,[n(_,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(E,{content:e.modelValue?.id},null,8,["content"])]),i("p",ys,[n(_,{icon:"fa-solid fa-circle-info",class:"mr-1"}),w(" "+r(e.$t("kling.name.failureReason"))+": "+r(e.modelValue?.response?.error?.message)+" ",1),n(E,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(l(),m("p",ws,[n(_,{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",Cs,[n(_,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(E,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):v("",!0)]),_:1})])):v("",!0),e.modelValue?.response?.success===void 0?(l(),m("div",Ss,[n(U,{closable:!1,class:"info"},{template:f(()=>[n(_,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),w(" "+r(e.$t("kling.name.failure")),1)]),default:f(()=>[i("p",Vs,[n(_,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(E,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.response?.trace_id?(l(),m("p",Is,[n(_,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(E,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):v("",!0)]),_:1})])):v("",!0)])])}const Es=y(ns,[["render",Ts],["__scopeId","data-v-4e0e18c9"]]),Ls=b({name:"RecentPanel",components:{TaskPreview:Es,NoTasks:Re,BotPlaceholder:ze,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?.()}}}),Ms={key:0},Rs={key:2,class:"w-full h-full flex items-center justify-center"};function Us(e,t,s,a,u,$){const d=o("bot-placeholder"),p=o("task-preview"),g=o("scroll-list"),c=o("no-tasks");return l(),m(V,null,[e.tasks?.items===void 0?(l(),m("div",Ms,[n(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(l(),C(g,{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:f(()=>[(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",Rs,[n(c)])):v("",!0)],64)}const As=y(Ls,[["render",Us]]),re=Ce("kling"),Ds=b({name:"KlingIndex",components:{ConfigPanel:ln,MotionPanel:Xn,TabSwitcher:os,Layout:Qe,RecentPanel:As},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===ne.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===ne.Request||this.fetchingTasks},credential(){return this.$store.state.kling.credential},config(){return this.$store.state.kling.config},motionConfig(){return this.$store.state.kling.motionConfig},taskType(){return this.$store.state.kling.taskType||"videos"},tasks(){return this.$store.state.kling.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await Le({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("kling/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("kling/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:s,createdAtMax:a}=e||{};console.debug("limit",t,"createdAtMin",s,"createdAtMax",a),this.fetchingTasks=!0;try{await this.$store.dispatch("kling/getTasks",{limit:t,createdAtMin:s,createdAtMax:a})}finally{this.fetchingTasks=!1}},async onGenerate(){const{camera_control:e,...t}=this.config||{},s={...t,callback_url:re};if(!s.video_id&&!t.video_url&&!s.start_image_url&&s.end_image_url){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")),te("kling",oe.generate(s,{token:a})).then(()=>{S.success(this.$t("kling.message.startTaskSuccess"))}).catch(u=>{u?.response?.data?.error?.code===ie?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:re},s=this.credential?.token;if(!s){console.error("no token specified");return}S.info(this.$t("kling.message.startingTask")),te("kling",oe.motion(t,{token:s})).then(()=>{S.success(this.$t("kling.message.startTaskSuccess"))}).catch(a=>{a?.response?.data?.error?.code===ie?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)})}}}),Ps={class:"flex flex-col h-full"},Gs={class:"flex-1 min-h-0"};function Ks(e,t,s,a,u,$){const d=o("tab-switcher"),p=o("config-panel"),g=o("motion-panel"),c=o("recent-panel"),k=o("layout");return l(),C(k,null,{config:f(()=>[i("div",Ps,[n(d,{"model-value":e.taskType,"onUpdate:modelValue":e.onTabChange},null,8,["model-value","onUpdate:modelValue"]),i("div",Gs,[e.taskType==="videos"?(l(),C(p,{key:0,onGenerate:e.onGenerate},null,8,["onGenerate"])):e.taskType==="motion"?(l(),C(g,{key:1,onGenerate:e.onGenerateMotion},null,8,["onGenerate"])):v("",!0)])])]),result:f(()=>[n(c,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const zi=y(Ds,[["render",Ks]]);export{zi as default};
1
+ import{F as L}from"./index.es-BXrnqbDc.js";import{E as M}from"./index-ByRYubXn.js";import{E as ce}from"./index-PMRNSwyk.js";import{d as b,H as m,E as i,z as N,C as n,y as f,D as o,q as l,F as r,x as C,O as V,N as T,Q as R,J as v,R as ve,I as w,M as be}from"./vendor-vue-NSDaktjZ.js";import{H as y,bm as K,ah as ye,I as we,cp as te,aG as oe,S as ne,cq as Ce}from"./index-BRfbHCvZ.js";import{a as Se,b as se,c as q,d as D,e as Ve,f as Ie,g as Te}from"./kling-DwJwIwVI.js";import{E as P,a as G}from"./index-DfiGO-z3.js";import{E as H}from"./index-C8L4L2UR.js";import{E as S}from"./index-B8CSiOhn.js";import{I,S as Ee,l as Le}from"./pagination-BJFvnhlr.js";import{p as W}from"./pasteUploadMixin-BurWbGNQ.js";import{I as O}from"./ImagePreview-CYYwR4zK.js";import{E as J}from"./index-BZkaFFuw.js";import{E as j}from"./index-D63t9suS.js";import{C as de}from"./Consumption-BgQfeJho.js";import{E as me}from"./index-BM28BQge.js";import{E as ue}from"./index-9TnzSqSo.js";import{E as pe}from"./index-TeXIMvfD.js";import{P as Me,N as Re}from"./NoTasks-d_8CfjZ-.js";import{E as ge}from"./index-Cf4MWvor.js";import{a as fe}from"./price-Be1B_bvo.js";import{F as Ue}from"./FilePreview-C6KMFmBi.js";import{E as Ae,a as De}from"./index-BYrMMM1u.js";import{E as Pe,a as Ge}from"./index-r8zBJeUr.js";import{b as ie}from"./errorCode-Cqj9Td_Z.js";import{C as Ke}from"./CopyToClipboard-B3FBgh3x.js";import{V as Oe}from"./VideoPlayer-BwloPwzx.js";import{A as je}from"./ApiCodeButton-DdERRoj0.js";import{E as Be}from"./index-Bav7i68F.js";import{E as Ne}from"./index-CVuadntg.js";import{B as ze}from"./BotPlaceholder-CMs0qZF7.js";import"./use-form-item-gFrK0FVf.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Df5ITouH.js";import"./index-BtOQSaPZ.js";import"./typescript-HOmQr8QU.js";import"./index-CJozFb-_.js";import"./strings-beZM2Y-f.js";import"./isEqual-DdIQEpjm.js";import"./_Uint8Array-BHztG1Lf.js";import"./castArray-CEKtna1X.js";import"./debounce-BzdywqWi.js";import"./_baseIteratee-DawPdq6H.js";import"./index-LSBUkmpR.js";import"./validator-CRted-PS.js";import"./highlight-D6Rf8-7-.js";import"./index-BLjywj98.js";import"./vendor-highlight-lEWW1Jxd.js";import"./index-BnLROHuz.js";import"./_baseClone-DBPrtxYY.js";import"./_initCloneObject-RQtwP1G5.js";import"./index-Cu41y2Fl.js";import"./index-zJe4TTTN.js";import"./isPlainObject-CG3miWf6.js";import"./vue-plyr-BO2nlN4c.js";import"./index-BSKrtLfD.js";const Fe=b({name:"LayoutKling",components:{ElDrawer:ce,ElButton:M,FontAwesomeIcon:L},data(){return{drawer:!1}}}),qe={class:"main flex flex-row flex-1 min-h-0"},He={class:"config w-[320px] flex-none h-full flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},We={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function Je(e,t,s,a,u,$){const d=o("font-awesome-icon"),p=o("el-button"),g=o("el-drawer");return l(),m("div",qe,[i("div",He,[N(e.$slots,"config",{},void 0,!0)]),i("div",We,[N(e.$slots,"result",{},void 0,!0)]),n(p,{circle:"",class:"menu",onClick:t[0]||(t[0]=c=>e.drawer=!0)},{default:f(()=>[n(d,{icon:"fa-solid fa-magic"})]),_:1}),n(g,{modelValue:e.drawer,"onUpdate:modelValue":t[1]||(t[1]=c=>e.drawer=c),direction:"ltr","with-header":!1,size:"350px"},{default:f(()=>[N(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Qe=y(Fe,[["render",Je],["__scopeId","data-v-be4bb0df"]]),Ye={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1};function Q(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 Ye}}function Y(e,t){if(!e)return[];const s=t.model??e.model,a=t.mode??e.mode,u=t.duration??e.duration;if(!s)return[];const $=Q(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 X(e,t){const s={...e};for(const a of t)a.field==="end_image_url"&&(s.end_image_url=void 0),a.field==="generate_audio"&&(s.generate_audio=!1),a.field==="camera_control"&&(s.camera_control=void 0);return s}const Xe=b({name:"ModelSelector",components:{ElSelect:G,ElOption:P},props:{modelValue:{type:String,default:void 0}},emits:["update:modelValue"],data(){return{revertKey:0,options:[{value:"kling-v3",label:"v3"},{value:"kling-v3-omni",label:"v3-Omni"},{value:"kling-v2-6",label:"v2.6"},{value:"kling-v2-5-turbo",label:"v2.5-Turbo"},{value:"kling-v2-1-master",label:"v2.1-Master"},{value:"kling-v2-master",label:"v2-Master"},{value:"kling-v1-6",label:"v1.6"},{value:"kling-v1",label:"v1"},{value:"kling-video-o1",label:"Video-o1"}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(Se)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Y(t,{model:e});if(s.length===0){this.applyModel(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await H.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=X({...t,model:e},s);this.$store.commit("kling/setConfig",u),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})}}}),Ze={class:"field"},xe={class:"title font-bold"};function et(e,t,s,a,u,$){const d=o("el-option"),p=o("el-select");return l(),m("div",Ze,[i("h2",xe,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:f(()=>[(l(!0),m(V,null,T(e.options,g=>(l(),C(d,{key:g.value,label:g.label,value:g.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const tt=y(Xe,[["render",et],["__scopeId","data-v-04059875"]]),ot=b({name:"ModeSelector",components:{ElSelect:G,ElOption:P,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 q.includes(this.selectedModel)?this.cameraControlSet?this.$t("kling.description.mode4kIncompatibleCamera"):"":this.$t("kling.description.mode4kRequiresV3")},options(){return[{value:"std",label:this.$t("kling.name.modeStd"),disabled:!1,disabledReason:""},{value:"pro",label:this.$t("kling.name.modePro"),disabled:!1,disabledReason:""},{value:"4k",label:this.$t("kling.name.mode4k"),disabled:!!this.fourKReason,disabledReason:this.fourKReason}]},value(){return this.$store.state.kling?.config?.mode}},watch:{fourKReason(e){e&&this.value==="4k"&&this.applyMode(se)}},mounted(){this.value||this.applyMode(se)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Y(t,{mode:e});if(s.length===0){this.applyMode(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await H.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=X({...t,mode:e},s);this.$store.commit("kling/setConfig",u),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})}}}),nt={class:"field"},st={class:"header"},it={class:"title font-bold"},lt={key:0,class:"opt-tip"};function at(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-option"),g=o("el-select");return l(),m("div",nt,[i("div",st,[i("h2",it,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.mode"),class:"info-icon"},null,8,["content"])]),(l(),C(g,{key:e.revertKey,"model-value":e.value,class:"value",placeholder:e.$t("kling.placeholder.select"),clearable:!0,onChange:e.onChange},{default:f(()=>[(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:f(()=>[i("span",{class:R({"opt-disabled":c.disabled})},r(c.label),3),c.disabled&&c.disabledReason?(l(),m("span",lt,r(c.disabledReason),1)):v("",!0)]),_:2},1032,["label","value","disabled"]))),128))]),_:1},8,["model-value","placeholder","onChange"]))])}const rt=y(ot,[["render",at],["__scopeId","data-v-9a8fa3c5"]]),ct=[3,5,8,10,12,15],dt=[5,10],mt=b({name:"DurationSelector",components:{ElSelect:G,ElOption:P,InfoIcon:I},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},isV3Model(){return q.includes(this.selectedModel)},allowedDurations(){return this.isV3Model?ct:dt},value(){return this.$store.state.kling?.config?.duration??D},selectValue(){const e=this.allowedDurations;return e.includes(this.value)?this.value:e.includes(D)?D:e[0]}},watch:{isV3Model(){this.allowedDurations.includes(this.value)||this.applyDuration(D)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(D)},methods:{async onChange(e){const t=this.$store.state.kling?.config||{},s=Y(t,{duration:e});if(s.length===0){this.applyDuration(e);return}const a=s.map(u=>this.$t(u.i18nLabel)).join("、");try{await H.confirm(this.$t("kling.message.featureNotSupportedBody",{fields:a}),this.$t("kling.message.featureNotSupportedTitle"),{confirmButtonText:this.$t("kling.button.confirmContinue"),cancelButtonText:this.$t("kling.button.cancelSwitch"),type:"warning"});const u=X({...t,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})}}}),ut={class:"field"},pt={class:"control"},gt={class:"label"},ft={class:"title font-bold"};function ht(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-option"),g=o("el-select");return l(),m("div",ut,[i("div",pt,[i("div",gt,[i("h2",ft,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(g,{key:e.revertKey,"model-value":e.selectValue,class:"value",placeholder:e.$t("kling.placeholder.select"),onChange:e.onChange},{default:f(()=>[(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 _t=y(mt,[["render",ht],["__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)}}),kt={class:"text-sm font-bold mb-2 block"},vt={class:"items"},bt=["onClick"],yt={class:"name"};function wt(e,t,s,a,u,$){return l(),m("div",null,[i("span",kt,r(e.$t("kling.name.ratio")),1),i("div",vt,[(l(!0),m(V,null,T(e.options,(d,p)=>(l(),m("div",{key:p,class:R({active:e.active===p,item:!0}),onClick:g=>e.value=d.value},[i("div",{class:R(["preview",d.label])},[i("div",{class:"rect",style:ve({width:d.width+"px",height:d.height+"px"})},null,4)],2),i("p",yt,r(d.label),1)],10,bt))),128))])])}const Ct=y($t,[["render",wt],["__scopeId","data-v-cdb14b2f"]]),St=b({name:"StartImage",components:{ElUpload:j,ElButton:M,ElTooltip:J,InfoIcon:I,FontAwesomeIcon:L,ImagePreview:O},mixins:[W],emits:["change"],data(){return{fileList:[],uploadUrl:K()+"/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()}}}),Vt={class:"relative"},It={class:"flex justify-between"},Tt={class:"flex justify-start items-center"},Et={class:"text-sm font-bold"};function Lt(e,t,s,a,u,$){const d=o("info-icon"),p=o("image-preview"),g=o("font-awesome-icon"),c=o("el-button"),k=o("el-tooltip"),h=o("el-upload");return l(),m("div",Vt,[i("div",It,[i("div",Tt,[i("span",Et,r(e.$t("kling.name.startImage")),1),n(d,{content:e.$t("kling.description.uploadStartImage")},null,8,["content"])])]),n(h,{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:f(({file:_})=>[_.url&&_.percentage!==void 0?(l(),C(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:E=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:f(()=>[n(k,{content:e.$t("kling.message.uploadReferencesExceed"),disabled:!e.reachedLimit,placement:"top"},{default:f(()=>[i("span",null,[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.reachedLimit},{default:f(()=>[n(g,{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 Mt=y(St,[["render",Lt],["__scopeId","data-v-68cf38f5"]]),Rt=b({name:"EndImage",components:{ElUpload:j,ElButton:M,ElTooltip:J,ImagePreview:O,InfoIcon:I,FontAwesomeIcon:L},mixins:[W],data(){return{fileList:[],uploadUrl:K()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},klingConfig(){return this.$store.state?.kling?.config||{}},endImageSupported(){return Q(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},hasStartImage(){return!!this.klingConfig.start_image_url},uploadDisabled(){return this.reachedLimit||!this.endImageSupported||!this.hasStartImage},uploadTooltip(){return this.endImageSupported?this.hasStartImage?this.reachedLimit?this.$t("kling.message.uploadReferencesExceed"):"":this.$t("kling.message.endImageRequiresStart"):this.$t("kling.message.endImageNotSupported")},storeValue(){return this.klingConfig.end_image_url},value:{get(){return this.storeValue},set(){}}},watch:{storeValue(e){!e&&this.fileList.length>0&&(this.fileList=[])},hasStartImage(e){!e&&this.storeValue&&(this.fileList=[],this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,end_image_url:void 0}))}},mounted(){this.value||(this.value=void 0),this.onSetEndImageUrl()},methods:{onBeforeUpload(){return this.endImageSupported?this.hasStartImage?!0:(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()}}}),Ut={class:"relative"},At={class:"flex justify-between"},Dt={class:"flex justify-start items-center"},Pt={class:"text-sm font-bold"};function Gt(e,t,s,a,u,$){const d=o("info-icon"),p=o("image-preview"),g=o("font-awesome-icon"),c=o("el-button"),k=o("el-tooltip"),h=o("el-upload");return l(),m("div",Ut,[i("div",At,[i("div",Dt,[i("span",Pt,r(e.$t("kling.name.endImage")),1),n(d,{content:e.$t("kling.description.uploadEndImage")},null,8,["content"])])]),n(h,{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:f(({file:_})=>[_.url&&_.percentage!==void 0?(l(),C(p,{key:0,url:_.url,name:_.name,percentage:_.percentage,onRemove:E=>e.fileList.splice(e.fileList.indexOf(_),1)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:f(()=>[n(k,{content:e.uploadTooltip,disabled:!e.uploadDisabled,placement:"top"},{default:f(()=>[i("span",null,[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload",disabled:e.uploadDisabled},{default:f(()=>[n(g,{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 Kt=y(Rt,[["render",Gt],["__scopeId","data-v-593c3bde"]]),Ot=b({name:"CfgScaleSelector",components:{ElSlider:ue,InfoIcon:I,ElInputNumber:me},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)}}),jt={class:"flex justify-between"},Bt={class:"flex justify-start items-center"},Nt={class:"text-sm font-bold"},zt={class:"flex justify-end items-center"},Ft={class:"w-full"};function qt(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-input-number"),g=o("el-slider");return l(),m("div",null,[i("div",jt,[i("div",Bt,[i("span",Nt,r(e.$t("kling.name.cfgScale")),1),n(d,{content:e.$t("kling.description.cfgScale")},null,8,["content"])]),i("div",zt,[n(p,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),"controls-position":"right"},null,8,["modelValue"])])]),i("div",Ft,[n(g,{modelValue:e.value,"onUpdate:modelValue":t[1]||(t[1]=c=>e.value=c),min:0,max:1,step:.1},null,8,["modelValue"])])])}const Ht=y(Ot,[["render",qt]]),Wt=b({name:"GenerateAudioSelector",components:{ElSwitch:pe,InfoIcon:I},computed:{selectedModel(){return this.$store.state.kling?.config?.model||""},selectedMode(){return this.$store.state.kling?.config?.mode||""},supported(){return!!(q.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})}}}),Jt={class:"relative"},Qt={class:"flex justify-between items-center"},Yt={class:"flex justify-start items-center"},Xt={class:"text-sm font-bold"};function Zt(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-switch");return l(),m("div",Jt,[i("div",Qt,[i("div",Yt,[i("span",Xt,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]=g=>e.value=g),class:"value",disabled:!e.supported},null,8,["modelValue","disabled"])])])}const xt=y(Wt,[["render",Zt]]),eo=["horizontal","vertical","pan","tilt","roll","zoom"],to=b({name:"CameraControlSelector",components:{ElSelect:G,ElOption:P,ElSlider:ue,ElInputNumber:me,InfoIcon:I},data(){return{configKeys:eo}},computed:{typeOptions(){return[{value:"",label:this.$t("kling.name.cameraTypeNone")},{value:"simple",label:this.$t("kling.name.cameraTypeSimple")},{value:"down_back",label:this.$t("kling.name.cameraTypeDownBack")},{value:"forward_up",label:this.$t("kling.name.cameraTypeForwardUp")},{value:"left_turn_forward",label:this.$t("kling.name.cameraTypeLeftTurnForward")},{value:"right_turn_forward",label:this.$t("kling.name.cameraTypeRightTurnForward")}]},selectedMode(){return this.$store.state.kling?.config?.mode||""},selectedModel(){return this.$store.state.kling?.config?.model||""},selectedDuration(){return this.$store.state.kling?.config?.duration},motionControlSupported(){return Q(this.selectedModel,this.selectedMode,this.selectedDuration).motionControl},hasStartImage(){return!!this.$store.state.kling?.config?.start_image_url},disabled(){return!this.motionControlSupported||this.hasStartImage},tooltipContent(){return this.motionControlSupported?this.hasStartImage?this.$t("kling.description.cameraControlDisabledImage2Video"):this.$t("kling.description.cameraControl"):this.$t("kling.description.cameraControlNotSupported")},selectedType(){return this.$store.state.kling?.config?.camera_control?.type},selectedTypeRaw:{get(){return this.selectedType??""},set(e){const t=this.$store.state.kling?.config||{};if(!e){const a={...t};delete a.camera_control,this.$store.commit("kling/setConfig",a);return}const s=e;this.$store.commit("kling/setConfig",{...t,camera_control:{type:s,config:s==="simple"?t.camera_control?.config||{}:void 0}})}},configValues(){return this.$store.state.kling?.config?.camera_control?.config||{}}},watch:{disabled(e){e&&this.selectedType!==void 0&&(this.selectedTypeRaw="")}},methods:{writeConfig(e,t){const s=this.$store.state.kling?.config||{},a=s.camera_control||{type:"simple"},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)}}}),oo={class:"field"},no={class:"header"},so={class:"text-sm font-bold"},io={key:0,class:"config-grid"},lo={class:"cfg-row-head"},ao={class:"cfg-name"};function ro(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-option"),g=o("el-select"),c=o("el-input-number"),k=o("el-slider");return l(),m("div",oo,[i("div",no,[i("span",so,r(e.$t("kling.name.cameraControl")),1),n(d,{content:e.tooltipContent},null,8,["content"])]),n(g,{modelValue:e.selectedTypeRaw,"onUpdate:modelValue":t[0]||(t[0]=h=>e.selectedTypeRaw=h),class:"value",placeholder:e.$t("kling.placeholder.cameraType"),clearable:!0,disabled:e.disabled},{default:f(()=>[(l(!0),m(V,null,T(e.typeOptions,h=>(l(),C(p,{key:h.value,label:h.label,value:h.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","disabled"]),e.selectedType==="simple"&&!e.disabled?(l(),m("div",io,[(l(!0),m(V,null,T(e.configKeys,h=>(l(),m("div",{key:h,class:"cfg-row"},[i("div",lo,[i("span",ao,r(e.$t(`kling.name.cc_${h}`)),1),n(c,{modelValue:e.configValues[h],"onUpdate:modelValue":_=>e.configValues[h]=_,min:-1,max:1,step:.1,precision:1,"controls-position":"right",size:"small",class:"cfg-num",onChange:_=>e.onNumberChange(h,_)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),n(k,{"model-value":e.configValues[h]??0,min:-1,max:1,step:.1,onInput:_=>e.onSliderChange(h,_)},null,8,["model-value","onInput"])]))),128))])):v("",!0)])}const co=y(to,[["render",ro],["__scopeId","data-v-cd896060"]]),he=[{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"]}],z=", ";function mo(e,t){const s=(e||"").trim();return s?s.includes(t)?s:`${s}${z}${t}`:t}function F(e,t){if(!e||!t)return e||"";const s=[`${t}${z}`,`${z}${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 uo=b({name:"InspirationPills",components:{FontAwesomeIcon:L},computed:{prompt(){return this.$store.state.kling?.config?.prompt||""},allChipTexts(){return he.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=F(this.prompt,e);this.$store.commit("kling/setConfig",{...this.$store.state.kling?.config,prompt:t})}}}),po={key:0,class:"pills",role:"list"},go={class:"pill-text"},fo=["aria-label","onClick"];function ho(e,t,s,a,u,$){const d=o("font-awesome-icon");return e.selected.length>0?(l(),m("div",po,[(l(!0),m(V,null,T(e.selected,p=>(l(),m("div",{key:p,class:"pill",role:"listitem"},[i("span",go,r(p),1),i("button",{type:"button",class:"pill-remove","aria-label":e.$t("kling.inspiration.removeChip"),onClick:be(g=>e.onRemove(p),["stop"])},[n(d,{icon:"fa-solid fa-xmark"})],8,fo)]))),128))])):v("",!0)}const _o=y(uo,[["render",ho],["__scopeId","data-v-5fc4fa65"]]),$o="",ko=b({name:"PromptInput",components:{ElButton:M,FontAwesomeIcon:L,PromptTextarea:Me,InspirationPills:_o},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 vo(e,t,s,a,u,$){const d=o("font-awesome-icon"),p=o("el-button"),g=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:f(()=>[n(p,{text:"",size:"small",class:"inspiration-btn",onClick:t[0]||(t[0]=k=>e.$emit("open-inspiration"))},{default:f(()=>[n(d,{icon:"fa-regular fa-lightbulb",class:"mr-1"}),w(" "+r(e.$t("kling.inspiration.openButton")),1)]),_:1})]),before:f(()=>[n(g)]),_:1},8,["modelValue","title","info","placeholder"])}const bo=y(ko,[["render",vo],["__scopeId","data-v-c01fc1a6"]]),yo="",wo=b({name:"NegativePromptInput",components:{ElInput:ge,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=yo)}}),Co={class:"field"},So={class:"box"},Vo={class:"title font-bold"};function Io(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-input");return l(),m("div",Co,[i("div",So,[i("h2",Vo,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]=g=>e.prompt=g),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.negativePrompt")},null,8,["modelValue","placeholder"])])}const To=y(wo,[["render",Io],["__scopeId","data-v-de98cf01"]]),Eo=b({name:"InspirationDrawer",components:{ElDrawer:ce,ElButton:M,FontAwesomeIcon:L},props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],data(){return{groups:he,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(F(this.prompt,e)):this.setPrompt(mo(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(const t of this.allChipTexts)for(;e.includes(t);)e=F(e,t);this.setPrompt(e)}}}),Lo={class:"drawer-content"},Mo={class:"drawer-header"},Ro={class:"title-row"},Uo={class:"title"},Ao={class:"hint"},Do={key:0,class:"selected-bar"},Po={class:"selected-text"},Go={class:"groups"},Ko={class:"group-title"},Oo={class:"chip-grid"},jo=["onClick"];function Bo(e,t,s,a,u,$){const d=o("font-awesome-icon"),p=o("el-button"),g=o("el-drawer");return l(),C(g,{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:f(()=>[i("div",Lo,[i("div",Mo,[i("div",Ro,[n(d,{icon:"fa-regular fa-lightbulb",class:"mr-2"}),i("span",Uo,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",Ao,r(e.$t("kling.inspiration.hint")),1),e.selectedCount>0?(l(),m("div",Do,[i("span",Po,r(e.$t("kling.inspiration.selectedSummary",{count:e.selectedCount})),1),n(p,{text:"",size:"small",class:"clear-btn",onClick:e.onClearSelected},{default:f(()=>[w(r(e.$t("kling.inspiration.clearSelected")),1)]),_:1},8,["onClick"])])):v("",!0),i("div",Go,[(l(!0),m(V,null,T(e.groups,c=>(l(),m("div",{key:c.groupKey,class:"group"},[i("div",Ko,r(e.$t(`kling.inspiration.group.${c.groupKey}`)),1),i("div",Oo,[(l(!0),m(V,null,T(c.chipKeys,k=>(l(),m("button",{key:k,type:"button",class:R({chip:!0,active:e.isSelected(e.chipText(k))}),onClick:h=>e.onToggle(e.chipText(k))},r(e.chipText(k)),11,jo))),128))])]))),128))])])]),_:1},8,["modelValue","size"])}const No=y(Eo,[["render",Bo],["__scopeId","data-v-7d457a69"]]),zo={"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"},Fo={std:"720p",pro:"1080p","4k":"4K"},qo=b({name:"SummaryChip",components:{FontAwesomeIcon:L},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){const e=this.config?.model||"kling-v2-5-turbo";return zo[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||""},modeLabel(){const e=this.config?.mode||"std";return Fo[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),Ho={class:"summary-chip"},Wo=["title"],Jo=["title"],Qo=["title"],Yo=["title"],Xo=["title"];function Zo(e,t,s,a,u,$){const d=o("font-awesome-icon");return l(),m("div",Ho,[i("span",{class:"part",title:e.$t("kling.name.model")},r(e.modelLabel),9,Wo),t[0]||(t[0]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.duration")},r(e.durationLabel),9,Jo),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,Qo),t[2]||(t[2]=i("span",{class:"dot"},"·",-1)),i("span",{class:"part",title:e.$t("kling.name.mode")},r(e.modeLabel),9,Yo),e.generateAudio?(l(),m("span",{key:0,class:"audio",title:e.$t("kling.name.generateAudio")},[n(d,{icon:"fa-solid fa-headphones"})],8,Xo)):v("",!0)])}const xo=y(qo,[["render",Zo],["__scopeId","data-v-418a6733"]]),en=b({name:"ConfigPanel",components:{ElButton:M,Consumption:de,FontAwesomeIcon:L,PromptInput:bo,NegativePromptInput:To,ModelSelector:tt,ModeSelector:rt,DurationSelector:_t,RatioSelector:Ct,StartImage:Mt,CfgScaleSelector:Ht,GenerateAudioSelector:xt,CameraControlSelector:co,InspirationDrawer:No,SummaryChip:xo,EndImage:Kt},emits:["generate"],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},consumption(){return fe(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit("generate")}}}),tn={class:"flex flex-col h-full"},on={class:"flex-1 overflow-y-auto p-5"},nn={class:"flex flex-col items-center justify-center px-5 pb-5"};function sn(e,t,s,a,u,$){const d=o("prompt-input"),p=o("model-selector"),g=o("ratio-selector"),c=o("start-image"),k=o("end-image"),h=o("duration-selector"),_=o("mode-selector"),E=o("generate-audio-selector"),U=o("camera-control-selector"),A=o("cfg-scale-selector"),B=o("negative-prompt-input"),_e=o("summary-chip"),$e=o("consumption"),Z=o("font-awesome-icon"),x=o("el-button"),ke=o("inspiration-drawer");return l(),m("div",tn,[i("div",on,[n(d,{class:"mb-4",onOpenInspiration:t[0]||(t[0]=ee=>e.inspirationOpen=!0)}),n(p,{class:"mb-4"}),n(g,{class:"mb-4"}),n(c,{class:"mb-2"}),n(k,{class:"mb-2"}),n(h,{class:"mb-4"}),n(_,{class:"mb-4"}),n(E,{class:"mb-4"}),n(U,{class:"mb-4"}),n(A,{class:"mb-4"}),n(B,{class:"mb-4"})]),i("div",nn,[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(x,{key:0,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:f(()=>[n(Z,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.extend")),1)]),_:1},8,["onClick"])):(l(),C(x,{key:1,type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:f(()=>[n(Z,{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]=ee=>e.inspirationOpen=ee)},null,8,["modelValue"])])}const ln=y(en,[["render",sn]]),an=b({name:"MotionImage",components:{ElUpload:j,ElButton:M,InfoIcon:I,FontAwesomeIcon:L,ImagePreview:O},mixins:[W],data(){return{fileList:[],uploadUrl:K()+"/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()}}}),rn={class:"relative"},cn={class:"flex justify-between"},dn={class:"flex justify-start items-center"},mn={class:"text-sm font-bold"};function un(e,t,s,a,u,$){const d=o("info-icon"),p=o("image-preview"),g=o("font-awesome-icon"),c=o("el-button"),k=o("el-upload");return l(),m("div",rn,[i("div",cn,[i("div",dn,[i("span",mn,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]=h=>e.fileList=h),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:f(({file:h})=>[h.url&&h.percentage!==void 0?(l(),C(p,{key:0,url:h.url,name:h.name,percentage:h.percentage,onRemove:_=>e.onRemove(h)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:f(()=>[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:f(()=>[n(g,{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 pn=y(an,[["render",un],["__scopeId","data-v-37d42da7"]]),gn=b({name:"MotionVideo",components:{ElUpload:j,ElButton:M,InfoIcon:I,FilePreview:Ue,FontAwesomeIcon:L},data(){return{fileList:[],uploadUrl:K()+"/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()}}}),fn={class:"relative"},hn={class:"flex justify-between"},_n={class:"flex justify-start items-center"},$n={class:"text-sm font-bold"};function kn(e,t,s,a,u,$){const d=o("info-icon"),p=o("file-preview"),g=o("font-awesome-icon"),c=o("el-button"),k=o("el-upload");return l(),m("div",fn,[i("div",hn,[i("div",_n,[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]=h=>e.fileList=h),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:f(({file:h})=>[h.percentage!==void 0?(l(),C(p,{key:0,url:h.url||h.response?.file_url,name:h.name,percentage:h.percentage,onRemove:_=>e.onRemove(h)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:f(()=>[n(c,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:f(()=>[n(g,{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 vn=y(gn,[["render",kn],["__scopeId","data-v-5cf93212"]]),bn=b({name:"MotionPromptInput",components:{ElInput:ge,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})}}}}),yn={class:"field"},wn={class:"box"},Cn={class:"title font-bold"};function Sn(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-input");return l(),m("div",yn,[i("div",wn,[i("h2",Cn,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]=g=>e.prompt=g),rows:3,type:"textarea",class:"prompt",placeholder:e.$t("kling.placeholder.motionPrompt")},null,8,["modelValue","placeholder"])])}const Vn=y(bn,[["render",Sn],["__scopeId","data-v-ca9fdbe5"]]),le="video",In=b({name:"CharacterOrientationSelector",components:{ElRadioGroup:De,ElRadioButton:Ae,InfoIcon:I},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||le},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,character_orientation:e})}}},mounted(){this.$store.state.kling?.motionConfig?.character_orientation||(this.value=le)}}),Tn={class:"field"},En={class:"header"},Ln={class:"text-sm font-bold"};function Mn(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-radio-button"),g=o("el-radio-group");return l(),m("div",Tn,[i("div",En,[i("span",Ln,r(e.$t("kling.name.characterOrientation")),1),n(d,{content:e.$t("kling.description.characterOrientation")},null,8,["content"])]),n(g,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),size:"small",class:"value"},{default:f(()=>[n(p,{label:"image"},{default:f(()=>[w(r(e.$t("kling.name.orientationImage")),1)]),_:1}),n(p,{label:"video"},{default:f(()=>[w(r(e.$t("kling.name.orientationVideo")),1)]),_:1})]),_:1},8,["modelValue"])])}const Rn=y(In,[["render",Mn],["__scopeId","data-v-7a91195b"]]),ae="std",Un=b({name:"MotionModeSelector",components:{ElSelect:G,ElOption:P,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||ae},set(e){this.$store.commit("kling/setMotionConfig",{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=ae)}}),An={class:"field"},Dn={class:"header"},Pn={class:"title font-bold"};function Gn(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-option"),g=o("el-select");return l(),m("div",An,[i("div",Dn,[i("h2",Pn,r(e.$t("kling.name.mode")),1),n(d,{content:e.$t("kling.description.motionMode")},null,8,["content"])]),n(g,{modelValue:e.value,"onUpdate:modelValue":t[0]||(t[0]=c=>e.value=c),class:"value",placeholder:e.$t("kling.placeholder.select")},{default:f(()=>[(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 Kn=y(Un,[["render",Gn],["__scopeId","data-v-1295688c"]]),On=b({name:"KeepOriginalSoundSelector",components:{ElSwitch:pe,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"})}}}}),jn={class:"relative"},Bn={class:"flex justify-between items-center"},Nn={class:"flex justify-start items-center"},zn={class:"text-sm font-bold"};function Fn(e,t,s,a,u,$){const d=o("info-icon"),p=o("el-switch");return l(),m("div",jn,[i("div",Bn,[i("div",Nn,[i("span",zn,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]=g=>e.value=g)},null,8,["modelValue"])])])}const qn=y(On,[["render",Fn]]),Hn=b({name:"MotionPanel",components:{ElButton:M,FontAwesomeIcon:L,Consumption:de,MotionImage:pn,MotionVideo:vn,MotionPromptInput:Vn,CharacterOrientationSelector:Rn,MotionModeSelector:Kn,KeepOriginalSoundSelector:qn},emits:["generate"],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return fe(this.motionConfig,this.service?.cost)},service(){return this.$store.state.kling?.service},canGenerate(){const e=this.motionConfig;return!!(e?.image_url&&e?.video_url)}},methods:{onGenerate(){this.$emit("generate")}}}),Wn={class:"flex flex-col h-full"},Jn={class:"flex-1 overflow-y-auto p-5"},Qn={class:"flex flex-col items-center justify-center px-5 pb-5"};function Yn(e,t,s,a,u,$){const d=o("motion-image"),p=o("motion-video"),g=o("motion-prompt-input"),c=o("character-orientation-selector"),k=o("motion-mode-selector"),h=o("keep-original-sound-selector"),_=o("consumption"),E=o("font-awesome-icon"),U=o("el-button");return l(),m("div",Wn,[i("div",Jn,[n(d,{class:"mb-3"}),n(p,{class:"mb-3"}),n(g,{class:"mb-4"}),n(c,{class:"mb-4"}),n(k,{class:"mb-4"}),n(h,{class:"mb-4"})]),i("div",Qn,[n(_,{value:e.consumption,service:e.service},null,8,["value","service"]),n(U,{type:"primary",class:"btn w-full",round:"",disabled:!e.canGenerate,onClick:e.onGenerate},{default:f(()=>[n(E,{icon:"fa-solid fa-magic",class:"mr-2"}),w(" "+r(e.$t("kling.button.generateMotion")),1)]),_:1},8,["disabled","onClick"])])])}const Xn=y(Hn,[["render",Yn]]),Zn=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)}}}),xn=["title"],es={class:"text"};function ts(e,t,s,a,u,$){const d=o("el-tag"),p=o("el-tab-pane"),g=o("el-tabs");return l(),C(g,{"model-value":e.modelValue,class:"kling-tabs",stretch:"","onUpdate:modelValue":e.onUpdate},{default:f(()=>[(l(!0),m(V,null,T(e.tabs,c=>(l(),C(p,{key:c.value,name:c.value,disabled:c.disabled},{label:f(()=>[i("span",{class:"tab-label",title:c.disabled?c.disabledReason:void 0},[i("span",es,r(c.label),1),c.badge?(l(),C(d,{key:0,size:"small",type:"warning",class:"badge"},{default:f(()=>[w(r(c.badge),1)]),_:2},1024)):v("",!0)],8,xn)]),_:2},1032,["name","disabled"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])}const os=y(Zn,[["render",ts],["__scopeId","data-v-bf00c27e"]]),ns=b({name:"TaskPreview",components:{ElImage:Ne,CopyToClipboard:Ke,FontAwesomeIcon:L,ElAlert:Be,VideoPlayer:Oe,ElTooltip:J,ElButton:M,ImagePreview:O,ApiCodeButton:je},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")}}}),ss={class:"preview"},is={class:"left"},ls={class:"main"},as={class:"bot"},rs={class:"datetime"},cs={class:"info"},ds={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},ms={key:1,class:"prompt mt-2"},us={key:0},ps={key:1},gs={key:0,class:R({content:!0,failed:!0})},fs={key:0,class:"mb-4"},hs={key:1,class:R({operations:!0,"mt-2":!0})},_s={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},$s={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ks={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},vs={key:1,class:R({content:!0})},bs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ys={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ws={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Cs={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},Ss={key:2,class:R({content:!0})},Vs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},Is={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Ts(e,t,s,a,u,$){const d=o("el-image"),p=o("image-preview"),g=o("video-player"),c=o("el-button"),k=o("el-tooltip"),h=o("api-code-button"),_=o("font-awesome-icon"),E=o("copy-to-clipboard"),U=o("el-alert");return l(),m("div",ss,[i("div",is,[n(d,{src:"https://cdn.acedata.cloud/qpbbbb.jpg",class:"avatar"})]),i("div",ls,[i("div",as,[w(r(e.$t("kling.name.klingBot"))+" ",1),i("span",rs,r(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),i("div",cs,[e.referenceImages.length>0?(l(),m("div",ds,[(l(!0),m(V,null,T(e.referenceImages,(A,B)=>(l(),C(p,{key:B,url:A.url,name:A.name,closable:!1},null,8,["url","name"]))),128))])):v("",!0),e.modelValue?.request?.prompt?(l(),m("p",ms,[w(r(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?v("",!0):(l(),m("span",us," - ("+r(e.$t("kling.status.pending"))+") ",1)),e.modelValue?.response?.state==="submitted"||e.modelValue?.response?.state==="processing"||e.modelValue?.response?.state==="pending"||e.modelValue?.response?.state==="completed"?(l(),m("span",ps," - ("+r(e.$t("kling.status.processing"))+") ",1)):v("",!0)])):v("",!0)]),e.modelValue?.response?.success===!0?(l(),m("div",gs,[e.modelValue?.response.video_url?(l(),m("div",fs,[n(g,{src:e.modelValue?.response.video_url},null,8,["src"])])):v("",!0),e.modelValue?.response.success?(l(),m("div",hs,[n(k,{class:"box-item",effect:"dark",content:e.$t("kling.message.downloadVideo"),placement:"top-start"},{default:f(()=>[e.modelValue?.response.video_url?(l(),C(c,{key:0,type:"info",size:"small",class:"btn-action",onClick:t[0]||(t[0]=A=>e.onDownload(A,e.modelValue?.response.video_url))},{default:f(()=>[w(r(e.$t("kling.button.download")),1)]),_:1})):v("",!0)]),_:1},8,["content"]),n(h,{path:"/kling/videos",body:e.modelValue?.request},null,8,["body"])])):v("",!0),n(U,{closable:!1,class:"mt-2 success"},{default:f(()=>[i("p",_s,[n(_,{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(_,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(E,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.elapsed?(l(),m("p",ks,[n(_,{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",vs,[n(U,{closable:!1,class:"failure"},{template:f(()=>[n(_,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),w(" "+r(e.$t("kling.name.failure")),1)]),default:f(()=>[i("p",bs,[n(_,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(E,{content:e.modelValue?.id},null,8,["content"])]),i("p",ys,[n(_,{icon:"fa-solid fa-circle-info",class:"mr-1"}),w(" "+r(e.$t("kling.name.failureReason"))+": "+r(e.modelValue?.response?.error?.message)+" ",1),n(E,{content:e.modelValue?.response?.error?.message},null,8,["content"])]),e.modelValue?.elapsed?(l(),m("p",ws,[n(_,{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",Cs,[n(_,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(E,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):v("",!0)]),_:1})])):v("",!0),e.modelValue?.response?.success===void 0?(l(),m("div",Ss,[n(U,{closable:!1,class:"info"},{template:f(()=>[n(_,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),w(" "+r(e.$t("kling.name.failure")),1)]),default:f(()=>[i("p",Vs,[n(_,{icon:"fa-solid fa-magic",class:"mr-1"}),w(" "+r(e.$t("kling.name.taskId"))+": "+r(e.modelValue?.id)+" ",1),n(E,{content:e.modelValue?.id},null,8,["content"])]),e.modelValue?.response?.trace_id?(l(),m("p",Is,[n(_,{icon:"fa-solid fa-hashtag",class:"mr-1"}),w(" "+r(e.$t("kling.name.traceId"))+": "+r(e.modelValue?.response?.trace_id)+" ",1),n(E,{content:e.modelValue?.response?.trace_id},null,8,["content"])])):v("",!0)]),_:1})])):v("",!0)])])}const Es=y(ns,[["render",Ts],["__scopeId","data-v-4e0e18c9"]]),Ls=b({name:"RecentPanel",components:{TaskPreview:Es,NoTasks:Re,BotPlaceholder:ze,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?.()}}}),Ms={key:0},Rs={key:2,class:"w-full h-full flex items-center justify-center"};function Us(e,t,s,a,u,$){const d=o("bot-placeholder"),p=o("task-preview"),g=o("scroll-list"),c=o("no-tasks");return l(),m(V,null,[e.tasks?.items===void 0?(l(),m("div",Ms,[n(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(l(),C(g,{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:f(()=>[(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",Rs,[n(c)])):v("",!0)],64)}const As=y(Ls,[["render",Us]]),re=Ce("kling"),Ds=b({name:"KlingIndex",components:{ConfigPanel:ln,MotionPanel:Xn,TabSwitcher:os,Layout:Qe,RecentPanel:As},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===ne.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===ne.Request||this.fetchingTasks},credential(){return this.$store.state.kling.credential},config(){return this.$store.state.kling.config},motionConfig(){return this.$store.state.kling.motionConfig},taskType(){return this.$store.state.kling.taskType||"videos"},tasks(){return this.$store.state.kling.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug("new tasks detected")},deep:!0},initialized:{async handler(e){e&&(console.debug("layout initialized"),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await Le({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug("start onGetService"),await this.$store.dispatch("kling/getService"),console.debug("end onGetService")},async onGetApplication(){console.debug("start onGetApplication"),await this.$store.dispatch("kling/getApplications"),console.debug("end onGetApplication"),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug("loading");return}console.debug("start onGetTasks",e);const{limit:t=5,createdAtMin:s,createdAtMax:a}=e||{};console.debug("limit",t,"createdAtMin",s,"createdAtMax",a),this.fetchingTasks=!0;try{await this.$store.dispatch("kling/getTasks",{limit:t,createdAtMin:s,createdAtMax:a})}finally{this.fetchingTasks=!1}},async onGenerate(){const{camera_control:e,...t}=this.config||{},s={...t,callback_url:re};if(!s.video_id&&!t.video_url&&!s.start_image_url&&s.end_image_url){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")),te("kling",oe.generate(s,{token:a})).then(()=>{S.success(this.$t("kling.message.startTaskSuccess"))}).catch(u=>{u?.response?.data?.error?.code===ie?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:re},s=this.credential?.token;if(!s){console.error("no token specified");return}S.info(this.$t("kling.message.startingTask")),te("kling",oe.motion(t,{token:s})).then(()=>{S.success(this.$t("kling.message.startTaskSuccess"))}).catch(a=>{a?.response?.data?.error?.code===ie?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)})}}}),Ps={class:"flex flex-col h-full"},Gs={class:"flex-1 min-h-0"};function Ks(e,t,s,a,u,$){const d=o("tab-switcher"),p=o("config-panel"),g=o("motion-panel"),c=o("recent-panel"),k=o("layout");return l(),C(k,null,{config:f(()=>[i("div",Ps,[n(d,{"model-value":e.taskType,"onUpdate:modelValue":e.onTabChange},null,8,["model-value","onUpdate:modelValue"]),i("div",Gs,[e.taskType==="videos"?(l(),C(p,{key:0,onGenerate:e.onGenerate},null,8,["onGenerate"])):e.taskType==="motion"?(l(),C(g,{key:1,onGenerate:e.onGenerateMotion},null,8,["onGenerate"])):v("",!0)])])]),result:f(()=>[n(c,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const zi=y(Ds,[["render",Ks]]);export{zi as default};
@@ -1 +1 @@
1
- import{F as I}from"./index.es-BiVAkZvx.js";import{E as A}from"./index-5aVmsxeg.js";import{E as Q}from"./index-PXD6g-_z.js";import{d as E,H as l,E as c,z as O,C as t,y as _,D as s,q as o,x as y,F as n,O as V,N as C,J as v,I as h,M as X,Q as F}from"./vendor-vue-NSDaktjZ.js";import{H as k,d7 as Y,d8 as G,d9 as B,da as q,db as Z,dc as x,dd as ee,de as te,df as se,dg as oe,bm as z,dh as ne,di as ae,dj as le,dk as re,dl as ie,cp as ce,b0 as de,S as j,cq as me}from"./index-orpPOzFA.js";import{P as ue,N as pe}from"./NoTasks-q3Lv6tKO.js";import{I as S,S as fe,l as _e}from"./pagination-ByFwVm7b.js";import{E as P,a as N}from"./index-C-1OqjJL.js";import{E as H}from"./index-CieIazTO.js";import{p as W}from"./pasteUploadMixin-BurWbGNQ.js";import{I as M}from"./ImagePreview-Cqg3CCWb.js";import{E as J}from"./index-DLBPcYg6.js";import{E as w}from"./index-Buwygoh0.js";import{C as he}from"./Consumption-A912L03A.js";import{a as ve}from"./price-ClrI7Hj_.js";import{C as $e}from"./CopyToClipboard-B14N8uGd.js";import{V as ge}from"./VideoPlayer-JO6u-Leu.js";import{I as be}from"./ImageWrapper-BoVGmV3c.js";import{A as Ee}from"./ApiCodeButton-SH3-mzRZ.js";import{E as ke}from"./index-BQXTC0Wr.js";import{E as ye}from"./index-BULlJ3TF.js";import{E as we}from"./index-DGYkSNcS.js";import{B as Se}from"./BotPlaceholder-BkzQvjfL.js";import{b as Ve}from"./errorCode-Cqj9Td_Z.js";import"./use-form-item-BqTljuiK.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Df5ITouH.js";import"./index-BYaJzDVD.js";import"./typescript-l14jPBBW.js";import"./index-BsF7tVO8.js";import"./index-IYCZlPkQ.js";import"./highlight-BdzcL-qA.js";import"./index-BLjywj98.js";import"./vendor-highlight-lEWW1Jxd.js";import"./index-CNPDulRN.js";import"./strings-beZM2Y-f.js";import"./isEqual-DrMqy2rp.js";import"./_Uint8Array-EI6rdDMg.js";import"./castArray-EsQaGbmV.js";import"./debounce-CH187K9a.js";import"./_baseIteratee-EE0Dhi3s.js";import"./index-BjQDU7Yx.js";import"./validator-BBWGl-WT.js";import"./index-ChitGZ1D.js";import"./_baseClone-CWXDJGZm.js";import"./_initCloneObject-BLayr3wN.js";import"./vue-plyr-BO2nlN4c.js";import"./index-B1BrvmAX.js";const Le=E({name:"LayoutSeedance",components:{ElDrawer:Q,ElButton:A,FontAwesomeIcon:I},data(){return{drawer:!1}}}),Te={class:"main flex flex-row flex-1"},Ie={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},Ae={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function Ce(e,a,m,f,u,g){const d=s("font-awesome-icon"),p=s("el-button"),r=s("el-drawer");return o(),l("div",Te,[c("div",Ie,[O(e.$slots,"config",{},void 0,!0)]),c("div",Ae,[O(e.$slots,"result",{},void 0,!0)]),t(p,{circle:"",class:"menu",onClick:a[0]||(a[0]=i=>e.drawer=!0)},{default:_(()=>[t(d,{icon:"fa-solid fa-magic"})]),_:1}),t(r,{modelValue:e.drawer,"onUpdate:modelValue":a[1]||(a[1]=i=>e.drawer=i),direction:"ltr","with-header":!1,size:"350px"},{default:_(()=>[O(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Fe=k(Le,[["render",Ce],["__scopeId","data-v-caafd095"]]),De="",Re=E({name:"SeedancePromptInput",components:{PromptTextarea:ue},computed:{prompt:{get(){return this.$store.state.seedance?.config?.prompt},set(e){this.$store.commit("seedance/setConfig",{...this.$store.state.seedance?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=De)}});function Ue(e,a,m,f,u,g){const d=s("prompt-textarea");return o(),y(d,{modelValue:e.prompt,"onUpdate:modelValue":a[0]||(a[0]=p=>e.prompt=p),title:e.$t("seedance.name.prompt"),info:e.$t("seedance.description.prompt"),placeholder:e.$t("seedance.placeholder.prompt"),"min-rows":5},null,8,["modelValue","title","info","placeholder"])}const Oe=k(Re,[["render",Ue]]),Pe=E({name:"SeedanceModelSelector",components:{ElSelect:N,ElOption:P,InfoIcon:S},data(){return{options:[{value:G,label:this.$t("seedance.model.seedance20")},{value:B,label:this.$t("seedance.model.seedance20Fast")},{value:q,label:this.$t("seedance.model.seedance15pro")},{value:Z,label:this.$t("seedance.model.seedance10pro")},{value:x,label:this.$t("seedance.model.seedance10proFast")},{value:ee,label:this.$t("seedance.model.seedance10liteT2v")},{value:te,label:this.$t("seedance.model.seedance10liteI2v")}]}},computed:{value:{get(){return this.$store.state.seedance?.config?.model},set(e){this.$store.commit("seedance/setConfig",{...this.$store.state.seedance?.config,model:e})}}},mounted(){this.value||(this.value=Y)}}),Ne={class:"field"},Me={class:"label"},je={class:"box"},Ge={class:"title font-bold"};function Be(e,a,m,f,u,g){const d=s("info-icon"),p=s("el-option"),r=s("el-select");return o(),l("div",Ne,[c("div",Me,[c("div",je,[c("h2",Ge,n(e.$t("seedance.name.model")),1),t(d,{content:e.$t("seedance.description.model"),class:"info"},null,8,["content"])])]),t(r,{modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=i=>e.value=i),class:"value",placeholder:e.$t("seedance.placeholder.select")},{default:_(()=>[(o(!0),l(V,null,C(e.options,i=>(o(),y(p,{key:i.value,label:i.label,value:i.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const qe=k(Pe,[["render",Be],["__scopeId","data-v-61816a81"]]),ze=E({name:"SeedanceDurationSelector",components:{ElSelect:N,ElOption:P,InfoIcon:S},data(){return{options:[{value:2,label:"2s"},{value:3,label:"3s"},{value:4,label:"4s"},{value:5,label:"5s"},{value:6,label:"6s"},{value:7,label:"7s"},{value:8,label:"8s"},{value:9,label:"9s"},{value:10,label:"10s"},{value:11,label:"11s"},{value:12,label:"12s"}]}},computed:{value:{get(){return this.$store.state.seedance?.config?.duration},set(e){this.$store.commit("seedance/setConfig",{...this.$store.state.seedance?.config,duration:e})}}},mounted(){this.value||(this.value=se)}}),He={class:"field"},We={class:"label"},Je={class:"box"},Ke={class:"title font-bold"};function Qe(e,a,m,f,u,g){const d=s("info-icon"),p=s("el-option"),r=s("el-select");return o(),l("div",He,[c("div",We,[c("div",Je,[c("h2",Ke,n(e.$t("seedance.name.duration")),1),t(d,{content:e.$t("seedance.description.duration"),class:"info"},null,8,["content"])])]),t(r,{modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=i=>e.value=i),class:"value",placeholder:e.$t("seedance.placeholder.select")},{default:_(()=>[(o(!0),l(V,null,C(e.options,i=>(o(),y(p,{key:i.value,label:i.label,value:i.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Xe=k(ze,[["render",Qe],["__scopeId","data-v-5c809a72"]]),Ye=new Set([q,G,B]),Ze=E({name:"SeedanceGenerateAudioSwitch",components:{ElSwitch:H,InfoIcon:S},computed:{isSupported(){const e=this.$store.state.seedance?.config?.model;return typeof e=="string"&&Ye.has(e)},value:{get(){return this.$store.state.seedance?.config?.generate_audio??!1},set(e){this.$store.commit("seedance/setConfig",{...this.$store.state.seedance?.config,generate_audio:e})}}},watch:{isSupported(e){!e&&this.value&&(this.value=!1)}},mounted(){this.value===void 0&&(this.value=oe)}}),xe={key:0,class:"field"},et={class:"label"},tt={class:"box"},st={class:"title font-bold"},ot={class:"value"};function nt(e,a,m,f,u,g){const d=s("info-icon"),p=s("el-switch");return e.isSupported?(o(),l("div",xe,[c("div",et,[c("div",tt,[c("h2",st,n(e.$t("seedance.name.generateAudio")),1),t(d,{content:e.$t("seedance.description.generateAudio"),class:"info"},null,8,["content"])])]),c("div",ot,[t(p,{modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=r=>e.value=r),"inline-prompt":"","active-text":e.$t("seedance.button.on"),"inactive-text":e.$t("seedance.button.off")},null,8,["modelValue","active-text","inactive-text"])])])):v("",!0)}const at=k(Ze,[["render",nt],["__scopeId","data-v-004d19ff"]]),lt=E({name:"SeedanceFirstFrameImage",components:{ElUpload:J,ElButton:A,InfoIcon:S,FontAwesomeIcon:I,ImagePreview:M},mixins:[W],data(){return{fileList:[],uploadUrl:z()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},methods:{onExceed(){w.warning(this.$t("seedance.message.uploadExceed"))},onError(){w.error(this.$t("seedance.message.uploadError"))},onSetFirstFrameUrl(){const e=this.urls?.[0],m=(this.$store.state.seedance?.config?.images||[]).filter(f=>f?.role!=="first_frame");e&&m.push({url:e,role:"first_frame"}),this.$store.commit("seedance/setConfig",{...this.$store.state.seedance?.config,images:m.length>0?m:void 0})},async onSuccess(){this.onSetFirstFrameUrl()},async onRemove(){this.onSetFirstFrameUrl()}}}),rt={class:"relative"},it={class:"flex justify-between"},ct={class:"flex justify-start items-center"},dt={class:"text-sm font-bold"};function mt(e,a,m,f,u,g){const d=s("info-icon"),p=s("image-preview"),r=s("font-awesome-icon"),i=s("el-button"),b=s("el-upload");return o(),l("div",rt,[c("div",it,[c("div",ct,[c("span",dt,n(e.$t("seedance.name.firstFrame")),1),t(d,{content:e.$t("seedance.description.firstFrame")},null,8,["content"])])]),t(b,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":a[0]||(a[0]=$=>e.fileList=$),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,"on-remove":e.onRemove,headers:e.headers},{file:_(({file:$})=>[$.url&&$.percentage!==void 0?(o(),y(p,{key:0,url:$.url,name:$.name,percentage:$.percentage,onRemove:L=>e.fileList.splice(e.fileList.indexOf($),1)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:_(()=>[t(i,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:_(()=>[t(r,{icon:"fa-solid fa-upload",class:"icon mr-1"}),h(" "+n(e.$t("seedance.button.upload")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","on-remove","headers"])])}const ut=k(lt,[["render",mt],["__scopeId","data-v-5294baf8"]]),pt=E({name:"SeedanceLastFrameImage",components:{ElUpload:J,ElButton:A,ImagePreview:M,InfoIcon:S,FontAwesomeIcon:I},mixins:[W],data(){return{fileList:[],uploadUrl:z()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},methods:{onExceed(){w.warning(this.$t("seedance.message.uploadExceed"))},onError(){w.error(this.$t("seedance.message.uploadError"))},onSetLastFrameUrl(){const e=this.urls?.[0],m=(this.$store.state.seedance?.config?.images||[]).filter(f=>f?.role!=="last_frame");e&&m.push({url:e,role:"last_frame"}),this.$store.commit("seedance/setConfig",{...this.$store.state.seedance?.config,images:m.length>0?m:void 0})},async onSuccess(){this.onSetLastFrameUrl()},async onRemove(){this.onSetLastFrameUrl()}}}),ft={class:"relative"},_t={class:"flex justify-between"},ht={class:"flex justify-start items-center"},vt={class:"text-sm font-bold"};function $t(e,a,m,f,u,g){const d=s("info-icon"),p=s("image-preview"),r=s("font-awesome-icon"),i=s("el-button"),b=s("el-upload");return o(),l("div",ft,[c("div",_t,[c("div",ht,[c("span",vt,n(e.$t("seedance.name.lastFrame")),1),t(d,{content:e.$t("seedance.description.lastFrame")},null,8,["content"])])]),t(b,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":a[0]||(a[0]=$=>e.fileList=$),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,"on-remove":e.onRemove,headers:e.headers},{file:_(({file:$})=>[$.url&&$.percentage!==void 0?(o(),y(p,{key:0,url:$.url,name:$.name,percentage:$.percentage,onRemove:L=>e.fileList.splice(e.fileList.indexOf($),1)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:_(()=>[t(i,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:_(()=>[t(r,{icon:"fa-solid fa-upload",class:"icon mr-1"}),h(" "+n(e.$t("seedance.button.upload")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","on-remove","headers"])])}const gt=k(pt,[["render",$t],["__scopeId","data-v-f423739f"]]),bt=E({name:"SeedanceServiceTierSelector",components:{ElSelect:N,ElOption:P,InfoIcon:S},data(){return{options:[{value:ae,label:this.$t("seedance.serviceTier.default")},{value:le,label:this.$t("seedance.serviceTier.flex")}]}},computed:{value:{get(){return this.$store.state.seedance?.config?.service_tier},set(e){this.$store.commit("seedance/setConfig",{...this.$store.state.seedance?.config,service_tier:e})}}},mounted(){this.value||(this.value=ne)}}),Et={class:"field"},kt={class:"label"},yt={class:"box"},wt={class:"title font-bold"};function St(e,a,m,f,u,g){const d=s("info-icon"),p=s("el-option"),r=s("el-select");return o(),l("div",Et,[c("div",kt,[c("div",yt,[c("h2",wt,n(e.$t("seedance.name.serviceTier")),1),t(d,{content:e.$t("seedance.description.serviceTier"),class:"info"},null,8,["content"])])]),t(r,{modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=i=>e.value=i),class:"value",placeholder:e.$t("seedance.placeholder.select")},{default:_(()=>[(o(!0),l(V,null,C(e.options,i=>(o(),y(p,{key:i.value,label:i.label,value:i.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Vt=k(bt,[["render",St],["__scopeId","data-v-cc938de2"]]),Lt=E({name:"SeedanceReturnLastFrameSwitch",components:{ElSwitch:H,InfoIcon:S},computed:{value:{get(){return this.$store.state.seedance?.config?.return_last_frame},set(e){this.$store.commit("seedance/setConfig",{...this.$store.state.seedance?.config,return_last_frame:e})}}},mounted(){this.value===void 0&&(this.value=re)}}),Tt={class:"field"},It={class:"label"},At={class:"box"},Ct={class:"title font-bold"},Ft={class:"value"};function Dt(e,a,m,f,u,g){const d=s("info-icon"),p=s("el-switch");return o(),l("div",Tt,[c("div",It,[c("div",At,[c("h2",Ct,n(e.$t("seedance.name.returnLastFrame")),1),t(d,{content:e.$t("seedance.description.returnLastFrame"),class:"info"},null,8,["content"])])]),c("div",Ft,[t(p,{modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=r=>e.value=r),"inline-prompt":"","active-text":e.$t("seedance.button.on"),"inactive-text":e.$t("seedance.button.off")},null,8,["modelValue","active-text","inactive-text"])])])}const Rt=k(Lt,[["render",Dt],["__scopeId","data-v-cd179b1c"]]),Ut=E({name:"SeedanceConfigPanel",components:{ElButton:A,FontAwesomeIcon:I,PromptInput:Oe,ModelSelector:qe,DurationSelector:Xe,GenerateAudioSwitch:at,ServiceTierSelector:Vt,ReturnLastFrameSwitch:Rt,FirstFrameImage:ut,LastFrameImage:gt,Consumption:he},emits:["generate"],computed:{config(){return this.$store.state.seedance?.config},consumption(){return ve(this.config,this.service?.cost)},service(){return this.$store.state.seedance?.service}},methods:{onGenerate(){this.$emit("generate")}}}),Ot={class:"flex flex-col h-full"},Pt={class:"flex-1 overflow-y-auto p-5"},Nt={class:"flex flex-col items-center justify-center px-5 pb-5"};function Mt(e,a,m,f,u,g){const d=s("prompt-input"),p=s("model-selector"),r=s("duration-selector"),i=s("generate-audio-switch"),b=s("service-tier-selector"),$=s("return-last-frame-switch"),L=s("first-frame-image"),D=s("last-frame-image"),R=s("consumption"),U=s("font-awesome-icon"),T=s("el-button");return o(),l("div",Ot,[c("div",Pt,[t(d,{class:"mb-4"}),t(p,{class:"mb-4"}),t(r,{class:"mb-4"}),t(i,{class:"mb-4"}),t(b,{class:"mb-4"}),t($,{class:"mb-4"}),t(L,{class:"mb-2"}),t(D,{class:"mb-2"})]),c("div",Nt,[t(R,{value:e.consumption,service:e.service},null,8,["value","service"]),t(T,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:_(()=>[t(U,{icon:"fa-solid fa-magic",class:"mr-2"}),h(" "+n(e.$t("seedance.button.generate")),1)]),_:1},8,["onClick"])])])}const jt=k(Ut,[["render",Mt]]),Gt=E({name:"SeedanceTaskPreview",components:{ElImage:we,CopyToClipboard:$e,FontAwesomeIcon:I,ElAlert:ye,VideoPlayer:ge,ElTooltip:ke,ElButton:A,ImageWrapper:be,ImagePreview:M,ApiCodeButton:Ee},props:{modelValue:{type:Object,required:!0}},data(){return{seedanceLogo:ie}},computed:{video(){return this.modelValue?.response?.data},referenceImages(){const e=this.modelValue?.request?.images;if(!Array.isArray(e))return[];const a=[],m=e.find(u=>u?.role==="first_frame");m?.url&&a.push({url:m.url,name:"first-frame"});const f=e.find(u=>u?.role==="last_frame");return f?.url&&a.push({url:f.url,name:"last-frame"}),e.forEach((u,g)=>{u?.url&&u.role!=="first_frame"&&u.role!=="last_frame"&&a.push({url:u.url,name:u.role||`image-${g}`})}),a}},methods:{onDownload(e){window.open(e,"_blank")}}}),Bt={class:"preview"},qt={class:"left"},zt={class:"main"},Ht={class:"bot"},Wt={class:"datetime"},Jt={class:"info"},Kt={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},Qt={key:1,class:"prompt mt-2"},Xt={key:0},Yt={key:1},Zt={key:0,class:F({content:!0})},xt={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},es={key:1,class:F({content:!0})},ts={key:0,class:"mb-4"},ss={key:1,class:"mb-4"},os={key:2,class:F({operations:!0,"mt-2":!0,"mb-2":!0})},ns={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},as={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ls={key:2,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},rs={key:0},is={key:1},cs={key:3,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ds={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ms={key:4,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},us={key:5,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},ps={key:2,class:F({content:!0})},fs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},_s={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},hs={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},vs={key:2,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},$s={key:3,class:F({content:!0})},gs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},bs={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Es(e,a,m,f,u,g){const d=s("el-image"),p=s("image-preview"),r=s("font-awesome-icon"),i=s("copy-to-clipboard"),b=s("el-alert"),$=s("video-player"),L=s("image-wrapper"),D=s("el-button"),R=s("el-tooltip"),U=s("api-code-button");return o(),l("div",Bt,[c("div",qt,[t(d,{src:e.seedanceLogo,class:"avatar"},null,8,["src"])]),c("div",zt,[c("div",Ht,[h(n(e.$t("seedance.name.seedanceBot"))+" ",1),c("span",Wt,n(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),c("div",Jt,[e.referenceImages.length>0?(o(),l("div",Kt,[(o(!0),l(V,null,C(e.referenceImages,(T,K)=>(o(),y(p,{key:K,url:T.url,name:T.name,closable:!1},null,8,["url","name"]))),128))])):v("",!0),e.modelValue?.request?.prompt?(o(),l("p",Qt,[h(n(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?e.video?.status==="processing"||e.video?.status==="pending"?(o(),l("span",Yt," - ("+n(e.$t("seedance.status.processing"))+") ",1)):v("",!0):(o(),l("span",Xt," - ("+n(e.$t("seedance.status.pending"))+") ",1))])):v("",!0)]),e.modelValue?.response?e.modelValue?.response?.success===!0?(o(),l("div",es,[e.video?.video_url?(o(),l("div",ts,[t($,{src:e.video?.video_url},null,8,["src"])])):v("",!0),e.video?.last_frame_url?(o(),l("div",ss,[t(L,{src:e.video?.last_frame_url,"raw-src":e.video?.last_frame_url},null,8,["src","raw-src"])])):v("",!0),e.video?.video_url?(o(),l("div",os,[t(R,{class:"box-item",effect:"dark",content:e.$t("seedance.message.downloadVideo"),placement:"top-start"},{default:_(()=>[t(D,{type:"info",size:"small",class:"btn-action",onClick:a[0]||(a[0]=X(T=>e.onDownload(e.video?.video_url),["stop"]))},{default:_(()=>[h(n(e.$t("seedance.button.download")),1)]),_:1})]),_:1},8,["content"]),t(U,{path:"/seedance/videos",body:e.modelValue?.request},null,8,["body"])])):v("",!0),t(b,{closable:!1,class:"mt-2 success"},{default:_(()=>[e.modelValue?.request?.model?(o(),l("p",ns,[t(r,{icon:"fa-solid fa-cube",class:"mr-1"}),h(" "+n(e.$t("seedance.name.model"))+": "+n(e.modelValue?.request?.model),1)])):v("",!0),e.video?.duration?(o(),l("p",as,[t(r,{icon:"fa-solid fa-clock",class:"mr-1"}),h(" "+n(e.$t("seedance.name.duration"))+": "+n(e.video?.duration)+"s ",1)])):v("",!0),e.video?.resolution?(o(),l("p",ls,[t(r,{icon:"fa-solid fa-expand",class:"mr-1"}),h(" "+n(e.$t("seedance.name.resolution"))+": "+n(e.video?.resolution)+" ",1),e.video?.ratio?(o(),l("span",rs," · "+n(e.video?.ratio),1)):v("",!0),e.video?.framespersecond?(o(),l("span",is," · "+n(e.video?.framespersecond)+"fps",1)):v("",!0)])):v("",!0),e.modelValue?.request?.generate_audio?(o(),l("p",cs,[t(r,{icon:"fa-solid fa-volume-up",class:"mr-1"}),h(" "+n(e.$t("seedance.name.generateAudio"))+": "+n(e.$t("seedance.button.on")),1)])):v("",!0),c("p",ds,[t(r,{icon:"fa-solid fa-magic",class:"mr-1"}),h(" "+n(e.$t("seedance.name.taskId"))+": "+n(e.modelValue?.id)+" ",1),t(i,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])]),e.modelValue?.elapsed?(o(),l("p",ms,[t(r,{icon:"fa-solid fa-clock",class:"mr-1"}),h(" "+n(e.$t("seedance.name.elapsed"))+": "+n(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):v("",!0),e.modelValue?.response?.trace_id?(o(),l("p",us,[t(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),h(" "+n(e.$t("seedance.name.traceId"))+": "+n(e.modelValue?.response?.trace_id)+" ",1),t(i,{content:e.modelValue?.response?.trace_id,class:"btn-copy inline-block"},null,8,["content"])])):v("",!0)]),_:1})])):e.modelValue?.response?.success===!1?(o(),l("div",ps,[t(b,{closable:!1,class:"failure"},{template:_(()=>[t(r,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),h(" "+n(e.$t("seedance.name.failure")),1)]),default:_(()=>[c("p",fs,[t(r,{icon:"fa-solid fa-magic",class:"mr-1"}),h(" "+n(e.$t("seedance.name.taskId"))+": "+n(e.modelValue?.id)+" ",1),t(i,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])]),e.modelValue?.response?.error?.message?(o(),l("p",_s,[t(r,{icon:"fa-solid fa-circle-info",class:"mr-1"}),h(" "+n(e.$t("seedance.name.failureReason"))+": "+n(e.modelValue?.response?.error?.message)+" ",1),t(i,{content:e.modelValue?.response?.error?.message,class:"btn-copy inline-block"},null,8,["content"])])):v("",!0),e.modelValue?.elapsed?(o(),l("p",hs,[t(r,{icon:"fa-solid fa-clock",class:"mr-1"}),h(" "+n(e.$t("seedance.name.elapsed"))+": "+n(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):v("",!0),e.modelValue?.response?.trace_id?(o(),l("p",vs,[t(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),h(" "+n(e.$t("seedance.name.traceId"))+": "+n(e.modelValue?.response?.trace_id)+" ",1),t(i,{content:e.modelValue?.response?.trace_id,class:"btn-copy inline-block"},null,8,["content"])])):v("",!0)]),_:1})])):(o(),l("div",$s,[t(b,{closable:!1,class:"info"},{template:_(()=>[t(r,{icon:"fa-solid fa-circle-info",class:"mr-1"}),h(" "+n(e.$t("seedance.name.status")),1)]),default:_(()=>[c("p",gs,[t(r,{icon:"fa-solid fa-magic",class:"mr-1"}),h(" "+n(e.$t("seedance.name.taskId"))+": "+n(e.modelValue?.id)+" ",1),t(i,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])]),e.modelValue?.response?.trace_id?(o(),l("p",bs,[t(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),h(" "+n(e.$t("seedance.name.traceId"))+": "+n(e.modelValue?.response?.trace_id)+" ",1),t(i,{content:e.modelValue?.response?.trace_id,class:"btn-copy inline-block"},null,8,["content"])])):v("",!0)]),_:1})])):(o(),l("div",Zt,[t(b,{closable:!1,class:"info"},{template:_(()=>[t(r,{icon:"fa-regular fa-clock",class:"mr-1"}),h(" "+n(e.$t("seedance.status.pending")),1)]),default:_(()=>[c("p",xt,[t(r,{icon:"fa-solid fa-magic",class:"mr-1"}),h(" "+n(e.$t("seedance.name.taskId"))+": "+n(e.modelValue?.id)+" ",1),t(i,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])])]),_:1})]))])])}const ks=k(Gt,[["render",Es],["__scopeId","data-v-3c933aae"]]),ys=E({name:"SeedanceRecentPanel",components:{TaskPreview:ks,BotPlaceholder:Se,NoTasks:pe,ScrollList:fe},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],computed:{tasks(){return{...this.$store.state.seedance?.tasks,items:this.$store.state.seedance?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),ws={key:0},Ss={key:2,class:"w-full h-full flex items-center justify-center"};function Vs(e,a,m,f,u,g){const d=s("bot-placeholder"),p=s("task-preview"),r=s("scroll-list"),i=s("no-tasks");return o(),l(V,null,[e.tasks?.items===void 0?(o(),l("div",ws,[t(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(o(),y(r,{key:1,ref:"scrollList",class:"tasks w-full h-full overflow-y-auto",loading:e.loading,onReachTop:a[0]||(a[0]=b=>e.$emit("reach-top"))},{default:_(()=>[(o(!0),l(V,null,C(e.tasks?.items,b=>(o(),y(p,{key:b.id,"model-value":b},null,8,["model-value"]))),128))]),_:1},8,["loading"])):v("",!0),e.tasks?.items?.length===0?(o(),l("div",Ss,[t(i)])):v("",!0)],64)}const Ls=k(ys,[["render",Vs]]),Ts=me("seedance"),Is=E({name:"SeedanceIndex",components:{ConfigPanel:jt,Layout:Fe,RecentPanel:Ls},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.seedance?.status?.getApplications===j.Request},tasksLoading(){return this.$store.state.seedance?.status?.getTasks===j.Request||this.fetchingTasks},credential(){return this.$store.state.seedance?.credential},config(){return this.$store.state.seedance?.config},tasks(){return this.$store.state.seedance?.tasks}},watch:{initialized:{async handler(e){e&&(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 _e({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(){await this.$store.dispatch("seedance/getService")},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;const{limit:a=5,createdAtMin:m,createdAtMax:f}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch("seedance/getTasks",{limit:a,createdAtMin:m,createdAtMax:f})}finally{this.fetchingTasks=!1}},async onGenerate(){const e={...this.config||{}};if(typeof e?.prompt=="string"&&(e.prompt=e.prompt.trim(),e.prompt||delete e.prompt),Array.isArray(e?.images)){e.images=e.images.filter(d=>!!d?.url);const u=e.images.some(d=>d?.role==="first_frame"),g=e.images.some(d=>d?.role==="last_frame");!u&&g&&(e.images=e.images.map(d=>d?.role==="last_frame"?{...d,role:"first_frame"}:d))}!(Array.isArray(e?.images)&&e.images.length>0)&&"images"in e&&delete e.images;const m={...e,callback_url:Ts},f=this.credential?.token;if(!f){console.error("no token specified");return}w.info(this.$t("seedance.message.startingTask")),ce("seedance",de.generate(m,{token:f})).then(()=>{w.success(this.$t("seedance.message.startTaskSuccess"))}).catch(u=>{const g=u?.response?.data;g?.error?.code===Ve?w.error(this.$t("seedance.message.usedUp")):w.error(this.$t("seedance.message.startTaskFailed")+(g?.error?.message||""))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function As(e,a,m,f,u,g){const d=s("config-panel"),p=s("recent-panel"),r=s("layout");return o(),y(r,null,{config:_(()=>[t(d,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:_(()=>[t(p,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const To=k(Is,[["render",As]]);export{To as default};
1
+ import{F as I}from"./index.es-BXrnqbDc.js";import{E as A}from"./index-ByRYubXn.js";import{E as Q}from"./index-PMRNSwyk.js";import{d as E,H as l,E as c,z as O,C as t,y as _,D as s,q as o,x as y,F as n,O as V,N as C,J as v,I as h,M as X,Q as F}from"./vendor-vue-NSDaktjZ.js";import{H as k,d7 as Y,d8 as G,d9 as B,da as q,db as Z,dc as x,dd as ee,de as te,df as se,dg as oe,bm as z,dh as ne,di as ae,dj as le,dk as re,dl as ie,cp as ce,b0 as de,S as j,cq as me}from"./index-BRfbHCvZ.js";import{P as ue,N as pe}from"./NoTasks-d_8CfjZ-.js";import{I as S,S as fe,l as _e}from"./pagination-BJFvnhlr.js";import{E as P,a as N}from"./index-DfiGO-z3.js";import{E as H}from"./index-TeXIMvfD.js";import{p as W}from"./pasteUploadMixin-BurWbGNQ.js";import{I as M}from"./ImagePreview-CYYwR4zK.js";import{E as J}from"./index-D63t9suS.js";import{E as w}from"./index-B8CSiOhn.js";import{C as he}from"./Consumption-BgQfeJho.js";import{a as ve}from"./price-Be1B_bvo.js";import{C as $e}from"./CopyToClipboard-B3FBgh3x.js";import{V as ge}from"./VideoPlayer-BwloPwzx.js";import{I as be}from"./ImageWrapper-D9p7vy0W.js";import{A as Ee}from"./ApiCodeButton-DdERRoj0.js";import{E as ke}from"./index-BZkaFFuw.js";import{E as ye}from"./index-Bav7i68F.js";import{E as we}from"./index-CVuadntg.js";import{B as Se}from"./BotPlaceholder-CMs0qZF7.js";import{b as Ve}from"./errorCode-Cqj9Td_Z.js";import"./use-form-item-gFrK0FVf.js";import"./index-BuyEbX8F.js";import"./vendor-axios-B8_nURbH.js";import"./vendor-dayjs-v0j1UNZp.js";import"./vendor-vue-router-Df5ITouH.js";import"./index-Cf4MWvor.js";import"./typescript-HOmQr8QU.js";import"./index-CJozFb-_.js";import"./index-zJe4TTTN.js";import"./highlight-D6Rf8-7-.js";import"./index-BLjywj98.js";import"./vendor-highlight-lEWW1Jxd.js";import"./index-BtOQSaPZ.js";import"./strings-beZM2Y-f.js";import"./isEqual-DdIQEpjm.js";import"./_Uint8Array-BHztG1Lf.js";import"./castArray-CEKtna1X.js";import"./debounce-BzdywqWi.js";import"./_baseIteratee-DawPdq6H.js";import"./index-LSBUkmpR.js";import"./validator-CRted-PS.js";import"./index-BnLROHuz.js";import"./_baseClone-DBPrtxYY.js";import"./_initCloneObject-RQtwP1G5.js";import"./vue-plyr-BO2nlN4c.js";import"./index-BSKrtLfD.js";const Le=E({name:"LayoutSeedance",components:{ElDrawer:Q,ElButton:A,FontAwesomeIcon:I},data(){return{drawer:!1}}}),Te={class:"main flex flex-row flex-1"},Ie={class:"config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]"},Ae={class:"result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]"};function Ce(e,a,m,f,u,g){const d=s("font-awesome-icon"),p=s("el-button"),r=s("el-drawer");return o(),l("div",Te,[c("div",Ie,[O(e.$slots,"config",{},void 0,!0)]),c("div",Ae,[O(e.$slots,"result",{},void 0,!0)]),t(p,{circle:"",class:"menu",onClick:a[0]||(a[0]=i=>e.drawer=!0)},{default:_(()=>[t(d,{icon:"fa-solid fa-magic"})]),_:1}),t(r,{modelValue:e.drawer,"onUpdate:modelValue":a[1]||(a[1]=i=>e.drawer=i),direction:"ltr","with-header":!1,size:"350px"},{default:_(()=>[O(e.$slots,"config",{},void 0,!0)]),_:3},8,["modelValue"])])}const Fe=k(Le,[["render",Ce],["__scopeId","data-v-caafd095"]]),De="",Re=E({name:"SeedancePromptInput",components:{PromptTextarea:ue},computed:{prompt:{get(){return this.$store.state.seedance?.config?.prompt},set(e){this.$store.commit("seedance/setConfig",{...this.$store.state.seedance?.config,prompt:e})}}},mounted(){this.prompt||(this.prompt=De)}});function Ue(e,a,m,f,u,g){const d=s("prompt-textarea");return o(),y(d,{modelValue:e.prompt,"onUpdate:modelValue":a[0]||(a[0]=p=>e.prompt=p),title:e.$t("seedance.name.prompt"),info:e.$t("seedance.description.prompt"),placeholder:e.$t("seedance.placeholder.prompt"),"min-rows":5},null,8,["modelValue","title","info","placeholder"])}const Oe=k(Re,[["render",Ue]]),Pe=E({name:"SeedanceModelSelector",components:{ElSelect:N,ElOption:P,InfoIcon:S},data(){return{options:[{value:G,label:this.$t("seedance.model.seedance20")},{value:B,label:this.$t("seedance.model.seedance20Fast")},{value:q,label:this.$t("seedance.model.seedance15pro")},{value:Z,label:this.$t("seedance.model.seedance10pro")},{value:x,label:this.$t("seedance.model.seedance10proFast")},{value:ee,label:this.$t("seedance.model.seedance10liteT2v")},{value:te,label:this.$t("seedance.model.seedance10liteI2v")}]}},computed:{value:{get(){return this.$store.state.seedance?.config?.model},set(e){this.$store.commit("seedance/setConfig",{...this.$store.state.seedance?.config,model:e})}}},mounted(){this.value||(this.value=Y)}}),Ne={class:"field"},Me={class:"label"},je={class:"box"},Ge={class:"title font-bold"};function Be(e,a,m,f,u,g){const d=s("info-icon"),p=s("el-option"),r=s("el-select");return o(),l("div",Ne,[c("div",Me,[c("div",je,[c("h2",Ge,n(e.$t("seedance.name.model")),1),t(d,{content:e.$t("seedance.description.model"),class:"info"},null,8,["content"])])]),t(r,{modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=i=>e.value=i),class:"value",placeholder:e.$t("seedance.placeholder.select")},{default:_(()=>[(o(!0),l(V,null,C(e.options,i=>(o(),y(p,{key:i.value,label:i.label,value:i.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const qe=k(Pe,[["render",Be],["__scopeId","data-v-61816a81"]]),ze=E({name:"SeedanceDurationSelector",components:{ElSelect:N,ElOption:P,InfoIcon:S},data(){return{options:[{value:2,label:"2s"},{value:3,label:"3s"},{value:4,label:"4s"},{value:5,label:"5s"},{value:6,label:"6s"},{value:7,label:"7s"},{value:8,label:"8s"},{value:9,label:"9s"},{value:10,label:"10s"},{value:11,label:"11s"},{value:12,label:"12s"}]}},computed:{value:{get(){return this.$store.state.seedance?.config?.duration},set(e){this.$store.commit("seedance/setConfig",{...this.$store.state.seedance?.config,duration:e})}}},mounted(){this.value||(this.value=se)}}),He={class:"field"},We={class:"label"},Je={class:"box"},Ke={class:"title font-bold"};function Qe(e,a,m,f,u,g){const d=s("info-icon"),p=s("el-option"),r=s("el-select");return o(),l("div",He,[c("div",We,[c("div",Je,[c("h2",Ke,n(e.$t("seedance.name.duration")),1),t(d,{content:e.$t("seedance.description.duration"),class:"info"},null,8,["content"])])]),t(r,{modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=i=>e.value=i),class:"value",placeholder:e.$t("seedance.placeholder.select")},{default:_(()=>[(o(!0),l(V,null,C(e.options,i=>(o(),y(p,{key:i.value,label:i.label,value:i.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Xe=k(ze,[["render",Qe],["__scopeId","data-v-5c809a72"]]),Ye=new Set([q,G,B]),Ze=E({name:"SeedanceGenerateAudioSwitch",components:{ElSwitch:H,InfoIcon:S},computed:{isSupported(){const e=this.$store.state.seedance?.config?.model;return typeof e=="string"&&Ye.has(e)},value:{get(){return this.$store.state.seedance?.config?.generate_audio??!1},set(e){this.$store.commit("seedance/setConfig",{...this.$store.state.seedance?.config,generate_audio:e})}}},watch:{isSupported(e){!e&&this.value&&(this.value=!1)}},mounted(){this.value===void 0&&(this.value=oe)}}),xe={key:0,class:"field"},et={class:"label"},tt={class:"box"},st={class:"title font-bold"},ot={class:"value"};function nt(e,a,m,f,u,g){const d=s("info-icon"),p=s("el-switch");return e.isSupported?(o(),l("div",xe,[c("div",et,[c("div",tt,[c("h2",st,n(e.$t("seedance.name.generateAudio")),1),t(d,{content:e.$t("seedance.description.generateAudio"),class:"info"},null,8,["content"])])]),c("div",ot,[t(p,{modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=r=>e.value=r),"inline-prompt":"","active-text":e.$t("seedance.button.on"),"inactive-text":e.$t("seedance.button.off")},null,8,["modelValue","active-text","inactive-text"])])])):v("",!0)}const at=k(Ze,[["render",nt],["__scopeId","data-v-004d19ff"]]),lt=E({name:"SeedanceFirstFrameImage",components:{ElUpload:J,ElButton:A,InfoIcon:S,FontAwesomeIcon:I,ImagePreview:M},mixins:[W],data(){return{fileList:[],uploadUrl:z()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},methods:{onExceed(){w.warning(this.$t("seedance.message.uploadExceed"))},onError(){w.error(this.$t("seedance.message.uploadError"))},onSetFirstFrameUrl(){const e=this.urls?.[0],m=(this.$store.state.seedance?.config?.images||[]).filter(f=>f?.role!=="first_frame");e&&m.push({url:e,role:"first_frame"}),this.$store.commit("seedance/setConfig",{...this.$store.state.seedance?.config,images:m.length>0?m:void 0})},async onSuccess(){this.onSetFirstFrameUrl()},async onRemove(){this.onSetFirstFrameUrl()}}}),rt={class:"relative"},it={class:"flex justify-between"},ct={class:"flex justify-start items-center"},dt={class:"text-sm font-bold"};function mt(e,a,m,f,u,g){const d=s("info-icon"),p=s("image-preview"),r=s("font-awesome-icon"),i=s("el-button"),b=s("el-upload");return o(),l("div",rt,[c("div",it,[c("div",ct,[c("span",dt,n(e.$t("seedance.name.firstFrame")),1),t(d,{content:e.$t("seedance.description.firstFrame")},null,8,["content"])])]),t(b,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":a[0]||(a[0]=$=>e.fileList=$),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,"on-remove":e.onRemove,headers:e.headers},{file:_(({file:$})=>[$.url&&$.percentage!==void 0?(o(),y(p,{key:0,url:$.url,name:$.name,percentage:$.percentage,onRemove:L=>e.fileList.splice(e.fileList.indexOf($),1)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:_(()=>[t(i,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:_(()=>[t(r,{icon:"fa-solid fa-upload",class:"icon mr-1"}),h(" "+n(e.$t("seedance.button.upload")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","on-remove","headers"])])}const ut=k(lt,[["render",mt],["__scopeId","data-v-5294baf8"]]),pt=E({name:"SeedanceLastFrameImage",components:{ElUpload:J,ElButton:A,ImagePreview:M,InfoIcon:S,FontAwesomeIcon:I},mixins:[W],data(){return{fileList:[],uploadUrl:z()+"/api/v1/files/"}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)}},methods:{onExceed(){w.warning(this.$t("seedance.message.uploadExceed"))},onError(){w.error(this.$t("seedance.message.uploadError"))},onSetLastFrameUrl(){const e=this.urls?.[0],m=(this.$store.state.seedance?.config?.images||[]).filter(f=>f?.role!=="last_frame");e&&m.push({url:e,role:"last_frame"}),this.$store.commit("seedance/setConfig",{...this.$store.state.seedance?.config,images:m.length>0?m:void 0})},async onSuccess(){this.onSetLastFrameUrl()},async onRemove(){this.onSetLastFrameUrl()}}}),ft={class:"relative"},_t={class:"flex justify-between"},ht={class:"flex justify-start items-center"},vt={class:"text-sm font-bold"};function $t(e,a,m,f,u,g){const d=s("info-icon"),p=s("image-preview"),r=s("font-awesome-icon"),i=s("el-button"),b=s("el-upload");return o(),l("div",ft,[c("div",_t,[c("div",ht,[c("span",vt,n(e.$t("seedance.name.lastFrame")),1),t(d,{content:e.$t("seedance.description.lastFrame")},null,8,["content"])])]),t(b,{ref:"uploader","file-list":e.fileList,"onUpdate:fileList":a[0]||(a[0]=$=>e.fileList=$),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,"on-remove":e.onRemove,headers:e.headers},{file:_(({file:$})=>[$.url&&$.percentage!==void 0?(o(),y(p,{key:0,url:$.url,name:$.name,percentage:$.percentage,onRemove:L=>e.fileList.splice(e.fileList.indexOf($),1)},null,8,["url","name","percentage","onRemove"])):v("",!0)]),default:_(()=>[t(i,{round:"",type:"primary",size:"small",class:"btn btn-upload"},{default:_(()=>[t(r,{icon:"fa-solid fa-upload",class:"icon mr-1"}),h(" "+n(e.$t("seedance.button.upload")),1)]),_:1})]),_:1},8,["file-list","action","on-exceed","on-error","on-success","on-remove","headers"])])}const gt=k(pt,[["render",$t],["__scopeId","data-v-f423739f"]]),bt=E({name:"SeedanceServiceTierSelector",components:{ElSelect:N,ElOption:P,InfoIcon:S},data(){return{options:[{value:ae,label:this.$t("seedance.serviceTier.default")},{value:le,label:this.$t("seedance.serviceTier.flex")}]}},computed:{value:{get(){return this.$store.state.seedance?.config?.service_tier},set(e){this.$store.commit("seedance/setConfig",{...this.$store.state.seedance?.config,service_tier:e})}}},mounted(){this.value||(this.value=ne)}}),Et={class:"field"},kt={class:"label"},yt={class:"box"},wt={class:"title font-bold"};function St(e,a,m,f,u,g){const d=s("info-icon"),p=s("el-option"),r=s("el-select");return o(),l("div",Et,[c("div",kt,[c("div",yt,[c("h2",wt,n(e.$t("seedance.name.serviceTier")),1),t(d,{content:e.$t("seedance.description.serviceTier"),class:"info"},null,8,["content"])])]),t(r,{modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=i=>e.value=i),class:"value",placeholder:e.$t("seedance.placeholder.select")},{default:_(()=>[(o(!0),l(V,null,C(e.options,i=>(o(),y(p,{key:i.value,label:i.label,value:i.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])}const Vt=k(bt,[["render",St],["__scopeId","data-v-cc938de2"]]),Lt=E({name:"SeedanceReturnLastFrameSwitch",components:{ElSwitch:H,InfoIcon:S},computed:{value:{get(){return this.$store.state.seedance?.config?.return_last_frame},set(e){this.$store.commit("seedance/setConfig",{...this.$store.state.seedance?.config,return_last_frame:e})}}},mounted(){this.value===void 0&&(this.value=re)}}),Tt={class:"field"},It={class:"label"},At={class:"box"},Ct={class:"title font-bold"},Ft={class:"value"};function Dt(e,a,m,f,u,g){const d=s("info-icon"),p=s("el-switch");return o(),l("div",Tt,[c("div",It,[c("div",At,[c("h2",Ct,n(e.$t("seedance.name.returnLastFrame")),1),t(d,{content:e.$t("seedance.description.returnLastFrame"),class:"info"},null,8,["content"])])]),c("div",Ft,[t(p,{modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=r=>e.value=r),"inline-prompt":"","active-text":e.$t("seedance.button.on"),"inactive-text":e.$t("seedance.button.off")},null,8,["modelValue","active-text","inactive-text"])])])}const Rt=k(Lt,[["render",Dt],["__scopeId","data-v-cd179b1c"]]),Ut=E({name:"SeedanceConfigPanel",components:{ElButton:A,FontAwesomeIcon:I,PromptInput:Oe,ModelSelector:qe,DurationSelector:Xe,GenerateAudioSwitch:at,ServiceTierSelector:Vt,ReturnLastFrameSwitch:Rt,FirstFrameImage:ut,LastFrameImage:gt,Consumption:he},emits:["generate"],computed:{config(){return this.$store.state.seedance?.config},consumption(){return ve(this.config,this.service?.cost)},service(){return this.$store.state.seedance?.service}},methods:{onGenerate(){this.$emit("generate")}}}),Ot={class:"flex flex-col h-full"},Pt={class:"flex-1 overflow-y-auto p-5"},Nt={class:"flex flex-col items-center justify-center px-5 pb-5"};function Mt(e,a,m,f,u,g){const d=s("prompt-input"),p=s("model-selector"),r=s("duration-selector"),i=s("generate-audio-switch"),b=s("service-tier-selector"),$=s("return-last-frame-switch"),L=s("first-frame-image"),D=s("last-frame-image"),R=s("consumption"),U=s("font-awesome-icon"),T=s("el-button");return o(),l("div",Ot,[c("div",Pt,[t(d,{class:"mb-4"}),t(p,{class:"mb-4"}),t(r,{class:"mb-4"}),t(i,{class:"mb-4"}),t(b,{class:"mb-4"}),t($,{class:"mb-4"}),t(L,{class:"mb-2"}),t(D,{class:"mb-2"})]),c("div",Nt,[t(R,{value:e.consumption,service:e.service},null,8,["value","service"]),t(T,{type:"primary",class:"btn w-full",round:"",onClick:e.onGenerate},{default:_(()=>[t(U,{icon:"fa-solid fa-magic",class:"mr-2"}),h(" "+n(e.$t("seedance.button.generate")),1)]),_:1},8,["onClick"])])])}const jt=k(Ut,[["render",Mt]]),Gt=E({name:"SeedanceTaskPreview",components:{ElImage:we,CopyToClipboard:$e,FontAwesomeIcon:I,ElAlert:ye,VideoPlayer:ge,ElTooltip:ke,ElButton:A,ImageWrapper:be,ImagePreview:M,ApiCodeButton:Ee},props:{modelValue:{type:Object,required:!0}},data(){return{seedanceLogo:ie}},computed:{video(){return this.modelValue?.response?.data},referenceImages(){const e=this.modelValue?.request?.images;if(!Array.isArray(e))return[];const a=[],m=e.find(u=>u?.role==="first_frame");m?.url&&a.push({url:m.url,name:"first-frame"});const f=e.find(u=>u?.role==="last_frame");return f?.url&&a.push({url:f.url,name:"last-frame"}),e.forEach((u,g)=>{u?.url&&u.role!=="first_frame"&&u.role!=="last_frame"&&a.push({url:u.url,name:u.role||`image-${g}`})}),a}},methods:{onDownload(e){window.open(e,"_blank")}}}),Bt={class:"preview"},qt={class:"left"},zt={class:"main"},Ht={class:"bot"},Wt={class:"datetime"},Jt={class:"info"},Kt={key:0,class:"flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto"},Qt={key:1,class:"prompt mt-2"},Xt={key:0},Yt={key:1},Zt={key:0,class:F({content:!0})},xt={class:"text-[var(--el-text-color-regular)] text-xs mb-0"},es={key:1,class:F({content:!0})},ts={key:0,class:"mb-4"},ss={key:1,class:"mb-4"},os={key:2,class:F({operations:!0,"mt-2":!0,"mb-2":!0})},ns={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},as={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ls={key:2,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},rs={key:0},is={key:1},cs={key:3,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ds={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},ms={key:4,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},us={key:5,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},ps={key:2,class:F({content:!0})},fs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},_s={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},hs={key:1,class:"text-[var(--el-text-color-regular)] text-xs mb-2"},vs={key:2,class:"text-[var(--el-text-color-regular)] text-xs mb-0"},$s={key:3,class:F({content:!0})},gs={class:"text-[var(--el-text-color-regular)] text-xs mb-2"},bs={key:0,class:"text-[var(--el-text-color-regular)] text-xs mb-0"};function Es(e,a,m,f,u,g){const d=s("el-image"),p=s("image-preview"),r=s("font-awesome-icon"),i=s("copy-to-clipboard"),b=s("el-alert"),$=s("video-player"),L=s("image-wrapper"),D=s("el-button"),R=s("el-tooltip"),U=s("api-code-button");return o(),l("div",Bt,[c("div",qt,[t(d,{src:e.seedanceLogo,class:"avatar"},null,8,["src"])]),c("div",zt,[c("div",Ht,[h(n(e.$t("seedance.name.seedanceBot"))+" ",1),c("span",Wt,n(e.$dayjs.format(""+new Date(parseFloat((e.modelValue?.created_at||"").toString())*1e3))),1)]),c("div",Jt,[e.referenceImages.length>0?(o(),l("div",Kt,[(o(!0),l(V,null,C(e.referenceImages,(T,K)=>(o(),y(p,{key:K,url:T.url,name:T.name,closable:!1},null,8,["url","name"]))),128))])):v("",!0),e.modelValue?.request?.prompt?(o(),l("p",Qt,[h(n(e.modelValue?.request?.prompt)+" ",1),e.modelValue?.response?e.video?.status==="processing"||e.video?.status==="pending"?(o(),l("span",Yt," - ("+n(e.$t("seedance.status.processing"))+") ",1)):v("",!0):(o(),l("span",Xt," - ("+n(e.$t("seedance.status.pending"))+") ",1))])):v("",!0)]),e.modelValue?.response?e.modelValue?.response?.success===!0?(o(),l("div",es,[e.video?.video_url?(o(),l("div",ts,[t($,{src:e.video?.video_url},null,8,["src"])])):v("",!0),e.video?.last_frame_url?(o(),l("div",ss,[t(L,{src:e.video?.last_frame_url,"raw-src":e.video?.last_frame_url},null,8,["src","raw-src"])])):v("",!0),e.video?.video_url?(o(),l("div",os,[t(R,{class:"box-item",effect:"dark",content:e.$t("seedance.message.downloadVideo"),placement:"top-start"},{default:_(()=>[t(D,{type:"info",size:"small",class:"btn-action",onClick:a[0]||(a[0]=X(T=>e.onDownload(e.video?.video_url),["stop"]))},{default:_(()=>[h(n(e.$t("seedance.button.download")),1)]),_:1})]),_:1},8,["content"]),t(U,{path:"/seedance/videos",body:e.modelValue?.request},null,8,["body"])])):v("",!0),t(b,{closable:!1,class:"mt-2 success"},{default:_(()=>[e.modelValue?.request?.model?(o(),l("p",ns,[t(r,{icon:"fa-solid fa-cube",class:"mr-1"}),h(" "+n(e.$t("seedance.name.model"))+": "+n(e.modelValue?.request?.model),1)])):v("",!0),e.video?.duration?(o(),l("p",as,[t(r,{icon:"fa-solid fa-clock",class:"mr-1"}),h(" "+n(e.$t("seedance.name.duration"))+": "+n(e.video?.duration)+"s ",1)])):v("",!0),e.video?.resolution?(o(),l("p",ls,[t(r,{icon:"fa-solid fa-expand",class:"mr-1"}),h(" "+n(e.$t("seedance.name.resolution"))+": "+n(e.video?.resolution)+" ",1),e.video?.ratio?(o(),l("span",rs," · "+n(e.video?.ratio),1)):v("",!0),e.video?.framespersecond?(o(),l("span",is," · "+n(e.video?.framespersecond)+"fps",1)):v("",!0)])):v("",!0),e.modelValue?.request?.generate_audio?(o(),l("p",cs,[t(r,{icon:"fa-solid fa-volume-up",class:"mr-1"}),h(" "+n(e.$t("seedance.name.generateAudio"))+": "+n(e.$t("seedance.button.on")),1)])):v("",!0),c("p",ds,[t(r,{icon:"fa-solid fa-magic",class:"mr-1"}),h(" "+n(e.$t("seedance.name.taskId"))+": "+n(e.modelValue?.id)+" ",1),t(i,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])]),e.modelValue?.elapsed?(o(),l("p",ms,[t(r,{icon:"fa-solid fa-clock",class:"mr-1"}),h(" "+n(e.$t("seedance.name.elapsed"))+": "+n(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):v("",!0),e.modelValue?.response?.trace_id?(o(),l("p",us,[t(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),h(" "+n(e.$t("seedance.name.traceId"))+": "+n(e.modelValue?.response?.trace_id)+" ",1),t(i,{content:e.modelValue?.response?.trace_id,class:"btn-copy inline-block"},null,8,["content"])])):v("",!0)]),_:1})])):e.modelValue?.response?.success===!1?(o(),l("div",ps,[t(b,{closable:!1,class:"failure"},{template:_(()=>[t(r,{icon:"fa-solid fa-exclamation-triangle",class:"mr-1"}),h(" "+n(e.$t("seedance.name.failure")),1)]),default:_(()=>[c("p",fs,[t(r,{icon:"fa-solid fa-magic",class:"mr-1"}),h(" "+n(e.$t("seedance.name.taskId"))+": "+n(e.modelValue?.id)+" ",1),t(i,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])]),e.modelValue?.response?.error?.message?(o(),l("p",_s,[t(r,{icon:"fa-solid fa-circle-info",class:"mr-1"}),h(" "+n(e.$t("seedance.name.failureReason"))+": "+n(e.modelValue?.response?.error?.message)+" ",1),t(i,{content:e.modelValue?.response?.error?.message,class:"btn-copy inline-block"},null,8,["content"])])):v("",!0),e.modelValue?.elapsed?(o(),l("p",hs,[t(r,{icon:"fa-solid fa-clock",class:"mr-1"}),h(" "+n(e.$t("seedance.name.elapsed"))+": "+n(e.modelValue?.elapsed?.toFixed(2))+"s ",1)])):v("",!0),e.modelValue?.response?.trace_id?(o(),l("p",vs,[t(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),h(" "+n(e.$t("seedance.name.traceId"))+": "+n(e.modelValue?.response?.trace_id)+" ",1),t(i,{content:e.modelValue?.response?.trace_id,class:"btn-copy inline-block"},null,8,["content"])])):v("",!0)]),_:1})])):(o(),l("div",$s,[t(b,{closable:!1,class:"info"},{template:_(()=>[t(r,{icon:"fa-solid fa-circle-info",class:"mr-1"}),h(" "+n(e.$t("seedance.name.status")),1)]),default:_(()=>[c("p",gs,[t(r,{icon:"fa-solid fa-magic",class:"mr-1"}),h(" "+n(e.$t("seedance.name.taskId"))+": "+n(e.modelValue?.id)+" ",1),t(i,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])]),e.modelValue?.response?.trace_id?(o(),l("p",bs,[t(r,{icon:"fa-solid fa-hashtag",class:"mr-1"}),h(" "+n(e.$t("seedance.name.traceId"))+": "+n(e.modelValue?.response?.trace_id)+" ",1),t(i,{content:e.modelValue?.response?.trace_id,class:"btn-copy inline-block"},null,8,["content"])])):v("",!0)]),_:1})])):(o(),l("div",Zt,[t(b,{closable:!1,class:"info"},{template:_(()=>[t(r,{icon:"fa-regular fa-clock",class:"mr-1"}),h(" "+n(e.$t("seedance.status.pending")),1)]),default:_(()=>[c("p",xt,[t(r,{icon:"fa-solid fa-magic",class:"mr-1"}),h(" "+n(e.$t("seedance.name.taskId"))+": "+n(e.modelValue?.id)+" ",1),t(i,{content:e.modelValue?.id,class:"btn-copy inline-block"},null,8,["content"])])]),_:1})]))])])}const ks=k(Gt,[["render",Es],["__scopeId","data-v-3c933aae"]]),ys=E({name:"SeedanceRecentPanel",components:{TaskPreview:ks,BotPlaceholder:Se,NoTasks:pe,ScrollList:fe},props:{loading:{type:Boolean,default:!1}},emits:["reach-top"],computed:{tasks(){return{...this.$store.state.seedance?.tasks,items:this.$store.state.seedance?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),ws={key:0},Ss={key:2,class:"w-full h-full flex items-center justify-center"};function Vs(e,a,m,f,u,g){const d=s("bot-placeholder"),p=s("task-preview"),r=s("scroll-list"),i=s("no-tasks");return o(),l(V,null,[e.tasks?.items===void 0?(o(),l("div",ws,[t(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(o(),y(r,{key:1,ref:"scrollList",class:"tasks w-full h-full overflow-y-auto",loading:e.loading,onReachTop:a[0]||(a[0]=b=>e.$emit("reach-top"))},{default:_(()=>[(o(!0),l(V,null,C(e.tasks?.items,b=>(o(),y(p,{key:b.id,"model-value":b},null,8,["model-value"]))),128))]),_:1},8,["loading"])):v("",!0),e.tasks?.items?.length===0?(o(),l("div",Ss,[t(i)])):v("",!0)],64)}const Ls=k(ys,[["render",Vs]]),Ts=me("seedance"),Is=E({name:"SeedanceIndex",components:{ConfigPanel:jt,Layout:Fe,RecentPanel:Ls},inject:["initialized"],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.seedance?.status?.getApplications===j.Request},tasksLoading(){return this.$store.state.seedance?.status?.getTasks===j.Request||this.fetchingTasks},credential(){return this.$store.state.seedance?.credential},config(){return this.$store.state.seedance?.config},tasks(){return this.$store.state.seedance?.tasks}},watch:{initialized:{async handler(e){e&&(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 _e({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(){await this.$store.dispatch("seedance/getService")},async onScrollDown(){await this.$nextTick();const e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;const{limit:a=5,createdAtMin:m,createdAtMax:f}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch("seedance/getTasks",{limit:a,createdAtMin:m,createdAtMax:f})}finally{this.fetchingTasks=!1}},async onGenerate(){const e={...this.config||{}};if(typeof e?.prompt=="string"&&(e.prompt=e.prompt.trim(),e.prompt||delete e.prompt),Array.isArray(e?.images)){e.images=e.images.filter(d=>!!d?.url);const u=e.images.some(d=>d?.role==="first_frame"),g=e.images.some(d=>d?.role==="last_frame");!u&&g&&(e.images=e.images.map(d=>d?.role==="last_frame"?{...d,role:"first_frame"}:d))}!(Array.isArray(e?.images)&&e.images.length>0)&&"images"in e&&delete e.images;const m={...e,callback_url:Ts},f=this.credential?.token;if(!f){console.error("no token specified");return}w.info(this.$t("seedance.message.startingTask")),ce("seedance",de.generate(m,{token:f})).then(()=>{w.success(this.$t("seedance.message.startTaskSuccess"))}).catch(u=>{const g=u?.response?.data;g?.error?.code===Ve?w.error(this.$t("seedance.message.usedUp")):w.error(this.$t("seedance.message.startTaskFailed")+(g?.error?.message||""))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function As(e,a,m,f,u,g){const d=s("config-panel"),p=s("recent-panel"),r=s("layout");return o(),y(r,null,{config:_(()=>[t(d,{onGenerate:e.onGenerate},null,8,["onGenerate"])]),result:_(()=>[t(p,{ref:"recentPanel",loading:e.loadingMore,onReachTop:e.onReachTop},null,8,["loading","onReachTop"])]),_:1})}const To=k(Is,[["render",As]]);export{To as default};