@accounter/client 0.0.11-alpha-20260126203116-e4ae2d445da89ef2194deb61fef02975089397cb → 0.0.11-alpha-20260127160317-d111b5057eb7a3e09fc743520558ba8843a4d9b0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/dist/assets/{Checkbox-De6ghCZT.js → Checkbox-D5PsdcQv.js} +1 -1
- package/dist/assets/{MultiSelect-Ca6lO0tL.js → MultiSelect-C5wjF9jC.js} +1 -1
- package/dist/assets/{Progress-26V_Zxr-.js → Progress-CUpt9lUI.js} +1 -1
- package/dist/assets/{Table-8-ldSKpC.js → Table-pGQWLQ8H.js} +1 -1
- package/dist/assets/{Typography-DyOGysfv.js → Typography-B3aRT5ej.js} +1 -1
- package/dist/assets/{accordion-DP7ZozTk.js → accordion-Bd6kAhfN.js} +1 -1
- package/dist/assets/{accountant-approvals-DKeksuRo.js → accountant-approvals-BJGkKn8O.js} +1 -1
- package/dist/assets/{accounter-table-D91AAtb3.js → accounter-table-CioecC_Y.js} +1 -1
- package/dist/assets/{addDays-DbQpcl70.js → addDays-DhQZBfTq.js} +1 -1
- package/dist/assets/{all-charges-C25sw4Vw.js → all-charges-UjLePnh5.js} +1 -1
- package/dist/assets/{arrow-up-down-Du86WmzT.js → arrow-up-down-YhPbp1Ud.js} +1 -1
- package/dist/assets/{building-2-BgbaTAJm.js → building-2-Df516nsd.js} +1 -1
- package/dist/assets/{business-B_k5j_ba.js → business-CryBsRqy.js} +1 -1
- package/dist/assets/{business-extended-info-Dn8Jjrlr.js → business-extended-info-zz1obrFs.js} +1 -1
- package/dist/assets/{business-header-CVNY-ll1.js → business-header-DL-hzsQ4.js} +1 -1
- package/dist/assets/{business-ledger-filters-Ctqgcwo5.js → business-ledger-filters-Dh6IJIbe.js} +1 -1
- package/dist/assets/{business-ledger-single-B2zYi6oe.js → business-ledger-single-ebXw596v.js} +1 -1
- package/dist/assets/business-trip-Bn5hm1D5.js +1 -0
- package/dist/assets/charge-DhvD1RST.js +1 -0
- package/dist/assets/{charges-filters-Ss76EpGY.js → charges-filters-BLSfy08K.js} +1 -1
- package/dist/assets/{charges-ledger-validation-829LsQIR.js → charges-ledger-validation-BOn22w9P.js} +1 -1
- package/dist/assets/{charges-table-CmHxXzVR.js → charges-table-Bjk5Mz--.js} +1 -1
- package/dist/assets/{contracts-CoybM2nI.js → contracts-iKKpsNnL.js} +1 -1
- package/dist/assets/{data-table-column-header-_ZrN0Vs6.js → data-table-column-header--gzXkv5r.js} +1 -1
- package/dist/assets/{data-table-pagination-DAvY_qBU.js → data-table-pagination-CLXUcmJJ.js} +1 -1
- package/dist/assets/{deposits-transactions-table-DGuOHsiS.js → deposits-transactions-table-CV-YceTW.js} +1 -1
- package/dist/assets/{download-csv-button-C12VYNQh.js → download-csv-button-DVLHjMAB.js} +1 -1
- package/dist/assets/{download-csv-CI8CQmZN.js → download-csv-weF1Lwst.js} +1 -1
- package/dist/assets/{editable-business-trip-DEIjhoGd.js → editable-business-trip-DRSlJ54m.js} +1 -1
- package/dist/assets/{eye-off-DPLQFIHz.js → eye-off-DWYC0Eax.js} +1 -1
- package/dist/assets/{funnel-DrbTHWGk.js → funnel-0IvwyZBf.js} +1 -1
- package/dist/assets/{index-Y8bTnSrF.js → index-1oajNqKA.js} +1 -1
- package/dist/assets/{index-DAU5uvX5.js → index-AI_GyykK.js} +1 -1
- package/dist/assets/{index-SeZ6e2IY.js → index-B6VKQBtu.js} +1 -1
- package/dist/assets/{index-CPWGn2pz.js → index-BA-I_zCt.js} +1 -1
- package/dist/assets/{index-DiURoW7Y.js → index-BESPuoZl.js} +1 -1
- package/dist/assets/{index-Tbw04SMm.js → index-BFEE5U-A.js} +1 -1
- package/dist/assets/{index-CTwMeBqF.js → index-BINmUTjA.js} +1 -1
- package/dist/assets/{index-xFXxtg2C.js → index-BoVSybOL.js} +1 -1
- package/dist/assets/{index-DLG-Can3.js → index-BrgWieYs.js} +1 -1
- package/dist/assets/{index-Ci6HaxoD.js → index-Bw_9Tifu.js} +1 -1
- package/dist/assets/{index-D3BVMctX.js → index-CAAL0SGN.js} +1 -1
- package/dist/assets/{index-B6dfuYIx.js → index-CGpiJ6wl.js} +1 -1
- package/dist/assets/{index-BmpxpR0w.js → index-CHzieg87.js} +1 -1
- package/dist/assets/{index-BFXVaxb0.js → index-CVefTdZ8.js} +1 -1
- package/dist/assets/{index-HzW6tFXv.js → index-CYLoUT7S.js} +1 -1
- package/dist/assets/{index-CWB4GuES.js → index-CgvjLFyG.js} +1 -1
- package/dist/assets/{index-ZKG76s7Z.js → index-CkPv0ZF8.js} +1 -1
- package/dist/assets/{index-B48UbZgd.js → index-Cm0VDoDd.js} +1 -1
- package/dist/assets/{index-llwTvhRi.js → index-D1_HHRLX.js} +5 -5
- package/dist/assets/{index-BWVeSaVH.js → index-DSAS0BpU.js} +1 -1
- package/dist/assets/{index-DT0MsOt-.js → index-DZFQ92ui.js} +1 -1
- package/dist/assets/{index-Cl0HzH8n.js → index-D_XfDEW8.js} +1 -1
- package/dist/assets/{index-BfmxxMgF.js → index-DaDghnaZ.js} +1 -1
- package/dist/assets/{index-EUnNrMjG.js → index-MPZl3TTq.js} +1 -1
- package/dist/assets/{index-6voPIuBc.js → index-ajJcMQms.js} +1 -1
- package/dist/assets/{index-DJdqwTB-.js → index-v8SIf-h9.js} +1 -1
- package/dist/assets/{index.es-CFgf-VWh.js → index.es-Dkm1W8bL.js} +1 -1
- package/dist/assets/issue-document-yi3XXbpe.js +1 -0
- package/dist/assets/{login-page-BUNJ0vL_.js → login-page-B5bqhOTx.js} +1 -1
- package/dist/assets/{missing-info-charges-Dsy5oUHu.js → missing-info-charges-DiIM7lBQ.js} +1 -1
- package/dist/assets/{modal-B0cCJdW9.js → modal-CNW2FGYc.js} +1 -1
- package/dist/assets/{modify-contract-dialog-DNQYpsqS.js → modify-contract-dialog-BBPR_IL8.js} +1 -1
- package/dist/assets/{page-layout-ClvcCJfx.js → page-layout-BOjYoqoi.js} +1 -1
- package/dist/assets/{page-not-found-zY3WEMae.js → page-not-found-UQZi0ekr.js} +1 -1
- package/dist/assets/{panel-top-open-pJuuLeLe.js → panel-top-open-Bxnxp1BU.js} +1 -1
- package/dist/assets/{report-commentary-row-CuMCzc7C.js → report-commentary-row-BtmSnv64.js} +1 -1
- package/dist/assets/{save-Dlfry6XY.js → save-BHNOV5fu.js} +1 -1
- package/dist/assets/{similar-transactions-modal-DjIjqO-0.js → similar-transactions-modal-BTidmv0G.js} +1 -1
- package/dist/assets/{sub-D5WK8Yq6.js → sub-6-HnNA3H.js} +1 -1
- package/dist/assets/subMonths-nC9-M0qS.js +1 -0
- package/dist/assets/{summary-yl9MRbvK.js → summary-C5TvRXn1.js} +1 -1
- package/dist/assets/{toggle-expansion-button-CGwmL9mo.js → toggle-expansion-button-Dg_XsE6y.js} +1 -1
- package/dist/assets/{update-accountant-status-QJ1upFTt.js → update-accountant-status-CU6mIJqS.js} +1 -1
- package/dist/assets/{use-issue-monthly-documents-pV0tTZGQ.js → use-issue-monthly-documents-CdxtNiuP.js} +1 -1
- package/dist/assets/{use-url-query-C70bqR6l.js → use-url-query-RoURh24O.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/business-trip-BTFVFqTb.js +0 -1
- package/dist/assets/charge-BiCrKZ5S.js +0 -1
- package/dist/assets/issue-document-DVCemcvP.js +0 -1
- package/dist/assets/subMonths-Ft6EDjKW.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{v as at,r as p,ep as Zo,eq as ea,di as ta,bz as Ke,er as na,es as ra,et as sa,aF as F,bA as Me,by as Ye,eu as k,ev as Oe,ew as oa,ex as gs,ey as aa,ez as ia,eA as ca,eB as la,eC as fn,bv as He,eD as da,d as it,cr as hs,eE as xs,j as r,a6 as L,eF as ua,g as Te,eG as fa,t as R,i as $e,eH as pa,T as Ue,bX as on,B as Y,m as ys,eI as ma,E as an,V as vs,eJ as ga,eK as ha,eL as xa,eM as ya,ay as _t,cb as va,eN as ja,eO as ct,eP as lt,eQ as rr,eR as sr,dP as ba,eS as js,eT as Da,l as jt,eU as Ca,eV as Sa,aT as or,eW as wa,u as Ne,eX as _a,eY as Ia,c as Oa,eZ as Fn,e_ as kn,D as cn,aL as bs,bU as Ea,bV as Pa,bW as Aa,x as ln,al as Ds,am as Cs,e$ as Na,f0 as Ss,f1 as Ta,f2 as ws,R as We,ag as Mn,f3 as $a,bC as Be,f4 as Fa,ah as bt,f5 as _s,f6 as Is,f7 as qe,w as tt,f8 as ka,f9 as Os,fa as Es,fb as Ps,fc as Ma,fd as Ra,fe as As,ff as Bt,fg as Ns,fh as za,fi as La,fj as Ba,a3 as Va,fk as Ts,n as yt,bE as ke,bF as $s,bG as Fs,cq as ks,bH as Vt,fl as Ha,fm as Ua,cw as Rn,e as Ka,fn as Ga,a9 as qa,fo as Wa,L as zn,fp as Ya,cp as pn,dt as Qa,fq as _n,fr as Ms,fs as Rs,ft as Xa,fu as mn,fv as ar,fw as zs,du as Ja,fx as Za,dI as we,b$ as je,af as Ls,fy as ir,fz as ei,bY as Bs,c4 as ti,c5 as Vs,c6 as Hs,bO as Ln,bP as Bn,bQ as Ve,bR as Pe,c2 as Ht,bS as Vn,bT as De,P as ni,dw as Us,fA as Ks,fB as Gs,fC as ri,fD as si,fE as oi,ao as cr,ap as lr,aq as dr,ar as ur,as as fr,a2 as ai,au as ii,fF as ci,fG as qs,p as li,c3 as di,bZ as ui,b_ as fi,c0 as pi,c1 as mi,fH as gi,fI as hi,dp as ot,fJ as Ws,fK as xi,fL as Ys,J as yi,W as vi,O as ji,fM as Qs,fN as bi,fO as Xs,fP as Js,fQ as Ee,fR as be,fS as Di,fT as pr,fU as Zs,fV as Je,fW as Ci,fX as Si}from"./index-llwTvhRi.js";import{T as eo}from"./toggle-expansion-button-CGwmL9mo.js";import{U as wi}from"./update-accountant-status-QJ1upFTt.js";import{M as _i,P as W,I as Ii,T as to,a as Oi,D as Ei,A as Pi,b as Ai,c as Ni,S as Ti,d as $i,C as Fi}from"./index-DLG-Can3.js";import{T as no}from"./Table-8-ldSKpC.js";import{R as ki,S as Mi,M as oe,B as Ri,L as mr,G as gn,C as gr}from"./summary-yl9MRbvK.js";import{A as ro,a as _e,b as Ie,c as he}from"./accordion-DP7ZozTk.js";import{u as zi,D as Li}from"./deposits-transactions-table-DGuOHsiS.js";import{C as Bi,M as Vi}from"./Checkbox-De6ghCZT.js";import{D as Le}from"./data-table-column-header-_ZrN0Vs6.js";const Hi=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M11 4h10",key:"1w87gc"}],["path",{d:"M11 8h7",key:"djye34"}],["path",{d:"M11 12h4",key:"q8tih4"}]],Ui=at("arrow-down-wide-narrow",Hi);const Ki=[["path",{d:"M14 3a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1",key:"1l7d7l"}],["path",{d:"M19 3a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1",key:"9955pe"}],["path",{d:"m7 15 3 3",key:"4hkfgk"}],["path",{d:"m7 21 3-3H5a2 2 0 0 1-2-2v-2",key:"1xljwe"}],["rect",{x:"14",y:"14",width:"7",height:"7",rx:"1",key:"1cdgtw"}],["rect",{x:"3",y:"3",width:"7",height:"7",rx:"1",key:"zi3rio"}]],Gi=at("combine",Ki);const qi=[["path",{d:"M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35",key:"17jvcc"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M14 19h6",key:"bvotb8"}],["path",{d:"M17 16v6",key:"18yu1i"}]],hr=at("file-plus-corner",qi);const Wi=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],Yi=at("refresh-ccw-dot",Wi);const Qi=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Pt=at("square-check-big",Qi);const Xi=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],At=at("square-x",Xi);function xr(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}var Ji=Object.defineProperty,Zi=Object.defineProperties,ec=Object.getOwnPropertyDescriptors,Ut=Object.getOwnPropertySymbols,so=Object.prototype.hasOwnProperty,oo=Object.prototype.propertyIsEnumerable,yr=(e,t,n)=>t in e?Ji(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ze=(e,t)=>{for(var n in t||(t={}))so.call(t,n)&&yr(e,n,t[n]);if(Ut)for(var n of Ut(t))oo.call(t,n)&&yr(e,n,t[n]);return e},hn=(e,t)=>Zi(e,ec(t)),tc=(e,t)=>{var n={};for(var s in e)so.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&Ut)for(var s of Ut(e))t.indexOf(s)<0&&oo.call(e,s)&&(n[s]=e[s]);return n};function nc(e){if(!e||typeof e=="string")return 0;const t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function xn(e){return e?.current?e.current.scrollHeight:"auto"}const Nt=typeof window<"u"&&window.requestAnimationFrame;function rc({transitionDuration:e,transitionTimingFunction:t="ease",onTransitionEnd:n=()=>{},opened:s}){const o=p.useRef(null),a=0,i={display:"none",height:0,overflow:"hidden"},[c,l]=p.useState(s?{}:i),d=u=>{ta.flushSync(()=>l(u))},h=u=>{d(m=>Ze(Ze({},m),u))};function f(u){return{transition:`height ${e||nc(u)}ms ${t}`}}Zo(()=>{Nt(s?()=>{h({willChange:"height",display:"block",overflow:"hidden"}),Nt(()=>{const u=xn(o);h(hn(Ze({},f(u)),{height:u}))})}:()=>{const u=xn(o);h(hn(Ze({},f(u)),{willChange:"height",height:u})),Nt(()=>h({height:a,overflow:"hidden"}))})},[s]);const g=u=>{if(!(u.target!==o.current||u.propertyName!=="height"))if(s){const m=xn(o);m===c.height?d({}):h({height:m}),n()}else c.height===a&&(d(i),n())};function x(u={}){var m=u,{style:j={},refKey:v="ref"}=m,b=tc(m,["style","refKey"]);const D=b[v];return hn(Ze({"aria-hidden":!s},b),{[v]:ea(o,D),onTransitionEnd:g,style:Ze(Ze({boxSizing:"border-box"},j),c)})}return x}var sc=Object.defineProperty,Kt=Object.getOwnPropertySymbols,ao=Object.prototype.hasOwnProperty,io=Object.prototype.propertyIsEnumerable,vr=(e,t,n)=>t in e?sc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Tt=(e,t)=>{for(var n in t||(t={}))ao.call(t,n)&&vr(e,n,t[n]);if(Kt)for(var n of Kt(t))io.call(t,n)&&vr(e,n,t[n]);return e},oc=(e,t)=>{var n={};for(var s in e)ao.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&Kt)for(var s of Kt(e))t.indexOf(s)<0&&io.call(e,s)&&(n[s]=e[s]);return n};const ac={transitionDuration:200,transitionTimingFunction:"ease",animateOpacity:!0},co=p.forwardRef((e,t)=>{const n=Ke("Collapse",ac,e),{children:s,in:o,transitionDuration:a,transitionTimingFunction:i,style:c,onTransitionEnd:l,animateOpacity:d}=n,h=oc(n,["children","in","transitionDuration","transitionTimingFunction","style","onTransitionEnd","animateOpacity"]),f=na(),g=ra(),u=(f.respectReducedMotion?g:!1)?0:a,{systemStyles:m,rest:j}=sa(h),v=rc({opened:o,transitionDuration:u,transitionTimingFunction:i,onTransitionEnd:l});return u===0?o?F.createElement(Me,Tt({},j),s):null:F.createElement(Me,Tt({},v(Tt(Tt({style:c,ref:t},j),m))),F.createElement("div",{style:{opacity:o||!d?1:0,transition:d?`opacity ${u}ms ${i}`:"none"}},s))});co.displayName="@mantine/core/Collapse";var ic=Object.defineProperty,cc=Object.defineProperties,lc=Object.getOwnPropertyDescriptors,jr=Object.getOwnPropertySymbols,dc=Object.prototype.hasOwnProperty,uc=Object.prototype.propertyIsEnumerable,br=(e,t,n)=>t in e?ic(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yn=(e,t)=>{for(var n in t||(t={}))dc.call(t,n)&&br(e,n,t[n]);if(jr)for(var n of jr(t))uc.call(t,n)&&br(e,n,t[n]);return e},fc=(e,t)=>cc(e,lc(t));const pc=["light","filled","outline","dot","gradient"],vn={xs:{fontSize:k(9),height:k(16)},sm:{fontSize:k(10),height:k(18)},md:{fontSize:k(11),height:k(20)},lg:{fontSize:k(13),height:k(26)},xl:{fontSize:k(16),height:k(32)}},mc={xs:k(4),sm:k(4),md:k(6),lg:k(8),xl:k(10)};function gc({theme:e,variant:t,color:n,size:s,gradient:o}){if(!pc.includes(t))return null;if(t==="dot"){const i=Oe({size:s,sizes:mc});return{backgroundColor:"transparent",color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],border:`${k(1)} solid ${e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[3]}`,paddingLeft:`calc(${Oe({size:s,sizes:e.spacing})} / 1.5 - ${i} / 2)`,"&::before":{content:'""',display:"block",width:i,height:i,borderRadius:i,backgroundColor:e.fn.themeColor(n,e.colorScheme==="dark"?4:e.fn.primaryShade("light"),!0),marginRight:i}}}const a=e.fn.variant({color:n,variant:t,gradient:o});return{background:a.background,color:a.color,border:`${k(t==="gradient"?0:1)} solid ${a.border}`}}var hc=Ye((e,{color:t,radius:n,gradient:s,fullWidth:o},{variant:a,size:i})=>{const{fontSize:c,height:l}=i in vn?vn[i]:vn.md;return{leftSection:{marginRight:`calc(${e.spacing.xs} / 2)`},rightSection:{marginLeft:`calc(${e.spacing.xs} / 2)`},inner:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},root:yn(fc(yn(yn({},e.fn.focusStyles()),e.fn.fontStyles()),{fontSize:c,height:l,WebkitTapHighlightColor:"transparent",lineHeight:`calc(${l} - ${k(2)})`,textDecoration:"none",padding:`0 calc(${Oe({size:i,sizes:e.spacing})} / 1.5)`,boxSizing:"border-box",display:o?"flex":"inline-flex",alignItems:"center",justifyContent:"center",width:o?"100%":"auto",textTransform:"uppercase",borderRadius:e.fn.radius(n),fontWeight:700,letterSpacing:k(.25),cursor:"inherit",textOverflow:"ellipsis",overflow:"hidden"}),gc({theme:e,variant:a,color:t,size:i,gradient:s}))}}),xc=Object.defineProperty,Gt=Object.getOwnPropertySymbols,lo=Object.prototype.hasOwnProperty,uo=Object.prototype.propertyIsEnumerable,Dr=(e,t,n)=>t in e?xc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yc=(e,t)=>{for(var n in t||(t={}))lo.call(t,n)&&Dr(e,n,t[n]);if(Gt)for(var n of Gt(t))uo.call(t,n)&&Dr(e,n,t[n]);return e},vc=(e,t)=>{var n={};for(var s in e)lo.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&Gt)for(var s of Gt(e))t.indexOf(s)<0&&uo.call(e,s)&&(n[s]=e[s]);return n};const jc={variant:"light",size:"md",radius:"xl"},fo=p.forwardRef((e,t)=>{const n=Ke("Badge",jc,e),{className:s,color:o,variant:a,fullWidth:i,children:c,size:l,leftSection:d,rightSection:h,radius:f,gradient:g,classNames:x,styles:u,unstyled:m}=n,j=vc(n,["className","color","variant","fullWidth","children","size","leftSection","rightSection","radius","gradient","classNames","styles","unstyled"]),{classes:v,cx:b}=hc({fullWidth:i,color:o,radius:f,gradient:g},{classNames:x,styles:u,name:"Badge",unstyled:m,variant:a,size:l});return F.createElement(Me,yc({className:b(v.root,s),ref:t},j),d&&F.createElement("span",{className:v.leftSection},d),F.createElement("span",{className:v.inner},c),h&&F.createElement("span",{className:v.rightSection},h))});fo.displayName="@mantine/core/Badge";const In=oa(fo);var bc=Object.defineProperty,qt=Object.getOwnPropertySymbols,po=Object.prototype.hasOwnProperty,mo=Object.prototype.propertyIsEnumerable,Cr=(e,t,n)=>t in e?bc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Sr=(e,t)=>{for(var n in t||(t={}))po.call(t,n)&&Cr(e,n,t[n]);if(qt)for(var n of qt(t))mo.call(t,n)&&Cr(e,n,t[n]);return e},Dc=(e,t)=>{var n={};for(var s in e)po.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&qt)for(var s of qt(e))t.indexOf(s)<0&&mo.call(e,s)&&(n[s]=e[s]);return n};const Cc={multiple:!1},go=p.forwardRef((e,t)=>{const n=Ke("FileButton",Cc,e),{onChange:s,children:o,multiple:a,accept:i,name:c,form:l,resetRef:d,disabled:h,capture:f,inputProps:g}=n,x=Dc(n,["onChange","children","multiple","accept","name","form","resetRef","disabled","capture","inputProps"]),u=p.useRef(),m=()=>{!h&&u.current.click()},j=b=>{s(a?Array.from(b.currentTarget.files):b.currentTarget.files[0]||null)};return gs(d,()=>{u.current.value=""}),F.createElement(F.Fragment,null,o(Sr({onClick:m},x)),F.createElement("input",Sr({style:{display:"none"},type:"file",accept:i,multiple:a,onChange:j,ref:aa(t,u),name:c,form:l,capture:f},g)))});go.displayName="@mantine/core/FileButton";var Sc=Ye(()=>({placeholder:{},input:{cursor:"pointer"}})),wc=Object.defineProperty,_c=Object.defineProperties,Ic=Object.getOwnPropertyDescriptors,Wt=Object.getOwnPropertySymbols,ho=Object.prototype.hasOwnProperty,xo=Object.prototype.propertyIsEnumerable,wr=(e,t,n)=>t in e?wc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,st=(e,t)=>{for(var n in t||(t={}))ho.call(t,n)&&wr(e,n,t[n]);if(Wt)for(var n of Wt(t))xo.call(t,n)&&wr(e,n,t[n]);return e},$t=(e,t)=>_c(e,Ic(t)),Oc=(e,t)=>{var n={};for(var s in e)ho.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&Wt)for(var s of Wt(e))t.indexOf(s)<0&&xo.call(e,s)&&(n[s]=e[s]);return n};const Ec=({value:e})=>F.createElement(He,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},Array.isArray(e)?e.map(t=>t.name).join(", "):e?.name),Pc={size:"sm",valueComponent:Ec},yo=p.forwardRef((e,t)=>{const n=ia("FileInput",Pc,e),{inputProps:s,wrapperProps:o,placeholder:a,value:i,defaultValue:c,onChange:l,multiple:d,accept:h,name:f,form:g,classNames:x,styles:u,unstyled:m,valueComponent:j,rightSection:v,clearable:b,clearButtonProps:D,readOnly:C,capture:A,fileInputProps:E}=n,w=Oc(n,["inputProps","wrapperProps","placeholder","value","defaultValue","onChange","multiple","accept","name","form","classNames","styles","unstyled","valueComponent","rightSection","clearable","clearButtonProps","readOnly","capture","fileInputProps"]),O=p.useRef(),{classes:_,cx:M}=Sc(null,{name:"FileInput",classNames:x,styles:u,unstyled:m}),[P,U]=ca({value:i,defaultValue:c,onChange:l,finalValue:d?[]:null}),y=Array.isArray(P)?P.length!==0:P!==null,N=v||(b&&y&&!C?F.createElement(la,$t(st({},D),{variant:"transparent",onClick:()=>U(d?[]:null),size:s.size,unstyled:m})):null);return p.useEffect(()=>{(Array.isArray(P)&&P.length===0||P===null)&&O.current()},[P]),F.createElement(fn.Wrapper,$t(st({},o),{__staticSelector:"FileInput"}),F.createElement(go,{onChange:U,multiple:d,accept:h,name:f,form:g,resetRef:O,disabled:C,capture:A,inputProps:E},B=>F.createElement(fn,$t(st(st(st({multiline:!0},B),s),w),{component:"button",type:"button",ref:t,__staticSelector:"FileInput",rightSection:N,classNames:$t(st({},x),{input:M(_.input,x?.input)})}),y?F.createElement(j,{value:P}):F.createElement(fn.Placeholder,{className:_.placeholder},a))))});yo.displayName="@mantine/core/FileInput";const Ac=yo;var Nc=Object.defineProperty,Tc=Object.defineProperties,$c=Object.getOwnPropertyDescriptors,_r=Object.getOwnPropertySymbols,Fc=Object.prototype.hasOwnProperty,kc=Object.prototype.propertyIsEnumerable,Ir=(e,t,n)=>t in e?Nc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mc=(e,t)=>{for(var n in t||(t={}))Fc.call(t,n)&&Ir(e,n,t[n]);if(_r)for(var n of _r(t))kc.call(t,n)&&Ir(e,n,t[n]);return e},Rc=(e,t)=>Tc(e,$c(t)),zc=Ye(e=>({root:Rc(Mc({},e.fn.cover()),{display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"})})),Lc=Object.defineProperty,Bc=Object.defineProperties,Vc=Object.getOwnPropertyDescriptors,Yt=Object.getOwnPropertySymbols,vo=Object.prototype.hasOwnProperty,jo=Object.prototype.propertyIsEnumerable,Or=(e,t,n)=>t in e?Lc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ft=(e,t)=>{for(var n in t||(t={}))vo.call(t,n)&&Or(e,n,t[n]);if(Yt)for(var n of Yt(t))jo.call(t,n)&&Or(e,n,t[n]);return e},Hc=(e,t)=>Bc(e,Vc(t)),Uc=(e,t)=>{var n={};for(var s in e)vo.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&Yt)for(var s of Yt(e))t.indexOf(s)<0&&jo.call(e,s)&&(n[s]=e[s]);return n};const Kc={overlayOpacity:.75,transitionDuration:0,radius:0,zIndex:xs("overlay")},bo=p.forwardRef((e,t)=>{const n=Ke("LoadingOverlay",Kc,e),{className:s,visible:o,loaderProps:a,overlayOpacity:i,overlayColor:c,transitionDuration:l,exitTransitionDuration:d,zIndex:h,style:f,loader:g,radius:x,overlayBlur:u,unstyled:m,variant:j,keepMounted:v}=n,b=Uc(n,["className","visible","loaderProps","overlayOpacity","overlayColor","transitionDuration","exitTransitionDuration","zIndex","style","loader","radius","overlayBlur","unstyled","variant","keepMounted"]),{classes:D,cx:C,theme:A}=zc(null,{name:"LoadingOverlay",unstyled:m,variant:j}),E=`calc(${h} + 1)`;return F.createElement(da,{keepMounted:v,duration:l,exitDuration:d,mounted:o,transition:"fade"},w=>F.createElement(Me,Ft({className:C(D.root,s),style:Hc(Ft(Ft({},w),f),{zIndex:h}),ref:t},b),g?F.createElement("div",{style:{zIndex:E}},g):F.createElement(it,Ft({style:{zIndex:E}},a)),F.createElement(hs,{opacity:i,zIndex:h,radius:x,blur:u,unstyled:m,color:c||(A.colorScheme==="dark"?A.colors.dark[5]:A.white)})))});bo.displayName="@mantine/core/LoadingOverlay";var Gc=Object.defineProperty,qc=Object.defineProperties,Wc=Object.getOwnPropertyDescriptors,Er=Object.getOwnPropertySymbols,Yc=Object.prototype.hasOwnProperty,Qc=Object.prototype.propertyIsEnumerable,Pr=(e,t,n)=>t in e?Gc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ar=(e,t)=>{for(var n in t||(t={}))Yc.call(t,n)&&Pr(e,n,t[n]);if(Er)for(var n of Er(t))Qc.call(t,n)&&Pr(e,n,t[n]);return e},Xc=(e,t)=>qc(e,Wc(t));const Jc={xs:k(16),sm:k(20),md:k(26),lg:k(32),xl:k(40)},Zc=["filled","light","gradient","outline","default"];function el({theme:e,variant:t,color:n,gradient:s}){if(!Zc.includes(t))return null;const o=e.fn.variant({variant:t,color:n||e.primaryColor,gradient:s,primaryFallback:!1});return{backgroundColor:o.background,color:o.color,backgroundImage:t==="gradient"?o.background:void 0,border:`${k(t==="gradient"?0:1)} solid ${o.border}`}}var tl=Ye((e,{color:t,radius:n,gradient:s},{variant:o,size:a})=>{const i=Oe({size:a,sizes:Jc});return{root:Ar(Xc(Ar({},e.fn.fontStyles()),{display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",width:i,height:i,minWidth:i,minHeight:i,borderRadius:e.fn.radius(n)}),el({theme:e,variant:o,gradient:s,color:t}))}}),nl=Object.defineProperty,Qt=Object.getOwnPropertySymbols,Do=Object.prototype.hasOwnProperty,Co=Object.prototype.propertyIsEnumerable,Nr=(e,t,n)=>t in e?nl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rl=(e,t)=>{for(var n in t||(t={}))Do.call(t,n)&&Nr(e,n,t[n]);if(Qt)for(var n of Qt(t))Co.call(t,n)&&Nr(e,n,t[n]);return e},sl=(e,t)=>{var n={};for(var s in e)Do.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&Qt)for(var s of Qt(e))t.indexOf(s)<0&&Co.call(e,s)&&(n[s]=e[s]);return n};const ol={size:"md",variant:"filled"},Hn=p.forwardRef((e,t)=>{const n=Ke("ThemeIcon",ol,e),{className:s,size:o,radius:a,variant:i,color:c,children:l,gradient:d,unstyled:h}=n,f=sl(n,["className","size","radius","variant","color","children","gradient","unstyled"]),{classes:g,cx:x}=tl({variant:i,radius:a,color:c,gradient:d},{name:"ThemeIcon",unstyled:h,variant:i,size:o});return F.createElement(Me,rl({className:x(g.root,s),ref:t},f),l)});Hn.displayName="@mantine/core/ThemeIcon";const al=({data:e})=>{const t=L(ua,e);return r.jsxs(r.Fragment,{children:[r.jsx(ki,{data:t,onChange:()=>{}}),r.jsx(Mi,{data:t})]})},il="deleteCharge",cl=()=>{const[{fetching:e},t]=Te(fa),n=p.useCallback(async s=>{const o=`Error deleting charge ID [${s.chargeId}]`,a=`${il}-${s.chargeId}`;R.loading("Deleting charge",{id:a});try{const i=await t(s),c=$e(i,o,a);if(c){if(c.deleteCharge===!1)throw new Error("Unsuccessful deletion");return R.success("Success",{id:a,description:"Charge was deleted"}),c.deleteCharge}}catch(i){console.error(`${o}: ${i}`),R.error("Error",{id:a,description:o,duration:1e5,closeButton:!0})}return!1},[t]);return{fetching:e,deleteCharge:n}},ll="regenerateLedgerRecords",dl=()=>{const[{fetching:e},t]=Te(pa),n=p.useCallback(async s=>{const o="Error regenerating ledger",a=`${ll}-${s.chargeId}`;R.loading("Regenerating Ledger",{id:a});try{const i=await t(s),c=$e(i,o,a,"regenerateLedgerRecords");if(c)return R.success("Success",{id:a,description:"Ledger records were regenerated"}),c.regenerateLedgerRecords}catch(i){console.error(`${o}: ${i}`),R.error("Error",{id:a,description:o,duration:1e5,closeButton:!0})}},[t]);return{fetching:e,regenerateLedgerRecords:n}};function ul({chargeId:e,onChange:t,...n}){const{regenerateLedgerRecords:s}=dl();function o(){s({chargeId:e}).then(t)}return r.jsx(Ue,{content:"Regenerate Ledger",children:r.jsx(on,{onConfirm:o,title:"Are you sure you want to regenerate ledger records?",children:r.jsx(Y,{variant:"outline",size:"icon",...n,className:ys("size-7.5",n.className),children:r.jsx(Yi,{className:"size-5"})})})})}function fl(e){const{mergeSelected:t,toggleMergeSelected:n}=e,[s,o]=p.useState(t?"default":"ghost");return p.useEffect(()=>{o(t?"default":"ghost")},[t]),r.jsx(Ue,{content:"Select for merge",children:r.jsx(Y,{onClick:a=>{a.stopPropagation(),n()},variant:s,className:ys("size-7.5",t?"bg-blue-500 hover:bg-blue-500/90":""),children:r.jsx(Gi,{className:"size-5"})})})}const pl="updateMiscExpense",ml=()=>{const[{fetching:e},t]=Te(ma),n=p.useCallback(async s=>{const o=`Error updating misc expense ID [${s.id}]`,a=`${pl}-${s.id}`;R.loading("Update Misc Expense",{id:a});try{const i=await t(s),c=$e(i,o,a,"updateMiscExpense");if(c)return R.success("Success",{id:a,description:"Misc expense was updated"}),c.updateMiscExpense}catch(i){console.error(`${o}: ${i}`),R.error("Error",{id:a,description:o,duration:1e5,closeButton:!0})}},[t]);return{fetching:e,updateMiscExpense:n}},gl=({onDone:e,data:t})=>{const[n,s]=p.useState(!1),o=L(ga,t),a=an({defaultValues:{amount:o.amount.raw,currency:o.amount.currency,description:o.description,valueDate:new Date(o.valueDate),invoiceDate:o.invoiceDate,creditorId:o.creditor.id,debtorId:o.debtor.id}}),{handleSubmit:i,formState:{dirtyFields:c}}=a,{updateMiscExpense:l,fetching:d}=ml(),h=p.useCallback(async g=>{s(!0),await l({id:o.id,fields:g}),e(),s(!1)},[l,e,o.id]),f=g=>{g&&Object.keys(g).length>0&&h({...g})};return n?r.jsx(it,{className:"flex self-center my-5",color:"dark",size:"xl",variant:"dots"}):r.jsx(vs,{...a,children:r.jsx("form",{onSubmit:i(f),noValidate:!0,children:r.jsxs("div",{className:"px-5 flex flex-col gap-5",children:[r.jsx(_i,{formManager:a,isInsert:!1}),r.jsx("div",{className:"flex justify-right gap-5 mt-5",children:r.jsx("button",{type:"submit",className:"text-white bg-indigo-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-indigo-600 rounded-sm text-lg",disabled:d||Object.keys(c).length===0,children:"Accept"})})]})})})},hl="insertDocument",xl=()=>{const[{fetching:e},t]=Te(ha),n=p.useCallback(async s=>{const o=`Error inserting document to charge ID [${s.record.chargeId}]`,a=hl;R.loading("Adding document",{id:a});try{const i=await t(s),c=$e(i,o,a,"insertDocument");if(c)return R.success("Success",{id:a,description:"Document added"}),c.insertDocument}catch(i){console.error(`${o}: ${i}`),R.error("Error",{id:a,description:o,duration:1e5,closeButton:!0})}},[t]);return{fetching:e,insertDocument:n}},yl=({chargeId:e,onChange:t,closeModal:n})=>{const s=an(),{handleSubmit:o,formState:{dirtyFields:a},setValue:i,watch:c}=s,{insertDocument:l,fetching:d}=xl(),h=g=>{if(g&&Object.keys(g).length>0){if(g.vat){if(!g.amount?.currency){R.error("Error",{description:"Couldn't figure out the currency of the document"});return}g.vat.currency=g.amount.currency}g.documentType??=va.Unprocessed,l({record:{...g,chargeId:e}}).then(()=>t?.()),n?.()}},f=c("amount.currency");return p.useEffect(()=>{i("vat.currency",f)},[i,f]),r.jsx("div",{className:"px-5 w-max h-max justify-items-center",children:r.jsx(vs,{...s,children:r.jsxs("form",{onSubmit:o(h),children:[r.jsx(xa,{cols:5,children:r.jsx(ya,{formManager:s,defaultCurrency:_t.Ils})}),r.jsxs("div",{className:"flex justify-center gap-5 mt-5",children:[r.jsx("button",{type:"submit",className:" text-white bg-indigo-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-indigo-600 rounded-sm text-lg",disabled:d||Object.keys(a).length===0,children:"Accept"}),r.jsx("button",{type:"button",className:" text-white bg-rose-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-rose-600 rounded-sm text-lg",onClick:n,children:"Cancel"})]})]})})})},vl="insertSalaryRecordsFromFile",jl=()=>{const[{fetching:e},t]=Te(ja),n=p.useCallback(async s=>{const o=`Error uploading payroll file to charge ID [${s.chargeId}]`,a=`${vl}-${s.chargeId}`;R.loading("Uploading payroll file",{id:a});try{const i=await t(s),c=$e(i,o,a,"insertSalaryRecordsFromFile");if(c)return R.success("Success",{id:a,description:"Payroll file added"}),c.insertSalaryRecordsFromFile}catch(i){console.error(`${o}: ${i}`),R.error("Error",{id:a,description:o,duration:1e5,closeButton:!0})}return!1},[t]);return{fetching:e,uploadPayrollFile:n}},bl=({chargeId:e,onDone:t})=>{const{fetching:n,uploadPayrollFile:s}=jl(),[o,a]=p.useState(null),i=p.useCallback(async()=>{o&&s({file:o,chargeId:e}).then(t)},[s,t,o,e]);return r.jsxs("div",{className:"px-5 w-max h-max justify-items-center",children:[r.jsx(Ac,{icon:n&&r.jsx(it,{}),value:o,onChange:a,clearable:!0,label:"File Upload"}),r.jsx("div",{className:"flex justify-center gap-5 mt-5",children:r.jsx("button",{type:"submit",className:" text-white bg-indigo-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-indigo-600 rounded-sm text-lg",disabled:n||!o,onClick:i,children:"Accept"})})]})};var Dl=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function It(e,t){var n=Cl(e);if(typeof n.path!="string"){var s=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof s=="string"&&s.length>0?s:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function Cl(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var s=t.split(".").pop().toLowerCase(),o=Dl.get(s);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var Sl=[".DS_Store","Thumbs.db"];function wl(e){return ct(this,void 0,void 0,function(){return lt(this,function(t){return Xt(e)&&_l(e.dataTransfer)?[2,Pl(e.dataTransfer,e.type)]:Il(e)?[2,Ol(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,El(e)]:[2,[]]})})}function _l(e){return Xt(e)}function Il(e){return Xt(e)&&Xt(e.target)}function Xt(e){return typeof e=="object"&&e!==null}function Ol(e){return On(e.target.files).map(function(t){return It(t)})}function El(e){return ct(this,void 0,void 0,function(){var t;return lt(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(s){return s.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(s){return It(s)})]}})})}function Pl(e,t){return ct(this,void 0,void 0,function(){var n,s;return lt(this,function(o){switch(o.label){case 0:return e.items?(n=On(e.items).filter(function(a){return a.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(Al))]):[3,2];case 1:return s=o.sent(),[2,Tr(So(s))];case 2:return[2,Tr(On(e.files).map(function(a){return It(a)}))]}})})}function Tr(e){return e.filter(function(t){return Sl.indexOf(t.name)===-1})}function On(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var s=e[n];t.push(s)}return t}function Al(e){if(typeof e.webkitGetAsEntry!="function")return $r(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?wo(t):$r(e)}function So(e){return e.reduce(function(t,n){return rr(rr([],sr(t),!1),sr(Array.isArray(n)?So(n):[n]),!1)},[])}function $r(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=It(t);return Promise.resolve(n)}function Nl(e){return ct(this,void 0,void 0,function(){return lt(this,function(t){return[2,e.isDirectory?wo(e):Tl(e)]})})}function wo(e){var t=e.createReader();return new Promise(function(n,s){var o=[];function a(){var i=this;t.readEntries(function(c){return ct(i,void 0,void 0,function(){var l,d,h;return lt(this,function(f){switch(f.label){case 0:if(c.length)return[3,5];f.label=1;case 1:return f.trys.push([1,3,,4]),[4,Promise.all(o)];case 2:return l=f.sent(),n(l),[3,4];case 3:return d=f.sent(),s(d),[3,4];case 4:return[3,6];case 5:h=Promise.all(c.map(Nl)),o.push(h),a(),f.label=6;case 6:return[2]}})})},function(c){s(c)})}a()})}function Tl(e){return ct(this,void 0,void 0,function(){return lt(this,function(t){return[2,new Promise(function(n,s){e.file(function(o){var a=It(o,e.fullPath);n(a)},function(o){s(o)})})]})})}var kt={},Fr;function $l(){return Fr||(Fr=1,kt.__esModule=!0,kt.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var s=e.name||"",o=(e.type||"").toLowerCase(),a=o.replace(/\/.*$/,"");return n.some(function(i){var c=i.trim().toLowerCase();return c.charAt(0)==="."?s.toLowerCase().endsWith(c):c.endsWith("/*")?a===c.replace(/\/.*$/,""):o===c})}return!0}),kt}var Fl=$l();const kl=ba(Fl);function kr(e){return zl(e)||Rl(e)||Io(e)||Ml()}function Ml(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1
|
+
import{v as at,r as p,ep as Zo,eq as ea,di as ta,bz as Ke,er as na,es as ra,et as sa,aF as F,bA as Me,by as Ye,eu as k,ev as Oe,ew as oa,ex as gs,ey as aa,ez as ia,eA as ca,eB as la,eC as fn,bv as He,eD as da,d as it,cr as hs,eE as xs,j as r,a6 as L,eF as ua,g as Te,eG as fa,t as R,i as $e,eH as pa,T as Ue,bX as on,B as Y,m as ys,eI as ma,E as an,V as vs,eJ as ga,eK as ha,eL as xa,eM as ya,ay as _t,cb as va,eN as ja,eO as ct,eP as lt,eQ as rr,eR as sr,dP as ba,eS as js,eT as Da,l as jt,eU as Ca,eV as Sa,aT as or,eW as wa,u as Ne,eX as _a,eY as Ia,c as Oa,eZ as Fn,e_ as kn,D as cn,aL as bs,bU as Ea,bV as Pa,bW as Aa,x as ln,al as Ds,am as Cs,e$ as Na,f0 as Ss,f1 as Ta,f2 as ws,R as We,ag as Mn,f3 as $a,bC as Be,f4 as Fa,ah as bt,f5 as _s,f6 as Is,f7 as qe,w as tt,f8 as ka,f9 as Os,fa as Es,fb as Ps,fc as Ma,fd as Ra,fe as As,ff as Bt,fg as Ns,fh as za,fi as La,fj as Ba,a3 as Va,fk as Ts,n as yt,bE as ke,bF as $s,bG as Fs,cq as ks,bH as Vt,fl as Ha,fm as Ua,cw as Rn,e as Ka,fn as Ga,a9 as qa,fo as Wa,L as zn,fp as Ya,cp as pn,dt as Qa,fq as _n,fr as Ms,fs as Rs,ft as Xa,fu as mn,fv as ar,fw as zs,du as Ja,fx as Za,dI as we,b$ as je,af as Ls,fy as ir,fz as ei,bY as Bs,c4 as ti,c5 as Vs,c6 as Hs,bO as Ln,bP as Bn,bQ as Ve,bR as Pe,c2 as Ht,bS as Vn,bT as De,P as ni,dw as Us,fA as Ks,fB as Gs,fC as ri,fD as si,fE as oi,ao as cr,ap as lr,aq as dr,ar as ur,as as fr,a2 as ai,au as ii,fF as ci,fG as qs,p as li,c3 as di,bZ as ui,b_ as fi,c0 as pi,c1 as mi,fH as gi,fI as hi,dp as ot,fJ as Ws,fK as xi,fL as Ys,J as yi,W as vi,O as ji,fM as Qs,fN as bi,fO as Xs,fP as Js,fQ as Ee,fR as be,fS as Di,fT as pr,fU as Zs,fV as Je,fW as Ci,fX as Si}from"./index-D1_HHRLX.js";import{T as eo}from"./toggle-expansion-button-Dg_XsE6y.js";import{U as wi}from"./update-accountant-status-CU6mIJqS.js";import{M as _i,P as W,I as Ii,T as to,a as Oi,D as Ei,A as Pi,b as Ai,c as Ni,S as Ti,d as $i,C as Fi}from"./index-BrgWieYs.js";import{T as no}from"./Table-pGQWLQ8H.js";import{R as ki,S as Mi,M as oe,B as Ri,L as mr,G as gn,C as gr}from"./summary-C5TvRXn1.js";import{A as ro,a as _e,b as Ie,c as he}from"./accordion-Bd6kAhfN.js";import{u as zi,D as Li}from"./deposits-transactions-table-CV-YceTW.js";import{C as Bi,M as Vi}from"./Checkbox-D5PsdcQv.js";import{D as Le}from"./data-table-column-header--gzXkv5r.js";const Hi=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M11 4h10",key:"1w87gc"}],["path",{d:"M11 8h7",key:"djye34"}],["path",{d:"M11 12h4",key:"q8tih4"}]],Ui=at("arrow-down-wide-narrow",Hi);const Ki=[["path",{d:"M14 3a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1",key:"1l7d7l"}],["path",{d:"M19 3a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1",key:"9955pe"}],["path",{d:"m7 15 3 3",key:"4hkfgk"}],["path",{d:"m7 21 3-3H5a2 2 0 0 1-2-2v-2",key:"1xljwe"}],["rect",{x:"14",y:"14",width:"7",height:"7",rx:"1",key:"1cdgtw"}],["rect",{x:"3",y:"3",width:"7",height:"7",rx:"1",key:"zi3rio"}]],Gi=at("combine",Ki);const qi=[["path",{d:"M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35",key:"17jvcc"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M14 19h6",key:"bvotb8"}],["path",{d:"M17 16v6",key:"18yu1i"}]],hr=at("file-plus-corner",qi);const Wi=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],Yi=at("refresh-ccw-dot",Wi);const Qi=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Pt=at("square-check-big",Qi);const Xi=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],At=at("square-x",Xi);function xr(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}var Ji=Object.defineProperty,Zi=Object.defineProperties,ec=Object.getOwnPropertyDescriptors,Ut=Object.getOwnPropertySymbols,so=Object.prototype.hasOwnProperty,oo=Object.prototype.propertyIsEnumerable,yr=(e,t,n)=>t in e?Ji(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ze=(e,t)=>{for(var n in t||(t={}))so.call(t,n)&&yr(e,n,t[n]);if(Ut)for(var n of Ut(t))oo.call(t,n)&&yr(e,n,t[n]);return e},hn=(e,t)=>Zi(e,ec(t)),tc=(e,t)=>{var n={};for(var s in e)so.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&Ut)for(var s of Ut(e))t.indexOf(s)<0&&oo.call(e,s)&&(n[s]=e[s]);return n};function nc(e){if(!e||typeof e=="string")return 0;const t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function xn(e){return e?.current?e.current.scrollHeight:"auto"}const Nt=typeof window<"u"&&window.requestAnimationFrame;function rc({transitionDuration:e,transitionTimingFunction:t="ease",onTransitionEnd:n=()=>{},opened:s}){const o=p.useRef(null),a=0,i={display:"none",height:0,overflow:"hidden"},[c,l]=p.useState(s?{}:i),d=u=>{ta.flushSync(()=>l(u))},h=u=>{d(m=>Ze(Ze({},m),u))};function f(u){return{transition:`height ${e||nc(u)}ms ${t}`}}Zo(()=>{Nt(s?()=>{h({willChange:"height",display:"block",overflow:"hidden"}),Nt(()=>{const u=xn(o);h(hn(Ze({},f(u)),{height:u}))})}:()=>{const u=xn(o);h(hn(Ze({},f(u)),{willChange:"height",height:u})),Nt(()=>h({height:a,overflow:"hidden"}))})},[s]);const g=u=>{if(!(u.target!==o.current||u.propertyName!=="height"))if(s){const m=xn(o);m===c.height?d({}):h({height:m}),n()}else c.height===a&&(d(i),n())};function x(u={}){var m=u,{style:j={},refKey:v="ref"}=m,b=tc(m,["style","refKey"]);const D=b[v];return hn(Ze({"aria-hidden":!s},b),{[v]:ea(o,D),onTransitionEnd:g,style:Ze(Ze({boxSizing:"border-box"},j),c)})}return x}var sc=Object.defineProperty,Kt=Object.getOwnPropertySymbols,ao=Object.prototype.hasOwnProperty,io=Object.prototype.propertyIsEnumerable,vr=(e,t,n)=>t in e?sc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Tt=(e,t)=>{for(var n in t||(t={}))ao.call(t,n)&&vr(e,n,t[n]);if(Kt)for(var n of Kt(t))io.call(t,n)&&vr(e,n,t[n]);return e},oc=(e,t)=>{var n={};for(var s in e)ao.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&Kt)for(var s of Kt(e))t.indexOf(s)<0&&io.call(e,s)&&(n[s]=e[s]);return n};const ac={transitionDuration:200,transitionTimingFunction:"ease",animateOpacity:!0},co=p.forwardRef((e,t)=>{const n=Ke("Collapse",ac,e),{children:s,in:o,transitionDuration:a,transitionTimingFunction:i,style:c,onTransitionEnd:l,animateOpacity:d}=n,h=oc(n,["children","in","transitionDuration","transitionTimingFunction","style","onTransitionEnd","animateOpacity"]),f=na(),g=ra(),u=(f.respectReducedMotion?g:!1)?0:a,{systemStyles:m,rest:j}=sa(h),v=rc({opened:o,transitionDuration:u,transitionTimingFunction:i,onTransitionEnd:l});return u===0?o?F.createElement(Me,Tt({},j),s):null:F.createElement(Me,Tt({},v(Tt(Tt({style:c,ref:t},j),m))),F.createElement("div",{style:{opacity:o||!d?1:0,transition:d?`opacity ${u}ms ${i}`:"none"}},s))});co.displayName="@mantine/core/Collapse";var ic=Object.defineProperty,cc=Object.defineProperties,lc=Object.getOwnPropertyDescriptors,jr=Object.getOwnPropertySymbols,dc=Object.prototype.hasOwnProperty,uc=Object.prototype.propertyIsEnumerable,br=(e,t,n)=>t in e?ic(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yn=(e,t)=>{for(var n in t||(t={}))dc.call(t,n)&&br(e,n,t[n]);if(jr)for(var n of jr(t))uc.call(t,n)&&br(e,n,t[n]);return e},fc=(e,t)=>cc(e,lc(t));const pc=["light","filled","outline","dot","gradient"],vn={xs:{fontSize:k(9),height:k(16)},sm:{fontSize:k(10),height:k(18)},md:{fontSize:k(11),height:k(20)},lg:{fontSize:k(13),height:k(26)},xl:{fontSize:k(16),height:k(32)}},mc={xs:k(4),sm:k(4),md:k(6),lg:k(8),xl:k(10)};function gc({theme:e,variant:t,color:n,size:s,gradient:o}){if(!pc.includes(t))return null;if(t==="dot"){const i=Oe({size:s,sizes:mc});return{backgroundColor:"transparent",color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],border:`${k(1)} solid ${e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[3]}`,paddingLeft:`calc(${Oe({size:s,sizes:e.spacing})} / 1.5 - ${i} / 2)`,"&::before":{content:'""',display:"block",width:i,height:i,borderRadius:i,backgroundColor:e.fn.themeColor(n,e.colorScheme==="dark"?4:e.fn.primaryShade("light"),!0),marginRight:i}}}const a=e.fn.variant({color:n,variant:t,gradient:o});return{background:a.background,color:a.color,border:`${k(t==="gradient"?0:1)} solid ${a.border}`}}var hc=Ye((e,{color:t,radius:n,gradient:s,fullWidth:o},{variant:a,size:i})=>{const{fontSize:c,height:l}=i in vn?vn[i]:vn.md;return{leftSection:{marginRight:`calc(${e.spacing.xs} / 2)`},rightSection:{marginLeft:`calc(${e.spacing.xs} / 2)`},inner:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},root:yn(fc(yn(yn({},e.fn.focusStyles()),e.fn.fontStyles()),{fontSize:c,height:l,WebkitTapHighlightColor:"transparent",lineHeight:`calc(${l} - ${k(2)})`,textDecoration:"none",padding:`0 calc(${Oe({size:i,sizes:e.spacing})} / 1.5)`,boxSizing:"border-box",display:o?"flex":"inline-flex",alignItems:"center",justifyContent:"center",width:o?"100%":"auto",textTransform:"uppercase",borderRadius:e.fn.radius(n),fontWeight:700,letterSpacing:k(.25),cursor:"inherit",textOverflow:"ellipsis",overflow:"hidden"}),gc({theme:e,variant:a,color:t,size:i,gradient:s}))}}),xc=Object.defineProperty,Gt=Object.getOwnPropertySymbols,lo=Object.prototype.hasOwnProperty,uo=Object.prototype.propertyIsEnumerable,Dr=(e,t,n)=>t in e?xc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yc=(e,t)=>{for(var n in t||(t={}))lo.call(t,n)&&Dr(e,n,t[n]);if(Gt)for(var n of Gt(t))uo.call(t,n)&&Dr(e,n,t[n]);return e},vc=(e,t)=>{var n={};for(var s in e)lo.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&Gt)for(var s of Gt(e))t.indexOf(s)<0&&uo.call(e,s)&&(n[s]=e[s]);return n};const jc={variant:"light",size:"md",radius:"xl"},fo=p.forwardRef((e,t)=>{const n=Ke("Badge",jc,e),{className:s,color:o,variant:a,fullWidth:i,children:c,size:l,leftSection:d,rightSection:h,radius:f,gradient:g,classNames:x,styles:u,unstyled:m}=n,j=vc(n,["className","color","variant","fullWidth","children","size","leftSection","rightSection","radius","gradient","classNames","styles","unstyled"]),{classes:v,cx:b}=hc({fullWidth:i,color:o,radius:f,gradient:g},{classNames:x,styles:u,name:"Badge",unstyled:m,variant:a,size:l});return F.createElement(Me,yc({className:b(v.root,s),ref:t},j),d&&F.createElement("span",{className:v.leftSection},d),F.createElement("span",{className:v.inner},c),h&&F.createElement("span",{className:v.rightSection},h))});fo.displayName="@mantine/core/Badge";const In=oa(fo);var bc=Object.defineProperty,qt=Object.getOwnPropertySymbols,po=Object.prototype.hasOwnProperty,mo=Object.prototype.propertyIsEnumerable,Cr=(e,t,n)=>t in e?bc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Sr=(e,t)=>{for(var n in t||(t={}))po.call(t,n)&&Cr(e,n,t[n]);if(qt)for(var n of qt(t))mo.call(t,n)&&Cr(e,n,t[n]);return e},Dc=(e,t)=>{var n={};for(var s in e)po.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&qt)for(var s of qt(e))t.indexOf(s)<0&&mo.call(e,s)&&(n[s]=e[s]);return n};const Cc={multiple:!1},go=p.forwardRef((e,t)=>{const n=Ke("FileButton",Cc,e),{onChange:s,children:o,multiple:a,accept:i,name:c,form:l,resetRef:d,disabled:h,capture:f,inputProps:g}=n,x=Dc(n,["onChange","children","multiple","accept","name","form","resetRef","disabled","capture","inputProps"]),u=p.useRef(),m=()=>{!h&&u.current.click()},j=b=>{s(a?Array.from(b.currentTarget.files):b.currentTarget.files[0]||null)};return gs(d,()=>{u.current.value=""}),F.createElement(F.Fragment,null,o(Sr({onClick:m},x)),F.createElement("input",Sr({style:{display:"none"},type:"file",accept:i,multiple:a,onChange:j,ref:aa(t,u),name:c,form:l,capture:f},g)))});go.displayName="@mantine/core/FileButton";var Sc=Ye(()=>({placeholder:{},input:{cursor:"pointer"}})),wc=Object.defineProperty,_c=Object.defineProperties,Ic=Object.getOwnPropertyDescriptors,Wt=Object.getOwnPropertySymbols,ho=Object.prototype.hasOwnProperty,xo=Object.prototype.propertyIsEnumerable,wr=(e,t,n)=>t in e?wc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,st=(e,t)=>{for(var n in t||(t={}))ho.call(t,n)&&wr(e,n,t[n]);if(Wt)for(var n of Wt(t))xo.call(t,n)&&wr(e,n,t[n]);return e},$t=(e,t)=>_c(e,Ic(t)),Oc=(e,t)=>{var n={};for(var s in e)ho.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&Wt)for(var s of Wt(e))t.indexOf(s)<0&&xo.call(e,s)&&(n[s]=e[s]);return n};const Ec=({value:e})=>F.createElement(He,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},Array.isArray(e)?e.map(t=>t.name).join(", "):e?.name),Pc={size:"sm",valueComponent:Ec},yo=p.forwardRef((e,t)=>{const n=ia("FileInput",Pc,e),{inputProps:s,wrapperProps:o,placeholder:a,value:i,defaultValue:c,onChange:l,multiple:d,accept:h,name:f,form:g,classNames:x,styles:u,unstyled:m,valueComponent:j,rightSection:v,clearable:b,clearButtonProps:D,readOnly:C,capture:A,fileInputProps:E}=n,w=Oc(n,["inputProps","wrapperProps","placeholder","value","defaultValue","onChange","multiple","accept","name","form","classNames","styles","unstyled","valueComponent","rightSection","clearable","clearButtonProps","readOnly","capture","fileInputProps"]),O=p.useRef(),{classes:_,cx:M}=Sc(null,{name:"FileInput",classNames:x,styles:u,unstyled:m}),[P,U]=ca({value:i,defaultValue:c,onChange:l,finalValue:d?[]:null}),y=Array.isArray(P)?P.length!==0:P!==null,N=v||(b&&y&&!C?F.createElement(la,$t(st({},D),{variant:"transparent",onClick:()=>U(d?[]:null),size:s.size,unstyled:m})):null);return p.useEffect(()=>{(Array.isArray(P)&&P.length===0||P===null)&&O.current()},[P]),F.createElement(fn.Wrapper,$t(st({},o),{__staticSelector:"FileInput"}),F.createElement(go,{onChange:U,multiple:d,accept:h,name:f,form:g,resetRef:O,disabled:C,capture:A,inputProps:E},B=>F.createElement(fn,$t(st(st(st({multiline:!0},B),s),w),{component:"button",type:"button",ref:t,__staticSelector:"FileInput",rightSection:N,classNames:$t(st({},x),{input:M(_.input,x?.input)})}),y?F.createElement(j,{value:P}):F.createElement(fn.Placeholder,{className:_.placeholder},a))))});yo.displayName="@mantine/core/FileInput";const Ac=yo;var Nc=Object.defineProperty,Tc=Object.defineProperties,$c=Object.getOwnPropertyDescriptors,_r=Object.getOwnPropertySymbols,Fc=Object.prototype.hasOwnProperty,kc=Object.prototype.propertyIsEnumerable,Ir=(e,t,n)=>t in e?Nc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mc=(e,t)=>{for(var n in t||(t={}))Fc.call(t,n)&&Ir(e,n,t[n]);if(_r)for(var n of _r(t))kc.call(t,n)&&Ir(e,n,t[n]);return e},Rc=(e,t)=>Tc(e,$c(t)),zc=Ye(e=>({root:Rc(Mc({},e.fn.cover()),{display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"})})),Lc=Object.defineProperty,Bc=Object.defineProperties,Vc=Object.getOwnPropertyDescriptors,Yt=Object.getOwnPropertySymbols,vo=Object.prototype.hasOwnProperty,jo=Object.prototype.propertyIsEnumerable,Or=(e,t,n)=>t in e?Lc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ft=(e,t)=>{for(var n in t||(t={}))vo.call(t,n)&&Or(e,n,t[n]);if(Yt)for(var n of Yt(t))jo.call(t,n)&&Or(e,n,t[n]);return e},Hc=(e,t)=>Bc(e,Vc(t)),Uc=(e,t)=>{var n={};for(var s in e)vo.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&Yt)for(var s of Yt(e))t.indexOf(s)<0&&jo.call(e,s)&&(n[s]=e[s]);return n};const Kc={overlayOpacity:.75,transitionDuration:0,radius:0,zIndex:xs("overlay")},bo=p.forwardRef((e,t)=>{const n=Ke("LoadingOverlay",Kc,e),{className:s,visible:o,loaderProps:a,overlayOpacity:i,overlayColor:c,transitionDuration:l,exitTransitionDuration:d,zIndex:h,style:f,loader:g,radius:x,overlayBlur:u,unstyled:m,variant:j,keepMounted:v}=n,b=Uc(n,["className","visible","loaderProps","overlayOpacity","overlayColor","transitionDuration","exitTransitionDuration","zIndex","style","loader","radius","overlayBlur","unstyled","variant","keepMounted"]),{classes:D,cx:C,theme:A}=zc(null,{name:"LoadingOverlay",unstyled:m,variant:j}),E=`calc(${h} + 1)`;return F.createElement(da,{keepMounted:v,duration:l,exitDuration:d,mounted:o,transition:"fade"},w=>F.createElement(Me,Ft({className:C(D.root,s),style:Hc(Ft(Ft({},w),f),{zIndex:h}),ref:t},b),g?F.createElement("div",{style:{zIndex:E}},g):F.createElement(it,Ft({style:{zIndex:E}},a)),F.createElement(hs,{opacity:i,zIndex:h,radius:x,blur:u,unstyled:m,color:c||(A.colorScheme==="dark"?A.colors.dark[5]:A.white)})))});bo.displayName="@mantine/core/LoadingOverlay";var Gc=Object.defineProperty,qc=Object.defineProperties,Wc=Object.getOwnPropertyDescriptors,Er=Object.getOwnPropertySymbols,Yc=Object.prototype.hasOwnProperty,Qc=Object.prototype.propertyIsEnumerable,Pr=(e,t,n)=>t in e?Gc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ar=(e,t)=>{for(var n in t||(t={}))Yc.call(t,n)&&Pr(e,n,t[n]);if(Er)for(var n of Er(t))Qc.call(t,n)&&Pr(e,n,t[n]);return e},Xc=(e,t)=>qc(e,Wc(t));const Jc={xs:k(16),sm:k(20),md:k(26),lg:k(32),xl:k(40)},Zc=["filled","light","gradient","outline","default"];function el({theme:e,variant:t,color:n,gradient:s}){if(!Zc.includes(t))return null;const o=e.fn.variant({variant:t,color:n||e.primaryColor,gradient:s,primaryFallback:!1});return{backgroundColor:o.background,color:o.color,backgroundImage:t==="gradient"?o.background:void 0,border:`${k(t==="gradient"?0:1)} solid ${o.border}`}}var tl=Ye((e,{color:t,radius:n,gradient:s},{variant:o,size:a})=>{const i=Oe({size:a,sizes:Jc});return{root:Ar(Xc(Ar({},e.fn.fontStyles()),{display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",width:i,height:i,minWidth:i,minHeight:i,borderRadius:e.fn.radius(n)}),el({theme:e,variant:o,gradient:s,color:t}))}}),nl=Object.defineProperty,Qt=Object.getOwnPropertySymbols,Do=Object.prototype.hasOwnProperty,Co=Object.prototype.propertyIsEnumerable,Nr=(e,t,n)=>t in e?nl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rl=(e,t)=>{for(var n in t||(t={}))Do.call(t,n)&&Nr(e,n,t[n]);if(Qt)for(var n of Qt(t))Co.call(t,n)&&Nr(e,n,t[n]);return e},sl=(e,t)=>{var n={};for(var s in e)Do.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(e!=null&&Qt)for(var s of Qt(e))t.indexOf(s)<0&&Co.call(e,s)&&(n[s]=e[s]);return n};const ol={size:"md",variant:"filled"},Hn=p.forwardRef((e,t)=>{const n=Ke("ThemeIcon",ol,e),{className:s,size:o,radius:a,variant:i,color:c,children:l,gradient:d,unstyled:h}=n,f=sl(n,["className","size","radius","variant","color","children","gradient","unstyled"]),{classes:g,cx:x}=tl({variant:i,radius:a,color:c,gradient:d},{name:"ThemeIcon",unstyled:h,variant:i,size:o});return F.createElement(Me,rl({className:x(g.root,s),ref:t},f),l)});Hn.displayName="@mantine/core/ThemeIcon";const al=({data:e})=>{const t=L(ua,e);return r.jsxs(r.Fragment,{children:[r.jsx(ki,{data:t,onChange:()=>{}}),r.jsx(Mi,{data:t})]})},il="deleteCharge",cl=()=>{const[{fetching:e},t]=Te(fa),n=p.useCallback(async s=>{const o=`Error deleting charge ID [${s.chargeId}]`,a=`${il}-${s.chargeId}`;R.loading("Deleting charge",{id:a});try{const i=await t(s),c=$e(i,o,a);if(c){if(c.deleteCharge===!1)throw new Error("Unsuccessful deletion");return R.success("Success",{id:a,description:"Charge was deleted"}),c.deleteCharge}}catch(i){console.error(`${o}: ${i}`),R.error("Error",{id:a,description:o,duration:1e5,closeButton:!0})}return!1},[t]);return{fetching:e,deleteCharge:n}},ll="regenerateLedgerRecords",dl=()=>{const[{fetching:e},t]=Te(pa),n=p.useCallback(async s=>{const o="Error regenerating ledger",a=`${ll}-${s.chargeId}`;R.loading("Regenerating Ledger",{id:a});try{const i=await t(s),c=$e(i,o,a,"regenerateLedgerRecords");if(c)return R.success("Success",{id:a,description:"Ledger records were regenerated"}),c.regenerateLedgerRecords}catch(i){console.error(`${o}: ${i}`),R.error("Error",{id:a,description:o,duration:1e5,closeButton:!0})}},[t]);return{fetching:e,regenerateLedgerRecords:n}};function ul({chargeId:e,onChange:t,...n}){const{regenerateLedgerRecords:s}=dl();function o(){s({chargeId:e}).then(t)}return r.jsx(Ue,{content:"Regenerate Ledger",children:r.jsx(on,{onConfirm:o,title:"Are you sure you want to regenerate ledger records?",children:r.jsx(Y,{variant:"outline",size:"icon",...n,className:ys("size-7.5",n.className),children:r.jsx(Yi,{className:"size-5"})})})})}function fl(e){const{mergeSelected:t,toggleMergeSelected:n}=e,[s,o]=p.useState(t?"default":"ghost");return p.useEffect(()=>{o(t?"default":"ghost")},[t]),r.jsx(Ue,{content:"Select for merge",children:r.jsx(Y,{onClick:a=>{a.stopPropagation(),n()},variant:s,className:ys("size-7.5",t?"bg-blue-500 hover:bg-blue-500/90":""),children:r.jsx(Gi,{className:"size-5"})})})}const pl="updateMiscExpense",ml=()=>{const[{fetching:e},t]=Te(ma),n=p.useCallback(async s=>{const o=`Error updating misc expense ID [${s.id}]`,a=`${pl}-${s.id}`;R.loading("Update Misc Expense",{id:a});try{const i=await t(s),c=$e(i,o,a,"updateMiscExpense");if(c)return R.success("Success",{id:a,description:"Misc expense was updated"}),c.updateMiscExpense}catch(i){console.error(`${o}: ${i}`),R.error("Error",{id:a,description:o,duration:1e5,closeButton:!0})}},[t]);return{fetching:e,updateMiscExpense:n}},gl=({onDone:e,data:t})=>{const[n,s]=p.useState(!1),o=L(ga,t),a=an({defaultValues:{amount:o.amount.raw,currency:o.amount.currency,description:o.description,valueDate:new Date(o.valueDate),invoiceDate:o.invoiceDate,creditorId:o.creditor.id,debtorId:o.debtor.id}}),{handleSubmit:i,formState:{dirtyFields:c}}=a,{updateMiscExpense:l,fetching:d}=ml(),h=p.useCallback(async g=>{s(!0),await l({id:o.id,fields:g}),e(),s(!1)},[l,e,o.id]),f=g=>{g&&Object.keys(g).length>0&&h({...g})};return n?r.jsx(it,{className:"flex self-center my-5",color:"dark",size:"xl",variant:"dots"}):r.jsx(vs,{...a,children:r.jsx("form",{onSubmit:i(f),noValidate:!0,children:r.jsxs("div",{className:"px-5 flex flex-col gap-5",children:[r.jsx(_i,{formManager:a,isInsert:!1}),r.jsx("div",{className:"flex justify-right gap-5 mt-5",children:r.jsx("button",{type:"submit",className:"text-white bg-indigo-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-indigo-600 rounded-sm text-lg",disabled:d||Object.keys(c).length===0,children:"Accept"})})]})})})},hl="insertDocument",xl=()=>{const[{fetching:e},t]=Te(ha),n=p.useCallback(async s=>{const o=`Error inserting document to charge ID [${s.record.chargeId}]`,a=hl;R.loading("Adding document",{id:a});try{const i=await t(s),c=$e(i,o,a,"insertDocument");if(c)return R.success("Success",{id:a,description:"Document added"}),c.insertDocument}catch(i){console.error(`${o}: ${i}`),R.error("Error",{id:a,description:o,duration:1e5,closeButton:!0})}},[t]);return{fetching:e,insertDocument:n}},yl=({chargeId:e,onChange:t,closeModal:n})=>{const s=an(),{handleSubmit:o,formState:{dirtyFields:a},setValue:i,watch:c}=s,{insertDocument:l,fetching:d}=xl(),h=g=>{if(g&&Object.keys(g).length>0){if(g.vat){if(!g.amount?.currency){R.error("Error",{description:"Couldn't figure out the currency of the document"});return}g.vat.currency=g.amount.currency}g.documentType??=va.Unprocessed,l({record:{...g,chargeId:e}}).then(()=>t?.()),n?.()}},f=c("amount.currency");return p.useEffect(()=>{i("vat.currency",f)},[i,f]),r.jsx("div",{className:"px-5 w-max h-max justify-items-center",children:r.jsx(vs,{...s,children:r.jsxs("form",{onSubmit:o(h),children:[r.jsx(xa,{cols:5,children:r.jsx(ya,{formManager:s,defaultCurrency:_t.Ils})}),r.jsxs("div",{className:"flex justify-center gap-5 mt-5",children:[r.jsx("button",{type:"submit",className:" text-white bg-indigo-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-indigo-600 rounded-sm text-lg",disabled:d||Object.keys(a).length===0,children:"Accept"}),r.jsx("button",{type:"button",className:" text-white bg-rose-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-rose-600 rounded-sm text-lg",onClick:n,children:"Cancel"})]})]})})})},vl="insertSalaryRecordsFromFile",jl=()=>{const[{fetching:e},t]=Te(ja),n=p.useCallback(async s=>{const o=`Error uploading payroll file to charge ID [${s.chargeId}]`,a=`${vl}-${s.chargeId}`;R.loading("Uploading payroll file",{id:a});try{const i=await t(s),c=$e(i,o,a,"insertSalaryRecordsFromFile");if(c)return R.success("Success",{id:a,description:"Payroll file added"}),c.insertSalaryRecordsFromFile}catch(i){console.error(`${o}: ${i}`),R.error("Error",{id:a,description:o,duration:1e5,closeButton:!0})}return!1},[t]);return{fetching:e,uploadPayrollFile:n}},bl=({chargeId:e,onDone:t})=>{const{fetching:n,uploadPayrollFile:s}=jl(),[o,a]=p.useState(null),i=p.useCallback(async()=>{o&&s({file:o,chargeId:e}).then(t)},[s,t,o,e]);return r.jsxs("div",{className:"px-5 w-max h-max justify-items-center",children:[r.jsx(Ac,{icon:n&&r.jsx(it,{}),value:o,onChange:a,clearable:!0,label:"File Upload"}),r.jsx("div",{className:"flex justify-center gap-5 mt-5",children:r.jsx("button",{type:"submit",className:" text-white bg-indigo-500 border-0 py-2 px-8 focus:outline-hidden hover:bg-indigo-600 rounded-sm text-lg",disabled:n||!o,onClick:i,children:"Accept"})})]})};var Dl=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function It(e,t){var n=Cl(e);if(typeof n.path!="string"){var s=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof s=="string"&&s.length>0?s:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function Cl(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var s=t.split(".").pop().toLowerCase(),o=Dl.get(s);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var Sl=[".DS_Store","Thumbs.db"];function wl(e){return ct(this,void 0,void 0,function(){return lt(this,function(t){return Xt(e)&&_l(e.dataTransfer)?[2,Pl(e.dataTransfer,e.type)]:Il(e)?[2,Ol(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,El(e)]:[2,[]]})})}function _l(e){return Xt(e)}function Il(e){return Xt(e)&&Xt(e.target)}function Xt(e){return typeof e=="object"&&e!==null}function Ol(e){return On(e.target.files).map(function(t){return It(t)})}function El(e){return ct(this,void 0,void 0,function(){var t;return lt(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(s){return s.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(s){return It(s)})]}})})}function Pl(e,t){return ct(this,void 0,void 0,function(){var n,s;return lt(this,function(o){switch(o.label){case 0:return e.items?(n=On(e.items).filter(function(a){return a.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(Al))]):[3,2];case 1:return s=o.sent(),[2,Tr(So(s))];case 2:return[2,Tr(On(e.files).map(function(a){return It(a)}))]}})})}function Tr(e){return e.filter(function(t){return Sl.indexOf(t.name)===-1})}function On(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var s=e[n];t.push(s)}return t}function Al(e){if(typeof e.webkitGetAsEntry!="function")return $r(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?wo(t):$r(e)}function So(e){return e.reduce(function(t,n){return rr(rr([],sr(t),!1),sr(Array.isArray(n)?So(n):[n]),!1)},[])}function $r(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=It(t);return Promise.resolve(n)}function Nl(e){return ct(this,void 0,void 0,function(){return lt(this,function(t){return[2,e.isDirectory?wo(e):Tl(e)]})})}function wo(e){var t=e.createReader();return new Promise(function(n,s){var o=[];function a(){var i=this;t.readEntries(function(c){return ct(i,void 0,void 0,function(){var l,d,h;return lt(this,function(f){switch(f.label){case 0:if(c.length)return[3,5];f.label=1;case 1:return f.trys.push([1,3,,4]),[4,Promise.all(o)];case 2:return l=f.sent(),n(l),[3,4];case 3:return d=f.sent(),s(d),[3,4];case 4:return[3,6];case 5:h=Promise.all(c.map(Nl)),o.push(h),a(),f.label=6;case 6:return[2]}})})},function(c){s(c)})}a()})}function Tl(e){return ct(this,void 0,void 0,function(){return lt(this,function(t){return[2,new Promise(function(n,s){e.file(function(o){var a=It(o,e.fullPath);n(a)},function(o){s(o)})})]})})}var kt={},Fr;function $l(){return Fr||(Fr=1,kt.__esModule=!0,kt.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var s=e.name||"",o=(e.type||"").toLowerCase(),a=o.replace(/\/.*$/,"");return n.some(function(i){var c=i.trim().toLowerCase();return c.charAt(0)==="."?s.toLowerCase().endsWith(c):c.endsWith("/*")?a===c.replace(/\/.*$/,""):o===c})}return!0}),kt}var Fl=$l();const kl=ba(Fl);function kr(e){return zl(e)||Rl(e)||Io(e)||Ml()}function Ml(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rl(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function zl(e){if(Array.isArray(e))return En(e)}function Mr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,s)}return n}function Rr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Mr(Object(n),!0).forEach(function(s){_o(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mr(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function _o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dt(e,t){return Vl(e)||Bl(e,t)||Io(e,t)||Ll()}function Ll(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Io(e,t){if(e){if(typeof e=="string")return En(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return En(e,t)}}function En(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n<t;n++)s[n]=e[n];return s}function Bl(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var s=[],o=!0,a=!1,i,c;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(s.push(i.value),!(t&&s.length===t));o=!0);}catch(l){a=!0,c=l}finally{try{!o&&n.return!=null&&n.return()}finally{if(a)throw c}}return s}}function Vl(e){if(Array.isArray(e))return e}var Hl="file-invalid-type",Ul="file-too-large",Kl="file-too-small",Gl="too-many-files",ql=function(t){t=Array.isArray(t)&&t.length===1?t[0]:t;var n=Array.isArray(t)?"one of ".concat(t.join(", ")):t;return{code:Hl,message:"File type must be ".concat(n)}},zr=function(t){return{code:Ul,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},Lr=function(t){return{code:Kl,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},Wl={code:Gl,message:"Too many files"};function Oo(e,t){var n=e.type==="application/x-moz-file"||kl(e,t);return[n,n?null:ql(t)]}function Eo(e,t,n){if(et(e.size))if(et(t)&&et(n)){if(e.size>n)return[!1,zr(n)];if(e.size<t)return[!1,Lr(t)]}else{if(et(t)&&e.size<t)return[!1,Lr(t)];if(et(n)&&e.size>n)return[!1,zr(n)]}return[!0,null]}function et(e){return e!=null}function Yl(e){var t=e.files,n=e.accept,s=e.minSize,o=e.maxSize,a=e.multiple,i=e.maxFiles,c=e.validator;return!a&&t.length>1||a&&i>=1&&t.length>i?!1:t.every(function(l){var d=Oo(l,n),h=Dt(d,1),f=h[0],g=Eo(l,s,o),x=Dt(g,1),u=x[0],m=c?c(l):null;return f&&u&&!m})}function Jt(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Mt(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function Br(e){e.preventDefault()}function Ql(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function Xl(e){return e.indexOf("Edge/")!==-1}function Jl(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return Ql(e)||Xl(e)}function Fe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(s){for(var o=arguments.length,a=new Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=arguments[i];return t.some(function(c){return!Jt(s)&&c&&c.apply(void 0,[s].concat(a)),Jt(s)})}}function Zl(){return"showOpenFilePicker"in window}function ed(e){if(et(e)){var t=Object.entries(e).filter(function(n){var s=Dt(n,2),o=s[0],a=s[1],i=!0;return Po(o)||(console.warn('Skipped "'.concat(o,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),i=!1),(!Array.isArray(a)||!a.every(Ao))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),i=!1),i}).reduce(function(n,s){var o=Dt(s,2),a=o[0],i=o[1];return Rr(Rr({},n),{},_o({},a,i))},{});return[{description:"Files",accept:t}]}return e}function td(e){if(et(e))return Object.entries(e).reduce(function(t,n){var s=Dt(n,2),o=s[0],a=s[1];return[].concat(kr(t),[o],kr(a))},[]).filter(function(t){return Po(t)||Ao(t)}).join(",")}function nd(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function rd(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function Po(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function Ao(e){return/^.*\.[\w]+$/.test(e)}var sd=["children"],od=["open"],ad=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],id=["refKey","onChange","onClick"];function cd(e){return ud(e)||dd(e)||No(e)||ld()}function ld(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
4
4
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dd(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ud(e){if(Array.isArray(e))return Pn(e)}function jn(e,t){return md(e)||pd(e,t)||No(e,t)||fd()}function fd(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,ah as T,R,p as k,af as B,B as C,a8 as se,r as i,D as z,aL as H,x as _,al as $,am as q,an as J,a2 as S,ao as w,ap as I,aq as L,ar as M,as as x,bJ as te,bK as ae,bL as ne,w as O,u as Q,bM as le,aJ as ie,E as re,H as ce,c as X,V as oe,bN as de,bO as Y,bP as Z,bQ as b,bR as f,bS as W,bT as g,bU as ue,bV as me,a4 as xe,bW as he,bX as ge,a6 as G,aK as je,bY as pe,bZ as fe,b_ as Ce,b$ as ve,c0 as De,c1 as Ne,c2 as E,P as ye,c3 as Se,c4 as be,c5 as we,c6 as Ie,c7 as Le,aC as Me,b as Fe,c8 as Ae}from"./index-llwTvhRi.js";import{M as Re,s as Te,a as Ve}from"./modify-contract-dialog-DNQYpsqS.js";import{D as m}from"./data-table-column-header-_ZrN0Vs6.js";import{F as Pe}from"./funnel-DrbTHWGk.js";import{u as ke,a as Be}from"./use-issue-monthly-documents-pV0tTZGQ.js";import{s as Oe}from"./subMonths-Ft6EDjKW.js";import"./eye-off-DPLQFIHz.js";const U=({timelessDate:s})=>e.jsx("p",{className:"text-sm font-medium",children:new Date(s).toLocaleDateString(void 0,{timeZone:"UTC"})});function Ee({id:s,name:t}){return e.jsx("div",{className:"flex flex-wrap flex-col justify-center",children:e.jsx(T,{to:R.BUSINESSES.DETAIL(s),target:"_blank",rel:"noreferrer",onClick:r=>r.stopPropagation(),className:"inline-flex items-center font-semibold",children:t})})}const K=[{id:"select",header:({table:s})=>e.jsx(k,{checked:s.getIsAllPageRowsSelected()||s.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:t=>s.toggleAllPageRowsSelected(!!t),"aria-label":"Select all"}),cell:({row:s})=>e.jsx(k,{checked:s.getIsSelected(),onCheckedChange:t=>s.toggleSelected(!!t),"aria-label":"Select row"}),enableSorting:!1,enableHiding:!1},{accessorKey:"isActive",header:({column:s})=>e.jsx(m,{column:s,title:"Is Active"}),cell:({row:s})=>s.getValue("isActive")?e.jsx(B,{variant:"default",children:"Active"}):e.jsx(B,{variant:"destructive",children:"Inactive"})},{accessorKey:"client.name",header:({column:s})=>e.jsx(m,{column:s,title:"Client"}),cell:({row:s})=>e.jsx(Ee,{id:s.original.client.id,name:s.original.client.name})},{accessorKey:"startDate",header:({column:s})=>e.jsx(m,{column:s,title:"Start"}),cell:({row:s})=>e.jsx(U,{timelessDate:s.getValue("startDate")})},{accessorKey:"endDate",header:({column:s})=>e.jsx(m,{column:s,title:"End"}),cell:({row:s})=>e.jsx(U,{timelessDate:s.getValue("endDate")})},{accessorKey:"purchaseOrder",header:({column:s})=>e.jsx(m,{column:s,title:"Purchase Order"}),cell:({row:s})=>e.jsxs("div",{className:"flex flex-row gap-1 items-center",children:[s.original.msCloud&&e.jsx(T,{to:s.original.msCloud,target:"_blank",rel:"noreferrer",className:"size-8",children:e.jsx(C,{variant:"link",size:"sm",children:e.jsx(se,{className:"size-4"})})}),e.jsx("span",{className:"text-sm font-medium",children:s.getValue("purchaseOrder")})]})},{accessorKey:"product",header:({column:s})=>e.jsx(m,{column:s,title:"Product"}),cell:({row:s})=>e.jsx("p",{className:"text-sm font-medium",children:s.getValue("product")})},{accessorKey:"plan",header:({column:s})=>e.jsx(m,{column:s,title:"Subscription Plan"}),cell:({row:s})=>e.jsx("p",{className:"text-sm font-medium",children:s.getValue("plan")})},{accessorKey:"billingCycle",header:({column:s})=>e.jsx(m,{column:s,title:"Billing Cycle"}),cell:({row:s})=>e.jsx("p",{className:"text-sm font-medium",children:s.getValue("billingCycle")})},{accessorKey:"amount.raw",header:({column:s})=>e.jsx(m,{column:s,title:"Amount"}),cell:({row:s})=>e.jsx("p",{className:"text-sm font-medium",children:s.original.amount.formatted})},{accessorKey:"operationsLimit",header:({column:s})=>e.jsx(m,{column:s,title:"Operations Limit"}),cell:({row:s})=>{const t=s.getValue("operationsLimit");return t?e.jsx("p",{className:"text-sm font-medium",children:t.toString()}):null}},{accessorKey:"edit",header:"",cell:({row:s})=>e.jsx(Re,{clientId:s.original.client.id,contractId:s.original.id}),enableSorting:!1}];function Ue({table:s}){const[t,r]=i.useState(!1);return e.jsxs(z,{open:t,onOpenChange:r,children:[e.jsx(H,{asChild:!0,children:e.jsx(C,{size:"sm",variant:"outline",children:e.jsx(Pe,{className:"size-4"})})}),e.jsxs(_,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[e.jsxs($,{children:[e.jsx(q,{children:"Filter Contracts"}),e.jsx(J,{children:"Filter contracts based on various criteria"})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{children:"Product Type"}),e.jsxs(w,{onValueChange:a=>s.getColumn("product")?.setFilterValue(a==="NULL"?void 0:a),value:s.getColumn("product")?.getFilterValue(),children:[e.jsx(I,{className:"w-full",children:e.jsx(L,{})}),e.jsxs(M,{children:[e.jsx(x,{value:"NULL",className:"font-light text-xs",children:"(None)"}),Object.values(te).map(a=>e.jsx(x,{value:a,children:a},a))]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{children:"Billing Cycle"}),e.jsxs(w,{onValueChange:a=>s.getColumn("billingCycle")?.setFilterValue(a==="NULL"?void 0:a),value:s.getColumn("billingCycle")?.getFilterValue(),children:[e.jsx(I,{className:"w-full",children:e.jsx(L,{})}),e.jsxs(M,{children:[e.jsx(x,{value:"NULL",className:"font-light text-xs",children:"(None)"}),Object.values(ae).map(a=>e.jsx(x,{value:a,children:Te(a)},a))]})]})]})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{children:"Subscription Plan"}),e.jsxs(w,{onValueChange:a=>s.getColumn("plan")?.setFilterValue(a==="NULL"?void 0:a),value:s.getColumn("plan")?.getFilterValue(),children:[e.jsx(I,{className:"w-full",children:e.jsx(L,{})}),e.jsxs(M,{children:[e.jsx(x,{value:"NULL",className:"font-light text-xs",children:"(None)"}),Object.values(ne).map(a=>e.jsx(x,{value:a,children:Ve(a)},a))]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{children:"Is Active"}),e.jsxs(w,{onValueChange:a=>s.getColumn("isActive")?.setFilterValue(a==="NULL"?void 0:a==="active"),value:Ke(s.getColumn("isActive")?.getFilterValue()),children:[e.jsx(I,{className:"w-full",children:e.jsx(L,{})}),e.jsxs(M,{children:[e.jsx(x,{value:"NULL",className:"font-light text-xs",children:"(None)"}),e.jsx(x,{value:"active",children:"Active"}),e.jsx(x,{value:"inactive",children:"Inactive"})]})]})]})]})]})]})]})}function Ke(s){return s===void 0?"NULL":s?"active":"inactive"}const ze=({contractIds:s})=>{const[t,r]=i.useState(!1),[a,v]=i.useState(O(Oe(new Date,1),"yyyy-MM-dd")),[h,D]=i.useState([]),{issueDocuments:j}=ke(),[{data:N,fetching:y},c]=Q({query:le,variables:{issueMonth:a,contractIds:s},pause:!t});i.useEffect(()=>{N?.periodicalDocumentDraftsByContracts&&D(N.periodicalDocumentDraftsByContracts.map(u=>ie(G(je,u))))},[N,D]),i.useEffect(()=>{t&&c()},[t,c]);const n=re({values:{drafts:h}}),l=i.useCallback(async u=>{await j({generateDocumentsInfo:u.drafts}),r(!1)},[j]),{fields:d,remove:F,update:ee}=ce({control:n.control,name:"drafts"}),V=n.watch("drafts"),P=i.useMemo(()=>d.map((u,o)=>({...u,...V[o],id:u.id})),[d,V]);return e.jsxs(z,{open:t,onOpenChange:r,children:[e.jsx(H,{asChild:!0,children:e.jsx(C,{size:"sm",variant:"outline",disabled:s.length===0,children:"Issue Documents"})}),e.jsxs(_,{className:"min-w-[90vw] w-full max-h-[90vh] overflow-y-auto",children:[e.jsxs($,{children:[e.jsx(q,{children:"Issue Documents for Contracts"}),e.jsx(J,{children:"Review and issue monthly documents for the selected contracts"})]}),y?e.jsx(X,{}):e.jsx(oe,{...n,children:e.jsxs("form",{onSubmit:n.handleSubmit(l),className:"min-w-5xl w-full",children:[e.jsxs("div",{className:"flex gap-2 items-center mb-4",children:[e.jsx(S,{children:"Issue Month:"}),e.jsx(de,{value:new Date(a),onChange:u=>{const o=new Date(u.getFullYear(),u.getMonth(),15);v(O(o,"yyyy-MM-dd"))},popoverProps:{withinPortal:!1}})]}),e.jsxs(Y,{children:[e.jsx(Z,{children:e.jsxs(b,{children:[e.jsx(f,{children:"Name"}),e.jsx(f,{children:"Document"}),e.jsx(f,{children:"Amount"}),e.jsx(f,{children:"Remark"}),e.jsx(f,{children:"Recipients"}),e.jsx(f,{})]})}),e.jsx(W,{children:P.map(({id:u,...o},A)=>e.jsxs(b,{children:[e.jsx(g,{children:e.jsx(T,{to:o.client?.id?R.BUSINESSES.DETAIL(o.client?.id):R.BUSINESSES.ALL,target:"_blank",rel:"noreferrer",onClick:p=>p.stopPropagation(),className:"inline-flex items-center font-semibold",children:o.client?.name})}),e.jsx(g,{children:o.type}),e.jsxs(g,{children:[o.income?.[0]?.price," ",o.income?.[0]?.currency]}),e.jsx(g,{children:e.jsx("span",{className:"text-sm text-gray-500 whitespace-normal max-w-50",children:o.remarks})}),e.jsx(g,{children:e.jsx("div",{className:"flex flex-col",children:o.client?.emails?.map(p=>e.jsx("span",{className:"text-sm text-gray-500",children:p},p))})}),e.jsx(g,{children:e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs(ue,{children:[e.jsx(me,{asChild:!0,type:"button",children:e.jsx(C,{className:"size-7.5",variant:"secondary",onClick:()=>F(A),children:e.jsx(xe,{size:16})})}),e.jsx(he,{children:e.jsx("p",{children:"Remove document"})})]}),e.jsx(Be,{draft:o,onApprove:p=>{n.setValue(`drafts.${A}`,p,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),ee(A,{...p})}})]})})]},u))})]}),e.jsx("div",{className:"flex justify-between items-center mt-4",children:e.jsx(ge,{onConfirm:n.handleSubmit(l),title:`Are you sure you want to issue ${P.length} documents?`,children:e.jsx(C,{children:"Issue"})})})]})})]})]})};function He(s){const t=G(Le,s);return{id:t.id,isActive:t.isActive,client:{id:t.client.id,name:t.client.originalBusiness.name},purchaseOrder:t.purchaseOrders[0],startDate:t.startDate,endDate:t.endDate,amount:{raw:t.amount.raw,formatted:t.amount.formatted},billingCycle:t.billingCycle,product:t.product??void 0,plan:t.plan??void 0,operationsLimit:t.operationsLimit,msCloud:t.msCloud?.toString()??void 0}}const _e=({data:s})=>{const[t,r]=i.useState([{id:"endDate",desc:!0},{id:"amount.raw",desc:!0}]),[a,v]=i.useState({}),[h,D]=i.useState([]),[j,N]=i.useState([]),y=i.useMemo(()=>s.map(n=>He(n)),[s]),c=pe({data:y,columns:K,getCoreRowModel:Ie(),onSortingChange:r,getSortedRowModel:we(),getPaginationRowModel:be(),onRowSelectionChange:v,onColumnFiltersChange:D,getFilteredRowModel:Se(),state:{sorting:t,rowSelection:a,columnFilters:h},initialState:{pagination:{pageIndex:0,pageSize:50}}});return i.useEffect(()=>{const n=Object.entries(a).filter(([,d])=>!!d).map(([d])=>Number(d)),l=Array.from(new Set(y.filter((d,F)=>n.includes(F)).map(d=>d.id)));(j.length!==l.length||!j.every(d=>l.includes(d)))&&N(l)},[a,y,j,h]),e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:"flex items-center py-4 gap-4",children:[e.jsx(Ue,{table:c}),e.jsxs(fe,{children:[e.jsx(Ce,{asChild:!0,children:e.jsxs(C,{variant:"outline",children:["Columns ",e.jsx(ve,{})]})}),e.jsx(De,{align:"end",children:c.getAllColumns().filter(n=>n.getCanHide()).map(n=>e.jsx(Ne,{className:"capitalize",checked:n.getIsVisible(),onCheckedChange:l=>n.toggleVisibility(!!l),children:n.id},n.id))})]}),e.jsx("div",{className:"ml-auto",children:e.jsx(ze,{contractIds:j,className:"ml-auto"})})]}),e.jsx("div",{className:"overflow-hidden rounded-md border",children:e.jsxs(Y,{children:[e.jsx(Z,{children:c.getHeaderGroups().map(n=>e.jsx(b,{children:n.headers.map(l=>e.jsx(f,{colSpan:l.colSpan,children:l.isPlaceholder?null:E(l.column.columnDef.header,l.getContext())},l.id))},n.id))}),e.jsx(W,{children:c.getRowModel().rows?.length?c.getRowModel().rows.map(n=>e.jsx(b,{children:n.getVisibleCells().map(l=>e.jsx(g,{children:E(l.column.columnDef.cell,l.getContext())},l.id))},n.id)):e.jsx(b,{children:e.jsx(g,{colSpan:K.length,className:"h-24 text-center",children:"No results."})})})]})}),e.jsxs("div",{className:"flex items-center justify-end space-x-2 py-4",children:[e.jsxs("div",{className:"text-muted-foreground flex-1 text-sm",children:[c.getFilteredSelectedRowModel().rows.length," of"," ",c.getFilteredRowModel().rows.length," row(s) selected."]}),e.jsx(ye,{className:"w-fit mx-0",currentPageIndex:c.getState().pagination.pageIndex,totalPages:c.getPageCount(),onChange:n=>c.setPageIndex(n)})]})]})},We=()=>{const{userContext:s}=i.useContext(Me),t=s?.context.adminBusinessId;let r;try{r=Fe()}catch{}const[{data:a,fetching:v}]=Q({query:Ae,pause:!t||!!r,variables:{adminId:t??""}}),h=r||a;return!r&&v&&!h?.contractsByAdmin?e.jsx(X,{}):!t||!h?.contractsByAdmin?e.jsx("div",{children:"Contracts not found"}):e.jsx(_e,{data:h.contractsByAdmin})};export{We as ContractsScreen};
|
|
1
|
+
import{j as e,ah as T,R,p as k,af as B,B as C,a8 as se,r as i,D as z,aL as H,x as _,al as $,am as q,an as J,a2 as S,ao as w,ap as I,aq as L,ar as M,as as x,bJ as te,bK as ae,bL as ne,w as O,u as Q,bM as le,aJ as ie,E as re,H as ce,c as X,V as oe,bN as de,bO as Y,bP as Z,bQ as b,bR as f,bS as W,bT as g,bU as ue,bV as me,a4 as xe,bW as he,bX as ge,a6 as G,aK as je,bY as pe,bZ as fe,b_ as Ce,b$ as ve,c0 as De,c1 as Ne,c2 as E,P as ye,c3 as Se,c4 as be,c5 as we,c6 as Ie,c7 as Le,aC as Me,b as Fe,c8 as Ae}from"./index-D1_HHRLX.js";import{M as Re,s as Te,a as Ve}from"./modify-contract-dialog-BBPR_IL8.js";import{D as m}from"./data-table-column-header--gzXkv5r.js";import{F as Pe}from"./funnel-0IvwyZBf.js";import{u as ke,a as Be}from"./use-issue-monthly-documents-CdxtNiuP.js";import{s as Oe}from"./subMonths-nC9-M0qS.js";import"./eye-off-DWYC0Eax.js";const U=({timelessDate:s})=>e.jsx("p",{className:"text-sm font-medium",children:new Date(s).toLocaleDateString(void 0,{timeZone:"UTC"})});function Ee({id:s,name:t}){return e.jsx("div",{className:"flex flex-wrap flex-col justify-center",children:e.jsx(T,{to:R.BUSINESSES.DETAIL(s),target:"_blank",rel:"noreferrer",onClick:r=>r.stopPropagation(),className:"inline-flex items-center font-semibold",children:t})})}const K=[{id:"select",header:({table:s})=>e.jsx(k,{checked:s.getIsAllPageRowsSelected()||s.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:t=>s.toggleAllPageRowsSelected(!!t),"aria-label":"Select all"}),cell:({row:s})=>e.jsx(k,{checked:s.getIsSelected(),onCheckedChange:t=>s.toggleSelected(!!t),"aria-label":"Select row"}),enableSorting:!1,enableHiding:!1},{accessorKey:"isActive",header:({column:s})=>e.jsx(m,{column:s,title:"Is Active"}),cell:({row:s})=>s.getValue("isActive")?e.jsx(B,{variant:"default",children:"Active"}):e.jsx(B,{variant:"destructive",children:"Inactive"})},{accessorKey:"client.name",header:({column:s})=>e.jsx(m,{column:s,title:"Client"}),cell:({row:s})=>e.jsx(Ee,{id:s.original.client.id,name:s.original.client.name})},{accessorKey:"startDate",header:({column:s})=>e.jsx(m,{column:s,title:"Start"}),cell:({row:s})=>e.jsx(U,{timelessDate:s.getValue("startDate")})},{accessorKey:"endDate",header:({column:s})=>e.jsx(m,{column:s,title:"End"}),cell:({row:s})=>e.jsx(U,{timelessDate:s.getValue("endDate")})},{accessorKey:"purchaseOrder",header:({column:s})=>e.jsx(m,{column:s,title:"Purchase Order"}),cell:({row:s})=>e.jsxs("div",{className:"flex flex-row gap-1 items-center",children:[s.original.msCloud&&e.jsx(T,{to:s.original.msCloud,target:"_blank",rel:"noreferrer",className:"size-8",children:e.jsx(C,{variant:"link",size:"sm",children:e.jsx(se,{className:"size-4"})})}),e.jsx("span",{className:"text-sm font-medium",children:s.getValue("purchaseOrder")})]})},{accessorKey:"product",header:({column:s})=>e.jsx(m,{column:s,title:"Product"}),cell:({row:s})=>e.jsx("p",{className:"text-sm font-medium",children:s.getValue("product")})},{accessorKey:"plan",header:({column:s})=>e.jsx(m,{column:s,title:"Subscription Plan"}),cell:({row:s})=>e.jsx("p",{className:"text-sm font-medium",children:s.getValue("plan")})},{accessorKey:"billingCycle",header:({column:s})=>e.jsx(m,{column:s,title:"Billing Cycle"}),cell:({row:s})=>e.jsx("p",{className:"text-sm font-medium",children:s.getValue("billingCycle")})},{accessorKey:"amount.raw",header:({column:s})=>e.jsx(m,{column:s,title:"Amount"}),cell:({row:s})=>e.jsx("p",{className:"text-sm font-medium",children:s.original.amount.formatted})},{accessorKey:"operationsLimit",header:({column:s})=>e.jsx(m,{column:s,title:"Operations Limit"}),cell:({row:s})=>{const t=s.getValue("operationsLimit");return t?e.jsx("p",{className:"text-sm font-medium",children:t.toString()}):null}},{accessorKey:"edit",header:"",cell:({row:s})=>e.jsx(Re,{clientId:s.original.client.id,contractId:s.original.id}),enableSorting:!1}];function Ue({table:s}){const[t,r]=i.useState(!1);return e.jsxs(z,{open:t,onOpenChange:r,children:[e.jsx(H,{asChild:!0,children:e.jsx(C,{size:"sm",variant:"outline",children:e.jsx(Pe,{className:"size-4"})})}),e.jsxs(_,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[e.jsxs($,{children:[e.jsx(q,{children:"Filter Contracts"}),e.jsx(J,{children:"Filter contracts based on various criteria"})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{children:"Product Type"}),e.jsxs(w,{onValueChange:a=>s.getColumn("product")?.setFilterValue(a==="NULL"?void 0:a),value:s.getColumn("product")?.getFilterValue(),children:[e.jsx(I,{className:"w-full",children:e.jsx(L,{})}),e.jsxs(M,{children:[e.jsx(x,{value:"NULL",className:"font-light text-xs",children:"(None)"}),Object.values(te).map(a=>e.jsx(x,{value:a,children:a},a))]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{children:"Billing Cycle"}),e.jsxs(w,{onValueChange:a=>s.getColumn("billingCycle")?.setFilterValue(a==="NULL"?void 0:a),value:s.getColumn("billingCycle")?.getFilterValue(),children:[e.jsx(I,{className:"w-full",children:e.jsx(L,{})}),e.jsxs(M,{children:[e.jsx(x,{value:"NULL",className:"font-light text-xs",children:"(None)"}),Object.values(ae).map(a=>e.jsx(x,{value:a,children:Te(a)},a))]})]})]})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{children:"Subscription Plan"}),e.jsxs(w,{onValueChange:a=>s.getColumn("plan")?.setFilterValue(a==="NULL"?void 0:a),value:s.getColumn("plan")?.getFilterValue(),children:[e.jsx(I,{className:"w-full",children:e.jsx(L,{})}),e.jsxs(M,{children:[e.jsx(x,{value:"NULL",className:"font-light text-xs",children:"(None)"}),Object.values(ne).map(a=>e.jsx(x,{value:a,children:Ve(a)},a))]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{children:"Is Active"}),e.jsxs(w,{onValueChange:a=>s.getColumn("isActive")?.setFilterValue(a==="NULL"?void 0:a==="active"),value:Ke(s.getColumn("isActive")?.getFilterValue()),children:[e.jsx(I,{className:"w-full",children:e.jsx(L,{})}),e.jsxs(M,{children:[e.jsx(x,{value:"NULL",className:"font-light text-xs",children:"(None)"}),e.jsx(x,{value:"active",children:"Active"}),e.jsx(x,{value:"inactive",children:"Inactive"})]})]})]})]})]})]})]})}function Ke(s){return s===void 0?"NULL":s?"active":"inactive"}const ze=({contractIds:s})=>{const[t,r]=i.useState(!1),[a,v]=i.useState(O(Oe(new Date,1),"yyyy-MM-dd")),[h,D]=i.useState([]),{issueDocuments:j}=ke(),[{data:N,fetching:y},c]=Q({query:le,variables:{issueMonth:a,contractIds:s},pause:!t});i.useEffect(()=>{N?.periodicalDocumentDraftsByContracts&&D(N.periodicalDocumentDraftsByContracts.map(u=>ie(G(je,u))))},[N,D]),i.useEffect(()=>{t&&c()},[t,c]);const n=re({values:{drafts:h}}),l=i.useCallback(async u=>{await j({generateDocumentsInfo:u.drafts}),r(!1)},[j]),{fields:d,remove:F,update:ee}=ce({control:n.control,name:"drafts"}),V=n.watch("drafts"),P=i.useMemo(()=>d.map((u,o)=>({...u,...V[o],id:u.id})),[d,V]);return e.jsxs(z,{open:t,onOpenChange:r,children:[e.jsx(H,{asChild:!0,children:e.jsx(C,{size:"sm",variant:"outline",disabled:s.length===0,children:"Issue Documents"})}),e.jsxs(_,{className:"min-w-[90vw] w-full max-h-[90vh] overflow-y-auto",children:[e.jsxs($,{children:[e.jsx(q,{children:"Issue Documents for Contracts"}),e.jsx(J,{children:"Review and issue monthly documents for the selected contracts"})]}),y?e.jsx(X,{}):e.jsx(oe,{...n,children:e.jsxs("form",{onSubmit:n.handleSubmit(l),className:"min-w-5xl w-full",children:[e.jsxs("div",{className:"flex gap-2 items-center mb-4",children:[e.jsx(S,{children:"Issue Month:"}),e.jsx(de,{value:new Date(a),onChange:u=>{const o=new Date(u.getFullYear(),u.getMonth(),15);v(O(o,"yyyy-MM-dd"))},popoverProps:{withinPortal:!1}})]}),e.jsxs(Y,{children:[e.jsx(Z,{children:e.jsxs(b,{children:[e.jsx(f,{children:"Name"}),e.jsx(f,{children:"Document"}),e.jsx(f,{children:"Amount"}),e.jsx(f,{children:"Remark"}),e.jsx(f,{children:"Recipients"}),e.jsx(f,{})]})}),e.jsx(W,{children:P.map(({id:u,...o},A)=>e.jsxs(b,{children:[e.jsx(g,{children:e.jsx(T,{to:o.client?.id?R.BUSINESSES.DETAIL(o.client?.id):R.BUSINESSES.ALL,target:"_blank",rel:"noreferrer",onClick:p=>p.stopPropagation(),className:"inline-flex items-center font-semibold",children:o.client?.name})}),e.jsx(g,{children:o.type}),e.jsxs(g,{children:[o.income?.[0]?.price," ",o.income?.[0]?.currency]}),e.jsx(g,{children:e.jsx("span",{className:"text-sm text-gray-500 whitespace-normal max-w-50",children:o.remarks})}),e.jsx(g,{children:e.jsx("div",{className:"flex flex-col",children:o.client?.emails?.map(p=>e.jsx("span",{className:"text-sm text-gray-500",children:p},p))})}),e.jsx(g,{children:e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs(ue,{children:[e.jsx(me,{asChild:!0,type:"button",children:e.jsx(C,{className:"size-7.5",variant:"secondary",onClick:()=>F(A),children:e.jsx(xe,{size:16})})}),e.jsx(he,{children:e.jsx("p",{children:"Remove document"})})]}),e.jsx(Be,{draft:o,onApprove:p=>{n.setValue(`drafts.${A}`,p,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),ee(A,{...p})}})]})})]},u))})]}),e.jsx("div",{className:"flex justify-between items-center mt-4",children:e.jsx(ge,{onConfirm:n.handleSubmit(l),title:`Are you sure you want to issue ${P.length} documents?`,children:e.jsx(C,{children:"Issue"})})})]})})]})]})};function He(s){const t=G(Le,s);return{id:t.id,isActive:t.isActive,client:{id:t.client.id,name:t.client.originalBusiness.name},purchaseOrder:t.purchaseOrders[0],startDate:t.startDate,endDate:t.endDate,amount:{raw:t.amount.raw,formatted:t.amount.formatted},billingCycle:t.billingCycle,product:t.product??void 0,plan:t.plan??void 0,operationsLimit:t.operationsLimit,msCloud:t.msCloud?.toString()??void 0}}const _e=({data:s})=>{const[t,r]=i.useState([{id:"endDate",desc:!0},{id:"amount.raw",desc:!0}]),[a,v]=i.useState({}),[h,D]=i.useState([]),[j,N]=i.useState([]),y=i.useMemo(()=>s.map(n=>He(n)),[s]),c=pe({data:y,columns:K,getCoreRowModel:Ie(),onSortingChange:r,getSortedRowModel:we(),getPaginationRowModel:be(),onRowSelectionChange:v,onColumnFiltersChange:D,getFilteredRowModel:Se(),state:{sorting:t,rowSelection:a,columnFilters:h},initialState:{pagination:{pageIndex:0,pageSize:50}}});return i.useEffect(()=>{const n=Object.entries(a).filter(([,d])=>!!d).map(([d])=>Number(d)),l=Array.from(new Set(y.filter((d,F)=>n.includes(F)).map(d=>d.id)));(j.length!==l.length||!j.every(d=>l.includes(d)))&&N(l)},[a,y,j,h]),e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:"flex items-center py-4 gap-4",children:[e.jsx(Ue,{table:c}),e.jsxs(fe,{children:[e.jsx(Ce,{asChild:!0,children:e.jsxs(C,{variant:"outline",children:["Columns ",e.jsx(ve,{})]})}),e.jsx(De,{align:"end",children:c.getAllColumns().filter(n=>n.getCanHide()).map(n=>e.jsx(Ne,{className:"capitalize",checked:n.getIsVisible(),onCheckedChange:l=>n.toggleVisibility(!!l),children:n.id},n.id))})]}),e.jsx("div",{className:"ml-auto",children:e.jsx(ze,{contractIds:j,className:"ml-auto"})})]}),e.jsx("div",{className:"overflow-hidden rounded-md border",children:e.jsxs(Y,{children:[e.jsx(Z,{children:c.getHeaderGroups().map(n=>e.jsx(b,{children:n.headers.map(l=>e.jsx(f,{colSpan:l.colSpan,children:l.isPlaceholder?null:E(l.column.columnDef.header,l.getContext())},l.id))},n.id))}),e.jsx(W,{children:c.getRowModel().rows?.length?c.getRowModel().rows.map(n=>e.jsx(b,{children:n.getVisibleCells().map(l=>e.jsx(g,{children:E(l.column.columnDef.cell,l.getContext())},l.id))},n.id)):e.jsx(b,{children:e.jsx(g,{colSpan:K.length,className:"h-24 text-center",children:"No results."})})})]})}),e.jsxs("div",{className:"flex items-center justify-end space-x-2 py-4",children:[e.jsxs("div",{className:"text-muted-foreground flex-1 text-sm",children:[c.getFilteredSelectedRowModel().rows.length," of"," ",c.getFilteredRowModel().rows.length," row(s) selected."]}),e.jsx(ye,{className:"w-fit mx-0",currentPageIndex:c.getState().pagination.pageIndex,totalPages:c.getPageCount(),onChange:n=>c.setPageIndex(n)})]})]})},We=()=>{const{userContext:s}=i.useContext(Me),t=s?.context.adminBusinessId;let r;try{r=Fe()}catch{}const[{data:a,fetching:v}]=Q({query:Ae,pause:!t||!!r,variables:{adminId:t??""}}),h=r||a;return!r&&v&&!h?.contractsByAdmin?e.jsx(X,{}):!t||!h?.contractsByAdmin?e.jsx("div",{children:"Contracts not found"}):e.jsx(_e,{data:h.contractsByAdmin})};export{We as ContractsScreen};
|
package/dist/assets/{data-table-column-header-_ZrN0Vs6.js → data-table-column-header--gzXkv5r.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{v as o,j as e,m as a,bZ as c,b_ as h,B as p,c0 as x,dU as n,dT as l}from"./index-
|
|
1
|
+
import{v as o,j as e,m as a,bZ as c,b_ as h,B as p,c0 as x,dU as n,dT as l}from"./index-D1_HHRLX.js";import{E as g}from"./eye-off-DWYC0Eax.js";const j=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],d=o("arrow-down",j);const w=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],i=o("arrow-up",w);const m=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],u=o("chevrons-up-down",m);function k({column:s,title:r,className:t}){return s.getCanSort()?e.jsx("div",{className:a("flex items-center gap-2",t),children:e.jsxs(c,{children:[e.jsx(h,{asChild:!0,children:e.jsxs(p,{variant:"ghost",size:"sm",className:"data-[state=open]:bg-accent -ml-3 h-8",children:[e.jsx("span",{children:r}),s.getIsSorted()==="desc"?e.jsx(d,{}):s.getIsSorted()==="asc"?e.jsx(i,{}):e.jsx(u,{})]})}),e.jsxs(x,{align:"start",children:[e.jsxs(n,{onClick:()=>s.toggleSorting(!1),children:[e.jsx(i,{}),"Asc"]}),e.jsxs(n,{onClick:()=>s.toggleSorting(!0),children:[e.jsx(d,{}),"Desc"]}),e.jsx(l,{}),e.jsxs(n,{onClick:()=>s.toggleVisibility(!1),children:[e.jsx(g,{}),"Hide"]})]})]})}):e.jsx("div",{className:a(t),children:r})}export{k as D};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{v as t,j as e,ao as i,ap as c,aq as o,ar as l,as as r,B as n,gX as x,gh as d}from"./index-
|
|
1
|
+
import{v as t,j as e,ao as i,ap as c,aq as o,ar as l,as as r,B as n,gX as x,gh as d}from"./index-D1_HHRLX.js";const g=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],h=t("chevrons-left",g);const p=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],m=t("chevrons-right",p);function u({table:s}){return e.jsxs("div",{className:"flex items-center space-x-6 lg:space-x-8",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("p",{className:"text-sm font-medium",children:"Rows per page"}),e.jsxs(i,{value:String(s.getState().pagination.pageSize),onValueChange:a=>{s.setPageSize(Number(a))},children:[e.jsx(c,{className:"h-8 w-[70px]",children:e.jsx(o,{placeholder:s.getState().pagination.pageSize})}),e.jsx(l,{side:"top",children:[10,20,30,40,50,100].map(a=>e.jsx(r,{value:String(a),children:a},a))})]})]}),e.jsxs("div",{className:"flex w-[100px] items-center justify-center text-sm font-medium",children:["Page ",s.getState().pagination.pageIndex+1," of ",s.getPageCount()]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxs(n,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>s.setPageIndex(0),disabled:!s.getCanPreviousPage(),children:[e.jsx("span",{className:"sr-only",children:"Go to first page"}),e.jsx(h,{})]}),e.jsxs(n,{variant:"outline",className:"h-8 w-8 p-0",onClick:()=>s.previousPage(),disabled:!s.getCanPreviousPage(),children:[e.jsx("span",{className:"sr-only",children:"Go to previous page"}),e.jsx(x,{})]}),e.jsxs(n,{variant:"outline",className:"h-8 w-8 p-0",onClick:()=>s.nextPage(),disabled:!s.getCanNextPage(),children:[e.jsx("span",{className:"sr-only",children:"Go to next page"}),e.jsx(d,{})]}),e.jsxs(n,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>s.setPageIndex(s.getPageCount()-1),disabled:!s.getCanNextPage(),children:[e.jsx("span",{className:"sr-only",children:"Go to last page"}),e.jsx(m,{})]})]})]})}export{u as D};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{v as E,j as t,w as K,r as l,af as N,B as p,dI as y,b$ as D,g as U,ic as q,t as b,i as H,u as $,fE as z,D as V,aL as _,x as G,al as P,am as Q,a2 as W,ao as J,ap as Y,aq as X,ar as Z,as as ee,au as te,aC as se,id as ae,a6 as ne,ay as x,bY as re,c5 as oe,c6 as ce,L as ie,bO as le,bP as de,bQ as T,bR as ue,c2 as A,bS as ge,bT as F,ie as me}from"./index-
|
|
1
|
+
import{v as E,j as t,w as K,r as l,af as N,B as p,dI as y,b$ as D,g as U,ic as q,t as b,i as H,u as $,fE as z,D as V,aL as _,x as G,al as P,am as Q,a2 as W,ao as J,ap as Y,aq as X,ar as Z,as as ee,au as te,aC as se,id as ae,a6 as ne,ay as x,bY as re,c5 as oe,c6 as ce,L as ie,bO as le,bP as de,bQ as T,bR as ue,c2 as A,bS as ge,bT as F,ie as me}from"./index-D1_HHRLX.js";const he=[["path",{d:"M12 18H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5",key:"x6cv4u"}],["path",{d:"m16 19 3 3 3-3",key:"1ibux0"}],["path",{d:"M18 12h.01",key:"yjnet6"}],["path",{d:"M19 16v6",key:"tddt3s"}],["path",{d:"M6 12h.01",key:"c2rlol"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],R=E("banknote-arrow-down",he);const xe=[["path",{d:"M12 18H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5",key:"x6cv4u"}],["path",{d:"M18 12h.01",key:"yjnet6"}],["path",{d:"M19 22v-6",key:"qhmiwi"}],["path",{d:"m22 19-3-3-3 3",key:"rn6bg2"}],["path",{d:"M6 12h.01",key:"c2rlol"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],fe=E("banknote-arrow-up",xe);function pe({transaction:e}){return t.jsx("div",{className:"flex flex-col justify-center",children:e.eventDate?K(new Date(e.eventDate),"dd/MM/yyyy"):"-"})}function je({transaction:e}){const{isInterest:a,amount:n}=e,r=l.useMemo(()=>Number(n.raw)<0,[n.raw]);return t.jsx("div",{className:"flex items-center gap-2",children:a?t.jsxs(t.Fragment,{children:[t.jsx(R,{className:"size-4 text-red-600"}),t.jsx(N,{variant:"outline",className:"bg-red-50 text-red-700",children:"Interest"})]}):r?t.jsxs(t.Fragment,{children:[t.jsx(fe,{className:"size-4 text-green-600"}),t.jsx(N,{variant:"outline",className:"bg-green-50 text-green-700",children:"Deposit"})]}):t.jsxs(t.Fragment,{children:[t.jsx(R,{className:"size-4 text-red-600"}),t.jsx(N,{variant:"outline",className:"bg-red-50 text-red-700",children:"Withdrawal"})]})})}function ye({transaction:e}){const n=Number(e.amount.raw)<0?"text-green-700":"text-red-500";return t.jsx("div",{className:`flex flex-col justify-center font-mono ${n}`,children:e.amount.formatted})}function De({transaction:e}){const a=l.useMemo(()=>{const{currency:n}=e.amount;return new Intl.NumberFormat("en-US",{style:"currency",currency:n,minimumFractionDigits:2,maximumFractionDigits:2}).format(e.cumulativeBalance)},[e.cumulativeBalance,e.amount]);return t.jsx("div",{className:"flex flex-col justify-center font-mono font-semibold",children:a})}function Ce({transaction:e}){const a=l.useMemo(()=>{const{currency:n}=e.amount;return new Intl.NumberFormat("en-US",{style:"currency",currency:n,minimumFractionDigits:2,maximumFractionDigits:2}).format(e.totalInterest)},[e.totalInterest,e.amount]);return t.jsx("div",{className:"flex flex-col justify-center font-mono font-semibold",children:a})}function ve({transaction:e}){const a=l.useMemo(()=>new Intl.NumberFormat("en-US",{style:"currency",currency:e.localCurrency,minimumFractionDigits:2,maximumFractionDigits:2}).format(e.localAmount),[e.localAmount,e.localCurrency]);return t.jsx("div",{className:"flex flex-col justify-center font-mono text-muted-foreground",children:a})}function Ie({transaction:e}){const a=l.useMemo(()=>new Intl.NumberFormat("en-US",{style:"currency",currency:e.localCurrency,minimumFractionDigits:2,maximumFractionDigits:2}).format(e.localCumulativeBalance),[e.localCumulativeBalance,e.localCurrency]);return t.jsx("div",{className:"flex flex-col justify-center font-mono font-semibold text-muted-foreground",children:a})}const L=[{id:"date",accessorKey:"eventDate",sortingFn:e=>e.original.eventDate?new Date(e.original.eventDate).getTime():0,header:({column:e})=>t.jsxs(p,{variant:"ghost",onClick:()=>e.toggleSorting(e.getIsSorted()==="asc"),children:["Date",e.getIsSorted()&&(e.getIsSorted()==="asc"?t.jsx(y,{className:"ml-2 h-4 w-4"}):t.jsx(D,{className:"ml-2 h-4 w-4"}))]}),cell:({row:e})=>t.jsx(pe,{transaction:e.original})},{id:"indicator",accessorKey:"amount.raw",header:"Type",cell:({row:e})=>t.jsx(je,{transaction:e.original})},{id:"amount",accessorKey:"amount.raw",header:({column:e})=>t.jsxs(p,{variant:"ghost",onClick:()=>e.toggleSorting(e.getIsSorted()==="asc"),children:["Origin Amount",e.getIsSorted()&&(e.getIsSorted()==="asc"?t.jsx(y,{className:"ml-2 h-4 w-4"}):t.jsx(D,{className:"ml-2 h-4 w-4"}))]}),cell:({row:e})=>t.jsx(ye,{transaction:e.original})},{id:"cumulativeBalance",accessorKey:"cumulativeBalance",header:({column:e})=>t.jsxs(p,{variant:"ghost",onClick:()=>e.toggleSorting(e.getIsSorted()==="asc"),children:["Origin Balance",e.getIsSorted()&&(e.getIsSorted()==="asc"?t.jsx(y,{className:"ml-2 h-4 w-4"}):t.jsx(D,{className:"ml-2 h-4 w-4"}))]}),cell:({row:e})=>t.jsx(De,{transaction:e.original})},{id:"totalInterest",accessorKey:"totalInterest",header:({column:e})=>t.jsxs(p,{variant:"ghost",onClick:()=>e.toggleSorting(e.getIsSorted()==="asc"),children:["Interest",e.getIsSorted()&&(e.getIsSorted()==="asc"?t.jsx(y,{className:"ml-2 h-4 w-4"}):t.jsx(D,{className:"ml-2 h-4 w-4"}))]}),cell:({row:e})=>t.jsx(Ce,{transaction:e.original})},{id:"localAmount",accessorKey:"localAmount",header:({column:e})=>t.jsxs(p,{variant:"ghost",onClick:()=>e.toggleSorting(e.getIsSorted()==="asc"),children:["Local Amount",e.getIsSorted()&&(e.getIsSorted()==="asc"?t.jsx(y,{className:"ml-2 h-4 w-4"}):t.jsx(D,{className:"ml-2 h-4 w-4"}))]}),cell:({row:e})=>t.jsx(ve,{transaction:e.original})},{id:"localCumulativeBalance",accessorKey:"localCumulativeBalance",header:({column:e})=>t.jsxs(p,{variant:"ghost",onClick:()=>e.toggleSorting(e.getIsSorted()==="asc"),children:["Local Balance",e.getIsSorted()&&(e.getIsSorted()==="asc"?t.jsx(y,{className:"ml-2 h-4 w-4"}):t.jsx(D,{className:"ml-2 h-4 w-4"}))]}),cell:({row:e})=>t.jsx(Ie,{transaction:e.original})}],we="assignChargeToDeposit",Se=()=>{const[{fetching:e},a]=U(q),n=l.useCallback(async r=>{const h=`Error assigning charge ${r.chargeId} to deposit ${r.depositId}`,o=`${we}-${r.chargeId}`;b.loading("Assigning to deposit",{id:o});try{const c=await a(r),u=H(c,h,o);u&&b.success("Success",{id:o,description:`Charge assigned to deposit ${u.assignChargeToDeposit.id}`})}catch(c){console.error(`${h}: ${c}`),b.error("Error",{id:o,description:h,duration:1e5,closeButton:!0})}},[a]);return{assigning:e,assignChargeToDeposit:n}};function Ne({depositId:e,chargeId:a,refetch:n}){const[r,h]=l.useState(!1),[o,c]=l.useState(void 0),[{data:u}]=$({query:z,pause:!r}),{assigning:g,assignChargeToDeposit:d}=Se(),f=l.useMemo(()=>(u?.allDeposits??[]).filter(s=>s.isOpen&&s.id!==e),[u?.allDeposits,e]),m=l.useCallback(async()=>{o&&(await d({chargeId:a,depositId:o}),h(!1),c(void 0),n?.())},[d,o,n,a]);return l.useEffect(()=>{r&&c(void 0)},[r]),t.jsxs(V,{open:r,onOpenChange:h,children:[t.jsx(_,{children:t.jsx(p,{variant:"ghost",size:"sm",children:"Reassign"})}),t.jsxs(G,{children:[t.jsx(P,{children:t.jsx(Q,{children:"Reassign Transaction"})}),t.jsx("div",{className:"space-y-4",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(W,{htmlFor:"target-deposit-select",children:"Target Deposit"}),t.jsxs(J,{value:o,onValueChange:s=>c(s),children:[t.jsx(Y,{className:"min-w-[220px]",children:t.jsx(X,{id:"target-deposit-select",placeholder:f.length?"Select deposit":"No open deposits"})}),t.jsx(Z,{children:f.map(s=>t.jsxs(ee,{value:s.id,children:[s.id," (",s.currency,")"]},s.id))})]})]})}),t.jsx(te,{children:t.jsx(p,{variant:"secondary",disabled:!o||g,onClick:m,children:g?"Reassigning…":"Reassign"})})]})]})}function be(e,a){const{getId:n,getChargeId:r,getAmount:h}=a,o=new Map;for(const u of e){const g=r(u);if(!g)continue;const d=o.get(g)??[];d.push(u),o.has(g)||o.set(g,d)}const c=new Set;for(const[,u]of o)if(u.length>1){const g=[...u].sort((d,f)=>Math.abs(h(f))-Math.abs(h(d)));for(let d=1;d<g.length;d++)c.add(n(g[d]))}return c}const Te={[x.Eur]:"eur",[x.Gbp]:"gbp",[x.Cad]:"cad",[x.Jpy]:"jpy",[x.Aud]:"aud",[x.Sek]:"sek",[x.Usd]:"usd"};function ke({depositId:e,enableReassign:a=!1,refetch:n}){const{userContext:r}=l.useContext(se),[h,o]=l.useState([{id:"date",desc:!1}]),[{data:c,fetching:u}]=$({query:ae,variables:{depositId:e}}),g=l.useMemo(()=>{if(!c?.deposit?.transactions)return[];const m=c.deposit.transactions.map(i=>ne(me,i)),s=be(m,{getId:i=>i.id,getChargeId:i=>i.chargeId,getAmount:i=>Number(i.amount.raw??0)}),S=[...m].sort((i,C)=>{const v=i.eventDate?new Date(i.eventDate).getTime():0,I=C.eventDate?new Date(C.eventDate).getTime():0;return v-I});let w=0,j=0,M=0;return S.map(i=>{let C=null;const v=Te[i.amount.currency];v&&(C=i.debitExchangeRates?.[v]??i.eventExchangeRates?.[v]??null);const I=Number(i.amount.raw),k=I*(C??1),O=r?.context.defaultLocalCurrency??x.Ils,B=s.has(i.id);return B?j+=I:(w+=I,M+=k),{...i,cumulativeBalance:w,localCumulativeBalance:M,localAmount:k,localCurrency:O,totalInterest:j,isInterest:B}})},[c?.deposit,r]),d=l.useMemo(()=>{const m=r?.context.defaultLocalCurrency??x.Ils,S=!!c?.deposit?.currency&&c.deposit.currency===m?L.filter(j=>j.id!=="amount"&&j.id!=="cumulativeBalance"):L,w=a?[{id:"actions",header:"Actions",cell:({row:j})=>t.jsx(Ne,{depositId:e,chargeId:j.original.chargeId,refetch:n})}]:[];return[...S,...w]},[a,e,n,c?.deposit?.currency,r?.context.defaultLocalCurrency]),f=re({data:g,columns:d,getCoreRowModel:ce(),onSortingChange:o,getSortedRowModel:oe(),state:{sorting:h}});return u?t.jsx("div",{className:"flex h-64 w-full items-center justify-center",children:t.jsx(ie,{className:"size-10 animate-spin"})}):t.jsxs(le,{children:[t.jsx(de,{children:f.getHeaderGroups().map(m=>t.jsx(T,{children:m.headers.map(s=>t.jsx(ue,{colSpan:s.colSpan,children:s.isPlaceholder?null:A(s.column.columnDef.header,s.getContext())},s.id))},m.id))}),t.jsx(ge,{children:f.getRowModel().rows?.length?f.getRowModel().rows.map(m=>t.jsx(T,{children:m.getVisibleCells().map(s=>t.jsx(F,{children:A(s.column.columnDef.cell,s.getContext())},s.id))},m.id)):t.jsx(T,{children:t.jsx(F,{colSpan:d.length,className:"h-24 text-center",children:"No transactions in this deposit."})})})]})}export{ke as D,Se as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,j as t,bU as i,bV as d,B as p,h6 as h,bW as x}from"./index-
|
|
1
|
+
import{r,j as t,bU as i,bV as d,B as p,h6 as h,bW as x}from"./index-D1_HHRLX.js";function u(n,s){const e=new Uint8Array([239,187,191]),c=new Blob([e,n],{type:"text/csv;charset=UTF-8"}),a=URL.createObjectURL(c),o=document.createElement("a");o.href=a,o.download=`${s}.csv`,document.body.appendChild(o),o.click(),document.body.removeChild(o)}const m=({createFileVariables:n,buttonProps:s,buttonContent:e,label:c})=>{const a=r.useCallback(()=>{n().then(({fileContent:o,fileName:l})=>{u(o,l)})},[n]);return t.jsxs(i,{children:[t.jsx(d,{children:t.jsx(p,{variant:"outline",className:"p-2",...s,onClick:a,children:e||t.jsx(h,{size:20})})}),t.jsx(x,{children:t.jsx("p",{children:c||"Download CSV"})})]})};export{m as D};
|