@zeniai/web-app-ui 5.3.52-qa → 5.3.53-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 (150) hide show
  1. package/dist/assets/{AccountMappingScreen-BFD6zGSo.js → AccountMappingScreen-h6RQnGUG.js} +2 -2
  2. package/dist/assets/{ActualMatchingMatchDetailScreen--CUkwe-7.js → ActualMatchingMatchDetailScreen-B7Vw_l4c.js} +1 -1
  3. package/dist/assets/AddressRoutes-w8tyo6J5.js +1 -0
  4. package/dist/assets/AddressScreen-DcUrSOsf.js +9 -0
  5. package/dist/assets/AiCfoScreen-CpQfUa4g.js +22 -0
  6. package/dist/assets/{AppDrawer-BioYAA8q.js → AppDrawer-DrLIFDtl.js} +1 -1
  7. package/dist/assets/{BillPayApprovalRoutes-CbgUcPPn.js → BillPayApprovalRoutes-Cjvq2rbF.js} +1 -1
  8. package/dist/assets/BillPayRoutes-CPJm_O1t.js +119 -0
  9. package/dist/assets/{BusinessVerificationPageScreen-_lNpLbtb.js → BusinessVerificationPageScreen-DJA0DrrC.js} +2 -2
  10. package/dist/assets/CardsAiCfoScreen-DDb2ZuZ_.js +14 -0
  11. package/dist/assets/{ChargeCardRoutes-Cm8gRyWo.js → ChargeCardRoutes-CbSM_5m3.js} +8 -8
  12. package/dist/assets/CompanyPassportScreen-j_dRH50h.js +1 -0
  13. package/dist/assets/{ConnectionAuthScreen-CvbL5gXS.js → ConnectionAuthScreen-DsPkAmru.js} +2 -2
  14. package/dist/assets/CustomerOnboardingAuthScreen-BNBLWcXr.js +1 -0
  15. package/dist/assets/{CustomerOnboardingRoutes-CFt1axWu.js → CustomerOnboardingRoutes-ZSH-nufQ.js} +3 -3
  16. package/dist/assets/{DashboardRoutes-B_RKHDQw.js → DashboardRoutes-BtOqv-MN.js} +3 -3
  17. package/dist/assets/{DefaultTenantHome-CzERteR_.js → DefaultTenantHome-DToEgYOq.js} +1 -1
  18. package/dist/assets/{DomesticWireDetailScreen-DdGRU08t.js → DomesticWireDetailScreen-CVW4GyMY.js} +3 -3
  19. package/dist/assets/{DrawerScreen-BkWdrsyD.js → DrawerScreen-_ojy_hFg.js} +1 -1
  20. package/dist/assets/EntityDetailRoutes-CK-mH_-b.js +1 -0
  21. package/dist/assets/{ExpenseAutomationRoutes-90qVj0mK.js → ExpenseAutomationRoutes-b3yLxHwD.js} +7 -7
  22. package/dist/assets/FeaturePreviewScreen-BoONdT_D.js +1 -0
  23. package/dist/assets/HubSpotOAuthCallbackScreen-DndTTZ9T.js +1 -0
  24. package/dist/assets/{InboxNotificationsProvider-Bd8tLMl8.js → InboxNotificationsProvider-D6QvVVj8.js} +1 -1
  25. package/dist/assets/{InvoicingRoutes-CexYyC5q.js → InvoicingRoutes-DkUuCZTT.js} +2 -2
  26. package/dist/assets/MagicLinkRoutes-D3FD1AQ_.js +72 -0
  27. package/dist/assets/MagicLinkSignInScreen-xu1o-sOL.js +12 -0
  28. package/dist/assets/MobileAppDrawer-BnS3AEOn.js +1 -0
  29. package/dist/assets/NotFoundScreen-zRiKZg68.js +1 -0
  30. package/dist/assets/{NotificationRoutes-bEJ4pL_q.js → NotificationRoutes-BNeDbLRn.js} +1 -1
  31. package/dist/assets/{OAuthConsentScreen-CH9GHZTu.js → OAuthConsentScreen-CFGSPUJy.js} +1 -1
  32. package/dist/assets/PandLWithForecastRoutes-LfSp6i3w.js +1 -0
  33. package/dist/assets/{PaymentLinkScreen-Dgt4_0Sf.js → PaymentLinkScreen-DeBS8t6S.js} +4 -4
  34. package/dist/assets/{PeopleRoutes-B9g6bB_r.js → PeopleRoutes-Dq1v6Pp-.js} +5 -5
  35. package/dist/assets/PerformanceRoutes-DIdRvtFD.js +1 -0
  36. package/dist/assets/{Preview-Bt5Z89U4.js → Preview-CDuSXomS.js} +1 -1
  37. package/dist/assets/QBOConnectionScreen-BnB1aZoV.js +100 -0
  38. package/dist/assets/ReimbursementApprovalRoutes-C1kq5riD.js +1 -0
  39. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-uAvwHmVJ.js → ReimbursementApprovalRuleDetailScreen-Cs7pkBs7.js} +1 -1
  40. package/dist/assets/ReimbursementRoutes-DnFb48rt.js +68 -0
  41. package/dist/assets/{ReportsRoutes-ByrzWoSX.js → ReportsRoutes-CbRMfUn0.js} +1 -1
  42. package/dist/assets/RewardsRoutes-BS5WcL7W.js +1 -0
  43. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-CcW917MW.js → ScheduleDetailsPrepaidExpensesScreen-U50ydaXU.js} +5 -5
  44. package/dist/assets/ScreenRoutes-0QveS_Gw.js +2 -0
  45. package/dist/assets/{SettingsRoutes-DCgOWsFJ.js → SettingsRoutes-DsqPy7ab.js} +6 -6
  46. package/dist/assets/{SetupPagesScreen-CgVfrQ5w.js → SetupPagesScreen-DyVC5Tjr.js} +5 -5
  47. package/dist/assets/SignInScreen-0Mg5cQhJ.js +1 -0
  48. package/dist/assets/SignOutScreen-DXrcHbwR.js +9 -0
  49. package/dist/assets/TaskListScreen-D8nGyAze.js +9 -0
  50. package/dist/assets/TaskRoutes-CvGAs8TT.js +9 -0
  51. package/dist/assets/TransactionDetailRoutes-Bn3kvwnI.js +1 -0
  52. package/dist/assets/{TransactionDetailScreen-DHysjIND.js → TransactionDetailScreen-CpeLNLRs.js} +2 -2
  53. package/dist/assets/TransactionListRoutes-GwUAS2rg.js +1 -0
  54. package/dist/assets/{TreasuryRoutes-0_eMw0Wx.js → TreasuryRoutes-DGbJojow.js} +3 -3
  55. package/dist/assets/{VendorsRoutes-B3eT8rLn.js → VendorsRoutes-D_uL1WqL.js} +12 -12
  56. package/dist/assets/WiseConfirmationScreen-BGmtQRG5.js +12 -0
  57. package/dist/assets/{ZeniAccountRoutes-BNdYEOcI.js → ZeniAccountRoutes-DnIPkvTG.js} +11 -11
  58. package/dist/assets/ZeniAccountStatementScreen-D1FrDKPz.js +9 -0
  59. package/dist/assets/{accountMappingHelper-DQktkWkn.js → accountMappingHelper-DNRaFM1C.js} +1 -1
  60. package/dist/assets/{analytics-GZ8dIY_c.js → analytics-Y9Rn1Gu7.js} +1 -1
  61. package/dist/assets/analyticsHelper-b_0JgbzW.js +1 -0
  62. package/dist/assets/{core-DOBELRta.js → core-Dh_SHcAD.js} +1 -1
  63. package/dist/assets/{decodeURIComponentSafe-DjVlhgki.js → decodeURIComponentSafe-B9wRnGXi.js} +1 -1
  64. package/dist/assets/{dnd-0MaFz9wL.js → dnd-CwwWYFuT.js} +1 -1
  65. package/dist/assets/{empty-DsXUnWhI.js → empty-BT_7GI6y.js} +1 -1
  66. package/dist/assets/{empty-C3pt8GU3.js → empty-XI8MiQF0.js} +1 -1
  67. package/dist/assets/{emptyVideoElement-DObxt-h2.js → emptyVideoElement-JNmKZqZz.js} +1 -1
  68. package/dist/assets/epic-COW9EFJg.js +2 -0
  69. package/dist/assets/expenseAutomationHelper-jy143DnO.js +1 -0
  70. package/dist/assets/{getLocaleForTenant-U4ff53sp.js → getLocaleForTenant-CCfef8lM.js} +1 -1
  71. package/dist/assets/{index-px1SxWJw.js → index-8Q8Cb_pA.js} +1 -1
  72. package/dist/assets/index-B23hmQHl.js +1 -0
  73. package/dist/assets/{index-D0or4oV9.js → index-BeqOty_5.js} +12169 -12162
  74. package/dist/assets/{index-BmFszw0H.js → index-C4rZANm7.js} +1 -1
  75. package/dist/assets/{index-rIJ81ix1.js → index-D3h8toFn.js} +1 -1
  76. package/dist/assets/{index-1mAhqt2L.js → index-DOYaY83A.js} +1 -1
  77. package/dist/assets/{index-JlXkO7-y.js → index-DTprL6g9.js} +1 -1
  78. package/dist/assets/{index-F4l7OCjI.js → index-D_bKIveY.js} +2 -2
  79. package/dist/assets/{lexical-CAgOy6Q-.js → lexical-CaftfZ9D.js} +1 -1
  80. package/dist/assets/{liveblocks-BPL36a6x.js → liveblocks-DR8KfETq.js} +1 -1
  81. package/dist/assets/{lottie-38LSfraF.js → lottie-ODKvpFjz.js} +1 -1
  82. package/dist/assets/{mui-wO6EIETx.js → mui-BYn_Ugho.js} +1 -1
  83. package/dist/assets/{pathToGoBack-BTiQNxwp.js → pathToGoBack-BiqpVJeS.js} +1 -1
  84. package/dist/assets/{pdf-B2N0erO1.js → pdf-DnQo5-Qw.js} +3 -3
  85. package/dist/assets/{pdf-lib-Ct6vdrHd.js → pdf-lib-DdZd3IiB.js} +1 -1
  86. package/dist/assets/{plaid-C-eBmVPr.js → plaid-Dw8l1kdg.js} +1 -1
  87. package/dist/assets/{pusher-Qt-2jBy4.js → pusher-CewboUYG.js} +1 -1
  88. package/dist/assets/{react-D0sfM7Iy.js → react-8By583h-.js} +1 -1
  89. package/dist/assets/{react-DSWUEYTa.js → react-B8IvMjeE.js} +1 -1
  90. package/dist/assets/{react-BogDsHCA.js → react-BgmP_PBP.js} +1 -1
  91. package/dist/assets/{react-ByoUrZyD.js → react-CWd2ZkNi.js} +1 -1
  92. package/dist/assets/{react-9dynYr-j.js → react-gSPYEWZo.js} +1 -1
  93. package/dist/assets/{react-ofgvrscL.js → react-ygIo2ccY.js} +1 -1
  94. package/dist/assets/{recharts-Sp9X2zHo.js → recharts-BTL88W4R.js} +1 -1
  95. package/dist/assets/{routePaths-DTZH71MW.js → routePaths-CN71IXC6.js} +1 -1
  96. package/dist/assets/{sentry-_x3Yh1Jc.js → sentry-FwaDhTzy.js} +1 -1
  97. package/dist/assets/{stripSplatSuffix-bz-VGo3l.js → stripSplatSuffix-CvpfThkG.js} +1 -1
  98. package/dist/assets/{url-DBFa8kl5.js → url-DHu7Ejzz.js} +1 -1
  99. package/dist/assets/{url-DW2CK7rX.js → url-DybJ-sxa.js} +1 -1
  100. package/dist/assets/useActualMatchingMatchDetail-CgMvOK9S.js +1 -0
  101. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BHQEdJfL.js → useAiCfoDashboardSuggestedQuestionsChips-B5JNAQpD.js} +1 -1
  102. package/dist/assets/useAskAiCfoHostNavButtonProps-BnkkGFrU.js +1 -0
  103. package/dist/assets/{useChargeCardPusherEvents-CLlJNBdI.js → useChargeCardPusherEvents-D9DQtbnp.js} +1 -1
  104. package/dist/assets/{useDeviceId-EJu2KjP1.js → useDeviceId-CUJxM_KE.js} +1 -1
  105. package/dist/assets/useEmailConnectResultRefresh-DWvxRsrW.js +1 -0
  106. package/dist/assets/{useInitialThreadRequest-DYGeNL0J.js → useInitialThreadRequest-AIPuwXqX.js} +1 -1
  107. package/dist/assets/{useTaskManagerAccess-CxAfFVI5.js → useTaskManagerAccess-DJBrAqGh.js} +1 -1
  108. package/dist/assets/useTaskManagerPusherEvents-CWsImhYv.js +1 -0
  109. package/dist/assets/utils-DEAaFgLU.js +36 -0
  110. package/dist/assets/{withTransactionSidePanel-CQ96RPah.js → withTransactionSidePanel-BA2-aFQT.js} +6 -6
  111. package/dist/assets/{zeni-epic-state-DXFYDM66.js → zeni-epic-state-DJh0-ZeR.js} +5 -5
  112. package/dist/index.html +1 -1
  113. package/package.json +3 -3
  114. package/dist/assets/AddressRoutes-IFU8jeyM.js +0 -1
  115. package/dist/assets/AddressScreen-C5gOC9K1.js +0 -9
  116. package/dist/assets/AiCfoScreen-Dk4NZsn4.js +0 -22
  117. package/dist/assets/BillPayRoutes-BLaPoSH3.js +0 -119
  118. package/dist/assets/CardsAiCfoScreen-_v8KOvIs.js +0 -14
  119. package/dist/assets/CompanyPassportScreen-LNhKVlPD.js +0 -1
  120. package/dist/assets/CustomerOnboardingAuthScreen-1_BAWSpj.js +0 -1
  121. package/dist/assets/EntityDetailRoutes-BJQ1CgrE.js +0 -1
  122. package/dist/assets/FeaturePreviewScreen-DmuM1Efe.js +0 -1
  123. package/dist/assets/HubSpotOAuthCallbackScreen-D5Csp1UO.js +0 -1
  124. package/dist/assets/MagicLinkRoutes-JEaRIrxB.js +0 -72
  125. package/dist/assets/MagicLinkSignInScreen-DwZW3Erw.js +0 -12
  126. package/dist/assets/MobileAppDrawer-C-ti4sM2.js +0 -1
  127. package/dist/assets/NotFoundScreen-3qucmnjW.js +0 -1
  128. package/dist/assets/PandLWithForecastRoutes-BuxQksyO.js +0 -1
  129. package/dist/assets/PerformanceRoutes-hC8UVG3D.js +0 -1
  130. package/dist/assets/QBOConnectionScreen-BT2gd9dq.js +0 -100
  131. package/dist/assets/ReimbursementApprovalRoutes-CoFA16rX.js +0 -1
  132. package/dist/assets/ReimbursementRoutes-BnvmE75X.js +0 -68
  133. package/dist/assets/RewardsRoutes-BrjKJijg.js +0 -1
  134. package/dist/assets/ScreenRoutes-BgjTH3MD.js +0 -2
  135. package/dist/assets/SignInScreen-QbBLEpYE.js +0 -1
  136. package/dist/assets/SignOutScreen-Cg98jLSX.js +0 -9
  137. package/dist/assets/TaskListScreen-BKRaew41.js +0 -9
  138. package/dist/assets/TaskRoutes-tj9-zwIR.js +0 -9
  139. package/dist/assets/TransactionDetailRoutes-BSNaBZbG.js +0 -1
  140. package/dist/assets/TransactionListRoutes-BcKO42ff.js +0 -1
  141. package/dist/assets/WiseConfirmationScreen-DJ2wN1Fx.js +0 -12
  142. package/dist/assets/ZeniAccountStatementScreen-Cua_2c_y.js +0 -9
  143. package/dist/assets/analyticsHelper-DnGDW6mo.js +0 -1
  144. package/dist/assets/epic-BqUfEKD1.js +0 -2
  145. package/dist/assets/expenseAutomationHelper-CRKfrxDD.js +0 -1
  146. package/dist/assets/index-C_zqEcVM.js +0 -1
  147. package/dist/assets/useActualMatchingMatchDetail-CtxH6NWw.js +0 -1
  148. package/dist/assets/useAskAiCfoHostNavButtonProps-eAE85_k_.js +0 -1
  149. package/dist/assets/useEmailConnectResultRefresh-DfrDVqu0.js +0 -1
  150. package/dist/assets/utils-BU0XThgM.js +0 -36
@@ -1,4 +1,4 @@
1
- import{j as L}from"./liveblocks-BPL36a6x.js";import{a as o}from"./sentry-_x3Yh1Jc.js";import{h as K,g as W,u as X,j as m,s as q,l as Y}from"./core-DOBELRta.js";import{aj as Z,c as ee,A as $,z as te,o as G,ak as ne,k as ae,V as ce}from"./index-D0or4oV9.js";import{bn as se,fF as oe,gV as ie,oB as Q,Uz as re,i8 as J,gh as le,os as ue,UA as de,UB as pe,u6 as ge,l$ as me,oq as Ae,om as be,ox as fe,ia as Ie,UC as ye,UD as Se}from"./zeni-epic-state-DXFYDM66.js";import{n as he}from"./mui-wO6EIETx.js";import{M as Ee}from"./MobileAppDrawer-C-ti4sM2.js";import{q as R}from"./QBOConnectionScreen-BT2gd9dq.js";import{g as h,a as E,m as ze}from"./accountMappingHelper-DQktkWkn.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="8afc5f6d-8031-4487-ac2e-ca1d6ada7584",a._sentryDebugIdIdentifier="sentry-dbid-8afc5f6d-8031-4487-ac2e-ca1d6ada7584")}catch{}})();const l="zeni_pending_projects_enable",u={pending:"pending",ready:"ready"},ve=he.div`
1
+ import{j as D}from"./liveblocks-DR8KfETq.js";import{a as o}from"./sentry-FwaDhTzy.js";import{h as K,g as W,u as X,j as m,s as q,l as Y}from"./core-Dh_SHcAD.js";import{aj as Z,c as ee,A as G,z as te,n as H,ak as ne,j as ae,S as ce}from"./index-BeqOty_5.js";import{bn as se,fF as oe,gV as ie,oB as $,UE as re,i8 as J,gh as le,os as ue,UF as de,UG as pe,u6 as ge,l$ as me,oq as Ae,om as be,ox as fe,ia as Ie,UH as ye,UI as Se}from"./zeni-epic-state-DJh0-ZeR.js";import{n as he}from"./mui-BYn_Ugho.js";import{M as Ee}from"./MobileAppDrawer-BnS3AEOn.js";import{q as R}from"./QBOConnectionScreen-BnB1aZoV.js";import{g as h,a as E,m as ze}from"./accountMappingHelper-DNRaFM1C.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="0f10ae1d-f0a7-42ce-94c3-3c9fe47c0fed",a._sentryDebugIdIdentifier="sentry-dbid-0f10ae1d-f0a7-42ce-94c3-3c9fe47c0fed")}catch{}})();const l="zeni_pending_projects_enable",u={pending:"pending",ready:"ready"},ve=he.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,4 +6,4 @@ import{j as L}from"./liveblocks-BPL36a6x.js";import{a as o}from"./sentry-_x3Yh1J
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${a=>a.theme.colors.grey4};
9
- `,we=Y((function(a,e){return{accountMappingView:e.accountMappingView,isFiling1099FeatureEnabled:e.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:e.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:me(a),isAccountingClassesUpdateInProgress:a.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:ge(a),isAccountingProjectsUpdateInProgress:(()=>{const i=sessionStorage.getItem(l),c=i===u.pending||i===u.ready;return a.companyViewState.passportView?.accountingProjectsUpdateStatus?.fetchState==="In-Progress"||c})(),isCapitalizationFeatureEnabled:e.isCapitalizationFeatureEnabled,capitalizableAccounts:e.capitalizableAccounts,accountNamesById:e.accountNamesById,capitalizableAccountOverrides:e.capitalizableAccountOverrides,isCapitalizationThresholdSaving:e.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:e.onSaveCapitalizationAccountThreshold}}),(function(a,e){const{navigate:i,location:c,isFiling1099FeatureEnabled:A}=e;return{onAccountMappingChange:r=>{const{uncategorizedAccountSection:d,billsAccountSection:z,reimbursementsAccountSection:v,vendorsAccountSection:w,filing1099Section:x}=r,{incomeAccount:C,expenseAccount:F}=d,{billPayAccount:s}=z,{reimbursementsAccount:V}=v,{prepaidExpensesAccount:p,fixedAssetsAccount:T,accruedExpensesAccount:O}=w,{bankAccount:k,expenseCategory1099:M}=x,b=h(e.accountMappingView.incomeAccountList,C.selectedOption),j=h(e.accountMappingView.expenseAccountList,F.selectedOption),f=h(e.accountMappingView.billPayAccountList,s.selectedOption),_=h(e.accountMappingView.reimbursementsAccountList,V.selectedOption),P=E(e.accountMappingView.prepaidExpensesAccountList,p.selectedOptions),U=E(e.accountMappingView.fixedAssetsAccountList,T.selectedOptions),I=E(e.accountMappingView.accruedExpensesAccountList,O.selectedOptions),D=E(e.accountMappingView.bankAccounts1099FilingAccountList,k.selectedOptions),y=ze(e.accountMappingView.expenseAccounts1099FilingAccountList,M),t={selectedIncomeAccountId:b?.accountId,selectedExpenseAccountId:j?.accountId,selectedBillPayAccountId:f?.accountId,selectedReimbursementsAccountId:_?.accountId,selectedPrepaidExpensesAccountIds:P.map((n=>n.accountId)),selectedFixedAssetsAccountIds:U.map((n=>n.accountId)),selectedAccruedExpensesAccountIds:I.map((n=>n.accountId)),selectedBankAccounts1099FilingAccountIds:D.map((n=>n.accountId)),selectedExpenseAccounts1099FilingAccountIds:y};a(Se({data:t}))},onBackClick:()=>{G(c)===!1?(i("../../dashboard"),a(ye())):a(J())},onSaveClick:()=>{a(Ie()),A&&ae.track(ce.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:r=>{a(fe(e.currentTenant.companyId,r))},onAccountingProjectsToggle:r=>{const d=sessionStorage.getItem(l);d===u.pending||d===u.ready||a(r?Ae(e.currentTenant.companyId):be(e.currentTenant.companyId))}}}))(ne),_e=()=>{const a=Z(),e=K(),i=W(),c=X(),{useFeatureGate:A,useDynamicConfig:r}=ee(),{isFeatureEnabled:d}=A($.isFiling1099FeatureEnabled),{isFeatureEnabled:z}=A($.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:v,isDynamicConfigLoading:w}=r("transaction_categorization_config"),x=!w&&v?.capitalization_enabled===!0,C=te.getSignedInUser(),F=se(C),s=m((t=>oe(t))),{capitalizableAccounts:V,capitalizableAccountOverrides:p,isCapitalizationThresholdSaving:T,currencySymbol:O}=m((t=>{const n=t.tenantState.currentTenantId,g=n!=null?t.tenantState.tenantsById[n]:void 0,S=ie(t.companyState,s.companyId);return{capitalizableAccounts:g?.capitalizableAccounts??null,capitalizableAccountOverrides:g?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:t.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:S?.company.companyLocaleInfo?.currencySymbol??"$"}}),q),k=o.useCallback(((t,n)=>{c(Q(s.companyId,t,n))}),[c,s.companyId]),M=o.useCallback((t=>{const n={...p??{}},g=Object.entries(t);for(const[B,N]of g)N===null?delete n[B]:n[B]=N;const[S,H]=g[0]??[];S!=null&&c(Q(s.companyId,S,H,void 0,Object.keys(n).length>0?n:null))}),[c,s.companyId,p]),b=m((t=>re(t.accountState)),q),j=o.useMemo((()=>{const t={};for(const n of b)n.accountId!=null&&n.accountName!=null&&(t[n.accountId]=n.accountName);return t}),[b]),[f,_]=o.useState(!1),[P,U]=o.useState(!1);o.useEffect((()=>{f===!1&&(c(J()),_(!0))}),[f]);const I=m((t=>t.companyViewState.passportView?.needsQboProjectsReconnect===!0));o.useEffect((()=>{sessionStorage.getItem(l)===u.pending&&(sessionStorage.removeItem(l),c(le({messageSection:"accounting_projects_qbo_reconnect_failed",messageText:"failed",type:"error"})))}),[c]),o.useEffect((()=>{sessionStorage.getItem(l)===u.ready&&s?.companyId!=null&&(sessionStorage.removeItem(l),c(ue(s.companyId)))}),[s?.companyId,c]),o.useEffect((()=>{I&&s?.tenantEmailDomain!=null&&(sessionStorage.setItem(l,u.pending),c(de()),R.init("/connection/auth",s.tenantEmailDomain),R.handleClick())}),[I,s?.tenantEmailDomain,c]);const D=m((t=>pe(t))),y=t=>{U(t)};return L.jsxs(ve,{children:[L.jsx(Ee,{isAppContentDrawerOpen:P,handleDrawerToggle:y}),L.jsx(we,{currentTenant:s,navigate:e,meetingUrl:a("account_mapping"),accountMappingView:D,isFiling1099FeatureEnabled:d&&F,isAccruedExpensesFeatureEnabled:z,isCapitalizationFeatureEnabled:x,capitalizableAccounts:V,accountNamesById:j,capitalizableAccountOverrides:p,currencySymbol:O,isCapitalizationThresholdSaving:T,onSaveCapitalizationAccountThreshold:k,onSaveCapitalizationAccountThresholds:M,location:i,isSettings:G(i),onClickMenuIcon:()=>y(!0)})]})};export{l as P,_e as U,u as a};
9
+ `,we=Y((function(a,e){return{accountMappingView:e.accountMappingView,isFiling1099FeatureEnabled:e.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:e.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:me(a),isAccountingClassesUpdateInProgress:a.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:ge(a),isAccountingProjectsUpdateInProgress:(()=>{const i=sessionStorage.getItem(l),c=i===u.pending||i===u.ready;return a.companyViewState.passportView?.accountingProjectsUpdateStatus?.fetchState==="In-Progress"||c})(),isCapitalizationFeatureEnabled:e.isCapitalizationFeatureEnabled,capitalizableAccounts:e.capitalizableAccounts,accountNamesById:e.accountNamesById,capitalizableAccountOverrides:e.capitalizableAccountOverrides,isCapitalizationThresholdSaving:e.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:e.onSaveCapitalizationAccountThreshold}}),(function(a,e){const{navigate:i,location:c,isFiling1099FeatureEnabled:A}=e;return{onAccountMappingChange:r=>{const{uncategorizedAccountSection:d,billsAccountSection:z,reimbursementsAccountSection:v,vendorsAccountSection:w,filing1099Section:x}=r,{incomeAccount:C,expenseAccount:F}=d,{billPayAccount:s}=z,{reimbursementsAccount:V}=v,{prepaidExpensesAccount:p,fixedAssetsAccount:T,accruedExpensesAccount:O}=w,{bankAccount:j,expenseCategory1099:M}=x,b=h(e.accountMappingView.incomeAccountList,C.selectedOption),k=h(e.accountMappingView.expenseAccountList,F.selectedOption),f=h(e.accountMappingView.billPayAccountList,s.selectedOption),_=h(e.accountMappingView.reimbursementsAccountList,V.selectedOption),P=E(e.accountMappingView.prepaidExpensesAccountList,p.selectedOptions),U=E(e.accountMappingView.fixedAssetsAccountList,T.selectedOptions),I=E(e.accountMappingView.accruedExpensesAccountList,O.selectedOptions),L=E(e.accountMappingView.bankAccounts1099FilingAccountList,j.selectedOptions),y=ze(e.accountMappingView.expenseAccounts1099FilingAccountList,M),t={selectedIncomeAccountId:b?.accountId,selectedExpenseAccountId:k?.accountId,selectedBillPayAccountId:f?.accountId,selectedReimbursementsAccountId:_?.accountId,selectedPrepaidExpensesAccountIds:P.map((n=>n.accountId)),selectedFixedAssetsAccountIds:U.map((n=>n.accountId)),selectedAccruedExpensesAccountIds:I.map((n=>n.accountId)),selectedBankAccounts1099FilingAccountIds:L.map((n=>n.accountId)),selectedExpenseAccounts1099FilingAccountIds:y};a(Se({data:t}))},onBackClick:()=>{H(c)===!1?(i("../../dashboard"),a(ye())):a(J())},onSaveClick:()=>{a(Ie()),A&&ae.track(ce.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:r=>{a(fe(e.currentTenant.companyId,r))},onAccountingProjectsToggle:r=>{const d=sessionStorage.getItem(l);d===u.pending||d===u.ready||a(r?Ae(e.currentTenant.companyId):be(e.currentTenant.companyId))}}}))(ne),_e=()=>{const a=Z(),e=K(),i=W(),c=X(),{useFeatureGate:A,useDynamicConfig:r}=ee(),{isFeatureEnabled:d}=A(G.isFiling1099FeatureEnabled),{isFeatureEnabled:z}=A(G.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:v,isDynamicConfigLoading:w}=r("transaction_categorization_config"),x=!w&&v?.capitalization_enabled===!0,C=te.getSignedInUser(),F=se(C),s=m((t=>oe(t))),{capitalizableAccounts:V,capitalizableAccountOverrides:p,isCapitalizationThresholdSaving:T,currencySymbol:O}=m((t=>{const n=t.tenantState.currentTenantId,g=n!=null?t.tenantState.tenantsById[n]:void 0,S=ie(t.companyState,s.companyId);return{capitalizableAccounts:g?.capitalizableAccounts??null,capitalizableAccountOverrides:g?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:t.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:S?.company.companyLocaleInfo?.currencySymbol??"$"}}),q),j=o.useCallback(((t,n)=>{c($(s.companyId,t,n))}),[c,s.companyId]),M=o.useCallback((t=>{const n={...p??{}},g=Object.entries(t);for(const[B,N]of g)N===null?delete n[B]:n[B]=N;const[S,Q]=g[0]??[];S!=null&&c($(s.companyId,S,Q,void 0,Object.keys(n).length>0?n:null))}),[c,s.companyId,p]),b=m((t=>re(t.accountState)),q),k=o.useMemo((()=>{const t={};for(const n of b)n.accountId!=null&&n.accountName!=null&&(t[n.accountId]=n.accountName);return t}),[b]),[f,_]=o.useState(!1),[P,U]=o.useState(!1);o.useEffect((()=>{f===!1&&(c(J()),_(!0))}),[f]);const I=m((t=>t.companyViewState.passportView?.needsQboProjectsReconnect===!0));o.useEffect((()=>{sessionStorage.getItem(l)===u.pending&&(sessionStorage.removeItem(l),c(le({messageSection:"accounting_projects_qbo_reconnect_failed",messageText:"failed",type:"error"})))}),[c]),o.useEffect((()=>{sessionStorage.getItem(l)===u.ready&&s?.companyId!=null&&(sessionStorage.removeItem(l),c(ue(s.companyId)))}),[s?.companyId,c]),o.useEffect((()=>{I&&s?.tenantEmailDomain!=null&&(sessionStorage.setItem(l,u.pending),c(de()),R.init("/connection/auth",s.tenantEmailDomain),R.handleClick())}),[I,s?.tenantEmailDomain,c]);const L=m((t=>pe(t))),y=t=>{U(t)};return D.jsxs(ve,{children:[D.jsx(Ee,{isAppContentDrawerOpen:P,handleDrawerToggle:y}),D.jsx(we,{currentTenant:s,navigate:e,meetingUrl:a("account_mapping"),accountMappingView:L,isFiling1099FeatureEnabled:d&&F,isAccruedExpensesFeatureEnabled:z,isCapitalizationFeatureEnabled:x,capitalizableAccounts:V,accountNamesById:k,capitalizableAccountOverrides:p,currencySymbol:O,isCapitalizationThresholdSaving:T,onSaveCapitalizationAccountThreshold:j,onSaveCapitalizationAccountThresholds:M,location:i,isSettings:H(i),onClickMenuIcon:()=>y(!0)})]})};export{l as P,_e as U,u as a};
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-BPL36a6x.js";import{a as k}from"./sentry-_x3Yh1Jc.js";import{a5 as I,dQ as g}from"./index-D0or4oV9.js";import"./mui-wO6EIETx.js";import{u as y}from"./useActualMatchingMatchDetail-CtxH6NWw.js";import b from"./NotFoundScreen-3qucmnjW.js";import{i as v,h as U,g as w}from"./core-DOBELRta.js";import"./zeni-epic-state-DXFYDM66.js";import"./recharts-Sp9X2zHo.js";import"./analytics-GZ8dIY_c.js";import"./plaid-C-eBmVPr.js";import"./dnd-0MaFz9wL.js";import"./stripe-cKAAJElX.js";import"./lottie-38LSfraF.js";import"./lexical-CAgOy6Q-.js";import"./pdf-B2N0erO1.js";import"./utils-BU0XThgM.js";import"./stripSplatSuffix-bz-VGo3l.js";import"./decodeURIComponentSafe-DjVlhgki.js";import"./routePaths-DTZH71MW.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="0b9cbf63-f788-4a28-96e6-d5ee605ae585",t._sentryDebugIdIdentifier="sentry-dbid-0b9cbf63-f788-4a28-96e6-d5ee605ae585")}catch{}})();function J(){const{matchId:t,tenantEmailDomain:e}=v(),n=U(),r=w(),R=y(t??""),a=k.useCallback((()=>{const S=I(r.state?.pathnameStackToGoBack);n(S.poppedPathname??`/${e??""}/month_end_close_checks/review`,{state:{pathnameStackToGoBack:S.newStack}})}),[r.state,n,e]);if(t==null)return s.jsx(b,{});const{match:i,detailFetchState:o,handleOpenBill:l,handleRefresh:c,handleUndoReversal:d,handleContinueMatch:h,lastMatchResults:f,lastUndoResults:m,refreshStatus:p,undoReversalStatus:u}=R;return i==null?o.fetchState==="Not-Started"||o.fetchState==="In-Progress"?s.jsx(g,{detailFetchState:o.fetchState,isUndoInFlight:u.fetchState==="In-Progress",refreshStatus:p.fetchState,onNavigateBack:a,onOpenBill:l,onContinueMatch:()=>{h(),a()},onRefresh:c,onUndoReversal:d,lastMatchResults:f,lastUndoResults:m}):s.jsx(b,{}):s.jsx(g,{match:i,detailFetchState:o.fetchState,isUndoInFlight:u.fetchState==="In-Progress",refreshStatus:p.fetchState,onNavigateBack:a,onOpenBill:l,onContinueMatch:()=>{h(),a()},onRefresh:c,onUndoReversal:d,lastMatchResults:f,lastUndoResults:m})}export{J as default};
1
+ import{j as s}from"./liveblocks-DR8KfETq.js";import{a as k}from"./sentry-FwaDhTzy.js";import{a5 as I,dQ as g}from"./index-BeqOty_5.js";import"./mui-BYn_Ugho.js";import{u as y}from"./useActualMatchingMatchDetail-CgMvOK9S.js";import b from"./NotFoundScreen-zRiKZg68.js";import{i as v,h as U,g as w}from"./core-Dh_SHcAD.js";import"./zeni-epic-state-DJh0-ZeR.js";import"./recharts-BTL88W4R.js";import"./analytics-Y9Rn1Gu7.js";import"./plaid-Dw8l1kdg.js";import"./dnd-CwwWYFuT.js";import"./stripe-cKAAJElX.js";import"./lottie-ODKvpFjz.js";import"./lexical-CaftfZ9D.js";import"./pdf-DnQo5-Qw.js";import"./utils-DEAaFgLU.js";import"./stripSplatSuffix-CvpfThkG.js";import"./decodeURIComponentSafe-B9wRnGXi.js";import"./routePaths-CN71IXC6.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="0b9cbf63-f788-4a28-96e6-d5ee605ae585",t._sentryDebugIdIdentifier="sentry-dbid-0b9cbf63-f788-4a28-96e6-d5ee605ae585")}catch{}})();function J(){const{matchId:t,tenantEmailDomain:e}=v(),n=U(),r=w(),R=y(t??""),a=k.useCallback((()=>{const S=I(r.state?.pathnameStackToGoBack);n(S.poppedPathname??`/${e??""}/month_end_close_checks/review`,{state:{pathnameStackToGoBack:S.newStack}})}),[r.state,n,e]);if(t==null)return s.jsx(b,{});const{match:i,detailFetchState:o,handleOpenBill:l,handleRefresh:c,handleUndoReversal:d,handleContinueMatch:h,lastMatchResults:f,lastUndoResults:m,refreshStatus:p,undoReversalStatus:u}=R;return i==null?o.fetchState==="Not-Started"||o.fetchState==="In-Progress"?s.jsx(g,{detailFetchState:o.fetchState,isUndoInFlight:u.fetchState==="In-Progress",refreshStatus:p.fetchState,onNavigateBack:a,onOpenBill:l,onContinueMatch:()=>{h(),a()},onRefresh:c,onUndoReversal:d,lastMatchResults:f,lastUndoResults:m}):s.jsx(b,{}):s.jsx(g,{match:i,detailFetchState:o.fetchState,isUndoInFlight:u.fetchState==="In-Progress",refreshStatus:p.fetchState,onNavigateBack:a,onOpenBill:l,onContinueMatch:()=>{h(),a()},onRefresh:c,onUndoReversal:d,lastMatchResults:f,lastUndoResults:m})}export{J as default};
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-DR8KfETq.js";import{A as i}from"./AddressScreen-DcUrSOsf.js";import s from"./NotFoundScreen-zRiKZg68.js";import"./sentry-FwaDhTzy.js";import{n as d,o as r}from"./core-Dh_SHcAD.js";import"./zeni-epic-state-DJh0-ZeR.js";import"./recharts-BTL88W4R.js";import"./index-BeqOty_5.js";import"./mui-BYn_Ugho.js";import"./analytics-Y9Rn1Gu7.js";import"./plaid-Dw8l1kdg.js";import"./dnd-CwwWYFuT.js";import"./stripe-cKAAJElX.js";import"./lottie-ODKvpFjz.js";import"./lexical-CaftfZ9D.js";import"./pdf-DnQo5-Qw.js";import"./utils-DEAaFgLU.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="81cbb5c1-1b56-4d87-a240-ae6c03b91825",t._sentryDebugIdIdentifier="sentry-dbid-81cbb5c1-1b56-4d87-a240-ae6c03b91825")}catch{}})();function _(){return e.jsxs(d,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(i,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(i,{})}),e.jsx(r,{path:"*",element:e.jsx(s,{})})]})}export{_ as default};
@@ -0,0 +1,9 @@
1
+ import{j as n}from"./liveblocks-DR8KfETq.js";import{a as b}from"./sentry-FwaDhTzy.js";import{h as T,u as P,g as j,i as E,j as B,l as M}from"./core-Dh_SHcAD.js";import{a2 as $,E as D,z as L,Q as V,a8 as K,a9 as F,j as _,S,a4 as z,_ as h,a5 as N}from"./index-BeqOty_5.js";import{Vj as C,ip as R,fF as U,Vk as G,c8 as H,Vl as O,mH as q}from"./zeni-epic-state-DJh0-ZeR.js";import{n as Q}from"./mui-BYn_Ugho.js";import J from"./NotFoundScreen-zRiKZg68.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]="80e5cc83-6ba3-4e8a-8cc9-941aad8b7bd1",e._sentryDebugIdIdentifier="sentry-dbid-80e5cc83-6ba3-4e8a-8cc9-941aad8b7bd1")}catch{}})();const W=Q.div`
2
+ display: flex;
3
+ height: 100vh;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey4};
9
+ `,X=M((function(e,s){const{addressId:o,isSubPage:i,addressType:c}=s,l=U(e),t=s.roleMap!=null&&G(s.roleMap),d=i||c==="user_address"||H(l?.userRole??[])||t?void 0:"readonly";if(o==null){const a=O(c,e);return{addressToEdit:a?.addressToCreate,loadingState:a?.status?.fetchState,googleAPIKey:h.googleMapsAPIKey,isDisabled:d,isSubPage:i,dontShowSaveConfirmationPopup:s.dontShowSaveConfirmation}}const r=C(e,o);return{addressToEdit:r.address,loadingState:r.fetchState,googleAPIKey:h.googleMapsAPIKey,isDisabled:d}}),(function(e,s){const{navigate:o,location:i,addressType:c}=s,l=t=>{if(t==="express-pay")o("../express-pay/add-wire");else{const d=i.state,r=N(d?.pathnameStackToGoBack);let a=r.poppedPathname??k();const u=d?.queryParams;if(u){const g=new URLSearchParams(u).toString();g&&(a=`${a}?${g}`)}o(a,{state:{pathnameStackToGoBack:r.newStack}})}};return{onSubmitHandler:t=>{const d=Y(t);e(q({addressType:c,addressToCreate:d})),_?.trackSaveAddressClicked(S.Event.saveAddressClicked,{street:t.street.addressString,city:t.city,state:t.state,country:t.country.selectedOption??"",postalCode:t.postalCode,suite:t.suite,secondaryInfo:t.secondaryInfo}),l(s.bankAccountContext)},onCancel:()=>{l(s.bankAccountContext)}}}))(z);function ne({isSubPage:e,hideAddressSubTitle:s=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const t=T(),d=P(),r=j(),{addressId:a,addressType:u}=E(),g=$(),v=D(),I=L.getSignedInUser(),[p,w]=b.useState(a==null),f=B((m=>a!=null?C(m,a).fetchState:"Not-Started")),x=V();if(I==null)throw Error("Can't access address page without signing in...");const A=m=>m.trackPageLoaded(a!=null?S.Event.editAddress:S.Event.addAddress),y=l??u;return b.useEffect((()=>{p||a==null||(w(!0),d(R(a,!1)))}),[p,a,d]),y==null||y.match(/(user_address|company_address|company_registered_address|vendor_address|officer_([1-9]|10)_address|invoicing_customer_billing_address|invoicing_subscription_shipping_address|invoicing_business_address)$/g)?!p&&f==="Not-Started"||p&&f==="In-Progress"?n.jsx(K,{fetchState:f,style:{backgroundColor:v.colors.grey5}}):a!=null&&f==="Error"?(t(`${k(1)}/new`,{replace:!0}),n.jsx(n.Fragment,{})):n.jsxs(n.Fragment,{children:[n.jsx(F,{analytics:_,onLoad:A}),n.jsx(W,{windowSize:g,children:n.jsx(X,{location:r,navigate:t,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:s,addressId:a,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:x?.loggedInUserRoleMap})})]}):n.jsx(J,{})}const k=(e=2)=>{let s="../";for(let o=0;o<e;o++)s=`${s}../`;return s},Y=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng});export{ne as A,Y as t};
@@ -0,0 +1,22 @@
1
+ import{j as h}from"./liveblocks-DR8KfETq.js";import{a}from"./sentry-FwaDhTzy.js";import{u as Dt,h as Ut,i as Lt,g as Bt,j as b,l as Ft}from"./core-Dh_SHcAD.js";import{a as Mt,V as Vt,e7 as $t,z as Nt,a2 as Gt,e8 as qt,e9 as zt,ea as Ht,bp as Be,eb as We,ec as Wt,bo as Je,a5 as ge,a9 as ce,j as M,ed as me,ee as Jt,ef as Kt,av as Yt,S as Xt,w as Zt,eg as es,eh as ts,aw as ss,ei as as,ej as ns,ek as os,el as is,p as rs,bl as Fe,em as ls}from"./index-BeqOty_5.js";import{fE as F,gt as R,U1 as us,a29 as ds,a2a as cs,jM as ms,a2b as Ss,jJ as hs,a2c as Se,jD as W,jT as J,jl as Ie,jB as he,jz as ps,jQ as fs,ju as Ke,Ua as Me,gv as V,gK as gs,U9 as Is,TW as Ve,fF as Cs,j3 as ks,a2d as bs,g8 as vs,jh as Es,jd as Ps,fG as pe,gf as ys,a2e as ws,a2f as xs,a2g as Rs,gu as Ts,go as $e,k4 as Ne,gq as Ge,gw as js,a2h as qe,jV as Os,ja as As,jo as Qs,jR as ze,jr as _s,gx as Ds,gy as Us,gz as Ls,gA as Bs}from"./zeni-epic-state-DJh0-ZeR.js";import{D as Fs,n as $,S as Ms,P as Vs}from"./mui-BYn_Ugho.js";import{u as $s}from"./useAiCfoDashboardSuggestedQuestionsChips-B5JNAQpD.js";import{p as Ns}from"./pathToGoBack-BiqpVJeS.js";import{j as Gs}from"./routePaths-CN71IXC6.js";import{u as qs}from"./useTaskManagerPusherEvents-CWsImhYv.js";import"./recharts-BTL88W4R.js";import"./analytics-Y9Rn1Gu7.js";import"./plaid-Dw8l1kdg.js";import"./dnd-CwwWYFuT.js";import"./stripe-cKAAJElX.js";import"./lottie-ODKvpFjz.js";import"./lexical-CaftfZ9D.js";import"./pdf-DnQo5-Qw.js";import"./utils-DEAaFgLU.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new s.Error().stack;r&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[r]="8316dc0b-9985-4753-bc14-23d413abcabc",s._sentryDebugIdIdentifier="sentry-dbid-8316dc0b-9985-4753-bc14-23d413abcabc")}catch{}})();const zs=["claimed","running","succeeded","failed","timeout"],fe=s=>typeof s=="string"&&s!=="",Ye="chat-response-generated";function Hs(s,r){if(r.kind!=="save")return;if(r.fetchState==="In-Progress")return{status:"saving"};if(r.fetchState==="Error")return{status:"failed"};if(r.fetchState!=="Completed")return;const t=R(s).skills.find((l=>l.macroId===r.savedMacroId));return t==null?void 0:{status:"saved",command:t.name}}const Ws=Ft((function(s,r){const t=F(s),l=r.isSubmitting,c=t.uiState?.currentChatSessionId,i=c!=null?ys(s.aiCfoState,c):[],f=ts(s,{allUsers:r.allUsers,onCardPolicyVendorSearchTextChange:r.onCardPolicyVendorSearchTextChange}),p=ws(s),S=xs(s),A=Rs(s);return{showSampleQuestions:r.sessionFromUrl==="explore"&&t.uiState.currentChatSessionId==null,aiCfoView:t,isSubmitting:l,isNewChatSession:r.sessionFromUrl==="new_chat"||r.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${ss}/tableDownload`,exportDownloadEndPoint:os(),emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,routedInitialQuestionSource:r.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:r.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:r.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:r.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:r.isFileUploadEnabled,isUploadPromoVisible:r.isUploadPromoVisible,onUploadPromoClose:r.onUploadPromoClose,skills:R(s).skills,skillSaveState:Hs(s,A),skillsEnabled:R(s).skillsEnabled,skillsList:R(s).skills,skillsListError:R(s).fetchState==="Error",skillsListLoading:R(s).fetchState==="In-Progress",skillsCanPublish:R(s).canPublish,skillSaving:A.fetchState==="In-Progress",skillSaveError:A.fetchState==="Error",skillVersionHistory:p.macroId!=null?{macroId:p.macroId,versions:p.versions,error:p.fetchState==="Error",loading:p.fetchState==="In-Progress"}:void 0,skillRestoreBody:S.macroId!=null&&S.version!=null?{macroId:S.macroId,version:S.version,instructions:S.instructions,error:S.fetchState==="Error",loading:S.fetchState==="In-Progress"}:void 0,skillDetail:J(s).detail,skillDetailError:J(s).fetchState==="Error",skillDetailLoading:J(s).fetchState==="In-Progress",syntheticAnswers:i,resolveSyntheticAnswerCardTile:ns(s),resolveSyntheticAnswerPolicyTile:as(s),...f}}),(function(s,r){const{location:t,currentTenant:l,userId:c,navigate:i,currentChatSessionId:f,allSessionsWithOrderedQuestionAnswers:p,isAiCardCreationEnabled:S,isCardPolicyEnabled:A,setIsAiCfoOpen:U}=r,T=l.tenantEmailDomain;return{onEventReceived:(n,o)=>{if(n===Ye&&typeof o.text=="string"&&typeof o.metadata=="object"){const m=o,E=Ds(m.type),v=m.metadata.chat_session_id??null,{currentChatSession:K,currentQuestionAnswer:j,currentQuestionAnswerSummary:Y}=Je(p,v);E!=="answer"?M.trackAICFOChatResponseGenerated(E,j?.question.questionText??"",m.text,v,ls(Y,K),m.metadata.message_id??null):M.trackAICFOChatAnswerGenerated(m.text,j?.question.questionText??"",(m.follow_up_questions?.length??0)>0,!!m.assumptions,!!m.insights,m.visualization!=null,Us(m.visualization?.type??"")??null,v,m.summarized_title,m.metadata.message_id??null),s(Ls({chatSessionId:m.metadata.chat_session_id,responseType:E,fetchState:{fetchState:"Completed",error:void 0}})),s(Bs({chatSessionId:m.metadata.chat_session_id,answerPayload:m,userId:c}))}},onSubmit:(n,o,m,E,v)=>{n&&Fe(s,n,o,f,p,c,E,m,void 0,v)},onFetchSkills:()=>{s(Ke())},onOpenSkill:n=>{s(Ie({macroId:n})),s(_s({macroId:n}))},onSaveSkill:(n,o)=>{s(ze({draft:n,macroId:o}))},onSaveSkillDraft:n=>{const o=n.displayName?.trim()??"",m=n.name?.trim()??"";s(ze({draft:{name:o.length>0?o:m,description:n.description?.trim()??null,instructions:n.instructions,visibility:"private"}}))},onFetchSkillVersionBody:(n,o)=>{s(Qs({macroId:n,version:o}))},onDeleteSkill:n=>{s(As({macroId:n}))},onSetSkillVisibility:(n,o)=>{s(Os({macroId:n,visibility:o}))},onCloseSkillDetail:()=>{s(qe())},onRunSkill:(n,o)=>{s(V()),s($e()),Fe(s,o,"user_input",void 0,p,c,void 0,void 0,void 0,n),s(qe())},updateCurrentInput:n=>{s(Ge(n))},onStopSubmit:()=>{},onUpdateScrollYOffset:n=>{s(js(n))},onSelectSampleQuestion:()=>{},onBackClick:()=>{i(-1)},onCloseClick:()=>{const n=ge(t.state?.pathnameStackToGoBack),o=n.poppedPathname??Ns(1);i(o,{state:{...t.state,pathnameStackToGoBack:n.newStack}}),s(Ge(""))},togglePageView:()=>{const n=ge(t.state?.pathnameStackToGoBack),o=n.poppedPathname??`/${l.tenantEmailDomain}/dashboard`;i(o,{state:{...We(t.state),pathnameStackToGoBack:n.newStack,message:"open_ai_cfo_drawer"}}),U(!0)},onCopy:()=>{},onThumbsUp:(n,o)=>{f!=null&&o?.messageId!=null&&s(Ne(f,o.messageId,"positive",o.questionText,o.answerText))},onThumbsDown:(n,o)=>{f!=null&&o?.messageId!=null&&s(Ne(f,o.messageId,"negative",o.questionText,o.answerText))},onTogglePageView:()=>{i(-1)},onNewChatClick:()=>{s(V()),f!=null&&s($e());const n=rs(t.state?.pathnameStackToGoBack,t.pathname);i(`/${l.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:n.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(n,o)=>{s(Ts({questionAnswerId:n,isCollapsed:o}))},onMenuClick:r.onMenuClick,...is(s,{isAiCardCreationEnabled:S,isCardPolicyEnabled:A,currentChatSessionId:f,onAfterCardsCreationSubmit:()=>{U(!0),i(`/${T}/cards`,{state:{...t.state}})},onAfterCardPolicySubmit:()=>{U(!0),i(`/${T}/cards/policy`,{state:{...t.state}})}})}}))(Zt(es)),Ia=({isFileUploadEnabled:s})=>{const{setIsAiCfoOpen:r}=Mt(),t=Dt(),l=Ut(),{session_id:c}=Lt(),i=Bt(),f=new URLSearchParams(i.search).get("routine")??void 0,[p,S]=a.useState(!1),A=b((e=>F(e).uiState.isSkillsBrowserOpen===!0)),U=b((e=>R(e).skillsEnabled)),T=b((e=>F(e).uiState.isRoutinesBrowserOpen===!0)),n=b((e=>us(e))),o=b((e=>ds(e))),m=b((e=>cs(e))),[E,v]=a.useState(void 0),[K,j]=a.useState(!1),[Y,Ce]=a.useState(void 0),Xe=a.useCallback((()=>{Ce(void 0),v(void 0),j(!0)}),[]),Ze=a.useCallback((e=>{v(e),j(!0)}),[]),et=a.useCallback((()=>{v(void 0),j(!1)}),[]),tt=a.useCallback((e=>{t(ms({draft:e,...E!=null&&{scheduleId:E.scheduleId}})),v(void 0),j(!1)}),[t,E]),P=f,ke=n.routines.find((e=>e.scheduleId===P)),I=b((e=>Ss(e))),st=a.useCallback((e=>{t(hs({scheduleId:e.scheduleId}))}),[t]);a.useEffect((()=>{t(P!=null?W({scheduleId:P}):Se())}),[t,P]);const B=ke?.macroId,at=b((e=>J(e))),be=B!=null&&B!==""&&at.fetchState==="Not-Started";a.useEffect((()=>{be&&B!=null&&t(Ie({macroId:B}))}),[t,be,B]);const nt=b((e=>F(e).uiState.currentChatSessionId))??c,C=n.routines.find((e=>e.scheduleId===f))??n.routines.find((e=>e.scheduleId===Vt(nt))),O=C?.scheduleId??null,[ve,ot]=a.useState(!0);a.useEffect((()=>{O!=null&&t(W({scheduleId:O}))}),[t,O]);const Ee=I.runs.some((e=>e.status==="claimed"||e.status==="running"))===!0;a.useEffect((()=>{if(P==null||Ee!==!0)return;const e=window.setInterval((()=>{t(W({scheduleId:P})),t(he())}),5e3);return()=>window.clearInterval(e)}),[t,Ee,P]);const it=a.useCallback((e=>{Ce(e),v(void 0),j(!0)}),[]),rt=a.useCallback((e=>{t(ps({scheduleId:e.scheduleId}))}),[t]),lt=a.useCallback(((e,d)=>{t(fs({enabled:d,scheduleId:e.scheduleId}))}),[t]);a.useEffect((()=>{T&&t(he())}),[t,T]);const Pe=b((e=>R(e).skills)),X=a.useMemo((()=>Pe.map((e=>({macroId:e.macroId,name:e.displayName??e.name})))),[Pe]),ut=a.useCallback((e=>{t(Ie({macroId:e}))}),[t]),Z=a.useCallback((()=>{t(Ke()),t(Me())}),[t]),dt=a.useCallback((()=>{t(V())}),[t]),{allUsers:ct,isAiCardCreationEnabled:mt,isCardPolicyEnabled:St,onCardPolicyVendorSearchTextChange:ht}=$t();a.useEffect((()=>{t(gs())}),[t]);const g=b((e=>F(e))),w=Nt.getSignedInUser();a.useEffect((()=>c==="routines"?(t(V()),void t(Is())):c==="skills"?(t(Se()),t(Ve()),void t(Me())):(O==null&&t(Se()),t(Ve()),void t(V()))),[t,O,f,c]);const pt=Gt(),Q=Yt(pt),k=b((e=>Cs(e))),u=g.uiState.currentChatSessionId,y=k.tenantEmailDomain,L=y!=null&&y!=="",ee=a.useCallback((e=>{L&&l(`/${y}/ai-cfo/routines?routine=${encodeURIComponent(e.scheduleId)}`)}),[L,l,y]),te=a.useCallback((()=>{L&&l(`/${y}/ai-cfo/routines`)}),[L,l,y]),se=a.useCallback(((e,d)=>{const _=e.sessionId??I.sessionId;_!=null&&L&&l(`/${y}/ai-cfo/${_}?routine=${encodeURIComponent(d)}`)}),[L,l,I.sessionId,y]),ft=a.useMemo((()=>C==null?void 0:{error:I.fetchState==="Error",kind:"routineRuns",loading:I.fetchState==="In-Progress"||I.fetchState==="Not-Started",routineName:C.name,schedule:qt(C),skillName:C.isAdHoc===!0?void 0:X.find((e=>e.macroId===C.macroId))?.name,onOpenSkill:C.isAdHoc===!0?void 0:Z,runs:I.runs,tzName:C.tzName,unreadCount:C.unreadRuns,open:ve,onToggle:()=>ot((e=>!e)),onOpenRun:e=>se(e,C.scheduleId),onOpenRoutine:()=>ee(C),onOpenRoutines:te}),[Z,te,ee,se,ve,C,I.fetchState,I.runs,X]),{handleUploadPromoClose:gt,isUploadPromoVisible:It}=zt({isFileUploadEnabled:s,tenantEmailDomain:y}),ae=Ht({currentTenant:k,currentChatSessionId:u,aiCfoView:g,skillsEnabled:U,onCloseSkills:dt,onOpenSkills:Z}),{isSuggestedQuestionsLoading:Ct,suggestedPromptQuestions:kt}=$s(),N=i.state,G=N?.aiCfoInitialQuestion,ye=!!N?.aiCfoShouldSubmit;a.useEffect((()=>{const e=i.state;if(e?.[Be]!==!0)return;S(!0);const d={...e};delete d[Be],l(i,{replace:!0,state:d})}),[i.pathname,i.search,i.state,l]);const[bt,ne]=a.useState(null),[vt,oe]=a.useState(!1),[Et,ie]=a.useState(void 0),[Pt,re]=a.useState(void 0),we=a.useRef(!1);a.useEffect((()=>{if(!we.current&&G!=null&&G!==""){const e=i.state;ne(G),oe(ye),ie(e?.aiCfoInitialSubmissionSource!=null?e.aiCfoInitialSubmissionSource:void 0);const d=e?.aiCfoSuggestionIndex;re(typeof d=="number"?d:void 0),we.current=!0}}),[G,ye,i.state]);const yt=a.useCallback((()=>{ne(null),oe(!1),ie(void 0),re(void 0),l(i.pathname,{replace:!0,state:We(i.state)})}),[i.pathname,i.state,l]),xe=a.useMemo((()=>new URLSearchParams(i.search)),[i.search]),Re=xe.get("ref")??N?.aiCfoRef,le=xe.get("emailRefId")??N?.aiCfoEmailRefId,Te=a.useRef(!1);a.useEffect((()=>{Te.current||Re!=="month-end-email"||le==null||u!=null||w==null||(t(ks("controller",w.userId,le,"MONTH_END_EMAIL")),Te.current=!0)}),[Re,le,u,t,w]);const q=g.uiState.lastContextMessage;a.useEffect((()=>{q!=null&&q!==""&&u!=null&&(ne(q),oe(!0),ie(void 0),re(void 0),t(bs()))}),[q,u,t]);const wt=k.masterTOSInfo,x=wt?.isMasterTOSAccepted??!1,{visitedSessions:je}=Wt(u),z=g.fetchState,H=g.uiState.chatSessionsNextPageToken.hasMore||!g.uiState.chatSessionsFirstPageFetched,Oe=u!=null?g.fetchChatSessionHistoryByChatSessionId?.[u]?.fetchState??"Not-Started":"Not-Started",Ae=u==null||(g.uiState.chatHistoryNextPageToken[u]?.hasMore??!0),Qe=g.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:xt}=Je(Qe,u),Rt=xt.length===0;a.useEffect((()=>{x||Q||l("../dashboard",{state:{...i.state,message:"open_ai_cfo_drawer"}})}),[x,Q,l,i.state]);const Tt=a.useCallback((()=>{const e=ge(i.state?.pathnameStackToGoBack),d=k.tenantEmailDomain;l(e.poppedPathname??(d!=null?`/${d}/dashboard`:".."),{state:{...i.state,pathnameStackToGoBack:e.newStack}})}),[k.tenantEmailDomain,i.state,l]),_e=a.useRef(void 0),De=a.useRef(void 0);a.useEffect((()=>{const e=c!==_e.current,d=u!==De.current;_e.current=c,De.current=u,c!==u&&(!e||c==null||Gs(c)?d&&u!=null&&l(`../ai-cfo/${u}`,{state:{...i.state}}):t(vs({sessionId:c,agentId:"controller"})))}),[u,c]);const jt=a.useMemo((()=>({events:je.map((e=>`private-encrypted-chat-${e}.${Ye}`)),eventCallback:(e,d,_)=>_.onEventReceived(e,d)})),[je]);a.useEffect((()=>{z!=="In-Progress"&&H&&t(Es())}),[z,H,t]),a.useEffect((()=>{u!=null&&Oe!=="In-Progress"&&Ae&&w!=null&&(c===u||z==="Completed"&&!H)&&t(Ps(u,w.userId))}),[Oe,z,Ae,H,u,w,c,t]);const ue=w?.userId,Ot=a.useMemo((()=>{return ue==null?[]:[(e=ue,`private-encrypted-routines-${e}.routine-run-updated`)];var e}),[ue]),Ue=a.useCallback((e=>{const d=e!=null&&(e===P||e===O);(T||d)&&t(he()),d&&t(W({scheduleId:e}))}),[t,T,O,P]);qs({events:Ot,onSubscribed:()=>Ue(P??O),onEvent:(e,d)=>{const _=(de=>{if(de==null||typeof de!="object")return null;const D=de;return fe(D.schedule_id)&&fe(D.run_id)?{scheduleId:D.schedule_id,runId:D.run_id,status:zs.find((_t=>_t===D.status))??null,finishedAt:fe(D.finished_at)?D.finished_at:null}:null})(d);_!=null&&Ue(_.scheduleId)}});const Le=e=>e.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(w==null||c==null)throw Error("Can't access AI Controller page without signing in...");const At=u!=null&&g.responseStateByChatSessionId?.[u]?.answer?.fetchState==="In-Progress";if(!x&&Q)return h.jsxs(Ks,{children:[h.jsx(ce,{analytics:M,onLoad:Le}),ae.drawerElement,h.jsx(Ys,{children:h.jsx(He,{children:h.jsx(me,{isTOSAccepted:!1,acceptMasterTOSState:g.masterTOSAcceptanceState,onCloseClick:Tt,onCompleteClick:()=>{k.userRoleId!=null&&t(pe(k.userRoleId))}})})})]});const Qt=h.jsxs(h.Fragment,{children:[p&&!x?h.jsx(ce,{analytics:M,onLoad:Le}):null,h.jsx(me,{isTOSAccepted:x,acceptMasterTOSState:g.masterTOSAcceptanceState,showHeader:!1,togglePageView:x?()=>S(!1):void 0,onCloseClick:()=>S(!1),onCompleteClick:()=>{x||k.userRoleId==null||t(pe(k.userRoleId)),S(!1)}})]});return h.jsxs(h.Fragment,{children:[h.jsxs(Js,{children:[h.jsx(ce,{analytics:M,onLoad:e=>e.trackPageLoaded(Xt.Event.aiCFOPage)}),Q&&ae.drawerElement,h.jsx(Ws,{...jt,currentChatSessionId:u,allSessionsWithOrderedQuestionAnswers:Qe,allUsers:ct,isAiCardCreationEnabled:mt,isCardPolicyEnabled:St,openOnboardingPage:()=>S(!0),userId:w.userId,setIsAiCfoOpen:r,navigate:l,sessionFromUrl:c,location:i,isSubmitting:At,isEmptyChatWithSession:Rt,currentTenant:k,emailLinkQuestion:bt??void 0,autoSubmitEmailLinkQuestion:vt,onEmailLinkQuestionProcessed:yt,routedInitialQuestionSource:Et,routedInitialQuestionSuggestionIndex:Pt,onCardPolicyVendorSearchTextChange:ht,onMenuClick:Q?ae.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:It,onUploadPromoClose:gt,exploreSuggestedPromptQuestions:kt,exploreSuggestedPromptQuestionsLoading:Ct,isSkillsOpen:A,isRoutinesOpen:T,routineCanCreate:m,routineEditing:E,routineEditorOpen:K,routineListError:n.fetchState==="Error",routineListLoading:n.fetchState==="In-Progress",routineMaxRoutines:n.maxRoutines,routineSaveError:o.fetchState==="Error",routineSaving:o.fetchState==="In-Progress",routineSchedulableSkills:X,routines:n.routines,onRoutineCreate:Xe,onRoutineDelete:rt,routineHistoryError:I.fetchState==="Error",routineHistoryLoading:I.fetchState==="In-Progress",chatSidePanel:ft,routineDetail:ke,routineRunningScheduleId:o.runningScheduleId,routineRuns:I.runs,onRoutineEdit:Ze,onRoutineOpenRun:(e,d)=>se(d,e.scheduleId),onRoutineRun:st,onRoutineCloseDetail:te,onRoutineDraft:it,routineDraftPrompt:Y,onRoutineOpenDetail:ee,onRoutineEditorCancel:et,onRoutineLoadSkillInstructions:ut,onRoutineSave:tt,onRoutineSetEnabled:lt,isCreateSkillEnabled:U,promoDismissalScope:y}),p&&Q?h.jsx(Fs,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:Xs,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>S(!1),children:h.jsx(He,{onClick:e=>e.stopPropagation(),children:h.jsx(me,{isTOSAccepted:x,acceptMasterTOSState:g.masterTOSAcceptanceState,onCloseClick:()=>S(!1),onCompleteClick:()=>{x||k.userRoleId==null||t(pe(k.userRoleId)),S(!1)}})})}):null]}),p&&!Q?h.jsx(Jt,{open:p,onClose:()=>S(!1),children:h.jsx(Kt,{children:Qt})}):null]})},He=$(Ms)`
2
+ display: flex;
3
+ min-height: 100%;
4
+ flex-direction: column;
5
+ `,Js=$.div`
6
+ height: 100vh;
7
+ width: 100%;
8
+ `,Ks=$.div`
9
+ height: 100vh;
10
+ width: 100%;
11
+ display: flex;
12
+ flex-direction: column;
13
+ min-height: 0;
14
+ `,Ys=$.div`
15
+ flex: 1;
16
+ min-height: 0;
17
+ display: flex;
18
+ flex-direction: column;
19
+ `,Xs=$(Vs)`
20
+ box-shadow: ${({theme:s})=>s.colors.elevation2};
21
+ color: ${({theme:s})=>s.colors.grey4};
22
+ `;export{Ia as default};
@@ -1,4 +1,4 @@
1
- import{j as d}from"./liveblocks-BPL36a6x.js";import{a as o,R as va}from"./sentry-_x3Yh1Jc.js";import{u as Me,j as r,g as ya,h as $a,q as G}from"./core-DOBELRta.js";import{fF as Fe,TP as Ba,TQ as Re,g9 as xa,gv as W,TR as J,ju as Ie,jB as Te,TS as Aa,TT as _a,gO as Da,p$ as Ma,TU as Fa,TV as ve,gm as Ra,TW as $,fE as Za,gt as Ga,TX as Pa,TY as Va,TZ as ja,T_ as ye,T$ as Ha,U0 as $e,U1 as La,E5 as Na,gn as Ua,h1 as Oa,cV as za,U2 as qa,U3 as Ya,qC as Qa,g8 as Wa,j6 as Ja,U4 as Xa,U5 as Ka,wq as et,go as at}from"./zeni-epic-state-DXFYDM66.js";import{w as tt,i as nt,a as ot,R as st,E as rt,c as it,A as m,d as lt,u as dt,e as ct,f as ut,g as mt,h as Ct,_ as pt,H as ht,j as ft,z as gt,k as P,p,m as Be,l as bt,q as St,n as xe,o as kt,Q as Ae,r as Et,O as wt,s as K,v as X,x as It,y as Tt,B as vt,L as yt,C as $t,D as Bt,F as ee,I as xt,J as At}from"./index-D0or4oV9.js";import{A as _t,b as Dt,I as Mt,a as _e,d as Ft,D as De}from"./mui-wO6EIETx.js";import{u as Rt}from"./InboxNotificationsProvider-Bd8tLMl8.js";import{u as Zt}from"./useTaskManagerAccess-CxAfFVI5.js";import{u as Gt}from"./expenseAutomationHelper-CRKfrxDD.js";import"./recharts-Sp9X2zHo.js";import"./analytics-GZ8dIY_c.js";import"./plaid-C-eBmVPr.js";import"./dnd-0MaFz9wL.js";import"./stripe-cKAAJElX.js";import"./lottie-38LSfraF.js";import"./lexical-CAgOy6Q-.js";import"./pdf-B2N0erO1.js";import"./utils-BU0XThgM.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},C=new a.Error().stack;C&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[C]="d90e326b-bdc2-4a55-8a25-f3f86e7dc5ba",a._sentryDebugIdIdentifier="sentry-dbid-d90e326b-bdc2-4a55-8a25-f3f86e7dc5ba")}catch{}})();const B="AppDrawer",c={root:`${B}-root`,drawer:`${B}-drawer`,appBar:`${B}-appBar`,menuButton:`${B}-menuButton`,appBarZenilogo:`${B}-appBarZenilogo`,drawerZenilogo:`${B}-drawerZenilogo`},Pt=ee("div",{slot:"Root"})((({theme:a})=>({[`&.${c.root}`]:{display:"flex"},[`& .${c.drawer}`]:{[a.breakpoints.up("md")]:{width:K,flexShrink:0,backgroundColor:a.colors.background}},[`& .${c.appBar}`]:{color:a.colors.primary,backgroundColor:a.colors.background,boxShadow:"none"},"& .MuiToolbar-root":{backgroundColor:a.colors.background},[`& .${c.menuButton}`]:{marginRight:a.spacing(2),[a.breakpoints.up("md")]:{display:"none"}},[`& .${c.appBarZenilogo}`]:{fill:a.colors.primary,cursor:"pointer",width:"100%",marginLeft:a.spacing(-6)},[`& .${c.drawerZenilogo}`]:{margin:`${a.spacing(3)} ${a.spacing(3)} ${a.spacing(0)}`,fill:a.colors.primary,cursor:"pointer"}}))),Vt=tt((function({tenantEmailDomain:a}){const{isAiCfoOpen:C,setIsAiCfoOpen:b}=ot(),[V,A]=va.useState(!1),[S,Ze]=o.useState(!1),t=ya(),s=$a(),ae=xa(),te=st(),n=Me(),[Ge,Pe]=o.useState(!1),j=rt(),ne=t.pathname.includes("/ai-cfo/");o.useEffect((()=>{ne||(n(W()),n(J()))}),[n,ne]),o.useEffect((()=>{n(W()),n(J())}),[n,a]);const{useFeatureGate:u}=it(),{isFeatureEnabled:oe}=u(m.isDebitCardFeatureEnabled),k=lt(),i=r((e=>Fe(e))),H=i.masterTOSInfo?.isMasterTOSAccepted??!1,{setLoading:Ve}=dt(),E=ct(),{isTaskManagerAccessEnabled:_,isZeniUser:je}=Zt(k),se=ut(),w=mt();o.useEffect((()=>{w&&E&&(n(Ie()),n(Te()))}),[n,w,i.tenantId,E]);const[L,He]=o.useState(void 0),Le=!!i.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:Ne}=u(m.isChargeCardFeatureEnabled),Ue=Ct(i,Ne,oe),{isFeatureEnabled:Oe}=u(m.isSettingsFeatureEnabled),{isFeatureEnabled:D}=u(m.isReferralFeatureEnabled),ze=i.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",re=r((e=>Aa(e)));o.useEffect((()=>{const e=()=>{Pe(window.scrollY>10)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}),[]);const N=r((e=>_a(e))),h=r((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),f=r((e=>Da(e))),{monthEndCloseChecksView:I}=f,qe=G("/signout")!==null,M=G("/:tenantEmailDomain/dashboard")!==null,ie=G("/:tenantEmailDomain/reports")!==null,g=G("/:tenantEmailDomain/onboarding/*")!==null,le=Gt();o.useEffect((()=>{w&&D&&!g&&N.fetchState==="Not-Started"&&n(Ma(!0))}),[w,D,N.fetchState,g]),o.useEffect((()=>{if(le){const e=t.state?.origin;if(e!=null){const l=Fa(e);l!=null&&n(ve(l))}}}),[le,t.state]);const Ye=qe||g,U=r((e=>e.tenantState)),Qe=r((e=>U.fetchState==="Completed"?Ra(e):[])),{isFeatureEnabled:We}=u(m.isApAgingFeatureEnabled),{isFeatureEnabled:Je}=u(m.isArAgingFeatureEnabled),{isFeatureEnabled:Xe}=u(m.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Ke}=u(m.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:ea}=u(m.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:aa}=u(m.isDashboardSidebarNewYearAnimationEnabled),ta=r((e=>$(e).totalUnreadCount)),na=r((e=>$(e).notificationDetailsByTab.tasks.uiState.unreadCount)),oa=r((e=>$(e).notificationDetailsByTab.comments.uiState.unreadCount)),sa=r((e=>$(e).reducedFetchCountState)),de=r((e=>$(e).notificationDetailsByTab.tasks.fetchCountState)),O=r((e=>Za(e))),ra=r((e=>Ga(e).skillsEnabled)),ia=r((e=>Pa(e))),ce=r((e=>Va(e).routines)),la=o.useMemo((()=>ce.filter((e=>e.sessionId!=null)).map((e=>({cadence:pt(e),name:e.name,scheduleId:e.scheduleId,sessionId:e.sessionId,unreadRuns:e.unreadRuns})))),[ce]),da=new URLSearchParams(t.search).get("routine")??ht(t.pathname.split("/ai-cfo/")[1])??void 0,ca=o.useCallback(((e,l)=>{s(l!=null&&l!==""?`/${a}/ai-cfo/${encodeURIComponent(l)}`:`/${a}/ai-cfo/routines?routine=${encodeURIComponent(e)}`)}),[s,a]),{status:ue}=r(ja),[T,z]=o.useState(void 0),q=O.uiState.currentChatSessionId,F=T!=null?O.deleteChatSessionStateByChatSessionId[T]?.fetchState:void 0,me=ft(F),{inboxNotifications:Y,isLoading:Ce,isFetchingMore:pe,hasFetchedAll:he,fetchMore:ua}=Rt(),R=r((e=>$(e).notificationDetailsByTab.comments.fetchCountState));o.useEffect((()=>{const e=setTimeout((()=>ua?.()),0);return()=>clearTimeout(e)})),o.useEffect((()=>{if(T!=null)return me==="In-Progress"&&F==="Completed"?(n(ye({chatSessionId:T})),z(void 0),void s(`/${a}/ai-cfo/explore`,{state:{...t.state,referrer:"Sidebar"}})):void(F==="Error"&&(n(ye({chatSessionId:T})),z(void 0)))}),[n,t.state,s,F,T,me,a]),o.useEffect((()=>{if(Ce===!1&&pe===!1&&he===!0&&i?.companyId!=null&&Y!=null){const e=`dashboard_${i.companyId}`;He(Y.filter((l=>l.roomId===e&&l.readAt==null)).length)}}),[Ce,pe,he,i?.companyId,Y]),o.useEffect((()=>{w&&_&&!g&&de.fetchState==="Not-Started"&&ae.tenantId!=null&&n(Ha("task_manager","dashboard"))}),[w,_,g,de.fetchState,ae.tenantId,n]),o.useEffect((()=>{g||R.fetchState!=="Not-Started"||n($e({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[g,R.fetchState,n]),o.useEffect((()=>{if(L!=null){const{fetchState:e}=R;e!=="In-Progress"&&e!=="Completed"||(e==="In-Progress"&&n($e({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),n(Re({unreadCount:L},"comments")))}}),[L,R.fetchState]);const ma={fetchStatus:sa,count:ta},v=[];We===!1&&v.push("accounts_payable_aging"),Je===!1&&v.push("accounts_receivable_aging"),v.push("zeni_accounts_promo_card","treasury_promo_card"),D===!1&&v.push("rewards_card"),se===!1&&v.push("expense_automation_card");const fe=r((e=>La(e,v).fetchState)),ge=r((e=>Na(e).fetchState)),be=a!=null?gt.getSignedInUserTenant(a):null,Se=r((e=>be?.tenantId!=null?Ua(e,be.tenantId):void 0)),Ca=M&&(fe==="Completed"||fe==="Error")||ie&&(ge==="Completed"||ge==="Error")||!M&&!ie?void 0:"disabled",pa=o.useMemo((()=>Oa(i.userRole)),[i.userRole]),ha=za(pa),y=e=>{A(e)},fa=ze,ga=i?.rewardsLastViewedTime==null,ba=k?.userEmail!=null&&re.fetchState==="Completed"&&qa(re.notificationSettings,k.userEmail,oe,i,_),Sa=o.useCallback((e=>{const l=t.state?.referrer;if(I.monthEndCloseChecks?.auditSummary!=null&&P.trackMonthCloseAuditPage(e.month,e.year,I.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",I.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,l??null),n(Ya(i.tenantId,e)),h[i.tenantId]!=null){const x=p(t.state?.pathnameStackToGoBack,t.pathname);s(`/${a}/month_end_close_checks/review/${f.currentSelectedView}/${e.month}-${e.year}`,{state:{pathnameStackToGoBack:x,referrer:f.currentSelectedView}})}n(ve(f.currentSelectedView)),f.reconciliation.selectedAccountId!=null&&n(Qa({selectedAccountId:void 0}))}),[f.reconciliation.selectedAccountId,f.currentSelectedView,i.tenantId,I.monthEndCloseChecks?.auditSummary,I.monthEndCloseChecks?.reportEmailSentDate,h,a,t.state,t.pathname]),ka=o.useMemo((()=>({zIndex:S?12:Be[2]})),[S]),Ea=E&&bt(t),ke=d.jsx(St,{signedInUser:k,currentTenantId:U.currentTenantId??"",tenants:U.fetchState==="Completed"?Qe:Se!=null?[Se]:[],rewardsConfiguration:{isRewardsTabVisible:D,isRewardsAnimated:ga,rewardsPlan:N.rewardsPlan},selectedMenu:C===!0?Ae("ai_cfo"):xe(t)&&ue!=="completed"?Ae("invoicing"):Et(t),isTenantDropdownDisabled:Ca,isSettings:kt(t),isInvoicing:xe(t)&&ue==="completed",isSettingsFeatureEnabled:Oe,currentTenant:i,isVendorsTabVisible:ha,isZeniAccountEnabled:Le,isChargeCardEnabled:Ue,isTreasuryEnabled:fa,isNotificationsTabVisible:ba,notificationCountDetails:ma,isExpenseAutomationEnabledForUser:se,isAiCfoAccessEnabled:E,skillsEnabled:ra&&E,routinesEnabled:ia===!0&&E,routines:la,selectedRoutineId:da,onRoutineSelect:ca,onNotificationIconClick:()=>{y(!1);const e=je?na===0&&oa>0?"notifications/comments":"notifications/tasks":"notifications/comments",l=p(t.state?.pathnameStackToGoBack,t.pathname);s(`${a}/${e}`,{state:{pathnameStackToGoBack:l}})},onZeniLogoClick:()=>{te.toggle()},handleTenantSelect:e=>{Ve(yt.TENANT_SWITCHING),y(!1),$t({dispatch:n,navigate:s,pathToNavigate:Bt(e.tenantEmailDomain,t),selectedTenant:e,signedInUser:k})},handleMenuChange:(e,l)=>{if(k!=null&&P.trackSidePanelClicked(e.type,e.group),y(!1),a==null)return;if(e.type==="routines")return H?(n(Te()),n(Xa()),void s(`/${a}/ai-cfo/routines`,{state:{pathnameStackToGoBack:p(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}})):void X({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});if(e.type==="skills")return H?(n(Ie()),n(Ka()),void s(`/${a}/ai-cfo/skills`,{state:{pathnameStackToGoBack:p(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}})):void X({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});if(n(W()),n(J()),e.type==="invoicing")return C&&b(!1),n(et({cacheOverride:!1})),void s(`../${a}/invoicing/overview`,{state:{pathnameStackToGoBack:p(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}});if(C&&It(e.type)&&b(!1),e.type==="ai_cfo"){if(P.trackAICFOChatScreenStateChanged("viewed","left_menu",q??null,null),!H)return void X({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});const Z=p(t.state?.pathnameStackToGoBack,t.pathname);return void s(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:Z,referrer:"Sidebar"}})}const x=p(t.state?.pathnameStackToGoBack,t.pathname),Q=e.type,we=At(Q)&&Q!=="command_center";if(Q!=="command_center"&&!we||h[i.tenantId]==null||P.trackMonthEndCloseClicked(h[i.tenantId].month,h[i.tenantId].year,"Sidebar"),we&&h[i.tenantId]!=null){const Z=h[i.tenantId];return void s(`/${a}/month_end_close_checks/review/${e.type}/${Z.month}-${Z.year}`,{state:{pathnameStackToGoBack:x,message:l,referrer:"Sidebar"}})}const Ta=Tt(e.type);vt(e.type)?(q!=null&&n(at()),s(`/${a}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:x.slice(0,-1),message:l,referrer:"Sidebar"}})):s(`../${a}/${Ta}`,{state:{pathnameStackToGoBack:x,message:l,referrer:"Sidebar"}})},onDeleteChatSession:e=>{n(Ja(e)),q===e&&z(e)},handleLogOutClick:()=>{y(!1);const e=p(t.state?.pathnameStackToGoBack,t.pathname);s("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMyProfileClick:()=>{s(`${a}/settings/my_profile`)},handleReferralsClick:()=>{s(`${a}/rewards/refer`)},handleBackClick:()=>{s(`${a}/dashboard`)},handleCockpitClick:()=>{window.open("/cockpit")},monthEndCloseChecksView:I,onPeriodChange:Sa,onCalendarOpen:Ze,aiCfoView:O,isAiCfo:Ea,isOnDashboard:M,isTaskManagerAccessEnabled:_,updateCurrentChatSessionId:e=>{n(Wa({sessionId:e,agentId:"controller"})),s(`../${a}/ai-cfo/${e}`,{state:{...t.state}})},halloweenAnimationEnabled:Xe,thanksGivingAnimationEnabled:Ke,christmasAnimationEnabled:ea,newYearAnimationEnabled:aa}),wa=d.jsx(_t,{position:"fixed",className:c.appBar,style:{borderBottom:Ge?`1px solid ${j.colors.grey2}`:""},children:d.jsxs(Dt,{style:{minHeight:wt},children:[d.jsx(Mt,{color:"inherit","aria-label":"open drawer",edge:"start",onClick:()=>y(!0),className:c.menuButton,size:"large",children:d.jsx(jt,{})}),d.jsx(Ht,{className:c.appBarZenilogo,onClick:()=>{te.toggle()}})]})}),Ee=_e((e=>e.breakpoints.up("md"))),Ia=_e((e=>e.breakpoints.down("md")));return a==null?null:d.jsxs(Pt,{className:c.root,children:[d.jsx(Ft,{}),Ye===!1?d.jsxs(d.Fragment,{children:[Ee||!M?null:wa,d.jsxs("nav",{className:c.drawer,children:[Ee?null:d.jsx(De,{container:window.document.body,variant:"temporary",open:V,onClose:()=>y(!1),PaperProps:{sx:{width:K,zIndex:Be[2],borderRight:"none",backgroundImage:"none",backgroundColor:j.colors.background}},ModalProps:{keepMounted:!0},children:ke}),Ia?null:d.jsx(De,{PaperProps:{sx:{width:K,borderRight:"none",backgroundImage:"none",backgroundColor:j.colors.background,...ka}},variant:"permanent",open:!0,children:ke})]})]}):null]})})),r1=({tenantEmailDomain:a})=>{const C=Me(),b=r((A=>Fe(A))),V={events:b.userRoleId!=null?[`private-encrypted-${b.userRoleId}.dashboard-user-notification`]:[],eventCallback:(A,S)=>{nt(S)&&Ba(S.mode)==="dashboard"&&C(Re({unreadCount:S.data.unread},"tasks"))}};return d.jsx(Vt,{tenantEmailDomain:a,...V})},jt=ee((a=>o.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...a},o.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.604839 4.51889C0.333157 4.57797 0.0879194 4.8318 0.0182541 5.12602C-0.00534674 5.22569 -0.00534674 5.4412 0.0182541 5.54086C0.0523791 5.685 0.117181 5.80198 0.22956 5.92229C0.346814 6.04782 0.459133 6.11627 0.600351 6.14826C0.726193 6.17676 23.2738 6.17676 23.3997 6.14826C23.5409 6.11627 23.6532 6.04782 23.7704 5.92229C23.9348 5.74632 24 5.57908 24 5.33344C24 5.1793 23.9797 5.08352 23.9199 4.95575C23.8455 4.79698 23.6879 4.63709 23.5343 4.56468C23.3857 4.49468 24.2116 4.49926 11.9899 4.50058C2.66632 4.50157 0.669677 4.50479 0.604839 4.51889ZM0.669895 11.1732C0.365117 11.2113 0.0889356 11.4752 0.0182179 11.7958C-0.00468131 11.8996 -0.00469357 12.0996 0.0181935 12.2034C0.0806855 12.4867 0.305734 12.7294 0.581516 12.8108C0.65573 12.8327 1.1761 12.8337 12 12.8337C22.8591 12.8337 23.3441 12.8327 23.4192 12.8106C23.6933 12.7297 23.9196 12.4855 23.9818 12.2034C24.0047 12.0996 24.0047 11.8997 23.9818 11.7959C23.9201 11.516 23.7014 11.2776 23.425 11.1888C23.3558 11.1665 22.8817 11.1655 12.0544 11.164C5.84032 11.1631 0.717278 11.1672 0.669895 11.1732ZM0.594774 17.8516C0.458952 17.8831 0.344939 17.9535 0.22956 18.077C0.0652015 18.253 0 18.4202 0 18.6659C0 18.82 0.0203225 18.9158 0.0801289 19.0435C0.154452 19.2023 0.312097 19.3622 0.465726 19.4346C0.614214 19.5046 -0.209758 19.4999 12 19.4999C21.8294 19.4999 23.3082 19.4975 23.3881 19.4811C23.6596 19.4256 23.9122 19.1669 23.9817 18.8733C24.0053 18.7736 24.0053 18.5581 23.9817 18.4584C23.9476 18.3143 23.8828 18.1973 23.7704 18.077C23.6532 17.9515 23.5409 17.883 23.3997 17.851C23.2779 17.8235 0.713601 17.824 0.594774 17.8516Z",fill:"currentColor"}))))`
1
+ import{j as d}from"./liveblocks-DR8KfETq.js";import{a as o,R as ya}from"./sentry-FwaDhTzy.js";import{u as Me,j as r,g as Ta,h as $a,q as R}from"./core-Dh_SHcAD.js";import{fF as Fe,TU as Ba,TV as Ze,g9 as xa,gv as K,TW as X,ju as Ie,jB as ve,TX as Aa,TY as _a,gO as Da,p$ as Ma,TZ as Fa,T_ as ye,gm as Za,T$ as $,fE as Ga,gt as Ra,U0 as Ua,U1 as Va,U2 as ja,U3 as Te,U4 as Ha,U5 as $e,U6 as Na,E5 as Pa,gn as La,h1 as Oa,cV as za,U7 as Ya,U8 as qa,qC as Wa,g8 as Ka,j6 as Xa,U9 as Ja,Ua as Qa,wq as et,go as at}from"./zeni-epic-state-DJh0-ZeR.js";import{w as tt,i as nt,a as ot,O as st,E as rt,c as it,A as m,d as lt,u as dt,e as ct,o as ut,f as mt,g as Ct,W as pt,V as ht,h as ft,z as gt,j as U,p,m as Be,k as bt,K as St,l as xe,n as kt,Y as Ae,q as Et,N as wt,r as Q,s as J,v as It,x as vt,y as yt,L as Tt,B as $t,C as Bt,D as ee,F as xt,Z as At}from"./index-BeqOty_5.js";import{A as _t,b as Dt,I as Mt,a as _e,d as Ft,D as De}from"./mui-BYn_Ugho.js";import{u as Zt}from"./InboxNotificationsProvider-D6QvVVj8.js";import{u as Gt}from"./useTaskManagerAccess-DJBrAqGh.js";import{u as Rt}from"./expenseAutomationHelper-jy143DnO.js";import"./recharts-BTL88W4R.js";import"./analytics-Y9Rn1Gu7.js";import"./plaid-Dw8l1kdg.js";import"./dnd-CwwWYFuT.js";import"./stripe-cKAAJElX.js";import"./lottie-ODKvpFjz.js";import"./lexical-CaftfZ9D.js";import"./pdf-DnQo5-Qw.js";import"./utils-DEAaFgLU.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},C=new a.Error().stack;C&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[C]="225a2e5d-e609-449c-8a8a-0ac025d100a8",a._sentryDebugIdIdentifier="sentry-dbid-225a2e5d-e609-449c-8a8a-0ac025d100a8")}catch{}})();const B="AppDrawer",c={root:`${B}-root`,drawer:`${B}-drawer`,appBar:`${B}-appBar`,menuButton:`${B}-menuButton`,appBarZenilogo:`${B}-appBarZenilogo`,drawerZenilogo:`${B}-drawerZenilogo`},Ut=ee("div",{slot:"Root"})((({theme:a})=>({[`&.${c.root}`]:{display:"flex"},[`& .${c.drawer}`]:{[a.breakpoints.up("md")]:{width:Q,flexShrink:0,backgroundColor:a.colors.background}},[`& .${c.appBar}`]:{color:a.colors.primary,backgroundColor:a.colors.background,boxShadow:"none"},"& .MuiToolbar-root":{backgroundColor:a.colors.background},[`& .${c.menuButton}`]:{marginRight:a.spacing(2),[a.breakpoints.up("md")]:{display:"none"}},[`& .${c.appBarZenilogo}`]:{fill:a.colors.primary,cursor:"pointer",width:"100%",marginLeft:a.spacing(-6)},[`& .${c.drawerZenilogo}`]:{margin:`${a.spacing(3)} ${a.spacing(3)} ${a.spacing(0)}`,fill:a.colors.primary,cursor:"pointer"}}))),Vt=tt((function({tenantEmailDomain:a}){const{isAiCfoOpen:C,setIsAiCfoOpen:b}=ot(),[V,A]=ya.useState(!1),[S,Ge]=o.useState(!1),t=Ta(),s=$a(),ae=xa(),te=st(),n=Me(),[Re,Ue]=o.useState(!1),j=rt(),ne=t.pathname.includes("/ai-cfo/");o.useEffect((()=>{ne||(n(K()),n(X()))}),[n,ne]),o.useEffect((()=>{n(K()),n(X())}),[n,a]);const{useFeatureGate:u}=it(),{isFeatureEnabled:oe}=u(m.isDebitCardFeatureEnabled),k=lt(),i=r((e=>Fe(e))),H=i.masterTOSInfo?.isMasterTOSAccepted??!1,{setLoading:Ve}=dt(),E=ct(),{isTaskManagerAccessEnabled:_,isZeniUser:je}=Gt(k),se=ut(),w=mt();o.useEffect((()=>{w&&E&&(n(Ie()),n(ve()))}),[n,w,i.tenantId,E]);const[N,He]=o.useState(void 0),Ne=!!i.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:Pe}=u(m.isChargeCardFeatureEnabled),Le=Ct(i,Pe,oe),{isFeatureEnabled:Oe}=u(m.isSettingsFeatureEnabled),{isFeatureEnabled:D}=u(m.isReferralFeatureEnabled),ze=i.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",re=r((e=>Aa(e)));o.useEffect((()=>{const e=()=>{Ue(window.scrollY>10)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}),[]);const P=r((e=>_a(e))),h=r((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),f=r((e=>Da(e))),{monthEndCloseChecksView:I}=f,Ye=R("/signout")!==null,M=R("/:tenantEmailDomain/dashboard")!==null,ie=R("/:tenantEmailDomain/reports")!==null,g=R("/:tenantEmailDomain/onboarding/*")!==null,le=Rt();o.useEffect((()=>{w&&D&&!g&&P.fetchState==="Not-Started"&&n(Ma(!0))}),[w,D,P.fetchState,g]),o.useEffect((()=>{if(le){const e=t.state?.origin;if(e!=null){const l=Fa(e);l!=null&&n(ye(l))}}}),[le,t.state]);const qe=Ye||g,L=r((e=>e.tenantState)),We=r((e=>L.fetchState==="Completed"?Za(e):[])),{isFeatureEnabled:Ke}=u(m.isApAgingFeatureEnabled),{isFeatureEnabled:Xe}=u(m.isArAgingFeatureEnabled),{isFeatureEnabled:Je}=u(m.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Qe}=u(m.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:ea}=u(m.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:aa}=u(m.isDashboardSidebarNewYearAnimationEnabled),ta=r((e=>$(e).totalUnreadCount)),na=r((e=>$(e).notificationDetailsByTab.tasks.uiState.unreadCount)),oa=r((e=>$(e).notificationDetailsByTab.comments.uiState.unreadCount)),sa=r((e=>$(e).reducedFetchCountState)),de=r((e=>$(e).notificationDetailsByTab.tasks.fetchCountState)),O=r((e=>Ga(e))),ra=r((e=>Ra(e).skillsEnabled)),ia=r((e=>Ua(e))),ce=r((e=>Va(e).routines)),la=o.useMemo((()=>ce.filter((e=>e.sessionId!=null)).map((e=>({cadence:pt(e),name:e.name,scheduleId:e.scheduleId,sessionId:e.sessionId,unreadRuns:e.unreadRuns})))),[ce]),da=new URLSearchParams(t.search).get("routine")??ht(t.pathname.split("/ai-cfo/")[1])??void 0,ca=o.useCallback(((e,l)=>{s(l!=null&&l!==""?`/${a}/ai-cfo/${encodeURIComponent(l)}`:`/${a}/ai-cfo/routines?routine=${encodeURIComponent(e)}`)}),[s,a]),{status:ue}=r(ja),[v,z]=o.useState(void 0),Y=O.uiState.currentChatSessionId,F=v!=null?O.deleteChatSessionStateByChatSessionId[v]?.fetchState:void 0,me=ft(F),{inboxNotifications:q,isLoading:Ce,isFetchingMore:pe,hasFetchedAll:he,fetchMore:ua}=Zt(),Z=r((e=>$(e).notificationDetailsByTab.comments.fetchCountState));o.useEffect((()=>{const e=setTimeout((()=>ua?.()),0);return()=>clearTimeout(e)})),o.useEffect((()=>{if(v!=null)return me==="In-Progress"&&F==="Completed"?(n(Te({chatSessionId:v})),z(void 0),void s(`/${a}/ai-cfo/explore`,{state:{...t.state,referrer:"Sidebar"}})):void(F==="Error"&&(n(Te({chatSessionId:v})),z(void 0)))}),[n,t.state,s,F,v,me,a]),o.useEffect((()=>{if(Ce===!1&&pe===!1&&he===!0&&i?.companyId!=null&&q!=null){const e=`dashboard_${i.companyId}`;He(q.filter((l=>l.roomId===e&&l.readAt==null)).length)}}),[Ce,pe,he,i?.companyId,q]),o.useEffect((()=>{w&&_&&!g&&de.fetchState==="Not-Started"&&ae.tenantId!=null&&n(Ha("task_manager","dashboard"))}),[w,_,g,de.fetchState,ae.tenantId,n]),o.useEffect((()=>{g||Z.fetchState!=="Not-Started"||n($e({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[g,Z.fetchState,n]),o.useEffect((()=>{if(N!=null){const{fetchState:e}=Z;e!=="In-Progress"&&e!=="Completed"||(e==="In-Progress"&&n($e({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),n(Ze({unreadCount:N},"comments")))}}),[N,Z.fetchState]);const ma={fetchStatus:sa,count:ta},y=[];Ke===!1&&y.push("accounts_payable_aging"),Xe===!1&&y.push("accounts_receivable_aging"),y.push("zeni_accounts_promo_card","treasury_promo_card"),D===!1&&y.push("rewards_card"),se===!1&&y.push("expense_automation_card");const fe=r((e=>Na(e,y).fetchState)),ge=r((e=>Pa(e).fetchState)),be=a!=null?gt.getSignedInUserTenant(a):null,Se=r((e=>be?.tenantId!=null?La(e,be.tenantId):void 0)),Ca=M&&(fe==="Completed"||fe==="Error")||ie&&(ge==="Completed"||ge==="Error")||!M&&!ie?void 0:"disabled",pa=o.useMemo((()=>Oa(i.userRole)),[i.userRole]),ha=za(pa),T=e=>{A(e)},fa=ze,ga=i?.rewardsLastViewedTime==null,ba=k?.userEmail!=null&&re.fetchState==="Completed"&&Ya(re.notificationSettings,k.userEmail,oe,i,_),Sa=o.useCallback((e=>{const l=t.state?.referrer;if(I.monthEndCloseChecks?.auditSummary!=null&&U.trackMonthCloseAuditPage(e.month,e.year,I.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",I.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,l??null),n(qa(i.tenantId,e)),h[i.tenantId]!=null){const x=p(t.state?.pathnameStackToGoBack,t.pathname);s(`/${a}/month_end_close_checks/review/${f.currentSelectedView}/${e.month}-${e.year}`,{state:{pathnameStackToGoBack:x,referrer:f.currentSelectedView}})}n(ye(f.currentSelectedView)),f.reconciliation.selectedAccountId!=null&&n(Wa({selectedAccountId:void 0}))}),[f.reconciliation.selectedAccountId,f.currentSelectedView,i.tenantId,I.monthEndCloseChecks?.auditSummary,I.monthEndCloseChecks?.reportEmailSentDate,h,a,t.state,t.pathname]),ka=o.useMemo((()=>({zIndex:S?12:Be[2]})),[S]),Ea=E&&bt(t),ke=d.jsx(St,{signedInUser:k,currentTenantId:L.currentTenantId??"",tenants:L.fetchState==="Completed"?We:Se!=null?[Se]:[],rewardsConfiguration:{isRewardsTabVisible:D,isRewardsAnimated:ga,rewardsPlan:P.rewardsPlan},selectedMenu:C===!0?Ae("ai_cfo"):xe(t)&&ue!=="completed"?Ae("invoicing"):Et(t),isTenantDropdownDisabled:Ca,isSettings:kt(t),isInvoicing:xe(t)&&ue==="completed",isSettingsFeatureEnabled:Oe,currentTenant:i,isVendorsTabVisible:ha,isZeniAccountEnabled:Ne,isChargeCardEnabled:Le,isTreasuryEnabled:fa,isNotificationsTabVisible:ba,notificationCountDetails:ma,isExpenseAutomationEnabledForUser:se,isAiCfoAccessEnabled:E,skillsEnabled:ra&&E,routinesEnabled:ia===!0&&E,routines:la,selectedRoutineId:da,onRoutineSelect:ca,onNotificationIconClick:()=>{T(!1);const e=je?na===0&&oa>0?"notifications/comments":"notifications/tasks":"notifications/comments",l=p(t.state?.pathnameStackToGoBack,t.pathname);s(`${a}/${e}`,{state:{pathnameStackToGoBack:l}})},onZeniLogoClick:()=>{te.toggle()},handleTenantSelect:e=>{Ve(Tt.TENANT_SWITCHING),T(!1),$t({dispatch:n,navigate:s,pathToNavigate:Bt(e.tenantEmailDomain,t),selectedTenant:e,signedInUser:k})},handleMenuChange:(e,l)=>{if(k!=null&&U.trackSidePanelClicked(e.type,e.group),T(!1),a==null)return;if(e.type==="routines")return H?(n(ve()),n(Ja()),void s(`/${a}/ai-cfo/routines`,{state:{pathnameStackToGoBack:p(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}})):void J({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});if(e.type==="skills")return H?(n(Ie()),n(Qa()),void s(`/${a}/ai-cfo/skills`,{state:{pathnameStackToGoBack:p(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}})):void J({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});if(n(K()),n(X()),e.type==="invoicing")return C&&b(!1),n(et({cacheOverride:!1})),void s(`../${a}/invoicing/overview`,{state:{pathnameStackToGoBack:p(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}});if(C&&It(e.type)&&b(!1),e.type==="ai_cfo"){if(U.trackAICFOChatScreenStateChanged("viewed","left_menu",Y??null,null),!H)return void J({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});const G=p(t.state?.pathnameStackToGoBack,t.pathname);return void s(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:G,referrer:"Sidebar"}})}const x=p(t.state?.pathnameStackToGoBack,t.pathname),W=e.type,we=At(W)&&W!=="command_center";if(W!=="command_center"&&!we||h[i.tenantId]==null||U.trackMonthEndCloseClicked(h[i.tenantId].month,h[i.tenantId].year,"Sidebar"),we&&h[i.tenantId]!=null){const G=h[i.tenantId];return void s(`/${a}/month_end_close_checks/review/${e.type}/${G.month}-${G.year}`,{state:{pathnameStackToGoBack:x,message:l,referrer:"Sidebar"}})}const va=vt(e.type);yt(e.type)?(Y!=null&&n(at()),s(`/${a}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:x.slice(0,-1),message:l,referrer:"Sidebar"}})):s(`../${a}/${va}`,{state:{pathnameStackToGoBack:x,message:l,referrer:"Sidebar"}})},onDeleteChatSession:e=>{n(Xa(e)),Y===e&&z(e)},handleLogOutClick:()=>{T(!1);const e=p(t.state?.pathnameStackToGoBack,t.pathname);s("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMyProfileClick:()=>{s(`${a}/settings/my_profile`)},handleReferralsClick:()=>{s(`${a}/rewards/refer`)},handleBackClick:()=>{s(`${a}/dashboard`)},handleCockpitClick:()=>{window.open("/cockpit")},monthEndCloseChecksView:I,onPeriodChange:Sa,onCalendarOpen:Ge,aiCfoView:O,isAiCfo:Ea,isOnDashboard:M,isTaskManagerAccessEnabled:_,updateCurrentChatSessionId:e=>{n(Ka({sessionId:e,agentId:"controller"})),s(`../${a}/ai-cfo/${e}`,{state:{...t.state}})},halloweenAnimationEnabled:Je,thanksGivingAnimationEnabled:Qe,christmasAnimationEnabled:ea,newYearAnimationEnabled:aa}),wa=d.jsx(_t,{position:"fixed",className:c.appBar,style:{borderBottom:Re?`1px solid ${j.colors.grey2}`:""},children:d.jsxs(Dt,{style:{minHeight:wt},children:[d.jsx(Mt,{color:"inherit","aria-label":"open drawer",edge:"start",onClick:()=>T(!0),className:c.menuButton,size:"large",children:d.jsx(jt,{})}),d.jsx(Ht,{className:c.appBarZenilogo,onClick:()=>{te.toggle()}})]})}),Ee=_e((e=>e.breakpoints.up("md"))),Ia=_e((e=>e.breakpoints.down("md")));return a==null?null:d.jsxs(Ut,{className:c.root,children:[d.jsx(Ft,{}),qe===!1?d.jsxs(d.Fragment,{children:[Ee||!M?null:wa,d.jsxs("nav",{className:c.drawer,children:[Ee?null:d.jsx(De,{container:window.document.body,variant:"temporary",open:V,onClose:()=>T(!1),PaperProps:{sx:{width:Q,zIndex:Be[2],borderRight:"none",backgroundImage:"none",backgroundColor:j.colors.background}},ModalProps:{keepMounted:!0},children:ke}),Ia?null:d.jsx(De,{PaperProps:{sx:{width:Q,borderRight:"none",backgroundImage:"none",backgroundColor:j.colors.background,...ka}},variant:"permanent",open:!0,children:ke})]})]}):null]})})),r1=({tenantEmailDomain:a})=>{const C=Me(),b=r((A=>Fe(A))),V={events:b.userRoleId!=null?[`private-encrypted-${b.userRoleId}.dashboard-user-notification`]:[],eventCallback:(A,S)=>{nt(S)&&Ba(S.mode)==="dashboard"&&C(Ze({unreadCount:S.data.unread},"tasks"))}};return d.jsx(Vt,{tenantEmailDomain:a,...V})},jt=ee((a=>o.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...a},o.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.604839 4.51889C0.333157 4.57797 0.0879194 4.8318 0.0182541 5.12602C-0.00534674 5.22569 -0.00534674 5.4412 0.0182541 5.54086C0.0523791 5.685 0.117181 5.80198 0.22956 5.92229C0.346814 6.04782 0.459133 6.11627 0.600351 6.14826C0.726193 6.17676 23.2738 6.17676 23.3997 6.14826C23.5409 6.11627 23.6532 6.04782 23.7704 5.92229C23.9348 5.74632 24 5.57908 24 5.33344C24 5.1793 23.9797 5.08352 23.9199 4.95575C23.8455 4.79698 23.6879 4.63709 23.5343 4.56468C23.3857 4.49468 24.2116 4.49926 11.9899 4.50058C2.66632 4.50157 0.669677 4.50479 0.604839 4.51889ZM0.669895 11.1732C0.365117 11.2113 0.0889356 11.4752 0.0182179 11.7958C-0.00468131 11.8996 -0.00469357 12.0996 0.0181935 12.2034C0.0806855 12.4867 0.305734 12.7294 0.581516 12.8108C0.65573 12.8327 1.1761 12.8337 12 12.8337C22.8591 12.8337 23.3441 12.8327 23.4192 12.8106C23.6933 12.7297 23.9196 12.4855 23.9818 12.2034C24.0047 12.0996 24.0047 11.8997 23.9818 11.7959C23.9201 11.516 23.7014 11.2776 23.425 11.1888C23.3558 11.1665 22.8817 11.1655 12.0544 11.164C5.84032 11.1631 0.717278 11.1672 0.669895 11.1732ZM0.594774 17.8516C0.458952 17.8831 0.344939 17.9535 0.22956 18.077C0.0652015 18.253 0 18.4202 0 18.6659C0 18.82 0.0203225 18.9158 0.0801289 19.0435C0.154452 19.2023 0.312097 19.3622 0.465726 19.4346C0.614214 19.5046 -0.209758 19.4999 12 19.4999C21.8294 19.4999 23.3082 19.4975 23.3881 19.4811C23.6596 19.4256 23.9122 19.1669 23.9817 18.8733C24.0053 18.7736 24.0053 18.5581 23.9817 18.4584C23.9476 18.3143 23.8828 18.1973 23.7704 18.077C23.6532 17.9515 23.5409 17.883 23.3997 17.851C23.2779 17.8235 0.713601 17.824 0.594774 17.8516Z",fill:"currentColor"}))))`
2
2
  height: 20px;
3
3
  width: 20px;
4
4
  color: ${a=>a.theme.colors.primary};
@@ -1 +1 @@
1
- import{j as u}from"./liveblocks-BPL36a6x.js";import{a as d}from"./sentry-_x3Yh1Jc.js";import{h as U,g as B,u as j,j as y,N as F,l as V,i as W,n as te,o as x}from"./core-DOBELRta.js";import{fF as P,YQ as w,Yx as R,HB as E,Hv as q,Hz as A,Ho as z,Yz as Y,Hs as ae,HD as oe,Hr as K,HG as G,HC as C}from"./zeni-epic-state-DXFYDM66.js";import{z as T,w as J,bZ as pe,o as O,bT as Q,b_ as le,E as Z,a8 as M,b$ as se,c0 as ne}from"./index-D0or4oV9.js";import"./mui-wO6EIETx.js";import{u as X,i as re}from"./ReimbursementApprovalRuleDetailScreen-uAvwHmVJ.js";import ie from"./NotFoundScreen-3qucmnjW.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="d85a50e5-e217-4122-9b22-bbf9146eab3b",e._sentryDebugIdIdentifier="sentry-dbid-d85a50e5-e217-4122-9b22-bbf9146eab3b")}catch{}})();const k="bill-approval-rule-update",ce=V((function(e){return{approvalView:w(e),billPaySetupApproverViewUpdateData:R(e).billPaySetupApproverViewUpdateData}}),(function(e,l){const{navigate:t,location:o}=l;return{onApprovalRulesEventReceived:a=>{a.endsWith(k)&&e(Y(!1))},onBackClick:()=>{O(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(z(a,!1))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))}}}))(J(pe)),ue=({isLoading:e})=>{const l=U(),t=B(),o=j(),[a,n]=d.useState(!1),[s,v]=d.useState(!1),p=y((r=>r.billPaySetupApproverViewState.fetchState)),f=y((r=>P(r))),c=y((r=>w(r))),S=y((r=>R(r).billPaySetupApproverViewUpdateData));if(d.useEffect((()=>{S?.updateStatus.fetchState==="Completed"&&o(E())}),[S]),d.useEffect((()=>{a||p!=="Not-Started"||e||(n(!0),o(q(!0,!0,!1)))}),[a,p,e,o]),T.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");d.useEffect((()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(s||(v(!0),o(A())),l("./new"))}),[s,c,o]);const g={events:f.companyId!=null?[`private-encrypted-${f.companyId}.${k}`]:[],eventCallback:(r,h,b)=>{r.endsWith(k)&&b.onApprovalRulesEventReceived(r)}};return f?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?u.jsx(F,{to:"../../promo"}):u.jsx(ce,{currentTenant:f,location:t,navigate:l,...g})},L="bill-approval-rule-update",de=V((function(e){const l=w(e),t=R(e).billPaySetupApproverViewUpdateData,o={};for(const n of Object.values(e.vendorState.vendorByID))n?.id!=null&&(o[n.id]=n.name);const a={};for(const n of Object.values(e.classState.classesByKey))n?.classId!=null&&(a[n.classId]=n.className);return{approvalView:l,billPaySetupApproverViewUpdateData:t,vendorNamesById:o,departmentNamesById:a}}),(function(e,l){const{navigate:t,location:o}=l;return{onApprovalRulesEventReceived:a=>{a.endsWith(L)&&e(Y(!1))},onBackClick:()=>{O(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(z(a,!0))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))},onReorderRules:a=>{e(oe(a,!0))}}}))(J(le)),ve=()=>{const e=y((o=>P(o))),{isApprovalRulesV3Enabled:l,isLoading:t}=Q(e?.tenantId);return l?u.jsx(fe,{isLoading:t}):u.jsx(ue,{isLoading:t})},fe=({isLoading:e})=>{const l=U(),t=B(),o=j(),[a,n]=d.useState(!1),[s,v]=d.useState(!1),[p,f]=d.useState(!1),c=y((i=>i.billPaySetupApproverViewState.fetchState)),S=y((i=>i.billPaySetupApproverViewState.approverListState.fetchStatus.fetchState)),g=y((i=>P(i)));X();const r=y((i=>w(i))),h=y((i=>R(i).billPaySetupApproverViewUpdateData));if(d.useEffect((()=>{h?.updateStatus.fetchState==="Completed"&&o(E())}),[h]),d.useEffect((()=>{a||c!=="Not-Started"||e||(n(!0),o(q(!0,!0,!0)))}),[a,c,e,o]),d.useEffect((()=>{s||S!=="Not-Started"||e||(v(!0),o(ae(!1,!0)))}),[s,S,e,o]),T.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");d.useEffect((()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(p||(f(!0),o(A())),l("./new"))}),[p,r,o]);const b={events:g.companyId!=null?[`private-encrypted-${g.companyId}.${L}`]:[],eventCallback:(i,I,m)=>{i.endsWith(L)&&m.onApprovalRulesEventReceived(i)}};return g?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?u.jsx(F,{to:"../../promo"}):u.jsx(de,{currentTenant:g,location:t,navigate:l,isLoading:e,...b})},ye=V((function(e,l){const t=R(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=o==="approval_create"&&t.allApprovalRules.length!==0;let n=t.allApprovalRules.length===0;return l.approvalRuleId&&(n=t.allApprovalRules.findIndex((s=>s.approvalRuleId===l.approvalRuleId))===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:n,approvalUpdateActionType:o}}),(function(e,l){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:n}=l,s=o.billPaySetupApproverViewUpdateData?.type,v=O(l.location);return{onApprovalRuleDataUpdated:p=>{const f=S=>{const g=[];return S.forEach((r=>{const h=r.actors.selectedUsers.map((I=>({type:"user",userId:I.userId,isImplicitActor:!1}))),b=r.actors.selectedNonUsers.map((I=>{const m=!!re(I.value);return{type:m?"attribute":"role",subType:I.value,userId:void 0,idType:void 0,isImplicitActor:!m}})),i=h.concat(b);g.push({action:r.stepType.selectedOption,actors:i,operator:i.length>1?r.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),g},c={amount:{type:"amount",comparator:"range",min:{amount:p.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:p.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(s==="approval_create"){const S={criteria:c,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(S))}else{const S={approvalRuleId:n,criteria:c,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(S))}},onResetClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(G(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(se);function Se(){const e=U(),l=j(),t=B(),{approvalRuleId:o}=W(),a=T.getSignedInUser(),n=Z(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(d.useEffect((()=>{p||(f(!0),l(K(!0)))})),d.useEffect((()=>{v.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[v,o]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?u.jsx(M,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):u.jsx(ye,{navigate:e,approvalUpdateDataView:s,approvalRuleId:o,approverViewData:v,location:t})}const ge=V((function(e,l){const t=R(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=[],n={};for(const s of Object.values(e.vendorState.vendorByID))s?.id!=null&&(a.push(s.id),n[s.id]=s.name);return{localData:t,approvalUpdateActionType:o,allVendorIds:a,vendorNamesById:n,editingRuleId:o==="approval_update"?l.approvalRuleId:void 0,allApprovalRulesWithUser:w(e).allApprovalRules}}),(function(e,l){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:n}=l,s=o.billPaySetupApproverViewUpdateData?.type,v=O(l.location);return{onApprovalRuleDataUpdated:p=>{const f=i=>{const I=[];return i.forEach((m=>{const N=m.actorKind?.selectedOption,ee=m.selectedRole?.selectedNonUsers??[];let D=[];N==="role"?D=ee.map((_=>({type:"attribute",subType:_.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):N==="specific_person"&&(D=(m.persons?.selectedUsers??[]).map((_=>({type:"user",userId:_.userId,isImplicitActor:!1}))));const $=m.action??"require_approval";I.push({action:$,actors:D,operator:D.length>1?$==="require_approval"?"or":"and":"is"})})),I},c=p.amountCriteria,S=p.vendorCriteria,g=p.departmentCriteria,r={};if(c!=null&&c.comparator.selectedOption!=null){const i=c.comparator.selectedOption;r.amount={type:"amount",comparator:i,min:i==="less_than"?void 0:c.min,max:i==="greater_than"?void 0:c.max}}const h=S?.selection.selectedOptions??[];h.length>0&&(r.vendor={type:"vendor",operator:S?.operator.selectedOption??"is",vendorIds:h});const b=g?.selection.selectedOptions??[];if(b.length>0&&(r.department={type:"department",operator:g?.operator.selectedOption??"is",departmentIds:b}),s==="approval_create"){const i={name:p.name,description:p.description,separationOfDuties:p.separationOfDuties,criteria:r,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(i))}else{const i={approvalRuleId:n,name:p.name,description:p.description,separationOfDuties:p.separationOfDuties,criteria:r,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(i))}},onResetClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(G(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:p=>{e(A(p)),t(s==="approval_update"?`../../${p}/edit`:`../${p}/edit`)}}}))(ne);function H(){const e=y((t=>P(t))),{isApprovalRulesV3Enabled:l}=Q(e?.tenantId);return l?u.jsx(me,{}):u.jsx(Se,{})}function me(){const e=U(),l=j(),t=B(),{approvalRuleId:o}=W(),a=T.getSignedInUser(),n=Z(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(X(),d.useEffect((()=>{p||(f(!0),l(K(!1)))})),d.useEffect((()=>{v.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[v,o]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?u.jsx(M,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):u.jsx(ge,{navigate:e,approvalUpdateDataView:s,approvalRuleId:o,approverViewData:v,location:t},o??"new")}function xe(){return u.jsxs(te,{children:[u.jsx(x,{path:"/",element:u.jsx(ve,{})}),u.jsx(x,{path:"/new",element:u.jsx(H,{})}),u.jsx(x,{path:"/:approvalRuleId/edit",element:u.jsx(H,{})}),u.jsx(x,{path:"*",element:u.jsx(ie,{})})]})}export{xe as B};
1
+ import{j as u}from"./liveblocks-DR8KfETq.js";import{a as d}from"./sentry-FwaDhTzy.js";import{h as U,g as j,u as B,j as y,N as F,l as V,i as W,n as te,o as x}from"./core-Dh_SHcAD.js";import{fF as P,YV as w,YC as R,HF as E,Hz as q,HD as A,Hs as K,YE as Y,Hw as ae,HH as oe,Hv as z,HK as G,HG as C}from"./zeni-epic-state-DJh0-ZeR.js";import{z as T,w as J,bZ as pe,n as O,bT as Z,b_ as le,E as M,a8 as Q,b$ as se,c0 as ne}from"./index-BeqOty_5.js";import"./mui-BYn_Ugho.js";import{u as X,i as re}from"./ReimbursementApprovalRuleDetailScreen-Cs7pkBs7.js";import ie from"./NotFoundScreen-zRiKZg68.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="b197b088-bf80-46f8-8cfa-87d27e69f3c0",e._sentryDebugIdIdentifier="sentry-dbid-b197b088-bf80-46f8-8cfa-87d27e69f3c0")}catch{}})();const k="bill-approval-rule-update",ce=V((function(e){return{approvalView:w(e),billPaySetupApproverViewUpdateData:R(e).billPaySetupApproverViewUpdateData}}),(function(e,l){const{navigate:t,location:o}=l;return{onApprovalRulesEventReceived:a=>{a.endsWith(k)&&e(Y(!1))},onBackClick:()=>{O(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(K(a,!1))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))}}}))(J(pe)),ue=({isLoading:e})=>{const l=U(),t=j(),o=B(),[a,n]=d.useState(!1),[s,v]=d.useState(!1),p=y((r=>r.billPaySetupApproverViewState.fetchState)),f=y((r=>P(r))),c=y((r=>w(r))),S=y((r=>R(r).billPaySetupApproverViewUpdateData));if(d.useEffect((()=>{S?.updateStatus.fetchState==="Completed"&&o(E())}),[S]),d.useEffect((()=>{a||p!=="Not-Started"||e||(n(!0),o(q(!0,!0,!1)))}),[a,p,e,o]),T.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");d.useEffect((()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(s||(v(!0),o(A())),l("./new"))}),[s,c,o]);const g={events:f.companyId!=null?[`private-encrypted-${f.companyId}.${k}`]:[],eventCallback:(r,h,b)=>{r.endsWith(k)&&b.onApprovalRulesEventReceived(r)}};return f?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?u.jsx(F,{to:"../../promo"}):u.jsx(ce,{currentTenant:f,location:t,navigate:l,...g})},L="bill-approval-rule-update",de=V((function(e){const l=w(e),t=R(e).billPaySetupApproverViewUpdateData,o={};for(const n of Object.values(e.vendorState.vendorByID))n?.id!=null&&(o[n.id]=n.name);const a={};for(const n of Object.values(e.classState.classesByKey))n?.classId!=null&&(a[n.classId]=n.className);return{approvalView:l,billPaySetupApproverViewUpdateData:t,vendorNamesById:o,departmentNamesById:a}}),(function(e,l){const{navigate:t,location:o}=l;return{onApprovalRulesEventReceived:a=>{a.endsWith(L)&&e(Y(!1))},onBackClick:()=>{O(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(K(a,!0))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))},onReorderRules:a=>{e(oe(a,!0))}}}))(J(le)),ve=()=>{const e=y((o=>P(o))),{isApprovalRulesV3Enabled:l,isLoading:t}=Z(e?.tenantId);return l?u.jsx(fe,{isLoading:t}):u.jsx(ue,{isLoading:t})},fe=({isLoading:e})=>{const l=U(),t=j(),o=B(),[a,n]=d.useState(!1),[s,v]=d.useState(!1),[p,f]=d.useState(!1),c=y((i=>i.billPaySetupApproverViewState.fetchState)),S=y((i=>i.billPaySetupApproverViewState.approverListState.fetchStatus.fetchState)),g=y((i=>P(i)));X();const r=y((i=>w(i))),h=y((i=>R(i).billPaySetupApproverViewUpdateData));if(d.useEffect((()=>{h?.updateStatus.fetchState==="Completed"&&o(E())}),[h]),d.useEffect((()=>{a||c!=="Not-Started"||e||(n(!0),o(q(!0,!0,!0)))}),[a,c,e,o]),d.useEffect((()=>{s||S!=="Not-Started"||e||(v(!0),o(ae(!1,!0)))}),[s,S,e,o]),T.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");d.useEffect((()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(p||(f(!0),o(A())),l("./new"))}),[p,r,o]);const b={events:g.companyId!=null?[`private-encrypted-${g.companyId}.${L}`]:[],eventCallback:(i,I,m)=>{i.endsWith(L)&&m.onApprovalRulesEventReceived(i)}};return g?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?u.jsx(F,{to:"../../promo"}):u.jsx(de,{currentTenant:g,location:t,navigate:l,isLoading:e,...b})},ye=V((function(e,l){const t=R(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=o==="approval_create"&&t.allApprovalRules.length!==0;let n=t.allApprovalRules.length===0;return l.approvalRuleId&&(n=t.allApprovalRules.findIndex((s=>s.approvalRuleId===l.approvalRuleId))===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:n,approvalUpdateActionType:o}}),(function(e,l){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:n}=l,s=o.billPaySetupApproverViewUpdateData?.type,v=O(l.location);return{onApprovalRuleDataUpdated:p=>{const f=S=>{const g=[];return S.forEach((r=>{const h=r.actors.selectedUsers.map((I=>({type:"user",userId:I.userId,isImplicitActor:!1}))),b=r.actors.selectedNonUsers.map((I=>{const m=!!re(I.value);return{type:m?"attribute":"role",subType:I.value,userId:void 0,idType:void 0,isImplicitActor:!m}})),i=h.concat(b);g.push({action:r.stepType.selectedOption,actors:i,operator:i.length>1?r.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),g},c={amount:{type:"amount",comparator:"range",min:{amount:p.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:p.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(s==="approval_create"){const S={criteria:c,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(S))}else{const S={approvalRuleId:n,criteria:c,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(S))}},onResetClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(G(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(se);function Se(){const e=U(),l=B(),t=j(),{approvalRuleId:o}=W(),a=T.getSignedInUser(),n=M(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(d.useEffect((()=>{p||(f(!0),l(z(!0)))})),d.useEffect((()=>{v.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[v,o]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?u.jsx(Q,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):u.jsx(ye,{navigate:e,approvalUpdateDataView:s,approvalRuleId:o,approverViewData:v,location:t})}const ge=V((function(e,l){const t=R(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=[],n={};for(const s of Object.values(e.vendorState.vendorByID))s?.id!=null&&(a.push(s.id),n[s.id]=s.name);return{localData:t,approvalUpdateActionType:o,allVendorIds:a,vendorNamesById:n,editingRuleId:o==="approval_update"?l.approvalRuleId:void 0,allApprovalRulesWithUser:w(e).allApprovalRules}}),(function(e,l){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:n}=l,s=o.billPaySetupApproverViewUpdateData?.type,v=O(l.location);return{onApprovalRuleDataUpdated:p=>{const f=i=>{const I=[];return i.forEach((m=>{const N=m.actorKind?.selectedOption,ee=m.selectedRole?.selectedNonUsers??[];let D=[];N==="role"?D=ee.map((_=>({type:"attribute",subType:_.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):N==="specific_person"&&(D=(m.persons?.selectedUsers??[]).map((_=>({type:"user",userId:_.userId,isImplicitActor:!1}))));const $=m.action??"require_approval";I.push({action:$,actors:D,operator:D.length>1?$==="require_approval"?"or":"and":"is"})})),I},c=p.amountCriteria,S=p.vendorCriteria,g=p.departmentCriteria,r={};if(c!=null&&c.comparator.selectedOption!=null){const i=c.comparator.selectedOption;r.amount={type:"amount",comparator:i,min:i==="less_than"?void 0:c.min,max:i==="greater_than"?void 0:c.max}}const h=S?.selection.selectedOptions??[];h.length>0&&(r.vendor={type:"vendor",operator:S?.operator.selectedOption??"is",vendorIds:h});const b=g?.selection.selectedOptions??[];if(b.length>0&&(r.department={type:"department",operator:g?.operator.selectedOption??"is",departmentIds:b}),s==="approval_create"){const i={name:p.name,description:p.description,separationOfDuties:p.separationOfDuties,criteria:r,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(i))}else{const i={approvalRuleId:n,name:p.name,description:p.description,separationOfDuties:p.separationOfDuties,criteria:r,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(i))}},onResetClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(G(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:p=>{e(A(p)),t(s==="approval_update"?`../../${p}/edit`:`../${p}/edit`)}}}))(ne);function H(){const e=y((t=>P(t))),{isApprovalRulesV3Enabled:l}=Z(e?.tenantId);return l?u.jsx(me,{}):u.jsx(Se,{})}function me(){const e=U(),l=B(),t=j(),{approvalRuleId:o}=W(),a=T.getSignedInUser(),n=M(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(X(),d.useEffect((()=>{p||(f(!0),l(z(!1)))})),d.useEffect((()=>{v.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[v,o]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?u.jsx(Q,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):u.jsx(ge,{navigate:e,approvalUpdateDataView:s,approvalRuleId:o,approverViewData:v,location:t},o??"new")}function xe(){return u.jsxs(te,{children:[u.jsx(x,{path:"/",element:u.jsx(ve,{})}),u.jsx(x,{path:"/new",element:u.jsx(H,{})}),u.jsx(x,{path:"/:approvalRuleId/edit",element:u.jsx(H,{})}),u.jsx(x,{path:"*",element:u.jsx(ie,{})})]})}export{xe as B};
@@ -0,0 +1,119 @@
1
+ import{j as t}from"./liveblocks-DR8KfETq.js";import{h as K,u as le,g as X,i as ae,j as k,N as ee,l as Q,q as it,n as ot,o as f}from"./core-Dh_SHcAD.js";import{fF as Z,Yc as Ue,bq as ka,Sd as lt,bo as wa,bJ as de,Yd as Ba,GV as Ca,Ii as Ve,Hw as st,bn as Ae,Ye as rt,Yf as ct,c8 as dt,Yg as ut,l$ as xa,Yh as Aa,Yi as Ea,IM as _e,Hc as Ce,Yj as pt,GJ as ta,Yk as mt,MB as bt,GN as ht,GT as Da,Yl as Se,Ym as Me,Ij as Ne,H9 as Ta,Yn as gt,Yo as St,Im as Oe,Yp as yt,Is as ft,Yq as ja,HX as na,I0 as It,Yr as vt,Ys as ce,Yt as Pa,Yu as Fa,Yv as Ra,gV as kt,Hh as $e,cG as Va,Yw as wt,gh as Bt,Yx as Ct,Yy as xt,d_ as $a,dZ as La,Yz as Ye,YA as At,YB as Et,WN as ze,YC as Dt,WO as ie,WP as He,YD as Tt,YE as jt,YF as Pt,I2 as ia,H$ as Ft,YG as Rt,YH as Vt,YI as $t,HN as Lt,YJ as Gt,YK as Ut,cu as Ga,da as Ua,ma as _t,bO as Mt,br as _a,bP as Ma,FZ as Nt,YL as Ot,Mo as Yt,Mu as zt,C9 as Ht,Ik as Zt,IT as Wt,mn as ge,YM as qt,YN as Na,mR as Jt,mh as Oa,mC as Ya,mB as oa,bE as pe,bN as Kt,YO as Xt,YP as ye,kN as Qt,YQ as la,YR as en,kR as an,la as tn,J5 as nn,YS as on,mK as ln,IX as sn,YT as sa,I$ as rn,J4 as cn,J2 as dn,IV as un,YU as za,H2 as pn,YV as mn,YW as bn,gG as hn,gF as gn,gE as Sn,mq as yn,mI as ra,mT as fn,uT as In,mz as vn,IZ as kn,kX as wn,mY as Bn,YX as Cn,kP as xn,uK as An,YY as En,HT as Dn,bK as Tn,bt as jn,Uc as Pn,dd as Fn,dc as Rn,cF as Vn,cM as $n}from"./zeni-epic-state-DJh0-ZeR.js";import{E as ue,z as L,Q as fe,at as Ze,c as oe,A as g,bj as We,a8 as se,F as A,a9 as Ee,j,bv as Ln,a5 as H,aw as qe,p as T,a2 as Ie,bw as ca,bx as da,by as Gn,aA as Un,ag as _n,aT as Mn,ac as Ha,G as De,ah as Je,bz as Nn,af as Za,bA as On,ar as Yn,S as Wa,w as zn,bB as Hn,bC as Zn,bD as Wn,bE as qn,bF as Jn,bG as Kn,bH as Xn,bI as Qn,bJ as ei,O as ai,bK as ti,bs as ni,bL as ii,aj as oi,bM as li,g as si}from"./index-BeqOty_5.js";import{n as U,S as ri}from"./mui-BYn_Ugho.js";import{A as ua}from"./AddressScreen-DcUrSOsf.js";import{g as ne,a as Te,i as qa,V as Ke,b as Xe,c as ci,v as di,d as ui,A as me,D as be}from"./DomesticWireDetailScreen-CVW4GyMY.js";import{a as S}from"./sentry-FwaDhTzy.js";import{u as Qe}from"./useAskAiCfoHostNavButtonProps-BnkkGFrU.js";import{u as Ja}from"./useInitialThreadRequest-AIPuwXqX.js";import{u as pi}from"./BusinessVerificationPageScreen-DJA0DrrC.js";import xe from"./NotFoundScreen-zRiKZg68.js";import{D as mi}from"./DrawerScreen-_ojy_hFg.js";import{M as Ka}from"./MobileAppDrawer-BnS3AEOn.js";import{F as Xa}from"./FeaturePreviewScreen-BoONdT_D.js";import{S as je}from"./SetupPagesScreen-DyVC5Tjr.js";import{B as bi}from"./BillPayApprovalRoutes-Cjvq2rbF.js";import{F as hi}from"./ScreenRoutes-0QveS_Gw.js";import"./recharts-BTL88W4R.js";import"./analytics-Y9Rn1Gu7.js";import"./plaid-Dw8l1kdg.js";import"./dnd-CwwWYFuT.js";import"./stripe-cKAAJElX.js";import"./lottie-ODKvpFjz.js";import"./lexical-CaftfZ9D.js";import"./pdf-DnQo5-Qw.js";import"./utils-DEAaFgLU.js";import"./routePaths-CN71IXC6.js";import"./InboxNotificationsProvider-D6QvVVj8.js";import"./useTaskManagerAccess-DJBrAqGh.js";import"./analyticsHelper-b_0JgbzW.js";import"./ReimbursementApprovalRuleDetailScreen-Cs7pkBs7.js";import"./getLocaleForTenant-CCfef8lM.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]="d4aac65a-6ff2-4604-8e64-d41a069f0eae",e._sentryDebugIdIdentifier="sentry-dbid-d4aac65a-6ff2-4604-8e64-d41a069f0eae")}catch{}})();const gi=Q((function(e,a){const l=Ue(e,a.billId),n=L.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=H(a.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;Ae(n)||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let i=!1,d=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:y,isMarkAsPaidBtnVisible:h}=rt(l.billActivities,ct(a.currentTenant),n);i=y,d=h}const p=dt(a.currentTenant?.userRole??[]),m=l.transactionDetails!=null&&ut(l.transactionDetails,p,n);return{billDetails:l,isAccountingClassesEnabled:xa(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:p,isRealTimeApprovalEnabled:a.isRealTimeApprovalEnabled,showApproveRejectBtns:i,showMarkAsPaidButtonToApprover:d,hasZeniAssistAccess:a.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:m}}),(function(e,a){const{billId:l,currentTenant:n,location:c,navigate:r}=a,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ne(u),s=T(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=T(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Se({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Da(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(ht(l,s))},onSaveRealTimeApprovals:o=>{e(bt(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(mt({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(ta(l,o.type,"")):e(ta(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ce(l,"retry")):e(Ce(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Te(u,o,s),d=T(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=H(a.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=T(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(pt({billId:a.billId}))},onRefundPaymentClick:()=>{e(Ce(a.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Ea({data:i,billId:l})),e(_e(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(Aa({billId:l}))}}}))(Ln);function Si(){const e=K(),a=le(),l=X(),{billId:n}=ae(),c=ue(),r=L.getSignedInUser(),u=fe(),o=k((z=>Z(z))),s=k((z=>Ue(z,n??""))),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Ja(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Qe({mobileExploreReferrer:"Bill Details"});Ze({isDataReady:s.fetchState==="Completed"});const y=o?.userRole!=null&&ka(o?.userRole),h=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!y,[b,I]=S.useState(!1),[E,C]=S.useState(!1),[x,_]=S.useState(!1),{useFeatureGate:D,useDynamicConfig:B}=oe(),{isFeatureEnabled:N}=D(g.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:V}=D(g.isBillPayCommentingEnabled),{isFeatureEnabled:W}=D(g.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=B(We.zeniAssistConfig),v=lt(o),Y=wa(o.userRole),M=h&&de(u?.loggedInUserRoleMap),$=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:q}=D(g.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:J}=D(g.billPaySetupShowInternationalPaymentByWise);if(S.useEffect((()=>{N&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&v===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(Y||M||s.allApprovers.find((z=>z.user.userId===r?.userId))!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))}),[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,Y,M,o.isZeni,v,r]),S.useEffect((()=>{n!=null&&a(Ba(n))}),[n]),S.useEffect((()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(I(!0),a(Ca(n??"",N,$,!1)))}),[b,s,n,a]),S.useEffect((()=>{E||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(C(!0),a(Ve(!1,N,$,J,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&a(st()))}),[E,s,n,a,N,$,J]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?t.jsx(ee,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?t.jsx(se,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${A.sp1} ${c.colors.dropShadowNormal}`}}):t.jsxs(t.Fragment,{children:[t.jsx(Ee,{analytics:j,onLoad:z=>(G=>{n!=null&&G.trackBillPayBillDetails(n,s.isRecurring)})(z)}),t.jsx(gi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:N,location:l,navigate:e,isBillPayCommentingEnabled:V,isRealTimeApprovalEnabled:x,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:q,hasZeniAssistAccess:$,isDetectInsufficientFundsEnabled:W,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const Le=De.getLocalizedStrings().spendManagement.billPay.billDetails,pa=De.getLocalizedStrings().common,yi={containerWidth:new Ha(100,58)},ma=Q((function(e,a){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=a.showActionButtons,u=r&&a.file==null;return{uploadInvoiceEndPoint:`${Za.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:a.billId,file:a.file,showAutofill:a.showAutofill,analytics:j,entityId:a.billId,showTitlebarIcon:r,showTitlebar:r&&a?.file!=null,uploadStatus:a.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:A.sp10,paddingRight:A.sp3,paddingBottom:"15px",paddingLeft:A.sp5,...a.showAutofill?{}:{backgroundColor:a.backgroundColor,paddingBottom:"128px"}}}}),(function(e,a){const l=L.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(a.file!=null||a.billId!=null||a.isInitialEdit?(a.setPayload(n),a.setShowConfirmationPopup(!0)):e(Oe(n,a.isVendorRecommendationEnabled,a.billId)))},updateInvoiceUploadFetchState:n=>{e(ft({fetchState:{fetchState:n,error:void 0},billId:a.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(Ne(n))},onDeleteClick:()=>{e(yt({billId:a.billId})),j?.trackInvoiceActionClick(a.billStage??"","delete",l?.userEmail??"",null)}}}))(Mn);function w({appContent:e}){const a=le(),l=K(),{billId:n}=ae(),c=X(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=Ie(),s=ue(),i=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=oe(),{isFeatureEnabled:m}=d(g.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=d(g.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:h}=d(g.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(g.billPaySetupShowInternationalPaymentByWise),{configValue:I}=p(We.zeniAssistConfig),E=I.user_ids!=null&&i?.userId!=null&&I.user_ids.includes(i?.userId),C=k((F=>Z(F)));pi();const[x,_]=S.useState(!1),[D,B]=S.useState(!1),[N,V]=S.useState(!1),[W,O]=S.useState(),v=k((F=>Me(F,m,h,n)));let Y=v.fetchState,M=v.file,$=v.showAutofill;const q=k((F=>Ue(F,n??"")));u===!1&&(Y=q.fetchState,M=q.transactionDetails?.attachments?.[0],$=!1);const J=v.billPayInfo!=null&&v.billPayInfo.stage.code==="pending_approval"?v.billPayInfo.billStatus.code:v.billStage;S.useEffect((()=>{n==null&&a(Ne(!0))}),[n,a]),S.useEffect((()=>{Y==="Not-Started"&&(u&&D?B(!1):!u&&x&&_(!1))}),[n]),S.useEffect((()=>{x||n==null||u||(_(!0),a(Ca(n,y,E,!1)),a(Ta(n)),D||(B(!0),a(Ve(!1,y,E,b,n)))),u&&!D&&(B(!0),a(Ve(!1,y,E,b,n)))}),[x,D,u,n,a,y,E,b]);const z={onOkClick:()=>{if(V(!1),!W)return;const F=M!=null?"replace":"upload";j?.trackInvoiceActionClick(J??"",F,i?.userEmail??"","yes"),a(St({replaceBillData:!0,billId:n})),a(Oe(W,m,n))},onCancelClick:()=>{if(V(!1),!W)return;const F=M!=null?"replace":"upload";j?.trackInvoiceActionClick(J??"",F,i?.userEmail??"","no"),a(gt({file:W,billId:n}))}},G=S.useCallback((()=>{const F=H(c.state?.pathnameStackToGoBack),ve=F.poppedPathname??ne(C.tenantEmailDomain);a(Se({billId:n})),l(ve,{state:{pathnameStackToGoBack:F.newStack}})}),[c.state,C.tenantEmailDomain,n,a,l]);if(i==null)throw Error("Can't access address page without signing in...");if(Y==="Error"||q.fetchState==="Error")return t.jsx(xe,{});if(Y!="Completed")return n==null&&o!=="small"?t.jsx(ca,{fallback:G,children:t.jsxs(Pe,{windowSize:o,children:[t.jsx(ha,{}),t.jsx(Fe,{}),t.jsx(ma,{backgroundColor:s.colors.grey4,billId:n,file:M,showAutofill:!0,uploadStatus:v.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:V,setPayload:O,showActionButtons:!1,isInitialEdit:!!v.isInitialEdit,billStage:J}),t.jsx(Re,{windowSize:o,children:t.jsx(da,{isNewBill:!0})})]})}):t.jsxs(Pe,{windowSize:o,children:[o==="small"||$?null:t.jsx(ba,{children:t.jsx(Qa,{onClick:G,"data-testid":"nav-bar-back-click"})}),o!=="small"?t.jsx(Fe,{}):null,t.jsx(Gn,{}),t.jsx(Re,{windowSize:o,children:t.jsx(da,{isNewBill:n==null})})]});{const F=v.billPayInfo!=null&&v.billPayInfo.stage.code==="pending_approval"?v.billPayInfo.billStatus.code:v.billStage;return t.jsx(ca,{fallback:G,children:t.jsxs(Pe,{windowSize:o,children:[$&&o!=="small"?t.jsx(ha,{}):null,N?t.jsx(Un,{titleComponent:t.jsx(Ci,{children:Le.overwriteTitle}),descriptionComponent:t.jsx(xi,{children:Le.overwriteDescription}),primaryButtonText:pa.yes,secondaryButtonText:pa.no,action:z,isEditPopup:!0}):null,o==="small"||$?null:t.jsx(ba,{children:t.jsx(fi,{})}),o!=="small"?t.jsx(Fe,{}):null,t.jsx(ma,{backgroundColor:s.colors.grey4,billId:n,file:M,showAutofill:$,uploadStatus:v.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Ii(u,q,v),setShowConfirmationPopup:V,setPayload:O,showActionButtons:vi(u,v),isInitialEdit:!!v.isInitialEdit,billStage:F}),t.jsx(Re,{windowSize:o,children:e})]})})}}function fi(){const{triggerBack:e}=Nn();return t.jsx(Qa,{onClick:e,"data-testid":"nav-bar-back-click"})}function Ii(e,a,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=a.transactionDetails?.recurringBillInstance,c=a.recurringBillConfigDetail?.totalPaymentCycles),a?.isRecurring===!0?t.jsxs(ki,{children:[t.jsx(wi,{children:`${Le.recurringBill.recurringCycle}
2
+ ${n}/${c}`}),t.jsx(Bi,{})]}):void 0}function vi(e,a){const l=a.billActivities?.[0],n=a.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(a.billStage==="draft"||n)}const ba=U.div`
3
+ margin-bottom: 20px;
4
+ margin-top: 20px;
5
+ margin-left: ${A.sp5};
6
+ position: absolute;
7
+ display: flex;
8
+ align-items: center;
9
+ `,ki=U.div`
10
+ display: flex;
11
+ justify-content: center;
12
+ align-items: center;
13
+ padding-top: 9px;
14
+ gap: ${A.sp2};
15
+ margin-bottom: -${A.sp2};
16
+ `,wi=U(Je.StandardMedium)``,Bi=U((e=>S.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},S.createElement("path",{d:"M3.35001 15L3.35001 10.125C3.35001 6.81129 6.0363 4.125 9.35001 4.125H16.475M16.475 4.125L13.85 1.5M16.475 4.125L13.85 6.75",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M20.6 9V13.875C20.6 17.1887 17.9137 19.875 14.6 19.875H7.47501M7.47501 19.875L10.1 22.5M7.47501 19.875L10.1 17.25",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))))`
17
+ color: ${e=>e.theme.colors.hero};
18
+ height: ${A.sp3};
19
+ width: ${A.sp3};
20
+ `,Qa=U((e=>S.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},S.createElement("path",{d:"M10 13L5 8L10 3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}))))`
21
+ width: ${A.sp3};
22
+ height: ${A.sp3};
23
+ cursor: pointer;
24
+ color: ${e=>e.theme.colors.champion};
25
+ &:hover {
26
+ color: ${e=>e.theme.colors.primary};
27
+ }
28
+ `,Pe=U.div`
29
+ display: flex;
30
+ height: 100vh;
31
+ flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
32
+ background-color: ${e=>e.theme.colors.grey4};
33
+ position: relative;
34
+ &::after {
35
+ content: "";
36
+ position: absolute;
37
+ top: 57px;
38
+ left: 42%;
39
+ width: 1px;
40
+ height: calc(100% - 57px);
41
+ background-color: ${e=>e.theme.colors.grey2};
42
+ pointer-events: none;
43
+ z-index: 3;
44
+ display: ${e=>e.windowSize==="small"?"none":"block"};
45
+ }
46
+ `,Fe=U.div`
47
+ position: absolute;
48
+ top: 56px;
49
+ left: 0;
50
+ width: 42%;
51
+ height: 1px;
52
+ background-color: ${e=>e.theme.colors.grey2};
53
+ z-index: 3;
54
+ `,ha=U.div`
55
+ position: fixed;
56
+ top: 0;
57
+ left: 0;
58
+ right: 0;
59
+ bottom: 0;
60
+ background-color: ${_n.overlayBackgroundBlack};
61
+ z-index: 5;
62
+ `,Re=U.div`
63
+ display: flex;
64
+ flex-direction: column;
65
+ width: ${e=>`${yi.containerWidth.value(e.windowSize)}%`};
66
+ ${e=>e.windowSize!=="small"?"overflow: auto;":""}
67
+ `,Ci=U(Je.H6Regular)`
68
+ margin-top: ${A.sp7};
69
+ padding-left: ${A.sp8};
70
+ padding-right: ${A.sp8};
71
+ color: ${e=>e.theme.colors.primary};
72
+ word-break: break-word;
73
+ `,xi=U(Je.LargeRegularSp)`
74
+ color: ${e=>e.theme.colors.hero};
75
+ padding-left: ${A.sp8};
76
+ padding-right: ${A.sp8};
77
+ margin-bottom: 30px;
78
+ margin-top: ${A.sp4};
79
+ white-space: pre-line;
80
+ `,Ai=Q((function(e,a){return{billsReviewView:ja(e),analytics:a.analytics}}),(function(e,a){return{onCloseOverlay:()=>{a.navigate(`/${a.tenantEmailDomain}/bills`),e(ce())},onCloseReviewItem:l=>{e(vt(l))},onProceedForBulkActionClick:(l,n)=>{switch(l){case"send_for_approval":e(It());break;case"approve":case"review":e(na("approved",n??""));break;case"reject":e(na("rejected",n??""))}}}}))(On);function Ei({tenantEmailDomain:e}){const a=K(),l=k((c=>c.billsBulkActionViewState.bulkSubmissionFetchState.fetchState)),{billsForReview:n}=k((c=>ja(c)));return S.useEffect((()=>{l!=="Completed"&&n.length!==0||a(`/${e}/bills`)}),[l,n.length,e]),t.jsx(Ai,{navigate:a,analytics:j,tenantEmailDomain:e})}const te=Et(),et="bulk-operation-update",Ge="bill-approval-rule-update",{common:we}=De.getLocalizedStrings(),Di=U.div`
81
+ display: flex;
82
+ min-height: 100%;
83
+ width: 100%;
84
+ flex: 1 1 auto;
85
+ flex-direction: column;
86
+ align-items: center;
87
+ background-color: ${e=>e.theme.colors.grey4};
88
+ `,Ti=Q((function(e,a){const l=L.getSignedInUser(),n=Ae(l),c=Ra(e,te,a.isBulkActionEnabled,l?.userId);let r=c.allSubTabs;a.isUserHasOnlyBillpayAccess&&a.roleMap&&c.currentTab==="pending_approval"&&(a.roleMap.bill_pay_analyst?r=r.filter((b=>b==="all"||b==="overdue"||b==="rejected"||b==="deleted")):a.roleMap.bill_pay_approver&&(r=r.filter((b=>b==="all"||b==="awaiting_my_approval"||b==="overdue"||b==="rejected"||b==="deleted")))),a.isShowDeletedBillsEnabled===!1&&(r=r.filter((b=>b!=="deleted")));const u=e.entityAutoCompleteState.autoCompleteText.common,o=ze(e,"common"),s=e.tenantState.currentTenantId,i=Z(e),d=i?.companyName??"",p={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},m=e.billListState.downloadUIState.downloadState,y=c.fetchState,h=Dt(e);return{transactionList:a.isShowDeletedBillsEnabled?c.transactions:c.transactions.filter((b=>b.isDeleted===!1)),currentTab:c.currentTab,currentSubTab:c.currentSubTab,approvalCount:c.approvalCount,allSubTabs:r,fetchState:y,analytics:j,botEmail:c.billPayBotEmail,searchText:c.searchText,filters:c.filters,vendorSearchAutoCompleteData:{autoCompleteText:u,entityAutoCompleteView:o},downloadParams:{authParams:p,companyName:d,timePeriod:te,spendManagementEndPoint:`${qe}/spendManagement`,isShowDeletedBillsEnabled:a.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:a.isShowDeletedReimbursementEnabled},downloadState:m,isBulkActionAllowed:c.billListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:c.billListBulkActionInfo?.billsSelectedForBulkAction,allowedBulkActions:c.billListBulkActionInfo?.allowedBulkActions,isZeniUser:n,billPayApprovalRulesAffectedEntityIds:h.affectedEntityIds}}),(function(e,a){const{navigate:l,currentTenant:n,location:c,period:r}=a,{tenantEmailDomain:u}=n;return{updateTabToState:o=>{e(ce()),e(Pa(o))},onSubtabChange:o=>{e(ce()),e(Fa(o))},onTransactionClick:(o,s)=>{const i=Te(u,o,s),d=T(c.state?.pathnameStackToGoBack,c.pathname);l(i,{state:{pathnameStackToGoBack:d}})},onClickSetupIcon:()=>{const o=Pi(u),s=T(c.state?.pathnameStackToGoBack,c.pathname);l(o,{state:{pathnameStackToGoBack:s}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=a.currentTenant;j?.trackBillPayNewBill();const s=`/${o}/bill/new`,i=T(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i}})},onSearchTextChanged:o=>{e(Gt(o))},onReloadTransactions:()=>{e($e(r,!0,a.isShowDeletedBillsEnabled,a.isInternationalWireEnabled)),e(Lt(n.companyId,!0))},onNavigateToSettings:()=>{l("../bills/setup")},onBackClick:()=>{l("../",{relative:"path"})},onFiltersChange:o=>{e($t({filters:o})),o.categories.every((s=>s.field!=null&&s.values?.length!==0))&&j.trackSpendManagmentFilterChange("bill_pay",o.categories.map((s=>`${s.field}-${JSON.stringify(s.values)}`)))},updateDownloadStateHandler:o=>{o==="In-Progress"&&j.trackSpendManagementDownloadClick("bill_pay"),e(Vt({uiState:{downloadState:o}}))},updateBulkActionList:o=>{e(Rt(o))},removeAllTransactionsFromBulkActionList:()=>{e(ce())},onProceedForBulkActionClick:(o,s)=>{switch(o){case"delete":case"cancel":e(Ft(o,s??""));break;case"send_for_approval":e(ia("send_for_approval")),a.navigate("./bulk-review");break;case"approve":e(ia("approve")),a.navigate("./bulk-review");break;case"review":e(Pt()),a.navigate("./bulk-review")}},onBillPayApprovalRulesEventReceived:o=>{o.endsWith(Ge)&&e(jt(!1))},onEventReceived:o=>{o===et&&e(Tt())},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(He({searchString:o,entityType:"vendor",searchOrigin:"common"})):o.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}}}}))(zn(Hn));function ji(){const e=K(),a=le(),l=X(),n=Ie(),c=l.state,r=fe(),[u,o]=S.useState(!1),[s,i]=S.useState(null),d=it("/:tenantEmailDomain/bills/bulk-review")!=null;S.useEffect((()=>(c?.tab!=null&&c?.subTab!=null&&(a(Pa(c?.tab)),a(Fa(c?.subTab))),()=>{a(ce())})),[]);const p=L.getSignedInUser(),m=k((P=>Z(P))),{areTenantIdsInSync:y}=Yn(),[h,b]=S.useState(!1),{useFeatureGate:I}=oe(),{isFeatureEnabled:E}=I(g.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:C}=I(g.isBillPayCommentingEnabled),{isFeatureEnabled:x}=I(g.isReimbursementCommentingEnabled),{isFeatureEnabled:_}=I(g.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:D}=I(g.isBillPayBulkActionEnabled),{isFeatureEnabled:B}=I(g.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:N}=I(g.isBillPayDetectInsufficientFundsEnabled),V=k((P=>Ra(P,te,D,p?.userId))),{isFeatureEnabled:W}=I(g.isDebitCardFeatureEnabled),O=V.fetchState,{isAiCfoAccessEnabled:v,onAskAiCfoClick:Y}=Qe({mobileExploreReferrer:"Bills List"});Ze({isDataReady:O==="Completed"});const M=!!m.companyBillPayInfo?.info?.isBillPayTOSAccepted,$=!!m.companyBillPayInfo?.info?.isBillPayEnabled,q=k((P=>kt(P.companyState,m.companyId))),J=q?.company.featuresActivationInfo.connectedAccountProvider;if(S.useEffect((()=>{!h&&$&&y&&(b(!0),a($e(te,!0,E,B)))}),[h,te,y,a]),p==null)throw Error("Can't access address page without signing in...");const z=(P,re)=>{a(At({uiState:{sortKey:P,sortOrder:re},period:te}))},G=Va(r?.loggedInUserRoleMap),F=de(r?.loggedInUserRoleMap),ve=P=>{o(P)},{billsProcessed:ke,billsProcessing:ea}=k((P=>wt(P)));S.useEffect((()=>{ke===ea&&s!=null&&(a(Bt({messageSection:"bill_pay_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_bill_",variableValue:ke>1?we.headers.bills:we.texts.bill2},{variableName:"_has_",variableValue:ke>1?we.texts.have:we.texts.has},{variableName:"_action_",variableValue:Ct(s)}]})),a(xt()),setTimeout((()=>{a($e(te,!0,E,!0,B))}),3e3),i(null))}),[ke,ea]);const at={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${et}`,`private-encrypted-${m.companyId}.${Ge}`]:[],eventCallback:(P,re,aa)=>{P.endsWith(Ge)?aa.onBillPayApprovalRulesEventReceived?.(P):re?.entity_type==="bill"&&(i(re.operation_type),aa.onEventReceived(P))}},tt=$a(W,m),nt=La(m);return l.pathname.endsWith("/bills/")||l.pathname.endsWith("/bills")||l.pathname.endsWith("/bills/bulk-review")?tt===!0||nt===!0?t.jsx(Xa,{}):$?t.jsxs(t.Fragment,{children:[O==="Completed"?t.jsx(Ee,{analytics:j,onLoad:P=>(re=>re.trackPageLoaded(Wa.Event.billPayHome))(P)}):null,t.jsxs(Di,{windowSize:n,children:[t.jsx(Ka,{isAppContentDrawerOpen:u,handleDrawerToggle:ve}),t.jsx(mi,{isOpen:d,drawerLeftMargin:new Ha(0,0,300,600),onClose:()=>{e(`/${m.tenantEmailDomain}/bills`),a(ce())},children:t.jsx(Fi,{onClick:P=>P.stopPropagation(),children:t.jsx(Ei,{tenantEmailDomain:m.tenantEmailDomain})})}),t.jsx(Ti,{location:l,navigate:e,currentTenant:m,entity:"bill_pay",isBillPayCommentingEnabled:C,isReimbursementCommentingEnabled:x,period:te,isAdmin:!1,uiState:V.uiState,onColumnSortConfigChanged:z,isUserHasOnlyBillpayAccess:G,isShowDeletedBillsEnabled:E,isShowDeletedReimbursementEnabled:_,isBulkActionEnabled:D,roleMap:r?.loggedInUserRoleMap,onClickMenuIcon:()=>{ve(!0)},isDownloadEnabled:V.isDownloadEnabled,connectedAccountProvider:J,bulkSubmissionLimit:V.billBulkSubmissionLimit,bulkSubmissionFetchState:V.billListBulkActionInfo.bulkSubmissionFetchState,isRecurringBillInBulkActionList:V.billListBulkActionInfo.isRecurringBillInBulkActionList,isInternationalWireEnabled:B,isDetectInsufficientFundsEnabled:N,isAiCfoAccessEnabled:v,onAskAiCfoClick:Y,...at})]})]}):M===!0&&F===!0?t.jsx(ee,{to:"../setup"}):r!=null&&Ye(m,r.loggedInUserRoleMap)?t.jsx(ee,{to:"../promo"}):t.jsx(se,{fetchState:O}):t.jsx(xe,{})}const Pi=e=>`/${e}/bills/setup`,Fi=U(ri)`
89
+ display: flex;
90
+ min-height: 100%;
91
+ flex-direction: column;
92
+ `,{common:{currency:he},spendManagement:{billPay:{billDetails:Ri}},appName:Vi}=De.getLocalizedStrings(),$i=Q((function(e,a){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=H(a.location.state?.pathnameStackToGoBack);let u=!0;r.poppedPathname?.includes("bills")===!0&&(u=!1);const o=e.entityAutoCompleteState.autoCompleteText.common,s=ze(e,"common");let i=`${l?.firstName} ${l?.lastName}`;const d=Ae(l);a.billId!=null&&a.billDetailsView!=null&&(i=`${a.billDetailsView.createdBy?.firstName??Vi} ${a.billDetailsView.createdBy?.lastName??""}`),d||!a.billDetailsView.createdBy?.email?.includes("zeni.ai")||(i="Zeni");const p=a.billDetailsView.editBillInitialDetails?.totalAmount?.amount,m=Mt(a.billDetailsView.paymentDetailsSection?.paymentType?.method),y=a.currentTenant.createTime,h=_a(),b=a.sameDayAchDisablementConfig.newTenantTenureLimitMonths,I=y.add(b,"month").isAfter(h),E=!!(a.billDetailsView.billStage==="draft"&&m&&p!=null&&p>0)&&!Ma(p,a.billDetailsView.approvalRules.allApprovalRules,l,a.billDetailsView.vendor?.id,a.billDetailsView.classId),C=Z(e);return{billDetails:a.billDetailsView,isAccountingClassesEnabled:xa(e),billId:a.billId,createdBy:i,createTime:a.billDetailsView?.createTime,authParams:c,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,analytics:j,showBackButton:u,isAdmin:a.isBillPayAdmin,isSuperAdmin:a.isSuperAdmin,connectedAccountProvider:C.company?.featuresActivationInfo.connectedAccountProvider??"",customerSearchAutoCompleteData:{autoCompleteText:o,entityAutoCompleteView:s},showMarkAsPaidInfo:E,isZeniUser:d,isNewUser:I,sameDayAchDisablementConfig:a.sameDayAchDisablementConfig}}),(function(e,a){const{billId:l,companyId:n,currentTenant:c,location:r,navigate:u,billDetailsView:o}=a,{tenantEmailDomain:s}=c;return{editVendor:i=>{e(oa(i));const d=Sa(s,i,l),p=T(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},chooseNewVendor:i=>{const d=i??a.billDetailsView.addBillAutoFields.tentativeVendorName;d!=null&&e(Oa(d,!1)),e(Ya({localData:{vendorName:i??a.billDetailsView.addBillAutoFields.tentativeVendorName}})),e(oa());const p=Sa(s,void 0,l),m=T(r.state?.pathnameStackToGoBack,r.pathname);u(p,{state:{pathnameStackToGoBack:m}})},onInvoiceUpload:i=>{i!=null&&e(Oe(i,a.isVendorRecommendationEnabled))},updateShowAutofill:i=>{e(Ne(i))},onSaveChangesToLocalStore:(i,d,p,m,y)=>{const h=_i(a.billDetailsView,{...i,paymentDetails:{...i?.paymentDetails,paymentDate:y}},p,d,a.isInternationalPaymentShaVsOurEnabled,m,a.vendor);e(Jt({billDetailLocalData:h,billId:l}))},saveBillDetails:()=>{e(_e("draft",!1,!1,l)),e(ie("common"))},updateBillDetailSaveBillCode:()=>{e(Na("draft"))},reviewBillDetails:()=>{const i=Li(s,l),d=T(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d,message:"coming_from_edit_page"}})},discardBillDetailsFromLocalStore:({billId:i})=>{e(Se({billId:i}))},clearBillPayReviewLocalState:()=>e(qt()),onClickDismiss:()=>{const i=ne(s),d=T(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d}})},onClickDiscard:()=>{const i=ne(s),d=T(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d}})},setBillDetailPageMode:i=>{if(i==="edit_bill"){let d=window.location.pathname;d=d.concat("/edit");const p=T(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})}},redirectToACHScreen:i=>{e(ge(!1,i));const d=Gi(s,i,l),p=T(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToWireScreen:i=>{e(ge(!1,i));const d=Ui(s,i,l),p=T(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToInternationalScreen:i=>{e(ge(!1,i));const d=qa(s,l,i),p=T(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToBillsScreen:()=>{const i=ne(s),d=T(r.state?.pathnameStackToGoBack,r.pathname);e(Se({})),u(i,{state:{pathnameStackToGoBack:d}})},redirectToBillDetailPage:()=>{a.navigate("../")},deleteBill:()=>{l!=null&&e(Da(l))},onAttachmentClick:(i,d)=>{const p=Te(s,i,d);window.open(`${p}`,"_blank")},onBackClick:()=>{const i=H(a.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ne(s);u(d,{state:{pathnameStackToGoBack:i.newStack}})},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(He({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}},addVendorContactEmail(i,d){e(Wt(i,d,l))},onWiseVerifyClick:()=>{let i="";i=Jn()?"https://sandbox.transferwise.tech":"https://wise.com";const d=`${i}/login`;window.open(d,"_blank")},onVendorSelected:i=>{e(Zt(!0,i,l))},onInternationalWireVerifyClick:()=>{window.open(`/${s}/bills/international-wire`)},onFetchLinkTokenClick:(i,d)=>{e(Ht("bill_pay_detail",i,d))},onEstablishConnectionClick:i=>{e(zt(i,n,"bill_pay_detail","bill_pay"))},onUpdatePaymentAccountStatus:(i,d,p)=>{e(Yt(i,d,"bill_pay","bill_pay_detail",p))},onEstablishConnectionSuccess:()=>{e(Nt("bill_pay","bill_pay_detail")),e(Ot({billId:l,withdrawFromAccountId:o.newAddedBillPaymentAccountId,withdrawFromList:o.withdrawFromList}))}}}))(Zn);function ga(){const e=K(),a=X(),l=le(),{billId:n,tenantEmailDomain:c}=ae(),{useFeatureGate:r,useDynamicConfig:u}=oe(),{isFeatureEnabled:o,isFeatureGateLoading:s}=r(g.isVendorMagicLinkFeatureEnabled),{isFeatureEnabled:i}=r(g.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:d}=r(g.isBillPayCommentingEnabled),{isFeatureEnabled:p}=r(g.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:m}=r(g.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=r(g.isRecurringBillsFeatureEnabled),{isFeatureEnabled:h}=r(g.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=r(g.isShaDisabled),{isFeatureEnabled:I}=r(g.isOurDisabled),{isFeatureEnabled:E}=r(g.isBillPayDetectInsufficientFundsEnabled),{configValue:C}=u(We.sameDayAchDisablementConfig),x=Ut(C),_=L.getSignedInUser(),D=k((G=>Z(G))),B=k((G=>Me(G,m,h,n))),N=Ja(D?.companyId,{clearParams:B.fetchState==="Completed"}),{isAiCfoAccessEnabled:V,onAskAiCfoClick:W}=Qe({mobileExploreReferrer:"Bill Details"});Ze({isDataReady:B.fetchState==="Completed"});const O=D.companyId??L.getSignedInUserTenant(c)?.companyId,v=fe(),Y=Ga(v?.loggedInUserRoleMap),M=Ua(v?.loggedInUserRoleMap),$=de(v?.loggedInUserRoleMap),q=wa(D.userRole);if(S.useEffect((()=>{n!=null&&l(Ba(n))}),[n]),S.useEffect((()=>{n!=null&&l(Ta(n))}),[n,l]),_==null)throw Error("Can't access address page without signing in...");const J=k((G=>_t(G.accountState,G.accountListState,"billPayAccountList"))),z={pathname:"../",search:a.search};return B.isDeleted===!0||B.billStage=="paid"||B.fetchState=="Not-Started"?t.jsx(ee,{to:z}):B.deleteStatus.fetchState==="In-Progress"||s?t.jsx(se,{fetchState:B.deleteStatus.fetchState}):t.jsxs(t.Fragment,{children:[t.jsx(Ee,{analytics:j,onLoad:G=>(F=>{n!=null&&B.deleteStatus.fetchState!=="Completed"&&F.trackBillPayEditBill(n,B.isRecurring)})(G)}),t.jsx($i,{initialOpenThreadRequest:N??void 0,location:a,navigate:e,currentTenant:D,billId:n,companyId:O,billDetailsView:B,isMagicLinkEnabled:o,isVendorRecommendationEnabled:m,isLocalCurrencyEnabled:p,uncategorizedAccounts:J,isInternationalPaymentShaVsOurEnabled:i,vendor:B.vendor,isBillPayCommentingEnabled:d,isShaDisabled:b,isOurDisabled:I,isRecurringBillsFeatureEnabled:y,hasZeniAccountsAdminAccess:Y,isZeniAccountsUser:M,isBillPayAdmin:$,isSuperAdmin:q,isDetectInsufficientFundsEnabled:E,sameDayAchDisablementConfig:x,isAiCfoAccessEnabled:V,onAskAiCfoClick:W})]})}const Sa=(e,a,l)=>{let n=`/${e}/bill/`;return l==null?n=a!=null?n.concat(`new/vendor/${encodeURIComponent(a)}/edit`):n.concat("new/vendor/create"):(n=n.concat(`${encodeURIComponent(l)}/edit/vendor/`),n=a!=null?n.concat(`${encodeURIComponent(a)}/edit`):n.concat("create")),n},Li=(e,a)=>{let l=`/${e}/bill/`;return l=a===void 0?l.concat("new/review"):l.concat(`${a}/edit/review`),l},Gi=(e,a,l)=>{let n=`/${e}/bill/`;return n=l!=null?n.concat(`${encodeURIComponent(l)}/edit/`):n.concat("new/"),n=n.concat(`vendor/${encodeURIComponent(a)}/edit/ach`),n},Ui=(e,a,l)=>{let n=`/${e}/bill/`;return n=l!=null?n.concat(`${encodeURIComponent(l)}/edit/`):n.concat("new/"),n=n.concat(`vendor/${encodeURIComponent(a)}/edit/domestic`),n},R="paymentDetails",_i=(e,a,l,n,c,r,u)=>{const o={invoiceNumber:a.whatFor.invoiceNumber,memo:a.whatFor.memo,invoiceDate:a.whatFor.invoiceDate?pe(a.whatFor.invoiceDate.toString()):_a(),billDueDate:a.whatFor.billDueDate?pe(a.whatFor.billDueDate.toString()):void 0,currencyCode:a.whatFor.currency,recipientCurrencyCode:a.whatFor.recipientCurrency,isInvoiceDateAutoUpdated:a.whatFor.isInvoiceDateAutoUpdated},s={paymentDate:a[R]?.paymentDate?pe(a[R].paymentDate.toString()):void 0,paymentType:a[R]?.paymentType!=null?a[R]?.paymentType:void 0,paymentTo:r?.id,withdrawFrom:e.withdrawFromList.find((b=>b.id===a[R]?.withdrawFrom?.selectedOption)),internationalTransferFeeBearerPaymentMethod:a[R]?.paymentType?.method!=null&&a[R].paymentType.method.includes(Kt)&&u?.vendorCurrencyCode===he.currencyCode&&c?a[R]?.internationalTransferFeeBearerPaymentMethod:void 0,conversionRate:e.paymentDetailsSection?.conversionRate},i=r?.type==="Contact"?r?.email:void 0,d=!!i,p=a[R]?.recurringPaymentType?.selectedOption===Ri.recurringBill.paymentTypeOptions[1],m={isActive:e.recurringConfig?.isActive??!1,currentInstance:e.recurringConfig?.currentInstance,isApprovalRequired:a[R]?.recurringPaymentDetails?.requireApproval?.selectedOption==="all",frequency:Xt(a[R]?.recurringPaymentDetails?.frequency?.selectedOption),endDate:a[R]?.recurringPaymentDetails?.endDateSelector?.date!=null?pe(a[R]?.recurringPaymentDetails?.endDateSelector.date.toString()):void 0,startDate:a[R]?.recurringPaymentDetails?.startDate?pe(a[R]?.recurringPaymentDetails?.startDate.toString()):void 0,endDateSelectorOptionType:a[R]?.recurringPaymentDetails?.endDateSelector?.type,totalPaymentCycles:a[R]?.recurringPaymentDetails?.endDateSelector?.recurringCount??0,updateRecurringBills:a[R]?.recurringPaymentDetails?.updateRecurringBills},y=Mi(e.accountList.accounts,e.classList.classes,e.lineDetailSection,a.lineItems,n,l),h=Object.keys(y).length>0?Wn(y):e.editBillInitialDetails?.recipientTotalAmount;return{showVendorGptRecommendationText:e.showVendorGptRecommendationText,vendor:u,whatForSection:o,paymentDetailsSection:s,isCancelled:e.isCancelled,totalAmount:h,recipientTotalAmount:h,file:e.file,updatesByLineId:y,toAccountVendorEmail:i,isCollectToAccountInfoFromVendorContact:d,isRecurring:p,recurringConfig:m}},Mi=(e,a,l,n,c,r)=>{const u={};return n.forEach((o=>{let s,i;o.account.selectedOption!=null&&(s=e.find((p=>p.qboId===o.account.selectedOption||p.accountId===o.account.selectedOption))),o.class?.selectedOption!=null&&(i=a.find((p=>p.classId===o.class.selectedOption)));const d=qn(l[o.lineId],o,c,r);u[o.lineId]={...l[o.lineId],...o,platformLineDetailType:l[o.lineId]?.platformLineDetailType??"account_based_expense_line_detail",amount:{amount:o.amount??0,currencyCode:o.currency?.currencyCode??he.currencyCode,currencySymbol:o.currency?.currencySymbol??he.currencySymbol},recipientAmount:{amount:o.recipientAmount??0,currencyCode:o.recipientCurrency?.currencyCode??he.currencyCode,currencySymbol:o.recipientCurrency?.currencySymbol??he.currencySymbol},id:o.lineId,lineDescription:o.lineDescription??"",account:s,class:i,billable:o.billable?.selectedOption??"not_billable",customer:{id:d?.id??"",name:d?.name??"",qboId:d?.qboId,logo:d?.logo},type:"journal_entry_transaction_line",isCategoryMiscategorized:!1,isClassMiscategorized:!1}})),u},Ni=U.div`
93
+ display: flex;
94
+ height: 100vh;
95
+ width: 100%;
96
+ flex: 1 1 auto;
97
+ flex-direction: column;
98
+ align-items: center;
99
+ background-color: ${e=>e.theme.colors.grey4};
100
+ box-shadow: ${e=>`0px 2px ${A.sp1} ${e.theme.colors.dropShadowNormal}`};
101
+ `,Oi=Q((function(e,a){const{vendorId:l,billId:n}=a,c=ye(e,l),r=Me(e,a.isVendorRecommendationEnabled,a.isZeniAccountsFeatureEnabled,n);return{billId:n,isDisabled:c.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:c,file:r.file,bankAccountContext:a.bankAccountContext}}),(function(e,a){const{billId:l,navigate:n,location:c,vendorId:r,currentTenant:u}=a,{tenantEmailDomain:o}=u;return{onFetchBankNameBySwift:s=>{e(tn(s))},onSaveHandler:()=>{e(an(a.bankAccountContext,r))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:i}=s;e(en({data:i}))},onCancel:()=>{(()=>{const s=H(c.state?.pathnameStackToGoBack),i=s.poppedPathname??ya();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(la())},onAddressClick:s=>{const i=Xe(o,s,l),d=T(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(Qt({fetchState:"Not-Started"}));const s=H(a.location.state?.pathnameStackToGoBack),i=s.poppedPathname??ya(0);a.navigate(i,{state:{pathnameStackToGoBack:s.newStack}}),e(la())}}}))(Kn);function Yi(){const e=K(),a=X(),l=Ie(),{vendorId:n,billId:c}=ae(),{useFeatureGate:r}=oe(),u=ue(),o=L.getSignedInUser(),s=k((h=>Z(h))),i=H(a.state?.pathnameStackToGoBack),d=i.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail",p=k((h=>ye(h,n))),{isFeatureEnabled:m}=r(g.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=r(g.isDepositAccountsFeatureEnabled);if(o==null)throw Error("Can't access address page without signing in...");return d==="billDetail"&&p.editVendorState?.saveStatus.fetchState==="In-Progress"?t.jsx(se,{fetchState:p.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:u.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${u.colors.dropShadowNormal}`}}):t.jsxs(Ni,{windowSize:l,children:[t.jsx(Ke,{vendorId:n,billId:c}),t.jsx(Oi,{location:a,navigate:e,billId:c,vendorId:n,currentTenant:s,bankAccountContext:d,isVendorRecommendationEnabled:m,isZeniAccountsFeatureEnabled:y})]})}const ya=(e=2)=>{let a="../";for(let l=0;l<e;l++)a=`${a}../`;return a},zi=U.div`
102
+ display: flex;
103
+ height: 100vh;
104
+ width: 100%;
105
+ flex: 1 1 auto;
106
+ flex-direction: column;
107
+ align-items: center;
108
+ background-color: ${e=>e.theme.colors.grey4};
109
+ box-shadow: ${e=>`0px 2px ${A.sp1} ${e.theme.colors.dropShadowNormal}`};
110
+ `,Hi=Q((function(e,a){const{vendorId:l}=a,n=ye(e,l),c=l!=null?n.editVendorState?.vendorDetailLocalData?.vendorType:n.newVendorState?.vendorDetailLocalData?.vendorType,r=on(e,c||"international_business",a.billId),u=n.editVendorState??n.newVendorState,o=a.billId!=null?e.editBillDetailViewState.editBillStateById[ln(a.billId)].billDetailLocalData.recipientTotalAmount?.amount:e.editBillDetailViewState.newBillState.billDetailLocalData.recipientTotalAmount?.amount;return{internationalWireView:r,vendorViewDetails:n,bankAccountContext:a.bankAccountContext,vendorType:c||"international_business",addressType:"vendor_address",addressToEdit:u?.vendorNewAddressStatus?.addressToCreate,mailingAddress:u?.vendorAddress,billAmount:o??0}}),(function(e,a){const{billId:l,navigate:n,location:c,vendorId:r,currentTenant:u}=a,{tenantEmailDomain:o}=u;return{onSaveHandler:()=>{e(un(a.bankAccountContext,r))},onAccountDetailsUpdated:(s,i,d,p)=>{e(cn(s)),p&&e(dn(i,d))},onCurrencyUpdated:(s,i,d)=>{e(rn(s,i,d,!1))},onCancel:()=>{(()=>{const s=H(c.state?.pathnameStackToGoBack),i=s.poppedPathname??fa();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(sa())},onAddressClick:s=>{const i=Xe(o,s,l),d=T(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(sn({fetchState:"Not-Started"}));const s=H(a.location.state?.pathnameStackToGoBack),i=s.poppedPathname??fa(0);a.navigate(i,{state:{pathnameStackToGoBack:s.newStack}}),e(sa())}}}))(Xn);function Zi(){const e=K(),a=X(),l=Ie(),{vendorId:n,billId:c}=ae(),r=le(),u=ue(),o=L.getSignedInUser(),s=k((x=>Z(x))),i=H(a.state?.pathnameStackToGoBack),[d,p]=S.useState(!1),m=k((x=>x.vendorViewState.newVendorState.fetchStatus.fetchState)),y=k((x=>n!=null?x.vendorViewState.editVendorStateById[n]?.fetchStatus.fetchState??"Not-Started":"Not-Started")),h=n!==void 0?y:m;S.useEffect((()=>{d===!1&&h==="Not-Started"&&n!=null&&(r(ge(!1,n)),p(!0))}),[d,h,n]);const[b,I]=S.useState(!1);S.useEffect((()=>{b||h==="In-Progress"||(I(!0),r(nn(c,n)))}),[b,h,r]);const E=i.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail",C=k((x=>ye(x,n)));if(o==null)throw Error("Can't access international wire page without signing in...");return E==="billDetail"&&C.editVendorState?.saveStatus.fetchState==="In-Progress"?t.jsx(se,{fetchState:C.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:u.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${u.colors.dropShadowNormal}`}}):t.jsxs(zi,{windowSize:l,children:[t.jsx(Ke,{vendorId:n,billId:c}),t.jsx(Hi,{location:a,navigate:e,billId:c,vendorId:n,currentTenant:s,bankAccountContext:E})]})}const fa=(e=2)=>{let a="../";for(let l=0;l<e;l++)a=`${a}../`;return a},Ia=U.div`
111
+ display: flex;
112
+ height: 100vh;
113
+ width: 100%;
114
+ flex: 1 1 auto;
115
+ flex-direction: column;
116
+ align-items: center;
117
+ background-color: ${e=>e.theme.colors.grey4};
118
+ box-shadow: ${e=>`0px 2px ${A.sp1} ${e.theme.colors.dropShadowNormal}`};
119
+ `,Wi=Q((function(e,a){const l=L.getSignedInUser(),n=za(e,a.billId),c=mn(e),r=Ae(l),u=n.totalAmount.amount,o=n.billPayInfo?.stage.code!=="scheduled"&&c.allApprovalRules.length>0&&!Ma(u,c.allApprovalRules,l,n.vendor?.id,n.classId);return{billDetails:n,billId:a.billId,billpayApprovalView:c,analytics:j,isApprovalRequiredForMarkAsPaid:o,isZeniUser:r}}),(function(e,a){const{location:l,billId:n,currentTenant:c,navigate:r}=a,{tenantEmailDomain:u}=c;return{redirectToBillsScreen:()=>{const o=ne(c.tenantEmailDomain),s=T(l.state?.pathnameStackToGoBack,l.pathname);r(o,{state:{pathnameStackToGoBack:s}})},discardBillDetailsFromLocalStore:()=>{e(Se({}))},saveBillDetails:(o,s)=>{o&&e(Ea({billId:n,data:s})),e(_e(o?"paid":"pending_approval",o,!1,n))},discardOutsideZeniPaymentData:()=>{e(Aa({billId:n}))},updateBillDetailSaveBillCode:()=>{e(Na("pending_approval"))},onClickEdit:()=>{a.navigate("../",{relative:"path"})},onAttachmentClick:(o,s)=>{const i=Te(u,o,s);window.open(`${i}`,"_blank")},retryPayment:()=>{a.billId!=null&&e(Ce(a.billId,"retry"))}}}))(ei);function va(){const e=K(),a=le(),l=X(),{billId:n}=ae(),{useFeatureGate:c}=oe(),{isFeatureEnabled:r}=c(g.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:u}=c(g.isBillPayDetectInsufficientFundsEnabled),o=Ie(),s=L.getSignedInUser(),{isFeatureEnabled:i}=c(g.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:d}=c(g.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:p}=c(g.isBillPayCommentingEnabled),m=H(l.state?.pathnameStackToGoBack),{poppedPathname:y}=m,{isFeatureEnabled:h}=c(g.isRecurringBillsFeatureEnabled),b=k((C=>Z(C))),I=k((C=>za(C,n))),E=I.fetchState??"Not-Started";if(S.useEffect((()=>(window.onbeforeunload=function(){return e(l,{state:{message:""}}),!0},()=>{window.onbeforeunload=null})),[e]),S.useEffect((()=>{l.state?.message!=="coming_from_edit_page"&&e(`../${n}`)}),[]),S.useEffect((()=>{const C=I.vendor?.name,x=I.vendor?.id,_=I.totalAmount.amount,D=I.recipientTotalAmount.amount,B=I.invoiceNumber;C&&x&&a(pn(C,x,_,D,B,n))}),[]),y==null)return t.jsx(ee,{to:`../${n}`});if(s==null)throw Error("Can't access address page without signing in...");return E==="In-Progress"?t.jsx(Ia,{windowSize:o,children:t.jsx(Qn,{})}):t.jsx(Ia,{windowSize:o,children:t.jsx(Wi,{location:l,navigate:e,currentTenant:b,billId:n,isBillPayCommentingEnabled:p,isLocalCurrencyEnabled:i,isVendorRecommendationEnabled:d,isInternationalPaymentShaVsOurEnabled:r,isRecurringBillsFeatureEnabled:h,isDetectInsufficientFundsEnabled:u})})}const qi=Q((function(e,a){const{vendorId:l}=a,n=e.entityAutoCompleteState.autoCompleteText.common,c=ze(e,"common"),r=l!=null?"edit":"create",u=Z(e),o=L.getSignedInUser(),s=u.tenantId,i={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:s??""};return{vendorViewDetails:a.vendorViewDetails,screenType:r,filesEndPoint:`${Za.fileMicroServiceBaseUrl}`,authParams:i,analytics:j,vendorSearchAutoCompleteData:{autoCompleteText:n,entityAutoCompleteView:c}}}),(function(e,a){const{billId:l,currentTenant:n,navigate:c,location:r,vendorId:u,themeState:o}=a,{tenantEmailDomain:s}=n;return{onSaveVendor:i=>{e(xn(u??void 0,a.billId)),i!=null&&e(An(i))},saveVendorDetailLocalData:i=>{e(Ya({vendorId:u,localData:i}))},saveContactsInVendorDetailLocalData:i=>{e(Cn({vendorId:u,contacts:i}))},resetVendorDetailLocalData:()=>{e(ra(u))},updateSelectedVendorForCreate:i=>{e(Bn(i))},navigateToBankDetailPage:(i,d)=>{let p;i==="wire"?p=d==="international"?qa(s,a.billId,u):ui(s,a.billId,u):p=di(s,a.billId,u);const m=T(r.state?.pathnameStackToGoBack,r.pathname);c(p,{state:{pathnameStackToGoBack:m}})},onRemoveBankAccount:(i,d)=>{e(d===!0?kn(i,"vendor",u):wn(i,"vendor",u))},navigateToMailingAddressPage:i=>{const d=Xe(s,i,l),p=T(r.state?.pathnameStackToGoBack,r.pathname);c(d,{state:{pathnameStackToGoBack:p}})},updateFilesEntity:i=>{e(vn({files:i}))},onEditFileName:(i,d)=>{e(In(i,d.split(".")[0]))},handleZeniLogoClick:()=>{o.toggle()},updateSaveFetchState:()=>{u==null&&e(ra(a.vendorViewDetails.newVendorState?.vendorBasic?.id)),e(fn("Not-Started",u))},onVendorSelected:i=>{i!=null&&e(yn(i,!0))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(He({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}},onBackClick:()=>{e(ie("common"));const i=H(a.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ci(n.tenantEmailDomain,a.billId);c(d,{state:{pathnameStackToGoBack:i.newStack}})},onGetOtp:i=>{e(Sn(i,"BillPayVendor"))},onResendOtp:i=>{e(gn(i,"BillPayVendor"))},onVerifyOtp:(i,d)=>{e(hn(i,d,"BillPayVendor"))},onVerifyOtpSuccess:(i,d,p)=>{e(bn(i,d,p))},onFetchAndUpdateVendorRecommendations:i=>{e(Oa(i,!1))}}}))(ii),Be=()=>{const e=K(),a=le(),l=ai(),n=X(),{billId:c,vendorId:r}=ae(),u=k((b=>Z(b))),{useFeatureGate:o}=oe(),{isFeatureEnabled:s}=o(g.isBillPayLocalCurrencyFeatureEnabled),[i,d]=S.useState(!1),p=k((b=>b.vendorViewState.newVendorState.fetchStatus.fetchState)),m=k((b=>ye(b,r))),y=k((b=>r!==void 0?b.vendorViewState.editVendorStateById[r]?.fetchStatus??"Not-Started":"Not-Started")),h=r!==void 0?y:p;return S.useEffect((()=>{i===!1&&h==="Not-Started"&&r!=null&&(a(ge(!1,r)),d(!0))}),[i,h,r]),m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?t.jsx(ti,{}):h==="Error"?t.jsx(ni,{onGoHome:()=>e("../",{replace:!0}),onReload:()=>window.location.reload()}):t.jsxs(t.Fragment,{children:[t.jsx(Ke,{vendorId:r,billId:c}),t.jsx(qi,{navigate:e,location:n,themeState:l,currentTenant:u,vendorId:r,billId:c,vendorViewDetails:m,isLocalCurrencyEnabled:s})]})},Ji=Q((function(e,a){const{companyId:l}=a;return{billPaySetupView:En(e,l),analytics:j,videoUrl:"https://player.vimeo.com/video/787873426?h=9d9389b1dc&badge=0&autopause=0&player_id=0&app_id=58479"}}),(function(e,a){const{companyId:l,navigate:n}=a;return{onButtonClick:()=>{e(Dn(l))},onBackClick:()=>{n("../..",{relative:"path"})},onSetupBillPaySuccess:()=>{n("../bills/setup",{relative:"path"})}}}))(li),Ki=()=>{const e=oi(),a=K(),l=X(),{tenantEmailDomain:n}=ae(),[c,r]=S.useState(!1),u=ue(),o=k((h=>Z(h))),s=o.companyId??L.getSignedInUserTenant(n)?.companyId,i=L.getSignedInUser(),d=fe(),p=!!o.companyBillPayInfo?.info?.isBillPayTOSAccepted,m=de(d?.loggedInUserRoleMap),y=h=>{r(h)};if(i==null)throw Error("Can't access bill pay promo page without signing in...");return o.companyBillPayInfo?.info?.isBillPayEnabled===!0?t.jsx(ee,{to:"../../../bills"}):p===!0&&m===!0?t.jsx(ee,{to:"../../bills/setup"}):p===!1||d!=null&&Ye(o,d.loggedInUserRoleMap)?t.jsxs(t.Fragment,{children:[t.jsx(Ee,{analytics:j,onLoad:h=>(b=>b.trackPageLoaded(Wa.Event.billPayPromoPage))(h)}),t.jsx(Ka,{isAppContentDrawerOpen:c,handleDrawerToggle:y}),t.jsx(Ji,{companyId:s,navigate:a,location:l,meetingUrl:e("bill_pay_promo"),onClickMenuIcon:()=>{y(!0)}})]}):t.jsx(se,{fetchState:"In-Progress",style:{backgroundColor:u.colors.grey5}})};function Po(){const e=k(($=>Z($))),a=fe(),l=de(a?.loggedInUserRoleMap),n=ue(),{useFeatureGate:c}=oe(),{isFeatureEnabled:r}=c(g.isBillPayLocalCurrencyFeatureEnabled),u=r===!0?Zi:Yi,{isFeatureEnabled:o}=c(g.isDebitCardFeatureEnabled),s=$a(o,e),i=La(e),d=X(),p=e?.userRole!=null&&ka(e?.userRole),m=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&de(a?.loggedInUserRoleMap),y=Va(a?.loggedInUserRoleMap),h=(e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p)&&Tn(a?.loggedInUserRoleMap),b=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!p,I=b&&Ga(a?.loggedInUserRoleMap),{isFeatureEnabled:E}=c(g.isChargeCardFeatureEnabled),C=si(e,E,o)&&!p,x=C&&jn(a?.loggedInUserRoleMap),_=Pn(a?.loggedInUserRoleMap),D=Ua(a?.loggedInUserRoleMap),B=Fn(a?.loggedInUserRoleMap),N=b&&D,V=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!p&&B,W=Rn(a?.loggedInUserRoleMap),O=Vn(a?.loggedInUserRoleMap),v=$n(a?.loggedInUserRoleMap),Y=C&&W,{tenantEmailDomain:M}=ae();return t.jsxs(ot,{children:[d.pathname.includes("/bills")?t.jsxs(t.Fragment,{children:[t.jsx(f,{path:"setup",element:t.jsx(je,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:y,isReimbursementAdminLevelAccess:h,isZeniAccountAdminLevelAccess:I,isChargeCardAdminLevelAccess:x,isUserHasOnlyCardAccess:_,productType:"bill_pay",type:"setup"})}),t.jsx(f,{path:"verification",element:t.jsx(je,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:y,isReimbursementAdminLevelAccess:h,isZeniAccountAdminLevelAccess:I,isChargeCardAdminLevelAccess:x,isUserHasOnlyCardAccess:_,productType:"bill_pay",type:"verification"})}),t.jsx(f,{path:"promo",element:t.jsx(Ki,{})}),t.jsx(f,{path:"approval-rules/*",element:m?t.jsx(bi,{}):t.jsx(hi,{showZeniAccountRoute:N,isUserHasBillPayAccess:O,isUserHasReimbursementAccess:v,showTreasuryRoute:V,isTenantBankingOnly:s,showChargeCardRoute:Y,tenantEmailDomain:M??""})}),t.jsx(f,{path:"international-wire",element:t.jsx(je,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:y,isReimbursementAdminLevelAccess:h,isZeniAccountAdminLevelAccess:I,isChargeCardAdminLevelAccess:x,isUserHasOnlyCardAccess:_,productType:"bill_pay",type:"international-wire"})}),e.companyBillPayInfo?.info?.isBillPayEnabled===!0&&t.jsx(f,{path:"*",element:t.jsx(ji,{})}),(s===!0||i===!0)&&t.jsx(f,{path:"/*",element:t.jsx(Xa,{})}),e.companyBillPayInfo?.info?.isBillPayTOSAccepted===!0&&l&&t.jsx(f,{path:"*",element:t.jsx(ee,{to:"../setup"})}),a!=null&&Ye(e,a.loggedInUserRoleMap)&&t.jsx(f,{path:"*",element:t.jsx(ee,{to:"../promo"})})]}):d.pathname.includes("/bill")?t.jsxs(t.Fragment,{children:[t.jsx(f,{path:"new",element:t.jsx(w,{appContent:t.jsx(ga,{})})}),t.jsx(f,{path:":billId",element:t.jsx(w,{appContent:t.jsx(Si,{})})}),t.jsx(f,{path:":billId/edit",element:t.jsx(w,{appContent:t.jsx(ga,{})})}),t.jsx(f,{path:"new/review",element:t.jsx(w,{appContent:t.jsx(va,{})})}),t.jsx(f,{path:":billId/edit/review",element:t.jsx(w,{appContent:t.jsx(va,{})})}),t.jsx(f,{path:"/:billId/:addressType",element:t.jsx(w,{appContent:t.jsx(ua,{isSubPage:!0})})}),t.jsx(f,{path:"/new/:addressType",element:t.jsx(w,{appContent:t.jsx(ua,{isSubPage:!0})})}),t.jsx(f,{path:"new/vendor/create",element:t.jsx(w,{appContent:t.jsx(Be,{})})}),t.jsx(f,{path:"new/vendor/:vendorId/edit",element:t.jsx(w,{appContent:t.jsx(Be,{})})}),t.jsx(f,{path:"new/vendor/:vendorId/edit/ach",element:t.jsx(w,{appContent:t.jsx(me,{})})}),t.jsx(f,{path:"new/vendor/:vendorId/edit/domestic",element:t.jsx(w,{appContent:t.jsx(be,{})})}),t.jsx(f,{path:"new/vendor/:vendorId/edit/international",element:t.jsx(w,{appContent:t.jsx(u,{})})}),t.jsx(f,{path:"new/vendor/create/ach",element:t.jsx(w,{appContent:t.jsx(me,{})})}),t.jsx(f,{path:"new/vendor/create/domestic",element:t.jsx(w,{appContent:t.jsx(be,{})})}),t.jsx(f,{path:"new/vendor/create/international",element:t.jsx(w,{appContent:t.jsx(u,{})})}),t.jsx(f,{path:":billId/edit/vendor/create/ach",element:t.jsx(w,{appContent:t.jsx(me,{})})}),t.jsx(f,{path:":billId/edit/vendor/create/domestic",element:t.jsx(w,{appContent:t.jsx(be,{})})}),t.jsx(f,{path:":billId/edit/vendor/create/international",element:t.jsx(w,{appContent:t.jsx(u,{})})}),t.jsx(f,{path:":billId/edit/vendor/create",element:t.jsx(w,{appContent:t.jsx(Be,{})})}),t.jsx(f,{path:":billId/edit/vendor/:vendorId/edit",element:t.jsx(w,{appContent:t.jsx(Be,{})})}),t.jsx(f,{path:":billId/edit/vendor/:vendorId/edit/ach",element:t.jsx(w,{appContent:t.jsx(me,{})})}),t.jsx(f,{path:":billId/edit/vendor/:vendorId/edit/domestic",element:t.jsx(w,{appContent:t.jsx(be,{})})}),t.jsx(f,{path:":billId/edit/vendor/:vendorId/edit/international",element:t.jsx(w,{appContent:t.jsx(u,{})})}),t.jsx(f,{path:":billId/edit/vendor/create/ach",element:t.jsx(w,{appContent:t.jsx(me,{})})}),t.jsx(f,{path:":billId/edit/vendor/create/domestic",element:t.jsx(w,{appContent:t.jsx(be,{})})}),t.jsx(f,{path:":billId/edit/vendor/create/international",element:t.jsx(w,{appContent:t.jsx(u,{})})}),t.jsx(f,{path:"*",element:t.jsx(xe,{})})]}):t.jsx(f,{path:"*",element:t.jsx(se,{fetchState:"In-Progress",style:{backgroundColor:n.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${n.colors.dropShadowNormal}`}})}),t.jsx(f,{path:"*",element:t.jsx(xe,{})})]})}export{Po as default};
@@ -1,4 +1,4 @@
1
- import{a as k}from"./sentry-_x3Yh1Jc.js";import{u as Z,j as h,h as ne,g as se,i as oe,N as ie,l as re}from"./core-DOBELRta.js";import{fF as z,Hv as ce,Y$ as ue,BA as de,Sb as pe,HJ as le,KU as me,NH as fe,Ol as ye,Pa as Se,Z0 as ge,Z1 as Ie,Z2 as be,Z3 as he,Z4 as Te,Vf as De,Y5 as Oe,Vu as Ce,LY as Ve,Vv as ke,M0 as Ae,mH as we,gG as Ne,gF as Fe,gE as ve,uT as _e,uK as Ee,uH as Be,mz as xe,BJ as ze,BH as P,bE as R,BV as U,cE as Pe}from"./zeni-epic-state-DXFYDM66.js";import{bT as Re,N as Ue,c as Le,bj as Me,z as x,a9 as je,k as L,o as E,V as B,bV as He,af as Ze,p as M,aH as j}from"./index-D0or4oV9.js";import{n as Ge}from"./mui-wO6EIETx.js";import{j as V}from"./liveblocks-BPL36a6x.js";import{d as H}from"./routePaths-DTZH71MW.js";import{M as Ye}from"./MobileAppDrawer-C-ti4sM2.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},u=new t.Error().stack;u&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[u]="f2c4a6a0-1eb1-4b8c-9754-20d7d5afda8c",t._sentryDebugIdIdentifier="sentry-dbid-f2c4a6a0-1eb1-4b8c-9754-20d7d5afda8c")}catch{}})();function nt(){const t=Z(),u=h((r=>z(r))),n=u?.tenantId,{isApprovalRulesV3Enabled:i,isLoading:d}=Re(n),p=h((r=>r.billPaySetupApproverViewState.fetchState));k.useEffect((()=>{n==null||d||p==="Not-Started"&&t(ce(!0,!0,i))}),[n,d,i,p,t])}const $e=Ge.div`
1
+ import{a as k}from"./sentry-FwaDhTzy.js";import{u as G,j as h,h as ne,g as se,i as oe,N as ie,l as re}from"./core-Dh_SHcAD.js";import{fF as z,Hz as ce,Z4 as ue,BA as de,Sg as pe,HN as le,KZ as me,NM as fe,Oq as ye,Pf as Se,Z5 as ge,Z6 as Ie,Z7 as be,Z8 as he,Z9 as Te,Vk as De,Ya as Oe,Vz as Ce,M1 as Ve,VA as ke,M5 as Ae,mH as we,gG as Ne,gF as Fe,gE as ve,uT as _e,uK as Be,uH as Ee,mz as xe,BJ as ze,BH as P,bE as M,BV as R,cE as Pe}from"./zeni-epic-state-DJh0-ZeR.js";import{bT as Me,Q as Re,c as Ue,bj as je,z as x,a9 as Le,j as U,n as B,S as E,bV as Ze,af as Ge,p as j,aH as L}from"./index-BeqOty_5.js";import{n as He}from"./mui-BYn_Ugho.js";import{j as V}from"./liveblocks-DR8KfETq.js";import{d as Z}from"./routePaths-CN71IXC6.js";import{M as qe}from"./MobileAppDrawer-BnS3AEOn.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},u=new t.Error().stack;u&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[u]="b32647d6-1649-4696-8f5e-bb98551194b6",t._sentryDebugIdIdentifier="sentry-dbid-b32647d6-1649-4696-8f5e-bb98551194b6")}catch{}})();function nt(){const t=G(),u=h((r=>z(r))),n=u?.tenantId,{isApprovalRulesV3Enabled:i,isLoading:d}=Me(n),p=h((r=>r.billPaySetupApproverViewState.fetchState));k.useEffect((()=>{n==null||d||p==="Not-Started"&&t(ce(!0,!0,i))}),[n,d,i,p,t])}const Ke=He.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,4 +6,4 @@ import{a as k}from"./sentry-_x3Yh1Jc.js";import{u as Z,j as h,h as ne,g as se,i
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${t=>t.theme.colors.grey4};
9
- `,qe=re((function(t,u){const{businessVerificationDetails:n}=u,i=z(t),d=x.getSignedInUser(),p=i.tenantId,r={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:p??""},T=De(u.roleMap)&&n.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=Oe(t.companyConfigState),s=Ce(t.userRoleConfigState);return{businessVerificationDetails:n,verficationDetailsFetchState:n.fetchState,isRefreshingViewInBackground:n.isRefreshingViewInBackground,allNationalityCountries:n.allNationalityCountries,filesEndPoint:`${Ze.fileMicroServiceBaseUrl}`,authParams:r,isDisabled:T,allIndustries:e.companyIndustries??[],companyTitles:s.companyTitles}}),(function(t,u){const{companyId:n,productType:i,currentTenant:d,navigate:p,location:r}=u,{tenantEmailDomain:T}=d;return{onCompanyDetailsChanged:e=>{const{companyDescription:s,companyIndustry:m,companyIndustryType:O,companyLegalName:C,companyTaxId:g,companyWebsite:y,companyPhone:I,primaryContactEmail:c,primaryContactName:o,primaryContactUserId:l,primaryContactSyncToken:D,syncToken:S,fileIds:a,incDate:f,typeOfIncorporation:A,stateOfIncorporation:w,sourceOfFunds:N,companySubIndustry:F,countriesOfOperations:b,companySourceOfFunds:G,companySourceOfFundsDescription:Y,transactionVolume:$,transactionVolumeDescription:q,purposeOfAccount:J,purposeOfAccountDescription:K,regulatedStatus:W,regulatedStatusDescription:Q,usNexus:X,usNexusTypes:ee}=e,v=O?.selectedOption,te={companyId:n,companyDescription:s,companyIndustry:m.selectedOption,companyIndustryType:v==null||v===""?void 0:v,companyLegalName:C,taxIdOrEIN:g,website:y!=""&&y!=null?Pe(y):void 0,phone:I,syncToken:S,fileIds:a,incDate:f!=null?R(f?.toString()):f,typeOfIncorporation:A?.selectedOption??"",stateOfIncorporation:w?.selectedOption??"",sourceOfFunds:N?.selectedOption??"",companySubIndustry:F?.selectedOption??"",countriesOfOperations:b?.selectedOptions.map((_=>_.length===2?_:j(_)))??[],companySourceOfFunds:G?.selectedOption??"",companySourceOfFundsDescription:Y,transactionVolume:$?.selectedOption??"",transactionVolumeDescription:q,purposeOfAccount:J?.selectedOption??"",purposeOfAccountDescription:K,regulatedStatus:W??"",regulatedStatusDescription:Q,usNexus:X,usNexusTypes:ee?.selectedOptions??[]},ae={userId:l,firstName:o.firstName,lastName:o.lastName,email:c,syncToken:D};t(U({companyDetails:te,primaryContactDetails:ae}))},onCompanyOfficerUpdated:e=>{const s=e.map((m=>{const{officerType:O,userId:C,name:g,email:y,nationalityCountryCode:I,ssn:c,dob:o,phone:l,syncToken:D,selectDocument:S,role:a,ownership:f,isSelectedForVerification:A,userVerificationStatus:w,treasuryUserVerificationStatus:N,fileIds:F}=m;let b;return S.selectDocumentType==="driverLicense"?b="driving_license":S.selectDocumentType==="passport"?b="passport":S.selectDocumentType==="stateId"?b="id_document":S.selectDocumentType==="ssnCard"&&(b="social_security_card"),{officerType:O,userId:C,firstName:g.firstName,lastName:g.lastName,email:y,ssn:c,nationalityCountryCode:I?.selectedOption!=null?j(I.selectedOption):void 0,phone:l,birthday:o!=null?R(o?.toString()):o,syncToken:D,titleAtCompany:a.selectedOption,ownershipInCompany:f,documentTypeSelectedForVerification:b,isSelectedForVerification:A,userVerificationStatus:w,treasuryUserVerificationStatus:N,fileIds:F,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));t(U({officers:s}))},onSaveDetailsClick:e=>{t(P(n,e,i))},onSendForVerificationClick:e=>{t(P(n,e,i,!0))},onAddressClick:e=>{const s=H(T,e),m=M(r.state?.pathnameStackToGoBack,r.pathname);p(s,{state:{pathnameStackToGoBack:m}})},onRegisteredAddressClick:e=>{const s=H(T,e),m=M(r.state?.pathnameStackToGoBack,r.pathname);p(s,{state:{pathnameStackToGoBack:m}})},onBackClick:()=>{t(ze({companyId:n})),p("../setup")},updateFilesEntity:e=>{t(xe({files:e}))},onDeleteFile:e=>{t(Be(e))},onDeleteFileList:e=>{t(Ee(e))},onEditFileName:(e,s)=>{t(_e(e,s.split(".")[0]))},onGetOtp:e=>{t(ve(e,"SpendManagementSetup"))},onResendOtp:e=>{t(Fe(e,"SpendManagementSetup"))},onVerifyOtp:(e,s)=>{t(Ne(e,s,"SpendManagementSetup"))},saveNewAddressInLocalStore:(e,s)=>{t(we({addressType:e,addressToCreate:s}))},onIdentityDocumentUploadedForAutofill:e=>{if(n==null)return;const s=ke(e.documentType);s!=null&&t(Ae({target:"setup",companyId:n,officerType:e.officerType,fileId:e.fileId,documentType:s}))},onCompanyDocumentUploadedForAutofill:e=>{n!=null&&t(Ve({target:"setup",companyId:n,fileId:e.fileId,documentType:e.documentType}))}}}))(He),st=({productType:t})=>{const u=ne(),n=se(),i=Z(),[d,p]=k.useState(!1),[r,T]=k.useState(!1),{tenantEmailDomain:e}=oe(),s=Ue(),{useDynamicConfig:m}=Le(),{configValue:O}=m(Me.zeniAccountsConfig),C=ue(O),g=h((a=>{switch(t){case"zeni_accounts":return a.zeniAccountSetupViewState.fetchState;case"reimbursement":return a.remiSetupViewState.fetchState;case"charge_cards":return a.chargeCardSetupViewState.fetchState;case"zeni_treasury":return a.treasurySetupViewState.fetchState;default:return a.billPaySetupViewState.fetchState}})),y=h((a=>a.companyConfigState.fetchState)),I=h((a=>a.userRoleConfigState.fetchState)),c=h((a=>z(a))),o=c.companyId??x.getSignedInUserTenant(e)?.companyId;if(k.useEffect((()=>{y==="Not-Started"&&i(de()),I==="Not-Started"&&i(pe(!0))}),[y,I,i]),k.useEffect((()=>{if(!d&&g==="Not-Started"&&o!=null)switch(p(!0),t){case"zeni_accounts":i(Se(o,!0));break;case"zeni_treasury":i(ye(o,!0));break;case"reimbursement":i(fe(o,!0));break;case"charge_cards":i(me(o,!0));break;default:i(le(o,!0))}}),[d,g,o,i]),x.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let l;switch(t){case"zeni_accounts":l=c.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":l=c.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":l=c.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||c.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":l=c.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:l=c.companyBillPayInfo?.info?.isBillPayTOSAccepted}const D=a=>{T(a)},S=h((a=>{switch(t){case"zeni_accounts":return Te(a,o);case"zeni_treasury":return he(a,o);case"charge_cards":return be(a,o);case"reimbursement":return Ie(a,o);default:return ge(a,o)}}));return l===!1?V.jsx(ie,{to:"../promo"}):V.jsxs($e,{children:[V.jsx(je,{analytics:L,onLoad:a=>(f=>{switch(t){case"zeni_accounts":return f.trackPageLoaded(B.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return f.trackPageLoaded(B.Event.reimbursementBusinessVerification);default:return f.trackPageLoaded(B.Event.billPayBusinessVerification,E(n)?"Settings":void 0)}})(a)}),E(n)?V.jsx(Ye,{isAppContentDrawerOpen:r,handleDrawerToggle:D}):null,V.jsx(qe,{businessVerificationDetails:S,navigate:u,location:n,companyId:o,analytics:L,currentTenant:c,productType:t,isSettings:E(n),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{D(!0)},maxInsuredAmount:C.maxInsuredAmount})]})};export{st as B,nt as u};
9
+ `,$e=re((function(t,u){const{businessVerificationDetails:n}=u,i=z(t),d=x.getSignedInUser(),p=i.tenantId,r={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:p??""},T=De(u.roleMap)&&n.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=Oe(t.companyConfigState),s=Ce(t.userRoleConfigState);return{businessVerificationDetails:n,verficationDetailsFetchState:n.fetchState,isRefreshingViewInBackground:n.isRefreshingViewInBackground,allNationalityCountries:n.allNationalityCountries,filesEndPoint:`${Ge.fileMicroServiceBaseUrl}`,authParams:r,isDisabled:T,allIndustries:e.companyIndustries??[],companyTitles:s.companyTitles}}),(function(t,u){const{companyId:n,productType:i,currentTenant:d,navigate:p,location:r}=u,{tenantEmailDomain:T}=d;return{onCompanyDetailsChanged:e=>{const{companyDescription:s,companyIndustry:m,companyIndustryType:O,companyLegalName:C,companyTaxId:g,companyWebsite:y,companyPhone:I,primaryContactEmail:c,primaryContactName:o,primaryContactUserId:l,primaryContactSyncToken:D,syncToken:S,fileIds:a,incDate:f,typeOfIncorporation:A,stateOfIncorporation:w,sourceOfFunds:N,companySubIndustry:F,countriesOfOperations:b,companySourceOfFunds:H,companySourceOfFundsDescription:q,transactionVolume:K,transactionVolumeDescription:$,purposeOfAccount:J,purposeOfAccountDescription:Q,regulatedStatus:W,regulatedStatusDescription:Y,usNexus:X,usNexusTypes:ee}=e,v=O?.selectedOption,te={companyId:n,companyDescription:s,companyIndustry:m.selectedOption,companyIndustryType:v==null||v===""?void 0:v,companyLegalName:C,taxIdOrEIN:g,website:y!=""&&y!=null?Pe(y):void 0,phone:I,syncToken:S,fileIds:a,incDate:f!=null?M(f?.toString()):f,typeOfIncorporation:A?.selectedOption??"",stateOfIncorporation:w?.selectedOption??"",sourceOfFunds:N?.selectedOption??"",companySubIndustry:F?.selectedOption??"",countriesOfOperations:b?.selectedOptions.map((_=>_.length===2?_:L(_)))??[],companySourceOfFunds:H?.selectedOption??"",companySourceOfFundsDescription:q,transactionVolume:K?.selectedOption??"",transactionVolumeDescription:$,purposeOfAccount:J?.selectedOption??"",purposeOfAccountDescription:Q,regulatedStatus:W??"",regulatedStatusDescription:Y,usNexus:X,usNexusTypes:ee?.selectedOptions??[]},ae={userId:l,firstName:o.firstName,lastName:o.lastName,email:c,syncToken:D};t(R({companyDetails:te,primaryContactDetails:ae}))},onCompanyOfficerUpdated:e=>{const s=e.map((m=>{const{officerType:O,userId:C,name:g,email:y,nationalityCountryCode:I,ssn:c,dob:o,phone:l,syncToken:D,selectDocument:S,role:a,ownership:f,isSelectedForVerification:A,userVerificationStatus:w,treasuryUserVerificationStatus:N,fileIds:F}=m;let b;return S.selectDocumentType==="driverLicense"?b="driving_license":S.selectDocumentType==="passport"?b="passport":S.selectDocumentType==="stateId"?b="id_document":S.selectDocumentType==="ssnCard"&&(b="social_security_card"),{officerType:O,userId:C,firstName:g.firstName,lastName:g.lastName,email:y,ssn:c,nationalityCountryCode:I?.selectedOption!=null?L(I.selectedOption):void 0,phone:l,birthday:o!=null?M(o?.toString()):o,syncToken:D,titleAtCompany:a.selectedOption,ownershipInCompany:f,documentTypeSelectedForVerification:b,isSelectedForVerification:A,userVerificationStatus:w,treasuryUserVerificationStatus:N,fileIds:F,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));t(R({officers:s}))},onSaveDetailsClick:e=>{t(P(n,e,i))},onSendForVerificationClick:e=>{t(P(n,e,i,!0))},onAddressClick:e=>{const s=Z(T,e),m=j(r.state?.pathnameStackToGoBack,r.pathname);p(s,{state:{pathnameStackToGoBack:m}})},onRegisteredAddressClick:e=>{const s=Z(T,e),m=j(r.state?.pathnameStackToGoBack,r.pathname);p(s,{state:{pathnameStackToGoBack:m}})},onBackClick:()=>{t(ze({companyId:n})),p("../setup")},updateFilesEntity:e=>{t(xe({files:e}))},onDeleteFile:e=>{t(Ee(e))},onDeleteFileList:e=>{t(Be(e))},onEditFileName:(e,s)=>{t(_e(e,s.split(".")[0]))},onGetOtp:e=>{t(ve(e,"SpendManagementSetup"))},onResendOtp:e=>{t(Fe(e,"SpendManagementSetup"))},onVerifyOtp:(e,s)=>{t(Ne(e,s,"SpendManagementSetup"))},saveNewAddressInLocalStore:(e,s)=>{t(we({addressType:e,addressToCreate:s}))},onIdentityDocumentUploadedForAutofill:e=>{if(n==null)return;const s=ke(e.documentType);s!=null&&t(Ae({target:"setup",companyId:n,officerType:e.officerType,fileId:e.fileId,documentType:s}))},onCompanyDocumentUploadedForAutofill:e=>{n!=null&&t(Ve({target:"setup",companyId:n,fileId:e.fileId,documentType:e.documentType}))}}}))(Ze),st=({productType:t})=>{const u=ne(),n=se(),i=G(),[d,p]=k.useState(!1),[r,T]=k.useState(!1),{tenantEmailDomain:e}=oe(),s=Re(),{useDynamicConfig:m}=Ue(),{configValue:O}=m(je.zeniAccountsConfig),C=ue(O),g=h((a=>{switch(t){case"zeni_accounts":return a.zeniAccountSetupViewState.fetchState;case"reimbursement":return a.remiSetupViewState.fetchState;case"charge_cards":return a.chargeCardSetupViewState.fetchState;case"zeni_treasury":return a.treasurySetupViewState.fetchState;default:return a.billPaySetupViewState.fetchState}})),y=h((a=>a.companyConfigState.fetchState)),I=h((a=>a.userRoleConfigState.fetchState)),c=h((a=>z(a))),o=c.companyId??x.getSignedInUserTenant(e)?.companyId;if(k.useEffect((()=>{y==="Not-Started"&&i(de()),I==="Not-Started"&&i(pe(!0))}),[y,I,i]),k.useEffect((()=>{if(!d&&g==="Not-Started"&&o!=null)switch(p(!0),t){case"zeni_accounts":i(Se(o,!0));break;case"zeni_treasury":i(ye(o,!0));break;case"reimbursement":i(fe(o,!0));break;case"charge_cards":i(me(o,!0));break;default:i(le(o,!0))}}),[d,g,o,i]),x.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let l;switch(t){case"zeni_accounts":l=c.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":l=c.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":l=c.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||c.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":l=c.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:l=c.companyBillPayInfo?.info?.isBillPayTOSAccepted}const D=a=>{T(a)},S=h((a=>{switch(t){case"zeni_accounts":return Te(a,o);case"zeni_treasury":return he(a,o);case"charge_cards":return be(a,o);case"reimbursement":return Ie(a,o);default:return ge(a,o)}}));return l===!1?V.jsx(ie,{to:"../promo"}):V.jsxs(Ke,{children:[V.jsx(Le,{analytics:U,onLoad:a=>(f=>{switch(t){case"zeni_accounts":return f.trackPageLoaded(E.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return f.trackPageLoaded(E.Event.reimbursementBusinessVerification);default:return f.trackPageLoaded(E.Event.billPayBusinessVerification,B(n)?"Settings":void 0)}})(a)}),B(n)?V.jsx(qe,{isAppContentDrawerOpen:r,handleDrawerToggle:D}):null,V.jsx($e,{businessVerificationDetails:S,navigate:u,location:n,companyId:o,analytics:U,currentTenant:c,productType:t,isSettings:B(n),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{D(!0)},maxInsuredAmount:C.maxInsuredAmount})]})};export{st as B,nt as u};