- Deleted apps/web/src/utils/optimisticStoreUpdates.ts (unused file) - File was unused - no imports found in codebase - Mutations already use React Query's onMutate pattern - No TypeScript errors after deletion - Actions 4.4.1.2 and 4.4.1.3 complete
6 lines
115 KiB
JavaScript
6 lines
115 KiB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["js/DashboardPage-tU6v8lrU.js","js/chunk-m7Vgm5hx.js","js/chunk-Dj70Y9U3.js","js/chunk-CbPYJovs.js","js/chunk-VMUEamc6.js","js/chunk-DZ12PeIs.js","js/chunk-Ofl1aOM0.js","js/chunk-B4NZlYwU.js","js/chunk-pW9FG0iV.js","js/chunk-CSrBv2n5.js","js/LibraryPage-CpGiWvEF.js","js/chunk-DbONor5B.js","js/chunk-DtpDHbXJ.js","js/ProfilePage-DejIn-kp.js","js/chunk-x_b5JIsF.js","js/chunk-twYhTH6E.js","js/SettingsPage-BuWv_afE.js","js/LoginPage-B8bD2GQG.js","js/RegisterPage-B8SqZFoS.js","js/ForgotPasswordPage-HtqV94Oc.js","js/chunk-CZfIDqzc.js","js/chunk-D3a66VIY.js","js/VerifyEmailPage-BleC9tbZ.js","js/ResetPasswordPage-BcR1yiXn.js","js/SessionsPage-C3IyqzXN.js","js/NotFoundPage-BNQ8QZXy.js","js/ServerErrorPage-D5p--daf.js","js/UserProfilePage-CHP4gaO1.js","js/chunk-De3uYxHy.js","js/chunk-Cn24-dbL.js","js/chunk-C3f0zOZJ.js","js/RolesPage-C_xE21Kg.js","js/TrackDetailPage-nsjzQxkj.js","js/routes-CnJ69re8.js","assets/routes-B3giLbLK.css","js/SearchPage-juuhB4y6.js","js/NotificationsPage-DKYvsusD.js","js/MarketplaceHome-CECv2q4E.js","js/AnalyticsPage-B6vsgRQp.js","js/WebhooksPage-Bxaqwkqe.js","js/AdminDashboardPage-D7_uRocR.js","js/DesignSystemDemoPage-DNdtVNU8.js","js/SocialPage-Dml5lqby.js","js/GearPage-mBpePMPH.js","js/LivePage-C9D98f1P.js","js/EducationPage-Bsmem2qY.js","js/QueuePage-XCc_NyCB.js","js/DeveloperPage-C-qN42Sy.js"])))=>i.map(i=>d[i]);
|
|
import{Q as _t,K as At,r as c,Y as Lt,Z as Rt,_ as Tt,l as x,j as s,E as It,N as z,c as V,$ as Dt,a0 as Ot,a1 as Mt,a2 as We,i as zt,L as ge,T as be,u as G,o as T,t as st,a3 as Ft,a4 as Ut,a5 as qe,B as K,a6 as He,a7 as Vt,h as $t,a8 as at,X as Bt,a9 as Wt,aa as qt,ab as Ee,M as Ht,n as Kt,ac as rt,ad as Gt,ae as nt,af as ot,ag as Yt,ah as Qt,ai as Jt,aj as Xt,ak as Zt,al as es,am as ts,an as ss,ao as as,ap as rs,aq as ns,ar as os,as as is,at as ls,au as cs,av as ds,aw as us,ax as hs,ay as ms,az as ps,aA as fs,q as gs,x as ys,aB as j,D as xs,aC as pe,aD as Se,aE as vs,aF as bs,aG as ws,aH as ks,aI as js}from"./chunk-m7Vgm5hx.js";import{k as it,l as M,n as lt,s as ct,q as Ie,x as De,y as ye,z as Ns,B as Ss,C as Cs,D as Ke,E as Es,t as Ps,c as _s,A as Oe,F as dt,G as As}from"./chunk-CbPYJovs.js";import{b as Ls}from"./chunk-VMUEamc6.js";import{c as Me,d as ze,p as Fe}from"./chunk-Dj70Y9U3.js";import{u as ut}from"./chunk-pW9FG0iV.js";import{f as Rs,a as Ts}from"./chunk-B4NZlYwU.js";import{G as Is,K as q}from"./chunk-CSrBv2n5.js";import"./chunk-DZ12PeIs.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))r(n);new MutationObserver(n=>{for(const o of n)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function a(n){const o={};return n.integrity&&(o.integrity=n.integrity),n.referrerPolicy&&(o.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?o.credentials="include":n.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(n){if(n.ep)return;n.ep=!0;const o=a(n);fetch(n.href,o)}})();var fe={},Ge;function Ds(){if(Ge)return fe;Ge=1;var e=_t();return fe.createRoot=e.createRoot,fe.hydrateRoot=e.hydrateRoot,fe}var Os=Ds();const Ms=At(Os);function ce(){return ce=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},ce.apply(this,arguments)}const Ue=c.createContext(null),zs=c.createContext(null),Z=c.createContext(null),we=c.createContext(null),Y=c.createContext({outlet:null,matches:[],isDataRoute:!1}),ht=c.createContext(null);function Fs(e,t){let{relative:a}=t===void 0?{}:t;ne()||M(!1);let{basename:r,navigator:n}=c.useContext(Z),{hash:o,pathname:i,search:d}=pt(e,{relative:a}),l=i;return r!=="/"&&(l=i==="/"?r:ye([r,i])),n.createHref({pathname:l,search:d,hash:o})}function ne(){return c.useContext(we)!=null}function ae(){return ne()||M(!1),c.useContext(we).location}function mt(e){c.useContext(Z).static||c.useLayoutEffect(e)}function ee(){let{isDataRoute:e}=c.useContext(Y);return e?Xs():Us()}function Us(){ne()||M(!1);let e=c.useContext(Ue),{basename:t,future:a,navigator:r}=c.useContext(Z),{matches:n}=c.useContext(Y),{pathname:o}=ae(),i=JSON.stringify(De(n,a.v7_relativeSplatPath)),d=c.useRef(!1);return mt(()=>{d.current=!0}),c.useCallback(function(u,h){if(h===void 0&&(h={}),!d.current)return;if(typeof u=="number"){r.go(u);return}let m=Ie(u,JSON.parse(i),o,h.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:ye([t,m.pathname])),(h.replace?r.replace:r.push)(m,h.state,h)},[t,r,i,o,e])}function No(){let{matches:e}=c.useContext(Y),t=e[e.length-1];return t?t.params:{}}function pt(e,t){let{relative:a}=t===void 0?{}:t,{future:r}=c.useContext(Z),{matches:n}=c.useContext(Y),{pathname:o}=ae(),i=JSON.stringify(De(n,r.v7_relativeSplatPath));return c.useMemo(()=>Ie(e,JSON.parse(i),o,a==="path"),[e,i,o,a])}function Vs(e,t){return $s(e,t)}function $s(e,t,a,r){ne()||M(!1);let{navigator:n}=c.useContext(Z),{matches:o}=c.useContext(Y),i=o[o.length-1],d=i?i.params:{};i&&i.pathname;let l=i?i.pathnameBase:"/";i&&i.route;let u=ae(),h;if(t){var m;let b=typeof t=="string"?lt(t):t;l==="/"||(m=b.pathname)!=null&&m.startsWith(l)||M(!1),h=b}else h=u;let p=h.pathname||"/",f=p;if(l!=="/"){let b=l.replace(/^\//,"").split("/");f="/"+p.replace(/^\//,"").split("/").slice(b.length).join("/")}let E=Ns(e,{pathname:f}),S=Ks(E&&E.map(b=>Object.assign({},b,{params:Object.assign({},d,b.params),pathname:ye([l,n.encodeLocation?n.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?l:ye([l,n.encodeLocation?n.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),o,a,r);return t&&S?c.createElement(we.Provider,{value:{location:ce({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:it.Pop}},S):S}function Bs(){let e=Js(),t=Ss(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,n={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return c.createElement(c.Fragment,null,c.createElement("h2",null,"Unexpected Application Error!"),c.createElement("h3",{style:{fontStyle:"italic"}},t),a?c.createElement("pre",{style:n},a):null,null)}const Ws=c.createElement(Bs,null);class qs extends c.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,a){return a.location!==t.location||a.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:a.error,location:a.location,revalidation:t.revalidation||a.revalidation}}componentDidCatch(t,a){console.error("React Router caught the following error during render",t,a)}render(){return this.state.error!==void 0?c.createElement(Y.Provider,{value:this.props.routeContext},c.createElement(ht.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Hs(e){let{routeContext:t,match:a,children:r}=e,n=c.useContext(Ue);return n&&n.static&&n.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=a.route.id),c.createElement(Y.Provider,{value:t},r)}function Ks(e,t,a,r){var n;if(t===void 0&&(t=[]),a===void 0&&(a=null),r===void 0&&(r=null),e==null){var o;if(!a)return null;if(a.errors)e=a.matches;else if((o=r)!=null&&o.v7_partialHydration&&t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let i=e,d=(n=a)==null?void 0:n.errors;if(d!=null){let h=i.findIndex(m=>m.route.id&&d?.[m.route.id]!==void 0);h>=0||M(!1),i=i.slice(0,Math.min(i.length,h+1))}let l=!1,u=-1;if(a&&r&&r.v7_partialHydration)for(let h=0;h<i.length;h++){let m=i[h];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(u=h),m.route.id){let{loaderData:p,errors:f}=a,E=m.route.loader&&p[m.route.id]===void 0&&(!f||f[m.route.id]===void 0);if(m.route.lazy||E){l=!0,u>=0?i=i.slice(0,u+1):i=[i[0]];break}}}return i.reduceRight((h,m,p)=>{let f,E=!1,S=null,b=null;a&&(f=d&&m.route.id?d[m.route.id]:void 0,S=m.route.errorElement||Ws,l&&(u<0&&p===0?(Zs("route-fallback"),E=!0,b=null):u===p&&(E=!0,b=m.route.hydrateFallbackElement||null)));let P=t.concat(i.slice(0,p+1)),g=()=>{let v;return f?v=S:E?v=b:m.route.Component?v=c.createElement(m.route.Component,null):m.route.element?v=m.route.element:v=h,c.createElement(Hs,{match:m,routeContext:{outlet:h,matches:P,isDataRoute:a!=null},children:v})};return a&&(m.route.ErrorBoundary||m.route.errorElement||p===0)?c.createElement(qs,{location:a.location,revalidation:a.revalidation,component:S,error:f,children:g(),routeContext:{outlet:null,matches:P,isDataRoute:!0}}):g()},null)}var ft=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(ft||{}),gt=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})(gt||{});function Gs(e){let t=c.useContext(Ue);return t||M(!1),t}function Ys(e){let t=c.useContext(zs);return t||M(!1),t}function Qs(e){let t=c.useContext(Y);return t||M(!1),t}function yt(e){let t=Qs(),a=t.matches[t.matches.length-1];return a.route.id||M(!1),a.route.id}function Js(){var e;let t=c.useContext(ht),a=Ys(),r=yt();return t!==void 0?t:(e=a.errors)==null?void 0:e[r]}function Xs(){let{router:e}=Gs(ft.UseNavigateStable),t=yt(gt.UseNavigateStable),a=c.useRef(!1);return mt(()=>{a.current=!0}),c.useCallback(function(n,o){o===void 0&&(o={}),a.current&&(typeof n=="number"?e.navigate(n):e.navigate(n,ce({fromRouteId:t},o)))},[e,t])}const Ye={};function Zs(e,t,a){Ye[e]||(Ye[e]=!0)}function ea(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function xe(e){let{to:t,replace:a,state:r,relative:n}=e;ne()||M(!1);let{future:o,static:i}=c.useContext(Z),{matches:d}=c.useContext(Y),{pathname:l}=ae(),u=ee(),h=Ie(t,De(d,o.v7_relativeSplatPath),l,n==="path"),m=JSON.stringify(h);return c.useEffect(()=>u(JSON.parse(m),{replace:a,state:r,relative:n}),[u,m,n,a,r]),null}function k(e){M(!1)}function ta(e){let{basename:t="/",children:a=null,location:r,navigationType:n=it.Pop,navigator:o,static:i=!1,future:d}=e;ne()&&M(!1);let l=t.replace(/^\/*/,"/"),u=c.useMemo(()=>({basename:l,navigator:o,static:i,future:ce({v7_relativeSplatPath:!1},d)}),[l,d,o,i]);typeof r=="string"&&(r=lt(r));let{pathname:h="/",search:m="",hash:p="",state:f=null,key:E="default"}=r,S=c.useMemo(()=>{let b=ct(h,l);return b==null?null:{location:{pathname:b,search:m,hash:p,state:f,key:E},navigationType:n}},[l,h,m,p,f,E,n]);return S==null?null:c.createElement(Z.Provider,{value:u},c.createElement(we.Provider,{children:a,value:S}))}function sa(e){let{children:t,location:a}=e;return Vs(Pe(t),a)}new Promise(()=>{});function Pe(e,t){t===void 0&&(t=[]);let a=[];return c.Children.forEach(e,(r,n)=>{if(!c.isValidElement(r))return;let o=[...t,n];if(r.type===c.Fragment){a.push.apply(a,Pe(r.props.children,o));return}r.type!==k&&M(!1),!r.props.index||!r.props.children||M(!1);let i={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=Pe(r.props.children,o)),a.push(i)}),a}function _e(){return _e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},_e.apply(this,arguments)}function aa(e,t){if(e==null)return{};var a={},r=Object.keys(e),n,o;for(o=0;o<r.length;o++)n=r[o],!(t.indexOf(n)>=0)&&(a[n]=e[n]);return a}function ra(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function na(e,t){return e.button===0&&(!t||t==="_self")&&!ra(e)}function Ae(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,a)=>{let r=e[a];return t.concat(Array.isArray(r)?r.map(n=>[a,n]):[[a,r]])},[]))}function oa(e,t){let a=Ae(e);return t&&t.forEach((r,n)=>{a.has(n)||t.getAll(n).forEach(o=>{a.append(n,o)})}),a}const ia=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],la="6";try{window.__reactRouterVersion=la}catch{}const ca="startTransition",Qe=Lt[ca];function da(e){let{basename:t,children:a,future:r,window:n}=e,o=c.useRef();o.current==null&&(o.current=Cs({window:n,v5Compat:!0}));let i=o.current,[d,l]=c.useState({action:i.action,location:i.location}),{v7_startTransition:u}=r||{},h=c.useCallback(m=>{u&&Qe?Qe(()=>l(m)):l(m)},[l,u]);return c.useLayoutEffect(()=>i.listen(h),[i,h]),c.useEffect(()=>ea(r),[r]),c.createElement(ta,{basename:t,children:a,location:d.location,navigationType:d.action,navigator:i,future:r})}const ua=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ha=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,le=c.forwardRef(function(t,a){let{onClick:r,relative:n,reloadDocument:o,replace:i,state:d,target:l,to:u,preventScrollReset:h,viewTransition:m}=t,p=aa(t,ia),{basename:f}=c.useContext(Z),E,S=!1;if(typeof u=="string"&&ha.test(u)&&(E=u,ua))try{let v=new URL(window.location.href),A=u.startsWith("//")?new URL(v.protocol+u):new URL(u),I=ct(A.pathname,f);A.origin===v.origin&&I!=null?u=I+A.search+A.hash:S=!0}catch{}let b=Fs(u,{relative:n}),P=ma(u,{replace:i,state:d,target:l,preventScrollReset:h,relative:n,viewTransition:m});function g(v){r&&r(v),v.defaultPrevented||P(v)}return c.createElement("a",_e({},p,{href:E||b,onClick:S||o?r:g,ref:a,target:l}))});var Je;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Je||(Je={}));var Xe;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Xe||(Xe={}));function ma(e,t){let{target:a,replace:r,state:n,preventScrollReset:o,relative:i,viewTransition:d}=t===void 0?{}:t,l=ee(),u=ae(),h=pt(e,{relative:i});return c.useCallback(m=>{if(na(m,a)){m.preventDefault();let p=r!==void 0?r:Ke(u)===Ke(h);l(e,{replace:p,state:n,preventScrollReset:o,relative:i,viewTransition:d})}},[u,l,h,r,n,a,e,o,i,d])}function So(e){let t=c.useRef(Ae(e)),a=c.useRef(!1),r=ae(),n=c.useMemo(()=>oa(r.search,a.current?null:t.current),[r.search]),o=ee(),i=c.useCallback((d,l)=>{const u=Ae(typeof d=="function"?d(n):d);a.current=!0,o("?"+u,l)},[o,n]);return[n,i]}const de=Me()(ze(Fe(Rt(e=>({theme:"dark",language:"en",sidebarOpen:!0,notifications:[],setTheme:t=>{e({theme:t});const a=document.documentElement;if(t==="system"){const r=window.matchMedia("(prefers-color-scheme: dark)").matches;a.classList.remove("light","dark"),a.classList.add(r?"dark":"light"),a.setAttribute("data-theme",r?"dark":"light")}else a.classList.remove("light","dark"),a.classList.add(t),a.setAttribute("data-theme",t)},setLanguage:t=>{e({language:t}),typeof window<"u"&&window.i18n&&window.i18n.changeLanguage(t)},setSidebarOpen:t=>e({sidebarOpen:t}),addNotification:t=>{const a={...t,id:crypto.randomUUID(),timestamp:new Date().toISOString()};e(r=>({notifications:[...r.notifications,a]}))},removeNotification:t=>{e(a=>({notifications:a.notifications.filter(r=>r.id!==t)}))},markNotificationAsRead:t=>{e(a=>({notifications:a.notifications.map(r=>r.id===t?{...r,read:!0}:r)}))},clearNotifications:()=>e({notifications:[]})}),{channelName:"ui-store",enabled:!0,shouldSync:(e,t)=>e.theme!==t?.theme||e.language!==t?.language||e.sidebarOpen!==t?.sidebarOpen}),{name:"ui-storage",partialize:e=>({theme:e.theme,language:e.language,sidebarOpen:e.sidebarOpen})}),{name:"UIStore",enabled:!1}));class N extends c.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,a){this.setState({error:t,errorInfo:a});const r=Tt(),n={...r,component:"ErrorBoundary",errorType:t.name||"Error",errorMessage:t.message,stack:t.stack,componentStack:a.componentStack,url:typeof window<"u"?window.location.href:void 0,userAgent:typeof navigator<"u"?navigator.userAgent:void 0,timestamp:new Date().toISOString()};x.error("[ErrorBoundary] React error caught",n),typeof window<"u"&&Es(t,{contexts:{react:{componentStack:a.componentStack},application:{...r,url:window.location.href,userAgent:navigator.userAgent}},tags:{error_boundary:!0,error_type:t.name||"Error",...r.request_id?{request_id:String(r.request_id)}:{}},level:"error"})}handleReset=()=>{this.setState({hasError:!1,error:void 0,errorInfo:void 0})};render(){return this.state.hasError?this.props.fallback?this.props.fallback:s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900 p-4",children:s.jsx("div",{className:"w-full max-w-md",children:s.jsx(It,{error:this.state.error||new Error("Une erreur inattendue s'est produite"),variant:"card",severity:"error",size:"lg",showDetails:!1,context:{component:"ErrorBoundary",action:"rendering component",componentStack:this.state.errorInfo?.componentStack},onRetry:this.handleReset,actions:[{label:"Retour à l'accueil",onClick:()=>{window.location.href="/"},variant:"outline"}]})})}):this.props.children}}const pa=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),fa=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,r)=>r?r.toUpperCase():a.toLowerCase()),Ze=e=>{const t=fa(e);return t.charAt(0).toUpperCase()+t.slice(1)},xt=(...e)=>e.filter((t,a,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===a).join(" ").trim(),ga=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var ya={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const xa=c.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:n="",children:o,iconNode:i,...d},l)=>c.createElement("svg",{ref:l,...ya,width:t,height:t,stroke:e,strokeWidth:r?Number(a)*24/Number(t):a,className:xt("lucide",n),...!o&&!ga(d)&&{"aria-hidden":"true"},...d},[...i.map(([u,h])=>c.createElement(u,h)),...Array.isArray(o)?o:[o]]));const ue=(e,t)=>{const a=c.forwardRef(({className:r,...n},o)=>c.createElement(xa,{ref:o,iconNode:t,className:xt(`lucide-${pa(Ze(e))}`,`lucide-${e}`,r),...n}));return a.displayName=Ze(e),a};const va=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],ba=ue("bell",va);const wa=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],ka=ue("ellipsis-vertical",wa);const ja=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],Na=ue("music",ja);const Sa=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Ca=ue("play",Sa);const Ea=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Pa=ue("search",Ea);function F(...e){return Ps(_s(e))}var vt=z.forwardRef(({variant:e="primary",size:t="md",icon:a,children:r,className:n,...o},i)=>{const d="relative inline-flex items-center justify-center font-body font-medium transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-kodo-void rounded-lg",l={sm:"text-xs px-3 py-1.5 gap-2",md:"text-sm px-5 py-2.5 gap-2",lg:"text-base px-8 py-3.5 gap-3",icon:"p-2.5"},u={primary:"bg-gradient-to-r from-kodo-cyan-dim to-kodo-cyan text-kodo-void hover:shadow-lg hover:shadow-kodo-cyan/20 border border-transparent font-bold tracking-wide",secondary:"bg-transparent border border-kodo-magenta/50 text-kodo-magenta hover:bg-kodo-magenta/5 hover:border-kodo-magenta hover:text-white",ghost:"bg-transparent text-gray-400 hover:text-white hover:bg-white/5",gaming:"bg-kodo-slate border border-kodo-gold/40 text-kodo-gold hover:bg-kodo-gold/10 hover:border-kodo-gold font-bold tracking-wider uppercase",terminal:"bg-kodo-ink border border-kodo-steel text-gray-300 font-mono text-xs hover:border-kodo-cyan hover:text-kodo-cyan",nature:"bg-kodo-slate border border-kodo-lime/30 text-kodo-lime hover:bg-kodo-lime/10",icon:"bg-transparent hover:bg-white/10 text-gray-400 hover:text-white rounded-full p-2"},h=e==="icon"?F(d,u.icon,n):F(d,l[t],u[e],n);return s.jsxs("button",{ref:i,className:h,...o,children:[a&&s.jsx("span",{className:r?"":"flex items-center justify-center",children:a}),r&&s.jsx("span",{children:r})]})});vt.displayName="Button";var _a=z.forwardRef(({variant:e="default",children:t,className:a,onClick:r},n)=>{const o="relative transition-all duration-300 rounded-xl",i={default:"bg-kodo-graphite border border-kodo-steel/60 p-6 shadow-sm hover:border-kodo-steel",manga:"bg-gradient-to-br from-kodo-graphite to-kodo-slate border border-kodo-magenta/20 p-6 hover:border-kodo-magenta/40 hover:shadow-neon-magenta/10",gaming:"bg-kodo-ink border border-kodo-cyan/20 p-6 hover:border-kodo-cyan/40 hover:shadow-neon-cyan/10",glass:"bg-kodo-slate/40 backdrop-blur-xl border border-white/5 p-6 hover:bg-kodo-slate/50"};return s.jsx("div",{ref:n,className:F(o,i[e],r&&"cursor-pointer",a),onClick:r,children:t})});_a.displayName="Card";var Aa=z.forwardRef(({label:e,icon:t,className:a,...r},n)=>s.jsxs("div",{className:"w-full",children:[e&&s.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-2 font-body",children:e}),s.jsxs("div",{className:"relative",children:[t&&s.jsx("div",{className:"absolute left-4 top-1/2 -translate-y-1/2 text-gray-500 pointer-events-none",children:t}),s.jsx("input",{ref:n,className:F("w-full py-3 bg-kodo-graphite border border-kodo-steel text-white placeholder-gray-500 font-body text-base rounded-lg focus:outline-none focus:border-kodo-cyan focus:ring-1 focus:ring-kodo-cyan transition-all duration-200",t?"pl-11 pr-4":"px-4",a),...r})]})]}));Aa.displayName="Input";var La=z.forwardRef((e,t)=>s.jsxs("div",{className:"relative w-full group",children:[s.jsx("input",{ref:t,type:"search",className:"w-full pl-12 pr-4 py-3 bg-kodo-graphite border border-kodo-steel text-white placeholder-gray-500 rounded-full focus:outline-none focus:border-kodo-cyan focus:ring-1 focus:ring-kodo-cyan focus:shadow-neon-cyan transition-all duration-300",placeholder:"Search platform...",...e}),s.jsx(Pa,{className:"absolute left-4 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500 group-focus-within:text-kodo-cyan transition-colors"})]}));La.displayName="SearchInput";var Co=({value:e,max:t=100,variant:a="default",color:r="cyan",labelLeft:n,labelRight:o,className:i})=>{const d=Math.min(100,Math.max(0,e/t*100)),l={cyan:"bg-kodo-cyan",magenta:"bg-kodo-magenta",lime:"bg-kodo-lime",gold:"bg-kodo-gold"},u={gold:"from-kodo-gold to-orange-500"};return a==="gaming"?s.jsxs("div",{className:F("relative",i),children:[s.jsx("div",{className:"h-4 bg-kodo-void rounded-full overflow-hidden border border-kodo-gold/30",children:s.jsx("div",{className:F("h-full bg-gradient-to-r shadow-[0_0_10px_rgba(255,215,0,0.5)] transition-all duration-500",u.gold),style:{width:`${d}%`}})}),(n||o)&&s.jsxs("div",{className:"flex justify-between text-[10px] font-mono font-bold text-kodo-gold mt-1 uppercase tracking-wider",children:[s.jsx("span",{children:n}),s.jsx("span",{children:o})]})]}):s.jsxs("div",{className:F("w-full",i),children:[s.jsx("div",{className:"h-2 bg-kodo-steel rounded-full overflow-hidden",children:s.jsx("div",{className:F("h-full transition-all duration-300 shadow-[0_0_10px_currentColor]",l[r]),style:{width:`${d}%`}})}),(n||o)&&s.jsxs("div",{className:"flex justify-between text-xs text-gray-500 mt-1 font-mono",children:[s.jsx("span",{children:n}),s.jsx("span",{children:o})]})]})},Ra=z.forwardRef(({title:e,value:t,change:a,icon:r,color:n="cyan",className:o},i)=>{const d={cyan:"text-kodo-cyan",lime:"text-kodo-lime",magenta:"text-kodo-magenta",gold:"text-kodo-gold",orange:"text-kodo-orange"};return s.jsxs("div",{ref:i,className:F("bg-kodo-graphite border border-kodo-steel/60 p-6 rounded-xl hover:border-kodo-cyan/40 transition-all duration-300",o),children:[s.jsxs("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx("h3",{className:"text-sm font-medium text-kodo-secondary",children:e}),r&&s.jsx("div",{className:F("h-4 w-4",d[n]),children:r})]}),s.jsxs("div",{className:"mt-4",children:[s.jsx("div",{className:"text-2xl font-bold text-white",children:t}),a&&s.jsxs("p",{className:"text-xs text-kodo-secondary mt-1",children:[s.jsx("span",{className:"text-kodo-lime",children:a})," par rapport au mois dernier"]})]})]})});Ra.displayName="StatCard";var Ta=z.forwardRef(({tracks:e,onTrackClick:t,onPlayClick:a,onMoreClick:r,className:n},o)=>e.length===0?s.jsx("div",{ref:o,className:F("text-center py-8",n),children:s.jsx("p",{className:"text-kodo-secondary text-sm",children:"Aucune piste disponible"})}):s.jsx("div",{ref:o,className:F("space-y-2",n),children:e.map(i=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-kodo-graphite/50 hover:bg-kodo-slate/50 transition-all group cursor-pointer",onClick:()=>t?.(i),children:[s.jsxs("div",{className:"relative w-12 h-12 rounded bg-kodo-slate flex items-center justify-center flex-shrink-0",children:[i.coverUrl?s.jsx("img",{src:i.coverUrl,alt:i.title,className:"w-full h-full object-cover rounded"}):s.jsx(Na,{className:"w-5 h-5 text-kodo-cyan"}),s.jsx("button",{onClick:d=>{d.stopPropagation(),a?.(i)},className:"absolute inset-0 flex items-center justify-center bg-black/60 opacity-0 group-hover:opacity-100 transition-opacity rounded",children:s.jsx(Ca,{className:"w-5 h-5 text-white fill-current"})})]}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium text-white truncate",children:i.title}),i.artist&&s.jsx("p",{className:"text-xs text-kodo-secondary truncate",children:i.artist})]}),i.duration&&s.jsx("span",{className:"text-xs text-kodo-secondary font-mono",children:i.duration}),r&&s.jsx("button",{onClick:d=>{d.stopPropagation(),r(i)},className:"p-2 rounded-lg hover:bg-kodo-steel/30 opacity-0 group-hover:opacity-100 transition-opacity",children:s.jsx(ka,{className:"w-4 h-4 text-kodo-secondary"})})]},i.id))}));Ta.displayName="TrackList";var Ia=z.forwardRef(({count:e=0,className:t},a)=>s.jsxs("div",{ref:a,className:F("relative inline-block",t),children:[s.jsx(ba,{className:"w-5 h-5 text-kodo-secondary hover:text-kodo-primary transition-colors"}),e>0&&s.jsx("span",{className:"absolute -top-1 -right-1 w-4 h-4 bg-kodo-red rounded-full flex items-center justify-center text-[10px] font-bold text-white border border-kodo-void",children:e>9?"9+":e})]}));Ia.displayName="NotificationBadge";var Da=z.forwardRef(({src:e,alt:t="Avatar",fallback:a,size:r="md",className:n},o)=>{const i={sm:"w-8 h-8 text-xs",md:"w-10 h-10 text-sm",lg:"w-12 h-12 text-base"};return s.jsx("div",{ref:o,className:F("rounded-full overflow-hidden bg-kodo-slate flex items-center justify-center",i[r],n),children:e?s.jsx("img",{src:e,alt:t,className:"w-full h-full object-cover"}):s.jsx("span",{className:"font-medium text-kodo-primary",children:a||t.charAt(0).toUpperCase()})})});Da.displayName="Avatar";class Oa{installPrompt=null;registration=null;statusCallbacks=new Set;constructor(){this.initialize()}async initialize(){await this.registerServiceWorker(),this.setupInstallPrompt(),this.setupOnlineDetection(),this.checkForUpdates()}async registerServiceWorker(){x.info("[PWA] Service Worker disabled to prevent cache conflicts with JS chunks")}setupInstallPrompt(){window.addEventListener("beforeinstallprompt",t=>{t.preventDefault(),this.installPrompt=t,x.info("[PWA] Install prompt available"),this.notifyStatusChange()}),window.addEventListener("appinstalled",()=>{x.info("[PWA] App installed successfully"),this.installPrompt=null,this.notifyStatusChange()})}setupOnlineDetection(){window.addEventListener("online",()=>{x.info("[PWA] Back online"),this.notifyStatusChange()}),window.addEventListener("offline",()=>{x.info("[PWA] Gone offline"),this.notifyStatusChange()})}async checkForUpdates(){if(this.registration)try{await this.registration.update()}catch(t){x.error("[PWA] Failed to check for updates:",{error:t})}}async promptInstall(){if(!this.installPrompt)return x.warn("[PWA] Install prompt not available"),!1;try{return await this.installPrompt.prompt(),(await this.installPrompt.userChoice).outcome==="accepted"?(x.info("[PWA] User accepted install prompt"),this.installPrompt=null,!0):(x.info("[PWA] User dismissed install prompt"),!1)}catch(t){return x.error("[PWA] Install prompt failed:",{error:t}),!1}}async updateServiceWorker(){this.registration&&this.registration.waiting&&(this.registration.waiting.postMessage({type:"SKIP_WAITING"}),window.location.reload())}getStatus(){return{isInstallable:!!this.installPrompt,isInstalled:this.isAppInstalled(),isOnline:navigator.onLine,serviceWorkerReady:!!this.registration,updateAvailable:!!this.registration?.waiting}}isAppInstalled(){return window.matchMedia("(display-mode: standalone)").matches||window.navigator.standalone||document.referrer.includes("android-app://")}onStatusChange(t){return this.statusCallbacks.add(t),()=>{this.statusCallbacks.delete(t)}}notifyStatusChange(){const t=this.getStatus();this.statusCallbacks.forEach(a=>{try{a(t)}catch(r){x.error("[PWA] Status callback error:",{error:r})}})}async clearCaches(){if(this.registration){const t=new MessageChannel;return new Promise(a=>{t.port1.onmessage=r=>{r.data.type==="CACHE_CLEARED"&&a()},this.registration.active?.postMessage({type:"CLEAR_CACHE"},[t.port2])})}}async getVersion(){if(this.registration&&this.registration.active){const t=new MessageChannel;return new Promise(a=>{t.port1.onmessage=r=>{r.data.type==="VERSION"&&a(r.data.payload.version)},this.registration.active.postMessage({type:"GET_VERSION"},[t.port2])})}return"unknown"}async showNotification(t,a){"Notification"in window&&Notification.permission==="granted"&&this.registration&&await this.registration.showNotification(t,{icon:"/icons/icon-192x192.png",badge:"/icons/badge-72x72.png",...a})}async requestNotificationPermission(){return"Notification"in window?await Notification.requestPermission():"denied"}}const H=new Oa;function Ma(){const[e,t]=c.useState(H.getStatus()),[a,r]=c.useState(!1),[n,o]=c.useState(!1);c.useEffect(()=>{const p=H.onStatusChange(t);return t(H.getStatus()),p},[]);const i=async()=>{if(!e.isInstallable||a)return!1;r(!0);try{return await H.promptInstall()}catch(p){return x.error("[PWA Hook] Install failed",{error:p instanceof Error?p.message:String(p),stack:p instanceof Error?p.stack:void 0}),!1}finally{r(!1)}},d=async()=>{if(!(!e.updateAvailable||n)){o(!0);try{await H.updateServiceWorker()}catch(p){x.error("[PWA Hook] Update failed",{error:p instanceof Error?p.message:String(p),stack:p instanceof Error?p.stack:void 0})}finally{o(!1)}}},l=async()=>await H.requestNotificationPermission(),u=async(p,f)=>await H.showNotification(p,f),h=async()=>await H.clearCaches(),m=async()=>await H.getVersion();return{...e,hasServiceWorker:e.serviceWorkerReady,isInstalling:a,isUpdating:n,install:i,update:d,requestNotifications:l,showNotification:u,clearCaches:h,getVersion:m,canInstall:e.isInstallable&&!a,canUpdate:e.updateAvailable&&!n,isOffline:!e.isOnline}}function za(){const{isInstallable:e,isInstalled:t,install:a,isInstalling:r}=Ma(),[n,o]=c.useState(!1),[i,d]=c.useState(!1);c.useEffect(()=>{o(e&&!t&&!i)},[e,t,i]);const l=async()=>{await a()&&o(!1)},u=()=>{d(!0),o(!1),sessionStorage.setItem("pwa-install-dismissed","true")};return c.useEffect(()=>{const h=sessionStorage.getItem("pwa-install-dismissed")==="true";d(h)},[]),{showBanner:n,isInstalling:r,handleInstall:l,handleDismiss:u}}const Fa=(e,t,a,r)=>{const n=[a,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(n,"warn","react-i18next::",!0);se(n[0])&&(n[0]=`react-i18next:: ${n[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...n):console?.warn&&console.warn(...n)},et={},Le=(e,t,a,r)=>{se(a)&&et[a]||(se(a)&&(et[a]=new Date),Fa(e,t,a,r))},bt=(e,t)=>()=>{if(e.isInitialized)t();else{const a=()=>{setTimeout(()=>{e.off("initialized",a)},0),t()};e.on("initialized",a)}},Re=(e,t,a)=>{e.loadNamespaces(t,bt(e,a))},tt=(e,t,a,r)=>{if(se(a)&&(a=[a]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Re(e,a,r);a.forEach(n=>{e.options.ns.indexOf(n)<0&&e.options.ns.push(n)}),e.loadLanguages(t,bt(e,r))},Ua=(e,t,a={})=>!t.languages||!t.languages.length?(Le(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:a.lng,precheck:(r,n)=>{if(a.bindI18n&&a.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!n(r.isLanguageChangingTo,e))return!1}}),se=e=>typeof e=="string",Va=e=>typeof e=="object"&&e!==null,$a=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Ba={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Wa=e=>Ba[e],qa=e=>e.replace($a,Wa);let Te={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:qa};const Ha=(e={})=>{Te={...Te,...e}},Ka=()=>Te;let wt;const Ga=e=>{wt=e},Ya=()=>wt,Qa={type:"3rdParty",init(e){Ha(e.options.react),Ga(e)}},Ja=c.createContext();class Xa{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(a=>{this.usedNamespaces[a]||(this.usedNamespaces[a]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const Za=(e,t)=>{const a=c.useRef();return c.useEffect(()=>{a.current=e},[e,t]),a.current},kt=(e,t,a,r)=>e.getFixedT(t,a,r),er=(e,t,a,r)=>c.useCallback(kt(e,t,a,r),[e,t,a,r]),jt=(e,t={})=>{const{i18n:a}=t,{i18n:r,defaultNS:n}=c.useContext(Ja)||{},o=a||r||Ya();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new Xa),!o){Le(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const A=(D,O)=>se(O)?O:Va(O)&&se(O.defaultValue)?O.defaultValue:Array.isArray(D)?D[D.length-1]:D,I=[A,{},!1];return I.t=A,I.i18n={},I.ready=!1,I}o.options.react?.wait&&Le(o,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const i={...Ka(),...o.options.react,...t},{useSuspense:d,keyPrefix:l}=i;let u=n||o.options?.defaultNS;u=se(u)?[u]:u||["translation"],o.reportNamespaces.addUsedNamespaces?.(u);const h=(o.isInitialized||o.initializedStoreOnce)&&u.every(A=>Ua(A,o,i)),m=er(o,t.lng||null,i.nsMode==="fallback"?u:u[0],l),p=()=>m,f=()=>kt(o,t.lng||null,i.nsMode==="fallback"?u:u[0],l),[E,S]=c.useState(p);let b=u.join();t.lng&&(b=`${t.lng}${b}`);const P=Za(b),g=c.useRef(!0);c.useEffect(()=>{const{bindI18n:A,bindI18nStore:I}=i;g.current=!0,!h&&!d&&(t.lng?tt(o,t.lng,u,()=>{g.current&&S(f)}):Re(o,u,()=>{g.current&&S(f)})),h&&P&&P!==b&&g.current&&S(f);const D=()=>{g.current&&S(f)};return A&&o?.on(A,D),I&&o?.store.on(I,D),()=>{g.current=!1,o&&A&&A?.split(" ").forEach(O=>o.off(O,D)),I&&o&&I.split(" ").forEach(O=>o.store.off(O,D))}},[o,b]),c.useEffect(()=>{g.current&&h&&S(p)},[o,l,h]);const v=[E,o,h];if(v.t=E,v.i18n=o,v.ready=h,h||!h&&!d)return v;throw new Promise(A=>{t.lng?tt(o,t.lng,u,()=>A()):Re(o,u,()=>A())})};function tr(){const{showBanner:e,isInstalling:t,handleInstall:a,handleDismiss:r}=za(),{t:n}=jt();return e?s.jsx("div",{className:V("fixed bottom-8 right-8 z-50 w-80 glass-hud rounded-2xl border-white/10 p-5 shadow-2xl animate-slideInRight hud-corner group overflow-hidden","before:absolute before:inset-0 before:bg-gradient-to-br before:from-kodo-cyan/5 before:to-transparent before:opacity-0 group-hover:before:opacity-100 before:transition-opacity"),children:s.jsxs("div",{className:"flex flex-col gap-4 relative z-10",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx("div",{className:"w-8 h-8 rounded-lg bg-kodo-cyan/10 flex items-center justify-center border border-kodo-cyan/30 animate-pulse-glow",children:s.jsx(Dt,{className:"h-4 w-4 text-kodo-cyan"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-hud",children:"System.Uplink"}),s.jsx("h3",{className:"font-display font-black text-xs text-white uppercase tracking-wider",children:n("pwa.install.title","Native_Access")})]})]}),s.jsx("button",{onClick:r,className:"p-1 px-2 rounded-md bg-white/5 text-kodo-secondary hover:text-white transition-all text-[10px] font-mono border border-transparent hover:border-white/10",children:"DISMISS"})]}),s.jsx("p",{className:"text-[11px] font-mono text-white/50 leading-relaxed uppercase tracking-tighter",children:n("pwa.install.description","ESTABLISH_LOCAL_UPLINK_FOR_LOW_LATENCY_OPERATIONS")}),s.jsx("div",{className:"flex gap-2",children:s.jsxs(vt,{variant:"gaming",className:"flex-1 h-9 text-[10px] font-black font-mono tracking-widest bg-kodo-cyan group hover:shadow-neon-cyan/40 transition-shadow",onClick:a,disabled:t,children:[s.jsx(Ot,{className:"h-3.5 w-3.5 mr-2 group-hover:translate-y-0.5 transition-transform"}),t?"RUNNING...":"INITIATE_INSTALL"]})}),s.jsx("div",{className:"absolute -bottom-8 -right-8 w-16 h-16 bg-kodo-cyan/10 blur-2xl rounded-full"})]})}):null}function sr(){const[e,t]=c.useState(()=>typeof navigator<"u"?navigator.onLine:!0);return c.useEffect(()=>{const a=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",a),window.addEventListener("offline",r),()=>{window.removeEventListener("online",a),window.removeEventListener("offline",r)}},[]),e}let Ve=null,ve=null;const ar=3e4;function rr(e){const t=Mt(e);(t==="network"||t==="timeout")&&(Ve=e instanceof Error||e&&typeof e=="object"&&"message"in e?e:new Error(String(e)),ve=Date.now())}function Nt(){Ve=null,ve=null}function St(){return!Ve||!ve?!1:Date.now()-ve>ar?(Nt(),!1):!0}const Eo=Object.freeze(Object.defineProperty({__proto__:null,clearNetworkError:Nt,hasRecentNetworkError:St,recordNetworkError:rr},Symbol.toStringTag,{value:"Module"}));function nr(){const e=sr(),[t,a]=c.useState(0),[r,n]=c.useState(!1),[o,i]=c.useState(!1);return c.useEffect(()=>{const d=()=>{a(We.getQueueSize())};d();const l=setInterval(d,1e3);return()=>clearInterval(l)},[]),c.useEffect(()=>{if(e&&t>0){n(!0);const d=setInterval(()=>{We.getQueueSize()===0&&(n(!1),clearInterval(d))},500);return()=>clearInterval(d)}else{n(!1);return}},[e,t]),c.useEffect(()=>{const d=()=>{i(St())};d();const l=setInterval(d,2e3);return()=>clearInterval(l)},[]),e&&t===0&&!r&&!o?null:!e||o?s.jsxs("div",{className:"fixed top-0 left-0 right-0 bg-kodo-red/90 backdrop-blur-sm text-white px-4 py-2.5 text-sm z-50 flex items-center justify-center gap-2 shadow-lg border-b border-kodo-red",children:[s.jsx(zt,{className:"w-4 h-4"}),s.jsxs("span",{children:["Mode hors ligne",t>0&&s.jsxs("span",{className:"ml-2 font-semibold",children:["- ",t," ",t===1?"requête":"requêtes"," en attente"]})]})]}):r&&t>0?s.jsxs("div",{className:"fixed top-0 left-0 right-0 bg-kodo-cyan/90 backdrop-blur-sm text-kodo-void px-4 py-2.5 text-sm z-50 flex items-center justify-center gap-2 shadow-lg border-b border-kodo-cyan",children:[s.jsx(ge,{className:"w-4 h-4 animate-spin"}),s.jsxs("span",{children:["Synchronisation en cours",t>0&&s.jsxs("span",{className:"ml-2 font-semibold",children:["- ",t," ",t===1?"requête":"requêtes"," restante",t>1?"s":""]})]})]}):null}function L({children:e}){const{isAuthenticated:t,user:a}=ut(),[r,n]=c.useState(!0),o=!!be.getAccessToken(),{isLoading:i}=G();return c.useEffect(()=>{const l=setTimeout(()=>{n(!1)},200);return()=>clearTimeout(l)},[]),r||i?null:t||o&&a?s.jsx(s.Fragment,{children:e}):s.jsx(xe,{to:"/login",replace:!0})}function $e(){const{i18n:e,t}=jt(),{language:a,setLanguage:r}=de(),n=o=>{e.changeLanguage(o),r(o)};return{t,i18n:{...e,changeLanguage:async o=>{await e.changeLanguage(o)},isInitialized:e.isInitialized},language:a,changeLanguage:n,isReady:e.isInitialized}}function or({verified:e}){return e?s.jsx("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",children:"✓ Email Verified"}):s.jsx("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",children:"⚠ Email Not Verified"})}async function ir(e){try{const t=new URLSearchParams;e?.read!==void 0&&t.append("read",e.read.toString()),e?.type&&t.append("type",e.type),e?.page&&t.append("page",e.page.toString()),e?.limit&&t.append("limit",e.limit.toString());const a=await T.get(`/notifications?${t.toString()}`);return{notifications:a.data.notifications||[],total:a.data.total,page:a.data.page||e?.page||1,limit:a.data.limit||e?.limit||20,totalPages:a.data.totalPages,unreadCount:a.data.unread_count}}catch(t){throw t instanceof Oe?new Error(t.response?.data?.error||t.message||"Failed to fetch notifications"):t}}async function lr(e){try{await T.post(`/notifications/${e}/read`)}catch(t){throw t instanceof Oe?new Error(t.response?.data?.error||t.message||"Failed to mark notification as read"):t}}async function cr(){try{await T.post("/notifications/read-all")}catch(e){throw e instanceof Oe?new Error(e.response?.data?.error||e.message||"Failed to mark all notifications as read"):e}}const dr=3e4,ur=50;function hr({className:e}={}){const[t,a]=c.useState(!1),r=c.useRef(null),n=ee(),o=st(),{success:i,error:d}=Ft(),{data:l,isLoading:u,refetch:h}=Ut({queryKey:["notifications","menu"],queryFn:()=>ir({limit:ur}),refetchInterval:dr,staleTime:1e4}),m=l?.notifications||[],p=m.filter(g=>!g.read).length,f=qe({mutationFn:lr,onSuccess:()=>{o.invalidateQueries({queryKey:["notifications"]})},onError:g=>{d(g.message||"Erreur lors du marquage")}}),E=qe({mutationFn:cr,onSuccess:()=>{o.invalidateQueries({queryKey:["notifications"]}),i("Toutes les notifications ont été marquées comme lues")},onError:g=>{d(g.message||"Erreur lors du marquage")}});c.useEffect(()=>{function g(v){r.current&&!r.current.contains(v.target)&&a(!1)}return t&&document.addEventListener("mousedown",g),()=>{document.removeEventListener("mousedown",g)}},[t]);const S=g=>{f.mutate(g)},b=()=>{E.mutate()},P=g=>{g.read||S(g.id),g.link&&(n(g.link),a(!1))};return c.useEffect(()=>{t&&h()},[t,h]),s.jsxs("div",{className:"relative",ref:r,children:[s.jsxs(K,{variant:"ghost",size:"icon",className:"relative",onClick:()=>a(!t),"aria-label":"Notifications","aria-expanded":t,"aria-haspopup":"true",children:[s.jsx(He,{className:"h-5 w-5"}),p>0&&s.jsx("span",{className:"absolute -top-1 -right-1 h-5 w-5 bg-destructive rounded-full text-xs text-destructive-foreground flex items-center justify-center font-semibold","aria-label":`${p} notifications non lues`,children:p>9?"9+":p})]}),t&&s.jsxs("div",{className:"absolute right-0 mt-2 w-80 bg-background border rounded-lg shadow-lg z-50 max-h-[500px] flex flex-col",children:[s.jsxs("div",{className:"p-4 border-b flex items-center justify-between",children:[s.jsx("h3",{className:"font-semibold text-sm",children:"Notifications"}),s.jsx("div",{className:"flex items-center space-x-2",children:p>0&&s.jsxs(K,{variant:"ghost",size:"sm",onClick:b,className:"h-7 text-xs",disabled:E.isPending,children:[E.isPending?s.jsx(ge,{className:"h-3 w-3 mr-1 animate-spin"}):s.jsx(Vt,{className:"h-3 w-3 mr-1"}),"Tout marquer comme lu"]})})]}),s.jsx("div",{className:"overflow-y-auto flex-1",children:u?s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(ge,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):m.length===0?s.jsxs("div",{className:"p-8 text-center text-muted-foreground",children:[s.jsx(He,{className:"h-12 w-12 mx-auto mb-2 opacity-50"}),s.jsx("p",{className:"text-sm",children:"Aucune notification"})]}):s.jsx("div",{className:"divide-y",children:m.map(g=>s.jsx("div",{className:V("p-4 hover:bg-accent transition-colors cursor-pointer",!g.read&&"bg-accent/50"),onClick:()=>P(g),children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center space-x-2 mb-1",children:[!g.read&&s.jsx("span",{className:"h-2 w-2 bg-primary rounded-full flex-shrink-0 mt-1.5"}),s.jsx("p",{className:V("text-sm font-medium",!g.read&&"font-semibold"),children:g.title})]}),g.content&&s.jsx("p",{className:"text-sm text-muted-foreground mb-2 line-clamp-2",children:g.content}),s.jsx("p",{className:"text-xs text-muted-foreground",children:Rs(new Date(g.created_at),{addSuffix:!0,locale:Ts})})]}),s.jsx("div",{className:"flex items-center space-x-1 ml-2 shrink-0",children:!g.read&&s.jsx(K,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:v=>{v.stopPropagation(),S(g.id)},"aria-label":"Marquer comme lu",disabled:f.isPending,children:f.isPending?s.jsx(ge,{className:"h-3 w-3 animate-spin"}):s.jsx($t,{className:"h-3 w-3"})})})]})},g.id))})}),m.length>0&&s.jsx("div",{className:"p-3 border-t",children:s.jsx(K,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>{n("/notifications"),a(!1)},children:"Voir toutes les notifications"})})]})]})}function mr(e,t){const[a,r]=c.useState(e);return c.useEffect(()=>{const n=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(n)}},[e,t]),a}function pr(e,t){const a=()=>{if(typeof window>"u")return t;try{const d=window.localStorage.getItem(e);return d?JSON.parse(d):t}catch(d){return x.warn(`Error reading localStorage key "${e}"`,{error:d instanceof Error?d.message:String(d),stack:d instanceof Error?d.stack:void 0,key:e}),t}},[r,n]=c.useState(a),o=d=>{try{const l=d instanceof Function?d(r):d;n(l),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(l))}catch(l){x.warn(`Error setting localStorage key "${e}"`,{error:l instanceof Error?l.message:String(l),stack:l instanceof Error?l.stack:void 0,key:e})}},i=()=>{try{typeof window<"u"&&(window.localStorage.removeItem(e),n(t))}catch(d){x.warn(`Error removing localStorage key "${e}"`,{error:d instanceof Error?d.message:String(d),stack:d instanceof Error?d.stack:void 0,key:e})}};return c.useEffect(()=>{n(a())},[]),[r,o,i]}const fr="veza_search_history",gr=10;function yr({onSearch:e,onResultSelect:t,placeholder:a="Rechercher...",showSuggestions:r=!0,showHistory:n=!0,maxHistoryItems:o=gr,fetchSuggestions:i,className:d,debounceDelay:l=300}){const[u,h]=c.useState(""),[m,p]=c.useState([]),[f,E]=c.useState(!1),[S,b]=c.useState(!1),[P,g]=c.useState(-1),[v,A,I]=pr(fr,[]),D=c.useRef(null),O=c.useRef(null),Q=mr(u,l);c.useEffect(()=>{if(!Q.trim()||!i||!r){p([]),E(!1);return}E(!0),(async()=>{try{const w=await Promise.resolve(i(Q));p(w)}catch(w){x.error("Error fetching suggestions",{error:w instanceof Error?w.message:String(w),stack:w instanceof Error?w.stack:void 0,query:Q}),p([])}finally{E(!1)}})()},[Q,i,r]),c.useEffect(()=>{Q.trim()&&e(Q)},[Q,e]),c.useEffect(()=>{const y=w=>{D.current&&!D.current.contains(w.target)&&(b(!1),g(-1))};return document.addEventListener("mousedown",y),()=>{document.removeEventListener("mousedown",y)}},[]);const ke=y=>{const w=y.target.value;h(w),b(!0),g(-1)},je=()=>{(u.trim()||n&&v.length>0)&&b(!0)},Ne=y=>{const w=[...n&&u.trim()===""?v.slice(0,5):[],...m];switch(y.key){case"ArrowDown":y.preventDefault(),g(_=>_<w.length-1?_+1:_);break;case"ArrowUp":y.preventDefault(),g(_=>_>0?_-1:-1);break;case"Enter":if(y.preventDefault(),P>=0&&P<w.length)if(P<(n&&u.trim()===""?v.length:0)){const _=v[P];h(_),oe(_)}else{const _=P-(n&&u.trim()===""?Math.min(v.length,5):0),X=m[_];$(X)}else u.trim()&&oe(u);break;case"Escape":b(!1),g(-1),O.current?.blur();break}},oe=c.useCallback(y=>{y.trim()&&(n&&A(w=>{const _=w.filter(te=>te!==y);return[y,..._].slice(0,o)}),b(!1),e(y))},[e,n,A,o]),$=c.useCallback(y=>{h(y.title),b(!1),g(-1),t?.(y)},[t]),J=y=>{h(y),oe(y)},he=()=>{I()},me=()=>{h(""),p([]),b(!1),O.current?.focus()},W=y=>{switch(y){case"track":return s.jsx(Ht,{className:"h-4 w-4"});case"user":return s.jsx(Ee,{className:"h-4 w-4"});case"playlist":return s.jsx(qt,{className:"h-4 w-4"})}},B=c.useMemo(()=>{const y=[];return n&&u.trim()===""&&v.length>0&&y.push(...v.slice(0,5).map(w=>({type:"history",data:w}))),r&&m.length>0&&y.push(...m.map(w=>({type:"suggestion",data:w}))),y},[n,r,u,v,m]),re=S&&(B.length>0||f)&&(r||n&&u.trim()==="");return s.jsxs("div",{ref:D,className:V("relative w-full",d),children:[s.jsxs("div",{className:"relative",children:[s.jsx(at,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),s.jsx("input",{ref:O,type:"text",value:u,onChange:ke,onFocus:je,onKeyDown:Ne,placeholder:a,className:V("w-full rounded-md border border-input bg-background px-9 py-2 text-sm","placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50")}),u&&s.jsx("button",{type:"button",onClick:me,className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:s.jsx(Bt,{className:"h-4 w-4"})})]}),re&&s.jsxs("div",{className:"absolute z-50 mt-2 w-full rounded-md border bg-popover shadow-lg",children:[f&&s.jsx("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"Recherche en cours..."}),!f&&B.length===0&&u.trim()&&s.jsx("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"Aucun résultat trouvé"}),!f&&B.length>0&&s.jsxs("div",{className:"max-h-96 overflow-y-auto",children:[n&&u.trim()===""&&v.length>0&&s.jsxs("div",{className:"border-b p-2",children:[s.jsxs("div",{className:"flex items-center justify-between px-2 py-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"RÉCENTS"}),s.jsx(K,{variant:"ghost",size:"sm",onClick:he,className:"h-6 text-xs",children:"Effacer"})]}),v.slice(0,5).map((y,w)=>s.jsxs("button",{type:"button",onClick:()=>J(y),className:V("w-full px-3 py-2 text-left text-sm hover:bg-accent","flex items-center gap-2",P===w&&"bg-accent"),children:[s.jsx(Wt,{className:"h-4 w-4 text-muted-foreground"}),s.jsx("span",{className:"flex-1",children:y})]},w))]}),r&&m.length>0&&s.jsxs("div",{className:"p-2",children:[u.trim()&&s.jsx("div",{className:"px-2 py-1 text-xs font-medium text-muted-foreground",children:"SUGGESTIONS"}),m.map((y,w)=>{const _=(n&&u.trim()===""?Math.min(v.length,5):0)+w;return s.jsxs("button",{type:"button",onClick:()=>$(y),className:V("w-full px-3 py-2 text-left text-sm hover:bg-accent","flex items-center gap-3",P===_&&"bg-accent"),children:[s.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded bg-muted",children:W(y.type)}),s.jsxs("div",{className:"flex-1",children:[s.jsx("div",{className:"font-medium",children:y.title}),y.subtitle&&s.jsx("div",{className:"text-xs text-muted-foreground",children:y.subtitle})]})]},y.id)})]})]})]})]})}async function xr(e={}){const t=new URLSearchParams;e.pagination&&(e.pagination.page&&t.append("page",e.pagination.page.toString()),e.pagination.limit&&t.append("limit",e.pagination.limit.toString())),e.filters&&(e.filters.genre&&t.append("genre",e.filters.genre),e.filters.artist&&t.append("artist",e.filters.artist),e.filters.album&&t.append("album",e.filters.album),e.filters.minDuration&&t.append("min_duration",e.filters.minDuration.toString()),e.filters.maxDuration&&t.append("max_duration",e.filters.maxDuration.toString())),e.sort&&(t.append("sort_by",e.sort.field),t.append("sort_order",e.sort.order)),e.search&&t.append("search",e.search);const a=t.toString(),r=`/tracks${a?`?${a}`:""}`,n=await T.get(r),{tracks:o,total:i,page:d,limit:l,totalPages:u}=n.data,h=d||e.pagination?.page||1,m=l||e.pagination?.limit||o.length||10,p=u||Math.ceil(i/m)||1;return{data:o,total:i,page:h,limit:m,totalPages:p}}async function vr(e,t={}){return xr({...t,search:e})}const br={TWO_FACTOR_AUTH:!0,PLAYLIST_COLLABORATION:!0,PLAYLIST_SEARCH:!1,PLAYLIST_SHARE:!1,PLAYLIST_RECOMMENDATIONS:!1,HLS_STREAMING:!1,ROLE_MANAGEMENT:!1,NOTIFICATIONS:!1};function wr(e){return!!br[e]}function Be(e){if(!wr(e))throw new Error(`Feature "${e}" is not enabled. This feature is not available in the MVP.`)}async function Po(e){return(await T.post("/playlists",e)).data.playlist}async function kr(e){return(await T.get(`/playlists/${e}`)).data.playlist}async function _o(e,t){return(await T.put(`/playlists/${e}`,t)).data.playlist}async function Ao(e){await T.delete(`/playlists/${e}`)}async function Lo(e=1,t=20,a,r,n){const o=Math.max(t,1),d={page:Math.max(e,1),limit:o};return a&&(d.user_id=a),r&&(d.sort_by=r),n&&(d.sort_order=n),(await T.get("/playlists",{params:d})).data}async function Ro(e,t){return(await T.post(`/playlists/${e}/collaborators`,t)).data}async function To(e,t){await T.delete(`/playlists/${e}/collaborators/${t}`)}async function Io(e,t,a){await T.put(`/playlists/${e}/collaborators/${t}`,a)}async function jr(e){return Be("PLAYLIST_SEARCH"),(await T.get("/playlists/search",{params:e})).data}async function Do(e){return Be("PLAYLIST_SHARE"),(await T.post(`/playlists/${e}/share`)).data.share_link}async function Oo(e,t){await T.put(`/playlists/${e}/tracks/reorder`,t)}async function Mo(e){return Be("PLAYLIST_RECOMMENDATIONS"),Promise.resolve({recommendations:[]})}async function zo(e){return(await T.get(`/playlists/${e}/collaborators`)).data.collaborators||[]}async function Fo(e,t){await T.post(`/playlists/${e}/tracks`,{track_id:t})}async function Uo(e){return{message:(await T.post(`/playlists/${e}/follow`)).data.message||"Playlist followed",is_following:!0}}async function Vo(e){return{message:(await T.delete(`/playlists/${e}/follow`)).data.message||"Playlist unfollowed",is_following:!1}}async function $o(e){const t=await kr(e);return{is_following:t.is_following??!1,follower_count:t.follower_count??0}}async function Nr(e){const t=new URLSearchParams;e.query&&t.append("q",e.query),e.page&&t.append("page",e.page.toString()),e.limit&&t.append("limit",e.limit.toString());const a=await T.get(`/users/search?${t.toString()}`);return{users:a.data.users||[],total:a.data.total||0,page:e.page||1,limit:e.limit||20}}function Sr({className:e,placeholder:t,onSearch:a}){const r=ee(),{t:n}=$e(),o=c.useCallback(async l=>{if(!l.trim())return[];try{const[u,h,m]=await Promise.allSettled([vr(l,{pagination:{page:1,limit:3}}),jr({q:l,page:1,limit:3}),Nr({query:l,page:1,limit:3})]),p=[];return u.status==="fulfilled"&&u.value?.data&&u.value.data.forEach(f=>{p.push({id:f.id,type:"track",title:f.title,subtitle:f.artist?`by ${f.artist}`:void 0,image:f.cover_url})}),h.status==="fulfilled"&&h.value?.playlists&&h.value.playlists.forEach(f=>{p.push({id:f.id,type:"playlist",title:f.title,subtitle:f.is_public?"Public":"Private",image:f.cover_url})}),m.status==="fulfilled"&&m.value?.users&&m.value.users.forEach(f=>{p.push({id:f.id,type:"user",title:f.username,subtitle:f.email,image:f.avatar_url})}),p.slice(0,8)}catch(u){return x.error("Error fetching search suggestions",{error:u instanceof Error?u.message:String(u),stack:u instanceof Error?u.stack:void 0}),[]}},[]),i=c.useCallback(l=>{l.trim()&&(r(`/search?q=${encodeURIComponent(l)}`),a?.(l))},[r,a]),d=c.useCallback(l=>{switch(l.type){case"track":r(`/tracks/${l.id}`);break;case"playlist":r(`/playlists/${l.id}`);break;case"user":r(`/users/${l.id}`);break}},[r]);return s.jsx(yr,{onSearch:i,onResultSelect:d,fetchSuggestions:o,placeholder:t||n("common.search")||"Search tracks, playlists, users...",showSuggestions:!0,showHistory:!0,className:e,debounceDelay:500})}function Cr({content:e,children:t,position:a="top",trigger:r="hover",delay:n=200,showArrow:o=!0,maxWidth:i=300,disabled:d=!1,className:l}){const[u,h]=c.useState(!1),[m,p]=c.useState(!1),[f,E]=c.useState(a),[S,b]=c.useState({}),P=c.useRef(null),g=c.useRef(null),v=c.useRef(null),A=c.useRef(null),I=c.useCallback(()=>{if(!v.current||!A.current||!u)return;const $=v.current.getBoundingClientRect(),J=A.current.getBoundingClientRect(),he=window.innerWidth,me=window.innerHeight,W=8;let B=a,re=0,y=0;switch(a){case"top":$.top-J.height-W<0&&(B="bottom");break;case"bottom":$.bottom+J.height+W>me&&(B="top");break;case"left":$.left-J.width-W<0&&(B="right");break;case"right":$.right+J.width+W>he&&(B="left");break}if(B==="top"||B==="bottom"){const w=$.left+$.width/2,_=J.width/2,X=W,te=he-W;w-_<X?re=X-(w-_):w+_>te&&(re=te-(w+_))}else{const w=$.top+$.height/2,_=J.height/2,X=W,te=me-W;w-_<X?y=X-(w-_):w+_>te&&(y=te-(w+_))}E(B),b({...re!==0&&{transform:`translate(calc(-50% + ${re}px), 0)`},...y!==0&&{transform:`translate(0, calc(-50% + ${y}px))`}})},[a,u]);c.useEffect(()=>{u&&(p(!0),I())},[u,I]),c.useEffect(()=>{m&&u&&I()},[m,u,I]);const D=()=>{P.current&&clearTimeout(P.current),P.current=setTimeout(()=>{h(!0)},n)},O=()=>{P.current&&clearTimeout(P.current),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{h(!1)},100)},ke={hover:{onMouseEnter:D,onMouseLeave:O},click:{onClick:()=>{r==="click"&&h(!u)}},focus:{onFocus:D,onBlur:O}}[r],je={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"},Ne={top:"top-full left-1/2 -translate-x-1/2 border-t-kodo-ink border-l-transparent border-r-transparent border-b-transparent",bottom:"bottom-full left-1/2 -translate-x-1/2 border-b-kodo-ink border-l-transparent border-r-transparent border-t-transparent",left:"left-full top-1/2 -translate-y-1/2 border-l-kodo-ink border-t-transparent border-b-transparent border-r-transparent",right:"right-full top-1/2 -translate-y-1/2 border-r-kodo-ink border-t-transparent border-b-transparent border-l-transparent"};if(c.useEffect(()=>()=>{P.current&&clearTimeout(P.current),g.current&&clearTimeout(g.current)},[]),d)return s.jsx(s.Fragment,{children:t});const oe=s.jsx(s.Fragment,{children:m&&s.jsxs("div",{ref:A,className:V("absolute z-50 px-3 py-1.5 text-sm text-white bg-kodo-ink rounded-md shadow-lg","border border-kodo-steel pointer-events-none","transition-all duration-200",je[f],u?"opacity-100 scale-100":"opacity-0 scale-95",l),role:"tooltip",style:{maxWidth:`${i}px`,...S},children:[e,o&&s.jsx("div",{className:V("absolute w-0 h-0 border-4",Ne[f])})]})});return s.jsxs("div",{ref:v,className:"relative inline-block",...ke,children:[t,oe]})}function Er(e){const[t,a]=c.useState(!1),{logout:r}=G(),{data:n}=Kt(),{theme:o,setTheme:i}=de(),{t:d}=$e(),l=ee(),u=async()=>{await r(),l("/login")},h=()=>{i(o==="light"?"dark":o==="dark"?"system":"light")},m=()=>{switch(o){case"light":return s.jsx(Jt,{className:"h-4 w-4"});case"dark":return s.jsx(Qt,{className:"h-4 w-4"});default:return s.jsx(Yt,{className:"h-4 w-4"})}};return s.jsx("header",{className:"fixed top-0 left-0 right-0 h-16 px-6 mt-4 pointer-events-none",style:{zIndex:"var(--z-fixed)"},children:s.jsxs("div",{className:"max-w-[1700px] mx-auto w-full h-full glass-hud rounded-2xl border-white/10 flex items-center justify-between px-6 pointer-events-auto hud-corner shadow-neon-cyan/5 group",children:[s.jsxs("div",{className:"flex items-center gap-6",children:[s.jsxs(le,{to:"/dashboard",className:"flex items-center gap-3 active:scale-95 transition-transform",children:[s.jsx("div",{className:"w-10 h-10 bg-kodo-cyan/20 rounded-xl flex items-center justify-center border border-kodo-cyan/30 shadow-neon-cyan/20 animate-scan",children:s.jsx(rt,{className:"w-6 h-6 text-kodo-cyan animate-pulse-glow"})}),s.jsxs("div",{className:"hidden sm:block",children:[s.jsxs("h1",{className:"text-lg font-display font-bold text-white tracking-widest uppercase leading-tight",children:["Veza",s.jsx("span",{className:"text-kodo-cyan",children:"OS"})]}),s.jsx("div",{className:"text-[9px] font-mono text-kodo-cyan/50 tracking-[0.2em] uppercase -mt-0.5",children:"Core Network v2.4"})]})]}),s.jsxs("div",{className:"hidden xl:flex items-center gap-6 border-l border-white/10 pl-8 h-8",children:[s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{className:"text-hud",children:"Uplink Status"}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-kodo-lime animate-pulse"}),s.jsx("span",{className:"text-[11px] font-mono text-white opacity-90 uppercase tracking-tighter",children:"Connected"})]})]}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{className:"text-hud",children:"Node ID"}),s.jsxs("span",{className:"text-[11px] font-mono text-kodo-cyan opacity-90 uppercase truncate max-w-[80px]",children:["VZ-",n?.id?.slice(0,4)]})]})]})]}),s.jsxs("div",{className:"flex-1 max-w-lg mx-8 relative hidden md:block",children:[s.jsx(Sr,{className:"w-full bg-transparent border-none"}),s.jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 flex items-center gap-2 pointer-events-none opacity-50 group-hover:opacity-100 transition-opacity",children:s.jsx(at,{className:"w-4 h-4 text-kodo-cyan"})})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"hidden lg:flex items-center gap-1 mr-4 bg-kodo-cyan/5 border border-kodo-cyan/10 rounded-full px-3 py-1.5",children:[s.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-kodo-lime"}),s.jsx("span",{className:"text-[10px] font-mono text-kodo-cyan uppercase font-bold tracking-tight",children:"Active_Stream_OK"})]}),s.jsx(hr,{}),s.jsx(Cr,{content:d("common.changeTheme"),children:s.jsx(K,{variant:"ghost",size:"icon",onClick:h,className:"hover:bg-white/5 hover:text-kodo-cyan transition-all rounded-xl border border-transparent hover:border-white/5",children:m()})}),s.jsx("div",{className:"w-px h-6 bg-white/10 mx-1"}),s.jsxs("div",{className:"relative",children:[s.jsxs(K,{variant:"ghost",size:"sm",onClick:()=>a(!t),className:V("p-1 pr-3 rounded-xl gap-2 transition-all border border-transparent",t?"bg-kodo-cyan/10 border-kodo-cyan/30 text-kodo-cyan":"hover:bg-white/5"),children:[s.jsx("div",{className:"w-8 h-8 rounded-lg bg-kodo-graphite border border-white/10 flex items-center justify-center overflow-hidden",children:s.jsx(Ee,{className:"w-5 h-5 text-kodo-secondary"})}),s.jsxs("div",{className:"flex flex-col items-start hidden sm:flex",children:[s.jsx("span",{className:"text-xs font-bold text-white leading-none",children:n?.username}),s.jsx("span",{className:"text-[9px] font-mono text-kodo-secondary uppercase tracking-tighter",children:"Lvl 1 Operative"})]})]}),t&&s.jsx(Gt,{active:t,onEscape:()=>a(!1),children:s.jsxs("div",{className:"absolute right-0 mt-3 w-56 glass-hud rounded-2xl border-white/10 shadow-2xl z-50 p-2 animate-scaleIn hud-corner",children:[s.jsxs("div",{className:"px-4 py-3 border-b border-white/5 mb-2",children:[s.jsx("div",{className:"text-xs font-mono text-kodo-cyan opacity-50 uppercase tracking-widest mb-1",children:"User_Registry"}),s.jsx("div",{className:"text-sm font-bold text-white truncate",children:n?.email}),n&&!n.is_verified&&s.jsx("div",{className:"mt-2",children:s.jsx(or,{verified:!1})})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs(le,{to:"/profile",onClick:()=>a(!1),className:"flex items-center gap-3 px-3 py-2 text-sm text-kodo-secondary hover:text-kodo-cyan hover:bg-kodo-cyan/5 rounded-xl transition-all group",children:[s.jsx(Ee,{className:"w-4 h-4 group-hover:drop-shadow-[0_0_5px_rgba(102,252,241,0.5)]"}),s.jsx("span",{children:"System.Profile"})]}),s.jsxs(le,{to:"/settings",onClick:()=>a(!1),className:"flex items-center gap-3 px-3 py-2 text-sm text-kodo-secondary hover:text-kodo-cyan hover:bg-kodo-cyan/5 rounded-xl transition-all group",children:[s.jsx(nt,{className:"w-4 h-4 group-hover:rotate-45 transition-transform"}),s.jsx("span",{children:"Global.Settings"})]}),s.jsx("div",{className:"h-px bg-white/5 my-2 mx-2"}),s.jsxs("button",{onClick:u,className:"flex items-center gap-3 w-full px-3 py-2 text-sm text-red-400/80 hover:text-red-400 hover:bg-red-500/10 rounded-xl transition-all group",children:[s.jsx(ot,{className:"w-4 h-4"}),s.jsx("span",{children:"Terminate.Session"})]})]})]})})]})]})]})})}const Pr=[{section:"My Studio",items:[{id:"dashboard",label:"Command Center",icon:s.jsx(Xt,{className:"w-4 h-4"})},{id:"studio",label:"Cloud Files",icon:s.jsx(Zt,{className:"w-4 h-4"})},{id:"tracks",label:"Projects",icon:s.jsx(es,{className:"w-4 h-4"})},{id:"gear",label:"Gear Locker",icon:s.jsx(ts,{className:"w-4 h-4"})},{id:"analytics",label:"Performance",icon:s.jsx(ss,{className:"w-4 h-4"})}]},{section:"Veza Network",items:[{id:"social",label:"Community Feed",icon:s.jsx(as,{className:"w-4 h-4"})},{id:"marketplace",label:"Marketplace",icon:s.jsx(rs,{className:"w-4 h-4"})},{id:"live",label:"Live Sessions",icon:s.jsx(ns,{className:"w-4 h-4 text-kodo-red"}),badge:3},{id:"chat",label:"Channels",icon:s.jsx(os,{className:"w-4 h-4"}),badge:12},{id:"education",label:"Academy",icon:s.jsx(is,{className:"w-4 h-4"})}]},{section:"Commerce",items:[{id:"sell",label:"Seller Dashboard",icon:s.jsx(ls,{className:"w-4 h-4"})},{id:"wishlist",label:"Wishlist",icon:s.jsx(cs,{className:"w-4 h-4"})},{id:"purchases",label:"Purchases",icon:s.jsx(ds,{className:"w-4 h-4"})}]},{section:"Library",items:[{id:"playlists",label:"Playlists",icon:s.jsx(us,{className:"w-4 h-4"})},{id:"queue",label:"Play Queue",icon:s.jsx(hs,{className:"w-4 h-4"})}]},{section:"System",items:[{id:"developer",label:"Developer API",icon:s.jsx(ms,{className:"w-4 h-4"})},{id:"admin",label:"Admin Panel",icon:s.jsx(ps,{className:"w-4 h-4"})}]}],Ce={dashboard:"/dashboard",studio:"/library",tracks:"/library",gear:"/gear",analytics:"/analytics",social:"/social",marketplace:"/marketplace",live:"/live",chat:"/chat",education:"/education",sell:"/marketplace",wishlist:"/marketplace",purchases:"/marketplace",playlists:"/playlists",queue:"/queue",developer:"/developer",admin:"/admin",settings:"/settings"},_r=({currentView:e,onNavigate:t,onLogout:a})=>{const r=ee(),n=ae(),{logout:o}=G(),{sidebarOpen:i,setSidebarOpen:d}=de(),l=()=>{window.innerWidth<1024&&d(!1)},u=e||Object.keys(Ce).find(m=>Ce[m]===n.pathname)||"dashboard",h=()=>{o(),r("/login"),a&&a()};return s.jsxs(s.Fragment,{children:[i&&s.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm lg:hidden",style:{zIndex:"var(--z-modal-backdrop)"},onClick:()=>d(!1),"aria-hidden":"true"}),s.jsxs("aside",{role:"navigation","aria-label":"Sidebar",className:`
|
|
fixed left-6 top-24 bottom-6 w-64 glass-hud rounded-2xl border-white/10 flex flex-col transition-all duration-500 ease-in-out hud-corner
|
|
${i?"translate-x-0 opacity-100":"-translate-x-full lg:translate-x-0 lg:opacity-100 lg:w-20"}
|
|
`,style:{zIndex:"var(--z-fixed)"},children:[s.jsxs("div",{className:"p-6 border-b border-white/5 flex items-center gap-3",children:[s.jsx("div",{className:"w-8 h-8 rounded bg-kodo-cyan/20 flex items-center justify-center border border-kodo-cyan/30 animate-pulse-glow",children:s.jsx(rt,{className:"w-5 h-5 text-kodo-cyan"})}),i&&s.jsxs("div",{className:"animate-fadeIn",children:[s.jsx("h2",{className:"text-xs font-mono font-bold text-white tracking-widest uppercase",children:"System Hub"}),s.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[s.jsx("span",{className:"w-1 h-1 rounded-full bg-kodo-lime animate-pulse"}),s.jsx("span",{className:"text-[10px] font-mono text-kodo-lime opacity-80 uppercase",children:"Active"})]})]})]}),s.jsx("div",{className:"flex-1 overflow-y-auto custom-scrollbar p-3 space-y-6 mt-4",children:Pr.map((m,p)=>s.jsxs("div",{className:"mb-4",children:[i&&s.jsx("h3",{className:"text-[9px] font-mono font-bold text-kodo-cyan/60 uppercase tracking-[0.2em] mb-3 px-3 flex items-center gap-2 animate-fadeIn",children:m.section}),s.jsx("div",{className:"space-y-1",children:m.items.map(f=>{const E=Ce[f.id]||"/dashboard",S=u===f.id;return s.jsxs(le,{to:E,title:i?void 0:f.label,onClick:()=>{l(),t&&t(f.id)},className:V("w-full flex items-center px-4 py-2.5 rounded-xl text-sm font-medium transition-all duration-300 group relative overflow-hidden",S?"glass-hud-active text-kodo-cyan":"text-kodo-secondary hover:text-white hover:bg-white/5"),children:[S&&s.jsx("div",{className:"absolute left-0 top-1 bottom-1 w-1 bg-kodo-cyan rounded-full shadow-[0_0_10px_rgba(102,252,241,0.5)]"}),s.jsxs("div",{className:"flex items-center gap-3 relative z-10 w-full",children:[s.jsx("span",{className:V("transition-all duration-300 transform group-hover:scale-110",S?"text-kodo-cyan drop-shadow-[0_0_8px_rgba(102,252,241,0.4)]":"text-kodo-secondary"),children:f.icon}),i&&s.jsx("span",{className:"animate-fadeIn flex-1 truncate",children:f.label})]}),f.badge&&i&&s.jsx("span",{className:"ml-2 bg-kodo-magenta/20 text-kodo-magenta text-[9px] px-1.5 py-0.5 rounded-full font-mono font-bold border border-kodo-magenta/30",children:f.badge})]},f.id)})})]},p))}),s.jsxs("div",{className:"p-3 border-t border-white/5 bg-white/2",children:[s.jsxs(le,{to:"/settings",onClick:()=>{l(),t&&t("settings")},className:V("w-full flex items-center gap-3 px-4 py-2.5 text-sm rounded-xl transition-all",u==="settings"?"glass-hud-active text-kodo-cyan":"text-kodo-secondary hover:text-white hover:bg-white/5"),children:[s.jsx(nt,{className:"w-4 h-4"}),i&&s.jsx("span",{className:"animate-fadeIn",children:"Settings"})]}),s.jsxs("button",{onClick:h,className:"w-full flex items-center gap-3 px-4 py-2.5 text-red-400/80 hover:text-red-400 hover:bg-red-500/10 rounded-xl transition-all text-sm mt-1",children:[s.jsx(ot,{className:"w-4 h-4"}),i&&s.jsx("span",{className:"animate-fadeIn",children:"Initialize Signout"})]})]})]})]})};function Ar({children:e}){return s.jsxs("div",{className:"flex h-screen overflow-hidden",children:[s.jsx(_r,{}),s.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[s.jsx(Er,{}),s.jsx("main",{className:"flex-1 overflow-auto pb-24",children:e}),s.jsx(Is,{})]})]})}function Ct({pageName:e,error:t,onRetry:a}){return s.jsx("div",{className:"container mx-auto px-4 py-8",children:s.jsxs("div",{className:"max-w-2xl mx-auto",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx(gs,{className:"h-6 w-6 text-yellow-600"}),s.jsx("h1",{className:"text-2xl font-bold",children:e})]}),s.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 text-yellow-700 dark:text-yellow-300 px-4 py-3 rounded-lg mb-4",children:[s.jsxs("p",{className:"font-medium mb-2",children:["Failed to load ",e]}),t&&s.jsx("p",{className:"text-sm opacity-75",children:t.message||"An error occurred while loading this page"})]}),s.jsxs("div",{className:"flex gap-3",children:[a&&s.jsxs(K,{onClick:a,variant:"outline",className:"flex items-center gap-2",children:[s.jsx(ys,{className:"h-4 w-4"}),"Retry"]}),s.jsx(K,{onClick:()=>window.location.reload(),variant:"default",className:"flex items-center gap-2",children:"Refresh Page"})]})]})})}class Lr extends c.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,a){x.error("[LazyComponent] Failed to load lazy component",{pageName:this.props.pageName,error:t.message,stack:t.stack,componentStack:a.componentStack}),this.props.onError&&this.props.onError(t,a)}handleRetry=()=>{this.setState({hasError:!1,error:void 0})};render(){return this.state.hasError?s.jsx(Ct,{pageName:this.props.pageName,error:this.state.error,onRetry:this.handleRetry}):this.props.children}}function Rr(e,t){return e().catch(a=>(x.error("[LazyComponent] Failed to import lazy component",{pageName:t,error:a instanceof Error?a.message:String(a),stack:a instanceof Error?a.stack:void 0}),Promise.resolve({default:()=>s.jsx(Ct,{pageName:t,error:a instanceof Error?a:new Error(String(a))})})))}function C(e,t,a){const r=a?()=>Rr(e,a):e,n=c.lazy(r);return function(i){const{fallback:d,...l}=i,u=s.jsx(c.Suspense,{fallback:s.jsx(fs,{}),children:s.jsx(n,{...l})});return a?s.jsx(Lr,{pageName:a,children:u}):u}}const Tr=C(()=>j(()=>import("./DashboardPage-tU6v8lrU.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])).then(e=>({default:e.DashboardPage})),void 0,"Dashboard"),Ir=C(()=>j(()=>import("./chunk-m7Vgm5hx.js").then(e=>e.bY),__vite__mapDeps([1,2,3,4,5])).then(e=>({default:e.ChatPage})),void 0,"Chat"),Dr=C(()=>j(()=>import("./LibraryPage-CpGiWvEF.js"),__vite__mapDeps([10,1,2,3,4,5,11,8,12,7,9])).then(e=>({default:e.default})),void 0,"Library"),Or=C(()=>j(()=>import("./ProfilePage-DejIn-kp.js"),__vite__mapDeps([13,1,2,3,4,5,14,8,15,7,9])).then(e=>({default:e.ProfilePage})),void 0,"Profile"),Mr=C(()=>j(()=>import("./SettingsPage-BuWv_afE.js"),__vite__mapDeps([16,1,2,3,4,5,8,7,9])).then(e=>({default:e.SettingsPage})),void 0,"Settings"),zr=C(()=>j(()=>import("./LoginPage-B8bD2GQG.js"),__vite__mapDeps([17,1,2,3,4,5,8,7,9])).then(e=>({default:e.LoginPage})),void 0,"Login"),Fr=C(()=>j(()=>import("./RegisterPage-B8SqZFoS.js"),__vite__mapDeps([18,1,2,3,4,5,8,7,9])).then(e=>({default:e.RegisterPage})),void 0,"Register"),Ur=C(()=>j(()=>import("./ForgotPasswordPage-HtqV94Oc.js"),__vite__mapDeps([19,1,2,3,4,5,20,21,8,7,9])),void 0,"Forgot Password"),Vr=C(()=>j(()=>import("./VerifyEmailPage-BleC9tbZ.js"),__vite__mapDeps([22,1,2,3,4,5,20,8,7,9])),void 0,"Verify Email"),$r=C(()=>j(()=>import("./ResetPasswordPage-BcR1yiXn.js"),__vite__mapDeps([23,1,2,3,4,5,20,21,8,7,9])),void 0,"Reset Password"),Br=C(()=>j(()=>import("./SessionsPage-C3IyqzXN.js"),__vite__mapDeps([24,1,2,3,4,5,9])),void 0,"Sessions"),Wr=C(()=>j(()=>import("./NotFoundPage-BNQ8QZXy.js"),__vite__mapDeps([25,1,2,3,4,5,8,7,9])),void 0,"Not Found"),qr=C(()=>j(()=>import("./ServerErrorPage-D5p--daf.js"),__vite__mapDeps([26,1,2,3,4,5,8,7,9])),void 0,"Server Error"),Hr=C(()=>j(()=>import("./UserProfilePage-CHP4gaO1.js"),__vite__mapDeps([27,1,2,3,4,5,15,8,28,29,30,6,7,9])).then(e=>({default:e.UserProfilePage})),void 0,"User Profile"),Kr=C(()=>j(()=>import("./RolesPage-C_xE21Kg.js"),__vite__mapDeps([31,1,2,3,4,5,9,14,8,7])).then(e=>({default:e.RolesPage})),void 0,"Roles"),Gr=C(()=>j(()=>import("./TrackDetailPage-nsjzQxkj.js"),__vite__mapDeps([32,1,2,3,4,5,8,9,29,28,7])).then(e=>({default:e.TrackDetailPage})),void 0,"Track Detail"),Yr=C(()=>j(()=>import("./routes-CnJ69re8.js"),__vite__mapDeps([33,1,2,3,4,5,11,30,12,14,8,28,29,7,9,34])).then(e=>({default:e.PlaylistRoutes})),void 0,"Playlists"),Qr=C(()=>j(()=>import("./SearchPage-juuhB4y6.js"),__vite__mapDeps([35,1,2,3,4,5,29,30,28,12,8,7,9])).then(e=>({default:e.SearchPage})),void 0,"Search"),Jr=C(()=>j(()=>import("./NotificationsPage-DKYvsusD.js"),__vite__mapDeps([36,1,2,3,4,5,9,7,8])).then(e=>({default:e.NotificationsPage})),void 0,"Notifications"),Xr=C(()=>j(()=>import("./MarketplaceHome-CECv2q4E.js"),__vite__mapDeps([37,1,2,3,4,5,9,12])).then(e=>({default:e.MarketplaceHome})),void 0,"Marketplace"),Zr=C(()=>j(()=>import("./AnalyticsPage-B6vsgRQp.js"),__vite__mapDeps([38,1,2,3,4,5,8,7,9])).then(e=>({default:e.AnalyticsPage})),void 0,"Analytics"),en=C(()=>j(()=>import("./WebhooksPage-Bxaqwkqe.js"),__vite__mapDeps([39,1,2,3,4,5,9])).then(e=>({default:e.WebhooksPage})),void 0,"Webhooks"),tn=C(()=>j(()=>import("./AdminDashboardPage-D7_uRocR.js"),__vite__mapDeps([40,1,2,3,4,5,9,29,12,7,8])).then(e=>({default:e.AdminDashboardPage})),void 0,"Admin Dashboard"),sn=C(()=>j(()=>import("./DesignSystemDemoPage-DNdtVNU8.js"),__vite__mapDeps([41,1,2,3,4,5,8,7,9])).then(e=>({default:e.default})),void 0,"Design System Demo"),an=C(()=>j(()=>import("./SocialPage-Dml5lqby.js"),__vite__mapDeps([42,1,2,3,4,5])).then(e=>({default:e.SocialPage})),void 0,"Social Feed"),rn=C(()=>j(()=>import("./GearPage-mBpePMPH.js"),__vite__mapDeps([43,1,2,3,4,5])).then(e=>({default:e.GearPage})),void 0,"Gear Locker"),nn=C(()=>j(()=>import("./LivePage-C9D98f1P.js"),__vite__mapDeps([44,1,2,3,4,5])).then(e=>({default:e.LivePage})),void 0,"Live Sessions"),on=C(()=>j(()=>import("./EducationPage-Bsmem2qY.js"),__vite__mapDeps([45,1,2,3,4,5])).then(e=>({default:e.EducationPage})),void 0,"Education"),ln=C(()=>j(()=>import("./QueuePage-XCc_NyCB.js"),__vite__mapDeps([46,1,2,3,4,5])).then(e=>({default:e.QueuePage})),void 0,"Queue"),cn=C(()=>j(()=>import("./DeveloperPage-C-qN42Sy.js"),__vite__mapDeps([47,1,2,3,4,5])).then(e=>({default:e.DeveloperPage})),void 0,"Developer API");function R({children:e}){return s.jsx(Ar,{children:e})}function ie({children:e}){const{isAuthenticated:t,user:a}=ut(),r=!!be.getAccessToken(),{isLoading:n}=G();return n?null:t||r&&a?s.jsx(xe,{to:"/dashboard",replace:!0}):s.jsx(s.Fragment,{children:e})}const dn=()=>s.jsxs(sa,{children:[s.jsx(k,{path:"/login",element:s.jsx(ie,{children:s.jsx(N,{children:s.jsx(zr,{})})})}),s.jsx(k,{path:"/register",element:s.jsx(ie,{children:s.jsx(N,{children:s.jsx(Fr,{})})})}),s.jsx(k,{path:"/forgot-password",element:s.jsx(ie,{children:s.jsx(N,{children:s.jsx(Ur,{})})})}),s.jsx(k,{path:"/verify-email",element:s.jsx(ie,{children:s.jsx(N,{children:s.jsx(Vr,{})})})}),s.jsx(k,{path:"/reset-password",element:s.jsx(ie,{children:s.jsx(N,{children:s.jsx($r,{})})})}),s.jsx(k,{path:"/design-system",element:s.jsx(N,{children:s.jsx(sn,{})})}),s.jsx(k,{path:"/u/:username",element:s.jsx(N,{children:s.jsx(Hr,{})})}),s.jsx(k,{path:"/dashboard",element:s.jsx(L,{children:s.jsx(R,{children:s.jsx(N,{children:s.jsx(Tr,{})})})})}),s.jsx(k,{path:"/marketplace",element:s.jsx(L,{children:s.jsx(R,{children:s.jsx(N,{children:s.jsx(Xr,{})})})})}),s.jsx(k,{path:"/chat",element:s.jsx(L,{children:s.jsx(R,{children:s.jsx(N,{children:s.jsx(Ir,{})})})})}),s.jsx(k,{path:"/library",element:s.jsx(L,{children:s.jsx(R,{children:s.jsx(N,{children:s.jsx(Dr,{})})})})}),s.jsx(k,{path:"/profile",element:s.jsx(L,{children:s.jsx(R,{children:s.jsx(N,{children:s.jsx(Or,{})})})})}),s.jsx(k,{path:"/settings",element:s.jsx(L,{children:s.jsx(R,{children:s.jsx(N,{children:s.jsx(Mr,{})})})})}),s.jsx(k,{path:"/settings/sessions",element:s.jsx(L,{children:s.jsx(R,{children:s.jsx(N,{children:s.jsx(Br,{})})})})}),s.jsx(k,{path:"/admin/roles",element:s.jsx(L,{children:s.jsx(R,{children:s.jsx(N,{children:s.jsx(Kr,{})})})})}),s.jsx(k,{path:"/tracks/:id",element:s.jsx(L,{children:s.jsx(R,{children:s.jsx(N,{children:s.jsx(Gr,{})})})})}),s.jsx(k,{path:"/playlists/*",element:s.jsx(L,{children:s.jsx(R,{children:s.jsx(N,{children:s.jsx(Yr,{})})})})}),s.jsx(k,{path:"/search",element:s.jsx(L,{children:s.jsx(R,{children:s.jsx(N,{children:s.jsx(Qr,{})})})})}),s.jsx(k,{path:"/notifications",element:s.jsx(L,{children:s.jsx(R,{children:s.jsx(N,{children:s.jsx(Jr,{})})})})}),s.jsx(k,{path:"/analytics",element:s.jsx(L,{children:s.jsx(R,{children:s.jsx(N,{children:s.jsx(Zr,{})})})})}),s.jsx(k,{path:"/webhooks",element:s.jsx(L,{children:s.jsx(R,{children:s.jsx(N,{children:s.jsx(en,{})})})})}),s.jsx(k,{path:"/admin",element:s.jsx(L,{children:s.jsx(R,{children:s.jsx(N,{children:s.jsx(tn,{})})})})}),s.jsx(k,{path:"/social",element:s.jsx(L,{children:s.jsx(R,{children:s.jsx(N,{children:s.jsx(an,{})})})})}),s.jsx(k,{path:"/gear",element:s.jsx(L,{children:s.jsx(R,{children:s.jsx(N,{children:s.jsx(rn,{})})})})}),s.jsx(k,{path:"/live",element:s.jsx(L,{children:s.jsx(R,{children:s.jsx(N,{children:s.jsx(nn,{})})})})}),s.jsx(k,{path:"/education",element:s.jsx(L,{children:s.jsx(R,{children:s.jsx(N,{children:s.jsx(on,{})})})})}),s.jsx(k,{path:"/queue",element:s.jsx(L,{children:s.jsx(R,{children:s.jsx(N,{children:s.jsx(ln,{})})})})}),s.jsx(k,{path:"/developer",element:s.jsx(L,{children:s.jsx(R,{children:s.jsx(N,{children:s.jsx(cn,{})})})})}),s.jsx(k,{path:"/404",element:s.jsx(N,{children:s.jsx(Wr,{})})}),s.jsx(k,{path:"/500",element:s.jsx(N,{children:s.jsx(qr,{})})}),s.jsx(k,{path:"/",element:s.jsx(xe,{to:"/dashboard",replace:!0})}),s.jsx(k,{path:"*",element:s.jsx(xe,{to:"/404",replace:!0})})]});function un(e={}){const{enabled:t=!0,preventDefault:a=!0,onHelpOpen:r}=e,n=ee(),{setSidebarOpen:o,sidebarOpen:i}=de(),d=c.useCallback(l=>{if(!t)return;const u=l.target;if(u&&(u.tagName==="INPUT"||u.tagName==="TEXTAREA"||u.isContentEditable===!0||u.getAttribute("role")==="textbox")){if(l.key==="k"&&(l.ctrlKey||l.metaKey)){a&&l.preventDefault();const h=document.querySelector('input[type="search"], input[placeholder*="search" i], input[placeholder*="rechercher" i]');h?(h.focus(),h.select()):n("/search");return}return}if((l.ctrlKey||l.metaKey)&&l.key==="k"){a&&l.preventDefault();const h=document.querySelector('input[type="search"], input[placeholder*="search" i], input[placeholder*="rechercher" i]');h?(h.focus(),h.select()):n("/search");return}if((l.ctrlKey||l.metaKey)&&l.key==="n"){a&&l.preventDefault(),n("/chat");return}if((l.ctrlKey||l.metaKey)&&l.key==="b"){a&&l.preventDefault(),o(!i);return}if(l.key==="Escape"){document.querySelectorAll('[role="menu"][aria-expanded="true"]').forEach(m=>{const p=m.previousElementSibling;p&&p.click()});return}if(l.key==="?"&&!l.ctrlKey&&!l.metaKey&&!l.shiftKey){a&&l.preventDefault(),r&&r();return}},[t,a,n,o,i,r]);c.useEffect(()=>{if(t)return window.addEventListener("keydown",d),()=>{window.removeEventListener("keydown",d)}},[t,d])}function hn({open:e,onClose:t}){const{t:a}=$e(),r=[{key:q.SEARCH,description:a("keyboard.shortcuts.search","Focus search or navigate to search page")},{key:q.NEW_MESSAGE,description:a("keyboard.shortcuts.newMessage","Open new chat/message")},{key:q.PLAY_PAUSE,description:a("keyboard.shortcuts.playPause","Play or pause current track")},{key:q.NEXT_TRACK,description:a("keyboard.shortcuts.nextTrack","Play next track")},{key:q.PREVIOUS_TRACK,description:a("keyboard.shortcuts.previousTrack","Play previous track")},{key:q.VOLUME_UP,description:a("keyboard.shortcuts.volumeUp","Increase volume")},{key:q.VOLUME_DOWN,description:a("keyboard.shortcuts.volumeDown","Decrease volume")},{key:q.MUTE,description:a("keyboard.shortcuts.mute","Toggle mute")},{key:"Ctrl+B / Cmd+B",description:a("keyboard.shortcuts.toggleSidebar","Toggle sidebar")},{key:q.ESCAPE,description:a("keyboard.shortcuts.escape","Close modals or go back")},{key:q.HELP,description:a("keyboard.shortcuts.help","Show this help dialog")}];return s.jsx(xs,{open:e,onClose:t,title:a("keyboard.shortcuts.title","Keyboard Shortcuts"),size:"lg",children:s.jsx("div",{className:"space-y-3",children:r.map((n,o)=>s.jsxs("div",{className:"flex items-center justify-between border-b border-gray-200 dark:border-gray-700 pb-2 last:border-0",children:[s.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:n.description}),s.jsx("kbd",{className:"px-2 py-1 text-xs font-semibold text-gray-800 dark:text-gray-200 bg-gray-100 dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded",children:n.key})]},o))})})}const Et=Me()(ze(Fe(e=>({filters:{},setFilters:t=>{e({filters:t})}}),{name:"library-storage",partialize:e=>({filters:e.filters})}),{name:"LibraryStore",enabled:!1})),Bo=Object.freeze(Object.defineProperty({__proto__:null,useLibraryStore:Et},Symbol.toStringTag,{value:"Module"}));class mn{ws=null;messageHandlers=[];errorHandlers=[];openHandlers=[];closeHandlers=[];reconnectAttempts=0;maxReconnectAttempts=5;reconnectDelay=3e3;async connect(){if(this.ws&&this.ws.readyState===WebSocket.OPEN)return;const t="/ws".startsWith("/")?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`:"/ws";return new Promise((a,r)=>{try{this.ws=new WebSocket(t),this.ws.onopen=()=>{this.reconnectAttempts=0,this.openHandlers.forEach(n=>n()),a()},this.ws.onmessage=n=>{try{const o=JSON.parse(n.data);this.messageHandlers.forEach(i=>i(o))}catch(o){x.error("Failed to parse WebSocket message:",{error:o})}},this.ws.onerror=n=>{this.errorHandlers.forEach(o=>o(n))},this.ws.onclose=n=>{if(this.closeHandlers.forEach(o=>o()),this.reconnectAttempts<this.maxReconnectAttempts){this.reconnectAttempts++;const o=this.reconnectDelay*Math.pow(2,this.reconnectAttempts-1);this.reconnectAttempts===1?x.warn(`[WebSocket] Connection closed. Chat server unavailable. Retrying in ${o/1e3}s...`):this.reconnectAttempts===this.maxReconnectAttempts&&x.error(`[WebSocket] Max reconnection attempts (${this.maxReconnectAttempts}) reached. Chat server unavailable at ${t}. Please ensure the chat server is running.`),setTimeout(()=>{this.connect().catch(()=>{})},o)}else x.error(`[WebSocket] Max reconnection attempts (${this.maxReconnectAttempts}) reached. Chat server unavailable at ${t}. Please ensure the chat server is running on port 8081.`),r(new Error("WebSocket connection failed after maximum retries"))}}catch(n){r(n)}})}disconnect(){this.ws&&(this.ws.close(),this.ws=null)}send(t){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify(t)):x.error("WebSocket is not connected")}onMessage(t){this.messageHandlers.push(t)}onError(t){this.errorHandlers.push(t)}onOpen(t){this.openHandlers.push(t)}onClose(t){this.closeHandlers.push(t)}isConnected(){return this.ws!==null&&this.ws.readyState===WebSocket.OPEN}removeMessageHandler(t){const a=this.messageHandlers.indexOf(t);a>-1&&this.messageHandlers.splice(a,1)}on(t,a){switch(t){case"message":case"chat_message":this.onMessage(a);break;case"connected":case"chat_connected":this.onOpen(a);break;case"disconnected":case"chat_disconnected":this.onClose(a);break;case"error":case"chat_error":this.onError(a);break;default:x.warn(`[WebSocket] Event '${t}' not supported`)}}off(t,a){switch(t){case"message":case"chat_message":this.removeMessageHandler(a);break}}connectChat(){return this.connect()}joinConversation(t){this.send({type:"join_conversation",conversation_id:t})}joinRoom(t){this.joinConversation(t)}leaveConversation(t){this.send({type:"leave_conversation",conversation_id:t})}sendMessage(t,a,r){this.send({type:"send_message",conversation_id:t,content:a,parent_id:r})}startTyping(t){this.send({type:"start_typing",conversation_id:t})}stopTyping(t){this.send({type:"stop_typing",conversation_id:t})}addReaction(t,a){this.send({type:"add_reaction",message_id:t,emoji:a})}removeReaction(t,a){this.send({type:"remove_reaction",message_id:t,emoji:a})}}const pn=new mn,U=pn,Pt=Me()(ze(Fe((e,t)=>({conversations:[],currentConversation:null,messages:{},typingUsers:{},isConnected:!1,isLoading:!1,error:null,setConversations:a=>e({conversations:a}),setCurrentConversation:a=>{e({currentConversation:a}),a&&t().joinConversation(a.id)},addMessage:(a,r)=>{e(n=>({messages:{...n.messages,[a]:[...n.messages[a]||[],r]}}))},updateMessage:(a,r,n)=>{e(o=>({messages:{...o.messages,[a]:o.messages[a]?.map(i=>i.id===r?{...i,...n}:i)||[]}}))},removeMessage:(a,r)=>{e(n=>({messages:{...n.messages,[a]:n.messages[a]?.filter(o=>o.id!==r)||[]}}))},setMessages:(a,r)=>{e(n=>({messages:{...n.messages,[a]:r}}))},setTypingUsers:(a,r)=>{e(n=>({typingUsers:{...n.typingUsers,[a]:r}}))},addTypingUser:(a,r)=>{e(n=>({typingUsers:{...n.typingUsers,[a]:[...n.typingUsers[a]||[],r]}}))},removeTypingUser:(a,r)=>{e(n=>({typingUsers:{...n.typingUsers,[a]:(n.typingUsers[a]||[]).filter(o=>o!==r)}}))},setConnected:a=>e({isConnected:a}),setLoading:a=>e({isLoading:a}),setError:a=>e({error:a}),connect:async()=>{e({isLoading:!0,error:null});try{await U.connect(),e({isConnected:!0,isLoading:!1}),U.on("message",a=>{const{conversation_id:r,user_id:n,content:o,emoji:i,timestamp:d}=a.data;switch(a.type){case"message":o&&t().addMessage(r,{id:crypto.randomUUID(),conversation_id:r,sender_id:n,content:o,message_type:"text",created_at:d,updated_at:d});break;case"typing":t().addTypingUser(r,n),setTimeout(()=>{t().removeTypingUser(r,n)},3e3);break;case"reaction":break}}),U.on("connected",()=>{e({isConnected:!0,isLoading:!1})}),U.on("disconnected",()=>{e({isConnected:!1})}),U.on("error",a=>{e({error:a.message,isLoading:!1})})}catch(a){e({error:Se(a).message,isLoading:!1})}},disconnect:()=>{U.disconnect(),e({isConnected:!1})},joinConversation:a=>{U.joinConversation(a)},leaveConversation:a=>{U.leaveConversation(a)},sendMessage:(a,r,n)=>{U.sendMessage(a,r,n)},startTyping:a=>{U.startTyping(a)},stopTyping:a=>{U.stopTyping(a)},addReaction:(a,r)=>{U.addReaction(a,r)},removeReaction:(a,r)=>{U.removeReaction(a,r)},fetchConversations:async()=>{try{const{apiClient:a}=await j(async()=>{const{apiClient:i}=await import("./chunk-m7Vgm5hx.js").then(d=>d.bX);return{apiClient:i}},__vite__mapDeps([1,2,3,4,5])),o=((await a.get("/conversations")).data.conversations||[]).map(i=>{const d=pe(i);return{...d,name:d.name||`Conversation ${d.id}`,participants:(d.participants||[]).map(l=>typeof l=="string"?l:pe(l).id||String(l))}});e({conversations:o})}catch(a){const r=Se(a);x.error("Error fetching conversations",{error:r.message,stack:a instanceof Error?a.stack:void 0}),e({error:"Failed to fetch conversations"})}},createConversation:async a=>{try{const{apiClient:r}=await j(async()=>{const{apiClient:l}=await import("./chunk-m7Vgm5hx.js").then(u=>u.bX);return{apiClient:l}},__vite__mapDeps([1,2,3,4,5])),o=(await r.post("/conversations",{name:a.name,description:a.description||"",type:a.type||"public",is_private:a.is_private||!1})).data,i=pe(o),d={...i,name:i.name||`Conversation ${i.id}`,participants:(i.participants||[]).map(l=>typeof l=="string"?l:pe(l).id||String(l))};return e(l=>({conversations:[...l.conversations,d],currentConversation:d})),t().joinConversation(d.id),d}catch(r){const n=Se(r);throw x.error("Error creating conversation",{error:n.message,stack:r instanceof Error?r.stack:void 0}),e({error:n.message||"Failed to create conversation"}),r}}}),{name:"chat-storage",partialize:e=>({conversations:e.conversations,currentConversation:e.currentConversation})}),{name:"ChatStore",enabled:!1})),Wo=Object.freeze(Object.defineProperty({__proto__:null,useChatStore:Pt},Symbol.toStringTag,{value:"Module"}));async function fn(e={}){const{hydrateAuth:t=!0,hydrateLibrary:a=!1,hydrateChat:r=!1,requireAuth:n=!0}=e,o={success:!0,hydrated:[],errors:[]};try{if(n){const{isAuthenticated:i}=G.getState();if(!i)return x.debug("[StateHydration] User not authenticated, skipping hydration"),o}if(t)try{const{isAuthenticated:i,isLoading:d}=G.getState(),l=be.hasTokens();i&&l&&!d?(x.debug("[StateHydration] User already authenticated with tokens, skipping auth hydration"),o.hydrated.push("auth")):(await gn(),o.hydrated.push("auth"),x.debug("[StateHydration] Auth state hydrated"))}catch(i){const d=i instanceof Error?i:new Error(String(i));o.errors.push({store:"auth",error:d}),o.success=!1,x.error("[StateHydration] Failed to hydrate auth state",{error:d.message})}if(a)try{await yn(),o.hydrated.push("library"),x.debug("[StateHydration] Library state hydrated")}catch(i){const d=i instanceof Error?i:new Error(String(i));o.errors.push({store:"library",error:d}),o.success=!1,x.error("[StateHydration] Failed to hydrate library state",{error:d.message})}if(r)try{await xn(),o.hydrated.push("chat"),x.debug("[StateHydration] Chat state hydrated")}catch(i){const d=i instanceof Error?i:new Error(String(i));o.errors.push({store:"chat",error:d}),o.success=!1,x.error("[StateHydration] Failed to hydrate chat state",{error:d.message})}}catch(i){const d=i instanceof Error?i:new Error(String(i));x.error("[StateHydration] Fatal error during hydration",{error:d.message}),o.success=!1}return o}async function gn(){const{refreshUser:e,isAuthenticated:t}=G.getState(),a=be.hasTokens();if(t&&a){x.debug("[StateHydration] User already authenticated, skipping refreshUser");return}await e()}async function yn(){const{fetchFavorites:e}=Et.getState();await e()}async function xn(){const{fetchConversations:e}=Pt.getState();await e()}function vn(e={}){const[t,a]=c.useState(!0),[r,n]=c.useState(null);return c.useEffect(()=>{let o=!0;return fn(e).then(i=>{o&&(n(i),a(!1))}).catch(i=>{o&&(x.error("[StateHydration] Hook error:",i),n({success:!1,hydrated:[],errors:[{store:"unknown",error:i instanceof Error?i:new Error(String(i))}]}),a(!1))}),()=>{o=!1}},[]),{isHydrating:t,hydrationResult:r}}function bn(){const e=st();c.useEffect(()=>{const t=a=>{const{queryKeys:r,resourceType:n,resourceId:o}=a.detail;if(r&&r.length>0)for(const i of r)e.invalidateQueries({queryKey:i});if(n){const d={tracks:[["tracks"],["track"],["library"]],playlists:[["playlists"],["playlist"]],users:[["users"],["user"],["auth"]],conversations:[["conversations"],["conversation"],["chat"]],roles:[["roles"],["role"]],library:[["library"],["tracks"],["favorites"]],auth:[["auth"],["user"]],ui:[],all:[]}[n]||[];for(const l of d)e.invalidateQueries({queryKey:o?[...l,o]:l})}};return window.addEventListener("veza:invalidate-queries",t),()=>{window.removeEventListener("veza:invalidate-queries",t)}},[e])}function wn(){const{refreshUser:e}=G(),{theme:t,setTheme:a,language:r,setLanguage:n}=de(),[o,i]=c.useState(!1);return un({enabled:!0,onHelpOpen:()=>i(!0)}),vn({hydrateAuth:!0,hydrateLibrary:!1,hydrateChat:!1,requireAuth:!1}),bn(),c.useEffect(()=>{if((async()=>{await new Promise(u=>setTimeout(u,100));const{isAuthenticated:l}=G.getState();l&&bs.refreshToken().catch(u=>{x.warn("Failed to fetch CSRF token on app init",{error:u instanceof Error?u.message:String(u),stack:u instanceof Error?u.stack:void 0})})})(),!t||t==="system"){const l=document.documentElement;!l.classList.contains("dark")&&!l.classList.contains("light")?a("dark"):a(t)}else a(t);if(typeof window<"u"&&window.i18n){const l=window.i18n.language||r;l!==r?window.i18n.changeLanguage(r):r!==l&&n(l)}},[e,a,t,r,n]),c.useEffect(()=>{if(t!=="system")return;const d=window.matchMedia("(prefers-color-scheme: dark)"),l=u=>{const h=document.documentElement;u.matches?h.classList.add("dark"):h.classList.remove("dark")};return d.addEventListener?d.addEventListener("change",l):d.addListener(l),()=>{d.removeEventListener?d.removeEventListener("change",l):d.removeListener(l)}},[t]),s.jsx(N,{children:s.jsxs(vs,{children:[s.jsx(nr,{}),s.jsx(dn,{}),s.jsx(tr,{}),s.jsx(hn,{open:o,onClose:()=>i(!1)})]})})}const kn={loading:"Chargement...",save:"Sauvegarder",cancel:"Annuler",edit:"Modifier",delete:"Supprimer",confirm:"Confirmer",close:"Fermer",back:"Retour",next:"Suivant",previous:"Précédent",search:"Rechercher",filter:"Filtrer",sort:"Trier",view:"Voir",download:"Télécharger",upload:"Téléverser",share:"Partager",copy:"Copier",refresh:"Actualiser",settings:"Paramètres",profile:"Profil",logout:"Déconnexion",login:"Connexion",register:"S'inscrire",email:"Email",password:"Mot de passe",username:"Nom d'utilisateur",firstName:"Prénom",lastName:"Nom",name:"Nom",title:"Titre",description:"Description",date:"Date",time:"Heure",status:"Statut",type:"Type",size:"Taille",actions:"Actions",error:"Erreur",success:"Succès",warning:"Attention",info:"Information",yes:"Oui",no:"Non",never:"Jamais",changeTheme:"Changer le thème",userMenu:"Menu utilisateur",notifications:"Notifications"},jn={login:{title:"Connexion",subtitle:"Connectez-vous à votre compte Veza",email:"Email",password:"Mot de passe",rememberMe:"Se souvenir de moi",forgotPassword:"Mot de passe oublié ?",loginButton:"Se connecter",noAccount:"Pas encore de compte ?",createAccount:"Créer un compte",errors:{invalidCredentials:"Email ou mot de passe incorrect",accountLocked:"Compte verrouillé",emailNotVerified:"Email non vérifié"}},register:{title:"Créer un compte",subtitle:"Rejoignez la communauté Veza",firstName:"Prénom",lastName:"Nom",username:"Nom d'utilisateur",email:"Email",password:"Mot de passe",confirmPassword:"Confirmer le mot de passe",registerButton:"Créer le compte",hasAccount:"Déjà un compte ?",loginLink:"Se connecter",errors:{passwordMismatch:"Les mots de passe ne correspondent pas",emailExists:"Cet email est déjà utilisé",usernameExists:"Ce nom d'utilisateur est déjà pris",weakPassword:"Le mot de passe doit contenir au moins 8 caractères"}},forgotPassword:{title:"Mot de passe oublié",subtitle:"Entrez votre email pour recevoir un lien de réinitialisation",email:"Email",sendButton:"Envoyer le lien",backToLogin:"Retour à la connexion",success:"Email de réinitialisation envoyé"}},Nn={title:"Tableau de bord",welcome:"Bienvenue, {{name}} !",stats:{totalTracks:"Pistes totales",totalPlaylists:"Playlists",totalFavorites:"Favoris",totalStorage:"Stockage utilisé"},recentActivity:"Activité récente",recentTracks:"Pistes récentes",quickActions:"Actions rapides",uploadTrack:"Téléverser une piste",createPlaylist:"Créer une playlist",startChat:"Démarrer un chat"},Sn={title:"Chat",conversations:"Conversations",newConversation:"Nouvelle conversation",searchConversations:"Rechercher des conversations",noConversations:"Aucune conversation",startConversation:"Démarrer une conversation",messages:{placeholder:"Tapez votre message...",send:"Envoyer",typing:"{{user}} est en train d'écrire...",online:"En ligne",offline:"Hors ligne",lastSeen:"Vu pour la dernière fois {{time}}"},errors:{connectionFailed:"Échec de la connexion au chat",messageFailed:"Échec de l'envoi du message",reconnecting:"Reconnexion en cours..."}},Cn={title:"Bibliothèque",myFiles:"Mes fichiers",favorites:"Favoris",recent:"Récents",search:"Rechercher dans la bibliothèque",filterBy:"Filtrer par",sortBy:"Trier par",viewMode:{grid:"Vue grille",list:"Vue liste"},upload:{title:"Téléverser un fichier",dragDrop:"Glissez-déposez vos fichiers ici",or:"ou",browseFiles:"Parcourir les fichiers",supportedFormats:"Formats supportés: MP3, WAV, FLAC, PDF, DOC, DOCX",maxSize:"Taille maximale: 100MB"},actions:{play:"Lire",download:"Télécharger",share:"Partager",addToFavorites:"Ajouter aux favoris",removeFromFavorites:"Retirer des favoris",edit:"Modifier",delete:"Supprimer"},empty:{title:"Votre bibliothèque est vide",subtitle:"Commencez par téléverser vos premiers fichiers",uploadButton:"Téléverser un fichier"}},En={title:"Profil",subtitle:"Gérez vos informations personnelles et préférences",personalInfo:"Informations personnelles",updateProfile:"Mettre à jour votre profil",edit:"Modifier",save:"Sauvegarder",cancel:"Annuler",avatar:{title:"Photo de profil",changePhoto:"Changer la photo",removePhoto:"Supprimer la photo"},accountInfo:"Informations du compte",memberSince:"Membre depuis",emailVerified:"Email vérifié",lastLogin:"Dernière connexion",fields:{firstName:"Prénom",lastName:"Nom",username:"Nom d'utilisateur",email:"Email",bio:"Bio",bioPlaceholder:"Parlez-nous de vous..."}},Pn={title:"Paramètres",subtitle:"Gérez vos préférences et paramètres de compte",tabs:{appearance:"Apparence",language:"Langue",notifications:"Notifications",security:"Sécurité"},appearance:{theme:"Thème",themeDescription:"Choisissez le thème qui vous convient le mieux",light:"Clair",dark:"Sombre",system:"Système",systemDescription:"Suivre le système"},language:{title:"Langue et région",description:"Choisissez votre langue préférée",language:"Langue"},notifications:{title:"Notifications",description:"Configurez vos préférences de notification",emailNotifications:"Notifications par email",emailDescription:"Recevez des notifications par email",pushNotifications:"Notifications push",pushDescription:"Recevez des notifications push dans le navigateur",chatNotifications:"Notifications de chat",chatDescription:"Recevez des notifications pour les nouveaux messages"},security:{title:"Sécurité",description:"Gérez vos paramètres de sécurité",changePassword:"Changer le mot de passe",changePasswordDescription:"Mettez à jour votre mot de passe",twoFactor:"Authentification à deux facteurs",twoFactorDescription:"Ajoutez une couche de sécurité supplémentaire",activeSessions:"Sessions actives",activeSessionsDescription:"Gérez vos sessions de connexion",modify:"Modifier",configure:"Configurer",view:"Voir"},save:"Sauvegarder les modifications",saving:"Sauvegarde..."},_n={404:{title:"Page non trouvée",message:"La page que vous recherchez n'existe pas.",backHome:"Retour à l'accueil"},500:{title:"Erreur serveur",message:"Une erreur interne s'est produite. Veuillez réessayer plus tard.",retry:"Réessayer"},network:{title:"Erreur de connexion",message:"Impossible de se connecter au serveur. Vérifiez votre connexion internet.",retry:"Réessayer"},unauthorized:{title:"Accès non autorisé",message:"Vous n'avez pas les permissions nécessaires pour accéder à cette ressource.",login:"Se connecter"}},An={dashboard:"Tableau de bord",chat:"Chat",library:"Bibliothèque",profile:"Profil",settings:"Paramètres",menu:"Menu",close:"Fermer"},Ln={required:"Ce champ est obligatoire",email:"Veuillez entrer une adresse email valide",minLength:"Ce champ doit contenir au moins {{min}} caractères",maxLength:"Ce champ ne peut pas dépasser {{max}} caractères",passwordMatch:"Les mots de passe ne correspondent pas",fileSize:"Le fichier ne peut pas dépasser {{max}}MB",fileType:"Type de fichier non supporté"},Rn={install:{title:"Installer Veza",description:"Accédez rapidement à Veza depuis votre écran d'accueil",button:"Installer",installing:"Installation...",later:"Plus tard",success:"Application installée avec succès !",error:"Erreur lors de l'installation"},update:{title:"Mise à jour disponible",description:"Une nouvelle version de Veza est disponible",button:"Mettre à jour",updating:"Mise à jour...",later:"Plus tard",success:"Application mise à jour !",error:"Erreur lors de la mise à jour"},offline:{title:"Mode hors ligne",description:"Vous êtes actuellement hors ligne. Certaines fonctionnalités peuvent être limitées.",retry:"Réessayer"},notifications:{permission:{title:"Notifications",description:"Autorisez les notifications pour recevoir les mises à jour importantes",allow:"Autoriser",deny:"Refuser"}}},Tn={title:"Pistes",upload:"Téléverser une piste",play:"Lire",pause:"Pause",like:"Aimer",unlike:"Ne plus aimer",addToFavorites:"Ajouter aux favoris",removeFromFavorites:"Retirer des favoris",share:"Partager",download:"Télécharger",comments:"Commentaires",addComment:"Ajouter un commentaire",editComment:"Modifier le commentaire",deleteComment:"Supprimer le commentaire",reply:"Répondre",noTracks:"Aucune piste disponible",noResults:"Aucun résultat trouvé",loading:"Chargement des pistes...",duration:"Durée",artist:"Artiste",album:"Album",genre:"Genre",year:"Année",plays:"Lectures",likes:"J'aime"},In={title:"Playlists",create:"Créer une playlist",edit:"Modifier la playlist",delete:"Supprimer la playlist",follow:"Suivre",unfollow:"Ne plus suivre",following:"Abonné",followers:"Abonnés",share:"Partager",addTrack:"Ajouter une piste",removeTrack:"Retirer la piste",collaborators:"Collaborateurs",addCollaborator:"Ajouter un collaborateur",removeCollaborator:"Retirer un collaborateur",noPlaylists:"Aucune playlist disponible",loading:"Chargement des playlists...",tracks:"Pistes",public:"Publique",private:"Privée"},Dn={title:"Notifications",markAsRead:"Marquer comme lu",markAllAsRead:"Tout marquer comme lu",clearAll:"Tout effacer",noNotifications:"Aucune notification",viewAll:"Voir toutes les notifications",newMessage:"Nouveau message",trackUploaded:"Piste téléversée",userMentioned:"Vous avez été mentionné",system:"Notification système",friendRequest:"Demande d'ami",conversationInvite:"Invitation à une conversation"},On={title:"Recherche",placeholder:"Rechercher des pistes, playlists, utilisateurs...",results:"Résultats",noResults:"Aucun résultat trouvé",tracks:"Pistes",playlists:"Playlists",users:"Utilisateurs",all:"Tout"},Mn={title:"Analytiques",period:"Période",last7Days:"7 derniers jours",last30Days:"30 derniers jours",last90Days:"90 derniers jours",lastYear:"Dernière année",topTracks:"Pistes populaires",topPlaylists:"Playlists populaires",totalPlays:"Total de lectures",totalLikes:"Total de j'aime",totalDownloads:"Total de téléchargements"},zn={title:"Webhooks",create:"Créer un webhook",edit:"Modifier le webhook",delete:"Supprimer le webhook",test:"Tester le webhook",regenerateKey:"Régénérer la clé API",url:"URL",events:"Événements",status:"Statut",active:"Actif",inactive:"Inactif",noWebhooks:"Aucun webhook configuré"},Fn={title:"Tableau de bord administrateur",users:"Utilisateurs",systemStats:"Statistiques système",auditLogs:"Journaux d'audit",suspiciousActivity:"Activité suspecte"},Un={shortcuts:{title:"Raccourcis clavier",search:"Focus sur la recherche ou naviguer vers la page de recherche",newMessage:"Ouvrir un nouveau chat/message",playPause:"Lire ou mettre en pause la piste actuelle",nextTrack:"Lire la piste suivante",previousTrack:"Lire la piste précédente",volumeUp:"Augmenter le volume",volumeDown:"Diminuer le volume",mute:"Activer/désactiver le mode silencieux",toggleSidebar:"Afficher/masquer la barre latérale",escape:"Fermer les modals ou revenir en arrière",help:"Afficher cette boîte de dialogue d'aide"}},Vn={play:"Lire",pause:"Pause",next:"Piste suivante",previous:"Piste précédente",shuffleOn:"Aléatoire: Activé",shuffleOff:"Aléatoire: Désactivé",repeatOff:"Répétition: Désactivée",repeatTrack:"Répétition: Piste",repeatPlaylist:"Répétition: Playlist",mute:"Muet",unmute:"Activer le son",showQueue:"Afficher la file d'attente",hideQueue:"Masquer la file d'attente"},$n={common:kn,auth:jn,dashboard:Nn,chat:Sn,library:Cn,profile:En,settings:Pn,errors:_n,navigation:An,validation:Ln,pwa:Rn,tracks:Tn,playlists:In,notifications:Dn,search:On,analytics:Mn,webhooks:zn,admin:Fn,keyboard:Un,player:Vn},Bn={loading:"Loading...",save:"Save",cancel:"Cancel",edit:"Edit",delete:"Delete",confirm:"Confirm",close:"Close",back:"Back",next:"Next",previous:"Previous",search:"Search",filter:"Filter",sort:"Sort",view:"View",download:"Download",upload:"Upload",share:"Share",copy:"Copy",refresh:"Refresh",settings:"Settings",profile:"Profile",logout:"Logout",login:"Login",register:"Register",email:"Email",password:"Password",username:"Username",firstName:"First Name",lastName:"Last Name",name:"Name",title:"Title",description:"Description",date:"Date",time:"Time",status:"Status",type:"Type",size:"Size",actions:"Actions",error:"Error",success:"Success",warning:"Warning",info:"Information",yes:"Yes",no:"No",never:"Never",changeTheme:"Change theme",userMenu:"User menu",notifications:"Notifications"},Wn={login:{title:"Login",subtitle:"Sign in to your Veza account",email:"Email",password:"Password",rememberMe:"Remember me",forgotPassword:"Forgot password?",loginButton:"Sign in",noAccount:"Don't have an account?",createAccount:"Create account",errors:{invalidCredentials:"Invalid email or password",accountLocked:"Account locked",emailNotVerified:"Email not verified"}},register:{title:"Create Account",subtitle:"Join the Veza community",firstName:"First Name",lastName:"Last Name",username:"Username",email:"Email",password:"Password",confirmPassword:"Confirm Password",registerButton:"Create Account",hasAccount:"Already have an account?",loginLink:"Sign in",errors:{passwordMismatch:"Passwords do not match",emailExists:"This email is already in use",usernameExists:"This username is already taken",weakPassword:"Password must contain at least 8 characters"}},forgotPassword:{title:"Forgot Password",subtitle:"Enter your email to receive a reset link",email:"Email",sendButton:"Send Reset Link",backToLogin:"Back to login",success:"Reset email sent"}},qn={title:"Dashboard",welcome:"Welcome, {{name}}!",stats:{totalTracks:"Total Tracks",totalPlaylists:"Playlists",totalFavorites:"Favorites",totalStorage:"Storage Used"},recentActivity:"Recent Activity",recentTracks:"Recent Tracks",quickActions:"Quick Actions",uploadTrack:"Upload Track",createPlaylist:"Create Playlist",startChat:"Start Chat"},Hn={title:"Chat",conversations:"Conversations",newConversation:"New Conversation",searchConversations:"Search conversations",noConversations:"No conversations",startConversation:"Start a conversation",messages:{placeholder:"Type your message...",send:"Send",typing:"{{user}} is typing...",online:"Online",offline:"Offline",lastSeen:"Last seen {{time}}"},errors:{connectionFailed:"Failed to connect to chat",messageFailed:"Failed to send message",reconnecting:"Reconnecting..."}},Kn={title:"Library",myFiles:"My Files",favorites:"Favorites",recent:"Recent",search:"Search library",filterBy:"Filter by",sortBy:"Sort by",viewMode:{grid:"Grid view",list:"List view"},upload:{title:"Upload File",dragDrop:"Drag and drop your files here",or:"or",browseFiles:"Browse files",supportedFormats:"Supported formats: MP3, WAV, FLAC, PDF, DOC, DOCX",maxSize:"Max size: 100MB"},actions:{play:"Play",download:"Download",share:"Share",addToFavorites:"Add to favorites",removeFromFavorites:"Remove from favorites",edit:"Edit",delete:"Delete"},empty:{title:"Your library is empty",subtitle:"Start by uploading your first files",uploadButton:"Upload file"}},Gn={title:"Profile",subtitle:"Manage your personal information and preferences",personalInfo:"Personal Information",updateProfile:"Update your profile",edit:"Edit",save:"Save",cancel:"Cancel",avatar:{title:"Profile Picture",changePhoto:"Change photo",removePhoto:"Remove photo"},accountInfo:"Account Information",memberSince:"Member since",emailVerified:"Email verified",lastLogin:"Last login",fields:{firstName:"First Name",lastName:"Last Name",username:"Username",email:"Email",bio:"Bio",bioPlaceholder:"Tell us about yourself..."}},Yn={title:"Settings",subtitle:"Manage your preferences and account settings",tabs:{appearance:"Appearance",language:"Language",notifications:"Notifications",security:"Security"},appearance:{theme:"Theme",themeDescription:"Choose the theme that works best for you",light:"Light",dark:"Dark",system:"System",systemDescription:"Follow system"},language:{title:"Language and Region",description:"Choose your preferred language",language:"Language"},notifications:{title:"Notifications",description:"Configure your notification preferences",emailNotifications:"Email notifications",emailDescription:"Receive notifications by email",pushNotifications:"Push notifications",pushDescription:"Receive push notifications in browser",chatNotifications:"Chat notifications",chatDescription:"Receive notifications for new messages"},security:{title:"Security",description:"Manage your security settings",changePassword:"Change password",changePasswordDescription:"Update your password",twoFactor:"Two-factor authentication",twoFactorDescription:"Add an extra layer of security",activeSessions:"Active sessions",activeSessionsDescription:"Manage your login sessions",modify:"Modify",configure:"Configure",view:"View"},save:"Save changes",saving:"Saving..."},Qn={404:{title:"Page Not Found",message:"The page you're looking for doesn't exist.",backHome:"Back to home"},500:{title:"Server Error",message:"An internal error occurred. Please try again later.",retry:"Retry"},network:{title:"Connection Error",message:"Unable to connect to server. Check your internet connection.",retry:"Retry"},unauthorized:{title:"Unauthorized Access",message:"You don't have permission to access this resource.",login:"Login"}},Jn={dashboard:"Dashboard",chat:"Chat",library:"Library",profile:"Profile",settings:"Settings",menu:"Menu",close:"Close"},Xn={required:"This field is required",email:"Please enter a valid email address",minLength:"This field must contain at least {{min}} characters",maxLength:"This field cannot exceed {{max}} characters",passwordMatch:"Passwords do not match",fileSize:"File cannot exceed {{max}}MB",fileType:"File type not supported"},Zn={install:{title:"Install Veza",description:"Quickly access Veza from your home screen",button:"Install",installing:"Installing...",later:"Later",success:"App installed successfully!",error:"Installation error"},update:{title:"Update available",description:"A new version of Veza is available",button:"Update",updating:"Updating...",later:"Later",success:"App updated!",error:"Update error"},offline:{title:"Offline mode",description:"You are currently offline. Some features may be limited.",retry:"Retry"},notifications:{permission:{title:"Notifications",description:"Allow notifications to receive important updates",allow:"Allow",deny:"Deny"}}},eo={title:"Tracks",upload:"Upload Track",play:"Play",pause:"Pause",like:"Like",unlike:"Unlike",addToFavorites:"Add to favorites",removeFromFavorites:"Remove from favorites",share:"Share",download:"Download",comments:"Comments",addComment:"Add a comment",editComment:"Edit comment",deleteComment:"Delete comment",reply:"Reply",noTracks:"No tracks available",noResults:"No results found",loading:"Loading tracks...",duration:"Duration",artist:"Artist",album:"Album",genre:"Genre",year:"Year",plays:"Plays",likes:"Likes"},to={title:"Playlists",create:"Create Playlist",edit:"Edit Playlist",delete:"Delete Playlist",follow:"Follow",unfollow:"Unfollow",following:"Following",followers:"Followers",share:"Share",addTrack:"Add Track",removeTrack:"Remove Track",collaborators:"Collaborators",addCollaborator:"Add Collaborator",removeCollaborator:"Remove Collaborator",noPlaylists:"No playlists available",loading:"Loading playlists...",tracks:"Tracks",public:"Public",private:"Private"},so={title:"Notifications",markAsRead:"Mark as read",markAllAsRead:"Mark all as read",clearAll:"Clear all",noNotifications:"No notifications",viewAll:"View all notifications",newMessage:"New message",trackUploaded:"Track uploaded",userMentioned:"You were mentioned",system:"System notification",friendRequest:"Friend request",conversationInvite:"Conversation invite"},ao={title:"Search",placeholder:"Search tracks, playlists, users...",results:"Results",noResults:"No results found",tracks:"Tracks",playlists:"Playlists",users:"Users",all:"All"},ro={title:"Analytics",period:"Period",last7Days:"Last 7 days",last30Days:"Last 30 days",last90Days:"Last 90 days",lastYear:"Last year",topTracks:"Top Tracks",topPlaylists:"Top Playlists",totalPlays:"Total Plays",totalLikes:"Total Likes",totalDownloads:"Total Downloads"},no={title:"Webhooks",create:"Create Webhook",edit:"Edit Webhook",delete:"Delete Webhook",test:"Test Webhook",regenerateKey:"Regenerate API Key",url:"URL",events:"Events",status:"Status",active:"Active",inactive:"Inactive",noWebhooks:"No webhooks configured"},oo={title:"Admin Dashboard",users:"Users",systemStats:"System Statistics",auditLogs:"Audit Logs",suspiciousActivity:"Suspicious Activity"},io={shortcuts:{title:"Keyboard Shortcuts",search:"Focus search or navigate to search page",newMessage:"Open new chat/message",playPause:"Play or pause current track",nextTrack:"Play next track",previousTrack:"Play previous track",volumeUp:"Increase volume",volumeDown:"Decrease volume",mute:"Toggle mute",toggleSidebar:"Toggle sidebar",escape:"Close modals or go back",help:"Show this help dialog"}},lo={play:"Play",pause:"Pause",next:"Next track",previous:"Previous track",shuffleOn:"Shuffle: On",shuffleOff:"Shuffle: Off",repeatOff:"Repeat: Off",repeatTrack:"Repeat: Track",repeatPlaylist:"Repeat: Playlist",mute:"Mute",unmute:"Unmute",showQueue:"Show queue",hideQueue:"Hide queue"},co={common:Bn,auth:Wn,dashboard:qn,chat:Hn,library:Kn,profile:Gn,settings:Yn,errors:Qn,navigation:Jn,validation:Xn,pwa:Zn,tracks:eo,playlists:to,notifications:so,search:ao,analytics:ro,webhooks:no,admin:oo,keyboard:io,player:lo},uo={fr:{translation:$n},en:{translation:co}};dt.use(As).use(Qa).init({resources:uo,fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1},detection:{order:["localStorage","navigator","htmlTag"],caches:["localStorage"]}});typeof window<"u"&&(window.i18n=dt);function ho(){const e="production";{x.debug("[Sentry] Error tracking disabled",{reason:"DSN not configured",environment:e});return}}if(typeof window<"u")if(window.React=z,z.Children)try{Object.defineProperty(window,"React",{value:z,writable:!1,enumerable:!0,configurable:!1})}catch{window.React=z}else{console.error("[CRITICAL] React.Children not available after import - React may not be fully loaded");try{const e=z.Children;console.warn("[CRITICAL] React.Children accessed to force initialization")}catch(e){console.error("[CRITICAL] Cannot access React.Children:",e)}}ho();const mo=new Ls({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});async function po(){ws.USE_MSW}const fo=()=>{Ms.createRoot(document.getElementById("root")).render(s.jsx(z.StrictMode,{children:s.jsx(ks,{client:mo,children:s.jsxs(da,{future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:[s.jsx(wn,{}),s.jsx(js,{position:"top-right"})]})})}))};po().catch(e=>{console.error("[MSW] Failed to initialize; continuing without mocks",e)}).finally(()=>{fo()});export{Nr as A,vt as B,_a as C,cr as D,lr as E,ir as F,Eo as G,Bo as H,Aa as I,Wo as J,le as L,xe as N,Co as P,sa as R,Cr as T,mr as a,$e as b,de as c,So as d,No as e,Po as f,Uo as g,Vo as h,kr as i,$o as j,Mo as k,Lo as l,zo as m,k as n,_o as o,Ao as p,Oo as q,Be as r,jr as s,To as t,ee as u,Io as v,Do as w,Ro as x,Fo as y,vr as z};
|
|
//# sourceMappingURL=index-vht7ZNSp.js.map
|