1import{x as T,y as v,j as e,a6 as N,cM as D,bI as R,e as K}from"./index-CpA91pr_.js";import{A as I}from"./AdminHeader-sb0izLuz.js";import{u as P,T as _,L as F,a as L}from"./usePosGlobalSalesSeries-C2TqQe6n.js";import{R as u,C as h,X as p,Y as f,T as b,B as i,L as B}from"./generateCategoricalChart-a8beUj7n.js";import{A as q,a as M,B as S}from"./AreaChart-DvOMMZQv.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const U=T("ChartNoAxesColumn",[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]]),C={billet:"#B07F17",pass:"#2A6FD0",boutique:"#D9542B",cafe:"#7B4BC4",experiences:"#0E8C6A"},z={cash:C.billet,sumup:C.pass},r={cumulative:"#1C1B19",density:"#D8D5CD",grid:"#E3E0D8"},G=[{id:1,label:"Aujourdâhui"},{id:7,label:"7j"},{id:30,label:"30j"},{id:90,label:"90j"},{id:365,label:"1a"},{id:9999,label:"Tout"}],Y=[{id:"all",label:"Tout"},{id:"billet",label:"Billets"},{id:"pass",label:"Pass"},{id:"boutique",label:"Boutique"},{id:"cafe",label:"Café"},{id:"experiences",label:"Expériences"}],$=[{id:"all",label:"Tout"},{id:"cash",label:"Esp."},{id:"sumup",label:"SumUp"}],w=t=>K("h-7 min-h-0 shrink-0 rounded-md px-2 text-[11px] font-medium leading-none transition",t?"bg-foreground text-background":"border border-border bg-card text-muted-foreground hover:border-foreground
6/30"),j=C,E=z,H=r.density,k=r.cumulative;function l(t){return`${t.toFixed(2).replace(".",",")} â¬`}function g({title:t,children:y,className:n}){return e.jsxs("div",{className:K("flex h-full min-h-0 min-w-0 flex-col overflow-hidden rounded-xl border border-border bg-card shadow-[0_1px_2px_hsl(var(--foreground)/0.04)]",n),children:[e.jsx("div",{className:"shrink-0 border-b border-border/70 px-2.5 py-1.5",children:e.jsx("h3",{className:"truncate font-sans text-[10px] font-semibold uppercase tracking-[0.16em] text-muted-foreground",children:t})}),e.jsx("div",{className:"min-h-0 flex-1 p-0.5",children:y})]})}function Q(){const[t,y]=v.useState(1),[n,A]=v.useState({category:"all",payment:"all"}),d=P(t,n),o=v.useMemo(()=>{const s=d.data??[],a=s[s.length-1];return{days:s.length,cum:(a==null?void 0:a.cumulativeTotal)??0,tickets:s.reduce((x,m)=>x+m.ticketCount,0),cash:s.reduce((x,m)=>x+m.cash,0),sumup:s.reduce((x,m)=>x+m.sumup,0)}},[d.data]),c=d.data??[];return e.jsxs("div",{className:"flex h-[100dvh] max-h-[100dvh] flex-col overflow-hidden bg-muted/60 font-sans text-foreground",children:[e.jsx(I,{title:"Vue globale",variant:"admin"}),e.jsx("div",{className:"shrink-0 border-b border-border bg-card/80 backdrop-blur",children:e.jsx("div",{className:"mx-auto max-w-7xl overflow-x-auto px-2 py-1.5 [scrollbar-width:thin] sm:px-3",style:{WebkitOverflowScrolling:"touch"},children:e.jsxs("div",{className:"flex w-max min-w-0 items-center gap-1.5 pr-1 sm:pr-0",children:[e.jsx("span",{className:"shrink-0 pl-0.5 text-[9px] font-medium uppercase tracking-[0.18em] text-muted-foreground",children:"Pér."}),G.map(s=>e.jsx(N,{type:"button",size:"sm",variant:"ghost",className:w(t===s.id),onClick:()=>y(s.id),children:s.label},s.id)),e.jsx("div",{className:"h-4 w-px shrink-0 bg-border","aria-hidden":!0}),e.jsx("span",{className:"shrink-0 pl-0.5 text-[9px] font-medium uppercase tracking-[0.18em] text-muted-foreground",children:"Cat."}),Y.map(s=>e.jsx(N,{type:"button",size:"sm",variant:"ghost",className:w(n.category===s.id),onClick:()=>A(a=>({...a,category:s.id})),children:s.label},s.id)),e.jsx("div",{className:"h-4 w-px shrink-0 bg-border","aria-hidden":!0}),e.jsx("span",{className:"shrink-0 pl-0.5 text-[9px] font-medium uppercase tracking-[0.18em] text-muted-foreground",children:"Moy"}),$.map(s=>e.jsx(N,{type:"button",size:"sm",variant:"ghost",className:w(n.payment===s.id),onClick:()=>A(a=>({...a,payment:s.id})),children:s.label},s.id))]})})}),e.jsx("main",{className:"mx-auto flex min-h-0 w-full max-w-7xl flex-1 flex-col overflow-hidden px-2 py-1.5 sm:px-3 sm:py-2",children:d.isLoading?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Chargementâ¦"}):d.isError?e.jsx("p",{className:"text-sm text-red-600",children:"Chargement impossible."}):e.jsxs("div",{className:"flex min-h-0 w-full flex-1 flex-col gap-1.5",children:[e.jsx("div",{className:"shrink-0 grid grid-cols-2 gap-1.5 sm:grid-cols-4 sm:gap-2",children:[{label:"Cumul",v:l(o.cum),sub:"période",icon:_},{label:"Tickets",v:String(o.tickets),sub:"lignes",icon:D},{label:"Jours",v:String(o.days),sub:"actifs",icon:U},{label:"Esp. / SumUp",v:e.jsxs("span",{className:"flex items-center gap-2 text-sm font-semibold text-foreground sm:text-base",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{"aria-hidden":!0,className:"size-1.5 shrink-0 rounded-full",style:{background:z.cash}}),l(o.cash)]}),e.jsx("span",{className:"text-border","aria-hidden":!0,children:"·"}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{"aria-hidden":!0,className:"size-1.5 shrink-0 rounded-full",style:{background:z.sumup}}),l(o.sumup)]})]}),sub:"",icon:R}].map(s=>e.jsxs("div",{className:"relative flex min-h-0 flex-col justify-center rounded-xl border border-border bg-card px-2.5 py-1.5 shadow-[0_1px_2px_hsl(var(--foreground)/0.04)] sm:px-3 sm:py-2",children:[e.jsx("p",{className:"text-[9px] font-medium uppercase tracking-[0.18em] text-muted-foreground",children:s.label}),e.jsxs("div",{className:"mt-0.5 flex items-baseline justify-between gap-1",children:[e.jsx("p",{className:"line-clamp-1 text-base font-semibold tabular-nums sm:text-lg",children:s.v}),e.jsx(s.icon,{className:"h-3.5 w-3.5 shrink-0 text-gold","aria-hidden":!0})]}),s.sub?e.jsx("p",{className:"text-[9px] text-muted-foreground",children:s.sub}):null]},s.label))}),e.jsx("div",{className:"min-h-0 flex-[1.1] sm:flex-[1.2]",children:e.jsxs("div",{className:"grid h-full min-h-0 grid-cols-1 gap-1.5 sm:grid-cols-3",children:[e.jsx(g,{title:"Cumul",children:e.jsx("div",{className:"h-full w-full min-h-0",children:e.jsx(u,{width:"100%",height:"100%",children:e.jsxs(q,{data:c,margin:{top:2,right:4,left:-6,bottom:0},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"vgCum",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:k,stopOpacity:.18}),e.jsx("stop",{offset:"100%",stopColor:k,stopOpacity:0})]})}),e.jsx(h,{strokeDasharray:"3 3",stroke:r.grid}),e.jsx(p,{dataKey:"label",tick:{fontSize:8}
6,tickLine:!1,axisLine:!1}),e.jsx(f,{tick:{fontSize:8},tickLine:!1,width:32,tickFormatter:s=>`${s}â¬`}),e.jsx(b,{contentStyle:{borderRadius:8,border:"1px solid #e4e4e7",fontSize:11},formatter:s=>[l(s),""]}),e.jsx(M,{type:"monotone",dataKey:"cumulativeTotal",stroke:k,fill:"url(#vgCum)",strokeWidth:1.2})]})})})}),e.jsx(g,{title:"Par jour (â¬)",children:e.jsx("div",{className:"h-full w-full min-h-0",children:e.jsx(u,{width:"100%",height:"100%",children:e.jsxs(S,{data:c,margin:{top:2,right:4,left:-6,bottom:0},children:[e.jsx(h,{strokeDasharray:"3 3",stroke:r.grid}),e.jsx(p,{dataKey:"label",tick:{fontSize:8},tickLine:!1,axisLine:!1}),e.jsx(f,{tick:{fontSize:8},tickLine:!1,width:32,tickFormatter:s=>`${s}â¬`}),e.jsx(b,{contentStyle:{borderRadius:8,border:"1px solid #e4e4e7"},formatter:s=>[l(s),""]}),e.jsx(i,{dataKey:"total",name:"Jour",fill:k,radius:[4,4,0,0],maxBarSize:32})]})})})}),e.jsx(g,{title:"Moy. paiement",children:e.jsx("div",{className:"h-full w-full min-h-0",children:e.jsx(u,{width:"100%",height:"100%",children:e.jsxs(F,{data:c,margin:{top:2,right:4,left:-6,bottom:0},children:[e.jsx(h,{strokeDasharray:"3 3",stroke:r.grid}),e.jsx(p,{dataKey:"label",tick:{fontSize:8},tickLine:!1,axisLine:!1}),e.jsx(f,{tick:{fontSize:8},tickLine:!1,width:32,tickFormatter:s=>`${s}â¬`}),e.jsx(b,{contentStyle:{borderRadius:8,border:"1px solid #e4e4e7"},formatter:s=>[l(s),""]}),e.jsx(B,{wrapperStyle:{fontSize:9}}),e.jsx(L,{type:"monotone",dataKey:"cash",name:"Esp.",stroke:E.cash,strokeWidth:1.4,dot:!1}),e.jsx(L,{type:"monotone",dataKey:"sumup",name:"SumUp",stroke:E.sumup,strokeWidth:1.4,dot:!1})]})})})})]})}),e.jsx("div",{className:"min-h-0 flex-1",children:e.jsxs("div",{className:"grid h-full min-h-0 grid-cols-1 gap-1.5 sm:grid-cols-2",children:[e.jsx(g,{title:"Par univers (empilé)",children:e.jsx("div",{className:"h-full w-full min-h-0",children:e.jsx(u,{width:"100%",height:"100%",children:e.jsxs(S,{data:c,margin:{top:2,right:4,left:-4,bottom:0},barSize:10,children:[e.jsx(h,{strokeDasharray:"3 3",stroke:r.grid}),e.jsx(p,{dataKey:"label",tick:{fontSize:8},tickLine:!1}),e.jsx(f,{tick:{fontSize:8},width:32,tickFormatter:s=>`${s}â¬`}),e.jsx(b,{contentStyle:{borderRadius:8,border:"1px solid #e4e4e7"},formatter:s=>[l(s),""]}),e.jsx(B,{wrapperStyle:{fontSize:8}}),e.jsx(i,{dataKey:"billet",name:"Billets",stackId:"a",fill:j.billet}),e.jsx(i,{dataKey:"pass",name:"Adhésions",stackId:"a",fill:j.pass}),e.jsx(i,{dataKey:"boutique",name:"Boutique",stackId:"a",fill:j.boutique}),e.jsx(i,{dataKey:"cafe",name:"Café",stackId:"a",fill:j.cafe}),e.jsx(i,{dataKey:"experiences",name:"Expériences",stackId:"a",fill:j.experiences})]})})})}),e.jsx(g,{title:"Ventes / jour (densité)",children:e.jsx("div",{className:"h-full w-full min-h-0",children:e.jsx(u,{width:"100%",height:"100%",children:e.jsxs(S,{data:c,margin:{top:2,right:4,left:-4,bottom:0},children:[e.jsx(h,{strokeDasharray:"3 3",stroke:r.grid}),e.jsx(p,{dataKey:"label",tick:{fontSize:8},tickLine:!1}),e.jsx(f,{allowDecimals:!1,tick:{fontSize:8},width:28}),e.jsx(b,{contentStyle:{borderRadius:8,border:"1px solid #e4e4e7"}}),e.jsx(i,{dataKey:"ticketCount",name:"N",fill:H,radius:[4,4,0,0],maxBarSize:28})]})})})})]})})]})})]})}export{Q as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.