@zeniai/web-app-ui 5.3.47-dev → 5.3.48-dev

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.
Files changed (159) hide show
  1. package/dist/assets/AccountMappingScreen-DeHsC__B.js +9 -0
  2. package/dist/assets/AddressRoutes-Bh2vRJBa.js +1 -0
  3. package/dist/assets/AddressScreen-C9Fk_Z55.js +9 -0
  4. package/dist/assets/AiCfoScreen-DB41E0VN.js +22 -0
  5. package/dist/assets/{AppDrawer-D4O6tn5i.js → AppDrawer-XdZKck2N.js} +3 -3
  6. package/dist/assets/{BillPayApprovalRoutes-BY4P9AKu.js → BillPayApprovalRoutes-Dyxgp6fW.js} +1 -1
  7. package/dist/assets/BillPayRoutes-Bp82WT-5.js +119 -0
  8. package/dist/assets/BusinessVerificationPageScreen-BT5PhS2R.js +9 -0
  9. package/dist/assets/CardsAiCfoScreen-CgeqAvem.js +14 -0
  10. package/dist/assets/ChargeCardRoutes-Ds9toMfJ.js +71 -0
  11. package/dist/assets/CompanyPassportScreen-B2k7aWUB.js +1 -0
  12. package/dist/assets/ConnectionAuthScreen-DrhuD992.js +11 -0
  13. package/dist/assets/CustomerOnboardingAuthScreen-CpbSTPlS.js +1 -0
  14. package/dist/assets/{CustomerOnboardingRoutes-DV3rYEiJ.js → CustomerOnboardingRoutes-RIeFd0Jj.js} +3 -3
  15. package/dist/assets/{DashboardRoutes-D5hdkebN.js → DashboardRoutes-DqcCIUfr.js} +4 -4
  16. package/dist/assets/{DefaultTenantHome-DCPi_wXC.js → DefaultTenantHome-DhG1xEfc.js} +1 -1
  17. package/dist/assets/DomesticWireDetailScreen-BKq5jjLx.js +18 -0
  18. package/dist/assets/{DrawerScreen-BihZ_PpN.js → DrawerScreen-DsFB_53j.js} +1 -1
  19. package/dist/assets/EntityDetailRoutes-mt1xcJ7j.js +1 -0
  20. package/dist/assets/ExpenseAutomationRoutes-lC_JLdAl.js +38 -0
  21. package/dist/assets/FeaturePreviewScreen-BFU7MG_7.js +1 -0
  22. package/dist/assets/HubSpotOAuthCallbackScreen-sKmwa_VW.js +1 -0
  23. package/dist/assets/InboxNotificationsProvider-CLtB_fgp.js +1 -0
  24. package/dist/assets/InvoicingRoutes-9v2-NT7u.js +2 -0
  25. package/dist/assets/MagicLinkRoutes-CXFrKDZN.js +72 -0
  26. package/dist/assets/MagicLinkSignInScreen-dmwIRx3p.js +12 -0
  27. package/dist/assets/MobileAppDrawer-cBt39NZW.js +1 -0
  28. package/dist/assets/NotFoundScreen-DFQDCCRn.js +1 -0
  29. package/dist/assets/NotificationRoutes-DBx2Hpze.js +1 -0
  30. package/dist/assets/OAuthConsentScreen-Y007Isid.js +1 -0
  31. package/dist/assets/PandLWithForecastRoutes-C51wwulq.js +1 -0
  32. package/dist/assets/{PaymentLinkScreen-B8bPleIr.js → PaymentLinkScreen-DJghRBso.js} +7 -7
  33. package/dist/assets/PeopleRoutes-Bm7sOBGu.js +22 -0
  34. package/dist/assets/PerformanceRoutes-BqAferL2.js +1 -0
  35. package/dist/assets/{Preview-DMLQokX_.js → Preview-BTwrFAaN.js} +1 -1
  36. package/dist/assets/{QBOConnectionScreen-CWU6DFJl.js → QBOConnectionScreen-UblfZAiA.js} +1 -1
  37. package/dist/assets/ReimbursementApprovalRoutes-DEDn1IHB.js +1 -0
  38. package/dist/assets/ReimbursementApprovalRuleDetailScreen-QDei_Fzl.js +1 -0
  39. package/dist/assets/{ReimbursementRoutes-BdJ3oqBf.js → ReimbursementRoutes-BHG-L5Ik.js} +9 -9
  40. package/dist/assets/ReportsRoutes-1SHXwblc.js +1 -0
  41. package/dist/assets/RewardsRoutes-bKzfn6ay.js +1 -0
  42. package/dist/assets/ScheduleDetailsPrepaidExpensesScreen-CdJ2LE-G.js +25 -0
  43. package/dist/assets/ScreenRoutes-Bz0Iu7E_.js +2 -0
  44. package/dist/assets/{SettingsRoutes-BGCz0_nd.js → SettingsRoutes-pgiyjQKt.js} +6 -6
  45. package/dist/assets/{SetupPagesScreen-DzNRL7Y-.js → SetupPagesScreen-Dzk7fHhk.js} +5 -5
  46. package/dist/assets/SignInScreen-Rmz1EJ3i.js +1 -0
  47. package/dist/assets/SignOutScreen-BgL1D0p9.js +9 -0
  48. package/dist/assets/{TaskListScreen-Br-mxkKM.js → TaskListScreen-BjJ59grh.js} +2 -2
  49. package/dist/assets/TaskRoutes-cixN3J6B.js +9 -0
  50. package/dist/assets/TransactionDetailRoutes-B_IKz98q.js +1 -0
  51. package/dist/assets/{TransactionDetailScreen-Bp7IFDK0.js → TransactionDetailScreen-BzVEfQec.js} +2 -2
  52. package/dist/assets/TransactionListRoutes-DiO8Bs9p.js +1 -0
  53. package/dist/assets/{TreasuryRoutes-BvvMozYl.js → TreasuryRoutes-DMo68xKo.js} +6 -6
  54. package/dist/assets/{VendorsRoutes-DsJ_lcDO.js → VendorsRoutes-DcubMsnX.js} +17 -17
  55. package/dist/assets/WiseConfirmationScreen-C40X1D6g.js +12 -0
  56. package/dist/assets/ZeniAccountRoutes-B2XcNL7K.js +57 -0
  57. package/dist/assets/ZeniAccountStatementScreen-B4EqmylS.js +9 -0
  58. package/dist/assets/{accountMappingHelper-DqBiQF6x.js → accountMappingHelper-C7mDOec7.js} +1 -1
  59. package/dist/assets/{analytics-D6GpUSOP.js → analytics-D1aMnBue.js} +1 -1
  60. package/dist/assets/{analyticsHelper-CwB3kQvw.js → analyticsHelper-BefphWIe.js} +1 -1
  61. package/dist/assets/{core-B5mDy9pu.js → core-DA_GbUVO.js} +1 -1
  62. package/dist/assets/{decodeURIComponentSafe-DANuhXnG.js → decodeURIComponentSafe-BeWrvHuJ.js} +1 -1
  63. package/dist/assets/{dnd-CGWe1ZMP.js → dnd-BVDuXkBA.js} +1 -1
  64. package/dist/assets/{empty-D0y6rZ_X.js → empty-DkYQEFBR.js} +1 -1
  65. package/dist/assets/{empty-Dj4ZMRNZ.js → empty-kmkuoqGV.js} +1 -1
  66. package/dist/assets/{emptyVideoElement-BbYSqu6F.js → emptyVideoElement-Dr5ohcS7.js} +1 -1
  67. package/dist/assets/epic-DZfUNOLM.js +2 -0
  68. package/dist/assets/expenseAutomationHelper-4Qy8IF7o.js +1 -0
  69. package/dist/assets/{getLocaleForTenant-DH5Avx3x.js → getLocaleForTenant-BYa6QBcb.js} +1 -1
  70. package/dist/assets/{index-BQBXaLiB.js → index-B02Uvg0e.js} +1 -1
  71. package/dist/assets/{index-8s12XWuB.js → index-BVMI-pAw.js} +1 -1
  72. package/dist/assets/{index-k1-Pd2Ki.js → index-BqUvSiTi.js} +1 -1
  73. package/dist/assets/{index-fq0DUtem.js → index-BsYcIz8M.js} +1 -1
  74. package/dist/assets/{index-CI8tXM3D.js → index-C4n_QrNU.js} +1 -1
  75. package/dist/assets/{index-G6Wb7pfX.js → index-C5j9ulaE.js} +2 -2
  76. package/dist/assets/index-CY-CsK5V.js +1 -0
  77. package/dist/assets/{index-6nH5LMe4.js → index-CsnAk3jU.js} +30661 -31464
  78. package/dist/assets/{lexical-DW4lC8Zx.js → lexical-Czsku2z1.js} +1 -1
  79. package/dist/assets/{liveblocks-UOzcPsHa.js → liveblocks-DTaiayIC.js} +2 -2
  80. package/dist/assets/{lottie-C5eNvt0I.js → lottie-CkYI8upo.js} +1 -1
  81. package/dist/assets/{mui-Do6nLzGb.js → mui-yMDYeeMr.js} +1 -1
  82. package/dist/assets/{pathToGoBack-DP_bGWF-.js → pathToGoBack-nmNIndUw.js} +1 -1
  83. package/dist/assets/{pdf-DjwvAC2g.js → pdf-BIYA0Nfl.js} +3 -3
  84. package/dist/assets/{pdf-lib-CZXOqgb4.js → pdf-lib-DZGnWz6X.js} +1 -1
  85. package/dist/assets/{plaid-0g_vwjSd.js → plaid-BtwBxM-6.js} +1 -1
  86. package/dist/assets/{pusher-BwlPp2s7.js → pusher-8BUSKGPT.js} +1 -1
  87. package/dist/assets/{react-BsXfT48C.js → react-Bs3cqIIe.js} +1 -1
  88. package/dist/assets/{react-CU01hiuh.js → react-C6ZyRyfn.js} +1 -1
  89. package/dist/assets/{react-Bja4MeVO.js → react-CxBgzLVF.js} +1 -1
  90. package/dist/assets/{react-Dex3foBA.js → react-a48nQACt.js} +1 -1
  91. package/dist/assets/{react-RZilWHYG.js → react-bpjj59R_.js} +1 -1
  92. package/dist/assets/{react-DkYBVdJJ.js → react-uoYsSJ7d.js} +1 -1
  93. package/dist/assets/{recharts-uFX1dZS-.js → recharts-D3wE7yHJ.js} +1 -1
  94. package/dist/assets/{routePaths-uBvxqlLY.js → routePaths-DeWRBZpS.js} +1 -1
  95. package/dist/assets/{sentry-DHDsO12F.js → sentry-BRmieicQ.js} +1 -1
  96. package/dist/assets/{url-CLCy7GPP.js → url-BAbGMJa_.js} +1 -1
  97. package/dist/assets/{url-BxiN6LKq.js → url-DXDQoAPC.js} +1 -1
  98. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-D8KJqvT7.js → useAiCfoDashboardSuggestedQuestionsChips-SoHaFZ4W.js} +1 -1
  99. package/dist/assets/useAskAiCfoHostNavButtonProps-BOgWSkqa.js +1 -0
  100. package/dist/assets/{useChargeCardPusherEvents-BnH8_thb.js → useChargeCardPusherEvents-C1Fc6NgG.js} +1 -1
  101. package/dist/assets/{useDeviceId-Bi38IJl0.js → useDeviceId-CZzjV8tQ.js} +1 -1
  102. package/dist/assets/{useEmailConnectResultRefresh-Ba8t-BuL.js → useEmailConnectResultRefresh-DtruKk0s.js} +1 -1
  103. package/dist/assets/{useInitialThreadRequest-7Q8HJAH2.js → useInitialThreadRequest-BJ6-q-Ev.js} +1 -1
  104. package/dist/assets/useTaskManagerAccess-Bm40mz18.js +1 -0
  105. package/dist/assets/{utils-BsODCDYR.js → utils-UMm0RYR6.js} +1 -1
  106. package/dist/assets/withTransactionSidePanel-aokrUwcT.js +25 -0
  107. package/dist/assets/{zeni-epic-state-7eY0g-Bc.js → zeni-epic-state-cafsD4rZ.js} +6 -6
  108. package/dist/index.html +1 -1
  109. package/package.json +6 -6
  110. package/dist/assets/AccountMappingScreen-Euit4Ttk.js +0 -9
  111. package/dist/assets/ActualMatchingMatchDetailScreen-BBYzjOqh.js +0 -1
  112. package/dist/assets/AddressRoutes-PvYGzHCA.js +0 -1
  113. package/dist/assets/AddressScreen-DsGvV3N8.js +0 -9
  114. package/dist/assets/AiCfoScreen-DAEPn0_B.js +0 -22
  115. package/dist/assets/BillPayRoutes-CWc4tAqm.js +0 -119
  116. package/dist/assets/BusinessVerificationPageScreen-CSruI1nV.js +0 -9
  117. package/dist/assets/CardsAiCfoScreen-COoYscKz.js +0 -14
  118. package/dist/assets/ChargeCardRoutes-BU6-pfJv.js +0 -71
  119. package/dist/assets/CompanyPassportScreen-BxoatMVb.js +0 -1
  120. package/dist/assets/ConnectionAuthScreen-zbcvhPbz.js +0 -11
  121. package/dist/assets/CustomerOnboardingAuthScreen-8IwDeKdF.js +0 -1
  122. package/dist/assets/DomesticWireDetailScreen-DgE28aJN.js +0 -18
  123. package/dist/assets/EntityDetailRoutes-BqX-J3vM.js +0 -1
  124. package/dist/assets/ExpenseAutomationRoutes-DK-U-YTd.js +0 -38
  125. package/dist/assets/FeaturePreviewScreen-5SleVFKv.js +0 -1
  126. package/dist/assets/HubSpotOAuthCallbackScreen-2RxbRDTZ.js +0 -1
  127. package/dist/assets/InboxNotificationsProvider-BmF5-_KA.js +0 -1
  128. package/dist/assets/InvoicingRoutes-D0S6fDxY.js +0 -2
  129. package/dist/assets/MagicLinkRoutes-C22EnpRm.js +0 -72
  130. package/dist/assets/MagicLinkSignInScreen-BVf-rLEH.js +0 -12
  131. package/dist/assets/MobileAppDrawer-0YtWXA3B.js +0 -1
  132. package/dist/assets/NotFoundScreen-BkYIKPgh.js +0 -1
  133. package/dist/assets/NotificationRoutes-CZQRvVbE.js +0 -1
  134. package/dist/assets/OAuthConsentScreen-Q7ZDvc1F.js +0 -1
  135. package/dist/assets/PandLWithForecastRoutes-BzO_OgSq.js +0 -1
  136. package/dist/assets/PeopleRoutes-D_nqmuPM.js +0 -22
  137. package/dist/assets/PerformanceRoutes-BW6dixVF.js +0 -1
  138. package/dist/assets/ReimbursementApprovalRoutes-DAusugdf.js +0 -1
  139. package/dist/assets/ReimbursementApprovalRuleDetailScreen-phJuB98f.js +0 -1
  140. package/dist/assets/ReportsRoutes-CDSCG28G.js +0 -1
  141. package/dist/assets/RewardsRoutes-CHkOPz1g.js +0 -1
  142. package/dist/assets/ScheduleDetailsPrepaidExpensesScreen-DnVEpQsK.js +0 -33
  143. package/dist/assets/ScreenRoutes-BYAPWka6.js +0 -2
  144. package/dist/assets/SignInScreen-BREpWd6T.js +0 -1
  145. package/dist/assets/SignOutScreen-BNCpbut8.js +0 -9
  146. package/dist/assets/TaskRoutes-CDuiJExM.js +0 -9
  147. package/dist/assets/TransactionDetailRoutes-CYb-4jKQ.js +0 -1
  148. package/dist/assets/TransactionListRoutes-B6NIJUWk.js +0 -1
  149. package/dist/assets/WiseConfirmationScreen-Bg5_g49N.js +0 -12
  150. package/dist/assets/ZeniAccountRoutes-C3fDjuMG.js +0 -57
  151. package/dist/assets/ZeniAccountStatementScreen-CbdRQI0p.js +0 -9
  152. package/dist/assets/epic-mSW644GG.js +0 -2
  153. package/dist/assets/expenseAutomationHelper-DBDpSggk.js +0 -1
  154. package/dist/assets/index-6yt3BfRL.js +0 -1
  155. package/dist/assets/stripSplatSuffix-CQQXAy0N.js +0 -1
  156. package/dist/assets/useActualMatchingMatchDetail-OCZsPxr6.js +0 -1
  157. package/dist/assets/useAskAiCfoHostNavButtonProps-BsP5fVhq.js +0 -1
  158. package/dist/assets/useTaskManagerAccess-BG0Fkj9k.js +0 -1
  159. package/dist/assets/withTransactionSidePanel-DK-Ex27L.js +0 -25
@@ -0,0 +1,9 @@
1
+ import{j as i}from"./liveblocks-DTaiayIC.js";import ue from"./NotFoundScreen-DFQDCCRn.js";import{a as k}from"./sentry-BRmieicQ.js";import{h as H,u as ee,j as E,g as de,i as ke,N as pe,l as me,n as Se,o as b}from"./core-DA_GbUVO.js";import{Ph as ae,Pk as fe,Pe as Te,Z6 as ge,fE as te,a1a as se,PG as g,Py as T,Pb as he,Qa as be,Q3 as Ee,a1b as ne,gg as oe,a1c as M,P7 as Ie,P4 as De,ul as Ce,u9 as Ge,my as Pe,Pw as ye,a1d as _e,Qn as Re,Ps as Ue,PR as we,PO as xe,Pn as Be,PL as ve,PK as Ae}from"./zeni-epic-state-cafsD4rZ.js";import{z as y,e2 as je,r as Le,M as Fe,y as G,a4 as re,p as P,a8 as Ke,h as q,S as $e,e3 as Ne,Y as Q,ae as Oe}from"./index-CsnAk3jU.js";import{n as ze}from"./mui-yMDYeeMr.js";import{u as Ve}from"./useInitialThreadRequest-BJ6-q-Ev.js";import{M as Ze}from"./MobileAppDrawer-cBt39NZW.js";import{b as Me,a as qe,u as Qe,T as f,t as Ye,c as Y,d as J,e as Je}from"./TaskListScreen-BjJ59grh.js";import"./recharts-D3wE7yHJ.js";import"./analytics-D1aMnBue.js";import"./plaid-BtwBxM-6.js";import"./dnd-BVDuXkBA.js";import"./stripe-cKAAJElX.js";import"./lottie-CkYI8upo.js";import"./lexical-Czsku2z1.js";import"./pdf-BIYA0Nfl.js";import"./utils-UMm0RYR6.js";import"./InboxNotificationsProvider-CLtB_fgp.js";import"./useTaskManagerAccess-Bm40mz18.js";import"./useAskAiCfoHostNavButtonProps-BOgWSkqa.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="344cedee-3a2b-4f37-b7d3-28a1db034388",e._sentryDebugIdIdentifier="sentry-dbid-344cedee-3a2b-4f37-b7d3-28a1db034388")}catch{}})();function We(){const e=H(),a=ee(),n=y.getSignedInUser(),{cannedResponses:c,fetchState:s,saveFetchState:u}=E((o=>o.cannedResponsesState)),d=k.useCallback((()=>{a(ae())}),[a]),m=k.useCallback(((o,I,D)=>{a(fe({name:o,content:I,cannedResponseId:D}))}),[a]),t=k.useCallback((o=>{a(Te({cannedResponseId:o}))}),[a]);if(n==null)throw Error("Can't access quick responses page without signing in...");return i.jsx(je,{cannedResponses:c,isLoading:s==="In-Progress"||s==="Not-Started",isSaving:u==="In-Progress",onBackClick:()=>e(-1),onDelete:t,onFetch:d,onSave:m})}const F=e=>e?.taskState?.taskByID,j=(e,a)=>{const n=F(e);if(a!=null&&n!=null)return n[a]?.parentTaskId??void 0},Xe=ge([j,(e,a)=>{const n=j(e,a),c=F(e);if(n!=null&&c!=null)return c[n]?.name},(e,a)=>{const n=j(e,a),c=F(e);return n!=null&&c!=null&&c[n]!=null}],((e,a,n)=>{if(e!=null&&n===!0)return{id:e,name:a??""}}));let W,X=[];const He=me((function(e,a){const{location:n,taskGroupId:c}=a,s=ne(e,a.taskId),u=te(e),d=Xe(e,a.taskId),m=s.taskGroupId??c,t=m!=null?M(e.taskGroupState,m):void 0,o=y.getSignedInUser(),I=u.tenantId,D={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:I??""},w=se(e),{tenantEmailDomain:x}=u,_=s.recurringSourceTaskId,B=_!=null?`${Q.appUrl}/${x}/tasks/${encodeURIComponent(_)}`:void 0;var h;return{taskDetailSelectorView:s,authParams:D,isZeniUser:y.isZeniUser(),userGroupList:((h=e.userGroupsState.userGroupByUserGroupId)!==W&&(W=h,X=Object.values(h)),X),isNewClicked:n.state?.message==="comingFromTaskListPage",filesEndPoint:Oe.fileMicroServiceBaseUrl,companyName:a.currentTenant.companyName,companyId:a.currentTenant.companyId,currentUrl:`${Q.appUrl}${a.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:B,tagListView:w,taskGroupName:m!=null&&t!=null&&t.isDefault===!1?t.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((S=>M(e.taskGroupState,S))).filter((S=>S!=null&&!S.isDeleted)).map((S=>({id:S.id,name:S.name,isDefault:S.isDefault}))),subtasks:s.subtasks,parentTaskRef:d,subTaskCreateStatus:e.taskDetailState?.subTaskCreateStatus?.fetchState}}),(function(e,a){const{taskId:n,navigate:c,currentTenant:s,location:u,taskGroupId:d}=a,{tenantEmailDomain:m}=s;return{onSaveChangesToLocalStore:t=>{e(Ae({taskDetailLocalData:t,taskId:n}))},onSaveDetailClick:t=>{e(ve(n,t??d))},onArchiveTaskClick:()=>{a.taskId!=null&&e(Be(a.taskId))},onSnoozeTask:(t,o)=>{e(xe(t,o))},onUnsnoozeTask:t=>{e(we(t))},onCreateSubtask:(t,o)=>{e(Ue({...o,parentTaskId:t}))},onSubtaskUpdate:(t,o)=>{e(Re({task:t,updates:o}))},onShowToast:t=>{e(oe(t))},onSubtaskRowClick:t=>{c(`/${m}/tasks/${t}`,{state:{pathnameStackToGoBack:P(u.state?.pathnameStackToGoBack,u.pathname)}})},onParentBreadcrumbClick:t=>{c(`/${m}/tasks/${t}`,{state:{pathnameStackToGoBack:P(u.state?.pathnameStackToGoBack,u.pathname)}})},onDismissClick:()=>{if(u.state?.message==="triggerBackClick"){const t=re(u.state?.pathnameStackToGoBack),o=t.poppedPathname??"../../dashboard";c(o,{state:{pathnameStackToGoBack:t.newStack}})}else{const t=U(m),o=P(u.state?.pathnameStackToGoBack,u.pathname);c(t,{state:{pathnameStackToGoBack:o}})}e(_e({taskId:n}))},onDeleteTaskClick:()=>{e(ye(n))},updateFilesEntity:t=>{e(Pe({files:t}))},onDeleteFile:t=>{e(Ge(t))},onEditFileName:(t,o)=>{e(Ce(t,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(g(!1,n))},onCreateTagClick:t=>{e(De(t,n))},onDeleteTagClick:t=>{e(Ie(t,n))},onFetchCannedResponses:()=>{e(ae())},onManageTemplatesClick:()=>{c(`/${s.tenantEmailDomain}/tasks/quick-responses`)}}}))(Ne);function L(){const e=H(),a=ee(),n=de(),c=Le(),{taskId:s,taskGroupId:u}=ke(),d=E((r=>te(r))),m=Ve(d?.companyId),{useFeatureGate:t}=Fe(),{isFeatureEnabled:o}=t(G.isTaskSnoozeEnabled),{isFeatureEnabled:I}=t(G.isTaskVisibilityEnabled),{isFeatureEnabled:D}=t(G.isTaskCannedResponsesEnabled),{isFeatureEnabled:w}=t(G.isTaskRecurringParentEnabled),{isFeatureEnabled:x}=t(G.isTaskGroupAssigneesEnabled),[_,B]=k.useState(!1),[h,S]=k.useState(!1),[K,ie]=k.useState(!1),[$,v]=k.useState(!1),C=k.useRef(!1),R=E((r=>r.taskListState.updateTasksFetchState.fetchState)),N=E((r=>se(r))),O=E((r=>r.taskGroupViewState.fetchState));k.useEffect((()=>{a(g(!1,s)),s!=null&&a(T(s))}),[a,s]);const z=y.getSignedInUser()?.userId,ce=k.useMemo((()=>{const r=[f.TASK_CREATED,f.TASK_UPDATED,f.TASKS_BULK_UPDATED,f.TASKS_BULK_DELETED],l=[...r,f.TASK_SNOOZE_RESURFACED];return[...Me(d?.companyId,r),...qe(z,l)]}),[d?.companyId,z]);Qe({events:ce,onSubscribed:()=>{s!=null&&(a(g(!0,s)),a(T(s)))},onEvent:(r,l)=>{if(s!=null)switch(r){case f.TASK_CREATED:{J(l)?.parent_task_id===s&&(a(g(!0,s)),a(T(s)));break}case f.TASK_UPDATED:{const p=J(l);if(p==null)break;p.task_id===s?(a(g(!0,s)),a(T(s))):p.parent_task_id===s&&a(T(s));break}case f.TASKS_BULK_UPDATED:{const p=Y(l);if(p==null)break;p.task_ids.includes(s)&&a(g(!0,s)),a(T(s));break}case f.TASKS_BULK_DELETED:{const p=Y(l);if(p==null)break;if(p.task_ids.includes(s)){a(oe({messageSection:"delete_task",messageText:"success",type:"success"})),d?.tenantEmailDomain!=null&&e(U(d.tenantEmailDomain));break}a(T(s));break}case f.TASK_SNOOZE_RESURFACED:{Ye(l)?.task_id===s&&a(g(!0,s));break}}}}),k.useEffect((()=>{h||N.fetchState==="Completed"||(S(!0),a(he()))}),[h,a,N.fetchState]),k.useEffect((()=>{K||O==="Completed"||(ie(!0),a(be()))}),[K,a,O]);const le=k.useCallback((()=>{s!=null&&(C.current=!1,a(Ee([s],null,{isArchived:!1})),v(!0))}),[a,s]);k.useEffect((()=>{if($)if(R!=="In-Progress"){if(C.current){if(R==="Error")return v(!1),void(C.current=!1);if(R==="Completed"){v(!1),C.current=!1;const{tenantEmailDomain:r}=d;if(n.state?.message==="triggerBackClick"){const l=re(n.state?.pathnameStackToGoBack);e(l.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:l.newStack}})}else{const l=U(r);e(l,{state:{pathnameStackToGoBack:P(n.state?.pathnameStackToGoBack,n.pathname)}})}}}}else C.current=!0}),[$,R,d,n,e]);const V=E((r=>ne(r,s))),A=V.fetchState,Z=y.getSignedInUser();if(Z==null)throw Error("Can't access task detail page without signing in...");if(A==="Error"&&V.error?.code===400){const{tenantEmailDomain:r}=d,l=U(r),p=P(n.state?.pathnameStackToGoBack,n.pathname);return i.jsx(pe,{to:l,state:{pathnameStackToGoBack:p}})}return i.jsxs(i.Fragment,{children:[A==="Completed"?i.jsx(Ke,{analytics:q,onLoad:r=>(l=>l.trackPageLoaded($e.Event.taskDetailPage))(r)}):null,i.jsxs(ea,{children:[i.jsx(Ze,{isAppContentDrawerOpen:_,handleDrawerToggle:r=>{B(r)}}),i.jsx(He,{analytics:q,currentTenant:d,handleZeniLogoClick:()=>{c.toggle()},initialOpenThreadRequest:m,location:n,loggedInUser:Z,navigate:e,taskGroupId:u,taskId:s,taskDetailFetchState:A,onUnarchiveTaskClick:le,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:I,isTaskCannedResponsesEnabled:D,isTaskRecurringParentEnabled:w,isTaskGroupAssigneesEnabled:x})]})]})}const ea=ze.div`
2
+ display: flex;
3
+ min-height: 100%;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey4};
9
+ `,U=e=>`/${e}/tasks`;function Da(){return i.jsxs(Se,{children:[i.jsx(b,{path:"/new",element:i.jsx(L,{})}),i.jsx(b,{path:"/new/:taskGroupId",element:i.jsx(L,{})}),i.jsx(b,{path:"/group/:taskGroupId",element:i.jsx(Je,{})}),i.jsx(b,{path:"/quick-responses",element:i.jsx(We,{})}),i.jsx(b,{path:"/:taskId",element:i.jsx(L,{})}),i.jsx(b,{path:"*",element:i.jsx(ue,{})})]})}export{Da as default};
@@ -0,0 +1 @@
1
+ import{j as t}from"./liveblocks-DTaiayIC.js";import i from"./NotFoundScreen-DFQDCCRn.js";import{T as r}from"./TransactionDetailScreen-BzVEfQec.js";import"./sentry-BRmieicQ.js";import{n as d,o}from"./core-DA_GbUVO.js";import"./zeni-epic-state-cafsD4rZ.js";import"./recharts-D3wE7yHJ.js";import"./index-CsnAk3jU.js";import"./mui-yMDYeeMr.js";import"./analytics-D1aMnBue.js";import"./plaid-BtwBxM-6.js";import"./dnd-BVDuXkBA.js";import"./stripe-cKAAJElX.js";import"./lottie-CkYI8upo.js";import"./lexical-Czsku2z1.js";import"./pdf-BIYA0Nfl.js";import"./utils-UMm0RYR6.js";import"./useAskAiCfoHostNavButtonProps-BOgWSkqa.js";import"./decodeURIComponentSafe-BeWrvHuJ.js";import"./useInitialThreadRequest-BJ6-q-Ev.js";import"./routePaths-DeWRBZpS.js";import"./expenseAutomationHelper-4Qy8IF7o.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="07c2895c-270d-414b-a4ec-49ceb0cdd05a",e._sentryDebugIdIdentifier="sentry-dbid-07c2895c-270d-414b-a4ec-49ceb0cdd05a")}catch{}})();function z(){return t.jsxs(d,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{z as default};
@@ -1,5 +1,5 @@
1
- import{j as C}from"./liveblocks-UOzcPsHa.js";import{a as i}from"./sentry-DHDsO12F.js";import{u as W,k as sn,j as g,s as ge,g as ke,h as Ce,i as Ae,N as cn,l as rn}from"./core-B5mDy9pu.js";import{pv as Ie,fF as ee,gV as ln,Uw as dn,oB as un,ob as mn,Dx as se,bn as pn,df as Re,bq as _e,sP as Y,VC as X,WK as Pe,WL as le,W0 as we,ma as Fe,WM as Ue,W5 as de,W6 as ue,m$ as xe,S1 as me,WG as G,m4 as Le,m2 as Ve,me as fn,pi as hn,WN as Sn,WO as yn,Do as Z,m9 as Be,Rm as Oe,cm as Tn,dl as bn,WP as gn,WF as In,WQ as vn,WR as En,WS as Dn,WT as kn,Dk as Cn,WU as An,WV as Rn,WW as _n,WX as Pn,WY as wn,md as Fn,WZ as Un,W_ as xn,WH as Ln,W$ as Vn,X0 as Bn,X1 as On,Rg as Nn,R6 as Wn,Rv as zn,mf as Mn,S2 as ve,pn as jn}from"./zeni-epic-state-7eY0g-Bc.js";import{N as K,c as A,j as $,b2 as Gn,z as Ne,E as $n,a1 as qn,b3 as Hn,ab as Yn,a4 as ce,U as Xn,b4 as Kn,p as ie,as as Qn,b5 as Zn,b6 as Jn,b7 as et,ae as nt,av as oe}from"./index-6nH5LMe4.js";import{n as tt,S as at,D as ot}from"./mui-Do6nLzGb.js";import{u as st}from"./useAskAiCfoHostNavButtonProps-BsP5fVhq.js";import{d as We}from"./decodeURIComponentSafe-DANuhXnG.js";import{u as ct}from"./useInitialThreadRequest-7Q8HJAH2.js";import{h as ze,c as Me,g as it,e as rt}from"./routePaths-uBvxqlLY.js";import{u as lt}from"./expenseAutomationHelper-DBDpSggk.js";import{v as dt}from"./utils-BsODCDYR.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new n.Error().stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="e0979b34-42b2-4847-b255-0e574fd87d19",n._sentryDebugIdIdentifier="sentry-dbid-e0979b34-42b2-4847-b255-0e574fd87d19")}catch{}})();function ut(n=!0){const e=W(),o=sn(),{useFeatureGate:t}=K(),{isFeatureEnabled:a}=t(A.isCreateTransferEntryFromExpenseEnabled);i.useEffect((()=>{if(!n||a!==!0)return;const s=c=>{const u=o.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return u!=="In-Progress"&&u!=="Completed"};s("transferEntryEligible")&&e(Ie({kind:"transferEntryEligible"})),s("creditCardOnlyEligible")&&e(Ie({kind:"creditCardOnlyEligible"}))}),[n,a,e,o])}function mt(n,e){const o=(function(){const u=W(),[h,y]=i.useState(!1),[f,d]=i.useState(null),[r,S]=i.useState(null),{useDynamicConfig:I}=K(),{configValue:k,isDynamicConfigLoading:T}=I("transaction_categorization_config"),b=!T&&k?.capitalization_enabled===!0,v=g((l=>ee(l))),R=v.companyId,q=g((l=>ln(l.companyState,v.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:U,capitalizableAccountOverrides:_,dismissedAccounts:P}=g((l=>{const E=l.tenantState.currentTenantId,D=E!=null?l.tenantState.tenantsById[E]:void 0;return{capitalizableAccounts:D?.capitalizableAccounts??null,capitalizableAccountOverrides:D?.capitalizableAccountOverrides??null,dismissedAccounts:D?.capitalizationOnboardingDismissedAccounts??null}}),ge),x=i.useRef(U);x.current=U;const w=i.useRef(_);w.current=_;const L=i.useRef(P);L.current=P;const V=g((l=>dn(l.accountState)),ge),H=i.useMemo((()=>{const l={};for(const E of V)E.accountId!=null&&E.accountName!=null&&(l[E.accountId]=E.accountName);return l}),[V]),z=r!=null?H[r]??null:null,B=i.useCallback((l=>{if(!b)return;const E=x.current;if(E==null)return;const D=E.accounts??[],j=new Set(l),Q=w.current??{},ne=L.current;for(const O of D)if(j.has(O.accountId)&&Q[O.accountId]==null&&ne?.[O.accountId]==null)return d(O.classificationType),S(O.accountId),void y(!0)}),[b]),M=i.useCallback(((l,E)=>{u(un(R,l,E,!0)),y(!1),d(null),S(null)}),[u,R]),p=i.useCallback((()=>{r!=null&&(u(mn(R,r)),y(!1),d(null),S(null))}),[u,R,r]);return{showPopup:h&&b,popupType:f,popupAccountId:r,popupAccountName:z,currencySymbol:q,checkAndShowPopup:B,handleSubmit:M,handleDismiss:p}})(),t=i.useRef(void 0),a=i.useRef([]),s=i.useRef(o.checkAndShowPopup);s.current=o.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect((()=>{n==="In-Progress"&&(a.current=c.current()),n==="Completed"&&t.current==="In-Progress"&&a.current.length>0&&(s.current(a.current),a.current=[]),t.current=n}),[n]),o}const N=new Map,Ee=(n,e,o)=>`${n}|${e??""}|${o}`,J=(n,e)=>{const[o,t]=n.shownRecommendations;return{recommendationFor:n.dimension,recommendation:o?.name??"",recommendationSource:o?.engine??null,recommendationConfidencePercentage:o?.confidencePercentage??null,alternativeRecommendation:t?.name??null,alternativeRecommendationSource:t?.engine??null,alternativeRecommendationConfidencePercentage:t?.confidencePercentage??null,selectedValue:n.selected.name,numberOfRecommendations:n.shownRecommendations.length,transactionId:e,lineId:n.lineId??null}},re=(n,e,o)=>({transactionId:e,lineId:n.lineId,dimension:n.dimension,outcome:n.outcome,selected:{name:n.selected.name,id:n.selected.id},matchedSource:n.matchedSource,matchedRank:n.matchedRank,topPickSource:n.topPickSource,shownRecommendations:n.shownRecommendations.map((t=>({source:t.source,rank:t.rank,value:{name:t.name,id:t.id},confidence:t.confidencePercentage!=null?t.confidencePercentage/100:void 0}))),...o}),je=(n,e,o)=>{$.trackRecommendationFeedbackRetracted(J(e,o)),n(se(re(e,o,{outcome:"retracted"})))},Lt=(n,e)=>{const o=new Set(e.map(String));N.forEach(((t,a)=>{o.has(t.transactionId)&&(N.delete(a),je(n,t.feedback,t.transactionId))}))},Vt=n=>{const e=new Set(n.map(String));N.forEach(((o,t)=>{e.has(o.transactionId)&&N.delete(t)}))};function pt(n){const e=W(),[o,t]=i.useState(null),{isEnabled:a,fallbackTransactionId:s}=n,c=i.useCallback((f=>f.transactionId??s??""),[s]),u=i.useCallback((f=>{if(!a)return;const d=c(f);if(d==="")return;if(f.outcome!=="accepted")return void t(f);((S,I,k,T)=>{const b=Ee(I,k,T),v=N.get(b);return v!=null&&(N.delete(b),je(S,v.feedback,v.transactionId),!0)})(e,d,f.lineId,f.dimension)||(((S,I)=>{$.trackRecommendationAccepted(J(S,I))})(f,d),e(se(re(f,d,{}))))}),[a,c,e]),h=i.useCallback((f=>{if(o==null)return;const d=c(o);((r,S,I)=>{$.trackRecommendationFeedbackSubmitted({...J(r,S),feedbackReason:I})})(o,d,f),e(se(re(o,d,{reasonText:f,skipped:!1}))),((r,S)=>{N.set(Ee(S,r.lineId,r.dimension),{feedback:r,transactionId:S})})(o,d),t(null)}),[o,c,e]),y=i.useCallback((()=>{var f,d;o!=null&&(f=o,d=c(o),$.trackRecommendationFeedbackSkipped(J(f,d)),t(null))}),[o,c]);return{onRecommendationSelection:u,popup:o!=null?C.jsx(Gn,{feedback:o,onSubmit:h,onSkip:y}):null}}const pe=()=>{const n=Ne.getSignedInUser(),{useFeatureGate:e}=K(),{isFeatureEnabled:o}=e(A.isChainOfThoughtEnabled);return i.useMemo((()=>pn(n)&&o),[n,o])};function Ge(n){if(n!=null){if("customer"in n&&n.customer!=null){const{customer:e}=n;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in n&&n.vendor!=null){const{vendor:e}=n;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Bt(n,e){const o=W(),{useFeatureGate:t}=K(),a=g((p=>ee(p))),s=a.userRole.includes("charge_card_user")||a.userRole.includes("charge_card_admin"),c=a.userRole!=null&&Re(a.userRole),u=a.userRole!=null&&_e(a.userRole),{isFeatureEnabled:h}=t(A.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:y}=t(A.isExpenseAutomationEnabled),f=pe(),d=i.useMemo((()=>({id:n,type:Y(e)})),[n,e]),r=g((p=>X(p,d))),S=r?.transactionDetailUpdateStatus?.fetchState,I=r?.transactionDetailLocalData?.lineItemById,k=g((p=>{const l=X(p,d)?.transactionDetailLocalData.vendorUpdates?.id;return l==null?"Not-Started":p.transactionVendorViewState.editVendorStateById[l]?.saveStatus.fetchState??"Not-Started"})),T=i.useMemo((()=>r?.fetchState==="Completed"?Ge(r?.transaction):void 0),[r?.fetchState,r?.transaction]),b=g((p=>{if(T!=null)return Pe(p.customerIncomeState,p.vendorExpenseState,p.trendState,T,"month")})),v=g((p=>le(p))),R=g((p=>{if(T!=null)return we(p.trendWithTransactionsState,T,"TransactionDetail")})),q=a.company?.companyInfo.firstMonthOfFY??1,U=g((p=>Fe(p.accountState,p.accountListState,"accountList"))),[_,P]=i.useState(!1),[x,w]=i.useState(!1),[L,V]=i.useState(!1);i.useEffect((()=>{P(!1),w(!1),V(!1)}),[n,e]);const H=i.useCallback((()=>{P(!1),w(!1)}),[]),[z,B]=i.useState(!1),M=R?.selectedPeriod?.timePeriod;return i.useEffect((()=>{L||r==null||r.transaction==null||(o(Ue({id:r.transaction.id,type:r.transaction.type})),V(!0)),T!=null&&(!s||c&&u===!1)&&(_?x||b==null||(w(!0),o(me(T,"TransactionDetail",{timeframe:"month",timePeriod:M??b}))):(o(de()),o(ue()),P(!0),o(xe(T))))}),[o,L,r?.fetchState,r?.transaction,T,s,c,u,_,x,b,M]),i.useEffect((()=>{v.newVendorState?.vendorDetailLocalData?.vendorName!=null?B(!0):B(!1)}),[v.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{o(G("common"))}),[o]),{currentTenant:a,loggedInUserHasCardUserOrAdminRole:s,isUserHasDashboardAccess:c,isUserHasInvestorOrBankerAccess:u,isVendorBulkUpdateOnTransactionEnabled:h,isExpenseAutomationEnabled:y,isChainOfThoughtEnabled:f,selectedTransaction:d,transactionDetail:r,rawDetailSaveStatus:S,rawDetailLineItemById:I,vendorSaveStatus:k,tranEntity:T,defaultTrendTransactionTimePeriod:b,vendorViewDetails:v,uiState:R,firstMonthOfFY:q,uncategorizedAccounts:U,resetTrendIsFetchedStates:H,isCreateVendorDrawerOpen:z,setIsCreateVendorDrawerOpen:B}}const ft={overlayWidth:new Yn(100,100,58)},ht=({isOpen:n,onSaveVendor:e,onSaveSuccess:o,onCancel:t,vendorViewDetails:a})=>{const s=$n(),c=qn(),u=W(),h=g((d=>le(d))),y=()=>{t()},f={vendorDetailView:a??h,onSaveSuccess:()=>{u(Ve()),u(fn("Not-Started")),o()},onSaveVendor:e,onCancelClick:y,saveVendorDetailLocalData:d=>{u(Le({vendorId:void 0,localData:d}))}};return C.jsx(ot,{anchor:"right",open:n,PaperProps:{style:{width:ft.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.4,cursor:"pointer"}}},onClose:y,children:C.jsx(St,{onClick:d=>d.stopPropagation(),children:C.jsx(Hn,{...f})})})},St=tt(at)`
1
+ import{j as C}from"./liveblocks-DTaiayIC.js";import{a as i}from"./sentry-BRmieicQ.js";import{u as W,k as sn,j as g,s as ge,g as De,h as Ce,i as Ae,N as cn,l as rn}from"./core-DA_GbUVO.js";import{pu as Ie,fE as ee,gU as ln,TX as dn,oA as un,oa as mn,CZ as se,bn as pn,de as Re,bq as _e,sg as Q,V1 as Y,W9 as we,Wa as le,Vr as Pe,m9 as Fe,Wb as Ue,Vw as de,Vx as ue,m_ as xe,Rt as me,W5 as G,m3 as Ve,m1 as Le,md as fn,ph as hn,Wc as Sn,Wd as yn,CQ as J,m8 as Oe,QO as Be,cm as Tn,dk as bn,We as gn,W4 as In,Wf as vn,Wg as En,Wh as kn,Wi as Dn,CM as Cn,Wj as An,Wk as Rn,Wl as _n,Wm as wn,Wn as Pn,mc as Fn,Wo as Un,Wp as xn,W6 as Vn,Wq as Ln,Wr as On,Ws as Bn,QI as Nn,Qy as Wn,QX as zn,me as Mn,Ru as ve,pm as jn}from"./zeni-epic-state-cafsD4rZ.js";import{M as X,y as A,h as $,b2 as Gn,z as Ne,E as $n,a1 as qn,b3 as Hn,ab as Qn,a4 as ce,V as Yn,b4 as Xn,p as ie,as as Zn,b5 as Jn,b6 as Kn,b7 as et,ae as nt,av as oe}from"./index-CsnAk3jU.js";import{n as tt,S as at,D as ot}from"./mui-yMDYeeMr.js";import{u as st}from"./useAskAiCfoHostNavButtonProps-BOgWSkqa.js";import{d as We}from"./decodeURIComponentSafe-BeWrvHuJ.js";import{u as ct}from"./useInitialThreadRequest-BJ6-q-Ev.js";import{h as ze,c as Me,g as it,e as rt}from"./routePaths-DeWRBZpS.js";import{u as lt}from"./expenseAutomationHelper-4Qy8IF7o.js";import{v as dt}from"./utils-UMm0RYR6.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new n.Error().stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="73ca429b-4495-49c6-8542-261366ce7c6c",n._sentryDebugIdIdentifier="sentry-dbid-73ca429b-4495-49c6-8542-261366ce7c6c")}catch{}})();function ut(n=!0){const e=W(),o=sn(),{useFeatureGate:t}=X(),{isFeatureEnabled:a}=t(A.isCreateTransferEntryFromExpenseEnabled);i.useEffect((()=>{if(!n||a!==!0)return;const s=c=>{const u=o.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return u!=="In-Progress"&&u!=="Completed"};s("transferEntryEligible")&&e(Ie({kind:"transferEntryEligible"})),s("creditCardOnlyEligible")&&e(Ie({kind:"creditCardOnlyEligible"}))}),[n,a,e,o])}function mt(n,e){const o=(function(){const u=W(),[h,y]=i.useState(!1),[f,d]=i.useState(null),[r,S]=i.useState(null),{useDynamicConfig:I}=X(),{configValue:D,isDynamicConfigLoading:T}=I("transaction_categorization_config"),b=!T&&D?.capitalization_enabled===!0,v=g((l=>ee(l))),R=v.companyId,q=g((l=>ln(l.companyState,v.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:U,capitalizableAccountOverrides:_,dismissedAccounts:w}=g((l=>{const E=l.tenantState.currentTenantId,k=E!=null?l.tenantState.tenantsById[E]:void 0;return{capitalizableAccounts:k?.capitalizableAccounts??null,capitalizableAccountOverrides:k?.capitalizableAccountOverrides??null,dismissedAccounts:k?.capitalizationOnboardingDismissedAccounts??null}}),ge),x=i.useRef(U);x.current=U;const P=i.useRef(_);P.current=_;const V=i.useRef(w);V.current=w;const L=g((l=>dn(l.accountState)),ge),H=i.useMemo((()=>{const l={};for(const E of L)E.accountId!=null&&E.accountName!=null&&(l[E.accountId]=E.accountName);return l}),[L]),z=r!=null?H[r]??null:null,O=i.useCallback((l=>{if(!b)return;const E=x.current;if(E==null)return;const k=E.accounts??[],j=new Set(l),Z=P.current??{},ne=V.current;for(const B of k)if(j.has(B.accountId)&&Z[B.accountId]==null&&ne?.[B.accountId]==null)return d(B.classificationType),S(B.accountId),void y(!0)}),[b]),M=i.useCallback(((l,E)=>{u(un(R,l,E,!0)),y(!1),d(null),S(null)}),[u,R]),p=i.useCallback((()=>{r!=null&&(u(mn(R,r)),y(!1),d(null),S(null))}),[u,R,r]);return{showPopup:h&&b,popupType:f,popupAccountId:r,popupAccountName:z,currencySymbol:q,checkAndShowPopup:O,handleSubmit:M,handleDismiss:p}})(),t=i.useRef(void 0),a=i.useRef([]),s=i.useRef(o.checkAndShowPopup);s.current=o.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect((()=>{n==="In-Progress"&&(a.current=c.current()),n==="Completed"&&t.current==="In-Progress"&&a.current.length>0&&(s.current(a.current),a.current=[]),t.current=n}),[n]),o}const N=new Map,Ee=(n,e,o)=>`${n}|${e??""}|${o}`,K=(n,e)=>{const[o,t]=n.shownRecommendations;return{recommendationFor:n.dimension,recommendation:o?.name??"",recommendationSource:o?.engine??null,recommendationConfidencePercentage:o?.confidencePercentage??null,alternativeRecommendation:t?.name??null,alternativeRecommendationSource:t?.engine??null,alternativeRecommendationConfidencePercentage:t?.confidencePercentage??null,selectedValue:n.selected.name,numberOfRecommendations:n.shownRecommendations.length,transactionId:e,lineId:n.lineId??null}},re=(n,e,o)=>({transactionId:e,lineId:n.lineId,dimension:n.dimension,outcome:n.outcome,selected:{name:n.selected.name,id:n.selected.id},matchedSource:n.matchedSource,matchedRank:n.matchedRank,topPickSource:n.topPickSource,shownRecommendations:n.shownRecommendations.map((t=>({source:t.source,rank:t.rank,value:{name:t.name,id:t.id},confidence:t.confidencePercentage!=null?t.confidencePercentage/100:void 0}))),...o}),je=(n,e,o)=>{$.trackRecommendationFeedbackRetracted(K(e,o)),n(se(re(e,o,{outcome:"retracted"})))},Vt=(n,e)=>{const o=new Set(e.map(String));N.forEach(((t,a)=>{o.has(t.transactionId)&&(N.delete(a),je(n,t.feedback,t.transactionId))}))},Lt=n=>{const e=new Set(n.map(String));N.forEach(((o,t)=>{e.has(o.transactionId)&&N.delete(t)}))};function pt(n){const e=W(),[o,t]=i.useState(null),{isEnabled:a,fallbackTransactionId:s}=n,c=i.useCallback((f=>f.transactionId??s??""),[s]),u=i.useCallback((f=>{if(!a)return;const d=c(f);if(d==="")return;if(f.outcome!=="accepted")return void t(f);((S,I,D,T)=>{const b=Ee(I,D,T),v=N.get(b);return v!=null&&(N.delete(b),je(S,v.feedback,v.transactionId),!0)})(e,d,f.lineId,f.dimension)||(((S,I)=>{$.trackRecommendationAccepted(K(S,I))})(f,d),e(se(re(f,d,{}))))}),[a,c,e]),h=i.useCallback((f=>{if(o==null)return;const d=c(o);((r,S,I)=>{$.trackRecommendationFeedbackSubmitted({...K(r,S),feedbackReason:I})})(o,d,f),e(se(re(o,d,{reasonText:f,skipped:!1}))),((r,S)=>{N.set(Ee(S,r.lineId,r.dimension),{feedback:r,transactionId:S})})(o,d),t(null)}),[o,c,e]),y=i.useCallback((()=>{var f,d;o!=null&&(f=o,d=c(o),$.trackRecommendationFeedbackSkipped(K(f,d)),t(null))}),[o,c]);return{onRecommendationSelection:u,popup:o!=null?C.jsx(Gn,{feedback:o,onSubmit:h,onSkip:y}):null}}const pe=()=>{const n=Ne.getSignedInUser(),{useFeatureGate:e}=X(),{isFeatureEnabled:o}=e(A.isChainOfThoughtEnabled);return i.useMemo((()=>pn(n)&&o),[n,o])};function Ge(n){if(n!=null){if("customer"in n&&n.customer!=null){const{customer:e}=n;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in n&&n.vendor!=null){const{vendor:e}=n;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Ot(n,e){const o=W(),{useFeatureGate:t}=X(),a=g((p=>ee(p))),s=a.userRole.includes("charge_card_user")||a.userRole.includes("charge_card_admin"),c=a.userRole!=null&&Re(a.userRole),u=a.userRole!=null&&_e(a.userRole),{isFeatureEnabled:h}=t(A.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:y}=t(A.isExpenseAutomationEnabled),f=pe(),d=i.useMemo((()=>({id:n,type:Q(e)})),[n,e]),r=g((p=>Y(p,d))),S=r?.transactionDetailUpdateStatus?.fetchState,I=r?.transactionDetailLocalData?.lineItemById,D=g((p=>{const l=Y(p,d)?.transactionDetailLocalData.vendorUpdates?.id;return l==null?"Not-Started":p.transactionVendorViewState.editVendorStateById[l]?.saveStatus.fetchState??"Not-Started"})),T=i.useMemo((()=>r?.fetchState==="Completed"?Ge(r?.transaction):void 0),[r?.fetchState,r?.transaction]),b=g((p=>{if(T!=null)return we(p.customerIncomeState,p.vendorExpenseState,p.trendState,T,"month")})),v=g((p=>le(p))),R=g((p=>{if(T!=null)return Pe(p.trendWithTransactionsState,T,"TransactionDetail")})),q=a.company?.companyInfo.firstMonthOfFY??1,U=g((p=>Fe(p.accountState,p.accountListState,"accountList"))),[_,w]=i.useState(!1),[x,P]=i.useState(!1),[V,L]=i.useState(!1);i.useEffect((()=>{w(!1),P(!1),L(!1)}),[n,e]);const H=i.useCallback((()=>{w(!1),P(!1)}),[]),[z,O]=i.useState(!1),M=R?.selectedPeriod?.timePeriod;return i.useEffect((()=>{V||r==null||r.transaction==null||(o(Ue({id:r.transaction.id,type:r.transaction.type})),L(!0)),T!=null&&(!s||c&&u===!1)&&(_?x||b==null||(P(!0),o(me(T,"TransactionDetail",{timeframe:"month",timePeriod:M??b}))):(o(de()),o(ue()),w(!0),o(xe(T))))}),[o,V,r?.fetchState,r?.transaction,T,s,c,u,_,x,b,M]),i.useEffect((()=>{v.newVendorState?.vendorDetailLocalData?.vendorName!=null?O(!0):O(!1)}),[v.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{o(G("common"))}),[o]),{currentTenant:a,loggedInUserHasCardUserOrAdminRole:s,isUserHasDashboardAccess:c,isUserHasInvestorOrBankerAccess:u,isVendorBulkUpdateOnTransactionEnabled:h,isExpenseAutomationEnabled:y,isChainOfThoughtEnabled:f,selectedTransaction:d,transactionDetail:r,rawDetailSaveStatus:S,rawDetailLineItemById:I,vendorSaveStatus:D,tranEntity:T,defaultTrendTransactionTimePeriod:b,vendorViewDetails:v,uiState:R,firstMonthOfFY:q,uncategorizedAccounts:U,resetTrendIsFetchedStates:H,isCreateVendorDrawerOpen:z,setIsCreateVendorDrawerOpen:O}}const ft={overlayWidth:new Qn(100,100,58)},ht=({isOpen:n,onSaveVendor:e,onSaveSuccess:o,onCancel:t,vendorViewDetails:a})=>{const s=$n(),c=qn(),u=W(),h=g((d=>le(d))),y=()=>{t()},f={vendorDetailView:a??h,onSaveSuccess:()=>{u(Le()),u(fn("Not-Started")),o()},onSaveVendor:e,onCancelClick:y,saveVendorDetailLocalData:d=>{u(Ve({vendorId:void 0,localData:d}))}};return C.jsx(ot,{anchor:"right",open:n,PaperProps:{style:{width:ft.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.4,cursor:"pointer"}}},onClose:y,children:C.jsx(St,{onClick:d=>d.stopPropagation(),children:C.jsx(Hn,{...f})})})},St=tt(at)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
5
- `;function yt(n,e){n(hn({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:Y(e.transactionType),sourceTransactionType:Y(e.sourceTransactionType)}))}function Tt({currentTransactionId:n,enabled:e=!0,buildPath:o,beforeNavigate:t,navigate:a,navigateState:s}){const c=g((h=>h.createTransferEntryState.lastTransferEntryReplacement)),u=i.useRef(null);i.useEffect((()=>{if(!e||c==null||n==null||u.current===c)return;const{previousTransactionId:h,newTransactionId:y}=c;n.id===h.id&&n.type===h.type&&(u.current=c,t?.(),a(o(y),{replace:!0,state:s}))}),[e,c,n,o,t,a,s])}const bt=({closeDrawerHandler:n,overrideTransactionId:e,overrideTransactionType:o})=>{const t=ke(),a=Ce(),s=W(),c=pe(),{transactionTypeEncoded:u,transactionId:h}=Ae(),y=e??h,f=o??We(u??"");let d;ze(y,f)&&(d={id:y,type:Y(f)});const r=d!=null?g((I=>X(I,d))):void 0,S=()=>{const I=ce(t.state?.pathnameStackToGoBack),k=I.poppedPathname??((T=2)=>{let b="../";for(let v=0;v<T;v++)b=`${b}../`;return b})(1);a(k,{state:{pathnameStackToGoBack:I.newStack}})};return{transactionId:d,onSaveVendor:()=>{s(Be(d,void 0))},onSaveSuccess:()=>{if(r!=null&&r?.transaction&&r?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&r?.transactionDetailLocalData.vendorUpdates?.id!=null){const I=r?.transactionDetailLocalData.vendorUpdates,k={id:r?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:r?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:I?.name,qboId:r?.transactionDetailLocalData.vendorUpdates?.qboId??""},T={transactionId:{id:r?.transaction?.id,type:r?.transaction?.type},transaction:r?.transaction,lineIds:r?.transaction?.lines?.map((b=>b.id))??[]};s(Z({entity:k,amount:r?.transaction?.amount.amount,transactionDetails:T,flowType:"detail",isFetchCOT:c}))}S()},onCancel:()=>{d!=null&&s(Sn({transactionId:d})),s(Ve()),s(yn()),n(!0),S()}}},gt=rn((function(n,e){const o=X(n,e.selectedTransaction);let t;o==null&&console.warn("Check if the you've selected the transaction before getting the details");const a=Ne.getSignedInUser(),s=n.tenantState.currentTenantId,c={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:s??""};o!=null&&o.fetchState==="Completed"&&o.transaction!=null&&e.entity!=null&&(t=gn(n,e.entity,"TransactionDetail"));const u=n.entityAutoCompleteState.autoCompleteText.common,h=In(n,"common"),y=ee(n);return{transactionDetail:o,transactionAttachmentEndpointToDownload:`${oe}/transaction_attachment`,transactionAttachmentsEndpointToFetch:y.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${oe}/transaction_attachments_accounting_provider`:`${oe}/transaction_attachments`,attachmentUploadEndpoint:`${nt.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:t,analytics:$,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:u,entityAutoCompleteView:h},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails"),isTransactionSplitEditMode:o?.transactionDetailLocalData?.editMode??!1}}),(function(n,e){const{isCOTEnabled:o}=e;return{onBackClick:()=>{if(n(G("common")),e.onBackClick!=null)return void e.onBackClick();const t=ce(e.location.state?.pathnameStackToGoBack),a=t.poppedPathname??$e(2);e.navigate(a,{state:{pathnameStackToGoBack:t.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(t,a)=>{e.transaction!=null&&n(jn({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:t,customerId:a}))},onTransactionClick:t=>{e.resetTrendIsFetchedStates(),n(de()),n(ue());const a=ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Me(t,e.tenantEmailDomain),{state:{pathnameStackToGoBack:a}})},onTrendSelectedPeriodChange:t=>{if(t==null)e.defaultTrendTransactionTimePeriod!=null&&n(ve(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const a=t.currentTimePeriod==null?t.addTimePeriod:{startDate:t.addTimePeriod.startDate,endDate:t.currentTimePeriod.endDate};n(me(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:t.addTimePeriod})),n(ve(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:a}))}},onSaveUpdates:(t,a,s,c)=>{n(c===!0&&s!=null?Be(t,s,!0,e.isExpenseAutomationEnabled):Mn({transactionId:t,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:a})),n(G("common"))},onUploadAttachmentAttachment:t=>{n(zn(t))},onDeleteAttachment:t=>{e.transaction!=null&&n(Wn(t,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(t,a)=>{n(Nn({transactionId:t,transactionLocalData:a}))},onUpdateAllChecked:(t,a,s,c)=>{e.transaction!=null&&n(On(e.selectedTransaction,e.transaction,t,a,s,c))},onResetLineItemsCategoryClassInLocalData:(t,a,s,c,u,h)=>{n(Bn(t,a,s,c,u,h))},onChangeCategoryClassWhenUpdateAllIsChecked:(t,a)=>{e.transaction!=null&&n(Vn({id:e.transaction.id,type:e.transaction.type},e.transaction,t,a))},onSaveSuccess:()=>{const t=ce(e.location.state?.pathnameStackToGoBack);if(t.poppedPathname!=null){const a=dt(t.poppedPathname,"/").split("/"),s=a[a.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(s)&&e.navigate(t.poppedPathname,{state:{pathnameStackToGoBack:t.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${it(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${rt(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{n(Oe(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(t,a)=>{t.trim().length>=2?n(Ln({searchString:t,entityType:a,searchOrigin:"common"})):t.trim().length===0&&n(G("common"))},onCancelAutoComplete:()=>{n(G("common"))}},onFetchRecommendationsForEntity:(t,a,s,c)=>{n(Z({entity:t,amount:a,transactionDetails:s,flowType:"detail",isBulkFetch:c,isFetchCOT:o}))},clearRecommendationForLineId:t=>{const{transactionId:a,transaction:s,lineId:c}=t;n(xn(a,s,c))},resetUpdateErrorState:()=>{const t={id:e.selectedTransaction.id,type:e.selectedTransaction.type};n(Un(t))},onSaveVendorInLocalData:(t,a,s,c,u)=>{if(n(Fn({transactionId:t,vendorUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&u!=null&&n(Z({entity:s,amount:c,transactionDetails:u,flowType:"detail",isFetchCOT:o})),n(Le({vendorId:a.id?a.id:void 0,localData:{vendorName:a.name,vendorId:a.id?a.id:void 0}})),!a.id&&e.transaction!=null){const h=e.transaction,y=ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(h.type??"")}/${h.id}/vendor/create`,{state:{pathnameStackToGoBack:y}})}},onSaveCustomerInLocalData:(t,a,s,c,u)=>{n(wn({transactionId:t,customerUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&u!=null&&n(Z({entity:s,amount:c,transactionDetails:u,flowType:"detail",isFetchCOT:o}))},onUpdateAllTranactionsWithCurrentVendorChecked:t=>{n(Pn({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:t}))},onClickUpdateVendorToAllLineItems:(t,a,s)=>{n(_n(t,a,s))},onResetVendorToAllLineItems:(t,a,s)=>{n(Rn(t,a,s))},saveLatestSelectedEntity:(t,a,s)=>{n(An({transactionId:t,lineId:a,entity:s}))},updateVendorBulkRecommendationsFetchStatus:(t,a)=>{n(Cn(t,a))},setIsVendorUpdateAllChecked:(t,a,s)=>{n(kn(t,a,s))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?t=>yt(n,t):void 0,onLineAdd:()=>{if(e.transaction==null)return;const t={id:e.transaction.id,type:e.transaction.type},a=e.transaction.type==="journal_entry",s=e.transaction.amount?.currencyCode??"",c=e.transaction.amount?.currencySymbol??"",u=a?{amount:{amount:0,currencyCode:s,currencySymbol:c},id:crypto.randomUUID(),isCategoryMiscategorized:!1,isClassMiscategorized:!1,lineDescription:"",platformLineDetailType:"journal_entry_line_detail",type:"journal_entry_transaction_line",postingType:void 0,postingTypeName:"",lineTransactionType:"journal_entry"}:{amount:{amount:0,currencyCode:s,currencySymbol:c},id:crypto.randomUUID(),isCategoryMiscategorized:!1,isClassMiscategorized:!1,lineDescription:"",platformLineDetailType:"account_based_expense_line_detail",type:"transaction_with_account_and_class_line"};n(Dn(t,u))},onLineDelete:t=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};n(En(a,t))},onToggleSplitEditMode:t=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};n(vn(a,t))}}}))(et);function Ot(){const n=Ce(),e=W(),o=ke(),{useFeatureGate:t}=K(),a=Xn(),s=g((m=>ee(m))),c=s.userRole.includes("charge_card_user")||s.userRole.includes("charge_card_admin"),u=s.userRole!=null&&Re(s.userRole),h=s.userRole!=null&&_e(s.userRole),{isFeatureEnabled:y}=t(A.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:f}=t(A.isExpenseAutomationEnabled),{tenantEmailDomain:d,transactionTypeEncoded:r,transactionId:S}=Ae(),[I,k]=i.useState(!1),T=We(r??""),b=ze(S,T),v=g((m=>m.transactionVendorViewState)),R=pe(),{isFeatureEnabled:q}=t(A.isRecommendationFeedbackEnabled),U=Kn(),{onRecommendationSelection:_,popup:P}=pt({isEnabled:q,fallbackTransactionId:S}),x=i.useMemo((()=>({...U,onRecommendationSelection:_})),[U,_]),{isFeatureEnabled:w}=t(A.isTransactionCommentingEnabled),{isFeatureEnabled:L}=t(A.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:V}=t(A.isProjectsTransactionsEnabled),{isFeatureEnabled:H}=t(A.isTransactionSplitEnabled),z=a?.currentTenant?.companyId,B=a?.currentTenant?.companyName,M=ct(z),p=i.useMemo((()=>{if(b)return{id:S,type:Y(T)}}),[b,S,T]),l=p!=null?g((m=>X(m,p))):void 0,E=l?.transactionDetailLocalData.vendorUpdates?.id!=null?v.editVendorStateById[l?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",D=l?.fetchState==="Completed"?Ge(l?.transaction):void 0,j=g((m=>D!=null?Pe(m.customerIncomeState,m.vendorExpenseState,m.trendState,D,"month"):void 0)),Q=g((m=>le(m))),ne=g((m=>D!=null?we(m.trendWithTransactionsState,D,"TransactionDetail"):void 0)),O=s.company?.companyInfo.firstMonthOfFY??1,qe=g((m=>Fe(m.accountState,m.accountListState,"accountList"))),[He,fe]=i.useState(!1),[Ye,he]=i.useState(!1),[Xe,Se]=i.useState(!1),Ke=i.useCallback((m=>Me(m,d??"")+o.search),[d,o.search]),Qe=i.useCallback((()=>{Se(!1)}),[]);Tt({currentTransactionId:p,enabled:d!=null&&d!=="",buildPath:Ke,beforeNavigate:Qe,navigate:n,navigateState:o.state});const ye=()=>{fe(!1),he(!1)},Te=lt();ut();const te=i.useRef(l?.transaction);te.current=l?.transaction;const Ze=l?.transactionDetailUpdateStatus?.fetchState,F=mt(Ze,(()=>{const m=[];if(te.current!=null)for(const ae of te.current.lines??[])"account"in ae&&ae.account?.accountId!=null&&m.push(ae.account.accountId);return m}));i.useEffect((()=>{p!=null&&l!=null&&l.fetchState==="Not-Started"&&(e(Oe(p,!1)),ye())}),[e,p,l?.fetchState]),i.useEffect((()=>{if(p!=null&&l?.fetchState==="Error"){const m=ie(o.state?.pathnameStackToGoBack,o.pathname);n("page-not-found",{replace:!0,state:Te?{pathnameStackToGoBack:m,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:m,message:"pageNotFound",origin:"transaction_detail"}})}}),[p,l?.fetchState,n,o.state,o.pathname,Te]),i.useEffect((()=>{Xe||l==null||l.transaction==null||(e(Ue({id:l.transaction.id,type:l.transaction.type})),Se(!0));const m=o.state?.searchContext;D==null&&l?.fetchState==="Completed"&&De(l?.transaction,m),D!=null&&(!c||u&&h===!1)&&(He?Ye||j==null||(he(!0),e(me(D,"TransactionDetail",{timeframe:"month",timePeriod:ne?.selectedPeriod?.timePeriod??j}))):(e(de()),e(ue()),De(l?.transaction,m),fe(!0),e(xe(D))))}),[l?.fetchState,l?.transaction,j,c]),i.useEffect((()=>{Q.newVendorState?.vendorDetailLocalData?.vendorName!=null?k(!0):k(!1)}),[Q.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{e(G("common"))}),[]);const Je=[r,S].filter((m=>m!=null)),{transactionId:be,onSaveVendor:en,onSaveSuccess:nn,onCancel:tn}=bt({closeDrawerHandler:m=>{k(!1),n(m?"../":"../..")}}),{isAiCfoAccessEnabled:an,onAskAiCfoClick:on}=st({mobileExploreReferrer:"Transaction Details"});return Qn({isDataReady:l?.fetchState==="Completed"}),b?C.jsxs(C.Fragment,{children:[be!=null&&I&&C.jsx(ht,{isOpen:I,transactionId:be,onSaveVendor:en,onSaveSuccess:nn,onCancel:tn}),C.jsx(Zn,{toolkit:x,children:C.jsx(gt,{hideDeleteAttachment:!0,firstMonthOfFY:O,isDisabled:l?.transaction?.type==="transfer"&&a?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:d,location:o,navigate:n,selectedTransaction:p,entity:D,isCOTEnabled:R,defaultTrendTransactionTimePeriod:j,resetTrendIsFetchedStates:ye,transaction:l?.transaction,uncategorizedAccounts:qe,vendorSaveStatus:E,isVendorBulkUpdateOnTransactionEnabled:y,isCreateTransferEntryFromExpenseEnabled:L,isExpenseAutomationEnabled:f,isAiCfoAccessEnabled:an,onAskAiCfoClick:on,isTransactionCommentingEnabled:w,isProjectsTransactionsEnabled:V,isTransactionSplitEnabled:H,companyId:z,companyName:B,initialOpenThreadRequest:M})}),P,F.showPopup&&F.popupType!=null&&C.jsx(Jn,{popupType:F.popupType,currencySymbol:F.currencySymbol,accountId:F.popupAccountId??"",accountName:F.popupAccountName??"",onSubmit:F.handleSubmit,onDismiss:F.handleDismiss})]}):C.jsx(cn,{to:$e(Je.length)})}const $e=(n=2)=>{let e="../";for(let o=0;o<n;o++)e=`${e}../`;return e},De=(n,e)=>{if(n!=null){const{transactionCategory:o,transactionClass:t}=It(n),a=vt(n);$.trackTransactionDetails(n.account?.accountId,n.account?.accountName,n.id,a,o.length>0?o:void 0,t.length>0?t:void 0,n.type,n.amount,n.memo,n.lines?.length??0,n.attachments?.map((s=>s.fileName)),e!=null?"Search":void 0,e?.searchTerm,e?.resultPosition,e?.resultsCount)}},It=n=>{const e=[],o=[];return n.lines?.forEach((t=>{switch(t.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const a=t;a!=null&&a.account!=null&&a.account.accountName?.length>0&&e.push(a.account.accountName),a.class!=null&&a.class.className?.length>0&&o.push(a.class.className);break}}})),{transactionCategory:e,transactionClass:o}},vt=n=>Tn(n)===!0?n.customer?.name??"":bn(n)===!0?n.vendor?.name??"":n.memo!=null?n.memo:n.type;export{ht as C,Ot as T,pt as a,ut as b,mt as c,bt as d,gt as e,Tt as f,pe as g,yt as h,Vt as i,De as l,Lt as r,Bt as u};
5
+ `;function yt(n,e){n(hn({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:Q(e.transactionType),sourceTransactionType:Q(e.sourceTransactionType)}))}function Tt({currentTransactionId:n,enabled:e=!0,buildPath:o,beforeNavigate:t,navigate:a,navigateState:s}){const c=g((h=>h.createTransferEntryState.lastTransferEntryReplacement)),u=i.useRef(null);i.useEffect((()=>{if(!e||c==null||n==null||u.current===c)return;const{previousTransactionId:h,newTransactionId:y}=c;n.id===h.id&&n.type===h.type&&(u.current=c,t?.(),a(o(y),{replace:!0,state:s}))}),[e,c,n,o,t,a,s])}const bt=({closeDrawerHandler:n,overrideTransactionId:e,overrideTransactionType:o})=>{const t=De(),a=Ce(),s=W(),c=pe(),{transactionTypeEncoded:u,transactionId:h}=Ae(),y=e??h,f=o??We(u??"");let d;ze(y,f)&&(d={id:y,type:Q(f)});const r=d!=null?g((I=>Y(I,d))):void 0,S=()=>{const I=ce(t.state?.pathnameStackToGoBack),D=I.poppedPathname??((T=2)=>{let b="../";for(let v=0;v<T;v++)b=`${b}../`;return b})(1);a(D,{state:{pathnameStackToGoBack:I.newStack}})};return{transactionId:d,onSaveVendor:()=>{s(Oe(d,void 0))},onSaveSuccess:()=>{if(r!=null&&r?.transaction&&r?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&r?.transactionDetailLocalData.vendorUpdates?.id!=null){const I=r?.transactionDetailLocalData.vendorUpdates,D={id:r?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:r?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:I?.name,qboId:r?.transactionDetailLocalData.vendorUpdates?.qboId??""},T={transactionId:{id:r?.transaction?.id,type:r?.transaction?.type},transaction:r?.transaction,lineIds:r?.transaction?.lines?.map((b=>b.id))??[]};s(J({entity:D,amount:r?.transaction?.amount.amount,transactionDetails:T,flowType:"detail",isFetchCOT:c}))}S()},onCancel:()=>{d!=null&&s(Sn({transactionId:d})),s(Le()),s(yn()),n(!0),S()}}},gt=rn((function(n,e){const o=Y(n,e.selectedTransaction);let t;o==null&&console.warn("Check if the you've selected the transaction before getting the details");const a=Ne.getSignedInUser(),s=n.tenantState.currentTenantId,c={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:s??""};o!=null&&o.fetchState==="Completed"&&o.transaction!=null&&e.entity!=null&&(t=gn(n,e.entity,"TransactionDetail"));const u=n.entityAutoCompleteState.autoCompleteText.common,h=In(n,"common"),y=ee(n);return{transactionDetail:o,transactionAttachmentEndpointToDownload:`${oe}/transaction_attachment`,transactionAttachmentsEndpointToFetch:y.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${oe}/transaction_attachments_accounting_provider`:`${oe}/transaction_attachments`,attachmentUploadEndpoint:`${nt.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:t,analytics:$,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:u,entityAutoCompleteView:h},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails"),isTransactionSplitEditMode:o?.transactionDetailLocalData?.editMode??!1}}),(function(n,e){const{isCOTEnabled:o}=e;return{onBackClick:()=>{if(n(G("common")),e.onBackClick!=null)return void e.onBackClick();const t=ce(e.location.state?.pathnameStackToGoBack),a=t.poppedPathname??$e(2);e.navigate(a,{state:{pathnameStackToGoBack:t.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(t,a)=>{e.transaction!=null&&n(jn({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:t,customerId:a}))},onTransactionClick:t=>{e.resetTrendIsFetchedStates(),n(de()),n(ue());const a=ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Me(t,e.tenantEmailDomain),{state:{pathnameStackToGoBack:a}})},onTrendSelectedPeriodChange:t=>{if(t==null)e.defaultTrendTransactionTimePeriod!=null&&n(ve(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const a=t.currentTimePeriod==null?t.addTimePeriod:{startDate:t.addTimePeriod.startDate,endDate:t.currentTimePeriod.endDate};n(me(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:t.addTimePeriod})),n(ve(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:a}))}},onSaveUpdates:(t,a,s,c)=>{n(c===!0&&s!=null?Oe(t,s,!0,e.isExpenseAutomationEnabled):Mn({transactionId:t,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:a})),n(G("common"))},onUploadAttachmentAttachment:t=>{n(zn(t))},onDeleteAttachment:t=>{e.transaction!=null&&n(Wn(t,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(t,a)=>{n(Nn({transactionId:t,transactionLocalData:a}))},onUpdateAllChecked:(t,a,s,c)=>{e.transaction!=null&&n(Bn(e.selectedTransaction,e.transaction,t,a,s,c))},onResetLineItemsCategoryClassInLocalData:(t,a,s,c,u,h)=>{n(On(t,a,s,c,u,h))},onChangeCategoryClassWhenUpdateAllIsChecked:(t,a)=>{e.transaction!=null&&n(Ln({id:e.transaction.id,type:e.transaction.type},e.transaction,t,a))},onSaveSuccess:()=>{const t=ce(e.location.state?.pathnameStackToGoBack);if(t.poppedPathname!=null){const a=dt(t.poppedPathname,"/").split("/"),s=a[a.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(s)&&e.navigate(t.poppedPathname,{state:{pathnameStackToGoBack:t.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${it(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${rt(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{n(Be(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(t,a)=>{t.trim().length>=2?n(Vn({searchString:t,entityType:a,searchOrigin:"common"})):t.trim().length===0&&n(G("common"))},onCancelAutoComplete:()=>{n(G("common"))}},onFetchRecommendationsForEntity:(t,a,s,c)=>{n(J({entity:t,amount:a,transactionDetails:s,flowType:"detail",isBulkFetch:c,isFetchCOT:o}))},clearRecommendationForLineId:t=>{const{transactionId:a,transaction:s,lineId:c}=t;n(xn(a,s,c))},resetUpdateErrorState:()=>{const t={id:e.selectedTransaction.id,type:e.selectedTransaction.type};n(Un(t))},onSaveVendorInLocalData:(t,a,s,c,u)=>{if(n(Fn({transactionId:t,vendorUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&u!=null&&n(J({entity:s,amount:c,transactionDetails:u,flowType:"detail",isFetchCOT:o})),n(Ve({vendorId:a.id?a.id:void 0,localData:{vendorName:a.name,vendorId:a.id?a.id:void 0}})),!a.id&&e.transaction!=null){const h=e.transaction,y=ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(h.type??"")}/${h.id}/vendor/create`,{state:{pathnameStackToGoBack:y}})}},onSaveCustomerInLocalData:(t,a,s,c,u)=>{n(Pn({transactionId:t,customerUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&u!=null&&n(J({entity:s,amount:c,transactionDetails:u,flowType:"detail",isFetchCOT:o}))},onUpdateAllTranactionsWithCurrentVendorChecked:t=>{n(wn({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:t}))},onClickUpdateVendorToAllLineItems:(t,a,s)=>{n(_n(t,a,s))},onResetVendorToAllLineItems:(t,a,s)=>{n(Rn(t,a,s))},saveLatestSelectedEntity:(t,a,s)=>{n(An({transactionId:t,lineId:a,entity:s}))},updateVendorBulkRecommendationsFetchStatus:(t,a)=>{n(Cn(t,a))},setIsVendorUpdateAllChecked:(t,a,s)=>{n(Dn(t,a,s))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?t=>yt(n,t):void 0,onLineAdd:()=>{if(e.transaction==null)return;const t={id:e.transaction.id,type:e.transaction.type},a=e.transaction.type==="journal_entry",s=e.transaction.amount?.currencyCode??"",c=e.transaction.amount?.currencySymbol??"",u=a?{amount:{amount:0,currencyCode:s,currencySymbol:c},id:crypto.randomUUID(),isCategoryMiscategorized:!1,isClassMiscategorized:!1,lineDescription:"",platformLineDetailType:"journal_entry_line_detail",type:"journal_entry_transaction_line",postingType:void 0,postingTypeName:"",lineTransactionType:"journal_entry"}:{amount:{amount:0,currencyCode:s,currencySymbol:c},id:crypto.randomUUID(),isCategoryMiscategorized:!1,isClassMiscategorized:!1,lineDescription:"",platformLineDetailType:"account_based_expense_line_detail",type:"transaction_with_account_and_class_line"};n(kn(t,u))},onLineDelete:t=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};n(En(a,t))},onToggleSplitEditMode:t=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};n(vn(a,t))}}}))(et);function Bt(){const n=Ce(),e=W(),o=De(),{useFeatureGate:t}=X(),a=Yn(),s=g((m=>ee(m))),c=s.userRole.includes("charge_card_user")||s.userRole.includes("charge_card_admin"),u=s.userRole!=null&&Re(s.userRole),h=s.userRole!=null&&_e(s.userRole),{isFeatureEnabled:y}=t(A.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:f}=t(A.isExpenseAutomationEnabled),{tenantEmailDomain:d,transactionTypeEncoded:r,transactionId:S}=Ae(),[I,D]=i.useState(!1),T=We(r??""),b=ze(S,T),v=g((m=>m.transactionVendorViewState)),R=pe(),{isFeatureEnabled:q}=t(A.isRecommendationFeedbackEnabled),U=Xn(),{onRecommendationSelection:_,popup:w}=pt({isEnabled:q,fallbackTransactionId:S}),x=i.useMemo((()=>({...U,onRecommendationSelection:_})),[U,_]),{isFeatureEnabled:P}=t(A.isTransactionCommentingEnabled),{isFeatureEnabled:V}=t(A.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:L}=t(A.isProjectsTransactionsEnabled),{isFeatureEnabled:H}=t(A.isTransactionSplitEnabled),z=a?.currentTenant?.companyId,O=a?.currentTenant?.companyName,M=ct(z),p=i.useMemo((()=>{if(b)return{id:S,type:Q(T)}}),[b,S,T]),l=p!=null?g((m=>Y(m,p))):void 0,E=l?.transactionDetailLocalData.vendorUpdates?.id!=null?v.editVendorStateById[l?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",k=l?.fetchState==="Completed"?Ge(l?.transaction):void 0,j=g((m=>k!=null?we(m.customerIncomeState,m.vendorExpenseState,m.trendState,k,"month"):void 0)),Z=g((m=>le(m))),ne=g((m=>k!=null?Pe(m.trendWithTransactionsState,k,"TransactionDetail"):void 0)),B=s.company?.companyInfo.firstMonthOfFY??1,qe=g((m=>Fe(m.accountState,m.accountListState,"accountList"))),[He,fe]=i.useState(!1),[Qe,he]=i.useState(!1),[Ye,Se]=i.useState(!1),Xe=i.useCallback((m=>Me(m,d??"")+o.search),[d,o.search]),Ze=i.useCallback((()=>{Se(!1)}),[]);Tt({currentTransactionId:p,enabled:d!=null&&d!=="",buildPath:Xe,beforeNavigate:Ze,navigate:n,navigateState:o.state});const ye=()=>{fe(!1),he(!1)},Te=lt();ut();const te=i.useRef(l?.transaction);te.current=l?.transaction;const Je=l?.transactionDetailUpdateStatus?.fetchState,F=mt(Je,(()=>{const m=[];if(te.current!=null)for(const ae of te.current.lines??[])"account"in ae&&ae.account?.accountId!=null&&m.push(ae.account.accountId);return m}));i.useEffect((()=>{p!=null&&l!=null&&l.fetchState==="Not-Started"&&(e(Be(p,!1)),ye())}),[e,p,l?.fetchState]),i.useEffect((()=>{if(p!=null&&l?.fetchState==="Error"){const m=ie(o.state?.pathnameStackToGoBack,o.pathname);n("page-not-found",{replace:!0,state:Te?{pathnameStackToGoBack:m,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:m,message:"pageNotFound",origin:"transaction_detail"}})}}),[p,l?.fetchState,n,o.state,o.pathname,Te]),i.useEffect((()=>{Ye||l==null||l.transaction==null||(e(Ue({id:l.transaction.id,type:l.transaction.type})),Se(!0));const m=o.state?.searchContext;k==null&&l?.fetchState==="Completed"&&ke(l?.transaction,m),k!=null&&(!c||u&&h===!1)&&(He?Qe||j==null||(he(!0),e(me(k,"TransactionDetail",{timeframe:"month",timePeriod:ne?.selectedPeriod?.timePeriod??j}))):(e(de()),e(ue()),ke(l?.transaction,m),fe(!0),e(xe(k))))}),[l?.fetchState,l?.transaction,j,c]),i.useEffect((()=>{Z.newVendorState?.vendorDetailLocalData?.vendorName!=null?D(!0):D(!1)}),[Z.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{e(G("common"))}),[]);const Ke=[r,S].filter((m=>m!=null)),{transactionId:be,onSaveVendor:en,onSaveSuccess:nn,onCancel:tn}=bt({closeDrawerHandler:m=>{D(!1),n(m?"../":"../..")}}),{isAiCfoAccessEnabled:an,onAskAiCfoClick:on}=st({mobileExploreReferrer:"Transaction Details"});return Zn({isDataReady:l?.fetchState==="Completed"}),b?C.jsxs(C.Fragment,{children:[be!=null&&I&&C.jsx(ht,{isOpen:I,transactionId:be,onSaveVendor:en,onSaveSuccess:nn,onCancel:tn}),C.jsx(Jn,{toolkit:x,children:C.jsx(gt,{hideDeleteAttachment:!0,firstMonthOfFY:B,isDisabled:l?.transaction?.type==="transfer"&&a?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:d,location:o,navigate:n,selectedTransaction:p,entity:k,isCOTEnabled:R,defaultTrendTransactionTimePeriod:j,resetTrendIsFetchedStates:ye,transaction:l?.transaction,uncategorizedAccounts:qe,vendorSaveStatus:E,isVendorBulkUpdateOnTransactionEnabled:y,isCreateTransferEntryFromExpenseEnabled:V,isExpenseAutomationEnabled:f,isAiCfoAccessEnabled:an,onAskAiCfoClick:on,isTransactionCommentingEnabled:P,isProjectsTransactionsEnabled:L,isTransactionSplitEnabled:H,companyId:z,companyName:O,initialOpenThreadRequest:M})}),w,F.showPopup&&F.popupType!=null&&C.jsx(Kn,{popupType:F.popupType,currencySymbol:F.currencySymbol,accountId:F.popupAccountId??"",accountName:F.popupAccountName??"",onSubmit:F.handleSubmit,onDismiss:F.handleDismiss})]}):C.jsx(cn,{to:$e(Ke.length)})}const $e=(n=2)=>{let e="../";for(let o=0;o<n;o++)e=`${e}../`;return e},ke=(n,e)=>{if(n!=null){const{transactionCategory:o,transactionClass:t}=It(n),a=vt(n);$.trackTransactionDetails(n.account?.accountId,n.account?.accountName,n.id,a,o.length>0?o:void 0,t.length>0?t:void 0,n.type,n.amount,n.memo,n.lines?.length??0,n.attachments?.map((s=>s.fileName)),e!=null?"Search":void 0,e?.searchTerm,e?.resultPosition,e?.resultsCount)}},It=n=>{const e=[],o=[];return n.lines?.forEach((t=>{switch(t.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const a=t;a!=null&&a.account!=null&&a.account.accountName?.length>0&&e.push(a.account.accountName),a.class!=null&&a.class.className?.length>0&&o.push(a.class.className);break}}})),{transactionCategory:e,transactionClass:o}},vt=n=>Tn(n)===!0?n.customer?.name??"":bn(n)===!0?n.vendor?.name??"":n.memo!=null?n.memo:n.type;export{ht as C,Bt as T,pt as a,ut as b,mt as c,bt as d,gt as e,Tt as f,pe as g,Lt as h,yt as i,ke as l,Vt as r,Ot as u};
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-DTaiayIC.js";import{h as Q,g as U,u as W,i as X,j as g,N as q,l as H,n as Me,o as C}from"./core-DA_GbUVO.js";import{fE as Z,tA as ee,le as p,ew as te,Rk as Se,br as pe,_Y as Be,l_ as ae,Vt as ne,_Z as fe,__ as Le,bE as k,Rg as he,_$ as Fe,$0 as Te,$1 as Oe,Rj as ge,$2 as Ge,$3 as De,$4 as we,$5 as Ie,$6 as $e,$7 as ze,$8 as ye,Sw as Re}from"./zeni-epic-state-cafsD4rZ.js";import{M as ce,y as J,h as F,G as ke,dc as oe,p as z,a4 as se,aq as _e,T as Ve}from"./index-CsnAk3jU.js";import"./mui-yMDYeeMr.js";import{a as y}from"./sentry-BRmieicQ.js";import{w as ie}from"./withTransactionSidePanel-aokrUwcT.js";import{p as re,c as de}from"./routePaths-DeWRBZpS.js";import{w as Ne}from"./utils-UMm0RYR6.js";import{d as j}from"./decodeURIComponentSafe-BeWrvHuJ.js";import{Z as Je}from"./ZeniAccountStatementScreen-B4EqmylS.js";import"./recharts-D3wE7yHJ.js";import"./analytics-D1aMnBue.js";import"./plaid-BtwBxM-6.js";import"./dnd-BVDuXkBA.js";import"./stripe-cKAAJElX.js";import"./lottie-CkYI8upo.js";import"./lexical-Czsku2z1.js";import"./pdf-BIYA0Nfl.js";import"./useAskAiCfoHostNavButtonProps-BOgWSkqa.js";import"./TransactionDetailScreen-BzVEfQec.js";import"./useInitialThreadRequest-BJ6-q-Ev.js";import"./expenseAutomationHelper-4Qy8IF7o.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="0f5806bb-b709-46ce-9733-a9da5ebc9d89",a._sentryDebugIdIdentifier="sentry-dbid-0f5806bb-b709-46ce-9733-a9da5ebc9d89")}catch{}})();const Ue=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],N=a=>Ne(a),Ye=()=>{const{common:a,uncategorizedTransactionList:e}=ke.getLocalizedStrings();return{amount:e.missingReceipt.missingReceiptMinAmount.amount,currencyCode:a.currency.currencyCode,currencySymbol:a.currency.currencySymbol}},qe=H((function(a,e){const t=Be(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,N(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=N(e.selectedAccount.tranListType),d=Qe(t,n,c,o,e.bookCloseDate);F.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(fe({uiState:{dateRange:d},type:N(e.selectedAccount.tranListType)})),a(Se(o,p(d),!1,o==="missingReceipts"?Ye():void 0)),e.onSelectedTimePeriodChange(p(d))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({uiState:{scrollYOffset:t},type:N(e.selectedAccount.tranListType)}))}}}))(oe),V=ie((function({...a}){const e=Q(),t=U(),n=W(),c=t.pathname.split("/").find((l=>Ue.includes(l))),o=c??"uncategorized-expense",{tenantEmailDomain:d}=X(),{accountType:Y,title:b,subTitle:A}=Ze(o),f="month",T=g((l=>Z(l))),v=T.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:S}=ce(),{isFeatureEnabled:h}=S(J.isProjectsTransactionsEnabled),I=g((l=>ee(l)))&&h,{dataAvailable:x,initialTimeframeTick:O}=Ke(o,v,T.bookCloseDate),[P,G]=y.useState(!1),[E,w]=y.useState(void 0),u=y.useMemo((()=>{const l=p(O);return{tranListType:o,accountType:te(Y),title:b,subTitle:A,timeframe:f,period:l}}),[o,f,Y,x]);y.useEffect((()=>{if(!P&&u!=null){G(!0),F.trackTransactionList(void 0,void 0,void 0,u.title);const l=N(u.tranListType);n(Se(l,u.period,!0,l==="missingReceipts"?Ye():void 0))}}),[P,u,n]);let M=u;return u!=null&&E!=null&&(M={...u,period:E}),c==null||M==null?s.jsx(q,{to:"../"}):s.jsx(qe,{firstMonthOfFY:v,tenantEmailDomain:d,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:x,navigate:e,showProjectField:I,selectedAccount:M,referrerType:o,bookCloseDate:T.bookCloseDate,onSelectedTimePeriodChange:l=>w(l),...a})})),Ze=a=>{let e="",t="";const n=ke.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.common.texts.uncategorizedExpenses;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.common.texts.receipts}return{accountType:e,title:t,subTitle:""}},Ke=(a,e,t)=>{const n=pe();let c=pe().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:re(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Qe=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},We=H((function(a,e){const t=Fe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??be();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),F.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(Te({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(he(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(Te({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}}))(oe),Xe=ie((function({referrerType:a,...e}){const t=Q(),n=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,classIdEncoded:b,timeframe:A,startDate:f,endDate:T,titleEncoded:v}=X(),S=j(d??""),h=j(Y??""),I=j(b??""),x=j(v??""),O=g((r=>Le(r.transactionListState,h,S,I))),[P,G]=y.useState(!1),[E,w]=y.useState(void 0),u=g((r=>Z(r))),M=u.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:l}=ce(),{isFeatureEnabled:m}=l(J.isProjectsTransactionsEnabled),$=g((r=>ee(r)))&&m;let i;const L=He(S,h,I,A,f,T,x);if(L){const r={startDate:k(f,"YYYY-MM-DD"),endDate:k(T,"YYYY-MM-DD")},_=et(O?.dateRange,r);i={accountId:h,accountType:te(S),classId:I,title:x,timeframe:A,period:_}}y.useEffect((()=>{P||i==null||(G(!0),F.trackTransactionList(i.accountId,void 0,a,i.title),c(he(i.accountId,i.accountType,i.classId,i.period)))}),[P,i,c]);let B=i;i!=null&&E!=null&&(B={...i,period:E});const R=[d,Y,b,A,f,T,v].filter((r=>r!=null));return L&&B!=null?s.jsx(We,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,showProjectField:$,selectedAccount:B,referrerType:a,onSelectedTimePeriodChange:r=>w(r),...e}):s.jsx(q,{to:be(R.length)})})),be=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},He=(a,e,t,n,c,o,d)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&k(c,"YYYY-MM-DD").isValid()&&k(o,"YYYY-MM-DD").isValid()&&d!=null,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),tt=H((function(a,e){const t=Ge(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??ve();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),F.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(De({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(ge(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(De({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}}))(oe),at=ie((function({referrerType:a,...e}){const t=Q(),n=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,projectIdEncoded:b,timeframe:A,startDate:f,endDate:T,titleEncoded:v}=X(),S=j(d??""),h=j(Y??""),I=j(b??""),x=j(v??""),O=g((r=>Oe(r.transactionListState,h,S,I))),[P,G]=y.useState(!1),[E,w]=y.useState(void 0),u=g((r=>Z(r))),M=u.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:l}=ce(),{isFeatureEnabled:m}=l(J.isProjectsTransactionsEnabled),$=g((r=>ee(r)))&&m;let i;const L=nt(S,h,I,A,f,T,x);if(L){const r={startDate:k(f,"YYYY-MM-DD"),endDate:k(T,"YYYY-MM-DD")},_=ct(O?.dateRange,r);i={accountId:h,accountType:te(S),projectId:I,title:x,timeframe:A,period:_}}y.useEffect((()=>{P||i==null||(G(!0),F.trackTransactionList(i.accountId,void 0,a,i.title),c(ge(i.accountId,i.accountType,i.projectId,i.period)))}),[P,i,c]);let B=i;i!=null&&E!=null&&(B={...i,period:E});const R=[d,Y,b,A,f,T,v].filter((r=>r!=null));return L&&B!=null?s.jsx(tt,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,showProjectField:$,selectedAccount:B,referrerType:a,onSelectedTimePeriodChange:r=>w(r),...e}):s.jsx(q,{to:ve(R.length)})})),ve=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},nt=(a,e,t,n,c,o,d)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&k(c,"YYYY-MM-DD").isValid()&&k(o,"YYYY-MM-DD").isValid()&&d!=null,ct=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),ot=H((function(a,e){const t=$e(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&ze(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:ae(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Pe();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),F.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(ye({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(Ie(e.selectedAccount.accountId,e.selectedAccount.accountType,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ye({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=rt(e.tenantEmailDomain),n=z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}}))(oe),Ae=ie((function({referrerType:a,...e}){const t=Q(),n=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,timeframe:b,startDate:A,endDate:f,titleEncoded:T,excludeSubAccounts:v}=X(),S=j(d??""),h=j(Y??""),I=j(T??""),x=!(v!=null&&v==="exclude_subaccounts"),O=g((D=>we(D.transactionListState,h,S))),[P,G]=y.useState(!1),[E,w]=y.useState(void 0),u=g((D=>Z(D))),M=u.company?.featuresActivationInfo.connectedAccountProvider==="unit",l=u.company?.companyInfo.firstMonthOfFY??1;let m;const $=st(S,h,b,A,f,I);if($){const D={startDate:k(A,"YYYY-MM-DD"),endDate:k(f,"YYYY-MM-DD")},le=it(O?.dateRange,D);m={accountId:h,accountType:te(S),title:I,timeframe:b,period:le}}let i=m;m!=null&&E!=null&&(i={...m,period:E});const{useFeatureGate:L}=ce(),{isFeatureEnabled:B}=L(J.isTransactionCommentingEnabled),R=y.useCallback(((D,le)=>{if(o==null)return;const me=D.url.split(`/${o}/`)[1];if(me==null)return;const[je,xe]=me.split("?"),K=new URLSearchParams(xe??"");K.set("view","full"),K.set("thread_id",le),K.set("entity_type",D.entityType);const Ce=z(n.state?.pathnameStackToGoBack,n.pathname);t(`/${o}/${je}?${K.toString()}`,{state:{pathnameStackToGoBack:Ce}})}),[t,o,n.state,n.pathname]),{isFeatureEnabled:r}=L(J.isProjectsTransactionsEnabled),_=g((D=>ee(D)))&&r,{areTenantIdsInSync:ue}=_e();y.useEffect((()=>{!P&&m!=null&&ue&&(G(!0),F.trackTransactionList(m.accountId,void 0,a,m.title),c(Ie(m.accountId,m.accountType,m.period,void 0,!1,x)))}),[P,m,c,ue]);const Ee=[d,Y,b,A,f,T].filter((D=>D!=null));return $&&i!=null?s.jsx(ot,{firstMonthOfFY:l,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:M,isTransactionCommentingEnabled:B,onCommentThreadClick:R,showProjectField:_,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:D=>w(D),...e}):s.jsx(q,{to:Pe(Ee.length)})})),Pe=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},st=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&k(n,"YYYY-MM-DD").isValid()&&k(c,"YYYY-MM-DD").isValid()&&o!=null,it=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),rt=a=>`/${a}/transactions/${Re}/statements`;function Mt(){const a=U().state?.referrer,e=g((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[g((n=>Z(n))).tenantId],t=Ve();return s.jsxs(Me,{children:[s.jsx(C,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Ae,{referrerType:a})}),s.jsx(C,{path:"/zeni-clearing-account/statements",element:s.jsx(Je,{})}),s.jsx(C,{path:"/*",element:s.jsx(Ae,{referrerType:a})}),s.jsx(C,{path:"/uncategorized-income/*",element:s.jsx(V,{})}),s.jsx(C,{path:"/uncategorized-expense/*",element:s.jsx(V,{})}),s.jsx(C,{path:"/miscategorized-income/*",element:s.jsx(V,{})}),s.jsx(C,{path:"/miscategorized-expense/*",element:s.jsx(V,{})}),s.jsx(C,{path:"/missing-receipts/*",element:t?s.jsx(q,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(C,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Xe,{referrerType:a})}),s.jsx(C,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(at,{referrerType:a})})]})}export{Mt as default};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./liveblocks-UOzcPsHa.js";import{h as L,g as U,u as F,i as M,j as y,N as D,l as V,n as Te,o as k}from"./core-B5mDy9pu.js";import{cv as N,fF as v,Z4 as B,Oi as ae,N$ as q,O0 as ne,Z6 as Ie,Ol as we,Z2 as Ce,Z3 as se,Zi as ke,Mm as je,C5 as be,Z8 as Ae,Os as Ee,Z5 as re,dd as H,GB as oe,dZ as ve,d_ as De,$t as Le,$u as Ue,O1 as Fe,$v as Be,O2 as Pe,Ob as Oe,bq as Re,bJ as Me,cG as Ve,bK as Ne,cu as $e,bt as _e,U4 as Ze,ct as ze}from"./zeni-epic-state-7eY0g-Bc.js";import{U as $,h as Ge,z as E,a8 as _,j as b,d7 as qe,d8 as He,d9 as G,a1 as W,E as We,aq as Je,as as Ke,N as ie,c as O,ab as Qe,a7 as Xe,da as Ye,ae as J,p as et,db as tt,a4 as K,dc as at,ai as nt,$ as X,dd as st,g as rt}from"./index-6nH5LMe4.js";import{D as ot,n as R,S as it}from"./mui-Do6nLzGb.js";import ct from"./NotFoundScreen-BkYIKPgh.js";import{S as Y}from"./SetupPagesScreen-DzNRL7Y-.js";import{a as p}from"./sentry-DHDsO12F.js";import{u as lt}from"./useAskAiCfoHostNavButtonProps-BsP5fVhq.js";import{u as ut}from"./useInitialThreadRequest-7Q8HJAH2.js";import{M as ce}from"./MobileAppDrawer-0YtWXA3B.js";import{F as dt}from"./FeaturePreviewScreen-5SleVFKv.js";import{a as ee}from"./analyticsHelper-CwB3kQvw.js";import"./recharts-uFX1dZS-.js";import"./analytics-D6GpUSOP.js";import"./plaid-0g_vwjSd.js";import"./dnd-CGWe1ZMP.js";import"./stripe-cKAAJElX.js";import"./lottie-C5eNvt0I.js";import"./lexical-DW4lC8Zx.js";import"./pdf-DjwvAC2g.js";import"./utils-BsODCDYR.js";import"./BusinessVerificationPageScreen-CSruI1nV.js";import"./routePaths-uBvxqlLY.js";import"./InboxNotificationsProvider-BmF5-_KA.js";import"./useTaskManagerAccess-BG0Fkj9k.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="c39bd920-3ed3-4bcf-b39f-c6ef7cf072c1",t._sentryDebugIdIdentifier="sentry-dbid-c39bd920-3ed3-4bcf-b39f-c6ef7cf072c1")}catch{}})();const pt=V((function(t,a){const{companyId:n}=a;return{treasurySetupView:B(t,n),analytics:b}}),(function(t,a){const{navigate:n,analytics:o,treasurySetupView:i}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const r=i.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(r.riskScore,ee(r)),t(we(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(Ie(r))}}}))(qe);function mt(){const t=L(),a=U(),n=F(),{tenantEmailDomain:o}=M(),i=$(),r=y((w=>w.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState)),m=Ge(r),s=N(i?.loggedInUserRoleMap),[d,c]=p.useState(!1),[S,T]=p.useState(!1),[l,u]=p.useState(!1),x=y((w=>v(w))),f=E.getSignedInUserTenant(o)?.companyId??x.companyId,C=E.getSignedInUser(),h=y((w=>B(w,f))),g=y((w=>w.treasurySetupViewState.fetchState)),j=y((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),I=y((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState));if(C==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect((()=>{d||g!=="Not-Started"||f==null||(c(!0),n(ae(f,!0,!1)))}),[d,g,f,n]),p.useEffect((()=>{l||I!=="Not-Started"||f==null||(u(!0),n(q()))}),[l,I,f,n]),p.useEffect((()=>{S||j!=="Not-Started"||f==null||(T(!0),n(ne()))}),[S,j,f,n]),p.useEffect((()=>{m==="In-Progress"&&r==="Completed"&&t("../")}),[m,r,t]),x.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(D,{to:"../promo"});const P=x.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||g!=="Completed";return e.jsxs(e.Fragment,{children:[!P&&e.jsx(_,{analytics:b,onLoad:()=>{}}),e.jsx(pt,{navigate:t,location:a,companyId:f,isEditMode:!0,isLoading:P,isReadOnly:!s,treasurySetupView:h,analytics:b})]})}const ft=V((function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:ke(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:B(t,n)}}),(function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:i}=a,r=o.treasuryTransferMoneyLocalData,m=i.fundAllocationLocalData;return{onCancelClick:()=>{G(a.analytics,"cancel",r,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{G(a.analytics,"confirm",r,m,"Transfer"),t(Ee())},onSaveChangesToLocalStore:s=>{t(Ae(s))},onFetchLinkTokenClick:s=>{t(be("treasury_setup",s))},onEstablishConnectionClick:s=>{t(je(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}}))(He),yt=({isFirstTransfer:t,isTransactionsLoaded:a})=>{const n=L(),{tenantEmailDomain:o}=M(),i=F(),[r,m]=p.useState(!1),[s,d]=p.useState(!1),[c,S]=p.useState(!1),[T,l]=p.useState(!1),u=y((I=>I.treasurySetupViewState.fetchState)),x=y((I=>I.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),f=y((I=>I.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),C=y((I=>v(I))),h=E.getSignedInUserTenant(o)?.companyId??C.companyId,g=y((I=>Ce(I))),j=y((I=>B(I,h)));if(E.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect((()=>{s||u!=="Not-Started"||h==null||(d(!0),i(ae(h,!0,!1)))}),[s,u,h,i]),p.useEffect((()=>{c||x!=="Not-Started"||h==null||(S(!0),i(q()))}),[c,x,h,i]),p.useEffect((()=>{T||f!=="Not-Started"||h==null||(l(!0),i(ne()))}),[T,f,h,i]),e.jsxs(e.Fragment,{children:[e.jsx(_,{analytics:b,onLoad:()=>{}}),e.jsx(ft,{analytics:b,navigate:n,transferDetails:g,onAnotherTransferClick:()=>{m(!1),i(se())},currentTenant:C,treasurySetupView:j,showReviewContent:r,maxInsuredAmount:5e5,onReviewClick:()=>{G(b,"review",g.treasuryTransferMoneyLocalData,j.fundAllocationLocalData,"Transfer"),m(!0)},isFirstTransfer:t,isTransactionsLoaded:a,setShowReviewContent:m,onBackClick:()=>{}})]})},gt=R.div`
1
+ import{j as e}from"./liveblocks-DTaiayIC.js";import{h as L,g as F,u as U,i as V,j as y,N as D,l as M,n as Te,o as k}from"./core-DA_GbUVO.js";import{cv as O,fE as v,Yv as B,NK as ae,Nr as q,Ns as ne,Yx as we,NN as Ie,Yt as Ce,Yu as se,YJ as ke,LO as je,Bx as Ae,Yz as be,NU as Ee,Yw as re,dc as Z,G1 as oe,dX as ve,dY as De,_V as Le,_W as Fe,Nt as Ue,_X as Be,Nu as Pe,ND as Re,bq as Ne,bJ as Ve,cG as Me,bK as Oe,cu as _e,bt as ze,Tw as Ge,ct as $e}from"./zeni-epic-state-cafsD4rZ.js";import{V as _,l as Ye,z as E,a8 as z,h as A,d5 as qe,d6 as Ze,d7 as Y,a1 as H,E as He,aq as Ke,as as We,M as ie,y as R,ab as Je,a7 as Xe,d8 as Qe,ae as K,p as et,d9 as tt,a4 as W,da as at,ai as nt,_ as X,db as st,f as rt}from"./index-CsnAk3jU.js";import{D as ot,n as N,S as it}from"./mui-yMDYeeMr.js";import ct from"./NotFoundScreen-DFQDCCRn.js";import{S as Q}from"./SetupPagesScreen-Dzk7fHhk.js";import{a as p}from"./sentry-BRmieicQ.js";import{u as lt}from"./useAskAiCfoHostNavButtonProps-BOgWSkqa.js";import{u as ut}from"./useInitialThreadRequest-BJ6-q-Ev.js";import{M as ce}from"./MobileAppDrawer-cBt39NZW.js";import{F as dt}from"./FeaturePreviewScreen-BFU7MG_7.js";import{a as ee}from"./analyticsHelper-BefphWIe.js";import"./recharts-D3wE7yHJ.js";import"./analytics-D1aMnBue.js";import"./plaid-BtwBxM-6.js";import"./dnd-BVDuXkBA.js";import"./stripe-cKAAJElX.js";import"./lottie-CkYI8upo.js";import"./lexical-Czsku2z1.js";import"./pdf-BIYA0Nfl.js";import"./utils-UMm0RYR6.js";import"./BusinessVerificationPageScreen-BT5PhS2R.js";import"./routePaths-DeWRBZpS.js";import"./InboxNotificationsProvider-CLtB_fgp.js";import"./useTaskManagerAccess-Bm40mz18.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="17edb5fe-8a98-4097-a085-21259119e5b0",t._sentryDebugIdIdentifier="sentry-dbid-17edb5fe-8a98-4097-a085-21259119e5b0")}catch{}})();const pt=M((function(t,a){const{companyId:n}=a;return{treasurySetupView:B(t,n),analytics:A}}),(function(t,a){const{navigate:n,analytics:o,treasurySetupView:i}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const r=i.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(r.riskScore,ee(r)),t(Ie(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(we(r))}}}))(qe);function mt(){const t=L(),a=F(),n=U(),{tenantEmailDomain:o}=V(),i=_(),r=y((I=>I.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState)),m=Ye(r),s=O(i?.loggedInUserRoleMap),[d,c]=p.useState(!1),[S,T]=p.useState(!1),[l,u]=p.useState(!1),x=y((I=>v(I))),f=E.getSignedInUserTenant(o)?.companyId??x.companyId,C=E.getSignedInUser(),h=y((I=>B(I,f))),g=y((I=>I.treasurySetupViewState.fetchState)),j=y((I=>I.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),w=y((I=>I.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState));if(C==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect((()=>{d||g!=="Not-Started"||f==null||(c(!0),n(ae(f,!0,!1)))}),[d,g,f,n]),p.useEffect((()=>{l||w!=="Not-Started"||f==null||(u(!0),n(q()))}),[l,w,f,n]),p.useEffect((()=>{S||j!=="Not-Started"||f==null||(T(!0),n(ne()))}),[S,j,f,n]),p.useEffect((()=>{m==="In-Progress"&&r==="Completed"&&t("../")}),[m,r,t]),x.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(D,{to:"../promo"});const P=x.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||g!=="Completed";return e.jsxs(e.Fragment,{children:[!P&&e.jsx(z,{analytics:A,onLoad:()=>{}}),e.jsx(pt,{navigate:t,location:a,companyId:f,isEditMode:!0,isLoading:P,isReadOnly:!s,treasurySetupView:h,analytics:A})]})}const ft=M((function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:ke(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:B(t,n)}}),(function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:i}=a,r=o.treasuryTransferMoneyLocalData,m=i.fundAllocationLocalData;return{onCancelClick:()=>{Y(a.analytics,"cancel",r,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{Y(a.analytics,"confirm",r,m,"Transfer"),t(Ee())},onSaveChangesToLocalStore:s=>{t(be(s))},onFetchLinkTokenClick:s=>{t(Ae("treasury_setup",s))},onEstablishConnectionClick:s=>{t(je(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}}))(Ze),yt=({isFirstTransfer:t,isTransactionsLoaded:a})=>{const n=L(),{tenantEmailDomain:o}=V(),i=U(),[r,m]=p.useState(!1),[s,d]=p.useState(!1),[c,S]=p.useState(!1),[T,l]=p.useState(!1),u=y((w=>w.treasurySetupViewState.fetchState)),x=y((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),f=y((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),C=y((w=>v(w))),h=E.getSignedInUserTenant(o)?.companyId??C.companyId,g=y((w=>Ce(w))),j=y((w=>B(w,h)));if(E.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect((()=>{s||u!=="Not-Started"||h==null||(d(!0),i(ae(h,!0,!1)))}),[s,u,h,i]),p.useEffect((()=>{c||x!=="Not-Started"||h==null||(S(!0),i(q()))}),[c,x,h,i]),p.useEffect((()=>{T||f!=="Not-Started"||h==null||(l(!0),i(ne()))}),[T,f,h,i]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:A,onLoad:()=>{}}),e.jsx(ft,{analytics:A,navigate:n,transferDetails:g,onAnotherTransferClick:()=>{m(!1),i(se())},currentTenant:C,treasurySetupView:j,showReviewContent:r,maxInsuredAmount:5e5,onReviewClick:()=>{Y(A,"review",g.treasuryTransferMoneyLocalData,j.fundAllocationLocalData,"Transfer"),m(!0)},isFirstTransfer:t,isTransactionsLoaded:a,setShowReviewContent:m,onBackClick:()=>{}})]})},gt=N.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,11 +6,11 @@ import{j as e}from"./liveblocks-UOzcPsHa.js";import{h as L,g as U,u as F,i as M,
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${t=>t.theme.colors.grey4};
9
- `,St={overlayWidth:new Qe(100,100,48)},ht=V((function(t,a){const n=re(t),{companyId:o}=a;return{treasuryDetail:n,treasurySetupView:B(t,o),downloadEndPoint:`${J.bankingMicroServiceBaseUrl}/1.0/treasury-account/statements?query={"statement_type":"tax_statement"}`}}),(function(t,a){const{navigate:n,currentTenant:o,location:i,handleDrawerToggle:r,analytics:m}=a,{tenantEmailDomain:s}=o;return{onSettingsClick:()=>{m.trackAccountsListPageClicked("Settings Icon"),n("setup")},onReloadTransactions:()=>{t(oe(!0))},handleTreasuryOptionSelection:d=>{let c="page-not-found";d==="editPortfolio"?c=xt(s):d==="statements"?c=Tt(s):d==="taxLetter"?c=It(s):d==="settings"&&(c=wt(s));const S=et(i.state?.pathnameStackToGoBack,i.pathname);n(c,{state:{pathnameStackToGoBack:S}})},onColumnSortConfigChanged:(d,c)=>{t(Le({uiState:{sortKey:d,sortOrder:c}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{r(!0)},onAutoTransferClick:()=>{n("../../checking/auto-transfer")}}}))(Ye);function z({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=U(),o=L(),i=F(),r=W(),m=We(),s=y((A=>v(A))),{tenantEmailDomain:d}=M(),c=s.companyId??E.getSignedInUserTenant(d)?.companyId,[S,T]=p.useState(!1),l=y((A=>re(A))),u=l.fetchState,x=l.accountSummary?.totalBalance?.amount,f=y((A=>A.treasurySetupViewState.treasuryFundsDetails?.fetchStatus)),C=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",h=$(),g=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,j=N(h?.loggedInUserRoleMap),I=H(h?.loggedInUserRoleMap),{areTenantIdsInSync:P}=Je();p.useEffect((()=>{u==="Not-Started"&&!S&&P&&(T(!0),i(oe(!0)))}),[S,i,u,P]),p.useEffect((()=>{l.transactionsFetchState.fetchState==="Completed"&&l.transactions.length===0&&!n.pathname.includes("transfer")&&j&&o("./transfer")}),[l.transactionsFetchState.fetchState,l.transactions.length,n.pathname,j,o]);const w=()=>{o("..")},[le,ue]=p.useState(!1),Q=A=>{ue(A)},{isAiCfoAccessEnabled:de,onAskAiCfoClick:pe}=lt({mobileExploreReferrer:"Treasury"});Ke({isDataReady:u==="Completed"});const{useFeatureGate:Z}=ie(),{isFeatureEnabled:me}=Z(O.isDebitCardFeatureEnabled),{isFeatureEnabled:fe}=Z(O.isAutoTransferRuleEnabled),{isFeatureEnabled:ye}=Z(O.isTreasuryCommentingEnabled),ge=ut(c,{clearParams:u==="Completed"&&f?.fetchState==="Completed"}),Se=ve(s),he=De(me,s);if(Se===!0&&he!==!0)return e.jsx(dt,{});if(C){const A=f?.fetchState!=="Completed"||l.accountSummaryFetchState.fetchState!=="Completed";return e.jsxs(e.Fragment,{children:[l.accountSummaryFetchState.fetchState==="Completed"&&f?.fetchState==="Completed"&&t===!1&&a===!1?e.jsx(_,{analytics:b,onLoad:()=>{}}):null,e.jsx(ot,{onClose:w,anchor:"right",open:a||t,transitionDuration:250,PaperProps:{style:{width:St.overlayWidth.valuePercentage(r),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:m.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsxs(Ct,{onClick:xe=>xe.stopPropagation(),children:[t===!0?e.jsx(yt,{isFirstTransfer:l.transactions.length===0||x===0,isTransactionsLoaded:l.transactionsFetchState.fetchState!=="In-Progress"&&l.transactionsFetchState.fetchState!=="Not-Started"}):null,a===!0?e.jsx(mt,{}):null]})}),e.jsxs(gt,{windowSize:r,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:Q}),e.jsx(ht,{treasuryDetailsView:l,isAutoTransferRuleEnabled:fe,navigate:o,currentTenant:s,location:n,companyId:c,analytics:b,isTreasuryCommentingEnabled:ye,handleDrawerToggle:Q,initialOpenThreadRequest:ge,isLoading:A,isAiCfoAccessEnabled:de,onAskAiCfoClick:pe})]})]})}return g&&j?e.jsx(D,{to:"../setup"}):s.companyTreasuryInfo?.info&&!g&&I?e.jsx(D,{to:"../promo",state:n.state}):e.jsx(Xe,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})}const xt=t=>`/${t}/treasury/edit-portfolio`,Tt=t=>`/${t}/treasury/statements`,It=t=>`/${t}/treasury/tax-letter`,wt=t=>`/${t}/treasury/setup`,Ct=R(it)`
9
+ `,St={overlayWidth:new Je(100,100,48)},ht=M((function(t,a){const n=re(t),{companyId:o}=a;return{treasuryDetail:n,treasurySetupView:B(t,o),downloadEndPoint:`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account/statements?query={"statement_type":"tax_statement"}`}}),(function(t,a){const{navigate:n,currentTenant:o,location:i,handleDrawerToggle:r,analytics:m}=a,{tenantEmailDomain:s}=o;return{onSettingsClick:()=>{m.trackAccountsListPageClicked("Settings Icon"),n("setup")},onReloadTransactions:()=>{t(oe(!0))},handleTreasuryOptionSelection:d=>{let c="page-not-found";d==="editPortfolio"?c=xt(s):d==="statements"?c=Tt(s):d==="taxLetter"?c=wt(s):d==="settings"&&(c=It(s));const S=et(i.state?.pathnameStackToGoBack,i.pathname);n(c,{state:{pathnameStackToGoBack:S}})},onColumnSortConfigChanged:(d,c)=>{t(Le({uiState:{sortKey:d,sortOrder:c}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{r(!0)},onAutoTransferClick:()=>{n("../../checking/auto-transfer")}}}))(Qe);function $({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=F(),o=L(),i=U(),r=H(),m=He(),s=y((b=>v(b))),{tenantEmailDomain:d}=V(),c=s.companyId??E.getSignedInUserTenant(d)?.companyId,[S,T]=p.useState(!1),l=y((b=>re(b))),u=l.fetchState,x=l.accountSummary?.totalBalance?.amount,f=y((b=>b.treasurySetupViewState.treasuryFundsDetails?.fetchStatus)),C=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",h=_(),g=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,j=O(h?.loggedInUserRoleMap),w=Z(h?.loggedInUserRoleMap),{areTenantIdsInSync:P}=Ke();p.useEffect((()=>{u==="Not-Started"&&!S&&P&&(T(!0),i(oe(!0)))}),[S,i,u,P]),p.useEffect((()=>{l.transactionsFetchState.fetchState==="Completed"&&l.transactions.length===0&&!n.pathname.includes("transfer")&&j&&o("./transfer")}),[l.transactionsFetchState.fetchState,l.transactions.length,n.pathname,j,o]);const I=()=>{o("..")},[le,ue]=p.useState(!1),J=b=>{ue(b)},{isAiCfoAccessEnabled:de,onAskAiCfoClick:pe}=lt({mobileExploreReferrer:"Treasury"});We({isDataReady:u==="Completed"});const{useFeatureGate:G}=ie(),{isFeatureEnabled:me}=G(R.isDebitCardFeatureEnabled),{isFeatureEnabled:fe}=G(R.isAutoTransferRuleEnabled),{isFeatureEnabled:ye}=G(R.isTreasuryCommentingEnabled),ge=ut(c,{clearParams:u==="Completed"&&f?.fetchState==="Completed"}),Se=ve(s),he=De(me,s);if(Se===!0&&he!==!0)return e.jsx(dt,{});if(C){const b=f?.fetchState!=="Completed"||l.accountSummaryFetchState.fetchState!=="Completed";return e.jsxs(e.Fragment,{children:[l.accountSummaryFetchState.fetchState==="Completed"&&f?.fetchState==="Completed"&&t===!1&&a===!1?e.jsx(z,{analytics:A,onLoad:()=>{}}):null,e.jsx(ot,{onClose:I,anchor:"right",open:a||t,transitionDuration:250,PaperProps:{style:{width:St.overlayWidth.valuePercentage(r),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:m.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsxs(Ct,{onClick:xe=>xe.stopPropagation(),children:[t===!0?e.jsx(yt,{isFirstTransfer:l.transactions.length===0||x===0,isTransactionsLoaded:l.transactionsFetchState.fetchState!=="In-Progress"&&l.transactionsFetchState.fetchState!=="Not-Started"}):null,a===!0?e.jsx(mt,{}):null]})}),e.jsxs(gt,{windowSize:r,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:J}),e.jsx(ht,{treasuryDetailsView:l,isAutoTransferRuleEnabled:fe,navigate:o,currentTenant:s,location:n,companyId:c,analytics:A,isTreasuryCommentingEnabled:ye,handleDrawerToggle:J,initialOpenThreadRequest:ge,isLoading:b,isAiCfoAccessEnabled:de,onAskAiCfoClick:pe})]})]})}return g&&j?e.jsx(D,{to:"../setup"}):s.companyTreasuryInfo?.info&&!g&&w?e.jsx(D,{to:"../promo",state:n.state}):e.jsx(Xe,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})}const xt=t=>`/${t}/treasury/edit-portfolio`,Tt=t=>`/${t}/treasury/statements`,wt=t=>`/${t}/treasury/tax-letter`,It=t=>`/${t}/treasury/setup`,Ct=N(it)`
10
10
  display: flex;
11
11
  min-height: 100%;
12
12
  flex-direction: column;
13
- `,kt=R.div`
13
+ `,kt=N.div`
14
14
  display: flex;
15
15
  height: 100vh;
16
16
  width: 100%;
@@ -18,7 +18,7 @@ import{j as e}from"./liveblocks-UOzcPsHa.js";import{h as L,g as U,u as F,i as M,
18
18
  flex-direction: column;
19
19
  align-items: center;
20
20
  background-color: ${t=>t.theme.colors.grey4};
21
- `;function jt(){const t=L(),a=F(),n=W(),o=U(),i=`${J.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=p.useState(!1),s=y((u=>Ue(u)));p.useEffect((()=>{r||s.fetchState!=="Not-Started"||(m(!0),a(Fe(!1)))}),[r,s.fetchState,a]);const d=E.getSignedInUser(),c=y((u=>v(u))),S={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:c.tenantId??""},T=c.company?.companyInfo.companyLegalName??c.companyName;if(d==null)throw Error("Can't access statements page without signing in...");const l=s.fetchState!=="Completed";return e.jsx(kt,{windowSize:n,children:e.jsx(tt,{currentTenantCompanyName:T,statementListView:s,isLoading:l,onBackClick:()=>{const u=K(o.state?.pathnameStackToGoBack),x=u.poppedPathname??"..";t(x,{state:{pathnameStackToGoBack:u.newStack}})},authParams:S,downloadEndPoint:i})})}const bt=R.div`
21
+ `;function jt(){const t=L(),a=U(),n=H(),o=F(),i=`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=p.useState(!1),s=y((u=>Fe(u)));p.useEffect((()=>{r||s.fetchState!=="Not-Started"||(m(!0),a(Ue(!1)))}),[r,s.fetchState,a]);const d=E.getSignedInUser(),c=y((u=>v(u))),S={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:c.tenantId??""},T=c.company?.companyInfo.companyLegalName??c.companyName;if(d==null)throw Error("Can't access statements page without signing in...");const l=s.fetchState!=="Completed";return e.jsx(kt,{windowSize:n,children:e.jsx(tt,{currentTenantCompanyName:T,statementListView:s,isLoading:l,onBackClick:()=>{const u=W(o.state?.pathnameStackToGoBack),x=u.poppedPathname??"..";t(x,{state:{pathnameStackToGoBack:u.newStack}})},authParams:S,downloadEndPoint:i})})}const At=N.div`
22
22
  display: flex;
23
23
  height: 100vh;
24
24
  width: 100%;
@@ -26,7 +26,7 @@ import{j as e}from"./liveblocks-UOzcPsHa.js";import{h as L,g as U,u as F,i as M,
26
26
  flex-direction: column;
27
27
  align-items: center;
28
28
  background-color: ${t=>t.theme.colors.grey4};
29
- `;function At(){const t=L(),a=W(),n=U(),o=F(),i=`${J.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=p.useState(!1),s=y((u=>Be(u)));p.useEffect((()=>{r||s.fetchState!=="Not-Started"||(m(!0),o(Pe(!1)))}),[r,s.fetchState,o]);const d=E.getSignedInUser(),c=y((u=>v(u))),S={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:c.tenantId??""},T=c.company?.companyInfo.companyLegalName??c.companyName;if(d==null)throw Error("Can't access tax letter page without signing in...");const l=s.fetchState!=="Completed";return e.jsx(bt,{windowSize:a,children:e.jsx(at,{currentTenantCompanyName:T,taxLetterListView:s,isLoading:l,onBackClick:()=>{const u=K(n.state?.pathnameStackToGoBack),x=u.poppedPathname??"..";t(x,{state:{pathnameStackToGoBack:u.newStack}})},authParams:S,downloadEndPoint:i})})}const Et=V((function(t,a){const{companyId:n}=a,o=B(t,n);return{treasurySetupView:o,isSetupComplete:o.companyTreasuryInfo?.businessVerificationStatus?.code==="verified",videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk"}}),(function(t,a){const{navigate:n,companyId:o}=a;return{onSetupButtonClick:()=>{t(Oe(o))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:i=>{n(i?"..":"../setup",{relative:"path"})}}}))(st),vt=()=>{const t=nt(),a=L(),n=U(),o=F(),{tenantEmailDomain:i}=M(),[r,m]=p.useState(!1),s=y((g=>v(g))),[d,c]=p.useState(!1),S=y((g=>g.treasurySetupViewState.treasuryFundsDetails?.fetchStatus));p.useEffect((()=>{d||S?.fetchState!=="Not-Started"||T==null||(c(!0),o(q()))}),[S,o]);const T=E.getSignedInUserTenant(i)?.companyId??s.companyId,l=E.getSignedInUser(),u=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=g=>{m(g)};if(l==null)throw Error("Can't access treasury promo page without signing in...");const f=$(),C=N(f?.loggedInUserRoleMap),h=H(f?.loggedInUserRoleMap);if(u&&C)return e.jsx(D,{to:"../../treasury/setup"});if(s.company?.companyTreasuryInfo&&(!u&&C||h)){if(n.state?.message==="activation"){const g=K(n.state?.pathnameStackToGoBack);a(n.pathname,{state:{...n.state,message:void 0,pathnameStackToGoBack:g.newStack}})}return S?.fetchState!=="Completed"?e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})}):e.jsxs(e.Fragment,{children:[e.jsx(_,{analytics:b,onLoad:g=>(j=>j.trackTreasuryPromoView("Treasury Promo Page"))(g)}),e.jsx(ce,{isAppContentDrawerOpen:r,handleDrawerToggle:x}),e.jsx(Et,{analytics:b,navigate:a,companyId:T,meetingUrl:t("treasury_promo"),onClickMenuIcon:()=>{x(!0)}})]})}return e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})})},te=R.div`
29
+ `;function bt(){const t=L(),a=H(),n=F(),o=U(),i=`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=p.useState(!1),s=y((u=>Be(u)));p.useEffect((()=>{r||s.fetchState!=="Not-Started"||(m(!0),o(Pe(!1)))}),[r,s.fetchState,o]);const d=E.getSignedInUser(),c=y((u=>v(u))),S={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:c.tenantId??""},T=c.company?.companyInfo.companyLegalName??c.companyName;if(d==null)throw Error("Can't access tax letter page without signing in...");const l=s.fetchState!=="Completed";return e.jsx(At,{windowSize:a,children:e.jsx(at,{currentTenantCompanyName:T,taxLetterListView:s,isLoading:l,onBackClick:()=>{const u=W(n.state?.pathnameStackToGoBack),x=u.poppedPathname??"..";t(x,{state:{pathnameStackToGoBack:u.newStack}})},authParams:S,downloadEndPoint:i})})}const Et=M((function(t,a){const{companyId:n}=a,o=B(t,n);return{treasurySetupView:o,isSetupComplete:o.companyTreasuryInfo?.businessVerificationStatus?.code==="verified",videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk"}}),(function(t,a){const{navigate:n,companyId:o}=a;return{onSetupButtonClick:()=>{t(Re(o))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:i=>{n(i?"..":"../setup",{relative:"path"})}}}))(st),vt=()=>{const t=nt(),a=L(),n=F(),o=U(),{tenantEmailDomain:i}=V(),[r,m]=p.useState(!1),s=y((g=>v(g))),[d,c]=p.useState(!1),S=y((g=>g.treasurySetupViewState.treasuryFundsDetails?.fetchStatus));p.useEffect((()=>{d||S?.fetchState!=="Not-Started"||T==null||(c(!0),o(q()))}),[S,o]);const T=E.getSignedInUserTenant(i)?.companyId??s.companyId,l=E.getSignedInUser(),u=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=g=>{m(g)};if(l==null)throw Error("Can't access treasury promo page without signing in...");const f=_(),C=O(f?.loggedInUserRoleMap),h=Z(f?.loggedInUserRoleMap);if(u&&C)return e.jsx(D,{to:"../../treasury/setup"});if(s.company?.companyTreasuryInfo&&(!u&&C||h)){if(n.state?.message==="activation"){const g=W(n.state?.pathnameStackToGoBack);a(n.pathname,{state:{...n.state,message:void 0,pathnameStackToGoBack:g.newStack}})}return S?.fetchState!=="Completed"?e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})}):e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:A,onLoad:g=>(j=>j.trackTreasuryPromoView("Treasury Promo Page"))(g)}),e.jsx(ce,{isAppContentDrawerOpen:r,handleDrawerToggle:x}),e.jsx(Et,{analytics:A,navigate:a,companyId:T,meetingUrl:t("treasury_promo"),onClickMenuIcon:()=>{x(!0)}})]})}return e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})})},te=N.div`
30
30
  display: flex;
31
31
  width: 100%;
32
32
  height: 100%;
@@ -34,4 +34,4 @@ import{j as e}from"./liveblocks-UOzcPsHa.js";import{h as L,g as U,u as F,i as M,
34
34
  justify-content: center;
35
35
  align-items: center;
36
36
  background-color: ${t=>t.theme.colors.grey5};
37
- `;function aa(){const t=U(),a=y((g=>v(g))),{useFeatureGate:n}=ie(),o=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",i=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,r=$(),m=H(r?.loggedInUserRoleMap),s=a?.userRole!=null&&Re(a?.userRole),d=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!s)&&Me(r?.loggedInUserRoleMap),c=Ve(r?.loggedInUserRoleMap),S=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!s)&&Ne(r?.loggedInUserRoleMap),T=!!a.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!s&&$e(r?.loggedInUserRoleMap),l=o&&!s&&N(r?.loggedInUserRoleMap),{isFeatureEnabled:u}=n(O.isChargeCardFeatureEnabled),{isFeatureEnabled:x}=n(O.isDebitCardFeatureEnabled),f=rt(a,u,x)&&!s&&_e(r?.loggedInUserRoleMap),C=Ze(r?.loggedInUserRoleMap),h=ze(r?.loggedInUserRoleMap);return e.jsxs(Te,{children:[h?null:e.jsx(k,{path:"setup",element:e.jsx(Y,{isBillPayAdminLevelAccess:d,isReimbursementAdminLevelAccess:S,isZeniAccountAdminLevelAccess:T,isChargeCardAdminLevelAccess:f,isTreasuryAdminLevelAccess:l,isUserHasOnlyCardAccess:C,isUserHasOnlyBillPayAccess:c,productType:"zeni_treasury",type:"setup"})}),h?null:e.jsx(k,{path:"verification",element:e.jsx(Y,{isBillPayAdminLevelAccess:d,isUserHasOnlyBillPayAccess:c,isReimbursementAdminLevelAccess:S,isZeniAccountAdminLevelAccess:T,isChargeCardAdminLevelAccess:f,isTreasuryAdminLevelAccess:l,isUserHasOnlyCardAccess:C,productType:"zeni_treasury",type:"verification"})}),e.jsx(k,{path:"promo",element:e.jsx(vt,{})}),e.jsx(k,{path:"statements",element:e.jsx(jt,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(At,{})}),o?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"/",element:e.jsx(z,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),l?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"edit-portfolio",element:e.jsx(z,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(k,{path:"transfer",element:e.jsx(z,{isTransferDrawerOpen:!0,isEditPortfolioDrawerOpen:!1})})]}):null,e.jsx(k,{path:"*",element:e.jsx(ct,{})})]}):i&&l?e.jsx(k,{path:"*",element:e.jsx(D,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&m?e.jsx(k,{path:"*",element:e.jsx(D,{to:"../promo",state:t.state})}):e.jsx(k,{path:"*",element:null})]})}export{aa as default};
37
+ `;function aa(){const t=F(),a=y((g=>v(g))),{useFeatureGate:n}=ie(),o=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",i=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,r=_(),m=Z(r?.loggedInUserRoleMap),s=a?.userRole!=null&&Ne(a?.userRole),d=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!s)&&Ve(r?.loggedInUserRoleMap),c=Me(r?.loggedInUserRoleMap),S=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!s)&&Oe(r?.loggedInUserRoleMap),T=!!a.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!s&&_e(r?.loggedInUserRoleMap),l=o&&!s&&O(r?.loggedInUserRoleMap),{isFeatureEnabled:u}=n(R.isChargeCardFeatureEnabled),{isFeatureEnabled:x}=n(R.isDebitCardFeatureEnabled),f=rt(a,u,x)&&!s&&ze(r?.loggedInUserRoleMap),C=Ge(r?.loggedInUserRoleMap),h=$e(r?.loggedInUserRoleMap);return e.jsxs(Te,{children:[h?null:e.jsx(k,{path:"setup",element:e.jsx(Q,{isBillPayAdminLevelAccess:d,isReimbursementAdminLevelAccess:S,isZeniAccountAdminLevelAccess:T,isChargeCardAdminLevelAccess:f,isTreasuryAdminLevelAccess:l,isUserHasOnlyCardAccess:C,isUserHasOnlyBillPayAccess:c,productType:"zeni_treasury",type:"setup"})}),h?null:e.jsx(k,{path:"verification",element:e.jsx(Q,{isBillPayAdminLevelAccess:d,isUserHasOnlyBillPayAccess:c,isReimbursementAdminLevelAccess:S,isZeniAccountAdminLevelAccess:T,isChargeCardAdminLevelAccess:f,isTreasuryAdminLevelAccess:l,isUserHasOnlyCardAccess:C,productType:"zeni_treasury",type:"verification"})}),e.jsx(k,{path:"promo",element:e.jsx(vt,{})}),e.jsx(k,{path:"statements",element:e.jsx(jt,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(bt,{})}),o?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"/",element:e.jsx($,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),l?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"edit-portfolio",element:e.jsx($,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(k,{path:"transfer",element:e.jsx($,{isTransferDrawerOpen:!0,isEditPortfolioDrawerOpen:!1})})]}):null,e.jsx(k,{path:"*",element:e.jsx(ct,{})})]}):i&&l?e.jsx(k,{path:"*",element:e.jsx(D,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&m?e.jsx(k,{path:"*",element:e.jsx(D,{to:"../promo",state:t.state})}):e.jsx(k,{path:"*",element:null})]})}export{aa as default};