T.ME/BIBIL_0DAY
CasperSecurity


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/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/gositeme/domains/lavocat.ca/private_html/.next/server/chunks/862.js
"use strict";exports.id=862,exports.ids=[862],exports.modules={54386:(e,t,s)=>{s.d(t,{A:()=>r});var a=s(8732),i=s(82015),n=s(4722);function r(){let{data:e}=(0,n.useSession)(),[t,s]=(0,i.useState)(null),[r,o]=(0,i.useState)(!0),[m,h]=(0,i.useState)(null),[p,u]=(0,i.useState)("overview"),g=async()=>{try{o(!0);let e=await fetch("/api/payments/financial-dashboard");if(!e.ok)throw Error("Failed to fetch financial data");let t=await e.json();s(t)}catch(e){console.error("Error fetching financial data:",e),h("Failed to load financial data. Please try again.")}finally{o(!1)}};if(r)return(0,a.jsxs)("div",{className:"flex items-center justify-center min-h-[400px]",children:[(0,a.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600"}),(0,a.jsx)("span",{className:"ml-3 text-gray-600",children:"Loading financial dashboard..."})]});if(m)return(0,a.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-md p-4",children:(0,a.jsxs)("div",{className:"flex",children:[(0,a.jsx)("svg",{className:"h-5 w-5 text-red-400",fill:"currentColor",viewBox:"0 0 20 20",children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})}),(0,a.jsxs)("div",{className:"ml-3",children:[(0,a.jsx)("h3",{className:"text-sm font-medium text-red-800",children:"Error"}),(0,a.jsx)("p",{className:"text-sm text-red-700 mt-1",children:m}),(0,a.jsx)("button",{onClick:g,className:"mt-2 text-sm bg-red-100 hover:bg-red-200 text-red-800 px-3 py-1 rounded",children:"Try Again"})]})]})});if(!t)return(0,a.jsx)("div",{children:"No financial data available."});let y=["LAWYER","ADMIN","SUPERADMIN"].includes(t.user.role);return(0,a.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[(0,a.jsxs)("div",{className:"mb-8",children:[(0,a.jsx)("h1",{className:"text-3xl font-bold text-gray-900",children:"Financial Dashboard"}),(0,a.jsxs)("p",{className:"text-gray-600 mt-2",children:["Track your ",y?"earnings":"spending",", society benefits, and payment history"]}),t.societyInfo&&(0,a.jsxs)("div",{className:"mt-4 inline-flex items-center px-4 py-2 rounded-full text-sm font-medium bg-gradient-to-r from-blue-500 to-purple-600 text-white",children:[(0,a.jsx)("svg",{className:"h-4 w-4 mr-2",fill:"currentColor",viewBox:"0 0 20 20",children:(0,a.jsx)("path",{d:"M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"})}),t.societyInfo.tier," Member • ",(100*t.societyInfo.platformFeeDiscount).toFixed(0),"% Fee Discount"]})]}),(0,a.jsx)("div",{className:"border-b border-gray-200 mb-6",children:(0,a.jsx)("nav",{className:"-mb-px flex space-x-8",children:[{id:"overview",name:"Overview",icon:"\uD83D\uDCCA"},{id:"transactions",name:"Transactions",icon:"\uD83D\uDCB3"},{id:"escrow",name:"Escrow",icon:"\uD83D\uDD12"},{id:"analytics",name:"Analytics",icon:"\uD83D\uDCC8"}].map(e=>(0,a.jsxs)("button",{onClick:()=>u(e.id),className:`py-2 px-1 border-b-2 font-medium text-sm ${p===e.id?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"}`,children:[(0,a.jsx)("span",{className:"mr-2",children:e.icon}),e.name]},e.id))})}),"overview"===p&&(0,a.jsx)(l,{data:t,isLawyer:y}),"transactions"===p&&(0,a.jsx)(c,{transactions:t.recentTransactions}),"escrow"===p&&(0,a.jsx)(d,{escrowAccounts:t.escrowAccounts,isLawyer:y}),"analytics"===p&&(0,a.jsx)(x,{data:t,isLawyer:y})]})}function l({data:e,isLawyer:t}){let{overview:s,monthlyComparison:i}=e,n=[{title:t?"Total Earnings":"Total Spent",value:`$${(t?s.totalEarnings:s.totalSpent).toFixed(2)}`,change:t?i.currentMonth.earnings-i.lastMonth.earnings:i.currentMonth.spending-i.lastMonth.spending,icon:t?"\uD83D\uDCB0":"\uD83D\uDCB8",color:"blue"},{title:t?"This Month Earnings":"This Month Spent",value:`$${(t?s.thisMonthEarnings:s.thisMonthSpent).toFixed(2)}`,change:0,icon:"\uD83D\uDCC5",color:"green"},{title:"Escrow Balance",value:`$${s.escrowBalance.toFixed(2)}`,change:0,icon:"\uD83D\uDD12",color:"yellow"},{title:"Society Savings",value:`$${s.societyDiscountsSaved.toFixed(2)}`,change:0,icon:"⭐",color:"purple"}];return t&&n.push({title:"Pending Payouts",value:`$${s.pendingPayouts.toFixed(2)}`,change:0,icon:"⏳",color:"orange"}),(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:n.map((e,t)=>(0,a.jsx)("div",{className:"bg-white rounded-lg shadow p-6",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("div",{className:"text-2xl mr-3",children:e.icon}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-gray-600",children:e.title}),(0,a.jsx)("p",{className:"text-2xl font-bold text-gray-900",children:e.value}),0!==e.change&&(0,a.jsxs)("p",{className:`text-sm ${e.change>0?"text-green-600":"text-red-600"}`,children:[e.change>0?"+":"","$",e.change.toFixed(2)," from last month"]})]})]})},t))}),e.societyInfo&&(0,a.jsxs)("div",{className:"bg-gradient-to-r from-blue-50 to-purple-50 rounded-lg p-6",children:[(0,a.jsxs)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:["\uD83C\uDF1F ",e.societyInfo.tier," Benefits"]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"font-medium text-gray-700 mb-2",children:"Active Benefits:"}),(0,a.jsx)("ul",{className:"space-y-1",children:e.societyInfo.benefits.map((e,t)=>(0,a.jsxs)("li",{className:"text-sm text-gray-600 flex items-center",children:[(0,a.jsx)("svg",{className:"h-4 w-4 text-green-500 mr-2",fill:"currentColor",viewBox:"0 0 20 20",children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),e]},t))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"font-medium text-gray-700 mb-2",children:"Financial Impact:"}),(0,a.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{children:"Platform Fee Rate:"}),(0,a.jsxs)("span",{className:"font-medium",children:[(100*e.societyInfo.discountedRate).toFixed(1),"%"]})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{children:"Total Savings:"}),(0,a.jsxs)("span",{className:"font-medium text-green-600",children:["$",s.societyDiscountsSaved.toFixed(2)]})]})]})]})]})]})]})}function c({transactions:e}){let t=e=>{switch(e.toLowerCase()){case"completed":return"text-green-600 bg-green-100";case"pending":return"text-yellow-600 bg-yellow-100";case"failed":return"text-red-600 bg-red-100";default:return"text-gray-600 bg-gray-100"}};return(0,a.jsxs)("div",{className:"bg-white shadow rounded-lg overflow-hidden",children:[(0,a.jsx)("div",{className:"px-6 py-4 border-b border-gray-200",children:(0,a.jsx)("h3",{className:"text-lg font-medium text-gray-900",children:"Recent Transactions"})}),(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"min-w-full divide-y divide-gray-200",children:[(0,a.jsx)("thead",{className:"bg-gray-50",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Date"}),(0,a.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Description"}),(0,a.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Amount"}),(0,a.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Status"}),(0,a.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"XP"})]})}),(0,a.jsx)("tbody",{className:"bg-white divide-y divide-gray-200",children:e.map(e=>(0,a.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,a.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:new Date(e.createdAt).toLocaleDateString()}),(0,a.jsxs)("td",{className:"px-6 py-4 text-sm text-gray-900",children:[(0,a.jsx)("div",{children:e.description}),e.caseTitle&&(0,a.jsx)("div",{className:"text-xs text-gray-500",children:e.caseTitle})]}),(0,a.jsxs)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:[(0,a.jsxs)("div",{children:["$",e.amount.toFixed(2)]}),e.societyDiscount>0&&(0,a.jsxs)("div",{className:"text-xs text-green-600",children:["-",(100*e.societyDiscount).toFixed(1),"% discount"]})]}),(0,a.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,a.jsx)("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${t(e.status)}`,children:e.status})}),(0,a.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-blue-600",children:e.xpEarned>0&&`+${e.xpEarned} XP`})]},e.id))})]})})]})}function d({escrowAccounts:e,isLawyer:t}){let s=e.asClient,i=e.asLawyer,n=e=>{switch(e.toLowerCase()){case"active":return"text-green-600 bg-green-100";case"completed":return"text-blue-600 bg-blue-100";case"disputed":return"text-red-600 bg-red-100";case"cancelled":return"text-gray-600 bg-gray-100";default:return"text-yellow-600 bg-yellow-100"}},r=({escrows:e,title:t})=>(0,a.jsxs)("div",{className:"bg-white shadow rounded-lg overflow-hidden mb-6",children:[(0,a.jsx)("div",{className:"px-6 py-4 border-b border-gray-200",children:(0,a.jsx)("h3",{className:"text-lg font-medium text-gray-900",children:t})}),0===e.length?(0,a.jsx)("div",{className:"px-6 py-8 text-center text-gray-500",children:"No escrow accounts found."}):(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"min-w-full divide-y divide-gray-200",children:[(0,a.jsx)("thead",{className:"bg-gray-50",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Case"}),(0,a.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:t.includes("Client")?"Lawyer":"Client"}),(0,a.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Total"}),(0,a.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Available"}),(0,a.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Released"}),(0,a.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Status"})]})}),(0,a.jsx)("tbody",{className:"bg-white divide-y divide-gray-200",children:e.map(e=>(0,a.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,a.jsxs)("td",{className:"px-6 py-4 text-sm text-gray-900",children:[(0,a.jsx)("div",{className:"font-medium",children:e.caseTitle}),(0,a.jsx)("div",{className:"text-xs text-gray-500",children:new Date(e.createdAt).toLocaleDateString()})]}),(0,a.jsx)("td",{className:"px-6 py-4 text-sm text-gray-900",children:t.includes("Client")?e.lawyerName:e.clientName}),(0,a.jsxs)("td",{className:"px-6 py-4 text-sm text-gray-900",children:["$",e.totalAmount.toFixed(2)]}),(0,a.jsxs)("td",{className:"px-6 py-4 text-sm text-gray-900",children:["$",e.availableAmount.toFixed(2)]}),(0,a.jsxs)("td",{className:"px-6 py-4 text-sm text-gray-900",children:["$",e.releasedAmount.toFixed(2)]}),(0,a.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,a.jsx)("span",{className:`inline-flex px-2 py-1 text-xs font-semibold rounded-full ${n(e.status)}`,children:e.status})})]},e.id))})]})})]});return(0,a.jsxs)("div",{children:[(0,a.jsx)(r,{escrows:s,title:"As Client"}),t&&(0,a.jsx)(r,{escrows:i,title:"As Lawyer"})]})}function x({data:e,isLawyer:t}){return(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow p-6",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"6-Month Financial Trend"}),(0,a.jsx)("div",{className:"h-64 bg-gray-100 rounded-lg flex items-center justify-center",children:(0,a.jsxs)("div",{className:"text-center text-gray-500",children:[(0,a.jsx)("svg",{className:"h-12 w-12 mx-auto mb-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 12l3-3 3 3 4-4M8 21l4-4 4 4M3 4h18M4 4h16v12a1 1 0 01-1 1H5a1 1 0 01-1-1V4z"})}),(0,a.jsx)("p",{children:"Chart visualization would go here"}),(0,a.jsx)("p",{className:"text-sm mt-1",children:"Use Chart.js or similar library"})]})})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow p-6",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-600",children:"Total Transactions"}),(0,a.jsx)("div",{className:"text-2xl font-bold text-gray-900",children:e.statistics.paymentCount})]}),(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow p-6",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-600",children:"Average Transaction"}),(0,a.jsxs)("div",{className:"text-2xl font-bold text-gray-900",children:["$",e.statistics.averageTransactionAmount.toFixed(2)]})]}),(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow p-6",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-600",children:"Refunds"}),(0,a.jsx)("div",{className:"text-2xl font-bold text-gray-900",children:e.statistics.refundCount})]}),(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow p-6",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-600",children:"Platform Fees Saved"}),(0,a.jsxs)("div",{className:"text-2xl font-bold text-green-600",children:["$",e.statistics.platformFeesSaved.toFixed(2)]})]})]})]})}},61779:(e,t,s)=>{s.r(t),s.d(t,{default:()=>n});var a=s(8732),i=s(82341);function n(){return(0,a.jsxs)(i.Html,{lang:"en",children:[(0,a.jsxs)(i.Head,{children:[(0,a.jsx)("meta",{charSet:"utf-8"}),(0,a.jsx)("meta",{name:"theme-color",content:"#000000"}),(0,a.jsx)("link",{rel:"icon",href:"/favicon.ico"}),(0,a.jsx)("link",{rel:"apple-touch-icon",href:"/logo192.png"}),(0,a.jsx)("link",{rel:"manifest",href:"/manifest.json"}),(0,a.jsx)("link",{rel:"preconnect",href:"https://fonts.googleapis.com"}),(0,a.jsx)("link",{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"}),(0,a.jsx)("link",{href:"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap",rel:"stylesheet"})]}),(0,a.jsxs)("body",{children:[(0,a.jsx)(i.Main,{}),(0,a.jsx)(i.NextScript,{})]})]})}},80237:(e,t)=>{Object.defineProperty(t,"A",{enumerable:!0,get:function(){return s}});var s=function(e){return e.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.IMAGE="IMAGE",e}({})},81413:(e,t)=>{Object.defineProperty(t,"M",{enumerable:!0,get:function(){return function e(t,s){return s in t?t[s]:"then"in t&&"function"==typeof t.then?t.then(t=>e(t,s)):"function"==typeof t&&"default"===s?t:void 0}}})}};

CasperSecurity Mini