- apps/web: test updates (Vitest/setup), playbackAnalyticsService, TrackGrid, serviceErrorHandler - veza-common: logging, metrics, traits, validation, random - veza-stream-server: audio pipeline, codecs, cache, monitoring, routes - apps/web/dist_verification: refresh build assets (content-hashed filenames) Co-authored-by: Cursor <cursoragent@cursor.com>
2 lines
13 KiB
JavaScript
2 lines
13 KiB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/chatStore-Cmmpwqns.js","assets/index-BMBS6scK.js","assets/vendor-react-C9dYU-TK.js","assets/vendor-CjLUfV8Y.js","assets/vendor-security-DsrNJhpn.js","assets/vendor-BD_zwJK7.css","assets/vendor-router-Dr0ZB7zf.js","assets/vendor-tanstack-C4XaEYj2.js","assets/vendor-http-CctT3C58.js","assets/vendor-utils-D0JLFg89.js","assets/vendor-icons-BSV6HBy1.js","assets/vendor-motion-CbAtAbUE.js","assets/vendor-i18n-PN7w4axr.js","assets/index-BjN9SWon.css"])))=>i.map(i=>d[i]);
|
|
import{j as e,a as c}from"./vendor-react-C9dYU-TK.js";import{a as F,L as k}from"./vendor-router-Dr0ZB7zf.js";import{s as I,g as T,_ as v,t as g,v as Q,h as E,C as m,b as h,d as S,c as p,f as x,e as y,B as P}from"./index-BMBS6scK.js";import{b as _,u as M}from"./vendor-tanstack-C4XaEYj2.js";import{ab as U,ad as R,ac as B}from"./vendor-CjLUfV8Y.js";import"./chatStore-Cmmpwqns.js";import{A as H,m as K}from"./vendor-motion-CbAtAbUE.js";import{A as O}from"./AnimatedNumber-C7V3zEin.js";import{J as j,W as N,L as $,U as L,o as V,Y as z,u as W,S as J}from"./vendor-icons-BSV6HBy1.js";import"./vendor-http-CctT3C58.js";import"./vendor-utils-D0JLFg89.js";import"./vendor-i18n-PN7w4axr.js";import"./vendor-security-DsrNJhpn.js";U()(R(B(r=>({filters:{},setFilters:a=>{r({filters:a})}}),{name:"library-storage",partialize:r=>({filters:r.filters})}),{name:"LibraryStore",enabled:I()}));const d={all:["library"],items:r=>[...d.all,"items",r],favorites:()=>[...d.all,"favorites"]};async function Y(r={}){const{page:a=1,limit:s=20,type:o,search:n}=r,i=(await T.get("/tracks",{params:{page:a,limit:s,type:o,search:n}})).data,u=Array.isArray(i.items)?i.items:Array.isArray(i)?i:[];return{...i,items:u,page:i.page||a,limit:i.limit||s,total:i.total||0,has_next:i.has_next??!1,has_prev:i.has_prev??!1}}async function G(){const a=(await T.get("/tracks",{params:{page:1,limit:100,type:"favorites"}})).data;return Array.isArray(a.items)?a.items:Array.isArray(a)?a:[]}function q(r={}){return _({queryKey:d.items(r),queryFn:()=>Y(r),staleTime:300*1e3,gcTime:600*1e3})}function X(){return _({queryKey:d.favorites(),queryFn:G,staleTime:300*1e3,gcTime:600*1e3})}function Z(r={}){const{data:a}=q(r);return a?.items??[]}function ee(){const r=q({}),a=X();return{isLoading:r.isLoading||a.isLoading,error:r.error||a.error}}function re(){const r=M();return{fetchItems:async a=>{await r.refetchQueries({queryKey:d.items(a)})},fetchFavorites:async()=>{await r.refetchQueries({queryKey:d.favorites()})},uploadFile:async(a,s)=>{const{apiClient:o}=await v(async()=>{const{apiClient:l}=await import("./chatStore-Cmmpwqns.js").then(i=>i.c);return{apiClient:l}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])),n=new FormData;n.append("file",a),n.append("title",s.title),s.description&&n.append("description",s.description),await o.post("/tracks",n,{headers:{"Content-Type":"multipart/form-data"}}),await r.invalidateQueries({queryKey:d.all})},toggleFavorite:async a=>{const{apiClient:s}=await v(async()=>{const{apiClient:o}=await import("./chatStore-Cmmpwqns.js").then(n=>n.c);return{apiClient:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]));await s.post(`/tracks/${a}/favorite`),await r.invalidateQueries({queryKey:d.all})},deleteItem:async a=>{const{apiClient:s}=await v(async()=>{const{apiClient:o}=await import("./chatStore-Cmmpwqns.js").then(n=>n.c);return{apiClient:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]));await s.delete(`/tracks/${a}`),await r.invalidateQueries({queryKey:d.all})},clearItems:()=>{r.invalidateQueries({queryKey:d.all})}}}function ae({isLoading:r,skeleton:a,children:s,className:o}){return e.jsx("div",{className:o,children:e.jsx(H,{mode:"wait",children:r?e.jsx(K.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},children:a},"skeleton"):e.jsx(K.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2,delay:.05},children:s},"content")})})}function se({username:r}){const{t:a}=g(),s=new Date().getHours(),o=s<12?"dashboard.goodMorning":s<18?"dashboard.goodAfternoon":"dashboard.goodEvening";return e.jsxs("div",{className:"relative overflow-hidden rounded-xl bg-gradient-to-r from-primary/20 via-primary/10 to-transparent p-6 mb-6",children:[e.jsx("div",{className:"absolute top-0 right-0 w-64 h-64 bg-primary/10 rounded-full blur-3xl -translate-y-1/2 translate-x-1/2"}),e.jsxs("div",{className:"relative z-10",children:[e.jsxs("h1",{className:"text-heading-1",children:[a(o),","," ",e.jsx("span",{className:"text-transparent bg-clip-text bg-gradient-to-r from-primary to-secondary",children:r})]}),e.jsx("p",{className:"text-muted-foreground mt-1",children:a("dashboard.subtitle")})]})]})}const te=[{icon:z,labelKey:"dashboard.uploadTrack",path:"/library?action=upload",color:"bg-primary/10 text-primary"},{icon:W,labelKey:"dashboard.createPlaylist",path:"/library",color:"bg-success/10 text-success"},{icon:J,labelKey:"dashboard.discoverMusic",path:"/search",color:"bg-warning/10 text-warning"},{icon:N,labelKey:"dashboard.openChat",path:"/chat",color:"bg-info/10 text-info"}];function ie(){const{t:r}=g();return e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 mb-6",children:te.map((a,s)=>e.jsxs(k,{to:a.path,className:"group flex items-center gap-3 p-4 rounded-xl border border-border hover:border-primary/30 hover:bg-muted/50 transition-all duration-[var(--sumi-duration-normal)] animate-stagger-in",style:{animationDelay:`${s*60}ms`},children:[e.jsx("div",{className:p("p-2.5 rounded-lg",a.color),children:e.jsx(a.icon,{className:"h-5 w-5"})}),e.jsx("span",{className:"text-sm font-medium group-hover:text-foreground transition-colors",children:r(a.labelKey)})]},a.labelKey))})}function f({title:r,viewAllPath:a}){const{t:s}=g();return e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h2",{className:"text-heading-3",children:r}),a&&e.jsxs(k,{to:a,className:"text-caption hover:text-foreground transition-colors",children:[s("dashboard.viewAll")," →"]})]})}const oe=[{titleKey:"dashboard.stats.tracksListened",value:1234,change:"+12%",icon:j,color:"text-primary",shadow:"drop-shadow-stat-icon"},{titleKey:"dashboard.stats.messagesSent",value:567,change:"+8%",icon:N,color:"text-success",shadow:"drop-shadow-stat-icon"},{titleKey:"dashboard.stats.favorites",value:89,change:"+23%",icon:V,color:"text-destructive",shadow:"drop-shadow-stat-icon"},{titleKey:"dashboard.stats.activeFriends",value:45,change:"+5%",icon:L,color:"text-destructive",shadow:"drop-shadow-stat-icon"}];function fe(){const{t:r}=g(),a=F(),{data:s}=Q(),o=Z(),{fetchItems:n}=re(),{isLoading:l,error:i}=ee();c.useEffect(()=>{n({limit:5})},[n]);const u=c.useCallback(()=>a("/library?action=upload"),[a]),w=c.useCallback(()=>a("/chat"),[a]),A=c.useCallback(()=>a("/library"),[a]),C=c.useCallback(()=>a("/social"),[a]),D=c.useMemo(()=>[{labelKey:"dashboard.newTrack",icon:j,color:"hover:text-primary",border:"hover:border-primary/50",action:u},{labelKey:"dashboard.newChat",icon:N,color:"hover:text-success",border:"hover:border-success/50",action:w},{labelKey:"dashboard.library",icon:$,color:"hover:text-destructive",border:"hover:border-destructive/50",action:A},{labelKey:"dashboard.inviteFriends",icon:L,color:"hover:text-foreground",border:"hover:border-primary/50",action:C}],[u,w,A,C]);return i?e.jsx("div",{className:"p-6",children:e.jsx(E,{error:i,onRetry:()=>n({limit:5})})}):e.jsxs("div",{className:"space-y-6 p-6 pb-24",children:[e.jsx(se,{username:s?.first_name||s?.username||"there"}),e.jsx(ie,{}),e.jsx("section",{"aria-label":"Performance statistics",className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:oe.map(t=>e.jsxs(m,{variant:"glass",className:"group hover:border-primary/50 transition-all duration-[var(--sumi-duration-normal)]",children:[e.jsxs(h,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(S,{className:"text-sm font-medium text-muted-foreground group-hover:text-foreground transition-colors duration-[var(--duration-fast)]",children:r(t.titleKey)}),e.jsx(t.icon,{className:p("h-4 w-4 transition-all duration-[var(--sumi-duration-normal)]",t.color,t.shadow,"group-hover:scale-110")})]}),e.jsxs(x,{children:[e.jsx(O,{value:t.value,className:"text-2xl font-bold text-foreground tracking-tight"}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[e.jsx("span",{className:"text-success font-medium",children:t.change})," ",r("dashboard.fromLastMonth")]})]})]},t.titleKey))}),e.jsxs("section",{"aria-label":"Activity and content",className:"grid gap-6 md:grid-cols-2 lg:grid-cols-3",children:[e.jsxs(m,{className:"md:col-span-2",variant:"glass",children:[e.jsxs(h,{children:[e.jsx(f,{title:r("dashboard.recentActivity"),viewAllPath:"/library"}),e.jsx(y,{children:r("dashboard.recentActivityDescription")})]}),e.jsx(x,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center space-x-4 p-3 rounded-lg hover:bg-muted/50 transition-colors duration-[var(--duration-fast)] border border-transparent hover:border-border",children:[e.jsx("div",{className:"w-2 h-2 bg-primary rounded-full shadow-status-dot-cyan animate-pulse"}),e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:r("dashboard.activity.newTrackAdded")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"2 hours ago"})]})]}),e.jsxs("div",{className:"flex items-center space-x-4 p-3 rounded-lg hover:bg-muted/50 transition-colors duration-[var(--duration-fast)] border border-transparent hover:border-border",children:[e.jsx("div",{className:"w-2 h-2 bg-success rounded-full shadow-status-dot-lime"}),e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:r("dashboard.activity.messageFrom",{user:"alice"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"4 hours ago"})]})]}),e.jsxs("div",{className:"flex items-center space-x-4 p-3 rounded-lg hover:bg-muted/50 transition-colors duration-[var(--duration-fast)] border border-transparent hover:border-border",children:[e.jsx("div",{className:"w-2 h-2 bg-destructive rounded-full shadow-status-dot-magenta"}),e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:r("dashboard.activity.newFavoriteAdded")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"6 hours ago"})]})]})]})})]}),e.jsxs(m,{variant:"glass",children:[e.jsxs(h,{children:[e.jsx(f,{title:r("dashboard.recentTracks"),viewAllPath:"/library"}),e.jsx(y,{children:r("dashboard.recentTracksDescription")})]}),e.jsx(x,{children:e.jsx(ae,{isLoading:l,skeleton:e.jsx("div",{className:"space-y-4",children:[...Array(3)].map((t,b)=>e.jsxs("div",{className:"flex items-center space-x-4 animate-pulse",children:[e.jsx("div",{className:"w-10 h-10 bg-muted rounded"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx("div",{className:"h-3 bg-muted rounded w-3/4"}),e.jsx("div",{className:"h-2 bg-muted rounded w-1/2"})]})]},b))}),children:e.jsxs("div",{className:"space-y-4",children:[o.slice(0,3).map(t=>e.jsxs("div",{className:"flex items-center space-x-4 p-2 rounded-lg hover:bg-white/5 transition-colors duration-[var(--duration-fast)] cursor-pointer group border border-transparent hover:border-white/5",children:[e.jsx("div",{className:"w-10 h-10 bg-muted/50 rounded flex items-center justify-center border border-border group-hover:border-primary/50 transition-colors shadow-lg",children:e.jsx(j,{className:"h-4 w-4 text-muted-foreground group-hover:text-primary transition-colors"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium truncate text-foreground group-hover:text-primary transition-colors",children:t.title}),e.jsx("p",{className:"text-xs text-muted-foreground truncate group-hover:text-foreground/80",children:t.description||"No description"})]})]},t.id)),o.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:r("dashboard.noTracksInLibrary")})]})})})]})]}),e.jsxs(m,{variant:"glass",className:"overflow-hidden",children:[e.jsxs(h,{children:[e.jsx(f,{title:r("dashboard.quickActions")}),e.jsx(y,{children:r("dashboard.quickActionsDescription")})]}),e.jsx(x,{children:e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:D.map((t,b)=>e.jsxs(P,{variant:"outline",onClick:t.action,className:p("h-24 flex-col gap-3 bg-muted/30 border-border hover:bg-muted/50 transition-all duration-[var(--sumi-duration-normal)] group",t.border),children:[e.jsx("div",{className:p("w-10 h-10 rounded-full bg-muted/50 flex items-center justify-center transition-all duration-[var(--sumi-duration-normal)] group-hover:scale-110",t.color),children:e.jsx(t.icon,{className:"h-5 w-5"})}),e.jsx("span",{className:"text-muted-foreground group-hover:text-foreground transition-colors duration-[var(--duration-fast)]",children:r(t.labelKey)})]},b))})})]})]})}export{fe as DashboardPage,fe as default};
|