diff --git a/dist/assets/index-sEdWZnAM.js b/dist/assets/index-BxVozdka.js similarity index 71% rename from dist/assets/index-sEdWZnAM.js rename to dist/assets/index-BxVozdka.js index e579bf7..cfd8136 100644 --- a/dist/assets/index-sEdWZnAM.js +++ b/dist/assets/index-BxVozdka.js @@ -6,4 +6,4 @@ var e=Object.defineProperty,t=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=nu `);return e===-1?``:t.stack.slice(e+1)})();try{if(!e.stack)e.stack=n;else if(n){let t=n.indexOf(` `),r=t===-1?-1:n.indexOf(` `,t+1),i=r===-1?``:n.slice(r+1);String(e.stack).endsWith(i)||(e.stack+=` -`+n)}}catch{}}throw e}}_request(e,t){typeof e==`string`?(t||={},t.url=e):t=e||{},t=Qd(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&Of.assertOptions(n,{silentJSONParsing:kf.transitional(kf.boolean),forcedJSONParsing:kf.transitional(kf.boolean),clarifyTimeoutError:kf.transitional(kf.boolean),legacyInterceptorReqResOrdering:kf.transitional(kf.boolean)},!1),r!=null&&(Y.isFunction(r)?t.paramsSerializer={serialize:r}:Of.assertOptions(r,{encode:kf.function,serialize:kf.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),Of.assertOptions(t,{baseUrl:kf.spelling(`baseURL`),withXsrfToken:kf.spelling(`withXSRFToken`)},!0),t.method=(t.method||this.defaults.method||`get`).toLowerCase();let a=i&&Y.merge(i.common,i[t.method]);i&&Y.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`query`,`common`],e=>{delete i[e]}),t.headers=id.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s&&=e.synchronous;let n=t.transitional||bd;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[wf.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new Rd(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function Mf(e){return function(t){return e.apply(null,t)}}function Nf(e){return Y.isObject(e)&&e.isAxiosError===!0}var Pf={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Pf).forEach(([e,t])=>{Pf[t]=e});function Ff(e){let t=new Af(e),n=Al(Af.prototype.request,t);return Y.extend(n,Af.prototype,t,{allOwnKeys:!0}),Y.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return Ff(Qd(e,t))},n}var Z=Ff(Fd);Z.Axios=Af,Z.CanceledError=Rd,Z.CancelToken=jf,Z.isCancel=Ld,Z.VERSION=df,Z.toFormData=pd,Z.AxiosError=X,Z.Cancel=Z.CanceledError,Z.all=function(e){return Promise.all(e)},Z.spread=Mf,Z.isAxiosError=Nf,Z.mergeConfig=Qd,Z.AxiosHeaders=id,Z.formToJSON=e=>Md(Y.isHTMLForm(e)?new FormData(e):e),Z.getAdapter=Sf.getAdapter,Z.HttpStatusCode=Pf,Z.default=Z;var Q=Z.create({baseURL:`http://localhost:3000/api`,withCredentials:!0,headers:{"Content-Type":`application/json`}});Q.interceptors.response.use(e=>e,async e=>{let t=e.config;if(e.response?.status===401&&!t._retry){t._retry=!0;try{return await Z.post(`${Q.defaults.baseURL}/auth/refresh`,{},{withCredentials:!0}),Q(t)}catch{return Promise.reject(e)}}return Promise.reject(e)});var If=Es(`auth`,()=>{let e=F(null),t=F(!1),n=G(()=>!!e.value),r=G(()=>e.value?.role===`admin`),i=G(()=>e.value?.role===`artist`),a=G(()=>new Set(e.value?.likedTracks||[]));async function o(){try{let{data:t}=await Q.get(`/auth/me`);t.success&&(e.value=t.data.user)}catch{e.value=null}}async function s(n,r){t.value=!0;try{let{data:t}=await Q.post(`/auth/login`,{identifier:n,password:r});return t.success&&(e.value=t.data.user),{success:!0}}catch(e){return{success:!1,message:e.response?.data?.message||`Login failed`}}finally{t.value=!1}}async function c(n){t.value=!0;try{let{data:t}=await Q.post(`/auth/register`,n);return t.success&&(e.value=t.data.user),{success:!0}}catch(e){return{success:!1,message:e.response?.data?.message||`Registration failed`}}finally{t.value=!1}}async function l(){try{await Q.post(`/auth/logout`)}finally{e.value=null}}async function u(n){t.value=!0;try{let{data:t}=await Q.put(`/auth/profile`,n,{headers:{"Content-Type":`multipart/form-data`}});return t.success&&(e.value=t.data),{success:!0}}catch(e){return{success:!1,message:e.response?.data?.message||`Update failed`}}finally{t.value=!1}}async function d(t){let n=a.value.has(t);try{n?(await Q.delete(`/tracks/${t}/like`),e.value&&(e.value.likedTracks=e.value.likedTracks.filter(e=>e!==t))):(await Q.post(`/tracks/${t}/like`),e.value&&e.value.likedTracks.push(t))}catch{}}return{user:e,loading:t,isLoggedIn:n,isAdmin:r,isArtist:i,likedTrackIds:a,checkSession:o,login:s,register:c,logout:l,updateProfile:u,toggleLike:d}}),Lf=n({useUiStore:()=>Rf}),Rf=Es(`ui`,()=>{let e=F([]),t=0;function n(n,r=`info`){let i=++t;e.value.push({id:i,message:n,type:r}),setTimeout(()=>{e.value=e.value.filter(e=>e.id!==i)},3e3)}function r(t){e.value=e.value.filter(e=>e.id!==t)}return{toasts:e,showToast:n,dismissToast:r}}),zf=t((e=>{(function(){var t=function(){this.init()};t.prototype={init:function(){var e=this||n;return e._counter=1e3,e._html5AudioPool=[],e.html5PoolSize=10,e._codecs={},e._howls=[],e._muted=!1,e._volume=1,e._canPlayEvent=`canplaythrough`,e._navigator=typeof window<`u`&&window.navigator?window.navigator:null,e.masterGain=null,e.noAudio=!1,e.usingWebAudio=!0,e.autoSuspend=!0,e.ctx=null,e.autoUnlock=!0,e._setup(),e},volume:function(e){var t=this||n;if(e=parseFloat(e),t.ctx||u(),e!==void 0&&e>=0&&e<=1){if(t._volume=e,t._muted)return t;t.usingWebAudio&&t.masterGain.gain.setValueAtTime(e,n.ctx.currentTime);for(var r=0;r=0;t--)e._howls[t].unload();return e.usingWebAudio&&e.ctx&&e.ctx.close!==void 0&&(e.ctx.close(),e.ctx=null,u()),e},codecs:function(e){return(this||n)._codecs[e.replace(/^x-/,``)]},_setup:function(){var e=this||n;if(e.state=e.ctx&&e.ctx.state||`suspended`,e._autoSuspend(),!e.usingWebAudio)if(typeof Audio<`u`)try{var t=new Audio;t.oncanplaythrough===void 0&&(e._canPlayEvent=`canplay`)}catch{e.noAudio=!0}else e.noAudio=!0;try{var t=new Audio;t.muted&&(e.noAudio=!0)}catch{}return e.noAudio||e._setupCodecs(),e},_setupCodecs:function(){var e=this||n,t=null;try{t=typeof Audio<`u`?new Audio:null}catch{return e}if(!t||typeof t.canPlayType!=`function`)return e;var r=t.canPlayType(`audio/mpeg;`).replace(/^no$/,``),i=e._navigator?e._navigator.userAgent:``,a=i.match(/OPR\/(\d+)/g),o=a&&parseInt(a[0].split(`/`)[1],10)<33,s=i.indexOf(`Safari`)!==-1&&i.indexOf(`Chrome`)===-1,c=i.match(/Version\/(.*?) /),l=s&&c&&parseInt(c[1],10)<15;return e._codecs={mp3:!!(!o&&(r||t.canPlayType(`audio/mp3;`).replace(/^no$/,``))),mpeg:!!r,opus:!!t.canPlayType(`audio/ogg; codecs="opus"`).replace(/^no$/,``),ogg:!!t.canPlayType(`audio/ogg; codecs="vorbis"`).replace(/^no$/,``),oga:!!t.canPlayType(`audio/ogg; codecs="vorbis"`).replace(/^no$/,``),wav:!!(t.canPlayType(`audio/wav; codecs="1"`)||t.canPlayType(`audio/wav`)).replace(/^no$/,``),aac:!!t.canPlayType(`audio/aac;`).replace(/^no$/,``),caf:!!t.canPlayType(`audio/x-caf;`).replace(/^no$/,``),m4a:!!(t.canPlayType(`audio/x-m4a;`)||t.canPlayType(`audio/m4a;`)||t.canPlayType(`audio/aac;`)).replace(/^no$/,``),m4b:!!(t.canPlayType(`audio/x-m4b;`)||t.canPlayType(`audio/m4b;`)||t.canPlayType(`audio/aac;`)).replace(/^no$/,``),mp4:!!(t.canPlayType(`audio/x-mp4;`)||t.canPlayType(`audio/mp4;`)||t.canPlayType(`audio/aac;`)).replace(/^no$/,``),weba:!!(!l&&t.canPlayType(`audio/webm; codecs="vorbis"`).replace(/^no$/,``)),webm:!!(!l&&t.canPlayType(`audio/webm; codecs="vorbis"`).replace(/^no$/,``)),dolby:!!t.canPlayType(`audio/mp4; codecs="ec-3"`).replace(/^no$/,``),flac:!!(t.canPlayType(`audio/x-flac;`)||t.canPlayType(`audio/flac;`)).replace(/^no$/,``)},e},_unlockAudio:function(){var e=this||n;if(!(e._audioUnlocked||!e.ctx)){e._audioUnlocked=!1,e.autoUnlock=!1,!e._mobileUnloaded&&e.ctx.sampleRate!==44100&&(e._mobileUnloaded=!0,e.unload()),e._scratchBuffer=e.ctx.createBuffer(1,1,22050);var t=function(n){for(;e._html5AudioPool.length0?s._seek:r._sprite[e][0]/1e3),u=Math.max(0,(r._sprite[e][0]+r._sprite[e][1])/1e3-l),d=u*1e3/Math.abs(s._rate),f=r._sprite[e][0]/1e3,p=(r._sprite[e][0]+r._sprite[e][1])/1e3;s._sprite=e,s._ended=!1;var m=function(){s._paused=!1,s._seek=l,s._start=f,s._stop=p,s._loop=!!(s._loop||r._sprite[e][2])};if(l>=p){r._ended(s);return}var h=s._node;if(r._webAudio){var g=function(){r._playLock=!1,m(),r._refreshBuffer(s);var e=s._muted||r._muted?0:s._volume;h.gain.setValueAtTime(e,n.ctx.currentTime),s._playStart=n.ctx.currentTime,h.bufferSource.start===void 0?s._loop?h.bufferSource.noteGrainOn(0,l,86400):h.bufferSource.noteGrainOn(0,l,u):s._loop?h.bufferSource.start(0,l,86400):h.bufferSource.start(0,l,u),d!==1/0&&(r._endTimers[s._id]=setTimeout(r._ended.bind(r,s),d)),t||setTimeout(function(){r._emit(`play`,s._id),r._loadQueue()},0)};n.state===`running`&&n.ctx.state!==`interrupted`?g():(r._playLock=!0,r.once(`resume`,g),r._clearTimer(s._id))}else{var _=function(){h.currentTime=l,h.muted=s._muted||r._muted||n._muted||h.muted,h.volume=s._volume*n.volume(),h.playbackRate=s._rate;try{var i=h.play();if(i&&typeof Promise<`u`&&(i instanceof Promise||typeof i.then==`function`)?(r._playLock=!0,m(),i.then(function(){r._playLock=!1,h._unlocked=!0,t?r._loadQueue():r._emit(`play`,s._id)}).catch(function(){r._playLock=!1,r._emit(`playerror`,s._id,`Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.`),s._ended=!0,s._paused=!0})):t||(r._playLock=!1,m(),r._emit(`play`,s._id)),h.playbackRate=s._rate,h.paused){r._emit(`playerror`,s._id,`Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.`);return}e!==`__default`||s._loop?r._endTimers[s._id]=setTimeout(r._ended.bind(r,s),d):(r._endTimers[s._id]=function(){r._ended(s),h.removeEventListener(`ended`,r._endTimers[s._id],!1)},h.addEventListener(`ended`,r._endTimers[s._id],!1))}catch(e){r._emit(`playerror`,s._id,e)}};h.src===`data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA`&&(h.src=r._src,h.load());var v=window&&window.ejecta||!h.readyState&&n._navigator.isCocoonJS;if(h.readyState>=3||v)_();else{r._playLock=!0,r._state=`loading`;var y=function(){r._state=`loaded`,_(),h.removeEventListener(n._canPlayEvent,y,!1)};h.addEventListener(n._canPlayEvent,y,!1),r._clearTimer(s._id)}}return s._id},pause:function(e){var t=this;if(t._state!==`loaded`||t._playLock)return t._queue.push({event:`pause`,action:function(){t.pause(e)}}),t;for(var n=t._getSoundIds(e),r=0;r=0?i=parseInt(t[0],10):r=parseFloat(t[0]):t.length>=2&&(r=parseFloat(t[0]),i=parseInt(t[1],10));var a;if(r!==void 0&&r>=0&&r<=1){if(e._state!==`loaded`||e._playLock)return e._queue.push({event:`volume`,action:function(){e.volume.apply(e,t)}}),e;i===void 0&&(e._volume=r),i=e._getSoundIds(i);for(var o=0;o0?r/l:r),d=Date.now();e._fadeTo=n,e._interval=setInterval(function(){var i=(Date.now()-d)/r;d=Date.now(),s+=c*i,s=Math.round(s*100)/100,s=c<0?Math.max(n,s):Math.min(n,s),o._webAudio?e._volume=s:o.volume(s,e._id,!0),a&&(o._volume=s),(nt&&s>=n)&&(clearInterval(e._interval),e._interval=null,e._fadeTo=null,o.volume(n,e._id),o._emit(`fade`,e._id))},u)},_stopFade:function(e){var t=this,r=t._soundById(e);return r&&r._interval&&(t._webAudio&&r._node.gain.cancelScheduledValues(n.ctx.currentTime),clearInterval(r._interval),r._interval=null,t.volume(r._fadeTo,e),r._fadeTo=null,t._emit(`fade`,e)),t},loop:function(){var e=this,t=arguments,n,r,i;if(t.length===0)return e._loop;if(t.length===1)if(typeof t[0]==`boolean`)n=t[0],e._loop=n;else return i=e._soundById(parseInt(t[0],10)),i?i._loop:!1;else t.length===2&&(n=t[0],r=parseInt(t[1],10));for(var a=e._getSoundIds(r),o=0;o=0?i=parseInt(t[0],10):r=parseFloat(t[0]):t.length===2&&(r=parseFloat(t[0]),i=parseInt(t[1],10));var a;if(typeof r==`number`){if(e._state!==`loaded`||e._playLock)return e._queue.push({event:`rate`,action:function(){e.rate.apply(e,t)}}),e;i===void 0&&(e._rate=r),i=e._getSoundIds(i);for(var o=0;o=0?i=parseInt(t[0],10):e._sounds.length&&(i=e._sounds[0]._id,r=parseFloat(t[0])):t.length===2&&(r=parseFloat(t[0]),i=parseInt(t[1],10)),i===void 0)return 0;if(typeof r==`number`&&(e._state!==`loaded`||e._playLock))return e._queue.push({event:`seek`,action:function(){e.seek.apply(e,t)}}),e;var a=e._soundById(i);if(a)if(typeof r==`number`&&r>=0){var o=e.playing(i);o&&e.pause(i,!0),a._seek=r,a._ended=!1,e._clearTimer(i),!e._webAudio&&a._node&&!isNaN(a._node.duration)&&(a._node.currentTime=r);var s=function(){o&&e.play(i,!0),e._emit(`seek`,i)};if(o&&!e._webAudio){var c=function(){e._playLock?setTimeout(c,0):s()};setTimeout(c,0)}else s()}else if(e._webAudio){var l=e.playing(i)?n.ctx.currentTime-a._playStart:0,u=a._rateSeek?a._rateSeek-a._seek:0;return a._seek+(u+l*Math.abs(a._rate))}else return a._node.currentTime;return e},playing:function(e){var t=this;if(typeof e==`number`){var n=t._soundById(e);return n?!n._paused:!1}for(var r=0;r=0&&n._howls.splice(i,1);var o=!0;for(r=0;r=0){o=!1;break}return a&&o&&delete a[e._src],n.noAudio=!1,e._state=`unloaded`,e._sounds=[],e=null,null},on:function(e,t,n,r){var i=this,a=i[`_on`+e];return typeof t==`function`&&a.push(r?{id:n,fn:t,once:r}:{id:n,fn:t}),i},off:function(e,t,n){var r=this,i=r[`_on`+e],a=0;if(typeof t==`number`&&(n=t,t=null),t||n)for(a=0;a=0;a--)(!i[a].id||i[a].id===t||e===`load`)&&(setTimeout(function(e){e.call(this,t,n)}.bind(r,i[a].fn),0),i[a].once&&r.off(e,i[a].fn,i[a].id));return r._loadQueue(e),r},_loadQueue:function(e){var t=this;if(t._queue.length>0){var n=t._queue[0];n.event===e&&(t._queue.shift(),t._loadQueue()),e||n.action()}return t},_ended:function(e){var t=this,r=e._sprite;if(!t._webAudio&&e._node&&!e._node.paused&&!e._node.ended&&e._node.currentTime=0;r--){if(n<=t)return;e._sounds[r]._ended&&(e._webAudio&&e._sounds[r]._node&&e._sounds[r]._node.disconnect(0),e._sounds.splice(r,1),n--)}}},_getSoundIds:function(e){var t=this;if(e===void 0){for(var n=[],r=0;r=0;if(!e.bufferSource)return t;if(n._scratchBuffer&&e.bufferSource&&(e.bufferSource.onended=null,e.bufferSource.disconnect(0),r))try{e.bufferSource.buffer=n._scratchBuffer}catch{}return e.bufferSource=null,t},_clearSound:function(e){/MSIE |Trident\//.test(n._navigator&&n._navigator.userAgent)||(e.src=`data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA`)}};var i=function(e){this._parent=e,this.init()};i.prototype={init:function(){var e=this,t=e._parent;return e._muted=t._muted,e._loop=t._loop,e._volume=t._volume,e._rate=t._rate,e._seek=0,e._paused=!0,e._ended=!0,e._sprite=`__default`,e._id=++n._counter,t._sounds.push(e),e.create(),e},create:function(){var e=this,t=e._parent,r=n._muted||e._muted||e._parent._muted?0:e._volume;return t._webAudio?(e._node=n.ctx.createGain===void 0?n.ctx.createGainNode():n.ctx.createGain(),e._node.gain.setValueAtTime(r,n.ctx.currentTime),e._node.paused=!0,e._node.connect(n.masterGain)):n.noAudio||(e._node=n._obtainHtml5Audio(),e._errorFn=e._errorListener.bind(e),e._node.addEventListener(`error`,e._errorFn,!1),e._loadFn=e._loadListener.bind(e),e._node.addEventListener(n._canPlayEvent,e._loadFn,!1),e._endFn=e._endListener.bind(e),e._node.addEventListener(`ended`,e._endFn,!1),e._node.src=t._src,e._node.preload=t._preload===!0?`auto`:t._preload,e._node.volume=r*n.volume(),e._node.load()),e},reset:function(){var e=this,t=e._parent;return e._muted=t._muted,e._loop=t._loop,e._volume=t._volume,e._rate=t._rate,e._seek=0,e._rateSeek=0,e._paused=!0,e._ended=!0,e._sprite=`__default`,e._id=++n._counter,e},_errorListener:function(){var e=this;e._parent._emit(`loaderror`,e._id,e._node.error?e._node.error.code:0),e._node.removeEventListener(`error`,e._errorFn,!1)},_loadListener:function(){var e=this,t=e._parent;t._duration=Math.ceil(e._node.duration*10)/10,Object.keys(t._sprite).length===0&&(t._sprite={__default:[0,t._duration*1e3]}),t._state!==`loaded`&&(t._state=`loaded`,t._emit(`load`),t._loadQueue()),e._node.removeEventListener(n._canPlayEvent,e._loadFn,!1)},_endListener:function(){var e=this,t=e._parent;t._duration===1/0&&(t._duration=Math.ceil(e._node.duration*10)/10,t._sprite.__default[1]===1/0&&(t._sprite.__default[1]=t._duration*1e3),t._ended(e)),e._node.removeEventListener(`ended`,e._endFn,!1)}};var a={},o=function(e){var t=e._src;if(a[t]){e._duration=a[t].duration,l(e);return}if(/^data:[^;]+;base64,/.test(t)){for(var n=atob(t.split(`,`)[1]),r=new Uint8Array(n.length),i=0;i0?(a[t._src]=e,l(t,e)):r()};typeof Promise<`u`&&n.ctx.decodeAudioData.length===1?n.ctx.decodeAudioData(e).then(i).catch(r):n.ctx.decodeAudioData(e,i,r)},l=function(e,t){t&&!e._duration&&(e._duration=t.duration),Object.keys(e._sprite).length===0&&(e._sprite={__default:[0,e._duration*1e3]}),e._state!==`loaded`&&(e._state=`loaded`,e._emit(`load`),e._loadQueue())},u=function(){if(n.usingWebAudio){try{typeof AudioContext<`u`?n.ctx=new AudioContext:typeof webkitAudioContext<`u`?n.ctx=new webkitAudioContext:n.usingWebAudio=!1}catch{n.usingWebAudio=!1}n.ctx||(n.usingWebAudio=!1);var e=/iP(hone|od|ad)/.test(n._navigator&&n._navigator.platform),t=n._navigator&&n._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),r=t?parseInt(t[1],10):null;if(e&&r&&r<9){var i=/safari/.test(n._navigator&&n._navigator.userAgent.toLowerCase());n._navigator&&!i&&(n.usingWebAudio=!1)}n.usingWebAudio&&(n.masterGain=n.ctx.createGain===void 0?n.ctx.createGainNode():n.ctx.createGain(),n.masterGain.gain.setValueAtTime(n._muted?0:n._volume,n.ctx.currentTime),n.masterGain.connect(n.ctx.destination)),n._setup()}};typeof define==`function`&&define.amd&&define([],function(){return{Howler:n,Howl:r}}),e!==void 0&&(e.Howler=n,e.Howl=r),typeof global<`u`?(global.HowlerGlobal=t,global.Howler=n,global.Howl=r,global.Sound=i):typeof window<`u`&&(window.HowlerGlobal=t,window.Howler=n,window.Howl=r,window.Sound=i)})(),(function(){HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(e){var t=this;if(!t.ctx||!t.ctx.listener)return t;for(var n=t._howls.length-1;n>=0;n--)t._howls[n].stereo(e);return t},HowlerGlobal.prototype.pos=function(e,t,n){var r=this;if(!r.ctx||!r.ctx.listener)return r;if(t=typeof t==`number`?t:r._pos[1],n=typeof n==`number`?n:r._pos[2],typeof e==`number`)r._pos=[e,t,n],r.ctx.listener.positionX===void 0?r.ctx.listener.setPosition(r._pos[0],r._pos[1],r._pos[2]):(r.ctx.listener.positionX.setTargetAtTime(r._pos[0],Howler.ctx.currentTime,.1),r.ctx.listener.positionY.setTargetAtTime(r._pos[1],Howler.ctx.currentTime,.1),r.ctx.listener.positionZ.setTargetAtTime(r._pos[2],Howler.ctx.currentTime,.1));else return r._pos;return r},HowlerGlobal.prototype.orientation=function(e,t,n,r,i,a){var o=this;if(!o.ctx||!o.ctx.listener)return o;var s=o._orientation;if(t=typeof t==`number`?t:s[1],n=typeof n==`number`?n:s[2],r=typeof r==`number`?r:s[3],i=typeof i==`number`?i:s[4],a=typeof a==`number`?a:s[5],typeof e==`number`)o._orientation=[e,t,n,r,i,a],o.ctx.listener.forwardX===void 0?o.ctx.listener.setOrientation(e,t,n,r,i,a):(o.ctx.listener.forwardX.setTargetAtTime(e,Howler.ctx.currentTime,.1),o.ctx.listener.forwardY.setTargetAtTime(t,Howler.ctx.currentTime,.1),o.ctx.listener.forwardZ.setTargetAtTime(n,Howler.ctx.currentTime,.1),o.ctx.listener.upX.setTargetAtTime(r,Howler.ctx.currentTime,.1),o.ctx.listener.upY.setTargetAtTime(i,Howler.ctx.currentTime,.1),o.ctx.listener.upZ.setTargetAtTime(a,Howler.ctx.currentTime,.1));else return s;return o},Howl.prototype.init=(function(e){return function(t){var n=this;return n._orientation=t.orientation||[1,0,0],n._stereo=t.stereo||null,n._pos=t.pos||null,n._pannerAttr={coneInnerAngle:t.coneInnerAngle===void 0?360:t.coneInnerAngle,coneOuterAngle:t.coneOuterAngle===void 0?360:t.coneOuterAngle,coneOuterGain:t.coneOuterGain===void 0?0:t.coneOuterGain,distanceModel:t.distanceModel===void 0?`inverse`:t.distanceModel,maxDistance:t.maxDistance===void 0?1e4:t.maxDistance,panningModel:t.panningModel===void 0?`HRTF`:t.panningModel,refDistance:t.refDistance===void 0?1:t.refDistance,rolloffFactor:t.rolloffFactor===void 0?1:t.rolloffFactor},n._onstereo=t.onstereo?[{fn:t.onstereo}]:[],n._onpos=t.onpos?[{fn:t.onpos}]:[],n._onorientation=t.onorientation?[{fn:t.onorientation}]:[],e.call(this,t)}})(Howl.prototype.init),Howl.prototype.stereo=function(t,n){var r=this;if(!r._webAudio)return r;if(r._state!==`loaded`)return r._queue.push({event:`stereo`,action:function(){r.stereo(t,n)}}),r;var i=Howler.ctx.createStereoPanner===void 0?`spatial`:`stereo`;if(n===void 0)if(typeof t==`number`)r._stereo=t,r._pos=[t,0,0];else return r._stereo;for(var a=r._getSoundIds(n),o=0;oVf.onPlay?.(),onpause:()=>Vf.onPause?.(),onend:()=>Vf.onEnd?.(),onloaderror:()=>Vf.onError?.(),onplayerror:()=>Vf.onError?.()})}function Wf(){Bf?.play()}function Gf(){Bf?.pause()}function Kf(){Bf?.playing()?Bf.pause():Bf.play()}function qf(e){Bf&&Bf.seek(e)}function Jf(){return Bf?Bf.seek():0}function Yf(e){return e!==void 0&&Howler.volume(e/100),Howler.volume()*100}function Xf(){return Bf?Bf.duration():0}function Zf(){return Bf?Bf.playing():!1}function Qf(e,t){Vf[e]=t}function $f(e){delete Vf[e]}function ep(){Bf&&=(Bf.unload(),null),Vf={}}var $={load:Uf,play:Wf,pause:Gf,togglePlay:Kf,seek:qf,getSeek:Jf,volume:Yf,duration:Xf,playing:Zf,on:Qf,off:$f,destroy:ep,formatTime:Hf},tp=`http://localhost:3000`;function np(e){return e?e.startsWith(`http`)?e:`${tp}${e}`:``}var rp=Es(`player`,()=>{let e=F(null),t=F(!1),n=F(0),r=F(0),i=F(80),a=F(null),o=F(null),s=G(()=>$.formatTime(n.value)),c=G(()=>$.formatTime(r.value));function l(i){if(!i)return;e.value=i,n.value=0,r.value=0,t.value=!1,g();let a=np(i.audioUrl);$.load(a),$.on(`play`,()=>{t.value=!0}),$.on(`pause`,()=>{t.value=!1}),$.on(`end`,()=>{t.value=!1,g(),o.value&&o.value()}),$.on(`error`,()=>{t.value=!1})}function u(e){o.value=e}function d(){e.value&&($.playing()?($.pause(),g()):($.play(),h()))}function f(){e.value&&($.play(),h())}function p(e){$.seek(e),n.value=e}function m(e){i.value=e,$.volume(e)}function h(){g(),a.value=setInterval(()=>{$.playing()&&(n.value=$.getSeek(),r.value=$.duration())},500)}function g(){a.value&&=(clearInterval(a.value),null)}function _(){g(),$.destroy(),e.value=null,t.value=!1,n.value=0,r.value=0,o.value=null}return{currentTrack:e,isPlaying:t,progress:n,duration:r,volume:i,formattedProgress:s,formattedDuration:c,setTrack:l,onEnd:u,togglePlay:d,play:f,seek:p,setVolume:m,$reset:_}}),ip=Es(`queue`,()=>{let e=F([]),t=F(-1),n=F(!1),r=F(`off`),i=G(()=>t.value<0||t.value>=e.value.length?null:e.value[t.value]);function a(n,r=0){e.value=n,t.value=r}function o(){if(e.value.length===0)return null;if(r.value===`one`)return e.value[t.value];let i;if(i=n.value?Math.floor(Math.random()*e.value.length):t.value+1,i>=e.value.length)if(r.value===`all`)i=0;else return null;return t.value=i,e.value[i]}function s(){if(e.value.length===0)return null;if(r.value===`one`)return e.value[t.value];let i;if(i=n.value?Math.floor(Math.random()*e.value.length):t.value-1,i<0)if(r.value===`all`)i=e.value.length-1;else return null;return t.value=i,e.value[i]}function c(){n.value=!n.value}function l(){let e=[`off`,`all`,`one`];r.value=e[(e.indexOf(r.value)+1)%e.length]}function u(){e.value=[],t.value=-1,n.value=!1,r.value=`off`}return{queue:e,currentIndex:t,shuffle:n,repeat:r,currentTrack:i,setQueue:a,nextTrack:o,prevTrack:s,toggleShuffle:c,cycleRepeat:l,$reset:u}}),ap={class:`min-h-screen bg-noctune-cream flex items-center justify-center p-8`},op={class:`w-full max-w-5xl bg-noctune-teal rounded-3xl border-4 border-black overflow-hidden flex shadow-2xl`},sp={class:`w-1/2 p-12 relative`},cp={class:`absolute top-8 right-12 grid grid-cols-4 gap-1`},lp={class:`absolute top-20 right-8 grid grid-cols-4 gap-1`},up={class:`absolute bottom-12 left-12 grid grid-cols-3 gap-1`},dp={class:`w-1/2 bg-white rounded-3xl m-4 p-10`},fp={key:0,class:`text-red-500 text-sm mb-4 font-medium`},pp={class:`mb-6`},mp={class:`flex border-2 border-black rounded-lg overflow-hidden`},hp={class:`mb-4`},gp={class:`flex border-2 border-black rounded-lg overflow-hidden`},_p=[`type`],vp={key:0,class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},yp={key:1,class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},bp=[`disabled`],xp={key:0,class:`inline-block w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin`},Sp={class:`text-center mt-8 text-gray-600`},Cp={__name:`LoginPage`,setup(e){let t=Ol(),n=If(),r=F(``),i=F(``),a=F(!1),o=F(!1),s=F(``);async function c(){s.value=``,o.value=!0;let e=await n.login(r.value,i.value);o.value=!1,e.success?t.push(`/home`):s.value=e.message}return(e,t)=>{let n=Tr(`router-link`);return z(),B(`div`,ap,[V(`div`,op,[V(`div`,sp,[V(`div`,cp,[(z(),B(R,null,L(16,e=>V(`span`,{key:e,class:`w-2 h-2 bg-black/40 rounded-full`})),64))]),V(`div`,lp,[(z(),B(R,null,L(12,e=>V(`span`,{key:e,class:`w-2 h-2 bg-black/40 rounded-full`})),64))]),t[3]||=V(`div`,{class:`absolute top-16 left-20 text-black/60 text-4xl font-bold`},`+`,-1),t[4]||=V(`div`,{class:`absolute bottom-24 right-20 text-black/60 text-4xl font-bold`},`+`,-1),V(`div`,up,[(z(),B(R,null,L(12,e=>V(`span`,{key:e,class:`w-2 h-2 bg-black/40 rounded-full`})),64))]),t[5]||=aa(`

noctune

`,1)]),V(`div`,dp,[t[16]||=V(`h2`,{class:`text-4xl font-black text-black mb-2`},`WELCOME!`,-1),t[17]||=V(`p`,{class:`text-gray-600 mb-8`},`Login to continue`,-1),s.value?(z(),B(`p`,fp,A(s.value),1)):W(``,!0),V(`div`,pp,[t[7]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-2 tracking-wider`},`EMAIL/USERNAME`,-1),V(`div`,mp,[t[6]||=V(`div`,{class:`bg-noctune-teal p-3 border-r-2 border-black`},[V(`svg`,{class:`w-6 h-6 text-black`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z`})])],-1),zn(V(`input`,{type:`text`,"onUpdate:modelValue":t[0]||=e=>r.value=e,onKeyup:Vo(c,[`enter`]),class:`flex-1 px-4 py-3 focus:outline-none text-black`,placeholder:`Enter your email`},null,544),[[Eo,r.value]])])]),V(`div`,hp,[t[11]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-2 tracking-wider`},`PASSWORD`,-1),V(`div`,gp,[t[10]||=V(`div`,{class:`bg-amber-200 p-3 border-r-2 border-black`},[V(`svg`,{class:`w-6 h-6 text-black`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z`})])],-1),zn(V(`input`,{type:a.value?`text`:`password`,"onUpdate:modelValue":t[1]||=e=>i.value=e,onKeyup:Vo(c,[`enter`]),class:`flex-1 px-4 py-3 focus:outline-none text-black`,placeholder:`Enter your password`},null,40,_p),[[Po,i.value]]),V(`button`,{onClick:t[2]||=e=>a.value=!a.value,class:`px-4 text-gray-500 hover:text-gray-700`},[a.value?(z(),B(`svg`,yp,[...t[9]||=[V(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M15 12a3 3 0 11-6 0 3 3 0 016 0z`},null,-1),V(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z`},null,-1)]])):(z(),B(`svg`,vp,[...t[8]||=[V(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21`},null,-1)]]))])])]),t[18]||=V(`div`,{class:`text-right mb-6`},[V(`a`,{href:`#`,class:`text-sm text-gray-600 hover:text-black`},`Forgot password?`)],-1),V(`button`,{onClick:c,disabled:o.value,class:`w-full bg-noctune-orange border-2 border-black rounded-lg py-4 font-bold text-white text-xl flex items-center justify-center gap-3 hover:bg-orange-600 transition-colors disabled:opacity-50`},[o.value?(z(),B(`span`,xp)):(z(),B(R,{key:1},[t[12]||=V(`div`,{class:`bg-white/20 rounded p-1`},[V(`svg`,{class:`w-5 h-5`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z`})])],-1),t[13]||=U(` LOGIN `,-1)],64))],8,bp),t[19]||=aa(`
OR SIGN IN WITH
`,2),V(`p`,Sp,[t[15]||=U(` Don't have an account yet? `,-1),H(n,{to:`/register`,class:`text-noctune-orange font-bold hover:underline`},{default:Rn(()=>[...t[14]||=[U(`Register now`,-1)]]),_:1})])])])])}}},wp={class:`min-h-screen bg-noctune-cream flex items-center justify-center p-8`},Tp={class:`w-full max-w-5xl bg-noctune-teal rounded-3xl border-4 border-black overflow-hidden flex shadow-2xl`},Ep={class:`w-1/2 p-12 relative`},Dp={class:`absolute top-8 right-12 grid grid-cols-4 gap-1`},Op={class:`w-1/2 bg-white rounded-3xl m-4 p-10`},kp={key:0,class:`text-red-500 text-sm mb-4 font-medium`},Ap={class:`mb-4`},jp={class:`mb-4`},Mp={class:`mb-4`},Np={class:`mb-6`},Pp=[`disabled`],Fp={key:0,class:`inline-block w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin`},Ip={key:1},Lp={class:`text-center mt-6 text-gray-600`},Rp={__name:`RegisterPage`,setup(e){let t=Ol(),n=If(),r=F(``),i=F(``),a=F(``),o=F(``),s=F(!1),c=F(``);async function l(){c.value=``,s.value=!0;let e=await n.register({name:r.value,username:i.value,email:a.value,password:o.value});s.value=!1,e.success?t.push(`/home`):c.value=e.message}return(e,t)=>{let n=Tr(`router-link`);return z(),B(`div`,wp,[V(`div`,Tp,[V(`div`,Ep,[V(`div`,Dp,[(z(),B(R,null,L(16,e=>V(`span`,{key:e,class:`w-2 h-2 bg-black/40 rounded-full`})),64))]),t[4]||=aa(`

noctune

`,1)]),V(`div`,Op,[t[11]||=V(`h2`,{class:`text-4xl font-black text-black mb-2`},`JOIN US!`,-1),t[12]||=V(`p`,{class:`text-gray-600 mb-6`},`Create your account`,-1),c.value?(z(),B(`p`,kp,A(c.value),1)):W(``,!0),V(`div`,Ap,[t[5]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-2 tracking-wider`},`NAME`,-1),zn(V(`input`,{type:`text`,"onUpdate:modelValue":t[0]||=e=>r.value=e,class:`w-full border-2 border-black rounded-lg px-4 py-3 focus:outline-none text-black`,placeholder:`Your name`},null,512),[[Eo,r.value]])]),V(`div`,jp,[t[6]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-2 tracking-wider`},`USERNAME`,-1),zn(V(`input`,{type:`text`,"onUpdate:modelValue":t[1]||=e=>i.value=e,class:`w-full border-2 border-black rounded-lg px-4 py-3 focus:outline-none text-black`,placeholder:`Choose a username`},null,512),[[Eo,i.value]])]),V(`div`,Mp,[t[7]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-2 tracking-wider`},`EMAIL`,-1),zn(V(`input`,{type:`email`,"onUpdate:modelValue":t[2]||=e=>a.value=e,class:`w-full border-2 border-black rounded-lg px-4 py-3 focus:outline-none text-black`,placeholder:`Enter your email`},null,512),[[Eo,a.value]])]),V(`div`,Np,[t[8]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-2 tracking-wider`},`PASSWORD`,-1),zn(V(`input`,{type:`password`,"onUpdate:modelValue":t[3]||=e=>o.value=e,class:`w-full border-2 border-black rounded-lg px-4 py-3 focus:outline-none text-black`,placeholder:`Create a password`},null,512),[[Eo,o.value]])]),V(`button`,{onClick:l,disabled:s.value,class:`w-full bg-noctune-orange border-2 border-black rounded-lg py-4 font-bold text-white text-xl flex items-center justify-center gap-3 hover:bg-orange-600 transition-colors disabled:opacity-50`},[s.value?(z(),B(`span`,Fp)):(z(),B(`span`,Ip,`REGISTER`))],8,Pp),V(`p`,Lp,[t[10]||=U(` Already have an account? `,-1),H(n,{to:`/login`,class:`text-noctune-orange font-bold hover:underline`},{default:Rn(()=>[...t[9]||=[U(`Login`,-1)]]),_:1})])])])])}}},zp={class:`bg-white rounded-2xl border-4 border-black p-6 w-full max-w-md mx-4 shadow-[8px_8px_0px_0px_#000]`},Bp={class:`flex items-center justify-between mb-6`},Vp={key:0,class:`text-red-500 text-sm mb-4 font-medium`},Hp={class:`space-y-4`},Up=[`disabled`],Wp={key:0,class:`inline-block w-4 h-4 border-2 border-black border-t-transparent rounded-full animate-spin mr-2`},Gp={__name:`CreatePlaylistModal`,props:{show:Boolean},emits:[`close`,`created`],setup(e,{emit:t}){let n=t,r=F(``),i=F(``),a=F(null),o=F(!1),s=F(``);function c(e){a.value=e.target.files[0]||null}async function l(){if(s.value=``,!r.value?.trim()){s.value=`Playlist name is required`;return}o.value=!0;try{let e=new FormData;e.append(`name`,r.value.trim()),i.value?.trim()&&e.append(`description`,i.value.trim()),a.value&&e.append(`playlistCover`,a.value);let{data:t}=await Q.post(`/playlists`,e,{headers:{"Content-Type":`multipart/form-data`}});t.success&&(n(`created`,t.data),r.value=``,i.value=``,a.value=null)}catch(e){s.value=e.response?.data?.message||`Failed to create playlist`}finally{o.value=!1}}return(t,n)=>e.show?(z(),B(`div`,{key:0,class:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onClick:n[3]||=zo(e=>t.$emit(`close`),[`self`])},[V(`div`,zp,[V(`div`,Bp,[n[4]||=V(`h2`,{class:`text-xl font-black text-black`},`CREATE PLAYLIST`,-1),V(`button`,{onClick:n[0]||=e=>t.$emit(`close`),class:`text-gray-500 hover:text-black text-2xl leading-none`},`×`)]),s.value?(z(),B(`p`,Vp,A(s.value),1)):W(``,!0),V(`div`,Hp,[V(`div`,null,[n[5]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-1 tracking-wider`},`NAME`,-1),zn(V(`input`,{"onUpdate:modelValue":n[1]||=e=>r.value=e,type:`text`,placeholder:`My awesome playlist`,class:`w-full border-2 border-black rounded-lg px-4 py-2 focus:outline-none text-black`},null,512),[[Eo,r.value]])]),V(`div`,null,[n[6]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-1 tracking-wider`},`DESCRIPTION`,-1),zn(V(`textarea`,{"onUpdate:modelValue":n[2]||=e=>i.value=e,placeholder:`Optional description`,rows:`2`,class:`w-full border-2 border-black rounded-lg px-4 py-2 focus:outline-none resize-none text-black`},null,512),[[Eo,i.value]])]),V(`div`,null,[n[7]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-1 tracking-wider`},`COVER IMAGE`,-1),V(`input`,{type:`file`,accept:`image/*`,onChange:c,class:`w-full text-sm text-gray-600 file:mr-3 file:py-2 file:px-4 file:border-2 file:border-black file:rounded-lg file:font-bold file:text-sm file:bg-noctune-yellow file:cursor-pointer`},null,32)]),V(`button`,{onClick:l,disabled:o.value,class:`w-full bg-noctune-teal border-2 border-black rounded-lg py-3 font-bold text-black hover:bg-teal-600 transition-colors disabled:opacity-50 cursor-pointer`},[o.value?(z(),B(`span`,Wp)):W(``,!0),U(` `+A(o.value?`Creating...`:`CREATE PLAYLIST`),1)],8,Up)])])])):W(``,!0)}},Kp={class:`bg-white rounded-2xl border-4 border-black p-6 w-full max-w-md mx-4 shadow-[8px_8px_0px_0px_#000]`},qp={class:`flex items-center justify-between mb-4`},Jp={key:0,class:`text-red-500 text-sm mb-3 font-medium`},Yp={key:1,class:`space-y-3`},Xp={key:2,class:`text-center py-8`},Zp={key:3,class:`max-h-80 overflow-y-auto space-y-2`},Qp=[`onClick`],$p={class:`w-12 h-12 rounded-lg overflow-hidden bg-gray-300 border border-black flex-shrink-0`},em=[`src`],tm={key:1,class:`w-full h-full flex items-center justify-center bg-gradient-to-br from-noctune-teal/20 to-noctune-yellow/20`},nm={class:`flex-1 min-w-0`},rm={class:`font-bold text-sm text-black truncate`},im={class:`text-xs text-gray-500`},am={key:0,class:`w-5 h-5 animate-spin text-noctune-teal`,fill:`none`,viewBox:`0 0 24 24`},om={key:1,class:`w-5 h-5 text-gray-400`,fill:`currentColor`,viewBox:`0 0 24 24`},sm={__name:`AddToPlaylistModal`,props:{show:Boolean,trackId:{type:String,default:null}},emits:[`close`],setup(e,{emit:t}){let n=e,r=t,i=If(),a=Rf(),o=F([]),s=F(!1),c=F(null),l=F(``),u=F(!1);function d(){u.value=!0}function f(e){u.value=!1,o.value.unshift(e)}async function p(e){if(n.trackId){c.value=e._id,l.value=``;try{let{data:t}=await Q.post(`/playlists/${e._id}/tracks`,{trackId:n.trackId});t.success&&(a.showToast(`Saved to "${e.name}"`,`success`),r(`close`))}catch(t){let n=t.response?.data?.message||``;n.includes(`already`)||n.includes(`duplicate`)?(a.showToast(`Already in "${e.name}"`,`info`),r(`close`)):l.value=n||`Failed to save track`}finally{c.value=null}}}async function m(){if(i.isLoggedIn){s.value=!0;try{let{data:e}=await Q.get(`/playlists`);e.success&&(o.value=e.data)}catch{}finally{s.value=!1}}}return Kn(()=>n.show,e=>{e&&m()}),(t,n)=>e.show?(z(),B(`div`,{key:0,class:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onClick:n[2]||=zo(e=>t.$emit(`close`),[`self`])},[V(`div`,Kp,[V(`div`,qp,[n[3]||=V(`h2`,{class:`text-xl font-black text-black`},`SAVE TO PLAYLIST`,-1),V(`button`,{onClick:n[0]||=e=>t.$emit(`close`),class:`text-gray-500 hover:text-black text-2xl leading-none`},`×`)]),l.value?(z(),B(`p`,Jp,A(l.value),1)):W(``,!0),s.value?(z(),B(`div`,Yp,[(z(),B(R,null,L(3,e=>V(`div`,{key:e,class:`h-14 bg-gray-200 animate-pulse rounded-lg border-2 border-black`})),64))])):o.value.length===0?(z(),B(`div`,Xp,[n[4]||=V(`svg`,{class:`w-16 h-16 mx-auto text-gray-300 mb-3`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M3 10h11v2H3v-2zm0-4h11v2H3V6zm0 8h7v2H3v-2zm13-1v8l6-4-6-4z`})],-1),n[5]||=V(`p`,{class:`text-gray-500 mb-2`},`No playlists yet`,-1),V(`button`,{onClick:d,class:`bg-noctune-yellow border-2 border-black px-4 py-2 font-bold rounded-lg text-sm hover:bg-yellow-400 transition-colors cursor-pointer`},` CREATE PLAYLIST `)])):(z(),B(`div`,Zp,[(z(!0),B(R,null,L(o.value,e=>(z(),B(`div`,{key:e._id,onClick:t=>p(e),class:k([`flex items-center gap-3 px-4 py-3 rounded-lg border-2 border-black cursor-pointer hover:bg-noctune-teal/10 transition-colors`,c.value===e._id?`opacity-50 pointer-events-none`:``])},[V(`div`,$p,[e.coverUrl?(z(),B(`img`,{key:0,src:I(np)(e.coverUrl),class:`w-full h-full object-cover`},null,8,em)):(z(),B(`div`,tm,[...n[6]||=[V(`svg`,{class:`w-6 h-5 text-gray-400`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M3 10h11v2H3v-2zm0-4h11v2H3V6zm0 8h7v2H3v-2zm13-1v8l6-4-6-4z`})],-1)]]))]),V(`div`,nm,[V(`p`,rm,A(e.name),1),V(`p`,im,A(e.tracks?.length||0)+` songs`,1)]),c.value===e._id?(z(),B(`svg`,am,[...n[7]||=[V(`circle`,{class:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,"stroke-width":`4`},null,-1),V(`path`,{class:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`},null,-1)]])):(z(),B(`svg`,om,[...n[8]||=[V(`path`,{d:`M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z`},null,-1)]]))],10,Qp))),128))]))]),H(Gp,{show:u.value,onClose:n[1]||=e=>u.value=!1,onCreated:f},null,8,[`show`])])):W(``,!0)}},cm={class:`p-8`},lm={key:0,class:`grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4`},um={key:1,class:`text-center py-20 bg-white rounded-2xl border-2 border-black`},dm={key:2,class:`grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4`},fm=[`onClick`],pm={class:`aspect-square bg-gray-300 relative overflow-hidden`},mm=[`src`],hm={class:`absolute inset-0 bg-black/0 group-hover:bg-black/20 transition-colors flex items-center justify-center`},gm={key:0,class:`w-6 h-6 text-black`,fill:`currentColor`,viewBox:`0 0 24 24`},_m={key:1,class:`w-6 h-6 ml-1 text-black`,fill:`currentColor`,viewBox:`0 0 24 24`},vm={class:`p-3`},ym={class:`flex items-center justify-between`},bm={class:`flex-1 min-w-0`},xm={class:`text-sm font-bold text-black truncate`},Sm={class:`text-xs text-gray-500 truncate`},Cm=[`onClick`],wm=[`onClick`],Tm={__name:`LandingPage`,setup(e){let t=rp(),n=ip(),r=If(),{requireAuth:i}=Hg(),a=F([]),o=F(!0),s=F(null),c=F(!1);function l(e){s.value=e,i({redirectTo:`/login`,onAuthenticated:()=>{c.value=!0}})}function u(e){return t.currentTrack?._id===e._id}function d(e){return r.likedTrackIds?.has(e._id)}function f(e){if(u(e)){t.togglePlay();return}let r=a.value.findIndex(t=>t._id===e._id);n.setQueue(a.value,r),t.setTrack(e),t.play()}function p(){a.value.length&&f(a.value[0])}function m(e){i({redirectTo:`/login`,onAuthenticated:()=>r.toggleLike(e._id)})}return hr(async()=>{try{let{data:e}=await Q.get(`/tracks`);e.success&&(a.value=e.data)}catch{}finally{o.value=!1}}),(e,n)=>{let r=Tr(`router-link`);return z(),B(`div`,cm,[V(`div`,{class:`flex items-start gap-8 mb-12`},[V(`div`,{class:`flex-1`},[n[2]||=V(`h1`,{class:`text-5xl font-black text-black leading-tight mb-2`},[U(`MUSIC`),V(`br`),U(`THAT HITS`)],-1),n[3]||=V(`div`,{class:`inline-block bg-noctune-orange px-4 py-2 mb-4 border-b-4 border-black`},[V(`span`,{class:`text-4xl font-black text-black`},`DIFFERENT.`)],-1),n[4]||=V(`p`,{class:`text-gray-600 mb-6`},`You Vibe. Your sound. Only on Noctune.`,-1),V(`div`,{class:`flex gap-4`},[V(`button`,{onClick:p,class:`bg-noctune-yellow border-2 border-black px-6 py-3 font-bold hover:bg-yellow-400 transition-colors rounded-lg`},`PLAY NOW`),n[1]||=V(`button`,{class:`bg-gray-200 border-2 border-black px-6 py-3 font-bold hover:bg-gray-300 transition-colors rounded-lg`},`EXPLORE`,-1)])]),n[5]||=V(`div`,{class:`w-80 h-80 rounded-2xl overflow-hidden border-4 border-black flex-shrink-0`},[V(`img`,{src:`https://images.unsplash.com/photo-1470225620780-dba8ba36b745?w=400&h=400&fit=crop`,alt:`Music illustration`,class:`w-full h-full object-cover`})],-1)]),V(`section`,null,[n[15]||=V(`h2`,{class:`text-2xl font-black text-black mb-6 flex items-center`},[U(` TRENDING NOW `),V(`svg`,{class:`w-5 h-5 ml-2`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z`})])],-1),o.value?(z(),B(`div`,lm,[(z(),B(R,null,L(4,e=>V(`div`,{key:e,class:`animate-pulse rounded-2xl border-2 border-black overflow-hidden`},[...n[6]||=[V(`div`,{class:`aspect-square bg-gray-300`},null,-1),V(`div`,{class:`p-3 space-y-2`},[V(`div`,{class:`h-3 bg-gray-300 rounded w-3/4`}),V(`div`,{class:`h-2 bg-gray-300 rounded w-1/2`})],-1)]])),64))])):a.value.length===0?(z(),B(`div`,um,[n[8]||=V(`svg`,{class:`w-24 h-24 mx-auto text-gray-300 mb-4`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M12 3v10.55c-.59-.34-1.27-.55-2-.55C7.79 13 6 14.79 6 17s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z`})],-1),n[9]||=V(`p`,{class:`text-gray-500 mb-2 text-lg`},`No tracks yet`,-1),n[10]||=V(`p`,{class:`text-gray-400 text-sm mb-4`},`Be the first to upload music!`,-1),H(r,{to:`/admin/tracks`,class:`inline-block bg-noctune-orange border-2 border-black px-6 py-3 font-bold rounded-lg hover:bg-orange-500 transition-colors`},{default:Rn(()=>[...n[7]||=[U(`UPLOAD TRACK`,-1)]]),_:1})])):(z(),B(`div`,dm,[(z(!0),B(R,null,L(a.value,e=>(z(),B(`div`,{key:e._id,onClick:t=>f(e),class:k([`bg-white rounded-2xl overflow-hidden hover:scale-[1.02] transition-transform cursor-pointer group`,u(e)?`border-4 border-noctune-teal`:`border-2 border-black`])},[V(`div`,pm,[e.coverUrl?(z(),B(`img`,{key:0,src:I(np)(e.coverUrl),class:`w-full h-full object-cover`},null,8,mm)):W(``,!0),V(`div`,hm,[V(`div`,{class:k([`w-12 h-12 rounded-full flex items-center justify-center border-2 border-black opacity-0 group-hover:opacity-100 transition-opacity`,u(e)&&I(t).isPlaying?`bg-white`:`bg-noctune-yellow`])},[u(e)&&I(t).isPlaying?(z(),B(`svg`,gm,[...n[11]||=[V(`path`,{d:`M6 19h4V5H6v14zm8-14v14h4V5h-4z`},null,-1)]])):(z(),B(`svg`,_m,[...n[12]||=[V(`path`,{d:`M8 5v14l11-7z`},null,-1)]]))],2)])]),V(`div`,vm,[V(`div`,ym,[V(`div`,bm,[V(`p`,xm,A(e.title),1),V(`p`,Sm,A(e.artist),1)]),V(`button`,{onClick:zo(t=>m(e),[`stop`]),class:`ml-2 flex-shrink-0`},[(z(),B(`svg`,{class:k([`w-5 h-5`,d(e)?`fill-red-400 text-red-400`:`text-gray-400 hover:text-red-400`]),fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[...n[13]||=[V(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z`},null,-1)]],2))],8,Cm),V(`button`,{onClick:zo(t=>l(e),[`stop`]),class:`ml-1 flex-shrink-0 text-gray-400 hover:text-noctune-teal transition-colors`},[...n[14]||=[V(`svg`,{class:`w-5 h-5`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z`})],-1)]],8,wm)])])],10,fm))),128))]))]),H(sm,{show:c.value,"track-id":s.value?._id,onClose:n[0]||=e=>c.value=!1},null,8,[`show`,`track-id`])])}}},Em={class:`p-8`},Dm={class:`mb-12`},Om={key:0,class:`text-center py-12 text-gray-500`},km={key:1,class:`text-center py-12`},Am={key:2,class:`text-center py-12`},jm={key:3,class:`grid grid-cols-4 gap-6`},Mm=[`onClick`],Nm={class:`aspect-square bg-gray-300 relative overflow-hidden`},Pm=[`src`],Fm={key:0,class:`w-5 h-5 text-black`,fill:`currentColor`,viewBox:`0 0 24 24`},Im={key:1,class:`w-5 h-5 ml-0.5 text-black`,fill:`currentColor`,viewBox:`0 0 24 24`},Lm={class:`p-3`},Rm={class:`flex items-center justify-between`},zm={class:`flex-1 min-w-0`},Bm={class:`text-sm font-bold text-black truncate`},Vm={class:`text-xs text-gray-500 truncate`},Hm=[`onClick`],Um={key:0,class:`space-y-3 p-4`},Wm={key:1,class:`bg-white rounded-2xl border-4 border-black overflow-hidden`},Gm={class:`divide-y divide-gray-200`},Km=[`onClick`],qm={class:`flex-1 flex items-center gap-3`},Jm={class:`text-sm text-gray-400 w-6`},Ym={key:0,class:`w-4 h-4 text-noctune-teal inline`,fill:`currentColor`,viewBox:`0 0 24 24`},Xm={key:1},Zm={class:`w-10 h-10 rounded-lg flex-shrink-0 overflow-hidden bg-gray-300 border border-black`},Qm=[`src`],$m={class:`w-40 text-center text-gray-600 text-sm truncate`},eh={class:`w-32 text-center text-gray-600 text-sm truncate`},th=[`onClick`],nh=[`onClick`],rh={__name:`LibraryPage`,setup(e){let t=rp(),n=ip(),r=If(),{requireAuth:i}=Hg(),a=F([]),o=F([]),s=F(!0),c=F(!0),l=F(null),u=F(!1);function d(e){l.value=e,i({redirectTo:`/login`,onAuthenticated:()=>{u.value=!0}})}function f(e){return t.currentTrack?._id===e._id}function p(e){return r.likedTrackIds?.has(e._id)}function m(e,r=!1,i){if(f(e)){t.togglePlay();return}let s=r?a.value:o.value,c=i??s.findIndex(t=>t._id===e._id);n.setQueue(s,c),t.setTrack(e),t.play()}function h(e){let t=p(e);i({redirectTo:`/login`,onAuthenticated:async()=>{await r.toggleLike(e._id),t&&(a.value=a.value.filter(t=>t._id!==e._id))}})}return hr(async()=>{if(r.isLoggedIn)try{let{data:e}=await Q.get(`/tracks/liked`);e.success&&(a.value=e.data||[])}catch{}s.value=!1;try{let{data:e}=await Q.get(`/tracks`);e.success&&(o.value=e.data)}catch{}finally{c.value=!1}}),(e,n)=>{let i=Tr(`router-link`);return z(),B(`div`,Em,[V(`section`,Dm,[n[8]||=V(`h2`,{class:`text-3xl font-black text-black mb-6`},`Liked Tracks`,-1),s.value?(z(),B(`div`,Om,`Loading...`)):I(r).isLoggedIn?a.value.length===0?(z(),B(`div`,Am,[n[4]||=V(`p`,{class:`text-gray-500 mb-4`},`No liked tracks yet`,-1),H(i,{to:`/home`,class:`bg-noctune-yellow border-2 border-black px-6 py-3 font-bold inline-block hover:bg-yellow-400 transition-colors rounded-lg`},{default:Rn(()=>[...n[3]||=[U(`Discover Music`,-1)]]),_:1})])):(z(),B(`div`,jm,[(z(!0),B(R,null,L(a.value,e=>(z(),B(`div`,{key:e._id,onClick:t=>m(e,!0),class:`group cursor-pointer bg-white rounded-2xl border-2 border-black overflow-hidden hover:scale-[1.02] transition-transform`},[V(`div`,Nm,[e.coverUrl?(z(),B(`img`,{key:0,src:I(np)(e.coverUrl),class:`w-full h-full object-cover`},null,8,Pm)):W(``,!0),V(`div`,{class:k([`absolute bottom-2 right-2 w-10 h-10 rounded-full flex items-center justify-center border-2 border-black opacity-0 group-hover:opacity-100 transition-opacity`,f(e)&&I(t).isPlaying?`bg-white`:`bg-noctune-yellow`])},[f(e)&&I(t).isPlaying?(z(),B(`svg`,Fm,[...n[5]||=[V(`path`,{d:`M6 19h4V5H6v14zm8-14v14h4V5h-4z`},null,-1)]])):(z(),B(`svg`,Im,[...n[6]||=[V(`path`,{d:`M8 5v14l11-7z`},null,-1)]]))],2)]),V(`div`,Lm,[V(`div`,Rm,[V(`div`,zm,[V(`p`,Bm,A(e.title),1),V(`p`,Vm,A(e.artist),1)]),V(`button`,{onClick:zo(t=>d(e),[`stop`]),class:`ml-2 flex-shrink-0 text-gray-400 hover:text-noctune-teal transition-colors`},[...n[7]||=[V(`svg`,{class:`w-4 h-4`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z`})],-1)]],8,Hm)])])],8,Mm))),128))])):(z(),B(`div`,km,[n[2]||=V(`p`,{class:`text-gray-500 mb-4`},`Login to see your liked tracks`,-1),H(i,{to:`/login`,class:`bg-noctune-yellow border-2 border-black px-6 py-3 font-bold inline-block hover:bg-yellow-400 transition-colors rounded-lg`},{default:Rn(()=>[...n[1]||=[U(`Login`,-1)]]),_:1})]))]),V(`section`,null,[n[14]||=V(`h2`,{class:`text-2xl font-black text-black mb-6 flex items-center`},[U(` All Tracks `),V(`svg`,{class:`w-5 h-5 ml-2`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z`})])],-1),c.value?(z(),B(`div`,Um,[(z(),B(R,null,L(5,e=>V(`div`,{key:e,class:`flex items-center gap-4 animate-pulse`},[...n[9]||=[aa(`
`,5)]])),64))])):(z(),B(`div`,Wm,[n[13]||=aa(`
TITLEARTISTALBUM
`,1),V(`div`,Gm,[(z(!0),B(R,null,L(o.value,(e,r)=>(z(),B(`div`,{key:e._id,onClick:t=>m(e,!1,r),class:k([`px-6 py-3 flex items-center hover:bg-gray-50 transition-colors cursor-pointer`,f(e)?`bg-noctune-teal/10`:``])},[V(`div`,qm,[V(`span`,Jm,[f(e)&&I(t).isPlaying?(z(),B(`svg`,Ym,[...n[10]||=[V(`path`,{d:`M6 19h4V5H6v14zm8-14v14h4V5h-4z`},null,-1)]])):(z(),B(`span`,Xm,A(r+1),1))]),V(`div`,Zm,[e.coverUrl?(z(),B(`img`,{key:0,src:I(np)(e.coverUrl),class:`w-full h-full object-cover`},null,8,Qm)):W(``,!0)]),V(`span`,{class:k([`font-medium text-sm truncate`,f(e)?`text-noctune-teal`:`text-black`])},A(e.title),3)]),V(`span`,$m,A(e.artist),1),V(`span`,eh,A(e.album),1),V(`button`,{onClick:zo(t=>h(e),[`stop`]),class:`w-10 flex justify-center transition-colors`},[(z(),B(`svg`,{class:k([`w-5 h-5`,p(e)?`fill-red-400 text-red-400`:`text-gray-400 hover:text-red-400`]),fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[...n[11]||=[V(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z`},null,-1)]],2))],8,th),V(`button`,{onClick:zo(t=>d(e),[`stop`]),class:`w-8 flex justify-center transition-colors text-gray-400 hover:text-noctune-teal`},[...n[12]||=[V(`svg`,{class:`w-5 h-5`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z`})],-1)]],8,nh)],10,Km))),128))])]))]),H(sm,{show:u.value,"track-id":l.value?._id,onClose:n[0]||=e=>u.value=!1},null,8,[`show`,`track-id`])])}}},ih={class:`p-8`},ah={key:0,class:`grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4`},oh={key:1,class:`text-center py-20`},sh={key:2,class:`grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4`},ch=[`onClick`],lh={class:`aspect-square bg-gray-300 relative overflow-hidden`},uh=[`src`],dh={key:1,class:`w-full h-full flex items-center justify-center bg-gradient-to-br from-noctune-teal/20 to-noctune-yellow/20`},fh={class:`p-3`},ph={class:`font-bold text-sm truncate text-black`},mh={class:`text-xs text-gray-500`},hh={__name:`PlaylistPage`,setup(e){let t=Ol(),n=If(),{requireAuth:r}=Hg(),i=F([]),a=F(!0),o=F(!1);function s(){r({redirectTo:`/login`,onAuthenticated:()=>{o.value=!0}})}function c(e){o.value=!1,i.value.unshift(e)}return hr(async()=>{if(!n.isLoggedIn){a.value=!1;return}try{let{data:e}=await Q.get(`/playlists`);e.success&&(i.value=e.data)}catch{}finally{a.value=!1}}),(e,n)=>(z(),B(`div`,ih,[V(`div`,{class:`flex items-center justify-between mb-6`},[n[2]||=V(`h1`,{class:`text-3xl font-black text-black`},`YOUR PLAYLISTS`,-1),V(`button`,{onClick:s,class:`bg-noctune-teal border-2 border-black px-4 py-2 font-bold flex items-center gap-2 rounded-lg hover:bg-teal-600 transition-colors cursor-pointer`},[...n[1]||=[V(`svg`,{class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,"stroke-width":`3`,viewBox:`0 0 24 24`},[V(`path`,{d:`M12 4v16m8-8H4`})],-1),U(` NEW PLAYLIST `,-1)]])]),a.value?(z(),B(`div`,ah,[(z(),B(R,null,L(4,e=>V(`div`,{key:e,class:`animate-pulse bg-gray-200 rounded-2xl border-2 border-black h-64`})),64))])):i.value.length===0?(z(),B(`div`,oh,[n[3]||=V(`svg`,{class:`w-24 h-24 mx-auto text-gray-300 mb-4`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M3 10h11v2H3v-2zm0-4h11v2H3V6zm0 8h7v2H3v-2zm13-1v8l6-4-6-4z`})],-1),n[4]||=V(`p`,{class:`text-gray-500 mb-2 text-lg`},`No playlists yet`,-1),n[5]||=V(`p`,{class:`text-gray-400 text-sm mb-4`},`Create your first playlist to start organizing your music`,-1),V(`button`,{onClick:s,class:`bg-noctune-yellow border-2 border-black px-6 py-3 font-bold rounded-lg hover:bg-yellow-400 transition-colors cursor-pointer`},` CREATE YOUR FIRST PLAYLIST `)])):(z(),B(`div`,sh,[(z(!0),B(R,null,L(i.value,e=>(z(),B(`div`,{key:e._id,onClick:n=>I(t).push(`/playlist/${e._id}`),class:`bg-white rounded-2xl border-2 border-black overflow-hidden hover:scale-[1.02] transition-transform cursor-pointer group`},[V(`div`,lh,[e.coverUrl?(z(),B(`img`,{key:0,src:I(np)(e.coverUrl),class:`w-full h-full object-cover`},null,8,uh)):(z(),B(`div`,dh,[...n[6]||=[V(`svg`,{class:`w-20 h-16 text-gray-400`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M3 10h11v2H3v-2zm0-4h11v2H3V6zm0 8h7v2H3v-2zm13-1v8l6-4-6-4z`})],-1)]])),n[7]||=V(`div`,{class:`absolute inset-0 bg-black/0 group-hover:bg-black/10 transition-colors`},null,-1)]),V(`div`,fh,[V(`p`,ph,A(e.name),1),V(`p`,mh,A(e.tracks?.length||0)+` songs`,1)])],8,ch))),128))])),H(Gp,{show:o.value,onClose:n[0]||=e=>o.value=!1,onCreated:c},null,8,[`show`])]))}},gh={class:`p-8`},_h={key:0,class:`space-y-6 animate-pulse`},vh={class:`space-y-3`},yh={class:`flex items-start gap-8 mb-8`},bh={class:`w-56 h-56 rounded-2xl overflow-hidden border-4 border-black flex-shrink-0 bg-black`},xh=[`src`],Sh={key:1,class:`w-full h-full flex items-center justify-center`},Ch={class:`flex-1`},wh={class:`text-4xl font-black text-black mb-4 leading-tight`},Th={key:0,class:`text-gray-600 mb-4`},Eh={class:`flex items-center gap-3 text-gray-600 mb-6`},Dh={class:`font-medium`},Oh={class:`flex gap-4`},kh=[`disabled`],Ah={class:`bg-white rounded-2xl border-4 border-black overflow-hidden`},jh={class:`divide-y divide-gray-200`},Mh=[`onClick`],Nh={class:`w-12 text-center`},Ph={key:0,class:`w-4 h-4 text-noctune-teal mx-auto`,fill:`currentColor`,viewBox:`0 0 24 24`},Fh={key:1,class:`text-gray-500`},Ih={class:`flex-1 flex items-center gap-4`},Lh={class:`w-12 h-12 rounded-lg flex-shrink-0 overflow-hidden bg-gray-300 border border-black`},Rh=[`src`],zh={class:`w-48 text-center text-gray-600 text-sm truncate`},Bh=[`onClick`],Vh=[`onClick`],Hh={key:0,class:`p-8 text-center text-gray-500`},Uh={key:2,class:`text-center py-20 text-gray-500`},Wh={__name:`PlaylistDetail`,setup(e){let t=kl(),n=rp(),r=ip(),i=If(),{requireAuth:a}=Hg(),o=F(null),s=F(!0),c=F(null),l=F(!1);function u(e){c.value=e,a({redirectTo:`/login`,onAuthenticated:()=>{l.value=!0}})}function d(e){return n.currentTrack?._id===e._id}function f(e){return i.likedTrackIds?.has(e._id)}function p(e){if(!o.value?.tracks?.length)return;let t=o.value.tracks[e];if(d(t)){n.togglePlay();return}let i=o.value.tracks;r.setQueue(i,e),n.setTrack(t),n.play()}function m(){o.value?.tracks?.length&&p(0)}function h(e){a({redirectTo:`/login`,onAuthenticated:()=>i.toggleLike(e._id)})}return hr(async()=>{let e=t.params.id;try{if(e){let{data:t}=await Q.get(`/playlists/${e}`);t.success&&(o.value=t.data)}}catch{o.value=null}finally{s.value=!1}}),(e,t)=>(z(),B(R,null,[V(`div`,gh,[s.value?(z(),B(`div`,_h,[t[2]||=aa(`
`,1),V(`div`,vh,[(z(),B(R,null,L(5,e=>V(`div`,{key:e,class:`flex items-center gap-4`},[...t[1]||=[V(`div`,{class:`w-8 h-4 bg-gray-200 rounded`},null,-1),V(`div`,{class:`w-10 h-10 bg-gray-200 rounded-lg`},null,-1),V(`div`,{class:`h-3 bg-gray-200 rounded flex-1`},null,-1),V(`div`,{class:`h-3 bg-gray-200 rounded w-24`},null,-1)]])),64))])])):o.value?(z(),B(R,{key:1},[V(`div`,yh,[V(`div`,bh,[o.value.coverUrl?(z(),B(`img`,{key:0,src:I(np)(o.value.coverUrl),class:`w-full h-full object-cover`},null,8,xh)):(z(),B(`div`,Sh,[...t[3]||=[aa(``,1)]]))]),V(`div`,Ch,[t[5]||=V(`span`,{class:`inline-block bg-noctune-teal text-black text-xs font-bold px-3 py-1 rounded mb-3 border border-black`},`PLAYLIST`,-1),V(`h1`,wh,A(o.value.name),1),o.value.description?(z(),B(`p`,Th,A(o.value.description),1)):W(``,!0),V(`div`,Eh,[V(`span`,Dh,A(o.value.tracks?.length||0)+` songs`,1)]),V(`div`,Oh,[V(`button`,{onClick:m,disabled:!o.value.tracks?.length,class:`bg-noctune-teal border-2 border-black px-6 py-2 font-bold flex items-center gap-2 rounded-lg hover:bg-teal-600 transition-colors disabled:opacity-50 cursor-pointer`},[...t[4]||=[V(`svg`,{class:`w-4 h-4`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M8 5v14l11-7z`})],-1),U(` PLAY `,-1)]],8,kh)])])]),V(`div`,Ah,[t[9]||=aa(`
#TITLEARTIST
`,1),V(`div`,jh,[(z(!0),B(R,null,L(o.value.tracks,(e,r)=>(z(),B(`div`,{key:e._id,onClick:e=>p(r),class:k([`px-6 py-3 flex items-center hover:bg-gray-50 transition-colors cursor-pointer`,d(e)?`bg-noctune-teal/10`:``])},[V(`span`,Nh,[d(e)&&I(n).isPlaying?(z(),B(`svg`,Ph,[...t[6]||=[V(`path`,{d:`M6 19h4V5H6v14zm8-14v14h4V5h-4z`},null,-1)]])):(z(),B(`span`,Fh,A(r+1),1))]),V(`div`,Ih,[V(`div`,Lh,[e.coverUrl?(z(),B(`img`,{key:0,src:I(np)(e.coverUrl),class:`w-full h-full object-cover`},null,8,Rh)):W(``,!0)]),V(`span`,{class:k([`font-medium text-sm truncate`,d(e)?`text-noctune-teal`:`text-black`])},A(e.title),3)]),V(`span`,zh,A(e.artist),1),V(`button`,{onClick:zo(t=>h(e),[`stop`]),class:`w-10 flex justify-center transition-colors cursor-pointer`},[(z(),B(`svg`,{class:k([`w-5 h-5`,f(e)?`fill-red-400 text-red-400`:`text-gray-400 hover:text-red-400`]),fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[...t[7]||=[V(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z`},null,-1)]],2))],8,Bh),V(`button`,{onClick:zo(t=>u(e),[`stop`]),class:`w-8 flex justify-center transition-colors text-gray-400 hover:text-noctune-teal cursor-pointer`},[...t[8]||=[V(`svg`,{class:`w-5 h-5`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z`})],-1)]],8,Vh)],10,Mh))),128)),o.value.tracks?.length?W(``,!0):(z(),B(`div`,Hh,`No tracks in this playlist yet`))])])],64)):(z(),B(`div`,Uh,`Playlist not found`))]),H(sm,{show:l.value,"track-id":c.value?._id,onClose:t[0]||=e=>l.value=!1},null,8,[`show`,`track-id`])],64))}},Gh={class:`p-8`},Kh={class:`bg-white rounded-2xl border-4 border-black p-6 mb-6 flex items-center gap-8`},qh={class:`w-40 h-40 rounded-full border-4 border-black overflow-hidden flex-shrink-0 bg-gray-300`},Jh=[`src`],Yh={key:1,class:`w-full h-full flex items-center justify-center`},Xh={class:`flex-1`},Zh={class:`text-3xl font-black text-black mb-1`},Qh={class:`text-gray-600 mb-3`},$h={class:`inline-flex items-center gap-2 border-2 border-noctune-orange text-noctune-orange px-3 py-1 rounded-full mb-4`},eg={class:`text-sm font-medium`},tg={class:`flex gap-4`},ng={key:0,class:`bg-white rounded-2xl border-4 border-black p-6 mb-6`},rg={key:0,class:`text-red-500 text-sm mb-4`},ig={key:1,class:`text-green-600 text-sm mb-4`},ag={class:`space-y-4 max-w-md`},og=[`disabled`],sg={key:0,class:`inline-block w-4 h-4 border-2 border-black border-t-transparent rounded-full animate-spin mr-1`},cg={class:`bg-white rounded-2xl border-4 border-black p-6 mb-6 flex justify-center gap-12`},lg={class:`flex items-center gap-4`},ug={class:`text-2xl font-black text-black`},dg={__name:`ProfilePage`,setup(e){let t=Ol(),n=If(),r=F(!1),i=F(``),a=F(``),o=F(``),s=F(null),c=F(!1),l=F(``),u=F(``),d=F(0),f=G(()=>n.user?.name||n.user?.username||`User`);function p(){r.value=!r.value,r.value&&(i.value=n.user?.name||``,a.value=n.user?.username||``,o.value=n.user?.email||``,s.value=null,l.value=``,u.value=``)}function m(e){s.value=e.target.files[0]||null}async function h(){l.value=``,u.value=``,c.value=!0;try{let e=new FormData;e.append(`name`,i.value),e.append(`username`,a.value),e.append(`email`,o.value),s.value&&e.append(`avatar`,s.value);let t=await n.updateProfile(e);t.success?(u.value=`Profile updated!`,setTimeout(()=>{r.value=!1},1500)):l.value=t.message}catch{l.value=`Update failed`}finally{c.value=!1}}async function g(){await n.logout(),t.push(`/login`)}return hr(async()=>{if(!n.isLoggedIn){t.push(`/login`);return}try{let{data:e}=await Q.get(`/tracks/liked`);e.success&&(d.value=e.data.likedTracks?.length||0)}catch{}}),(e,t)=>(z(),B(`div`,Gh,[V(`div`,Kh,[V(`div`,qh,[I(n).user?.avatarUrl?(z(),B(`img`,{key:0,src:I(np)(I(n).user.avatarUrl),alt:`Profile`,class:`w-full h-full object-cover`},null,8,Jh)):(z(),B(`div`,Yh,[...t[3]||=[V(`svg`,{class:`w-16 h-16 text-gray-400`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z`})],-1)]]))]),V(`div`,Xh,[V(`h1`,Zh,A(f.value),1),V(`p`,Qh,`@`+A(I(n).user?.username||`username`),1),V(`div`,$h,[t[4]||=V(`svg`,{class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z`})],-1),V(`span`,eg,A(I(n).user?.role===`admin`?`Admin`:`Premium Member`),1)]),V(`div`,tg,[V(`button`,{onClick:p,class:`border-2 border-black px-4 py-2 rounded-lg font-medium flex items-center gap-2 hover:bg-gray-100 transition-colors`},[t[5]||=V(`svg`,{class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z`})],-1),U(` `+A(r.value?`Cancel`:`Edit Profile`),1)])])])]),r.value?(z(),B(`div`,ng,[t[11]||=V(`h3`,{class:`text-xl font-black text-black mb-4`},`Edit Profile`,-1),l.value?(z(),B(`p`,rg,A(l.value),1)):W(``,!0),u.value?(z(),B(`p`,ig,A(u.value),1)):W(``,!0),V(`div`,ag,[V(`div`,null,[t[6]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-1`},`NAME`,-1),zn(V(`input`,{type:`text`,"onUpdate:modelValue":t[0]||=e=>i.value=e,class:`w-full border-2 border-black rounded-lg px-4 py-2 focus:outline-none text-black`},null,512),[[Eo,i.value]])]),V(`div`,null,[t[7]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-1`},`USERNAME`,-1),zn(V(`input`,{type:`text`,"onUpdate:modelValue":t[1]||=e=>a.value=e,class:`w-full border-2 border-black rounded-lg px-4 py-2 focus:outline-none text-black`},null,512),[[Eo,a.value]])]),V(`div`,null,[t[8]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-1`},`EMAIL`,-1),zn(V(`input`,{type:`email`,"onUpdate:modelValue":t[2]||=e=>o.value=e,class:`w-full border-2 border-black rounded-lg px-4 py-2 focus:outline-none text-black`},null,512),[[Eo,o.value]])]),V(`div`,null,[t[9]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-1`},`AVATAR`,-1),V(`input`,{type:`file`,accept:`image/*`,onChange:m,class:`w-full text-sm`},null,32)]),V(`button`,{onClick:h,disabled:c.value,class:`bg-noctune-teal border-2 border-black px-6 py-2 font-bold rounded-lg hover:bg-teal-600 transition-colors disabled:opacity-50`},[c.value?(z(),B(`span`,sg)):W(``,!0),t[10]||=U(` Save Changes `,-1)],8,og)])])):W(``,!0),V(`div`,cg,[V(`div`,lg,[t[13]||=V(`div`,{class:`w-14 h-14 bg-noctune-orange rounded-xl flex items-center justify-center border-2 border-black`},[V(`svg`,{class:`w-7 h-7 text-white`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z`})])],-1),V(`div`,null,[V(`p`,ug,A(d.value),1),t[12]||=V(`p`,{class:`text-sm text-gray-500`},`Liked Songs`,-1)])])]),V(`button`,{onClick:g,class:`w-full bg-noctune-orange border-4 border-black rounded-2xl py-4 font-bold text-black flex items-center justify-center gap-3 hover:bg-orange-600 transition-colors`},[...t[14]||=[V(`svg`,{class:`w-6 h-6`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1`})],-1),U(` Logout `,-1)]])]))}},fg={class:`bg-noctune-cream flex flex-col h-full`},pg={class:`p-4 space-y-2`},mg={class:`relative group`},hg={class:`absolute left-0 top-full mt-1 w-56 bg-white border-2 border-black rounded-lg shadow-[4px_4px_0px_0px_#000] opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-200 z-50 max-h-72 overflow-y-auto`},gg={key:0,class:`p-2`},_g=[`onClick`],vg={class:`truncate`},yg={key:1,class:`p-4 text-center text-sm text-gray-500`},bg={class:`border-t-2 border-gray-200 p-2`},xg={__name:`Sidebar`,setup(e){let t=kl(),n=Ol(),r=If(),i=F([]),a=F(!1),{requireAuth:o}=Hg(),s=e=>t.path===e,c=e=>t.path.startsWith(e);async function l(){if(r.isLoggedIn)try{let{data:e}=await Q.get(`/playlists`);e.success&&(i.value=e.data)}catch{}}function u(){o({redirectTo:`/login`,onAuthenticated:()=>{a.value=!0}})}function d(e){a.value=!1,i.value.unshift(e)}return hr(l),(e,t)=>{let o=Tr(`router-link`);return z(),B(`aside`,fg,[V(`nav`,pg,[H(o,{to:`/home`,class:k([`flex items-center gap-3 px-4 py-3 rounded-lg font-bold text-black hover:bg-noctune-teal/20 transition-colors`,{"bg-noctune-teal text-black":s(`/home`)}])},{default:Rn(()=>[...t[1]||=[V(`svg`,{class:`w-6 h-6`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z`})],-1),V(`span`,{class:`tracking-wide`},`HOME`,-1)]]),_:1},8,[`class`]),H(o,{to:`/library`,class:k([`flex items-center gap-3 px-4 py-3 rounded-lg font-bold text-black hover:bg-noctune-teal/20 transition-colors`,{"bg-noctune-teal text-black":s(`/library`)}])},{default:Rn(()=>[...t[2]||=[V(`svg`,{class:`w-6 h-6`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M3 13h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7z`})],-1),V(`span`,{class:`tracking-wide`},`LIBRARY`,-1)]]),_:1},8,[`class`]),V(`div`,mg,[H(o,{to:`/playlist`,class:k([`flex items-center gap-3 px-4 py-3 rounded-lg font-bold text-black hover:bg-noctune-teal/20 transition-colors`,{"bg-noctune-teal text-black":s(`/playlist`)||c(`/playlist/`)}])},{default:Rn(()=>[...t[3]||=[V(`svg`,{class:`w-6 h-6`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M3 10h11v2H3v-2zm0-4h11v2H3V6zm0 8h7v2H3v-2zm13-1v8l6-4-6-4z`})],-1),V(`span`,{class:`tracking-wide`},`PLAYLIST`,-1),V(`svg`,{class:`w-4 h-4 ml-auto text-gray-500 group-hover:rotate-180 transition-transform`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M7 10l5 5 5-5z`})],-1)]]),_:1},8,[`class`]),V(`div`,hg,[i.value.length?(z(),B(`div`,gg,[(z(!0),B(R,null,L(i.value,e=>(z(),B(`div`,{key:e._id,onClick:t=>I(n).push(`/playlist/${e._id}`),class:`flex items-center gap-2 px-3 py-2 rounded-lg cursor-pointer hover:bg-noctune-teal/20 transition-colors text-sm font-medium text-black`},[t[4]||=V(`svg`,{class:`w-4 h-4 flex-shrink-0 text-gray-500`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M3 10h11v2H3v-2zm0-4h11v2H3V6zm0 8h7v2H3v-2zm13-1v8l6-4-6-4z`})],-1),V(`span`,vg,A(e.name),1)],8,_g))),128))])):(z(),B(`div`,yg,`No playlists yet`)),V(`div`,bg,[H(o,{to:`/playlist`,class:`block px-3 py-2 rounded-lg text-sm font-bold text-noctune-teal hover:bg-noctune-teal/20 transition-colors text-center`},{default:Rn(()=>[...t[5]||=[U(` Browse All Playlists `,-1)]]),_:1})])])]),I(r).isAdmin?(z(),Zi(o,{key:0,to:`/admin/tracks`,class:k([`flex items-center gap-3 px-4 py-3 rounded-lg font-bold text-black hover:bg-noctune-orange/20 transition-colors`,{"bg-noctune-orange text-black":s(`/admin/tracks`)}])},{default:Rn(()=>[...t[6]||=[V(`svg`,{class:`w-6 h-6`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm-3 17l-4-4 1.41-1.41L11 16.17l6.59-6.59L19 11l-8 8z`})],-1),V(`span`,{class:`tracking-wide`},`UPLOAD TRACK`,-1)]]),_:1},8,[`class`])):W(``,!0)]),t[8]||=V(`div`,{class:`mx-4 border-t-2 border-gray-300 my-2`},null,-1),V(`div`,{class:`px-4`},[V(`button`,{onClick:u,class:`w-full bg-noctune-yellow border-2 border-black rounded-lg py-3 px-4 font-bold flex items-center gap-2 hover:bg-yellow-400 transition-colors`},[...t[7]||=[V(`svg`,{class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`3`,d:`M12 4v16m8-8H4`})],-1),V(`span`,{class:`tracking-wide`},`CREATE PLAYLIST`,-1)]])]),t[9]||=V(`div`,{class:`flex-1`},null,-1),H(Gp,{show:a.value,onClose:t[0]||=e=>a.value=!1,onCreated:d},null,8,[`show`])])}}},Sg={class:`min-h-screen bg-noctune-cream flex flex-col`},Cg={class:`flex flex-1`},wg={class:`flex-1 p-8 overflow-auto`},Tg={class:`max-w-2xl mx-auto`},Eg={key:0,class:`text-red-500 text-sm mb-4 font-medium`},Dg={key:1,class:`text-green-600 text-sm mb-4 font-medium`},Og={class:`bg-white rounded-2xl border-4 border-black p-8 space-y-6`},kg=[`src`],Ag={key:1,class:`text-gray-500`},jg={key:0,class:`text-black font-medium`},Mg={key:1,class:`text-gray-500`},Ng=[`disabled`],Pg={key:0,class:`inline-block w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin mr-2`},Fg=[{path:`/`,redirect:`/home`},{path:`/login`,name:`Login`,component:Cp,meta:{guest:!0}},{path:`/register`,name:`Register`,component:Rp,meta:{guest:!0}},{path:`/home`,name:`Home`,component:Tm},{path:`/library`,name:`Library`,component:rh},{path:`/playlist`,name:`Playlist`,component:hh},{path:`/playlist/:id`,name:`PlaylistDetail`,component:Wh},{path:`/profile`,name:`Profile`,component:dg},{path:`/admin/tracks`,name:`AdminTracks`,component:{__name:`AdminPage`,setup(e){let t=Ol(),n=F(``),r=F(``),i=F(``),a=F(``),o=F(null),s=F(``),c=F(null),l=F(!1),u=F(``),d=F(``),f=F(null),p=F(null);function m(e){let t=e.target.files[0];t&&(o.value=t,s.value=URL.createObjectURL(t))}function h(e){let t=e.target.files[0];t&&(c.value=t)}async function g(){if(u.value=``,d.value=``,!n.value||!r.value||!i.value||!a.value||!o.value||!c.value){u.value=`All fields are required`;return}l.value=!0;try{let e=new FormData;e.append(`title`,n.value),e.append(`artist`,r.value),e.append(`album`,i.value),e.append(`genre`,a.value),e.append(`cover`,o.value),e.append(`audio`,c.value);let{data:l}=await Q.post(`/admin/tracks`,e,{headers:{"Content-Type":`multipart/form-data`}});l.success&&(d.value=`Track uploaded successfully!`,n.value=``,r.value=``,i.value=``,a.value=``,o.value=null,s.value=``,c.value=null,setTimeout(()=>t.push(`/home`),1500))}catch(e){u.value=e.response?.data?.message||`Upload failed`}finally{l.value=!1}}return(e,t)=>(z(),B(`div`,Sg,[V(`div`,Cg,[V(`main`,wg,[V(`div`,Tg,[t[12]||=V(`h1`,{class:`text-4xl font-black text-black mb-2`},`Upload Track`,-1),t[13]||=V(`p`,{class:`text-gray-600 mb-8`},`Add a new track to the library`,-1),u.value?(z(),B(`p`,Eg,A(u.value),1)):W(``,!0),d.value?(z(),B(`p`,Dg,A(d.value),1)):W(``,!0),V(`div`,Og,[V(`div`,null,[t[6]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-2 tracking-wider`},`TITLE`,-1),zn(V(`input`,{type:`text`,"onUpdate:modelValue":t[0]||=e=>n.value=e,class:`w-full border-2 border-black rounded-lg px-4 py-3 focus:outline-none text-black`,placeholder:`Track title`},null,512),[[Eo,n.value]])]),V(`div`,null,[t[7]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-2 tracking-wider`},`ARTIST`,-1),zn(V(`input`,{type:`text`,"onUpdate:modelValue":t[1]||=e=>r.value=e,class:`w-full border-2 border-black rounded-lg px-4 py-3 focus:outline-none text-black`,placeholder:`Artist name`},null,512),[[Eo,r.value]])]),V(`div`,null,[t[8]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-2 tracking-wider`},`ALBUM`,-1),zn(V(`input`,{type:`text`,"onUpdate:modelValue":t[2]||=e=>i.value=e,class:`w-full border-2 border-black rounded-lg px-4 py-3 focus:outline-none text-black`,placeholder:`Album name`},null,512),[[Eo,i.value]])]),V(`div`,null,[t[9]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-2 tracking-wider`},`GENRE`,-1),zn(V(`input`,{type:`text`,"onUpdate:modelValue":t[3]||=e=>a.value=e,class:`w-full border-2 border-black rounded-lg px-4 py-3 focus:outline-none text-black`,placeholder:`e.g. Pop, Rock, Jazz`},null,512),[[Eo,a.value]])]),V(`div`,null,[t[10]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-2 tracking-wider`},`COVER IMAGE`,-1),V(`div`,{class:`border-2 border-dashed border-black rounded-lg p-6 text-center cursor-pointer hover:bg-gray-50`,onClick:t[4]||=e=>f.value.click()},[s.value?(z(),B(`img`,{key:0,src:s.value,class:`w-32 h-32 object-cover mx-auto mb-2 rounded-lg border-2 border-black`},null,8,kg)):(z(),B(`p`,Ag,`Click to upload cover image`)),V(`input`,{ref_key:`coverInput`,ref:f,type:`file`,accept:`image/*`,onChange:m,class:`hidden`},null,544)])]),V(`div`,null,[t[11]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-2 tracking-wider`},`AUDIO FILE`,-1),V(`div`,{class:`border-2 border-dashed border-black rounded-lg p-6 text-center cursor-pointer hover:bg-gray-50`,onClick:t[5]||=e=>p.value.click()},[c.value?(z(),B(`p`,jg,A(c.value.name),1)):(z(),B(`p`,Mg,` Click to upload audio file (MP3, WAV, FLAC) `)),V(`input`,{ref_key:`audioInput`,ref:p,type:`file`,accept:`.mp3,.wav,.flac`,onChange:h,class:`hidden`},null,544)])]),V(`button`,{onClick:g,disabled:l.value,class:`w-full bg-noctune-orange border-2 border-black rounded-lg py-4 font-bold text-white text-xl hover:bg-orange-600 transition-colors disabled:opacity-50`},[l.value?(z(),B(`span`,Pg)):W(``,!0),U(` `+A(l.value?`Uploading...`:`UPLOAD TRACK`),1)],8,Ng)])])])])]))}},meta:{admin:!0}}],Ig=Dl({history:qc(),routes:Fg});Ig.beforeEach((e,t,n)=>{let r=If();if(e.meta.admin&&!r.isAdmin||e.meta.guest&&r.isLoggedIn)return n(`/home`);n()});var Lg=`modulepreload`,Rg=function(e){return`/`+e},zg={},Bg=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=Rg(t,n),t in zg)return;zg[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:Lg,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Vg=null;function Hg(){let e=If();async function t({message:t,onAuthenticated:n,redirectTo:r}){if(e.isLoggedIn)n?.();else if(Vg=n||null,r)Ig.push(r);else if(t){let{useUiStore:e}=await Bg(async()=>{let{useUiStore:e}=await Promise.resolve().then(()=>Lf);return{useUiStore:e}},void 0);e().showToast(t,`info`)}}function n(){if(Vg){let e=Vg;Vg=null,e()}}return{requireAuth:t,executePending:n}}var Ug={class:`bg-noctune-teal px-4 py-3 flex items-center justify-between border-b-4 border-black`},Wg={class:`flex items-center gap-4`},Gg={class:`flex-1 max-w-md mx-8 relative`},Kg={class:`relative`},qg={key:0,class:`absolute top-full mt-2 left-0 right-0 bg-white border-2 border-black rounded-lg shadow-[4px_4px_0px_0px_#000] max-h-96 overflow-y-auto z-50`},Jg={key:0,class:`p-2`},Yg=[`onClick`],Xg={class:`w-8 h-8 bg-gray-300 rounded border border-black flex-shrink-0 overflow-hidden`},Zg=[`src`],Qg={class:`min-w-0 flex-1`},$g={class:`text-sm font-medium text-black truncate`},e_={class:`text-xs text-gray-500`},t_={key:1,class:`p-2 border-t border-gray-200`},n_=[`onClick`],r_={key:2,class:`p-4 text-center text-gray-500 text-sm`},i_={class:`flex items-center gap-4`},a_={class:`w-8 h-8 rounded-full bg-noctune-dark overflow-hidden border-2 border-black`},o_=[`src`],s_={key:1,class:`w-full h-full flex items-center justify-center`},c_={__name:`AppHeader`,setup(e){let t=Ol(),n=If(),r=rp(),i=ip(),{requireAuth:a}=Hg(),o=F(``),s=F(null),c=null;function l(){if(clearTimeout(c),!o.value.trim()){s.value=null;return}c=setTimeout(async()=>{try{let{data:e}=await Q.get(`/search?q=${encodeURIComponent(o.value)}`);e.success&&(s.value=e.data)}catch{s.value=null}},300)}function u(){o.value=``,s.value=null}function d(e){u(),i.setQueue([e],0),r.setTrack(e),r.play()}function f(){a({redirectTo:`/login`,onAuthenticated:()=>t.push(`/library`)})}function p(){a({redirectTo:`/login`,onAuthenticated:()=>t.push(`/profile`)})}return(e,r)=>{let i=Tr(`router-link`);return z(),B(`header`,Ug,[V(`div`,Wg,[H(i,{to:`/home`,class:`text-black font-bold text-2xl tracking-wider font-mono`},{default:Rn(()=>[...r[1]||=[U(`NOCTUNE`,-1)]]),_:1})]),V(`div`,Gg,[V(`div`,Kg,[r[2]||=V(`div`,{class:`absolute inset-y-0 left-3 flex items-center pointer-events-none`},[V(`svg`,{class:`w-5 h-5 text-gray-500`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z`})])],-1),zn(V(`input`,{type:`text`,"onUpdate:modelValue":r[0]||=e=>o.value=e,onInput:l,onKeydown:Vo(u,[`escape`]),placeholder:`Search music, artist, album...`,class:`w-full bg-noctune-cream py-2 pl-10 pr-4 rounded-full text-sm focus:outline-none focus:ring-2 focus:ring-black`},null,544),[[Eo,o.value]])]),s.value&&o.value?(z(),B(`div`,qg,[s.value.tracks?.length?(z(),B(`div`,Jg,[r[3]||=V(`p`,{class:`text-xs font-bold text-gray-500 px-2 py-1`},`TRACKS`,-1),(z(!0),B(R,null,L(s.value.tracks.slice(0,5),e=>(z(),B(`div`,{key:e._id,onClick:t=>d(e),class:`flex items-center gap-3 px-2 py-2 hover:bg-gray-100 rounded cursor-pointer`},[V(`div`,Xg,[e.coverUrl?(z(),B(`img`,{key:0,src:I(np)(e.coverUrl),class:`w-full h-full object-cover`},null,8,Zg)):W(``,!0)]),V(`div`,Qg,[V(`p`,$g,A(e.title),1),V(`p`,e_,A(e.artist),1)])],8,Yg))),128))])):W(``,!0),s.value.artists?.length?(z(),B(`div`,t_,[r[4]||=V(`p`,{class:`text-xs font-bold text-gray-500 px-2 py-1`},`ARTISTS`,-1),(z(!0),B(R,null,L(s.value.artists.slice(0,3),e=>(z(),B(`div`,{key:e.name,onClick:n=>I(t).push(`/home?artist=${e.name}`),class:`px-2 py-2 hover:bg-gray-100 rounded cursor-pointer text-sm font-medium text-black`},A(e.name),9,n_))),128))])):W(``,!0),!s.value.tracks?.length&&!s.value.artists?.length?(z(),B(`div`,r_,`No results found`)):W(``,!0)])):W(``,!0)]),V(`div`,i_,[V(`button`,{onClick:f,class:`text-black hover:opacity-80`},[...r[5]||=[V(`svg`,{class:`w-7 h-7`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z`})],-1)]]),V(`button`,{onClick:p,class:`text-black hover:opacity-80`},[V(`div`,a_,[I(n).user?.avatarUrl?(z(),B(`img`,{key:0,src:I(np)(I(n).user.avatarUrl),class:`w-full h-full object-cover`},null,8,o_)):(z(),B(`div`,s_,[...r[6]||=[V(`svg`,{class:`w-5 h-5 text-white`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z`})],-1)]]))])])])])}}},l_=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},u_={key:0,class:`fixed bottom-0 left-0 right-0 bg-noctune-dark border-t-4 border-black z-50`},d_={class:`flex items-center px-4 py-2 max-w-screen-2xl mx-auto`},f_={class:`flex items-center gap-3 w-80`},p_={class:`w-12 h-12 bg-black rounded-lg overflow-hidden flex-shrink-0 border border-white/20`},m_=[`src`],h_={key:1,class:`w-full h-full flex items-center justify-center`},g_={class:`min-w-0`},__={class:`text-sm font-bold text-white truncate`},v_={class:`text-xs text-gray-400 truncate`},y_={class:`flex-1 flex flex-col items-center`},b_={class:`flex items-center gap-4 mb-1`},x_={key:0,class:`w-5 h-5 text-black`,fill:`currentColor`,viewBox:`0 0 24 24`},S_={key:1,class:`w-5 h-5 text-black ml-0.5`,fill:`currentColor`,viewBox:`0 0 24 24`},C_={key:0,class:`absolute -top-2 -right-2 text-[9px] font-bold`},w_={class:`flex items-center gap-3 w-full max-w-lg`},T_={class:`text-xs text-gray-400 w-10 text-right`},E_=[`value`,`max`],D_={class:`text-xs text-gray-400 w-10`},O_={class:`w-80 flex items-center justify-end gap-3`},k_={class:`flex items-center gap-2`},A_=[`value`],j_=l_({__name:`PlayerBar`,setup(e){let t=rp(),n=ip(),r=If(),{requireAuth:i}=Hg(),a=F(!1),o=F(null);function s(e){return`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,`0`)}`}function c(e){let n=e.currentTarget.getBoundingClientRect();o.value=(e.clientX-n.left)/n.width*t.duration}function l(){let e=n.nextTrack();e&&(t.setTrack(e),t.play())}hr(()=>{t.onEnd(l)});let u=G(()=>np(t.currentTrack?.coverUrl));function d(e){t.seek(parseFloat(e.target.value))}function f(e){t.setVolume(parseInt(e.target.value))}function p(){let e=n.nextTrack();e&&(t.setTrack(e),t.play())}function m(){let e=n.prevTrack();e&&(t.setTrack(e),t.play())}function h(){if(!t.currentTrack)return;let e=t.currentTrack._id||t.currentTrack.id;i({redirectTo:`/login`,onAuthenticated:()=>r.toggleLike(e)})}return Kn(()=>t.currentTrack?._id,e=>{a.value=e?r.likedTrackIds.has(e):!1},{immediate:!0}),Kn(()=>r.user?.likedTracks?.length,()=>{let e=t.currentTrack?._id;e&&(a.value=r.likedTrackIds.has(e))}),(e,r)=>I(t).currentTrack?(z(),B(`div`,u_,[V(`div`,d_,[V(`div`,f_,[V(`div`,p_,[I(t).currentTrack.coverUrl?(z(),B(`img`,{key:0,src:u.value,alt:``,class:`w-full h-full object-cover`},null,8,m_)):(z(),B(`div`,h_,[...r[6]||=[aa(``,1)]]))]),V(`div`,g_,[V(`p`,__,A(I(t).currentTrack.title),1),V(`p`,v_,A(I(t).currentTrack.artist),1)])]),V(`div`,y_,[V(`div`,b_,[V(`button`,{onClick:r[0]||=e=>I(n).toggleShuffle(),class:k([`text-sm transition-colors`,I(n).shuffle?`text-noctune-teal`:`text-gray-400 hover:text-white`])},[...r[7]||=[V(`svg`,{class:`w-4 h-4`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M10.59 9.17L5.41 4 4 5.41l5.17 5.17 1.42-1.41zM14.5 4l2.04 2.04L4 18.59 5.41 20 17.96 7.46 20 9.5V4h-5.5zm.33 9.41l-1.41 1.41 3.13 3.13L14.5 20H20v-5.5l-2.04 2.04-3.13-3.13z`})],-1)]],2),V(`button`,{onClick:r[1]||=e=>m(),class:`text-gray-400 hover:text-white transition-colors`},[...r[8]||=[V(`svg`,{class:`w-5 h-5`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M6 6h2v12H6zm3.5 6l8.5 6V6z`})],-1)]]),V(`button`,{onClick:r[2]||=e=>I(t).togglePlay(),class:`w-10 h-10 bg-white rounded-full flex items-center justify-center hover:scale-105 transition-transform`},[I(t).isPlaying?(z(),B(`svg`,x_,[...r[9]||=[V(`path`,{d:`M6 19h4V5H6v14zm8-14v14h4V5h-4z`},null,-1)]])):(z(),B(`svg`,S_,[...r[10]||=[V(`path`,{d:`M8 5v14l11-7z`},null,-1)]]))]),V(`button`,{onClick:r[3]||=e=>p(),class:`text-gray-400 hover:text-white transition-colors`},[...r[11]||=[V(`svg`,{class:`w-5 h-5`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M6 18l8.5-6L6 6v12zM16 6v12h2V6h-2z`})],-1)]]),V(`button`,{onClick:r[4]||=e=>I(n).cycleRepeat(),class:k([`text-sm transition-colors`,I(n).repeat===`off`?`text-gray-400 hover:text-white`:`text-noctune-teal`,I(n).repeat===`one`?`relative`:``])},[r[12]||=V(`svg`,{class:`w-4 h-4`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M7 7h10v3l4-4-4-4v3H5v6h2V7zm10 10H7v-3l-4 4 4 4v-3h12v-6h-2v4z`})],-1),I(n).repeat===`one`?(z(),B(`span`,C_,`1`)):W(``,!0)],2)]),V(`div`,w_,[V(`span`,T_,A(I(t).formattedProgress),1),V(`div`,{class:`relative flex-1`,onMousemove:c,onMouseleave:r[5]||=e=>o.value=null},[o.value===null?W(``,!0):(z(),B(`div`,{key:0,class:`absolute -top-6 left-1/2 -translate-x-1/2 bg-black text-white text-xs px-2 py-1 rounded whitespace-nowrap z-10`,style:pe({left:`${o.value/(I(t).duration||1)*100}%`})},A(s(o.value)),5)),V(`input`,{type:`range`,value:I(t).progress,onInput:d,min:`0`,max:I(t).duration||1,step:`0.1`,class:`w-full h-1 bg-gray-600 rounded-full appearance-none cursor-pointer range-player`},null,40,E_)],32),V(`span`,D_,A(I(t).formattedDuration),1)])]),V(`div`,O_,[V(`button`,{onClick:h,class:`transition-colors`},[(z(),B(`svg`,{class:k([`w-5 h-5`,a.value?`fill-red-400 text-red-400`:`text-gray-400 hover:text-red-400`]),fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[...r[13]||=[V(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z`},null,-1)]],2))]),V(`div`,k_,[r[14]||=V(`svg`,{class:`w-4 h-4 text-gray-400`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z`})],-1),V(`input`,{type:`range`,value:I(t).volume,onInput:f,min:`0`,max:`100`,class:`w-20 h-1 bg-gray-600 rounded-full appearance-none cursor-pointer range-vol`},null,40,A_)])])])])):W(``,!0)}},[[`__scopeId`,`data-v-0368441b`]]);function M_(){let e=rp();ip();function t(t){if(![`INPUT`,`TEXTAREA`].includes(t.target.tagName))switch(t.code){case`Space`:t.preventDefault(),e.togglePlay();break;case`ArrowLeft`:e.seek(Math.max(0,e.progress-5));break;case`ArrowRight`:e.seek(Math.min(e.duration,e.progress+5));break;case`ArrowUp`:e.setVolume(Math.min(100,e.volume+5));break;case`ArrowDown`:e.setVolume(Math.max(0,e.volume-5));break}}hr(()=>window.addEventListener(`keydown`,t)),yr(()=>window.removeEventListener(`keydown`,t))}var N_={class:`min-h-screen bg-noctune-cream`},P_={key:0},F_={class:`flex`},I_={class:`fixed top-4 right-4 z-[100] space-y-2`},L_={class:`flex items-center gap-2`},R_=[`onClick`],z_=Go({__name:`App`,setup(e){let t=kl(),n=If(),r=Rf(),i=rp(),a=G(()=>t.meta?.guest===!0),o=G(()=>!!i.currentTrack);M_();function s(e){return{info:`bg-noctune-teal text-black`,success:`bg-green-400 text-black`,error:`bg-red-400 text-white`}[e]||`bg-noctune-yellow text-black`}return hr(async()=>{await n.checkSession()}),(e,t)=>{let n=Tr(`router-view`);return z(),B(`div`,N_,[a.value?(z(),Zi(n,{key:1})):(z(),B(`div`,P_,[H(c_,{class:`sticky top-0 z-30`}),V(`div`,F_,[H(xg,{class:`fixed left-0 top-[57px] bottom-0 w-64 border-r-4 border-black overflow-y-auto z-20`}),V(`main`,{class:k([`ml-64 flex-1 min-h-[calc(100vh-57px)]`,{"pb-20":o.value}])},[H(n)],2)]),H(j_)])),V(`div`,I_,[(z(!0),B(R,null,L(I(r).toasts,e=>(z(),B(`div`,{key:e.id,class:k([`px-4 py-3 rounded-lg border-2 border-black font-bold text-sm shadow-[4px_4px_0px_0px_#000] transition-all animate-slide-in`,s(e.type)])},[V(`div`,L_,[V(`span`,null,A(e.message),1),V(`button`,{onClick:t=>I(r).dismissToast(e.id),class:`ml-2 opacity-60 hover:opacity-100`},` × `,8,R_)])],2))),128))])])}}}),B_=fs();z_.use(B_),z_.use(Ig),If(B_).checkSession().finally(()=>{z_.mount(`#app`)}); \ No newline at end of file +`+n)}}catch{}}throw e}}_request(e,t){typeof e==`string`?(t||={},t.url=e):t=e||{},t=Qd(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&Of.assertOptions(n,{silentJSONParsing:kf.transitional(kf.boolean),forcedJSONParsing:kf.transitional(kf.boolean),clarifyTimeoutError:kf.transitional(kf.boolean),legacyInterceptorReqResOrdering:kf.transitional(kf.boolean)},!1),r!=null&&(Y.isFunction(r)?t.paramsSerializer={serialize:r}:Of.assertOptions(r,{encode:kf.function,serialize:kf.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),Of.assertOptions(t,{baseUrl:kf.spelling(`baseURL`),withXsrfToken:kf.spelling(`withXSRFToken`)},!0),t.method=(t.method||this.defaults.method||`get`).toLowerCase();let a=i&&Y.merge(i.common,i[t.method]);i&&Y.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`query`,`common`],e=>{delete i[e]}),t.headers=id.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s&&=e.synchronous;let n=t.transitional||bd;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[wf.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new Rd(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function Mf(e){return function(t){return e.apply(null,t)}}function Nf(e){return Y.isObject(e)&&e.isAxiosError===!0}var Pf={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Pf).forEach(([e,t])=>{Pf[t]=e});function Ff(e){let t=new Af(e),n=Al(Af.prototype.request,t);return Y.extend(n,Af.prototype,t,{allOwnKeys:!0}),Y.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return Ff(Qd(e,t))},n}var Z=Ff(Fd);Z.Axios=Af,Z.CanceledError=Rd,Z.CancelToken=jf,Z.isCancel=Ld,Z.VERSION=df,Z.toFormData=pd,Z.AxiosError=X,Z.Cancel=Z.CanceledError,Z.all=function(e){return Promise.all(e)},Z.spread=Mf,Z.isAxiosError=Nf,Z.mergeConfig=Qd,Z.AxiosHeaders=id,Z.formToJSON=e=>Md(Y.isHTMLForm(e)?new FormData(e):e),Z.getAdapter=Sf.getAdapter,Z.HttpStatusCode=Pf,Z.default=Z;var Q=Z.create({baseURL:`http://localhost:3000/api`,withCredentials:!0,headers:{"Content-Type":`application/json`}});Q.interceptors.response.use(e=>e,async e=>{let t=e.config;if(e.response?.status===401&&!t._retry){t._retry=!0;try{return await Z.post(`${Q.defaults.baseURL}/auth/refresh`,{},{withCredentials:!0}),Q(t)}catch{return Promise.reject(e)}}return Promise.reject(e)});var If=Es(`auth`,()=>{let e=F(null),t=F(!1),n=G(()=>!!e.value),r=G(()=>e.value?.role===`admin`),i=G(()=>e.value?.role===`artist`),a=G(()=>new Set(e.value?.likedTracks||[]));async function o(){try{let{data:t}=await Q.get(`/auth/me`);t.success&&(e.value=t.data.user)}catch{e.value=null}}async function s(n,r){t.value=!0;try{let{data:t}=await Q.post(`/auth/login`,{identifier:n,password:r});return t.success&&(e.value=t.data.user),{success:!0}}catch(e){return{success:!1,message:e.response?.data?.message||`Login failed`}}finally{t.value=!1}}async function c(n){t.value=!0;try{let{data:t}=await Q.post(`/auth/register`,n);return t.success&&(e.value=t.data.user),{success:!0}}catch(e){return{success:!1,message:e.response?.data?.message||`Registration failed`}}finally{t.value=!1}}async function l(){try{await Q.post(`/auth/logout`)}finally{e.value=null}}async function u(n){t.value=!0;try{let{data:t}=await Q.put(`/auth/profile`,n,{headers:{"Content-Type":`multipart/form-data`}});return t.success&&(e.value=t.data),{success:!0}}catch(e){return{success:!1,message:e.response?.data?.message||`Update failed`}}finally{t.value=!1}}async function d(t){let n=a.value.has(t);try{n?(await Q.delete(`/tracks/${t}/like`),e.value&&(e.value.likedTracks=e.value.likedTracks.filter(e=>e!==t))):(await Q.post(`/tracks/${t}/like`),e.value&&e.value.likedTracks.push(t))}catch{}}return{user:e,loading:t,isLoggedIn:n,isAdmin:r,isArtist:i,likedTrackIds:a,checkSession:o,login:s,register:c,logout:l,updateProfile:u,toggleLike:d}}),Lf=n({useUiStore:()=>Rf}),Rf=Es(`ui`,()=>{let e=F([]),t=0;function n(n,r=`info`){let i=++t;e.value.push({id:i,message:n,type:r}),setTimeout(()=>{e.value=e.value.filter(e=>e.id!==i)},3e3)}function r(t){e.value=e.value.filter(e=>e.id!==t)}return{toasts:e,showToast:n,dismissToast:r}}),zf=t((e=>{(function(){var t=function(){this.init()};t.prototype={init:function(){var e=this||n;return e._counter=1e3,e._html5AudioPool=[],e.html5PoolSize=10,e._codecs={},e._howls=[],e._muted=!1,e._volume=1,e._canPlayEvent=`canplaythrough`,e._navigator=typeof window<`u`&&window.navigator?window.navigator:null,e.masterGain=null,e.noAudio=!1,e.usingWebAudio=!0,e.autoSuspend=!0,e.ctx=null,e.autoUnlock=!0,e._setup(),e},volume:function(e){var t=this||n;if(e=parseFloat(e),t.ctx||u(),e!==void 0&&e>=0&&e<=1){if(t._volume=e,t._muted)return t;t.usingWebAudio&&t.masterGain.gain.setValueAtTime(e,n.ctx.currentTime);for(var r=0;r=0;t--)e._howls[t].unload();return e.usingWebAudio&&e.ctx&&e.ctx.close!==void 0&&(e.ctx.close(),e.ctx=null,u()),e},codecs:function(e){return(this||n)._codecs[e.replace(/^x-/,``)]},_setup:function(){var e=this||n;if(e.state=e.ctx&&e.ctx.state||`suspended`,e._autoSuspend(),!e.usingWebAudio)if(typeof Audio<`u`)try{var t=new Audio;t.oncanplaythrough===void 0&&(e._canPlayEvent=`canplay`)}catch{e.noAudio=!0}else e.noAudio=!0;try{var t=new Audio;t.muted&&(e.noAudio=!0)}catch{}return e.noAudio||e._setupCodecs(),e},_setupCodecs:function(){var e=this||n,t=null;try{t=typeof Audio<`u`?new Audio:null}catch{return e}if(!t||typeof t.canPlayType!=`function`)return e;var r=t.canPlayType(`audio/mpeg;`).replace(/^no$/,``),i=e._navigator?e._navigator.userAgent:``,a=i.match(/OPR\/(\d+)/g),o=a&&parseInt(a[0].split(`/`)[1],10)<33,s=i.indexOf(`Safari`)!==-1&&i.indexOf(`Chrome`)===-1,c=i.match(/Version\/(.*?) /),l=s&&c&&parseInt(c[1],10)<15;return e._codecs={mp3:!!(!o&&(r||t.canPlayType(`audio/mp3;`).replace(/^no$/,``))),mpeg:!!r,opus:!!t.canPlayType(`audio/ogg; codecs="opus"`).replace(/^no$/,``),ogg:!!t.canPlayType(`audio/ogg; codecs="vorbis"`).replace(/^no$/,``),oga:!!t.canPlayType(`audio/ogg; codecs="vorbis"`).replace(/^no$/,``),wav:!!(t.canPlayType(`audio/wav; codecs="1"`)||t.canPlayType(`audio/wav`)).replace(/^no$/,``),aac:!!t.canPlayType(`audio/aac;`).replace(/^no$/,``),caf:!!t.canPlayType(`audio/x-caf;`).replace(/^no$/,``),m4a:!!(t.canPlayType(`audio/x-m4a;`)||t.canPlayType(`audio/m4a;`)||t.canPlayType(`audio/aac;`)).replace(/^no$/,``),m4b:!!(t.canPlayType(`audio/x-m4b;`)||t.canPlayType(`audio/m4b;`)||t.canPlayType(`audio/aac;`)).replace(/^no$/,``),mp4:!!(t.canPlayType(`audio/x-mp4;`)||t.canPlayType(`audio/mp4;`)||t.canPlayType(`audio/aac;`)).replace(/^no$/,``),weba:!!(!l&&t.canPlayType(`audio/webm; codecs="vorbis"`).replace(/^no$/,``)),webm:!!(!l&&t.canPlayType(`audio/webm; codecs="vorbis"`).replace(/^no$/,``)),dolby:!!t.canPlayType(`audio/mp4; codecs="ec-3"`).replace(/^no$/,``),flac:!!(t.canPlayType(`audio/x-flac;`)||t.canPlayType(`audio/flac;`)).replace(/^no$/,``)},e},_unlockAudio:function(){var e=this||n;if(!(e._audioUnlocked||!e.ctx)){e._audioUnlocked=!1,e.autoUnlock=!1,!e._mobileUnloaded&&e.ctx.sampleRate!==44100&&(e._mobileUnloaded=!0,e.unload()),e._scratchBuffer=e.ctx.createBuffer(1,1,22050);var t=function(n){for(;e._html5AudioPool.length0?s._seek:r._sprite[e][0]/1e3),u=Math.max(0,(r._sprite[e][0]+r._sprite[e][1])/1e3-l),d=u*1e3/Math.abs(s._rate),f=r._sprite[e][0]/1e3,p=(r._sprite[e][0]+r._sprite[e][1])/1e3;s._sprite=e,s._ended=!1;var m=function(){s._paused=!1,s._seek=l,s._start=f,s._stop=p,s._loop=!!(s._loop||r._sprite[e][2])};if(l>=p){r._ended(s);return}var h=s._node;if(r._webAudio){var g=function(){r._playLock=!1,m(),r._refreshBuffer(s);var e=s._muted||r._muted?0:s._volume;h.gain.setValueAtTime(e,n.ctx.currentTime),s._playStart=n.ctx.currentTime,h.bufferSource.start===void 0?s._loop?h.bufferSource.noteGrainOn(0,l,86400):h.bufferSource.noteGrainOn(0,l,u):s._loop?h.bufferSource.start(0,l,86400):h.bufferSource.start(0,l,u),d!==1/0&&(r._endTimers[s._id]=setTimeout(r._ended.bind(r,s),d)),t||setTimeout(function(){r._emit(`play`,s._id),r._loadQueue()},0)};n.state===`running`&&n.ctx.state!==`interrupted`?g():(r._playLock=!0,r.once(`resume`,g),r._clearTimer(s._id))}else{var _=function(){h.currentTime=l,h.muted=s._muted||r._muted||n._muted||h.muted,h.volume=s._volume*n.volume(),h.playbackRate=s._rate;try{var i=h.play();if(i&&typeof Promise<`u`&&(i instanceof Promise||typeof i.then==`function`)?(r._playLock=!0,m(),i.then(function(){r._playLock=!1,h._unlocked=!0,t?r._loadQueue():r._emit(`play`,s._id)}).catch(function(){r._playLock=!1,r._emit(`playerror`,s._id,`Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.`),s._ended=!0,s._paused=!0})):t||(r._playLock=!1,m(),r._emit(`play`,s._id)),h.playbackRate=s._rate,h.paused){r._emit(`playerror`,s._id,`Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.`);return}e!==`__default`||s._loop?r._endTimers[s._id]=setTimeout(r._ended.bind(r,s),d):(r._endTimers[s._id]=function(){r._ended(s),h.removeEventListener(`ended`,r._endTimers[s._id],!1)},h.addEventListener(`ended`,r._endTimers[s._id],!1))}catch(e){r._emit(`playerror`,s._id,e)}};h.src===`data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA`&&(h.src=r._src,h.load());var v=window&&window.ejecta||!h.readyState&&n._navigator.isCocoonJS;if(h.readyState>=3||v)_();else{r._playLock=!0,r._state=`loading`;var y=function(){r._state=`loaded`,_(),h.removeEventListener(n._canPlayEvent,y,!1)};h.addEventListener(n._canPlayEvent,y,!1),r._clearTimer(s._id)}}return s._id},pause:function(e){var t=this;if(t._state!==`loaded`||t._playLock)return t._queue.push({event:`pause`,action:function(){t.pause(e)}}),t;for(var n=t._getSoundIds(e),r=0;r=0?i=parseInt(t[0],10):r=parseFloat(t[0]):t.length>=2&&(r=parseFloat(t[0]),i=parseInt(t[1],10));var a;if(r!==void 0&&r>=0&&r<=1){if(e._state!==`loaded`||e._playLock)return e._queue.push({event:`volume`,action:function(){e.volume.apply(e,t)}}),e;i===void 0&&(e._volume=r),i=e._getSoundIds(i);for(var o=0;o0?r/l:r),d=Date.now();e._fadeTo=n,e._interval=setInterval(function(){var i=(Date.now()-d)/r;d=Date.now(),s+=c*i,s=Math.round(s*100)/100,s=c<0?Math.max(n,s):Math.min(n,s),o._webAudio?e._volume=s:o.volume(s,e._id,!0),a&&(o._volume=s),(nt&&s>=n)&&(clearInterval(e._interval),e._interval=null,e._fadeTo=null,o.volume(n,e._id),o._emit(`fade`,e._id))},u)},_stopFade:function(e){var t=this,r=t._soundById(e);return r&&r._interval&&(t._webAudio&&r._node.gain.cancelScheduledValues(n.ctx.currentTime),clearInterval(r._interval),r._interval=null,t.volume(r._fadeTo,e),r._fadeTo=null,t._emit(`fade`,e)),t},loop:function(){var e=this,t=arguments,n,r,i;if(t.length===0)return e._loop;if(t.length===1)if(typeof t[0]==`boolean`)n=t[0],e._loop=n;else return i=e._soundById(parseInt(t[0],10)),i?i._loop:!1;else t.length===2&&(n=t[0],r=parseInt(t[1],10));for(var a=e._getSoundIds(r),o=0;o=0?i=parseInt(t[0],10):r=parseFloat(t[0]):t.length===2&&(r=parseFloat(t[0]),i=parseInt(t[1],10));var a;if(typeof r==`number`){if(e._state!==`loaded`||e._playLock)return e._queue.push({event:`rate`,action:function(){e.rate.apply(e,t)}}),e;i===void 0&&(e._rate=r),i=e._getSoundIds(i);for(var o=0;o=0?i=parseInt(t[0],10):e._sounds.length&&(i=e._sounds[0]._id,r=parseFloat(t[0])):t.length===2&&(r=parseFloat(t[0]),i=parseInt(t[1],10)),i===void 0)return 0;if(typeof r==`number`&&(e._state!==`loaded`||e._playLock))return e._queue.push({event:`seek`,action:function(){e.seek.apply(e,t)}}),e;var a=e._soundById(i);if(a)if(typeof r==`number`&&r>=0){var o=e.playing(i);o&&e.pause(i,!0),a._seek=r,a._ended=!1,e._clearTimer(i),!e._webAudio&&a._node&&!isNaN(a._node.duration)&&(a._node.currentTime=r);var s=function(){o&&e.play(i,!0),e._emit(`seek`,i)};if(o&&!e._webAudio){var c=function(){e._playLock?setTimeout(c,0):s()};setTimeout(c,0)}else s()}else if(e._webAudio){var l=e.playing(i)?n.ctx.currentTime-a._playStart:0,u=a._rateSeek?a._rateSeek-a._seek:0;return a._seek+(u+l*Math.abs(a._rate))}else return a._node.currentTime;return e},playing:function(e){var t=this;if(typeof e==`number`){var n=t._soundById(e);return n?!n._paused:!1}for(var r=0;r=0&&n._howls.splice(i,1);var o=!0;for(r=0;r=0){o=!1;break}return a&&o&&delete a[e._src],n.noAudio=!1,e._state=`unloaded`,e._sounds=[],e=null,null},on:function(e,t,n,r){var i=this,a=i[`_on`+e];return typeof t==`function`&&a.push(r?{id:n,fn:t,once:r}:{id:n,fn:t}),i},off:function(e,t,n){var r=this,i=r[`_on`+e],a=0;if(typeof t==`number`&&(n=t,t=null),t||n)for(a=0;a=0;a--)(!i[a].id||i[a].id===t||e===`load`)&&(setTimeout(function(e){e.call(this,t,n)}.bind(r,i[a].fn),0),i[a].once&&r.off(e,i[a].fn,i[a].id));return r._loadQueue(e),r},_loadQueue:function(e){var t=this;if(t._queue.length>0){var n=t._queue[0];n.event===e&&(t._queue.shift(),t._loadQueue()),e||n.action()}return t},_ended:function(e){var t=this,r=e._sprite;if(!t._webAudio&&e._node&&!e._node.paused&&!e._node.ended&&e._node.currentTime=0;r--){if(n<=t)return;e._sounds[r]._ended&&(e._webAudio&&e._sounds[r]._node&&e._sounds[r]._node.disconnect(0),e._sounds.splice(r,1),n--)}}},_getSoundIds:function(e){var t=this;if(e===void 0){for(var n=[],r=0;r=0;if(!e.bufferSource)return t;if(n._scratchBuffer&&e.bufferSource&&(e.bufferSource.onended=null,e.bufferSource.disconnect(0),r))try{e.bufferSource.buffer=n._scratchBuffer}catch{}return e.bufferSource=null,t},_clearSound:function(e){/MSIE |Trident\//.test(n._navigator&&n._navigator.userAgent)||(e.src=`data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA`)}};var i=function(e){this._parent=e,this.init()};i.prototype={init:function(){var e=this,t=e._parent;return e._muted=t._muted,e._loop=t._loop,e._volume=t._volume,e._rate=t._rate,e._seek=0,e._paused=!0,e._ended=!0,e._sprite=`__default`,e._id=++n._counter,t._sounds.push(e),e.create(),e},create:function(){var e=this,t=e._parent,r=n._muted||e._muted||e._parent._muted?0:e._volume;return t._webAudio?(e._node=n.ctx.createGain===void 0?n.ctx.createGainNode():n.ctx.createGain(),e._node.gain.setValueAtTime(r,n.ctx.currentTime),e._node.paused=!0,e._node.connect(n.masterGain)):n.noAudio||(e._node=n._obtainHtml5Audio(),e._errorFn=e._errorListener.bind(e),e._node.addEventListener(`error`,e._errorFn,!1),e._loadFn=e._loadListener.bind(e),e._node.addEventListener(n._canPlayEvent,e._loadFn,!1),e._endFn=e._endListener.bind(e),e._node.addEventListener(`ended`,e._endFn,!1),e._node.src=t._src,e._node.preload=t._preload===!0?`auto`:t._preload,e._node.volume=r*n.volume(),e._node.load()),e},reset:function(){var e=this,t=e._parent;return e._muted=t._muted,e._loop=t._loop,e._volume=t._volume,e._rate=t._rate,e._seek=0,e._rateSeek=0,e._paused=!0,e._ended=!0,e._sprite=`__default`,e._id=++n._counter,e},_errorListener:function(){var e=this;e._parent._emit(`loaderror`,e._id,e._node.error?e._node.error.code:0),e._node.removeEventListener(`error`,e._errorFn,!1)},_loadListener:function(){var e=this,t=e._parent;t._duration=Math.ceil(e._node.duration*10)/10,Object.keys(t._sprite).length===0&&(t._sprite={__default:[0,t._duration*1e3]}),t._state!==`loaded`&&(t._state=`loaded`,t._emit(`load`),t._loadQueue()),e._node.removeEventListener(n._canPlayEvent,e._loadFn,!1)},_endListener:function(){var e=this,t=e._parent;t._duration===1/0&&(t._duration=Math.ceil(e._node.duration*10)/10,t._sprite.__default[1]===1/0&&(t._sprite.__default[1]=t._duration*1e3),t._ended(e)),e._node.removeEventListener(`ended`,e._endFn,!1)}};var a={},o=function(e){var t=e._src;if(a[t]){e._duration=a[t].duration,l(e);return}if(/^data:[^;]+;base64,/.test(t)){for(var n=atob(t.split(`,`)[1]),r=new Uint8Array(n.length),i=0;i0?(a[t._src]=e,l(t,e)):r()};typeof Promise<`u`&&n.ctx.decodeAudioData.length===1?n.ctx.decodeAudioData(e).then(i).catch(r):n.ctx.decodeAudioData(e,i,r)},l=function(e,t){t&&!e._duration&&(e._duration=t.duration),Object.keys(e._sprite).length===0&&(e._sprite={__default:[0,e._duration*1e3]}),e._state!==`loaded`&&(e._state=`loaded`,e._emit(`load`),e._loadQueue())},u=function(){if(n.usingWebAudio){try{typeof AudioContext<`u`?n.ctx=new AudioContext:typeof webkitAudioContext<`u`?n.ctx=new webkitAudioContext:n.usingWebAudio=!1}catch{n.usingWebAudio=!1}n.ctx||(n.usingWebAudio=!1);var e=/iP(hone|od|ad)/.test(n._navigator&&n._navigator.platform),t=n._navigator&&n._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),r=t?parseInt(t[1],10):null;if(e&&r&&r<9){var i=/safari/.test(n._navigator&&n._navigator.userAgent.toLowerCase());n._navigator&&!i&&(n.usingWebAudio=!1)}n.usingWebAudio&&(n.masterGain=n.ctx.createGain===void 0?n.ctx.createGainNode():n.ctx.createGain(),n.masterGain.gain.setValueAtTime(n._muted?0:n._volume,n.ctx.currentTime),n.masterGain.connect(n.ctx.destination)),n._setup()}};typeof define==`function`&&define.amd&&define([],function(){return{Howler:n,Howl:r}}),e!==void 0&&(e.Howler=n,e.Howl=r),typeof global<`u`?(global.HowlerGlobal=t,global.Howler=n,global.Howl=r,global.Sound=i):typeof window<`u`&&(window.HowlerGlobal=t,window.Howler=n,window.Howl=r,window.Sound=i)})(),(function(){HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(e){var t=this;if(!t.ctx||!t.ctx.listener)return t;for(var n=t._howls.length-1;n>=0;n--)t._howls[n].stereo(e);return t},HowlerGlobal.prototype.pos=function(e,t,n){var r=this;if(!r.ctx||!r.ctx.listener)return r;if(t=typeof t==`number`?t:r._pos[1],n=typeof n==`number`?n:r._pos[2],typeof e==`number`)r._pos=[e,t,n],r.ctx.listener.positionX===void 0?r.ctx.listener.setPosition(r._pos[0],r._pos[1],r._pos[2]):(r.ctx.listener.positionX.setTargetAtTime(r._pos[0],Howler.ctx.currentTime,.1),r.ctx.listener.positionY.setTargetAtTime(r._pos[1],Howler.ctx.currentTime,.1),r.ctx.listener.positionZ.setTargetAtTime(r._pos[2],Howler.ctx.currentTime,.1));else return r._pos;return r},HowlerGlobal.prototype.orientation=function(e,t,n,r,i,a){var o=this;if(!o.ctx||!o.ctx.listener)return o;var s=o._orientation;if(t=typeof t==`number`?t:s[1],n=typeof n==`number`?n:s[2],r=typeof r==`number`?r:s[3],i=typeof i==`number`?i:s[4],a=typeof a==`number`?a:s[5],typeof e==`number`)o._orientation=[e,t,n,r,i,a],o.ctx.listener.forwardX===void 0?o.ctx.listener.setOrientation(e,t,n,r,i,a):(o.ctx.listener.forwardX.setTargetAtTime(e,Howler.ctx.currentTime,.1),o.ctx.listener.forwardY.setTargetAtTime(t,Howler.ctx.currentTime,.1),o.ctx.listener.forwardZ.setTargetAtTime(n,Howler.ctx.currentTime,.1),o.ctx.listener.upX.setTargetAtTime(r,Howler.ctx.currentTime,.1),o.ctx.listener.upY.setTargetAtTime(i,Howler.ctx.currentTime,.1),o.ctx.listener.upZ.setTargetAtTime(a,Howler.ctx.currentTime,.1));else return s;return o},Howl.prototype.init=(function(e){return function(t){var n=this;return n._orientation=t.orientation||[1,0,0],n._stereo=t.stereo||null,n._pos=t.pos||null,n._pannerAttr={coneInnerAngle:t.coneInnerAngle===void 0?360:t.coneInnerAngle,coneOuterAngle:t.coneOuterAngle===void 0?360:t.coneOuterAngle,coneOuterGain:t.coneOuterGain===void 0?0:t.coneOuterGain,distanceModel:t.distanceModel===void 0?`inverse`:t.distanceModel,maxDistance:t.maxDistance===void 0?1e4:t.maxDistance,panningModel:t.panningModel===void 0?`HRTF`:t.panningModel,refDistance:t.refDistance===void 0?1:t.refDistance,rolloffFactor:t.rolloffFactor===void 0?1:t.rolloffFactor},n._onstereo=t.onstereo?[{fn:t.onstereo}]:[],n._onpos=t.onpos?[{fn:t.onpos}]:[],n._onorientation=t.onorientation?[{fn:t.onorientation}]:[],e.call(this,t)}})(Howl.prototype.init),Howl.prototype.stereo=function(t,n){var r=this;if(!r._webAudio)return r;if(r._state!==`loaded`)return r._queue.push({event:`stereo`,action:function(){r.stereo(t,n)}}),r;var i=Howler.ctx.createStereoPanner===void 0?`spatial`:`stereo`;if(n===void 0)if(typeof t==`number`)r._stereo=t,r._pos=[t,0,0];else return r._stereo;for(var a=r._getSoundIds(n),o=0;oVf.play?.(),onpause:()=>Vf.pause?.(),onend:()=>Vf.end?.(),onloaderror:()=>Vf.error?.(),onplayerror:()=>Vf.error?.()})}function Wf(){Bf?.play()}function Gf(){Bf?.pause()}function Kf(){Bf?.playing()?Bf.pause():Bf.play()}function qf(e){Bf&&Bf.seek(e)}function Jf(){return Bf?Bf.seek():0}function Yf(e){return e!==void 0&&Howler.volume(e/100),Howler.volume()*100}function Xf(){return Bf?Bf.duration():0}function Zf(){return Bf?Bf.playing():!1}function Qf(e,t){Vf[e]=t}function $f(e){delete Vf[e]}function ep(){Bf&&=(Bf.unload(),null),Vf={}}var $={load:Uf,play:Wf,pause:Gf,togglePlay:Kf,seek:qf,getSeek:Jf,volume:Yf,duration:Xf,playing:Zf,on:Qf,off:$f,destroy:ep,formatTime:Hf},tp=`http://localhost:3000`;function np(e){return e?e.startsWith(`http`)?e:`${tp}${e}`:``}var rp=Es(`player`,()=>{let e=F(null),t=F(!1),n=F(0),r=F(0),i=F(80),a=F(null),o=F(null),s=G(()=>$.formatTime(n.value)),c=G(()=>$.formatTime(r.value));function l(i){if(!i)return;e.value=i,n.value=0,r.value=0,t.value=!1,g();let a=np(i.audioUrl);$.load(a),$.on(`play`,()=>{t.value=!0}),$.on(`pause`,()=>{t.value=!1}),$.on(`end`,()=>{t.value=!1,g(),o.value&&o.value()}),$.on(`error`,()=>{t.value=!1})}function u(e){o.value=e}function d(){e.value&&($.playing()?($.pause(),g()):($.play(),h()))}function f(){e.value&&($.play(),h())}function p(e){$.seek(e),n.value=e}function m(e){i.value=e,$.volume(e)}function h(){g(),a.value=setInterval(()=>{$.playing()&&(n.value=$.getSeek(),r.value=$.duration())},500)}function g(){a.value&&=(clearInterval(a.value),null)}function _(){g(),$.destroy(),e.value=null,t.value=!1,n.value=0,r.value=0,o.value=null}return{currentTrack:e,isPlaying:t,progress:n,duration:r,volume:i,formattedProgress:s,formattedDuration:c,setTrack:l,onEnd:u,togglePlay:d,play:f,seek:p,setVolume:m,$reset:_}}),ip=Es(`queue`,()=>{let e=F([]),t=F(-1),n=F(!1),r=F(`off`),i=G(()=>t.value<0||t.value>=e.value.length?null:e.value[t.value]);function a(n,r=0){e.value=n,t.value=r}function o(){if(e.value.length===0)return null;if(r.value===`one`)return e.value[t.value];let i;if(i=n.value?Math.floor(Math.random()*e.value.length):t.value+1,i>=e.value.length)if(r.value===`all`)i=0;else return null;return t.value=i,e.value[i]}function s(){if(e.value.length===0)return null;if(r.value===`one`)return e.value[t.value];let i;if(i=n.value?Math.floor(Math.random()*e.value.length):t.value-1,i<0)if(r.value===`all`)i=e.value.length-1;else return null;return t.value=i,e.value[i]}function c(){n.value=!n.value}function l(){let e=[`off`,`all`,`one`];r.value=e[(e.indexOf(r.value)+1)%e.length]}function u(){e.value=[],t.value=-1,n.value=!1,r.value=`off`}return{queue:e,currentIndex:t,shuffle:n,repeat:r,currentTrack:i,setQueue:a,nextTrack:o,prevTrack:s,toggleShuffle:c,cycleRepeat:l,$reset:u}}),ap={class:`min-h-screen bg-noctune-cream flex items-center justify-center p-8`},op={class:`w-full max-w-5xl bg-noctune-teal rounded-3xl border-4 border-black overflow-hidden flex shadow-2xl`},sp={class:`w-1/2 p-12 relative`},cp={class:`absolute top-8 right-12 grid grid-cols-4 gap-1`},lp={class:`absolute top-20 right-8 grid grid-cols-4 gap-1`},up={class:`absolute bottom-12 left-12 grid grid-cols-3 gap-1`},dp={class:`w-1/2 bg-white rounded-3xl m-4 p-10`},fp={key:0,class:`text-red-500 text-sm mb-4 font-medium`},pp={class:`mb-6`},mp={class:`flex border-2 border-black rounded-lg overflow-hidden`},hp={class:`mb-4`},gp={class:`flex border-2 border-black rounded-lg overflow-hidden`},_p=[`type`],vp={key:0,class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},yp={key:1,class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},bp=[`disabled`],xp={key:0,class:`inline-block w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin`},Sp={class:`text-center mt-8 text-gray-600`},Cp={__name:`LoginPage`,setup(e){let t=Ol(),n=If(),r=F(``),i=F(``),a=F(!1),o=F(!1),s=F(``);async function c(){s.value=``,o.value=!0;let e=await n.login(r.value,i.value);o.value=!1,e.success?t.push(`/home`):s.value=e.message}return(e,t)=>{let n=Tr(`router-link`);return z(),B(`div`,ap,[V(`div`,op,[V(`div`,sp,[V(`div`,cp,[(z(),B(R,null,L(16,e=>V(`span`,{key:e,class:`w-2 h-2 bg-black/40 rounded-full`})),64))]),V(`div`,lp,[(z(),B(R,null,L(12,e=>V(`span`,{key:e,class:`w-2 h-2 bg-black/40 rounded-full`})),64))]),t[3]||=V(`div`,{class:`absolute top-16 left-20 text-black/60 text-4xl font-bold`},`+`,-1),t[4]||=V(`div`,{class:`absolute bottom-24 right-20 text-black/60 text-4xl font-bold`},`+`,-1),V(`div`,up,[(z(),B(R,null,L(12,e=>V(`span`,{key:e,class:`w-2 h-2 bg-black/40 rounded-full`})),64))]),t[5]||=aa(`

noctune

`,1)]),V(`div`,dp,[t[16]||=V(`h2`,{class:`text-4xl font-black text-black mb-2`},`WELCOME!`,-1),t[17]||=V(`p`,{class:`text-gray-600 mb-8`},`Login to continue`,-1),s.value?(z(),B(`p`,fp,A(s.value),1)):W(``,!0),V(`div`,pp,[t[7]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-2 tracking-wider`},`EMAIL/USERNAME`,-1),V(`div`,mp,[t[6]||=V(`div`,{class:`bg-noctune-teal p-3 border-r-2 border-black`},[V(`svg`,{class:`w-6 h-6 text-black`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z`})])],-1),zn(V(`input`,{type:`text`,"onUpdate:modelValue":t[0]||=e=>r.value=e,onKeyup:Vo(c,[`enter`]),class:`flex-1 px-4 py-3 focus:outline-none text-black`,placeholder:`Enter your email`},null,544),[[Eo,r.value]])])]),V(`div`,hp,[t[11]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-2 tracking-wider`},`PASSWORD`,-1),V(`div`,gp,[t[10]||=V(`div`,{class:`bg-amber-200 p-3 border-r-2 border-black`},[V(`svg`,{class:`w-6 h-6 text-black`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z`})])],-1),zn(V(`input`,{type:a.value?`text`:`password`,"onUpdate:modelValue":t[1]||=e=>i.value=e,onKeyup:Vo(c,[`enter`]),class:`flex-1 px-4 py-3 focus:outline-none text-black`,placeholder:`Enter your password`},null,40,_p),[[Po,i.value]]),V(`button`,{onClick:t[2]||=e=>a.value=!a.value,class:`px-4 text-gray-500 hover:text-gray-700`},[a.value?(z(),B(`svg`,yp,[...t[9]||=[V(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M15 12a3 3 0 11-6 0 3 3 0 016 0z`},null,-1),V(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z`},null,-1)]])):(z(),B(`svg`,vp,[...t[8]||=[V(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21`},null,-1)]]))])])]),t[18]||=V(`div`,{class:`text-right mb-6`},[V(`a`,{href:`#`,class:`text-sm text-gray-600 hover:text-black`},`Forgot password?`)],-1),V(`button`,{onClick:c,disabled:o.value,class:`w-full bg-noctune-orange border-2 border-black rounded-lg py-4 font-bold text-white text-xl flex items-center justify-center gap-3 hover:bg-orange-600 transition-colors disabled:opacity-50`},[o.value?(z(),B(`span`,xp)):(z(),B(R,{key:1},[t[12]||=V(`div`,{class:`bg-white/20 rounded p-1`},[V(`svg`,{class:`w-5 h-5`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z`})])],-1),t[13]||=U(` LOGIN `,-1)],64))],8,bp),t[19]||=aa(`
OR SIGN IN WITH
`,2),V(`p`,Sp,[t[15]||=U(` Don't have an account yet? `,-1),H(n,{to:`/register`,class:`text-noctune-orange font-bold hover:underline`},{default:Rn(()=>[...t[14]||=[U(`Register now`,-1)]]),_:1})])])])])}}},wp={class:`min-h-screen bg-noctune-cream flex items-center justify-center p-8`},Tp={class:`w-full max-w-5xl bg-noctune-teal rounded-3xl border-4 border-black overflow-hidden flex shadow-2xl`},Ep={class:`w-1/2 p-12 relative`},Dp={class:`absolute top-8 right-12 grid grid-cols-4 gap-1`},Op={class:`w-1/2 bg-white rounded-3xl m-4 p-10`},kp={key:0,class:`text-red-500 text-sm mb-4 font-medium`},Ap={class:`mb-4`},jp={class:`mb-4`},Mp={class:`mb-4`},Np={class:`mb-6`},Pp=[`disabled`],Fp={key:0,class:`inline-block w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin`},Ip={key:1},Lp={class:`text-center mt-6 text-gray-600`},Rp={__name:`RegisterPage`,setup(e){let t=Ol(),n=If(),r=F(``),i=F(``),a=F(``),o=F(``),s=F(!1),c=F(``);async function l(){c.value=``,s.value=!0;let e=await n.register({name:r.value,username:i.value,email:a.value,password:o.value});s.value=!1,e.success?t.push(`/home`):c.value=e.message}return(e,t)=>{let n=Tr(`router-link`);return z(),B(`div`,wp,[V(`div`,Tp,[V(`div`,Ep,[V(`div`,Dp,[(z(),B(R,null,L(16,e=>V(`span`,{key:e,class:`w-2 h-2 bg-black/40 rounded-full`})),64))]),t[4]||=aa(`

noctune

`,1)]),V(`div`,Op,[t[11]||=V(`h2`,{class:`text-4xl font-black text-black mb-2`},`JOIN US!`,-1),t[12]||=V(`p`,{class:`text-gray-600 mb-6`},`Create your account`,-1),c.value?(z(),B(`p`,kp,A(c.value),1)):W(``,!0),V(`div`,Ap,[t[5]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-2 tracking-wider`},`NAME`,-1),zn(V(`input`,{type:`text`,"onUpdate:modelValue":t[0]||=e=>r.value=e,class:`w-full border-2 border-black rounded-lg px-4 py-3 focus:outline-none text-black`,placeholder:`Your name`},null,512),[[Eo,r.value]])]),V(`div`,jp,[t[6]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-2 tracking-wider`},`USERNAME`,-1),zn(V(`input`,{type:`text`,"onUpdate:modelValue":t[1]||=e=>i.value=e,class:`w-full border-2 border-black rounded-lg px-4 py-3 focus:outline-none text-black`,placeholder:`Choose a username`},null,512),[[Eo,i.value]])]),V(`div`,Mp,[t[7]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-2 tracking-wider`},`EMAIL`,-1),zn(V(`input`,{type:`email`,"onUpdate:modelValue":t[2]||=e=>a.value=e,class:`w-full border-2 border-black rounded-lg px-4 py-3 focus:outline-none text-black`,placeholder:`Enter your email`},null,512),[[Eo,a.value]])]),V(`div`,Np,[t[8]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-2 tracking-wider`},`PASSWORD`,-1),zn(V(`input`,{type:`password`,"onUpdate:modelValue":t[3]||=e=>o.value=e,class:`w-full border-2 border-black rounded-lg px-4 py-3 focus:outline-none text-black`,placeholder:`Create a password`},null,512),[[Eo,o.value]])]),V(`button`,{onClick:l,disabled:s.value,class:`w-full bg-noctune-orange border-2 border-black rounded-lg py-4 font-bold text-white text-xl flex items-center justify-center gap-3 hover:bg-orange-600 transition-colors disabled:opacity-50`},[s.value?(z(),B(`span`,Fp)):(z(),B(`span`,Ip,`REGISTER`))],8,Pp),V(`p`,Lp,[t[10]||=U(` Already have an account? `,-1),H(n,{to:`/login`,class:`text-noctune-orange font-bold hover:underline`},{default:Rn(()=>[...t[9]||=[U(`Login`,-1)]]),_:1})])])])])}}},zp={class:`bg-white rounded-2xl border-4 border-black p-6 w-full max-w-md mx-4 shadow-[8px_8px_0px_0px_#000]`},Bp={class:`flex items-center justify-between mb-6`},Vp={key:0,class:`text-red-500 text-sm mb-4 font-medium`},Hp={class:`space-y-4`},Up=[`disabled`],Wp={key:0,class:`inline-block w-4 h-4 border-2 border-black border-t-transparent rounded-full animate-spin mr-2`},Gp={__name:`CreatePlaylistModal`,props:{show:Boolean},emits:[`close`,`created`],setup(e,{emit:t}){let n=t,r=F(``),i=F(``),a=F(null),o=F(!1),s=F(``);function c(e){a.value=e.target.files[0]||null}async function l(){if(s.value=``,!r.value?.trim()){s.value=`Playlist name is required`;return}o.value=!0;try{let e=new FormData;e.append(`name`,r.value.trim()),i.value?.trim()&&e.append(`description`,i.value.trim()),a.value&&e.append(`playlistCover`,a.value);let{data:t}=await Q.post(`/playlists`,e,{headers:{"Content-Type":`multipart/form-data`}});t.success&&(n(`created`,t.data),r.value=``,i.value=``,a.value=null)}catch(e){s.value=e.response?.data?.message||`Failed to create playlist`}finally{o.value=!1}}return(t,n)=>e.show?(z(),B(`div`,{key:0,class:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onClick:n[3]||=zo(e=>t.$emit(`close`),[`self`])},[V(`div`,zp,[V(`div`,Bp,[n[4]||=V(`h2`,{class:`text-xl font-black text-black`},`CREATE PLAYLIST`,-1),V(`button`,{onClick:n[0]||=e=>t.$emit(`close`),class:`text-gray-500 hover:text-black text-2xl leading-none`},`×`)]),s.value?(z(),B(`p`,Vp,A(s.value),1)):W(``,!0),V(`div`,Hp,[V(`div`,null,[n[5]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-1 tracking-wider`},`NAME`,-1),zn(V(`input`,{"onUpdate:modelValue":n[1]||=e=>r.value=e,type:`text`,placeholder:`My awesome playlist`,class:`w-full border-2 border-black rounded-lg px-4 py-2 focus:outline-none text-black`},null,512),[[Eo,r.value]])]),V(`div`,null,[n[6]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-1 tracking-wider`},`DESCRIPTION`,-1),zn(V(`textarea`,{"onUpdate:modelValue":n[2]||=e=>i.value=e,placeholder:`Optional description`,rows:`2`,class:`w-full border-2 border-black rounded-lg px-4 py-2 focus:outline-none resize-none text-black`},null,512),[[Eo,i.value]])]),V(`div`,null,[n[7]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-1 tracking-wider`},`COVER IMAGE`,-1),V(`input`,{type:`file`,accept:`image/*`,onChange:c,class:`w-full text-sm text-gray-600 file:mr-3 file:py-2 file:px-4 file:border-2 file:border-black file:rounded-lg file:font-bold file:text-sm file:bg-noctune-yellow file:cursor-pointer`},null,32)]),V(`button`,{onClick:l,disabled:o.value,class:`w-full bg-noctune-teal border-2 border-black rounded-lg py-3 font-bold text-black hover:bg-teal-600 transition-colors disabled:opacity-50 cursor-pointer`},[o.value?(z(),B(`span`,Wp)):W(``,!0),U(` `+A(o.value?`Creating...`:`CREATE PLAYLIST`),1)],8,Up)])])])):W(``,!0)}},Kp={class:`bg-white rounded-2xl border-4 border-black p-6 w-full max-w-md mx-4 shadow-[8px_8px_0px_0px_#000]`},qp={class:`flex items-center justify-between mb-4`},Jp={key:0,class:`text-red-500 text-sm mb-3 font-medium`},Yp={key:1,class:`space-y-3`},Xp={key:2,class:`text-center py-8`},Zp={key:3,class:`max-h-80 overflow-y-auto space-y-2`},Qp=[`onClick`],$p={class:`w-12 h-12 rounded-lg overflow-hidden bg-gray-300 border border-black flex-shrink-0`},em=[`src`],tm={key:1,class:`w-full h-full flex items-center justify-center bg-gradient-to-br from-noctune-teal/20 to-noctune-yellow/20`},nm={class:`flex-1 min-w-0`},rm={class:`font-bold text-sm text-black truncate`},im={class:`text-xs text-gray-500`},am={key:0,class:`w-5 h-5 animate-spin text-noctune-teal`,fill:`none`,viewBox:`0 0 24 24`},om={key:1,class:`w-5 h-5 text-gray-400`,fill:`currentColor`,viewBox:`0 0 24 24`},sm={__name:`AddToPlaylistModal`,props:{show:Boolean,trackId:{type:String,default:null}},emits:[`close`],setup(e,{emit:t}){let n=e,r=t,i=If(),a=Rf(),o=F([]),s=F(!1),c=F(null),l=F(``),u=F(!1);function d(){u.value=!0}function f(e){u.value=!1,o.value.unshift(e)}async function p(e){if(n.trackId){c.value=e._id,l.value=``;try{let{data:t}=await Q.post(`/playlists/${e._id}/tracks`,{trackId:n.trackId});t.success&&(a.showToast(`Saved to "${e.name}"`,`success`),r(`close`))}catch(t){let n=t.response?.data?.message||``;n.includes(`already`)||n.includes(`duplicate`)?(a.showToast(`Already in "${e.name}"`,`info`),r(`close`)):l.value=n||`Failed to save track`}finally{c.value=null}}}async function m(){if(i.isLoggedIn){s.value=!0;try{let{data:e}=await Q.get(`/playlists`);e.success&&(o.value=e.data)}catch{}finally{s.value=!1}}}return Kn(()=>n.show,e=>{e&&m()}),(t,n)=>e.show?(z(),B(`div`,{key:0,class:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onClick:n[2]||=zo(e=>t.$emit(`close`),[`self`])},[V(`div`,Kp,[V(`div`,qp,[n[3]||=V(`h2`,{class:`text-xl font-black text-black`},`SAVE TO PLAYLIST`,-1),V(`button`,{onClick:n[0]||=e=>t.$emit(`close`),class:`text-gray-500 hover:text-black text-2xl leading-none`},`×`)]),l.value?(z(),B(`p`,Jp,A(l.value),1)):W(``,!0),s.value?(z(),B(`div`,Yp,[(z(),B(R,null,L(3,e=>V(`div`,{key:e,class:`h-14 bg-gray-200 animate-pulse rounded-lg border-2 border-black`})),64))])):o.value.length===0?(z(),B(`div`,Xp,[n[4]||=V(`svg`,{class:`w-16 h-16 mx-auto text-gray-300 mb-3`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M3 10h11v2H3v-2zm0-4h11v2H3V6zm0 8h7v2H3v-2zm13-1v8l6-4-6-4z`})],-1),n[5]||=V(`p`,{class:`text-gray-500 mb-2`},`No playlists yet`,-1),V(`button`,{onClick:d,class:`bg-noctune-yellow border-2 border-black px-4 py-2 font-bold rounded-lg text-sm hover:bg-yellow-400 transition-colors cursor-pointer`},` CREATE PLAYLIST `)])):(z(),B(`div`,Zp,[(z(!0),B(R,null,L(o.value,e=>(z(),B(`div`,{key:e._id,onClick:t=>p(e),class:k([`flex items-center gap-3 px-4 py-3 rounded-lg border-2 border-black cursor-pointer hover:bg-noctune-teal/10 transition-colors`,c.value===e._id?`opacity-50 pointer-events-none`:``])},[V(`div`,$p,[e.coverUrl?(z(),B(`img`,{key:0,src:I(np)(e.coverUrl),class:`w-full h-full object-cover`},null,8,em)):(z(),B(`div`,tm,[...n[6]||=[V(`svg`,{class:`w-6 h-5 text-gray-400`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M3 10h11v2H3v-2zm0-4h11v2H3V6zm0 8h7v2H3v-2zm13-1v8l6-4-6-4z`})],-1)]]))]),V(`div`,nm,[V(`p`,rm,A(e.name),1),V(`p`,im,A(e.tracks?.length||0)+` songs`,1)]),c.value===e._id?(z(),B(`svg`,am,[...n[7]||=[V(`circle`,{class:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,"stroke-width":`4`},null,-1),V(`path`,{class:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`},null,-1)]])):(z(),B(`svg`,om,[...n[8]||=[V(`path`,{d:`M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z`},null,-1)]]))],10,Qp))),128))]))]),H(Gp,{show:u.value,onClose:n[1]||=e=>u.value=!1,onCreated:f},null,8,[`show`])])):W(``,!0)}},cm={class:`p-8`},lm={key:0,class:`grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4`},um={key:1,class:`text-center py-20 bg-white rounded-2xl border-2 border-black`},dm={key:2,class:`grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4`},fm=[`onClick`],pm={class:`aspect-square bg-gray-300 relative overflow-hidden`},mm=[`src`],hm={class:`absolute inset-0 bg-black/0 group-hover:bg-black/20 transition-colors flex items-center justify-center`},gm={key:0,class:`w-6 h-6 text-black`,fill:`currentColor`,viewBox:`0 0 24 24`},_m={key:1,class:`w-6 h-6 ml-1 text-black`,fill:`currentColor`,viewBox:`0 0 24 24`},vm={class:`p-3`},ym={class:`flex items-center justify-between`},bm={class:`flex-1 min-w-0`},xm={class:`text-sm font-bold text-black truncate`},Sm={class:`text-xs text-gray-500 truncate`},Cm=[`onClick`],wm=[`onClick`],Tm={__name:`LandingPage`,setup(e){let t=rp(),n=ip(),r=If(),{requireAuth:i}=Hg(),a=F([]),o=F(!0),s=F(null),c=F(!1);function l(e){s.value=e,i({redirectTo:`/login`,onAuthenticated:()=>{c.value=!0}})}function u(e){return t.currentTrack?._id===e._id}function d(e){return r.likedTrackIds?.has(e._id)}function f(e){if(u(e)){t.togglePlay();return}let r=a.value.findIndex(t=>t._id===e._id);n.setQueue(a.value,r),t.setTrack(e),t.play()}function p(){a.value.length&&f(a.value[0])}function m(e){i({redirectTo:`/login`,onAuthenticated:()=>r.toggleLike(e._id)})}return hr(async()=>{try{let{data:e}=await Q.get(`/tracks`);e.success&&(a.value=e.data)}catch{}finally{o.value=!1}}),(e,n)=>{let r=Tr(`router-link`);return z(),B(`div`,cm,[V(`div`,{class:`flex items-start gap-8 mb-12`},[V(`div`,{class:`flex-1`},[n[2]||=V(`h1`,{class:`text-5xl font-black text-black leading-tight mb-2`},[U(`MUSIC`),V(`br`),U(`THAT HITS`)],-1),n[3]||=V(`div`,{class:`inline-block bg-noctune-orange px-4 py-2 mb-4 border-b-4 border-black`},[V(`span`,{class:`text-4xl font-black text-black`},`DIFFERENT.`)],-1),n[4]||=V(`p`,{class:`text-gray-600 mb-6`},`You Vibe. Your sound. Only on Noctune.`,-1),V(`div`,{class:`flex gap-4`},[V(`button`,{onClick:p,class:`bg-noctune-yellow border-2 border-black px-6 py-3 font-bold hover:bg-yellow-400 transition-colors rounded-lg`},`PLAY NOW`),n[1]||=V(`button`,{class:`bg-gray-200 border-2 border-black px-6 py-3 font-bold hover:bg-gray-300 transition-colors rounded-lg`},`EXPLORE`,-1)])]),n[5]||=V(`div`,{class:`w-80 h-80 rounded-2xl overflow-hidden border-4 border-black flex-shrink-0`},[V(`img`,{src:`https://images.unsplash.com/photo-1470225620780-dba8ba36b745?w=400&h=400&fit=crop`,alt:`Music illustration`,class:`w-full h-full object-cover`})],-1)]),V(`section`,null,[n[15]||=V(`h2`,{class:`text-2xl font-black text-black mb-6 flex items-center`},[U(` TRENDING NOW `),V(`svg`,{class:`w-5 h-5 ml-2`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z`})])],-1),o.value?(z(),B(`div`,lm,[(z(),B(R,null,L(4,e=>V(`div`,{key:e,class:`animate-pulse rounded-2xl border-2 border-black overflow-hidden`},[...n[6]||=[V(`div`,{class:`aspect-square bg-gray-300`},null,-1),V(`div`,{class:`p-3 space-y-2`},[V(`div`,{class:`h-3 bg-gray-300 rounded w-3/4`}),V(`div`,{class:`h-2 bg-gray-300 rounded w-1/2`})],-1)]])),64))])):a.value.length===0?(z(),B(`div`,um,[n[8]||=V(`svg`,{class:`w-24 h-24 mx-auto text-gray-300 mb-4`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M12 3v10.55c-.59-.34-1.27-.55-2-.55C7.79 13 6 14.79 6 17s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z`})],-1),n[9]||=V(`p`,{class:`text-gray-500 mb-2 text-lg`},`No tracks yet`,-1),n[10]||=V(`p`,{class:`text-gray-400 text-sm mb-4`},`Be the first to upload music!`,-1),H(r,{to:`/admin/tracks`,class:`inline-block bg-noctune-orange border-2 border-black px-6 py-3 font-bold rounded-lg hover:bg-orange-500 transition-colors`},{default:Rn(()=>[...n[7]||=[U(`UPLOAD TRACK`,-1)]]),_:1})])):(z(),B(`div`,dm,[(z(!0),B(R,null,L(a.value,e=>(z(),B(`div`,{key:e._id,onClick:t=>f(e),class:k([`bg-white rounded-2xl overflow-hidden hover:scale-[1.02] transition-transform cursor-pointer group`,u(e)?`border-4 border-noctune-teal`:`border-2 border-black`])},[V(`div`,pm,[e.coverUrl?(z(),B(`img`,{key:0,src:I(np)(e.coverUrl),class:`w-full h-full object-cover`},null,8,mm)):W(``,!0),V(`div`,hm,[V(`div`,{class:k([`w-12 h-12 rounded-full flex items-center justify-center border-2 border-black opacity-0 group-hover:opacity-100 transition-opacity`,u(e)&&I(t).isPlaying?`bg-white`:`bg-noctune-yellow`])},[u(e)&&I(t).isPlaying?(z(),B(`svg`,gm,[...n[11]||=[V(`path`,{d:`M6 19h4V5H6v14zm8-14v14h4V5h-4z`},null,-1)]])):(z(),B(`svg`,_m,[...n[12]||=[V(`path`,{d:`M8 5v14l11-7z`},null,-1)]]))],2)])]),V(`div`,vm,[V(`div`,ym,[V(`div`,bm,[V(`p`,xm,A(e.title),1),V(`p`,Sm,A(e.artist),1)]),V(`button`,{onClick:zo(t=>m(e),[`stop`]),class:`ml-2 flex-shrink-0`},[(z(),B(`svg`,{class:k([`w-5 h-5`,d(e)?`fill-red-400 text-red-400`:`text-gray-400 hover:text-red-400`]),fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[...n[13]||=[V(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z`},null,-1)]],2))],8,Cm),V(`button`,{onClick:zo(t=>l(e),[`stop`]),class:`ml-1 flex-shrink-0 text-gray-400 hover:text-noctune-teal transition-colors`},[...n[14]||=[V(`svg`,{class:`w-5 h-5`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z`})],-1)]],8,wm)])])],10,fm))),128))]))]),H(sm,{show:c.value,"track-id":s.value?._id,onClose:n[0]||=e=>c.value=!1},null,8,[`show`,`track-id`])])}}},Em={class:`p-8`},Dm={class:`mb-12`},Om={key:0,class:`text-center py-12 text-gray-500`},km={key:1,class:`text-center py-12`},Am={key:2,class:`text-center py-12`},jm={key:3,class:`grid grid-cols-4 gap-6`},Mm=[`onClick`],Nm={class:`aspect-square bg-gray-300 relative overflow-hidden`},Pm=[`src`],Fm={key:0,class:`w-5 h-5 text-black`,fill:`currentColor`,viewBox:`0 0 24 24`},Im={key:1,class:`w-5 h-5 ml-0.5 text-black`,fill:`currentColor`,viewBox:`0 0 24 24`},Lm={class:`p-3`},Rm={class:`flex items-center justify-between`},zm={class:`flex-1 min-w-0`},Bm={class:`text-sm font-bold text-black truncate`},Vm={class:`text-xs text-gray-500 truncate`},Hm=[`onClick`],Um={key:0,class:`space-y-3 p-4`},Wm={key:1,class:`bg-white rounded-2xl border-4 border-black overflow-hidden`},Gm={class:`divide-y divide-gray-200`},Km=[`onClick`],qm={class:`flex-1 flex items-center gap-3`},Jm={class:`text-sm text-gray-400 w-6`},Ym={key:0,class:`w-4 h-4 text-noctune-teal inline`,fill:`currentColor`,viewBox:`0 0 24 24`},Xm={key:1},Zm={class:`w-10 h-10 rounded-lg flex-shrink-0 overflow-hidden bg-gray-300 border border-black`},Qm=[`src`],$m={class:`w-40 text-center text-gray-600 text-sm truncate`},eh={class:`w-32 text-center text-gray-600 text-sm truncate`},th=[`onClick`],nh=[`onClick`],rh={__name:`LibraryPage`,setup(e){let t=rp(),n=ip(),r=If(),{requireAuth:i}=Hg(),a=F([]),o=F([]),s=F(!0),c=F(!0),l=F(null),u=F(!1);function d(e){l.value=e,i({redirectTo:`/login`,onAuthenticated:()=>{u.value=!0}})}function f(e){return t.currentTrack?._id===e._id}function p(e){return r.likedTrackIds?.has(e._id)}function m(e,r=!1,i){if(f(e)){t.togglePlay();return}let s=r?a.value:o.value,c=i??s.findIndex(t=>t._id===e._id);n.setQueue(s,c),t.setTrack(e),t.play()}function h(e){let t=p(e);i({redirectTo:`/login`,onAuthenticated:async()=>{await r.toggleLike(e._id),t&&(a.value=a.value.filter(t=>t._id!==e._id))}})}return hr(async()=>{if(r.isLoggedIn)try{let{data:e}=await Q.get(`/tracks/liked`);e.success&&(a.value=e.data||[])}catch{}s.value=!1;try{let{data:e}=await Q.get(`/tracks`);e.success&&(o.value=e.data)}catch{}finally{c.value=!1}}),(e,n)=>{let i=Tr(`router-link`);return z(),B(`div`,Em,[V(`section`,Dm,[n[8]||=V(`h2`,{class:`text-3xl font-black text-black mb-6`},`Liked Tracks`,-1),s.value?(z(),B(`div`,Om,`Loading...`)):I(r).isLoggedIn?a.value.length===0?(z(),B(`div`,Am,[n[4]||=V(`p`,{class:`text-gray-500 mb-4`},`No liked tracks yet`,-1),H(i,{to:`/home`,class:`bg-noctune-yellow border-2 border-black px-6 py-3 font-bold inline-block hover:bg-yellow-400 transition-colors rounded-lg`},{default:Rn(()=>[...n[3]||=[U(`Discover Music`,-1)]]),_:1})])):(z(),B(`div`,jm,[(z(!0),B(R,null,L(a.value,e=>(z(),B(`div`,{key:e._id,onClick:t=>m(e,!0),class:`group cursor-pointer bg-white rounded-2xl border-2 border-black overflow-hidden hover:scale-[1.02] transition-transform`},[V(`div`,Nm,[e.coverUrl?(z(),B(`img`,{key:0,src:I(np)(e.coverUrl),class:`w-full h-full object-cover`},null,8,Pm)):W(``,!0),V(`div`,{class:k([`absolute bottom-2 right-2 w-10 h-10 rounded-full flex items-center justify-center border-2 border-black opacity-0 group-hover:opacity-100 transition-opacity`,f(e)&&I(t).isPlaying?`bg-white`:`bg-noctune-yellow`])},[f(e)&&I(t).isPlaying?(z(),B(`svg`,Fm,[...n[5]||=[V(`path`,{d:`M6 19h4V5H6v14zm8-14v14h4V5h-4z`},null,-1)]])):(z(),B(`svg`,Im,[...n[6]||=[V(`path`,{d:`M8 5v14l11-7z`},null,-1)]]))],2)]),V(`div`,Lm,[V(`div`,Rm,[V(`div`,zm,[V(`p`,Bm,A(e.title),1),V(`p`,Vm,A(e.artist),1)]),V(`button`,{onClick:zo(t=>d(e),[`stop`]),class:`ml-2 flex-shrink-0 text-gray-400 hover:text-noctune-teal transition-colors`},[...n[7]||=[V(`svg`,{class:`w-4 h-4`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z`})],-1)]],8,Hm)])])],8,Mm))),128))])):(z(),B(`div`,km,[n[2]||=V(`p`,{class:`text-gray-500 mb-4`},`Login to see your liked tracks`,-1),H(i,{to:`/login`,class:`bg-noctune-yellow border-2 border-black px-6 py-3 font-bold inline-block hover:bg-yellow-400 transition-colors rounded-lg`},{default:Rn(()=>[...n[1]||=[U(`Login`,-1)]]),_:1})]))]),V(`section`,null,[n[14]||=V(`h2`,{class:`text-2xl font-black text-black mb-6 flex items-center`},[U(` All Tracks `),V(`svg`,{class:`w-5 h-5 ml-2`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z`})])],-1),c.value?(z(),B(`div`,Um,[(z(),B(R,null,L(5,e=>V(`div`,{key:e,class:`flex items-center gap-4 animate-pulse`},[...n[9]||=[aa(`
`,5)]])),64))])):(z(),B(`div`,Wm,[n[13]||=aa(`
TITLEARTISTALBUM
`,1),V(`div`,Gm,[(z(!0),B(R,null,L(o.value,(e,r)=>(z(),B(`div`,{key:e._id,onClick:t=>m(e,!1,r),class:k([`px-6 py-3 flex items-center hover:bg-gray-50 transition-colors cursor-pointer`,f(e)?`bg-noctune-teal/10`:``])},[V(`div`,qm,[V(`span`,Jm,[f(e)&&I(t).isPlaying?(z(),B(`svg`,Ym,[...n[10]||=[V(`path`,{d:`M6 19h4V5H6v14zm8-14v14h4V5h-4z`},null,-1)]])):(z(),B(`span`,Xm,A(r+1),1))]),V(`div`,Zm,[e.coverUrl?(z(),B(`img`,{key:0,src:I(np)(e.coverUrl),class:`w-full h-full object-cover`},null,8,Qm)):W(``,!0)]),V(`span`,{class:k([`font-medium text-sm truncate`,f(e)?`text-noctune-teal`:`text-black`])},A(e.title),3)]),V(`span`,$m,A(e.artist),1),V(`span`,eh,A(e.album),1),V(`button`,{onClick:zo(t=>h(e),[`stop`]),class:`w-10 flex justify-center transition-colors`},[(z(),B(`svg`,{class:k([`w-5 h-5`,p(e)?`fill-red-400 text-red-400`:`text-gray-400 hover:text-red-400`]),fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[...n[11]||=[V(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z`},null,-1)]],2))],8,th),V(`button`,{onClick:zo(t=>d(e),[`stop`]),class:`w-8 flex justify-center transition-colors text-gray-400 hover:text-noctune-teal`},[...n[12]||=[V(`svg`,{class:`w-5 h-5`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z`})],-1)]],8,nh)],10,Km))),128))])]))]),H(sm,{show:u.value,"track-id":l.value?._id,onClose:n[0]||=e=>u.value=!1},null,8,[`show`,`track-id`])])}}},ih={class:`p-8`},ah={key:0,class:`grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4`},oh={key:1,class:`text-center py-20`},sh={key:2,class:`grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4`},ch=[`onClick`],lh={class:`aspect-square bg-gray-300 relative overflow-hidden`},uh=[`src`],dh={key:1,class:`w-full h-full flex items-center justify-center bg-gradient-to-br from-noctune-teal/20 to-noctune-yellow/20`},fh={class:`p-3`},ph={class:`font-bold text-sm truncate text-black`},mh={class:`text-xs text-gray-500`},hh={__name:`PlaylistPage`,setup(e){let t=Ol(),n=If(),{requireAuth:r}=Hg(),i=F([]),a=F(!0),o=F(!1);function s(){r({redirectTo:`/login`,onAuthenticated:()=>{o.value=!0}})}function c(e){o.value=!1,i.value.unshift(e)}return hr(async()=>{if(!n.isLoggedIn){a.value=!1;return}try{let{data:e}=await Q.get(`/playlists`);e.success&&(i.value=e.data)}catch{}finally{a.value=!1}}),(e,n)=>(z(),B(`div`,ih,[V(`div`,{class:`flex items-center justify-between mb-6`},[n[2]||=V(`h1`,{class:`text-3xl font-black text-black`},`YOUR PLAYLISTS`,-1),V(`button`,{onClick:s,class:`bg-noctune-teal border-2 border-black px-4 py-2 font-bold flex items-center gap-2 rounded-lg hover:bg-teal-600 transition-colors cursor-pointer`},[...n[1]||=[V(`svg`,{class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,"stroke-width":`3`,viewBox:`0 0 24 24`},[V(`path`,{d:`M12 4v16m8-8H4`})],-1),U(` NEW PLAYLIST `,-1)]])]),a.value?(z(),B(`div`,ah,[(z(),B(R,null,L(4,e=>V(`div`,{key:e,class:`animate-pulse bg-gray-200 rounded-2xl border-2 border-black h-64`})),64))])):i.value.length===0?(z(),B(`div`,oh,[n[3]||=V(`svg`,{class:`w-24 h-24 mx-auto text-gray-300 mb-4`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M3 10h11v2H3v-2zm0-4h11v2H3V6zm0 8h7v2H3v-2zm13-1v8l6-4-6-4z`})],-1),n[4]||=V(`p`,{class:`text-gray-500 mb-2 text-lg`},`No playlists yet`,-1),n[5]||=V(`p`,{class:`text-gray-400 text-sm mb-4`},`Create your first playlist to start organizing your music`,-1),V(`button`,{onClick:s,class:`bg-noctune-yellow border-2 border-black px-6 py-3 font-bold rounded-lg hover:bg-yellow-400 transition-colors cursor-pointer`},` CREATE YOUR FIRST PLAYLIST `)])):(z(),B(`div`,sh,[(z(!0),B(R,null,L(i.value,e=>(z(),B(`div`,{key:e._id,onClick:n=>I(t).push(`/playlist/${e._id}`),class:`bg-white rounded-2xl border-2 border-black overflow-hidden hover:scale-[1.02] transition-transform cursor-pointer group`},[V(`div`,lh,[e.coverUrl?(z(),B(`img`,{key:0,src:I(np)(e.coverUrl),class:`w-full h-full object-cover`},null,8,uh)):(z(),B(`div`,dh,[...n[6]||=[V(`svg`,{class:`w-20 h-16 text-gray-400`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M3 10h11v2H3v-2zm0-4h11v2H3V6zm0 8h7v2H3v-2zm13-1v8l6-4-6-4z`})],-1)]])),n[7]||=V(`div`,{class:`absolute inset-0 bg-black/0 group-hover:bg-black/10 transition-colors`},null,-1)]),V(`div`,fh,[V(`p`,ph,A(e.name),1),V(`p`,mh,A(e.tracks?.length||0)+` songs`,1)])],8,ch))),128))])),H(Gp,{show:o.value,onClose:n[0]||=e=>o.value=!1,onCreated:c},null,8,[`show`])]))}},gh={class:`p-8`},_h={key:0,class:`space-y-6 animate-pulse`},vh={class:`space-y-3`},yh={class:`flex items-start gap-8 mb-8`},bh={class:`w-56 h-56 rounded-2xl overflow-hidden border-4 border-black flex-shrink-0 bg-black`},xh=[`src`],Sh={key:1,class:`w-full h-full flex items-center justify-center`},Ch={class:`flex-1`},wh={class:`text-4xl font-black text-black mb-4 leading-tight`},Th={key:0,class:`text-gray-600 mb-4`},Eh={class:`flex items-center gap-3 text-gray-600 mb-6`},Dh={class:`font-medium`},Oh={class:`flex gap-4`},kh=[`disabled`],Ah={class:`bg-white rounded-2xl border-4 border-black overflow-hidden`},jh={class:`divide-y divide-gray-200`},Mh=[`onClick`],Nh={class:`w-12 text-center`},Ph={key:0,class:`w-4 h-4 text-noctune-teal mx-auto`,fill:`currentColor`,viewBox:`0 0 24 24`},Fh={key:1,class:`text-gray-500`},Ih={class:`flex-1 flex items-center gap-4`},Lh={class:`w-12 h-12 rounded-lg flex-shrink-0 overflow-hidden bg-gray-300 border border-black`},Rh=[`src`],zh={class:`w-48 text-center text-gray-600 text-sm truncate`},Bh=[`onClick`],Vh=[`onClick`],Hh={key:0,class:`p-8 text-center text-gray-500`},Uh={key:2,class:`text-center py-20 text-gray-500`},Wh={__name:`PlaylistDetail`,setup(e){let t=kl(),n=rp(),r=ip(),i=If(),{requireAuth:a}=Hg(),o=F(null),s=F(!0),c=F(null),l=F(!1);function u(e){c.value=e,a({redirectTo:`/login`,onAuthenticated:()=>{l.value=!0}})}function d(e){return n.currentTrack?._id===e._id}function f(e){return i.likedTrackIds?.has(e._id)}function p(e){if(!o.value?.tracks?.length)return;let t=o.value.tracks[e];if(d(t)){n.togglePlay();return}let i=o.value.tracks;r.setQueue(i,e),n.setTrack(t),n.play()}function m(){o.value?.tracks?.length&&p(0)}function h(e){a({redirectTo:`/login`,onAuthenticated:()=>i.toggleLike(e._id)})}return hr(async()=>{let e=t.params.id;try{if(e){let{data:t}=await Q.get(`/playlists/${e}`);t.success&&(o.value=t.data)}}catch{o.value=null}finally{s.value=!1}}),(e,t)=>(z(),B(R,null,[V(`div`,gh,[s.value?(z(),B(`div`,_h,[t[2]||=aa(`
`,1),V(`div`,vh,[(z(),B(R,null,L(5,e=>V(`div`,{key:e,class:`flex items-center gap-4`},[...t[1]||=[V(`div`,{class:`w-8 h-4 bg-gray-200 rounded`},null,-1),V(`div`,{class:`w-10 h-10 bg-gray-200 rounded-lg`},null,-1),V(`div`,{class:`h-3 bg-gray-200 rounded flex-1`},null,-1),V(`div`,{class:`h-3 bg-gray-200 rounded w-24`},null,-1)]])),64))])])):o.value?(z(),B(R,{key:1},[V(`div`,yh,[V(`div`,bh,[o.value.coverUrl?(z(),B(`img`,{key:0,src:I(np)(o.value.coverUrl),class:`w-full h-full object-cover`},null,8,xh)):(z(),B(`div`,Sh,[...t[3]||=[aa(``,1)]]))]),V(`div`,Ch,[t[5]||=V(`span`,{class:`inline-block bg-noctune-teal text-black text-xs font-bold px-3 py-1 rounded mb-3 border border-black`},`PLAYLIST`,-1),V(`h1`,wh,A(o.value.name),1),o.value.description?(z(),B(`p`,Th,A(o.value.description),1)):W(``,!0),V(`div`,Eh,[V(`span`,Dh,A(o.value.tracks?.length||0)+` songs`,1)]),V(`div`,Oh,[V(`button`,{onClick:m,disabled:!o.value.tracks?.length,class:`bg-noctune-teal border-2 border-black px-6 py-2 font-bold flex items-center gap-2 rounded-lg hover:bg-teal-600 transition-colors disabled:opacity-50 cursor-pointer`},[...t[4]||=[V(`svg`,{class:`w-4 h-4`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M8 5v14l11-7z`})],-1),U(` PLAY `,-1)]],8,kh)])])]),V(`div`,Ah,[t[9]||=aa(`
#TITLEARTIST
`,1),V(`div`,jh,[(z(!0),B(R,null,L(o.value.tracks,(e,r)=>(z(),B(`div`,{key:e._id,onClick:e=>p(r),class:k([`px-6 py-3 flex items-center hover:bg-gray-50 transition-colors cursor-pointer`,d(e)?`bg-noctune-teal/10`:``])},[V(`span`,Nh,[d(e)&&I(n).isPlaying?(z(),B(`svg`,Ph,[...t[6]||=[V(`path`,{d:`M6 19h4V5H6v14zm8-14v14h4V5h-4z`},null,-1)]])):(z(),B(`span`,Fh,A(r+1),1))]),V(`div`,Ih,[V(`div`,Lh,[e.coverUrl?(z(),B(`img`,{key:0,src:I(np)(e.coverUrl),class:`w-full h-full object-cover`},null,8,Rh)):W(``,!0)]),V(`span`,{class:k([`font-medium text-sm truncate`,d(e)?`text-noctune-teal`:`text-black`])},A(e.title),3)]),V(`span`,zh,A(e.artist),1),V(`button`,{onClick:zo(t=>h(e),[`stop`]),class:`w-10 flex justify-center transition-colors cursor-pointer`},[(z(),B(`svg`,{class:k([`w-5 h-5`,f(e)?`fill-red-400 text-red-400`:`text-gray-400 hover:text-red-400`]),fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[...t[7]||=[V(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z`},null,-1)]],2))],8,Bh),V(`button`,{onClick:zo(t=>u(e),[`stop`]),class:`w-8 flex justify-center transition-colors text-gray-400 hover:text-noctune-teal cursor-pointer`},[...t[8]||=[V(`svg`,{class:`w-5 h-5`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z`})],-1)]],8,Vh)],10,Mh))),128)),o.value.tracks?.length?W(``,!0):(z(),B(`div`,Hh,`No tracks in this playlist yet`))])])],64)):(z(),B(`div`,Uh,`Playlist not found`))]),H(sm,{show:l.value,"track-id":c.value?._id,onClose:t[0]||=e=>l.value=!1},null,8,[`show`,`track-id`])],64))}},Gh={class:`p-8`},Kh={class:`bg-white rounded-2xl border-4 border-black p-6 mb-6 flex items-center gap-8`},qh={class:`w-40 h-40 rounded-full border-4 border-black overflow-hidden flex-shrink-0 bg-gray-300`},Jh=[`src`],Yh={key:1,class:`w-full h-full flex items-center justify-center`},Xh={class:`flex-1`},Zh={class:`text-3xl font-black text-black mb-1`},Qh={class:`text-gray-600 mb-3`},$h={class:`inline-flex items-center gap-2 border-2 border-noctune-orange text-noctune-orange px-3 py-1 rounded-full mb-4`},eg={class:`text-sm font-medium`},tg={class:`flex gap-4`},ng={key:0,class:`bg-white rounded-2xl border-4 border-black p-6 mb-6`},rg={key:0,class:`text-red-500 text-sm mb-4`},ig={key:1,class:`text-green-600 text-sm mb-4`},ag={class:`space-y-4 max-w-md`},og=[`disabled`],sg={key:0,class:`inline-block w-4 h-4 border-2 border-black border-t-transparent rounded-full animate-spin mr-1`},cg={class:`bg-white rounded-2xl border-4 border-black p-6 mb-6 flex justify-center gap-12`},lg={class:`flex items-center gap-4`},ug={class:`text-2xl font-black text-black`},dg={__name:`ProfilePage`,setup(e){let t=Ol(),n=If(),r=F(!1),i=F(``),a=F(``),o=F(``),s=F(null),c=F(!1),l=F(``),u=F(``),d=F(0),f=G(()=>n.user?.name||n.user?.username||`User`);function p(){r.value=!r.value,r.value&&(i.value=n.user?.name||``,a.value=n.user?.username||``,o.value=n.user?.email||``,s.value=null,l.value=``,u.value=``)}function m(e){s.value=e.target.files[0]||null}async function h(){l.value=``,u.value=``,c.value=!0;try{let e=new FormData;e.append(`name`,i.value),e.append(`username`,a.value),e.append(`email`,o.value),s.value&&e.append(`avatar`,s.value);let t=await n.updateProfile(e);t.success?(u.value=`Profile updated!`,setTimeout(()=>{r.value=!1},1500)):l.value=t.message}catch{l.value=`Update failed`}finally{c.value=!1}}async function g(){await n.logout(),t.push(`/login`)}return hr(async()=>{if(!n.isLoggedIn){t.push(`/login`);return}try{let{data:e}=await Q.get(`/tracks/liked`);e.success&&(d.value=e.data.likedTracks?.length||0)}catch{}}),(e,t)=>(z(),B(`div`,Gh,[V(`div`,Kh,[V(`div`,qh,[I(n).user?.avatarUrl?(z(),B(`img`,{key:0,src:I(np)(I(n).user.avatarUrl),alt:`Profile`,class:`w-full h-full object-cover`},null,8,Jh)):(z(),B(`div`,Yh,[...t[3]||=[V(`svg`,{class:`w-16 h-16 text-gray-400`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z`})],-1)]]))]),V(`div`,Xh,[V(`h1`,Zh,A(f.value),1),V(`p`,Qh,`@`+A(I(n).user?.username||`username`),1),V(`div`,$h,[t[4]||=V(`svg`,{class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z`})],-1),V(`span`,eg,A(I(n).user?.role===`admin`?`Admin`:`Premium Member`),1)]),V(`div`,tg,[V(`button`,{onClick:p,class:`border-2 border-black px-4 py-2 rounded-lg font-medium flex items-center gap-2 hover:bg-gray-100 transition-colors`},[t[5]||=V(`svg`,{class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z`})],-1),U(` `+A(r.value?`Cancel`:`Edit Profile`),1)])])])]),r.value?(z(),B(`div`,ng,[t[11]||=V(`h3`,{class:`text-xl font-black text-black mb-4`},`Edit Profile`,-1),l.value?(z(),B(`p`,rg,A(l.value),1)):W(``,!0),u.value?(z(),B(`p`,ig,A(u.value),1)):W(``,!0),V(`div`,ag,[V(`div`,null,[t[6]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-1`},`NAME`,-1),zn(V(`input`,{type:`text`,"onUpdate:modelValue":t[0]||=e=>i.value=e,class:`w-full border-2 border-black rounded-lg px-4 py-2 focus:outline-none text-black`},null,512),[[Eo,i.value]])]),V(`div`,null,[t[7]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-1`},`USERNAME`,-1),zn(V(`input`,{type:`text`,"onUpdate:modelValue":t[1]||=e=>a.value=e,class:`w-full border-2 border-black rounded-lg px-4 py-2 focus:outline-none text-black`},null,512),[[Eo,a.value]])]),V(`div`,null,[t[8]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-1`},`EMAIL`,-1),zn(V(`input`,{type:`email`,"onUpdate:modelValue":t[2]||=e=>o.value=e,class:`w-full border-2 border-black rounded-lg px-4 py-2 focus:outline-none text-black`},null,512),[[Eo,o.value]])]),V(`div`,null,[t[9]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-1`},`AVATAR`,-1),V(`input`,{type:`file`,accept:`image/*`,onChange:m,class:`w-full text-sm`},null,32)]),V(`button`,{onClick:h,disabled:c.value,class:`bg-noctune-teal border-2 border-black px-6 py-2 font-bold rounded-lg hover:bg-teal-600 transition-colors disabled:opacity-50`},[c.value?(z(),B(`span`,sg)):W(``,!0),t[10]||=U(` Save Changes `,-1)],8,og)])])):W(``,!0),V(`div`,cg,[V(`div`,lg,[t[13]||=V(`div`,{class:`w-14 h-14 bg-noctune-orange rounded-xl flex items-center justify-center border-2 border-black`},[V(`svg`,{class:`w-7 h-7 text-white`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z`})])],-1),V(`div`,null,[V(`p`,ug,A(d.value),1),t[12]||=V(`p`,{class:`text-sm text-gray-500`},`Liked Songs`,-1)])])]),V(`button`,{onClick:g,class:`w-full bg-noctune-orange border-4 border-black rounded-2xl py-4 font-bold text-black flex items-center justify-center gap-3 hover:bg-orange-600 transition-colors`},[...t[14]||=[V(`svg`,{class:`w-6 h-6`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1`})],-1),U(` Logout `,-1)]])]))}},fg={class:`bg-noctune-cream flex flex-col h-full`},pg={class:`p-4 space-y-2`},mg={class:`relative group`},hg={class:`absolute left-0 top-full mt-1 w-56 bg-white border-2 border-black rounded-lg shadow-[4px_4px_0px_0px_#000] opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-200 z-50 max-h-72 overflow-y-auto`},gg={key:0,class:`p-2`},_g=[`onClick`],vg={class:`truncate`},yg={key:1,class:`p-4 text-center text-sm text-gray-500`},bg={class:`border-t-2 border-gray-200 p-2`},xg={__name:`Sidebar`,setup(e){let t=kl(),n=Ol(),r=If(),i=F([]),a=F(!1),{requireAuth:o}=Hg(),s=e=>t.path===e,c=e=>t.path.startsWith(e);async function l(){if(r.isLoggedIn)try{let{data:e}=await Q.get(`/playlists`);e.success&&(i.value=e.data)}catch{}}function u(){o({redirectTo:`/login`,onAuthenticated:()=>{a.value=!0}})}function d(e){a.value=!1,i.value.unshift(e)}return hr(l),(e,t)=>{let o=Tr(`router-link`);return z(),B(`aside`,fg,[V(`nav`,pg,[H(o,{to:`/home`,class:k([`flex items-center gap-3 px-4 py-3 rounded-lg font-bold text-black hover:bg-noctune-teal/20 transition-colors`,{"bg-noctune-teal text-black":s(`/home`)}])},{default:Rn(()=>[...t[1]||=[V(`svg`,{class:`w-6 h-6`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z`})],-1),V(`span`,{class:`tracking-wide`},`HOME`,-1)]]),_:1},8,[`class`]),H(o,{to:`/library`,class:k([`flex items-center gap-3 px-4 py-3 rounded-lg font-bold text-black hover:bg-noctune-teal/20 transition-colors`,{"bg-noctune-teal text-black":s(`/library`)}])},{default:Rn(()=>[...t[2]||=[V(`svg`,{class:`w-6 h-6`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M3 13h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7z`})],-1),V(`span`,{class:`tracking-wide`},`LIBRARY`,-1)]]),_:1},8,[`class`]),V(`div`,mg,[H(o,{to:`/playlist`,class:k([`flex items-center gap-3 px-4 py-3 rounded-lg font-bold text-black hover:bg-noctune-teal/20 transition-colors`,{"bg-noctune-teal text-black":s(`/playlist`)||c(`/playlist/`)}])},{default:Rn(()=>[...t[3]||=[V(`svg`,{class:`w-6 h-6`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M3 10h11v2H3v-2zm0-4h11v2H3V6zm0 8h7v2H3v-2zm13-1v8l6-4-6-4z`})],-1),V(`span`,{class:`tracking-wide`},`PLAYLIST`,-1),V(`svg`,{class:`w-4 h-4 ml-auto text-gray-500 group-hover:rotate-180 transition-transform`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M7 10l5 5 5-5z`})],-1)]]),_:1},8,[`class`]),V(`div`,hg,[i.value.length?(z(),B(`div`,gg,[(z(!0),B(R,null,L(i.value,e=>(z(),B(`div`,{key:e._id,onClick:t=>I(n).push(`/playlist/${e._id}`),class:`flex items-center gap-2 px-3 py-2 rounded-lg cursor-pointer hover:bg-noctune-teal/20 transition-colors text-sm font-medium text-black`},[t[4]||=V(`svg`,{class:`w-4 h-4 flex-shrink-0 text-gray-500`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M3 10h11v2H3v-2zm0-4h11v2H3V6zm0 8h7v2H3v-2zm13-1v8l6-4-6-4z`})],-1),V(`span`,vg,A(e.name),1)],8,_g))),128))])):(z(),B(`div`,yg,`No playlists yet`)),V(`div`,bg,[H(o,{to:`/playlist`,class:`block px-3 py-2 rounded-lg text-sm font-bold text-noctune-teal hover:bg-noctune-teal/20 transition-colors text-center`},{default:Rn(()=>[...t[5]||=[U(` Browse All Playlists `,-1)]]),_:1})])])]),I(r).isAdmin?(z(),Zi(o,{key:0,to:`/admin/tracks`,class:k([`flex items-center gap-3 px-4 py-3 rounded-lg font-bold text-black hover:bg-noctune-orange/20 transition-colors`,{"bg-noctune-orange text-black":s(`/admin/tracks`)}])},{default:Rn(()=>[...t[6]||=[V(`svg`,{class:`w-6 h-6`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm-3 17l-4-4 1.41-1.41L11 16.17l6.59-6.59L19 11l-8 8z`})],-1),V(`span`,{class:`tracking-wide`},`UPLOAD TRACK`,-1)]]),_:1},8,[`class`])):W(``,!0)]),t[8]||=V(`div`,{class:`mx-4 border-t-2 border-gray-300 my-2`},null,-1),V(`div`,{class:`px-4`},[V(`button`,{onClick:u,class:`w-full bg-noctune-yellow border-2 border-black rounded-lg py-3 px-4 font-bold flex items-center gap-2 hover:bg-yellow-400 transition-colors`},[...t[7]||=[V(`svg`,{class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`3`,d:`M12 4v16m8-8H4`})],-1),V(`span`,{class:`tracking-wide`},`CREATE PLAYLIST`,-1)]])]),t[9]||=V(`div`,{class:`flex-1`},null,-1),H(Gp,{show:a.value,onClose:t[0]||=e=>a.value=!1,onCreated:d},null,8,[`show`])])}}},Sg={class:`min-h-screen bg-noctune-cream flex flex-col`},Cg={class:`flex flex-1`},wg={class:`flex-1 p-8 overflow-auto`},Tg={class:`max-w-2xl mx-auto`},Eg={key:0,class:`text-red-500 text-sm mb-4 font-medium`},Dg={key:1,class:`text-green-600 text-sm mb-4 font-medium`},Og={class:`bg-white rounded-2xl border-4 border-black p-8 space-y-6`},kg=[`src`],Ag={key:1,class:`text-gray-500`},jg={key:0,class:`text-black font-medium`},Mg={key:1,class:`text-gray-500`},Ng=[`disabled`],Pg={key:0,class:`inline-block w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin mr-2`},Fg=[{path:`/`,redirect:`/home`},{path:`/login`,name:`Login`,component:Cp,meta:{guest:!0}},{path:`/register`,name:`Register`,component:Rp,meta:{guest:!0}},{path:`/home`,name:`Home`,component:Tm},{path:`/library`,name:`Library`,component:rh},{path:`/playlist`,name:`Playlist`,component:hh},{path:`/playlist/:id`,name:`PlaylistDetail`,component:Wh},{path:`/profile`,name:`Profile`,component:dg},{path:`/admin/tracks`,name:`AdminTracks`,component:{__name:`AdminPage`,setup(e){let t=Ol(),n=F(``),r=F(``),i=F(``),a=F(``),o=F(null),s=F(``),c=F(null),l=F(!1),u=F(``),d=F(``),f=F(null),p=F(null);function m(e){let t=e.target.files[0];t&&(o.value=t,s.value=URL.createObjectURL(t))}function h(e){let t=e.target.files[0];t&&(c.value=t)}async function g(){if(u.value=``,d.value=``,!n.value||!r.value||!i.value||!a.value||!o.value||!c.value){u.value=`All fields are required`;return}l.value=!0;try{let e=new FormData;e.append(`title`,n.value),e.append(`artist`,r.value),e.append(`album`,i.value),e.append(`genre`,a.value),e.append(`cover`,o.value),e.append(`audio`,c.value);let{data:l}=await Q.post(`/admin/tracks`,e,{headers:{"Content-Type":`multipart/form-data`}});l.success&&(d.value=`Track uploaded successfully!`,n.value=``,r.value=``,i.value=``,a.value=``,o.value=null,s.value=``,c.value=null,setTimeout(()=>t.push(`/home`),1500))}catch(e){u.value=e.response?.data?.message||`Upload failed`}finally{l.value=!1}}return(e,t)=>(z(),B(`div`,Sg,[V(`div`,Cg,[V(`main`,wg,[V(`div`,Tg,[t[12]||=V(`h1`,{class:`text-4xl font-black text-black mb-2`},`Upload Track`,-1),t[13]||=V(`p`,{class:`text-gray-600 mb-8`},`Add a new track to the library`,-1),u.value?(z(),B(`p`,Eg,A(u.value),1)):W(``,!0),d.value?(z(),B(`p`,Dg,A(d.value),1)):W(``,!0),V(`div`,Og,[V(`div`,null,[t[6]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-2 tracking-wider`},`TITLE`,-1),zn(V(`input`,{type:`text`,"onUpdate:modelValue":t[0]||=e=>n.value=e,class:`w-full border-2 border-black rounded-lg px-4 py-3 focus:outline-none text-black`,placeholder:`Track title`},null,512),[[Eo,n.value]])]),V(`div`,null,[t[7]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-2 tracking-wider`},`ARTIST`,-1),zn(V(`input`,{type:`text`,"onUpdate:modelValue":t[1]||=e=>r.value=e,class:`w-full border-2 border-black rounded-lg px-4 py-3 focus:outline-none text-black`,placeholder:`Artist name`},null,512),[[Eo,r.value]])]),V(`div`,null,[t[8]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-2 tracking-wider`},`ALBUM`,-1),zn(V(`input`,{type:`text`,"onUpdate:modelValue":t[2]||=e=>i.value=e,class:`w-full border-2 border-black rounded-lg px-4 py-3 focus:outline-none text-black`,placeholder:`Album name`},null,512),[[Eo,i.value]])]),V(`div`,null,[t[9]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-2 tracking-wider`},`GENRE`,-1),zn(V(`input`,{type:`text`,"onUpdate:modelValue":t[3]||=e=>a.value=e,class:`w-full border-2 border-black rounded-lg px-4 py-3 focus:outline-none text-black`,placeholder:`e.g. Pop, Rock, Jazz`},null,512),[[Eo,a.value]])]),V(`div`,null,[t[10]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-2 tracking-wider`},`COVER IMAGE`,-1),V(`div`,{class:`border-2 border-dashed border-black rounded-lg p-6 text-center cursor-pointer hover:bg-gray-50`,onClick:t[4]||=e=>f.value.click()},[s.value?(z(),B(`img`,{key:0,src:s.value,class:`w-32 h-32 object-cover mx-auto mb-2 rounded-lg border-2 border-black`},null,8,kg)):(z(),B(`p`,Ag,`Click to upload cover image`)),V(`input`,{ref_key:`coverInput`,ref:f,type:`file`,accept:`image/*`,onChange:m,class:`hidden`},null,544)])]),V(`div`,null,[t[11]||=V(`label`,{class:`block text-xs font-bold text-gray-600 mb-2 tracking-wider`},`AUDIO FILE`,-1),V(`div`,{class:`border-2 border-dashed border-black rounded-lg p-6 text-center cursor-pointer hover:bg-gray-50`,onClick:t[5]||=e=>p.value.click()},[c.value?(z(),B(`p`,jg,A(c.value.name),1)):(z(),B(`p`,Mg,` Click to upload audio file (MP3, WAV, FLAC) `)),V(`input`,{ref_key:`audioInput`,ref:p,type:`file`,accept:`.mp3,.wav,.flac`,onChange:h,class:`hidden`},null,544)])]),V(`button`,{onClick:g,disabled:l.value,class:`w-full bg-noctune-orange border-2 border-black rounded-lg py-4 font-bold text-white text-xl hover:bg-orange-600 transition-colors disabled:opacity-50`},[l.value?(z(),B(`span`,Pg)):W(``,!0),U(` `+A(l.value?`Uploading...`:`UPLOAD TRACK`),1)],8,Ng)])])])])]))}},meta:{admin:!0}}],Ig=Dl({history:qc(),routes:Fg});Ig.beforeEach((e,t,n)=>{let r=If();if(e.meta.admin&&!r.isAdmin||e.meta.guest&&r.isLoggedIn)return n(`/home`);n()});var Lg=`modulepreload`,Rg=function(e){return`/`+e},zg={},Bg=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=Rg(t,n),t in zg)return;zg[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:Lg,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Vg=null;function Hg(){let e=If();async function t({message:t,onAuthenticated:n,redirectTo:r}){if(e.isLoggedIn)n?.();else if(Vg=n||null,r)Ig.push(r);else if(t){let{useUiStore:e}=await Bg(async()=>{let{useUiStore:e}=await Promise.resolve().then(()=>Lf);return{useUiStore:e}},void 0);e().showToast(t,`info`)}}function n(){if(Vg){let e=Vg;Vg=null,e()}}return{requireAuth:t,executePending:n}}var Ug={class:`bg-noctune-teal px-4 py-3 flex items-center justify-between border-b-4 border-black`},Wg={class:`flex items-center gap-4`},Gg={class:`flex-1 max-w-md mx-8 relative`},Kg={class:`relative`},qg={key:0,class:`absolute top-full mt-2 left-0 right-0 bg-white border-2 border-black rounded-lg shadow-[4px_4px_0px_0px_#000] max-h-96 overflow-y-auto z-50`},Jg={key:0,class:`p-2`},Yg=[`onClick`],Xg={class:`w-8 h-8 bg-gray-300 rounded border border-black flex-shrink-0 overflow-hidden`},Zg=[`src`],Qg={class:`min-w-0 flex-1`},$g={class:`text-sm font-medium text-black truncate`},e_={class:`text-xs text-gray-500`},t_={key:1,class:`p-2 border-t border-gray-200`},n_=[`onClick`],r_={key:2,class:`p-4 text-center text-gray-500 text-sm`},i_={class:`flex items-center gap-4`},a_={class:`w-8 h-8 rounded-full bg-noctune-dark overflow-hidden border-2 border-black`},o_=[`src`],s_={key:1,class:`w-full h-full flex items-center justify-center`},c_={__name:`AppHeader`,setup(e){let t=Ol(),n=If(),r=rp(),i=ip(),{requireAuth:a}=Hg(),o=F(``),s=F(null),c=null;function l(){if(clearTimeout(c),!o.value.trim()){s.value=null;return}c=setTimeout(async()=>{try{let{data:e}=await Q.get(`/search?q=${encodeURIComponent(o.value)}`);e.success&&(s.value=e.data)}catch{s.value=null}},300)}function u(){o.value=``,s.value=null}function d(e){u(),i.setQueue([e],0),r.setTrack(e),r.play()}function f(){a({redirectTo:`/login`,onAuthenticated:()=>t.push(`/library`)})}function p(){a({redirectTo:`/login`,onAuthenticated:()=>t.push(`/profile`)})}return(e,r)=>{let i=Tr(`router-link`);return z(),B(`header`,Ug,[V(`div`,Wg,[H(i,{to:`/home`,class:`text-black font-bold text-2xl tracking-wider font-mono`},{default:Rn(()=>[...r[1]||=[U(`NOCTUNE`,-1)]]),_:1})]),V(`div`,Gg,[V(`div`,Kg,[r[2]||=V(`div`,{class:`absolute inset-y-0 left-3 flex items-center pointer-events-none`},[V(`svg`,{class:`w-5 h-5 text-gray-500`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z`})])],-1),zn(V(`input`,{type:`text`,"onUpdate:modelValue":r[0]||=e=>o.value=e,onInput:l,onKeydown:Vo(u,[`escape`]),placeholder:`Search music, artist, album...`,class:`w-full bg-noctune-cream py-2 pl-10 pr-4 rounded-full text-sm focus:outline-none focus:ring-2 focus:ring-black`},null,544),[[Eo,o.value]])]),s.value&&o.value?(z(),B(`div`,qg,[s.value.tracks?.length?(z(),B(`div`,Jg,[r[3]||=V(`p`,{class:`text-xs font-bold text-gray-500 px-2 py-1`},`TRACKS`,-1),(z(!0),B(R,null,L(s.value.tracks.slice(0,5),e=>(z(),B(`div`,{key:e._id,onClick:t=>d(e),class:`flex items-center gap-3 px-2 py-2 hover:bg-gray-100 rounded cursor-pointer`},[V(`div`,Xg,[e.coverUrl?(z(),B(`img`,{key:0,src:I(np)(e.coverUrl),class:`w-full h-full object-cover`},null,8,Zg)):W(``,!0)]),V(`div`,Qg,[V(`p`,$g,A(e.title),1),V(`p`,e_,A(e.artist),1)])],8,Yg))),128))])):W(``,!0),s.value.artists?.length?(z(),B(`div`,t_,[r[4]||=V(`p`,{class:`text-xs font-bold text-gray-500 px-2 py-1`},`ARTISTS`,-1),(z(!0),B(R,null,L(s.value.artists.slice(0,3),e=>(z(),B(`div`,{key:e.name,onClick:n=>I(t).push(`/home?artist=${e.name}`),class:`px-2 py-2 hover:bg-gray-100 rounded cursor-pointer text-sm font-medium text-black`},A(e.name),9,n_))),128))])):W(``,!0),!s.value.tracks?.length&&!s.value.artists?.length?(z(),B(`div`,r_,`No results found`)):W(``,!0)])):W(``,!0)]),V(`div`,i_,[V(`button`,{onClick:f,class:`text-black hover:opacity-80`},[...r[5]||=[V(`svg`,{class:`w-7 h-7`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z`})],-1)]]),V(`button`,{onClick:p,class:`text-black hover:opacity-80`},[V(`div`,a_,[I(n).user?.avatarUrl?(z(),B(`img`,{key:0,src:I(np)(I(n).user.avatarUrl),class:`w-full h-full object-cover`},null,8,o_)):(z(),B(`div`,s_,[...r[6]||=[V(`svg`,{class:`w-5 h-5 text-white`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z`})],-1)]]))])])])])}}},l_=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},u_={key:0,class:`fixed bottom-0 left-0 right-0 bg-noctune-dark border-t-4 border-black z-50`},d_={class:`flex items-center px-4 py-2 max-w-screen-2xl mx-auto`},f_={class:`flex items-center gap-3 w-80`},p_={class:`w-12 h-12 bg-black rounded-lg overflow-hidden flex-shrink-0 border border-white/20`},m_=[`src`],h_={key:1,class:`w-full h-full flex items-center justify-center`},g_={class:`min-w-0`},__={class:`text-sm font-bold text-white truncate`},v_={class:`text-xs text-gray-400 truncate`},y_={class:`flex-1 flex flex-col items-center`},b_={class:`flex items-center gap-4 mb-1`},x_={key:0,class:`w-5 h-5 text-black`,fill:`currentColor`,viewBox:`0 0 24 24`},S_={key:1,class:`w-5 h-5 text-black ml-0.5`,fill:`currentColor`,viewBox:`0 0 24 24`},C_={key:0,class:`absolute -top-2 -right-2 text-[9px] font-bold`},w_={class:`flex items-center gap-3 w-full max-w-lg`},T_={class:`text-xs text-gray-400 w-10 text-right`},E_=[`value`,`max`],D_={class:`text-xs text-gray-400 w-10`},O_={class:`w-80 flex items-center justify-end gap-3`},k_={class:`flex items-center gap-2`},A_=[`value`],j_=l_({__name:`PlayerBar`,setup(e){let t=rp(),n=ip(),r=If(),{requireAuth:i}=Hg(),a=F(!1),o=F(null);function s(e){return`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,`0`)}`}function c(e){let n=e.currentTarget.getBoundingClientRect();o.value=(e.clientX-n.left)/n.width*t.duration}function l(){let e=n.nextTrack();e&&(t.setTrack(e),t.play())}hr(()=>{t.onEnd(l)});let u=G(()=>np(t.currentTrack?.coverUrl));function d(e){t.seek(parseFloat(e.target.value))}function f(e){t.setVolume(parseInt(e.target.value))}function p(){let e=n.nextTrack();e&&(t.setTrack(e),t.play())}function m(){let e=n.prevTrack();e&&(t.setTrack(e),t.play())}function h(){if(!t.currentTrack)return;let e=t.currentTrack._id||t.currentTrack.id;i({redirectTo:`/login`,onAuthenticated:()=>r.toggleLike(e)})}return Kn(()=>t.currentTrack?._id,e=>{a.value=e?r.likedTrackIds.has(e):!1},{immediate:!0}),Kn(()=>r.user?.likedTracks?.length,()=>{let e=t.currentTrack?._id;e&&(a.value=r.likedTrackIds.has(e))}),(e,r)=>I(t).currentTrack?(z(),B(`div`,u_,[V(`div`,d_,[V(`div`,f_,[V(`div`,p_,[I(t).currentTrack.coverUrl?(z(),B(`img`,{key:0,src:u.value,alt:``,class:`w-full h-full object-cover`},null,8,m_)):(z(),B(`div`,h_,[...r[6]||=[aa(``,1)]]))]),V(`div`,g_,[V(`p`,__,A(I(t).currentTrack.title),1),V(`p`,v_,A(I(t).currentTrack.artist),1)])]),V(`div`,y_,[V(`div`,b_,[V(`button`,{onClick:r[0]||=e=>I(n).toggleShuffle(),class:k([`text-sm transition-colors`,I(n).shuffle?`text-noctune-teal`:`text-gray-400 hover:text-white`])},[...r[7]||=[V(`svg`,{class:`w-4 h-4`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M10.59 9.17L5.41 4 4 5.41l5.17 5.17 1.42-1.41zM14.5 4l2.04 2.04L4 18.59 5.41 20 17.96 7.46 20 9.5V4h-5.5zm.33 9.41l-1.41 1.41 3.13 3.13L14.5 20H20v-5.5l-2.04 2.04-3.13-3.13z`})],-1)]],2),V(`button`,{onClick:r[1]||=e=>m(),class:`text-gray-400 hover:text-white transition-colors`},[...r[8]||=[V(`svg`,{class:`w-5 h-5`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M6 6h2v12H6zm3.5 6l8.5 6V6z`})],-1)]]),V(`button`,{onClick:r[2]||=e=>I(t).togglePlay(),class:`w-10 h-10 bg-white rounded-full flex items-center justify-center hover:scale-105 transition-transform`},[I(t).isPlaying?(z(),B(`svg`,x_,[...r[9]||=[V(`path`,{d:`M6 19h4V5H6v14zm8-14v14h4V5h-4z`},null,-1)]])):(z(),B(`svg`,S_,[...r[10]||=[V(`path`,{d:`M8 5v14l11-7z`},null,-1)]]))]),V(`button`,{onClick:r[3]||=e=>p(),class:`text-gray-400 hover:text-white transition-colors`},[...r[11]||=[V(`svg`,{class:`w-5 h-5`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M6 18l8.5-6L6 6v12zM16 6v12h2V6h-2z`})],-1)]]),V(`button`,{onClick:r[4]||=e=>I(n).cycleRepeat(),class:k([`text-sm transition-colors`,I(n).repeat===`off`?`text-gray-400 hover:text-white`:`text-noctune-teal`,I(n).repeat===`one`?`relative`:``])},[r[12]||=V(`svg`,{class:`w-4 h-4`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M7 7h10v3l4-4-4-4v3H5v6h2V7zm10 10H7v-3l-4 4 4 4v-3h12v-6h-2v4z`})],-1),I(n).repeat===`one`?(z(),B(`span`,C_,`1`)):W(``,!0)],2)]),V(`div`,w_,[V(`span`,T_,A(I(t).formattedProgress),1),V(`div`,{class:`relative flex-1`,onMousemove:c,onMouseleave:r[5]||=e=>o.value=null},[o.value===null?W(``,!0):(z(),B(`div`,{key:0,class:`absolute -top-6 left-1/2 -translate-x-1/2 bg-black text-white text-xs px-2 py-1 rounded whitespace-nowrap z-10`,style:pe({left:`${o.value/(I(t).duration||1)*100}%`})},A(s(o.value)),5)),V(`input`,{type:`range`,value:I(t).progress,onInput:d,min:`0`,max:I(t).duration||1,step:`0.1`,class:`w-full h-1 bg-gray-600 rounded-full appearance-none cursor-pointer range-player`},null,40,E_)],32),V(`span`,D_,A(I(t).formattedDuration),1)])]),V(`div`,O_,[V(`button`,{onClick:h,class:`transition-colors`},[(z(),B(`svg`,{class:k([`w-5 h-5`,a.value?`fill-red-400 text-red-400`:`text-gray-400 hover:text-red-400`]),fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[...r[13]||=[V(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z`},null,-1)]],2))]),V(`div`,k_,[r[14]||=V(`svg`,{class:`w-4 h-4 text-gray-400`,fill:`currentColor`,viewBox:`0 0 24 24`},[V(`path`,{d:`M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z`})],-1),V(`input`,{type:`range`,value:I(t).volume,onInput:f,min:`0`,max:`100`,class:`w-20 h-1 bg-gray-600 rounded-full appearance-none cursor-pointer range-vol`},null,40,A_)])])])])):W(``,!0)}},[[`__scopeId`,`data-v-0368441b`]]);function M_(){let e=rp();ip();function t(t){if(![`INPUT`,`TEXTAREA`].includes(t.target.tagName))switch(t.code){case`Space`:t.preventDefault(),e.togglePlay();break;case`ArrowLeft`:e.seek(Math.max(0,e.progress-5));break;case`ArrowRight`:e.seek(Math.min(e.duration,e.progress+5));break;case`ArrowUp`:e.setVolume(Math.min(100,e.volume+5));break;case`ArrowDown`:e.setVolume(Math.max(0,e.volume-5));break}}hr(()=>window.addEventListener(`keydown`,t)),yr(()=>window.removeEventListener(`keydown`,t))}var N_={class:`min-h-screen bg-noctune-cream`},P_={key:0},F_={class:`flex`},I_={class:`fixed top-4 right-4 z-[100] space-y-2`},L_={class:`flex items-center gap-2`},R_=[`onClick`],z_=Go({__name:`App`,setup(e){let t=kl(),n=If(),r=Rf(),i=rp(),a=G(()=>t.meta?.guest===!0),o=G(()=>!!i.currentTrack);M_();function s(e){return{info:`bg-noctune-teal text-black`,success:`bg-green-400 text-black`,error:`bg-red-400 text-white`}[e]||`bg-noctune-yellow text-black`}return hr(async()=>{await n.checkSession()}),(e,t)=>{let n=Tr(`router-view`);return z(),B(`div`,N_,[a.value?(z(),Zi(n,{key:1})):(z(),B(`div`,P_,[H(c_,{class:`sticky top-0 z-30`}),V(`div`,F_,[H(xg,{class:`fixed left-0 top-[57px] bottom-0 w-64 border-r-4 border-black overflow-y-auto z-20`}),V(`main`,{class:k([`ml-64 flex-1 min-h-[calc(100vh-57px)]`,{"pb-20":o.value}])},[H(n)],2)]),H(j_)])),V(`div`,I_,[(z(!0),B(R,null,L(I(r).toasts,e=>(z(),B(`div`,{key:e.id,class:k([`px-4 py-3 rounded-lg border-2 border-black font-bold text-sm shadow-[4px_4px_0px_0px_#000] transition-all animate-slide-in`,s(e.type)])},[V(`div`,L_,[V(`span`,null,A(e.message),1),V(`button`,{onClick:t=>I(r).dismissToast(e.id),class:`ml-2 opacity-60 hover:opacity-100`},` × `,8,R_)])],2))),128))])])}}}),B_=fs();z_.use(B_),z_.use(Ig),If(B_).checkSession().finally(()=>{z_.mount(`#app`)}); \ No newline at end of file diff --git a/dist/index.html b/dist/index.html index 7e9797a..ac0db2f 100644 --- a/dist/index.html +++ b/dist/index.html @@ -6,7 +6,7 @@ Noctune - Music That Hits Different - + diff --git a/src/lib/audioEngine.js b/src/lib/audioEngine.js index f1c91b2..07948f7 100644 --- a/src/lib/audioEngine.js +++ b/src/lib/audioEngine.js @@ -15,11 +15,11 @@ function load(url) { howl = new Howl({ src: [url], html5: true, - onplay: () => listeners.onPlay?.(), - onpause: () => listeners.onPause?.(), - onend: () => listeners.onEnd?.(), - onloaderror: () => listeners.onError?.(), - onplayerror: () => listeners.onError?.(), + onplay: () => listeners.play?.(), + onpause: () => listeners.pause?.(), + onend: () => listeners.end?.(), + onloaderror: () => listeners.error?.(), + onplayerror: () => listeners.error?.(), }) }