1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d9b68034-c6cf-45b3-99ac-27d690721f11",e._sentryDebugIdIdentifier="sentry-dbid-d9b68034-c6cf-45b3-99ac-27d690721f11")}()}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4991],{16697:(e,n,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/app/reports/reconciliation",function(){return t(33737)}])},33737:(e,n,t)=>{"use strict";t.r(n),t.d(n,{__N_SSP:()=>e1,default:()=>e2});var l=t(37876),a=t(4547),i=t(65932),o=t(72341),r=t(82077),s=t(91811),c=t(3838),d=t(28304),u=t(25422),h=t(2506),m=t(71763),p=t(19770),g=t(29700),A=t(14232),f=t(16338),x=t(72681),v=t(269),b=t(27809),j=t(24973),y=t(63225),S=t(39738),C=t(47753),w=t(79686),k=t(90810),F=t(15066),I=t(55565),R=t(72637),B=t(89028),P=t(94211),T=t(13677),D=t(79455),_=t(58090),U=t(52336),W=t(20104),z=t(75965),E=t(80733),N=t(46256),L=t(44292),M=t(49535),H=t(51994),O=t(60113),$=t(34178),V=t(48789),J=t(96427),G=t(27630),Y=t(27250),q=t(64177);function Z(){let e=(0,J._)(["\n fragment BankStatementFields on Attachment {\n id\n filename\n uploadedAt\n uploadStatus\n parsingStatus\n uploadedBy {\n id\n name {\n first\n last\n }\n }\n}\n "]);return Z=function(){return e},e}function K(){let e=(0,J._)(["\n query GetUnlinkedBankStatements($orgId: ID!, $first: Int, $after: Cursor) {\n organization(orgId: $orgId) {\n id\n attachments(\n input: {first: $first, after: $after, attachmentTypes: [BANK_STATEMENT], linkedReconciliationSession: false}\n ) {\n edges {\n node {\n ...BankStatementFields\n }\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n}\n ",""]);return K=function(){return e},e}function Q(){let e=(0,J._)(["\n mutation ArchiveBankStatement($input: DeleteAttachmentInput!) {\n archiveAttachment(input: $input) {\n success\n error {\n message\n }\n }\n}\n "]);return Q=function(){return e},e}function X(){let e=(0,J._)(["\n mutation BulkArchiveBankStatements($input: BulkArchiveAttachmentsInput!) {\n bulkArchiveAttachments(input: $input) {\n archivedAttachmentIds\n }\n}\n "]);return X=function(){return e},e}function ee(){let e=(0,J._)(["\n mutation RenameStatement($input: UpdateAttachmentFilenameInput!) {\n updateAttachmentFilename(input: $input) {\n userErrors {\n message\n code\n }\n attachment {\n ...BankStatementFields\n }\n }\n}\n ",""]);return ee=function(){return e},e}let en={},et=(0,G.J1)(Z()),el=(0,G.J1)(K(),et);function ea(e){let n={...en,...e};return Y.IT(el,n)}let ei=(0,G.J1)(Q()),eo=(0,G.J1)(X()),er=(0,G.J1)(ee(),et);var es=t(36029),ec=t(99576),ed=t(35812),eu=t(9479);function eh(e){let n=e.lastIndexOf(".");return -1===n||0===n?{baseName:e,extension:""}:{baseName:e.slice(0,n),extension:e.slice(n)}}let em=e=>{let{open:n,onClose:t,attachmentId:a,currentFilename:i,onRenameComplete:o}=e,{queueSnackbar:s}=(0,W.xt)(),c=(0,ec.m)(r.oaU),[d]=function(e){let n={...en,...void 0};return q.n(er,n)}(),{baseName:u,extension:h}=(0,A.useMemo)(()=>eh(i),[i]),[m,p]=(0,A.useState)(u),[g,f]=(0,A.useState)(!1),[x,v]=(0,A.useState)(null);(0,A.useEffect)(()=>{if(n){let{baseName:e}=eh(i);p(e),v(null)}},[n,i]);let b=(0,A.useCallback)(async()=>{if(!a)return;let e=m.trim();if(!e)return void v("Filename cannot be empty");let n=e+h;if(n.length>255)return void v("Filename cannot exceed ".concat(255," characters"));let i=function(e){return es.xZ.test(e)?"Filename cannot start with a period":es.KI.test(e)?"Filename cannot contain consecutive periods (..)":es.qZ.test(e)?"Filename contains invalid characters":null}(n);if(i)return void v(i);f(!0),v(null);try{var r,u;let e=await d({variables:{input:{attachmentId:a,filename:n}}});if(c(null==(u=e.data)||null==(r=u.updateAttachmentFilename)?void 0:r.userErrors))return;s({message:"Statement renamed",startIcon:(0,l.jsx)(B.A,{path:j.KsW})}),o(),t()}catch(e){v("Couldn't rename statement. Please try again.")}finally{f(!1)}},[a,m,h,d,c,s,o,t]),y=(0,A.useCallback)(e=>{p(e.target.value),x&&v(null)},[x]);return(0,l.jsx)(ed.A,{title:"Rename Statement",buttonPosition:"none",open:n,onClose:t,children:(0,l.jsxs)(P.A,{column:!0,spacing:1.5,children:[(0,l.jsx)(eu.A,{fieldLabel:"Filename",value:m,onChange:y,state:x?"error":"default",helperText:x,fullWidth:!0,autoFocus:!0,disabled:g,onEnterPress:b,endAdornment:h?(0,l.jsx)(M.A,{variant:"body",light:!0,children:h}):void 0}),(0,l.jsxs)(P.A,{column:!0,spacing:1,children:[(0,l.jsx)(w.A,{fullWidth:!0,color:"green",onClick:b,isLoading:g,disabled:!m.trim()||g,children:"Rename"}),(0,l.jsx)(w.A,{fullWidth:!0,light:!0,color:"brown",onClick:t,disabled:g,children:"Cancel"})]})]})})},ep=()=>[],eg=O.A.create({borderTopAndBottom:{borderBottomColor:F.Ay.brown[20],borderBottomWidth:1,borderTopColor:F.Ay.brown[20],borderTopWidth:1}}),eA=e=>{var n,t,a;let{statements:i,loading:o,refetch:s,isInternalUser:c}=e,{queueSnackbar:u}=(0,W.xt)(),[h,p]=(0,A.useState)(!c),[g,f]=(0,A.useState)(),[O,J]=(0,A.useState)(null),[G,Y]=(0,A.useState)(new Set),[Z,K]=(0,A.useState)(null),[Q,X]=(0,A.useState)("uploadedAt"),[ee,et]=(0,A.useState)("desc"),[el,ea]=(0,A.useState)(null),[er,es]=(0,A.useState)(!1),[ec,ed]=(0,A.useState)(!1),[eu,eh]=(0,A.useState)(!1),eA=(0,m.A)(),[ef]=function(e){let n={...en,...void 0};return q.n(ei,n)}(),[ex,{loading:ev}]=function(e){let n={...en,...void 0};return q.n(eo,n)}(),eb=(0,A.useCallback)(e=>{J(e)},[]),ej=(0,A.useCallback)(()=>{J(null)},[]),ey=(0,A.useCallback)(()=>{f(void 0)},[]),eS=(0,A.useCallback)(async e=>{try{var n,t,a,i;let o=await ef({variables:{input:{attachmentId:e}}});(null==(n=o.data)?void 0:n.archiveAttachment.success)?(u({message:"Statement deleted",startIcon:(0,l.jsx)(B.A,{path:j.FhF})}),await s()):u({color:"red",message:null!=(i=null==(a=o.data)||null==(t=a.archiveAttachment.error)?void 0:t.message)?i:"Failed to delete statement"})}catch(e){u({color:"red",message:"Couldn't delete statement. Please try again."})}},[ef,u,s]),eC=(0,A.useCallback)(e=>{Y(n=>{let t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t})},[]),ew=(0,A.useCallback)(()=>{Y(e=>e.size===i.length?new Set:new Set(i.map(e=>e.id)))},[i]),ek=(0,A.useCallback)(async()=>{let e=[...G];ed(!0);try{let n=await (0,y.DD)("/api/v1/statements/bulk-download",{attachmentIds:e,orgId:eA}),t=await n.blob(),a=URL.createObjectURL(t),i=document.createElement("a");i.href=a,i.download="statements.zip",document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(a),u({message:"Downloaded ".concat(e.length," statement
1(s)"),startIcon:(0,l.jsx)(B.A,{path:j.Bxv})})}catch(e){var n;u({color:"red",message:e instanceof S.h&&null!=(n=e.rawCause())?n:"Failed to download statements. Please try again."})}finally{ed(!1)}},[G,eA,u]),eF=(0,A.useCallback)(async()=>{let e=[...G];if(0===e.length)return void eh(!1);try{var n,t;let a=null!=(t=null==(n=(await ex({variables:{input:{attachmentIds:e}}})).data)?void 0:n.bulkArchiveAttachments.archivedAttachmentIds.length)?t:0;if(Y(new Set),0===a)u({color:"red",message:"Couldn't delete statements. Please try again."});else{let n=(0,$.td)(a,{plural:"statements",singular:"statement"});u({message:a<e.length?"Deleted ".concat(a," of ").concat(e.length," statements"):"".concat(a," ").concat(n," deleted"),startIcon:(0,l.jsx)(B.A,{path:j.FhF})})}}catch(e){u({color:"red",message:"Couldn't delete statements. Please try again."}),eh(!1);return}eh(!1);try{await s()}catch(e){}},[ex,u,s,G]),eI=i.length>0&&G.size===i.length,eR=G.size>0&&!eI,eB=(0,A.useCallback)(()=>{K(null)},[]),eP=(0,A.useCallback)(()=>{s()},[s]),eT=(0,A.useCallback)(e=>{e===Q?et(e=>"desc"===e?"asc":"desc"):(X(e),et("desc"))},[Q]),eD=(0,A.useMemo)(()=>[...i].sort((e,n)=>{var t,l,a,i,o,r;let s=0;switch(Q){case"filename":s=(null!=(t=e.filename)?t:"").localeCompare(null!=(l=n.filename)?l:"");break;case"uploadedAt":s=(e.uploadedAt?"".concat(e.uploadedAt):"").localeCompare(n.uploadedAt?"".concat(n.uploadedAt):"");break;case"uploadedBy":s=(null!=(o=(0,$._A)(null==(a=e.uploadedBy)?void 0:a.name))?o:"").localeCompare(null!=(r=(0,$._A)(null==(i=n.uploadedBy)?void 0:i.name))?r:"")}return"asc"===ee?s:-s}),[i,Q,ee]),e_=(0,A.useMemo)(()=>[...c?[{cellSpec:{basis:3,maxWidth:4,minWidth:3},headerSpec:{overrideHeaderWithWrapper:()=>(0,l.jsx)(R.A,{checked:eI,indeterminate:eR,onChange:ew}),title:""},id:"select",renderCell:(e,n)=>(0,l.jsx)(E.A,{gutterProps:{align:"center",gutter:(null==n?void 0:n.gutter)||"none",justify:null==n?void 0:n.justify},children:(0,l.jsx)(R.A,{checked:G.has(e.id),onChange:()=>eC(e.id)})})}]:[],{cellSpec:{basis:17},headerSpec:{onSortClick:()=>eT("filename"),sort:"filename"===Q?ee:void 0,title:"Filename"},id:"filename",renderCell:(e,n)=>{var t;return(0,l.jsx)(E.A,{gutterProps:{align:"center",gutter:(null==n?void 0:n.gutter)||"none",justify:null==n?void 0:n.justify},children:(0,l.jsxs)(P.A,{spacing:.75,align:"center",flex:1,children:[(0,l.jsx)(k.A,{variant:"subtle",underline:"hover",href:"/app/attachments/download/".concat(e.id),targetBlank:!0,children:(0,l.jsx)(M.A,{variant:"small",truncate:!0,children:null!=(t=e.filename)?t:"Unknown"})}),e.parsingStatus===r.mNp.Pending&&(0,l.jsxs)(P.A,{spacing:.5,align:"center",children:[(0,l.jsx)(U.A,{size:"small"}),(0,l.jsx)(M.A,{variant:"small",light:!0,children:"Parsing..."})]})]})})}},{cellSpec:{basis:12},headerSpec:{onSortClick:()=>eT("uploadedAt"),sort:"uploadedAt"===Q?ee:void 0,title:"Uploaded"},id:"uploadedAt",renderCell:(e,n)=>(0,l.jsx)(E.A,{gutterProps:{align:"center",gutter:(null==n?void 0:n.gutter)||"none",justify:null==n?void 0:n.justify},children:(0,l.jsx)(M.A,{variant:"small",truncate:!0,children:e.uploadedAt?v.A.medium((0,b.Ay)(e.uploadedAt)):x.F})})},{cellSpec:{basis:12},headerSpec:{onSortClick:()=>eT("uploadedBy"),sort:"uploadedBy"===Q?ee:void 0,title:"Uploaded By"},id:"uploadedBy",renderCell:(e,n)=>{var t,a;return(0,l.jsx)(E.A,{gutterProps:{align:"center",gutter:(null==n?void 0:n.gutter)||"none",justify:null==n?void 0:n.justify},children:(0,l.jsx)(M.A,{variant:"small",truncate:!0,children:null!=(a=(0,$._A)(null==(t=e.uploadedBy)?void 0:t.name))?a:x.F})})}},{cellSpec:{basis:10,maxWidth:12,minWidth:8},headerSpec:{title:""},id:"actions",renderCell:(e,n)=>(0,l.jsx)(E.A,{gutterProps:{align:"center",gutter:(null==n?void 0:n.gutter)||"none",justify:(null==n?void 0:n.justify)||"flex-end"},children:(0,l.jsxs)(P.A,{spacing:.75,align:"center",children:[(0,l.jsx)(w.A,{light:!0,transparentColor:!0,color:"brown",size:"small",onClick:()=>eb(e),children:"Reconcile"}),(0,l.jsxs)(_.Ay,{children:[(0,l.jsx)(D.A,{title:"Preview",onClick:()=>{f(e)},icon:(0,l.jsx)(B.A,{path:j.VDu,color:"brown"})}),(0,l.jsx)(D.A,{title:"Rename",onClick:()=>{K(e)},icon:(0,l.jsx)(B.A,{path:j.KsW,color:"brown"})}),(0,l.jsx)(D.A,{title:"Download",icon:(0,l.jsx)(B.A,{path:j.Bxv,color:"brown"}),otherWebProps:{component:"a",download:!0,href:"/app/attachments/download/".concat(e.id),rel:"noopener noreferrer",target:"_blank"}}),(0,l.jsx)(D.A,{title:"Delete",color:"red",onClick:()=>{ea(e)},icon:(0,l.jsx)(B.A,{path:j.FhF,color:"red"})})]})]})})}],[eI,eb,eT,eC,ew,c,G,eR,Q,ee]);return 0===i.length?null:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(C.A,{open:!!g,onClose:ey,attachmentId:(null==g?void 0:g.id)||"",attachmentFilename:(null==g?void 0:g.filename)||""}),(0,l.jsx)(V.A,{open:!!O,onClose:ej,account:null,fromAttachmentId:null==O?void 0:O.id,fromAttachmentFilename:null!=(n=null==O?void 0:O.filename)?n:void 0}),(0,l.jsx)(em,{open:!!Z,onClose:eB,attachmentId:null!=(t=null==Z?void 0:Z.id)?t:null,currentFilename:null!=(a=null==Z?void 0:Z.filename)?a:"",onRenameComplete:eP}),(0,l.jsx)(I.A,{open:!!el,onClose:()=>ea(null),title:"Delete Statement",actionLabel:"Delete Statement",isDestructive:!0,loading:er,onAction:async()=>
1{if(el){es(!0);try{await eS(el.id),ea(null)}finally{es(!1)}}},children:(0,l.jsx)(M.A,{variant:"body",children:"This action is permanent and cannot be undone. If you need a copy of this statement, please download it first before deleting."})}),(0,l.jsx)(I.A,{open:eu,onClose:()=>eh(!1),title:"Delete Statements",actionLabel:"Delete ".concat(G.size," ").concat((0,$.td)(G.size,{plural:"Statements",singular:"Statement"})),isDestructive:!0,loading:ev,onAction:()=>void eF(),children:(0,l.jsx)(M.A,{variant:"body",children:"This action is permanent and cannot be undone. If you need copies of these statements, please download them first before deleting."})}),(0,l.jsx)(H.A,{style:eg.borderTopAndBottom,children:(0,l.jsxs)(T.A,{column:!0,spacing:1,gutter:"none",top:2,bottom:2,bgColor:F.Ay.brown[5],children:[(0,l.jsxs)(d.A,{gutter:"responsive",spacing:1,align:"center",justify:"space-between",children:[c?(0,l.jsxs)(M.A,{variant:"large",bold:!0,children:["Statements to Review (",i.length,")"]}):(0,l.jsx)(L.A,{title:"These files are visible to your Full Service team. No action is needed from you.",placement:"bottom-start",children:(0,l.jsxs)(M.A,{variant:"large",bold:!0,children:["Pending Full Service Team (",i.length,")"]})}),(0,l.jsxs)(P.A,{spacing:1,align:"center",children:[c&&G.size>0&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(w.A,{size:"small",color:"brown",light:!0,disabled:ec,startIcon:(0,l.jsx)(B.A,{path:j.Bxv}),onClick:()=>void ek(),children:ec?"Downloadingâ¦":"Download Selected (".concat(G.size,")")}),(0,l.jsx)(w.A,{size:"small",color:"red",light:!0,disabled:ev,startIcon:(0,l.jsx)(B.A,{path:j.FhF}),onClick:()=>eh(!0),children:ev?"Deletingâ¦":"Delete Selected (".concat(G.size,")")})]}),(0,l.jsx)(w.A,{light:!0,transparentColor:!0,color:"brown",size:"small",onClick:()=>p(e=>!e),endIcon:h?(0,l.jsx)(B.A,{path:j.mI8,color:"brown"}):(0,l.jsx)(B.A,{path:j.W5x,color:"brown"}),children:h?"Show":"Hide"})]})]}),!h&&(0,l.jsx)(z.Ay,{styleSpec:{backgroundColor:F.Ay.brown[5],height:3},tableId:N.R7,loading:o,skeletonRowCount:3,columns:e_,data:eD,extractSubRows:ep})]})})]})};var ef=t(89928),ex=t(14521),ev=t(30054),eb=t(14199),ej=t(80722),ey=t(55261),eS=t(46726),eC=t(44022);let ew=(0,t(5646).Ay)(M.A).withConfig({componentId:"sc-ecbef45e-0"})(["background-color:",";border-bottom-right-radius:","rem;border-top-left-radius:","rem;color:white;left:-1px;padding:0.25rem 0.75rem;position:absolute;top:-1px;z-index:1;"],F.Ay.green[100],eC.TI.md,eC.TI.md),ek=e=>{let{onUploadComplete:n}=e,{queueSnackbar:t}=(0,W.xt)(),a=(0,A.useCallback)(e=>{let{succeededCount:n}=e;n>0&&t({color:"green",message:"".concat(n," bank ").concat((0,$.td)(n,{plural:"statements",singular:"statement"})," uploaded! Your Full Service account manager will take it from here.")})},[t]),i=(0,A.useCallback)(()=>{null==n||n()},[n]),o=(0,ev.d)({attachmentDetails:void 0,attachmentType:r.whx.BankStatement,onBatchComplete:a,onUploadComplete:i,resetUploadStateOnComplete:!0});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ey.A,{open:o.uploadStatus.isUploading,uploadedCount:o.uploadStatus.succeededUploadCount,totalCount:o.uploadStatus.totalUploadCount,cancelUploads:o.cancelUploads}),(0,l.jsx)(d.A,{gutter:"responsive",children:(0,l.jsx)(ex.A,{title:"Upload Bank Statements",vm:o,allowedFileTypes:[eS.gm.PDF,eS.gm.PNG,eS.gm.JPEG],children:(0,l.jsxs)(eb.A,{height:(0,ef.A)(6),children:[(0,l.jsx)(ew,{variant:"micro",medium:!0,overline:!0,children:"Full Service"}),(0,l.jsx)(ej.A,{fileTypes:["pdf","image"],onFilesSelected:e=>o.onFilesSelected({files:e}),children:(0,l.jsxs)(P.A,{column:!0,align:"center",justify:"center",children:[(0,l.jsxs)(P.A,{flex:1,spacing:.5,align:"center",children:[(0,l.jsx)(B.A,{path:j.QZ1,colorOverride:F.ZQ.green[80]}),(0,l.jsx)(M.A,{variant:"body",medium:!0,style:{cursor:"pointer"},color:"green",children:"Upload / Drop Bank Statements"})]}),(0,l.jsx)(M.A,{variant:"small",light:!0,children:"Your Full Service account manager will review & reconcile"})]})})]})})})]})};var eF=t(64421),eI=t(53801),eR=t(7906),eB=t(6448),eP=t(26730),eT=t(46396),eD=t(47234),e_=t(73797),eU=t(11355),eW=t(78332),ez=t(37507),eE=t(23981),eN=t(55126
1),eL=t(42414);let eM=e=>{let{accounts:n,collapsible:t,loading:a,startOpen:i=!0,title:o}=e;(e=>{let n=(0,eN.A)(),{queueSnackbar:t}=(0,W.xt)(),l=(0,eL.TZ)(n.query.finished);(0,A.useEffect)(()=>{if(!l||!e.length)return;let a="/app/reports/reconciliation";n.replace(a,a,{shallow:!0});let i=e.find(e=>e.id===l);(null==i?void 0:i.reconciledUpToDate)&&t({message:"Reconciled ".concat(i.name," up to ").concat(eF.x.format(eF.x.fromString(i.reconciledUpToDate),"MMMM D, YYYY"))})},[e,t,l])})(n||[]);let r=(0,eW.A)(),[s,c]=(0,A.useState)(null),[u,h]=(0,A.useState)(i),m=(0,A.useMemo)(()=>[{cellSpec:{basis:24,minWidth:12},headerSpec:{title:"Account"},id:"name",renderCell:(e,n)=>(0,l.jsx)(E.A,{gutterProps:{align:"center",gutter:(null==n?void 0:n.gutter)||"none",justify:null==n?void 0:n.justify},children:(0,l.jsxs)(P.A,{spacing:.5,align:"center",children:[(0,l.jsx)(eP.A,{children:(0,l.jsx)(eE.k4,{account:e})}),(0,l.jsx)(eE.d9,{account:e})]})})},...r?[]:[{cellSpec:{basis:16,borderLeft:"solid",minWidth:12},headerSpec:{title:"Last Reconciled By"},id:"reconciledBy",renderCell:(e,n)=>{var t,a,i,o;let r=null!=(t=e.inProgressReconciliationSession)?t:e.lastCompletedReconciliationSession;return(0,l.jsx)(E.A,{gutterProps:{align:"center",gutter:(null==n?void 0:n.gutter)||"none",justify:null==n?void 0:n.justify},children:(null==r?void 0:r.reconciledBy)?(0,l.jsxs)(L.A,{title:null!=(a=(0,$._A)(r.reconciledBy.name))?a:eI.Jx,spacing:.5,align:"center",placement:"top-start",children:[(0,l.jsx)(eD.A,{size:"small",name:null!=(i=(0,$._A)(r.reconciledBy.name))?i:eI.Jx,avatarUrls:r.reconciledBy.avatarUrls}),(0,l.jsx)(eB.A,{label:r.reconciledTimeMs?"On ".concat(v.A.medium((0,b.Ay)(r.reconciledTimeMs))):"-",labelPosition:"bottom",textProps:{variant:"small"},spacing:0,children:null!=(o=(0,$._A)(r.reconciledBy.name))?o:eI.Jx})]}):(0,l.jsx)(l.Fragment,{})})}},{cellSpec:{basis:12,minWidth:10},headerSpec:{title:"Reconciled Up To"},id:"startDate",renderCell:(e,n)=>(0,l.jsx)(E.A,{gutterProps:{align:"center",gutter:(null==n?void 0:n.gutter)||"none",justify:null==n?void 0:n.justify},children:(0,l.jsx)(M.A,{variant:"small",truncate:!0,children:e.reconciledUpToDate?v.A.medium(eF.x.fromString(e.reconciledUpToDate)):""})})},{cellSpec:{basis:8,borderRight:"solid",justify:"flex-end",minWidth:9},headerSpec:{title:"Ending Balance"},id:"endingBalance",renderCell:(e,n)=>{var t;let a=null!=(t=e.inProgressReconciliationSession)?t:e.lastCompletedReconciliationSession;return(0,l.jsx)(E.A,{gutterProps:{align:"center",gutter:(null==n?void 0:n.gutter)||"none",justify:null==n?void 0:n.justify},children:(0,l.jsx)(M.A,{variant:"small",truncate:!0,children:(null==a?void 0:a.statementEndingBalanceCents)!=null&&(0,l.jsx)(eU.A,{value:a.statementEndingBalanceCents})})})}}],{cellSpec:{basis:3,maxWidth:10,minWidth:9},headerSpec:{title:""},id:"overflow",renderCell:(e,n)=>(0,l.jsx)(E.A,{gutterProps:{align:"center",gutter:(null==n?void 0:n.gutter)||"none",justify:(null==n?void 0:n.justify)||"flex-end"},onClick:e=>{e.stopPropagation()},children:e.reconciliationSessionId?(0,l.jsx)(L.A,{title:"Resume reconciliation session",enterDelay:eT.d.slow,flex:1,children:(0,l.jsx)(e_.A,{href:"/app/reconcile/transactions?account=".concat(e.id,"&session=").concat(e.reconciliationSessionId),size:"small",light:!0,fullWidth:!0,transparentColor:!0,menuItems:[(0,l.jsx)(D.A,{onClick:()=>c(e),title:"Abandon changes and start fresh",color:"red"},"start-fresh")],children:"Resume"})}):(0,l.jsx)(w.A,{light:!0,onClick:()=>c(e),color:"brown",size:"small",fullWidth:!0,disabled:!e.reconciliationEnabled,transparentColor:!0,children:"Reconcile"})})}],[r]),p=a?(0,l.jsx)(P.A,{spacing:1,column:!0,children:(0,l.jsx)(d.A,{gutter:"responsive",column:!0,children:(0,l.jsx)(T.A,{top:2,align:"stretch",column:!0,children:(0,l.jsx)(d.A,{gutter:"responsive",column:!0,children:(0,l.jsx)(ez.A,{count:3,divided:!0,spacing:1,height:"1.5rem"})})})})}):(0,l.jsx)(T.A,{top:1,align:"stretch",column:!0,children:(0,l.jsx)(z.Ay,{extractSubRows:()=>[],columns:m,data:n,styleSpec:{dividerPosition:"top",height:4,stickyHeader:!!t&&u},getRowClickBehavior:e=>({href:"/app/reports/reconciliation/history?account=".concat(e.id)}),getRowHighlightId:e=>e.id,tableId:N.mh})});return(0,l.jsxs)(l.Fragment,{children:[t?(0,l.jsx)(eR.A,{expanded:u,setExpanded:h,summaryGutter:"responsive",iconPosition:"start",detailsGutter:"none",detailsSize:"no-padding",summary:(0,l.jsx)(M.A,{variant:"large",bold:!0,children:o}),children:p}):(0,l.jsxs)(P.A,{column:!0,spacing:1,children:[(0,l.jsx)(d.A,{gutter:"responsive",children:(0,l.jsx)(M.A,{variant:"large",bold:!0,children:o})}),p]}),(0,l.jsx)(V.A,{account:s,open:!!s,onClose:()=>c(null)})]})};var eH=t(70704),eO=t.n(eH),e$=t(20578),eV=t(44224);function eJ(){let e=(0,J._)(["\n fragment ReconcilableAccountPreview on CashflowConnectedAccount {\n ...AccountForReconciliationSession\n inProgressReconciliationSession {\n ...ReconciliationSessionFieldsForHistoryTable\n }\n lastCompletedReconciliationSession {\n ...ReconciliationSessionFieldsForHistoryTable\n }\n}\n ","\n",""]);return eJ=function(){return e},e}function eG(){let e=(0,J._)(["\n query ReconcileDashboardScreen($orgId: ID!) {\n organization(orgId: $orgId) {\n id\n cashflowConnectedAccounts(allLedgerAccounts: true, skipBalances: true) {\n ...ReconcilableAccountPreview\n }\n }\n}\n ",""]);return eG=function(){return e},e}let eY={},eq=(0,G.J1)(eJ(),e$.cv,eV.ih),eZ=(0,G.J1)(eG(),eq),eK=new Set([r.HiV.Bank,r.HiV.CreditCard]),eQ=new Set([r.HiV.Land,r.HiV.Structure,r.HiV.Vehicle,r.HiV.Equipment,r.HiV.Animals,r.HiV.AccumulatedDepreciation,r.HiV.OtherLongTermAsset]),eX=()=>{var e,n,t,a,i;let o=(0,m.A)(),x=(0,s.NF)(),{banksAndCards:v,fixedAssets:b,loading:j,otherAccounts:y,recentAccounts:S,setSearchTerm:C,isSearching:w}=(()=>{var e;let n=(0,m.A)(),[t,l]=(0,A.useState)(""),{data:a,loading:i}=function(e){let n={...eY,...e};return Y.IT(eZ,n)}({variables:{orgId:n}}),o=(null==a||null==(e=a.organization)?void 0:e.cashflowConnectedAccounts)||null,{recentAccounts:s,banksAndCards:c,otherAccounts:d,fixedAssets:u}=(0,A.useMemo)(()=>
1{if(!o)return{banksAndCards:[],fixedAssets:[],otherAccounts:[],recentAccounts:[]};let e=o.filter(e=>{let n=!t||e.name.toLowerCase().includes(t.toLowerCase());return e.reconciliationEnabled&&n}),[n,l]=eO()(e.sort((e,n)=>e.name.localeCompare(n.name)),e=>e.source===r.NsP.Wallet||e.ledgerAccountType&&eK.has(e.ledgerAccountType)),[a,i]=eO()(l,e=>!!e.ledgerAccountType&&eQ.has(e.ledgerAccountType));return{banksAndCards:n,fixedAssets:a,otherAccounts:i,recentAccounts:e.filter(e=>e.reconciledUpToDate).sort((e,n)=>n.reconciledUpToDate.localeCompare(e.reconciledUpToDate)).slice(0,5)}},[o,t]);return(0,A.useMemo)(()=>({banksAndCards:c,fixedAssets:u,isSearching:t.length>0,loading:i,otherAccounts:d,recentAccounts:s,setSearchTerm:l}),[c,u,i,d,s,l,t])})(),{showStatementUpload:k,showStatementList:F}=(()=>{let e=(0,p.fd)(),n=(0,g.A)("monthlyReconciliationServices");return(0,A.useMemo)(()=>{let t=f.A.hasAccessToMonthlyReconciliationServices(n)||!!e;return{loading:null===n,showStatementList:t,showStatementUpload:t}},[e,n])})(),I=(0,A.useRef)(null),R=(0,A.useMemo)(()=>({first:100,orgId:o}),[o]),{data:B,loading:P,refetch:T}=ea({fetchPolicy:"cache-and-network",skip:!F,variables:R}),D=null!=(a=null==B||null==(n=B.organization)||null==(e=n.attachments)?void 0:e.edges.map(e=>e.node))?a:[];ea({fetchPolicy:"cache-and-network",pollInterval:2e3,skip:!F||!D.some(e=>e.parsingStatus===r.mNp.Pending),variables:R});let _=(0,A.useCallback)(()=>{F&&T()},[F,T]);return(0,l.jsxs)(u.A,{top:[1,1.5,2],column:!0,spacing:2,children:[k&&(0,l.jsx)(ek,{onUploadComplete:_}),F&&(0,l.jsx)(eA,{statements:D,loading:P,refetch:T,isInternalUser:x}),(0,l.jsx)(d.A,{gutter:"responsive",children:(0,l.jsx)(h.A,{inputRef:I,refine:C,placeholder:"Search accounts...",size:"medium",fullWidth:!0,autoFocus:!0})}),!j&&w&&!y.length&&!v.length&&!S.length&&!b.length&&(w?(0,l.jsx)(c.A,{wrapperGutter:"responsive",message:"No matching accounts found.",cta:"Clear Search",onClick:()=>{var e,n;null==(e=I.current)||e.clear(),null==(n=I.current)||n.focus()}}):(0,l.jsx)(c.A,{wrapperGutter:"responsive",message:"No accounts found.",cta:"Connect Accounts",href:"/app/transactions"})),(j||S.length>0)&&(0,l.jsx)(eM,{title:"Recent",loading:j,accounts:S,collapsible:!0,startOpen:!0},"recent-".concat(S.length)),(j||v.length>0)&&(0,l.jsx)(eM,{title:"Banks and Cards",loading:j,accounts:v,collapsible:!0,startOpen:!0},"banks-and-cards-".concat(v.length)),(j||y.length>0)&&(0,l.jsx)(eM,{title:"Other Accounts",loading:j,accounts:y,collapsible:!0,startOpen:!0},"other-".concat(y.length)),b.length>0&&(0,l.jsx)(eM,{title:"Fixed Assets",loading:j,accounts:b,collapsible:!0,startOpen:(null!=(i=null==I||null==(t=I.current)?void 0:t.getValue())?i:"").length>0},"fixed-assets-".concat(b.length))]})};var e0=t(62867),e1=!0;let e2=()=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(e0.bV,{title:"Reconciliation",description:"Reconcile your accounts on Ambrook",openGraph:{description:"Reconcile your accounts on Ambrook"},noindex:!0}),(0,l.jsx)(o.A,{active:"accounting",children:(0,l.jsx)(a.A,{tab:i.x.Reconciliation,children:(0,l.jsx)(eX,{})})})]})}},e=>{e.O(0,[8992,16,4337,3737,8798,6371,4285,8185,3600,815,2455,3246,9117,8681,9479,1792,3736,9973,551,1651,2260,2762,1144,404,4274,7588,9843,5519,9560,3662,636,6593,8792],()=>e(e.s=16697)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.