@zeniai/web-app-ui 5.4.12-dev → 5.4.13-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 (169) hide show
  1. package/dist/assets/{AccountMappingScreen-CtnQtVOI.js → AccountMappingScreen-BRzigj9b.js} +2 -2
  2. package/dist/assets/ActualMatchingMatchDetailScreen-BAnhij0b.js +1 -0
  3. package/dist/assets/AddressRoutes-CENGCuuf.js +1 -0
  4. package/dist/assets/{AddressScreen-CiPLLpNX.js → AddressScreen-B1WKzTxJ.js} +2 -2
  5. package/dist/assets/AiCfoScreen-C-9SCmEd.js +22 -0
  6. package/dist/assets/{AppDrawer-Bxmzf_KR.js → AppDrawer-BMUNiLoq.js} +1 -1
  7. package/dist/assets/{BillPayApprovalRoutes-Bhwrq5tr.js → BillPayApprovalRoutes-DKLoOuwS.js} +1 -1
  8. package/dist/assets/{BillPayRoutes-CQCAwPWX.js → BillPayRoutes-VPiZq7wX.js} +8 -8
  9. package/dist/assets/{BusinessVerificationPageScreen-71JxUYXB.js → BusinessVerificationPageScreen-BBfkNXWr.js} +2 -2
  10. package/dist/assets/CardsAiCfoScreen-DvGNnU6w.js +14 -0
  11. package/dist/assets/{ChargeCardRoutes-CvC_JvPH.js → ChargeCardRoutes-CulF2JvM.js} +9 -9
  12. package/dist/assets/CompanyPassportScreen-CO0hs3h5.js +1 -0
  13. package/dist/assets/ConnectionAuthScreen-BEy82Ssf.js +11 -0
  14. package/dist/assets/CustomerOnboardingAuthScreen-BMc4DHei.js +1 -0
  15. package/dist/assets/{CustomerOnboardingRoutes-BMrjyYZ8.js → CustomerOnboardingRoutes-rnOyKIiB.js} +3 -3
  16. package/dist/assets/{DashboardRoutes-DYfRGtw5.js → DashboardRoutes-Cu8fYKAV.js} +4 -4
  17. package/dist/assets/{DefaultTenantHome-DmRqFqlc.js → DefaultTenantHome-CVMojLIT.js} +1 -1
  18. package/dist/assets/DomesticWireDetailScreen-DvqNzOqw.js +18 -0
  19. package/dist/assets/DrawerScreen-DcCH_0uM.js +1 -0
  20. package/dist/assets/EntityDetailRoutes-CU_8Y8KV.js +1 -0
  21. package/dist/assets/{ExpenseAutomationRoutes-Bks-mNnn.js → ExpenseAutomationRoutes-BDWC6-9s.js} +6 -6
  22. package/dist/assets/FeaturePreviewScreen-BNMkwdyk.js +1 -0
  23. package/dist/assets/HubSpotOAuthCallbackScreen-BCwidLV1.js +1 -0
  24. package/dist/assets/InboxNotificationsProvider-dYyDAGLI.js +1 -0
  25. package/dist/assets/InvoicingRoutes-92Lk9pMJ.js +3 -0
  26. package/dist/assets/{MagicLinkRoutes-BQns5k2S.js → MagicLinkRoutes-qLj928yC.js} +9 -9
  27. package/dist/assets/MagicLinkSignInScreen-B5rANZEW.js +12 -0
  28. package/dist/assets/MobileAppDrawer-DfwkluKE.js +1 -0
  29. package/dist/assets/NotFoundScreen-QNLsV8PR.js +1 -0
  30. package/dist/assets/NotificationRoutes-ByCMeGhn.js +1 -0
  31. package/dist/assets/OAuthConsentScreen-DvZbWzs6.js +1 -0
  32. package/dist/assets/PandLWithForecastRoutes-CddU1LvP.js +1 -0
  33. package/dist/assets/{PaymentLinkScreen-BADSNyXp.js → PaymentLinkScreen-DJv-jPN7.js} +2 -2
  34. package/dist/assets/PeopleRoutes-seHwQw6o.js +22 -0
  35. package/dist/assets/PerformanceRoutes-DNmhsmNx.js +1 -0
  36. package/dist/assets/{Preview-DGZHmpgt.js → Preview-DYy1N-vn.js} +1 -1
  37. package/dist/assets/QBOConnectionScreen-BnjbZJvL.js +100 -0
  38. package/dist/assets/{ReimbursementApprovalRoutes-CsG7QtOs.js → ReimbursementApprovalRoutes-DUvLzvwu.js} +1 -1
  39. package/dist/assets/ReimbursementApprovalRuleDetailScreen-BliFeglB.js +1 -0
  40. package/dist/assets/ReimbursementRoutes-uqQhXzD_.js +68 -0
  41. package/dist/assets/ReportsRoutes-Ty52_HTE.js +1 -0
  42. package/dist/assets/RewardsRoutes-DLgsJCTB.js +1 -0
  43. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-v3zw3e0R.js → ScheduleDetailsPrepaidExpensesScreen-DW_6SN7k.js} +5 -5
  44. package/dist/assets/ScreenRoutes-DJPFTJup.js +2 -0
  45. package/dist/assets/{SettingsRoutes-CwW3Kcyz.js → SettingsRoutes-DucmuzJP.js} +6 -6
  46. package/dist/assets/{SetupPagesScreen-DPnnq4jj.js → SetupPagesScreen-DK6Wiu69.js} +5 -5
  47. package/dist/assets/SignInScreen-DaPgU2Nl.js +1 -0
  48. package/dist/assets/SignOutScreen-B59RCl56.js +9 -0
  49. package/dist/assets/TaskListScreen-Cvt-fENk.js +9 -0
  50. package/dist/assets/TaskRoutes-D2FIt6Mv.js +9 -0
  51. package/dist/assets/TransactionDetailRoutes-tbHHbIBD.js +1 -0
  52. package/dist/assets/TransactionDetailScreen-Ch0LCj8G.js +5 -0
  53. package/dist/assets/{TransactionListRoutes-aYhnWH8H.js → TransactionListRoutes-C3bzQYFS.js} +1 -1
  54. package/dist/assets/TreasuryRoutes-DDeLTUpi.js +37 -0
  55. package/dist/assets/{VendorsRoutes-QudM99vQ.js → VendorsRoutes-DJp9Lw7q.js} +11 -11
  56. package/dist/assets/WiseConfirmationScreen-CLvpbPdm.js +12 -0
  57. package/dist/assets/{ZeniAccountRoutes-DeSodvmm.js → ZeniAccountRoutes-DaY0WnU3.js} +11 -11
  58. package/dist/assets/ZeniAccountStatementScreen-iiLi8G_s.js +9 -0
  59. package/dist/assets/{accountMappingHelper-7kGWRPlV.js → accountMappingHelper-Bhr6esKF.js} +1 -1
  60. package/dist/assets/{analytics-BfKlFVdJ.js → analytics-DQKmqYV4.js} +4 -4
  61. package/dist/assets/{analyticsHelper-Cn2rORl_.js → analyticsHelper-BwgoMQXe.js} +1 -1
  62. package/dist/assets/{core-BWRpGVdr.js → core--MkqccHv.js} +1 -1
  63. package/dist/assets/{decodeURIComponentSafe-DN9u1X8y.js → decodeURIComponentSafe-BEyzjo_o.js} +1 -1
  64. package/dist/assets/{dnd-wLfPcqQ_.js → dnd-CP4whtxN.js} +1 -1
  65. package/dist/assets/{empty-CKwCpajm.js → empty-BNS5Y1pB.js} +1 -1
  66. package/dist/assets/{empty-BxjviaN4.js → empty-ClM8DHuA.js} +1 -1
  67. package/dist/assets/{emptyVideoElement-BURd-WPn.js → emptyVideoElement-fa_uGl7-.js} +1 -1
  68. package/dist/assets/epic-D_XIiCBV.js +2 -0
  69. package/dist/assets/expenseAutomationHelper-Dgshk1zd.js +1 -0
  70. package/dist/assets/getLocaleForTenant-GT2HpY4t.js +1 -0
  71. package/dist/assets/{index-9pdMsp-M.js → index-B3QEycF9.js} +14277 -14277
  72. package/dist/assets/{index-DwbDgvVM.js → index-BF_3R8uL.js} +1 -1
  73. package/dist/assets/{index-DYK9WSJX.js → index-BeoiOG5z.js} +1 -1
  74. package/dist/assets/{index-BtcZVjM1.js → index-CgMPBz0t.js} +1 -1
  75. package/dist/assets/{index-CcNUb4uI.js → index-D6eGMXVa.js} +2 -2
  76. package/dist/assets/index-eDdhdaqL.js +1 -0
  77. package/dist/assets/{index-D6O1UsWW.js → index-unoqrRj0.js} +1 -1
  78. package/dist/assets/index-yOyvZ3iU.js +1 -0
  79. package/dist/assets/{lexical-ljfsYSTd.js → lexical-BSiUIp1H.js} +1 -1
  80. package/dist/assets/liveblocks-DxRiM6VH.js +59 -0
  81. package/dist/assets/{lottie-ByqRhfis.js → lottie-ixiiUTSF.js} +1 -1
  82. package/dist/assets/{mui-BmHHlwSU.js → mui-kCJnrqYM.js} +1 -1
  83. package/dist/assets/{pathToGoBack-Dr_s0YFt.js → pathToGoBack-bat7ZlX9.js} +1 -1
  84. package/dist/assets/{pdf-C42gprG9.js → pdf-CRxQY5HT.js} +5 -5
  85. package/dist/assets/{pdf-lib-D4o6Nk27.js → pdf-lib-CHqQ3Ry3.js} +1 -1
  86. package/dist/assets/{plaid-CNV6JDhi.js → plaid-D94Y0H1P.js} +1 -1
  87. package/dist/assets/{pusher-DvjXiGU0.js → pusher-D0JY_FIf.js} +1 -1
  88. package/dist/assets/{react-DJxNpxcE.js → react-BBat2v6H.js} +1 -1
  89. package/dist/assets/{react-CdlDO5TG.js → react-BMVWGyVG.js} +1 -1
  90. package/dist/assets/{react-s5yBxYCg.js → react-Bv8sZiPk.js} +1 -1
  91. package/dist/assets/{react-CFwPpD-1.js → react-CiS3ccRD.js} +1 -1
  92. package/dist/assets/{react-Ct2ZzE_U.js → react-DTdBaAd3.js} +1 -1
  93. package/dist/assets/{react-CFX1RFZH.js → react-ltAkcaDC.js} +1 -1
  94. package/dist/assets/{recharts-BXLxGQ-T.js → recharts-EjKi4hbc.js} +1 -1
  95. package/dist/assets/{reportTimeframe-tJTkNTvP.js → reportTimeframe-DQT7aPWx.js} +1 -1
  96. package/dist/assets/{routePaths--TXDBUUo.js → routePaths-33YxbFc-.js} +1 -1
  97. package/dist/assets/{sentry-bpmZUW7k.js → sentry-B-dIf5xz.js} +1 -1
  98. package/dist/assets/{stripSplatSuffix-Bizh1-Tx.js → stripSplatSuffix-xBjFkZSJ.js} +1 -1
  99. package/dist/assets/{url-Cc_9bwX-.js → url-Bs4Dq0vG.js} +1 -1
  100. package/dist/assets/{url-8ONn8gmN.js → url-hbMZAh9y.js} +1 -1
  101. package/dist/assets/useActualMatchingMatchDetail-CAIVsCJG.js +1 -0
  102. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-BTEnEWTt.js +1 -0
  103. package/dist/assets/useAskAiCfoHostNavButtonProps-BZFKDw3z.js +1 -0
  104. package/dist/assets/useChargeCardPusherEvents-DG1lA66n.js +1 -0
  105. package/dist/assets/{useDeviceId-3o80RPjJ.js → useDeviceId-8baAH1vH.js} +1 -1
  106. package/dist/assets/useEmailConnectResultRefresh-BEw2d8Jv.js +1 -0
  107. package/dist/assets/useEnsureVendorListLoaded-IzkQpfDE.js +1 -0
  108. package/dist/assets/useInitialThreadRequest-D8OFP51H.js +1 -0
  109. package/dist/assets/useTaskManagerAccess-ULuU1uGf.js +1 -0
  110. package/dist/assets/useTaskManagerPusherEvents-WPqjoQIF.js +1 -0
  111. package/dist/assets/utils-BPWa_pEs.js +36 -0
  112. package/dist/assets/withTransactionSidePanel-RKi7LGHx.js +25 -0
  113. package/dist/assets/{zeni-epic-state-BlWDBO75.js → zeni-epic-state-Dg1W8Zu5.js} +4 -4
  114. package/dist/index.html +1 -1
  115. package/package.json +4 -4
  116. package/dist/assets/ActualMatchingMatchDetailScreen-COb45lJn.js +0 -1
  117. package/dist/assets/AddressRoutes-CXRpuLt0.js +0 -1
  118. package/dist/assets/AiCfoScreen-DPuJRDN-.js +0 -22
  119. package/dist/assets/CardsAiCfoScreen-Dze-_SQs.js +0 -14
  120. package/dist/assets/CompanyPassportScreen-dRN2jnGn.js +0 -1
  121. package/dist/assets/ConnectionAuthScreen-CrQ3LZFB.js +0 -11
  122. package/dist/assets/CustomerOnboardingAuthScreen-BUiUC1A4.js +0 -1
  123. package/dist/assets/DomesticWireDetailScreen-YfGiQgSo.js +0 -18
  124. package/dist/assets/DrawerScreen-DH40ycW6.js +0 -1
  125. package/dist/assets/EntityDetailRoutes-BgqO6DqU.js +0 -1
  126. package/dist/assets/FeaturePreviewScreen-B9UACzAC.js +0 -1
  127. package/dist/assets/HubSpotOAuthCallbackScreen-BjEMURaY.js +0 -1
  128. package/dist/assets/InboxNotificationsProvider-Cd4NxEtR.js +0 -1
  129. package/dist/assets/InvoicingRoutes-UHPes0q9.js +0 -3
  130. package/dist/assets/MagicLinkSignInScreen-IXnuvHt3.js +0 -12
  131. package/dist/assets/MobileAppDrawer-rCVKr3J3.js +0 -1
  132. package/dist/assets/NotFoundScreen-C94S-cmy.js +0 -1
  133. package/dist/assets/NotificationRoutes-h53g4kBO.js +0 -1
  134. package/dist/assets/OAuthConsentScreen-35XPz7Vp.js +0 -1
  135. package/dist/assets/PandLWithForecastRoutes-OnVWoGgX.js +0 -1
  136. package/dist/assets/PeopleRoutes-CnmV1pW5.js +0 -22
  137. package/dist/assets/PerformanceRoutes-MYTxvcMA.js +0 -1
  138. package/dist/assets/QBOConnectionScreen-C1Kn9y8q.js +0 -101
  139. package/dist/assets/ReimbursementApprovalRuleDetailScreen-BzhkgPjS.js +0 -1
  140. package/dist/assets/ReimbursementRoutes-BcjYsUHB.js +0 -68
  141. package/dist/assets/ReportsRoutes-Bcm2EvxJ.js +0 -1
  142. package/dist/assets/RewardsRoutes-Do7moyFI.js +0 -1
  143. package/dist/assets/ScreenRoutes-vTLuTGuW.js +0 -2
  144. package/dist/assets/SignInScreen-ColMnPgQ.js +0 -1
  145. package/dist/assets/SignOutScreen-DILD5ueP.js +0 -9
  146. package/dist/assets/TaskListScreen-aizYXFWj.js +0 -9
  147. package/dist/assets/TaskRoutes-CWWa57kf.js +0 -9
  148. package/dist/assets/TransactionDetailRoutes-DWXM95sG.js +0 -1
  149. package/dist/assets/TransactionDetailScreen-CNMo1Iyr.js +0 -5
  150. package/dist/assets/TreasuryRoutes-DnAsQTrn.js +0 -37
  151. package/dist/assets/WiseConfirmationScreen-CkFHmO99.js +0 -12
  152. package/dist/assets/ZeniAccountStatementScreen-DKVtRt3N.js +0 -9
  153. package/dist/assets/epic-Nc2-Ka61.js +0 -2
  154. package/dist/assets/expenseAutomationHelper-Dr99xbt1.js +0 -1
  155. package/dist/assets/getLocaleForTenant-BNAJG7gN.js +0 -1
  156. package/dist/assets/index-BXpurrfG.js +0 -1
  157. package/dist/assets/index-mJCZBkgN.js +0 -1
  158. package/dist/assets/liveblocks-V5YQZeeY.js +0 -59
  159. package/dist/assets/useActualMatchingMatchDetail-Mft821vz.js +0 -1
  160. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-3ayut61P.js +0 -1
  161. package/dist/assets/useAskAiCfoHostNavButtonProps-E2UGdnp9.js +0 -1
  162. package/dist/assets/useChargeCardPusherEvents-DVeqwUB9.js +0 -1
  163. package/dist/assets/useEmailConnectResultRefresh-F8OBO8EU.js +0 -1
  164. package/dist/assets/useEnsureVendorListLoaded-CKZrwkQQ.js +0 -1
  165. package/dist/assets/useInitialThreadRequest-Df-inltN.js +0 -1
  166. package/dist/assets/useTaskManagerAccess-Bq9TDvwr.js +0 -1
  167. package/dist/assets/useTaskManagerPusherEvents-Ctn5L7kn.js +0 -1
  168. package/dist/assets/utils-CXFQdt3d.js +0 -36
  169. package/dist/assets/withTransactionSidePanel-DOV8YzFf.js +0 -25
@@ -1 +0,0 @@
1
- import{j as g}from"./liveblocks-V5YQZeeY.js";import{a as y}from"./sentry-bpmZUW7k.js";import{h as U,u as x,g as C,i as V,j as R,l as k}from"./core-BWRpGVdr.js";import{_n as _,_5 as O,O6 as j,Oj as B,Oe as A,Of as E,_o as F,fE as K,Od as L}from"./zeni-epic-state-BlWDBO75.js";import{z as N,a6 as P,c3 as W,x as $,bV as G,c4 as H}from"./index-9pdMsp-M.js";import{u as q}from"./mui-BmHHlwSU.js";import{u as J}from"./useEnsureVendorListLoaded-CKZrwkQQ.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="98f36186-6368-4850-a7c1-cf21b7694019",e._sentryDebugIdIdentifier="sentry-dbid-98f36186-6368-4850-a7c1-cf21b7694019")}catch{}})();const M=k((function(e,o){const t=_(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",s=p==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return o.approvalRuleId&&(i=t.allApprovalRules.findIndex((r=>r.approvalRuleId===o.approvalRuleId))===0),{localData:t,hideUpperBoundField:s,isLowerBoundDisabled:i,approvalUpdateActionType:p}}),(function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:s,approvalRuleId:i}=o,r=p.remiSetupApproverViewUpdateData?.type,l=$(o.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const h=[];return v.forEach((u=>{const I=u.actors.selectedUsers.map((m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1}))),b=u.actors.selectedNonUsers.map((m=>{const f=(S=m.value,F(S)==null);var S;return{type:f?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!f}})),c=I.concat(b);h.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),h},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:i,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(W);function Q(){const e=U(),o=x(),t=C(),{approvalRuleId:p}=V(),s=N.getSignedInUser(),i=q(),r=R((n=>_(n))),l=R((n=>O(n))),[a,d]=y.useState(!1);if(y.useEffect((()=>{a||(d(!0),o(j(!0)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,p]),s==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):g.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t})}function se(e){return F(e)==null}const X=k((function(e,o){const t=_(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",s=[],i={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(s.push(r.id),i[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:s,vendorNamesById:i,editingRuleId:p==="approval_update"?o.approvalRuleId:void 0,allApprovalRulesWithUser:O(e).allApprovalRules}}),(function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:s,approvalRuleId:i}=o,r=p.remiSetupApproverViewUpdateData?.type,l=$(o.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach((f=>{const S=f.actorKind?.selectedOption,z=f.selectedRole?.selectedNonUsers??[];let D=[];S==="role"?D=z.map((w=>({type:"attribute",subType:w.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):S==="specific_person"&&(D=(f.persons?.selectedUsers??[]).map((w=>({type:"user",subType:void 0,userId:w.userId,idType:"user",isImplicitActor:!1}))));const T=f.action??"require_approval";m.push({action:T,actors:D,operator:D.length>1?T==="require_approval"?"or":"and":"is"})})),m},n=a.amountCriteria,v=a.vendorCriteria,h=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const I=v?.selection.selectedOptions??[];I.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:I});const b=h?.selection.selectedOptions??[];if(b.length>0&&(u.department={type:"department",operator:h?.operator.selectedOption??"is",departmentIds:b}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:i,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(L(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(H);function ne(){const e=R((t=>K(t))),{isApprovalRulesV3Enabled:o}=G(e?.tenantId);return o?g.jsx(Y,{}):g.jsx(Q,{})}function Y(){const e=U(),o=x(),t=C(),{approvalRuleId:p}=V(),s=N.getSignedInUser(),i=q(),r=R((n=>_(n))),l=R((n=>O(n))),[a,d]=y.useState(!1);if(J(),y.useEffect((()=>{a||(d(!0),o(j(!1)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,p]),s==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):g.jsx(X,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t},p??"new")}export{ne as R,se as i};
@@ -1,68 +0,0 @@
1
- import{j as s}from"./liveblocks-V5YQZeeY.js";import{u as ae,j as v,h as Q,g as Y,i as ie,N,l as ee,q as lt,n as mt,o as x}from"./core-BWRpGVdr.js";import{fE as H,Oa as ct,$S as ge,c6 as he,Ng as Fe,ma as dt,Nv as ce,Nu as de,$T as ut,bj as fe,gV as Le,$U as pt,XC as bt,l$ as $e,XD as ke,XE as gt,kN as ht,ZT as ft,l0 as St,N4 as It,CA as yt,kU as At,NR as Ne,$V as Pe,$W as Ce,$X as Rt,$Y as vt,$Z as kt,NB as Ee,l6 as Ct,_0 as Et,Nt as wt,Ne as xt,$_ as Bt,Nd as Tt,$$ as Dt,Nl as we,NF as jt,NE as Ut,NA as Ft,a00 as _e,S$ as Lt,bk as $t,No as Nt,O7 as Pt,a01 as _t,a02 as Mt,NN as Ot,NK as xe,Zn as Zt,Nb as zt,a03 as Me,OA as Be,OI as Gt,a04 as Vt,a05 as X,a06 as Ht,a07 as Oe,a08 as Wt,a09 as Ze,a0a as ze,NZ as ue,br as qt,bI as Se,cK as Ie,dZ as Ge,dY as Ve,a0b as Xt,gg as Kt,ZA as Yt,a0c as Jt,a0d as He,ZE as Qt,_n as en,a0e as tn,_M as nn,OF as Te,OE as an,a0f as sn,a0g as on,a0h as rn,a0i as ln,a0j as mn,_6 as cn,Ov as dn,Oz as un,bm as pn,bH as bn,cE as gn,cs as hn,bq as fn,U$ as Sn,d8 as In,db as yn,da as An,cD as Rn}from"./zeni-epic-state-BlWDBO75.js";import{bV as vn,g as We,a0 as qe,p as oe,c as F,z as L,cT as Xe,a7 as re,m as w,aR as De,K as j,ad as se,ae as kn,G as Ke,cU as Cn,n as K,ar as Ye,cV as En,V as le,cW as wn,ap as xn,aa as Bn,a6 as ye,S as Je,w as Tn,bD as Dn,au as jn,ah as Un,cX as Fn,j as Ln}from"./index-9pdMsp-M.js";import{n as P,S as $n,u as Qe}from"./mui-BmHHlwSU.js";import pe from"./NotFoundScreen-C94S-cmy.js";import{S as je}from"./SetupPagesScreen-DPnnq4jj.js";import{F as et}from"./FeaturePreviewScreen-B9UACzAC.js";import{a as g}from"./sentry-bpmZUW7k.js";import{u as Ae}from"./useAskAiCfoHostNavButtonProps-E2UGdnp9.js";import{u as tt}from"./useInitialThreadRequest-Df-inltN.js";import{D as Nn}from"./DrawerScreen-DH40ycW6.js";import{M as nt}from"./MobileAppDrawer-rCVKr3J3.js";import{F as Pn}from"./ScreenRoutes-vTLuTGuW.js";import{R as _n}from"./ReimbursementApprovalRoutes-CsG7QtOs.js";import"./recharts-BXLxGQ-T.js";import"./analytics-BfKlFVdJ.js";import"./plaid-CNV6JDhi.js";import"./dnd-wLfPcqQ_.js";import"./stripe-cKAAJElX.js";import"./lottie-ByqRhfis.js";import"./lexical-ljfsYSTd.js";import"./pdf-C42gprG9.js";import"./utils-CXFQdt3d.js";import"./BusinessVerificationPageScreen-71JxUYXB.js";import"./routePaths--TXDBUUo.js";import"./analyticsHelper-Cn2rORl_.js";import"./InboxNotificationsProvider-Cd4NxEtR.js";import"./useTaskManagerAccess-Bq9TDvwr.js";import"./getLocaleForTenant-BNAJG7gN.js";import"./useEnsureVendorListLoaded-CKZrwkQQ.js";import"./ReimbursementApprovalRuleDetailScreen-BzhkgPjS.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="b0adaa4c-3674-4275-bbd7-fb8720a318a5",e._sentryDebugIdIdentifier="sentry-dbid-b0adaa4c-3674-4275-bbd7-fb8720a318a5")}catch{}})();const at=e=>`/${e}/reimbursements`,Mn=e=>g.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},g.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),g.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:q,spendManagement:{reimbursement:{reimbursementDetail:ne}}}=Ke.getLocalizedStrings(),On=ee((function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),m=L.getSignedInUser(),c=fe(m),d=r.plaidConnectionDetails,i=Le(e.companyState,n),a=e.tenantState.currentTenantId,o={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:a??""},l=ge(e,t.reimbursementId),p=pt(e,m?.userId??"");let I=`${m?.firstName} ${m?.lastName}`,u=!0;t.reimbursementId!=null&&(I=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,u=m?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,y=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:y},authParams:o,defaultCurrency:{currencySymbol:i?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:i?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:i?.company.configInfo.mileageRateConfig,createdBy:I,isUserAdmin:he(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:d,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:p.bankAccountCreationState,bankAccounts:p.bankAccounts,analytics:w,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:u,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:$e(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:m,navigate:c,themeState:d}=t,{tenantEmailDomain:i}=r,a=L.getSignedInUser();return{onReceiptsUpload:(o,l,p)=>{o!=null&&e(de(o,l,p,n,a?.userId))},onExistingMerchantChange:(o,l)=>{e(we(!1,l,n,o,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Ft(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Ut())},clearRemiSaveStatus:()=>{e(jt("Not-Started",n))},onDuplicateLineClick:(o,l)=>window.open(`/${i}/reimbursement/${o}#L${l}`),onNewMerchantChange:(o,l)=>{e(we(!1,l,n,void 0,o))},removeFileFromLine:o=>{e(Dt({lineId:o,reimbursementId:n}))},onAmountChanged:(o,l)=>{e(Tt(l,o,n))},updateReimbursementType:(o,l,p)=>{e(Bt({reimbursementId:p,lineId:l,reimbursementType:o}))},onHomeCurrencyConversionUpdate:(o,l,p)=>{e(xt({reimbursementId:p,lineId:l,amountPayload:{amount:o.amount,currency_code:o.currencyCode,currency_symbol:o.currencySymbol}}))},onReimbursementDetailsChanged:o=>{e(wt({remiDetailLocalData:o,reimbursementId:n}))},saveRemiDetails:o=>{e(Ee(o,!1,n))},onUserBankDetailsUpdated:o=>{const{bankAccountSection:l}=o;e(Et({data:l}))},onFetchBankName:o=>{e(Ct(o))},submitRemiDetails:()=>{e(Ee("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:o=>{e(Ce({reimbursementId:o}))},updateInvoiceUploadFetchState:o=>{e(ce({reimbursementId:n,fetchState:o}))},clearTentativeNameForLine:o=>{e(kt({reimbursementId:n,lineId:o}))},removeDuplicateReimbursementForLine:o=>{e(vt({lineId:o}))},onZeniLogoClick:()=>{d.toggle()},clearAddRemiAutoFields:o=>{e(Rt({reimbursementId:n,lineId:o}))},redirectToReimbursementListScreen:()=>{e(Pe()),e(Ce({}));const o=at(i),l=K(m.state?.pathnameStackToGoBack,m.pathname);c(o,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(w.trackReimbursementDeleteReimbursement(n),e(Ne(n)))},onSaveBankAccount:()=>{a?.userId&&e(At(a?.userId,n))},onFetchLinkTokenClick:o=>{e(yt("user_reimbursement_account",o))},onEstablishConnectionClick:o=>{e(It(o,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:o=>{e(St(o,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(o,l)=>{o.trim().length>=2?e(gt({searchString:o,entityType:l,searchOrigin:"common"})):e(ke("common"))},onCancelAutoComplete:()=>{e(ke("common"))}}}}))(Cn);function Ue(){const e=Q(),t=ae(),n=Y(),{reimbursementId:r}=ie(),m=We(),c=qe(),d=g.useRef(!1),[i,a]=g.useState(r==null),[o,l]=g.useState(1),{useFeatureGate:p}=oe(),{isFeatureEnabled:I}=p(F.isLimitedCategoryForReimbursement),{isFeatureEnabled:u}=p(F.isShowDeletedReimbursementsFeatureEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:y}=Ae({mobileExploreReferrer:"Reimbursement Details"}),B=Y().pathname,D=B.includes("edit"),k=B.includes("reimbursement/new"),[C,A]=g.useState(!1),S=L.getSignedInUser(),E=v((b=>H(b))),h=v((b=>ge(b,r))),$=tt(E?.companyId,{clearParams:h.fetchState==="Completed"}),U=he(E?.userRole??[]);(function(){const b=ae(),M=v((J=>H(J))),O=M?.tenantId,{isApprovalRulesV3Enabled:Z,isLoading:W}=vn(O),z=v((J=>J.remiSetupApproverViewState.fetchState));g.useEffect((()=>{O==null||W||z==="Not-Started"&&b(ct(!0,!1,!1,Z))}),[O,W,Z,z,b])})(),g.useEffect((()=>{(k&&!C||D&&!C&&h.fetchState!="Completed"&&h.fetchState!="In-Progress")&&(A(!0),t(Fe(!1,I,u,r)))}));const R=v((b=>dt(b.accountState,b.accountListState,"reimbursementAccountList")));if(S==null)throw Error("Can't access address page without signing in...");const _={pathname:`../${r}`,search:n.search};return h.fetchState==="Completed"&&(d.current=!0),h.isDeleted===!0||h.billStage=="paid"||h.billStage=="scheduled"||d.current===!1&&h.fetchState==="Not-Started"||U&&h.billStatus==="rejected"||U===!1&&h.billStage==="pending_approval"&&h.billStatus!=="rejected"?s.jsx(N,{to:_}):d.current!==!1||h.deleteStatus.fetchState!=="In-Progress"&&h.fetchState==="Completed"?s.jsxs(Zn,{windowSize:c,children:[s.jsx(re,{analytics:w,onLoad:b=>(M=>{r!=null&&h.deleteStatus.fetchState!=="Completed"&&M.trackReimbursementEditReimbursement(r)})(b)}),i&&c!=="small"?s.jsx(zn,{}):null,i&&c!=="small"?s.jsx(Gn,{children:s.jsx(De,{showAutofill:i,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:E?.tenantId??""},onSkipAutofill:()=>a(!1),onInvoiceUpload:b=>{b!=null&&t(de(b,o,!0,r,S?.userId))},updateInvoiceUploadFetchState:b=>{t(ce({reimbursementId:r,fetchState:b}))},allowMultiFiles:i,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:q.upload,single:ne.dropReceipt.single,or:q.texts.or,multiple:ne.dropReceipt.multiple,receipts:q.texts.receipts2}})}):null,i&&c==="small"?s.jsxs(Vn,{children:[s.jsx(Hn,{onClick:()=>a(!1),children:s.jsx(Mn,{})}),s.jsx(De,{showAutofill:i,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:E?.tenantId??""},onSkipAutofill:()=>a(!1),onInvoiceUpload:b=>{b!=null&&t(de(b,o,!0,r,S?.userId))},updateInvoiceUploadFetchState:b=>{t(ce({reimbursementId:r,fetchState:b}))},allowMultiFiles:i,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:q.upload,single:ne.dropReceipt.single,or:q.texts.or,multiple:ne.dropReceipt.multiple,receipts:q.texts.receipts2}})]}):null,s.jsx(Wn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:$??void 0,location:n,navigate:e,currentTenant:E,reimbursementId:r,themeState:m,uncategorizedAccounts:R,disableInternalOverlay:!0,showSkipAutoFill:i,setShowSkipAutoFill:a,onCurrentLineIdForUploadChange:l,isAiCfoAccessEnabled:T,onAskAiCfoClick:y})})]}):s.jsx(Xe,{isNewReimbursement:r==null})}const Zn=P.div`
2
- display: flex;
3
- position: relative;
4
- height: 100vh;
5
- flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
6
- background-color: ${e=>e.theme.colors.grey4};
7
- `,zn=P.div`
8
- position: fixed;
9
- top: 0;
10
- left: 0;
11
- right: 0;
12
- bottom: 0;
13
- background-color: ${kn.overlayBackgroundBlack};
14
- z-index: 5;
15
- `,Gn=P.div`
16
- position: absolute;
17
- top: 0;
18
- left: 0;
19
- width: 42%;
20
- height: 100%;
21
- z-index: 6;
22
- display: flex;
23
- background-color: transparent;
24
- overflow: hidden;
25
- `,Vn=P.div`
26
- position: fixed;
27
- top: 0;
28
- left: 0;
29
- right: 0;
30
- bottom: 0;
31
- z-index: 11;
32
- display: flex;
33
- flex-direction: column;
34
- overflow-y: auto;
35
- background-color: ${e=>e.theme.colors.grey4};
36
- `,Hn=P.button`
37
- align-self: flex-end;
38
- background: none;
39
- border: none;
40
- cursor: pointer;
41
- padding: ${j.sp2} ${j.sp3};
42
- line-height: 1;
43
- color: ${e=>e.theme.colors.hero};
44
- &:hover {
45
- color: ${e=>e.theme.colors.primary};
46
- }
47
- svg {
48
- width: ${j.sp4};
49
- height: ${j.sp4};
50
- }
51
- `,Wn=P.div`
52
- display: flex;
53
- flex-direction: column;
54
- width: 100%;
55
- ${e=>e.windowSize!=="small"?"overflow: auto;":""}
56
- `,qn=ee((function(e,t){const n=_e(e,t.reimbursementId),r=L.getSignedInUser(),m=fe(r),c=e.tenantState.currentTenantId,d={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c??""},i=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=_t(n.remiActivities,Mt(t.currentTenant),r));const o=he(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:d,signedInUser:r,createdBy:i,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:o,showApproveRejectBtns:a,isZeniUser:m,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:$e(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:m,navigate:c,themeState:d}=t,{tenantEmailDomain:i}=r;return{onDuplicateLineClick:(a,o)=>window.open(`/${i}/reimbursement/${a}#L${o}`),redirectToReimbursementListScreen:()=>{e(Pe());const a=at(i),o=K(m.state?.pathnameStackToGoBack,m.pathname);c(a,{state:{pathnameStackToGoBack:o}})},onSaveRealTimeApprovals:a=>{e(zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Zt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(xe(n,a.type,"")):e(xe(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=K(m.state?.pathnameStackToGoBack,m.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{w.trackReimbursementDeleteReimbursement(n),e(Ne(n))},cancelAndDeleteReport:a=>{a===!0?w.trackReimbursementCancelAndDeleteReimbursement(n):w.trackReimbursementCancelReimbursement(n),e(Ot(n,a))},handleZeniLogoClick:()=>{d.toggle()}}}))(En);function Xn(){const e=Q(),t=ae(),n=Y(),r=n.hash.substring(1),m=We(),{reimbursementId:c}=ie(),d=L.getSignedInUser(),i=v((R=>H(R))),a=v((R=>_e(R,c??""))),o=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=tt(i?.companyId,{clearParams:a.fetchState==="Completed"&&!o}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:I}=Ae({mobileExploreReferrer:"Reimbursement Details"});Ye({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:u}=oe(),{isFeatureEnabled:T}=u(F.isLimitedCategoryForReimbursement),[y,B]=g.useState(!1),[D,k]=g.useState(!1),[C,A]=g.useState(!1),{isFeatureEnabled:S}=u(F.isShowDeletedReimbursementsFeatureEnabled),E=v((R=>ge(R,c??""))),h=Lt(i),$=$t(i.userRole),U=a.fetchState;if(g.useEffect((()=>{y||c==null?y==1&&U==="Error"&&e("page-not-found",{replace:!0}):(B(!0),t(Nt(c,!1,S)))}),[y,c,t,U]),g.useEffect((()=>{S&&a.remiDetails?.isDeleted===!0||i.isZeni===!0&&d?.userEmailDomain==="zeni.ai"&&h===!1?A(!1):A(a.remiActivities[0]?.isRealTimeApprovalEnabled&&($||a.allApprovers.find((R=>R.user.userId===d?.userId))!=null||a.remiDetails?.lastUpdatedBy===d?.userId))}),[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,$,i.isZeni,h,d]),g.useEffect((()=>{D||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||E.fetchState=="Completed"||E.fetchState=="In-Progress"||(k(!0),t(Fe(!1,T,S,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Pt(!1,!0,!0,a.lastUpdatedByUserId)))}),[D,a,c,t]),d==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&E.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx(N,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&E.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(Xe,{}):s.jsxs(s.Fragment,{children:[s.jsx(re,{analytics:w,onLoad:R=>(_=>{c!=null&&_.trackReimbursementReimbursementDetails(c)})(R)}),s.jsx(qn,{initialOpenThreadRequest:l??void 0,scrollId:r,isShowDeletedReimbursementEnabled:S,location:n,navigate:e,isRealTimeApprovalEnabled:C,currentTenant:i,reimbursementId:c??"",themeState:m,isAiCfoAccessEnabled:p,onAskAiCfoClick:I})]})}const Kn=ee((function(e,t){return{remisReviewView:Me(e),analytics:t.analytics}}),(function(e,t){return{onCloseOverlay:()=>{t.navigate(`/${t.tenantEmailDomain}/reimbursements`),e(X())},onCloseReviewItem:n=>{e(Vt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Gt());break;case"approve":e(Be("approved",r??""));break;case"reject":e(Be("rejected",r??""))}}}}))(wn);function Yn({tenantEmailDomain:e}){const t=Q(),n=v((d=>d.remisBulkActionViewState.bulkSubmissionFetchState.fetchState)),{remisForReview:r}=v((d=>Me(d))),m=le(),c=m?.loggedInUserRole?.includes("admin")===!0;return g.useEffect((()=>{n!=="Completed"&&r.length!==0||t(`/${e}/reimbursements`)}),[n,r.length,e]),s.jsx(Kn,{navigate:t,analytics:w,isAdmin:c,tenantEmailDomain:e})}const V=Qt(),st="bulk-operation-update",be="reimbursement-approval-rule-update",{spendManagement:Jn,common:me}=Ke.getLocalizedStrings(),Qn=Jn.reimbursement.bulkActions,ea=P.div`
57
- display: flex;
58
- min-height: 100%;
59
- width: 100%;
60
- flex: 1 1 auto;
61
- flex-direction: column;
62
- align-items: center;
63
- background-color: ${e=>e.theme.colors.grey4};
64
- `,ta=ee((function(e,t){const n=ze(e,V,t.isBulkActionEnabled);let r=n.allSubTabs;const m=L.getSignedInUser(),c=fe(m),d=e.tenantState.currentTenantId,i=H(e),a=i?.companyName??"",o={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:d??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter((u=>u!=="deleted")));const p=n.fetchState,I=en(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter((u=>u.isDeleted===!1)),isAdmin:t.isAdmin,isZeniUser:c,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:p,botEmail:n.reimbursementBotEmail,analytics:w,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:o,companyName:a,timePeriod:V,spendManagementEndPoint:`${jn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:I.affectedEntityIds}}),(function(e,t){const{navigate:n,currentTenant:r,location:m,period:c}=t,{tenantEmailDomain:d}=r;return{updateTabToState:i=>{e(X()),e(Oe(i))},onSubtabChange:i=>{e(X()),e(Ze(i))},onTransactionClick:(i,a)=>{const o=sa(d,i,a),l=K(m.state?.pathnameStackToGoBack,m.pathname);n(o,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const i=aa(d),a=K(m.state?.pathnameStackToGoBack,m.pathname);n(i,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:i}=t.currentTenant;w?.trackReimbursementNewReimbursement();const a=`/${i}/reimbursement/new`,o=K(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:o}})},onColumnSortConfigChanged:(i,a)=>{e(mn({uiState:{sortKey:i,sortOrder:a},period:t.period}))},onSearchTextChanged:i=>{e(ln(i))},onFiltersChange:i=>{e(rn({filters:i})),i.categories.every((a=>a.field!=null&&a.values?.length!==0))&&w.trackSpendManagmentFilterChange("reimbursement",i.categories.map((a=>`${a.field}-${JSON.stringify(a.values)}`)))},updateDownloadStateHandler:i=>{i==="In-Progress"&&w.trackSpendManagementDownloadClick("reimbursement"),e(on({uiState:{downloadState:i}}))},onReloadTransactions:()=>{e(ue(c,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:i=>{e(sn(i))},removeAllTransactionsFromBulkActionList:()=>{e(X())},onProceedForBulkActionClick:(i,a)=>{switch(i){case"delete":case"cancel":e(an(i,a??""));break;case"send_for_approval":e(Te("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(Te("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:i=>{i.endsWith(be)&&e(nn(!1))},onEventReceived:i=>{i===st&&e(tn())}}}))(Tn(Dn));function na(){const e=Q(),t=ae(),n=Y(),r=n.state,m=qe(),[c,d]=g.useState(null),i=lt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;g.useEffect((()=>{if(r?.tab!=null&&r?.subTab!=null){const f=Ht(r.tab.toString());f!=null?t(Oe(f)):console.log("Warning:Not a valid remiListTab");const G=Wt(r.subTab.toString());G!=null?t(Ze(G)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(X())}}),[]);const{useFeatureGate:a}=oe(),{isFeatureEnabled:o}=a(F.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(F.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:p}=a(F.isReimbursementBulkActionEnabled),I=L.getSignedInUser(),u=v((f=>H(f))),[T,y]=g.useState(!1),[B,D]=g.useState(!1),k=le(),C=k?.loggedInUserRole?.includes("admin")===!0,A=v((f=>ze(f,V,p))),{areTenantIdsInSync:S}=xn(),E=A.fetchState,{isAiCfoAccessEnabled:h,onAskAiCfoClick:$}=Ae({mobileExploreReferrer:"Reimbursement List"});if(Ye({isDataReady:E==="Completed"}),g.useEffect((()=>{!B&&S&&(D(!0),t(ue(V,!0,l,!1,!0)))}),[B,V,t,S]),I==null)throw Error("Can't access address page without signing in...");const U=!!u?.userRole&&qt(u),R=Se(k?.loggedInUserRoleMap),_=Ie(k?.loggedInUserRoleMap),b=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,M=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,O=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,Z=v((f=>Le(f.companyState,u.companyId))),W=Z?.company.featuresActivationInfo.connectedAccountProvider,z=f=>{y(f)},{isFeatureEnabled:J}=a(F.isDebitCardFeatureEnabled),it=Ge(J,u),ot=Ve(u),{remisProcessed:te,remisProcessing:Re}=v((f=>Xt(f)));g.useEffect((()=>{te===Re&&c!=null&&(t(Kt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:te>1?me.texts.reports2:Qn.report},{variableName:"_has_",variableValue:te>1?me.texts.have:me.texts.has},{variableName:"_action_",variableValue:Yt(c)}]})),t(Jt()),setTimeout((()=>{t(ue(V,!0,l,!1,!0,!0))}),3e3),d(null))}),[te,Re]);const rt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${st}`,`private-encrypted-${u.companyId}.${be}`]:[],eventCallback:(f,G,ve)=>{f.endsWith(be)?ve.onReimbursementApprovalRulesEventReceived?.(f):G.entity_type==="reimbursement"&&(d(G.operation_type),ve.onEventReceived(f))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?it===!0||ot===!0?s.jsx(et,{}):M&&(!U||R)||_&&b?s.jsxs(s.Fragment,{children:[E==="Completed"?s.jsx(re,{analytics:w,onLoad:f=>(G=>G.trackPageLoaded(Je.Event.reimbursementHome))(f)}):null,s.jsx(nt,{isAppContentDrawerOpen:T,handleDrawerToggle:z}),s.jsxs(ea,{windowSize:m,children:[s.jsx(Nn,{isOpen:i,drawerLeftMargin:new Bn(0,0,300,600),onClose:()=>{e(`/${u.tenantEmailDomain}/reimbursements`),t(X())},children:s.jsx(ia,{onClick:f=>f.stopPropagation(),children:s.jsx(Yn,{tenantEmailDomain:u.tenantEmailDomain})})}),s.jsx(ta,{isShowDeletedBillsEnabled:o,isShowDeletedReimbursementEnabled:l,location:n,navigate:e,currentTenant:u,period:V,isAdmin:C,isEmployee:U,entity:"reimbursement",onClickMenuIcon:()=>{z(!0)},createdByUserList:A.createdByUserList,createdByUserListFetchState:A.createdByUserListFetchState,isDownloadEnabled:A.isDownloadEnabled,connectedAccountProvider:W,isBulkActionEnabled:p,bulkSubmissionLimit:A.remiBulkSubmissionLimit,bulkSubmissionFetchState:A.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:h,onAskAiCfoClick:$,...rt})]})]}):O&&R?s.jsx(N,{to:"../setup"}):k!=null&&He(u,k.loggedInUserRoleMap)?s.jsx(N,{to:"../promo"}):s.jsx(ye,{fetchState:"In-Progress"}):s.jsx(pe,{})}const aa=e=>`/${e}/reimbursements/setup`,sa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},ia=P($n)`
65
- display: flex;
66
- min-height: 100%;
67
- flex-direction: column;
68
- `,oa=ee((function(e,t){const{companyId:n}=t;return{reimbursementSetupView:cn(e,n),analytics:w,videoUrl:"https://player.vimeo.com/video/814821498?h=e7fd11e13e&badge=0&autopause=0&player_id=0&app_id=122963"}}),(function(e,t){const{companyId:n,navigate:r}=t;return{onSetupButtonClick:()=>{e(un(n))},onCreateNewRemiButtonClick:()=>{e(dn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}}))(Fn),ra=()=>{const e=Un(),t=Q(),n=Y(),{tenantEmailDomain:r}=ie(),m=Qe(),[c,d]=g.useState(!1),i=v((C=>H(C))),a=L.getSignedInUserTenant(r)?.companyId??i.companyId,o=L.getSignedInUser(),l=i.userRoleId,p=!!i.userRole?.includes("reimbursements_user"),I=le(),u=Se(I?.loggedInUserRoleMap),T=Ie(I?.loggedInUserRoleMap),y=!!i.userReimbursementInfo?.isReimbursementTOSAccepted,B=!!i.companyReimbursementInfo?.info?.isReimbursementEnabled,D=!!i.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,k=C=>{d(C)};if(o==null)throw Error("Can't access reimbursement promo page without signing in...");return B&&T&&y?s.jsx(N,{to:"../../../reimbursements"}):D&&u?s.jsx(N,{to:"../../reimbursements/setup"}):i.companyReimbursementInfo&&!D||i.userReimbursementInfo&&T&&y===!1?s.jsxs(s.Fragment,{children:[s.jsx(re,{analytics:w,onLoad:C=>(A=>A.trackPageLoaded(Je.Event.reimbursementPromoPage))(C)}),s.jsx(nt,{isAppContentDrawerOpen:c,handleDrawerToggle:k}),s.jsx(oa,{companyId:a,navigate:t,meetingUrl:e("reimbursement_promo"),location:n,userReimbursementInfo:i.userReimbursementInfo,userRoleId:l,isEmployee:p,onClickMenuIcon:()=>{k(!0)}})]}):s.jsx(ye,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})};function Ma(){const e=v((z=>H(z))),t=le(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Qe(),m=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:d}=oe(),{isFeatureEnabled:i}=d(F.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=d(F.isDebitCardFeatureEnabled),o=Ge(a,e),l=Ve(e),p=e?.userRole!=null&&pn(e?.userRole),I=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&bn(t?.loggedInUserRoleMap),u=gn(t?.loggedInUserRoleMap),T=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p,y=Se(t?.loggedInUserRoleMap),B=T&&y,D=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!p,k=D&&hn(t?.loggedInUserRoleMap),C=Ln(e,i,a)&&!p,A=C&&fn(t?.loggedInUserRoleMap),S=Sn(t?.loggedInUserRoleMap),E=In(t?.loggedInUserRoleMap),h=yn(t?.loggedInUserRoleMap),$=D&&E,U=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!p&&h,R=An(t?.loggedInUserRoleMap),_=Rn(t?.loggedInUserRoleMap),b=Ie(t?.loggedInUserRoleMap),M=C&&R,{tenantEmailDomain:O}=ie(),Z=Y(),W=n===!0&&(y||b&&c);return s.jsxs(mt,{children:[Z.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(x,{path:"verification",element:s.jsx(je,{isBillPayAdminLevelAccess:I,isUserHasOnlyBillPayAccess:u,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:A,isUserHasOnlyCardAccess:S,productType:"reimbursement",type:"verification"})}),s.jsx(x,{path:"setup",element:s.jsx(je,{isBillPayAdminLevelAccess:I,isUserHasOnlyBillPayAccess:u,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:A,isUserHasOnlyCardAccess:S,productType:"reimbursement",type:"setup"})}),s.jsx(x,{path:"promo",element:s.jsx(ra,{})}),s.jsx(x,{path:"approval-rules/*",element:B?s.jsx(_n,{}):s.jsx(Pn,{showZeniAccountRoute:$,isUserHasBillPayAccess:_,isUserHasReimbursementAccess:b,showTreasuryRoute:U,isTenantBankingOnly:o,showChargeCardRoute:M,tenantEmailDomain:O??""})}),W&&s.jsx(x,{path:"*",element:s.jsx(na,{})}),(o===!0||l===!0)&&s.jsx(x,{path:"/*",element:s.jsx(et,{})}),t!=null&&He(e,t?.loggedInUserRoleMap)&&s.jsx(x,{path:"*",element:s.jsx(N,{to:"../promo"})}),m&&y&&s.jsx(x,{path:"*",element:s.jsx(N,{to:"../setup"})})]}):Z.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(x,{path:"new",element:s.jsx(Ue,{})}),s.jsx(x,{path:":reimbursementId",element:s.jsx(Xn,{})}),s.jsx(x,{path:":reimbursementId/edit",element:s.jsx(Ue,{})}),s.jsx(x,{path:"*",element:s.jsx(pe,{})})]}):s.jsx(x,{path:"*",element:s.jsx(ye,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${j.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(x,{path:"*",element:s.jsx(pe,{})})]})}export{Ma as default};
@@ -1 +0,0 @@
1
- import{j as f}from"./liveblocks-V5YQZeeY.js";import{g as te,h as ve,u as Ye,i as Ue,j as _,l as xe,n as ze,o as oe}from"./core-BWRpGVdr.js";import{fE as J,ED as S,Vy as Ge,l$ as ue,uh as he,v6 as Y,lG as O,lP as F,lH as V,kK as P,kB as A,kA as E,DG as U,vb as ye,bm as He,Vz as We,bj as Ne,E$ as $e,VA as qe,VB as Ze,cg as R,Dz as ne,VC as re,VD as Ke,VE as Qe,VF as Je,VG as Xe,VH as ea,VI as aa,VJ as sa,VK as ta,VL as oa,VM as na,VN as ra,VO as la,VP as j,VQ as x,VR as z,VS as G,VT as H,VU as W,VV as N,VW as $,VX as q,VY as Z,eg as ca,EF as ia,Er as le,Es as ce,EL as da,Ew as ie,bC as k,VZ as de,de as pe,Ex as _e,ER as pa,V_ as _a,V$ as fa,W0 as ba,W1 as ma,W2 as ua,W3 as ha,W4 as ya,W5 as Ca,W6 as wa,W7 as ga,dZ as Ra,dY as Ia}from"./zeni-epic-state-BlWDBO75.js";import{am as Sa,an as Ta,ao as ja,a as ka,a0 as Da,p as Ce,c as K,z as we,ap as Oa,V as Fa,e as Va,aq as Pa,ar as Aa,a7 as Ea,m as Q,S as Ma,D as Ba,n as ge,as as La,at as va,au as Ya}from"./index-9pdMsp-M.js";import"./mui-BmHHlwSU.js";import Ua from"./NotFoundScreen-C94S-cmy.js";import{F as xa}from"./FeaturePreviewScreen-B9UACzAC.js";import{a as u}from"./sentry-bpmZUW7k.js";import{u as za}from"./useInitialThreadRequest-Df-inltN.js";import{t as fe,a as be,b as Ga}from"./routePaths--TXDBUUo.js";import{t as me}from"./reportTimeframe-tJTkNTvP.js";import{M as Ha}from"./MobileAppDrawer-rCVKr3J3.js";import"./recharts-BXLxGQ-T.js";import"./analytics-BfKlFVdJ.js";import"./plaid-CNV6JDhi.js";import"./dnd-wLfPcqQ_.js";import"./stripe-cKAAJElX.js";import"./lottie-ByqRhfis.js";import"./lexical-ljfsYSTd.js";import"./pdf-C42gprG9.js";import"./utils-CXFQdt3d.js";import"./InboxNotificationsProvider-Cd4NxEtR.js";import"./useTaskManagerAccess-Bq9TDvwr.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="9e2af523-c507-45a5-a656-2420cd620bc5",e._sentryDebugIdIdentifier="sentry-dbid-9e2af523-c507-45a5-a656-2420cd620bc5")}catch{}})();const Wa=["profit_loss","balance_sheet","cash_flow"],I=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",h=e=>{e(Z({resetLeftScroll:!0})),e(q({resetLeftScroll:!0})),e($({resetLeftScroll:!0})),e(N({resetLeftScroll:!0})),e(W({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0}))},Na=e=>{e(fa()),e(ba()),e(ma()),e(ua()),e(ha()),e(ya()),e(Ca()),e(wa()),e(ga())},$a=xe((function(e){const o=we.getSignedInUser(),b=e.tenantState.currentTenantId,m=J(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:b??""},t=S(e),n=We(m);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,balanceSheetClassesViewReport:t.balanceSheetByClassReport,cashFlowClassesViewReport:t.cashFlowByClassReport,cashFlowProjectViewReport:t.cashFlowByProjectReport,balanceSheetProjectViewReport:t.balanceSheetByProjectReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:Q,isZeniUser:Ne(o),showAccountGroups:n===!0,isAccountingClassesEnabled:ue(e),isAccountingProjectsEnabled:he(e),currentTenantCompanyName:a,statementEndPoint:`${Ya}/statement`,authParams:s,isZeniCOAUsed:n}}),(function(e,o){const{navigate:b,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(Y(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(_a(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(pa(a)),s){const{isCompareModeOn:n,filter:r}=o,{additionalBalances:i,balancesRange:d}=r;let c=[...i];a==="year"&&(c=c.filter((p=>p!=="this_period_vs_same_period_last_year"&&p!=="this_period_vs_same_period_last_year_percent"&&p!=="same_period_last_year"))),e(le(o.firstMonthOfFY,n,d.numberOfPeriods<1?1:d.numberOfPeriods,c)),i.length>0&&e(ce(o.firstMonthOfFY,c.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",d.numberOfPeriods<1?1:d.numberOfPeriods,c))}t!==!0&&setTimeout((()=>h(e)),50)},onInitialDateRangeAvailable:(a,s)=>{const{filter:t}=o,n=me(t.timeframe),r=k(a),i=k(s),d=de(o.firstMonthOfFY,n,{startDate:r,endDate:i})??t.balancesRange.numberOfPeriods,{startOfTimeframeFY:c,endOfTimeframeFY:p}=pe(i,o.firstMonthOfFY,n);e(_e({numberOfPeriods:d,orderBy:t.balancesRange.orderBy,thisPeriod:{startDate:c,endDate:p}}))},onCustomDateRangeChanged:(a,s,t)=>{const{filter:n}=o,r=me(t??n.timeframe);switch(o.selectedReportID){case"profit_and_loss":case"profit_and_loss_by_classes":e(ye(r,void 0,!0,!1,a,s)),o.selectedReportID==="profit_and_loss_by_classes"&&o.isAccountingClassesEnabled&&e(ne());break;case"profit_and_loss_by_projects":o.isAccountingProjectsEnabled&&e(U());break;case"balance_sheet":e(E(r,!0,!1,a,s));break;case"balance_sheet_by_classes":e(E(r,!0,!1,a,s)),o.isAccountingClassesEnabled&&e(A());break;case"balance_sheet_by_projects":e(E(r,!0,!1,a,s)),o.isAccountingProjectsEnabled&&e(P());break;case"cash_flow":e(O(r,!0,a,s));break;case"cash_flow_by_classes":e(O(r,!0,a,s)),o.isAccountingClassesEnabled&&e(V());break;case"cash_flow_by_projects":e(O(r,!0,a,s)),o.isAccountingProjectsEnabled&&e(F())}const i=k(a),d=k(s),c=de(o.firstMonthOfFY,r,{startDate:i,endDate:d})??n.balancesRange.numberOfPeriods,{startOfTimeframeFY:p,endOfTimeframeFY:M}=pe(d,o.firstMonthOfFY,r);e(_e({numberOfPeriods:c,orderBy:n.balancesRange.orderBy,thisPeriod:{startDate:p,endDate:M}})),h(e)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(j(a)),(I(a)||R(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(ie({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(re({classViewLayout:"vertical"})),h(e)},onCOABalancesRangeChanged:(a,s)=>{e(ie(a,s)),h(e)},onThisPeriodChanged:(a,s,t)=>{e(da(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&h(e)},onAdditionalBalanceSelectionChanged:(a,s,t,n)=>{e(le(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(ce(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),n!==!0&&o.isCompareModeOn===a||setTimeout((()=>h(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,n)=>{e(ia({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:n}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let n,r;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(n=s.balanceTimeFrame,r=ca(s)):s.balanceTimeFrame==="year"?(n="quarter",r={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),r!=null&&n!=null){const i=a.accountName===""?a.accountDescription:a.accountName,d=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return fe(o.tenantEmailDomain,a.accountId,a.accountType,i,n,r);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return be(o.tenantEmailDomain,a.accountId,a.accountType,s.id,i,n,r)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?Ga(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,i,n,r):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?be(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],i,n,r):a.accountType!=null?fe(o.tenantEmailDomain,a.accountId,a.accountType,i,n,r):void 0})();if(d!=null){const c=ge(o.location.state?.pathnameStackToGoBack,o.location.pathname);b(d,{state:{pathnameStackToGoBack:c,referrer:D(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(Z({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(q({scrollPosition:s}));break;case"profit_and_loss_by_projects":e($({scrollPosition:s}));break;case"balance_sheet":e(N({scrollPosition:s}));break;case"balance_sheet_by_classes":e(W({scrollPosition:s}));break;case"balance_sheet_by_projects":e(H({scrollPosition:s}));break;case"cash_flow_by_classes":e(G({scrollPosition:s}));break;case"cash_flow_by_projects":e(z({scrollPosition:s}));break;case"cash_flow":e(x({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(Z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(q({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e($({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(W({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(x({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{b("../../")},onUpdateAccountViewMode:(a,s)=>{const t=s??o.selectedReportID,n=I(t),r=R(t);r?(e(sa({viewMode:a})),e(ta({viewMode:a}))):n?(e(oa({viewMode:a})),e(na({viewMode:a}))):(e(ra({viewMode:a})),e(la({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",D(t)),e(j(r?"cash_flow_by_classes":n?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",D(t)),e(j(r?"cash_flow_by_projects":n?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",D(t)),e(j(r?"cash_flow":n?"balance_sheet":"profit_and_loss"))),h(e)},onUpdateClassesToFilterOut:a=>{R(o.selectedReportID)?e(Xe({classesToFilterOut:a})):I(o.selectedReportID)?e(ea({classesToFilterOut:a})):e(aa({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{R(o.selectedReportID)?e(Ke({projectsToFilterOut:a})):I(o.selectedReportID)?e(Qe({projectsToFilterOut:a})):e(Je({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(re({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=I(o.selectedReportID),s=R(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?V():a?A():ne()),o.isAccountingProjectsEnabled&&e(s?F():a?P():U())},onUpdateDisplayOrder:a=>{e(Ze(a))},onUpdateReportFormat:a=>{Na(e),e(qe(a))},onClickMenuIcon:()=>{m(!0)},onResyncReports:()=>{const a=o.selectedReportID;e(a!=="balance_sheet_by_classes"?a!=="balance_sheet_by_projects"?a!=="cash_flow_by_classes"?a!=="cash_flow_by_projects"?$e(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):F(!0):V(!0):P(!0):A(!0))}}}))(La);function qa(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=ka(),b=Da(),m=va(b),a=ve(),s=Ye(),t=te(),{tenantEmailDomain:n}=Ue(),{useFeatureGate:r}=Ce(),{isFeatureEnabled:i}=r(K.isReportsHorizontalClassLayoutSwitchEnabled),{isFeatureEnabled:d}=r(K.isReportsCustomDateRangeEnabled),c=we.getSignedInUser(),[p,M]=u.useState(!1),[X,Re]=u.useState(!1);if(c==null)throw Error("Can't access reports page without signing in...");const B=_((l=>J(l))),Ie=B.masterTOSInfo?.isMasterTOSAccepted??!1,Se=B.company?.companyInfo.firstMonthOfFY??1,Te=za(B?.companyId),w=_((l=>S(l).fetchState)),je=_((l=>Ge(l))),{areTenantIdsInSync:y}=Oa(),L=_((l=>l.financeStatementState.selectedReportId)),T=_((l=>ue(l))),g=_((l=>he(l))),ke=_((l=>S(l).isCompareModeOn)),C=_((l=>S(l).filter)),v=_((l=>S(l).selectedReportAndTimeframeFetchState)),De=_((l=>l.profitAndLossClassesViewState.uiState.classViewLayout));u.useEffect((()=>{!p&&y&&(M(!0),s(Y(c.userId,!0,!0,!1)))}),[p,c,s,y]),u.useEffect((()=>{p&&!X&&w==="Completed"&&y&&(s(Y(c.userId,!1,!0,!1)),Re(!0))}),[p,X,w,y]),u.useEffect((()=>{if(p&&v.fetchState==="Not-Started"&&C.timeframe!=="free_range"&&C.timeframe!=="week"&&y)switch(L){case"profit_and_loss":case"profit_and_loss_by_classes":s(ye(C.timeframe));break;case"profit_and_loss_by_projects":g&&s(U());break;case"balance_sheet":s(E(C.timeframe));break;case"balance_sheet_by_classes":T&&s(A());break;case"balance_sheet_by_projects":g&&s(P());break;case"cash_flow_by_classes":T&&s(V());break;case"cash_flow_by_projects":g&&s(F());break;case"cash_flow":s(O(C.timeframe))}}),[p,L,v,y,T,g]);const ee=Fa(),Oe=ee?.loggedInUserRole!=null&&He(ee?.loggedInUserRole)!==!0,[Fe,Ve]=u.useState(!1),ae=l=>{Ve(l)},Pe=Va(),Ae=Pa();return(function(l){const{isDataReady:Ee}=l,{pathname:Me}=te(),se=Sa(Me??"")==="reports",Be=Ta(Ee),Le=u.useMemo((()=>se?Wa:void 0),[se]);ja({canFetchSuggestedQuestions:Be,pageContexts:Le})})({isDataReady:w==="Completed"}),Aa({isDataReady:w==="Completed"}),f.jsxs(f.Fragment,{children:[w==="Completed"?f.jsx(Ea,{analytics:Q,onLoad:l=>l.trackPageLoaded(Ma.Event.reports)}):null,f.jsx(Ha,{isAppContentDrawerOpen:Fe,handleDrawerToggle:ae}),f.jsx($a,{firstMonthOfFY:Se,tenantEmailDomain:n,location:t,navigate:a,windowSize:b,classViewLayout:De,selectedReportID:L,analytics:Q,filter:C,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:g,isCompareModeOn:ke,hasTransactionAccess:Oe,signedInUser:c,selectedReportAndTimeframeFetchState:v,handleDrawerToggle:ae,reportsResyncFetchState:je.reportsResyncFetchState,isAiCfoAccessEnabled:Ae&&Pe&&!e,onAskAiCfoClick:()=>{if(Ie)if(m){const l=ge(t.state?.pathnameStackToGoBack,t.pathname);a(`/${n}/ai-cfo/explore`,{state:{pathnameStackToGoBack:l,referrer:"Reports"}})}else o(!0);else Ba({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:i,isCustomDateRangeEnabled:d,initialOpenThreadRequest:Te})]})}const D=e=>{switch(e){case"profit_and_loss":case"profit_and_loss_by_classes":case"profit_and_loss_by_projects":return"Profit & Loss";case"balance_sheet":case"balance_sheet_by_classes":case"balance_sheet_by_projects":return"Balance Sheet";case"cash_flow":case"cash_flow_by_classes":case"cash_flow_by_projects":return"Cash Flow";default:return"Reports"}};function ys(){const e=_((s=>J(s))),{useFeatureGate:o}=Ce(),{isFeatureEnabled:b}=o(K.isDebitCardFeatureEnabled),m=Ra(b,e),a=Ia(e);return m===!0||a===!0?f.jsx(xa,{}):f.jsxs(ze,{children:[f.jsx(oe,{path:"/",element:f.jsx(qa,{})}),f.jsx(oe,{path:"*",element:f.jsx(Ua,{})})]})}export{ys as default};
@@ -1 +0,0 @@
1
- import{j as a}from"./liveblocks-V5YQZeeY.js";import{z as b,a7 as v,m as p,S as N,e6 as k,p as C,c as I}from"./index-9pdMsp-M.js";import"./mui-BmHHlwSU.js";import g from"./NotFoundScreen-C94S-cmy.js";import{a as c}from"./sentry-bpmZUW7k.js";import{u as D,j as h,h as F,g as L,l as _,n as T,o as f,N as y}from"./core-BWRpGVdr.js";import{fE as U,a2_ as j,a2$ as d,Ei as P,q3 as V,a30 as q,Eg as z}from"./zeni-epic-state-BlWDBO75.js";import"./recharts-BXLxGQ-T.js";import"./analytics-BfKlFVdJ.js";import"./plaid-CNV6JDhi.js";import"./dnd-wLfPcqQ_.js";import"./stripe-cKAAJElX.js";import"./lottie-ByqRhfis.js";import"./lexical-ljfsYSTd.js";import"./pdf-C42gprG9.js";import"./utils-CXFQdt3d.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f1ef5168-04b8-4cea-9102-187bac372833",e._sentryDebugIdIdentifier="sentry-dbid-f1ef5168-04b8-4cea-9102-187bac372833")}catch{}})();const G=_((function(e,t){const n=j(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}}),(function(e,t){const{navigate:n}=t,i=b.getSignedInUser();return{onDismissClick:()=>{e(d()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((m=>{s.push(m.companyName),r.push(m.emailIds[0])})),p.trackInviteEmailClicked("send",s,r,s.length)}e(z())},onUpdateInviteFormLocalData:s=>{e(q({localData:s}))},onSubmitSuccess:()=>{e(d())},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}}))(k),R=()=>{const e=D(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>U(o))),m=F(),w=L(),u=b.getSignedInUser();if(u==null)throw Error("Can't access invite referral screen without signing in...");const l=h((o=>j(o))),x=u?.firstName!=null?u.firstName:"User";c.useEffect((()=>{e(d()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),c.useEffect((()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[l.fetchState,e]);const E=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(v,{analytics:p,onLoad:o=>(S=>S.trackPageLoaded(N.Event.inviteEmailViewed))(o)}):null,a.jsx(G,{navigate:m,location:w,currentTenant:r,companyName:E,userName:x,inviteFormCompayData:l.localData})]})};function ne(){const{useFeatureGate:e}=C(),{isFeatureEnabled:t}=e(I.isReferralFeatureEnabled);return a.jsxs(T,{children:[a.jsx(f,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(R,{}):a.jsx(g,{})}),a.jsx(f,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-C94S-cmy.js","assets/sentry-bpmZUW7k.js","assets/core-BWRpGVdr.js","assets/zeni-epic-state-BlWDBO75.js","assets/index-9pdMsp-M.js","assets/mui-BmHHlwSU.js","assets/analytics-BfKlFVdJ.js","assets/utils-CXFQdt3d.js","assets/index-BQ3cXEYt.css","assets/DashboardRoutes-DYfRGtw5.js","assets/withTransactionSidePanel-DOV8YzFf.js","assets/useAskAiCfoHostNavButtonProps-E2UGdnp9.js","assets/TransactionDetailScreen-CNMo1Iyr.js","assets/decodeURIComponentSafe-DN9u1X8y.js","assets/useInitialThreadRequest-Df-inltN.js","assets/routePaths--TXDBUUo.js","assets/expenseAutomationHelper-Dr99xbt1.js","assets/stripSplatSuffix-Bizh1-Tx.js","assets/reportTimeframe-tJTkNTvP.js","assets/analyticsHelper-Cn2rORl_.js","assets/CompanyPassportScreen-dRN2jnGn.js","assets/MobileAppDrawer-rCVKr3J3.js","assets/InboxNotificationsProvider-Cd4NxEtR.js","assets/useTaskManagerAccess-Bq9TDvwr.js","assets/useAiCfoDashboardSuggestedQuestionsChips-3ayut61P.js","assets/FeaturePreviewScreen-B9UACzAC.js","assets/BillPayRoutes-CQCAwPWX.js","assets/AddressScreen-CiPLLpNX.js","assets/DomesticWireDetailScreen-YfGiQgSo.js","assets/BusinessVerificationPageScreen-71JxUYXB.js","assets/DrawerScreen-DH40ycW6.js","assets/SetupPagesScreen-DPnnq4jj.js","assets/BillPayApprovalRoutes-Bhwrq5tr.js","assets/useEnsureVendorListLoaded-CKZrwkQQ.js","assets/ReimbursementApprovalRuleDetailScreen-BzhkgPjS.js","assets/getLocaleForTenant-BNAJG7gN.js","assets/ReimbursementRoutes-BcjYsUHB.js","assets/ReimbursementApprovalRoutes-CsG7QtOs.js","assets/TransactionListRoutes-aYhnWH8H.js","assets/ZeniAccountStatementScreen-DKVtRt3N.js","assets/SettingsRoutes-CwW3Kcyz.js","assets/AccountMappingScreen-CtnQtVOI.js","assets/QBOConnectionScreen-C1Kn9y8q.js","assets/url-Cc_9bwX-.js","assets/empty-BxjviaN4.js","assets/index-DYK9WSJX.js","assets/index-BXpurrfG.js","assets/accountMappingHelper-7kGWRPlV.js","assets/useEmailConnectResultRefresh-F8OBO8EU.js","assets/ReportsRoutes-Bcm2EvxJ.js","assets/ChargeCardRoutes-CvC_JvPH.js","assets/useChargeCardPusherEvents-DVeqwUB9.js","assets/PeopleRoutes-CnmV1pW5.js","assets/ExpenseAutomationRoutes-Bks-mNnn.js","assets/useActualMatchingMatchDetail-Mft821vz.js","assets/ScheduleDetailsPrepaidExpensesScreen-v3zw3e0R.js","assets/pathToGoBack-Dr_s0YFt.js","assets/TreasuryRoutes-DnAsQTrn.js","assets/VendorsRoutes-QudM99vQ.js","assets/ZeniAccountRoutes-DeSodvmm.js","assets/AddressRoutes-CXRpuLt0.js","assets/PandLWithForecastRoutes-OnVWoGgX.js","assets/CustomerOnboardingRoutes-BMrjyYZ8.js","assets/TransactionDetailRoutes-DWXM95sG.js","assets/EntityDetailRoutes-BgqO6DqU.js","assets/InvoicingRoutes-UHPes0q9.js","assets/NotificationRoutes-h53g4kBO.js","assets/PerformanceRoutes-MYTxvcMA.js","assets/ActualMatchingMatchDetailScreen-COb45lJn.js","assets/RewardsRoutes-Do7moyFI.js","assets/TaskRoutes-CWWa57kf.js","assets/TaskListScreen-aizYXFWj.js","assets/useTaskManagerPusherEvents-Ctn5L7kn.js","assets/AiCfoScreen-DPuJRDN-.js","assets/CardsAiCfoScreen-Dze-_SQs.js"])))=>i.map(i=>d[i]);
2
- import{_ as s,bj as hs,fE as Es,dZ as ps,dY as xs,Bo as js,dg as gs,c6 as Rs,gI as Is,g8 as As,dd as xe,cE as Ts,gm as bs,cw as fs,bC as Ds,bn as ys,UX as Cs,v as vs,U_ as ws,bm as Os,U$ as Ps,bI as Us,bH as ks,bq as Fs,cs as Ls,V0 as Vs,V1 as Hs,d8 as Ss,db as Bs,da as Ns,cD as Zs,cK as Ms,pW as je,gh as ge,gY as $s,gj as Re,gK as Ie,gL as Ae,gk as zs}from"./zeni-epic-state-BlWDBO75.js";import{j as e}from"./liveblocks-V5YQZeeY.js";import{a as U}from"./sentry-bpmZUW7k.js";import{N as d,u as Gs,h as Ys,i as qs,g as Ws,j as z,q as Te,n as Ks,o as a}from"./core-BWRpGVdr.js";import{N as l,u as Xs,z as C,p as Qs,e as Js,f as en,c as Z,j as sn,O as nn,V as tn,L as F,G as be,t as _,P as an,m as ae,Q as on,Z as rn}from"./index-9pdMsp-M.js";import{u as ln}from"./mui-BmHHlwSU.js";import{f as fe}from"./analyticsHelper-Cn2rORl_.js";import{t as dn}from"./getLocaleForTenant-BNAJG7gN.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},p=new t.Error().stack;p&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[p]="4cc4e28b-24b5-4a57-b82a-b3fae305843e",t._sentryDebugIdIdentifier="sentry-dbid-4cc4e28b-24b5-4a57-b82a-b3fae305843e")}catch{}})();const cn=l((()=>s((()=>import("./NotFoundScreen-C94S-cmy.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),un=({tenantEmailDomain:t})=>e.jsx(d,{to:`/${t}/reimbursements`}),mn=({tenantEmailDomain:t})=>e.jsx(d,{to:`/${t}/bills`}),De=({tenantEmailDomain:t})=>e.jsx(d,{to:`/${t}/treasury`}),ye=({tenantEmailDomain:t})=>e.jsx(d,{to:`/${t}/checking`}),Ce=({tenantEmailDomain:t})=>e.jsx(d,{to:`/${t}/cards`}),v=({showZeniAccountRoute:t,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:L,showTreasuryRoute:i,isTenantBankingOnly:H,showChargeCardRoute:O,tenantEmailDomain:w})=>{if(H===!0){if(t)return e.jsx(ye,{tenantEmailDomain:w});if(i)return e.jsx(De,{tenantEmailDomain:w});if(O)return e.jsx(Ce,{tenantEmailDomain:w})}return t?e.jsx(ye,{tenantEmailDomain:w}):i?e.jsx(De,{tenantEmailDomain:w}):O?e.jsx(Ce,{tenantEmailDomain:w}):p?e.jsx(mn,{tenantEmailDomain:w}):L?e.jsx(un,{tenantEmailDomain:w}):e.jsx(cn,{})},_n={dashboard:()=>s((()=>import("./DashboardRoutes-DYfRGtw5.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,25,8])),bills:()=>s((()=>import("./BillPayRoutes-CQCAwPWX.js")),__vite__mapDeps([26,1,2,3,4,5,6,7,27,0,28,11,14,29,15,21,22,23,30,25,31,19,32,33,34,35,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-BcjYsUHB.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,25,11,14,30,37,33,34,35,8])),transactions:()=>s((()=>import("./TransactionListRoutes-aYhnWH8H.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,39,8])),settings:()=>s((()=>import("./SettingsRoutes-CwW3Kcyz.js")),__vite__mapDeps([40,1,2,3,4,5,6,7,23,41,21,22,42,43,44,45,46,13,47,27,0,19,29,15,20,48,32,33,34,37,8])),reports:()=>s((()=>import("./ReportsRoutes-Bcm2EvxJ.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,0,25,14,15,18,21,22,23,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-CvC_JvPH.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,11,21,22,23,31,29,15,0,19,14,51,27,8])),people:()=>s((()=>import("./PeopleRoutes-CnmV1pW5.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,0,11,21,22,23,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-Bks-mNnn.js")),__vite__mapDeps([53,1,2,3,0,4,5,6,7,11,12,13,14,15,16,54,17,10,55,56,47,30,8])),treasury:()=>s((()=>import("./TreasuryRoutes-DnAsQTrn.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,11,14,25,8])),vendors:()=>s((()=>import("./VendorsRoutes-QudM99vQ.js")),__vite__mapDeps([58,1,2,3,4,5,6,7,27,0,25,55,56,54,17,13,15,11,21,22,23,30,47,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-DeSodvmm.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,25,28,27,11,39,8]))},hn=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],oe=t=>{"requestIdleCallback"in window?requestIdleCallback(t):setTimeout(t,100)},En=l((()=>s((()=>import("./ReportsRoutes-Bcm2EvxJ.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,0,25,14,15,18,21,22,23,8])))),pn=l((()=>s((()=>import("./AddressRoutes-CXRpuLt0.js")),__vite__mapDeps([60,1,2,3,27,4,5,6,7,0,8])))),xn=l((()=>s((()=>import("./PeopleRoutes-CnmV1pW5.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,0,11,21,22,23,8])))),jn=l((()=>s((()=>import("./PandLWithForecastRoutes-OnVWoGgX.js")),__vite__mapDeps([61,1,2,3,4,5,6,7,0,25,11,14,15,21,22,23,8])))),gn=l((()=>s((()=>import("./CustomerOnboardingRoutes-BMrjyYZ8.js")),__vite__mapDeps([62,1,2,3,27,4,5,6,7,0,42,43,44,45,46,13,48,51,8])))),Rn=l((()=>s((()=>import("./VendorsRoutes-QudM99vQ.js")),__vite__mapDeps([58,1,2,3,4,5,6,7,27,0,25,55,56,54,17,13,15,11,21,22,23,30,47,8])))),In=l((()=>s((()=>import("./TransactionDetailRoutes-DWXM95sG.js")),__vite__mapDeps([63,1,2,3,0,4,5,6,7,13,33,12,11,14,15,16,8])))),ve=l((()=>s((()=>import("./EntityDetailRoutes-BgqO6DqU.js")),__vite__mapDeps([64,1,2,3,4,5,6,7,13,10,11,12,14,15,16,17,8])))),An=l((()=>s((()=>import("./DashboardRoutes-DYfRGtw5.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,25,8])))),we=l((()=>s((()=>import("./BillPayRoutes-CQCAwPWX.js")),__vite__mapDeps([26,1,2,3,4,5,6,7,27,0,28,11,14,29,15,21,22,23,30,25,31,19,32,33,34,35,8])))),Tn=l((()=>s((()=>import("./SettingsRoutes-CwW3Kcyz.js")),__vite__mapDeps([40,1,2,3,4,5,6,7,23,41,21,22,42,43,44,45,46,13,47,27,0,19,29,15,20,48,32,33,34,37,8])))),bn=l((()=>s((()=>import("./InvoicingRoutes-UHPes0q9.js")),__vite__mapDeps([65,1,2,3,4,5,6,7,27,0,21,22,23,42,43,44,45,46,13,8])))),Oe=l((()=>s((()=>import("./ReimbursementRoutes-BcjYsUHB.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,25,11,14,30,37,33,34,35,8])))),fn=l((()=>s((()=>import("./ZeniAccountRoutes-DeSodvmm.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,25,28,27,11,39,8])))),Dn=l((()=>s((()=>import("./TreasuryRoutes-DnAsQTrn.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,11,14,25,8])))),yn=l((()=>s((()=>import("./TransactionListRoutes-aYhnWH8H.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,39,8])))),Cn=l((()=>s((()=>import("./ChargeCardRoutes-CvC_JvPH.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,11,21,22,23,31,29,15,0,19,14,51,27,8])))),vn=l((()=>s((()=>import("./NotificationRoutes-h53g4kBO.js")),__vite__mapDeps([66,1,2,3,0,4,5,6,7,11,23,8])))),wn=l((()=>s((()=>import("./PerformanceRoutes-MYTxvcMA.js")),__vite__mapDeps([67,1,2,3,0,4,5,6,7,11,21,22,23,8])))),On=l((()=>s((()=>import("./ExpenseAutomationRoutes-Bks-mNnn.js")),__vite__mapDeps([53,1,2,3,0,4,5,6,7,11,12,13,14,15,16,54,17,10,55,56,47,30,8])))),Pn=l((()=>s((()=>import("./ActualMatchingMatchDetailScreen-COb45lJn.js")),__vite__mapDeps([68,1,2,3,4,5,6,7,54,17,13,15,0,8])))),Un=l((()=>s((()=>import("./RewardsRoutes-Do7moyFI.js")),__vite__mapDeps([69,1,2,3,4,5,6,7,0,8])))),kn=l((()=>s((()=>import("./TaskRoutes-CWWa57kf.js")),__vite__mapDeps([70,1,2,3,0,4,5,6,7,14,21,22,23,71,11,72,8])))),Fn=l((()=>s((()=>import("./AiCfoScreen-DPuJRDN-.js")),__vite__mapDeps([73,1,2,3,4,5,6,7,24,56,15,72,8])))),Pe=l((()=>s((()=>import("./CardsAiCfoScreen-Dze-_SQs.js")),__vite__mapDeps([74,1,2,3,4,5,6,7,8])))),D=l((()=>s((()=>import("./NotFoundScreen-C94S-cmy.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),Ln=l((()=>s((()=>import("./TaskListScreen-aizYXFWj.js").then((t=>t.f))),__vite__mapDeps([71,1,2,3,4,5,6,7,11,21,22,23,72,8])))),Vn=({isDashboardAccess:t,showZeniAccountRoute:p,isUserHasBillPayAccess:L,isUserHasReimbursementAccess:i,showTreasuryRoute:H,isTenantBankingOnly:O,isTenantCardsOnly:w,showChargeCardRoute:S})=>{if(O===!0){if(p)return e.jsx(d,{to:"checking"});if(H)return e.jsx(d,{to:"treasury"});if(S)return e.jsx(d,{to:"cards"})}return w===!0&&S?e.jsx(d,{to:"cards"}):t?e.jsx(d,{to:"dashboard"}):p?e.jsx(d,{to:"checking"}):H?e.jsx(d,{to:"treasury"}):S?e.jsx(d,{to:"cards"}):L?e.jsx(d,{to:"bills"}):i?e.jsx(d,{to:"reimbursements"}):e.jsx(d,{to:"dashboard"})},A=({children:t,fallback:p,isAllowed:L})=>{const i=on();return L?t:i?e.jsx(rn,{fetchState:"In-Progress"}):p},Ue=({tenantEmailDomain:t})=>e.jsx(d,{to:`/${t}/dashboard`}),Gn=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:t}){const p=Gs(),L=Ys(),{tenantEmailDomain:i}=qs(),H=ln().mode,{setLoading:O,clearAllLoading:w,clearLoading:S}=Xs(),y=C.getSignedInUserTenant(i)?.tenantId,T=C.getSignedInUser(),X=hs(T),G=Ws(),[V,ke]=U.useState(!1),r=z((o=>Es(o))),{useFeatureGate:B}=Qs(),M=Js(),Q=en(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:Ve}=B(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:ie}=B(Z.isDebitCardFeatureEnabled),b=z((o=>o.tenantState.fetchState)),x=z((o=>o.tenantState.activeTenantFetchState.fetchState)),h=x==="Completed"||b==="Completed"?ps(ie,r):void 0,J=x==="Completed"||b==="Completed"?xs(r):void 0,re=x==="Completed"||b==="Completed"?js(r)&&!gs(r):void 0,He=sn(r,Ve,ie),{isCardsHidden:Se}=nn(r?.tenantId),Be=!He||!!Se,{isFeatureEnabled:Ne}=B(Z.isSettingsFeatureEnabled),{isFeatureEnabled:ee}=B(Z.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ze}=B(Z.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=r?.userRole!=null&&Rs(r.userRole),Y=z((o=>Is(o)));if(i!=null){const o=C.getSignedInUserTenant(i);T!=null&&o!=null&&fe(T,r,H)}const $={tenantId:y,userId:T?.userId,sessionId:T?.zeniSessionId},le=As(),E=tn(),$e=r.company==null||E?.loggedInUserRoleMap!=null&&xe(E.loggedInUserRole),ze=Ts(E?.loggedInUserRoleMap),se=Te("/:tenantEmailDomain/onboarding/*")!==null,Ge=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),ne=Ge?.params.selectedPeriod,Ye=z((o=>$.tenantId!=null?bs(o,$.tenantId):void 0));U.useEffect((()=>{O(F.TENANT_FETCHING),t(i)}),[i]),U.useEffect((()=>{if(ne!=null&&y!=null){const o=ne.split("-");if(o.length===2){const f=fs(Number(o[0])),u=Number(o[1]),n=Ds(`01-${f<10?`0${f}`:f}-${u}`,be.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),c=ys();n.isAfter(c,"month")===!1?p(Cs(y,{month:f,year:u})):L(`/${i}/month_end_close_checks/review`)}}}),[ne,i,y]),U.useEffect((()=>{V||(ke(!0),O(F.TENANT_FETCHING))}),[V,$,le,T,p,C]),U.useLayoutEffect((()=>{!vs(le,$)&&C.isSignedIn()&&(O(F.TENANT_FETCHING),(function(o,f,u,n){if(ge(f?.userId,f?.zeniSessionId,o.tenantId),u($s(!0)),u(Re(o.tenantId)),o.tenantId!=null&&_.clearTenant(o.tenantId),o.tenantId!=null){const c=C.getSignedInUserTenantWithId(o.tenantId);n&&be.updateAppLocaleID(dn(n)),c?.tenantEmailDomain!=null&&C.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}o.userId!=null?ae.identify(o.userId,{tenant_id:o.tenantId}):ae.resetUserIdentity()})($,T,p,Ye))}),[y]),U.useEffect((()=>{C.isSignedIn()&&(O(F.TENANT_FETCHING),(function(o,f,u,n,c,q,N){if(u==null&&n==null)return void console.warn("There is no current tenant selected!!");const W=n!=null&&c?.zeniSessionId!=null,us=u==null||u.tenantId!==n,ms=u!=null&&u.excludedResources==null,_s=u!=null&&u.externalConnections==null;if(W&&us){N(Re(n));const K=C.getSignedInUserTenantWithId(n);K?.tenantEmailDomain!=null&&C.saveActiveTenantDomainForUser(K?.tenantEmailDomain),ge(c?.userId,c?.zeniSessionId,n),_.shouldFetchExcludedResources(n)&&(_.markExcludedResourcesFetchStarted(n),N(Ie(c.userId,n))),_.shouldFetchConnections(n)&&(_.markConnectionsFetchStarted(n),N(Ae(c.userId,n)))}else W&&ms&&_.shouldFetchExcludedResources(n)&&(_.markExcludedResourcesFetchStarted(n),N(Ie(c.userId,n))),W&&_s&&_.shouldFetchConnections(n)&&(_.markConnectionsFetchStarted(n),N(Ae(c.userId,n)));if(W){ae.identify(c.userId,{tenant_id:n});const K=n==null||n!=null&&(f==="Completed"||f==="Error");o==="Completed"||f!=="Not-Started"&&f!=="Error"||n==null||!_.shouldFetchActiveTenant(n)||(_.markActiveTenantFetchStarted(n),q(F.TENANT_FETCHING),N(zs(c.userId,n,c.zeniSessionId))),K&&(o==="Not-Started"||o==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),N(je(c.userId,c.zeniSessionId)))}})(b,x,r,y,T,O,p))}),[y,x]),U.useEffect((()=>{C.isSignedIn()&&b==="Completed"&&Y.tenantsBaseInOrder.length>0&&(S(F.TENANT_FETCHING),C.saveSignedInUserTenants(ws(Y.tenantsBaseInOrder)),T!=null&&fe(T,r,H,void 0,Y.tenantsBaseInOrder))}),[Y,b,r,T]),U.useEffect((()=>{x==="In-Progress"&&O(F.TENANT_FETCHING),x!=="Completed"&&x!=="Error"||(x==="Completed"&&y!=null?(w(),_.markActiveTenantFetchCompleted(y)):x==="Error"&&y!=null&&(_.markActiveTenantFetchFailed(y),S(F.TENANT_FETCHING),S(F.TENANT_SWITCHING))),b!=="Completed"&&b!=="Error"||(b==="Completed"?_.markAllTenantsFetchCompleted():b==="Error"&&_.markAllTenantsFetchFailed())}),[x,b,y,V]);const de=U.useRef(!1);U.useEffect((()=>{!de.current&&x==="Completed"&&V&&(de.current=!0,(function(o=hn,f=3e3){setTimeout((()=>{const u=n=>{if(n>=o.length)return;const c=o[n],q=_n[c];q!=null?q().then((()=>oe((()=>u(n+1))))).catch((()=>oe((()=>u(n+1))))):u(n+1)};oe((()=>u(0)))}),f)})())}),[x,V]);const P=r?.userRole!=null&&Os(r?.userRole),{isFeatureEnabled:qe}=B(Z.isReferralFeatureEnabled),{isFeatureEnabled:We}=B(Z.isAccrualEnabled),Ke=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Xe=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),k=r?.userRole!=null&&xe(r.userRole),ce=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!P,ue=!Be&&!P,Qe=Ps(E?.loggedInUserRoleMap),Je=r.externalConnections?.accounting[0]?.isValid,es=r.externalConnections?.fetchState==="Completed",te=r.company?.companyOnboardingInfo.isOnboardingCompleted,me=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!P,_e=me&&Us(E?.loggedInUserRoleMap),he=Fe&&!P,ss=Le&&!P,ns=ce&&ks(E?.loggedInUserRoleMap),ts=ue&&Fs(E?.loggedInUserRoleMap),as=he&&Ls(E?.loggedInUserRoleMap),os=Vs(E?.loggedInUserRoleMap),is=Hs(E?.loggedInUserRoleMap),rs=Ss(E?.loggedInUserRoleMap),ls=Bs(E?.loggedInUserRoleMap),ds=Ns(E?.loggedInUserRoleMap),j=Zs(E?.loggedInUserRoleMap),g=Ms(E?.loggedInUserRoleMap),Ee=ce&&j,pe=me&&g,R=he&&rs,I=ss&&ls,m=ue&&ds,cs=r.excludedResources?.resources?.find((o=>o.resource==="/invites"))!=null||ze===!0||Qe===!0||os===!0||is===!0;return C.isSignedIn()?y==null?b==="Completed"?e.jsx(d,{to:"/",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}):(T!=null&&b!=="In-Progress"&&p(je(T.userId,T.zeniSessionId)),null):x!=="In-Progress"&&x!=="Not-Started"||b==="Completed"?(te===!0||X&&!se)&&es&&Je!==!0&&h===!1&&J===!1&&re===!1?(t(void 0),e.jsx(d,{to:"/connection/auth",replace:!0})):!V||re!==!0||te!==!0||se||X?!V||te!==!1||se||X?V&&r?.userRole&&h!=null&&J!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Ks,{children:e.jsxs(a,{element:e.jsx(an,{}),children:[e.jsx(a,{path:"/",element:e.jsx(Vn,{isDashboardAccess:k,showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,isTenantCardsOnly:J,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:k?e.jsx(An,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reports/*",element:k?e.jsx(En,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"people/*",element:cs||k?e.jsx(xn,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"forecast/*",element:k?e.jsx(jn,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(gn,{})}),e.jsx(a,{path:"transaction/*",element:k&&P===!1||Ke||Xe?e.jsx(In,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"transactions/*",element:k&&P===!1?e.jsx(yn,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"customer/*",element:k&&P===!1?e.jsx(ve,{entityType:"customer"}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,isTenantBankingOnly:h,showTreasuryRoute:I,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"vendor/*",element:k&&P===!1?e.jsx(ve,{entityType:"vendor"}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"tasks",element:e.jsx(Ln,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(kn,{})}),e.jsx(a,{path:"address/*",element:ns||_e||as||ts?e.jsx(pn,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"checking/*",element:e.jsx(A,{isAllowed:R,fallback:e.jsx(D,{}),children:e.jsx(fn,{})})}),e.jsx(a,{path:"treasury/*",element:e.jsx(A,{isAllowed:I,fallback:e.jsx(D,{}),children:e.jsx(Dn,{})})}),e.jsx(a,{path:"performance",element:e.jsx(A,{isAllowed:Q,fallback:e.jsx(Ue,{tenantEmailDomain:i}),children:e.jsx(wn,{})})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:e.jsx(A,{isAllowed:Q&&!P,fallback:e.jsx(Ue,{tenantEmailDomain:i}),children:e.jsx(On,{})})}),e.jsx(a,{path:"expense-automation/actual-matching/:matchId",element:e.jsx(A,{isAllowed:Q&&!P&&We,fallback:e.jsx(D,{}),children:e.jsx(Pn,{})})}),e.jsx(a,{path:"notifications/*",element:e.jsx(vn,{})}),e.jsx(a,{path:"vendors/*",element:e.jsx(A,{isAllowed:$e,fallback:e.jsx(D,{}),children:e.jsx(Rn,{})})}),e.jsx(a,{path:"bill/*",element:Ee?e.jsx(we,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"bills/*",element:Ee?e.jsx(we,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursement/*",element:pe?e.jsx(Oe,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursements/*",element:pe?e.jsx(Oe,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:g,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"settings/*",element:e.jsx(A,{isAllowed:Ne,fallback:e.jsx(D,{}),children:e.jsx(Tn,{hasAdminLevelAccess:_e})})}),e.jsx(a,{path:"invoicing/*",element:e.jsx(A,{isAllowed:Ze&&Me,fallback:e.jsx(D,{}),children:e.jsx(bn,{})})}),e.jsx(a,{path:"cards/ask",element:e.jsx(A,{isAllowed:m&&M,fallback:e.jsx(D,{}),children:e.jsx(Pe,{isFileUploadEnabled:ee})})}),e.jsx(a,{path:"cards/ask/:session_id",element:e.jsx(A,{isAllowed:m&&M,fallback:e.jsx(D,{}),children:e.jsx(Pe,{isFileUploadEnabled:ee})})}),e.jsx(a,{path:"cards/*",element:e.jsx(A,{isAllowed:m,fallback:e.jsx(D,{}),children:e.jsx(Cn,{})})}),e.jsx(a,{path:"rewards/*",element:e.jsx(A,{isAllowed:qe,fallback:e.jsx(D,{}),children:e.jsx(Un,{})})}),e.jsx(a,{path:"/ai-cfo",element:e.jsx(A,{isAllowed:M,fallback:e.jsx(D,{}),children:e.jsx(d,{to:"explore"})})}),e.jsx(a,{path:"/ai-cfo/",element:e.jsx(A,{isAllowed:M,fallback:e.jsx(D,{}),children:e.jsx(d,{to:"explore"})})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:e.jsx(A,{isAllowed:M,fallback:e.jsx(D,{}),children:e.jsx(Fn,{isFileUploadEnabled:ee})})}),e.jsx(a,{path:"*",element:e.jsx(D,{})})]})}):null:(t(void 0),e.jsx(d,{to:`/${i}/onboarding`,replace:!0})):(t(void 0),e.jsx(d,{to:`/${i}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),t(void 0),e.jsx(d,{to:"/signin/auth",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{v as F,Gn as S};
@@ -1 +0,0 @@
1
- import{j as u}from"./liveblocks-V5YQZeeY.js";import{a as f,R as T,t as A}from"./sentry-bpmZUW7k.js";import{u as z,h as D,j as l,g as j,N as M,l as P}from"./core-BWRpGVdr.js";import{u as O,z as s,m as w,G as V,R as _,S as F,T as B,U as N,W as G,X as v}from"./index-9pdMsp-M.js";import{fE as R,UG as W,U_ as $,gh as J,gj as X,V3 as H,gU as Z,dh as q,V4 as U,V5 as K,V6 as Q,bZ as y}from"./zeni-epic-state-BlWDBO75.js";import{u as Y}from"./mui-BmHHlwSU.js";import{u as ee}from"./useDeviceId-3o80RPjJ.js";import{f as te}from"./analyticsHelper-Cn2rORl_.js";import{t as ne}from"./getLocaleForTenant-BNAJG7gN.js";import"./recharts-BXLxGQ-T.js";import"./analytics-BfKlFVdJ.js";import"./plaid-CNV6JDhi.js";import"./dnd-wLfPcqQ_.js";import"./stripe-cKAAJElX.js";import"./lottie-ByqRhfis.js";import"./lexical-ljfsYSTd.js";import"./pdf-C42gprG9.js";import"./utils-CXFQdt3d.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="1906876a-4e3f-4471-9301-e86844e2b813",t._sentryDebugIdIdentifier="sentry-dbid-1906876a-4e3f-4471-9301-e86844e2b813")}catch{}})();const ie=P((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Q({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(c),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(K(n,a)))},clearSignInError:()=>{t(U())}}}))(G),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=O(),n=s.getSignedInUser();f.useLayoutEffect((()=>{g()}),[g]);const a=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:h,accountLocked:b,accountUnlockTime:k}=l((e=>e.tenantState)),p=l((e=>e.tenantState.fetchState)),L=l((e=>e.tenantState.activeTenantFetchState.fetchState)),S=l((e=>e.tenantState.signInState)),o=l((e=>e.tenantState.loggedInUser)),r=l((e=>R(e))),I=l((e=>W(e))),m=j(),E=Y().mode,C=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(f.useEffect((()=>{h.fetchState==="Completed"&&c!=null&&(w.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[h.fetchState,c]),f.useEffect((()=>{t(void 0)}),[]),f.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants($(I.tenantsInOrder),o.zeniSessionId),J(o.userId,o.zeniSessionId,r.tenantId),i(X(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(H("Completed")),V.updateAppLocaleID(ne(r)),te(o,r,E,void 0,I.tenantsInOrder),Z().then((()=>{const e=N();e!=null&&_(e)})),setTimeout((()=>{w.trackLogin(F.Event.loginSuccess,o.authProvider??"google",q(r.productSettings))}),2e3))}),[S,p,L,o,r,I,E,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return u.jsx(M,{to:e,state:{...m.state,origin:""}})}return u.jsxs(u.Fragment,{children:[u.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),b===!0&&k!=null?u.jsx(B,{onClose:()=>i(U()),unlockDate:k}):null]})}export{ve as default};
@@ -1,9 +0,0 @@
1
- import{j as s}from"./liveblocks-V5YQZeeY.js";import{a as i}from"./sentry-bpmZUW7k.js";import{u as l,g as c,N as u}from"./core-BWRpGVdr.js";import{z as n,m as a,S as m,a6 as p}from"./index-9pdMsp-M.js";import{gX as g,Vk as b}from"./zeni-epic-state-BlWDBO75.js";import{n as y}from"./mui-BmHHlwSU.js";import"./recharts-BXLxGQ-T.js";import"./analytics-BfKlFVdJ.js";import"./plaid-CNV6JDhi.js";import"./dnd-wLfPcqQ_.js";import"./stripe-cKAAJElX.js";import"./lottie-ByqRhfis.js";import"./lexical-ljfsYSTd.js";import"./pdf-C42gprG9.js";import"./utils-CXFQdt3d.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="0258d0f1-ab3e-4303-b6df-121415b353db",e._sentryDebugIdIdentifier="sentry-dbid-0258d0f1-ab3e-4303-b6df-121415b353db")}catch{}})();function P(){const e=l(),t=c(),r=i.useRef(!1),d=n.isSignedIn(),o=t.state?.message==="logout"||d;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(g()),b(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(f){console.error("Error during sign out:",f)}finally{window.location.replace("/signin/auth")}}}),[o,e]),o?s.jsx(h,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=y.div`
2
- display: flex;
3
- height: 100vh;
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
- `;export{P as default};
@@ -1,9 +0,0 @@
1
- import{j as A}from"./liveblocks-V5YQZeeY.js";import{a as u}from"./sentry-bpmZUW7k.js";import{u as H,k as J,j as C,h as me,g as Se,i as ye,l as De}from"./core-BWRpGVdr.js";import{z as M,p as Ee,c as I,ar as be,a7 as he,m as Ce,S as Ge,e9 as Ae,n as F,a3 as Ie}from"./index-9pdMsp-M.js";import{QI as Re,Rt as ve,fE as Be,a37 as ne,gM as Q,a38 as re,a32 as Le,QZ as X,a39 as Ke,R9 as Y,QK as we,Qm as Ue,RF as ee,a3a as ae,gg as Pe,Rw as Fe,RB as je,Ro as xe,Rm as te,RC as $e,Rj as Oe,a3b as Ne,a3c as Ze,a3d as ze,a3e as Me,a3f as R,dv as Qe,du as Ve,a3g as qe,QH as We}from"./zeni-epic-state-BlWDBO75.js";import{n as He}from"./mui-BmHHlwSU.js";import{u as Je}from"./useAskAiCfoHostNavButtonProps-E2UGdnp9.js";import{M as Xe}from"./MobileAppDrawer-rCVKr3J3.js";import{u as Ye}from"./useTaskManagerPusherEvents-Ctn5L7kn.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="74f137ff-6987-4ce1-971a-868a75a6350f",e._sentryDebugIdIdentifier="sentry-dbid-74f137ff-6987-4ce1-971a-868a75a6350f")}catch{}})();const _={TASK_CREATED:"task-created",TASK_UPDATED:"task-updated",TASK_SNOOZE_RESURFACED:"task-snooze-resurfaced",TASKS_BULK_UPDATED:"tasks-bulk-updated",TASKS_BULK_DELETED:"tasks-bulk-deleted"},ea=(e,t)=>e==null||e===""?[]:t.map((n=>`private-encrypted-${e}.${n}`)),aa=(e,t)=>e==null||e===""?[]:t.map((n=>`private-encrypted-${e}.${n}`)),j=e=>Array.isArray(e)&&e.every((t=>typeof t=="string")),oe=e=>typeof e.task_id=="string"?e.task_id:typeof e.id=="string"?e.id:null,ga=e=>{if(e==null||typeof e!="object")return null;const t=e,n=oe(t);if(n==null)return null;const c={task_id:n};return typeof t.parent_task_id=="string"&&(c.parent_task_id=t.parent_task_id),typeof t.sync_token=="string"&&(c.sync_token=t.sync_token),typeof t.is_deleted=="boolean"&&(c.is_deleted=t.is_deleted),typeof t.is_private=="boolean"&&(c.is_private=t.is_private),c},ta=e=>{if(e==null||typeof e!="object")return null;const t=e;return j(t.task_ids)?{task_ids:t.task_ids}:null},_a=e=>{if(e==null||typeof e!="object")return null;const t=e;return typeof t.task_id!="string"?null:{task_id:t.task_id}},sa=He.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
- `,na=De((function(e,t){const n=ne(e,t.isTaskTemplatesEnabled),{taskGroupId:c}=t,p=c!=null&&c!==""?{...n,taskGroupsWithTasksList:n.taskGroupsWithTasksList.map((a=>({...a,tasks:a.tasks.filter((s=>s.taskGroupIds.includes(c)))}))).filter((a=>a.tasks.length>0))}:n,y=Le(e),f=M.isZeniUser(),v=e.taskDetailState?.subTaskCreateStatus?.fetchState;return{taskListView:p,tagListView:y,localData:p.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:f,subTaskCreateStatus:v}}),(function(e,t){const{navigate:n,currentTenant:c,location:p,isTaskTemplatesEnabled:y}=t,{tenantEmailDomain:f}=c,{groupByKey:v}=t.uiState;return{onTaskManagementRowClick:a=>{const s=se(f,a),D=F(p.state?.pathnameStackToGoBack,p.pathname);n(s,{state:{pathnameStackToGoBack:D}})},onReloadTasks:()=>{e(Q(!0,y))},onTabChange:a=>{e(Me(a))},onParentTaskClick:a=>{const s=se(f,a);window.open(s,"_blank","noopener")},bulkUpdateTasks:(a,s)=>{e(te(a,null,s))},onNewTaskClick:()=>{if(t.localData.defaultTaskGroupId!=null){const a=z(f,t.localData.defaultTaskGroupId),s=F(p.state?.pathnameStackToGoBack,p.pathname);n(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{e(ae({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{e(ze({filters:a}))},onSearchTextChanged:a=>{e(Ze({searchText:a}))},onReloadCards:()=>{e(Q(!0,y))},onBackClick:()=>{if(p.state?.message==="triggerBackClick"){const a=Ie(p.state?.pathnameStackToGoBack),s=a.poppedPathname??"../";n(s,{state:{pathnameStackToGoBack:a.newStack}})}else n("../")},updateLocalData:a=>{e(Ne({localData:a}))},resetLocalData:()=>{e(re({taskGroupById:t.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{e(Oe(t.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{e(te(t.localData.selectedTaskIds,a,$e(t.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{e(xe(a))},onAddNewTaskToTaskGroup:a=>{if(t.localData.defaultTaskGroupId!=null){const s=oa(v,a);e(X({taskDetailLocalData:s}));const D=z(f,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),x=F(p.state?.pathnameStackToGoBack,p.pathname);n(D,{state:{pathnameStackToGoBack:x,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{e(je(t.localData.selectedTaskIds.length>0?t.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{e(Fe(a,s))},onTimeSpentUpdate:(a,s)=>{e(ee({task:a,updates:s}))},onShowToast:a=>{e(Pe(a))},onGroupByFilterChange:a=>{e(ae({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{e(ee({task:a,updates:s}))},onCreateTagClick:(a,s)=>{e(Ue(a,s))},onSubtaskCreation:(a,s)=>{e(we({...s,parentTaskId:a}))},handleGroupTemplateClick:a=>{e(Y(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{e(Y(a,[s]))},handleNewTaskInitialization:a=>{if(e(X({taskDetailLocalData:{...Ke,name:a}})),t.localData.defaultTaskGroupId!=null){const s=z(f,t.localData.defaultTaskGroupId),D=F(p.state?.pathnameStackToGoBack,p.pathname);n(s,{state:{pathnameStackToGoBack:D,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{n(`/${f}/tasks/group/${a}`)},onQuickResponsesClick:()=>{n(`/${f}/tasks/quick-responses`)}}}))(Ae);function ra(){const e=me(),t=H(),n=Se(),c=M.getSignedInUser(),p=M.isZeniUser(),y=J(),f=C((d=>Be(d))),{taskGroupId:v}=ye(),{useFeatureGate:a}=Ee(),{isFeatureEnabled:s}=a(I.isTaskTemplatesEnabled),{isFeatureEnabled:D}=a(I.isTaskCannedResponsesEnabled),{isFeatureEnabled:x}=a(I.isTaskCategorizationEnabled),{isFeatureEnabled:ie}=a(I.isTaskBulkResolutionEnabled),{isFeatureEnabled:le}=a(I.isTaskGroupAssigneesEnabled),{isFeatureEnabled:ue}=a(I.isTaskRecurringParentEnabled),[ce,de]=u.useState(!1),$=C((d=>ne(d,s))),O=C((d=>d.taskGroupState)),B=$.fetchState,{isAiCfoAccessEnabled:ke,onAskAiCfoClick:pe}=Je({mobileExploreReferrer:"Task Checklist"});be({isDataReady:B==="Completed"});const{markBoardFetchInFlight:V,requestTaskRefetch:N}=(function(d){const m=H(),r=J(),T=u.useRef(!1),o=u.useRef(!1),k=u.useRef(!1),g=u.useRef(),l=u.useRef(),S=u.useRef(!1),L=u.useRef(),K=u.useCallback((()=>{L.current=r.getState().taskListState.byTab.live,S.current=!0}),[r]),w=u.useCallback((()=>{K(),m(Re())}),[m,K]),E=u.useCallback((()=>{g.current=r.getState().taskGroupState.taskGroupById,k.current=!0,m(ve())}),[m,r]),b=u.useCallback((()=>{T.current=!1,l.current!=null&&(clearTimeout(l.current),l.current=void 0),w(),k.current||r.getState().taskGroupViewState.fetchState==="In-Progress"?o.current=!0:E()}),[w,E,r]),Z=u.useCallback((()=>{S.current?(T.current=!0,l.current==null&&(l.current=setTimeout((()=>{l.current=void 0,T.current&&r.getState().taskListState.fetchState!=="In-Progress"&&(S.current=!1,b())}),6e3))):b()}),[b,r]);u.useEffect((()=>{l.current!=null&&(clearTimeout(l.current),l.current=void 0),T.current=!1,o.current=!1,k.current=!1}),[d]);const h=C((i=>i.taskListState.fetchState)),G=C((i=>i.taskGroupViewState.fetchState)),U=C((i=>i.taskListState.byTab.live)),P=C((i=>i.taskGroupState.taskGroupById));return u.useEffect((()=>{h!=="In-Progress"&&(!S.current||U!==L.current||h==="Error")&&(S.current=!1,T.current&&(h!=="Completed"?h==="Error"&&(T.current=!1,l.current!=null&&(clearTimeout(l.current),l.current=void 0)):b()))}),[h,U,b]),u.useEffect((()=>{G!=="In-Progress"&&(!k.current||P!==g.current||G==="Error")&&(k.current=!1,o.current&&(o.current=!1,G!=="Error"&&E()))}),[G,P,E]),u.useEffect((()=>()=>{l.current!=null&&(clearTimeout(l.current),l.current=void 0)}),[]),{markBoardFetchInFlight:K,requestTaskRefetch:Z}})(f?.tenantId);u.useEffect((()=>{y.getState().taskListState.hasValidState()||V(),t(Q(!1,s))}),[f?.tenantId,t,s,V,y]);const fe=u.useMemo((()=>{const d=[_.TASK_CREATED,_.TASK_UPDATED,_.TASKS_BULK_UPDATED,_.TASKS_BULK_DELETED],m=[_.TASK_CREATED,_.TASK_UPDATED,_.TASK_SNOOZE_RESURFACED,_.TASKS_BULK_UPDATED];return[...ea(f?.companyId,d),...aa(c?.userId,m)]}),[f?.companyId,c?.userId]);if(Ye({events:fe,onEvent:(d,m)=>{switch(d){case _.TASK_CREATED:case _.TASK_UPDATED:{const r=(T=>{if(T==null||typeof T!="object")return null;const o=T,k=oe(o);if(k==null||typeof o.tenant_id!="string"||typeof o.event_type!="string")return null;const g={task_id:k,tenant_id:o.tenant_id,event_type:o.event_type};return typeof o.is_private=="boolean"&&(g.is_private=o.is_private),j(o.assignees)&&(g.assignees=o.assignees),j(o.direct_assignees)&&(g.direct_assignees=o.direct_assignees),typeof o.created_by=="string"&&(g.created_by=o.created_by),j(o.task_group_ids)&&(g.task_group_ids=o.task_group_ids),typeof o.name=="string"&&(g.name=o.name),typeof o.parent_task_id=="string"&&(g.parent_task_id=o.parent_task_id),g})(m);if(r!=null){const T=y.getState(),o=r.task_id,k=o!=null?T.taskState.taskByID?.[o]:void 0,g=k!=null;if(!p)if(r.is_private===!0){if(!g)return}else{const l=c?.userId,S=new Set([...r.assignees??[],...r.direct_assignees??[]]);if(r.created_by!=null&&r.created_by!==""&&S.add(r.created_by),!(l!=null&&S.has(l))&&!g)return}if(d===_.TASK_UPDATED&&g&&k!=null&&Array.isArray(r.task_group_ids)){const l=new Set(Object.values(T.taskGroupState.taskGroupById??{}).filter((i=>i!=null&&!i.isDeleted)).map((i=>i.id))),S=(k.taskGroupIds??[]).filter((i=>l.has(i))),L=(r.task_group_ids??[]).filter((i=>l.has(i))),K=S.length===L.length&&S.every((i=>L.includes(i))),w=k.taskGroupIds??[],E=r.task_group_ids??[],b=w.length!==E.length||!w.every((i=>E.includes(i))),Z=(i,Te)=>{const q=i??[],W=Te??[];if(q.length!==W.length)return!1;const ge=new Set(W);return q.every((_e=>ge.has(_e)))},h=r.name==null||r.name===k.name,G=r.is_private==null||r.is_private===k.isPrivate,U=r.assignees==null||Z(r.assignees,k.assignees),P=r.direct_assignees==null;if(K&&b&&h&&G&&U&&P)return}}return void N()}case _.TASKS_BULK_DELETED:{const r=ta(m);return r==null?void 0:void r.task_ids.forEach((T=>t(We(T))))}case _.TASKS_BULK_UPDATED:case _.TASK_SNOOZE_RESURFACED:return void N()}},onSubscribed:()=>{N()}}),u.useEffect((()=>{B==="Completed"&&t(re({taskGroupById:O.taskGroupById}))}),[B,O.taskGroupById]),c==null)throw Error("Can't access task list page without signing in...");return A.jsxs(A.Fragment,{children:[B==="Completed"?A.jsx(he,{analytics:Ce,onLoad:d=>(m=>m.trackPageLoaded(Ge.Event.taskListPage))(d)}):null,A.jsxs(sa,{children:[A.jsx(Xe,{isAppContentDrawerOpen:ce,handleDrawerToggle:d=>{de(d)}}),A.jsx(na,{location:n,navigate:e,currentTenant:f,taskGroupId:v,taskGroupState:O,localData:$.localData,uiState:$.uiState,isTaskTemplatesEnabled:s,taskListFetchState:B,isTaskCategorizationEnabled:x,isTaskCannedResponsesEnabled:D,isTaskBulkResolutionEnabled:ie,isTaskGroupAssigneesEnabled:le,isTaskRecurringParentEnabled:ue,isAiCfoAccessEnabled:ke,onAskAiCfoClick:pe})]})]})}const se=(e,t)=>`/${e}/tasks/${encodeURIComponent(t)}`,z=(e,t)=>`/${e}/tasks/new/${t}`,oa=(e,t)=>{if(e==="assignee"){const n=t.split(",");return{...R.taskDetailLocalData,assignee:n}}if(e==="priority"){const n=Qe(t);return{...R.taskDetailLocalData,priority:n}}if(e==="status"){const n=Ve(t);return{...R.taskDetailLocalData,status:n}}if(e==="tag"){const n=t.split(",");return{...R.taskDetailLocalData,tagIds:n}}if(e==="dueDate"){const n=qe(t);return{...R.taskDetailLocalData,dueDate:n}}return{...R.taskDetailLocalData}},ma=Object.freeze(Object.defineProperty({__proto__:null,default:ra},Symbol.toStringTag,{value:"Module"}));export{_ as T,aa as a,ea as b,_a as c,ta as d,ra as e,ma as f,ga as t};
@@ -1,9 +0,0 @@
1
- import{j as r}from"./liveblocks-V5YQZeeY.js";import fe from"./NotFoundScreen-C94S-cmy.js";import{a as k}from"./sentry-bpmZUW7k.js";import{h as ee,u as ae,j as g,g as ge,i as he,N as be,l as Ee,n as De,o as h}from"./core-BWRpGVdr.js";import{Qz as se,QC as Ie,Qw as Ce,a31 as _e,fE as te,a32 as ne,Q_ as E,QQ as b,Qt as Re,Rt as ye,Rm as Ge,a33 as oe,gg as ie,a34 as W,a35 as Ae,Qp as Ue,Qm as ve,v2 as we,uS as xe,mz as Be,QO as je,a36 as Pe,RF as Fe,QK as Ke,R8 as Le,R5 as Qe,QF as $e,R2 as Ne,QZ as Ze}from"./zeni-epic-state-BlWDBO75.js";import{z as D,e7 as ze,g as Oe,p as Ve,c as R,a3 as re,n as y,a7 as qe,m as X,S as Me,e8 as Je,X as Y,ad as We}from"./index-9pdMsp-M.js";import{n as Xe}from"./mui-BmHHlwSU.js";import{u as Ye}from"./useInitialThreadRequest-Df-inltN.js";import{M as He}from"./MobileAppDrawer-rCVKr3J3.js";import{T as m,t as ea,b as aa,a as sa,c as ta,d as H,e as na}from"./TaskListScreen-aizYXFWj.js";import{u as oa}from"./useTaskManagerPusherEvents-Ctn5L7kn.js";import"./recharts-BXLxGQ-T.js";import"./analytics-BfKlFVdJ.js";import"./plaid-CNV6JDhi.js";import"./dnd-wLfPcqQ_.js";import"./stripe-cKAAJElX.js";import"./lottie-ByqRhfis.js";import"./lexical-ljfsYSTd.js";import"./pdf-C42gprG9.js";import"./utils-CXFQdt3d.js";import"./InboxNotificationsProvider-Cd4NxEtR.js";import"./useTaskManagerAccess-Bq9TDvwr.js";import"./useAskAiCfoHostNavButtonProps-E2UGdnp9.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]="4bb9c6db-298e-4d05-aa2f-ba4496c8fe2d",e._sentryDebugIdIdentifier="sentry-dbid-4bb9c6db-298e-4d05-aa2f-ba4496c8fe2d")}catch{}})();function ia(){const e=ee(),a=ae(),n=D.getSignedInUser(),{cannedResponses:c,fetchState:t,saveFetchState:l}=g((i=>i.cannedResponsesState)),d=k.useCallback((()=>{a(se())}),[a]),S=k.useCallback(((i,I,C)=>{a(Ie({name:i,content:I,cannedResponseId:C}))}),[a]),s=k.useCallback((i=>{a(Ce({cannedResponseId:i}))}),[a]);if(n==null)throw Error("Can't access quick responses page without signing in...");return r.jsx(ze,{cannedResponses:c,isLoading:t==="In-Progress"||t==="Not-Started",isSaving:l==="In-Progress",onBackClick:()=>e(-1),onDelete:s,onFetch:d,onSave:S})}const L=e=>e?.taskState?.taskByID,F=(e,a)=>{const n=L(e);if(a!=null&&n!=null)return n[a]?.parentTaskId??void 0},ra=_e([F,(e,a)=>{const n=F(e,a),c=L(e);if(n!=null&&c!=null)return c[n]?.name},(e,a)=>{const n=F(e,a),c=L(e);return n!=null&&c!=null&&c[n]!=null}],((e,a,n)=>{if(e!=null&&n===!0)return{id:e,name:a??""}})),ca=Ee((function(e,a){const{location:n,taskGroupId:c}=a,t=oe(e,a.taskId),l=te(e),d=ra(e,a.taskId),S=t.taskGroupId??c,s=S!=null?W(e.taskGroupState,S):void 0,i=D.getSignedInUser(),I=l.tenantId,C={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:I??""},v=ne(e),{tenantEmailDomain:w}=l,G=t.recurringSourceTaskId,x=G!=null?`${Y.appUrl}/${w}/tasks/${encodeURIComponent(G)}`:void 0;return{taskDetailSelectorView:t,authParams:C,isZeniUser:D.isZeniUser(),userGroupList:Ae(e),isNewClicked:n.state?.message==="comingFromTaskListPage",filesEndPoint:We.fileMicroServiceBaseUrl,companyName:a.currentTenant.companyName,companyId:a.currentTenant.companyId,currentUrl:`${Y.appUrl}${a.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:v,taskGroupName:S!=null&&s!=null&&s.isDefault===!1?s.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((T=>W(e.taskGroupState,T))).filter((T=>T!=null&&!T.isDeleted)).map((T=>({id:T.id,name:T.name,isDefault:T.isDefault}))),subtasks:t.subtasks,parentTaskRef:d,subTaskCreateStatus:e.taskDetailState?.subTaskCreateStatus?.fetchState}}),(function(e,a){const{taskId:n,navigate:c,currentTenant:t,location:l,taskGroupId:d}=a,{tenantEmailDomain:S}=t;return{onSaveChangesToLocalStore:s=>{e(Ze({taskDetailLocalData:s,taskId:n}))},onSaveDetailClick:s=>{e(Ne(n,s??d))},onArchiveTaskClick:()=>{a.taskId!=null&&e($e(a.taskId))},onSnoozeTask:(s,i)=>{e(Qe(s,i))},onUnsnoozeTask:s=>{e(Le(s))},onCreateSubtask:(s,i)=>{e(Ke({...i,parentTaskId:s}))},onSubtaskUpdate:(s,i)=>{e(Fe({task:s,updates:i}))},onShowToast:s=>{e(ie(s))},onSubtaskRowClick:s=>{c(`/${S}/tasks/${s}`,{state:{pathnameStackToGoBack:y(l.state?.pathnameStackToGoBack,l.pathname)}})},onParentBreadcrumbClick:s=>{c(`/${S}/tasks/${s}`,{state:{pathnameStackToGoBack:y(l.state?.pathnameStackToGoBack,l.pathname)}})},onDismissClick:()=>{if(l.state?.message==="triggerBackClick"){const s=re(l.state?.pathnameStackToGoBack),i=s.poppedPathname??"../../dashboard";c(i,{state:{pathnameStackToGoBack:s.newStack}})}else{const s=U(S),i=y(l.state?.pathnameStackToGoBack,l.pathname);c(s,{state:{pathnameStackToGoBack:i}})}e(Pe({taskId:n}))},onDeleteTaskClick:()=>{e(je(n))},updateFilesEntity:s=>{e(Be({files:s}))},onDeleteFile:s=>{e(xe(s))},onEditFileName:(s,i)=>{e(we(s,i.split(".")[0]))},onReloadTaskDetailPage:()=>{e(E(!1,n))},onCreateTagClick:s=>{e(ve(s,n))},onDeleteTagClick:s=>{e(Ue(s,n))},onFetchCannedResponses:()=>{e(se())},onManageTemplatesClick:()=>{c(`/${t.tenantEmailDomain}/tasks/quick-responses`)}}}))(Je);function K(){const e=ee(),a=ae(),n=ge(),c=Oe(),{taskId:t,taskGroupId:l}=he(),d=g((o=>te(o))),S=Ye(d?.companyId),{useFeatureGate:s}=Ve(),{isFeatureEnabled:i}=s(R.isTaskSnoozeEnabled),{isFeatureEnabled:I}=s(R.isTaskVisibilityEnabled),{isFeatureEnabled:C}=s(R.isTaskCannedResponsesEnabled),{isFeatureEnabled:v}=s(R.isTaskRecurringParentEnabled),{isFeatureEnabled:w}=s(R.isTaskGroupAssigneesEnabled),[G,x]=k.useState(!1),[T,ce]=k.useState(!1),[Q,le]=k.useState(!1),[$,B]=k.useState(!1),_=k.useRef(!1),A=g((o=>o.taskListState.updateTasksFetchState.fetchState)),N=g((o=>ne(o))),Z=g((o=>o.taskGroupViewState.fetchState));k.useEffect((()=>{a(E(!1,t)),t!=null&&a(b(t))}),[a,t]);const z=D.getSignedInUser()?.userId,de=D.isZeniUser(),ue=g((o=>t!=null?o.taskState.taskByID[t]?.syncToken:void 0)),O=()=>{d?.tenantEmailDomain!=null&&e(U(d.tenantEmailDomain))},V=()=>{a(ie({messageSection:"delete_task",messageText:"success",type:"success"})),O()},ke=k.useMemo((()=>{const o=[m.TASK_CREATED,m.TASK_UPDATED,m.TASKS_BULK_UPDATED,m.TASKS_BULK_DELETED],u=[...o,m.TASK_SNOOZE_RESURFACED];return[...aa(d?.companyId,o),...sa(z,u)]}),[d?.companyId,z]);oa({events:ke,onSubscribed:()=>{t!=null&&(a(E(!0,t)),a(b(t)))},onEvent:(o,u)=>{if(t!=null)switch(o){case m.TASK_CREATED:case m.TASK_UPDATED:{const p=((P,me,{isZeniUser:Se,storedSyncToken:Te,taskId:J})=>{if(P!==m.TASK_CREATED&&P!==m.TASK_UPDATED)return"none";const f=ea(me);return f==null?"none":f.parent_task_id===J?"refreshSubtasks":P!==m.TASK_UPDATED||f.task_id!==J?"none":f.is_deleted===!0?"leaveDeleted":f.is_private!==!0||Se?f.sync_token!=null&&f.sync_token===Te?"none":"refreshTask":"leaveNoAccess"})(o,u,{isZeniUser:de,storedSyncToken:ue,taskId:t});p==="refreshTask"?(a(E(!0,t)),a(b(t))):p==="refreshSubtasks"?a(b(t)):p==="leaveDeleted"?V():p==="leaveNoAccess"&&O();break}case m.TASKS_BULK_UPDATED:{const p=H(u);if(p==null)break;p.task_ids.includes(t)&&a(E(!0,t)),a(b(t));break}case m.TASKS_BULK_DELETED:{const p=H(u);if(p==null)break;if(p.task_ids.includes(t)){V();break}a(b(t));break}case m.TASK_SNOOZE_RESURFACED:{ta(u)?.task_id===t&&a(E(!0,t));break}}}}),k.useEffect((()=>{T||N.fetchState==="Completed"||(ce(!0),a(Re()))}),[T,a,N.fetchState]),k.useEffect((()=>{Q||Z==="Completed"||(le(!0),a(ye()))}),[Q,a,Z]);const pe=k.useCallback((()=>{t!=null&&(_.current=!1,a(Ge([t],null,{isArchived:!1})),B(!0))}),[a,t]);k.useEffect((()=>{if($)if(A!=="In-Progress"){if(_.current){if(A==="Error")return B(!1),void(_.current=!1);if(A==="Completed"){B(!1),_.current=!1;const{tenantEmailDomain:o}=d;if(n.state?.message==="triggerBackClick"){const u=re(n.state?.pathnameStackToGoBack);e(u.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:u.newStack}})}else{const u=U(o);e(u,{state:{pathnameStackToGoBack:y(n.state?.pathnameStackToGoBack,n.pathname)}})}}}}else _.current=!0}),[$,A,d,n,e]);const q=g((o=>oe(o,t))),j=q.fetchState,M=D.getSignedInUser();if(M==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&q.error?.code===400){const{tenantEmailDomain:o}=d,u=U(o),p=y(n.state?.pathnameStackToGoBack,n.pathname);return r.jsx(be,{to:u,state:{pathnameStackToGoBack:p}})}return r.jsxs(r.Fragment,{children:[j==="Completed"?r.jsx(qe,{analytics:X,onLoad:o=>(u=>u.trackPageLoaded(Me.Event.taskDetailPage))(o)}):null,r.jsxs(la,{children:[r.jsx(He,{isAppContentDrawerOpen:G,handleDrawerToggle:o=>{x(o)}}),r.jsx(ca,{analytics:X,currentTenant:d,handleZeniLogoClick:()=>{c.toggle()},initialOpenThreadRequest:S,location:n,loggedInUser:M,navigate:e,taskGroupId:l,taskId:t,taskDetailFetchState:j,onUnarchiveTaskClick:pe,isTaskSnoozeEnabled:i,isTaskVisibilityEnabled:I,isTaskCannedResponsesEnabled:C,isTaskRecurringParentEnabled:v,isTaskGroupAssigneesEnabled:w})]})]})}const la=Xe.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 xa(){return r.jsxs(De,{children:[r.jsx(h,{path:"/new",element:r.jsx(K,{})}),r.jsx(h,{path:"/new/:taskGroupId",element:r.jsx(K,{})}),r.jsx(h,{path:"/group/:taskGroupId",element:r.jsx(na,{})}),r.jsx(h,{path:"/quick-responses",element:r.jsx(ia,{})}),r.jsx(h,{path:"/:taskId",element:r.jsx(K,{})}),r.jsx(h,{path:"*",element:r.jsx(fe,{})})]})}export{xa as default};
@@ -1 +0,0 @@
1
- import{j as c}from"./liveblocks-V5YQZeeY.js";import V from"./NotFoundScreen-C94S-cmy.js";import{a as n}from"./sentry-bpmZUW7k.js";import{u as ft,h as bt,g as yt,i as ht,j as o,n as St,o as f}from"./core-BWRpGVdr.js";import{fE as It,gV as Lt,l$ as Tt,uh as Ct,XN as Et,XC as jt,XO as gt,R_ as At,R$ as kt,h$ as L,lZ as vt,ui as xt,RQ as Dt,Sp as Rt,XP as _t,XQ as Nt,RX as Xt,RU as wt,XR as Ft,XS as Mt,XT as Pt}from"./zeni-epic-state-BlWDBO75.js";import{p as zt,V as Ht,c as H,b1 as Ut,z as $t,h as qt,b2 as Vt,m as U,b3 as Bt,ad as Gt,G as Ot}from"./index-9pdMsp-M.js";import"./mui-BmHHlwSU.js";import{d as Qt}from"./decodeURIComponentSafe-DN9u1X8y.js";import{u as Jt}from"./useEnsureVendorListLoaded-CKZrwkQQ.js";import{u as Kt,T}from"./TransactionDetailScreen-CNMo1Iyr.js";import{c as Zt}from"./routePaths--TXDBUUo.js";import"./recharts-BXLxGQ-T.js";import"./analytics-BfKlFVdJ.js";import"./plaid-CNV6JDhi.js";import"./dnd-wLfPcqQ_.js";import"./stripe-cKAAJElX.js";import"./lottie-ByqRhfis.js";import"./lexical-ljfsYSTd.js";import"./pdf-C42gprG9.js";import"./utils-CXFQdt3d.js";import"./useAskAiCfoHostNavButtonProps-E2UGdnp9.js";import"./useInitialThreadRequest-Df-inltN.js";import"./expenseAutomationHelper-Dr99xbt1.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new e.Error().stack;d&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[d]="e2fb5cbf-abba-4839-ac59-b394fd797b09",e._sentryDebugIdIdentifier="sentry-dbid-e2fb5cbf-abba-4839-ac59-b394fd797b09")}catch{}})();const Wt=["bank","credit_card","other_current_assets"],$=e=>`/${e}/month_end_close_checks/review/transaction_categorization`,{common:{currency:q}}=Ot.getLocalizedStrings();function Yt(){const e=ft(),d=bt(),m=yt(),{tenantEmailDomain:u,transactionTypeEncoded:B}=ht(),{useFeatureGate:C}=zt(),G=Ht(),{isFeatureEnabled:O}=C(H.isCreateTransactionEnabled),{isFeatureEnabled:E}=C(H.isProjectsTransactionsEnabled),Q=Qt(B??""),a=Pt.find((t=>t===Q)),h=o((t=>It(t))),j=Ut(h.companyId,a),g=o((t=>Lt(t.companyState,h.companyId)?.company.companyLocaleInfo)),J=g?.currencyCode??q.currencyCode,K=g?.currencySymbol??q.currencySymbol,A=o((t=>t.tenantState.currentTenantId)),k=$t.getSignedInUser(),v=k?.userId??"",x=k?.zeniSessionId??"",Z=n.useMemo((()=>({userId:v,sessionId:x,tenantId:A??""})),[v,x,A]),W=o((t=>Tt(t))),D=o((t=>Ct(t))),R=D&&E===!0,S=o((t=>t.projectListState)),_=o((t=>t.projectState)),Y=n.useMemo((()=>Et(_,S).projects),[_,S]),I=o((t=>jt(t,"common"))),N=o((t=>t.accountListState.byReportId.accountList.fetchState)),X=o((t=>t.accountListState.byReportId.createTransactionLineAccountList.fetchState)),w=o((t=>t.accountListState.byReportId.createTransactionPaymentAccountList.fetchState)),F=o((t=>t.classListState.fetchState)),s=o((t=>a!=null?gt(t,a):void 0));n.useEffect((()=>{if(a!=null)return e(At(a)),()=>{e(kt(a))}}),[e,a]);const tt=qt(),et=o((t=>{const{activeTenantFetchState:i,currentTenantId:y,fetchState:mt,tenantsById:pt}=t.tenantState;return y!=null&&pt[y]!=null&&(i.fetchState==="Completed"||mt==="Completed")})),r=tt&&et;n.useEffect((()=>{r&&a==="transfer"&&N==="Not-Started"&&e(L("accountList"))}),[e,r,a,N]),n.useEffect((()=>{r&&X==="Not-Started"&&e(L("createTransactionLineAccountList"))}),[e,r,X]),n.useEffect((()=>{r&&w==="Not-Started"&&e(L("createTransactionPaymentAccountList",!1,!1,!1,!1,Wt))}),[e,r,w]),n.useEffect((()=>{r&&F==="Not-Started"&&e(vt())}),[e,r,F]);const M=S.fetchState;n.useEffect((()=>{r&&R&&M==="Not-Started"&&e(xt())}),[e,r,R,M]),Jt(r),Kt(r&&a==="transfer",!1);const at=n.useCallback(((t,i=[])=>{if(i.length>0&&e(Dt(i)),u==null)return;const y=Vt(m.state)??[$(u)];d(Zt(t,u),{replace:!0,state:{pathnameStackToGoBack:y}})}),[e,u,d,m.state]),nt=n.useCallback((()=>{m.key==="default"?u!=null&&d($(u)):d(-1)}),[m.key,d,u]),ot=n.useCallback((t=>{e(Rt(t))}),[e]),P=n.useRef(void 0),p=s?.createStatus.error;n.useEffect((()=>{if(a==null||p==null)return;const t=`${p.code??""}-${p.message??""}`;P.current!==t&&(P.current=t,U.trackCreateTransactionFailed({transactionType:a,errorCode:p.code}))}),[p,a]);const b=n.useCallback((t=>t),[]),l=n.useMemo((()=>(s?.vendorList??[]).filter((t=>!t.isDeleted)).sort(((t,i)=>t.name.localeCompare(i.name)))),[s?.vendorList]),z=s?.localData.vendorId,st=n.useMemo((()=>{const t=l.find((i=>i.id===z));if(t!=null)return t.qboId!==""&&t.qboId!==t.name?t.qboId:t.name}),[l,z]),ct=o((t=>_t(t,st))),rt=n.useMemo((()=>b(l.map((t=>({id:t.id,label:t.name}))))),[l,b]),it=n.useMemo((()=>({...I,vendor:[...l.map((t=>({id:t.id,name:t.name,qboId:t.qboId,type:"vendor",zeniId:t.id}))),...I.vendor]})),[I,l]),dt=n.useMemo((()=>b((s?.transferAccountsList??[]).map((t=>({id:t.accountId,label:t.accountName}))))),[s?.transferAccountsList,b]),ut=n.useCallback((t=>{a!=null&&e(Nt(a,t))}),[e,a]),lt=n.useCallback(((t,i)=>{a!=null&&e(Xt(a,i,t))}),[e,a]);return j==null?null:a!=null&&s!=null&&O===!0&&j&&G?.connectionName!=="netsuite"?c.jsx(Bt,{analytics:U,attachmentUploadEndpoint:Gt.accountMicroServiceBaseUrl,authParams:Z,createdTransactionId:s.createdTransactionId,transactionType:a,localData:s.localData,createStatus:s.createStatus,accountsHierarchyList:s.accountListNestedAccountHierarchy,paymentAccountsHierarchyList:s.paymentAccountListNestedAccountHierarchy,classHierarchyList:s.classListNestedAccountHierarchy,vendorOptions:rt,transferAccountOptions:dt,isAccountingClassesEnabled:W,isAccountingProjectsEnabled:D,isProjectsTransactionsEnabled:E===!0,projects:Y,currencyCode:J,currencySymbol:K,bookCloseDate:h.bookCloseDate?.toDate(),entityAutoCompleteView:it,vendorRecommendationFetchState:ct.fetchState,onUpdateLocalData:ut,onAddLine:()=>e(Mt(a)),onRemoveLine:t=>e(Ft(a,t)),onSubmit:()=>e(wt(a)),onCancel:nt,onCreateTransactionComplete:at,onUploadAttachmentAttachment:ot,onFetchRecommendationsForVendor:lt}):c.jsx(V,{})}function Ee(){return c.jsxs(St,{children:[c.jsx(f,{path:"/new/:transactionTypeEncoded",element:c.jsx(Yt,{})}),c.jsx(f,{path:"/:transactionTypeEncoded/:transactionId",element:c.jsx(T,{})}),c.jsx(f,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:c.jsx(V,{})}),c.jsx(f,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:c.jsx(T,{})}),c.jsx(f,{path:"/*",element:c.jsx(T,{})})]})}export{Ee as default};
@@ -1,5 +0,0 @@
1
- import{j as _}from"./liveblocks-V5YQZeeY.js";import{a as i}from"./sentry-bpmZUW7k.js";import{u as M,k as st,j as g,s as ge,g as De,h as Ce,i as Ae,N as ct,l as it}from"./core-BWRpGVdr.js";import{pz as Ie,fE as te,gV as rt,Vr as lt,oF as dt,ob as ut,E0 as J,XU as mt,gg as pt,bj as ft,dd as _e,bm as Re,sZ as W,Wz as q,XV as we,XW as le,WZ as Pe,ma as Fe,XX as Ue,X2 as de,X3 as ue,m$ as Ve,SX as me,XD as G,m4 as xe,m2 as Le,me as St,pm as ht,XY as yt,XZ as Tt,DT as K,m9 as Be,Sg as Oe,ck as bt,dj as gt,X_ as It,XC as vt,X$ as Et,Y0 as kt,Y1 as Dt,Y2 as Ct,DP as At,Y3 as _t,Y4 as Rt,Y5 as wt,Y6 as Pt,Y7 as Ft,md as Ut,Y8 as Vt,Y9 as xt,XE as Lt,Ya as Bt,Yb as Ot,Yc as Nt,Sa as zt,S0 as jt,Sp as Mt,mf as Yt,SY as ve,pr as Gt}from"./zeni-epic-state-BlWDBO75.js";import{p as H,c as w,m as $,b4 as $t,z as Ne,a0 as Xt,b5 as Wt,aa as qt,a3 as ie,V as Ht,b6 as Zt,n as re,ar as Jt,b7 as Kt,b8 as Qt,b9 as en,ad as tn,au as ce}from"./index-9pdMsp-M.js";import{n as nn,S as an,u as on,D as sn}from"./mui-BmHHlwSU.js";import{u as cn}from"./useAskAiCfoHostNavButtonProps-E2UGdnp9.js";import{d as ze}from"./decodeURIComponentSafe-DN9u1X8y.js";import{u as rn}from"./useInitialThreadRequest-Df-inltN.js";import{h as je,c as Me,g as ln,e as dn}from"./routePaths--TXDBUUo.js";import{u as un}from"./expenseAutomationHelper-Dr99xbt1.js";import{A as mn}from"./utils-CXFQdt3d.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="0197e6e6-d240-491b-b78f-a0c9a283c124",t._sentryDebugIdIdentifier="sentry-dbid-0197e6e6-d240-491b-b78f-a0c9a283c124")}catch{}})();function pn(t=!0,e=!0){const o=M(),n=st(),{useFeatureGate:a}=H(),{isFeatureEnabled:s}=a(w.isCreateTransferEntryFromExpenseEnabled);i.useEffect((()=>{if(!t||e&&s!==!0)return;const c=d=>{const f=n.getState().createTransferEntryState.transferAccountsByType[d].fetchState;return f!=="In-Progress"&&f!=="Completed"};c("transferEntryEligible")&&o(Ie({kind:"transferEntryEligible"})),c("creditCardOnlyEligible")&&o(Ie({kind:"creditCardOnlyEligible"}))}),[t,e,s,o,n])}function fn(t,e){const o=(function(){const d=M(),[f,S]=i.useState(!1),[D,p]=i.useState(null),[l,u]=i.useState(null),{useDynamicConfig:y}=H(),{configValue:v,isDynamicConfigLoading:h}=y("transaction_categorization_config"),T=!h&&v?.capitalization_enabled===!0,k=g((I=>te(I))),C=k.companyId,P=g((I=>rt(I.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:A,capitalizableAccountOverrides:F,dismissedAccounts:U}=g((I=>{const b=I.tenantState.currentTenantId,R=b!=null?I.tenantState.tenantsById[b]:void 0;return{capitalizableAccounts:R?.capitalizableAccounts??null,capitalizableAccountOverrides:R?.capitalizableAccountOverrides??null,dismissedAccounts:R?.capitalizationOnboardingDismissedAccounts??null}}),ge),L=i.useRef(A);L.current=A;const V=i.useRef(F);V.current=F;const B=i.useRef(U);B.current=U;const O=g((I=>lt(I.accountState)),ge),Y=i.useMemo((()=>{const I={};for(const b of O)b.accountId!=null&&b.accountName!=null&&(I[b.accountId]=b.accountName);return I}),[O]),X=l!=null?Y[l]??null:null,N=i.useCallback((I=>{if(!T)return;const b=L.current;if(b==null)return;const R=b.accounts??[],Z=new Set(I),ne=V.current??{},ae=B.current;for(const z of R)if(Z.has(z.accountId)&&ne[z.accountId]==null&&ae?.[z.accountId]==null)return p(z.classificationType),u(z.accountId),void S(!0)}),[T]),E=i.useCallback(((I,b)=>{d(dt(C,I,b,!0)),S(!1),p(null),u(null)}),[d,C]),r=i.useCallback((()=>{l!=null&&(d(ut(C,l)),S(!1),p(null),u(null))}),[d,C,l]);return{showPopup:f&&T,popupType:D,popupAccountId:l,popupAccountName:X,currencySymbol:P,checkAndShowPopup:N,handleSubmit:E,handleDismiss:r}})(),n=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((()=>{t==="In-Progress"&&(a.current=c.current()),t==="Completed"&&n.current==="In-Progress"&&a.current.length>0&&(s.current(a.current),a.current=[]),n.current=t}),[t]),o}const j=new Map,Ye=(t,e,o)=>`${t}|${e??""}|${o}`,Q=(t,e)=>{const[o,n]=t.shownRecommendations;return{recommendationFor:t.dimension,recommendation:o?.name??"",recommendationSource:o?.engine??null,recommendationConfidencePercentage:o?.confidencePercentage??null,alternativeRecommendation:n?.name??null,alternativeRecommendationSource:n?.engine??null,alternativeRecommendationConfidencePercentage:n?.confidencePercentage??null,selectedValue:t.selected.name,numberOfRecommendations:t.shownRecommendations.length,transactionId:e,lineId:t.lineId??null}},ee=(t,e,o)=>({transactionId:e,lineId:t.lineId,dimension:t.dimension,outcome:t.outcome,selected:{name:t.selected.name,id:t.selected.id},matchedSource:t.matchedSource,matchedRank:t.matchedRank,topPickSource:t.topPickSource,shownRecommendations:t.shownRecommendations.map((n=>({source:n.source,rank:n.rank,value:{name:n.name,id:n.id},confidence:n.confidencePercentage!=null?n.confidencePercentage/100:void 0}))),...o}),Ee=(t,e)=>{j.set(Ye(e,t.lineId,t.dimension),{feedback:t,transactionId:e})},Ge=(t,e,o)=>{$.trackRecommendationFeedbackRetracted(Q(e,o)),t(J(ee(e,o,{outcome:"retracted"})))},Bn=(t,e)=>{const o=new Set(e.map(String));j.forEach(((n,a)=>{o.has(n.transactionId)&&(j.delete(a),Ge(t,n.feedback,n.transactionId))}))},On=t=>{const e=new Set(t.map(String));j.forEach(((o,n)=>{e.has(o.transactionId)&&j.delete(n)}))};function Sn(t){const e=M(),[o,n]=i.useState(null),[a,s]=i.useState(!1),{fetchState:c}=g(mt),{isEnabled:d,fallbackTransactionId:f}=t,S=i.useCallback((u=>u.transactionId??f??""),[f]),D=i.useCallback((u=>{if(!d)return;const y=S(u);if(y==="")return;if(u.outcome!=="accepted")return void n(u);((h,T,k,C)=>{const P=Ye(T,k,C),A=j.get(P);return A!=null&&(j.delete(P),Ge(h,A.feedback,A.transactionId),!0)})(e,y,u.lineId,u.dimension)||(((h,T)=>{$.trackRecommendationAccepted(Q(h,T))})(u,y),e(J(ee(u,y,{}))))}),[d,S,e]),p=i.useCallback((u=>{if(o==null)return;const y=S(o);((v,h,T)=>{$.trackRecommendationFeedbackSubmitted({...Q(v,h),feedbackReason:T})})(o,y,u),e(J(ee(o,y,{reasonText:u,skipped:!1}))),Ee(o,y),s(!0)}),[o,S,e]),l=i.useCallback((()=>{if(o==null)return;const u=S(o);((y,v)=>{$.trackRecommendationFeedbackSkipped(Q(y,v))})(o,u),e(J(ee(o,u,{skipped:!0}))),Ee(o,u),s(!1),n(null)}),[o,S,e]);return i.useEffect((()=>{if(!a||c!=="Completed"&&c!=="Error")return;s(!1),n(null);const u=c==="Completed";e(pt({messageSection:"recommendation_feedback",messageText:u?"success":"failed",type:u?"success":"error",showStatusIcon:!0}))}),[a,c,e]),{onRecommendationSelection:D,popup:o!=null?_.jsx($t,{feedback:o,submitState:a?c:"Not-Started",onSubmit:p,onSkip:l}):null}}const pe=()=>{const t=Ne.getSignedInUser(),{useFeatureGate:e}=H(),{isFeatureEnabled:o}=e(w.isChainOfThoughtEnabled);return i.useMemo((()=>ft(t)&&o),[t,o])};function $e(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Nn(t,e){const o=M(),{useFeatureGate:n}=H(),a=g((r=>te(r))),s=a.userRole.includes("charge_card_user")||a.userRole.includes("charge_card_admin"),c=a.userRole!=null&&_e(a.userRole),d=a.userRole!=null&&Re(a.userRole),{isFeatureEnabled:f}=n(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:S}=n(w.isExpenseAutomationEnabled),D=pe(),p=i.useMemo((()=>({id:t,type:W(e)})),[t,e]),l=g((r=>q(r,p))),u=l?.transactionDetailUpdateStatus?.fetchState,y=l?.transactionDetailLocalData?.lineItemById,v=g((r=>{const I=q(r,p)?.transactionDetailLocalData.vendorUpdates?.id;return I==null?"Not-Started":r.transactionVendorViewState.editVendorStateById[I]?.saveStatus.fetchState??"Not-Started"})),h=i.useMemo((()=>l?.fetchState==="Completed"?$e(l?.transaction):void 0),[l?.fetchState,l?.transaction]),T=g((r=>{if(h!=null)return we(r.customerIncomeState,r.vendorExpenseState,r.trendState,h,"month")})),k=g((r=>le(r))),C=g((r=>{if(h!=null)return Pe(r.trendWithTransactionsState,h,"TransactionDetail")})),P=a.company?.companyInfo.firstMonthOfFY??1,A=g((r=>Fe(r.accountState,r.accountListState,"accountList"))),[F,U]=i.useState(!1),[L,V]=i.useState(!1),[B,O]=i.useState(!1);i.useEffect((()=>{U(!1),V(!1),O(!1)}),[t,e]);const Y=i.useCallback((()=>{U(!1),V(!1)}),[]),[X,N]=i.useState(!1),E=C?.selectedPeriod?.timePeriod;return i.useEffect((()=>{B||l==null||l.transaction==null||(o(Ue({id:l.transaction.id,type:l.transaction.type})),O(!0)),h!=null&&(!s||c&&d===!1)&&(F?L||T==null||(V(!0),o(me(h,"TransactionDetail",{timeframe:"month",timePeriod:E??T}))):(o(de()),o(ue()),U(!0),o(Ve(h))))}),[o,B,l?.fetchState,l?.transaction,h,s,c,d,F,L,T,E]),i.useEffect((()=>{k.newVendorState?.vendorDetailLocalData?.vendorName!=null?N(!0):N(!1)}),[k.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{o(G("common"))}),[o]),{currentTenant:a,loggedInUserHasCardUserOrAdminRole:s,isUserHasDashboardAccess:c,isUserHasInvestorOrBankerAccess:d,isVendorBulkUpdateOnTransactionEnabled:f,isExpenseAutomationEnabled:S,isChainOfThoughtEnabled:D,selectedTransaction:p,transactionDetail:l,rawDetailSaveStatus:u,rawDetailLineItemById:y,vendorSaveStatus:v,tranEntity:h,defaultTrendTransactionTimePeriod:T,vendorViewDetails:k,uiState:C,firstMonthOfFY:P,uncategorizedAccounts:A,resetTrendIsFetchedStates:Y,isCreateVendorDrawerOpen:X,setIsCreateVendorDrawerOpen:N}}const hn={overlayWidth:new qt(100,100,58)},yn=({isOpen:t,onSaveVendor:e,onSaveSuccess:o,onCancel:n,vendorViewDetails:a})=>{const s=on(),c=Xt(),d=M(),f=g((p=>le(p))),S=()=>{n()},D={vendorDetailView:a??f,onSaveSuccess:()=>{d(Le()),d(St("Not-Started")),o()},onSaveVendor:e,onCancelClick:S,saveVendorDetailLocalData:p=>{d(xe({vendorId:void 0,localData:p}))}};return _.jsx(sn,{anchor:"right",open:t,PaperProps:{style:{width:hn.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.4,cursor:"pointer"}}},onClose:S,children:_.jsx(Tn,{onClick:p=>p.stopPropagation(),children:_.jsx(Wt,{...D})})})},Tn=nn(an)`
2
- display: flex;
3
- min-height: 100%;
4
- flex-direction: column;
5
- `;function bn(t,e){t(ht({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:W(e.transactionType),sourceTransactionType:W(e.sourceTransactionType)}))}function gn({currentTransactionId:t,enabled:e=!0,buildPath:o,beforeNavigate:n,navigate:a,navigateState:s}){const c=g((f=>f.createTransferEntryState.lastTransferEntryReplacement)),d=i.useRef(null);i.useEffect((()=>{if(!e||c==null||t==null||d.current===c)return;const{previousTransactionId:f,newTransactionId:S}=c;t.id===f.id&&t.type===f.type&&(d.current=c,n?.(),a(o(S),{replace:!0,state:s}))}),[e,c,t,o,n,a,s])}const In=({closeDrawerHandler:t,overrideTransactionId:e,overrideTransactionType:o})=>{const n=De(),a=Ce(),s=M(),c=pe(),{transactionTypeEncoded:d,transactionId:f}=Ae(),S=e??f,D=o??ze(d??"");let p;je(S,D)&&(p={id:S,type:W(D)});const l=p!=null?g((y=>q(y,p))):void 0,u=()=>{const y=ie(n.state?.pathnameStackToGoBack),v=y.poppedPathname??((h=2)=>{let T="../";for(let k=0;k<h;k++)T=`${T}../`;return T})(1);a(v,{state:{pathnameStackToGoBack:y.newStack}})};return{transactionId:p,onSaveVendor:()=>{s(Be(p,void 0))},onSaveSuccess:()=>{if(l!=null&&l?.transaction&&l?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&l?.transactionDetailLocalData.vendorUpdates?.id!=null){const y=l?.transactionDetailLocalData.vendorUpdates,v={id:l?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:l?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:y?.name,qboId:l?.transactionDetailLocalData.vendorUpdates?.qboId??""},h={transactionId:{id:l?.transaction?.id,type:l?.transaction?.type},transaction:l?.transaction,lineIds:l?.transaction?.lines?.map((T=>T.id))??[]};s(K({entity:v,amount:l?.transaction?.amount.amount,transactionDetails:h,flowType:"detail",isFetchCOT:c}))}u()},onCancel:()=>{p!=null&&s(yt({transactionId:p})),s(Le()),s(Tt()),t(!0),u()}}},vn=it((function(t,e){const o=q(t,e.selectedTransaction);let n;o==null&&console.warn("Check if the you've selected the transaction before getting the details");const a=Ne.getSignedInUser(),s=t.tenantState.currentTenantId,c={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:s??""};o!=null&&o.fetchState==="Completed"&&o.transaction!=null&&e.entity!=null&&(n=It(t,e.entity,"TransactionDetail"));const d=t.entityAutoCompleteState.autoCompleteText.common,f=vt(t,"common"),S=te(t);return{transactionDetail:o,transactionAttachmentEndpointToDownload:`${ce}/transaction_attachment`,transactionAttachmentsEndpointToFetch:S.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${ce}/transaction_attachments_accounting_provider`:`${ce}/transaction_attachments`,attachmentUploadEndpoint:`${tn.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:n,analytics:$,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:d,entityAutoCompleteView:f},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails"),isTransactionSplitEditMode:o?.transactionDetailLocalData?.editMode??!1}}),(function(t,e){const{isCOTEnabled:o}=e;return{onBackClick:()=>{if(t(G("common")),e.onBackClick!=null)return void e.onBackClick();const n=ie(e.location.state?.pathnameStackToGoBack),a=n.poppedPathname??Xe(2);e.navigate(a,{state:{pathnameStackToGoBack:n.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(n,a)=>{e.transaction!=null&&t(Gt({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:n,customerId:a}))},onTransactionClick:n=>{e.resetTrendIsFetchedStates(),t(de()),t(ue());const a=re(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Me(n,e.tenantEmailDomain),{state:{pathnameStackToGoBack:a}})},onTrendSelectedPeriodChange:n=>{if(n==null)e.defaultTrendTransactionTimePeriod!=null&&t(ve(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const a=n.currentTimePeriod==null?n.addTimePeriod:{startDate:n.addTimePeriod.startDate,endDate:n.currentTimePeriod.endDate};t(me(e.entity,"TransactionDetail",{timeframe:n.timeframe,timePeriod:n.addTimePeriod})),t(ve(e.entity,"TransactionDetail",{timeframe:n.timeframe,timePeriod:a}))}},onSaveUpdates:(n,a,s,c)=>{t(c===!0&&s!=null?Be(n,s,!0,e.isExpenseAutomationEnabled):Yt({transactionId:n,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:a})),t(G("common"))},onUploadAttachmentAttachment:n=>{t(Mt(n))},onDeleteAttachment:n=>{e.transaction!=null&&t(jt(n,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(n,a)=>{t(zt({transactionId:n,transactionLocalData:a}))},onUpdateAllChecked:(n,a,s,c)=>{e.transaction!=null&&t(Nt(e.selectedTransaction,e.transaction,n,a,s,c))},onResetLineItemsCategoryClassInLocalData:(n,a,s,c,d,f)=>{t(Ot(n,a,s,c,d,f))},onChangeCategoryClassWhenUpdateAllIsChecked:(n,a)=>{e.transaction!=null&&t(Bt({id:e.transaction.id,type:e.transaction.type},e.transaction,n,a))},onSaveSuccess:()=>{const n=ie(e.location.state?.pathnameStackToGoBack);if(n.poppedPathname!=null){const a=mn(n.poppedPathname,"/").split("/"),s=a[a.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(s)&&e.navigate(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${ln(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${dn(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{t(Oe(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(n,a)=>{n.trim().length>=2?t(Lt({searchString:n,entityType:a,searchOrigin:"common"})):n.trim().length===0&&t(G("common"))},onCancelAutoComplete:()=>{t(G("common"))}},onFetchRecommendationsForEntity:(n,a,s,c)=>{t(K({entity:n,amount:a,transactionDetails:s,flowType:"detail",isBulkFetch:c,isFetchCOT:o}))},clearRecommendationForLineId:n=>{const{transactionId:a,transaction:s,lineId:c}=n;t(xt(a,s,c))},resetUpdateErrorState:()=>{const n={id:e.selectedTransaction.id,type:e.selectedTransaction.type};t(Vt(n))},onSaveVendorInLocalData:(n,a,s,c,d)=>{if(t(Ut({transactionId:n,vendorUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&d!=null&&t(K({entity:s,amount:c,transactionDetails:d,flowType:"detail",isFetchCOT:o})),t(xe({vendorId:a.id?a.id:void 0,localData:{vendorName:a.name,vendorId:a.id?a.id:void 0}})),!a.id&&e.transaction!=null){const f=e.transaction,S=re(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(f.type??"")}/${f.id}/vendor/create`,{state:{pathnameStackToGoBack:S}})}},onSaveCustomerInLocalData:(n,a,s,c,d)=>{t(Ft({transactionId:n,customerUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&d!=null&&t(K({entity:s,amount:c,transactionDetails:d,flowType:"detail",isFetchCOT:o}))},onUpdateAllTranactionsWithCurrentVendorChecked:n=>{t(Pt({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:n}))},onClickUpdateVendorToAllLineItems:(n,a,s)=>{t(wt(n,a,s))},onResetVendorToAllLineItems:(n,a,s)=>{t(Rt(n,a,s))},saveLatestSelectedEntity:(n,a,s)=>{t(_t({transactionId:n,lineId:a,entity:s}))},updateVendorBulkRecommendationsFetchStatus:(n,a)=>{t(At(n,a))},setIsVendorUpdateAllChecked:(n,a,s)=>{t(Ct(n,a,s))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?n=>bn(t,n):void 0,onLineAdd:()=>{if(e.transaction==null)return;const n={id:e.transaction.id,type:e.transaction.type},a=e.transaction.type==="journal_entry",s=e.transaction.amount?.currencyCode??"",c=e.transaction.amount?.currencySymbol??"",d=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"};t(Dt(n,d))},onLineDelete:n=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};t(kt(a,n))},onToggleSplitEditMode:n=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};t(Et(a,n))}}}))(en);function zn(){const t=Ce(),e=M(),o=De(),{useFeatureGate:n}=H(),a=Ht(),s=g((m=>te(m))),c=s.userRole.includes("charge_card_user")||s.userRole.includes("charge_card_admin"),d=s.userRole!=null&&_e(s.userRole),f=s.userRole!=null&&Re(s.userRole),{isFeatureEnabled:S}=n(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:D}=n(w.isExpenseAutomationEnabled),{tenantEmailDomain:p,transactionTypeEncoded:l,transactionId:u}=Ae(),[y,v]=i.useState(!1),h=ze(l??""),T=je(u,h),k=g((m=>m.transactionVendorViewState)),C=pe(),{isFeatureEnabled:P}=n(w.isRecommendationFeedbackEnabled),A=Zt(),{onRecommendationSelection:F,popup:U}=Sn({isEnabled:P,fallbackTransactionId:u}),L=i.useMemo((()=>({...A,onRecommendationSelection:F})),[A,F]),{isFeatureEnabled:V}=n(w.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:B}=n(w.isProjectsTransactionsEnabled),{isFeatureEnabled:O}=n(w.isTransactionSplitEnabled),Y=a?.currentTenant?.companyId,X=a?.currentTenant?.companyName,N=rn(Y),E=i.useMemo((()=>{if(T)return{id:u,type:W(h)}}),[T,u,h]),r=E!=null?g((m=>q(m,E))):void 0,I=r?.transactionDetailLocalData.vendorUpdates?.id!=null?k.editVendorStateById[r?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",b=r?.fetchState==="Completed"?$e(r?.transaction):void 0,R=g((m=>b!=null?we(m.customerIncomeState,m.vendorExpenseState,m.trendState,b,"month"):void 0)),Z=g((m=>le(m))),ne=g((m=>b!=null?Pe(m.trendWithTransactionsState,b,"TransactionDetail"):void 0)),ae=s.company?.companyInfo.firstMonthOfFY??1,z=g((m=>Fe(m.accountState,m.accountListState,"accountList"))),[We,fe]=i.useState(!1),[qe,Se]=i.useState(!1),[He,he]=i.useState(!1),Ze=i.useCallback((m=>Me(m,p??"")+o.search),[p,o.search]),Je=i.useCallback((()=>{he(!1)}),[]);gn({currentTransactionId:E,enabled:p!=null&&p!=="",buildPath:Ze,beforeNavigate:Je,navigate:t,navigateState:o.state});const ye=()=>{fe(!1),Se(!1)},Te=un();pn();const oe=i.useRef(r?.transaction);oe.current=r?.transaction;const Ke=r?.transactionDetailUpdateStatus?.fetchState,x=fn(Ke,(()=>{const m=[];if(oe.current!=null)for(const se of oe.current.lines??[])"account"in se&&se.account?.accountId!=null&&m.push(se.account.accountId);return m}));i.useEffect((()=>{E!=null&&r!=null&&r.fetchState==="Not-Started"&&(e(Oe(E,!1)),ye())}),[e,E,r?.fetchState]),i.useEffect((()=>{if(E!=null&&r?.fetchState==="Error"){const m=re(o.state?.pathnameStackToGoBack,o.pathname);t("page-not-found",{replace:!0,state:Te?{pathnameStackToGoBack:m,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:m,message:"pageNotFound",origin:"transaction_detail"}})}}),[E,r?.fetchState,t,o.state,o.pathname,Te]),i.useEffect((()=>{He||r==null||r.transaction==null||(e(Ue({id:r.transaction.id,type:r.transaction.type})),he(!0));const m=o.state?.searchContext;b==null&&r?.fetchState==="Completed"&&ke(r?.transaction,m),b!=null&&(!c||d&&f===!1)&&(We?qe||R==null||(Se(!0),e(me(b,"TransactionDetail",{timeframe:"month",timePeriod:ne?.selectedPeriod?.timePeriod??R}))):(e(de()),e(ue()),ke(r?.transaction,m),fe(!0),e(Ve(b))))}),[r?.fetchState,r?.transaction,R,c]),i.useEffect((()=>{Z.newVendorState?.vendorDetailLocalData?.vendorName!=null?v(!0):v(!1)}),[Z.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{e(G("common"))}),[]);const Qe=[l,u].filter((m=>m!=null)),{transactionId:be,onSaveVendor:et,onSaveSuccess:tt,onCancel:nt}=In({closeDrawerHandler:m=>{v(!1),t(m?"../":"../..")}}),{isAiCfoAccessEnabled:at,onAskAiCfoClick:ot}=cn({mobileExploreReferrer:"Transaction Details"});return Jt({isDataReady:r?.fetchState==="Completed"}),T?_.jsxs(_.Fragment,{children:[be!=null&&y&&_.jsx(yn,{isOpen:y,transactionId:be,onSaveVendor:et,onSaveSuccess:tt,onCancel:nt}),_.jsx(Kt,{toolkit:L,children:_.jsx(vn,{hideDeleteAttachment:!0,firstMonthOfFY:ae,isDisabled:r?.transaction?.type==="transfer"&&a?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:p,location:o,navigate:t,selectedTransaction:E,entity:b,isCOTEnabled:C,defaultTrendTransactionTimePeriod:R,resetTrendIsFetchedStates:ye,transaction:r?.transaction,uncategorizedAccounts:z,vendorSaveStatus:I,isVendorBulkUpdateOnTransactionEnabled:S,isCreateTransferEntryFromExpenseEnabled:V,isExpenseAutomationEnabled:D,isAiCfoAccessEnabled:at,onAskAiCfoClick:ot,isProjectsTransactionsEnabled:B,isTransactionSplitEnabled:O,companyId:Y,companyName:X,initialOpenThreadRequest:N})}),U,x.showPopup&&x.popupType!=null&&_.jsx(Qt,{popupType:x.popupType,currencySymbol:x.currencySymbol,accountId:x.popupAccountId??"",accountName:x.popupAccountName??"",onSubmit:x.handleSubmit,onDismiss:x.handleDismiss})]}):_.jsx(ct,{to:Xe(Qe.length)})}const Xe=(t=2)=>{let e="../";for(let o=0;o<t;o++)e=`${e}../`;return e},ke=(t,e)=>{if(t!=null){const{transactionCategory:o,transactionClass:n}=En(t),a=kn(t);$.trackTransactionDetails(t.account?.accountId,t.account?.accountName,t.id,a,o.length>0?o:void 0,n.length>0?n:void 0,t.type,t.amount,t.memo,t.lines?.length??0,t.attachments?.map((s=>s.fileName)),e!=null?"Search":void 0,e?.searchTerm,e?.resultPosition,e?.resultsCount,e!=null?"search":void 0)}},En=t=>{const e=[],o=[];return t.lines?.forEach((n=>{switch(n.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=n;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}},kn=t=>bt(t)===!0?t.customer?.name??"":gt(t)===!0?t.vendor?.name??"":t.memo!=null?t.memo:t.type;export{yn as C,zn as T,Nn as a,Sn as b,fn as c,In as d,vn as e,gn as f,pe as g,bn as h,On as i,ke as l,Bn as r,pn as u};
@@ -1,37 +0,0 @@
1
- import{j as e}from"./liveblocks-V5YQZeeY.js";import{h as L,g as P,u as U,i as V,j as y,N as D,l as M,n as xe,o as k}from"./core-BWRpGVdr.js";import{ct as _,fE as v,_g as F,P0 as ae,OJ as H,OK as ne,_i as Ie,P3 as Te,_e as we,_f as se,_u as Ce,N4 as ke,CA as je,_k as Ae,Pa as be,_h as re,db as Z,Hb as oe,dY as Ee,dZ as ve,a0F as De,a0G as Le,OL as Pe,a0H as Ue,OM as Fe,OV as Be,bm as Re,bH as Oe,cE as Ve,bI as Me,cs as _e,bq as Ne,U$ as ze,cr as $e}from"./zeni-epic-state-BlWDBO75.js";import{V as N,l as Ge,z as E,a7 as z,m as A,d7 as He,d8 as Ze,d9 as G,a0 as q,ap as qe,ar as We,p as ie,c as O,aa as Je,a6 as Ke,da as Ye,ad as W,n as Qe,db as Xe,a3 as J,dc as et,ah as tt,_ as Q,dd as at,j as nt}from"./index-9pdMsp-M.js";import{u as st,D as rt,n as R,S as ot}from"./mui-BmHHlwSU.js";import it from"./NotFoundScreen-C94S-cmy.js";import{S as X}from"./SetupPagesScreen-DPnnq4jj.js";import{a as p}from"./sentry-bpmZUW7k.js";import{u as ct}from"./useAskAiCfoHostNavButtonProps-E2UGdnp9.js";import{u as lt}from"./useInitialThreadRequest-Df-inltN.js";import{M as ce}from"./MobileAppDrawer-rCVKr3J3.js";import{F as ut}from"./FeaturePreviewScreen-B9UACzAC.js";import{a as ee}from"./analyticsHelper-Cn2rORl_.js";import"./recharts-BXLxGQ-T.js";import"./analytics-BfKlFVdJ.js";import"./plaid-CNV6JDhi.js";import"./dnd-wLfPcqQ_.js";import"./stripe-cKAAJElX.js";import"./lottie-ByqRhfis.js";import"./lexical-ljfsYSTd.js";import"./pdf-C42gprG9.js";import"./utils-CXFQdt3d.js";import"./BusinessVerificationPageScreen-71JxUYXB.js";import"./routePaths--TXDBUUo.js";import"./InboxNotificationsProvider-Cd4NxEtR.js";import"./useTaskManagerAccess-Bq9TDvwr.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]="41e077ed-dd85-4781-b3dd-b757509a833b",t._sentryDebugIdIdentifier="sentry-dbid-41e077ed-dd85-4781-b3dd-b757509a833b")}catch{}})();const dt=M((function(t,a){const{companyId:n}=a;return{treasurySetupView:F(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(Te(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(Ie(r))}}}))(He);function pt(){const t=L(),a=P(),n=U(),{tenantEmailDomain:o}=V(),i=N(),r=y((w=>w.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState)),m=Ge(r),s=_(i?.loggedInUserRoleMap),[d,c]=p.useState(!1),[h,I]=p.useState(!1),[l,u]=p.useState(!1),x=y((w=>v(w))),f=E.getSignedInUserTenant(o)?.companyId??x.companyId,C=E.getSignedInUser(),S=y((w=>F(w,f))),g=y((w=>w.treasurySetupViewState.fetchState)),j=y((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),T=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||T!=="Not-Started"||f==null||(u(!0),n(H()))}),[l,T,f,n]),p.useEffect((()=>{h||j!=="Not-Started"||f==null||(I(!0),n(ne()))}),[h,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 B=x.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||g!=="Completed";return e.jsxs(e.Fragment,{children:[!B&&e.jsx(z,{analytics:A,onLoad:()=>{}}),e.jsx(dt,{navigate:t,location:a,companyId:f,isEditMode:!0,isLoading:B,isReadOnly:!s,treasurySetupView:S,analytics:A})]})}const mt=M((function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:Ce(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:F(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(be())},onSaveChangesToLocalStore:s=>{t(Ae(s))},onFetchLinkTokenClick:s=>{t(je("treasury_setup",s))},onEstablishConnectionClick:s=>{t(ke(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}}))(Ze),ft=({isFirstTransfer:t,isTransactionsLoaded:a})=>{const n=L(),{tenantEmailDomain:o}=V(),i=U(),[r,m]=p.useState(!1),[s,d]=p.useState(!1),[c,h]=p.useState(!1),[I,l]=p.useState(!1),u=y((T=>T.treasurySetupViewState.fetchState)),x=y((T=>T.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),f=y((T=>T.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),C=y((T=>v(T))),S=E.getSignedInUserTenant(o)?.companyId??C.companyId,g=y((T=>we(T))),j=y((T=>F(T,S)));if(E.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect((()=>{s||u!=="Not-Started"||S==null||(d(!0),i(ae(S,!0,!1)))}),[s,u,S,i]),p.useEffect((()=>{c||x!=="Not-Started"||S==null||(h(!0),i(H()))}),[c,x,S,i]),p.useEffect((()=>{I||f!=="Not-Started"||S==null||(l(!0),i(ne()))}),[I,f,S,i]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:A,onLoad:()=>{}}),e.jsx(mt,{analytics:A,navigate:n,transferDetails:g,onAnotherTransferClick:()=>{m(!1),i(se())},currentTenant:C,treasurySetupView:j,showReviewContent:r,maxInsuredAmount:5e5,onReviewClick:()=>{G(A,"review",g.treasuryTransferMoneyLocalData,j.fundAllocationLocalData,"Transfer"),m(!0)},isFirstTransfer:t,isTransactionsLoaded:a,setShowReviewContent:m,onBackClick:()=>{}})]})},yt=R.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: ${t=>t.theme.colors.grey4};
9
- `,gt={overlayWidth:new Je(100,100,48)},ht=M((function(t,a){const n=re(t),{companyId:o}=a;return{treasuryDetail:n,treasurySetupView:F(t,o),downloadEndPoint:`${W.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=St(s):d==="statements"?c=xt(s):d==="taxLetter"?c=It(s):d==="settings"&&(c=Tt(s));const h=Qe(i.state?.pathnameStackToGoBack,i.pathname);n(c,{state:{pathnameStackToGoBack:h}})},onColumnSortConfigChanged:(d,c)=>{t(De({uiState:{sortKey:d,sortOrder:c}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{r(!0)},onAutoTransferClick:()=>{n("../../checking/auto-transfer")}}}))(Ye);function $({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=P(),o=L(),i=U(),r=q(),m=st(),s=y((b=>v(b))),{tenantEmailDomain:d}=V(),c=s.companyId??E.getSignedInUserTenant(d)?.companyId,[h,I]=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",S=N(),g=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,j=_(S?.loggedInUserRoleMap),T=Z(S?.loggedInUserRoleMap),{areTenantIdsInSync:B}=qe();p.useEffect((()=>{u==="Not-Started"&&!h&&B&&(I(!0),i(oe(!0)))}),[h,i,u,B]),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),K=b=>{ue(b)},{isAiCfoAccessEnabled:de,onAskAiCfoClick:pe}=ct({mobileExploreReferrer:"Treasury"});We({isDataReady:u==="Completed"});const{useFeatureGate:Y}=ie(),{isFeatureEnabled:me}=Y(O.isDebitCardFeatureEnabled),{isFeatureEnabled:fe}=Y(O.isAutoTransferRuleEnabled),ye=lt(c,{clearParams:u==="Completed"&&f?.fetchState==="Completed"}),ge=Ee(s),he=ve(me,s);if(ge===!0&&he!==!0)return e.jsx(ut,{});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(rt,{onClose:w,anchor:"right",open:a||t,transitionDuration:250,PaperProps:{style:{width:gt.overlayWidth.valuePercentage(r),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:m.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsxs(wt,{onClick:Se=>Se.stopPropagation(),children:[t===!0?e.jsx(ft,{isFirstTransfer:l.transactions.length===0||x===0,isTransactionsLoaded:l.transactionsFetchState.fetchState!=="In-Progress"&&l.transactionsFetchState.fetchState!=="Not-Started"}):null,a===!0?e.jsx(pt,{}):null]})}),e.jsxs(yt,{windowSize:r,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:K}),e.jsx(ht,{treasuryDetailsView:l,isAutoTransferRuleEnabled:fe,navigate:o,currentTenant:s,location:n,companyId:c,analytics:A,handleDrawerToggle:K,initialOpenThreadRequest:ye,isLoading:b,isAiCfoAccessEnabled:de,onAskAiCfoClick:pe})]})]})}return g&&j?e.jsx(D,{to:"../setup"}):s.companyTreasuryInfo?.info&&!g&&T?e.jsx(D,{to:"../promo",state:n.state}):e.jsx(Ke,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})}const St=t=>`/${t}/treasury/edit-portfolio`,xt=t=>`/${t}/treasury/statements`,It=t=>`/${t}/treasury/tax-letter`,Tt=t=>`/${t}/treasury/setup`,wt=R(ot)`
10
- display: flex;
11
- min-height: 100%;
12
- flex-direction: column;
13
- `,Ct=R.div`
14
- display: flex;
15
- height: 100vh;
16
- width: 100%;
17
- flex: 1 1 auto;
18
- flex-direction: column;
19
- align-items: center;
20
- background-color: ${t=>t.theme.colors.grey4};
21
- `;function kt(){const t=L(),a=U(),n=q(),o=P(),i=`${W.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=p.useState(!1),s=y((u=>Le(u)));p.useEffect((()=>{r||s.fetchState!=="Not-Started"||(m(!0),a(Pe(!1)))}),[r,s.fetchState,a]);const d=E.getSignedInUser(),c=y((u=>v(u))),h={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:c.tenantId??""},I=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(Ct,{windowSize:n,children:e.jsx(Xe,{currentTenantCompanyName:I,statementListView:s,isLoading:l,onBackClick:()=>{const u=J(o.state?.pathnameStackToGoBack),x=u.poppedPathname??"..";t(x,{state:{pathnameStackToGoBack:u.newStack}})},authParams:h,downloadEndPoint:i})})}const jt=R.div`
22
- display: flex;
23
- height: 100vh;
24
- width: 100%;
25
- flex: 1 1 auto;
26
- flex-direction: column;
27
- align-items: center;
28
- background-color: ${t=>t.theme.colors.grey4};
29
- `;function At(){const t=L(),a=q(),n=P(),o=U(),i=`${W.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=p.useState(!1),s=y((u=>Ue(u)));p.useEffect((()=>{r||s.fetchState!=="Not-Started"||(m(!0),o(Fe(!1)))}),[r,s.fetchState,o]);const d=E.getSignedInUser(),c=y((u=>v(u))),h={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:c.tenantId??""},I=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(jt,{windowSize:a,children:e.jsx(et,{currentTenantCompanyName:I,taxLetterListView:s,isLoading:l,onBackClick:()=>{const u=J(n.state?.pathnameStackToGoBack),x=u.poppedPathname??"..";t(x,{state:{pathnameStackToGoBack:u.newStack}})},authParams:h,downloadEndPoint:i})})}const bt=M((function(t,a){const{companyId:n}=a,o=F(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(Be(o))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:i=>{n(i?"..":"../setup",{relative:"path"})}}}))(at),Et=()=>{const t=tt(),a=L(),n=P(),o=U(),{tenantEmailDomain:i}=V(),[r,m]=p.useState(!1),s=y((g=>v(g))),[d,c]=p.useState(!1),h=y((g=>g.treasurySetupViewState.treasuryFundsDetails?.fetchStatus));p.useEffect((()=>{d||h?.fetchState!=="Not-Started"||I==null||(c(!0),o(H()))}),[h,o]);const I=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=N(),C=_(f?.loggedInUserRoleMap),S=Z(f?.loggedInUserRoleMap);if(u&&C)return e.jsx(D,{to:"../../treasury/setup"});if(s.company?.companyTreasuryInfo&&(!u&&C||S)){if(n.state?.message==="activation"){const g=J(n.state?.pathnameStackToGoBack);a(n.pathname,{state:{...n.state,message:void 0,pathnameStackToGoBack:g.newStack}})}return h?.fetchState!=="Completed"?e.jsx(te,{children:e.jsx(Q,{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(bt,{analytics:A,navigate:a,companyId:I,meetingUrl:t("treasury_promo"),onClickMenuIcon:()=>{x(!0)}})]})}return e.jsx(te,{children:e.jsx(Q,{size:"ExtraLarge",start:!0})})},te=R.div`
30
- display: flex;
31
- width: 100%;
32
- height: 100%;
33
- flex-direction: row;
34
- justify-content: center;
35
- align-items: center;
36
- background-color: ${t=>t.theme.colors.grey5};
37
- `;function ta(){const t=P(),a=y((g=>v(g))),{useFeatureGate:n}=ie(),o=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",i=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,r=N(),m=Z(r?.loggedInUserRoleMap),s=a?.userRole!=null&&Re(a?.userRole),d=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!s)&&Oe(r?.loggedInUserRoleMap),c=Ve(r?.loggedInUserRoleMap),h=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!s)&&Me(r?.loggedInUserRoleMap),I=!!a.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!s&&_e(r?.loggedInUserRoleMap),l=o&&!s&&_(r?.loggedInUserRoleMap),{isFeatureEnabled:u}=n(O.isChargeCardFeatureEnabled),{isFeatureEnabled:x}=n(O.isDebitCardFeatureEnabled),f=nt(a,u,x)&&!s&&Ne(r?.loggedInUserRoleMap),C=ze(r?.loggedInUserRoleMap),S=$e(r?.loggedInUserRoleMap);return e.jsxs(xe,{children:[S?null:e.jsx(k,{path:"setup",element:e.jsx(X,{isBillPayAdminLevelAccess:d,isReimbursementAdminLevelAccess:h,isZeniAccountAdminLevelAccess:I,isChargeCardAdminLevelAccess:f,isTreasuryAdminLevelAccess:l,isUserHasOnlyCardAccess:C,isUserHasOnlyBillPayAccess:c,productType:"zeni_treasury",type:"setup"})}),S?null:e.jsx(k,{path:"verification",element:e.jsx(X,{isBillPayAdminLevelAccess:d,isUserHasOnlyBillPayAccess:c,isReimbursementAdminLevelAccess:h,isZeniAccountAdminLevelAccess:I,isChargeCardAdminLevelAccess:f,isTreasuryAdminLevelAccess:l,isUserHasOnlyCardAccess:C,productType:"zeni_treasury",type:"verification"})}),e.jsx(k,{path:"promo",element:e.jsx(Et,{})}),e.jsx(k,{path:"statements",element:e.jsx(kt,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(At,{})}),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(it,{})})]}):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{ta as default};
@@ -1,12 +0,0 @@
1
- import{j as o}from"./liveblocks-V5YQZeeY.js";import{a as f}from"./sentry-bpmZUW7k.js";import{t as u,u as h,j as y,N as I}from"./core-BWRpGVdr.js";import{Vh as b,gh as w,K4 as j}from"./zeni-epic-state-BlWDBO75.js";import{z as c,a6 as x,ae as S,af as D}from"./index-9pdMsp-M.js";import{n as l}from"./mui-BmHHlwSU.js";import"./recharts-BXLxGQ-T.js";import"./analytics-BfKlFVdJ.js";import"./plaid-CNV6JDhi.js";import"./dnd-wLfPcqQ_.js";import"./stripe-cKAAJElX.js";import"./lottie-ByqRhfis.js";import"./lexical-ljfsYSTd.js";import"./pdf-C42gprG9.js";import"./utils-CXFQdt3d.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4fc70042-4ce6-470d-9b59-9485f01cc947",e._sentryDebugIdIdentifier="sentry-dbid-4fc70042-4ce6-470d-9b59-9485f01cc947")}catch{}})();const A=()=>{const[e]=u(),t=e.get("code")??"",s=e.get("state")??"",g=e.get("profileId")??"",[n,p]=f.useState(!1),a=h(),i=y((m=>b(m))),r=c.getSignedInUser(),d=c.getSignedInUserTenantWithId(s);if(r==null||d==null)return o.jsx(I,{to:"/signin/auth",replace:!0});if(r==null)throw Error("Can't access this page without signing in...");return w(r.userId,r.zeniSessionId,d?.tenantId),f.useEffect((()=>{n||(p(!0),a(j(t,g,s)))}),[n,a]),i.fetchState==="Error"?o.jsx(E,{children:o.jsx(_,{children:i.error?.message??""})}):(i.fetchState==="Completed"&&window.close(),o.jsx(x,{fetchState:"In-Progress"}))},E=l.div`
2
- display: flex;
3
- width: 100%;
4
- height: 100vh;
5
- flex-direction: row;
6
- justify-content: center;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey5};
9
- `,_=l(D.LargeRegular)`
10
- display: flex;
11
- color: ${S.important};
12
- `;export{A as default};
@@ -1,9 +0,0 @@
1
- import{j as i}from"./liveblocks-V5YQZeeY.js";import{a as f}from"./sentry-bpmZUW7k.js";import{h as x,u as T,g as $,i as E,j as p}from"./core-BWRpGVdr.js";import{T$ as s,T_ as j,a0D as v,fE as B,a0E as C}from"./zeni-epic-state-BlWDBO75.js";import{a0 as D,ad as g,z,a6 as L,d6 as P,a3 as _}from"./index-9pdMsp-M.js";import{u as N,n as U}from"./mui-BmHHlwSU.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]="853cc6dc-5d55-4a4a-902e-2ec8bde98755",e._sentryDebugIdIdentifier="sentry-dbid-853cc6dc-5d55-4a4a-902e-2ec8bde98755")}catch{}})();const G=U.div`
2
- display: flex;
3
- height: 100vh;
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
- `;function H(){const e=x(),n=T(),d=D(),l=$();let{accountId:a}=E(),u=`${g.bankingMicroServiceBaseUrl}/1.0/deposit-accounts/${a}`;a==null&&l.pathname.includes(`${s}/statements`)&&(a=s,u=`${g.bankingMicroServiceBaseUrl}/1.0/${s}`);const[m,h]=f.useState(!1),y=N();f.useEffect((()=>{m||(h(!0),n(j(a??"",!1)))}),[m,n]);const o=p((t=>v(t,a??""))),I=()=>{const t=_(l.state?.pathnameStackToGoBack),S=t.poppedPathname??"..";e(S,{state:{pathnameStackToGoBack:t.newStack}})},c=z.getSignedInUser(),r=p((t=>B(t))),b={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:r.tenantId??""},w=C(a??"")===!0?s:o.zeniAccountDetail?.accountLast4??"",k=r.company?.companyInfo.companyLegalName??r.companyName;if(c==null)throw Error("Can't access address page without signing in...");return o.fetchState!=="Completed"?i.jsx(L,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}}):i.jsx(G,{windowSize:d,children:i.jsx(P,{currentTenantCompanyName:k,statementListView:o,accountLast4:w,onBackClick:I,authParams:b,downloadEndPoint:u})})}export{H as Z};