@acedatacloud/nexior 3.366.0 → 3.366.1
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-CNUTyuRJ.js → ApiCodeButton-C7scE7xM.js} +1 -1
- package/dist/assets/{ApiCodeDialog-DqhfQ8Wk.js → ApiCodeDialog-Bg0tWPJ0.js} +2 -2
- package/dist/assets/{Artifacts-wIkJbIew.js → Artifacts-DNeH29kG.js} +1 -1
- package/dist/assets/{AskUserQuestionCard-CxMmNpAA.js → AskUserQuestionCard-Djy0TI7n.js} +1 -1
- package/dist/assets/{AudioPreview-BI2G9JWa.js → AudioPreview-QpcH3q7k.js} +1 -1
- package/dist/assets/{Auth-Dmtc3Gao.js → Auth-kvfP23De.js} +1 -1
- package/dist/assets/{Bare-DN6YFbSE.js → Bare-CgEBKvyI.js} +1 -1
- package/dist/assets/{BotPlaceholder-C4od7g46.js → BotPlaceholder-DEGkOm1v.js} +1 -1
- package/dist/assets/{BottomFooter-I6o-dxHd.js → BottomFooter-BFiZrSwq.js} +1 -1
- package/dist/assets/{BrowseConnectors-Cb159Sew.css → BrowseConnectors-Cj5o6cn9.css} +1 -1
- package/dist/assets/BrowseConnectors-D-kusp8P.js +1 -0
- package/dist/assets/{BrowserPairingDialog-CEX2HkdY.js → BrowserPairingDialog-mPHDBh9v.js} +1 -1
- package/dist/assets/{Callback-Wglsu85l.js → Callback-CY5SM-RO.js} +1 -1
- package/dist/assets/{CodeSnippet-CcVvsEZx.js → CodeSnippet-CcScns9G.js} +1 -1
- package/dist/assets/{Console-B0MM3w8Z.js → Console-DPtHo6wT.js} +1 -1
- package/dist/assets/{Conversation-Dc1ai4c8.js → Conversation-vHNhsMBY.js} +1 -1
- package/dist/assets/{Conversation-CFgeehQJ.js → Conversation-xA8KHIxK.js} +1 -1
- package/dist/assets/{CopyToClipboard-D3g5OQYq.js → CopyToClipboard-DwP8EnVL.js} +1 -1
- package/dist/assets/{Detail-B3hV91lO.js → Detail-D7IEYdsG.js} +2 -2
- package/dist/assets/{Extra-COVe-vU5.js → Extra-cx_u9wuG.js} +1 -1
- package/dist/assets/{FilePreview-DGrTwiZ0.js → FilePreview-B0LZbgoP.js} +1 -1
- package/dist/assets/{Hailuo-B49Dy9xD.js → Hailuo-C2dZ2Hep.js} +1 -1
- package/dist/assets/{History-C2WISAvm.js → History-BVR2QAcw.js} +1 -1
- package/dist/assets/{ImagePreview-qAVMs5-m.js → ImagePreview-DsNhLxjj.js} +1 -1
- package/dist/assets/{ImageWrapper-B6SkXSYB.js → ImageWrapper-BqB7BVOH.js} +1 -1
- package/dist/assets/Index--pfuR7qc.js +1 -0
- package/dist/assets/{Index-BwccICel.css → Index-B41Fv1rE.css} +1 -1
- package/dist/assets/Index-B90L4ZGP.js +1 -0
- package/dist/assets/{Index-BYaDAelT.js → Index-BD0--C6x.js} +1 -1
- package/dist/assets/Index-BJyD0UiQ.js +1 -0
- package/dist/assets/{Index-BUJb5dLt.js → Index-BO39Yrn8.js} +2 -2
- package/dist/assets/Index-BQKnUav7.js +1 -0
- package/dist/assets/{Index-eMb7CxvS.css → Index-BYTs7y1w.css} +1 -1
- package/dist/assets/Index-Bbzcb0Dr.js +1 -0
- package/dist/assets/Index-C3Au_Ala.js +1 -0
- package/dist/assets/Index-C7R9MIeL.js +1 -0
- package/dist/assets/{Index-iiOS8zXF.css → Index-C7q1ELqN.css} +1 -1
- package/dist/assets/Index-C8xCtvy9.js +1 -0
- package/dist/assets/Index-CCBy1WKd2.js +1 -0
- package/dist/assets/{Index-BCMADVdJ.css → Index-CDCElVuB.css} +1 -1
- package/dist/assets/Index-CbBh2G5w.js +1 -0
- package/dist/assets/{Index-Dj5-BET9.css → Index-Cd0d6ngD.css} +1 -1
- package/dist/assets/{Index-ykVaEeXu.js → Index-Ced_8JX_.js} +1 -1
- package/dist/assets/{Index-Ct8oVEgF.js → Index-CiW-P8wg.js} +1 -1
- package/dist/assets/Index-CkCJJvRD.js +1 -0
- package/dist/assets/{Index-Ctj7rhP5.js → Index-CkddzQAk.js} +1 -1
- package/dist/assets/Index-Cl5Pdauj.js +1 -0
- package/dist/assets/Index-CoZfjlqE.js +1 -0
- package/dist/assets/Index-CrENz4Ug.js +1 -0
- package/dist/assets/{Index-DVnRuDGz.js → Index-D7HXRwfV.js} +1 -1
- package/dist/assets/Index-D9on_bCE.js +1 -0
- package/dist/assets/Index-DAyToqf0.css +1 -0
- package/dist/assets/Index-DMekgFQK.js +1 -0
- package/dist/assets/Index-DNmHReq2.js +1 -0
- package/dist/assets/Index-Dc25DqUP.js +1 -0
- package/dist/assets/Index-DdIIQpId.js +1 -0
- package/dist/assets/{Index-D79lPrR6.css → Index-DfF9WOA9.css} +1 -1
- package/dist/assets/Index-Di3IO7Tp2.js +1 -0
- package/dist/assets/{Index-C9aytpVX.js → Index-Dq44TDvQ.js} +1 -1
- package/dist/assets/{Index-BFagE2vJ.js → Index-DsBBS_xE.js} +1 -1
- package/dist/assets/Index-Dw_X76T32.js +1 -0
- package/dist/assets/{Index-69qwJrEl.js → Index-DzEeIFqB.js} +1 -1
- package/dist/assets/Index-RrEXHfeB.js +1 -0
- package/dist/assets/Index-Sx_DJs5u.js +2 -0
- package/dist/assets/Index-afUaM83M.js +1 -0
- package/dist/assets/{Index-BDDfx64J.css → Index-gNdt1-V7.css} +1 -1
- package/dist/assets/Index-pU3g-Gaj.js +1 -0
- package/dist/assets/Index-uHe6f3js.js +1 -0
- package/dist/assets/{Index-C8euoWNj.js → Index-ziKQKZYb.js} +1 -1
- package/dist/assets/{Invitees-CvHGuQti.js → Invitees-CuoJZ8qW.js} +1 -1
- package/dist/assets/List-BhOhD8mr.js +1 -0
- package/dist/assets/{List-BcqnmARv.js → List-Cbhj8VX7.js} +1 -1
- package/dist/assets/List-CodGsflW.js +1 -0
- package/dist/assets/List-WpvMOl6Z.css +1 -0
- package/dist/assets/LocalTools-CE0j1cUC.js +5 -0
- package/dist/assets/{LocalTools-9Jtgbq-H.js → LocalTools-DAXOoidh.js} +1 -1
- package/dist/assets/{Logo-BguoQTCB.js → Logo-BxWY8yDz.js} +1 -1
- package/dist/assets/Main-CQp3KYgB.css +1 -0
- package/dist/assets/Main-CXWozUVI.js +1 -0
- package/dist/assets/Message-COwFwhYr.js +3 -0
- package/dist/assets/{Message-av3bdLFk.css → Message-DrxHoTDI.css} +1 -1
- package/dist/assets/Model-DMKuWmLk.js +1 -0
- package/dist/assets/{Navigator-B4FrcUud.js → Navigator-D4tQ6Tlb.js} +4 -4
- package/dist/assets/{NotFound-DhzA1jGZ.js → NotFound-BP3vnoOY.js} +1 -1
- package/dist/assets/{PageHeader-CVan17KZ.js → PageHeader-1V50PS2z.js} +1 -1
- package/dist/assets/{Pay-C6yYHO6L.js → Pay-BJ_t3Xkm.js} +1 -1
- package/dist/assets/{Player-DNYFGvUI.js → Player-DHr0-4ia.js} +1 -1
- package/dist/assets/{Poivelle-CjIog7SR.js → Poivelle-C_NnGnnx.js} +1 -1
- package/dist/assets/{RealtimeCall-OgnsGRxz.js → RealtimeCall-DoU938cN.js} +1 -1
- package/dist/assets/{ReportButton-PnxhbyY3.js → ReportButton-Bm62Lacf.js} +1 -1
- package/dist/assets/{ReportDialog-SRZtNE4g.js → ReportDialog-B8kZl-BL.js} +1 -1
- package/dist/assets/{ScenarioPaymentMode-DIi02QYr.js → ScenarioPaymentMode-D4tV55rH.js} +1 -1
- package/dist/assets/{ScheduledTasks-ConsLl32.js → ScheduledTasks-Bx0_YZAI.js} +2 -2
- package/dist/assets/{ServicePricingSummary-BivE2980.js → ServicePricingSummary-D4FVsXlm.js} +1 -1
- package/dist/assets/{ShowcaseDetailDialog-CaAxybGk.js → ShowcaseDetailDialog-eEoWy-5j.js} +1 -1
- package/dist/assets/{ShowcaseGrid-mNAgSCCP.js → ShowcaseGrid-qP_Hyviy.js} +1 -1
- package/dist/assets/{ShowcaseResultTabs-DBLSmleL.js → ShowcaseResultTabs-CKcaJRIY.js} +1 -1
- package/dist/assets/{SolanaWalletPickerDialog-BA5B3njr.js → SolanaWalletPickerDialog-CkS5HQYx.js} +1 -1
- package/dist/assets/Status-C0aZ3vpY.js +1 -0
- package/dist/assets/{Status-DWfphJ5X.css → Status-kvJ35KBF.css} +1 -1
- package/dist/assets/{Subscribe-0ttI5TLw.js → Subscribe-EDAWp886.js} +1 -1
- package/dist/assets/{TabSwitcher-BV9qnkwD.js → TabSwitcher-DZIAS4XS.js} +1 -1
- package/dist/assets/Tts-B5a57W_B.js +1 -0
- package/dist/assets/{VideoPlayer-C5nuzpsQ.js → VideoPlayer-FSh3nDpc.js} +1 -1
- package/dist/assets/{VideoPreview-GDesX4uO.js → VideoPreview-B-THygEm.js} +1 -1
- package/dist/assets/arrow-down-DFXHAyUS.js +1 -0
- package/dist/assets/{arrow-down-wide-narrow-Czt_I7KX.js → arrow-down-wide-narrow-xyXjHaW8.js} +1 -1
- package/dist/assets/arrow-left-B7WQi403.js +1 -0
- package/dist/assets/arrow-right-D4rwO_Au.js +1 -0
- package/dist/assets/arrow-up-q-iszS2P.js +1 -0
- package/dist/assets/authorizeFlow-DnEpSZv8.js +1 -0
- package/dist/assets/{avatar-D370EMqc.js → avatar-CZZxQYLl.js} +1 -1
- package/dist/assets/{basic-7YSgFLqK.js → basic-PCDbRQRT.js} +1 -1
- package/dist/assets/{book-open-vLxoN6PL.js → book-open-Bh7h50JY.js} +1 -1
- package/dist/assets/{box-BvxPOK2h.js → box-BBfeBDWM.js} +1 -1
- package/dist/assets/{boxes-mSI74P2u.js → boxes-twyo7vbC.js} +1 -1
- package/dist/assets/{brain-CyoXLhfV.js → brain-Bbp_3Dru.js} +1 -1
- package/dist/assets/{chart-no-axes-combined-TTGX3bjw.js → chart-no-axes-combined--iroaZSJ.js} +1 -1
- package/dist/assets/{chat-Dr_8i2OC.js → chat-DQr_G1lK.js} +1 -1
- package/dist/assets/check-CdRY2Yxz.js +1 -0
- package/dist/assets/chevron-down-DMT83zNF.js +1 -0
- package/dist/assets/chevron-right-BXZ-HwwD.js +1 -0
- package/dist/assets/circle-check-DF4k69Rx.js +1 -0
- package/dist/assets/{circle-question-mark-CZR-PLIy.js → circle-question-mark-xfs1rhlS.js} +1 -1
- package/dist/assets/{clipboard-list-UBdkfTaV.js → clipboard-list-Xa_o-zx1.js} +1 -1
- package/dist/assets/clock-DmG68B_m.js +1 -0
- package/dist/assets/code-CEYwJp_3.js +1 -0
- package/dist/assets/{codingBridge-HGP2GJev.js → codingBridge-Dyvxe3ig.js} +2 -2
- package/dist/assets/{coins-Ci1h3mFn.js → coins-C6lnr6eN.js} +1 -1
- package/dist/assets/{collapse-VpE-JTHv.js → collapse-Loa-kWFA.js} +1 -1
- package/dist/assets/{copy-d-knGnBg.js → copy-BucJJjSq.js} +1 -1
- package/dist/assets/{createTaskActions-NiTfdh0V.js → createTaskActions-DhFHQISa.js} +1 -1
- package/dist/assets/{date-picker-G36ASKiN.js → date-picker-qPhjXms2.js} +1 -1
- package/dist/assets/{digitalhuman-C7S7FsT3.js → digitalhuman-EqZJcQav.js} +1 -1
- package/dist/assets/dist-Bj1bzw6C.js +1 -0
- package/dist/assets/{dollar-sign-C3cUPmpu.js → dollar-sign-COPNik6d.js} +1 -1
- package/dist/assets/{download-BhtFvN99.js → download-Bcw7Hy-X.js} +1 -1
- package/dist/assets/{drawer-CcmIHJGA.js → drawer-DfXjJO_e.js} +1 -1
- package/dist/assets/{dropdown-Bn9v2KTj.js → dropdown-BpnvvhZD.js} +1 -1
- package/dist/assets/{dropdown-D4o4wWHg.js → dropdown-qRDq0eWW.js} +1 -1
- package/dist/assets/{ellipsis-BmEAnlmx.js → ellipsis-DyGBlldp.js} +1 -1
- package/dist/assets/{esm-p8Jo0tYw.js → esm-Bb5GB2Ls.js} +3 -3
- package/dist/assets/esm-DKo-dyuZ.js +3 -0
- package/dist/assets/{esm-Dr_IIEG1.js → esm-DQRQajYi.js} +1 -1
- package/dist/assets/{esm-H1SE-ruA.js → esm-Di1-0oPN.js} +1 -1
- package/dist/assets/esm-j-yHGXQp.js +2 -0
- package/dist/assets/{external-link-a6gwnAXF.js → external-link-fR5udMCA.js} +1 -1
- package/dist/assets/{eye-DAvdydrT.js → eye-D6VMAzQ5.js} +1 -1
- package/dist/assets/{file-idwjcrNO.js → file-BZUguXKs.js} +1 -1
- package/dist/assets/{file-output-7KnhDC3g.js → file-output-C35uv7VQ.js} +1 -1
- package/dist/assets/{file-text-X4uWOJCu.js → file-text-CY325CGw.js} +1 -1
- package/dist/assets/fish-DTUhK6wG.js +1 -0
- package/dist/assets/{flux-D_xASdM7.js → flux-Bz-tFPHA.js} +1 -1
- package/dist/assets/{folder-D4arolGu.js → folder-B0brS6QN.js} +1 -1
- package/dist/assets/gauge-CRZ3LNGr.js +1 -0
- package/dist/assets/{globe-BeA3PtwN.js → globe-Cs0FMFOk.js} +1 -1
- package/dist/assets/{grokvideo-Cy0u_ALM.js → grokvideo-CseK4u12.js} +1 -1
- package/dist/assets/{hailuo-BVGW2LPO.js → hailuo-Dwxsal0M.js} +1 -1
- package/dist/assets/{headphones-CN8-XPOG.js → headphones-Rh-dlOsL.js} +1 -1
- package/dist/assets/{history-CHzw4Zy3.js → history-DStvHsoa.js} +1 -1
- package/dist/assets/{house-CHht5bK-.js → house-rDSRqz9D.js} +1 -1
- package/dist/assets/{image-TUJ7noU4.js → image-DXlHEkxh.js} +1 -1
- package/dist/assets/index-C2sgIqPl.js +570 -0
- package/dist/assets/{index.browser.esm-BbYKZd7a.js → index.browser.esm-CNb4vwx1.js} +1 -1
- package/dist/assets/{index.es-DmSo7tWP.js → index.es-QIqTUIEY.js} +1 -1
- package/dist/assets/{info-Dw45cuIu.js → info-Dy6jE77P.js} +1 -1
- package/dist/assets/{input-number-BKBS2Owi.js → input-number-BdXZiGUI.js} +1 -1
- package/dist/assets/{key-round-AIoNm7eD.js → key-round-B6Mqq2Lg.js} +1 -1
- package/dist/assets/{kling-DZUvBteL.js → kling-EbFI1iFL.js} +1 -1
- package/dist/assets/{languages-DXL9MEKc.js → languages-oV5N_Alp.js} +1 -1
- package/dist/assets/{laptop-CAjegCPJ.js → laptop-6SsyRulE.js} +1 -1
- package/dist/assets/{lightbulb-B-K1XTkr.js → lightbulb-Bvz2oSo8.js} +1 -1
- package/dist/assets/{link-Dsj5Bmxr.js → link-Dg9RgZiI.js} +1 -1
- package/dist/assets/loader-circle-BhLoljYa.js +1 -0
- package/dist/assets/{lock-CLuaJ3mF.js → lock-CxQtw8RZ.js} +1 -1
- package/dist/assets/{veo-C0vz8D1K.js → luma-BRjiMx3Y.js} +1 -1
- package/dist/assets/maestro-BxbVyOE5.js +1 -0
- package/dist/assets/{mail-BrzONGRQ.js → mail-DFdNy8Ra.js} +1 -1
- package/dist/assets/{message-circle-CWXpTu0H.js → message-circle-CZW5ardy.js} +1 -1
- package/dist/assets/{mic-nJa_ZcUr.js → mic-D442HlCF.js} +1 -1
- package/dist/assets/{midjourney-BF4w7CkS.js → midjourney-BUsBjUb0.js} +1 -1
- package/dist/assets/{minimax-B9Qs7fCW.js → minimax-D8Tx2C_Q.js} +1 -1
- package/dist/assets/{models-MQfDh4XR.js → models-Cmo-VT-F.js} +1 -1
- package/dist/assets/{monitor-Bwxg4hNZ.js → monitor-BjV4HoYF.js} +1 -1
- package/dist/assets/{mouse-pointer-2-D8cdXzLf.js → mouse-pointer-2-B2-9X0q8.js} +1 -1
- package/dist/assets/music-2-CHRNlHGT.js +1 -0
- package/dist/assets/{nanobanana-CoXNCH5U.js → nanobanana-C1RcRlIQ.js} +1 -1
- package/dist/assets/{omni-DwRTi8pI.js → omni-D7yjrqdG.js} +1 -1
- package/dist/assets/{openaiimage-DT36Vssf.js → openaiimage-BztBB9Wr.js} +1 -1
- package/dist/assets/{pagination-Cm8YvnWD.js → pagination-BMxNVusP.js} +1 -1
- package/dist/assets/{pagination-DSThTHa8.js → pagination-CXIeMVnN.js} +1 -1
- package/dist/assets/{pagination-DwZ3YOUv.js → pagination-Cs8AeOMZ.js} +1 -1
- package/dist/assets/{palette-DHGMVKUq.js → palette-CNvk-C8x.js} +1 -1
- package/dist/assets/{paperclip-DEtsPc4z.js → paperclip-B5A5e-4V.js} +1 -1
- package/dist/assets/{pause-BPVIeCKa.js → pause-CWUerwP0.js} +1 -1
- package/dist/assets/{pencil-DteavqpG.js → pencil-Csq6-6cZ.js} +1 -1
- package/dist/assets/{pika-yiqZQcBo.js → pika-QR_keXcv.js} +1 -1
- package/dist/assets/{pixverse-wpQE5tgC.js → pixverse-BkT2eu-h.js} +1 -1
- package/dist/assets/play-D_HvuPrY.js +1 -0
- package/dist/assets/{plug-CIjw2auh.js → plug-yO3Q-eF4.js} +1 -1
- package/dist/assets/plus-BtFEhIIv.js +1 -0
- package/dist/assets/{poivelle-Dnuq1AsU.js → poivelle-DD58OrYl.js} +1 -1
- package/dist/assets/{popover-BMCGA48W.js → popover-BKaxFwwA.js} +1 -1
- package/dist/assets/{producer-DSFqSihS.js → producer-DbFulRD5.js} +1 -1
- package/dist/assets/{luma-FQpy7QMl.js → qrart-Coi7dXf_.js} +1 -1
- package/dist/assets/{realtime-Otop6lWY.js → realtime-xxyl3bN0.js} +1 -1
- package/dist/assets/{refresh-cw-CSmBCYsc.js → refresh-cw-XfuPu0a6.js} +1 -1
- package/dist/assets/rotate-ccw-B-eMKmiQ.js +1 -0
- package/dist/assets/rotate-cw-quVDw14L.js +1 -0
- package/dist/assets/{row-jqfod54_.js → row-CcBmlG-B.js} +1 -1
- package/dist/assets/search-BR43rWRH.js +1 -0
- package/dist/assets/{seedance-rrdRxmQD.js → seedance-VNyPFVAf.js} +1 -1
- package/dist/assets/{seedream-CcnOuucy.js → seedream-DRZfX4t0.js} +1 -1
- package/dist/assets/{select-Djse4FY0.js → select-D9aYzMf6.js} +1 -1
- package/dist/assets/{serp-C7dqNnnE.js → serp-DUPPPqhB.js} +1 -1
- package/dist/assets/{shield-CDA87sCy.js → shield-CWWgzv3X.js} +1 -1
- package/dist/assets/{showcase-BxdRB1lg.js → showcase-Cb1oGcVL.js} +1 -1
- package/dist/assets/{showcaseRecreateMixin-C-uOJ1M3.js → showcaseRecreateMixin-BZsXGtH6.js} +1 -1
- package/dist/assets/{shuffle-mOtJ2eE7.js → shuffle-DksF6HDm.js} +1 -1
- package/dist/assets/{siteBanner-BAxM0SE3.js → siteBanner-HcwctxPN.js} +1 -1
- package/dist/assets/{slider-DuS7ZACc.js → slider-B0-TGGgS.js} +1 -1
- package/dist/assets/{solana-Bn9cyhqr.js → solana-W8Xq1SnF.js} +2 -2
- package/dist/assets/{solana-wallets-CJXdb5BA.js → solana-wallets-B-874rbp.js} +2 -2
- package/dist/assets/{solana-wallets-vue-CvwzSqOW.js → solana-wallets-vue-C76KtNoS.js} +3 -3
- package/dist/assets/{sora-DKQHmPft.js → sora-DzJ-6Ca-.js} +1 -1
- package/dist/assets/{sparkles-C7XQv5Oq.js → sparkles-CzcAFvbW.js} +1 -1
- package/dist/assets/square-DEbbYmWP.js +1 -0
- package/dist/assets/{store-Bv0oX6Fc.js → store-B6_hFU0d.js} +1 -1
- package/dist/assets/{suno-aE9UfcDU.js → suno-BW3MhNs1.js} +1 -1
- package/dist/assets/{switch-BaGnAgAK.js → switch-COo_nVp9.js} +1 -1
- package/dist/assets/{table-NCWewyfH.js → table-BKxkUGAF.js} +1 -1
- package/dist/assets/{tabs-BYpPENh6.js → tabs-C0jaOUPC.js} +1 -1
- package/dist/assets/{tag-QrfH6KqU.js → tag-7zBfHNLd.js} +1 -1
- package/dist/assets/terminal-Cf4HqLmD.js +1 -0
- package/dist/assets/{time-picker-6Rw_7sgp.js → time-picker-2Nimkx9I.js} +1 -1
- package/dist/assets/{tooltip-DFb5f-ki.js → tooltip-CEa69fVd.js} +1 -1
- package/dist/assets/{trash-2-DFMSCDg9.js → trash-2-C8cED3lx.js} +1 -1
- package/dist/assets/{triangle-alert-D1ufgHM3.js → triangle-alert-BShpWZ9W.js} +1 -1
- package/dist/assets/{upload-CgEPSBDS.js → upload-Biblaze1.js} +1 -1
- package/dist/assets/{upload-BASUxaqc.js → upload-CO2xuaQ0.js} +1 -1
- package/dist/assets/user-8TlljmPW.js +1 -0
- package/dist/assets/{qrart-BNrRtoyT.js → veo-B7UQcrCr.js} +1 -1
- package/dist/assets/{video-DzjdkDHI.js → video-CB-yDNZ5.js} +1 -1
- package/dist/assets/{volume-2-GDPXM8s9.js → volume-2-KmhwbK54.js} +1 -1
- package/dist/assets/{wallet-9EcruXOc.js → wallet-B8k555jA.js} +1 -1
- package/dist/assets/{wan-CTlUtHUF.js → wan-DJubi0Hb.js} +1 -1
- package/dist/assets/{wand-sparkles-BUSW_8Pb.js → wand-sparkles-4VXENbf1.js} +1 -1
- package/dist/assets/{web-Ds1rhfEp.js → web-BJsDXl_f.js} +1 -1
- package/dist/assets/{webextrator-BTabdQd0.js → webextrator-CQfq4dIM.js} +1 -1
- package/dist/assets/{zap-CulaRliY.js → zap-DXu1LxNj.js} +1 -1
- package/dist/index.html +3 -3
- package/package.json +2 -2
- package/dist/assets/BrowseConnectors-DTSZsDBw.js +0 -1
- package/dist/assets/Index--rse_zMe.js +0 -1
- package/dist/assets/Index-AqPYdbiK.js +0 -1
- package/dist/assets/Index-B4lMK30K.js +0 -1
- package/dist/assets/Index-B9Pz_3vY.js +0 -1
- package/dist/assets/Index-BIC6s4oZ.css +0 -1
- package/dist/assets/Index-BSBjicw7.js +0 -1
- package/dist/assets/Index-BVEIFn8M.js +0 -1
- package/dist/assets/Index-Bp1Xuqv9.js +0 -1
- package/dist/assets/Index-C0V2gUjX2.js +0 -1
- package/dist/assets/Index-C5jrvF_n.js +0 -1
- package/dist/assets/Index-C66U0sUH.js +0 -1
- package/dist/assets/Index-COE2I6mf.js +0 -1
- package/dist/assets/Index-COJbRBLb.js +0 -1
- package/dist/assets/Index-CV7mzJas.js +0 -1
- package/dist/assets/Index-CdE11WGf.js +0 -1
- package/dist/assets/Index-CyjzLEWZ.js +0 -1
- package/dist/assets/Index-D834xbiN.js +0 -1
- package/dist/assets/Index-DJ1quW1D.js +0 -1
- package/dist/assets/Index-DZe9iZnD2.js +0 -1
- package/dist/assets/Index-GqlVtqL72.js +0 -1
- package/dist/assets/Index-Lzpa_0WY.js +0 -1
- package/dist/assets/Index-PkYDLnnl.js +0 -1
- package/dist/assets/Index-S96s3RN4.js +0 -1
- package/dist/assets/Index-Z1_3NkNn.js +0 -1
- package/dist/assets/Index-fY9lCOR_.js +0 -2
- package/dist/assets/Index-jXKXh5Bg.js +0 -1
- package/dist/assets/Index-n2E9Z0Gp.js +0 -1
- package/dist/assets/List-Be0odOJ-.js +0 -1
- package/dist/assets/List-DvJ-nNz5.js +0 -1
- package/dist/assets/List-ScKJ0k8S.css +0 -1
- package/dist/assets/LocalTools-D5uWkeyP.js +0 -5
- package/dist/assets/Main-BPOEeHjD.css +0 -1
- package/dist/assets/Main-CLKpy0B-.js +0 -1
- package/dist/assets/Message-E5cktEkZ.js +0 -3
- package/dist/assets/Model-BJtmzNA4.js +0 -1
- package/dist/assets/Status-CxJ4lAF1.js +0 -1
- package/dist/assets/Tts-DA3S_m5f.js +0 -1
- package/dist/assets/arrow-down-HPJryax8.js +0 -1
- package/dist/assets/arrow-left-CRH1hfcq.js +0 -1
- package/dist/assets/arrow-right-D3CCwZ4n.js +0 -1
- package/dist/assets/arrow-up-BZDeVety.js +0 -1
- package/dist/assets/authorizeFlow-RR6YFj95.js +0 -1
- package/dist/assets/check-Dw-Sz3oa.js +0 -1
- package/dist/assets/chevron-down-BmdZR3aU.js +0 -1
- package/dist/assets/chevron-right-CwL17Ni1.js +0 -1
- package/dist/assets/circle-check-Cfk2-tkE.js +0 -1
- package/dist/assets/clock-1gPZIP8f.js +0 -1
- package/dist/assets/code-BAKRDvmK.js +0 -1
- package/dist/assets/dist-DQBaVIej.js +0 -1
- package/dist/assets/esm-D-5GXt9s.js +0 -3
- package/dist/assets/esm-D2u5tK9d.js +0 -2
- package/dist/assets/fish-CQuNyGkW.js +0 -1
- package/dist/assets/gauge-BNI_KXsN.js +0 -1
- package/dist/assets/index-D2MoQRUt.js +0 -570
- package/dist/assets/loader-circle-CQAan3Ia.js +0 -1
- package/dist/assets/maestro-D9VvJ2kV.js +0 -1
- package/dist/assets/music-2-CkWYBkdq.js +0 -1
- package/dist/assets/play-DXsw7Fdy.js +0 -1
- package/dist/assets/plus-Cbtx4VCt.js +0 -1
- package/dist/assets/rotate-ccw-D-2DsI7v.js +0 -1
- package/dist/assets/rotate-cw-DDlMXf0a.js +0 -1
- package/dist/assets/search-BwPBcEMx.js +0 -1
- package/dist/assets/square-B_LUG-EG.js +0 -1
- package/dist/assets/terminal-CHK-nsKg.js +0 -1
- package/dist/assets/user-Dz5_N1ar.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{r as y,t as b}from"./select-D9aYzMf6.js";import{n as x,t as S}from"./tabs-C0jaOUPC.js";import{t as C}from"./upload-CO2xuaQ0.js";import{t as w}from"./tooltip-CEa69fVd.js";import{t as T}from"./alert-BprQRUmf.js";import{h as E,v as D}from"./models-Cmo-VT-F.js";import{n as O,r as k}from"./radio-BNhFzeBO.js";import{t as A}from"./drawer-DfXjJO_e.js";import{t as j}from"./input-number-BdXZiGUI.js";import{t as M}from"./slider-B0-TGGgS.js";import{t as N}from"./switch-COo_nVp9.js";import{t as P}from"./clock-DmG68B_m.js";import{a as F,i as ee,n as te,r as ne,s as re,t as ie}from"./pagination-Cs8AeOMZ.js";import{t as ae}from"./headphones-Rh-dlOsL.js";import{t as oe}from"./info-Dy6jE77P.js";import{t as se}from"./lightbulb-Bvz2oSo8.js";import{t as ce}from"./trash-2-C8cED3lx.js";import{t as le}from"./triangle-alert-BShpWZ9W.js";import{t as I}from"./upload-Biblaze1.js";import{t as L}from"./wand-sparkles-4VXENbf1.js";import{bi as R,hi as ue,vi as de,yi as fe}from"./constants-D0qyO-4p.js";import{$ as z,Aa as B,Ei as pe,Fr as me,Ir as V,J as he,Li as H,O as ge,Oa as _e,On as ve,Pr as ye,Q as be,Ra as xe,Si as U,X as Se,Y as Ce,Z as we,bn as W,et as Te,ga as G,ii as Ee,k as K,ma as De,nt as q,oi as Oe,pa as J,tt as Y,wi as X}from"./index-C2sgIqPl.js";import{t as ke}from"./CopyToClipboard-DwP8EnVL.js";import{t as Ae}from"./ReportButton-Bm62Lacf.js";import{t as je}from"./FilePreview-B0LZbgoP.js";import{t as Z}from"./ImagePreview-DsNhLxjj.js";import{n as Me}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Ne}from"./ServicePricingSummary-D4FVsXlm.js";import{t as Pe}from"./AudioPreview-QpcH3q7k.js";import{t as Fe}from"./VideoPlayer-FSh3nDpc.js";import{t as Ie}from"./VideoPreview-B-THygEm.js";import{t as Le}from"./ScenarioPaymentMode-D4tV55rH.js";import{t as Re}from"./ApiCodeButton-C7scE7xM.js";import{t as ze}from"./BotPlaceholder-DEGkOm1v.js";import{t as Be}from"./ShowcaseResultTabs-CKcaJRIY.js";import{t as Ve}from"./showcaseRecreateMixin-BZsXGtH6.js";var He=v({name:`LayoutKling`,components:{MagicIcon:L,ElDrawer:A,ElButton:B},mixins:[Me]}),Ue={class:`main flex flex-row flex-1 min-h-0`},We={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)]`},Ge={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ke(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Ue,[e(`div`,We,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Ge,[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 qe=K(He,[[`render`,Ke],[`__scopeId`,`data-v-2d826924`]]),Je={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-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 Je}}var $=`<<<video_1>>>`,Ye=/<<<image_\d+>>>/g;function Xe(e){return e?e.split($).join(` `).replace(/\s{2,}/g,` `).trim():``}function Ze(e){return e?e.replace(Ye,` `).replace(/\s{2,}/g,` `).trim():``}function Qe(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=n===`kling-o1`||!!(e.image_list?.length||e.video_list?.length);return s&&e.cfg_scale!==void 0&&o.push({field:`cfg_scale`,i18nLabel:`kling.name.cfgScale`}),s&&e.negative_prompt&&o.push({field:`negative_prompt`,i18nLabel:`kling.name.negativePrompt`}),o}function $e(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=Xe(n.prompt)),e.field===`image_list`&&(n.image_list=void 0,n.prompt=Ze(n.prompt));return n}var et=v({name:`ModelSelector`,components:{ElSelect:y,ElOption:b},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{revertKey:0,options:[{value:`kling-v3`,label:`v3`},{value:`kling-v3-omni`,label:`v3-Omni`},{value:`kling-v2-6`,label:`v2.6`},{value:`kling-v2-5-turbo`,label:`v2.5-Turbo`},{value:`kling-v2-1-master`,label:`v2.1-Master`},{value:`kling-v2-master`,label:`v2-Master`},{value:`kling-v1-6`,label:`v1.6`},{value:`kling-v1`,label:`v1`},{value:`kling-o1`,label:`Kling O1`}]}},computed:{value(){return this.$store.state.kling?.config?.model}},mounted(){this.value||this.applyModel(ue)},methods:{async onChange(e){let t=this.$store.state.kling?.config||{},n=Qe(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await G.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=$e({...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})}}}),tt={class:`field`},nt={class:`title font-bold`};function rt(t,n,r,a,o,u){let d=l(`el-option`),m=l(`el-select`);return g(),s(`div`,tt,[e(`h2`,nt,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 it=K(et,[[`render`,rt],[`__scopeId`,`data-v-a74e7f31`]]),at=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=Qe(t,{mode:e});if(n.length===0){this.applyMode(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await G.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=$e({...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})}}}),ot={class:`field`},st={class:`header`},ct={class:`title font-bold`},lt={key:0,class:`opt-tip`};function ut(t,r,u,d,m,_){let v=l(`info-icon`),y=l(`el-option`),b=l(`el-select`);return g(),s(`div`,ot,[e(`div`,st,[e(`h2`,ct,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`,lt,i(t.disabledReason),1)):o(``,!0)]),_:2},1032,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var dt=K(at,[[`render`,ut],[`__scopeId`,`data-v-9a8fa3c5`]]),ft=[3,5,8,10,12,15],pt=[5,10],mt=[5],ht=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 R.includes(this.selectedModel)},allowedDurations(){return this.selectedModel===`kling-o1`?mt:this.isV3Model?ft:pt},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=Qe(t,{duration:e});if(n.length===0){this.applyDuration(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await G.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=$e({...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})}}}),gt={class:`field`},_t={class:`control`},vt={class:`label`},yt={class:`title font-bold`};function bt(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,gt,[e(`div`,_t,[e(`div`,vt,[e(`h2`,yt,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 xt=K(ht,[[`render`,bt],[`__scopeId`,`data-v-496bf31c`]]),St=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`}}),Ct={class:`text-sm font-bold mb-2 block`},wt={class:`items`},Tt=[`onClick`],Et={class:`name`};function Dt(t,r,a,o,l,u){return g(),s(`div`,null,[e(`span`,Ct,i(t.$t(`kling.name.ratio`)),1),e(`div`,wt,[(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`,Et,i(r.label),1)],10,Tt))),128))])])}var Ot=K(St,[[`render`,Dt],[`__scopeId`,`data-v-cdb14b2f`]]),kt=v({name:`StartImage`,components:{UploadIcon:I,ElUpload:C,ElButton:B,ElTooltip:w,InfoIcon:F,ImagePreview:Z},mixins:[q,Y,z],emits:[`change`],data(){return{fileList:[],uploadUrl:J()+`/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()}}}),At={class:`relative`},jt={class:`flex min-h-8 items-center pr-20`},Mt={class:`flex justify-start items-center`},Nt={class:`text-sm font-bold`};function Pt(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`,At,[e(`div`,jt,[e(`div`,Mt,[e(`span`,Nt,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 Ft=K(kt,[[`render`,Pt],[`__scopeId`,`data-v-60844ac3`]]),It=v({name:`EndImage`,components:{UploadIcon:I,ElUpload:C,ElButton:B,ElTooltip:w,ImagePreview:Z,InfoIcon:F},mixins:[q,Y,z],data(){return{fileList:[],uploadUrl:J()+`/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()}}}),Lt={class:`relative`},Rt={class:`flex min-h-8 items-center pr-20`},zt={class:`flex justify-start items-center`},Bt={class:`text-sm font-bold`};function Vt(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`,Lt,[e(`div`,Rt,[e(`div`,zt,[e(`span`,Bt,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 Ht=K(It,[[`render`,Vt],[`__scopeId`,`data-v-b286c4d0`]]),Ut=v({name:`ReferenceVideo`,components:{ElUpload:C,ElButton:B,ElRadioButton:O,ElRadioGroup:k,ElSwitch:N,InfoIcon:F,FilePreview:je,UploadIcon:I},mixins:[Y,z],data(){return{fileList:[],uploadUrl:J()+`/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=we(e.size);return t?n?!0:(D.error(this.$t(`kling.message.referenceVideoSizeExceed`,{max:Se(Ce)})),!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=Xe(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()}}}),Wt={class:`relative`},Gt={class:`flex min-h-8 items-center pr-20`},Kt={class:`flex justify-start items-center`},qt={class:`text-sm font-bold`},Jt={key:0,class:`reference-options mt-3 flex flex-col gap-3`},Yt={class:`flex flex-col items-stretch gap-2 sm:flex-row sm:items-center sm:justify-between`},Xt={class:`text-sm`},Zt={class:`flex items-center justify-between gap-3`},Qt={class:`text-sm`};function $t(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`,Wt,[e(`div`,Gt,[e(`div`,Kt,[e(`span`,qt,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`,Jt,[e(`div`,Yt,[e(`span`,Xt,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`,Zt,[e(`span`,Qt,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 en=K(Ut,[[`render`,$t],[`__scopeId`,`data-v-e3a9dfab`]]),tn=v({name:`KlingReferenceImages`,components:{ElButton:B,ElUpload:C,UploadIcon:I,ImagePreview:Z,InfoIcon:F},mixins:[q,Y,z],data(){return{fileList:[],uploadUrl:J()+`/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=[Ze(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()}}}),nn={class:`relative`},rn={class:`flex justify-between items-center`},an={class:`flex justify-start items-center`},on={class:`text-sm font-bold`},sn={key:0,class:`file-list flex flex-wrap gap-2 mt-2`};function cn(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`,nn,[e(`div`,rn,[e(`div`,an,[e(`span`,on,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`,sn,[(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 ln=K(tn,[[`render`,cn]]),un=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}}),dn={class:`flex justify-between`},fn={class:`flex justify-start items-center`},pn={class:`text-sm font-bold`},mn={class:`flex justify-end items-center`},hn={class:`w-full`};function gn(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`,dn,[e(`div`,fn,[e(`span`,pn,i(t.$t(`kling.name.cfgScale`)),1),a(d,{content:t.$t(`kling.description.cfgScale`)},null,8,[`content`])]),e(`div`,mn,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,hn,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:0,max:1,step:.1},null,8,[`modelValue`])])])}var _n=K(un,[[`render`,gn]]),vn=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||``},supported(){return!!(R.includes(this.selectedModel)||this.selectedModel===`kling-v2-6`&&this.selectedMode===`pro`)},tooltipContent(){return this.supported?this.$t(`kling.description.generateAudio`):this.$t(`kling.description.generateAudioUnsupported`)},value:{get(){return this.supported?this.$store.state.kling?.config?.generate_audio??!1:!1},set(e){this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,generate_audio:e})}}},watch:{supported(e){!e&&this.$store.state.kling?.config?.generate_audio&&this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,generate_audio:!1})}}}),yn={class:`relative`},bn={class:`flex justify-between items-center`},xn={class:`flex justify-start items-center`},Sn={class:`text-sm font-bold`};function Cn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,yn,[e(`div`,bn,[e(`div`,xn,[e(`span`,Sn,i(t.$t(`kling.name.generateAudio`)),1),a(d,{content:t.tooltipContent},null,8,[`content`])]),a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,disabled:!t.supported},null,8,[`modelValue`,`disabled`])])])}var wn=K(vn,[[`render`,Cn]]),Tn=[`horizontal`,`vertical`,`pan`,`tilt`,`roll`,`zoom`],En=v({name:`CameraControlSelector`,components:{ElSelect:y,ElOption:b,ElSlider:M,ElInputNumber:j,InfoIcon:F},data(){return{configKeys:Tn}},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)}}}),Dn={class:`field`},On={class:`header`},kn={class:`text-sm font-bold`},An={key:0,class:`config-grid`},jn={class:`cfg-row-head`},Mn={class:`cfg-name`};function Nn(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`,Dn,[e(`div`,On,[e(`span`,kn,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`,An,[(g(!0),s(c,null,h(t.configKeys,n=>(g(),s(`div`,{key:n,class:`cfg-row`},[e(`div`,jn,[e(`span`,Mn,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 Pn=K(En,[[`render`,Nn],[`__scopeId`,`data-v-cd896060`]]),Fn=[{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`]}],In=`, `;function Ln(e,t){let n=(e||``).trim();return n?n.includes(t)?n:`${n}${In}${t}`:t}function Rn(e,t){if(!e||!t)return e||``;let n=[`${t}${In}`,`${In}${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 zn=v({name:`InspirationPills`,components:{CloseIcon:De},computed:{prompt(){return this.$store.state.kling?.config?.prompt||``},allChipTexts(){return Fn.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=Rn(this.prompt,e);this.$store.commit(`kling/setConfig`,{...this.$store.state.kling?.config,prompt:t})}}}),Bn={key:0,class:`pills`,role:`list`},Vn={class:`pill-text`},Hn=[`aria-label`,`title`,`onClick`];function Un(n,r,u,d,f,p){let m=l(`close-icon`);return n.selected.length>0?(g(),s(`div`,Bn,[(g(!0),s(c,null,h(n.selected,r=>(g(),s(`div`,{key:r,class:`pill`,role:`listitem`},[e(`span`,Vn,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,Hn)]))),128))])):o(``,!0)}var Wn=v({name:`PromptInput`,components:{IdeaIcon:se,ElButton:B,PromptTextarea:ee,InspirationPills:K(zn,[[`render`,Un],[`__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 Gn(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 Kn=K(Wn,[[`render`,Gn],[`__scopeId`,`data-v-5754ae54`]]),qn=v({name:`NegativePromptInput`,components:{ElInput:xe,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||=``}}),Jn={class:`field`},Yn={class:`box`},Xn={class:`title font-bold`};function Zn(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,Jn,[e(`div`,Yn,[e(`h2`,Xn,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 Qn=K(qn,[[`render`,Zn],[`__scopeId`,`data-v-de98cf01`]]),$n=v({name:`InspirationDrawer`,components:{Close:De,IdeaIcon:se,ElDrawer:A,ElButton:B},props:{modelValue:{type:Boolean,default:!1}},emits:[`update:modelValue`],data(){return{groups:Fn}},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(Rn(this.prompt,e)):this.setPrompt(Ln(this.prompt,e)))},onClearSelected(){let e=this.prompt;for(let t of this.allChipTexts)for(;e.includes(t);)e=Rn(e,t);this.setPrompt(e)}}}),er={class:`drawer-content`},tr={class:`drawer-header`},nr={class:`title-row`},rr={class:`title`},ir={class:`hint`},ar={key:0,class:`selected-bar`},or={class:`selected-text`},sr={class:`groups`},cr={class:`group-title`},lr={class:`chip-grid`},ur=[`onClick`];function dr(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`,er,[e(`div`,tr,[e(`div`,nr,[a(y,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,rr,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`,ir,i(t.$t(`kling.inspiration.hint`)),1),t.selectedCount>0?(g(),s(`div`,ar,[e(`span`,or,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`,sr,[(g(!0),s(c,null,h(t.groups,r=>(g(),s(`div`,{key:r.groupKey,class:`group`},[e(`div`,cr,i(t.$t(`kling.inspiration.group.${r.groupKey}`)),1),e(`div`,lr,[(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,ur))),128))])]))),128))])])]),_:1},8,[`modelValue`,`size`])}var fr=K($n,[[`render`,dr],[`__scopeId`,`data-v-8b2e6a5d`]]),pr={"kling-v3":`v3`,"kling-v3-omni":`v3-Omni`,"kling-v2-6":`v2.6`,"kling-v2-5-turbo":`v2.5-Turbo`,"kling-v2-1-master":`v2.1-Master`,"kling-v2-master":`v2-Master`,"kling-v1-6":`v1.6`,"kling-v1":`v1`,"kling-o1":`Kling O1`},mr={std:`720p`,pro:`1080p`,"4k":`4K`},hr=v({name:`SummaryChip`,components:{AudioIcon:ae},computed:{config(){return this.$store.state.kling?.config||{}},modelLabel(){let e=this.config?.model||`kling-v2-5-turbo`;return pr[e]||e},durationLabel(){return`${this.config?.duration??5}s`},aspectRatio(){return this.config?.aspect_ratio||``},modeLabel(){let e=this.config?.mode||`std`;return mr[e]||e},generateAudio(){return!!this.config?.generate_audio}}}),gr={class:`summary-chip`},_r=[`title`],vr=[`title`],yr=[`title`],br=[`title`],xr=[`title`];function Sr(t,n,r,c,u,d){let f=l(`audio-icon`);return g(),s(`div`,gr,[e(`span`,{class:`part`,title:t.$t(`kling.name.model`)},i(t.modelLabel),9,_r),n[0]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.duration`)},i(t.durationLabel),9,vr),n[1]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.ratio`)},i(t.aspectRatio||`16:9`),9,yr),n[2]||=e(`span`,{class:`dot`},`·`,-1),e(`span`,{class:`part`,title:t.$t(`kling.name.mode`)},i(t.modeLabel),9,br),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,xr)):o(``,!0)])}var Cr=v({name:`ConfigPanel`,components:{MagicIcon:L,ElButton:B,ServicePricingSummary:Ne,PromptInput:Kn,NegativePromptInput:Qn,ModelSelector:it,ModeSelector:dt,DurationSelector:xt,RatioSelector:Ot,StartImage:Ft,CfgScaleSelector:_n,GenerateAudioSelector:wn,CameraControlSelector:Pn,InspirationDrawer:fr,SummaryChip:K(hr,[[`render`,Sr],[`__scopeId`,`data-v-c800852a`]]),EndImage:Ht,ReferenceImages:ln,ReferenceVideo:en,ScenarioPaymentMode:Le},emits:[`generate`],data(){return{inspirationOpen:!1,quoteTimer:0,quoteRunId:0}},computed:{config(){return this.$store.state.kling?.config},capabilities(){return Q(this.config?.model,this.config?.mode,this.config?.duration)},omniActive(){return this.config?.model===`kling-o1`||!!(this.config?.image_list?.length||this.config?.video_list?.length)},consumption(){return W(this.config,this.service?.cost)},service(){return this.$store.state.kling?.service},walletMode(){return U()&&X(`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=X(`kling`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await V.quote(me(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)}},onGenerate(){this.$emit(`generate`)}}}),wr={class:`flex flex-col h-full`},Tr={class:`flex-1 overflow-y-auto p-5`},Er={class:`flex flex-col items-center justify-center px-5 pb-5`};function Dr(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`,wr,[e(`div`,Tr,[a(h,{class:`mb-4`,onOpenInspiration:n[0]||=e=>t.inspirationOpen=!0}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),t.capabilities.referenceImages?(g(),f(y,{key:0,class:`mb-3`})):o(``,!0),t.capabilities.referenceVideo?(g(),f(b,{key:1,class:`mb-4`})):o(``,!0),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`}),t.omniActive?o(``,!0):(g(),f(E,{key:2,class:`mb-4`})),t.omniActive?o(``,!0):(g(),f(D,{key:3,class:`mb-4`})),t.omniActive?o(``,!0):(g(),f(O,{key:4,class:`mb-4`}))]),e(`div`,Er,[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:``,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,[`onClick`])):(g(),f(N,{key:2,type:`primary`,class:`btn w-full`,round:``,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,[`onClick`]))]),a(P,{modelValue:t.inspirationOpen,"onUpdate:modelValue":n[1]||=e=>t.inspirationOpen=e},null,8,[`modelValue`])])}var Or=K(Cr,[[`render`,Dr]]),kr=v({name:`MotionImage`,components:{UploadIcon:I,ElUpload:C,ElButton:B,InfoIcon:F,ImagePreview:Z},mixins:[q,Y,z,he],data(){return{fileList:[],uploadUrl:J()+`/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()}}}),Ar={class:`relative`},jr={class:`flex justify-between`},Mr={class:`flex justify-start items-center`},Nr={class:`text-sm font-bold`};function Pr(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`,Ar,[e(`div`,jr,[e(`div`,Mr,[e(`span`,Nr,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 Fr=K(kr,[[`render`,Pr],[`__scopeId`,`data-v-4a95ef2c`]]),Ir=v({name:`MotionVideo`,components:{UploadIcon:I,ElUpload:C,ElButton:B,InfoIcon:F,FilePreview:je},mixins:[Y,z],data(){return{fileList:[],uploadUrl:J()+`/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()}}}),Lr={class:`relative`},Rr={class:`flex justify-between`},zr={class:`flex justify-start items-center`},Br={class:`text-sm font-bold`};function Vr(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`,Lr,[e(`div`,Rr,[e(`div`,zr,[e(`span`,Br,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 Hr=K(Ir,[[`render`,Vr],[`__scopeId`,`data-v-630c4521`]]),Ur=v({name:`MotionPromptInput`,components:{ElInput:xe,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})}}}}),Wr={class:`field`},Gr={class:`box`},Kr={class:`title font-bold`};function qr(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input`);return g(),s(`div`,Wr,[e(`div`,Gr,[e(`h2`,Kr,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 Jr=K(Ur,[[`render`,qr],[`__scopeId`,`data-v-ca9fdbe5`]]),Yr=`video`,Xr=v({name:`CharacterOrientationSelector`,components:{ElRadioGroup:k,ElRadioButton:O,InfoIcon:F},computed:{value:{get(){return this.$store.state.kling?.motionConfig?.character_orientation||Yr},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=Yr)}}),Zr={class:`field`},Qr={class:`header`},$r={class:`text-sm font-bold`};function ei(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`,Zr,[e(`div`,Qr,[e(`span`,$r,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 ti=K(Xr,[[`render`,ei],[`__scopeId`,`data-v-7a91195b`]]),ni=`kling-v2-6`,ri=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||ni},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=ni)}}),ii={class:`field`},ai={class:`header`},oi={class:`title font-bold`};function si(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,ii,[e(`div`,ai,[e(`h2`,oi,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 ci=K(ri,[[`render`,si],[`__scopeId`,`data-v-480e8da2`]]),li=`std`,ui=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||li},set(e){this.$store.commit(`kling/setMotionConfig`,{...this.$store.state.kling?.motionConfig,mode:e})}}},mounted(){this.$store.state.kling?.motionConfig?.mode||(this.value=li)}}),di={class:`field`},fi={class:`header`},pi={class:`title font-bold`};function mi(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,di,[e(`div`,fi,[e(`h2`,pi,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 hi=K(ui,[[`render`,mi],[`__scopeId`,`data-v-1295688c`]]),gi=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`})}}}}),_i={class:`relative`},vi={class:`flex justify-between items-center`},yi={class:`flex justify-start items-center`},bi={class:`text-sm font-bold`};function xi(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,_i,[e(`div`,vi,[e(`div`,yi,[e(`span`,bi,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 Si=v({name:`MotionPanel`,components:{MagicIcon:L,ElButton:B,ServicePricingSummary:Ne,MotionImage:Fr,MotionVideo:Hr,MotionPromptInput:Jr,CharacterOrientationSelector:ti,MotionModelSelector:ci,MotionModeSelector:hi,KeepOriginalSoundSelector:K(gi,[[`render`,xi]])},emits:[`generate`],computed:{motionConfig(){return this.$store.state.kling?.motionConfig},consumption(){return W({...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`)}}}),Ci={class:`flex flex-col h-full`},wi={class:`flex-1 overflow-y-auto p-5`},Ti={class:`flex flex-col items-center justify-center px-5 pb-5`};function Ei(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`,Ci,[e(`div`,wi,[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`,Ti,[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 Di=K(Si,[[`render`,Ei]]),Oi=v({name:`KlingTabSwitcher`,components:{ElTabs:x,ElTabPane:S,ElTag:_e},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)}}}),ki=[`title`],Ai={class:`text`};function ji(t,n,a,u,d,m){let _=l(`el-tag`),v=l(`el-tab-pane`),y=l(`el-tabs`);return g(),f(y,{"model-value":t.modelValue,class:`kling-tabs scenario-tabs scenario-tabs--divided`,"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`,Ai,i(t.label),1),t.badge?(g(),f(_,{key:0,size:`small`,type:`warning`,class:`badge`},{default:p(()=>[r(i(t.badge),1)]),_:2},1024)):o(``,!0)],8,ki)]),_:2},1032,[`name`,`disabled`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var Mi=K(Oi,[[`render`,ji],[`__scopeId`,`data-v-e6a2bb26`]]),Ni={"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`},Pi=v({name:`TalkingPhotoModelSelector`,components:{ElSelect:y,ElOption:b},data(){return{options:fe.map(e=>({value:e,label:Ni[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)}}),Fi={class:`field`},Ii={class:`title font-bold`};function Li(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Fi,[e(`h2`,Ii,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 Ri=K(Pi,[[`render`,Li],[`__scopeId`,`data-v-cbc83d11`]]),zi=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`)}}),Bi={class:`field`},Vi={class:`title font-bold`};function Hi(t,n,r,o,u,d){let m=l(`el-option`),_=l(`el-select`);return g(),s(`div`,Bi,[e(`h2`,Vi,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 Ui=v({name:`TalkingPhotoPanel`,components:{MagicIcon:L,UploadIcon:I,ElUpload:C,ElButton:B,ElInput:xe,ServicePricingSummary:Ne,InfoIcon:F,ImagePreview:Z,ModelSelector:Ri,ModeSelector:K(zi,[[`render`,Hi],[`__scopeId`,`data-v-92525a1d`]]),ScenarioPaymentMode:Le},mixins:[z,he],emits:[`generate`],data(){return{imageFiles:[],audioFiles:[],uploadUrl:J()+`/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 W({...this.config,action:`talking-photo`},this.service?.cost)},canGenerate(){return!!(this.config.image_url&&this.config.audio_url)},walletMode(){return U()&&X(`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=X(`kling`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await V.quoteTalkingPhoto(ye(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`)}}}),Wi={class:`flex flex-col h-full`},Gi={class:`flex-1 overflow-y-auto p-5`},Ki={class:`relative mb-4`},qi={class:`flex justify-start items-center`},Ji={class:`text-sm font-bold`},Yi={class:`relative mb-4`},Xi={class:`flex justify-start items-center`},Zi={class:`text-sm font-bold`},Qi=[`src`],$i={class:`mb-4`},ea={class:`flex justify-start items-center`},ta={class:`text-sm font-bold`},na={class:`flex flex-col items-center justify-center px-5 pb-5`};function ra(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`,Wi,[e(`div`,Gi,[a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),e(`div`,Ki,[e(`div`,qi,[e(`span`,Ji,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`,Yi,[e(`div`,Xi,[e(`span`,Zi,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,Qi)):o(``,!0)]),e(`div`,$i,[e(`div`,ea,[e(`span`,ta,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`,na,[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 ia=K(Ui,[[`render`,ra],[`__scopeId`,`data-v-46191f92`]]),aa=v({name:`TaskPreview`,components:{DeleteIcon:ce,ChannelIcon:re,InfoIcon:oe,MagicIcon:L,TimeIcon:P,WarningIcon:le,CopyToClipboard:ke,ElAlert:T,VideoPlayer:Fe,ElTooltip:w,ElButton:B,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 G.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`)}}}),oa={class:`preview`},sa={class:`left`},ca={class:`main`},la={class:`bot`},ua={class:`datetime`},da=[`aria-label`],fa={key:0,class:`info`},pa={key:0,class:`request-media flex justify-start items-center gap-2 w-full overflow-x-auto`},ma={key:1,class:`prompt`},ha={key:0},ga={key:1},_a={key:1,class:n({content:!0,failed:!0})},va={key:0,class:`mb-4`},ya={key:1,class:n({operations:!0,"mt-2":!0})},ba={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},xa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Sa={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Ca={key:2,class:n({content:!0})},wa={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ta={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ea={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Da={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Oa={key:3,class:n({content:!0})},ka={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Aa={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function ja(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`),F=l(`info-icon`);return g(),s(`div`,oa,[e(`div`,sa,[a(y,{capability:`kling`,part:`avatar`,class:`avatar`})]),e(`div`,ca,[e(`div`,la,[a(y,{capability:`kling`,part:`name`}),e(`span`,ua,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,da)):o(``,!0)]),_:1},8,[`content`])]),n.referenceImages.length>0||n.referenceVideos.length>0||n.referenceAudios.length>0||n.displayText?(g(),s(`div`,fa,[n.referenceImages.length>0||n.referenceVideos.length>0||n.referenceAudios.length>0?(g(),s(`div`,pa,[(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`,ma,[r(i(n.displayText)+` `,1),n.modelValue?.response?n.isWaiting?(g(),s(`span`,ga,` - (`+i(n.$t(`kling.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,ha,` - (`+i(n.$t(`kling.status.pending`))+`) `,1))])):o(``,!0)])):o(``,!0),n.modelValue?.response?.success===!0&&!n.isFailure?(g(),s(`div`,_a,[n.modelValue?.response.video_url?(g(),s(`div`,va,[a(T,{src:n.modelValue?.response.video_url},null,8,[`src`])])):o(``,!0),n.modelValue?.response.success?(g(),s(`div`,ya,[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`,ba,[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`,xa,[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`,Sa,[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`,Ca,[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`,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`])]),e(`p`,Ta,[a(F,{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`,Ea,[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`,Da,[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`,Oa,[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`,ka,[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`,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)])])}var Ma=v({name:`RecentPanel`,components:{TaskPreview:K(aa,[[`render`,ja],[`__scopeId`,`data-v-73637147`]]),NoTasks:ne,BotPlaceholder:ze,ScrollList:te},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?.()}}}),Na={key:0},Pa={key:2,class:`w-full h-full flex items-center justify-center`};function Fa(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`,Na,[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`,Pa,[a(v)])):o(``,!0)],64)}var Ia=v({name:`KlingIndex`,components:{ConfigPanel:Or,MotionPanel:Di,TalkingPhotoPanel:ia,TabSwitcher:Mi,Layout:qe,RecentPanel:K(Ma,[[`render`,Fa]]),ShowcaseResultTabs:Be},mixins:[Te,Ve(`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`&&U()&&X(`kling`).mode===`wallet`}},watch:{taskType:{handler(e){pe(`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.onGetTasks,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.onGetTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ie({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(){if(!be(this.uploadTracker,e=>this.$t(e),e=>D.warning(e)))return;let e=me(this.config),t=Number(!!e.start_image_url)+Number(!!e.end_image_url),n=e.image_list?.length||0,r=e.video_list?.length?4:7;if(t+n>r){D.warning(this.$t(`kling.message.referenceImagesTotalLimit`,{count:r}));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 i=this.createPaymentOperation(t=>V.generate(e,t));i&&(D.info(this.$t(`kling.message.startingTask`)),H(`kling`,i).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(!ve())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 Ee||ge(e,`kling`)||(this.walletMode?D.error(`${this.$t(`common.x402Scenario.paymentFailed`)} ${e?.message||``}`.trim()):D.error(this.$t(`kling.message.startTaskFailed`)))},getWalletContext(){return Oe(this.$wallet)},async confirmWalletPayment(e){return G.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(!be(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(!ve())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}D.info(this.$t(`kling.message.startingTask`)),H(`kling`,V.motion(t,{token:n})).then(()=>{D.success(this.$t(`kling.message.startTaskSuccess`))}).catch(e=>{ge(e,`kling`)||D.error(this.$t(`kling.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},async onGenerateTalkingPhoto(){if(!be(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=ye(e),n=this.createPaymentOperation(e=>V.talkingPhoto(t,e));n&&(D.info(this.$t(`kling.message.startingTask`)),H(`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)}))}}}),La={class:`flex flex-col h-full`},Ra={class:`flex-1 min-h-0`};function za(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`,La,[a(u,{"model-value":t.taskType,"onUpdate:modelValue":t.onTabChange},null,8,[`model-value`,`onUpdate:modelValue`]),e(`div`,Ra,[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 Ba=K(Ia,[[`render`,za]]);export{Ba as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
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,ot as h,rt as g,st as _,tt as v,z as y}from"./vendor-chart-Dw-P17PN.js";import{t as b}from"./upload-CO2xuaQ0.js";import{h as x,v as S}from"./models-Cmo-VT-F.js";import{t as C}from"./checkbox-DXMDpaxv.js";import{t as w}from"./drawer-DfXjJO_e.js";import{n as T,r as E,t as D}from"./dropdown-BpnvvhZD.js";import{t as O}from"./popover-BKaxFwwA.js";import{n as ee,t as te}from"./skeleton-Dj_a_iIP.js";import{t as ne}from"./arrow-right-D4rwO_Au.js";import{t as k}from"./arrow-up-q-iszS2P.js";import{t as re}from"./brain-Bbp_3Dru.js";import{t as A}from"./check-CdRY2Yxz.js";import{t as ie}from"./chevron-down-DMT83zNF.js";import{t as ae}from"./clipboard-list-Xa_o-zx1.js";import{t as j}from"./code-CEYwJp_3.js";import{t as M}from"./ellipsis-DyGBlldp.js";import{t as oe}from"./eye-D6VMAzQ5.js";import{t as se}from"./file-text-CY325CGw.js";import{t as N}from"./file-BZUguXKs.js";import{t as ce}from"./folder-B0brS6QN.js";import{t as P}from"./gauge-CRZ3LNGr.js";import{t as F}from"./history-DStvHsoa.js";import{t as I}from"./info-Dy6jE77P.js";import{t as L}from"./laptop-6SsyRulE.js";import{t as R}from"./link-Dg9RgZiI.js";import{t as z}from"./loader-circle-BhLoljYa.js";import{t as le}from"./mic-D442HlCF.js";import{t as ue}from"./monitor-BjV4HoYF.js";import{t as B}from"./paperclip-B5A5e-4V.js";import{t as V}from"./pencil-Csq6-6cZ.js";import{t as H}from"./plus-BtFEhIIv.js";import{t as U}from"./rotate-cw-quVDw14L.js";import{t as de}from"./search-BR43rWRH.js";import{t as fe}from"./shield-CWWgzv3X.js";import{t as pe}from"./square-DEbbYmWP.js";import{t as me}from"./terminal-Cf4HqLmD.js";import{t as he}from"./trash-2-C8cED3lx.js";import"./constants-D0qyO-4p.js";import{H as ge,M as _e}from"./i18n-Cju75xJ-.js";import{Aa as W,Ra as G,Sn as ve,ga as ye,ha as K,k as q,ma as J,nt as be,pa as xe,tt as Se,xa as Y,yn as Ce}from"./index-C2sgIqPl.js";import"./vendor-highlight-BHrfT4-E.js";import{t as we}from"./CopyToClipboard-DwP8EnVL.js";import{t as Te}from"./VueMarkdown-CiiRjbWs.js";import{t as Ee}from"./AskUserQuestionCard-Djy0TI7n.js";import{s as De,t as Oe}from"./codingBridgeNotify-DONT7Ns0.js";import{t as ke}from"./CodeSnippet-CcScns9G.js";var Ae=K(`bell-off`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]),je=K(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),Me=K(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Ne=y({name:`CodingBridgeNotificationToggle`,components:{LoadingIcon:z,NotificationIcon:je,NotificationOffIcon:Ae,ElButton:W},data(){return{enabled:!1,busy:!1}},computed:{supported(){return _e()||De()}},mounted(){this.enabled=!_e()&&Oe()===`granted`},methods:{async onToggle(){this.busy=!0;try{if(this.enabled){await this.$store.dispatch(`codingBridge/disableNotifications`),this.enabled=!1,S.success(this.$t(`codingBridge.notify.disabled`));return}let e=await this.$store.dispatch(`codingBridge/enableNotifications`);e===`enabled`?(this.enabled=!0,S.success(this.$t(`codingBridge.notify.enabled`))):e===`denied`?S.warning(this.$t(`codingBridge.notify.denied`)):S.warning(this.$t(`codingBridge.notify.unsupported`))}catch{S.error(this.$t(`codingBridge.notify.failed`))}finally{this.busy=!1}}}});function Pe(e,t,n,r,i,a){let s=u(`loading-icon`),c=u(`notification-icon`),l=u(`notification-off-icon`),d=u(`el-button`);return e.supported?(v(),p(d,{key:0,circle:``,size:`small`,type:e.enabled?`primary`:`default`,title:e.enabled?e.$t(`codingBridge.notify.disable`):e.$t(`codingBridge.notify.enable`),disabled:e.busy,"aria-label":e.enabled?e.$t(`codingBridge.notify.disable`):e.$t(`codingBridge.notify.enable`),onClick:e.onToggle},{default:m(()=>[e.busy?(v(),p(s,{key:0,class:`adc-icon-spin`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):e.enabled?(v(),p(c,{key:1,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(v(),p(l,{key:2,size:`1em`,"aria-hidden":`true`,focusable:`false`}))]),_:1},8,[`type`,`title`,`disabled`,`aria-label`,`onClick`])):o(``,!0)}var Fe=y({name:`CodingBridgeNodeList`,components:{AddIcon:H,DeleteIcon:he,DesktopIcon:ue,DeveloperIcon:L,EditIcon:V,RedoIcon:U,ElButton:W,NotificationToggle:q(Ne,[[`render`,Pe]])},emits:[`pair`],computed:{nodes(){return this.$store.state.codingBridge?.nodes??[]},currentNodeId(){return this.$store.state.codingBridge?.currentNodeId},connection(){return this.$store.state.codingBridge?.connection??`disconnected`},connectionLabel(){return this.$t(`codingBridge.connection.${this.connection}`)},connectionDotClass(){switch(this.connection){case`connected`:return`bg-[var(--el-color-success)]`;case`connecting`:return`bg-[var(--el-color-warning)]`;case`error`:return`bg-[var(--el-color-danger)]`;default:return`bg-[var(--app-text-subtle)]`}}},methods:{onSelect(e){this.$store.dispatch(`codingBridge/selectNode`,e)},onRefresh(){this.$store.dispatch(`codingBridge/getNodes`)},async onRename(e){let t;try{t=((await ye.prompt(this.$t(`codingBridge.nodeList.renamePrompt`),this.$t(`codingBridge.nodeList.rename`),{confirmButtonText:this.$t(`common.button.confirm`),cancelButtonText:this.$t(`common.button.cancel`),inputValue:e.name,inputValidator:e=>{let t=(e??``).trim();return t?[...t].length>64?this.$t(`codingBridge.nodeList.renameTooLong`,{max:64}):!0:this.$t(`codingBridge.nodeList.renameEmpty`)}})).value??``).trim()}catch{return}if(!(!t||t===e.name))try{await this.$store.dispatch(`codingBridge/renameNode`,{nodeId:e.node_id,name:t}),S.success(this.$t(`codingBridge.nodeList.renameSuccess`))}catch{S.error(this.$t(`codingBridge.nodeList.renameFailed`))}},async onDelete(e){try{await ye.confirm(this.$t(`codingBridge.nodeList.removeConfirm`,{name:e.name}),this.$t(`codingBridge.nodeList.remove`),{confirmButtonText:this.$t(`codingBridge.nodeList.remove`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`})}catch{return}try{await this.$store.dispatch(`codingBridge/deleteNode`,e.node_id),S.success(this.$t(`codingBridge.nodeList.removeSuccess`))}catch{S.error(this.$t(`codingBridge.nodeList.removeFailed`))}}}}),Ie={class:`node-list flex flex-col h-full bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Le={class:`flex items-center justify-between px-4 py-3 border-b border-[var(--app-border-subtle)]`},Re={class:`flex items-center gap-2 font-medium`},ze={class:`flex items-center gap-1`},Be={class:`flex items-center gap-2 px-4 py-2 text-xs border-b border-[var(--app-border-subtle)]`},Ve={class:`text-[var(--app-text-subtle)]`},He={class:`flex-1 overflow-y-auto`},Ue={key:0,class:`p-6 text-center text-sm text-[var(--app-text-subtle)]`},We={class:`mb-3`},Ge={key:1,class:`list-none m-0 p-0`},Ke=[`onClick`],qe={class:`flex-1 min-w-0`},Je={class:`flex items-center gap-2`},Ye={class:`truncate font-medium`},Xe=[`title`],Ze={class:`text-xs text-[var(--app-text-subtle)] truncate`};function Qe(o,c,d,f,p,h){let _=u(`developer-icon`),y=u(`notification-toggle`),b=u(`redo-icon`),x=u(`el-button`),S=u(`add-icon`),C=u(`desktop-icon`),w=u(`edit-icon`),T=u(`delete-icon`);return v(),s(`div`,Ie,[e(`div`,Le,[e(`div`,Re,[a(_,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,i(o.$t(`codingBridge.nodeList.title`)),1)]),e(`div`,ze,[a(y),a(x,{circle:``,size:`small`,"aria-label":o.$t(`codingBridge.nodeList.refresh`),title:o.$t(`codingBridge.nodeList.refresh`),onClick:o.onRefresh},{default:m(()=>[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`,`onClick`]),a(x,{type:`primary`,circle:``,size:`small`,"aria-label":o.$t(`codingBridge.nodeList.pair`),title:o.$t(`codingBridge.nodeList.pair`),onClick:c[0]||=e=>o.$emit(`pair`)},{default:m(()=>[a(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`])])]),e(`div`,Be,[e(`span`,{class:n([`inline-block w-2 h-2 rounded-full`,o.connectionDotClass])},null,2),e(`span`,Ve,i(o.connectionLabel),1)]),e(`div`,He,[o.nodes.length?(v(),s(`ul`,Ge,[(v(!0),s(l,null,g(o.nodes,r=>(v(),s(`li`,{key:r.node_id,class:n([`group flex items-center gap-3 px-4 py-3 cursor-pointer border-b border-[var(--app-border-subtle)] hover:bg-[var(--app-content-bg)]`,{"bg-[var(--app-content-bg)]":r.node_id===o.currentNodeId}]),onClick:e=>o.onSelect(r.node_id)},[a(C,{class:`text-[var(--app-text-subtle)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`div`,qe,[e(`div`,Je,[e(`span`,Ye,i(r.name),1),e(`span`,{class:n([`inline-block w-2 h-2 rounded-full flex-none`,r.status===`online`?`bg-[var(--el-color-success)]`:`bg-[var(--app-text-subtle)]`]),title:r.status===`online`?o.$t(`codingBridge.status.online`):o.$t(`codingBridge.status.offline`)},null,10,Xe)]),e(`div`,Ze,i(r.status===`online`?o.$t(`codingBridge.status.online`):o.$t(`codingBridge.status.offline`)),1)]),a(x,{class:`node-action`,text:``,circle:``,size:`small`,"aria-label":o.$t(`codingBridge.nodeList.rename`),title:o.$t(`codingBridge.nodeList.rename`),onClick:t(e=>o.onRename(r),[`stop`])},{default:m(()=>[a(w,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`,`onClick`]),a(x,{class:`node-action`,text:``,circle:``,size:`small`,"aria-label":o.$t(`codingBridge.nodeList.remove`),title:o.$t(`codingBridge.nodeList.remove`),onClick:t(e=>o.onDelete(r),[`stop`])},{default:m(()=>[a(T,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`,`onClick`])],10,Ke))),128))])):(v(),s(`div`,Ue,[e(`p`,We,i(o.$t(`codingBridge.nodeList.empty`)),1),a(x,{type:`primary`,round:``,size:`small`,onClick:c[1]||=e=>o.$emit(`pair`)},{default:m(()=>[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(o.$t(`codingBridge.nodeList.pairFirst`)),1)]),_:1})]))])])}var $e=q(Fe,[[`render`,Qe],[`__scopeId`,`data-v-37e3f542`]]),et=e=>{let t=e?.questions;return Array.isArray(t)&&t.length>0&&t.every(e=>e&&typeof e.question==`string`&&Array.isArray(e.options))},tt=e=>e?(e.tool||``).toLowerCase()===`askuserquestion`?!0:et(e.input):!1,nt=e=>({questions:e.input?.questions??[]}),rt=100,X=4e4,it=12e3,at=6e3,ot=50,st=200,Z=(e,t)=>{if(e.length<=t)return e;let n=((e.length-t)/1024).toFixed(1);return`${e.slice(0,t)}\n\n··· +${n} KB ···`},ct=y({name:`CodingBridgeTranscriptItem`,directives:{highlight:ve},components:{CloseIcon:J,ConfirmIcon:A,EditIcon:V,FileIcon:N,InfoIcon:I,VueMarkdown:Te,CodeSnippet:ke,CopyToClipboard:we},props:{event:{type:Object,required:!0},editable:{type:Boolean,default:!1}},emits:[`edit`],data(){return{renderedText:Z(this.event.text||``,X),streamTimer:0}},computed:{commandText(){let e=this.event.input;if(!e)return``;for(let t of[`command`,`cmd`,`script`]){let n=e[t];if(typeof n==`string`&&n.trim())return Z(n,at)}return``},filePath(){let e=this.event.input;if(!e)return``;for(let t of[`file_path`,`filePath`,`path`,`notebook_path`,`filename`]){let n=e[t];if(typeof n==`string`&&n.trim())return n}return``},toolDescription(){let e=this.event.input?.description;return typeof e==`string`?e:``},toolIcon(){if(this.todoList.length)return ae;if(this.commandText)return me;let e=(this.event.tool??``).toLowerCase();return/read|cat|view/.test(e)?se:/write|edit|create|update|insert/.test(e)?V:/grep|glob|search|find|list/.test(e)?de:j},questionLines(){let e=(this.event.tool??``).toLowerCase(),t=this.event.input?.questions;return!(e===`askuserquestion`||Array.isArray(t))||!Array.isArray(t)?[]:t.filter(e=>e&&typeof e.question==`string`).map(e=>({header:typeof e.header==`string`?e.header:``,question:e.question}))},todoList(){let e=this.event.input?.todos;return!Array.isArray(e)||!(this.event.tool??``).toLowerCase().includes(`todo`)&&Object.keys(this.event.input??{}).filter(e=>e!==`todos`&&e!==`description`).length?[]:e.filter(e=>e&&typeof e.content==`string`).map(e=>({content:e.content,status:typeof e.status==`string`?e.status:`pending`,activeForm:typeof e.activeForm==`string`?e.activeForm:void 0}))},todoItems(){return this.todoList.slice(0,ot).map(e=>{let t=e.status===`in_progress`&&e.activeForm?e.activeForm:e.content,n=t.length>st?`${t.slice(0,st)}…`:t;return e.status===`completed`?{text:n,status:`completed`,statusLabel:this.$t(`codingBridge.transcript.todoCompleted`),icon:A,iconClass:`text-[var(--el-color-success)]`,textClass:`text-[var(--app-text-subtle)] line-through`}:e.status===`in_progress`?{text:n,status:`in_progress`,statusLabel:this.$t(`codingBridge.transcript.todoInProgress`),icon:z,iconClass:`text-[var(--el-color-primary)]`,textClass:`text-[var(--app-text)] font-medium`}:{text:n,status:`pending`,statusLabel:this.$t(`codingBridge.transcript.todoPending`),icon:pe,iconClass:`text-[var(--app-text-subtle)] opacity-60`,textClass:`text-[var(--app-text-subtle)]`}})},todoProgressLabel(){let e=this.todoList.filter(e=>e.status===`completed`).length;return this.$t(`codingBridge.transcript.todoProgress`,{done:e,total:this.todoList.length})},todoProgressId(){return`cb-todo-progress-${this.event.id}`},todoOverflow(){return Math.max(0,this.todoList.length-ot)},inputText(){let e=this.event.input;if(!e)return``;let t={};for(let[n,r]of Object.entries(e))n===`timeout`||n===`description`||(t[n]=r);if(Object.keys(t).length===0)return``;try{return Z(JSON.stringify(t,null,2),at)}catch{return Z(String(e),at)}},thinkingText(){return Z(this.event.text||``,X)},resultText(){let e=this.event.content;return typeof e==`string`&&e.length>0?e:`—`},resultDisplay(){return Z(this.resultText,it)},resultLabel(){let e=[];return this.event.is_error?e.push(this.$t(`codingBridge.transcript.turnFailed`)):e.push(this.$t(`codingBridge.transcript.turnDone`)),typeof this.event.cost_usd==`number`&&this.event.cost_usd>0&&e.push(`$${this.event.cost_usd.toFixed(4)}`),e.join(` · `)},hasAttachments(){return!!this.event.attachments?.length},noticeText(){let e=this.event.subtype,t=this.event.command;if(t){if(e===`slash_unavailable`)return this.$t(`codingBridge.notice.slashUnavailable`,{command:t});if(e===`slash_codex_unsupported`)return this.$t(`codingBridge.notice.slashCodexUnsupported`,{command:t})}return this.event.text||``}},watch:{"event.text"(){this.scheduleRender()},"event.streaming"(e){e||this.flushRender()}},beforeUnmount(){this.streamTimer&&window.clearTimeout(this.streamTimer)},methods:{scheduleRender(){if(!this.event.streaming){this.flushRender();return}this.streamTimer||=window.setTimeout(()=>{this.streamTimer=0,this.renderedText=Z(this.event.text||``,X)},rt)},flushRender(){this.streamTimer&&=(window.clearTimeout(this.streamTimer),0),this.renderedText=Z(this.event.text||``,X)}}}),lt={key:0,class:`group flex items-end justify-end gap-1.5`},ut=[`title`,`aria-label`],dt={class:`max-w-[85%] rounded-lg px-3 py-2 bg-[var(--el-color-primary)] text-white whitespace-pre-wrap break-words`},ft=[`src`],pt=[`href`],mt=[`src`],ht={key:1,class:`flex h-9 w-9 items-center justify-center rounded bg-white/15`},gt={class:`min-w-0 truncate`},_t={key:2},vt={key:2,class:`whitespace-pre-wrap break-words italic text-[var(--app-text-subtle)] border-l-2 border-[var(--app-border-subtle)] pl-3`},yt={key:3,class:`overflow-hidden rounded-md bg-[var(--app-sidebar-bg)] border border-[var(--app-border-subtle)]`},bt={class:`flex items-center gap-2 px-2.5 py-1.5 font-medium text-[var(--app-text-subtle)]`},xt={key:0,class:`min-w-0 truncate text-xs font-normal opacity-70`},St={key:0,class:`flex flex-col gap-1.5 px-2.5 pb-2`},Ct={key:0,class:`font-medium text-[var(--app-text)]`},wt={class:`whitespace-pre-wrap break-words text-[var(--app-text-subtle)]`},Tt={key:1,class:`px-2.5 pb-2`},Et=[`id`],Dt=[`aria-labelledby`],Ot={class:`sr-only`},kt={key:0,class:`mt-1 text-xs text-[var(--app-text-subtle)]`},At={key:2,class:`px-2.5 pb-2`},jt={key:3,class:`px-2.5 pb-2 font-mono text-xs break-all text-[var(--app-text-subtle)]`},Mt={key:4,class:`px-2.5 pb-2`},Nt={key:0,class:`absolute right-1.5 top-1.5 z-10 rounded bg-[var(--app-content-bg)] px-1 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100`},Pt={key:5,class:`flex items-center gap-2 text-xs text-[var(--app-text-subtle)]`},Ft={key:6,class:`flex items-start gap-2 rounded-md bg-[var(--app-sidebar-bg)] border border-[var(--app-border-subtle)] text-[var(--app-text-subtle)] px-3 py-2 text-xs`},It={class:`whitespace-pre-wrap break-words`},Lt={key:7,class:`rounded-md bg-[var(--el-color-danger-light-9)] text-[var(--el-color-danger)] px-3 py-2 whitespace-pre-wrap break-words`};function Rt(t,r,c,f,m,y){let b=u(`edit-icon`),x=u(`file-icon`),S=u(`vue-markdown`),C=u(`code-snippet`),w=u(`copy-to-clipboard`),T=u(`close-icon`),E=u(`confirm-icon`),D=u(`info-icon`),O=h(`highlight`);return v(),s(`div`,{class:n([`transcript-item text-sm leading-relaxed`,`kind-${t.event.kind}`])},[t.event.kind===`prompt`?(v(),s(`div`,lt,[t.editable?(v(),s(`button`,{key:0,type:`button`,class:`cb-edit-btn opacity-0 transition-opacity group-hover:opacity-100 focus-visible:opacity-100`,title:t.$t(`codingBridge.session.editPrompt`),"aria-label":t.$t(`codingBridge.session.editPrompt`),onClick:r[0]||=e=>t.$emit(`edit`,t.event)},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,ut)):o(``,!0),e(`div`,dt,[t.event.images&&t.event.images.length?(v(),s(`div`,{key:0,class:n([`flex flex-wrap gap-1.5`,{"mb-1.5":t.event.text||t.hasAttachments}])},[(v(!0),s(l,null,g(t.event.images,(e,t)=>(v(),s(`img`,{key:t,src:e,class:`w-16 h-16 rounded object-cover`,alt:``},null,8,ft))),128))],2)):o(``,!0),t.hasAttachments?(v(),s(`div`,{key:1,class:n([`flex flex-wrap gap-1.5`,{"mb-1.5":t.event.text}])},[(v(!0),s(l,null,g(t.event.attachments,(t,n)=>(v(),s(`a`,{key:`${t.url}-${n}`,href:t.url,target:`_blank`,rel:`noopener noreferrer`,class:`flex max-w-[220px] items-center gap-2 rounded-md bg-white/15 px-2 py-1.5 text-xs text-white hover:bg-white/20`},[t.type===`image`?(v(),s(`img`,{key:0,src:t.url,class:`h-9 w-9 rounded object-cover`,alt:``},null,8,mt)):(v(),s(`span`,ht,[a(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})])),e(`span`,gt,i(t.name||t.url),1)],8,pt))),128))],2)):o(``,!0),t.event.text?(v(),s(`span`,_t,i(t.event.text),1)):o(``,!0)])])):t.event.kind===`text`?(v(),s(`div`,{key:1,class:n([`cb-stream-text`,{"is-streaming":t.event.streaming}])},[d(a(S,{source:t.renderedText,class:`markdown-body bg-transparent text-[var(--app-text)]`},null,8,[`source`]),[[O]])],2)):t.event.kind===`thinking`?(v(),s(`div`,vt,i(t.thinkingText),1)):t.event.kind===`tool_use`?(v(),s(`div`,yt,[e(`div`,bt,[(v(),p(_(t.toolIcon),{class:`text-[var(--el-color-primary)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,null,i(t.event.tool),1),t.toolDescription?(v(),s(`span`,xt,i(t.toolDescription),1)):o(``,!0)]),t.questionLines.length?(v(),s(`div`,St,[(v(!0),s(l,null,g(t.questionLines,(t,n)=>(v(),s(`div`,{key:n,class:`rounded border border-[var(--app-border-subtle)] bg-[var(--app-content-bg)] px-2.5 py-1.5 text-xs`},[t.header?(v(),s(`div`,Ct,i(t.header),1)):o(``,!0),e(`div`,wt,i(t.question),1)]))),128))])):t.todoItems.length?(v(),s(`div`,Tt,[e(`div`,{id:t.todoProgressId,class:`mb-1.5 text-xs text-[var(--app-text-subtle)]`},i(t.todoProgressLabel),9,Et),e(`ul`,{class:`flex flex-col gap-1`,"aria-labelledby":t.todoProgressId},[(v(!0),s(l,null,g(t.todoItems,(t,r)=>(v(),s(`li`,{key:r,class:`flex items-start gap-2 text-xs`},[(v(),p(_(t.icon),{class:n([`mt-0.5 flex-none`,t.iconClass]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`])),e(`span`,Ot,i(t.statusLabel),1),e(`span`,{class:n([`min-w-0 break-words`,t.textClass])},i(t.text),3)]))),128))],8,Dt),t.todoOverflow?(v(),s(`div`,kt,i(t.$t(`codingBridge.transcript.todoOverflow`,{count:t.todoOverflow})),1)):o(``,!0)])):t.commandText?(v(),s(`div`,At,[a(C,{code:t.commandText,lang:`bash`,copyable:``},null,8,[`code`])])):t.filePath?(v(),s(`div`,jt,i(t.filePath),1)):t.inputText?(v(),s(`div`,Mt,[a(C,{code:t.inputText,lang:`json`,copyable:``},null,8,[`code`])])):o(``,!0)])):t.event.kind===`tool_result`?(v(),s(`div`,{key:4,class:n([`group relative overflow-hidden rounded-md`,t.event.is_error?`bg-[var(--el-color-danger-light-9)]`:`bg-[var(--app-sidebar-bg)]`])},[t.event.content?(v(),s(`div`,Nt,[a(w,{content:t.resultText},null,8,[`content`])])):o(``,!0),e(`pre`,{class:n([`m-0 max-h-72 overflow-auto whitespace-pre-wrap break-words px-2.5 py-2 font-mono text-xs`,t.event.is_error?`text-[var(--el-color-danger)]`:`text-[var(--app-text-subtle)]`])},i(t.resultDisplay),3)],2)):t.event.kind===`result`?(v(),s(`div`,Pt,[t.event.is_error?(v(),p(T,{key:0,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(v(),p(E,{key:1,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,null,i(t.resultLabel),1)])):t.event.kind===`notice`?(v(),s(`div`,Ft,[a(D,{class:`mt-0.5 flex-none text-[var(--el-color-primary)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,It,i(t.noticeText),1)])):t.event.kind===`error`?(v(),s(`div`,Lt,i(t.event.text),1)):o(``,!0)],2)}var zt=q(ct,[[`render`,Rt],[`__scopeId`,`data-v-f71fa078`]]),Bt=`Pondering.Noodling.Conjuring.Brewing.Cooking.Crafting.Churning.Simmering.Percolating.Ruminating.Musing.Marinating.Synthesizing.Computing.Hatching.Forging.Vibing.Working.Thinking.Cogitating.Mulling.Stewing.Tinkering.Wrangling.Spinning.Reticulating.Manifesting.Deliberating`.split(`.`),Vt=[`思考中`,`酝酿中`,`沉思中`,`推敲中`,`构思中`,`计算中`,`琢磨中`,`捣鼓中`,`炼制中`,`召唤中`,`编织中`,`烹饪中`,`咀嚼中`,`盘算中`,`发酵中`,`运转中`,`冥想中`,`鼓捣中`,`熬制中`,`神游中`,`演算中`,`雕琢中`,`头脑风暴中`,`反复斟酌中`],Ht=60,Ut=1500,Wt=28,Gt=y({name:`CodingBridgeThinkingIndicator`,components:{LoadingIcon:z},data(){return{display:``,elapsed:0,charIndex:0,phase:`typing`,currentWord:``,elapsedTimer:0,typeTimer:0}},computed:{words(){return this.$i18n.locale.startsWith(`zh`)?Vt:Bt}},mounted(){this.currentWord=this.pickWord(),this.elapsedTimer=window.setInterval(()=>{this.elapsed+=1},1e3),this.scheduleType(Ht)},beforeUnmount(){window.clearInterval(this.elapsedTimer),window.clearTimeout(this.typeTimer)},methods:{pickWord(){let e=this.words;if(e.length<=1)return e[0]??``;let t=this.currentWord;for(;t===this.currentWord;)t=e[Math.floor(Math.random()*e.length)];return t},scheduleType(e){this.typeTimer=window.setTimeout(this.advance,e)},advance(){let e=this.currentWord;this.phase===`typing`?(this.charIndex+=1,this.display=e.slice(0,this.charIndex),this.charIndex>=e.length?(this.phase=`holding`,this.scheduleType(Ut)):this.scheduleType(Ht)):this.phase===`holding`?(this.phase=`deleting`,this.scheduleType(Wt)):(--this.charIndex,this.display=e.slice(0,Math.max(0,this.charIndex)),this.charIndex<=0?(this.currentWord=this.pickWord(),this.phase=`typing`,this.scheduleType(Ht)):this.scheduleType(Wt))}}}),Kt={class:`cb-thinking flex items-center gap-2 text-sm text-[var(--app-text-subtle)] py-1`},qt={class:`cb-thinking__word`},Jt={class:`cb-thinking__elapsed tabular-nums opacity-60`};function Yt(t,n,o,c,l,d){let f=u(`loading-icon`);return v(),s(`div`,Kt,[a(f,{class:`cb-thinking__spinner adc-icon-spin text-[var(--el-color-primary)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,qt,[r(i(t.display),1),n[0]||=e(`span`,{class:`cb-thinking__caret`},`▋`,-1)]),e(`span`,Jt,`(`+i(t.elapsed)+`s)`,1)])}var Xt=q(Gt,[[`render`,Yt],[`__scopeId`,`data-v-ae116215`]]),Zt=y({name:`CodingBridgeComposerSettings`,components:{ElButton:W,ElDialog:Y},props:{dialog:{type:Boolean,default:!1},open:{type:Boolean,default:!1}},emits:[`update:open`]}),Qt={key:0,class:`cb-settings-inline`},$t={class:`cb-settings-rows`};function en(t,n,o,c,l,d){let h=u(`el-button`),g=u(`el-dialog`);return t.dialog?(v(),p(g,{key:1,"model-value":t.open,title:t.$t(`codingBridge.session.settings`),width:`min(420px, 92vw)`,"align-center":``,"append-to-body":``,class:`cb-settings-dialog`,"onUpdate:modelValue":n[1]||=e=>t.$emit(`update:open`,e)},{footer:m(()=>[a(h,{type:`primary`,round:``,onClick:n[0]||=e=>t.$emit(`update:open`,!1)},{default:m(()=>[r(i(t.$t(`common.button.close`)),1)]),_:1})]),default:m(()=>[e(`div`,$t,[f(t.$slots,`default`,{},void 0,!0)])]),_:3},8,[`model-value`,`title`])):(v(),s(`div`,Qt,[f(t.$slots,`default`,{},void 0,!0)]))}var tn=q(Zt,[[`render`,en],[`__scopeId`,`data-v-20aa7356`]]),nn=y({name:`CodingBridgeDirectoryDialog`,components:{ContinueIcon:ne,FileIcon:N,FolderIcon:ce,RedoIcon:U,UpIcon:k,ElDialog:Y,ElButton:W,ElInput:G},props:{visible:{type:Boolean,default:!1},initialPath:{type:String,default:``}},emits:[`update:visible`,`select`],data(){return{pathInput:``}},computed:{listing(){return this.$store.state.codingBridge?.directory},loading(){return this.$store.state.codingBridge?.directoryLoading===!0},directories(){return(this.listing?.entries??[]).filter(e=>e.type===`dir`)},files(){return(this.listing?.entries??[]).filter(e=>e.type===`file`)},isEmpty(){return!!this.listing&&!this.listing.error&&(this.listing.entries??[]).length===0}},watch:{"listing.path"(e){this.pathInput=e??``}},methods:{onOpen(){this.pathInput=this.initialPath||``,this.$store.dispatch(`codingBridge/browseDir`,this.initialPath||void 0)},goPath(){let e=this.pathInput.trim();e&&this.$store.dispatch(`codingBridge/browseDir`,e)},syncPathInput(){this.pathInput=this.listing?.path??``},onVisibleChange(e){this.$emit(`update:visible`,e),e||this.$store.dispatch(`codingBridge/clearDirectory`)},openDir(e){this.$store.dispatch(`codingBridge/browseDir`,e)},goParent(){this.listing?.parent&&this.$store.dispatch(`codingBridge/browseDir`,this.listing.parent)},refresh(){this.$store.dispatch(`codingBridge/browseDir`,this.listing?.path||this.initialPath||void 0)},chooseCurrent(){this.listing&&!this.listing.error&&(this.$emit(`select`,this.listing.path),this.onVisibleChange(!1))}}}),rn={class:`flex flex-col gap-2`},an={class:`flex items-center gap-2 min-w-0`},on={class:`h-72 overflow-y-auto border border-[var(--app-border-subtle)] rounded-md divide-y divide-[var(--app-border-subtle)]`},sn={key:0,class:`h-full flex items-center justify-center text-sm text-[var(--app-text-subtle)]`},cn={key:1,class:`h-full flex items-center justify-center text-sm text-[var(--el-color-danger)]`},ln=[`onClick`],un={class:`truncate`,dir:`ltr`},dn={class:`truncate`,dir:`ltr`},fn={key:0,class:`h-full flex items-center justify-center text-sm text-[var(--app-text-subtle)] py-8`},pn={key:0,class:`text-[11px] text-[var(--app-text-subtle)] px-1`},mn={class:`flex items-center justify-end gap-2`};function hn(t,d,f,h,_,y){let b=u(`up-icon`),x=u(`el-button`),S=u(`continue-icon`),C=u(`el-input`),w=u(`redo-icon`),T=u(`folder-icon`),E=u(`file-icon`),D=u(`el-dialog`);return v(),p(D,{"model-value":t.visible,title:t.$t(`codingBridge.directory.title`),width:`520px`,"append-to-body":``,"onUpdate:modelValue":t.onVisibleChange,onOpen:t.onOpen},{footer:m(()=>[e(`div`,mn,[a(x,{round:``,onClick:d[1]||=e=>t.onVisibleChange(!1)},{default:m(()=>[r(i(t.$t(`common.button.cancel`)),1)]),_:1}),a(x,{type:`primary`,round:``,disabled:!t.listing||!!t.listing.error,onClick:t.chooseCurrent},{default:m(()=>[r(i(t.$t(`codingBridge.directory.choose`)),1)]),_:1},8,[`disabled`,`onClick`])])]),default:m(()=>[e(`div`,rn,[e(`div`,an,[a(x,{size:`small`,circle:``,disabled:!t.listing||!t.listing.parent||t.loading,title:t.$t(`codingBridge.directory.up`),"aria-label":t.$t(`codingBridge.directory.up`),onClick:t.goParent},{default:m(()=>[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`disabled`,`title`,`aria-label`,`onClick`]),a(C,{modelValue:t.pathInput,"onUpdate:modelValue":d[0]||=e=>t.pathInput=e,size:`small`,class:`flex-1 min-w-0`,dir:`ltr`,placeholder:t.$t(`codingBridge.directory.pathPlaceholder`),disabled:t.loading,onKeyup:c(t.goPath,[`enter`]),onBlur:t.syncPathInput},{append:m(()=>[a(x,{title:t.$t(`codingBridge.directory.go`),disabled:t.loading||!t.pathInput.trim(),"aria-label":t.$t(`codingBridge.directory.go`),onClick:t.goPath},{default:m(()=>[a(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`title`,`disabled`,`aria-label`,`onClick`])]),_:1},8,[`modelValue`,`placeholder`,`disabled`,`onKeyup`,`onBlur`]),a(x,{size:`small`,circle:``,disabled:t.loading,title:t.$t(`codingBridge.directory.refresh`),"aria-label":t.$t(`codingBridge.directory.refresh`),onClick:t.refresh},{default:m(()=>[a(w,{class:n({"adc-icon-spin":t.loading}),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`])]),_:1},8,[`disabled`,`title`,`aria-label`,`onClick`])]),e(`div`,on,[t.loading&&!t.listing?(v(),s(`div`,sn,i(t.$t(`codingBridge.directory.loading`)),1)):t.listing&&t.listing.error?(v(),s(`div`,cn,i(t.listing.error),1)):(v(),s(l,{key:2},[(v(!0),s(l,null,g(t.directories,n=>(v(),s(`button`,{key:n.path,type:`button`,class:`w-full flex items-center gap-2 px-3 py-2 text-left text-sm hover:bg-[var(--app-content-hover-bg)]`,onClick:e=>t.openDir(n.path)},[a(T,{class:`text-[var(--el-color-warning)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,un,i(n.name),1)],8,ln))),128)),(v(!0),s(l,null,g(t.files,t=>(v(),s(`div`,{key:t.path,class:`w-full flex items-center gap-2 px-3 py-2 text-sm text-[var(--app-text-subtle)]`},[a(E,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,dn,i(t.name),1)]))),128)),t.isEmpty?(v(),s(`div`,fn,i(t.$t(`codingBridge.directory.empty`)),1)):o(``,!0)],64))]),t.listing&&t.listing.truncated?(v(),s(`p`,pn,i(t.$t(`codingBridge.directory.truncated`)),1)):o(``,!0)])]),_:1},8,[`model-value`,`title`,`onUpdate:modelValue`,`onOpen`])}var gn=q(nn,[[`render`,hn]]),_n=`data:image/svg+xml,%3csvg%20fill='%23D97757'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eClaude%3c/title%3e%3cpath%20d='m4.7144%2015.9555%204.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608%201.5179.1032%202.2767.1578%201.6514.0972%202.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973%209.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686%201.9064%201.4754%202.4893%201.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335%206.6997%200l.9957.1336.419.3642.6192%201.4147%201.0018%202.2282%201.5543%203.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853%201.8517-.5586%202.9021-.3643%201.9429h.2125l.2429-.2429.9835-1.3053%201.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759%201.1293-.34%201.1657-1.0625%201.3478-.8804%201.1414-1.2628%201.7-.7893%201.36.0729.1093.1882-.0183%202.8535-.607%201.5421-.2794%201.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607%201.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929%201.0686%202.0035%201.8092%202.5075%202.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496%202.3436%203.5214.1214%201.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38%2017.959l-1.1414-1.9428-.1397.079-.674%207.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328%201.9672-2.1796%202.9446-1.7243%201.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889%202.386-3.0357%201.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385%204.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429%201.9064-1.3114Z'/%3e%3c/svg%3e`,vn=`data:image/svg+xml,%3csvg%20fill='%23000000'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOpenAI%3c/title%3e%3cpath%20d='M22.282%209.821a5.985%205.985%200%200%200-.516-4.91%206.046%206.046%200%200%200-6.51-2.9A6.065%206.065%200%200%200%204.981%204.18a5.985%205.985%200%200%200-3.998%202.9%206.046%206.046%200%200%200%20.743%207.097%205.98%205.98%200%200%200%20.51%204.911%206.051%206.051%200%200%200%206.515%202.9A5.985%205.985%200%200%200%2013.26%2024a6.056%206.056%200%200%200%205.772-4.206%205.99%205.99%200%200%200%203.997-2.9%206.056%206.056%200%200%200-.747-7.073zM13.26%2022.43a4.476%204.476%200%200%201-2.876-1.04l.141-.081%204.779-2.758a.795.795%200%200%200%20.392-.681v-6.737l2.02%201.168a.071.071%200%200%201%20.038.052v5.583a4.504%204.504%200%200%201-4.494%204.494zM3.6%2018.304a4.47%204.47%200%200%201-.535-3.014l.142.085%204.783%202.759a.771.771%200%200%200%20.78%200l5.843-3.369v2.332a.08.08%200%200%201-.033.062L9.74%2019.95a4.5%204.5%200%200%201-6.14-1.646zM2.34%207.896a4.485%204.485%200%200%201%202.366-1.973V11.6a.766.766%200%200%200%20.388.676l5.815%203.355-2.02%201.168a.076.076%200%200%201-.071%200l-4.83-2.786A4.504%204.504%200%200%201%202.34%207.872zm16.597%203.855l-5.833-3.387L15.119%207.2a.076.076%200%200%201%20.071%200l4.83%202.791a4.494%204.494%200%200%201-.676%208.105v-5.678a.79.79%200%200%200-.407-.667zm2.01-3.023l-.141-.085-4.774-2.782a.776.776%200%200%200-.785%200L9.409%209.23V6.897a.066.066%200%200%201%20.028-.061l4.83-2.787a4.5%204.5%200%200%201%206.68%204.66zm-12.64%204.135l-2.02-1.164a.08.08%200%200%201-.038-.057V6.075a4.5%204.5%200%200%201%207.375-3.453l-.142.08L8.704%205.46a.795.795%200%200%200-.393.681zm1.097-2.365l2.602-1.5%202.607%201.5v2.999l-2.597%201.5-2.607-1.5z'/%3e%3c/svg%3e`,yn=`data:image/svg+xml,%3csvg%20fill='%23000'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGitHub%20Copilot%3c/title%3e%3cpath%20d='M23.922%2016.997C23.061%2018.492%2018.063%2022.02%2012%2022.02%205.937%2022.02.939%2018.492.078%2016.997A.641.641%200%200%201%200%2016.741v-2.869a.883.883%200%200%201%20.053-.22c.372-.935%201.347-2.292%202.605-2.656.167-.429.414-1.055.644-1.517a10.098%2010.098%200%200%201-.052-1.086c0-1.331.282-2.499%201.132-3.368.397-.406.89-.717%201.474-.952C7.255%202.937%209.248%201.98%2011.978%201.98c2.731%200%204.767.957%206.166%202.093.584.235%201.077.546%201.474.952.85.869%201.132%202.037%201.132%203.368%200%20.368-.014.733-.052%201.086.23.462.477%201.088.644%201.517%201.258.364%202.233%201.721%202.605%202.656a.841.841%200%200%201%20.053.22v2.869a.641.641%200%200%201-.078.256Zm-11.75-5.992h-.344a4.359%204.359%200%200%201-.355.508c-.77.947-1.918%201.492-3.508%201.492-1.725%200-2.989-.359-3.782-1.259a2.137%202.137%200%200%201-.085-.104L4%2011.746v6.585c1.435.779%204.514%202.179%208%202.179%203.486%200%206.565-1.4%208-2.179v-6.585l-.098-.104s-.033.045-.085.104c-.793.9-2.057%201.259-3.782%201.259-1.59%200-2.738-.545-3.508-1.492a4.359%204.359%200%200%201-.355-.508Zm2.328%203.25c.549%200%201%20.451%201%201v2c0%20.549-.451%201-1%201-.549%200-1-.451-1-1v-2c0-.549.451-1%201-1Zm-5%200c.549%200%201%20.451%201%201v2c0%20.549-.451%201-1%201-.549%200-1-.451-1-1v-2c0-.549.451-1%201-1Zm3.313-6.185c.136%201.057.403%201.913.878%202.497.442.544%201.134.938%202.344.938%201.573%200%202.292-.337%202.657-.751.384-.435.558-1.15.558-2.361%200-1.14-.243-1.847-.705-2.319-.477-.488-1.319-.862-2.824-1.025-1.487-.161-2.192.138-2.533.529-.269.307-.437.808-.438%201.578v.021c0%20.265.021.562.063.893Zm-1.626%200c.042-.331.063-.628.063-.894v-.02c-.001-.77-.169-1.271-.438-1.578-.341-.391-1.046-.69-2.533-.529-1.505.163-2.347.537-2.824%201.025-.462.472-.705%201.179-.705%202.319%200%201.211.175%201.926.558%202.361.365.414%201.084.751%202.657.751%201.21%200%201.902-.394%202.344-.938.475-.584.742-1.44.878-2.497Z'/%3e%3c/svg%3e`;function bn(e){let t=(e instanceof Error?`${e.name} ${e.message}`:String(e??``)).toLowerCase().replaceAll(`_`,`-`);return t.includes(`notallowed`)||t.includes(`not-allowed`)||t.includes(`permission`)?`permission-denied`:t.includes(`notfound`)||t.includes(`not-found`)||t.includes(`audio-capture`)||t.includes(`microphone`)?`microphone-unavailable`:t.includes(`network`)||t.includes(`fetch`)?`network`:t.includes(`abort`)||t.includes(`cancel`)?`aborted`:`unknown`}function xn(){return[`audio/webm;codecs=opus`,`audio/webm`,`audio/mp4`,`audio/ogg`].find(e=>MediaRecorder.isTypeSupported?.(e))}function Sn(e){return e.includes(`mp4`)?`m4a`:e.includes(`ogg`)?`ogg`:e.includes(`wav`)?`wav`:`webm`}async function Cn(e,t,n,r){let i=new FormData;i.append(`file`,new File([e],t,{type:e.type||`audio/webm`})),i.append(`model`,`gpt-transcribe`),i.append(`response_format`,`json`),n&&i.append(`language`,n);let a=await fetch(`${ge}/v1/audio/transcriptions`,{method:`POST`,headers:{Authorization:`Bearer ${r}`},body:i});if(!a.ok)throw Error(`transcription request failed (${a.status})`);return(await a.json()).text?.trim()??``}var wn=class{mediaDevices;createRecorder;transcribe;stream;recorder;callbacks;chunks=[];language=``;token=``;generation=0;aborted=!1;constructor(e=typeof navigator>`u`?void 0:navigator.mediaDevices,t=(e,t)=>new MediaRecorder(e,t),n=Cn){this.mediaDevices=e,this.createRecorder=t,this.transcribe=n}async isSupported(){return!!this.mediaDevices?.getUserMedia&&typeof MediaRecorder<`u`}async start(e,t,n){await this.abort();let r=++this.generation;this.callbacks=n,this.language=e,this.token=t,this.chunks=[],this.aborted=!1;try{let e=await this.mediaDevices?.getUserMedia({audio:{channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}});if(!e||r!==this.generation){e?.getTracks().forEach(e=>e.stop());return}this.stream=e;let t=xn();this.recorder=this.createRecorder(e,t?{mimeType:t}:void 0),this.recorder.ondataavailable=e=>{r===this.generation&&e.data.size>0&&this.chunks.push(e.data)},this.recorder.start()}catch(e){let t=bn(e);throw t!==`aborted`&&n.onError(t),await this.abort(),e}}async stop(){let e=this.recorder,t=this.generation;!e||e.state===`inactive`||!this.callbacks||await new Promise(n=>{e.onstop=async()=>{if(this.releaseStream(),t!==this.generation||this.aborted||!this.callbacks)return n();let r=this.callbacks,i=e.mimeType||this.chunks[0]?.type||`audio/webm`,a=new Blob(this.chunks,{type:i});try{if(!a.size)r.onError(`no-speech`);else{let e=await this.transcribe(a,`coding-bridge-voice.${Sn(i)}`,this.language,this.token);if(t!==this.generation||this.aborted)return n();e?r.onResult({finalText:e,interimText:``}):r.onError(`no-speech`)}}catch(e){t===this.generation&&!this.aborted&&r.onError(bn(e))}finally{t===this.generation&&(this.aborted||r.onEnd(),this.reset()),n()}},e.stop()})}async abort(){this.aborted=!0,this.generation+=1;let e=this.recorder;e&&e.state!==`inactive`&&(e.ondataavailable=null,e.onstop=null,e.stop()),this.releaseStream(),this.reset()}async dispose(){await this.abort()}releaseStream(){this.stream?.getTracks().forEach(e=>e.stop()),this.stream=void 0}reset(){this.recorder=void 0,this.callbacks=void 0,this.chunks=[],this.language=``,this.token=``}};function Tn(){return new wn}var En=50*1024*1024,Q=10,Dn=60,On=60,kn=80,An={claude:{src:_n,invertOnDark:!1},codex:{src:vn,invertOnDark:!0},copilot:{src:yn,invertOnDark:!0}},jn=y({name:`CodingBridgeSessionView`,components:{AddIcon:H,AiIcon:re,AttachmentIcon:B,CloseIcon:J,CodeIcon:j,ConfirmIcon:A,DeveloperIcon:L,EditIcon:V,ExpandDownIcon:ie,FileIcon:N,FolderOpenIcon:Me,HistoryIcon:F,MicrophoneIcon:le,MoreIcon:M,PerformanceIcon:P,RedoIcon:U,SecurityIcon:fe,StopIcon:pe,UpIcon:k,ViewIcon:oe,ElInput:G,ElButton:W,ElPopover:O,ElDropdown:D,ElDropdownMenu:E,ElDropdownItem:T,ElUpload:b,ElCheckbox:C,ElSkeleton:te,ElSkeletonItem:ee,TranscriptItem:zt,ThinkingIndicator:Xt,ComposerSettings:tn,DirectoryDialog:gn,AskUserQuestionCard:Ee,CopyToClipboard:we},mixins:[be,Se],emits:[`history`,`devices`],data(){return{prompt:``,cwd:``,model:``,customModelDraft:``,permissionMode:`bypassPermissions`,provider:`claude`,effort:``,directoryVisible:!1,moreOpen:!1,mobileSettings:!1,settingsMql:void 0,slashMenuOpen:!1,slashActiveIndex:0,editingEventId:``,restoreCode:!1,attachmentFileList:[],uploadUrl:xe()+`/api/v1/files/`,maxAttachments:Q,visibleCount:Dn,pinnedToBottom:!0,scrollPending:!1,transcriptObserver:void 0,observedTranscript:void 0,speechController:void 0,speechSupported:!1,speechState:`idle`,speechBasePrompt:``,speechFinalText:``,speechInterimText:``}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},currentNodeId(){return this.$store.state.codingBridge?.currentNodeId},lastComposer(){let e=this.currentNodeId;return(e?this.$store.state.codingBridge?.lastComposer?.[e]:void 0)??{}},currentNode(){return this.$store.state.codingBridge?.nodes?.find(e=>e.node_id===this.currentNodeId)},nodeOnline(){return this.currentNode?.status===`online`},currentSessionId(){return this.$store.state.codingBridge?.currentSessionId},currentSession(){let e=this.currentSessionId;return e?this.$store.state.codingBridge?.sessions?.[e]:void 0},events(){let e=this.currentSessionId;return e?this.$store.state.codingBridge?.events?.[e]??[]:[]},eventCount(){return this.events.length},visibleEvents(){let e=this.events;return e.length>this.visibleCount?e.slice(-this.visibleCount):e},hiddenEventCount(){return Math.max(0,this.events.length-this.visibleCount)},historyLoading(){return this.$store.state.codingBridge?.status?.getHistoryDetail===x.Request},pendingQuestion(){let e=this.currentSessionId;if(!e)return;let t=(this.$store.state.codingBridge?.permissions??[]).find(t=>t.session_id===e&&tt(t));return t?{request_id:t.request_id,payload:nt(t)}:void 0},isNewSession(){return!this.currentSessionId},canPickCwd(){return this.isNewSession||!this.currentSession?.started},readonly(){return this.currentSession?.readonly===!0},resumeHint(){return!!this.currentSession?.provider&&!this.currentSession?.started&&!this.readonly},replayLabel(){return!this.currentSession?.provider||this.currentSession?.started?``:this.currentSession.provider===`codex`?this.$t(`codingBridge.history.codexLabel`):this.currentSession.provider===`claude`?this.$t(`codingBridge.history.claudeLabel`):this.providerName(this.currentSession.provider)},running(){let e=this.currentSession?.status;return e===`running`||e===`starting`},thinking(){return this.running&&!this.pendingQuestion},connected(){return this.$store.state.codingBridge?.connection===`connected`},canRetry(){return this.currentSession?.status===`error`&&!this.readonly&&this.connected&&this.nodeOnline&&this.events.some(e=>e.kind===`prompt`)},attachments(){return(this.attachmentFileList||[]).map(e=>{let t=e.response?.file_url||(typeof e.url==`string`&&!e.url.startsWith(`blob:`)?e.url:``);if(!t)return;let n=e.raw,r=n?.type||e.mime_type||``;return{type:this.isImageAttachment(e)?`image`:`file`,url:t,name:e.name,mime_type:r,size:n?.size}}).filter(e=>!!e)},uploadingAttachments(){return(this.attachmentFileList||[]).some(e=>this.isAttachmentUploading(e))},speechActive(){return this.speechState!==`idle`},canSend(){return(!!this.prompt.trim()||this.attachments.length>0)&&!this.uploadingAttachments&&!this.speechActive&&this.connected&&this.nodeOnline},composerHint(){return this.speechState===`stopping`?this.$t(`codingBridge.session.voiceStopping`):this.speechState===`listening`?this.$t(`codingBridge.session.voiceListening`):this.uploadingAttachments?this.$t(`codingBridge.session.uploadingAttachment`):this.providerCaps.length&&!this.currentProviderAvailable?this.$t(`codingBridge.session.providerUnavailableHint`,{name:this.providerName(this.provider)}):this.resumeHint?this.$t(`codingBridge.history.resumeHint`):this.$t(`codingBridge.session.enterHint`)},nodeCapabilities(){let e=this.currentNodeId;return e?this.$store.state.codingBridge?.capabilities?.[e]:void 0},providerCaps(){return this.nodeCapabilities?.providers??[]},currentProviderCap(){return this.providerCaps.find(e=>e.name===this.provider)},canEdit(){return this.readonly?!1:!!this.providerCaps.find(e=>e.name===this.activeProviderName)?.supports_edit},canRestoreCode(){return!!this.providerCaps.find(e=>e.name===this.activeProviderName)?.supports_code_restore},editingActive(){return!!this.editingEventId},currentProviderAvailable(){return this.providerCaps.length?this.currentProviderCap?.available!==!1:!0},providerOptions(){return this.providerCaps.length?this.providerCaps.map(e=>({value:e.name,label:e.label,available:e.available!==!1})):[{label:this.$t(`codingBridge.session.providerClaude`),value:`claude`,available:!0},{label:this.$t(`codingBridge.session.providerCodex`),value:`codex`,available:!0},{label:`GitHub Copilot`,value:`copilot`,available:!0}]},modelOptions(){return this.currentProviderCap?.models??[]},allowCustomModel(){return this.currentProviderCap?.allow_custom_model??!0},effortOptions(){let e=this.currentProviderCap?.efforts;return(e&&e.length?e:[``]).map(e=>({value:e,label:this.effortLabel(e)}))},permissionModeOptions(){let e=this.currentProviderCap?.permission_modes;return(e&&e.length?e:[`default`,`acceptEdits`,`plan`,`bypassPermissions`]).map(e=>({value:e,label:this.permissionModeLabel(e)}))},sessionMeta(){let e=this.currentSession;if(!e)return``;let t=[];return e.provider&&t.push(this.providerName(e.provider)),e.cwd&&t.push(e.cwd),e.model&&t.push(e.model),t.join(` · `)},activeProviderName(){return this.currentSession?.provider||this.provider},slashCommands(){let e=this.activeProviderName;return this.providerCaps.find(t=>t.name===e)?.commands??[]},slashMatches(){let e=this.prompt.match(/^\/(\S*)$/);if(!e)return[];let t=e[1].toLowerCase();return this.slashCommands.filter(e=>[e.name,...e.aliases??[]].some(e=>e.toLowerCase().startsWith(t)))},slashMenuVisible(){return this.slashMenuOpen&&this.slashMatches.length>0},diagnostics(){let e=[];return this.currentNodeId&&e.push({label:this.$t(`codingBridge.session.nodeId`),value:this.currentNodeId}),this.currentSessionId&&e.push({label:this.$t(`codingBridge.session.sessionId`),value:this.currentSessionId}),this.currentSession?.trace_id&&e.push({label:this.$t(`codingBridge.session.traceId`),value:this.currentSession.trace_id}),e}},watch:{eventCount(){this.scrollToBottom()},pendingQuestion(){this.scrollToBottom()},thinking(){this.scrollToBottom()},currentSessionId(){this.cancelSpeechRecognition?.(),this.pinnedToBottom=!0,this.scrollToBottom(),this.visibleCount=Dn,this.editingEventId=``,this.restoreCode=!1,this.syncSessionSettings()},currentNodeId(){this.cancelSpeechRecognition?.(),this.requestCapabilities(),this.isNewSession&&this.restoreComposerPrefs()},nodeOnline(e){e||this.cancelSpeechRecognition?.()},providerCaps(){if(!this.isNewSession||!this.providerCaps.length)return;let e=this.providerCaps.find(e=>e.name===this.provider);if(!e||e.available===!1){let e=this.providerCaps.find(e=>e.available!==!1);e&&(this.provider=e.name)}},provider(){this.isNewSession&&(this.model=``,this.effort=``)},prompt(e){this.slashMenuOpen=/^\/\S*$/.test(e),this.slashActiveIndex>=this.slashMatches.length&&(this.slashActiveIndex=0)}},mounted(){this.requestCapabilities(),this.syncSessionSettings(),this.scrollToBottom(),this.observeTranscript(),this.watchSettingsBreakpoint(),this.initializeSpeechRecognition?.()},updated(){this.observeTranscript()},beforeUnmount(){this.transcriptObserver?.disconnect(),this.transcriptObserver=void 0,this.observedTranscript=void 0,this.settingsMql?.removeEventListener(`change`,this.onSettingsBreakpoint),this.settingsMql=void 0,this.speechController?.dispose(),this.speechController=void 0},methods:{async initializeSpeechRecognition(){let e=Tn();this.speechController=e,this.speechSupported=await e.isSupported()},async toggleSpeechRecognition(){if(this.speechState===`listening`){await this.stopSpeechRecognition();return}this.speechState===`idle`&&await this.startSpeechRecognition()},async startSpeechRecognition(){if(!this.speechController||!this.speechSupported)return;let e=await this.ensureSpeechCredential();if(!e){S.error(this.$t(`codingBridge.session.voiceError`));return}this.speechBasePrompt=this.prompt,this.speechFinalText=``,this.speechInterimText=``,this.speechState=`listening`;try{await this.speechController.start(this.$i18n.locale,e,{onResult:this.applySpeechSnapshot,onEnd:this.finishSpeechRecognition,onError:this.handleSpeechError})}catch{this.finishSpeechRecognition()}},async ensureSpeechCredential(){let e=this.$store.state.openaiimage?.credential?.token;if(e)return e;await this.$store.dispatch(`openaiimage/getService`);let t=await this.$store.dispatch(`openaiimage/getApplications`),n=Ce([...this.$store.state.applications??[],...t??[]],this.$store.state.openaiimage?.application);return n&&await this.$store.dispatch(`openaiimage/setApplication`,n),e=this.$store.state.openaiimage?.credential?.token,e??``},async stopSpeechRecognition(){if(!(!this.speechController||this.speechState!==`listening`)){this.speechState=`stopping`;try{await this.speechController.stop()}catch{this.handleSpeechError(`unknown`),this.finishSpeechRecognition()}}},async cancelSpeechRecognition(){!this.speechController||this.speechState===`idle`||(this.speechState=`idle`,this.speechInterimText=``,this.applySpeechPrompt(),await this.speechController.abort())},applySpeechSnapshot(e){this.speechState!==`idle`&&(this.speechFinalText=e.finalText,this.speechInterimText=e.interimText,this.applySpeechPrompt())},applySpeechPrompt(){let e=`${this.speechFinalText}${this.speechInterimText}`,t=this.speechBasePrompt&&e?`
|
|
2
|
+
`:``;this.prompt=`${this.speechBasePrompt}${t}${e}`},finishSpeechRecognition(){this.speechState!==`idle`&&(this.speechInterimText=``,this.applySpeechPrompt(),this.speechState=`idle`)},handleSpeechError(e){if(e===`aborted`)return;let t=this.$t({"permission-denied":`codingBridge.session.voicePermissionDenied`,"microphone-unavailable":`codingBridge.session.voiceMicrophoneUnavailable`,"no-speech":`codingBridge.session.voiceNoSpeech`,network:`codingBridge.session.voiceNetworkError`,unknown:`codingBridge.session.voiceError`}[e]);e===`no-speech`?S.warning(t):S.error(t)},watchSettingsBreakpoint(){typeof window>`u`||!window.matchMedia||(this.settingsMql=window.matchMedia(`(max-width: 767px)`),this.mobileSettings=this.settingsMql.matches,this.settingsMql.addEventListener(`change`,this.onSettingsBreakpoint))},onSettingsBreakpoint(e){this.mobileSettings=e.matches,e.matches||(this.moreOpen=!1)},requestCapabilities(){this.currentNodeId&&this.$store.dispatch(`codingBridge/getCapabilities`,this.currentNodeId)},effortLabel(e){let t={"":`codingBridge.session.effortDefault`,low:`codingBridge.session.effortLow`,medium:`codingBridge.session.effortMedium`,high:`codingBridge.session.effortHigh`,max:`codingBridge.session.effortMax`}[e];return t?this.$t(t):e},permissionModeLabel(e){let t={default:`codingBridge.session.permissionModeDefault`,acceptEdits:`codingBridge.session.permissionModeAcceptEdits`,plan:`codingBridge.session.permissionModePlan`,bypassPermissions:`codingBridge.session.permissionModeBypass`}[e];return t?this.$t(t):e},providerName(e){let t=this.providerCaps.find(t=>t.name===e);return t?t.label:{claude:this.$t(`codingBridge.session.providerClaude`),codex:this.$t(`codingBridge.session.providerCodex`),copilot:`GitHub Copilot`}[e]??e},providerIcon(e){return An[e]??null},syncSessionSettings(){let e=this.currentSession;if(!e){this.restoreComposerPrefs();return}let t=this.lastComposer;e.provider&&(this.provider=e.provider),this.model=e.model??``,this.customModelDraft=``,this.cwd=e.cwd??t.cwd??``,this.effort=e.effort??t.effort??``,this.permissionMode=e.permission_mode??t.permissionMode??`bypassPermissions`},selectModel(e){this.model=e,this.customModelDraft=``,this.closeModelPopover()},applyCustomModel(){let e=this.customModelDraft.trim();e&&(this.model=e,this.customModelDraft=``,this.closeModelPopover())},closeModelPopover(){this.$refs.modelPopover?.hide?.()},onComposerEnter(e){let t=e;t.isComposing||t.keyCode===229||t.shiftKey||t.ctrlKey||t.metaKey||t.altKey||(t.preventDefault(),this.onSend())},onComposerKeydown(e){let t=e;if(this.slashMenuVisible&&!t.isComposing&&t.keyCode!==229){if(t.key===`ArrowDown`){t.preventDefault(),this.moveSlash(1);return}if(t.key===`ArrowUp`){t.preventDefault(),this.moveSlash(-1);return}if(t.key===`Escape`){t.preventDefault(),this.slashMenuOpen=!1;return}if(t.key===`Tab`||t.key===`Enter`&&!t.shiftKey){t.preventDefault(),this.applySlash(this.slashMatches[this.slashActiveIndex]);return}}t.key===`Enter`&&this.onComposerEnter(t)},moveSlash(e){let t=this.slashMatches.length;t&&(this.slashActiveIndex=(this.slashActiveIndex+e+t)%t,this.$nextTick(()=>{(this.$el?.querySelector?.(`.cb-slash-menu__item--active`))?.scrollIntoView({block:`nearest`})}))},applySlash(e){e&&(this.prompt=`/${e.name} `,this.slashMenuOpen=!1,this.slashActiveIndex=0)},onSend(){if(!this.canSend)return;this.cancelSpeechRecognition?.();let e=this.attachments;if(this.editingEventId){this.$store.dispatch(`codingBridge/editPrompt`,{eventId:this.editingEventId,prompt:this.prompt,model:this.model,permissionMode:this.permissionMode,effort:this.effort,attachments:e.length?e:void 0,restoreCode:this.restoreCode}),this.resetComposer();return}this.currentNodeId&&this.$store.commit(`codingBridge/setLastComposer`,{node_id:this.currentNodeId,prefs:{cwd:this.cwd,provider:this.provider,model:this.model,permissionMode:this.permissionMode,effort:this.effort}}),this.$store.dispatch(`codingBridge/sendPrompt`,{prompt:this.prompt,cwd:this.cwd,model:this.model,permissionMode:this.permissionMode,provider:this.provider,effort:this.effort,attachments:e.length?e:void 0}),this.resetComposer()},resetComposer(){this.cancelSpeechRecognition?.(),this.prompt=``,this.speechBasePrompt=``,this.speechFinalText=``,this.speechInterimText=``,this.slashMenuOpen=!1,this.slashActiveIndex=0,this.editingEventId=``,this.restoreCode=!1,this.clearAttachments()},cancelEdit(){this.resetComposer()},onAnswerQuestion(e){this.$store.dispatch(`codingBridge/answerQuestion`,{request_id:e.tool_use_id,output:e.output})},onSkipQuestion(e){this.$store.dispatch(`codingBridge/resolvePermission`,{request_id:e.tool_use_id,decision:`deny`})},beforeAttachmentUpload(e){return this.attachmentFileList.length>=Q?(S.warning(this.$t(`codingBridge.session.attachmentLimit`,{count:Q})),!1):e.size>En?(S.warning(this.$t(`codingBridge.session.attachmentTooLarge`)),!1):!0},onAttachmentChange(e){if(!e.url&&e.raw&&this.isImageAttachment(e))try{e.url=URL.createObjectURL(e.raw)}catch{}},onAttachmentSuccess(e,t){e?.file_url&&(this.revokeBlobUrl(t),t.url=e.file_url,t.response=e)},onAttachmentError(){S.error(this.$t(`codingBridge.session.attachmentUploadError`))},onAttachmentExceed(){S.warning(this.$t(`codingBridge.session.attachmentLimit`,{count:Q}))},onTriggerAttachmentUpload(){this.$nextTick(()=>{let e=this.$refs.uploader?.$el;(e?.querySelector(`input.el-upload__input`)||e?.querySelector(`input[type="file"]`))?.click()})},isAttachmentUploading(e){return e.status===`ready`||e.status===`uploading`},isImageAttachment(e){return(e.raw?.type||``).startsWith(`image/`)?!0:/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(e.name||e.url||``)},attachmentPreviewUrl(e){return this.isImageAttachment(e)&&(e.url||e.response?.file_url)||``},removeAttachment(e,t){this.revokeBlobUrl(t),this.attachmentFileList.splice(e,1)},clearAttachments(){for(let e of this.attachmentFileList)this.revokeBlobUrl(e);this.attachmentFileList=[]},revokeBlobUrl(e){if(e.url?.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}},onInterrupt(){this.$store.dispatch(`codingBridge/interruptSession`)},onRetry(){this.$store.dispatch(`codingBridge/retryLastPrompt`)},onEditPrompt(e){this.canEdit&&(this.cancelSpeechRecognition?.(),this.editingEventId=e.id,this.restoreCode=!1,this.prompt=e.text??``,this.slashMenuOpen=!1,this.slashActiveIndex=0,this.clearAttachments(),this.attachmentFileList=(e.attachments??[]).map((e,t)=>({name:e.name||e.url,url:e.url,status:`success`,percentage:100,uid:Date.now()+t,response:{file_url:e.url},mime_type:e.mime_type})),this.$nextTick(()=>{(this.$el?.querySelector?.(`.cb-composer__input textarea`))?.focus()}))},openDirectory(){this.directoryVisible=!0},onDirectorySelect(e){this.cwd=e},onNewSession(){this.$store.dispatch(`codingBridge/newSession`),this.restoreComposerPrefs(),this.resetComposer()},restoreComposerPrefs(){let e=this.lastComposer;this.cwd=e.cwd??``,this.provider=e.provider??`claude`,this.permissionMode=e.permissionMode??`bypassPermissions`,this.customModelDraft=``,this.$nextTick(()=>{this.model=e.model??``,this.effort=e.effort??``})},scrollToBottom(){if(!this.pinnedToBottom)return;let e=()=>{let e=this.$refs.transcript;e&&(e.scrollTop=e.scrollHeight)};this.$nextTick(()=>{e(),requestAnimationFrame(e)})},observeTranscript(){let e=this.$refs.transcript;e!==this.observedTranscript&&(this.transcriptObserver?.disconnect(),this.transcriptObserver=void 0,this.observedTranscript=e,!(!e||typeof MutationObserver>`u`)&&(this.transcriptObserver=new MutationObserver(()=>this.scheduleScrollToBottom()),this.transcriptObserver.observe(e,{childList:!0,subtree:!0,characterData:!0})))},scheduleScrollToBottom(){!this.pinnedToBottom||this.scrollPending||(this.scrollPending=!0,requestAnimationFrame(()=>{this.scrollPending=!1;let e=this.$refs.transcript;e&&this.pinnedToBottom&&(e.scrollTop=e.scrollHeight)}))},onTranscriptScroll(){let e=this.$refs.transcript;e&&(this.pinnedToBottom=e.scrollHeight-e.scrollTop-e.clientHeight<=kn)},loadEarlier(){let e=this.$refs.transcript,t=e?.scrollHeight??0;this.pinnedToBottom=!1,this.visibleCount+=On,this.$nextTick(()=>{e&&(e.scrollTop=e.scrollHeight-t+e.scrollTop)})}}}),Mn={class:`session-view flex flex-col h-full bg-[var(--app-content-bg)]`},Nn={key:0,class:`flex-1 flex flex-col items-center justify-center text-center p-8 text-[var(--app-text-subtle)]`},Pn={class:`text-sm`},Fn={class:`flex items-center justify-between gap-3 px-5 py-3 border-b border-[var(--app-border-subtle)]`},In={class:`flex items-center gap-2 min-w-0`},Ln=[`title`,`aria-label`],Rn={class:`min-w-0`},zn={class:`flex items-center gap-2 font-medium`},Bn={class:`truncate`},Vn={key:0,class:`text-xs text-[var(--app-text-subtle)] truncate`},Hn={key:0,class:`text-[var(--el-color-primary)]`},Un={class:`flex items-center gap-2 flex-none`},Wn={key:0,class:`px-5 py-2 text-xs bg-[var(--el-color-warning-light-9)] text-[var(--el-color-warning)] border-b border-[var(--app-border-subtle)]`},Gn={key:1,class:`flex flex-wrap items-center gap-x-4 gap-y-1 px-5 py-1.5 text-[11px] text-[var(--app-text-subtle)] border-b border-[var(--app-border-subtle)]`},Kn={class:`opacity-70 flex-none`},qn=[`title`],Jn={key:0,class:`cb-skeleton`},Yn={class:`flex flex-col gap-4`},Xn={class:`flex justify-end`},Zn={class:`flex flex-col gap-1.5`},Qn={class:`flex justify-end`},$n={class:`flex flex-col gap-1.5`},er={key:1,class:`m-auto text-center text-sm text-[var(--app-text-subtle)]`},tr=[`title`],nr={key:4,class:`flex justify-center pt-1`},rr={key:2,class:`cb-question-dock flex-none px-5`},ir={class:`border-t border-[var(--app-border-subtle)] p-3`},ar={key:0,class:`flex items-center gap-2 text-xs text-[var(--app-text-subtle)] px-1 py-2`},or={key:0,class:`mb-2 flex flex-wrap items-center gap-x-3 gap-y-1.5 rounded-lg bg-[var(--el-color-primary-light-9)] px-3 py-2 text-xs text-[var(--app-text)]`},sr={class:`inline-flex items-center gap-1.5`},cr={class:`cb-composer rounded-2xl border border-[var(--app-border-subtle)] bg-[var(--app-content-bg)] px-3 py-2.5 transition-colors focus-within:border-[var(--el-color-primary-light-5)]`},lr={key:0,class:`flex flex-wrap gap-2 pb-2`},ur=[`src`,`alt`],dr={key:1,class:`flex h-8 w-8 items-center justify-center rounded bg-[var(--app-content-bg)]`},fr=[`title`],pr={key:2,class:`text-[10px] text-[var(--app-text-subtle)]`},mr=[`title`,`aria-label`,`onClick`],hr={key:1,class:`cb-slash-menu`},gr=[`onMousedown`,`onMouseenter`],_r={class:`cb-slash-menu__name`},vr={key:0,class:`cb-slash-menu__hint`},yr={key:1,class:`cb-slash-menu__desc`},br={ref:`attachmentUploadTrigger`,class:`block h-0 w-0`,"aria-hidden":`true`},xr={class:`mt-1.5 flex items-center gap-1.5`},Sr=[`title`,`aria-label`],Cr=[`disabled`,`title`,`aria-label`,`aria-pressed`],wr={class:`flex min-w-0 flex-1 flex-wrap items-center gap-1.5`},Tr={type:`button`,class:`cb-pill`},Er=[`src`],Dr={class:`truncate`},Or=[`src`],kr={key:1,class:`ml-1 text-xs opacity-60`},Ar={key:1,class:`cb-pill cb-pill--static`},jr=[`src`],Mr={class:`truncate`},Nr=[`title`,`aria-label`],Pr={key:0,class:`cb-setting__label`},Fr={type:`button`,class:`cb-pill`},Ir={class:`truncate`},Lr={class:`cb-model-menu`},Rr={class:`truncate`},zr=[`onClick`],Br={class:`truncate`},Vr={key:0,class:`cb-model-custom`},Hr={key:0,class:`cb-setting__label`},Ur={type:`button`,class:`cb-pill`},Wr={class:`truncate`},Gr={key:0,class:`cb-setting__label`},Kr={type:`button`,class:`cb-pill`},qr={class:`truncate`},Jr={key:0,class:`cb-setting__label`},Yr={type:`button`,class:`cb-pill`},Xr={class:`truncate`},Zr=[`title`,`aria-label`],Qr={key:2,class:`cb-pill cb-pill--static`},$r={class:`truncate`},ei={class:`text-[11px] text-[var(--app-text-subtle)] mt-1 px-1`};function ti(d,f,h,_,y,b){let x=u(`developer-icon`),S=u(`el-button`),C=u(`history-icon`),w=u(`add-icon`),T=u(`copy-to-clipboard`),E=u(`el-skeleton-item`),D=u(`el-skeleton`),O=u(`up-icon`),ee=u(`transcript-item`),te=u(`thinking-indicator`),ne=u(`redo-icon`),k=u(`ask-user-question-card`),re=u(`view-icon`),A=u(`edit-icon`),ie=u(`el-checkbox`),ae=u(`file-icon`),j=u(`close-icon`),M=u(`el-input`),oe=u(`el-upload`),se=u(`attachment-icon`),N=u(`stop-icon`),ce=u(`microphone-icon`),P=u(`code-icon`),F=u(`expand-down-icon`),I=u(`confirm-icon`),L=u(`el-dropdown-item`),R=u(`el-dropdown-menu`),z=u(`el-dropdown`),le=u(`more-icon`),ue=u(`ai-icon`),B=u(`el-popover`),V=u(`performance-icon`),H=u(`security-icon`),U=u(`folder-open-icon`),de=u(`composer-settings`),fe=u(`directory-dialog`);return v(),s(`div`,Mn,[d.currentNode?(v(),s(l,{key:1},[e(`div`,Fn,[e(`div`,In,[e(`button`,{type:`button`,class:`cb-devices-btn md:hidden`,title:d.$t(`codingBridge.nodeList.title`),"aria-label":d.$t(`codingBridge.nodeList.title`),onClick:f[1]||=e=>d.$emit(`devices`)},[a(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Ln),e(`div`,Rn,[e(`div`,zn,[e(`span`,Bn,i(d.currentNode.name),1),e(`span`,{class:n([`inline-block w-2 h-2 rounded-full flex-none`,d.nodeOnline?`bg-[var(--el-color-success)]`:`bg-[var(--app-text-subtle)]`])},null,2)]),d.currentSession?(v(),s(`div`,Vn,[e(`span`,null,i(d.sessionMeta),1),d.replayLabel?(v(),s(`span`,Hn,` · `+i(d.replayLabel),1)):o(``,!0)])):o(``,!0)])]),e(`div`,Un,[a(S,{size:`small`,round:``,onClick:f[2]||=e=>d.$emit(`history`)},{default:m(()=>[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`codingBridge.history.button`)),1)]),_:1}),d.currentSessionId?(v(),p(S,{key:0,size:`small`,round:``,onClick:d.onNewSession},{default:m(()=>[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`codingBridge.session.newSession`)),1)]),_:1},8,[`onClick`])):o(``,!0)])]),d.nodeOnline?o(``,!0):(v(),s(`div`,Wn,i(d.$t(`codingBridge.session.deviceOffline`)),1)),d.diagnostics.length?(v(),s(`div`,Gn,[(v(!0),s(l,null,g(d.diagnostics,t=>(v(),s(`span`,{key:t.label,class:`inline-flex items-center gap-1 min-w-0`},[e(`span`,Kn,i(t.label)+`:`,1),e(`span`,{class:`font-mono break-all`,title:t.value},i(t.value),9,qn),a(T,{content:t.value,class:`inline-block flex-none`},null,8,[`content`])]))),128))])):o(``,!0),e(`div`,{ref:`transcript`,class:`flex-1 min-h-0 overflow-y-auto px-5 py-4 flex flex-col gap-3`,onScroll:f[4]||=(...e)=>d.onTranscriptScroll&&d.onTranscriptScroll(...e)},[d.historyLoading&&!d.events.length?(v(),s(`div`,Jn,[a(D,{animated:``},{template:m(()=>[e(`div`,Yn,[e(`div`,Xn,[a(E,{variant:`rect`,class:`cb-sk cb-sk--user`})]),e(`div`,Zn,[a(E,{variant:`text`,style:{width:`55%`}}),a(E,{variant:`text`,style:{width:`88%`}}),a(E,{variant:`text`,style:{width:`70%`}})]),a(E,{variant:`rect`,class:`cb-sk cb-sk--tool`}),e(`div`,Qn,[a(E,{variant:`rect`,class:`cb-sk cb-sk--user-sm`})]),e(`div`,$n,[a(E,{variant:`text`,style:{width:`80%`}}),a(E,{variant:`text`,style:{width:`45%`}})])])]),_:1})])):d.events.length?o(``,!0):(v(),s(`div`,er,i(d.$t(`codingBridge.session.startHint`)),1)),d.hiddenEventCount>0?(v(),s(`button`,{key:2,type:`button`,class:`cb-load-earlier mx-auto mb-1 flex items-center gap-1.5 rounded-full border border-[var(--app-border-subtle)] bg-[var(--app-content-bg)] px-3 py-1 text-xs text-[var(--app-text-subtle)] hover:text-[var(--el-color-primary)]`,title:`+${d.hiddenEventCount}`,onClick:f[3]||=(...e)=>d.loadEarlier&&d.loadEarlier(...e)},[a(O,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.hiddenEventCount),1)],8,tr)):o(``,!0),(v(!0),s(l,null,g(d.visibleEvents,e=>(v(),p(ee,{key:e.id,event:e,editable:d.canEdit,onEdit:d.onEditPrompt},null,8,[`event`,`editable`,`onEdit`]))),128)),d.thinking?(v(),p(te,{key:3})):o(``,!0),d.canRetry?(v(),s(`div`,nr,[a(S,{size:`small`,round:``,onClick:d.onRetry},{default:m(()=>[a(ne,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`codingBridge.session.retry`)),1)]),_:1},8,[`onClick`])])):o(``,!0)],544),d.pendingQuestion?(v(),s(`div`,rr,[(v(),p(k,{key:d.pendingQuestion.request_id,"tool-use-id":d.pendingQuestion.request_id,payload:d.pendingQuestion.payload,onSubmit:d.onAnswerQuestion,onSkip:d.onSkipQuestion},null,8,[`tool-use-id`,`payload`,`onSubmit`,`onSkip`]))])):o(``,!0),e(`div`,ir,[d.readonly?(v(),s(`div`,ar,[a(re,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,i(d.$t(`codingBridge.history.readonly`)),1),a(S,{class:`ml-auto`,size:`small`,round:``,onClick:d.onNewSession},{default:m(()=>[r(i(d.$t(`codingBridge.session.newSession`)),1)]),_:1},8,[`onClick`])])):(v(),s(l,{key:1},[d.editingActive?(v(),s(`div`,or,[e(`span`,sr,[a(A,{class:`text-[var(--el-color-primary)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`codingBridge.session.editingBanner`)),1)]),d.canRestoreCode?(v(),p(ie,{key:0,modelValue:d.restoreCode,"onUpdate:modelValue":f[5]||=e=>d.restoreCode=e,size:`small`,class:`cb-restore-code`},{default:m(()=>[r(i(d.$t(`codingBridge.session.editRestoreCode`)),1)]),_:1},8,[`modelValue`])):o(``,!0),e(`button`,{type:`button`,class:`ml-auto cb-edit-cancel`,onClick:f[6]||=(...e)=>d.cancelEdit&&d.cancelEdit(...e)},i(d.$t(`codingBridge.session.editCancel`)),1)])):o(``,!0),e(`div`,cr,[d.attachmentFileList.length?(v(),s(`div`,lr,[(v(!0),s(l,null,g(d.attachmentFileList,(t,n)=>(v(),s(`div`,{key:t.uid||t.name||n,class:`group relative flex max-w-[220px] items-center gap-2 rounded-md border border-[var(--app-border-subtle)] bg-[var(--app-sidebar-bg)] px-2 py-1.5 text-xs`},[d.attachmentPreviewUrl(t)?(v(),s(`img`,{key:0,src:d.attachmentPreviewUrl(t),class:`h-8 w-8 rounded object-cover`,alt:d.$t(`codingBridge.session.attachmentImageAlt`)},null,8,ur)):(v(),s(`span`,dr,[a(ae,{size:`1em`,"aria-hidden":`true`,focusable:`false`})])),e(`span`,{class:`min-w-0 flex-1 truncate`,title:t.name},i(t.name),9,fr),d.isAttachmentUploading(t)?(v(),s(`span`,pr,i(Math.round(t.percentage||0))+`% `,1)):o(``,!0),e(`button`,{type:`button`,class:`flex h-5 w-5 items-center justify-center rounded-full text-[var(--app-text-subtle)] hover:bg-[var(--app-content-hover-bg)] hover:text-[var(--el-color-danger)]`,title:d.$t(`codingBridge.session.removeAttachment`),"aria-label":d.$t(`codingBridge.session.removeAttachment`),onClick:e=>d.removeAttachment(n,t)},[a(j,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,mr)]))),128))])):o(``,!0),d.slashMenuVisible?(v(),s(`ul`,hr,[(v(!0),s(l,null,g(d.slashMatches,(r,a)=>(v(),s(`li`,{key:r.name,class:n([`cb-slash-menu__item`,{"cb-slash-menu__item--active":a===d.slashActiveIndex}]),onMousedown:t(e=>d.applySlash(r),[`prevent`]),onMouseenter:e=>d.slashActiveIndex=a},[e(`span`,_r,`/`+i(r.name),1),r.argument_hint?(v(),s(`span`,vr,i(r.argument_hint),1)):o(``,!0),r.description?(v(),s(`span`,yr,i(r.description),1)):o(``,!0)],42,gr))),128))])):o(``,!0),a(M,{modelValue:d.prompt,"onUpdate:modelValue":f[7]||=e=>d.prompt=e,type:`textarea`,autosize:{minRows:2,maxRows:12},resize:`none`,class:`cb-composer__input`,readonly:d.speechActive,placeholder:d.$t(`codingBridge.session.promptPlaceholder`),onKeydown:d.onComposerKeydown},null,8,[`modelValue`,`readonly`,`placeholder`,`onKeydown`]),a(oe,{ref:`uploader`,"file-list":d.attachmentFileList,"onUpdate:fileList":f[8]||=e=>d.attachmentFileList=e,class:`h-0 w-0 overflow-hidden opacity-0`,name:`file`,action:d.uploadUrl,headers:d.headers,multiple:!0,limit:d.maxAttachments,"show-file-list":!1,"before-upload":d.beforeAttachmentUpload,"on-change":d.onAttachmentChange,"on-success":d.onAttachmentSuccess,"on-error":d.onAttachmentError,"on-exceed":d.onAttachmentExceed},{default:m(()=>[e(`span`,br,null,512)]),_:1},8,[`file-list`,`action`,`headers`,`limit`,`before-upload`,`on-change`,`on-success`,`on-error`,`on-exceed`]),e(`div`,xr,[e(`button`,{type:`button`,class:`cb-icon-btn`,title:d.$t(`codingBridge.session.attachFile`),"aria-label":d.$t(`codingBridge.session.attachFile`),onClick:f[9]||=(...e)=>d.onTriggerAttachmentUpload&&d.onTriggerAttachmentUpload(...e)},[a(se,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Sr),d.speechSupported?(v(),s(`button`,{key:0,type:`button`,class:n([`cb-icon-btn cb-voice-btn`,{"cb-voice-btn--active":d.speechActive}]),disabled:d.speechState===`stopping`,title:d.$t(d.speechActive?`codingBridge.session.voiceStop`:`codingBridge.session.voiceInput`),"aria-label":d.$t(d.speechActive?`codingBridge.session.voiceStop`:`codingBridge.session.voiceInput`),"aria-pressed":d.speechActive,onClick:f[10]||=(...e)=>d.toggleSpeechRecognition&&d.toggleSpeechRecognition(...e)},[d.speechActive?(v(),p(N,{key:0,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(v(),p(ce,{key:1,size:`1em`,"aria-hidden":`true`,focusable:`false`}))],10,Cr)):o(``,!0),e(`div`,wr,[d.isNewSession?(v(),p(z,{key:0,trigger:`click`,onCommand:f[11]||=e=>d.provider=e},{dropdown:m(()=>[a(R,null,{default:m(()=>[(v(!0),s(l,null,g(d.providerOptions,e=>(v(),p(L,{key:e.value,command:e.value,disabled:!e.available},{default:m(()=>[a(I,{class:n([`mr-2`,e.value===d.provider?`opacity-100`:`opacity-0`]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`]),d.providerIcon(e.value)?(v(),s(`img`,{key:0,src:d.providerIcon(e.value).src,class:n([`cb-pill__brand mr-1.5`,{"cb-pill__brand--invert":d.providerIcon(e.value).invertOnDark}]),alt:``},null,10,Or)):o(``,!0),r(` `+i(e.label)+` `,1),e.available?o(``,!0):(v(),s(`span`,kr,i(d.$t(`codingBridge.session.providerUnavailable`)),1))]),_:2},1032,[`command`,`disabled`]))),128))]),_:1})]),default:m(()=>[e(`button`,Tr,[d.providerIcon(d.provider)?(v(),s(`img`,{key:0,src:d.providerIcon(d.provider).src,class:n([`cb-pill__brand`,{"cb-pill__brand--invert":d.providerIcon(d.provider).invertOnDark}]),alt:``},null,10,Er)):(v(),p(P,{key:1,class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,Dr,i(d.providerName(d.provider)),1),a(F,{class:`cb-pill__caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})])]),_:1})):(v(),s(`span`,Ar,[d.providerIcon(d.currentSession?.provider||`claude`)?(v(),s(`img`,{key:0,src:d.providerIcon(d.currentSession?.provider||`claude`).src,class:n([`cb-pill__brand`,{"cb-pill__brand--invert":d.providerIcon(d.currentSession?.provider||`claude`).invertOnDark}]),alt:``},null,10,jr)):(v(),p(P,{key:1,class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,Mr,i(d.providerName(d.currentSession?.provider||`claude`)),1)])),e(`button`,{type:`button`,class:`cb-icon-btn cb-more-btn`,title:d.$t(`codingBridge.session.settings`),"aria-label":d.$t(`codingBridge.session.settings`),onClick:f[12]||=e=>d.moreOpen=!0},[a(le,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Nr),a(de,{open:d.moreOpen,"onUpdate:open":f[21]||=e=>d.moreOpen=e,dialog:d.mobileSettings},{default:m(()=>[e(`div`,{class:n([`cb-setting`,{"cb-setting--row":d.mobileSettings}])},[d.mobileSettings?(v(),s(`span`,Pr,i(d.$t(`chat.scheduledTasks.form.model`)),1)):o(``,!0),a(B,{ref:`modelPopover`,trigger:`click`,placement:`top-start`,width:260},{reference:m(()=>[e(`button`,Fr,[a(ue,{class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,Ir,i(d.model||d.$t(`codingBridge.session.modelDefault`)),1),a(F,{class:`cb-pill__caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})])]),default:m(()=>[e(`div`,Lr,[e(`button`,{type:`button`,class:`cb-model-option`,onClick:f[13]||=e=>d.selectModel(``)},[a(I,{class:n([`cb-model-option__check`,d.model?`opacity-0`:`opacity-100`]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`]),e(`span`,Rr,i(d.$t(`codingBridge.session.modelDefault`)),1)]),(v(!0),s(l,null,g(d.modelOptions,t=>(v(),s(`button`,{key:t.value,type:`button`,class:`cb-model-option`,onClick:e=>d.selectModel(t.value)},[a(I,{class:n([`cb-model-option__check`,t.value===d.model?`opacity-100`:`opacity-0`]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`]),e(`span`,Br,i(t.label),1)],8,zr))),128)),d.allowCustomModel?(v(),s(`div`,Vr,[a(M,{modelValue:d.customModelDraft,"onUpdate:modelValue":f[14]||=e=>d.customModelDraft=e,size:`small`,placeholder:d.$t(`codingBridge.session.modelPlaceholder`),onKeyup:c(d.applyCustomModel,[`enter`])},{append:m(()=>[a(S,{disabled:!d.customModelDraft.trim(),"aria-label":d.$t(`common.button.confirm`),title:d.$t(`common.button.confirm`),onClick:d.applyCustomModel},{default:m(()=>[a(I,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`disabled`,`aria-label`,`title`,`onClick`])]),_:1},8,[`modelValue`,`placeholder`,`onKeyup`])])):o(``,!0)])]),_:1},512)],2),d.effortOptions.length>1?(v(),s(`div`,{key:0,class:n([`cb-setting`,{"cb-setting--row":d.mobileSettings}])},[d.mobileSettings?(v(),s(`span`,Hr,i(d.$t(`codingBridge.session.effortLabel`)),1)):o(``,!0),a(z,{trigger:`click`,onCommand:f[15]||=e=>d.effort=e},{dropdown:m(()=>[a(R,null,{default:m(()=>[(v(!0),s(l,null,g(d.effortOptions,e=>(v(),p(L,{key:e.value,command:e.value},{default:m(()=>[a(I,{class:n([`mr-2`,e.value===d.effort?`opacity-100`:`opacity-0`]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`]),r(` `+i(e.label),1)]),_:2},1032,[`command`]))),128))]),_:1})]),default:m(()=>[e(`button`,Ur,[a(V,{class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,Wr,i(d.effortLabel(d.effort)),1),a(F,{class:`cb-pill__caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})])]),_:1})],2)):o(``,!0),e(`div`,{class:n([`cb-setting`,{"cb-setting--row":d.mobileSettings}])},[d.mobileSettings?(v(),s(`span`,Gr,i(d.$t(`codingBridge.session.permissionModeLabel`)),1)):o(``,!0),a(z,{trigger:`click`,onCommand:f[16]||=e=>d.permissionMode=e},{dropdown:m(()=>[a(R,null,{default:m(()=>[(v(!0),s(l,null,g(d.permissionModeOptions,e=>(v(),p(L,{key:e.value,command:e.value},{default:m(()=>[a(I,{class:n([`mr-2`,e.value===d.permissionMode?`opacity-100`:`opacity-0`]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`]),r(` `+i(e.label),1)]),_:2},1032,[`command`]))),128))]),_:1})]),default:m(()=>[e(`button`,Kr,[a(H,{class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,qr,i(d.permissionModeLabel(d.permissionMode)),1),a(F,{class:`cb-pill__caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})])]),_:1})],2),d.canPickCwd||d.currentSession?.cwd?(v(),s(`div`,{key:1,class:n([`cb-setting`,{"cb-setting--row":d.mobileSettings}])},[d.mobileSettings?(v(),s(`span`,Jr,i(d.$t(`common.settings.localToolsWorkingDirTitle`)),1)):o(``,!0),d.canPickCwd?(v(),p(B,{key:1,trigger:`click`,placement:`top-start`,width:320},{reference:m(()=>[e(`button`,Yr,[a(U,{class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,Xr,i(d.cwd||d.$t(`codingBridge.session.cwdDefault`)),1),a(F,{class:`cb-pill__caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})])]),default:m(()=>[a(M,{modelValue:d.cwd,"onUpdate:modelValue":f[20]||=e=>d.cwd=e,size:`small`,clearable:``,class:`cb-cwd-input`,placeholder:d.$t(`codingBridge.session.cwdPlaceholder`)},{suffix:m(()=>[e(`span`,{class:`cb-cwd-browse`,role:`button`,tabindex:`0`,title:d.$t(`codingBridge.directory.title`),"aria-label":d.$t(`codingBridge.directory.title`),onClick:f[17]||=(...e)=>d.openDirectory&&d.openDirectory(...e),onKeydown:[f[18]||=c(t((...e)=>d.openDirectory&&d.openDirectory(...e),[`prevent`]),[`enter`]),f[19]||=c(t((...e)=>d.openDirectory&&d.openDirectory(...e),[`prevent`]),[`space`])]},[a(U,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],40,Zr)]),_:1},8,[`modelValue`,`placeholder`])]),_:1})):(v(),s(`span`,Qr,[a(U,{class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,$r,i(d.currentSession?.cwd),1)]))],2)):o(``,!0)]),_:1},8,[`open`,`dialog`])]),d.running?(v(),p(S,{key:1,circle:``,"aria-label":d.$t(`common.button.stop`),title:d.$t(`common.button.stop`),onClick:d.onInterrupt},{default:m(()=>[a(N,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`,`onClick`])):o(``,!0),a(S,{type:`primary`,round:``,disabled:!d.canSend,onClick:d.onSend},{default:m(()=>[r(i(d.editingActive?d.$t(`codingBridge.session.editSubmit`):d.$t(`codingBridge.session.send`)),1)]),_:1},8,[`disabled`,`onClick`])])]),e(`p`,ei,i(d.composerHint),1)],64))])],64)):(v(),s(`div`,Nn,[a(x,{class:`text-4xl mb-3`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,Pn,i(d.$t(`codingBridge.session.noDevice`)),1),a(S,{class:`md:hidden mt-4`,round:``,onClick:f[0]||=e=>d.$emit(`devices`)},{default:m(()=>[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`codingBridge.nodeList.title`)),1)]),_:1})])),a(fe,{visible:d.directoryVisible,"onUpdate:visible":f[22]||=e=>d.directoryVisible=e,"initial-path":d.cwd,onSelect:d.onDirectorySelect},null,8,[`visible`,`initial-path`,`onSelect`])])}var ni=q(jn,[[`render`,ti],[`__scopeId`,`data-v-adb11f90`]]),ri=y({name:`CodingBridgePairDialog`,components:{LinkIcon:R,ElDialog:Y,ElInput:G,ElButton:W},props:{visible:{type:Boolean,default:!1},initialCode:{type:String,default:``}},emits:[`update:visible`],data(){return{code:``}},computed:{claiming(){return this.$store.state.codingBridge?.status?.claimPair===x.Request}},watch:{visible(e){e&&this.initialCode&&(this.code=this.initialCode)},initialCode(e){e&&(this.code=e)}},methods:{async onClaim(){let e=this.code.trim();if(e)try{let t=await this.$store.dispatch(`codingBridge/claimPair`,e);S.success(this.$t(`codingBridge.pair.success`,{name:t})),this.code=``,this.$emit(`update:visible`,!1)}catch(e){let t=e?.response?.status;t===404?S.error(this.$t(`codingBridge.pair.invalidCode`)):t===409?S.error(this.$t(`codingBridge.pair.usedCode`)):S.error(this.$t(`codingBridge.pair.failed`))}}}}),ii={class:`content`},ai={class:`text-sm text-[var(--app-text-subtle)] mb-4`},oi={class:`steps list-none m-0 p-0 mb-4`},si={class:`flex gap-3 mb-3`},ci={class:`flex-1 min-w-0`},li={class:`text-sm mb-1`},ui={class:`flex gap-3 mb-3`},di={class:`flex-1 min-w-0`},fi={class:`text-sm mb-1`},pi={class:`flex gap-3`},mi={class:`flex-1 min-w-0`},hi={class:`text-sm`};function gi(t,n,o,s,l,d){let f=u(`el-input`),h=u(`link-icon`),g=u(`el-button`),_=u(`el-dialog`);return v(),p(_,{"model-value":t.visible,width:`520px`,title:t.$t(`codingBridge.pair.title`),center:``,"onUpdate:modelValue":n[1]||=e=>t.$emit(`update:visible`,e)},{default:m(()=>[e(`div`,ii,[e(`p`,ai,i(t.$t(`codingBridge.pair.intro`)),1),e(`ol`,oi,[e(`li`,si,[n[3]||=e(`span`,{class:`step-index`},`1`,-1),e(`div`,ci,[e(`p`,li,i(t.$t(`codingBridge.pair.step1`)),1),n[2]||=e(`code`,{class:`cmd`},`pip install coding-bridge`,-1)])]),e(`li`,ui,[n[5]||=e(`span`,{class:`step-index`},`2`,-1),e(`div`,di,[e(`p`,fi,i(t.$t(`codingBridge.pair.step2`)),1),n[4]||=e(`code`,{class:`cmd`},`coding-bridge up`,-1)])]),e(`li`,pi,[n[6]||=e(`span`,{class:`step-index`},`3`,-1),e(`div`,mi,[e(`p`,hi,i(t.$t(`codingBridge.pair.step3`)),1)])])]),a(f,{modelValue:t.code,"onUpdate:modelValue":n[0]||=e=>t.code=e,size:`large`,class:`mb-3`,placeholder:t.$t(`codingBridge.pair.codePlaceholder`),clearable:``,onKeyup:c(t.onClaim,[`enter`])},null,8,[`modelValue`,`placeholder`,`onKeyup`]),a(g,{type:`primary`,round:``,class:`w-full`,loading:t.claiming,disabled:!t.code.trim(),onClick:t.onClaim},{default:m(()=>[a(h,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`codingBridge.pair.claim`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])])]),_:1},8,[`model-value`,`title`])}var _i=q(ri,[[`render`,gi],[`__scopeId`,`data-v-54bd85f1`]]),vi=y({name:`CodingBridgePermissionDialog`,components:{CloseIcon:J,CodeIcon:j,ConfirmIcon:A,ElDialog:Y,ElButton:W},computed:{request(){return(this.$store.state.codingBridge?.permissions??[]).find(e=>!tt(e))},hasInput(){return!!this.request?.input&&Object.keys(this.request.input).length>0},inputText(){try{return JSON.stringify(this.request?.input,null,2)}catch{return String(this.request?.input??``)}}},methods:{onAllow(){this.request&&this.$store.dispatch(`codingBridge/resolvePermission`,{request_id:this.request.request_id,decision:`allow`})},onDeny(){this.request&&this.$store.dispatch(`codingBridge/resolvePermission`,{request_id:this.request.request_id,decision:`deny`})}}}),yi={key:0,class:`content`},bi={class:`text-sm text-[var(--app-text-subtle)] mb-3`},xi={class:`rounded-md border border-[var(--app-border-subtle)] p-3 mb-3`},Si={class:`flex items-center gap-2 font-medium`},Ci={key:0,class:`text-xs text-[var(--app-text-subtle)] mt-1`},wi={key:1,class:`mt-2 text-xs overflow-x-auto whitespace-pre-wrap break-words text-[var(--app-text-subtle)] max-h-[200px]`},Ti={class:`flex justify-end gap-2`};function Ei(t,n,c,l,d,f){let h=u(`code-icon`),g=u(`close-icon`),_=u(`el-button`),y=u(`confirm-icon`),b=u(`el-dialog`);return v(),p(b,{"model-value":!!t.request,width:`480px`,title:t.$t(`codingBridge.permission.title`),"close-on-click-modal":!1,"show-close":!1,center:``},{footer:m(()=>[e(`div`,Ti,[a(_,{round:``,onClick:t.onDeny},{default:m(()=>[a(g,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`codingBridge.permission.deny`)),1)]),_:1},8,[`onClick`]),a(_,{type:`primary`,round:``,onClick:t.onAllow},{default:m(()=>[a(y,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`codingBridge.permission.allow`)),1)]),_:1},8,[`onClick`])])]),default:m(()=>[t.request?(v(),s(`div`,yi,[e(`p`,bi,i(t.$t(`codingBridge.permission.subtitle`)),1),e(`div`,xi,[e(`div`,Si,[a(h,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,i(t.request.display_name||t.request.title||t.request.tool),1)]),t.request.description?(v(),s(`p`,Ci,i(t.request.description),1)):o(``,!0),t.hasInput?(v(),s(`pre`,wi,i(t.inputText),1)):o(``,!0)])])):o(``,!0)]),_:1},8,[`model-value`,`title`])}var Di=q(vi,[[`render`,Ei]]),Oi={claude:{src:_n,invertOnDark:!1},codex:{src:vn,invertOnDark:!0},copilot:{src:yn,invertOnDark:!0}},$=[`claude`,`codex`,`copilot`],ki=y({name:`CodingBridgeHistoryDrawer`,components:{CodeIcon:j,RedoIcon:U,ElDrawer:w,ElButton:W},props:{visible:{type:Boolean,default:!1}},emits:[`update:visible`],data(){return{selectedProviders:[]}},computed:{currentNodeId(){return this.$store.state.codingBridge?.currentNodeId},loading(){return this.$store.state.codingBridge?.status?.getHistory===x.Request},allSessions(){let e=this.currentNodeId;return[...e?this.$store.state.codingBridge?.history?.[e]??[]:[]].sort((e,t)=>(t.updated_at??0)-(e.updated_at??0))},sessions(){return this.selectedProviders.length?this.allSessions.filter(e=>this.selectedProviders.includes(e.provider)):this.allSessions},providerOptions(){let e=new Map;return this.allSessions.forEach(t=>{e.set(t.provider,(e.get(t.provider)??0)+1)}),[...e.entries()].sort(([e],[t])=>{let n=$.indexOf(e),r=$.indexOf(t);return n===r?e.localeCompare(t):(n<0?$.length:n)-(r<0?$.length:r)}).map(([e,t])=>({value:e,label:this.providerLabel(e),count:t,icon:this.providerIcon(e)}))}},watch:{visible(e){e&&this.currentNodeId&&this.$store.dispatch(`codingBridge/getHistory`,this.currentNodeId)},currentNodeId(){this.selectedProviders=[]}},methods:{isSelected(e){return this.selectedProviders.includes(e)},toggle(e){this.selectedProviders=this.isSelected(e)?this.selectedProviders.filter(t=>t!==e):[...this.selectedProviders,e]},clearFilter(){this.selectedProviders=[]},providerLabel(e){return{claude:`Claude Code`,codex:`Codex`,copilot:`GitHub Copilot`}[e]??e},providerIcon(e){return Oi[e]??null},refresh(){this.currentNodeId&&this.$store.dispatch(`codingBridge/getHistory`,this.currentNodeId)},open(e){this.currentNodeId&&(e.unread&&this.$store.dispatch(`codingBridge/markHistoryRead`,{node_id:this.currentNodeId,provider:e.provider,session_id:e.session_id,updated_at:e.updated_at}),this.$store.dispatch(`codingBridge/reattachSession`,{node_id:this.currentNodeId,provider:e.provider,session_id:e.session_id}),this.$emit(`update:visible`,!1))},formatTime(e){try{return new Date(e).toLocaleString()}catch{return``}}}}),Ai={class:`flex flex-col h-full`},ji={class:`flex items-center justify-between mb-3`},Mi={class:`text-xs text-[var(--app-text-subtle)] m-0`},Ni={key:0,class:`flex flex-wrap items-center gap-1.5 mb-3`},Pi=[`aria-pressed`,`onClick`],Fi=[`src`],Ii={class:`chip-count`},Li={key:1,class:`m-auto text-sm text-[var(--app-text-subtle)]`},Ri={key:2,class:`m-auto text-sm text-[var(--app-text-subtle)]`},zi={key:3,class:`m-auto text-sm text-[var(--app-text-subtle)] text-center`},Bi={key:4,class:`m-auto text-sm text-[var(--app-text-subtle)] text-center`},Vi={class:`m-0`},Hi={key:5,class:`list-none m-0 p-0 flex-1 overflow-y-auto flex flex-col gap-2`},Ui=[`onClick`],Wi={class:`flex items-center gap-2 mb-1`},Gi=[`src`,`alt`],Ki=[`title`],qi=[`title`],Ji={class:`text-[11px] text-[var(--app-text-subtle)] truncate`},Yi={key:0},Xi={key:1},Zi={class:`text-[11px] text-[var(--app-text-subtle)] mt-0.5`},Qi={key:0},$i={key:1};function ea(t,c,d,f,h,_){let y=u(`redo-icon`),b=u(`el-button`),x=u(`code-icon`),S=u(`el-drawer`);return v(),p(S,{"model-value":t.visible,direction:`rtl`,size:`380px`,title:t.$t(`codingBridge.history.title`),"onUpdate:modelValue":c[1]||=e=>t.$emit(`update:visible`,e)},{default:m(()=>[e(`div`,Ai,[e(`div`,ji,[e(`p`,Mi,i(t.$t(`codingBridge.history.intro`)),1),a(b,{size:`small`,round:``,loading:t.loading,onClick:t.refresh},{default:m(()=>[t.loading?o(``,!0):(v(),p(y,{key:0,class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),r(` `+i(t.$t(`codingBridge.history.refresh`)),1)]),_:1},8,[`loading`,`onClick`])]),t.providerOptions.length>1?(v(),s(`div`,Ni,[(v(!0),s(l,null,g(t.providerOptions,r=>(v(),s(`button`,{key:r.value,type:`button`,class:n([`chip`,{"chip--active":t.isSelected(r.value)}]),"aria-pressed":t.isSelected(r.value),onClick:e=>t.toggle(r.value)},[r.icon?(v(),s(`img`,{key:0,src:r.icon.src,class:n([`provider-icon`,{"provider-icon--invert":r.icon.invertOnDark}]),alt:``,"aria-hidden":`true`},null,10,Fi)):(v(),p(x,{key:1,class:`provider-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,null,i(r.label),1),e(`span`,Ii,i(r.count),1)],10,Pi))),128)),t.selectedProviders.length?(v(),s(`button`,{key:0,type:`button`,class:`chip-clear`,onClick:c[0]||=(...e)=>t.clearFilter&&t.clearFilter(...e)},i(t.$t(`codingBridge.history.filterAll`)),1)):o(``,!0)])):o(``,!0),t.currentNodeId?t.loading&&!t.allSessions.length?(v(),s(`div`,Ri,i(t.$t(`codingBridge.history.loading`)),1)):t.allSessions.length?t.sessions.length?(v(),s(`ul`,Hi,[(v(!0),s(l,null,g(t.sessions,r=>(v(),s(`li`,{key:r.provider+`:`+r.session_id,class:`item rounded-lg p-3 cursor-pointer border border-[var(--app-border-subtle)]`,onClick:e=>t.open(r)},[e(`div`,Wi,[t.providerIcon(r.provider)?(v(),s(`img`,{key:0,src:t.providerIcon(r.provider).src,class:n([`provider-icon`,{"provider-icon--invert":t.providerIcon(r.provider).invertOnDark}]),alt:t.providerLabel(r.provider)},null,10,Gi)):(v(),p(x,{key:1,class:`provider-icon`,title:t.providerLabel(r.provider),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`title`])),e(`span`,{class:n([`text-sm truncate flex-1`,r.unread?`font-bold`:`font-normal`]),title:r.unread?t.$t(`codingBridge.history.unread`):void 0},i(r.title),11,Ki),r.running?(v(),s(`span`,{key:2,class:`running-dot`,title:t.$t(`codingBridge.history.running`)},null,8,qi)):o(``,!0)]),e(`div`,Ji,[r.cwd?(v(),s(`span`,Yi,i(r.cwd),1)):o(``,!0),r.git_branch?(v(),s(`span`,Xi,` · `+i(r.git_branch),1)):o(``,!0)]),e(`div`,Zi,[r.updated_at?(v(),s(`span`,Qi,i(t.formatTime(r.updated_at)),1)):o(``,!0),r.message_count?(v(),s(`span`,$i,` · `+i(t.$t(`codingBridge.history.messages`,{count:r.message_count})),1)):o(``,!0)])],8,Ui))),128))])):(v(),s(`div`,Bi,[e(`p`,Vi,i(t.$t(`codingBridge.history.filterEmpty`)),1),a(b,{class:`mt-2`,size:`small`,round:``,onClick:t.clearFilter},{default:m(()=>[r(i(t.$t(`codingBridge.history.filterAll`)),1)]),_:1},8,[`onClick`])])):(v(),s(`div`,zi,i(t.$t(`codingBridge.history.empty`)),1)):(v(),s(`div`,Li,i(t.$t(`codingBridge.session.noDevice`)),1))])]),_:1},8,[`model-value`,`title`])}var ta=y({name:`CodingBridgeIndex`,components:{ElDrawer:w,NodeList:$e,SessionView:ni,PairDialog:_i,PermissionDialog:Di,HistoryDrawer:q(ki,[[`render`,ea],[`__scopeId`,`data-v-abb16563`]])},data(){return{drawer:!1,pairVisible:!1,historyVisible:!1,initialCode:``}},mounted(){this.$store.dispatch(`codingBridge/connect`),this.$store.dispatch(`codingBridge/getNodes`);let e=this.$route.query.code;typeof e==`string`&&e&&(this.initialCode=e,this.pairVisible=!0),this.restoreFromUrl(),this.handleNotificationDeepLink(),this.cleanUrl()},beforeUnmount(){this.$store.dispatch(`codingBridge/disconnect`)},methods:{openPair(){this.initialCode=``,this.pairVisible=!0},openPairFromDrawer(){this.drawer=!1,this.openPair()},restoreFromUrl(){let e=this.$route.query,t=typeof e.session==`string`?e.session:``,n=typeof e.node==`string`?e.node:``;if(!t||!n)return;let r=e.provider===`codex`||e.provider===`copilot`?e.provider:`claude`;this.$store.commit(`codingBridge/setCurrentNode`,n),this.$store.commit(`codingBridge/setHistoryRef`,{node_id:n,provider:r,session_id:t}),this.$store.dispatch(`codingBridge/getHistory`,n),this.$store.dispatch(`codingBridge/requestSessions`,n)},cleanUrl(){let e=this.$route.query,t=[`session`,`node`,`provider`,`request`,`code`];if(!t.some(t=>t in e))return;let n={...e};t.forEach(e=>delete n[e]),this.$router.replace({query:n}).catch(()=>{})},handleNotificationDeepLink(){let e=this.$route.query.node;typeof e==`string`&&e&&(this.$route.query.session||this.$store.dispatch(`codingBridge/selectNode`,e),this.$store.dispatch(`codingBridge/requestPendingPermissions`,e))}}}),na={class:`coding-bridge flex flex-row h-full relative`};function ra(e,t,n,r,i,o){let c=u(`node-list`),l=u(`session-view`),d=u(`el-drawer`),f=u(`pair-dialog`),p=u(`permission-dialog`),h=u(`history-drawer`);return v(),s(`div`,na,[a(c,{class:`sidebar w-[300px] flex-none`,onPair:e.openPair},null,8,[`onPair`]),a(l,{class:`flex-1 min-w-0`,onHistory:t[0]||=t=>e.historyVisible=!0,onDevices:t[1]||=t=>e.drawer=!0}),a(d,{modelValue:e.drawer,"onUpdate:modelValue":t[2]||=t=>e.drawer=t,direction:`ltr`,"with-header":!1,size:`300px`,class:`drawer`},{default:m(()=>[a(c,{onPair:e.openPairFromDrawer},null,8,[`onPair`])]),_:1},8,[`modelValue`]),a(f,{visible:e.pairVisible,"onUpdate:visible":t[3]||=t=>e.pairVisible=t,"initial-code":e.initialCode},null,8,[`visible`,`initial-code`]),a(p),a(h,{visible:e.historyVisible,"onUpdate:visible":t[4]||=t=>e.historyVisible=t},null,8,[`visible`])])}var ia=q(ta,[[`render`,ra],[`__scopeId`,`data-v-2879fe0f`]]);export{ia as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,S as c,T as l,at as u,bt as d,ht as f,it as p,j as m,mt as h,qt as g,rt as _,st as v,tt as y,x as b,z as x}from"./vendor-chart-Dw-P17PN.js";import{F as S}from"./icon-CDmWyIgD.js";import{r as C,t as w}from"./select-D9aYzMf6.js";import{t as T}from"./upload-CO2xuaQ0.js";import{t as E}from"./tooltip-CEa69fVd.js";import{t as D}from"./alert-BprQRUmf.js";import{h as O,v as k}from"./models-Cmo-VT-F.js";import{t as A}from"./drawer-DfXjJO_e.js";import{t as j}from"./input-number-BdXZiGUI.js";import{t as M}from"./switch-COo_nVp9.js";import{t as N}from"./check-CdRY2Yxz.js";import{t as P}from"./clock-DmG68B_m.js";import{t as F}from"./download-Bcw7Hy-X.js";import{t as ee}from"./gauge-CRZ3LNGr.js";import{a as te,i as ne,n as re,o as ie,r as I,s as ae,t as oe}from"./pagination-Cs8AeOMZ.js";import{t as se}from"./info-Dy6jE77P.js";import{t as L}from"./languages-oV5N_Alp.js";import{t as ce}from"./loader-circle-BhLoljYa.js";import{t as le}from"./palette-CNvk-C8x.js";import{t as ue}from"./paperclip-B5A5e-4V.js";import{t as de}from"./pause-CWUerwP0.js";import{t as fe}from"./play-D_HvuPrY.js";import{t as pe}from"./rotate-cw-quVDw14L.js";import{t as me}from"./trash-2-C8cED3lx.js";import{t as he}from"./triangle-alert-BShpWZ9W.js";import{t as ge}from"./video-CB-yDNZ5.js";import{t as R}from"./wand-sparkles-4VXENbf1.js";import{$r as _e,Br as z,Fr as ve,Jr as ye,Kr as be,Lr as xe,Qr as B,Rr as Se,Ur as Ce,Vr as V,Xr as we,zr as Te}from"./constants-D0qyO-4p.js";import{Aa as H,An as Ee,Cr as U,J as De,Li as Oe,O as ke,On as Ae,Pn as W,Si as je,Tr as Me,ga as Ne,ii as Pe,jn as Fe,k as G,oi as Ie,pa as Le,tt as Re,wi as K,wr as q}from"./index-C2sgIqPl.js";import{t as ze}from"./CopyToClipboard-DwP8EnVL.js";import{t as Be}from"./ReportButton-Bm62Lacf.js";import{t as Ve}from"./FilePreview-B0LZbgoP.js";import{t as He}from"./ImagePreview-DsNhLxjj.js";import{n as Ue}from"./taskDrawerMixin-DyAUhFEq.js";import{t as We}from"./ServicePricingSummary-D4FVsXlm.js";import{t as Ge}from"./AudioPreview-QpcH3q7k.js";import{t as Ke}from"./VideoPlayer-FSh3nDpc.js";import{t as qe}from"./VideoPreview-B-THygEm.js";import{t as Je}from"./ScenarioPaymentMode-D4tV55rH.js";import{t as Ye}from"./ApiCodeButton-C7scE7xM.js";import{t as Xe}from"./BotPlaceholder-DEGkOm1v.js";import{i as Ze,n as J,r as Qe,t as $e}from"./maestroLanguages-v8t3x-bv.js";var et=x({name:`LayoutMaestro`,components:{MagicIcon:R,ElDrawer:A,ElButton:H},mixins:[Ue]}),tt={class:`main flex flex-row flex-1`},nt={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)]`},rt={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function it(t,n,r,i,o,c){let l=u(`magic-icon`),d=u(`el-button`),m=u(`el-drawer`);return y(),s(`div`,tt,[e(`div`,nt,[p(t.$slots,`config`,{},void 0,!0)]),e(`div`,rt,[p(t.$slots,`result`,{},void 0,!0)]),f(a(d,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:h(()=>[a(l,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[b,!t.tasksEmpty]]),a(m,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:h(()=>[p(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var at=G(et,[[`render`,it],[`__scopeId`,`data-v-808f6ae5`]]),ot=x({name:`MaestroFileUrlsInput`,components:{AttachmentIcon:ue,ElUpload:T,ElButton:H},mixins:[Re,De],data(){return{fileList:[],uploadUrl:Le()+`/api/v1/files/`,MAESTRO_FILE_ACCEPT:ye,MAESTRO_FILE_LIMIT:6}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},value(){return this.$store.state.maestro?.config?.file_urls||[]}},watch:{value:{immediate:!0,handler(e){let t=new Map(this.fileList.map(e=>[e?.response?.file_url||e.url,e])),n=e.map(e=>t.get(e)||{name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}}),r=this.fileList.filter(e=>!(e?.response?.file_url||e.url));this.fileList=[...n,...r]}}},methods:{onExceed(){k.warning(this.$t(`maestro.message.uploadExceed`))},onError(){k.error(this.$t(`maestro.message.uploadError`))},onChange(){let e=this.fileList.map(e=>e?.response?.file_url||e.url).filter(e=>!!e);this.$store.commit(`maestro/setConfig`,{...this.$store.state.maestro?.config,file_urls:e})}}});function st(e,t,n,o,c,l){let d=u(`attachment-icon`),f=u(`el-button`),p=u(`el-upload`);return y(),s(`div`,null,[a(p,{ref:`uploader`,"file-list":e.fileList,"onUpdate:fileList":t[0]||=t=>e.fileList=t,accept:e.MAESTRO_FILE_ACCEPT,name:`file`,class:`w-full`,limit:e.MAESTRO_FILE_LIMIT,multiple:!0,"before-upload":e.beforeUploadSizeGuard,action:e.uploadUrl,headers:e.headers,"on-exceed":e.onExceed,"on-error":e.onError,"on-success":e.onChange,"on-remove":e.onChange},{default:h(()=>[a(f,{size:`small`,round:``},{default:h(()=>[a(d,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(e.$t(`maestro.button.uploadFiles`)),1)]),_:1})]),_:1},8,[`file-list`,`accept`,`limit`,`before-upload`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`,`on-remove`])])}var ct=G(ot,[[`render`,st]]),lt={draft:`lite`,premium:`pro`};function ut(e){let t=e?.trim().toLowerCase()||`standard`;return t in B?t:lt[t]||`standard`}function Y(e,t){let n=Math.min(30,B[t].maxDuration),r=typeof e==`number`&&Number.isFinite(e)?Math.round(e):n;return Math.min(B[t].maxDuration,Math.max(5,r))}function X(e,t){return(e?.length?e:[`zh-cn`]).slice(0,B[t].maxLanguages)}function Z(e,t){return B[t].scenarios.includes(e)}function dt(e,t,n=`auto`,r=1){let i=n===`drama`?1.35:n===`avatar`?1.15:1,a=Math.max(0,r-1)*6;return Number((e*B[t].rate*i+a).toFixed(2))}var ft={"9:16":{width:15,height:26},"16:9":{width:26,height:15},"1:1":{width:20,height:20}},pt=x({name:`ConfigPanel`,components:{MagicIcon:R,ElButton:H,ElSelect:C,ElOption:w,ElInputNumber:j,ElAlert:D,ElSwitch:M,InfoIcon:te,PauseIcon:de,PlayIcon:fe,PromptTextarea:ne,FileUrlsInput:ct,ScenarioPaymentMode:Je,ServicePricingSummary:We},emits:[`generate`],data(){return{MAESTRO_MIN_DURATION:5,MAESTRO_ALLOWED_QUALITIES:xe,MAESTRO_SKU_POLICIES:B,MAESTRO_ALLOWED_SCENARIOS:Se,MAESTRO_SCENARIO_THUMBNAILS:we,MAESTRO_ALLOWED_STYLES:Te,MAESTRO_ALLOWED_VOICES:z,playing:!1,audioEl:null,quoteTimer:0,quoteRunId:0}},computed:{config(){return this.$store.state.maestro?.config},service(){return this.$store.state.maestro?.service},ratioOptions(){return ve.map(e=>({value:e,...ft[e]??{width:20,height:20}}))},isRemixing(){let e=this.config?.action;return!!e&&e!==`generate`&&!!this.config?.ref_task_id},refTaskId(){return this.config?.ref_task_id},needsRequiredUpload(){if(!this.scenarioCustomizationEnabled)return!1;let e=this.config?.scenario;if(!e||!_e.includes(e))return!1;let t=this.config?.file_urls||[];return e===`captions`?!t.some(e=>W(e)):!t.some(e=>Fe(e))},canGenerate(){return!!this.prompt?.trim()&&!this.needsRequiredUpload},prompt:{get(){return this.config?.prompt},set(e){this.update({prompt:e})}},langs:{get(){return J(this.config?.langs)},set(e){this.update({langs:J(e)})}},languageOptions(){return $e(this.$i18n.locale)},additionalLanguageOptions(){return this.languageOptions.filter(e=>e.value!==this.primaryLanguage)},primaryLanguage:{get(){return this.langs[0]||Ce[0]},set(e){this.update({langs:Ze(this.langs,e)})}},additionalLanguages:{get(){return this.langs.slice(1)},set(e){this.update({langs:X(Qe(this.langs,e),this.quality)})}},activeSkuPolicy(){return B[this.quality]},additionalLanguageLimit(){return Math.max(0,this.activeSkuPolicy.maxLanguages-1)},estimatedCredits(){let e=this.scenarioCustomizationEnabled&&this.scenario||`auto`;return dt(this.duration||30,this.quality,e,this.langs.length)},aspect:{get(){return this.config?.aspect},set(e){this.update({aspect:e})}},duration:{get(){return this.config?.duration},set(e){this.update({duration:Y(e,this.quality)})}},quality:{get(){return ut(this.config?.quality)},set(e){let t={quality:e,duration:Y(this.duration,e),langs:X(this.langs,e)};this.scenarioCustomizationEnabled&&!Z(this.scenario||`auto`,e)&&(t.scenario=`narrated`),e===`lite`&&this.config?.action===`remix`&&(t.action=V,t.ref_task_id=void 0),e!==`pro`&&this.config?.action===`extend`&&(t.action=V,t.ref_task_id=void 0),this.update(t)}},scenarioCustomizationEnabled:{get(){return this.config?.scenario_customization_enabled??!1},set(e){this.update({scenario_customization_enabled:e})}},styleCustomizationEnabled:{get(){return this.config?.style_customization_enabled??!1},set(e){this.update({style_customization_enabled:e})}},voiceCustomizationEnabled:{get(){return this.config?.voice_customization_enabled??!1},set(e){e||this.stopSample(),this.update({voice_customization_enabled:e})}},scenario:{get(){return this.config?.scenario},set(e){this.update({scenario:e})}},style:{get(){return this.config?.style},set(e){let t=e?.trim();this.update({style:!t||t.toLowerCase()===`auto`?be:t})}},voice:{get(){return this.config?.voice},set(e){this.stopSample(),this.update({voice:e||`warm-female`})}},currentSample(){return z.find(e=>e.key===this.voice)?.sample},walletMode(){return je()&&K(`maestro`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0},voiceCustomizationEnabled(e){e||this.stopSample()},voice(){this.stopSample()}},mounted(){let e=ut(this.config?.quality),t=X(J(this.config?.langs),e),n=this.config?.scenario||`narrated`;this.update({action:this.config?.action??`generate`,langs:t,aspect:this.config?.aspect??`9:16`,duration:Y(this.config?.duration,e),quality:e,scenario:Z(n,e)?n:`narrated`})},beforeUnmount(){this.stopSample(),window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{isScenarioAvailable(e){return Z(e,this.quality)},requiredSkuForScenario(e){return Z(e,`standard`)?`Standard`:`Pro`},scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteTimer=window.setTimeout(this.refreshQuote,350)},async refreshQuote(){let e=K(`maestro`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await q.quote(U(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)}},update(e){this.$store.commit(`maestro/setConfig`,{...this.config,...e})},onClearRemix(){this.update({action:V,ref_task_id:void 0})},onToggleSample(){let e=this.currentSample;if(e){if(this.audioEl||(this.audioEl=d(new Audio),this.audioEl.addEventListener(`ended`,()=>{this.playing=!1})),this.playing){this.audioEl.pause(),this.playing=!1;return}this.audioEl.src!==e&&(this.audioEl.src=e),this.audioEl.currentTime=0,this.audioEl.play().then(()=>{this.playing=!0}).catch(()=>{this.playing=!1})}},stopSample(){this.audioEl&&(this.audioEl.pause(),this.audioEl.currentTime=0),this.playing=!1},onGenerate(){this.$emit(`generate`)}}}),mt={class:`flex flex-col h-full`},ht={class:`flex-1 overflow-y-auto p-5`},gt={class:`text-xs mb-1`},_t={class:`field-block mb-5`},vt={class:`field-head`},yt={class:`field-title font-bold`},bt={class:`field-block mb-5`},xt={class:`field-head`},St={class:`field-title font-bold`},Ct={class:`language-picker`},wt={class:`language-role language-role--primary`},Tt={class:`language-role-label`},Et={class:`language-role`},Dt={class:`language-role-label`},Ot={class:`field-block mb-5`},kt={class:`field-head`},At={class:`field-title font-bold`},jt=[`aria-label`],Mt=[`aria-checked`,`aria-label`,`onClick`,`onKeydown`],Nt={class:`ratio-preview`},Pt={class:`ratio-name`},Ft={class:`field-row mb-4`},It={class:`field-head`},Lt={class:`field-title font-bold`},Rt={class:`field-block sku-field`},zt={class:`field-head`},Bt={class:`field-title font-bold`},Vt=[`aria-label`],Ht=[`aria-checked`,`onClick`],Ut={class:`sku-card-name`},Wt={class:`sku-card-price`},Gt={class:`sku-card-meta`},Kt={class:`sku-summary`},qt={class:`custom-field`},Jt={class:`custom-field-header mb-2`},Yt={class:`field-head`},Xt={class:`field-title font-bold`},Zt=[`aria-label`,`aria-disabled`],Qt=[`aria-checked`,`aria-disabled`,`aria-label`,`tabindex`,`onClick`,`onKeydown`],$t={class:`scenario-thumb`},en=[`src`,`alt`],tn={class:`scenario-name`},nn={key:0,class:`scenario-lock`},rn={class:`custom-field`},an={class:`custom-field-header mb-2`},on={class:`field-head`},sn={class:`field-title font-bold`},cn={class:`custom-field`},ln={class:`custom-field-header mb-2`},un={class:`field-head`},dn={class:`field-title font-bold`},fn={class:`voice-row`},pn={class:`flex flex-col items-center justify-center px-5 pb-5`};function mn(d,f,p,v,b,x){let S=u(`magic-icon`),C=u(`el-button`),w=u(`el-alert`),T=u(`prompt-textarea`),E=u(`info-icon`),D=u(`file-urls-input`),O=u(`el-option`),k=u(`el-select`),A=u(`el-input-number`),j=u(`el-switch`),M=u(`pause-icon`),N=u(`play-icon`),P=u(`scenario-payment-mode`),F=u(`service-pricing-summary`);return y(),s(`div`,mt,[e(`div`,ht,[d.isRemixing?(y(),m(w,{key:0,closable:!1,type:`info`,class:`mb-5`},{default:h(()=>[e(`p`,gt,[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`maestro.name.remixing`))+`: `+i(d.refTaskId),1)]),a(C,{size:`small`,text:``,onClick:d.onClearRemix},{default:h(()=>[r(i(d.$t(`maestro.button.cancelRemix`)),1)]),_:1},8,[`onClick`])]),_:1})):o(``,!0),a(T,{modelValue:d.prompt,"onUpdate:modelValue":f[0]||=e=>d.prompt=e,class:`mb-5`,title:d.$t(`maestro.name.prompt`),info:d.$t(`maestro.description.prompt`),placeholder:d.$t(`maestro.placeholder.prompt`),"min-rows":6},null,8,[`modelValue`,`title`,`info`,`placeholder`]),e(`div`,_t,[e(`div`,vt,[e(`h2`,yt,i(d.$t(`maestro.name.files`)),1),a(E,{content:d.$t(`maestro.description.files`),class:`ml-1`},null,8,[`content`])]),a(D)]),e(`div`,bt,[e(`div`,xt,[e(`h2`,St,i(d.$t(`maestro.name.langs`)),1),a(E,{content:d.$t(`maestro.description.langs`),class:`ml-1`},null,8,[`content`])]),e(`div`,Ct,[e(`label`,wt,[e(`span`,Tt,i(d.$t(`maestro.name.primaryLanguage`)),1),a(k,{modelValue:d.primaryLanguage,"onUpdate:modelValue":f[1]||=e=>d.primaryLanguage=e,class:`w-full`},{default:h(()=>[(y(!0),s(l,null,_(d.languageOptions,e=>(y(),m(O,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`])]),e(`label`,Et,[e(`span`,Dt,i(d.$t(`maestro.name.additionalLanguages`)),1),a(k,{modelValue:d.additionalLanguages,"onUpdate:modelValue":f[2]||=e=>d.additionalLanguages=e,multiple:``,"collapse-tags":``,"collapse-tags-tooltip":``,"multiple-limit":d.additionalLanguageLimit,placeholder:d.$t(`maestro.placeholder.additionalLanguages`),class:`w-full`},{default:h(()=>[(y(!0),s(l,null,_(d.additionalLanguageOptions,e=>(y(),m(O,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`multiple-limit`,`placeholder`])])])]),e(`div`,Ot,[e(`div`,kt,[e(`h2`,At,i(d.$t(`maestro.name.aspect`)),1)]),e(`div`,{class:`ratio-items`,role:`radiogroup`,"aria-label":d.$t(`maestro.name.aspect`)},[(y(!0),s(l,null,_(d.ratioOptions,r=>(y(),s(`div`,{key:r.value,class:n([`ratio-item`,{active:d.aspect===r.value}]),role:`radio`,"aria-checked":d.aspect===r.value,"aria-label":r.value,tabindex:`0`,onClick:e=>d.aspect=r.value,onKeydown:[c(t(e=>d.aspect=r.value,[`prevent`]),[`enter`]),c(t(e=>d.aspect=r.value,[`prevent`]),[`space`])]},[e(`div`,Nt,[e(`div`,{class:`ratio-rect`,style:g({width:r.width+`px`,height:r.height+`px`})},null,4)]),e(`p`,Pt,i(r.value),1)],42,Mt))),128))],8,jt)]),e(`div`,Ft,[e(`div`,It,[e(`h2`,Lt,i(d.$t(`maestro.name.duration`)),1),a(E,{content:d.$t(`maestro.description.duration`),class:`ml-1`},null,8,[`content`])]),a(A,{modelValue:d.duration,"onUpdate:modelValue":f[3]||=e=>d.duration=e,class:`field-control`,min:d.MAESTRO_MIN_DURATION,max:d.activeSkuPolicy.maxDuration,step:5,"controls-position":`right`},null,8,[`modelValue`,`min`,`max`])]),e(`div`,Rt,[e(`div`,zt,[e(`h2`,Bt,i(d.$t(`maestro.name.quality`)),1),a(E,{content:d.$t(`maestro.description.quality`),class:`ml-1`},null,8,[`content`])]),e(`div`,{class:`sku-cards`,role:`radiogroup`,"aria-label":d.$t(`maestro.name.quality`)},[(y(!0),s(l,null,_(d.MAESTRO_ALLOWED_QUALITIES,t=>(y(),s(`button`,{key:t,type:`button`,class:n([`sku-card`,{active:d.quality===t}]),role:`radio`,"aria-checked":d.quality===t,onClick:e=>d.quality=t},[e(`span`,Ut,i(d.$t(`maestro.option.quality.${t}`)),1),e(`strong`,Wt,i(d.MAESTRO_SKU_POLICIES[t].rate)+` Cr/s`,1),e(`span`,Gt,i(d.MAESTRO_SKU_POLICIES[t].resolution)+` · `+i(d.MAESTRO_SKU_POLICIES[t].fps)+` fps · `+i(d.$t(`maestro.name.upToSeconds`,{seconds:d.MAESTRO_SKU_POLICIES[t].maxDuration})),1)],10,Ht))),128))],8,Vt),e(`div`,Kt,[e(`span`,null,i(d.$t(`maestro.description.quality.${d.quality}`)),1),e(`strong`,null,i(d.$t(`maestro.name.estimatedCredits`,{credits:d.estimatedCredits})),1)])]),e(`div`,qt,[e(`div`,Jt,[e(`div`,Yt,[e(`h2`,Xt,i(d.$t(`maestro.name.customizeScenario`)),1),a(E,{content:d.$t(`maestro.description.scenario`),class:`ml-1`},null,8,[`content`])]),a(j,{modelValue:d.scenarioCustomizationEnabled,"onUpdate:modelValue":f[4]||=e=>d.scenarioCustomizationEnabled=e,"aria-label":d.$t(`maestro.name.customizeScenario`)},null,8,[`modelValue`,`aria-label`])]),e(`div`,{class:n([`scenario-cards`,{"is-disabled":!d.scenarioCustomizationEnabled}]),role:`radiogroup`,"aria-label":d.$t(`maestro.name.scenario`),"aria-disabled":!d.scenarioCustomizationEnabled},[(y(!0),s(l,null,_(d.MAESTRO_ALLOWED_SCENARIOS,r=>(y(),s(`div`,{key:r,class:n([`scenario-card`,{active:d.scenarioCustomizationEnabled&&d.scenario===r,disabled:!d.scenarioCustomizationEnabled||!d.isScenarioAvailable(r)}]),role:`radio`,"aria-checked":d.scenarioCustomizationEnabled&&d.scenario===r,"aria-disabled":!d.scenarioCustomizationEnabled||!d.isScenarioAvailable(r),"aria-label":d.$t(`maestro.option.scenario.${r}`),tabindex:d.scenarioCustomizationEnabled&&d.isScenarioAvailable(r)?0:-1,onClick:e=>d.scenarioCustomizationEnabled&&d.isScenarioAvailable(r)&&(d.scenario=r),onKeydown:[c(t(e=>d.scenarioCustomizationEnabled&&d.isScenarioAvailable(r)&&(d.scenario=r),[`prevent`]),[`enter`]),c(t(e=>d.scenarioCustomizationEnabled&&d.isScenarioAvailable(r)&&(d.scenario=r),[`prevent`]),[`space`])]},[e(`div`,$t,[e(`img`,{src:d.MAESTRO_SCENARIO_THUMBNAILS[r],alt:d.$t(`maestro.option.scenario.${r}`),loading:`lazy`},null,8,en)]),e(`p`,tn,i(d.$t(`maestro.option.scenario.${r}`)),1),d.isScenarioAvailable(r)?o(``,!0):(y(),s(`span`,nn,i(d.$t(`maestro.name.requiresSku`,{sku:d.requiredSkuForScenario(r)})),1))],42,Qt))),128))],10,Zt),d.needsRequiredUpload?(y(),m(w,{key:0,title:d.$t(d.scenario===`avatar`?`maestro.message.avatarNeedsImage`:`maestro.message.captionsNeedVideo`),type:`warning`,closable:!1,"show-icon":``,class:`mt-2`},null,8,[`title`])):o(``,!0)]),e(`div`,rn,[e(`div`,an,[e(`div`,on,[e(`h2`,sn,i(d.$t(`maestro.name.customizeStyle`)),1),a(E,{content:d.$t(`maestro.description.style`),class:`ml-1`},null,8,[`content`])]),a(j,{modelValue:d.styleCustomizationEnabled,"onUpdate:modelValue":f[5]||=e=>d.styleCustomizationEnabled=e,"aria-label":d.$t(`maestro.name.customizeStyle`)},null,8,[`modelValue`,`aria-label`])]),a(k,{modelValue:d.style,"onUpdate:modelValue":f[6]||=e=>d.style=e,class:`w-full`,filterable:``,"allow-create":``,"default-first-option":``,disabled:!d.styleCustomizationEnabled,"aria-label":d.$t(`maestro.name.customizeStyle`),placeholder:d.$t(`maestro.placeholder.select`)},{default:h(()=>[(y(!0),s(l,null,_(d.MAESTRO_ALLOWED_STYLES,e=>(y(),m(O,{key:e,label:d.$t(`maestro.option.style.${e}`),value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`disabled`,`aria-label`,`placeholder`])]),e(`div`,cn,[e(`div`,ln,[e(`div`,un,[e(`h2`,dn,i(d.$t(`maestro.name.customizeVoice`)),1),a(E,{content:d.$t(`maestro.description.voice`),class:`ml-1`},null,8,[`content`])]),a(j,{modelValue:d.voiceCustomizationEnabled,"onUpdate:modelValue":f[7]||=e=>d.voiceCustomizationEnabled=e,"aria-label":d.$t(`maestro.name.customizeVoice`)},null,8,[`modelValue`,`aria-label`])]),e(`div`,fn,[a(k,{modelValue:d.voice,"onUpdate:modelValue":f[8]||=e=>d.voice=e,class:`voice-select`,disabled:!d.voiceCustomizationEnabled,"aria-label":d.$t(`maestro.name.customizeVoice`),placeholder:d.$t(`maestro.placeholder.select`)},{default:h(()=>[(y(!0),s(l,null,_(d.MAESTRO_ALLOWED_VOICES,e=>(y(),m(O,{key:e.key,label:d.$t(`maestro.option.voice.${e.key}`),value:e.key},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`disabled`,`aria-label`,`placeholder`]),a(C,{class:`voice-play`,disabled:!d.voiceCustomizationEnabled||!d.currentSample,title:d.$t(`maestro.button.preview`),"aria-label":d.$t(`maestro.button.preview`),onClick:d.onToggleSample},{default:h(()=>[d.playing?(y(),m(M,{key:0,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(y(),m(N,{key:1,size:`1em`,"aria-hidden":`true`,focusable:`false`}))]),_:1},8,[`disabled`,`title`,`aria-label`,`onClick`])])])]),e(`div`,pn,[a(P,{scenario:`maestro`}),d.walletMode?o(``,!0):(y(),m(F,{key:0,value:d.estimatedCredits,service:d.service},null,8,[`value`,`service`])),a(C,{type:`primary`,class:`btn w-full`,round:``,disabled:!d.canGenerate,onClick:d.onGenerate},{default:h(()=>[a(S,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`maestro.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var hn=G(pt,[[`render`,mn],[`__scopeId`,`data-v-4b93fb03`]]),gn=50,_n=1e4,Q=new Map,$=new Map,vn=(e,t)=>{if(Q.set(e,t),Q.size>gn){let e=Q.keys().next().value;e&&Q.delete(e)}};async function yn(e,t){let n=`${t.credentialKey}:${e}`,r=Q.get(n);if(r)return r;let i=$.get(n);if(i)return i.promise;let a=new AbortController,o,s={controller:a,promise:void 0},c=q.task(e,{token:t.token,signal:a.signal}).then(({data:e})=>{if(!a.signal.aborted)return vn(n,e),e}).catch(t=>{a.signal.aborted||console.warn(`failed to load maestro remix reference task`,e,t)}),l=new Promise(e=>{o=window.setTimeout(()=>{a.abort(),e(void 0)},_n)});return s.promise=Promise.race([c,l]).finally(()=>{o!==void 0&&window.clearTimeout(o),$.get(n)===s&&$.delete(n)}),$.set(n,s),s.promise}var bn=[`plan`,`source`,`voice`,`compose`,`render`,`deliver`];function xn(e){if(!e)return-1;let t=e.toLowerCase(),n=bn.indexOf(t);return n>=0?n:/plan|storyboard|script|brief/.test(t)?0:/source|search|image|photo|asset|media/.test(t)?1:/voice|tts|audio|narrat/.test(t)?2:/compose|composit|build|layout|scene/.test(t)?3:/render|encode/.test(t)?4:/deliver|upload|cdn|complete|done|finish/.test(t)?5:-1}var Sn=x({name:`ProgressSteps`,components:{ElIcon:S,Loading:ce,Check:N},props:{modelValue:{type:Object,required:!0}},computed:{currentIndex(){let e=this.modelValue?.response?.data?.progress||[],t=-1;for(let n of e)t=Math.max(t,xn(n?.stage));return t=Math.max(t,xn(this.modelValue?.response?.data?.stage)),Math.max(t,0)},detail(){let e=this.modelValue?.response?.data;if(e?.activity)return e.activity;let t=e?.progress||[];for(let e=t.length-1;e>=0;e--)if(t[e]?.message)return t[e]?.message},steps(){return bn.map(e=>({key:e}))}},methods:{stateOf(e){let t=this.currentIndex;return e<t?`done`:e===t?`active`:`pending`}}}),Cn={class:`progress-steps`,"aria-live":`polite`},wn=[`aria-current`],Tn={class:`ico`},En={class:`txt`},Dn={key:0,class:`detail`};function On(t,r,c,d,f,p){let g=u(`loading`),v=u(`el-icon`),b=u(`check`);return y(),s(`div`,Cn,[(y(!0),s(l,null,_(t.steps,(r,c)=>(y(),s(`div`,{key:r.key,class:n([`step`,t.stateOf(c)]),"aria-current":c===t.currentIndex?`step`:void 0},[e(`span`,Tn,[c===t.currentIndex?(y(),m(v,{key:0,class:`is-loading`,"aria-label":t.$t(`maestro.step.${r.key}`)},{default:h(()=>[a(g,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`])):c<t.currentIndex?(y(),m(v,{key:1},{default:h(()=>[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1})):o(``,!0)]),e(`span`,En,i(t.$t(`maestro.step.${r.key}`)),1)],10,wn))),128)),t.detail?(y(),s(`p`,Dn,i(t.detail),1)):o(``,!0)])}var kn=G(Sn,[[`render`,On],[`__scopeId`,`data-v-8a883977`]]),An=[`succeeded`,`failed`],jn=[1e3,3e3],Mn=x({name:`TaskPreview`,components:{DeleteIcon:me,ElTooltip:E,ChannelIcon:ae,DownloadIcon:F,InfoIcon:se,LanguageIcon:L,MagicIcon:R,RedoIcon:pe,TimeIcon:P,WarningIcon:he,CopyToClipboard:ze,ElAlert:D,VideoPlayer:Ke,ElButton:H,ApiCodeButton:Ye,ReportButton:Be,ImagePreview:He,AudioPreview:Ge,VideoPreview:qe,FilePreview:Ve,ProgressSteps:kn},props:{modelValue:{type:Object,required:!0}},data(){return{fetchedReferenceTask:void 0,fetchedReferenceKey:void 0,referenceLoadAttempt:0,referenceLoadFailed:!1,referenceLoadTimer:void 0,referenceLoadVersion:0}},computed:{variants(){return this.modelValue?.response?.data?.variants||[]},files(){let e=[...this.modelValue?.request?.file_urls||[]];if(this.referenceTaskId)for(let t of this.referenceTask?.response?.data?.variants||[])t.output_url&&e.push(t.output_url);return[...new Set(e)].filter(e=>!!e).map(e=>{let t=e.split(`?`)[0].split(`#`)[0],n=Fe(t)?`image`:W(t)?`video`:Ee(t)?`audio`:`file`;return{url:e,name:this.fileName(t),kind:n}})},referenceTaskId(){let e=this.modelValue?.request;return e?.action===`remix`?e?.ref_task_id:void 0},referenceLoadKey(){let e=this.$store.state.maestro?.credential,t=e?.token;if(!(!this.referenceTaskId||!t))return JSON.stringify([this.referenceTaskId,e?.id||e?.user_id||t,t])},referenceTask(){if(this.referenceTaskId)return this.$store.state.maestro?.tasks?.items?.find(e=>e.id===this.referenceTaskId)||(this.fetchedReferenceKey===this.referenceLoadKey?this.fetchedReferenceTask:void 0)},isTerminal(){return An.includes(this.modelValue?.status||``)},traceId(){return this.modelValue?.trace_id||this.modelValue?.response?.trace_id},progressPct(){let e=this.modelValue?.response?.data?.progress,t=e?.length?e[e.length-1]:void 0;return typeof t?.pct==`number`?t.pct:void 0},progressText(){return this.progressPct===void 0?this.statusLabel:`${this.progressPct}%`},statusLabel(){let e=`maestro.status.${this.modelValue?.status||`pending`}`,t=this.$t(e);return t===e?this.$t(`maestro.status.processing`):t},failureReason(){let e=this.modelValue?.response?.error;if(e)return typeof e==`string`?e:e?.message},requestParams(){let e=this.modelValue?.request;if(!e)return[];let t=[];return e.action&&t.push({icon:d(R),label:this.$t(`maestro.name.mode`),value:this.optionLabel(`maestro.option.action`,e.action)}),e.scenario&&t.push({icon:d(ge),label:this.$t(`maestro.name.scenario`),value:this.optionLabel(`maestro.option.scenario`,e.scenario)}),e.style&&t.push({icon:d(le),label:this.$t(`maestro.name.style`),value:this.optionLabel(`maestro.option.style`,e.style)}),e.quality&&t.push({icon:d(ee),label:this.$t(`maestro.name.quality`),value:this.optionLabel(`maestro.option.quality`,e.quality)}),e.aspect&&t.push({icon:d(ie),label:this.$t(`maestro.name.aspect`),value:e.aspect}),e.duration&&t.push({icon:d(P),label:this.$t(`maestro.name.duration`),value:`${e.duration}s`}),e.langs?.length&&t.push({icon:d(L),label:this.$t(`maestro.name.langs`),value:e.langs.join(` · `)}),t}},watch:{referenceLoadKey:{immediate:!0,handler(e){this.resetReferenceLoad(),e&&!this.referenceTask&&this.loadReferenceTask(e)}}},beforeUnmount(){this.resetReferenceLoad()},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(`maestro/deleteTask`,{id:e}),k.success(this.$t(`common.message.deleteTaskSuccess`))}catch{k.error(this.$t(`common.message.deleteTaskFailed`))}}},resetReferenceLoad(){this.referenceLoadTimer!==void 0&&window.clearTimeout(this.referenceLoadTimer),this.referenceLoadTimer=void 0,this.referenceLoadVersion+=1,this.referenceLoadAttempt=0,this.referenceLoadFailed=!1,this.fetchedReferenceTask=void 0,this.fetchedReferenceKey=void 0},async loadReferenceTask(e){if(e!==this.referenceLoadKey||this.referenceTask)return;let t=this.$store.state.maestro?.credential,n=t?.token,r=this.referenceTaskId;if(!r||!n)return;let i=t?.id||t?.user_id||n,a=this.referenceLoadVersion;this.referenceLoadAttempt+=1;let o=await yn(r,{token:n,credentialKey:i});if(a!==this.referenceLoadVersion||e!==this.referenceLoadKey)return;if(o){this.fetchedReferenceTask=o,this.fetchedReferenceKey=e,this.referenceLoadFailed=!1;return}let s=jn[this.referenceLoadAttempt-1];s===void 0?this.referenceLoadFailed=!0:this.referenceLoadTimer=window.setTimeout(()=>{this.referenceLoadTimer=void 0,this.loadReferenceTask(e)},s)},retryReferenceTask(){let e=this.referenceLoadKey;this.resetReferenceLoad(),e&&this.loadReferenceTask(e)},optionLabel(e,t){let n=`${e}.${t}`,r=this.$t(n);return r===n?t:r},fileName(e){let t=e.substring(e.lastIndexOf(`/`)+1);try{return decodeURIComponent(t)||e}catch{return t||e}},onDownload(e,t){e?.stopPropagation(),window.open(t,`_blank`)},onRemix(){if(!this.modelValue)return;let e=Me(this.$store.state.maestro?.config,this.modelValue);this.$store.commit(`maestro/setConfig`,e),k.info(this.$t(`maestro.message.remixLoaded`))}}}),Nn={class:`preview`},Pn={class:`left`},Fn={class:`main`},In={class:`bot`},Ln={class:`datetime`},Rn=[`aria-label`],zn={class:`info`},Bn={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Vn=[`href`,`title`],Hn={key:1,class:`reference-load-failed flex items-center gap-1 mt-2 text-xs text-[var(--el-text-color-secondary)]`},Un={key:2,class:`prompt mt-2`},Wn={key:0,class:`progress-pct`},Gn={key:0,class:`content`},Kn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},qn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Jn={key:1,class:`content`},Yn={class:`text-xs text-[var(--el-text-color-secondary)] mb-1`},Xn={key:0},Zn={class:`operations`},Qn={key:0},$n={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},er={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},tr={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},nr={key:2,class:`content`},rr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ir={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ar={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},or={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function sr(c,d,f,p,g,b){let x=u(`capability-presentation`),S=u(`delete-icon`),C=u(`el-tooltip`),w=u(`image-preview`),T=u(`video-preview`),E=u(`audio-preview`),D=u(`file-preview`),O=u(`info-icon`),k=u(`redo-icon`),A=u(`el-button`),j=u(`progress-steps`),M=u(`magic-icon`),N=u(`copy-to-clipboard`),P=u(`channel-icon`),F=u(`el-alert`),ee=u(`language-icon`),te=u(`video-player`),ne=u(`download-icon`),re=u(`api-code-button`),ie=u(`report-button`),I=u(`time-icon`),ae=u(`warning-icon`);return y(),s(`div`,Nn,[e(`div`,Pn,[a(x,{capability:`maestro`,part:`avatar`,class:`avatar`})]),e(`div`,Fn,[e(`div`,In,[a(x,{capability:`maestro`,part:`name`}),e(`span`,Ln,i(c.$dayjs.format(``+new Date(parseFloat((c.modelValue?.created_at||``).toString())*1e3))),1),a(C,{effect:`dark`,content:c.$t(`common.button.delete`),placement:`top`},{default:h(()=>[c.modelValue?.id?(y(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":c.$t(`common.button.delete`),onClick:d[0]||=t((...e)=>c.onDelete&&c.onDelete(...e),[`stop`])},[a(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Rn)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,zn,[c.files.length?(y(),s(`div`,Bn,[(y(!0),s(l,null,_(c.files,(e,t)=>(y(),s(l,{key:t},[e.kind===`image`?(y(),m(w,{key:0,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`])):e.kind===`video`?(y(),m(T,{key:1,url:e.url,name:e.name},null,8,[`url`,`name`])):e.kind===`audio`?(y(),m(E,{key:2,url:e.url,name:e.name},null,8,[`url`,`name`])):(y(),s(`a`,{key:3,href:e.url,title:e.name,target:`_blank`,rel:`noopener noreferrer`,class:`shrink-0 no-underline`},[a(D,{name:e.name,closable:!1},null,8,[`name`])],8,Vn))],64))),128))])):o(``,!0),c.referenceLoadFailed&&c.referenceTaskId&&!c.referenceTask?(y(),s(`div`,Hn,[a(O,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,i(c.$t(`maestro.name.files`))+`: `+i(c.$t(`maestro.name.failure`)),1),a(A,{class:`reference-retry`,size:`small`,text:``,circle:``,title:c.$t(`codingBridge.session.retry`),"aria-label":c.$t(`codingBridge.session.retry`),onClick:c.retryReferenceTask},{default:h(()=>[a(k,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`title`,`aria-label`,`onClick`])])):o(``,!0),c.modelValue?.request?.prompt?(y(),s(`p`,Un,[r(i(c.modelValue?.request?.prompt)+` `,1),c.isTerminal?o(``,!0):(y(),s(`span`,Wn,` · `+i(c.progressText),1))])):o(``,!0)]),c.isTerminal?o(``,!0):(y(),s(`div`,Gn,[a(F,{closable:!1,class:`mt-2 processing`},{default:h(()=>[a(j,{"model-value":c.modelValue},null,8,[`model-value`]),(y(!0),s(l,null,_(c.requestParams,(e,t)=>(y(),s(`p`,{key:`param-${t}`,class:n([`text-[var(--el-text-color-regular)] text-xs mb-2`,{"mt-3":t===0}])},[(y(),m(v(e.icon),{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),r(` `+i(e.label)+`: `+i(e.value),1)],2))),128)),e(`p`,Kn,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.taskId`))+`: `+i(c.modelValue?.id)+` `,1),a(N,{content:c.modelValue?.id},null,8,[`content`])]),c.traceId?(y(),s(`p`,qn,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.traceId`))+`: `+i(c.traceId)+` `,1),a(N,{content:c.traceId},null,8,[`content`])])):o(``,!0)]),_:1})])),c.modelValue?.response?.success===!0&&c.variants.length?(y(),s(`div`,Jn,[(y(!0),s(l,null,_(c.variants,(t,n)=>(y(),s(`div`,{key:n,class:`mb-4`},[e(`p`,Yn,[a(ee,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(i(t.lang),1),t.title?(y(),s(`span`,Xn,` · `+i(t.title),1)):o(``,!0)]),t.output_url?(y(),m(te,{key:0,src:t.output_url},null,8,[`src`])):o(``,!0)]))),128)),e(`div`,Zn,[(y(!0),s(l,null,_(c.variants,(e,t)=>(y(),s(l,{key:t},[e.output_url?(y(),m(A,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:t=>c.onDownload(t,e.output_url)},{default:h(()=>[a(ne,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.button.download`)),1),c.variants.length>1?(y(),s(`span`,Qn,` · `+i(e.lang),1)):o(``,!0)]),_:2},1032,[`onClick`])):o(``,!0)],64))),128)),a(A,{size:`small`,type:`primary`,class:`btn-action`,onClick:c.onRemix},{default:h(()=>[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.button.remix`)),1)]),_:1},8,[`onClick`]),a(re,{path:`/maestro/videos`,body:c.modelValue?.request},null,8,[`body`]),a(ie,{service:`maestro`,"target-id":c.modelValue?.id,snapshot:{prompt:c.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])]),a(F,{closable:!1,class:`mt-2 success`},{default:h(()=>[(y(!0),s(l,null,_(c.requestParams,(e,t)=>(y(),s(`p`,{key:`param-${t}`,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},[(y(),m(v(e.icon),{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),r(` `+i(e.label)+`: `+i(e.value),1)]))),128)),e(`p`,$n,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.taskId`))+`: `+i(c.modelValue?.id)+` `,1),a(N,{content:c.modelValue?.id},null,8,[`content`])]),c.modelValue?.elapsed?(y(),s(`p`,er,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.elapsed`))+`: `+i(c.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),c.traceId?(y(),s(`p`,tr,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.traceId`))+`: `+i(c.traceId)+` `,1),a(N,{content:c.traceId},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),c.modelValue?.response?.success===!1?(y(),s(`div`,nr,[a(F,{closable:!1,class:`failure`},{template:h(()=>[a(ae,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.failure`)),1)]),default:h(()=>[(y(!0),s(l,null,_(c.requestParams,(e,t)=>(y(),s(`p`,{key:`param-${t}`,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},[(y(),m(v(e.icon),{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),r(` `+i(e.label)+`: `+i(e.value),1)]))),128)),e(`p`,rr,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.taskId`))+`: `+i(c.modelValue?.id)+` `,1),a(N,{content:c.modelValue?.id},null,8,[`content`])]),c.failureReason?(y(),s(`p`,ir,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.failureReason`))+`: `+i(c.failureReason),1)])):o(``,!0),c.modelValue?.elapsed?(y(),s(`p`,ar,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.elapsed`))+`: `+i(c.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),c.traceId?(y(),s(`p`,or,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.$t(`maestro.name.traceId`))+`: `+i(c.traceId)+` `,1),a(N,{content:c.traceId},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var cr=x({name:`RecentPanel`,components:{TaskPreview:G(Mn,[[`render`,sr],[`__scopeId`,`data-v-1ceb81fa`]]),NoTasks:I,BotPlaceholder:Xe,ScrollList:re},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.maestro?.tasks,items:this.$store.state.maestro?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),lr={key:0},ur={key:2,class:`w-full h-full flex items-center justify-center`};function dr(e,t,n,r,i,c){let d=u(`bot-placeholder`),f=u(`task-preview`),p=u(`scroll-list`),g=u(`no-tasks`);return y(),s(l,null,[e.tasks?.items===void 0?(y(),s(`div`,lr,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(y(),m(p,{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:h(()=>[(y(!0),s(l,null,_(e.tasks?.items,(e,t)=>(y(),m(f,{key:t,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(y(),s(`div`,ur,[a(g)])):o(``,!0)],64)}var fr=x({name:`MaestroIndex`,components:{ConfigPanel:hn,Layout:at,RecentPanel:G(cr,[[`render`,dr]])},inject:[`initialized`],data(){return{job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.maestro?.status?.getApplications===O.Request},tasksLoading(){return this.$store.state.maestro?.status?.getTasks===O.Request||this.fetchingTasks},credential(){return this.$store.state.maestro.credential},config(){return this.$store.state.maestro.config},tasks(){return this.$store.state.maestro.tasks},walletMode(){return je()&&K(`maestro`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`maestro/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onGetTasks,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.onGetTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await oe({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){await this.$store.dispatch(`maestro/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(`maestro/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;if(this.walletMode){let n=this.getWalletContext();if(!n){k.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}t=q.generate(e,{mode:`x402`,x402:{wallet:n,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!Ae())return;let n=this.credential?.token;if(!n)return;t=q.generate(e,{token:n})}k.info(this.$t(`maestro.message.startingTask`)),Oe(`maestro`,t).then(e=>{let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),k.success(this.$t(`maestro.message.startTaskSuccess`))}).catch(e=>{e instanceof Pe||ke(e,`maestro`)||(this.walletMode?k.error(`${this.$t(`common.x402Scenario.paymentFailed`)} ${e?.message||``}`.trim()):k.error(this.$t(`maestro.message.startTaskFailed`)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return Ie(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 pr(e,t,n,r,i,o){let s=u(`config-panel`),c=u(`recent-panel`),l=u(`layout`);return y(),m(l,null,{config:h(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:h(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var mr=G(fr,[[`render`,pr]]);export{mr as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.menu[data-v-e912fd04]{display:none}@media (width<=767px){.config[data-v-e912fd04]{display:none}.result[data-v-e912fd04]{width:100%}.menu[data-v-e912fd04]{right:8px;top:calc(45px + var(--app-safe-area-top));z-index:1000;display:block;position:absolute}}.hint[data-v-db0590a9]{color:var(--el-text-color-secondary);margin:6px 0 0;font-size:12px;line-height:1.4}.slot[data-v-db0590a9]{border:1px solid var(--el-border-color-lighter);border-radius:var(--el-border-radius-base);background-color:var(--el-fill-color-lighter);flex-direction:row;align-items:center;gap:8px;width:100%;padding:6px;display:flex}.slot .thumb[data-v-db0590a9]{flex:none}.slot .placeholder[data-v-db0590a9]{border-radius:var(--el-border-radius-base);background-color:var(--el-fill-color-dark);width:50px;height:50px;color:var(--el-text-color-secondary);justify-content:center;align-items:center;display:flex}.slot .filename[data-v-db0590a9]{min-width:0;color:var(--el-text-color-regular);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:12px;overflow:hidden}.slot .remove[data-v-db0590a9]{cursor:pointer;color:var(--el-text-color-secondary);background:0 0;border:none;flex:none;padding:4px 6px;line-height:1}.slot .remove[data-v-db0590a9]:hover{color:var(--el-color-danger)}.media-input{flex-direction:column-reverse;height:auto;display:flex}.media-input .el-upload-list{width:100%;margin:0 0 8px}.media-input .el-upload-list__item{margin:0;transition:none}.media-input .el-upload-list__item:first-child{margin-top:0}.field[data-v-037c810e]{flex-direction:row;justify-content:space-between;align-items:center;gap:12px;display:flex}.field .label[data-v-037c810e]{flex:none;font-size:14px;font-weight:700}.field .control[data-v-037c810e]{width:260px}.footer[data-v-037c810e]{flex-direction:row;justify-content:space-between;align-items:center;gap:12px;display:flex}.footer .cost[data-v-037c810e]{margin:0}.row[data-v-e191cc56]{flex-direction:row;justify-content:space-between;align-items:center;gap:12px;display:flex}.row .label[data-v-e191cc56]{flex:none;font-size:14px;font-weight:700}.row .control[data-v-e191cc56]{width:190px;min-width:0}.clone[data-v-e191cc56]{margin-top:4px;padding-left:0}.empty[data-v-e191cc56]{color:var(--el-text-color-secondary);margin:0;padding:10px 20px;font-size:12px}.option[data-v-e191cc56]{flex-direction:row;align-items:center;gap:8px;display:flex}.option .option-name[data-v-e191cc56]{text-overflow:ellipsis;flex:1;min-width:0;overflow:hidden}.option .option-remove[data-v-e191cc56]{cursor:pointer;color:var(--el-text-color-secondary);background:0 0;border:none;flex:none;padding:0 2px;line-height:1}.option .option-remove[data-v-e191cc56]:hover{color:var(--el-color-danger)}.field-head[data-v-
|
|
1
|
+
.menu[data-v-e912fd04]{display:none}@media (width<=767px){.config[data-v-e912fd04]{display:none}.result[data-v-e912fd04]{width:100%}.menu[data-v-e912fd04]{right:8px;top:calc(45px + var(--app-safe-area-top));z-index:1000;display:block;position:absolute}}.hint[data-v-db0590a9]{color:var(--el-text-color-secondary);margin:6px 0 0;font-size:12px;line-height:1.4}.slot[data-v-db0590a9]{border:1px solid var(--el-border-color-lighter);border-radius:var(--el-border-radius-base);background-color:var(--el-fill-color-lighter);flex-direction:row;align-items:center;gap:8px;width:100%;padding:6px;display:flex}.slot .thumb[data-v-db0590a9]{flex:none}.slot .placeholder[data-v-db0590a9]{border-radius:var(--el-border-radius-base);background-color:var(--el-fill-color-dark);width:50px;height:50px;color:var(--el-text-color-secondary);justify-content:center;align-items:center;display:flex}.slot .filename[data-v-db0590a9]{min-width:0;color:var(--el-text-color-regular);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:12px;overflow:hidden}.slot .remove[data-v-db0590a9]{cursor:pointer;color:var(--el-text-color-secondary);background:0 0;border:none;flex:none;padding:4px 6px;line-height:1}.slot .remove[data-v-db0590a9]:hover{color:var(--el-color-danger)}.media-input{flex-direction:column-reverse;height:auto;display:flex}.media-input .el-upload-list{width:100%;margin:0 0 8px}.media-input .el-upload-list__item{margin:0;transition:none}.media-input .el-upload-list__item:first-child{margin-top:0}.field[data-v-037c810e]{flex-direction:row;justify-content:space-between;align-items:center;gap:12px;display:flex}.field .label[data-v-037c810e]{flex:none;font-size:14px;font-weight:700}.field .control[data-v-037c810e]{width:260px}.footer[data-v-037c810e]{flex-direction:row;justify-content:space-between;align-items:center;gap:12px;display:flex}.footer .cost[data-v-037c810e]{margin:0}.row[data-v-e191cc56]{flex-direction:row;justify-content:space-between;align-items:center;gap:12px;display:flex}.row .label[data-v-e191cc56]{flex:none;font-size:14px;font-weight:700}.row .control[data-v-e191cc56]{width:190px;min-width:0}.clone[data-v-e191cc56]{margin-top:4px;padding-left:0}.empty[data-v-e191cc56]{color:var(--el-text-color-secondary);margin:0;padding:10px 20px;font-size:12px}.option[data-v-e191cc56]{flex-direction:row;align-items:center;gap:8px;display:flex}.option .option-name[data-v-e191cc56]{text-overflow:ellipsis;flex:1;min-width:0;overflow:hidden}.option .option-remove[data-v-e191cc56]{cursor:pointer;color:var(--el-text-color-secondary);background:0 0;border:none;flex:none;padding:0 2px;line-height:1}.option .option-remove[data-v-e191cc56]:hover{color:var(--el-color-danger)}.field-head[data-v-0b652d94]{flex-direction:row;align-items:center;display:flex}.field-title[data-v-0b652d94]{margin:0;font-size:14px}.field-block>.field-head[data-v-0b652d94]{margin-bottom:8px}.field-row[data-v-0b652d94]{flex-direction:row;justify-content:space-between;align-items:center;display:flex}.field-control[data-v-0b652d94]{width:140px}.mode-switch[data-v-0b652d94]{width:100%;display:flex}.mode-switch[data-v-0b652d94] .el-radio-button{flex:1}.mode-switch[data-v-0b652d94] .el-radio-button__inner{width:100%}.required-badge[data-v-0b652d94]{color:var(--el-color-warning);background-color:var(--el-color-warning-light-9);border:1px solid var(--el-color-warning-light-7);border-radius:8px;margin-left:6px;padding:0 6px;font-size:11px;line-height:16px}.hint-missing[data-v-0b652d94]{text-align:center;color:var(--el-color-warning);justify-content:center;align-items:center;margin:0 0 8px;font-size:12px;line-height:1.4;display:flex}.hint-eta[data-v-0b652d94]{text-align:center;color:var(--el-text-color-secondary);margin:8px 0 0;font-size:12px;line-height:1.4}.advanced[data-v-0b652d94]{border-top:none;border-bottom:none}.advanced[data-v-0b652d94] .el-collapse-item__header{border-bottom:none;font-size:14px;font-weight:700}.advanced[data-v-0b652d94] .el-collapse-item__wrap{border-bottom:none}.preview[data-v-342f1d6d]{text-align:left;flex-direction:row;width:100%;height:fit-content;margin-bottom:15px;display:flex}.preview .left[data-v-342f1d6d]{width:70px}.preview .left .avatar[data-v-342f1d6d]{border-radius:50%;width:50px;height:50px;margin:10px}.preview .main[data-v-342f1d6d]{flex:1;width:calc(100% - 70px);min-width:0;padding:10px 10px 0}.preview .main .bot[data-v-342f1d6d]{color:var(--el-color-primary);text-overflow:ellipsis;white-space:nowrap;align-items:center;font-size:16px;font-weight:700;display:flex;overflow:hidden}.preview .main .bot .datetime[data-v-342f1d6d]{text-overflow:ellipsis;color:var(--el-text-color-secondary);margin-left:10px;font-size:12px;font-weight:400;overflow:hidden}.preview .main .bot .btn-delete[data-v-342f1d6d]{cursor:pointer;color:var(--el-text-color-secondary);opacity:0;background:0 0;border:none;margin-left:auto;padding:4px 6px;line-height:1;transition:opacity .15s,color .15s}.preview .main .bot .btn-delete[data-v-342f1d6d]:hover{color:var(--el-color-danger)}@media (hover:none){.preview .main .bot .btn-delete[data-v-342f1d6d]{opacity:1}}.preview .main .info[data-v-342f1d6d]{overflow:hidden}.preview .main .info .prompt[data-v-342f1d6d]{color:var(--el-text-color-regular);white-space:normal;word-break:break-word;overflow-wrap:anywhere;margin-bottom:10px;font-size:16px;font-weight:700}.preview .main .content[data-v-342f1d6d]{word-break:break-word;overflow-wrap:anywhere}.preview .main .content .el-alert[data-v-342f1d6d]{border-left-style:solid;border-left-width:2px}.preview .main .content .el-alert.failure[data-v-342f1d6d]{border-color:var(--el-color-danger)}.preview .main .content .el-alert.success[data-v-342f1d6d]{border-color:var(--el-color-success)}.preview .main .content .el-alert.info-state[data-v-342f1d6d]{border-color:var(--el-color-info)}.preview .main .content .el-alert[data-v-342f1d6d] p:last-child{margin-bottom:0}.preview:hover .main .bot .btn-delete[data-v-342f1d6d]{opacity:1}
|