import{Qt as e,dn as t,en as n,gr as r,tn as i}from"./vendor-Dnfj1twE.js";import{et as a}from"./vendor-quasar-BP3JemFi.js";import{D as o,E as s,Hr as c,Ht as l,In as u,Lr as d,M as f,Mn as p,N as m,Nt as h,P as g,So as _,Vt as v,Wr as y,b,bo as x,jt as S,vo as C,x as w,xo as T,yo as E,zr as D,zt as O}from"./ws-Dl8XkIy4.js";import{a as k,c as A,d as j}from"./client-api-D-UNvPyj.js";import{r as M,t as N}from"./useNotifications-6khsAMfM.js";import{Ln as P,Rn as F}from"./auth-tS4c9ju3.js";t(),j(),_(),M(),c(),d(),p(),l(),h(),o(),w(),F(),n(),C();var I=`wq:`,L=!1;function R(){L||(L=!0,E(()=>{(async()=>{try{let t=(await i()).filter(e=>typeof e==`string`&&e.startsWith(I));if(!t.length)return;await e(t),console.debug(`[Queue] Swept legacy queue storage:`,{removed:t.length})}catch(e){console.debug(`[Queue] Legacy queue storage sweep failed:`,e)}})()},{timeout:6e4}))}g();var z=a(async()=>{if(u())return;console.debug(`[boot] Client Listeners`);let e=D(),t=O(),n=A()===`win32`&&k()==`pixie`;(A()===`darwin`||n)&&(document.body.classList.add(`window-glass`),document.documentElement.classList.add(`window-glass`)),r(()=>t.debug?.mklite,e=>{globalThis.__MKLITE_DEBUG=!!e},{immediate:!0}),m(),y(e=>{e?f():m(),N({title:x(e?`term.privateSession`:`term.disablePrivateSession`),subtitle:e?T(`Scrobbling, Discord presence and listening history are paused.`,`term.privateSession.paused`):T(`Scrobbling, Discord presence and listening history have resumed.`,`term.privateSession.resumed`),icon:`nicon:private`,type:`info`})}),s(),R();let i=new Set;window.addEventListener(`blur`,()=>{if(v(`visual.pauseAnimatedOnBlur`)){let e=document.querySelectorAll(`.animated-artwork-video`);for(let t of e)t.paused||(t.pause(),i.add(t))}document.body.setAttribute(`window-blurred`,`true`),e.windowFocusState=`blurred`}),window.addEventListener(`focus`,()=>{for(let e of i)i.delete(e),e.isConnected&&e.play().catch(()=>{});document.body.removeAttribute(`window-blurred`),e.windowFocusState=`focused`}),window.addEventListener(`beforeunload`,()=>{b(),S()}),P(t.general.keybindings)});export{z as default};