@acedatacloud/nexior 3.327.13 → 3.328.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ApiCodeButton-B6ugqxDK.js → ApiCodeButton-mvKRd2vS.js} +1 -1
- package/dist/assets/{Artifacts-ChxHYL6P.js → Artifacts-DiZZ912g.js} +1 -1
- package/dist/assets/{AskUserQuestionCard-MLoMFQkY.js → AskUserQuestionCard-BM4FF-1V.js} +1 -1
- package/dist/assets/{Auth-wpaFPrgr.js → Auth-BrVkJGO_.js} +1 -1
- package/dist/assets/{Bare-DwmWAX-H.js → Bare-UbYuAA12.js} +1 -1
- package/dist/assets/{BotPlaceholder-DwMB-nyu.js → BotPlaceholder-DqU8f5Fh.js} +1 -1
- package/dist/assets/{BottomFooter-jejtxfth.js → BottomFooter-DyGYK_Gx.js} +1 -1
- package/dist/assets/{Callback-D75_4ess.js → Callback-BPODJsx-.js} +1 -1
- package/dist/assets/{CodeSnippet-Dh3rolbK.js → CodeSnippet-D0BBi2Ky.js} +1 -1
- package/dist/assets/{Console-u92zISr-.js → Console-Y0tbVxma.js} +1 -1
- package/dist/assets/{Consumption-_nwRhH83.js → Consumption-C1ALJh9G.js} +1 -1
- package/dist/assets/{Conversation-DA7fmunS.js → Conversation-B2LOqT8A.js} +1 -1
- package/dist/assets/{Conversation-DKkhgqPd.js → Conversation-CBVoGnhp.js} +1 -1
- package/dist/assets/{CopyToClipboard-BQ2Ei1sV.js → CopyToClipboard-CoT4M6xJ.js} +1 -1
- package/dist/assets/{Detail-CyZi7ogE.js → Detail-CfisoQTG.js} +2 -2
- package/dist/assets/{Extra-D5li270u.js → Extra-D2IzCejr.js} +1 -1
- package/dist/assets/{FilePreview-BSviFDi1.js → FilePreview-jTXb2Spm.js} +1 -1
- package/dist/assets/{Hailuo-Dbc-B9Te.js → Hailuo-DrKaJaV2.js} +1 -1
- package/dist/assets/{History-dVoPykWo.js → History-B18OkqSK.js} +1 -1
- package/dist/assets/{ImagePreview-DKkz6u_p.js → ImagePreview-DBw0YCSw.js} +1 -1
- package/dist/assets/{ImageWrapper-BRTUYofN.js → ImageWrapper-C53P6A5K.js} +1 -1
- package/dist/assets/{Index-CE770V6G.js → Index-4RKfboND.js} +1 -1
- package/dist/assets/{Index-DiZwqyMw.js → Index-88lBeScn.js} +1 -1
- package/dist/assets/{Index-CuNZ5VPo.js → Index-B6iscR9u.js} +1 -1
- package/dist/assets/{Index-DlbG_DmZ.js → Index-BUOWu16h.js} +1 -1
- package/dist/assets/{Index-BL75lfg_.js → Index-BgqcHd_K.js} +1 -1
- package/dist/assets/{Index-dlLiKtTD.js → Index-Bos1LeCW.js} +1 -1
- package/dist/assets/{Index-CGpLsRmt.js → Index-BrsLEiZ7.js} +1 -1
- package/dist/assets/{Index-B7FqCu9b.js → Index-BsFDkqOL.js} +1 -1
- package/dist/assets/Index-C3pra4Y7.css +1 -0
- package/dist/assets/{Index-Dg4BOluo.js → Index-C5x8UoQI.js} +1 -1
- package/dist/assets/{Index-SjzgrV03.js → Index-CAX5wNat.js} +1 -1
- package/dist/assets/{Index-_lLCY_Ea.js → Index-CawsB9uy.js} +1 -1
- package/dist/assets/{Index-JzdZ0TPa.js → Index-D2Vhp2CJ.js} +1 -1
- package/dist/assets/{Index-Bsjmz52S.js → Index-D2rGLTgW.js} +1 -1
- package/dist/assets/{Index-Crl1Sw0g.js → Index-D2s9qsVK.js} +1 -1
- package/dist/assets/{Index-a1CjJGW4.js → Index-D5X4FwcM.js} +1 -1
- package/dist/assets/{Index-B8hTEerD.js → Index-D86nHL9s.js} +1 -1
- package/dist/assets/{Index-DQelOaCE.js → Index-DBNXBNVW.js} +1 -1
- package/dist/assets/{Index-BuNpeQrj.js → Index-DG3w7EUn.js} +1 -1
- package/dist/assets/{Index-CY9x2seG.js → Index-DNAc5g57.js} +1 -1
- package/dist/assets/{Index-C_qRrGdK.js → Index-DRWGSM3g.js} +1 -1
- package/dist/assets/{Index-4cqh_kOu.js → Index-Dea2VEzW.js} +1 -1
- package/dist/assets/{Index-Csd8_Agb.js → Index-Dm99mchI.js} +1 -1
- package/dist/assets/{Index--zSMebgV.js → Index-Dom1NOvI.js} +1 -1
- package/dist/assets/{Index-fJfUyzuW.js → Index-XCT2nW-q.js} +1 -1
- package/dist/assets/{Index-BB098AsY.js → Index-mKqetc_y.js} +1 -1
- package/dist/assets/{Index-BpGgY_Ek.js → Index-oYKJzd3F.js} +1 -1
- package/dist/assets/Index-sUcCal1c.js +1 -0
- package/dist/assets/{Index-P3j5DwyI.js → Index-z0HJwMqW.js} +1 -1
- package/dist/assets/{Index-D5NWlMH3.js → Index-z68h_pJr.js} +1 -1
- package/dist/assets/{Invitees-Vc7QeWfZ.js → Invitees-Cq71yirj.js} +1 -1
- package/dist/assets/{List-C2HCkQAI.js → List-B9YtWkbq.js} +1 -1
- package/dist/assets/{List-CcWcnbv9.js → List-CAuRb7pj.js} +1 -1
- package/dist/assets/{List-BHaLjNnq.js → List-DwbvNbC-.js} +1 -1
- package/dist/assets/{LocalTools-C-v6Bz-r.js → LocalTools-BSWQrNHA.js} +1 -1
- package/dist/assets/{LocalTools-BRuz7qWE.js → LocalTools-Bro9KBBp.js} +1 -1
- package/dist/assets/{Main-DNwm8rcq.js → Main-DvtduPPO.js} +1 -1
- package/dist/assets/{Message-s5Ec1YQm.js → Message-BCnXgc94.js} +1 -1
- package/dist/assets/{Model-7P_UY2Dy.js → Model-OXl45r_3.js} +1 -1
- package/dist/assets/{Navigator-DHT_Wtqn.js → Navigator-DpyMiUbf.js} +3 -3
- package/dist/assets/{NoTasks-Q9DDa660.js → NoTasks-C1NCAjA5.js} +1 -1
- package/dist/assets/{NotFound-Ob-yzf2H.js → NotFound-B9Y2ofCd.js} +1 -1
- package/dist/assets/{Pay-NytSoqqM.js → Pay-B0K_Tvrn.js} +1 -1
- package/dist/assets/{Player-BrnX8xA-.js → Player-HzZca10j.js} +1 -1
- package/dist/assets/{PromptTextarea-5oMvhem7.js → PromptTextarea-BDqu8og3.js} +1 -1
- package/dist/assets/{RealtimeCall-CEGYhfJe.js → RealtimeCall-DiH_vBaL.js} +1 -1
- package/dist/assets/ScheduledTasks-CTAIqYHO.js +2 -0
- package/dist/assets/ScheduledTasks-DsnuqSPs.css +1 -0
- package/dist/assets/{Status-BqztxI8Z.js → Status-D_dhm_ea.js} +1 -1
- package/dist/assets/{Subscribe-D55UOtOX.js → Subscribe-lE08Cm5T.js} +1 -1
- package/dist/assets/{TabSwitcher-s8FxHO7f.js → TabSwitcher-CHIQIq79.js} +1 -1
- package/dist/assets/{Tts-5Zt3ZHoX.js → Tts-lPnAYyEe.js} +1 -1
- package/dist/assets/{VideoPlayer-ikSJRkQv.js → VideoPlayer-NexTZScZ.js} +1 -1
- package/dist/assets/{VideoPreview-CZrENuKu.js → VideoPreview-DCeahnWf.js} +1 -1
- package/dist/assets/{alert-BfCyDcWO.js → alert-ahs7mNpG.js} +1 -1
- package/dist/assets/{avatar-CPDZqBps.js → avatar-jja3af5K.js} +1 -1
- package/dist/assets/{basic-Cm345FYj.js → basic-B6pBZ2q-.js} +1 -1
- package/dist/assets/{chat-C-DKOo30.js → chat--x9_gJPz.js} +1 -1
- package/dist/assets/{chat-9opabn-h.js → chat-B4uuLtpJ.js} +1 -1
- package/dist/assets/{chat-sBlqc2KU.js → chat-BI2yQyQy.js} +1 -1
- package/dist/assets/{chat-DpFWauZx.js → chat-BTe9NEfY.js} +1 -1
- package/dist/assets/{chat-VCk_q53g.js → chat-BV7WcfeH.js} +1 -1
- package/dist/assets/{chat-Bwws-v4D.js → chat-Bjjf7eir.js} +1 -1
- package/dist/assets/{chat-DbN3MSTh.js → chat-C4aYd5cf.js} +1 -1
- package/dist/assets/{chat-CeWfycGq.js → chat-COjmFCyK.js} +1 -1
- package/dist/assets/{chat-MQGYTifz.js → chat-Cuihkv7o.js} +1 -1
- package/dist/assets/{chat-gZYrV4pp.js → chat-Cv1yaYsZ.js} +1 -1
- package/dist/assets/{chat-DthPhVgi.js → chat-D5gP6Sk5.js} +1 -1
- package/dist/assets/{chat-BrZJSdNv.js → chat-DRNK8cKV.js} +1 -1
- package/dist/assets/{chat-Dwhkdkl2.js → chat-D_WKV49e.js} +1 -1
- package/dist/assets/{chat-DW2yPStG.js → chat-DvxEWzFZ.js} +1 -1
- package/dist/assets/{chat-BDFqZmA3.js → chat-G-oUryzh.js} +1 -1
- package/dist/assets/{chat-DGXJ4mVu.js → chat-PmqkzdK3.js} +1 -1
- package/dist/assets/{chat-BXG0uOVZ.js → chat-aD2kAhrU.js} +1 -1
- package/dist/assets/{chat-DqaOqyAE.js → chat-bJGizI3q.js} +1 -1
- package/dist/assets/{chat-DcUjsF0z.js → chat-oq8iY2nR.js} +1 -1
- package/dist/assets/{codingBridge-CbaTU1_7.js → codingBridge-o4D8NG2k.js} +1 -1
- package/dist/assets/{codingBridgeNotify-DIzHGoeo.js → codingBridgeNotify-CCCkRJaZ.js} +2 -2
- package/dist/assets/{collapse-Ccqa0VVu.js → collapse-Dt1P8EeN.js} +1 -1
- package/dist/assets/{constants-BWAHKQ-e.js → constants-Di8qAaA0.js} +1 -1
- package/dist/assets/{createTaskActions-utz_xWYm.js → createTaskActions-CofCuaMR.js} +1 -1
- package/dist/assets/{date-picker-B1Aj1P6O.js → date-picker-Beaq-V0S.js} +1 -1
- package/dist/assets/{digitalhuman-6sBkCXbF.js → digitalhuman-ywQie6q1.js} +1 -1
- package/dist/assets/{drawer-GII5N0kH.js → drawer-Bbz1bWjK.js} +1 -1
- package/dist/assets/{dropdown-NCWhNhmE.js → dropdown-2CHlhOc9.js} +1 -1
- package/dist/assets/{dropdown-BAiD4dmf.js → dropdown-Cw_1xU2o.js} +1 -1
- package/dist/assets/{esm-enNlsZ6P.js → esm-BkgOqOsK.js} +1 -1
- package/dist/assets/{esm-CQTOhOd1.js → esm-BlE1O8HU.js} +1 -1
- package/dist/assets/{esm-B3u8lUhu.js → esm-C9dyKRdH.js} +3 -3
- package/dist/assets/{esm-BFDzwz7H.js → esm-CXu8KDgo.js} +1 -1
- package/dist/assets/{esm-BlbK3YWA.js → esm-Ct0jmPCD.js} +2 -2
- package/dist/assets/esm-DYow634e.js +1 -0
- package/dist/assets/{esm-B4Mv9hnp.js → esm-hygnFHoD.js} +2 -2
- package/dist/assets/{fish-FcW2RIKk.js → fish-3Cku79Zq.js} +1 -1
- package/dist/assets/{flux-C_uoEh9t.js → flux-DGDIV7-V.js} +1 -1
- package/dist/assets/{grokvideo-5JqcID1e.js → grokvideo-CBm2EpbA.js} +1 -1
- package/dist/assets/{hailuo-BnOVDYIb.js → hailuo-CjcPxVr2.js} +1 -1
- package/dist/assets/{headshots-rog-taw5.js → headshots-DBIAayTq.js} +1 -1
- package/dist/assets/{i18n-BDMAD7Em.js → i18n-Cnwvyfb3.js} +1 -1
- package/dist/assets/{image-DdozYzas.js → image-CZEhdfIr.js} +1 -1
- package/dist/assets/{index-m0B4VH-l.js → index-CapYApEL.js} +4 -4
- package/dist/assets/{index.browser.esm-CkOw7Di7.js → index.browser.esm-Dy_KG34b.js} +1 -1
- package/dist/assets/{index.es-DVFB1iVe.js → index.es-BeDOj7l9.js} +1 -1
- package/dist/assets/{input-number-BZftuN2C.js → input-number-CNM48oTw.js} +1 -1
- package/dist/assets/{kling-fezjH413.js → kling-7onj209B.js} +1 -1
- package/dist/assets/{kling-BIZn64wm.js → kling-B0qdNUpv.js} +1 -1
- package/dist/assets/{kling-DX_ENx7v.js → kling-B90MZBJO.js} +1 -1
- package/dist/assets/{kling-Bfb08rFf.js → kling-BQnSXJCU.js} +1 -1
- package/dist/assets/{kling-BEBDcTg5.js → kling-BZJ2upGO.js} +1 -1
- package/dist/assets/{kling-CTFvMkZr.js → kling-Belmdw46.js} +1 -1
- package/dist/assets/{kling-ByVEzCMw.js → kling-Bmv35E4c.js} +1 -1
- package/dist/assets/{kling-D3MyKkPT.js → kling-Bqax-ibX.js} +1 -1
- package/dist/assets/{kling-DN95GeNu.js → kling-C05d6u9h.js} +1 -1
- package/dist/assets/{kling-B1QlFyAe.js → kling-C8vjwHgy.js} +1 -1
- package/dist/assets/{kling-jjIQFuuE.js → kling-CCAYIJg5.js} +1 -1
- package/dist/assets/{kling-CSRmwt_f.js → kling-CItw2VDx.js} +1 -1
- package/dist/assets/{kling-59Z6MxcM.js → kling-Cn0tB7bl.js} +1 -1
- package/dist/assets/{kling-C92J08nF.js → kling-D8dfWBS0.js} +1 -1
- package/dist/assets/{kling-BEO0McAG.js → kling-DGkXRFMA.js} +1 -1
- package/dist/assets/{kling-sIPAwEqj.js → kling-DJrnxz-n.js} +1 -1
- package/dist/assets/{kling-jT3Zhfyx.js → kling-DYmZI3bA.js} +1 -1
- package/dist/assets/{kling-BsM3OSTR.js → kling-ZtrCYbBQ.js} +1 -1
- package/dist/assets/{kling-_eDULOvq.js → kling-bZSVbsRJ.js} +1 -1
- package/dist/assets/{luma-12kArsfq.js → luma-Cy-6kvOi.js} +1 -1
- package/dist/assets/{maestro-Bm9wS8_g.js → maestro-DkXRzCm0.js} +1 -1
- package/dist/assets/{maestro-BE7pVrHS.js → maestro-mw3UP9ZS.js} +1 -1
- package/dist/assets/{midjourney-CYvKJLtX.js → midjourney-P7wOWd3A.js} +1 -1
- package/dist/assets/{mobileLocalExec-Cyxow5dP.js → mobileLocalExec-C-kplgQv.js} +2 -2
- package/dist/assets/{nanobanana-BUcG4Gxe.js → nanobanana-BRBjqK_c.js} +1 -1
- package/dist/assets/{openaiimage-CZjkzjCL.js → openaiimage-DHjjPff3.js} +1 -1
- package/dist/assets/{pagination-DiZdmGxW.js → pagination-BCtEfOqh.js} +1 -1
- package/dist/assets/{pagination-OQ6Csuu1.js → pagination-Df_omtLz.js} +1 -1
- package/dist/assets/{pika-CzipPX7M.js → pika-rzDILOCL.js} +1 -1
- package/dist/assets/{pixverse-CSS6SWUh.js → pixverse-DEgHSewZ.js} +1 -1
- package/dist/assets/{popover-DPOFggKQ.js → popover-BUq1te9P.js} +1 -1
- package/dist/assets/{producer-Ck_R-Q2x.js → producer-C7LByMVU.js} +1 -1
- package/dist/assets/{qrart-CEksb0cO.js → qrart-jd-KUeeZ.js} +1 -1
- package/dist/assets/{realtime-Dy4DX0gx.js → realtime-BSHKId1F.js} +1 -1
- package/dist/assets/{row-BMPJJqEZ.js → row-CeGcOFQC.js} +1 -1
- package/dist/assets/{seedance-YJeq02mp.js → seedance-BUU9REVe.js} +1 -1
- package/dist/assets/{seedream-CC08j83p.js → seedream-BQBdCJYB.js} +1 -1
- package/dist/assets/{select-Dimm3cl1.js → select-BA-cCcAZ.js} +1 -1
- package/dist/assets/{serp-CTs8RmbM.js → serp-DK-o13iD.js} +1 -1
- package/dist/assets/{slider-DmQjyRiW.js → slider-mSxNRAb6.js} +1 -1
- package/dist/assets/{solana-wallets-Bqu9jRXB.js → solana-wallets-DUN6ORxY.js} +2 -2
- package/dist/assets/{solana-wallets-vue-DjANhE7q.js → solana-wallets-vue-B5FC5Ihn.js} +1 -1
- package/dist/assets/{sora-2-T3sx-Y.js → sora-DUIW5h55.js} +1 -1
- package/dist/assets/{suno-ZdLhI-cJ.js → suno-B0lyGnTl.js} +1 -1
- package/dist/assets/{switch-D94Z7hOB.js → switch-B5T2UZ5K.js} +1 -1
- package/dist/assets/{table-CKTQXDS9.js → table-CEPsV0ch.js} +1 -1
- package/dist/assets/{tabs-CoQ1qOZt.js → tabs-ua-Mkkpv.js} +1 -1
- package/dist/assets/{time-picker-B8u2NouX.js → time-picker-DPPeDwNK.js} +1 -1
- package/dist/assets/{tooltip-CRloPYoS.js → tooltip-DaZcA4iA.js} +1 -1
- package/dist/assets/{upload-BQXdf3I1.js → upload-uSrKePzA.js} +1 -1
- package/dist/assets/{veo-AOvqIips.js → veo-BXDjEJvY.js} +1 -1
- package/dist/assets/{wan-C0EjXerf.js → wan-B9NOCIm5.js} +1 -1
- package/dist/assets/{web-CP12_Eue.js → web-BMwGjPJP.js} +1 -1
- package/dist/assets/{web-CxtaLiec.js → web-BUnavYd9.js} +1 -1
- package/dist/assets/{web-Bey0K1H_.js → web-C1Hdr0H3.js} +1 -1
- package/dist/assets/{web-GSeS6qM4.js → web-CXVHECoS.js} +1 -1
- package/dist/assets/{web-Bg7DToey.js → web-CvqA3KbP.js} +1 -1
- package/dist/assets/{webextrator-BD3AJOUe.js → webextrator-DqTN5Zq1.js} +1 -1
- package/dist/index.html +3 -3
- package/package.json +1 -1
- package/dist/assets/Index-BF1k8B8X.js +0 -1
- package/dist/assets/Index-CLr2BFzd.css +0 -1
- package/dist/assets/ScheduledTasks-BRGzfh-c.css +0 -1
- package/dist/assets/ScheduledTasks-CA_-ym45.js +0 -2
- package/dist/assets/esm-B2GYLCJK.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{E as y}from"./use-deprecated-B-uvyrTL.js";import{r as b,t as x}from"./select-BA-cCcAZ.js";import{n as S,t as C}from"./tabs-ua-Mkkpv.js";import{t as w}from"./upload-uSrKePzA.js";import{t as T}from"./tooltip-DaZcA4iA.js";import{t as E}from"./image-CZEhdfIr.js";import{t as ee}from"./alert-ahs7mNpG.js";import{n as te,r as ne}from"./radio-Bj0tEwH8.js";import{t as D}from"./drawer-Bbz1bWjK.js";import{t as O}from"./input-number-CNM48oTw.js";import{t as k}from"./slider-mSxNRAb6.js";import{t as re}from"./switch-B5T2UZ5K.js";import{$r as ie,Xr as ae,ei as oe,ti as A}from"./constants-Di8qAaA0.js";import{G as j,Gi as M,Ii as N,Pi as se,Ti as P,Tr as F,di as ce,hn as I,in as L,mi as R,nn as z,nr as B,on as V,rn as le,tn as H,wi as U}from"./index-CapYApEL.js";import{t as W}from"./index.es-BeDOj7l9.js";import{t as ue}from"./CopyToClipboard-CoT4M6xJ.js";import{t as de}from"./FilePreview-jTXb2Spm.js";import{t as G}from"./ImagePreview-DBw0YCSw.js";import{n as fe}from"./taskDrawerMixin-DyAUhFEq.js";import{t as K}from"./Consumption-C1ALJh9G.js";import{i as q,n as pe,t as me}from"./pagination-Df_omtLz.js";import{t as he}from"./VideoPlayer-NexTZScZ.js";import{t as ge}from"./ApiCodeButton-mvKRd2vS.js";import{t as _e}from"./BotPlaceholder-DqU8f5Fh.js";import{t as ve}from"./NoTasks-C1NCAjA5.js";import{t as ye}from"./PromptTextarea-BDqu8og3.js";var be=v({name:`LayoutKling`,components:{ElDrawer:D,ElButton:N,FontAwesomeIcon:W},mixins:[fe]}),xe={class:`main flex flex-row flex-1 min-h-0`},Se={class:`config w-[320px] flex-none h-full flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Ce={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function we(t,n,r,i,o,c){let f=l(`font-awesome-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,xe,[e(`div`,Se,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Ce,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{icon:`fa-solid fa-magic`})]),_:1},512),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`350px`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Te=j(be,[[`render`,we],[`__scopeId`,`data-v-b87958dc`]]),Ee={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1};function J(e,t,n){let r=t||`std`,i=n??5;switch(e){case`kling-v1`:return{text2video:!0,image2video:!0,endImage:i===5,audio:!1,motionControl:i===5,referenceVideo:!1};case`kling-v1-6`:case`kling-v2-5-turbo`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:!1,motionControl:!1,referenceVideo:!1};case`kling-v2-6`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:r===`pro`,motionControl:!1,referenceVideo:!1};case`kling-v2-master`:case`kling-v2-1-master`:return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1};case`kling-v3`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:r!==`4k`,referenceVideo:!1};case`kling-v3-omni`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1,referenceVideo:!1};case`kling-video-o1`:return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1,referenceVideo:!0};default:return Ee}}var Y=`<<<video_1>>>`;function De(e){return e?e.split(Y).join(` `).replace(/\s{2,}/g,` `).trim():``}function X(e,t){if(!e)return[];let n=t.model??e.model,r=t.mode??e.mode,i=t.duration??e.duration;if(!n)return[];let a=J(n,r,i),o=[];return e.end_image_url&&!a.endImage&&o.push({field:`end_image_url`,i18nLabel:`kling.name.endImage`}),e.generate_audio&&!a.audio&&o.push({field:`generate_audio`,i18nLabel:`kling.name.generateAudio`}),e.camera_control?.type&&(!a.motionControl||e.start_image_url)&&o.push({field:`camera_control`,i18nLabel:`kling.name.cameraControl`}),e.video_list?.length&&!a.referenceVideo&&o.push({field:`video_list`,i18nLabel:`kling.name.referenceVideo`}),o}function Z(e,t){let n={...e};for(let e of t)e.field===`end_image_url`&&(n.end_image_url=void 0),e.field===`generate_audio`&&(n.generate_audio=!1),e.field===`camera_control`&&(n.camera_control=void 0),e.field===`video_list`&&(n.video_list=void 0,n.prompt=De(n.prompt));return n}var Oe=v({name:`ModelSelector`,components:{ElSelect:b,ElOption:x},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(ae)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=X(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await U.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=Z({...t,model:e},n);this.$store.commit(`kling/setConfig`,i),P.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,model:e})}}}),ke={class:`field`},Ae={class:`title font-bold`};function je(t,n,r,a,o,u){let d=l(`el-option`),m=l(`el-select`);return g(),s(`div`,ke,[e(`h2`,Ae,i(t.$t(`pika.name.model`)),1),(g(),f(m,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`pika.placeholder.select`),onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(d,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var Me=j(Oe,[[`render`,je],[`__scopeId`,`data-v-04059875`]]),Ne=v({name:`ModeSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:q},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 A.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(`std`)}},mounted(){this.value||this.applyMode(`std`)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=X(t,{mode:e});if(n.length===0){this.applyMode(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await U.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=Z({...t,mode:e},n);this.$store.commit(`kling/setConfig`,i),P.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyMode(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,mode:e})}}}),Pe={class:`field`},Fe={class:`header`},Ie={class:`title font-bold`},Le={key:0,class:`opt-tip`};function Re(t,r,u,d,m,_){let v=l(`info-icon`),y=l(`el-option`),b=l(`el-select`);return g(),s(`div`,Pe,[e(`div`,Fe,[e(`h2`,Ie,i(t.$t(`kling.name.mode`)),1),a(v,{content:t.$t(`kling.description.mode`),class:`info-icon`},null,8,[`content`])]),(g(),f(b,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`kling.placeholder.select`),clearable:!0,onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.options,t=>(g(),f(y,{key:t.value,label:t.label,value:t.value,disabled:t.disabled},{default:p(()=>[e(`span`,{class:n({"opt-disabled":t.disabled})},i(t.label),3),t.disabled&&t.disabledReason?(g(),s(`span`,Le,i(t.disabledReason),1)):o(``,!0)]),_:2},1032,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var ze=j(Ne,[[`render`,Re],[`__scopeId`,`data-v-9a8fa3c5`]]),Be=[3,5,8,10,12,15],Ve=[5,10],He=v({name:`DurationSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:q},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},isV3Model(){return A.includes(this.selectedModel)},allowedDurations(){return this.isV3Model?Be:Ve},value(){return this.$store.state.kling?.config?.duration??5},selectValue(){let e=this.allowedDurations;return e.includes(this.value)?this.value:e.includes(5)?5:e[0]}},watch:{isV3Model(){this.allowedDurations.includes(this.value)||this.applyDuration(5)}},mounted(){this.$store.state.kling?.config?.duration||this.applyDuration(5)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=X(t,{duration:e});if(n.length===0){this.applyDuration(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await U.confirm(this.$t(`kling.message.featureNotSupportedBody`,{fields:r}),this.$t(`kling.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`kling.button.confirmContinue`),cancelButtonText:this.$t(`kling.button.cancelSwitch`),type:`warning`});let i=Z({...t,duration:e},n);this.$store.commit(`kling/setConfig`,i),P.success(this.$t(`kling.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyDuration(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling.config,duration:e})}}}),Ue={class:`field`},We={class:`control`},Ge={class:`label`},Ke={class:`title font-bold`};function qe(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Ue,[e(`div`,We,[e(`div`,Ge,[e(`h2`,Ke,i(t.$t(`kling.name.duration`)),1),a(m,{content:t.$t(`kling.description.duration`),class:`info-icon ml-1`},null,8,[`content`])]),(g(),f(v,{key:t.revertKey,"model-value":t.selectValue,class:`value`,placeholder:t.$t(`kling.placeholder.select`),onChange:t.onChange},{default:p(()=>[(g(!0),s(c,null,h(t.allowedDurations,e=>(g(),f(_,{key:e,label:`${e}s`,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])])}var Je=j(He,[[`render`,qe],[`__scopeId`,`data-v-5ae55e28`]]),Ye=v({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||=`1:1`}}),Xe={class:`text-sm font-bold mb-2 block`},Ze={class:`items`},Qe=[`onClick`],$e={class:`name`};function et(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,Xe,i(t.$t(`kling.name.ratio`)),1),e(`div`,Ze,[(g(!0),s(c,null,h(t.options,(r,a)=>(g(),s(`div`,{key:a,class:n({active:t.active===a,item:!0}),onClick:e=>t.value=r.value},[e(`div`,{class:n([`preview`,r.label])},[e(`div`,{class:`rect`,style:m({width:r.width+`px`,height:r.height+`px`})},null,4)],2),e(`p`,$e,i(r.label),1)],10,Qe))),128))])])}var tt=j(Ye,[[`render`,et],[`__scopeId`,`data-v-cdb14b2f`]]),nt=v({name:`StartImage`,components:{ElUpload:w,ElButton:N,ElTooltip:T,InfoIcon:q,FontAwesomeIcon:W,ImagePreview:G},mixins:[L,z],emits:[`change`],data(){return{fileList:[],uploadUrl:R()+`/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||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){P.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){P.error(this.$t(`kling.message.uploadReferencesError`))},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),rt={class:`relative`},it={class:`flex justify-between`},at={class:`flex justify-start items-center`},ot={class:`text-sm font-bold`};function st(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,rt,[e(`div`,it,[e(`div`,at,[e(`span`,ot,i(t.$t(`kling.name.startImage`)),1),a(h,{content:t.$t(`kling.description.uploadStartImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,disabled:t.reachedLimit,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.$t(`kling.message.uploadReferencesExceed`),disabled:!t.reachedLimit,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.reachedLimit},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$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`])])}var ct=j(nt,[[`render`,st],[`__scopeId`,`data-v-756dc269`]]),lt=v({name:`EndImage`,components:{ElUpload:w,ElButton:N,ElTooltip:T,ImagePreview:G,InfoIcon:q,FontAwesomeIcon:W},mixins:[L,z],data(){return{fileList:[],uploadUrl:R()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},klingConfig(){return this.$store.state?.kling?.config||{}},endImageSupported(){return J(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},hasStartImage(){return!!this.klingConfig.start_image_url},uploadDisabled(){return this.reachedLimit||!this.endImageSupported||!this.hasStartImage},uploadTooltip(){return this.endImageSupported?this.hasStartImage?this.reachedLimit?this.$t(`kling.message.uploadReferencesExceed`):``:this.$t(`kling.message.endImageRequiresStart`):this.$t(`kling.message.endImageNotSupported`)},storeValue(){return this.klingConfig.end_image_url},value:{get(){return this.storeValue},set(){}}},watch:{storeValue(e){!e&&this.fileList.length>0&&(this.fileList=[])},hasStartImage(e){!e&&this.storeValue&&(this.fileList=[],this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,end_image_url:void 0}))}},mounted(){this.value||=void 0,this.onSetEndImageUrl()},methods:{onBeforeUpload(){return this.endImageSupported?this.hasStartImage?!0:(P.warning(this.$t(`kling.message.endImageRequiresStart`)),!1):(P.warning(this.$t(`kling.message.endImageNotSupported`)),!1)},onExceed(){P.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){P.error(this.$t(`kling.message.uploadReferencesError`))},onSetEndImageUrl(){let 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`},dt={class:`flex justify-between`},ft={class:`flex justify-start items-center`},pt={class:`text-sm font-bold`};function mt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,ut,[e(`div`,dt,[e(`div`,ft,[e(`span`,pt,i(t.$t(`kling.name.endImage`)),1),a(h,{content:t.$t(`kling.description.uploadEndImage`)},null,8,[`content`])])]),a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,disabled:t.uploadDisabled,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"before-upload":t.onBeforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(b,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$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`])])}var ht=j(lt,[[`render`,mt],[`__scopeId`,`data-v-c1b257e5`]]),gt=v({name:`ReferenceVideo`,components:{ElUpload:w,ElButton:N,InfoIcon:q,FilePreview:de,FontAwesomeIcon:W},mixins:[z],data(){return{fileList:[],uploadUrl:R()+`/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(){P.warning(this.$t(`kling.message.referenceVideoExceed`))},onError(){P.error(this.$t(`kling.message.referenceVideoError`))},beforeUpload(e){let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=e.size/1024/1024<200;return t?n?!0:(P.error(this.$t(`kling.message.referenceVideoSizeExceed`)),!1):(P.error(this.$t(`kling.message.referenceVideoTypeFailed`)),!1)},ensurePromptToken(e){let t=this.$store.state.kling?.config,n=t?.prompt||``,r=n.includes(Y),i;if(e&&!r)i=n?`${n} ${Y}`:Y;else if(!e&&r)i=De(n);else return;this.$store.commit(`kling/setConfig`,{...t,prompt:i})},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,video_list:void 0}),this.ensurePromptToken(!1)},onSetVideoList(){let e=this.urls?.[0],t=e?[{video_url:e,refer_type:`base`,keep_original_sound:`no`}]:void 0;this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,video_list:t}),this.ensurePromptToken(!!e)},async onSuccess(){this.onSetVideoList()}}}),_t={class:`relative`},vt={class:`flex justify-between`},yt={class:`flex justify-start items-center`},bt={class:`text-sm font-bold`};function xt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,_t,[e(`div`,vt,[e(`div`,yt,[e(`span`,bt,i(t.$t(`kling.name.referenceVideo`)),1),a(h,{content:t.$t(`kling.description.referenceVideo`)},null,8,[`content`])])]),a(b,{"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4,.mov`,name:`file`,class:`value`,"show-file-list":!0,limit:1,multiple:!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.percentage===void 0?o(``,!0):(g(),f(_,{key:0,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadReferenceVideo`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var St=j(gt,[[`render`,xt],[`__scopeId`,`data-v-dcdf8068`]]),Ct=v({name:`CfgScaleSelector`,components:{ElSlider:k,InfoIcon:q,ElInputNumber:O},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||=0}}),wt={class:`flex justify-between`},Tt={class:`flex justify-start items-center`},Et={class:`text-sm font-bold`},Dt={class:`flex justify-end items-center`},Ot={class:`w-full`};function kt(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`),p=l(`el-slider`);return g(),s(`div`,null,[e(`div`,wt,[e(`div`,Tt,[e(`span`,Et,i(t.$t(`kling.name.cfgScale`)),1),a(d,{content:t.$t(`kling.description.cfgScale`)},null,8,[`content`])]),e(`div`,Dt,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,Ot,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:0,max:1,step:.1},null,8,[`modelValue`])])])}var At=j(Ct,[[`render`,kt]]),jt=v({name:`GenerateAudioSelector`,components:{ElSwitch:re,InfoIcon:q},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},selectedMode(){return this.$store.state.kling?.config?.mode||``},supported(){return!!(A.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??!1:!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})}}}),Mt={class:`relative`},Nt={class:`flex justify-between items-center`},Pt={class:`flex justify-start items-center`},Ft={class:`text-sm font-bold`};function It(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Mt,[e(`div`,Nt,[e(`div`,Pt,[e(`span`,Ft,i(t.$t(`kling.name.generateAudio`)),1),a(d,{content:t.tooltipContent},null,8,[`content`])]),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,disabled:!t.supported},null,8,[`modelValue`,`disabled`])])])}var Lt=j(jt,[[`render`,It]]),Rt=[`horizontal`,`vertical`,`pan`,`tilt`,`roll`,`zoom`],zt=v({name:`CameraControlSelector`,components:{ElSelect:b,ElOption:x,ElSlider:k,ElInputNumber:O,InfoIcon:q},data(){return{configKeys:Rt}},computed:{typeOptions(){return[{value:``,label:this.$t(`kling.name.cameraTypeNone`)},{value:`simple`,label:this.$t(`kling.name.cameraTypeSimple`)},{value:`down_back`,label:this.$t(`kling.name.cameraTypeDownBack`)},{value:`forward_up`,label:this.$t(`kling.name.cameraTypeForwardUp`)},{value:`left_turn_forward`,label:this.$t(`kling.name.cameraTypeLeftTurnForward`)},{value:`right_turn_forward`,label:this.$t(`kling.name.cameraTypeRightTurnForward`)}]},selectedMode(){return this.$store.state.kling?.config?.mode||``},selectedModel(){return this.$store.state.kling?.config?.model||``},selectedDuration(){return this.$store.state.kling?.config?.duration},motionControlSupported(){return J(this.selectedModel,this.selectedMode,this.selectedDuration).motionControl},hasStartImage(){return!!this.$store.state.kling?.config?.start_image_url},disabled(){return!this.motionControlSupported||this.hasStartImage},tooltipContent(){return this.motionControlSupported?this.hasStartImage?this.$t(`kling.description.cameraControlDisabledImage2Video`):this.$t(`kling.description.cameraControl`):this.$t(`kling.description.cameraControlNotSupported`)},selectedType(){return this.$store.state.kling?.config?.camera_control?.type},selectedTypeRaw:{get(){return this.selectedType??``},set(e){let t=this.$store.state.kling?.config||{};if(!e){let e={...t};delete e.camera_control,this.$store.commit(`kling/setConfig`,e);return}let n=e;this.$store.commit(`kling/setConfig`,{...t,camera_control:{type:n,config:n===`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){let n=this.$store.state.kling?.config||{},r=n.camera_control||{type:`simple`},i={...r.config||{}};t==null?delete i[e]:i[e]=t,this.$store.commit(`kling/setConfig`,{...n,camera_control:{...r,type:`simple`,config:i}})},onSliderChange(e,t){this.writeConfig(e,t)},onNumberChange(e,t){this.writeConfig(e,t)}}}),Bt={class:`field`},Vt={class:`header`},Ht={class:`text-sm font-bold`},Ut={key:0,class:`config-grid`},Wt={class:`cfg-row-head`},Gt={class:`cfg-name`};function Kt(t,n,r,u,d,m){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-select`),b=l(`el-input-number`),x=l(`el-slider`);return g(),s(`div`,Bt,[e(`div`,Vt,[e(`span`,Ht,i(t.$t(`kling.name.cameraControl`)),1),a(_,{content:t.tooltipContent},null,8,[`content`])]),a(y,{modelValue:t.selectedTypeRaw,"onUpdate:modelValue":n[0]||=e=>t.selectedTypeRaw=e,class:`value`,placeholder:t.$t(`kling.placeholder.cameraType`),clearable:!0,disabled:t.disabled},{default:p(()=>[(g(!0),s(c,null,h(t.typeOptions,e=>(g(),f(v,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`]),t.selectedType===`simple`&&!t.disabled?(g(),s(`div`,Ut,[(g(!0),s(c,null,h(t.configKeys,n=>(g(),s(`div`,{key:n,class:`cfg-row`},[e(`div`,Wt,[e(`span`,Gt,i(t.$t(`kling.name.cc_${n}`)),1),a(b,{modelValue:t.configValues[n],"onUpdate:modelValue":e=>t.configValues[n]=e,min:-1,max:1,step:.1,precision:1,"controls-position":`right`,size:`small`,class:`cfg-num`,onChange:e=>t.onNumberChange(n,e)},null,8,[`modelValue`,`onUpdate:modelValue`,`onChange`])]),a(x,{"model-value":t.configValues[n]??0,min:-1,max:1,step:.1,onInput:e=>t.onSliderChange(n,e)},null,8,[`model-value`,`onInput`])]))),128))])):o(``,!0)])}var qt=j(zt,[[`render`,Kt],[`__scopeId`,`data-v-cd896060`]]),Jt=[{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`]}],Q=`, `;function Yt(e,t){let n=(e||``).trim();return n?n.includes(t)?n:`${n}${Q}${t}`:t}function $(e,t){if(!e||!t)return e||``;let n=[`${t}${Q}`,`${Q}${t}`,t],r=e;for(let e of n)if(r.includes(e)){r=r.replace(e,``);break}return r.replace(/(?:,\s*)+$/,``).replace(/^(?:,\s*)+/,``)}var Xt=v({name:`InspirationPills`,components:{FontAwesomeIcon:W},computed:{prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return Jt.flatMap(e=>e.chipKeys.map(e=>this.$t(`kling.inspiration.chip.${e}`)))},selected(){let e=this.prompt;if(!e)return[];let t=[];for(let n of this.allChipTexts){let r=e.indexOf(n);r!==-1&&t.push({text:n,idx:r})}return t.sort((e,t)=>e.idx-t.idx).map(e=>e.text)}},methods:{onRemove(e){let t=$(this.prompt,e);this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:t})}}}),Zt={key:0,class:`pills`,role:`list`},Qt={class:`pill-text`},$t=[`aria-label`,`onClick`];function en(n,r,u,d,f,p){let m=l(`font-awesome-icon`);return n.selected.length>0?(g(),s(`div`,Zt,[(g(!0),s(c,null,h(n.selected,r=>(g(),s(`div`,{key:r,class:`pill`,role:`listitem`},[e(`span`,Qt,i(r),1),e(`button`,{type:`button`,class:`pill-remove`,"aria-label":n.$t(`kling.inspiration.removeChip`),onClick:t(e=>n.onRemove(r),[`stop`])},[a(m,{icon:`fa-solid fa-xmark`})],8,$t)]))),128))])):o(``,!0)}var tn=v({name:`PromptInput`,components:{ElButton:N,FontAwesomeIcon:W,PromptTextarea:ye,InspirationPills:j(Xt,[[`render`,en],[`__scopeId`,`data-v-5fc4fa65`]])},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||=``}});function nn(e,t,n,o,s,c){let u=l(`font-awesome-icon`),d=l(`el-button`),m=l(`inspiration-pills`),h=l(`prompt-textarea`);return g(),f(h,{modelValue:e.prompt,"onUpdate:modelValue":t[1]||=t=>e.prompt=t,title:e.$t(`kling.name.prompt`),info:e.$t(`kling.description.prompt`),placeholder:e.$t(`kling.placeholder.prompt`)},{actions:p(()=>[a(d,{text:``,size:`small`,class:`inspiration-btn`,onClick:t[0]||=t=>e.$emit(`open-inspiration`)},{default:p(()=>[a(u,{icon:`fa-regular fa-lightbulb`,class:`mr-1`}),r(` `+i(e.$t(`kling.inspiration.openButton`)),1)]),_:1})]),before:p(()=>[a(m)]),_:1},8,[`modelValue`,`title`,`info`,`placeholder`])}var rn=j(tn,[[`render`,nn],[`__scopeId`,`data-v-c01fc1a6`]]),an=v({name:`NegativePromptInput`,components:{ElInput:M,InfoIcon:q},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||=``}}),on={class:`field`},sn={class:`box`},cn={class:`title font-bold`};function ln(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,on,[e(`div`,sn,[e(`h2`,cn,i(t.$t(`kling.name.negativePrompt`)),1),a(d,{content:t.$t(`kling.description.negativePrompt`),class:`info`},null,8,[`content`])]),a(f,{modelValue:t.prompt,"onUpdate:modelValue":n[0]||=e=>t.prompt=e,rows:3,type:`textarea`,class:`prompt`,placeholder:t.$t(`kling.placeholder.negativePrompt`)},null,8,[`modelValue`,`placeholder`])])}var un=j(an,[[`render`,ln],[`__scopeId`,`data-v-de98cf01`]]),dn=v({name:`InspirationDrawer`,components:{ElDrawer:D,ElButton:N,FontAwesomeIcon:W},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`],data(){return{groups:Jt,Close:y}},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(e=>this.$t(`kling.inspiration.chip.${e}`)))},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($(this.prompt,e)):this.setPrompt(Yt(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(let t of this.allChipTexts)for(;e.includes(t);)e=$(e,t);this.setPrompt(e)}}}),fn={class:`drawer-content`},pn={class:`drawer-header`},mn={class:`title-row`},hn={class:`title`},gn={class:`hint`},_n={key:0,class:`selected-bar`},vn={class:`selected-text`},yn={class:`groups`},bn={class:`group-title`},xn={class:`chip-grid`},Sn=[`onClick`];function Cn(t,u,d,m,_,v){let y=l(`font-awesome-icon`),b=l(`el-button`),x=l(`el-drawer`);return g(),f(x,{modelValue:t.visible,"onUpdate:modelValue":u[1]||=e=>t.visible=e,direction:`rtl`,"with-header":!1,size:t.drawerSize,"custom-class":`kling-inspiration-drawer`,"destroy-on-close":!1},{default:p(()=>[e(`div`,fn,[e(`div`,pn,[e(`div`,mn,[a(y,{icon:`fa-regular fa-lightbulb`,class:`mr-2`}),e(`span`,hn,i(t.$t(`kling.inspiration.title`)),1)]),a(b,{text:``,icon:t.Close,class:`close-btn`,onClick:u[0]||=e=>t.visible=!1},null,8,[`icon`])]),e(`div`,gn,i(t.$t(`kling.inspiration.hint`)),1),t.selectedCount>0?(g(),s(`div`,_n,[e(`span`,vn,i(t.$t(`kling.inspiration.selectedSummary`,{count:t.selectedCount})),1),a(b,{text:``,size:`small`,class:`clear-btn`,onClick:t.onClearSelected},{default:p(()=>[r(i(t.$t(`kling.inspiration.clearSelected`)),1)]),_:1},8,[`onClick`])])):o(``,!0),e(`div`,yn,[(g(!0),s(c,null,h(t.groups,r=>(g(),s(`div`,{key:r.groupKey,class:`group`},[e(`div`,bn,i(t.$t(`kling.inspiration.group.${r.groupKey}`)),1),e(`div`,xn,[(g(!0),s(c,null,h(r.chipKeys,e=>(g(),s(`button`,{key:e,type:`button`,class:n({chip:!0,active:t.isSelected(t.chipText(e))}),onClick:n=>t.onToggle(t.chipText(e))},i(t.chipText(e)),11,Sn))),128))])]))),128))])])]),_:1},8,[`modelValue`,`size`])}var wn=j(dn,[[`render`,Cn],[`__scopeId`,`data-v-7d457a69`]]),Tn={"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`},En={std:`720p`,pro:`1080p`,"4k":`4K`},Dn=v({name:`SummaryChip`,components:{FontAwesomeIcon:W},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){let e=this.config?.model||`kling-v2-5-turbo`;return Tn[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||``},modeLabel(){let e=this.config?.mode||`std`;return En[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),On={class:`summary-chip`},kn=[`title`],An=[`title`],jn=[`title`],Mn=[`title`],Nn=[`title`];function Pn(t,n,r,c,u,d){let f=l(`font-awesome-icon`);return g(),s(`div`,On,[e(`span`,{class:`part`,title:t.$t(`kling.name.model`)},i(t.modelLabel),9,kn),n[0]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.duration`)},i(t.durationLabel),9,An),n[1]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.ratio`)},i(t.aspectRatio||`16:9`),9,jn),n[2]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.mode`)},i(t.modeLabel),9,Mn),t.generateAudio?(g(),s(`span`,{key:0,class:`audio`,title:t.$t(`kling.name.generateAudio`)},[a(f,{icon:`fa-solid fa-headphones`})],8,Nn)):o(``,!0)])}var Fn=v({name:`ConfigPanel`,components:{ElButton:N,Consumption:K,FontAwesomeIcon:W,PromptInput:rn,NegativePromptInput:un,ModelSelector:Me,ModeSelector:ze,DurationSelector:Je,RatioSelector:tt,StartImage:ct,CfgScaleSelector:At,GenerateAudioSelector:Lt,CameraControlSelector:qt,InspirationDrawer:wn,SummaryChip:j(Dn,[[`render`,Pn],[`__scopeId`,`data-v-418a6733`]]),EndImage:ht,ReferenceVideo:St},emits:[`generate`],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},capabilities(){return J(this.config?.model,this.config?.mode,this.config?.duration)},consumption(){return V(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),In={class:`flex flex-col h-full`},Ln={class:`flex-1 overflow-y-auto p-5`},Rn={class:`flex flex-col items-center justify-center px-5 pb-5`};function zn(t,n,c,u,d,m){let h=l(`prompt-input`),_=l(`model-selector`),v=l(`ratio-selector`),y=l(`reference-video`),b=l(`start-image`),x=l(`end-image`),S=l(`duration-selector`),C=l(`mode-selector`),w=l(`generate-audio-selector`),T=l(`camera-control-selector`),E=l(`cfg-scale-selector`),ee=l(`negative-prompt-input`),te=l(`summary-chip`),ne=l(`consumption`),D=l(`font-awesome-icon`),O=l(`el-button`),k=l(`inspiration-drawer`);return g(),s(`div`,In,[e(`div`,Ln,[a(h,{class:`mb-4`,onOpenInspiration:n[0]||=e=>t.inspirationOpen=!0}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),t.capabilities.referenceVideo?(g(),f(y,{key:0,class:`mb-2`})):o(``,!0),a(b,{class:`mb-2`}),a(x,{class:`mb-2`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`}),a(E,{class:`mb-4`}),a(ee,{class:`mb-4`})]),e(`div`,Rn,[a(te),a(ne,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),t.config?.video_url!==void 0||t.config?.custom?(g(),f(O,{key:0,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(D,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.extend`)),1)]),_:1},8,[`onClick`])):(g(),f(O,{key:1,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(D,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.generate`)),1)]),_:1},8,[`onClick`]))]),a(k,{modelValue:t.inspirationOpen,"onUpdate:modelValue":n[1]||=e=>t.inspirationOpen=e},null,8,[`modelValue`])])}var Bn=j(Fn,[[`render`,zn]]),Vn=v({name:`MotionImage`,components:{ElUpload:w,ElButton:N,InfoIcon:q,FontAwesomeIcon:W,ImagePreview:G},mixins:[L,z],data(){return{fileList:[],uploadUrl:R()+`/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(){P.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){P.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(){let e=this.urls?.[0];this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,image_url:e})},async onSuccess(){this.onSetImageUrl()}}}),Hn={class:`relative`},Un={class:`flex justify-between`},Wn={class:`flex justify-start items-center`},Gn={class:`text-sm font-bold`};function Kn(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,Hn,[e(`div`,Un,[e(`div`,Wn,[e(`span`,Gn,i(t.$t(`kling.name.motionImage`)),1),a(h,{content:t.$t(`kling.description.motionImage`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var qn=j(Vn,[[`render`,Kn],[`__scopeId`,`data-v-e52eaf2f`]]),Jn=v({name:`MotionVideo`,components:{ElUpload:w,ElButton:N,InfoIcon:q,FilePreview:de,FontAwesomeIcon:W},mixins:[z],data(){return{fileList:[],uploadUrl:R()+`/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(){P.warning(this.$t(`kling.message.uploadVideoExceed`))},onError(){P.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){let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=e.size/1024/1024<100;return t?n?!0:(P.error(this.$t(`kling.message.uploadVideoSizeExceed`)),!1):(P.error(this.$t(`kling.message.uploadVideoTypeFailed`)),!1)},onSetVideoUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,video_url:e})},async onSuccess(){this.onSetVideoUrl()}}}),Yn={class:`relative`},Xn={class:`flex justify-between`},Zn={class:`flex justify-start items-center`},Qn={class:`text-sm font-bold`};function $n(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`font-awesome-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,Yn,[e(`div`,Xn,[e(`div`,Zn,[e(`span`,Qn,i(t.$t(`kling.name.motionVideo`)),1),a(h,{content:t.$t(`kling.description.motionVideo`)},null,8,[`content`])])]),a(b,{"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4,.mov`,name:`file`,class:`value`,"show-file-list":!0,limit:1,multiple:!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:p(({file:e})=>[e.percentage===void 0?o(``,!0):(g(),f(_,{key:0,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))]),default:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadVideoUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var er=j(Jn,[[`render`,$n],[`__scopeId`,`data-v-7019a8d2`]]),tr=v({name:`MotionPromptInput`,components:{ElInput:M,InfoIcon:q},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||``},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),nr={class:`field`},rr={class:`box`},ir={class:`title font-bold`};function ar(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,nr,[e(`div`,rr,[e(`h2`,ir,i(t.$t(`kling.name.motionPrompt`)),1),a(d,{content:t.$t(`kling.description.motionPrompt`),class:`info`},null,8,[`content`])]),a(f,{modelValue:t.prompt,"onUpdate:modelValue":n[0]||=e=>t.prompt=e,rows:3,type:`textarea`,class:`prompt`,placeholder:t.$t(`kling.placeholder.motionPrompt`)},null,8,[`modelValue`,`placeholder`])])}var or=j(tr,[[`render`,ar],[`__scopeId`,`data-v-ca9fdbe5`]]),sr=`video`,cr=v({name:`CharacterOrientationSelector`,components:{ElRadioGroup:ne,ElRadioButton:te,InfoIcon:q},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||sr},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=sr)}}),lr={class:`field`},ur={class:`header`},dr={class:`text-sm font-bold`};function fr(t,n,o,c,u,d){let f=l(`info-icon`),m=l(`el-radio-button`),h=l(`el-radio-group`);return g(),s(`div`,lr,[e(`div`,ur,[e(`span`,dr,i(t.$t(`kling.name.characterOrientation`)),1),a(f,{content:t.$t(`kling.description.characterOrientation`)},null,8,[`content`])]),a(h,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,size:`small`,class:`value`},{default:p(()=>[a(m,{label:`image`},{default:p(()=>[r(i(t.$t(`kling.name.orientationImage`)),1)]),_:1}),a(m,{label:`video`},{default:p(()=>[r(i(t.$t(`kling.name.orientationVideo`)),1)]),_:1})]),_:1},8,[`modelValue`])])}var pr=j(cr,[[`render`,fr],[`__scopeId`,`data-v-7a91195b`]]),mr=`kling-v2-6`,hr=v({name:`MotionModelSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:q},computed:{options(){return[{value:`kling-v2-6`,label:`Kling 2.6`},{value:`kling-v3`,label:`Kling 3.0`}]},value:{get(){return this.$store.state.kling?.motionConfig?.model_name||mr},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,model_name:e})}}},mounted(){this.$store.state.kling?.motionConfig?.model_name||(this.value=mr)}}),gr={class:`field`},_r={class:`header`},vr={class:`title font-bold`};function yr(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,gr,[e(`div`,_r,[e(`h2`,vr,i(t.$t(`kling.name.motionModel`)),1),a(m,{content:t.$t(`kling.description.motionModel`)},null,8,[`content`])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var br=j(hr,[[`render`,yr],[`__scopeId`,`data-v-480e8da2`]]),xr=`std`,Sr=v({name:`MotionModeSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:q},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||xr},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=xr)}}),Cr={class:`field`},wr={class:`header`},Tr={class:`title font-bold`};function Er(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Cr,[e(`div`,wr,[e(`h2`,Tr,i(t.$t(`kling.name.mode`)),1),a(m,{content:t.$t(`kling.description.motionMode`)},null,8,[`content`])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Dr=j(Sr,[[`render`,Er],[`__scopeId`,`data-v-1295688c`]]),Or=v({name:`KeepOriginalSoundSelector`,components:{ElSwitch:re,InfoIcon:q},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`})}}}}),kr={class:`relative`},Ar={class:`flex justify-between items-center`},jr={class:`flex justify-start items-center`},Mr={class:`text-sm font-bold`};function Nr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,kr,[e(`div`,Ar,[e(`div`,jr,[e(`span`,Mr,i(t.$t(`kling.name.keepOriginalSound`)),1),a(d,{content:t.$t(`kling.description.keepOriginalSound`)},null,8,[`content`])]),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e},null,8,[`modelValue`])])])}var Pr=v({name:`MotionPanel`,components:{ElButton:N,FontAwesomeIcon:W,Consumption:K,MotionImage:qn,MotionVideo:er,MotionPromptInput:or,CharacterOrientationSelector:pr,MotionModelSelector:br,MotionModeSelector:Dr,KeepOriginalSoundSelector:j(Or,[[`render`,Nr]])},emits:[`generate`],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return V({...this.motionConfig,duration:1},this.service?.cost)},service(){return this.$store.state.kling?.service},canGenerate(){let e=this.motionConfig;return!!(e?.image_url&&e?.video_url)}},methods:{onGenerate(){this.$emit(`generate`)}}}),Fr={class:`flex flex-col h-full`},Ir={class:`flex-1 overflow-y-auto p-5`},Lr={class:`flex flex-col items-center justify-center px-5 pb-5`};function Rr(t,n,o,c,u,d){let f=l(`motion-image`),m=l(`motion-video`),h=l(`motion-prompt-input`),_=l(`character-orientation-selector`),v=l(`motion-model-selector`),y=l(`motion-mode-selector`),b=l(`keep-original-sound-selector`),x=l(`consumption`),S=l(`font-awesome-icon`),C=l(`el-button`);return g(),s(`div`,Fr,[e(`div`,Ir,[a(f,{class:`mb-3`}),a(m,{class:`mb-3`}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`})]),e(`div`,Lr,[a(x,{value:t.consumption,service:t.service,"rate-unit":t.$t(`kling.name.perSecond`),note:t.$t(`kling.message.motionPricingNote`)},null,8,[`value`,`service`,`rate-unit`,`note`]),a(C,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(S,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.generateMotion`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var zr=j(Pr,[[`render`,Rr]]),Br=v({name:`KlingTabSwitcher`,components:{ElTabs:S,ElTabPane:C,ElTag:se},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`)},{value:`talking-photo`,label:this.$t(`kling.tab.talkingPhoto`)}]}},methods:{onUpdate(e){this.$emit(`update:modelValue`,e)}}}),Vr=[`title`],Hr={class:`text`};function Ur(t,n,a,u,d,m){let _=l(`el-tag`),v=l(`el-tab-pane`),y=l(`el-tabs`);return g(),f(y,{"model-value":t.modelValue,class:`kling-tabs`,stretch:``,"onUpdate:modelValue":t.onUpdate},{default:p(()=>[(g(!0),s(c,null,h(t.tabs,t=>(g(),f(v,{key:t.value,name:t.value,disabled:t.disabled},{label:p(()=>[e(`span`,{class:`tab-label`,title:t.disabled?t.disabledReason:void 0},[e(`span`,Hr,i(t.label),1),t.badge?(g(),f(_,{key:0,size:`small`,type:`warning`,class:`badge`},{default:p(()=>[r(i(t.badge),1)]),_:2},1024)):o(``,!0)],8,Vr)]),_:2},1032,[`name`,`disabled`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var Wr=j(Br,[[`render`,Ur],[`__scopeId`,`data-v-fda33e4c`]]),Gr={"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`},Kr=v({name:`TalkingPhotoModelSelector`,components:{ElSelect:b,ElOption:x},data(){return{options:oe.map(e=>({value:e,label:Gr[e]||e}))}},computed:{value:{get(){return this.$store.state.kling?.talkingPhotoConfig?.model||`kling-v2-1-master`},set(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.$store.state.kling?.talkingPhotoConfig,model:e})}}},mounted(){this.$store.state.kling?.talkingPhotoConfig?.model||(this.value=ie)}}),qr={class:`field`},Jr={class:`title font-bold`};function Yr(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,qr,[e(`h2`,Jr,i(t.$t(`kling.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Xr=j(Kr,[[`render`,Yr],[`__scopeId`,`data-v-cbc83d11`]]),Zr=v({name:`TalkingPhotoModeSelector`,components:{ElSelect:b,ElOption:x},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?.talkingPhotoConfig?.mode||`pro`},set(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.$store.state.kling?.talkingPhotoConfig,mode:e})}}},mounted(){this.$store.state.kling?.talkingPhotoConfig?.mode||(this.value=`pro`)}}),Qr={class:`field`},$r={class:`title font-bold`};function ei(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Qr,[e(`h2`,$r,i(t.$t(`kling.name.mode`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`kling.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(m,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var ti=v({name:`TalkingPhotoPanel`,components:{ElUpload:w,ElButton:N,ElInput:M,FontAwesomeIcon:W,Consumption:K,InfoIcon:q,ImagePreview:G,ModelSelector:Xr,ModeSelector:j(Zr,[[`render`,ei],[`__scopeId`,`data-v-92525a1d`]])},mixins:[z],emits:[`generate`],data(){return{imageFiles:[],audioFiles:[],uploadUrl:R()+`/api/v1/files/`}},computed:{config(){return this.$store.state.kling?.talkingPhotoConfig||{}},audioUrl(){return this.config.audio_url},headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},service(){return this.$store.state.kling?.service},consumption(){return V({...this.config,action:`talking-photo`},this.service?.cost)},canGenerate(){return!!(this.config.image_url&&this.config.audio_url)}},methods:{commit(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.config,...e})},onPromptChange(e){this.commit({prompt:e})},onImageExceed(){P.warning(this.$t(`kling.message.uploadReferencesExceed`))},onImageError(){P.error(this.$t(`kling.message.uploadReferencesError`))},onImageSuccess(e){this.commit({image_url:e?.file_url})},onImageRemove(e){this.imageFiles.splice(this.imageFiles.indexOf(e),1),this.commit({image_url:void 0})},onAudioExceed(){P.warning(this.$t(`kling.message.uploadAudioExceed`))},onAudioError(){P.error(this.$t(`kling.message.uploadAudioError`))},onAudioSuccess(e){this.commit({audio_url:e?.file_url})},onAudioRemove(){this.commit({audio_url:void 0})},onGenerate(){this.$emit(`generate`)}}}),ni={class:`flex flex-col h-full`},ri={class:`flex-1 overflow-y-auto p-5`},ii={class:`relative mb-4`},ai={class:`flex justify-start items-center`},oi={class:`text-sm font-bold`},si={class:`relative mb-4`},ci={class:`flex justify-start items-center`},li={class:`text-sm font-bold`},ui=[`src`],di={class:`mb-4`},fi={class:`flex justify-start items-center`},pi={class:`text-sm font-bold`},mi={class:`flex flex-col items-center justify-center px-5 pb-5`};function hi(t,n,c,u,d,m){let h=l(`model-selector`),_=l(`mode-selector`),v=l(`info-icon`),y=l(`image-preview`),b=l(`font-awesome-icon`),x=l(`el-button`),S=l(`el-upload`),C=l(`el-input`),w=l(`consumption`);return g(),s(`div`,ni,[e(`div`,ri,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),e(`div`,ii,[e(`div`,ai,[e(`span`,oi,i(t.$t(`kling.name.talkingPhotoImage`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoImage`)},null,8,[`content`])]),a(S,{ref:`imageUploader`,"file-list":t.imageFiles,"onUpdate:fileList":n[0]||=e=>t.imageFiles=e,name:`file`,accept:`.png,.jpg,.jpeg,.webp,.bmp`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,headers:t.headers,"on-exceed":t.onImageExceed,"on-error":t.onImageError,"on-success":t.onImageSuccess},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(y,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onImageRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(x,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(b,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`])]),e(`div`,si,[e(`div`,ci,[e(`span`,li,i(t.$t(`kling.name.talkingPhotoAudio`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoAudio`)},null,8,[`content`])]),a(S,{ref:`audioUploader`,"file-list":t.audioFiles,"onUpdate:fileList":n[1]||=e=>t.audioFiles=e,name:`file`,accept:`.mp3,.wav,.m4a,.aac`,limit:1,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,headers:t.headers,"on-exceed":t.onAudioExceed,"on-error":t.onAudioError,"on-success":t.onAudioSuccess,"on-remove":t.onAudioRemove},{default:p(()=>[a(x,{round:``,type:`primary`,size:`small`,class:`btn`},{default:p(()=>[a(b,{icon:`fa-solid fa-upload`,class:`icon mr-1`}),r(` `+i(t.$t(`kling.button.uploadAudio`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`,`on-remove`]),t.audioUrl?(g(),s(`audio`,{key:0,src:t.audioUrl,controls:``,class:`w-full mt-2`},null,8,ui)):o(``,!0)]),e(`div`,di,[e(`div`,fi,[e(`span`,pi,i(t.$t(`kling.name.talkingPhotoPrompt`)),1),a(v,{content:t.$t(`kling.description.talkingPhotoPrompt`)},null,8,[`content`])]),a(C,{"model-value":t.config.prompt,type:`textarea`,rows:2,placeholder:t.$t(`kling.placeholder.talkingPhotoPrompt`),class:`mt-1`,"onUpdate:modelValue":t.onPromptChange},null,8,[`model-value`,`placeholder`,`onUpdate:modelValue`])])]),e(`div`,mi,[a(w,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(x,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(b,{icon:`fa-solid fa-magic`,class:`mr-2`}),r(` `+i(t.$t(`kling.button.generateTalkingPhoto`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var gi=j(ti,[[`render`,hi],[`__scopeId`,`data-v-27261e35`]]),_i=v({name:`TaskPreview`,components:{ElImage:E,CopyToClipboard:ue,FontAwesomeIcon:W,ElAlert:ee,VideoPlayer:he,ElTooltip:T,ElButton:N,ImagePreview:G,ApiCodeButton:ge},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.kling?.application},config(){return this.$store.state.kling?.config},referenceImages(){let e=[],t=this.modelValue?.request?.start_image_url,n=this.modelValue?.request?.end_image_url;return t&&e.push({url:t,name:`start-image`}),n&&e.push({url:n,name:`end-image`}),e}},methods:{onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),vi={class:`preview`},yi={class:`left`},bi={class:`main`},xi={class:`bot`},Si={class:`datetime`},Ci={class:`info`},wi={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Ti={key:1,class:`prompt mt-2`},Ei={key:0},Di={key:1},Oi={key:0,class:n({content:!0,failed:!0})},ki={key:0,class:`mb-4`},Ai={key:1,class:n({operations:!0,"mt-2":!0})},ji={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Mi={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ni={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Pi={key:1,class:n({content:!0})},Fi={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ii={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Li={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ri={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},zi={key:2,class:n({content:!0})},Bi={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Vi={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Hi(t,n,u,d,m,_){let v=l(`el-image`),y=l(`image-preview`),b=l(`video-player`),x=l(`el-button`),S=l(`el-tooltip`),C=l(`api-code-button`),w=l(`font-awesome-icon`),T=l(`copy-to-clipboard`),E=l(`el-alert`);return g(),s(`div`,vi,[e(`div`,yi,[a(v,{src:`https://cdn.acedata.cloud/qpbbbb.jpg`,class:`avatar`})]),e(`div`,bi,[e(`div`,xi,[r(i(t.$t(`kling.name.klingBot`))+` `,1),e(`span`,Si,i(t.$dayjs.format(``+new Date(parseFloat((t.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,Ci,[t.referenceImages.length>0?(g(),s(`div`,wi,[(g(!0),s(c,null,h(t.referenceImages,(e,t)=>(g(),f(y,{key:t,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),t.modelValue?.request?.prompt?(g(),s(`p`,Ti,[r(i(t.modelValue?.request?.prompt)+` `,1),t.modelValue?.response?o(``,!0):(g(),s(`span`,Ei,` - (`+i(t.$t(`kling.status.pending`))+`) `,1)),t.modelValue?.response?.state===`submitted`||t.modelValue?.response?.state===`processing`||t.modelValue?.response?.state===`pending`||t.modelValue?.response?.state===`completed`?(g(),s(`span`,Di,` - (`+i(t.$t(`kling.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),t.modelValue?.response?.success===!0?(g(),s(`div`,Oi,[t.modelValue?.response.video_url?(g(),s(`div`,ki,[a(b,{src:t.modelValue?.response.video_url},null,8,[`src`])])):o(``,!0),t.modelValue?.response.success?(g(),s(`div`,Ai,[a(S,{class:`box-item`,effect:`dark`,content:t.$t(`kling.message.downloadVideo`),placement:`top-start`},{default:p(()=>[t.modelValue?.response.video_url?(g(),f(x,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:n[0]||=e=>t.onDownload(e,t.modelValue?.response.video_url)},{default:p(()=>[r(i(t.$t(`kling.button.download`)),1)]),_:1})):o(``,!0)]),_:1},8,[`content`]),a(C,{path:`/kling/videos`,body:t.modelValue?.request},null,8,[`body`])])):o(``,!0),a(E,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,ji,[a(w,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.model`))+`: `+i(t.modelValue?.request?.model),1)]),e(`p`,Mi,[a(w,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(T,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.elapsed?(g(),s(`p`,Ni,[a(w,{icon:`fa-solid fa-clock`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.elapsed`))+`: `+i(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),t.modelValue?.response?.success===!1?(g(),s(`div`,Pi,[a(E,{closable:!1,class:`failure`},{template:p(()=>[a(w,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,Fi,[a(w,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(T,{content:t.modelValue?.id},null,8,[`content`])]),e(`p`,Ii,[a(w,{icon:`fa-solid fa-circle-info`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.failureReason`))+`: `+i(t.modelValue?.response?.error?.message)+` `,1),a(T,{content:t.modelValue?.response?.error?.message},null,8,[`content`])]),t.modelValue?.elapsed?(g(),s(`p`,Li,[a(w,{icon:`fa-solid fa-clock`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.elapsed`))+`: `+i(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),t.modelValue?.response?.trace_id?(g(),s(`p`,Ri,[a(w,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.traceId`))+`: `+i(t.modelValue?.response?.trace_id)+` `,1),a(T,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),t.modelValue?.response?.success===void 0?(g(),s(`div`,zi,[a(E,{closable:!1,class:`info`},{template:p(()=>[a(w,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,Bi,[a(w,{icon:`fa-solid fa-magic`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(T,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.response?.trace_id?(g(),s(`p`,Vi,[a(w,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),r(` `+i(t.$t(`kling.name.traceId`))+`: `+i(t.modelValue?.response?.trace_id)+` `,1),a(T,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var Ui=v({name:`RecentPanel`,components:{TaskPreview:j(_i,[[`render`,Hi],[`__scopeId`,`data-v-c36bfd7f`]]),NoTasks:ve,BotPlaceholder:_e,ScrollList:pe},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?.()}}}),Wi={key:0},Gi={key:2,class:`w-full h-full flex items-center justify-center`};function Ki(e,t,n,r,i,u){let d=l(`bot-placeholder`),m=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return g(),s(c,null,[e.tasks?.items===void 0?(g(),s(`div`,Wi,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`h-full w-full overflow-y-auto tasks`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,e=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,Gi,[a(v)])):o(``,!0)],64)}var qi=v({name:`KlingIndex`,components:{ConfigPanel:Bn,MotionPanel:zr,TalkingPhotoPanel:gi,TabSwitcher:Wr,Layout:Te,RecentPanel:j(Ui,[[`render`,Ki]])},mixins:[le],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===ce.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===ce.Request||this.fetchingTasks},credential(){return this.$store.state.kling.credential},config(){return this.$store.state.kling.config},motionConfig(){return this.$store.state.kling.motionConfig},talkingPhotoConfig(){return this.$store.state.kling.talkingPhotoConfig},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 me({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();let 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);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`kling/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!H(this.uploadTracker,e=>this.$t(e),e=>P.warning(e)))return;let{camera_control:e,...t}=this.config||{},n={...t,async:!0};if(!n.video_id&&!t.video_url&&!n.start_image_url&&n.end_image_url){P.warning(this.$t(`kling.message.endImageRequiresStart`));return}if(n.action||(n.video_id||t.video_url?n.action=`extend`:n.start_image_url?n.action=`image2video`:n.action=`text2video`),n.action===`text2video`&&n.end_image_url&&delete n.end_image_url,e?.type&&(n.camera_control={type:e.type,...e.type===`simple`&&e.config?{config:Object.fromEntries(Object.entries(e.config).filter(([,e])=>e!=null))}:{}}),!I())return;let r=this.credential?.token;if(!r){console.error(`no token specified`);return}P.info(this.$t(`kling.message.startingTask`)),F(`kling`,B.generate(n,{token:r})).then(()=>{P.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?P.error(this.$t(`kling.message.usedUp`)):P.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(){if(!H(this.uploadTracker,e=>this.$t(e),e=>P.warning(e)))return;let e=this.motionConfig||{};if(!e.image_url||!e.video_url){P.warning(this.$t(`kling.message.motionMissingInputs`));return}let 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.model_name?{model_name:e.model_name}:{},...e.prompt?{prompt:e.prompt}:{},async:!0};if(!I())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}P.info(this.$t(`kling.message.startingTask`)),F(`kling`,B.motion(t,{token:n})).then(()=>{P.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?P.error(this.$t(`kling.message.usedUp`)):P.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},async onGenerateTalkingPhoto(){if(!H(this.uploadTracker,e=>this.$t(e),e=>P.warning(e)))return;let e=this.talkingPhotoConfig||{};if(!e.image_url||!e.audio_url){P.warning(this.$t(`kling.message.talkingPhotoMissingInputs`));return}let t={image_url:e.image_url,audio_url:e.audio_url,model:e.model||`kling-v2-1-master`,mode:e.mode||`pro`,...e.prompt?{prompt:e.prompt}:{},...e.duration?{duration:e.duration}:{},async:!0};if(!I())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}P.info(this.$t(`kling.message.startingTask`)),F(`kling`,B.talkingPhoto(t,{token:n})).then(()=>{P.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?P.error(this.$t(`kling.message.usedUp`)):P.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),Ji={class:`flex flex-col h-full`},Yi={class:`flex-1 min-h-0`};function Xi(t,n,r,i,s,c){let u=l(`tab-switcher`),d=l(`config-panel`),m=l(`motion-panel`),h=l(`talking-photo-panel`),_=l(`recent-panel`),v=l(`layout`);return g(),f(v,null,{config:p(()=>[e(`div`,Ji,[a(u,{"model-value":t.taskType,"onUpdate:modelValue":t.onTabChange},null,8,[`model-value`,`onUpdate:modelValue`]),e(`div`,Yi,[t.taskType===`videos`?(g(),f(d,{key:0,onGenerate:t.onGenerate},null,8,[`onGenerate`])):t.taskType===`motion`?(g(),f(m,{key:1,onGenerate:t.onGenerateMotion},null,8,[`onGenerate`])):t.taskType===`talking-photo`?(g(),f(h,{key:2,onGenerate:t.onGenerateTalkingPhoto},null,8,[`onGenerate`])):o(``,!0)])])]),result:p(()=>[a(_,{ref:`recentPanel`,loading:t.loadingMore,onReachTop:t.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Zi=j(qi,[[`render`,Xi]]);export{Zi as default};
|