import{Zn as e,ar as t,qt as n}from"./vendor-C4JLrdLj.js";import{it as r}from"./vendor-quasar-BMuYn1t2.js";import{Bn as i,K as a,X as o,_r as s,vr as c,x as l,y as u,zn as d}from"./ws-JRT2XE7Y.js";import{n as f,t as p}from"./useUISound-BqJQNXQO.js";import{n as m,r as h,t as g}from"./vLyricProgress-BwMTxAeJ.js";s(),l(),n();var _=null;function v(){_?.stop(),_=t(!0);let n=document.documentElement;_.run(()=>{e(()=>{let e=u().accessibility;if(!e)return;n.classList.toggle(`a11y-bold`,!!e.boldText),n.classList.toggle(`a11y-high-contrast`,!!e.highContrast),n.classList.toggle(`a11y-focus-visible`,!!e.forceFocusVisible);let t=e.motionIntensity||`normal`,r=[`none`,`reduced`,`normal`,`playful`].includes(t)?t:`normal`;n.classList.remove(`motion-none`,`motion-reduced`,`motion-normal`,`motion-playful`),n.classList.add(`motion-${r}`);let i=r===`none`||r===`reduced`;e.reducedMotion!==i&&(e.reducedMotion=i),n.classList.toggle(`cards-in-motion`,!!e.cardMotion);let a=Math.min(1.5,Math.max(.75,Number(e.uiScale)||1));n.style.setProperty(`--a11y-ui-scale`,String(a))})})}i(),a(),g(),p();var y=new WeakMap;function b(e){return e??`click`}function x(e,t){let n=b(t),r=()=>f(n),i=()=>f(`hover`);e.addEventListener(`click`,r),e.addEventListener(`pointerenter`,i),y.set(e,{click:r,pointerenter:i})}function S(e){let t=y.get(e);t&&(e.removeEventListener(`click`,t.click),e.removeEventListener(`pointerenter`,t.pointerenter),y.delete(e))}var C={mounted(e,t){x(e,t.value)},updated(e,t){t.value!==t.oldValue&&(S(e),x(e,t.value))},unmounted(e){S(e)}};p();var w=[`button`,`[role="button"]`,`[role="tab"]`,`[role="menuitem"]`,`[role="option"]`,`.q-btn`,`.q-tab`,`.q-item.q-item--clickable`,`.q-item[clickable]`,`.q-select`,`.q-expansion-item__toggle-icon`,`.chrome-button`,`.settings-sidebar-item`,`.sidebar_nav-btn`,`.pod-tab`,`.mediaitem-card`,`[data-sidebar-navigation-button]`].join(`,`),T=[`button`,`[role="button"]`,`[role="tab"]`,`.q-btn`,`.q-tab`,`.chrome-button`,`.settings-sidebar-item`,`.sidebar_nav-btn`,`.pod-tab`,`[data-sidebar-navigation-button]`].join(`,`);function E(e){return!!e.closest(`.q-toggle, .q-slider, input[type="checkbox"], input[type="range"]`)}function D(e){if(!(e instanceof HTMLElement))return null;let t=e.closest(w);return!t||E(t)?null:t}function O(e){return e instanceof HTMLElement?!!(e instanceof HTMLInputElement&&e.type===`checkbox`||e.getAttribute(`role`)===`switch`||e.closest(`.q-toggle`)):!1}function k(e){return e instanceof HTMLElement?!!(e instanceof HTMLInputElement&&e.type===`range`||e.closest(`.q-slider`)):!1}function A(){document.addEventListener(`click`,e=>{let t=D(e.target);if(t){if(t.matches(`.q-tab, [role="tab"], .pod-tab, .settings-sidebar-item, .sidebar_nav-btn, [data-sidebar-navigation-button]`)){f(`tab-switch`);return}f(`click`)}},{capture:!0,passive:!0});let e=null,t=null,n=!1;function r(){n=!1;let r=t;if(t=null,!(r instanceof HTMLElement)){e=null;return}let i=r.closest(T);if(!i){e=null;return}i!==e&&(E(i)||(e=i,f(`hover`)))}document.addEventListener(`pointerover`,e=>{document.body.classList.contains(`scrolling`)||e.target!==t&&(t=e.target,!n&&(n=!0,requestAnimationFrame(r)))},{passive:!0}),document.addEventListener(`change`,e=>{let t=e.target;if(O(t)){f((t instanceof HTMLInputElement?t.checked:t.getAttribute(`aria-checked`)===`true`)?`switch-on`:`switch-off`);return}if(k(t)){f(`slide-tick`);return}(t instanceof HTMLSelectElement||t instanceof HTMLElement&&t.closest(`.q-select`))&&f(`click`)},{passive:!0}),document.addEventListener(`input`,e=>{let t=e.target;k(t)&&f(`slide-tick`)},{passive:!0}),document.addEventListener(`click`,e=>{if(!(e.target instanceof HTMLElement))return;let t=e.target.closest(`.q-expansion-item`);t&&queueMicrotask(()=>{f(t.querySelector(`.q-expansion-item--expanded`)?`expand`:`collapse`)})},{capture:!0,passive:!0})}var j=r(({app:e})=>{if(!o()){e.directive(`ui-sound`,C),e.directive(`lyric-line-progress`,m),e.directive(`lyric-word-progress`,h),A();try{c()}catch{}try{d()}catch{}queueMicrotask(()=>{try{v()}catch{requestAnimationFrame(()=>{try{v()}catch{}})}})}});export{j as default};