import{n as e}from"./rolldown-runtime-DAXXjFlN.js";import{En as t,Nn as n,Vn as ee,Wr as te,ar as ne,dn as re,vr as r,zn as i}from"./vendor-6bGPahzI.js";import{$n as a,Bi as o,Da as s,Fi as c,Ha as l,Ii as u,Ki as ie,Ni as ae,Oa as oe,Qn as se,Sa as ce,Ua as le,Un as ue,Va as d,_r as f,ba as p,cr as m,dr as h,fr as g,ir as _,kr as v,nr as y,pa as b,qi as x,si as S,ur as C,vr as w,xa as T,xr as E,ya as D,zi as O}from"./ws-BfVPV0ME.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-DGgiwyPh.js";import{r as P,t as F}from"./useNotifications-DKQR3Y1H.js";import{f as I,o as L,p as R,s as z}from"./index-BfA-u3L9.js";import{n as de,t as B}from"./amurl-CqDeAR6t.js";import{$ as V,$t as H,B as fe,K as pe,U as me,V as he,W as ge,en as _e,fn as ve,i as ye,n as be,nt as U,pn as xe,q as Se,t as Ce,z as we}from"./auth-WD4QDKIv.js";import{n as Te,t as Ee}from"./AboutPanel-Bknrcrwc.js";function De(e){let t=new ae;t.setItems([c(d(`term.settings`),U,{icon:`settings`}),u(d(`term.appleMusic`),[c(d(`action.openUrl`),async()=>{let e=await T(``,`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`}),c(l(`Your Profile`,`action.appleMusic.yourProfile`),async()=>{S(await b(`/v1/me/social-profile`,{fields:`name`}).then(e=>e.data.data[0]))},{icon:`profile`}),c(d(`term.replay`),()=>{_().push(`/am/replay`)},{icon:`rewind`}),o(),J()],{icon:`apple-music`}),q(),u(l(`View`,`term.view`),[c(d(`term.immersive`),()=>h(`immersive`),{icon:`immersive`}),c(d(`term.miniplayer`),V,{icon:`mini-player`}),c(d(`term.commandPalette`),Se,{icon:`command`})],{icon:`panorama-image`}),u(l(`Help`,`term.help`),[Y(),c(d(`term.createBugIssueReport`),()=>pe(),{icon:`bug`}),c(l(`Connect a Remote app`,`action.connectRemoteApp`),he,{icon:`mobilePhone`})],{icon:`help`}),c(l(`Updates`,`term.updates`),()=>U(`updates`),{icon:`download`}),c(l(`Marketplace`,`term.marketplace`),()=>_().push(`/gallery/themes`),{icon:`marketplace`}),u(l(`Sleep Timer`,`sleepTimer.title`),[c(l(`15 Minutes`,`sleepTimer.15Minutes`),()=>z().startTimer(15)),c(l(`30 Minutes`,`sleepTimer.30Minutes`),()=>z().startTimer(30)),c(l(`45 Minutes`,`sleepTimer.45Minutes`),()=>z().startTimer(45)),c(l(`1 Hour`,`sleepTimer.1Hour`),()=>z().startTimer(60)),c(l(`Custom...`,`sleepTimer.custom`),async()=>{p({component:H,componentProps:{}}).show()}),o(),c(l(`Clear Timer`,`sleepTimer.clearTimer`),()=>z().clearTimer())],{icon:`sleepTimer`}),c(d(`term.audioSettings`),ge,{icon:`sound-waves`}),c(`Dev Test`,()=>_().push(`/am/zoo`),{icon:`brackets`}),fe(),X(),c(d(`term.about`),()=>Te(),{icon:`circle-info`}),c(d(`term.quit`),()=>I.closeWindow(!0),{icon:`power`})]),t.show(e)}var W,G,K,q,J,Y,X,Oe=e((()=>{j(),R(),_e(),P(),Ee(),k(),me(),ce(),E(),B(),be(),v(),y(),C(),le(),se(),L(),ue(),O(),we(),W=a(),G=()=>w.VitePluginActive.value?!1:c(l(`Enable Vite for Plugins`,`action.plugins.enableVitePlugins`),w.EnableVitePlugin),K=()=>c(l(`Disable plugins for this session`,`action.disablePlugins`),w.DisablePluginsForSession),q=()=>{if(sessionStorage.getItem(`diag:disable-plugins`)===`true`)return!1;let e=f.MainMenu.items.value,t=u(d(`term.plugins`),[],{icon:`plugins`});return e.forEach(e=>{t.addItem(c(e.label,()=>e.onClick(new MouseEvent(`click`))))}),e.length!==0&&t.addItem(o()),t.addItem(G()),t.addItem(K()),t},J=()=>W.isAuthorized||A.isAuthorized()?c(d(`menu.signOut`),()=>{D(`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{}ye()}})}):c(d(`menu.signIn`),()=>{Ce()}),Y=()=>M().version.includes(`ptb`)?c(`PTB Changelog`,()=>N(`https://github.com/ciderapp/Cider-2/blob/main/changelogs/PTB.md`),{icon:`clipboard`}):!1,X=()=>m()?c(d(`term.gameMode.disable`),()=>{g().gameMode=!1},{icon:`gamepad`}):c(d(`term.gameMode`),()=>{g().gameMode=!0},{icon:`gamepad`})})),Z,Q=e((()=>{re(),xe(),Oe(),x(),Z=ee({__name:`MainMenuButton`,setup(e){return(e,ee)=>(ne(),n(ve,{onMousedown:t(te(De),[`left`])},{default:r(()=>[i(ie,{name:`menu-dots`})]),_:1},8,[`onMousedown`]))}})})),ke=e((()=>{})),$,Ae=e((()=>{Q(),Q(),ke(),oe(),$=s(Z,[[`__scopeId`,`data-v-6ba43ce9`]])}));export{Ae as n,$ as t};