@acedatacloud/nexior 3.353.2 → 3.353.4
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-PTy1Cbvo.js → ApiCodeButton-BoYfR8v5.js} +1 -1
- package/dist/assets/{Artifacts-y2YaVPLb.js → Artifacts-D2nQo4tU.js} +1 -1
- package/dist/assets/{AskUserQuestionCard-C9K8VKME.js → AskUserQuestionCard-roLNRaCn.js} +1 -1
- package/dist/assets/{Auth-01g2CCao.js → Auth-K5YCbBk2.js} +1 -1
- package/dist/assets/{Bare-Dp0mAdYw.js → Bare-D5W9OqtC.js} +1 -1
- package/dist/assets/{BotPlaceholder-BxCtmaAR.js → BotPlaceholder-C42Ymqvl.js} +1 -1
- package/dist/assets/{BottomFooter-BzgPkkio.js → BottomFooter-wiCnN85k.js} +1 -1
- package/dist/assets/{BrowserPairingDialog-DAP5zPmP.js → BrowserPairingDialog--ujU3DsW.js} +1 -1
- package/dist/assets/{Callback-DTr3kKHU.js → Callback-COmMgA5x.js} +1 -1
- package/dist/assets/{CodeSnippet-BL_7sDPR.js → CodeSnippet-CHGLu7DJ.js} +1 -1
- package/dist/assets/{Console-UBhzeV6E.js → Console-L7JJpzyh.js} +1 -1
- package/dist/assets/{Consumption-CpQHXzGt.js → Consumption-DGykzGxC.js} +1 -1
- package/dist/assets/{Conversation-XVBOvOi7.js → Conversation-DLC9y3KR.js} +1 -1
- package/dist/assets/{Conversation-xRCUb-xo.js → Conversation-dOY7hKiQ.js} +1 -1
- package/dist/assets/{CopyToClipboard-kEHSjRrJ.js → CopyToClipboard-CP5bh5uq.js} +1 -1
- package/dist/assets/{Detail-B1s_JKw_.js → Detail-CttCSTZq.js} +2 -2
- package/dist/assets/{Extra-DG37zGLy.js → Extra-bL5dtE9Y.js} +1 -1
- package/dist/assets/{FilePreview-CvCyrhWU.js → FilePreview-BaSJGB_a.js} +1 -1
- package/dist/assets/{Hailuo-BglWP260.js → Hailuo-ClFOkALJ.js} +1 -1
- package/dist/assets/{History-j1yW0Q04.js → History-7TfR3bG5.js} +1 -1
- package/dist/assets/{ImagePreview-BkFVGOWx.js → ImagePreview-fQJvI010.js} +1 -1
- package/dist/assets/{ImageWrapper-4e84V2ru.js → ImageWrapper-COWOs7PX.js} +1 -1
- package/dist/assets/{Index-DooByda72.js → Index-5F7g-4uB2.js} +1 -1
- package/dist/assets/{Index-CbpDcGAw.css → Index-7zEoaAQu.css} +1 -1
- package/dist/assets/{Index-D3JFwKr-.js → Index-B1vWOtER.js} +1 -1
- package/dist/assets/{Index-CSztlfB1.js → Index-Bbk1rAHB.js} +1 -1
- package/dist/assets/Index-BwkDhmFE.js +1 -0
- package/dist/assets/{Index-CytMO5iT.js → Index-C4OVnYCq.js} +1 -1
- package/dist/assets/{Index-DCwpuH2y.js → Index-CCx7gQCe.js} +1 -1
- package/dist/assets/{Index-B9Ygqxkf.js → Index-CJIzTKOg.js} +1 -1
- package/dist/assets/{Index-hKIxS6j_.js → Index-CUq80NZF.js} +1 -1
- package/dist/assets/{Index-R2VUT1Sy.js → Index-CYW7u2JH.js} +1 -1
- package/dist/assets/{Index-DiLvTMjM.js → Index-CZ2oBBT8.js} +1 -1
- package/dist/assets/{Index-B9xal3wg.js → Index-CcnW93mQ.js} +1 -1
- package/dist/assets/{Index-CrRGYTB_.js → Index-Cf-UjF1D.js} +1 -1
- package/dist/assets/{Index-syUY5be5.js → Index-Cg_E2kJJ.js} +1 -1
- package/dist/assets/{Index-DFa4-D2c2.js → Index-Cj93EwQM2.js} +1 -1
- package/dist/assets/{Index-w1kjEmD0.js → Index-Ck-MtsAt.js} +1 -1
- package/dist/assets/{Index-DOCz5ZV2.js → Index-CpsA-lJv.js} +1 -1
- package/dist/assets/{Index-Z2BXVkMg.js → Index-D1OEri8a.js} +1 -1
- package/dist/assets/{Index-YcP7FdSW.js → Index-D5Cd1PAJ.js} +1 -1
- package/dist/assets/{Index-D8QSnZx7.js → Index-D6G3PR4-.js} +1 -1
- package/dist/assets/{Index-DdEKTzD1.js → Index-D77J8iuo.js} +1 -1
- package/dist/assets/{Index-CfIM_2-T.js → Index-DAfPb1VE.js} +1 -1
- package/dist/assets/{Index-6_wXfk2T.js → Index-DGM5e4rY.js} +1 -1
- package/dist/assets/{Index-ZkG50SAg2.js → Index-DKqcW8gN2.js} +1 -1
- package/dist/assets/{Index-BI2wG4Oz.js → Index-DQbZ4QOr.js} +1 -1
- package/dist/assets/Index-DXlKbIkM.js +1 -0
- package/dist/assets/{Index-B706gkpT.js → Index-DfrL7HHX.js} +1 -1
- package/dist/assets/{Index-BJ3IdM5N.js → Index-DkNslpYz.js} +1 -1
- package/dist/assets/{Index-CkCEn-bk2.js → Index-Ds_JOOxL2.js} +1 -1
- package/dist/assets/{Index-DXO_BIXY.js → Index-HzUGw1Yb.js} +1 -1
- package/dist/assets/{Index-Dre5PLHc.js → Index-cso7ieUL.js} +1 -1
- package/dist/assets/{Index-x-8Z8EGa.js → Index-d_eDrmfZ.js} +1 -1
- package/dist/assets/{Index-KbkiKEGa2.js → Index-iostdk_R2.js} +1 -1
- package/dist/assets/{Index-CkMjTJdP.js → Index-tV7YZP-O.js} +1 -1
- package/dist/assets/{Invitees-QOLdnev6.js → Invitees-DSarU8BX.js} +1 -1
- package/dist/assets/{List-C2qglbhd.js → List-B9AVZp4s.js} +1 -1
- package/dist/assets/{List-C3DD5tPN.js → List-BjCtr92-.js} +1 -1
- package/dist/assets/{List-81QTxg_3.js → List-D673Pgy1.js} +1 -1
- package/dist/assets/{LocalTools-BDONAask.js → LocalTools-BC8jGBeL.js} +1 -1
- package/dist/assets/{LocalTools-DINsTLSN.js → LocalTools-eA6Y2rJq.js} +1 -1
- package/dist/assets/{Logo-DyrYlIJ-.js → Logo-Br3BGwwf.js} +1 -1
- package/dist/assets/{Main-DgrXyDL3.js → Main-CieB2Bf0.js} +1 -1
- package/dist/assets/Message-DHGdWt27.js +3 -0
- package/dist/assets/{Message-C1Nhth6j.css → Message-MrnJ51mA.css} +1 -1
- package/dist/assets/{Model-B-qhfE9o.js → Model-_ubRp5cm.js} +1 -1
- package/dist/assets/{Navigator-9sgtE2e0.js → Navigator-Bg-oSPVG.js} +3 -3
- package/dist/assets/{NotFound-GCbnUZjE.js → NotFound-Dvg08YK-.js} +1 -1
- package/dist/assets/{PageHeader-Dmi_HuY6.js → PageHeader-1oHtUwp7.js} +1 -1
- package/dist/assets/{Pay-CaHOv8ez.js → Pay-BWzR8VbM.js} +1 -1
- package/dist/assets/{Player-Crn-5xR_.js → Player-DznlIUrT.js} +1 -1
- package/dist/assets/{Poivelle-gM_P8xUZ.js → Poivelle-B-D1e0H1.js} +1 -1
- package/dist/assets/{RealtimeCall-49tL0UW6.js → RealtimeCall-DW49UKFy.js} +1 -1
- package/dist/assets/{ReportButton-CybqyzF6.js → ReportButton-Donr-AWk.js} +1 -1
- package/dist/assets/{ReportDialog-Bjypjitb.js → ReportDialog-BiLDb7Xj.js} +1 -1
- package/dist/assets/{ScheduledTasks-BDjUIQKF.js → ScheduledTasks-SoVhudjw.js} +1 -1
- package/dist/assets/{Status-75Zo1A3i.css → Status-8gHhjAIu.css} +1 -1
- package/dist/assets/Status-CsjAZI18.js +1 -0
- package/dist/assets/{Subscribe-CSVjTSdJ.js → Subscribe-BAWpX-9R.js} +1 -1
- package/dist/assets/{TabSwitcher-DcYdDAiy.js → TabSwitcher-BpZ1QcOS.js} +1 -1
- package/dist/assets/{Tts-D-emMwyM.js → Tts-CIeZdEMp.js} +1 -1
- package/dist/assets/{VideoPlayer-RzzT_NxH.js → VideoPlayer-BNRh6h0n.js} +1 -1
- package/dist/assets/{VideoPreview-BBjrN7yJ.js → VideoPreview-3_dzkg8M.js} +1 -1
- package/dist/assets/arrow-down-BxiXgbhu.js +1 -0
- package/dist/assets/{arrow-down-wide-narrow-DDQaX8Bj.js → arrow-down-wide-narrow-15zvSaHy.js} +1 -1
- package/dist/assets/arrow-left-BK9Fxa_j.js +1 -0
- package/dist/assets/arrow-right-CoHZqGXA.js +1 -0
- package/dist/assets/arrow-up-BV9vk3tx.js +1 -0
- package/dist/assets/{authorizeFlow-C0YXdMen.js → authorizeFlow-Cy446zIb.js} +1 -1
- package/dist/assets/{avatar-DlWhfISR.js → avatar-DRt2U5Pb.js} +1 -1
- package/dist/assets/{basic-Dk44KjDw.js → basic-DEJvhpaF.js} +1 -1
- package/dist/assets/{book-open-D7rcU9I8.js → book-open-Dv6qcZ2P.js} +1 -1
- package/dist/assets/{box-DCajlFel.js → box-aM-pcoXN.js} +1 -1
- package/dist/assets/{boxes-CNvhF1WR.js → boxes-YTdv0XY7.js} +1 -1
- package/dist/assets/{brain-BZtBmZSb.js → brain-C9dUBwpu.js} +1 -1
- package/dist/assets/{chart-no-axes-combined-CQUeJcAm.js → chart-no-axes-combined-D8kNMTYO.js} +1 -1
- package/dist/assets/{chat-qV1hEPyz.js → chat-C22xHrwi.js} +1 -1
- package/dist/assets/check-DpKzDz-5.js +1 -0
- package/dist/assets/chevron-down-BtvltmkO.js +1 -0
- package/dist/assets/chevron-right-D7HkzO9k.js +1 -0
- package/dist/assets/circle-check-B-06aax7.js +1 -0
- package/dist/assets/{circle-question-mark-YWvOuoPq.js → circle-question-mark-DuIxA4WE.js} +1 -1
- package/dist/assets/{clipboard-list-oYPkextV.js → clipboard-list-mNBTHEo2.js} +1 -1
- package/dist/assets/clock-CCljPowN.js +1 -0
- package/dist/assets/code-krPCdlwZ.js +1 -0
- package/dist/assets/{codingBridge-C2VV5GHb.js → codingBridge-DkDWjaM1.js} +1 -1
- package/dist/assets/{codingBridgeNotify-A6_CLdF4.js → codingBridgeNotify-D_NpZVaT.js} +2 -2
- package/dist/assets/{coins-BTAlPjXc.js → coins-BaBjiwRM.js} +1 -1
- package/dist/assets/{copy-C9p5ttuS.js → copy-DOHqs49h.js} +1 -1
- package/dist/assets/{createTaskActions-BUUrOofZ.js → createTaskActions-BkRUXvhA.js} +1 -1
- package/dist/assets/{digitalhuman-CjcLP1c8.js → digitalhuman-Ck3ZoJtC.js} +1 -1
- package/dist/assets/{dollar-sign-0lRHeuEq.js → dollar-sign-Dy-yQgch.js} +1 -1
- package/dist/assets/{download-BauSMozc.js → download-xaSy0mRf.js} +1 -1
- package/dist/assets/{drawer-DwNKgVNQ.js → drawer-BYrWn-wi.js} +1 -1
- package/dist/assets/{dropdown-BcSxMBDj.js → dropdown-WLLKaXoi.js} +1 -1
- package/dist/assets/{dropdown-DlD-t7w-.js → dropdown-dJyl79PP.js} +1 -1
- package/dist/assets/{ellipsis-qKp2yx_c.js → ellipsis-Kgu9BKV-.js} +1 -1
- package/dist/assets/esm-BTt8L_JR.js +1 -0
- package/dist/assets/{esm-Dq5mDv4-.js → esm-BWUBZWRX.js} +2 -2
- package/dist/assets/{esm-BVjtAKaL.js → esm-BcXgbm5s.js} +1 -1
- package/dist/assets/{esm-CBoelXqf.js → esm-BmoJJzPK.js} +2 -2
- package/dist/assets/{esm-C8yU5yBP.js → esm-ByzZb6WU.js} +1 -1
- package/dist/assets/{esm-BfitMxkx.js → esm-DBzwbQLe.js} +3 -3
- package/dist/assets/{esm-CwGCktEB.js → esm-DXlvgaWH.js} +1 -1
- package/dist/assets/{external-link-C-Spy8-D.js → external-link-BkmV4CLH.js} +1 -1
- package/dist/assets/{eye-B-pmZqp4.js → eye-DuSVGvFU.js} +1 -1
- package/dist/assets/{file-DxSuQKk4.js → file-BqOmxxbq.js} +1 -1
- package/dist/assets/{file-output-D2uw-hnn.js → file-output-BFLboA2n.js} +1 -1
- package/dist/assets/{file-text-BkEg1Wga.js → file-text-vQBok-1B.js} +1 -1
- package/dist/assets/{fish-B1UT-_TY.js → fish-CVQ6zwCl.js} +1 -1
- package/dist/assets/{flux-DdLMs2G5.js → flux-uQlHDfLl.js} +1 -1
- package/dist/assets/{folder-CfbjZMBC.js → folder-BPNNWMbi.js} +1 -1
- package/dist/assets/gauge-BYfRBfSe.js +1 -0
- package/dist/assets/{globe-G4DF9IKX.js → globe-C6g3JZgL.js} +1 -1
- package/dist/assets/{grokvideo-BKEvSXgA.js → grokvideo-DS40Qjn-.js} +1 -1
- package/dist/assets/{hailuo-B1r9WT5U.js → hailuo-C4genAdr.js} +1 -1
- package/dist/assets/{headphones-B3Ty0tOt.js → headphones-Cv7zE6hM.js} +1 -1
- package/dist/assets/{history-C6O2j7lB.js → history-CVkxFYWc.js} +1 -1
- package/dist/assets/{house-CNnzIeWl.js → house-D0BhonPH.js} +1 -1
- package/dist/assets/{image-9grrIbOS.js → image-CbgMrDy4.js} +1 -1
- package/dist/assets/{index-z6KXKq9i.js → index-DSAgKNWm.js} +3 -3
- package/dist/assets/{index.browser.esm-CtJGNwb5.js → index.browser.esm-BiZ1PUoX.js} +1 -1
- package/dist/assets/{index.es-DHWDsThb.js → index.es-BGtTBs6E.js} +1 -1
- package/dist/assets/{info-Cxon5zpU.js → info-B8n3U43j.js} +1 -1
- package/dist/assets/{input-number-DXUwKhhk.js → input-number-B6mCFWZN.js} +1 -1
- package/dist/assets/{key-round-CZWfOYD1.js → key-round-CAl3B3wn.js} +1 -1
- package/dist/assets/{kling-HOfETRV0.js → kling-LYu_XAKT.js} +1 -1
- package/dist/assets/{languages-B1h2tvSz.js → languages-sDxkzpgd.js} +1 -1
- package/dist/assets/{laptop-Po8L1sXC.js → laptop-B6VIa9KH.js} +1 -1
- package/dist/assets/{lightbulb-CBWCkzJ4.js → lightbulb-C8_0Sfzu.js} +1 -1
- package/dist/assets/{link-bwtqVJS9.js → link-Cqm9iai8.js} +1 -1
- package/dist/assets/loader-circle-C3oRC_46.js +1 -0
- package/dist/assets/{lock-DK3wDuN2.js → lock-DBne33UH.js} +1 -1
- package/dist/assets/{luma-DFBcZFqE.js → luma-DEP_aFYd.js} +1 -1
- package/dist/assets/{maestro-Wk3gy6mB.js → maestro-D7aVuf7F.js} +1 -1
- package/dist/assets/{mail-pYhlvo6E.js → mail-DoqXbBJ-.js} +1 -1
- package/dist/assets/{message-circle-BZxOIvHV.js → message-circle-CJKVqRKG.js} +1 -1
- package/dist/assets/{mic-dzhfHc1x.js → mic-CQqzgu2a.js} +1 -1
- package/dist/assets/{midjourney-BHvZGkjl.js → midjourney-Bnu6OgB6.js} +1 -1
- package/dist/assets/{mobileLocalExec-CgzaTlQ8.js → mobileLocalExec-WiFkhFuu.js} +2 -2
- package/dist/assets/{monitor-CO6lra68.js → monitor-DaGlrKZg.js} +1 -1
- package/dist/assets/{mouse-pointer-2-CjMoQP3P.js → mouse-pointer-2-BTYdPv6Y.js} +1 -1
- package/dist/assets/music-2-Bzom9ep9.js +1 -0
- package/dist/assets/{nanobanana-B61JIvz0.js → nanobanana-pFKlXGOc.js} +1 -1
- package/dist/assets/{omni-CSFtRao4.js → omni-vKP8RxU8.js} +1 -1
- package/dist/assets/{openaiimage-NzKSE7Tj.js → openaiimage-C3Y5kC8l.js} +1 -1
- package/dist/assets/{pagination-CYWHmEQy.js → pagination-BTVOvpvg.js} +1 -1
- package/dist/assets/{pagination-DSsNxN86.js → pagination-BbB25PxT.js} +1 -1
- package/dist/assets/{pagination-C7GFvDBj.js → pagination-CtkSWjVi.js} +1 -1
- package/dist/assets/{palette-D3WdfT0r.js → palette-8rydNAeE.js} +1 -1
- package/dist/assets/{paperclip-CSumSurJ.js → paperclip-DHh7WRgg.js} +1 -1
- package/dist/assets/{pause-DEFfi1MW.js → pause-VyvJQ-Z_.js} +1 -1
- package/dist/assets/{pencil-CmslIKkS.js → pencil-CrMC0hWn.js} +1 -1
- package/dist/assets/{pika-CkiuTfss.js → pika-DtaRH2KI.js} +1 -1
- package/dist/assets/{pixverse-DM8gfWnt.js → pixverse-C5WgxOjD.js} +1 -1
- package/dist/assets/play-xCfCGCia.js +1 -0
- package/dist/assets/{plug-ZkRs9BxT.js → plug-JAsKzEsm.js} +1 -1
- package/dist/assets/plus-Bgf4b7_D.js +1 -0
- package/dist/assets/{poivelle-BMjnxwPJ.js → poivelle-DrkneRmn.js} +1 -1
- package/dist/assets/{popover-BVk0bt76.js → popover-Oaiq8oiH.js} +1 -1
- package/dist/assets/{producer-CmDDQGq2.js → producer-CYrZMDUU.js} +1 -1
- package/dist/assets/{qrart-CDzKn5MX.js → qrart-Bv93TtPh.js} +1 -1
- package/dist/assets/{realtime-COJla9Tv.js → realtime-sBs7dTpg.js} +1 -1
- package/dist/assets/{refresh-cw-BLbDJ9d8.js → refresh-cw-ToSOF7mi.js} +1 -1
- package/dist/assets/rotate-ccw-DaRid_jM.js +1 -0
- package/dist/assets/rotate-cw-Dg6YEi1E.js +1 -0
- package/dist/assets/search-CT76oSOi.js +1 -0
- package/dist/assets/{seedance-Cr31rqL_.js → seedance-BA82Hana.js} +1 -1
- package/dist/assets/{seedream-E0SOoWYs.js → seedream-BblPBiNO.js} +1 -1
- package/dist/assets/{select-C1JBloXv.js → select-D1luRgRq.js} +1 -1
- package/dist/assets/{serp-C9eS9pPN.js → serp-CjpJqV9i.js} +1 -1
- package/dist/assets/{shield-CULt0IEs.js → shield-D81DAkjw.js} +1 -1
- package/dist/assets/{shuffle-5xvSnr1q.js → shuffle-bT3TpoOw.js} +1 -1
- package/dist/assets/{slider-D6bhKIIm.js → slider-B2HxCy0H.js} +1 -1
- package/dist/assets/{solana-wallets-oFQv81JO.js → solana-wallets-Ca1v2kZV.js} +2 -2
- package/dist/assets/{solana-wallets-vue-BmNRVZtb.js → solana-wallets-vue-CRE-3KhZ.js} +1 -1
- package/dist/assets/{sora-Dh3dsrvB.js → sora-Dh2A94bD.js} +1 -1
- package/dist/assets/{sparkles-Dj0Edp5k.js → sparkles-CGHT4a00.js} +1 -1
- package/dist/assets/square-z_a9bxBG.js +1 -0
- package/dist/assets/{store-3csKhH3_.js → store-CiS4Tvci.js} +1 -1
- package/dist/assets/{suno-C21REsqf.js → suno-BUxGWjMV.js} +1 -1
- package/dist/assets/{switch-Df4G1XQO.js → switch-C4Vaponc.js} +1 -1
- package/dist/assets/{table-xyp9aHdM.js → table-DRPwLfzY.js} +1 -1
- package/dist/assets/{tag-WUIasyR7.js → tag-BCkvG45l.js} +1 -1
- package/dist/assets/terminal-CE6gL9a8.js +1 -0
- package/dist/assets/{time-picker-BT9Xe-k7.js → time-picker-kfSXrfW7.js} +1 -1
- package/dist/assets/{tooltip-Cwwy0TGy.js → tooltip-DUcNmmP-.js} +1 -1
- package/dist/assets/{trash-2-mMMYa28u.js → trash-2-DLKDfmcv.js} +1 -1
- package/dist/assets/{triangle-alert-C28SDtE0.js → triangle-alert-BWV9pT6w.js} +1 -1
- package/dist/assets/{upload-D6NHiFjY.js → upload-BZ-Gklsa.js} +1 -1
- package/dist/assets/user-DV1_LEkO.js +1 -0
- package/dist/assets/{veo-CV2N5WQr.js → veo-Bm7aEC_8.js} +1 -1
- package/dist/assets/{video-BVL2CdJr.js → video-BUh3B3m1.js} +1 -1
- package/dist/assets/{volume-2-_ZlHtBbD.js → volume-2-BhxYo14t.js} +1 -1
- package/dist/assets/{wallet-BU45j_Ox.js → wallet-VxcilCIK.js} +1 -1
- package/dist/assets/{wan-CAj3-_ld.js → wan-CwcdkxuC.js} +1 -1
- package/dist/assets/{wand-sparkles-DPuJe95W.js → wand-sparkles-zeg14-Rq.js} +1 -1
- package/dist/assets/{web-DeloOhQd.js → web-1VZSOW5_.js} +1 -1
- package/dist/assets/{web-BjiFfADF.js → web-BO4N3c4H.js} +1 -1
- package/dist/assets/{web-DDTGlPY5.js → web-C3UOdUqb.js} +1 -1
- package/dist/assets/{web-BiRGFygI.js → web-CjeEalt1.js} +1 -1
- package/dist/assets/{web-D_i4Wxbr.js → web-UnkwI-Um.js} +1 -1
- package/dist/assets/{webextrator-BoP6DB5j.js → webextrator-5jcmEsnJ.js} +1 -1
- package/dist/assets/{zap-C2LTrSLM.js → zap-aiC_mBZz.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/Index-BaqenzAc.js +0 -1
- package/dist/assets/Index-TC_vF2rj.js +0 -1
- package/dist/assets/Message-CsExToPh.js +0 -3
- package/dist/assets/Status-1tFt4qql.js +0 -1
- package/dist/assets/arrow-down-BHy-uRDc.js +0 -1
- package/dist/assets/arrow-left-WvpuqvbU.js +0 -1
- package/dist/assets/arrow-right-CRIhneaK.js +0 -1
- package/dist/assets/arrow-up-D3Pwyuc0.js +0 -1
- package/dist/assets/check-ClRF_Odp.js +0 -1
- package/dist/assets/chevron-down-uClS3DwZ.js +0 -1
- package/dist/assets/chevron-right-DR-ZiDX1.js +0 -1
- package/dist/assets/circle-check-YpZm567l.js +0 -1
- package/dist/assets/clock-CG4G8mZJ.js +0 -1
- package/dist/assets/code-DKR_Hvr2.js +0 -1
- package/dist/assets/esm-BISGe7VK.js +0 -1
- package/dist/assets/gauge-DHXXbHVi.js +0 -1
- package/dist/assets/loader-circle-CCnrUMcL.js +0 -1
- package/dist/assets/music-2-CEgzmd8X.js +0 -1
- package/dist/assets/play-B_zaMs6X.js +0 -1
- package/dist/assets/plus-BQE5Wk3j.js +0 -1
- package/dist/assets/rotate-ccw-hwYQifpm.js +0 -1
- package/dist/assets/rotate-cw-COX1kONg.js +0 -1
- package/dist/assets/search-FsbPJb03.js +0 -1
- package/dist/assets/square-CIuXnaWe.js +0 -1
- package/dist/assets/terminal-DydDU401.js +0 -1
- package/dist/assets/user-Cj50GgYO.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,S as c,T as l,at as u,ht as d,it as f,j as p,mt as m,qt as h,rt as g,tt as _,x as v,z as y}from"./vendor-chart-Dw-P17PN.js";import{r as b,t as x}from"./select-C1JBloXv.js";import{t as S}from"./upload-Cjls2phY.js";import{t as C}from"./tooltip-Cwwy0TGy.js";import{t as w}from"./alert-BprQRUmf.js";import{h as T,v as E}from"./models-yTQ4rqqP.js";import{t as D}from"./drawer-DwNKgVNQ.js";import{t as O}from"./box-DCajlFel.js";import{t as k}from"./clock-CG4G8mZJ.js";import{t as A}from"./external-link-C-Spy8-D.js";import{a as j,c as M,n as N,o as P,r as F,t as I}from"./pagination-C7GFvDBj.js";import{t as L}from"./image-9grrIbOS.js";import{t as ee}from"./info-Cxon5zpU.js";import{t as R}from"./trash-2-mMMYa28u.js";import{t as z}from"./triangle-alert-C28SDtE0.js";import{t as B}from"./upload-D6NHiFjY.js";import{t as V}from"./wand-sparkles-DPuJe95W.js";import{t as te}from"./zap-C2LTrSLM.js";import{$n as ne,Jn as H,Qn as U,Xn as W,Zn as G}from"./constants-CzYWUlOY.js";import{$t as K,Bn as q,O as J,Pi as Y,Qt as X,Zt as Z,bi as re,en as ie,fn as ae,jr as oe,oi as se,qt as ce,rn as le,tn as ue}from"./index-z6KXKq9i.js";import{t as de}from"./CopyToClipboard-kEHSjRrJ.js";import{t as fe}from"./ReportButton-CybqyzF6.js";import{t as Q}from"./ImagePreview-BkFVGOWx.js";import{n as pe}from"./taskDrawerMixin-DyAUhFEq.js";import{t as me}from"./Consumption-CpQHXzGt.js";import{t as he}from"./ApiCodeButton-PTy1Cbvo.js";import{t as ge}from"./BotPlaceholder-BxCtmaAR.js";import{t as _e}from"./ImageWrapper-4e84V2ru.js";var ve=y({name:`LayoutNanobanana`,components:{MagicIcon:V,ElDrawer:D,ElButton:Y},mixins:[pe]}),ye={class:`main flex flex-row flex-1`},be={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)]`},xe={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Se(t,n,r,i,o,c){let l=u(`magic-icon`),p=u(`el-button`),h=u(`el-drawer`);return _(),s(`div`,ye,[e(`div`,be,[f(t.$slots,`config`,{},void 0,!0)]),e(`div`,xe,[f(t.$slots,`result`,{},void 0,!0)]),d(a(p,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:m(()=>[a(l,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[v,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer generator-drawer`},{default:m(()=>[f(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Ce=J(ve,[[`render`,Se],[`__scopeId`,`data-v-6419fc74`]]),we=y({name:`PromptInput`,components:{PromptTextarea:j},computed:{prompt:{get(){return this.$store.state.nanobanana?.config?.prompt},set(e){this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Te(e,t,n,r,i,a){let o=u(`prompt-textarea`);return _(),p(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`nanobanana.name.prompt`),info:e.$t(`nanobanana.description.prompt`),placeholder:e.$t(`nanobanana.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ee=J(we,[[`render`,Te]]),De=y({name:`ImageUrlsInput`,components:{UploadIcon:B,ElUpload:S,ElButton:Y,InfoIcon:P,ImagePreview:Q},mixins:[ue,ie,X,ce],data(){return{fileList:[],uploadUrl:se()+`/api/v1/files/`,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.nanobanana?.config?.image_urls}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){let e=(this.fileList||[]).filter(e=>!e?.response?.file_url);this.fileList=e.length?e:[];return}let t=[];e.forEach(e=>{let n=this.fileList.find(t=>t?.response?.file_url===e||t?.url===e);n?t.push(n):t.push({name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}})}),(this.fileList||[]).filter(e=>!e?.response?.file_url).forEach(e=>{t.some(t=>t===e||t?.url===e?.url||t?.response?.file_url===e?.response?.file_url)||t.push(e)}),this.fileList=t}}},mounted(){},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url==`string`&&e.url.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImageUrls()},onExceed(){E.warning(this.$t(`nanobanana.message.uploadImageExceed`))},onError(){E.error(this.$t(`nanobanana.message.uploadImageError`))},onSetImageUrls(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,image_urls:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImageUrls()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImageUrls()}}}),Oe={class:`field mb-[10px] flex min-h-8 w-full items-center justify-between gap-3`},ke={class:`flex min-w-0 items-center`},Ae={class:`title m-0 text-[14px] font-bold`},je={class:`file-list flex flex-wrap gap-[10px]`};function Me(t,n,o,c,d,f){let h=u(`info-icon`),v=u(`upload-icon`),y=u(`el-button`),b=u(`el-upload`),x=u(`image-preview`);return _(),s(`div`,null,[e(`div`,Oe,[e(`div`,ke,[e(`h2`,Ae,i(t.$t(`nanobanana.name.imageUrls`)),1),a(h,{content:t.$t(`nanobanana.description.imageUrls`)},null,8,[`content`])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value shrink-0`,limit:5,multiple:!0,"show-file-list":!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-change":t.onChange,"on-remove":t.onRemove,headers:t.headers},{default:m(()=>[a(y,{size:`small`,type:`primary`,round:``},{default:m(()=>[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`nanobanana.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])]),e(`div`,je,[(_(!0),s(l,null,g(t.fileList,(e,n)=>(_(),p(x,{key:e.uid||e?.response?.file_url||e.url||n,url:e.url||e?.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemovePreview(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])])}var Ne=J(De,[[`render`,Me]]),Pe=y({name:`AspectRatioSelector`,components:{InfoIcon:P},data(){return{options:[{value:`1:1`,label:`1:1`,width:20,height:20},{value:`3:2`,label:`3:2`,width:27,height:18},{value:`2:3`,label:`2:3`,width:18,height:27},{value:`16:9`,label:`16:9`,width:25,height:13},{value:`9:16`,label:`9:16`,width:13,height:25},{value:`4:3`,label:`4:3`,width:24,height:18},{value:`3:4`,label:`3:4`,width:18,height:24}]}},computed:{value(){return this.$store.state.nanobanana?.config?.aspect_ratio}},methods:{onSelect(e){let t=this.value===e?void 0:e,n={...this.$store.state.nanobanana?.config||{}};t?n.aspect_ratio=t:delete n.aspect_ratio,this.$store.commit(`nanobanana/setConfig`,n)}}}),Fe={class:`ratio`},Ie={class:`header`},Le={class:`title font-bold`},Re=[`aria-label`],ze=[`aria-checked`,`aria-label`,`onClick`,`onKeydown`],Be={class:`preview`},Ve={class:`name`};function He(r,o,d,f,p,m){let v=u(`info-icon`);return _(),s(`div`,Fe,[e(`div`,Ie,[e(`h2`,Le,i(r.$t(`nanobanana.name.aspectRatio`)),1),a(v,{content:r.$t(`nanobanana.description.aspectRatio`),class:`ml-1`},null,8,[`content`])]),e(`div`,{class:`items`,role:`radiogroup`,"aria-label":r.$t(`nanobanana.name.aspectRatio`)},[(_(!0),s(l,null,g(r.options,a=>(_(),s(`div`,{key:a.value,class:n([`item`,{active:r.value===a.value}]),role:`radio`,"aria-checked":r.value===a.value,"aria-label":a.label,tabindex:`0`,onClick:e=>r.onSelect(a.value),onKeydown:[c(t(e=>r.onSelect(a.value),[`prevent`]),[`enter`]),c(t(e=>r.onSelect(a.value),[`prevent`]),[`space`])]},[e(`div`,Be,[e(`div`,{class:`rect`,style:h({width:a.width+`px`,height:a.height+`px`})},null,4)]),e(`p`,Ve,i(a.label),1)],42,ze))),128))],8,Re)])}var Ue=J(Pe,[[`render`,He],[`__scopeId`,`data-v-7131eb97`]]),We=y({name:`NanobananaModelSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:P},data(){return{options:[{value:W,label:this.$t(`nanobanana.model.nanoBanana`)},{value:U,label:U},{value:ne,label:this.$t(`nanobanana.model.nanoBananaPro`)},{value:G,label:this.$t(`nanobanana.model.nanoBanana2`)}]}},computed:{value:{get(){return this.$store.state.nanobanana?.config?.model},set(e){this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,model:e})}},modelDescription(){return this.$t(`nanobanana.description.model`)}},mounted(){this.value||=H}}),Ge={class:`field`},Ke={class:`label`},qe={class:`box`},Je={class:`title font-bold`};function Ye(t,n,r,o,c,d){let f=u(`info-icon`),h=u(`el-option`),v=u(`el-select`);return _(),s(`div`,Ge,[e(`div`,Ke,[e(`div`,qe,[e(`h2`,Je,i(t.$t(`nanobanana.name.model`)),1),a(f,{content:t.modelDescription,class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`nanobanana.placeholder.select`)},{default:m(()=>[(_(!0),s(l,null,g(t.options,e=>(_(),p(h,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Xe=J(We,[[`render`,Ye],[`__scopeId`,`data-v-11cb675b`]]),Ze=y({name:`NanobananaResolutionSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:P},data(){return{cachedResolution:`1K`,options:[{value:`1K`,label:`1K`},{value:`2K`,label:`2K`},{value:`4K`,label:`4K`}]}},computed:{value:{get(){return this.$store.state.nanobanana?.config?.resolution},set(e){this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,resolution:e})}},supportsResolution(){let e=this.$store.state.nanobanana?.config?.model;return e===`nano-banana-2`||e===`nano-banana-pro`}},watch:{value(e){this.supportsResolution&&e&&(this.cachedResolution=e)},supportsResolution(e){e?this.value||=this.cachedResolution||`1K`:(this.value&&(this.cachedResolution=this.value),this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,resolution:void 0}))}},mounted(){this.supportsResolution&&!this.value&&(this.value=`1K`),!this.supportsResolution&&this.value&&(this.cachedResolution=this.value,this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,resolution:void 0}))}}),Qe={class:`field`},$e={class:`label`},et={class:`box`},tt={class:`title font-bold`};function nt(t,n,r,o,c,d){let f=u(`info-icon`),h=u(`el-option`),v=u(`el-select`);return _(),s(`div`,Qe,[e(`div`,$e,[e(`div`,et,[e(`h2`,tt,i(t.$t(`nanobanana.name.resolution`)),1),a(f,{content:t.$t(`nanobanana.description.resolutionProOnly`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`nanobanana.placeholder.select`),disabled:!t.supportsResolution},{default:m(()=>[(_(!0),s(l,null,g(t.options,e=>(_(),p(h,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`])])}var rt=y({name:`ConfigPanel`,components:{MagicIcon:V,ElButton:Y,PromptInput:Ee,Consumption:me,ImageUrlsInput:Ne,AspectRatioSelector:Ue,ModelSelector:Xe,ResolutionSelector:J(Ze,[[`render`,nt],[`__scopeId`,`data-v-7ab9d4d4`]])},emits:[`generate`],computed:{config(){return this.$store.state.nanobanana?.config},consumption(){let e={...this.config||{}},t=Array.isArray(e?.image_urls)&&e.image_urls.length>0;return le({...e,action:t?`edit`:`generate`},this.service?.cost)},service(){return this.$store.state.nanobanana?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),it={class:`flex flex-col h-full`},at={class:`flex-1 overflow-y-auto p-5`},ot={class:`flex flex-col items-center justify-center px-5 pb-5`};function st(t,n,o,c,l,d){let f=u(`model-selector`),p=u(`resolution-selector`),h=u(`prompt-input`),g=u(`aspect-ratio-selector`),v=u(`image-urls-input`),y=u(`consumption`),b=u(`magic-icon`),x=u(`el-button`);return _(),s(`div`,it,[e(`div`,at,[a(f,{class:`mb-4`}),a(p,{class:`mb-4`}),a(h,{class:`mb-4`}),a(g,{class:`mb-4`}),a(v,{class:`mb-4`})]),e(`div`,ot,[a(y,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(x,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:m(()=>[a(b,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`nanobanana.button.generate`)),1)]),_:1},8,[`onClick`])])])}var ct=J(rt,[[`render`,st]]),lt=y({name:`TaskPreview`,components:{ApplicationIcon:O,ChannelIcon:M,DeleteIcon:R,ExternalLinkIcon:A,ImageIcon:L,InfoIcon:ee,LightningIcon:te,MagicIcon:V,TimeIcon:k,WarningIcon:z,CopyToClipboard:de,ElAlert:w,ImageWrapper:_e,ElButton:Y,ElTooltip:C,ImagePreview:Q,ApiCodeButton:he,ReportButton:fe},props:{modelValue:{type:Object,required:!0}},computed:{images(){let e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{e.push(t)}),e},hasImages(){return this.images.some(e=>!!e?.image_url)},showResult(){let e=this.modelValue?.response;return e?e.success===!0?!0:this.hasImages&&e.success!==!1:!1}},methods:{onEdit(e){if(!e)return;console.debug(`Edit image:`,e);let t={...this.$store.state.nanobanana?.config||{}};delete t.action,t.image_urls=[e],this.$store.commit(`nanobanana/setConfig`,t)},async onDelete(){let e=this.modelValue?.id;if(e){try{await re.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`nanobanana/deleteTask`,{id:e}),E.success(this.$t(`common.message.deleteTaskSuccess`))}catch{E.error(this.$t(`common.message.deleteTaskFailed`))}}}}}),ut={class:`preview`},dt={class:`left`},ft={class:`main`},pt={class:`bot`},mt={class:`datetime`},ht=[`aria-label`],gt={class:`info`},_t={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},vt={key:1,class:`prompt mt-2`},yt={key:0},bt={key:0,class:n({content:!0,failed:!0})},xt={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},St={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Ct={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Tt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Et={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Dt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ot={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},kt={key:5,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},At={key:1,class:n({content:!0})},jt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Mt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Nt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Pt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ft={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},It={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Lt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Rt={key:5,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},zt={key:2,class:n({content:!0})},Bt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Vt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ht={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ut={class:`text-[var(--el-text-color-regular)] text-xs mb-2`};function Wt(n,c,d,f,h,v){let y=u(`capability-presentation`),b=u(`delete-icon`),x=u(`el-tooltip`),S=u(`image-preview`),C=u(`image-wrapper`),w=u(`el-button`),T=u(`api-code-button`),E=u(`report-button`),D=u(`application-icon`),O=u(`image-icon`),k=u(`external-link-icon`),A=u(`lightning-icon`),j=u(`magic-icon`),M=u(`copy-to-clipboard`),N=u(`time-icon`),P=u(`channel-icon`),F=u(`el-alert`),I=u(`warning-icon`),L=u(`info-icon`);return _(),s(`div`,ut,[e(`div`,dt,[a(y,{capability:`nanobanana`,part:`avatar`,class:`avatar`})]),e(`div`,ft,[e(`div`,pt,[a(y,{capability:`nanobanana`,part:`name`}),e(`span`,mt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(x,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:m(()=>[n.modelValue?.id?(_(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:c[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,ht)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,gt,[n.modelValue?.request?.image_urls&&n.modelValue?.request?.image_urls.length>0?(_(),s(`div`,_t,[(_(!0),s(l,null,g(n.modelValue?.request?.image_urls,(e,t)=>(_(),p(S,{key:t,url:e,name:`image-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),n.modelValue?.request?.prompt?(_(),s(`p`,vt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(_(),s(`span`,yt,` - (`+i(n.$t(`nanobanana.status.pending`))+`) `,1))])):o(``,!0)]),n.showResult?(_(),s(`div`,bt,[e(`div`,xt,[(_(!0),s(l,null,g(n.images,(e,t)=>(_(),p(C,{key:t,src:e?.image_url,"raw-src":e?.image_url},null,8,[`src`,`raw-src`]))),128))]),e(`div`,St,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`common.button.edit`),placement:`top-start`},{default:m(()=>[a(w,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=t(e=>n.onEdit(n.images?.[0]?.image_url),[`stop`])},{default:m(()=>[r(i(n.$t(`common.button.edit`)),1)]),_:1})]),_:1},8,[`content`]),a(T,{path:`/nano-banana/images`,body:n.modelValue?.request},null,8,[`body`]),a(E,{service:`nanobanana`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])]),a(F,{closable:!1,class:`mt-2 success`},{default:m(()=>[n.modelValue?.request?.model?(_(),s(`p`,Ct,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.resolution?(_(),s(`p`,wt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.resolution`))+`: `+i(n.modelValue?.request?.resolution),1)])):o(``,!0),n.modelValue?.request?.aspect_ratio?(_(),s(`p`,Tt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.aspectRatio`))+`: `+i(n.modelValue?.request?.aspect_ratio),1)])):o(``,!0),n.modelValue?.request?.action?(_(),s(`p`,Et,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.task`))+`: `+i(n.modelValue?.request?.action===`generate`?n.$t(`nanobanana.name.generate`):n.$t(`nanobanana.name.edits`)),1)])):o(``,!0),e(`p`,Dt,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(M,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(_(),s(`p`,Ot,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(_(),s(`p`,kt,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(M,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1||n.modelValue?.response?.error?(_(),s(`div`,At,[a(F,{closable:!1,class:`failure`},{template:m(()=>[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.failure`)),1)]),default:m(()=>[n.modelValue?.request?.model?(_(),s(`p`,jt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.resolution?(_(),s(`p`,Mt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.resolution`))+`: `+i(n.modelValue?.request?.resolution),1)])):o(``,!0),n.modelValue?.request?.aspect_ratio?(_(),s(`p`,Nt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.aspectRatio`))+`: `+i(n.modelValue?.request?.aspect_ratio),1)])):o(``,!0),n.modelValue?.request?.action?(_(),s(`p`,Pt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.task`))+`: `+i(n.modelValue?.request?.action===`generate`?n.$t(`nanobanana.name.generate`):n.$t(`nanobanana.name.edits`)),1)])):o(``,!0),e(`p`,Ft,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(M,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),e(`p`,It,[a(L,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(M,{content:n.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.elapsed?(_(),s(`p`,Lt,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(_(),s(`p`,Rt,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(M,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(_(),s(`div`,zt,[a(F,{closable:!1,class:`info`},{template:m(()=>[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.status.pending`)),1)]),default:m(()=>[n.modelValue?.request?.model?(_(),s(`p`,Bt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.resolution?(_(),s(`p`,$,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.resolution`))+`: `+i(n.modelValue?.request?.resolution),1)])):o(``,!0),n.modelValue?.request?.aspect_ratio?(_(),s(`p`,Vt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.aspectRatio`))+`: `+i(n.modelValue?.request?.aspect_ratio),1)])):o(``,!0),n.modelValue?.request?.action?(_(),s(`p`,Ht,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.task`))+`: `+i(n.modelValue?.request?.action===`generate`?n.$t(`nanobanana.name.generate`):n.$t(`nanobanana.name.edits`)),1)])):o(``,!0),e(`p`,Ut,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(M,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])])]),_:1})]))])])}var Gt=y({name:`RecentPanel`,components:{TaskPreview:J(lt,[[`render`,Wt],[`__scopeId`,`data-v-45a0e049`]]),BotPlaceholder:ge,NoTasks:F,ScrollList:N},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.nanobanana?.tasks,items:this.$store.state.nanobanana?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Kt={key:0},qt={key:2,class:`w-full h-full flex items-center justify-center`};function Jt(e,t,n,r,i,c){let d=u(`bot-placeholder`),f=u(`task-preview`),h=u(`scroll-list`),v=u(`no-tasks`);return _(),s(l,null,[e.tasks?.items===void 0?(_(),s(`div`,Kt,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(_(),p(h,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:m(()=>[(_(!0),s(l,null,g(e.tasks?.items,e=>(_(),p(f,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(_(),s(`div`,qt,[a(v)])):o(``,!0)],64)}var Yt=y({name:`NanobananaIndex`,components:{ConfigPanel:ct,Layout:Ce,RecentPanel:J(Gt,[[`render`,Jt]])},mixins:[K],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.nanobanana?.status?.getApplications===T.Request},tasksLoading(){return this.$store.state.nanobanana?.status?.getTasks===T.Request},credential(){return this.$store.state.nanobanana?.credential},config(){return this.$store.state.nanobanana?.config},application(){return this.$store.state.nanobanana?.application},tasks(){return this.$store.state.nanobanana?.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await I({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loading,setLoading:e=>this.loading=e,isBlocked:()=>this.tasksLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`nanobanana/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`nanobanana/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.tasksLoading){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=20,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),await this.$store.dispatch(`nanobanana/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})},async onGenerate(){if(!Z(this.uploadTracker,e=>this.$t(e),e=>E.warning(e)))return;let e={...this.config||{}},t=Array.isArray(e?.image_urls)&&e.image_urls.length>0;delete e.action,!t&&`image_urls`in e&&delete e.image_urls,e?.aspect_ratio||delete e.aspect_ratio;let n=e?.model===`nano-banana-2`||e?.model===`nano-banana-pro`;!n&&`resolution`in e&&delete e.resolution,n&&!e?.resolution&&(e.resolution=`1K`);let r={...e,action:t?`edit`:`generate`,async:!0};if(!ae())return;let i=this.credential?.token;if(!i){console.error(`no token specified`);return}E.info(this.$t(`nanobanana.message.startingTask`)),oe(`nanobanana`,q.generate(r,{token:i})).then(()=>{E.success(this.$t(`nanobanana.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?E.error(this.$t(`nanobanana.message.usedUp`)):E.error(this.$t(`nanobanana.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Xt(e,t,n,r,i,o){let s=u(`config-panel`),c=u(`recent-panel`),l=u(`layout`);return _(),p(l,null,{config:m(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:m(()=>[a(c,{ref:`recentPanel`,loading:e.loading,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Zt=J(Yt,[[`render`,Xt]]);export{Zt as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,S as c,T as l,at as u,ht as d,it as f,j as p,mt as m,qt as h,rt as g,tt as _,x as v,z as y}from"./vendor-chart-Dw-P17PN.js";import{r as b,t as x}from"./select-D1luRgRq.js";import{t as S}from"./upload-Cjls2phY.js";import{t as C}from"./tooltip-DUcNmmP-.js";import{t as w}from"./alert-BprQRUmf.js";import{h as T,v as E}from"./models-yTQ4rqqP.js";import{t as D}from"./drawer-BYrWn-wi.js";import{t as O}from"./box-aM-pcoXN.js";import{t as k}from"./clock-CCljPowN.js";import{t as A}from"./external-link-BkmV4CLH.js";import{a as j,c as M,n as N,o as P,r as F,t as I}from"./pagination-CtkSWjVi.js";import{t as L}from"./image-CbgMrDy4.js";import{t as ee}from"./info-B8n3U43j.js";import{t as R}from"./trash-2-DLKDfmcv.js";import{t as z}from"./triangle-alert-BWV9pT6w.js";import{t as B}from"./upload-BZ-Gklsa.js";import{t as V}from"./wand-sparkles-zeg14-Rq.js";import{t as te}from"./zap-aiC_mBZz.js";import{$n as ne,Jn as H,Qn as U,Xn as W,Zn as G}from"./constants-CzYWUlOY.js";import{$t as K,Bn as q,O as J,Pi as Y,Qt as X,Zt as Z,bi as re,en as ie,fn as ae,jr as oe,oi as se,qt as ce,rn as le,tn as ue}from"./index-DSAgKNWm.js";import{t as de}from"./CopyToClipboard-CP5bh5uq.js";import{t as fe}from"./ReportButton-Donr-AWk.js";import{t as Q}from"./ImagePreview-fQJvI010.js";import{n as pe}from"./taskDrawerMixin-DyAUhFEq.js";import{t as me}from"./Consumption-DGykzGxC.js";import{t as he}from"./ApiCodeButton-BoYfR8v5.js";import{t as ge}from"./BotPlaceholder-C42Ymqvl.js";import{t as _e}from"./ImageWrapper-COWOs7PX.js";var ve=y({name:`LayoutNanobanana`,components:{MagicIcon:V,ElDrawer:D,ElButton:Y},mixins:[pe]}),ye={class:`main flex flex-row flex-1`},be={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)]`},xe={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Se(t,n,r,i,o,c){let l=u(`magic-icon`),p=u(`el-button`),h=u(`el-drawer`);return _(),s(`div`,ye,[e(`div`,be,[f(t.$slots,`config`,{},void 0,!0)]),e(`div`,xe,[f(t.$slots,`result`,{},void 0,!0)]),d(a(p,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:m(()=>[a(l,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[v,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer generator-drawer`},{default:m(()=>[f(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Ce=J(ve,[[`render`,Se],[`__scopeId`,`data-v-6419fc74`]]),we=y({name:`PromptInput`,components:{PromptTextarea:j},computed:{prompt:{get(){return this.$store.state.nanobanana?.config?.prompt},set(e){this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Te(e,t,n,r,i,a){let o=u(`prompt-textarea`);return _(),p(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`nanobanana.name.prompt`),info:e.$t(`nanobanana.description.prompt`),placeholder:e.$t(`nanobanana.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ee=J(we,[[`render`,Te]]),De=y({name:`ImageUrlsInput`,components:{UploadIcon:B,ElUpload:S,ElButton:Y,InfoIcon:P,ImagePreview:Q},mixins:[ue,ie,X,ce],data(){return{fileList:[],uploadUrl:se()+`/api/v1/files/`,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.nanobanana?.config?.image_urls}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){let e=(this.fileList||[]).filter(e=>!e?.response?.file_url);this.fileList=e.length?e:[];return}let t=[];e.forEach(e=>{let n=this.fileList.find(t=>t?.response?.file_url===e||t?.url===e);n?t.push(n):t.push({name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}})}),(this.fileList||[]).filter(e=>!e?.response?.file_url).forEach(e=>{t.some(t=>t===e||t?.url===e?.url||t?.response?.file_url===e?.response?.file_url)||t.push(e)}),this.fileList=t}}},mounted(){},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url==`string`&&e.url.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImageUrls()},onExceed(){E.warning(this.$t(`nanobanana.message.uploadImageExceed`))},onError(){E.error(this.$t(`nanobanana.message.uploadImageError`))},onSetImageUrls(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,image_urls:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImageUrls()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImageUrls()}}}),Oe={class:`field mb-[10px] flex min-h-8 w-full items-center justify-between gap-3`},ke={class:`flex min-w-0 items-center`},Ae={class:`title m-0 text-[14px] font-bold`},je={class:`file-list flex flex-wrap gap-[10px]`};function Me(t,n,o,c,d,f){let h=u(`info-icon`),v=u(`upload-icon`),y=u(`el-button`),b=u(`el-upload`),x=u(`image-preview`);return _(),s(`div`,null,[e(`div`,Oe,[e(`div`,ke,[e(`h2`,Ae,i(t.$t(`nanobanana.name.imageUrls`)),1),a(h,{content:t.$t(`nanobanana.description.imageUrls`)},null,8,[`content`])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value shrink-0`,limit:5,multiple:!0,"show-file-list":!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-change":t.onChange,"on-remove":t.onRemove,headers:t.headers},{default:m(()=>[a(y,{size:`small`,type:`primary`,round:``},{default:m(()=>[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`nanobanana.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])]),e(`div`,je,[(_(!0),s(l,null,g(t.fileList,(e,n)=>(_(),p(x,{key:e.uid||e?.response?.file_url||e.url||n,url:e.url||e?.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemovePreview(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])])}var Ne=J(De,[[`render`,Me]]),Pe=y({name:`AspectRatioSelector`,components:{InfoIcon:P},data(){return{options:[{value:`1:1`,label:`1:1`,width:20,height:20},{value:`3:2`,label:`3:2`,width:27,height:18},{value:`2:3`,label:`2:3`,width:18,height:27},{value:`16:9`,label:`16:9`,width:25,height:13},{value:`9:16`,label:`9:16`,width:13,height:25},{value:`4:3`,label:`4:3`,width:24,height:18},{value:`3:4`,label:`3:4`,width:18,height:24}]}},computed:{value(){return this.$store.state.nanobanana?.config?.aspect_ratio}},methods:{onSelect(e){let t=this.value===e?void 0:e,n={...this.$store.state.nanobanana?.config||{}};t?n.aspect_ratio=t:delete n.aspect_ratio,this.$store.commit(`nanobanana/setConfig`,n)}}}),Fe={class:`ratio`},Ie={class:`header`},Le={class:`title font-bold`},Re=[`aria-label`],ze=[`aria-checked`,`aria-label`,`onClick`,`onKeydown`],Be={class:`preview`},Ve={class:`name`};function He(r,o,d,f,p,m){let v=u(`info-icon`);return _(),s(`div`,Fe,[e(`div`,Ie,[e(`h2`,Le,i(r.$t(`nanobanana.name.aspectRatio`)),1),a(v,{content:r.$t(`nanobanana.description.aspectRatio`),class:`ml-1`},null,8,[`content`])]),e(`div`,{class:`items`,role:`radiogroup`,"aria-label":r.$t(`nanobanana.name.aspectRatio`)},[(_(!0),s(l,null,g(r.options,a=>(_(),s(`div`,{key:a.value,class:n([`item`,{active:r.value===a.value}]),role:`radio`,"aria-checked":r.value===a.value,"aria-label":a.label,tabindex:`0`,onClick:e=>r.onSelect(a.value),onKeydown:[c(t(e=>r.onSelect(a.value),[`prevent`]),[`enter`]),c(t(e=>r.onSelect(a.value),[`prevent`]),[`space`])]},[e(`div`,Be,[e(`div`,{class:`rect`,style:h({width:a.width+`px`,height:a.height+`px`})},null,4)]),e(`p`,Ve,i(a.label),1)],42,ze))),128))],8,Re)])}var Ue=J(Pe,[[`render`,He],[`__scopeId`,`data-v-7131eb97`]]),We=y({name:`NanobananaModelSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:P},data(){return{options:[{value:W,label:this.$t(`nanobanana.model.nanoBanana`)},{value:U,label:U},{value:ne,label:this.$t(`nanobanana.model.nanoBananaPro`)},{value:G,label:this.$t(`nanobanana.model.nanoBanana2`)}]}},computed:{value:{get(){return this.$store.state.nanobanana?.config?.model},set(e){this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,model:e})}},modelDescription(){return this.$t(`nanobanana.description.model`)}},mounted(){this.value||=H}}),Ge={class:`field`},Ke={class:`label`},qe={class:`box`},Je={class:`title font-bold`};function Ye(t,n,r,o,c,d){let f=u(`info-icon`),h=u(`el-option`),v=u(`el-select`);return _(),s(`div`,Ge,[e(`div`,Ke,[e(`div`,qe,[e(`h2`,Je,i(t.$t(`nanobanana.name.model`)),1),a(f,{content:t.modelDescription,class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`nanobanana.placeholder.select`)},{default:m(()=>[(_(!0),s(l,null,g(t.options,e=>(_(),p(h,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Xe=J(We,[[`render`,Ye],[`__scopeId`,`data-v-11cb675b`]]),Ze=y({name:`NanobananaResolutionSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:P},data(){return{cachedResolution:`1K`,options:[{value:`1K`,label:`1K`},{value:`2K`,label:`2K`},{value:`4K`,label:`4K`}]}},computed:{value:{get(){return this.$store.state.nanobanana?.config?.resolution},set(e){this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,resolution:e})}},supportsResolution(){let e=this.$store.state.nanobanana?.config?.model;return e===`nano-banana-2`||e===`nano-banana-pro`}},watch:{value(e){this.supportsResolution&&e&&(this.cachedResolution=e)},supportsResolution(e){e?this.value||=this.cachedResolution||`1K`:(this.value&&(this.cachedResolution=this.value),this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,resolution:void 0}))}},mounted(){this.supportsResolution&&!this.value&&(this.value=`1K`),!this.supportsResolution&&this.value&&(this.cachedResolution=this.value,this.$store.commit(`nanobanana/setConfig`,{...this.$store.state.nanobanana?.config,resolution:void 0}))}}),Qe={class:`field`},$e={class:`label`},et={class:`box`},tt={class:`title font-bold`};function nt(t,n,r,o,c,d){let f=u(`info-icon`),h=u(`el-option`),v=u(`el-select`);return _(),s(`div`,Qe,[e(`div`,$e,[e(`div`,et,[e(`h2`,tt,i(t.$t(`nanobanana.name.resolution`)),1),a(f,{content:t.$t(`nanobanana.description.resolutionProOnly`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`nanobanana.placeholder.select`),disabled:!t.supportsResolution},{default:m(()=>[(_(!0),s(l,null,g(t.options,e=>(_(),p(h,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`])])}var rt=y({name:`ConfigPanel`,components:{MagicIcon:V,ElButton:Y,PromptInput:Ee,Consumption:me,ImageUrlsInput:Ne,AspectRatioSelector:Ue,ModelSelector:Xe,ResolutionSelector:J(Ze,[[`render`,nt],[`__scopeId`,`data-v-7ab9d4d4`]])},emits:[`generate`],computed:{config(){return this.$store.state.nanobanana?.config},consumption(){let e={...this.config||{}},t=Array.isArray(e?.image_urls)&&e.image_urls.length>0;return le({...e,action:t?`edit`:`generate`},this.service?.cost)},service(){return this.$store.state.nanobanana?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),it={class:`flex flex-col h-full`},at={class:`flex-1 overflow-y-auto p-5`},ot={class:`flex flex-col items-center justify-center px-5 pb-5`};function st(t,n,o,c,l,d){let f=u(`model-selector`),p=u(`resolution-selector`),h=u(`prompt-input`),g=u(`aspect-ratio-selector`),v=u(`image-urls-input`),y=u(`consumption`),b=u(`magic-icon`),x=u(`el-button`);return _(),s(`div`,it,[e(`div`,at,[a(f,{class:`mb-4`}),a(p,{class:`mb-4`}),a(h,{class:`mb-4`}),a(g,{class:`mb-4`}),a(v,{class:`mb-4`})]),e(`div`,ot,[a(y,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(x,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:m(()=>[a(b,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`nanobanana.button.generate`)),1)]),_:1},8,[`onClick`])])])}var ct=J(rt,[[`render`,st]]),lt=y({name:`TaskPreview`,components:{ApplicationIcon:O,ChannelIcon:M,DeleteIcon:R,ExternalLinkIcon:A,ImageIcon:L,InfoIcon:ee,LightningIcon:te,MagicIcon:V,TimeIcon:k,WarningIcon:z,CopyToClipboard:de,ElAlert:w,ImageWrapper:_e,ElButton:Y,ElTooltip:C,ImagePreview:Q,ApiCodeButton:he,ReportButton:fe},props:{modelValue:{type:Object,required:!0}},computed:{images(){let e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{e.push(t)}),e},hasImages(){return this.images.some(e=>!!e?.image_url)},showResult(){let e=this.modelValue?.response;return e?e.success===!0?!0:this.hasImages&&e.success!==!1:!1}},methods:{onEdit(e){if(!e)return;console.debug(`Edit image:`,e);let t={...this.$store.state.nanobanana?.config||{}};delete t.action,t.image_urls=[e],this.$store.commit(`nanobanana/setConfig`,t)},async onDelete(){let e=this.modelValue?.id;if(e){try{await re.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`nanobanana/deleteTask`,{id:e}),E.success(this.$t(`common.message.deleteTaskSuccess`))}catch{E.error(this.$t(`common.message.deleteTaskFailed`))}}}}}),ut={class:`preview`},dt={class:`left`},ft={class:`main`},pt={class:`bot`},mt={class:`datetime`},ht=[`aria-label`],gt={class:`info`},_t={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},vt={key:1,class:`prompt mt-2`},yt={key:0},bt={key:0,class:n({content:!0,failed:!0})},xt={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},St={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Ct={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Tt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Et={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Dt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ot={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},kt={key:5,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},At={key:1,class:n({content:!0})},jt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Mt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Nt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Pt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ft={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},It={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Lt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Rt={key:5,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},zt={key:2,class:n({content:!0})},Bt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Vt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ht={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ut={class:`text-[var(--el-text-color-regular)] text-xs mb-2`};function Wt(n,c,d,f,h,v){let y=u(`capability-presentation`),b=u(`delete-icon`),x=u(`el-tooltip`),S=u(`image-preview`),C=u(`image-wrapper`),w=u(`el-button`),T=u(`api-code-button`),E=u(`report-button`),D=u(`application-icon`),O=u(`image-icon`),k=u(`external-link-icon`),A=u(`lightning-icon`),j=u(`magic-icon`),M=u(`copy-to-clipboard`),N=u(`time-icon`),P=u(`channel-icon`),F=u(`el-alert`),I=u(`warning-icon`),L=u(`info-icon`);return _(),s(`div`,ut,[e(`div`,dt,[a(y,{capability:`nanobanana`,part:`avatar`,class:`avatar`})]),e(`div`,ft,[e(`div`,pt,[a(y,{capability:`nanobanana`,part:`name`}),e(`span`,mt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(x,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:m(()=>[n.modelValue?.id?(_(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:c[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,ht)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,gt,[n.modelValue?.request?.image_urls&&n.modelValue?.request?.image_urls.length>0?(_(),s(`div`,_t,[(_(!0),s(l,null,g(n.modelValue?.request?.image_urls,(e,t)=>(_(),p(S,{key:t,url:e,name:`image-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),n.modelValue?.request?.prompt?(_(),s(`p`,vt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(_(),s(`span`,yt,` - (`+i(n.$t(`nanobanana.status.pending`))+`) `,1))])):o(``,!0)]),n.showResult?(_(),s(`div`,bt,[e(`div`,xt,[(_(!0),s(l,null,g(n.images,(e,t)=>(_(),p(C,{key:t,src:e?.image_url,"raw-src":e?.image_url},null,8,[`src`,`raw-src`]))),128))]),e(`div`,St,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`common.button.edit`),placement:`top-start`},{default:m(()=>[a(w,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=t(e=>n.onEdit(n.images?.[0]?.image_url),[`stop`])},{default:m(()=>[r(i(n.$t(`common.button.edit`)),1)]),_:1})]),_:1},8,[`content`]),a(T,{path:`/nano-banana/images`,body:n.modelValue?.request},null,8,[`body`]),a(E,{service:`nanobanana`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])]),a(F,{closable:!1,class:`mt-2 success`},{default:m(()=>[n.modelValue?.request?.model?(_(),s(`p`,Ct,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.resolution?(_(),s(`p`,wt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.resolution`))+`: `+i(n.modelValue?.request?.resolution),1)])):o(``,!0),n.modelValue?.request?.aspect_ratio?(_(),s(`p`,Tt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.aspectRatio`))+`: `+i(n.modelValue?.request?.aspect_ratio),1)])):o(``,!0),n.modelValue?.request?.action?(_(),s(`p`,Et,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.task`))+`: `+i(n.modelValue?.request?.action===`generate`?n.$t(`nanobanana.name.generate`):n.$t(`nanobanana.name.edits`)),1)])):o(``,!0),e(`p`,Dt,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(M,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(_(),s(`p`,Ot,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(_(),s(`p`,kt,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(M,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1||n.modelValue?.response?.error?(_(),s(`div`,At,[a(F,{closable:!1,class:`failure`},{template:m(()=>[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.failure`)),1)]),default:m(()=>[n.modelValue?.request?.model?(_(),s(`p`,jt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.resolution?(_(),s(`p`,Mt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.resolution`))+`: `+i(n.modelValue?.request?.resolution),1)])):o(``,!0),n.modelValue?.request?.aspect_ratio?(_(),s(`p`,Nt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.aspectRatio`))+`: `+i(n.modelValue?.request?.aspect_ratio),1)])):o(``,!0),n.modelValue?.request?.action?(_(),s(`p`,Pt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.task`))+`: `+i(n.modelValue?.request?.action===`generate`?n.$t(`nanobanana.name.generate`):n.$t(`nanobanana.name.edits`)),1)])):o(``,!0),e(`p`,Ft,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(M,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),e(`p`,It,[a(L,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(M,{content:n.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.elapsed?(_(),s(`p`,Lt,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(_(),s(`p`,Rt,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(M,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(_(),s(`div`,zt,[a(F,{closable:!1,class:`info`},{template:m(()=>[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.status.pending`)),1)]),default:m(()=>[n.modelValue?.request?.model?(_(),s(`p`,Bt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.resolution?(_(),s(`p`,$,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.resolution`))+`: `+i(n.modelValue?.request?.resolution),1)])):o(``,!0),n.modelValue?.request?.aspect_ratio?(_(),s(`p`,Vt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.aspectRatio`))+`: `+i(n.modelValue?.request?.aspect_ratio),1)])):o(``,!0),n.modelValue?.request?.action?(_(),s(`p`,Ht,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.task`))+`: `+i(n.modelValue?.request?.action===`generate`?n.$t(`nanobanana.name.generate`):n.$t(`nanobanana.name.edits`)),1)])):o(``,!0),e(`p`,Ut,[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`nanobanana.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(M,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])])]),_:1})]))])])}var Gt=y({name:`RecentPanel`,components:{TaskPreview:J(lt,[[`render`,Wt],[`__scopeId`,`data-v-45a0e049`]]),BotPlaceholder:ge,NoTasks:F,ScrollList:N},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.nanobanana?.tasks,items:this.$store.state.nanobanana?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Kt={key:0},qt={key:2,class:`w-full h-full flex items-center justify-center`};function Jt(e,t,n,r,i,c){let d=u(`bot-placeholder`),f=u(`task-preview`),h=u(`scroll-list`),v=u(`no-tasks`);return _(),s(l,null,[e.tasks?.items===void 0?(_(),s(`div`,Kt,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(_(),p(h,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:m(()=>[(_(!0),s(l,null,g(e.tasks?.items,e=>(_(),p(f,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(_(),s(`div`,qt,[a(v)])):o(``,!0)],64)}var Yt=y({name:`NanobananaIndex`,components:{ConfigPanel:ct,Layout:Ce,RecentPanel:J(Gt,[[`render`,Jt]])},mixins:[K],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.nanobanana?.status?.getApplications===T.Request},tasksLoading(){return this.$store.state.nanobanana?.status?.getTasks===T.Request},credential(){return this.$store.state.nanobanana?.credential},config(){return this.$store.state.nanobanana?.config},application(){return this.$store.state.nanobanana?.application},tasks(){return this.$store.state.nanobanana?.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await I({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loading,setLoading:e=>this.loading=e,isBlocked:()=>this.tasksLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`nanobanana/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`nanobanana/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.tasksLoading){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=20,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),await this.$store.dispatch(`nanobanana/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})},async onGenerate(){if(!Z(this.uploadTracker,e=>this.$t(e),e=>E.warning(e)))return;let e={...this.config||{}},t=Array.isArray(e?.image_urls)&&e.image_urls.length>0;delete e.action,!t&&`image_urls`in e&&delete e.image_urls,e?.aspect_ratio||delete e.aspect_ratio;let n=e?.model===`nano-banana-2`||e?.model===`nano-banana-pro`;!n&&`resolution`in e&&delete e.resolution,n&&!e?.resolution&&(e.resolution=`1K`);let r={...e,action:t?`edit`:`generate`,async:!0};if(!ae())return;let i=this.credential?.token;if(!i){console.error(`no token specified`);return}E.info(this.$t(`nanobanana.message.startingTask`)),oe(`nanobanana`,q.generate(r,{token:i})).then(()=>{E.success(this.$t(`nanobanana.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?E.error(this.$t(`nanobanana.message.usedUp`)):E.error(this.$t(`nanobanana.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Xt(e,t,n,r,i,o){let s=u(`config-panel`),c=u(`recent-panel`),l=u(`layout`);return _(),p(l,null,{config:m(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:m(()=>[a(c,{ref:`recentPanel`,loading:e.loading,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Zt=J(Yt,[[`render`,Xt]]);export{Zt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,T as s,at as c,j as l,mt as u,rt as d,tt as f,z as p}from"./vendor-chart-Dw-P17PN.js";import{t as m}from"./arrow-right-CRIhneaK.js";import{t as h}from"./check-ClRF_Odp.js";import{t as g}from"./external-link-C-Spy8-D.js";import{t as ee}from"./globe-G4DF9IKX.js";import{t as te}from"./wand-sparkles-DPuJe95W.js";import{M as _,O as v,Pi as y,gn as b,i as x,r as S}from"./index-z6KXKq9i.js";var C=(e,t)=>({zh:e,en:t}),w=`https://platform.acedata.cloud/documents/studio-overview`,T=new Set([`qrart`,`pika`]),E={auth:C(`https://cdn.acedata.cloud/ae2dceaacc.png`,`https://cdn.acedata.cloud/61f717db6c.png`),branding:C(`https://cdn.acedata.cloud/d54f145c5c.png`,`https://cdn.acedata.cloud/6d59646c4d.png`),capabilities:C(`https://cdn.acedata.cloud/2369fa145f.png`,`https://cdn.acedata.cloud/082a69ca54.png`),digitalHumanDesktop:C(`https://cdn.acedata.cloud/b9ee357c33.png`,`https://cdn.acedata.cloud/a0228b206a.png`),distributionDesktop:C(`https://cdn.acedata.cloud/6c25c74a49.png`,`https://cdn.acedata.cloud/a1e62e4425.png`),klingDesktop:C(`https://cdn.acedata.cloud/e45bc3e2e2.png`,`https://cdn.acedata.cloud/03d73b16ce.png`),klingMobile:C(`https://cdn.acedata.cloud/10dc431467.png`,`https://cdn.acedata.cloud/ea10c8e395.png`),maestroDesktop:C(`https://cdn.acedata.cloud/1791398216.png`,`https://cdn.acedata.cloud/7854458ee3.png`),nanoDesktop:C(`https://cdn.acedata.cloud/82252ec647.png`,`https://cdn.acedata.cloud/e047aea679.png`),nanoMobile:C(`https://cdn.acedata.cloud/c7da634c96.png`,`https://cdn.acedata.cloud/dc5b2cca1d.png`),subsites:C(`https://cdn.acedata.cloud/bf4356fffc.png`,`https://cdn.acedata.cloud/b1948ec2a2.png`),sunoDesktop:C(`https://cdn.acedata.cloud/8ce288065b.png`,`https://cdn.acedata.cloud/1eebf72e3a.png`)},D=[{key:`subsites`,eyebrowKey:`index.eyebrow.subsites`,titleKey:`index.title.subsites`,subtitleKey:`index.subtitle.subsites`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=subsites`,href:w,desktop:E.subsites,bulletKeys:[`index.benefit.subsites.noServer`,`index.benefit.subsites.customDomain`,`index.benefit.subsites.branding`]},{key:`capabilities`,eyebrowKey:`index.eyebrow.capabilities`,titleKey:`index.title.capabilities`,subtitleKey:`index.subtitle.capabilities`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=function`,href:w,desktop:E.capabilities,bulletKeys:[`index.benefit.capabilities.catalog`,`index.benefit.capabilities.display`,`index.benefit.capabilities.pricing`]},{key:`operations`,eyebrowKey:`index.eyebrow.operations`,titleKey:`index.title.operations`,subtitleKey:`index.subtitle.operations`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=seo`,href:w,desktop:E.auth,bulletKeys:[`index.benefit.operations.seo`,`index.benefit.operations.auth`,`index.benefit.operations.localization`]},{key:`distribution`,eyebrowKey:`index.eyebrow.distribution`,titleKey:`index.title.distribution`,subtitleKey:`index.subtitle.distribution`,buttonKey:`index.button.learnBusiness`,path:`/distribution`,href:w,desktop:E.distributionDesktop,bulletKeys:[`index.benefit.distribution.noBarrier`,`index.benefit.distribution.levels`,`index.benefit.distribution.withdrawal`]}],O=[{key:`image`,featureKeys:[`nanobanana`],eyebrowKey:`index.eyebrow.image`,titleKey:`index.title.image`,subtitleKey:`index.subtitle.image`,buttonKey:`index.button.try`,path:`/nanobanana`,desktop:E.nanoDesktop,mobile:E.nanoMobile},{key:`music`,featureKeys:[`suno`],eyebrowKey:`index.eyebrow.music`,titleKey:`index.title.music`,subtitleKey:`index.subtitle.music`,buttonKey:`index.button.try`,path:`/suno`,desktop:E.sunoDesktop},{key:`workflow`,featureKeys:[`maestro`],eyebrowKey:`index.eyebrow.workflow`,titleKey:`index.title.workflow`,subtitleKey:`index.subtitle.workflow`,buttonKey:`index.button.try`,path:`/maestro`,desktop:E.maestroDesktop},{key:`digitalHuman`,featureKeys:[`digitalhuman`],eyebrowKey:`index.eyebrow.digitalHuman`,titleKey:`index.title.digitalHuman`,subtitleKey:`index.subtitle.digitalHuman`,buttonKey:`index.button.try`,path:`/digital-human`,desktop:E.digitalHumanDesktop}],k=p({name:`Index`,components:{ElButton:y,ConfirmIcon:h,ExternalLinkIcon:g,GlobeIcon:ee,MagicIcon:te,NextIcon:m},data(){return{}},computed:{site(){return this.$store.state.site},enabledFeatures(){return this.site?.features??{}},isMainSite(){let e=typeof window>`u`?``:window.location.hostname,t=e.endsWith(`.plain-river-2dfc.workers.dev`)&&this.site?.origin===e&&this.site?.title===`Ace Data Cloud`&&this.site?.branding===null;return this.site?.origin===`studio.acedata.cloud`||b()||t},capabilityCount(){return this.site?.id?this.capabilityCards.length:x.length},isChineseLocale(){return String(this.$i18n.locale).toLowerCase()===`zh-cn`},heroDesktop(){return this.localizedImage(E.klingDesktop)},heroMobile(){return this.localizedImage(E.klingMobile)},businessShowcases(){return D.filter(e=>e.key!==`subsites`||this.isMainSite).map(e=>this.resolveShowcase(e))},creationShowcases(){return(this.isMainSite?O:O.filter(e=>e.featureKeys?.some(e=>this.enabledFeatures[e]?.enabled))).map(e=>this.resolveShowcase(e))},capabilityCards(){return(this.isMainSite?x:x.filter(e=>this.enabledFeatures[e]?.enabled)).filter(e=>!T.has(e)).map(e=>({key:e,label:this.$t(`site.field.features${e.charAt(0).toUpperCase()}${e.slice(1)}`),icon:S[e]}))}},methods:{localizedImage(e){return this.isChineseLocale?e.zh:e.en},resolveShowcase(e){return{...e,desktop:this.localizedImage(e.desktop),mobile:e.mobile?this.localizedImage(e.mobile):void 0}},onStart(){this.$router.push(_())},openShowcase(e){this.$router.push(e.path)},openSubsites(){this.$router.push(`/chatgpt?dialog=settings&tab=subsites`)},scrollToPlatform(){this.scrollToSection(`platform`)},scrollToCreation(){this.scrollToSection(`creation`)},scrollToSubsites(){this.scrollToSection(`subsites`)},scrollToSection(e){let t=document.getElementById(`app`),n=document.getElementById(e);if(!t||!n)return;let r=document.querySelector(`.header`)?.offsetHeight??0;t.scrollTop=n.offsetTop-r}}}),A={class:`landing`},j={class:`hero`},M={class:`container hero__content`},N={class:`hero__copy`},P={class:`eyebrow`},F={class:`hero__headline`},I={class:`hero__summary`},L={class:`hero__actions`},R={class:`hero__stats`},z={class:`hero__screens`},B={class:`macbook-frame hero__desktop`,"aria-hidden":`true`},V={class:`macbook-frame__lid`},H={class:`macbook-frame__viewport`},U=[`src`],W={class:`phone-device hero__mobile`,"aria-hidden":`true`},G={class:`phone-device__screen`},K=[`src`],q={id:`platform`,class:`section platform-section`},J={class:`container`},Y={class:`section-heading section-heading--wide`},X={class:`eyebrow eyebrow--light`},Z=[`id`],Q={class:`platform-story__copy`},ne={class:`story-number`},re={class:`story-kicker`},ie={class:`feature-points`},ae={class:`screen-pair screen-pair--large`},oe={class:`macbook-frame screen-pair__desktop`},se={class:`macbook-frame__lid`},ce={class:`macbook-frame__viewport`},le=[`src`,`alt`],ue={id:`creation`,class:`section creation-section`},de={class:`container`},fe={class:`section-heading`},pe={class:`eyebrow eyebrow--light`},me={class:`creation-grid`},he={class:`macbook-frame screen-pair__desktop`},ge={class:`macbook-frame__lid`},_e={class:`macbook-frame__viewport`},ve=[`src`,`alt`],ye={key:0,class:`phone-device screen-pair__mobile`},be={class:`phone-device__screen`},xe=[`src`],Se={class:`creation-item__copy`},Ce={class:`story-kicker`},we=[`onClick`],Te={class:`section capability-section`},Ee={class:`container`},De={class:`section-heading section-heading--wide`},$={class:`eyebrow eyebrow--light`},Oe={class:`capability-directory`},ke=[`src`],Ae={class:`final-cta`},je={class:`container final-cta__content`},Me={class:`story-kicker`},Ne={class:`final-cta__actions`};function Pe(p,m,h,g,ee,te){let _=c(`el-button`),v=c(`magic-icon`),y=c(`globe-icon`),b=c(`confirm-icon`),x=c(`next-icon`),S=c(`external-link-icon`);return f(),o(`div`,A,[e(`section`,j,[m[9]||=e(`div`,{class:`hero__grid`},null,-1),e(`div`,M,[e(`div`,N,[e(`span`,P,r(p.$t(`index.badge.hero`)),1),e(`h1`,null,r(p.site?.title),1),e(`p`,F,r(p.$t(`index.subtitle.banner`)),1),e(`p`,I,r(p.$t(`index.subtitle.hero`)),1),e(`div`,L,[i(_,{type:`primary`,size:`large`,onClick:p.onStart},{default:u(()=>[n(r(p.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),i(_,{size:`large`,onClick:p.scrollToPlatform},{default:u(()=>[n(r(p.$t(`index.button.explore`)),1)]),_:1},8,[`onClick`])]),e(`dl`,R,[e(`div`,null,[e(`dt`,null,r(p.capabilityCount)+`+`,1),e(`dd`,null,r(p.$t(`index.stat.capabilities`)),1)]),e(`div`,null,[m[2]||=e(`dt`,null,`5 min`,-1),e(`dd`,null,r(p.$t(`index.stat.subsite`)),1)]),e(`div`,null,[m[3]||=e(`dt`,null,`24%`,-1),e(`dd`,null,r(p.$t(`index.stat.commission`)),1)])])]),e(`div`,z,[e(`div`,B,[e(`div`,V,[m[4]||=e(`span`,{class:`macbook-frame__camera`},null,-1),e(`div`,H,[e(`img`,{src:p.heroDesktop,alt:``},null,8,U)]),m[5]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[6]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)]),e(`div`,W,[m[8]||=e(`span`,{class:`phone-device__speaker`},null,-1),e(`div`,G,[m[7]||=e(`span`,{class:`phone-device__island`},null,-1),e(`img`,{src:p.heroMobile,alt:``},null,8,K)])]),e(`button`,{type:`button`,class:`hero__note hero__note--top`,onClick:m[0]||=(...e)=>p.scrollToCreation&&p.scrollToCreation(...e)},[i(v,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(`index.note.allInOne`)),1)]),p.isMainSite?(f(),o(`button`,{key:0,type:`button`,class:`hero__note hero__note--bottom`,onClick:m[1]||=(...e)=>p.scrollToSubsites&&p.scrollToSubsites(...e)},[i(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(`index.note.customDomain`)),1)])):a(``,!0)])])]),e(`section`,q,[e(`div`,J,[e(`div`,Y,[e(`span`,X,r(p.$t(`index.eyebrow.business`)),1),e(`h2`,null,r(p.$t(`index.title.business`)),1),e(`p`,null,r(p.$t(`index.subtitle.business`)),1)]),(f(!0),o(s,null,d(p.businessShowcases,(a,c)=>(f(),o(`article`,{id:a.key,key:a.key,class:t([`platform-story`,{"platform-story--reverse":c%2==1}])},[e(`div`,Q,[e(`span`,ne,`0`+r(c+1),1),e(`p`,re,r(p.$t(a.eyebrowKey)),1),e(`h3`,null,r(p.$t(a.titleKey)),1),e(`p`,null,r(p.$t(a.subtitleKey)),1),e(`ul`,ie,[(f(!0),o(s,null,d(a.bulletKeys,t=>(f(),o(`li`,{key:t},[i(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(t)),1)]))),128))]),a.href?(f(),l(_,{key:0,tag:`a`,type:`primary`,plain:``,href:a.href,target:`_blank`,rel:`noopener noreferrer`},{default:u(()=>[n(r(p.$t(a.buttonKey))+` `,1),i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:2},1032,[`href`])):(f(),l(_,{key:1,type:`primary`,plain:``,onClick:e=>p.openShowcase(a)},{default:u(()=>[n(r(p.$t(a.buttonKey))+` `,1),i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:2},1032,[`onClick`]))]),e(`div`,ae,[e(`div`,oe,[e(`div`,se,[m[10]||=e(`span`,{class:`macbook-frame__camera`,"aria-hidden":`true`},null,-1),e(`div`,ce,[e(`img`,{src:a.desktop,alt:p.$t(a.titleKey),loading:`lazy`},null,8,le)]),m[11]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[12]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)])])],10,Z))),128))])]),e(`section`,ue,[e(`div`,de,[e(`div`,fe,[e(`span`,pe,r(p.$t(`index.eyebrow.creation`)),1),e(`h2`,null,r(p.$t(`index.title.creation`)),1),e(`p`,null,r(p.$t(`index.subtitle.creation`)),1)]),e(`div`,me,[(f(!0),o(s,null,d(p.creationShowcases,n=>(f(),o(`article`,{key:n.key,class:`creation-item`},[e(`div`,{class:t([`screen-pair`,{"screen-pair--with-phone":n.mobile}])},[e(`div`,he,[e(`div`,ge,[m[13]||=e(`span`,{class:`macbook-frame__camera`,"aria-hidden":`true`},null,-1),e(`div`,_e,[e(`img`,{src:n.desktop,alt:p.$t(n.titleKey),loading:`lazy`},null,8,ve)]),m[14]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[15]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)]),n.mobile?(f(),o(`div`,ye,[m[17]||=e(`span`,{class:`phone-device__speaker`,"aria-hidden":`true`},null,-1),e(`div`,be,[m[16]||=e(`span`,{class:`phone-device__island`,"aria-hidden":`true`},null,-1),e(`img`,{src:n.mobile,alt:``,loading:`lazy`},null,8,xe)])])):a(``,!0)],2),e(`div`,Se,[e(`div`,null,[e(`p`,Ce,r(p.$t(n.eyebrowKey)),1),e(`h3`,null,r(p.$t(n.titleKey)),1)]),i(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,null,r(p.$t(n.subtitleKey)),1),e(`button`,{type:`button`,class:`creation-item__link`,onClick:e=>p.openShowcase(n)},r(p.$t(`index.button.try`)),9,we)])]))),128))])])]),e(`section`,Te,[e(`div`,Ee,[e(`div`,De,[e(`span`,$,r(p.$t(`index.eyebrow.directory`)),1),e(`h2`,null,r(p.$t(`index.title.directory`)),1),e(`p`,null,r(p.$t(`index.subtitle.directory`)),1)]),e(`div`,Oe,[(f(!0),o(s,null,d(p.capabilityCards,t=>(f(),o(`div`,{key:t.key,class:`capability-row`},[e(`img`,{src:t.icon,alt:``},null,8,ke),e(`span`,null,r(t.label),1)]))),128))])])]),e(`section`,Ae,[e(`div`,je,[e(`div`,null,[e(`p`,Me,r(p.$t(`index.eyebrow.cta`)),1),e(`h2`,null,r(p.$t(`index.title.cta`)),1),e(`p`,null,r(p.$t(`index.subtitle.cta`)),1)]),e(`div`,Ne,[i(_,{type:`primary`,size:`large`,onClick:p.onStart},{default:u(()=>[n(r(p.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),p.isMainSite?(f(),l(_,{key:0,size:`large`,onClick:p.openSubsites},{default:u(()=>[n(r(p.$t(`index.button.createSubsite`)),1)]),_:1},8,[`onClick`])):a(``,!0)])])])])}var Fe=v(k,[[`render`,Pe],[`__scopeId`,`data-v-82c57205`]]);export{Fe as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,T as s,at as c,j as l,mt as u,rt as d,tt as f,z as p}from"./vendor-chart-Dw-P17PN.js";import{t as m}from"./arrow-right-CoHZqGXA.js";import{t as h}from"./check-DpKzDz-5.js";import{t as g}from"./external-link-BkmV4CLH.js";import{t as ee}from"./globe-C6g3JZgL.js";import{t as te}from"./wand-sparkles-zeg14-Rq.js";import{M as _,O as v,Pi as y,gn as b,i as x,r as S}from"./index-DSAgKNWm.js";var C=(e,t)=>({zh:e,en:t}),w=`https://platform.acedata.cloud/documents/studio-overview`,T=new Set([`qrart`,`pika`]),E={auth:C(`https://cdn.acedata.cloud/ae2dceaacc.png`,`https://cdn.acedata.cloud/61f717db6c.png`),branding:C(`https://cdn.acedata.cloud/d54f145c5c.png`,`https://cdn.acedata.cloud/6d59646c4d.png`),capabilities:C(`https://cdn.acedata.cloud/2369fa145f.png`,`https://cdn.acedata.cloud/082a69ca54.png`),digitalHumanDesktop:C(`https://cdn.acedata.cloud/b9ee357c33.png`,`https://cdn.acedata.cloud/a0228b206a.png`),distributionDesktop:C(`https://cdn.acedata.cloud/6c25c74a49.png`,`https://cdn.acedata.cloud/a1e62e4425.png`),klingDesktop:C(`https://cdn.acedata.cloud/e45bc3e2e2.png`,`https://cdn.acedata.cloud/03d73b16ce.png`),klingMobile:C(`https://cdn.acedata.cloud/10dc431467.png`,`https://cdn.acedata.cloud/ea10c8e395.png`),maestroDesktop:C(`https://cdn.acedata.cloud/1791398216.png`,`https://cdn.acedata.cloud/7854458ee3.png`),nanoDesktop:C(`https://cdn.acedata.cloud/82252ec647.png`,`https://cdn.acedata.cloud/e047aea679.png`),nanoMobile:C(`https://cdn.acedata.cloud/c7da634c96.png`,`https://cdn.acedata.cloud/dc5b2cca1d.png`),subsites:C(`https://cdn.acedata.cloud/bf4356fffc.png`,`https://cdn.acedata.cloud/b1948ec2a2.png`),sunoDesktop:C(`https://cdn.acedata.cloud/8ce288065b.png`,`https://cdn.acedata.cloud/1eebf72e3a.png`)},D=[{key:`subsites`,eyebrowKey:`index.eyebrow.subsites`,titleKey:`index.title.subsites`,subtitleKey:`index.subtitle.subsites`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=subsites`,href:w,desktop:E.subsites,bulletKeys:[`index.benefit.subsites.noServer`,`index.benefit.subsites.customDomain`,`index.benefit.subsites.branding`]},{key:`capabilities`,eyebrowKey:`index.eyebrow.capabilities`,titleKey:`index.title.capabilities`,subtitleKey:`index.subtitle.capabilities`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=function`,href:w,desktop:E.capabilities,bulletKeys:[`index.benefit.capabilities.catalog`,`index.benefit.capabilities.display`,`index.benefit.capabilities.pricing`]},{key:`operations`,eyebrowKey:`index.eyebrow.operations`,titleKey:`index.title.operations`,subtitleKey:`index.subtitle.operations`,buttonKey:`index.button.learnBusiness`,path:`/chatgpt?dialog=settings&tab=seo`,href:w,desktop:E.auth,bulletKeys:[`index.benefit.operations.seo`,`index.benefit.operations.auth`,`index.benefit.operations.localization`]},{key:`distribution`,eyebrowKey:`index.eyebrow.distribution`,titleKey:`index.title.distribution`,subtitleKey:`index.subtitle.distribution`,buttonKey:`index.button.learnBusiness`,path:`/distribution`,href:w,desktop:E.distributionDesktop,bulletKeys:[`index.benefit.distribution.noBarrier`,`index.benefit.distribution.levels`,`index.benefit.distribution.withdrawal`]}],O=[{key:`image`,featureKeys:[`nanobanana`],eyebrowKey:`index.eyebrow.image`,titleKey:`index.title.image`,subtitleKey:`index.subtitle.image`,buttonKey:`index.button.try`,path:`/nanobanana`,desktop:E.nanoDesktop,mobile:E.nanoMobile},{key:`music`,featureKeys:[`suno`],eyebrowKey:`index.eyebrow.music`,titleKey:`index.title.music`,subtitleKey:`index.subtitle.music`,buttonKey:`index.button.try`,path:`/suno`,desktop:E.sunoDesktop},{key:`workflow`,featureKeys:[`maestro`],eyebrowKey:`index.eyebrow.workflow`,titleKey:`index.title.workflow`,subtitleKey:`index.subtitle.workflow`,buttonKey:`index.button.try`,path:`/maestro`,desktop:E.maestroDesktop},{key:`digitalHuman`,featureKeys:[`digitalhuman`],eyebrowKey:`index.eyebrow.digitalHuman`,titleKey:`index.title.digitalHuman`,subtitleKey:`index.subtitle.digitalHuman`,buttonKey:`index.button.try`,path:`/digital-human`,desktop:E.digitalHumanDesktop}],k=p({name:`Index`,components:{ElButton:y,ConfirmIcon:h,ExternalLinkIcon:g,GlobeIcon:ee,MagicIcon:te,NextIcon:m},data(){return{}},computed:{site(){return this.$store.state.site},enabledFeatures(){return this.site?.features??{}},isMainSite(){let e=typeof window>`u`?``:window.location.hostname,t=e.endsWith(`.plain-river-2dfc.workers.dev`)&&this.site?.origin===e&&this.site?.title===`Ace Data Cloud`&&this.site?.branding===null;return this.site?.origin===`studio.acedata.cloud`||b()||t},capabilityCount(){return this.site?.id?this.capabilityCards.length:x.length},isChineseLocale(){return String(this.$i18n.locale).toLowerCase()===`zh-cn`},heroDesktop(){return this.localizedImage(E.klingDesktop)},heroMobile(){return this.localizedImage(E.klingMobile)},businessShowcases(){return D.filter(e=>e.key!==`subsites`||this.isMainSite).map(e=>this.resolveShowcase(e))},creationShowcases(){return(this.isMainSite?O:O.filter(e=>e.featureKeys?.some(e=>this.enabledFeatures[e]?.enabled))).map(e=>this.resolveShowcase(e))},capabilityCards(){return(this.isMainSite?x:x.filter(e=>this.enabledFeatures[e]?.enabled)).filter(e=>!T.has(e)).map(e=>({key:e,label:this.$t(`site.field.features${e.charAt(0).toUpperCase()}${e.slice(1)}`),icon:S[e]}))}},methods:{localizedImage(e){return this.isChineseLocale?e.zh:e.en},resolveShowcase(e){return{...e,desktop:this.localizedImage(e.desktop),mobile:e.mobile?this.localizedImage(e.mobile):void 0}},onStart(){this.$router.push(_())},openShowcase(e){this.$router.push(e.path)},openSubsites(){this.$router.push(`/chatgpt?dialog=settings&tab=subsites`)},scrollToPlatform(){this.scrollToSection(`platform`)},scrollToCreation(){this.scrollToSection(`creation`)},scrollToSubsites(){this.scrollToSection(`subsites`)},scrollToSection(e){let t=document.getElementById(`app`),n=document.getElementById(e);if(!t||!n)return;let r=document.querySelector(`.header`)?.offsetHeight??0;t.scrollTop=n.offsetTop-r}}}),A={class:`landing`},j={class:`hero`},M={class:`container hero__content`},N={class:`hero__copy`},P={class:`eyebrow`},F={class:`hero__headline`},I={class:`hero__summary`},L={class:`hero__actions`},R={class:`hero__stats`},z={class:`hero__screens`},B={class:`macbook-frame hero__desktop`,"aria-hidden":`true`},V={class:`macbook-frame__lid`},H={class:`macbook-frame__viewport`},U=[`src`],W={class:`phone-device hero__mobile`,"aria-hidden":`true`},G={class:`phone-device__screen`},K=[`src`],q={id:`platform`,class:`section platform-section`},J={class:`container`},Y={class:`section-heading section-heading--wide`},X={class:`eyebrow eyebrow--light`},Z=[`id`],Q={class:`platform-story__copy`},ne={class:`story-number`},re={class:`story-kicker`},ie={class:`feature-points`},ae={class:`screen-pair screen-pair--large`},oe={class:`macbook-frame screen-pair__desktop`},se={class:`macbook-frame__lid`},ce={class:`macbook-frame__viewport`},le=[`src`,`alt`],ue={id:`creation`,class:`section creation-section`},de={class:`container`},fe={class:`section-heading`},pe={class:`eyebrow eyebrow--light`},me={class:`creation-grid`},he={class:`macbook-frame screen-pair__desktop`},ge={class:`macbook-frame__lid`},_e={class:`macbook-frame__viewport`},ve=[`src`,`alt`],ye={key:0,class:`phone-device screen-pair__mobile`},be={class:`phone-device__screen`},xe=[`src`],Se={class:`creation-item__copy`},Ce={class:`story-kicker`},we=[`onClick`],Te={class:`section capability-section`},Ee={class:`container`},De={class:`section-heading section-heading--wide`},$={class:`eyebrow eyebrow--light`},Oe={class:`capability-directory`},ke=[`src`],Ae={class:`final-cta`},je={class:`container final-cta__content`},Me={class:`story-kicker`},Ne={class:`final-cta__actions`};function Pe(p,m,h,g,ee,te){let _=c(`el-button`),v=c(`magic-icon`),y=c(`globe-icon`),b=c(`confirm-icon`),x=c(`next-icon`),S=c(`external-link-icon`);return f(),o(`div`,A,[e(`section`,j,[m[9]||=e(`div`,{class:`hero__grid`},null,-1),e(`div`,M,[e(`div`,N,[e(`span`,P,r(p.$t(`index.badge.hero`)),1),e(`h1`,null,r(p.site?.title),1),e(`p`,F,r(p.$t(`index.subtitle.banner`)),1),e(`p`,I,r(p.$t(`index.subtitle.hero`)),1),e(`div`,L,[i(_,{type:`primary`,size:`large`,onClick:p.onStart},{default:u(()=>[n(r(p.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),i(_,{size:`large`,onClick:p.scrollToPlatform},{default:u(()=>[n(r(p.$t(`index.button.explore`)),1)]),_:1},8,[`onClick`])]),e(`dl`,R,[e(`div`,null,[e(`dt`,null,r(p.capabilityCount)+`+`,1),e(`dd`,null,r(p.$t(`index.stat.capabilities`)),1)]),e(`div`,null,[m[2]||=e(`dt`,null,`5 min`,-1),e(`dd`,null,r(p.$t(`index.stat.subsite`)),1)]),e(`div`,null,[m[3]||=e(`dt`,null,`24%`,-1),e(`dd`,null,r(p.$t(`index.stat.commission`)),1)])])]),e(`div`,z,[e(`div`,B,[e(`div`,V,[m[4]||=e(`span`,{class:`macbook-frame__camera`},null,-1),e(`div`,H,[e(`img`,{src:p.heroDesktop,alt:``},null,8,U)]),m[5]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[6]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)]),e(`div`,W,[m[8]||=e(`span`,{class:`phone-device__speaker`},null,-1),e(`div`,G,[m[7]||=e(`span`,{class:`phone-device__island`},null,-1),e(`img`,{src:p.heroMobile,alt:``},null,8,K)])]),e(`button`,{type:`button`,class:`hero__note hero__note--top`,onClick:m[0]||=(...e)=>p.scrollToCreation&&p.scrollToCreation(...e)},[i(v,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(`index.note.allInOne`)),1)]),p.isMainSite?(f(),o(`button`,{key:0,type:`button`,class:`hero__note hero__note--bottom`,onClick:m[1]||=(...e)=>p.scrollToSubsites&&p.scrollToSubsites(...e)},[i(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(`index.note.customDomain`)),1)])):a(``,!0)])])]),e(`section`,q,[e(`div`,J,[e(`div`,Y,[e(`span`,X,r(p.$t(`index.eyebrow.business`)),1),e(`h2`,null,r(p.$t(`index.title.business`)),1),e(`p`,null,r(p.$t(`index.subtitle.business`)),1)]),(f(!0),o(s,null,d(p.businessShowcases,(a,c)=>(f(),o(`article`,{id:a.key,key:a.key,class:t([`platform-story`,{"platform-story--reverse":c%2==1}])},[e(`div`,Q,[e(`span`,ne,`0`+r(c+1),1),e(`p`,re,r(p.$t(a.eyebrowKey)),1),e(`h3`,null,r(p.$t(a.titleKey)),1),e(`p`,null,r(p.$t(a.subtitleKey)),1),e(`ul`,ie,[(f(!0),o(s,null,d(a.bulletKeys,t=>(f(),o(`li`,{key:t},[i(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,r(p.$t(t)),1)]))),128))]),a.href?(f(),l(_,{key:0,tag:`a`,type:`primary`,plain:``,href:a.href,target:`_blank`,rel:`noopener noreferrer`},{default:u(()=>[n(r(p.$t(a.buttonKey))+` `,1),i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:2},1032,[`href`])):(f(),l(_,{key:1,type:`primary`,plain:``,onClick:e=>p.openShowcase(a)},{default:u(()=>[n(r(p.$t(a.buttonKey))+` `,1),i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:2},1032,[`onClick`]))]),e(`div`,ae,[e(`div`,oe,[e(`div`,se,[m[10]||=e(`span`,{class:`macbook-frame__camera`,"aria-hidden":`true`},null,-1),e(`div`,ce,[e(`img`,{src:a.desktop,alt:p.$t(a.titleKey),loading:`lazy`},null,8,le)]),m[11]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[12]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)])])],10,Z))),128))])]),e(`section`,ue,[e(`div`,de,[e(`div`,fe,[e(`span`,pe,r(p.$t(`index.eyebrow.creation`)),1),e(`h2`,null,r(p.$t(`index.title.creation`)),1),e(`p`,null,r(p.$t(`index.subtitle.creation`)),1)]),e(`div`,me,[(f(!0),o(s,null,d(p.creationShowcases,n=>(f(),o(`article`,{key:n.key,class:`creation-item`},[e(`div`,{class:t([`screen-pair`,{"screen-pair--with-phone":n.mobile}])},[e(`div`,he,[e(`div`,ge,[m[13]||=e(`span`,{class:`macbook-frame__camera`,"aria-hidden":`true`},null,-1),e(`div`,_e,[e(`img`,{src:n.desktop,alt:p.$t(n.titleKey),loading:`lazy`},null,8,ve)]),m[14]||=e(`div`,{class:`macbook-frame__chin`},null,-1)]),m[15]||=e(`div`,{class:`macbook-frame__base`},[e(`span`)],-1)]),n.mobile?(f(),o(`div`,ye,[m[17]||=e(`span`,{class:`phone-device__speaker`,"aria-hidden":`true`},null,-1),e(`div`,be,[m[16]||=e(`span`,{class:`phone-device__island`,"aria-hidden":`true`},null,-1),e(`img`,{src:n.mobile,alt:``,loading:`lazy`},null,8,xe)])])):a(``,!0)],2),e(`div`,Se,[e(`div`,null,[e(`p`,Ce,r(p.$t(n.eyebrowKey)),1),e(`h3`,null,r(p.$t(n.titleKey)),1)]),i(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,null,r(p.$t(n.subtitleKey)),1),e(`button`,{type:`button`,class:`creation-item__link`,onClick:e=>p.openShowcase(n)},r(p.$t(`index.button.try`)),9,we)])]))),128))])])]),e(`section`,Te,[e(`div`,Ee,[e(`div`,De,[e(`span`,$,r(p.$t(`index.eyebrow.directory`)),1),e(`h2`,null,r(p.$t(`index.title.directory`)),1),e(`p`,null,r(p.$t(`index.subtitle.directory`)),1)]),e(`div`,Oe,[(f(!0),o(s,null,d(p.capabilityCards,t=>(f(),o(`div`,{key:t.key,class:`capability-row`},[e(`img`,{src:t.icon,alt:``},null,8,ke),e(`span`,null,r(t.label),1)]))),128))])])]),e(`section`,Ae,[e(`div`,je,[e(`div`,null,[e(`p`,Me,r(p.$t(`index.eyebrow.cta`)),1),e(`h2`,null,r(p.$t(`index.title.cta`)),1),e(`p`,null,r(p.$t(`index.subtitle.cta`)),1)]),e(`div`,Ne,[i(_,{type:`primary`,size:`large`,onClick:p.onStart},{default:u(()=>[n(r(p.$t(`common.button.startForFree`)),1)]),_:1},8,[`onClick`]),p.isMainSite?(f(),l(_,{key:0,size:`large`,onClick:p.openSubsites},{default:u(()=>[n(r(p.$t(`index.button.createSubsite`)),1)]),_:1},8,[`onClick`])):a(``,!0)])])])])}var Fe=v(k,[[`render`,Pe],[`__scopeId`,`data-v-82c57205`]]);export{Fe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{t as y}from"./upload-Cjls2phY.js";import{t as b}from"./tooltip-Cwwy0TGy.js";import{t as x}from"./alert-BprQRUmf.js";import{h as S,v as C}from"./models-yTQ4rqqP.js";import{t as w}from"./drawer-DwNKgVNQ.js";import{t as T}from"./box-DCajlFel.js";import{t as E}from"./clock-CG4G8mZJ.js";import{a as D,c as O,n as k,o as A,r as j,s as M,t as N}from"./pagination-C7GFvDBj.js";import{t as ee}from"./info-Cxon5zpU.js";import{t as P}from"./trash-2-mMMYa28u.js";import{t as F}from"./triangle-alert-C28SDtE0.js";import{t as I}from"./upload-D6NHiFjY.js";import{t as L}from"./wand-sparkles-DPuJe95W.js";import{At as te,Et as ne,Ot as re,Tt as ie,jt as R,kt as z}from"./constants-CzYWUlOY.js";import{$t as B,Fn as V,Jt as H,O as U,Pi as W,Qt as G,Xt as K,Yt as q,Zt as J,bi as Y,en as X,fn as ae,jr as oe,oi as Z,qt as se,rn as ce,tn as le}from"./index-z6KXKq9i.js";import{t as ue}from"./CopyToClipboard-kEHSjRrJ.js";import{t as de}from"./ReportButton-CybqyzF6.js";import{t as fe}from"./FilePreview-CvCyrhWU.js";import{t as Q}from"./ImagePreview-BkFVGOWx.js";import{n as pe}from"./taskDrawerMixin-DyAUhFEq.js";import{t as me}from"./Consumption-CpQHXzGt.js";import{t as he}from"./VideoPlayer-RzzT_NxH.js";import{t as ge}from"./ApiCodeButton-PTy1Cbvo.js";import{t as _e}from"./BotPlaceholder-BxCtmaAR.js";var ve=v({name:`LayoutOmni`,components:{MagicIcon:L,ElDrawer:w,ElButton:W},mixins:[pe]}),ye={class:`main flex flex-row flex-1`},be={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)]`},xe={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Se(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,ye,[e(`div`,be,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,xe,[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 Ce=U(ve,[[`render`,Se],[`__scopeId`,`data-v-b76ffabf`]]),we=v({name:`OmniPromptInput`,components:{PromptTextarea:D},computed:{prompt:{get(){return this.$store.state.omni?.config?.prompt},set(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Te(e,t,n,r,i,a){let o=l(`prompt-textarea`);return g(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`omni.name.prompt`),info:e.$t(`omni.description.prompt`),placeholder:e.$t(`omni.placeholder.prompt`),"min-rows":5},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ee=U(we,[[`render`,Te]]),De=v({name:`OmniResolutionSelector`,components:{InfoIcon:A},data(){return{options:[{value:R,label:`720p`},{value:te,label:`1080p`}]}},computed:{value:{get(){return this.$store.state.omni?.config?.resolution},set(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,resolution:e})}}},mounted(){this.value||=ne}}),Oe={class:`resolution`},ke={class:`header`},Ae={class:`title font-bold`},je={class:`items`},Me=[`onClick`];function Ne(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,Oe,[e(`div`,ke,[e(`h2`,Ae,i(t.$t(`omni.name.resolution`)),1),a(p,{content:t.$t(`omni.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,je,[(g(!0),s(c,null,h(t.options,e=>(g(),s(`div`,{key:e.value,class:n([`item`,{active:t.value===e.value}]),onClick:n=>t.value=e.value},i(e.label),11,Me))),128))])])}var Pe=U(De,[[`render`,Ne],[`__scopeId`,`data-v-1f9abe29`]]),Fe=v({name:`OmniRatioSelector`,components:{InfoIcon:A},computed:{options(){return[{value:re,label:`16:9`,w:32,h:18},{value:z,label:`9:16`,w:18,h:32}]},value:{get(){return this.$store.state.omni?.config?.aspect_ratio},set(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,aspect_ratio:e})}}},mounted(){this.value||=ie}}),Ie={class:`ratio`},Le={class:`header`},Re={class:`title font-bold`},ze={class:`items`},Be=[`onClick`],Ve={class:`preview`},He={class:`name`};function Ue(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,Ie,[e(`div`,Le,[e(`h2`,Re,i(t.$t(`omni.name.ratio`)),1),a(p,{content:t.$t(`omni.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,ze,[(g(!0),s(c,null,h(t.options,r=>(g(),s(`div`,{key:r.value,class:n([`item`,{active:t.value===r.value}]),onClick:e=>t.value=r.value},[e(`div`,Ve,[e(`div`,{class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)]),e(`div`,He,i(r.label),1)],10,Be))),128))])])}var We=U(Fe,[[`render`,Ue],[`__scopeId`,`data-v-1c0c1511`]]),Ge=4,Ke=v({name:`OmniReferenceImagesInput`,components:{ElUpload:y,ElButton:W,InfoIcon:A,ImagePreview:Q,UploadIcon:I},mixins:[le,X,G,se],data(){return{fileList:[],uploadUrl:Z()+`/api/v1/files/`,limit:Ge,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)||[]},value(){return this.$store.state.omni?.config?.image_urls}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){let e=(this.fileList||[]).filter(e=>!e?.response?.file_url);this.fileList=e.length?e:[];return}let t=[];e.forEach(e=>{let n=this.fileList.find(t=>t?.response?.file_url===e||t?.url===e);n?t.push(n):t.push({name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}})}),(this.fileList||[]).filter(e=>!e?.response?.file_url).forEach(e=>{t.some(t=>t===e||t?.url===e?.url||t?.response?.file_url===e?.response?.file_url)||t.push(e)}),this.fileList=t}}},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url==`string`&&e.url.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}this.onSetReferenceImages()},onExceed(){C.warning(this.$t(`omni.message.uploadReferenceExceed`))},onError(){C.error(this.$t(`omni.message.uploadError`))},onSetReferenceImages(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,image_urls:e.length?e:void 0}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetReferenceImages()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetReferenceImages()}}}),qe={class:`field mb-[10px] flex min-h-8 w-full items-center justify-between gap-3`},Je={class:`flex min-w-0 items-center`},Ye={class:`title m-0 text-[14px] font-bold`},Xe={class:`file-list flex flex-wrap gap-[10px]`};function Ze(t,n,o,u,d,m){let _=l(`info-icon`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`),x=l(`image-preview`);return g(),s(`div`,null,[e(`div`,qe,[e(`div`,Je,[e(`h2`,Ye,i(t.$t(`omni.name.referenceImages`)),1),a(_,{content:t.$t(`omni.description.referenceImages`)},null,8,[`content`])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value shrink-0`,limit:t.limit,multiple:!0,"show-file-list":!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-change":t.onChange,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(y,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`omni.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`limit`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])]),e(`div`,Xe,[(g(!0),s(c,null,h(t.fileList,(e,n)=>(g(),f(x,{key:e.uid||e?.response?.file_url||e.url||n,url:e.url||e?.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemovePreview(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])])}var Qe=U(Ke,[[`render`,Ze]]),$e=v({name:`OmniVideoInput`,components:{ElUpload:y,ElButton:W,InfoIcon:A,FilePreview:fe,UploadIcon:I},mixins:[X,G],data(){return{fileList:[],uploadUrl:Z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},videoUrl(){return this.$store.state.omni?.config?.video_urls?.[0]},videoName(){let e=this.videoUrl||``;return e.split(`/`).pop()||e}},methods:{onExceed(){C.warning(this.$t(`omni.message.uploadVideoExceed`))},onError(){C.error(this.$t(`omni.message.uploadVideoError`))},beforeUpload(e){let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=K(e.size);return t?n?!0:(C.error(this.$t(`omni.message.uploadVideoSizeExceed`,{max:q(H)})),!1):(C.error(this.$t(`omni.message.uploadVideoTypeFailed`)),!1)},setVideoUrls(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,video_urls:e?[e]:void 0})},onRemove(){this.fileList=[],this.setVideoUrls(void 0)},async onSuccess(e,t){let n=e?.file_url||t?.response?.file_url;this.setVideoUrls(n||void 0)}}}),et={class:`field flex min-h-8 w-full items-center justify-between gap-3`},tt={class:`flex min-w-0 items-center`},nt={class:`title m-0 text-[14px] font-bold`},rt={key:0,class:`file-list flex flex-wrap gap-[10px]`};function it(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-upload`),y=l(`file-preview`);return g(),s(`div`,null,[e(`div`,et,[e(`div`,tt,[e(`h2`,nt,i(t.$t(`omni.name.referenceVideo`)),1),a(m,{content:t.$t(`omni.description.referenceVideo`)},null,8,[`content`])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4,.mov`,name:`file`,class:`value shrink-0`,"show-file-list":!1,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},{default:p(()=>[a(_,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(h,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`omni.button.uploadVideo`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])]),t.videoUrl?(g(),s(`div`,rt,[a(y,{url:t.videoUrl,name:t.videoName,percentage:100,onRemove:t.onRemove},null,8,[`url`,`name`,`onRemove`])])):o(``,!0)])}var at=v({name:`OmniConfigPanel`,components:{ElButton:W,MagicIcon:L,PromptInput:Ee,ResolutionSelector:Pe,RatioSelector:We,ReferenceImagesInput:Qe,VideoInput:U($e,[[`render`,it],[`__scopeId`,`data-v-b87d1e4e`]]),Consumption:me},emits:[`generate`],computed:{config(){return this.$store.state.omni?.config},consumption(){return ce(this.config,this.service?.cost)},service(){return this.$store.state.omni?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),ot={class:`flex flex-col h-full`},st={class:`flex-1 overflow-y-auto p-5`},ct={class:`flex flex-col items-center justify-center px-5 pb-5`};function lt(t,n,o,c,u,d){let f=l(`prompt-input`),m=l(`ratio-selector`),h=l(`resolution-selector`),_=l(`reference-images-input`),v=l(`video-input`),y=l(`consumption`),b=l(`magic-icon`),x=l(`el-button`);return g(),s(`div`,ot,[e(`div`,st,[a(f,{class:`mb-4`}),a(m,{class:`mb-4`}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`})]),e(`div`,ct,[a(y,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(x,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(b,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`omni.button.generate`)),1)]),_:1},8,[`onClick`])])])}var ut=U(at,[[`render`,lt]]),dt=v({name:`OmniTaskPreview`,components:{DeleteIcon:P,ApplicationIcon:T,ChannelIcon:O,CopyToClipboard:ue,ExpandIcon:M,InfoIcon:ee,MagicIcon:L,TimeIcon:E,WarningIcon:F,ElAlert:x,VideoPlayer:he,ElTooltip:b,ElButton:W,ImagePreview:Q,ApiCodeButton:ge,ReportButton:de},props:{modelValue:{type:Object,required:!0}},data(){return{nowTs:Date.now(),timer:0}},computed:{video(){return this.modelValue?.response?.data?.[0]},inputImage(){return this.modelValue?.request?.image_urls?.[0]},pendingElapsed(){let e=parseFloat((this.modelValue?.created_at||``).toString());if(e)return Math.max(0,Math.floor(this.nowTs/1e3-e))}},watch:{"modelValue.response":{handler(e){e&&this.stopTimer()}}},mounted(){this.modelValue?.response||(this.timer=window.setInterval(()=>{this.nowTs=Date.now()},1e3))},beforeUnmount(){this.stopTimer()},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await Y.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(`omni/deleteTask`,{id:e}),C.success(this.$t(`common.message.deleteTaskSuccess`))}catch{C.error(this.$t(`common.message.deleteTaskFailed`))}}},stopTimer(){this.timer&&=(window.clearInterval(this.timer),0)},onDownload(e){window.open(e,`_blank`)}}}),ft={class:`preview`},pt={class:`left`},mt={class:`main`},ht={class:`bot`},gt={class:`datetime`},_t=[`aria-label`],vt={class:`info`},yt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},bt={key:1,class:`prompt mt-2`},xt={key:0},St={key:1},Ct={key:0,class:n({content:!0})},wt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Tt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Et={key:1,class:n({content:!0})},Dt={key:0,class:`mb-4`},Ot={key:1,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},kt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},At={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},jt={key:0},Mt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Nt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Pt={key:2,class:n({content:!0})},Ft={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},It={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Lt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Rt={key:3,class:n({content:!0})},zt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Bt(n,c,u,d,f,m){let h=l(`capability-presentation`),_=l(`delete-icon`),v=l(`el-tooltip`),y=l(`image-preview`),b=l(`time-icon`),x=l(`magic-icon`),S=l(`copy-to-clipboard`),C=l(`el-alert`),w=l(`video-player`),T=l(`el-button`),E=l(`api-code-button`),D=l(`report-button`),O=l(`application-icon`),k=l(`expand-icon`),A=l(`channel-icon`),j=l(`warning-icon`),M=l(`info-icon`);return g(),s(`div`,ft,[e(`div`,pt,[a(h,{capability:`omni`,part:`avatar`,class:`avatar`})]),e(`div`,mt,[e(`div`,ht,[a(h,{capability:`omni`,part:`name`}),e(`span`,gt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(v,{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:c[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(_,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,_t)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,vt,[n.inputImage?(g(),s(`div`,yt,[a(y,{url:n.inputImage,name:`image`,closable:!1},null,8,[`url`])])):o(``,!0),n.modelValue?.request?.prompt?(g(),s(`p`,bt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?n.video?.state===`processing`||n.video?.state===`pending`?(g(),s(`span`,St,` - (`+i(n.$t(`omni.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,xt,` - (`+i(n.$t(`omni.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,Et,[n.video?.video_url?(g(),s(`div`,Dt,[a(w,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,Ot,[a(v,{class:`box-item`,effect:`dark`,content:n.$t(`omni.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(T,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`omni.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(E,{path:`/gemini/videos`,body:n.modelValue?.request},null,8,[`body`]),a(D,{service:`omni`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(C,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,kt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.resolution?(g(),s(`p`,At,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.resolution`))+`: `+i(n.modelValue?.request?.resolution)+` `,1),n.modelValue?.request?.aspect_ratio?(g(),s(`span`,jt,` · `+i(n.modelValue?.request?.aspect_ratio),1)):o(``,!0)])):o(``,!0),e(`p`,Mt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,Nt,[a(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,$,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(S,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(g(),s(`div`,Pt,[a(C,{closable:!1,class:`failure`},{template:p(()=>[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.failure`)),1)]),default:p(()=>[e(`p`,Ft,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(g(),s(`p`,It,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(S,{content:n.modelValue?.response?.error?.message,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Lt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(S,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,Rt,[a(C,{closable:!1,class:`info`},{template:p(()=>[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.status`)),1)]),default:p(()=>[e(`p`,zt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})])):(g(),s(`div`,Ct,[a(C,{closable:!1,class:`info`},{template:p(()=>[a(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.status.pending`)),1)]),default:p(()=>[e(`p`,wt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.pendingElapsed===void 0?o(``,!0):(g(),s(`p`,Tt,[a(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.elapsed`))+`: `+i(n.pendingElapsed)+`s `,1)]))]),_:1})]))])])}var Vt=v({name:`OmniRecentPanel`,components:{TaskPreview:U(dt,[[`render`,Bt],[`__scopeId`,`data-v-08bc502f`]]),BotPlaceholder:_e,NoTasks:j,ScrollList:k},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.omni?.tasks,items:this.$store.state.omni?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Ht={key:0},Ut={key:2,class:`w-full h-full flex items-center justify-center`};function Wt(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`,Ht,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,e=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,Ut,[a(v)])):o(``,!0)],64)}var Gt=v({name:`OmniIndex`,components:{ConfigPanel:ut,Layout:Ce,RecentPanel:U(Vt,[[`render`,Wt]])},mixins:[B],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.omni?.status?.getApplications===S.Request},tasksLoading(){return this.$store.state.omni?.status?.getTasks===S.Request||this.fetchingTasks},credential(){return this.$store.state.omni?.credential},config(){return this.$store.state.omni?.config},tasks(){return this.$store.state.omni?.tasks}},watch:{initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await N({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){await this.$store.dispatch(`omni/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(`omni/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!J(this.uploadTracker,e=>this.$t(e),e=>C.warning(e)))return;let e={...this.config||{}};if(typeof e?.prompt==`string`&&(e.prompt=e.prompt.trim(),e.prompt||delete e.prompt),Array.isArray(e?.image_urls)&&(e.image_urls=e.image_urls.filter(e=>typeof e==`string`&&e.trim()),e.image_urls.length||delete e.image_urls),Array.isArray(e?.video_urls)&&(e.video_urls=e.video_urls.filter(e=>typeof e==`string`&&e.trim()),e.video_urls.length||delete e.video_urls),!e?.prompt){C.warning(this.$t(`omni.message.promptRequired`));return}if(e?.video_urls&&!e?.image_urls){C.warning(this.$t(`omni.message.videoRequiresImage`));return}let t={...e,async:!0};if(!ae())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}C.info(this.$t(`omni.message.startingTask`)),oe(`omni`,V.generate(t,{token:n})).then(()=>{C.success(this.$t(`omni.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?C.error(this.$t(`omni.message.usedUp`)):C.error(this.$t(`omni.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Kt(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return g(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var qt=U(Gt,[[`render`,Kt]]);export{qt as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{t as y}from"./upload-Cjls2phY.js";import{t as b}from"./tooltip-DUcNmmP-.js";import{t as x}from"./alert-BprQRUmf.js";import{h as S,v as C}from"./models-yTQ4rqqP.js";import{t as w}from"./drawer-BYrWn-wi.js";import{t as T}from"./box-aM-pcoXN.js";import{t as E}from"./clock-CCljPowN.js";import{a as D,c as O,n as k,o as A,r as j,s as M,t as N}from"./pagination-CtkSWjVi.js";import{t as ee}from"./info-B8n3U43j.js";import{t as P}from"./trash-2-DLKDfmcv.js";import{t as F}from"./triangle-alert-BWV9pT6w.js";import{t as I}from"./upload-BZ-Gklsa.js";import{t as L}from"./wand-sparkles-zeg14-Rq.js";import{At as te,Et as ne,Ot as re,Tt as ie,jt as R,kt as z}from"./constants-CzYWUlOY.js";import{$t as B,Fn as V,Jt as H,O as U,Pi as W,Qt as G,Xt as K,Yt as q,Zt as J,bi as Y,en as X,fn as ae,jr as oe,oi as Z,qt as se,rn as ce,tn as le}from"./index-DSAgKNWm.js";import{t as ue}from"./CopyToClipboard-CP5bh5uq.js";import{t as de}from"./ReportButton-Donr-AWk.js";import{t as fe}from"./FilePreview-BaSJGB_a.js";import{t as Q}from"./ImagePreview-fQJvI010.js";import{n as pe}from"./taskDrawerMixin-DyAUhFEq.js";import{t as me}from"./Consumption-DGykzGxC.js";import{t as he}from"./VideoPlayer-BNRh6h0n.js";import{t as ge}from"./ApiCodeButton-BoYfR8v5.js";import{t as _e}from"./BotPlaceholder-C42Ymqvl.js";var ve=v({name:`LayoutOmni`,components:{MagicIcon:L,ElDrawer:w,ElButton:W},mixins:[pe]}),ye={class:`main flex flex-row flex-1`},be={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)]`},xe={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Se(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,ye,[e(`div`,be,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,xe,[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 Ce=U(ve,[[`render`,Se],[`__scopeId`,`data-v-b76ffabf`]]),we=v({name:`OmniPromptInput`,components:{PromptTextarea:D},computed:{prompt:{get(){return this.$store.state.omni?.config?.prompt},set(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Te(e,t,n,r,i,a){let o=l(`prompt-textarea`);return g(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`omni.name.prompt`),info:e.$t(`omni.description.prompt`),placeholder:e.$t(`omni.placeholder.prompt`),"min-rows":5},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ee=U(we,[[`render`,Te]]),De=v({name:`OmniResolutionSelector`,components:{InfoIcon:A},data(){return{options:[{value:R,label:`720p`},{value:te,label:`1080p`}]}},computed:{value:{get(){return this.$store.state.omni?.config?.resolution},set(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,resolution:e})}}},mounted(){this.value||=ne}}),Oe={class:`resolution`},ke={class:`header`},Ae={class:`title font-bold`},je={class:`items`},Me=[`onClick`];function Ne(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,Oe,[e(`div`,ke,[e(`h2`,Ae,i(t.$t(`omni.name.resolution`)),1),a(p,{content:t.$t(`omni.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,je,[(g(!0),s(c,null,h(t.options,e=>(g(),s(`div`,{key:e.value,class:n([`item`,{active:t.value===e.value}]),onClick:n=>t.value=e.value},i(e.label),11,Me))),128))])])}var Pe=U(De,[[`render`,Ne],[`__scopeId`,`data-v-1f9abe29`]]),Fe=v({name:`OmniRatioSelector`,components:{InfoIcon:A},computed:{options(){return[{value:re,label:`16:9`,w:32,h:18},{value:z,label:`9:16`,w:18,h:32}]},value:{get(){return this.$store.state.omni?.config?.aspect_ratio},set(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,aspect_ratio:e})}}},mounted(){this.value||=ie}}),Ie={class:`ratio`},Le={class:`header`},Re={class:`title font-bold`},ze={class:`items`},Be=[`onClick`],Ve={class:`preview`},He={class:`name`};function Ue(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,Ie,[e(`div`,Le,[e(`h2`,Re,i(t.$t(`omni.name.ratio`)),1),a(p,{content:t.$t(`omni.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,ze,[(g(!0),s(c,null,h(t.options,r=>(g(),s(`div`,{key:r.value,class:n([`item`,{active:t.value===r.value}]),onClick:e=>t.value=r.value},[e(`div`,Ve,[e(`div`,{class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)]),e(`div`,He,i(r.label),1)],10,Be))),128))])])}var We=U(Fe,[[`render`,Ue],[`__scopeId`,`data-v-1c0c1511`]]),Ge=4,Ke=v({name:`OmniReferenceImagesInput`,components:{ElUpload:y,ElButton:W,InfoIcon:A,ImagePreview:Q,UploadIcon:I},mixins:[le,X,G,se],data(){return{fileList:[],uploadUrl:Z()+`/api/v1/files/`,limit:Ge,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)||[]},value(){return this.$store.state.omni?.config?.image_urls}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){let e=(this.fileList||[]).filter(e=>!e?.response?.file_url);this.fileList=e.length?e:[];return}let t=[];e.forEach(e=>{let n=this.fileList.find(t=>t?.response?.file_url===e||t?.url===e);n?t.push(n):t.push({name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}})}),(this.fileList||[]).filter(e=>!e?.response?.file_url).forEach(e=>{t.some(t=>t===e||t?.url===e?.url||t?.response?.file_url===e?.response?.file_url)||t.push(e)}),this.fileList=t}}},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url==`string`&&e.url.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}this.onSetReferenceImages()},onExceed(){C.warning(this.$t(`omni.message.uploadReferenceExceed`))},onError(){C.error(this.$t(`omni.message.uploadError`))},onSetReferenceImages(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,image_urls:e.length?e:void 0}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetReferenceImages()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetReferenceImages()}}}),qe={class:`field mb-[10px] flex min-h-8 w-full items-center justify-between gap-3`},Je={class:`flex min-w-0 items-center`},Ye={class:`title m-0 text-[14px] font-bold`},Xe={class:`file-list flex flex-wrap gap-[10px]`};function Ze(t,n,o,u,d,m){let _=l(`info-icon`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`),x=l(`image-preview`);return g(),s(`div`,null,[e(`div`,qe,[e(`div`,Je,[e(`h2`,Ye,i(t.$t(`omni.name.referenceImages`)),1),a(_,{content:t.$t(`omni.description.referenceImages`)},null,8,[`content`])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value shrink-0`,limit:t.limit,multiple:!0,"show-file-list":!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-change":t.onChange,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(y,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`omni.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`limit`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])]),e(`div`,Xe,[(g(!0),s(c,null,h(t.fileList,(e,n)=>(g(),f(x,{key:e.uid||e?.response?.file_url||e.url||n,url:e.url||e?.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemovePreview(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])])}var Qe=U(Ke,[[`render`,Ze]]),$e=v({name:`OmniVideoInput`,components:{ElUpload:y,ElButton:W,InfoIcon:A,FilePreview:fe,UploadIcon:I},mixins:[X,G],data(){return{fileList:[],uploadUrl:Z()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},videoUrl(){return this.$store.state.omni?.config?.video_urls?.[0]},videoName(){let e=this.videoUrl||``;return e.split(`/`).pop()||e}},methods:{onExceed(){C.warning(this.$t(`omni.message.uploadVideoExceed`))},onError(){C.error(this.$t(`omni.message.uploadVideoError`))},beforeUpload(e){let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=K(e.size);return t?n?!0:(C.error(this.$t(`omni.message.uploadVideoSizeExceed`,{max:q(H)})),!1):(C.error(this.$t(`omni.message.uploadVideoTypeFailed`)),!1)},setVideoUrls(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,video_urls:e?[e]:void 0})},onRemove(){this.fileList=[],this.setVideoUrls(void 0)},async onSuccess(e,t){let n=e?.file_url||t?.response?.file_url;this.setVideoUrls(n||void 0)}}}),et={class:`field flex min-h-8 w-full items-center justify-between gap-3`},tt={class:`flex min-w-0 items-center`},nt={class:`title m-0 text-[14px] font-bold`},rt={key:0,class:`file-list flex flex-wrap gap-[10px]`};function it(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-upload`),y=l(`file-preview`);return g(),s(`div`,null,[e(`div`,et,[e(`div`,tt,[e(`h2`,nt,i(t.$t(`omni.name.referenceVideo`)),1),a(m,{content:t.$t(`omni.description.referenceVideo`)},null,8,[`content`])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4,.mov`,name:`file`,class:`value shrink-0`,"show-file-list":!1,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},{default:p(()=>[a(_,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(h,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`omni.button.uploadVideo`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])]),t.videoUrl?(g(),s(`div`,rt,[a(y,{url:t.videoUrl,name:t.videoName,percentage:100,onRemove:t.onRemove},null,8,[`url`,`name`,`onRemove`])])):o(``,!0)])}var at=v({name:`OmniConfigPanel`,components:{ElButton:W,MagicIcon:L,PromptInput:Ee,ResolutionSelector:Pe,RatioSelector:We,ReferenceImagesInput:Qe,VideoInput:U($e,[[`render`,it],[`__scopeId`,`data-v-b87d1e4e`]]),Consumption:me},emits:[`generate`],computed:{config(){return this.$store.state.omni?.config},consumption(){return ce(this.config,this.service?.cost)},service(){return this.$store.state.omni?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),ot={class:`flex flex-col h-full`},st={class:`flex-1 overflow-y-auto p-5`},ct={class:`flex flex-col items-center justify-center px-5 pb-5`};function lt(t,n,o,c,u,d){let f=l(`prompt-input`),m=l(`ratio-selector`),h=l(`resolution-selector`),_=l(`reference-images-input`),v=l(`video-input`),y=l(`consumption`),b=l(`magic-icon`),x=l(`el-button`);return g(),s(`div`,ot,[e(`div`,st,[a(f,{class:`mb-4`}),a(m,{class:`mb-4`}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`})]),e(`div`,ct,[a(y,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(x,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(b,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`omni.button.generate`)),1)]),_:1},8,[`onClick`])])])}var ut=U(at,[[`render`,lt]]),dt=v({name:`OmniTaskPreview`,components:{DeleteIcon:P,ApplicationIcon:T,ChannelIcon:O,CopyToClipboard:ue,ExpandIcon:M,InfoIcon:ee,MagicIcon:L,TimeIcon:E,WarningIcon:F,ElAlert:x,VideoPlayer:he,ElTooltip:b,ElButton:W,ImagePreview:Q,ApiCodeButton:ge,ReportButton:de},props:{modelValue:{type:Object,required:!0}},data(){return{nowTs:Date.now(),timer:0}},computed:{video(){return this.modelValue?.response?.data?.[0]},inputImage(){return this.modelValue?.request?.image_urls?.[0]},pendingElapsed(){let e=parseFloat((this.modelValue?.created_at||``).toString());if(e)return Math.max(0,Math.floor(this.nowTs/1e3-e))}},watch:{"modelValue.response":{handler(e){e&&this.stopTimer()}}},mounted(){this.modelValue?.response||(this.timer=window.setInterval(()=>{this.nowTs=Date.now()},1e3))},beforeUnmount(){this.stopTimer()},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await Y.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(`omni/deleteTask`,{id:e}),C.success(this.$t(`common.message.deleteTaskSuccess`))}catch{C.error(this.$t(`common.message.deleteTaskFailed`))}}},stopTimer(){this.timer&&=(window.clearInterval(this.timer),0)},onDownload(e){window.open(e,`_blank`)}}}),ft={class:`preview`},pt={class:`left`},mt={class:`main`},ht={class:`bot`},gt={class:`datetime`},_t=[`aria-label`],vt={class:`info`},yt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},bt={key:1,class:`prompt mt-2`},xt={key:0},St={key:1},Ct={key:0,class:n({content:!0})},wt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Tt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Et={key:1,class:n({content:!0})},Dt={key:0,class:`mb-4`},Ot={key:1,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},kt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},At={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},jt={key:0},Mt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Nt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Pt={key:2,class:n({content:!0})},Ft={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},It={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Lt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Rt={key:3,class:n({content:!0})},zt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Bt(n,c,u,d,f,m){let h=l(`capability-presentation`),_=l(`delete-icon`),v=l(`el-tooltip`),y=l(`image-preview`),b=l(`time-icon`),x=l(`magic-icon`),S=l(`copy-to-clipboard`),C=l(`el-alert`),w=l(`video-player`),T=l(`el-button`),E=l(`api-code-button`),D=l(`report-button`),O=l(`application-icon`),k=l(`expand-icon`),A=l(`channel-icon`),j=l(`warning-icon`),M=l(`info-icon`);return g(),s(`div`,ft,[e(`div`,pt,[a(h,{capability:`omni`,part:`avatar`,class:`avatar`})]),e(`div`,mt,[e(`div`,ht,[a(h,{capability:`omni`,part:`name`}),e(`span`,gt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(v,{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:c[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(_,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,_t)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,vt,[n.inputImage?(g(),s(`div`,yt,[a(y,{url:n.inputImage,name:`image`,closable:!1},null,8,[`url`])])):o(``,!0),n.modelValue?.request?.prompt?(g(),s(`p`,bt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?n.video?.state===`processing`||n.video?.state===`pending`?(g(),s(`span`,St,` - (`+i(n.$t(`omni.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,xt,` - (`+i(n.$t(`omni.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,Et,[n.video?.video_url?(g(),s(`div`,Dt,[a(w,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,Ot,[a(v,{class:`box-item`,effect:`dark`,content:n.$t(`omni.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(T,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`omni.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(E,{path:`/gemini/videos`,body:n.modelValue?.request},null,8,[`body`]),a(D,{service:`omni`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(C,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,kt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.resolution?(g(),s(`p`,At,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.resolution`))+`: `+i(n.modelValue?.request?.resolution)+` `,1),n.modelValue?.request?.aspect_ratio?(g(),s(`span`,jt,` · `+i(n.modelValue?.request?.aspect_ratio),1)):o(``,!0)])):o(``,!0),e(`p`,Mt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,Nt,[a(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,$,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(S,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(g(),s(`div`,Pt,[a(C,{closable:!1,class:`failure`},{template:p(()=>[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.failure`)),1)]),default:p(()=>[e(`p`,Ft,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(g(),s(`p`,It,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(S,{content:n.modelValue?.response?.error?.message,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Lt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(S,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,Rt,[a(C,{closable:!1,class:`info`},{template:p(()=>[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.status`)),1)]),default:p(()=>[e(`p`,zt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})])):(g(),s(`div`,Ct,[a(C,{closable:!1,class:`info`},{template:p(()=>[a(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.status.pending`)),1)]),default:p(()=>[e(`p`,wt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.pendingElapsed===void 0?o(``,!0):(g(),s(`p`,Tt,[a(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.elapsed`))+`: `+i(n.pendingElapsed)+`s `,1)]))]),_:1})]))])])}var Vt=v({name:`OmniRecentPanel`,components:{TaskPreview:U(dt,[[`render`,Bt],[`__scopeId`,`data-v-08bc502f`]]),BotPlaceholder:_e,NoTasks:j,ScrollList:k},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.omni?.tasks,items:this.$store.state.omni?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Ht={key:0},Ut={key:2,class:`w-full h-full flex items-center justify-center`};function Wt(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`,Ht,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,e=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,Ut,[a(v)])):o(``,!0)],64)}var Gt=v({name:`OmniIndex`,components:{ConfigPanel:ut,Layout:Ce,RecentPanel:U(Vt,[[`render`,Wt]])},mixins:[B],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.omni?.status?.getApplications===S.Request},tasksLoading(){return this.$store.state.omni?.status?.getTasks===S.Request||this.fetchingTasks},credential(){return this.$store.state.omni?.credential},config(){return this.$store.state.omni?.config},tasks(){return this.$store.state.omni?.tasks}},watch:{initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await N({tasks:this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){await this.$store.dispatch(`omni/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(`omni/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!J(this.uploadTracker,e=>this.$t(e),e=>C.warning(e)))return;let e={...this.config||{}};if(typeof e?.prompt==`string`&&(e.prompt=e.prompt.trim(),e.prompt||delete e.prompt),Array.isArray(e?.image_urls)&&(e.image_urls=e.image_urls.filter(e=>typeof e==`string`&&e.trim()),e.image_urls.length||delete e.image_urls),Array.isArray(e?.video_urls)&&(e.video_urls=e.video_urls.filter(e=>typeof e==`string`&&e.trim()),e.video_urls.length||delete e.video_urls),!e?.prompt){C.warning(this.$t(`omni.message.promptRequired`));return}if(e?.video_urls&&!e?.image_urls){C.warning(this.$t(`omni.message.videoRequiresImage`));return}let t={...e,async:!0};if(!ae())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}C.info(this.$t(`omni.message.startingTask`)),oe(`omni`,V.generate(t,{token:n})).then(()=>{C.success(this.$t(`omni.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?C.error(this.$t(`omni.message.usedUp`)):C.error(this.$t(`omni.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Kt(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return g(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var qt=U(Gt,[[`render`,Kt]]);export{qt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{t as v}from"./upload-Cjls2phY.js";import{t as y}from"./tooltip-Cwwy0TGy.js";import{t as b}from"./alert-BprQRUmf.js";import{h as x,v as S}from"./models-yTQ4rqqP.js";import{t as C}from"./drawer-DwNKgVNQ.js";import{t as w}from"./switch-Df4G1XQO.js";import{t as T}from"./clock-CG4G8mZJ.js";import{a as E,c as D,n as O,o as k,r as A,t as j}from"./pagination-C7GFvDBj.js";import{t as M}from"./info-Cxon5zpU.js";import{t as N}from"./trash-2-mMMYa28u.js";import{t as ee}from"./triangle-alert-C28SDtE0.js";import{t as P}from"./upload-D6NHiFjY.js";import{t as F}from"./wand-sparkles-DPuJe95W.js";import"./constants-CzYWUlOY.js";import{$t as I,O as L,Pi as R,Qt as z,Zt as te,ar as ne,bi as B,en as V,fn as H,jr as U,oi as W,qt as G,rn as K,tn as q}from"./index-z6KXKq9i.js";import{t as J}from"./CopyToClipboard-kEHSjRrJ.js";import{t as Y}from"./ReportButton-CybqyzF6.js";import{t as X}from"./FilePreview-CvCyrhWU.js";import{t as Z}from"./ImagePreview-BkFVGOWx.js";import{n as re}from"./taskDrawerMixin-DyAUhFEq.js";import{t as ie}from"./Consumption-CpQHXzGt.js";import{t as Q}from"./VideoPlayer-RzzT_NxH.js";import{t as ae}from"./ApiCodeButton-PTy1Cbvo.js";import{t as oe}from"./BotPlaceholder-BxCtmaAR.js";var se=_({name:`LayoutLuma`,components:{MagicIcon:F,ElDrawer:C,ElButton:R},mixins:[re]}),ce={class:`main flex flex-row flex-1`},le={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)]`},ue={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function de(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,ce,[e(`div`,le,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,ue,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[g,!t.tasksEmpty]]),a(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var fe=L(se,[[`render`,de],[`__scopeId`,`data-v-d13d43a9`]]),pe=_({name:`EnhancementSelector`,components:{ElSwitch:w,InfoIcon:k},computed:{value:{get(){return this.$store.state.luma?.config?.enhancement},set(e){console.debug(`set enhancement`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,enhancement:e})}}},mounted(){this.value===void 0&&(this.value=!0)}}),me={class:`relative`},he={class:`flex justify-between`},ge={class:`flex justify-start items-center`},_e={class:`text-sm font-bold`},ve={class:`flex justify-end items-center`};function ye(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,me,[e(`div`,he,[e(`div`,ge,[e(`span`,_e,i(t.$t(`luma.name.enhancement`)),1),a(d,{content:t.$t(`luma.description.enhancement`)},null,8,[`content`])]),e(`div`,ve,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var be=L(pe,[[`render`,ye]]),xe=_({name:`CustomSelector`,components:{ElSwitch:w,InfoIcon:k},computed:{value:{get(){return this.$store.state.luma?.config?.custom},set(e){console.debug(`set custom`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,custom:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),Se={class:`relative`},Ce={class:`flex justify-between`},we={class:`flex justify-start items-center`},Te={class:`text-sm font-bold`},Ee={class:`flex justify-end items-center`};function De(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,Se,[e(`div`,Ce,[e(`div`,we,[e(`span`,Te,i(t.$t(`luma.name.custom`)),1),a(d,{content:t.$t(`luma.description.custom`)},null,8,[`content`])]),e(`div`,Ee,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var Oe=L(xe,[[`render`,De]]),ke=_({name:`LoopSelector`,components:{ElSwitch:w,InfoIcon:k},computed:{value:{get(){return this.$store.state.luma?.config?.loop},set(e){console.debug(`set loop`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,loop:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),Ae={class:`relative`},je={class:`flex justify-between`},Me={class:`flex justify-start items-center`},Ne={class:`text-sm font-bold`},Pe={class:`flex justify-end items-center`};function Fe(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,Ae,[e(`div`,je,[e(`div`,Me,[e(`span`,Ne,i(t.$t(`luma.name.loop`)),1),a(d,{content:t.$t(`luma.description.loop`)},null,8,[`content`])]),e(`div`,Pe,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var Ie=L(ke,[[`render`,Fe]]),Le=_({name:`EndImage`,components:{UploadIcon:P,ElUpload:v,ElButton:R,ImagePreview:Z,InfoIcon:k},mixins:[q,V,z,G],data(){return{fileList:[],uploadUrl:W()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.luma?.config?.start_image_url},set(){}}},mounted(){this.value||=void 0,this.onSetEndImageUrl()},methods:{onExceed(){S.warning(this.$t(`luma.message.uploadReferencesExceed`))},onError(){S.error(this.$t(`luma.message.uploadReferencesError`))},onSetEndImageUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),Re={class:`relative`},ze={class:`flex justify-between`},Be={class:`flex justify-start items-center`},Ve={class:`text-sm font-bold`};function He(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,Re,[e(`div`,ze,[e(`div`,Be,[e(`span`,Ve,i(t.$t(`luma.name.endImageUrl`)),1),a(g,{content:t.$t(`luma.description.endImageUrl`)},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:5,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?(h(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(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(`luma.button.uploadEndImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Ue=L(Le,[[`render`,He],[`__scopeId`,`data-v-04c461bb`]]),We=_({name:`StartImage`,components:{UploadIcon:P,ElUpload:v,ElButton:R,ImagePreview:Z,InfoIcon:k},mixins:[q,V,z,G],data(){return{fileList:[],uploadUrl:W()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.luma?.config?.start_image_url},set(){}}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){S.warning(this.$t(`luma.message.uploadReferencesExceed`))},onError(){S.error(this.$t(`luma.message.uploadReferencesError`))},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),Ge={class:`relative`},Ke={class:`flex justify-between`},qe={class:`flex justify-start items-center`},Je={class:`text-sm font-bold`};function Ye(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,Ge,[e(`div`,Ke,[e(`div`,qe,[e(`span`,Je,i(t.$t(`luma.name.startImageUrl`)),1),a(g,{content:t.$t(`luma.description.startImageUrl`)},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:5,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.percentage==null?o(``,!0):(h(),f(_,{key:0,url:e.url||e.response.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},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(`luma.button.uploadStartImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Xe=L(We,[[`render`,Ye],[`__scopeId`,`data-v-31c07a19`]]),Ze=_({name:`UploadVideo`,components:{UploadIcon:P,ElUpload:v,ElButton:R,InfoIcon:k,FilePreview:X},mixins:[V,z],data(){return{fileList:[],uploadUrl:W()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.luma?.config?.video_url},set(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_url:e})}}},mounted(){this.value||=void 0},methods:{onExceed(){S.warning(this.$t(`luma.message.uploadVideoExceed`))},onError(){S.error(this.$t(`luma.message.uploadVideoError`))},beforeUpload(e){let t=e.type===`video/mp4`,n=e.size/1024/1024<10;return t?n?!0:(S.error(this.$t(`luma.message.uploadVideoSizeExceed`)),!1):(S.error(this.$t(`luma.message.uploadVideoTypeFailed`)),!1)},onSetVideoUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_url:e,action:`extend`})},async onSuccess(){this.onSetVideoUrl()}}}),Qe={class:`relative`},$e={class:`flex justify-between`},et={class:`flex justify-start items-center`},tt={class:`text-sm font-bold`};function nt(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,Qe,[e(`div`,$e,[e(`div`,et,[e(`span`,tt,i(t.$t(`luma.name.videoUrl`)),1),a(g,{content:t.$t(`luma.description.videoUrl`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4`,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==null?o(``,!0):(h(),f(_,{key:0,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},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(`luma.button.uploadVideoUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var rt=L(Ze,[[`render`,nt],[`__scopeId`,`data-v-2189fc52`]]),it=_({name:`PromptInput`,components:{PromptTextarea:E},computed:{prompt:{get(){return this.$store.state.luma?.config?.prompt},set(e){this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,prompt:e})}}},mounted(){this.prompt||=``}});function at(e,t,n,r,i,a){let o=l(`prompt-textarea`);return h(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`luma.name.prompt`),info:e.$t(`luma.description.prompt`),placeholder:e.$t(`luma.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var ot=L(it,[[`render`,at]]),st=_({name:`ExtendFromInput`,components:{VideoPlayer:Q},props:{modelValue:{type:Object,required:!1,default:void 0}},data(){return{options:{quality:{default:`1080p`}}}},computed:{config(){return this.$store.state.luma?.config}}}),ct={class:`relative`},lt={class:`flex mb-2`},ut={class:`text-sm font-bold`};function dt(t,n,r,a,c,u){let d=l(`video-player`);return h(),s(`div`,ct,[e(`div`,lt,[e(`span`,ut,i(t.$t(`luma.name.extend`)),1)]),e(`div`,null,[t.config?.video_url?(h(),f(d,{key:0,src:t.config?.video_url},null,8,[`src`])):o(``,!0)])])}var ft=_({name:`ConfigPanel`,components:{MagicIcon:F,LoopSelector:Ie,StartImageInput:Xe,EndImageInput:Ue,EnhancementSelector:be,ElButton:R,PromptInput:ot,ExtendFromInput:L(st,[[`render`,dt]]),CustomSelector:Oe,UploadVideo:rt,Consumption:ie},emits:[`generate`],computed:{config(){return this.$store.state.luma?.config},consumption(){return K(this.config,this.service?.cost)},service(){return this.$store.state.luma?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),pt={class:`flex flex-col h-full`},mt={class:`flex-1 overflow-y-auto p-5`},ht={class:`flex flex-col items-center justify-center px-5 pb-5`};function gt(t,n,c,u,d,m){let g=l(`extend-from-input`),_=l(`prompt-input`),v=l(`custom-selector`),y=l(`upload-video`),b=l(`start-image-input`),x=l(`end-image-input`),S=l(`enhancement-selector`),C=l(`loop-selector`),w=l(`consumption`),T=l(`magic-icon`),E=l(`el-button`);return h(),s(`div`,pt,[e(`div`,mt,[t.config?.video_id||t.config?.video_url?(h(),f(g,{key:0,class:`mb-4`})):o(``,!0),a(_,{class:`mb-4`}),t.config?.video_id?o(``,!0):(h(),f(v,{key:1,class:`mb-4`})),t.config?.custom?(h(),f(y,{key:2,class:`mb-4`})):o(``,!0),!(t.config?.video_id||t.config?.video_url)&&!t.config?.custom?(h(),f(b,{key:3,class:`mb-4`})):o(``,!0),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`})]),e(`div`,ht,[a(w,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),t.config?.video_url!==void 0||t.config?.custom?(h(),f(E,{key:0,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.extend`)),1)]),_:1},8,[`onClick`])):(h(),f(E,{key:1,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.generate`)),1)]),_:1},8,[`onClick`]))])])}var _t=L(ft,[[`render`,gt]]),vt=_({name:`TaskPreview`,components:{DeleteIcon:N,ChannelIcon:D,InfoIcon:M,MagicIcon:F,TimeIcon:T,WarningIcon:ee,CopyToClipboard:J,ElAlert:b,VideoPlayer:Q,ElTooltip:y,ElButton:R,ApiCodeButton:ae,ReportButton:Y},props:{modelValue:{type:Object,required:!0}},emits:[`extend`],data(){return{}},computed:{application(){return this.$store.state.luma?.application},config(){return this.$store.state.luma?.config}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await B.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(`luma/deleteTask`,{id:e}),S.success(this.$t(`common.message.deleteTaskSuccess`))}catch{S.error(this.$t(`common.message.deleteTaskFailed`))}}},onExtend(e,t){console.debug(`set config`,t),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_id:t.video_id,prompt:t.prompt,action:`extend`,thumbnail_url:t.thumbnail_url,video_url:t.video_url}),this.$emit(`extend`)},onDownload(e){window.open(e,`_blank`)}}}),yt={class:`preview`},bt={class:`left`},xt={class:`main`},St={class:`bot`},Ct={class:`datetime`},wt=[`aria-label`],Tt={class:`info`},Et={key:0,class:`prompt mt-2`},Dt={key:0},Ot={key:1},kt={key:0,class:n({content:!0,failed:!0})},At={key:0,class:`mb-4`},jt={key:1,class:n({operations:!0,"mt-2":!0,"mb-4":!0})},Mt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Nt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},$={key:1,class:n({content:!0})},Pt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ft={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},It={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Lt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Rt={key:2,class:n({content:!0})},zt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Bt(n,c,u,d,f,m){let g=l(`capability-presentation`),_=l(`delete-icon`),v=l(`el-tooltip`),y=l(`video-player`),b=l(`el-button`),x=l(`api-code-button`),S=l(`report-button`),C=l(`magic-icon`),w=l(`copy-to-clipboard`),T=l(`time-icon`),E=l(`el-alert`),D=l(`warning-icon`),O=l(`info-icon`),k=l(`channel-icon`);return h(),s(`div`,yt,[e(`div`,bt,[a(g,{capability:`luma`,part:`avatar`,class:`avatar`})]),e(`div`,xt,[e(`div`,St,[a(g,{capability:`luma`,part:`name`}),e(`span`,Ct,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(v,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(h(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:c[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(_,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,wt)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Tt,[n.modelValue?.request?.prompt?(h(),s(`p`,Et,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,Dt,` - (`+i(n.$t(`luma.status.pending`))+`) `,1)),n.modelValue?.response?.state===`processing`||n.modelValue?.response?.state===`pending`?(h(),s(`span`,Ot,` - (`+i(n.$t(`luma.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),n.modelValue?.response?.success===!0?(h(),s(`div`,kt,[n.modelValue.response.video_url?(h(),s(`div`,At,[a(y,{src:n.modelValue.response.video_url},null,8,[`src`])])):o(``,!0),n.modelValue?.response&&!n.config?.custom?(h(),s(`div`,jt,[a(v,{class:`box-item`,effect:`dark`,content:n.$t(`luma.message.extendVideo`),placement:`top-start`},{default:p(()=>[a(b,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=t(e=>n.onExtend(e,n.modelValue?.response),[`stop`])},{default:p(()=>[r(i(n.$t(`luma.button.extend`)),1)]),_:1})]),_:1},8,[`content`]),a(v,{class:`box-item`,effect:`dark`,content:n.$t(`luma.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(b,{type:`info`,size:`small`,class:`btn-action`,onClick:c[2]||=t(e=>n.onDownload(n.modelValue?.response?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`luma.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(x,{path:`/luma/videos`,body:n.modelValue?.request},null,8,[`body`]),a(S,{service:`luma`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(E,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,Mt,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,Nt,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.modelValue?.response?.state===`failed`||n.modelValue?.response?.success===!1?(h(),s(`div`,$,[a(E,{closable:!1,class:`failure`},{template:p(()=>[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.failure`)),1)]),default:p(()=>[e(`p`,Pt,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,Ft,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(w,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,It,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),e(`p`,Lt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.traceId`))+`: `+i(n.modelValue?.trace_id)+` `,1),a(w,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])]),_:1})])):o(``,!0),!n.modelValue?.response||n.modelValue?.response?.state===`processing`||n.modelValue?.response?.state===`pending`?(h(),s(`div`,Rt,[a(E,{closable:!1,class:`info`},{template:p(()=>[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(n.modelValue?.response?`luma.status.processing`:`luma.status.pending`)),1)]),default:p(()=>[e(`p`,zt,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})])):o(``,!0)])])}var Vt=_({name:`RecentPanel`,components:{BotPlaceholder:oe,TaskPreview:L(vt,[[`render`,Bt],[`__scopeId`,`data-v-46a32bda`]]),NoTasks:A,ScrollList:O},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`,`extend`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.luma?.tasks,items:this.$store.state.luma?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Ht={key:0},Ut={key:2,class:`w-full h-full flex items-center justify-center`};function Wt(e,t,n,r,i,u){let d=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return h(),s(c,null,[e.tasks?.items===void 0?(h(),s(`div`,Ht,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),f(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[1]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(h(!0),s(c,null,m(e.tasks?.items,n=>(h(),f(g,{key:n.id,"model-value":n,onExtend:t[0]||=t=>e.$emit(`extend`)},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(h(),s(`div`,Ut,[a(v)])):o(``,!0)],64)}var Gt=_({name:`LumaIndex`,components:{ConfigPanel:_t,Layout:fe,RecentPanel:L(Vt,[[`render`,Wt]])},mixins:[I],inject:[`initialized`],emits:[`extend`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.luma?.status?.getApplications===x.Request},tasksLoading(){return this.$store.state.luma?.status?.getTasks===x.Request||this.fetchingTasks},credential(){return this.$store.state.luma.credential},config(){return this.$store.state.luma.config},application(){return this.$store.state.luma.application},tasks(){return this.$store.state.luma.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await j({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(){console.debug(`start onGetService`),await this.$store.dispatch(`luma/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`luma/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){console.debug(`scrolling down`),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(`luma/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!te(this.uploadTracker,e=>this.$t(e),e=>S.warning(e)))return;let e={...this.config,async:!0};if(!this.hasText(e.prompt)){S.error(this.$t(`luma.message.promptRequired`));return}if(e.prompt=e.prompt?.trim(),!H())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}S.info(this.$t(`luma.message.startingTask`)),U(`luma`,ne.generate(e,{token:t})).then(()=>{S.success(this.$t(`luma.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?S.error(this.$t(`luma.message.usedUp`)):S.error(this.$t(`luma.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},hasText(e){return typeof e==`string`&&e.trim().length>0}}});function Kt(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return h(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop,onExtend:t[0]||=t=>e.$emit(`extend`)},null,8,[`loading`,`onReachTop`])]),_:1})}var qt=L(Gt,[[`render`,Kt]]);export{qt as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{t as v}from"./upload-Cjls2phY.js";import{t as y}from"./tooltip-DUcNmmP-.js";import{t as b}from"./alert-BprQRUmf.js";import{h as x,v as S}from"./models-yTQ4rqqP.js";import{t as C}from"./drawer-BYrWn-wi.js";import{t as w}from"./switch-C4Vaponc.js";import{t as T}from"./clock-CCljPowN.js";import{a as E,c as D,n as O,o as k,r as A,t as j}from"./pagination-CtkSWjVi.js";import{t as M}from"./info-B8n3U43j.js";import{t as N}from"./trash-2-DLKDfmcv.js";import{t as ee}from"./triangle-alert-BWV9pT6w.js";import{t as P}from"./upload-BZ-Gklsa.js";import{t as F}from"./wand-sparkles-zeg14-Rq.js";import"./constants-CzYWUlOY.js";import{$t as I,O as L,Pi as R,Qt as z,Zt as te,ar as ne,bi as B,en as V,fn as H,jr as U,oi as W,qt as G,rn as K,tn as q}from"./index-DSAgKNWm.js";import{t as J}from"./CopyToClipboard-CP5bh5uq.js";import{t as Y}from"./ReportButton-Donr-AWk.js";import{t as X}from"./FilePreview-BaSJGB_a.js";import{t as Z}from"./ImagePreview-fQJvI010.js";import{n as re}from"./taskDrawerMixin-DyAUhFEq.js";import{t as ie}from"./Consumption-DGykzGxC.js";import{t as Q}from"./VideoPlayer-BNRh6h0n.js";import{t as ae}from"./ApiCodeButton-BoYfR8v5.js";import{t as oe}from"./BotPlaceholder-C42Ymqvl.js";var se=_({name:`LayoutLuma`,components:{MagicIcon:F,ElDrawer:C,ElButton:R},mixins:[re]}),ce={class:`main flex flex-row flex-1`},le={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)]`},ue={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function de(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,ce,[e(`div`,le,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,ue,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[g,!t.tasksEmpty]]),a(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var fe=L(se,[[`render`,de],[`__scopeId`,`data-v-d13d43a9`]]),pe=_({name:`EnhancementSelector`,components:{ElSwitch:w,InfoIcon:k},computed:{value:{get(){return this.$store.state.luma?.config?.enhancement},set(e){console.debug(`set enhancement`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,enhancement:e})}}},mounted(){this.value===void 0&&(this.value=!0)}}),me={class:`relative`},he={class:`flex justify-between`},ge={class:`flex justify-start items-center`},_e={class:`text-sm font-bold`},ve={class:`flex justify-end items-center`};function ye(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,me,[e(`div`,he,[e(`div`,ge,[e(`span`,_e,i(t.$t(`luma.name.enhancement`)),1),a(d,{content:t.$t(`luma.description.enhancement`)},null,8,[`content`])]),e(`div`,ve,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var be=L(pe,[[`render`,ye]]),xe=_({name:`CustomSelector`,components:{ElSwitch:w,InfoIcon:k},computed:{value:{get(){return this.$store.state.luma?.config?.custom},set(e){console.debug(`set custom`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,custom:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),Se={class:`relative`},Ce={class:`flex justify-between`},we={class:`flex justify-start items-center`},Te={class:`text-sm font-bold`},Ee={class:`flex justify-end items-center`};function De(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,Se,[e(`div`,Ce,[e(`div`,we,[e(`span`,Te,i(t.$t(`luma.name.custom`)),1),a(d,{content:t.$t(`luma.description.custom`)},null,8,[`content`])]),e(`div`,Ee,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var Oe=L(xe,[[`render`,De]]),ke=_({name:`LoopSelector`,components:{ElSwitch:w,InfoIcon:k},computed:{value:{get(){return this.$store.state.luma?.config?.loop},set(e){console.debug(`set loop`,e),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,loop:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),Ae={class:`relative`},je={class:`flex justify-between`},Me={class:`flex justify-start items-center`},Ne={class:`text-sm font-bold`},Pe={class:`flex justify-end items-center`};function Fe(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return h(),s(`div`,Ae,[e(`div`,je,[e(`div`,Me,[e(`span`,Ne,i(t.$t(`luma.name.loop`)),1),a(d,{content:t.$t(`luma.description.loop`)},null,8,[`content`])]),e(`div`,Pe,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var Ie=L(ke,[[`render`,Fe]]),Le=_({name:`EndImage`,components:{UploadIcon:P,ElUpload:v,ElButton:R,ImagePreview:Z,InfoIcon:k},mixins:[q,V,z,G],data(){return{fileList:[],uploadUrl:W()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.luma?.config?.start_image_url},set(){}}},mounted(){this.value||=void 0,this.onSetEndImageUrl()},methods:{onExceed(){S.warning(this.$t(`luma.message.uploadReferencesExceed`))},onError(){S.error(this.$t(`luma.message.uploadReferencesError`))},onSetEndImageUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,end_image_url:e})},async onSuccess(){this.onSetEndImageUrl()}}}),Re={class:`relative`},ze={class:`flex justify-between`},Be={class:`flex justify-start items-center`},Ve={class:`text-sm font-bold`};function He(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,Re,[e(`div`,ze,[e(`div`,Be,[e(`span`,Ve,i(t.$t(`luma.name.endImageUrl`)),1),a(g,{content:t.$t(`luma.description.endImageUrl`)},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:5,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?(h(),f(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):o(``,!0)]),default:p(()=>[a(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(`luma.button.uploadEndImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Ue=L(Le,[[`render`,He],[`__scopeId`,`data-v-04c461bb`]]),We=_({name:`StartImage`,components:{UploadIcon:P,ElUpload:v,ElButton:R,ImagePreview:Z,InfoIcon:k},mixins:[q,V,z,G],data(){return{fileList:[],uploadUrl:W()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.luma?.config?.start_image_url},set(){}}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){S.warning(this.$t(`luma.message.uploadReferencesExceed`))},onError(){S.error(this.$t(`luma.message.uploadReferencesError`))},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,start_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),Ge={class:`relative`},Ke={class:`flex justify-between`},qe={class:`flex justify-start items-center`},Je={class:`text-sm font-bold`};function Ye(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,Ge,[e(`div`,Ke,[e(`div`,qe,[e(`span`,Je,i(t.$t(`luma.name.startImageUrl`)),1),a(g,{content:t.$t(`luma.description.startImageUrl`)},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:5,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.percentage==null?o(``,!0):(h(),f(_,{key:0,url:e.url||e.response.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},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(`luma.button.uploadStartImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Xe=L(We,[[`render`,Ye],[`__scopeId`,`data-v-31c07a19`]]),Ze=_({name:`UploadVideo`,components:{UploadIcon:P,ElUpload:v,ElButton:R,InfoIcon:k,FilePreview:X},mixins:[V,z],data(){return{fileList:[],uploadUrl:W()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state.luma?.config?.video_url},set(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_url:e})}}},mounted(){this.value||=void 0},methods:{onExceed(){S.warning(this.$t(`luma.message.uploadVideoExceed`))},onError(){S.error(this.$t(`luma.message.uploadVideoError`))},beforeUpload(e){let t=e.type===`video/mp4`,n=e.size/1024/1024<10;return t?n?!0:(S.error(this.$t(`luma.message.uploadVideoSizeExceed`)),!1):(S.error(this.$t(`luma.message.uploadVideoTypeFailed`)),!1)},onSetVideoUrl(){let e=this.urls?.[0];this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_url:e,action:`extend`})},async onSuccess(){this.onSetVideoUrl()}}}),Qe={class:`relative`},$e={class:`flex justify-between`},et={class:`flex justify-start items-center`},tt={class:`text-sm font-bold`};function nt(t,n,c,u,d,m){let g=l(`info-icon`),_=l(`file-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return h(),s(`div`,Qe,[e(`div`,$e,[e(`div`,et,[e(`span`,tt,i(t.$t(`luma.name.videoUrl`)),1),a(g,{content:t.$t(`luma.description.videoUrl`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4`,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==null?o(``,!0):(h(),f(_,{key:0,url:e.url||e.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},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(`luma.button.uploadVideoUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var rt=L(Ze,[[`render`,nt],[`__scopeId`,`data-v-2189fc52`]]),it=_({name:`PromptInput`,components:{PromptTextarea:E},computed:{prompt:{get(){return this.$store.state.luma?.config?.prompt},set(e){this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,prompt:e})}}},mounted(){this.prompt||=``}});function at(e,t,n,r,i,a){let o=l(`prompt-textarea`);return h(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`luma.name.prompt`),info:e.$t(`luma.description.prompt`),placeholder:e.$t(`luma.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var ot=L(it,[[`render`,at]]),st=_({name:`ExtendFromInput`,components:{VideoPlayer:Q},props:{modelValue:{type:Object,required:!1,default:void 0}},data(){return{options:{quality:{default:`1080p`}}}},computed:{config(){return this.$store.state.luma?.config}}}),ct={class:`relative`},lt={class:`flex mb-2`},ut={class:`text-sm font-bold`};function dt(t,n,r,a,c,u){let d=l(`video-player`);return h(),s(`div`,ct,[e(`div`,lt,[e(`span`,ut,i(t.$t(`luma.name.extend`)),1)]),e(`div`,null,[t.config?.video_url?(h(),f(d,{key:0,src:t.config?.video_url},null,8,[`src`])):o(``,!0)])])}var ft=_({name:`ConfigPanel`,components:{MagicIcon:F,LoopSelector:Ie,StartImageInput:Xe,EndImageInput:Ue,EnhancementSelector:be,ElButton:R,PromptInput:ot,ExtendFromInput:L(st,[[`render`,dt]]),CustomSelector:Oe,UploadVideo:rt,Consumption:ie},emits:[`generate`],computed:{config(){return this.$store.state.luma?.config},consumption(){return K(this.config,this.service?.cost)},service(){return this.$store.state.luma?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),pt={class:`flex flex-col h-full`},mt={class:`flex-1 overflow-y-auto p-5`},ht={class:`flex flex-col items-center justify-center px-5 pb-5`};function gt(t,n,c,u,d,m){let g=l(`extend-from-input`),_=l(`prompt-input`),v=l(`custom-selector`),y=l(`upload-video`),b=l(`start-image-input`),x=l(`end-image-input`),S=l(`enhancement-selector`),C=l(`loop-selector`),w=l(`consumption`),T=l(`magic-icon`),E=l(`el-button`);return h(),s(`div`,pt,[e(`div`,mt,[t.config?.video_id||t.config?.video_url?(h(),f(g,{key:0,class:`mb-4`})):o(``,!0),a(_,{class:`mb-4`}),t.config?.video_id?o(``,!0):(h(),f(v,{key:1,class:`mb-4`})),t.config?.custom?(h(),f(y,{key:2,class:`mb-4`})):o(``,!0),!(t.config?.video_id||t.config?.video_url)&&!t.config?.custom?(h(),f(b,{key:3,class:`mb-4`})):o(``,!0),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`})]),e(`div`,ht,[a(w,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),t.config?.video_url!==void 0||t.config?.custom?(h(),f(E,{key:0,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.extend`)),1)]),_:1},8,[`onClick`])):(h(),f(E,{key:1,type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(T,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`luma.button.generate`)),1)]),_:1},8,[`onClick`]))])])}var _t=L(ft,[[`render`,gt]]),vt=_({name:`TaskPreview`,components:{DeleteIcon:N,ChannelIcon:D,InfoIcon:M,MagicIcon:F,TimeIcon:T,WarningIcon:ee,CopyToClipboard:J,ElAlert:b,VideoPlayer:Q,ElTooltip:y,ElButton:R,ApiCodeButton:ae,ReportButton:Y},props:{modelValue:{type:Object,required:!0}},emits:[`extend`],data(){return{}},computed:{application(){return this.$store.state.luma?.application},config(){return this.$store.state.luma?.config}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await B.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(`luma/deleteTask`,{id:e}),S.success(this.$t(`common.message.deleteTaskSuccess`))}catch{S.error(this.$t(`common.message.deleteTaskFailed`))}}},onExtend(e,t){console.debug(`set config`,t),this.$store.commit(`luma/setConfig`,{...this.$store.state.luma?.config,video_id:t.video_id,prompt:t.prompt,action:`extend`,thumbnail_url:t.thumbnail_url,video_url:t.video_url}),this.$emit(`extend`)},onDownload(e){window.open(e,`_blank`)}}}),yt={class:`preview`},bt={class:`left`},xt={class:`main`},St={class:`bot`},Ct={class:`datetime`},wt=[`aria-label`],Tt={class:`info`},Et={key:0,class:`prompt mt-2`},Dt={key:0},Ot={key:1},kt={key:0,class:n({content:!0,failed:!0})},At={key:0,class:`mb-4`},jt={key:1,class:n({operations:!0,"mt-2":!0,"mb-4":!0})},Mt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Nt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},$={key:1,class:n({content:!0})},Pt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ft={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},It={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Lt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Rt={key:2,class:n({content:!0})},zt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Bt(n,c,u,d,f,m){let g=l(`capability-presentation`),_=l(`delete-icon`),v=l(`el-tooltip`),y=l(`video-player`),b=l(`el-button`),x=l(`api-code-button`),S=l(`report-button`),C=l(`magic-icon`),w=l(`copy-to-clipboard`),T=l(`time-icon`),E=l(`el-alert`),D=l(`warning-icon`),O=l(`info-icon`),k=l(`channel-icon`);return h(),s(`div`,yt,[e(`div`,bt,[a(g,{capability:`luma`,part:`avatar`,class:`avatar`})]),e(`div`,xt,[e(`div`,St,[a(g,{capability:`luma`,part:`name`}),e(`span`,Ct,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(v,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(h(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:c[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(_,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,wt)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Tt,[n.modelValue?.request?.prompt?(h(),s(`p`,Et,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,Dt,` - (`+i(n.$t(`luma.status.pending`))+`) `,1)),n.modelValue?.response?.state===`processing`||n.modelValue?.response?.state===`pending`?(h(),s(`span`,Ot,` - (`+i(n.$t(`luma.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),n.modelValue?.response?.success===!0?(h(),s(`div`,kt,[n.modelValue.response.video_url?(h(),s(`div`,At,[a(y,{src:n.modelValue.response.video_url},null,8,[`src`])])):o(``,!0),n.modelValue?.response&&!n.config?.custom?(h(),s(`div`,jt,[a(v,{class:`box-item`,effect:`dark`,content:n.$t(`luma.message.extendVideo`),placement:`top-start`},{default:p(()=>[a(b,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=t(e=>n.onExtend(e,n.modelValue?.response),[`stop`])},{default:p(()=>[r(i(n.$t(`luma.button.extend`)),1)]),_:1})]),_:1},8,[`content`]),a(v,{class:`box-item`,effect:`dark`,content:n.$t(`luma.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(b,{type:`info`,size:`small`,class:`btn-action`,onClick:c[2]||=t(e=>n.onDownload(n.modelValue?.response?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`luma.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(x,{path:`/luma/videos`,body:n.modelValue?.request},null,8,[`body`]),a(S,{service:`luma`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(E,{closable:!1,class:`mt-2 success`},{default:p(()=>[e(`p`,Mt,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,Nt,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.modelValue?.response?.state===`failed`||n.modelValue?.response?.success===!1?(h(),s(`div`,$,[a(E,{closable:!1,class:`failure`},{template:p(()=>[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.failure`)),1)]),default:p(()=>[e(`p`,Pt,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,Ft,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(w,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,It,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),e(`p`,Lt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.traceId`))+`: `+i(n.modelValue?.trace_id)+` `,1),a(w,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])]),_:1})])):o(``,!0),!n.modelValue?.response||n.modelValue?.response?.state===`processing`||n.modelValue?.response?.state===`pending`?(h(),s(`div`,Rt,[a(E,{closable:!1,class:`info`},{template:p(()=>[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(n.modelValue?.response?`luma.status.processing`:`luma.status.pending`)),1)]),default:p(()=>[e(`p`,zt,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`luma.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})])):o(``,!0)])])}var Vt=_({name:`RecentPanel`,components:{BotPlaceholder:oe,TaskPreview:L(vt,[[`render`,Bt],[`__scopeId`,`data-v-46a32bda`]]),NoTasks:A,ScrollList:O},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`,`extend`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.luma?.tasks,items:this.$store.state.luma?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Ht={key:0},Ut={key:2,class:`w-full h-full flex items-center justify-center`};function Wt(e,t,n,r,i,u){let d=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return h(),s(c,null,[e.tasks?.items===void 0?(h(),s(`div`,Ht,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),f(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[1]||=t=>e.$emit(`reach-top`)},{default:p(()=>[(h(!0),s(c,null,m(e.tasks?.items,n=>(h(),f(g,{key:n.id,"model-value":n,onExtend:t[0]||=t=>e.$emit(`extend`)},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(h(),s(`div`,Ut,[a(v)])):o(``,!0)],64)}var Gt=_({name:`LumaIndex`,components:{ConfigPanel:_t,Layout:fe,RecentPanel:L(Vt,[[`render`,Wt]])},mixins:[I],inject:[`initialized`],emits:[`extend`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.luma?.status?.getApplications===x.Request},tasksLoading(){return this.$store.state.luma?.status?.getTasks===x.Request||this.fetchingTasks},credential(){return this.$store.state.luma.credential},config(){return this.$store.state.luma.config},application(){return this.$store.state.luma.application},tasks(){return this.$store.state.luma.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await j({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(){console.debug(`start onGetService`),await this.$store.dispatch(`luma/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`luma/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){console.debug(`scrolling down`),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(`luma/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!te(this.uploadTracker,e=>this.$t(e),e=>S.warning(e)))return;let e={...this.config,async:!0};if(!this.hasText(e.prompt)){S.error(this.$t(`luma.message.promptRequired`));return}if(e.prompt=e.prompt?.trim(),!H())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}S.info(this.$t(`luma.message.startingTask`)),U(`luma`,ne.generate(e,{token:t})).then(()=>{S.success(this.$t(`luma.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?S.error(this.$t(`luma.message.usedUp`)):S.error(this.$t(`luma.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},hasText(e){return typeof e==`string`&&e.trim().length>0}}});function Kt(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return h(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop,onExtend:t[0]||=t=>e.$emit(`extend`)},null,8,[`loading`,`onReachTop`])]),_:1})}var qt=L(Gt,[[`render`,Kt]]);export{qt as default};
|