vendor: 4,301 bytes, lines 1-22
1import{r as o,F as q,j as e,B as de,G as xe,o as G,W as me,l as pe,D as ge,p as ue,H as he,J as Ce,K as Ae,A as H,E as fe,O as je}from"./vendor-radix-DzOO2cmU.js";import{k as T,a2 as j,aN as Y,u as be,b as Ne,t as S,c as C,D as ve,U as I,C as A,f,T as ye,M as z,Y as we,I as De,B as w,L as F,G as Se,aO as ke,aP as Pe,aQ as Ee,aR as k,aS as V,aT as Te,aU as _e,S as Me,aV as Re,r as Le,v as Ie}from"./index-CEKQWnFw.js";import{S as $e}from"./switch-ChJQutMV.js";import{L as Oe}from"./label-TMtQzwSw.js";import{A as Ue,C as Be,a as ze}from"./chevrons-right-CiJ7PvfC.js";import{D as Fe}from"./download-CvCDmpeX.js";import{E as Ve}from"./eye-DijmpF25.js";import{C as W}from"./circle-check-big-OvjjpYmY.js";import{T as We}from"./trash-2-DYcI4TNY.js";import{C as qe}from"./chevron-left-ePRNF3l0.js";/** 2 * @license lucide-react v0.453.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 Ge=T("ClipboardCheck",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]);/** 7 * @license lucide-react v0.453.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const He=T("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** 12 * @license lucide-react v0.453.0 - ISC 13 * 14 * This source code is licensed under the ISC license. 15 * See the LICENSE file in the root directory of this source tree. 16 */const Ye=T("UserX",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]);/** 17 * @license lucide-react v0.453.0 - ISC 18 * 19 * This source code is licensed under the ISC license. 20 * See the LICENSE file in the root directory of this source tree. 21 */const Qe=T("Wallet",[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]]);var Q="AlertDialog",[Xe]=pe(Q,[q]),u=q(),X=s=>{const{__scopeAlertDialog:a,...l}=s,c=u(a);return e.jsx(de,{...c,...l,modal:!0})};X.displayName=Q;var Je="AlertDialogTrigger",J=o.forwardRef((s,a)=>{const{__scopeAlertDialog:l,...c}=s,r=u(l);return e.jsx(xe,{...r,...c,ref:a})});J.displayName=Je;var Ke="AlertDialogPortal",K=s=>{const{__scopeAlertDialog:a,...l}=s,c=u(a);return e.jsx(fe,{...c,...l})};K.displayName=Ke;var Ze="AlertDialogOverlay",Z=o.forwardRef((s,a)=>{const{__scopeAlertDialog:l,...c}=s,r=u(l);return e.jsx(je,{...r,...c,ref:a})});Z.displayName=Ze;var D="AlertDialogContent",[et,tt]=Xe(D),st=he("AlertDialogContent"),ee=o.forwardRef((s,a)=>{const{__scopeAlertDialog:l,children:c,...r}=s,i=u(l),p=o.useRef(null),_=G(a,p),P=o.useRef(null);return e.jsx(me,{contentName:D,titleName:te,docsSlug:"alert-dialog",children:e.jsx(et,{scope:l,cancelRef:P,children:e.jsxs(ge,{role:"alertdialog",...i,...r,ref:_,onOpenAutoFocus:ue(r.onOpenAutoFocus,d=>{d.preventDefault(),P.current?.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[e.jsx(st,{children:c}),e.jsx(lt,{contentRef:p})]})})})});ee.displayName=D;var te="AlertDialogTitle",se=o.forwardRef((s,a)=>{const{__scopeAlertDialog:l,...c}=s,r=u(l);return e.jsx(Ce,{...r,...c,ref:a})});se.displayName=te;var ae="AlertDialogDescription",le=o.forwardRef((s,a)=>{const{__scopeAlertDialog:l,...c}=s,r=u(l);return e.jsx(Ae,{...r,...c,ref:a})});le.displayName=ae;var at="AlertDialogAction",ne=o.forwardRef((s,a)=>{const{__scopeAlertDialog:l,...c}=s,r=u(l);return e.jsx(H,{...r,...c,ref:a})});ne.displayName=at;var ie="AlertDialogCancel",ce=o.forwardRef((s,a)=>{const{__scopeAlertDialog:l,...c}=s,{cancelRef:r}=tt(ie,l),i=u(l),p=G(a,r);return e.jsx(H,{...i,...c,ref:p})});ce.displayName=ie;var lt=({contentRef:s})=>{const a=`\`${D}\` requires a description for the component to be accessible for screen reader users. 22
23You can add a description to the \`${D}\` by passing a \`${ae}\` component as a child, which also benefits sighted users by adding visible context to the dialog. 24 25Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${D}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. 26 27For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return o.useEffect(()=>{document.getElementById(s.current?.getAttribute("aria-describedby"))||console.warn(a)},[a,s]),null},nt=X,it=J,ct=K,rt=Z,ot=ee,dt=ne,xt=ce,mt=se,pt=le;function gt({...s}){return e.jsx(nt,{"data-loc":"client/src/components/ui/alert-dialog.tsx:10","data-slot":"alert-dialog",...s})}function ut({...s}){return e.jsx(it,{"data-loc":"client/src/components/ui/alert-dialog.tsx:17","data-slot":"alert-dialog-trigger",...s})}function ht({...s}){return e.jsx(ct,{"data-loc":"client/src/components/ui/alert-dialog.tsx:25","data-slot":"alert-dialog-portal",...s})}function Ct({className:s,...a}){return e.jsx(rt,{"data-loc":"client/src/components/ui/alert-dialog.tsx:34","data-slot":"alert-dialog-overlay",className:j("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",s),...a})}function At({className:s,...a}){return e.jsxs(ht,{"data-loc":"client/src/components/ui/alert-dialog.tsx:50",children:[e.jsx(Ct,{"data-loc":"client/src/components/ui/alert-dialog.tsx:51"}),e.jsx(ot,{"data-loc":"client/src/components/ui/alert-dialog.tsx:52","data-slot":"alert-dialog-content",className:j("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] max-h-[90vh] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg overflow-y-auto",s),...a})]})}function $t({className:s,...a}){return e.jsx("div",{"data-loc":"client/src/components/ui/alert-dialog.tsx:69","data-slot":"alert-dialog-header",className:j("flex flex-col gap-2 text-center sm:text-left",s),...a}
27)}function Ot({className:s,...a}){return e.jsx("div",{"data-loc":"client/src/components/ui/alert-dialog.tsx:82","data-slot":"alert-dialog-footer",className:j("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",s),...a})}function ft({className:s,...a}){return e.jsx(mt,{"data-loc":"client/src/components/ui/alert-dialog.tsx:98","data-slot":"alert-dialog-title",className:j("text-lg font-semibold",s),...a})}function jt({className:s,...a}){return e.jsx(pt,{"data-loc":"client/src/components/ui/alert-dialog.tsx:111","data-slot":"alert-dialog-description",className:j("text-muted-foreground text-sm",s),...a})}function bt({className:s,...a}){return e.jsx(dt,{"data-loc":"client/src/components/ui/alert-dialog.tsx:124",className:j(Y(),s),...a})}function Nt({className:s,...a}){return e.jsx(xt,{"data-loc":"client/src/components/ui/alert-dialog.tsx:136",className:j(Y({variant:"outline"}),s),...a})}const $=20,vt={pro:"bg-violet-100 text-violet-700 border-violet-200",etudiant:"bg-gray-100 text-gray-700 border-gray-200",essentiel:"bg-blue-100 text-blue-700 border-blue-200",avance:"bg-purple-100 text-purple-700 border-purple-200",cabinet:"bg-amber-100 text-amber-700 border-amber-200"},yt={pro:"Pro",etudiant:"Accès gratuit (ancien)",essentiel:"Essentiel",avance:"Avancé",cabinet:"Cabinet"},wt=(s,a,l)=>l?.startsWith("cus_admin_")?"Forcé":s==="pro"&&!a?"Prospect":s==="pro"&&a?"Pro":yt[s]??s;function Dt(){const{t:s}=be(),[,a]=Ne(),{data:l,isLoading:c,refetch:r}=S.adminClients.list.useQuery(),{data:i}=S.adminClients.subscriptionStats.useQuery(),[p,_]=o.useState(""),[P,d]=o.useState(1),[m,O]=o.useState("all"),[M,re]=o.useState(!1),E=S.adminClients.changeRole.useMutation({onSuccess:()=>{r(),C.success("Rôle modifié avec succès")},onError:t=>{C.error(t.message)}}),R=S.adminClients.deleteUser.useMutation({onSuccess:()=>{r(),C.success("Utilisateur supprimé avec succès")},onError:t=>{C.error(t.message)}}),U=S.adminClients.forceSubscription.useMutation({onSuccess:()=>{r(),C.success("Abonnement forcé avec succès")},onError:t=>{C.error(t.message)}}),oe=t=>!!(["essentiel","avance","cabinet"].includes(t.plan)||t.plan==="etudiant"&&!t.stripeCustomerId),L=o.useMemo(()=>{if(!l)return[];const t=15,v=new Date;let g=l;if(M||(g=g.filter(n=>!oe(n))),m!=="all"&&(g=g.filter(n=>{switch(m){case"prospects":return n.plan==="pro"&&!n.stripeCustomerId;case"cardValidated":return n.plan==="pro"&&!!n.stripeCustomerId;case"onboardingDone":return n.plan==="pro"&&n.onboardingCompleted;case"trialExpired":{if(n.plan!=="pro"||n.stripeSubscriptionId)return!1;const x=n.planStartedAt||n.createdAt;return x?(v.getTime()-new Date(x).getTime())/864e5>t:!1}case"activePaid":return i?.activePaidUserIds?.includes(n.id)??(n.plan==="pro"&&!!n.stripeSubscriptionId);case"unsubscribed":return n.plan==="etudiant"&&!!n.stripeCustomerId;default:return!0}})),p.trim()){const n=p.toLowerCase();g=g.filter(x=>(x.name??"").toLowerCase().includes(n)||(x.email??"").toLowerCase().includes(n)||(x.firstName??"").toLowerCase().includes(n)||(x.lastName??"").toLowerCase().includes(n)||(x.plan??"").toLowerCase().includes(n))}return g},[l,p,m,M,i]),b=Math.max(1,Math.ceil(L.length/$)),N=Math.min(P,b),B=L.slice((N-1)*$,N*$),y=t=>{O(v=>v===t?"all":t),d(1)};return e.jsx(ve,{"data-loc":"client/src/pages/AdminClients.tsx:146",children:e.jsxs("div",{"data-loc":"client/src/pages/AdminClients.tsx:147",className:"container max-w-6xl py-6 space-y-6",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminClients.tsx:149",children:[e.jsxs("h1",{"data-loc":"client/src/pages/AdminClients.tsx:150",className:"text-2xl font-heading font-bold text-navy flex items-center gap-2",children:[e.jsx(I,{"data-loc":"client/src/pages/AdminClients.tsx:151",className:"h-6 w-6 text-teal-500"}),"Admin Client"]}),e.jsx("p",{"data-loc":"client/src/pages/AdminClients.tsx:154",className:"text-muted-foreground mt-1",children:"Tunnel de conversion et suivi des utilisateurs."})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminClients.tsx:160",className:"space-y-3",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminClients.tsx:161",className:"grid grid-cols-2 sm:grid-cols-4 lg:grid-cols-7 gap-3",children:[e.jsx(A,{"data-loc":"client/src/pages/AdminClients.tsx:163",className:`border-gray-200 cursor-pointer transition-all hover:shadow-md ${m==="all"?"ring-2 ring-gray-400 shadow-md":""}`,onClick:()=>O("all"),children:e.jsxs(f,{"data-loc":"client/src/pages/AdminClients.tsx:164",className:"p-3",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminClients.tsx:165",className:"flex items-center gap-2 mb-1",children:[e.jsx(I,{"data-loc":"client/src/pages/AdminClients.tsx:166",className:"h-4 w-4 text-gray-500"}),e.jsx("p",{"data-loc":"client/src/pages/AdminClients.tsx:167",className:"text-xs text-muted-foreground font-medium",children:"Total inscrits"})]}),e.jsx("p",{"data-loc":"client/src/pages/AdminClients.tsx:169",className:"text-2xl font-bold text-navy",children:i?.total??"â"}),e.jsx("p",{"data-loc":"client/src/pages/AdminClients.tsx:170",className:"text-[10px] text-gray-400 mt-0.5",children:"Nouveau système"})]})}),e.jsx(A,{"data-loc":"client/src/pages/AdminClients.tsx:174",className:`border-orange-200 bg-orange-50/40 cursor-pointer transition-all hover:shadow-md ${m==="prospects"?"ring-2 ring-orange-400 shadow-md":""}`,onClick:()=>y("prospects"),children:e.jsxs(f,{"data-loc":"client/src/pages/AdminClients.tsx:175",className:"p-3",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminClients.tsx:176",className:"flex items-center gap-2 mb-1",children:[e.jsx(I,{"data-loc":"client/src/pages/AdminClients.tsx:177",className:"h-4 w-4 text-orange-500"}),e.jsx("p",{"data-loc":"client/src/pages/AdminClients.tsx:178",className:"text-xs text-orange-700 font-medium",children:"Prospects"})]}),e.jsx("p",{"data-loc":"client/src/pages/AdminClients.tsx:180",className:"text-2xl font-bold text-orange-700",children:i?.prospects??"â"}),e.jsx("p",{"data-loc":"client/src/pages/AdminClients.tsx:181",className:"text-[10px] text-orange-500 mt-0.5",children:"Ont quitté avant la CB"})]})}),e.jsx(A,{"data-loc":"client/src/pages/AdminClients.tsx:185",className:`border-sky-200 bg-sky-50/40 cursor-pointer transition-all hover:shadow-md ${m==="cardValidated"?"ring-2 ring-sky-400 shadow-md":""}`,onClick:()=>y("cardValidated"),children:e.jsxs(f,{"data-loc":"client/src/pages/AdminClients.tsx:186",className:"p-3",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminClients.tsx:187",className:"flex items-center gap-2 mb-1",children:[e.jsx(Qe,{"data-loc":"client/src/pages/AdminClients.tsx:188",className:"h-4 w-4 text-sky-500"}),e.jsx("p",{"data-loc":"client/src/pages/AdminClients.tsx:189",className:"text-xs text-sky-700 font-medium",children:"Compte créé"})]}),e.jsx("p",{"data-loc":"client/src/pages/AdminClients.tsx:191",className:"text-2xl font-bold text-sky-700",children:i?.cardValidated??"â"}),e.jsx("p",{"data-loc":"client/src/pages/AdminClients.tsx:192",className:"text-[10px] text-sky-500 mt-0.5",children:"Carte bancaire validée"})]})}),e.jsx(A,{"data-loc":"client/src/pages/AdminClients.tsx:196",className:`border-teal-200 bg-teal-50/40 cursor-pointer transition-all hover:shadow-md ${m==="onboardingDone"?"ring-2 ring-teal-400 shadow-md":""}`,onClick:()=>y("onboardingDone"),children:e.jsxs(f,{"data-loc":"client/src/pages/AdminClients.tsx:197",className:"p-3",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminClients.tsx:198",className:"flex items-center gap-2 mb-1",children:[e.jsx(Ge,{"data-loc":"client/src/pages/AdminClients.tsx:199",className:"h-4 w-4 text-teal-500"}),e.jsx("p",{"data-loc":"client/src/pages/AdminClients.tsx:200",className:"text-xs text-teal-700 font-medium",children:"Onboarding"})]}),e.jsx("p",{"data-loc":"client/src/pages/AdminClients.tsx:202",className:"text-2xl font-bold text-teal-700",children:i?.onboardingDone??"â"}),e.jsx("p",{"data-loc":"client/src/pages/AdminClients.tsx:203",className:"text-[10px] text-teal-500 mt-0.5",children:"Tutoriel terminé"})]})}),e.jsx(A,{"data-loc":"client/src/pages/AdminClients.tsx:207",className:`border-amber-200 bg-amber-50/40 cursor-pointer transition-all hover:shadow-md ${m==="trialExpired"?"ring-2 ring-amber-400 shadow-md":""}`,onClick:()=>y("trialExpired"),children:e.jsxs(f,{"data-loc":"client/src/pages/AdminClients.tsx:208",className:"p-3",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminClients.tsx:209",className:"flex items-center gap-2 mb-1",children:[e.jsx(ye,{"data-loc":"client/src/pages/AdminClients.tsx:210",className:"h-4 w-4 text-amber-500"}),e.jsx("p",{"data-loc":"client/src/pages/AdminClients.tsx:211",className:"text-xs text-amber-700 font-medium",children:"Churné sans CB"})]}),e.jsx("p",{"data-loc":"client/src/pages/AdminClients.tsx:213",className:"text-2xl font-bold text-amber-700",children:i?.trialExpired??"â"}),e.jsx("p",{"data-loc":"client/src/pages/AdminClients.tsx:214",className:"text-[10px] text-amber-500 mt-0.5",children:"Parti sans payer"})]})}),e.jsx(A,{"data-loc":"client/src/pages/AdminClients.tsx:218",className:`border-emerald-200 bg-emerald-50/40 cursor-pointer transition-all hover:shadow-md ${m==="activePaid"?"ring-2 ring-emerald-400 shadow-md":""}`,onClick:()=>y("activePaid"),children:e.jsxs(f,{"data-loc":"client/src/pages/AdminClients.tsx:219",className:"p-3",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminClients.tsx:220",className:"flex items-center gap-2 mb-1",children:[e.jsx(z,{"data-loc":"client/src/pages/AdminClients.tsx:221",className:"h-4 w-4 text-emerald-600"}),e.jsx("p",{"data-loc":"client/src/pages/AdminClients.tsx:222",className:"text-xs text-emerald-700 font-medium",children:"Abonnés actifs"})]}),e.jsx("p",{"data-loc":"client/src/pages/AdminClients.tsx:224",className:"text-2xl font-bold text-emerald-700",children:i?.activePaid??"â"}),e.jsx("p",{"data-loc":"client/src/pages/AdminClients.tsx:225",className:"text-[10px] text-emerald-600 mt-0.5",children:"Abonnement en cours"})]})}),e.jsx(A,{"data-loc":"client/src/pages/AdminClients.tsx:229",className:`border-red-200 bg-red-50/40 cursor-pointer transition-all hover:shadow-md ${m==="unsubscribed"?"ring-2 ring-red-400 shadow-md":""}`,onClick:()=>y("unsubscribed"),children:e.jsxs(f,{"data-loc":"client/src/pages/AdminClients.tsx:230",className:"p-3",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminClients.tsx:231",className:"flex items-center gap-2 mb-1",children:[e.jsx(Ye,{"data-loc":"client/src/pages/AdminClients.tsx:232",className:"h-4 w-4 text-red-500"}),e.jsx("p",{"data-loc":"client/src/pages/AdminClients.tsx:233",className:"text-xs text-red-700 font-medium",children:"Désabonnés"})]}),e.jsx("p",{"data-loc":"client/src/pages/AdminClients.tsx:235",className:"text-2xl font-bold text-red-700",children:i?.unsubscribed??"â"}),e.jsx("p",{"data-loc":"client/src/pages/AdminClients.tsx:236",className:"text-[10px] text-red-500 mt-0.5",children:"A payé, puis résilié"})]})})]}),i&&i.legacyTotal>0&&e.jsx(A,{"data-loc":"client/src/pages/AdminClients.tsx:243",className:"border-gray-200",children:e.jsxs(f,{"data-loc":"client/src/pages/AdminClients.tsx:244",className:"p-3",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminClients.tsx:245",className:"flex items-center gap-2 mb-2",children:[e.jsx(Ue,{"data-loc":"client/src/pages/AdminClients.tsx:246",className:"h-4 w-4 text-gray-400"}),e.jsx("p",{"data-loc":"client/src/pages/AdminClients.tsx:247",className:"text-xs text-muted-foreground font-medium",children:"Plans hérités (anciens inscrits â non proposés aux nouveaux)"})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminClients.tsx:249",className:"flex flex-wrap gap-4",children:[i.legacyBreakdown.etudiant>0&&e.jsxs("div",{"data-loc":"client/src/pages/AdminClients.tsx:251",className:"text-center",children:[e.jsx("p",{"data-loc":"client/src/pages/AdminClients.tsx:252",className:"text-lg font-bold text-gray-600",children:i.legacyBreakdown.etudiant}),e.jsx("p",{"data-loc":"client/src/pages/AdminClients.tsx:253",className:"text-[10px] text-gray-400",children:"Ãtudiant (gratuit)"})]}),i.legacyBreakdown.essentiel>0&&e.jsxs("div",{"data-loc":"client/src/pages/AdminClients.tsx:257",className:"text-center",children:[e.jsx("p",{"data-loc":"client/src/pages/AdminClients.tsx:258",className:"text-lg font-bold text-blue-600",children:i.legacyBreakdown.essentiel}),e.jsx("p",{"data-loc":"client/src/pages/AdminClients.tsx:259",className:"text-[10px] text-blue-400",children:"Essentiel 9,90â¬"})]}),i.legacyBreakdown.avance>0&&e.jsxs("div",{"data-loc":"client/src/pages/AdminClients.tsx:263",className:"text-center",children:[e.jsx("p",{"data-loc":"client/src/pages/AdminClients.tsx:264",className:"text-lg font-bold text-purple-600",children:i.legacyBreakdown.avance}),e.jsx("p",{"data-loc":"client/src/pages/AdminClients.tsx:265",className:"text-[10px] text-purple-400",children:"Avancé 19,90â¬"})]}),i.legacyBreakdown.cabinet>0&&e.jsxs("div",{"data-loc":"client/src/pages/AdminClients.tsx:269",className:"text-center",children:[e.jsx("p",{"data-loc":"client/src/pages/AdminClients.tsx:270",className:"text-lg font-bold text-amber-600",children:i.legacyBreakdown.cabinet}),e.jsx("p",{"data-loc":"client/src/pages/AdminClients.tsx:271",className:"text-[10px] text-amber-400",children:"Cabinet 49,90â¬"})]})]})]})})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminClients.tsx:281",className:"flex flex-col sm:flex-row gap-3 items-start sm:items-center",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminClients.tsx:282",className:"relative flex-1 w-full",children:[e.jsx(we,{"data-loc":"client/src/pages/AdminClients.tsx:283",className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(De,{"data-loc":"client/src/pages/AdminClients.tsx:284",placeholder:"Rechercher par nom, email, plan...",value:p,onChange:t=>{_(t.target.value),d(1)},className:"pl-10"})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminClients.tsx:291",className:"flex items-center gap-2 shrink-0",children:[e.jsxs(w,{"data-loc":"client/src/pages/AdminClients.tsx:292",variant:"outline",size:"sm",className:"text-xs gap-1",onClick:()=>{const t=(l??[]).filter(h=>h.plan==="pro"&&!h.stripeCustomerId);if(t.length===0){C.info("Aucun prospect à exporter");return}const v=`email,nom,date_inscription 28`+t.map(h=>`${h.email??""},${h.name??""},${h.createdAt?new Date(h.createdAt).toISOString().split("T")[0]:""}`).join(` 29`),g=new Blob([v],{type:"text/csv"}),n=URL.createObjectURL(g),x=document.createElement("a");x.href=n,x.download=`prospects_${new Date().toISOString().split("T")[0]}.csv`,x.click(),URL.revokeObjectURL(n),C.success(`${t.length} prospect(s) exporté(s)`)},children:[e.jsx(Fe,{"data-loc":"client/src/pages/AdminClients.tsx:308",className:"h-3.5 w-3.5"}),"Export prospects"]}),e.jsx($e,{"data-loc":"client/src/pages/AdminClients.tsx:311",id:"show-legacy",checked:M,onCheckedChange:re}),e.jsx(Oe,{"data-loc":"client/src/pages/AdminClients.tsx:312",htmlFor:"show-legacy",className:"text-xs text-muted-foreground cursor-pointer",children:"Afficher plans hérités"})]})]}),c?e.jsx("div",{"data-loc":"client/src/pages/AdminClients.tsx:320",className:"flex items-center justify-center py-12",children:e.jsx(F,{"data-loc":"client/src/pages/AdminClients.tsx:321",className:"h-6 w-6 animate-spin text-gold-dark"})}):e.jsx("div",{"data-loc":"client/src/pages/AdminClients.tsx:324",className:"overflow-x-auto rounded-lg border border-gold/15",children:e.jsxs("table",{"data-loc":"client/src/pages/AdminClients.tsx:325",className:"w-full text-sm",children:[e.jsx("thead",{"data-loc":"client/src/pages/AdminClients.tsx:326",children:e.jsxs("tr",{"data-loc":"client/src/pages/AdminClients.tsx:327",className:"bg-gold/5 border-b border-gold/15",children:[e.jsx("th",{"data-loc":"client/src/pages/AdminClients.tsx:328",className:"text-left px-4 py-3 font-semibold text-navy",children:"Nom"}),e.jsx("th",{"data-loc":"client/src/pages/AdminClients.tsx:329",className:"text-left px-4 py-3 font-semibold text-navy",children:"Email"}),e.jsx("th",{"data-loc":"client/src/pages/AdminClients.tsx:330",className:"text-left px-4 py-3 font-semibold text-navy",children:"Abonnement"}),e.jsx("th",{"data-loc":"client/src/pages/AdminClients.tsx:331",className:"text-left px-4 py-3 font-semibold text-navy",children:"Inscrit le"}),e.jsx("th",{"data-loc":"client/src/pages/AdminClients.tsx:332",className:"
29text-left px-4 py-3 font-semibold text-navy",children:"Actions"})]})}),e.jsxs("tbody",{"data-loc":"client/src/pages/AdminClients.tsx:335",children:[B.map(t=>e.jsxs("tr",{"data-loc":"client/src/pages/AdminClients.tsx:337",className:"border-b border-gold/10 hover:bg-gold/5 transition-colors",children:[e.jsx("td",{"data-loc":"client/src/pages/AdminClients.tsx:338",className:"px-4 py-3",children:e.jsxs("div",{"data-loc":"client/src/pages/AdminClients.tsx:339",className:"flex items-center gap-2",children:[e.jsx("div",{"data-loc":"client/src/pages/AdminClients.tsx:340",className:"w-8 h-8 rounded-full bg-gold/10 flex items-center justify-center text-xs font-bold text-navy shrink-0",children:(t.firstName??t.name??"?").charAt(0).toUpperCase()}),e.jsx("p",{"data-loc":"client/src/pages/AdminClients.tsx:343",className:"font-medium text-navy truncate",children:t.firstName&&t.lastName?`${t.firstName} ${t.lastName}`:t.name??"-"})]})}),e.jsx("td",{"data-loc":"client/src/pages/AdminClients.tsx:348",className:"px-4 py-3 text-muted-foreground truncate max-w-[200px]",children:t.email??"-"}),e.jsx("td",{"data-loc":"client/src/pages/AdminClients.tsx:349",className:"px-4 py-3",children:e.jsxs("span",{"data-loc":"client/src/pages/AdminClients.tsx:350",className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-semibold border ${t.stripeCustomerId?.startsWith("cus_admin_")?"bg-amber-100 text-amber-700 border-amber-200":t.plan==="pro"&&!t.stripeSubscriptionId?"bg-blue-100 text-blue-700 border-blue-200":vt[t.plan]??"bg-gray-100 text-gray-600"}`,children:[e.jsx(z,{"data-loc":"client/src/pages/AdminClients.tsx:357",className:"h-3 w-3"}),wt(t.plan,t.stripeSubscriptionId,t.stripeCustomerId)]})}),e.jsx("td",{"data-loc":"client/src/pages/AdminClients.tsx:361",className:"px-4 py-3 text-muted-foreground text-xs",children:t.createdAt?new Date(t.createdAt).toLocaleDateString(Se()):"-"}),e.jsx("td",{"data-loc":"client/src/pages/AdminClients.tsx:364",className:"px-4 py-3",children:e.jsxs(ke,{"data-loc":"client/src/pages/AdminClients.tsx:365",children:[e.jsx(Pe,{"data-loc":"client/src/pages/AdminClients.tsx:366",asChild:!0,children:e.jsx(w,{"data-loc":"client/src/pages/AdminClients.tsx:367",variant:"ghost",size:"icon",className:"h-8 w-8",children:e.jsx(He,{"data-loc":"client/src/pages/AdminClients.tsx:368",className:"h-4 w-4"})})}),e.jsxs(Ee,{"data-loc":"client/src/pages/AdminClients.tsx:371",align:"end",className:"w-48",children:[e.jsxs(k,{"data-loc":"client/src/pages/AdminClients.tsx:372",onClick:()=>a(`/annuaire/${t.id}`),children:[e.jsx(Ve,{"data-loc":"client/src/pages/AdminClients.tsx:373",className:"h-4 w-4 mr-2"}),"Voir le profil"]}),e.jsx(V,{"data-loc":"client/src/pages/AdminClients.tsx:376"}),e.jsxs(Te,{"data-loc":"client/src/pages/AdminClients.tsx:377",children:[e.jsxs(_e,{"data-loc":"client/src/pages/AdminClients.tsx:378",children:[e.jsx(Me,{"data-loc":"client/src/pages/AdminClients.tsx:379",className:"h-4 w-4 mr-2"}),"Modifier le rôle"]}),e.jsxs(Re,{"data-loc":"client/src/pages/AdminClients.tsx:382",children:[e.jsxs(k,{"data-loc":"client/src/pages/AdminClients.tsx:383",disabled:t.role==="user"||E.isPending,onClick:()=>E.mutate({userId:t.id,role:"user"}),children:["Utilisateur",t.role==="user"&&e.jsx(W,{"data-loc":"client/src/pages/AdminClients.tsx:388",className:"h-3 w-3 ml-auto text-green-500"})]}),e.jsxs(k,{"data-loc":"client/src/pages/AdminClients.tsx:390",disabled:t.role==="admin"||E.isPending,onClick:()=>E.mutate({userId:t.id,role:"admin"}),children:["Admin",t.role==="admin"&&e.jsx(W,{"data-loc":"client/src/pages/AdminClients.tsx:395",className:"h-3 w-3 ml-auto text-green-500"})]})]})]}),e.jsxs(k,{"data-loc":"client/src/pages/AdminClients.tsx:399",disabled:U.isPending,onClick:()=>U.mutate({userId:t.id,plan:"pro"}),children:[e.jsx(Le,{"data-loc":"client/src/pages/AdminClients.tsx:403",className:"h-4 w-4 mr-2"}),"Forcer abonnement Pro"]}),e.jsx(V,{"data-loc":"client/src/pages/AdminClients.tsx:406"}),e.jsxs(gt,{"data-loc":"client/src/pages/AdminClients.tsx:407",children:[e.jsx(ut,{"data-loc":"client/src/pages/AdminClients.tsx:408",asChild:!0,children:e.jsxs(k,{"data-loc":"client/src/pages/AdminClients.tsx:409",onSelect:v=>v.preventDefault(),className:"text-red-600 focus:text-red-600 focus:bg-red-50",children:[e.jsx(We,{"data-loc":"client/src/pages/AdminClients.tsx:413",className:"h-4 w-4 mr-2"}),"Supprimer l'utilisateur"]})}),e.jsxs(At,{"data-loc":"client/src/pages/AdminClients.tsx:417",children:[e.jsx(ft,{"data-loc":"client/src/pages/AdminClients.tsx:418",children:"Supprimer l'utilisateur ?"}),e.jsx(jt,{"data-loc":"client/src/pages/AdminClients.tsx:419",children:"Cette action supprimera définitivement l'utilisateur et TOUTES ses données. Cette action est irréversible."}),e.jsxs("div",{"data-loc":"client/src/pages/AdminClients.tsx:422",className:"flex justify-end gap-2",children:[e.jsx(Nt,{"data-loc":"client/src/pages/AdminClients.tsx:423",children:"Annuler"}),e.jsx(bt,{"data-loc":"client/src/pages/AdminClients.tsx:424",onClick:()=>R.mutate({userId:t.id}),disabled:R.isPending,className:"bg-red-600 hover:bg-red-700",children:R.isPending?e.jsx(F,{"data-loc":"client/src/pages/AdminClients.tsx:429",className:"h-4 w-4 animate-spin"}):"Supprimer"})]})]})]})]})]})})]},t.id)),B.length===0&&e.jsx("tr",{"data-loc":"client/src/pages/AdminClients.tsx:440",children:e.jsx("td",{"data-loc":"client/src/pages/AdminClients.tsx:441",colSpan:5,className:"px-4 py-8 text-center text-muted-foreground",children:"Aucun utilisateur trouvé."})})]})]})}),e.jsxs("div",{"data-loc":"client/src/pages/AdminClients.tsx:452",className:"flex items-center justify-between",children:[e.jsxs("p",{"data-loc":"client/src/pages/AdminClients.tsx:453",className:"text-xs text-muted-foreground",children:[L.length," utilisateur(s) affiché(s)"]}),b>1&&e.jsxs("div",{"data-loc":"client/src/pages/AdminClients.tsx:457",className:"flex items-center gap-1",children:[e.jsx(w,{"data-loc":"client/src/pages/AdminClients.tsx:458",variant:"ghost",size:"icon",className:"h-8 w-8",disabled:N<=1,onClick:()=>d(1),children:e.jsx(Be,{"data-loc":"client/src/pages/AdminClients.tsx:459",className:"h-4 w-4"})}),e.jsx(w,{"data-loc":"client/src/pages/AdminClients.tsx:461",variant:"ghost",size:"icon",className:"h-8 w-8",disabled:N<=1,onClick:()=>d(t=>Math.max(1,t-1)),children:e.jsx(qe,{"data-loc":"client/src/pages/AdminClients.tsx:462",className:"h-4 w-4"})}),e.jsxs("span",{"data-loc":"client/src/pages/AdminClients.tsx:464",className:"text-sm px-3 font-medium",children:[N," / ",b]}),e.jsx(w,{"data-loc":"client/src/pages/AdminClients.tsx:465",variant:"ghost",size:"icon",className:"h-8 w-8",disabled:N>=b,onClick:()=>d(t=>Math.min(b,t+1)),children:e.jsx(Ie,{"data-loc":"client/src/pages/AdminClients.tsx:466",className:"h-4 w-4"})}),e.jsx(w,{"data-loc":"client/src/pages/AdminClients.tsx:468",variant:"ghost",size:"icon",className:"h-8 w-8",disabled:N>=b,onClick:()=>d(b),children:e.jsx(ze,{"data-loc":"client/src/pages/AdminClients.tsx:469",className:"h-4 w-4"})})]})]})]})})}const Ut=Object.freeze(Object.defineProperty({__proto__:null,default:Dt},Symbol.toStringTag,{value:"Module"}));
29export{gt as A,He as E,Ye as U,At as a,$t as b,ft as c,jt as d,Ot as e,Nt as f,bt as g,Dt as h,Ut as i};
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.