![]() Server : Apache/2 System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 User : gositeme ( 1004) PHP Version : 8.2.29 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/gositeme/domains/lavocat.ca/private_html/.next/server/chunks/ |
"use strict";exports.id=3457,exports.ids=[3457],exports.modules={3457:(e,s,a)=>{a.a(e,async(e,t)=>{try{a.r(s),a.d(s,{default:()=>es});var r=a(8732),n=a(44233),i=a(82015),o=a(4722),l=a(19918),c=a.n(l),d=a(56523),m=a(63220),h=a(22792),u=a(90226),x=a(86569),p=a(16383),g=a(30703),f=a(87637),y=a(6159),b=a(93923),j=a(73441),v=a(22554),N=a(23779),w=a(40128),A=a(49048),S=a(26836),C=a(13838),k=a(82439),I=a(66e3),D=a(99421),P=a(58903),E=a(65653),M=a(36205),L=a(18804),T=a(39461),R=a(34458),U=a(9741),$=a(46050),O=a(87962),F=a(35091),z=a(65293),J=a(51372),B=a(25505),W=a(74297),_=a(51005),V=a(50930),G=a(96774),Y=a(56761),H=a.n(Y),q=a(94292),K=a(38559),Q=a(27368),X=a(5057),Z=a(29934),ee=e([m,_,V,q,K]);[m,_,V,q,K]=ee.then?(await ee)():ee;let es=({children:e})=>{let s=(0,n.useRouter)(),{data:a,status:t}=(0,o.useSession)(),[l,Y]=(0,i.useState)(!1),[ee,es]=(0,i.useState)(!1),{theme:ea}=(0,h.D)(),[et,er]=(0,i.useState)(!1),{stopImpersonation:en}=(0,V.y)(),[ei,eo]=(0,i.useState)(null),[el,ec]=(0,i.useState)({}),[ed,em]=(0,i.useState)(!1),[eh,eu]=(0,i.useState)(!1),ex=(0,i.useRef)(null),[ep,eg]=(0,i.useState)([]),[ef,ey]=(0,i.useState)(0),[eb,ej]=(0,i.useState)(!1),ev=(0,i.useRef)(null),[eN,ew]=(0,i.useState)(!1),[eA,eS]=(0,i.useState)("fr"),[eC,ek]=(0,i.useState)(!1);(0,i.useEffect)(()=>{es(!0),"authenticated"===t&&fetch("/api/user/business-profile").then(e=>e.ok?e.json():null).then(e=>{e&&e.id&&eo(e.id)})},[t]),(0,i.useEffect)(()=>{let e=e=>{ex.current&&!ex.current.contains(e.target)&&eu(!1)};return eh&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[eh]);let eI=[{name:"Home",href:"/",icon:x.A},{name:"About",href:"/about",icon:p.A},{name:"Bordeaux Case",href:"/class-action",icon:g.A},{name:"\uD83C\uDFDB️ Judicial Directory",href:"/judicial-directory",icon:f.A},{name:"⚖️ Law Firms",href:"/business-profiles",icon:y.A},{name:"\uD83D\uDC65 Society Members",href:"/profiles",icon:f.A},{name:"Justice Roles",href:"/justice-roles",icon:f.A},{name:"Legal Basis",href:"/resources",icon:b.A},{name:"FAQ",href:"/faq",icon:j.A},{name:"Contact",href:"/contact",icon:v.A},{name:"Join Our Team",href:"/join",icon:N.A},{name:"Group Chat",href:"/group-chat",icon:w.A},{name:"\uD83C\uDFDB️ Society Demo",href:"/society-demo",icon:f.A},{name:"\uD83C\uDFDB️ Society Access",href:"/society-access",icon:f.A},{name:"\uD83D\uDCCB Class Action",href:"/class-action",icon:g.A},{name:"⚖️ Legal Notice",href:"/legal-notice",icon:g.A},{name:"\uD83D\uDD27 Additional Capabilities",href:"/additional-capabilities",icon:A.A},{name:"\uD83D\uDCC5 Calendar Demo",href:"/calendar-demo",icon:S.A},{name:"⚖️ Legal Suite",href:"/legal-suite",icon:b.A},{name:"\uD83D\uDCCA Dashboard",href:"/dashboard",icon:S.A},{name:"♿ Accessibility",href:"/accessibility",icon:p.A},{name:"\uD83D\uDC65 Who We Are",href:"/who",icon:f.A},{name:"\uD83D\uDD12 Privacy Policy",href:"/privacy-policy",icon:g.A},{name:"\uD83C\uDF6A Cookie Policy",href:"/cookie-policy",icon:g.A},{name:"\uD83D\uDCC4 Terms",href:"/terms",icon:g.A}],eD=[{name:"Dashboard",href:"/client/dashboard",icon:S.A},{name:"\uD83D\uDCCB Case Management",href:"/admin/cases",icon:g.A},{name:"My Cases",href:"/user/cases",icon:g.A},{name:"My Documents",href:"/documents",icon:g.A},{name:"Messages",href:"/messages",icon:w.A},{name:"My Profile",href:"/user/profile",icon:C.A},{name:"Unified Profile",href:"/profile/unified",icon:A.A},{name:"Applications",href:"/user/applications",icon:g.A},{name:"Subscription Plans",href:"/user/subscription",icon:k.A}],eP=[{name:"Lawyer Dashboard",href:"/lawyer/dashboard",icon:S.A},{name:"\uD83D\uDCCB Case Management",href:"/admin/cases",icon:g.A},{name:"\uD83D\uDCCA Case Analytics",href:"/analytics/cases",icon:S.A},{name:"My Clients",href:"/lawyer/clients",icon:f.A},{name:"My Cases",href:"/lawyer/cases",icon:g.A},{name:"Team Management",href:"/lawyer/team",icon:f.A},{name:"Business Profile",href:"/user/business-profile",icon:y.A},{name:"Business Analytics",href:"/user/business-analytics",icon:S.A}],eE=[{name:"Jurist Dashboard",href:"/jurist/dashboard",icon:S.A},{name:"\uD83D\uDCCB Case Management",href:"/admin/cases",icon:g.A},{name:"Legal Research",href:"/jurist/research",icon:g.A},{name:"Scholarly Publications",href:"/jurist/publications",icon:g.A},{name:"Theory Development",href:"/jurist/theory",icon:S.A},{name:"Academic Collaboration",href:"/jurist/collaboration",icon:f.A}],eM=[{name:"Judge Dashboard",href:"/judge/dashboard",icon:S.A},{name:"\uD83D\uDCCB Case Management",href:"/admin/cases",icon:g.A},{name:"Case Oversight",href:"/judge/cases",icon:g.A},{name:"Court Administration",href:"/judge/administration",icon:b.A},{name:"Judicial Tools",href:"/judge/tools",icon:A.A}],eL=[{name:"Mediator Dashboard",href:"/mediator/dashboard",icon:S.A},{name:"\uD83D\uDCCB Case Management",href:"/admin/cases",icon:g.A},{name:"Active Mediations",href:"/mediator/cases",icon:g.A},{name:"Settlement Tracking",href:"/mediator/settlements",icon:S.A},{name:"Mediation Tools",href:"/mediator/tools",icon:A.A}],eT=[{name:"Consultant Dashboard",href:"/consultant/dashboard",icon:S.A},{name:"\uD83D\uDCCB Case Management",href:"/admin/cases",icon:g.A},{name:"Client Advisory",href:"/consultant/clients",icon:f.A},{name:"Strategic Planning",href:"/consultant/planning",icon:S.A},{name:"Expert Network",href:"/consultant/network",icon:f.A}],eR=[{name:"Investigator Dashboard",href:"/investigator/dashboard",icon:S.A},{name:"\uD83D\uDCCB Case Management",href:"/admin/cases",icon:g.A},{name:"Active Investigations",href:"/investigator/cases",icon:g.A},{name:"Evidence Tracking",href:"/investigator/evidence",icon:g.A},{name:"Investigation Tools",href:"/investigator/tools",icon:A.A}],eU=[{name:"Expert Dashboard",href:"/expert/dashboard",icon:S.A},{name:"\uD83D\uDCCB Case Management",href:"/admin/cases",icon:g.A},{name:"Expert Testimony",href:"/expert/testimony",icon:g.A},{name:"Case Collaboration",href:"/expert/cases",icon:f.A},{name:"Credential Management",href:"/expert/credentials",icon:A.A}],e$=[{name:"Support Dashboard",href:"/support/dashboard",icon:S.A},{name:"\uD83D\uDCCB Case Management",href:"/admin/cases",icon:g.A},{name:"Task Management",href:"/support/tasks",icon:g.A},{name:"Document Processing",href:"/support/documents",icon:g.A},{name:"Team Collaboration",href:"/support/team",icon:f.A}],eO=[{name:"Student Dashboard",href:"/student/dashboard",icon:S.A},{name:"\uD83D\uDCCB Case Management",href:"/admin/cases",icon:g.A},{name:"Educational Resources",href:"/student/resources",icon:g.A},{name:"Mentorship Programs",href:"/student/mentorship",icon:f.A},{name:"Practical Experience",href:"/student/experience",icon:S.A}],eF=[{name:"Notary Dashboard",href:"/notary/dashboard",icon:S.A},{name:"\uD83D\uDCCB Case Management",href:"/admin/cases",icon:g.A},{name:"Notarial Services",href:"/notary/services",icon:g.A},{name:"Document Authentication",href:"/notary/authentication",icon:g.A},{name:"Record Keeping",href:"/notary/records",icon:g.A}],ez=[{name:"Admin Dashboard",href:"/admin/dashboard",icon:C.A},{name:"\uD83D\uDCCB Case Management",href:"/admin/cases",icon:g.A},{name:"\uD83D\uDCCA Case Analytics",href:"/analytics/cases",icon:S.A},{name:"Case Assignments",href:"/admin/case-assignments",icon:b.A},{name:"Analytics Dashboard",href:"/admin/analytics-dashboard",icon:S.A},{name:"Manage Users",href:"/admin/users",icon:C.A},{name:"\uD83D\uDCE2 Public Notifications",href:"/admin/notifications",icon:g.A},{name:"\uD83D\uDCE7 Newsletter Management",href:"/admin/newsletter",icon:v.A},{name:"⚙️ Admin Options",href:"/admin/options",icon:g.A},{name:"\uD83C\uDFE2 Business Profiles",href:"/admin/business-profiles",icon:y.A},{name:"\uD83E\uDD16 System Automation",href:"/admin/system-automation",icon:A.A},{name:"\uD83D\uDCC1 Cases Directory",href:"/admin/cases",icon:g.A},{name:"\uD83D\uDCE7 Newsletter Templates",href:"/admin/newsletter/templates",icon:v.A},{name:"\uD83D\uDCDD Registration Management",href:"/admin/registrations",icon:g.A},{name:"\uD83D\uDCC4 Application Management",href:"/admin/applications",icon:g.A},{name:"\uD83C\uDFDB️ Barreau Scraper",href:"/admin/barreau-scraper",icon:I.A},{name:"✅ V\xe9rifications Manuelles",href:"/admin/manual-verifications",icon:g.A}],eJ=[{name:"\uD83D\uDC51 Super Admin Dashboard",href:"/admin/super",icon:k.A},{name:"\uD83D\uDC65 All User Dashboards",href:"/user/dashboard",icon:C.A},{name:"⚖️ All Lawyer Dashboards",href:"/lawyer/dashboard",icon:b.A},{name:"\uD83D\uDCDA All Jurist Dashboards",href:"/jurist/dashboard",icon:g.A},{name:"\uD83C\uDFDB️ All Judge Dashboards",href:"/judge/dashboard",icon:C.A},{name:"\uD83E\uDD1D All Mediator Dashboards",href:"/mediator/dashboard",icon:f.A},{name:"\uD83D\uDCBC All Consultant Dashboards",href:"/consultant/dashboard",icon:A.A},{name:"\uD83D\uDD0D All Investigator Dashboards",href:"/investigator/dashboard",icon:g.A},{name:"\uD83C\uDFAF All Expert Dashboards",href:"/expert/dashboard",icon:k.A},{name:"\uD83D\uDEE0️ All Support Dashboards",href:"/support/dashboard",icon:A.A},{name:"\uD83C\uDF93 All Student Dashboards",href:"/student/dashboard",icon:C.A},{name:"\uD83D\uDCDC All Notary Dashboards",href:"/notary/dashboard",icon:g.A},{name:"\uD83C\uDFE2 All Client Dashboards",href:"/client/dashboard",icon:y.A}],eB=[{label:"Public",key:"public",items:eI}];if("authenticated"===t&&a){eB.push({label:"\uD83E\uDDD1\uD83D\uDCBC Client",key:"client",items:eD});let e="SUPERADMIN"===a.user.role;console.log("Current user role:",a.user.role),console.log("Role type:",typeof a.user.role),console.log("Role comparison with SUPERADMIN:","SUPERADMIN"===a.user.role),console.log("Show all roles:",e),console.log("Full session user object:",a.user),(e||"LAWYER"===a.user.role)&&eB.push({label:"⚖️ Lawyer",key:"lawyer",items:eP}),(e||"JURIST"===a.user.role)&&eB.push({label:"\uD83D\uDCDA Jurist",key:"jurist",items:eE}),(e||"JUDGE"===a.user.role)&&eB.push({label:"\uD83D\uDC69⚖️ Judge",key:"judge",items:eM}),(e||"MEDIATOR"===a.user.role)&&eB.push({label:"\uD83D\uDD4A️ Mediator",key:"mediator",items:eL}),(e||"LEGAL_CONSULTANT"===a.user.role)&&eB.push({label:"\uD83D\uDCBC Consultant",key:"consultant",items:eT}),(e||"INVESTIGATOR"===a.user.role)&&eB.push({label:"\uD83D\uDD75️ Investigator",key:"investigator",items:eR}),(e||"EXPERT_WITNESS"===a.user.role)&&eB.push({label:"\uD83C\uDFAF Expert Witness",key:"expert",items:eU}),(e||["SECRETARY","ASSISTANT","CLERK","COURT_CLERK","PARALEGAL"].includes(a.user.role))&&eB.push({label:"\uD83D\uDEE0️ Support Staff",key:"support",items:e$}),(e||["LAW_STUDENT","LEGAL_INTERN"].includes(a.user.role))&&eB.push({label:"\uD83C\uDF93 Student",key:"student",items:eO}),(e||"NOTARY"===a.user.role)&&eB.push({label:"\uD83D\uDCDC Notary",key:"notary",items:eF}),(e||"ADMIN"===a.user.role||"SUPERADMIN"===a.user.role)&&eB.push({label:"\uD83D\uDEE1️ Admin",key:"admin",items:ez}),"SUPERADMIN"===a.user.role&&eB.push({label:"\uD83D\uDC51 SUPER ADMIN",key:"super-admin",items:eJ}),console.log("Final grouped navigation:",eB.map(e=>({label:e.label,key:e.key,itemCount:e.items.length})))}let eW=[{name:"\uD83D\uDCB0 Financial Dashboard",href:"/financial-dashboard",icon:D.A},{name:"\uD83D\uDCB3 Payment Demo",href:"/payment-demo",icon:P.A},{name:"\uD83C\uDFDB️ Society Dashboard",href:"/society-dashboard",icon:f.A},{name:"\uD83D\uDCC4 Documents",href:"/documents",icon:g.A}];ei&&eW.push({name:" Business Profile",href:`/business/${ei}`,icon:y.A},{name:"\uD83D\uDCCA Business Analytics",href:"/user/business-analytics",icon:S.A}),eW.push({name:"Manage Business Profile",href:"/user/business-profile",icon:A.A},{name:"Subscription Plans",href:"/user/subscription",icon:k.A},{name:"My Profile",href:"/user/profile",icon:C.A},{name:"My Applications",href:"/user/dashboard",icon:g.A}),a&&a.user&&"SUPERADMIN"===a.user.role&&eW.push({name:"\uD83D\uDC51 Super Admin",href:"/admin/super",icon:k.A}),eW.push({name:"⚖️ Hire Lawyer",href:"/hire/case-selection",icon:b.A},{name:"\uD83D\uDCAC Book Consultation",href:"/hire/consultation",icon:w.A},{name:"\uD83D\uDD0D Debug Session",href:"/api/debug-session",icon:A.A});let e_="authenticated"===t&&a&&["CLIENT","USER","ADMIN","SUPERADMIN"].includes(a.user.role),eV=new Date,eG=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][eV.getDay()],eY=["January","February","March","April","May","June","July","August","September","October","November","December"][eV.getMonth()],eH=eV.getDate(),eq=eV.getFullYear(),eK=`${eG}, ${eY} ${eH}${(e=>["th","st","nd","rd"][e%10>3||e%100-e%10==10?0:e%10])(eH)}, ${eq} A.D.`,eQ=async()=>{try{if(a?.user?.isImpersonating){console.log("User is impersonating, stopping impersonation instead of logout"),await en(),Y(!1);return}console.log("Normal logout"),(0,o.signOut)({redirect:!1}).then(()=>{s.push("/"),Y(!1)})}catch(e){if(console.error("Error during logout/stop impersonation:",e),a?.user?.isImpersonating){console.log("Stop impersonation failed, redirecting to admin dashboard"),window.location.href="/admin/dashboard",Y(!1);return}(0,o.signOut)({redirect:!1}).then(()=>{s.push("/"),Y(!1)})}},eX=async()=>{let e=await fetch("/api/notifications");if(e.ok){let s=await e.json();eg(s),ey(s.filter(e=>!e.isRead).length)}};(0,i.useEffect)(()=>{eX();let e=setInterval(eX,15e3);return()=>clearInterval(e)},[]),(0,i.useEffect)(()=>{let e=()=>{eX()};return window.addEventListener("notification-updated",e),()=>window.removeEventListener("notification-updated",e)},[]),(0,i.useEffect)(()=>{let e=e=>{ev.current&&!ev.current.contains(e.target)&&ej(!1)};return eb&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[eb]);let eZ=async()=>{let e=ep.filter(e=>!e.isRead).map(e=>e.id);e.length>0&&(await fetch("/api/notifications",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:e})}),eX())};if(!ee||"loading"===t)return null;let e0=({label:e,sectionKey:s,children:a})=>(0,r.jsxs)("div",{children:[(0,r.jsxs)("button",{className:"flex items-center w-full px-2 py-2 text-left font-semibold text-white hover:bg-white/10 rounded-lg transition-colors mb-1",onClick:()=>ec(e=>({...e,[s]:!e[s]})),"aria-expanded":!!el[s],children:[el[s]?(0,r.jsx)(E.A,{className:"h-4 w-4 mr-2"}):(0,r.jsx)(M.A,{className:"h-4 w-4 mr-2"}),e]}),(0,r.jsx)("div",{className:el[s]?"block":"hidden",children:a})]}),e2=[{label:"Home",href:"/",icon:x.A},{label:"Cases",href:"/live-cases",icon:L.A},{label:"Messages",href:"/messages",icon:T.A},{label:"Groups",href:"/groups",icon:f.A},{label:"Marketplace",href:"/marketplace",icon:R.A},{label:"Documents",href:"/documents",icon:g.A,pdf:!0}];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.Ay,{type:"organization",data:(0,u.pu)()}),(0,r.jsxs)("div",{className:"min-h-screen bg-gray-50",children:[(0,r.jsx)("button",{onClick:()=>Y(!l),className:"lg:hidden fixed top-4 right-4 z-50 p-2 rounded-full bg-primary text-white shadow-lg hover:bg-primary-dark transition-colors",children:l?(0,r.jsx)(U.A,{className:"h-6 w-6"}):(0,r.jsx)($.A,{className:"h-6 w-6"})}),(0,r.jsx)(m.AnimatePresence,{children:l&&(0,r.jsxs)(m.motion.div,{initial:{opacity:0,x:-300},animate:{opacity:1,x:0},exit:{opacity:0,x:-300},transition:{duration:.2},className:"lg:hidden fixed inset-0 z-40",children:[(0,r.jsx)("div",{className:"fixed inset-0 bg-gray-600 bg-opacity-75",onClick:()=>Y(!1)}),(0,r.jsx)("div",{className:"fixed inset-y-0 left-0 max-w-xs w-full bg-gradient-to-b from-primary to-primary-dark shadow-xl",children:(0,r.jsxs)("div",{className:"h-full flex flex-col py-6 px-4",children:[(0,r.jsx)("div",{className:"flex items-center justify-center mb-8",children:(0,r.jsx)(c(),{href:"/",onClick:()=>Y(!1),children:(0,r.jsx)("img",{src:"/images/Logo_w.png",alt:"Logo",className:"max-w-full h-auto wave"})})}),(0,r.jsx)(G.A,{}),(0,r.jsxs)("nav",{className:"flex-1 space-y-2",children:[eB.map(e=>"public"===e.key?e.items.map((s,a)=>(0,r.jsxs)(c(),{href:s.href,onClick:()=>Y(!1),className:"flex items-center space-x-2 p-2 rounded-lg text-white hover:bg-white/10 transition-colors",children:[(0,r.jsx)(s.icon,{className:"h-5 w-5"}),(0,r.jsx)("span",{children:s.name})]},"string"==typeof s.name?s.name:`nav-item-${e.key}-${a}`)):(0,r.jsx)(e0,{label:e.label,sectionKey:e.key,children:e.items.map((s,a)=>(0,r.jsxs)(c(),{href:s.href,onClick:()=>Y(!1),className:"flex items-center space-x-2 p-2 rounded-lg text-white hover:bg-white/10 transition-colors ml-4",children:[(0,r.jsx)(s.icon,{className:"h-5 w-5"}),(0,r.jsx)("span",{children:s.name})]},"string"==typeof s.name?s.name:`nav-item-${e.key}-${a}`))},e.key)),eW.map((e,s)=>(0,r.jsxs)(c(),{href:e.href,onClick:()=>Y(!1),className:"flex items-center space-x-2 p-2 rounded-lg text-white hover:bg-white/10 transition-colors",children:[(0,r.jsx)(e.icon,{className:"h-5 w-5"}),(0,r.jsx)("span",{children:e.name})]},"string"==typeof e.name?e.name:`addon-item-${s}`)),a?(0,r.jsxs)("button",{onClick:eQ,className:"w-full flex items-center space-x-2 p-2 rounded-lg text-white hover:bg-white/10 transition-colors",children:[(0,r.jsx)(O.A,{className:"h-5 w-5"}),(0,r.jsx)("span",{children:a.user?.isImpersonating?"Stop Impersonating":"Logout"})]}):(0,r.jsxs)(c(),{href:"en"===eA?"/en/auth/login":"/auth/login",onClick:()=>Y(!1),className:"flex items-center space-x-2 p-2 rounded-lg text-white hover:bg-white/10 transition-colors",children:[(0,r.jsx)(O.A,{className:"h-5 w-5"}),(0,r.jsx)("span",{children:"Login"})]})]})]})})]})}),(0,r.jsx)("aside",{className:"hidden lg:block fixed inset-y-0 left-0 w-64 bg-gradient-to-b from-primary to-primary-dark text-white shadow-lg",children:(0,r.jsxs)("div",{className:"flex flex-col h-full",children:[(0,r.jsx)("div",{className:"flex items-center justify-center p-4",children:(0,r.jsx)(c(),{href:"/",children:(0,r.jsx)("img",{src:"/images/Logo_w.png",alt:"Logo",className:"max-w-full h-auto wave"})})}),(0,r.jsx)("div",{className:"px-4 pb-2",children:(0,r.jsx)(G.A,{})}),(0,r.jsxs)("nav",{className:"flex-1 px-4 space-y-2 overflow-y-auto",children:[eB.map(e=>"public"===e.key?e.items.map((s,a)=>(0,r.jsxs)(c(),{href:s.href,className:"flex items-center space-x-3 p-3 rounded-lg hover:bg-white/10 transition-colors",children:[(0,r.jsx)(s.icon,{className:"h-5 w-5 flex-shrink-0"}),(0,r.jsx)("span",{className:"text-sm font-medium",children:s.name})]},"string"==typeof s.name?s.name:`nav-item-${e.key}-${a}`)):(0,r.jsx)(e0,{label:e.label,sectionKey:e.key,children:e.items.map((s,a)=>(0,r.jsxs)(c(),{href:s.href,className:"flex items-center space-x-3 p-3 rounded-lg hover:bg-white/10 transition-colors ml-4",children:[(0,r.jsx)(s.icon,{className:"h-5 w-5 flex-shrink-0"}),(0,r.jsx)("span",{className:"text-sm font-medium",children:s.name})]},"string"==typeof s.name?s.name:`nav-item-${e.key}-${a}`))},e.key)),(0,r.jsx)("div",{className:"mt-4 border-t border-white/10 pt-2",children:eW.map((e,s)=>(0,r.jsxs)(c(),{href:e.href,className:"flex items-center space-x-3 p-3 rounded-lg hover:bg-white/10 transition-colors",children:[(0,r.jsx)(e.icon,{className:"h-5 w-5 flex-shrink-0"}),(0,r.jsx)("span",{className:"text-sm font-medium",children:e.name})]},"string"==typeof e.name?e.name:`addon-item-${s}`))}),a?(0,r.jsxs)("button",{onClick:eQ,className:"w-full flex items-center space-x-3 p-3 rounded-lg hover:bg-white/10 transition-colors",children:[(0,r.jsx)(O.A,{className:"h-5 w-5 flex-shrink-0"}),(0,r.jsx)("span",{className:"text-sm font-medium",children:a.user?.isImpersonating?"Stop Impersonating":"Logout"})]}):(0,r.jsxs)(c(),{href:"en"===eA?"/en/auth/login":"/auth/login",className:"flex items-center space-x-3 p-3 rounded-lg hover:bg-white/10 transition-colors",children:[(0,r.jsx)(O.A,{className:"h-5 w-5 flex-shrink-0"}),(0,r.jsx)("span",{className:"text-sm font-medium",children:"Login"})]})]}),(0,r.jsx)("div",{className:"p-4 border-t border-white/10",children:(0,r.jsxs)("div",{className:"text-xs text-white/60 text-center",children:["\xa9 ",new Date().getFullYear()," Libert\xe9 M\xeame en Cellule"]})}),e_&&(0,r.jsx)("button",{onClick:()=>window.location.href="/hire/new-case",className:"fixed bottom-8 left-8 z-50 flex items-center px-5 py-3 bg-blue-600 text-white rounded-full shadow-lg hover:bg-blue-700 transition-colors text-lg font-semibold",style:{boxShadow:"0 4px 24px rgba(0,0,0,0.15)"},children:"+ New Case"})]})}),(0,r.jsxs)("main",{className:"lg:pl-64 flex flex-col min-h-screen",children:[(0,r.jsx)(_.A,{}),(0,r.jsxs)("header",{className:"sticky top-0 z-50 w-full h-14 bg-primary flex items-center px-2 md:px-6 justify-between border-b border-gray-200 shadow",children:[(0,r.jsx)("div",{className:"flex items-center gap-2 min-w-0",children:(0,r.jsxs)("div",{className:"relative hidden md:block",children:[(0,r.jsx)(F.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-400"}),(0,r.jsx)("input",{type:"text",placeholder:"Search professionals, cases, documents...",onClick:()=>s.push("/search"),className:"bg-white/80 rounded-full pl-10 pr-4 py-1 focus:outline-none text-sm w-64 cursor-pointer",readOnly:!0})]})}),(0,r.jsx)("nav",{className:"flex gap-6 md:gap-8",children:e2.map(({label:e,href:s,icon:a,pdf:t})=>(0,r.jsxs)(c(),{href:s,className:`relative flex flex-col items-center group transition-colors duration-150 px-2 py-1 rounded-lg
${t?"hover:bg-red-50":"hover:bg-white/20"}
`,title:e,children:[(0,r.jsx)(a,{size:26,className:`transition-colors duration-150
${t?"text-white group-hover:text-red-500":"text-white group-hover:text-primary-light"}
`}),(0,r.jsx)("span",{className:"sr-only",children:e})]},e))}),(0,r.jsxs)("div",{className:"flex items-center gap-2 md:gap-3",children:[(0,r.jsx)("button",{className:"p-2 rounded-full hover:bg-white/20 transition relative",children:(0,r.jsx)(z.A,{size:22,className:"text-white"})}),(0,r.jsxs)("button",{className:"p-2 rounded-full hover:bg-white/20 transition relative",children:[(0,r.jsx)(T.A,{size:22,className:"text-white"}),(0,r.jsx)("span",{className:"absolute -top-1 -right-1 bg-blue-500 text-white text-xs rounded-full px-1.5",children:"2"})]}),(0,r.jsxs)("div",{className:"relative",ref:ev,children:[(0,r.jsxs)("button",{onClick:()=>ej(e=>!e),className:"p-2 rounded-full hover:bg-white/20 transition flex items-center relative",title:"Notifications",children:[(0,r.jsx)(J.A,{size:22,className:"text-white"}),ef>0&&(0,r.jsx)(m.motion.div,{initial:{scale:0},animate:{scale:1},className:"absolute -top-1 -right-1 bg-red-500 text-white text-xs rounded-full w-5 h-5 flex items-center justify-center font-medium",children:ef>99?"99+":ef})]}),(0,r.jsx)(m.AnimatePresence,{children:eb&&(0,r.jsx)(m.motion.div,{initial:{opacity:0,scale:.95,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-10},className:"absolute right-0 mt-2 w-80 bg-white shadow-lg rounded-lg border border-gray-200 z-50",children:(0,r.jsxs)("div",{className:"p-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Notifications"}),ef>0&&(0,r.jsx)("button",{onClick:eZ,className:"text-xs text-blue-600 hover:text-blue-800",children:"Mark all as read"})]}),(0,r.jsx)("div",{className:"max-h-64 overflow-y-auto space-y-2",children:0===ep.length?(0,r.jsx)("div",{className:"text-center py-4 text-gray-500 text-sm",children:"No notifications"}):ep.map((e,s)=>(0,r.jsxs)("div",{className:`flex items-start space-x-3 p-2 rounded-lg ${!e.isRead?"bg-blue-50":"hover:bg-gray-50"}`,children:[(0,r.jsxs)("div",{className:"flex-shrink-0 mt-1",children:["message"===e.type&&(0,r.jsx)(w.A,{className:"h-5 w-5 text-blue-500"}),"case"===e.type&&(0,r.jsx)(g.A,{className:"h-5 w-5 text-green-500"}),"payment"===e.type&&(0,r.jsx)(D.A,{className:"h-5 w-5 text-yellow-500"}),"reaction"===e.type&&(0,r.jsx)(B.A,{className:"h-5 w-5 text-green-500"}),"report"===e.type&&(0,r.jsx)(W.A,{className:"h-5 w-5 text-red-500"})]}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("div",{className:`font-medium text-sm ${!e.isRead?"text-gray-900":"text-gray-700"}`,children:e.title}),(0,r.jsx)("div",{className:"text-xs text-gray-500 truncate",children:e.message}),(0,r.jsx)("div",{className:"text-xs text-gray-400 mt-0.5",children:(0,X.m)(new Date(e.createdAt),{addSuffix:!0})})]}),!e.isRead&&(0,r.jsx)("span",{className:"mt-1 w-2 h-2 bg-yellow-400 rounded-full"})]},s))}),(0,r.jsx)("div",{className:"px-4 py-2 border-t border-gray-100 bg-gray-50 text-right",children:(0,r.jsx)(c(),{href:"en"===eA?"/en/notifications":"/notifications",className:"text-xs text-blue-600 hover:underline",children:"View all notifications"})})]})})})]}),a&&(0,r.jsx)(Q.A,{userId:a.user?.id||"",userRole:a.user?.role||"USER"}),a&&(0,r.jsx)("button",{onClick:()=>ew(!0),className:"p-2 rounded-full hover:bg-white/20 transition",title:"Privacy Settings",children:(0,r.jsx)(A.A,{size:22,className:"text-white"})}),(0,r.jsxs)("div",{className:"relative",ref:ex,children:[(0,r.jsx)("button",{onClick:()=>eu(!eh),className:"p-1 rounded-full hover:bg-white/20 transition flex items-center",children:a?.user?.image?(0,r.jsx)(H(),{src:a.user.image,alt:"Profile",width:32,height:32,className:"rounded-full border"}):(0,r.jsx)(C.A,{size:28,className:"rounded-full border text-white"})}),eh&&(0,r.jsx)("div",{className:"flex flex-col absolute right-0 mt-2 w-44 bg-white shadow-lg rounded-xl py-2 z-50 border border-gray-100",onMouseEnter:()=>{window.profileMenuTimeout&&(clearTimeout(window.profileMenuTimeout),window.profileMenuTimeout=null)},onMouseLeave:()=>{window.profileMenuTimeout=setTimeout(()=>eu(!1),300)},children:a?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"px-4 py-2 border-b border-gray-100",children:[(0,r.jsx)("div",{className:"font-semibold text-gray-800 text-sm truncate",children:a.user?.name||"User"}),(0,r.jsx)("div",{className:"text-xs text-gray-500 truncate",children:a.user?.email})]}),(0,r.jsx)(c(),{href:"en"===eA?"/en/user/profile":"/user/profile",className:"px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",children:"Profile"}),(0,r.jsx)(c(),{href:"en"===eA?"/en/user/dashboard":"/user/dashboard",className:"px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",children:"Dashboard"}),(0,r.jsxs)(c(),{href:"en"===eA?"/en/user/payments":"/user/payments",className:"px-4 py-2 text-sm text-gray-700 hover:bg-gray-50 flex items-center",children:[(0,r.jsx)(D.A,{className:"h-4 w-4 mr-2"}),"Payments & Billing"]}),(0,r.jsxs)(c(),{href:"en"===eA?"/en/user/subscription":"/user/subscription",className:"px-4 py-2 text-sm text-gray-700 hover:bg-gray-50 flex items-center",children:[(0,r.jsx)(P.A,{className:"h-4 w-4 mr-2"}),"Subscription"]}),a.user?.role==="SUPERADMIN"&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("button",{onClick:()=>em(!0),className:"px-4 py-2 text-sm text-blue-600 hover:bg-blue-50 text-left flex items-center",children:[(0,r.jsx)("span",{className:"mr-2",children:"\uD83D\uDC64"}),"Impersonate User"]}),(0,r.jsx)("div",{className:"border-t border-gray-100 my-1"}),[{label:"Client",nav:eD},{label:"Lawyer",nav:eP},{label:"Jurist",nav:eE},{label:"Judge",nav:eM},{label:"Mediator",nav:eL},{label:"Consultant",nav:eT},{label:"Investigator",nav:eR},{label:"Expert Witness",nav:eU},{label:"Support Staff",nav:e$},{label:"Student",nav:eO},{label:"Notary",nav:eF},{label:"Admin",nav:ez}].map(({label:e,nav:s})=>{let a=s[0]?.icon||C.A;return(0,r.jsxs)("div",{className:"relative group",children:[(0,r.jsxs)("button",{className:"w-full px-4 py-2 text-sm text-purple-700 hover:bg-purple-50 text-left flex items-center justify-between",onClick:()=>ec(s=>({...s,[e]:!s[e]})),onMouseEnter:()=>ec(s=>({...s,[e]:!0})),onMouseLeave:()=>ec(s=>({...s,[e]:!1})),children:[(0,r.jsx)(a,{className:"h-4 w-4 mr-2"}),e,(0,r.jsx)("span",{className:"ml-auto",children:"◀"})]}),el[e]&&(0,r.jsx)("div",{className:"absolute right-full top-0 mt-0 mr-1 w-56 bg-white shadow-lg rounded-xl py-2 z-50 border border-gray-100",onMouseEnter:()=>ec(s=>({...s,[e]:!0})),onMouseLeave:()=>ec(s=>({...s,[e]:!1})),children:s.map(e=>(0,r.jsxs)(c(),{href:e.href,className:"px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 flex items-center",children:[(0,r.jsx)(e.icon,{className:"h-4 w-4 mr-2"}),e.name]},e.href))})]},e)})]}),(0,r.jsx)("button",{onClick:()=>(0,o.signOut)({callbackUrl:"/"}),className:"px-4 py-2 text-sm text-red-600 hover:bg-red-50 text-left",children:"Sign out"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"px-4 py-2 border-b border-gray-100",children:[(0,r.jsx)("div",{className:"font-semibold text-gray-800 text-sm",children:"Guest User"}),(0,r.jsx)("div",{className:"text-xs text-gray-500",children:"Not signed in"})]}),(0,r.jsx)(c(),{href:"en"===eA?"/en/auth/login":"/auth/login",className:"px-4 py-2 text-sm text-blue-600 hover:bg-blue-50 text-left",children:"Sign in"}),(0,r.jsx)(c(),{href:"en"===eA?"/en/auth/signup":"/auth/signup",className:"px-4 py-2 text-sm text-green-600 hover:bg-green-50 text-left",children:"Create Account"})]})})]})]}),(0,r.jsx)("div",{className:"md:hidden ml-2",children:(0,r.jsx)("button",{className:"p-2 rounded-full hover:bg-white/20 transition",children:(0,r.jsx)($.A,{size:24,className:"text-white"})})})]}),et&&(0,r.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",onClick:()=>er(!1),children:(0,r.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-full mx-4",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,r.jsx)("h3",{className:"text-lg font-semibold",children:"Today's Date & Notes"}),(0,r.jsx)("button",{onClick:()=>er(!1),className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),(0,r.jsx)("div",{className:"mb-4",children:(0,r.jsx)("p",{className:"text-gray-600 text-sm",children:eK})}),(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Notes for today:"}),(0,r.jsx)("textarea",{placeholder:"Add your notes here...",className:"w-full p-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-transparent",rows:4,defaultValue:"",onChange:e=>{}})]}),(0,r.jsx)("div",{className:"flex justify-end gap-2",children:(0,r.jsx)("button",{onClick:()=>er(!1),className:"px-4 py-2 bg-gray-200 text-gray-800 rounded-md hover:bg-gray-300 transition-colors",children:"Close"})})]})}),(0,r.jsx)("div",{className:"flex-1 w-full",children:e}),(0,r.jsx)(d.A,{}),(0,r.jsx)(G.A,{})]}),(0,r.jsx)(Z.A,{}),(0,r.jsx)(q.A,{isOpen:ed,onClose:()=>em(!1)}),(0,r.jsx)(K.A,{isOpen:eN,onClose:()=>ew(!1)})]})]})};t()}catch(e){t(e)}})},27368:(e,s,a)=>{a.d(s,{A:()=>m});var t=a(8732),r=a(82015),n=a(44233),i=a(99421),o=a(66399),l=a(5134),c=a(27290),d=a(58903);let m=({userId:e,userRole:s})=>{let a=(0,n.useRouter)(),[m,h]=(0,r.useState)(null),[u,x]=(0,r.useState)(!0),[p,g]=(0,r.useState)(!1);(0,r.useEffect)(()=>{f()},[e]);let f=async()=>{try{x(!0);let e=await fetch("/api/user/financial-summary");if(e.ok){let s=await e.json();h({pendingPayments:s.pendingPayments||0,overdueInvoices:s.overdueInvoices||0,totalSpent:s.totalSpent||0,thisMonthSpent:s.thisMonthSpent||0})}}catch(e){console.error("Error fetching payment info:",e)}finally{x(!1)}},y=(e,s="CAD")=>new Intl.NumberFormat("en-CA",{style:"currency",currency:s}).format(e),b=m&&(m.pendingPayments>0||m.overdueInvoices>0);return u?(0,t.jsx)("div",{className:"relative",children:(0,t.jsx)("button",{className:"p-2 rounded-full hover:bg-white/20 transition flex items-center",children:(0,t.jsx)(i.A,{className:"h-5 w-5 text-white"})})}):(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsxs)("button",{onClick:()=>g(!p),className:`p-2 rounded-full hover:bg-white/20 transition flex items-center relative ${b?"text-yellow-400":"text-white"}`,children:[(0,t.jsx)(i.A,{className:"h-5 w-5"}),b&&(0,t.jsx)("span",{className:"absolute -top-1 -right-1 w-3 h-3 bg-red-500 rounded-full animate-pulse"})]}),p&&(0,t.jsx)("div",{className:"absolute right-0 mt-2 w-64 bg-white shadow-lg rounded-lg border border-gray-200 z-50",children:(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Payments"}),(0,t.jsx)("button",{onClick:()=>{g(!1),a.push("/user/payments")},className:"text-xs text-blue-600 hover:text-blue-800",children:"View All"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3 mb-3",children:[(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-lg font-bold text-gray-900",children:y(m?.totalSpent||0)}),(0,t.jsx)("div",{className:"text-xs text-gray-500",children:"Total Spent"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-lg font-bold text-gray-900",children:y(m?.thisMonthSpent||0)}),(0,t.jsx)("div",{className:"text-xs text-gray-500",children:"This Month"})]})]}),b&&(0,t.jsxs)("div",{className:"space-y-2 mb-3",children:[m?.pendingPayments>0&&(0,t.jsxs)("div",{className:"flex items-center p-2 bg-yellow-50 rounded text-xs",children:[(0,t.jsx)(o.A,{className:"h-3 w-3 text-yellow-600 mr-2"}),(0,t.jsxs)("span",{className:"text-yellow-800",children:[m.pendingPayments," pending payment",m.pendingPayments>1?"s":""]})]}),m?.overdueInvoices>0&&(0,t.jsxs)("div",{className:"flex items-center p-2 bg-red-50 rounded text-xs",children:[(0,t.jsx)(l.A,{className:"h-3 w-3 text-red-600 mr-2"}),(0,t.jsxs)("span",{className:"text-red-800",children:[m.overdueInvoices," overdue invoice",m.overdueInvoices>1?"s":""]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("button",{onClick:()=>{g(!1),a.push("/user/payments")},className:"w-full flex items-center p-2 text-sm text-gray-700 hover:bg-gray-50 rounded transition-colors",children:[(0,t.jsx)(c.A,{className:"h-4 w-4 mr-2"}),"View Payments"]}),(0,t.jsxs)("button",{onClick:()=>{g(!1),a.push("/user/subscription")},className:"w-full flex items-center p-2 text-sm text-gray-700 hover:bg-gray-50 rounded transition-colors",children:[(0,t.jsx)(d.A,{className:"h-4 w-4 mr-2"}),"Subscription"]}),(0,t.jsxs)("button",{onClick:()=>{g(!1),a.push("/user/payments?tab=methods")},className:"w-full flex items-center p-2 text-sm text-gray-700 hover:bg-gray-50 rounded transition-colors",children:[(0,t.jsx)(d.A,{className:"h-4 w-4 mr-2"}),"Payment Methods"]})]})]})})]})}},29934:(e,s,a)=>{a.d(s,{A:()=>d});var t=a(8732),r=a(82015),n=a(19918),i=a.n(n),o=a(4722),l=a(56761),c=a.n(l);let d=()=>{let[e,s]=(0,r.useState)("fr"),{data:a}=(0,o.useSession)();return(0,t.jsxs)("footer",{className:"bg-gradient-to-b from-primary to-orange-600 text-white pt-8 pb-4 px-4 mt-12",children:[(0,t.jsxs)("div",{className:"max-w-7xl mx-auto flex flex-col md:flex-row md:justify-between md:items-start gap-8",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center md:items-start mb-6 md:mb-0",children:[(0,t.jsx)(c(),{src:"/images/Logo_w.png",alt:"Libert\xe9 M\xeame en Prison Logo",width:80,height:80,className:"mb-2"}),(0,t.jsx)("span",{className:"font-bold text-lg",children:"LIBERT\xc9 M\xcaME EN PRISON"})]}),(0,t.jsxs)("div",{className:"flex-1 grid grid-cols-2 md:grid-cols-4 gap-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"font-semibold mb-2",children:"General"}),(0,t.jsxs)("ul",{className:"space-y-1",children:[(0,t.jsx)("li",{children:(0,t.jsx)(i(),{href:"/",className:"hover:underline",children:"Home"})}),(0,t.jsx)("li",{children:(0,t.jsx)(i(),{href:"en"===e?"/en/about":"/about",className:"hover:underline",children:"About"})}),(0,t.jsx)("li",{children:(0,t.jsx)(i(),{href:"en"===e?"/en/who":"/who",className:"hover:underline",children:"Who"})}),(0,t.jsx)("li",{children:(0,t.jsx)(i(),{href:"en"===e?"/en/contact":"/contact",className:"hover:underline",children:"''Contact''"})}),(0,t.jsx)("li",{children:(0,t.jsx)(i(),{href:"en"===e?"/en/faq":"/faq",className:"hover:underline",children:"FAQ"})}),(0,t.jsx)("li",{children:(0,t.jsx)(i(),{href:"en"===e?"/en/resources":"/resources",className:"hover:underline",children:"Resources"})}),(0,t.jsx)("li",{children:(0,t.jsx)(i(),{href:"en"===e?"/en/class-action":"/class-action",className:"hover:underline",children:"Class Action"})}),(0,t.jsx)("li",{children:(0,t.jsx)(i(),{href:"en"===e?"/en/legal-notice":"/legal-notice",className:"hover:underline",children:"Legal Basis"})})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"font-semibold mb-2",children:"Policies"}),(0,t.jsxs)("ul",{className:"space-y-1",children:[(0,t.jsx)("li",{children:(0,t.jsx)(i(),{href:"en"===e?"/en/privacy-policy":"/privacy-policy",className:"hover:underline",children:"Privacy Policy"})}),(0,t.jsx)("li",{children:(0,t.jsx)(i(),{href:"en"===e?"/en/cookie-policy":"/cookie-policy",className:"hover:underline",children:"Cookie Policy"})}),(0,t.jsx)("li",{children:(0,t.jsx)(i(),{href:"en"===e?"/en/terms":"/terms",className:"hover:underline",children:"Terms"})}),(0,t.jsx)("li",{children:(0,t.jsx)(i(),{href:"en"===e?"/en/accessibility":"/accessibility",className:"hover:underline",children:"Accessibility"})})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"font-semibold mb-2",children:"Account"}),(0,t.jsxs)("ul",{className:"space-y-1",children:[!a&&(0,t.jsx)("li",{children:(0,t.jsx)(i(),{href:"en"===e?"/en/auth/login":"/auth/login",className:"hover:underline",children:"Login"})}),!a&&(0,t.jsx)("li",{children:(0,t.jsx)(i(),{href:"en"===e?"/en/auth/signup":"/auth/signup",className:"hover:underline",children:"Signup"})}),a&&(0,t.jsx)("li",{children:(0,t.jsx)(i(),{href:"en"===e?"/en/user/dashboard":"/user/dashboard",className:"hover:underline",children:"Dashboard"})}),a?.user?.role==="ADMIN"&&(0,t.jsx)("li",{children:(0,t.jsx)(i(),{href:"en"===e?"/en/admin":"/admin",className:"hover:underline",children:"Admin"})})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"font-semibold mb-2",children:"\uD83D\uDCB0 Financial"}),(0,t.jsxs)("ul",{className:"space-y-1",children:[a&&(0,t.jsx)("li",{children:(0,t.jsx)(i(),{href:"en"===e?"/en/financial-dashboard":"/financial-dashboard",className:"hover:underline",children:"\uD83D\uDCB0 Financial Dashboard"})}),a&&(0,t.jsx)("li",{children:(0,t.jsx)(i(),{href:"en"===e?"/en/payment-demo":"/payment-demo",className:"hover:underline",children:"\uD83D\uDCB3 Payment Demo"})}),a&&(0,t.jsx)("li",{children:(0,t.jsx)(i(),{href:"en"===e?"/en/society-dashboard":"/society-dashboard",className:"hover:underline",children:"⭐ Society Progress"})}),(0,t.jsx)("li",{children:(0,t.jsx)(i(),{href:"en"===e?"/en/profiles":"/profiles",className:"hover:underline",children:"\uD83D\uDC65 Our Team"})}),(0,t.jsx)("li",{children:(0,t.jsx)(i(),{href:"en"===e?"/en/live-cases":"/live-cases",className:"hover:underline",children:"\uD83D\uDCCB Live Cases"})})]})]})]})]}),(0,t.jsxs)("div",{className:"mt-8 border-t border-white/20 pt-4 text-center text-xs text-white/70",children:["\xa9 ",new Date().getFullYear()," Libert\xe9 M\xeame en Cellule. All rights reserved.",(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)("span",{className:"text-yellow-300",children:"\uD83D\uDCB3"})," Secure payments powered by Stripe |",(0,t.jsx)("span",{className:"text-blue-300",children:" \uD83D\uDD12"})," Escrow protection for all transactions |",(0,t.jsx)("span",{className:"text-green-300",children:" ⭐"})," Society member benefits available"]})]})]})}},38559:(e,s,a)=>{a.a(e,async(e,t)=>{try{a.d(s,{A:()=>p});var r=a(8732),n=a(82015),i=a(4722),o=a(63220),l=a(87637),c=a(27290),d=a(87962),m=a(49048),h=a(9741),u=a(66596),x=e([o]);o=(x.then?(await x)():x)[0];let p=({isOpen:e,onClose:s})=>{let{data:a}=(0,i.useSession)(),[t,x]=(0,n.useState)({showFriends:!0,showEmail:!1,showPhone:!1,showLocation:!1,allowMessages:!0,showOnlineStatus:!0}),[p,g]=(0,n.useState)(!1),[f,y]=(0,n.useState)("");(0,n.useEffect)(()=>{e&&a?.user?.id&&b()},[e,a?.user?.id]);let b=async()=>{try{let e=await fetch(`/api/users/${a?.user?.id}`);if(e.ok){let s=await e.json();x({showFriends:s.showFriends??!0,showEmail:s.showEmail??!1,showPhone:s.showPhone??!1,showLocation:s.showLocation??!1,allowMessages:s.allowMessages??!0,showOnlineStatus:s.showOnlineStatus??!0})}}catch(e){console.error("Error fetching privacy settings:",e)}},j=async()=>{if(a?.user?.id){g(!0),y("");try{(await fetch(`/api/users/${a.user.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).ok?(y("Privacy settings updated successfully!"),setTimeout(()=>y(""),3e3)):y("Failed to update privacy settings. Please try again.")}catch(e){console.error("Error updating privacy settings:",e),y("An error occurred. Please try again.")}finally{g(!1)}}},v=e=>{x(s=>({...s,[e]:!s[e]}))},N=[{key:"showFriends",label:"Show Friends List",description:"Allow others to see your friends and connections",icon:l.A,category:"Profile Visibility"},{key:"showEmail",label:"Show Email Address",description:"Display your email address on your profile",icon:c.A,category:"Contact Information"},{key:"showPhone",label:"Show Phone Number",description:"Display your phone number on your profile",icon:c.A,category:"Contact Information"},{key:"showLocation",label:"Show Location",description:"Display your location on your profile",icon:c.A,category:"Profile Visibility"},{key:"allowMessages",label:"Allow Direct Messages",description:"Let other users send you private messages",icon:d.A,category:"Communication"},{key:"showOnlineStatus",label:"Show Online Status",description:"Display when you are online",icon:c.A,category:"Profile Visibility"}].reduce((e,s)=>(e[s.category]||(e[s.category]=[]),e[s.category].push(s),e),{});return(0,r.jsx)(o.AnimatePresence,{children:e&&(0,r.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:(0,r.jsxs)(o.motion.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-white rounded-xl shadow-2xl max-w-2xl w-full max-h-[90vh] overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-gray-200",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"p-2 bg-blue-100 rounded-lg",children:(0,r.jsx)(m.A,{className:"h-6 w-6 text-blue-600"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"Privacy Settings"}),(0,r.jsx)("p",{className:"text-sm text-gray-500",children:"Control who can see your information"})]})]}),(0,r.jsx)("button",{onClick:s,className:"p-2 hover:bg-gray-100 rounded-lg transition-colors",children:(0,r.jsx)(h.A,{className:"h-5 w-5 text-gray-500"})})]}),(0,r.jsxs)("div",{className:"p-6 overflow-y-auto max-h-[60vh]",children:[f&&(0,r.jsx)("div",{className:`mb-4 p-3 rounded-lg text-sm ${f.includes("successfully")?"bg-green-50 text-green-700 border border-green-200":"bg-red-50 text-red-700 border border-red-200"}`,children:f}),(0,r.jsx)("div",{className:"space-y-6",children:Object.entries(N).map(([e,s])=>(0,r.jsxs)("div",{children:[(0,r.jsxs)("h3",{className:"text-lg font-medium text-gray-900 mb-3 flex items-center gap-2",children:[(0,r.jsx)(u.A,{className:"h-5 w-5 text-gray-600"}),e]}),(0,r.jsx)("div",{className:"space-y-3",children:s.map(e=>{let s=e.icon;return(0,r.jsxs)("div",{className:"flex items-center justify-between p-4 border border-gray-200 rounded-lg hover:bg-gray-50 transition-colors",children:[(0,r.jsxs)("div",{className:"flex items-start gap-3 flex-1",children:[(0,r.jsx)("div",{className:"p-2 bg-gray-100 rounded-lg",children:(0,r.jsx)(s,{className:"h-4 w-4 text-gray-600"})}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h4",{className:"font-medium text-gray-900",children:e.label}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:e.description})]})]}),(0,r.jsx)("button",{onClick:()=>v(e.key),className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 ${t[e.key]?"bg-blue-600":"bg-gray-200"}`,children:(0,r.jsx)("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${t[e.key]?"translate-x-6":"translate-x-1"}`})})]},e.key)})})]},e))})]}),(0,r.jsxs)("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-gray-200 bg-gray-50",children:[(0,r.jsx)("button",{onClick:s,className:"px-4 py-2 text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors",children:"Cancel"}),(0,r.jsx)("button",{onClick:j,disabled:p,className:"px-6 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",children:p?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"}),"Saving..."]}):"Save Changes"})]})]})})})};t()}catch(e){t(e)}})},50930:(e,s,a)=>{a.a(e,async(e,t)=>{try{a.d(s,{y:()=>c});var r=a(82015),n=a(4722),i=a(42893),o=a(44233),l=e([i]);function c(){let{data:e,update:s}=(0,n.useSession)(),[a,t]=(0,r.useState)(!1),l=(0,o.useRouter)(),c=async(a,r)=>{if(!e?.user)return i.toast.error("Not authenticated"),!1;let n=e.user.isImpersonating&&e.user.originalUser?e.user.originalUser.role:e.user.role;if(console.log("\uD83D\uDD0D Impersonation check:",{effectiveRole:n,currentRole:e.user.role,isImpersonating:e.user.isImpersonating,originalUser:e.user.originalUser}),"SUPERADMIN"!==n&&"ADMIN"!==n)return i.toast.error("Only Super Admins and Admins can impersonate users"),!1;if(e.user.isImpersonating)return i.toast.error("Already impersonating a user. Please stop current impersonation first."),!1;t(!0);try{let t;console.log("\uD83D\uDD04 Starting impersonation request for userId:",a),console.log("\uD83D\uDD04 Effective role for impersonation:",n),console.log("\uD83D\uDD04 Current session:",{userId:e.user.id,email:e.user.email,role:e.user.role,isImpersonating:e.user.isImpersonating});let o=await fetch("/api/admin/impersonate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:a})});if(console.log("\uD83D\uDCCA Response received:",{status:o.status,statusText:o.statusText,ok:o.ok}),!o.ok){let e="Failed to impersonate user",s="";try{let a=await o.json();e=a.error||a.message||e,s=a.details||""}catch(s){console.error("Failed to parse error response:",s);try{let s=await o.text();console.error("Raw error response:",s),e=`Server error (${o.status}): ${s||"Unknown error"}`}catch(s){console.error("Failed to read response as text:",s),e=`Server error (${o.status}): Unable to read response`}}return console.error("❌ Impersonation failed:",{status:o.status,errorMessage:e,errorDetails:s}),429===o.status?i.toast.error("Rate limit exceeded. Please wait a moment and try again."):403===o.status?i.toast.error("Access denied. You may not have permission to impersonate this user."):404===o.status?i.toast.error("User not found."):i.toast.error(e),!1}try{t=await o.json(),console.log("✅ Impersonation success data:",t)}catch(e){return console.error("Failed to parse success response:",e),i.toast.error("Invalid response from server"),!1}return i.toast.success(`🔄 Impersonation initiated for ${r}`,{duration:3e3,icon:"\uD83D\uDC64"}),console.log("\uD83D\uDD04 Forcing session update..."),await s({trigger:"update"}),console.log("\uD83D\uDD04 Waiting for session to update..."),await new Promise(e=>setTimeout(e,1500)),console.log("\uD83D\uDD04 Reloading page to ensure session consistency..."),window.location.href=t.redirectUrl,!0}catch(e){return console.error("❌ Impersonation error:",e),e instanceof TypeError&&e.message.includes("fetch")?i.toast.error("Network error. Please check your connection and try again."):i.toast.error(e instanceof Error?e.message:"Failed to impersonate user"),!1}finally{t(!1)}},d=async()=>{try{console.log("\uD83D\uDD04 stopImpersonation - Starting..."),console.log("\uD83D\uDD04 Current session state:",{isImpersonating:e?.user?.isImpersonating,originalUser:e?.user?.originalUser});let a=await fetch("/api/admin/stop-impersonation",{method:"POST",headers:{"Content-Type":"application/json"}});console.log("\uD83D\uDCCA Stop impersonation response:",{status:a.status,statusText:a.statusText,ok:a.ok});let t=await a.json();if(a.ok)console.log("✅ stopImpersonation - API success:",t),i.toast.success("\uD83D\uDD04 Impersonation stopped successfully",{duration:2e3,icon:"\uD83D\uDC64"}),console.log("\uD83D\uDD04 stopImpersonation - Updating session..."),await s({trigger:"update"}),console.log("\uD83D\uDD04 stopImpersonation - Waiting for session to update..."),await new Promise(e=>setTimeout(e,1500)),console.log("\uD83D\uDD04 stopImpersonation - Reloading page to ensure session consistency..."),window.location.href="/admin/dashboard";else{if(console.error("❌ stopImpersonation - API error:",t),"Not currently impersonating"===t.error||t.error?.includes("not impersonating")){console.log("ℹ️ stopImpersonation - User is not currently impersonating, redirecting to admin dashboard"),(0,i.toast)("Not currently impersonating any user"),l.push("/admin/dashboard");return}i.toast.error(t.error||"Failed to stop impersonation"),console.warn("⚠️ stopImpersonation - Non-critical error, forcing hard reload"),window.location.href="/admin/dashboard"}}catch(e){console.error("❌ stopImpersonation - Error:",e),i.toast.error("Network error while stopping impersonation"),console.warn("⚠️ stopImpersonation - Network error, forcing hard reload"),window.location.href="/admin/dashboard"}};return{impersonateUser:c,stopImpersonation:d,isImpersonating:a,isCurrentlyImpersonating:e?.user?.isImpersonating||!1,originalUser:e?.user?.originalUser||null,canImpersonate:!e?.user?.isImpersonating&&!a,debugInfo:{sessionExists:!!e,userRole:e?.user?.role,isImpersonating:e?.user?.isImpersonating,originalUserRole:e?.user?.originalUser?.role}}}i=(l.then?(await l)():l)[0],t()}catch(e){t(e)}})},51005:(e,s,a)=>{a.a(e,async(e,t)=>{try{a.d(s,{A:()=>l});var r=a(8732);a(82015);var n=a(4722),i=a(50930),o=e([i]);function l(){let{data:e}=(0,n.useSession)(),{stopImpersonation:s,isImpersonating:a}=(0,i.y)();if(!e?.user?.isImpersonating||!e?.user?.originalUser)return null;let t=async()=>{try{await s()}catch(e){alert("Failed to stop impersonation. Forcing sign out."),(0,n.signOut)({callbackUrl:"/auth/login"}),window.location.href="/auth/login"}};return(0,r.jsxs)("div",{className:"bg-red-600 text-white p-4 flex items-center justify-between z-50",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("b",{children:"Impersonation Mode:"})," You are impersonating another user."]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("button",{onClick:t,className:"bg-white text-red-700 px-4 py-2 rounded font-bold hover:bg-red-100 border border-red-700",title:"Stop Impersonation",children:"\uD83D\uDEAB Stop Impersonation"}),(0,r.jsx)("button",{onClick:()=>{(0,n.signOut)({callbackUrl:"/auth/login"}),window.location.href="/auth/login"},className:"bg-white text-gray-700 px-4 py-2 rounded font-bold hover:bg-gray-100 border border-gray-400",title:"Force Sign Out (if stuck)",children:"Force Sign Out"})]})]})}i=(o.then?(await o)():o)[0],t()}catch(e){t(e)}})},56523:(e,s,a)=>{a.d(s,{A:()=>l});var t=a(8732),r=a(82015),n=a(44233),i=a(19918),o=a.n(i);let l=()=>{let[e,s]=(0,r.useState)("fr");(0,n.useRouter)();let[a,i]=(0,r.useState)(!1);return((0,r.useEffect)(()=>{localStorage.getItem("cookieConsent")||i(!0)},[]),a)?(0,t.jsx)("div",{className:"fixed bottom-0 left-0 right-0 bg-white border-t border-gray-200 shadow-lg z-50",children:(0,t.jsx)("div",{className:"max-w-7xl mx-auto px-4 py-4",children:(0,t.jsxs)("div",{className:"flex flex-col md:flex-row items-center justify-between gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 text-sm text-gray-600",children:["We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies.",(0,t.jsxs)("div",{className:"mt-2 md:mt-0 md:inline-block md:ml-2",children:[(0,t.jsx)(o(),{href:"en"===e?"/en/privacy-policy":"/privacy-policy",className:"text-primary hover:text-primary-dark",children:"Privacy Policy"})," • ",(0,t.jsx)(o(),{href:"en"===e?"/en/cookie-policy":"/cookie-policy",className:"text-primary hover:text-primary-dark",children:"Cookie Policy"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("button",{onClick:()=>{localStorage.setItem("cookieConsent","true"),i(!1)},className:"bg-primary text-white px-6 py-2 rounded-full hover:bg-primary-dark transition-colors",children:"Accept"}),(0,t.jsx)("button",{onClick:()=>i(!1),className:"text-gray-500 hover:text-gray-700","aria-label":"Close",children:(0,t.jsx)("span",{className:"w-5 h-5 flex items-center justify-center text-xl font-bold",children:"\xd7"})})]})]})})}):null}},90226:(e,s,a)=>{a.d(s,{Ay:()=>u,Ei:()=>o,F6:()=>i,JF:()=>h,L8:()=>d,Xz:()=>c,aM:()=>m,pu:()=>l});var t=a(8732),r=a(49788),n=a.n(r);let i=e=>{let s="https://lavocat.ca";return{"@context":"https://schema.org","@type":"LegalCase",name:e.title||"Legal Case",description:e.description||e.summary||"Legal case details and information",url:`${s}/public/cases/${e.id}`,dateCreated:e.createdAt,dateModified:e.updatedAt,datePublished:e.createdAt,author:e.client?{"@type":"Person",name:e.client.name,url:e.client.username?`${s}/profile/${e.client.username}`:void 0}:e.lawyer?{"@type":"Person",name:e.lawyer.name,url:e.lawyer.username?`${s}/profile/${e.lawyer.username}`:void 0}:void 0,publisher:{"@type":"Organization",name:"Libert\xe9 M\xeame en Prison",url:s,logo:{"@type":"ImageObject",url:`${s}/images/logo.png`}},mainEntityOfPage:{"@type":"WebPage","@id":`${s}/public/cases/${e.id}`},image:e.client?.profileImage?{"@type":"ImageObject",url:e.client.profileImage.startsWith("http")?e.client.profileImage:`${s}${e.client.profileImage}`,width:1200,height:630}:void 0,category:e.category,legalArea:e.legalArea,jurisdiction:e.jurisdiction,court:e.court,status:e.status,urgencyLevel:e.urgencyLevel,riskLevel:e.riskLevel,estimatedValue:e.estimatedValue,tags:e.tags,commentCount:e._count?.comments||0,viewCount:e.viewCount||0,supporterCount:e.supporterCount||0}},o=e=>{let s="https://lavocat.ca";return{"@context":"https://schema.org","@type":"Person",name:e.name,url:`${s}/profile/${e.username}`,image:e.profilePicture?e.profilePicture.startsWith("http")?e.profilePicture:`${s}${e.profilePicture}`:void 0,description:e.bio,jobTitle:e.title||"Lawyer",worksFor:{"@type":"Organization",name:"Libert\xe9 M\xeame en Prison",url:s},address:e.officeLocation?{"@type":"PostalAddress",addressLocality:e.officeLocation}:void 0,telephone:e.workPhone,email:e.email,sameAs:[e.linkedinUrl,e.websiteUrl].filter(Boolean),knowsAbout:[e.specialization,"Legal Services","Law"].filter(Boolean),hasCredential:e.education?[{"@type":"EducationalOccupationalCredential",name:e.education,credentialCategory:"Educational Credential"}]:void 0,award:e.isVerified?["Verified Lawyer"]:void 0,aggregateRating:e.averageRating?{"@type":"AggregateRating",ratingValue:e.averageRating,reviewCount:e.totalCases||0,bestRating:5}:void 0,priceRange:e.hourlyRate?`$${e.hourlyRate}/hour`:void 0,areaServed:e.officeLocation?[{"@type":"Place",name:e.officeLocation}]:void 0,availableService:[{"@type":"Service",name:"Legal Consultation",description:"Professional legal consultation and representation services"}]}},l=()=>{let e="https://lavocat.ca";return{"@context":"https://schema.org","@type":"Organization",name:"Libert\xe9 M\xeame en Prison",url:e,logo:{"@type":"ImageObject",url:`${e}/images/logo.png`,width:180,height:180},description:"A comprehensive legal marketplace connecting clients with qualified legal professionals. Browse cases, find lawyers, and access legal services.",contactPoint:[{"@type":"ContactPoint",contactType:"customer service",email:"support@libertememeenprison.com"}],sameAs:["https://twitter.com/LiberteMemeEnPrison","https://linkedin.com/company/libertememeenprison"],serviceArea:[{"@type":"Place",name:"Global"}]}},c=()=>{let e="https://lavocat.ca";return{"@context":"https://schema.org","@type":"WebSite",name:"Libert\xe9 M\xeame en Prison",url:e,description:"A comprehensive legal marketplace connecting clients with qualified legal professionals",publisher:{"@type":"Organization",name:"Libert\xe9 M\xeame en Prison",url:e},potentialAction:{"@type":"SearchAction",target:{"@type":"EntryPoint",urlTemplate:`${e}/search?q={search_term_string}`},"query-input":"required name=search_term_string"}}},d=e=>({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:e.map((e,s)=>({"@type":"ListItem",position:s+1,name:e.name,item:e.url.startsWith("http")?e.url:`https://lavocat.ca${e.url}`}))}),m=e=>({"@context":"https://schema.org","@type":"FAQPage",mainEntity:e.map(e=>({"@type":"Question",name:e.question,acceptedAnswer:{"@type":"Answer",text:e.answer}}))}),h=e=>{let s="https://lavocat.ca";return{"@context":"https://schema.org","@type":"HowTo",name:e.name,description:e.description,image:e.image?{"@type":"ImageObject",url:e.image.startsWith("http")?e.image:`${s}${e.image}`}:void 0,totalTime:e.totalTime,estimatedCost:e.estimatedCost?{"@type":"MonetaryAmount",currency:e.estimatedCost.currency,value:e.estimatedCost.value}:void 0,supply:e.supply?.map(e=>({"@type":"HowToSupply",name:e})),tool:e.tool?.map(e=>({"@type":"HowToTool",name:e})),step:e.steps.map((e,a)=>({"@type":"HowToStep",name:e.name,text:e.text,url:e.url?e.url.startsWith("http")?e.url:`${s}${e.url}`:void 0,image:e.image?{"@type":"ImageObject",url:e.image.startsWith("http")?e.image:`${s}${e.image}`}:void 0}))}},u=({type:e,data:s})=>(0,t.jsx)(n(),{children:(0,t.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(s,null,2)}})})},94292:(e,s,a)=>{a.a(e,async(e,t)=>{try{a.d(s,{A:()=>f});var r=a(8732),n=a(82015),i=a(50930),o=a(35091),l=a(71335),c=a(13838),d=a(22554),m=a(5453),h=a(30703),u=a(18804),x=a(56761),p=a.n(x),g=e([i]);i=(g.then?(await g)():g)[0];let y=e=>{switch(e){case"SUPERADMIN":return"\uD83D\uDC51";case"ADMIN":return"⚡";case"LAWYER":return"\uD83D\uDC68\uD83D\uDCBC";case"CLIENT":default:return"\uD83D\uDC64";case"JURIST":return"\uD83D\uDCDA";case"JUDGE":return"⚖️";case"MEDIATOR":return"\uD83E\uDD1D";case"CONSULTANT":return"\uD83D\uDCBC";case"INVESTIGATOR":return"\uD83D\uDD0D";case"EXPERT_WITNESS":return"\uD83C\uDF93";case"SUPPORT_STAFF":return"\uD83D\uDEE0️";case"STUDENT":return"\uD83C\uDF92";case"NOTARY":return"\uD83D\uDCDC"}},b=e=>{switch(e){case"SUPERADMIN":return"bg-purple-100 text-purple-800";case"ADMIN":return"bg-red-100 text-red-800";case"LAWYER":return"bg-blue-100 text-blue-800";case"CLIENT":return"bg-green-100 text-green-800";case"JURIST":return"bg-indigo-100 text-indigo-800";case"JUDGE":return"bg-yellow-100 text-yellow-800";case"MEDIATOR":return"bg-pink-100 text-pink-800";case"CONSULTANT":return"bg-orange-100 text-orange-800";case"INVESTIGATOR":return"bg-teal-100 text-teal-800";case"EXPERT_WITNESS":return"bg-cyan-100 text-cyan-800";case"SUPPORT_STAFF":default:return"bg-gray-100 text-gray-800";case"STUDENT":return"bg-emerald-100 text-emerald-800";case"NOTARY":return"bg-amber-100 text-amber-800"}};function f({isOpen:e,onClose:s}){let[a,t]=(0,n.useState)([]),[x,g]=(0,n.useState)(!1),[f,j]=(0,n.useState)(""),[v,N]=(0,n.useState)("all"),{impersonateUser:w}=(0,i.y)(),[A,S]=(0,n.useState)(null),C=async e=>{try{console.log("\uD83D\uDD04 Impersonation modal - Starting impersonation for user:",e),await w(e.id,e.name)?(console.log("\uD83D\uDD04 Impersonation modal - Success, closing modal"),s()):console.error("\uD83D\uDD04 Impersonation modal - Failed to impersonate user")}catch(e){console.error("\uD83D\uDD04 Impersonation modal - Error during impersonation:",e)}},k=a.filter(e=>{let s=e.name.toLowerCase().includes(f.toLowerCase())||e.email.toLowerCase().includes(f.toLowerCase())||e.role.toLowerCase().includes(f.toLowerCase()),a="all"===v||e.role===v;return s&&a}),I=Array.from(new Set(a.map(e=>e.role))).sort();return e?(0,r.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,r.jsxs)("div",{className:"bg-white rounded-xl shadow-2xl max-w-4xl w-full mx-4 max-h-[80vh] flex flex-col",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-gray-200",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Impersonate User"}),(0,r.jsx)("p",{className:"text-gray-600 mt-1",children:"Select a user to impersonate their account"})]}),(0,r.jsx)("button",{onClick:s,className:"text-gray-400 hover:text-gray-600 transition-colors",children:(0,r.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,r.jsx)("div",{className:"p-6 border-b border-gray-200 bg-gray-50",children:(0,r.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(o.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),(0,r.jsx)("input",{type:"text",placeholder:"Search users by name, email, or role...",value:f,onChange:e=>j(e.target.value),className:"w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"})]}),(0,r.jsx)("div",{children:(0,r.jsxs)("select",{value:v,onChange:e=>N(e.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:[(0,r.jsx)("option",{value:"all",children:"All Roles"}),I.map(e=>(0,r.jsxs)("option",{value:e,children:[y(e)," ",e]},e))]})})]})}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto p-6",children:x?(0,r.jsxs)("div",{className:"flex items-center justify-center py-12",children:[(0,r.jsx)(l.A,{className:"w-8 h-8 animate-spin text-blue-600"}),(0,r.jsx)("span",{className:"ml-2 text-gray-600",children:"Loading users..."})]}):0===k.length?(0,r.jsxs)("div",{className:"text-center py-12",children:[(0,r.jsx)(c.A,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),(0,r.jsx)("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No users found"}),(0,r.jsx)("p",{className:"text-gray-500",children:"Try adjusting your search or filters."})]}):(0,r.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:k.map(e=>(0,r.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-4 hover:shadow-md transition-shadow cursor-pointer",onClick:()=>C(e),children:[(0,r.jsxs)("div",{className:"flex items-start space-x-3",children:[(0,r.jsx)("div",{className:"flex-shrink-0",children:e.image?(0,r.jsx)(p(),{src:e.image,alt:e.name,width:48,height:48,className:"rounded-full"}):(0,r.jsx)("div",{className:"w-12 h-12 bg-gray-200 rounded-full flex items-center justify-center",children:(0,r.jsx)(c.A,{className:"w-6 h-6 text-gray-500"})})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-gray-900 truncate",children:e.name}),(0,r.jsxs)("span",{className:`px-2 py-1 rounded-full text-xs font-medium ${b(e.role)}`,children:[y(e.role)," ",e.role]})]}),(0,r.jsxs)("div",{className:"flex items-center text-xs text-gray-500 mb-2",children:[(0,r.jsx)(d.A,{className:"w-3 h-3 mr-1"}),(0,r.jsx)("span",{className:"truncate",children:e.email})]}),(0,r.jsxs)("div",{className:"flex items-center text-xs text-gray-500 mb-2",children:[(0,r.jsx)(m.A,{className:"w-3 h-3 mr-1"}),(0,r.jsxs)("span",{children:["Joined ",new Date(e.createdAt).toLocaleDateString()]})]}),(0,r.jsxs)("div",{className:"flex items-center space-x-4 text-xs text-gray-500",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(h.A,{className:"w-3 h-3 mr-1"}),(0,r.jsxs)("span",{children:[e.stats.registrations," apps"]})]}),(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(u.A,{className:"w-3 h-3 mr-1"}),(0,r.jsxs)("span",{children:[e.stats.cases," cases"]})]})]})]})]}),(0,r.jsx)("div",{className:"mt-3 pt-3 border-t border-gray-100",children:(0,r.jsx)("button",{className:"w-full bg-blue-600 hover:bg-blue-700 text-white text-sm font-medium py-2 px-3 rounded-md transition-colors",children:"Impersonate"})})]},e.id))})}),(0,r.jsx)("div",{className:"p-6 border-t border-gray-200 bg-gray-50",children:(0,r.jsxs)("div",{className:"flex justify-between items-center",children:[(0,r.jsxs)("div",{className:"text-sm text-gray-600",children:[k.length," user",1!==k.length?"s":""," found"]}),(0,r.jsx)("button",{onClick:s,className:"px-4 py-2 bg-gray-300 hover:bg-gray-400 text-gray-800 rounded-md transition-colors",children:"Cancel"})]})})]})}):null}t()}catch(e){t(e)}})},96774:(e,s,a)=>{a.d(s,{A:()=>n});var t=a(8732),r=a(4722);let n=()=>{let{data:e,status:s}=(0,r.useSession)();return"loading"===s?(0,t.jsx)("div",{className:"text-sm text-gray-500",children:"Loading session..."}):e?(0,t.jsxs)("div",{className:"text-xs text-gray-400 p-2 bg-gray-100 rounded",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("strong",{children:"Status:"})," ",s]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("strong",{children:"User ID:"})," ",e.user?.id]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("strong",{children:"Email:"})," ",e.user?.email]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("strong",{children:"Role:"})," ",e.user?.role]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("strong",{children:"Name:"})," ",e.user?.name]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("strong",{children:"Is Impersonating:"})," ",e.user?.isImpersonating?"Yes":"No"]})]}):(0,t.jsx)("div",{className:"text-sm text-red-500",children:"No session found"})}}};