import{n as e}from"./rolldown-runtime-DAXXjFlN.js";import{En as t,Nn as ee,Vn as te,Wr as ne,ar as re,dn as n,vr as r,zn as i}from"./vendor-Dnfj1twE.js";import{$r as a,Fr as o,Ga as s,Ha as c,Ka as l,Lr as ie,Ma as ae,Na as oe,Pa as se,Rr as ce,Sa as le,So as ue,Va as u,Xr as d,Yr as f,Zn as p,ao as m,bo as h,da as g,io as _,ja as v,oo as y,or as b,si as x,so as S,sr as C,wa as w,xo as T,za as E,zi as D,zr as O}from"./ws-Dl8XkIy4.js";import{r as k,t as A}from"./TokenManager-7Ay6nr15.js";import{d as j,n as M,v as N}from"./client-api-D-UNvPyj.js";import{r as P,t as F}from"./useNotifications-6khsAMfM.js";import{f as I,o as L,p as R,s as z}from"./index-DEgYmG5l.js";import{n as de,t as B}from"./amurl-ClQHKX1-.js";import{$t as V,G as H,K as fe,L as pe,Q as me,Qt as he,R as ge,U as _e,V as ve,bn as ye,i as be,n as xe,t as Se,tt as U,yn as Ce,z as we}from"./auth-tS4c9ju3.js";import{n as Te,t as Ee}from"./AboutPanel-yc7DfiQ2.js";function De(e){let t=new E;t.setItems([u(h(`term.settings`),U,{icon:`settings`}),c(h(`term.appleMusic`),[u(h(`action.openUrl`),async()=>{let e=await oe(``,`Enter Apple Music URL`);if(!e.includes(`apple.com`)){F({title:`Apple Music`,icon:`nicon:queryError`,subtitle:`Not a valid Apple Music URL`,type:`error`});return}de(e)},{icon:`url`}),u(T(`Your Profile`,`action.appleMusic.yourProfile`),async()=>{D(await g(`/v1/me/social-profile`,{fields:`name`}).then(e=>e.data.data[0]))},{icon:`profile`}),u(h(`term.replay`),()=>{w().push(`/am/replay`)},{icon:`rewind`}),l(),J()],{icon:`apple-music`}),q(),c(T(`View`,`term.view`),[u(h(`term.immersive`),()=>ce(`immersive`),{icon:`immersive`}),u(h(`term.miniplayer`),me,{icon:`mini-player`}),u(h(`term.commandPalette`),fe,{icon:`command`})],{icon:`panorama-image`}),c(T(`Help`,`term.help`),[Y(),u(h(`term.createBugIssueReport`),()=>H(),{icon:`bug`}),u(T(`Connect a Remote app`,`action.connectRemoteApp`),we,{icon:`mobilePhone`})],{icon:`help`}),u(T(`Updates`,`term.updates`),()=>U(`updates`),{icon:`download`}),u(T(`Marketplace`,`term.marketplace`),()=>w().push(`/gallery/themes`),{icon:`marketplace`}),c(T(`Sleep Timer`,`sleepTimer.title`),[u(T(`15 Minutes`,`sleepTimer.15Minutes`),()=>z().startTimer(15)),u(T(`30 Minutes`,`sleepTimer.30Minutes`),()=>z().startTimer(30)),u(T(`45 Minutes`,`sleepTimer.45Minutes`),()=>z().startTimer(45)),u(T(`1 Hour`,`sleepTimer.1Hour`),()=>z().startTimer(60)),u(T(`Custom...`,`sleepTimer.custom`),async()=>{ae({component:he,componentProps:{}}).show()}),l(),u(T(`Clear Timer`,`sleepTimer.clearTimer`),()=>z().clearTimer())],{icon:`sleepTimer`}),u(h(`term.audioSettings`),_e,{icon:`sound-waves`}),u(`Dev Test`,()=>w().push(`/am/zoo`),{icon:`brackets`}),ge(),X(),u(h(`term.about`),()=>Te(),{icon:`circle-info`}),u(h(`term.quit`),()=>I.closeWindow(!0),{icon:`power`})]),t.show(e)}var W,G,K,q,J,Y,X,Oe=e((()=>{j(),R(),V(),P(),Ee(),k(),ve(),se(),a(),B(),xe(),x(),le(),ie(),ue(),b(),L(),p(),s(),pe(),W=C(),G=()=>d.VitePluginActive.value?!1:u(T(`Enable Vite for Plugins`,`action.plugins.enableVitePlugins`),d.EnableVitePlugin),K=()=>u(T(`Disable plugins for this session`,`action.disablePlugins`),d.DisablePluginsForSession),q=()=>{if(sessionStorage.getItem(`diag:disable-plugins`)===`true`)return!1;let e=f.MainMenu.items.value,t=c(h(`term.plugins`),[],{icon:`plugins`});return e.forEach(e=>{t.addItem(u(e.label,()=>e.onClick(new MouseEvent(`click`))))}),e.length!==0&&t.addItem(l()),t.addItem(G()),t.addItem(K()),t},J=()=>W.isAuthorized||A.isAuthorized()?u(h(`menu.signOut`),()=>{v(`Are you sure you want to sign out?`,`Sign out`,{okLabel:`Sign out`,cancelLabel:`Cancel`}).then(e=>{if(e){try{window?.webkit?.messageHandlers.external.postMessage(`mkSignOut`)}catch{}be()}})}):u(h(`menu.signIn`),()=>{Se()}),Y=()=>M().version.includes(`ptb`)?u(`PTB Changelog`,()=>N(`https://github.com/ciderapp/Cider-2/blob/main/changelogs/PTB.md`),{icon:`clipboard`}):!1,X=()=>o()?u(h(`term.gameMode.disable`),()=>{O().gameMode=!1},{icon:`gamepad`}):u(h(`term.gameMode`),()=>{O().gameMode=!0},{icon:`gamepad`})})),Z,Q=e((()=>{n(),ye(),Oe(),m(),Z=te({__name:`MainMenuButton`,setup(e){return(e,te)=>(re(),ee(Ce,{onMousedown:t(ne(De),[`left`])},{default:r(()=>[i(_,{name:`menu-dots`})]),_:1},8,[`onMousedown`]))}})})),ke=e((()=>{})),$,Ae=e((()=>{Q(),Q(),ke(),S(),$=y(Z,[[`__scopeId`,`data-v-6ba43ce9`]])}));export{Ae as n,$ as t};