PageSourceSearch

https://web.tide.co/6793.77bc4a9a3beb70af.js

js tide.co collected 2026-09-24 17:45:47 UTC 33,353 bytes, 1 lines download raw bytes

1(self.webpackChunkwebapp=self.webpackChunkwebapp||[]).push([[6793],{4465(J,E,t){t.d(E,{c:()=>S});var e=t(66992),m=t(44238),n=t(63880),D=t(6946),P=t(88830),A=t(66319);const v={getLedgerTransactionDetails:{endpoint:p=>`${p.API_V4_URL}/transaction-aggregator/transactions/ledger`,options:p=>({params:new e.HttpParams({fromObject:{transaction_id:p}}),headers:new e.HttpHeaders({accept:"application/vnd.tide.business-services.transaction-aggregator.get-ledger-transaction-response+json;version=2"})})},getManualTransactionDetails:{endpoint:p=>`${p.API_V4_URL}/transaction-aggregator/transactions/manual`,options:p=>({params:new e.HttpParams({fromObject:{transaction_id:p}}),headers:new e.HttpHeaders({accept:"application/vnd.tide.business-services.transaction-aggregator.get-manual-transaction-response+json;version=2"})})},deleteManualTransaction:{endpoint:(p,x)=>`${p.API_V4_URL}/manual-transaction/transactions/${x}`,options:()=>({headers:new e.HttpHeaders({accept:"application/vnd.tide.business-services.manual-transaction.transaction-delete-response+json;version=1","Idempotency-Key":(0,A.A)()})})}};let S=(()=>{class p{#t=(0,m.inject)(e.HttpClient);#n=(0,m.inject)(n.ENVIRONMENT);getManualTransactionDetails(s){const{endpoint:d,options:C}=v.getManualTransactionDetails;return this.#t.get(d(this.#n),C(s)).pipe((0,P.map)(({data:a})=>a))}getLedgerTransactionDetails(s){const{endpoint:d,options:C}=v.getLedgerTransactionDetails;return this.#t.get(d(this.#n),C(s)).pipe((0,P.map)(({data:a})=>a))}getTransactionDetails(s,d){return d===D.hq.Ledger?this.getLedgerTransactionDetails(s):this.getManualTransactionDetails(s)}deleteManualTransaction(s){const{endpoint:d,options:C}=v.deleteManualTransaction;return this.#t.delete(d(this.#n,s),C()).pipe((0,P.map)(({data:a})=>a))}static{this.\u0275fac=function(d){return new(d||p)}}static{this.\u0275prov=m.\u0275\u0275defineInjectable({token:p,factory:p.\u0275fac,providedIn:"root"})}}return p})()},49665(J,E,t){t.d(E,{Ev:()=>$});var e=t(44238),m=t(72743),n=t(61803),D=t(8275),P=t(35729),A=t(90045),v=t(44098),S=t(74943),p=t(66992),x=t(63880),s=t(88830);const d={createAttachment:{endpoint:(i,h,y)=>`${i.API_URL}/v3/timeline/accounts/${h}/transactions/${y}/attachments`,options:i=>{const h=new FormData;return h.append("file",i,i.name),h}},deleteAttachment:{endpoint:(i,h,y,j)=>`${i.API_URL}/v3/timeline/accounts/${h}/transactions/${y}/attachments/${j}`},getAttachment:{endpoint:(i,h,y,j)=>`${i.API_URL}/v3/timeline/accounts/${h}/transactions/${y}/attachments/${j}`},getPdfAttachment:{endpoint:(i,h,y,j)=>`${i.API_URL}/v3/timeline/accounts/${h}/transactions/${y}/attachments/${j}/contents`}};let C=(()=>{class i{#t=(0,e.inject)(p.HttpClient);#n=(0,e.inject)(x.ENVIRONMENT);createAttachment(y,j,W){const{endpoint:X,options:Z}=d.createAttachment;return this.#t.post(X(this.#n,y,j),Z(W)).pipe((0,s.map)(({data:tt})=>tt))}getAttachment(y,j,W,X="image"){return"application/pdf"==X?this.#t.get(d.getPdfAttachment.endpoint(this.#n,y,j,W),{responseType:"blob"}):this.#t.get(d.getAttachment.endpoint(this.#n,y,j,W)).pipe((0,s.map)(({data:Z})=>Z))}deleteAttachment(y,j,W){const{endpoint:X}=d.deleteAttachment;return this.#t.delete(X(this.#n,y,j,W))}static{this.\u0275fac=function(j){return new(j||i)}}static{this.\u0275prov=e.\u0275\u0275defineInjectable({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var a=t(7029),f=t(38003),I=t(28624);const o=["a1b2c3d4-e5f6-7890-abcd-ef1234567001","a1b2c3d4-e5f6-7890-abcd-ef1234567002","a1b2c3d4-e5f6-7890-abcd-ef1234567003","a1b2c3d4-e5f6-7890-abcd-ef1234567000"];function c(i,h){return function r(i){return!!i&&"error"in i&&"file"in i}(h)?{...i,failed:[...i.failed,h]}:{...i,successful:[...i.successful,h]}}const M={"a1b2c3d4-e5f6-7890-abcd-ef1234567001":"FILE_SIZE_ERROR_CODE","a1b2c3d4-e5f6-7890-abcd-ef1234567002":"FILE_EXTENSION_ERROR_CODE","a1b2c3d4-e5f6-7890-abcd-ef1234567003":"FILE_NAME_ERROR_CODE","a1b2c3d4-e5f6-7890-abcd-ef1234567000":"GENERIC_ERROR_CODE"},V={FILE_SIZE_ERROR_CODE:" The file you\u2019re uploading is too big, the limit is 10MB",FILE_EXTENSION_ERROR_CODE:" The file isn\u2019t the right type, it should be PDF, JPEG, JPG, or PNG",FILE_NAME_ERROR_CODE:" The file name has special characters, it should contain letters and numbers only",GENERIC_ERROR_CODE:" Something went wrong. Please try again later "};var N=t(37938),L=t(44709),z=t(40896),G=t(54282),O=t(62953);function $(){return(0,n.Mj)((0,L.A)((0,G.Kr)(),(0,S.y)()),(0,n.Q2)({failedAttachments:(0,n.NW)()}),(0,v.w)({attachmentId:i=>i}),(0,O.MF)(a.t.Attachments),(0,n.QO)(({attachmentsRequestStatus:i,failedAttachments:h})=>({isUploadingAttachments:(0,e.computed)(()=>i()===a.u.UpsertPending),uploadFailureDialogData:(0,e.computed)(()=>i()===a.u.UpsertFailed&&h()?.length>0?function u(i){const h=i.map(X=>{const Z=X.error,tt=Z instanceof p.HttpErrorResponse?Z.error.message:null,at=function l(i){return o.includes(i)}
1(tt)?M[tt]:"GENERIC_ERROR_CODE";return`<b>${X.file.name}</b> - ${V[at]}<br>`}).join("");return{header:{title:"Upload failed"},body:`${"We were unable to upload the following file(s):"}<br> \n    ${h} \n    ${"Please try again."}`,actions:[{text:"Ok",type:I._.Ok,variant:f.Me.Primary}]}}(h()):null)})),(0,n.RI)((i,h=(0,e.inject)(C),y=(0,e.inject)(P.z),j=(0,e.inject)(A.o))=>({uploadAttachments:(0,D.o)((0,s.pipe)((0,s.tap)(()=>(0,n.M8)(i,(0,O.Px)(a.t.Attachments,a.u.UpsertPending))),(0,s.exhaustMap)(W=>(0,s.from)(W).pipe((0,s.mergeMap)(X=>h.createAttachment(i.transaction().accountId,i.transaction().id,X).pipe((0,s.retry)({count:1}),(0,s.tap)(Z=>(0,n.M8)(i,function K(i){return h=>{const y=(0,N.z)(a.t.Attachments,h.transaction);return(0,O.G9)(a.t.Attachments,[...y,...i])(h)}}([Z]))),(0,s.tap)(()=>y.open({message:"Attachment saved"})),(0,s.catchError)(function Q(i){return h=>(0,s.of)({file:i,error:h})}(X)))),(0,s.reduce)(c,{successful:[],failed:[]}),(0,s.tap)(({successful:X,failed:Z})=>(0,n.M8)(i,function T(i){return{failedAttachments:i}}(Z),(0,O.Px)(a.t.Attachments,X.length?a.u.UpsertSuccess:a.u.UpsertFailed))))))),openAttachment:(0,D.o)((0,s.pipe)((0,s.switchMap)(W=>h.getAttachment(i.transaction().accountId,i.transaction().id,W.id,W.mediaType).pipe((0,m.Hn)({next:X=>function g(i){if(i instanceof Blob){const j=URL.createObjectURL(new Blob([i],{type:"application/pdf"}));return void window.open(j)}const h=window.open("about:blank"),y=new Image;y.src=`data:${i.mediaType};base64,${i.payload}`,setTimeout(function(){h?.document.write(y.outerHTML)},0)}(X),error:z.A}))))),deleteAttachment:(0,D.o)((0,s.pipe)((0,s.tap)(()=>(0,n.M8)(i,(0,O.Px)(a.t.Attachments,a.u.DeletePending))),(0,s.switchMap)(W=>h.deleteAttachment(i.transaction().accountId,i.transaction().id,W.id).pipe((0,m.Hn)({next:()=>{y.open({message:"Attachment deleted"}),(0,n.M8)(i,function R(i){return h=>{const y=(0,N.z)(a.t.Attachments,h.transaction);return(0,O.G9)(a.t.Attachments,y?.filter(({id:j})=>j!==i.id))(h)}}(W),(0,O.Px)(a.t.Attachments,a.u.DeleteSuccess))},error:()=>(0,n.M8)(i,(0,O.Px)(a.t.Attachments,a.u.DeleteFailed)),finalize:()=>i.closeDrawer({queryParamsHandling:"merge"})}))))),openFailedUploadDialog:(0,D.o)((0,s.pipe)((0,s.filter)(W=>null!==W),(0,s.exhaustMap)(W=>(j.openDialog(W),j.dialogClose$))))})))}},12642(J,E,t){t.d(E,{do:()=>$,gT:()=>G});var e=t(44238),m=t(72743),n=t(61803),D=t(8275),P=t(2140),A=t(36351),v=t(74943),S=t(33425),p=t(66992),x=t(63880),s=t(6946),d=t(88830),C=t(66319);const a={updateLedgerTransactionCategory:{endpoint:(T,K,R)=>`${T.API_V4_URL}/categorisation/transactions/${encodeURI(K.toString())}/schemes/${encodeURI(R.toString())}`,options:()=>({headers:new p.HttpHeaders({accept:"application/vnd.tide.business-services.categorisation.transaction-category+json;version=1","content-type":"application/vnd.tide.business-services.categorisation.set-category-request+json;version=1","idempotency-key":(0,C.A)()})})},deleteLedgerTransactionCategory:{endpoint:(T,K,R)=>`${T.API_V4_URL}/categorisation/transactions/${encodeURI(K.toString())}/schemes/${encodeURI(R.toString())}`,options:()=>({headers:new p.HttpHeaders({accept:"application/vnd.tide.business-services.categorisation.transaction-category+json;version=1","content-type":"application/vnd.tide.business-services.categorisation.set-category-request+json;version=1","idempotency-key":(0,C.A)()})})},updateTransactionsCategories:{endpoint:T=>`${T.API_V4_URL}/categorisation/transactions`,options:()=>({headers:new p.HttpHeaders({accept:"application/vnd.tide.business-services.categorisation.bulk-transaction-categorisation-response+json;version=1","content-type":"application/vnd.tide.business-services.categorisation.bulk-transaction-categorisation-request+json;version=1","idempotency-key":(0,C.A)()})})},overrideTransactionCategorisation:{endpoint:T=>`${T.API_V4_URL}/categorisation/rules`,options:()=>({headers:new p.HttpHeaders({accept:"application/vnd.tide.business-services.categorisation.create-rule+json;version=1","content-type":"application/vnd.tide.business-services.categorisation.create-rule+json;version=1","idempotency-key":(0,C.A)()})})}};let f=(()=>{class T{#t=(0,e.inject)(p.HttpClient);#n=(0,e.inject)(x.ENVIRONMENT);updateLedgerTransactionCategory(R,Q,i){return i?this.#e(R,Q,i):this.#a(R,Q)}#e(R,Q,i){const{endpoint:h,options:y}=a.updateLedgerTransactionCategory;return this.#t.put(h(this.#n,R,Q),{categoryId:i},y()).pipe((0,d.map)(({data:j})=>
1({id:j.categoryId,schemeId:j.schemeId})))}#a(R,Q){const{endpoint:i,options:h}=a.deleteLedgerTransactionCategory;return this.#t.delete(i(this.#n,R,Q),h()).pipe((0,d.map)(({data:y})=>y))}updateManualTransactionCategory(R,Q){return this.updateTransactionsCategories([{transactionId:R,transactionSource:s.hq.Manual}],Q).pipe((0,d.map)(([{id:i,schemeId:h}])=>({id:i,schemeId:h})))}updateTransactionsCategories(R,Q){const{endpoint:i,options:h}=a.updateTransactionsCategories;return this.#t.post(i(this.#n),{categoryId:Q,transactions:R},h()).pipe((0,d.map)(({data:y})=>y.transactionCategoryList.map(({categoryId:j,...W})=>({...W,id:j}))))}overrideTransactionCategorisation(R,Q){const{endpoint:i,options:h}=a.overrideTransactionCategorisation;return this.#t.put(i(this.#n),{categoryId:Q,transactionIds:[R]},h())}static{this.\u0275fac=function(Q){return new(Q||T)}}static{this.\u0275prov=e.\u0275\u0275defineInjectable({token:T,factory:T.\u0275fac,providedIn:"root"})}}return T})();var I=t(31060),o=t(7029),U=t(43604),l=t(81380),r=t(35729),c=t(43202),g=t(2268),M=t(65800),V=t(44709),u=t(40896),N=t(54282),L=t(62953),z=t(15098);function G(){return(0,n.Mj)((0,V.A)((0,N.Kr)(),(0,v.y)()),(0,L.MF)(o.t.Category),function O(){return(0,n.Mj)((0,N.Kr)(),(0,n.Q2)(()=>({_categorisationOverrideConfig:(0,e.inject)(P.FlagsService).variation(A.S.AccountingEnrichmentsCustomRules,S.P)||S.P})),(0,n.QO)(T=>({isCategorisationOverrideEnabled:(0,e.computed)(()=>T._categorisationOverrideConfig?.enabled),isTransactionCategorisationOverridable:(0,e.computed)(()=>{const K=T._categorisationOverrideConfig(),{creditOrDebit:R,proprietaryBankTransactionCode:Q}=T.basicTransactionDetails();return(0,c.A)(K,Q,R)})})),(0,n.RI)((T,K=(0,e.inject)(U.TrackingService))=>({trackCategorisationOverrideShown:()=>K.trackEvent(I.P.TACategorizationOverrideShown,{source:"Web"}),trackCategorisationOverrideSaved:R=>K.trackEvent(I.P.TACategorizationOverrideSaved,{transactionType:(0,g.Sw)(T.basicTransactionDetails().creditOrDebit,T.basicTransactionDetails().proprietaryBankTransactionCode),category:R,source:"Web"})})),(0,n.RI)((T,K=(0,e.inject)(f))=>({overrideTransactionCategorisation:(0,D.o)((0,d.pipe)((0,d.tap)(({categoryId:R})=>T.trackCategorisationOverrideSaved(R)),(0,d.switchMap)(({categoryId:R})=>K.overrideTransactionCategorisation(T.transaction().id,R).pipe((0,m.Hn)({next:u.A,error:u.A})))))})))}(),(0,n.QO)((T,K=(0,e.inject)(l.Store))=>{const R=K.selectSignal(z.M.selectSchemeId);return{schemeId:(0,e.computed)(()=>R()),isUpdatingCategory:(0,e.computed)(()=>T.categoryRequestStatus()===o.u.UpsertPending)}}),(0,n.RI)((T,K=(0,e.inject)(f),R=(0,e.inject)(r.z))=>{const Q=(i,h)=>{const{categoryId:y,overrideCategorisation:j,transactionSource:W}=i,X=T.schemeId(),Z=y!==M.AK.Uncategorised?y:null;return(0,n.M8)(T,(0,L.Px)(o.t.Category,o.u.UpsertPending),(0,L.Gx)(o.t.Category)),(0,d.iif)(()=>W===s.hq.Ledger,K.updateLedgerTransactionCategory(T.transaction().id,X,Z),K.updateManualTransactionCategory(T.transaction().id,Z)).pipe((0,m.Hn)({next:tt=>(0,n.M8)(T,(0,L.G9)(o.t.Category,tt),(0,L.Px)(o.t.Category,o.u.UpsertSuccess)),error:()=>{const tt="Category could not be saved. Please try again";(0,n.M8)(T,(0,L.Px)(o.t.Category,o.u.UpsertFailed),(0,L.Vz)(o.t.Category,tt))},complete:()=>{j&&T.overrideTransactionCategorisation({categoryId:y}),h?.closeDrawer&&(T.closeDrawer({queryParamsHandling:"merge"}),R.open({message:"Category saved"}))}}))};return{updateTransactionCategory$:Q,updateTransactionCategory:(0,D.o)((0,d.pipe)((0,d.exhaustMap)(i=>Q(i,{closeDrawer:!0}))))}}))}function $(){return{state:(0,n.NW)(),props:(0,n.NW)(),methods:(0,n.NW)()}}},54282(J,E,t){t.d(E,{Kr:()=>I,Vy:()=>U,bk:()=>f,u:()=>o});var e=t(44238),m=t(72743),n=t(61803),D=t(8275),P=t(35729),A=t(5608),v=t(56538),S=t(74943),p=t(6946),x=t(85687),s=t(2268),d=t(40896),C=t(88830),a=t(4465);function f(){return(0,n.Mj)((0,S.y)(),(0,v.i)({transactionDetailsRequestStatus:A.O.Init}),(0,n.Q2)({transaction:null,changes:{}}),(0,n.QO)(({transaction:l,transactionDetailsRequestStatus:r})=>{const c=(0,n.G6)(()=>(0,x.o)(p.cu.BasicTransactionDetails,l())?.payload);
1return{basicTransactionDetails:c,isCashTransaction:(0,e.computed)(()=>(0,s.wE)(c()?.proprietaryBankTransactionCode)),isLoadingTransactionDetails:(0,e.computed)(()=>r()===A.O.Loading)}}),(0,n.RI)((l,r=(0,e.inject)(a.c),c=(0,e.inject)(P.z))=>({fetchTransaction:(0,D.o)((0,C.pipe)((0,C.filter)(({transactionId:g})=>!!g),(0,C.tap)(()=>(0,n.M8)(l,o(A.O.Loading))),(0,C.exhaustMap)(({transactionId:g,transactionSource:M})=>r.getTransactionDetails(g,M).pipe((0,m.Hn)({next:V=>(0,n.M8)(l,U(V),o(A.O.Loaded)),error:()=>(0,n.M8)(l,o(A.O.Error))}))))),deleteManualTransaction:(0,D.o)((0,C.pipe)((0,C.switchMap)(({transactionId:g})=>r.deleteManualTransaction(g)),(0,m.Hn)({next:()=>{c.open({message:"Transaction deleted successfully"}),l.closeSidesheet({queryParamsHandling:"merge"})},error:d.A})))})))}function I(){return{state:(0,n.NW)(),methods:(0,n.NW)(),props:(0,n.NW)()}}function o(l){return{transactionDetailsRequestStatus:l}}function U(l){return{transaction:l}}},6793(J,E,t){t.d(E,{DP:()=>r,hi:()=>l,mh:()=>U,st:()=>o});var e=t(44238),m=t(61803),n=t(44098),D=t(74943),P=t(74687),A=t(2268),v=t(49665),S=t(12642),p=t(54282),x=t(71354),s=t(27167),d=t(46347),C=t(95193),a=t(35155),f=t(81380),I=t(15098);const o=(0,m.Eu)((0,D.p)(),(0,p.bk)(),(0,n.w)({transactionId:c=>c,transactionSource:c=>(0,P.o)(c)}),(0,m.QO)(c=>({isManualTransaction:(0,e.computed)(()=>(0,A.LF)(c.transactionSource())),isLedgerTransaction:(0,e.computed)(()=>(0,A.i2)(c.transactionSource())),transactionRouteParams:(0,e.computed)(()=>({transactionId:c.transactionId(),transactionSource:c.transactionSource()}))})),(0,S.gT)(),(0,x.F)(),(0,s.$)(),(0,d.i)(),(0,v.Ev)(),(0,C.d)(),(0,m.QO)((c,g=(0,e.inject)(f.Store))=>{const M=g.selectSignal(I.M.selectSchemeCategoriesMap);return{splitTransactionCategories:(0,e.computed)(()=>Object.fromEntries(c.splitTransactions()?.map(V=>V.categoryId)?.filter(V=>null!=V)?.map(V=>[V,M()[V]])??[])),categoryViewModel:(0,e.computed)(()=>c.category()?.id?M()[c.category().id]:a.hi)}}),(0,m.TK)((c,g=(0,e.inject)(U,{optional:!0}))=>({onInit:()=>c.fetchTransaction(c.transactionRouteParams),onDestroy:()=>g?.(c.changes(),c.transaction().id)}))),U=new e.InjectionToken("TRANSACTION_DETAILS_SIDESHEET_CLOSE_CALLBACK");function l(c){return{provide:U,useFactory:c}}function r(c){return c?[c,{provide:o,useExisting:c}]:[o]}},62953(J,E,t){t.d(E,{G9:()=>p,Gx:()=>C,MF:()=>S,Px:()=>s,Vz:()=>d,m4:()=>x});var e=t(44238),m=t(61803),n=t(56538),D=t(10784),P=t(7029),A=t(37938),v=t(54282);function S(r){return(0,m.Mj)((0,v.Kr)(),(0,m.QO)(c=>({[r]:(0,e.computed)(()=>(0,A.z)(r,c.transaction()))})),function I(r){return(0,m.Mj)((0,n.i)(function f(r){return{[a(r)]:P.u.Init}}(r)))}(r),function l(r){return(0,m.Mj)((0,D.p)(function U(r){return{[o(r)]:null}}(r)))}(r))}function p(r,c){return g=>{const M=(0,A.z)(r,g.transaction);return{transaction:(0,A.N)(r,c,g.transaction),changes:{...g.changes,[r]:{previous:M,current:c}}}}}function x(r){return p(r,null)}function s(r,c){return(0,n.k)({[a(r)]:c})}function d(r,c){return(0,D.j)({[o(r)]:c})}function C(r){return d(r,null)}function a(r){return`${r}RequestStatus`}function o(r){return`${r}UpdateError`}},71354(J,E,t){t.d(E,{F:()=>I});var e=t(44238),m=t(72743),n=t(61803),D=t(8275),P=t(35729),A=t(74943),v=t(66992),S=t(63880),p=t(88830);const x_createNote={endpoint:(o,U,l)=>`${o.API_URL}/v3/timeline/accounts/${U}/transactions/${l}/notes`},x_updateNote={endpoint:(o,U,l,r)=>`${o.API_URL}/v3/timeline/accounts/${U}/transactions/${l}/notes/${r}`},x_deleteNote={endpoint:(o,U,l,r)=>`${o.API_URL}/v3/timeline/accounts/${U}/transactions/${l}/notes/${r}`};let s=(()=>{class o{#t=(0,e.inject)(v.HttpClient);#n=(0,e.inject)(S.ENVIRONMENT);createNote(l,r,c){const{endpoint:g}=x_createNote;return this.#t.post(g(this.#n,l,r),c).pipe((0,p.map)(({data:M})=>M))}updateNote(l,r,c){const{endpoint:g}=x_updateNote;return this.#t.put(g(this.#n,l,r,c.id),c).pipe((0,p.map)(({data:M})=>M))}deleteNote(l,r,c){const{endpoint:g}=x_deleteNote;return this.#t.delete(g(this.#n,l,r,c.id)).pipe((0,p.map)(({data:M})=>M))}static{this.\u0275fac=function(r){return new(r||o)}}static{this.\u0275prov=e.\u0275\u0275defineInjectable({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o}
1)();var d=t(7029),C=t(44709),a=t(54282),f=t(62953);function I(){return(0,n.Mj)((0,C.A)((0,a.Kr)(),(0,A.y)()),(0,f.MF)(d.t.Note),(0,n.RI)((o,U=(0,e.inject)(s),l=(0,e.inject)(P.z))=>({createNote:(0,D.o)((0,p.pipe)((0,p.tap)(()=>(0,n.M8)(o,(0,f.Px)(d.t.Note,d.u.UpsertPending))),(0,p.exhaustMap)(r=>U.createNote(o.transaction().accountId,o.transaction().id,r).pipe((0,m.Hn)({next:c=>(0,n.M8)(o,(0,f.G9)(d.t.Note,c),(0,f.Px)(d.t.Note,d.u.UpsertSuccess)),error:()=>(0,n.M8)(o,(0,f.Px)(d.t.Note,d.u.UpsertFailed)),complete:()=>{o.closeDrawer({queryParamsHandling:"merge"}),l.open({message:"Note saved"})}}))))),updateNote:(0,D.o)((0,p.pipe)((0,p.tap)(()=>(0,n.M8)(o,(0,f.Px)(d.t.Note,d.u.UpsertPending))),(0,p.exhaustMap)(r=>U.updateNote(o.transaction().accountId,o.transaction().id,{id:o.note().id,...r}).pipe((0,m.Hn)({next:c=>(0,n.M8)(o,(0,f.G9)(d.t.Note,c),(0,f.Px)(d.t.Note,d.u.UpsertSuccess)),error:()=>(0,n.M8)(o,(0,f.Px)(d.t.Note,d.u.UpsertFailed)),complete:()=>{o.closeDrawer({queryParamsHandling:"merge"}),l.open({message:"Note saved"})}}))))),deleteNote:(0,D.o)((0,p.pipe)((0,p.tap)(()=>(0,n.M8)(o,(0,f.Px)(d.t.Note,d.u.DeletePending))),(0,p.exhaustMap)(()=>U.deleteNote(o.transaction().accountId,o.transaction().id,o.note()).pipe((0,m.Hn)({next:()=>(0,n.M8)(o,(0,f.m4)(d.t.Note),(0,f.Px)(d.t.Note,d.u.DeleteSuccess)),error:()=>(0,n.M8)(o,(0,f.Px)(d.t.Note,d.u.DeleteFailed)),complete:()=>{o.closeDrawer({queryParamsHandling:"merge"}),l.open({message:"Note deleted"})}})))))})))}},27167(J,E,t){t.d(E,{G:()=>g,$:()=>c});var e=t(44238),m=t(72743),n=t(61803),D=t(8275),P=t(20402),A=t(35729),v=t(36351),S=t(66992),p=t(63880),x=t(88830),s=t(66319);const d={updateSalesTax:{endpoint:(M,V,u)=>`${M.API_V4_URL}/vat/accounts/${V}/transactions/${u}/vat`,endpointV2:(M,V,u)=>`${M.API_V4_URL}/tax-management/accounts/${V}/transactions/${u}/tax`,optionsV2:()=>({headers:new S.HttpHeaders({accept:"application/vnd.tide.tax-management.tax.transaction-res+json;version=1","content-type":"application/vnd.tide.tax-management.tax.transaction-req+json;version=1","idempotency-key":(0,s.A)()})}),options:()=>({headers:new S.HttpHeaders({accept:"application/vnd.tide.business-services.vat.transaction+json;version=1","content-type":"application/vnd.tide.business-services.vat.transaction+json;version=1","idempotency-key":(0,s.A)()})})},createCustomRule:{endpoint:M=>`${M.API_V4_URL}/vat/rules`,options:()=>({headers:new S.HttpHeaders({"content-type":"application/vnd.tide.business-services.create-custom-rule+json;version=1","idempotency-key":(0,s.A)()})})}};var C=t(93934);let a=(()=>{class M{#t=(0,e.inject)(S.HttpClient);#n=(0,e.inject)(p.ENVIRONMENT);#e=(0,e.inject)(P.AccessService);updateSalesTax(u,N,L,z){return this.#e.hasAccess({flags:[v.S.AdminCompanyProfile]})?this._updateSalesTaxPost(u,N,L,z):this._updateSalesTaxPut(u,N,L,z)}_updateSalesTaxPost(u,N,L,z){const{endpointV2:G,optionsV2:O}=d.updateSalesTax;return this.#t.post(G(this.#n,u,N),{data:{...L,transactionSource:z}},O()).pipe((0,x.map)(({data:$})=>({salesTaxAmount:$.taxDetails.taxAmount.amount,salesTaxId:$.taxDetails.taxSlab.id,salesTaxCustom:!$.taxDetails.taxSlab.id})))}_updateSalesTaxPut(u,N,L,z){const{endpoint:G,options:O}=d.updateSalesTax;return this.#t.put(G(this.#n,u,N),{data:{...L,transactionSource:z}},O()).pipe((0,x.map)(({data:$})=>(0,C.Rx)($.vat)))}createCustomRule(u,N){const{endpoint:L,options:z}=d.createCustomRule;return this.#t.put(L(this.#n),{data:{transactionIds:[u],vatRateId:N}},z())}static{this.\u0275fac=function(N){return new(N||M)}}static{this.\u0275prov=e.\u0275\u0275defineInjectable({token:M,factory:M.\u0275fac,providedIn:"root"})}}return M})();var f=t(74943),I=t(30765),o=t(44709),U=t(40896),l=t(54282),r=t(62953);function c(){return(0,n.Mj)((0,o.A)((0,l.Kr)(),(0,f.y)()),(0,r.MF)(I.t.SalesTax),(0,n.RI)((M,V=(0,e.inject)(a),u=(0,e.inject)(A.z),N=(0,e.inject)(P.AccessService))=>{const L=(0,D.o)((0,x.pipe)((0,x.exhaustMap)(({vatRateId:G})=>V.createCustomRule(M.transaction().id,G).pipe((0,m.Hn)({next:U.A,error:U.A}))))),z=(G,O)=>{const{transactionSource:$,salesTax:T}=G;return(0,n.M8)(M,(0,r.Px)(I.t.SalesTax,I.u.UpsertPending),(0,r.Gx)(I.t.SalesTax)),V.updateSalesTax(M.transaction().accountId,M.transaction().id,T,$).pipe((0,m.Hn)({next:K=>(0,n.M8)(M,(0,r.G9)(I.t.SalesTax,K),(0,r.Px)(I.t.SalesTax,I.u.UpsertSuccess)),error:()=>{const K="VAT amount could not be saved. Please try again";(0,n.M8)(M,(0,r.Vz)(I.t.SalesTax,K),(0,r.Px)(I.t.SalesTax,I.u.UpsertFailed))},complete:()=>{G.createCustomRule&&(0,C.uI)(G.salesTax)&&N.hasAccess({flags:[v.S.AccountingAutoVAT]})&&L({vatRateId:G.salesTax.rate.id}),O?.closeDrawer&&(M.closeDrawer(),u.open({message:"VAT rate saved"}))}}))};return{updateSalesTax$:z,updateSalesTax:(0,D.o)((0,x.pipe)((0,x.exhaustMap)(G=>z(G,{closeDrawer:!0}))))}}))}function g(){return{state:(0,n.NW)(),props:(0,n.NW)(),methods:(0,n.NW)()}}},46347(J,E,t){t.d(E,{i:()=>V});var e=t(44238),m=t(72743),n=t(61803),D=t(8275),P=t(66992),A=t(63880),v=t(88830),S=t(66319);const p={updateSplitTransaction:{endpoint:u=>`${u.API_V4_URL}/split-transactions`,options:()=>({headers:new P.HttpHeaders({"content-type":"application/vnd.tide.business-services.split.transaction.request+json;
1version=1","idempotency-key":(0,S.A)()})})},deleteSplitTransaction:{endpoint:(u,N)=>`${u.API_V4_URL}/split-transactions/${N}`,options:()=>({headers:new P.HttpHeaders({"content-type":"application/vnd.tide.business-services.split.transaction.delete-request+json;version=1","idempotency-key":(0,S.A)()})})}};let x=(()=>{class u{#t=(0,e.inject)(P.HttpClient);#n=(0,e.inject)(A.ENVIRONMENT);splitTransaction(L,z,G){const{endpoint:O,options:$}=p.updateSplitTransaction;return this.#t.put(O(this.#n),{transactionId:L,accountId:z,splitTransactions:G},$()).pipe((0,v.map)(({data:T})=>T))}deleteSplitTransaction(L){const{endpoint:z,options:G}=p.deleteSplitTransaction;return this.#t.delete(z(this.#n,L),G())}static{this.\u0275fac=function(z){return new(z||u)}}static{this.\u0275prov=e.\u0275\u0275defineInjectable({token:u,factory:u.\u0275fac,providedIn:"root"})}}return u})();var s=t(7029),d=t(35729),C=t(93587),a=t(74943),f=t(4465),I=t(37938),o=t(43202),U=t(93934),l=t(44709),r=t(12642),c=t(54282),g=t(62953),M=t(27167);function V(){return(0,n.Mj)((0,l.A)((0,c.Kr)(),(0,r.do)(),(0,M.G)(),(0,a.y)()),(0,g.MF)(s.t.isSplit),(0,g.MF)(s.t.SplitTransactions),(0,n.QO)(({splitTransactionsRequestStatus:u,salesTaxUpdateError:N,categoryUpdateError:L})=>({isSplitTransactionLoading:(0,e.computed)(()=>u()===s.u.UpsertPending),allocationRequestErrors:(0,e.computed)(()=>[N(),L()].filter(Boolean))})),(0,n.RI)((u,N=(0,e.inject)(x),L=(0,e.inject)(f.c),z=(0,e.inject)(d.z))=>({updateSplitTransactions:(0,D.o)((0,v.pipe)((0,v.tap)(()=>(0,n.M8)(u,(0,g.Px)(s.t.SplitTransactions,s.u.UpsertPending))),(0,v.switchMap)(({splitTransactions:O})=>N.splitTransaction(u.transaction().id,u.transaction().accountId,O).pipe((0,m.Hn)({next:({splitTransactions:$})=>(0,n.M8)(u,(0,g.m4)(s.t.Category),(0,g.m4)(s.t.SalesTax),(0,g.G9)(s.t.isSplit,!0),(0,g.G9)(s.t.SplitTransactions,$),(0,g.Px)(s.t.SplitTransactions,s.u.UpsertSuccess)),error:()=>(0,n.M8)(u,(0,g.Px)(s.t.SplitTransactions,s.u.UpsertFailed)),complete:()=>{z.open({message:"Split transaction saved"}),u.closeDrawer({queryParamsHandling:"merge"})}}))))),updateCategoryAndSalesTax:(0,D.o)((0,v.pipe)((0,v.tap)(()=>(0,n.M8)(u,(0,g.Px)(s.t.SplitTransactions,s.u.UpsertPending))),(0,v.exhaustMap)(O=>(0,v.iif)(()=>!!u.isSplit(),N.deleteSplitTransaction(u.transaction().id).pipe((0,v.switchMap)(()=>L.getLedgerTransactionDetails(u.transaction().id).pipe((0,C.NV)(1e3,10,O=>!(0,I.z)(s.t.isSplit,O)),(0,v.tap)(()=>(0,n.M8)(u,(0,g.G9)(s.t.isSplit,!1),(0,g.m4)(s.t.SplitTransactions)))))),v.EMPTY).pipe((0,v.map)(()=>O),(0,v.defaultIfEmpty)(O))),(0,v.map)(({category:O,salesTax:$,transactionSource:T})=>{const K=[];return(0,o.T)(O,u.category())&&K.push({update:()=>u.updateTransactionCategory$({...O,transactionSource:T}),requestStatus:u.categoryRequestStatus}),null!==$&&(0,U.uu)($.salesTax,u.salesTax())&&K.push({update:()=>u.updateSalesTax$({...$,transactionSource:T}),requestStatus:u.salesTaxRequestStatus}),K}),(0,v.exhaustMap)(O=>(0,v.from)(O).pipe((0,v.mergeMap)(({update:$})=>$(),O.length),(0,v.toArray)(),(0,v.map)(()=>O.every(({requestStatus:$})=>$()===s.u.UpsertSuccess)?s.u.UpsertSuccess:s.u.UpsertFailed),(0,m.Hn)({next:$=>(0,n.M8)(u,(0,g.Px)(s.t.SplitTransactions,$)),error:()=>(0,n.M8)(u,(0,g.Px)(s.t.SplitTransactions,s.u.UpsertFailed)),complete:()=>{u.splitTransactionsRequestStatus()===s.u.UpsertSuccess&&u.closeDrawer({queryParamsHandling:"merge"})}}))))),clearSplitTransactionErrors:()=>(0,n.M8)(u,(0,g.Gx)(s.t.SplitTransactions),(0,g.Gx)(s.t.Category),(0,g.Gx)(s.t.SalesTax))})))}},95193(J,E,t){t.d(E,{d:()=>U});var e=t(44238),m=t(72743),n=t(61803),D=t(8275),P=t(5608),A=t(10784),v=t(56538),S=t(74943),p=t(66992),x=t(88830),s=t(63880);const d_createCompanyTag={endpoint:l=>`${l.API_URL}/v3/timeline/tags`},d_updateTransactionTags={endpoint:(l,r,c)=>`${l.API_URL}/v3/timeline/accounts/${r}/transactions/${c}/tags`};let C=(()=>{class l{#t=(0,e.inject)(p.HttpClient);#n=(0,e.inject)(s.ENVIRONMENT);createCompanyTag(c){const{endpoint:g}=d_createCompanyTag;return this.#t.post(g(this.#n),{tag:c}).pipe((0,x.map)(({data:M})=>M))}updateTransactionTags(c,g,M){const{endpoint:V}=d_updateTransactionTags;return this.#t.put(V(this.#n,c,g),{tagIds:M}).pipe((0,x.map)(({data:u})=>u))}static{this.\u0275fac=function(g){return new(g||l)}}static{this.\u0275prov=e.\u0275\u0275defineInjectable({token:l,factory:l.\u0275fac,providedIn:"root"})}}return l})();var a=t(7029),f=t(44709),I=t(54282),o=t(62953);function U(){return(0,n.Mj)((0,f.A)((0,I.Kr)(),(0,S.y)()),(0,A.p)({createTagRequestError:(0,n.NW)()}),(0,v.i)({createTagRequestStatus:P.O.Init}),(0,o.MF)(a.t.Tags),(0,n.RI)((l,r=(0,e.inject)(C))=>({createCompanyTag:(0,D.o)((0,x.pipe)((0,x.tap)(()=>(0,n.M8)(l,(0,v.k)({createTagRequestStatus:P.O.Loading}),(0,A.j)({createTagRequestError:null}))),(0,x.exhaustMap)(c=>r.createCompanyTag(c).pipe((0,m.Hn)({next:g=>{l.closeDrawer({queryParamsHandling:"merge",state:{createdCompanyTag:g}}),(0,n.M8)(l,(0,v.k)({createTagRequestStatus:P.O.Loaded}),(0,A.j)({createTagRequestError:null}))},error:({error:g})=>{(0,n.M8)(l,(0,v.k)({createTagRequestStatus:P.O.Error}),(0,A.j)({createTagRequestError:g}))}}))))),updateTransactionTags:(0,D.o)((0,x.pipe)((0,x.tap)(()=>(0,n.M8)(l,(0,o.Px)(a.t.Tags,a.u.UpsertPending))),(0,x.exhaustMap)(c=>r.updateTransactionTags(l.transaction().accountId,l.transaction().id,c).pipe((0,m.Hn)({next:({tags:g})=>
1(0,n.M8)(l,(0,o.G9)(a.t.Tags,g),(0,o.Px)(a.t.Tags,a.u.UpsertSuccess)),error:()=>(0,n.M8)(l,(0,o.Px)(a.t.Tags,a.u.UpsertFailed)),complete:()=>l.closeDrawer({queryParamsHandling:"merge"})}))))),clearTagsErrors:()=>(0,n.M8)(l,(0,o.Gx)(a.t.Tags),(0,A.j)({createTagRequestError:null}))})))}},7029(J,E,t){t.d(E,{t:()=>e,u:()=>m});var e=function(n){return n.SalesTax="salesTax",n.Category="category",n.Attachments="attachments",n.Note="note",n.Tags="tags",n.SplitTransactions="splitTransactions",n.isSplit="isSplit",n.ReviewDetails="reviewDetails",n.IsLocked="isLocked",n}(e||{}),m=function(n){return n[n.Init=1]="Init",n[n.UpsertPending=2]="UpsertPending",n[n.UpsertFailed=3]="UpsertFailed",n[n.UpsertSuccess=4]="UpsertSuccess",n[n.DeletePending=5]="DeletePending",n[n.DeleteSuccess=6]="DeleteSuccess",n[n.DeleteFailed=7]="DeleteFailed",n[n.FetchPending=8]="FetchPending",n[n.FetchSuccess=9]="FetchSuccess",n[n.FetchFailed=10]="FetchFailed",n}(m||{})},74169(J,E,t){t.d(E,{j:()=>D,k:()=>n});const e=["BIF","CLP","DJF","GNF","JPY","KMF","KRW","MGA","PYG","RWF","UGX","VND","VUV","XAF","XOF","XPF"],m=["IQD","JOD","KWD","OMR","TND"];function n(P){return e.includes(P)?1:m.includes(P)?1e3:100}function D(P,A){return Intl.NumberFormat(P,{style:"currency",currency:A}).formatToParts().find(v=>"currency"===v.type)?.value}},74687(J,E,t){function e(m){return m}t.d(E,{o:()=>e})},30765(J,E,t){t.d(E,{t:()=>e,u:()=>m});var e=function(n){return n.SalesTax="salesTax",n.Category="category",n.Attachments="attachments",n.Note="note",n.Tags="tags",n.SplitTransactions="splitTransactions",n.isSplit="isSplit",n}(e||{}),m=function(n){return n[n.Init=1]="Init",n[n.UpsertPending=2]="UpsertPending",n[n.UpsertFailed=3]="UpsertFailed",n[n.UpsertSuccess=4]="UpsertSuccess",n[n.DeletePending=5]="DeletePending",n[n.DeleteSuccess=6]="DeleteSuccess",n[n.DeleteFailed=7]="DeleteFailed",n[n.FetchPending=8]="FetchPending",n[n.FetchSuccess=9]="FetchSuccess",n[n.FetchFailed=10]="FetchFailed",n}(m||{})},37938(J,E,t){t.d(E,{N:()=>D,z:()=>n});var e=t(6946),m=t(85687);function n(P,A){return A?(0,m.o)(e.cu.Encrichments,A)?.payload?.[P]??null:null}function D(P,A,v){return{...v,components:v.components.map(S=>{if(S.group===e.cu.Encrichments){const p=S,x=p.payload??{};return{...p,payload:{...x,[P]:A}}}return S})}}},93934(J,E,t){t.d(E,{L1:()=>s,Qm:()=>C,RC:()=>d,Rx:()=>n,uI:()=>v,uu:()=>x,wS:()=>P});var e=t(74169),m=t(65800);function n(a){return a?{salesTaxAmount:D(a.amount),salesTaxId:a.rate?.id,salesTaxCustom:!a.rate?.id}:null}function D(a){return a?(parseFloat(a.amount)/(0,e.k)(a.currency)).toString():null}function P(a,f,I,o=!0){if(I===m.AK.VAT)return null;if(a){const{salesTaxCustom:U,salesTaxId:l,salesTaxAmount:r}=a;if(U&&r)return{amount:{amount:o?String(parseFloat(r)*(0,e.k)(f.currency)):r,currency:f.currency}};if(l)return{rate:{id:l}}}return null}function v(a){return null!==a&&a&&!("amount"in a)&&"rate"in a}function x(a,f){return function S(a,f){return function A(a){return null!==a&&a&&"amount"in a&&!("rate"in a)}(a)&&a.amount?.amount!==f?.salesTaxAmount}(a,f)||function p(a,f){return v(a)&&a.rate?.id!==f?.salesTaxId}(a,f)}function s(a,f){return`Transactions in the ${a??"selected"} category do not require ${f} rate`}function d(a,f){return a?f.find(o=>o.id===a)?.ratePercentage??0:0}function C(a,f,I=2){const o=parseFloat(a.amount);return parseFloat(Math.abs(o/(1+f/100)-o).toFixed(I))}},85687(J,E,t){function e(m,n){return n?.components?.find(P=>P.group===m)}t.d(E,{o:()=>e})},44709(J,E,t){t.d(E,{A:()=>at});var e=t(35429),m=t(11878),n=t(97622);const P=function D(F,H,B){(void 0!==B&&!(0,n.A)(F[H],B)||void 0===B&&!(H in F))&&(0,m.A)(F,H,B)};var A=t(12097),v=t(99424),S=t(28295),p=t(80905),x=t(58822),s=t(34113),d=t(19247),C=t(92031),a=t(3101),f=t(68104),I=t(23151),o=t(68207),U=t(32549),l=t(85528),M=Function.prototype.toString,V=Object.prototype.hasOwnProperty,u=M.call(Object);var z=t(69913);const O=function G(F,H){if(("constructor"!==H||"function"!=typeof F[H])&&"__proto__"!=H)return F[H]};var $=t(61893),T=t(22813);const i=function Q(F,H,B,nt,b,w,k){var Y=O(F,B),_=O(H,B),ot=k.get(_);if(ot)P(F,B,ot);else{var q=w?w(Y,_,B+"",F,H,k):void 0,et=void 0===q;if(et){var st=(0,d.A)(_),it=!st&&(0,a.A)(_),rt=!st&&!it&&(0,z.A)(_);q=_,st||it||rt?(0,d.A)(Y)?q=Y:(0,C.A)(Y)?q=(0,p.A)(Y):it?(et=!1,q=(0,v.A)(_,!0)):rt?(et=!1,q=(0,S.A)(_,!0)):q=[]:function N(F){if(!(0,l.A)(F)||"[object Object]"!=(0,o.A)(F))return!1;var H=(0,U.A)(F);if(null===H)return!0;var B=V.call(H,"constructor")&&H.constructor;return"function"==typeof B&&B instanceof B&&M.call(B)==u}(_)||(0,s.A)(_)?(q=Y,(0,s.A)(Y)?q=function K(F){return(0,$.A)(F,(0,T.A)(F))}(Y):(!(0,I.A)(Y)||(0,f.A)(Y))&&(q=(0,x.A)(_))):et=!1}et&&(k.set(_,q),b(q,_,nt,w,k),k.delete(_)),P(F,B,q)}},y=function h(F,H,B,nt,b){F!==H&&(0,A.A)(H,function(w,k){if(b||(b=ne
1w e.A),(0,I.A)(w))i(F,H,k,B,h,nt,b);else{var Y=nt?nt(O(F,k),w,k+"",F,H,b):void 0;void 0===Y&&(Y=w),P(F,k,Y)}},T.A)};var j=t(14709),W=t(41642);const at=function X(F){return(0,j.A)(function(H,B){var nt=-1,b=B.length,w=b>1?B[b-1]:void 0,k=b>2?B[2]:void 0;for(w=F.length>3&&"function"==typeof w?(b--,w):void 0,k&&(0,W.A)(B[0],B[1],k)&&(w=b<3?void 0:w,b=1),H=Object(H);++nt<b;){var Y=B[nt];Y&&F(H,Y,nt,w)}return H})}(function(F,H,B){y(F,H,B)})}}]);

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.