@zeniai/web-app-ui 5.0.76-qa → 5.0.77-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 (138) hide show
  1. package/dist/assets/AddressRoutes-Clm_yxMo.js +1 -0
  2. package/dist/assets/AddressScreen-ByYpZmgQ.js +9 -0
  3. package/dist/assets/AiCfoScreen-DbYSFoNw.js +22 -0
  4. package/dist/assets/BillPayApprovalRoutes-CX2-tB9Z.js +1 -0
  5. package/dist/assets/{BillPayRoutes-CIhgsxs6.js → BillPayRoutes-CFin72Sd.js} +12 -12
  6. package/dist/assets/BusinessVerificationPageScreen-C-d6e6xJ.js +9 -0
  7. package/dist/assets/{ChargeCardRoutes-BCDwsoI8.js → ChargeCardRoutes-BqilxZnu.js} +8 -8
  8. package/dist/assets/{CompanyPassportScreen-Cjnsn_RK.js → CompanyPassportScreen-Btm8q2XT.js} +1 -1
  9. package/dist/assets/ConnectionAuthScreen-B3NEPge1.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-BP98cwHW.js +1 -0
  11. package/dist/assets/CustomerOnboardingRoutes-Cx10OoO6.js +23 -0
  12. package/dist/assets/{DashboardRoutes-DxyPzfo5.js → DashboardRoutes-Dr7E3H8N.js} +4 -4
  13. package/dist/assets/{DefaultTenantHome-BxxoLoEm.js → DefaultTenantHome-BmA8DcRx.js} +1 -1
  14. package/dist/assets/DomesticWireDetailScreen-CzSUYZwn.js +18 -0
  15. package/dist/assets/DrawerScreen-AH0ysY6V.js +1 -0
  16. package/dist/assets/EntityDetailRoutes-DVGIBaLz.js +1 -0
  17. package/dist/assets/{ExpenseAutomationRoutes-Bhl_mKXt.js → ExpenseAutomationRoutes-BhbZS8a1.js} +4 -4
  18. package/dist/assets/FeaturePreviewScreen-DPxCLrsp.js +1 -0
  19. package/dist/assets/HubSpotOAuthCallbackScreen-BvqLZI0N.js +1 -0
  20. package/dist/assets/MagicLinkRoutes-jZeMo5Ui.js +72 -0
  21. package/dist/assets/MagicLinkSignInScreen-PJSTdmbN.js +12 -0
  22. package/dist/assets/{MobileAppDrawer-D_MxSFu1.js → MobileAppDrawer-CNxBiA0K.js} +1 -1
  23. package/dist/assets/NotFoundScreen-CsEhUGfR.js +1 -0
  24. package/dist/assets/NotificationRoutes-9IJgVYJ1.js +1 -0
  25. package/dist/assets/OAuthConsentScreen-1ZY7Ls_k.js +1 -0
  26. package/dist/assets/PandLWithForecastRoutes-8SC0GJZW.js +1 -0
  27. package/dist/assets/PeopleRoutes-DQ3Y767r.js +22 -0
  28. package/dist/assets/PerformanceRoutes-BZb18QS3.js +1 -0
  29. package/dist/assets/{Preview-Csj6iaMz.js → Preview-B7yw63qf.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-D3kZw9eT.js → QBOConnectionScreen-BRrDd8wr.js} +1 -1
  31. package/dist/assets/ReferralListScreen-DWAGGjua.js +5 -0
  32. package/dist/assets/ReimbursementApprovalRoutes-DSgEFO1H.js +1 -0
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DXvOZU5T.js → ReimbursementApprovalRuleDetailScreen-CtZbBICM.js} +1 -1
  34. package/dist/assets/ReimbursementRoutes-Iavqnxfs.js +68 -0
  35. package/dist/assets/ReportsRoutes-CjoIF9EB.js +1 -0
  36. package/dist/assets/RewardsRoutes-CTiffYxG.js +1 -0
  37. package/dist/assets/ScreenRoutes-zUtLUY3P.js +2 -0
  38. package/dist/assets/{SettingsRoutes-ayR8jsmB.js → SettingsRoutes-Dr2cLQZf.js} +7 -7
  39. package/dist/assets/{SetupPagesScreen-DVIzlP-5.js → SetupPagesScreen-BMUAJOjI.js} +5 -5
  40. package/dist/assets/SignInScreen-BO8V1s1B.js +1 -0
  41. package/dist/assets/SignOutScreen-B1QfOGXO.js +9 -0
  42. package/dist/assets/{TaskListScreen-CBK1vDKd.js → TaskListScreen-DdoFZv0I.js} +2 -2
  43. package/dist/assets/TaskRoutes-DR1BBqXQ.js +9 -0
  44. package/dist/assets/TransactionDetailRoutes-DLkTkOiV.js +1 -0
  45. package/dist/assets/TransactionDetailScreen--PMkud8g.js +5 -0
  46. package/dist/assets/{TransactionListRoutes-BX5vLxoe.js → TransactionListRoutes-quiJ_wNs.js} +1 -1
  47. package/dist/assets/TreasuryRoutes-BVcC0j-i.js +37 -0
  48. package/dist/assets/{VendorsRoutes-tcDOX-e4.js → VendorsRoutes-DJYa05bm.js} +21 -21
  49. package/dist/assets/WiseConfirmationScreen-CTaGbwbB.js +12 -0
  50. package/dist/assets/{ZeniAccountRoutes-ByArgJuB.js → ZeniAccountRoutes-CpYvVE1u.js} +12 -12
  51. package/dist/assets/ZeniAccountStatementScreen-C8feQjoH.js +9 -0
  52. package/dist/assets/{accountMappingHelper-BSumbKrF.js → accountMappingHelper-D6x0RpVY.js} +1 -1
  53. package/dist/assets/{analytics-q_QSThl7.js → analytics-CgRNtlDm.js} +1 -1
  54. package/dist/assets/{analyticsHelper-DhFEnfI7.js → analyticsHelper-DhD4YoYg.js} +1 -1
  55. package/dist/assets/{core-D9lzXsHE.js → core-uYqCzel8.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-B4xUD3SX.js → decodeURIComponentSafe-DCnYf30M.js} +1 -1
  57. package/dist/assets/{dnd-DNtF3Icn.js → dnd-BSWou54V.js} +1 -1
  58. package/dist/assets/{empty-Bg3h__-J.js → empty-BFCAZWzA.js} +1 -1
  59. package/dist/assets/{empty-BnWCAzBO.js → empty-CKinwWZY.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-CrLTHEbW.js → emptyVideoElement-E29-Nor3.js} +1 -1
  61. package/dist/assets/epic-dPIWYPli.js +2 -0
  62. package/dist/assets/getLocaleForTenant-CFQN8jbL.js +1 -0
  63. package/dist/assets/{index-tKID2aTm.js → index-8d_FSGLw.js} +1 -1
  64. package/dist/assets/{index-DmyhDNRf.js → index-BsLHs9Ab.js} +1 -1
  65. package/dist/assets/{index-D4WqoFTE.js → index-CeZ7L-BQ.js} +12975 -12947
  66. package/dist/assets/{index-CDrFhkvu.js → index-CxWCBC6O.js} +1 -1
  67. package/dist/assets/{index-IEcabr56.js → index-DWPRup5s.js} +1 -1
  68. package/dist/assets/{index-CuyoN034.js → index-DeBaxB_L.js} +1 -1
  69. package/dist/assets/{index-BYO1BJ4-.js → index-Dl7Wgss6.js} +1 -1
  70. package/dist/assets/{index-DQS8hiD6.js → index-F3uqdkEv.js} +2 -2
  71. package/dist/assets/{lexical-5_A_mLPM.js → lexical-DbCoEckm.js} +1 -1
  72. package/dist/assets/{liveblocks-DRCozBQX.js → liveblocks-CfCKAQeM.js} +1 -1
  73. package/dist/assets/{lottie-CFIADA6U.js → lottie-Dc_IH0fS.js} +1 -1
  74. package/dist/assets/{mui-uwgkpTLc.js → mui-CTbUXhla.js} +1 -1
  75. package/dist/assets/{pathToGoBack-Ll3naOiu.js → pathToGoBack-Y7yporNq.js} +1 -1
  76. package/dist/assets/{pdf-C9DJlS7s.js → pdf-O9N1jd2N.js} +4 -4
  77. package/dist/assets/{pdf-lib-DykPSmmb.js → pdf-lib-CNgiyR2K.js} +1 -1
  78. package/dist/assets/{plaid-CRq9dUdG.js → plaid-Bio3MiLm.js} +1 -1
  79. package/dist/assets/{pusher-DRQztvpS.js → pusher--jGYOMJ8.js} +1 -1
  80. package/dist/assets/{react-BG_C1Eck.js → react-BYbqG6ZW.js} +1 -1
  81. package/dist/assets/{react-Bc7GdtKE.js → react-BaqpebX1.js} +1 -1
  82. package/dist/assets/{react-DVWjQrcH.js → react-D9RjhqSo.js} +1 -1
  83. package/dist/assets/{react-LnMTZloB.js → react-DqfAPb7w.js} +1 -1
  84. package/dist/assets/{react-B67TqooD.js → react-KPWjcD7D.js} +1 -1
  85. package/dist/assets/{react-Cv1q1f7X.js → react-kWXzqyUF.js} +1 -1
  86. package/dist/assets/{recharts-C3UFukkg.js → recharts-BUFoogHS.js} +1 -1
  87. package/dist/assets/{routePaths-C2HBowO1.js → routePaths-vUmlDccC.js} +1 -1
  88. package/dist/assets/{sentry-B4qAfutp.js → sentry-131ydzJg.js} +1 -1
  89. package/dist/assets/{url-D-rSVugE.js → url-BRm_J7V6.js} +1 -1
  90. package/dist/assets/{url-DrNm2a4i.js → url-DlWfObPw.js} +1 -1
  91. package/dist/assets/useAskAiCfoHostNavButtonProps-D4_eEE1f.js +1 -0
  92. package/dist/assets/{useDeviceId-CF-PoIcu.js → useDeviceId-CBU-vDdN.js} +1 -1
  93. package/dist/assets/useFetchSuggestedQuestionsWhenReady-b8cA6qxS.js +1 -0
  94. package/dist/assets/{useInitialThreadRequest-Cw2FMHcf.js → useInitialThreadRequest-cRvS9PIT.js} +1 -1
  95. package/dist/assets/{utils-DfCznjX8.js → utils-BkkIzijx.js} +1 -1
  96. package/dist/assets/{withTransactionSidePanel-DhelGbXD.js → withTransactionSidePanel-BS7S2wn5.js} +3 -3
  97. package/dist/assets/{zeni-epic-state-CthkBqEW.js → zeni-epic-state-BmAPZlsC.js} +6 -6
  98. package/dist/index.html +1 -1
  99. package/package.json +4 -4
  100. package/dist/assets/AddressRoutes-KIt8uyHg.js +0 -1
  101. package/dist/assets/AddressScreen-C8epvHKg.js +0 -9
  102. package/dist/assets/AiCfoScreen-C8PnLvFm.js +0 -22
  103. package/dist/assets/BillPayApprovalRoutes-C2pW_0HD.js +0 -1
  104. package/dist/assets/BusinessVerificationPageScreen-BHqq2xxV.js +0 -9
  105. package/dist/assets/ConnectionAuthScreen-CXfcmrz5.js +0 -11
  106. package/dist/assets/CustomerOnboardingAuthScreen-DLQ4stgM.js +0 -1
  107. package/dist/assets/CustomerOnboardingRoutes-BZFueUon.js +0 -23
  108. package/dist/assets/DomesticWireDetailScreen-BVJ2uZZ_.js +0 -18
  109. package/dist/assets/DrawerScreen-BYBgvD5u.js +0 -1
  110. package/dist/assets/EntityDetailRoutes-CVEIAJzD.js +0 -1
  111. package/dist/assets/FeaturePreviewScreen-BCRZsfyQ.js +0 -1
  112. package/dist/assets/HubSpotOAuthCallbackScreen-ByWE3hmY.js +0 -1
  113. package/dist/assets/MagicLinkRoutes-CjEeLFrg.js +0 -72
  114. package/dist/assets/MagicLinkSignInScreen-BNv6DMmx.js +0 -12
  115. package/dist/assets/NotFoundScreen-BUTU_-cN.js +0 -1
  116. package/dist/assets/NotificationRoutes-BU7RiYj-.js +0 -1
  117. package/dist/assets/OAuthConsentScreen-CjqH556D.js +0 -1
  118. package/dist/assets/PandLWithForecastRoutes-BRWqh_fp.js +0 -1
  119. package/dist/assets/PeopleRoutes-BHwShJOh.js +0 -22
  120. package/dist/assets/PerformanceRoutes-BSJraYOg.js +0 -1
  121. package/dist/assets/ReferralListScreen-DZ5cxHIr.js +0 -5
  122. package/dist/assets/ReimbursementApprovalRoutes-CK7PuiBG.js +0 -1
  123. package/dist/assets/ReimbursementRoutes-CHbt2wdC.js +0 -68
  124. package/dist/assets/ReportsRoutes-CXA3us4c.js +0 -1
  125. package/dist/assets/RewardsRoutes-gAW1VRAE.js +0 -1
  126. package/dist/assets/ScreenRoutes-U1ZbFVRi.js +0 -2
  127. package/dist/assets/SignInScreen-I3X_P9xn.js +0 -1
  128. package/dist/assets/SignOutScreen-BdUuSEch.js +0 -9
  129. package/dist/assets/TaskRoutes-D817k7tQ.js +0 -9
  130. package/dist/assets/TransactionDetailRoutes-C3_-fHOI.js +0 -1
  131. package/dist/assets/TransactionDetailScreen-C7MA74ac.js +0 -5
  132. package/dist/assets/TreasuryRoutes-B7ppkZjl.js +0 -37
  133. package/dist/assets/WiseConfirmationScreen-Uew1AA-_.js +0 -12
  134. package/dist/assets/ZeniAccountStatementScreen-Upv5ClY5.js +0 -9
  135. package/dist/assets/epic-C-cItypz.js +0 -2
  136. package/dist/assets/getLocaleForTenant-BCu2Wbt5.js +0 -1
  137. package/dist/assets/useAskAiCfoHostNavButtonProps-mLaTPohd.js +0 -1
  138. package/dist/assets/useFetchSuggestedQuestionsWhenReady-Y2W_vLVT.js +0 -1
@@ -0,0 +1 @@
1
+ import{j as t}from"./liveblocks-CfCKAQeM.js";import R from"./NotFoundScreen-CsEhUGfR.js";import{a as p}from"./sentry-131ydzJg.js";import{j as C,u as I,h as A,g as u,N as E,k as D,n as k,o as c}from"./core-uYqCzel8.js";import{eQ as N,Nr as g,NH as S,D0 as T,C9 as V,C$ as m,CS as U,NX as _}from"./zeni-epic-state-BmAPZlsC.js";import{m as $,z as O,x as W,a3 as z,bJ as B,ac as H}from"./index-CeZ7L-BQ.js";import"./mui-CTbUXhla.js";import{R as v}from"./ReimbursementApprovalRuleDetailScreen-CtZbBICM.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="8f2e3902-e30b-4f44-a9fc-8be5e0aa9d5a",e._sentryDebugIdIdentifier="sentry-dbid-8f2e3902-e30b-4f44-a9fc-8be5e0aa9d5a")}catch{}})();const f="reimbursement-approval-rule-update",J=D(function(e){return{approvalView:g(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:a,location:l}=r;return{onApprovalRulesEventReceived:s=>{s.endsWith(f)&&e(_(!1))},onBackClick:()=>{H(l)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:s=>{e(U(s))},onEditRuleClick:s=>{s!=null?(e(m(s)),a(`./${s}/edit`)):(e(m()),a("./new"))}}})(z(B)),P=()=>{const e=C(),r=I(),a=A(),[l,s]=p.useState(!1),[d,y]=p.useState(!1),b=u(n=>n.remiSetupApproverViewState.fetchState),o=u(n=>N(n)),w=$(),i=u(n=>g(n)),h=u(n=>S(n).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{h?.updateStatus.fetchState==="Completed"&&a(T())},[h]),p.useEffect(()=>{l||b!=="Not-Started"||(s(!0),a(V(!0)))},[l,b,a]),O.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(d||(y(!0),a(m())),e("./new"))},[d,i,a]);const j={events:o.companyId!=null?[`private-encrypted-${o.companyId}.${f}`]:[],eventCallback:(n,Q,x)=>{n.endsWith(f)&&x.onApprovalRulesEventReceived(n)}};return o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?t.jsx(E,{to:"../../promo"}):o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||i.fetchState!=="Completed"&&i.fetchState!=="Error"?t.jsx(W,{fetchState:"In-Progress",style:{backgroundColor:w.colors.grey5}}):t.jsx(J,{currentTenant:o,location:r,navigate:e,...j})};function Z(){return t.jsxs(k,{children:[t.jsx(c,{path:"/",element:t.jsx(P,{})}),t.jsx(c,{path:"/new",element:t.jsx(v,{})}),t.jsx(c,{path:"/:approvalRuleId/edit",element:t.jsx(v,{})}),t.jsx(c,{path:"*",element:t.jsx(R,{})})]})}export{Z as R};
@@ -1 +1 @@
1
- import{j as g}from"./liveblocks-DRCozBQX.js";import{a as y}from"./sentry-B4qAfutp.js";import{j as A,h as w,u as C,l as T,g as b,k as U}from"./core-D9lzXsHE.js";import{Nk as R,N4 as E,Cy as x,CH as _,CF as S,CG as h,Nl as k}from"./zeni-epic-state-CthkBqEW.js";import{z as B,m as N,B as V,bA as F,ac as j}from"./index-D4WqoFTE.js";import"./mui-uwgkpTLc.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]="76e88467-3709-4dc1-be22-b5e708f7928c",e._sentryDebugIdIdentifier="sentry-dbid-76e88467-3709-4dc1-be22-b5e708f7928c")}catch{}})();function O(e){return k(e)==null}const $=U(function(e,a){const t=R(e),s=t.remiSetupApproverViewUpdateData?.type??"approval_create",n=s==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return a.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===a.approvalRuleId)===0),{localData:t,hideUpperBoundField:n,isLowerBoundDisabled:l,approvalUpdateActionType:s}},function(e,a){const{navigate:t,approvalUpdateDataView:s,approverViewData:n,approvalRuleId:l}=a,r=s.remiSetupApproverViewUpdateData?.type,i=j(a.location);return{onApprovalRuleDataUpdated:o=>{const u=p=>{const v=[];return p.forEach(c=>{const D=c.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=c.actors.selectedNonUsers.map(d=>{const f=!!O(d.value);return{type:f?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!f}}),m=D.concat(I);v.push({action:c.stepType.selectedOption,actors:m,operator:m.length>1?c.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),v};if(r==="approval_create"){const p={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}else{const p={approvalRuleId:l,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}},onResetClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(F);function J(){const e=A(),a=w(),t=C(),{approvalRuleId:s}=T(),n=B.getSignedInUser(),l=N(),r=b(p=>R(p)),i=b(p=>E(p)),[o,u]=y.useState(!1);if(y.useEffect(()=>{o||(u(!0),a(x(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[i,s]),n==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(V,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):g.jsx($,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{J as R,O as i};
1
+ import{j as g}from"./liveblocks-CfCKAQeM.js";import{a as y}from"./sentry-131ydzJg.js";import{j as A,h as w,u as T,l as U,g as b,k as E}from"./core-uYqCzel8.js";import{NH as D,Nr as C,CV as x,D2 as _,D0 as S,D1 as h,NI as k}from"./zeni-epic-state-BmAPZlsC.js";import{z as B,m as V,x as N,bA as j,ac as F}from"./index-CeZ7L-BQ.js";import"./mui-CTbUXhla.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]="eff20c96-40cf-410c-953b-9bc59bb3b89d",e._sentryDebugIdIdentifier="sentry-dbid-eff20c96-40cf-410c-953b-9bc59bb3b89d")}catch{}})();function O(e){return k(e)==null}const $=E(function(e,a){const t=D(e),s=t.remiSetupApproverViewUpdateData?.type??"approval_create",n=s==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return a.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===a.approvalRuleId)===0),{localData:t,hideUpperBoundField:n,isLowerBoundDisabled:l,approvalUpdateActionType:s}},function(e,a){const{navigate:t,approvalUpdateDataView:s,approverViewData:n,approvalRuleId:l}=a,r=s.remiSetupApproverViewUpdateData?.type,i=F(a.location);return{onApprovalRuleDataUpdated:o=>{const c=p=>{const f=[];return p.forEach(u=>{const R=u.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=u.actors.selectedNonUsers.map(d=>{const m=!!O(d.value);return{type:m?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!m}}),v=R.concat(I);f.push({action:u.stepType.selectedOption,actors:v,operator:v.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),f};if(r==="approval_create"){const p={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}else{const p={approvalRuleId:l,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}},onResetClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(j);function J(){const e=A(),a=w(),t=T(),{approvalRuleId:s}=U(),n=B.getSignedInUser(),l=V(),r=b(p=>D(p)),i=b(p=>C(p)),[o,c]=y.useState(!1);if(y.useEffect(()=>{o||(c(!0),a(x(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[i,s]),n==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(N,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):g.jsx($,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{J as R,O as i};
@@ -0,0 +1,68 @@
1
+ import{j as s}from"./liveblocks-CfCKAQeM.js";import{j as K,h as re,u as H,l as Q,g as E,N as M,k as q,i as mt,n as ct,o as v}from"./core-uYqCzel8.js";import{eQ as V,NY as le,c2 as me,C4 as Be,jN as dt,Ch as ne,Cg as ae,NZ as ut,bn as ce,fK as Te,N_ as pt,Kj as bt,jC as De,Kk as Se,Kl as gt,ix as ht,Nd as ft,iM as St,BU as It,sJ as yt,iE as Rt,CE as je,N$ as Fe,O0 as Ct,O1 as At,O2 as kt,O3 as vt,O4 as Et,Co as Ie,iS as wt,Nm as xt,Ci as Bt,C2 as Tt,O5 as Dt,C1 as jt,O6 as Ft,Ca as ye,Cs as Ut,Cr as Lt,Cn as Ot,O7 as Ue,Ht as Pt,bo as $t,Cd as Mt,CW as Nt,O8 as _t,O9 as zt,CA as Gt,Cx as Re,MI as Zt,B$ as Ht,Oa as Le,Dj as Ce,Dr as Vt,Ob as Wt,Oc as G,Od as Kt,Oe,Of as qt,Og as Pe,Oh as $e,CM as se,bt as Jt,bG as de,cC as ue,eW as Me,eU as Ne,Oi as Yt,gO as Qt,MV as Xt,Oj as en,Ok as _e,MZ as tn,NH as nn,Ol as an,NX as sn,Do as Ae,Dn as on,Om as rn,On as ln,Oo as mn,Op as cn,Oq as dn,Ns as un,De as pn,Di as bn,bv as gn,bF as hn,cx as fn,cl as Sn,bs as In,Jd as yn,cN as Rn,cP as Cn,cO as An,cw as kn}from"./zeni-epic-state-BmAPZlsC.js";import{s as ze,Z as Ge,y as X,S as A,z as P,bK as Ze,A as ee,d as k,aE as ke,o as j,aq as Y,I as vn,D as He,bL as En,q as Z,bM as wn,c as te,bN as xn,U as Bn,G as Tn,x as pe,f as Ve,a3 as Dn,bb as jn,Y as Fn,m as We,bO as Un,a6 as Ln}from"./index-CeZ7L-BQ.js";import{n as N,S as On}from"./mui-CTbUXhla.js";import ie from"./NotFoundScreen-CsEhUGfR.js";import{S as ve}from"./SetupPagesScreen-BMUAJOjI.js";import{F as Ke}from"./FeaturePreviewScreen-DPxCLrsp.js";import{a as f}from"./sentry-131ydzJg.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-D4_eEE1f.js";import{u as qe}from"./useInitialThreadRequest-cRvS9PIT.js";import{c as Je}from"./useFetchSuggestedQuestionsWhenReady-b8cA6qxS.js";import{D as Pn}from"./DrawerScreen-AH0ysY6V.js";import{M as Ye}from"./MobileAppDrawer-CNxBiA0K.js";import{R as $n}from"./ReimbursementApprovalRoutes-DSgEFO1H.js";import{FallBackRoute as Mn}from"./ScreenRoutes-zUtLUY3P.js";import"./recharts-BUFoogHS.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./utils-BkkIzijx.js";import"./analyticsHelper-DhD4YoYg.js";import"./routePaths-vUmlDccC.js";import"./BusinessVerificationPageScreen-C-d6e6xJ.js";import"./ReimbursementApprovalRuleDetailScreen-CtZbBICM.js";import"./getLocaleForTenant-CFQN8jbL.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]="f66d0d15-bd30-4ea8-a4a8-1bff78bad55a",e._sentryDebugIdIdentifier="sentry-dbid-f66d0d15-bd30-4ea8-a4a8-1bff78bad55a")}catch{}})();const Qe=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:L}}}=He.getLocalizedStrings(),_n=q(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=P.getSignedInUser(),c=ce(d),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=le(e,t.reimbursementId),b=pt(e,d?.userId??"");let R=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(R=`${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:`${Y.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:R,isUserAdmin:me(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:De(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=P.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ae(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ye(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Ot(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(ye(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Dt({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(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ne({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(vt({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(kt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(At({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Fe()),e(Ct());const i=Qe(o),l=Z(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(k.trackReimbursementDeleteReimbursement(n),e(je(n)))},onSaveBankAccount:()=>{a?.userId&&e(Rt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("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(Se("common"))},onCancelAutoComplete:()=>{e(Se("common"))}}}})(En);function Ee(){const e=K(),t=re(),n=H(),{reimbursementId:r}=Q(),d=ze(),c=Ge(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=X(),{isFeatureEnabled:b}=l(A.isLimitedCategoryForReimbursement),{isFeatureEnabled:R}=l(A.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(A.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),w=H().pathname,D=w.includes("edit"),C=w.includes("reimbursement/new"),[F,x]=f.useState(!1),B=P.getSignedInUser(),I=E(p=>V(p)),g=E(p=>le(p,r)),O=qe(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);f.useEffect(()=>{(C&&!F||D&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(x(!0),t(Be(!1,b,R,r)))});const $=E(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(B==null)throw Error("Can't access address page without signing in...");const y={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(M,{to:y}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(Ze,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(ee,{analytics:k,onLoad:p=>(W=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&W.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Gn,{}):null,m&&c!=="small"?s.jsx(Zn,{children:s.jsx(ke,{showAutofill:m,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Hn,{children:[s.jsx(Vn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(ke,{showAutofill:m,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(Wn,{windowSize:c,children:s.jsx(_n,{initialOpenThreadRequest:O??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const zn=N.div`
2
+ display: flex;
3
+ position: relative;
4
+ height: 100vh;
5
+ flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
6
+ background-color: ${e=>e.theme.colors.grey4};
7
+ `,Gn=N.div`
8
+ position: fixed;
9
+ top: 0;
10
+ left: 0;
11
+ right: 0;
12
+ bottom: 0;
13
+ background-color: ${vn.overlayBackgroundBlack};
14
+ z-index: 5;
15
+ `,Zn=N.div`
16
+ position: absolute;
17
+ top: 0;
18
+ left: 0;
19
+ width: 42%;
20
+ height: 100%;
21
+ z-index: 6;
22
+ display: flex;
23
+ background-color: transparent;
24
+ overflow: hidden;
25
+ `,Hn=N.div`
26
+ position: fixed;
27
+ top: 0;
28
+ left: 0;
29
+ right: 0;
30
+ bottom: 0;
31
+ z-index: 11;
32
+ display: flex;
33
+ flex-direction: column;
34
+ overflow-y: auto;
35
+ background-color: ${e=>e.theme.colors.grey4};
36
+ `,Vn=N.button`
37
+ align-self: flex-end;
38
+ background: none;
39
+ border: none;
40
+ cursor: pointer;
41
+ padding: ${j.sp2} ${j.sp3};
42
+ line-height: 1;
43
+ color: ${e=>e.theme.colors.hero};
44
+ &:hover {
45
+ color: ${e=>e.theme.colors.primary};
46
+ }
47
+ svg {
48
+ width: ${j.sp4};
49
+ height: ${j.sp4};
50
+ }
51
+ `,Wn=N.div`
52
+ display: flex;
53
+ flex-direction: column;
54
+ width: 100%;
55
+ ${e=>e.windowSize!=="small"?"overflow: auto;":""}
56
+ `,Kn=q(function(e,t){const n=Ue(e,t.reimbursementId),r=P.getSignedInUser(),d=ce(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=_t(n.remiActivities,zt(t.currentTenant),r));const i=me(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:d,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:De(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(Fe());const a=Qe(o),i=Z(d.state?.pathnameStackToGoBack,d.pathname);c(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Ht(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Zt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Re(n,a.type,"")):e(Re(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=Z(d.state?.pathnameStackToGoBack,d.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{k.trackReimbursementDeleteReimbursement(n),e(je(n))},cancelAndDeleteReport:a=>{a===!0?k.trackReimbursementCancelAndDeleteReimbursement(n):k.trackReimbursementCancelReimbursement(n),e(Gt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}})(wn);function qn(){const e=K(),t=re(),n=H(),r=n.hash.substring(1),d=ze(),{reimbursementId:c}=Q(),m=P.getSignedInUser(),o=E(y=>V(y)),a=E(y=>Ue(y,c??"")),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=qe(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:R}=be({mobileExploreReferrer:"Reimbursement Details"});Je({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:h}=X(),{isFeatureEnabled:T}=h(A.isLimitedCategoryForReimbursement),[u,w]=f.useState(!1),[D,C]=f.useState(!1),[F,x]=f.useState(!1),{isFeatureEnabled:B}=h(A.isReimbursementCommentingEnabled),{isFeatureEnabled:I}=h(A.isShowDeletedReimbursementsFeatureEnabled),g=E(y=>le(y,c??"")),O=Pt(o),U=$t(o.userRole),$=a.fetchState;if(f.useEffect(()=>{u||c==null?u==1&&$==="Error"&&e("page-not-found",{replace:!0}):(w(!0),t(Mt(c,!1,I)))},[u,c,t,$]),f.useEffect(()=>{I&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&O===!1?x(!1):x(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(U||a.allApprovers.find(y=>y.user.userId===m?.userId)!=null||a.remiDetails?.lastUpdatedBy===m?.userId))},[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,U,o.isZeni,O,m]),f.useEffect(()=>{D||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(C(!0),t(Be(!1,T,I,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Nt(!1,!0,!0,a.lastUpdatedByUserId)))},[D,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(M,{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(Ze,{}):s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:k,onLoad:y=>(p=>{c!=null&&p.trackReimbursementReimbursementDetails(c)})(y)}),s.jsx(Kn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:B,isShowDeletedReimbursementEnabled:I,location:n,navigate:e,isRealTimeApprovalEnabled:F,currentTenant:o,reimbursementId:c??"",themeState:d,isAiCfoAccessEnabled:b,onAskAiCfoClick:R})]})}const Jn=q(function(e,t){return{remisReviewView:Le(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(G())},onCloseReviewItem:n=>{e(Wt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Vt());break;case"approve":e(Ce("approved",r??""));break;case"reject":e(Ce("rejected",r??""))}}}})(xn);function Yn(){const e=K(),t=E(c=>c.remisBulkActionViewState.bulkSubmissionFetchState.fetchState),{remisForReview:n}=E(c=>Le(c)),r=te(),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(),Xe="bulk-operation-update",oe="reimbursement-approval-rule-update",{spendManagement:Qn,common:we}=He.getLocalizedStrings(),xe=Qn.reimbursement.bulkActions,Xn=N.div`
57
+ display: flex;
58
+ min-height: 100%;
59
+ width: 100%;
60
+ flex: 1 1 auto;
61
+ flex-direction: column;
62
+ align-items: center;
63
+ background-color: ${e=>e.theme.colors.grey4};
64
+ `,ea=q(function(e,t){const n=$e(e,z,t.isBulkActionEnabled);let r=n.allSubTabs;const d=P.getSignedInUser(),c=ce(d),m=e.tenantState.currentTenantId,o=V(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,R=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:`${Fn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:R.affectedEntityIds}},function(e,t){const{navigate:n,currentTenant:r,location:d,period:c}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(G()),e(Oe(o))},onSubtabChange:o=>{e(G()),e(Pe(o))},onTransactionClick:(o,a)=>{const i=aa(m,o,a),l=Z(d.state?.pathnameStackToGoBack,d.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=na(m),a=Z(d.state?.pathnameStackToGoBack,d.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;k?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=Z(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(se(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(Ae("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(Ae("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(oe)&&e(sn(!1))},onEventReceived:o=>{o===Xe&&e(an())}}})(Dn(jn));function ta(){const e=K(),t=re(),n=H(),r=n.state,d=Ge(),[c,m]=f.useState(null),o=mt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;f.useEffect(()=>{if(r?.tab!=null&&r?.subTab!=null){const S=Kt(r.tab.toString());S!=null?t(Oe(S)):console.log("Warning:Not a valid remiListTab");const _=qt(r.subTab.toString());_!=null?t(Pe(_)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(G())}},[]);const{useFeatureGate:a}=X(),{isFeatureEnabled:i}=a(A.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(A.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(A.isBillPayCommentingEnabled),{isFeatureEnabled:R}=a(A.isReimbursementCommentingEnabled),{isFeatureEnabled:h}=a(A.isReimbursementBulkActionEnabled),T=P.getSignedInUser(),u=E(S=>V(S)),[w,D]=f.useState(!1),[C,F]=f.useState(!1),x=te(),B=x?.loggedInUserRole?.includes("admin")===!0,I=E(S=>$e(S,z,h)),{areTenantIdsInSync:g}=Bn(),O=I.fetchState,{isAiCfoAccessEnabled:U,onAskAiCfoClick:$}=be({mobileExploreReferrer:"Reimbursement List"});if(Je({isDataReady:O==="Completed"}),f.useEffect(()=>{!C&&g&&(F(!0),t(se(z,!0,l,!1,!0)))},[C,z,t,g]),T==null)throw Error("Can't access address page without signing in...");const y=!!u?.userRole&&Jt(u),p=de(x?.loggedInUserRoleMap),W=ue(x?.loggedInUserRoleMap),et=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,tt=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,nt=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,at=E(S=>Te(S.companyState,u.companyId)),st=at?.company.featuresActivationInfo.connectedAccountProvider,ge=S=>{D(S)},{isFeatureEnabled:it}=a(A.isDebitCardFeatureEnabled),ot=Me(it,u),rt=Ne(u),{remisProcessed:J,remisProcessing:he}=E(S=>Yt(S));f.useEffect(()=>{J===he&&c!=null&&(t(Qt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:J>1?xe.reports:xe.report},{variableName:"_has_",variableValue:J>1?we.texts.have:we.texts.has},{variableName:"_action_",variableValue:Xt(c)}]})),t(en()),setTimeout(()=>{t(se(z,!0,l,!1,!0,!0))},3e3),m(null))},[J,he]);const lt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${Xe}`,`private-encrypted-${u.companyId}.${oe}`]:[],eventCallback:(S,_,fe)=>{S.endsWith(oe)?fe.onReimbursementApprovalRulesEventReceived?.(S):_.entity_type==="reimbursement"&&(m(_.operation_type),fe.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?ot===!0||rt===!0?s.jsx(Ke,{}):tt&&(!y||p)||W&&et?s.jsxs(s.Fragment,{children:[O==="Completed"?s.jsx(ee,{analytics:k,onLoad:S=>(_=>_.trackPageLoaded(Ve.Event.reimbursementHome))(S)}):null,s.jsx(Ye,{isAppContentDrawerOpen:w,handleDrawerToggle:ge}),s.jsxs(Xn,{windowSize:d,children:[s.jsx(Pn,{isOpen:o,drawerLeftMargin:new Tn(0,0,300,600),onClose:()=>{e("./"),t(G())},children:s.jsx(sa,{onClick:S=>S.stopPropagation(),children:s.jsx(Yn,{})})}),s.jsx(ea,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:R,location:n,navigate:e,currentTenant:u,period:z,isAdmin:B,isEmployee:y,entity:"reimbursement",onClickMenuIcon:()=>{ge(!0)},createdByUserList:I.createdByUserList,createdByUserListFetchState:I.createdByUserListFetchState,isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:st,isBulkActionEnabled:h,bulkSubmissionLimit:I.remiBulkSubmissionLimit,bulkSubmissionFetchState:I.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:U,onAskAiCfoClick:$,...lt})]})]}):nt&&p?s.jsx(M,{to:"../setup"}):x!=null&&_e(u,x.loggedInUserRoleMap)?s.jsx(M,{to:"../promo"}):s.jsx(pe,{fetchState:"In-Progress"}):s.jsx(ie,{})}const na=e=>`/${e}/reimbursements/setup`,aa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},sa=N(On)`
65
+ display: flex;
66
+ min-height: 100%;
67
+ flex-direction: column;
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=K(),t=H(),{tenantEmailDomain:n}=Q(),r=We(),[d,c]=f.useState(!1),m=E(C=>V(C)),o=P.getSignedInUserTenant(n)?.companyId??m.companyId,a=P.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),b=te(),R=de(b?.loggedInUserRoleMap),h=ue(b?.loggedInUserRoleMap),T=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,u=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,w=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,D=C=>{c(C)};if(a==null)throw Error("Can't access reimbursement promo page without signing in...");return u&&h&&T?s.jsx(M,{to:"../../../reimbursements"}):w&&R?s.jsx(M,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!w||m.userReimbursementInfo&&h&&T===!1?s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:k,onLoad:C=>(F=>F.trackPageLoaded(Ve.Event.reimbursementPromoPage))(C)}),s.jsx(Ye,{isAppContentDrawerOpen:d,handleDrawerToggle:D}),s.jsx(ia,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{D(!0)}})]}):s.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Pa(){const e=E(W=>V(W)),t=te(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=We(),d=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=X(),{isFeatureEnabled:o}=m(A.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(A.isDebitCardFeatureEnabled),i=Me(a,e),l=Ne(e),b=e?.userRole!=null&&gn(e?.userRole),R=(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=de(t?.loggedInUserRoleMap),w=T&&u,{isFeatureEnabled:D}=m(A.isDepositAccountsFeatureEnabled),C=D&&!b&&Sn(t?.loggedInUserRoleMap),F=Ln(e,o,a)&&!b&&In(t?.loggedInUserRoleMap),x=yn(t?.loggedInUserRoleMap),B=Rn(t?.loggedInUserRoleMap),I=Cn(t?.loggedInUserRoleMap),g=An(t?.loggedInUserRoleMap),O=kn(t?.loggedInUserRoleMap),U=ue(t?.loggedInUserRoleMap),{tenantEmailDomain:$}=Q(),y=H(),p=n===!0&&(u||U&&c);return s.jsxs(ct,{children:[y.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(v,{path:"verification",element:s.jsx(ve,{isBillPayAdminLevelAccess:R,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:w,isZeniAccountAdminLevelAccess:C,isChargeCardAdminLevelAccess:F,isUserHasOnlyCardAccess:x,productType:"reimbursement",type:"verification"})}),s.jsx(v,{path:"setup",element:s.jsx(ve,{isBillPayAdminLevelAccess:R,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:w,isZeniAccountAdminLevelAccess:C,isChargeCardAdminLevelAccess:F,isUserHasOnlyCardAccess:x,productType:"reimbursement",type:"setup"})}),s.jsx(v,{path:"promo",element:s.jsx(oa,{})}),s.jsx(v,{path:"approval-rules/*",element:w?s.jsx($n,{}):s.jsx(Mn,{isUserHasZeniAccountsAccess:B,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:O,isUserHasReimbursementAccess:U,isUserHasTreasuryAccess:I,isTenantBankingOnly:i,tenantEmailDomain:$??""})}),p&&s.jsx(v,{path:"*",element:s.jsx(ta,{})}),(i===!0||l===!0)&&s.jsx(v,{path:"/*",element:s.jsx(Ke,{})}),t!=null&&_e(e,t?.loggedInUserRoleMap)&&s.jsx(v,{path:"*",element:s.jsx(M,{to:"../promo"})}),d&&u&&s.jsx(v,{path:"*",element:s.jsx(M,{to:"../setup"})})]}):y.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(v,{path:"new",element:s.jsx(Ee,{})}),s.jsx(v,{path:":reimbursementId",element:s.jsx(qn,{})}),s.jsx(v,{path:":reimbursementId/edit",element:s.jsx(Ee,{})}),s.jsx(v,{path:"*",element:s.jsx(ie,{})})]}):s.jsx(v,{path:"*",element:s.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${j.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(v,{path:"*",element:s.jsx(ie,{})})]})}export{Pa as default};
@@ -0,0 +1 @@
1
+ import{j as p}from"./liveblocks-CfCKAQeM.js";import{u as z,j as ye,h as Ce,l as ge,g as d,k as Se,n as Ie,o as G}from"./core-uYqCzel8.js";import{eQ as L,fa as S,JG as we,jC as Z,JH as X,qd as O,jq as Re,iu as Te,tJ as K,qi as Ae,bv as Oe,JI as Fe,bn as ke,uI as De,JJ as Ee,JK as je,tB as Pe,JL as Y,JM as Le,JN as Me,JO as Je,JP as Be,JQ as I,JR as F,JS as k,JT as H,JU as D,JV as E,dE as Ue,uo as ve,uc as q,ud as N,uu as Ve,uh as $,uA as xe,JW as ze,JX as Ge,JY as Ye,JZ as He,J_ as qe,eW as Ne,eU as $e}from"./zeni-epic-state-BmAPZlsC.js";import{R as Qe,T as We,Z as Ze,y as ee,S as j,z as ae,U as Xe,c as Ke,a as ea,A as aa,d as P,f as sa,q as se,W as ta,X as oa,Y as na}from"./index-CeZ7L-BQ.js";import"./mui-CTbUXhla.js";import ra from"./NotFoundScreen-CsEhUGfR.js";import{F as ia}from"./FeaturePreviewScreen-DPxCLrsp.js";import{a as _}from"./sentry-131ydzJg.js";import{u as la,a as ca,b as da,c as pa}from"./useFetchSuggestedQuestionsWhenReady-b8cA6qxS.js";import{u as fa}from"./useInitialThreadRequest-cRvS9PIT.js";import{t as Q,a as W}from"./routePaths-vUmlDccC.js";import{M as ma}from"./MobileAppDrawer-CNxBiA0K.js";import"./recharts-BUFoogHS.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./utils-BkkIzijx.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]="2ce673f1-141d-4ad7-803e-06d1f899a822",e._sentryDebugIdIdentifier="sentry-dbid-2ce673f1-141d-4ad7-803e-06d1f899a822")}catch{}})();const ua=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(E({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},_a=e=>{e(Ge()),e(Ye()),e(He()),e(qe())},ha=Se(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=S(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:Z(e),isAccountingProjectsEnabled:X(e),currentTenantCompanyName:a,statementEndPoint:`${na}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(O(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(ze(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(xe(a)),s){const{isCompareModeOn:r,filter:c}=o,{additionalBalances:m,balancesRange:l}=c;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(q(o.firstMonthOfFY,r,l.numberOfPeriods<1?1:l.numberOfPeriods,i)),m.length>0&&e(N(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",l.numberOfPeriods<1?1:l.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($({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Y({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e($(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(Ve(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(q(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(N(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(ve({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,c;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,c=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",c={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),c!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,l=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,c);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return W(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,c)}return a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?W(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,c):a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,c):void 0})();if(l!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(l,{state:{pathnameStackToGoBack:i,referrer:w(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(H({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(H({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(Je({viewMode:a})),e(Be({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",w(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",w(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",w(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Me({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(K())},onUpdateDisplayOrder:a=>{e(je(a))},onUpdateReportFormat:a=>{_a(e),e(Ee(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ta);function ba(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=We(),f=Ze(),u=oa(f),a=ye(),s=Ce(),t=z(),{tenantEmailDomain:r}=ge(),{useFeatureGate:c}=ee(),{isFeatureEnabled:m}=c(j.isReportsHorizontalClassLayoutSwitchEnabled),l=ae.getSignedInUser(),[i,C]=_.useState(!1),[M,te]=_.useState(!1),{isFeatureEnabled:J}=c(j.isReportsCommentingEnabled);if(l==null)throw Error("Can't access reports page without signing in...");const B=d(n=>L(n)),oe=B.company?.companyInfo.firstMonthOfFY??1,ne=fa(J?B?.companyId:void 0),g=d(n=>S(n).fetchState),re=d(n=>we(n)),{areTenantIdsInSync:h}=Xe(),R=d(n=>n.financeStatementState.selectedReportId),U=d(n=>Z(n)),T=d(n=>X(n)),ie=d(n=>S(n).isCompareModeOn),b=d(n=>S(n).filter),A=d(n=>S(n).selectedReportAndTimeframeFetchState),le=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(C(!0),s(O(l.userId,!0,!0,!1)))},[i,l,s,h]),_.useEffect(()=>{i&&!M&&g==="Completed"&&h&&(s(O(l.userId,!1,!0,!1)),te(!0))},[i,M,g,h]),_.useEffect(()=>{if(i&&A.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Ae(b.timeframe));break;case"profit_and_loss_by_projects":T&&s(K());break;case"balance_sheet":s(Te(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,A,h,U,T]);const v=Ke(),ce=v?.loggedInUserRole!=null&&Oe(v?.loggedInUserRole)!==!0,[de,pe]=_.useState(!1),V=n=>{pe(n)},fe=ea(),me=da();return function(n){const{isDataReady:ue}=n,{pathname:_e}=z(),x=Qe(_e??"")==="reports",he=la(ue),be=_.useMemo(()=>x?ua:void 0,[x]);ca({canFetchSuggestedQuestions:he,pageContexts:be})}({isDataReady:g==="Completed"}),pa({isDataReady:g==="Completed"}),p.jsxs(p.Fragment,{children:[g==="Completed"?p.jsx(aa,{analytics:P,onLoad:n=>n.trackPageLoaded(sa.Event.reports)}):null,p.jsx(ma,{isAppContentDrawerOpen:de,handleDrawerToggle:V}),p.jsx(ha,{firstMonthOfFY:oe,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:le,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:U,isAccountingProjectsEnabled:T,isCompareModeOn:ie,hasTransactionAccess:ce,signedInUser:l,selectedReportAndTimeframeFetchState:A,handleDrawerToggle:V,reportsResyncFetchState:re.reportsResyncFetchState,isAiCfoAccessEnabled:me&&fe&&!e,onAskAiCfoClick:()=>{if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0)},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:J,initialOpenThreadRequest:ne})]})}const w=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 va(){const e=d(s=>L(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(j.isDebitCardFeatureEnabled),u=Ne(f,e),a=$e(e);return u===!0||a===!0?p.jsx(ia,{}):p.jsxs(Ie,{children:[p.jsx(G,{path:"/",element:p.jsx(ba,{})}),p.jsx(G,{path:"*",element:p.jsx(ra,{})})]})}export{va as default};
@@ -0,0 +1 @@
1
+ import{j as a}from"./liveblocks-CfCKAQeM.js";import{y as j,z as w,aK as y,A as I,d as p,f as F,cF as L,S as P}from"./index-CeZ7L-BQ.js";import"./mui-CTbUXhla.js";import l from"./NotFoundScreen-CsEhUGfR.js";import{a as f}from"./sentry-131ydzJg.js";import{h as A,g as b,j as T,u as V,k as Q,n as R,o as u}from"./core-uYqCzel8.js";import{eQ as U,Qh as C,N6 as z,Qi as k,u3 as Y,f0 as G,Qj as K,u1 as O}from"./zeni-epic-state-BmAPZlsC.js";import{R as x}from"./ReferralListScreen-DWAGGjua.js";import"./recharts-BUFoogHS.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./utils-BkkIzijx.js";import"./useAskAiCfoHostNavButtonProps-D4_eEE1f.js";import"./useFetchSuggestedQuestionsWhenReady-b8cA6qxS.js";import"./MobileAppDrawer-CNxBiA0K.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]="ff287741-b2ea-437c-b3e3-27962bf276a9",e._sentryDebugIdIdentifier="sentry-dbid-ff287741-b2ea-437c-b3e3-27962bf276a9")}catch{}})();const q=Q(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,o=w.getSignedInUser();return{onDismissClick:()=>{e(k()),n("..")},onSendClick:()=>{if(o!=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(K({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{o!=null&&p.trackInviteEmailClicked("cancel")}}})(L),B=()=>{const e=A(),[t,n]=f.useState(!1),[o,s]=f.useState(!1),r=b(i=>U(i)),c=T(),v=V(),{useDynamicConfig:g}=j(),d=w.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const m=b(i=>C(i)),D=d?.firstName!=null?d.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:S}=g(y.zeniAccountsConfig),_=z(S);f.useEffect(()=>{e(k()),r?.rewardsLastViewedTime==null&&o===!1&&(e(Y()),s(!0))},[]),f.useEffect(()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(G(!0)))},[m.fetchState,e]);const N=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(I,{analytics:p,onLoad:i=>(E=>E.trackPageLoaded(F.Event.inviteEmailViewed))(i)}):null,a.jsx(q,{navigate:c,location:v,currentTenant:r,companyName:N,userName:D,inviteFormCompayData:m.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:_.maxAnnualPercentageYield})]})};function de(){const{useFeatureGate:e}=j(),{isFeatureEnabled:t}=e(P.isReferralFeatureEnabled);return a.jsxs(R,{children:[a.jsx(u,{path:"/",element:t?a.jsx(x,{}):a.jsx(l,{})}),a.jsx(u,{path:"how-it-works",element:t?a.jsx(x,{isReferralDrawerOpen:!0}):a.jsx(l,{})}),a.jsx(u,{path:"refer/*",element:t?a.jsx(B,{}):a.jsx(l,{})}),a.jsx(u,{path:"*",element:a.jsx(l,{})})]})}export{de as default};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-Dr7E3H8N.js","assets/sentry-131ydzJg.js","assets/core-uYqCzel8.js","assets/zeni-epic-state-BmAPZlsC.js","assets/index-CeZ7L-BQ.js","assets/mui-CTbUXhla.js","assets/analytics-CgRNtlDm.js","assets/utils-BkkIzijx.js","assets/withTransactionSidePanel-BS7S2wn5.js","assets/useAskAiCfoHostNavButtonProps-D4_eEE1f.js","assets/useFetchSuggestedQuestionsWhenReady-b8cA6qxS.js","assets/TransactionDetailScreen--PMkud8g.js","assets/decodeURIComponentSafe-DCnYf30M.js","assets/routePaths-vUmlDccC.js","assets/NotFoundScreen-CsEhUGfR.js","assets/analyticsHelper-DhD4YoYg.js","assets/CompanyPassportScreen-Btm8q2XT.js","assets/MobileAppDrawer-CNxBiA0K.js","assets/FeaturePreviewScreen-DPxCLrsp.js","assets/ReferralListScreen-DWAGGjua.js","assets/index-Bc34frN_.css","assets/BillPayRoutes-CFin72Sd.js","assets/AddressScreen-ByYpZmgQ.js","assets/DomesticWireDetailScreen-CzSUYZwn.js","assets/useInitialThreadRequest-cRvS9PIT.js","assets/DrawerScreen-AH0ysY6V.js","assets/SetupPagesScreen-BMUAJOjI.js","assets/BusinessVerificationPageScreen-C-d6e6xJ.js","assets/BillPayApprovalRoutes-CX2-tB9Z.js","assets/ReimbursementApprovalRuleDetailScreen-CtZbBICM.js","assets/getLocaleForTenant-CFQN8jbL.js","assets/ReimbursementRoutes-Iavqnxfs.js","assets/ReimbursementApprovalRoutes-DSgEFO1H.js","assets/TransactionListRoutes-quiJ_wNs.js","assets/ZeniAccountStatementScreen-C8feQjoH.js","assets/SettingsRoutes-Dr2cLQZf.js","assets/accountMappingHelper-D6x0RpVY.js","assets/QBOConnectionScreen-BRrDd8wr.js","assets/empty-CKinwWZY.js","assets/index-DeBaxB_L.js","assets/url-BRm_J7V6.js","assets/index-CxWCBC6O.js","assets/ReportsRoutes-CjoIF9EB.js","assets/ChargeCardRoutes-BqilxZnu.js","assets/PeopleRoutes-DQ3Y767r.js","assets/ExpenseAutomationRoutes-BhbZS8a1.js","assets/TreasuryRoutes-BVcC0j-i.js","assets/VendorsRoutes-DJYa05bm.js","assets/pathToGoBack-Y7yporNq.js","assets/ZeniAccountRoutes-CpYvVE1u.js","assets/AddressRoutes-Clm_yxMo.js","assets/PandLWithForecastRoutes-8SC0GJZW.js","assets/CustomerOnboardingRoutes-Cx10OoO6.js","assets/TransactionDetailRoutes-DLkTkOiV.js","assets/EntityDetailRoutes-DVGIBaLz.js","assets/NotificationRoutes-9IJgVYJ1.js","assets/PerformanceRoutes-BZb18QS3.js","assets/RewardsRoutes-CTiffYxG.js","assets/TaskRoutes-DR1BBqXQ.js","assets/TaskListScreen-DdoFZv0I.js","assets/AiCfoScreen-DbYSFoNw.js"])))=>i.map(i=>d[i]);
2
+ import{_ as n,bn as os,eQ as ls,eW as cs,eU as ds,eV as ms,fF as us,eS as _s,cQ as Ee,cx as Es,fb as As,cp as ps,bE as gs,bq as xs,fg as Is,v as Ts,Jc as hs,bv as js,Jd as Us,bG as Hs,fd as Rs,bF as Ds,bs,cl as ys,Je as fs,Jf as Cs,cN as vs,cP as Os,cO as Ps,cw as Fs,cC as Ls,mS as Ae,eR as pe,fP as Bs,fk as ge,fM as xe,fN as Ie,fl as ks}from"./zeni-epic-state-BmAPZlsC.js";import{j as e}from"./liveblocks-CfCKAQeM.js";import{a as v}from"./sentry-131ydzJg.js";import{h as Vs,j as Ss,l as Ns,u as Ms,g as G,i as Te,N as c,n as Zs,o as t}from"./core-uYqCzel8.js";import{m as ws,u as Gs,z as R,y as zs,a as $s,M as Js,S as L,c as Ws,L as B,D as he,t as _,P as Ys,d as X,l}from"./index-CeZ7L-BQ.js";import"./mui-CTbUXhla.js";import{f as je}from"./analyticsHelper-DhD4YoYg.js";import{t as qs}from"./getLocaleForTenant-CFQN8jbL.js";import"./recharts-BUFoogHS.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./utils-BkkIzijx.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},U=new i.Error().stack;U&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[U]="678d69e8-81cc-474a-9ccc-d975a94edf1a",i._sentryDebugIdIdentifier="sentry-dbid-678d69e8-81cc-474a-9ccc-d975a94edf1a")}catch{}})();const Qs={dashboard:()=>n(()=>import("./DashboardRoutes-Dr7E3H8N.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])),bills:()=>n(()=>import("./BillPayRoutes-CFin72Sd.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,22,14,23,9,10,24,25,17,18,26,15,13,27,28,29,30,20])),reimbursement:()=>n(()=>import("./ReimbursementRoutes-Iavqnxfs.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,14,26,17,15,13,27,18,9,10,24,25,32,29,30,20])),transactions:()=>n(()=>import("./TransactionListRoutes-quiJ_wNs.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20])),settings:()=>n(()=>import("./SettingsRoutes-Dr2cLQZf.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,37,38,39,40,41,12,28,29,32,20])),reports:()=>n(()=>import("./ReportsRoutes-CjoIF9EB.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,14,18,10,24,13,17,20])),chargeCards:()=>n(()=>import("./ChargeCardRoutes-BqilxZnu.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20])),people:()=>n(()=>import("./PeopleRoutes-DQ3Y767r.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,9,10,17,20])),expenseAutomation:()=>n(()=>import("./ExpenseAutomationRoutes-BhbZS8a1.js"),__vite__mapDeps([45,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20])),treasury:()=>n(()=>import("./TreasuryRoutes-BVcC0j-i.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20])),vendors:()=>n(()=>import("./VendorsRoutes-DJYa05bm.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,22,14,18,13,48,9,10,17,25,36,20])),zeniAccounts:()=>n(()=>import("./ZeniAccountRoutes-CpYvVE1u.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,14,26,17,15,13,27,18,23,22,9,10,34,20]))},Ks=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Xs=l(()=>n(()=>import("./ReportsRoutes-CjoIF9EB.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,14,18,10,24,13,17,20]))),en=l(()=>n(()=>import("./AddressRoutes-Clm_yxMo.js"),__vite__mapDeps([50,1,2,3,22,4,5,6,7,14,20]))),sn=l(()=>n(()=>import("./PeopleRoutes-DQ3Y767r.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,9,10,17,20]))),nn=l(()=>n(()=>import("./PandLWithForecastRoutes-8SC0GJZW.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,14,18,9,10,24,13,17,20]))),an=l(()=>n(()=>import("./CustomerOnboardingRoutes-Cx10OoO6.js"),__vite__mapDeps([52,1,2,3,22,4,5,6,7,14,37,38,39,40,41,12,20]))),tn=l(()=>n(()=>import("./VendorsRoutes-DJYa05bm.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,22,14,18,13,48,9,10,17,25,36,20]))),rn=l(()=>n(()=>import("./TransactionDetailRoutes-DLkTkOiV.js"),__vite__mapDeps([53,1,2,3,14,4,5,6,7,11,9,10,12,13,20]))),Ue=l(()=>n(()=>import("./EntityDetailRoutes-DVGIBaLz.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,12,8,9,10,11,13,20]))),on=l(()=>n(()=>import("./DashboardRoutes-Dr7E3H8N.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))),He=l(()=>n(()=>import("./BillPayRoutes-CFin72Sd.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,22,14,23,9,10,24,25,17,18,26,15,13,27,28,29,30,20]))),ln=l(()=>n(()=>import("./SettingsRoutes-Dr2cLQZf.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,37,38,39,40,41,12,28,29,32,20]))),Re=l(()=>n(()=>import("./ReimbursementRoutes-Iavqnxfs.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,14,26,17,15,13,27,18,9,10,24,25,32,29,30,20]))),cn=l(()=>n(()=>import("./ZeniAccountRoutes-CpYvVE1u.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,14,26,17,15,13,27,18,23,22,9,10,34,20]))),dn=l(()=>n(()=>import("./TreasuryRoutes-BVcC0j-i.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20]))),mn=l(()=>n(()=>import("./TransactionListRoutes-quiJ_wNs.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20]))),un=l(()=>n(()=>import("./ChargeCardRoutes-BqilxZnu.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20]))),_n=l(()=>n(()=>import("./NotificationRoutes-9IJgVYJ1.js"),__vite__mapDeps([55,1,2,3,14,4,5,6,7,9,10,20]))),En=l(()=>n(()=>import("./PerformanceRoutes-BZb18QS3.js"),__vite__mapDeps([56,1,2,3,14,4,5,6,7,9,10,17,20]))),An=l(()=>n(()=>import("./ExpenseAutomationRoutes-BhbZS8a1.js"),__vite__mapDeps([45,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20]))),pn=l(()=>n(()=>import("./RewardsRoutes-CTiffYxG.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,14,19,9,10,17,20]))),gn=l(()=>n(()=>import("./TaskRoutes-DR1BBqXQ.js"),__vite__mapDeps([58,1,2,3,14,4,5,6,7,24,17,59,9,10,20]))),xn=l(()=>n(()=>import("./AiCfoScreen-DbYSFoNw.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,48,20]))),y=l(()=>n(()=>import("./NotFoundScreen-CsEhUGfR.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,20]))),In=l(()=>n(()=>import("./TaskListScreen-DdoFZv0I.js"),__vite__mapDeps([59,1,2,3,4,5,6,7,9,10,17,20])));function wn({setTenantEmailDomain:i}){const U=Vs(),V=Ss(),{tenantEmailDomain:o}=Ns(),S=ws().mode,{setLoading:f,clearAllLoading:O,clearLoading:Z}=Gs(),b=R.getSignedInUserTenant(o)?.tenantId,h=R.getSignedInUser(),q=os(h),z=Ms(),[N,be]=v.useState(!1),r=G(a=>ls(a)),{useFeatureGate:P}=zs(),Q=$s(),ye=Js(),{isFeatureEnabled:fe}=P(L.isExpenseAutomationEnabled),{isFeatureEnabled:Ce}=P(L.isExpenseAutomationEnabledV2),ve=Ce||fe&&q,{isFeatureEnabled:Oe}=P(L.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Pe}=P(L.isTreasuryEnabled),{isFeatureEnabled:Fe}=P(L.isChargeCardFeatureEnabled),{isFeatureEnabled:se}=P(L.isDebitCardFeatureEnabled),j=G(a=>a.tenantState.fetchState),A=G(a=>a.tenantState.activeTenantFetchState.fetchState),u=A==="Completed"||j==="Completed"?cs(se,r):void 0,$=A==="Completed"||j==="Completed"?ds(r):void 0,Le=A==="Completed"||j==="Completed"?ms(r):void 0,Be=Fe||se||!!Le||!!$||!!u,{isFeatureEnabled:ke}=P(L.isSettingsFeatureEnabled),{isFeatureEnabled:Ve}=P(L.isAiCfoFileUploadEnabled),J=G(a=>us(a));if(o!=null){const a=R.getSignedInUserTenant(o);h!=null&&a!=null&&je(h,r,S)}const w={tenantId:b,userId:h?.userId,sessionId:h?.zeniSessionId},ne=_s(),E=Ws(),Se=r.company==null||E?.loggedInUserRoleMap!=null&&Ee(E.loggedInUserRole),Ne=Es(E?.loggedInUserRoleMap),ae=v.useRef(!0),te=Te("/:tenantEmailDomain/onboarding/*")!==null,K=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=G(a=>w.tenantId!=null?As(a,w.tenantId):void 0);v.useEffect(()=>{f(B.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(K!=null&&b!=null){const a=K.params.selectedPeriod;if(a!=null){const H=a.split("-");if(H.length===2){const d=ps(Number(H[0])),s=Number(H[1]),m=gs(`01-${d<10?`0${d}`:d}-${s}`,he.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=xs();m.isAfter(M,"month")===!1?U(Is(b,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[K,b]),v.useEffect(()=>{N||(be(!0),f(B.TENANT_FETCHING)),ae.current?ae.current=!1:!Ts(ne,w)&&R.isSignedIn()&&(f(B.TENANT_FETCHING),function(a,H,d,s){if(pe(H?.userId,H?.zeniSessionId,a.tenantId),d(Bs(!0)),d(ge(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const m=R.getSignedInUserTenantWithId(a.tenantId);s&&he.updateAppLocaleID(qs(s)),m?.tenantEmailDomain!=null&&R.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}a.userId!=null?X.identify(a.userId,{tenant_id:a.tenantId}):X.resetUserIdentity()}(w,h,U,Me))},[w,ne,h,U,R]),v.useEffect(()=>{R.isSignedIn()&&(f(B.TENANT_FETCHING),function(a,H,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const W=s!=null&&m?.zeniSessionId!=null,ts=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,rs=d!=null&&d.externalConnections==null;if(W&&ts){k(ge(s));const Y=R.getSignedInUserTenantWithId(s);Y?.tenantEmailDomain!=null&&R.saveActiveTenantDomainForUser(Y?.tenantEmailDomain),pe(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(xe(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(Ie(m.userId,s)))}else W&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(xe(m.userId,s))),W&&rs&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(Ie(m.userId,s)));if(W){X.identify(m.userId,{tenant_id:s});const Y=s==null||s!=null&&(H==="Completed"||H==="Error");a==="Completed"||H!=="Not-Started"&&H!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(B.TENANT_FETCHING),k(ks(m.userId,s,m.zeniSessionId))),Y&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Ae(m.userId,m.zeniSessionId)))}}(j,A,r,b,h,f,U))},[b,A]),v.useEffect(()=>{R.isSignedIn()&&j==="Completed"&&J.tenantsBaseInOrder.length>0&&(Z(B.TENANT_FETCHING),R.saveSignedInUserTenants(hs(J.tenantsBaseInOrder)),h!=null&&je(h,r,S,void 0,J.tenantsBaseInOrder))},[J,j,r,h]),v.useEffect(()=>{A==="In-Progress"&&f(B.TENANT_FETCHING),A!=="Completed"&&A!=="Error"||(A==="Completed"&&b!=null?(O(),_.markActiveTenantFetchCompleted(b)):A==="Error"&&b!=null&&(_.markActiveTenantFetchFailed(b),Z(B.TENANT_FETCHING),Z(B.TENANT_SWITCHING))),j!=="Completed"&&j!=="Error"||(j==="Completed"?_.markAllTenantsFetchCompleted():j==="Error"&&_.markAllTenantsFetchFailed())},[A,j,b,N]);const ie=v.useRef(!1);v.useEffect(()=>{!ie.current&&A==="Completed"&&N&&(ie.current=!0,function(a=Ks,H=3e3){setTimeout(()=>{const d=s=>{if(s>=a.length)return;const m=a[s],M=Qs[m];M!=null?M().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},H)}())},[A,N]);const C=r?.userRole!=null&&js(r?.userRole),{isFeatureEnabled:Ze}=P(L.isReferralFeatureEnabled),we=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Ge=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),F=r?.userRole!=null&&Ee(r.userRole),re=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,oe=Be&&!C,ze=Us(E?.loggedInUserRoleMap),$e=r.externalConnections?.accounting[0]?.isValid,le=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,de=ce&&Hs(E?.loggedInUserRoleMap),me=Oe&&!C,Je=r.company!=null&&Rs(r.company),We=Pe&&Je===!0&&!C,Ye=re&&Ds(E?.loggedInUserRoleMap),qe=oe&&bs(E?.loggedInUserRoleMap),Qe=me&&ys(E?.loggedInUserRoleMap),Ke=fs(E?.loggedInUserRoleMap),Xe=Cs(E?.loggedInUserRoleMap),p=vs(E?.loggedInUserRoleMap),g=Os(E?.loggedInUserRoleMap),x=Ps(E?.loggedInUserRoleMap),I=Fs(E?.loggedInUserRoleMap),T=Ls(E?.loggedInUserRoleMap),ue=re&&I,_e=ce&&T,es=me&&p,ss=We&&g,ns=oe&&x,as=r.excludedResources?.resources?.find(a=>a.resource==="/invites")!=null||Ne===!0||ze===!0||Ke===!0||Xe===!0;return R.isSignedIn()?b==null?j==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}):(h!=null&&j!=="In-Progress"&&U(Ae(h.userId,h.zeniSessionId)),null):A!=="In-Progress"&&A!=="Not-Started"||j==="Completed"?(le===!0||q&&!te)&&$e===!1&&u===!1&&$===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||le!==!1||te||q?N&&r?.userRole&&u!=null&&$!=null&&o!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Zs,{children:e.jsxs(t,{element:e.jsx(Ys,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Tn,{isDashboardAccess:F,isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,isTenantCardsOnly:$})}),e.jsx(t,{path:"dashboard/*",element:F?e.jsx(on,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:F?e.jsx(Xs,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:as||F?e.jsx(sn,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:F?e.jsx(nn,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(an,{})}),e.jsx(t,{path:"transaction/*",element:F&&C===!1||we||Ge?e.jsx(rn,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:F&&C===!1?e.jsx(mn,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:F&&C===!1?e.jsx(Ue,{entityType:"customer"}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:g,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:F&&C===!1?e.jsx(Ue,{entityType:"vendor"}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(In,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(gn,{})}),e.jsx(t,{path:"address/*",element:Ye||de||Qe||qe?e.jsx(en,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:es?e.jsx(cn,{}):e.jsx(y,{})}),e.jsx(t,{path:"treasury/*",element:ss?e.jsx(dn,{}):e.jsx(y,{})}),e.jsx(t,{path:"performance",element:ye?e.jsx(En,{}):e.jsx(De,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ve&&C===!1?e.jsx(An,{}):e.jsx(De,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(_n,{})}),e.jsx(t,{path:"vendors/*",element:Se?e.jsx(tn,{}):e.jsx(y,{})}),e.jsx(t,{path:"bill/*",element:ue?e.jsx(He,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:ue?e.jsx(He,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:_e?e.jsx(Re,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:_e?e.jsx(Re,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:ke?e.jsx(ln,{hasAdminLevelAccess:de}):e.jsx(y,{})}),e.jsx(t,{path:"cards/*",element:ns?e.jsx(un,{}):e.jsx(y,{})}),e.jsx(t,{path:"rewards/*",element:Ze?e.jsx(pn,{}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo",element:Q?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/",element:Q?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:Q?e.jsx(xn,{isFileUploadEnabled:Ve}):e.jsx(y,{})}),e.jsx(t,{path:"*",element:e.jsx(y,{})})]})}):null:(i(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),i(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}))}const Tn=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:S,isUserHasTreasuryAccess:f,isTenantBankingOnly:O,isTenantCardsOnly:Z})=>O===!0&&U?e.jsx(c,{to:"checking"}):Z===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):f?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):S?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),D=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:f,tenantEmailDomain:O})=>f===!0||i?e.jsx(Hn,{tenantEmailDomain:O}):S?e.jsx(Un,{tenantEmailDomain:O}):U?e.jsx(Rn,{tenantEmailDomain:O}):V?e.jsx(jn,{tenantEmailDomain:O}):o?e.jsx(hn,{tenantEmailDomain:O}):e.jsx(y,{}),hn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),jn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),Un=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),Hn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),Rn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),De=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{D as FallBackRoute,wn as default};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-DRCozBQX.js";import{a as p}from"./sentry-B4qAfutp.js";import{j as _,u as B,h as k,g as h,k as R,l as F,n as X,o as C}from"./core-D9lzXsHE.js";import{bn as xe,eO as j,gG as de,KX as Ee,Jk as Ae,jA as ue,lT as we,gI as je,KZ as ve,KY as ke,Nm as Pe,xj as De,BO as Ue,MX as Me,N4 as _e,c1 as W,cG as Te,cH as Be,J1 as Re,Nn as Fe,J2 as Ve,vL as Ne,No as Oe,E2 as Le,Bu as $e,Bl as pe,Bi as Je,vP as ge,Bo as me,Br as fe,Bx as ee,sm as ne,vO as ze,jc as Q,jf as he,Np as Ge,kg as Ke,w2 as Ze,JS as He,JT as qe,ja as Xe,Nq as Qe,jd as Ye,qM as We,Nr as en,Ns as nn,qQ as tn,gi as an,Ja as se,gp as sn,Jb as on,v$ as cn,Nt as rn,Nu as ln,BL as dn,eS as be,eU as Se,Nv as un,fw as pn,Jl as gn,v_ as oe,fB as ie,fA as mn,vZ as fn,fz as hn,fy as bn,Nw as Sn,eX as ye,Nx as yn,Ny as In,w5 as Cn,vY as ce,Nz as xn,fd as En,vV as An,bU as wn,c0 as jn,b$ as vn,bV as kn,bZ as Pn,bY as Dn,bX as Un,b_ as Mn,bW as _n}from"./zeni-epic-state-CthkBqEW.js";import{y as te,S as U,z as x,ac as Ie,bB as Tn,c as J,e as Bn,k as V,B as ae,bC as Rn,bD as Fn,an as Vn,f as Ce,bE as Nn,bF as On,bG as Ln,a6 as $n,R as Jn,bH as zn,j as Gn,bI as Kn}from"./index-D4WqoFTE.js";import{n as M}from"./mui-uwgkpTLc.js";import{M as P}from"./MobileAppDrawer-D_MxSFu1.js";import{a as L,g as $,m as Zn}from"./accountMappingHelper-BSumbKrF.js";import{t as Hn,A as qn}from"./AddressScreen-C8epvHKg.js";import T from"./NotFoundScreen-BUTU_-cN.js";import{g as Xn}from"./analyticsHelper-DhFEnfI7.js";import{B as Qn}from"./BusinessVerificationPageScreen-BHqq2xxV.js";import{C as Yn}from"./CompanyPassportScreen-Cjnsn_RK.js";import{q as re}from"./QBOConnectionScreen-D3kZw9eT.js";import{B as Wn}from"./BillPayApprovalRoutes-C2pW_0HD.js";import{R as et}from"./ReimbursementApprovalRoutes-CK7PuiBG.js";import"./recharts-C3UFukkg.js";import"./analytics-q_QSThl7.js";import"./plaid-CRq9dUdG.js";import"./dnd-DNtF3Icn.js";import"./stripe-DMRn4zHo.js";import"./lottie-CFIADA6U.js";import"./lexical-5_A_mLPM.js";import"./pdf-C9DJlS7s.js";import"./utils-DfCznjX8.js";import"./routePaths-C2HBowO1.js";import"./empty-BnWCAzBO.js";import"./pdf-lib-DykPSmmb.js";import"./index-CuyoN034.js";import"./url-D-rSVugE.js";import"./index-CDrFhkvu.js";import"./decodeURIComponentSafe-B4xUD3SX.js";import"./ReimbursementApprovalRuleDetailScreen-DXvOZU5T.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]="bd8315a5-a504-4dc2-926a-0caac4a357e5",e._sentryDebugIdIdentifier="sentry-dbid-bd8315a5-a504-4dc2-926a-0caac4a357e5")}catch{}})();const nt=M.div`
1
+ import{j as a}from"./liveblocks-CfCKAQeM.js";import{a as p}from"./sentry-131ydzJg.js";import{j as _,u as T,h as P,g as h,k as B,l as F,n as W,o as C}from"./core-uYqCzel8.js";import{bn as xe,eQ as j,gI as de,Li as Ee,JH as Ae,jC as ue,lV as we,gK as je,Lk as ke,Lj as Pe,NJ as ve,xG as De,C9 as Ue,Ni as Me,Nr as _e,c2 as Y,cH as Re,cI as Te,Jo as Be,NK as Fe,Jp as Ne,w6 as Ve,NL as Le,Ep as Oe,BR as $e,BI as pe,BF as Je,wa as ge,BL as me,BO as fe,BU as ee,sJ as ne,w9 as Ke,je as q,jh as he,NM as Ge,ki as He,wp as ze,Kd as Ze,Ke as Qe,jc as We,NN as qe,jf as Xe,r7 as Ye,NO as en,NP as nn,rb as tn,gk as an,Jx as se,gr as sn,Jy as on,wm as cn,NQ as rn,NR as ln,C6 as dn,eU as be,eW as Se,NS as un,fy as pn,JI as gn,wl as oe,fD as ie,fC as mn,wk as fn,fB as hn,fA as bn,NT as Sn,eZ as Ie,NU as In,NV as yn,ws as Cn,wj as ce,NW as xn,ff as En,wg as An,bV as wn,c1 as jn,c0 as kn,bW as Pn,b_ as vn,bZ as Dn,bY as Un,b$ as Mn,bX as _n}from"./zeni-epic-state-BmAPZlsC.js";import{y as te,S as U,z as x,ac as ye,bB as Rn,d as J,f as Tn,c as N,x as ae,bC as Bn,bD as Fn,an as Nn,h as Ce,bE as Vn,bF as Ln,bG as On,a6 as $n,U as Jn,bH as Kn,q as Gn,bI as Hn}from"./index-CeZ7L-BQ.js";import{n as M}from"./mui-CTbUXhla.js";import{M as v}from"./MobileAppDrawer-CNxBiA0K.js";import{a as O,g as $,m as zn}from"./accountMappingHelper-D6x0RpVY.js";import{t as Zn,A as Qn}from"./AddressScreen-ByYpZmgQ.js";import R from"./NotFoundScreen-CsEhUGfR.js";import{g as Wn}from"./analyticsHelper-DhD4YoYg.js";import{B as qn}from"./BusinessVerificationPageScreen-C-d6e6xJ.js";import{C as Xn}from"./CompanyPassportScreen-Btm8q2XT.js";import{q as re}from"./QBOConnectionScreen-BRrDd8wr.js";import{B as Yn}from"./BillPayApprovalRoutes-CX2-tB9Z.js";import{R as et}from"./ReimbursementApprovalRoutes-DSgEFO1H.js";import"./recharts-BUFoogHS.js";import"./analytics-CgRNtlDm.js";import"./plaid-Bio3MiLm.js";import"./dnd-BSWou54V.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dc_IH0fS.js";import"./lexical-DbCoEckm.js";import"./pdf-O9N1jd2N.js";import"./utils-BkkIzijx.js";import"./routePaths-vUmlDccC.js";import"./empty-CKinwWZY.js";import"./pdf-lib-CNgiyR2K.js";import"./index-DeBaxB_L.js";import"./url-BRm_J7V6.js";import"./index-CxWCBC6O.js";import"./decodeURIComponentSafe-DCnYf30M.js";import"./ReimbursementApprovalRuleDetailScreen-CtZbBICM.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]="2ec8d538-4cea-4041-aadb-74a1e92fd3fe",e._sentryDebugIdIdentifier="sentry-dbid-2ec8d538-4cea-4041-aadb-74a1e92fd3fe")}catch{}})();const nt=M.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as a}from"./liveblocks-DRCozBQX.js";import{a as p}from"./sentry-B4qAfut
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,tt=R(function(e,s){return{accountMappingView:s.accountMappingView,isFiling1099FeatureEnabled:s.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:s.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:ue(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Ae(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,s){const{navigate:o,location:c,isFiling1099FeatureEnabled:i}=s;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:t,billsAccountSection:r,reimbursementsAccountSection:u,vendorsAccountSection:d,filing1099Section:g}=n,{incomeAccount:f,expenseAccount:m}=t,{billPayAccount:l}=r,{reimbursementsAccount:E}=u,{prepaidExpensesAccount:y,fixedAssetsAccount:w,accruedExpensesAccount:S}=d,{bankAccount:I,expenseCategory1099:N}=g,A=L(s.accountMappingView.incomeAccountList,f.selectedOption),z=L(s.accountMappingView.expenseAccountList,m.selectedOption),G=L(s.accountMappingView.billPayAccountList,l.selectedOption),K=L(s.accountMappingView.reimbursementsAccountList,E.selectedOption),O=$(s.accountMappingView.prepaidExpensesAccountList,y.selectedOptions),b=$(s.accountMappingView.fixedAssetsAccountList,w.selectedOptions),D=$(s.accountMappingView.accruedExpensesAccountList,S.selectedOptions),Z=$(s.accountMappingView.bankAccounts1099FilingAccountList,I.selectedOptions),H=Zn(s.accountMappingView.expenseAccounts1099FilingAccountList,N),q={selectedIncomeAccountId:A?.accountId,selectedExpenseAccountId:z?.accountId,selectedBillPayAccountId:G?.accountId,selectedReimbursementsAccountId:K?.accountId,selectedPrepaidExpensesAccountIds:O.map(v=>v.accountId),selectedFixedAssetsAccountIds:b.map(v=>v.accountId),selectedAccruedExpensesAccountIds:D.map(v=>v.accountId),selectedBankAccounts1099FilingAccountIds:Z.map(v=>v.accountId),selectedExpenseAccounts1099FilingAccountIds:H};e(ke({data:q}))},onBackClick:()=>{Ie(c)===!1?(o("../../dashboard"),e(ve())):e(de())},onSaveClick:()=>{e(je()),i&&J.track(Bn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(we(s.currentTenant.companyId,n))}}})(Tn),at=()=>{const e=_(),s=B(),o=k(),{useFeatureGate:c}=te(),{isFeatureEnabled:i}=c(U.isFiling1099FeatureEnabled),{isFeatureEnabled:n}=c(U.isScheduledJEAccruedExpensesFeatureEnabled),t=x.getSignedInUser(),r=xe(t),u=h(y=>j(y)),[d,g]=p.useState(!1),[f,m]=p.useState(!1);p.useEffect(()=>{d===!1&&(o(de()),g(!0))},[d]);const l=h(y=>Ee(y)),E=y=>{m(y)};return a.jsxs(nt,{children:[a.jsx(P,{isAppContentDrawerOpen:f,handleDrawerToggle:E}),a.jsx(tt,{currentTenant:u,navigate:e,accountMappingView:l,isFiling1099FeatureEnabled:i&&r,isAccruedExpensesFeatureEnabled:n,location:s,isSettings:Ie(s),onClickMenuIcon:()=>E(!0)})]})},st=M.div`
9
+ `,tt=B(function(e,s){return{accountMappingView:s.accountMappingView,isFiling1099FeatureEnabled:s.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:s.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:ue(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Ae(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,s){const{navigate:o,location:c,isFiling1099FeatureEnabled:i}=s;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:t,billsAccountSection:r,reimbursementsAccountSection:u,vendorsAccountSection:d,filing1099Section:g}=n,{incomeAccount:f,expenseAccount:m}=t,{billPayAccount:l}=r,{reimbursementsAccount:E}=u,{prepaidExpensesAccount:I,fixedAssetsAccount:w,accruedExpensesAccount:S}=d,{bankAccount:y,expenseCategory1099:V}=g,A=O(s.accountMappingView.incomeAccountList,f.selectedOption),K=O(s.accountMappingView.expenseAccountList,m.selectedOption),G=O(s.accountMappingView.billPayAccountList,l.selectedOption),H=O(s.accountMappingView.reimbursementsAccountList,E.selectedOption),L=$(s.accountMappingView.prepaidExpensesAccountList,I.selectedOptions),b=$(s.accountMappingView.fixedAssetsAccountList,w.selectedOptions),D=$(s.accountMappingView.accruedExpensesAccountList,S.selectedOptions),z=$(s.accountMappingView.bankAccounts1099FilingAccountList,y.selectedOptions),Z=zn(s.accountMappingView.expenseAccounts1099FilingAccountList,V),Q={selectedIncomeAccountId:A?.accountId,selectedExpenseAccountId:K?.accountId,selectedBillPayAccountId:G?.accountId,selectedReimbursementsAccountId:H?.accountId,selectedPrepaidExpensesAccountIds:L.map(k=>k.accountId),selectedFixedAssetsAccountIds:b.map(k=>k.accountId),selectedAccruedExpensesAccountIds:D.map(k=>k.accountId),selectedBankAccounts1099FilingAccountIds:z.map(k=>k.accountId),selectedExpenseAccounts1099FilingAccountIds:Z};e(Pe({data:Q}))},onBackClick:()=>{ye(c)===!1?(o("../../dashboard"),e(ke())):e(de())},onSaveClick:()=>{e(je()),i&&J.track(Tn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(we(s.currentTenant.companyId,n))}}})(Rn),at=()=>{const e=_(),s=T(),o=P(),{useFeatureGate:c}=te(),{isFeatureEnabled:i}=c(U.isFiling1099FeatureEnabled),{isFeatureEnabled:n}=c(U.isScheduledJEAccruedExpensesFeatureEnabled),t=x.getSignedInUser(),r=xe(t),u=h(I=>j(I)),[d,g]=p.useState(!1),[f,m]=p.useState(!1);p.useEffect(()=>{d===!1&&(o(de()),g(!0))},[d]);const l=h(I=>Ee(I)),E=I=>{m(I)};return a.jsxs(nt,{children:[a.jsx(v,{isAppContentDrawerOpen:f,handleDrawerToggle:E}),a.jsx(tt,{currentTenant:u,navigate:e,accountMappingView:l,isFiling1099FeatureEnabled:i&&r,isAccruedExpensesFeatureEnabled:n,location:s,isSettings:ye(s),onClickMenuIcon:()=>E(!0)})]})},st=M.div`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -14,7 +14,7 @@ import{j as a}from"./liveblocks-DRCozBQX.js";import{a as p}from"./sentry-B4qAfut
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,ot=R(function(e,s){const o=j(e),c=Me(e),i=_e(e),n=s.roleMap.bill_pay_admin;return{isDisabled:(W(o?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:i,analytics:J}},function(e,s){const{navigate:o,currentTenant:c}=s;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}})(Rn),it=()=>{const e=_(),s=B(),o=k(),{tenantEmailDomain:c}=F(),[i,n]=p.useState(!1),[t,r]=p.useState(!1),[u,d]=p.useState(!1),g=h(S=>j(S)),f=h(S=>S.billPaySetupApproverViewState.fetchState),m=h(S=>S.remiSetupApproverViewState.fetchState),l=h(S=>Pe(S)),E=g.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const y=V();p.useEffect(()=>{u||f!=="Not-Started"||(d(!0),o(De(!0)))},[u,f,o]),p.useEffect(()=>{t||m!=="Not-Started"||(r(!0),o(Ue(!0)))},[t,m,o]);const w=S=>{n(S)};return y?.loggedInUserRoleMap!=null?a.jsxs(st,{children:[a.jsx(P,{isAppContentDrawerOpen:i,handleDrawerToggle:w}),a.jsx(ot,{navigate:e,location:s,companyId:E,currentTenant:g,roleMap:y.loggedInUserRoleMap,onClickMenuIcon:()=>{w(!0)}})]}):a.jsx(ae,{fetchState:l.fetchState})},ct=M.div`
17
+ `,ot=B(function(e,s){const o=j(e),c=Me(e),i=_e(e),n=s.roleMap.bill_pay_admin;return{isDisabled:(Y(o?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:i,analytics:J}},function(e,s){const{navigate:o,currentTenant:c}=s;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}})(Bn),it=()=>{const e=_(),s=T(),o=P(),{tenantEmailDomain:c}=F(),[i,n]=p.useState(!1),[t,r]=p.useState(!1),[u,d]=p.useState(!1),g=h(S=>j(S)),f=h(S=>S.billPaySetupApproverViewState.fetchState),m=h(S=>S.remiSetupApproverViewState.fetchState),l=h(S=>ve(S)),E=g.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const I=N();p.useEffect(()=>{u||f!=="Not-Started"||(d(!0),o(De(!0)))},[u,f,o]),p.useEffect(()=>{t||m!=="Not-Started"||(r(!0),o(Ue(!0)))},[t,m,o]);const w=S=>{n(S)};return I?.loggedInUserRoleMap!=null?a.jsxs(st,{children:[a.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:w}),a.jsx(ot,{navigate:e,location:s,companyId:E,currentTenant:g,roleMap:I.loggedInUserRoleMap,onClickMenuIcon:()=>{w(!0)}})]}):a.jsx(ae,{fetchState:l.fetchState})},ct=M.div`
18
18
  display: flex;
19
19
  height: 100%;
20
20
  width: 100%;
@@ -22,7 +22,7 @@ import{j as a}from"./liveblocks-DRCozBQX.js";import{a as p}from"./sentry-B4qAfut
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,rt=R(function(e,s){const{companyId:o,isZeniAccountEnabled:c,isChargeCardEnabled:i,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:r}=s,u=j(e);return{bankSetupView:Oe(e,o,n,t,c,i,r),connectedAccountProvider:u.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:J}},function(e,s){const{navigate:o,currentTenant:c,companyId:i}=s;return{onFetchLinkTokenClick:(n,t,r)=>{e(ne(t,n,r))},onEstablishConnectionClick:(n,t,r)=>{e(ee(n,i,t,r))},onUpdatePaymentAccountStatus:(n,t,r,u,d)=>{e(fe(n,t,d,u,r))},onUpdatePaymentAccountLoginStatus:(n,t,r,u)=>{e(me(!1,n,u,r,t))},onEstablishConnectionSuccess:(n,t)=>{e(ge(t,n))},onUpdateAccountClick:(n,t,r,u,d)=>{e(d==="paymentAccount"?pe(n,t,r,u):Je(u,n,t))},onUpdatePrimaryFundingAccount:(n,t,r)=>{e($e(i,t,n,r))},onRemoveConnection:n=>{e(Le(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}})(Fn),lt=()=>{const e=_(),s=B(),o=k(),{tenantEmailDomain:c}=F(),i=V(),[n,t]=p.useState(!1),[r,u]=p.useState(!1),d=h(I=>j(I)),g=h(I=>I.settingsViewState.bankConnection.fetchState),f=Te(d,i?.loggedInUserRoleMap),m=Be(d,i?.loggedInUserRoleMap),l=Re(d,i?.loggedInUserRoleMap),E=Fe(d,i?.loggedInUserRoleMap),y=Ve(d,i?.loggedInUserRoleMap),w=d.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");p.useEffect(()=>{r||g==="Completed"||(u(!0),o(Ne(!1)))},[r,o,g]);const S=I=>{t(I)};return f||l||m||y?a.jsxs(ct,{children:[a.jsx(P,{isAppContentDrawerOpen:n,handleDrawerToggle:S}),a.jsx(rt,{navigate:e,location:s,companyId:w,currentTenant:d,roleMap:i.loggedInUserRoleMap,isBillPayEnabled:f,isRemiEnabled:m,isZeniAccountEnabled:l,isChargeCardEnabled:y,isTreasuryEnabled:E,onClickMenuIcon:()=>{S(!0)}})]}):a.jsx(T,{})},dt=M.div`
25
+ `,rt=B(function(e,s){const{companyId:o,isZeniAccountEnabled:c,isChargeCardEnabled:i,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:r}=s,u=j(e);return{bankSetupView:Le(e,o,n,t,c,i,r),connectedAccountProvider:u.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:J}},function(e,s){const{navigate:o,currentTenant:c,companyId:i}=s;return{onFetchLinkTokenClick:(n,t,r)=>{e(ne(t,n,r))},onEstablishConnectionClick:(n,t,r)=>{e(ee(n,i,t,r))},onUpdatePaymentAccountStatus:(n,t,r,u,d)=>{e(fe(n,t,d,u,r))},onUpdatePaymentAccountLoginStatus:(n,t,r,u)=>{e(me(!1,n,u,r,t))},onEstablishConnectionSuccess:(n,t)=>{e(ge(t,n))},onUpdateAccountClick:(n,t,r,u,d)=>{e(d==="paymentAccount"?pe(n,t,r,u):Je(u,n,t))},onUpdatePrimaryFundingAccount:(n,t,r)=>{e($e(i,t,n,r))},onRemoveConnection:n=>{e(Oe(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}})(Fn),lt=()=>{const e=_(),s=T(),o=P(),{tenantEmailDomain:c}=F(),i=N(),[n,t]=p.useState(!1),[r,u]=p.useState(!1),d=h(y=>j(y)),g=h(y=>y.settingsViewState.bankConnection.fetchState),f=Re(d,i?.loggedInUserRoleMap),m=Te(d,i?.loggedInUserRoleMap),l=Be(d,i?.loggedInUserRoleMap),E=Fe(d,i?.loggedInUserRoleMap),I=Ne(d,i?.loggedInUserRoleMap),w=d.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");p.useEffect(()=>{r||g==="Completed"||(u(!0),o(Ve(!1)))},[r,o,g]);const S=y=>{t(y)};return f||l||m||I?a.jsxs(ct,{children:[a.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:S}),a.jsx(rt,{navigate:e,location:s,companyId:w,currentTenant:d,roleMap:i.loggedInUserRoleMap,isBillPayEnabled:f,isRemiEnabled:m,isZeniAccountEnabled:l,isChargeCardEnabled:I,isTreasuryEnabled:E,onClickMenuIcon:()=>{S(!0)}})]}):a.jsx(R,{})},dt=M.div`
26
26
  display: flex;
27
27
  height: 100%;
28
28
  width: 100%;
@@ -30,7 +30,7 @@ import{j as a}from"./liveblocks-DRCozBQX.js";import{a as p}from"./sentry-B4qAfut
30
30
  flex-direction: column;
31
31
  align-items: center;
32
32
  background-color: ${e=>e.theme.colors.grey4};
33
- `,ut=R(function(e,s){const{companyId:o}=s,c=j(e),i=s.roleMap.bill_pay_admin,n=Ge(e,o),{uiState:t}=n,r=(W(c?.userRole??[])||i)&&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:Ce.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,analytics:J}},function(e,s){const{navigate:o,currentTenant:c,companyId:i}=s;return{onFetchLinkTokenClick:(n,t)=>{e(ne("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(ee(n,i,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ge("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,r)=>{e(fe(n,t,"billing","billing_setup",r))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(me(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(pe(n,t,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(he(n))},handleConfirmCardSetupIntent:n=>{e(Ye(n))},updateCardPaymentModalState:n=>{e(Qe({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,r)=>{e(Xe(n,t,r))},handleFetchPaymentSources:()=>{e(Q())},resetCardPaymentViewState:()=>{e(qe())},handleResetCardPaymentErrorStatuses:()=>{e(He())},onBillingAddressSave:n=>{e(Ze(n))},onAddressEditHandler:n=>{if(n!=null){const t=Hn(n);e(Ke({addressType:"subscription_billing_address",addressToCreate:t}))}}}})(Nn),pt=()=>{const e=_(),s=B(),o=k(),{tenantEmailDomain:c}=F(),[i,n]=p.useState(!1),[t,r]=p.useState(!1),[u,d]=p.useState(!1),g=h(I=>j(I)),f=h(I=>I.cardPaymentViewState),m=h(I=>I.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=Vn(f.addCardPaymentSourceStatus.fetchState),E=f.addCardPaymentSourceStatus.fetchState,y=g.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const w=V();p.useEffect(()=>{y!=null&&o(ze(y,!1))},[y,o]),p.useEffect(()=>{t||(r(!0),o(Q()))},[t,o]),p.useEffect(()=>{u||(he(["card"]),d(!0))},[u]),p.useEffect(()=>{l==="In-Progress"&&E==="Completed"&&o(Q())},[l,E]);const S=I=>{n(I)};return w?.loggedInUserRoleMap!=null?a.jsxs(dt,{children:[a.jsx(P,{isAppContentDrawerOpen:i,handleDrawerToggle:S}),a.jsx(ut,{navigate:e,location:s,companyId:y,currentTenant:g,roleMap:w.loggedInUserRoleMap,onClickMenuIcon:()=>{S(!0)},googleAPIKey:Ce.googleMapsAPIKey})]}):a.jsx(ae,{fetchState:m})},Y="external_integrations",gt=R(function(e){const s=nn(e,Y);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(s.map(o=>o.additionalInfo).filter(o=>o!=null))}},function(e,s){const{navigate:o,integrationsView:c,signedInUserEmail:i,tenantEmailDomain:n,tenantId:t}=s;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{re.init("/connection/auth",n),re.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(cn())},onSaveChargeBeeCredentials:(r,u)=>{const d=c.externalConnections?.revenue?.find(g=>g.connectionName==="chargebee")?.connectionId;d!=null&&e(sn(t,d,se("revenue"),on("chargebee"),{api_key:r,site:u}))},onConnectHubSpot:(r,u)=>{const d=c.externalConnections?.revenue?.find(g=>g.connectionName==="hubspot")?.connectionId;if(d!=null){const g=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:r,client_secret:u,connection_id:d,redirect_uri:g,tenant_id:t}));const f="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(r)}&scope=${encodeURIComponent(f)}&redirect_uri=${encodeURIComponent(g)}`}},onDisconnect:(r,u)=>{e(an(t,r,se(u)))},onNotifyMe:r=>{e(tn(Y,r,i))}}})(On),mt=()=>{const e=_(),s=k(),{tenantEmailDomain:o}=F(),[c,i]=p.useState(!1),n=h(l=>l.tenantState.fetchState),t=h(l=>j(l)),r=t.companyId??x.getSignedInUserTenant(o)?.companyId,u=x.getSignedInUser(),d=V(),g=W(t.userRole??[]);if(u==null)throw Error("Can't access Integrations page without signing in...");p.useEffect(()=>{s(We(Y))},[s]);const f=l=>{i(l)},m=h(l=>en(l,r));return d?.loggedInUserRoleMap!=null?a.jsxs(ft,{children:[a.jsx(P,{isAppContentDrawerOpen:c,handleDrawerToggle:f}),a.jsx(gt,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:g,integrationsView:m,signedInUserEmail:u.userEmail??"",tenantEmailDomain:t.tenantEmailDomain??o??"",tenantId:t.tenantId,saveChargeBeeState:m.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:m.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:m.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:m.externalConnections?.saveOAuthConnectionError?.message,deleteConnectionState:m.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:m.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress"})]}):a.jsx(ae,{fetchState:n})},ft=M.div`
33
+ `,ut=B(function(e,s){const{companyId:o}=s,c=j(e),i=s.roleMap.bill_pay_admin,n=Ge(e,o),{uiState:t}=n,r=(Y(c?.userRole??[])||i)&&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:Ce.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,analytics:J}},function(e,s){const{navigate:o,currentTenant:c,companyId:i}=s;return{onFetchLinkTokenClick:(n,t)=>{e(ne("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(ee(n,i,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ge("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,r)=>{e(fe(n,t,"billing","billing_setup",r))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(me(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(pe(n,t,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(he(n))},handleConfirmCardSetupIntent:n=>{e(Xe(n))},updateCardPaymentModalState:n=>{e(qe({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,r)=>{e(We(n,t,r))},handleFetchPaymentSources:()=>{e(q())},resetCardPaymentViewState:()=>{e(Qe())},handleResetCardPaymentErrorStatuses:()=>{e(Ze())},onBillingAddressSave:n=>{e(ze(n))},onAddressEditHandler:n=>{if(n!=null){const t=Zn(n);e(He({addressType:"subscription_billing_address",addressToCreate:t}))}}}})(Vn),pt=()=>{const e=_(),s=T(),o=P(),{tenantEmailDomain:c}=F(),[i,n]=p.useState(!1),[t,r]=p.useState(!1),[u,d]=p.useState(!1),g=h(y=>j(y)),f=h(y=>y.cardPaymentViewState),m=h(y=>y.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=Nn(f.addCardPaymentSourceStatus.fetchState),E=f.addCardPaymentSourceStatus.fetchState,I=g.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const w=N();p.useEffect(()=>{I!=null&&o(Ke(I,!1))},[I,o]),p.useEffect(()=>{t||(r(!0),o(q()))},[t,o]),p.useEffect(()=>{u||(he(["card"]),d(!0))},[u]),p.useEffect(()=>{l==="In-Progress"&&E==="Completed"&&o(q())},[l,E]);const S=y=>{n(y)};return w?.loggedInUserRoleMap!=null?a.jsxs(dt,{children:[a.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:S}),a.jsx(ut,{navigate:e,location:s,companyId:I,currentTenant:g,roleMap:w.loggedInUserRoleMap,onClickMenuIcon:()=>{S(!0)},googleAPIKey:Ce.googleMapsAPIKey})]}):a.jsx(ae,{fetchState:m})},X="external_integrations",gt=B(function(e){const s=nn(e,X);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(s.map(o=>o.additionalInfo).filter(o=>o!=null))}},function(e,s){const{navigate:o,integrationsView:c,signedInUserEmail:i,tenantEmailDomain:n,tenantId:t}=s;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{re.init("/connection/auth",n),re.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(cn())},onSaveChargeBeeCredentials:(r,u)=>{const d=c.externalConnections?.revenue?.find(g=>g.connectionName==="chargebee")?.connectionId;d!=null&&e(sn(t,d,se("revenue"),on("chargebee"),{api_key:r,site:u}))},onConnectHubSpot:(r,u)=>{const d=c.externalConnections?.revenue?.find(g=>g.connectionName==="hubspot")?.connectionId;if(d!=null){const g=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:r,client_secret:u,connection_id:d,redirect_uri:g,tenant_id:t}));const f="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(r)}&scope=${encodeURIComponent(f)}&redirect_uri=${encodeURIComponent(g)}`}},onDisconnect:(r,u)=>{e(an(t,r,se(u)))},onNotifyMe:r=>{e(tn(X,r,i))}}})(Ln),mt=()=>{const e=_(),s=P(),{tenantEmailDomain:o}=F(),[c,i]=p.useState(!1),n=h(l=>l.tenantState.fetchState),t=h(l=>j(l)),r=t.companyId??x.getSignedInUserTenant(o)?.companyId,u=x.getSignedInUser(),d=N(),g=Y(t.userRole??[]);if(u==null)throw Error("Can't access Integrations page without signing in...");p.useEffect(()=>{s(Ye(X))},[s]);const f=l=>{i(l)},m=h(l=>en(l,r));return d?.loggedInUserRoleMap!=null?a.jsxs(ft,{children:[a.jsx(v,{isAppContentDrawerOpen:c,handleDrawerToggle:f}),a.jsx(gt,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:g,integrationsView:m,signedInUserEmail:u.userEmail??"",tenantEmailDomain:t.tenantEmailDomain??o??"",tenantId:t.tenantId,saveChargeBeeState:m.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:m.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:m.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:m.externalConnections?.saveOAuthConnectionError?.message,deleteConnectionState:m.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:m.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress"})]}):a.jsx(ae,{fetchState:n})},ft=M.div`
34
34
  display: flex;
35
35
  height: 100%;
36
36
  width: 100%;
@@ -46,7 +46,7 @@ import{j as a}from"./liveblocks-DRCozBQX.js";import{a as p}from"./sentry-B4qAfut
46
46
  flex-direction: column;
47
47
  align-items: center;
48
48
  background-color: ${e=>e.theme.colors.grey4};
49
- `,bt=()=>{const e=k(),{tenantEmailDomain:s}=F(),[o,c]=p.useState(!1),i=h(l=>j(l)).companyId??x.getSignedInUserTenant(s)?.companyId,n=x.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=h(l=>rn(l,n.userId)),r=h(l=>ln(l,i,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:u}=r,d=l=>{c(l)},g=p.useCallback(l=>{e(ne("user_reimbursement_account",l))},[]),f=p.useCallback(l=>{e(ee(l,i,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);p.useEffect(()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(dn(n.userId))},[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(ht,{children:[a.jsx(P,{isAppContentDrawerOpen:o,handleDrawerToggle:d}),a.jsx(Ln,{plaidConnectionDetails:u,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:g,onEstablishConnectionClick:f,onClickMenuIcon:()=>{d(!0)}})]})},St=M.div`
49
+ `,bt=()=>{const e=P(),{tenantEmailDomain:s}=F(),[o,c]=p.useState(!1),i=h(l=>j(l)).companyId??x.getSignedInUserTenant(s)?.companyId,n=x.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=h(l=>rn(l,n.userId)),r=h(l=>ln(l,i,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:u}=r,d=l=>{c(l)},g=p.useCallback(l=>{e(ne("user_reimbursement_account",l))},[]),f=p.useCallback(l=>{e(ee(l,i,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);p.useEffect(()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(dn(n.userId))},[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(ht,{children:[a.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:d}),a.jsx(On,{plaidConnectionDetails:u,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:g,onEstablishConnectionClick:f,onClickMenuIcon:()=>{d(!0)}})]})},St=M.div`
50
50
  display: flex;
51
51
  height: 100%;
52
52
  width: 100%;
@@ -54,4 +54,4 @@ import{j as a}from"./liveblocks-DRCozBQX.js";import{a as p}from"./sentry-B4qAfut
54
54
  flex-direction: column;
55
55
  align-items: center;
56
56
  background-color: ${e=>e.theme.colors.grey4};
57
- `,le=({appContent:e})=>{const s=k(),o=_(),c=B(),[i,n]=p.useState(!1),t=h(b=>j(b)),{tenantEmailDomain:r}=t,u=t.companyId??x.getSignedInUserTenant(r)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=te(),{isFeatureEnabled:g}=d(U.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=d(U.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=d(U.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=d(U.isTreasuryEnabled),E=h(b=>ue(b)),y=be(t),w=Se(m,t),S=!w&&E,I=$n(t,f,m),{areTenantIdsInSync:N}=Jn();p.useEffect(()=>{N&&s(un(u,S))},[u,s,S,N]);const A=h(b=>pn(b,S)),z=A.fetchState==="Not-Started"||A.fetchState==="In-Progress"||u==null,G=gn(t),K=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,O=b=>{n(b)};return a.jsxs(St,{children:[a.jsx(P,{isAppContentDrawerOpen:i,handleDrawerToggle:O}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(zn,{myProfileView:A,isAccountingClassesEnabled:E,isReimbursementDisabled:K===!1,isZeniAccountsDisabled:g===!1,isChargeCardDisabled:I===!1,isTreasuryDisabled:l===!1,isLiteRoleDisabled:G===!1,onClickMenuIcon:()=>{O(!0)},isLoading:z,isBankingOnlyTenant:w,isCardsOnlyTenant:y,onAddressClick:b=>{const D=function(H,q){let v=`/${H}/settings/my_profile`;return v=v.concat(`/new/${q}`),v}(r,b),Z=Gn(c.state?.pathnameStackToGoBack,c.pathname);o(D,{state:{pathnameStackToGoBack:Z}})},onGetOtp:b=>{const D={...A.myProfileLocalData,phone:b};s(oe({localData:D})),s(bn(b,"MyProfile"))},onResendOtp:b=>{s(hn(b,"MyProfile"))},onCancelClick:()=>{s(fn())},onSaveClick:()=>{s(ie("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},onVerifyOtp:(b,D)=>{s(mn(b,D,"MyProfile"))},onVerifyOtpSuccess:b=>{b!=null&&x.saveZeniOtpToken(b),s(ie("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},updateMyProfileLocalData:b=>{s(oe({localData:b}))}})]})};function yt(){const e=k(),s=h(l=>j(l)).companyId,o=h(l=>Sn(l)),c=h(l=>ye(l)),i=x.getSignedInUser(),[n,t]=p.useState(!1),r=p.useCallback(l=>{t(l)},[]),u=p.useCallback(l=>{e(yn(l))},[]),d=p.useCallback(()=>{i?.userEmail!=null&&e(In({loggedInUserEmail:i.userEmail}))},[i?.userEmail]),g=p.useCallback(()=>{e(Cn())},[]);if(i==null)throw Error("Can't access Notification Settings page without signing in...");const f=p.useCallback(()=>{const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ce(l,s))},[s,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),m=p.useCallback(()=>{e(xn())},[]);return p.useEffect(()=>{if(c.fetchState==="Completed"&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"){const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ce(l,s))}},[o.fetchState,s,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(P,{isAppContentDrawerOpen:n,handleDrawerToggle:r}),a.jsx(Kn,{notificationSettingsView:o,onFormDataChange:u,onCancel:d,onSave:g,onClickMenuIcon:()=>{r(!0)},signedInUser:i,onRefresh:f,resetUpdateStatus:m})]})}function ea(e){const[s,o]=p.useState(!1),c=h(l=>ye(l)),i=h(l=>j(l)),n=V(),t=x.getSignedInUser(),r=k(),{useFeatureGate:u}=te(),{isFeatureEnabled:d}=u(U.isDebitCardFeatureEnabled),g=t?.userEmail==null||c.fetchState!=="Completed"||En(c.notificationSettings,t.userEmail,d,i);p.useEffect(()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&s===!1&&(o(!0),r(An()))},[c.fetchState,s]);const f=Se(d,i),m=be(i);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||g!==!0?wn(i)?a.jsxs(X,{children:[jn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"accounting/*",element:a.jsx(at,{})}),vn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"approval_rules/*",element:a.jsx(It,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),kn(i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"my_bank_connections",element:a.jsx(bt,{})}),Pn(i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"bank_connections",element:a.jsx(lt,{})}),Dn(i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"business_verification",element:a.jsx(Qn,{productType:f?"zeni_accounts":m?"charge_cards":Xn(i,n?.loggedInUserRoleMap)})}),Un(n?.loggedInUserRole??[],i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"company_details",element:a.jsx(Yn,{})}),Mn(n?.loggedInUserRole??[],i)&&a.jsx(C,{path:"billing",element:a.jsx(pt,{})}),_n(n?.loggedInUserRole??[],d,i)&&a.jsx(C,{path:"integrations",element:a.jsx(mt,{})}),a.jsx(C,{path:"my_profile/new/:addressType",element:a.jsx(le,{appContent:a.jsx(qn,{isSubPage:!1})})}),a.jsx(C,{path:"my_profile",element:a.jsx(le,{})}),g&&a.jsx(C,{path:"notifications",element:a.jsx(yt,{})}),a.jsx(C,{path:"*",element:a.jsx(T,{})})]}):a.jsx(X,{children:a.jsx(C,{path:"*",element:a.jsx(T,{})})}):null}function It(e){return a.jsxs(X,{children:[a.jsx(C,{path:"/",element:a.jsx(it,{})}),a.jsx(C,{path:"bills/approval-rules/*",element:a.jsx(Wn,{})}),a.jsx(C,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(et,{}):a.jsx(T,{})}),a.jsx(C,{path:"*",element:a.jsx(T,{})})]})}export{ea as default};
57
+ `,le=({appContent:e})=>{const s=P(),o=_(),c=T(),[i,n]=p.useState(!1),t=h(b=>j(b)),{tenantEmailDomain:r}=t,u=t.companyId??x.getSignedInUserTenant(r)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=te(),{isFeatureEnabled:g}=d(U.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=d(U.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=d(U.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=d(U.isTreasuryEnabled),E=h(b=>ue(b)),I=be(t),w=Se(m,t),S=!w&&E,y=$n(t,f,m),{areTenantIdsInSync:V}=Jn();p.useEffect(()=>{V&&s(un(u,S))},[u,s,S,V]);const A=h(b=>pn(b,S)),K=A.fetchState==="Not-Started"||A.fetchState==="In-Progress"||u==null,G=gn(t),H=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,L=b=>{n(b)};return a.jsxs(St,{children:[a.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:L}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(Kn,{myProfileView:A,isAccountingClassesEnabled:E,isReimbursementDisabled:H===!1,isZeniAccountsDisabled:g===!1,isChargeCardDisabled:y===!1,isTreasuryDisabled:l===!1,isLiteRoleDisabled:G===!1,onClickMenuIcon:()=>{L(!0)},isLoading:K,isBankingOnlyTenant:w,isCardsOnlyTenant:I,onAddressClick:b=>{const D=function(Z,Q){let k=`/${Z}/settings/my_profile`;return k=k.concat(`/new/${Q}`),k}(r,b),z=Gn(c.state?.pathnameStackToGoBack,c.pathname);o(D,{state:{pathnameStackToGoBack:z}})},onGetOtp:b=>{const D={...A.myProfileLocalData,phone:b};s(oe({localData:D})),s(bn(b,"MyProfile"))},onResendOtp:b=>{s(hn(b,"MyProfile"))},onCancelClick:()=>{s(fn())},onSaveClick:()=>{s(ie("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},onVerifyOtp:(b,D)=>{s(mn(b,D,"MyProfile"))},onVerifyOtpSuccess:b=>{b!=null&&x.saveZeniOtpToken(b),s(ie("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},updateMyProfileLocalData:b=>{s(oe({localData:b}))}})]})};function It(){const e=P(),s=h(l=>j(l)).companyId,o=h(l=>Sn(l)),c=h(l=>Ie(l)),i=x.getSignedInUser(),[n,t]=p.useState(!1),r=p.useCallback(l=>{t(l)},[]),u=p.useCallback(l=>{e(In(l))},[]),d=p.useCallback(()=>{i?.userEmail!=null&&e(yn({loggedInUserEmail:i.userEmail}))},[i?.userEmail]),g=p.useCallback(()=>{e(Cn())},[]);if(i==null)throw Error("Can't access Notification Settings page without signing in...");const f=p.useCallback(()=>{const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ce(l,s))},[s,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),m=p.useCallback(()=>{e(xn())},[]);return p.useEffect(()=>{if(c.fetchState==="Completed"&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"){const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ce(l,s))}},[o.fetchState,s,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:r}),a.jsx(Hn,{notificationSettingsView:o,onFormDataChange:u,onCancel:d,onSave:g,onClickMenuIcon:()=>{r(!0)},signedInUser:i,onRefresh:f,resetUpdateStatus:m})]})}function ea(e){const[s,o]=p.useState(!1),c=h(l=>Ie(l)),i=h(l=>j(l)),n=N(),t=x.getSignedInUser(),r=P(),{useFeatureGate:u}=te(),{isFeatureEnabled:d}=u(U.isDebitCardFeatureEnabled),g=t?.userEmail==null||c.fetchState!=="Completed"||En(c.notificationSettings,t.userEmail,d,i);p.useEffect(()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&s===!1&&(o(!0),r(An()))},[c.fetchState,s]);const f=Se(d,i),m=be(i);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||g!==!0?wn(i)?a.jsxs(W,{children:[jn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"accounting/*",element:a.jsx(at,{})}),kn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"approval_rules/*",element:a.jsx(yt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Pn(i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"my_bank_connections",element:a.jsx(bt,{})}),vn(i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"bank_connections",element:a.jsx(lt,{})}),Dn(i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"business_verification",element:a.jsx(qn,{productType:f?"zeni_accounts":m?"charge_cards":Wn(i,n?.loggedInUserRoleMap)})}),Un(n?.loggedInUserRole??[],i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"company_details",element:a.jsx(Xn,{})}),Mn(n?.loggedInUserRole??[],i)&&a.jsx(C,{path:"billing",element:a.jsx(pt,{})}),_n(n?.loggedInUserRole??[],d,i)&&a.jsx(C,{path:"integrations",element:a.jsx(mt,{})}),a.jsx(C,{path:"my_profile/new/:addressType",element:a.jsx(le,{appContent:a.jsx(Qn,{isSubPage:!1})})}),a.jsx(C,{path:"my_profile",element:a.jsx(le,{})}),g&&a.jsx(C,{path:"notifications",element:a.jsx(It,{})}),a.jsx(C,{path:"*",element:a.jsx(R,{})})]}):a.jsx(W,{children:a.jsx(C,{path:"*",element:a.jsx(R,{})})}):null}function yt(e){return a.jsxs(W,{children:[a.jsx(C,{path:"/",element:a.jsx(it,{})}),a.jsx(C,{path:"bills/approval-rules/*",element:a.jsx(Yn,{})}),a.jsx(C,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(et,{}):a.jsx(R,{})}),a.jsx(C,{path:"*",element:a.jsx(R,{})})]})}export{ea as default};