import{n as e}from"./rolldown-runtime-DAXXjFlN.js";import{Fn as t,Ln as n,On as r,Sn as i,er as a,kn as o,pr as s,sn as c,zr as l}from"./vendor-Dcerr41Y.js";import{r as ee,t as te}from"./TokenManager-ScrAtveA.js";import{Bn as ne,Dr as u,En as re,Er as d,Hn as f,Li as p,Ni as m,Pi as ie,Ri as h,Xi as ae,Xn as g,Xt as _,Yn as v,Zn as y,Zr as oe,_r as b,ai as se,br as ce,di as x,gr as S,h as le,ii as ue,la as de,m as fe,mr as pe,ni as me,nr as he,or as ge,pt as _e,qn as ve,ra as ye,ri as C,rr as w,ui as T,xr as E,zi as D}from"./ws-DjAvcWfg.js";import{c as O,m as k,p as A,s as j}from"./index-IojTodLd.js";import{n as M,t as N}from"./amurl-YTI1PoSU.js";import{A as P,Gt as F,H as I,N as be,O as xe,P as Se,Wt as Ce,an as we,in as Te,j as Ee,on as L,rn as De,sn as R,z as Oe}from"./smart-playlist-store-U6zHlhLg.js";import{n as ke,t as Ae}from"./AboutPanel-BrksQ9NM.js";function je(e){let t=new pe;t.setItems([S(p(`term.settings`),I,{icon:`settings`}),b(p(`term.appleMusic`),[S(p(`action.openUrl`),async()=>{let e=await ue(``,`Enter Apple Music URL`);if(!e.includes(`apple.com`)){m({title:`Apple Music`,icon:`nicon:queryError`,subtitle:`Not a valid Apple Music URL`,type:`error`});return}M(e)},{icon:`url`}),S(h(`Your Profile`,`action.appleMusic.yourProfile`),async()=>{re(await oe(`/v1/me/social-profile`,{fields:`name`}).then(e=>e.data.data[0]))},{icon:`profile`}),S(p(`term.replay`),()=>{f().push(`/am/replay`)},{icon:`rewind`}),E(),U()],{icon:`apple-music`}),H(),b(h(`View`,`term.view`),[S(p(`term.immersive`),()=>g(`immersive`),{icon:`immersive`}),S(p(`term.miniplayer`),Oe,{icon:`mini-player`}),S(p(`term.commandPalette`),Se,{icon:`command`})],{icon:`panorama-image`}),b(h(`Help`,`term.help`),[W(),S(p(`term.createBugIssueReport`),()=>be(),{icon:`bug`}),S(h(`Connect a Remote app`,`action.connectRemoteApp`),xe,{icon:`mobilePhone`})],{icon:`help`}),S(h(`Updates`,`term.updates`),()=>I(`updates`),{icon:`download`}),S(h(`Marketplace`,`term.marketplace`),()=>f().push(`/gallery/themes`),{icon:`marketplace`}),b(`Sleep Timer`,[S(`15 Minutes`,()=>O().startTimer(15)),S(`30 Minutes`,()=>O().startTimer(30)),S(`45 Minutes`,()=>O().startTimer(45)),S(`1 Hour`,()=>O().startTimer(60)),S(`Custom...`,async()=>{C({component:Ce,componentProps:{}}).show()}),E(),S(`Clear Timer`,()=>O().clearTimer())],{icon:`sleepTimer`}),S(p(`term.audioSettings`),Ee,{icon:`sound-waves`}),S(`Dev Test`,()=>f().push(`/am/zoo`),{icon:`brackets`}),K(),G(),S(p(`term.about`),()=>ke(),{icon:`circle-info`}),S(p(`term.quit`),()=>A.closeWindow(!0),{icon:`power`})]),t.show(e)}var z,B,V,H,U,W,G,K,Me=e((()=>{ye(),k(),F(),ie(),Ae(),ee(),P(),se(),ge(),N(),Te(),_(),ne(),v(),D(),fe(),j(),_e(),ce(),z=le(),B=()=>w.VitePluginActive.value?!1:S(h(`Enable Vite for Plugins`,`action.plugins.enableVitePlugins`),w.EnableVitePlugin),V=()=>S(h(`Disable plugins for this session`,`action.disablePlugins`),w.DisablePluginsForSession),H=()=>{if(sessionStorage.getItem(`diag:disable-plugins`)===`true`)return!1;let e=he.MainMenu.items.value,t=b(p(`term.plugins`),[],{icon:`plugins`});return e.forEach(e=>{t.addItem(S(e.label,()=>e.onClick(new MouseEvent(`click`))))}),e.length!==0&&t.addItem(E()),t.addItem(B()),t.addItem(V()),t},U=()=>z.isAuthorized||te.isAuthorized()?S(p(`menu.signOut`),()=>{me(`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{}we()}})}):S(p(`menu.signIn`),()=>{De()}),W=()=>ae().version.includes(`ptb`)?S(`PTB Changelog`,()=>de(`https://github.com/ciderapp/Cider-2/blob/main/changelogs/PTB.md`),{icon:`clipboard`}):!1,G=()=>ve()?S(p(`term.gameMode.disable`),()=>{y().gameMode=!1},{icon:`gamepad`}):S(p(`term.gameMode`),()=>{y().gameMode=!0},{icon:`gamepad`}),K=()=>z.privateEnabled?S(p(`term.disablePrivateSession`),()=>{z.setPrivateState(!1)},{icon:`private`}):S(p(`term.privateSession`),()=>{z.setPrivateState(!0)},{icon:`private`})})),q,J=e((()=>{c(),R(),Me(),u(),q=n({__name:`MainMenuButton`,setup(e){return(e,n)=>(a(),o(L,{onMousedown:i(l(je),[`left`])},{default:s(()=>[t(d,{name:`menu-dots`})]),_:1},8,[`onMousedown`]))}})})),Ne=e((()=>{})),Y,Pe=e((()=>{J(),J(),Ne(),x(),Y=T(q,[[`__scopeId`,`data-v-f4be464f`]])})),X,Z,Q=e((()=>{c(),u(),R(),v(),X={class:`nav-glyph`},Z=n({__name:`AirplayButton`,setup(e,{expose:n}){let i=y();function c(){for(let e in i.chromeViews)e===`airplay`?i.chromeViews[e]=!i.chromeViews[e]:i.chromeViews[e]=!1}return n({toggleOpen:c}),(e,n)=>(a(),o(L,{class:`airplay-button`,"native-title":``,title:e.$i(`action.cast.airplay`),active:l(i).isRightDrawerView(`airplay`),onClick:n[0]||=e=>l(i).invokeRightDrawerView(`airplay`)},{default:s(()=>[r(`div`,X,[t(d,{name:`airplay`})])]),_:1},8,[`title`,`active`]))}})})),Fe=e((()=>{})),$,Ie=e((()=>{Q(),Q(),Fe(),x(),$=T(Z,[[`__scopeId`,`data-v-2be7b68d`]])}));export{Pe as i,Ie as n,Y as r,$ as t};