@zeniai/web-app-ui 5.1.97-prod → 5.1.98-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 (122) hide show
  1. package/dist/assets/AddressRoutes-Up5IwqQs.js +1 -0
  2. package/dist/assets/{AddressScreen-Du-97i19.js → AddressScreen-UxWcRZmy.js} +2 -2
  3. package/dist/assets/{AiCfoScreen-DTvxXnCI.js → AiCfoScreen-BF05qSzR.js} +2 -2
  4. package/dist/assets/{BillPayApprovalRoutes-DsVLcKpn.js → BillPayApprovalRoutes-D-GuovwH.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-Cixo1SNn.js → BillPayRoutes-DrOfY-VV.js} +10 -10
  6. package/dist/assets/{BusinessVerificationPageScreen-CzQ1lRn0.js → BusinessVerificationPageScreen-B2HhT9ni.js} +2 -2
  7. package/dist/assets/{CardsAiCfoScreen-BVaM35VP.js → CardsAiCfoScreen-BPXCnKpZ.js} +1 -1
  8. package/dist/assets/{ChargeCardRoutes-CkjrUh1h.js → ChargeCardRoutes-CWdtg6YK.js} +6 -6
  9. package/dist/assets/CompanyPassportScreen-x21Ap6N1.js +1 -0
  10. package/dist/assets/{ConnectionAuthScreen-MwI0oWAt.js → ConnectionAuthScreen-ge2sUVoY.js} +1 -1
  11. package/dist/assets/CustomerOnboardingAuthScreen-BIMtfZH9.js +1 -0
  12. package/dist/assets/{CustomerOnboardingRoutes-CIZUzVCA.js → CustomerOnboardingRoutes-DqDGjNdb.js} +4 -4
  13. package/dist/assets/{DashboardRoutes-B58SA_3r.js → DashboardRoutes-Cgw_iCM3.js} +4 -4
  14. package/dist/assets/{DefaultTenantHome-BZfE3HMq.js → DefaultTenantHome-CR0_CXQW.js} +1 -1
  15. package/dist/assets/DomesticWireDetailScreen-C2GdXtSa.js +18 -0
  16. package/dist/assets/DrawerScreen-B3cQzzUP.js +1 -0
  17. package/dist/assets/{EntityDetailRoutes-D4aBY2Gt.js → EntityDetailRoutes-CpurlHtH.js} +1 -1
  18. package/dist/assets/{ExpenseAutomationRoutes-CB8jlVuS.js → ExpenseAutomationRoutes-BGX8NlRB.js} +1 -1
  19. package/dist/assets/FeaturePreviewScreen-CMZ336vr.js +1 -0
  20. package/dist/assets/{HubSpotOAuthCallbackScreen-BDcKQbNn.js → HubSpotOAuthCallbackScreen-CZAmJj_d.js} +1 -1
  21. package/dist/assets/{MagicLinkRoutes-CYB9vxcB.js → MagicLinkRoutes-BDaLfAq1.js} +9 -9
  22. package/dist/assets/MagicLinkSignInScreen-DEG2WA_h.js +12 -0
  23. package/dist/assets/{MobileAppDrawer-DykdYSpc.js → MobileAppDrawer-BmpM5OEl.js} +1 -1
  24. package/dist/assets/NotFoundScreen-Dzg5zRVC.js +1 -0
  25. package/dist/assets/{NotificationRoutes-DIjJ5TOx.js → NotificationRoutes-BNb1ZPKE.js} +1 -1
  26. package/dist/assets/OAuthConsentScreen-D_0djnco.js +1 -0
  27. package/dist/assets/{PandLWithForecastRoutes-tUGSr_ZD.js → PandLWithForecastRoutes-cuWrGpLk.js} +1 -1
  28. package/dist/assets/PeopleRoutes-C4qepWZ_.js +22 -0
  29. package/dist/assets/PerformanceRoutes-BzhzpXd0.js +1 -0
  30. package/dist/assets/{Preview-Du-bdias.js → Preview-BOuT-_53.js} +1 -1
  31. package/dist/assets/{QBOConnectionScreen-CUpVGX5k.js → QBOConnectionScreen-lQslhLmS.js} +1 -1
  32. package/dist/assets/ReferralListScreen-BieHflTg.js +5 -0
  33. package/dist/assets/{ReimbursementApprovalRoutes-CaPbnBcf.js → ReimbursementApprovalRoutes-BhxstoNC.js} +1 -1
  34. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DbRpFLeK.js → ReimbursementApprovalRuleDetailScreen-CkEZJXQa.js} +1 -1
  35. package/dist/assets/{ReimbursementRoutes-BtHianla.js → ReimbursementRoutes-92SGBZZl.js} +4 -4
  36. package/dist/assets/{ReportsRoutes-KWai2NUA.js → ReportsRoutes-a54YeLvu.js} +1 -1
  37. package/dist/assets/RewardsRoutes-0DC-adXs.js +1 -0
  38. package/dist/assets/{ScreenRoutes-kNvSX_Sm.js → ScreenRoutes-BlNv4YIY.js} +2 -2
  39. package/dist/assets/{SettingsRoutes-Dl04oqwE.js → SettingsRoutes-C6UHiixM.js} +7 -7
  40. package/dist/assets/{SetupPagesScreen-CKP0m0tv.js → SetupPagesScreen-DdbFAdHb.js} +5 -5
  41. package/dist/assets/SignInScreen-HAlIOIjn.js +1 -0
  42. package/dist/assets/SignOutScreen-DW1gUCGz.js +9 -0
  43. package/dist/assets/{TaskListScreen-Dc1EjpII.js → TaskListScreen-B9eSStzs.js} +2 -2
  44. package/dist/assets/{TaskRoutes-XpfuMU1J.js → TaskRoutes-BZqNTas-.js} +2 -2
  45. package/dist/assets/{TransactionDetailRoutes-zxVAFgZ5.js → TransactionDetailRoutes-BXo-56fO.js} +1 -1
  46. package/dist/assets/{TransactionDetailScreen-63KieL8T.js → TransactionDetailScreen-jnjIQhYw.js} +2 -2
  47. package/dist/assets/{TransactionListRoutes-B3jKMEvN.js → TransactionListRoutes-BYb7ohjf.js} +1 -1
  48. package/dist/assets/{TreasuryRoutes-k4zHQ9eI.js → TreasuryRoutes-D_Nc2Thq.js} +5 -5
  49. package/dist/assets/{VendorsRoutes-Bjqg3Qse.js → VendorsRoutes-BW-uHhrx.js} +12 -12
  50. package/dist/assets/WiseConfirmationScreen-D1PZo18h.js +12 -0
  51. package/dist/assets/{ZeniAccountRoutes-maEHkrzk.js → ZeniAccountRoutes-BiCibze4.js} +8 -8
  52. package/dist/assets/{ZeniAccountStatementScreen-CD0jWkqM.js → ZeniAccountStatementScreen-BrNKBtSn.js} +2 -2
  53. package/dist/assets/{accountMappingHelper-C84ncZve.js → accountMappingHelper-LYbX13CN.js} +1 -1
  54. package/dist/assets/{analytics-BFERaNq_.js → analytics-C32tZaP0.js} +1 -1
  55. package/dist/assets/{analyticsHelper-CxUZWq8h.js → analyticsHelper-DtQFmi0e.js} +1 -1
  56. package/dist/assets/{core-EpiYd0dH.js → core-BEqwGbSx.js} +1 -1
  57. package/dist/assets/{decodeURIComponentSafe-IenY_Kah.js → decodeURIComponentSafe-DTCbLY6J.js} +1 -1
  58. package/dist/assets/{dnd-B4UwQr13.js → dnd-aedH_7an.js} +1 -1
  59. package/dist/assets/{empty-COx6eDQQ.js → empty-CTT5XurM.js} +1 -1
  60. package/dist/assets/{empty-DLJQl4LQ.js → empty-DaJrG0iL.js} +1 -1
  61. package/dist/assets/{emptyVideoElement-C12GVRF-.js → emptyVideoElement-BbF1KvUh.js} +1 -1
  62. package/dist/assets/epic-DAvRZRKw.js +2 -0
  63. package/dist/assets/getLocaleForTenant-CPQG2FZU.js +1 -0
  64. package/dist/assets/{index-B10X3pcb.js → index-54sgiomr.js} +2 -2
  65. package/dist/assets/{index-pQRSpyuH.js → index-BHmbllBx.js} +1 -1
  66. package/dist/assets/{index-DPEysLPv.js → index-BV2hYWmb.js} +1 -1
  67. package/dist/assets/{index-PtlNydxQ.js → index-CIHRBtr6.js} +1 -1
  68. package/dist/assets/{index-PhOkXSWB.js → index-Ctjlt8lG.js} +1 -1
  69. package/dist/assets/{index-CtdTfMzT.js → index-DD5A7mJH.js} +13722 -13708
  70. package/dist/assets/{index-CyK2Gcxx.js → index-DgEagwC7.js} +1 -1
  71. package/dist/assets/{index-OONpG3iT.js → index-hKu4f1iJ.js} +1 -1
  72. package/dist/assets/{lexical-BRwXCMXC.js → lexical-Dk1uI_nN.js} +1 -1
  73. package/dist/assets/{liveblocks-Cml8Dky9.js → liveblocks-CI520bHO.js} +1 -1
  74. package/dist/assets/{lottie-s8xCOGnE.js → lottie-0YTaCosS.js} +1 -1
  75. package/dist/assets/{mui-B9DMc10H.js → mui-6WrS_ojW.js} +1 -1
  76. package/dist/assets/{pathToGoBack-DH_6EPoW.js → pathToGoBack-DZgL3eGt.js} +1 -1
  77. package/dist/assets/{pdf-EVuEk9_o.js → pdf-XPdZ15Zh.js} +3 -3
  78. package/dist/assets/{pdf-lib-CvBA5q_E.js → pdf-lib-DImtf-Hd.js} +1 -1
  79. package/dist/assets/{plaid-B2cdYw6c.js → plaid-BwgJPT1f.js} +1 -1
  80. package/dist/assets/{pusher-DKFvVWJF.js → pusher-vO-vyZDC.js} +1 -1
  81. package/dist/assets/{react-B33JvX2B.js → react-CSZBa4ot.js} +1 -1
  82. package/dist/assets/{react-z7c2a6D9.js → react-CoNtbOCQ.js} +1 -1
  83. package/dist/assets/{react-Cm4VjhSH.js → react-DgrHNyrR.js} +1 -1
  84. package/dist/assets/{react-uH85VOSc.js → react-MpBkihu9.js} +1 -1
  85. package/dist/assets/{react-DmIef_t6.js → react-S4diJ2jH.js} +1 -1
  86. package/dist/assets/{react-mFi1XeVx.js → react-bA_ZDfL5.js} +1 -1
  87. package/dist/assets/{recharts-Ct1VSQ_u.js → recharts-HPhXmfTv.js} +1 -1
  88. package/dist/assets/{routePaths-BA6bWJ0d.js → routePaths-BEczkE7A.js} +1 -1
  89. package/dist/assets/{sentry-Bv_CMTdO.js → sentry-B9QSZuyZ.js} +1 -1
  90. package/dist/assets/{url-R7bp5PtC.js → url-45TnfvPl.js} +1 -1
  91. package/dist/assets/{url-CBpyhPBC.js → url-toWtB1hu.js} +1 -1
  92. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-CIioFz4b.js → useAiCfoDashboardSuggestedQuestionsChips-DmLt0ng2.js} +1 -1
  93. package/dist/assets/useAskAiCfoHostNavButtonProps-BGHggyph.js +1 -0
  94. package/dist/assets/{useCashManagementBanner-BykprQ5N.js → useCashManagementBanner-CjSG1LM_.js} +1 -1
  95. package/dist/assets/{useChargeCardPusherEvents-BLJeyGNT.js → useChargeCardPusherEvents-CXqYtiJS.js} +1 -1
  96. package/dist/assets/{useDeviceId-DxYsYa_A.js → useDeviceId-BeyVLeTd.js} +1 -1
  97. package/dist/assets/{useEmailConnectResultRefresh-DAylHZBG.js → useEmailConnectResultRefresh-DvejkSG7.js} +1 -1
  98. package/dist/assets/{useInitialThreadRequest-CxvsW_2d.js → useInitialThreadRequest-CqJaxo92.js} +1 -1
  99. package/dist/assets/{utils-CpecgzlM.js → utils-7NyLmgtg.js} +1 -1
  100. package/dist/assets/{withTransactionSidePanel-Bbjo5aqK.js → withTransactionSidePanel-CgEEpbzu.js} +1 -1
  101. package/dist/assets/{zeni-epic-state-Dms0qEHD.js → zeni-epic-state-DDiwMHXL.js} +4 -4
  102. package/dist/index.html +1 -1
  103. package/package.json +3 -3
  104. package/dist/assets/AddressRoutes-Dc-8kEgF.js +0 -1
  105. package/dist/assets/CompanyPassportScreen-D6jYLDF2.js +0 -1
  106. package/dist/assets/CustomerOnboardingAuthScreen-DpdFe28I.js +0 -1
  107. package/dist/assets/DomesticWireDetailScreen-CC3PuPoP.js +0 -18
  108. package/dist/assets/DrawerScreen-BwpxQsSs.js +0 -1
  109. package/dist/assets/FeaturePreviewScreen-BakX_uqy.js +0 -1
  110. package/dist/assets/MagicLinkSignInScreen-BoKjABFB.js +0 -12
  111. package/dist/assets/NotFoundScreen-De6kOHv9.js +0 -1
  112. package/dist/assets/OAuthConsentScreen-aNY0UGa0.js +0 -1
  113. package/dist/assets/PeopleRoutes-DU6z-anW.js +0 -22
  114. package/dist/assets/PerformanceRoutes-Cblt21EZ.js +0 -1
  115. package/dist/assets/ReferralListScreen-C9AlCRQ0.js +0 -5
  116. package/dist/assets/RewardsRoutes-Y97qvuPJ.js +0 -1
  117. package/dist/assets/SignInScreen-Dpl9nGEq.js +0 -1
  118. package/dist/assets/SignOutScreen-BkxbwF2v.js +0 -9
  119. package/dist/assets/WiseConfirmationScreen-DGFDCODT.js +0 -12
  120. package/dist/assets/epic-CHrm7yJa.js +0 -2
  121. package/dist/assets/getLocaleForTenant-BMU__UL3.js +0 -1
  122. package/dist/assets/useAskAiCfoHostNavButtonProps--zCkzMi3.js +0 -1
@@ -1 +1 @@
1
- import{j as b}from"./liveblocks-Cml8Dky9.js";import{a as f}from"./sentry-Bv_CMTdO.js";import{u as T,j as g,h as _,g as O,i as F,n as k}from"./core-EpiYd0dH.js";import{kZ as Q,Qz as w,Qj as U,Fy as V,FK as B,FF as A,FG as E,QA as j,eX as z,FE as K}from"./zeni-epic-state-Dms0qEHD.js";import{z as N,y as P,B as $,bR as G,ag as q,bE as W,bS as X}from"./index-CtdTfMzT.js";import"./mui-B9DMc10H.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="cf6a2b7b-b5b2-46ff-911a-a0af2f401f65",e._sentryDebugIdIdentifier="sentry-dbid-cf6a2b7b-b5b2-46ff-911a-a0af2f401f65")}catch{}})();function Z(){const e=T(),s=f.useRef(!1),t=g(o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started"),p=g(o=>o.vendorListState.allVendorIdsBillsTab.length>0);f.useEffect(()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(Q({})))},[p,t,e])}const H=k(function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return s.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===s.approvalRuleId)===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:l,approvalUpdateActionType:p}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const h=[];return v.forEach(u=>{const R=u.actors.selectedUsers.map(m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1})),I=u.actors.selectedNonUsers.map(m=>{const y=(S=m.value,j(S)==null);var S;return{type:y?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!y}}),c=R.concat(I);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:l,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}})(G);function J(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=F(),o=N.getSignedInUser(),l=P(),r=g(n=>w(n)),i=g(n=>U(n)),[a,d]=f.useState(!1);if(f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?b.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):b.jsx(H,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return j(e)==null}const M=k(function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],l={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),l[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:l,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:U(e).allApprovalRules}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach(y=>{const S=y.actorKind?.selectedOption,x=y.selectedRole?.selectedOption;let D=[];S==="role"&&x!=null?D=[{type:"attribute",subType:x,userId:void 0,idType:void 0,isImplicitActor:!1}]:S==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map(L=>({type:"user",subType:void 0,userId:L.userId,idType:"user",isImplicitActor:!1})));const C=y.action??"require_approval";m.push({action:C,actors:D,operator:D.length>1?C==="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 R=v?.selection.selectedOptions??[];R.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:R});const I=h?.selection.selectedOptions??[];if(I.length>0&&(u.department={type:"department",operator:h?.operator.selectedOption??"is",departmentIds:I}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:l,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(K(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}})(X);function ne(){const e=g(t=>z(t)),{isApprovalRulesV3Enabled:s}=W(e?.tenantId);return s?b.jsx(Y,{}):b.jsx(J,{})}function Y(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=F(),o=N.getSignedInUser(),l=P(),r=g(n=>w(n)),i=g(n=>U(n)),[a,d]=f.useState(!1);if(Z(),f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?b.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):b.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,Z as u};
1
+ import{j as b}from"./liveblocks-CI520bHO.js";import{a as f}from"./sentry-B9QSZuyZ.js";import{u as T,j as g,h as _,g as O,i as F,n as k}from"./core-BEqwGbSx.js";import{kZ as Q,Qz as w,Qj as U,Fy as V,FK as B,FF as A,FG as E,QA as j,eX as z,FE as K}from"./zeni-epic-state-DDiwMHXL.js";import{z as N,y as P,B as $,bR as G,ag as q,bE as W,bS as X}from"./index-DD5A7mJH.js";import"./mui-6WrS_ojW.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="cf6a2b7b-b5b2-46ff-911a-a0af2f401f65",e._sentryDebugIdIdentifier="sentry-dbid-cf6a2b7b-b5b2-46ff-911a-a0af2f401f65")}catch{}})();function Z(){const e=T(),s=f.useRef(!1),t=g(o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started"),p=g(o=>o.vendorListState.allVendorIdsBillsTab.length>0);f.useEffect(()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(Q({})))},[p,t,e])}const H=k(function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return s.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===s.approvalRuleId)===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:l,approvalUpdateActionType:p}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const h=[];return v.forEach(u=>{const R=u.actors.selectedUsers.map(m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1})),I=u.actors.selectedNonUsers.map(m=>{const y=(S=m.value,j(S)==null);var S;return{type:y?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!y}}),c=R.concat(I);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:l,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}})(G);function J(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=F(),o=N.getSignedInUser(),l=P(),r=g(n=>w(n)),i=g(n=>U(n)),[a,d]=f.useState(!1);if(f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?b.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):b.jsx(H,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return j(e)==null}const M=k(function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],l={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),l[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:l,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:U(e).allApprovalRules}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach(y=>{const S=y.actorKind?.selectedOption,x=y.selectedRole?.selectedOption;let D=[];S==="role"&&x!=null?D=[{type:"attribute",subType:x,userId:void 0,idType:void 0,isImplicitActor:!1}]:S==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map(L=>({type:"user",subType:void 0,userId:L.userId,idType:"user",isImplicitActor:!1})));const C=y.action??"require_approval";m.push({action:C,actors:D,operator:D.length>1?C==="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 R=v?.selection.selectedOptions??[];R.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:R});const I=h?.selection.selectedOptions??[];if(I.length>0&&(u.department={type:"department",operator:h?.operator.selectedOption??"is",departmentIds:I}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:l,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(K(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}})(X);function ne(){const e=g(t=>z(t)),{isApprovalRulesV3Enabled:s}=W(e?.tenantId);return s?b.jsx(Y,{}):b.jsx(J,{})}function Y(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=F(),o=N.getSignedInUser(),l=P(),r=g(n=>w(n)),i=g(n=>U(n)),[a,d]=f.useState(!1);if(Z(),f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?b.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):b.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,Z as u};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-Cml8Dky9.js";import{h as W,u as de,g as Z,i as Y,j as w,N as _,n as J,l as mt,o as ct,p as C}from"./core-EpiYd0dH.js";import{eX as H,QN as ue,c6 as pe,EJ as De,kI as dt,EW as oe,EV as re,QO as ut,bn as be,gp as Ue,QP as pt,Na as bt,kx as Le,Nb as Ae,Nc as gt,js as ht,Q5 as ft,jH as St,Ex as It,ub as Rt,jz as yt,Fh as Pe,QQ as $e,QR as At,QS as kt,QT as vt,QU as Ct,QV as Et,F1 as ke,jN as wt,Qe as xt,EX as Bt,EH as Tt,QW as jt,EG as Ft,QX as Dt,EP as ve,F5 as Ut,F4 as Lt,F0 as Pt,QY as Me,Kg as $t,bq as Mt,ES as _t,Fz as Nt,QZ as Ot,Q_ as zt,Fd as Gt,Fa as Ce,PA as Qt,EE as Zt,Q$ as _e,F$ as Ee,G7 as Ht,R0 as Vt,R1 as G,R2 as Wt,R3 as Ne,R4 as Jt,R5 as Oe,R6 as ze,Fp as le,bu as qt,bK as ge,cG as he,fE as Ge,fC as Qe,R7 as Kt,fz as Xt,PN as Yt,R8 as en,R9 as Ze,PR as tn,Qz as nn,Ra as an,QM as sn,G4 as we,G3 as on,Rb as rn,Rc as ln,Rd as mn,Re as cn,Rf as dn,Qk as un,FW as pn,F_ as bn,bs as gn,bJ as hn,cA as fn,co as Sn,bt as In,L_ as Rn,cQ as yn,cT as An,cS as kn,cz as vn}from"./zeni-epic-state-Dms0qEHD.js";import{H as He,K as Ve,C as ee,G as E,z as $,c1 as We,v as te,e as k,aM as xe,o as F,au as X,J as Cn,a as Je,c2 as En,r as Q,a0 as qe,c3 as wn,I as ne,c4 as xn,Z as Bn,D as Tn,B as fe,g as Ke,a9 as jn,bp as Fn,a4 as Dn,y as Xe,c5 as Un,i as Ln}from"./index-CtdTfMzT.js";import{n as N,S as Pn}from"./mui-B9DMc10H.js";import me from"./NotFoundScreen-De6kOHv9.js";import{S as Be}from"./SetupPagesScreen-CKP0m0tv.js";import{F as Ye}from"./FeaturePreviewScreen-BakX_uqy.js";import{a as f}from"./sentry-Bv_CMTdO.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps--zCkzMi3.js";import{u as et}from"./useInitialThreadRequest-CxvsW_2d.js";import{D as $n}from"./DrawerScreen-BwpxQsSs.js";import{M as tt}from"./MobileAppDrawer-DykdYSpc.js";import{R as Mn}from"./ReimbursementApprovalRoutes-CaPbnBcf.js";import{FallBackRoute as _n}from"./ScreenRoutes-kNvSX_Sm.js";import"./recharts-Ct1VSQ_u.js";import"./analytics-BFERaNq_.js";import"./plaid-B2cdYw6c.js";import"./dnd-B4UwQr13.js";import"./stripe-DMRn4zHo.js";import"./lottie-s8xCOGnE.js";import"./lexical-BRwXCMXC.js";import"./pdf-EVuEk9_o.js";import"./utils-CpecgzlM.js";import"./analyticsHelper-CxUZWq8h.js";import"./routePaths-BA6bWJ0d.js";import"./BusinessVerificationPageScreen-CzQ1lRn0.js";import"./ReimbursementApprovalRuleDetailScreen-DbRpFLeK.js";import"./getLocaleForTenant-BMU__UL3.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]="0afa68e7-9283-4c63-93e7-1a941f792a50",e._sentryDebugIdIdentifier="sentry-dbid-0afa68e7-9283-4c63-93e7-1a941f792a50")}catch{}})();const nt=e=>`/${e}/reimbursements`,Nn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:U}}}=Je.getLocalizedStrings(),On=J(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=$.getSignedInUser(),c=be(d),m=r.plaidConnectionDetails,o=Ue(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ue(e,t.reimbursementId),b=pt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:pe(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:k,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Le(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=$.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(re(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ve(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Pt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ve(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Dt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Ft(l,i,n))},updateReimbursementType:(i,l,b)=>{e(jt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(ke(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(ke("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(oe({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(vt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e($e()),e(At());const i=nt(o),l=Q(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(k.trackReimbursementDeleteReimbursement(n),e(Pe(n)))},onSaveBankAccount:()=>{a?.userId&&e(yt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Rt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Ae("common"))},onCancelAutoComplete:()=>{e(Ae("common"))}}}})(En);function Te(){const e=W(),t=de(),n=Z(),{reimbursementId:r}=Y(),d=He(),c=Ve(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:b}=l(E.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(E.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=Se({mobileExploreReferrer:"Reimbursement Details"}),x=Z().pathname,j=x.includes("edit"),A=x.includes("reimbursement/new"),[D,B]=f.useState(!1),v=$.getSignedInUser(),I=w(p=>H(p)),g=w(p=>ue(p,r)),L=et(I?.companyId,{clearParams:g.fetchState==="Completed"}),P=pe(I?.userRole??[]);f.useEffect(()=>{(A&&!D||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(De(!1,b,y,r)))});const M=w(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(v==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||P&&g.billStatus==="rejected"||P===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(We,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(te,{analytics:k,onLoad:p=>(V=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&V.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Gn,{}):null,m&&c!=="small"?s.jsx(Qn,{children:s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,v?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:F.sp3,paddingBottom:"15px",paddingLeft:F.sp5},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Hn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,v?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:F.sp5,paddingRight:F.sp3,paddingBottom:F.sp5,paddingLeft:F.sp3},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})]}):null,s.jsx(Vn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:L??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const zn=N.div`
1
+ import{j as s}from"./liveblocks-CI520bHO.js";import{h as W,u as de,g as Z,i as Y,j as w,N as _,n as q,l as mt,o as ct,p as C}from"./core-BEqwGbSx.js";import{eX as H,QN as ue,c6 as pe,EJ as De,kI as dt,EW as oe,EV as re,QO as ut,bn as be,gp as Ue,QP as pt,Na as bt,kx as Le,Nb as Ae,Nc as gt,js as ht,Q5 as ft,jH as St,Ex as It,ub as Rt,jz as yt,Fh as Pe,QQ as $e,QR as At,QS as kt,QT as vt,QU as Ct,QV as Et,F1 as ke,jN as wt,Qe as xt,EX as Bt,EH as Tt,QW as jt,EG as Ft,QX as Dt,EP as ve,F5 as Ut,F4 as Lt,F0 as Pt,QY as Me,Kg as $t,bq as Mt,ES as _t,Fz as Nt,QZ as Ot,Q_ as zt,Fd as Gt,Fa as Ce,PA as Qt,EE as Zt,Q$ as _e,F$ as Ee,G7 as Ht,R0 as Vt,R1 as G,R2 as Wt,R3 as Ne,R4 as qt,R5 as Oe,R6 as ze,Fp as le,bu as Jt,bK as ge,cH as he,fE as Ge,fC as Qe,R7 as Kt,fz as Xt,PN as Yt,R8 as en,R9 as Ze,PR as tn,Qz as nn,Ra as an,QM as sn,G4 as we,G3 as on,Rb as rn,Rc as ln,Rd as mn,Re as cn,Rf as dn,Qk as un,FW as pn,F_ as bn,bs as gn,bJ as hn,cB as fn,cp as Sn,bt as In,L_ as Rn,cR as yn,cU as An,cT as kn,cA as vn}from"./zeni-epic-state-DDiwMHXL.js";import{x as He,K as Ve,C as ee,G as E,z as $,c1 as We,D as te,d as k,aM as xe,o as F,au as X,M as Cn,a as qe,c2 as En,v as Q,a0 as Je,c3 as wn,I as ne,c4 as xn,_ as Bn,F as Tn,B as fe,f as Ke,a9 as jn,bp as Fn,a4 as Dn,y as Xe,c5 as Un,i as Ln}from"./index-DD5A7mJH.js";import{n as N,S as Pn}from"./mui-6WrS_ojW.js";import me from"./NotFoundScreen-Dzg5zRVC.js";import{S as Be}from"./SetupPagesScreen-DdbFAdHb.js";import{F as Ye}from"./FeaturePreviewScreen-CMZ336vr.js";import{a as f}from"./sentry-B9QSZuyZ.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-BGHggyph.js";import{u as et}from"./useInitialThreadRequest-CqJaxo92.js";import{D as $n}from"./DrawerScreen-B3cQzzUP.js";import{M as tt}from"./MobileAppDrawer-BmpM5OEl.js";import{R as Mn}from"./ReimbursementApprovalRoutes-BhxstoNC.js";import{FallBackRoute as _n}from"./ScreenRoutes-BlNv4YIY.js";import"./recharts-HPhXmfTv.js";import"./analytics-C32tZaP0.js";import"./plaid-BwgJPT1f.js";import"./dnd-aedH_7an.js";import"./stripe-DMRn4zHo.js";import"./lottie-0YTaCosS.js";import"./lexical-Dk1uI_nN.js";import"./pdf-XPdZ15Zh.js";import"./utils-7NyLmgtg.js";import"./analyticsHelper-DtQFmi0e.js";import"./routePaths-BEczkE7A.js";import"./BusinessVerificationPageScreen-B2HhT9ni.js";import"./ReimbursementApprovalRuleDetailScreen-CkEZJXQa.js";import"./getLocaleForTenant-CPQG2FZU.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]="f78cca3f-db05-44e7-be1a-712a00709f21",e._sentryDebugIdIdentifier="sentry-dbid-f78cca3f-db05-44e7-be1a-712a00709f21")}catch{}})();const nt=e=>`/${e}/reimbursements`,Nn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:U}}}=qe.getLocalizedStrings(),On=q(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=$.getSignedInUser(),c=be(d),m=r.plaidConnectionDetails,o=Ue(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ue(e,t.reimbursementId),b=pt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:pe(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:k,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Le(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=$.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(re(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ve(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Pt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ve(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Dt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Ft(l,i,n))},updateReimbursementType:(i,l,b)=>{e(jt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(ke(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(ke("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(oe({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(vt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e($e()),e(At());const i=nt(o),l=Q(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(k.trackReimbursementDeleteReimbursement(n),e(Pe(n)))},onSaveBankAccount:()=>{a?.userId&&e(yt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Rt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Ae("common"))},onCancelAutoComplete:()=>{e(Ae("common"))}}}})(En);function Te(){const e=W(),t=de(),n=Z(),{reimbursementId:r}=Y(),d=He(),c=Ve(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:b}=l(E.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(E.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=Se({mobileExploreReferrer:"Reimbursement Details"}),x=Z().pathname,j=x.includes("edit"),A=x.includes("reimbursement/new"),[D,B]=f.useState(!1),v=$.getSignedInUser(),I=w(p=>H(p)),g=w(p=>ue(p,r)),L=et(I?.companyId,{clearParams:g.fetchState==="Completed"}),P=pe(I?.userRole??[]);f.useEffect(()=>{(A&&!D||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(De(!1,b,y,r)))});const M=w(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(v==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||P&&g.billStatus==="rejected"||P===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(We,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(te,{analytics:k,onLoad:p=>(V=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&V.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Gn,{}):null,m&&c!=="small"?s.jsx(Qn,{children:s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,v?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:F.sp3,paddingBottom:"15px",paddingLeft:F.sp5},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Hn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,v?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:F.sp5,paddingRight:F.sp3,paddingBottom:F.sp5,paddingLeft:F.sp3},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})]}):null,s.jsx(Vn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:L??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const zn=N.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;
@@ -53,7 +53,7 @@ import{j as s}from"./liveblocks-Cml8Dky9.js";import{h as W,u as de,g as Z,i as Y
53
53
  flex-direction: column;
54
54
  width: 100%;
55
55
  ${e=>e.windowSize!=="small"?"overflow: auto;":""}
56
- `,Wn=J(function(e,t){const n=Me(e,t.reimbursementId),r=$.getSignedInUser(),d=be(r),c=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Ot(n.remiActivities,zt(t.currentTenant),r));const i=pe(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:d,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:Le(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e($e());const a=nt(o),i=Q(d.state?.pathnameStackToGoBack,d.pathname);c(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Qt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Ce(n,a.type,"")):e(Ce(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=Q(d.state?.pathnameStackToGoBack,d.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{k.trackReimbursementDeleteReimbursement(n),e(Pe(n))},cancelAndDeleteReport:a=>{a===!0?k.trackReimbursementCancelAndDeleteReimbursement(n):k.trackReimbursementCancelReimbursement(n),e(Gt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}})(wn);function Jn(){const e=W(),t=de(),n=Z(),r=n.hash.substring(1),d=He(),{reimbursementId:c}=Y(),m=$.getSignedInUser(),o=w(R=>H(R)),a=w(R=>Me(R,c??"")),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=et(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:y}=Se({mobileExploreReferrer:"Reimbursement Details"});qe({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:h}=ee(),{isFeatureEnabled:T}=h(E.isLimitedCategoryForReimbursement),[u,x]=f.useState(!1),[j,A]=f.useState(!1),[D,B]=f.useState(!1),{isFeatureEnabled:v}=h(E.isReimbursementCommentingEnabled),{isFeatureEnabled:I}=h(E.isShowDeletedReimbursementsFeatureEnabled),g=w(R=>ue(R,c??"")),L=$t(o),P=Mt(o.userRole),M=a.fetchState;if(f.useEffect(()=>{u||c==null?u==1&&M==="Error"&&e("page-not-found",{replace:!0}):(x(!0),t(_t(c,!1,I)))},[u,c,t,M]),f.useEffect(()=>{I&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&L===!1?B(!1):B(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(P||a.allApprovers.find(R=>R.user.userId===m?.userId)!=null||a.remiDetails?.lastUpdatedBy===m?.userId))},[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,P,o.isZeni,L,m]),f.useEffect(()=>{j||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(A(!0),t(De(!1,T,I,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Nt(!1,!0,!0,a.lastUpdatedByUserId)))},[j,a,c,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx(_,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(We,{}):s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:k,onLoad:R=>(p=>{c!=null&&p.trackReimbursementReimbursementDetails(c)})(R)}),s.jsx(Wn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:v,isShowDeletedReimbursementEnabled:I,location:n,navigate:e,isRealTimeApprovalEnabled:D,currentTenant:o,reimbursementId:c??"",themeState:d,isAiCfoAccessEnabled:b,onAskAiCfoClick:y})]})}const qn=J(function(e,t){return{remisReviewView:_e(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(G())},onCloseReviewItem:n=>{e(Vt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Ht());break;case"approve":e(Ee("approved",r??""));break;case"reject":e(Ee("rejected",r??""))}}}})(xn);function Kn(){const e=W(),t=w(c=>c.remisBulkActionViewState.bulkSubmissionFetchState.fetchState),{remisForReview:n}=w(c=>_e(c)),r=ne(),d=r?.loggedInUserRole?.includes("admin")===!0;return f.useEffect(()=>{t!=="Completed"&&n.length!==0||e("./")},[t,n.length]),s.jsx(qn,{navigate:e,analytics:k,isAdmin:d})}const z=tn(),at="bulk-operation-update",ce="reimbursement-approval-rule-update",{spendManagement:Xn,common:je}=Je.getLocalizedStrings(),Fe=Xn.reimbursement.bulkActions,Yn=N.div`
56
+ `,Wn=q(function(e,t){const n=Me(e,t.reimbursementId),r=$.getSignedInUser(),d=be(r),c=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Ot(n.remiActivities,zt(t.currentTenant),r));const i=pe(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:d,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:Le(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e($e());const a=nt(o),i=Q(d.state?.pathnameStackToGoBack,d.pathname);c(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Qt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Ce(n,a.type,"")):e(Ce(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=Q(d.state?.pathnameStackToGoBack,d.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{k.trackReimbursementDeleteReimbursement(n),e(Pe(n))},cancelAndDeleteReport:a=>{a===!0?k.trackReimbursementCancelAndDeleteReimbursement(n):k.trackReimbursementCancelReimbursement(n),e(Gt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}})(wn);function qn(){const e=W(),t=de(),n=Z(),r=n.hash.substring(1),d=He(),{reimbursementId:c}=Y(),m=$.getSignedInUser(),o=w(R=>H(R)),a=w(R=>Me(R,c??"")),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=et(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:y}=Se({mobileExploreReferrer:"Reimbursement Details"});Je({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:h}=ee(),{isFeatureEnabled:T}=h(E.isLimitedCategoryForReimbursement),[u,x]=f.useState(!1),[j,A]=f.useState(!1),[D,B]=f.useState(!1),{isFeatureEnabled:v}=h(E.isReimbursementCommentingEnabled),{isFeatureEnabled:I}=h(E.isShowDeletedReimbursementsFeatureEnabled),g=w(R=>ue(R,c??"")),L=$t(o),P=Mt(o.userRole),M=a.fetchState;if(f.useEffect(()=>{u||c==null?u==1&&M==="Error"&&e("page-not-found",{replace:!0}):(x(!0),t(_t(c,!1,I)))},[u,c,t,M]),f.useEffect(()=>{I&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&L===!1?B(!1):B(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(P||a.allApprovers.find(R=>R.user.userId===m?.userId)!=null||a.remiDetails?.lastUpdatedBy===m?.userId))},[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,P,o.isZeni,L,m]),f.useEffect(()=>{j||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(A(!0),t(De(!1,T,I,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Nt(!1,!0,!0,a.lastUpdatedByUserId)))},[j,a,c,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx(_,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(We,{}):s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:k,onLoad:R=>(p=>{c!=null&&p.trackReimbursementReimbursementDetails(c)})(R)}),s.jsx(Wn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:v,isShowDeletedReimbursementEnabled:I,location:n,navigate:e,isRealTimeApprovalEnabled:D,currentTenant:o,reimbursementId:c??"",themeState:d,isAiCfoAccessEnabled:b,onAskAiCfoClick:y})]})}const Jn=q(function(e,t){return{remisReviewView:_e(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(G())},onCloseReviewItem:n=>{e(Vt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Ht());break;case"approve":e(Ee("approved",r??""));break;case"reject":e(Ee("rejected",r??""))}}}})(xn);function Kn(){const e=W(),t=w(c=>c.remisBulkActionViewState.bulkSubmissionFetchState.fetchState),{remisForReview:n}=w(c=>_e(c)),r=ne(),d=r?.loggedInUserRole?.includes("admin")===!0;return f.useEffect(()=>{t!=="Completed"&&n.length!==0||e("./")},[t,n.length]),s.jsx(Jn,{navigate:e,analytics:k,isAdmin:d})}const z=tn(),at="bulk-operation-update",ce="reimbursement-approval-rule-update",{spendManagement:Xn,common:je}=qe.getLocalizedStrings(),Fe=Xn.reimbursement.bulkActions,Yn=N.div`
57
57
  display: flex;
58
58
  min-height: 100%;
59
59
  width: 100%;
@@ -61,8 +61,8 @@ import{j as s}from"./liveblocks-Cml8Dky9.js";import{h as W,u as de,g as Z,i as Y
61
61
  flex-direction: column;
62
62
  align-items: center;
63
63
  background-color: ${e=>e.theme.colors.grey4};
64
- `,ea=J(function(e,t){const n=ze(e,z,t.isBulkActionEnabled);let r=n.allSubTabs;const d=$.getSignedInUser(),c=be(d),m=e.tenantState.currentTenantId,o=H(e),a=o?.companyName??"",i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter(h=>h!=="deleted"));const b=n.fetchState,y=nn(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter(h=>h.isDeleted===!1),isAdmin:t.isAdmin,isZeniUser:c,isBillPayCommentingEnabled:t.isBillPayCommentingEnabled,isReimbursementCommentingEnabled:t.isReimbursementCommentingEnabled,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:b,botEmail:n.reimbursementBotEmail,analytics:k,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:z,spendManagementEndPoint:`${Dn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:y.affectedEntityIds}},function(e,t){const{navigate:n,currentTenant:r,location:d,period:c}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(G()),e(Ne(o))},onSubtabChange:o=>{e(G()),e(Oe(o))},onTransactionClick:(o,a)=>{const i=aa(m,o,a),l=Q(d.state?.pathnameStackToGoBack,d.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=na(m),a=Q(d.state?.pathnameStackToGoBack,d.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;k?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=Q(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(dn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(cn(o))},onFiltersChange:o=>{e(mn({filters:o})),o.categories.every(a=>a.field!=null&&a.values?.length!==0)&&k.trackSpendManagmentFilterChange("reimbursement",o.categories.map(a=>`${a.field}-${JSON.stringify(a.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&k.trackSpendManagementDownloadClick("reimbursement"),e(ln({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(le(c,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(rn(o))},removeAllTransactionsFromBulkActionList:()=>{e(G())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(on(o,a??""));break;case"send_for_approval":e(we("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(we("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(ce)&&e(sn(!1))},onEventReceived:o=>{o===at&&e(an())}}})(jn(Fn));function ta(){const e=W(),t=de(),n=Z(),r=n.state,d=Ve(),[c,m]=f.useState(null),o=mt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;f.useEffect(()=>{if(r?.tab!=null&&r?.subTab!=null){const S=Wt(r.tab.toString());S!=null?t(Ne(S)):console.log("Warning:Not a valid remiListTab");const O=Jt(r.subTab.toString());O!=null?t(Oe(O)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(G())}},[]);const{useFeatureGate:a}=ee(),{isFeatureEnabled:i}=a(E.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(E.isBillPayCommentingEnabled),{isFeatureEnabled:y}=a(E.isReimbursementCommentingEnabled),{isFeatureEnabled:h}=a(E.isReimbursementBulkActionEnabled),T=$.getSignedInUser(),u=w(S=>H(S)),[x,j]=f.useState(!1),[A,D]=f.useState(!1),B=ne(),v=B?.loggedInUserRole?.includes("admin")===!0,I=w(S=>ze(S,z,h)),{areTenantIdsInSync:g}=Bn(),L=I.fetchState,{isAiCfoAccessEnabled:P,onAskAiCfoClick:M}=Se({mobileExploreReferrer:"Reimbursement List"});if(qe({isDataReady:L==="Completed"}),f.useEffect(()=>{!A&&g&&(D(!0),t(le(z,!0,l,!1,!0)))},[A,z,t,g]),T==null)throw Error("Can't access address page without signing in...");const R=!!u?.userRole&&qt(u),p=ge(B?.loggedInUserRoleMap),V=he(B?.loggedInUserRoleMap),ae=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,q=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,se=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,ie=w(S=>Ue(S.companyState,u.companyId)),st=ie?.company.featuresActivationInfo.connectedAccountProvider,Ie=S=>{j(S)},{isFeatureEnabled:it}=a(E.isDebitCardFeatureEnabled),ot=Ge(it,u),rt=Qe(u),{remisProcessed:K,remisProcessing:Re}=w(S=>Kt(S));f.useEffect(()=>{K===Re&&c!=null&&(t(Xt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:K>1?Fe.reports:Fe.report},{variableName:"_has_",variableValue:K>1?je.texts.have:je.texts.has},{variableName:"_action_",variableValue:Yt(c)}]})),t(en()),setTimeout(()=>{t(le(z,!0,l,!1,!0,!0))},3e3),m(null))},[K,Re]);const lt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${at}`,`private-encrypted-${u.companyId}.${ce}`]:[],eventCallback:(S,O,ye)=>{S.endsWith(ce)?ye.onReimbursementApprovalRulesEventReceived?.(S):O.entity_type==="reimbursement"&&(m(O.operation_type),ye.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?ot===!0||rt===!0?s.jsx(Ye,{}):q&&(!R||p)||V&&ae?s.jsxs(s.Fragment,{children:[L==="Completed"?s.jsx(te,{analytics:k,onLoad:S=>(O=>O.trackPageLoaded(Ke.Event.reimbursementHome))(S)}):null,s.jsx(tt,{isAppContentDrawerOpen:x,handleDrawerToggle:Ie}),s.jsxs(Yn,{windowSize:d,children:[s.jsx($n,{isOpen:o,drawerLeftMargin:new Tn(0,0,300,600),onClose:()=>{e("./"),t(G())},children:s.jsx(sa,{onClick:S=>S.stopPropagation(),children:s.jsx(Kn,{})})}),s.jsx(ea,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:y,location:n,navigate:e,currentTenant:u,period:z,isAdmin:v,isEmployee:R,entity:"reimbursement",onClickMenuIcon:()=>{Ie(!0)},createdByUserList:I.createdByUserList,createdByUserListFetchState:I.createdByUserListFetchState,isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:st,isBulkActionEnabled:h,bulkSubmissionLimit:I.remiBulkSubmissionLimit,bulkSubmissionFetchState:I.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:P,onAskAiCfoClick:M,...lt})]})]}):se&&p?s.jsx(_,{to:"../setup"}):B!=null&&Ze(u,B.loggedInUserRoleMap)?s.jsx(_,{to:"../promo"}):s.jsx(fe,{fetchState:"In-Progress"}):s.jsx(me,{})}const na=e=>`/${e}/reimbursements/setup`,aa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},sa=N(Pn)`
64
+ `,ea=q(function(e,t){const n=ze(e,z,t.isBulkActionEnabled);let r=n.allSubTabs;const d=$.getSignedInUser(),c=be(d),m=e.tenantState.currentTenantId,o=H(e),a=o?.companyName??"",i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter(h=>h!=="deleted"));const b=n.fetchState,y=nn(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter(h=>h.isDeleted===!1),isAdmin:t.isAdmin,isZeniUser:c,isBillPayCommentingEnabled:t.isBillPayCommentingEnabled,isReimbursementCommentingEnabled:t.isReimbursementCommentingEnabled,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:b,botEmail:n.reimbursementBotEmail,analytics:k,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:z,spendManagementEndPoint:`${Dn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:y.affectedEntityIds}},function(e,t){const{navigate:n,currentTenant:r,location:d,period:c}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(G()),e(Ne(o))},onSubtabChange:o=>{e(G()),e(Oe(o))},onTransactionClick:(o,a)=>{const i=aa(m,o,a),l=Q(d.state?.pathnameStackToGoBack,d.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=na(m),a=Q(d.state?.pathnameStackToGoBack,d.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;k?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=Q(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(dn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(cn(o))},onFiltersChange:o=>{e(mn({filters:o})),o.categories.every(a=>a.field!=null&&a.values?.length!==0)&&k.trackSpendManagmentFilterChange("reimbursement",o.categories.map(a=>`${a.field}-${JSON.stringify(a.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&k.trackSpendManagementDownloadClick("reimbursement"),e(ln({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(le(c,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(rn(o))},removeAllTransactionsFromBulkActionList:()=>{e(G())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(on(o,a??""));break;case"send_for_approval":e(we("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(we("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(ce)&&e(sn(!1))},onEventReceived:o=>{o===at&&e(an())}}})(jn(Fn));function ta(){const e=W(),t=de(),n=Z(),r=n.state,d=Ve(),[c,m]=f.useState(null),o=mt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;f.useEffect(()=>{if(r?.tab!=null&&r?.subTab!=null){const S=Wt(r.tab.toString());S!=null?t(Ne(S)):console.log("Warning:Not a valid remiListTab");const O=qt(r.subTab.toString());O!=null?t(Oe(O)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(G())}},[]);const{useFeatureGate:a}=ee(),{isFeatureEnabled:i}=a(E.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(E.isBillPayCommentingEnabled),{isFeatureEnabled:y}=a(E.isReimbursementCommentingEnabled),{isFeatureEnabled:h}=a(E.isReimbursementBulkActionEnabled),T=$.getSignedInUser(),u=w(S=>H(S)),[x,j]=f.useState(!1),[A,D]=f.useState(!1),B=ne(),v=B?.loggedInUserRole?.includes("admin")===!0,I=w(S=>ze(S,z,h)),{areTenantIdsInSync:g}=Bn(),L=I.fetchState,{isAiCfoAccessEnabled:P,onAskAiCfoClick:M}=Se({mobileExploreReferrer:"Reimbursement List"});if(Je({isDataReady:L==="Completed"}),f.useEffect(()=>{!A&&g&&(D(!0),t(le(z,!0,l,!1,!0)))},[A,z,t,g]),T==null)throw Error("Can't access address page without signing in...");const R=!!u?.userRole&&Jt(u),p=ge(B?.loggedInUserRoleMap),V=he(B?.loggedInUserRoleMap),ae=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,J=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,se=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,ie=w(S=>Ue(S.companyState,u.companyId)),st=ie?.company.featuresActivationInfo.connectedAccountProvider,Ie=S=>{j(S)},{isFeatureEnabled:it}=a(E.isDebitCardFeatureEnabled),ot=Ge(it,u),rt=Qe(u),{remisProcessed:K,remisProcessing:Re}=w(S=>Kt(S));f.useEffect(()=>{K===Re&&c!=null&&(t(Xt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:K>1?Fe.reports:Fe.report},{variableName:"_has_",variableValue:K>1?je.texts.have:je.texts.has},{variableName:"_action_",variableValue:Yt(c)}]})),t(en()),setTimeout(()=>{t(le(z,!0,l,!1,!0,!0))},3e3),m(null))},[K,Re]);const lt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${at}`,`private-encrypted-${u.companyId}.${ce}`]:[],eventCallback:(S,O,ye)=>{S.endsWith(ce)?ye.onReimbursementApprovalRulesEventReceived?.(S):O.entity_type==="reimbursement"&&(m(O.operation_type),ye.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?ot===!0||rt===!0?s.jsx(Ye,{}):J&&(!R||p)||V&&ae?s.jsxs(s.Fragment,{children:[L==="Completed"?s.jsx(te,{analytics:k,onLoad:S=>(O=>O.trackPageLoaded(Ke.Event.reimbursementHome))(S)}):null,s.jsx(tt,{isAppContentDrawerOpen:x,handleDrawerToggle:Ie}),s.jsxs(Yn,{windowSize:d,children:[s.jsx($n,{isOpen:o,drawerLeftMargin:new Tn(0,0,300,600),onClose:()=>{e("./"),t(G())},children:s.jsx(sa,{onClick:S=>S.stopPropagation(),children:s.jsx(Kn,{})})}),s.jsx(ea,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:y,location:n,navigate:e,currentTenant:u,period:z,isAdmin:v,isEmployee:R,entity:"reimbursement",onClickMenuIcon:()=>{Ie(!0)},createdByUserList:I.createdByUserList,createdByUserListFetchState:I.createdByUserListFetchState,isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:st,isBulkActionEnabled:h,bulkSubmissionLimit:I.remiBulkSubmissionLimit,bulkSubmissionFetchState:I.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:P,onAskAiCfoClick:M,...lt})]})]}):se&&p?s.jsx(_,{to:"../setup"}):B!=null&&Ze(u,B.loggedInUserRoleMap)?s.jsx(_,{to:"../promo"}):s.jsx(fe,{fetchState:"In-Progress"}):s.jsx(me,{})}const na=e=>`/${e}/reimbursements/setup`,aa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},sa=N(Pn)`
65
65
  display: flex;
66
66
  min-height: 100%;
67
67
  flex-direction: column;
68
- `,ia=J(function(e,t){const{companyId:n}=t;return{reimbursementSetupView:un(e,n),analytics:k,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",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(bn(n))},onCreateNewRemiButtonClick:()=>{e(pn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}})(Un),oa=()=>{const e=W(),t=Z(),{tenantEmailDomain:n}=Y(),r=Xe(),[d,c]=f.useState(!1),m=w(A=>H(A)),o=$.getSignedInUserTenant(n)?.companyId??m.companyId,a=$.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),b=ne(),y=ge(b?.loggedInUserRoleMap),h=he(b?.loggedInUserRoleMap),T=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,u=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,x=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,j=A=>{c(A)};if(a==null)throw Error("Can't access reimbursement promo page without signing in...");return u&&h&&T?s.jsx(_,{to:"../../../reimbursements"}):x&&y?s.jsx(_,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!x||m.userReimbursementInfo&&h&&T===!1?s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:k,onLoad:A=>(D=>D.trackPageLoaded(Ke.Event.reimbursementPromoPage))(A)}),s.jsx(tt,{isAppContentDrawerOpen:d,handleDrawerToggle:j}),s.jsx(ia,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{j(!0)}})]}):s.jsx(fe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Pa(){const e=w(ie=>H(ie)),t=ne(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Xe(),d=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=ee(),{isFeatureEnabled:o}=m(E.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(E.isDebitCardFeatureEnabled),i=Ge(a,e),l=Qe(e),b=e?.userRole!=null&&gn(e?.userRole),y=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&hn(t?.loggedInUserRoleMap),h=fn(t?.loggedInUserRoleMap),T=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,u=ge(t?.loggedInUserRoleMap),x=T&&u,j=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!b,A=j&&Sn(t?.loggedInUserRoleMap),D=Ln(e,o,a)&&!b,B=D&&In(t?.loggedInUserRoleMap),v=Rn(t?.loggedInUserRoleMap),I=yn(t?.loggedInUserRoleMap),g=An(t?.loggedInUserRoleMap),L=j&&I,P=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!b&&g,M=kn(t?.loggedInUserRoleMap),R=vn(t?.loggedInUserRoleMap),p=he(t?.loggedInUserRoleMap),V=D&&M,{tenantEmailDomain:ae}=Y(),q=Z(),se=n===!0&&(u||p&&c);return s.jsxs(ct,{children:[q.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"verification",element:s.jsx(Be,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:x,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:v,productType:"reimbursement",type:"verification"})}),s.jsx(C,{path:"setup",element:s.jsx(Be,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:x,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:v,productType:"reimbursement",type:"setup"})}),s.jsx(C,{path:"promo",element:s.jsx(oa,{})}),s.jsx(C,{path:"approval-rules/*",element:x?s.jsx(Mn,{}):s.jsx(_n,{showZeniAccountRoute:L,isUserHasBillPayAccess:R,isUserHasReimbursementAccess:p,showTreasuryRoute:P,isTenantBankingOnly:i,showChargeCardRoute:V,tenantEmailDomain:ae??""})}),se&&s.jsx(C,{path:"*",element:s.jsx(ta,{})}),(i===!0||l===!0)&&s.jsx(C,{path:"/*",element:s.jsx(Ye,{})}),t!=null&&Ze(e,t?.loggedInUserRoleMap)&&s.jsx(C,{path:"*",element:s.jsx(_,{to:"../promo"})}),d&&u&&s.jsx(C,{path:"*",element:s.jsx(_,{to:"../setup"})})]}):q.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"new",element:s.jsx(Te,{})}),s.jsx(C,{path:":reimbursementId",element:s.jsx(Jn,{})}),s.jsx(C,{path:":reimbursementId/edit",element:s.jsx(Te,{})}),s.jsx(C,{path:"*",element:s.jsx(me,{})})]}):s.jsx(C,{path:"*",element:s.jsx(fe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${F.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(C,{path:"*",element:s.jsx(me,{})})]})}export{Pa as default};
68
+ `,ia=q(function(e,t){const{companyId:n}=t;return{reimbursementSetupView:un(e,n),analytics:k,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",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(bn(n))},onCreateNewRemiButtonClick:()=>{e(pn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}})(Un),oa=()=>{const e=W(),t=Z(),{tenantEmailDomain:n}=Y(),r=Xe(),[d,c]=f.useState(!1),m=w(A=>H(A)),o=$.getSignedInUserTenant(n)?.companyId??m.companyId,a=$.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),b=ne(),y=ge(b?.loggedInUserRoleMap),h=he(b?.loggedInUserRoleMap),T=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,u=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,x=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,j=A=>{c(A)};if(a==null)throw Error("Can't access reimbursement promo page without signing in...");return u&&h&&T?s.jsx(_,{to:"../../../reimbursements"}):x&&y?s.jsx(_,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!x||m.userReimbursementInfo&&h&&T===!1?s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:k,onLoad:A=>(D=>D.trackPageLoaded(Ke.Event.reimbursementPromoPage))(A)}),s.jsx(tt,{isAppContentDrawerOpen:d,handleDrawerToggle:j}),s.jsx(ia,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{j(!0)}})]}):s.jsx(fe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Pa(){const e=w(ie=>H(ie)),t=ne(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Xe(),d=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=ee(),{isFeatureEnabled:o}=m(E.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(E.isDebitCardFeatureEnabled),i=Ge(a,e),l=Qe(e),b=e?.userRole!=null&&gn(e?.userRole),y=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&hn(t?.loggedInUserRoleMap),h=fn(t?.loggedInUserRoleMap),T=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,u=ge(t?.loggedInUserRoleMap),x=T&&u,j=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!b,A=j&&Sn(t?.loggedInUserRoleMap),D=Ln(e,o,a)&&!b,B=D&&In(t?.loggedInUserRoleMap),v=Rn(t?.loggedInUserRoleMap),I=yn(t?.loggedInUserRoleMap),g=An(t?.loggedInUserRoleMap),L=j&&I,P=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!b&&g,M=kn(t?.loggedInUserRoleMap),R=vn(t?.loggedInUserRoleMap),p=he(t?.loggedInUserRoleMap),V=D&&M,{tenantEmailDomain:ae}=Y(),J=Z(),se=n===!0&&(u||p&&c);return s.jsxs(ct,{children:[J.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"verification",element:s.jsx(Be,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:x,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:v,productType:"reimbursement",type:"verification"})}),s.jsx(C,{path:"setup",element:s.jsx(Be,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:x,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:v,productType:"reimbursement",type:"setup"})}),s.jsx(C,{path:"promo",element:s.jsx(oa,{})}),s.jsx(C,{path:"approval-rules/*",element:x?s.jsx(Mn,{}):s.jsx(_n,{showZeniAccountRoute:L,isUserHasBillPayAccess:R,isUserHasReimbursementAccess:p,showTreasuryRoute:P,isTenantBankingOnly:i,showChargeCardRoute:V,tenantEmailDomain:ae??""})}),se&&s.jsx(C,{path:"*",element:s.jsx(ta,{})}),(i===!0||l===!0)&&s.jsx(C,{path:"/*",element:s.jsx(Ye,{})}),t!=null&&Ze(e,t?.loggedInUserRoleMap)&&s.jsx(C,{path:"*",element:s.jsx(_,{to:"../promo"})}),d&&u&&s.jsx(C,{path:"*",element:s.jsx(_,{to:"../setup"})})]}):J.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"new",element:s.jsx(Te,{})}),s.jsx(C,{path:":reimbursementId",element:s.jsx(qn,{})}),s.jsx(C,{path:":reimbursementId/edit",element:s.jsx(Te,{})}),s.jsx(C,{path:"*",element:s.jsx(me,{})})]}):s.jsx(C,{path:"*",element:s.jsx(fe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${F.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(C,{path:"*",element:s.jsx(me,{})})]})}export{Pa as default};
@@ -1 +1 @@
1
- import{j as p}from"./liveblocks-Cml8Dky9.js";import{g as G,h as Ce,u as ge,i as we,j as d,n as Ie,o as Se,p as Y}from"./core-EpiYd0dH.js";import{eX as v,fT as w,Mr as Te,kx as J,qR as X,rG as A,kl as Re,jp as Me,ve as W,rL as Oe,bs as Ae,Ms as Fe,bn as ke,wn as De,Mt as Ee,Mu as je,v6 as Pe,Mv as H,Mw as ve,Mx as Le,My as Be,Mz as Ve,MA as I,MB as F,MC as k,MD as N,ME as D,MF as E,dK as Ue,w3 as xe,vT as $,vU as q,w9 as ze,vY as K,wf as Ge,MG as Ye,MH as He,MI as Ne,MJ as $e,MK as qe,fE as Ke,fC as Ze}from"./zeni-epic-state-Dms0qEHD.js";import{Q as Qe,T as Je,V as Xe,Y as We,K as ea,C as ee,G as j,z as ae,Z as aa,I as sa,c as ta,$ as oa,a0 as na,v as ra,e as P,g as ia,a1 as la,r as se,a2 as ca,a3 as da,a4 as pa}from"./index-CtdTfMzT.js";import"./mui-B9DMc10H.js";import fa from"./NotFoundScreen-De6kOHv9.js";import{F as ma}from"./FeaturePreviewScreen-BakX_uqy.js";import{a as _}from"./sentry-Bv_CMTdO.js";import{u as ua}from"./useInitialThreadRequest-CxvsW_2d.js";import{t as Z,a as Q,b as _a}from"./routePaths-BA6bWJ0d.js";import{M as ha}from"./MobileAppDrawer-DykdYSpc.js";import"./recharts-Ct1VSQ_u.js";import"./analytics-BFERaNq_.js";import"./plaid-B2cdYw6c.js";import"./dnd-B4UwQr13.js";import"./stripe-DMRn4zHo.js";import"./lottie-s8xCOGnE.js";import"./lexical-BRwXCMXC.js";import"./pdf-EVuEk9_o.js";import"./utils-CpecgzlM.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]="defc0b3e-8cfd-41e6-a4c5-9752eef7e3a7",e._sentryDebugIdIdentifier="sentry-dbid-defc0b3e-8cfd-41e6-a4c5-9752eef7e3a7")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(E({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ya=e=>{e(He()),e(Ne()),e($e()),e(qe())},Ca=Ie(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=v(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=Fe(u);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,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:ke(o),showAccountGroups:r===!0,isAccountingClassesEnabled:J(e),isAccountingProjectsEnabled:X(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ye(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter(C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year")),e($(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e(q(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(I(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(K({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(H({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(K(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(ze(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e($(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(q(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(xe({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return Q(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(E({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(N({scrollPosition:s}));break;case"balance_sheet":e(k({scrollPosition:s}));break;case"cash_flow":e(F({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(E({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Ve({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Le({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(ve({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(H({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(W())},onUpdateDisplayOrder:a=>{e(je(a))},onUpdateReportFormat:a=>{ya(e),e(Ee(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ca);function ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=We(),f=ea(),u=da(f),a=Ce(),s=ge(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(j.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,C]=_.useState(!1),[L,te]=_.useState(!1),{isFeatureEnabled:B}=l(j.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d(n=>v(n)),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),g=d(n=>w(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:h}=aa(),R=d(n=>n.financeStatementState.selectedReportId),V=d(n=>J(n)),M=d(n=>X(n)),le=d(n=>w(n).isCompareModeOn),b=d(n=>w(n).filter),O=d(n=>w(n).selectedReportAndTimeframeFetchState),ce=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(C(!0),s(A(c.userId,!0,!0,!1)))},[i,c,s,h]),_.useEffect(()=>{i&&!L&&g==="Completed"&&h&&(s(A(c.userId,!1,!0,!1)),te(!0))},[i,L,g,h]),_.useEffect(()=>{if(i&&O.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(W());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,O,h,V,M]);const U=sa(),de=U?.loggedInUserRole!=null&&Ae(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:he}=G(),z=Qe(he??"")==="reports",be=Je(_e),ye=_.useMemo(()=>z?ba:void 0,[z]);Xe({canFetchSuggestedQuestions:be,pageContexts:ye})}({isDataReady:g==="Completed"}),na({isDataReady:g==="Completed"}),p.jsxs(p.Fragment,{children:[g==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(Ca,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:x,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function za(){const e=d(s=>v(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(j.isDebitCardFeatureEnabled),u=Ke(f,e),a=Ze(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(Y,{path:"/",element:p.jsx(ga,{})}),p.jsx(Y,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
1
+ import{j as p}from"./liveblocks-CI520bHO.js";import{g as G,h as Ce,u as ge,i as we,j as d,n as Ie,o as Se,p as Y}from"./core-BEqwGbSx.js";import{eX as v,fT as w,Mr as Te,kx as J,qR as Q,rG as A,kl as Re,jp as Me,ve as W,rL as Oe,bs as Ae,Ms as Fe,bn as ke,wn as De,Mt as Ee,Mu as je,v6 as Pe,Mv as H,Mw as ve,Mx as Le,My as Be,Mz as Ve,MA as I,MB as F,MC as k,MD as N,ME as D,MF as E,dK as Ue,w3 as xe,vT as $,vU as q,w9 as ze,vY as K,wf as Ge,MG as Ye,MH as He,MI as Ne,MJ as $e,MK as qe,fE as Ke,fC as Ze}from"./zeni-epic-state-DDiwMHXL.js";import{V as Xe,X as Je,Y as Qe,Z as We,K as ea,C as ee,G as j,z as ae,_ as aa,I as sa,c as ta,$ as oa,a0 as na,D as ra,d as P,f as ia,a1 as la,v as se,a2 as ca,a3 as da,a4 as pa}from"./index-DD5A7mJH.js";import"./mui-6WrS_ojW.js";import fa from"./NotFoundScreen-Dzg5zRVC.js";import{F as ma}from"./FeaturePreviewScreen-CMZ336vr.js";import{a as _}from"./sentry-B9QSZuyZ.js";import{u as ua}from"./useInitialThreadRequest-CqJaxo92.js";import{t as Z,a as X,b as _a}from"./routePaths-BEczkE7A.js";import{M as ha}from"./MobileAppDrawer-BmpM5OEl.js";import"./recharts-HPhXmfTv.js";import"./analytics-C32tZaP0.js";import"./plaid-BwgJPT1f.js";import"./dnd-aedH_7an.js";import"./stripe-DMRn4zHo.js";import"./lottie-0YTaCosS.js";import"./lexical-Dk1uI_nN.js";import"./pdf-XPdZ15Zh.js";import"./utils-7NyLmgtg.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]="6c4c3e2c-5e3e-4d73-aed5-7eb7e621e1b8",e._sentryDebugIdIdentifier="sentry-dbid-6c4c3e2c-5e3e-4d73-aed5-7eb7e621e1b8")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(E({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ya=e=>{e(He()),e(Ne()),e($e()),e(qe())},Ca=Ie(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=v(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=Fe(u);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,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:ke(o),showAccountGroups:r===!0,isAccountingClassesEnabled:J(e),isAccountingProjectsEnabled:Q(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ye(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter(C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year")),e($(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e(q(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(I(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(K({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(H({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(K(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(ze(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e($(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(q(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(xe({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return X(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?X(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(E({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(N({scrollPosition:s}));break;case"balance_sheet":e(k({scrollPosition:s}));break;case"cash_flow":e(F({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(E({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Ve({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Le({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(ve({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(H({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(W())},onUpdateDisplayOrder:a=>{e(je(a))},onUpdateReportFormat:a=>{ya(e),e(Ee(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ca);function ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=We(),f=ea(),u=da(f),a=Ce(),s=ge(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(j.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,C]=_.useState(!1),[L,te]=_.useState(!1),{isFeatureEnabled:B}=l(j.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d(n=>v(n)),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),g=d(n=>w(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:h}=aa(),R=d(n=>n.financeStatementState.selectedReportId),V=d(n=>J(n)),M=d(n=>Q(n)),le=d(n=>w(n).isCompareModeOn),b=d(n=>w(n).filter),O=d(n=>w(n).selectedReportAndTimeframeFetchState),ce=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(C(!0),s(A(c.userId,!0,!0,!1)))},[i,c,s,h]),_.useEffect(()=>{i&&!L&&g==="Completed"&&h&&(s(A(c.userId,!1,!0,!1)),te(!0))},[i,L,g,h]),_.useEffect(()=>{if(i&&O.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(W());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,O,h,V,M]);const U=sa(),de=U?.loggedInUserRole!=null&&Ae(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:he}=G(),z=Xe(he??"")==="reports",be=Je(_e),ye=_.useMemo(()=>z?ba:void 0,[z]);Qe({canFetchSuggestedQuestions:be,pageContexts:ye})}({isDataReady:g==="Completed"}),na({isDataReady:g==="Completed"}),p.jsxs(p.Fragment,{children:[g==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(Ca,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:x,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function za(){const e=d(s=>v(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(j.isDebitCardFeatureEnabled),u=Ke(f,e),a=Ze(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(Y,{path:"/",element:p.jsx(ga,{})}),p.jsx(Y,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
@@ -0,0 +1 @@
1
+ import{j as a}from"./liveblocks-CI520bHO.js";import{C as x,z as w,aS as h,D as E,d as p,f as F,d9 as P,G as T}from"./index-DD5A7mJH.js";import"./mui-6WrS_ojW.js";import m from"./NotFoundScreen-Dzg5zRVC.js";import{a as d}from"./sentry-B9QSZuyZ.js";import{u as L,j as y,h as V,g as A,n as R,o as U,p as u}from"./core-BEqwGbSx.js";import{eX as z,TF as C,P_ as G,TG as v,vK as K,fK as Y,TH as H,vI as O}from"./zeni-epic-state-DDiwMHXL.js";import{R as j}from"./ReferralListScreen-BieHflTg.js";import"./recharts-HPhXmfTv.js";import"./analytics-C32tZaP0.js";import"./plaid-BwgJPT1f.js";import"./dnd-aedH_7an.js";import"./stripe-DMRn4zHo.js";import"./lottie-0YTaCosS.js";import"./lexical-Dk1uI_nN.js";import"./pdf-XPdZ15Zh.js";import"./utils-7NyLmgtg.js";import"./useAskAiCfoHostNavButtonProps-BGHggyph.js";import"./MobileAppDrawer-BmpM5OEl.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]="04ad0630-ba77-4b13-b4b5-b3994dbe3ef6",e._sentryDebugIdIdentifier="sentry-dbid-04ad0630-ba77-4b13-b4b5-b3994dbe3ef6")}catch{}})();const X=R(function(e,t){const n=C(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=w.getSignedInUser();return{onDismissClick:()=>{e(v()),n("..")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}e(O())},onUpdateInviteFormLocalData:s=>{e(H({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),q=()=>{const e=L(),[t,n]=d.useState(!1),[i,s]=d.useState(!1),r=y(o=>z(o)),c=V(),D=A(),{useDynamicConfig:g}=x(),f=w.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const l=y(o=>C(o)),_=f?.firstName!=null?f.firstName:"User",{configValue:b}=g(h.zeniCardsConfig),{configValue:S}=g(h.zeniAccountsConfig),k=G(S);d.useEffect(()=>{e(v()),r?.rewardsLastViewedTime==null&&i===!1&&(e(K()),s(!0))},[]),d.useEffect(()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(Y(!0)))},[l.fetchState,e]);const I=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(E,{analytics:p,onLoad:o=>(N=>N.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,a.jsx(X,{navigate:c,location:D,currentTenant:r,companyName:I,userName:_,inviteFormCompayData:l.localData,chargeCardCashbackRatePerTransaction:b.charge_card_cashback_rate_per_transaction!=null?b.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:k.maxAnnualPercentageYield})]})};function ue(){const{useFeatureGate:e}=x(),{isFeatureEnabled:t}=e(T.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(u,{path:"/",element:t?a.jsx(j,{}):a.jsx(m,{})}),a.jsx(u,{path:"how-it-works",element:t?a.jsx(j,{isReferralDrawerOpen:!0}):a.jsx(m,{})}),a.jsx(u,{path:"refer/*",element:t?a.jsx(q,{}):a.jsx(m,{})}),a.jsx(u,{path:"*",element:a.jsx(m,{})})]})}export{ue as default};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-B58SA_3r.js","assets/sentry-Bv_CMTdO.js","assets/core-EpiYd0dH.js","assets/zeni-epic-state-Dms0qEHD.js","assets/index-CtdTfMzT.js","assets/mui-B9DMc10H.js","assets/analytics-BFERaNq_.js","assets/utils-CpecgzlM.js","assets/withTransactionSidePanel-Bbjo5aqK.js","assets/useAskAiCfoHostNavButtonProps--zCkzMi3.js","assets/TransactionDetailScreen-63KieL8T.js","assets/decodeURIComponentSafe-IenY_Kah.js","assets/routePaths-BA6bWJ0d.js","assets/NotFoundScreen-De6kOHv9.js","assets/useInitialThreadRequest-CxvsW_2d.js","assets/analyticsHelper-CxUZWq8h.js","assets/CompanyPassportScreen-D6jYLDF2.js","assets/MobileAppDrawer-DykdYSpc.js","assets/useAiCfoDashboardSuggestedQuestionsChips-CIioFz4b.js","assets/FeaturePreviewScreen-BakX_uqy.js","assets/ReferralListScreen-C9AlCRQ0.js","assets/index-BUmr5maU.css","assets/BillPayRoutes-Cixo1SNn.js","assets/AddressScreen-Du-97i19.js","assets/DomesticWireDetailScreen-CC3PuPoP.js","assets/DrawerScreen-BwpxQsSs.js","assets/SetupPagesScreen-CKP0m0tv.js","assets/BusinessVerificationPageScreen-CzQ1lRn0.js","assets/BillPayApprovalRoutes-DsVLcKpn.js","assets/ReimbursementApprovalRuleDetailScreen-DbRpFLeK.js","assets/getLocaleForTenant-BMU__UL3.js","assets/ReimbursementRoutes-BtHianla.js","assets/ReimbursementApprovalRoutes-CaPbnBcf.js","assets/TransactionListRoutes-B3jKMEvN.js","assets/ZeniAccountStatementScreen-CD0jWkqM.js","assets/SettingsRoutes-Dl04oqwE.js","assets/accountMappingHelper-C84ncZve.js","assets/useEmailConnectResultRefresh-DAylHZBG.js","assets/QBOConnectionScreen-CUpVGX5k.js","assets/empty-COx6eDQQ.js","assets/index-pQRSpyuH.js","assets/url-CBpyhPBC.js","assets/index-CyK2Gcxx.js","assets/ReportsRoutes-KWai2NUA.js","assets/ChargeCardRoutes-CkjrUh1h.js","assets/useChargeCardPusherEvents-BLJeyGNT.js","assets/PeopleRoutes-DU6z-anW.js","assets/ExpenseAutomationRoutes-CB8jlVuS.js","assets/TreasuryRoutes-k4zHQ9eI.js","assets/useCashManagementBanner-BykprQ5N.js","assets/VendorsRoutes-Bjqg3Qse.js","assets/pathToGoBack-DH_6EPoW.js","assets/ZeniAccountRoutes-maEHkrzk.js","assets/AddressRoutes-Dc-8kEgF.js","assets/PandLWithForecastRoutes-tUGSr_ZD.js","assets/CustomerOnboardingRoutes-CIZUzVCA.js","assets/TransactionDetailRoutes-zxVAFgZ5.js","assets/EntityDetailRoutes-D4aBY2Gt.js","assets/NotificationRoutes-DIjJ5TOx.js","assets/PerformanceRoutes-Cblt21EZ.js","assets/RewardsRoutes-Y97qvuPJ.js","assets/TaskRoutes-XpfuMU1J.js","assets/TaskListScreen-Dc1EjpII.js","assets/AiCfoScreen-DTvxXnCI.js","assets/CardsAiCfoScreen-BVaM35VP.js"])))=>i.map(i=>d[i]);
2
- import{_ as t,bn as ls,eX as us,fE as ds,fC as cs,gk as ms,fr as _s,cU as pe,cA as hs,fU as Es,cs as ps,bE as Rs,bo as xs,fY as gs,v as Is,LZ as js,bs as Ts,L_ as As,bK as Ds,bJ as fs,bt as ys,co as bs,L$ as Cs,M0 as vs,cQ as Us,cT as ws,cS as Os,cz as Ps,cG as Fs,o9 as Re,fA as xe,gu as Ls,g0 as ge,gr as Ie,gs as je,g1 as ks}from"./zeni-epic-state-Dms0qEHD.js";import{j as e}from"./liveblocks-Cml8Dky9.js";import{a as O}from"./sentry-Bv_CMTdO.js";import{u as Hs,h as Bs,i as Vs,g as Ss,j as G,l as Te,N as u,o as Ns,p as a}from"./core-EpiYd0dH.js";import{y as Zs,u as Ms,z as f,C as Gs,c as zs,d as $s,G as z,i as Ys,F as Ws,I as qs,L as F,a as Ae,t as _,P as Js,e as X,l}from"./index-CtdTfMzT.js";import"./mui-B9DMc10H.js";import{f as De}from"./analyticsHelper-CxUZWq8h.js";import{t as Ks}from"./getLocaleForTenant-BMU__UL3.js";import"./recharts-Ct1VSQ_u.js";import"./analytics-BFERaNq_.js";import"./plaid-B2cdYw6c.js";import"./dnd-B4UwQr13.js";import"./stripe-DMRn4zHo.js";import"./lottie-s8xCOGnE.js";import"./lexical-BRwXCMXC.js";import"./pdf-EVuEk9_o.js";import"./utils-CpecgzlM.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},T=new o.Error().stack;T&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[T]="3c6d0a00-47b0-4886-b999-73aa24c2a96d",o._sentryDebugIdIdentifier="sentry-dbid-3c6d0a00-47b0-4886-b999-73aa24c2a96d")}catch{}})();const Qs={dashboard:()=>t(()=>import("./DashboardRoutes-B58SA_3r.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),bills:()=>t(()=>import("./BillPayRoutes-Cixo1SNn.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])),reimbursement:()=>t(()=>import("./ReimbursementRoutes-BtHianla.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])),transactions:()=>t(()=>import("./TransactionListRoutes-B3jKMEvN.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>t(()=>import("./SettingsRoutes-Dl04oqwE.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21])),reports:()=>t(()=>import("./ReportsRoutes-KWai2NUA.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>t(()=>import("./ChargeCardRoutes-CkjrUh1h.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21])),people:()=>t(()=>import("./PeopleRoutes-DU6z-anW.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>t(()=>import("./ExpenseAutomationRoutes-CB8jlVuS.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>t(()=>import("./TreasuryRoutes-k4zHQ9eI.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21])),vendors:()=>t(()=>import("./VendorsRoutes-Bjqg3Qse.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21])),zeniAccounts:()=>t(()=>import("./ZeniAccountRoutes-maEHkrzk.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))},Xs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},et=l(()=>t(()=>import("./ReportsRoutes-KWai2NUA.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21]))),st=l(()=>t(()=>import("./AddressRoutes-Dc-8kEgF.js"),__vite__mapDeps([53,1,2,3,23,4,5,6,7,13,21]))),tt=l(()=>t(()=>import("./PeopleRoutes-DU6z-anW.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21]))),nt=l(()=>t(()=>import("./PandLWithForecastRoutes-tUGSr_ZD.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),at=l(()=>t(()=>import("./CustomerOnboardingRoutes-CIZUzVCA.js"),__vite__mapDeps([55,1,2,3,23,4,5,6,7,13,38,39,40,41,42,11,37,45,21]))),ot=l(()=>t(()=>import("./VendorsRoutes-Bjqg3Qse.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21]))),rt=l(()=>t(()=>import("./TransactionDetailRoutes-zxVAFgZ5.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,10,9,11,12,21]))),fe=l(()=>t(()=>import("./EntityDetailRoutes-D4aBY2Gt.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,11,8,9,10,12,21]))),it=l(()=>t(()=>import("./DashboardRoutes-B58SA_3r.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),ye=l(()=>t(()=>import("./BillPayRoutes-Cixo1SNn.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21]))),lt=l(()=>t(()=>import("./SettingsRoutes-Dl04oqwE.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21]))),be=l(()=>t(()=>import("./ReimbursementRoutes-BtHianla.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21]))),ut=l(()=>t(()=>import("./ZeniAccountRoutes-maEHkrzk.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))),dt=l(()=>t(()=>import("./TreasuryRoutes-k4zHQ9eI.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21]))),ct=l(()=>t(()=>import("./TransactionListRoutes-B3jKMEvN.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),mt=l(()=>t(()=>import("./ChargeCardRoutes-CkjrUh1h.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21]))),_t=l(()=>t(()=>import("./NotificationRoutes-DIjJ5TOx.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,21]))),ht=l(()=>t(()=>import("./PerformanceRoutes-Cblt21EZ.js"),__vite__mapDeps([59,1,2,3,13,4,5,6,7,9,17,21]))),Et=l(()=>t(()=>import("./ExpenseAutomationRoutes-CB8jlVuS.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),pt=l(()=>t(()=>import("./RewardsRoutes-Y97qvuPJ.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,13,20,9,17,21]))),Rt=l(()=>t(()=>import("./TaskRoutes-XpfuMU1J.js"),__vite__mapDeps([61,1,2,3,13,4,5,6,7,14,17,62,9,21]))),xt=l(()=>t(()=>import("./AiCfoScreen-DTvxXnCI.js"),__vite__mapDeps([63,1,2,3,4,5,6,7,18,51,21]))),Ce=l(()=>t(()=>import("./CardsAiCfoScreen-BVaM35VP.js"),__vite__mapDeps([64,1,2,3,4,5,6,7,21]))),b=l(()=>t(()=>import("./NotFoundScreen-De6kOHv9.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),gt=l(()=>t(()=>import("./TaskListScreen-Dc1EjpII.js"),__vite__mapDeps([62,1,2,3,4,5,6,7,9,17,21])));function St({setTenantEmailDomain:o}){const T=Hs(),B=Bs(),{tenantEmailDomain:i}=Vs(),L=Zs().mode,{setLoading:U,clearAllLoading:C,clearLoading:k}=Ms(),v=f.getSignedInUserTenant(i)?.tenantId,I=f.getSignedInUser(),se=ls(I),$=Ss(),[V,Pe]=O.useState(!1),r=G(n=>us(n)),{useFeatureGate:N}=Gs(),Z=zs(),te=$s(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ke}=N(z.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=N(z.isDebitCardFeatureEnabled),A=G(n=>n.tenantState.fetchState),j=G(n=>n.tenantState.activeTenantFetchState.fetchState),h=j==="Completed"||A==="Completed"?ds(ne,r):void 0,J=j==="Completed"||A==="Completed"?cs(r):void 0,He=Ys(r,ke,ne),{isCardsHidden:Be}=Ws(r?.tenantId),Ve=!He||!!Be,{isFeatureEnabled:Se}=N(z.isSettingsFeatureEnabled),{isFeatureEnabled:K}=N(z.isAiCfoFileUploadEnabled),Y=G(n=>ms(n));if(i!=null){const n=f.getSignedInUserTenant(i);I!=null&&n!=null&&De(I,r,L)}const M={tenantId:v,userId:I?.userId,sessionId:I?.zeniSessionId},ae=_s(),E=qs(),Ne=r.company==null||E?.loggedInUserRoleMap!=null&&pe(E.loggedInUserRole),Ze=hs(E?.loggedInUserRoleMap),oe=O.useRef(!0),re=Te("/:tenantEmailDomain/onboarding/*")!==null,Q=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=G(n=>M.tenantId!=null?Es(n,M.tenantId):void 0);O.useEffect(()=>{U(F.TENANT_FETCHING),o(i)},[i]),O.useEffect(()=>{if(Q!=null&&v!=null){const n=Q.params.selectedPeriod;if(n!=null){const D=n.split("-");if(D.length===2){const d=ps(Number(D[0])),s=Number(D[1]),c=Rs(`01-${d<10?`0${d}`:d}-${s}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),S=xs();c.isAfter(S,"month")===!1?T(gs(v,{month:d,year:s})):B("./month_end_close_checks/review")}}}},[Q,v]),O.useEffect(()=>{V||(Pe(!0),U(F.TENANT_FETCHING)),oe.current?oe.current=!1:!Is(ae,M)&&f.isSignedIn()&&(U(F.TENANT_FETCHING),function(n,D,d,s){if(xe(D?.userId,D?.zeniSessionId,n.tenantId),d(Ls(!0)),d(ge(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const c=f.getSignedInUserTenantWithId(n.tenantId);s&&Ae.updateAppLocaleID(Ks(s)),c?.tenantEmailDomain!=null&&f.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}n.userId!=null?X.identify(n.userId,{tenant_id:n.tenantId}):X.resetUserIdentity()}(M,I,T,Me))},[M,ae,I,T,f]),O.useEffect(()=>{f.isSignedIn()&&(U(F.TENANT_FETCHING),function(n,D,d,s,c,S,H){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const W=s!=null&&c?.zeniSessionId!=null,os=d==null||d.tenantId!==s,rs=d!=null&&d.excludedResources==null,is=d!=null&&d.externalConnections==null;if(W&&os){H(ge(s));const q=f.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&f.saveActiveTenantDomainForUser(q?.tenantEmailDomain),xe(c?.userId,c?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(Ie(c.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(je(c.userId,s)))}else W&&rs&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(Ie(c.userId,s))),W&&is&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(je(c.userId,s)));if(W){X.identify(c.userId,{tenant_id:s});const q=s==null||s!=null&&(D==="Completed"||D==="Error");n==="Completed"||D!=="Not-Started"&&D!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),S(F.TENANT_FETCHING),H(ks(c.userId,s,c.zeniSessionId))),q&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),H(Re(c.userId,c.zeniSessionId)))}}(A,j,r,v,I,U,T))},[v,j]),O.useEffect(()=>{f.isSignedIn()&&A==="Completed"&&Y.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),f.saveSignedInUserTenants(js(Y.tenantsBaseInOrder)),I!=null&&De(I,r,L,void 0,Y.tenantsBaseInOrder))},[Y,A,r,I]),O.useEffect(()=>{j==="In-Progress"&&U(F.TENANT_FETCHING),j!=="Completed"&&j!=="Error"||(j==="Completed"&&v!=null?(C(),_.markActiveTenantFetchCompleted(v)):j==="Error"&&v!=null&&(_.markActiveTenantFetchFailed(v),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),A!=="Completed"&&A!=="Error"||(A==="Completed"?_.markAllTenantsFetchCompleted():A==="Error"&&_.markAllTenantsFetchFailed())},[j,A,v,V]);const ie=O.useRef(!1);O.useEffect(()=>{!ie.current&&j==="Completed"&&V&&(ie.current=!0,function(n=Xs,D=3e3){setTimeout(()=>{const d=s=>{if(s>=n.length)return;const c=n[s],S=Qs[c];S!=null?S().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},D)}())},[j,V]);const w=r?.userRole!=null&&Ts(r?.userRole),{isFeatureEnabled:Ge}=N(z.isReferralFeatureEnabled),ze=r?.userRole!=null&&r.userRole.includes("charge_card_user"),$e=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&pe(r.userRole),le=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!w,ue=!Ve&&!w,Ye=As(E?.loggedInUserRoleMap),We=r.externalConnections?.accounting[0]?.isValid,de=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!w,me=ce&&Ds(E?.loggedInUserRoleMap),_e=Fe&&!w,qe=Le&&!w,Je=le&&fs(E?.loggedInUserRoleMap),Ke=ue&&ys(E?.loggedInUserRoleMap),Qe=_e&&bs(E?.loggedInUserRoleMap),Xe=Cs(E?.loggedInUserRoleMap),es=vs(E?.loggedInUserRoleMap),ss=Us(E?.loggedInUserRoleMap),ts=ws(E?.loggedInUserRoleMap),ns=Os(E?.loggedInUserRoleMap),p=Ps(E?.loggedInUserRoleMap),R=Fs(E?.loggedInUserRoleMap),he=le&&p,Ee=ce&&R,x=_e&&ss,g=qe&&ts,m=ue&&ns,as=r.excludedResources?.resources?.find(n=>n.resource==="/invites")!=null||Ze===!0||Ye===!0||Xe===!0||es===!0;return f.isSignedIn()?v==null?A==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&A!=="In-Progress"&&T(Re(I.userId,I.zeniSessionId)),null):j!=="In-Progress"&&j!=="Not-Started"||A==="Completed"?(de===!0||se&&!re)&&We===!1&&h===!1&&J===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!V||de!==!1||re||se?V&&r?.userRole&&h!=null&&J!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Ns,{children:e.jsxs(a,{element:e.jsx(Js,{}),children:[e.jsx(a,{path:"/",element:e.jsx(It,{isDashboardAccess:P,showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,isTenantCardsOnly:J,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(it,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(et,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"people/*",element:as||P?e.jsx(tt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(nt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(at,{})}),e.jsx(a,{path:"transaction/*",element:P&&w===!1||ze||$e?e.jsx(rt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"transactions/*",element:P&&w===!1?e.jsx(ct,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"customer/*",element:P&&w===!1?e.jsx(fe,{entityType:"customer"}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,isTenantBankingOnly:h,showTreasuryRoute:g,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"vendor/*",element:P&&w===!1?e.jsx(fe,{entityType:"vendor"}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"tasks",element:e.jsx(gt,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(Rt,{})}),e.jsx(a,{path:"address/*",element:Je||me||Qe||Ke?e.jsx(st,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"checking/*",element:x?e.jsx(ut,{}):e.jsx(b,{})}),e.jsx(a,{path:"treasury/*",element:g?e.jsx(dt,{}):e.jsx(b,{})}),e.jsx(a,{path:"performance",element:te===!0?e.jsx(ht,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:te===!0&&w===!1?e.jsx(Et,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"notifications/*",element:e.jsx(_t,{})}),e.jsx(a,{path:"vendors/*",element:Ne?e.jsx(ot,{}):e.jsx(b,{})}),e.jsx(a,{path:"bill/*",element:he?e.jsx(ye,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"bills/*",element:he?e.jsx(ye,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursement/*",element:Ee?e.jsx(be,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursements/*",element:Ee?e.jsx(be,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"settings/*",element:Se?e.jsx(lt,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(a,{path:"cards/ask",element:m&&Z?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&Z?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(mt,{}):e.jsx(b,{})}),e.jsx(a,{path:"rewards/*",element:Ge?e.jsx(pt,{}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo",element:Z?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo/",element:Z?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:Z?e.jsx(xt,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"*",element:e.jsx(b,{})})]})}):null:(o(void 0),e.jsx(u,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const It=({isDashboardAccess:o,showZeniAccountRoute:T,isUserHasBillPayAccess:B,isUserHasReimbursementAccess:i,showTreasuryRoute:L,isTenantBankingOnly:U,isTenantCardsOnly:C,showChargeCardRoute:k})=>{if(U===!0){if(T)return e.jsx(u,{to:"checking"});if(L)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return C===!0&&k?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):T?e.jsx(u,{to:"checking"}):L?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):B?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},y=({showZeniAccountRoute:o,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:B,showTreasuryRoute:i,isTenantBankingOnly:L,showChargeCardRoute:U,tenantEmailDomain:C})=>{if(L===!0){if(o)return e.jsx(Ue,{tenantEmailDomain:C});if(i)return e.jsx(ve,{tenantEmailDomain:C});if(U)return e.jsx(we,{tenantEmailDomain:C})}return o?e.jsx(Ue,{tenantEmailDomain:C}):i?e.jsx(ve,{tenantEmailDomain:C}):U?e.jsx(we,{tenantEmailDomain:C}):T?e.jsx(Tt,{tenantEmailDomain:C}):B?e.jsx(jt,{tenantEmailDomain:C}):e.jsx(b,{})},jt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),Tt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),ve=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),we=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),Oe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`});export{y as FallBackRoute,St as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-Cgw_iCM3.js","assets/sentry-B9QSZuyZ.js","assets/core-BEqwGbSx.js","assets/zeni-epic-state-DDiwMHXL.js","assets/index-DD5A7mJH.js","assets/mui-6WrS_ojW.js","assets/analytics-C32tZaP0.js","assets/utils-7NyLmgtg.js","assets/withTransactionSidePanel-CgEEpbzu.js","assets/useAskAiCfoHostNavButtonProps-BGHggyph.js","assets/TransactionDetailScreen-jnjIQhYw.js","assets/decodeURIComponentSafe-DTCbLY6J.js","assets/routePaths-BEczkE7A.js","assets/NotFoundScreen-Dzg5zRVC.js","assets/useInitialThreadRequest-CqJaxo92.js","assets/analyticsHelper-DtQFmi0e.js","assets/CompanyPassportScreen-x21Ap6N1.js","assets/MobileAppDrawer-BmpM5OEl.js","assets/useAiCfoDashboardSuggestedQuestionsChips-DmLt0ng2.js","assets/FeaturePreviewScreen-CMZ336vr.js","assets/ReferralListScreen-BieHflTg.js","assets/index-BUmr5maU.css","assets/BillPayRoutes-DrOfY-VV.js","assets/AddressScreen-UxWcRZmy.js","assets/DomesticWireDetailScreen-C2GdXtSa.js","assets/DrawerScreen-B3cQzzUP.js","assets/SetupPagesScreen-DdbFAdHb.js","assets/BusinessVerificationPageScreen-B2HhT9ni.js","assets/BillPayApprovalRoutes-D-GuovwH.js","assets/ReimbursementApprovalRuleDetailScreen-CkEZJXQa.js","assets/getLocaleForTenant-CPQG2FZU.js","assets/ReimbursementRoutes-92SGBZZl.js","assets/ReimbursementApprovalRoutes-BhxstoNC.js","assets/TransactionListRoutes-BYb7ohjf.js","assets/ZeniAccountStatementScreen-BrNKBtSn.js","assets/SettingsRoutes-C6UHiixM.js","assets/accountMappingHelper-LYbX13CN.js","assets/useEmailConnectResultRefresh-DvejkSG7.js","assets/QBOConnectionScreen-lQslhLmS.js","assets/empty-CTT5XurM.js","assets/index-BHmbllBx.js","assets/url-toWtB1hu.js","assets/index-DgEagwC7.js","assets/ReportsRoutes-a54YeLvu.js","assets/ChargeCardRoutes-CWdtg6YK.js","assets/useChargeCardPusherEvents-CXqYtiJS.js","assets/PeopleRoutes-C4qepWZ_.js","assets/ExpenseAutomationRoutes-BGX8NlRB.js","assets/TreasuryRoutes-D_Nc2Thq.js","assets/useCashManagementBanner-CjSG1LM_.js","assets/VendorsRoutes-BW-uHhrx.js","assets/pathToGoBack-DZgL3eGt.js","assets/ZeniAccountRoutes-BiCibze4.js","assets/AddressRoutes-Up5IwqQs.js","assets/PandLWithForecastRoutes-cuWrGpLk.js","assets/CustomerOnboardingRoutes-DqDGjNdb.js","assets/TransactionDetailRoutes-BXo-56fO.js","assets/EntityDetailRoutes-CpurlHtH.js","assets/NotificationRoutes-BNb1ZPKE.js","assets/PerformanceRoutes-BzhzpXd0.js","assets/RewardsRoutes-0DC-adXs.js","assets/TaskRoutes-BZqNTas-.js","assets/TaskListScreen-B9eSStzs.js","assets/AiCfoScreen-BF05qSzR.js","assets/CardsAiCfoScreen-BPXCnKpZ.js"])))=>i.map(i=>d[i]);
2
+ import{_ as t,bn as ls,eX as us,fE as ds,fC as cs,gk as ms,fr as _s,cV as pe,cB as hs,fU as Es,ct as ps,bE as Rs,bo as xs,fY as gs,v as Is,LZ as js,bs as Ts,L_ as As,bK as fs,bJ as Ds,bt as ys,cp as bs,L$ as Cs,M0 as vs,cR as Us,cU as ws,cT as Os,cA as Ps,cH as Fs,o9 as Re,fA as xe,gu as Ls,g0 as ge,gr as Ie,gs as je,g1 as Hs}from"./zeni-epic-state-DDiwMHXL.js";import{j as e}from"./liveblocks-CI520bHO.js";import{a as O}from"./sentry-B9QSZuyZ.js";import{u as ks,h as Bs,i as Vs,g as Ss,j as G,l as Te,N as u,o as Ns,p as a}from"./core-BEqwGbSx.js";import{y as Zs,u as Ms,z as D,C as Gs,c as zs,S as $s,G as z,i as Ys,H as Ws,I as qs,L as F,a as Ae,t as _,P as Js,d as Q,l}from"./index-DD5A7mJH.js";import"./mui-6WrS_ojW.js";import{f as fe}from"./analyticsHelper-DtQFmi0e.js";import{t as Ks}from"./getLocaleForTenant-CPQG2FZU.js";import"./recharts-HPhXmfTv.js";import"./analytics-C32tZaP0.js";import"./plaid-BwgJPT1f.js";import"./dnd-aedH_7an.js";import"./stripe-DMRn4zHo.js";import"./lottie-0YTaCosS.js";import"./lexical-Dk1uI_nN.js";import"./pdf-XPdZ15Zh.js";import"./utils-7NyLmgtg.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},T=new o.Error().stack;T&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[T]="5733d0b7-d82d-490d-b323-896f5e0bad07",o._sentryDebugIdIdentifier="sentry-dbid-5733d0b7-d82d-490d-b323-896f5e0bad07")}catch{}})();const Xs={dashboard:()=>t(()=>import("./DashboardRoutes-Cgw_iCM3.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),bills:()=>t(()=>import("./BillPayRoutes-DrOfY-VV.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])),reimbursement:()=>t(()=>import("./ReimbursementRoutes-92SGBZZl.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])),transactions:()=>t(()=>import("./TransactionListRoutes-BYb7ohjf.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>t(()=>import("./SettingsRoutes-C6UHiixM.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21])),reports:()=>t(()=>import("./ReportsRoutes-a54YeLvu.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>t(()=>import("./ChargeCardRoutes-CWdtg6YK.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21])),people:()=>t(()=>import("./PeopleRoutes-C4qepWZ_.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>t(()=>import("./ExpenseAutomationRoutes-BGX8NlRB.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>t(()=>import("./TreasuryRoutes-D_Nc2Thq.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21])),vendors:()=>t(()=>import("./VendorsRoutes-BW-uHhrx.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21])),zeniAccounts:()=>t(()=>import("./ZeniAccountRoutes-BiCibze4.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))},Qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},et=l(()=>t(()=>import("./ReportsRoutes-a54YeLvu.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21]))),st=l(()=>t(()=>import("./AddressRoutes-Up5IwqQs.js"),__vite__mapDeps([53,1,2,3,23,4,5,6,7,13,21]))),tt=l(()=>t(()=>import("./PeopleRoutes-C4qepWZ_.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21]))),nt=l(()=>t(()=>import("./PandLWithForecastRoutes-cuWrGpLk.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),at=l(()=>t(()=>import("./CustomerOnboardingRoutes-DqDGjNdb.js"),__vite__mapDeps([55,1,2,3,23,4,5,6,7,13,38,39,40,41,42,11,37,45,21]))),ot=l(()=>t(()=>import("./VendorsRoutes-BW-uHhrx.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21]))),rt=l(()=>t(()=>import("./TransactionDetailRoutes-BXo-56fO.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,10,9,11,12,21]))),De=l(()=>t(()=>import("./EntityDetailRoutes-CpurlHtH.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,11,8,9,10,12,21]))),it=l(()=>t(()=>import("./DashboardRoutes-Cgw_iCM3.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),ye=l(()=>t(()=>import("./BillPayRoutes-DrOfY-VV.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21]))),lt=l(()=>t(()=>import("./SettingsRoutes-C6UHiixM.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21]))),be=l(()=>t(()=>import("./ReimbursementRoutes-92SGBZZl.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21]))),ut=l(()=>t(()=>import("./ZeniAccountRoutes-BiCibze4.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))),dt=l(()=>t(()=>import("./TreasuryRoutes-D_Nc2Thq.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21]))),ct=l(()=>t(()=>import("./TransactionListRoutes-BYb7ohjf.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),mt=l(()=>t(()=>import("./ChargeCardRoutes-CWdtg6YK.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21]))),_t=l(()=>t(()=>import("./NotificationRoutes-BNb1ZPKE.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,21]))),ht=l(()=>t(()=>import("./PerformanceRoutes-BzhzpXd0.js"),__vite__mapDeps([59,1,2,3,13,4,5,6,7,9,17,21]))),Et=l(()=>t(()=>import("./ExpenseAutomationRoutes-BGX8NlRB.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),pt=l(()=>t(()=>import("./RewardsRoutes-0DC-adXs.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,13,20,9,17,21]))),Rt=l(()=>t(()=>import("./TaskRoutes-BZqNTas-.js"),__vite__mapDeps([61,1,2,3,13,4,5,6,7,14,17,62,9,21]))),xt=l(()=>t(()=>import("./AiCfoScreen-BF05qSzR.js"),__vite__mapDeps([63,1,2,3,4,5,6,7,18,51,21]))),Ce=l(()=>t(()=>import("./CardsAiCfoScreen-BPXCnKpZ.js"),__vite__mapDeps([64,1,2,3,4,5,6,7,21]))),b=l(()=>t(()=>import("./NotFoundScreen-Dzg5zRVC.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),gt=l(()=>t(()=>import("./TaskListScreen-B9eSStzs.js"),__vite__mapDeps([62,1,2,3,4,5,6,7,9,17,21])));function St({setTenantEmailDomain:o}){const T=ks(),B=Bs(),{tenantEmailDomain:i}=Vs(),L=Zs().mode,{setLoading:U,clearAllLoading:C,clearLoading:H}=Ms(),v=D.getSignedInUserTenant(i)?.tenantId,I=D.getSignedInUser(),se=ls(I),$=Ss(),[V,Pe]=O.useState(!1),r=G(n=>us(n)),{useFeatureGate:N}=Gs(),Z=zs(),te=$s(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:He}=N(z.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=N(z.isDebitCardFeatureEnabled),A=G(n=>n.tenantState.fetchState),j=G(n=>n.tenantState.activeTenantFetchState.fetchState),h=j==="Completed"||A==="Completed"?ds(ne,r):void 0,J=j==="Completed"||A==="Completed"?cs(r):void 0,ke=Ys(r,He,ne),{isCardsHidden:Be}=Ws(r?.tenantId),Ve=!ke||!!Be,{isFeatureEnabled:Se}=N(z.isSettingsFeatureEnabled),{isFeatureEnabled:K}=N(z.isAiCfoFileUploadEnabled),Y=G(n=>ms(n));if(i!=null){const n=D.getSignedInUserTenant(i);I!=null&&n!=null&&fe(I,r,L)}const M={tenantId:v,userId:I?.userId,sessionId:I?.zeniSessionId},ae=_s(),E=qs(),Ne=r.company==null||E?.loggedInUserRoleMap!=null&&pe(E.loggedInUserRole),Ze=hs(E?.loggedInUserRoleMap),oe=O.useRef(!0),re=Te("/:tenantEmailDomain/onboarding/*")!==null,X=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=G(n=>M.tenantId!=null?Es(n,M.tenantId):void 0);O.useEffect(()=>{U(F.TENANT_FETCHING),o(i)},[i]),O.useEffect(()=>{if(X!=null&&v!=null){const n=X.params.selectedPeriod;if(n!=null){const f=n.split("-");if(f.length===2){const d=ps(Number(f[0])),s=Number(f[1]),c=Rs(`01-${d<10?`0${d}`:d}-${s}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),S=xs();c.isAfter(S,"month")===!1?T(gs(v,{month:d,year:s})):B("./month_end_close_checks/review")}}}},[X,v]),O.useEffect(()=>{V||(Pe(!0),U(F.TENANT_FETCHING)),oe.current?oe.current=!1:!Is(ae,M)&&D.isSignedIn()&&(U(F.TENANT_FETCHING),function(n,f,d,s){if(xe(f?.userId,f?.zeniSessionId,n.tenantId),d(Ls(!0)),d(ge(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const c=D.getSignedInUserTenantWithId(n.tenantId);s&&Ae.updateAppLocaleID(Ks(s)),c?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}n.userId!=null?Q.identify(n.userId,{tenant_id:n.tenantId}):Q.resetUserIdentity()}(M,I,T,Me))},[M,ae,I,T,D]),O.useEffect(()=>{D.isSignedIn()&&(U(F.TENANT_FETCHING),function(n,f,d,s,c,S,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const W=s!=null&&c?.zeniSessionId!=null,os=d==null||d.tenantId!==s,rs=d!=null&&d.excludedResources==null,is=d!=null&&d.externalConnections==null;if(W&&os){k(ge(s));const q=D.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(q?.tenantEmailDomain),xe(c?.userId,c?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Ie(c.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(je(c.userId,s)))}else W&&rs&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Ie(c.userId,s))),W&&is&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(je(c.userId,s)));if(W){Q.identify(c.userId,{tenant_id:s});const q=s==null||s!=null&&(f==="Completed"||f==="Error");n==="Completed"||f!=="Not-Started"&&f!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),S(F.TENANT_FETCHING),k(Hs(c.userId,s,c.zeniSessionId))),q&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Re(c.userId,c.zeniSessionId)))}}(A,j,r,v,I,U,T))},[v,j]),O.useEffect(()=>{D.isSignedIn()&&A==="Completed"&&Y.tenantsBaseInOrder.length>0&&(H(F.TENANT_FETCHING),D.saveSignedInUserTenants(js(Y.tenantsBaseInOrder)),I!=null&&fe(I,r,L,void 0,Y.tenantsBaseInOrder))},[Y,A,r,I]),O.useEffect(()=>{j==="In-Progress"&&U(F.TENANT_FETCHING),j!=="Completed"&&j!=="Error"||(j==="Completed"&&v!=null?(C(),_.markActiveTenantFetchCompleted(v)):j==="Error"&&v!=null&&(_.markActiveTenantFetchFailed(v),H(F.TENANT_FETCHING),H(F.TENANT_SWITCHING))),A!=="Completed"&&A!=="Error"||(A==="Completed"?_.markAllTenantsFetchCompleted():A==="Error"&&_.markAllTenantsFetchFailed())},[j,A,v,V]);const ie=O.useRef(!1);O.useEffect(()=>{!ie.current&&j==="Completed"&&V&&(ie.current=!0,function(n=Qs,f=3e3){setTimeout(()=>{const d=s=>{if(s>=n.length)return;const c=n[s],S=Xs[c];S!=null?S().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},f)}())},[j,V]);const w=r?.userRole!=null&&Ts(r?.userRole),{isFeatureEnabled:Ge}=N(z.isReferralFeatureEnabled),ze=r?.userRole!=null&&r.userRole.includes("charge_card_user"),$e=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&pe(r.userRole),le=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!w,ue=!Ve&&!w,Ye=As(E?.loggedInUserRoleMap),We=r.externalConnections?.accounting[0]?.isValid,de=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!w,me=ce&&fs(E?.loggedInUserRoleMap),_e=Fe&&!w,qe=Le&&!w,Je=le&&Ds(E?.loggedInUserRoleMap),Ke=ue&&ys(E?.loggedInUserRoleMap),Xe=_e&&bs(E?.loggedInUserRoleMap),Qe=Cs(E?.loggedInUserRoleMap),es=vs(E?.loggedInUserRoleMap),ss=Us(E?.loggedInUserRoleMap),ts=ws(E?.loggedInUserRoleMap),ns=Os(E?.loggedInUserRoleMap),p=Ps(E?.loggedInUserRoleMap),R=Fs(E?.loggedInUserRoleMap),he=le&&p,Ee=ce&&R,x=_e&&ss,g=qe&&ts,m=ue&&ns,as=r.excludedResources?.resources?.find(n=>n.resource==="/invites")!=null||Ze===!0||Ye===!0||Qe===!0||es===!0;return D.isSignedIn()?v==null?A==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&A!=="In-Progress"&&T(Re(I.userId,I.zeniSessionId)),null):j!=="In-Progress"&&j!=="Not-Started"||A==="Completed"?(de===!0||se&&!re)&&We===!1&&h===!1&&J===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!V||de!==!1||re||se?V&&r?.userRole&&h!=null&&J!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Ns,{children:e.jsxs(a,{element:e.jsx(Js,{}),children:[e.jsx(a,{path:"/",element:e.jsx(It,{isDashboardAccess:P,showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,isTenantCardsOnly:J,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(it,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(et,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"people/*",element:as||P?e.jsx(tt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(nt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(at,{})}),e.jsx(a,{path:"transaction/*",element:P&&w===!1||ze||$e?e.jsx(rt,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"transactions/*",element:P&&w===!1?e.jsx(ct,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"customer/*",element:P&&w===!1?e.jsx(De,{entityType:"customer"}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,isTenantBankingOnly:h,showTreasuryRoute:g,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"vendor/*",element:P&&w===!1?e.jsx(De,{entityType:"vendor"}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"tasks",element:e.jsx(gt,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(Rt,{})}),e.jsx(a,{path:"address/*",element:Je||me||Xe||Ke?e.jsx(st,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"checking/*",element:x?e.jsx(ut,{}):e.jsx(b,{})}),e.jsx(a,{path:"treasury/*",element:g?e.jsx(dt,{}):e.jsx(b,{})}),e.jsx(a,{path:"performance",element:te===!0?e.jsx(ht,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:te===!0&&w===!1?e.jsx(Et,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"notifications/*",element:e.jsx(_t,{})}),e.jsx(a,{path:"vendors/*",element:Ne?e.jsx(ot,{}):e.jsx(b,{})}),e.jsx(a,{path:"bill/*",element:he?e.jsx(ye,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"bills/*",element:he?e.jsx(ye,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursement/*",element:Ee?e.jsx(be,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursements/*",element:Ee?e.jsx(be,{}):e.jsx(y,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"settings/*",element:Se?e.jsx(lt,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(a,{path:"cards/ask",element:m&&Z?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&Z?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(mt,{}):e.jsx(b,{})}),e.jsx(a,{path:"rewards/*",element:Ge?e.jsx(pt,{}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo",element:Z?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo/",element:Z?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:Z?e.jsx(xt,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"*",element:e.jsx(b,{})})]})}):null:(o(void 0),e.jsx(u,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const It=({isDashboardAccess:o,showZeniAccountRoute:T,isUserHasBillPayAccess:B,isUserHasReimbursementAccess:i,showTreasuryRoute:L,isTenantBankingOnly:U,isTenantCardsOnly:C,showChargeCardRoute:H})=>{if(U===!0){if(T)return e.jsx(u,{to:"checking"});if(L)return e.jsx(u,{to:"treasury"});if(H)return e.jsx(u,{to:"cards"})}return C===!0&&H?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):T?e.jsx(u,{to:"checking"}):L?e.jsx(u,{to:"treasury"}):H?e.jsx(u,{to:"cards"}):B?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},y=({showZeniAccountRoute:o,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:B,showTreasuryRoute:i,isTenantBankingOnly:L,showChargeCardRoute:U,tenantEmailDomain:C})=>{if(L===!0){if(o)return e.jsx(Ue,{tenantEmailDomain:C});if(i)return e.jsx(ve,{tenantEmailDomain:C});if(U)return e.jsx(we,{tenantEmailDomain:C})}return o?e.jsx(Ue,{tenantEmailDomain:C}):i?e.jsx(ve,{tenantEmailDomain:C}):U?e.jsx(we,{tenantEmailDomain:C}):T?e.jsx(Tt,{tenantEmailDomain:C}):B?e.jsx(jt,{tenantEmailDomain:C}):e.jsx(b,{})},jt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),Tt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),ve=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),we=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),Oe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`});export{y as FallBackRoute,St as default};
@@ -1,4 +1,4 @@
1
- import{j as o}from"./liveblocks-Cml8Dky9.js";import{a as u}from"./sentry-Bv_CMTdO.js";import{h as L,g as Q,u as U,j as S,s as re,n as Z,i as H,o as ne,p as v}from"./core-EpiYd0dH.js";import{bn as De,eX as P,gp as Me,m$ as le,Oi as Te,hF as he,O9 as Ue,qR as _e,kx as be,mX as Fe,hH as Re,Ob as Be,Oa as Oe,QB as Ve,zl as ze,EO as Le,Qa as Ne,Qj as $e,c6 as ae,cL as Qe,cM as Ze,bs as He,Ma as Ge,xN as Ke,QC as Xe,Hd as qe,Eu as Je,El as Se,Ei as Ye,xR as ye,Eo as Ce,Er as Ie,Ex as oe,ub as se,xQ as We,k9 as J,kc as Ee,QD as en,ld as nn,y4 as tn,N1 as an,N2 as on,k7 as sn,QE as cn,ka as rn,rj as ln,MY as dn,MZ as un,rn as pn,hq as gn,Mi as ee,hi as de,hf as mn,hn as fn,Mj as hn,y1 as bn,QF as Sn,QG as yn,EL as Cn,fC as Ae,fE as xe,QH as In,gd as En,Ms as An,y0 as ue,gi as pe,gh as xn,x$ as vn,gg as kn,gf as wn,QI as jn,fH as ve,QJ as Pn,QK as Dn,y7 as Mn,x_ as ge,QL as Tn,fX as Un,xX as _n,bZ as Fn,c5 as Rn,c4 as Bn,b_ as On,c2 as Vn,c1 as zn,c0 as Ln,c3 as Nn,b$ as $n}from"./zeni-epic-state-Dms0qEHD.js";import{C as Y,G as O,z as w,ag as ke,bT as Qn,e as G,g as Zn,bE as Hn,I as K,B as ie,bU as Gn,i as we,F as je,bV as Kn,ar as Xn,k as Pe,bW as qn,bX as Jn,bY as Yn,Z as Wn,bZ as et,r as nt,b_ as tt}from"./index-CtdTfMzT.js";import{n as V}from"./mui-B9DMc10H.js";import{M as R}from"./MobileAppDrawer-DykdYSpc.js";import{a as X,g as q,m as at}from"./accountMappingHelper-C84ncZve.js";import{t as ot,A as st}from"./AddressScreen-Du-97i19.js";import $ from"./NotFoundScreen-De6kOHv9.js";import{g as it}from"./analyticsHelper-CxUZWq8h.js";import{B as ct}from"./BusinessVerificationPageScreen-CzQ1lRn0.js";import{C as rt}from"./CompanyPassportScreen-D6jYLDF2.js";import{u as lt,a as dt}from"./useEmailConnectResultRefresh-DAylHZBG.js";import{q as me}from"./QBOConnectionScreen-CUpVGX5k.js";import{B as ut}from"./BillPayApprovalRoutes-DsVLcKpn.js";import{R as pt}from"./ReimbursementApprovalRoutes-CaPbnBcf.js";import"./recharts-Ct1VSQ_u.js";import"./analytics-BFERaNq_.js";import"./plaid-B2cdYw6c.js";import"./dnd-B4UwQr13.js";import"./stripe-DMRn4zHo.js";import"./lottie-s8xCOGnE.js";import"./lexical-BRwXCMXC.js";import"./pdf-EVuEk9_o.js";import"./utils-CpecgzlM.js";import"./routePaths-BA6bWJ0d.js";import"./empty-COx6eDQQ.js";import"./pdf-lib-CvBA5q_E.js";import"./index-pQRSpyuH.js";import"./url-CBpyhPBC.js";import"./index-CyK2Gcxx.js";import"./decodeURIComponentSafe-IenY_Kah.js";import"./ReimbursementApprovalRuleDetailScreen-DbRpFLeK.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]="79754a25-93bc-4435-b60e-658c90487999",e._sentryDebugIdIdentifier="sentry-dbid-79754a25-93bc-4435-b60e-658c90487999")}catch{}})();const gt=V.div`
1
+ import{j as o}from"./liveblocks-CI520bHO.js";import{a as u}from"./sentry-B9QSZuyZ.js";import{h as L,g as Q,u as _,j as S,s as le,n as H,i as Z,o as ne,p as v}from"./core-BEqwGbSx.js";import{bn as De,eX as P,gp as Me,m$ as re,Oi as Te,hF as he,O9 as _e,qR as Ue,kx as be,mX as Re,hH as Be,Ob as Fe,Oa as Oe,QB as Ve,zl as ze,EO as Le,Qa as Ne,Qj as $e,c6 as ae,cM as Qe,cN as He,bs as Ze,Ma as Ge,xN as Ke,QC as Xe,Hd as qe,Eu as Je,El as Se,Ei as Ye,xR as ye,Eo as Ce,Er as Ie,Ex as oe,ub as se,xQ as We,k9 as J,kc as Ee,QD as en,ld as nn,y4 as tn,N1 as an,N2 as on,k7 as sn,QE as cn,ka as ln,rj as rn,MY as dn,MZ as un,rn as pn,hq as gn,Mi as ee,hi as de,hf as mn,hn as fn,Mj as hn,y1 as bn,QF as Sn,QG as yn,EL as Cn,fC as Ae,fE as xe,QH as In,gd as En,Ms as An,y0 as ue,gi as pe,gh as xn,x$ as vn,gg as wn,gf as kn,QI as jn,fH as ve,QJ as Pn,QK as Dn,y7 as Mn,x_ as ge,QL as Tn,fX as _n,xX as Un,bZ as Rn,c5 as Bn,c4 as Fn,b_ as On,c2 as Vn,c1 as zn,c0 as Ln,c3 as Nn,b$ as $n}from"./zeni-epic-state-DDiwMHXL.js";import{C as Y,G as O,z as k,ag as we,bT as Qn,d as G,f as Hn,bE as Zn,I as K,B as ie,bU as Gn,i as ke,H as je,bV as Kn,ar as Xn,j as Pe,bW as qn,bX as Jn,bY as Yn,_ as Wn,bZ as et,v as nt,b_ as tt}from"./index-DD5A7mJH.js";import{n as V}from"./mui-6WrS_ojW.js";import{M as B}from"./MobileAppDrawer-BmpM5OEl.js";import{a as X,g as q,m as at}from"./accountMappingHelper-LYbX13CN.js";import{t as ot,A as st}from"./AddressScreen-UxWcRZmy.js";import $ from"./NotFoundScreen-Dzg5zRVC.js";import{g as it}from"./analyticsHelper-DtQFmi0e.js";import{B as ct}from"./BusinessVerificationPageScreen-B2HhT9ni.js";import{C as lt}from"./CompanyPassportScreen-x21Ap6N1.js";import{u as rt,a as dt}from"./useEmailConnectResultRefresh-DvejkSG7.js";import{q as me}from"./QBOConnectionScreen-lQslhLmS.js";import{B as ut}from"./BillPayApprovalRoutes-D-GuovwH.js";import{R as pt}from"./ReimbursementApprovalRoutes-BhxstoNC.js";import"./recharts-HPhXmfTv.js";import"./analytics-C32tZaP0.js";import"./plaid-BwgJPT1f.js";import"./dnd-aedH_7an.js";import"./stripe-DMRn4zHo.js";import"./lottie-0YTaCosS.js";import"./lexical-Dk1uI_nN.js";import"./pdf-XPdZ15Zh.js";import"./utils-7NyLmgtg.js";import"./routePaths-BEczkE7A.js";import"./empty-CTT5XurM.js";import"./pdf-lib-DImtf-Hd.js";import"./index-BHmbllBx.js";import"./url-toWtB1hu.js";import"./index-DgEagwC7.js";import"./decodeURIComponentSafe-DTCbLY6J.js";import"./ReimbursementApprovalRuleDetailScreen-CkEZJXQa.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]="34160ed7-d824-4caf-8f06-61a6c833ce31",e._sentryDebugIdIdentifier="sentry-dbid-34160ed7-d824-4caf-8f06-61a6c833ce31")}catch{}})();const gt=V.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as o}from"./liveblocks-Cml8Dky9.js";import{a as u}from"./sentry-Bv_CMTd
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,mt=Z(function(e,a){return{accountMappingView:a.accountMappingView,isFiling1099FeatureEnabled:a.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:a.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:be(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:_e(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",isCapitalizationFeatureEnabled:a.isCapitalizationFeatureEnabled,capitalizableAccounts:a.capitalizableAccounts,accountNamesById:a.accountNamesById,capitalizableAccountOverrides:a.capitalizableAccountOverrides,isCapitalizationThresholdSaving:a.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:a.onSaveCapitalizationAccountThreshold}},function(e,a){const{navigate:s,location:c,isFiling1099FeatureEnabled:r}=a;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:t,billsAccountSection:i,reimbursementsAccountSection:p,vendorsAccountSection:m,filing1099Section:f}=n,{incomeAccount:y,expenseAccount:g}=t,{billPayAccount:l}=i,{reimbursementsAccount:b}=p,{prepaidExpensesAccount:I,fixedAssetsAccount:k,accruedExpensesAccount:A}=m,{bankAccount:h,expenseCategory1099:E}=f,_=X(a.accountMappingView.incomeAccountList,y.selectedOption),M=X(a.accountMappingView.expenseAccountList,g.selectedOption),x=X(a.accountMappingView.billPayAccountList,l.selectedOption),F=X(a.accountMappingView.reimbursementsAccountList,b.selectedOption),D=q(a.accountMappingView.prepaidExpensesAccountList,I.selectedOptions),N=q(a.accountMappingView.fixedAssetsAccountList,k.selectedOptions),B=q(a.accountMappingView.accruedExpensesAccountList,A.selectedOptions),d=q(a.accountMappingView.bankAccounts1099FilingAccountList,h.selectedOptions),C=at(a.accountMappingView.expenseAccounts1099FilingAccountList,E),T={selectedIncomeAccountId:_?.accountId,selectedExpenseAccountId:M?.accountId,selectedBillPayAccountId:x?.accountId,selectedReimbursementsAccountId:F?.accountId,selectedPrepaidExpensesAccountIds:D.map(j=>j.accountId),selectedFixedAssetsAccountIds:N.map(j=>j.accountId),selectedAccruedExpensesAccountIds:B.map(j=>j.accountId),selectedBankAccounts1099FilingAccountIds:d.map(j=>j.accountId),selectedExpenseAccounts1099FilingAccountIds:C};e(Oe({data:T}))},onBackClick:()=>{ke(c)===!1?(s("../../dashboard"),e(Be())):e(he())},onSaveClick:()=>{e(Re()),r&&G.track(Zn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Fe(a.currentTenant.companyId,n))}}})(Qn),ft=()=>{const e=L(),a=Q(),s=U(),{useFeatureGate:c,useDynamicConfig:r}=Y(),{isFeatureEnabled:n}=c(O.isFiling1099FeatureEnabled),{isFeatureEnabled:t}=c(O.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:i,isDynamicConfigLoading:p}=r("transaction_categorization_config"),m=!p&&i?.capitalization_enabled===!0,f=w.getSignedInUser(),y=De(f),g=S(d=>P(d)),{capitalizableAccounts:l,capitalizableAccountOverrides:b,isCapitalizationThresholdSaving:I,currencySymbol:k}=S(d=>{const C=d.tenantState.currentTenantId,T=C!=null?d.tenantState.tenantsById[C]:void 0,j=Me(d.companyState,g.companyId);return{capitalizableAccounts:T?.capitalizableAccounts??null,capitalizableAccountOverrides:T?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:d.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:j?.company.companyLocaleInfo?.currencySymbol??"$"}},re),A=u.useCallback((d,C)=>{s(le(g.companyId,d,C))},[s,g.companyId]),h=u.useCallback(d=>{const C={...b??{}},T=Object.entries(d);for(const[z,ce]of T)ce===null?delete C[z]:C[z]=ce;const[j,W]=T[0]??[];j!=null&&s(le(g.companyId,j,W,void 0,Object.keys(C).length>0?C:null))},[s,g.companyId,b]),E=S(d=>Te(d.accountState),re),_=u.useMemo(()=>{const d={};for(const C of E)C.accountId!=null&&C.accountName!=null&&(d[C.accountId]=C.accountName);return d},[E]),[M,x]=u.useState(!1),[F,D]=u.useState(!1);u.useEffect(()=>{M===!1&&(s(he()),x(!0))},[M]);const N=S(d=>Ue(d)),B=d=>{D(d)};return o.jsxs(gt,{children:[o.jsx(R,{isAppContentDrawerOpen:F,handleDrawerToggle:B}),o.jsx(mt,{currentTenant:g,navigate:e,accountMappingView:N,isFiling1099FeatureEnabled:n&&y,isAccruedExpensesFeatureEnabled:t,isCapitalizationFeatureEnabled:m,capitalizableAccounts:l,accountNamesById:_,capitalizableAccountOverrides:b,currencySymbol:k,isCapitalizationThresholdSaving:I,onSaveCapitalizationAccountThreshold:A,onSaveCapitalizationAccountThresholds:h,location:a,isSettings:ke(a),onClickMenuIcon:()=>B(!0)})]})},ht=V.div`
9
+ `,mt=H(function(e,a){return{accountMappingView:a.accountMappingView,isFiling1099FeatureEnabled:a.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:a.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:be(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Ue(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",isCapitalizationFeatureEnabled:a.isCapitalizationFeatureEnabled,capitalizableAccounts:a.capitalizableAccounts,accountNamesById:a.accountNamesById,capitalizableAccountOverrides:a.capitalizableAccountOverrides,isCapitalizationThresholdSaving:a.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:a.onSaveCapitalizationAccountThreshold}},function(e,a){const{navigate:s,location:c,isFiling1099FeatureEnabled:l}=a;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:t,billsAccountSection:i,reimbursementsAccountSection:p,vendorsAccountSection:m,filing1099Section:f}=n,{incomeAccount:y,expenseAccount:g}=t,{billPayAccount:r}=i,{reimbursementsAccount:b}=p,{prepaidExpensesAccount:I,fixedAssetsAccount:w,accruedExpensesAccount:A}=m,{bankAccount:h,expenseCategory1099:E}=f,U=X(a.accountMappingView.incomeAccountList,y.selectedOption),M=X(a.accountMappingView.expenseAccountList,g.selectedOption),x=X(a.accountMappingView.billPayAccountList,r.selectedOption),R=X(a.accountMappingView.reimbursementsAccountList,b.selectedOption),D=q(a.accountMappingView.prepaidExpensesAccountList,I.selectedOptions),N=q(a.accountMappingView.fixedAssetsAccountList,w.selectedOptions),F=q(a.accountMappingView.accruedExpensesAccountList,A.selectedOptions),d=q(a.accountMappingView.bankAccounts1099FilingAccountList,h.selectedOptions),C=at(a.accountMappingView.expenseAccounts1099FilingAccountList,E),T={selectedIncomeAccountId:U?.accountId,selectedExpenseAccountId:M?.accountId,selectedBillPayAccountId:x?.accountId,selectedReimbursementsAccountId:R?.accountId,selectedPrepaidExpensesAccountIds:D.map(j=>j.accountId),selectedFixedAssetsAccountIds:N.map(j=>j.accountId),selectedAccruedExpensesAccountIds:F.map(j=>j.accountId),selectedBankAccounts1099FilingAccountIds:d.map(j=>j.accountId),selectedExpenseAccounts1099FilingAccountIds:C};e(Oe({data:T}))},onBackClick:()=>{we(c)===!1?(s("../../dashboard"),e(Fe())):e(he())},onSaveClick:()=>{e(Be()),l&&G.track(Hn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Re(a.currentTenant.companyId,n))}}})(Qn),ft=()=>{const e=L(),a=Q(),s=_(),{useFeatureGate:c,useDynamicConfig:l}=Y(),{isFeatureEnabled:n}=c(O.isFiling1099FeatureEnabled),{isFeatureEnabled:t}=c(O.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:i,isDynamicConfigLoading:p}=l("transaction_categorization_config"),m=!p&&i?.capitalization_enabled===!0,f=k.getSignedInUser(),y=De(f),g=S(d=>P(d)),{capitalizableAccounts:r,capitalizableAccountOverrides:b,isCapitalizationThresholdSaving:I,currencySymbol:w}=S(d=>{const C=d.tenantState.currentTenantId,T=C!=null?d.tenantState.tenantsById[C]:void 0,j=Me(d.companyState,g.companyId);return{capitalizableAccounts:T?.capitalizableAccounts??null,capitalizableAccountOverrides:T?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:d.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:j?.company.companyLocaleInfo?.currencySymbol??"$"}},le),A=u.useCallback((d,C)=>{s(re(g.companyId,d,C))},[s,g.companyId]),h=u.useCallback(d=>{const C={...b??{}},T=Object.entries(d);for(const[z,ce]of T)ce===null?delete C[z]:C[z]=ce;const[j,W]=T[0]??[];j!=null&&s(re(g.companyId,j,W,void 0,Object.keys(C).length>0?C:null))},[s,g.companyId,b]),E=S(d=>Te(d.accountState),le),U=u.useMemo(()=>{const d={};for(const C of E)C.accountId!=null&&C.accountName!=null&&(d[C.accountId]=C.accountName);return d},[E]),[M,x]=u.useState(!1),[R,D]=u.useState(!1);u.useEffect(()=>{M===!1&&(s(he()),x(!0))},[M]);const N=S(d=>_e(d)),F=d=>{D(d)};return o.jsxs(gt,{children:[o.jsx(B,{isAppContentDrawerOpen:R,handleDrawerToggle:F}),o.jsx(mt,{currentTenant:g,navigate:e,accountMappingView:N,isFiling1099FeatureEnabled:n&&y,isAccruedExpensesFeatureEnabled:t,isCapitalizationFeatureEnabled:m,capitalizableAccounts:r,accountNamesById:U,capitalizableAccountOverrides:b,currencySymbol:w,isCapitalizationThresholdSaving:I,onSaveCapitalizationAccountThreshold:A,onSaveCapitalizationAccountThresholds:h,location:a,isSettings:we(a),onClickMenuIcon:()=>F(!0)})]})},ht=V.div`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -14,7 +14,7 @@ import{j as o}from"./liveblocks-Cml8Dky9.js";import{a as u}from"./sentry-Bv_CMTd
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,bt=Z(function(e,a){const s=P(e),c=Ne(e),r=$e(e),n=a.roleMap.bill_pay_admin;return{isDisabled:(ae(s?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:r,analytics:G}},function(e,a){const{navigate:s,currentTenant:c}=a;return{onSetupApprovalRulesBillPaySectionClick:()=>{s("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{s("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Gn),St=()=>{const e=L(),a=Q(),s=U(),{tenantEmailDomain:c}=H(),[r,n]=u.useState(!1),[t,i]=u.useState(!1),[p,m]=u.useState(!1),f=S(E=>P(E)),y=S(E=>E.billPaySetupApproverViewState.fetchState),g=S(E=>E.remiSetupApproverViewState.fetchState),l=S(E=>Ve(E)),{isApprovalRulesV3Enabled:b,isLoading:I}=Hn(f?.tenantId),k=f.companyId??w.getSignedInUserTenant(c)?.companyId;if(w.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const A=K();u.useEffect(()=>{p||y!=="Not-Started"||I||(m(!0),s(ze(!0,!0,b)))},[p,y,I,b,s]),u.useEffect(()=>{t||g!=="Not-Started"||I||(i(!0),s(Le(!0,!1,!1,b)))},[t,g,I,b,s]);const h=E=>{n(E)};return A?.loggedInUserRoleMap!=null?o.jsxs(ht,{children:[o.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:h}),o.jsx(bt,{navigate:e,location:a,companyId:k,currentTenant:f,roleMap:A.loggedInUserRoleMap,onClickMenuIcon:()=>{h(!0)}})]}):o.jsx(ie,{fetchState:l.fetchState})},yt=V.div`
17
+ `,bt=H(function(e,a){const s=P(e),c=Ne(e),l=$e(e),n=a.roleMap.bill_pay_admin;return{isDisabled:(ae(s?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:l,analytics:G}},function(e,a){const{navigate:s,currentTenant:c}=a;return{onSetupApprovalRulesBillPaySectionClick:()=>{s("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{s("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Gn),St=()=>{const e=L(),a=Q(),s=_(),{tenantEmailDomain:c}=Z(),[l,n]=u.useState(!1),[t,i]=u.useState(!1),[p,m]=u.useState(!1),f=S(E=>P(E)),y=S(E=>E.billPaySetupApproverViewState.fetchState),g=S(E=>E.remiSetupApproverViewState.fetchState),r=S(E=>Ve(E)),{isApprovalRulesV3Enabled:b,isLoading:I}=Zn(f?.tenantId),w=f.companyId??k.getSignedInUserTenant(c)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const A=K();u.useEffect(()=>{p||y!=="Not-Started"||I||(m(!0),s(ze(!0,!0,b)))},[p,y,I,b,s]),u.useEffect(()=>{t||g!=="Not-Started"||I||(i(!0),s(Le(!0,!1,!1,b)))},[t,g,I,b,s]);const h=E=>{n(E)};return A?.loggedInUserRoleMap!=null?o.jsxs(ht,{children:[o.jsx(B,{isAppContentDrawerOpen:l,handleDrawerToggle:h}),o.jsx(bt,{navigate:e,location:a,companyId:w,currentTenant:f,roleMap:A.loggedInUserRoleMap,onClickMenuIcon:()=>{h(!0)}})]}):o.jsx(ie,{fetchState:r.fetchState})},yt=V.div`
18
18
  display: flex;
19
19
  height: 100%;
20
20
  width: 100%;
@@ -22,7 +22,7 @@ import{j as o}from"./liveblocks-Cml8Dky9.js";import{a as u}from"./sentry-Bv_CMTd
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,Ct=Z(function(e,a){const{companyId:s,isZeniAccountEnabled:c,isChargeCardEnabled:r,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:i}=a,p=P(e);return{bankSetupView:Xe(e,s,n,t,c,r,i),connectedAccountProvider:p.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:G}},function(e,a){const{navigate:s,currentTenant:c,companyId:r}=a;return{onFetchLinkTokenClick:(n,t,i)=>{e(se(t,n,i))},onEstablishConnectionClick:(n,t,i)=>{e(oe(n,r,t,i))},onUpdatePaymentAccountStatus:(n,t,i,p,m)=>{e(Ie(n,t,m,p,i))},onUpdatePaymentAccountLoginStatus:(n,t,i,p)=>{e(Ce(!1,n,p,i,t))},onEstablishConnectionSuccess:(n,t)=>{e(ye(t,n))},onUpdateAccountClick:(n,t,i,p,m)=>{e(m==="paymentAccount"?Se(n,t,i,p):Ye(p,n,t))},onUpdatePrimaryFundingAccount:(n,t,i)=>{e(Je(r,t,n,i))},onRemoveConnection:n=>{e(qe(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Kn),It=()=>{const e=L(),a=Q(),s=U(),{tenantEmailDomain:c}=H(),r=K(),{useFeatureGate:n}=Y(),{isFeatureEnabled:t}=n(O.isChargeCardFeatureEnabled),{isFeatureEnabled:i}=n(O.isDebitCardFeatureEnabled),[p,m]=u.useState(!1),[f,y]=u.useState(!1),g=S(D=>P(D)),l=S(D=>D.settingsViewState.bankConnection.fetchState),b=Qe(g,r?.loggedInUserRoleMap),I=Ze(g,r?.loggedInUserRoleMap),k=g?.userRole!=null&&He(g.userRole),A=!!g.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!k,h=g.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!k,E=we(g,t,i),_=Ge(g,r?.loggedInUserRoleMap)&&E,{isCardsHidden:M}=je(g?.tenantId),x=g.companyId??w.getSignedInUserTenant(c)?.companyId;if(w.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");u.useEffect(()=>{f||l==="Completed"||(y(!0),s(Ke(!1)))},[f,s,l]);const F=D=>{m(D)};return b||A||I||_?o.jsxs(yt,{children:[o.jsx(R,{isAppContentDrawerOpen:p,handleDrawerToggle:F}),o.jsx(Ct,{navigate:e,location:a,companyId:x,currentTenant:g,roleMap:r.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:I,isZeniAccountEnabled:A,isChargeCardEnabled:_,isChargeCardsHidden:M,isTreasuryEnabled:h,onClickMenuIcon:()=>{F(!0)}})]}):o.jsx($,{})},Et=V.div`
25
+ `,Ct=H(function(e,a){const{companyId:s,isZeniAccountEnabled:c,isChargeCardEnabled:l,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:i}=a,p=P(e);return{bankSetupView:Xe(e,s,n,t,c,l,i),connectedAccountProvider:p.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:G}},function(e,a){const{navigate:s,currentTenant:c,companyId:l}=a;return{onFetchLinkTokenClick:(n,t,i)=>{e(se(t,n,i))},onEstablishConnectionClick:(n,t,i)=>{e(oe(n,l,t,i))},onUpdatePaymentAccountStatus:(n,t,i,p,m)=>{e(Ie(n,t,m,p,i))},onUpdatePaymentAccountLoginStatus:(n,t,i,p)=>{e(Ce(!1,n,p,i,t))},onEstablishConnectionSuccess:(n,t)=>{e(ye(t,n))},onUpdateAccountClick:(n,t,i,p,m)=>{e(m==="paymentAccount"?Se(n,t,i,p):Ye(p,n,t))},onUpdatePrimaryFundingAccount:(n,t,i)=>{e(Je(l,t,n,i))},onRemoveConnection:n=>{e(qe(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Kn),It=()=>{const e=L(),a=Q(),s=_(),{tenantEmailDomain:c}=Z(),l=K(),{useFeatureGate:n}=Y(),{isFeatureEnabled:t}=n(O.isChargeCardFeatureEnabled),{isFeatureEnabled:i}=n(O.isDebitCardFeatureEnabled),[p,m]=u.useState(!1),[f,y]=u.useState(!1),g=S(D=>P(D)),r=S(D=>D.settingsViewState.bankConnection.fetchState),b=Qe(g,l?.loggedInUserRoleMap),I=He(g,l?.loggedInUserRoleMap),w=g?.userRole!=null&&Ze(g.userRole),A=!!g.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!w,h=g.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!w,E=ke(g,t,i),U=Ge(g,l?.loggedInUserRoleMap)&&E,{isCardsHidden:M}=je(g?.tenantId),x=g.companyId??k.getSignedInUserTenant(c)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");u.useEffect(()=>{f||r==="Completed"||(y(!0),s(Ke(!1)))},[f,s,r]);const R=D=>{m(D)};return b||A||I||U?o.jsxs(yt,{children:[o.jsx(B,{isAppContentDrawerOpen:p,handleDrawerToggle:R}),o.jsx(Ct,{navigate:e,location:a,companyId:x,currentTenant:g,roleMap:l.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:I,isZeniAccountEnabled:A,isChargeCardEnabled:U,isChargeCardsHidden:M,isTreasuryEnabled:h,onClickMenuIcon:()=>{R(!0)}})]}):o.jsx($,{})},Et=V.div`
26
26
  display: flex;
27
27
  height: 100%;
28
28
  width: 100%;
@@ -30,7 +30,7 @@ import{j as o}from"./liveblocks-Cml8Dky9.js";import{a as u}from"./sentry-Bv_CMTd
30
30
  flex-direction: column;
31
31
  align-items: center;
32
32
  background-color: ${e=>e.theme.colors.grey4};
33
- `,At=Z(function(e,a){const{companyId:s}=a,c=P(e),r=a.roleMap.bill_pay_admin,n=en(e,s),{uiState:t}=n,i=(ae(c?.userRole??[])||r)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:Pe.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:i,analytics:G}},function(e,a){const{navigate:s,currentTenant:c,companyId:r}=a;return{onFetchLinkTokenClick:(n,t)=>{e(se("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(oe(n,r,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ye("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,i)=>{e(Ie(n,t,"billing","billing_setup",i))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(Ce(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(Se(n,t,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")},handleCreateCardSetupIntent:n=>{e(Ee(n))},handleConfirmCardSetupIntent:n=>{e(rn(n))},updateCardPaymentModalState:n=>{e(cn({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,i)=>{e(sn(n,t,i))},handleFetchPaymentSources:()=>{e(J())},resetCardPaymentViewState:()=>{e(on())},handleResetCardPaymentErrorStatuses:()=>{e(an())},onBillingAddressSave:n=>{e(tn(n))},onAddressEditHandler:n=>{if(n!=null){const t=ot(n);e(nn({addressType:"subscription_billing_address",addressToCreate:t}))}}}})(qn),xt=()=>{const e=L(),a=Q(),s=U(),{tenantEmailDomain:c}=H(),[r,n]=u.useState(!1),[t,i]=u.useState(!1),[p,m]=u.useState(!1),f=S(h=>P(h)),y=S(h=>h.cardPaymentViewState),g=S(h=>h.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=Xn(y.addCardPaymentSourceStatus.fetchState),b=y.addCardPaymentSourceStatus.fetchState,I=f.companyId??w.getSignedInUserTenant(c)?.companyId;if(w.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const k=K();u.useEffect(()=>{I!=null&&s(We(I,!1))},[I,s]),u.useEffect(()=>{t||(i(!0),s(J()))},[t,s]),u.useEffect(()=>{p||(Ee(["card"]),m(!0))},[p]),u.useEffect(()=>{l==="In-Progress"&&b==="Completed"&&s(J())},[l,b]);const A=h=>{n(h)};return k?.loggedInUserRoleMap!=null?o.jsxs(Et,{children:[o.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:A}),o.jsx(At,{navigate:e,location:a,companyId:I,currentTenant:f,roleMap:k.loggedInUserRoleMap,onClickMenuIcon:()=>{A(!0)},googleAPIKey:Pe.googleMapsAPIKey})]}):o.jsx(ie,{fetchState:g})},te="external_integrations",vt=Z(function(e){const a=un(e,te);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(a.map(s=>s.additionalInfo).filter(s=>s!=null))}},function(e,a){const{navigate:s,integrationsView:c,signedInUserEmail:r,tenantEmailDomain:n,tenantId:t}=a;return{onBackClick:()=>{s("../")},onNavigateToDashboard:()=>{s("../dashboard")},onReconnectQBO:()=>{me.init("/connection/auth",n),me.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(bn())},onSaveChargeBeeCredentials:(i,p)=>{const m=c.externalConnections?.revenue?.find(f=>f.connectionName==="chargebee")?.connectionId;m!=null&&e(fn(t,m,ee("revenue"),hn("chargebee"),{api_key:i,site:p}))},onConnectHubSpot:(i,p)=>{const m=c.externalConnections?.revenue?.find(f=>f.connectionName==="hubspot")?.connectionId;if(m!=null){const f=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:i,client_secret:p,connection_id:m,redirect_uri:f,tenant_id:t}));const y="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(i)}&scope=${encodeURIComponent(y)}&redirect_uri=${encodeURIComponent(f)}`}},onDisconnect:(i,p)=>{e(mn(t,i,ee(p)))},onConnectGmail:()=>{e(de(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(de(t,"outlook",window.location.href))},onSaveConnectorCredentials:i=>{e(gn(t,ee("payments"),i))},onNotifyMe:i=>{G.trackIntegrationsNotifyMeClicked("Settings",i),e(pn(te,i,r))}}})(Jn),kt=()=>{const e=L(),a=U(),{tenantEmailDomain:s}=H();lt();const[c,r]=u.useState(!1),n=S(h=>h.tenantState.fetchState),t=S(h=>P(h)),i=t.companyId??w.getSignedInUserTenant(s)?.companyId,p=w.getSignedInUser(),m=K(),f=ae(t.userRole??[]);if(p==null)throw Error("Can't access Integrations page without signing in...");u.useEffect(()=>{a(ln(te))},[a]);const[y,g]=u.useState(!1);u.useEffect(()=>{y||(g(!0),a(J()))},[y,a]);const l=h=>{r(h)},b=S(h=>dn(h,i)),I=S(h=>h.plaidAccountViewState.external_account.plaidConnectionDetails),{plaidAccounts:k,onAddPlaidAccount:A}=dt({companyId:i??t.companyId});return m?.loggedInUserRoleMap!=null?o.jsxs(wt,{children:[o.jsx(R,{isAppContentDrawerOpen:c,handleDrawerToggle:l}),o.jsx(vt,{navigate:e,onClickMenuIcon:()=>{l(!0)},isAdmin:f,integrationsView:b,signedInUserEmail:p.userEmail??"",tenantEmailDomain:t.tenantEmailDomain??s??"",tenantId:t.tenantId,saveChargeBeeState:b.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:b.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:b.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:b.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:b.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(b.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map(([h,E])=>[h,E?.message])),deleteConnectionState:b.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:b.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress",plaidAccounts:k,onAddPlaidAccount:A,plaidConnectionDetails:I})]}):o.jsx(ie,{fetchState:n})},wt=V.div`
33
+ `,At=H(function(e,a){const{companyId:s}=a,c=P(e),l=a.roleMap.bill_pay_admin,n=en(e,s),{uiState:t}=n,i=(ae(c?.userRole??[])||l)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:Pe.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:i,analytics:G}},function(e,a){const{navigate:s,currentTenant:c,companyId:l}=a;return{onFetchLinkTokenClick:(n,t)=>{e(se("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(oe(n,l,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ye("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,i)=>{e(Ie(n,t,"billing","billing_setup",i))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(Ce(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(Se(n,t,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")},handleCreateCardSetupIntent:n=>{e(Ee(n))},handleConfirmCardSetupIntent:n=>{e(ln(n))},updateCardPaymentModalState:n=>{e(cn({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,i)=>{e(sn(n,t,i))},handleFetchPaymentSources:()=>{e(J())},resetCardPaymentViewState:()=>{e(on())},handleResetCardPaymentErrorStatuses:()=>{e(an())},onBillingAddressSave:n=>{e(tn(n))},onAddressEditHandler:n=>{if(n!=null){const t=ot(n);e(nn({addressType:"subscription_billing_address",addressToCreate:t}))}}}})(qn),xt=()=>{const e=L(),a=Q(),s=_(),{tenantEmailDomain:c}=Z(),[l,n]=u.useState(!1),[t,i]=u.useState(!1),[p,m]=u.useState(!1),f=S(h=>P(h)),y=S(h=>h.cardPaymentViewState),g=S(h=>h.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),r=Xn(y.addCardPaymentSourceStatus.fetchState),b=y.addCardPaymentSourceStatus.fetchState,I=f.companyId??k.getSignedInUserTenant(c)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const w=K();u.useEffect(()=>{I!=null&&s(We(I,!1))},[I,s]),u.useEffect(()=>{t||(i(!0),s(J()))},[t,s]),u.useEffect(()=>{p||(Ee(["card"]),m(!0))},[p]),u.useEffect(()=>{r==="In-Progress"&&b==="Completed"&&s(J())},[r,b]);const A=h=>{n(h)};return w?.loggedInUserRoleMap!=null?o.jsxs(Et,{children:[o.jsx(B,{isAppContentDrawerOpen:l,handleDrawerToggle:A}),o.jsx(At,{navigate:e,location:a,companyId:I,currentTenant:f,roleMap:w.loggedInUserRoleMap,onClickMenuIcon:()=>{A(!0)},googleAPIKey:Pe.googleMapsAPIKey})]}):o.jsx(ie,{fetchState:g})},te="external_integrations",vt=H(function(e){const a=un(e,te);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(a.map(s=>s.additionalInfo).filter(s=>s!=null))}},function(e,a){const{navigate:s,integrationsView:c,signedInUserEmail:l,tenantEmailDomain:n,tenantId:t}=a;return{onBackClick:()=>{s("../")},onNavigateToDashboard:()=>{s("../dashboard")},onReconnectQBO:()=>{me.init("/connection/auth",n),me.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(bn())},onSaveChargeBeeCredentials:(i,p)=>{const m=c.externalConnections?.revenue?.find(f=>f.connectionName==="chargebee")?.connectionId;m!=null&&e(fn(t,m,ee("revenue"),hn("chargebee"),{api_key:i,site:p}))},onConnectHubSpot:(i,p)=>{const m=c.externalConnections?.revenue?.find(f=>f.connectionName==="hubspot")?.connectionId;if(m!=null){const f=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:i,client_secret:p,connection_id:m,redirect_uri:f,tenant_id:t}));const y="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(i)}&scope=${encodeURIComponent(y)}&redirect_uri=${encodeURIComponent(f)}`}},onDisconnect:(i,p)=>{e(mn(t,i,ee(p)))},onConnectGmail:()=>{e(de(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(de(t,"outlook",window.location.href))},onSaveConnectorCredentials:i=>{e(gn(t,ee("payments"),i))},onNotifyMe:i=>{G.trackIntegrationsNotifyMeClicked("Settings",i),e(pn(te,i,l))}}})(Jn),wt=()=>{const e=L(),a=_(),{tenantEmailDomain:s}=Z();rt();const[c,l]=u.useState(!1),n=S(h=>h.tenantState.fetchState),t=S(h=>P(h)),i=t.companyId??k.getSignedInUserTenant(s)?.companyId,p=k.getSignedInUser(),m=K(),f=ae(t.userRole??[]);if(p==null)throw Error("Can't access Integrations page without signing in...");u.useEffect(()=>{a(rn(te))},[a]);const[y,g]=u.useState(!1);u.useEffect(()=>{y||(g(!0),a(J()))},[y,a]);const r=h=>{l(h)},b=S(h=>dn(h,i)),I=S(h=>h.plaidAccountViewState.external_account.plaidConnectionDetails),{plaidAccounts:w,onAddPlaidAccount:A}=dt({companyId:i??t.companyId});return m?.loggedInUserRoleMap!=null?o.jsxs(kt,{children:[o.jsx(B,{isAppContentDrawerOpen:c,handleDrawerToggle:r}),o.jsx(vt,{navigate:e,onClickMenuIcon:()=>{r(!0)},isAdmin:f,integrationsView:b,signedInUserEmail:p.userEmail??"",tenantEmailDomain:t.tenantEmailDomain??s??"",tenantId:t.tenantId,saveChargeBeeState:b.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:b.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:b.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:b.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:b.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(b.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map(([h,E])=>[h,E?.message])),deleteConnectionState:b.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:b.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress",plaidAccounts:w,onAddPlaidAccount:A,plaidConnectionDetails:I})]}):o.jsx(ie,{fetchState:n})},kt=V.div`
34
34
  display: flex;
35
35
  height: 100%;
36
36
  width: 100%;
@@ -46,7 +46,7 @@ import{j as o}from"./liveblocks-Cml8Dky9.js";import{a as u}from"./sentry-Bv_CMTd
46
46
  flex-direction: column;
47
47
  align-items: center;
48
48
  background-color: ${e=>e.theme.colors.grey4};
49
- `,Pt=()=>{const e=U(),{tenantEmailDomain:a}=H(),[s,c]=u.useState(!1),r=S(l=>P(l)).companyId??w.getSignedInUserTenant(a)?.companyId,n=w.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=S(l=>Sn(l,n.userId)),i=S(l=>yn(l,r,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:p}=i,m=l=>{c(l)},f=u.useCallback(l=>{e(se("user_reimbursement_account",l))},[]),y=u.useCallback(l=>{e(oe(l,r,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);u.useEffect(()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(Cn(n.userId))},[n.userId,t.fetchState]);const g=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return o.jsxs(jt,{children:[o.jsx(R,{isAppContentDrawerOpen:s,handleDrawerToggle:m}),o.jsx(Yn,{plaidConnectionDetails:p,isLoading:g,myBankConnectionsView:t,onFetchLinkTokenClick:f,onEstablishConnectionClick:y,onClickMenuIcon:()=>{m(!0)}})]})},Dt=V.div`
49
+ `,Pt=()=>{const e=_(),{tenantEmailDomain:a}=Z(),[s,c]=u.useState(!1),l=S(r=>P(r)).companyId??k.getSignedInUserTenant(a)?.companyId,n=k.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=S(r=>Sn(r,n.userId)),i=S(r=>yn(r,l,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:p}=i,m=r=>{c(r)},f=u.useCallback(r=>{e(se("user_reimbursement_account",r))},[]),y=u.useCallback(r=>{e(oe(r,l,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);u.useEffect(()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(Cn(n.userId))},[n.userId,t.fetchState]);const g=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return o.jsxs(jt,{children:[o.jsx(B,{isAppContentDrawerOpen:s,handleDrawerToggle:m}),o.jsx(Yn,{plaidConnectionDetails:p,isLoading:g,myBankConnectionsView:t,onFetchLinkTokenClick:f,onEstablishConnectionClick:y,onClickMenuIcon:()=>{m(!0)}})]})},Dt=V.div`
50
50
  display: flex;
51
51
  height: 100%;
52
52
  width: 100%;
@@ -54,4 +54,4 @@ import{j as o}from"./liveblocks-Cml8Dky9.js";import{a as u}from"./sentry-Bv_CMTd
54
54
  flex-direction: column;
55
55
  align-items: center;
56
56
  background-color: ${e=>e.theme.colors.grey4};
57
- `,fe=({appContent:e})=>{const a=U(),s=L(),c=Q(),[r,n]=u.useState(!1),t=S(d=>P(d)),{tenantEmailDomain:i}=t,p=t.companyId??w.getSignedInUserTenant(i)?.companyId;if(w.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:m}=Y(),f=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:y}=m(O.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=m(O.isDebitCardFeatureEnabled),l=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",b=S(d=>be(d)),I=Ae(t),k=xe(g,t),A=!k&&b,h=we(t,y,g),{isCardsHidden:E}=je(t?.tenantId),_=!h||E,{areTenantIdsInSync:M}=Wn();u.useEffect(()=>{M&&a(In(p,A))},[p,a,A,M]);const x=S(d=>En(d,A)),F=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||p==null,D=An(t),N=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,B=d=>{n(d)};return o.jsxs(Dt,{children:[o.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:B}),e!=null?o.jsx(o.Fragment,{children:e}):o.jsx(et,{myProfileView:x,isAccountingClassesEnabled:b,isReimbursementDisabled:N===!1,isZeniAccountsDisabled:f===!1,isChargeCardDisabled:_,isTreasuryDisabled:l===!1,isLiteRoleDisabled:D===!1,onClickMenuIcon:()=>{B(!0)},isLoading:F,isBankingOnlyTenant:k,isCardsOnlyTenant:I,onAddressClick:d=>{const C=function(j,W){let z=`/${j}/settings/my_profile`;return z=z.concat(`/new/${W}`),z}(i,d),T=nt(c.state?.pathnameStackToGoBack,c.pathname);s(C,{state:{pathnameStackToGoBack:T}})},onGetOtp:d=>{const C={...x.myProfileLocalData,phone:d};a(ue({localData:C})),a(wn(d,"MyProfile"))},onResendOtp:d=>{a(kn(d,"MyProfile"))},onCancelClick:()=>{a(vn())},onSaveClick:()=>{a(pe("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(d,C)=>{a(xn(d,C,"MyProfile"))},onVerifyOtpSuccess:d=>{d!=null&&w.saveZeniOtpToken(d),a(pe("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:d=>{a(ue({localData:d}))}})]})};function Mt(){const e=U(),a=S(l=>P(l)).companyId,s=S(l=>jn(l)),c=S(l=>ve(l)),r=w.getSignedInUser(),[n,t]=u.useState(!1),i=u.useCallback(l=>{t(l)},[]),p=u.useCallback(l=>{e(Pn(l))},[]),m=u.useCallback(()=>{r?.userEmail!=null&&e(Dn({loggedInUserEmail:r.userEmail}))},[r?.userEmail]),f=u.useCallback(()=>{e(Mn())},[]);if(r==null)throw Error("Can't access Notification Settings page without signing in...");const y=u.useCallback(()=>{const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ge(l,a))},[a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=u.useCallback(()=>{e(Tn())},[]);return u.useEffect(()=>{if(c.fetchState==="Completed"&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"){const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ge(l,a))}},[s.fetchState,a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),o.jsxs(o.Fragment,{children:[o.jsx(R,{isAppContentDrawerOpen:n,handleDrawerToggle:i}),o.jsx(tt,{notificationSettingsView:s,onFormDataChange:p,onCancel:m,onSave:f,onClickMenuIcon:()=>{i(!0)},signedInUser:r,onRefresh:y,resetUpdateStatus:g})]})}function ga(e){const[a,s]=u.useState(!1),c=S(l=>ve(l)),r=S(l=>P(l)),n=K(),t=w.getSignedInUser(),i=U(),{useFeatureGate:p}=Y(),{isFeatureEnabled:m}=p(O.isDebitCardFeatureEnabled),f=t?.userEmail==null||c.fetchState!=="Completed"||Un(c.notificationSettings,t.userEmail,m,r);u.useEffect(()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&a===!1&&(s(!0),i(_n()))},[c.fetchState,a]);const y=xe(m,r),g=Ae(r);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||f!==!0?Fn(r)?o.jsxs(ne,{children:[Rn(n?.loggedInUserRole??[],m,r,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"accounting/*",element:o.jsx(ft,{})}),Bn(n?.loggedInUserRole??[],m,r,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"approval_rules/*",element:o.jsx(Tt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),On(r,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"my_bank_connections",element:o.jsx(Pt,{})}),Vn(r,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"bank_connections",element:o.jsx(It,{})}),zn(r,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"business_verification",element:o.jsx(ct,{productType:y?"zeni_accounts":g?"charge_cards":it(r,n?.loggedInUserRoleMap)})}),Ln(n?.loggedInUserRole??[],r,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"company_details",element:o.jsx(rt,{})}),Nn(n?.loggedInUserRole??[],r)&&o.jsx(v,{path:"billing",element:o.jsx(xt,{})}),$n(n?.loggedInUserRole??[],m,r)&&o.jsx(v,{path:"integrations",element:o.jsx(kt,{})}),o.jsx(v,{path:"my_profile/new/:addressType",element:o.jsx(fe,{appContent:o.jsx(st,{isSubPage:!1})})}),o.jsx(v,{path:"my_profile",element:o.jsx(fe,{})}),f&&o.jsx(v,{path:"notifications",element:o.jsx(Mt,{})}),o.jsx(v,{path:"*",element:o.jsx($,{})})]}):o.jsx(ne,{children:o.jsx(v,{path:"*",element:o.jsx($,{})})}):null}function Tt(e){return o.jsxs(ne,{children:[o.jsx(v,{path:"/",element:o.jsx(St,{})}),o.jsx(v,{path:"bills/approval-rules/*",element:o.jsx(ut,{})}),o.jsx(v,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?o.jsx(pt,{}):o.jsx($,{})}),o.jsx(v,{path:"*",element:o.jsx($,{})})]})}export{ga as default};
57
+ `,fe=({appContent:e})=>{const a=_(),s=L(),c=Q(),[l,n]=u.useState(!1),t=S(d=>P(d)),{tenantEmailDomain:i}=t,p=t.companyId??k.getSignedInUserTenant(i)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:m}=Y(),f=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:y}=m(O.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=m(O.isDebitCardFeatureEnabled),r=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",b=S(d=>be(d)),I=Ae(t),w=xe(g,t),A=!w&&b,h=ke(t,y,g),{isCardsHidden:E}=je(t?.tenantId),U=!h||E,{areTenantIdsInSync:M}=Wn();u.useEffect(()=>{M&&a(In(p,A))},[p,a,A,M]);const x=S(d=>En(d,A)),R=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||p==null,D=An(t),N=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,F=d=>{n(d)};return o.jsxs(Dt,{children:[o.jsx(B,{isAppContentDrawerOpen:l,handleDrawerToggle:F}),e!=null?o.jsx(o.Fragment,{children:e}):o.jsx(et,{myProfileView:x,isAccountingClassesEnabled:b,isReimbursementDisabled:N===!1,isZeniAccountsDisabled:f===!1,isChargeCardDisabled:U,isTreasuryDisabled:r===!1,isLiteRoleDisabled:D===!1,onClickMenuIcon:()=>{F(!0)},isLoading:R,isBankingOnlyTenant:w,isCardsOnlyTenant:I,onAddressClick:d=>{const C=function(j,W){let z=`/${j}/settings/my_profile`;return z=z.concat(`/new/${W}`),z}(i,d),T=nt(c.state?.pathnameStackToGoBack,c.pathname);s(C,{state:{pathnameStackToGoBack:T}})},onGetOtp:d=>{const C={...x.myProfileLocalData,phone:d};a(ue({localData:C})),a(kn(d,"MyProfile"))},onResendOtp:d=>{a(wn(d,"MyProfile"))},onCancelClick:()=>{a(vn())},onSaveClick:()=>{a(pe("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(d,C)=>{a(xn(d,C,"MyProfile"))},onVerifyOtpSuccess:d=>{d!=null&&k.saveZeniOtpToken(d),a(pe("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:d=>{a(ue({localData:d}))}})]})};function Mt(){const e=_(),a=S(r=>P(r)).companyId,s=S(r=>jn(r)),c=S(r=>ve(r)),l=k.getSignedInUser(),[n,t]=u.useState(!1),i=u.useCallback(r=>{t(r)},[]),p=u.useCallback(r=>{e(Pn(r))},[]),m=u.useCallback(()=>{l?.userEmail!=null&&e(Dn({loggedInUserEmail:l.userEmail}))},[l?.userEmail]),f=u.useCallback(()=>{e(Mn())},[]);if(l==null)throw Error("Can't access Notification Settings page without signing in...");const y=u.useCallback(()=>{const r=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ge(r,a))},[a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=u.useCallback(()=>{e(Tn())},[]);return u.useEffect(()=>{if(c.fetchState==="Completed"&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"){const r=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ge(r,a))}},[s.fetchState,a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),o.jsxs(o.Fragment,{children:[o.jsx(B,{isAppContentDrawerOpen:n,handleDrawerToggle:i}),o.jsx(tt,{notificationSettingsView:s,onFormDataChange:p,onCancel:m,onSave:f,onClickMenuIcon:()=>{i(!0)},signedInUser:l,onRefresh:y,resetUpdateStatus:g})]})}function ga(e){const[a,s]=u.useState(!1),c=S(r=>ve(r)),l=S(r=>P(r)),n=K(),t=k.getSignedInUser(),i=_(),{useFeatureGate:p}=Y(),{isFeatureEnabled:m}=p(O.isDebitCardFeatureEnabled),f=t?.userEmail==null||c.fetchState!=="Completed"||_n(c.notificationSettings,t.userEmail,m,l);u.useEffect(()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&a===!1&&(s(!0),i(Un()))},[c.fetchState,a]);const y=xe(m,l),g=Ae(l);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||f!==!0?Rn(l)?o.jsxs(ne,{children:[Bn(n?.loggedInUserRole??[],m,l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"accounting/*",element:o.jsx(ft,{})}),Fn(n?.loggedInUserRole??[],m,l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"approval_rules/*",element:o.jsx(Tt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),On(l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"my_bank_connections",element:o.jsx(Pt,{})}),Vn(l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"bank_connections",element:o.jsx(It,{})}),zn(l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"business_verification",element:o.jsx(ct,{productType:y?"zeni_accounts":g?"charge_cards":it(l,n?.loggedInUserRoleMap)})}),Ln(n?.loggedInUserRole??[],l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"company_details",element:o.jsx(lt,{})}),Nn(n?.loggedInUserRole??[],l)&&o.jsx(v,{path:"billing",element:o.jsx(xt,{})}),$n(n?.loggedInUserRole??[],m,l)&&o.jsx(v,{path:"integrations",element:o.jsx(wt,{})}),o.jsx(v,{path:"my_profile/new/:addressType",element:o.jsx(fe,{appContent:o.jsx(st,{isSubPage:!1})})}),o.jsx(v,{path:"my_profile",element:o.jsx(fe,{})}),f&&o.jsx(v,{path:"notifications",element:o.jsx(Mt,{})}),o.jsx(v,{path:"*",element:o.jsx($,{})})]}):o.jsx(ne,{children:o.jsx(v,{path:"*",element:o.jsx($,{})})}):null}function Tt(e){return o.jsxs(ne,{children:[o.jsx(v,{path:"/",element:o.jsx(St,{})}),o.jsx(v,{path:"bills/approval-rules/*",element:o.jsx(ut,{})}),o.jsx(v,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?o.jsx(pt,{}):o.jsx($,{})}),o.jsx(v,{path:"*",element:o.jsx($,{})})]})}export{ga as default};