@acedatacloud/nexior 3.380.4 → 3.380.6
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-DSt2Pz0O.js → ApiCodeButton-yY9sIC18.js} +1 -1
- package/dist/assets/{ApiCodeDialog-Byr4CPCS.js → ApiCodeDialog-BLUVDa6B.js} +2 -2
- package/dist/assets/{Artifacts-CwC_U4xA.js → Artifacts-yeVPmg33.js} +1 -1
- package/dist/assets/{AskUserQuestionCard-D9fOfq80.js → AskUserQuestionCard-DX1Pk22u.js} +1 -1
- package/dist/assets/{AudioPreview-DbtJFAs7.js → AudioPreview-CnwTRcGy.js} +1 -1
- package/dist/assets/{Auth-b-NGU3Lu.js → Auth-CJoZFvHM.js} +1 -1
- package/dist/assets/{Bare-D0G3hFJE.js → Bare-DY5zCMGG.js} +1 -1
- package/dist/assets/{BotPlaceholder-BC8u-j84.js → BotPlaceholder-DAC5flJl.js} +1 -1
- package/dist/assets/{BottomFooter-CXPg4oia.js → BottomFooter-BONSfS_F.js} +1 -1
- package/dist/assets/{BrowseConnectors-DS5nGp3i.js → BrowseConnectors-D9R9JiA8.js} +1 -1
- package/dist/assets/{BrowserPairingDialog-NeyovLD-.js → BrowserPairingDialog-bpgkeeo1.js} +1 -1
- package/dist/assets/{Callback-DuZ9zjkR.js → Callback-ieDXRskK.js} +1 -1
- package/dist/assets/{CodeSnippet-Djz4eOTz.js → CodeSnippet-g54knlUN.js} +1 -1
- package/dist/assets/{Console-DcLA9Qt3.js → Console-CwLw8Auu.js} +1 -1
- package/dist/assets/{Conversation-O_Xv-6R6.js → Conversation-CV-3gYUB.js} +1 -1
- package/dist/assets/{Conversation-BQ7kjoFg.js → Conversation-Dn36zzZT.js} +2 -2
- package/dist/assets/{CopyToClipboard-CQT78wob.js → CopyToClipboard-OD_-zDDD.js} +1 -1
- package/dist/assets/{Detail-BqVKPO9C.js → Detail-C3hvSyp2.js} +1 -1
- package/dist/assets/Extra-BLhcNyVC.js +1 -0
- package/dist/assets/{FilePreview-D640d7Cq.js → FilePreview-C_zo-MCC.js} +1 -1
- package/dist/assets/{Hailuo-ClYsc7Vc.js → Hailuo-KVk3SAC1.js} +1 -1
- package/dist/assets/{History-DeAIxtE9.js → History-B2YCbKcj.js} +1 -1
- package/dist/assets/{ImagePreview-YXx0To-U.js → ImagePreview-iMMwS5bK.js} +1 -1
- package/dist/assets/{ImageWrapper-DH6OlBWC.js → ImageWrapper-DPFYz3PG.js} +1 -1
- package/dist/assets/Index-B26d3XUb2.js +1 -0
- package/dist/assets/{Index-Cuw-pJ0I.js → Index-B2dZQWPV.js} +1 -1
- package/dist/assets/{Index-BHOeQ3H9.js → Index-B2uiXYsr.js} +2 -2
- package/dist/assets/{Index-DeE_gyAr.js → Index-B7nKxqIv.js} +1 -1
- package/dist/assets/Index-BBBDlgXP.js +88 -0
- package/dist/assets/{Index-B80CvBO0.js → Index-BPfyJzDF.js} +1 -1
- package/dist/assets/{Index-D0f6VCCu.js → Index-BWxATCn4.js} +1 -1
- package/dist/assets/Index-Bcyq_YIZ.js +1 -0
- package/dist/assets/Index-Bol0-bce.js +1 -0
- package/dist/assets/Index-Brw_NmpE.js +2 -0
- package/dist/assets/{Index-DOv21tLH.css → Index-BsbAhMSz.css} +1 -1
- package/dist/assets/{Index-CnknPEOW2.js → Index-BwDwwg6y.js} +1 -1
- package/dist/assets/Index-BxsjRqQ4.js +1 -0
- package/dist/assets/Index-ByM-t-zY.js +1 -0
- package/dist/assets/Index-BzqjfDyK.js +1 -0
- package/dist/assets/{Index-CYJ4Mi3M.js → Index-C-nvVaFr.js} +1 -1
- package/dist/assets/{Index-eY2m4uYt.js → Index-C6eM4OO-.js} +1 -1
- package/dist/assets/{Index-DjMjXRYa.js → Index-CNRXBlE4.js} +1 -1
- package/dist/assets/{Index-Bp-GjqgR.js → Index-CQ8cqTkq.js} +1 -1
- package/dist/assets/Index-CRv9WTLe.js +1 -0
- package/dist/assets/{Index-BDNNQGYY.js → Index-CU7A29sK.js} +1 -1
- package/dist/assets/{Index-uBZSGiEh.js → Index-Cd4FcH7u.js} +1 -1
- package/dist/assets/Index-CesZYOqz.js +1 -0
- package/dist/assets/{Index-DqwY22ln.js → Index-CjsNDNat.js} +2 -2
- package/dist/assets/Index-CoQOM3Lc.js +1 -0
- package/dist/assets/{Index-Chg7-uHY.js → Index-Cp1nDoyT.js} +1 -1
- package/dist/assets/{Index-CjPN5GZr.js → Index-CutIaotz.js} +1 -1
- package/dist/assets/Index-D4VbsMbC2.js +1 -0
- package/dist/assets/Index-DMZwe1dw.js +1 -0
- package/dist/assets/{Index-uAG9GoTD.js → Index-DTz1508v2.js} +1 -1
- package/dist/assets/{Index-DK07tGm1.js → Index-DWWNdA0k.js} +1 -1
- package/dist/assets/{Index-GUuys43B.js → Index-DWmnQVHJ.js} +1 -1
- package/dist/assets/{Index-VvE544ki.js → Index-DlXFZ6d-.js} +1 -1
- package/dist/assets/Index-QpI1894D.js +1 -0
- package/dist/assets/Index-Tvp1KZvO.js +1 -0
- package/dist/assets/Index-UHcGq0ot.css +1 -0
- package/dist/assets/{Index-Cc2vUCVA.js → Index-x4ARhV5N.js} +1 -1
- package/dist/assets/{Index-De1b43q9.js → Index-zAZFxsP7.js} +1 -1
- package/dist/assets/{Invitees-DJE7UMCL.js → Invitees-rNRbRsJK.js} +1 -1
- package/dist/assets/{List-DlT9iEAG.js → List-Bl_Pw6ZM.js} +1 -1
- package/dist/assets/{List-MtsKWkKG.js → List-CqqTWjSR.js} +1 -1
- package/dist/assets/{List-B8wHqSvA.js → List-YcoeYD3g.js} +1 -1
- package/dist/assets/LocalTools-CGzgXYmU.js +5 -0
- package/dist/assets/{LocalTools-DlPjqmJb.js → LocalTools-Coin0A-_.js} +1 -1
- package/dist/assets/{Logo-BRsMoZUf.js → Logo-CzgdqTtr.js} +1 -1
- package/dist/assets/{Main-DkcDWNRf.js → Main-CEJWGYVQ.js} +1 -1
- package/dist/assets/{Message-TyAQUCUU.js → Message-C2SGTxO1.js} +2 -2
- package/dist/assets/{Model-DZqCeCtl.js → Model-BorsWZY7.js} +1 -1
- package/dist/assets/{Navigator-D6I38CcF.css → Navigator-BIH1gZzE.css} +1 -1
- package/dist/assets/{Navigator-DJR1Vv92.js → Navigator-CD6WYL8I.js} +5 -5
- package/dist/assets/{NotFound-DCPalElg.js → NotFound-bZTypZWk.js} +1 -1
- package/dist/assets/{PageHeader-DF-zuRdB.js → PageHeader-Cr_pWNQu.js} +1 -1
- package/dist/assets/Pay-jMnf8f4L.js +1 -0
- package/dist/assets/{Player-BofEgCOB.js → Player-DKlCY38Q.js} +1 -1
- package/dist/assets/{Poivelle-nb8MW5Qx.js → Poivelle-BbrjC2Pf.js} +1 -1
- package/dist/assets/{RealtimeCall-C9IB8DsU.js → RealtimeCall-CF9IZ4EK.js} +3 -3
- package/dist/assets/{ReportButton-B6G5OWJ0.js → ReportButton-CBoBD__d.js} +1 -1
- package/dist/assets/{ReportDialog-C8ssbL5B.js → ReportDialog-H8JCbrhU.js} +1 -1
- package/dist/assets/{ScenarioPaymentMode-DRMdqOm9.js → ScenarioPaymentMode-B-onFjJH.js} +1 -1
- package/dist/assets/{ScheduledTasks-BjZ3cZyb.js → ScheduledTasks-D1ogc14e.js} +2 -2
- package/dist/assets/{ServicePricingSummary-rLPlqY7R.js → ServicePricingSummary-mQ3kXYW6.js} +1 -1
- package/dist/assets/{SharedMarkdown-BmNuEnIj.js → SharedMarkdown-90N4n0oz.js} +1 -1
- package/dist/assets/{ShowcaseGrid-DOcNBb0W.js → ShowcaseGrid-Cki1GB7C.js} +1 -1
- package/dist/assets/{ShowcaseResultTabs-CS9fv2h_.js → ShowcaseResultTabs-CJ63xnjI.js} +1 -1
- package/dist/assets/{SolanaWalletPickerDialog-zxd6nO8P.js → SolanaWalletPickerDialog-BJCPJPLl.js} +1 -1
- package/dist/assets/{Status-Pg6vKJcY.js → Status-DuMI-huv.js} +1 -1
- package/dist/assets/{Subscribe-C5hDRcCw.js → Subscribe-BjsSfzMh.js} +1 -1
- package/dist/assets/{TabSwitcher-VfoHJIjb.js → TabSwitcher-C6ing8hE.js} +1 -1
- package/dist/assets/{Tts-BaBl3ymq.js → Tts-CaUMvlYA.js} +1 -1
- package/dist/assets/{VideoPlayer-DuUSbT-p.js → VideoPlayer-BHDyrslN.js} +1 -1
- package/dist/assets/{VideoPreview-DiHzfmhx.js → VideoPreview-CVQXuaJq.js} +1 -1
- package/dist/assets/{VueMarkdown-DX3n2_s6.js → VueMarkdown-Ciohflex.js} +2 -2
- package/dist/assets/WriteSkillDialog-CbGJtFx9.js +1 -0
- package/dist/assets/{airwallexCheckout-DImF7qWM.js → airwallexCheckout-BfsLyuyz.js} +1 -1
- package/dist/assets/arrow-down-BGS1e3rU.js +1 -0
- package/dist/assets/arrow-left-C64FJjH5.js +1 -0
- package/dist/assets/arrow-right-Cv0Ykyrz.js +1 -0
- package/dist/assets/arrow-up-C5g67P26.js +1 -0
- package/dist/assets/{authorizeFlow-iv3I40NA.js → authorizeFlow-DUX6f2cF.js} +1 -1
- package/dist/assets/{avatar-Bk-KlfGF.js → avatar-CNQyS-Lp.js} +1 -1
- package/dist/assets/{back-navigation-DCnyH9QK.js → back-navigation-D3D9a_KQ.js} +1 -1
- package/dist/assets/{basic-DhRe680f.js → basic-CKebYjqy.js} +1 -1
- package/dist/assets/{book-open-EQsOnwpQ.js → book-open-_lTz4QJR.js} +1 -1
- package/dist/assets/{box-Eq7xsVMG.js → box-6vYJ5zr0.js} +1 -1
- package/dist/assets/{boxes-_p2gozxH.js → boxes-BFnp7eNw.js} +1 -1
- package/dist/assets/{brain-B3HPVkyt.js → brain-TP-yaodp.js} +1 -1
- package/dist/assets/{chart-no-axes-combined-wCOmZXlo.js → chart-no-axes-combined-CbDGvzGk.js} +1 -1
- package/dist/assets/{chat-DlJM5HiQ.js → chat-D2C5PRGe.js} +1 -1
- package/dist/assets/check-BPmW-6Re.js +1 -0
- package/dist/assets/chevron-down-_5nRvC6_.js +1 -0
- package/dist/assets/chevron-right-CdZ7m0IV.js +1 -0
- package/dist/assets/{circle-alert-CudS64vb.js → circle-alert-CPXNfais.js} +1 -1
- package/dist/assets/circle-check-O20rZJdJ.js +1 -0
- package/dist/assets/{circle-question-mark-CT3dP_S-.js → circle-question-mark-bAyiS3uM.js} +1 -1
- package/dist/assets/{clipboard-list-rh0gR3f-.js → clipboard-list-NDSjeP6T.js} +1 -1
- package/dist/assets/clock-CAf8wf9e.js +1 -0
- package/dist/assets/code-DSlDLRN9.js +1 -0
- package/dist/assets/codingBridge-DXxeFXpR.js +2 -0
- package/dist/assets/{codingBridgeNotify-C68uE2gS.js → codingBridgeNotify-DmpIIIYp.js} +2 -2
- package/dist/assets/{coins-8GLEA8kx.js → coins-D2PG1Dcv.js} +1 -1
- package/dist/assets/{collapse-Dwaru9dv.js → collapse-B87qL7a1.js} +1 -1
- package/dist/assets/{constants-GmVIn7tC.js → constants-4TRM3yeb.js} +1 -1
- package/dist/assets/{copy-BIXUZXhN.js → copy-BskT-Tme.js} +1 -1
- package/dist/assets/{createTaskActions-Bz2OI0ye.js → createTaskActions-Dt37lwuh.js} +1 -1
- package/dist/assets/{date-picker-qwrQLSa0.js → date-picker-CWayt2Os.js} +1 -1
- package/dist/assets/{digitalhuman-EWWLamU7.js → digitalhuman-LDJWJFn6.js} +1 -1
- package/dist/assets/{dollar-sign-3CctSein.js → dollar-sign-Bu6eWtyh.js} +1 -1
- package/dist/assets/{download-0mLTP8WQ.js → download-B2eXd6xP.js} +1 -1
- package/dist/assets/{drawer-APcI0MuL.js → drawer-DVH0xZU_.js} +1 -1
- package/dist/assets/{dropdown-BZ5uH0eb.js → dropdown-DHi1DFxZ.js} +1 -1
- package/dist/assets/{dropdown-C1V-gXTG.js → dropdown-H1iCOtDm.js} +1 -1
- package/dist/assets/{ellipsis-DaK_tv_8.js → ellipsis-CS_-hd2M.js} +1 -1
- package/dist/assets/{esm-CwuiP5gS.js → esm-B-LdsOt6.js} +2 -2
- package/dist/assets/esm-CxX1IxoO.js +1 -0
- package/dist/assets/{esm-DDwto2T_.js → esm-ej3tHEtC.js} +2 -2
- package/dist/assets/{external-link-GS6joyO2.js → external-link-BUaqLKYm.js} +1 -1
- package/dist/assets/{eye-BjqPsB38.js → eye-MNgYUO1j.js} +1 -1
- package/dist/assets/{file-DN0Fq1Cv.js → file-CwiI2ZDt.js} +1 -1
- package/dist/assets/{file-output-CYRVDW3O.js → file-output-DksFKPyC.js} +1 -1
- package/dist/assets/{file-text-DLwLkvbZ.js → file-text-DM9_QdSH.js} +1 -1
- package/dist/assets/{fish-CuUidYqW.js → fish-CdeFszEX.js} +1 -1
- package/dist/assets/{flux-CkT5DOwc.js → flux-kgren3Q_.js} +1 -1
- package/dist/assets/{folder-DGjP5SDg.js → folder-DYKQn0mJ.js} +1 -1
- package/dist/assets/gauge-BjEg2K9v.js +1 -0
- package/dist/assets/{generationInput--J_4Niw5.js → generationInput-DnJFevpe.js} +1 -1
- package/dist/assets/{globe-CfmQv6dc.js → globe-f4dS915S.js} +1 -1
- package/dist/assets/grokvideo-BObiy7b0.js +1 -0
- package/dist/assets/{luma-BnxSbH2s.js → hailuo-CLRN3C5Y.js} +1 -1
- package/dist/assets/{hash-GTQkcsQj.js → hash-DqiIH4WA.js} +1 -1
- package/dist/assets/{headphones-B8VUrUji.js → headphones-DSR8arQo.js} +1 -1
- package/dist/assets/{history-BENBo59s.js → history-BmLtxr_f.js} +1 -1
- package/dist/assets/{house-WEmC14W_.js → house-DV6gKn0u.js} +1 -1
- package/dist/assets/{image-BEbYTJ0m.js → image-BVqhVXTy.js} +1 -1
- package/dist/assets/{imageRequests-BaQ60xKB.js → imageRequests-GNQtekZ9.js} +1 -1
- package/dist/assets/index-DURbYpHp.js +572 -0
- package/dist/assets/{index.es-BADyL8Or.js → index.es-BPCHaRbX.js} +1 -1
- package/dist/assets/{info-PmX6OJ8X.js → info-DzqnccKk.js} +1 -1
- package/dist/assets/{input-number-CQyq1gfs.js → input-number-DSOk0jCW.js} +1 -1
- package/dist/assets/{kling-CSMDk42y.js → kling-C6wE6PWD.js} +1 -1
- package/dist/assets/{languages-D0-qojfd.js → languages-DQhgO8zU.js} +1 -1
- package/dist/assets/{laptop-CiCND6PE.js → laptop-CuFSxcV7.js} +1 -1
- package/dist/assets/{lightbulb-rCoLSMOl.js → lightbulb-DlkrJWeZ.js} +1 -1
- package/dist/assets/{link-DfdSHXXz.js → link-CA71xo7D.js} +1 -1
- package/dist/assets/loader-circle-DZ3PD17k.js +1 -0
- package/dist/assets/{qrart-PjwpBvHh.js → luma-Cx9vm0CD.js} +1 -1
- package/dist/assets/maestro-BBLbhcdk.js +1 -0
- package/dist/assets/maestro-BbjtdNWq.js +1 -0
- package/dist/assets/maestro-CI7kJGPZ.js +1 -0
- package/dist/assets/maestro-Cq-lw4mZ.js +1 -0
- package/dist/assets/maestro-CvrCSepF.js +1 -0
- package/dist/assets/maestro-DFNYslYD.js +1 -0
- package/dist/assets/maestro-DIk5m-7L.js +1 -0
- package/dist/assets/maestro-DuZPhVj-.js +1 -0
- package/dist/assets/maestro-IWFg0U3T.js +1 -0
- package/dist/assets/maestro-Oxjr8OPC.js +1 -0
- package/dist/assets/maestro-VcPlmsOj.js +1 -0
- package/dist/assets/maestro-bsK4BW5L.js +1 -0
- package/dist/assets/maestro-h29lA6bR.js +1 -0
- package/dist/assets/{mail-LZDXgeS8.js → mail-BI9wlWnc.js} +1 -1
- package/dist/assets/{message-circle-VRo45xNQ.js → message-circle-BCrTeCKd.js} +1 -1
- package/dist/assets/{mic-x3pAaagI.js → mic-GjgLdgrD.js} +1 -1
- package/dist/assets/{midjourney-DiDJ_NAX.js → midjourney-DfhS25ZZ.js} +1 -1
- package/dist/assets/{minimax-CezIM2Vc.js → minimax-DMTZr51M.js} +1 -1
- package/dist/assets/{mobileLocalExec-Ba06Ginw.js → mobileLocalExec-Cez00ZSD.js} +2 -2
- package/dist/assets/{monitor-f-HdAnII.js → monitor-Dhu9PJDl.js} +1 -1
- package/dist/assets/{mouse-pointer-2-D28_tEOD.js → mouse-pointer-2-D3Hg5hXq.js} +1 -1
- package/dist/assets/music-2-LsJnrWjq.js +1 -0
- package/dist/assets/{nanobanana-C47zn35Q.js → nanobanana-DL4EGM-7.js} +1 -1
- package/dist/assets/{omni-BRhJ9p2L.js → omni-BHGuy_OI.js} +1 -1
- package/dist/assets/{openaiimage-DN5cekWI.js → openaiimage-C9KS3PWL.js} +1 -1
- package/dist/assets/{pagination-W-HQ78h5.js → pagination-Ccy4p3jJ.js} +1 -1
- package/dist/assets/{pagination-CkelWLyU.js → pagination-ESpJvGCV.js} +1 -1
- package/dist/assets/{pagination-RVZs5Fps.js → pagination-hD8vUwHZ.js} +1 -1
- package/dist/assets/{palette-Bnao4N1E.js → palette-zytRStv0.js} +1 -1
- package/dist/assets/{paperclip-BIrljPlV.js → paperclip-B9-z4Sw4.js} +1 -1
- package/dist/assets/{pause-B1oVLxPW.js → pause-8fyUMsI6.js} +1 -1
- package/dist/assets/{pencil-tfoCLZ10.js → pencil-CsjFAABf.js} +1 -1
- package/dist/assets/{pika-oMB8We5G.js → pika-DaSS-jhE.js} +1 -1
- package/dist/assets/{pixverse-CrjkStpM.js → pixverse-BBz9_xaO.js} +1 -1
- package/dist/assets/play-DbSJkwaz.js +1 -0
- package/dist/assets/{plug-CneJpKAI.js → plug-B05LKSuU.js} +1 -1
- package/dist/assets/plus-Ch9vaMzG.js +1 -0
- package/dist/assets/{poivelle-aDT78zU0.js → poivelle-DNUpAqAE.js} +1 -1
- package/dist/assets/{popover-CdWXDZ4Y.js → popover-Cyrdnxzf.js} +1 -1
- package/dist/assets/{producer-Cmo7xf9M.js → producer-yleleIFK.js} +1 -1
- package/dist/assets/{veo-BooE6Coe.js → qrart-DM5sCAPu.js} +1 -1
- package/dist/assets/{qwenimage-DiCadgpU.js → qwenimage-vL6h0JDb.js} +1 -1
- package/dist/assets/{realtime-cKmm03Gk.js → realtime-CXKU2TRW.js} +1 -1
- package/dist/assets/{refresh-cw-Bx7-OW-L.js → refresh-cw-CIkeGSdq.js} +1 -1
- package/dist/assets/rotate-ccw-BCt2BBKY.js +1 -0
- package/dist/assets/rotate-cw-B1rEwf95.js +1 -0
- package/dist/assets/{row-DNp_zRGz.js → row-BgeFnNqr.js} +1 -1
- package/dist/assets/{scheduledTasks-DfyCRMUo.js → scheduledTasks-yKVMpRrF.js} +1 -1
- package/dist/assets/{scroll-text-BznQ-upq.js → scroll-text-0TQUmW_G.js} +1 -1
- package/dist/assets/search-B4J4NAO1.js +1 -0
- package/dist/assets/{seedance-B5iHVffg.js → seedance-BBl9LPMD.js} +1 -1
- package/dist/assets/{seedream-BUCCanJU.js → seedream-CTCjkQmS.js} +1 -1
- package/dist/assets/{select-GALwUZll.js → select-B6ZO1rLl.js} +1 -1
- package/dist/assets/{serp-ByhpOEFk.js → serp-AghjMh3X.js} +1 -1
- package/dist/assets/{shield-zOrEMlZR.js → shield-BoT-slIH.js} +1 -1
- package/dist/assets/{showcase-ClAsok_u.js → showcase-LGm-Jv5z.js} +1 -1
- package/dist/assets/{showcaseRecreateMixin-Dhdr3T0y.js → showcaseRecreateMixin-BmDK7n-L.js} +1 -1
- package/dist/assets/{shuffle-Bsn1YQVr.js → shuffle-OUCsSq4D.js} +1 -1
- package/dist/assets/{site-BFSh5Tl1.js → site-B49LuPmm.js} +1 -1
- package/dist/assets/{site-Cg9MVedN.js → site-B8_t2Gq8.js} +1 -1
- package/dist/assets/{site-mJ0A622j.js → site-BRLKAsjK.js} +1 -1
- package/dist/assets/{site-v8-PMGDX.js → site-BWg9ZCUm.js} +1 -1
- package/dist/assets/{site-D0A9w1iR.js → site-BbxeOam5.js} +1 -1
- package/dist/assets/{site-nFnV_r0X.js → site-BpWwDuNx.js} +1 -1
- package/dist/assets/{site-BgL5auJs.js → site-CSCiTLp9.js} +1 -1
- package/dist/assets/{site-DJxqIMde.js → site-D6wDBCzU.js} +1 -1
- package/dist/assets/{site-CEyYV9T9.js → site-DIZYOk2e.js} +1 -1
- package/dist/assets/{site-CfeKxRll.js → site-DlUTcObc.js} +1 -1
- package/dist/assets/{site-eyXU2Lu9.js → site-fYVkMM28.js} +1 -1
- package/dist/assets/{site-Dq6XOltW.js → site-z4EU3abt.js} +1 -1
- package/dist/assets/{siteHome-DOZxDTUA.js → siteHome-n6fEmZXM.js} +1 -1
- package/dist/assets/{slider-C8pY6U4o.js → slider-DJM_8qq1.js} +1 -1
- package/dist/assets/{solana-wallets-Cib8AJ2S.js → solana-wallets-B2jid-qi.js} +2 -2
- package/dist/assets/{sora-8X-omnaE.js → sora-Cn4a7G1J.js} +1 -1
- package/dist/assets/{sparkles-C1bLa319.js → sparkles-CA_rhsRh.js} +1 -1
- package/dist/assets/square-B1ed_yTG.js +1 -0
- package/dist/assets/{suno-DoUkooAP.js → suno-DLrqUixP.js} +1 -1
- package/dist/assets/{switch-4nC3Yz4b.js → switch-Bdw4rC-y.js} +1 -1
- package/dist/assets/{table-CHg1iLS7.js → table-DRotfm-k.js} +1 -1
- package/dist/assets/{tabs-8Um-YKWZ.js → tabs-sZ_AqSxe.js} +1 -1
- package/dist/assets/{tag-ILhm5hh0.js → tag-B54dpjWl.js} +1 -1
- package/dist/assets/{taskPolling-DfRWd0Q5.js → taskPolling-B_SxyDD9.js} +1 -1
- package/dist/assets/terminal-BbSObAgc.js +1 -0
- package/dist/assets/{time-picker-DqmuplAb.js → time-picker-BcqGv443.js} +1 -1
- package/dist/assets/{tooltip-4w7ghPQM.js → tooltip-BFMHj7yV.js} +1 -1
- package/dist/assets/{trash-2-BkEkcSHv.js → trash-2-DTIOXFAX.js} +1 -1
- package/dist/assets/{triangle-alert-DBmpuUlm.js → triangle-alert-BPPxjzKW.js} +1 -1
- package/dist/assets/{upload-DidTvyIg.js → upload-B8RBApAO.js} +1 -1
- package/dist/assets/{upload-Sju4DbiY.js → upload-DvqAUM9o.js} +1 -1
- package/dist/assets/user-DbQMGtR0.js +1 -0
- package/dist/assets/{hailuo-DaQVZPNi.js → veo-Yt8igQIU.js} +1 -1
- package/dist/assets/{video-DwVV0C_d.js → video-BwlralfI.js} +1 -1
- package/dist/assets/{volume-2-CpkYjlNM.js → volume-2-L7Us8StJ.js} +1 -1
- package/dist/assets/{vuex.esm-bundler-BV9tXD4i.js → vuex.esm-bundler-Dh61cDbO.js} +1 -1
- package/dist/assets/{wallet-CSEdeUVb.js → wallet-4XwgqLJP.js} +1 -1
- package/dist/assets/{wan-NceqaOX8.js → wan-D6vcSwq9.js} +1 -1
- package/dist/assets/{wand-sparkles-CwgjO5Gl.js → wand-sparkles-Be9RrbrT.js} +1 -1
- package/dist/assets/{web-DR1td9xt.js → web-BV2ceXJ7.js} +1 -1
- package/dist/assets/{web-ChTQtMOV.js → web-D2nuEqfy.js} +1 -1
- package/dist/assets/{web-CtwYyIHk.js → web-DIj3tgeE.js} +1 -1
- package/dist/assets/{web-Be7eYSTS.js → web-DlYim1xR.js} +1 -1
- package/dist/assets/{web-DYYogIAJ.js → web-zjGs6Tk6.js} +1 -1
- package/dist/assets/{webextrator-DcBVygf6.js → webextrator-DEaErwUM.js} +1 -1
- package/dist/assets/{zap-5TJ16_7J.js → zap-B_4nhrzt.js} +1 -1
- package/dist/index.html +3 -3
- package/package.json +1 -1
- package/dist/assets/Extra-RTJPBXX1.js +0 -1
- package/dist/assets/Index-3enMEt0q.js +0 -1
- package/dist/assets/Index-4M6goWY5.js +0 -1
- package/dist/assets/Index-7Lx1-FVY.js +0 -88
- package/dist/assets/Index-B0S_YnIQ.js +0 -1
- package/dist/assets/Index-B2mD07Ei.js +0 -1
- package/dist/assets/Index-BRky2LVx.js +0 -1
- package/dist/assets/Index-BjS0ggii.js +0 -2
- package/dist/assets/Index-Bm_JpxRb.css +0 -1
- package/dist/assets/Index-CyKGM7MD.js +0 -1
- package/dist/assets/Index-DTFPAlsp.js +0 -1
- package/dist/assets/Index-Dx52UhVA.js +0 -1
- package/dist/assets/Index-Mw1xrmbA.js +0 -1
- package/dist/assets/Index-NwESkz1G.js +0 -1
- package/dist/assets/Index-eXdcllSH.js +0 -1
- package/dist/assets/Index-jZMrIwYv.js +0 -1
- package/dist/assets/Index-uemFTdfN.js +0 -1
- package/dist/assets/LocalTools-C5elVqih.js +0 -5
- package/dist/assets/Pay-5sKP-5mn.js +0 -1
- package/dist/assets/WriteSkillDialog-B4lxIDJK.js +0 -1
- package/dist/assets/arrow-down-B7gY3qc0.js +0 -1
- package/dist/assets/arrow-left-D9PzI6lU.js +0 -1
- package/dist/assets/arrow-right-BZVVykF9.js +0 -1
- package/dist/assets/arrow-up-vjX6ESSZ.js +0 -1
- package/dist/assets/check-DEuTU4c8.js +0 -1
- package/dist/assets/chevron-down-CCvMOkAm.js +0 -1
- package/dist/assets/chevron-right-CMN7EUPl.js +0 -1
- package/dist/assets/circle-check-BzGCItgQ.js +0 -1
- package/dist/assets/clock-BooSG6zB.js +0 -1
- package/dist/assets/code-DyNs0diY.js +0 -1
- package/dist/assets/codingBridge-D5m47vOt.js +0 -2
- package/dist/assets/esm-Czt26omG.js +0 -1
- package/dist/assets/gauge-DRD3bzzD.js +0 -1
- package/dist/assets/grokvideo-jylBR3ej.js +0 -1
- package/dist/assets/index-Dr2ooWnm.js +0 -572
- package/dist/assets/loader-circle-DlDNc4da.js +0 -1
- package/dist/assets/maestro-BZjKR3qb.js +0 -1
- package/dist/assets/maestro-BseWpiuj.js +0 -1
- package/dist/assets/maestro-C1SfpTGL.js +0 -1
- package/dist/assets/maestro-C3qz5VUl.js +0 -1
- package/dist/assets/maestro-CA9H8dEG.js +0 -1
- package/dist/assets/maestro-CEEx8qvF.js +0 -1
- package/dist/assets/maestro-CZsW3Nlk.js +0 -1
- package/dist/assets/maestro-ChDcMauc.js +0 -1
- package/dist/assets/maestro-CsqrFYgi.js +0 -1
- package/dist/assets/maestro-DM9tDnMK.js +0 -1
- package/dist/assets/maestro-DdTH473R.js +0 -1
- package/dist/assets/maestro-ZR8sSyLR.js +0 -1
- package/dist/assets/maestro-lQnNR9WV.js +0 -1
- package/dist/assets/maestroLanguages-BCseVxSx.js +0 -1
- package/dist/assets/music-2-DimqlZ0P.js +0 -1
- package/dist/assets/play-CKD5ICgk.js +0 -1
- package/dist/assets/plus-B_fnUe1I.js +0 -1
- package/dist/assets/rotate-ccw-DxSDeWPl.js +0 -1
- package/dist/assets/rotate-cw-ZIUqlSwU.js +0 -1
- package/dist/assets/search-CgyxhhlQ.js +0 -1
- package/dist/assets/square-CT3nJzJZ.js +0 -1
- package/dist/assets/terminal-B0UFZK-h.js +0 -1
- package/dist/assets/user-D8eTVZ1t.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
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,S as c,T as l,at as u,ht as d,it as f,j as p,mt as m,qt as h,rt as g,tt as _,x as v,z as y}from"./vendor-chart-Dw-P17PN.js";import{r as b,t as x}from"./select-GALwUZll.js";import{t as S}from"./upload-Sju4DbiY.js";import{t as C}from"./tooltip-4w7ghPQM.js";import{t as w}from"./alert-BprQRUmf.js";import{_ as T,v as E}from"./vuex.esm-bundler-BV9tXD4i.js";import{t as D}from"./drawer-APcI0MuL.js";import{t as O}from"./box-Eq7xsVMG.js";import{t as k}from"./clock-BooSG6zB.js";import{t as A}from"./external-link-GS6joyO2.js";import{t as j}from"./hash-GTQkcsQj.js";import{t as M}from"./image-BEbYTJ0m.js";import{t as N}from"./info-PmX6OJ8X.js";import{a as P,i as F,n as I,r as L,t as ee}from"./pagination-W-HQ78h5.js";import{t as te}from"./trash-2-BkEkcSHv.js";import{t as ne}from"./triangle-alert-DBmpuUlm.js";import{t as re}from"./upload-DidTvyIg.js";import{t as R}from"./wand-sparkles-CwgjO5Gl.js";import{t as z}from"./zap-5TJ16_7J.js";import{$a as ie,Ua as B,_r as V,gr as ae,hr as oe,pr as se,vr as H,yr as ce}from"./constants-GmVIn7tC.js";import{D as U,Mi as W,Na as G,Pi as K,Qa as q,Qn as J,T as le,Tn as ue,at as de,ct as fe,lt as pe,oi as me,ot as he,qi as ge,ri as _e,st as ve,ta as Y,tt as ye,za as X}from"./index-Dr2ooWnm.js";import{t as be}from"./CopyToClipboard-CQT78wob.js";import{t as xe}from"./ReportButton-B6G5OWJ0.js";import{t as Z}from"./ImagePreview-YXx0To-U.js";import{n as Se}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Ce}from"./ServicePricingSummary-rLPlqY7R.js";import{t as we}from"./ScenarioPaymentMode-DRMdqOm9.js";import{t as Te}from"./ApiCodeButton-DSt2Pz0O.js";import{t as Ee}from"./BotPlaceholder-BC8u-j84.js";import{t as De}from"./taskPollingMixin-CcLxtz8z.js";import{t as Oe}from"./ShowcaseResultTabs-CS9fv2h_.js";import{t as ke}from"./showcaseRecreateMixin-Dhdr3T0y.js";import{t as Ae}from"./ImageWrapper-DH6OlBWC.js";import{t as Q}from"./imageRequests-BaQ60xKB.js";var je=y({name:`LayoutNanobanana`,components:{MagicIcon:R,ElDrawer:D,ElButton:q},mixins:[Se]}),Me={class:`main flex flex-row flex-1`},Ne={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)]`},Pe={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Fe(t,n,r,i,o,c){let l=u(`magic-icon`),p=u(`el-button`),h=u(`el-drawer`);return _(),s(`div`,Me,[e(`div`,Ne,[f(t.$slots,`config`,{},void 0,!0)]),e(`div`,Pe,[f(t.$slots,`result`,{},void 0,!0)]),d(a(p,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:m(()=>[a(l,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[v,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer generator-drawer`},{default:m(()=>[f(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Ie=U(je,[[`render`,Fe],[`__scopeId`,`data-v-6f553b1e`]]),Le=y({name:`PromptInput`,components:{PromptTextarea:F},computed:{prompt:{get(){return this.$store.state.nanobanana?.config?.prompt},set(e){this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Re(e,t,n,r,i,a){let o=u(`prompt-textarea`);return _(),p(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`nanobanana.name.prompt`),info:e.$t(`nanobanana.description.prompt`),placeholder:e.$t(`nanobanana.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var ze=U(Le,[[`render`,Re]]),Be=y({name:`ImageUrlsInput`,components:{UploadIcon:re,ElUpload:S,ElButton:q,InfoIcon:P,ImagePreview:Z},mixins:[pe,fe,he,ye],data(){return{fileList:[],uploadUrl:G()+`/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.nanobanana?.config?.image_urls}},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}}},mounted(){},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.onSetImageUrls()},onExceed(){E.warning(this.$t(`nanobanana.message.uploadImageExceed`))},onError(){E.error(this.$t(`nanobanana.message.uploadImageError`))},onSetImageUrls(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,image_urls:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImageUrls()},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.onSetImageUrls()}}}),Ve={class:`field mb-[10px] flex min-h-8 w-full items-center justify-between gap-3`},He={class:`flex min-w-0 items-center`},Ue={class:`title m-0 text-[14px] font-bold`},We={class:`file-list flex flex-wrap gap-[10px]`};function Ge(t,n,o,c,d,f){let h=u(`info-icon`),v=u(`upload-icon`),y=u(`el-button`),b=u(`el-upload`),x=u(`image-preview`);return _(),s(`div`,null,[e(`div`,Ve,[e(`div`,He,[e(`h2`,Ue,i(t.$t(`nanobanana.name.imageUrls`)),1),a(h,{content:t.$t(`nanobanana.description.imageUrls`)},null,8,[`content`])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value shrink-0`,limit:5,multiple:!0,"show-file-list":!1,"before-upload":t.beforeUploadSizeGuard,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:m(()=>[a(y,{size:`small`,type:`primary`,round:``},{default:m(()=>[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`nanobanana.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])]),e(`div`,We,[(_(!0),s(l,null,g(t.fileList,(e,n)=>(_(),p(x,{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))])])}var Ke=U(Be,[[`render`,Ge]]),qe=y({name:`AspectRatioSelector`,components:{InfoIcon:P},data(){return{options:[{value:`1:1`,label:`1:1`,width:20,height:20},{value:`3:2`,label:`3:2`,width:27,height:18},{value:`2:3`,label:`2:3`,width:18,height:27},{value:`16:9`,label:`16:9`,width:25,height:13},{value:`9:16`,label:`9:16`,width:13,height:25},{value:`4:3`,label:`4:3`,width:24,height:18},{value:`3:4`,label:`3:4`,width:18,height:24}]}},computed:{value(){return this.$store.state.nanobanana?.config?.aspect_ratio}},methods:{onSelect(e){let t=this.value===e?void 0:e,n={...this.$store.state.nanobanana?.config||{}};t?n.aspect_ratio=t:delete n.aspect_ratio,this.$store.commit(`nanobanana/setConfig`,n)}}}),Je={class:`ratio`},Ye={class:`header`},Xe={class:`title font-bold`},Ze=[`aria-label`],Qe=[`aria-checked`,`aria-label`,`onClick`,`onKeydown`],$e={class:`preview`},et={class:`name`};function tt(r,o,d,f,p,m){let v=u(`info-icon`);return _(),s(`div`,Je,[e(`div`,Ye,[e(`h2`,Xe,i(r.$t(`nanobanana.name.aspectRatio`)),1),a(v,{content:r.$t(`nanobanana.description.aspectRatio`),class:`ml-1`},null,8,[`content`])]),e(`div`,{class:`items`,role:`radiogroup`,"aria-label":r.$t(`nanobanana.name.aspectRatio`)},[(_(!0),s(l,null,g(r.options,a=>(_(),s(`div`,{key:a.value,class:n([`item`,{active:r.value===a.value}]),role:`radio`,"aria-checked":r.value===a.value,"aria-label":a.label,tabindex:`0`,onClick:e=>r.onSelect(a.value),onKeydown:[c(t(e=>r.onSelect(a.value),[`prevent`]),[`enter`]),c(t(e=>r.onSelect(a.value),[`prevent`]),[`space`])]},[e(`div`,$e,[e(`div`,{class:`rect`,style:h({width:a.width+`px`,height:a.height+`px`})},null,4)]),e(`p`,et,i(a.label),1)],42,Qe))),128))],8,Ze)])}var nt=U(qe,[[`render`,tt],[`__scopeId`,`data-v-7131eb97`]]),rt=y({name:`NanobananaModelSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:P},data(){return{options:[{value:oe,label:this.$t(`nanobanana.model.nanoBanana`)},{value:H,label:H},{value:ce,label:this.$t(`nanobanana.model.nanoBananaPro`)},{value:ae,label:this.$t(`nanobanana.model.nanoBanana2`)},{value:V,label:V}]}},computed:{value:{get(){return this.$store.state.nanobanana?.config?.model},set(e){this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,model:e})}},modelDescription(){return this.$t(`nanobanana.description.model`)}},mounted(){this.value||=se}}),it={class:`field`},at={class:`label`},ot={class:`box`},st={class:`title font-bold`};function ct(t,n,r,o,c,d){let f=u(`info-icon`),h=u(`el-option`),v=u(`el-select`);return _(),s(`div`,it,[e(`div`,at,[e(`div`,ot,[e(`h2`,st,i(t.$t(`nanobanana.name.model`)),1),a(f,{content:t.modelDescription,class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`nanobanana.placeholder.select`)},{default:m(()=>[(_(!0),s(l,null,g(t.options,e=>(_(),p(h,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var lt=U(rt,[[`render`,ct],[`__scopeId`,`data-v-a04056e6`]]),ut=y({name:`NanobananaResolutionSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:P},data(){return{cachedResolution:`1K`,options:[{value:`1K`,label:`1K`},{value:`2K`,label:`2K`},{value:`4K`,label:`4K`}]}},computed:{value:{get(){return this.$store.state.nanobanana?.config?.resolution},set(e){this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,resolution:e})}},supportsResolution(){let e=this.$store.state.nanobanana?.config?.model;return e===`nano-banana-2`||e===`nano-banana-2.1`||e===`nano-banana-pro`}},watch:{value(e){this.supportsResolution&&e&&(this.cachedResolution=e)},supportsResolution(e){e?this.value||=this.cachedResolution||`1K`:(this.value&&(this.cachedResolution=this.value),this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,resolution:void 0}))}},mounted(){this.supportsResolution&&!this.value&&(this.value=`1K`),!this.supportsResolution&&this.value&&(this.cachedResolution=this.value,this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,resolution:void 0}))}}),dt={class:`field`},ft={class:`label`},pt={class:`box`},mt={class:`title font-bold`};function ht(t,n,r,o,c,d){let f=u(`info-icon`),h=u(`el-option`),v=u(`el-select`);return _(),s(`div`,dt,[e(`div`,ft,[e(`div`,pt,[e(`h2`,mt,i(t.$t(`nanobanana.name.resolution`)),1),a(f,{content:t.$t(`nanobanana.description.resolutionProOnly`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`nanobanana.placeholder.select`),disabled:!t.supportsResolution},{default:m(()=>[(_(!0),s(l,null,g(t.options,e=>(_(),p(h,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`])])}var gt=U(ut,[[`render`,ht],[`__scopeId`,`data-v-6246047b`]]),_t=350,vt=y({name:`ConfigPanel`,components:{MagicIcon:R,ElButton:q,PromptInput:ze,ServicePricingSummary:Ce,ImageUrlsInput:Ke,AspectRatioSelector:nt,ModelSelector:lt,ResolutionSelector:gt,ScenarioPaymentMode:we},props:{identityToken:{type:String,default:void 0}},emits:[`generate`],data(){return{quoteTimer:0,quoteRunId:0}},computed:{config(){return this.$store.state.nanobanana?.config},canGenerate(){return B(this.config?.prompt)},consumption(){let e={...this.config||{}},t=Array.isArray(e?.image_urls)&&e.image_urls.length>0;return ue({...e,action:t?`edit`:`generate`},this.service?.cost)},service(){return this.$store.state.nanobanana?.service},walletMode(){return W()&&K(`nanobanana`).mode===`wallet`}},watch:{walletMode:{handler(e){e?this.scheduleQuote():this.clearQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0},identityToken(){this.walletMode&&this.scheduleQuote()}},beforeUnmount(){this.clearQuote()},methods:{clearQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=K(`nanobanana`);e.quoteUsdc=void 0,e.quoteLoading=!1},scheduleQuote(){this.clearQuote(),!(!this.walletMode||!this.canGenerate)&&(this.quoteTimer=window.setTimeout(this.refreshQuote,_t))},async refreshQuote(){if(!this.walletMode||!this.canGenerate){this.clearQuote();return}let e=K(`nanobanana`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await J.quote(Q(this.config),this.identityToken);t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)}}}),yt={class:`flex flex-col h-full`},bt={class:`flex-1 overflow-y-auto p-5`},xt={class:`flex flex-col items-center justify-center px-5 pb-5`};function St(t,n,c,l,d,f){let h=u(`model-selector`),g=u(`resolution-selector`),v=u(`prompt-input`),y=u(`aspect-ratio-selector`),b=u(`image-urls-input`),x=u(`scenario-payment-mode`),S=u(`service-pricing-summary`),C=u(`magic-icon`),w=u(`el-button`);return _(),s(`div`,yt,[e(`div`,bt,[a(h,{class:`mb-4`}),a(g,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`})]),e(`div`,xt,[a(x,{scenario:`nanobanana`}),t.walletMode?o(``,!0):(_(),p(S,{key:0,value:t.consumption,service:t.service,"pricing-unit-aliases":{count:`image`}},null,8,[`value`,`service`])),a(w,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:m(()=>[a(C,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`nanobanana.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var Ct=U(vt,[[`render`,St]]),wt=y({name:`TaskPreview`,components:{ApplicationIcon:O,ChannelIcon:j,DeleteIcon:te,ExternalLinkIcon:A,ImageIcon:M,InfoIcon:N,LightningIcon:z,MagicIcon:R,TimeIcon:k,WarningIcon:ne,CopyToClipboard:be,ElAlert:w,ImageWrapper:Ae,ElButton:q,ElTooltip:C,ImagePreview:Z,ApiCodeButton:Te,ReportButton:xe},props:{modelValue:{type:Object,required:!0}},computed:{images(){let e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{e.push(t)}),e},hasImages(){return this.images.some(e=>!!e?.image_url)},isFailure(){let e=this.modelValue?.response;return e?.success===!1||!!e?.error},showResult(){let e=this.modelValue?.response;return!e||this.isFailure?!1:(e.success,this.hasImages)},reportSnapshot(){return{prompt:this.modelValue?.request?.prompt,image_urls:this.images.map(e=>e.image_url).filter(Boolean),model:this.modelValue?.request?.model,action:this.modelValue?.request?.action,task_id:this.modelValue?.id,trace_id:this.modelValue?.response?.trace_id}}},methods:{onEdit(e){if(!e)return;console.debug(`Edit image:`,e);let t={...this.$store.state.nanobanana?.config||{}};delete t.action,t.image_urls=[e],this.$store.commit(`nanobanana/setConfig`,t)},async onDelete(){let e=this.modelValue?.id;if(e){try{await X.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`nanobanana/deleteTask`,{id:e}),E.success(this.$t(`common.message.deleteTaskSuccess`))}catch{E.error(this.$t(`common.message.deleteTaskFailed`))}}}}}),Tt={class:`preview`},Et={class:`left`},Dt={class:`main`},Ot={class:`bot`},kt={class:`datetime`},At=[`aria-label`],jt={class:`info`},Mt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Nt={key:1,class:`prompt mt-2`},Pt={key:0},Ft={key:0,class:n({content:!0,failed:!0})},It={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},Lt={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Rt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},zt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Bt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Vt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ht={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ut={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Wt={key:5,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Gt={key:1,class:n({content:!0})},Kt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},qt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Jt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Yt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Xt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Zt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Qt={key:5,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},$t={key:2,class:n({content:!0})},en={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},tn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},nn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},rn={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},an={class:`text-[var(--el-text-color-regular)] text-xs mb-2`};function on(n,c,d,f,h,v){let y=u(`capability-presentation`),b=u(`delete-icon`),x=u(`el-tooltip`),S=u(`image-preview`),C=u(`image-wrapper`),w=u(`el-button`),T=u(`api-code-button`),E=u(`report-button`),D=u(`application-icon`),O=u(`image-icon`),k=u(`external-link-icon`),A=u(`lightning-icon`),j=u(`magic-icon`),M=u(`copy-to-clipboard`),N=u(`time-icon`),P=u(`channel-icon`),F=u(`el-alert`),I=u(`warning-icon`),L=u(`info-icon`);return _(),s(`div`,Tt,[e(`div`,Et,[a(y,{capability:`nanobanana`,part:`avatar`,class:`avatar`})]),e(`div`,Dt,[e(`div`,Ot,[a(y,{capability:`nanobanana`,part:`name`}),e(`span`,kt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(x,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:m(()=>[n.modelValue?.id?(_(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:c[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,At)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,jt,[n.modelValue?.request?.image_urls&&n.modelValue?.request?.image_urls.length>0?(_(),s(`div`,Mt,[(_(!0),s(l,null,g(n.modelValue?.request?.image_urls,(e,t)=>(_(),p(S,{key:t,url:e,name:`image-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),n.modelValue?.request?.prompt?(_(),s(`p`,Nt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(_(),s(`span`,Pt,` - (`+i(n.$t(`nanobanana.status.pending`))+`) `,1))])):o(``,!0)]),n.showResult?(_(),s(`div`,Ft,[e(`div`,It,[(_(!0),s(l,null,g(n.images,(e,t)=>(_(),p(C,{key:t,src:e?.image_url,"raw-src":e?.image_url},null,8,[`src`,`raw-src`]))),128))]),e(`div`,Lt,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`common.button.edit`),placement:`top-start`},{default:m(()=>[a(w,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=t(e=>n.onEdit(n.images?.[0]?.image_url),[`stop`])},{default:m(()=>[r(i(n.$t(`common.button.edit`)),1)]),_:1})]),_:1},8,[`content`]),a(T,{path:`/nano-banana/images`,body:n.modelValue?.request},null,8,[`body`]),a(E,{service:`nanobanana`,"target-id":n.modelValue?.id,snapshot:n.reportSnapshot,"show-label":``},null,8,[`target-id`,`snapshot`])]),a(F,{closable:!1,class:`mt-2 success`},{default:m(()=>[n.modelValue?.request?.model?(_(),s(`p`,Rt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.resolution?(_(),s(`p`,zt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.resolution`))+`: `+i(n.modelValue?.request?.resolution),1)])):o(``,!0),n.modelValue?.request?.aspect_ratio?(_(),s(`p`,Bt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.aspectRatio`))+`: `+i(n.modelValue?.request?.aspect_ratio),1)])):o(``,!0),n.modelValue?.request?.action?(_(),s(`p`,Vt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.task`))+`: `+i(n.modelValue?.request?.action===`generate`?n.$t(`nanobanana.name.generate`):n.$t(`nanobanana.name.edits`)),1)])):o(``,!0),e(`p`,Ht,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(M,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(_(),s(`p`,Ut,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(_(),s(`p`,Wt,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(M,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.isFailure?(_(),s(`div`,Gt,[a(F,{closable:!1,class:`failure`},{template:m(()=>[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.failure`)),1)]),default:m(()=>[n.modelValue?.request?.model?(_(),s(`p`,Kt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.resolution?(_(),s(`p`,qt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.resolution`))+`: `+i(n.modelValue?.request?.resolution),1)])):o(``,!0),n.modelValue?.request?.aspect_ratio?(_(),s(`p`,$,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.aspectRatio`))+`: `+i(n.modelValue?.request?.aspect_ratio),1)])):o(``,!0),n.modelValue?.request?.action?(_(),s(`p`,Jt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.task`))+`: `+i(n.modelValue?.request?.action===`generate`?n.$t(`nanobanana.name.generate`):n.$t(`nanobanana.name.edits`)),1)])):o(``,!0),e(`p`,Yt,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(M,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),e(`p`,Xt,[a(L,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(M,{content:n.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.elapsed?(_(),s(`p`,Zt,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(_(),s(`p`,Qt,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(M,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(_(),s(`div`,$t,[a(F,{closable:!1,class:`info`},{template:m(()=>[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.status.pending`)),1)]),default:m(()=>[n.modelValue?.request?.model?(_(),s(`p`,en,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.resolution?(_(),s(`p`,tn,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.resolution`))+`: `+i(n.modelValue?.request?.resolution),1)])):o(``,!0),n.modelValue?.request?.aspect_ratio?(_(),s(`p`,nn,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.aspectRatio`))+`: `+i(n.modelValue?.request?.aspect_ratio),1)])):o(``,!0),n.modelValue?.request?.action?(_(),s(`p`,rn,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.task`))+`: `+i(n.modelValue?.request?.action===`generate`?n.$t(`nanobanana.name.generate`):n.$t(`nanobanana.name.edits`)),1)])):o(``,!0),e(`p`,an,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(M,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])])]),_:1})]))])])}var sn=y({name:`RecentPanel`,components:{TaskPreview:U(wt,[[`render`,on],[`__scopeId`,`data-v-aa642ec8`]]),BotPlaceholder:Ee,NoTasks:L,ScrollList:I},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.nanobanana?.tasks,items:this.$store.state.nanobanana?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),cn={key:0},ln={key:2,class:`w-full h-full flex items-center justify-center`};function un(e,t,n,r,i,c){let d=u(`bot-placeholder`),f=u(`task-preview`),h=u(`scroll-list`),v=u(`no-tasks`);return _(),s(l,null,[e.tasks?.items===void 0?(_(),s(`div`,cn,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(_(),p(h,{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:m(()=>[(_(!0),s(l,null,g(e.tasks?.items,e=>(_(),p(f,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(_(),s(`div`,ln,[a(v)])):o(``,!0)],64)}var dn=y({name:`NanobananaIndex`,components:{ConfigPanel:Ct,Layout:Ie,RecentPanel:U(sn,[[`render`,un]]),ShowcaseResultTabs:Oe},mixins:[ve,ke(`nanobanana`),De(`nanobanana`)],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.nanobanana?.status?.getApplications===T.Request},tasksLoading(){return this.$store.state.nanobanana?.status?.getTasks===T.Request},credential(){return this.$store.state.nanobanana?.credential},config(){return this.$store.state.nanobanana?.config},application(){return this.$store.state.nanobanana?.application},tasks(){return this.$store.state.nanobanana?.tasks},walletMode(){return W()&&K(`nanobanana`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){t===void 0||e===t||(this.$store.commit(`nanobanana/setTasks`,void 0),await this.onGetTasks(),await this.onScrollDown())}},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.onPollTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ee({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(`nanobanana/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`nanobanana/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}let{limit:t=20,createdAtMin:n,createdAtMax:r}=e||{};await this.$store.dispatch(`nanobanana/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})},async onGenerate(){if(ie()&&!Y())return;if(!B(this.config?.prompt)){E.error(this.$t(`common.message.promptRequired`));return}if(!de(this.uploadTracker,e=>this.$t(e),e=>E.warning(e)))return;let e=Q(this.config),t;if(this.walletMode){let n=this.getWalletContext();if(!n){E.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}t=J.generate(e,{mode:`x402`,x402:{wallet:n,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!Y())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}t=J.generate(e,{token:n})}E.info(this.$t(`nanobanana.message.startingTask`)),ge(`nanobanana`,t).then(e=>{let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),E.success(this.$t(`nanobanana.message.startTaskSuccess`))}).catch(e=>{if(e instanceof _e)return;let t=e?.response?.data;le(e,`nanobanana`)||(this.walletMode?E.error(this.$t(`common.x402Scenario.paymentFailed`)):E.error(this.$t(`nanobanana.message.startTaskFailed`)+(t?.error?.message||``)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return me(this.$wallet)},async confirmWalletPayment(e){return X.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function fn(e,t,n,r,i,o){let s=u(`config-panel`),c=u(`recent-panel`),l=u(`showcase-result-tabs`),d=u(`layout`);return _(),p(d,null,{config:m(()=>[a(s,{"identity-token":e.credential?.token,onGenerate:e.onGenerate},null,8,[`identity-token`,`onGenerate`])]),result:m(()=>[a(l,{service:`nano-banana`},{tasks:m(()=>[a(c,{ref:`recentPanel`,loading:e.loading,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})]),_:1})}var pn=U(dn,[[`render`,fn]]);export{pn as default};
|
|
@@ -1 +0,0 @@
|
|
|
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-GALwUZll.js";import{n as x,t as S}from"./tabs-8Um-YKWZ.js";import{t as C}from"./upload-Sju4DbiY.js";import{t as w}from"./tooltip-4w7ghPQM.js";import{t as T}from"./alert-BprQRUmf.js";import{_ as E,v as D}from"./vuex.esm-bundler-BV9tXD4i.js";import{n as O,r as k}from"./radio-BNhFzeBO.js";import{t as A}from"./drawer-APcI0MuL.js";import{t as j}from"./input-number-CQyq1gfs.js";import{t as M}from"./slider-C8pY6U4o.js";import{t as N}from"./switch-4nC3Yz4b.js";import{t as P}from"./clock-BooSG6zB.js";import{t as ee}from"./hash-GTQkcsQj.js";import{t as te}from"./headphones-B8VUrUji.js";import{t as ne}from"./info-PmX6OJ8X.js";import{t as re}from"./lightbulb-rCoLSMOl.js";import{a as F,i as ie,n as ae,r as oe,t as se}from"./pagination-W-HQ78h5.js";import{t as ce}from"./trash-2-BkEkcSHv.js";import{t as le}from"./triangle-alert-DBmpuUlm.js";import{t as I}from"./upload-DidTvyIg.js";import{t as L}from"./wand-sparkles-CwgjO5Gl.js";import{Ai as ue,Fi as R,Ni as de,Pi as fe}from"./constants-GmVIn7tC.js";import{D as z,Fa as pe,Fr as B,Ii as me,La as he,Mi as ge,Na as V,Nr as _e,Pi as H,Pr as U,Qa as W,T as ve,Tn as G,at as K,ct as q,it as ye,lt as J,nt as be,oi as xe,oo as Se,ot as Y,qi as Ce,ri as we,rt as Te,st as Ee,ta as De,tt as Oe,za as X}from"./index-Dr2ooWnm.js";import{t as ke}from"./CopyToClipboard-CQT78wob.js";import{t as Ae}from"./ReportButton-B6G5OWJ0.js";import{t as je}from"./FilePreview-D640d7Cq.js";import{t as Z}from"./ImagePreview-YXx0To-U.js";import{n as Me}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Ne}from"./ServicePricingSummary-rLPlqY7R.js";import{t as Pe}from"./AudioPreview-DbtJFAs7.js";import{t as Fe}from"./VideoPlayer-DuUSbT-p.js";import{t as Ie}from"./VideoPreview-DiHzfmhx.js";import{t as Le}from"./ScenarioPaymentMode-DRMdqOm9.js";import{t as Re}from"./ApiCodeButton-DSt2Pz0O.js";import{t as ze}from"./BotPlaceholder-BC8u-j84.js";import{t as Be}from"./taskPollingMixin-CcLxtz8z.js";import{t as Ve}from"./ShowcaseResultTabs-CS9fv2h_.js";import{t as He}from"./showcaseRecreateMixin-Dhdr3T0y.js";import{n as Ue,t as We}from"./generationInput--J_4Niw5.js";var Ge=v({name:`LayoutKling`,components:{MagicIcon:L,ElDrawer:A,ElButton:W},mixins:[Me]}),Ke={class:`main flex flex-row flex-1 min-h-0`},qe={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)]`},Je={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ye(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Ke,[e(`div`,qe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Je,[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 Xe=z(Ge,[[`render`,Ye],[`__scopeId`,`data-v-f4b791b5`]]),Ze={text2video:!0,image2video:!0,endImage:!1,audio:!1,motionControl:!1,referenceVideo:!1,referenceImages:!1};function Q(e,t,n){let r=t||`std`,i=n??5;switch(e){case`kling-v3-turbo`:return{...Ze,audio:!0};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 Ze}}var $=`<<<video_1>>>`,Qe=/<<<image_\d+>>>/g;function $e(e){return e?e.split($).join(` `).replace(/\s{2,}/g,` `).trim():``}function et(e){return e?e.replace(Qe,` `).replace(/\s{2,}/g,` `).trim():``}function tt(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=Q(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=[`kling-o1`,`kling-v3-omni`,`kling-v3-turbo`].includes(n)||!!(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 nt(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=$e(n.prompt)),e.field===`image_list`&&(n.image_list=void 0,n.prompt=et(n.prompt));return n}var rt=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-turbo`,label:`v3-Turbo`},{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(ue)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=tt(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await X.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=nt({...t,model:e},n);this.$store.commit(`kling/setConfig`,i),D.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})}}}),it={class:`field`},at={class:`title font-bold`};function ot(t,n,r,a,o,u){let d=l(`el-option`),m=l(`el-select`);return g(),s(`div`,it,[e(`h2`,at,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 st=z(rt,[[`render`,ot],[`__scopeId`,`data-v-d3faca05`]]),ct=v({name:`ModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:F},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 R.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=tt(t,{mode:e});if(n.length===0){this.applyMode(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await X.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=nt({...t,mode:e},n);this.$store.commit(`kling/setConfig`,i),D.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})}}}),lt={class:`field`},ut={class:`header`},dt={class:`title font-bold`},ft={key:0,class:`opt-tip`};function pt(t,r,u,d,m,_){let v=l(`info-icon`),y=l(`el-option`),b=l(`el-select`);return g(),s(`div`,lt,[e(`div`,ut,[e(`h2`,dt,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`,ft,i(t.disabledReason),1)):o(``,!0)]),_:2},1032,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var mt=z(ct,[[`render`,pt],[`__scopeId`,`data-v-9a8fa3c5`]]),ht=Array.from({length:13},(e,t)=>t+3),gt=[5,10],_t=[5],vt=v({name:`DurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:F},data(){return{revertKey:0}},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},isV3Model(){return this.selectedModel===`kling-v3-turbo`||R.includes(this.selectedModel)},allowedDurations(){return this.selectedModel===`kling-o1`?_t:this.isV3Model?ht:gt},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=tt(t,{duration:e});if(n.length===0){this.applyDuration(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await X.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=nt({...t,duration:e},n);this.$store.commit(`kling/setConfig`,i),D.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})}}}),yt={class:`field`},bt={class:`control`},xt={class:`label`},St={class:`title font-bold`};function Ct(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,yt,[e(`div`,bt,[e(`div`,xt,[e(`h2`,St,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 wt=z(vt,[[`render`,Ct],[`__scopeId`,`data-v-9051ec82`]]),Tt=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`}}),Et={class:`text-sm font-bold mb-2 block`},Dt={class:`items`},Ot=[`onClick`],kt={class:`name`};function At(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,Et,i(t.$t(`kling.name.ratio`)),1),e(`div`,Dt,[(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`,kt,i(r.label),1)],10,Ot))),128))])])}var jt=z(Tt,[[`render`,At],[`__scopeId`,`data-v-cdb14b2f`]]),Mt=v({name:`StartImage`,components:{UploadIcon:I,ElUpload:C,ElButton:W,ElTooltip:w,InfoIcon:F,ImagePreview:Z},mixins:[J,q,Y],emits:[`change`],data(){return{fileList:[],uploadUrl:V()+`/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(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.error(this.$t(`kling.message.uploadReferencesError`))},onBeforeUpload(){let e=this.$store.state.kling?.config||{};if(e.video_list?.[0]?.refer_type===`base`)return D.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?(D.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()}}}),Nt={class:`relative`},Pt={class:`flex min-h-8 items-center pr-20`},Ft={class:`flex justify-start items-center`},It={class:`text-sm font-bold`};function Lt(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`,Nt,[e(`div`,Pt,[e(`div`,Ft,[e(`span`,It,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 Rt=z(Mt,[[`render`,Lt],[`__scopeId`,`data-v-60844ac3`]]),zt=v({name:`EndImage`,components:{UploadIcon:I,ElUpload:C,ElButton:W,ElTooltip:w,ImagePreview:Z,InfoIcon:F},mixins:[J,q,Y],data(){return{fileList:[],uploadUrl:V()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},reachedLimit(){return(this.fileList?.length||0)>=1},klingConfig(){return this.$store.state?.kling?.config||{}},endImageSupported(){return Q(this.klingConfig.model,this.klingConfig.mode,this.klingConfig.duration).endImage},hasStartImage(){return!!this.klingConfig.start_image_url},uploadDisabled(){return this.reachedLimit||!this.endImageSupported||!this.hasStartImage},uploadTooltip(){return this.endImageSupported?this.hasStartImage?this.reachedLimit?this.$t(`kling.message.uploadReferencesExceed`):``:this.$t(`kling.message.endImageRequiresStart`):this.$t(`kling.message.endImageNotSupported`)},storeValue(){return this.klingConfig.end_image_url},value:{get(){return this.storeValue},set(){}}},watch:{storeValue(e){!e&&this.fileList.length>0&&(this.fileList=[])},hasStartImage(e){!e&&this.storeValue&&(this.fileList=[],this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,end_image_url:void 0}))}},mounted(){this.value||=void 0,this.onSetEndImageUrl()},methods:{onBeforeUpload(){if(!this.endImageSupported)return D.warning(this.$t(`kling.message.endImageNotSupported`)),!1;if(!this.hasStartImage)return D.warning(this.$t(`kling.message.endImageRequiresStart`)),!1;if(this.klingConfig.video_list?.[0]?.refer_type===`base`)return D.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?(D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:e})),!1):!0},onExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.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`},Vt={class:`flex min-h-8 items-center pr-20`},Ht={class:`flex justify-start items-center`},Ut={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`,Vt,[e(`div`,Ht,[e(`span`,Ut,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 Gt=z(zt,[[`render`,Wt],[`__scopeId`,`data-v-b286c4d0`]]),Kt=v({name:`ReferenceVideo`,components:{ElUpload:C,ElButton:W,ElRadioButton:O,ElRadioGroup:k,ElSwitch:N,InfoIcon:F,FilePreview:je,UploadIcon:I},mixins:[q,Y],data(){return{fileList:[],uploadUrl:V()+`/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(){D.warning(this.$t(`kling.message.referenceVideoExceed`))},onError(){D.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 D.error(this.$t(`kling.message.referenceVideoImageLimit`)),!1;let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=ye(e.size);return t?n?!0:(D.error(this.$t(`kling.message.referenceVideoSizeExceed`,{max:Te(be)})),!1):(D.error(this.$t(`kling.message.referenceVideoTypeFailed`)),!1)},ensurePromptToken(e){let t=this.$store.state.kling?.config,n=t?.prompt||``,r=n.includes($),i;if(e&&!r)i=n?`${n} ${$}`:$;else if(!e&&r)i=$e(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()}}}),qt={class:`relative`},Jt={class:`flex min-h-8 items-center pr-20`},Yt={class:`flex justify-start items-center`},Xt={class:`text-sm font-bold`},Zt={key:0,class:`reference-options mt-3 flex flex-col gap-3`},Qt={class:`flex flex-col items-stretch gap-2 sm:flex-row sm:items-center sm:justify-between`},$t={class:`text-sm`},en={class:`flex items-center justify-between gap-3`},tn={class:`text-sm`};function nn(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`,qt,[e(`div`,Jt,[e(`div`,Yt,[e(`span`,Xt,i(t.$t(`kling.name.referenceVideo`)),1),a(h,{content:t.$t(`kling.description.omniReferenceVideo`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"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`,Zt,[e(`div`,Qt,[e(`span`,$t,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`,en,[e(`span`,tn,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 rn=z(Kt,[[`render`,nn],[`__scopeId`,`data-v-e3a9dfab`]]),an=v({name:`KlingReferenceImages`,components:{ElButton:W,ElUpload:C,UploadIcon:I,ImagePreview:Z,InfoIcon:F},mixins:[J,q,Y],data(){return{fileList:[],uploadUrl:V()+`/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(){D.warning(this.$t(`kling.message.referenceImagesExceed`,{count:this.remainingSlots}))},onError(){D.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=[et(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()}}}),on={class:`relative`},sn={class:`flex justify-between items-center`},cn={class:`flex justify-start items-center`},ln={class:`text-sm font-bold`},un={key:0,class:`file-list flex flex-wrap gap-2 mt-2`};function dn(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`,on,[e(`div`,sn,[e(`div`,cn,[e(`span`,ln,i(t.$t(`kling.name.referenceImages`)),1),a(v,{content:t.$t(`kling.description.referenceImages`)},null,8,[`content`])]),a(x,{ref:`uploader`,"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`,un,[(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 fn=z(an,[[`render`,dn]]),pn=v({name:`CfgScaleSelector`,components:{ElSlider:M,InfoIcon:F,ElInputNumber:j},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}}),mn={class:`flex justify-between`},hn={class:`flex justify-start items-center`},gn={class:`text-sm font-bold`},_n={class:`flex justify-end items-center`},vn={class:`w-full`};function yn(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`,mn,[e(`div`,hn,[e(`span`,gn,i(t.$t(`kling.name.cfgScale`)),1),a(d,{content:t.$t(`kling.description.cfgScale`)},null,8,[`content`])]),e(`div`,_n,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,vn,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:0,max:1,step:.1},null,8,[`modelValue`])])])}var bn=z(pn,[[`render`,yn]]),xn=v({name:`GenerateAudioSelector`,components:{ElSwitch:N,InfoIcon:F},computed:{selectedModel(){return this.$store.state.kling?.config?.model||``},selectedMode(){return this.$store.state.kling?.config?.mode||``},fixedAudio(){return this.selectedModel===`kling-v3-turbo`},supported(){return!!(this.fixedAudio||R.includes(this.selectedModel)||this.selectedModel===`kling-v2-6`&&this.selectedMode===`pro`)},tooltipContent(){return this.fixedAudio?this.$t(`kling.description.generateAudioIncluded`):this.supported?this.$t(`kling.description.generateAudio`):this.$t(`kling.description.generateAudioUnsupported`)},value:{get(){return this.fixedAudio?!0: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})}}}),Sn={class:`relative`},Cn={class:`flex justify-between items-center`},wn={class:`flex justify-start items-center`},Tn={class:`text-sm font-bold`};function En(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Sn,[e(`div`,Cn,[e(`div`,wn,[e(`span`,Tn,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||t.fixedAudio},null,8,[`modelValue`,`disabled`])])])}var Dn=z(xn,[[`render`,En]]),On=[`horizontal`,`vertical`,`pan`,`tilt`,`roll`,`zoom`],kn=v({name:`CameraControlSelector`,components:{ElSelect:y,ElOption:b,ElSlider:M,ElInputNumber:j,InfoIcon:F},data(){return{configKeys:On}},computed:{typeOptions(){return[{value:``,label:this.$t(`kling.name.cameraTypeNone`)},{value:`simple`,label:this.$t(`kling.name.cameraTypeSimple`)},{value:`down_back`,label:this.$t(`kling.name.cameraTypeDownBack`)},{value:`forward_up`,label:this.$t(`kling.name.cameraTypeForwardUp`)},{value:`left_turn_forward`,label:this.$t(`kling.name.cameraTypeLeftTurnForward`)},{value:`right_turn_forward`,label:this.$t(`kling.name.cameraTypeRightTurnForward`)}]},selectedMode(){return this.$store.state.kling?.config?.mode||``},selectedModel(){return this.$store.state.kling?.config?.model||``},selectedDuration(){return this.$store.state.kling?.config?.duration},motionControlSupported(){return Q(this.selectedModel,this.selectedMode,this.selectedDuration).motionControl},hasStartImage(){return!!this.$store.state.kling?.config?.start_image_url},disabled(){return!this.motionControlSupported||this.hasStartImage},tooltipContent(){return this.motionControlSupported?this.hasStartImage?this.$t(`kling.description.cameraControlDisabledImage2Video`):this.$t(`kling.description.cameraControl`):this.$t(`kling.description.cameraControlNotSupported`)},selectedType(){return this.$store.state.kling?.config?.camera_control?.type},selectedTypeRaw:{get(){return this.selectedType??``},set(e){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)}}}),An={class:`field`},jn={class:`header`},Mn={class:`text-sm font-bold`},Nn={key:0,class:`config-grid`},Pn={class:`cfg-row-head`},Fn={class:`cfg-name`};function In(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`,An,[e(`div`,jn,[e(`span`,Mn,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`,Nn,[(g(!0),s(c,null,h(t.configKeys,n=>(g(),s(`div`,{key:n,class:`cfg-row`},[e(`div`,Pn,[e(`span`,Fn,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 Ln=z(kn,[[`render`,In],[`__scopeId`,`data-v-cd896060`]]),Rn=[{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`]}],zn=`, `;function Bn(e,t){let n=(e||``).trim();return n?n.includes(t)?n:`${n}${zn}${t}`:t}function Vn(e,t){if(!e||!t)return e||``;let n=[`${t}${zn}`,`${zn}${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 Hn=v({name:`InspirationPills`,components:{CloseIcon:he},computed:{prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return Rn.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=Vn(this.prompt,e);this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:t})}}}),Un={key:0,class:`pills`,role:`list`},Wn={class:`pill-text`},Gn=[`aria-label`,`title`,`onClick`];function Kn(n,r,u,d,f,p){let m=l(`close-icon`);return n.selected.length>0?(g(),s(`div`,Un,[(g(!0),s(c,null,h(n.selected,r=>(g(),s(`div`,{key:r,class:`pill`,role:`listitem`},[e(`span`,Wn,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,Gn)]))),128))])):o(``,!0)}var qn=v({name:`PromptInput`,components:{IdeaIcon:re,ElButton:W,PromptTextarea:ie,InspirationPills:z(Hn,[[`render`,Kn],[`__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 Jn(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 Yn=z(qn,[[`render`,Jn],[`__scopeId`,`data-v-5754ae54`]]),Xn=v({name:`NegativePromptInput`,components:{ElInput:Se,InfoIcon:F},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||=``}}),Zn={class:`field`},Qn={class:`box`},$n={class:`title font-bold`};function er(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,Zn,[e(`div`,Qn,[e(`h2`,$n,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 tr=z(Xn,[[`render`,er],[`__scopeId`,`data-v-de98cf01`]]),nr=v({name:`InspirationDrawer`,components:{Close:he,IdeaIcon:re,ElDrawer:A,ElButton:W},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`],data(){return{groups:Rn}},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(Vn(this.prompt,e)):this.setPrompt(Bn(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(let t of this.allChipTexts)for(;e.includes(t);)e=Vn(e,t);this.setPrompt(e)}}}),rr={class:`drawer-content`},ir={class:`drawer-header`},ar={class:`title-row`},or={class:`title`},sr={class:`hint`},cr={key:0,class:`selected-bar`},lr={class:`selected-text`},ur={class:`groups`},dr={class:`group-title`},fr={class:`chip-grid`},pr=[`onClick`];function mr(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`,rr,[e(`div`,ir,[e(`div`,ar,[a(y,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,or,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`,sr,i(t.$t(`kling.inspiration.hint`)),1),t.selectedCount>0?(g(),s(`div`,cr,[e(`span`,lr,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`,ur,[(g(!0),s(c,null,h(t.groups,r=>(g(),s(`div`,{key:r.groupKey,class:`group`},[e(`div`,dr,i(t.$t(`kling.inspiration.group.${r.groupKey}`)),1),e(`div`,fr,[(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,pr))),128))])]))),128))])])]),_:1},8,[`modelValue`,`size`])}var hr=z(nr,[[`render`,mr],[`__scopeId`,`data-v-8b2e6a5d`]]),gr={"kling-v3":`v3`,"kling-v3-turbo":`v3-Turbo`,"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`},_r={std:`720p`,pro:`1080p`,"4k":`4K`},vr=v({name:`SummaryChip`,components:{AudioIcon:te},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){let e=this.config?.model||`kling-v2-5-turbo`;return gr[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||``},modeLabel(){let e=this.config?.mode||`std`;return _r[e]||e},generateAudio(){return this.config?.model===`kling-v3-turbo`||!!this.config?.generate_audio}}}),yr={class:`summary-chip`},br=[`title`],xr=[`title`],Sr=[`title`],Cr=[`title`],wr=[`title`];function Tr(t,n,r,c,u,d){let f=l(`audio-icon`);return g(),s(`div`,yr,[e(`span`,{class:`part`,title:t.$t(`kling.name.model`)},i(t.modelLabel),9,br),n[0]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.duration`)},i(t.durationLabel),9,xr),n[1]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.ratio`)},i(t.aspectRatio||`16:9`),9,Sr),n[2]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.mode`)},i(t.modeLabel),9,Cr),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,wr)):o(``,!0)])}var Er=v({name:`ConfigPanel`,components:{MagicIcon:L,ElButton:W,ServicePricingSummary:Ne,PromptInput:Yn,NegativePromptInput:tr,ModelSelector:st,ModeSelector:mt,DurationSelector:wt,RatioSelector:jt,StartImage:Rt,CfgScaleSelector:bn,GenerateAudioSelector:Dn,CameraControlSelector:Ln,InspirationDrawer:hr,SummaryChip:z(vr,[[`render`,Tr],[`__scopeId`,`data-v-f59e4d1f`]]),EndImage:Gt,ReferenceImages:fn,ReferenceVideo:rn,ScenarioPaymentMode:Le},emits:[`generate`],data(){return{inspirationOpen:!1,quoteTimer:0,quoteRunId:0}},computed:{canGenerate(){return We(`kling`,U(this.config))},config(){return this.$store.state.kling?.config},capabilities(){return Q(this.config?.model,this.config?.mode,this.config?.duration)},restrictedControls(){return[`kling-o1`,`kling-v3-omni`,`kling-v3-turbo`].includes(this.config?.model||``)||!!(this.config?.image_list?.length||this.config?.video_list?.length)},consumption(){return G(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service},walletMode(){return ge()&&H(`kling`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=H(`kling`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,350))},async refreshQuote(){if(!this.canGenerate)return;let e=H(`kling`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await B.quote(U(this.config));t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)}}}),Dr={class:`flex flex-col h-full`},Or={class:`flex-1 overflow-y-auto p-5`},kr={class:`flex flex-col items-center justify-center px-5 pb-5`};function Ar(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(`scenario-payment-mode`),j=l(`service-pricing-summary`),M=l(`magic-icon`),N=l(`el-button`),P=l(`inspiration-drawer`);return g(),s(`div`,Dr,[e(`div`,Or,[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`}),t.config?.model===`kling-v3-turbo`?o(``,!0):(g(),f(S,{key:2,class:`mb-4`})),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`}),t.restrictedControls?o(``,!0):(g(),f(E,{key:3,class:`mb-4`})),t.restrictedControls?o(``,!0):(g(),f(D,{key:4,class:`mb-4`})),t.restrictedControls?o(``,!0):(g(),f(O,{key:5,class:`mb-4`}))]),e(`div`,kr,[a(k),a(A,{scenario:`kling`}),t.walletMode?o(``,!0):(g(),f(j,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),t.config?.video_url!==void 0||t.config?.custom?(g(),f(N,{key:1,type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(M,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.extend`)),1)]),_:1},8,[`disabled`,`onClick`])):(g(),f(N,{key:2,type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(M,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`]))]),a(P,{modelValue:t.inspirationOpen,"onUpdate:modelValue":n[1]||=e=>t.inspirationOpen=e},null,8,[`modelValue`])])}var jr=z(Er,[[`render`,Ar]]),Mr=v({name:`MotionImage`,components:{UploadIcon:I,ElUpload:C,ElButton:W,InfoIcon:F,ImagePreview:Z},mixins:[J,q,Y,Oe],data(){return{fileList:[],uploadUrl:V()+`/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(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onError(){D.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()}}}),Nr={class:`relative`},Pr={class:`flex justify-between`},Fr={class:`flex justify-start items-center`},Ir={class:`text-sm font-bold`};function Lr(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`,Nr,[e(`div`,Pr,[e(`div`,Fr,[e(`span`,Ir,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,"before-upload":t.beforeUploadSizeGuard,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`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Rr=z(Mr,[[`render`,Lr],[`__scopeId`,`data-v-4a95ef2c`]]),zr=v({name:`MotionVideo`,components:{UploadIcon:I,ElUpload:C,ElButton:W,InfoIcon:F,FilePreview:je},mixins:[q,Y],data(){return{fileList:[],uploadUrl:V()+`/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(){D.warning(this.$t(`kling.message.uploadVideoExceed`))},onError(){D.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:(D.error(this.$t(`kling.message.uploadVideoSizeExceed`)),!1):(D.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()}}}),Br={class:`relative`},Vr={class:`flex justify-between`},Hr={class:`flex justify-start items-center`},Ur={class:`text-sm font-bold`};function Wr(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`,Br,[e(`div`,Vr,[e(`div`,Hr,[e(`span`,Ur,i(t.$t(`kling.name.motionVideo`)),1),a(h,{content:t.$t(`kling.description.motionVideo`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"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 Gr=z(zr,[[`render`,Wr],[`__scopeId`,`data-v-630c4521`]]),Kr=v({name:`MotionPromptInput`,components:{ElInput:Se,InfoIcon:F},computed:{prompt:{get(){return this.$store.state.kling?.motionConfig?.prompt||``},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,prompt:e})}}}}),qr={class:`field`},Jr={class:`box`},Yr={class:`title font-bold`};function Xr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,qr,[e(`div`,Jr,[e(`h2`,Yr,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 Zr=z(Kr,[[`render`,Xr],[`__scopeId`,`data-v-ca9fdbe5`]]),Qr=`video`,$r=v({name:`CharacterOrientationSelector`,components:{ElRadioGroup:k,ElRadioButton:O,InfoIcon:F},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||Qr},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=Qr)}}),ei={class:`field`},ti={class:`header`},ni={class:`text-sm font-bold`};function ri(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`,ei,[e(`div`,ti,[e(`span`,ni,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 ii=z($r,[[`render`,ri],[`__scopeId`,`data-v-7a91195b`]]),ai=`kling-v2-6`,oi=v({name:`MotionModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:F},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||ai},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=ai)}}),si={class:`field`},ci={class:`header`},li={class:`title font-bold`};function ui(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,si,[e(`div`,ci,[e(`h2`,li,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 di=z(oi,[[`render`,ui],[`__scopeId`,`data-v-480e8da2`]]),fi=`std`,pi=v({name:`MotionModeSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:F},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||fi},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=fi)}}),mi={class:`field`},hi={class:`header`},gi={class:`title font-bold`};function _i(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,mi,[e(`div`,hi,[e(`h2`,gi,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 vi=z(pi,[[`render`,_i],[`__scopeId`,`data-v-1295688c`]]),yi=v({name:`KeepOriginalSoundSelector`,components:{ElSwitch:N,InfoIcon:F},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`})}}}}),bi={class:`relative`},xi={class:`flex justify-between items-center`},Si={class:`flex justify-start items-center`},Ci={class:`text-sm font-bold`};function wi(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,bi,[e(`div`,xi,[e(`div`,Si,[e(`span`,Ci,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 Ti=v({name:`MotionPanel`,components:{MagicIcon:L,ElButton:W,ServicePricingSummary:Ne,MotionImage:Rr,MotionVideo:Gr,MotionPromptInput:Zr,CharacterOrientationSelector:ii,MotionModelSelector:di,MotionModeSelector:vi,KeepOriginalSoundSelector:z(yi,[[`render`,wi]])},emits:[`generate`],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return G({...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`)}}}),Ei={class:`flex flex-col h-full`},Di={class:`flex-1 overflow-y-auto p-5`},Oi={class:`flex flex-col items-center justify-center px-5 pb-5`};function ki(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(`service-pricing-summary`),S=l(`magic-icon`),C=l(`el-button`);return g(),s(`div`,Ei,[e(`div`,Di,[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`,Oi,[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 Ai=z(Ti,[[`render`,ki]]),ji=v({name:`KlingTabSwitcher`,components:{MetaTag:pe,ElTabs:x,ElTabPane:S},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)}}}),Mi=[`title`],Ni={class:`text`};function Pi(t,n,a,u,d,m){let _=l(`meta-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`,"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`,Ni,i(t.label),1),t.badge?(g(),f(_,{key:0,tone:`warning`,class:`badge`,density:`compact`},{default:p(()=>[r(i(t.badge),1)]),_:2},1024)):o(``,!0)],8,Mi)]),_:2},1032,[`name`,`disabled`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var Fi=z(ji,[[`render`,Pi],[`__scopeId`,`data-v-24ca66ec`]]),Ii={"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`},Li=v({name:`TalkingPhotoModelSelector`,components:{ElSelect:y,ElOption:b},data(){return{options:fe.map(e=>({value:e,label:Ii[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=de)}}),Ri={class:`field`},zi={class:`title font-bold`};function Bi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Ri,[e(`h2`,zi,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 Vi=z(Li,[[`render`,Bi],[`__scopeId`,`data-v-cbc83d11`]]),Hi=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`)}}),Ui={class:`field`},Wi={class:`title font-bold`};function Gi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Ui,[e(`h2`,Wi,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 Ki=v({name:`TalkingPhotoPanel`,components:{MagicIcon:L,UploadIcon:I,ElUpload:C,ElButton:W,ElInput:Se,ServicePricingSummary:Ne,InfoIcon:F,ImagePreview:Z,ModelSelector:Vi,ModeSelector:z(Hi,[[`render`,Gi],[`__scopeId`,`data-v-92525a1d`]]),ScenarioPaymentMode:Le},mixins:[Y,Oe],emits:[`generate`],data(){return{imageFiles:[],audioFiles:[],uploadUrl:V()+`/api/v1/files/`,quoteTimer:0,quoteRunId:0}},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 G({...this.config,action:`talking-photo`},this.service?.cost)},canGenerate(){return!!(this.config.image_url&&this.config.audio_url)},walletMode(){return ge()&&H(`kling`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteTimer=window.setTimeout(this.refreshQuote,350)},async refreshQuote(){let e=H(`kling`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await B.quoteTalkingPhoto(_e(this.config));t===this.quoteRunId&&e.mode===`wallet`&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},commit(e){this.$store.commit(`kling/setTalkingPhotoConfig`,{...this.config,...e})},onPromptChange(e){this.commit({prompt:e})},onImageExceed(){D.warning(this.$t(`kling.message.uploadReferencesExceed`))},onImageError(){D.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(){D.warning(this.$t(`kling.message.uploadAudioExceed`))},onAudioError(){D.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`)}}}),qi={class:`flex flex-col h-full`},Ji={class:`flex-1 overflow-y-auto p-5`},Yi={class:`relative mb-4`},Xi={class:`flex justify-start items-center`},Zi={class:`text-sm font-bold`},Qi={class:`relative mb-4`},$i={class:`flex justify-start items-center`},ea={class:`text-sm font-bold`},ta=[`src`],na={class:`mb-4`},ra={class:`flex justify-start items-center`},ia={class:`text-sm font-bold`},aa={class:`flex flex-col items-center justify-center px-5 pb-5`};function oa(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(`scenario-payment-mode`),T=l(`service-pricing-summary`),E=l(`magic-icon`);return g(),s(`div`,qi,[e(`div`,Ji,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),e(`div`,Yi,[e(`div`,Xi,[e(`span`,Zi,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,"before-upload":t.beforeUploadSizeGuard,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`,`before-upload`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`])]),e(`div`,Qi,[e(`div`,$i,[e(`span`,ea,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,"before-upload":t.beforeUploadSizeGuard,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`,`before-upload`,`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,ta)):o(``,!0)]),e(`div`,na,[e(`div`,ra,[e(`span`,ia,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`,aa,[a(w,{scenario:`kling`}),t.walletMode?o(``,!0):(g(),f(T,{key:0,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(E,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`kling.button.generateTalkingPhoto`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var sa=z(Ki,[[`render`,oa],[`__scopeId`,`data-v-46191f92`]]),ca=v({name:`TaskPreview`,components:{DeleteIcon:ce,ChannelIcon:ee,InfoIcon:ne,MagicIcon:L,TimeIcon:P,WarningIcon:le,CopyToClipboard:ke,ElAlert:T,VideoPlayer:Fe,ElTooltip:w,ElButton:W,ImagePreview:Z,VideoPreview:Ie,AudioPreview:Pe,ApiCodeButton:Re,ReportButton:Ae},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},displayText(){return this.modelValue?.request?.prompt?.trim()||this.modelValue?.request?.text?.trim()||``},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:{async onDelete(){let e=this.modelValue?.id;if(e){try{await X.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`kling/deleteTask`,{id:e}),D.success(this.$t(`common.message.deleteTaskSuccess`))}catch{D.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),la={class:`preview`},ua={class:`left`},da={class:`main`},fa={class:`bot`},pa={class:`datetime`},ma=[`aria-label`],ha={key:0,class:`info`},ga={key:0,class:`request-media flex justify-start items-center gap-2 w-full overflow-x-auto`},_a={key:1,class:`prompt`},va={key:0},ya={key:1},ba={key:1,class:n({content:!0,failed:!0})},xa={key:0,class:`mb-4`},Sa={key:1,class:n({operations:!0,"mt-2":!0})},Ca={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ta={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Ea={key:2,class:n({content:!0})},Da={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Oa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ka={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Aa={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ja={key:3,class:n({content:!0})},Ma={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Na={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Pa(n,u,d,m,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-preview`),C=l(`video-preview`),w=l(`audio-preview`),T=l(`video-player`),E=l(`el-button`),D=l(`api-code-button`),O=l(`report-button`),k=l(`channel-icon`),A=l(`magic-icon`),j=l(`copy-to-clipboard`),M=l(`time-icon`),N=l(`el-alert`),P=l(`warning-icon`),ee=l(`info-icon`);return g(),s(`div`,la,[e(`div`,ua,[a(y,{capability:`kling`,part:`avatar`,class:`avatar`})]),e(`div`,da,[e(`div`,fa,[a(y,{capability:`kling`,part:`name`}),e(`span`,pa,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(x,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(g(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:u[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,ma)):o(``,!0)]),_:1},8,[`content`])]),n.referenceImages.length>0||n.referenceVideos.length>0||n.referenceAudios.length>0||n.displayText?(g(),s(`div`,ha,[n.referenceImages.length>0||n.referenceVideos.length>0||n.referenceAudios.length>0?(g(),s(`div`,ga,[(g(!0),s(c,null,h(n.referenceImages,(e,t)=>(g(),f(S,{key:`image-${t}`,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceVideos,(e,t)=>(g(),f(C,{key:`video-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceAudios,(e,t)=>(g(),f(w,{key:`audio-${t}`,url:e.url,name:e.name},null,8,[`url`,`name`]))),128))])):o(``,!0),n.displayText?(g(),s(`p`,_a,[r(i(n.displayText)+` `,1),n.modelValue?.response?n.isWaiting?(g(),s(`span`,ya,` - (`+i(n.$t(`kling.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,va,` - (`+i(n.$t(`kling.status.pending`))+`) `,1))])):o(``,!0)])):o(``,!0),n.modelValue?.response?.success===!0&&!n.isFailure?(g(),s(`div`,ba,[n.modelValue?.response.video_url?(g(),s(`div`,xa,[a(T,{src:n.modelValue?.response.video_url},null,8,[`src`])])):o(``,!0),n.modelValue?.response.success?(g(),s(`div`,Sa,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`kling.message.downloadVideo`),placement:`top-start`},{default:p(()=>[n.modelValue?.response.video_url?(g(),f(E,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:u[1]||=e=>n.onDownload(e,n.modelValue?.response.video_url)},{default:p(()=>[r(i(n.$t(`kling.button.download`)),1)]),_:1})):o(``,!0)]),_:1},8,[`content`]),a(D,{path:`/kling/videos`,body:n.modelValue?.request},null,8,[`body`]),a(O,{service:`kling`,"target-id":n.modelValue?.id,snapshot:{prompt:n.displayText}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(N,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,Ca,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.model`))+`: `+i(n.modelValue?.request?.model),1)]),e(`p`,wa,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,Ta,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.isFailure?(g(),s(`div`,Ea,[a(N,{closable:!1,class:`failure`},{template:p(()=>[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.failure`)),1)]),default:p(()=>[e(`p`,Da,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,Oa,[a(ee,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(j,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,ka,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Aa,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),n.isWaiting?(g(),s(`div`,ja,[a(N,{closable:!1,class:`info`},{template:p(()=>[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(n.modelValue?.response?`kling.status.processing`:`kling.status.pending`)),1)]),default:p(()=>[e(`p`,Ma,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.response?.trace_id?(g(),s(`p`,Na,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`kling.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var Fa=v({name:`RecentPanel`,components:{TaskPreview:z(ca,[[`render`,Pa],[`__scopeId`,`data-v-73637147`]]),NoTasks:oe,BotPlaceholder:ze,ScrollList:ae},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?.()}}}),Ia={key:0},La={key:2,class:`w-full h-full flex items-center justify-center`};function Ra(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`,Ia,[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`,La,[a(v)])):o(``,!0)],64)}var za=v({name:`KlingIndex`,components:{ConfigPanel:jr,MotionPanel:Ai,TalkingPhotoPanel:sa,TabSwitcher:Fi,Layout:Xe,RecentPanel:z(Fa,[[`render`,Ra]]),ShowcaseResultTabs:Ve},mixins:[Ee,He(`kling`),Be(`kling`)],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.kling?.status?.getApplications===E.Request},tasksLoading(){return this.$store.state.kling?.status?.getTasks===E.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},walletMode(){return this.taskType!==`motion`&&ge()&&H(`kling`).mode===`wallet`}},watch:{taskType:{handler(e){me(`kling`,e!==`motion`)},immediate:!0},walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`kling/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},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.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await se({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,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){let e=U(this.config),t=Ue(`kling`,e);if(t){D.error(this.$t(`common.message.${t}`));return}if(!K(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let n=Number(!!e.start_image_url)+Number(!!e.end_image_url),r=e.image_list?.length||0,i=e.video_list?.length?4:7;if(n+r>i){D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:i}));return}if(e.video_list?.[0]?.refer_type===`base`&&(e.start_image_url||e.end_image_url||e.image_list?.some(({type:e})=>e))){D.warning(this.$t(`kling.message.baseVideoFrameConflict`));return}if(!e.video_id&&!e.video_url&&!e.start_image_url&&e.end_image_url){D.warning(this.$t(`kling.message.endImageRequiresStart`));return}let a=this.createPaymentOperation(t=>B.generate(e,t));a&&(D.info(this.$t(`kling.message.startingTask`)),Ce(`kling`,a).then(e=>{this.recordWalletTask(e),D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>this.handleGenerationError(e)).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)}))},createPaymentOperation(e){if(!this.walletMode){if(!De())return;let t=this.credential?.token;return t?e({token:t}):void 0}let t=this.getWalletContext();if(!t){D.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}return e({mode:`x402`,x402:{wallet:t,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})},recordWalletTask(e){let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t)},handleGenerationError(e){e instanceof we||ve(e,`kling`)||(this.walletMode?D.error(this.$t(`common.x402Scenario.paymentFailed`)):D.error(this.$t(`kling.message.startTaskFailed`)))},getWalletContext(){return xe(this.$wallet)},async confirmWalletPayment(e){return X.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},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(!K(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let e=this.motionConfig||{};if(!e.image_url||!e.video_url){D.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(!De())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}D.info(this.$t(`kling.message.startingTask`)),Ce(`kling`,B.motion(t,{token:n})).then(()=>{D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{ve(e,`kling`)||D.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},async onGenerateTalkingPhoto(){if(!K(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let e=this.talkingPhotoConfig||{};if(!e.image_url||!e.audio_url){D.warning(this.$t(`kling.message.talkingPhotoMissingInputs`));return}let t=_e(e),n=this.createPaymentOperation(e=>B.talkingPhoto(t,e));n&&(D.info(this.$t(`kling.message.startingTask`)),Ce(`kling`,n).then(e=>{this.recordWalletTask(e),D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>this.handleGenerationError(e)).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)}))}}}),Ba={class:`flex flex-col h-full`},Va={class:`flex-1 min-h-0`};function Ha(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(`showcase-result-tabs`),y=l(`layout`);return g(),f(y,null,{config:p(()=>[e(`div`,Ba,[a(u,{"model-value":t.taskType,"onUpdate:modelValue":t.onTabChange},null,8,[`model-value`,`onUpdate:modelValue`]),e(`div`,Va,[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(v,{service:`kling`},{tasks:p(()=>[a(_,{ref:`recentPanel`,loading:t.loadingMore,onReachTop:t.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})]),_:1})}var Ua=z(za,[[`render`,Ha]]);export{Ua as default};
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,G as t,Gt as n,I as r,Jt as i,K as a,L as o,M as s,Mt as c,N as l,Q as u,S as d,T as f,Y as p,at as m,ft as h,ht as g,j as _,k as v,mt as y,p as b,qt as x,rt as S,st as C,tt as w,wt as T,x as E,z as D}from"./vendor-chart-Dw-P17PN.js";import{t as O}from"./vendor-vue-router-BVGjZC3n.js";import{n as k}from"./vuex.esm-bundler-BV9tXD4i.js";import{Fa as A,eo as j,oo as M}from"./constants-GmVIn7tC.js";import{D as N,Fn as P,M as F,Ma as I,N as L,Pn as R,Qa as z,Ra as B,cr as V,j as H}from"./index-Dr2ooWnm.js";import{t as U}from"./VueMarkdown-DX3n2_s6.js";import{c as W,l as ee,n as te,r as G,s as K,t as ne,u as re}from"./siteHome-DOZxDTUA.js";import{n as ie}from"./showcase-ClAsok_u.js";import{n as ae,t as oe}from"./ShowcaseGrid-DOcNBb0W.js";var se=B(`arrow-up-to-line`,[[`path`,{d:`M5 3h14`,key:`7usisc`}],[`path`,{d:`m18 13-6-6-6 6`,key:`1kf1n9`}],[`path`,{d:`M12 7v14`,key:`1akyts`}]]),ce={class:`section-heading`},le={id:`home-categories-title`},ue={class:`category-rows card-gap`},de=[`aria-expanded`,`aria-controls`,`onClick`],fe=[`src`,`alt`,`onError`],pe={class:`category-copy`},me=[`id`,`aria-label`],he=[`src`,`onError`],ge=N(D({__name:`CategoryTiles`,props:{items:{},heading:{},subtitle:{}},emits:[`category-image-error`,`icon-error`],setup(t,{expose:n}){let c=t,g=T(),C=T(4),E=v(()=>{let e=[];for(let t=0;t<c.items.length;t+=C.value)e.push(c.items.slice(t,t+C.value));return e});function D(){C.value=window.matchMedia?.(`(max-width: 430px)`).matches?1:window.matchMedia?.(`(max-width: 1120px)`).matches?2:4}u(()=>{D(),window.addEventListener(`resize`,D)}),p(()=>window.removeEventListener(`resize`,D));let O=new Map,k=v(()=>c.items.find(e=>e.id===g.value));function A(e,t){t instanceof HTMLButtonElement?O.set(e,t):O.delete(e)}function j(e){g.value=g.value===e?void 0:e,g.value&&a(()=>{window.matchMedia?.(`(max-width: 430px)`).matches&&O.get(e)?.scrollIntoView?.({behavior:window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches?`instant`:`smooth`,block:`start`})})}function M(){if(!g.value)return;let e=O.get(g.value);g.value=void 0,e?.focus()}return h(()=>c.items,e=>{g.value&&!e.some(e=>e.id===g.value)&&(g.value=void 0)}),n({openId:g,activeCategory:k,toggle:j,closePanel:M}),(n,a)=>{let c=m(`router-link`);return w(),l(`section`,{class:`dashboard-section`,"aria-labelledby":`home-categories-title`,onKeydown:d(M,[`esc`])},[e(`div`,ce,[e(`div`,null,[e(`span`,null,i(n.$t(`intro.home.quick.eyebrow`)),1),e(`h2`,le,i(t.heading),1)]),e(`p`,null,i(t.subtitle),1)]),e(`div`,ue,[(w(!0),l(f,null,S(E.value,(t,u)=>(w(),l(`div`,{key:u,class:`category-grid card-gap`},[(w(!0),l(f,null,S(t,t=>(w(),l(`button`,{key:t.id,ref_for:!0,ref:e=>A(t.id,e),type:`button`,class:`category-card`,"aria-expanded":g.value===t.id,"aria-controls":`home-category-panel-${t.id}`,onClick:e=>j(t.id)},[t.imageUrl?(w(),l(`img`,{key:0,src:t.imageUrl,alt:t.title,loading:`lazy`,decoding:`async`,style:x({objectPosition:t.focalPoint||`center`}),onError:e=>n.$emit(`category-image-error`,t.id)},null,44,fe)):s(``,!0),a[0]||=e(`span`,{class:`shade`},null,-1),e(`span`,pe,[e(`strong`,null,i(t.title),1),e(`span`,null,i(t.description),1),e(`b`,null,i(n.$t(g.value===t.id?`intro.home.quick.close`:`intro.home.quick.explore`))+` ↓`,1)])],8,de))),128)),o(b,{name:`panel`},{default:y(()=>[t.some(e=>e.id===g.value)&&k.value?(w(),l(`div`,{key:0,id:`home-category-panel-${k.value.id}`,class:`capability-panel`,role:`region`,"aria-label":n.$t(`intro.home.quick.panelLabel`,{category:k.value?.title})},[(w(!0),l(f,null,S(k.value?.items||[],t=>(w(),_(c,{key:t.capability,to:{name:t.routeName},class:`capability-card`},{default:y(()=>[e(`img`,{src:t.icon,alt:``,onError:e=>n.$emit(`icon-error`,t)},null,40,he),e(`span`,null,[e(`strong`,null,i(t.name),1),e(`small`,null,i(t.description),1)]),e(`b`,null,[r(i(n.$t(`intro.home.createNow`))+` `,1),a[1]||=e(`span`,{"aria-hidden":`true`},`→`,-1)])]),_:2},1032,[`to`]))),128))],8,me)):s(``,!0)]),_:2},1024)]))),128))])],32)}}}),[[`__scopeId`,`data-v-d129353a`]]),_e=[`aria-label`],ve={class:`slides`},ye=[`src`,`alt`,`loading`,`fetchpriority`,`onError`],be={key:1,class:`image-fallback`},xe=[`src`],Se={class:`copy`},Ce={key:0,class:`eyebrow`},we={key:1},Te={class:`description`},Ee={key:2,class:`action`},De=[`aria-label`],Oe=[`aria-label`],ke={class:`dots`},Ae=[`aria-label`,`aria-current`,`onClick`],je=5600,Me=45,Ne=N(D({__name:`HomeCarousel`,props:{slides:{}},emits:[`image-error`],setup(a,{expose:o}){let c=a,d=T(0),m=T(!1),g=T(!1),b=T(!1),E=T(!1),D=T(),k,A,j=v(()=>m.value||g.value||b.value||E.value||c.slides.length<2);function M(e){return e.target?`href`in e.target&&/^https?:\/\//i.test(e.target.href)?`a`:O:`div`}function N(e){return e.target?`routeName`in e.target?{to:{name:e.target.routeName}}:/^https?:\/\//i.test(e.target.href)?{href:e.target.href,target:`_blank`,rel:`noopener noreferrer`}:{to:e.target.href}:{}}function P(e){let t=c.slides.length;return t?(e+t)%t:0}function F(e){d.value=P(e)}function I(){F(d.value+1)}function L(){F(d.value-1)}function R(){k!==void 0&&window.clearInterval(k),k=void 0}function z(){R(),j.value||(k=window.setInterval(I,je))}function B(){b.value=document.hidden}function V(e){E.value=e.matches}function H(e){let t=e.currentTarget,n=e.relatedTarget;g.value=!!(n&&t.contains(n))}function U(e){D.value=e.changedTouches[0]?.clientX}function W(e){if(D.value===void 0)return;let t=e.changedTouches[0]?.clientX;if(t===void 0)return;let n=t-D.value;Math.abs(n)>=Me&&(n>0?L():I()),D.value=void 0}return h(j,z),h(()=>c.slides.length,e=>{d.value>=e&&(d.value=0),z()}),u(()=>{b.value=document.hidden,document.addEventListener(`visibilitychange`,B),A=window.matchMedia(`(prefers-reduced-motion: reduce)`),E.value=A.matches,A.addEventListener(`change`,V),z()}),p(()=>{R(),document.removeEventListener(`visibilitychange`,B),A?.removeEventListener(`change`,V)}),o({activeIndex:d,next:I,previous:L,goTo:F,hovered:m,focused:g}),(o,c)=>(w(),l(`section`,{class:`home-carousel`,"aria-label":o.$t(`intro.home.carousel.label`),onMouseenter:c[0]||=e=>m.value=!0,onMouseleave:c[1]||=e=>m.value=!1,onFocusin:c[2]||=e=>g.value=!0,onFocusout:H,onTouchstartPassive:U,onTouchendPassive:W},[e(`div`,ve,[(w(!0),l(f,null,S(a.slides,(n,a)=>(w(),_(C(M(n)),t({key:n.id},{ref_for:!0},N(n),{class:[`slide`,{active:a===d.value,static:!n.target}],"aria-hidden":a!==d.value,tabindex:a===d.value&&n.target?0:-1}),{default:y(()=>[n.imageUrl?(w(),l(`img`,{key:0,src:n.imageUrl,alt:n.title,loading:a===0?`eager`:`lazy`,decoding:`async`,fetchpriority:a===0?`high`:`auto`,style:x({objectPosition:n.focalPoint||`center`}),onError:e=>o.$emit(`image-error`,n)},null,44,ye)):(w(),l(`span`,be,[n.icon?(w(),l(`img`,{key:0,src:n.icon,alt:``},null,8,xe)):s(``,!0)])),c[4]||=e(`span`,{class:`shade`},null,-1),e(`span`,Se,[n.eyebrow?(w(),l(`span`,Ce,i(n.eyebrow),1)):s(``,!0),n.title?(w(),l(`strong`,we,i(n.title),1)):s(``,!0),e(`span`,Te,i(n.description),1),n.target?(w(),l(`span`,Ee,[r(i(o.$t(`intro.home.createNow`))+` `,1),c[3]||=e(`span`,{"aria-hidden":`true`},`→`,-1)])):s(``,!0)])]),_:2},1040,[`class`,`aria-hidden`,`tabindex`]))),128))]),a.slides.length>1?(w(),l(f,{key:0},[e(`button`,{class:`arrow previous`,type:`button`,"aria-label":o.$t(`intro.home.carousel.previous`),onClick:L},[...c[5]||=[e(`span`,{"aria-hidden":`true`},`‹`,-1)]],8,De),e(`button`,{class:`arrow next`,type:`button`,"aria-label":o.$t(`intro.home.carousel.next`),onClick:I},[...c[6]||=[e(`span`,{"aria-hidden":`true`},`›`,-1)]],8,Oe),e(`div`,ke,[(w(!0),l(f,null,S(a.slides,(e,t)=>(w(),l(`button`,{key:e.id,type:`button`,class:n({active:t===d.value}),"aria-label":o.$t(`intro.home.carousel.goto`,{number:t+1,title:e.title}),"aria-current":t===d.value?`true`:void 0,onClick:e=>F(t)},null,10,Ae))),128))])],64)):s(``,!0)],40,_e))}}),[[`__scopeId`,`data-v-d69edc68`]]),Pe=`acedatacloud:home-html-iframe-resize`,q=`acedatacloud:home-html-iframe-measure`,Fe=12e3,J=[`allow-scripts`,`allow-forms`,`allow-popups`,`allow-popups-to-escape-sandbox`,`allow-top-navigation-by-user-activation`].join(` `),Ie=new Set([`ar`]),Y=e=>{let t=e.trim().replace(`_`,`-`).slice(0,35);return/^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/.test(t)?t:`en`},X=e=>Ie.has(e.split(`-`)[0].toLowerCase())?`rtl`:`ltr`,Le=e=>JSON.stringify(e).replace(/</g,`\\u003c`).split(`\u2028`).join(`\\u2028`).split(`\u2029`).join(`\\u2029`),Re=`<script data-acedatacloud-resize>
|
|
2
|
-
(() => {
|
|
3
|
-
let pendingFrame = 0;
|
|
4
|
-
let lastHeight = -1;
|
|
5
|
-
let observed = new Set();
|
|
6
|
-
const observer = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(() => schedule());
|
|
7
|
-
const isFixed = (element) => {
|
|
8
|
-
for (let current = element; current && current !== document.body; current = current.parentElement) {
|
|
9
|
-
if (getComputedStyle(current).position === 'fixed') return true;
|
|
10
|
-
}
|
|
11
|
-
return false;
|
|
12
|
-
};
|
|
13
|
-
const measure = () => {
|
|
14
|
-
pendingFrame = 0;
|
|
15
|
-
const body = document.body;
|
|
16
|
-
if (!body) return;
|
|
17
|
-
const bodyStyle = getComputedStyle(body);
|
|
18
|
-
const bodyTop = body.getBoundingClientRect().top;
|
|
19
|
-
const paddingBottom = parseFloat(bodyStyle.paddingBottom) || 0;
|
|
20
|
-
let bottom = bodyTop + (parseFloat(bodyStyle.paddingTop) || 0) + paddingBottom;
|
|
21
|
-
const walker = document.createTreeWalker(body, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT);
|
|
22
|
-
for (let node = walker.nextNode(); node; node = walker.nextNode()) {
|
|
23
|
-
const element = node.nodeType === Node.ELEMENT_NODE ? node : node.parentElement;
|
|
24
|
-
if (!element || isFixed(element)) continue;
|
|
25
|
-
const style = getComputedStyle(element);
|
|
26
|
-
if (style.display === 'none' || style.visibility === 'hidden') continue;
|
|
27
|
-
const range = document.createRange();
|
|
28
|
-
if (node.nodeType === Node.TEXT_NODE) range.selectNodeContents(node);
|
|
29
|
-
const rect = node.nodeType === Node.TEXT_NODE ? range.getBoundingClientRect() : element.getBoundingClientRect();
|
|
30
|
-
if (!rect.width && !rect.height) continue;
|
|
31
|
-
const margin = node.nodeType === Node.ELEMENT_NODE ? Math.max(0, parseFloat(style.marginBottom) || 0) : 0;
|
|
32
|
-
bottom = Math.max(bottom, rect.bottom + margin + paddingBottom);
|
|
33
|
-
}
|
|
34
|
-
const height = Math.max(1, Math.ceil(bottom - bodyTop));
|
|
35
|
-
if (height === lastHeight) return;
|
|
36
|
-
lastHeight = height;
|
|
37
|
-
parent.postMessage({ type: '${Pe}', height }, '*');
|
|
38
|
-
};
|
|
39
|
-
const schedule = () => {
|
|
40
|
-
if (pendingFrame) cancelAnimationFrame(pendingFrame);
|
|
41
|
-
pendingFrame = requestAnimationFrame(measure);
|
|
42
|
-
};
|
|
43
|
-
const observeContent = () => {
|
|
44
|
-
if (!observer || !document.body) return;
|
|
45
|
-
const current = new Set(document.body.children);
|
|
46
|
-
for (const element of current) {
|
|
47
|
-
if (!observed.has(element)) observer.observe(element);
|
|
48
|
-
}
|
|
49
|
-
for (const element of observed) {
|
|
50
|
-
if (!current.has(element)) observer.unobserve(element);
|
|
51
|
-
}
|
|
52
|
-
observed = current;
|
|
53
|
-
};
|
|
54
|
-
const start = () => {
|
|
55
|
-
observeContent();
|
|
56
|
-
schedule();
|
|
57
|
-
setTimeout(schedule, 100);
|
|
58
|
-
setTimeout(schedule, 500);
|
|
59
|
-
new MutationObserver(() => {
|
|
60
|
-
observeContent();
|
|
61
|
-
schedule();
|
|
62
|
-
}).observe(document.body, { attributes: true, characterData: true, childList: true, subtree: true });
|
|
63
|
-
addEventListener('load', schedule, true);
|
|
64
|
-
document.fonts?.ready.then(schedule);
|
|
65
|
-
addEventListener('message', (event) => {
|
|
66
|
-
if (event.source === parent && event.data?.type === '${q}') schedule();
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
if (document.readyState === 'loading') addEventListener('DOMContentLoaded', start, { once: true });
|
|
70
|
-
else start();
|
|
71
|
-
})();
|
|
72
|
-
<\/script>`,ze=(e,t,n)=>`<script data-acedatacloud-context>
|
|
73
|
-
Object.defineProperty(window, '__ACEDATACLOUD__', {
|
|
74
|
-
value: Object.freeze(${Le({locale:e,dir:t,theme:n})}),
|
|
75
|
-
writable: false,
|
|
76
|
-
configurable: false
|
|
77
|
-
});
|
|
78
|
-
<\/script>`,Z=(e,t,n,r)=>`<meta charset="UTF-8">
|
|
79
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
80
|
-
<base target="_top">
|
|
81
|
-
<style data-acedatacloud-frame>
|
|
82
|
-
html { color-scheme: ${n}; }
|
|
83
|
-
html, body { width: 100%; height: auto !important; min-height: 0 !important; margin: 0; overflow-x: hidden; }
|
|
84
|
-
*, *::before, *::after { box-sizing: border-box; }
|
|
85
|
-
img, video, svg, canvas, iframe { max-width: 100%; }
|
|
86
|
-
</style>
|
|
87
|
-
${ze(e,t,n)}
|
|
88
|
-
${r?Re:``}`,Q=(e,t,n)=>{let r=RegExp(`<${t}\\b[^>]*>`,`i`).exec(e);if(!r||r.index===void 0)return e;let i=r.index+r[0].length;return`${e.slice(0,i)}${n}${e.slice(i)}`},Be=(e,t,n,r)=>e.replace(/<html\b([^>]*)>/i,(e,i)=>`<html${i.replace(/\s(?:lang|dir|data-lang|data-theme)\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi,``)} lang="${t}" dir="${n}" data-lang="${t}" data-theme="${r}">`),Ve=(e,t=`en`,n=!0,r=`light`)=>{let i=Y(t),a=X(i);if(!/<html\b[^>]*>/i.test(e))return`<!DOCTYPE html><html lang="${i}" dir="${a}" data-lang="${i}" data-theme="${r}"><head>${Z(i,a,r,n)}</head><body>${e}</body></html>`;let o=Be(e,i,a,r);return/<head\b[^>]*>/i.test(o)?Q(o,`head`,Z(i,a,r,n)):Q(o,`html`,`<head>${Z(i,a,r,n)}</head>`)},He=e=>{if(!e||typeof e!=`object`)return null;let t=e;return t.type!==`acedatacloud:home-html-iframe-resize`||typeof t.height!=`number`||!Number.isFinite(t.height)?null:Math.min(Fe,Math.max(160,Math.ceil(t.height)))},Ue={class:`tenant-home-block tenant-home-html`},We=[`title`,`sandbox`,`srcdoc`],Ge=[`lang`,`dir`,`data-lang`,`data-theme`,`innerHTML`],Ke=N(D({__name:`HomeHtmlSection`,props:{section:{},locale:{},theme:{}},setup(t){let n=t,r=v(()=>Y(n.locale||`en`)),a=v(()=>X(r.value)),o=T(),s=v(()=>n.section.height??null),d=v(()=>s.value===null),f=T(s.value??160),m=v(()=>Ve(n.section.body,r.value,d.value,n.theme||`light`)),g=e=>{if(!d.value||e.source!==o.value?.contentWindow)return;let t=He(e.data);t!==null&&(f.value=t)},_=()=>{d.value&&o.value?.contentWindow?.postMessage({type:q},`*`)};return h(()=>[n.section.body,n.section.height,n.locale,n.theme],()=>{f.value=s.value??160}),u(()=>{window.addEventListener(`message`,g),_()}),p(()=>window.removeEventListener(`message`,g)),(n,s)=>(w(),l(`article`,Ue,[e(`h2`,null,i(t.section.title),1),t.section.render_in_iframe?(w(),l(`iframe`,{key:0,ref_key:`frame`,ref:o,class:`tenant-home-content tenant-home-iframe`,title:t.section.title,sandbox:c(J),srcdoc:m.value,style:x({height:`${f.value}px`}),loading:`lazy`,referrerpolicy:`strict-origin-when-cross-origin`,onLoad:_},null,44,We)):(w(),l(`div`,{key:1,class:`tenant-home-content`,lang:r.value,dir:a.value,"data-lang":r.value,"data-theme":t.theme||`light`,style:x(t.section.height==null?void 0:{height:`${t.section.height}px`,overflowY:`auto`}),innerHTML:t.section.body},null,12,Ge))]))}}),[[`__scopeId`,`data-v-ae8f8418`]]),qe={class:`tenant-home-block tenant-home-markdown`},Je=D({__name:`HomeMarkdownSection`,props:{section:{}},setup(t){return(n,r)=>(w(),l(`article`,qe,[e(`h2`,null,i(t.section.title),1),o(U,{class:`tenant-home-content`,source:t.section.body,style:x(t.section.height==null?void 0:{height:`${t.section.height}px`,overflowY:`auto`}),sanitize:``},null,8,[`source`,`style`])]))}}),Ye={class:`tenant-home-block tenant-home-website`},Xe=[`src`,`title`,`sandbox`],Ze=N(D({__name:`HomeWebsiteSection`,props:{section:{},locale:{},theme:{}},setup(t){let n=t,r=v(()=>{try{let e=new URL(n.section.body);return e.protocol!==`https:`&&e.protocol!==`http:`?``:(e.searchParams.set(`lang`,Y(n.locale||`en`)),e.searchParams.set(`theme`,n.theme||`light`),e.toString())}catch{return``}});return(n,a)=>(w(),l(`article`,Ye,[e(`h2`,null,i(t.section.title),1),r.value?(w(),l(`iframe`,{key:0,class:`tenant-home-content tenant-home-website-frame`,src:r.value,title:t.section.title,sandbox:c(J),style:x(t.section.height?{height:`${t.section.height}px`}:void 0),loading:`lazy`,referrerpolicy:`no-referrer`},null,12,Xe)):s(``,!0)]))}}),[[`__scopeId`,`data-v-c3b8cc56`]]),Qe=`profile:read credentials:read`,$e=`allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox`,et=(e,t)=>{try{if(e.kind!==`website`||!e.oauth?.client_id.trim())return null;let n=new URL(e.body),r=new URL(e.oauth.redirect_uri);return n.protocol!==`https:`||r.protocol!==`https:`||r.hash||n.username||n.password||r.username||r.password||n.origin===t||n.origin!==r.origin||!/^https:\/\//.test(t)?null:{...e.oauth,origin:n.origin}}catch{return null}},tt=e=>{if(!e||typeof e!=`object`)return null;let t=e;return t.type!==`acedatacloud:oauth:authorize`||typeof t.state!=`string`||!/^[A-Za-z0-9_-]{16,256}$/.test(t.state)||typeof t.code_challenge!=`string`||!/^[A-Za-z0-9_-]{43}$/.test(t.code_challenge)||t.code_challenge_method!==`S256`?null:{state:t.state,code_challenge:t.code_challenge,code_challenge_method:`S256`}},nt=(e,t,n,r)=>{let i=new URL(`/oauth2/authorize`,e);return i.search=new URLSearchParams({response_type:`code`,client_id:t.client_id,redirect_uri:t.redirect_uri,scope:Qe,...n,embed:`studio`,embed_origin:r}).toString(),i.toString()},rt={class:`tenant-home-block tenant-home-oauth`},it={key:0,role:`alert`},at={key:0,class:`oauth-login`},ot={class:`oauth-frame-region`},st=[`src`,`title`,`sandbox`],ct=[`src`,`title`],lt=[`href`],ut=N(D({__name:`HomeOAuthWebsiteSection`,props:{section:{},locale:{},theme:{}},setup(t){let n=t,a=k(),d=T(),m=T(),b=T(null),S=v(()=>et(n.section,window.location.origin)),C=v(()=>a.getters.token?.access),D=v(()=>a.getters.user?.id||a.state.user?.id||`guest`),O=v(()=>JSON.stringify([D.value,!!C.value,S.value,n.section.body])),A=new URL(I()).origin,j=v(()=>S.value&&b.value?nt(A,S.value,b.value,window.location.origin):``),M=v(()=>{let e=new URL(n.section.body);return e.searchParams.set(`lang`,Y(n.locale||`en`)),e.searchParams.set(`theme`,n.theme||`light`),e.toString()}),N=v(()=>({height:`${Math.max(n.section.height||640,b.value?640:160)}px`})),P,F=!1,L=e=>{S.value&&d.value?.contentWindow?.postMessage(e,S.value.origin)},R=()=>{S.value&&L({type:`acedatacloud:oauth:init`,client_id:S.value.client_id,redirect_uri:S.value.redirect_uri,scope:Qe})},B=()=>{P&&clearTimeout(P),b.value=null,F=!1},V=e=>{!b.value||!S.value||(L({type:`acedatacloud:oauth:result`,state:b.value.state,redirect_uri:S.value.redirect_uri,...e}),B())},H=()=>a.dispatch(`login`),U=e=>{let t=e.data;if(!(!S.value||!t||typeof t!=`object`)){if(e.origin===S.value.origin&&e.source===d.value?.contentWindow){if(t.type===`acedatacloud:oauth:ready`){R();return}let e=tt(t);if(!e||b.value)return;if(!C.value){L({type:`acedatacloud:oauth:result`,state:e.state,error:`login_required`});return}b.value=e,P=setTimeout(()=>V({error:`authorization_timeout`}),300*1e3);return}if(!(e.origin!==A||e.source!==m.value?.contentWindow||!b.value||t.state!==b.value.state)){if(t.type===`acedatacloud:oauth:session-ready`&&!F&&C.value)F=!0,m.value?.contentWindow?.postMessage({type:`acedatacloud:oauth:session`,state:b.value.state,access_token:C.value},A);else if(t.type===`acedatacloud:oauth:result`){if(t.redirect_uri!==S.value.redirect_uri)return;typeof t.code==`string`&&t.code?V({code:t.code}):typeof t.error==`string`&&V({error:t.error})}}}};return h(O,B),u(()=>window.addEventListener(`message`,U)),p(()=>{window.removeEventListener(`message`,U),B()}),(n,a)=>(w(),l(`article`,rt,[e(`h2`,null,i(t.section.title),1),S.value?(w(),l(f,{key:1},[C.value?s(``,!0):(w(),l(`p`,at,[o(c(z),{type:`primary`,onClick:H},{default:y(()=>[r(i(n.$t(`site.homeSections.oauth.login`)),1)]),_:1})])),e(`div`,ot,[g((w(),l(`iframe`,{key:O.value,ref_key:`appFrame`,ref:d,src:M.value,title:t.section.title,sandbox:c($e),style:x(N.value),referrerpolicy:`no-referrer`,onLoad:R},null,44,st)),[[E,!b.value]]),b.value?(w(),l(`iframe`,{key:0,ref_key:`authFrame`,ref:m,src:j.value,title:n.$t(`site.homeSections.oauth.authorization`),sandbox:`allow-scripts allow-same-origin`,style:x(N.value),referrerpolicy:`origin`},null,12,ct)):s(``,!0)]),b.value?(w(),_(c(z),{key:1,class:`oauth-cancel`,onClick:a[0]||=e=>V({error:`access_denied`})},{default:y(()=>[r(i(n.$t(`site.homeSections.oauth.cancel`)),1)]),_:1})):s(``,!0),e(`a`,{href:t.section.body,target:`_blank`,rel:`noopener noreferrer`},i(n.$t(`site.homeSections.websiteOpenExternal`,{host:S.value.origin})),9,lt)],64)):(w(),l(`p`,it,i(n.$t(`site.homeSections.oauth.invalid`)),1))]))}}),[[`__scopeId`,`data-v-8f954105`]]),dt={key:0,class:`custom-sections`},ft=D({__name:`HomeCustomSections`,props:{sections:{},site:{},locale:{}},setup(e){let t=e,n=()=>document.documentElement.classList.contains(`dark`)?`dark`:`light`,r=T(n()),i;u(()=>{r.value=n(),i=new MutationObserver(()=>{r.value=n()}),i.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]})}),p(()=>i?.disconnect());let a={markdown:Je,html:Ke,website:Ze},o=v(()=>t.sections.filter(e=>a[e.kind]));return(t,n)=>o.value.length?(w(),l(`section`,dt,[(w(!0),l(f,null,S(o.value,t=>(w(),_(C(t.kind===`website`&&t.oauth?ut:a[t.kind]),{key:t.id,section:t,locale:t.kind===`html`||t.kind===`website`?e.locale:void 0,theme:t.kind===`html`||t.kind===`website`?r.value:void 0},null,8,[`section`,`locale`,`theme`]))),128))])):s(``,!0)}}),$=12,pt=D({name:`StudioHome`,components:{ArrowUpToLine:se,CategoryTiles:ge,ShowcaseGrid:oe,ShowcaseDetailDialog:ae,HomeCarousel:Ne,HomeCustomSections:ft},data(){return{showBackToTop:!1,failedIcons:{},failedBannerImages:{},failedCategoryImages:{},rawBanners:[],bannerLoadGeneration:0,rawShowcases:[],rawHomeSections:[],homeSectionLoadGeneration:0,showcaseLoadGeneration:0,visibleShowcaseCount:$,showcaseLoadObserver:void 0,showcaseAutoLoadArmed:!0,selectedShowcase:void 0}},computed:{site(){return this.$store.state.site},siteLoaded(){return!!this.site?.id},bannerEnabled(){return G(this.site,`banner`)},categoriesEnabled(){return G(this.site,`categories`)},showcaseEnabled(){return G(this.site,`showcase`)},bannerRequestKey(){return!this.siteLoaded||!this.bannerEnabled?``:`${this.site?.id||``}|${A(this.site)}|${String(this.$i18n.locale||`en`)}`},showcaseRequestKey(){return!this.siteLoaded||!this.showcaseEnabled?``:`${this.site?.id||``}|${String(this.$i18n.locale||`en`)}`},homeSectionRequestKey(){return!this.siteLoaded||!M()?``:`${this.site?.id||``}|${A(this.site)}|${String(this.$i18n.locale||`en`)}`},enabledKeys(){if(!this.siteLoaded)return new Set;let e=this.site?.features??{};return new Set(L.filter(t=>e[t]?.enabled&&j(t)))},banners(){let e=te(this.site),t=W.filter(t=>this.enabledKeys.has(t.capability)&&!e.has(t.id)).map(e=>({...this.resolve(e),id:e.id,imageUrl:this.failedBannerImages[e.id]?``:e.imageUrl,eyebrow:this.$t(e.eyebrowKey),title:this.$t(e.titleKey),target:{routeName:e.routeName}})),n=String(this.$i18n.locale||`en`),r=this.rawBanners.map(e=>{let t=K(e.title,n);return{id:e.id||`custom-${e.sort_order||0}`,name:t,eyebrow:``,title:t,description:K(e.subtitle,n),icon:this.site?.logo||this.site?.favicon||``,defaultIcon:this.site?.logo||this.site?.favicon||``,imageUrl:this.failedBannerImages[e.id||``]?``:e.image_url||``,target:e.link_url?{href:e.link_url}:null}});return[...t,...r]},categories(){let e=[],t=ne(this.site),n=this.site?.home?.scenes;if(n!=null){for(let t of n){if(t.visible===!1)continue;let n=t.tools.flatMap(e=>{let t=ee.get(e.capability);return!t||!this.enabledKeys.has(e.capability)?[]:[this.resolve(t)]});n.length&&e.push({id:t.id,title:t.title,description:t.description,imageUrl:this.failedCategoryImages[t.id]?``:t.image_url||``,items:n})}return e}for(let n of re){if(t.has(n.id))continue;let r=n.candidates.filter(e=>this.enabledKeys.has(e.capability)).map(e=>this.resolve(e));r.length&&e.push({id:n.id,title:this.$t(n.titleKey),description:this.$t(n.descriptionKey),imageUrl:this.failedCategoryImages[n.id]?``:n.imageUrl,focalPoint:n.focalPoint,items:r})}return e},resolvedShowcases(){let e=this.site;return e?this.rawShowcases.map(t=>ie(t,e)).filter(e=>!!e).map(e=>({...e,icon:this.failedIcons[e.capability]?e.defaultIcon:e.icon})):[]},visibleShowcases(){return this.resolvedShowcases.slice(0,this.visibleShowcaseCount)},hasMoreShowcases(){return this.visibleShowcaseCount<this.resolvedShowcases.length}},watch:{bannerRequestKey:{immediate:!0,handler(e){e?this.loadBanners():(this.bannerLoadGeneration+=1,this.rawBanners=[],this.failedBannerImages={})}},homeSectionRequestKey:{immediate:!0,handler(e){e?this.loadHomeSections():(this.homeSectionLoadGeneration+=1,this.rawHomeSections=[])}},showcaseRequestKey:{immediate:!0,handler(e){e?this.loadShowcases():(this.showcaseLoadGeneration+=1,this.rawShowcases=[],this.visibleShowcaseCount=$,this.selectedShowcase=void 0)}},hasMoreShowcases(){this.$nextTick(()=>this.observeShowcaseLoadMore())}},mounted(){this.setupShowcaseLoadObserver()},beforeUnmount(){this.bannerLoadGeneration+=1,this.homeSectionLoadGeneration+=1,this.showcaseLoadGeneration+=1,this.showcaseLoadObserver?.disconnect()},methods:{onHomeScroll(e){this.showBackToTop=e.currentTarget.scrollTop>300},scrollToTop(){let e=this.$refs.homeScroll;e.focus({preventScroll:!0}),e.scrollTo({top:0,behavior:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?`instant`:`smooth`})},resolve(e){let t=F[e.capability],n=H(this.site,e.capability,e.defaultName,t);return{capability:e.capability,routeName:e.routeName,name:n.displayName,description:e.descriptionKey?this.$t(e.descriptionKey):``,icon:this.failedIcons[e.capability]?t:n.iconUrl,defaultIcon:t,imageUrl:e.imageUrl,focalPoint:e.focalPoint}},async loadBanners(){if(!this.bannerRequestKey)return;let e=this.bannerRequestKey,t=++this.bannerLoadGeneration;this.rawBanners=[];try{let n=await V.getPublic(A(this.site));t===this.bannerLoadGeneration&&e===this.bannerRequestKey&&(this.rawBanners=Array.isArray(n.data)?n.data:[])}catch{t===this.bannerLoadGeneration&&e===this.bannerRequestKey&&(this.rawBanners=[])}},async loadHomeSections(){if(!this.homeSectionRequestKey)return;let e=this.homeSectionRequestKey,t=++this.homeSectionLoadGeneration;this.rawHomeSections=[];try{let n=await R.getPublic(A(this.site),String(this.$i18n.locale||`en`));t===this.homeSectionLoadGeneration&&e===this.homeSectionRequestKey&&(this.rawHomeSections=Array.isArray(n.data)?n.data:[])}catch{t===this.homeSectionLoadGeneration&&e===this.homeSectionRequestKey&&(this.rawHomeSections=[])}},async loadShowcases(){if(!this.showcaseRequestKey)return;let e=this.showcaseRequestKey,t=++this.showcaseLoadGeneration,n=String(this.$i18n.locale||`en`);this.visibleShowcaseCount=$,this.showcaseAutoLoadArmed=!0,this.rawShowcases=[],this.selectedShowcase=void 0;try{let r=await P.list(void 0,n);t===this.showcaseLoadGeneration&&e===this.showcaseRequestKey&&(this.rawShowcases=Array.isArray(r.data)?r.data:[])}catch{t===this.showcaseLoadGeneration&&e===this.showcaseRequestKey&&(this.rawShowcases=[])}},loadMoreShowcases(){this.visibleShowcaseCount=Math.min(this.visibleShowcaseCount+$,this.resolvedShowcases.length)},onShowcaseLoadMoreClick(){this.showcaseAutoLoadArmed=!1,this.loadMoreShowcases()},setupShowcaseLoadObserver(){`IntersectionObserver`in window&&(this.showcaseLoadObserver=new IntersectionObserver(e=>{for(let t of e){if(!t.isIntersecting){this.showcaseAutoLoadArmed=!0;continue}this.showcaseAutoLoadArmed&&(this.showcaseAutoLoadArmed=!1,this.loadMoreShowcases())}},{root:this.$el,rootMargin:`400px 0px`}),this.observeShowcaseLoadMore())},observeShowcaseLoadMore(){this.showcaseLoadObserver?.disconnect();let e=this.$refs.showcaseLoadMore;e instanceof HTMLElement&&this.showcaseLoadObserver?.observe(e)},onIconError(e){e.icon!==e.defaultIcon&&(this.failedIcons[e.capability]=!0)},onShowcaseIconError(e){e.icon!==e.defaultIcon&&(this.failedIcons[e.capability]=!0)},onImageError(e){this.failedBannerImages[e.id]=!0},onCategoryImageError(e){this.failedCategoryImages[e]=!0}}}),mt={class:`dashboard`},ht=[`aria-label`,`title`],gt=[`aria-label`];function _t(t,n,r,a,c,u){let d=m(`home-carousel`),f=m(`category-tiles`),p=m(`home-custom-sections`),h=m(`showcase-grid`),g=m(`ArrowUpToLine`),v=m(`showcase-detail-dialog`);return t.siteLoaded?(w(),l(`main`,{key:0,ref:`homeScroll`,class:`studio-home`,tabindex:`-1`,onScrollPassive:n[4]||=(...e)=>t.onHomeScroll&&t.onHomeScroll(...e)},[e(`div`,mt,[t.bannerEnabled&&t.banners.length?(w(),_(d,{key:0,slides:t.banners,onImageError:t.onImageError},null,8,[`slides`,`onImageError`])):s(``,!0),t.categoriesEnabled&&t.categories.length?(w(),_(f,{key:1,items:t.categories,heading:t.$t(`intro.home.quick.title`),subtitle:t.$t(`intro.home.quick.subtitle`),onCategoryImageError:t.onCategoryImageError,onIconError:t.onIconError},null,8,[`items`,`heading`,`subtitle`,`onCategoryImageError`,`onIconError`])):s(``,!0),t.rawHomeSections.length?(w(),_(p,{key:2,sections:t.rawHomeSections,site:t.site,locale:String(t.$i18n.locale||`en`)},null,8,[`sections`,`site`,`locale`])):s(``,!0),t.showcaseEnabled&&t.visibleShowcases.length?(w(),_(h,{key:3,items:t.visibleShowcases,eyebrow:t.$t(`intro.home.showcase.eyebrow`),title:t.$t(`intro.home.showcase.title`),subtitle:t.$t(`intro.home.showcase.subtitle`),"aria-label":t.$t(`intro.home.showcase.title`),"detail-preview":``,onSelect:n[0]||=e=>t.selectedShowcase=e,onIconError:t.onShowcaseIconError},null,8,[`items`,`eyebrow`,`title`,`subtitle`,`aria-label`,`onIconError`])):s(``,!0),t.showcaseEnabled&&t.hasMoreShowcases?(w(),l(`button`,{key:4,ref:`showcaseLoadMore`,type:`button`,class:`showcase-load-more`,onClick:n[1]||=(...e)=>t.onShowcaseLoadMoreClick&&t.onShowcaseLoadMoreClick(...e)},i(t.$t(`intro.home.showcase.loadMore`)),513)):s(``,!0)]),o(b,{name:`back-to-top`},{default:y(()=>[t.showBackToTop?(w(),l(`button`,{key:0,type:`button`,class:`home-back-to-top`,"aria-label":t.$t(`intro.home.backToTop`),title:t.$t(`intro.home.backToTop`),onClick:n[2]||=(...e)=>t.scrollToTop&&t.scrollToTop(...e)},[o(g,{size:14,"stroke-width":1.8,"aria-hidden":`true`})],8,ht)):s(``,!0)]),_:1}),o(v,{item:t.selectedShowcase,onClose:n[3]||=e=>t.selectedShowcase=void 0},null,8,[`item`])],544)):(w(),l(`div`,{key:1,class:`home-loading`,role:`status`,"aria-label":t.$t(`common.status.loading`)},[...n[5]||=[e(`span`,null,null,-1)]],8,gt))}var vt=N(pt,[[`render`,_t],[`__scopeId`,`data-v-b1f4587d`]]);export{vt as default};
|
|
@@ -1 +0,0 @@
|
|
|
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-GALwUZll.js";import{t as x}from"./upload-Sju4DbiY.js";import{t as S}from"./tooltip-4w7ghPQM.js";import{t as C}from"./alert-BprQRUmf.js";import{_ as w,v as T}from"./vuex.esm-bundler-BV9tXD4i.js";import{t as E}from"./drawer-APcI0MuL.js";import{t as D}from"./input-number-CQyq1gfs.js";import{t as O}from"./switch-4nC3Yz4b.js";import{t as k}from"./box-Eq7xsVMG.js";import{t as A}from"./clock-BooSG6zB.js";import{t as j}from"./hash-GTQkcsQj.js";import{t as M}from"./info-PmX6OJ8X.js";import{a as N,i as P,n as F,o as ee,r as I,t as te}from"./pagination-W-HQ78h5.js";import{t as L}from"./trash-2-BkEkcSHv.js";import{t as ne}from"./triangle-alert-DBmpuUlm.js";import{t as R}from"./upload-DidTvyIg.js";import{t as re}from"./volume-2-CpkYjlNM.js";import{t as z}from"./wand-sparkles-CwgjO5Gl.js";import{Cn as B,Ua as V,_n as ie,an as ae,bn as oe,cn as se,dn as ce,fn as le,gn as ue,hn as de,ln as fe,mn as pe,nn as me,on as he,pn as ge,sn as _e,tn as ve,un as ye,vn as be,xn as xe,yn as Se}from"./constants-GmVIn7tC.js";import{D as H,Fa as Ce,Jn as U,Mi as we,Na as W,Pi as G,Qa as K,T as Te,Tn as Ee,at as De,ct as q,lt as J,oi as Oe,ot as Y,qi as ke,ri as Ae,st as je,ta as Me,tt as X,za as Ne}from"./index-Dr2ooWnm.js";import{t as Pe}from"./CopyToClipboard-CQT78wob.js";import{t as Fe}from"./ReportButton-B6G5OWJ0.js";import{t as Z}from"./ImagePreview-YXx0To-U.js";import{n as Ie}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Le}from"./ServicePricingSummary-rLPlqY7R.js";import{t as Re}from"./AudioPreview-DbtJFAs7.js";import{t as ze}from"./VideoPlayer-DuUSbT-p.js";import{t as Be}from"./VideoPreview-DiHzfmhx.js";import{t as Ve}from"./ScenarioPaymentMode-DRMdqOm9.js";import{t as He}from"./ApiCodeButton-DSt2Pz0O.js";import{t as Ue}from"./BotPlaceholder-BC8u-j84.js";import{t as We}from"./taskPollingMixin-CcLxtz8z.js";import{t as Ge}from"./ShowcaseResultTabs-CS9fv2h_.js";import{t as Ke}from"./showcaseRecreateMixin-Dhdr3T0y.js";import{t as qe}from"./generationInput--J_4Niw5.js";import{t as Je}from"./ImageWrapper-DH6OlBWC.js";var Ye=v({name:`LayoutSeedance`,components:{MagicIcon:z,ElDrawer:E,ElButton:K},mixins:[Ie]}),Xe={class:`main flex flex-row flex-1`},Ze={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)]`},Qe={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function $e(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Xe,[e(`div`,Ze,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Qe,[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 et=H(Ye,[[`render`,$e],[`__scopeId`,`data-v-86340af4`]]),tt=v({name:`SeedancePromptInput`,components:{PromptTextarea:P},computed:{prompt:{get(){return this.$store.state.seedance?.config?.prompt},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,prompt:e})}}},mounted(){this.prompt||=``}});function nt(e,t,n,r,i,a){let o=l(`prompt-textarea`);return g(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`seedance.name.prompt`),info:e.$t(`seedance.description.prompt`),placeholder:e.$t(`seedance.placeholder.prompt`),"min-rows":5},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var rt=H(tt,[[`render`,nt]]),it=v({name:`SeedanceModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:N},data(){return{options:[{value:ge,label:this.$t(`seedance.model.seedance25`)},{value:ye,label:this.$t(`seedance.model.seedance20`)},{value:ce,label:this.$t(`seedance.model.seedance20Fast`)},{value:le,label:this.$t(`seedance.model.seedance20Mini`)},{value:fe,label:this.$t(`seedance.model.seedance15pro`)},{value:_e,label:this.$t(`seedance.model.seedance10pro`)},{value:se,label:this.$t(`seedance.model.seedance10proFast`)},{value:he,label:this.$t(`seedance.model.seedance10liteT2v`)},{value:ae,label:this.$t(`seedance.model.seedance10liteI2v`)}]}},computed:{value:{get(){return this.$store.state.seedance?.config?.model},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,model:e})}}},mounted(){this.value||=ve}}),at={class:`field`},ot={class:`label`},st={class:`box`},ct={class:`title font-bold`};function lt(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,at,[e(`div`,ot,[e(`div`,st,[e(`h2`,ct,i(t.$t(`seedance.name.model`)),1),a(m,{content:t.$t(`seedance.description.model`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedance.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 ut=H(it,[[`render`,lt],[`__scopeId`,`data-v-0092c9dc`]]),dt=v({name:`SeedanceDurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:N},computed:{model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},options(){let e=[];this.capability.supportsAutoDuration&&e.push({value:-1,label:`${this.$t(`seedance.placeholder.seed`)} (-1)`});for(let t=this.capability.minDuration;t<=this.capability.maxDuration;t++)e.push({value:t,label:`${t}s`});return e},value:{get(){return this.$store.state.seedance?.config?.duration},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,duration:e})}}},watch:{model(){this.clampValue()}},mounted(){this.value?this.clampValue():this.value=5},methods:{clampValue(){let e=this.value;e!==void 0&&!(e===-1&&this.capability.supportsAutoDuration)&&(e<this.capability.minDuration||e>this.capability.maxDuration)&&(this.value=5)}}}),ft={class:`field`},pt={class:`label`},mt={class:`box`},ht={class:`title font-bold`};function gt(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,ft,[e(`div`,pt,[e(`div`,mt,[e(`h2`,ht,i(t.$t(`seedance.name.duration`)),1),a(m,{content:t.$t(`seedance.description.duration`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedance.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 _t=H(dt,[[`render`,gt],[`__scopeId`,`data-v-d61cc21b`]]),Q={[oe]:0,[xe]:1,[Se]:2,"4k":3},vt=v({name:`SeedanceResolutionSelector`,components:{InfoIcon:N,ElTooltip:S},computed:{model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},options(){let e=[{value:oe,label:`480p`},{value:xe,label:`720p`},{value:Se,label:`1080p`},{value:`4k`,label:`4k`}],t=Q[this.capability.maxResolution]??Q[`1080p`];return e.map(e=>({...e,disabled:Q[e.value]>t}))},value:{get(){return this.$store.state.seedance?.config?.resolution},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,resolution:e})}}},watch:{model(){this.clampValue()}},mounted(){this.value?this.clampValue():this.value=this.capability.defaultResolution||`720p`},methods:{onSelect(e){e.disabled||(this.value=e.value)},clampValue(){let e=this.value,t=this.options.find(t=>t.value===e);(!e||t&&t.disabled)&&(this.value=this.capability.defaultResolution||`720p`)}}}),yt={class:`resolution`},bt={class:`header`},xt={class:`title font-bold`},St={class:`items`},Ct=[`onClick`];function wt(t,r,o,u,d,m){let _=l(`info-icon`),v=l(`el-tooltip`);return g(),s(`div`,yt,[e(`div`,bt,[e(`h2`,xt,i(t.$t(`seedance.name.resolution`)),1),a(_,{content:t.$t(`seedance.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,St,[(g(!0),s(c,null,h(t.options,r=>(g(),f(v,{key:r.value,content:t.$t(`seedance.message.resolutionNotSupported`),disabled:!r.disabled,placement:`top`},{default:p(()=>[e(`div`,{class:n([`item`,{active:t.value===r.value,disabled:r.disabled}]),onClick:e=>t.onSelect(r)},i(r.label),11,Ct)]),_:2},1032,[`content`,`disabled`]))),128))])])}var Tt=H(vt,[[`render`,wt],[`__scopeId`,`data-v-db7e8aff`]]),Et=v({name:`SeedanceRatioSelector`,components:{InfoIcon:N},computed:{options(){return[{value:de,label:`16:9`,w:32,h:18},{value:ie,label:`9:16`,w:18,h:32},{value:`4:3`,label:`4:3`,w:28,h:21},{value:`3:4`,label:`3:4`,w:21,h:28},{value:`1:1`,label:`1:1`,w:24,h:24},{value:ue,label:`21:9`,w:34,h:14},{value:be,label:this.$t(`seedance.ratio.adaptive`),w:0,h:0}]},value:{get(){return this.$store.state.seedance?.config?.ratio},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,ratio:e})}}},mounted(){this.value||=me}}),Dt={class:`ratio`},Ot={class:`header`},kt={class:`title font-bold`},At={class:`items`},jt=[`onClick`],Mt={class:`preview`},Nt={key:1,class:`rect rect-auto`},Pt={class:`name`};function Ft(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,Dt,[e(`div`,Ot,[e(`h2`,kt,i(t.$t(`seedance.name.ratio`)),1),a(p,{content:t.$t(`seedance.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,At,[(g(!0),s(c,null,h(t.options,r=>(g(),s(`div`,{key:r.value,class:n([`item`,{active:t.value===r.value}]),onClick:e=>t.value=r.value},[e(`div`,Mt,[r.w&&r.h?(g(),s(`div`,{key:0,class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)):(g(),s(`div`,Nt,`A`))]),e(`div`,Pt,i(r.label),1)],10,jt))),128))])])}var It=H(Et,[[`render`,Ft],[`__scopeId`,`data-v-8ddec2dd`]]),Lt=v({name:`SeedanceGenerateAudioSwitch`,components:{ElSwitch:O,InfoIcon:N},computed:{isSupported(){let e=this.$store.state.seedance?.config?.model;return B(e).acceptsAudio},value:{get(){return this.$store.state.seedance?.config?.generate_audio??!1},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,generate_audio:e})}}},watch:{isSupported(e){!e&&this.value&&(this.value=!1)}},mounted(){this.value===void 0&&(this.value=!1)}}),Rt={key:0,class:`field`},zt={class:`label`},Bt={class:`box`},Vt={class:`title font-bold`},Ht={class:`value`};function Ut(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,Rt,[e(`div`,zt,[e(`div`,Bt,[e(`h2`,Vt,i(t.$t(`seedance.name.generateAudio`)),1),a(f,{content:t.$t(`seedance.description.generateAudio`),class:`info`},null,8,[`content`])])]),e(`div`,Ht,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])):o(``,!0)}var Wt=H(Lt,[[`render`,Ut],[`__scopeId`,`data-v-df51dfbd`]]),Gt=v({name:`SeedanceCameraFixedSwitch`,components:{ElSwitch:O,InfoIcon:N},computed:{value:{get(){return this.$store.state.seedance?.config?.camerafixed??!1},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,camerafixed:e})}}},mounted(){this.$store.state.seedance?.config?.camerafixed===void 0&&(this.value=!1)}}),Kt={class:`field`},qt={class:`label`},Jt={class:`box`},Yt={class:`title font-bold`},Xt={class:`value`};function Zt(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Kt,[e(`div`,qt,[e(`div`,Jt,[e(`h2`,Yt,i(t.$t(`seedance.name.cameraFixed`)),1),a(d,{content:t.$t(`seedance.description.cameraFixed`),class:`info`},null,8,[`content`])])]),e(`div`,Xt,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])}var Qt=H(Gt,[[`render`,Zt],[`__scopeId`,`data-v-ae777d61`]]),$t=new Set(Object.keys(pe)),en=e=>Array.isArray(e)?e.filter(e=>V(e?.url)):[];function $(e){let t=en(e?.images),n=t.some(e=>!e.role||e.role===`first_frame`||e.role===`last_frame`),r=t.some(e=>e.role===`reference_image`)||e?.audios?.some(e=>V(e?.url))===!0||e?.videos?.some(e=>V(e?.url))===!0;return{frame:n,reference:r,mixed:n&&r}}function tn(e){let t={...e||{}};if(typeof t.prompt==`string`&&(t.prompt=t.prompt.trim(),t.prompt||delete t.prompt),t.model&&!$t.has(t.model))return{reject:`modelUnsupported`};let n=B(t.model);t.images=en(t.images);let r=t.images.some(e=>e.role===`first_frame`),i=t.images.some(e=>e.role===`last_frame`);!r&&i&&(t.images=t.images.map(e=>e.role===`last_frame`?{...e,role:`first_frame`}:e));let a=t.images.length>0;if(a||delete t.images,delete t.service_tier,!n.acceptsImage&&a)return{reject:`modelRejectsImage`};if(!n.acceptsAudio&&t.generate_audio&&(t.generate_audio=!1),!n.acceptsReturnLastFrame&&t.return_last_frame&&(t.return_last_frame=!1),!n.acceptsLastFrame&&a&&(t.images=t.images.filter(e=>e.role!==`last_frame`),a=t.images.length>0,a||delete t.images),n.acceptsReferenceAudio&&Array.isArray(t.audios)&&(t.audios=t.audios.filter(e=>V(e?.url))),(!n.acceptsReferenceAudio||!Array.isArray(t.audios)||t.audios.length===0)&&delete t.audios,n.acceptsReferenceVideo&&Array.isArray(t.videos)&&(t.videos=t.videos.filter(e=>V(e?.url))),(!n.acceptsReferenceVideo||!Array.isArray(t.videos)||t.videos.length===0)&&delete t.videos,!n.acceptsReferenceImage&&Array.isArray(t.images)&&(t.images=t.images.filter(e=>e.role!==`reference_image`),t.images.length===0&&delete t.images),a=Array.isArray(t.images)&&t.images.length>0,$(t).mixed)return{reject:`frameReferenceConflict`};if(n.requiresImage&&!a||!n.acceptsText&&!a)return{reject:`modelRequiresImage`};let o=Array.isArray(t.videos)&&t.videos.length>0,s=(t.images||[]).filter(e=>e.role===`reference_image`).length,c=t.model===`doubao-seedance-2-5-260628`?t.images?.length||0:s,l=t.videos?.length||0,u=t.audios?.length||0;return s>n.maxReferenceImages||l>n.maxReferenceVideos||u>n.maxReferenceAudios||c+l+u>n.maxReferenceMedia?{reject:`referenceMediaExceeded`}:Array.isArray(t.audios)&&t.audios.length>0&&!a&&!o&&!n.supportsAudioOnly?{reject:`audioRequiresReference`}:(n.taskTypes.includes(t.omni_reference_task_type)||delete t.omni_reference_task_type,t.omni_reference_task_type===`reference`&&!$(t).reference?{reject:`taskRequiresReferenceMedia`}:(n.outputFormats.includes(t.output_format)||delete t.output_format,t.model===`doubao-seedance-2-5-260628`&&t.web_search===!0?t.tools=[{type:`web_search`}]:delete t.tools,delete t.web_search,t.model===`doubao-seedance-2-5-260628`&&t.images?.some(e=>e.role===`first_frame`||e.role===`last_frame`)&&(t.ratio=`adaptive`),(t.omni_reference_task_type===`edit`||t.omni_reference_task_type===`extend`)&&!o?{reject:`taskRequiresVideo`}:!t.prompt&&!a&&!o&&!Array.isArray(t.audios)?{reject:`generationInputRequired`}:(t.omni_reference_task_type===`edit`?(t.ratio=`adaptive`,t.duration=-1):t.omni_reference_task_type===`extend`&&(t.ratio=`adaptive`),{request:{...t,async:!0}})))}var nn=v({name:`SeedanceFirstFrameImage`,components:{MetaTag:Ce,UploadIcon:R,ElUpload:x,ElButton:K,ElTooltip:S,InfoIcon:N,ImagePreview:Z},mixins:[J,q,Y,X],data(){return{fileList:[],uploadUrl:W()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},inputModes(){return $(this.$store.state.seedance?.config)},uploadDisabled(){return this.inputModes.reference},dropDisabled(){return this.uploadDisabled},uploadTooltip(){return this.uploadDisabled?this.$t(`seedance.message.frameUploadBlocked`):``},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsImage"(e){e||(this.fileList=[],this.onSetFirstFrameUrl())}},methods:{onBeforeUpload(e){return this.uploadDisabled?(T.warning(this.$t(`seedance.message.frameUploadBlocked`)),!1):this.beforeUploadSizeGuard(e)},onRemoveFile(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetFirstFrameUrl()},onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.error(this.$t(`seedance.message.uploadError`))},onSetFirstFrameUrl(){let e=this.urls?.[0],t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`first_frame`);e&&t.push({url:e,role:`first_frame`}),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetFirstFrameUrl()},async onRemove(){this.onSetFirstFrameUrl()}}}),rn={key:0,class:`relative`},an={class:`flex min-h-8 items-center pr-20`},on={class:`flex justify-start items-center`},sn={class:`text-sm font-bold`};function cn(t,n,c,u,d,m){let h=l(`meta-tag`),_=l(`info-icon`),v=l(`image-preview`),y=l(`upload-icon`),b=l(`el-button`),x=l(`el-tooltip`),S=l(`el-upload`);return t.capability.acceptsImage?(g(),s(`div`,rn,[e(`div`,an,[e(`div`,on,[e(`span`,sn,i(t.$t(`seedance.name.firstFrame`)),1),t.capability.requiresImage?(g(),f(h,{key:0,class:`required-badge`,density:`compact`,tone:`warning`},{default:p(()=>[r(i(t.$t(`seedance.name.required`)),1)]),_:1})):o(``,!0),a(_,{content:t.$t(`seedance.description.firstFrame`)},null,8,[`content`])])]),a(S,{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,"before-upload":t.onBeforeUpload,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(v,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemoveFile(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(x,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(b,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(y,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var ln=H(nn,[[`render`,cn],[`__scopeId`,`data-v-b6c34daf`]]),un=v({name:`SeedanceLastFrameImage`,components:{UploadIcon:R,ElUpload:x,ElButton:K,ElTooltip:S,ImagePreview:Z,InfoIcon:N},mixins:[J,q,Y,X],data(){return{fileList:[],uploadUrl:W()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},inputModes(){return $(this.$store.state.seedance?.config)},uploadDisabled(){return this.inputModes.reference},dropDisabled(){return this.uploadDisabled},uploadTooltip(){return this.uploadDisabled?this.$t(`seedance.message.frameUploadBlocked`):``},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsLastFrame"(e){e||(this.fileList=[],this.onSetLastFrameUrl())}},methods:{onBeforeUpload(e){return this.uploadDisabled?(T.warning(this.$t(`seedance.message.frameUploadBlocked`)),!1):this.beforeUploadSizeGuard(e)},onRemoveFile(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetLastFrameUrl()},onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.error(this.$t(`seedance.message.uploadError`))},onSetLastFrameUrl(){let e=this.urls?.[0],t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`last_frame`);e&&t.push({url:e,role:`last_frame`}),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetLastFrameUrl()},async onRemove(){this.onSetLastFrameUrl()}}}),dn={key:0,class:`relative`},fn={class:`flex min-h-8 items-center pr-20`},pn={class:`flex justify-start items-center`},mn={class:`text-sm font-bold`};function hn(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 t.capability.acceptsLastFrame?(g(),s(`div`,dn,[e(`div`,fn,[e(`div`,pn,[e(`span`,mn,i(t.$t(`seedance.name.lastFrame`)),1),a(h,{content:t.$t(`seedance.description.lastFrame`)},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,class:`upload-wrapper`,multiple:!1,"before-upload":t.onBeforeUpload,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,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.onRemoveFile(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(`seedance.button.upload`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var gn=H(un,[[`render`,hn],[`__scopeId`,`data-v-198d2769`]]),_n=v({name:`SeedanceReferenceImage`,components:{UploadIcon:R,ElUpload:x,ElButton:K,ElTooltip:S,InfoIcon:N,ImagePreview:Z},mixins:[J,q,Y,X],data(){return{fileList:[],uploadUrl:W()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},inputModes(){return $(this.$store.state.seedance?.config)},uploadDisabled(){return this.inputModes.frame},dropDisabled(){return this.uploadDisabled},uploadTooltip(){return this.uploadDisabled?this.$t(`seedance.message.referenceUploadBlocked`):``},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceImage"(e){e||(this.fileList=[],this.onSetReferenceImageUrls())}},methods:{onBeforeUpload(e){return this.uploadDisabled?(T.warning(this.$t(`seedance.message.referenceUploadBlocked`)),!1):this.beforeUploadSizeGuard(e)},onRemoveFile(e){this.fileList.splice(this.fileList.indexOf(e),1),this.onSetReferenceImageUrls()},onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.error(this.$t(`seedance.message.uploadError`))},onSetReferenceImageUrls(){let e=(this.urls||[]).filter(Boolean),t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`reference_image`);e.forEach(e=>t.push({url:e,role:`reference_image`})),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetReferenceImageUrls()},async onRemove(){this.onSetReferenceImageUrls()}}}),vn={key:0,class:`relative`},yn={class:`flex min-h-8 items-center pr-20`},bn={class:`flex justify-start items-center`},xn={class:`text-sm font-bold`};function Sn(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 t.capability.acceptsReferenceImage?(g(),s(`div`,vn,[e(`div`,yn,[e(`div`,bn,[e(`span`,xn,i(t.$t(`seedance.name.referenceImage`)),1),a(h,{content:t.$t(`seedance.description.referenceImage`)},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:t.capability.maxReferenceImages,class:`upload-wrapper`,multiple:t.capability.maxReferenceImages>1,"before-upload":t.onBeforeUpload,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,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.onRemoveFile(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(`seedance.button.upload`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`limit`,`multiple`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var Cn=H(_n,[[`render`,Sn],[`__scopeId`,`data-v-591ef66f`]]),wn=v({name:`SeedanceReferenceAudio`,components:{UploadIcon:R,ElUpload:x,ElButton:K,ElTooltip:S,InfoIcon:N},mixins:[q,Y,X],data(){return{fileList:[],uploadUrl:W()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},inputModes(){return $(this.$store.state.seedance?.config)},uploadDisabled(){return this.inputModes.frame},dropDisabled(){return this.uploadDisabled},uploadTooltip(){return this.uploadDisabled?this.$t(`seedance.message.referenceUploadBlocked`):``},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceAudio"(e){e||(this.fileList=[],this.onSetReferenceAudios())}},methods:{onBeforeUpload(e){return this.uploadDisabled?(T.warning(this.$t(`seedance.message.referenceUploadBlocked`)),!1):this.beforeUploadSizeGuard(e)},onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.error(this.$t(`seedance.message.uploadError`))},onSetReferenceAudios(){let e=(this.urls||[]).filter(Boolean);this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,audios:e.length>0?e.map(e=>({url:e})):void 0})},async onSuccess(){this.onSetReferenceAudios()},async onRemove(){this.onSetReferenceAudios()}}}),Tn={key:0,class:`relative`},En={class:`flex min-h-8 items-center pr-20`},Dn={class:`flex justify-start items-center`},On={class:`text-sm font-bold`};function kn(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-tooltip`),y=l(`el-upload`);return t.capability.acceptsReferenceAudio?(g(),s(`div`,Tn,[e(`div`,En,[e(`div`,Dn,[e(`span`,On,i(t.$t(`seedance.name.referenceAudio`)),1),a(m,{content:t.$t(`seedance.description.referenceAudio`)},null,8,[`content`])])]),a(y,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp3,.wav,.m4a,.aac,.ogg,.flac`,limit:t.capability.maxReferenceAudios,class:`upload-wrapper`,multiple:t.capability.maxReferenceAudios>1,"before-upload":t.onBeforeUpload,action:t.uploadUrl,"list-type":`text`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(v,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(h,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`limit`,`multiple`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var An=H(wn,[[`render`,kn],[`__scopeId`,`data-v-cb408b11`]]),jn=v({name:`SeedanceReferenceVideo`,components:{UploadIcon:R,ElUpload:x,ElButton:K,ElTooltip:S,InfoIcon:N},mixins:[q,Y,X],data(){return{fileList:[],uploadUrl:W()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return B(this.model)},inputModes(){return $(this.$store.state.seedance?.config)},uploadDisabled(){return this.inputModes.frame},dropDisabled(){return this.uploadDisabled},uploadTooltip(){return this.uploadDisabled?this.$t(`seedance.message.referenceUploadBlocked`):``},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceVideo"(e){e||(this.fileList=[],this.onSetReferenceVideos())}},methods:{onBeforeUpload(e){return this.uploadDisabled?(T.warning(this.$t(`seedance.message.referenceUploadBlocked`)),!1):this.beforeUploadSizeGuard(e)},onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.error(this.$t(`seedance.message.uploadError`))},onSetReferenceVideos(){let e=(this.urls||[]).filter(Boolean);this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,videos:e.length>0?e.map(e=>({url:e})):void 0})},async onSuccess(){this.onSetReferenceVideos()},async onRemove(){this.onSetReferenceVideos()}}}),Mn={key:0,class:`relative`},Nn={class:`flex min-h-8 items-center pr-20`},Pn={class:`flex justify-start items-center`},Fn={class:`text-sm font-bold`};function In(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-tooltip`),y=l(`el-upload`);return t.capability.acceptsReferenceVideo?(g(),s(`div`,Mn,[e(`div`,Nn,[e(`div`,Pn,[e(`span`,Fn,i(t.$t(`seedance.name.referenceVideo`)),1),a(m,{content:t.$t(`seedance.description.referenceVideo`)},null,8,[`content`])])]),a(y,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp4,.mov,.webm,.mkv,.avi`,limit:t.capability.maxReferenceVideos,class:`upload-wrapper`,multiple:t.capability.maxReferenceVideos>1,"before-upload":t.onBeforeUpload,action:t.uploadUrl,"list-type":`text`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(v,{content:t.uploadTooltip,disabled:!t.uploadDisabled,placement:`top`},{default:p(()=>[e(`span`,null,[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`,disabled:t.uploadDisabled},{default:p(()=>[a(h,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`file-list`,`limit`,`multiple`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var Ln=H(jn,[[`render`,In],[`__scopeId`,`data-v-c0492201`]]),Rn=v({name:`SeedanceReturnLastFrameSwitch`,components:{ElSwitch:O,InfoIcon:N},computed:{model(){return this.$store.state.seedance?.config?.model},isSupported(){return B(this.model).acceptsReturnLastFrame},value:{get(){return this.$store.state.seedance?.config?.return_last_frame},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,return_last_frame:e})}}},watch:{isSupported(e){!e&&this.value&&(this.value=!1)}},mounted(){this.value===void 0&&(this.value=!1)}}),zn={key:0,class:`field`},Bn={class:`label`},Vn={class:`box`},Hn={class:`title font-bold`},Un={class:`value`};function Wn(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,zn,[e(`div`,Bn,[e(`div`,Vn,[e(`h2`,Hn,i(t.$t(`seedance.name.returnLastFrame`)),1),a(f,{content:t.$t(`seedance.description.returnLastFrame`),class:`info`},null,8,[`content`])])]),e(`div`,Un,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])):o(``,!0)}var Gn=H(Rn,[[`render`,Wn],[`__scopeId`,`data-v-edea5451`]]),Kn=v({name:`SeedanceAdvanced25Settings`,components:{ElOption:b,ElSelect:y,ElSwitch:O,InfoIcon:N},computed:{visible(){return this.$store.state.seedance?.config?.model===ge},taskType:{get(){return this.$store.state.seedance?.config?.omni_reference_task_type||`auto`},set(e){this.updateConfig({omni_reference_task_type:e})}},outputFormat:{get(){return this.$store.state.seedance?.config?.output_format||`mp4`},set(e){this.updateConfig({output_format:e})}},webSearch:{get(){return this.$store.state.seedance?.config?.web_search===!0},set(e){this.updateConfig({web_search:e})}}},methods:{updateConfig(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,...e})}}}),qn={key:0,class:`space-y-4`},Jn={class:`field`},Yn={class:`label`},Xn={class:`title font-bold`},Zn={class:`field`},Qn={class:`label`},$n={class:`title font-bold`},er={class:`field`},tr={class:`label`},nr={class:`title font-bold`};function rr(t,n,r,c,u,d){let f=l(`info-icon`),m=l(`el-option`),h=l(`el-select`),_=l(`el-switch`);return t.visible?(g(),s(`div`,qn,[e(`div`,Jn,[e(`div`,Yn,[e(`h2`,Xn,i(t.$t(`seedance.name.taskType`)),1),a(f,{content:t.$t(`seedance.description.taskType`),class:`info`},null,8,[`content`])]),a(h,{modelValue:t.taskType,"onUpdate:modelValue":n[0]||=e=>t.taskType=e,class:`value`},{default:p(()=>[a(m,{value:`auto`,label:t.$t(`seedance.taskType.auto`)},null,8,[`label`]),a(m,{value:`reference`,label:t.$t(`seedance.taskType.reference`)},null,8,[`label`]),a(m,{value:`edit`,label:t.$t(`seedance.taskType.edit`)},null,8,[`label`]),a(m,{value:`extend`,label:t.$t(`seedance.taskType.extend`)},null,8,[`label`])]),_:1},8,[`modelValue`])]),e(`div`,Zn,[e(`div`,Qn,[e(`h2`,$n,i(t.$t(`seedance.name.outputFormat`)),1)]),a(h,{modelValue:t.outputFormat,"onUpdate:modelValue":n[1]||=e=>t.outputFormat=e,class:`value`},{default:p(()=>[a(m,{value:`mp4`,label:`MP4`}),a(m,{value:`mov`,label:`MOV`})]),_:1},8,[`modelValue`])]),e(`div`,er,[e(`div`,tr,[e(`h2`,nr,i(t.$t(`seedance.name.webSearch`)),1),a(f,{content:t.$t(`seedance.description.webSearch`),class:`info`},null,8,[`content`])]),a(_,{modelValue:t.webSearch,"onUpdate:modelValue":n[2]||=e=>t.webSearch=e},null,8,[`modelValue`])])])):o(``,!0)}var ir=H(Kn,[[`render`,rr],[`__scopeId`,`data-v-b4dd64f6`]]),ar=v({name:`SeedanceSeedInput`,components:{ElInputNumber:D,InfoIcon:N},computed:{value:{get(){let e=this.$store.state.seedance?.config?.seed;return typeof e==`number`?e:-1},set(e){let t={...this.$store.state.seedance?.config||{}};t.seed=typeof e==`number`&&Number.isInteger(e)?e:-1,this.$store.commit(`seedance/setConfig`,t)}}}}),or={class:`field`},sr={class:`label`},cr={class:`box`},lr={class:`title font-bold`},ur={class:`value`};function dr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`);return g(),s(`div`,or,[e(`div`,sr,[e(`div`,cr,[e(`h2`,lr,i(t.$t(`seedance.name.seed`)),1),a(d,{content:t.$t(`seedance.description.seed`),class:`info`},null,8,[`content`])])]),e(`div`,ur,[a(f,{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`])])])}var fr=v({name:`SeedanceConfigPanel`,components:{MagicIcon:z,ElAlert:C,ElButton:K,PromptInput:rt,ModelSelector:ut,DurationSelector:_t,ResolutionSelector:Tt,RatioSelector:It,GenerateAudioSwitch:Wt,CameraFixedSwitch:Qt,ReturnLastFrameSwitch:Gn,Advanced25Settings:ir,SeedInput:H(ar,[[`render`,dr],[`__scopeId`,`data-v-685a9869`]]),FirstFrameImage:ln,LastFrameImage:gn,ReferenceImage:Cn,ReferenceAudio:An,ReferenceVideo:Ln,ServicePricingSummary:Le,ScenarioPaymentMode:Ve},emits:[`generate`],data(){return{quoteTimer:0,quoteRunId:0}},computed:{canGenerate(){let{request:e,reject:t}=tn(this.config);return!t&&qe(`seedance`,e)},config(){return this.$store.state.seedance?.config},capability(){return B(this.config?.model)},inputModes(){return $(this.config)},consumption(){return Ee(this.config,this.service?.cost)},service(){return this.$store.state.seedance?.service},walletMode(){return we()&&G(`seedance`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=G(`seedance`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,350))},async refreshQuote(){if(!this.canGenerate)return;let e=G(`seedance`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;let{request:n}=tn(this.config);try{if(!n)return;let r=await U.quote(n);t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=r.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`,this.walletMode?void 0:this.consumption)}}}),pr={class:`flex flex-col h-full`},mr={class:`flex-1 overflow-y-auto p-5`},hr={key:0,class:`input-mode-guide mb-4`},gr={class:`flex flex-col items-center justify-center px-5 pb-5`};function _r(t,n,c,u,d,m){let h=l(`prompt-input`),_=l(`model-selector`),v=l(`ratio-selector`),y=l(`resolution-selector`),b=l(`duration-selector`),x=l(`generate-audio-switch`),S=l(`camera-fixed-switch`),C=l(`return-last-frame-switch`),w=l(`advanced25-settings`),T=l(`seed-input`),E=l(`el-alert`),D=l(`first-frame-image`),O=l(`last-frame-image`),k=l(`reference-image`),A=l(`reference-audio`),j=l(`reference-video`),M=l(`scenario-payment-mode`),N=l(`service-pricing-summary`),P=l(`magic-icon`),F=l(`el-button`);return g(),s(`div`,pr,[e(`div`,mr,[a(h,{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`}),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`}),t.capability.acceptsReferenceImage?(g(),s(`div`,hr,[e(`div`,null,[e(`strong`,null,i(t.$t(`seedance.inputMode.frames`)),1),r(` `+i(t.$t(`seedance.description.frameMode`)),1)]),e(`div`,null,[e(`strong`,null,i(t.$t(`seedance.inputMode.reference`)),1),r(` `+i(t.$t(`seedance.description.referenceMode`)),1)])])):o(``,!0),t.inputModes.mixed?(g(),f(E,{key:1,class:`mb-4`,type:`warning`,closable:!1,title:t.$t(`seedance.message.frameReferenceConflict`),"show-icon":``},null,8,[`title`])):o(``,!0),a(D,{class:`mb-4`}),a(O,{class:`mb-4`}),a(k,{class:`mb-4`}),a(A,{class:`mb-4`}),a(j,{class:`mb-4`})]),e(`div`,gr,[a(M,{scenario:`seedance`}),t.walletMode?o(``,!0):(g(),f(N,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),a(F,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:p(()=>[a(P,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var vr=H(fr,[[`render`,_r],[`__scopeId`,`data-v-0b17b09f`]]),yr=v({name:`SeedanceTaskPreview`,components:{DeleteIcon:L,ApplicationIcon:k,ChannelIcon:j,FullscreenIcon:ee,InfoIcon:M,MagicIcon:z,TimeIcon:A,VolumeIcon:re,WarningIcon:ne,CopyToClipboard:Pe,ElAlert:C,VideoPlayer:ze,ElTooltip:S,ElButton:K,ImageWrapper:Je,ImagePreview:Z,AudioPreview:Re,VideoPreview:Be,ApiCodeButton:He,ReportButton:Fe},props:{modelValue:{type:Object,required:!0}},computed:{video(){return this.modelValue?.response?.data},apiCodeBody(){let e=this.modelValue?.request;if(!e)return e;let{service_tier:t,...n}=e;return n},promptText(){let e=this.modelValue?.request;if(e?.prompt)return e.prompt;let t=e?.content?.find(e=>e?.type===`text`&&e?.text);return t?.text?t.text:this.video?.prompt},referenceImages(){let e=this.collectImages();if(e.length===0)return[];let t=[],n=e.find(e=>e?.role===`first_frame`);n?.url&&t.push({url:n.url,name:`first-frame`});let r=e.find(e=>e?.role===`last_frame`);return r?.url&&t.push({url:r.url,name:`last-frame`}),e.forEach((e,n)=>{e?.url&&e.role!==`first_frame`&&e.role!==`last_frame`&&t.push({url:e.url,name:e.role||`image-${n}`})}),t},referenceAudios(){let e=this.modelValue?.request,t=(e?.audios??[]).map(e=>e?.url).filter(Boolean);return(e?.content??[]).forEach(e=>{e?.type===`audio_url`&&e?.audio_url?.url&&t.push(e.audio_url.url)}),t},referenceVideos(){let e=this.modelValue?.request,t=(e?.videos??[]).map(e=>e?.url).filter(Boolean);return(e?.content??[]).forEach(e=>{e?.type===`video_url`&&e?.video_url?.url&&t.push(e.video_url.url)}),t}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await Ne.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`seedance/deleteTask`,{id:e}),T.success(this.$t(`common.message.deleteTaskSuccess`))}catch{T.error(this.$t(`common.message.deleteTaskFailed`))}}},collectImages(){let e=this.modelValue?.request,t=Array.isArray(e?.images)?[...e.images]:[];return(e?.content??[]).forEach(e=>{e?.type===`image_url`&&e?.image_url?.url&&t.push({url:e.image_url.url,role:e.role})}),t},onDownload(e){window.open(e,`_blank`)}}}),br={class:`preview`},xr={class:`left`},Sr={class:`main`},Cr={class:`bot`},wr={class:`datetime`},Tr=[`aria-label`],Er={class:`info`},Dr={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Or={key:1,class:`prompt mt-2`},kr={key:0},Ar={key:1},jr={key:0,class:n({content:!0})},Mr={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Nr={key:1,class:n({content:!0})},Pr={key:0,class:`mb-4`},Fr={key:1,class:`mb-4`},Ir={key:2,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Lr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Rr={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},zr={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Br={key:0},Vr={key:1},Hr={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ur={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Wr={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Gr={key:5,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Kr={key:2,class:n({content:!0})},qr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Jr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Yr={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Xr={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Zr={key:3,class:n({content:!0})},Qr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$r={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function ei(n,u,d,m,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-preview`),C=l(`audio-preview`),w=l(`video-preview`),T=l(`time-icon`),E=l(`magic-icon`),D=l(`copy-to-clipboard`),O=l(`el-alert`),k=l(`video-player`),A=l(`image-wrapper`),j=l(`el-button`),M=l(`api-code-button`),N=l(`report-button`),P=l(`application-icon`),F=l(`fullscreen-icon`),ee=l(`volume-icon`),I=l(`channel-icon`),te=l(`warning-icon`),L=l(`info-icon`);return g(),s(`div`,br,[e(`div`,xr,[a(y,{capability:`seedance`,part:`avatar`,class:`avatar`})]),e(`div`,Sr,[e(`div`,Cr,[a(y,{capability:`seedance`,part:`name`}),e(`span`,wr,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(x,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(g(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:u[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Tr)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Er,[n.referenceImages.length>0||n.referenceAudios.length>0||n.referenceVideos.length>0?(g(),s(`div`,Dr,[(g(!0),s(c,null,h(n.referenceImages,(e,t)=>(g(),f(S,{key:`image-${t}`,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceAudios,(e,t)=>(g(),f(C,{key:`audio-${t}`,url:e,name:`audio-${t+1}`},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceVideos,(e,t)=>(g(),f(w,{key:`video-${t}`,url:e,name:`video-${t+1}`},null,8,[`url`,`name`]))),128))])):o(``,!0),n.promptText?(g(),s(`p`,Or,[r(i(n.promptText)+` `,1),n.modelValue?.response?n.video?.status===`processing`||n.video?.status===`pending`?(g(),s(`span`,Ar,` - (`+i(n.$t(`seedance.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,kr,` - (`+i(n.$t(`seedance.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,Nr,[n.video?.video_url?(g(),s(`div`,Pr,[a(k,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.last_frame_url?(g(),s(`div`,Fr,[a(A,{src:n.video?.last_frame_url,"raw-src":n.video?.last_frame_url},null,8,[`src`,`raw-src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,Ir,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`seedance.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(j,{type:`info`,size:`small`,class:`btn-action`,onClick:u[1]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`seedance.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(M,{path:`/seedance/videos`,body:n.apiCodeBody},null,8,[`body`]),a(N,{service:`seedance`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(O,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,Lr,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.video?.duration?(g(),s(`p`,Rr,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.duration`))+`: `+i(n.video?.duration)+`s `,1)])):o(``,!0),n.video?.resolution?(g(),s(`p`,zr,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.resolution`))+`: `+i(n.video?.resolution)+` `,1),n.video?.ratio?(g(),s(`span`,Br,` · `+i(n.video?.ratio),1)):o(``,!0),n.video?.framespersecond?(g(),s(`span`,Vr,` · `+i(n.video?.framespersecond)+`fps`,1)):o(``,!0)])):o(``,!0),n.modelValue?.request?.generate_audio?(g(),s(`p`,Hr,[a(ee,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.generateAudio`))+`: `+i(n.$t(`seedance.button.on`)),1)])):o(``,!0),e(`p`,Ur,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,Wr,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Gr,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(g(),s(`div`,Kr,[a(O,{closable:!1,class:`failure`},{template:p(()=>[a(te,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.failure`)),1)]),default:p(()=>[e(`p`,qr,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(g(),s(`p`,Jr,[a(L,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(D,{content:n.modelValue?.response?.error?.message,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(g(),s(`p`,Yr,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Xr,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,Zr,[a(O,{closable:!1,class:`info`},{template:p(()=>[a(L,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.status`)),1)]),default:p(()=>[e(`p`,Qr,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.trace_id?(g(),s(`p`,$r,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,jr,[a(O,{closable:!1,class:`info`},{template:p(()=>[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.status.pending`)),1)]),default:p(()=>[e(`p`,Mr,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})]))])])}var ti=v({name:`SeedanceRecentPanel`,components:{TaskPreview:H(yr,[[`render`,ei],[`__scopeId`,`data-v-a9336aee`]]),BotPlaceholder:Ue,NoTasks:I,ScrollList:F},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.seedance?.tasks,items:this.$store.state.seedance?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),ni={key:0},ri={key:2,class:`w-full h-full flex items-center justify-center`};function ii(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`,ni,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,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`,ri,[a(v)])):o(``,!0)],64)}var ai=v({name:`SeedanceIndex`,components:{ConfigPanel:vr,Layout:et,RecentPanel:H(ti,[[`render`,ii]]),ShowcaseResultTabs:Ge},mixins:[je,Ke(`seedance`),We(`seedance`)],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.seedance?.status?.getApplications===w.Request},tasksLoading(){return this.$store.state.seedance?.status?.getTasks===w.Request||this.fetchingTasks},credential(){return this.$store.state.seedance?.credential},config(){return this.$store.state.seedance?.config},tasks(){return this.$store.state.seedance?.tasks},walletMode(){return we()&&G(`seedance`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`seedance/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job||=window.setInterval(this.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await te({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){await this.$store.dispatch(`seedance/getService`)},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch(`seedance/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(e){let{request:t,reject:n}=tn(this.config);if(n){let e=n===`generationInputRequired`?`common.message.generationInputRequired`:`seedance.message.${n}`;T.warning(this.$t(e));return}if(!De(this.uploadTracker,e=>this.$t(e),e=>T.warning(e))||!t)return;let r;if(this.walletMode){let e=this.getWalletContext();if(!e){T.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}r=U.generate(t,{mode:`x402`,x402:{wallet:e,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!Me())return;let e=this.credential?.token;if(!e)return;r=U.generate(t,{token:e})}let i=T.info(this.$t(`seedance.message.startingTask`));ke(`seedance`,r).then(e=>{i.close();let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),T.success(this.$t(`seedance.message.startTaskSuccess`))}).catch(t=>{i.close();let n=t?.response?.data;t instanceof Ae||Te(t,`seedance`,e)||(this.walletMode?T.error(this.$t(`common.x402Scenario.paymentFailed`)):T.error(this.$t(`seedance.message.startTaskFailed`)+(n?.error?.message||``)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return Oe(this.$wallet)},async confirmWalletPayment(e){return Ne.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function oi(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`showcase-result-tabs`),d=l(`layout`);return g(),f(d,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(u,{service:`seedance`},{tasks:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})]),_:1})}var si=H(ai,[[`render`,oi]]);export{si as default};
|