@acedatacloud/nexior 3.330.11 → 3.330.13
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-S_UyXg4j.js → ApiCodeButton-ESjV90I4.js} +1 -1
- package/dist/assets/{Artifacts-BuOYN_7M.js → Artifacts-Ce-xuRxa.js} +1 -1
- package/dist/assets/{AskUserQuestionCard-kKE9xbet.js → AskUserQuestionCard-Cq27SgYf.js} +1 -1
- package/dist/assets/{AudioPreview-BzHmySK6.js → AudioPreview-6icOwV8b.js} +1 -1
- package/dist/assets/{Auth-b7fTSjg-.js → Auth-CHXgA2-p.js} +1 -1
- package/dist/assets/{Bare-CWezaNWv.js → Bare-CXR7KRJ3.js} +1 -1
- package/dist/assets/{BotPlaceholder-C4saLAYx.js → BotPlaceholder-60Ittost.js} +1 -1
- package/dist/assets/{BottomFooter-Deox_ipm.js → BottomFooter-dQ2kYE7_.js} +1 -1
- package/dist/assets/{Callback-gxyUqpQ1.js → Callback-BtRyalNi.js} +1 -1
- package/dist/assets/{CodeSnippet-DFlyqsjm.js → CodeSnippet-DaFc_zgg.js} +1 -1
- package/dist/assets/{Console-BE2qKHKA.js → Console-DPEfTVtC.js} +1 -1
- package/dist/assets/{Consumption-DVsuzbOV.js → Consumption-C5-QJWxc.js} +1 -1
- package/dist/assets/{Conversation-D5bmrrGp.js → Conversation-CF_8aoBf.js} +1 -1
- package/dist/assets/{Conversation-CiOj0RM7.js → Conversation-DHEAZsRi.js} +1 -1
- package/dist/assets/{CopyToClipboard-CRR8YgjD.js → CopyToClipboard-DMzrmhs6.js} +1 -1
- package/dist/assets/{Detail-CZ3J7Zxw.js → Detail-BOcW5mO6.js} +2 -2
- package/dist/assets/{Extra-BHmmJxo1.js → Extra-CeLsj853.js} +1 -1
- package/dist/assets/{FilePreview-DFH2zf6Y.js → FilePreview-k9s4AWkh.js} +1 -1
- package/dist/assets/{Hailuo-B49dsuMz.js → Hailuo-7zG40Dpo.js} +1 -1
- package/dist/assets/{History-D__lDfd7.js → History-B5MmWpzB.js} +1 -1
- package/dist/assets/{ImagePreview-Dgm42i77.js → ImagePreview-CqonQxaO.js} +1 -1
- package/dist/assets/{ImageWrapper-8S5wIbh2.js → ImageWrapper-BAqDx2VE.js} +1 -1
- package/dist/assets/{Index-Bl2MEygA2.js → Index-5ugMlEwU2.js} +1 -1
- package/dist/assets/{Index-DEKAboFG.js → Index-BMBEx5MA.js} +1 -1
- package/dist/assets/{Index-MWDj4RnV.js → Index-Bcw8E0KZ.js} +1 -1
- package/dist/assets/{Index-BxJpMqu1.js → Index-BfP_Pv7l.js} +1 -1
- package/dist/assets/{Index-ov7JaD_K.js → Index-BicqqqWP.js} +1 -1
- package/dist/assets/{Index-Cv4DwW64.js → Index-C-sxprYC.js} +1 -1
- package/dist/assets/{Index-IuGMnvJE.js → Index-C0mohG1Y.js} +1 -1
- package/dist/assets/Index-C0nVxMEi.css +1 -0
- package/dist/assets/{Index-BhXz96IH2.js → Index-CJTaO59j2.js} +1 -1
- package/dist/assets/Index-COLQRvq9.js +1 -0
- package/dist/assets/{Index-CyyvTeMQ.js → Index-C_XzTrJa.js} +1 -1
- package/dist/assets/{Index-nKFLKv8w.js → Index-CiGj9eQv.js} +1 -1
- package/dist/assets/{Index-BUffr1X52.js → Index-CjcwNkmY2.js} +1 -1
- package/dist/assets/{Index-CMSbyM662.js → Index-CnVC4csn2.js} +1 -1
- package/dist/assets/{Index-ChyygG6f.js → Index-D1y1HMd2.js} +1 -1
- package/dist/assets/{Index-CK3Mw0NW.js → Index-D98_-SQx.js} +1 -1
- package/dist/assets/{Index-SRG50uig.js → Index-DGyQNFxI.js} +1 -1
- package/dist/assets/{Index-giOBQwgX.js → Index-DInL_Op1.js} +1 -1
- package/dist/assets/{Index-BIyCIAax.js → Index-DUDIY-fR.js} +1 -1
- package/dist/assets/{Index-BCj1NFlO.js → Index-DWydnG17.js} +1 -1
- package/dist/assets/{Index-CIn5wfmB.js → Index-D_rRsuym.js} +1 -1
- package/dist/assets/{Index-BA8s89QD.js → Index-DcCrfbdF.js} +1 -1
- package/dist/assets/{Index-Dt6XD_wA.js → Index-DkqbfxwM.js} +1 -1
- package/dist/assets/{Index-mKVqG7zM.js → Index-DmcbvTVf.js} +1 -1
- package/dist/assets/{Index-BMiXjToV.js → Index-DpX5BvAM.js} +1 -1
- package/dist/assets/{Index-BbMijo8m.js → Index-DrlEbB62.js} +1 -1
- package/dist/assets/{Index-U2M40b8J2.js → Index-DvpJPa2B2.js} +1 -1
- package/dist/assets/{Index-BK3W2-el2.js → Index-KobqmpYi2.js} +1 -1
- package/dist/assets/{Index-D8AIiZiP2.js → Index-NkHb9EYO2.js} +1 -1
- package/dist/assets/{Index-I_pyA15O.js → Index-SkR-OzgT.js} +1 -1
- package/dist/assets/{Index-DEzPPtcr.js → Index-lFq3L3aT.js} +1 -1
- package/dist/assets/{Invitees-BFCq2XV3.js → Invitees-CBpFJ0Va.js} +1 -1
- package/dist/assets/{List-DhvG6nrQ.js → List-D2G9OCYR.js} +1 -1
- package/dist/assets/{List-Cn0ceZN7.js → List-EtJekfwq.js} +1 -1
- package/dist/assets/{List-m2FQfiK_.js → List-lDHnqsFh.js} +1 -1
- package/dist/assets/{LocalTools-C-GZnedo.js → LocalTools-BTHQwENK.js} +1 -1
- package/dist/assets/{LocalTools-DHaSuBqU.js → LocalTools-MnX_lVF5.js} +1 -1
- package/dist/assets/{Main-WQZj1lSL.js → Main-CBfdcF1R.js} +1 -1
- package/dist/assets/{Message-COuOQJsr.js → Message-DuHF8YyA.js} +1 -1
- package/dist/assets/{Model-C6ThA9l5.js → Model-_7-sbyx4.js} +1 -1
- package/dist/assets/{Navigator-DYJ2lulW.js → Navigator-BJ6niQUi.js} +3 -3
- package/dist/assets/{NotFound-BlI4AKnN.js → NotFound-C5zCrm7Z.js} +1 -1
- package/dist/assets/{Pay-JxlaS_Y0.js → Pay-8Iyikc2D.js} +1 -1
- package/dist/assets/{Player-DMON9ii2.js → Player-DGvt2su_.js} +1 -1
- package/dist/assets/{Poivelle-CO369zsF.js → Poivelle-Cipdg8Yr.js} +1 -1
- package/dist/assets/{PromptTextarea-7K2vh_Ga.js → PromptTextarea-BwQ2pgsq.js} +1 -1
- package/dist/assets/{RealtimeCall-DL0HThPi.js → RealtimeCall-BzzwwXFR.js} +1 -1
- package/dist/assets/{ScheduledTasks-DYUWN3yW.js → ScheduledTasks-B-qqFsg8.js} +1 -1
- package/dist/assets/{Status-Pu-7zNXK.js → Status-DOSxpxFE.js} +1 -1
- package/dist/assets/{Subscribe-SuEQmHVF.js → Subscribe-CcBmc2KP.js} +1 -1
- package/dist/assets/{TabSwitcher-CuxkdUP5.js → TabSwitcher-BIz8y25m.js} +1 -1
- package/dist/assets/{Tts-BHdtkM23.js → Tts-BS6a0FMa.js} +1 -1
- package/dist/assets/{VideoPlayer-CpfdYnIU.js → VideoPlayer-DfQm-G_M.js} +1 -1
- package/dist/assets/{alert-WBvXJLK8.js → alert-BsVzeQZL.js} +1 -1
- package/dist/assets/{arrow-down-wide-narrow-CY45LWjp.js → arrow-down-wide-narrow-D9DBjkHb.js} +1 -1
- package/dist/assets/arrow-down-yu22xkT4.js +1 -0
- package/dist/assets/arrow-left-IiETNkzN.js +1 -0
- package/dist/assets/arrow-right-Mhz5tsdk.js +1 -0
- package/dist/assets/arrow-up-42MhnI4S.js +1 -0
- package/dist/assets/{avatar-Dpp82z0_.js → avatar-WTS0mxhH.js} +1 -1
- package/dist/assets/{basic-B5h7-kMt.js → basic-DYMjWp6M.js} +1 -1
- package/dist/assets/{box-AELNwZ6O.js → box-DlrCDW_Z.js} +1 -1
- package/dist/assets/{boxes-DlYwj-Kf.js → boxes-CvTuRtD2.js} +1 -1
- package/dist/assets/{brain-ZhsCjc7I.js → brain-DqkMK8o-.js} +1 -1
- package/dist/assets/{chart-no-axes-combined-DspmvDXd.js → chart-no-axes-combined-DBZaBC_z.js} +1 -1
- package/dist/assets/{chat-BQSBCGbz.js → chat-BJA9J12o.js} +1 -1
- package/dist/assets/{chat-DXfE32Xb.js → chat-BRRph6ZY.js} +1 -1
- package/dist/assets/{chat-CQLS9_kI.js → chat-BVR-USZS.js} +1 -1
- package/dist/assets/{chat-CT4eVO_5.js → chat-BZAD82h7.js} +1 -1
- package/dist/assets/chat-Bn0KonSB.js +1 -0
- package/dist/assets/{chat-BWolz9C1.js → chat-Bv9-2q9M.js} +1 -1
- package/dist/assets/{chat-CnR_Tppw.js → chat-C0N_PIyo.js} +1 -1
- package/dist/assets/{chat-CI-js_in.js → chat-CGm4BcSS.js} +1 -1
- package/dist/assets/{chat-Cvfd0pgt.js → chat-CLaYnk1u.js} +1 -1
- package/dist/assets/{chat-BOxFdPH_.js → chat-CY9zJHrN.js} +1 -1
- package/dist/assets/{chat-CPUu3Td7.js → chat-CfO0IkGR.js} +1 -1
- package/dist/assets/{chat-D6E8zDc7.js → chat-Ckm0j_lK.js} +1 -1
- package/dist/assets/{chat-Dln6jRwU.js → chat-CtsDqsXX.js} +1 -1
- package/dist/assets/{chat-DrxtEECj.js → chat-DkSuvbOb.js} +1 -1
- package/dist/assets/{chat-uPWTWE39.js → chat-DrS-WVsO.js} +1 -1
- package/dist/assets/{chat-C41R1Kbo.js → chat-X4zY00AA.js} +1 -1
- package/dist/assets/chat-Z-VrIgTr.js +1 -0
- package/dist/assets/{chat-DJzNMD_T.js → chat-l5ESPEs4.js} +1 -1
- package/dist/assets/{chat-D7e-z8kX.js → chat-zjUYRJR6.js} +1 -1
- package/dist/assets/check-DxZtOepN.js +1 -0
- package/dist/assets/chevron-down-BTplzcvu.js +1 -0
- package/dist/assets/chevron-right-D-eL6Zlc.js +1 -0
- package/dist/assets/circle-check-DvUAttOa.js +1 -0
- package/dist/assets/clock-DmoJeS1-.js +1 -0
- package/dist/assets/{codingBridge-Bnf3txBL.js → codingBridge-DRJ9Q4Q8.js} +1 -1
- package/dist/assets/{codingBridgeNotify-CD0VnVSI.js → codingBridgeNotify-BfssShKZ.js} +2 -2
- package/dist/assets/{coins-DXscl09Q.js → coins-CnnnE904.js} +1 -1
- package/dist/assets/{collapse-RnpT_cDC.js → collapse-BGRzjqqi.js} +1 -1
- package/dist/assets/constants-Dwvkb2qI.js +1 -0
- package/dist/assets/{copy-D2pUrYDo.js → copy-CuiXD2DC.js} +1 -1
- package/dist/assets/{createTaskActions-BB0XVzyi.js → createTaskActions-CHbmI2Xs.js} +1 -1
- package/dist/assets/{digitalhuman-CA-g-Lsa.js → digitalhuman-fSroLub6.js} +1 -1
- package/dist/assets/{dollar-sign-B4mIMxg5.js → dollar-sign-CIPKXVvA.js} +1 -1
- package/dist/assets/{download-Dfw5o91S.js → download-CIEcPgI1.js} +1 -1
- package/dist/assets/{drawer-DSzO2dsM.js → drawer-91Rv4Ele.js} +1 -1
- package/dist/assets/{dropdown-XqY5KRfD.js → dropdown-B16D8Kwq.js} +1 -1
- package/dist/assets/{dropdown-DJffWDtz.js → dropdown-BclnCTCe.js} +1 -1
- package/dist/assets/{ellipsis-ERf7xU-X.js → ellipsis-wwqxR-yn.js} +1 -1
- package/dist/assets/{esm-BM9M-vUQ.js → esm-AIGoQnCh.js} +1 -1
- package/dist/assets/{esm-BeMSeNd0.js → esm-CGBr50zt.js} +1 -1
- package/dist/assets/{esm-DGtQlD7p.js → esm-CKLwFBUR.js} +2 -2
- package/dist/assets/{esm-X-TlCBww.js → esm-DbP_Vy83.js} +1 -1
- package/dist/assets/{esm-Bnxch6EP.js → esm-DevbO36y.js} +2 -2
- package/dist/assets/{esm-D9uCJ2zz.js → esm-Dr-ozfU7.js} +3 -3
- package/dist/assets/esm-SoR3Zq_9.js +1 -0
- package/dist/assets/{external-link-BLtFrFE2.js → external-link-C-ELuFgb.js} +1 -1
- package/dist/assets/{eye-Bjk5cOL3.js → eye-tZeeHiqB.js} +1 -1
- package/dist/assets/{file-output-jos5BUhn.js → file-output-BWxfKqze.js} +1 -1
- package/dist/assets/{file-text-Wlfzcn4p.js → file-text-CJtFUnbZ.js} +1 -1
- package/dist/assets/{fish-DsinvpC5.js → fish-HZgBzY8L.js} +1 -1
- package/dist/assets/{flux-DrJHOrc4.js → flux-BlF7I4ii.js} +1 -1
- package/dist/assets/{folder-BKW_LD-A.js → folder-Dm3A7mhE.js} +1 -1
- package/dist/assets/gauge-BGyVJt7l.js +1 -0
- package/dist/assets/{globe-DCE1lt_-.js → globe-CbeIDOnV.js} +1 -1
- package/dist/assets/{grokvideo-XoYvXVef.js → grokvideo-CbMcq6Nr.js} +1 -1
- package/dist/assets/{hailuo-BvM3L-2P.js → hailuo-B3dCwVHZ.js} +1 -1
- package/dist/assets/{headphones-ZxJfjpwf.js → headphones-BYpy8Yka.js} +1 -1
- package/dist/assets/{history-DAnKTxh6.js → history-etn9vvhi.js} +1 -1
- package/dist/assets/{i18n-m-rMtkos.js → i18n-BwZABSLX.js} +1 -1
- package/dist/assets/{image-C6eBVmfM.js → image-8hx4YUb0.js} +1 -1
- package/dist/assets/{index-Cb8GIs2T.css → index-B3NUT6Sj.css} +1 -1
- package/dist/assets/{index-VBHeBzR0.js → index-D11lR21M.js} +4 -4
- package/dist/assets/{index.browser.esm-Co3SBgou.js → index.browser.esm-BILJ0i0I.js} +1 -1
- package/dist/assets/{index.es-BdfmtnYr.js → index.es-D9wpiZpG.js} +1 -1
- package/dist/assets/{info-DEMVq26u.js → info-CsXueTRq.js} +1 -1
- package/dist/assets/{input-number-Cxr0yGWv.js → input-number-DFaagkZ1.js} +1 -1
- package/dist/assets/{key-round-BNRx993K.js → key-round-BCeSp5Ky.js} +1 -1
- package/dist/assets/{kling-B79nPDvZ.js → kling-BzpLIFkF.js} +1 -1
- package/dist/assets/{languages-BDvmQogT.js → languages-BZ6oQUWe.js} +1 -1
- package/dist/assets/{laptop-mFlnsKpF.js → laptop-D0nw4urN.js} +1 -1
- package/dist/assets/{lightbulb-Ddx7bZyL.js → lightbulb-BLCPwpqb.js} +1 -1
- package/dist/assets/{link-DFyQc69y.js → link-DQWWASPf.js} +1 -1
- package/dist/assets/loader-circle-BtKiEz76.js +1 -0
- package/dist/assets/{luma-Z9CkS1Al.js → luma-Cup5L_FW.js} +1 -1
- package/dist/assets/{maestro-BWGDJJ-2.js → maestro-BeyFVvns.js} +1 -1
- package/dist/assets/{maestro-C4KUqcGJ.js → maestro-DtLtTGW-.js} +1 -1
- package/dist/assets/{mail-HD7lxwd9.js → mail-8p4gHxZ2.js} +1 -1
- package/dist/assets/{message-circle-DxQ1GD6k.js → message-circle-CbOdsqvj.js} +1 -1
- package/dist/assets/{mic-0PRzkMMU.js → mic-Bah1fkJr.js} +1 -1
- package/dist/assets/{midjourney-Dl79Ujo2.js → midjourney-CWWqqsk2.js} +1 -1
- package/dist/assets/{mobileLocalExec-SRzr868n.js → mobileLocalExec-DRMB0uEV.js} +2 -2
- package/dist/assets/{mouse-pointer-2-DLDMdxRv.js → mouse-pointer-2-rlN-I3Rd.js} +1 -1
- package/dist/assets/music-2-CbVeTVyL.js +1 -0
- package/dist/assets/{nanobanana-mIq9Rym-.js → nanobanana-WoQ_GrQA.js} +1 -1
- package/dist/assets/{omni-ClVrE877.js → omni-DTCgIhYE.js} +1 -1
- package/dist/assets/{openaiimage-BH5VhQqE.js → openaiimage-MJMThHzx.js} +1 -1
- package/dist/assets/{pagination-BSiXY-Jl.js → pagination-Blfeoga3.js} +1 -1
- package/dist/assets/{pagination-BeMaY6jH.js → pagination-hQoJe8fE.js} +1 -1
- package/dist/assets/{palette-fzgmVU72.js → palette-BShqy-O4.js} +1 -1
- package/dist/assets/{paperclip-DJVvXwVR.js → paperclip-Cpyt9097.js} +1 -1
- package/dist/assets/{pause-B9jWveqG.js → pause-BDGimkCB.js} +1 -1
- package/dist/assets/{pencil-Byaa9oh_.js → pencil-UNDwTR7e.js} +1 -1
- package/dist/assets/{pika-CWMJpPD7.js → pika-C6m9u1gB.js} +1 -1
- package/dist/assets/{pixverse-C009i__-.js → pixverse-Dav_Oxf1.js} +1 -1
- package/dist/assets/play-EJ5kX8EX.js +1 -0
- package/dist/assets/plus-B29mCsSP.js +1 -0
- package/dist/assets/{poivelle-CwMK3-1J.js → poivelle-2cCDBnGF.js} +1 -1
- package/dist/assets/{poivelle-B_QSOwfv.js → poivelle-3nkGbPvK.js} +1 -1
- package/dist/assets/{poivelle-B2wv8kv8.js → poivelle-BDQjle-B.js} +1 -1
- package/dist/assets/{poivelle-BU9sXd3Z.js → poivelle-BDl71Lw7.js} +1 -1
- package/dist/assets/{poivelle-B-4nGG9X.js → poivelle-BHawyBWB.js} +1 -1
- package/dist/assets/poivelle-BKNIo3KW.js +1 -0
- package/dist/assets/poivelle-BhmorJKu.js +1 -0
- package/dist/assets/poivelle-BtVTjxx6.js +1 -0
- package/dist/assets/poivelle-Bx0dh9by.js +1 -0
- package/dist/assets/poivelle-CB0hllHC.js +1 -0
- package/dist/assets/poivelle-CM6SlTIJ.js +1 -0
- package/dist/assets/poivelle-CSoaOAqi.js +1 -0
- package/dist/assets/poivelle-CThzSms4.js +1 -0
- package/dist/assets/poivelle-Cmwe3NjT.js +1 -0
- package/dist/assets/poivelle-CsmbOA_P.js +1 -0
- package/dist/assets/poivelle-Ctiextn_.js +1 -0
- package/dist/assets/poivelle-D3yO0lZe.js +1 -0
- package/dist/assets/poivelle-LElOo-0T.js +1 -0
- package/dist/assets/poivelle-a3jCqCKL.js +1 -0
- package/dist/assets/{popover-BhzWwlHA.js → popover-Dw95C5zL.js} +1 -1
- package/dist/assets/{producer-D-5ahs22.js → producer-Cx3GSOeP.js} +1 -1
- package/dist/assets/{qrart-CfKDPJzc.js → qrart-CSs1C2gw.js} +1 -1
- package/dist/assets/{realtime-BDw9Ja0m.js → realtime-D8CiUCSa.js} +1 -1
- package/dist/assets/{refresh-cw-CZy8uOKf.js → refresh-cw-c1f-4GL1.js} +1 -1
- package/dist/assets/rotate-ccw-DANBtoW5.js +1 -0
- package/dist/assets/rotate-cw-CQypZOeQ.js +1 -0
- package/dist/assets/{row-DEepQm5v.js → row-D8Md0caP.js} +1 -1
- package/dist/assets/search-DorxMjPl.js +1 -0
- package/dist/assets/{seedance-CuQ-RB-o.js → seedance-DLpT4YPq.js} +1 -1
- package/dist/assets/{seedream-DwMeA7lR.js → seedream-HcChJpAo.js} +1 -1
- package/dist/assets/{select-Dd7_ivYm.js → select-CY8L3FpM.js} +1 -1
- package/dist/assets/{serp-Cpme1jLA.js → serp-CShPNdaC.js} +1 -1
- package/dist/assets/{shield-CEKzGUiK.js → shield-CCRYI_QA.js} +1 -1
- package/dist/assets/{shuffle-CPp1zIQg.js → shuffle-BHUsU0DE.js} +1 -1
- package/dist/assets/{slider-DZFpT_-k.js → slider-D3nQy28g.js} +1 -1
- package/dist/assets/{sliders-horizontal-ZIkt1_ZY.js → sliders-horizontal-DEmALzFN.js} +1 -1
- package/dist/assets/{solana-wallets-8N8TFiQr.js → solana-wallets-BPonbhZT.js} +2 -2
- package/dist/assets/{solana-wallets-vue-q46RNVE2.js → solana-wallets-vue-BS5ZFtn-.js} +1 -1
- package/dist/assets/{sora-DgK-9cu6.js → sora-CIMSVfhq.js} +1 -1
- package/dist/assets/{sparkles-DO8SF9W1.js → sparkles-FKYrDcPD.js} +1 -1
- package/dist/assets/square-RkQJNrTE.js +1 -0
- package/dist/assets/{suno-lw9iaGS7.js → suno-Kr_BOSJ-.js} +1 -1
- package/dist/assets/{switch-CTynqVTx.js → switch-tSKAoZ0l.js} +1 -1
- package/dist/assets/{table-DZchSoeL.js → table-Goh_lj7o.js} +1 -1
- package/dist/assets/{tabs-xPvwicwp.js → tabs-tYFbYhk_.js} +1 -1
- package/dist/assets/{tag-Djz8A-aq.js → tag-WjH23hVG.js} +1 -1
- package/dist/assets/{taskDrawerMixin-DxvJ_eHK.js → taskDrawerMixin-BbwfrIGa.js} +1 -1
- package/dist/assets/terminal-C8AgqXIs.js +1 -0
- package/dist/assets/{time-picker-DtuViMZr.js → time-picker-BnuD2UEV.js} +1 -1
- package/dist/assets/{tooltip-Dj6RbMto.js → tooltip-BWksRWUx.js} +1 -1
- package/dist/assets/{trash-2-BUBTZ5jZ.js → trash-2-DguCsKzj.js} +1 -1
- package/dist/assets/{triangle-alert-DdjKQZco.js → triangle-alert-D3h6_VD_.js} +1 -1
- package/dist/assets/{upload-lhd9YfIE.js → upload--OMy2H6L.js} +1 -1
- package/dist/assets/{upload-D-IxWuPY.js → upload-UU_EKVx7.js} +1 -1
- package/dist/assets/user-DLgTmCsN.js +1 -0
- package/dist/assets/{veo-D_6dx0uK.js → veo-CgoQdLl1.js} +1 -1
- package/dist/assets/{video-BeVJ1twu.js → video-BUbgp2Mi.js} +1 -1
- package/dist/assets/{volume-2-BGU1w9OE.js → volume-2-DlgXY7_9.js} +1 -1
- package/dist/assets/{wallet-D2lzSwKH.js → wallet-BDJiLzju.js} +1 -1
- package/dist/assets/{wan-C1eF7kN4.js → wan-BAjGeclK.js} +1 -1
- package/dist/assets/{wand-sparkles-DDpMxLU_.js → wand-sparkles-G_omarUp.js} +1 -1
- package/dist/assets/{web-UodICUOU.js → web-C4KikJl4.js} +1 -1
- package/dist/assets/{web-mZ-TUY5O.js → web-DGHFIqIQ.js} +1 -1
- package/dist/assets/{web-Dlgb_jk0.js → web-IARqBYAj.js} +1 -1
- package/dist/assets/{web-FnDg6aZl.js → web-J_8DsY5v.js} +1 -1
- package/dist/assets/{web-DA4pW8F2.js → web-rlsEdgAb.js} +1 -1
- package/dist/assets/{webextrator-CfqoU2lP.js → webextrator-DdS48rj0.js} +1 -1
- package/dist/assets/{zap-CGueNzj6.js → zap-BY9oC9vX.js} +1 -1
- package/dist/index.html +4 -4
- package/package.json +1 -1
- package/dist/assets/Index-COH2u_8f.css +0 -1
- package/dist/assets/Index-CpX0ttGf.js +0 -1
- package/dist/assets/arrow-down-C3jVdwaz.js +0 -1
- package/dist/assets/arrow-left-DzMprQNH.js +0 -1
- package/dist/assets/arrow-right-Bts11H__.js +0 -1
- package/dist/assets/arrow-up-Ci1eD-i4.js +0 -1
- package/dist/assets/chat-dQFSw_HO.js +0 -1
- package/dist/assets/chat-tz5-Yl50.js +0 -1
- package/dist/assets/check-BVoOceXa.js +0 -1
- package/dist/assets/chevron-down-1YQ6WCcf.js +0 -1
- package/dist/assets/chevron-right-AdnKRtPj.js +0 -1
- package/dist/assets/circle-check-LckUQ_Xv.js +0 -1
- package/dist/assets/clock-DTI37195.js +0 -1
- package/dist/assets/constants-P5wTiWzI.js +0 -1
- package/dist/assets/esm-BRew7ccV.js +0 -1
- package/dist/assets/gauge-DNe9O2xN.js +0 -1
- package/dist/assets/loader-circle-EzQmQXjz.js +0 -1
- package/dist/assets/music-2-pCqmG8V2.js +0 -1
- package/dist/assets/play-GmyxLymE.js +0 -1
- package/dist/assets/plus-CRsJ6n1q.js +0 -1
- package/dist/assets/poivelle-CVJFwmq5.js +0 -1
- package/dist/assets/poivelle-CiKxLOuT.js +0 -1
- package/dist/assets/poivelle-Cr6f1XNM.js +0 -1
- package/dist/assets/poivelle-Cu8yRgEl.js +0 -1
- package/dist/assets/poivelle-CyNOYDy-.js +0 -1
- package/dist/assets/poivelle-DDxnUoCb.js +0 -1
- package/dist/assets/poivelle-DFAUqjxK.js +0 -1
- package/dist/assets/poivelle-DHNobTmI.js +0 -1
- package/dist/assets/poivelle-DRT_oBTG.js +0 -1
- package/dist/assets/poivelle-DWpiT4AP.js +0 -1
- package/dist/assets/poivelle-JFwjJcOn.js +0 -1
- package/dist/assets/poivelle-PPNh0mDW.js +0 -1
- package/dist/assets/poivelle-pe1Nl83L.js +0 -1
- package/dist/assets/poivelle-u9RX9UkY.js +0 -1
- package/dist/assets/rotate-ccw-VvERcXNU.js +0 -1
- package/dist/assets/rotate-cw-Cvrx9Z3Y.js +0 -1
- package/dist/assets/search-DGYVO_nA.js +0 -1
- package/dist/assets/square-BjHqstMz.js +0 -1
- package/dist/assets/terminal-DPCHO9cA.js +0 -1
- package/dist/assets/user-DOZWtcUc.js +0 -1
|
@@ -1 +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{r as y,t as b}from"./select-Dd7_ivYm.js";import{n as x,t as S}from"./tabs-xPvwicwp.js";import{t as C}from"./upload-lhd9YfIE.js";import{t as w}from"./tooltip-Dj6RbMto.js";import{t as T}from"./alert-WBvXJLK8.js";import{n as E,r as D}from"./radio-DgDgyT2l.js";import{t as O}from"./drawer-DSzO2dsM.js";import{t as k}from"./input-number-Cxr0yGWv.js";import{t as A}from"./slider-DZFpT_-k.js";import{t as j}from"./switch-CTynqVTx.js";import{n as M}from"./taskDrawerMixin-DxvJ_eHK.js";import{t as ee}from"./clock-DTI37195.js";import{r as te,t as ne}from"./PromptTextarea-7K2vh_Ga.js";import{t as re}from"./headphones-ZxJfjpwf.js";import{t as ie}from"./info-DEMVq26u.js";import{t as ae}from"./lightbulb-Ddx7bZyL.js";import{t as oe}from"./triangle-alert-DdjKQZco.js";import{t as N}from"./upload-D-IxWuPY.js";import{t as P}from"./wand-sparkles-DDpMxLU_.js";import{ai as se,ci as ce,li as le,ui as F}from"./constants-P5wTiWzI.js";import{Ai as ue,Bt as de,E as I,Gt as L,Ht as fe,Mi as R,Un as z,Ut as B,Vi as V,Vt as H,_i as pe,ai as U,en as W,gr as G,hi as me,ni as he,vi as K}from"./index-VBHeBzR0.js";import{t as ge}from"./CopyToClipboard-CRR8YgjD.js";import{t as _e}from"./FilePreview-DFH2zf6Y.js";import{t as q}from"./ImagePreview-Dgm42i77.js";import{t as J}from"./Consumption-DVsuzbOV.js";import{a as Y,n as ve,r as ye,t as be}from"./pagination-BSiXY-Jl.js";import{t as xe}from"./VideoPlayer-CpfdYnIU.js";import{t as Se}from"./ApiCodeButton-S_UyXg4j.js";import{t as Ce}from"./BotPlaceholder-C4saLAYx.js";import{n as we,t as Te}from"./AudioPreview-BzHmySK6.js";var Ee=v({name:`LayoutKling`,components:{MagicIcon:P,ElDrawer:O,ElButton:R},mixins:[M]}),De={class:`main flex flex-row flex-1 min-h-0`},Oe={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},ke={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ae(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,De,[e(`div`,Oe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,ke,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var je=I(Ee,[[`render`,Ae],[`__scopeId`,`data-v-2d826924`]]),Me={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};function X(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,referenceImages:!1};case`kling-v1-6`:case`kling-v2-5-turbo`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v2-6`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:r===`pro`,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v2-master`:case`kling-v2-1-master`:return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v3`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:r!==`4k`,referenceVideo:!1,referenceImages:!1};case`kling-v3-omni`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1,referenceVideo:!0,referenceImages:!0};case`kling-o1`:return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1,referenceVideo:!0,referenceImages:!0};default:return Me}}var Z=`<<<video_1>>>`,Ne=/<<<image_\d+>>>/g;function Pe(e){return e?e.split(Z).join(` `).replace(/\s{2,}/g,` `).trim():``}function Fe(e){return e?e.replace(Ne,` `).replace(/\s{2,}/g,` `).trim():``}function Q(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=X(n,r,i),o=[];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`}),e.image_list?.length&&!a.referenceImages&&o.push({field:`image_list`,i18nLabel:`kling.name.referenceImages`});let s=n===`kling-o1`||!!(e.image_list?.length||e.video_list?.length);return s&&e.cfg_scale!==void 0&&o.push({field:`cfg_scale`,i18nLabel:`kling.name.cfgScale`}),s&&e.negative_prompt&&o.push({field:`negative_prompt`,i18nLabel:`kling.name.negativePrompt`}),o}function Ie(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===`cfg_scale`&&(n.cfg_scale=void 0),e.field===`negative_prompt`&&(n.negative_prompt=void 0),e.field===`video_list`&&(n.video_list=void 0,n.prompt=Pe(n.prompt)),e.field===`image_list`&&(n.image_list=void 0,n.prompt=Fe(n.prompt));return n}var Le=v({name:`ModelSelector`,components:{ElSelect:y,ElOption:b},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-o1`,label:`Kling O1`}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(se)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=Q(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await pe.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=Ie({...t,model:e},n);this.$store.commit(`kling/setConfig`,i),K.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})}}}),Re={class:`field`},ze={class:`title font-bold`};function Be(t,n,r,a,o,u){let d=l(`el-option`),m=l(`el-select`);return g(),s(`div`,Re,[e(`h2`,ze,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 Ve=I(Le,[[`render`,Be],[`__scopeId`,`data-v-a74e7f31`]]),He=v({name:`ModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Y},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},cameraControlSet(){return!!this.$store.state.kling?.config?.camera_control?.type},fourKReason(){return F.includes(this.selectedModel)?this.cameraControlSet?this.$t(`kling.description.mode4kIncompatibleCamera`):``:this.$t(`kling.description.mode4kRequiresV3`)},options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`),disabled:!1,disabledReason:``},{value:`pro`,label:this.$t(`kling.name.modePro`),disabled:!1,disabledReason:``},{value:`4k`,label:this.$t(`kling.name.mode4k`),disabled:!!this.fourKReason,disabledReason:this.fourKReason}]},value(){return this.$store.state.kling?.config?.mode}},watch:{fourKReason(e){e&&this.value===`4k`&&this.applyMode(`std`)}},mounted(){this.value||this.applyMode(`std`)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=Q(t,{mode:e});if(n.length===0){this.applyMode(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await pe.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=Ie({...t,mode:e},n);this.$store.commit(`kling/setConfig`,i),K.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})}}}),Ue={class:`field`},We={class:`header`},Ge={class:`title font-bold`},Ke={key:0,class:`opt-tip`};function qe(t,r,u,d,m,_){let v=l(`info-icon`),y=l(`el-option`),b=l(`el-select`);return g(),s(`div`,Ue,[e(`div`,We,[e(`h2`,Ge,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`,Ke,i(t.disabledReason),1)):o(``,!0)]),_:2},1032,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var Je=I(He,[[`render`,qe],[`__scopeId`,`data-v-9a8fa3c5`]]),Ye=[3,5,8,10,12,15],Xe=[5,10],Ze=[5],Qe=v({name:`DurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Y},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},isV3Model(){return F.includes(this.selectedModel)},allowedDurations(){return this.selectedModel===`kling-o1`?Ze:this.isV3Model?Ye:Xe},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:{selectedModel(){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=Q(t,{duration:e});if(n.length===0){this.applyDuration(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await pe.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=Ie({...t,duration:e},n);this.$store.commit(`kling/setConfig`,i),K.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})}}}),$e={class:`field`},et={class:`control`},tt={class:`label`},nt={class:`title font-bold`};function rt(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,$e,[e(`div`,et,[e(`div`,tt,[e(`h2`,nt,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 it=I(Qe,[[`render`,rt],[`__scopeId`,`data-v-496bf31c`]]),at=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`}}),ot={class:`text-sm font-bold mb-2 block`},st={class:`items`},ct=[`onClick`],lt={class:`name`};function ut(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,ot,i(t.$t(`kling.name.ratio`)),1),e(`div`,st,[(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`,lt,i(r.label),1)],10,ct))),128))])])}var dt=I(at,[[`render`,ut],[`__scopeId`,`data-v-cdb14b2f`]]),ft=v({name:`StartImage`,components:{UploadIcon:N,ElUpload:C,ElButton:R,ElTooltip:w,InfoIcon:Y,ImagePreview:q},mixins:[B,H],emits:[`change`],data(){return{fileList:[],uploadUrl:U()+`/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(){}}},watch:{value(e){!e&&this.fileList.length>0&&(this.fileList=[])}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){K.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){K.error(this.$t(`kling.message.uploadReferencesError`))},onBeforeUpload(){let e=this.$store.state.kling?.config||{};if(e.video_list?.[0]?.refer_type===`base`)return K.warning(this.$t(`kling.message.baseVideoFrameConflict`)),!1;let t=e.video_list?.length?4:7;return(e.image_list?.length||0)+Number(!!e.end_image_url)+1>t?(K.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:t})),!1):!0},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetStartImageUrl()}}}),pt={class:`relative`},mt={class:`flex min-h-8 items-center pr-20`},ht={class:`flex justify-start items-center`},gt={class:`text-sm font-bold`};function _t(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,pt,[e(`div`,mt,[e(`div`,ht,[e(`span`,gt,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`,"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.onRemove(e)},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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),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 vt=I(ft,[[`render`,_t],[`__scopeId`,`data-v-0220ed34`]]),yt=v({name:`EndImage`,components:{UploadIcon:N,ElUpload:C,ElButton:R,ElTooltip:w,ImagePreview:q,InfoIcon:Y},mixins:[B,H],data(){return{fileList:[],uploadUrl:U()+`/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 X(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(){if(!this.endImageSupported)return K.warning(this.$t(`kling.message.endImageNotSupported`)),!1;if(!this.hasStartImage)return K.warning(this.$t(`kling.message.endImageRequiresStart`)),!1;if(this.klingConfig.video_list?.[0]?.refer_type===`base`)return K.warning(this.$t(`kling.message.baseVideoFrameConflict`)),!1;let e=this.klingConfig.video_list?.length?4:7;return(this.klingConfig.image_list?.length||0)+2>e?(K.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:e})),!1):!0},onExceed(){K.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){K.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()},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetEndImageUrl()}}}),bt={class:`relative`},xt={class:`flex min-h-8 items-center pr-20`},St={class:`flex justify-start items-center`},Ct={class:`text-sm font-bold`};function wt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,bt,[e(`div`,xt,[e(`div`,St,[e(`span`,Ct,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.onRemove(e)},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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),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 Tt=I(yt,[[`render`,wt],[`__scopeId`,`data-v-b2eaa919`]]),Et=v({name:`ReferenceVideo`,components:{ElUpload:C,ElButton:R,ElRadioButton:E,ElRadioGroup:D,ElSwitch:j,InfoIcon:Y,FilePreview:_e,UploadIcon:N},mixins:[H],data(){return{fileList:[],uploadUrl:U()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},config(){return this.$store.state.kling?.config||{}},hasVideo(){return!!this.urls?.[0]},referenceType:{get(){return this.config.video_list?.[0]?.refer_type||`feature`},set(e){this.updateVideoOptions(e,this.keepOriginalSound)}},keepOriginalSound:{get(){return this.config.video_list?.[0]?.keep_original_sound===`yes`},set(e){this.updateVideoOptions(this.referenceType,e)}}},methods:{onExceed(){K.warning(this.$t(`kling.message.referenceVideoExceed`))},onError(){K.error(this.$t(`kling.message.referenceVideoError`))},beforeUpload(e){if((this.config.image_list?.length||0)+Number(!!this.config.start_image_url)+Number(!!this.config.end_image_url)>4)return K.error(this.$t(`kling.message.referenceVideoImageLimit`)),!1;let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=e.size/1024/1024<200;return t?n?!0:(K.error(this.$t(`kling.message.referenceVideoSizeExceed`)),!1):(K.error(this.$t(`kling.message.referenceVideoTypeFailed`)),!1)},ensurePromptToken(e){let t=this.$store.state.kling?.config,n=t?.prompt||``,r=n.includes(Z),i;if(e&&!r)i=n?`${n} ${Z}`:Z;else if(!e&&r)i=Pe(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:this.referenceType,keep_original_sound:this.keepOriginalSound?`yes`:`no`}]:void 0;this.$store.commit(`kling/setConfig`,{...this.config,video_list:t,generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0}),this.ensurePromptToken(!!e)},updateVideoOptions(e,t){let n=this.urls?.[0];n&&this.$store.commit(`kling/setConfig`,{...this.config,video_list:[{video_url:n,refer_type:e,keep_original_sound:t?`yes`:`no`}],...e===`base`?{start_image_url:void 0,end_image_url:void 0}:{},generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0})},async onSuccess(){this.onSetVideoList()}}}),Dt={class:`relative`},Ot={class:`flex min-h-8 items-center pr-20`},kt={class:`flex justify-start items-center`},At={class:`text-sm font-bold`},jt={key:0,class:`reference-options mt-3 flex flex-col gap-3`},Mt={class:`flex flex-col items-stretch gap-2 sm:flex-row sm:items-center sm:justify-between`},Nt={class:`text-sm`},Pt={class:`flex items-center justify-between gap-3`},Ft={class:`text-sm`};function It(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`),x=l(`el-radio-button`),S=l(`el-radio-group`),C=l(`el-switch`);return g(),s(`div`,Dt,[e(`div`,Ot,[e(`div`,kt,[e(`span`,At,i(t.$t(`kling.name.referenceVideo`)),1),a(h,{content:t.$t(`kling.description.omniReferenceVideo`)},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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferenceVideo`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`]),t.hasVideo?(g(),s(`div`,jt,[e(`div`,Mt,[e(`span`,Nt,i(t.$t(`kling.name.referenceVideoType`)),1),a(S,{modelValue:t.referenceType,"onUpdate:modelValue":n[1]||=e=>t.referenceType=e,size:`small`},{default:p(()=>[a(x,{value:`feature`},{default:p(()=>[r(i(t.$t(`kling.name.referenceVideoFeature`)),1)]),_:1}),a(x,{value:`base`},{default:p(()=>[r(i(t.$t(`kling.name.referenceVideoBase`)),1)]),_:1})]),_:1},8,[`modelValue`])]),e(`div`,Pt,[e(`span`,Ft,i(t.$t(`kling.name.keepOriginalSound`)),1),a(C,{modelValue:t.keepOriginalSound,"onUpdate:modelValue":n[2]||=e=>t.keepOriginalSound=e},null,8,[`modelValue`])])])):o(``,!0)])}var Lt=I(Et,[[`render`,It],[`__scopeId`,`data-v-7bb04cb4`]]),Rt=v({name:`KlingReferenceImages`,components:{ElButton:R,ElUpload:C,UploadIcon:N,ImagePreview:q,InfoIcon:Y},mixins:[B,H],data(){return{fileList:[],uploadUrl:U()+`/api/v1/files/`}},computed:{config(){return this.$store.state.kling?.config||{}},headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},frameCount(){return Number(!!this.config.start_image_url)+Number(!!this.config.end_image_url)},maxImages(){return this.config.video_list?.length?4:7},referenceLimit(){return Math.max(0,this.maxImages-this.frameCount)},remainingSlots(){return Math.max(0,this.referenceLimit-this.urls.length)},urls(){return this.fileList.map(e=>e.response?.file_url||e.url).filter(Boolean)},storeImages(){return this.config.image_list}},watch:{frameCount(){this.syncPromptTokens()},storeImages(e){!e?.length&&this.fileList.length>0&&(this.fileList=[])}},methods:{beforeUpload(){return this.remainingSlots===0?(this.onExceed(),!1):!0},onExceed(){K.warning(this.$t(`kling.message.referenceImagesExceed`,{count:this.remainingSlots}))},onError(){K.error(this.$t(`kling.message.referenceImagesError`))},clearOmniConflicts(e){return{...e,generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0}},syncPromptTokens(e){let t=e||this.config,n=[Fe(t.prompt),...this.urls.map((e,t)=>`<<<image_${this.frameCount+t+1}>>>`)].filter(Boolean).join(` `);n!==t.prompt&&this.$store.commit(`kling/setConfig`,{...t,prompt:n})},syncConfig(){let e=this.urls.length?this.urls.map(e=>({image_url:e})):void 0,t=this.clearOmniConflicts({...this.config,image_list:e});this.$store.commit(`kling/setConfig`,t),this.syncPromptTokens(t)},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.syncConfig()},onRemove(e,t){this.fileList.splice(e,1),t.url?.startsWith(`blob:`)&&URL.revokeObjectURL(t.url),this.syncConfig()}}}),zt={class:`relative`},Bt={class:`flex justify-between items-center`},Vt={class:`flex justify-start items-center`},Ht={class:`text-sm font-bold`},Ut={key:0,class:`file-list flex flex-wrap gap-2 mt-2`};function Wt(t,n,u,d,m,_){let v=l(`info-icon`),y=l(`UploadIcon`),b=l(`el-button`),x=l(`el-upload`),S=l(`image-preview`);return g(),s(`div`,zt,[e(`div`,Bt,[e(`div`,Vt,[e(`span`,Ht,i(t.$t(`kling.name.referenceImages`)),1),a(v,{content:t.$t(`kling.description.referenceImages`)},null,8,[`content`])]),a(x,{"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg`,name:`file`,limit:t.referenceLimit,multiple:!0,"show-file-list":!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{default:p(()=>[a(b,{round:``,type:`primary`,size:`small`,disabled:t.remainingSlots===0},{default:p(()=>[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferenceImages`)),1)]),_:1},8,[`disabled`])]),_:1},8,[`file-list`,`limit`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])]),t.fileList.length?(g(),s(`div`,Ut,[(g(!0),s(c,null,h(t.fileList,(e,n)=>(g(),f(S,{key:e.uid||e.url||n,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemove(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])):o(``,!0)])}var Gt=I(Rt,[[`render`,Wt]]),Kt=v({name:`CfgScaleSelector`,components:{ElSlider:A,InfoIcon:Y,ElInputNumber:k},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}}),qt={class:`flex justify-between`},Jt={class:`flex justify-start items-center`},Yt={class:`text-sm font-bold`},Xt={class:`flex justify-end items-center`},Zt={class:`w-full`};function Qt(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`,qt,[e(`div`,Jt,[e(`span`,Yt,i(t.$t(`kling.name.cfgScale`)),1),a(d,{content:t.$t(`kling.description.cfgScale`)},null,8,[`content`])]),e(`div`,Xt,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,Zt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:0,max:1,step:.1},null,8,[`modelValue`])])])}var $t=I(Kt,[[`render`,Qt]]),en=v({name:`GenerateAudioSelector`,components:{ElSwitch:j,InfoIcon:Y},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},selectedMode(){return this.$store.state.kling?.config?.mode||``},supported(){return!!(F.includes(this.selectedModel)||this.selectedModel===`kling-v2-6`&&this.selectedMode===`pro`)},tooltipContent(){return this.supported?this.$t(`kling.description.generateAudio`):this.$t(`kling.description.generateAudioUnsupported`)},value:{get(){return this.supported?this.$store.state.kling?.config?.generate_audio??!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})}}}),tn={class:`relative`},nn={class:`flex justify-between items-center`},rn={class:`flex justify-start items-center`},an={class:`text-sm font-bold`};function on(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,tn,[e(`div`,nn,[e(`div`,rn,[e(`span`,an,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 sn=I(en,[[`render`,on]]),cn=[`horizontal`,`vertical`,`pan`,`tilt`,`roll`,`zoom`],ln=v({name:`CameraControlSelector`,components:{ElSelect:y,ElOption:b,ElSlider:A,ElInputNumber:k,InfoIcon:Y},data(){return{configKeys:cn}},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 X(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)}}}),un={class:`field`},dn={class:`header`},fn={class:`text-sm font-bold`},pn={key:0,class:`config-grid`},mn={class:`cfg-row-head`},hn={class:`cfg-name`};function gn(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`,un,[e(`div`,dn,[e(`span`,fn,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`,pn,[(g(!0),s(c,null,h(t.configKeys,n=>(g(),s(`div`,{key:n,class:`cfg-row`},[e(`div`,mn,[e(`span`,hn,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 _n=I(ln,[[`render`,gn],[`__scopeId`,`data-v-cd896060`]]),vn=[{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`]}],$=`, `;function yn(e,t){let n=(e||``).trim();return n?n.includes(t)?n:`${n}${$}${t}`:t}function bn(e,t){if(!e||!t)return e||``;let n=[`${t}${$}`,`${$}${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 xn=v({name:`InspirationPills`,components:{CloseIcon:me},computed:{prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return vn.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=bn(this.prompt,e);this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:t})}}}),Sn={key:0,class:`pills`,role:`list`},Cn={class:`pill-text`},wn=[`aria-label`,`title`,`onClick`];function Tn(n,r,u,d,f,p){let m=l(`close-icon`);return n.selected.length>0?(g(),s(`div`,Sn,[(g(!0),s(c,null,h(n.selected,r=>(g(),s(`div`,{key:r,class:`pill`,role:`listitem`},[e(`span`,Cn,i(r),1),e(`button`,{type:`button`,class:`pill-remove`,"aria-label":n.$t(`kling.inspiration.removeChip`),title:n.$t(`kling.inspiration.removeChip`),onClick:t(e=>n.onRemove(r),[`stop`])},[a(m,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,wn)]))),128))])):o(``,!0)}var En=v({name:`PromptInput`,components:{IdeaIcon:ae,ElButton:R,PromptTextarea:ne,InspirationPills:I(xn,[[`render`,Tn],[`__scopeId`,`data-v-6be01bcf`]])},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 Dn(e,t,n,o,s,c){let u=l(`idea-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,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(e.$t(`kling.inspiration.openButton`)),1)]),_:1})]),before:p(()=>[a(m)]),_:1},8,[`modelValue`,`title`,`info`,`placeholder`])}var On=I(En,[[`render`,Dn],[`__scopeId`,`data-v-5754ae54`]]),kn=v({name:`NegativePromptInput`,components:{ElInput:V,InfoIcon:Y},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||=``}}),An={class:`field`},jn={class:`box`},Mn={class:`title font-bold`};function Nn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,An,[e(`div`,jn,[e(`h2`,Mn,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 Pn=I(kn,[[`render`,Nn],[`__scopeId`,`data-v-de98cf01`]]),Fn=v({name:`InspirationDrawer`,components:{Close:me,IdeaIcon:ae,ElDrawer:O,ElButton:R},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`],data(){return{groups:vn}},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(bn(this.prompt,e)):this.setPrompt(yn(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(let t of this.allChipTexts)for(;e.includes(t);)e=bn(e,t);this.setPrompt(e)}}}),In={class:`drawer-content`},Ln={class:`drawer-header`},Rn={class:`title-row`},zn={class:`title`},Bn={class:`hint`},Vn={key:0,class:`selected-bar`},Hn={class:`selected-text`},Un={class:`groups`},Wn={class:`group-title`},Gn={class:`chip-grid`},Kn=[`onClick`];function qn(t,u,d,m,_,v){let y=l(`idea-icon`),b=l(`close`),x=l(`el-button`),S=l(`el-drawer`);return g(),f(S,{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`,In,[e(`div`,Ln,[e(`div`,Rn,[a(y,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,zn,i(t.$t(`kling.inspiration.title`)),1)]),a(x,{text:``,class:`close-btn`,"aria-label":t.$t(`common.button.close`),title:t.$t(`common.button.close`),onClick:u[0]||=e=>t.visible=!1},{default:p(()=>[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`])]),e(`div`,Bn,i(t.$t(`kling.inspiration.hint`)),1),t.selectedCount>0?(g(),s(`div`,Vn,[e(`span`,Hn,i(t.$t(`kling.inspiration.selectedSummary`,{count:t.selectedCount})),1),a(x,{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`,Un,[(g(!0),s(c,null,h(t.groups,r=>(g(),s(`div`,{key:r.groupKey,class:`group`},[e(`div`,Wn,i(t.$t(`kling.inspiration.group.${r.groupKey}`)),1),e(`div`,Gn,[(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,Kn))),128))])]))),128))])])]),_:1},8,[`modelValue`,`size`])}var Jn=I(Fn,[[`render`,qn],[`__scopeId`,`data-v-8b2e6a5d`]]),Yn={"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-o1":`Kling O1`},Xn={std:`720p`,pro:`1080p`,"4k":`4K`},Zn=v({name:`SummaryChip`,components:{AudioIcon:re},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){let e=this.config?.model||`kling-v2-5-turbo`;return Yn[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||``},modeLabel(){let e=this.config?.mode||`std`;return Xn[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),Qn={class:`summary-chip`},$n=[`title`],er=[`title`],tr=[`title`],nr=[`title`],rr=[`title`];function ir(t,n,r,c,u,d){let f=l(`audio-icon`);return g(),s(`div`,Qn,[e(`span`,{class:`part`,title:t.$t(`kling.name.model`)},i(t.modelLabel),9,$n),n[0]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.duration`)},i(t.durationLabel),9,er),n[1]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.ratio`)},i(t.aspectRatio||`16:9`),9,tr),n[2]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.mode`)},i(t.modeLabel),9,nr),t.generateAudio?(g(),s(`span`,{key:0,class:`audio`,title:t.$t(`kling.name.generateAudio`)},[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,rr)):o(``,!0)])}var ar=v({name:`ConfigPanel`,components:{MagicIcon:P,ElButton:R,Consumption:J,PromptInput:On,NegativePromptInput:Pn,ModelSelector:Ve,ModeSelector:Je,DurationSelector:it,RatioSelector:dt,StartImage:vt,CfgScaleSelector:$t,GenerateAudioSelector:sn,CameraControlSelector:_n,InspirationDrawer:Jn,SummaryChip:I(Zn,[[`render`,ir],[`__scopeId`,`data-v-c800852a`]]),EndImage:Tt,ReferenceImages:Gt,ReferenceVideo:Lt},emits:[`generate`],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},capabilities(){return X(this.config?.model,this.config?.mode,this.config?.duration)},omniActive(){return this.config?.model===`kling-o1`||!!(this.config?.image_list?.length||this.config?.video_list?.length)},consumption(){return L(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),or={class:`flex flex-col h-full`},sr={class:`flex-1 overflow-y-auto p-5`},cr={class:`flex flex-col items-center justify-center px-5 pb-5`};function lr(t,n,c,u,d,m){let h=l(`prompt-input`),_=l(`model-selector`),v=l(`ratio-selector`),y=l(`reference-images`),b=l(`reference-video`),x=l(`start-image`),S=l(`end-image`),C=l(`duration-selector`),w=l(`mode-selector`),T=l(`generate-audio-selector`),E=l(`camera-control-selector`),D=l(`cfg-scale-selector`),O=l(`negative-prompt-input`),k=l(`summary-chip`),A=l(`consumption`),j=l(`magic-icon`),M=l(`el-button`),ee=l(`inspiration-drawer`);return g(),s(`div`,or,[e(`div`,sr,[a(h,{class:`mb-4`,onOpenInspiration:n[0]||=e=>t.inspirationOpen=!0}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),t.capabilities.referenceImages?(g(),f(y,{key:0,class:`mb-3`})):o(``,!0),t.capabilities.referenceVideo?(g(),f(b,{key:1,class:`mb-4`})):o(``,!0),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`}),t.omniActive?o(``,!0):(g(),f(E,{key:2,class:`mb-4`})),t.omniActive?o(``,!0):(g(),f(D,{key:3,class:`mb-4`})),t.omniActive?o(``,!0):(g(),f(O,{key:4,class:`mb-4`}))]),e(`div`,cr,[a(k),a(A,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),t.config?.video_url!==void 0||t.config?.custom?(g(),f(M,{key:0,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(j,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.extend`)),1)]),_:1},8,[`onClick`])):(g(),f(M,{key:1,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(j,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generate`)),1)]),_:1},8,[`onClick`]))]),a(ee,{modelValue:t.inspirationOpen,"onUpdate:modelValue":n[1]||=e=>t.inspirationOpen=e},null,8,[`modelValue`])])}var ur=I(ar,[[`render`,lr]]),dr=v({name:`MotionImage`,components:{UploadIcon:N,ElUpload:C,ElButton:R,InfoIcon:Y,ImagePreview:q},mixins:[B,H],data(){return{fileList:[],uploadUrl:U()+`/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(){K.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){K.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()}}}),fr={class:`relative`},pr={class:`flex justify-between`},mr={class:`flex justify-start items-center`},hr={class:`text-sm font-bold`};function gr(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,fr,[e(`div`,pr,[e(`div`,mr,[e(`span`,hr,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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var _r=I(dr,[[`render`,gr],[`__scopeId`,`data-v-32f5471f`]]),vr=v({name:`MotionVideo`,components:{UploadIcon:N,ElUpload:C,ElButton:R,InfoIcon:Y,FilePreview:_e},mixins:[H],data(){return{fileList:[],uploadUrl:U()+`/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(){K.warning(this.$t(`kling.message.uploadVideoExceed`))},onError(){K.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:(K.error(this.$t(`kling.message.uploadVideoSizeExceed`)),!1):(K.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()}}}),yr={class:`relative`},br={class:`flex justify-between`},xr={class:`flex justify-start items-center`},Sr={class:`text-sm font-bold`};function Cr(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,yr,[e(`div`,br,[e(`div`,xr,[e(`span`,Sr,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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadVideoUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var wr=I(vr,[[`render`,Cr],[`__scopeId`,`data-v-80320d94`]]),Tr=v({name:`MotionPromptInput`,components:{ElInput:V,InfoIcon:Y},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||``},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),Er={class:`field`},Dr={class:`box`},Or={class:`title font-bold`};function kr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,Er,[e(`div`,Dr,[e(`h2`,Or,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 Ar=I(Tr,[[`render`,kr],[`__scopeId`,`data-v-ca9fdbe5`]]),jr=`video`,Mr=v({name:`CharacterOrientationSelector`,components:{ElRadioGroup:D,ElRadioButton:E,InfoIcon:Y},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||jr},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=jr)}}),Nr={class:`field`},Pr={class:`header`},Fr={class:`text-sm font-bold`};function Ir(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`,Nr,[e(`div`,Pr,[e(`span`,Fr,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 Lr=I(Mr,[[`render`,Ir],[`__scopeId`,`data-v-7a91195b`]]),Rr=`kling-v2-6`,zr=v({name:`MotionModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Y},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||Rr},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=Rr)}}),Br={class:`field`},Vr={class:`header`},Hr={class:`title font-bold`};function Ur(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Br,[e(`div`,Vr,[e(`h2`,Hr,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 Wr=I(zr,[[`render`,Ur],[`__scopeId`,`data-v-480e8da2`]]),Gr=`std`,Kr=v({name:`MotionModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Y},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||Gr},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=Gr)}}),qr={class:`field`},Jr={class:`header`},Yr={class:`title font-bold`};function Xr(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,qr,[e(`div`,Jr,[e(`h2`,Yr,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 Zr=I(Kr,[[`render`,Xr],[`__scopeId`,`data-v-1295688c`]]),Qr=v({name:`KeepOriginalSoundSelector`,components:{ElSwitch:j,InfoIcon:Y},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`})}}}}),$r={class:`relative`},ei={class:`flex justify-between items-center`},ti={class:`flex justify-start items-center`},ni={class:`text-sm font-bold`};function ri(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,$r,[e(`div`,ei,[e(`div`,ti,[e(`span`,ni,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 ii=v({name:`MotionPanel`,components:{MagicIcon:P,ElButton:R,Consumption:J,MotionImage:_r,MotionVideo:wr,MotionPromptInput:Ar,CharacterOrientationSelector:Lr,MotionModelSelector:Wr,MotionModeSelector:Zr,KeepOriginalSoundSelector:I(Qr,[[`render`,ri]])},emits:[`generate`],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return L({...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`)}}}),ai={class:`flex flex-col h-full`},oi={class:`flex-1 overflow-y-auto p-5`},si={class:`flex flex-col items-center justify-center px-5 pb-5`};function ci(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(`magic-icon`),C=l(`el-button`);return g(),s(`div`,ai,[e(`div`,oi,[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`,si,[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,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generateMotion`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var li=I(ii,[[`render`,ci]]),ui=v({name:`KlingTabSwitcher`,components:{ElTabs:x,ElTabPane:S,ElTag:ue},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)}}}),di=[`title`],fi={class:`text`};function pi(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 scenario-tabs scenario-tabs--divided`,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`,fi,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,di)]),_:2},1032,[`name`,`disabled`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var mi=I(ui,[[`render`,pi],[`__scopeId`,`data-v-4c7b6046`]]),hi={"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`},gi=v({name:`TalkingPhotoModelSelector`,components:{ElSelect:y,ElOption:b},data(){return{options:le.map(e=>({value:e,label:hi[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=ce)}}),_i={class:`field`},vi={class:`title font-bold`};function yi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,_i,[e(`h2`,vi,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 bi=I(gi,[[`render`,yi],[`__scopeId`,`data-v-cbc83d11`]]),xi=v({name:`TalkingPhotoModeSelector`,components:{ElSelect:y,ElOption:b},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`)}}),Si={class:`field`},Ci={class:`title font-bold`};function wi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Si,[e(`h2`,Ci,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:{MagicIcon:P,UploadIcon:N,ElUpload:C,ElButton:R,ElInput:V,Consumption:J,InfoIcon:Y,ImagePreview:q,ModelSelector:bi,ModeSelector:I(xi,[[`render`,wi],[`__scopeId`,`data-v-92525a1d`]])},mixins:[H],emits:[`generate`],data(){return{imageFiles:[],audioFiles:[],uploadUrl:U()+`/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 L({...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(){K.warning(this.$t(`kling.message.uploadReferencesExceed`))},onImageError(){K.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(){K.warning(this.$t(`kling.message.uploadAudioExceed`))},onAudioError(){K.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`)}}}),Ei={class:`flex flex-col h-full`},Di={class:`flex-1 overflow-y-auto p-5`},Oi={class:`relative mb-4`},ki={class:`flex justify-start items-center`},Ai={class:`text-sm font-bold`},ji={class:`relative mb-4`},Mi={class:`flex justify-start items-center`},Ni={class:`text-sm font-bold`},Pi=[`src`],Fi={class:`mb-4`},Ii={class:`flex justify-start items-center`},Li={class:`text-sm font-bold`},Ri={class:`flex flex-col items-center justify-center px-5 pb-5`};function zi(t,n,c,u,d,m){let h=l(`model-selector`),_=l(`mode-selector`),v=l(`info-icon`),y=l(`image-preview`),b=l(`upload-icon`),x=l(`el-button`),S=l(`el-upload`),C=l(`el-input`),w=l(`consumption`),T=l(`magic-icon`);return g(),s(`div`,Ei,[e(`div`,Di,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),e(`div`,Oi,[e(`div`,ki,[e(`span`,Ai,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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`])]),e(`div`,ji,[e(`div`,Mi,[e(`span`,Ni,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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),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,Pi)):o(``,!0)]),e(`div`,Fi,[e(`div`,Ii,[e(`span`,Li,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`,Ri,[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(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generateTalkingPhoto`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var Bi=I(Ti,[[`render`,zi],[`__scopeId`,`data-v-1cf65bf0`]]),Vi=v({name:`TaskPreview`,components:{ChannelIcon:te,InfoIcon:ie,MagicIcon:P,TimeIcon:ee,WarningIcon:oe,CopyToClipboard:ge,ElAlert:T,VideoPlayer:xe,ElTooltip:w,ElButton:R,ImagePreview:q,VideoPreview:we,AudioPreview:Te,ApiCodeButton:Se},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{isFailure(){let e=this.modelValue?.response;return e?.success===!1||!!e?.error||e?.state===`failed`||e?.state===`cancelled`},isWaiting(){let e=this.modelValue?.response;return!e||!this.isFailure&&e.success!==!0&&!e.video_url},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,r=this.modelValue?.request?.image_url;return t&&e.push({url:t,name:`start-image`}),n&&e.push({url:n,name:`end-image`}),r&&e.push({url:r,name:`reference-image`}),e},referenceVideos(){let e=[],t=this.modelValue?.request?.video_url;t&&e.push({url:t,name:`reference-video`});let n=this.modelValue?.request?.video_list;return(Array.isArray(n)?n:[]).forEach((t,n)=>{t?.video_url&&e.push({url:t.video_url,name:`reference-video-${n+1}`})}),e},referenceAudios(){let e=this.modelValue?.request?.audio_url;return e?[{url:e,name:`reference-audio`}]:[]}},methods:{onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),Hi={class:`preview`},Ui={class:`left`},Wi={class:`main`},Gi={class:`bot`},Ki={class:`datetime`},qi={class:`info`},Ji={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Yi={key:1,class:`prompt mt-2`},Xi={key:0},Zi={key:1},Qi={key:0,class:n({content:!0,failed:!0})},$i={key:0,class:`mb-4`},ea={key:1,class:n({operations:!0,"mt-2":!0})},ta={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},na={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ra={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ia={key:1,class:n({content:!0})},aa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},oa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},sa={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ca={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},la={key:2,class:n({content:!0})},ua={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},da={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function fa(t,n,u,d,m,_){let v=l(`capability-presentation`),y=l(`image-preview`),b=l(`video-preview`),x=l(`audio-preview`),S=l(`video-player`),C=l(`el-button`),w=l(`el-tooltip`),T=l(`api-code-button`),E=l(`channel-icon`),D=l(`magic-icon`),O=l(`copy-to-clipboard`),k=l(`time-icon`),A=l(`el-alert`),j=l(`warning-icon`),M=l(`info-icon`);return g(),s(`div`,Hi,[e(`div`,Ui,[a(v,{capability:`kling`,part:`avatar`,class:`avatar`})]),e(`div`,Wi,[e(`div`,Gi,[a(v,{capability:`kling`,part:`name`}),e(`span`,Ki,i(t.$dayjs.format(``+new Date(parseFloat((t.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,qi,[t.referenceImages.length>0||t.referenceVideos.length>0||t.referenceAudios.length>0?(g(),s(`div`,Ji,[(g(!0),s(c,null,h(t.referenceImages,(e,t)=>(g(),f(y,{key:`image-${t}`,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(t.referenceVideos,(e,t)=>(g(),f(b,{key:`video-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(t.referenceAudios,(e,t)=>(g(),f(x,{key:`audio-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128))])):o(``,!0),t.modelValue?.request?.prompt?(g(),s(`p`,Yi,[r(i(t.modelValue?.request?.prompt)+` `,1),t.modelValue?.response?t.isWaiting?(g(),s(`span`,Zi,` - (`+i(t.$t(`kling.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,Xi,` - (`+i(t.$t(`kling.status.pending`))+`) `,1))])):o(``,!0)]),t.modelValue?.response?.success===!0&&!t.isFailure?(g(),s(`div`,Qi,[t.modelValue?.response.video_url?(g(),s(`div`,$i,[a(S,{src:t.modelValue?.response.video_url},null,8,[`src`])])):o(``,!0),t.modelValue?.response.success?(g(),s(`div`,ea,[a(w,{class:`box-item`,effect:`dark`,content:t.$t(`kling.message.downloadVideo`),placement:`top-start`},{default:p(()=>[t.modelValue?.response.video_url?(g(),f(C,{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(T,{path:`/kling/videos`,body:t.modelValue?.request},null,8,[`body`])])):o(``,!0),a(A,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,ta,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.model`))+`: `+i(t.modelValue?.request?.model),1)]),e(`p`,na,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(O,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.elapsed?(g(),s(`p`,ra,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.elapsed`))+`: `+i(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),t.isFailure?(g(),s(`div`,ia,[a(A,{closable:!1,class:`failure`},{template:p(()=>[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,aa,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(O,{content:t.modelValue?.id},null,8,[`content`])]),e(`p`,oa,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.failureReason`))+`: `+i(t.modelValue?.response?.error?.message)+` `,1),a(O,{content:t.modelValue?.response?.error?.message},null,8,[`content`])]),t.modelValue?.elapsed?(g(),s(`p`,sa,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),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`,ca,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.traceId`))+`: `+i(t.modelValue?.response?.trace_id)+` `,1),a(O,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),t.isWaiting?(g(),s(`div`,la,[a(A,{closable:!1,class:`info`},{template:p(()=>[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(t.modelValue?.response?`kling.status.processing`:`kling.status.pending`)),1)]),default:p(()=>[e(`p`,ua,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(O,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.response?.trace_id?(g(),s(`p`,da,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.traceId`))+`: `+i(t.modelValue?.response?.trace_id)+` `,1),a(O,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var pa=v({name:`RecentPanel`,components:{TaskPreview:I(Vi,[[`render`,fa],[`__scopeId`,`data-v-d5f75276`]]),NoTasks:ye,BotPlaceholder:Ce,ScrollList:ve},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?.()}}}),ma={key:0},ha={key:2,class:`w-full h-full flex items-center justify-center`};function ga(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`,ma,[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`,ha,[a(v)])):o(``,!0)],64)}var _a=v({name:`KlingIndex`,components:{ConfigPanel:ur,MotionPanel:li,TalkingPhotoPanel:Bi,TabSwitcher:mi,Layout:je,RecentPanel:I(pa,[[`render`,ga]])},mixins:[fe],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===he.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===he.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 be({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`kling/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`kling/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();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(!de(this.uploadTracker,e=>this.$t(e),e=>K.warning(e)))return;let{camera_control:e,...t}=this.config||{},n={...t,async:!0},r=Number(!!n.start_image_url)+Number(!!n.end_image_url),i=n.image_list?.length||0,a=n.video_list?.length?4:7;if(r+i>a){K.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:a}));return}if(n.video_list?.[0]?.refer_type===`base`&&(n.start_image_url||n.end_image_url||n.image_list?.some(({type:e})=>e))){K.warning(this.$t(`kling.message.baseVideoFrameConflict`));return}if(!n.video_id&&!t.video_url&&!n.start_image_url&&n.end_image_url){K.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))}:{}}),!W())return;let o=this.credential?.token;if(!o){console.error(`no token specified`);return}K.info(this.$t(`kling.message.startingTask`)),G(`kling`,z.generate(n,{token:o})).then(()=>{K.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?K.error(this.$t(`kling.message.usedUp`)):K.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(!de(this.uploadTracker,e=>this.$t(e),e=>K.warning(e)))return;let e=this.motionConfig||{};if(!e.image_url||!e.video_url){K.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(!W())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}K.info(this.$t(`kling.message.startingTask`)),G(`kling`,z.motion(t,{token:n})).then(()=>{K.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?K.error(this.$t(`kling.message.usedUp`)):K.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},async onGenerateTalkingPhoto(){if(!de(this.uploadTracker,e=>this.$t(e),e=>K.warning(e)))return;let e=this.talkingPhotoConfig||{};if(!e.image_url||!e.audio_url){K.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(!W())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}K.info(this.$t(`kling.message.startingTask`)),G(`kling`,z.talkingPhoto(t,{token:n})).then(()=>{K.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?K.error(this.$t(`kling.message.usedUp`)):K.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),va={class:`flex flex-col h-full`},ya={class:`flex-1 min-h-0`};function ba(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`,va,[a(u,{"model-value":t.taskType,"onUpdate:modelValue":t.onTabChange},null,8,[`model-value`,`onUpdate:modelValue`]),e(`div`,ya,[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 xa=I(_a,[[`render`,ba]]);export{xa as default};
|
|
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{r as y,t as b}from"./select-CY8L3FpM.js";import{n as x,t as S}from"./tabs-tYFbYhk_.js";import{t as C}from"./upload--OMy2H6L.js";import{t as w}from"./tooltip-BWksRWUx.js";import{t as T}from"./alert-BsVzeQZL.js";import{n as E,r as D}from"./radio-DgDgyT2l.js";import{t as O}from"./drawer-91Rv4Ele.js";import{t as k}from"./input-number-DFaagkZ1.js";import{t as A}from"./slider-D3nQy28g.js";import{t as j}from"./switch-tSKAoZ0l.js";import{n as M}from"./taskDrawerMixin-BbwfrIGa.js";import{t as ee}from"./clock-DmoJeS1-.js";import{r as te,t as ne}from"./PromptTextarea-BwQ2pgsq.js";import{t as re}from"./headphones-BYpy8Yka.js";import{t as ie}from"./info-CsXueTRq.js";import{t as ae}from"./lightbulb-BLCPwpqb.js";import{t as oe}from"./triangle-alert-D3h6_VD_.js";import{t as N}from"./upload-UU_EKVx7.js";import{t as P}from"./wand-sparkles-G_omarUp.js";import{ai as se,ci as ce,li as le,ui as F}from"./constants-Dwvkb2qI.js";import{Ai as ue,Bt as de,E as I,Gt as L,Ht as fe,Mi as R,Un as z,Ut as B,Vi as V,Vt as H,_i as pe,ai as U,en as W,gr as G,hi as me,ni as he,vi as K}from"./index-D11lR21M.js";import{t as ge}from"./CopyToClipboard-DMzrmhs6.js";import{t as _e}from"./FilePreview-k9s4AWkh.js";import{t as q}from"./ImagePreview-CqonQxaO.js";import{t as J}from"./Consumption-C5-QJWxc.js";import{a as Y,n as ve,r as ye,t as be}from"./pagination-Blfeoga3.js";import{t as xe}from"./VideoPlayer-DfQm-G_M.js";import{t as Se}from"./ApiCodeButton-ESjV90I4.js";import{t as Ce}from"./BotPlaceholder-60Ittost.js";import{n as we,t as Te}from"./AudioPreview-6icOwV8b.js";var Ee=v({name:`LayoutKling`,components:{MagicIcon:P,ElDrawer:O,ElButton:R},mixins:[M]}),De={class:`main flex flex-row flex-1 min-h-0`},Oe={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},ke={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ae(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,De,[e(`div`,Oe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,ke,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var je=I(Ee,[[`render`,Ae],[`__scopeId`,`data-v-2d826924`]]),Me={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};function X(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,referenceImages:!1};case`kling-v1-6`:case`kling-v2-5-turbo`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v2-6`:return{text2video:!0,image2video:!0,endImage:r===`pro`,audio:r===`pro`,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v2-master`:case`kling-v2-1-master`:return{text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};case`kling-v3`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:r!==`4k`,referenceVideo:!1,referenceImages:!1};case`kling-v3-omni`:return{text2video:!0,image2video:!0,endImage:!0,audio:!0,motionControl:!1,referenceVideo:!0,referenceImages:!0};case`kling-o1`:return{text2video:!0,image2video:!0,endImage:!0,audio:!1,motionControl:!1,referenceVideo:!0,referenceImages:!0};default:return Me}}var Z=`<<<video_1>>>`,Ne=/<<<image_\d+>>>/g;function Pe(e){return e?e.split(Z).join(` `).replace(/\s{2,}/g,` `).trim():``}function Fe(e){return e?e.replace(Ne,` `).replace(/\s{2,}/g,` `).trim():``}function Q(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=X(n,r,i),o=[];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`}),e.image_list?.length&&!a.referenceImages&&o.push({field:`image_list`,i18nLabel:`kling.name.referenceImages`});let s=n===`kling-o1`||!!(e.image_list?.length||e.video_list?.length);return s&&e.cfg_scale!==void 0&&o.push({field:`cfg_scale`,i18nLabel:`kling.name.cfgScale`}),s&&e.negative_prompt&&o.push({field:`negative_prompt`,i18nLabel:`kling.name.negativePrompt`}),o}function Ie(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===`cfg_scale`&&(n.cfg_scale=void 0),e.field===`negative_prompt`&&(n.negative_prompt=void 0),e.field===`video_list`&&(n.video_list=void 0,n.prompt=Pe(n.prompt)),e.field===`image_list`&&(n.image_list=void 0,n.prompt=Fe(n.prompt));return n}var Le=v({name:`ModelSelector`,components:{ElSelect:y,ElOption:b},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-o1`,label:`Kling O1`}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(se)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=Q(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await pe.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=Ie({...t,model:e},n);this.$store.commit(`kling/setConfig`,i),K.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})}}}),Re={class:`field`},ze={class:`title font-bold`};function Be(t,n,r,a,o,u){let d=l(`el-option`),m=l(`el-select`);return g(),s(`div`,Re,[e(`h2`,ze,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 Ve=I(Le,[[`render`,Be],[`__scopeId`,`data-v-a74e7f31`]]),He=v({name:`ModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Y},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},cameraControlSet(){return!!this.$store.state.kling?.config?.camera_control?.type},fourKReason(){return F.includes(this.selectedModel)?this.cameraControlSet?this.$t(`kling.description.mode4kIncompatibleCamera`):``:this.$t(`kling.description.mode4kRequiresV3`)},options(){return[{value:`std`,label:this.$t(`kling.name.modeStd`),disabled:!1,disabledReason:``},{value:`pro`,label:this.$t(`kling.name.modePro`),disabled:!1,disabledReason:``},{value:`4k`,label:this.$t(`kling.name.mode4k`),disabled:!!this.fourKReason,disabledReason:this.fourKReason}]},value(){return this.$store.state.kling?.config?.mode}},watch:{fourKReason(e){e&&this.value===`4k`&&this.applyMode(`std`)}},mounted(){this.value||this.applyMode(`std`)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=Q(t,{mode:e});if(n.length===0){this.applyMode(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await pe.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=Ie({...t,mode:e},n);this.$store.commit(`kling/setConfig`,i),K.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})}}}),Ue={class:`field`},We={class:`header`},Ge={class:`title font-bold`},Ke={key:0,class:`opt-tip`};function qe(t,r,u,d,m,_){let v=l(`info-icon`),y=l(`el-option`),b=l(`el-select`);return g(),s(`div`,Ue,[e(`div`,We,[e(`h2`,Ge,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`,Ke,i(t.disabledReason),1)):o(``,!0)]),_:2},1032,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var Je=I(He,[[`render`,qe],[`__scopeId`,`data-v-9a8fa3c5`]]),Ye=[3,5,8,10,12,15],Xe=[5,10],Ze=[5],Qe=v({name:`DurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Y},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},isV3Model(){return F.includes(this.selectedModel)},allowedDurations(){return this.selectedModel===`kling-o1`?Ze:this.isV3Model?Ye:Xe},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:{selectedModel(){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=Q(t,{duration:e});if(n.length===0){this.applyDuration(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await pe.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=Ie({...t,duration:e},n);this.$store.commit(`kling/setConfig`,i),K.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})}}}),$e={class:`field`},et={class:`control`},tt={class:`label`},nt={class:`title font-bold`};function rt(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,$e,[e(`div`,et,[e(`div`,tt,[e(`h2`,nt,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 it=I(Qe,[[`render`,rt],[`__scopeId`,`data-v-496bf31c`]]),at=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`}}),ot={class:`text-sm font-bold mb-2 block`},st={class:`items`},ct=[`onClick`],lt={class:`name`};function ut(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,ot,i(t.$t(`kling.name.ratio`)),1),e(`div`,st,[(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`,lt,i(r.label),1)],10,ct))),128))])])}var dt=I(at,[[`render`,ut],[`__scopeId`,`data-v-cdb14b2f`]]),ft=v({name:`StartImage`,components:{UploadIcon:N,ElUpload:C,ElButton:R,ElTooltip:w,InfoIcon:Y,ImagePreview:q},mixins:[B,H],emits:[`change`],data(){return{fileList:[],uploadUrl:U()+`/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(){}}},watch:{value(e){!e&&this.fileList.length>0&&(this.fileList=[])}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){K.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){K.error(this.$t(`kling.message.uploadReferencesError`))},onBeforeUpload(){let e=this.$store.state.kling?.config||{};if(e.video_list?.[0]?.refer_type===`base`)return K.warning(this.$t(`kling.message.baseVideoFrameConflict`)),!1;let t=e.video_list?.length?4:7;return(e.image_list?.length||0)+Number(!!e.end_image_url)+1>t?(K.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:t})),!1):!0},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`kling/setConfig`,{...this.$store.state?.kling?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetStartImageUrl()}}}),pt={class:`relative`},mt={class:`flex min-h-8 items-center pr-20`},ht={class:`flex justify-start items-center`},gt={class:`text-sm font-bold`};function _t(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,pt,[e(`div`,mt,[e(`div`,ht,[e(`span`,gt,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`,"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.onRemove(e)},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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),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 vt=I(ft,[[`render`,_t],[`__scopeId`,`data-v-0220ed34`]]),yt=v({name:`EndImage`,components:{UploadIcon:N,ElUpload:C,ElButton:R,ElTooltip:w,ImagePreview:q,InfoIcon:Y},mixins:[B,H],data(){return{fileList:[],uploadUrl:U()+`/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 X(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(){if(!this.endImageSupported)return K.warning(this.$t(`kling.message.endImageNotSupported`)),!1;if(!this.hasStartImage)return K.warning(this.$t(`kling.message.endImageRequiresStart`)),!1;if(this.klingConfig.video_list?.[0]?.refer_type===`base`)return K.warning(this.$t(`kling.message.baseVideoFrameConflict`)),!1;let e=this.klingConfig.video_list?.length?4:7;return(this.klingConfig.image_list?.length||0)+2>e?(K.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:e})),!1):!0},onExceed(){K.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){K.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()},onRemove(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetEndImageUrl()}}}),bt={class:`relative`},xt={class:`flex min-h-8 items-center pr-20`},St={class:`flex justify-start items-center`},Ct={class:`text-sm font-bold`};function wt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-tooltip`),x=l(`el-upload`);return g(),s(`div`,bt,[e(`div`,xt,[e(`div`,St,[e(`span`,Ct,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.onRemove(e)},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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),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 Tt=I(yt,[[`render`,wt],[`__scopeId`,`data-v-b2eaa919`]]),Et=v({name:`ReferenceVideo`,components:{ElUpload:C,ElButton:R,ElRadioButton:E,ElRadioGroup:D,ElSwitch:j,InfoIcon:Y,FilePreview:_e,UploadIcon:N},mixins:[H],data(){return{fileList:[],uploadUrl:U()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},config(){return this.$store.state.kling?.config||{}},hasVideo(){return!!this.urls?.[0]},referenceType:{get(){return this.config.video_list?.[0]?.refer_type||`feature`},set(e){this.updateVideoOptions(e,this.keepOriginalSound)}},keepOriginalSound:{get(){return this.config.video_list?.[0]?.keep_original_sound===`yes`},set(e){this.updateVideoOptions(this.referenceType,e)}}},methods:{onExceed(){K.warning(this.$t(`kling.message.referenceVideoExceed`))},onError(){K.error(this.$t(`kling.message.referenceVideoError`))},beforeUpload(e){if((this.config.image_list?.length||0)+Number(!!this.config.start_image_url)+Number(!!this.config.end_image_url)>4)return K.error(this.$t(`kling.message.referenceVideoImageLimit`)),!1;let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=e.size/1024/1024<200;return t?n?!0:(K.error(this.$t(`kling.message.referenceVideoSizeExceed`)),!1):(K.error(this.$t(`kling.message.referenceVideoTypeFailed`)),!1)},ensurePromptToken(e){let t=this.$store.state.kling?.config,n=t?.prompt||``,r=n.includes(Z),i;if(e&&!r)i=n?`${n} ${Z}`:Z;else if(!e&&r)i=Pe(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:this.referenceType,keep_original_sound:this.keepOriginalSound?`yes`:`no`}]:void 0;this.$store.commit(`kling/setConfig`,{...this.config,video_list:t,generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0}),this.ensurePromptToken(!!e)},updateVideoOptions(e,t){let n=this.urls?.[0];n&&this.$store.commit(`kling/setConfig`,{...this.config,video_list:[{video_url:n,refer_type:e,keep_original_sound:t?`yes`:`no`}],...e===`base`?{start_image_url:void 0,end_image_url:void 0}:{},generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0})},async onSuccess(){this.onSetVideoList()}}}),Dt={class:`relative`},Ot={class:`flex min-h-8 items-center pr-20`},kt={class:`flex justify-start items-center`},At={class:`text-sm font-bold`},jt={key:0,class:`reference-options mt-3 flex flex-col gap-3`},Mt={class:`flex flex-col items-stretch gap-2 sm:flex-row sm:items-center sm:justify-between`},Nt={class:`text-sm`},Pt={class:`flex items-center justify-between gap-3`},Ft={class:`text-sm`};function It(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`),x=l(`el-radio-button`),S=l(`el-radio-group`),C=l(`el-switch`);return g(),s(`div`,Dt,[e(`div`,Ot,[e(`div`,kt,[e(`span`,At,i(t.$t(`kling.name.referenceVideo`)),1),a(h,{content:t.$t(`kling.description.omniReferenceVideo`)},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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferenceVideo`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`]),t.hasVideo?(g(),s(`div`,jt,[e(`div`,Mt,[e(`span`,Nt,i(t.$t(`kling.name.referenceVideoType`)),1),a(S,{modelValue:t.referenceType,"onUpdate:modelValue":n[1]||=e=>t.referenceType=e,size:`small`},{default:p(()=>[a(x,{value:`feature`},{default:p(()=>[r(i(t.$t(`kling.name.referenceVideoFeature`)),1)]),_:1}),a(x,{value:`base`},{default:p(()=>[r(i(t.$t(`kling.name.referenceVideoBase`)),1)]),_:1})]),_:1},8,[`modelValue`])]),e(`div`,Pt,[e(`span`,Ft,i(t.$t(`kling.name.keepOriginalSound`)),1),a(C,{modelValue:t.keepOriginalSound,"onUpdate:modelValue":n[2]||=e=>t.keepOriginalSound=e},null,8,[`modelValue`])])])):o(``,!0)])}var Lt=I(Et,[[`render`,It],[`__scopeId`,`data-v-7bb04cb4`]]),Rt=v({name:`KlingReferenceImages`,components:{ElButton:R,ElUpload:C,UploadIcon:N,ImagePreview:q,InfoIcon:Y},mixins:[B,H],data(){return{fileList:[],uploadUrl:U()+`/api/v1/files/`}},computed:{config(){return this.$store.state.kling?.config||{}},headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},frameCount(){return Number(!!this.config.start_image_url)+Number(!!this.config.end_image_url)},maxImages(){return this.config.video_list?.length?4:7},referenceLimit(){return Math.max(0,this.maxImages-this.frameCount)},remainingSlots(){return Math.max(0,this.referenceLimit-this.urls.length)},urls(){return this.fileList.map(e=>e.response?.file_url||e.url).filter(Boolean)},storeImages(){return this.config.image_list}},watch:{frameCount(){this.syncPromptTokens()},storeImages(e){!e?.length&&this.fileList.length>0&&(this.fileList=[])}},methods:{beforeUpload(){return this.remainingSlots===0?(this.onExceed(),!1):!0},onExceed(){K.warning(this.$t(`kling.message.referenceImagesExceed`,{count:this.remainingSlots}))},onError(){K.error(this.$t(`kling.message.referenceImagesError`))},clearOmniConflicts(e){return{...e,generate_audio:!1,camera_control:void 0,cfg_scale:void 0,negative_prompt:void 0}},syncPromptTokens(e){let t=e||this.config,n=[Fe(t.prompt),...this.urls.map((e,t)=>`<<<image_${this.frameCount+t+1}>>>`)].filter(Boolean).join(` `);n!==t.prompt&&this.$store.commit(`kling/setConfig`,{...t,prompt:n})},syncConfig(){let e=this.urls.length?this.urls.map(e=>({image_url:e})):void 0,t=this.clearOmniConflicts({...this.config,image_list:e});this.$store.commit(`kling/setConfig`,t),this.syncPromptTokens(t)},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.syncConfig()},onRemove(e,t){this.fileList.splice(e,1),t.url?.startsWith(`blob:`)&&URL.revokeObjectURL(t.url),this.syncConfig()}}}),zt={class:`relative`},Bt={class:`flex justify-between items-center`},Vt={class:`flex justify-start items-center`},Ht={class:`text-sm font-bold`},Ut={key:0,class:`file-list flex flex-wrap gap-2 mt-2`};function Wt(t,n,u,d,m,_){let v=l(`info-icon`),y=l(`UploadIcon`),b=l(`el-button`),x=l(`el-upload`),S=l(`image-preview`);return g(),s(`div`,zt,[e(`div`,Bt,[e(`div`,Vt,[e(`span`,Ht,i(t.$t(`kling.name.referenceImages`)),1),a(v,{content:t.$t(`kling.description.referenceImages`)},null,8,[`content`])]),a(x,{"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg`,name:`file`,limit:t.referenceLimit,multiple:!0,"show-file-list":!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{default:p(()=>[a(b,{round:``,type:`primary`,size:`small`,disabled:t.remainingSlots===0},{default:p(()=>[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferenceImages`)),1)]),_:1},8,[`disabled`])]),_:1},8,[`file-list`,`limit`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])]),t.fileList.length?(g(),s(`div`,Ut,[(g(!0),s(c,null,h(t.fileList,(e,n)=>(g(),f(S,{key:e.uid||e.url||n,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemove(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])):o(``,!0)])}var Gt=I(Rt,[[`render`,Wt]]),Kt=v({name:`CfgScaleSelector`,components:{ElSlider:A,InfoIcon:Y,ElInputNumber:k},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}}),qt={class:`flex justify-between`},Jt={class:`flex justify-start items-center`},Yt={class:`text-sm font-bold`},Xt={class:`flex justify-end items-center`},Zt={class:`w-full`};function Qt(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`,qt,[e(`div`,Jt,[e(`span`,Yt,i(t.$t(`kling.name.cfgScale`)),1),a(d,{content:t.$t(`kling.description.cfgScale`)},null,8,[`content`])]),e(`div`,Xt,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,Zt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:0,max:1,step:.1},null,8,[`modelValue`])])])}var $t=I(Kt,[[`render`,Qt]]),en=v({name:`GenerateAudioSelector`,components:{ElSwitch:j,InfoIcon:Y},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},selectedMode(){return this.$store.state.kling?.config?.mode||``},supported(){return!!(F.includes(this.selectedModel)||this.selectedModel===`kling-v2-6`&&this.selectedMode===`pro`)},tooltipContent(){return this.supported?this.$t(`kling.description.generateAudio`):this.$t(`kling.description.generateAudioUnsupported`)},value:{get(){return this.supported?this.$store.state.kling?.config?.generate_audio??!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})}}}),tn={class:`relative`},nn={class:`flex justify-between items-center`},rn={class:`flex justify-start items-center`},an={class:`text-sm font-bold`};function on(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,tn,[e(`div`,nn,[e(`div`,rn,[e(`span`,an,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 sn=I(en,[[`render`,on]]),cn=[`horizontal`,`vertical`,`pan`,`tilt`,`roll`,`zoom`],ln=v({name:`CameraControlSelector`,components:{ElSelect:y,ElOption:b,ElSlider:A,ElInputNumber:k,InfoIcon:Y},data(){return{configKeys:cn}},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 X(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)}}}),un={class:`field`},dn={class:`header`},fn={class:`text-sm font-bold`},pn={key:0,class:`config-grid`},mn={class:`cfg-row-head`},hn={class:`cfg-name`};function gn(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`,un,[e(`div`,dn,[e(`span`,fn,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`,pn,[(g(!0),s(c,null,h(t.configKeys,n=>(g(),s(`div`,{key:n,class:`cfg-row`},[e(`div`,mn,[e(`span`,hn,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 _n=I(ln,[[`render`,gn],[`__scopeId`,`data-v-cd896060`]]),vn=[{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`]}],$=`, `;function yn(e,t){let n=(e||``).trim();return n?n.includes(t)?n:`${n}${$}${t}`:t}function bn(e,t){if(!e||!t)return e||``;let n=[`${t}${$}`,`${$}${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 xn=v({name:`InspirationPills`,components:{CloseIcon:me},computed:{prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return vn.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=bn(this.prompt,e);this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:t})}}}),Sn={key:0,class:`pills`,role:`list`},Cn={class:`pill-text`},wn=[`aria-label`,`title`,`onClick`];function Tn(n,r,u,d,f,p){let m=l(`close-icon`);return n.selected.length>0?(g(),s(`div`,Sn,[(g(!0),s(c,null,h(n.selected,r=>(g(),s(`div`,{key:r,class:`pill`,role:`listitem`},[e(`span`,Cn,i(r),1),e(`button`,{type:`button`,class:`pill-remove`,"aria-label":n.$t(`kling.inspiration.removeChip`),title:n.$t(`kling.inspiration.removeChip`),onClick:t(e=>n.onRemove(r),[`stop`])},[a(m,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,wn)]))),128))])):o(``,!0)}var En=v({name:`PromptInput`,components:{IdeaIcon:ae,ElButton:R,PromptTextarea:ne,InspirationPills:I(xn,[[`render`,Tn],[`__scopeId`,`data-v-6be01bcf`]])},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 Dn(e,t,n,o,s,c){let u=l(`idea-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,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(e.$t(`kling.inspiration.openButton`)),1)]),_:1})]),before:p(()=>[a(m)]),_:1},8,[`modelValue`,`title`,`info`,`placeholder`])}var On=I(En,[[`render`,Dn],[`__scopeId`,`data-v-5754ae54`]]),kn=v({name:`NegativePromptInput`,components:{ElInput:V,InfoIcon:Y},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||=``}}),An={class:`field`},jn={class:`box`},Mn={class:`title font-bold`};function Nn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,An,[e(`div`,jn,[e(`h2`,Mn,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 Pn=I(kn,[[`render`,Nn],[`__scopeId`,`data-v-de98cf01`]]),Fn=v({name:`InspirationDrawer`,components:{Close:me,IdeaIcon:ae,ElDrawer:O,ElButton:R},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`],data(){return{groups:vn}},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(bn(this.prompt,e)):this.setPrompt(yn(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(let t of this.allChipTexts)for(;e.includes(t);)e=bn(e,t);this.setPrompt(e)}}}),In={class:`drawer-content`},Ln={class:`drawer-header`},Rn={class:`title-row`},zn={class:`title`},Bn={class:`hint`},Vn={key:0,class:`selected-bar`},Hn={class:`selected-text`},Un={class:`groups`},Wn={class:`group-title`},Gn={class:`chip-grid`},Kn=[`onClick`];function qn(t,u,d,m,_,v){let y=l(`idea-icon`),b=l(`close`),x=l(`el-button`),S=l(`el-drawer`);return g(),f(S,{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`,In,[e(`div`,Ln,[e(`div`,Rn,[a(y,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,zn,i(t.$t(`kling.inspiration.title`)),1)]),a(x,{text:``,class:`close-btn`,"aria-label":t.$t(`common.button.close`),title:t.$t(`common.button.close`),onClick:u[0]||=e=>t.visible=!1},{default:p(()=>[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`])]),e(`div`,Bn,i(t.$t(`kling.inspiration.hint`)),1),t.selectedCount>0?(g(),s(`div`,Vn,[e(`span`,Hn,i(t.$t(`kling.inspiration.selectedSummary`,{count:t.selectedCount})),1),a(x,{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`,Un,[(g(!0),s(c,null,h(t.groups,r=>(g(),s(`div`,{key:r.groupKey,class:`group`},[e(`div`,Wn,i(t.$t(`kling.inspiration.group.${r.groupKey}`)),1),e(`div`,Gn,[(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,Kn))),128))])]))),128))])])]),_:1},8,[`modelValue`,`size`])}var Jn=I(Fn,[[`render`,qn],[`__scopeId`,`data-v-8b2e6a5d`]]),Yn={"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-o1":`Kling O1`},Xn={std:`720p`,pro:`1080p`,"4k":`4K`},Zn=v({name:`SummaryChip`,components:{AudioIcon:re},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){let e=this.config?.model||`kling-v2-5-turbo`;return Yn[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||``},modeLabel(){let e=this.config?.mode||`std`;return Xn[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),Qn={class:`summary-chip`},$n=[`title`],er=[`title`],tr=[`title`],nr=[`title`],rr=[`title`];function ir(t,n,r,c,u,d){let f=l(`audio-icon`);return g(),s(`div`,Qn,[e(`span`,{class:`part`,title:t.$t(`kling.name.model`)},i(t.modelLabel),9,$n),n[0]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.duration`)},i(t.durationLabel),9,er),n[1]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.ratio`)},i(t.aspectRatio||`16:9`),9,tr),n[2]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.mode`)},i(t.modeLabel),9,nr),t.generateAudio?(g(),s(`span`,{key:0,class:`audio`,title:t.$t(`kling.name.generateAudio`)},[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,rr)):o(``,!0)])}var ar=v({name:`ConfigPanel`,components:{MagicIcon:P,ElButton:R,Consumption:J,PromptInput:On,NegativePromptInput:Pn,ModelSelector:Ve,ModeSelector:Je,DurationSelector:it,RatioSelector:dt,StartImage:vt,CfgScaleSelector:$t,GenerateAudioSelector:sn,CameraControlSelector:_n,InspirationDrawer:Jn,SummaryChip:I(Zn,[[`render`,ir],[`__scopeId`,`data-v-c800852a`]]),EndImage:Tt,ReferenceImages:Gt,ReferenceVideo:Lt},emits:[`generate`],data(){return{inspirationOpen:!1}},computed:{config(){return this.$store.state.kling?.config},capabilities(){return X(this.config?.model,this.config?.mode,this.config?.duration)},omniActive(){return this.config?.model===`kling-o1`||!!(this.config?.image_list?.length||this.config?.video_list?.length)},consumption(){return L(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),or={class:`flex flex-col h-full`},sr={class:`flex-1 overflow-y-auto p-5`},cr={class:`flex flex-col items-center justify-center px-5 pb-5`};function lr(t,n,c,u,d,m){let h=l(`prompt-input`),_=l(`model-selector`),v=l(`ratio-selector`),y=l(`reference-images`),b=l(`reference-video`),x=l(`start-image`),S=l(`end-image`),C=l(`duration-selector`),w=l(`mode-selector`),T=l(`generate-audio-selector`),E=l(`camera-control-selector`),D=l(`cfg-scale-selector`),O=l(`negative-prompt-input`),k=l(`summary-chip`),A=l(`consumption`),j=l(`magic-icon`),M=l(`el-button`),ee=l(`inspiration-drawer`);return g(),s(`div`,or,[e(`div`,sr,[a(h,{class:`mb-4`,onOpenInspiration:n[0]||=e=>t.inspirationOpen=!0}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),t.capabilities.referenceImages?(g(),f(y,{key:0,class:`mb-3`})):o(``,!0),t.capabilities.referenceVideo?(g(),f(b,{key:1,class:`mb-4`})):o(``,!0),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`}),t.omniActive?o(``,!0):(g(),f(E,{key:2,class:`mb-4`})),t.omniActive?o(``,!0):(g(),f(D,{key:3,class:`mb-4`})),t.omniActive?o(``,!0):(g(),f(O,{key:4,class:`mb-4`}))]),e(`div`,cr,[a(k),a(A,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),t.config?.video_url!==void 0||t.config?.custom?(g(),f(M,{key:0,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(j,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.extend`)),1)]),_:1},8,[`onClick`])):(g(),f(M,{key:1,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(j,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generate`)),1)]),_:1},8,[`onClick`]))]),a(ee,{modelValue:t.inspirationOpen,"onUpdate:modelValue":n[1]||=e=>t.inspirationOpen=e},null,8,[`modelValue`])])}var ur=I(ar,[[`render`,lr]]),dr=v({name:`MotionImage`,components:{UploadIcon:N,ElUpload:C,ElButton:R,InfoIcon:Y,ImagePreview:q},mixins:[B,H],data(){return{fileList:[],uploadUrl:U()+`/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(){K.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){K.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()}}}),fr={class:`relative`},pr={class:`flex justify-between`},mr={class:`flex justify-start items-center`},hr={class:`text-sm font-bold`};function gr(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,fr,[e(`div`,pr,[e(`div`,mr,[e(`span`,hr,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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var _r=I(dr,[[`render`,gr],[`__scopeId`,`data-v-32f5471f`]]),vr=v({name:`MotionVideo`,components:{UploadIcon:N,ElUpload:C,ElButton:R,InfoIcon:Y,FilePreview:_e},mixins:[H],data(){return{fileList:[],uploadUrl:U()+`/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(){K.warning(this.$t(`kling.message.uploadVideoExceed`))},onError(){K.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:(K.error(this.$t(`kling.message.uploadVideoSizeExceed`)),!1):(K.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()}}}),yr={class:`relative`},br={class:`flex justify-between`},xr={class:`flex justify-start items-center`},Sr={class:`text-sm font-bold`};function Cr(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return g(),s(`div`,yr,[e(`div`,br,[e(`div`,xr,[e(`span`,Sr,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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadVideoUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var wr=I(vr,[[`render`,Cr],[`__scopeId`,`data-v-80320d94`]]),Tr=v({name:`MotionPromptInput`,components:{ElInput:V,InfoIcon:Y},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||``},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),Er={class:`field`},Dr={class:`box`},Or={class:`title font-bold`};function kr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,Er,[e(`div`,Dr,[e(`h2`,Or,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 Ar=I(Tr,[[`render`,kr],[`__scopeId`,`data-v-ca9fdbe5`]]),jr=`video`,Mr=v({name:`CharacterOrientationSelector`,components:{ElRadioGroup:D,ElRadioButton:E,InfoIcon:Y},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||jr},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=jr)}}),Nr={class:`field`},Pr={class:`header`},Fr={class:`text-sm font-bold`};function Ir(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`,Nr,[e(`div`,Pr,[e(`span`,Fr,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 Lr=I(Mr,[[`render`,Ir],[`__scopeId`,`data-v-7a91195b`]]),Rr=`kling-v2-6`,zr=v({name:`MotionModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Y},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||Rr},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=Rr)}}),Br={class:`field`},Vr={class:`header`},Hr={class:`title font-bold`};function Ur(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Br,[e(`div`,Vr,[e(`h2`,Hr,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 Wr=I(zr,[[`render`,Ur],[`__scopeId`,`data-v-480e8da2`]]),Gr=`std`,Kr=v({name:`MotionModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Y},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||Gr},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=Gr)}}),qr={class:`field`},Jr={class:`header`},Yr={class:`title font-bold`};function Xr(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,qr,[e(`div`,Jr,[e(`h2`,Yr,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 Zr=I(Kr,[[`render`,Xr],[`__scopeId`,`data-v-1295688c`]]),Qr=v({name:`KeepOriginalSoundSelector`,components:{ElSwitch:j,InfoIcon:Y},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`})}}}}),$r={class:`relative`},ei={class:`flex justify-between items-center`},ti={class:`flex justify-start items-center`},ni={class:`text-sm font-bold`};function ri(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,$r,[e(`div`,ei,[e(`div`,ti,[e(`span`,ni,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 ii=v({name:`MotionPanel`,components:{MagicIcon:P,ElButton:R,Consumption:J,MotionImage:_r,MotionVideo:wr,MotionPromptInput:Ar,CharacterOrientationSelector:Lr,MotionModelSelector:Wr,MotionModeSelector:Zr,KeepOriginalSoundSelector:I(Qr,[[`render`,ri]])},emits:[`generate`],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return L({...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`)}}}),ai={class:`flex flex-col h-full`},oi={class:`flex-1 overflow-y-auto p-5`},si={class:`flex flex-col items-center justify-center px-5 pb-5`};function ci(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(`magic-icon`),C=l(`el-button`);return g(),s(`div`,ai,[e(`div`,oi,[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`,si,[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,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generateMotion`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var li=I(ii,[[`render`,ci]]),ui=v({name:`KlingTabSwitcher`,components:{ElTabs:x,ElTabPane:S,ElTag:ue},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)}}}),di=[`title`],fi={class:`text`};function pi(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 scenario-tabs scenario-tabs--divided`,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`,fi,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,di)]),_:2},1032,[`name`,`disabled`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var mi=I(ui,[[`render`,pi],[`__scopeId`,`data-v-4c7b6046`]]),hi={"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`},gi=v({name:`TalkingPhotoModelSelector`,components:{ElSelect:y,ElOption:b},data(){return{options:le.map(e=>({value:e,label:hi[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=ce)}}),_i={class:`field`},vi={class:`title font-bold`};function yi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,_i,[e(`h2`,vi,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 bi=I(gi,[[`render`,yi],[`__scopeId`,`data-v-cbc83d11`]]),xi=v({name:`TalkingPhotoModeSelector`,components:{ElSelect:y,ElOption:b},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`)}}),Si={class:`field`},Ci={class:`title font-bold`};function wi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Si,[e(`h2`,Ci,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:{MagicIcon:P,UploadIcon:N,ElUpload:C,ElButton:R,ElInput:V,Consumption:J,InfoIcon:Y,ImagePreview:q,ModelSelector:bi,ModeSelector:I(xi,[[`render`,wi],[`__scopeId`,`data-v-92525a1d`]])},mixins:[H],emits:[`generate`],data(){return{imageFiles:[],audioFiles:[],uploadUrl:U()+`/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 L({...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(){K.warning(this.$t(`kling.message.uploadReferencesExceed`))},onImageError(){K.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(){K.warning(this.$t(`kling.message.uploadAudioExceed`))},onAudioError(){K.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`)}}}),Ei={class:`flex flex-col h-full`},Di={class:`flex-1 overflow-y-auto p-5`},Oi={class:`relative mb-4`},ki={class:`flex justify-start items-center`},Ai={class:`text-sm font-bold`},ji={class:`relative mb-4`},Mi={class:`flex justify-start items-center`},Ni={class:`text-sm font-bold`},Pi=[`src`],Fi={class:`mb-4`},Ii={class:`flex justify-start items-center`},Li={class:`text-sm font-bold`},Ri={class:`flex flex-col items-center justify-center px-5 pb-5`};function zi(t,n,c,u,d,m){let h=l(`model-selector`),_=l(`mode-selector`),v=l(`info-icon`),y=l(`image-preview`),b=l(`upload-icon`),x=l(`el-button`),S=l(`el-upload`),C=l(`el-input`),w=l(`consumption`),T=l(`magic-icon`);return g(),s(`div`,Ei,[e(`div`,Di,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),e(`div`,Oi,[e(`div`,ki,[e(`span`,Ai,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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`])]),e(`div`,ji,[e(`div`,Mi,[e(`span`,Ni,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,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),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,Pi)):o(``,!0)]),e(`div`,Fi,[e(`div`,Ii,[e(`span`,Li,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`,Ri,[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(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generateTalkingPhoto`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var Bi=I(Ti,[[`render`,zi],[`__scopeId`,`data-v-1cf65bf0`]]),Vi=v({name:`TaskPreview`,components:{ChannelIcon:te,InfoIcon:ie,MagicIcon:P,TimeIcon:ee,WarningIcon:oe,CopyToClipboard:ge,ElAlert:T,VideoPlayer:xe,ElTooltip:w,ElButton:R,ImagePreview:q,VideoPreview:we,AudioPreview:Te,ApiCodeButton:Se},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{isFailure(){let e=this.modelValue?.response;return e?.success===!1||!!e?.error||e?.state===`failed`||e?.state===`cancelled`},isWaiting(){let e=this.modelValue?.response;return!e||!this.isFailure&&e.success!==!0&&!e.video_url},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,r=this.modelValue?.request?.image_url;return t&&e.push({url:t,name:`start-image`}),n&&e.push({url:n,name:`end-image`}),r&&e.push({url:r,name:`reference-image`}),e},referenceVideos(){let e=[],t=this.modelValue?.request?.video_url;t&&e.push({url:t,name:`reference-video`});let n=this.modelValue?.request?.video_list;return(Array.isArray(n)?n:[]).forEach((t,n)=>{t?.video_url&&e.push({url:t.video_url,name:`reference-video-${n+1}`})}),e},referenceAudios(){let e=this.modelValue?.request?.audio_url;return e?[{url:e,name:`reference-audio`}]:[]}},methods:{onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),Hi={class:`preview`},Ui={class:`left`},Wi={class:`main`},Gi={class:`bot`},Ki={class:`datetime`},qi={class:`info`},Ji={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Yi={key:1,class:`prompt mt-2`},Xi={key:0},Zi={key:1},Qi={key:0,class:n({content:!0,failed:!0})},$i={key:0,class:`mb-4`},ea={key:1,class:n({operations:!0,"mt-2":!0})},ta={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},na={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ra={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ia={key:1,class:n({content:!0})},aa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},oa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},sa={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ca={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},la={key:2,class:n({content:!0})},ua={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},da={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function fa(t,n,u,d,m,_){let v=l(`capability-presentation`),y=l(`image-preview`),b=l(`video-preview`),x=l(`audio-preview`),S=l(`video-player`),C=l(`el-button`),w=l(`el-tooltip`),T=l(`api-code-button`),E=l(`channel-icon`),D=l(`magic-icon`),O=l(`copy-to-clipboard`),k=l(`time-icon`),A=l(`el-alert`),j=l(`warning-icon`),M=l(`info-icon`);return g(),s(`div`,Hi,[e(`div`,Ui,[a(v,{capability:`kling`,part:`avatar`,class:`avatar`})]),e(`div`,Wi,[e(`div`,Gi,[a(v,{capability:`kling`,part:`name`}),e(`span`,Ki,i(t.$dayjs.format(``+new Date(parseFloat((t.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,qi,[t.referenceImages.length>0||t.referenceVideos.length>0||t.referenceAudios.length>0?(g(),s(`div`,Ji,[(g(!0),s(c,null,h(t.referenceImages,(e,t)=>(g(),f(y,{key:`image-${t}`,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(t.referenceVideos,(e,t)=>(g(),f(b,{key:`video-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(t.referenceAudios,(e,t)=>(g(),f(x,{key:`audio-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128))])):o(``,!0),t.modelValue?.request?.prompt?(g(),s(`p`,Yi,[r(i(t.modelValue?.request?.prompt)+` `,1),t.modelValue?.response?t.isWaiting?(g(),s(`span`,Zi,` - (`+i(t.$t(`kling.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,Xi,` - (`+i(t.$t(`kling.status.pending`))+`) `,1))])):o(``,!0)]),t.modelValue?.response?.success===!0&&!t.isFailure?(g(),s(`div`,Qi,[t.modelValue?.response.video_url?(g(),s(`div`,$i,[a(S,{src:t.modelValue?.response.video_url},null,8,[`src`])])):o(``,!0),t.modelValue?.response.success?(g(),s(`div`,ea,[a(w,{class:`box-item`,effect:`dark`,content:t.$t(`kling.message.downloadVideo`),placement:`top-start`},{default:p(()=>[t.modelValue?.response.video_url?(g(),f(C,{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(T,{path:`/kling/videos`,body:t.modelValue?.request},null,8,[`body`])])):o(``,!0),a(A,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,ta,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.model`))+`: `+i(t.modelValue?.request?.model),1)]),e(`p`,na,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(O,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.elapsed?(g(),s(`p`,ra,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.elapsed`))+`: `+i(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),t.isFailure?(g(),s(`div`,ia,[a(A,{closable:!1,class:`failure`},{template:p(()=>[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,aa,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(O,{content:t.modelValue?.id},null,8,[`content`])]),e(`p`,oa,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.failureReason`))+`: `+i(t.modelValue?.response?.error?.message)+` `,1),a(O,{content:t.modelValue?.response?.error?.message},null,8,[`content`])]),t.modelValue?.elapsed?(g(),s(`p`,sa,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),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`,ca,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.traceId`))+`: `+i(t.modelValue?.response?.trace_id)+` `,1),a(O,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),t.isWaiting?(g(),s(`div`,la,[a(A,{closable:!1,class:`info`},{template:p(()=>[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(t.modelValue?.response?`kling.status.processing`:`kling.status.pending`)),1)]),default:p(()=>[e(`p`,ua,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.taskId`))+`: `+i(t.modelValue?.id)+` `,1),a(O,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.response?.trace_id?(g(),s(`p`,da,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.name.traceId`))+`: `+i(t.modelValue?.response?.trace_id)+` `,1),a(O,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var pa=v({name:`RecentPanel`,components:{TaskPreview:I(Vi,[[`render`,fa],[`__scopeId`,`data-v-d5f75276`]]),NoTasks:ye,BotPlaceholder:Ce,ScrollList:ve},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?.()}}}),ma={key:0},ha={key:2,class:`w-full h-full flex items-center justify-center`};function ga(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`,ma,[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`,ha,[a(v)])):o(``,!0)],64)}var _a=v({name:`KlingIndex`,components:{ConfigPanel:ur,MotionPanel:li,TalkingPhotoPanel:Bi,TabSwitcher:mi,Layout:je,RecentPanel:I(pa,[[`render`,ga]])},mixins:[fe],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===he.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===he.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 be({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`kling/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`kling/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();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(!de(this.uploadTracker,e=>this.$t(e),e=>K.warning(e)))return;let{camera_control:e,...t}=this.config||{},n={...t,async:!0},r=Number(!!n.start_image_url)+Number(!!n.end_image_url),i=n.image_list?.length||0,a=n.video_list?.length?4:7;if(r+i>a){K.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:a}));return}if(n.video_list?.[0]?.refer_type===`base`&&(n.start_image_url||n.end_image_url||n.image_list?.some(({type:e})=>e))){K.warning(this.$t(`kling.message.baseVideoFrameConflict`));return}if(!n.video_id&&!t.video_url&&!n.start_image_url&&n.end_image_url){K.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))}:{}}),!W())return;let o=this.credential?.token;if(!o){console.error(`no token specified`);return}K.info(this.$t(`kling.message.startingTask`)),G(`kling`,z.generate(n,{token:o})).then(()=>{K.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?K.error(this.$t(`kling.message.usedUp`)):K.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(!de(this.uploadTracker,e=>this.$t(e),e=>K.warning(e)))return;let e=this.motionConfig||{};if(!e.image_url||!e.video_url){K.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(!W())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}K.info(this.$t(`kling.message.startingTask`)),G(`kling`,z.motion(t,{token:n})).then(()=>{K.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?K.error(this.$t(`kling.message.usedUp`)):K.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},async onGenerateTalkingPhoto(){if(!de(this.uploadTracker,e=>this.$t(e),e=>K.warning(e)))return;let e=this.talkingPhotoConfig||{};if(!e.image_url||!e.audio_url){K.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(!W())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}K.info(this.$t(`kling.message.startingTask`)),G(`kling`,z.talkingPhoto(t,{token:n})).then(()=>{K.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?K.error(this.$t(`kling.message.usedUp`)):K.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})}}}),va={class:`flex flex-col h-full`},ya={class:`flex-1 min-h-0`};function ba(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`,va,[a(u,{"model-value":t.taskType,"onUpdate:modelValue":t.onTabChange},null,8,[`model-value`,`onUpdate:modelValue`]),e(`div`,ya,[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 xa=I(_a,[[`render`,ba]]);export{xa as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,I as t,Jt as n,L as r,M as i,N as a,at as o,j as s,mt as c,tt as l,z as u}from"./vendor-chart-Dw-P17PN.js";import{n as d,t as f}from"./table-
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,I as t,Jt as n,L as r,M as i,N as a,at as o,j as s,mt as c,tt as l,z as u}from"./vendor-chart-Dw-P17PN.js";import{n as d,t as f}from"./table-Goh_lj7o.js";import{t as ee}from"./tooltip-BWksRWUx.js";import{t as p}from"./card-D-4S-l7a.js";import{n as m,t as h}from"./row-D8Md0caP.js";import{t as g}from"./divider-BNWJAaA2.js";import{t as _}from"./progress-bSUZvkfj.js";import{t as v}from"./skeleton-B3LIGUiE.js";import{t as y}from"./coins-CnnnE904.js";import{t as b}from"./link-DQWWASPf.js";import{t as x}from"./user-DLgTmCsN.js";import{t as S}from"./wallet-BDJiLzju.js";import{E as C,It as w,Kt as T,Mi as E,Q as D,Qn as O,X as k,Xn as A,Zn as j,an as M,cr as N,gi as P}from"./index-D11lR21M.js";import{t as F}from"./CopyToClipboard-DMzrmhs6.js";var I=u({name:`ConsoleDistributionList`,components:{CreditsIcon:y,LinkIcon:b,PercentIcon:P(`percent`,[[`line`,{x1:`19`,x2:`5`,y1:`5`,y2:`19`,key:`1x9vlm`}],[`circle`,{cx:`6.5`,cy:`6.5`,r:`2.5`,key:`4mh3h7`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`2.5`,key:`1mdrzq`}]]),UserIcon:x,WalletIcon:S,CopyToClipboard:F,QrCode:w,ElProgress:_,ElRow:h,ElCol:m,ElButton:E,ElDivider:g,ElCard:p,ElTooltip:ee,ElTable:f,ElTableColumn:d,ElSkeleton:v},data(){return{invitees:[],inviteesCount:void 0,distributionLevels:[],distributionLink:void 0,distributionStatus:void 0,loading:!1}},computed:{redirect(){return this.$route.query.redirect},page(){return parseInt(this.$route.query.page?.toString()||`1`)},qrColor(){let e=document.documentElement.classList.contains(`dark`);return{dark:e?`#ffffff`:`#000000`,light:e?`#1e1e1e`:`#ffffff`}},distributionLevelMap(){let e={};return this.distributionLevels.forEach(t=>{e[t.level]=t}),e}},watch:{page:{handler(){this.onFetchData()}}},async mounted(){this.onFetchData(),this.onGenerateDistributionLink()},methods:{getPriceString:T,goHistory(){this.$router.push({name:k})},goInvitees(){this.$router.push({name:D})},onPageChange(e){this.$router.push({name:this.$route.name?.toString(),query:{page:e}})},getPercentageForNextLevel(){let e=this.distributionLevelMap[this.distributionStatus?.level?.level]?.threshold,t=this.distributionLevelMap[this.distributionStatus?.level?.level+1]?.threshold;return Math.floor((this.distributionStatus?.price-e)/(t-e)*100)},getDeltaForNextLevel(){let e=this.distributionLevelMap[this.distributionStatus?.level?.level+1]?.threshold;return Math.floor(e-this.distributionStatus?.price)},async onFetchData(){this.loading=!0,await j.initialize(),Promise.all([this.onFetchDistributionStatus(),this.onFetchDistributionLevels(),this.onFetchInvitees()]).finally(()=>{this.loading=!1})},async onGenerateDistributionLink(){let e=`${window.location.origin}?inviter_id=${this.$store.getters.user.id}`;try{let t=(await O.create(e))?.data?.data?.url||e;this.distributionLink=M()?t.replace(`surl.id`,`share.acedata.cloud`):t}catch{this.distributionLink=e}},async onFetchDistributionStatus(){let{data:e}=await j.getAll({user_id:this.$store.getters.user.id});e.items&&e.items.length>0&&(this.distributionStatus=e.items[0])},async onFetchDistributionLevels(){let{data:e}=await A.getAll({limit:20,user_id:this.$store.getters.user.id});this.distributionLevels=e.items},async onFetchInvitees(){let{data:e}=await N.getInvitees({});this.invitees=e.items,this.inviteesCount=e.count}}}),L={class:`title`},R={key:1},z={class:`icon-wrapper`},B={class:`text-left`},V={class:`description`},H={class:`value`},U={key:1},W={class:`icon-wrapper`},G={class:`text-left`},K={class:`description`},q={class:`value`},J={key:1},Y={class:`icon-wrapper`},X={class:`text-left`},Z={class:`description`},te={class:`value`},Q={key:1},ne={class:`icon-wrapper`},re={class:`text-left`},ie={class:`description`},ae={class:`value`},oe={key:1},se={class:`title`},ce={class:`clear-both overflow-hidden`},le={class:`float-left description`},ue={class:`float-right description`},de={class:`description`},fe={class:`level`},pe={class:`level`},$={class:`level`},me={key:1},he={class:`title`},ge={class:`link-wrapper text-center`},_e=[`href`],ve={class:`qr-wrapper ml-auto mr-auto`},ye={class:`mt-0`},be={class:`description`},xe={class:`more`};function Se(u,d,f,ee,p,m){let h=o(`el-col`),g=o(`el-row`),_=o(`el-skeleton`),v=o(`wallet-icon`),y=o(`el-button`),b=o(`el-card`),x=o(`credits-icon`),S=o(`el-tooltip`),C=o(`percent-icon`),w=o(`user-icon`),T=o(`el-progress`),E=o(`el-divider`),D=o(`el-table-column`),O=o(`el-table`);o(`link-icon`);let k=o(`copy-to-clipboard`),A=o(`qr-code`);return l(),s(g,{class:`panel`},{default:c(()=>[r(h,{span:24},{default:c(()=>[r(g,null,{default:c(()=>[r(h,{span:24},{default:c(()=>[e(`h2`,L,n(u.$t(`common.title.distribution`)),1)]),_:1})]),_:1}),r(g,{gutter:15},{default:c(()=>[r(h,{md:6,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`item-mini mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,R,[e(`div`,z,[r(v,{class:`icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`div`,B,[e(`p`,V,n(u.$t(`distribution.title.price`)),1),e(`p`,H,n(u.getPriceString({value:u.distributionStatus?.price})),1)]),r(y,{type:`primary`,round:``,size:`small`,class:`btn`,onClick:u.goHistory},{default:c(()=>[t(n(u.$t(`distribution.button.detail`)),1)]),_:1},8,[`onClick`])]))]),_:1})]),_:1}),r(h,{md:6,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`item-mini mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,U,[e(`div`,W,[r(x,{class:`icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`div`,G,[e(`p`,K,n(u.$t(`distribution.title.reward`)),1),e(`p`,q,n(u.getPriceString({value:u.distributionStatus?.reward})),1)]),r(S,{effect:`dark`,content:u.$t(`distribution.message.developingWithDrawal`),placement:`top`},{default:c(()=>[r(y,{type:`primary`,round:``,size:`small`,class:`btn`},{default:c(()=>[t(n(u.$t(`distribution.button.withdrawal`)),1)]),_:1})]),_:1},8,[`content`])]))]),_:1})]),_:1}),r(h,{md:6,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`item-mini mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,J,[e(`div`,Y,[r(C,{class:`icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`div`,X,[e(`p`,Z,n(u.$t(`distribution.title.percentage`)),1),e(`p`,te,n(u.distributionStatus?.level?.percentage)+`%`,1)])]))]),_:1})]),_:1}),r(h,{md:6,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`item-mini mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,Q,[e(`div`,ne,[r(w,{class:`icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`div`,re,[e(`p`,ie,n(u.$t(`distribution.title.inviteesCount`)),1),e(`p`,ae,n(u.inviteesCount),1)]),r(y,{type:`primary`,round:``,size:`small`,class:`btn`,onClick:u.goInvitees},{default:c(()=>[t(n(u.$t(`distribution.button.detail`)),1)]),_:1},8,[`onClick`])]))]),_:1})]),_:1})]),_:1}),r(g,{gutter:15},{default:c(()=>[r(h,{md:12,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`level-info mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,oe,[e(`h4`,se,n(u.$t(`distribution.title.levelInfo`)),1),e(`div`,ce,[e(`div`,le,[e(`p`,null,n(u.$t(`distribution.title.currentLevel`))+`: L`+n(u.distributionStatus?.level?.level),1),e(`p`,null,n(u.$t(`distribution.title.currentPercentage`))+`: `+n(u.distributionLevelMap[u.distributionStatus?.level?.level]?.percentage)+`% `,1)]),e(`div`,ue,[e(`p`,null,n(u.$t(`distribution.title.nextLevel`))+`: L`+n(u.distributionStatus?.level?.level+1),1),e(`p`,null,n(u.$t(`distribution.title.nextPercentage`))+`: `+n(u.distributionLevelMap[u.distributionStatus?.level?.level+1]?.percentage)+`% `,1)])]),r(T,{"text-inside":!0,"stroke-width":20,percentage:u.getPercentageForNextLevel(),class:`mb-2`},null,8,[`percentage`]),e(`p`,de,n(u.$t(`distribution.message.deltaPriceForNextLevel`))+`: $`+n(u.getDeltaForNextLevel()),1),r(E),u.distributionLevels?(l(),s(O,{key:0,data:u.distributionLevels,stripe:``},{default:c(()=>[r(D,{label:u.$t(`distribution.field.level`)},{default:c(t=>[e(`span`,fe,`L`+n(t.row?.level),1)]),_:1},8,[`label`]),r(D,{label:u.$t(`distribution.field.threshold`)},{default:c(t=>[e(`span`,pe,`$`+n(t.row?.threshold),1)]),_:1},8,[`label`]),r(D,{label:u.$t(`distribution.field.percentage`)},{default:c(t=>[e(`span`,$,n(t.row?.percentage)+`%`,1)]),_:1},8,[`label`])]),_:1},8,[`data`])):i(``,!0)]))]),_:1})]),_:1}),r(h,{md:12,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`distribution-info mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,me,[e(`h4`,he,n(u.$t(`distribution.title.distributionLink`)),1),r(E),e(`div`,ge,[i(``,!0),e(`a`,{href:u.distributionLink,class:`link`},n(u.distributionLink),9,_e),r(k,{content:u.distributionLink},null,8,[`content`])]),e(`div`,ve,[u.distributionLink?(l(),s(A,{key:0,value:u.distributionLink,size:180,margin:2,class:`block mb-2 ml-auto mr-auto`,type:`image/png`,color:u.qrColor},null,8,[`value`,`color`])):i(``,!0),e(`p`,ye,n(u.$t(`distribution.message.distributionQrDescription`)),1)]),e(`p`,be,[t(n(u.$t(`distribution.message.distributionLinkDescription`))+` `,1),e(`span`,xe,[r(S,{effect:`dark`,content:u.$t(`distribution.message.distributionLinkDescription2`),placement:`top`},{default:c(()=>[t(n(u.$t(`distribution.message.technicalDetail`)),1)]),_:1},8,[`content`])])])]))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}var Ce=C(I,[[`render`,Se],[`__scopeId`,`data-v-3657f823`]]);export{Ce as default};
|
|
@@ -1 +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,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{n as v,r as y,t as b}from"./select-Dd7_ivYm.js";import{t as x}from"./upload-lhd9YfIE.js";import{t as S}from"./tooltip-Dj6RbMto.js";import{t as C}from"./alert-WBvXJLK8.js";import{t as w}from"./drawer-DSzO2dsM.js";import{t as T}from"./input-number-Cxr0yGWv.js";import{n as E}from"./taskDrawerMixin-DxvJ_eHK.js";import{t as D}from"./box-AELNwZ6O.js";import{t as O}from"./clock-DTI37195.js";import{r as k,t as A}from"./PromptTextarea-7K2vh_Ga.js";import{t as j}from"./image-C6eBVmfM.js";import{t as M}from"./info-DEMVq26u.js";import{t as N}from"./triangle-alert-DdjKQZco.js";import{t as P}from"./upload-D-IxWuPY.js";import{t as F}from"./wand-sparkles-DDpMxLU_.js";import{t as ee}from"./zap-CGueNzj6.js";import{Cn as te,En as I,Sn as ne,Tn as re,_n as L,bn as R,gn as z,mn as B,pn as ie,vn as V,xn as H,yn as U}from"./constants-P5wTiWzI.js";import{Bt as ae,E as W,Gt as oe,Ht as se,Mi as G,Ut as ce,Vt as le,_i as ue,ai as de,en as fe,gr as pe,ni as K,vi as q,wn as me}from"./index-VBHeBzR0.js";import{t as he}from"./CopyToClipboard-CRR8YgjD.js";import{t as J}from"./ImagePreview-Dgm42i77.js";import{t as ge}from"./Consumption-DVsuzbOV.js";import{a as Y,n as _e,r as ve,t as ye}from"./pagination-BSiXY-Jl.js";import{t as be}from"./ApiCodeButton-S_UyXg4j.js";import{t as xe}from"./BotPlaceholder-C4saLAYx.js";import{t as Se}from"./ImageWrapper-8S5wIbh2.js";var Ce=_({name:`LayoutSeedream`,components:{MagicIcon:F,ElDrawer:w,ElButton:G},mixins:[E]}),we={class:`main flex flex-row flex-1`},Te={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Ee={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function De(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,we,[e(`div`,Te,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Ee,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[g,!t.tasksEmpty]]),a(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Oe=W(Ce,[[`render`,De],[`__scopeId`,`data-v-c10167d0`]]),ke=_({name:`SeedreamPromptInput`,components:{PromptTextarea:A},computed:{prompt:{get(){return this.$store.state.seedream?.config?.prompt},set(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Ae(e,t,n,r,i,a){let o=l(`prompt-textarea`);return h(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`seedream.name.prompt`),info:e.$t(`seedream.description.prompt`),placeholder:e.$t(`seedream.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var je=W(ke,[[`render`,Ae]]),Me={image:!0,imageRequired:!1,sizeTiers:[`1K`,`2K`,`3K`,`4K`],sizeAdaptive:!0,sizePixel:!0,sizePixelDefault:void 0,groupGeneration:!1,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};function X(e){switch(e){case R:return{image:!0,imageRequired:!1,sizeTiers:[`1K`,`2K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!1,seed:!1,guidanceScale:!1,outputFormat:!0,tools:!1};case U:return{image:!0,imageRequired:!1,sizeTiers:[`2K`,`3K`,`4K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!0,tools:!0};case V:return{image:!0,imageRequired:!1,sizeTiers:[`2K`,`4K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};case L:return{image:!0,imageRequired:!1,sizeTiers:[`1K`,`2K`,`4K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};case z:return{image:!1,imageRequired:!1,sizeTiers:[],sizeAdaptive:!1,sizePixel:!0,sizePixelDefault:`1024x1024`,groupGeneration:!1,seed:!0,guidanceScale:!0,guidanceScaleDefault:B[z],outputFormat:!1,tools:!1};case H:return{image:!0,imageRequired:!0,sizeTiers:[],sizeAdaptive:!1,sizePixel:!0,sizePixelDefault:`1024x1024`,groupGeneration:!1,seed:!1,guidanceScale:!0,guidanceScaleDefault:B[H],outputFormat:!1,tools:!1};default:return Me}}function Z(e,t){let n=X(e);return n.imageRequired||n.image&&t?.length?`edit`:`generate`}var Ne=[`1K`,`2K`,`3K`,`4K`];function Pe(e,t){if(!e)return[];let n=t.model??e.model;if(!n)return[];let r=X(n),i=[];Array.isArray(e.image)&&e.image.length>0&&!r.image&&i.push({field:`image`,i18nLabel:`seedream.name.imageUrls`});let a=typeof e.size==`string`?e.size:void 0;if(a){let e=a.toUpperCase();(Ne.includes(e)&&!r.sizeTiers.includes(e)||a===`adaptive`&&!r.sizeAdaptive)&&i.push({field:`size`,i18nLabel:`seedream.name.size`})}return e.sequential_image_generation===`auto`&&!r.groupGeneration&&i.push({field:`sequential_image_generation`,i18nLabel:`seedream.name.maxImages`}),e.seed!==void 0&&e.seed!==null&&!r.seed&&i.push({field:`seed`,i18nLabel:`seedream.name.seed`}),e.guidance_scale!==void 0&&e.guidance_scale!==null&&!r.guidanceScale&&i.push({field:`guidance_scale`,i18nLabel:`seedream.name.guidanceScale`}),e.output_format&&!r.outputFormat&&i.push({field:`output_format`,i18nLabel:`seedream.name.outputFormat`}),Array.isArray(e.tools)&&e.tools.length>0&&!r.tools&&i.push({field:`tools`,i18nLabel:`seedream.name.tools`}),i}function Fe(e,t,n){let r={...e},i=X(n.model??e.model);for(let e of t)switch(e.field){case`image`:delete r.image;break;case`size`:i.sizePixelDefault?r.size=i.sizePixelDefault:delete r.size;break;case`sequential_image_generation`:r.sequential_image_generation=`disabled`,delete r.sequential_image_generation_options;break;case`seed`:delete r.seed;break;case`guidance_scale`:delete r.guidance_scale;break;case`output_format`:delete r.output_format;break;case`tools`:delete r.tools;break}return r}var Ie=_({name:`SeedreamImageInput`,components:{UploadIcon:P,ElUpload:x,ElButton:G,InfoIcon:Y,ImagePreview:J},mixins:[ce,le],data(){return{fileList:[],uploadUrl:de()+`/api/v1/files/`,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.seedream?.config?.image},model(){return this.$store.state.seedream?.config?.model},supported(){return X(this.model).image}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){let e=(this.fileList||[]).filter(e=>!e?.response?.file_url);this.fileList=e.length?e:[];return}let t=[];e.forEach(e=>{let n=this.fileList.find(t=>t?.response?.file_url===e||t?.url===e);n?t.push(n):t.push({name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}})}),(this.fileList||[]).filter(e=>!e?.response?.file_url).forEach(e=>{t.some(t=>t===e||t?.url===e?.url||t?.response?.file_url===e?.response?.file_url)||t.push(e)}),this.fileList=t}}},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url==`string`&&e.url.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImages()},onExceed(){q.warning(this.$t(`seedream.message.uploadImageExceed`))},onError(){q.error(this.$t(`seedream.message.uploadImageError`))},onSetImages(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,image:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImages()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImages()}}}),Le={key:0},Re={class:`field`},ze={class:`label`},Be={class:`box`},Ve={class:`title font-bold`},He={class:`value`},Ue={class:`file-list mt-2 flex flex-wrap gap-[10px]`};function We(t,n,u,d,g,_){let v=l(`info-icon`),y=l(`upload-icon`),b=l(`el-button`),x=l(`el-upload`),S=l(`image-preview`);return t.supported?(h(),s(`div`,Le,[e(`div`,Re,[e(`div`,ze,[e(`div`,Be,[e(`h2`,Ve,i(t.$t(`seedream.name.imageUrls`)),1),a(v,{content:t.$t(`seedream.description.imageUrls`),class:`info`},null,8,[`content`])])]),e(`div`,He,[a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,limit:14,multiple:!0,"show-file-list":!1,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-change":t.onChange,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(b,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedream.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])])]),e(`div`,Ue,[(h(!0),s(c,null,m(t.fileList,(e,n)=>(h(),f(S,{key:e.uid||e?.response?.file_url||e.url||n,url:e.url||e?.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemovePreview(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])])):o(``,!0)}var Ge=W(Ie,[[`render`,We],[`__scopeId`,`data-v-ac071e59`]]),Ke=_({name:`SeedreamModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Y},data(){return{revertKey:0,options:[{value:R,label:this.$t(`seedream.model.seedream50pro`)},{value:U,label:this.$t(`seedream.model.seedream50`)},{value:V,label:this.$t(`seedream.model.seedream45`)},{value:L,label:this.$t(`seedream.model.seedream40`)},{value:z,label:this.$t(`seedream.model.seedream30t2i`)},{value:H,label:this.$t(`seedream.model.seededit30i2i`)}]}},computed:{value(){return this.$store.state.seedream?.config?.model}},mounted(){this.value||this.applyModel(ie)},methods:{async onChange(e){let t=this.$store.state.seedream?.config||{},n=Pe(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await ue.confirm(this.$t(`seedream.message.featureNotSupportedBody`,{fields:r}),this.$t(`seedream.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`seedream.button.confirmContinue`),cancelButtonText:this.$t(`seedream.button.cancelSwitch`),type:`warning`});let i=Fe({...t,model:e},n,{model:e});this.$store.commit(`seedream/setConfig`,i),q.success(this.$t(`seedream.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,model:e})}}}),qe={class:`field`},Je={class:`label`},Ye={class:`box`},Xe={class:`title font-bold`};function Ze(t,n,r,o,u,d){let g=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return h(),s(`div`,qe,[e(`div`,Je,[e(`div`,Ye,[e(`h2`,Xe,i(t.$t(`seedream.name.model`)),1),a(g,{content:t.$t(`seedream.description.model`),class:`info`},null,8,[`content`])])]),(h(),f(v,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`seedream.placeholder.select`),onChange:t.onChange},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var Qe=W(Ke,[[`render`,Ze],[`__scopeId`,`data-v-6413c179`]]),$e=_({name:`SeedreamSizeSelector`,components:{ElSelect:y,ElOption:b,ElOptionGroup:v,InfoIcon:Y},data(){return{SEEDREAM_SIZE_ADAPTIVE:re,pixelOptions:te}},computed:{model(){return this.$store.state.seedream?.config?.model},capabilities(){return X(this.model)},value:{get(){return this.$store.state.seedream?.config?.size},set(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,size:e})}}},watch:{model:{immediate:!0,handler(){if(this.value)return;let e=this.capabilities;e.sizeTiers.length?this.value=e.sizeTiers.includes(`2K`)?`2K`:e.sizeTiers[0]:e.sizePixelDefault&&(this.value=e.sizePixelDefault)}}}}),et={class:`field`},tt={class:`label`},nt={class:`box`},rt={class:`title font-bold`};function it(t,n,r,u,d,g){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-option-group`),b=l(`el-select`);return h(),s(`div`,et,[e(`div`,tt,[e(`div`,nt,[e(`h2`,rt,i(t.$t(`seedream.name.size`)),1),a(_,{content:t.$t(`seedream.description.size`),class:`info`},null,8,[`content`])])]),a(b,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedream.placeholder.size`),filterable:``,"allow-create":``,"default-first-option":``},{default:p(()=>[t.capabilities.sizeTiers.length?(h(),f(y,{key:0,label:t.$t(`seedream.size.group.tier`)},{default:p(()=>[(h(!0),s(c,null,m(t.capabilities.sizeTiers,e=>(h(),f(v,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`label`])):o(``,!0),t.capabilities.sizeAdaptive?(h(),f(y,{key:1,label:t.$t(`seedream.size.group.adaptive`)},{default:p(()=>[(h(),f(v,{key:t.SEEDREAM_SIZE_ADAPTIVE,label:t.$t(`seedream.size.adaptive`),value:t.SEEDREAM_SIZE_ADAPTIVE},null,8,[`label`,`value`]))]),_:1},8,[`label`])):o(``,!0),a(y,{label:t.$t(`seedream.size.group.pixel`)},{default:p(()=>[(h(!0),s(c,null,m(t.pixelOptions,e=>(h(),f(v,{key:e.value,label:`${e.value} (${e.ratio})`,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`label`])]),_:1},8,[`modelValue`,`placeholder`])])}var at=W($e,[[`render`,it],[`__scopeId`,`data-v-dd7bd021`]]),ot=_({name:`SeedreamMaxImagesSelector`,components:{ElInputNumber:T,InfoIcon:Y},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return X(this.config?.model).groupGeneration},referenceImageCount(){let e=this.config?.image;return Array.isArray(e)?e.length:0},effectiveMax(){let e=15-this.referenceImageCount;return Math.max(1,Math.min(15,e))},value:{get(){let e=this.config?.sequential_image_generation_options?.max_images;return typeof e==`number`&&e>=1?e:1},set(e){let t={...this.config||{}},n=Math.max(1,Math.min(this.effectiveMax,Math.floor(e||1)));n>1?(t.sequential_image_generation=`auto`,t.sequential_image_generation_options={...t.sequential_image_generation_options||{},max_images:n}):(t.sequential_image_generation=`disabled`,t.sequential_image_generation_options&&delete t.sequential_image_generation_options),this.$store.commit(`seedream/setConfig`,t)}}},watch:{effectiveMax(e){this.value>e&&(this.value=e)}}}),st={key:0,class:`field`},ct={class:`label`},lt={class:`box`},ut={class:`title font-bold`},dt={class:`value`};function ft(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-input-number`);return t.supported?(h(),s(`div`,st,[e(`div`,ct,[e(`div`,lt,[e(`h2`,ut,i(t.$t(`seedream.name.maxImages`)),1),a(f,{content:t.$t(`seedream.description.maxImages`),class:`info`},null,8,[`content`])])]),e(`div`,dt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:1,max:t.effectiveMax,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`,`max`])])])):o(``,!0)}var pt=W(ot,[[`render`,ft],[`__scopeId`,`data-v-f079fd20`]]),mt=_({name:`SeedreamOutputFormatSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Y},data(){return{options:[...ne]}},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return X(this.config?.model).outputFormat},value:{get(){return this.config?.output_format},set(e){let t={...this.config||{}};t.output_format=e,this.$store.commit(`seedream/setConfig`,t)}}}}),ht={key:0,class:`field`},gt={class:`label`},_t={class:`box`},vt={class:`title font-bold`};function yt(t,n,r,u,d,g){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-select`);return t.supported?(h(),s(`div`,ht,[e(`div`,gt,[e(`div`,_t,[e(`h2`,vt,i(t.$t(`seedream.name.outputFormat`)),1),a(_,{content:t.$t(`seedream.description.outputFormat`),class:`info`},null,8,[`content`])])]),a(y,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedream.placeholder.select`)},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(v,{key:e,label:e.toUpperCase(),value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])):o(``,!0)}var bt=W(mt,[[`render`,yt],[`__scopeId`,`data-v-69ea4c07`]]),xt=_({name:`SeedreamSeedInput`,components:{ElInputNumber:T,InfoIcon:Y},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return X(this.config?.model).seed},value:{get(){let e=this.config?.seed;return typeof e==`number`?e:-1},set(e){let t={...this.config||{}};t.seed=typeof e==`number`&&Number.isInteger(e)?e:-1,this.$store.commit(`seedream/setConfig`,t)}}}}),St={key:0,class:`field`},Ct={class:`label`},wt={class:`box`},Tt={class:`title font-bold`},Et={class:`value`};function Dt(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-input-number`);return t.supported?(h(),s(`div`,St,[e(`div`,Ct,[e(`div`,wt,[e(`h2`,Tt,i(t.$t(`seedream.name.seed`)),1),a(f,{content:t.$t(`seedream.description.seed`),class:`info`},null,8,[`content`])])]),e(`div`,Et,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:-1,max:2147483647,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])):o(``,!0)}var Ot=W(xt,[[`render`,Dt],[`__scopeId`,`data-v-10cdc1e0`]]),kt=_({name:`SeedreamGuidanceScaleInput`,components:{ElInputNumber:T,InfoIcon:Y},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return X(this.config?.model).guidanceScale},defaultValue(){return X(this.config?.model).guidanceScaleDefault??2.5},value:{get(){let e=this.config?.guidance_scale;return typeof e==`number`?e:this.defaultValue},set(e){let t={...this.config||{}};t.guidance_scale=typeof e==`number`&&e>=1&&e<=10?e:this.defaultValue,this.$store.commit(`seedream/setConfig`,t)}}}}),At={key:0,class:`field`},jt={class:`label`},Mt={class:`box`},Nt={class:`title font-bold`},Pt={class:`value`};function Ft(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-input-number`);return t.supported?(h(),s(`div`,At,[e(`div`,jt,[e(`div`,Mt,[e(`h2`,Nt,i(t.$t(`seedream.name.guidanceScale`)),1),a(f,{content:t.$t(`seedream.description.guidanceScale`),class:`info`},null,8,[`content`])])]),e(`div`,Pt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:1,max:10,step:.1,precision:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])):o(``,!0)}var It=W(kt,[[`render`,Ft],[`__scopeId`,`data-v-7386f064`]]),Q=e=>{let t={...e||{}},n=Z(t.model,t.image);return delete t.action,t.watermark=!1,(n!==`edit`||!t.image?.length)&&delete t.image,t.size||delete t.size,t.sequential_image_generation!==`auto`&&delete t.sequential_image_generation_options,{...t,async:!0}},Lt=_({name:`SeedreamConfigPanel`,components:{MagicIcon:F,ElButton:G,PromptInput:je,Consumption:ge,ImageInput:Ge,ModelSelector:Qe,SizeSelector:at,MaxImagesSelector:pt,OutputFormatSelector:bt,SeedInput:Ot,GuidanceScaleInput:It},emits:[`generate`],computed:{action(){return Z(this.config?.model,this.config?.image)},capabilities(){return X(this.config?.model)},config(){return this.$store.state.seedream?.config},consumption(){let e=Q(this.config),t=e.sequential_image_generation===`auto`?Math.max(1,Math.floor(e.sequential_image_generation_options?.max_images||1)):1;return oe({...e,action:this.action,model:I(e.model),input_image_count:e.image?.length||0,count:t},this.service?.cost)},service(){return this.$store.state.seedream?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),Rt={class:`flex flex-col h-full`},zt={class:`flex-1 overflow-y-auto p-5`},Bt={class:`flex flex-col items-center justify-center px-5 pb-5`};function Vt(t,n,c,u,d,m){let g=l(`model-selector`),_=l(`size-selector`),v=l(`max-images-selector`),y=l(`output-format-selector`),b=l(`seed-input`),x=l(`guidance-scale-input`),S=l(`prompt-input`),C=l(`image-input`),w=l(`consumption`),T=l(`magic-icon`),E=l(`el-button`);return h(),s(`div`,Rt,[e(`div`,zt,[a(g,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),t.capabilities.image?(h(),f(C,{key:0,class:`mb-4`})):o(``,!0)]),e(`div`,Bt,[a(w,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(E,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedream.button.generate`)),1)]),_:1},8,[`onClick`])])])}var Ht=W(Lt,[[`render`,Vt]]),Ut=_({name:`SeedreamTaskPreview`,components:{ApplicationIcon:D,ChannelIcon:k,ImageIcon:j,InfoIcon:M,LightningIcon:ee,MagicIcon:F,TimeIcon:O,WarningIcon:N,CopyToClipboard:he,ElAlert:C,ImageWrapper:Se,ElButton:G,ElTooltip:S,ImagePreview:J,ApiCodeButton:be},props:{modelValue:{type:Object,required:!0}},computed:{apiRequest(){return Q(this.modelValue?.request)},isEdit(){return Array.isArray(this.modelValue?.request?.image)&&(this.modelValue?.request?.image?.length||0)>0},images(){let e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{e.push(t)}),e}},methods:{shortModel(e){return I(e)||e},onEdit(e){if(!e)return;console.debug(`Edit image:`,e);let t={...this.$store.state.seedream?.config||{}};t.image=[e],this.$store.commit(`seedream/setConfig`,t)}}}),Wt={class:`preview`},Gt={class:`left`},Kt={class:`main`},qt={class:`bot`},Jt={class:`datetime`},Yt={class:`info`},Xt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Zt={key:1,class:`prompt mt-2`},Qt={key:0},$t={key:0,class:n({content:!0})},en={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},tn={key:1,class:n({content:!0,failed:!0})},nn={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},rn={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},an={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},on={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},sn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},cn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ln={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},un={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},dn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},fn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},pn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},mn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},hn={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},gn={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},_n={key:3,class:n({content:!0})},vn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},yn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function bn(u,d,g,_,v,y){let b=l(`capability-presentation`),x=l(`image-preview`),S=l(`time-icon`),C=l(`magic-icon`),w=l(`copy-to-clipboard`),T=l(`el-alert`),E=l(`image-wrapper`),D=l(`el-button`),O=l(`el-tooltip`),k=l(`api-code-button`),A=l(`application-icon`),j=l(`image-icon`),M=l(`lightning-icon`),N=l(`channel-icon`),P=l(`warning-icon`),F=l(`info-icon`);return h(),s(`div`,Wt,[e(`div`,Gt,[a(b,{capability:`seedream`,part:`avatar`,class:`avatar`})]),e(`div`,Kt,[e(`div`,qt,[a(b,{capability:`seedream`,part:`name`}),e(`span`,Jt,i(u.$dayjs.format(``+new Date(parseFloat((u.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,Yt,[Array.isArray(u.modelValue?.request?.image)&&u.modelValue?.request?.image.length>0?(h(),s(`div`,Xt,[(h(!0),s(c,null,m(u.modelValue?.request?.image,(e,t)=>(h(),f(x,{key:t,url:e,name:`image-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),u.modelValue?.request?.prompt?(h(),s(`p`,Zt,[r(i(u.modelValue?.request?.prompt)+` `,1),u.modelValue?.response?o(``,!0):(h(),s(`span`,Qt,` - (`+i(u.$t(`seedream.status.pending`))+`) `,1))])):o(``,!0)]),u.modelValue?.response?u.modelValue?.response?.success===!0?(h(),s(`div`,tn,[e(`div`,nn,[(h(!0),s(c,null,m(u.images,(e,t)=>(h(),f(E,{key:t,src:e?.image_url,"raw-src":e?.image_url},null,8,[`src`,`raw-src`]))),128))]),e(`div`,rn,[a(O,{class:`box-item`,effect:`dark`,content:u.$t(`common.button.edit`),placement:`top-start`},{default:p(()=>[a(D,{type:`info`,size:`small`,class:`btn-action`,onClick:d[0]||=t(e=>u.onEdit(u.images?.[0]?.image_url),[`stop`])},{default:p(()=>[r(i(u.$t(`common.button.edit`)),1)]),_:1})]),_:1},8,[`content`]),a(k,{path:`/seedream/images`,body:u.apiRequest},null,8,[`body`])]),a(T,{closable:!1,class:`mt-2 success`},{default:p(()=>[u.modelValue?.request?.model?(h(),s(`p`,an,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.model`))+`: `+i(u.shortModel(u.modelValue?.request?.model)),1)])):o(``,!0),u.modelValue?.request?.size?(h(),s(`p`,on,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.size`))+`: `+i(u.modelValue?.request?.size),1)])):o(``,!0),e(`p`,sn,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.task`))+`: `+i(u.isEdit?u.$t(`seedream.name.edits`):u.$t(`seedream.name.generate`)),1)]),e(`p`,cn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.taskId`))+`: `+i(u.modelValue?.id)+` `,1),a(w,{content:u.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),u.modelValue?.elapsed?(h(),s(`p`,$,[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.elapsed`))+`: `+i(u.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),u.modelValue?.response?.trace_id?(h(),s(`p`,ln,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.traceId`))+`: `+i(u.modelValue?.response?.trace_id)+` `,1),a(w,{content:u.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):u.modelValue?.response?.success===!1?(h(),s(`div`,{key:2,class:n({content:!0,"mt-[15px]":!u.modelValue?.request?.prompt})},[a(T,{closable:!1,class:`failure`},{template:p(()=>[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.failure`)),1)]),default:p(()=>[u.modelValue?.request?.model?(h(),s(`p`,un,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.model`))+`: `+i(u.shortModel(u.modelValue?.request?.model)),1)])):o(``,!0),u.modelValue?.request?.size?(h(),s(`p`,dn,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.size`))+`: `+i(u.modelValue?.request?.size),1)])):o(``,!0),e(`p`,fn,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.task`))+`: `+i(u.isEdit?u.$t(`seedream.name.edits`):u.$t(`seedream.name.generate`)),1)]),e(`p`,pn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.taskId`))+`: `+i(u.modelValue?.id)+` `,1),a(w,{content:u.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),u.modelValue?.response?.error?.message?(h(),s(`p`,mn,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.failureReason`))+`: `+i(u.modelValue?.response?.error?.message)+` `,1),a(w,{content:u.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])])):o(``,!0),u.modelValue?.elapsed?(h(),s(`p`,hn,[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.elapsed`))+`: `+i(u.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),u.modelValue?.response?.trace_id?(h(),s(`p`,gn,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.traceId`))+`: `+i(u.modelValue?.response?.trace_id)+` `,1),a(w,{content:u.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})],2)):(h(),s(`div`,_n,[a(T,{closable:!1,class:`info`},{template:p(()=>[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.status`)),1)]),default:p(()=>[e(`p`,vn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.taskId`))+`: `+i(u.modelValue?.id)+` `,1),a(w,{content:u.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),u.modelValue?.response?.trace_id?(h(),s(`p`,yn,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.traceId`))+`: `+i(u.modelValue?.response?.trace_id)+` `,1),a(w,{content:u.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(h(),s(`div`,$t,[a(T,{closable:!1,class:`info`},{template:p(()=>[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.status.pending`)),1)]),default:p(()=>[e(`p`,en,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.taskId`))+`: `+i(u.modelValue?.id)+` `,1),a(w,{content:u.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})]))])])}var xn=_({name:`SeedreamRecentPanel`,components:{TaskPreview:W(Ut,[[`render`,bn],[`__scopeId`,`data-v-9c8af4df`]]),BotPlaceholder:xe,NoTasks:ve,ScrollList:_e},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.seedream?.tasks,items:this.$store.state.seedream?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Sn={key:0},Cn={key:2,class:`w-full h-full flex items-center justify-center`};function wn(e,t,n,r,i,u){let d=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return h(),s(c,null,[e.tasks?.items===void 0?(h(),s(`div`,Sn,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),f(_,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(h(!0),s(c,null,m(e.tasks?.items,e=>(h(),f(g,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(h(),s(`div`,Cn,[a(v)])):o(``,!0)],64)}var Tn=_({name:`SeedreamIndex`,components:{ConfigPanel:Ht,Layout:Oe,RecentPanel:W(xn,[[`render`,wn]])},mixins:[se],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.seedream?.status?.getApplications===K.Request},tasksLoading(){return this.$store.state.seedream?.status?.getTasks===K.Request},credential(){return this.$store.state.seedream?.credential},config(){return this.$store.state.seedream?.config},application(){return this.$store.state.seedream?.application},tasks(){return this.$store.state.seedream?.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ye({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loading,setLoading:e=>this.loading=e,isBlocked:()=>this.tasksLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`seedream/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`seedream/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.tasksLoading){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=20,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),await this.$store.dispatch(`seedream/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})},async onGenerate(){if(!ae(this.uploadTracker,e=>this.$t(e),e=>q.warning(e)))return;if(X(this.config?.model).imageRequired&&!this.config?.image?.length){q.warning(this.$t(`seedream.message.referenceImageRequired`));return}let e=Q(this.config);if(!fe())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}q.info(this.$t(`seedream.message.startingTask`)),pe(`seedream`,me.generate(e,{token:t})).then(()=>{q.success(this.$t(`seedream.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?q.error(this.$t(`seedream.message.usedUp`)):q.error(this.$t(`seedream.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function En(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return h(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loading,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Dn=W(Tn,[[`render`,En]]);export{Dn as default};
|
|
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,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{n as v,r as y,t as b}from"./select-CY8L3FpM.js";import{t as x}from"./upload--OMy2H6L.js";import{t as S}from"./tooltip-BWksRWUx.js";import{t as C}from"./alert-BsVzeQZL.js";import{t as w}from"./drawer-91Rv4Ele.js";import{t as T}from"./input-number-DFaagkZ1.js";import{n as E}from"./taskDrawerMixin-BbwfrIGa.js";import{t as D}from"./box-DlrCDW_Z.js";import{t as O}from"./clock-DmoJeS1-.js";import{r as k,t as A}from"./PromptTextarea-BwQ2pgsq.js";import{t as j}from"./image-8hx4YUb0.js";import{t as M}from"./info-CsXueTRq.js";import{t as N}from"./triangle-alert-D3h6_VD_.js";import{t as P}from"./upload-UU_EKVx7.js";import{t as F}from"./wand-sparkles-G_omarUp.js";import{t as ee}from"./zap-BY9oC9vX.js";import{Cn as te,En as I,Sn as ne,Tn as re,_n as L,bn as R,gn as z,mn as B,pn as ie,vn as V,xn as H,yn as U}from"./constants-Dwvkb2qI.js";import{Bt as ae,E as W,Gt as oe,Ht as se,Mi as G,Ut as ce,Vt as le,_i as ue,ai as de,en as fe,gr as pe,ni as K,vi as q,wn as me}from"./index-D11lR21M.js";import{t as he}from"./CopyToClipboard-DMzrmhs6.js";import{t as J}from"./ImagePreview-CqonQxaO.js";import{t as ge}from"./Consumption-C5-QJWxc.js";import{a as Y,n as _e,r as ve,t as ye}from"./pagination-Blfeoga3.js";import{t as be}from"./ApiCodeButton-ESjV90I4.js";import{t as xe}from"./BotPlaceholder-60Ittost.js";import{t as Se}from"./ImageWrapper-BAqDx2VE.js";var Ce=_({name:`LayoutSeedream`,components:{MagicIcon:F,ElDrawer:w,ElButton:G},mixins:[E]}),we={class:`main flex flex-row flex-1`},Te={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Ee={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function De(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,we,[e(`div`,Te,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Ee,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[g,!t.tasksEmpty]]),a(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Oe=W(Ce,[[`render`,De],[`__scopeId`,`data-v-c10167d0`]]),ke=_({name:`SeedreamPromptInput`,components:{PromptTextarea:A},computed:{prompt:{get(){return this.$store.state.seedream?.config?.prompt},set(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Ae(e,t,n,r,i,a){let o=l(`prompt-textarea`);return h(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`seedream.name.prompt`),info:e.$t(`seedream.description.prompt`),placeholder:e.$t(`seedream.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var je=W(ke,[[`render`,Ae]]),Me={image:!0,imageRequired:!1,sizeTiers:[`1K`,`2K`,`3K`,`4K`],sizeAdaptive:!0,sizePixel:!0,sizePixelDefault:void 0,groupGeneration:!1,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};function X(e){switch(e){case R:return{image:!0,imageRequired:!1,sizeTiers:[`1K`,`2K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!1,seed:!1,guidanceScale:!1,outputFormat:!0,tools:!1};case U:return{image:!0,imageRequired:!1,sizeTiers:[`2K`,`3K`,`4K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!0,tools:!0};case V:return{image:!0,imageRequired:!1,sizeTiers:[`2K`,`4K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};case L:return{image:!0,imageRequired:!1,sizeTiers:[`1K`,`2K`,`4K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};case z:return{image:!1,imageRequired:!1,sizeTiers:[],sizeAdaptive:!1,sizePixel:!0,sizePixelDefault:`1024x1024`,groupGeneration:!1,seed:!0,guidanceScale:!0,guidanceScaleDefault:B[z],outputFormat:!1,tools:!1};case H:return{image:!0,imageRequired:!0,sizeTiers:[],sizeAdaptive:!1,sizePixel:!0,sizePixelDefault:`1024x1024`,groupGeneration:!1,seed:!1,guidanceScale:!0,guidanceScaleDefault:B[H],outputFormat:!1,tools:!1};default:return Me}}function Z(e,t){let n=X(e);return n.imageRequired||n.image&&t?.length?`edit`:`generate`}var Ne=[`1K`,`2K`,`3K`,`4K`];function Pe(e,t){if(!e)return[];let n=t.model??e.model;if(!n)return[];let r=X(n),i=[];Array.isArray(e.image)&&e.image.length>0&&!r.image&&i.push({field:`image`,i18nLabel:`seedream.name.imageUrls`});let a=typeof e.size==`string`?e.size:void 0;if(a){let e=a.toUpperCase();(Ne.includes(e)&&!r.sizeTiers.includes(e)||a===`adaptive`&&!r.sizeAdaptive)&&i.push({field:`size`,i18nLabel:`seedream.name.size`})}return e.sequential_image_generation===`auto`&&!r.groupGeneration&&i.push({field:`sequential_image_generation`,i18nLabel:`seedream.name.maxImages`}),e.seed!==void 0&&e.seed!==null&&!r.seed&&i.push({field:`seed`,i18nLabel:`seedream.name.seed`}),e.guidance_scale!==void 0&&e.guidance_scale!==null&&!r.guidanceScale&&i.push({field:`guidance_scale`,i18nLabel:`seedream.name.guidanceScale`}),e.output_format&&!r.outputFormat&&i.push({field:`output_format`,i18nLabel:`seedream.name.outputFormat`}),Array.isArray(e.tools)&&e.tools.length>0&&!r.tools&&i.push({field:`tools`,i18nLabel:`seedream.name.tools`}),i}function Fe(e,t,n){let r={...e},i=X(n.model??e.model);for(let e of t)switch(e.field){case`image`:delete r.image;break;case`size`:i.sizePixelDefault?r.size=i.sizePixelDefault:delete r.size;break;case`sequential_image_generation`:r.sequential_image_generation=`disabled`,delete r.sequential_image_generation_options;break;case`seed`:delete r.seed;break;case`guidance_scale`:delete r.guidance_scale;break;case`output_format`:delete r.output_format;break;case`tools`:delete r.tools;break}return r}var Ie=_({name:`SeedreamImageInput`,components:{UploadIcon:P,ElUpload:x,ElButton:G,InfoIcon:Y,ImagePreview:J},mixins:[ce,le],data(){return{fileList:[],uploadUrl:de()+`/api/v1/files/`,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.seedream?.config?.image},model(){return this.$store.state.seedream?.config?.model},supported(){return X(this.model).image}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){let e=(this.fileList||[]).filter(e=>!e?.response?.file_url);this.fileList=e.length?e:[];return}let t=[];e.forEach(e=>{let n=this.fileList.find(t=>t?.response?.file_url===e||t?.url===e);n?t.push(n):t.push({name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}})}),(this.fileList||[]).filter(e=>!e?.response?.file_url).forEach(e=>{t.some(t=>t===e||t?.url===e?.url||t?.response?.file_url===e?.response?.file_url)||t.push(e)}),this.fileList=t}}},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url==`string`&&e.url.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImages()},onExceed(){q.warning(this.$t(`seedream.message.uploadImageExceed`))},onError(){q.error(this.$t(`seedream.message.uploadImageError`))},onSetImages(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,image:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImages()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImages()}}}),Le={key:0},Re={class:`field`},ze={class:`label`},Be={class:`box`},Ve={class:`title font-bold`},He={class:`value`},Ue={class:`file-list mt-2 flex flex-wrap gap-[10px]`};function We(t,n,u,d,g,_){let v=l(`info-icon`),y=l(`upload-icon`),b=l(`el-button`),x=l(`el-upload`),S=l(`image-preview`);return t.supported?(h(),s(`div`,Le,[e(`div`,Re,[e(`div`,ze,[e(`div`,Be,[e(`h2`,Ve,i(t.$t(`seedream.name.imageUrls`)),1),a(v,{content:t.$t(`seedream.description.imageUrls`),class:`info`},null,8,[`content`])])]),e(`div`,He,[a(x,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,limit:14,multiple:!0,"show-file-list":!1,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-change":t.onChange,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(b,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedream.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])])]),e(`div`,Ue,[(h(!0),s(c,null,m(t.fileList,(e,n)=>(h(),f(S,{key:e.uid||e?.response?.file_url||e.url||n,url:e.url||e?.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemovePreview(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])])):o(``,!0)}var Ge=W(Ie,[[`render`,We],[`__scopeId`,`data-v-ac071e59`]]),Ke=_({name:`SeedreamModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Y},data(){return{revertKey:0,options:[{value:R,label:this.$t(`seedream.model.seedream50pro`)},{value:U,label:this.$t(`seedream.model.seedream50`)},{value:V,label:this.$t(`seedream.model.seedream45`)},{value:L,label:this.$t(`seedream.model.seedream40`)},{value:z,label:this.$t(`seedream.model.seedream30t2i`)},{value:H,label:this.$t(`seedream.model.seededit30i2i`)}]}},computed:{value(){return this.$store.state.seedream?.config?.model}},mounted(){this.value||this.applyModel(ie)},methods:{async onChange(e){let t=this.$store.state.seedream?.config||{},n=Pe(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await ue.confirm(this.$t(`seedream.message.featureNotSupportedBody`,{fields:r}),this.$t(`seedream.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`seedream.button.confirmContinue`),cancelButtonText:this.$t(`seedream.button.cancelSwitch`),type:`warning`});let i=Fe({...t,model:e},n,{model:e});this.$store.commit(`seedream/setConfig`,i),q.success(this.$t(`seedream.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,model:e})}}}),qe={class:`field`},Je={class:`label`},Ye={class:`box`},Xe={class:`title font-bold`};function Ze(t,n,r,o,u,d){let g=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return h(),s(`div`,qe,[e(`div`,Je,[e(`div`,Ye,[e(`h2`,Xe,i(t.$t(`seedream.name.model`)),1),a(g,{content:t.$t(`seedream.description.model`),class:`info`},null,8,[`content`])])]),(h(),f(v,{key:t.revertKey,"model-value":t.value,class:`value`,placeholder:t.$t(`seedream.placeholder.select`),onChange:t.onChange},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var Qe=W(Ke,[[`render`,Ze],[`__scopeId`,`data-v-6413c179`]]),$e=_({name:`SeedreamSizeSelector`,components:{ElSelect:y,ElOption:b,ElOptionGroup:v,InfoIcon:Y},data(){return{SEEDREAM_SIZE_ADAPTIVE:re,pixelOptions:te}},computed:{model(){return this.$store.state.seedream?.config?.model},capabilities(){return X(this.model)},value:{get(){return this.$store.state.seedream?.config?.size},set(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,size:e})}}},watch:{model:{immediate:!0,handler(){if(this.value)return;let e=this.capabilities;e.sizeTiers.length?this.value=e.sizeTiers.includes(`2K`)?`2K`:e.sizeTiers[0]:e.sizePixelDefault&&(this.value=e.sizePixelDefault)}}}}),et={class:`field`},tt={class:`label`},nt={class:`box`},rt={class:`title font-bold`};function it(t,n,r,u,d,g){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-option-group`),b=l(`el-select`);return h(),s(`div`,et,[e(`div`,tt,[e(`div`,nt,[e(`h2`,rt,i(t.$t(`seedream.name.size`)),1),a(_,{content:t.$t(`seedream.description.size`),class:`info`},null,8,[`content`])])]),a(b,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedream.placeholder.size`),filterable:``,"allow-create":``,"default-first-option":``},{default:p(()=>[t.capabilities.sizeTiers.length?(h(),f(y,{key:0,label:t.$t(`seedream.size.group.tier`)},{default:p(()=>[(h(!0),s(c,null,m(t.capabilities.sizeTiers,e=>(h(),f(v,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`label`])):o(``,!0),t.capabilities.sizeAdaptive?(h(),f(y,{key:1,label:t.$t(`seedream.size.group.adaptive`)},{default:p(()=>[(h(),f(v,{key:t.SEEDREAM_SIZE_ADAPTIVE,label:t.$t(`seedream.size.adaptive`),value:t.SEEDREAM_SIZE_ADAPTIVE},null,8,[`label`,`value`]))]),_:1},8,[`label`])):o(``,!0),a(y,{label:t.$t(`seedream.size.group.pixel`)},{default:p(()=>[(h(!0),s(c,null,m(t.pixelOptions,e=>(h(),f(v,{key:e.value,label:`${e.value} (${e.ratio})`,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`label`])]),_:1},8,[`modelValue`,`placeholder`])])}var at=W($e,[[`render`,it],[`__scopeId`,`data-v-dd7bd021`]]),ot=_({name:`SeedreamMaxImagesSelector`,components:{ElInputNumber:T,InfoIcon:Y},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return X(this.config?.model).groupGeneration},referenceImageCount(){let e=this.config?.image;return Array.isArray(e)?e.length:0},effectiveMax(){let e=15-this.referenceImageCount;return Math.max(1,Math.min(15,e))},value:{get(){let e=this.config?.sequential_image_generation_options?.max_images;return typeof e==`number`&&e>=1?e:1},set(e){let t={...this.config||{}},n=Math.max(1,Math.min(this.effectiveMax,Math.floor(e||1)));n>1?(t.sequential_image_generation=`auto`,t.sequential_image_generation_options={...t.sequential_image_generation_options||{},max_images:n}):(t.sequential_image_generation=`disabled`,t.sequential_image_generation_options&&delete t.sequential_image_generation_options),this.$store.commit(`seedream/setConfig`,t)}}},watch:{effectiveMax(e){this.value>e&&(this.value=e)}}}),st={key:0,class:`field`},ct={class:`label`},lt={class:`box`},ut={class:`title font-bold`},dt={class:`value`};function ft(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-input-number`);return t.supported?(h(),s(`div`,st,[e(`div`,ct,[e(`div`,lt,[e(`h2`,ut,i(t.$t(`seedream.name.maxImages`)),1),a(f,{content:t.$t(`seedream.description.maxImages`),class:`info`},null,8,[`content`])])]),e(`div`,dt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:1,max:t.effectiveMax,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`,`max`])])])):o(``,!0)}var pt=W(ot,[[`render`,ft],[`__scopeId`,`data-v-f079fd20`]]),mt=_({name:`SeedreamOutputFormatSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Y},data(){return{options:[...ne]}},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return X(this.config?.model).outputFormat},value:{get(){return this.config?.output_format},set(e){let t={...this.config||{}};t.output_format=e,this.$store.commit(`seedream/setConfig`,t)}}}}),ht={key:0,class:`field`},gt={class:`label`},_t={class:`box`},vt={class:`title font-bold`};function yt(t,n,r,u,d,g){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-select`);return t.supported?(h(),s(`div`,ht,[e(`div`,gt,[e(`div`,_t,[e(`h2`,vt,i(t.$t(`seedream.name.outputFormat`)),1),a(_,{content:t.$t(`seedream.description.outputFormat`),class:`info`},null,8,[`content`])])]),a(y,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedream.placeholder.select`)},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(v,{key:e,label:e.toUpperCase(),value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])):o(``,!0)}var bt=W(mt,[[`render`,yt],[`__scopeId`,`data-v-69ea4c07`]]),xt=_({name:`SeedreamSeedInput`,components:{ElInputNumber:T,InfoIcon:Y},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return X(this.config?.model).seed},value:{get(){let e=this.config?.seed;return typeof e==`number`?e:-1},set(e){let t={...this.config||{}};t.seed=typeof e==`number`&&Number.isInteger(e)?e:-1,this.$store.commit(`seedream/setConfig`,t)}}}}),St={key:0,class:`field`},Ct={class:`label`},wt={class:`box`},Tt={class:`title font-bold`},Et={class:`value`};function Dt(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-input-number`);return t.supported?(h(),s(`div`,St,[e(`div`,Ct,[e(`div`,wt,[e(`h2`,Tt,i(t.$t(`seedream.name.seed`)),1),a(f,{content:t.$t(`seedream.description.seed`),class:`info`},null,8,[`content`])])]),e(`div`,Et,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:-1,max:2147483647,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])):o(``,!0)}var Ot=W(xt,[[`render`,Dt],[`__scopeId`,`data-v-10cdc1e0`]]),kt=_({name:`SeedreamGuidanceScaleInput`,components:{ElInputNumber:T,InfoIcon:Y},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return X(this.config?.model).guidanceScale},defaultValue(){return X(this.config?.model).guidanceScaleDefault??2.5},value:{get(){let e=this.config?.guidance_scale;return typeof e==`number`?e:this.defaultValue},set(e){let t={...this.config||{}};t.guidance_scale=typeof e==`number`&&e>=1&&e<=10?e:this.defaultValue,this.$store.commit(`seedream/setConfig`,t)}}}}),At={key:0,class:`field`},jt={class:`label`},Mt={class:`box`},Nt={class:`title font-bold`},Pt={class:`value`};function Ft(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-input-number`);return t.supported?(h(),s(`div`,At,[e(`div`,jt,[e(`div`,Mt,[e(`h2`,Nt,i(t.$t(`seedream.name.guidanceScale`)),1),a(f,{content:t.$t(`seedream.description.guidanceScale`),class:`info`},null,8,[`content`])])]),e(`div`,Pt,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:1,max:10,step:.1,precision:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])):o(``,!0)}var It=W(kt,[[`render`,Ft],[`__scopeId`,`data-v-7386f064`]]),Q=e=>{let t={...e||{}},n=Z(t.model,t.image);return delete t.action,t.watermark=!1,(n!==`edit`||!t.image?.length)&&delete t.image,t.size||delete t.size,t.sequential_image_generation!==`auto`&&delete t.sequential_image_generation_options,{...t,async:!0}},Lt=_({name:`SeedreamConfigPanel`,components:{MagicIcon:F,ElButton:G,PromptInput:je,Consumption:ge,ImageInput:Ge,ModelSelector:Qe,SizeSelector:at,MaxImagesSelector:pt,OutputFormatSelector:bt,SeedInput:Ot,GuidanceScaleInput:It},emits:[`generate`],computed:{action(){return Z(this.config?.model,this.config?.image)},capabilities(){return X(this.config?.model)},config(){return this.$store.state.seedream?.config},consumption(){let e=Q(this.config),t=e.sequential_image_generation===`auto`?Math.max(1,Math.floor(e.sequential_image_generation_options?.max_images||1)):1;return oe({...e,action:this.action,model:I(e.model),input_image_count:e.image?.length||0,count:t},this.service?.cost)},service(){return this.$store.state.seedream?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),Rt={class:`flex flex-col h-full`},zt={class:`flex-1 overflow-y-auto p-5`},Bt={class:`flex flex-col items-center justify-center px-5 pb-5`};function Vt(t,n,c,u,d,m){let g=l(`model-selector`),_=l(`size-selector`),v=l(`max-images-selector`),y=l(`output-format-selector`),b=l(`seed-input`),x=l(`guidance-scale-input`),S=l(`prompt-input`),C=l(`image-input`),w=l(`consumption`),T=l(`magic-icon`),E=l(`el-button`);return h(),s(`div`,Rt,[e(`div`,zt,[a(g,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),t.capabilities.image?(h(),f(C,{key:0,class:`mb-4`})):o(``,!0)]),e(`div`,Bt,[a(w,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(E,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedream.button.generate`)),1)]),_:1},8,[`onClick`])])])}var Ht=W(Lt,[[`render`,Vt]]),Ut=_({name:`SeedreamTaskPreview`,components:{ApplicationIcon:D,ChannelIcon:k,ImageIcon:j,InfoIcon:M,LightningIcon:ee,MagicIcon:F,TimeIcon:O,WarningIcon:N,CopyToClipboard:he,ElAlert:C,ImageWrapper:Se,ElButton:G,ElTooltip:S,ImagePreview:J,ApiCodeButton:be},props:{modelValue:{type:Object,required:!0}},computed:{apiRequest(){return Q(this.modelValue?.request)},isEdit(){return Array.isArray(this.modelValue?.request?.image)&&(this.modelValue?.request?.image?.length||0)>0},images(){let e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{e.push(t)}),e}},methods:{shortModel(e){return I(e)||e},onEdit(e){if(!e)return;console.debug(`Edit image:`,e);let t={...this.$store.state.seedream?.config||{}};t.image=[e],this.$store.commit(`seedream/setConfig`,t)}}}),Wt={class:`preview`},Gt={class:`left`},Kt={class:`main`},qt={class:`bot`},Jt={class:`datetime`},Yt={class:`info`},Xt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Zt={key:1,class:`prompt mt-2`},Qt={key:0},$t={key:0,class:n({content:!0})},en={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},tn={key:1,class:n({content:!0,failed:!0})},nn={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},rn={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},an={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},on={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},sn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},cn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ln={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},un={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},dn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},fn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},pn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},mn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},hn={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},gn={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},_n={key:3,class:n({content:!0})},vn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},yn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function bn(u,d,g,_,v,y){let b=l(`capability-presentation`),x=l(`image-preview`),S=l(`time-icon`),C=l(`magic-icon`),w=l(`copy-to-clipboard`),T=l(`el-alert`),E=l(`image-wrapper`),D=l(`el-button`),O=l(`el-tooltip`),k=l(`api-code-button`),A=l(`application-icon`),j=l(`image-icon`),M=l(`lightning-icon`),N=l(`channel-icon`),P=l(`warning-icon`),F=l(`info-icon`);return h(),s(`div`,Wt,[e(`div`,Gt,[a(b,{capability:`seedream`,part:`avatar`,class:`avatar`})]),e(`div`,Kt,[e(`div`,qt,[a(b,{capability:`seedream`,part:`name`}),e(`span`,Jt,i(u.$dayjs.format(``+new Date(parseFloat((u.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,Yt,[Array.isArray(u.modelValue?.request?.image)&&u.modelValue?.request?.image.length>0?(h(),s(`div`,Xt,[(h(!0),s(c,null,m(u.modelValue?.request?.image,(e,t)=>(h(),f(x,{key:t,url:e,name:`image-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),u.modelValue?.request?.prompt?(h(),s(`p`,Zt,[r(i(u.modelValue?.request?.prompt)+` `,1),u.modelValue?.response?o(``,!0):(h(),s(`span`,Qt,` - (`+i(u.$t(`seedream.status.pending`))+`) `,1))])):o(``,!0)]),u.modelValue?.response?u.modelValue?.response?.success===!0?(h(),s(`div`,tn,[e(`div`,nn,[(h(!0),s(c,null,m(u.images,(e,t)=>(h(),f(E,{key:t,src:e?.image_url,"raw-src":e?.image_url},null,8,[`src`,`raw-src`]))),128))]),e(`div`,rn,[a(O,{class:`box-item`,effect:`dark`,content:u.$t(`common.button.edit`),placement:`top-start`},{default:p(()=>[a(D,{type:`info`,size:`small`,class:`btn-action`,onClick:d[0]||=t(e=>u.onEdit(u.images?.[0]?.image_url),[`stop`])},{default:p(()=>[r(i(u.$t(`common.button.edit`)),1)]),_:1})]),_:1},8,[`content`]),a(k,{path:`/seedream/images`,body:u.apiRequest},null,8,[`body`])]),a(T,{closable:!1,class:`mt-2 success`},{default:p(()=>[u.modelValue?.request?.model?(h(),s(`p`,an,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.model`))+`: `+i(u.shortModel(u.modelValue?.request?.model)),1)])):o(``,!0),u.modelValue?.request?.size?(h(),s(`p`,on,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.size`))+`: `+i(u.modelValue?.request?.size),1)])):o(``,!0),e(`p`,sn,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.task`))+`: `+i(u.isEdit?u.$t(`seedream.name.edits`):u.$t(`seedream.name.generate`)),1)]),e(`p`,cn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.taskId`))+`: `+i(u.modelValue?.id)+` `,1),a(w,{content:u.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),u.modelValue?.elapsed?(h(),s(`p`,$,[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.elapsed`))+`: `+i(u.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),u.modelValue?.response?.trace_id?(h(),s(`p`,ln,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.traceId`))+`: `+i(u.modelValue?.response?.trace_id)+` `,1),a(w,{content:u.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):u.modelValue?.response?.success===!1?(h(),s(`div`,{key:2,class:n({content:!0,"mt-[15px]":!u.modelValue?.request?.prompt})},[a(T,{closable:!1,class:`failure`},{template:p(()=>[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.failure`)),1)]),default:p(()=>[u.modelValue?.request?.model?(h(),s(`p`,un,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.model`))+`: `+i(u.shortModel(u.modelValue?.request?.model)),1)])):o(``,!0),u.modelValue?.request?.size?(h(),s(`p`,dn,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.size`))+`: `+i(u.modelValue?.request?.size),1)])):o(``,!0),e(`p`,fn,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.task`))+`: `+i(u.isEdit?u.$t(`seedream.name.edits`):u.$t(`seedream.name.generate`)),1)]),e(`p`,pn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.taskId`))+`: `+i(u.modelValue?.id)+` `,1),a(w,{content:u.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),u.modelValue?.response?.error?.message?(h(),s(`p`,mn,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.failureReason`))+`: `+i(u.modelValue?.response?.error?.message)+` `,1),a(w,{content:u.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])])):o(``,!0),u.modelValue?.elapsed?(h(),s(`p`,hn,[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.elapsed`))+`: `+i(u.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),u.modelValue?.response?.trace_id?(h(),s(`p`,gn,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.traceId`))+`: `+i(u.modelValue?.response?.trace_id)+` `,1),a(w,{content:u.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})],2)):(h(),s(`div`,_n,[a(T,{closable:!1,class:`info`},{template:p(()=>[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.status`)),1)]),default:p(()=>[e(`p`,vn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.taskId`))+`: `+i(u.modelValue?.id)+` `,1),a(w,{content:u.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),u.modelValue?.response?.trace_id?(h(),s(`p`,yn,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.traceId`))+`: `+i(u.modelValue?.response?.trace_id)+` `,1),a(w,{content:u.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(h(),s(`div`,$t,[a(T,{closable:!1,class:`info`},{template:p(()=>[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.status.pending`)),1)]),default:p(()=>[e(`p`,en,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(u.$t(`seedream.name.taskId`))+`: `+i(u.modelValue?.id)+` `,1),a(w,{content:u.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})]))])])}var xn=_({name:`SeedreamRecentPanel`,components:{TaskPreview:W(Ut,[[`render`,bn],[`__scopeId`,`data-v-9c8af4df`]]),BotPlaceholder:xe,NoTasks:ve,ScrollList:_e},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.seedream?.tasks,items:this.$store.state.seedream?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Sn={key:0},Cn={key:2,class:`w-full h-full flex items-center justify-center`};function wn(e,t,n,r,i,u){let d=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return h(),s(c,null,[e.tasks?.items===void 0?(h(),s(`div`,Sn,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),f(_,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(h(!0),s(c,null,m(e.tasks?.items,e=>(h(),f(g,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(h(),s(`div`,Cn,[a(v)])):o(``,!0)],64)}var Tn=_({name:`SeedreamIndex`,components:{ConfigPanel:Ht,Layout:Oe,RecentPanel:W(xn,[[`render`,wn]])},mixins:[se],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.seedream?.status?.getApplications===K.Request},tasksLoading(){return this.$store.state.seedream?.status?.getTasks===K.Request},credential(){return this.$store.state.seedream?.credential},config(){return this.$store.state.seedream?.config},application(){return this.$store.state.seedream?.application},tasks(){return this.$store.state.seedream?.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ye({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loading,setLoading:e=>this.loading=e,isBlocked:()=>this.tasksLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`seedream/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`seedream/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.tasksLoading){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=20,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),await this.$store.dispatch(`seedream/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})},async onGenerate(){if(!ae(this.uploadTracker,e=>this.$t(e),e=>q.warning(e)))return;if(X(this.config?.model).imageRequired&&!this.config?.image?.length){q.warning(this.$t(`seedream.message.referenceImageRequired`));return}let e=Q(this.config);if(!fe())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}q.info(this.$t(`seedream.message.startingTask`)),pe(`seedream`,me.generate(e,{token:t})).then(()=>{q.success(this.$t(`seedream.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?q.error(this.$t(`seedream.message.usedUp`)):q.error(this.$t(`seedream.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function En(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return h(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loading,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Dn=W(Tn,[[`render`,En]]);export{Dn as default};
|