FinancePage-BfhaugR1.js 36 KB

1
  1. import{i as e}from"./chunk-aKtaBQYM.js";import{C as t,D as n,a as r,w as ee}from"./client-BdOyoZJz.js";import{n as te}from"./QueryClientProvider-Clbyr4Jg.js";import{t as i}from"./useQuery-CCy0EwsM.js";import{t as a}from"./useMutation-qh3Iyscy.js";import{t as o}from"./createLucideIcon-Yo2YoYjm.js";import{n as ne,t as re}from"./chevrons-right-OnQ-9jKz.js";import{n as ie}from"./ToastContext-VFOrCCoA.js";import{i as s,n as c,t as l}from"./Card-OUAj0Ayh.js";import{t as u}from"./Button-pwVKPiYn.js";import{v as d}from"./date-G9KUauqz.js";import{$t as ae,At as oe,Mn as se,_t as ce,at as le,jn as ue,yt as de}from"./index-BoVbGTav.js";var fe=o(`building-2`,[[`path`,{d:`M10 12h4`,key:`a56b0p`}],[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2`,key:`secmi2`}],[`path`,{d:`M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16`,key:`16ra0t`}]]),pe=o(`clock-3`,[[`path`,{d:`M12 6v6h4`,key:`135r8i`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),me=o(`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`}]]),f=e(n(),1),p=t(),m=/\[(aborted|failed|cancelled):\s*([^\]]*)\]/i;function he(e){if(!e)return{isPartial:!1,partialType:null,cleanedDescription:null};let t=e.match(m);if(!t)return{isPartial:!1,partialType:null,cleanedDescription:e};let n=e.replace(t[0],``).trim();return{isPartial:!0,partialType:t[1].toLowerCase(),cleanedDescription:n||null}}function ge(e,t){if(!e)return`-`;let n=d(e);return n?n.toLocaleString(t):e}function h(e){let t=e.trim();if(!t)return null;let n=Number.parseFloat(t);return Number.isFinite(n)?n:null}function _e(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}T${String(e.getHours()).padStart(2,`0`)}:${String(e.getMinutes()).padStart(2,`0`)}`}var g=`w-full px-3 py-2 text-sm bg-bambu-dark border border-bambu-dark-tertiary rounded text-white placeholder-bambu-gray focus:outline-none focus:ring-1 focus:ring-bambu-green`,_=`block text-sm font-medium text-white mb-1`,v=`px-4 py-3 text-left text-bambu-gray font-medium`,y=`px-4 py-3 align-top text-white`;function b({title:e,onClose:t,children:n,size:r=`md`}){let{t:te}=ee();return(0,p.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4`,children:(0,p.jsxs)(`div`,{className:`w-full ${r===`sm`?`max-w-xl`:r===`lg`?`max-w-6xl`:`max-w-4xl`} overflow-hidden rounded-lg border border-bambu-dark-tertiary bg-bambu-dark-secondary`,children:[(0,p.jsxs)(`div`,{className:`flex items-center justify-between border-b border-bambu-dark-tertiary px-4 py-3`,children:[(0,p.jsx)(`h3`,{className:`text-lg font-semibold text-white`,children:e}),(0,p.jsx)(u,{size:`sm`,variant:`secondary`,onClick:t,children:te(`common.close`,`Close`)})]}),(0,p.jsx)(`div`,{className:`max-h-[75vh] overflow-auto p-4`,children:n})]})})}function x(){let{t:e,i18n:t}=ee(),{hasPermission:n,user:o}=de(),{showToast:d}=ie(),m=te(),x=n(`cost_centers:read_own`),S=n(`cost_centers:read_all`),C=n(`cost_centers:create`),w=n(`cost_centers:modify`),T=n(`cost_centers:modify`),E=n(`cost_centers:modify`),D=n(`cost_centers:modify`),O=n(`users:read_slim`)||n(`users:read`),ve=S||C||w||T||E||D,ye=x||ve,be=ye,[xe,Se]=(0,f.useState)(``),[k,Ce]=(0,f.useState)(`monthly`),[we,Te]=(0,f.useState)(``),[A,Ee]=(0,f.useState)(null),[De,Oe]=(0,f.useState)(`deposit`),[ke,Ae]=(0,f.useState)(``),[je,Me]=(0,f.useState)(``),[Ne,Pe]=(0,f.useState)(null),[j,M]=(0,f.useState)(null),[Fe,Ie]=(0,f.useState)(null),[Le,Re]=(0,f.useState)(!0),[N,P]=(0,f.useState)(0),[F,ze]=(0,f.useState)(`all`),[I,Be]=(0,f.useState)(`all`),[Ve,He]=(0,f.useState)(!1),[Ue,We]=(0,f.useState)(!1),[Ge,Ke]=(0,f.useState)(!1),[L,qe]=(0,f.useState)(!1),[R,Je]=(0,f.useState)(`personal`),[z,Ye]=(0,f.useState)(null),[Xe,Ze]=(0,f.useState)(``),[Qe,B]=(0,f.useState)(`monthly`),[$e,V]=(0,f.useState)(``),[et,tt]=(0,f.useState)(!1),[nt,rt]=(0,f.useState)(null),[it,at]=(0,f.useState)(null),[ot,st]=(0,f.useState)(null),[ct,lt]=(0,f.useState)(``),[ut,dt]=(0,f.useState)(``),[ft,H]=(0,f.useState)(!1),[pt,mt]=(0,f.useState)(null),[ht,gt]=(0,f.useState)(null),[_t,vt]=(0,f.useState)(``),[yt,bt]=(0,f.useState)(``),[xt,St]=(0,f.useState)(_e(new Date)),[U,Ct]=(0,f.useState)(null),[wt,Tt]=(0,f.useState)(null),W=S||C||w||T||D&&O||E&&O;(0,f.useEffect)(()=>{W||Je(`personal`)},[W]);let{data:Et,isLoading:Dt}=i({queryKey:[`finance`,`me`,`balance`],queryFn:r.getMyBalance,enabled:x}),{data:Ot}=i({queryKey:[`ui-flags`],queryFn:r.getUiFlags}),{data:kt,isLoading:At}=i({queryKey:[`finance`,`me`,`transactions`,50,N],queryFn:()=>r.getMyTransactions(50,N),enabled:x}),{data:jt,isLoading:Mt}=i({queryKey:[`finance`,`transactions`,50,N],queryFn:()=>r.getAllTransactions(50,N),enabled:R===`admin`&&S}),{data:G,isLoading:K}=i({queryKey:[`finance`,`cost-centers`,R],queryFn:()=>R===`admin`&&ve?r.listCostCenters(!0):r.getMyCostCenters(),enabled:be}),{data:q}=i({queryKey:[`users`,`slim`],queryFn:r.getUsersSlim,enabled:O&&(be||D||E)}),{data:J}=i({queryKey:[`finance`,`cost-center`,j],queryFn:()=>r.getCostCenter(j),enabled:E&&j!=null});(0,f.useEffect)(()=>{!q||q.length===0||A!=null&&q.some(e=>e.id===A)||Ee(q[0].id)},[q,A]),(0,f.useEffect)(()=>{if(!E)return;let e=(G||[]).filter(e=>!e.is_private);if(e.length===0){M(null);return}j!=null&&e.some(e=>e.id===j)||M(e[0].id)},[E,G,j]),(0,f.useEffect)(()=>{if(!E||!q||q.length===0)return;let e=new Set((J?.members||[]).map(e=>e.user_id)),t=q.find(t=>!e.has(t.id));Ie(t?t.id:null)},[E,q,J]),(0,f.useEffect)(()=>{if(!L)return;let e=G||[];if(e.length===0){Ye(null);return}z!=null&&e.some(e=>e.id===z)||Ye(e[0].id)},[L,z,G]),(0,f.useEffect)(()=>{if(!L||z==null)return;let e=(G||[]).find(e=>e.id===z);if(e){if(Ze(e.name),e.budget_mode===`total`){B(`total`),V(e.total_budget==null?``:String(e.total_budget));return}B(`monthly`),V(e.monthly_budget==null?``:String(e.monthly_budget))}},[L,z,G]);let Nt=a({mutationFn:()=>r.createCostCenter({name:xe.trim(),total_budget:k===`total`?h(we):null,monthly_budget:k===`monthly`?h(we):null,is_active:!0}),onSuccess:()=>{m.invalidateQueries({queryKey:[`finance`]}),Se(``),Te(``),d(e(`finance.createdCostCenter`,`Cost center created`))},onError:t=>{d(t.message||e(`finance.createCostCenterFailed`,`Failed to create cost center`),`error`)}}),Pt=a({mutationFn:({costCenterId:e,value:t,mode:n})=>r.updateCostCenterBudgets(e,{total_budget:n===`total`?h(t):null,monthly_budget:n===`monthly`?h(t):null})}),Ft=a({mutationFn:({costCenterId:e,name:t})=>r.updateCostCenter(e,{name:t})}),It=a({mutationFn:e=>r.deleteCostCenter(e)}),Lt=a({mutationFn:e=>r.deleteTransaction(e),onSuccess:()=>{m.invalidateQueries({queryKey:[`finance`]}),d(e(`finance.transactionDeleted`,`Transaction deleted`))},onError:t=>{d(t.message||e(`finance.deleteTransactionFailed`,`Failed to delete transaction`),`error`)}}),Rt=a({mutationFn:e=>r.editTransaction(e.transactionId,e.data),onSuccess:()=>{m.invalidateQueries({queryKey:[`finance`]}),d(e(`finance.transactionEdited`,`Transaction updated and ledger recalculated`)),tt(!1)},onError:t=>{d(t.message||e(`finance.editTransactionFailed`,`Failed to edit transaction`),`error`)}}),zt=a({mutationFn:e=>r.createManualPrint(e),onSuccess:()=>{m.invalidateQueries({queryKey:[`finance`]}),d(e(`finance.manualPrintCreated`,`Manual print charge added and ledger recalculated`)),H(!1),mt(null),gt(null),vt(``),bt(``),St(_e(new Date))},onError:t=>{d(t.message||e(`finance.manualPrintFailed`,`Failed to create manual print`),`error`)}}),Bt=a({mutationFn:e=>r.depositUserBalance(e.userId,{amount:e.amount,description:e.description,cost_center_id:e.costCenterId??null})}),Vt=a({mutationFn:e=>r.withdrawUserBalance(e.userId,{amount:e.amount,description:e.description,cost_center_id:e.costCenterId??null})}),Ht=a({mutationFn:e=>r.upsertCostCenterMember(e.costCenterId,{user_id:e.userId,can_print:e.canPrint}),onSuccess:()=>{m.invalidateQueries({queryKey:[`finance`]}),d(e(`finance.memberSaved`,`Member saved`))},onError:t=>{d(t.message||e(`finance.memberSaveFailed`,`Failed to save member`),`error`)}}),Ut=a({mutationFn:e=>r.removeCostCenterMember(e.costCenterId,e.userId),onSuccess:()=>{m.invalidateQueries({queryKey:[`finance`]}),d(e(`finance.memberRemoved`,`Member removed`))},onError:t=>{d(t.message||e(`finance.memberRemoveFailed`,`Failed to remove member`),`error`)}}),Wt=Bt.isPending||Vt.isPending,Gt=()=>{if(!xe.trim()){d(e(`finance.costCenterNameRequired`,`Cost center name is required`),`error`);return}Nt.mutate()},Kt=async()=>{if(z==null){d(e(`finance.selectCostCenter`,`Please select a cost center`),`error`);return}let t=Xe.trim();if(!t){d(e(`finance.costCenterNameRequired`,`Cost center name is required`),`error`);return}try{w&&await Ft.mutateAsync({costCenterId:z,name:t}),T&&await Pt.mutateAsync({costCenterId:z,mode:Qe,value:$e}),m.invalidateQueries({queryKey:[`finance`]}),d(e(`finance.costCenterUpdated`,`Cost center updated`)),qe(!1)}catch(t){d(t.message||e(`finance.costCenterUpdateFailed`,`Failed to update cost center`),`error`)}},qt=e=>{let t=(G||[]).find(t=>t.id===e);t&&(Ye(t.id),Ze(t.name),t.budget_mode===`total`?(B(`total`),V(t.total_budget==null?``:String(t.total_budget))):(B(`monthly`),V(t.monthly_budget==null?``:String(t.monthly_budget))),qe(!0))},Jt=async()=>{if(U)try{await It.mutateAsync(U.id),m.invalidateQueries({queryKey:[`finance`]}),j===U.id&&M(null),d(e(`finance.costCenterDeleted`,`Cost center deleted`))}catch(t){d(t.message||e(`finance.costCenterDeleteFailed`,`Failed to delete cost center`),`error`)}finally{Ct(null)}},Yt=()=>{wt!=null&&Lt.mutate(wt,{onSettled:()=>Tt(null)})},Xt=e=>{rt(e.id),at(e.user_id),st(e.cost_center_id),lt(String(e.amount)),dt(e.description||``),tt(!0)},Zt=async()=>{if(nt==null)return;let t=ct?Number.parseFloat(ct):null;if(t!==null&&!Number.isFinite(t)){d(e(`finance.amountInvalid`,`Amount must be a valid number`),`error`);return}Rt.mutate({transactionId:nt,data:{user_id:it||void 0,cost_center_id:ot||void 0,amount:t??void 0,description:ut||void 0}})},Qt=async()=>{if(pt==null){d(e(`finance.userRequired`,`Please select a user`),`error`);return}if(ht==null){d(e(`finance.costCenterRequired`,`Please select a cost center`),`error`);return}let t=_t?Number.parseFloat(_t):null;if(t===null||!Number.isFinite(t)){d(e(`finance.amountInvalid`,`Amount must be a valid number`),`error`);return}t=Math.abs(t),zt.mutate({user_id:pt,cost_center_id:ht,amount:t,description:yt||void 0,created_at:xt?new Date(xt).toISOString():void 0})},$t=async()=>{if(A==null){d(e(`finance.userRequired`,`Please select a user`),`error`);return}let t=Number.parseFloat(ke);if(!Number.isFinite(t)||t<=0){d(e(`finance.amountMustBePositive`,`Amount must be greater than zero`),`error`);return}let n={userId:A,amount:t,description:je.trim()||void 0,costCenterId:Ne};try{De===`deposit`?await Bt.mutateAsync(n):await Vt.mutateAsync(n),m.invalidateQueries({queryKey:[`finance`]}),Ae(``),Me(``),d(De===`deposit`?e(`finance.depositSuccess`,`Deposit successful`):e(`finance.withdrawSuccess`,`Withdrawal successful`))}catch(t){d(t.message||e(`finance.adjustmentFailed`,`Wallet adjustment failed`),`error`)}},en=()=>{if(j==null){d(e(`finance.selectCostCenter`,`Please select a cost center`),`error`);return}if(Fe==null){d(e(`finance.noEligibleUsers`,`No eligible users available`),`error`);return}Ht.mutate({costCenterId:j,userId:Fe,canPrint:Le})},tn=e=>{j!=null&&Ut.mutate({costCenterId:j,userId:e})},Y=le(Ot?.currency||`USD`),X=(0,f.useMemo)(()=>[...q||[]].sort((e,t)=>e.username.localeCompare(t.username)),[q]),nn=(0,f.useMemo)(()=>{let e=new Map;for(let t of X)e.set(t.id,t.username);return e},[X]),rn=(0,f.useMemo)(()=>{let e=new Set((J?.members||[]).map(e=>e.user_id));return X.filter(t=>!e.has(t.id))},[X,J]),an=R===`admin`&&S?jt:kt,Z=R===`admin`&&S?Mt:At,Q=(0,f.useMemo)(()=>an?.items??[],[an?.items]),on=an?.total??0,sn=Math.max(1,Math.ceil(on/50)),cn=(0,f.useMemo)(()=>Q.filter(e=>!(F!==`all`&&e.transaction_type!==F||I!==`all`&&e.cost_center_id!==I)),[Q,F,I]),ln=Math.floor(N/50)+1,$=R===`admin`,un=t=>t===`deposit`?e(`finance.deposit`):t===`withdraw`?e(`finance.withdraw`):t===`print_charge`?e(`finance.printCharge`):t,dn=t=>t==null?e(`finance.personal`,`Personal`):nn.get(t)||(o?.id===t&&o.username?o.username:e(`finance.userWithId`,`User #{{id}}`,{id:t})),fn=t=>t.budget_limit==null||t.budget_available==null?e(`finance.unlimited`,`Unlimited`):`${Y}${t.budget_available.toFixed(2)}/${Y}${t.budget_limit.toFixed(2)}`;return ye?(0,p.jsxs)(`div`,{className:`p-4 md:p-8 space-y-8`,children:[(0,p.jsxs)(`div`,{className:`flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(me,{className:`h-6 w-6 text-bambu-green`}),(0,p.jsx)(`h1`,{className:`text-2xl font-bold text-white`,children:e(`finance.title`,`Finance`)})]}),(0,p.jsx)(`p`,{className:`text-bambu-gray mt-2 max-w-2xl`,children:e(`finance.subtitle`,`Wallet, personal transactions, and cost centers`)}),(0,p.jsx)(`p`,{className:`text-xs text-bambu-gray mt-1 max-w-2xl`,children:e(`finance.budgetPolicyHint`,`Account balances track costs. Printing is limited only by the selected cost center budget; without a budget, printing is unlimited.`)})]}),(0,p.jsxs)(`div`,{className:`flex flex-col gap-2 lg:items-end`,children:[W&&(0,p.jsxs)(`div`,{className:`inline-flex overflow-hidden rounded border border-bambu-dark-tertiary`,children:[(0,p.jsx)(`button`,{type:`button`,onClick:()=>Je(`personal`),className:`px-3 py-1.5 text-sm ${R===`personal`?`bg-bambu-green text-black font-medium`:`bg-bambu-dark text-bambu-gray`}`,children:e(`finance.personalView`,`Personal view`)}),(0,p.jsx)(`button`,{type:`button`,onClick:()=>Je(`admin`),className:`px-3 py-1.5 text-sm ${R===`admin`?`bg-bambu-green text-black font-medium`:`bg-bambu-dark text-bambu-gray`}`,children:e(`finance.adminView`,`Admin view`)})]}),R===`admin`&&W&&(0,p.jsxs)(`div`,{className:`flex flex-wrap gap-2 lg:justify-end`,children:[C&&(0,p.jsx)(u,{size:`sm`,variant:`secondary`,onClick:()=>He(!0),children:e(`finance.createCostCenter`,`Create cost center`)}),D&&O&&(0,p.jsx)(u,{size:`sm`,variant:`secondary`,onClick:()=>We(!0),children:e(`finance.adjustWallet`,`Adjust wallet`)}),D&&O&&(0,p.jsx)(u,{size:`sm`,variant:`secondary`,onClick:()=>H(!0),children:e(`finance.addManualPrint`,`Add manual print`)}),E&&O&&(0,p.jsx)(u,{size:`sm`,variant:`secondary`,onClick:()=>Ke(!0),children:e(`finance.manageMembers`,`Manage cost center members`)})]})]})]}),(0,p.jsxs)(`div`,{className:`grid gap-5 md:grid-cols-2 xl:grid-cols-3`,children:[(0,p.jsxs)(l,{children:[(0,p.jsxs)(s,{className:`flex flex-row items-center justify-between pb-2`,children:[(0,p.jsx)(`span`,{className:`text-sm text-bambu-gray`,children:e(`finance.currentBalance`,`Personal account balance`)}),(0,p.jsx)(me,{className:`w-4 h-4 text-bambu-green/90`})]}),(0,p.jsx)(c,{className:`pt-1`,children:(0,p.jsx)(`p`,{className:`text-3xl font-semibold text-white leading-tight`,children:Dt?e(`common.loading`,`Loading...`):`${Y}${(Et?.balance??0).toFixed(2)}`})})]}),(0,p.jsxs)(l,{children:[(0,p.jsxs)(s,{className:`flex flex-row items-center justify-between pb-2`,children:[(0,p.jsx)(`span`,{className:`text-sm text-bambu-gray`,children:R===`admin`?e(`finance.transactions`,`Transactions`):e(`finance.personalTransactions`,`Personal transactions`)}),(0,p.jsx)(pe,{className:`w-4 h-4 text-blue-400`})]}),(0,p.jsx)(c,{className:`pt-1`,children:(0,p.jsx)(`p`,{className:`text-3xl font-semibold text-white leading-tight`,children:Z?`-`:on})})]}),(0,p.jsxs)(l,{children:[(0,p.jsxs)(s,{className:`flex flex-row items-center justify-between pb-2`,children:[(0,p.jsx)(`span`,{className:`text-sm text-bambu-gray`,children:e(`finance.costCenters`,`Cost centers`)}),(0,p.jsx)(fe,{className:`w-4 h-4 text-orange-400`})]}),(0,p.jsx)(c,{className:`pt-1`,children:(0,p.jsx)(`p`,{className:`text-3xl font-semibold text-white leading-tight`,children:K?`-`:G?.length??0})})]})]}),Ve&&C&&(0,p.jsx)(b,{title:e(`finance.createCostCenter`,`Create cost center`),size:`md`,onClose:()=>He(!1),children:(0,p.jsxs)(`div`,{className:`space-y-4`,children:[(0,p.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-3`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{className:_,children:e(`finance.costCenterName`,`Name`)}),(0,p.jsx)(`input`,{type:`text`,value:xe,onChange:e=>Se(e.target.value),placeholder:e(`finance.costCenterName`,`Name`),className:g})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{className:_,children:e(`finance.budgetType`,`Budget type`)}),(0,p.jsxs)(`select`,{value:k,onChange:e=>Ce(e.target.value),className:g,children:[(0,p.jsx)(`option`,{value:`monthly`,children:e(`finance.monthlyBudget`,`Monthly budget`)}),(0,p.jsx)(`option`,{value:`total`,children:e(`finance.totalBudget`,`Total budget`)})]})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{className:_,children:k===`monthly`?e(`finance.monthlyBudget`,`Monthly budget`):e(`finance.totalBudget`,`Total budget`)}),(0,p.jsx)(`input`,{type:`number`,step:`0.01`,value:we,onChange:e=>Te(e.target.value),placeholder:`0.00`,className:g})]})]}),(0,p.jsx)(u,{className:`min-w-[180px]`,onClick:Gt,disabled:Nt.isPending,children:Nt.isPending?e(`common.saving`,`Saving...`):e(`finance.create`,`Create`)})]})}),Ue&&D&&O&&(0,p.jsx)(b,{title:e(`finance.adjustWallet`,`Adjust wallet`),size:`md`,onClose:()=>We(!1),children:(0,p.jsxs)(`div`,{className:`space-y-4`,children:[(0,p.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{className:_,children:e(`finance.selectUser`,`Select user`)}),(0,p.jsx)(`select`,{value:A??``,onChange:e=>Ee(e.target.value?Number(e.target.value):null),className:g,children:(X||[]).map(e=>(0,p.jsx)(`option`,{value:e.id,children:e.username},e.id))})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{className:_,children:e(`finance.transactionType`,`Type`)}),(0,p.jsxs)(`select`,{value:De,onChange:e=>Oe(e.target.value),className:g,children:[(0,p.jsx)(`option`,{value:`deposit`,children:e(`finance.deposit`,`Deposit`)}),(0,p.jsx)(`option`,{value:`withdraw`,children:e(`finance.withdraw`,`Withdraw`)})]})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{className:_,children:e(`finance.amount`,`Amount`)}),(0,p.jsx)(`input`,{type:`number`,step:`0.01`,min:`0`,value:ke,onChange:e=>Ae(e.target.value),placeholder:`0.00`,className:g})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{className:_,children:e(`finance.costCenters`,`Cost centers`)}),(0,p.jsxs)(`select`,{value:Ne??``,onChange:e=>Pe(e.target.value?Number(e.target.value):null),className:g,children:[(0,p.jsx)(`option`,{value:``,children:e(`finance.noCostCenter`,`No cost center`)}),(G||[]).map(e=>(0,p.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{className:_,children:e(`common.description`,`Description`)}),(0,p.jsx)(`input`,{type:`text`,value:je,onChange:e=>Me(e.target.value),placeholder:e(`finance.descriptionOptional`,`Description (optional)`),className:g})]}),(0,p.jsx)(u,{className:`min-w-[180px]`,onClick:$t,disabled:Wt,children:Wt?e(`common.saving`,`Saving...`):e(`finance.applyAdjustment`,`Apply adjustment`)})]})}),Ge&&E&&O&&(0,p.jsx)(b,{title:e(`finance.manageMembers`,`Manage cost center members`),size:`lg`,onClose:()=>Ke(!1),children:(0,p.jsxs)(`div`,{className:`space-y-5`,children:[(0,p.jsxs)(`div`,{className:`grid gap-5 md:grid-cols-2`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{className:_,children:e(`finance.costCenters`,`Cost centers`)}),(0,p.jsx)(`select`,{value:j??``,onChange:e=>M(e.target.value?Number(e.target.value):null),className:g,children:(G||[]).filter(e=>!e.is_private).map(e=>(0,p.jsx)(`option`,{value:e.id,children:e.name},e.id))})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{className:_,children:e(`finance.selectUser`,`Select user`)}),(0,p.jsxs)(`select`,{value:Fe??``,onChange:e=>Ie(e.target.value?Number(e.target.value):null),className:g,children:[(0,p.jsx)(`option`,{value:``,children:e(`finance.selectUser`,`Select user`)}),rn.map(e=>(0,p.jsx)(`option`,{value:e.id,children:e.username},e.id))]})]}),(0,p.jsxs)(`div`,{className:`flex items-center gap-2 rounded border border-bambu-dark-tertiary bg-bambu-dark-secondary px-3 py-2`,children:[(0,p.jsx)(`input`,{id:`memberCanPrint`,type:`checkbox`,checked:Le,onChange:e=>Re(e.target.checked),className:`rounded border-bambu-dark-tertiary bg-bambu-dark text-bambu-green focus:ring-bambu-green`}),(0,p.jsx)(`label`,{htmlFor:`memberCanPrint`,className:`text-sm text-bambu-gray`,children:e(`finance.memberCanPrint`,`Member can print`)})]}),(0,p.jsx)(`div`,{className:`flex items-end`,children:(0,p.jsx)(u,{className:`min-w-[180px]`,onClick:en,disabled:Ht.isPending||Fe==null,children:Ht.isPending?e(`common.saving`,`Saving...`):e(`finance.addMember`,`Add member`)})})]}),(0,p.jsx)(`div`,{className:`overflow-auto rounded-lg border border-bambu-dark-tertiary`,children:(0,p.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,p.jsx)(`thead`,{children:(0,p.jsxs)(`tr`,{className:`border-b border-bambu-dark-tertiary bg-bambu-dark text-bambu-gray`,children:[(0,p.jsx)(`th`,{className:v,children:e(`common.name`,`Name`)}),(0,p.jsx)(`th`,{className:v,children:e(`finance.canPrint`,`Can print`)}),(0,p.jsx)(`th`,{className:v,children:e(`common.actions`,`Actions`)})]})}),(0,p.jsxs)(`tbody`,{children:[(J?.members||[]).map(t=>(0,p.jsxs)(`tr`,{className:`border-b border-bambu-dark-tertiary/60 text-white`,children:[(0,p.jsx)(`td`,{className:y,children:X.find(e=>e.id===t.user_id)?.username||`User ${t.user_id}`}),(0,p.jsx)(`td`,{className:y,children:t.can_print?e(`common.yes`,`Yes`):e(`common.no`,`No`)}),(0,p.jsx)(`td`,{className:y,children:(0,p.jsx)(u,{size:`sm`,variant:`danger`,onClick:()=>tn(t.user_id),disabled:Ut.isPending,children:e(`common.remove`,`Remove`)})})]},t.id)),(J?.members||[]).length===0&&(0,p.jsx)(`tr`,{children:(0,p.jsx)(`td`,{colSpan:3,className:`py-3 text-bambu-gray`,children:e(`finance.noMembers`,`No members assigned.`)})})]})]})})]})}),L&&(w||T)&&(0,p.jsx)(b,{title:e(`finance.editCostCenter`,`Edit cost center`),size:`md`,onClose:()=>qe(!1),children:(0,p.jsxs)(`div`,{className:`space-y-4`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{className:_,children:e(`finance.costCenterName`,`Name`)}),(0,p.jsx)(`input`,{type:`text`,value:Xe,onChange:e=>Ze(e.target.value),placeholder:e(`finance.costCenterName`,`Name`),className:g,disabled:!w})]}),(0,p.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{className:_,children:e(`finance.budgetType`,`Budget type`)}),(0,p.jsxs)(`select`,{value:Qe,onChange:e=>B(e.target.value),className:g,disabled:!T,children:[(0,p.jsx)(`option`,{value:`monthly`,children:e(`finance.monthlyBudget`,`Monthly budget`)}),(0,p.jsx)(`option`,{value:`total`,children:e(`finance.totalBudget`,`Total budget`)})]})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{className:_,children:Qe===`monthly`?e(`finance.monthlyBudget`,`Monthly budget`):e(`finance.totalBudget`,`Total budget`)}),(0,p.jsx)(`input`,{type:`number`,step:`0.01`,value:$e,onChange:e=>V(e.target.value),placeholder:`0.00`,className:g,disabled:!T})]})]}),(0,p.jsx)(u,{className:`min-w-[180px]`,onClick:Kt,disabled:Ft.isPending||Pt.isPending||z==null,children:Ft.isPending||Pt.isPending?e(`common.saving`,`Saving...`):e(`common.save`,`Save`)})]})}),(0,p.jsxs)(`div`,{className:`grid gap-6 ${be&&x?`xl:grid-cols-2`:``}`,children:[be&&(0,p.jsxs)(l,{children:[(0,p.jsxs)(s,{children:[(0,p.jsx)(`h2`,{className:`text-lg font-semibold text-white`,children:e(`finance.myCostCenters`,`My cost centers`)}),(0,p.jsx)(`p`,{className:`text-sm text-bambu-gray mt-1`,children:e(`finance.costCentersHint`,`Review budget limits and keep costs under control`)})]}),(0,p.jsxs)(c,{className:`space-y-3`,children:[K&&(0,p.jsx)(`p`,{className:`text-sm text-bambu-gray`,children:e(`common.loading`,`Loading...`)}),!K&&(!G||G.length===0)&&(0,p.jsx)(`p`,{className:`text-sm text-bambu-gray`,children:e(`finance.noCostCenters`,`No cost centers found.`)}),!K&&G&&G.length>0&&(0,p.jsx)(`div`,{className:`overflow-auto rounded-lg border border-bambu-dark-tertiary`,children:(0,p.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,p.jsx)(`thead`,{children:(0,p.jsxs)(`tr`,{className:`border-b border-bambu-dark-tertiary bg-bambu-dark text-bambu-gray`,children:[(0,p.jsx)(`th`,{className:v,children:e(`common.name`,`Name`)}),$&&(0,p.jsx)(`th`,{className:v,children:e(`finance.owner`,`Owner`)}),(0,p.jsx)(`th`,{className:v,children:e(`finance.balance`,`Account balance`)}),(0,p.jsx)(`th`,{className:v,children:e(`finance.budget`,`Budget`)}),$&&(0,p.jsx)(`th`,{className:v,children:e(`common.actions`,`Actions`)})]})}),(0,p.jsx)(`tbody`,{children:G.map(t=>{let n=w||T,r=!t.is_private&&w;return(0,p.jsxs)(`tr`,{className:`border-b border-bambu-dark-tertiary/60 text-white`,children:[(0,p.jsx)(`td`,{className:y,children:t.name}),$&&(0,p.jsx)(`td`,{className:y,children:t.is_private?dn(t.owner_user_id):e(`finance.shared`,`Shared`)}),(0,p.jsxs)(`td`,{className:y,children:[Y,t.total_balance.toFixed(2)]}),(0,p.jsx)(`td`,{className:y,children:(0,p.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,p.jsx)(`span`,{children:fn(t)}),(0,p.jsx)(`span`,{className:`text-xs text-bambu-gray`,children:t.budget_mode===`monthly`?e(`finance.monthlyBudget`,`Monthly budget`):t.budget_mode===`total`?e(`finance.totalBudget`,`Total budget`):e(`finance.noBudget`,`No budget`)})]})}),$&&(0,p.jsx)(`td`,{className:y,children:(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(u,{size:`sm`,variant:`ghost`,onClick:()=>qt(t.id),disabled:!n,title:n?e(`common.edit`,`Edit`):e(`finance.cannotEditPrivateCostCenter`,`Private cost centers cannot be edited here`),className:`p-1.5 sm:p-2`,children:(0,p.jsx)(ae,{className:`w-4 h-4`})}),r&&(0,p.jsx)(u,{size:`sm`,variant:`ghost`,onClick:()=>Ct({id:t.id,name:t.name}),disabled:It.isPending,title:e(`common.delete`,`Delete`),className:`text-red-400 hover:text-red-300 hover:bg-red-500/10 p-1.5 sm:p-2`,children:(0,p.jsx)(oe,{className:`w-4 h-4`})})]})})]},t.id)})})]})})]})]}),x&&(0,p.jsxs)(l,{children:[(0,p.jsxs)(s,{children:[(0,p.jsx)(`h2`,{className:`text-lg font-semibold text-white`,children:e(`finance.recentTransactions`,`Recent transactions`)}),(0,p.jsx)(`p`,{className:`text-sm text-bambu-gray mt-1`,children:e(`finance.transactionsHint`,`Filter by type and cost center, then navigate pages`)})]}),(0,p.jsxs)(c,{className:`space-y-4`,children:[(0,p.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto] xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto] items-end`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{className:_,children:e(`finance.transactionType`,`Type`)}),(0,p.jsxs)(`select`,{value:F,onChange:e=>ze(e.target.value),className:g,children:[(0,p.jsx)(`option`,{value:`all`,children:e(`finance.allTypes`)}),(0,p.jsx)(`option`,{value:`deposit`,children:e(`finance.deposit`)}),(0,p.jsx)(`option`,{value:`withdraw`,children:e(`finance.withdraw`)}),(0,p.jsx)(`option`,{value:`print_charge`,children:e(`finance.printCharge`)})]})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{className:_,children:e(`finance.costCenters`,`Cost centers`)}),(0,p.jsxs)(`select`,{value:I,onChange:e=>Be(e.target.value===`all`?`all`:Number(e.target.value)),className:g,children:[(0,p.jsx)(`option`,{value:`all`,children:e(`finance.allCostCenters`)}),(G||[]).map(e=>(0,p.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]})]}),Z&&(0,p.jsx)(`p`,{className:`text-sm text-bambu-gray`,children:e(`common.loading`,`Loading...`)}),!Z&&(!Q||Q.length===0)&&(0,p.jsx)(`p`,{className:`text-sm text-bambu-gray`,children:e(`finance.noTransactions`,`No transactions available.`)}),!Z&&Q.length>0&&cn.length===0&&(0,p.jsx)(`p`,{className:`text-sm text-bambu-gray`,children:e(`finance.noTransactionsForFilter`,`No transactions match the selected filters.`)}),!Z&&cn.length>0&&(0,p.jsx)(`div`,{className:`overflow-auto rounded-lg border border-bambu-dark-tertiary`,children:(0,p.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,p.jsx)(`thead`,{children:(0,p.jsxs)(`tr`,{className:`border-b border-bambu-dark-tertiary bg-bambu-dark text-bambu-gray`,children:[(0,p.jsx)(`th`,{className:v,children:e(`common.date`,`Date`)}),$&&(0,p.jsx)(`th`,{className:v,children:e(`common.user`,`User`)}),(0,p.jsx)(`th`,{className:v,children:e(`finance.costCenter`,`Cost center`)}),(0,p.jsx)(`th`,{className:v,children:e(`finance.transactionType`,`Type`)}),(0,p.jsx)(`th`,{className:v,children:e(`common.description`,`Description`)}),(0,p.jsx)(`th`,{className:v,children:e(`finance.amount`,`Amount`)}),(0,p.jsx)(`th`,{className:v,children:e(`finance.balanceAfter`,`Balance after`)}),$&&(0,p.jsx)(`th`,{className:v,children:e(`common.actions`,`Actions`)})]})}),(0,p.jsx)(`tbody`,{children:cn.map(n=>{let r=n.amount>=0,ee=n.cost_center_id==null?null:(G||[]).find(e=>e.id===n.cost_center_id),te=nn.get(n.user_id),i=n.transaction_type===`print_charge`?he(n.description??null):null,a=i?.isPartial??!1;return(0,p.jsxs)(`tr`,{className:`border-b border-bambu-dark-tertiary/60 text-white`,children:[(0,p.jsx)(`td`,{className:y,children:ge(n.created_at,t.language)}),$&&(0,p.jsx)(`td`,{className:y,children:te||e(`finance.userWithId`,`User #{{id}}`,{id:n.user_id})}),(0,p.jsx)(`td`,{className:y,children:ee?.name||`-`}),(0,p.jsx)(`td`,{className:y,children:(0,p.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,p.jsx)(`span`,{children:un(n.transaction_type)}),a&&(0,p.jsx)(`span`,{className:`rounded border border-yellow-500/40 bg-yellow-500/10 px-2 py-0.5 text-[11px] text-yellow-300`,children:i&&i.partialType?e(`finance.partialStatus.${i.partialType}`,i.partialType):e(`finance.partial`,`Partial`)})]})}),(0,p.jsx)(`td`,{className:y,children:(i?.cleanedDescription??n.description)||`-`}),(0,p.jsxs)(`td`,{className:`${y} ${r?`text-green-400`:`text-red-400`}`,children:[r?`+`:`-`,Y,Math.abs(n.amount).toFixed(2)]}),(0,p.jsx)(`td`,{className:y,children:n.balance_after==null?`-`:`${n.balance_after<0?`-`:``}${Y}${Math.abs(n.balance_after).toFixed(2)}`}),$&&(0,p.jsx)(`td`,{className:y,children:(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(u,{size:`sm`,variant:`secondary`,onClick:()=>Xt(n),disabled:Rt.isPending,children:(0,p.jsx)(ae,{className:`w-4 h-4`})}),(0,p.jsx)(u,{size:`sm`,variant:`danger`,onClick:()=>Tt(n.id),disabled:Lt.isPending,children:(0,p.jsx)(oe,{className:`w-4 h-4`})})]})})]},n.id)})})]})}),!Z&&cn.length>0&&(0,p.jsx)(`div`,{className:`flex justify-end pt-2 lg:pt-0`,children:(0,p.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[(0,p.jsx)(`button`,{type:`button`,onClick:()=>P(0),disabled:N===0||Z,className:`p-1.5 rounded text-bambu-gray hover:text-white disabled:opacity-30 disabled:cursor-not-allowed transition-colors`,"aria-label":e(`finance.first`,`First`),children:(0,p.jsx)(ne,{className:`w-4 h-4`})}),(0,p.jsx)(`button`,{type:`button`,onClick:()=>P(e=>Math.max(0,e-50)),disabled:N===0||Z,className:`p-1.5 rounded text-bambu-gray hover:text-white disabled:opacity-30 disabled:cursor-not-allowed transition-colors`,"aria-label":e(`finance.prev`,`Previous`),children:(0,p.jsx)(ue,{className:`w-4 h-4`})}),(0,p.jsx)(`span`,{className:`text-bambu-gray px-1 whitespace-nowrap`,children:e(`finance.pageNumberOf`,`Page {{page}} of {{total}}`,{page:ln,total:sn})}),(0,p.jsx)(`button`,{type:`button`,onClick:()=>P(e=>e+50),disabled:Z||ln>=sn,className:`p-1.5 rounded text-bambu-gray hover:text-white disabled:opacity-30 disabled:cursor-not-allowed transition-colors`,"aria-label":e(`finance.next`,`Next`),children:(0,p.jsx)(se,{className:`w-4 h-4`})}),(0,p.jsx)(`button`,{type:`button`,onClick:()=>P(Math.max(0,(sn-1)*50)),disabled:Z||ln>=sn,className:`p-1.5 rounded text-bambu-gray hover:text-white disabled:opacity-30 disabled:cursor-not-allowed transition-colors`,"aria-label":e(`finance.last`,`Last`),children:(0,p.jsx)(re,{className:`w-4 h-4`})})]})})]})]}),et&&nt!==null&&(0,p.jsx)(b,{title:e(`finance.editTransaction`,`Edit Transaction`),onClose:()=>tt(!1),size:`md`,children:(0,p.jsxs)(`div`,{className:`space-y-4`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{className:_,children:e(`common.user`,`User`)}),(0,p.jsxs)(`select`,{className:g,value:it||``,onChange:e=>at(e.target.value?Number(e.target.value):null),children:[(0,p.jsx)(`option`,{value:``,children:e(`finance.selectUser`,`Select user...`)}),X.map(e=>(0,p.jsx)(`option`,{value:e.id,children:e.username},e.id))]})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{className:_,children:e(`finance.costCenter`,`Cost center (optional)`)}),(0,p.jsxs)(`select`,{className:g,value:ot||``,onChange:e=>st(e.target.value?Number(e.target.value):null),children:[(0,p.jsx)(`option`,{value:``,children:e(`finance.noCostCenter`,`Personal (no cost center)`)}),(G||[]).map(e=>(0,p.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{className:_,children:e(`finance.amount`,`Amount`)}),(0,p.jsx)(`input`,{type:`number`,step:`0.01`,className:g,value:ct,onChange:e=>lt(e.target.value),placeholder:e(`finance.amountExample`,`e.g., 10.50`)})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{className:_,children:e(`common.description`,`Description`)}),(0,p.jsx)(`textarea`,{className:`${g} resize-none`,rows:3,value:ut,onChange:e=>dt(e.target.value),placeholder:e(`finance.manualAdjustmentExample`,`e.g., Manual adjustment`)})]}),(0,p.jsxs)(`div`,{className:`flex justify-end gap-2 pt-4`,children:[(0,p.jsx)(u,{variant:`secondary`,onClick:()=>tt(!1),children:e(`common.cancel`,`Cancel`)}),(0,p.jsx)(u,{onClick:Zt,disabled:Rt.isPending,children:e(`common.save`,`Save`)})]})]})}),ft&&(0,p.jsx)(b,{title:e(`finance.addManualPrint`,`Add manual print`),onClose:()=>H(!1),size:`md`,children:(0,p.jsxs)(`div`,{className:`space-y-4`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{className:_,children:e(`common.user`,`User`)}),(0,p.jsxs)(`select`,{className:g,value:pt||``,onChange:e=>mt(e.target.value?Number(e.target.value):null),children:[(0,p.jsx)(`option`,{value:``,children:e(`finance.selectUser`,`Select user...`)}),X.map(e=>(0,p.jsx)(`option`,{value:e.id,children:e.username},e.id))]})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{className:_,children:e(`finance.costCenter`,`Cost center`)}),(0,p.jsxs)(`select`,{className:g,value:ht||``,onChange:e=>gt(e.target.value?Number(e.target.value):null),children:[(0,p.jsx)(`option`,{value:``,children:e(`finance.selectCostCenter`,`Select cost center...`)}),(G||[]).map(e=>(0,p.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{className:_,children:e(`finance.amount`,`Amount`)}),(0,p.jsx)(`input`,{type:`number`,step:`0.01`,className:g,value:_t,onChange:e=>vt(e.target.value),placeholder:e(`finance.amountExample`,`e.g., 4.00`)})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{className:_,children:e(`common.description`,`Description`)}),(0,p.jsx)(`input`,{type:`text`,value:yt,onChange:e=>bt(e.target.value),placeholder:e(`finance.descriptionOptional`,`Description (optional)`),className:g})]}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`label`,{className:_,children:e(`common.date`,`Date`)}),(0,p.jsx)(`input`,{type:`datetime-local`,value:xt,onChange:e=>St(e.target.value),className:g})]}),(0,p.jsxs)(`div`,{className:`flex justify-end gap-2 pt-4`,children:[(0,p.jsx)(u,{variant:`secondary`,onClick:()=>H(!1),children:e(`common.cancel`,`Cancel`)}),(0,p.jsx)(u,{onClick:Qt,disabled:zt.isPending,children:zt.isPending?e(`common.saving`,`Saving...`):e(`finance.addManualPrint`,`Add manual print`)})]})]})}),U&&(0,p.jsx)(ce,{title:e(`common.delete`,`Delete`),message:e(`finance.confirmDeleteCostCenter`,`Delete cost center "{{name}}"?`,{name:U.name}),confirmText:e(`common.delete`,`Delete`),variant:`danger`,isLoading:It.isPending,onConfirm:Jt,onCancel:()=>Ct(null)}),wt!=null&&(0,p.jsx)(ce,{title:e(`finance.deleteTransaction`,`Delete transaction`),message:e(`finance.deleteTransactionConfirm`,`Delete this transaction? Balances will be recalculated automatically.`),confirmText:e(`common.delete`,`Delete`),variant:`danger`,isLoading:Lt.isPending,onConfirm:Yt,onCancel:()=>Tt(null)})]})]}):(0,p.jsxs)(`div`,{className:`p-4 md:p-8 space-y-6`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(me,{className:`h-6 w-6 text-bambu-green`}),(0,p.jsx)(`h1`,{className:`text-2xl font-bold text-white`,children:e(`finance.title`,`Finance`)})]}),(0,p.jsx)(`div`,{children:(0,p.jsx)(`p`,{className:`text-bambu-gray mt-2 max-w-2xl`,children:e(`finance.subtitle`,`Wallet, personal transactions, and cost centers`)})}),(0,p.jsx)(l,{children:(0,p.jsx)(c,{className:`py-8 text-center text-bambu-gray`,children:e(`finance.noAccess`,`You do not have permission to view finance data.`)})})]})}export{x as FinancePage};