@acedatacloud/nexior 3.356.12 → 3.356.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ApiCodeButton-CZz0vt_z.js → ApiCodeButton-BG3uOft7.js} +1 -1
- package/dist/assets/{Artifacts-Bim733qJ.js → Artifacts-CPV9CagV.js} +1 -1
- package/dist/assets/{AskUserQuestionCard-BNwLafRi.js → AskUserQuestionCard-CKoVWONV.js} +1 -1
- package/dist/assets/{Auth-CJYKOEDj.js → Auth-CV4FBP0o.js} +1 -1
- package/dist/assets/{Bare-Dc8h0VKW.js → Bare-CZb9pPfn.js} +1 -1
- package/dist/assets/{BotPlaceholder-BxYtoblR.js → BotPlaceholder-CXmOKAnD.js} +1 -1
- package/dist/assets/{BottomFooter-Bz6HsMWn.js → BottomFooter-BryvPO4R.js} +1 -1
- package/dist/assets/{BrowserPairingDialog-_B8Ws28o.js → BrowserPairingDialog-BmVPe-2c.js} +1 -1
- package/dist/assets/{Callback-DWHgUSVK.js → Callback-pis0GeEe.js} +1 -1
- package/dist/assets/{CodeSnippet-ZSEN_fjJ.js → CodeSnippet-RuYvbcNi.js} +1 -1
- package/dist/assets/{Console-DMqXrcSd.js → Console-8LSIGXy4.js} +1 -1
- package/dist/assets/{Consumption-DkBnCq4g.js → Consumption-DiSEqNK8.js} +1 -1
- package/dist/assets/{Conversation-Cjx8rDMb.js → Conversation-Dw6U8tbI.js} +1 -1
- package/dist/assets/{Conversation-kCKHwe1K.js → Conversation-UtPacMnm.js} +1 -1
- package/dist/assets/{CopyToClipboard-BPulu_aW.js → CopyToClipboard-D1PN1vgU.js} +1 -1
- package/dist/assets/{Detail-C_A4EUXi.js → Detail-D0qYh2hQ.js} +2 -2
- package/dist/assets/{Extra-C8DEqJfJ.js → Extra-D400bY0a.js} +1 -1
- package/dist/assets/{FilePreview-DY61u1F0.js → FilePreview-tLIDSh2u.js} +1 -1
- package/dist/assets/{Hailuo-BOCB7Ynu.js → Hailuo-BoOwIPFr.js} +1 -1
- package/dist/assets/{History-BFtl--tb.js → History-ByRTCDVX.js} +1 -1
- package/dist/assets/{ImagePreview-BQgq7g8c.js → ImagePreview-CN8OBvU4.js} +1 -1
- package/dist/assets/{ImageWrapper-COowNSPF.js → ImageWrapper-C3WAO4WL.js} +1 -1
- package/dist/assets/{Index--uZaX9H5.js → Index-B3VMqnwj.js} +1 -1
- package/dist/assets/{Index-BxTSY7RU.js → Index-B9EzOHkk.js} +1 -1
- package/dist/assets/{Index-LqeqRgNl.js → Index-BNjCsOVJ.js} +1 -1
- package/dist/assets/{Index-n23S5oaw2.js → Index-BUa7JHRK2.js} +1 -1
- package/dist/assets/{Index-7HB6Y1ZE2.js → Index-BWoENnrp2.js} +1 -1
- package/dist/assets/{Index-Ci1rq22n2.js → Index-BkON1ENg2.js} +1 -1
- package/dist/assets/{Index-B_60Vun3.js → Index-BlSXdk7C.js} +1 -1
- package/dist/assets/{Index-BI2ME7K6.js → Index-CBw5rFDD.js} +1 -1
- package/dist/assets/{Index-BcGdQw-J.js → Index-CG1H1lxh.js} +1 -1
- package/dist/assets/{Index-DRYfFB-i.js → Index-CGgiUKTv.js} +1 -1
- package/dist/assets/{Index-DW58LzHk.js → Index-CN_ot8Xw.js} +1 -1
- package/dist/assets/{Index-D5WT7a40.js → Index-CbbR6v73.js} +1 -1
- package/dist/assets/{Index-_QFRZMzv.js → Index-Ci8e-H1m.js} +1 -1
- package/dist/assets/{Index-BhFTdTgP.js → Index-Co7amws1.js} +1 -1
- package/dist/assets/{Index-yXe8CWfW2.js → Index-Cxj0UFHP2.js} +1 -1
- package/dist/assets/{Index-CyFQVcI_.js → Index-CyVD9tWl.js} +1 -1
- package/dist/assets/{Index-C2QTRSzF.js → Index-CzNm1XXi.js} +1 -1
- package/dist/assets/{Index-B4RCAOCa.js → Index-D1CLzJ50.js} +1 -1
- package/dist/assets/{Index-Cm6xT4-I.js → Index-D6DuslVp.js} +1 -1
- package/dist/assets/{Index-Dudoj257.js → Index-DE4eQtJi.js} +1 -1
- package/dist/assets/{Index-CYRiGopy.js → Index-DLu-lbtD.js} +1 -1
- package/dist/assets/{Index-CwkPcOae.js → Index-DRe7C-2X.js} +1 -1
- package/dist/assets/{Index-I0cEQa0E2.js → Index-DXC_DoKm2.js} +1 -1
- package/dist/assets/{Index-BWW_z9xw.js → Index-DkmWDmj1.js} +1 -1
- package/dist/assets/{Index-C_uYqnk_.js → Index-DohINA4_.js} +1 -1
- package/dist/assets/{Index-C8Cn8pwH.js → Index-DqTc0EO5.js} +1 -1
- package/dist/assets/{Index-C_4MMpp1.js → Index-Dyxr3ovG.js} +1 -1
- package/dist/assets/{Index-Bg1XVoM7.js → Index-KcPzQgXd.js} +1 -1
- package/dist/assets/{Index-3P8jsBZN.js → Index-NR-TXNhu.js} +1 -1
- package/dist/assets/{Index-Bn7s82kp.js → Index-QriE6rA6.js} +1 -1
- package/dist/assets/{Index-EusoSxN1.js → Index-X_aeyxlV.js} +1 -1
- package/dist/assets/{Index-XnMGK4G7.js → Index-kAFXP4SR.js} +1 -1
- package/dist/assets/{Index-ClWNccAt.js → Index-o6aKFfcj.js} +1 -1
- package/dist/assets/{Index-CpLrz2i8.js → Index-sPcBvdwE.js} +1 -1
- package/dist/assets/{Invitees-C8b_syTE.js → Invitees-CneKtJVo.js} +1 -1
- package/dist/assets/{List-BTqnb29X.js → List-D6vi6wYd.js} +1 -1
- package/dist/assets/{List-Bo7GRBrG.js → List-DAijs_ko.js} +1 -1
- package/dist/assets/{List-BIo9Fs0f.js → List-toyeHOp3.js} +1 -1
- package/dist/assets/{LocalTools-CYm9xemT.js → LocalTools-Bn7my_3W.js} +1 -1
- package/dist/assets/{LocalTools-DgOyujhO.js → LocalTools-DaGllIHE.js} +1 -1
- package/dist/assets/{Logo-C37PCBQE.js → Logo-ncmT-jcg.js} +1 -1
- package/dist/assets/{Main-BU_MPVJY.js → Main-B0uTAftV.js} +1 -1
- package/dist/assets/{Message-D8y2qURo.js → Message-DeQBwFUk.js} +1 -1
- package/dist/assets/{Model-DsURth5f.js → Model-BLLbBfD4.js} +1 -1
- package/dist/assets/{Navigator-B06GX-1d.js → Navigator-CSJ0YFuP.js} +3 -3
- package/dist/assets/{NotFound-DSQFuQBh.js → NotFound-BbJAItAr.js} +1 -1
- package/dist/assets/{PageHeader-VxeorQDr.js → PageHeader-CdLs-fU1.js} +1 -1
- package/dist/assets/{Pay-cgp0TkaC.js → Pay-Bvaz3NA2.js} +1 -1
- package/dist/assets/{Player-BuViZDa-.js → Player-CjlYz11h.js} +1 -1
- package/dist/assets/{Poivelle-BAse_SAm.js → Poivelle-Bygtcf3v.js} +1 -1
- package/dist/assets/{RealtimeCall-f2lhX2v_.js → RealtimeCall-BLGOJly0.js} +1 -1
- package/dist/assets/{ReportButton-yrAmNWvq.js → ReportButton-YWxvQv7T.js} +1 -1
- package/dist/assets/{ReportDialog-Cknuk3MH.js → ReportDialog-Di6DDJwG.js} +1 -1
- package/dist/assets/{ScheduledTasks-BXT7HzIq.js → ScheduledTasks-BjCxMV41.js} +1 -1
- package/dist/assets/{Status-dkogzRpT.js → Status-BM8T5G6r.js} +1 -1
- package/dist/assets/{Subscribe-BYUteF89.js → Subscribe-DOJfTMLv.js} +1 -1
- package/dist/assets/{TabSwitcher-BGFu9K7f.js → TabSwitcher-wX5AvBMi.js} +1 -1
- package/dist/assets/{Tts-Pxqiysvo.js → Tts-DWmfoBBL.js} +1 -1
- package/dist/assets/{VideoPlayer-C28FcwsP.js → VideoPlayer-Dqej3RIo.js} +1 -1
- package/dist/assets/{VideoPreview-BI0zUAGH.js → VideoPreview-Bhxldvlh.js} +1 -1
- package/dist/assets/arrow-down--gR3NaHz.js +1 -0
- package/dist/assets/{arrow-down-wide-narrow-CosS-EDL.js → arrow-down-wide-narrow-DgeRLxF6.js} +1 -1
- package/dist/assets/arrow-left-B39EagFY.js +1 -0
- package/dist/assets/arrow-right-40WAcToQ.js +1 -0
- package/dist/assets/arrow-up-Q1ntqZpz.js +1 -0
- package/dist/assets/{authorizeFlow-llvXyPYo.js → authorizeFlow-D3eNmeY0.js} +1 -1
- package/dist/assets/{avatar-CESGjgLU.js → avatar-C1Gr1iFR.js} +1 -1
- package/dist/assets/{basic-0MGLBNFj.js → basic-BjOB4_uV.js} +1 -1
- package/dist/assets/{book-open-MIVy1qm0.js → book-open-DYiFwFR1.js} +1 -1
- package/dist/assets/{box-B5csEhsR.js → box-C0dtnlPA.js} +1 -1
- package/dist/assets/{boxes-CmFwj-Xg.js → boxes-WbbO39Z7.js} +1 -1
- package/dist/assets/{brain-Ehdj_OJR.js → brain-fZab3hXA.js} +1 -1
- package/dist/assets/{chart-no-axes-combined-B37YosrK.js → chart-no-axes-combined-BLVOA658.js} +1 -1
- package/dist/assets/{chat-CDY_cthq.js → chat-BGhaQ0QG.js} +1 -1
- package/dist/assets/{chat-BK_UEshm.js → chat-BH-jxBKe.js} +1 -1
- package/dist/assets/{chat-DTEDnSMw.js → chat-BZWf5YLa.js} +1 -1
- package/dist/assets/{chat-CKErGpKS.js → chat-BbpZKnYr.js} +1 -1
- package/dist/assets/{chat-CxwMwBIN.js → chat-Bp6HFICC.js} +1 -1
- package/dist/assets/{chat-CEtfAGkL.js → chat-Bws7gLCX.js} +1 -1
- package/dist/assets/{chat-DVk89krC.js → chat-C0MJAX1q.js} +1 -1
- package/dist/assets/{chat-Do_Vv7Jd.js → chat-CH9xJhsR.js} +1 -1
- package/dist/assets/{chat-DmH_Pcna.js → chat-CNDrQoCb.js} +1 -1
- package/dist/assets/{chat-DLGg_n2Y.js → chat-CQdilMII.js} +1 -1
- package/dist/assets/{chat-uLgwWLuR.js → chat-C_OFQhQL.js} +1 -1
- package/dist/assets/{chat-C6154lWA.js → chat-CdKwsYWp.js} +1 -1
- package/dist/assets/{chat-uYa0Fr1s.js → chat-CtoCDBqf.js} +1 -1
- package/dist/assets/{chat-CNj8_cx1.js → chat-D2Jtvb_V.js} +1 -1
- package/dist/assets/{chat-D262td6g.js → chat-D7lz2-T1.js} +1 -1
- package/dist/assets/{chat-DkENTuiI.js → chat-DYce0_pQ.js} +1 -1
- package/dist/assets/{chat-EH5t4a52.js → chat-DeQRB9Da.js} +1 -1
- package/dist/assets/{chat-DnmDpIYw.js → chat-ephUdYIr.js} +1 -1
- package/dist/assets/{chat-DROQksn6.js → chat-ugfISKIr.js} +1 -1
- package/dist/assets/check-Vb1enwhA.js +1 -0
- package/dist/assets/chevron-down-BzsAsDSA.js +1 -0
- package/dist/assets/chevron-right-mC8jKx3p.js +1 -0
- package/dist/assets/circle-check-DaxMxK1P.js +1 -0
- package/dist/assets/{circle-question-mark-B-Q88hPg.js → circle-question-mark-DGOj7bbQ.js} +1 -1
- package/dist/assets/{clipboard-list-uFdZqPLk.js → clipboard-list-K5kUJRig.js} +1 -1
- package/dist/assets/clock-Varrr0Bl.js +1 -0
- package/dist/assets/code-BsfXj8Ll.js +1 -0
- package/dist/assets/{codingBridge-U1O6oJu0.js → codingBridge-Coed1aJm.js} +1 -1
- package/dist/assets/{codingBridgeNotify-BoI_05Du.js → codingBridgeNotify-CprVKydm.js} +2 -2
- package/dist/assets/{coins-DSjXCdTA.js → coins-B09dASJj.js} +1 -1
- package/dist/assets/{collapse-UIfEKlmn.js → collapse-BdbX-9vK.js} +1 -1
- package/dist/assets/{constants-DJHV7KrP.js → constants-D04Y0eol.js} +1 -1
- package/dist/assets/{copy-BwQpxgyE.js → copy-BWb_FWmO.js} +1 -1
- package/dist/assets/{createTaskActions-_3yegJa-.js → createTaskActions-A0OVVCwT.js} +1 -1
- package/dist/assets/{digitalhuman-BRti95_W.js → digitalhuman-DLHMifkO.js} +1 -1
- package/dist/assets/{dollar-sign-DhQv33YP.js → dollar-sign-rKY0qNJp.js} +1 -1
- package/dist/assets/{download-924Pao3S.js → download-2Qdwx8V1.js} +1 -1
- package/dist/assets/{drawer-Sbj1LwZx.js → drawer-CpQ_k9m7.js} +1 -1
- package/dist/assets/{dropdown-DwCQwZGk.js → dropdown-B4C-n1xR.js} +1 -1
- package/dist/assets/{dropdown-C1jhbmMJ.js → dropdown-E7h06hcM.js} +1 -1
- package/dist/assets/{ellipsis-D97uFxb5.js → ellipsis-BAbKdRzM.js} +1 -1
- package/dist/assets/{esm-BONZ3PH7.js → esm-8LNL4PtX.js} +3 -3
- package/dist/assets/{esm-DL_XoDZp.js → esm-BhQXoKvx.js} +1 -1
- package/dist/assets/esm-BzAEdgPN.js +1 -0
- package/dist/assets/{esm-T90mXUtg.js → esm-DhUI5IHK.js} +1 -1
- package/dist/assets/{esm-CwTFKHdQ.js → esm-DlIIS3Js.js} +2 -2
- package/dist/assets/{esm-Bvw7B_HC.js → esm-Dx6vr1T-.js} +2 -2
- package/dist/assets/{esm-BCpbp9tH.js → esm-hUh73nCP.js} +1 -1
- package/dist/assets/{external-link-BpLgbs1V.js → external-link-jGKw--J3.js} +1 -1
- package/dist/assets/{eye-BrKLyOlV.js → eye-BrnoVXWO.js} +1 -1
- package/dist/assets/{file-tXBY3-Jz.js → file-DOjVowKo.js} +1 -1
- package/dist/assets/{file-output-rAVorTpQ.js → file-output-CJCqrTiV.js} +1 -1
- package/dist/assets/{file-text-CoHSqVKg.js → file-text-Ba0Fr8hn.js} +1 -1
- package/dist/assets/{fish-YBMyBnpA.js → fish-6OAgbtFq.js} +1 -1
- package/dist/assets/{flux-upW7CCtc.js → flux-CKcmMOwb.js} +1 -1
- package/dist/assets/{folder-DdhIBHwd.js → folder-BnpdAdOx.js} +1 -1
- package/dist/assets/gauge-JH86QFGZ.js +1 -0
- package/dist/assets/{globe-QGCX4bYv.js → globe-C3D_adfw.js} +1 -1
- package/dist/assets/{grokvideo-ro108z3l.js → grokvideo-NDONdHMX.js} +1 -1
- package/dist/assets/{hailuo-PtUoBwgL.js → hailuo-5QMzApl8.js} +1 -1
- package/dist/assets/{headphones-BfVr1otq.js → headphones-CypIUoNv.js} +1 -1
- package/dist/assets/{history-CcI4jt87.js → history-Cl0xyiad.js} +1 -1
- package/dist/assets/{house-3Wnlv-fk.js → house-D0dcqwOf.js} +1 -1
- package/dist/assets/{i18n-zXW69bJG.js → i18n-wJzQfGyO.js} +1 -1
- package/dist/assets/{image-BVL-gSRO.js → image-FnjRJ4X3.js} +1 -1
- package/dist/assets/{index-BubtY8Qx.js → index-C_sjkBHo.js} +4 -4
- package/dist/assets/{index.browser.esm-CwEhkNDG.js → index.browser.esm-UdtCQBNM.js} +1 -1
- package/dist/assets/{index.es-DRw3_KrX.js → index.es-BG1Z8NLn.js} +1 -1
- package/dist/assets/{info-D9qSu1pE.js → info-BPaOsauW.js} +1 -1
- package/dist/assets/{input-number-BJxRDYCr.js → input-number-DZm2a-qc.js} +1 -1
- package/dist/assets/{key-round-1j5YdFxk.js → key-round-CRtlOPGd.js} +1 -1
- package/dist/assets/{kling-DTr0y8QL.js → kling-BaL7pFs9.js} +1 -1
- package/dist/assets/{languages-D0Y0UQTd.js → languages-CmmLg5T3.js} +1 -1
- package/dist/assets/{laptop-B4eOYbTq.js → laptop-DkpZomSM.js} +1 -1
- package/dist/assets/{lightbulb-Bne7-8Ze.js → lightbulb-aSJr4j2E.js} +1 -1
- package/dist/assets/{link-zf2sJvg6.js → link-Bv9PD6RR.js} +1 -1
- package/dist/assets/loader-circle-BMZu6eSq.js +1 -0
- package/dist/assets/{lock-CCxvlfNF.js → lock-CFGc54H-.js} +1 -1
- package/dist/assets/{luma-B_AVorW-.js → luma-xS8MPVmo.js} +1 -1
- package/dist/assets/{maestro-D1XT4FOs.js → maestro-Dcscvzhn.js} +1 -1
- package/dist/assets/{maestro-Do7AEFHl.js → maestro-DzYdPz9V.js} +1 -1
- package/dist/assets/{mail-BjcGxedl.js → mail-DQmxUiBG.js} +1 -1
- package/dist/assets/{message-circle-S_bavuQA.js → message-circle-iOdDVQ4j.js} +1 -1
- package/dist/assets/{mic-DlTpLTkf.js → mic-BH3alSnw.js} +1 -1
- package/dist/assets/{midjourney-DhBvOksa.js → midjourney-DdpmxYvW.js} +1 -1
- package/dist/assets/{mobileLocalExec-42_DoOyr.js → mobileLocalExec-C0CZpyA3.js} +2 -2
- package/dist/assets/{models-C_vP8fXw.js → models-ClsawnaQ.js} +1 -1
- package/dist/assets/{monitor-Ch-0sHuU.js → monitor-D-Ihg5W_.js} +1 -1
- package/dist/assets/{mouse-pointer-2-BUXmLl2i.js → mouse-pointer-2-o0odj8fp.js} +1 -1
- package/dist/assets/music-2-BY9FsAt5.js +1 -0
- package/dist/assets/{nanobanana-B9c8p1El.js → nanobanana-BhGJLST1.js} +1 -1
- package/dist/assets/{omni-D56RZnj-.js → omni-WA7vxGzT.js} +1 -1
- package/dist/assets/{openaiimage-CUAsXedo.js → openaiimage-mAx5FUGZ.js} +1 -1
- package/dist/assets/{pagination-bJAgglOW.js → pagination-BM4GJ-Sf.js} +1 -1
- package/dist/assets/{pagination-BMxFmqMB.js → pagination-D-uSyaRW.js} +1 -1
- package/dist/assets/{pagination-CQzCATax.js → pagination-WL2poeB8.js} +1 -1
- package/dist/assets/{palette-CVJ2VgEn.js → palette-CaO47W0Z.js} +1 -1
- package/dist/assets/{paperclip-Imlcce98.js → paperclip-8DZuzxqp.js} +1 -1
- package/dist/assets/{pause-C7_NsJRj.js → pause-Q-Xq27LK.js} +1 -1
- package/dist/assets/{pencil-YjbK28Hn.js → pencil-CHl88iig.js} +1 -1
- package/dist/assets/{pika-Bc3bO-b4.js → pika-ClI7CuKh.js} +1 -1
- package/dist/assets/{pixverse-BrmP1gc6.js → pixverse-TreHn4sJ.js} +1 -1
- package/dist/assets/play-CC2cYJj4.js +1 -0
- package/dist/assets/{plug-DIJyivM4.js → plug-CVWmKuC_.js} +1 -1
- package/dist/assets/plus-C2LaXZld.js +1 -0
- package/dist/assets/{poivelle-BCK1P4s2.js → poivelle-6m5eBCZW.js} +1 -1
- package/dist/assets/{popover-si5WTwYa.js → popover-DY8pHQut.js} +1 -1
- package/dist/assets/{producer-BsR8varW.js → producer-CzPcOHfn.js} +1 -1
- package/dist/assets/{qrart-Cm0Ptxrq.js → qrart-CMtw9xkh.js} +1 -1
- package/dist/assets/{realtime-Cy2ilMC4.js → realtime-DvSWKMLp.js} +1 -1
- package/dist/assets/{refresh-cw-wlvPD5o7.js → refresh-cw-C1aKOTkD.js} +1 -1
- package/dist/assets/rotate-ccw-BI-R9yqW.js +1 -0
- package/dist/assets/rotate-cw-DbYFLksy.js +1 -0
- package/dist/assets/{row-D9U2T0uj.js → row-BlBs21oD.js} +1 -1
- package/dist/assets/search-BIDVC-i5.js +1 -0
- package/dist/assets/{seedance-zbZFcuVS.js → seedance-Ds9N5QEg.js} +1 -1
- package/dist/assets/{seedream-CcBfVCEc.js → seedream-C5Qnaa_T.js} +1 -1
- package/dist/assets/{select-D4hHjjDD.js → select-ChyQns32.js} +1 -1
- package/dist/assets/{serp-DG5ZjZuD.js → serp-CP-qJKWH.js} +1 -1
- package/dist/assets/{shield-BMEQfl-R.js → shield-DGhAiApq.js} +1 -1
- package/dist/assets/{shuffle-CytwzA1L.js → shuffle-BeuDPIr4.js} +1 -1
- package/dist/assets/{slider-Dk-HMGwy.js → slider-CY92XsCL.js} +1 -1
- package/dist/assets/{solana-wallets-EsW3--Bx.js → solana-wallets-DgBa0FA_.js} +2 -2
- package/dist/assets/{solana-wallets-vue-XZ-0KNv3.js → solana-wallets-vue-BM_tK09v.js} +1 -1
- package/dist/assets/{sora-Bx-JXxsT.js → sora-AEl9SE4P.js} +1 -1
- package/dist/assets/{sparkles-B5oTux1n.js → sparkles-Vz7bqEir.js} +1 -1
- package/dist/assets/square-hr7_vQe-.js +1 -0
- package/dist/assets/{store-DkjznNUJ.js → store-g2x7jSoz.js} +1 -1
- package/dist/assets/{suno-CX-rOReE.js → suno-DV1Tv46s.js} +1 -1
- package/dist/assets/{switch-CqZthZuC.js → switch-CI_r8TsE.js} +1 -1
- package/dist/assets/{table-BibQtyBE.js → table-B5uHA9cN.js} +1 -1
- package/dist/assets/{tabs-C-Wxy8D4.js → tabs-BY90FIeI.js} +1 -1
- package/dist/assets/{tag-DCg80Kpi.js → tag-BN2GZemo.js} +1 -1
- package/dist/assets/terminal-BVFIc0Qz.js +1 -0
- package/dist/assets/{time-picker-CTiboyQM.js → time-picker-DE1ng7uG.js} +1 -1
- package/dist/assets/{tooltip-BZiH-gfA.js → tooltip-pUbjR2xu.js} +1 -1
- package/dist/assets/{trash-2-C8KAL3-J.js → trash-2-BfVLvlm9.js} +1 -1
- package/dist/assets/{triangle-alert-BQ4zdiSO.js → triangle-alert-BVAKaCSW.js} +1 -1
- package/dist/assets/{upload-DFZeQKOg.js → upload-CHxTlPO1.js} +1 -1
- package/dist/assets/{upload-Bwv0tGVb.js → upload-DimlTiIl.js} +1 -1
- package/dist/assets/user-K2d3Fh6I.js +1 -0
- package/dist/assets/{veo-9ApiYEhZ.js → veo-jxagRwld.js} +1 -1
- package/dist/assets/{video-CSUIxI9O.js → video-Dd3ZeLSG.js} +1 -1
- package/dist/assets/{volume-2-Dv4Len4G.js → volume-2-DGhYdIbk.js} +1 -1
- package/dist/assets/{wallet-BpiKcpvI.js → wallet-eAa1xyTv.js} +1 -1
- package/dist/assets/{wan-ByjqBu5O.js → wan-BFDTbf-Y.js} +1 -1
- package/dist/assets/{wand-sparkles-exkpi42x.js → wand-sparkles-Dp_e6WgR.js} +1 -1
- package/dist/assets/{web-l21vf0R1.js → web-BJoY2XNu.js} +1 -1
- package/dist/assets/{web-Cn39kkb5.js → web-Ck1DjjQD.js} +1 -1
- package/dist/assets/{web-CQV9hmdl.js → web-DMA8SArr.js} +1 -1
- package/dist/assets/{web-CDANyUY8.js → web-Do11Qy5F.js} +1 -1
- package/dist/assets/{web-CBLNqdi1.js → web-Lhwy08Bj.js} +1 -1
- package/dist/assets/{webextrator-BHCoHmbU.js → webextrator-CamKbO8I.js} +1 -1
- package/dist/assets/{zap-C5IZCLwR.js → zap-DZhBoH3Y.js} +1 -1
- package/dist/index.html +4 -4
- package/package.json +1 -1
- package/dist/assets/arrow-down-DVdyWwAW.js +0 -1
- package/dist/assets/arrow-left--zYjHOfm.js +0 -1
- package/dist/assets/arrow-right-rc3hOl3T.js +0 -1
- package/dist/assets/arrow-up-D9AJVoWg.js +0 -1
- package/dist/assets/check-DBlukU_J.js +0 -1
- package/dist/assets/chevron-down-B-FxpwU9.js +0 -1
- package/dist/assets/chevron-right-4M0nk_KZ.js +0 -1
- package/dist/assets/circle-check-DMgyvbFg.js +0 -1
- package/dist/assets/clock-bD4fxNqS.js +0 -1
- package/dist/assets/code-CeXvZwGL.js +0 -1
- package/dist/assets/esm-qLOqOdpT.js +0 -1
- package/dist/assets/gauge-C7mXRZRY.js +0 -1
- package/dist/assets/loader-circle-DWJ46J-N.js +0 -1
- package/dist/assets/music-2-C2cY2LzO.js +0 -1
- package/dist/assets/play-jYrItXXG.js +0 -1
- package/dist/assets/plus-DsD5w37_.js +0 -1
- package/dist/assets/rotate-ccw-CV5nDuuq.js +0 -1
- package/dist/assets/rotate-cw-zUPMZT4H.js +0 -1
- package/dist/assets/search-XPZdKAm0.js +0 -1
- package/dist/assets/square-yObS8rBG.js +0 -1
- package/dist/assets/terminal-BsAjmpP2.js +0 -1
- package/dist/assets/user-BzPJOHb6.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,Jt as t,L as n,M as r,N as i,at as a,tt as o,z as s}from"./vendor-chart-Dw-P17PN.js";import{t as c}from"./arrow-left
|
|
1
|
+
import{A as e,Jt as t,L as n,M as r,N as i,at as a,tt as o,z as s}from"./vendor-chart-Dw-P17PN.js";import{t as c}from"./arrow-left-B39EagFY.js";import{t as l}from"./house-D0dcqwOf.js";import{O as u}from"./index-C_sjkBHo.js";var d=s({name:`NotFound`,components:{BackIcon:c,HomeIcon:l},computed:{path(){return this.$route?.fullPath||``}},mounted(){let e=document.querySelector(`meta[name="robots"]`);e||(e=document.createElement(`meta`),e.setAttribute(`name`,`robots`),document.head.appendChild(e)),e.setAttribute(`content`,`noindex, nofollow`)},beforeUnmount(){let e=document.querySelector(`meta[name="robots"]`);e&&e.setAttribute(`content`,`index, follow`)},methods:{goHome(){this.$router.push(`/`)},goBack(){window.history.length>1?this.$router.back():this.$router.push(`/`)}}}),f={class:`not-found`},p={class:`content`},m={class:`eyebrow`},h={class:`title`},g={class:`subtitle`},_={class:`actions`},v={key:0,class:`path`},y={class:`path__label`},b={class:`path__value`};function x(s,c,l,u,d,x){let S=a(`home-icon`),C=a(`back-icon`);return o(),i(`div`,f,[c[3]||=e(`div`,{class:`glow`,"aria-hidden":`true`},null,-1),e(`main`,p,[e(`p`,m,t(s.$t(`common.message.notFoundEyebrow`)),1),c[2]||=e(`div`,{class:`code`,"aria-hidden":`true`},`404`,-1),e(`h1`,h,t(s.$t(`common.title.notFound`)),1),e(`p`,g,t(s.$t(`common.message.notFound`)),1),e(`div`,_,[e(`button`,{class:`btn btn--primary`,onClick:c[0]||=(...e)=>s.goHome&&s.goHome(...e)},[n(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,t(s.$t(`common.button.backToHome`)),1)]),e(`button`,{class:`btn btn--ghost`,onClick:c[1]||=(...e)=>s.goBack&&s.goBack(...e)},[n(C,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,t(s.$t(`common.button.goBack`)),1)])]),s.path?(o(),i(`div`,v,[e(`span`,y,t(s.$t(`common.message.notFoundPath`)),1),e(`code`,b,t(s.path),1)])):r(``,!0)])])}var S=u(d,[[`render`,x],[`__scopeId`,`data-v-40e4e98c`]]);export{S as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,Jt as t,M as n,N as r,tt as i,z as a}from"./vendor-chart-Dw-P17PN.js";import{O as o}from"./index-
|
|
1
|
+
import{A as e,Jt as t,M as n,N as r,tt as i,z as a}from"./vendor-chart-Dw-P17PN.js";import{O as o}from"./index-C_sjkBHo.js";var s=a({name:`ConsolePageHeader`,props:{title:{type:String,required:!0},subtitle:{type:String,default:``}}}),c={class:`page-heading`},l={class:`page-title`},u={key:0,class:`page-subtitle`};function d(a,o,s,d,f,p){return i(),r(`div`,c,[e(`h2`,l,t(a.title),1),a.subtitle?(i(),r(`p`,u,t(a.subtitle),1)):n(``,!0)])}var f=o(s,[[`render`,d],[`__scopeId`,`data-v-98d2d413`]]);export{f as t};
|
|
@@ -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,tt as d,z as f}from"./vendor-chart-Dw-P17PN.js";import{t as p}from"./alert-BprQRUmf.js";import{o as m,v as ee}from"./models-C_vP8fXw.js";import{t as h}from"./card-IQwqnRJR.js";import{n as g,t as _}from"./row-D9U2T0uj.js";import{i as v,n as y,r as b,t as x}from"./wechat-B_xvylqk.js";import{t as S}from"./divider-Du_3kymg.js";import{t as C}from"./skeleton-Dj_a_iIP.js";import{Ei as w,Fi as T,Ni as E,O as D,Wt as O,an as k,li as A,mr as j,pi as te,sn as M}from"./index-BubtY8Qx.js";import{t as N}from"./CopyToClipboard-BPulu_aW.js";var P=f({name:`PublicWechatPayDialog`,components:{ElDialog:w,ElButton:T,QrCode:O,ElRow:_,ElCol:g},props:{order:{type:Object,required:!0},visible:{type:Boolean,required:!1,default:!1}},emits:[`hide`],data(){return{copied:!1,copiedTimer:void 0}},computed:{isMobileOutsideWechat(){return y()&&!x()},isMobileInsideWechat(){return y()&&x()},dialogWidth(){return this.isMobileOutsideWechat||this.isMobileInsideWechat?`90%`:`500px`}},unmounted(){this.copiedTimer&&clearTimeout(this.copiedTimer)},methods:{async onCopyLink(){let e=typeof window<`u`?window.location.href:``;if(!e)return;let t=!1;try{t=await M(e,{debug:!1})}catch{t=!1}t?(this.copied=!0,this.copiedTimer&&clearTimeout(this.copiedTimer),this.copiedTimer=window.setTimeout(()=>{this.copied=!1},2e3)):ee.error(String(this.$t(`common.message.copyFailed`)||`Copy failed`))}}}),F={key:0,class:`wechat-pay-mobile text-center py-[20px] px-[10px]`},I={class:`text-[14px] mb-3 leading-relaxed`},L={class:`text-[12px] text-gray-500 mb-4 leading-relaxed`},R={key:1,class:`wechat-pay-longpress text-center py-[20px] px-[10px]`},z={class:`text-[14px] mb-4 leading-relaxed`},B={class:`paycode wechat`},V={class:`help-text block bg-[#00c800] text-white text-[14px] h-[35px] w-[240px] text-center leading-[35px] mt-[10px] mx-auto`};function H(t,s,f,p,m,ee){let h=c(`qr-code`),g=c(`el-button`),_=c(`el-col`),v=c(`el-row`),y=c(`el-dialog`);return d(),l(y,{"model-value":t.visible,title:t.$t(`application.title.buyService`),width:t.dialogWidth,center:``,onClose:s[0]||=e=>t.$emit(`hide`)},{default:u(()=>[t.isMobileOutsideWechat?(d(),o(`div`,F,[e(`p`,I,r(t.$t(`order.message.wechatPayMobileScanTip`)),1),t.order?.pay_url?(d(),l(h,{key:0,value:t.order?.pay_url,size:220,class:`qrcode m-auto mb-3`,type:`image/png`,color:{dark:`#000000`,light:`#ffffff`}},null,8,[`value`])):a(``,!0),e(`p`,L,r(t.$t(`order.message.wechatPayMobileHint`)),1),i(g,{size:`default`,round:``,class:`w-[220px]`,onClick:t.onCopyLink},{default:u(()=>[n(r(t.copied?t.$t(`common.message.copied`):t.$t(`order.button.copyPayLink`)),1)]),_:1},8,[`onClick`])])):t.isMobileInsideWechat?(d(),o(`div`,R,[e(`p`,z,r(t.$t(`order.message.wechatPayLongPressTip`)),1),t.order?.pay_url?(d(),l(h,{key:0,value:t.order?.pay_url,size:240,class:`qrcode mx-auto`,type:`image/png`,color:{dark:`#000000`,light:`#ffffff`}},null,8,[`value`])):a(``,!0)])):(d(),l(v,{key:2,class:`paycodes py-[30px] w-[500px] mx-auto`},{default:u(()=>[i(_,{span:12},{default:u(()=>[e(`div`,B,[t.order?.pay_url?(d(),l(h,{key:0,value:t.order?.pay_url,size:200,class:`qrcode m-auto w-[200px] h-[200px]`,type:`image/png`,color:{dark:`#000000`,light:`#ffffff`}},null,8,[`value`])):a(``,!0),e(`p`,V,r(t.$t(`order.message.wechatPayHelp`)),1)])]),_:1}),i(_,{span:12},{default:u(()=>[...s[1]||=[e(`div`,{class:`help-img`},[e(`img`,{src:`https://midas.gtimg.cn/enterprise/images/ep_sys_wx_tip.jpg`})],-1)]]),_:1})]),_:1}))]),_:1},8,[`model-value`,`title`,`width`])}var U=D(P,[[`render`,H]]),W=f({name:`PublicStripePayDialog`,components:{ElDialog:w},props:{order:{type:Object,required:!0},visible:{type:Boolean,required:!1,default:!1}},emits:[`hide`],watch:{visible:{handler(e){e&&this.order?.pay_url&&window.open(this.order.pay_url,`_blank`)}}}}),G={class:`text-center`};function K(t,n,i,a,o,s){let f=c(`el-dialog`);return d(),l(f,{"model-value":t.visible,title:t.$t(`application.title.buyService`),width:`500px`,center:``,onClose:n[0]||=e=>t.$emit(`hide`)},{default:u(()=>[e(`p`,G,r(t.$t(`order.message.buyInExternalUrl`)),1)]),_:1},8,[`model-value`,`title`])}var q=D(W,[[`render`,K]]),ne=f({name:`PublicAlipayPayDialog`,components:{ElDialog:w},props:{order:{type:Object,required:!0},visible:{type:Boolean,required:!1,default:!1}},emits:[`hide`],watch:{visible:{handler(e){e&&this.order?.pay_url&&window.open(this.order.pay_url,`_blank`)}}}}),J={class:`text-center`};function Y(t,n,i,a,o,s){let f=c(`el-dialog`);return d(),l(f,{"model-value":t.visible,title:t.$t(`application.title.buyService`),width:`500px`,center:``,onClose:n[0]||=e=>t.$emit(`hide`)},{default:u(()=>[e(`p`,J,r(t.$t(`order.message.buyInExternalUrl`)),1)]),_:1},8,[`model-value`,`title`])}var X=D(ne,[[`render`,Y]]),Z=7e3,re=2e3,Q=function(e){return e.WechatPay=`WechatPay`,e.Stripe=`Stripe`,e.AliPay=`AliPay`,e.Card=`Card`,e}(Q||{}),ie=f({name:`OrderPublicPay`,components:{ElButton:T,ElRow:_,ElCol:g,ElCard:h,ElSkeleton:C,ElDivider:S,ElAlert:p,ElDescriptions:b,ElDescriptionsItem:v,ElTag:E,PublicWechatPay:U,PublicStripePay:q,PublicAlipayPay:X,CopyToClipboard:N},data(){return{PayWay:Q,OrderState:m,payWay:`WechatPay`,order:void 0,loading:!1,paying:!1,prepaying:!1}},computed:{id(){return this.$route.params?.id?.toString()??``},config(){return this.$store.getters.config},enableCard(){return!!this.config?.features?.ENABLE_CARD},showPayment(){return!te()}},watch:{paying(e){e?this.startOrderPolling(re):this.stopOrderPolling()}},created(){this._orderRefreshTimer=void 0},mounted(){this.onFetchData()},beforeUnmount(){this.stopOrderPolling()},methods:{getPriceString:k,payWayLabel(e){return{WechatPay:this.$t(`order.title.wechatPay`),Stripe:this.$t(`order.title.stripe`),AliPay:this.$t(`order.title.aliPay`),Card:this.$t(`order.title.card`)}[e]||e},onFetchData(){this.id&&(this.loading=!0,j.get(this.id).then(({data:e})=>{this.order=e,e?.pay_way&&e.pay_way in Q&&(this.payWay=e.pay_way),this.loading=!1}).catch(()=>{this.order=void 0,this.loading=!1}))},startOrderPolling(e=0){this.stopOrderPolling();let t=async()=>{try{let{data:e}=await j.get(this.id);if(this.order=e,e?.state===m.PAID||e?.state===m.FINISHED||e?.state===m.FAILED||e?.state===m.EXPIRED){this.paying=!1,this.stopOrderPolling();return}}catch{}this.paying&&(this._orderRefreshTimer=window.setTimeout(t,Z))};this._orderRefreshTimer=window.setTimeout(t,e)},stopOrderPolling(){let e=this._orderRefreshTimer;e&&(clearTimeout(e),this._orderRefreshTimer=void 0)},onRepay(){this.paying=!0},onPay(){if(!this.id)return;this.prepaying=!0;let e={pay_way:this.payWay};this.payWay===`AliPay`&&(e.surface=A()),j.pay(this.id,e).then(({data:e})=>{this.prepaying=!1,e?.id&&(this.order=e),this.order&&this.order.price&&this.order.price>0&&(this.paying=!0)}).catch(()=>{this.prepaying=!1})}}}),ae={class:`title`},oe={key:0,class:`pt-5`},se={key:1,class:`pt-10 text-center`},ce={key:2,class:`order`},le={key:0,class:`price current unfree`},ue={key:1,class:`price free`},de={key:0,class:`payways mb-6`},fe={class:`payname`},pe={class:`payname`},$={class:`payname`},me={class:`payname`},he={key:1},ge={key:2};function _e(f,p,m,ee,h,g){let _=c(`el-col`),v=c(`el-row`),y=c(`el-skeleton`),b=c(`el-alert`),x=c(`copy-to-clipboard`),S=c(`el-descriptions-item`),C=c(`el-tag`),w=c(`el-descriptions`),T=c(`el-divider`),E=c(`el-button`),D=c(`el-card`),O=c(`public-wechat-pay`),k=c(`public-stripe-pay`),A=c(`public-alipay-pay`);return d(),o(s,null,[i(v,{class:`wrapper`},{default:u(()=>[i(_,{span:24},{default:u(()=>[i(v,null,{default:u(()=>[i(_,{span:24},{default:u(()=>[e(`h2`,ae,r(f.$t(`order.title.info`)),1)]),_:1})]),_:1}),i(v,{class:`panel`},{default:u(()=>[i(_,{span:24},{default:u(()=>[i(D,{shadow:`hover`},{default:u(()=>[i(v,null,{default:u(()=>[i(_,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:u(()=>[f.loading?(d(),o(`div`,oe,[i(y,{animated:``})])):f.order?(d(),o(`div`,ce,[i(w,{column:1},{default:u(()=>[i(S,{label:f.$t(`order.field.id`)},{default:u(()=>[e(`span`,null,r(f.order.id),1),f.order.id?(d(),l(x,{key:0,content:f.order.id,class:`inline-block`},null,8,[`content`])):a(``,!0)]),_:1},8,[`label`]),i(S,{label:f.$t(`order.field.description`)},{default:u(()=>[n(r(f.order.description),1)]),_:1},8,[`label`]),f.order.pay_way?(d(),l(S,{key:0,label:f.$t(`order.field.payWay`)},{default:u(()=>[i(C,{type:`info`,effect:`dark`,round:``,size:`small`},{default:u(()=>[n(r(f.payWayLabel(f.order.pay_way)),1)]),_:1})]),_:1},8,[`label`])):a(``,!0),i(S,{label:f.$t(`order.field.createdAt`)},{default:u(()=>[n(r(f.$dayjs.format(f.order.created_at||``)),1)]),_:1},8,[`label`]),i(S,{label:f.$t(`order.field.price`)},{default:u(()=>[f.order.price&&f.order.price>0?(d(),o(`span`,le,r(f.getPriceString({value:f.order.price})),1)):(d(),o(`span`,ue,r(f.$t(`order.message.free`)),1))]),_:1},8,[`label`])]),_:1})])):(d(),o(`div`,se,[i(b,{title:f.$t(`order.message.publicPayNotFound`),type:`error`,"show-icon":``,closable:!1},null,8,[`title`])]))]),_:1})]),_:1}),f.order?.state===f.OrderState.PAID||f.order?.state===f.OrderState.FINISHED?(d(),l(v,{key:0,class:`mb-5`},{default:u(()=>[i(_,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:u(()=>[i(T,{"border-style":`dashed`}),i(b,{title:f.$t(`order.message.paidSuccessfully`),type:`success`,"show-icon":``,closable:!1},null,8,[`title`])]),_:1})]),_:1})):a(``,!0),f.order?.state===f.OrderState.EXPIRED?(d(),l(v,{key:1,class:`mb-5`},{default:u(()=>[i(_,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:u(()=>[i(T,{"border-style":`dashed`}),i(b,{title:f.$t(`order.message.orderExpired`),type:`error`,"show-icon":``,closable:!1},null,8,[`title`])]),_:1})]),_:1})):a(``,!0),f.order?.state===f.OrderState.FAILED?(d(),l(v,{key:2,class:`mb-5`},{default:u(()=>[i(_,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:u(()=>[i(T,{"border-style":`dashed`}),i(b,{title:f.$t(`order.state.failed`),type:`error`,"show-icon":``,closable:!1},null,8,[`title`])]),_:1})]),_:1})):a(``,!0),f.order?.state===f.OrderState.PENDING&&f.showPayment?(d(),l(v,{key:3},{default:u(()=>[i(_,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:u(()=>[i(T,{"border-style":`dashed`}),!f.order.pay_way&&f.order.price&&f.order.price>0?(d(),o(`div`,de,[e(`div`,{class:t({payway:!0,wechatpay:!0,active:f.payWay===f.PayWay.WechatPay}),onClick:p[0]||=e=>f.payWay=f.PayWay.WechatPay},[p[7]||=e(`span`,{class:`payicon wechatpay`},null,-1),e(`span`,fe,r(f.$t(`order.title.wechatPay`)),1)],2),e(`div`,{class:t({payway:!0,alipay:!0,active:f.payWay===f.PayWay.AliPay}),onClick:p[1]||=e=>f.payWay=f.PayWay.AliPay},[p[8]||=e(`span`,{class:`payicon alipay`},null,-1),e(`span`,pe,r(f.$t(`order.title.aliPay`)),1)],2),f.enableCard?a(``,!0):(d(),o(`div`,{key:0,class:t({payway:!0,stripe:!0,active:f.payWay===f.PayWay.Stripe}),onClick:p[2]||=e=>f.payWay=f.PayWay.Stripe},[p[9]||=e(`span`,{class:`payicon stripe`},null,-1),e(`span`,$,r(f.$t(`order.title.stripe`)),1)],2)),f.enableCard?(d(),o(`div`,{key:1,class:t({payway:!0,creditcard:!0,active:f.payWay===f.PayWay.Card}),onClick:p[3]||=e=>f.payWay=f.PayWay.Card},[p[10]||=e(`span`,{class:`payicon card`,"aria-hidden":`true`},null,-1),e(`span`,me,r(f.$t(`order.title.card`)),1)],2)):a(``,!0)])):a(``,!0),f.order.pay_way?(d(),o(`div`,ge,[i(E,{type:`primary`,round:``,size:`large`,class:`btn-repay`,onClick:f.onRepay},{default:u(()=>[n(r(f.$t(`common.button.repay`)),1)]),_:1},8,[`onClick`])])):(d(),o(`div`,he,[i(E,{loading:f.prepaying,round:``,type:`primary`,size:`large`,class:`btn-pay`,onClick:f.onPay},{default:u(()=>[n(r(f.$t(`common.button.pay`)),1)]),_:1},8,[`loading`,`onClick`])]))]),_:1})]),_:1})):a(``,!0)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),f.order&&f.payWay===f.PayWay.WechatPay?(d(),l(O,{key:0,order:f.order,visible:f.paying,onHide:p[4]||=e=>f.paying=!1},null,8,[`order`,`visible`])):a(``,!0),f.order&&(f.payWay===f.PayWay.Stripe||f.payWay===f.PayWay.Card)?(d(),l(k,{key:1,order:f.order,visible:f.paying,onHide:p[5]||=e=>f.paying=!1},null,8,[`order`,`visible`])):a(``,!0),f.order&&f.payWay===f.PayWay.AliPay?(d(),l(A,{key:2,order:f.order,visible:f.paying,onHide:p[6]||=e=>f.paying=!1},null,8,[`order`,`visible`])):a(``,!0)],64)}var ve=D(ie,[[`render`,_e],[`__scopeId`,`data-v-8711039f`]]);export{ve 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,tt as d,z as f}from"./vendor-chart-Dw-P17PN.js";import{t as p}from"./alert-BprQRUmf.js";import{o as m,v as ee}from"./models-ClsawnaQ.js";import{t as h}from"./card-IQwqnRJR.js";import{n as g,t as _}from"./row-BlBs21oD.js";import{i as v,n as y,r as b,t as x}from"./wechat-B_xvylqk.js";import{t as S}from"./divider-Du_3kymg.js";import{t as C}from"./skeleton-Dj_a_iIP.js";import{Ei as w,Fi as T,Ni as E,O as D,Wt as O,an as k,li as A,mr as j,pi as te,sn as M}from"./index-C_sjkBHo.js";import{t as N}from"./CopyToClipboard-D1PN1vgU.js";var P=f({name:`PublicWechatPayDialog`,components:{ElDialog:w,ElButton:T,QrCode:O,ElRow:_,ElCol:g},props:{order:{type:Object,required:!0},visible:{type:Boolean,required:!1,default:!1}},emits:[`hide`],data(){return{copied:!1,copiedTimer:void 0}},computed:{isMobileOutsideWechat(){return y()&&!x()},isMobileInsideWechat(){return y()&&x()},dialogWidth(){return this.isMobileOutsideWechat||this.isMobileInsideWechat?`90%`:`500px`}},unmounted(){this.copiedTimer&&clearTimeout(this.copiedTimer)},methods:{async onCopyLink(){let e=typeof window<`u`?window.location.href:``;if(!e)return;let t=!1;try{t=await M(e,{debug:!1})}catch{t=!1}t?(this.copied=!0,this.copiedTimer&&clearTimeout(this.copiedTimer),this.copiedTimer=window.setTimeout(()=>{this.copied=!1},2e3)):ee.error(String(this.$t(`common.message.copyFailed`)||`Copy failed`))}}}),F={key:0,class:`wechat-pay-mobile text-center py-[20px] px-[10px]`},I={class:`text-[14px] mb-3 leading-relaxed`},L={class:`text-[12px] text-gray-500 mb-4 leading-relaxed`},R={key:1,class:`wechat-pay-longpress text-center py-[20px] px-[10px]`},z={class:`text-[14px] mb-4 leading-relaxed`},B={class:`paycode wechat`},V={class:`help-text block bg-[#00c800] text-white text-[14px] h-[35px] w-[240px] text-center leading-[35px] mt-[10px] mx-auto`};function H(t,s,f,p,m,ee){let h=c(`qr-code`),g=c(`el-button`),_=c(`el-col`),v=c(`el-row`),y=c(`el-dialog`);return d(),l(y,{"model-value":t.visible,title:t.$t(`application.title.buyService`),width:t.dialogWidth,center:``,onClose:s[0]||=e=>t.$emit(`hide`)},{default:u(()=>[t.isMobileOutsideWechat?(d(),o(`div`,F,[e(`p`,I,r(t.$t(`order.message.wechatPayMobileScanTip`)),1),t.order?.pay_url?(d(),l(h,{key:0,value:t.order?.pay_url,size:220,class:`qrcode m-auto mb-3`,type:`image/png`,color:{dark:`#000000`,light:`#ffffff`}},null,8,[`value`])):a(``,!0),e(`p`,L,r(t.$t(`order.message.wechatPayMobileHint`)),1),i(g,{size:`default`,round:``,class:`w-[220px]`,onClick:t.onCopyLink},{default:u(()=>[n(r(t.copied?t.$t(`common.message.copied`):t.$t(`order.button.copyPayLink`)),1)]),_:1},8,[`onClick`])])):t.isMobileInsideWechat?(d(),o(`div`,R,[e(`p`,z,r(t.$t(`order.message.wechatPayLongPressTip`)),1),t.order?.pay_url?(d(),l(h,{key:0,value:t.order?.pay_url,size:240,class:`qrcode mx-auto`,type:`image/png`,color:{dark:`#000000`,light:`#ffffff`}},null,8,[`value`])):a(``,!0)])):(d(),l(v,{key:2,class:`paycodes py-[30px] w-[500px] mx-auto`},{default:u(()=>[i(_,{span:12},{default:u(()=>[e(`div`,B,[t.order?.pay_url?(d(),l(h,{key:0,value:t.order?.pay_url,size:200,class:`qrcode m-auto w-[200px] h-[200px]`,type:`image/png`,color:{dark:`#000000`,light:`#ffffff`}},null,8,[`value`])):a(``,!0),e(`p`,V,r(t.$t(`order.message.wechatPayHelp`)),1)])]),_:1}),i(_,{span:12},{default:u(()=>[...s[1]||=[e(`div`,{class:`help-img`},[e(`img`,{src:`https://midas.gtimg.cn/enterprise/images/ep_sys_wx_tip.jpg`})],-1)]]),_:1})]),_:1}))]),_:1},8,[`model-value`,`title`,`width`])}var U=D(P,[[`render`,H]]),W=f({name:`PublicStripePayDialog`,components:{ElDialog:w},props:{order:{type:Object,required:!0},visible:{type:Boolean,required:!1,default:!1}},emits:[`hide`],watch:{visible:{handler(e){e&&this.order?.pay_url&&window.open(this.order.pay_url,`_blank`)}}}}),G={class:`text-center`};function K(t,n,i,a,o,s){let f=c(`el-dialog`);return d(),l(f,{"model-value":t.visible,title:t.$t(`application.title.buyService`),width:`500px`,center:``,onClose:n[0]||=e=>t.$emit(`hide`)},{default:u(()=>[e(`p`,G,r(t.$t(`order.message.buyInExternalUrl`)),1)]),_:1},8,[`model-value`,`title`])}var q=D(W,[[`render`,K]]),ne=f({name:`PublicAlipayPayDialog`,components:{ElDialog:w},props:{order:{type:Object,required:!0},visible:{type:Boolean,required:!1,default:!1}},emits:[`hide`],watch:{visible:{handler(e){e&&this.order?.pay_url&&window.open(this.order.pay_url,`_blank`)}}}}),J={class:`text-center`};function Y(t,n,i,a,o,s){let f=c(`el-dialog`);return d(),l(f,{"model-value":t.visible,title:t.$t(`application.title.buyService`),width:`500px`,center:``,onClose:n[0]||=e=>t.$emit(`hide`)},{default:u(()=>[e(`p`,J,r(t.$t(`order.message.buyInExternalUrl`)),1)]),_:1},8,[`model-value`,`title`])}var X=D(ne,[[`render`,Y]]),Z=7e3,re=2e3,Q=function(e){return e.WechatPay=`WechatPay`,e.Stripe=`Stripe`,e.AliPay=`AliPay`,e.Card=`Card`,e}(Q||{}),ie=f({name:`OrderPublicPay`,components:{ElButton:T,ElRow:_,ElCol:g,ElCard:h,ElSkeleton:C,ElDivider:S,ElAlert:p,ElDescriptions:b,ElDescriptionsItem:v,ElTag:E,PublicWechatPay:U,PublicStripePay:q,PublicAlipayPay:X,CopyToClipboard:N},data(){return{PayWay:Q,OrderState:m,payWay:`WechatPay`,order:void 0,loading:!1,paying:!1,prepaying:!1}},computed:{id(){return this.$route.params?.id?.toString()??``},config(){return this.$store.getters.config},enableCard(){return!!this.config?.features?.ENABLE_CARD},showPayment(){return!te()}},watch:{paying(e){e?this.startOrderPolling(re):this.stopOrderPolling()}},created(){this._orderRefreshTimer=void 0},mounted(){this.onFetchData()},beforeUnmount(){this.stopOrderPolling()},methods:{getPriceString:k,payWayLabel(e){return{WechatPay:this.$t(`order.title.wechatPay`),Stripe:this.$t(`order.title.stripe`),AliPay:this.$t(`order.title.aliPay`),Card:this.$t(`order.title.card`)}[e]||e},onFetchData(){this.id&&(this.loading=!0,j.get(this.id).then(({data:e})=>{this.order=e,e?.pay_way&&e.pay_way in Q&&(this.payWay=e.pay_way),this.loading=!1}).catch(()=>{this.order=void 0,this.loading=!1}))},startOrderPolling(e=0){this.stopOrderPolling();let t=async()=>{try{let{data:e}=await j.get(this.id);if(this.order=e,e?.state===m.PAID||e?.state===m.FINISHED||e?.state===m.FAILED||e?.state===m.EXPIRED){this.paying=!1,this.stopOrderPolling();return}}catch{}this.paying&&(this._orderRefreshTimer=window.setTimeout(t,Z))};this._orderRefreshTimer=window.setTimeout(t,e)},stopOrderPolling(){let e=this._orderRefreshTimer;e&&(clearTimeout(e),this._orderRefreshTimer=void 0)},onRepay(){this.paying=!0},onPay(){if(!this.id)return;this.prepaying=!0;let e={pay_way:this.payWay};this.payWay===`AliPay`&&(e.surface=A()),j.pay(this.id,e).then(({data:e})=>{this.prepaying=!1,e?.id&&(this.order=e),this.order&&this.order.price&&this.order.price>0&&(this.paying=!0)}).catch(()=>{this.prepaying=!1})}}}),ae={class:`title`},oe={key:0,class:`pt-5`},se={key:1,class:`pt-10 text-center`},ce={key:2,class:`order`},le={key:0,class:`price current unfree`},ue={key:1,class:`price free`},de={key:0,class:`payways mb-6`},fe={class:`payname`},pe={class:`payname`},$={class:`payname`},me={class:`payname`},he={key:1},ge={key:2};function _e(f,p,m,ee,h,g){let _=c(`el-col`),v=c(`el-row`),y=c(`el-skeleton`),b=c(`el-alert`),x=c(`copy-to-clipboard`),S=c(`el-descriptions-item`),C=c(`el-tag`),w=c(`el-descriptions`),T=c(`el-divider`),E=c(`el-button`),D=c(`el-card`),O=c(`public-wechat-pay`),k=c(`public-stripe-pay`),A=c(`public-alipay-pay`);return d(),o(s,null,[i(v,{class:`wrapper`},{default:u(()=>[i(_,{span:24},{default:u(()=>[i(v,null,{default:u(()=>[i(_,{span:24},{default:u(()=>[e(`h2`,ae,r(f.$t(`order.title.info`)),1)]),_:1})]),_:1}),i(v,{class:`panel`},{default:u(()=>[i(_,{span:24},{default:u(()=>[i(D,{shadow:`hover`},{default:u(()=>[i(v,null,{default:u(()=>[i(_,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:u(()=>[f.loading?(d(),o(`div`,oe,[i(y,{animated:``})])):f.order?(d(),o(`div`,ce,[i(w,{column:1},{default:u(()=>[i(S,{label:f.$t(`order.field.id`)},{default:u(()=>[e(`span`,null,r(f.order.id),1),f.order.id?(d(),l(x,{key:0,content:f.order.id,class:`inline-block`},null,8,[`content`])):a(``,!0)]),_:1},8,[`label`]),i(S,{label:f.$t(`order.field.description`)},{default:u(()=>[n(r(f.order.description),1)]),_:1},8,[`label`]),f.order.pay_way?(d(),l(S,{key:0,label:f.$t(`order.field.payWay`)},{default:u(()=>[i(C,{type:`info`,effect:`dark`,round:``,size:`small`},{default:u(()=>[n(r(f.payWayLabel(f.order.pay_way)),1)]),_:1})]),_:1},8,[`label`])):a(``,!0),i(S,{label:f.$t(`order.field.createdAt`)},{default:u(()=>[n(r(f.$dayjs.format(f.order.created_at||``)),1)]),_:1},8,[`label`]),i(S,{label:f.$t(`order.field.price`)},{default:u(()=>[f.order.price&&f.order.price>0?(d(),o(`span`,le,r(f.getPriceString({value:f.order.price})),1)):(d(),o(`span`,ue,r(f.$t(`order.message.free`)),1))]),_:1},8,[`label`])]),_:1})])):(d(),o(`div`,se,[i(b,{title:f.$t(`order.message.publicPayNotFound`),type:`error`,"show-icon":``,closable:!1},null,8,[`title`])]))]),_:1})]),_:1}),f.order?.state===f.OrderState.PAID||f.order?.state===f.OrderState.FINISHED?(d(),l(v,{key:0,class:`mb-5`},{default:u(()=>[i(_,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:u(()=>[i(T,{"border-style":`dashed`}),i(b,{title:f.$t(`order.message.paidSuccessfully`),type:`success`,"show-icon":``,closable:!1},null,8,[`title`])]),_:1})]),_:1})):a(``,!0),f.order?.state===f.OrderState.EXPIRED?(d(),l(v,{key:1,class:`mb-5`},{default:u(()=>[i(_,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:u(()=>[i(T,{"border-style":`dashed`}),i(b,{title:f.$t(`order.message.orderExpired`),type:`error`,"show-icon":``,closable:!1},null,8,[`title`])]),_:1})]),_:1})):a(``,!0),f.order?.state===f.OrderState.FAILED?(d(),l(v,{key:2,class:`mb-5`},{default:u(()=>[i(_,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:u(()=>[i(T,{"border-style":`dashed`}),i(b,{title:f.$t(`order.state.failed`),type:`error`,"show-icon":``,closable:!1},null,8,[`title`])]),_:1})]),_:1})):a(``,!0),f.order?.state===f.OrderState.PENDING&&f.showPayment?(d(),l(v,{key:3},{default:u(()=>[i(_,{xs:{span:22,offset:1},sm:{span:16,offset:4}},{default:u(()=>[i(T,{"border-style":`dashed`}),!f.order.pay_way&&f.order.price&&f.order.price>0?(d(),o(`div`,de,[e(`div`,{class:t({payway:!0,wechatpay:!0,active:f.payWay===f.PayWay.WechatPay}),onClick:p[0]||=e=>f.payWay=f.PayWay.WechatPay},[p[7]||=e(`span`,{class:`payicon wechatpay`},null,-1),e(`span`,fe,r(f.$t(`order.title.wechatPay`)),1)],2),e(`div`,{class:t({payway:!0,alipay:!0,active:f.payWay===f.PayWay.AliPay}),onClick:p[1]||=e=>f.payWay=f.PayWay.AliPay},[p[8]||=e(`span`,{class:`payicon alipay`},null,-1),e(`span`,pe,r(f.$t(`order.title.aliPay`)),1)],2),f.enableCard?a(``,!0):(d(),o(`div`,{key:0,class:t({payway:!0,stripe:!0,active:f.payWay===f.PayWay.Stripe}),onClick:p[2]||=e=>f.payWay=f.PayWay.Stripe},[p[9]||=e(`span`,{class:`payicon stripe`},null,-1),e(`span`,$,r(f.$t(`order.title.stripe`)),1)],2)),f.enableCard?(d(),o(`div`,{key:1,class:t({payway:!0,creditcard:!0,active:f.payWay===f.PayWay.Card}),onClick:p[3]||=e=>f.payWay=f.PayWay.Card},[p[10]||=e(`span`,{class:`payicon card`,"aria-hidden":`true`},null,-1),e(`span`,me,r(f.$t(`order.title.card`)),1)],2)):a(``,!0)])):a(``,!0),f.order.pay_way?(d(),o(`div`,ge,[i(E,{type:`primary`,round:``,size:`large`,class:`btn-repay`,onClick:f.onRepay},{default:u(()=>[n(r(f.$t(`common.button.repay`)),1)]),_:1},8,[`onClick`])])):(d(),o(`div`,he,[i(E,{loading:f.prepaying,round:``,type:`primary`,size:`large`,class:`btn-pay`,onClick:f.onPay},{default:u(()=>[n(r(f.$t(`common.button.pay`)),1)]),_:1},8,[`loading`,`onClick`])]))]),_:1})]),_:1})):a(``,!0)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),f.order&&f.payWay===f.PayWay.WechatPay?(d(),l(O,{key:0,order:f.order,visible:f.paying,onHide:p[4]||=e=>f.paying=!1},null,8,[`order`,`visible`])):a(``,!0),f.order&&(f.payWay===f.PayWay.Stripe||f.payWay===f.PayWay.Card)?(d(),l(k,{key:1,order:f.order,visible:f.paying,onHide:p[5]||=e=>f.paying=!1},null,8,[`order`,`visible`])):a(``,!0),f.order&&f.payWay===f.PayWay.AliPay?(d(),l(A,{key:2,order:f.order,visible:f.paying,onHide:p[6]||=e=>f.paying=!1},null,8,[`order`,`visible`])):a(``,!0)],64)}var ve=D(ie,[[`render`,_e],[`__scopeId`,`data-v-8711039f`]]);export{ve as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime--c01j_DQ.js";import{A as t,Gt as n,Jt as r,L as i,M as a,Mt as o,N as s,U as c,Y as l,ft as u,k as d,mt as f,nt as p,tt as m,yt as h,z as g}from"./vendor-chart-Dw-P17PN.js";import{_}from"./models-
|
|
1
|
+
import{t as e}from"./rolldown-runtime--c01j_DQ.js";import{A as t,Gt as n,Jt as r,L as i,M as a,Mt as o,N as s,U as c,Y as l,ft as u,k as d,mt as f,nt as p,tt as m,yt as h,z as g}from"./vendor-chart-Dw-P17PN.js";import{_}from"./models-ClsawnaQ.js";import{t as v}from"./popover-DY8pHQut.js";import{t as y}from"./slider-CY92XsCL.js";import{t as b}from"./arrow-left-B39EagFY.js";import{t as x}from"./arrow-right-40WAcToQ.js";import{t as S}from"./pause-Q-Xq27LK.js";import{t as C}from"./play-CC2cYJj4.js";import{t as w}from"./volume-2-DGhYdIbk.js";import{O as T,bi as E}from"./index-C_sjkBHo.js";var D=E(`brush-cleaning`,[[`path`,{d:`m16 22-1-4`,key:`1ow2iv`}],[`path`,{d:`M19 14a1 1 0 0 0 1-1v-1a2 2 0 0 0-2-2h-3a1 1 0 0 1-1-1V4a2 2 0 0 0-4 0v5a1 1 0 0 1-1 1H6a2 2 0 0 0-2 2v1a1 1 0 0 0 1 1`,key:`11gii7`}],[`path`,{d:`M19 14H5l-1.973 6.767A1 1 0 0 0 4 22h16a1 1 0 0 0 .973-1.233z`,key:`bju7h4`}],[`path`,{d:`m8 22 1-4`,key:`s3unb`}]]);function O(e){let t=Math.floor(e)%60;e=Math.floor(e/60);let n=e%60,r=n<10?`0${n}`:n,i=t<10?`0${t}`:t;return r+`:`+i}var k=e(((e,t)=>{(function(t,n){typeof define==`function`&&define.amd?define([],n):e===void 0?(n(),t.FileSaver={exports:{}}.exports):n()})(e,function(){function e(e,t){return t===void 0?t={autoBom:!1}:typeof t!=`object`&&(console.warn(`Deprecated: Expected third argument to be a object`),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([``,e],{type:e.type}):e}function n(e,t,n){var r=new XMLHttpRequest;r.open(`GET`,e),r.responseType=`blob`,r.onload=function(){s(r.response,t,n)},r.onerror=function(){console.error(`could not download file`)},r.send()}function r(e){var t=new XMLHttpRequest;t.open(`HEAD`,e,!1);try{t.send()}catch{}return 200<=t.status&&299>=t.status}function i(e){try{e.dispatchEvent(new MouseEvent(`click`))}catch{var t=document.createEvent(`MouseEvents`);t.initMouseEvent(`click`,!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a=typeof window==`object`&&window.window===window?window:typeof self==`object`&&self.self===self?self:typeof global==`object`&&global.global===global?global:void 0,o=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),s=a.saveAs||(typeof window!=`object`||window!==a?function(){}:`download`in HTMLAnchorElement.prototype&&!o?function(e,t,o){var s=a.URL||a.webkitURL,c=document.createElement(`a`);t=t||e.name||`download`,c.download=t,c.rel=`noopener`,typeof e==`string`?(c.href=e,c.origin===location.origin?i(c):r(c.href)?n(e,t,o):i(c,c.target=`_blank`)):(c.href=s.createObjectURL(e),setTimeout(function(){s.revokeObjectURL(c.href)},4e4),setTimeout(function(){i(c)},0))}:`msSaveOrOpenBlob`in navigator?function(t,a,o){if(a=a||t.name||`download`,typeof t!=`string`)navigator.msSaveOrOpenBlob(e(t,o),a);else if(r(t))n(t,a,o);else{var s=document.createElement(`a`);s.href=t,s.target=`_blank`,setTimeout(function(){i(s)})}}:function(e,t,r,i){if(i||=open(``,`_blank`),i&&(i.document.title=i.document.body.innerText=`downloading...`),typeof e==`string`)return n(e,t,r);var s=e.type===`application/octet-stream`,c=/constructor/i.test(a.HTMLElement)||a.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||s&&c||o)&&typeof FileReader<`u`){var u=new FileReader;u.onloadend=function(){var e=u.result;e=l?e:e.replace(/^data:[^;]*;/,`data:attachment/file;`),i?i.location.href=e:location=e,i=null},u.readAsDataURL(e)}else{var d=a.URL||a.webkitURL,f=d.createObjectURL(e);i?i.location=f:location.href=f,i=null,setTimeout(function(){d.revokeObjectURL(f)},4e4)}});a.saveAs=s.saveAs=s,t!==void 0&&(t.exports=s)})})),A=Symbol(`AudioNamespace`),j=Symbol(`AudioQueue`),M=()=>{let e=c(A);if(!e)throw Error(`[player] useAudioNamespace() must be called inside <Player namespace="suno|producer">`);return e},N=e=>{let t=e??M(),n=_(),r=d({get:()=>n.state[t].audio,set:e=>n.commit(`${t}/setAudio`,e)}),i=e=>{n.commit(`${t}/setAudio`,{...n.state[t].audio,...e})},a=e=>{n.dispatch(`${t}/setAudio`,{...n.state[t].audio,...e})},o=e=>d({get:()=>n.state[t].audio?.[e],set:t=>i({[e]:t})}),s=c(j,void 0),l=d(()=>{let e=s?.value;if(e&&e.length)return e;let r=n.state[t]?.tasks?.items??[],i=[];for(let e of r)for(let t of e?.response?.data??[])t?.audio_url&&i.push(t);return i}),u=d(()=>{let e=n.state[t].audio?.id;return l.value.findIndex(t=>t.id===e)});return{namespace:t,store:n,audio:r,field:o,patchAudio:i,dispatchAudio:a,tracks:l,currentIndex:u,playAdjacent:e=>{let r=u.value;if(r===-1)return;let i=l.value[r+e];i&&n.dispatch(`${t}/setAudio`,{...n.state[t].audio,...i,progress:0,state:`playing`})}}},P={class:`player-slider`},F=g({__name:`PlayerSlider`,setup(e){let{field:t,dispatchAudio:n}=N(),r=t(`progress`),a=t(`duration`),c=()=>{},l=e=>n({progress:Array.isArray(e)?e[0]:e});return(e,t)=>(m(),s(`div`,P,[i(o(y),{modelValue:o(r),"onUpdate:modelValue":t[0]||=e=>h(r)?r.value=e:null,"show-tooltip":!1,min:0,max:o(a),onChange:l,onInput:c},null,8,[`modelValue`,`max`])]))}}),I={class:`flex player-song`},L=[`src`],R={class:`ml-2 text-xs flex flex-col justify-between`},z={class:`w-52 2xl:w-96 cursor-pointer truncate`},ee={class:`flex`},B={class:`ml-2 text-dc`},V=g({__name:`PlayerSong`,setup(e){let{audio:n,patchAudio:i}=N(),a=null,c=null,d=()=>{if(a){try{a.pause()}catch{}a.src=``,a=null}c&&=(c.abort(),null)};return u(n,(e,t)=>{if(e?.audio_url!==t?.audio_url){if(d(),!e?.audio_url)return;let t=new Audio(e.audio_url);a=t,c=new AbortController;let{signal:n}=c;e.state===`playing`?t.play().catch(()=>{}):t.pause(),t.addEventListener(`loadedmetadata`,()=>{t.currentTime=0},{signal:n}),t.addEventListener(`timeupdate`,()=>{i({progress:t.currentTime})},{signal:n}),i({object:t})}else e?.progress!==t?.progress&&e?.object&&Math.abs(e.progress-e.object.currentTime)>2?e.object.currentTime=e.progress:e?.state!==t?.state&&e?.object&&(e.state===`playing`?e.object.play().catch(()=>{}):e.object.pause());e?.volume!==t?.volume&&e?.object&&(e.object.volume=e.volume/100)}),l(d),(e,i)=>(m(),s(`div`,I,[t(`img`,{alt:``,class:`w-11 h-11 rounded`,src:o(n)?.image_url||o(`/assets/disk-XFRmVAfp.png`)},null,8,L),t(`div`,R,[t(`div`,z,[t(`div`,ee,[t(`span`,null,r(o(n)?.title||`Music`),1),t(`span`,B,`- `+r(o(n)?.style||`SmallRuralDog`),1)])])])]))}}),H={class:`flex justify-end items-center gap-x-2.5`},U={class:`text-xs`},W=g({__name:`PlayerAction`,setup(e){let{field:n}=N(),i=n(`progress`),a=n(`duration`);return(e,n)=>(m(),s(`div`,H,[t(`span`,U,r(o(O)(o(i)))+` / `+r(o(O)(o(a))),1)]))}}),G={class:`player-volume flex flex-col items-center pt-2`},K={class:`text-sm mt-3`},q=g({__name:`PlayerVolumeSlider`,setup(e){let{namespace:n,store:a,field:c}=N(),l=c(`volume`),u=c(`muted`),d=e=>a.dispatch(`${n}/setVolume`,Array.isArray(e)?e[0]:e);return(e,n)=>(m(),s(`div`,G,[i(o(y),{modelValue:o(l),"onUpdate:modelValue":n[0]||=e=>h(l)?l.value=e:null,vertical:``,height:`100px`,"show-tooltip":!1,max:100,min:0,size:`small`,disabled:o(u),onInput:d},null,8,[`modelValue`,`disabled`]),t(`div`,K,r(o(l)),1)]))}}),J={class:`flex items-center justify-center gap-x-3`},Y=[`disabled`,`aria-label`,`title`],X=[`aria-label`,`title`],Z=[`aria-label`,`title`],Q=[`disabled`,`aria-label`,`title`],$=[`aria-label`,`title`],te=T(g({__name:`PlayerController`,setup(e){let{audio:r,dispatchAudio:c,tracks:l,currentIndex:u,playAdjacent:p}=N(),h=d(()=>l.value.length>1),g=d(()=>u.value>0),_=d(()=>u.value!==-1&&u.value<l.value.length-1),y=()=>c({state:r.value?.state===`playing`?`paused`:`playing`});return(e,c)=>(m(),s(`div`,J,[h.value?(m(),s(`button`,{key:0,type:`button`,class:n([`player-control player-control--small cursor-pointer transition-opacity`,g.value?`text-[var(--el-text-color-regular)]`:`opacity-30 cursor-not-allowed`]),disabled:!g.value,"aria-label":e.$t(`common.player.previous`),title:e.$t(`common.player.previous`),onClick:c[0]||=e=>g.value&&o(p)(-1)},[i(o(b),{size:`1em`,"aria-hidden":`true`,focusable:`false`})],10,Y)):a(``,!0),o(r)?.state===`playing`?(m(),s(`button`,{key:1,type:`button`,class:`player-control player-control--main text-[var(--el-color-primary)] cursor-pointer`,"aria-label":e.$t(`common.player.pause`),title:e.$t(`common.player.pause`),onClick:y},[i(o(S),{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,X)):(m(),s(`button`,{key:2,type:`button`,class:`player-control player-control--main text-[var(--el-color-primary)] cursor-pointer`,"aria-label":e.$t(`common.player.play`),title:e.$t(`common.player.play`),onClick:y},[i(o(C),{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Z)),h.value?(m(),s(`button`,{key:3,type:`button`,class:n([`player-control player-control--small cursor-pointer transition-opacity`,_.value?`text-[var(--el-text-color-regular)]`:`opacity-30 cursor-not-allowed`]),disabled:!_.value,"aria-label":e.$t(`common.player.next`),title:e.$t(`common.player.next`),onClick:c[1]||=e=>_.value&&o(p)(1)},[i(o(x),{size:`1em`,"aria-hidden":`true`,focusable:`false`})],10,Q)):a(``,!0),i(o(v),{placement:`top`,width:`50px`,trigger:`click`},{reference:f(()=>[t(`button`,{type:`button`,class:`player-control player-control--volume cursor-pointer`,"aria-label":e.$t(`common.player.volume`),title:e.$t(`common.player.volume`)},[i(o(w),{"stroke-width":2,size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,$)]),default:f(()=>[i(q)]),_:1})]))}}),[[`__scopeId`,`data-v-f66c5f86`]]),ne={class:`flex flex-col items-stretch h-20`},re={class:`flex grow px-5 items-center`},ie={class:`flex-1`},ae={class:`flex-1`},oe={class:`flex-1`},se=g({__name:`Player`,props:{namespace:{},tracks:{}},setup(e){let n=e;return p(A,n.namespace),p(j,d(()=>n.tracks??[])),(e,n)=>(m(),s(`div`,ne,[i(F),t(`div`,re,[t(`div`,ie,[i(V)]),t(`div`,ae,[i(te)]),t(`div`,oe,[i(W)])])]))}});export{D as i,k as n,O as r,se as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as e,N as t,Q as n,Y as r,at as i,tt as a,wt as o,z as s}from"./vendor-chart-Dw-P17PN.js";import{t as c}from"./Navigator-
|
|
1
|
+
import{L as e,N as t,Q as n,Y as r,at as i,tt as a,wt as o,z as s}from"./vendor-chart-Dw-P17PN.js";import{t as c}from"./Navigator-CSJ0YFuP.js";import{O as l}from"./index-C_sjkBHo.js";var u={class:`poivelle-shell`},d=l(s({__name:`Poivelle`,setup(s){let l=o(typeof window<`u`&&window.innerWidth<768),d=()=>{l.value=window.innerWidth<768};return n(()=>window.addEventListener(`resize`,d)),r(()=>window.removeEventListener(`resize`,d)),(n,r)=>{let o=i(`router-view`);return a(),t(`div`,u,[e(o,{class:`poivelle-view`}),e(c,{class:`poivelle-navigator`,direction:l.value?`row`:`column`},null,8,[`direction`])])}}}),[[`__scopeId`,`data-v-e1f67605`]]);export{d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,C as t,Gt 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,p as d,qt as f,rt as p,tt as m,z as h}from"./vendor-chart-Dw-P17PN.js";import{t as g}from"./chevron-down-B-FxpwU9.js";import{t as _}from"./info-D9qSu1pE.js";import{t as v}from"./mic-DlTpLTkf.js";import{Ii as y,Mi as b,Ni as x,Pi as S,da as C}from"./constants-DJHV7KrP.js";import{O as w,bi as T,yi as E,z as D}from"./index-BubtY8Qx.js";var O=T(`captions`,[[`rect`,{width:`18`,height:`14`,x:`3`,y:`5`,rx:`2`,ry:`2`,key:`12ruh7`}],[`path`,{d:`M7 15h4M15 15h2M7 11h2M13 11h4`,key:`1ueiar`}]]),k=T(`mic-off`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M15 9.34V5a3 3 0 0 0-5.68-1.33`,key:`1gzdoj`}],[`path`,{d:`M16.95 16.95A7 7 0 0 1 5 12v-2`,key:`cqa7eg`}],[`path`,{d:`M18.89 13.23A7 7 0 0 0 19 12v-2`,key:`16hl24`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v3a3 3 0 0 0 5.12 2.12`,key:`r2i35w`}]]),A=class{token;model;handlers;voice;ws;audioCtx;micStream;micNode;workletNode;analyser;levelRaf=0;running=!1;playHead=0;activeSources=[];disposed=!1;suppressAudio=!1;aiResponding=!1;constructor(e,t,n,r=x){this.token=e,this.model=t,this.handlers=n,this.voice=r}get isRunning(){return this.running}async start(){this.handlers.onStatus?.(`connecting`);let e=window.AudioContext||window.webkitAudioContext;if(this.audioCtx=new e({sampleRate:S}),await this.audioCtx.audioWorklet.addModule(`/recorder-worklet.js`),this.disposed||(this.micStream=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}}),this.disposed))return this.teardownAudio();this.micNode=this.audioCtx.createMediaStreamSource(this.micStream),this.workletNode=new AudioWorkletNode(this.audioCtx,`recorder-processor`),this.micNode.connect(this.workletNode),this.analyser=this.audioCtx.createAnalyser(),this.analyser.fftSize=256,this.micNode.connect(this.analyser),this.startLevelLoop();let t=this.audioCtx.createGain();t.gain.value=0,this.workletNode.connect(t).connect(this.audioCtx.destination);let n=`${C}?model=${encodeURIComponent(this.model)}&voice=${encodeURIComponent(this.voice)}`;this.ws=new WebSocket(n,[`realtime`,`acedata-token.${this.token}`]),this.ws.onopen=()=>{if(this.disposed){this.ws?.close();return}this.running=!0,this.handlers.onStatus?.(`connected`)},this.ws.onclose=()=>{this.handlers.onStatus?.(`disconnected`),this.teardownAudio(),this.running=!1},this.ws.onerror=()=>this.handlers.onStatus?.(`error`),this.ws.onmessage=e=>this.onServerEvent(e),this.workletNode.port.onmessage=e=>{!this.ws||this.ws.readyState!==WebSocket.OPEN||this.ws.send(JSON.stringify({type:`input_audio_buffer.append`,audio:j(e.data)}))}}setMuted(e){this.micStream?.getAudioTracks().forEach(t=>t.enabled=!e)}startLevelLoop(){let e=new Uint8Array(this.analyser?this.analyser.fftSize:0),t=0,n=()=>{if(this.disposed||!this.analyser)return;this.analyser.getByteTimeDomainData(e);let r=0;for(let t=0;t<e.length;t++){let n=(e[t]-128)/128;r+=n*n}let i=Math.sqrt(r/e.length),a=Math.min(1,i*3.4);t=t*.82+a*.18,this.handlers.onAudioLevel?.(t),this.levelRaf=requestAnimationFrame(n)};this.levelRaf=requestAnimationFrame(n)}stop(){this.disposed=!0,this.ws&&(this.ws.readyState===WebSocket.OPEN||this.ws.readyState===WebSocket.CONNECTING)&&this.ws.close(),this.teardownAudio(),this.running=!1,this.handlers.onStatus?.(`disconnected`)}send(e){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify(e))}onServerEvent(e){let t;try{t=JSON.parse(e.data)}catch{return}switch(t.type){case`session.created`:case`session.updated`:break;case`input_audio_buffer.speech_started`:this.stopPlayback(),this.aiResponding&&this.send({type:`response.cancel`}),this.suppressAudio=!0,this.handlers.onUserSpeechStarted?.();break;case`conversation.item.input_audio_transcription.completed`:this.handlers.onUserTranscript?.(t.transcript||``);break;case`response.created`:this.aiResponding=!0,this.suppressAudio=!1,this.handlers.onAiResponseStart?.();break;case`response.done`:this.aiResponding=!1;break;case`response.output_audio.delta`:case`response.audio.delta`:t.delta&&!this.suppressAudio&&this.enqueuePcm16(t.delta);break;case`response.output_audio_transcript.delta`:case`response.audio_transcript.delta`:t.delta&&this.handlers.onAiTranscriptDelta?.(t.delta);break;case`error`:{let e=t.error||{},n=String(e.code||``),r=String(e.message||``);if(n===`response_cancel_not_active`||/no active response/i.test(r))break;this.handlers.onError?.(r||`realtime error`);break}default:break}}enqueuePcm16(e){if(!this.audioCtx)return;let t=M(e),n=new Int16Array(t);if(n.length===0)return;let r=new Float32Array(n.length);for(let e=0;e<n.length;e++)r[e]=n[e]/32768;let i=this.audioCtx.createBuffer(1,r.length,S);i.getChannelData(0).set(r);let a=this.audioCtx.createBufferSource();a.buffer=i,a.connect(this.audioCtx.destination),this.analyser&&a.connect(this.analyser);let o=this.audioCtx.currentTime;this.playHead<o&&(this.playHead=o+.02),a.start(this.playHead),this.playHead+=i.duration,this.activeSources.push(a),a.onended=()=>{this.activeSources=this.activeSources.filter(e=>e!==a)}}stopPlayback(){for(let e of this.activeSources)try{e.onended=null,e.stop()}catch{}this.activeSources=[],this.playHead=0}teardownAudio(){try{this.levelRaf&&cancelAnimationFrame(this.levelRaf),this.workletNode&&(this.workletNode.port.onmessage=null),this.micStream&&this.micStream.getTracks().forEach(e=>e.stop()),this.stopPlayback(),this.audioCtx&&this.audioCtx.close()}catch{}this.levelRaf=0,this.handlers.onAudioLevel?.(0),this.micStream=this.micNode=this.workletNode=this.audioCtx=this.analyser=void 0}};function j(e){let t=new Uint8Array(e),n=``,r=32768;for(let e=0;e<t.length;e+=r)n+=String.fromCharCode.apply(null,Array.from(t.subarray(e,e+r)));return btoa(n)}function M(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n.buffer}var N=`nexior.realtime.voice`,P=h({name:`RealtimeCall`,components:{CaptionsIcon:O,CloseIcon:E,ExpandDownIcon:g,InfoIcon:_,MicrophoneIcon:v,MicrophoneOffIcon:k},data(){return{client:void 0,status:`disconnected`,connecting:!1,provisioning:!0,running:!1,aiSpeaking:!1,userText:``,aiText:``,errorMsg:``,level:0,muted:!1,captionsOn:!1,showInfo:!1,voice:x,voices:[...y],voiceMenuOpen:!1,callSeq:0}},computed:{token(){return this.$store.state.realtime?.credential?.token},canCall(){return!!this.token},modelName(){return b},orbScale(){return 1+this.level*.16},haloStyle(){let e=this.running?this.level:0;return{transform:`scale(${1+e*.7})`,opacity:`${.16+e*.5}`}},orbClass(){return{speaking:this.aiSpeaking,live:this.running,idle:!this.running}},captionText(){return this.aiText?this.aiText:this.running&&!this.userText?this.$t(`realtime.listening`):``},stageText(){return this.errorMsg?this.errorMsg:this.provisioning||this.connecting?this.$t(`realtime.status.connecting`):this.running?this.aiSpeaking?this.$t(`realtime.speaking`):this.$t(`realtime.listening`):this.$t(`realtime.start`)},voiceLabel(){return this.labelOf(this.voice)}},async mounted(){try{let e=localStorage.getItem(N);e&&this.voices.includes(e)&&(this.voice=e)}catch{}this.voices.includes(this.voice)||(this.voice=x),this.provisioning=!0;try{await this.$store.dispatch(`realtime/init`)}finally{this.provisioning=!1}this.canCall&&this.startCall()},beforeUnmount(){this.client?.stop()},methods:{async startCall(){if(!this.token||this.connecting||this.running)return;let e=++this.callSeq,t=()=>e===this.callSeq;this.errorMsg=``,this.userText=``,this.aiText=``,this.connecting=!0;let n=new A(this.token,b,{onStatus:e=>{t()&&(this.status=e,this.running=e===`connecting`||e===`connected`,(e===`connected`||e===`disconnected`||e===`error`)&&(this.connecting=!1),this.running||(this.level=0))},onUserSpeechStarted:()=>{t()&&(this.aiSpeaking=!1,this.errorMsg=``)},onUserTranscript:e=>{t()&&(this.userText=e)},onAiResponseStart:()=>{t()&&(this.aiText=``,this.aiSpeaking=!0,this.errorMsg=``)},onAiTranscriptDelta:e=>{t()&&(this.aiText+=e)},onAudioLevel:e=>{t()&&(this.level=e)},onError:e=>{t()&&(this.errorMsg=e)}},this.voice);this.client=n;try{if(await n.start(),!t()||this.client!==n)return;n.setMuted(this.muted)}catch(e){if(n.stop(),!t()||this.client!==n)return;this.connecting=!1,this.running=!1,this.errorMsg=e?.message||this.$t(`realtime.startFailed`)}},toggleMute(){this.muted=!this.muted,this.client?.setMuted(this.muted)},toggleCaptions(){this.captionsOn=!this.captionsOn},labelOf(e){let t=e||`alloy`;return t.charAt(0).toUpperCase()+t.slice(1)},selectVoice(e){if(this.voiceMenuOpen=!1,e!==this.voice){this.voice=e;try{localStorage.setItem(N,e)}catch{}(this.running||this.connecting)&&this.reconnect()}},reconnect(){let e=this.client;this.client=void 0,this.callSeq++,this.running=!1,this.connecting=!1,this.aiSpeaking=!1,this.level=0,this.userText=``,this.aiText=``,this.errorMsg=``,e?.stop(),this.$nextTick(()=>this.startCall())},onOrbTap(){!this.running&&!this.connecting&&this.startCall()},endCall(){this.client?.stop(),this.running=!1,this.aiSpeaking=!1,this.level=0,this.goBack()},goBack(){this.client?.stop(),this.$router.push({name:D})}}}),F={class:`rtc-top`},I={class:`rtc-top-left`},L=[`title`,`aria-label`],ee={class:`voice-pick`},R={class:`voice-name`},z={key:0,class:`voice-menu`},B=[`onClick`],V={class:`rtc-top-right`},H=[`title`,`aria-label`],U=[`title`,`aria-label`],W={class:`rtc-stage`},G={key:0,class:`rtc-info`},K={key:0,class:`rtc-captions`},q={key:0,class:`cap user`},J={class:`cap ai`},Y={class:`rtc-controls`},X=[`title`,`aria-label`],Z=[`title`,`aria-label`],Q=[`title`,`aria-label`];function $(h,g,_,v,y,b){let x=c(`expand-down-icon`),S=c(`info-icon`),C=c(`captions-icon`),w=c(`microphone-off-icon`),T=c(`microphone-icon`),E=c(`close-icon`);return m(),o(`div`,{class:n([`rtc`,{"is-captions":h.captionsOn,"is-live":h.running}])},[e(`header`,F,[e(`div`,I,[e(`button`,{class:`ic`,title:h.$t(`realtime.title`),"aria-label":h.$t(`realtime.title`),onClick:g[0]||=(...e)=>h.goBack&&h.goBack(...e)},[i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,L),e(`div`,ee,[e(`button`,{class:n([`voice-chip`,{on:h.voiceMenuOpen}]),onClick:g[1]||=t(e=>h.voiceMenuOpen=!h.voiceMenuOpen,[`stop`])},[e(`span`,R,r(h.voiceLabel),1),i(x,{class:`voice-caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})],2),h.voiceMenuOpen?(m(),o(`ul`,z,[(m(!0),o(s,null,p(h.voices,e=>(m(),o(`li`,{key:e,class:n({sel:e===h.voice}),onClick:t=>h.selectVoice(e)},r(h.labelOf(e)),11,B))),128))])):a(``,!0)])]),e(`div`,V,[e(`button`,{class:n([`ic`,{on:h.showInfo}]),title:h.$t(`realtime.title`),"aria-label":h.$t(`realtime.title`),onClick:g[2]||=e=>h.showInfo=!h.showInfo},[i(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],10,H),e(`button`,{class:n([`ic`,{on:h.captionsOn}]),title:h.$t(`realtime.captions`),"aria-label":h.$t(`realtime.captions`),onClick:g[3]||=(...e)=>h.toggleCaptions&&h.toggleCaptions(...e)},[i(C,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],10,U)])]),h.voiceMenuOpen?(m(),o(`div`,{key:0,class:`voice-backdrop`,onClick:g[4]||=e=>h.voiceMenuOpen=!1})):a(``,!0),e(`main`,W,[e(`div`,{class:`orb-stage`,onClick:g[5]||=(...e)=>h.onOrbTap&&h.onOrbTap(...e)},[e(`div`,{class:`orb-halo`,style:f(h.haloStyle)},null,4),e(`div`,{class:n([`orb-breathe`,{paused:!h.running}])},[e(`div`,{class:n([`orb`,h.orbClass]),style:f({transform:`scale(${h.orbScale})`})},[...g[9]||=[e(`span`,{class:`cloud c1`},null,-1),e(`span`,{class:`cloud c2`},null,-1),e(`span`,{class:`cloud c3`},null,-1),e(`span`,{class:`sheen`},null,-1)]],6)],2)]),i(d,{name:`fade`},{default:u(()=>[h.showInfo&&!h.captionsOn?(m(),o(`p`,G,r(h.modelName),1)):a(``,!0)]),_:1}),h.captionsOn?(m(),o(`div`,K,[h.userText?(m(),o(`p`,q,r(h.userText),1)):a(``,!0),e(`p`,J,r(h.captionText),1)])):(m(),o(`p`,{key:1,class:n([`rtc-status`,{err:!!h.errorMsg}])},r(h.stageText),3))]),e(`footer`,Y,[e(`button`,{class:n([`ctl`,{active:h.muted}]),title:h.muted?h.$t(`realtime.unmute`):h.$t(`realtime.mute`),"aria-label":h.muted?h.$t(`realtime.unmute`):h.$t(`realtime.mute`),onClick:g[6]||=(...e)=>h.toggleMute&&h.toggleMute(...e)},[h.muted?(m(),l(w,{key:0,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(m(),l(T,{key:1,size:`1em`,"aria-hidden":`true`,focusable:`false`}))],10,X),e(`button`,{class:n([`ctl`,{active:h.captionsOn}]),title:h.$t(`realtime.captions`),"aria-label":h.$t(`realtime.captions`),onClick:g[7]||=(...e)=>h.toggleCaptions&&h.toggleCaptions(...e)},[i(C,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],10,Z),e(`button`,{class:`ctl end`,title:h.$t(`realtime.end`),"aria-label":h.$t(`realtime.end`),onClick:g[8]||=(...e)=>h.endCall&&h.endCall(...e)},[i(E,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Q)])],2)}var te=w(P,[[`render`,$],[`__scopeId`,`data-v-b55c144b`]]);export{te as default};
|
|
1
|
+
import{A as e,C as t,Gt 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,p as d,qt as f,rt as p,tt as m,z as h}from"./vendor-chart-Dw-P17PN.js";import{t as g}from"./chevron-down-BzsAsDSA.js";import{t as _}from"./info-BPaOsauW.js";import{t as v}from"./mic-BH3alSnw.js";import{Ii as y,Mi as b,Ni as x,Pi as S,da as C}from"./constants-D04Y0eol.js";import{O as w,bi as T,yi as E,z as D}from"./index-C_sjkBHo.js";var O=T(`captions`,[[`rect`,{width:`18`,height:`14`,x:`3`,y:`5`,rx:`2`,ry:`2`,key:`12ruh7`}],[`path`,{d:`M7 15h4M15 15h2M7 11h2M13 11h4`,key:`1ueiar`}]]),k=T(`mic-off`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M15 9.34V5a3 3 0 0 0-5.68-1.33`,key:`1gzdoj`}],[`path`,{d:`M16.95 16.95A7 7 0 0 1 5 12v-2`,key:`cqa7eg`}],[`path`,{d:`M18.89 13.23A7 7 0 0 0 19 12v-2`,key:`16hl24`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v3a3 3 0 0 0 5.12 2.12`,key:`r2i35w`}]]),A=class{token;model;handlers;voice;ws;audioCtx;micStream;micNode;workletNode;analyser;levelRaf=0;running=!1;playHead=0;activeSources=[];disposed=!1;suppressAudio=!1;aiResponding=!1;constructor(e,t,n,r=x){this.token=e,this.model=t,this.handlers=n,this.voice=r}get isRunning(){return this.running}async start(){this.handlers.onStatus?.(`connecting`);let e=window.AudioContext||window.webkitAudioContext;if(this.audioCtx=new e({sampleRate:S}),await this.audioCtx.audioWorklet.addModule(`/recorder-worklet.js`),this.disposed||(this.micStream=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}}),this.disposed))return this.teardownAudio();this.micNode=this.audioCtx.createMediaStreamSource(this.micStream),this.workletNode=new AudioWorkletNode(this.audioCtx,`recorder-processor`),this.micNode.connect(this.workletNode),this.analyser=this.audioCtx.createAnalyser(),this.analyser.fftSize=256,this.micNode.connect(this.analyser),this.startLevelLoop();let t=this.audioCtx.createGain();t.gain.value=0,this.workletNode.connect(t).connect(this.audioCtx.destination);let n=`${C}?model=${encodeURIComponent(this.model)}&voice=${encodeURIComponent(this.voice)}`;this.ws=new WebSocket(n,[`realtime`,`acedata-token.${this.token}`]),this.ws.onopen=()=>{if(this.disposed){this.ws?.close();return}this.running=!0,this.handlers.onStatus?.(`connected`)},this.ws.onclose=()=>{this.handlers.onStatus?.(`disconnected`),this.teardownAudio(),this.running=!1},this.ws.onerror=()=>this.handlers.onStatus?.(`error`),this.ws.onmessage=e=>this.onServerEvent(e),this.workletNode.port.onmessage=e=>{!this.ws||this.ws.readyState!==WebSocket.OPEN||this.ws.send(JSON.stringify({type:`input_audio_buffer.append`,audio:j(e.data)}))}}setMuted(e){this.micStream?.getAudioTracks().forEach(t=>t.enabled=!e)}startLevelLoop(){let e=new Uint8Array(this.analyser?this.analyser.fftSize:0),t=0,n=()=>{if(this.disposed||!this.analyser)return;this.analyser.getByteTimeDomainData(e);let r=0;for(let t=0;t<e.length;t++){let n=(e[t]-128)/128;r+=n*n}let i=Math.sqrt(r/e.length),a=Math.min(1,i*3.4);t=t*.82+a*.18,this.handlers.onAudioLevel?.(t),this.levelRaf=requestAnimationFrame(n)};this.levelRaf=requestAnimationFrame(n)}stop(){this.disposed=!0,this.ws&&(this.ws.readyState===WebSocket.OPEN||this.ws.readyState===WebSocket.CONNECTING)&&this.ws.close(),this.teardownAudio(),this.running=!1,this.handlers.onStatus?.(`disconnected`)}send(e){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify(e))}onServerEvent(e){let t;try{t=JSON.parse(e.data)}catch{return}switch(t.type){case`session.created`:case`session.updated`:break;case`input_audio_buffer.speech_started`:this.stopPlayback(),this.aiResponding&&this.send({type:`response.cancel`}),this.suppressAudio=!0,this.handlers.onUserSpeechStarted?.();break;case`conversation.item.input_audio_transcription.completed`:this.handlers.onUserTranscript?.(t.transcript||``);break;case`response.created`:this.aiResponding=!0,this.suppressAudio=!1,this.handlers.onAiResponseStart?.();break;case`response.done`:this.aiResponding=!1;break;case`response.output_audio.delta`:case`response.audio.delta`:t.delta&&!this.suppressAudio&&this.enqueuePcm16(t.delta);break;case`response.output_audio_transcript.delta`:case`response.audio_transcript.delta`:t.delta&&this.handlers.onAiTranscriptDelta?.(t.delta);break;case`error`:{let e=t.error||{},n=String(e.code||``),r=String(e.message||``);if(n===`response_cancel_not_active`||/no active response/i.test(r))break;this.handlers.onError?.(r||`realtime error`);break}default:break}}enqueuePcm16(e){if(!this.audioCtx)return;let t=M(e),n=new Int16Array(t);if(n.length===0)return;let r=new Float32Array(n.length);for(let e=0;e<n.length;e++)r[e]=n[e]/32768;let i=this.audioCtx.createBuffer(1,r.length,S);i.getChannelData(0).set(r);let a=this.audioCtx.createBufferSource();a.buffer=i,a.connect(this.audioCtx.destination),this.analyser&&a.connect(this.analyser);let o=this.audioCtx.currentTime;this.playHead<o&&(this.playHead=o+.02),a.start(this.playHead),this.playHead+=i.duration,this.activeSources.push(a),a.onended=()=>{this.activeSources=this.activeSources.filter(e=>e!==a)}}stopPlayback(){for(let e of this.activeSources)try{e.onended=null,e.stop()}catch{}this.activeSources=[],this.playHead=0}teardownAudio(){try{this.levelRaf&&cancelAnimationFrame(this.levelRaf),this.workletNode&&(this.workletNode.port.onmessage=null),this.micStream&&this.micStream.getTracks().forEach(e=>e.stop()),this.stopPlayback(),this.audioCtx&&this.audioCtx.close()}catch{}this.levelRaf=0,this.handlers.onAudioLevel?.(0),this.micStream=this.micNode=this.workletNode=this.audioCtx=this.analyser=void 0}};function j(e){let t=new Uint8Array(e),n=``,r=32768;for(let e=0;e<t.length;e+=r)n+=String.fromCharCode.apply(null,Array.from(t.subarray(e,e+r)));return btoa(n)}function M(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n.buffer}var N=`nexior.realtime.voice`,P=h({name:`RealtimeCall`,components:{CaptionsIcon:O,CloseIcon:E,ExpandDownIcon:g,InfoIcon:_,MicrophoneIcon:v,MicrophoneOffIcon:k},data(){return{client:void 0,status:`disconnected`,connecting:!1,provisioning:!0,running:!1,aiSpeaking:!1,userText:``,aiText:``,errorMsg:``,level:0,muted:!1,captionsOn:!1,showInfo:!1,voice:x,voices:[...y],voiceMenuOpen:!1,callSeq:0}},computed:{token(){return this.$store.state.realtime?.credential?.token},canCall(){return!!this.token},modelName(){return b},orbScale(){return 1+this.level*.16},haloStyle(){let e=this.running?this.level:0;return{transform:`scale(${1+e*.7})`,opacity:`${.16+e*.5}`}},orbClass(){return{speaking:this.aiSpeaking,live:this.running,idle:!this.running}},captionText(){return this.aiText?this.aiText:this.running&&!this.userText?this.$t(`realtime.listening`):``},stageText(){return this.errorMsg?this.errorMsg:this.provisioning||this.connecting?this.$t(`realtime.status.connecting`):this.running?this.aiSpeaking?this.$t(`realtime.speaking`):this.$t(`realtime.listening`):this.$t(`realtime.start`)},voiceLabel(){return this.labelOf(this.voice)}},async mounted(){try{let e=localStorage.getItem(N);e&&this.voices.includes(e)&&(this.voice=e)}catch{}this.voices.includes(this.voice)||(this.voice=x),this.provisioning=!0;try{await this.$store.dispatch(`realtime/init`)}finally{this.provisioning=!1}this.canCall&&this.startCall()},beforeUnmount(){this.client?.stop()},methods:{async startCall(){if(!this.token||this.connecting||this.running)return;let e=++this.callSeq,t=()=>e===this.callSeq;this.errorMsg=``,this.userText=``,this.aiText=``,this.connecting=!0;let n=new A(this.token,b,{onStatus:e=>{t()&&(this.status=e,this.running=e===`connecting`||e===`connected`,(e===`connected`||e===`disconnected`||e===`error`)&&(this.connecting=!1),this.running||(this.level=0))},onUserSpeechStarted:()=>{t()&&(this.aiSpeaking=!1,this.errorMsg=``)},onUserTranscript:e=>{t()&&(this.userText=e)},onAiResponseStart:()=>{t()&&(this.aiText=``,this.aiSpeaking=!0,this.errorMsg=``)},onAiTranscriptDelta:e=>{t()&&(this.aiText+=e)},onAudioLevel:e=>{t()&&(this.level=e)},onError:e=>{t()&&(this.errorMsg=e)}},this.voice);this.client=n;try{if(await n.start(),!t()||this.client!==n)return;n.setMuted(this.muted)}catch(e){if(n.stop(),!t()||this.client!==n)return;this.connecting=!1,this.running=!1,this.errorMsg=e?.message||this.$t(`realtime.startFailed`)}},toggleMute(){this.muted=!this.muted,this.client?.setMuted(this.muted)},toggleCaptions(){this.captionsOn=!this.captionsOn},labelOf(e){let t=e||`alloy`;return t.charAt(0).toUpperCase()+t.slice(1)},selectVoice(e){if(this.voiceMenuOpen=!1,e!==this.voice){this.voice=e;try{localStorage.setItem(N,e)}catch{}(this.running||this.connecting)&&this.reconnect()}},reconnect(){let e=this.client;this.client=void 0,this.callSeq++,this.running=!1,this.connecting=!1,this.aiSpeaking=!1,this.level=0,this.userText=``,this.aiText=``,this.errorMsg=``,e?.stop(),this.$nextTick(()=>this.startCall())},onOrbTap(){!this.running&&!this.connecting&&this.startCall()},endCall(){this.client?.stop(),this.running=!1,this.aiSpeaking=!1,this.level=0,this.goBack()},goBack(){this.client?.stop(),this.$router.push({name:D})}}}),F={class:`rtc-top`},I={class:`rtc-top-left`},L=[`title`,`aria-label`],ee={class:`voice-pick`},R={class:`voice-name`},z={key:0,class:`voice-menu`},B=[`onClick`],V={class:`rtc-top-right`},H=[`title`,`aria-label`],U=[`title`,`aria-label`],W={class:`rtc-stage`},G={key:0,class:`rtc-info`},K={key:0,class:`rtc-captions`},q={key:0,class:`cap user`},J={class:`cap ai`},Y={class:`rtc-controls`},X=[`title`,`aria-label`],Z=[`title`,`aria-label`],Q=[`title`,`aria-label`];function $(h,g,_,v,y,b){let x=c(`expand-down-icon`),S=c(`info-icon`),C=c(`captions-icon`),w=c(`microphone-off-icon`),T=c(`microphone-icon`),E=c(`close-icon`);return m(),o(`div`,{class:n([`rtc`,{"is-captions":h.captionsOn,"is-live":h.running}])},[e(`header`,F,[e(`div`,I,[e(`button`,{class:`ic`,title:h.$t(`realtime.title`),"aria-label":h.$t(`realtime.title`),onClick:g[0]||=(...e)=>h.goBack&&h.goBack(...e)},[i(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,L),e(`div`,ee,[e(`button`,{class:n([`voice-chip`,{on:h.voiceMenuOpen}]),onClick:g[1]||=t(e=>h.voiceMenuOpen=!h.voiceMenuOpen,[`stop`])},[e(`span`,R,r(h.voiceLabel),1),i(x,{class:`voice-caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})],2),h.voiceMenuOpen?(m(),o(`ul`,z,[(m(!0),o(s,null,p(h.voices,e=>(m(),o(`li`,{key:e,class:n({sel:e===h.voice}),onClick:t=>h.selectVoice(e)},r(h.labelOf(e)),11,B))),128))])):a(``,!0)])]),e(`div`,V,[e(`button`,{class:n([`ic`,{on:h.showInfo}]),title:h.$t(`realtime.title`),"aria-label":h.$t(`realtime.title`),onClick:g[2]||=e=>h.showInfo=!h.showInfo},[i(S,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],10,H),e(`button`,{class:n([`ic`,{on:h.captionsOn}]),title:h.$t(`realtime.captions`),"aria-label":h.$t(`realtime.captions`),onClick:g[3]||=(...e)=>h.toggleCaptions&&h.toggleCaptions(...e)},[i(C,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],10,U)])]),h.voiceMenuOpen?(m(),o(`div`,{key:0,class:`voice-backdrop`,onClick:g[4]||=e=>h.voiceMenuOpen=!1})):a(``,!0),e(`main`,W,[e(`div`,{class:`orb-stage`,onClick:g[5]||=(...e)=>h.onOrbTap&&h.onOrbTap(...e)},[e(`div`,{class:`orb-halo`,style:f(h.haloStyle)},null,4),e(`div`,{class:n([`orb-breathe`,{paused:!h.running}])},[e(`div`,{class:n([`orb`,h.orbClass]),style:f({transform:`scale(${h.orbScale})`})},[...g[9]||=[e(`span`,{class:`cloud c1`},null,-1),e(`span`,{class:`cloud c2`},null,-1),e(`span`,{class:`cloud c3`},null,-1),e(`span`,{class:`sheen`},null,-1)]],6)],2)]),i(d,{name:`fade`},{default:u(()=>[h.showInfo&&!h.captionsOn?(m(),o(`p`,G,r(h.modelName),1)):a(``,!0)]),_:1}),h.captionsOn?(m(),o(`div`,K,[h.userText?(m(),o(`p`,q,r(h.userText),1)):a(``,!0),e(`p`,J,r(h.captionText),1)])):(m(),o(`p`,{key:1,class:n([`rtc-status`,{err:!!h.errorMsg}])},r(h.stageText),3))]),e(`footer`,Y,[e(`button`,{class:n([`ctl`,{active:h.muted}]),title:h.muted?h.$t(`realtime.unmute`):h.$t(`realtime.mute`),"aria-label":h.muted?h.$t(`realtime.unmute`):h.$t(`realtime.mute`),onClick:g[6]||=(...e)=>h.toggleMute&&h.toggleMute(...e)},[h.muted?(m(),l(w,{key:0,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(m(),l(T,{key:1,size:`1em`,"aria-hidden":`true`,focusable:`false`}))],10,X),e(`button`,{class:n([`ctl`,{active:h.captionsOn}]),title:h.$t(`realtime.captions`),"aria-label":h.$t(`realtime.captions`),onClick:g[7]||=(...e)=>h.toggleCaptions&&h.toggleCaptions(...e)},[i(C,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],10,Z),e(`button`,{class:`ctl end`,title:h.$t(`realtime.end`),"aria-label":h.$t(`realtime.end`),onClick:g[8]||=(...e)=>h.endCall&&h.endCall(...e)},[i(E,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Q)])],2)}var te=w(P,[[`render`,$],[`__scopeId`,`data-v-b55c144b`]]);export{te as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Jt as n,L as r,M as i,N as a,at as o,mt as s,tt as c,z as l}from"./vendor-chart-Dw-P17PN.js";import{t as u}from"./tooltip-
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Jt as n,L as r,M as i,N as a,at as o,mt as s,tt as c,z as l}from"./vendor-chart-Dw-P17PN.js";import{t as u}from"./tooltip-pUbjR2xu.js";import{t as d}from"./triangle-alert-BVAKaCSW.js";import{O as f}from"./index-C_sjkBHo.js";import{t as p}from"./ReportDialog-Di6DDJwG.js";var m=l({name:`ReportButton`,components:{WarningIcon:d,ElTooltip:u,ReportDialog:p},props:{service:{type:String,required:!0},targetId:{type:String,required:!1,default:``},snapshot:{type:Object,required:!1,default:void 0},showLabel:{type:Boolean,default:!1}},data(){return{visible:!1}},methods:{onOpen(){if(!this.$store.getters.authenticated){this.$store.dispatch(`login`,{redirect:this.$route.fullPath});return}this.visible=!0}}}),h={class:`report-entry`},g=[`aria-label`,`title`],_={key:0,class:`label`};function v(l,u,d,f,p,m){let v=o(`warning-icon`),y=o(`el-tooltip`),b=o(`report-dialog`);return c(),a(`span`,h,[r(y,{effect:`dark`,content:l.$t(`common.button.report`),placement:`top`},{default:s(()=>[e(`button`,{type:`button`,class:`btn-report`,"aria-label":l.$t(`common.button.report`),title:l.$t(`common.button.report`),onClick:u[0]||=t((...e)=>l.onOpen&&l.onOpen(...e),[`stop`])},[r(v,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),l.showLabel?(c(),a(`span`,_,n(l.$t(`common.button.report`)),1)):i(``,!0)],8,g)]),_:1},8,[`content`]),r(b,{visible:l.visible,"onUpdate:visible":u[1]||=e=>l.visible=e,service:l.service,"target-id":l.targetId,snapshot:l.snapshot},null,8,[`visible`,`service`,`target-id`,`snapshot`])])}var y=f(m,[[`render`,v],[`__scopeId`,`data-v-085d10be`]]);export{y as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,I as n,Jt as r,L as i,N as a,T as o,at as s,j as c,mt as l,rt as u,tt as d,z as f}from"./vendor-chart-Dw-P17PN.js";import{v as p}from"./models-
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,I as n,Jt as r,L as i,N as a,T as o,at as s,j as c,mt as l,rt as u,tt as d,z as f}from"./vendor-chart-Dw-P17PN.js";import{v as p}from"./models-ClsawnaQ.js";import{r as m,t as h}from"./radio-BNhFzeBO.js";import{Ei as g,Fi as _,O as v,Ui as y,kn as b}from"./index-C_sjkBHo.js";var x=[`sexual`,`violence`,`hate`,`child_safety`,`self_harm`,`deception`,`illegal`,`ip`,`other`],S=1e3,C=f({name:`ReportDialog`,components:{ElButton:_,ElDialog:g,ElInput:y,ElRadio:h,ElRadioGroup:m},props:{visible:{type:Boolean,default:!1},service:{type:String,required:!0},targetId:{type:String,required:!1,default:``},snapshot:{type:Object,required:!1,default:void 0}},emits:[`update:visible`],data(){return{submitting:!1,reason:``,detail:``,reasons:x}},watch:{visible(e){e&&(this.reason=``,this.detail=``)}},methods:{truncate(e){return typeof e==`string`&&e.length>S?`${e.slice(0,S)}…`:e},async onSubmit(){if(!this.reason){p.warning(this.$t(`common.message.reportReasonRequired`));return}this.submitting=!0;try{let e=this.snapshot?Object.fromEntries(Object.entries(this.snapshot).map(([e,t])=>[e,this.truncate(t)])):void 0;await b.create({service:this.service,target_id:this.targetId,reason:this.reason,detail:this.detail,snapshot:e}),this.$emit(`update:visible`,!1),p.success(this.$t(`common.message.reportSuccess`))}catch{p.error(this.$t(`common.message.reportFailed`))}finally{this.submitting=!1}}}}),w={class:`intro`};function T(f,p,m,h,g,_){let v=s(`el-radio`),y=s(`el-radio-group`),b=s(`el-input`),x=s(`el-button`),S=s(`el-dialog`);return d(),c(S,{"model-value":f.visible,title:f.$t(`common.title.reportContent`),width:`460`,"align-center":``,"append-to-body":``,class:`report-dialog`,"onUpdate:modelValue":p[3]||=e=>f.$emit(`update:visible`,e),onClick:p[4]||=t(()=>{},[`stop`])},{footer:l(()=>[i(x,{round:``,onClick:p[2]||=e=>f.$emit(`update:visible`,!1)},{default:l(()=>[n(r(f.$t(`common.button.cancel`)),1)]),_:1}),i(x,{type:`primary`,round:``,loading:f.submitting,onClick:f.onSubmit},{default:l(()=>[n(r(f.$t(`common.button.report`)),1)]),_:1},8,[`loading`,`onClick`])]),default:l(()=>[e(`p`,w,r(f.$t(`common.message.reportIntro`)),1),i(y,{modelValue:f.reason,"onUpdate:modelValue":p[0]||=e=>f.reason=e,class:`reasons`},{default:l(()=>[(d(!0),a(o,null,u(f.reasons,e=>(d(),c(v,{key:e,value:e,class:`reason`},{default:l(()=>[n(r(f.$t(`common.reportReason.${e}`)),1)]),_:2},1032,[`value`]))),128))]),_:1},8,[`modelValue`]),i(b,{modelValue:f.detail,"onUpdate:modelValue":p[1]||=e=>f.detail=e,type:`textarea`,rows:3,maxlength:`2000`,"show-word-limit":``,class:`detail`,placeholder:f.$t(`common.message.reportDetailPlaceholder`)},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`model-value`,`title`])}var E=v(C,[[`render`,T],[`__scopeId`,`data-v-7c270936`]]);export{E as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,S as c,T as l,at as u,j as d,mt as f,rt as p,tt as m,z as h}from"./vendor-chart-Dw-P17PN.js";import{n as g,r as ee,t as te}from"./select-
|
|
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,j as d,mt as f,rt as p,tt as m,z as h}from"./vendor-chart-Dw-P17PN.js";import{n as g,r as ee,t as te}from"./select-ChyQns32.js";import{t as ne}from"./time-picker-DE1ng7uG.js";import{n as re,t as _}from"./form-BdKMEyCR.js";import{t as v}from"./tooltip-pUbjR2xu.js";import{v as y}from"./models-ClsawnaQ.js";import{t as b}from"./card-IQwqnRJR.js";import{r as x,t as S}from"./radio-BNhFzeBO.js";import{t as ie}from"./drawer-CpQ_k9m7.js";import{t as C}from"./empty-C5KjRN0h.js";import{t as w}from"./input-number-DZm2a-qc.js";import{t as T}from"./skeleton-Dj_a_iIP.js";import{t as E}from"./switch-CI_r8TsE.js";import{t as D}from"./brain-fZab3hXA.js";import{t as O}from"./chevron-right-mC8jKx3p.js";import{t as k}from"./clock-Varrr0Bl.js";import{t as A}from"./copy-BWb_FWmO.js";import{t as j}from"./pencil-CHl88iig.js";import{t as ae}from"./play-CC2cYJj4.js";import{t as M}from"./plus-C2LaXZld.js";import{t as oe}from"./refresh-cw-C1aKOTkD.js";import{t as N}from"./trash-2-BfVLvlm9.js";import{t as P}from"./vendor-axios-Ck2ffRoh.js";import{Qi as F,Ri as I,ia as L}from"./constants-D04Y0eol.js";import{A as R,Ei as z,Fi as B,Ni as V,O as H,Ui as U,fi as W,k as G,mn as se,ui as K,xi as q}from"./index-C_sjkBHo.js";import{t as ce}from"./CopyToClipboard-D1PN1vgU.js";import{t as le}from"./pagination-BM4GJ-Sf.js";function J(e){let t=se();return{Authorization:`Bearer ${e}`,"Content-Type":`application/json`,...t?{"x-site-origin":t}:{}}}var Y=`${L}/aichat2/scheduled-tasks`,X=2e4,ue=3300;function de(e,t){return e.status!==`queued`&&e.status!==`running`?!1:t/1e3-e.scheduled_at<ue}function fe(e){let t=e?.response?.data;return t?.error===`skill_not_active`?t.detail??{kind:`skill`,slug:``,reason:`not_active`}:null}var Z=new class{async listTasks(e){let{data:t}=await P.post(Y,{action:`retrieve_batch`},{headers:J(e)});return t?.items??[]}async createTask(e,t,n=!1){let{data:r}=await P.post(Y,{action:`create`,...t,...n?{force:!0}:{}},{headers:J(e)});return r}async updateTask(e,t,n,r=!1){let{data:i}=await P.post(Y,{action:`update`,id:t,...n,...r?{force:!0}:{}},{headers:J(e)});return i}async deleteTask(e,t){await P.post(Y,{action:`delete`,id:t},{headers:J(e)})}async triggerTask(e,t){let{data:n}=await P.post(Y,{action:`trigger`,id:t},{headers:J(e)});return n??{}}async listRuns(e,t){let{data:n}=await P.post(Y,{action:`retrieve_runs`,id:t},{headers:J(e),timeout:X});return n?.items??[]}async listAllRuns(e,t={}){let{data:n}=await P.post(Y,{action:`retrieve_runs_batch`,...t},{headers:J(e),timeout:X});return{items:n?.items??[],count:n?.count??0}}async listAuthorizableSkills(e){let{data:t}=await P.post(Y,{action:`retrieve_authorizable_skills`},{headers:J(e)});return t?.items??[]}async listAuthorizableCapabilities(e){let{data:t}=await P.post(Y,{action:`retrieve_authorizable_skills`},{headers:J(e)});return{skills:t?.skills??t?.items??[],mcp_servers:t?.mcp_servers??[]}}},pe=[`UTC`,`Asia/Shanghai`,`Asia/Hong_Kong`,`Asia/Tokyo`,`Asia/Seoul`,`Asia/Singapore`,`Asia/Kolkata`,`Europe/London`,`Europe/Paris`,`Europe/Berlin`,`Europe/Moscow`,`America/New_York`,`America/Chicago`,`America/Denver`,`America/Los_Angeles`,`America/Toronto`,`America/Sao_Paulo`,`Australia/Sydney`,`Pacific/Auckland`];function me(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||`Asia/Shanghai`}catch{return`Asia/Shanghai`}}function he(e){if(!e?.trim())return!1;try{return new Intl.DateTimeFormat(`en-US`,{timeZone:e}).format(0),!0}catch{return!1}}function ge(e,t=new Date){try{let n=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`shortOffset`}).formatToParts(t).find(({type:e})=>e===`timeZoneName`)?.value;return!n||n===`GMT`?`UTC`:n.replace(`GMT`,`UTC`)}catch{return``}}function Q(e,t=new Date){let n=ge(e,t);return n?`${e} (${n})`:e}function _e(...e){let t=[];try{let e=Intl.supportedValuesOf;t=e?.(`timeZone`)??[]}catch{t=[]}return[...new Set([`UTC`,...e.filter(e=>!!e),...t,...pe])].filter(he).sort((e,t)=>e.localeCompare(t))}var $=me(),ve=50,ye=12*1e3,be=3,xe=h({name:`ScheduledTasks`,components:{AiIcon:D,ExpandRightIcon:O,PlayIcon:ae,TimeIcon:k,AddIcon:M,CopyIcon:A,DeleteIcon:N,EditIcon:j,RefreshIcon:oe,ElButton:B,ElCard:b,ElSkeleton:T,ElEmpty:C,ElSwitch:E,ElTag:V,ElTooltip:v,ElDrawer:ie,ElDialog:z,ElForm:_,ElFormItem:re,ElInput:U,ElSelect:ee,ElOption:te,ElOptionGroup:g,ElRadioGroup:x,ElRadio:S,ElTimePicker:ne,ElInputNumber:w,Pagination:le,CopyToClipboard:ce},data(){return{tasks:[],runs:[],activeTab:`tasks`,tabs:[`tasks`,`runs`],statusFilters:[`all`,`success`,`failed`,`indeterminate`,`skipped`,`running`,`queued`],allRuns:[],allRunsCount:0,allRunsLoading:!1,allRunsStatus:`all`,allRunsPage:1,allRunsPageSize:20,allRunsRequestId:0,loading:!1,runsLoading:!1,skillsLoading:!1,skillsInflight:null,saving:!1,showCreateDialog:!1,showRunHistory:!1,selectedTask:null,editingTask:null,authorizableSkills:[],authorizableMcpServers:[],triggeringId:``,weekdays:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],page:1,pageSize:6,runPage:1,runPageSize:8,runPollTimer:null,runPollInFlight:!1,runPollSeq:0,runPollFailures:0,runsRequestId:0,form:this.emptyForm(),deviceIdentity:null,localToolSpecs:[]}},computed:{canRunLocally(){return W()&&!!this.deviceIdentity},localUnavailableReason(){if(this.canRunLocally)return``;let e=K();return e===`ios`||e===`android`?this.$t(`chat.scheduledTasks.form.executionMobileUnsupported`):e===`web`?this.$t(`chat.scheduledTasks.form.executionWebUnsupported`):this.$t(`chat.scheduledTasks.form.executionDeviceUnavailable`)},token(){return this.$store.state.chat?.credential?.token},modelGroups(){let e=this.$store.state.site?.features??{};return I.filter(t=>e[t.name]?.enabled!==!1).map(e=>({...e,models:e.models.filter(e=>e.enabled!==!1)})).filter(e=>e.models.length>0)},pagedTasks(){let e=(this.page-1)*this.pageSize;return this.tasks.slice(e,e+this.pageSize)},pagedRuns(){let e=(this.runPage-1)*this.runPageSize;return this.runs.slice(e,e+this.runPageSize)},intervalMax(){return this.form.intervalUnit===`minute`?1440:this.form.intervalUnit===`hour`?720:365},schedulePreview(){try{return this.scheduleLabel(this.buildSchedule())}catch{return``}},timezoneOptions(){return _e($,this.form.timezone)},detectedTimezoneLabel(){return Q($)},selectedBrowserConnections(){let e=new Set(this.form.authorizedSkills);return this.authorizableSkills.filter(t=>e.has(t.slug)).flatMap(e=>e.browser_connections??[])},selectedBrowserSkills(){let e=new Set(this.form.authorizedSkills);return this.authorizableSkills.filter(t=>e.has(t.slug)&&t.browser_connections!==void 0)},selectedBrowserConnection(){return this.selectedBrowserConnections.find(e=>e.connection_id===this.form.browserConnectionId)},accountChoices(){let e=new Set(this.form.authorizedSkills),t=new Map;for(let n of this.authorizableSkills)if(e.has(n.slug))for(let[e,r]of Object.entries(n.connection_accounts??{})){if((r?.length??0)<2)continue;let n=r[0].connector_identifier||e;t.has(n)||t.set(n,{label:e,accounts:r})}return[...t.entries()].map(([e,{label:t,accounts:n}])=>({identifier:e,label:t,accounts:n}))}},watch:{showRunHistory(e){e||(this.selectedTask=null,this.runsRequestId+=1,this.runsLoading=!1,this.runPollFailures=0,this.syncRunPolling())}},async mounted(){document.addEventListener(`visibilitychange`,this.onVisibilityChange),await this.loadTasks()},unmounted(){document.removeEventListener(`visibilitychange`,this.onVisibilityChange),this.stopRunPolling()},methods:{emptyForm(){return{name:``,question:``,model:F,scheduleType:`daily`,intervalValue:4,intervalUnit:`hour`,hourlyMinute:0,dailyTime:`09:00`,weekday:1,cronExpr:`0 9 * * *`,timezone:$,authorizedSkills:[],authorizedMcpServers:[],browserConnectionId:``,connectionAccounts:{},authorizationExpiresAt:Math.floor(Date.now()/1e3)+720*60*60,maxTurns:ve,execution:`cloud`,authorizedLocalTools:[]}},deriveName(e){let t=(e||``).trim().split(`
|
|
2
2
|
`)[0].trim();return t.length>40?`${t.slice(0,40)}…`:t||`Scheduled Task`},async loadTasks(){if(this.token){this.loading=!0;try{this.tasks=await Z.listTasks(this.token);let e=Math.max(1,Math.ceil(this.tasks.length/this.pageSize));this.page>e&&(this.page=e)}catch{y.error(this.$t(`chat.scheduledTasks.loadError`))}finally{this.loading=!1}}},async selectTask(e){this.selectedTask=e,this.showRunHistory=!0,this.runPage=1,await this.loadTaskRuns(e.id)},async loadTaskRuns(e,t=!1){if(!this.token)return;let n=++this.runsRequestId;t||(this.runsLoading=!0,this.runPollFailures=0);try{let t=await Z.listRuns(this.token,e);if(n!==this.runsRequestId||!this.showRunHistory||this.selectedTask?.id!==e)return;this.runs=t,this.runPollFailures=0}catch{if(n!==this.runsRequestId)return;this.runPollFailures+=1,t||y.error(this.$t(`chat.scheduledTasks.loadError`))}finally{n===this.runsRequestId&&(this.runsLoading=!1,this.syncRunPolling())}},onPageChange(e){this.page=e},switchTab(e){this.activeTab!==e&&(this.activeTab=e,e===`runs`?this.loadAllRuns():this.stopRunPolling())},onStatusFilter(e){this.allRunsStatus!==e&&(this.allRunsStatus=e,this.allRunsPage=1,this.loadAllRuns())},onAllRunsPageChange(e){this.allRunsPage=e,this.loadAllRuns()},async loadAllRuns(e=!1){if(!this.token)return;let t=++this.allRunsRequestId;e||(this.allRunsLoading=!0,this.runPollFailures=0);try{let{items:e,count:n}=await Z.listAllRuns(this.token,{status:this.allRunsStatus===`all`?void 0:this.allRunsStatus,offset:(this.allRunsPage-1)*this.allRunsPageSize,limit:this.allRunsPageSize});if(t!==this.allRunsRequestId)return;this.allRuns=e,this.allRunsCount=n,this.runPollFailures=0}catch{if(t!==this.allRunsRequestId)return;this.runPollFailures+=1,e||y.error(this.$t(`chat.scheduledTasks.loadError`))}finally{t===this.allRunsRequestId&&(this.allRunsLoading=!1,this.syncRunPolling())}},onRunPageChange(e){this.runPage=e},visibleRuns(){return this.showRunHistory?this.runs:this.activeTab===`runs`?this.allRuns:[]},syncRunPolling(){let e=Date.now();if(!(this.token&&this.runPollFailures<be&&this.visibleRuns().some(t=>de(t,e)))||document.hidden){this.stopRunPolling();return}this.runPollTimer||=setInterval(()=>void this.pollRuns(),ye)},stopRunPolling(){this.runPollTimer&&=(clearInterval(this.runPollTimer),null)},async pollRuns(){if(!this.token){this.stopRunPolling();return}if(this.runPollInFlight)return;let e=++this.runPollSeq;this.runPollInFlight=!0;try{this.showRunHistory&&this.selectedTask?await this.loadTaskRuns(this.selectedTask.id,!0):this.activeTab===`runs`?await this.loadAllRuns(!0):this.stopRunPolling()}finally{e===this.runPollSeq&&(this.runPollInFlight=!1)}},onVisibilityChange(){document.hidden?this.stopRunPolling():(this.runPollFailures=0,this.runPollInFlight=!1,this.pollRuns(),this.syncRunPolling())},openCreate(){this.saving||(this.editingTask=null,this.form=this.emptyForm(),this.showCreateDialog=!0,this.loadDesktopContext())},async loadDesktopContext(){if(!W())return;let e=G()?.scheduler;if(e)try{this.deviceIdentity=await e.identity()}catch{this.deviceIdentity=null}try{this.localToolSpecs=await R()?.listTools()??[]}catch{this.localToolSpecs=[]}},closeTaskDialog(){this.saving||(this.showCreateDialog=!1)},taskToForm(e){let t=e.schedule,n=`cron`,r=4,i=`hour`,a=0,o=`09:00`,s=`0 9 * * *`,c=1;if(t.type===`cron`){s=t.cron;let[e,r,i,l,u]=t.cron.split(/\s+/),d=e=>/^\d+$/.test(e);i===`*`&&l===`*`&&u===`*`&&r===`*`&&d(e)?(n=`hourly`,a=Number(e)):i===`*`&&l===`*`&&u===`*`&&d(r)&&d(e)?(n=`daily`,o=`${r.padStart(2,`0`)}:${e.padStart(2,`0`)}`):i===`*`&&l===`*`&&d(u)&&d(r)&&d(e)&&(n=`weekly`,c=Number(u),o=`${r.padStart(2,`0`)}:${e.padStart(2,`0`)}`)}else if(t.type===`interval`){n=`interval`;let e=t.interval_seconds;e%86400==0?(i=`day`,r=e/86400):e%3600==0?(i=`hour`,r=e/3600):(i=`minute`,r=Math.max(1,Math.round(e/60)))}return{name:e.name,question:e.template.question,model:e.template.model,scheduleType:n,intervalValue:r,intervalUnit:i,hourlyMinute:a,dailyTime:o,weekday:c,cronExpr:s,timezone:t.tz||$,authorizedSkills:e.unattended_policy?.allowed_skills||[],authorizedMcpServers:e.unattended_policy?.allowed_mcp_servers||[],browserConnectionId:e.unattended_policy?.browser_connections?.[0]?.connection_id??``,connectionAccounts:Object.fromEntries((e.unattended_policy?.connection_bindings??[]).map(e=>[e.connector_identifier,e.connection_id])),authorizationExpiresAt:e.unattended_policy?.expires_at??Math.floor(Date.now()/1e3)+720*60*60,maxTurns:e.template.max_turns??ve,execution:e.execution===`local`?`local`:`cloud`,authorizedLocalTools:e.unattended_policy?.allowed_local_tools||[]}},openEdit(e){this.editingTask=e,this.form=this.taskToForm(e),this.showCreateDialog=!0,this.loadAuthorizableSkills(),this.loadDesktopContext()},openDuplicate(e){this.saving||(this.editingTask=null,this.form={...this.taskToForm(e),name:this.nextCopyName(e.name),authorizationExpiresAt:Math.floor(Date.now()/1e3)+720*60*60},this.showCreateDialog=!0,this.loadAuthorizableSkills(),this.loadDesktopContext())},nextCopyName(e){let t=(e||``).trim()||this.$t(`chat.scheduledTasks.title`),n=new Set(this.tasks.map(e=>e.name)),r=e=>{let n=` ${e}`,r=80-n.length;if(t.length<=r)return`${t}${n}`;let i=``;for(let e of t){if(i.length+e.length>r)break;i+=e}return`${i}${n}`},i=2;for(;n.has(r(i));)i+=1;return r(i)},buildSchedule(){let{scheduleType:e,intervalValue:t,intervalUnit:n,hourlyMinute:r,dailyTime:i,weekday:a,cronExpr:o,timezone:s}=this.form;if(e===`interval`)return{type:`interval`,interval_seconds:Math.max(60,Math.round(t)*(n===`day`?86400:n===`hour`?3600:60)),tz:s};if(e===`hourly`)return{type:`cron`,cron:`${Math.min(59,Math.max(0,Math.round(r)))} * * * *`,tz:s};if(e===`daily`){let[e,t]=i.split(`:`);return{type:`cron`,cron:`${t} ${e} * * *`,tz:s}}if(e===`weekly`){let[e,t]=i.split(`:`);return{type:`cron`,cron:`${t} ${e} * * ${a}`,tz:s}}return{type:`cron`,cron:o,tz:s}},async saveTask(){if(!this.form.question.trim()){y.warning(this.$t(`chat.scheduledTasks.form.required`));return}if(!he(this.form.timezone)){y.warning(this.$t(`chat.scheduledTasks.form.timezoneInvalid`));return}let e=this.editingTask;this.saving=!0;let t;try{t=await this.loadAuthorizableSkills()}finally{this.saving=!1}if(!t||!this.showCreateDialog||this.editingTask!==e)return;if(this.form.authorizedSkills.length>0||this.form.authorizedMcpServers.length>0)try{await q.confirm(this.authorizationConfirmText(),this.$t(`chat.scheduledTasks.form.skillsConfirmTitle`),{type:`warning`,confirmButtonText:this.$t(`common.button.confirm`),cancelButtonText:this.$t(`common.button.cancel`)})}catch{return}let n=[...this.form.authorizedSkills],r=[...this.form.authorizedMcpServers],i;if(this.selectedBrowserSkills.length){let e=this.selectedBrowserConnection;if(!e||!e.online||!e.compatible){y.error(this.$t(`chat.scheduledTasks.form.browserBindingInvalid`));return}i=[{connection_id:e.connection_id,connection_revision:e.connection_revision,device_id:e.device_id,wire_contract_digest:e.wire_contract_digest,policy_digest:e.policy_digest}]}let a=this.accountChoices.map(e=>({connector_identifier:e.identifier,connection_id:this.form.connectionAccounts[e.identifier]||``})).filter(e=>!!e.connection_id&&this.accountChoices.find(t=>t.identifier===e.connector_identifier)?.accounts.some(t=>t.connection_id===e.connection_id)),o=this.form.execution===`local`?[...this.form.authorizedLocalTools]:[],s={name:this.form.name.trim()||this.deriveName(this.form.question),schedule:this.buildSchedule(),template:{model:this.form.model,question:this.form.question,skills:n,mcp_servers:r,max_turns:this.form.maxTurns},created_surface:K(),...this.form.execution===`local`&&this.deviceIdentity?{execution:`local`,device_id:this.deviceIdentity.device_id,device_name:this.deviceIdentity.device_name}:{},unattended_policy:n.length||r.length||o.length?{allowed_skills:n,allowed_mcp_servers:r,...o.length?{allowed_local_tools:o}:{},browser_connections:i,connection_bindings:a.length?a:void 0,expires_at:this.form.authorizationExpiresAt}:{allowed_skills:[],allowed_mcp_servers:[]}};await this.submitTask(s,!1)},async submitTask(e,t){this.saving=!0;let n=null;try{if(this.editingTask){let n=this.editingTask.id,r=await Z.updateTask(this.token,n,e,t),i=this.tasks.findIndex(e=>e.id===n);i!==-1&&(this.tasks[i]=r)}else{let n=await Z.createTask(this.token,e,t);this.tasks=[n,...this.tasks],this.page=1}y.success(this.$t(`chat.scheduledTasks.create`)+` OK`),this.showCreateDialog=!1,this.editingTask=null,this.form=this.emptyForm()}catch(e){n=t?null:fe(e),n||y.error(this.$t(`chat.scheduledTasks.loadError`))}finally{this.saving=!1}if(n){if(this.selectedBrowserSkills.length)return;await this.confirmForceSkill(n)&&await this.submitTask(e,!0)}},async confirmForceSkill(e){let t=this.capabilityLabel(e.slug);try{return await q.confirm(this.$t(`chat.scheduledTasks.form.skillNotActiveMessage`,{name:t}),this.$t(`chat.scheduledTasks.form.skillNotActiveTitle`),{type:`warning`,confirmButtonText:this.$t(`chat.scheduledTasks.form.skillNotActiveForce`),cancelButtonText:this.$t(`common.button.cancel`)}),!0}catch{return!1}},capabilityLabel(e){let t=this.authorizableSkills.find(t=>t.slug===e);if(t)return t.name||t.slug;let n=this.authorizableMcpServers.find(t=>t.slug===e);return n?n.name||n.slug:e},async loadAuthorizableSkills(e=!1){return this.skillsInflight?this.skillsInflight:!this.token||!e&&(this.authorizableSkills.length||this.authorizableMcpServers.length)?!0:(this.skillsLoading=!0,this.skillsInflight=(async()=>{try{let e=await Z.listAuthorizableCapabilities(this.token);return this.authorizableSkills=e.skills,this.authorizableMcpServers=e.mcp_servers,!0}catch{return y.error(this.$t(`chat.scheduledTasks.loadError`)),!1}finally{this.skillsLoading=!1,this.skillsInflight=null}})(),this.skillsInflight)},onSkillSelectVisible(e){e&&this.loadAuthorizableSkills(!0)},skillLabel(e){return e.name||e.slug},mcpServerLabel(e){return e.name||e.slug},authorizationConfirmText(){let e=new Set(this.form.authorizedSkills),t=new Set(this.form.authorizedMcpServers),n=this.authorizableSkills.filter(t=>e.has(t.slug)).map(e=>this.skillLabel(e)),r=this.authorizableMcpServers.filter(e=>t.has(e.slug)).map(e=>this.mcpServerLabel(e));return this.$t(`chat.scheduledTasks.form.skillsConfirm`,{count:e.size+t.size,skills:[...n,...r].length?[...n,...r].join(`, `):[...Array.from(e),...Array.from(t)].join(`, `)})},async toggleState(e,t){let n=this.tasks.findIndex(t=>t.id===e.id),r=t?`enabled`:`disabled`;n!==-1&&(this.tasks[n]={...e,state:r});try{let t=await Z.updateTask(this.token,e.id,{state:r});n!==-1&&(this.tasks[n]=t)}catch{n!==-1&&(this.tasks[n]={...e,state:e.state}),y.error(this.$t(`chat.scheduledTasks.loadError`))}},async triggerNow(e){if(!this.triggeringId){this.triggeringId=e.id;try{if(e.execution===`local`){let t=G()?.scheduler?.runNow;if(!t){y.warning(this.$t(`chat.scheduledTasks.triggerLocalUnavailable`));return}let n=await t(e.id);if(!n?.ok){let e=n?.reason===`not_on_this_device`?`chat.scheduledTasks.triggerWrongDevice`:n?.reason===`signed_out`?`chat.scheduledTasks.triggerSignedOut`:n?.reason===`already_running`?`chat.scheduledTasks.triggerAlreadyRunning`:`chat.scheduledTasks.triggerError`;y.warning(this.$t(e));return}}else await Z.triggerTask(this.token,e.id);y.success(this.$t(`chat.scheduledTasks.triggerSuccess`)),this.showRunHistory&&this.selectedTask?.id===e.id?(this.runPage=1,await this.loadTaskRuns(e.id)):this.activeTab===`runs`&&await this.loadAllRuns(!0)}catch{y.error(this.$t(`chat.scheduledTasks.triggerError`))}finally{this.triggeringId=``}}},async confirmDelete(e){await q.confirm(this.$t(`chat.scheduledTasks.deleteConfirm`,{name:e.name}),{type:`warning`});try{await Z.deleteTask(this.token,e.id),this.tasks=this.tasks.filter(t=>t.id!==e.id);let t=Math.max(1,Math.ceil(this.tasks.length/this.pageSize));this.page>t&&(this.page=t)}catch{y.error(this.$t(`chat.scheduledTasks.loadError`))}},openRun(e){if(!e.conversation_id)return;let t=this.modelGroups.map(e=>e.name),n=e.conversation_model_group,r=this.$store.state.chat?.modelGroup?.name||`chatgpt`,i=n&&(t.length===0||t.includes(n))?n:r;this.$router.push(`/${i}/conversations/${e.conversation_id}`)},stateTagType(e){return e===`enabled`?`success`:e===`error`?`danger`:`info`},runTagType(e){return e===`success`?`success`:e===`failed`?`danger`:e===`indeterminate`||e===`skipped`?`info`:`warning`},accountTagText(e){let t=e.provider_alias||e.connector_identifier,n=e.label||e.account_name;return n?`${t} · ${n}`:t},runOutcomeText(e){return e.outcome_reason?e.outcome_reason:this.runErrorText(e)},runErrorText(e){let t=e.error_code;return t&&this.$te(`chat.scheduledTasks.run.reason.${t}`)?this.errorCodeText(t):e.error_message?e.error_message:t?this.errorCodeText(t):``},errorCodeText(e){let t=`chat.scheduledTasks.run.reason.${e}`;return this.$te(t)?this.$t(t):e.replace(/_/g,` `)},humanizeSchedule(e){let t=(e,t)=>this.$t(`chat.scheduledTasks.humanize.${e}`,t??{});if(e.type===`interval`){let n=e.interval_seconds;return n%86400==0?t(`everyNDays`,{n:n/86400}):n%3600==0?t(`everyNHours`,{n:n/3600}):t(`everyNMinutes`,{n:Math.round(n/60)})}if(e.type===`cron`){let[n,r,i,a,o]=e.cron.split(/\s+/),s=e=>/^\d+$/.test(e);if(i===`*`&&a===`*`&&o===`*`&&r===`*`&&s(n))return t(`hourlyAtMinute`,{n:Number(n)});let c=s(r)&&s(n)?`${r.padStart(2,`0`)}:${n.padStart(2,`0`)}`:``;return c&&i===`*`&&a===`*`&&o===`*`?t(`dailyAt`,{time:c}):c&&i===`*`&&a===`*`&&s(o)?t(`weeklyAt`,{weekday:this.weekdays[Number(o)]??o,time:c}):t(`cronRaw`,{cron:e.cron})}return t(`once`,{time:new Date(e.at*1e3).toLocaleString()})},scheduleLabel(e){return`${this.humanizeSchedule(e)} · ${Q(e.tz)}`},timeZoneLabel(e){return Q(e)},formatTime(e){return new Date(e*1e3).toLocaleString()}}}),Se={class:`scheduled-tasks`},Ce={class:`inner`},we={class:`header`},Te={class:`title`},Ee=[`aria-label`],De=[`aria-selected`,`onClick`],Oe={class:`task-list`},ke={class:`task-top`},Ae={class:`task-heading`},je={class:`task-name`},Me={class:`task-id`},Ne={class:`task-id-text`},Pe={class:`task-meta`},Fe={class:`meta-chip`},Ie={class:`meta-chip`},Le={key:0,class:`meta-chip`},Re={class:`task-prompt`},ze={key:0,class:`task-last-output`},Be={class:`task-footer`},Ve={class:`run-count`},He={key:0,class:`error-hint`},Ue={class:`open-hint`},We={key:0,class:`pager`},Ge=[`aria-label`],Ke=[`aria-pressed`,`onClick`],qe={class:`run-list`},Je=[`tabindex`,`role`,`onClick`,`onKeydown`],Ye={class:`run-body`},Xe={class:`run-line`},Ze={class:`run-title`},Qe={key:0,class:`run-preview`},$e={class:`run-sub`},et={class:`run-time`},tt=[`title`],nt={class:`run-action`},rt={key:1,class:`run-noconv`},it={key:0,class:`pager`},at={key:0,class:`run-context`},ot={class:`task-id run-context-id`},st={class:`task-id-text`},ct={class:`run-context-meta`},lt={class:`run-context-prompt`},ut={key:3,class:`run-list`},dt=[`tabindex`,`role`,`onClick`,`onKeydown`],ft={class:`run-body`},pt={class:`run-line`},mt={class:`run-title`},ht={key:0,class:`run-preview`},gt={class:`run-sub`},_t={class:`run-time`},vt=[`title`],yt={class:`run-action`},bt={key:1,class:`run-noconv`},xt={key:4,class:`pager run-pager`},St={class:`hint`},Ct={class:`inline-block`},wt={class:`hint`},Tt={class:`hint`},Et={key:0,class:`schedule-preview`},Dt={class:`hint`},Ot={class:`hint`},kt={class:`hint`},At={class:`jitter-hint`},jt={class:`hint`},Mt={class:`skill-option`},Nt={class:`skill-option-name`},Pt={key:0,class:`skill-option-missing`},Ft={class:`hint`},It={key:0,class:`browser-binding-summary`},Lt={class:`hint`},Rt={class:`hint`};function zt(h,g,ee,te,ne,re){let _=u(`add-icon`),v=u(`el-button`),y=u(`el-skeleton`),b=u(`el-empty`),x=u(`copy-to-clipboard`),S=u(`el-switch`),ie=u(`play-icon`),C=u(`el-tooltip`),w=u(`edit-icon`),T=u(`copy-icon`),E=u(`delete-icon`),D=u(`el-tag`),O=u(`time-icon`),k=u(`ai-icon`),A=u(`refresh-icon`),j=u(`expand-right-icon`),ae=u(`el-card`),M=u(`pagination`),oe=u(`el-drawer`),N=u(`el-input`),P=u(`el-form-item`),F=u(`el-option`),I=u(`el-option-group`),L=u(`el-select`),R=u(`el-radio`),z=u(`el-radio-group`),B=u(`el-input-number`),V=u(`el-time-picker`),H=u(`el-form`),U=u(`el-dialog`);return m(),s(`div`,Se,[e(`div`,Ce,[e(`div`,we,[e(`h2`,Te,i(h.$t(`chat.scheduledTasks.title`)),1),h.activeTab===`tasks`?(m(),d(v,{key:0,type:`primary`,round:``,disabled:h.saving,onClick:h.openCreate},{default:f(()=>[a(_,{size:16,class:`icon`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(h.$t(`chat.scheduledTasks.create`)),1)]),_:1},8,[`disabled`,`onClick`])):o(``,!0)]),e(`div`,{class:`tabs`,role:`tablist`,"aria-label":h.$t(`chat.scheduledTasks.title`)},[(m(!0),s(l,null,p(h.tabs,e=>(m(),s(`button`,{key:e,type:`button`,role:`tab`,class:n([`tab`,{active:h.activeTab===e}]),"aria-selected":h.activeTab===e,onClick:t=>h.switchTab(e)},i(h.$t(`chat.scheduledTasks.tab.${e}`)),11,De))),128))],8,Ee),h.activeTab===`tasks`?(m(),s(l,{key:0},[h.loading?(m(),d(y,{key:0,rows:4,animated:``,class:`loading-block`})):h.tasks.length?(m(),s(l,{key:2},[e(`div`,Oe,[(m(!0),s(l,null,p(h.pagedTasks,n=>(m(),d(ae,{key:n.id,class:`task-card`,shadow:`hover`,onClick:e=>h.selectTask(n)},{default:f(()=>[e(`div`,ke,[e(`div`,Ae,[e(`div`,je,i(n.name),1),e(`div`,Me,[e(`span`,Ne,i(h.$t(`common.entity.id`))+`: `+i(n.id),1),a(x,{content:n.id,class:`inline-block shrink-0`},null,8,[`content`])])]),e(`div`,{class:`task-actions`,onClick:g[0]||=t(()=>{},[`stop`])},[a(S,{"model-value":n.state===`enabled`,onChange:e=>h.toggleState(n,e===!0)},null,8,[`model-value`,`onChange`]),a(C,{content:h.$t(`chat.scheduledTasks.triggerNow`),placement:`top`},{default:f(()=>[a(v,{text:``,class:`icon-action`,loading:h.triggeringId===n.id,"aria-label":h.$t(`chat.scheduledTasks.triggerNow`),title:h.$t(`chat.scheduledTasks.triggerNow`),onClick:e=>h.triggerNow(n)},{default:f(()=>[h.triggeringId===n.id?o(``,!0):(m(),d(ie,{key:0,size:`1em`,"aria-hidden":`true`,focusable:`false`}))]),_:2},1032,[`loading`,`aria-label`,`title`,`onClick`])]),_:2},1032,[`content`]),a(C,{content:h.$t(`common.button.edit`),placement:`top`},{default:f(()=>[a(v,{text:``,class:`icon-action`,"aria-label":h.$t(`common.button.edit`),onClick:e=>h.openEdit(n)},{default:f(()=>[a(w,{size:16,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`onClick`])]),_:2},1032,[`content`]),a(C,{content:h.$t(`chat.scheduledTasks.duplicate`),placement:`top`},{default:f(()=>[a(v,{text:``,class:`icon-action`,"aria-label":h.$t(`chat.scheduledTasks.duplicate`),onClick:e=>h.openDuplicate(n)},{default:f(()=>[a(T,{size:16,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`onClick`])]),_:2},1032,[`content`]),a(C,{content:h.$t(`common.button.delete`),placement:`top`},{default:f(()=>[a(v,{text:``,type:`danger`,class:`icon-action`,"aria-label":h.$t(`common.button.delete`),onClick:e=>h.confirmDelete(n)},{default:f(()=>[a(E,{size:16,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`onClick`])]),_:2},1032,[`content`])])]),e(`div`,Pe,[a(D,{size:`small`,type:h.stateTagType(n.state),effect:`dark`,round:``},{default:f(()=>[r(i(h.$t(`chat.scheduledTasks.state.${n.state}`)),1)]),_:2},1032,[`type`]),e(`span`,Fe,[a(O,{class:`meta-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(h.scheduleLabel(n.schedule)),1)]),e(`span`,Ie,[a(k,{class:`meta-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.template.model),1)]),n.execution===`local`?(m(),s(`span`,Le,i(n.device_name||h.$t(`chat.scheduledTasks.execution.local`)),1)):o(``,!0)]),e(`div`,Re,i(n.template.question),1),n.last_output_snippet?(m(),s(`div`,ze,i(n.last_output_snippet),1)):o(``,!0),e(`div`,Be,[e(`span`,Ve,[a(A,{size:16,class:`footer-icon`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(h.$t(`chat.scheduledTasks.runCount`,{count:n.run_count})),1)]),n.last_error?(m(),s(`span`,He,i(h.errorCodeText(n.last_error)),1)):o(``,!0),e(`span`,Ue,[r(i(h.$t(`chat.scheduledTasks.viewRuns`))+` `,1),a(j,{size:`1em`,"aria-hidden":`true`,focusable:`false`})])])]),_:2},1032,[`onClick`]))),128))]),h.tasks.length>h.pageSize?(m(),s(`div`,We,[a(M,{"current-page":h.page,"page-size":h.pageSize,total:h.tasks.length,onChange:h.onPageChange},null,8,[`current-page`,`page-size`,`total`,`onChange`])])):o(``,!0)],64)):(m(),d(b,{key:1,description:h.$t(`chat.scheduledTasks.empty`),class:`empty`},null,8,[`description`]))],64)):(m(),s(l,{key:1},[e(`div`,{class:`filters`,role:`group`,"aria-label":h.$t(`chat.scheduledTasks.tab.runs`)},[(m(!0),s(l,null,p(h.statusFilters,e=>(m(),s(`button`,{key:e,type:`button`,class:n([`filter-chip`,{active:h.allRunsStatus===e}]),"aria-pressed":h.allRunsStatus===e,onClick:t=>h.onStatusFilter(e)},i(e===`all`?h.$t(`chat.scheduledTasks.filterAll`):h.$t(`chat.scheduledTasks.run.${e}`)),11,Ke))),128))],8,Ge),h.allRunsLoading?(m(),d(y,{key:0,rows:4,animated:``,class:`loading-block`})):h.allRuns.length?(m(),s(l,{key:2},[e(`div`,qe,[(m(!0),s(l,null,p(h.allRuns,u=>(m(),s(`div`,{key:u.id,class:n([`run-item`,{clickable:!!u.conversation_id}]),tabindex:u.conversation_id?0:-1,role:u.conversation_id?`button`:void 0,onClick:e=>h.openRun(u),onKeydown:[c(e=>h.openRun(u),[`enter`]),c(t(e=>h.openRun(u),[`prevent`]),[`space`])]},[e(`div`,Ye,[e(`div`,Xe,[e(`span`,Ze,i(u.conversation_title||h.formatTime(u.scheduled_at)),1),a(D,{size:`small`,type:h.runTagType(u.status),effect:`dark`,round:``,class:`run-tag`},{default:f(()=>[r(i(h.$t(`chat.scheduledTasks.run.${u.status}`)),1)]),_:2},1032,[`type`])]),u.conversation_preview?(m(),s(`div`,Qe,i(u.conversation_preview),1)):o(``,!0),e(`div`,$e,[u.task_name?(m(),d(D,{key:0,size:`small`,type:`info`,round:``,class:`run-task-tag`},{default:f(()=>[r(i(u.task_name),1)]),_:2},1024)):o(``,!0),u.execution===`local`?(m(),d(D,{key:1,size:`small`,type:`info`,round:``,class:`run-task-tag`},{default:f(()=>[r(i(u.device_name||h.$t(`chat.scheduledTasks.execution.local`)),1)]),_:2},1024)):o(``,!0),(m(!0),s(l,null,p(u.run_accounts,(e,t)=>(m(),d(D,{key:`${e.connector_identifier}-${t}`,size:`small`,type:`info`,round:``,class:`run-account-tag`},{default:f(()=>[r(i(h.accountTagText(e)),1)]),_:2},1024))),128)),e(`span`,et,i(h.formatTime(u.scheduled_at)),1),h.runOutcomeText(u)?(m(),s(`span`,{key:2,class:n(u.status===`failed`?`run-error`:`run-outcome`),title:h.runOutcomeText(u)},i(h.runOutcomeText(u)),11,tt)):o(``,!0)])]),e(`div`,nt,[u.conversation_id?(m(),d(j,{key:0,class:`run-arrow`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(m(),s(`span`,rt,i(h.$t(`chat.scheduledTasks.noConversation`)),1))])],42,Je))),128))]),h.allRunsCount>h.allRunsPageSize?(m(),s(`div`,it,[a(M,{"current-page":h.allRunsPage,"page-size":h.allRunsPageSize,total:h.allRunsCount,onChange:h.onAllRunsPageChange},null,8,[`current-page`,`page-size`,`total`,`onChange`])])):o(``,!0)],64)):(m(),d(b,{key:1,description:h.$t(`chat.scheduledTasks.noRuns`),class:`empty`},null,8,[`description`]))],64))]),a(oe,{modelValue:h.showRunHistory,"onUpdate:modelValue":g[1]||=e=>h.showRunHistory=e,title:h.selectedTask?.name,direction:`rtl`,size:`min(560px, 92vw)`,class:`run-history-drawer`},{default:f(()=>[h.selectedTask?(m(),s(`div`,at,[e(`div`,ot,[e(`span`,st,i(h.$t(`common.entity.id`))+`: `+i(h.selectedTask.id),1),a(x,{content:h.selectedTask.id,class:`inline-block shrink-0`},null,8,[`content`])]),e(`div`,ct,[e(`span`,null,i(h.scheduleLabel(h.selectedTask.schedule)),1),e(`span`,null,i(h.selectedTask.template.model),1),e(`span`,null,i(h.$t(`chat.scheduledTasks.runCount`,{count:h.selectedTask.run_count})),1)]),e(`div`,lt,i(h.selectedTask.template.question),1)])):o(``,!0),h.runsLoading?(m(),d(y,{key:1,rows:3,animated:``})):h.runs.length?(m(),s(`div`,ut,[(m(!0),s(l,null,p(h.pagedRuns,u=>(m(),s(`div`,{key:u.id,class:n([`run-item`,{clickable:!!u.conversation_id}]),tabindex:u.conversation_id?0:-1,role:u.conversation_id?`button`:void 0,onClick:e=>h.openRun(u),onKeydown:[c(e=>h.openRun(u),[`enter`]),c(t(e=>h.openRun(u),[`prevent`]),[`space`])]},[e(`div`,ft,[e(`div`,pt,[e(`span`,mt,i(u.conversation_title||h.formatTime(u.scheduled_at)),1),a(D,{size:`small`,type:h.runTagType(u.status),effect:`dark`,round:``,class:`run-tag`},{default:f(()=>[r(i(h.$t(`chat.scheduledTasks.run.${u.status}`)),1)]),_:2},1032,[`type`])]),u.conversation_preview?(m(),s(`div`,ht,i(u.conversation_preview),1)):o(``,!0),e(`div`,gt,[(m(!0),s(l,null,p(u.run_accounts,(e,t)=>(m(),d(D,{key:`${e.connector_identifier}-${t}`,size:`small`,type:`info`,round:``,class:`run-account-tag`},{default:f(()=>[r(i(h.accountTagText(e)),1)]),_:2},1024))),128)),e(`span`,_t,i(h.formatTime(u.scheduled_at)),1),h.runOutcomeText(u)?(m(),s(`span`,{key:0,class:n(u.status===`failed`?`run-error`:`run-outcome`),title:h.runOutcomeText(u)},i(h.runOutcomeText(u)),11,vt)):o(``,!0)])]),e(`div`,yt,[u.conversation_id?(m(),d(j,{key:0,class:`run-arrow`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(m(),s(`span`,bt,i(h.$t(`chat.scheduledTasks.noConversation`)),1))])],42,dt))),128))])):(m(),d(b,{key:2,description:h.$t(`chat.scheduledTasks.noRuns`)},null,8,[`description`])),!h.runsLoading&&h.runs.length>h.runPageSize?(m(),s(`div`,xt,[a(M,{"current-page":h.runPage,"page-size":h.runPageSize,total:h.runs.length,onChange:h.onRunPageChange},null,8,[`current-page`,`page-size`,`total`,`onChange`])])):o(``,!0)]),_:1},8,[`modelValue`,`title`]),a(U,{modelValue:h.showCreateDialog,"onUpdate:modelValue":g[20]||=e=>h.showCreateDialog=e,title:h.editingTask?h.$t(`chat.scheduledTasks.edit`):h.$t(`chat.scheduledTasks.create`),width:`540px`,"close-on-click-modal":!1,"close-on-press-escape":!h.saving,"show-close":!h.saving,class:`scheduled-task-dialog`},{footer:f(()=>[a(v,{disabled:h.saving,onClick:h.closeTaskDialog},{default:f(()=>[r(i(h.$t(`common.button.cancel`)),1)]),_:1},8,[`disabled`,`onClick`]),a(v,{type:`primary`,loading:h.saving,onClick:h.saveTask},{default:f(()=>[r(i(h.$t(`common.button.confirm`)),1)]),_:1},8,[`loading`,`onClick`])]),default:f(()=>[a(H,{model:h.form,"label-width":`92px`},{default:f(()=>[a(P,{label:h.$t(`chat.scheduledTasks.form.name`)},{default:f(()=>[a(N,{modelValue:h.form.name,"onUpdate:modelValue":g[2]||=e=>h.form.name=e,placeholder:h.$t(`chat.scheduledTasks.form.namePlaceholder`),maxlength:`80`},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`label`]),a(P,{label:h.$t(`chat.scheduledTasks.form.prompt`),required:``},{default:f(()=>[a(N,{modelValue:h.form.question,"onUpdate:modelValue":g[3]||=e=>h.form.question=e,type:`textarea`,rows:6,placeholder:h.$t(`chat.scheduledTasks.form.promptPlaceholder`)},null,8,[`modelValue`,`placeholder`]),e(`div`,St,i(h.$t(`chat.scheduledTasks.form.promptHint`)),1)]),_:1},8,[`label`]),a(P,{label:h.$t(`chat.scheduledTasks.form.model`)},{default:f(()=>[a(L,{modelValue:h.form.model,"onUpdate:modelValue":g[4]||=e=>h.form.model=e,style:{width:`100%`},filterable:``},{default:f(()=>[(m(!0),s(l,null,p(h.modelGroups,e=>(m(),d(I,{key:e.name,label:e.getDisplayName()},{default:f(()=>[(m(!0),s(l,null,p(e.models,e=>(m(),d(F,{key:e.name,label:e.getDisplayName(),value:e.name},null,8,[`label`,`value`]))),128))]),_:2},1032,[`label`]))),128))]),_:1},8,[`modelValue`])]),_:1},8,[`label`]),a(P,{label:h.$t(`chat.scheduledTasks.form.execution`)},{default:f(()=>[a(z,{modelValue:h.form.execution,"onUpdate:modelValue":g[5]||=e=>h.form.execution=e},{default:f(()=>[a(R,{value:`cloud`},{default:f(()=>[r(i(h.$t(`chat.scheduledTasks.execution.cloud`)),1)]),_:1}),a(C,{content:h.localUnavailableReason,disabled:h.canRunLocally,placement:`top`},{default:f(()=>[e(`span`,Ct,[a(R,{value:`local`,disabled:!h.canRunLocally},{default:f(()=>[r(i(h.deviceIdentity?h.$t(`chat.scheduledTasks.execution.localNamed`,{device:h.deviceIdentity.device_name}):h.$t(`chat.scheduledTasks.execution.local`)),1)]),_:1},8,[`disabled`])])]),_:1},8,[`content`,`disabled`])]),_:1},8,[`modelValue`]),e(`div`,wt,i(h.form.execution===`local`?h.$t(`chat.scheduledTasks.form.executionLocalHint`):h.$t(`chat.scheduledTasks.form.executionCloudHint`)),1)]),_:1},8,[`label`]),h.form.execution===`local`?(m(),d(P,{key:0,label:h.$t(`chat.scheduledTasks.form.localTools`)},{default:f(()=>[a(L,{modelValue:h.form.authorizedLocalTools,"onUpdate:modelValue":g[6]||=e=>h.form.authorizedLocalTools=e,multiple:``,filterable:``,style:{width:`100%`},placeholder:h.$t(`chat.scheduledTasks.form.localToolsPlaceholder`)},{default:f(()=>[(m(!0),s(l,null,p(h.localToolSpecs,t=>(m(),d(F,{key:t.name,label:t.name,value:t.name},{default:f(()=>[e(`span`,null,i(t.name),1)]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`]),e(`div`,Tt,i(h.$t(`chat.scheduledTasks.form.localToolsHint`)),1)]),_:1},8,[`label`])):o(``,!0),a(P,{label:h.$t(`chat.scheduledTasks.form.schedule`)},{default:f(()=>[a(z,{modelValue:h.form.scheduleType,"onUpdate:modelValue":g[7]||=e=>h.form.scheduleType=e},{default:f(()=>[a(R,{value:`interval`},{default:f(()=>[r(i(h.$t(`chat.scheduledTasks.scheduleType.interval`)),1)]),_:1}),a(R,{value:`hourly`},{default:f(()=>[r(i(h.$t(`chat.scheduledTasks.scheduleType.hourly`)),1)]),_:1}),a(R,{value:`daily`},{default:f(()=>[r(i(h.$t(`chat.scheduledTasks.scheduleType.daily`)),1)]),_:1}),a(R,{value:`weekly`},{default:f(()=>[r(i(h.$t(`chat.scheduledTasks.scheduleType.weekly`)),1)]),_:1}),a(R,{value:`cron`},{default:f(()=>[r(i(h.$t(`chat.scheduledTasks.scheduleType.cron`)),1)]),_:1})]),_:1},8,[`modelValue`]),h.schedulePreview?(m(),s(`div`,Et,[a(O,{class:`preview-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(h.$t(`chat.scheduledTasks.form.schedulePreview`,{text:h.schedulePreview})),1)])):o(``,!0)]),_:1},8,[`label`]),a(P,{label:h.$t(`chat.scheduledTasks.form.timezone`),required:``},{default:f(()=>[a(L,{modelValue:h.form.timezone,"onUpdate:modelValue":g[8]||=e=>h.form.timezone=e,filterable:``,style:{width:`100%`}},{default:f(()=>[(m(!0),s(l,null,p(h.timezoneOptions,e=>(m(),d(F,{key:e,label:h.timeZoneLabel(e),value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`]),e(`div`,Dt,i(h.$t(`chat.scheduledTasks.form.timezoneHint`,{timezone:h.detectedTimezoneLabel})),1)]),_:1},8,[`label`]),h.form.scheduleType===`interval`?(m(),d(P,{key:1,label:h.$t(`chat.scheduledTasks.scheduleType.interval`)},{default:f(()=>[a(B,{modelValue:h.form.intervalValue,"onUpdate:modelValue":g[9]||=e=>h.form.intervalValue=e,min:1,max:h.intervalMax,step:1,"controls-position":`right`},null,8,[`modelValue`,`max`]),a(L,{modelValue:h.form.intervalUnit,"onUpdate:modelValue":g[10]||=e=>h.form.intervalUnit=e,style:{width:`110px`,"margin-left":`8px`}},{default:f(()=>[a(F,{label:h.$t(`chat.scheduledTasks.form.intervalUnit.minute`),value:`minute`},null,8,[`label`]),a(F,{label:h.$t(`chat.scheduledTasks.form.intervalUnit.hour`),value:`hour`},null,8,[`label`]),a(F,{label:h.$t(`chat.scheduledTasks.form.intervalUnit.day`),value:`day`},null,8,[`label`])]),_:1},8,[`modelValue`]),e(`div`,Ot,i(h.$t(`chat.scheduledTasks.form.intervalHint`)),1)]),_:1},8,[`label`])):o(``,!0),h.form.scheduleType===`hourly`?(m(),d(P,{key:2,label:h.$t(`chat.scheduledTasks.form.hourlyMinute`)},{default:f(()=>[a(B,{modelValue:h.form.hourlyMinute,"onUpdate:modelValue":g[11]||=e=>h.form.hourlyMinute=e,min:0,max:59,step:1,"controls-position":`right`},null,8,[`modelValue`]),e(`div`,kt,i(h.$t(`chat.scheduledTasks.form.hourlyMinuteHint`)),1)]),_:1},8,[`label`])):o(``,!0),h.form.scheduleType===`daily`?(m(),d(P,{key:3,label:h.$t(`chat.scheduledTasks.form.time`)},{default:f(()=>[a(V,{modelValue:h.form.dailyTime,"onUpdate:modelValue":g[12]||=e=>h.form.dailyTime=e,format:`HH:mm`,"value-format":`HH:mm`},null,8,[`modelValue`]),e(`span`,At,i(h.$t(`chat.scheduledTasks.jitterHint`)),1)]),_:1},8,[`label`])):o(``,!0),h.form.scheduleType===`weekly`?(m(),d(P,{key:4,label:h.$t(`chat.scheduledTasks.form.weekday`)},{default:f(()=>[a(L,{modelValue:h.form.weekday,"onUpdate:modelValue":g[13]||=e=>h.form.weekday=e,style:{width:`120px`}},{default:f(()=>[(m(!0),s(l,null,p(h.weekdays,(e,t)=>(m(),d(F,{key:t,label:e,value:t},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`]),a(V,{modelValue:h.form.dailyTime,"onUpdate:modelValue":g[14]||=e=>h.form.dailyTime=e,format:`HH:mm`,"value-format":`HH:mm`,style:{"margin-left":`8px`}},null,8,[`modelValue`])]),_:1},8,[`label`])):o(``,!0),h.form.scheduleType===`cron`?(m(),d(P,{key:5,label:h.$t(`chat.scheduledTasks.form.cron`)},{default:f(()=>[a(N,{modelValue:h.form.cronExpr,"onUpdate:modelValue":g[15]||=e=>h.form.cronExpr=e,placeholder:`0 9 * * *`},null,8,[`modelValue`]),e(`div`,jt,i(h.$t(`chat.scheduledTasks.form.cronHint`)),1)]),_:1},8,[`label`])):o(``,!0),a(P,{label:h.$t(`chat.scheduledTasks.form.skills`)},{default:f(()=>[a(L,{modelValue:h.form.authorizedSkills,"onUpdate:modelValue":g[16]||=e=>h.form.authorizedSkills=e,style:{width:`100%`},multiple:``,filterable:``,"collapse-tags":``,"collapse-tags-tooltip":``,loading:h.skillsLoading,placeholder:h.$t(`chat.scheduledTasks.form.skillsPlaceholder`),onVisibleChange:h.onSkillSelectVisible},{default:f(()=>[(m(!0),s(l,null,p(h.authorizableSkills,t=>(m(),d(F,{key:t.slug,label:h.skillLabel(t),value:t.slug,disabled:!t.connected},{default:f(()=>[e(`div`,Mt,[e(`span`,Nt,i(h.skillLabel(t)),1),t.connected?o(``,!0):(m(),s(`span`,Pt,i(h.$t(`chat.scheduledTasks.form.skillMissing`)),1))])]),_:2},1032,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`modelValue`,`loading`,`placeholder`,`onVisibleChange`]),e(`div`,Ft,i(h.$t(`chat.scheduledTasks.form.skillsHint`)),1)]),_:1},8,[`label`]),h.selectedBrowserSkills.length?(m(),d(P,{key:6,label:h.$t(`chat.scheduledTasks.form.browserConnection`),required:``},{default:f(()=>[a(L,{modelValue:h.form.browserConnectionId,"onUpdate:modelValue":g[17]||=e=>h.form.browserConnectionId=e,style:{width:`100%`}},{default:f(()=>[(m(!0),s(l,null,p(h.selectedBrowserConnections,e=>(m(),d(F,{key:e.connection_id,label:`${e.name} · ${e.device_name}`,value:e.connection_id,disabled:!e.online||!e.compatible},null,8,[`label`,`value`,`disabled`]))),128))]),_:1},8,[`modelValue`]),h.selectedBrowserConnection?(m(),s(`div`,It,[e(`div`,null,i(h.selectedBrowserConnection.allowed_origins.join(`, `)),1),e(`div`,null,i(h.$t(`chat.scheduledTasks.form.browserEffects`,{effects:h.selectedBrowserConnection.side_effects.join(`, `)})),1),e(`div`,null,i(h.$t(`chat.scheduledTasks.form.authorizationExpires`,{time:h.formatTime(h.form.authorizationExpiresAt)})),1)])):o(``,!0)]),_:1},8,[`label`])):o(``,!0),(m(!0),s(l,null,p(h.accountChoices,e=>(m(),d(P,{key:e.identifier,label:h.$t(`chat.scheduledTasks.form.connectionAccount`,{connector:e.label})},{default:f(()=>[a(L,{modelValue:h.form.connectionAccounts[e.identifier],"onUpdate:modelValue":t=>h.form.connectionAccounts[e.identifier]=t,clearable:``,placeholder:h.$t(`chat.scheduledTasks.form.connectionAccountDefault`),style:{width:`100%`}},{default:f(()=>[(m(!0),s(l,null,p(e.accounts,e=>(m(),d(F,{key:e.connection_id,label:e.is_default?`${e.label||e.account_name} · ${h.$t(`chat.scheduledTasks.form.accountIsDefault`)}`:e.label||e.account_name,value:e.connection_id},null,8,[`label`,`value`]))),128))]),_:2},1032,[`modelValue`,`onUpdate:modelValue`,`placeholder`])]),_:2},1032,[`label`]))),128)),a(P,{label:h.$t(`chat.scheduledTasks.form.mcpServers`)},{default:f(()=>[a(L,{modelValue:h.form.authorizedMcpServers,"onUpdate:modelValue":g[18]||=e=>h.form.authorizedMcpServers=e,style:{width:`100%`},multiple:``,filterable:``,"collapse-tags":``,"collapse-tags-tooltip":``,loading:h.skillsLoading,placeholder:h.$t(`chat.scheduledTasks.form.mcpServersPlaceholder`),onVisibleChange:h.onSkillSelectVisible},{default:f(()=>[(m(!0),s(l,null,p(h.authorizableMcpServers,e=>(m(),d(F,{key:e.slug,label:h.mcpServerLabel(e),value:e.slug},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`loading`,`placeholder`,`onVisibleChange`]),e(`div`,Lt,i(h.$t(`chat.scheduledTasks.form.mcpServersHint`)),1)]),_:1},8,[`label`]),a(P,{label:h.$t(`chat.scheduledTasks.form.maxTurns`)},{default:f(()=>[a(B,{modelValue:h.form.maxTurns,"onUpdate:modelValue":g[19]||=e=>h.form.maxTurns=e,min:1,max:50,step:1,"controls-position":`right`},null,8,[`modelValue`]),e(`div`,Rt,i(h.$t(`chat.scheduledTasks.form.maxTurnsHint`)),1)]),_:1},8,[`label`])]),_:1},8,[`model`])]),_:1},8,[`modelValue`,`title`,`close-on-press-escape`,`show-close`])])}var Bt=H(xe,[[`render`,zt],[`__scopeId`,`data-v-bcfbc9cd`]]);export{Bt 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,j as u,mt as d,rt as f,tt as p,z as m}from"./vendor-chart-Dw-P17PN.js";import{F as h}from"./icon-CDmWyIgD.js";import{p as g}from"./models-
|
|
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,j as u,mt as d,rt as f,tt as p,z as m}from"./vendor-chart-Dw-P17PN.js";import{F as h}from"./icon-CDmWyIgD.js";import{p as g}from"./models-ClsawnaQ.js";import{t as _}from"./chart-no-axes-combined-BLVOA658.js";import{t as v}from"./check-Vb1enwhA.js";import{t as y}from"./coins-B09dASJj.js";import{t as b}from"./wallet-eAa1xyTv.js";import{Dn as x,Ei as S,Fi as C,G as w,Ni as T,O as E,et as D,gi as O,pi as k}from"./index-C_sjkBHo.js";import{t as A}from"./CopyToClipboard-D1PN1vgU.js";var j=m({name:`ApplicationInfo`,components:{AnalyticsIcon:_,ConfirmIcon:v,CreditsIcon:y,ElButton:C,ElIcon:h,ElTag:T,CopyToClipboard:A,WalletIcon:b},props:{application:{type:Object,required:!0},showType:{type:Boolean,default:!1},showId:{type:Boolean,default:!1}},emits:[`buy`,`usage`],computed:{showPayment(){return x(this.$store.getters.site)?!1:!k()||this.application?.scope===`Global`?!0:(this.application?.packages||[]).some(e=>e?.metadata?.apple_product_id)},remainingAmountText(){let e=Number(this.application?.remaining_amount??0);return!Number.isFinite(e)||e<0?`0.00`:e.toFixed(2)}}}),M={class:`flex flex-col min-w-0`},N={key:0,class:`app-id-row`},P={class:`icon !mb-0 flex-shrink-0`},F={class:`app-id-line`},I={class:`app-id-label`},L={class:`app-id-value`},R={key:1,class:`icon`},z={class:`text-left`},B={class:`description`},ee={key:0},V={key:1},H={class:`value`},U={class:`description2`},W={key:0},G={key:1},K={class:`actions`};function q(n,c,f,m,h,g){let _=l(`confirm-icon`),v=l(`el-icon`),y=l(`wallet-icon`),b=l(`copy-to-clipboard`),x=l(`el-tag`),S=l(`analytics-icon`),C=l(`el-button`),w=l(`credits-icon`);return p(),s(`div`,null,[e(`div`,M,[a(v,{class:`check`},{default:d(()=>[a(_,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1}),n.showId?(p(),s(`div`,N,[e(`div`,P,[a(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`div`,F,[e(`span`,I,i(n.$t(`application.field.id`))+`:`,1),e(`span`,L,i(n.application.id),1),n.application.id?(p(),u(b,{key:0,content:n.application.id,class:`copy-small`},null,8,[`content`])):o(``,!0)])])):(p(),s(`div`,R,[a(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`})])),e(`div`,z,[e(`p`,B,[n.application.service?(p(),s(`span`,V,i(n.$t(`application.title.applicationBalance`,{service:n.application.service?.title})),1)):(p(),s(`span`,ee,i(n.$t(`application.title.globalBalance`)),1)),n.application.role===`grantee`?(p(),u(x,{key:2,class:`shared-badge`,size:`small`,type:`warning`,effect:`dark`,round:``},{default:d(()=>[r(i(n.$t(`application.badge.shared`)),1)]),_:1})):o(``,!0)]),e(`p`,H,i(n.remainingAmountText)+` `+i(n.$t(`service.unit.`+(n.application?.service?.unit||`credit`)+`s`)),1),e(`p`,U,[n.application.type===`Period`?(p(),s(`span`,W,i(n.$t(`application.field.expiredAt`))+`: `+i(n.$dayjs.format(n.application.expired_at)),1)):(p(),s(`span`,G,i(n.$t(`application.message.neverExpire`)),1))])])]),e(`div`,K,[a(C,{size:`small`,round:``,onClick:c[0]||=t(e=>n.$emit(`usage`,n.application),[`stop`])},{default:d(()=>[a(S,{class:`mr-1 text-[11px]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`application.button.usage`)),1)]),_:1}),n.showPayment?(p(),u(C,{key:0,type:`primary`,round:``,size:`small`,onClick:c[1]||=t(e=>n.$emit(`buy`,n.application),[`stop`])},{default:d(()=>[a(w,{class:`mr-1 text-[11px]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`application.button.buyMore`)),1)]),_:1})):o(``,!0)])])}var J=m({name:`ApplicationStatus`,components:{WalletIcon:b,ElDialog:S,ApplicationInfo:E(j,[[`render`,q],[`__scopeId`,`data-v-5c43793c`]])},props:{application:{type:Object,required:!0},applications:{type:Array,default:void 0},service:{type:Object,required:!0}},emits:[`select`],data(){return{visible:!1,applicationType:g}},computed:{authenticated(){return!!this.$store.state.token.access},user(){return this.$store.state.user},balanceAmount(){return Number(this.application?.remaining_amount??0)},balanceUnit(){let e=`service.unit.${this.application?.service?.unit||`credit`}`+(this.balanceAmount===1?``:`s`);return this.$t(e)},balanceText(){let e=this.balanceAmount;return Number.isFinite(e)?e>=1e3?Math.round(e).toLocaleString():e>=100?e.toFixed(1):e.toFixed(2):`0`},balanceTitle(){return`${this.balanceText} ${this.balanceUnit}`}},methods:{onGoUsage(e){let t={name:D,query:{application_id:e.id}};if(O()){this.visible=!1,this.$router.push(t);return}window.open(this.$router.resolve(t).href,`_blank`)},onBuyMore(e){let t={name:w,params:{id:e.id}};if(O()){this.visible=!1,this.$router.push(t);return}window.open(this.$router.resolve(t).href,`_blank`)},onSelectApplication(e){this.$emit(`select`,e)}}}),Y={class:`status`},X={key:0},Z={class:`text-center mb-4`},Q={class:`flex flex-col gap-4 mb-6 overflow-y-auto`},$=[`title`],te={class:`entry-amount`},ne={class:`entry-unit`};function re(t,r,m,h,g,_){let v=l(`application-info`),y=l(`el-dialog`),b=l(`wallet-icon`);return p(),s(`div`,Y,[a(y,{modelValue:t.visible,"onUpdate:modelValue":r[0]||=e=>t.visible=e,class:`mt-12`,width:`450px`},{default:d(()=>[t.application?(p(),s(`div`,X,[e(`p`,Z,i(t.$t(`application.message.applicationSelection`)),1),e(`div`,Q,[(p(!0),s(c,null,f(t.applications,(e,r)=>(p(),u(v,{key:r,class:n({item:!0,active:t.application?.id===e.id}),application:e,"show-id":``,onClick:n=>t.onSelectApplication(e),onUsage:n=>t.onGoUsage(e),onBuy:n=>t.onBuyMore(e)},null,8,[`class`,`application`,`onClick`,`onUsage`,`onBuy`]))),128))])])):o(``,!0)]),_:1},8,[`modelValue`]),e(`button`,{type:`button`,class:`entry`,title:t.balanceTitle,onClick:r[1]||=e=>t.visible=!0},[a(b,{class:`entry-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,te,i(t.balanceText),1),e(`span`,ne,i(t.balanceUnit),1)],8,$)])}var ie=E(J,[[`render`,re],[`__scopeId`,`data-v-b2f8b2d1`]]);export{ie as t};
|
|
@@ -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{m,p as h,v as g}from"./models-
|
|
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{m,p as h,v as g}from"./models-ClsawnaQ.js";import{t as _}from"./card-IQwqnRJR.js";import{n as v,t as y}from"./row-BlBs21oD.js";import{t as b}from"./empty-C5KjRN0h.js";import{t as x}from"./skeleton-Dj_a_iIP.js";import{t as S}from"./check-Vb1enwhA.js";import{Cn as C,Dn as w,Fi as T,G as E,K as D,Ni as O,Nr as k,O as A,Tr as j,X as M,an as N,lr as P,mr as F,pi as I,xn as L,yi as R}from"./index-C_sjkBHo.js";var z=p({name:`ConsoleSubscriptionBuy`,components:{CloseIcon:R,ConfirmIcon:S,ElSkeleton:x,ElRow:y,ElTag:O,ElCol:v,ElCard:_,ElEmpty:b,ElButton:T},data(){return{application:void 0,application2:void 0,type:h.PERIOD,services:[],loading:!1,loadFailed:!1,creating:!1,subscription:void 0}},computed:{site(){return this.$store.getters.site},applicationId(){return this.$route.params?.id?.toString()},showPayment(){return!I()},effectiveMarkupRatio(){return C(this.application2,this.site)},pricingAvailable(){return this.effectiveMarkupRatio!==void 0},subscriptions(){let e=[{name:`WEEK`,label:this.$t(`console.subscription.weekly`),description:this.$t(`console.subscription.weekly.description`),duration:10080*60},{name:`MONTH`,label:this.$t(`console.subscription.monthly`),description:this.$t(`console.subscription.monthly.description`),duration:720*60*60},{name:`YEAR`,tag:this.$t(`console.button.suggested`),label:this.$t(`console.subscription.yearly`),description:this.$t(`console.subscription.yearly.description`),duration:365*24*60*60}];for(let t of e){console.log(`item`,t);let e=this.getPackages(t.duration);console.log(`pkgs`,e),t.available=e.length>0&&this.effectiveMarkupRatio!==void 0,t.available&&(t.price=L(e.reduce((e,t)=>e+t.price,0),this.effectiveMarkupRatio));for(let n of e)t.benefits||=[],t.benefits.push({enabled:!0,content:`${n?.service?.title} - ${n.amount} `+this.$t(`service.unit.`+n?.service?.unit+`s`)});t.benefits?.push({enabled:t.name!==`WEEK`,content:this.$t(`console.message.benefit1`)}),t.benefits?.push({enabled:t.name!==`WEEK`,content:this.$t(`console.message.benefit2`)})}return e},service(){return this.application?.service},serviceIds(){return!this.application||!this.application.service?[]:[this.application.service.id]}},async mounted(){if(w(this.$store.getters.site)){this.$router.replace({name:D});return}await this.onInitialize()},methods:{async onInitialize(){this.loading=!0,this.loadFailed=!1;try{await this.onFetchApplication(),await this.onFetchApplication2(),await this.onCreateApplications(),this.subscription=this.subscriptions.find(e=>e.available)}catch{this.loadFailed=!0}finally{this.loading=!1}},getPriceString:N,onBuyExtra(){this.$router.push({name:E,params:{id:this.applicationId}})},getPackages(e){let t=[];if(!this.service)return[];let n=[this.service].sort((e,t)=>this.serviceIds.indexOf(e.id)-this.serviceIds.indexOf(t.id));for(let r of n){let n=r.packages?.find(t=>t.type===m.PERIOD&&t.duration===e);n&&t.push({...n,service:r})}return t},async onCreateApplications(){let e=[];if(this.application2||e.push(this.application?.service?.id),e.length>0){for(let t of e)await j.create({service_id:t,type:h.PERIOD});await this.onFetchApplication2()}},onChangeType(){console.log(`onChangeType`,this.type),this.$router.push({name:E,params:this.$route.params})},async onFetchServices(){let{data:e}=await P.getAll({id:this.serviceIds});this.services=e.items,console.debug(`services`,this.services)},async onFetchApplication(){let{data:e}=await j.get(this.applicationId);this.application=e,console.debug(`application`,this.application)},async onFetchApplication2(){let{data:e}=await j.getAll({limit:100,offset:0,user_id:this.$store.getters.user.id,ordering:`-created_at`,service_id:this.serviceIds,type:h.PERIOD});this.application2=e.items?.[0],console.debug(`application2`,this.application2)},onCreateOrder(e){let t=this.getPackages(e.duration);if(!(!this.pricingAvailable||!e.available||t.length===0)){if(this.subscription=e,this.creating=!0,!this.application2||!this.application2.id){g.error(this.$t(`console.message.applicationNotFound`)),this.creating=!1;return}k(`payment_initiated`,{service:this.service?.alias,action:`subscribe`,duration:e.duration}),F.create({application_ids:[this.application2.id],package_ids:t.map(e=>e.id),description:this.service?.title+` - `+e.label}).then(({data:e})=>{this.creating=!1,this.$router.push({name:M,params:{id:e.id}})}).catch(e=>{g.error(this.$t(`order.message.createFailed`)),this.creating=!1,k(`payment_failed`,{service:this.service?.alias,action:`subscribe`,error:e?.response?.data?.error?.message??String(e)})})}}}}),B={class:`title`},V={class:`introduction`},H={key:1,class:`text-center`},U={class:`name`},W={class:`price`},G={key:1,class:`text-[var(--el-text-color-secondary)]`},K={class:`description`},q={class:`benefits`},J={class:`operations`},Y={key:3,class:`extra`};function X(p,m,h,g,_,v){let y=c(`el-col`),b=c(`el-row`),x=c(`el-empty`),S=c(`el-skeleton`),C=c(`el-button`),w=c(`el-tag`),T=c(`confirm-icon`),E=c(`close-icon`),D=c(`el-card`);return f(),l(b,{class:`panel`},{default:u(()=>[i(y,{span:24},{default:u(()=>[i(b,null,{default:u(()=>[i(y,{span:24},{default:u(()=>[e(`h2`,B,r(p.$t(`common.title.buyMore`)),1)]),_:1})]),_:1}),i(b,null,{default:u(()=>[i(y,{span:24},{default:u(()=>[i(D,{shadow:`hover`,class:`card`},{default:u(()=>[i(b,null,{default:u(()=>[p.showPayment?(f(),l(y,{key:1,class:`max-w-4xl mx-auto`},{default:u(()=>[e(`p`,V,r(p.$t(`console.subscription.title`)),1),p.loading?(f(),l(S,{key:0})):p.loadFailed?(f(),o(`div`,H,[i(x,{description:p.$t(`common.message.noData`)},null,8,[`description`]),i(C,{type:`primary`,round:``,onClick:p.onInitialize},{default:u(()=>[n(r(p.$t(`common.button.refresh`)),1)]),_:1},8,[`onClick`])])):(f(),l(b,{key:2,gutter:15,class:`subscriptions`},{default:u(()=>[(f(!0),o(s,null,d(p.subscriptions,(c,m)=>(f(),l(y,{key:m,xs:24,md:24/(p.subscriptions?.length||4)},{default:u(()=>[i(D,{shadow:`hover`,class:t({subscription:!0,active:p.subscription?.name===c.name,disabled:!c.available}),onClick:e=>c.available&&(p.subscription=c)},{default:u(()=>[e(`h4`,U,[n(r(c.label)+` `,1),c.tag?(f(),l(w,{key:0,type:`warning`},{default:u(()=>[n(r(c.tag),1)]),_:2},1024)):a(``,!0)]),e(`h2`,W,[c.price===void 0?(f(),o(`span`,G,r(p.$t(`common.message.noData`)),1)):(f(),o(s,{key:0},[n(r(p.getPriceString({value:c.price})),1)],64))]),e(`p`,K,r(c.description),1),e(`div`,q,[(f(!0),o(s,null,d(c.benefits,(t,n)=>(f(),o(`div`,{key:n,class:`benefit`},[t.enabled?(f(),l(T,{key:0,class:`icon icon-check`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(f(),l(E,{key:1,class:`icon icon-xmark`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,null,r(t.content),1)]))),128))]),e(`div`,J,[p.showPayment?(f(),l(C,{key:0,class:`btn btn-subscribe`,type:p.subscription?.name===c?.name?`primary`:``,disabled:!c.available,round:``,onClick:e=>p.onCreateOrder(c)},{default:u(()=>[n(r(p.$t(`common.button.buy`)),1)]),_:1},8,[`type`,`disabled`,`onClick`])):a(``,!0)])]),_:2},1032,[`class`,`onClick`])]),_:2},1032,[`md`]))),128))]),_:1})),!p.loading&&!p.loadFailed&&p.showPayment?(f(),o(`div`,Y,[e(`span`,null,r(p.$t(`console.message.doNotWantSubscribe`)),1),i(C,{type:`primary`,class:`btn btn-extra`,round:``,size:`small`,onClick:p.onBuyExtra},{default:u(()=>[n(r(p.$t(`console.message.buyExtra`)),1)]),_:1},8,[`onClick`])])):a(``,!0)]),_:1})):(f(),l(y,{key:0,class:`max-w-4xl mx-auto`},{default:u(()=>[i(x,{description:p.$t(`common.message.noData`)},null,8,[`description`])]),_:1}))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}var Z=A(z,[[`render`,X],[`__scopeId`,`data-v-8b874c63`]]);export{Z as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{L as e,at as t,j as n,mt as r,tt as i,z as a}from"./vendor-chart-Dw-P17PN.js";import{n as o,t as s}from"./tabs-
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{L as e,at as t,j as n,mt as r,tt as i,z as a}from"./vendor-chart-Dw-P17PN.js";import{n as o,t as s}from"./tabs-BY90FIeI.js";import{O as c,ct as l,lt as u}from"./index-C_sjkBHo.js";var d=a({name:`FishTabSwitcher`,components:{ElTabs:o,ElTabPane:s},data(){return{ROUTE_FISH_TTS_INDEX:u,ROUTE_FISH_MODEL_INDEX:l}},computed:{active(){return(this.$route?.name||``)===`fish-model-index`?l:u}},methods:{onUpdate(e){let t=String(e);t!==this.active&&this.$router.push({name:t})}}});function f(a,o,s,c,l,u){let d=t(`el-tab-pane`),f=t(`el-tabs`);return i(),n(f,{"model-value":a.active,class:`fish-tabs scenario-tabs scenario-tabs--divided`,"onUpdate:modelValue":a.onUpdate},{default:r(()=>[e(d,{label:a.$t(`fish.tab.tts`),name:a.ROUTE_FISH_TTS_INDEX},null,8,[`label`,`name`]),e(d,{label:a.$t(`fish.tab.model`),name:a.ROUTE_FISH_MODEL_INDEX},null,8,[`label`,`name`])]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var p=c(d,[[`render`,f],[`__scopeId`,`data-v-f942a514`]]);export{p as t};
|
|
@@ -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,j as u,mt as d,rt as f,tt as p,z as m}from"./vendor-chart-Dw-P17PN.js";import{n as h,r as g,t as _}from"./select-D4hHjjDD.js";import{t as v}from"./tooltip-BZiH-gfA.js";import{t as y}from"./alert-BprQRUmf.js";import{h as b,v as x}from"./models-C_vP8fXw.js";import{t as S}from"./slider-Dk-HMGwy.js";import{t as C}from"./clock-bD4fxNqS.js";import{a as w,c as T,n as E,r as D,t as O}from"./pagination-BMxFmqMB.js";import{t as k}from"./info-D9qSu1pE.js";import{t as A}from"./mic-DlTpLTkf.js";import{t as ee}from"./trash-2-C8KAL3-J.js";import{t as te}from"./triangle-alert-BQ4zdiSO.js";import{t as j}from"./wand-sparkles-exkpi42x.js";import{ft as M,ht as ne}from"./constants-DJHV7KrP.js";import{Fi as N,Mn as P,Mr as re,O as F,Qt as I,bi as L,en as R,in as z,pn as B,xi as V}from"./index-BubtY8Qx.js";import{t as H}from"./CopyToClipboard-BPulu_aW.js";import{t as U}from"./ReportButton-yrAmNWvq.js";import{t as W}from"./Consumption-DkBnCq4g.js";import{t as G}from"./ApiCodeButton-CZz0vt_z.js";import{t as K}from"./BotPlaceholder-BxYtoblR.js";import{t as q}from"./Hailuo-BOCB7Ynu.js";import{t as J}from"./TabSwitcher-BGFu9K7f.js";var Y=L(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),X=m({name:`FishTextInput`,components:{PromptTextarea:w},computed:{text:{get(){return this.$store.state.fish?.config?.text},set(e){this.$store.commit(`fish/setConfig`,{...this.$store.state.fish?.config,text:e})}}}});function ie(e,t,n,r,i,a){let o=l(`prompt-textarea`);return p(),u(o,{modelValue:e.text,"onUpdate:modelValue":t[0]||=t=>e.text=t,title:e.$t(`fish.name.text`),info:e.$t(`fish.description.text`),placeholder:e.$t(`fish.placeholder.text`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var ae=F(X,[[`render`,ie]]),oe=m({name:`FishModelSelector`,components:{ElSelect:g,ElOption:_},computed:{options(){return[{value:ne,label:this.$t(`fish.button.modelS2Pro`)},{value:`s1`,label:this.$t(`fish.button.modelS1`)}]},value:{get(){return this.$store.state.fish?.config?.model},set(e){this.$store.commit(`fish/setConfig`,{...this.$store.state.fish?.config,model:e})}}},mounted(){this.value||=M}}),se={class:`field`},ce={class:`title font-bold`};function le(t,n,r,o,m,h){let g=l(`el-option`),_=l(`el-select`);return p(),s(`div`,se,[e(`h2`,ce,i(t.$t(`fish.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`fish.placeholder.select`)},{default:d(()=>[(p(!0),s(c,null,f(t.options,e=>(p(),u(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var ue=F(oe,[[`render`,le],[`__scopeId`,`data-v-9702e6d3`]]),de=m({name:`FishVoiceOption`,props:{option:{type:Object,required:!0},playing:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:[`preview`]}),fe={class:`voice-option`},pe=[`aria-label`],me={key:0,class:`spin`,viewBox:`0 0 24 24`,width:`13`,height:`13`,"aria-hidden":`true`},he={key:1,viewBox:`0 0 24 24`,width:`13`,height:`13`,"aria-hidden":`true`},ge={key:2,viewBox:`0 0 24 24`,width:`13`,height:`13`,"aria-hidden":`true`},_e={key:1,class:`preview placeholder`,"aria-hidden":`true`},ve={class:`meta`},ye={class:`label`},be={key:0,class:`description`};function xe(r,a,c,l,u,d){return p(),s(`div`,fe,[r.option.audio?(p(),s(`button`,{key:0,type:`button`,class:n([`preview`,{playing:r.playing,loading:r.loading}]),"aria-label":r.playing?`stop preview`:`play preview`,onMousedown:a[0]||=t(()=>{},[`prevent`]),onClick:a[1]||=t(e=>r.$emit(`preview`,r.option),[`stop`,`prevent`])},[r.loading?(p(),s(`svg`,me,[...a[2]||=[e(`circle`,{cx:`12`,cy:`12`,r:`9`,fill:`none`,stroke:`currentColor`,"stroke-width":`3`,"stroke-linecap":`round`,"stroke-dasharray":`42 60`},null,-1)]])):r.playing?(p(),s(`svg`,he,[...a[3]||=[e(`rect`,{x:`6`,y:`5`,width:`4`,height:`14`,rx:`1`,fill:`currentColor`},null,-1),e(`rect`,{x:`14`,y:`5`,width:`4`,height:`14`,rx:`1`,fill:`currentColor`},null,-1)]])):(p(),s(`svg`,ge,[...a[4]||=[e(`path`,{d:`M8 5v14l11-7z`,fill:`currentColor`},null,-1)]]))],42,pe)):(p(),s(`span`,_e,[...a[5]||=[e(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`},[e(`path`,{d:`M12 14a3 3 0 0 0 3-3V6a3 3 0 0 0-6 0v5a3 3 0 0 0 3 3zm5-3a5 5 0 0 1-10 0H5a7 7 0 0 0 6 6.92V21h2v-3.08A7 7 0 0 0 19 11z`,fill:`currentColor`})],-1)]])),e(`div`,ve,[e(`span`,ye,i(r.option.label),1),r.option.description?(p(),s(`span`,be,i(r.option.description),1)):o(``,!0)])])}var Se=F(de,[[`render`,xe],[`__scopeId`,`data-v-c16a6a46`]]),Ce=e=>(e.id||e._id||e.reference_id||``).toString(),Z=e=>{let t=Ce(e);return{value:t,label:e.title||t,description:e.description,audio:e.samples?.[0]?.audio}},we=m({name:`FishVoicePicker`,components:{ElSelect:g,ElOption:_,ElOptionGroup:h,VoiceOption:Se},data(){return{popularVoices:[],searchVoices:[],popularLoading:!1,searchLoading:!1,preloaded:!1,query:``,playingId:null,loadingId:null,labelCache:{},previewAudio:null,searchTimer:null,searchSeq:0}},computed:{remoteLoading(){return this.popularLoading||this.searchLoading},myVoices(){return this.$store.state.fish?.voices??[]},myOptions(){return this.myVoices.map(Z).filter(e=>!!e.value)},publicPool(){return this.query&&(this.searchVoices.length||this.searchLoading)?{voices:this.searchVoices,isSearch:!0}:{voices:this.popularVoices,isSearch:!1}},publicOptions(){let e=new Set(this.myOptions.map(e=>e.value));return this.publicPool.voices.map(Z).filter(t=>!!t.value&&!e.has(t.value))},filteredMyOptions(){return this.applyQuery(this.myOptions)},filteredPublicOptions(){return this.publicPool.isSearch?this.publicOptions:this.applyQuery(this.publicOptions)},fallbackOption(){let e=this.value;return!e||this.myOptions.some(t=>t.value===e)||this.publicOptions.some(t=>t.value===e)?null:{value:e,label:this.labelCache[e]||e}},noDataText(){return this.remoteLoading?this.$t(`fish.message.searching`):this.credential?.token?this.$t(`fish.message.searchVoiceHint`):this.$t(`fish.message.noVoices`)},credential(){return this.$store.state.fish?.credential},value:{get(){return this.$store.state.fish?.config?.reference_id},set(e){this.$store.commit(`fish/setConfig`,{...this.$store.state.fish?.config,reference_id:e||void 0})}}},watch:{myOptions:{immediate:!0,handler(e){this.cacheLabels(e)}},publicOptions(e){this.cacheLabels(e)},credential:{immediate:!0,handler(e){if(!e?.token)return;let t=this.$store.state.fish?.voices;(t===void 0||t.length===0)&&this.$store.dispatch(`fish/getVoices`),this.preloaded||this.fetchPopular()}}},beforeUnmount(){this.stopPreview(),this.searchTimer&&clearTimeout(this.searchTimer)},methods:{cacheLabels(e){for(let t of e)this.labelCache[t.value]=t.label},applyQuery(e){let t=this.query.toLowerCase();return t?e.filter(e=>e.label.toLowerCase().includes(t)||(e.description||``).toLowerCase().includes(t)):e},onVisibleChange(e){e&&!this.preloaded&&!this.popularLoading&&this.fetchPopular()},onFilter(e){if(this.query=(e||``).trim(),this.searchTimer&&clearTimeout(this.searchTimer),!this.query){this.searchSeq++,this.searchVoices=[],this.searchLoading=!1;return}this.searchTimer=setTimeout(()=>this.fetchSearch(this.query),350)},async fetchPopular(){let e=this.credential?.token;if(!(!e||this.popularLoading)){this.popularLoading=!0;try{let{data:t}=await P.listModels({self:!1,page_size:30,page_number:1},{token:e});this.popularVoices=t?.items??[],this.preloaded=!0}catch(e){console.error(`fish.loadPopularVoices failed`,e)}finally{this.popularLoading=!1}}},async fetchSearch(e){let t=this.credential?.token;if(!t)return;let n=++this.searchSeq;this.searchLoading=!0;try{let{data:r}=await P.listModels({self:!1,page_size:30,page_number:1,title:e},{token:t});if(n!==this.searchSeq)return;this.searchVoices=r?.items??[]}catch(e){n===this.searchSeq&&(this.searchVoices=[]),console.error(`fish.searchPublicVoices failed`,e)}finally{n===this.searchSeq&&(this.searchLoading=!1)}},togglePreview(e){if(!e.audio)return;if(this.playingId===e.value||this.loadingId===e.value){this.stopPreview();return}this.stopPreview();let t=new Audio(e.audio),n=()=>{this.previewAudio===t&&(this.loadingId=null,this.playingId=e.value)},r=()=>{this.previewAudio===t&&this.stopPreview()};t.addEventListener(`playing`,n),t.addEventListener(`ended`,r),t.addEventListener(`error`,r),this.previewAudio=t,this.loadingId=e.value,this.playingId=null,t.play().catch(()=>{this.previewAudio===t&&this.stopPreview()})},stopPreview(){this.previewAudio&&=(this.previewAudio.pause(),this.previewAudio.src=``,null),this.playingId=null,this.loadingId=null}}}),Te={class:`field`},Ee={class:`title font-bold`};function De(t,n,r,m,h,g){let _=l(`el-option`),v=l(`voice-option`),y=l(`el-option-group`),b=l(`el-select`);return p(),s(`div`,Te,[e(`h2`,Ee,i(t.$t(`fish.name.voice`)),1),a(b,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,"popper-class":`fish-voice-popper`,placeholder:t.$t(`fish.placeholder.voice`),clearable:``,filterable:``,"filter-method":t.onFilter,loading:t.remoteLoading,"loading-text":t.$t(`fish.message.searching`),"no-data-text":t.noDataText,onVisibleChange:t.onVisibleChange},{default:d(()=>[t.fallbackOption?(p(),u(_,{key:t.fallbackOption.value,label:t.fallbackOption.label,value:t.fallbackOption.value},null,8,[`label`,`value`])):o(``,!0),t.filteredMyOptions.length?(p(),u(y,{key:1,label:t.$t(`fish.title.myVoices`)},{default:d(()=>[(p(!0),s(c,null,f(t.filteredMyOptions,e=>(p(),u(_,{key:e.value,label:e.label,value:e.value},{default:d(()=>[a(v,{option:e,playing:t.playingId===e.value,loading:t.loadingId===e.value,onPreview:t.togglePreview},null,8,[`option`,`playing`,`loading`,`onPreview`])]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`label`])):o(``,!0),t.filteredPublicOptions.length?(p(),u(y,{key:2,label:t.$t(`fish.group.publicVoices`)},{default:d(()=>[(p(!0),s(c,null,f(t.filteredPublicOptions,e=>(p(),u(_,{key:e.value,label:e.label,value:e.value},{default:d(()=>[a(v,{option:e,playing:t.playingId===e.value,loading:t.loadingId===e.value,onPreview:t.togglePreview},null,8,[`option`,`playing`,`loading`,`onPreview`])]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`label`])):o(``,!0)]),_:1},8,[`modelValue`,`placeholder`,`filter-method`,`loading`,`loading-text`,`no-data-text`,`onVisibleChange`])])}var Oe=m({name:`FishConfigPanel`,components:{MagicIcon:j,ElButton:N,ElSlider:S,TextInput:ae,ModelSelector:ue,VoicePicker:F(we,[[`render`,De],[`__scopeId`,`data-v-6183b210`]]),Consumption:W},emits:[`generate`],computed:{config(){return this.$store.state.fish?.config},consumption(){let e=this.config?.text?.trim()??``;return z({...this.config,model:this.config?.model??`s2-pro`,byte_count:new TextEncoder().encode(e).byteLength},this.service?.cost)},service(){return this.$store.state.fish?.service},canGenerate(){let e=this.config?.text;return typeof e==`string`&&e.trim().length>0},speed:{get(){return this.config?.prosody?.speed??1},set(e){this.$store.commit(`fish/setConfig`,{...this.config,prosody:{...this.config?.prosody??{},speed:e}})}}},methods:{onGenerate(){this.$emit(`generate`)}}}),ke={class:`flex flex-col h-full`},Ae={class:`flex-1 overflow-y-auto p-5`},je={class:`field mb-4`},Me={class:`title font-bold`},Ne={class:`flex flex-col items-center justify-center px-5 pb-5`};function Pe(t,n,o,c,u,f){let m=l(`text-input`),h=l(`model-selector`),g=l(`voice-picker`),_=l(`el-slider`),v=l(`consumption`),y=l(`magic-icon`),b=l(`el-button`);return p(),s(`div`,ke,[e(`div`,Ae,[a(m,{class:`mb-4`}),a(h,{class:`mb-4`}),a(g,{class:`mb-4`}),e(`div`,je,[e(`h2`,Me,i(t.$t(`fish.name.speed`)),1),a(_,{modelValue:t.speed,"onUpdate:modelValue":n[0]||=e=>t.speed=e,min:.5,max:2,step:.1,class:`value`,"show-input":``},null,8,[`modelValue`])])]),e(`div`,Ne,[a(v,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(b,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:d(()=>[a(y,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`fish.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var Fe=F(Oe,[[`render`,Pe],[`__scopeId`,`data-v-dc4ea983`]]);function Ie(e){if(!e)return;let t=e.error;if(t){let e=typeof t==`string`?t:t.message;if(e)return e.trim()}let n=e.message;if(!(typeof n!=`string`||!n.trim()))return Q(n.trim())}function Q(e){if(e.startsWith(`[`))try{let t=JSON.parse(e);if(Array.isArray(t)&&t.length){let e=t.map(e=>{let t=typeof e?.msg==`string`?e.msg:void 0;if(!t)return;let n=Array.isArray(e?.loc)?e.loc.filter(e=>e!==`parameters`):[],r=n.length?n[n.length-1]:void 0;return r?`${r}: ${t}`:t}).filter(e=>!!e),n=Array.from(new Set(e));if(n.length)return n.join(`; `)}}catch{}if(e.startsWith(`{`))try{let t=JSON.parse(e);if(t&&typeof t.message==`string`&&t.message.trim())return Q(t.message.trim())}catch{}return e}var Le=m({name:`FishTaskPreview`,components:{DeleteIcon:ee,ElTooltip:v,ChannelIcon:T,CpuIcon:Y,InfoIcon:k,MagicIcon:j,MicrophoneIcon:A,TimeIcon:C,WarningIcon:te,CopyToClipboard:H,ElAlert:y,ElButton:N,ApiCodeButton:G,ReportButton:U},props:{modelValue:{type:Object,required:!0}},computed:{prompt(){return this.modelValue?.request?.text},audioUrl(){return this.modelValue?.response?.audio_url},isFailure(){let e=this.modelValue?.response;if(!e||e.audio_url)return!1;if(e.success===!1||e.error)return!0;let t=Number(e.status);return!Number.isNaN(t)&&t>=400||!!e.message},failureReason(){return Ie(this.modelValue?.response)}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await V.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(`fish/deleteTask`,{id:e}),x.success(this.$t(`common.message.deleteTaskSuccess`))}catch{x.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e){window.open(e,`_blank`)}}}),Re={class:`preview`},ze={class:`left`},Be={class:`main`},Ve={class:`bot`},He={class:`datetime`},Ue=[`aria-label`],We={class:`info`},Ge={key:0,class:`prompt mt-2`},Ke={key:0},qe={key:0,class:`content`},Je=[`src`],Ye={class:`operations mt-2`},Xe={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ze={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Qe={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$e={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},et={key:1,class:`content`},tt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},nt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},rt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},it={key:2,class:`content`},at={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function ot(n,c,u,f,m,h){let g=l(`capability-presentation`),_=l(`delete-icon`),v=l(`el-tooltip`),y=l(`el-button`),b=l(`api-code-button`),x=l(`report-button`),S=l(`cpu-icon`),C=l(`microphone-icon`),w=l(`copy-to-clipboard`),T=l(`magic-icon`),E=l(`time-icon`),D=l(`el-alert`),O=l(`warning-icon`),k=l(`info-icon`),A=l(`channel-icon`);return p(),s(`div`,Re,[e(`div`,ze,[a(g,{capability:`fish`,part:`avatar`,class:`avatar`})]),e(`div`,Be,[e(`div`,Ve,[a(g,{capability:`fish`,part:`name`}),e(`span`,He,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:d(()=>[n.modelValue?.id?(p(),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,Ue)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,We,[n.prompt?(p(),s(`p`,Ge,[r(i(n.prompt)+` `,1),n.modelValue?.response?o(``,!0):(p(),s(`span`,Ke,` - (`+i(n.$t(`fish.status.pending`))+`) `,1))])):o(``,!0)]),n.audioUrl?(p(),s(`div`,qe,[e(`audio`,{src:n.audioUrl,controls:``,preload:`metadata`,class:`w-full mb-3`},null,8,Je),e(`div`,Ye,[a(y,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=t(e=>n.onDownload(n.audioUrl),[`stop`])},{default:d(()=>[r(i(n.$t(`fish.button.download`)),1)]),_:1}),a(b,{path:`/fish/tts`,body:n.modelValue?.request},null,8,[`body`]),a(x,{service:`fish`,"target-id":n.modelValue?.id,snapshot:{text:n.modelValue?.request?.text}},null,8,[`target-id`,`snapshot`])]),a(D,{closable:!1,class:`mt-2 success`},{default:d(()=>[n.modelValue?.request?.model?(p(),s(`p`,Xe,[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.reference_id?(p(),s(`p`,Ze,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.referenceId`))+`: `+i(n.modelValue?.request?.reference_id)+` `,1),a(w,{content:n.modelValue?.request?.reference_id},null,8,[`content`])])):o(``,!0),e(`p`,Qe,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(p(),s(`p`,$e,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):n.isFailure?(p(),s(`div`,et,[a(D,{closable:!1,class:`failure`},{title:d(()=>[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.failure`)),1)]),default:d(()=>[e(`p`,tt,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])]),n.failureReason?(p(),s(`p`,$,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.failureReason`))+`: `+i(n.failureReason)+` `,1),a(w,{content:n.failureReason},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(p(),s(`p`,nt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(p(),s(`p`,rt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(w,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):(p(),s(`div`,it,[a(D,{closable:!1,class:`info`},{default:d(()=>[e(`p`,at,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})]))])])}var st=m({name:`FishRecentPanel`,components:{TaskPreview:F(Le,[[`render`,ot],[`__scopeId`,`data-v-79dbfe9e`]]),BotPlaceholder:K,NoTasks:D,ScrollList:E},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.fish?.tasks,items:this.$store.state.fish?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),ct={key:0},lt={key:2,class:`w-full h-full flex items-center justify-center`};function ut(e,t,n,r,i,m){let h=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return p(),s(c,null,[e.tasks?.items===void 0?(p(),s(`div`,ct,[a(h)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(p(),u(_,{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:d(()=>[(p(!0),s(c,null,f(e.tasks?.items,e=>(p(),u(g,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(p(),s(`div`,lt,[a(v)])):o(``,!0)],64)}var dt=m({name:`FishTtsIndex`,components:{ConfigPanel:Fe,Layout:q,RecentPanel:F(st,[[`render`,ut]]),TabSwitcher:J},mixins:[R],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.fish?.status?.getApplications===b.Request},tasksLoading(){return this.$store.state.fish?.status?.getTasks===b.Request||this.fetchingTasks},credential(){return this.$store.state.fish?.credential},config(){return this.$store.state.fish?.config},application(){return this.$store.state.fish?.application},tasks(){return this.$store.state.fish?.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(),await this.$store.dispatch(`fish/getVoices`)},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await O({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){await this.$store.dispatch(`fish/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(`fish/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!I(this.uploadTracker,e=>this.$t(e),e=>x.warning(e)))return;let e=this.config??{},t=e.text?.trim();if(!t){x.warning(this.$t(`fish.message.textRequired`));return}if(!B())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}let r=e.model||`s2-pro`,i={text:t,async:!0};e.reference_id&&(i.reference_id=e.reference_id),e.format&&(i.format=e.format),e.prosody&&Object.keys(e.prosody).length>0&&(i.prosody=e.prosody),x.info(this.$t(`fish.message.startingTask`)),re(`fish`,P.generateTts(i,{token:n,model:r})).then(()=>{x.success(this.$t(`fish.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?x.error(this.$t(`fish.message.usedUp`)):x.error(this.$t(`fish.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}}),ft={class:`flex flex-col h-full`},pt={class:`flex-1 min-h-0`};function mt(t,n,r,i,o,s){let c=l(`tab-switcher`),f=l(`config-panel`),m=l(`recent-panel`),h=l(`layout`);return p(),u(h,null,{config:d(()=>[e(`div`,ft,[a(c),e(`div`,pt,[a(f,{onGenerate:t.onGenerate},null,8,[`onGenerate`])])])]),result:d(()=>[a(m,{ref:`recentPanel`,loading:t.loadingMore,onReachTop:t.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var ht=F(dt,[[`render`,mt]]);export{ht 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,j as u,mt as d,rt as f,tt as p,z as m}from"./vendor-chart-Dw-P17PN.js";import{n as h,r as g,t as _}from"./select-ChyQns32.js";import{t as v}from"./tooltip-pUbjR2xu.js";import{t as y}from"./alert-BprQRUmf.js";import{h as b,v as x}from"./models-ClsawnaQ.js";import{t as S}from"./slider-CY92XsCL.js";import{t as C}from"./clock-Varrr0Bl.js";import{a as w,c as T,n as E,r as D,t as O}from"./pagination-D-uSyaRW.js";import{t as k}from"./info-BPaOsauW.js";import{t as A}from"./mic-BH3alSnw.js";import{t as ee}from"./trash-2-BfVLvlm9.js";import{t as te}from"./triangle-alert-BVAKaCSW.js";import{t as j}from"./wand-sparkles-Dp_e6WgR.js";import{ft as M,ht as ne}from"./constants-D04Y0eol.js";import{Fi as N,Mn as P,Mr as re,O as F,Qt as I,bi as L,en as R,in as z,pn as B,xi as V}from"./index-C_sjkBHo.js";import{t as H}from"./CopyToClipboard-D1PN1vgU.js";import{t as U}from"./ReportButton-YWxvQv7T.js";import{t as W}from"./Consumption-DiSEqNK8.js";import{t as G}from"./ApiCodeButton-BG3uOft7.js";import{t as K}from"./BotPlaceholder-CXmOKAnD.js";import{t as q}from"./Hailuo-BoOwIPFr.js";import{t as J}from"./TabSwitcher-wX5AvBMi.js";var Y=L(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),X=m({name:`FishTextInput`,components:{PromptTextarea:w},computed:{text:{get(){return this.$store.state.fish?.config?.text},set(e){this.$store.commit(`fish/setConfig`,{...this.$store.state.fish?.config,text:e})}}}});function ie(e,t,n,r,i,a){let o=l(`prompt-textarea`);return p(),u(o,{modelValue:e.text,"onUpdate:modelValue":t[0]||=t=>e.text=t,title:e.$t(`fish.name.text`),info:e.$t(`fish.description.text`),placeholder:e.$t(`fish.placeholder.text`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var ae=F(X,[[`render`,ie]]),oe=m({name:`FishModelSelector`,components:{ElSelect:g,ElOption:_},computed:{options(){return[{value:ne,label:this.$t(`fish.button.modelS2Pro`)},{value:`s1`,label:this.$t(`fish.button.modelS1`)}]},value:{get(){return this.$store.state.fish?.config?.model},set(e){this.$store.commit(`fish/setConfig`,{...this.$store.state.fish?.config,model:e})}}},mounted(){this.value||=M}}),se={class:`field`},ce={class:`title font-bold`};function le(t,n,r,o,m,h){let g=l(`el-option`),_=l(`el-select`);return p(),s(`div`,se,[e(`h2`,ce,i(t.$t(`fish.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`fish.placeholder.select`)},{default:d(()=>[(p(!0),s(c,null,f(t.options,e=>(p(),u(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var ue=F(oe,[[`render`,le],[`__scopeId`,`data-v-9702e6d3`]]),de=m({name:`FishVoiceOption`,props:{option:{type:Object,required:!0},playing:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:[`preview`]}),fe={class:`voice-option`},pe=[`aria-label`],me={key:0,class:`spin`,viewBox:`0 0 24 24`,width:`13`,height:`13`,"aria-hidden":`true`},he={key:1,viewBox:`0 0 24 24`,width:`13`,height:`13`,"aria-hidden":`true`},ge={key:2,viewBox:`0 0 24 24`,width:`13`,height:`13`,"aria-hidden":`true`},_e={key:1,class:`preview placeholder`,"aria-hidden":`true`},ve={class:`meta`},ye={class:`label`},be={key:0,class:`description`};function xe(r,a,c,l,u,d){return p(),s(`div`,fe,[r.option.audio?(p(),s(`button`,{key:0,type:`button`,class:n([`preview`,{playing:r.playing,loading:r.loading}]),"aria-label":r.playing?`stop preview`:`play preview`,onMousedown:a[0]||=t(()=>{},[`prevent`]),onClick:a[1]||=t(e=>r.$emit(`preview`,r.option),[`stop`,`prevent`])},[r.loading?(p(),s(`svg`,me,[...a[2]||=[e(`circle`,{cx:`12`,cy:`12`,r:`9`,fill:`none`,stroke:`currentColor`,"stroke-width":`3`,"stroke-linecap":`round`,"stroke-dasharray":`42 60`},null,-1)]])):r.playing?(p(),s(`svg`,he,[...a[3]||=[e(`rect`,{x:`6`,y:`5`,width:`4`,height:`14`,rx:`1`,fill:`currentColor`},null,-1),e(`rect`,{x:`14`,y:`5`,width:`4`,height:`14`,rx:`1`,fill:`currentColor`},null,-1)]])):(p(),s(`svg`,ge,[...a[4]||=[e(`path`,{d:`M8 5v14l11-7z`,fill:`currentColor`},null,-1)]]))],42,pe)):(p(),s(`span`,_e,[...a[5]||=[e(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`},[e(`path`,{d:`M12 14a3 3 0 0 0 3-3V6a3 3 0 0 0-6 0v5a3 3 0 0 0 3 3zm5-3a5 5 0 0 1-10 0H5a7 7 0 0 0 6 6.92V21h2v-3.08A7 7 0 0 0 19 11z`,fill:`currentColor`})],-1)]])),e(`div`,ve,[e(`span`,ye,i(r.option.label),1),r.option.description?(p(),s(`span`,be,i(r.option.description),1)):o(``,!0)])])}var Se=F(de,[[`render`,xe],[`__scopeId`,`data-v-c16a6a46`]]),Ce=e=>(e.id||e._id||e.reference_id||``).toString(),Z=e=>{let t=Ce(e);return{value:t,label:e.title||t,description:e.description,audio:e.samples?.[0]?.audio}},we=m({name:`FishVoicePicker`,components:{ElSelect:g,ElOption:_,ElOptionGroup:h,VoiceOption:Se},data(){return{popularVoices:[],searchVoices:[],popularLoading:!1,searchLoading:!1,preloaded:!1,query:``,playingId:null,loadingId:null,labelCache:{},previewAudio:null,searchTimer:null,searchSeq:0}},computed:{remoteLoading(){return this.popularLoading||this.searchLoading},myVoices(){return this.$store.state.fish?.voices??[]},myOptions(){return this.myVoices.map(Z).filter(e=>!!e.value)},publicPool(){return this.query&&(this.searchVoices.length||this.searchLoading)?{voices:this.searchVoices,isSearch:!0}:{voices:this.popularVoices,isSearch:!1}},publicOptions(){let e=new Set(this.myOptions.map(e=>e.value));return this.publicPool.voices.map(Z).filter(t=>!!t.value&&!e.has(t.value))},filteredMyOptions(){return this.applyQuery(this.myOptions)},filteredPublicOptions(){return this.publicPool.isSearch?this.publicOptions:this.applyQuery(this.publicOptions)},fallbackOption(){let e=this.value;return!e||this.myOptions.some(t=>t.value===e)||this.publicOptions.some(t=>t.value===e)?null:{value:e,label:this.labelCache[e]||e}},noDataText(){return this.remoteLoading?this.$t(`fish.message.searching`):this.credential?.token?this.$t(`fish.message.searchVoiceHint`):this.$t(`fish.message.noVoices`)},credential(){return this.$store.state.fish?.credential},value:{get(){return this.$store.state.fish?.config?.reference_id},set(e){this.$store.commit(`fish/setConfig`,{...this.$store.state.fish?.config,reference_id:e||void 0})}}},watch:{myOptions:{immediate:!0,handler(e){this.cacheLabels(e)}},publicOptions(e){this.cacheLabels(e)},credential:{immediate:!0,handler(e){if(!e?.token)return;let t=this.$store.state.fish?.voices;(t===void 0||t.length===0)&&this.$store.dispatch(`fish/getVoices`),this.preloaded||this.fetchPopular()}}},beforeUnmount(){this.stopPreview(),this.searchTimer&&clearTimeout(this.searchTimer)},methods:{cacheLabels(e){for(let t of e)this.labelCache[t.value]=t.label},applyQuery(e){let t=this.query.toLowerCase();return t?e.filter(e=>e.label.toLowerCase().includes(t)||(e.description||``).toLowerCase().includes(t)):e},onVisibleChange(e){e&&!this.preloaded&&!this.popularLoading&&this.fetchPopular()},onFilter(e){if(this.query=(e||``).trim(),this.searchTimer&&clearTimeout(this.searchTimer),!this.query){this.searchSeq++,this.searchVoices=[],this.searchLoading=!1;return}this.searchTimer=setTimeout(()=>this.fetchSearch(this.query),350)},async fetchPopular(){let e=this.credential?.token;if(!(!e||this.popularLoading)){this.popularLoading=!0;try{let{data:t}=await P.listModels({self:!1,page_size:30,page_number:1},{token:e});this.popularVoices=t?.items??[],this.preloaded=!0}catch(e){console.error(`fish.loadPopularVoices failed`,e)}finally{this.popularLoading=!1}}},async fetchSearch(e){let t=this.credential?.token;if(!t)return;let n=++this.searchSeq;this.searchLoading=!0;try{let{data:r}=await P.listModels({self:!1,page_size:30,page_number:1,title:e},{token:t});if(n!==this.searchSeq)return;this.searchVoices=r?.items??[]}catch(e){n===this.searchSeq&&(this.searchVoices=[]),console.error(`fish.searchPublicVoices failed`,e)}finally{n===this.searchSeq&&(this.searchLoading=!1)}},togglePreview(e){if(!e.audio)return;if(this.playingId===e.value||this.loadingId===e.value){this.stopPreview();return}this.stopPreview();let t=new Audio(e.audio),n=()=>{this.previewAudio===t&&(this.loadingId=null,this.playingId=e.value)},r=()=>{this.previewAudio===t&&this.stopPreview()};t.addEventListener(`playing`,n),t.addEventListener(`ended`,r),t.addEventListener(`error`,r),this.previewAudio=t,this.loadingId=e.value,this.playingId=null,t.play().catch(()=>{this.previewAudio===t&&this.stopPreview()})},stopPreview(){this.previewAudio&&=(this.previewAudio.pause(),this.previewAudio.src=``,null),this.playingId=null,this.loadingId=null}}}),Te={class:`field`},Ee={class:`title font-bold`};function De(t,n,r,m,h,g){let _=l(`el-option`),v=l(`voice-option`),y=l(`el-option-group`),b=l(`el-select`);return p(),s(`div`,Te,[e(`h2`,Ee,i(t.$t(`fish.name.voice`)),1),a(b,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,"popper-class":`fish-voice-popper`,placeholder:t.$t(`fish.placeholder.voice`),clearable:``,filterable:``,"filter-method":t.onFilter,loading:t.remoteLoading,"loading-text":t.$t(`fish.message.searching`),"no-data-text":t.noDataText,onVisibleChange:t.onVisibleChange},{default:d(()=>[t.fallbackOption?(p(),u(_,{key:t.fallbackOption.value,label:t.fallbackOption.label,value:t.fallbackOption.value},null,8,[`label`,`value`])):o(``,!0),t.filteredMyOptions.length?(p(),u(y,{key:1,label:t.$t(`fish.title.myVoices`)},{default:d(()=>[(p(!0),s(c,null,f(t.filteredMyOptions,e=>(p(),u(_,{key:e.value,label:e.label,value:e.value},{default:d(()=>[a(v,{option:e,playing:t.playingId===e.value,loading:t.loadingId===e.value,onPreview:t.togglePreview},null,8,[`option`,`playing`,`loading`,`onPreview`])]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`label`])):o(``,!0),t.filteredPublicOptions.length?(p(),u(y,{key:2,label:t.$t(`fish.group.publicVoices`)},{default:d(()=>[(p(!0),s(c,null,f(t.filteredPublicOptions,e=>(p(),u(_,{key:e.value,label:e.label,value:e.value},{default:d(()=>[a(v,{option:e,playing:t.playingId===e.value,loading:t.loadingId===e.value,onPreview:t.togglePreview},null,8,[`option`,`playing`,`loading`,`onPreview`])]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`label`])):o(``,!0)]),_:1},8,[`modelValue`,`placeholder`,`filter-method`,`loading`,`loading-text`,`no-data-text`,`onVisibleChange`])])}var Oe=m({name:`FishConfigPanel`,components:{MagicIcon:j,ElButton:N,ElSlider:S,TextInput:ae,ModelSelector:ue,VoicePicker:F(we,[[`render`,De],[`__scopeId`,`data-v-6183b210`]]),Consumption:W},emits:[`generate`],computed:{config(){return this.$store.state.fish?.config},consumption(){let e=this.config?.text?.trim()??``;return z({...this.config,model:this.config?.model??`s2-pro`,byte_count:new TextEncoder().encode(e).byteLength},this.service?.cost)},service(){return this.$store.state.fish?.service},canGenerate(){let e=this.config?.text;return typeof e==`string`&&e.trim().length>0},speed:{get(){return this.config?.prosody?.speed??1},set(e){this.$store.commit(`fish/setConfig`,{...this.config,prosody:{...this.config?.prosody??{},speed:e}})}}},methods:{onGenerate(){this.$emit(`generate`)}}}),ke={class:`flex flex-col h-full`},Ae={class:`flex-1 overflow-y-auto p-5`},je={class:`field mb-4`},Me={class:`title font-bold`},Ne={class:`flex flex-col items-center justify-center px-5 pb-5`};function Pe(t,n,o,c,u,f){let m=l(`text-input`),h=l(`model-selector`),g=l(`voice-picker`),_=l(`el-slider`),v=l(`consumption`),y=l(`magic-icon`),b=l(`el-button`);return p(),s(`div`,ke,[e(`div`,Ae,[a(m,{class:`mb-4`}),a(h,{class:`mb-4`}),a(g,{class:`mb-4`}),e(`div`,je,[e(`h2`,Me,i(t.$t(`fish.name.speed`)),1),a(_,{modelValue:t.speed,"onUpdate:modelValue":n[0]||=e=>t.speed=e,min:.5,max:2,step:.1,class:`value`,"show-input":``},null,8,[`modelValue`])])]),e(`div`,Ne,[a(v,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(b,{type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:d(()=>[a(y,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`fish.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`])])])}var Fe=F(Oe,[[`render`,Pe],[`__scopeId`,`data-v-dc4ea983`]]);function Ie(e){if(!e)return;let t=e.error;if(t){let e=typeof t==`string`?t:t.message;if(e)return e.trim()}let n=e.message;if(!(typeof n!=`string`||!n.trim()))return Q(n.trim())}function Q(e){if(e.startsWith(`[`))try{let t=JSON.parse(e);if(Array.isArray(t)&&t.length){let e=t.map(e=>{let t=typeof e?.msg==`string`?e.msg:void 0;if(!t)return;let n=Array.isArray(e?.loc)?e.loc.filter(e=>e!==`parameters`):[],r=n.length?n[n.length-1]:void 0;return r?`${r}: ${t}`:t}).filter(e=>!!e),n=Array.from(new Set(e));if(n.length)return n.join(`; `)}}catch{}if(e.startsWith(`{`))try{let t=JSON.parse(e);if(t&&typeof t.message==`string`&&t.message.trim())return Q(t.message.trim())}catch{}return e}var Le=m({name:`FishTaskPreview`,components:{DeleteIcon:ee,ElTooltip:v,ChannelIcon:T,CpuIcon:Y,InfoIcon:k,MagicIcon:j,MicrophoneIcon:A,TimeIcon:C,WarningIcon:te,CopyToClipboard:H,ElAlert:y,ElButton:N,ApiCodeButton:G,ReportButton:U},props:{modelValue:{type:Object,required:!0}},computed:{prompt(){return this.modelValue?.request?.text},audioUrl(){return this.modelValue?.response?.audio_url},isFailure(){let e=this.modelValue?.response;if(!e||e.audio_url)return!1;if(e.success===!1||e.error)return!0;let t=Number(e.status);return!Number.isNaN(t)&&t>=400||!!e.message},failureReason(){return Ie(this.modelValue?.response)}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await V.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(`fish/deleteTask`,{id:e}),x.success(this.$t(`common.message.deleteTaskSuccess`))}catch{x.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e){window.open(e,`_blank`)}}}),Re={class:`preview`},ze={class:`left`},Be={class:`main`},Ve={class:`bot`},He={class:`datetime`},Ue=[`aria-label`],We={class:`info`},Ge={key:0,class:`prompt mt-2`},Ke={key:0},qe={key:0,class:`content`},Je=[`src`],Ye={class:`operations mt-2`},Xe={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ze={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Qe={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$e={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},et={key:1,class:`content`},tt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},nt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},rt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},it={key:2,class:`content`},at={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function ot(n,c,u,f,m,h){let g=l(`capability-presentation`),_=l(`delete-icon`),v=l(`el-tooltip`),y=l(`el-button`),b=l(`api-code-button`),x=l(`report-button`),S=l(`cpu-icon`),C=l(`microphone-icon`),w=l(`copy-to-clipboard`),T=l(`magic-icon`),E=l(`time-icon`),D=l(`el-alert`),O=l(`warning-icon`),k=l(`info-icon`),A=l(`channel-icon`);return p(),s(`div`,Re,[e(`div`,ze,[a(g,{capability:`fish`,part:`avatar`,class:`avatar`})]),e(`div`,Be,[e(`div`,Ve,[a(g,{capability:`fish`,part:`name`}),e(`span`,He,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:d(()=>[n.modelValue?.id?(p(),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,Ue)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,We,[n.prompt?(p(),s(`p`,Ge,[r(i(n.prompt)+` `,1),n.modelValue?.response?o(``,!0):(p(),s(`span`,Ke,` - (`+i(n.$t(`fish.status.pending`))+`) `,1))])):o(``,!0)]),n.audioUrl?(p(),s(`div`,qe,[e(`audio`,{src:n.audioUrl,controls:``,preload:`metadata`,class:`w-full mb-3`},null,8,Je),e(`div`,Ye,[a(y,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=t(e=>n.onDownload(n.audioUrl),[`stop`])},{default:d(()=>[r(i(n.$t(`fish.button.download`)),1)]),_:1}),a(b,{path:`/fish/tts`,body:n.modelValue?.request},null,8,[`body`]),a(x,{service:`fish`,"target-id":n.modelValue?.id,snapshot:{text:n.modelValue?.request?.text}},null,8,[`target-id`,`snapshot`])]),a(D,{closable:!1,class:`mt-2 success`},{default:d(()=>[n.modelValue?.request?.model?(p(),s(`p`,Xe,[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.reference_id?(p(),s(`p`,Ze,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.referenceId`))+`: `+i(n.modelValue?.request?.reference_id)+` `,1),a(w,{content:n.modelValue?.request?.reference_id},null,8,[`content`])])):o(``,!0),e(`p`,Qe,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(p(),s(`p`,$e,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):n.isFailure?(p(),s(`div`,et,[a(D,{closable:!1,class:`failure`},{title:d(()=>[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.failure`)),1)]),default:d(()=>[e(`p`,tt,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])]),n.failureReason?(p(),s(`p`,$,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.failureReason`))+`: `+i(n.failureReason)+` `,1),a(w,{content:n.failureReason},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(p(),s(`p`,nt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(p(),s(`p`,rt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(w,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):(p(),s(`div`,it,[a(D,{closable:!1,class:`info`},{default:d(()=>[e(`p`,at,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(w,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})]))])])}var st=m({name:`FishRecentPanel`,components:{TaskPreview:F(Le,[[`render`,ot],[`__scopeId`,`data-v-79dbfe9e`]]),BotPlaceholder:K,NoTasks:D,ScrollList:E},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.fish?.tasks,items:this.$store.state.fish?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),ct={key:0},lt={key:2,class:`w-full h-full flex items-center justify-center`};function ut(e,t,n,r,i,m){let h=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return p(),s(c,null,[e.tasks?.items===void 0?(p(),s(`div`,ct,[a(h)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(p(),u(_,{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:d(()=>[(p(!0),s(c,null,f(e.tasks?.items,e=>(p(),u(g,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(p(),s(`div`,lt,[a(v)])):o(``,!0)],64)}var dt=m({name:`FishTtsIndex`,components:{ConfigPanel:Fe,Layout:q,RecentPanel:F(st,[[`render`,ut]]),TabSwitcher:J},mixins:[R],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.fish?.status?.getApplications===b.Request},tasksLoading(){return this.$store.state.fish?.status?.getTasks===b.Request||this.fetchingTasks},credential(){return this.$store.state.fish?.credential},config(){return this.$store.state.fish?.config},application(){return this.$store.state.fish?.application},tasks(){return this.$store.state.fish?.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(),await this.$store.dispatch(`fish/getVoices`)},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await O({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){await this.$store.dispatch(`fish/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(`fish/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!I(this.uploadTracker,e=>this.$t(e),e=>x.warning(e)))return;let e=this.config??{},t=e.text?.trim();if(!t){x.warning(this.$t(`fish.message.textRequired`));return}if(!B())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}let r=e.model||`s2-pro`,i={text:t,async:!0};e.reference_id&&(i.reference_id=e.reference_id),e.format&&(i.format=e.format),e.prosody&&Object.keys(e.prosody).length>0&&(i.prosody=e.prosody),x.info(this.$t(`fish.message.startingTask`)),re(`fish`,P.generateTts(i,{token:n,model:r})).then(()=>{x.success(this.$t(`fish.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?x.error(this.$t(`fish.message.usedUp`)):x.error(this.$t(`fish.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}}),ft={class:`flex flex-col h-full`},pt={class:`flex-1 min-h-0`};function mt(t,n,r,i,o,s){let c=l(`tab-switcher`),f=l(`config-panel`),m=l(`recent-panel`),h=l(`layout`);return p(),u(h,null,{config:d(()=>[e(`div`,ft,[a(c),e(`div`,pt,[a(f,{onGenerate:t.onGenerate},null,8,[`onGenerate`])])])]),result:d(()=>[a(m,{ref:`recentPanel`,loading:t.loadingMore,onReachTop:t.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var ht=F(dt,[[`render`,mt]]);export{ht as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{A as e,I as t,Jt as n,L as r,M as i,N as a,at as o,j as s,mt as c,tt as l,z as u}from"./vendor-chart-Dw-P17PN.js";import{t as d}from"./external-link-
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,I as t,Jt as n,L as r,M as i,N as a,at as o,j as s,mt as c,tt as l,z as u}from"./vendor-chart-Dw-P17PN.js";import{t as d}from"./external-link-jGKw--J3.js";import{Fi as f,O as p}from"./index-C_sjkBHo.js";import{t as m}from"./vue-plyr-wiIKa-zl.js";var h=u({name:`VideoPlayer`,components:{ElButton:f,ExternalLinkIcon:d,VuePlyr:m},props:{src:{type:String,required:!0},options:{type:Object,required:!1,default:()=>({})}},data(){return{failed:!1,mergedOptions:{controls:[`play-large`,`play`,`progress`,`current-time`,`mute`,`volume`,`captions`,`settings`,`pip`,`fullscreen`],iconUrl:`https://cdn.acedata.cloud/7jq4t0.svg`,quality:{default:1080,options:[1080],...this.options.quality},...this.options}}},computed:{safeSrc(){return this.src.trim()}},watch:{safeSrc(){this.failed=!1}},methods:{onError(){this.failed=!0},onOpen(){window.open(this.safeSrc,`_blank`,`noopener,noreferrer`)}}}),g={class:`video max-w-[800px] max-h-[450px] rounded-[15px] overflow-hidden`},_=[`src`],v={key:1,class:`video-fallback`};function y(u,d,f,p,m,h){let y=o(`vue-plyr`),b=o(`external-link-icon`),x=o(`el-button`);return l(),a(`div`,g,[!u.failed&&u.safeSrc?(l(),s(y,{key:u.safeSrc,options:u.mergedOptions},{default:c(()=>[e(`video`,{controls:``,playsinline:``,preload:`metadata`,class:`w-full h-full aspect-[16/9]`,onError:d[0]||=(...e)=>u.onError&&u.onError(...e)},[e(`source`,{size:`1080`,src:u.safeSrc,type:`video/mp4`},null,8,_)],32)]),_:1},8,[`options`])):u.safeSrc?(l(),a(`div`,v,[r(x,{type:`primary`,round:``,onClick:u.onOpen},{default:c(()=>[r(b,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),t(` `+n(u.$t(`common.button.download`)),1)]),_:1},8,[`onClick`])])):i(``,!0)])}var b=p(h,[[`render`,y],[`__scopeId`,`data-v-0d13923b`]]);export{b as t};
|