@acedatacloud/nexior 3.339.0 → 3.340.0
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-CkM0nK72.js → ApiCodeButton-C53iqEQJ.js} +1 -1
- package/dist/assets/{Artifacts-DS6fbMlE.js → Artifacts-DhlQzEQE.js} +1 -1
- package/dist/assets/{AskUserQuestionCard-ClPJXtcz.js → AskUserQuestionCard-BcFriHpf.js} +1 -1
- package/dist/assets/{AudioPreview-DFzFcjCr.js → AudioPreview-DBlfO6Xc.js} +1 -1
- package/dist/assets/{Auth-euGTIpm6.js → Auth-Dr_839SO.js} +1 -1
- package/dist/assets/{Bare-Df2t-M3n.js → Bare-CAMZgvl_.js} +1 -1
- package/dist/assets/{BotPlaceholder-D4gOMQjG.js → BotPlaceholder-BVLOfJ2E.js} +1 -1
- package/dist/assets/{BottomFooter-BcrKS5Zi.js → BottomFooter-TiOblMeI.js} +1 -1
- package/dist/assets/{Callback-LQfJCE_X.js → Callback-Bgkx-B3y.js} +1 -1
- package/dist/assets/{CodeSnippet-CDiJoaYx.js → CodeSnippet-DqNabo9W.js} +1 -1
- package/dist/assets/{Console-CvB3B3mI.js → Console-dGJY3uFE.js} +1 -1
- package/dist/assets/{Consumption-CGUzUXdy.js → Consumption-DsITlBWE.js} +1 -1
- package/dist/assets/{Conversation-CK85E2Mg.js → Conversation-Dj5BcvUq.js} +1 -1
- package/dist/assets/{Conversation-DkmENQGa.js → Conversation-DooUC60y.js} +1 -1
- package/dist/assets/{CopyToClipboard-DkvN0ug5.js → CopyToClipboard-DjaFSD8h.js} +1 -1
- package/dist/assets/{Detail-BlSE7B_R.js → Detail-NhRxkjlq.js} +2 -2
- package/dist/assets/{Extra-CmslvJrJ.js → Extra-C1G7zbtI.js} +1 -1
- package/dist/assets/{FilePreview-BRt8rCBT.js → FilePreview-B9t0uoeF.js} +1 -1
- package/dist/assets/{Hailuo-kuWkRUOK.js → Hailuo-CL6Ps8ey.js} +1 -1
- package/dist/assets/{History-Bbo_x4s-.js → History-C1IFE3AK.js} +1 -1
- package/dist/assets/{ImagePreview-D6hzVct7.js → ImagePreview-b03ynxL7.js} +1 -1
- package/dist/assets/{ImageWrapper-CLgEMJJl.js → ImageWrapper-fcuuvktS.js} +1 -1
- package/dist/assets/{Index-B23h_h8t.js → Index-6c2Ur0gi.js} +1 -1
- package/dist/assets/{Index-gYF7TnxL.js → Index-8IlOdDgM.js} +1 -1
- package/dist/assets/{Index-ByIRGvyU2.js → Index-BSt_cGkK2.js} +1 -1
- package/dist/assets/{Index-pkFlLz2B.js → Index-BT2p3Wmd.js} +1 -1
- package/dist/assets/{Index-C8TKcfjo.js → Index-BWUUjYCb.js} +1 -1
- package/dist/assets/{Index-BwcxlAaN.js → Index-BYTzdZyj.js} +1 -1
- package/dist/assets/{Index-CCgpULFS.js → Index-Bf1aCfej.js} +1 -1
- package/dist/assets/{Index-B-VqC22d.js → Index-BlGkV7ak.js} +1 -1
- package/dist/assets/{Index-BbMK3mL42.js → Index-BxVzjszm2.js} +1 -1
- package/dist/assets/{Index-HUElyXn0.js → Index-C6j5M9WH.js} +1 -1
- package/dist/assets/{Index-BiUOuAqW2.js → Index-C7uOUABI2.js} +1 -1
- package/dist/assets/{Index-DdQoVWZi.js → Index-CHMShReg.js} +1 -1
- package/dist/assets/{Index-DX3-Z9cm.js → Index-CImgfVak.js} +1 -1
- package/dist/assets/{Index-XG6ohfmJ.css → Index-CLdIE6-p.css} +1 -1
- package/dist/assets/{Index-CxreD-7V2.js → Index-CT2KK54Q2.js} +1 -1
- package/dist/assets/{Index-DlP1jnYL.js → Index-CWZQWicD.js} +1 -1
- package/dist/assets/{Index-CpOruj-I2.js → Index-CfGs6fy92.js} +1 -1
- package/dist/assets/{Index-KkEoVEmK.js → Index-Cq8FSlcm.js} +1 -1
- package/dist/assets/{Index-Cvzv0rxS.js → Index-D9aCoNvv.js} +1 -1
- package/dist/assets/{Index--kE2-ity.js → Index-DBCrRPIg.js} +1 -1
- package/dist/assets/{Index-CR5icC2x.js → Index-DGyN8Om6.js} +1 -1
- package/dist/assets/{Index-i4DgYnRA.js → Index-DLaUd-vF.js} +1 -1
- package/dist/assets/{Index-BNvmd4EW2.js → Index-DSqvDROa2.js} +1 -1
- package/dist/assets/{Index-Bn4f3PCp.js → Index-DZ0eV8Uk.js} +1 -1
- package/dist/assets/Index-GeuLYw7X.js +1 -0
- package/dist/assets/{Index-Bq0uFYoQ.js → Index-LwgrxUef.js} +1 -1
- package/dist/assets/{Index-De3-YyxW.js → Index-ODNBY7SW.js} +1 -1
- package/dist/assets/{Index-D2iNN_M82.js → Index-PfKTsZ3G2.js} +1 -1
- package/dist/assets/{Index-3MmANfb1.js → Index-Zp_nb7A0.js} +1 -1
- package/dist/assets/{Index-a-N6PHbh.js → Index-aug2J_4b.js} +1 -1
- package/dist/assets/{Index-uEhYg2hb.js → Index-lsV3XiEo.js} +1 -1
- package/dist/assets/{Invitees-DKi50m8r.js → Invitees-DUEJqgMm.js} +1 -1
- package/dist/assets/{List-2KskSv3u.js → List-CNsHHuZX.js} +1 -1
- package/dist/assets/{List-2whyW1sv.js → List-C_E4sOF9.js} +1 -1
- package/dist/assets/{List-Pu5Gd_Qm.js → List-D9YQrHxw.js} +1 -1
- package/dist/assets/{LocalTools-B1LWMpb_.js → LocalTools-BbdUPXgw.js} +1 -1
- package/dist/assets/{LocalTools-BJMzNzr8.js → LocalTools-CpToFV55.js} +1 -1
- package/dist/assets/{Main-BS6CBTnV.js → Main-CLFmXixx.js} +1 -1
- package/dist/assets/{Message-CA--Drnw.js → Message-D7XI1GqO.js} +1 -1
- package/dist/assets/{Model-C13FZdu0.js → Model-DQcpcqab.js} +1 -1
- package/dist/assets/{Navigator-CGNmLz0n.js → Navigator-DFO27NGz.js} +3 -3
- package/dist/assets/{NotFound-DpvaZ46V.js → NotFound-gP5-KjW8.js} +1 -1
- package/dist/assets/{Pay-CqzF5dNu.js → Pay-3XB9OmLU.js} +1 -1
- package/dist/assets/{Player-3Aog58bz.js → Player-sLmc2Uk_.js} +1 -1
- package/dist/assets/{Poivelle-CRsK61ZN.js → Poivelle-B_tjy6aV.js} +1 -1
- package/dist/assets/{PromptTextarea-C56bhHTR.js → PromptTextarea-DzLkvnua.js} +1 -1
- package/dist/assets/{RealtimeCall-tJEIwOwL.js → RealtimeCall-BL60h9Vx.js} +1 -1
- package/dist/assets/ScheduledTasks-AaqZxBj1.js +2 -0
- package/dist/assets/ScheduledTasks-BrbQ8BXC.css +1 -0
- package/dist/assets/{Status-1ad6OXzj.js → Status-BA52MaNQ.js} +1 -1
- package/dist/assets/{Subscribe-DDWgmUy1.js → Subscribe-BmA6p9Q1.js} +1 -1
- package/dist/assets/{TabSwitcher-Cs_kPZYG.js → TabSwitcher-CWkcNrnf.js} +1 -1
- package/dist/assets/{Tts-Bf1PmRF7.js → Tts-DlYouSuG.js} +1 -1
- package/dist/assets/{VideoPlayer-BEg9PHIa.js → VideoPlayer-B3LF1ktd.js} +1 -1
- package/dist/assets/{alert-B3fkwmi_.js → alert-CRHBgg7r.js} +1 -1
- package/dist/assets/arrow-down-BStB4PHw.js +1 -0
- package/dist/assets/{arrow-down-wide-narrow-DOlLZOzE.js → arrow-down-wide-narrow-wgc-CX8H.js} +1 -1
- package/dist/assets/arrow-left-EUbth0iN.js +1 -0
- package/dist/assets/arrow-right-CQBJ5g4J.js +1 -0
- package/dist/assets/arrow-up-f6Vjbbn1.js +1 -0
- package/dist/assets/{avatar-CeIgyvkc.js → avatar-CPGQkpMq.js} +1 -1
- package/dist/assets/{basic-CH5q8hpV.js → basic-B-rk4HWN.js} +1 -1
- package/dist/assets/{box-D8Vb978l.js → box-47XDEQlP.js} +1 -1
- package/dist/assets/{boxes-3zaG-Mil.js → boxes-CMI7YUPa.js} +1 -1
- package/dist/assets/{brain-D8uxeTlC.js → brain-n1WvTwZR.js} +1 -1
- package/dist/assets/{chart-no-axes-combined-C12FhP49.js → chart-no-axes-combined-B6WPcV1a.js} +1 -1
- package/dist/assets/{chat-B5ZWBMJd.js → chat-BKDUzUHK.js} +1 -1
- package/dist/assets/{chat-DziWSTCE.js → chat-BYtcpf0F.js} +1 -1
- package/dist/assets/{chat-cjvZr8ex.js → chat-Ba2cNuX2.js} +1 -1
- package/dist/assets/{chat-BoB027w0.js → chat-BeDLUBt_.js} +1 -1
- package/dist/assets/{chat-B7t8Llwu.js → chat-BgfQwQ8d.js} +1 -1
- package/dist/assets/{chat-CbjBTBYd.js → chat-BkCNOp8r.js} +1 -1
- package/dist/assets/{chat-DZ-gkHzH.js → chat-Buggwc0w.js} +1 -1
- package/dist/assets/{chat-DRexpyfS.js → chat-CNEjj4_y.js} +1 -1
- package/dist/assets/{chat-ByqmdJEv.js → chat-CpYZ_bQs.js} +1 -1
- package/dist/assets/{chat-C4H7V9Nj.js → chat-CqPGhtVC.js} +1 -1
- package/dist/assets/{chat-CPFSYEhP.js → chat-D-WtNkx0.js} +1 -1
- package/dist/assets/{chat-CRNp9Aw-.js → chat-DSOenbOC.js} +1 -1
- package/dist/assets/{chat-C37WqESr.js → chat-Djv-9amT.js} +1 -1
- package/dist/assets/{chat-CY5idqsd.js → chat-Dk34jsJx.js} +1 -1
- package/dist/assets/{chat-aXB6hm9c.js → chat-Sd2ZBGRP.js} +1 -1
- package/dist/assets/{chat-D-xVBNhf.js → chat-_ztwiNQ2.js} +1 -1
- package/dist/assets/{chat-CAY8wIIG.js → chat-a7G9yGpP.js} +1 -1
- package/dist/assets/{chat--QU1zv14.js → chat-tDREYcpe.js} +1 -1
- package/dist/assets/{chat-DudhYvNh.js → chat-vquaXBBf.js} +1 -1
- package/dist/assets/check-CAo4ikWV.js +1 -0
- package/dist/assets/chevron-down-CxVHqDJz.js +1 -0
- package/dist/assets/chevron-right-BEfFxSCG.js +1 -0
- package/dist/assets/circle-check-DGz0qEnu.js +1 -0
- package/dist/assets/clock-Bsi4ai5b.js +1 -0
- package/dist/assets/{codingBridge-Dmz_0xAe.js → codingBridge-9dmspAt1.js} +1 -1
- package/dist/assets/codingBridge-BAuqbil5.js +1 -0
- package/dist/assets/{codingBridge-79OVpxfm.js → codingBridge-BB1ch4Tk.js} +1 -1
- package/dist/assets/{codingBridge-B4WiK8s4.js → codingBridge-BMHQXkUv.js} +1 -1
- package/dist/assets/{codingBridge-SiELI0Z0.js → codingBridge-BUt2ponV.js} +1 -1
- package/dist/assets/{codingBridge-CNp-6naF.js → codingBridge-BmSsYXFJ.js} +1 -1
- package/dist/assets/{codingBridge-YfbrbSvG.js → codingBridge-CAgEs16R.js} +1 -1
- package/dist/assets/{codingBridge-Cvcb8cCx.js → codingBridge-CWXBZ8w7.js} +1 -1
- package/dist/assets/{codingBridge-CmL3Vmf1.js → codingBridge-C_LA7d0d.js} +1 -1
- package/dist/assets/{codingBridge-ktGoyeGs.js → codingBridge-CfANMF5m.js} +1 -1
- package/dist/assets/{codingBridge-RNk2BFt1.js → codingBridge-Ct6ZrIBM.js} +1 -1
- package/dist/assets/codingBridge-D5C8MGMI.js +1 -0
- package/dist/assets/{codingBridge-nvGc4nvQ.js → codingBridge-D8nO-Hpu.js} +1 -1
- package/dist/assets/{codingBridge-BBqD0mY_.js → codingBridge-DJxBs9t7.js} +1 -1
- package/dist/assets/{codingBridge-BiRb6HPN.js → codingBridge-DLI7oqZE.js} +1 -1
- package/dist/assets/{codingBridge-BU35PDfQ.js → codingBridge-DqMLYCPV.js} +1 -1
- package/dist/assets/{codingBridge-BDEy322x.js → codingBridge-DsC1i-NL.js} +1 -1
- package/dist/assets/{codingBridge-_Z_z-5e8.js → codingBridge-N7nwbCfO.js} +1 -1
- package/dist/assets/{codingBridge-CvkyeYFh.js → codingBridge-qEXVv0GZ.js} +1 -1
- package/dist/assets/{codingBridgeNotify-23aHMZK3.js → codingBridgeNotify-ByLUF7rm.js} +2 -2
- package/dist/assets/{coins-CBIprYKY.js → coins-COUuOITw.js} +1 -1
- package/dist/assets/{collapse-BkqdKC7g.js → collapse-D3vQMyuD.js} +1 -1
- package/dist/assets/{constants-kuIe0Rg4.js → constants-ChRYidMs.js} +1 -1
- package/dist/assets/{copy-ChPYxtPg.js → copy-gbh1Hu-_.js} +1 -1
- package/dist/assets/{createTaskActions-8sSE6fP5.js → createTaskActions-CHWFXisn.js} +1 -1
- package/dist/assets/{digitalhuman-DwbWoTQl.js → digitalhuman-WcRqTqSJ.js} +1 -1
- package/dist/assets/{dollar-sign-Bm6gAU49.js → dollar-sign-fvSq6HvT.js} +1 -1
- package/dist/assets/{download-e6keFu33.js → download-CG81Did-.js} +1 -1
- package/dist/assets/{drawer-xXnemy0j.js → drawer-BZGf6ZhI.js} +1 -1
- package/dist/assets/{dropdown-DdyNy8Rw.js → dropdown-BBqC0uWO.js} +1 -1
- package/dist/assets/{dropdown-ByJ_2We7.js → dropdown-BCi6FXaJ.js} +1 -1
- package/dist/assets/{ellipsis-qEDz75HE.js → ellipsis-a4Bk1qVm.js} +1 -1
- package/dist/assets/esm-CogX6iPS.js +1 -0
- package/dist/assets/{esm-GKdujo3J.js → esm-CysK7GKi.js} +1 -1
- package/dist/assets/{esm-Ctb6oLJw.js → esm-DSrcKj2_.js} +2 -2
- package/dist/assets/{esm-0B6EYwz9.js → esm-DXJhje5t.js} +2 -2
- package/dist/assets/{esm-DQmwROlF.js → esm-DeiyNqVX.js} +1 -1
- package/dist/assets/{esm-CxR5BtoM.js → esm-NezqVFAM.js} +1 -1
- package/dist/assets/{esm-BCSjYEfy.js → esm-qpzPZ_mj.js} +3 -3
- package/dist/assets/{external-link-B6US6Rpg.js → external-link-EzZxNXQ9.js} +1 -1
- package/dist/assets/{eye-Cr1Znq0K.js → eye-DPR3t5H4.js} +1 -1
- package/dist/assets/{file-output-ikTtYafN.js → file-output-Ddb60zUZ.js} +1 -1
- package/dist/assets/{file-text-OrBVmeSG.js → file-text-D0VMwMGQ.js} +1 -1
- package/dist/assets/{fish-Yhag4lip.js → fish-DYRPNr5z.js} +1 -1
- package/dist/assets/{flux-CbIPwgs6.js → flux-BkG6ASg7.js} +1 -1
- package/dist/assets/{folder-BgdW6lws.js → folder-ClSkgYIN.js} +1 -1
- package/dist/assets/gauge-D2Ok9N0J.js +1 -0
- package/dist/assets/{globe-DNJUaTgi.js → globe-Cst9bSnj.js} +1 -1
- package/dist/assets/{grokvideo-B7LjfVXK.js → grokvideo-mNntjoyY.js} +1 -1
- package/dist/assets/{hailuo-CxDE-mab.js → hailuo-F1AoVBCE.js} +1 -1
- package/dist/assets/{headphones-DgIVHcmG.js → headphones-_SL2ngUm.js} +1 -1
- package/dist/assets/{history-Bto6cN79.js → history-C4mTAvhH.js} +1 -1
- package/dist/assets/{house-DQNaN-7w.js → house-C6rVua6s.js} +1 -1
- package/dist/assets/{i18n-HQNt54Ek.js → i18n-CBsCcxss.js} +1 -1
- package/dist/assets/{image-2C4Q9nSl.js → image-CrociZMa.js} +1 -1
- package/dist/assets/{index-DclC-KvF.js → index-B7AvV6gb.js} +4 -4
- package/dist/assets/{index-A6IWsaDV.css → index-B96mS-VB.css} +1 -1
- package/dist/assets/{index.browser.esm-DD1uIXY4.js → index.browser.esm-BkdaJSC1.js} +1 -1
- package/dist/assets/{index.es-VZkRqp-n.js → index.es-CfsshD34.js} +1 -1
- package/dist/assets/{info-sYS8Y4kZ.js → info-b31RIJKS.js} +1 -1
- package/dist/assets/{input-number-C6amd5vF.js → input-number-7NoaJFRg.js} +1 -1
- package/dist/assets/{key-round-YMPA2L3S.js → key-round-BuUXc3LI.js} +1 -1
- package/dist/assets/{kling-CscH6fPa.js → kling-DXFm-Vrf.js} +1 -1
- package/dist/assets/{languages-DJSWJg_9.js → languages-T3h-MRu3.js} +1 -1
- package/dist/assets/{laptop-DevaAUz9.js → laptop-CvHOFeWt.js} +1 -1
- package/dist/assets/{lightbulb-DnXua8le.js → lightbulb-B69DHoPU.js} +1 -1
- package/dist/assets/{link-BdkjCN0Y.js → link-Rds3CFa2.js} +1 -1
- package/dist/assets/loader-circle-DGvoDYzG.js +1 -0
- package/dist/assets/{luma-DKV2bzE9.js → luma-C4AnyIcV.js} +1 -1
- package/dist/assets/{maestro-lcLZOPXN.js → maestro-CHc2bCDT.js} +1 -1
- package/dist/assets/{maestro-C3_a0CuS.js → maestro-pARlroeQ.js} +1 -1
- package/dist/assets/{mail-CmZND3xY.js → mail-Dr4pLLtF.js} +1 -1
- package/dist/assets/{message-circle-CiByvBdZ.js → message-circle-BcGNzIqU.js} +1 -1
- package/dist/assets/{mic-BYGWDeAx.js → mic-261ODdC5.js} +1 -1
- package/dist/assets/{midjourney-B3XFryiX.js → midjourney-DhYwAR-2.js} +1 -1
- package/dist/assets/{mobileLocalExec-1atJP6x6.js → mobileLocalExec-DgvSRKH8.js} +2 -2
- package/dist/assets/{mouse-pointer-2-DFp76Lze.js → mouse-pointer-2-DcsISNp6.js} +1 -1
- package/dist/assets/music-2-S1CFcpBO.js +1 -0
- package/dist/assets/{nanobanana-Dout2QBa.js → nanobanana-UVOi6CUI.js} +1 -1
- package/dist/assets/{omni-BO9QFSd5.js → omni-y32Foccy.js} +1 -1
- package/dist/assets/{openaiimage-DMj0yHBa.js → openaiimage-BblyVnx1.js} +1 -1
- package/dist/assets/{pagination-Dt4h-CYK.js → pagination-CoGkcyAo.js} +1 -1
- package/dist/assets/{pagination-YnyoMu0n.js → pagination-DnB7ouBK.js} +1 -1
- package/dist/assets/{palette-QH_N2qy3.js → palette-DMbY5GYC.js} +1 -1
- package/dist/assets/{paperclip-BI23sMic.js → paperclip-CAlRj4_H.js} +1 -1
- package/dist/assets/{pause-CmrIIxKL.js → pause-tW8Kn0a8.js} +1 -1
- package/dist/assets/{pencil-iOazcNI9.js → pencil-Df-6bbXx.js} +1 -1
- package/dist/assets/{pika-DCu4veEc.js → pika-Bj7F-g-e.js} +1 -1
- package/dist/assets/{pixverse-DPv5meLz.js → pixverse-CQPOixS1.js} +1 -1
- package/dist/assets/play-Cs1nkoSU.js +1 -0
- package/dist/assets/plus-D6nWrjI3.js +1 -0
- package/dist/assets/{poivelle-DzJLVR4q.js → poivelle-Ws7saXsu.js} +1 -1
- package/dist/assets/{popover-C0Au0mzn.js → popover-DIhVVXRx.js} +1 -1
- package/dist/assets/{producer-Do9WPvkT.js → producer-BsY7ApiR.js} +1 -1
- package/dist/assets/{qrart-j8d6lL8O.js → qrart-CqOuYyAM.js} +1 -1
- package/dist/assets/{realtime-B1AHEDod.js → realtime-B1SMTllz.js} +1 -1
- package/dist/assets/{refresh-cw-b1AkLCqS.js → refresh-cw-BfGn0-Qb.js} +1 -1
- package/dist/assets/rotate-ccw-Dv4ixwpv.js +1 -0
- package/dist/assets/rotate-cw-D7qdtaeZ.js +1 -0
- package/dist/assets/{row-23HtkcJ-.js → row-DrXf0_C2.js} +1 -1
- package/dist/assets/search-C5XGKEzo.js +1 -0
- package/dist/assets/{seedance-t2ucDdeV.js → seedance-BGEhqMEr.js} +1 -1
- package/dist/assets/{seedream-CODWzrQE.js → seedream-BDzs7lv6.js} +1 -1
- package/dist/assets/{select-uldXAWrH.js → select-CpvztHBU.js} +1 -1
- package/dist/assets/{serp-DXFJ1vwE.js → serp-CAOKmMPj.js} +1 -1
- package/dist/assets/{shield-85Ky2cjp.js → shield-Cx5H35pg.js} +1 -1
- package/dist/assets/{shuffle-CDTL9DSH.js → shuffle-GjsQeLmo.js} +1 -1
- package/dist/assets/{slider-CkGNG5a7.js → slider-C4b9QcFi.js} +1 -1
- package/dist/assets/{sliders-horizontal-C-mcuIlt.js → sliders-horizontal-BNAJnZQP.js} +1 -1
- package/dist/assets/{solana-wallets-DQX7HqBh.js → solana-wallets-uD-WHvp1.js} +2 -2
- package/dist/assets/{solana-wallets-vue-DuDouSj_.js → solana-wallets-vue-EzjUux3e.js} +1 -1
- package/dist/assets/{sora-BTZ0nrMi.js → sora-sr37OxD8.js} +1 -1
- package/dist/assets/{sparkles-C1bVqIi2.js → sparkles-C-lRE-Ow.js} +1 -1
- package/dist/assets/square-C3V0vdTe.js +1 -0
- package/dist/assets/{suno-DVtkvulS.js → suno-Cv4TAPJe.js} +1 -1
- package/dist/assets/{switch-BUWm07k_.js → switch-CcTn0ZOS.js} +1 -1
- package/dist/assets/{table-BWzhSccy.js → table-Dx28EUJl.js} +1 -1
- package/dist/assets/{tabs-DvovyKyk.js → tabs-DmvNvKRc.js} +1 -1
- package/dist/assets/{tag-COWwJzLe.js → tag-n80nZI1k.js} +1 -1
- package/dist/assets/{taskDrawerMixin-CN9a-kE5.js → taskDrawerMixin-CHY-eE38.js} +1 -1
- package/dist/assets/terminal-BIXp0_cN.js +1 -0
- package/dist/assets/{time-picker-RhvsMlGr.js → time-picker-CY4dR1RV.js} +1 -1
- package/dist/assets/{tooltip-uHCMYOmh.js → tooltip-DNvXWorG.js} +1 -1
- package/dist/assets/{trash-2-5sbW29HW.js → trash-2-CV1FM8ox.js} +1 -1
- package/dist/assets/{triangle-alert-CmcoYwyi.js → triangle-alert-BQ9oPsw-.js} +1 -1
- package/dist/assets/{upload-D5gTmf2B.js → upload-BlXiZnzq.js} +1 -1
- package/dist/assets/{upload-BXWufnq_.js → upload-etzwq2ge.js} +1 -1
- package/dist/assets/user-vLPEc58o.js +1 -0
- package/dist/assets/{veo-C1L3SSK3.js → veo-Cj6sSMSg.js} +1 -1
- package/dist/assets/{video-vs3mnHBf.js → video-Dnk7rtTR.js} +1 -1
- package/dist/assets/{volume-2--vgnhO7U.js → volume-2-Cz9VwFEj.js} +1 -1
- package/dist/assets/{wallet-DzpMPbZa.js → wallet-dtGRrnvh.js} +1 -1
- package/dist/assets/{wan-BvPxuu-D.js → wan-Dws2KEHU.js} +1 -1
- package/dist/assets/{wand-sparkles-ClrEVQmB.js → wand-sparkles-C82CTAsQ.js} +1 -1
- package/dist/assets/{web-DSkehJrI.js → web-CYpJeG2N.js} +1 -1
- package/dist/assets/{web-VIddDBkP.js → web-CmrD6k5b.js} +1 -1
- package/dist/assets/{web-CPFjQr_D.js → web-CxoBHBRl.js} +1 -1
- package/dist/assets/{web-Demze5kT.js → web-D3JKZRqR.js} +1 -1
- package/dist/assets/{web-CZNEyq1l.js → web-DVUiM8kr.js} +1 -1
- package/dist/assets/{webextrator-CMoKX3rs.js → webextrator-BEan9_EQ.js} +1 -1
- package/dist/assets/{zap-C_S03Xuq.js → zap-B-U_qAqr.js} +1 -1
- package/dist/index.html +4 -4
- package/package.json +1 -1
- package/dist/assets/Index-Ct406vcg.js +0 -1
- package/dist/assets/ScheduledTasks-BLYsSIDU.css +0 -1
- package/dist/assets/ScheduledTasks-Dir7KQE9.js +0 -2
- package/dist/assets/arrow-down-Sm7s7IIT.js +0 -1
- package/dist/assets/arrow-left-Cpc0pmeK.js +0 -1
- package/dist/assets/arrow-right-BisLvjok.js +0 -1
- package/dist/assets/arrow-up-CUmFX8Wr.js +0 -1
- package/dist/assets/check-DiJNmwu0.js +0 -1
- package/dist/assets/chevron-down-CALXpR4g.js +0 -1
- package/dist/assets/chevron-right-D8QgyTSe.js +0 -1
- package/dist/assets/circle-check-DAPHKJhw.js +0 -1
- package/dist/assets/clock-i2EK0vEv.js +0 -1
- package/dist/assets/codingBridge-C47BZlU-.js +0 -1
- package/dist/assets/codingBridge-D6B0ckAI.js +0 -1
- package/dist/assets/esm-DSVrE2_V.js +0 -1
- package/dist/assets/gauge-CiWKexEC.js +0 -1
- package/dist/assets/loader-circle-BZGy8H-n.js +0 -1
- package/dist/assets/music-2-Ieg_Zv19.js +0 -1
- package/dist/assets/play-DcNEy99F.js +0 -1
- package/dist/assets/plus-DtdIAhMW.js +0 -1
- package/dist/assets/rotate-ccw-B8iLlVrx.js +0 -1
- package/dist/assets/rotate-cw-BmbWtODr.js +0 -1
- package/dist/assets/search-ICgLYEEh.js +0 -1
- package/dist/assets/square-CrEmZBEk.js +0 -1
- package/dist/assets/terminal-CKyTbfJ2.js +0 -1
- package/dist/assets/user-BRXa_Nk1.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-EUbth0iN.js";import{t as l}from"./house-C6rVua6s.js";import{E as u}from"./index-B7AvV6gb.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"./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-B3fkwmi_.js";import{t as ee}from"./card-D-4S-l7a.js";import{n as m,t as h}from"./row-23HtkcJ-.js";import{i as g,n as _,r as v,t as y}from"./wechat-Jy07BKOo.js";import{t as b}from"./divider-BNWJAaA2.js";import{t as x}from"./skeleton-B3LIGUiE.js";import{E as S,Ei as C,Fi as w,It as T,Ni as E,Yt as D,Zr as O,fi as k,li as A,qt as te,tr as j,xi as M}from"./index-DclC-KvF.js";import{t as N}from"./CopyToClipboard-DkvN0ug5.js";var P=f({name:`PublicWechatPayDialog`,components:{ElDialog:C,ElButton:w,QrCode:T,ElRow:h,ElCol:m},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()},isMobileInsideWechat(){return _()&&y()},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 D(e,{debug:!1})}catch{t=!1}t?(this.copied=!0,this.copiedTimer&&clearTimeout(this.copiedTimer),this.copiedTimer=window.setTimeout(()=>{this.copied=!1},2e3)):M.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,ee,m){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=S(P,[[`render`,H]]),W=f({name:`PublicStripePayDialog`,components:{ElDialog:C},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=S(W,[[`render`,K]]),ne=f({name:`PublicAlipayPayDialog`,components:{ElDialog:C},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=S(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:w,ElRow:h,ElCol:m,ElCard:ee,ElSkeleton:x,ElDivider:b,ElAlert:p,ElDescriptions:v,ElDescriptionsItem:g,ElTag:E,PublicWechatPay:U,PublicStripePay:q,PublicAlipayPay:X,CopyToClipboard:N},data(){return{PayWay:Q,OrderState:O,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!k()}},watch:{paying(e){e?this.startOrderPolling(re):this.stopOrderPolling()}},created(){this._orderRefreshTimer=void 0},mounted(){this.onFetchData()},beforeUnmount(){this.stopOrderPolling()},methods:{getPriceString:te,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===O.PAID||e?.state===O.FINISHED||e?.state===O.FAILED||e?.state===O.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,ee,m,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=S(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-CRHBgg7r.js";import{t as ee}from"./card-D-4S-l7a.js";import{n as m,t as h}from"./row-DrXf0_C2.js";import{i as g,n as _,r as v,t as y}from"./wechat-Jy07BKOo.js";import{t as b}from"./divider-BNWJAaA2.js";import{t as x}from"./skeleton-B3LIGUiE.js";import{E as S,Ei as C,Fi as w,It as T,Ni as E,Yt as D,Zr as O,fi as k,li as A,qt as te,tr as j,xi as M}from"./index-B7AvV6gb.js";import{t as N}from"./CopyToClipboard-DjaFSD8h.js";var P=f({name:`PublicWechatPayDialog`,components:{ElDialog:C,ElButton:w,QrCode:T,ElRow:h,ElCol:m},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()},isMobileInsideWechat(){return _()&&y()},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 D(e,{debug:!1})}catch{t=!1}t?(this.copied=!0,this.copiedTimer&&clearTimeout(this.copiedTimer),this.copiedTimer=window.setTimeout(()=>{this.copied=!1},2e3)):M.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,ee,m){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=S(P,[[`render`,H]]),W=f({name:`PublicStripePayDialog`,components:{ElDialog:C},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=S(W,[[`render`,K]]),ne=f({name:`PublicAlipayPayDialog`,components:{ElDialog:C},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=S(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:w,ElRow:h,ElCol:m,ElCard:ee,ElSkeleton:x,ElDivider:b,ElAlert:p,ElDescriptions:v,ElDescriptionsItem:g,ElTag:E,PublicWechatPay:U,PublicStripePay:q,PublicAlipayPay:X,CopyToClipboard:N},data(){return{PayWay:Q,OrderState:O,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!k()}},watch:{paying(e){e?this.startOrderPolling(re):this.stopOrderPolling()}},created(){this._orderRefreshTimer=void 0},mounted(){this.onFetchData()},beforeUnmount(){this.stopOrderPolling()},methods:{getPriceString:te,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===O.PAID||e?.state===O.FINISHED||e?.state===O.FAILED||e?.state===O.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,ee,m,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=S(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{t as _}from"./popover-
|
|
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{t as _}from"./popover-DIhVVXRx.js";import{t as v}from"./slider-C4b9QcFi.js";import{t as y}from"./arrow-left-EUbth0iN.js";import{t as ee}from"./arrow-right-CQBJ5g4J.js";import{t as b}from"./pause-tW8Kn0a8.js";import{t as x}from"./play-Cs1nkoSU.js";import{t as S}from"./volume-2-Cz9VwFEj.js";import{E as C,oi as w,yi as T}from"./index-B7AvV6gb.js";var E=T(`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 D(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 O=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)})})),k=Symbol(`AudioNamespace`),A=Symbol(`AudioQueue`),j=()=>{let e=c(k);if(!e)throw Error(`[player] useAudioNamespace() must be called inside <Player namespace="suno|producer">`);return e},M=e=>{let t=e??j(),n=w(),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(A,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`})}}},N={class:`player-slider`},P=g({__name:`PlayerSlider`,setup(e){let{field:t,dispatchAudio:n}=M(),r=t(`progress`),a=t(`duration`),c=()=>{},l=e=>n({progress:Array.isArray(e)?e[0]:e});return(e,t)=>(m(),s(`div`,N,[i(o(v),{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`])]))}}),F={class:`flex player-song`},I=[`src`],L={class:`ml-2 text-xs flex flex-col justify-between`},R={class:`w-52 2xl:w-96 cursor-pointer truncate`},z={class:`flex`},B={class:`ml-2 text-dc`},V=g({__name:`PlayerSong`,setup(e){let{audio:n,patchAudio:i}=M(),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`,F,[t(`img`,{alt:``,class:`w-11 h-11 rounded`,src:o(n)?.image_url||o(`/assets/disk-XFRmVAfp.png`)},null,8,I),t(`div`,L,[t(`div`,R,[t(`div`,z,[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}=M(),i=n(`progress`),a=n(`duration`);return(e,n)=>(m(),s(`div`,H,[t(`span`,U,r(o(D)(o(i)))+` / `+r(o(D)(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}=M(),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(v),{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=C(g({__name:`PlayerController`,setup(e){let{audio:r,dispatchAudio:c,tracks:l,currentIndex:u,playAdjacent:p}=M(),h=d(()=>l.value.length>1),g=d(()=>u.value>0),v=d(()=>u.value!==-1&&u.value<l.value.length-1),C=()=>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(y),{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:C},[i(o(b),{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:C},[i(o(x),{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`,v.value?`text-[var(--el-text-color-regular)]`:`opacity-30 cursor-not-allowed`]),disabled:!v.value,"aria-label":e.$t(`common.player.next`),title:e.$t(`common.player.next`),onClick:c[1]||=e=>v.value&&o(p)(1)},[i(o(ee),{size:`1em`,"aria-hidden":`true`,focusable:`false`})],10,Q)):a(``,!0),i(o(_),{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(S),{"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(k,n.namespace),p(A,d(()=>n.tracks??[])),(e,n)=>(m(),s(`div`,ne,[i(P),t(`div`,re,[t(`div`,ie,[i(V)]),t(`div`,ae,[i(te)]),t(`div`,oe,[i(W)])])]))}});export{E as i,O as n,D 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-DFO27NGz.js";import{E as l}from"./index-B7AvV6gb.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-63c6dd21`]]);export{d 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,it as s,j as c,mt as l,tt as u,z as d}from"./vendor-chart-Dw-P17PN.js";import{t as f}from"./tooltip-
|
|
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,it as s,j as c,mt as l,tt as u,z as d}from"./vendor-chart-Dw-P17PN.js";import{t as f}from"./tooltip-DNvXWorG.js";import{E as p,Ei as m,Fi as h,Wi as g,yi as _}from"./index-B7AvV6gb.js";import{a as v}from"./pagination-CoGkcyAo.js";var y=_(`hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),b=_(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),x=d({name:`PromptTextarea`,components:{FullscreenIcon:b,ElInput:g,ElButton:h,ElTooltip:f,ElDialog:m,InfoIcon:v},props:{modelValue:{type:String,default:``},title:{type:String,required:!0},info:{type:String,default:``},placeholder:{type:String,default:``},minRows:{type:Number,default:4},maxRows:{type:Number,default:12},maxlength:{type:Number,default:0},expandable:{type:Boolean,default:!0},dialogTitle:{type:String,default:``}},emits:[`update:modelValue`,`expand`],data(){return{expanded:!1}},computed:{text:{get(){return this.modelValue??``},set(e){this.$emit(`update:modelValue`,e)}},hasMaxlength(){return typeof this.maxlength==`number`&&this.maxlength>0},effectiveMaxlength(){return this.hasMaxlength?this.maxlength:void 0}},methods:{onExpand(){this.expanded=!0,this.$emit(`expand`)}}}),S={class:`prompt-textarea`},C={class:`header`},w={class:`heading`},T={class:`title font-bold`},E={class:`actions`};function D(d,f,p,m,h,g){let _=o(`info-icon`),v=o(`fullscreen-icon`),y=o(`el-button`),b=o(`el-tooltip`),x=o(`el-input`),D=o(`el-dialog`);return u(),a(`div`,S,[e(`div`,C,[e(`div`,w,[e(`h2`,T,n(d.title),1),d.info?(u(),c(_,{key:0,content:d.info},null,8,[`content`])):i(``,!0)]),e(`div`,E,[s(d.$slots,`actions`,{},void 0,!0),d.expandable?(u(),c(b,{key:0,content:d.$t(`common.button.expand`),placement:`top`},{default:l(()=>[r(y,{size:`small`,circle:``,class:`expand-btn`,"aria-label":d.$t(`common.button.expand`),title:d.$t(`common.button.expand`),onClick:d.onExpand},{default:l(()=>[r(v,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`,`onClick`])]),_:1},8,[`content`])):i(``,!0)])]),s(d.$slots,`before`,{},void 0,!0),r(x,{modelValue:d.text,"onUpdate:modelValue":f[0]||=e=>d.text=e,type:`textarea`,class:`textarea`,autosize:{minRows:d.minRows,maxRows:d.maxRows},resize:`vertical`,placeholder:d.placeholder,maxlength:d.effectiveMaxlength,"show-word-limit":d.hasMaxlength},null,8,[`modelValue`,`autosize`,`placeholder`,`maxlength`,`show-word-limit`]),s(d.$slots,`after`,{},void 0,!0),d.expandable?(u(),c(D,{key:0,modelValue:d.expanded,"onUpdate:modelValue":f[3]||=e=>d.expanded=e,title:d.dialogTitle||d.title,width:`720px`,top:`5vh`,"close-on-click-modal":!1,class:`prompt-expand-dialog`,"append-to-body":``},{footer:l(()=>[r(y,{type:`primary`,onClick:f[2]||=e=>d.expanded=!1},{default:l(()=>[t(n(d.$t(`common.button.confirm`)),1)]),_:1})]),default:l(()=>[r(x,{modelValue:d.text,"onUpdate:modelValue":f[1]||=e=>d.text=e,type:`textarea`,autosize:{minRows:14,maxRows:28},placeholder:d.placeholder,maxlength:d.effectiveMaxlength,"show-word-limit":d.hasMaxlength,autofocus:``},null,8,[`modelValue`,`placeholder`,`maxlength`,`show-word-limit`])]),_:1},8,[`modelValue`,`title`])):i(``,!0)])}var O=p(x,[[`render`,D],[`__scopeId`,`data-v-0543313c`]]);export{b as n,y as r,O as t};
|
|
@@ -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-CALXpR4g.js";import{t as _}from"./info-sYS8Y4kZ.js";import{t as v}from"./mic-BYGWDeAx.js";import{Ii as y,Mi as b,Ni as x,Pi as S,ua as C}from"./constants-kuIe0Rg4.js";import{E as w,P as T,vi as E,yi as D}from"./index-DclC-KvF.js";var O=D(`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=D(`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:T})}}}),F={class:`rtc-top`},I={class:`rtc-top-left`},L=[`title`,`aria-label`],R={class:`voice-pick`},ee={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`,R,[e(`button`,{class:n([`voice-chip`,{on:h.voiceMenuOpen}]),onClick:g[1]||=t(e=>h.voiceMenuOpen=!h.voiceMenuOpen,[`stop`])},[e(`span`,ee,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-CxVHqDJz.js";import{t as _}from"./info-b31RIJKS.js";import{t as v}from"./mic-261ODdC5.js";import{Ii as y,Mi as b,Ni as x,Pi as S,ua as C}from"./constants-ChRYidMs.js";import{E as w,P as T,vi as E,yi as D}from"./index-B7AvV6gb.js";var O=D(`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=D(`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:T})}}}),F={class:`rtc-top`},I={class:`rtc-top-left`},L=[`title`,`aria-label`],R={class:`voice-pick`},ee={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`,R,[e(`button`,{class:n([`voice-chip`,{on:h.voiceMenuOpen}]),onClick:g[1]||=t(e=>h.voiceMenuOpen=!h.voiceMenuOpen,[`stop`])},[e(`span`,ee,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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,S as c,T as l,at as u,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-CpvztHBU.js";import{t as ne}from"./time-picker-CY4dR1RV.js";import{n as re,t as _}from"./form-BNJ9LdPs.js";import{t as v}from"./tooltip-DNvXWorG.js";import{t as y}from"./card-D-4S-l7a.js";import{r as b,t as x}from"./radio-DgDgyT2l.js";import{t as S}from"./drawer-BZGf6ZhI.js";import{t as C}from"./empty-B1wenOj5.js";import{t as w}from"./input-number-7NoaJFRg.js";import{t as T}from"./pagination-DnB7ouBK.js";import{t as E}from"./skeleton-B3LIGUiE.js";import{t as D}from"./switch-CcTn0ZOS.js";import{t as O}from"./brain-n1WvTwZR.js";import{t as k}from"./chevron-right-BEfFxSCG.js";import{t as A}from"./clock-Bsi4ai5b.js";import{t as j}from"./copy-gbh1Hu-_.js";import{t as M}from"./pencil-Df-6bbXx.js";import{t as N}from"./play-Cs1nkoSU.js";import{t as P}from"./plus-D6nWrjI3.js";import{t as F}from"./refresh-cw-BfGn0-Qb.js";import{t as I}from"./trash-2-CV1FM8ox.js";import{t as L}from"./vendor-axios-Ck2ffRoh.js";import{Ri as R,Zi as z,ra as B}from"./constants-ChRYidMs.js";import{E as V,Ei as H,Fi as U,Ni as W,Wi as G,bi as K,nn as ie,xi as q}from"./index-B7AvV6gb.js";function J(e){let t=ie();return{Authorization:`Bearer ${e}`,"Content-Type":`application/json`,...t?{"x-site-origin":t}:{}}}var Y=`${B}/aichat2/scheduled-tasks`,X=2e4,ae=3300;function oe(e,t){return e.status!==`queued`&&e.status!==`running`?!1:t/1e3-e.scheduled_at<ae}function se(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 L.post(Y,{action:`retrieve_batch`},{headers:J(e)});return t?.items??[]}async createTask(e,t,n=!1){let{data:r}=await L.post(Y,{action:`create`,...t,...n?{force:!0}:{}},{headers:J(e)});return r}async updateTask(e,t,n,r=!1){let{data:i}=await L.post(Y,{action:`update`,id:t,...n,...r?{force:!0}:{}},{headers:J(e)});return i}async deleteTask(e,t){await L.post(Y,{action:`delete`,id:t},{headers:J(e)})}async triggerTask(e,t){let{data:n}=await L.post(Y,{action:`trigger`,id:t},{headers:J(e)});return n??{}}async listRuns(e,t){let{data:n}=await L.post(Y,{action:`retrieve_runs`,id:t},{headers:J(e),timeout:X});return n?.items??[]}async listAllRuns(e,t={}){let{data:n}=await L.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 L.post(Y,{action:`retrieve_authorizable_skills`},{headers:J(e)});return t?.items??[]}async listAuthorizableCapabilities(e){let{data:t}=await L.post(Y,{action:`retrieve_authorizable_skills`},{headers:J(e)});return{skills:t?.skills??t?.items??[],mcp_servers:t?.mcp_servers??[]}}},Q=Intl.DateTimeFormat().resolvedOptions().timeZone||`Asia/Shanghai`,$=50,ce=12*1e3,le=3,ue=h({name:`ScheduledTasks`,components:{AiIcon:O,ExpandRightIcon:k,PlayIcon:N,TimeIcon:A,AddIcon:P,CopyIcon:j,DeleteIcon:I,EditIcon:M,RefreshIcon:F,ElButton:U,ElCard:y,ElSkeleton:E,ElEmpty:C,ElSwitch:D,ElTag:W,ElTooltip:v,ElDrawer:S,ElDialog:H,ElForm:_,ElFormItem:re,ElInput:G,ElSelect:ee,ElOption:te,ElOptionGroup:g,ElRadioGroup:b,ElRadio:x,ElTimePicker:ne,ElInputNumber:w,Pagination:T},data(){return{tasks:[],runs:[],activeTab:`tasks`,tabs:[`tasks`,`runs`],statusFilters:[`all`,`success`,`failed`,`running`,`queued`],allRuns:[],allRunsCount:0,allRunsLoading:!1,allRunsStatus:`all`,allRunsPage:1,allRunsPageSize:20,allRunsRequestId:0,loading:!1,runsLoading:!1,skillsLoading:!1,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()}},computed:{token(){return this.$store.state.chat?.credential?.token},modelGroups(){let e=this.$store.state.site?.features??{};return R.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.humanizeSchedule(this.buildSchedule())}catch{return``}},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:z,scheduleType:`daily`,intervalValue:4,intervalUnit:`hour`,hourlyMinute:0,dailyTime:`09:00`,weekday:1,cronExpr:`0 9 * * *`,authorizedSkills:[],authorizedMcpServers:[],browserConnectionId:``,connectionAccounts:{},authorizationExpiresAt:Math.floor(Date.now()/1e3)+720*60*60,maxTurns:$}},deriveName(e){let t=(e||``).trim().split(`
|
|
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{q.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||q.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||q.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<le&&this.visibleRuns().some(t=>oe(t,e)))||document.hidden){this.stopRunPolling();return}this.runPollTimer||=setInterval(()=>void this.pollRuns(),ce)},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)},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,authorizedSkills:e.unattended_policy?.mode===`allow_selected_skills`&&e.unattended_policy.allowed_skills||[],authorizedMcpServers:e.unattended_policy?.mode===`allow_selected_skills`&&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??$}},openEdit(e){this.editingTask=e,this.form=this.taskToForm(e),this.showCreateDialog=!0,this.loadAuthorizableSkills()},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())},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}=this.form;if(e===`interval`)return{type:`interval`,interval_seconds:Math.max(60,Math.round(t)*(n===`day`?86400:n===`hour`?3600:60)),tz:Q};if(e===`hourly`)return{type:`cron`,cron:`${Math.min(59,Math.max(0,Math.round(r)))} * * * *`,tz:Q};if(e===`daily`){let[e,t]=i.split(`:`);return{type:`cron`,cron:`${t} ${e} * * *`,tz:Q}}if(e===`weekly`){let[e,t]=i.split(`:`);return{type:`cron`,cron:`${t} ${e} * * ${a}`,tz:Q}}return{type:`cron`,cron:o,tz:Q}},async saveTask(){if(!this.form.question.trim()){q.warning(this.$t(`chat.scheduledTasks.form.required`));return}if(this.form.authorizedSkills.length>0||this.form.authorizedMcpServers.length>0)try{await K.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 e=[...this.form.authorizedSkills],t=[...this.form.authorizedMcpServers],n;if(this.selectedBrowserSkills.length){let e=this.selectedBrowserConnection;if(!e||!e.online||!e.compatible){q.error(this.$t(`chat.scheduledTasks.form.browserBindingInvalid`));return}n=[{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 r=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)),i={name:this.form.name.trim()||this.deriveName(this.form.question),schedule:this.buildSchedule(),template:{model:this.form.model,question:this.form.question,skills:e,mcp_servers:t,max_turns:this.form.maxTurns},unattended_policy:e.length||t.length?{mode:`allow_selected_skills`,allowed_skills:e,allowed_mcp_servers:t,browser_connections:n,connection_bindings:r.length?r:void 0,expires_at:this.form.authorizationExpiresAt}:{mode:`deny_all`,allowed_skills:[],allowed_mcp_servers:[]}};await this.submitTask(i,!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}q.success(this.$t(`chat.scheduledTasks.create`)+` OK`),this.showCreateDialog=!1,this.editingTask=null,this.form=this.emptyForm()}catch(e){n=t?null:se(e),n||q.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 K.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){if(!(!this.token||this.skillsLoading||!e&&(this.authorizableSkills.length||this.authorizableMcpServers.length))){this.skillsLoading=!0;try{let e=await Z.listAuthorizableCapabilities(this.token);this.authorizableSkills=e.skills,this.authorizableMcpServers=e.mcp_servers}catch{q.error(this.$t(`chat.scheduledTasks.loadError`))}finally{this.skillsLoading=!1}}},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}),q.error(this.$t(`chat.scheduledTasks.loadError`))}},async triggerNow(e){if(!this.triggeringId){this.triggeringId=e.id;try{await Z.triggerTask(this.token,e.id),q.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{q.error(this.$t(`chat.scheduledTasks.triggerError`))}finally{this.triggeringId=``}}},async confirmDelete(e){await K.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{q.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`:`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){if(e.error_message)return e.error_message;let t=e.error_code;return 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)},formatTime(e){return new Date(e*1e3).toLocaleString()}}}),de={class:`scheduled-tasks`},fe={class:`inner`},pe={class:`header`},me={class:`title`},he=[`aria-label`],ge=[`aria-selected`,`onClick`],_e={class:`task-list`},ve={class:`task-top`},ye={class:`task-name`},be={class:`task-meta`},xe={class:`meta-chip`},Se={class:`meta-chip`},Ce={class:`task-prompt`},we={key:0,class:`task-last-output`},Te={class:`task-footer`},Ee={class:`run-count`},De={key:0,class:`error-hint`},Oe={class:`open-hint`},ke={key:0,class:`pager`},Ae=[`aria-label`],je=[`aria-pressed`,`onClick`],Me={class:`run-list`},Ne=[`tabindex`,`role`,`onClick`,`onKeydown`],Pe={class:`run-body`},Fe={class:`run-line`},Ie={class:`run-title`},Le={key:0,class:`run-preview`},Re={class:`run-sub`},ze={class:`run-time`},Be=[`title`],Ve={class:`run-action`},He={key:1,class:`run-noconv`},Ue={key:0,class:`pager`},We={key:0,class:`run-context`},Ge={class:`run-context-meta`},Ke={class:`run-context-prompt`},qe={key:3,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:4,class:`pager run-pager`},at={class:`hint`},ot={key:0,class:`schedule-preview`},st={class:`hint`},ct={class:`hint`},lt={class:`jitter-hint`},ut={class:`hint`},dt={class:`skill-option`},ft={class:`skill-option-name`},pt={key:0,class:`skill-option-missing`},mt={class:`hint`},ht={key:0,class:`browser-binding-summary`},gt={class:`hint`},_t={class:`hint`};function vt(h,g,ee,te,ne,re){let _=u(`add-icon`),v=u(`el-button`),y=u(`el-skeleton`),b=u(`el-empty`),x=u(`el-switch`),S=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`),M=u(`el-card`),N=u(`pagination`),P=u(`el-drawer`),F=u(`el-input`),I=u(`el-form-item`),L=u(`el-option`),R=u(`el-option-group`),z=u(`el-select`),B=u(`el-radio`),V=u(`el-radio-group`),H=u(`el-input-number`),U=u(`el-time-picker`),W=u(`el-form`),G=u(`el-dialog`);return m(),s(`div`,de,[e(`div`,fe,[e(`div`,pe,[e(`h2`,me,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,ge))),128))],8,he),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`,_e,[(m(!0),s(l,null,p(h.pagedTasks,n=>(m(),d(M,{key:n.id,class:`task-card`,shadow:`hover`,onClick:e=>h.selectTask(n)},{default:f(()=>[e(`div`,ve,[e(`div`,ye,i(n.name),1),e(`div`,{class:`task-actions`,onClick:g[0]||=t(()=>{},[`stop`])},[a(x,{"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(S,{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`,be,[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`,xe,[a(O,{class:`meta-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(h.scheduleLabel(n.schedule)),1)]),e(`span`,Se,[a(k,{class:`meta-icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.template.model),1)])]),e(`div`,Ce,i(n.template.question),1),n.last_output_snippet?(m(),s(`div`,we,i(n.last_output_snippet),1)):o(``,!0),e(`div`,Te,[e(`span`,Ee,[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`,De,i(h.errorCodeText(n.last_error)),1)):o(``,!0),e(`span`,Oe,[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`,ke,[a(N,{"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,je))),128))],8,Ae),h.allRunsLoading?(m(),d(y,{key:0,rows:4,animated:``,class:`loading-block`})):h.allRuns.length?(m(),s(l,{key:2},[e(`div`,Me,[(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`,Pe,[e(`div`,Fe,[e(`span`,Ie,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`,Le,i(u.conversation_preview),1)):o(``,!0),e(`div`,Re,[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),(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`,ze,i(h.formatTime(u.scheduled_at)),1),h.runOutcomeText(u)?(m(),s(`span`,{key:1,class:n(u.status===`success`?`run-outcome`:`run-error`),title:h.runOutcomeText(u)},i(h.runOutcomeText(u)),11,Be)):o(``,!0)])]),e(`div`,Ve,[u.conversation_id?(m(),d(j,{key:0,class:`run-arrow`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(m(),s(`span`,He,i(h.$t(`chat.scheduledTasks.noConversation`)),1))])],42,Ne))),128))]),h.allRunsCount>h.allRunsPageSize?(m(),s(`div`,Ue,[a(N,{"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(P,{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`,We,[e(`div`,Ge,[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`,Ke,i(h.selectedTask.template.question),1)])):o(``,!0),h.runsLoading?(m(),d(y,{key:1,rows:3,animated:``})):h.runs.length?(m(),s(`div`,qe,[(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`,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,[(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:0,class:n(u.status===`success`?`run-outcome`:`run-error`),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))])):(m(),d(b,{key:2,description:h.$t(`chat.scheduledTasks.noRuns`)},null,8,[`description`])),!h.runsLoading&&h.runs.length>h.runPageSize?(m(),s(`div`,it,[a(N,{"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(G,{modelValue:h.showCreateDialog,"onUpdate:modelValue":g[17]||=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(W,{model:h.form,"label-width":`92px`},{default:f(()=>[a(I,{label:h.$t(`chat.scheduledTasks.form.name`)},{default:f(()=>[a(F,{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(I,{label:h.$t(`chat.scheduledTasks.form.prompt`),required:``},{default:f(()=>[a(F,{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`,at,i(h.$t(`chat.scheduledTasks.form.promptHint`)),1)]),_:1},8,[`label`]),a(I,{label:h.$t(`chat.scheduledTasks.form.model`)},{default:f(()=>[a(z,{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(R,{key:e.name,label:e.getDisplayName()},{default:f(()=>[(m(!0),s(l,null,p(e.models,e=>(m(),d(L,{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(I,{label:h.$t(`chat.scheduledTasks.form.schedule`)},{default:f(()=>[a(V,{modelValue:h.form.scheduleType,"onUpdate:modelValue":g[5]||=e=>h.form.scheduleType=e},{default:f(()=>[a(B,{value:`interval`},{default:f(()=>[r(i(h.$t(`chat.scheduledTasks.scheduleType.interval`)),1)]),_:1}),a(B,{value:`hourly`},{default:f(()=>[r(i(h.$t(`chat.scheduledTasks.scheduleType.hourly`)),1)]),_:1}),a(B,{value:`daily`},{default:f(()=>[r(i(h.$t(`chat.scheduledTasks.scheduleType.daily`)),1)]),_:1}),a(B,{value:`weekly`},{default:f(()=>[r(i(h.$t(`chat.scheduledTasks.scheduleType.weekly`)),1)]),_:1}),a(B,{value:`cron`},{default:f(()=>[r(i(h.$t(`chat.scheduledTasks.scheduleType.cron`)),1)]),_:1})]),_:1},8,[`modelValue`]),h.schedulePreview?(m(),s(`div`,ot,[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`]),h.form.scheduleType===`interval`?(m(),d(I,{key:0,label:h.$t(`chat.scheduledTasks.scheduleType.interval`)},{default:f(()=>[a(H,{modelValue:h.form.intervalValue,"onUpdate:modelValue":g[6]||=e=>h.form.intervalValue=e,min:1,max:h.intervalMax,step:1,"controls-position":`right`},null,8,[`modelValue`,`max`]),a(z,{modelValue:h.form.intervalUnit,"onUpdate:modelValue":g[7]||=e=>h.form.intervalUnit=e,style:{width:`110px`,"margin-left":`8px`}},{default:f(()=>[a(L,{label:h.$t(`chat.scheduledTasks.form.intervalUnit.minute`),value:`minute`},null,8,[`label`]),a(L,{label:h.$t(`chat.scheduledTasks.form.intervalUnit.hour`),value:`hour`},null,8,[`label`]),a(L,{label:h.$t(`chat.scheduledTasks.form.intervalUnit.day`),value:`day`},null,8,[`label`])]),_:1},8,[`modelValue`]),e(`div`,st,i(h.$t(`chat.scheduledTasks.form.intervalHint`)),1)]),_:1},8,[`label`])):o(``,!0),h.form.scheduleType===`hourly`?(m(),d(I,{key:1,label:h.$t(`chat.scheduledTasks.form.hourlyMinute`)},{default:f(()=>[a(H,{modelValue:h.form.hourlyMinute,"onUpdate:modelValue":g[8]||=e=>h.form.hourlyMinute=e,min:0,max:59,step:1,"controls-position":`right`},null,8,[`modelValue`]),e(`div`,ct,i(h.$t(`chat.scheduledTasks.form.hourlyMinuteHint`)),1)]),_:1},8,[`label`])):o(``,!0),h.form.scheduleType===`daily`?(m(),d(I,{key:2,label:h.$t(`chat.scheduledTasks.form.time`)},{default:f(()=>[a(U,{modelValue:h.form.dailyTime,"onUpdate:modelValue":g[9]||=e=>h.form.dailyTime=e,format:`HH:mm`,"value-format":`HH:mm`},null,8,[`modelValue`]),e(`span`,lt,i(h.$t(`chat.scheduledTasks.jitterHint`)),1)]),_:1},8,[`label`])):o(``,!0),h.form.scheduleType===`weekly`?(m(),d(I,{key:3,label:h.$t(`chat.scheduledTasks.form.weekday`)},{default:f(()=>[a(z,{modelValue:h.form.weekday,"onUpdate:modelValue":g[10]||=e=>h.form.weekday=e,style:{width:`120px`}},{default:f(()=>[(m(!0),s(l,null,p(h.weekdays,(e,t)=>(m(),d(L,{key:t,label:e,value:t},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`]),a(U,{modelValue:h.form.dailyTime,"onUpdate:modelValue":g[11]||=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(I,{key:4,label:h.$t(`chat.scheduledTasks.form.cron`)},{default:f(()=>[a(F,{modelValue:h.form.cronExpr,"onUpdate:modelValue":g[12]||=e=>h.form.cronExpr=e,placeholder:`0 9 * * *`},null,8,[`modelValue`]),e(`div`,ut,i(h.$t(`chat.scheduledTasks.form.cronHint`)),1)]),_:1},8,[`label`])):o(``,!0),a(I,{label:h.$t(`chat.scheduledTasks.form.skills`)},{default:f(()=>[a(z,{modelValue:h.form.authorizedSkills,"onUpdate:modelValue":g[13]||=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(L,{key:t.slug,label:h.skillLabel(t),value:t.slug,disabled:!t.connected},{default:f(()=>[e(`div`,dt,[e(`span`,ft,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`,mt,i(h.$t(`chat.scheduledTasks.form.skillsHint`)),1)]),_:1},8,[`label`]),h.selectedBrowserSkills.length?(m(),d(I,{key:5,label:h.$t(`chat.scheduledTasks.form.browserConnection`),required:``},{default:f(()=>[a(z,{modelValue:h.form.browserConnectionId,"onUpdate:modelValue":g[14]||=e=>h.form.browserConnectionId=e,style:{width:`100%`}},{default:f(()=>[(m(!0),s(l,null,p(h.selectedBrowserConnections,e=>(m(),d(L,{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`,ht,[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(I,{key:e.identifier,label:h.$t(`chat.scheduledTasks.form.connectionAccount`,{connector:e.label})},{default:f(()=>[a(z,{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(L,{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(I,{label:h.$t(`chat.scheduledTasks.form.mcpServers`)},{default:f(()=>[a(z,{modelValue:h.form.authorizedMcpServers,"onUpdate:modelValue":g[15]||=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(L,{key:e.slug,label:h.mcpServerLabel(e),value:e.slug},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`loading`,`placeholder`,`onVisibleChange`]),e(`div`,gt,i(h.$t(`chat.scheduledTasks.form.mcpServersHint`)),1)]),_:1},8,[`label`]),a(I,{label:h.$t(`chat.scheduledTasks.form.maxTurns`)},{default:f(()=>[a(H,{modelValue:h.form.maxTurns,"onUpdate:modelValue":g[16]||=e=>h.form.maxTurns=e,min:1,max:50,step:1,"controls-position":`right`},null,8,[`modelValue`]),e(`div`,_t,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 yt=V(ue,[[`render`,vt],[`__scopeId`,`data-v-537d479c`]]);export{yt as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.scheduled-tasks[data-v-537d479c]{height:100%;overflow-y:auto;background-color:var(--el-bg-color-page)!important}.inner[data-v-537d479c]{max-width:880px;margin:0 auto;padding:24px 20px 48px}.header[data-v-537d479c]{justify-content:space-between;align-items:center;margin-bottom:20px;display:flex}.title[data-v-537d479c]{color:var(--el-text-color-primary);margin:0;font-size:20px;font-weight:700}.header .icon[data-v-537d479c]{margin-right:6px}.tabs[data-v-537d479c]{border-bottom:1px solid var(--app-border-subtle,var(--el-border-color-lighter));gap:6px;margin-bottom:16px;display:flex}.tab[data-v-537d479c]{appearance:none;color:var(--el-text-color-secondary);cursor:pointer;background:0 0;border:none;border-bottom:2px solid #0000;margin-bottom:-1px;padding:8px 12px;font-size:14px;font-weight:600;transition:color .16s,border-color .16s}.tab[data-v-537d479c]:hover{color:var(--el-text-color-primary)}.tab[data-v-537d479c]:focus-visible{outline:2px solid var(--el-color-primary);outline-offset:2px;border-radius:4px}.tab.active[data-v-537d479c]{color:var(--el-color-primary);border-bottom-color:var(--el-color-primary)}.filters[data-v-537d479c]{flex-wrap:wrap;gap:8px;margin-bottom:16px;display:flex}.filter-chip[data-v-537d479c]{appearance:none;border:1px solid var(--app-border-subtle,var(--el-border-color-lighter));background:var(--app-bg-surface,var(--el-bg-color-overlay));color:var(--el-text-color-regular);cursor:pointer;border-radius:999px;padding:5px 14px;font-size:13px;transition:background .16s,border-color .16s,color .16s}.filter-chip[data-v-537d479c]:hover:not(.active){background:var(--el-fill-color-lighter)}.filter-chip[data-v-537d479c]:focus-visible{outline:2px solid var(--el-color-primary);outline-offset:2px}.filter-chip.active[data-v-537d479c]{background:var(--el-color-primary);border-color:var(--el-color-primary);color:#fff}.run-task-tag[data-v-537d479c],.run-account-tag[data-v-537d479c]{text-overflow:ellipsis;flex-shrink:0;max-width:200px;overflow:hidden}@media (width<=767px){.inner[data-v-537d479c]{padding-top:56px}}.loading-block[data-v-537d479c]{padding:12px 4px}.task-list[data-v-537d479c]{flex-direction:column;gap:14px;display:flex}.task-card[data-v-537d479c]{cursor:pointer;border:none;border-radius:16px}.task-card[data-v-537d479c] .el-card__body{padding:16px 18px}.task-top[data-v-537d479c]{justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:10px;display:flex}.task-name[data-v-537d479c]{color:var(--el-text-color-primary);word-break:break-word;font-size:16px;font-weight:600;line-height:1.4}.task-actions[data-v-537d479c]{flex-shrink:0;align-items:center;gap:0;display:flex}.task-actions .el-button+.el-button[data-v-537d479c]{margin-left:0}.icon-action[data-v-537d479c]{padding:6px 5px}.task-meta[data-v-537d479c]{flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:10px;display:flex}.meta-chip[data-v-537d479c]{color:var(--el-text-color-secondary);background:var(--el-fill-color-light);border-radius:8px;align-items:center;gap:5px;padding:3px 9px;font-size:12px;display:inline-flex}.meta-icon[data-v-537d479c]{opacity:.85;font-size:11px}.task-prompt[data-v-537d479c]{color:var(--el-text-color-regular);white-space:pre-line;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;font-size:13px;line-height:1.55;display:-webkit-box;overflow:hidden}.task-last-output[data-v-537d479c]{color:var(--el-text-color-secondary);background:var(--el-fill-color-lighter);-webkit-line-clamp:2;line-clamp:2;border-radius:10px;-webkit-box-orient:vertical;margin-top:10px;padding:10px 12px;font-size:12px;line-height:1.5;display:-webkit-box;overflow:hidden}.task-footer[data-v-537d479c]{color:var(--el-text-color-secondary);align-items:center;gap:10px;margin-top:12px;font-size:12px;display:flex}.run-count[data-v-537d479c]{align-items:center;gap:5px;display:inline-flex}.footer-icon[data-v-537d479c]{opacity:.85;font-size:11px}.error-hint[data-v-537d479c]{color:var(--el-color-danger);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.open-hint[data-v-537d479c]{color:var(--el-color-primary);flex-shrink:0;align-items:center;gap:5px;margin-left:auto;display:inline-flex}.empty[data-v-537d479c]{padding:60px 0}.pager[data-v-537d479c]{justify-content:center;margin-top:20px;display:flex}.run-pager[data-v-537d479c]{margin-top:8px}.run-context[data-v-537d479c]{border-bottom:1px solid var(--app-border-subtle,var(--el-border-color-lighter));margin-bottom:14px;padding-bottom:14px}.run-context-meta[data-v-537d479c]{color:var(--el-text-color-secondary);flex-wrap:wrap;gap:8px;font-size:12px;display:flex}.run-context-meta span+span[data-v-537d479c]:before{content:"·";color:var(--el-text-color-placeholder);margin-right:8px}.run-context-prompt[data-v-537d479c]{color:var(--el-text-color-secondary);white-space:pre-line;max-height:48px;margin-top:8px;font-size:12px;line-height:1.55;overflow:hidden}.run-list[data-v-537d479c]{flex-direction:column;gap:10px;display:flex}.run-item[data-v-537d479c]{border:1px solid var(--app-border-subtle,var(--el-border-color-lighter));background:var(--app-bg-surface,var(--el-bg-color-overlay));border-radius:14px;align-items:center;gap:12px;padding:12px 14px;transition:background .16s,border-color .16s;display:flex}.run-item.clickable[data-v-537d479c]{cursor:pointer}.run-item.clickable[data-v-537d479c]:hover,.run-item.clickable[data-v-537d479c]:focus-visible{background:var(--el-fill-color-lighter);border-color:var(--el-border-color);outline:none}.run-body[data-v-537d479c]{flex-direction:column;flex:1;gap:6px;min-width:0;display:flex}.run-line[data-v-537d479c]{align-items:center;gap:8px;display:flex}.run-title[data-v-537d479c]{min-width:0;color:var(--el-text-color-primary);white-space:nowrap;text-overflow:ellipsis;flex:1;font-size:14px;font-weight:600;overflow:hidden}.run-tag[data-v-537d479c]{flex-shrink:0}.run-preview[data-v-537d479c]{color:var(--el-text-color-secondary);white-space:nowrap;text-overflow:ellipsis;font-size:12px;line-height:1.5;overflow:hidden}.run-sub[data-v-537d479c]{flex-wrap:wrap;align-items:center;gap:10px;min-width:0;display:flex}.run-time[data-v-537d479c]{color:var(--el-text-color-secondary);font-size:12px}.run-error[data-v-537d479c],.run-outcome[data-v-537d479c]{min-width:0;color:var(--el-text-color-secondary);white-space:nowrap;text-overflow:ellipsis;font-size:11px;overflow:hidden}.run-action[data-v-537d479c]{flex-shrink:0;align-self:center;align-items:center;display:flex}.run-arrow[data-v-537d479c]{color:var(--el-text-color-secondary);flex-shrink:0;font-size:12px}.run-noconv[data-v-537d479c]{color:var(--el-text-color-secondary);flex-shrink:0;font-size:11px}.hint[data-v-537d479c]{color:var(--el-text-color-secondary);flex-basis:100%;margin-top:6px;font-size:11px;line-height:1.5}.jitter-hint[data-v-537d479c]{color:var(--el-text-color-secondary);margin-left:8px;font-size:11px}.schedule-preview[data-v-537d479c]{background:var(--el-fill-color-light);width:fit-content;color:var(--el-text-color-regular);border-radius:8px;flex-basis:100%;align-items:center;gap:6px;margin-top:12px;padding:7px 12px;font-size:12px;display:inline-flex}.preview-icon[data-v-537d479c]{color:var(--el-color-primary)}.skill-option[data-v-537d479c]{justify-content:space-between;align-items:center;gap:8px;min-width:0;display:flex}.skill-option-name[data-v-537d479c]{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.skill-option-missing[data-v-537d479c]{color:var(--el-text-color-secondary);flex-shrink:0;font-size:11px}.run-history-drawer.el-drawer,.run-history-drawer .el-drawer{border-top-left-radius:18px;border-bottom-left-radius:18px;overflow:hidden}.scheduled-task-dialog.el-dialog,.scheduled-task-dialog .el-dialog{border-radius:16px;overflow:hidden}
|
|
@@ -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{W as h}from"./use-deprecated-r4dlLNqm.js";import{t as g}from"./chart-no-axes-combined-
|
|
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{W as h}from"./use-deprecated-r4dlLNqm.js";import{t as g}from"./chart-no-axes-combined-B6WPcV1a.js";import{t as _}from"./check-CAo4ikWV.js";import{t as v}from"./coins-COUuOITw.js";import{t as y}from"./wallet-dtGRrnvh.js";import{B as b,E as x,Ei as S,Fi as C,K as w,fi as T,hi as E,hn as D,ri as O}from"./index-B7AvV6gb.js";import{t as k}from"./CopyToClipboard-DjaFSD8h.js";var A=m({name:`ApplicationInfo`,components:{AnalyticsIcon:g,ConfirmIcon:_,CreditsIcon:v,ElButton:C,ElIcon:h,CopyToClipboard:k,WalletIcon:y},props:{application:{type:Object,required:!0},showType:{type:Boolean,default:!1},showId:{type:Boolean,default:!1}},emits:[`buy`,`usage`],computed:{showPayment(){return D(this.$store.getters.site)?!1:!T()||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)}}}),j={class:`flex flex-col min-w-0`},M={key:0,class:`app-id-row`},N={class:`icon !mb-0 flex-shrink-0`},P={class:`app-id-line`},F={class:`app-id-label`},I={class:`app-id-value`},L={key:1,class:`icon`},R={class:`text-left`},z={class:`description`},ee={key:0},B={key:1},V={class:`value`},H={class:`description2`},U={key:0},W={key:1},G={class:`actions`};function K(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`,j,[a(v,{class:`check`},{default:d(()=>[a(_,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1}),n.showId?(p(),s(`div`,M,[e(`div`,N,[a(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`div`,P,[e(`span`,F,i(n.$t(`application.field.id`))+`:`,1),e(`span`,I,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`,L,[a(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`})])),e(`div`,R,[e(`p`,z,[n.application.service?(p(),s(`span`,B,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`,V,i(n.remainingAmountText)+` `+i(n.$t(`service.unit.`+(n.application?.service?.unit||`credit`)+`s`)),1),e(`p`,H,[n.application.type===`Period`?(p(),s(`span`,U,i(n.$t(`application.field.expiredAt`))+`: `+i(n.$dayjs.format(n.application.expired_at)),1)):(p(),s(`span`,W,i(n.$t(`application.message.neverExpire`)),1))])])]),e(`div`,G,[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 q=m({name:`ApplicationStatus`,components:{WalletIcon:y,ElDialog:S,ApplicationInfo:x(A,[[`render`,K],[`__scopeId`,`data-v-19146d4c`]])},props:{application:{type:Object,required:!0},applications:{type:Array,default:void 0},service:{type:Object,required:!0}},emits:[`select`],data(){return{visible:!1,applicationType:O}},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:w,query:{application_id:e.id}};if(E()){this.visible=!1,this.$router.push(t);return}window.open(this.$router.resolve(t).href,`_blank`)},onBuyMore(e){let t={name:b,params:{id:e.id}};if(E()){this.visible=!1,this.$router.push(t);return}window.open(this.$router.resolve(t).href,`_blank`)},onSelectApplication(e){this.$emit(`select`,e)}}}),J={class:`status`},Y={key:0},X={class:`text-center mb-4`},Z={class:`flex flex-col gap-4 mb-6 overflow-y-auto`},Q=[`title`],$={class:`entry-amount`},te={class:`entry-unit`};function ne(t,r,m,h,g,_){let v=l(`application-info`),y=l(`el-dialog`),b=l(`wallet-icon`);return p(),s(`div`,J,[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`,Y,[e(`p`,X,i(t.$t(`application.message.applicationSelection`)),1),e(`div`,Z,[(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`,$,i(t.balanceText),1),e(`span`,te,i(t.balanceUnit),1)],8,Q)])}var re=x(q,[[`render`,ne],[`__scopeId`,`data-v-b2f8b2d1`]]);export{re 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{t as m}from"./card-D-4S-l7a.js";import{n as h,t as g}from"./row-
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,T as s,at as c,j as l,mt as u,rt as d,tt as f,z as p}from"./vendor-chart-Dw-P17PN.js";import{t as m}from"./card-D-4S-l7a.js";import{n as h,t as g}from"./row-DrXf0_C2.js";import{t as _}from"./empty-B1wenOj5.js";import{t as v}from"./skeleton-B3LIGUiE.js";import{t as y}from"./check-CAo4ikWV.js";import{B as b,E as x,Fi as S,Ni as C,U as w,V as T,Xn as E,br as D,dn as O,fi as k,fr as A,hn as j,ii as M,ln as N,qt as P,ri as F,tr as I,vi as L,xi as R}from"./index-B7AvV6gb.js";var z=p({name:`ConsoleSubscriptionBuy`,components:{CloseIcon:L,ConfirmIcon:y,ElSkeleton:v,ElRow:g,ElTag:C,ElCol:h,ElCard:m,ElEmpty:_,ElButton:S},data(){return{application:void 0,application2:void 0,type:F.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!k()},effectiveMarkupRatio(){return O(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=N(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(j(this.$store.getters.site)){this.$router.replace({name:T});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:P,onBuyExtra(){this.$router.push({name:b,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 A.create({service_id:t,type:F.PERIOD});await this.onFetchApplication2()}},onChangeType(){console.log(`onChangeType`,this.type),this.$router.push({name:b,params:this.$route.params})},async onFetchServices(){let{data:e}=await E.getAll({id:this.serviceIds});this.services=e.items,console.debug(`services`,this.services)},async onFetchApplication(){let{data:e}=await A.get(this.applicationId);this.application=e,console.debug(`application`,this.application)},async onFetchApplication2(){let{data:e}=await A.getAll({limit:100,offset:0,user_id:this.$store.getters.user.id,ordering:`-created_at`,service_id:this.serviceIds,type:F.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){R.error(this.$t(`console.message.applicationNotFound`)),this.creating=!1;return}D(`payment_initiated`,{service:this.service?.alias,action:`subscribe`,duration:e.duration}),I.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:w,params:{id:e.id}})}).catch(e=>{R.error(this.$t(`order.message.createFailed`)),this.creating=!1,D(`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=x(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-DmvNvKRc.js";import{E as c,et as l,tt as u}from"./index-B7AvV6gb.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-uldXAWrH.js";import{t as v}from"./tooltip-uHCMYOmh.js";import{t as y}from"./alert-B3fkwmi_.js";import{t as b}from"./slider-CkGNG5a7.js";import{t as x}from"./clock-i2EK0vEv.js";import{r as S,t as C}from"./PromptTextarea-C56bhHTR.js";import{t as w}from"./info-sYS8Y4kZ.js";import{t as T}from"./mic-BYGWDeAx.js";import{t as E}from"./trash-2-5sbW29HW.js";import{t as D}from"./triangle-alert-CmcoYwyi.js";import{t as O}from"./wand-sparkles-ClrEVQmB.js";import{ft as k,lt as ee}from"./constants-kuIe0Rg4.js";import{Bt as A,E as j,Fi as M,Ht as N,Kt as te,ai as P,bi as ne,tn as re,xi as F,yi as I,yn as L,yr as R}from"./index-DclC-KvF.js";import{t as z}from"./CopyToClipboard-DkvN0ug5.js";import{t as B}from"./Consumption-CGUzUXdy.js";import{n as V,r as H,t as U}from"./pagination-Dt4h-CYK.js";import{t as W}from"./ApiCodeButton-CkM0nK72.js";import{t as G}from"./BotPlaceholder-D4gOMQjG.js";import{t as K}from"./Hailuo-kuWkRUOK.js";import{t as q}from"./TabSwitcher-Cs_kPZYG.js";var J=I(`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`}]]),Y=m({name:`FishTextInput`,components:{PromptTextarea:C},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 X(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 ie=j(Y,[[`render`,X]]),ae=m({name:`FishModelSelector`,components:{ElSelect:g,ElOption:_},computed:{options(){return[{value:k,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||=ee}}),oe={class:`field`},se={class:`title font-bold`};function ce(t,n,r,o,m,h){let g=l(`el-option`),_=l(`el-select`);return p(),s(`div`,oe,[e(`h2`,se,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 le=j(ae,[[`render`,ce],[`__scopeId`,`data-v-9702e6d3`]]),ue=m({name:`FishVoiceOption`,props:{option:{type:Object,required:!0},playing:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:[`preview`]}),de={class:`voice-option`},fe=[`aria-label`],pe={key:0,class:`spin`,viewBox:`0 0 24 24`,width:`13`,height:`13`,"aria-hidden":`true`},me={key:1,viewBox:`0 0 24 24`,width:`13`,height:`13`,"aria-hidden":`true`},he={key:2,viewBox:`0 0 24 24`,width:`13`,height:`13`,"aria-hidden":`true`},ge={key:1,class:`preview placeholder`,"aria-hidden":`true`},_e={class:`meta`},ve={class:`label`},ye={key:0,class:`description`};function be(r,a,c,l,u,d){return p(),s(`div`,de,[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`,pe,[...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`,me,[...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`,he,[...a[4]||=[e(`path`,{d:`M8 5v14l11-7z`,fill:`currentColor`},null,-1)]]))],42,fe)):(p(),s(`span`,ge,[...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`,_e,[e(`span`,ve,i(r.option.label),1),r.option.description?(p(),s(`span`,ye,i(r.option.description),1)):o(``,!0)])])}var xe=j(ue,[[`render`,be],[`__scopeId`,`data-v-c16a6a46`]]),Se=e=>(e.id||e._id||e.reference_id||``).toString(),Z=e=>{let t=Se(e);return{value:t,label:e.title||t,description:e.description,audio:e.samples?.[0]?.audio}},Ce=m({name:`FishVoicePicker`,components:{ElSelect:g,ElOption:_,ElOptionGroup:h,VoiceOption:xe},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 L.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 L.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}}}),we={class:`field`},Te={class:`title font-bold`};function Ee(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`,we,[e(`h2`,Te,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 De=m({name:`FishConfigPanel`,components:{MagicIcon:O,ElButton:M,ElSlider:b,TextInput:ie,ModelSelector:le,VoicePicker:j(Ce,[[`render`,Ee],[`__scopeId`,`data-v-6183b210`]]),Consumption:B},emits:[`generate`],computed:{config(){return this.$store.state.fish?.config},consumption(){let e=this.config?.text?.trim()??``;return te({...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`)}}}),Oe={class:`flex flex-col h-full`},ke={class:`flex-1 overflow-y-auto p-5`},Ae={class:`field mb-4`},je={class:`title font-bold`},Me={class:`flex flex-col items-center justify-center px-5 pb-5`};function Ne(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`,Oe,[e(`div`,ke,[a(m,{class:`mb-4`}),a(h,{class:`mb-4`}),a(g,{class:`mb-4`}),e(`div`,Ae,[e(`h2`,je,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`,Me,[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 Pe=j(De,[[`render`,Ne],[`__scopeId`,`data-v-dc4ea983`]]);function Fe(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 Ie=m({name:`FishTaskPreview`,components:{DeleteIcon:E,ElTooltip:v,ChannelIcon:S,CpuIcon:J,InfoIcon:w,MagicIcon:O,MicrophoneIcon:T,TimeIcon:x,WarningIcon:D,CopyToClipboard:z,ElAlert:y,ElButton:M,ApiCodeButton:W},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 Fe(this.modelValue?.response)}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await ne.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`fish/deleteTask`,{id:e}),F.success(this.$t(`common.message.deleteTaskSuccess`))}catch{F.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e){window.open(e,`_blank`)}}}),Le={class:`preview`},Re={class:`left`},ze={class:`main`},Be={class:`bot`},Ve={class:`datetime`},He=[`aria-label`],Ue={class:`info`},We={key:0,class:`prompt mt-2`},Ge={key:0},Ke={key:0,class:`content`},qe=[`src`],Je={class:`operations mt-2`},Ye={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Xe={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ze={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Qe={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},$e={key:1,class:`content`},et={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},tt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},nt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},rt={key:2,class:`content`},it={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function at(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(`cpu-icon`),S=l(`microphone-icon`),C=l(`copy-to-clipboard`),w=l(`magic-icon`),T=l(`time-icon`),E=l(`el-alert`),D=l(`warning-icon`),O=l(`info-icon`),k=l(`channel-icon`);return p(),s(`div`,Le,[e(`div`,Re,[a(g,{capability:`fish`,part:`avatar`,class:`avatar`})]),e(`div`,ze,[e(`div`,Be,[a(g,{capability:`fish`,part:`name`}),e(`span`,Ve,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,He)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Ue,[n.prompt?(p(),s(`p`,We,[r(i(n.prompt)+` `,1),n.modelValue?.response?o(``,!0):(p(),s(`span`,Ge,` - (`+i(n.$t(`fish.status.pending`))+`) `,1))])):o(``,!0)]),n.audioUrl?(p(),s(`div`,Ke,[e(`audio`,{src:n.audioUrl,controls:``,preload:`metadata`,class:`w-full mb-3`},null,8,qe),e(`div`,Je,[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(E,{closable:!1,class:`mt-2 success`},{default:d(()=>[n.modelValue?.request?.model?(p(),s(`p`,Ye,[a(x,{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`,Xe,[a(S,{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(C,{content:n.modelValue?.request?.reference_id},null,8,[`content`])])):o(``,!0),e(`p`,Ze,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(C,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(p(),s(`p`,Qe,[a(T,{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`,$e,[a(E,{closable:!1,class:`failure`},{title:d(()=>[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.failure`)),1)]),default:d(()=>[e(`p`,et,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(C,{content:n.modelValue?.id},null,8,[`content`])]),n.failureReason?(p(),s(`p`,tt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.failureReason`))+`: `+i(n.failureReason)+` `,1),a(C,{content:n.failureReason},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(p(),s(`p`,$,[a(T,{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`,nt,[a(k,{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(C,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):(p(),s(`div`,rt,[a(E,{closable:!1,class:`info`},{default:d(()=>[e(`p`,it,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(C,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})]))])])}var ot=m({name:`FishRecentPanel`,components:{TaskPreview:j(Ie,[[`render`,at],[`__scopeId`,`data-v-d71784d5`]]),BotPlaceholder:G,NoTasks:H,ScrollList:V},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?.()}}}),st={key:0},ct={key:2,class:`w-full h-full flex items-center justify-center`};function lt(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`,st,[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`,ct,[a(v)])):o(``,!0)],64)}var ut=m({name:`FishTtsIndex`,components:{ConfigPanel:Pe,Layout:K,RecentPanel:j(ot,[[`render`,lt]]),TabSwitcher:q},mixins:[N],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.fish?.status?.getApplications===P.Request},tasksLoading(){return this.$store.state.fish?.status?.getTasks===P.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 U({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(!A(this.uploadTracker,e=>this.$t(e),e=>F.warning(e)))return;let e=this.config??{},t=e.text?.trim();if(!t){F.warning(this.$t(`fish.message.textRequired`));return}if(!re())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),F.info(this.$t(`fish.message.startingTask`)),R(`fish`,L.generateTts(i,{token:n,model:r})).then(()=>{F.success(this.$t(`fish.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?F.error(this.$t(`fish.message.usedUp`)):F.error(this.$t(`fish.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}}),dt={class:`flex flex-col h-full`},ft={class:`flex-1 min-h-0`};function pt(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`,dt,[a(c),e(`div`,ft,[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 mt=j(ut,[[`render`,pt]]);export{mt 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-CpvztHBU.js";import{t as v}from"./tooltip-DNvXWorG.js";import{t as y}from"./alert-CRHBgg7r.js";import{t as b}from"./slider-C4b9QcFi.js";import{t as x}from"./clock-Bsi4ai5b.js";import{r as S,t as C}from"./PromptTextarea-DzLkvnua.js";import{t as w}from"./info-b31RIJKS.js";import{t as T}from"./mic-261ODdC5.js";import{t as E}from"./trash-2-CV1FM8ox.js";import{t as D}from"./triangle-alert-BQ9oPsw-.js";import{t as O}from"./wand-sparkles-C82CTAsQ.js";import{ft as k,lt as ee}from"./constants-ChRYidMs.js";import{Bt as A,E as j,Fi as M,Ht as N,Kt as te,ai as P,bi as ne,tn as re,xi as F,yi as I,yn as L,yr as R}from"./index-B7AvV6gb.js";import{t as z}from"./CopyToClipboard-DjaFSD8h.js";import{t as B}from"./Consumption-DsITlBWE.js";import{n as V,r as H,t as U}from"./pagination-CoGkcyAo.js";import{t as W}from"./ApiCodeButton-C53iqEQJ.js";import{t as G}from"./BotPlaceholder-BVLOfJ2E.js";import{t as K}from"./Hailuo-CL6Ps8ey.js";import{t as q}from"./TabSwitcher-CWkcNrnf.js";var J=I(`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`}]]),Y=m({name:`FishTextInput`,components:{PromptTextarea:C},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 X(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 ie=j(Y,[[`render`,X]]),ae=m({name:`FishModelSelector`,components:{ElSelect:g,ElOption:_},computed:{options(){return[{value:k,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||=ee}}),oe={class:`field`},se={class:`title font-bold`};function ce(t,n,r,o,m,h){let g=l(`el-option`),_=l(`el-select`);return p(),s(`div`,oe,[e(`h2`,se,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 le=j(ae,[[`render`,ce],[`__scopeId`,`data-v-9702e6d3`]]),ue=m({name:`FishVoiceOption`,props:{option:{type:Object,required:!0},playing:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:[`preview`]}),de={class:`voice-option`},fe=[`aria-label`],pe={key:0,class:`spin`,viewBox:`0 0 24 24`,width:`13`,height:`13`,"aria-hidden":`true`},me={key:1,viewBox:`0 0 24 24`,width:`13`,height:`13`,"aria-hidden":`true`},he={key:2,viewBox:`0 0 24 24`,width:`13`,height:`13`,"aria-hidden":`true`},ge={key:1,class:`preview placeholder`,"aria-hidden":`true`},_e={class:`meta`},ve={class:`label`},ye={key:0,class:`description`};function be(r,a,c,l,u,d){return p(),s(`div`,de,[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`,pe,[...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`,me,[...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`,he,[...a[4]||=[e(`path`,{d:`M8 5v14l11-7z`,fill:`currentColor`},null,-1)]]))],42,fe)):(p(),s(`span`,ge,[...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`,_e,[e(`span`,ve,i(r.option.label),1),r.option.description?(p(),s(`span`,ye,i(r.option.description),1)):o(``,!0)])])}var xe=j(ue,[[`render`,be],[`__scopeId`,`data-v-c16a6a46`]]),Se=e=>(e.id||e._id||e.reference_id||``).toString(),Z=e=>{let t=Se(e);return{value:t,label:e.title||t,description:e.description,audio:e.samples?.[0]?.audio}},Ce=m({name:`FishVoicePicker`,components:{ElSelect:g,ElOption:_,ElOptionGroup:h,VoiceOption:xe},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 L.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 L.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}}}),we={class:`field`},Te={class:`title font-bold`};function Ee(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`,we,[e(`h2`,Te,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 De=m({name:`FishConfigPanel`,components:{MagicIcon:O,ElButton:M,ElSlider:b,TextInput:ie,ModelSelector:le,VoicePicker:j(Ce,[[`render`,Ee],[`__scopeId`,`data-v-6183b210`]]),Consumption:B},emits:[`generate`],computed:{config(){return this.$store.state.fish?.config},consumption(){let e=this.config?.text?.trim()??``;return te({...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`)}}}),Oe={class:`flex flex-col h-full`},ke={class:`flex-1 overflow-y-auto p-5`},Ae={class:`field mb-4`},je={class:`title font-bold`},Me={class:`flex flex-col items-center justify-center px-5 pb-5`};function Ne(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`,Oe,[e(`div`,ke,[a(m,{class:`mb-4`}),a(h,{class:`mb-4`}),a(g,{class:`mb-4`}),e(`div`,Ae,[e(`h2`,je,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`,Me,[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 Pe=j(De,[[`render`,Ne],[`__scopeId`,`data-v-dc4ea983`]]);function Fe(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 Ie=m({name:`FishTaskPreview`,components:{DeleteIcon:E,ElTooltip:v,ChannelIcon:S,CpuIcon:J,InfoIcon:w,MagicIcon:O,MicrophoneIcon:T,TimeIcon:x,WarningIcon:D,CopyToClipboard:z,ElAlert:y,ElButton:M,ApiCodeButton:W},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 Fe(this.modelValue?.response)}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await ne.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`fish/deleteTask`,{id:e}),F.success(this.$t(`common.message.deleteTaskSuccess`))}catch{F.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e){window.open(e,`_blank`)}}}),Le={class:`preview`},Re={class:`left`},ze={class:`main`},Be={class:`bot`},Ve={class:`datetime`},He=[`aria-label`],Ue={class:`info`},We={key:0,class:`prompt mt-2`},Ge={key:0},Ke={key:0,class:`content`},qe=[`src`],Je={class:`operations mt-2`},Ye={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Xe={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ze={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Qe={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},$e={key:1,class:`content`},et={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},tt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},nt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},rt={key:2,class:`content`},it={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function at(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(`cpu-icon`),S=l(`microphone-icon`),C=l(`copy-to-clipboard`),w=l(`magic-icon`),T=l(`time-icon`),E=l(`el-alert`),D=l(`warning-icon`),O=l(`info-icon`),k=l(`channel-icon`);return p(),s(`div`,Le,[e(`div`,Re,[a(g,{capability:`fish`,part:`avatar`,class:`avatar`})]),e(`div`,ze,[e(`div`,Be,[a(g,{capability:`fish`,part:`name`}),e(`span`,Ve,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,He)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Ue,[n.prompt?(p(),s(`p`,We,[r(i(n.prompt)+` `,1),n.modelValue?.response?o(``,!0):(p(),s(`span`,Ge,` - (`+i(n.$t(`fish.status.pending`))+`) `,1))])):o(``,!0)]),n.audioUrl?(p(),s(`div`,Ke,[e(`audio`,{src:n.audioUrl,controls:``,preload:`metadata`,class:`w-full mb-3`},null,8,qe),e(`div`,Je,[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(E,{closable:!1,class:`mt-2 success`},{default:d(()=>[n.modelValue?.request?.model?(p(),s(`p`,Ye,[a(x,{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`,Xe,[a(S,{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(C,{content:n.modelValue?.request?.reference_id},null,8,[`content`])])):o(``,!0),e(`p`,Ze,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(C,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(p(),s(`p`,Qe,[a(T,{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`,$e,[a(E,{closable:!1,class:`failure`},{title:d(()=>[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.failure`)),1)]),default:d(()=>[e(`p`,et,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(C,{content:n.modelValue?.id},null,8,[`content`])]),n.failureReason?(p(),s(`p`,tt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.failureReason`))+`: `+i(n.failureReason)+` `,1),a(C,{content:n.failureReason},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(p(),s(`p`,$,[a(T,{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`,nt,[a(k,{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(C,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):(p(),s(`div`,rt,[a(E,{closable:!1,class:`info`},{default:d(()=>[e(`p`,it,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`fish.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(C,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})]))])])}var ot=m({name:`FishRecentPanel`,components:{TaskPreview:j(Ie,[[`render`,at],[`__scopeId`,`data-v-d71784d5`]]),BotPlaceholder:G,NoTasks:H,ScrollList:V},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?.()}}}),st={key:0},ct={key:2,class:`w-full h-full flex items-center justify-center`};function lt(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`,st,[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`,ct,[a(v)])):o(``,!0)],64)}var ut=m({name:`FishTtsIndex`,components:{ConfigPanel:Pe,Layout:K,RecentPanel:j(ot,[[`render`,lt]]),TabSwitcher:q},mixins:[N],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.fish?.status?.getApplications===P.Request},tasksLoading(){return this.$store.state.fish?.status?.getTasks===P.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 U({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(!A(this.uploadTracker,e=>this.$t(e),e=>F.warning(e)))return;let e=this.config??{},t=e.text?.trim();if(!t){F.warning(this.$t(`fish.message.textRequired`));return}if(!re())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),F.info(this.$t(`fish.message.startingTask`)),R(`fish`,L.generateTts(i,{token:n,model:r})).then(()=>{F.success(this.$t(`fish.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?F.error(this.$t(`fish.message.usedUp`)):F.error(this.$t(`fish.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}}),dt={class:`flex flex-col h-full`},ft={class:`flex-1 min-h-0`};function pt(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`,dt,[a(c),e(`div`,ft,[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 mt=j(ut,[[`render`,pt]]);export{mt 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-EzZxNXQ9.js";import{E as f,Fi as p}from"./index-B7AvV6gb.js";import{t as m}from"./vue-plyr-wiIKa-zl.js";var h=u({name:`VideoPlayer`,components:{ElButton:p,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=f(h,[[`render`,y],[`__scopeId`,`data-v-0d13923b`]]);export{b as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,Mt as o,N as s,Ot as c,T as l,ht as u,it as d,j as f,k as p,mt as m,p as h,st as g,tt as _,ut as v,wt as y,x as b,z as x}from"./vendor-chart-Dw-P17PN.js";import{a as S,c as C,t as w}from"./install-Cn-SLM3u.js";import{n as T,u as E}from"./runtime-BTM7t9of.js";import{Ct as D,Q as O,W as k,d as A,f as j}from"./use-deprecated-r4dlLNqm.js";import{d as M,u as N}from"./tooltip-
|
|
1
|
+
import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,Mt as o,N as s,Ot as c,T as l,ht as u,it as d,j as f,k as p,mt as m,p as h,st as g,tt as _,ut as v,wt as y,x as b,z as x}from"./vendor-chart-Dw-P17PN.js";import{a as S,c as C,t as w}from"./install-Cn-SLM3u.js";import{n as T,u as E}from"./runtime-BTM7t9of.js";import{Ct as D,Q as O,W as k,d as A,f as j}from"./use-deprecated-r4dlLNqm.js";import{d as M,u as N}from"./tooltip-DNvXWorG.js";var P=T({title:{type:String,default:``},description:{type:String,default:``},type:{type:String,values:O(j),default:`info`},closable:{type:Boolean,default:!0},closeText:{type:String,default:``},showIcon:Boolean,center:Boolean,effect:{type:String,values:[`light`,`dark`],default:`light`},...M}),F={open:()=>!0,close:e=>E(e)||e instanceof Event},I=w(S(x({...x({name:`ElAlert`}),props:P,emits:F,setup(x,{emit:S}){let w=x,{Close:T}=A,E=v(),O=C(`alert`),M=y(!1),P=p(()=>j[w.type]),F=p(()=>!!(w.description||E.default)),I=()=>{M.value=!0,S(`open`)},L=e=>{M.value=!1,S(`close`,e)},{onOpen:R,onClose:z}=N({showAfter:c(w,`showAfter`),hideAfter:c(w,`hideAfter`),autoClose:c(w,`autoClose`),open:I,close:L});return D&&R(),(c,p)=>(_(),f(h,{name:o(O).b(`fade`),persisted:``},{default:m(()=>[u(e(`div`,{class:t([o(O).b(),o(O).m(c.type),o(O).is(`center`,c.center),o(O).is(c.effect)]),role:`alert`},[c.showIcon&&(c.$slots.icon||o(P))?(_(),f(o(k),{key:0,class:t([o(O).e(`icon`),{[o(O).is(`big`)]:o(F)}])},{default:m(()=>[d(c.$slots,`icon`,{},()=>[(_(),f(g(o(P))))])]),_:3},8,[`class`])):a(`v-if`,!0),e(`div`,{class:t(o(O).e(`content`))},[c.title||c.$slots.title?(_(),s(`span`,{key:0,class:t([o(O).e(`title`),{"with-description":o(F)}])},[d(c.$slots,`title`,{},()=>[n(r(c.title),1)])],2)):a(`v-if`,!0),o(F)?(_(),s(`p`,{key:1,class:t(o(O).e(`description`))},[d(c.$slots,`default`,{},()=>[n(r(c.description),1)])],2)):a(`v-if`,!0),c.closable?(_(),s(l,{key:2},[c.closeText?(_(),s(`div`,{key:0,class:t([o(O).e(`close-btn`),o(O).is(`customed`)]),onClick:L},r(c.closeText),3)):(_(),f(o(k),{key:1,class:t(o(O).e(`close-btn`)),onClick:o(z)},{default:m(()=>[i(o(T))]),_:1},8,[`class`,`onClick`]))],64)):a(`v-if`,!0)],2)],2),[[b,M.value]])]),_:3},8,[`name`]))}}),[[`__file`,`alert.vue`]]));export{I as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{yi as e}from"./index-B7AvV6gb.js";var t=e(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]);export{t};
|
package/dist/assets/{arrow-down-wide-narrow-DOlLZOzE.js → arrow-down-wide-narrow-wgc-CX8H.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{yi as e}from"./index-
|
|
1
|
+
import{yi as e}from"./index-B7AvV6gb.js";var t=e(`arrow-down-wide-narrow`,[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`M11 4h10`,key:`1w87gc`}],[`path`,{d:`M11 8h7`,key:`djye34`}],[`path`,{d:`M11 12h4`,key:`q8tih4`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{yi as e}from"./index-B7AvV6gb.js";var t=e(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{yi as e}from"./index-B7AvV6gb.js";var t=e(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{yi as e}from"./index-B7AvV6gb.js";var t=e(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]);export{t};
|