@zeniai/web-app-ui 5.0.10-qa → 5.0.11-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 (117) hide show
  1. package/dist/assets/AddressRoutes-D4nqvs49.js +1 -0
  2. package/dist/assets/AddressScreen-BMB6Kbyt.js +9 -0
  3. package/dist/assets/AiCfoScreen-Vk7WMEZ-.js +11 -0
  4. package/dist/assets/{BillPayApprovalRoutes-BMer3wuj.js → BillPayApprovalRoutes-DfIF_lRe.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-C1s11_iz.js → BillPayRoutes-ABgydC8p.js} +6 -6
  6. package/dist/assets/{BusinessVerificationPageScreen-CbiCbjAZ.js → BusinessVerificationPageScreen-Byg1Uhrv.js} +2 -2
  7. package/dist/assets/{ChargeCardRoutes-YilITIsN.js → ChargeCardRoutes-DOv8Kupg.js} +9 -9
  8. package/dist/assets/CompanyPassportScreen-DNNUDJSS.js +1 -0
  9. package/dist/assets/{ConnectionAuthScreen-DqGy4a3m.js → ConnectionAuthScreen-C46eBigr.js} +1 -1
  10. package/dist/assets/CustomerOnboardingAuthScreen-EaU7h7Wf.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-drLdNHDD.js → CustomerOnboardingRoutes-HmFZMxcH.js} +4 -4
  12. package/dist/assets/{DashboardRoutes-B2wE4D0T.js → DashboardRoutes-DCrMQvqt.js} +3 -3
  13. package/dist/assets/{DefaultTenantHome-CwZEkfQX.js → DefaultTenantHome-C6axtGsS.js} +1 -1
  14. package/dist/assets/DomesticWireDetailScreen-CDLset95.js +18 -0
  15. package/dist/assets/DrawerScreen-CjKjzVJ3.js +1 -0
  16. package/dist/assets/{EntityDetailRoutes-Ch0rvPIy.js → EntityDetailRoutes-NLN5T6x2.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-C70FMshm.js → ExpenseAutomationRoutes-f8iGFMw1.js} +3 -3
  18. package/dist/assets/FeaturePreviewScreen-DCLqtwXF.js +1 -0
  19. package/dist/assets/{MagicLinkRoutes-BQEi0ZJK.js → MagicLinkRoutes-BWOlQli3.js} +8 -8
  20. package/dist/assets/MagicLinkSignInScreen-8L2FgZqU.js +12 -0
  21. package/dist/assets/{MobileAppDrawer-CimbS3hY.js → MobileAppDrawer-OybL2Okz.js} +1 -1
  22. package/dist/assets/NotFoundScreen-D8bJeRt0.js +1 -0
  23. package/dist/assets/{NotificationRoutes--kFdvLLf.js → NotificationRoutes-BpYt3phX.js} +1 -1
  24. package/dist/assets/{PandLWithForecastRoutes-BgdJ5LRb.js → PandLWithForecastRoutes-CHRiJgFR.js} +1 -1
  25. package/dist/assets/{PeopleRoutes-CFGmFJC7.js → PeopleRoutes-D9CVh0Ja.js} +9 -9
  26. package/dist/assets/PerformanceRoutes-lNCEdrfz.js +1 -0
  27. package/dist/assets/{Preview-Ce-yKggj.js → Preview-CKmcpteJ.js} +1 -1
  28. package/dist/assets/{QBOConnectionScreen-CYdGz_84.js → QBOConnectionScreen-DZ1k9UnT.js} +1 -1
  29. package/dist/assets/ReferralListScreen-ChvCApY5.js +5 -0
  30. package/dist/assets/ReimbursementApprovalRoutes-DFueCzb6.js +1 -0
  31. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-eQzzNWqC.js → ReimbursementApprovalRuleDetailScreen-CGR7iPyc.js} +1 -1
  32. package/dist/assets/{ReimbursementRoutes-BifooTxj.js → ReimbursementRoutes-fdHxZhUC.js} +6 -6
  33. package/dist/assets/{ReportsRoutes-Ck89aMEv.js → ReportsRoutes-BfRe6iWC.js} +1 -1
  34. package/dist/assets/RewardsRoutes-CrU22RDz.js +1 -0
  35. package/dist/assets/{ScreenRoutes-Dv_kin0Y.js → ScreenRoutes-33kyTNa0.js} +2 -2
  36. package/dist/assets/{SettingsRoutes-DbKrx5vl.js → SettingsRoutes-BubqdVb7.js} +6 -6
  37. package/dist/assets/{SetupPagesScreen-C-SdBEE6.js → SetupPagesScreen-CIFtnWYk.js} +5 -5
  38. package/dist/assets/SignInScreen-DunAziCS.js +1 -0
  39. package/dist/assets/SignOutScreen-DFscZ-6B.js +9 -0
  40. package/dist/assets/{TaskListScreen-C5lfphC9.js → TaskListScreen-BgivrIiS.js} +2 -2
  41. package/dist/assets/{TaskRoutes-BbW1TW2g.js → TaskRoutes-Zd-WILg6.js} +2 -2
  42. package/dist/assets/TransactionDetailRoutes-BQ9j2vpm.js +1 -0
  43. package/dist/assets/{TransactionDetailScreen-BWX6dDBh.js → TransactionDetailScreen-DxmS5vev.js} +2 -2
  44. package/dist/assets/{TransactionListRoutes-BMf4CZ_1.js → TransactionListRoutes-DmcpRXDM.js} +1 -1
  45. package/dist/assets/TreasuryRoutes-Dwg7JuRo.js +37 -0
  46. package/dist/assets/{VendorsRoutes-B8xcZKUi.js → VendorsRoutes-6uhzJWI3.js} +12 -12
  47. package/dist/assets/WiseConfirmationScreen-CNbKlsBn.js +12 -0
  48. package/dist/assets/{ZeniAccountRoutes-CwnbuK3E.js → ZeniAccountRoutes-y235hpKz.js} +10 -10
  49. package/dist/assets/{ZeniAccountStatementScreen-B1G-7Ulg.js → ZeniAccountStatementScreen-Dk4AqWUx.js} +2 -2
  50. package/dist/assets/{accountMappingHelper-DC8hLo25.js → accountMappingHelper-BIF_cEGy.js} +1 -1
  51. package/dist/assets/{analytics-D76TbnBG.js → analytics-YTm4e0V2.js} +1 -1
  52. package/dist/assets/{analyticsHelper-DMYHMyd-.js → analyticsHelper-BG68_Ecq.js} +1 -1
  53. package/dist/assets/{core--8kDo-LJ.js → core-cQ_UGuA8.js} +1 -1
  54. package/dist/assets/{decodeURIComponentSafe-C7w4UFFF.js → decodeURIComponentSafe-CzQtaU9d.js} +1 -1
  55. package/dist/assets/{dnd-C7FILogn.js → dnd-BKb14efZ.js} +1 -1
  56. package/dist/assets/{empty-3u2VxJVl.js → empty-DNHXYLLo.js} +1 -1
  57. package/dist/assets/{empty-Be_BVx3n.js → empty-DZNLkcgK.js} +1 -1
  58. package/dist/assets/{emptyVideoElement-2PLigQOf.js → emptyVideoElement-CBnuw-R_.js} +1 -1
  59. package/dist/assets/{epic-RtUezbdm.js → epic-B020-YAE.js} +1 -1
  60. package/dist/assets/{getLocaleForTenant-Blx2jmcV.js → getLocaleForTenant-CX5wQdJ4.js} +1 -1
  61. package/dist/assets/{index-BWzDqQ_Z.js → index-6MiIPIRp.js} +1 -1
  62. package/dist/assets/{index-B9x4skgF.js → index-BU0MpF_k.js} +1 -1
  63. package/dist/assets/{index-BZ4v8_jI.js → index-COB8HvQe.js} +2 -2
  64. package/dist/assets/{index-GDJvj_1Q.js → index-DAAltHsi.js} +1 -1
  65. package/dist/assets/{index-h4jm-UQJ.js → index-DaFoFUBf.js} +11002 -11024
  66. package/dist/assets/{index-D2BuA-Eq.js → index-Dv9AJolW.js} +1 -1
  67. package/dist/assets/{index-DwK3E-F6.js → index-jWD7VWky.js} +1 -1
  68. package/dist/assets/{lexical-roIufkFt.js → lexical-Dhe13gAE.js} +1 -1
  69. package/dist/assets/{liveblocks-CGYIz1sf.js → liveblocks-BGrTvYCQ.js} +1 -1
  70. package/dist/assets/{lottie-BwZdyUox.js → lottie-DunuFFva.js} +1 -1
  71. package/dist/assets/{mui-COKu087d.js → mui-bgnk9Y8D.js} +1 -1
  72. package/dist/assets/{pathToGoBack-BAEmu1ZG.js → pathToGoBack-CrwnkzZo.js} +1 -1
  73. package/dist/assets/{pdf-lib-C9qLw4cO.js → pdf-lib-CWFeXKHq.js} +1 -1
  74. package/dist/assets/{pdf-CBQkrKS2.js → pdf-pb-ViLbf.js} +4 -4
  75. package/dist/assets/{plaid-DzMABTsR.js → plaid-D86kekqV.js} +1 -1
  76. package/dist/assets/{pusher-TSE9lTnh.js → pusher-Dl_gaLc0.js} +1 -1
  77. package/dist/assets/{react-D77OVu9R.js → react-B-GK82Mh.js} +1 -1
  78. package/dist/assets/{react-Q-oC4eFq.js → react-BGx71-xQ.js} +1 -1
  79. package/dist/assets/{react-wPUmTj8i.js → react-BSv395g0.js} +1 -1
  80. package/dist/assets/{react-BwlBpQg6.js → react-CsXicgmu.js} +1 -1
  81. package/dist/assets/{react-NGMn_z4n.js → react-DjMti-au.js} +1 -1
  82. package/dist/assets/{react-CG2bsPU9.js → react-amVh9j5p.js} +1 -1
  83. package/dist/assets/{recharts-jENt1xXk.js → recharts-d-EnR1VF.js} +1 -1
  84. package/dist/assets/{routePaths-NcYvgIlg.js → routePaths-Dbo9mbXz.js} +1 -1
  85. package/dist/assets/{sentry-ClGNqxTu.js → sentry-B-sG2CiU.js} +1 -1
  86. package/dist/assets/{url-BQx25DrG.js → url-BOXP7fzy.js} +1 -1
  87. package/dist/assets/{url-BVVYwai7.js → url-DXZa-f5b.js} +1 -1
  88. package/dist/assets/useAskAiCfoHostNavButtonProps-AwLPsx7n.js +1 -0
  89. package/dist/assets/{useDeviceId-CESE7gTF.js → useDeviceId-D2nSr5j2.js} +1 -1
  90. package/dist/assets/useFetchSuggestedQuestionsWhenReady-wonFIDms.js +1 -0
  91. package/dist/assets/{useInitialThreadRequest-CLJyupbh.js → useInitialThreadRequest-DuxWYdX9.js} +1 -1
  92. package/dist/assets/{utils-C9gYeSwW.js → utils-CU50wlH3.js} +1 -1
  93. package/dist/assets/{withTransactionSidePanel-DT5dIUC2.js → withTransactionSidePanel-08bnc7py.js} +2 -2
  94. package/dist/assets/{zeni-epic-state-Cb3mJiT_.js → zeni-epic-state-BObvmHAZ.js} +3 -3
  95. package/dist/index.html +1 -1
  96. package/package.json +2 -2
  97. package/dist/assets/AddressRoutes-BAXgA4i8.js +0 -1
  98. package/dist/assets/AddressScreen-nigwI_KO.js +0 -9
  99. package/dist/assets/AiCfoScreen-Ckw592Hw.js +0 -11
  100. package/dist/assets/CompanyPassportScreen-D4aivbz2.js +0 -1
  101. package/dist/assets/CustomerOnboardingAuthScreen-P2DxwlCb.js +0 -1
  102. package/dist/assets/DomesticWireDetailScreen-BYpZqZEo.js +0 -18
  103. package/dist/assets/DrawerScreen-DkRsu6_3.js +0 -1
  104. package/dist/assets/FeaturePreviewScreen-Csy8zadv.js +0 -1
  105. package/dist/assets/MagicLinkSignInScreen-BOUQOOvb.js +0 -12
  106. package/dist/assets/NotFoundScreen-0YxizmXw.js +0 -1
  107. package/dist/assets/PerformanceRoutes-DbpgSm9u.js +0 -1
  108. package/dist/assets/ReferralListScreen-CAKSMH_r.js +0 -5
  109. package/dist/assets/ReimbursementApprovalRoutes-DafN-Tqf.js +0 -1
  110. package/dist/assets/RewardsRoutes-CdKUlgwY.js +0 -1
  111. package/dist/assets/SignInScreen-DDCpQD2D.js +0 -1
  112. package/dist/assets/SignOutScreen-C-4uLvDn.js +0 -9
  113. package/dist/assets/TransactionDetailRoutes-CKVbSnqj.js +0 -1
  114. package/dist/assets/TreasuryRoutes-BgPbwTe3.js +0 -37
  115. package/dist/assets/WiseConfirmationScreen-Cplv20co.js +0 -12
  116. package/dist/assets/useAskAiCfoHostNavButtonProps-BBHohiIK.js +0 -1
  117. package/dist/assets/useFetchSuggestedQuestionsWhenReady-m6vzz_hW.js +0 -1
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-BGrTvYCQ.js";import{A as d}from"./AddressScreen-BMB6Kbyt.js";import i from"./NotFoundScreen-D8bJeRt0.js";import"./sentry-B-sG2CiU.js";import{n as s,o as r}from"./core-cQ_UGuA8.js";import"./zeni-epic-state-BObvmHAZ.js";import"./recharts-d-EnR1VF.js";import"./index-DaFoFUBf.js";import"./mui-bgnk9Y8D.js";import"./analytics-YTm4e0V2.js";import"./plaid-D86kekqV.js";import"./dnd-BKb14efZ.js";import"./stripe-DMRn4zHo.js";import"./lottie-DunuFFva.js";import"./lexical-Dhe13gAE.js";import"./pdf-pb-ViLbf.js";import"./utils-CU50wlH3.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]="4bd15e18-5b5f-4be1-8d33-8bd696c76da2",t._sentryDebugIdIdentifier="sentry-dbid-4bd15e18-5b5f-4be1-8d33-8bd696c76da2")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(d,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(d,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
@@ -0,0 +1,9 @@
1
+ import{j as d}from"./liveblocks-BGrTvYCQ.js";import{a as h}from"./sentry-B-sG2CiU.js";import{j as P,h as _,u as j,l as E,g as $,k as B}from"./core-cQ_UGuA8.js";import{J as M,h as D,z as L,S as K,B as R,w as z,d as I,f as m,Q as F,k as b,q as N}from"./index-DaFoFUBf.js";import{IZ as C,gI as U,eM as q,I_ as G,b$ as O,I$ as V,k2 as H}from"./zeni-epic-state-BObvmHAZ.js";import{n as J}from"./mui-bgnk9Y8D.js";import Q from"./NotFoundScreen-D8bJeRt0.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a5f972a4-0a15-42c1-968e-973b6ac2fe5f",e._sentryDebugIdIdentifier="sentry-dbid-a5f972a4-0a15-42c1-968e-973b6ac2fe5f")}catch{}})();const Z=J.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
+ `,W=B(function(e,t){const{addressId:o,isSubPage:i,addressType:c}=t,l=q(e),a=t.roleMap!=null&&G(t.roleMap),r=i||c==="user_address"||O(l?.userRole??[])||a?void 0:"readonly";if(o==null){const s=V(c,e);return{addressToEdit:s?.addressToCreate,loadingState:s?.status?.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:r,isSubPage:i,dontShowSaveConfirmationPopup:t.dontShowSaveConfirmation}}const n=C(e,o);return{addressToEdit:n.address,loadingState:n.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:r}},function(e,t){const{navigate:o,location:i,addressType:c}=t,l=a=>{if(a==="express-pay")o("../express-pay/add-wire");else{const r=i.state,n=N(r?.pathnameStackToGoBack);let s=n.poppedPathname??k();const u=r?.queryParams;if(u){const f=new URLSearchParams(u).toString();f&&(s=`${s}?${f}`)}o(s,{state:{pathnameStackToGoBack:n.newStack}})}};return{onSubmitHandler:a=>{const r=X(a);e(H({addressType:c,addressToCreate:r})),I?.trackSaveAddressClicked(m.Event.saveAddressClicked,{street:a.street.addressString,city:a.city,state:a.state,country:a.country.selectedOption??"",postalCode:a.postalCode,suite:a.suite,secondaryInfo:a.secondaryInfo}),l(t.bankAccountContext)},onCancel:()=>{l(t.bankAccountContext)}}})(F);function de({isSubPage:e,hideAddressSubTitle:t=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=P(),r=_(),n=j(),{addressId:s,addressType:u}=E(),f=M(),w=D(),v=L.getSignedInUser(),[g,x]=h.useState(s==null),p=$(S=>s!=null?C(S,s).fetchState:"Not-Started"),A=K();if(v==null)throw Error("Can't access address page without signing in...");const T=S=>S.trackPageLoaded(s!=null?m.Event.editAddress:m.Event.addAddress),y=l??u;return h.useEffect(()=>{g||s==null||(x(!0),r(U(s,!1)))},[g,s,r]),y==null||y.match(/(user_address|company_address|company_registered_address|vendor_address|officer_([1-9]|10)_address)$/g)?!g&&p==="Not-Started"||g&&p==="In-Progress"?d.jsx(R,{fetchState:p,style:{backgroundColor:w.colors.grey5}}):s!=null&&p==="Error"?(a(`${k(1)}/new`,{replace:!0}),d.jsx(d.Fragment,{})):d.jsxs(d.Fragment,{children:[d.jsx(z,{analytics:I,onLoad:T}),d.jsx(Z,{windowSize:f,children:d.jsx(W,{location:n,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:t,addressId:s,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:A?.loggedInUserRoleMap})})]}):d.jsx(Q,{})}const k=(e=2)=>{let t="../";for(let o=0;o<e;o++)t=`${t}../`;return t},X=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{de as A,X as t};
@@ -0,0 +1,11 @@
1
+ import{j as g}from"./liveblocks-BGrTvYCQ.js";import{a as i}from"./sentry-B-sG2CiU.js";import{h as te,j as se,u as ae,g as R,l as ne,k as oe}from"./core-cQ_UGuA8.js";import{K as ie,cB as re,z as le,J as ce,cC as ue,cD as de,cE as $,w as me,d as _,R as U,cF as pe,cG as fe,f as he,a1 as Se,cH as ge,T as Ce,v as we,q as j,cI as ke,cJ as Ie}from"./index-DaFoFUBf.js";import{fE as be,f3 as q,eM as Ee,hm as Te,Pv as Pe,eL as ye,hw as _e,hs as ve,fu as xe,fo as Ae,fh as Qe,fl as G,fp as Oe,fq as Fe,fr as Be,fs as De,ft as Le}from"./zeni-epic-state-BObvmHAZ.js";import{D as Me,n as v,P as Re,S as Ue}from"./mui-bgnk9Y8D.js";import{p as je}from"./pathToGoBack-CrwnkzZo.js";import"./recharts-d-EnR1VF.js";import"./analytics-YTm4e0V2.js";import"./plaid-D86kekqV.js";import"./dnd-BKb14efZ.js";import"./stripe-DMRn4zHo.js";import"./lottie-DunuFFva.js";import"./lexical-Dhe13gAE.js";import"./pdf-pb-ViLbf.js";import"./utils-CU50wlH3.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new a.Error().stack;r&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[r]="2b443012-8e21-4a8e-9416-01984c777d51",a._sentryDebugIdIdentifier="sentry-dbid-2b443012-8e21-4a8e-9416-01984c777d51")}catch{}})();const N="chat-response-generated",Ge=oe(function(a,r){const s=q(a),m=r.isSubmitting;return{showSampleQuestions:r.sessionFromUrl==="explore"&&s.uiState.currentChatSessionId==null,aiCfoView:s,isSubmitting:m,isNewChatSession:r.sessionFromUrl==="new_chat"||r.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Ce}/tableDownload`,emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,isFileUploadEnabled:r.isFileUploadEnabled}},function(a,r){const{location:s,currentTenant:m,userId:d,navigate:p,currentChatSessionId:f,allSessionsWithOrderedQuestionAnswers:C,setIsAiCfoOpen:l}=r;return{onEventReceived:(e,n)=>{if(e===N&&typeof n.text=="string"&&typeof n.metadata=="object"){const o=n,c=Fe(o.type),t=o.metadata.chat_session_id??null,{currentChatSession:w,currentQuestionAnswer:h,currentQuestionAnswerSummary:S}=$(C,t);c!=="answer"?_.trackAICFOChatResponseGenerated(c,h?.question.questionText??"",o.text,t,Ie(S,w),o.metadata.message_id??null):_.trackAICFOChatAnswerGenerated(o.text,h?.question.questionText??"",(o.follow_up_questions?.length??0)>0,!!o.assumptions,!!o.insights,o.visualization!=null,Be(o.visualization?.type??"")??null,t,o.summarized_title,o.metadata.message_id??null),a(De({chatSessionId:o.metadata.chat_session_id,responseType:c,fetchState:{fetchState:"Completed",error:void 0}})),a(Le({chatSessionId:o.metadata.chat_session_id,answerPayload:o,userId:d}))}},onSubmit:(e,n,o,c)=>{e&&ke(a,e,n,f,C,d,c,o)},updateCurrentInput:e=>{a(G(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{a(Oe(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{p(-1)},onCloseClick:()=>{const e=j(s.state?.pathnameStackToGoBack),n=e.poppedPathname??je(1);p(n,{state:{...s.state,pathnameStackToGoBack:e.newStack}}),a(G(""))},togglePageView:()=>{const e=j(s.state?.pathnameStackToGoBack),n=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;p(n,{state:{...s.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),l(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{p(-1)},onNewChatClick:()=>{f!=null&&a(Qe());const e=we(s.state?.pathnameStackToGoBack,s.pathname);p(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,n)=>{a(Ae({questionAnswerId:e,isCollapsed:n}))},onMenuClick:r.onMenuClick}})(Se(ge)),rt=({isFileUploadEnabled:a})=>{const{setIsAiCfoOpen:r}=ie(),s=te(),m=se(),d=ae(),[p,f]=i.useState(!1);i.useEffect(()=>{s(be())},[s]);const{customPageTitle:C}=re(),l=R(u=>q(u)),e=le.getSignedInUser(),{session_id:n}=ne(),o=ce(),c=R(u=>Ee(u)),t=l.uiState.currentChatSessionId,w=ue({currentTenant:c,currentChatSessionId:t,aiCfoView:l}),h=d.state,S=h?.aiCfoInitialQuestion,x=!!h?.aiCfoShouldSubmit,[V,b]=i.useState(null),[H,E]=i.useState(!1),A=i.useRef(!1);i.useEffect(()=>{A.current||S==null||S===""||(b(S),E(x),A.current=!0)},[S,x]);const W=i.useCallback(()=>{b(null),E(!1)},[]),Q=i.useMemo(()=>new URLSearchParams(d.search),[d.search]),O=Q.get("ref")??h?.aiCfoRef,T=Q.get("emailRefId")??h?.aiCfoEmailRefId,F=i.useRef(!1);i.useEffect(()=>{F.current||O!=="month-end-email"||T==null||t!=null||e==null||(s(Te("controller",e.userId,T,"MONTH_END_EMAIL")),F.current=!0)},[O,T,t,s,e]);const k=l.uiState.lastContextMessage;i.useEffect(()=>{k!=null&&k!==""&&t!=null&&(b(k),E(!0),s(Pe()))},[k,t,s]);const z=c.masterTOSInfo,I=z?.isMasterTOSAccepted??!1,{visitedSessions:B}=de(t),P=l.fetchState,y=l.uiState.chatSessionsNextPageToken.hasMore||!l.uiState.chatSessionsFirstPageFetched,D=t!=null?l.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",L=t==null||(l.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),M=l.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:J}=$(M,t),K=J.length===0;i.useEffect(()=>{I||m("../dashboard",{state:{...d.state,message:"open_ai_cfo_drawer"}})},[I]),i.useEffect(()=>{t!=null&&n!==t&&m(`../ai-cfo/${t}`,{state:{...d.state}})},[t,n]),i.useEffect(()=>{n!=null&&t==null&&n!=="new_chat"&&n!=="explore"&&s(ye({sessionId:n,agentId:"controller"}))},[]);const X=i.useMemo(()=>({events:B.map(u=>`private-chat-${u}.${N}`),eventCallback:(u,Z,ee)=>ee.onEventReceived(u,Z)}),[B]);if(i.useEffect(()=>{P!=="In-Progress"&&y&&s(_e())},[P,y,s]),i.useEffect(()=>{t!=null&&D!=="In-Progress"&&L&&e!=null&&P==="Completed"&&!y&&s(ve(t,e.userId))},[D,L,t,e,s]),e==null||n==null)throw Error("Can't access AI Controller page without signing in...");const Y=t!=null&&l.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";return g.jsxs(qe,{children:[g.jsx(me,{analytics:_,onLoad:u=>u.trackPageLoaded(he.Event.aiCFOPage)}),U(o)&&w.drawerElement,g.jsx(Ge,{...X,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:M,openOnboardingPage:()=>f(!0),userId:e.userId,setIsAiCfoOpen:r,navigate:m,sessionFromUrl:n,location:d,isSubmitting:Y,isEmptyChatWithSession:K,customPageTitle:C,currentTenant:c,emailLinkQuestion:V??void 0,autoSubmitEmailLinkQuestion:H,onEmailLinkQuestionProcessed:W,onMenuClick:U(o)?w.open:void 0,isFileUploadEnabled:a}),g.jsx(Me,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:Ne,style:{width:`${pe}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:g.jsx($e,{onClick:u=>u.stopPropagation(),children:g.jsx(fe,{isTOSAccepted:I,acceptMasterTOSState:l.masterTOSAcceptanceState,customPageTitle:C,onCloseClick:()=>f(!1),onCompleteClick:()=>{I||c.userRoleId==null||s(xe(c.userRoleId)),f(!1)}})})})]})},$e=v(Ue)`
2
+ display: flex;
3
+ min-height: 100%;
4
+ flex-direction: column;
5
+ `,qe=v.div`
6
+ height: 100vh;
7
+ width: 100%;
8
+ `,Ne=v(Re)`
9
+ box-shadow: ${({theme:a})=>a.colors.elevation2};
10
+ color: ${({theme:a})=>a.colors.grey4};
11
+ `;export{rt as default};
@@ -1 +1 @@
1
- import{j as l}from"./liveblocks-CGYIz1sf.js";import{a as f}from"./sentry-ClGNqxTu.js";import{j as U,u as B,h as j,g as v,N as $,k as T,l as L,n as O,o as h}from"./core--8kDo-LJ.js";import{eM as N,Mg as R,LY as b,x5 as w,w$ as F,x3 as I,wU as M,L_ as W,wX as q,x7 as z,x6 as C}from"./zeni-epic-state-Cb3mJiT_.js";import{h as P,z as k,v as V,a1 as X,bu as Y,aa as _,bv as G}from"./index-h4jm-UQJ.js";import"./mui-COKu087d.js";import{i as H}from"./ReimbursementApprovalRuleDetailScreen-eQzzNWqC.js";import J from"./NotFoundScreen-0YxizmXw.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="f2717f53-6456-4323-ad41-4abb58ea1941",e._sentryDebugIdIdentifier="sentry-dbid-f2717f53-6456-4323-ad41-4abb58ea1941")}catch{}})();const x="bill-approval-rule-update",K=T(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:a,location:p}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(x)&&e(W(!1))},onBackClick:()=>{_(p)?a("../../"):a("../../../bills/setup")},onDeleteRuleClick:t=>{e(M(t))},onEditRuleClick:t=>{t!=null?(e(I(t)),a(`./${t}/edit`)):(e(I()),a("./new"))}}})(X(Y)),Q=()=>{const e=U(),o=B(),a=j(),[p,t]=f.useState(!1),[u,s]=f.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>N(i)),r=v(i=>R(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(f.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&a(w())},[g]),f.useEffect(()=>{p||n!=="Not-Started"||(t(!0),a(F(!0)))},[p,n,a]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");f.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),a(I())),e("./new"))},[u,r,a]);const y={events:c.companyId!=null?[`private-${c.companyId}.${x}`]:[],eventCallback:(i,A,m)=>{i.endsWith(x)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx($,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(K,{currentTenant:c,location:o,navigate:e,...y})},Z=T(function(e,o){const a=b(e),p=a.billPaySetupApproverViewUpdateData?.type??"approval_create",t=p==="approval_create"&&a.allApprovalRules.length!==0;let u=a.allApprovalRules.length===0;return o.approvalRuleId&&(u=a.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:a,hideUpperBoundField:t,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:a,approvalUpdateDataView:p,approverViewData:t,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(y=>{const i=y.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),A=y.actors.selectedNonUsers.map(S=>{const E=!!H(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),m=i.concat(A);g.push({action:y.stepType.selectedOption,actors:m,operator:m.length>1?y.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(w()),s==="approval_update"||d?a("../"):t.allApprovalRules.length===0&&t.fetchState==="Completed"?a("../../setup"):a("../")},onBackClick:()=>{e(w()),s==="approval_update"||d?a("../"):t.allApprovalRules.length===0&&t.fetchState==="Completed"?a("../../setup"):a("../")},onSaveRuleClick:()=>{e(z())},onSaveRuleSuccess:()=>{a("../")}}})(G);function D(){const e=U(),o=j(),a=B(),{approvalRuleId:p}=L(),t=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>R(r)),[n,c]=f.useState(!1);if(f.useEffect(()=>{n||(c(!0),o(q(!0)))}),f.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),t==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Z,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:a})}function se(){return l.jsxs(O,{children:[l.jsx(h,{path:"/",element:l.jsx(Q,{})}),l.jsx(h,{path:"/new",element:l.jsx(D,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(h,{path:"*",element:l.jsx(J,{})})]})}export{se as B};
1
+ import{j as l}from"./liveblocks-BGrTvYCQ.js";import{a as y}from"./sentry-B-sG2CiU.js";import{j as U,u as B,h as j,g as v,N as $,k as T,l as L,n as O,o as h}from"./core-cQ_UGuA8.js";import{eM as N,Mg as R,LY as b,x5 as w,w$ as F,x3 as I,wU as M,L_ as W,wX as q,x7 as z,x6 as C}from"./zeni-epic-state-BObvmHAZ.js";import{h as P,z as k,B as V,a1 as X,bu as Y,aa as _,bv as G}from"./index-DaFoFUBf.js";import"./mui-bgnk9Y8D.js";import{i as H}from"./ReimbursementApprovalRuleDetailScreen-CGR7iPyc.js";import J from"./NotFoundScreen-D8bJeRt0.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="cee623a8-b41d-40b8-aae7-939f5ada85dd",e._sentryDebugIdIdentifier="sentry-dbid-cee623a8-b41d-40b8-aae7-939f5ada85dd")}catch{}})();const x="bill-approval-rule-update",K=T(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:a,location:p}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(x)&&e(W(!1))},onBackClick:()=>{_(p)?a("../../"):a("../../../bills/setup")},onDeleteRuleClick:t=>{e(M(t))},onEditRuleClick:t=>{t!=null?(e(I(t)),a(`./${t}/edit`)):(e(I()),a("./new"))}}})(X(Y)),Q=()=>{const e=U(),o=B(),a=j(),[p,t]=y.useState(!1),[u,s]=y.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>N(i)),r=v(i=>R(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&a(w())},[g]),y.useEffect(()=>{p||n!=="Not-Started"||(t(!0),a(F(!0)))},[p,n,a]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");y.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),a(I())),e("./new"))},[u,r,a]);const f={events:c.companyId!=null?[`private-${c.companyId}.${x}`]:[],eventCallback:(i,A,m)=>{i.endsWith(x)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx($,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(K,{currentTenant:c,location:o,navigate:e,...f})},Z=T(function(e,o){const a=b(e),p=a.billPaySetupApproverViewUpdateData?.type??"approval_create",t=p==="approval_create"&&a.allApprovalRules.length!==0;let u=a.allApprovalRules.length===0;return o.approvalRuleId&&(u=a.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:a,hideUpperBoundField:t,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:a,approvalUpdateDataView:p,approverViewData:t,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(f=>{const i=f.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),A=f.actors.selectedNonUsers.map(S=>{const E=!!H(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),m=i.concat(A);g.push({action:f.stepType.selectedOption,actors:m,operator:m.length>1?f.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(w()),s==="approval_update"||d?a("../"):t.allApprovalRules.length===0&&t.fetchState==="Completed"?a("../../setup"):a("../")},onBackClick:()=>{e(w()),s==="approval_update"||d?a("../"):t.allApprovalRules.length===0&&t.fetchState==="Completed"?a("../../setup"):a("../")},onSaveRuleClick:()=>{e(z())},onSaveRuleSuccess:()=>{a("../")}}})(G);function D(){const e=U(),o=j(),a=B(),{approvalRuleId:p}=L(),t=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>R(r)),[n,c]=y.useState(!1);if(y.useEffect(()=>{n||(c(!0),o(q(!0)))}),y.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),t==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Z,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:a})}function se(){return l.jsxs(O,{children:[l.jsx(h,{path:"/",element:l.jsx(Q,{})}),l.jsx(h,{path:"/new",element:l.jsx(D,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(h,{path:"*",element:l.jsx(J,{})})]})}export{se as B};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-CGYIz1sf.js";import{j as K,h as re,u as Q,l as te,g as v,N as ee,k as Y,i as la,n as sa,o as S}from"./core--8kDo-LJ.js";import{eM as Z,Ly as Ge,bu as At,GA as ra,bn as xt,bC as ue,Lz as Bt,wp as Et,xz as Ue,wY as ca,bm as je,LA as da,LB as pa,b$ as ua,LC as ma,jm as Dt,LD as jt,LE as Tt,y8 as Oe,wE as Be,LF as ba,wd as it,LG as ha,Bk as ga,wh as ya,wn as Pt,LH as Ie,LI as Ne,xA as ze,LJ as Sa,LK as fa,xD as Ze,LL as Ia,xQ as va,LM as Ft,xk as ot,xp as ka,LN as wa,LO as pe,LP as Rt,LQ as Lt,LR as Vt,fG as Ca,wJ as Me,ct as $t,LS as Aa,gy as xa,LT as Ba,LU as Ea,eT as Ut,eR as Mt,LV as He,LW as Da,LX as ja,Jh as We,LY as Ta,Ji as ie,Jj as qe,LZ as Pa,L_ as Fa,L$ as Ra,xr as lt,xo as La,M0 as Va,M1 as $a,M2 as Ua,xa as Ma,M3 as _a,M4 as Ga,M5 as Oa,cN as _t,cJ as Gt,jx as Na,bI as za,bp as Ot,bJ as Nt,vv as Za,M6 as Ha,B7 as Wa,Bd as qa,s2 as Ja,xB as Ka,yf as Qa,jK as fe,M7 as Ya,M8 as zt,kc as Xa,jE as Zt,jZ as Ht,jY as st,bB as be,bH as en,M9 as tn,Ma as ve,ig as an,Mb as rt,Mc as nn,ik as on,iG as ln,yt as sn,Md as rn,k5 as cn,yj as dn,Me as ct,yn as pn,ys as un,yp as mn,yh as bn,Mf as Wt,wy as hn,Mg as gn,Mh as yn,fA as Sn,fz as fn,fy as In,jN as vn,k3 as dt,ke as kn,pB as wn,jW as Cn,yl as An,ir as xn,kj as Bn,Mi as En,ii as Dn,ps as jn,Mj as Tn,xg as Pn,bD as Fn,br as Rn,Ig as Ln,cL as Vn,cK as $n,cs as Un,cy as Mn}from"./zeni-epic-state-Cb3mJiT_.js";import{h as me,z as L,S as ke,M as Je,i as oe,s as y,aI as Ee,v as ce,o as E,O as Te,d as j,b1 as _n,q as z,T as Ke,r as D,J as we,b2 as pt,b3 as ut,b4 as Gn,af as On,G as Nn,aC as zn,A as qt,D as Qe,I as Ye,b5 as Zn,ao as Jt,b6 as Hn,N as Wn,f as Kt,a1 as qn,b7 as Jn,b8 as Kn,b9 as Qn,ba as Yn,bb as Xn,bc as ei,bd as ti,be as ai,bf as ni,Z as ii,bg as oi,aZ as li,bh as si,bi as ri,a4 as ci}from"./index-h4jm-UQJ.js";import{n as V,S as di}from"./mui-COKu087d.js";import{A as mt}from"./AddressScreen-nigwI_KO.js";import{g as ne,a as Pe,i as Qt,V as Xe,b as et,c as pi,v as ui,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-BYpZqZEo.js";import{a as f}from"./sentry-ClGNqxTu.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-BBHohiIK.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-m6vzz_hW.js";import{u as Yt}from"./useInitialThreadRequest-CLJyupbh.js";import De from"./NotFoundScreen-0YxizmXw.js";import{D as bi}from"./DrawerScreen-DkRsu6_3.js";import{M as Xt}from"./MobileAppDrawer-CimbS3hY.js";import{F as ea}from"./FeaturePreviewScreen-Csy8zadv.js";import{S as Re}from"./SetupPagesScreen-C-SdBEE6.js";import{B as hi}from"./BillPayApprovalRoutes-BMer3wuj.js";import{FallBackRoute as gi}from"./ScreenRoutes-Dv_kin0Y.js";import"./recharts-jENt1xXk.js";import"./analytics-D76TbnBG.js";import"./plaid-DzMABTsR.js";import"./dnd-C7FILogn.js";import"./stripe-DMRn4zHo.js";import"./lottie-BwZdyUox.js";import"./lexical-roIufkFt.js";import"./pdf-CBQkrKS2.js";import"./utils-C9gYeSwW.js";import"./analyticsHelper-DMYHMyd-.js";import"./routePaths-NcYvgIlg.js";import"./BusinessVerificationPageScreen-CbiCbjAZ.js";import"./ReimbursementApprovalRuleDetailScreen-eQzzNWqC.js";import"./getLocaleForTenant-Blx2jmcV.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="073dbb04-1566-4fe6-8b32-4236f924a36c",e._sentryDebugIdIdentifier="sentry-dbid-073dbb04-1566-4fe6-8b32-4236f924a36c")}catch{}})();const yi=Y(function(e,t){const l=Ge(e,t.billId),n=L.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},p=z(t.location.state?.pathnameStackToGoBack);let o=!0;p.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=je(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,u=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,pa(t.currentTenant),n);d=m,u=b}const h=ua(t.currentTenant?.userRole??[]),g=l.transactionDetails!=null&&ma(l.transactionDetails,h,n);return{billDetails:l,isAccountingClassesEnabled:Dt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:h,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:u,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:p}=n;return{redirectToBillsScreen:()=>{const o=ne(p),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Ie({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Pt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(ya(l,s))},onSaveRealTimeApprovals:o=>{e(ga(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ha({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(it(l,o.type,"")):e(it(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Pe(p,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(p);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ba({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Tt({data:i,billId:l})),e(Oe(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(_n);function Si(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=L.getSignedInUser(),p=ke(),o=v(w=>Z(w)),s=v(w=>Ge(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Yt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoOpen:u,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:u,setIsAiCfoOpen:h,mobileExploreReferrer:"Bill Details"});at({isDataReady:s.fetchState==="Completed"});const b=o?.userRole!=null&&At(o?.userRole),A=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b,[T,I]=f.useState(!1),[k,H]=f.useState(!1),[M,_]=f.useState(!1),{useFeatureGate:F,useDynamicConfig:x}=oe(),{isFeatureEnabled:$}=F(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=F(y.isBillPayCommentingEnabled),{isFeatureEnabled:B}=F(y.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=x(Ee.zeniAssistConfig),W=ra(o),q=xt(o.userRole),J=A&&ue(p?.loggedInUserRoleMap),G=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=F(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&W===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||J||s.allApprovers.find(w=>w.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,J,o.isZeni,W,r]),f.useEffect(()=>{n!=null&&t(Bt(n))},[n]),f.useEffect(()=>{T||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(I(!0),t(Et(n??"",$,G,!1)))},[T,s,n,t]),f.useEffect(()=>{k||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,G,X,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(ca()))},[k,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(ee,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(ce,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${E.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:w=>(se=>{n!=null&&se.trackBillPayBillDetails(n,s.isRecurring)})(w)}),a.jsx(yi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:U,isRealTimeApprovalEnabled:M,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:G,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const ye=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=Y(function(e,t){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,p=r&&t.file==null;return{uploadInvoiceEndPoint:`${Jt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:j,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:p,style:{paddingTop:E.sp10,paddingRight:E.sp3,paddingBottom:"15px",paddingLeft:E.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=L.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ze(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(va({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(ze(n))},onDeleteClick:()=>{e(Ia({billId:t.billId})),j?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(zn);function C({appContent:e}){const t=re(),l=K(),{billId:n}=te(),c=Q(),r=c.pathname,p=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:u}=oe(),{isFeatureEnabled:h}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:A}=u(Ee.zeniAssistConfig),T=A.user_ids!=null&&i?.userId!=null&&A.user_ids.includes(i?.userId),I=v(w=>Z(w)),[k,H]=f.useState(!1),[M,_]=f.useState(!1),[F,x]=f.useState(!1),[$,U]=f.useState(),B=v(w=>Ne(w,h,m,n));let O=B.fetchState,W=B.file,q=B.showAutofill;const J=v(w=>Ge(w,n??""));p===!1&&(O=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const G=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{n==null&&t(ze(!0))},[n,t]),f.useEffect(()=>{O==="Not-Started"&&(p&&M?_(!1):!p&&k&&H(!1))},[n]),f.useEffect(()=>{k||n==null||p||(H(!0),t(Et(n,g,T,!1)),M||(_(!0),t(Ue(!1,g,T,b,n)))),p&&!M&&(_(!0),t(Ue(!1,g,T,b,n)))},[k,M,p,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","yes"),t(fa({replaceBillData:!0,billId:n})),t(Ze($,h,n))},onCancelClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","no"),t(Sa({file:$,billId:n}))}},X=f.useCallback(()=>{const w=z(c.state?.pathnameStackToGoBack),se=w.poppedPathname??ne(I.tenantEmailDomain);t(Ie({billId:n})),l(se,{state:{pathnameStackToGoBack:w.newStack}})},[c.state,I.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(O==="Error"||J.fetchState==="Error")return a.jsx(De,{});if(O!="Completed")return n==null&&o!=="small"?a.jsx(pt,{fallback:X,children:a.jsxs(Le,{windowSize:o,children:[a.jsx(gt,{}),a.jsx(Ve,{}),a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:void 0,setShowConfirmationPopup:x,setPayload:U,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:G}),a.jsx($e,{windowSize:o,children:a.jsx(ut,{isNewBill:!0})})]})}):a.jsxs(Le,{windowSize:o,children:[o==="small"||q?null:a.jsx(ht,{children:a.jsx(ta,{onClick:X})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(Gn,{}),a.jsx($e,{windowSize:o,children:a.jsx(ut,{isNewBill:n==null})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(pt,{fallback:X,children:a.jsxs(Le,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(On,{titleComponent:a.jsx(xi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Bi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:le,isEditPopup:!0}):null,o==="small"||q?null:a.jsx(ht,{children:a.jsx(Ii,{})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:q,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:vi(p,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:ki(p,B),isInitialEdit:!!B.isInitialEdit,billStage:w}),a.jsx($e,{windowSize:o,children:e})]})})}}function Ii(){const{triggerBack:e}=Zn();return a.jsx(ta,{onClick:e})}function vi(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(wi,{children:[a.jsx(Ci,{children:`${ye.recurringBill.recurringCycle}
1
+ import{j as a}from"./liveblocks-BGrTvYCQ.js";import{j as K,h as re,u as Q,l as te,g as v,N as ee,k as Y,i as la,n as sa,o as S}from"./core-cQ_UGuA8.js";import{eM as Z,Ly as Ge,bu as At,GA as ra,bn as Bt,bC as ue,Lz as xt,wp as Et,xz as Ue,wY as ca,bm as je,LA as da,LB as pa,b$ as ua,LC as ma,jm as Dt,LD as jt,LE as Tt,y8 as Oe,wE as xe,LF as ba,wd as it,LG as ha,Bk as ga,wh as ya,wn as Pt,LH as Ie,LI as Ne,xA as ze,LJ as Sa,LK as fa,xD as Ze,LL as Ia,xQ as va,LM as Ft,xk as ot,xp as ka,LN as wa,LO as pe,LP as Rt,LQ as Lt,LR as Vt,fG as Ca,wJ as Me,ct as $t,LS as Aa,gy as Ba,LT as xa,LU as Ea,eT as Ut,eR as Mt,LV as He,LW as Da,LX as ja,Jh as We,LY as Ta,Ji as ie,Jj as qe,LZ as Pa,L_ as Fa,L$ as Ra,xr as lt,xo as La,M0 as Va,M1 as $a,M2 as Ua,xa as Ma,M3 as _a,M4 as Ga,M5 as Oa,cN as _t,cJ as Gt,jx as Na,bI as za,bp as Ot,bJ as Nt,vv as Za,M6 as Ha,B7 as Wa,Bd as qa,s2 as Ja,xB as Ka,yf as Qa,jK as fe,M7 as Ya,M8 as zt,kc as Xa,jE as Zt,jZ as Ht,jY as st,bB as be,bH as en,M9 as tn,Ma as ve,ig as an,Mb as rt,Mc as nn,ik as on,iG as ln,yt as sn,Md as rn,k5 as cn,yj as dn,Me as ct,yn as pn,ys as un,yp as mn,yh as bn,Mf as Wt,wy as hn,Mg as gn,Mh as yn,fA as Sn,fz as fn,fy as In,jN as vn,k3 as dt,ke as kn,pB as wn,jW as Cn,yl as An,ir as Bn,kj as xn,Mi as En,ii as Dn,ps as jn,Mj as Tn,xg as Pn,bD as Fn,br as Rn,Ig as Ln,cL as Vn,cK as $n,cs as Un,cy as Mn}from"./zeni-epic-state-BObvmHAZ.js";import{h as me,z as L,S as ke,K as Je,i as oe,s as y,aI as Ee,B as ce,o as E,w as Te,d as j,b1 as _n,q as z,T as Ke,v as D,J as we,b2 as pt,b3 as ut,b4 as Gn,af as On,F as Nn,aC as zn,C as qt,D as Qe,H as Ye,b5 as Zn,ao as Jt,b6 as Hn,M as Wn,f as Kt,a1 as qn,b7 as Jn,b8 as Kn,b9 as Qn,ba as Yn,bb as Xn,bc as ei,bd as ti,be as ai,bf as ni,G as ii,bg as oi,aZ as li,bh as si,bi as ri,a4 as ci}from"./index-DaFoFUBf.js";import{n as V,S as di}from"./mui-bgnk9Y8D.js";import{A as mt}from"./AddressScreen-BMB6Kbyt.js";import{g as ne,a as Pe,i as Qt,V as Xe,b as et,c as pi,v as ui,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-CDLset95.js";import{a as f}from"./sentry-B-sG2CiU.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-AwLPsx7n.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-wonFIDms.js";import{u as Yt}from"./useInitialThreadRequest-DuxWYdX9.js";import De from"./NotFoundScreen-D8bJeRt0.js";import{D as bi}from"./DrawerScreen-CjKjzVJ3.js";import{M as Xt}from"./MobileAppDrawer-OybL2Okz.js";import{F as ea}from"./FeaturePreviewScreen-DCLqtwXF.js";import{S as Re}from"./SetupPagesScreen-CIFtnWYk.js";import{B as hi}from"./BillPayApprovalRoutes-DfIF_lRe.js";import{FallBackRoute as gi}from"./ScreenRoutes-33kyTNa0.js";import"./recharts-d-EnR1VF.js";import"./analytics-YTm4e0V2.js";import"./plaid-D86kekqV.js";import"./dnd-BKb14efZ.js";import"./stripe-DMRn4zHo.js";import"./lottie-DunuFFva.js";import"./lexical-Dhe13gAE.js";import"./pdf-pb-ViLbf.js";import"./utils-CU50wlH3.js";import"./analyticsHelper-BG68_Ecq.js";import"./routePaths-Dbo9mbXz.js";import"./BusinessVerificationPageScreen-Byg1Uhrv.js";import"./ReimbursementApprovalRuleDetailScreen-CGR7iPyc.js";import"./getLocaleForTenant-CX5wQdJ4.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3e8d8c6d-cf21-4742-8113-ffcdc0dcc70f",e._sentryDebugIdIdentifier="sentry-dbid-3e8d8c6d-cf21-4742-8113-ffcdc0dcc70f")}catch{}})();const yi=Y(function(e,t){const l=Ge(e,t.billId),n=L.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},p=z(t.location.state?.pathnameStackToGoBack);let o=!0;p.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=je(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,u=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,pa(t.currentTenant),n);d=m,u=b}const h=ua(t.currentTenant?.userRole??[]),g=l.transactionDetails!=null&&ma(l.transactionDetails,h,n);return{billDetails:l,isAccountingClassesEnabled:Dt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:h,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:u,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:p}=n;return{redirectToBillsScreen:()=>{const o=ne(p),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Ie({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Pt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(ya(l,s))},onSaveRealTimeApprovals:o=>{e(ga(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ha({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(it(l,o.type,"")):e(it(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(xe(l,"retry")):e(xe(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Pe(p,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(p);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ba({billId:t.billId}))},onRefundPaymentClick:()=>{e(xe(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Tt({data:i,billId:l})),e(Oe(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(_n);function Si(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=L.getSignedInUser(),p=ke(),o=v(w=>Z(w)),s=v(w=>Ge(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Yt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoOpen:u,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:u,setIsAiCfoOpen:h,mobileExploreReferrer:"Bill Details"});at({isDataReady:s.fetchState==="Completed"});const b=o?.userRole!=null&&At(o?.userRole),A=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b,[T,I]=f.useState(!1),[k,H]=f.useState(!1),[M,_]=f.useState(!1),{useFeatureGate:F,useDynamicConfig:B}=oe(),{isFeatureEnabled:$}=F(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=F(y.isBillPayCommentingEnabled),{isFeatureEnabled:x}=F(y.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=B(Ee.zeniAssistConfig),W=ra(o),q=Bt(o.userRole),J=A&&ue(p?.loggedInUserRoleMap),G=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=F(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&W===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||J||s.allApprovers.find(w=>w.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,J,o.isZeni,W,r]),f.useEffect(()=>{n!=null&&t(xt(n))},[n]),f.useEffect(()=>{T||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(I(!0),t(Et(n??"",$,G,!1)))},[T,s,n,t]),f.useEffect(()=>{k||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,G,X,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(ca()))},[k,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(ee,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(ce,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${E.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:w=>(se=>{n!=null&&se.trackBillPayBillDetails(n,s.isRecurring)})(w)}),a.jsx(yi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:U,isRealTimeApprovalEnabled:M,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:G,isDetectInsufficientFundsEnabled:x,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const ye=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=Y(function(e,t){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,p=r&&t.file==null;return{uploadInvoiceEndPoint:`${Jt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:j,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:p,style:{paddingTop:E.sp10,paddingRight:E.sp3,paddingBottom:"15px",paddingLeft:E.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=L.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ze(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(va({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(ze(n))},onDeleteClick:()=>{e(Ia({billId:t.billId})),j?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(zn);function C({appContent:e}){const t=re(),l=K(),{billId:n}=te(),c=Q(),r=c.pathname,p=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:u}=oe(),{isFeatureEnabled:h}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:A}=u(Ee.zeniAssistConfig),T=A.user_ids!=null&&i?.userId!=null&&A.user_ids.includes(i?.userId),I=v(w=>Z(w)),[k,H]=f.useState(!1),[M,_]=f.useState(!1),[F,B]=f.useState(!1),[$,U]=f.useState(),x=v(w=>Ne(w,h,m,n));let O=x.fetchState,W=x.file,q=x.showAutofill;const J=v(w=>Ge(w,n??""));p===!1&&(O=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const G=x.billPayInfo!=null&&x.billPayInfo.stage.code==="pending_approval"?x.billPayInfo.billStatus.code:x.billStage;f.useEffect(()=>{n==null&&t(ze(!0))},[n,t]),f.useEffect(()=>{O==="Not-Started"&&(p&&M?_(!1):!p&&k&&H(!1))},[n]),f.useEffect(()=>{k||n==null||p||(H(!0),t(Et(n,g,T,!1)),M||(_(!0),t(Ue(!1,g,T,b,n)))),p&&!M&&(_(!0),t(Ue(!1,g,T,b,n)))},[k,M,p,n,t]);const le={onOkClick:()=>{if(B(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","yes"),t(fa({replaceBillData:!0,billId:n})),t(Ze($,h,n))},onCancelClick:()=>{if(B(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","no"),t(Sa({file:$,billId:n}))}},X=f.useCallback(()=>{const w=z(c.state?.pathnameStackToGoBack),se=w.poppedPathname??ne(I.tenantEmailDomain);t(Ie({billId:n})),l(se,{state:{pathnameStackToGoBack:w.newStack}})},[c.state,I.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(O==="Error"||J.fetchState==="Error")return a.jsx(De,{});if(O!="Completed")return n==null&&o!=="small"?a.jsx(pt,{fallback:X,children:a.jsxs(Le,{windowSize:o,children:[a.jsx(gt,{}),a.jsx(Ve,{}),a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:x.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:void 0,setShowConfirmationPopup:B,setPayload:U,showActionButtons:!1,isInitialEdit:!!x.isInitialEdit,billStage:G}),a.jsx($e,{windowSize:o,children:a.jsx(ut,{isNewBill:!0})})]})}):a.jsxs(Le,{windowSize:o,children:[o==="small"||q?null:a.jsx(ht,{children:a.jsx(ta,{onClick:X})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(Gn,{}),a.jsx($e,{windowSize:o,children:a.jsx(ut,{isNewBill:n==null})})]});{const w=x.billPayInfo!=null&&x.billPayInfo.stage.code==="pending_approval"?x.billPayInfo.billStatus.code:x.billStage;return a.jsx(pt,{fallback:X,children:a.jsxs(Le,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(On,{titleComponent:a.jsx(Bi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:le,isEditPopup:!0}):null,o==="small"||q?null:a.jsx(ht,{children:a.jsx(Ii,{})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:q,uploadStatus:x.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:vi(p,J,x),setShowConfirmationPopup:B,setPayload:U,showActionButtons:ki(p,x),isInitialEdit:!!x.isInitialEdit,billStage:w}),a.jsx($e,{windowSize:o,children:e})]})})}}function Ii(){const{triggerBack:e}=Zn();return a.jsx(ta,{onClick:e})}function vi(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(wi,{children:[a.jsx(Ci,{children:`${ye.recurringBill.recurringCycle}
2
2
  ${n}/${c}`}),a.jsx(Ai,{})]}):void 0}function ki(e,t){const l=t.billActivities?.[0],n=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||n)}const ht=V.div`
3
3
  margin-bottom: 20px;
4
4
  margin-top: 20px;
@@ -64,13 +64,13 @@ import{j as a}from"./liveblocks-CGYIz1sf.js";import{j as K,h as re,u as Q,l as t
64
64
  flex-direction: column;
65
65
  width: ${e=>`${fi.containerWidth.value(e.windowSize)}%`};
66
66
  ${e=>e.windowSize!=="small"?"overflow: auto;":""}
67
- `,xi=V(Ye.H6Regular)`
67
+ `,Bi=V(Ye.H6Regular)`
68
68
  margin-top: ${E.sp7};
69
69
  padding-left: ${E.sp8};
70
70
  padding-right: ${E.sp8};
71
71
  color: ${e=>e.theme.colors.primary};
72
72
  word-break: break-word;
73
- `,Bi=V(Ye.LargeRegularSp)`
73
+ `,xi=V(Ye.LargeRegularSp)`
74
74
  color: ${e=>e.theme.colors.hero};
75
75
  padding-left: ${E.sp8};
76
76
  padding-right: ${E.sp8};
@@ -85,11 +85,11 @@ import{j as a}from"./liveblocks-CGYIz1sf.js";import{j as K,h as re,u as Q,l as t
85
85
  flex-direction: column;
86
86
  align-items: center;
87
87
  background-color: ${e=>e.theme.colors.grey4};
88
- `,Pi=Y(function(e,t){const l=L.getSignedInUser(),n=je(l),c=Vt(e,ae,t.isBulkActionEnabled,l?.userId);let r=c.allSubTabs;t.isUserHasOnlyBillpayAccess&&t.roleMap&&c.currentTab==="pending_approval"&&(t.roleMap.bill_pay_analyst?r=r.filter(b=>b==="all"||b==="overdue"||b==="rejected"||b==="deleted"):t.roleMap.bill_pay_approver&&(r=r.filter(b=>b==="all"||b==="awaiting_my_approval"||b==="overdue"||b==="rejected"||b==="deleted"))),t.isShowDeletedBillsEnabled===!1&&(r=r.filter(b=>b!=="deleted"));const p=e.entityAutoCompleteState.autoCompleteText.common,o=We(e,"common"),s=e.tenantState.currentTenantId,i=Z(e),d=i?.companyName??"",u={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},h=e.billListState.downloadUIState.downloadState,g=c.fetchState,m=Ta(e);return{transactionList:t.isShowDeletedBillsEnabled?c.transactions:c.transactions.filter(b=>b.isDeleted===!1),currentTab:c.currentTab,currentSubTab:c.currentSubTab,approvalCount:c.approvalCount,allSubTabs:r,fetchState:g,analytics:j,botEmail:c.billPayBotEmail,searchText:c.searchText,filters:c.filters,vendorSearchAutoCompleteData:{autoCompleteText:p,entityAutoCompleteView:o},downloadParams:{authParams:u,companyName:d,timePeriod:ae,spendManagementEndPoint:`${Ke}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:h,isBulkActionAllowed:c.billListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:c.billListBulkActionInfo?.billsSelectedForBulkAction,allowedBulkActions:c.billListBulkActionInfo?.allowedBulkActions,isZeniUser:n,billPayApprovalRulesAffectedEntityIds:m.affectedEntityIds}},function(e,t){const{navigate:l,currentTenant:n,location:c,period:r}=t,{tenantEmailDomain:p}=n;return{updateTabToState:o=>{e(pe()),e(Rt(o))},onSubtabChange:o=>{e(pe()),e(Lt(o))},onTransactionClick:(o,s)=>{const i=Pe(p,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);l(i,{state:{pathnameStackToGoBack:d}})},onClickSetupIcon:()=>{const o=Ri(p),s=D(c.state?.pathnameStackToGoBack,c.pathname);l(o,{state:{pathnameStackToGoBack:s}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;j?.trackBillPayNewBill();const s=`/${o}/bill/new`,i=D(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(s,{state:{pathnameStackToGoBack:i}})},onSearchTextChanged:o=>{e(_a(o))},onReloadTransactions:()=>{e(Me(r,!0,t.isShowDeletedBillsEnabled,t.isInternationalWireEnabled)),e(Ma(n.companyId,!0))},onNavigateToSettings:()=>{l("../bills/setup")},onBackClick:()=>{l("../",{relative:"path"})},onFiltersChange:o=>{e(Ua({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($a({uiState:{downloadState:o}}))},updateBulkActionList:o=>{e(Va(o))},removeAllTransactionsFromBulkActionList:()=>{e(pe())},onProceedForBulkActionClick:(o,s)=>{switch(o){case"delete":case"cancel":e(La(o,s??""));break;case"send_for_approval":e(lt("send_for_approval")),t.navigate("./bulk-review");break;case"approve":e(lt("approve")),t.navigate("./bulk-review");break;case"review":e(Ra()),t.navigate("./bulk-review")}},onBillPayApprovalRulesEventReceived:o=>{o.endsWith(_e)&&e(Fa(!1))},onEventReceived:o=>{o===aa&&e(Pa())},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(qe({searchString:o,entityType:"vendor",searchOrigin:"common"})):o.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}}}})(qn(Jn));function Fi(){const{isAiCfoOpen:e,setIsAiCfoOpen:t}=Je(),l=K(),n=re(),c=Q(),r=we(),p=c.state,o=ke(),[s,i]=f.useState(!1),[d,u]=f.useState(null),h=la("/:tenantEmailDomain/bills/bulk-review")!=null;f.useEffect(()=>(p?.tab!=null&&p?.subTab!=null&&(n(Rt(p?.tab)),n(Lt(p?.subTab))),()=>{n(pe())}),[]);const g=L.getSignedInUser(),m=v(P=>Z(P)),{areTenantIdsInSync:b}=Wn(),[A,T]=f.useState(!1),{useFeatureGate:I}=oe(),{isFeatureEnabled:k}=I(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:H}=I(y.isBillPayCommentingEnabled),{isFeatureEnabled:M}=I(y.isReimbursementCommentingEnabled),{isFeatureEnabled:_}=I(y.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:F}=I(y.isBillPayBulkActionEnabled),{isFeatureEnabled:x}=I(y.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:$}=I(y.isBillPayDetectInsufficientFundsEnabled),U=v(P=>Vt(P,ae,F,g?.userId)),{isFeatureEnabled:B}=I(y.isDebitCardFeatureEnabled),O=U.fetchState,{isAiCfoAccessEnabled:W,onAskAiCfoClick:q}=tt({isAiCfoOpen:e,setIsAiCfoOpen:t,mobileExploreReferrer:"Bills List"});at({isDataReady:O==="Completed"});const J=!!m.companyBillPayInfo?.info?.isBillPayTOSAccepted,G=!!m.companyBillPayInfo?.info?.isBillPayEnabled,le=v(P=>Ca(P.companyState,m.companyId)),X=le?.company.featuresActivationInfo.connectedAccountProvider;if(f.useEffect(()=>{!A&&G&&b&&(T(!0),n(Me(ae,!0,k,x)))},[A,ae,b,n]),g==null)throw Error("Can't access address page without signing in...");const w=(P,de)=>{n(Da({uiState:{sortKey:P,sortOrder:de},period:ae}))},se=$t(o?.loggedInUserRoleMap),Fe=ue(o?.loggedInUserRoleMap),Ce=P=>{i(P)},{billsProcessed:N,billsProcessing:Ae}=v(P=>Aa(P));f.useEffect(()=>{N===Ae&&d!=null&&(n(xa({messageSection:"bill_pay_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_bill_",variableValue:N>1?St.bills:St.bill},{variableName:"_has_",variableValue:N>1?yt.texts.have:yt.texts.has},{variableName:"_action_",variableValue:Ba(d)}]})),n(Ea()),setTimeout(()=>{n(Me(ae,!0,k,!0,x))},3e3),u(null))},[N,Ae]);const na={events:m.companyId!=null?[`private-${m.companyId}.${aa}`,`private-${m.companyId}.${_e}`]:[],eventCallback:(P,de,nt)=>{P.endsWith(_e)?nt.onBillPayApprovalRulesEventReceived?.(P):de?.entity_type==="bill"&&(u(de.operation_type),nt.onEventReceived(P))}},ia=Ut(B,m),oa=Mt(m);return c.pathname.endsWith("/bills/")||c.pathname.endsWith("/bills")||c.pathname.endsWith("/bills/bulk-review")?ia===!0||oa===!0?a.jsx(ea,{}):G?a.jsxs(a.Fragment,{children:[O==="Completed"?a.jsx(Te,{analytics:j,onLoad:P=>(de=>de.trackPageLoaded(Kt.Event.billPayHome))(P)}):null,a.jsxs(Ti,{windowSize:r,children:[a.jsx(Xt,{isAppContentDrawerOpen:s,handleDrawerToggle:Ce}),a.jsx(bi,{isOpen:h,drawerLeftMargin:new qt(0,0,300,600),onClose:()=>{l("./"),n(pe())},children:a.jsx(Li,{onClick:P=>P.stopPropagation(),children:a.jsx(Di,{})})}),a.jsx(Pi,{location:c,navigate:l,currentTenant:m,entity:"bill_pay",isBillPayCommentingEnabled:H,isReimbursementCommentingEnabled:M,period:ae,isAdmin:!1,uiState:U.uiState,onColumnSortConfigChanged:w,isUserHasOnlyBillpayAccess:se,isShowDeletedBillsEnabled:k,isShowDeletedReimbursementEnabled:_,isBulkActionEnabled:F,roleMap:o?.loggedInUserRoleMap,onClickMenuIcon:()=>{Ce(!0)},isDownloadEnabled:U.isDownloadEnabled,connectedAccountProvider:X,bulkSubmissionLimit:U.billBulkSubmissionLimit,bulkSubmissionFetchState:U.billListBulkActionInfo.bulkSubmissionFetchState,isRecurringBillInBulkActionList:U.billListBulkActionInfo.isRecurringBillInBulkActionList,isInternationalWireEnabled:x,isDetectInsufficientFundsEnabled:$,isAiCfoAccessEnabled:W,onAskAiCfoClick:q,...na})]})]}):J===!0&&Fe===!0?a.jsx(ee,{to:"../setup"}):o!=null&&He(m,o.loggedInUserRoleMap)?a.jsx(ee,{to:"../promo"}):a.jsx(ce,{fetchState:O}):a.jsx(De,{})}const Ri=e=>`/${e}/bills/setup`,Li=V(di)`
88
+ `,Pi=Y(function(e,t){const l=L.getSignedInUser(),n=je(l),c=Vt(e,ae,t.isBulkActionEnabled,l?.userId);let r=c.allSubTabs;t.isUserHasOnlyBillpayAccess&&t.roleMap&&c.currentTab==="pending_approval"&&(t.roleMap.bill_pay_analyst?r=r.filter(b=>b==="all"||b==="overdue"||b==="rejected"||b==="deleted"):t.roleMap.bill_pay_approver&&(r=r.filter(b=>b==="all"||b==="awaiting_my_approval"||b==="overdue"||b==="rejected"||b==="deleted"))),t.isShowDeletedBillsEnabled===!1&&(r=r.filter(b=>b!=="deleted"));const p=e.entityAutoCompleteState.autoCompleteText.common,o=We(e,"common"),s=e.tenantState.currentTenantId,i=Z(e),d=i?.companyName??"",u={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},h=e.billListState.downloadUIState.downloadState,g=c.fetchState,m=Ta(e);return{transactionList:t.isShowDeletedBillsEnabled?c.transactions:c.transactions.filter(b=>b.isDeleted===!1),currentTab:c.currentTab,currentSubTab:c.currentSubTab,approvalCount:c.approvalCount,allSubTabs:r,fetchState:g,analytics:j,botEmail:c.billPayBotEmail,searchText:c.searchText,filters:c.filters,vendorSearchAutoCompleteData:{autoCompleteText:p,entityAutoCompleteView:o},downloadParams:{authParams:u,companyName:d,timePeriod:ae,spendManagementEndPoint:`${Ke}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:h,isBulkActionAllowed:c.billListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:c.billListBulkActionInfo?.billsSelectedForBulkAction,allowedBulkActions:c.billListBulkActionInfo?.allowedBulkActions,isZeniUser:n,billPayApprovalRulesAffectedEntityIds:m.affectedEntityIds}},function(e,t){const{navigate:l,currentTenant:n,location:c,period:r}=t,{tenantEmailDomain:p}=n;return{updateTabToState:o=>{e(pe()),e(Rt(o))},onSubtabChange:o=>{e(pe()),e(Lt(o))},onTransactionClick:(o,s)=>{const i=Pe(p,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);l(i,{state:{pathnameStackToGoBack:d}})},onClickSetupIcon:()=>{const o=Ri(p),s=D(c.state?.pathnameStackToGoBack,c.pathname);l(o,{state:{pathnameStackToGoBack:s}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;j?.trackBillPayNewBill();const s=`/${o}/bill/new`,i=D(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(s,{state:{pathnameStackToGoBack:i}})},onSearchTextChanged:o=>{e(_a(o))},onReloadTransactions:()=>{e(Me(r,!0,t.isShowDeletedBillsEnabled,t.isInternationalWireEnabled)),e(Ma(n.companyId,!0))},onNavigateToSettings:()=>{l("../bills/setup")},onBackClick:()=>{l("../",{relative:"path"})},onFiltersChange:o=>{e(Ua({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($a({uiState:{downloadState:o}}))},updateBulkActionList:o=>{e(Va(o))},removeAllTransactionsFromBulkActionList:()=>{e(pe())},onProceedForBulkActionClick:(o,s)=>{switch(o){case"delete":case"cancel":e(La(o,s??""));break;case"send_for_approval":e(lt("send_for_approval")),t.navigate("./bulk-review");break;case"approve":e(lt("approve")),t.navigate("./bulk-review");break;case"review":e(Ra()),t.navigate("./bulk-review")}},onBillPayApprovalRulesEventReceived:o=>{o.endsWith(_e)&&e(Fa(!1))},onEventReceived:o=>{o===aa&&e(Pa())},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(qe({searchString:o,entityType:"vendor",searchOrigin:"common"})):o.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}}}})(qn(Jn));function Fi(){const{isAiCfoOpen:e,setIsAiCfoOpen:t}=Je(),l=K(),n=re(),c=Q(),r=we(),p=c.state,o=ke(),[s,i]=f.useState(!1),[d,u]=f.useState(null),h=la("/:tenantEmailDomain/bills/bulk-review")!=null;f.useEffect(()=>(p?.tab!=null&&p?.subTab!=null&&(n(Rt(p?.tab)),n(Lt(p?.subTab))),()=>{n(pe())}),[]);const g=L.getSignedInUser(),m=v(P=>Z(P)),{areTenantIdsInSync:b}=Wn(),[A,T]=f.useState(!1),{useFeatureGate:I}=oe(),{isFeatureEnabled:k}=I(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:H}=I(y.isBillPayCommentingEnabled),{isFeatureEnabled:M}=I(y.isReimbursementCommentingEnabled),{isFeatureEnabled:_}=I(y.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:F}=I(y.isBillPayBulkActionEnabled),{isFeatureEnabled:B}=I(y.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:$}=I(y.isBillPayDetectInsufficientFundsEnabled),U=v(P=>Vt(P,ae,F,g?.userId)),{isFeatureEnabled:x}=I(y.isDebitCardFeatureEnabled),O=U.fetchState,{isAiCfoAccessEnabled:W,onAskAiCfoClick:q}=tt({isAiCfoOpen:e,setIsAiCfoOpen:t,mobileExploreReferrer:"Bills List"});at({isDataReady:O==="Completed"});const J=!!m.companyBillPayInfo?.info?.isBillPayTOSAccepted,G=!!m.companyBillPayInfo?.info?.isBillPayEnabled,le=v(P=>Ca(P.companyState,m.companyId)),X=le?.company.featuresActivationInfo.connectedAccountProvider;if(f.useEffect(()=>{!A&&G&&b&&(T(!0),n(Me(ae,!0,k,B)))},[A,ae,b,n]),g==null)throw Error("Can't access address page without signing in...");const w=(P,de)=>{n(Da({uiState:{sortKey:P,sortOrder:de},period:ae}))},se=$t(o?.loggedInUserRoleMap),Fe=ue(o?.loggedInUserRoleMap),Ce=P=>{i(P)},{billsProcessed:N,billsProcessing:Ae}=v(P=>Aa(P));f.useEffect(()=>{N===Ae&&d!=null&&(n(Ba({messageSection:"bill_pay_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_bill_",variableValue:N>1?St.bills:St.bill},{variableName:"_has_",variableValue:N>1?yt.texts.have:yt.texts.has},{variableName:"_action_",variableValue:xa(d)}]})),n(Ea()),setTimeout(()=>{n(Me(ae,!0,k,!0,B))},3e3),u(null))},[N,Ae]);const na={events:m.companyId!=null?[`private-${m.companyId}.${aa}`,`private-${m.companyId}.${_e}`]:[],eventCallback:(P,de,nt)=>{P.endsWith(_e)?nt.onBillPayApprovalRulesEventReceived?.(P):de?.entity_type==="bill"&&(u(de.operation_type),nt.onEventReceived(P))}},ia=Ut(x,m),oa=Mt(m);return c.pathname.endsWith("/bills/")||c.pathname.endsWith("/bills")||c.pathname.endsWith("/bills/bulk-review")?ia===!0||oa===!0?a.jsx(ea,{}):G?a.jsxs(a.Fragment,{children:[O==="Completed"?a.jsx(Te,{analytics:j,onLoad:P=>(de=>de.trackPageLoaded(Kt.Event.billPayHome))(P)}):null,a.jsxs(Ti,{windowSize:r,children:[a.jsx(Xt,{isAppContentDrawerOpen:s,handleDrawerToggle:Ce}),a.jsx(bi,{isOpen:h,drawerLeftMargin:new qt(0,0,300,600),onClose:()=>{l("./"),n(pe())},children:a.jsx(Li,{onClick:P=>P.stopPropagation(),children:a.jsx(Di,{})})}),a.jsx(Pi,{location:c,navigate:l,currentTenant:m,entity:"bill_pay",isBillPayCommentingEnabled:H,isReimbursementCommentingEnabled:M,period:ae,isAdmin:!1,uiState:U.uiState,onColumnSortConfigChanged:w,isUserHasOnlyBillpayAccess:se,isShowDeletedBillsEnabled:k,isShowDeletedReimbursementEnabled:_,isBulkActionEnabled:F,roleMap:o?.loggedInUserRoleMap,onClickMenuIcon:()=>{Ce(!0)},isDownloadEnabled:U.isDownloadEnabled,connectedAccountProvider:X,bulkSubmissionLimit:U.billBulkSubmissionLimit,bulkSubmissionFetchState:U.billListBulkActionInfo.bulkSubmissionFetchState,isRecurringBillInBulkActionList:U.billListBulkActionInfo.isRecurringBillInBulkActionList,isInternationalWireEnabled:B,isDetectInsufficientFundsEnabled:$,isAiCfoAccessEnabled:W,onAskAiCfoClick:q,...na})]})]}):J===!0&&Fe===!0?a.jsx(ee,{to:"../setup"}):o!=null&&He(m,o.loggedInUserRoleMap)?a.jsx(ee,{to:"../promo"}):a.jsx(ce,{fetchState:O}):a.jsx(De,{})}const Ri=e=>`/${e}/bills/setup`,Li=V(di)`
89
89
  display: flex;
90
90
  min-height: 100%;
91
91
  flex-direction: column;
92
- `,{common:{currency:Se},spendManagement:{billPay:{billDetails:Vi}},appName:$i}=Qe.getLocalizedStrings(),Ui=Y(function(e,t){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=z(t.location.state?.pathnameStackToGoBack);let p=!0;r.poppedPathname?.includes("bills")===!0&&(p=!1);const o=e.entityAutoCompleteState.autoCompleteText.common,s=We(e,"common");let i=`${l?.firstName} ${l?.lastName}`;const d=je(l);t.billId!=null&&t.billDetailsView!=null&&(i=`${t.billDetailsView.createdBy?.firstName??$i} ${t.billDetailsView.createdBy?.lastName??""}`),d||!t.billDetailsView.createdBy?.email?.includes("zeni.ai")||(i="Zeni");const u=t.billDetailsView.editBillInitialDetails?.totalAmount?.amount,h=za(t.billDetailsView.paymentDetailsSection?.paymentType?.method),g=t.currentTenant.createTime,m=Ot(),b=t.sameDayAchDisablementConfig.newTenantTenureLimitMonths,A=g.add(b,"month").isAfter(m),T=!!(t.billDetailsView.billStage==="draft"&&h&&u!=null&&u>0)&&!Nt(u,t.billDetailsView.approvalRules.allApprovalRules,l),I=Z(e);return{billDetails:t.billDetailsView,isAccountingClassesEnabled:Dt(e),billId:t.billId,createdBy:i,createTime:t.billDetailsView?.createTime,authParams:c,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,analytics:j,showBackButton:p,isAdmin:t.isBillPayAdmin,isSuperAdmin:t.isSuperAdmin,connectedAccountProvider:I.company?.featuresActivationInfo.connectedAccountProvider??"",customerSearchAutoCompleteData:{autoCompleteText:o,entityAutoCompleteView:s},showMarkAsPaidInfo:T,isZeniUser:d,isNewUser:A,sameDayAchDisablementConfig:t.sameDayAchDisablementConfig}},function(e,t){const{billId:l,companyId:n,currentTenant:c,location:r,navigate:p,billDetailsView:o}=t,{tenantEmailDomain:s}=c;return{editVendor:i=>{e(st(i));const d=It(s,i,l),u=D(r.state?.pathnameStackToGoBack,r.pathname);p(d,{state:{pathnameStackToGoBack:u}})},chooseNewVendor:i=>{const d=i??t.billDetailsView.addBillAutoFields.tentativeVendorName;d!=null&&e(Zt(d,!1)),e(Ht({localData:{vendorName:i??t.billDetailsView.addBillAutoFields.tentativeVendorName}})),e(st());const u=It(s,void 0,l),h=D(r.state?.pathnameStackToGoBack,r.pathname);p(u,{state:{pathnameStackToGoBack:h}})},onInvoiceUpload:i=>{i!=null&&e(Ze(i,t.isVendorRecommendationEnabled))},updateShowAutofill:i=>{e(ze(i))},onSaveChangesToLocalStore:(i,d,u,h,g)=>{const m=Oi(t.billDetailsView,{...i,paymentDetails:{...i?.paymentDetails,paymentDate:g}},u,d,t.isInternationalPaymentShaVsOurEnabled,h,t.vendor);e(Xa({billDetailLocalData:m,billId:l}))},saveBillDetails:()=>{e(Oe("draft",!1,!1,l)),e(ie("common"))},updateBillDetailSaveBillCode:()=>{e(zt("draft"))},reviewBillDetails:()=>{const i=Mi(s,l),d=D(r.state?.pathnameStackToGoBack,r.pathname);p(i,{state:{pathnameStackToGoBack:d,message:"coming_from_edit_page"}})},discardBillDetailsFromLocalStore:({billId:i})=>{e(Ie({billId:i}))},clearBillPayReviewLocalState:()=>e(Ya()),onClickDismiss:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);p(i,{state:{pathnameStackToGoBack:d}})},onClickDiscard:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);p(i,{state:{pathnameStackToGoBack:d}})},setBillDetailPageMode:i=>{if(i==="edit_bill"){let d=window.location.pathname;d=d.concat("/edit");const u=D(r.state?.pathnameStackToGoBack,r.pathname);p(d,{state:{pathnameStackToGoBack:u}})}},redirectToACHScreen:i=>{e(fe(!1,i));const d=_i(s,i,l),u=D(r.state?.pathnameStackToGoBack,r.pathname);p(d,{state:{pathnameStackToGoBack:u}})},redirectToWireScreen:i=>{e(fe(!1,i));const d=Gi(s,i,l),u=D(r.state?.pathnameStackToGoBack,r.pathname);p(d,{state:{pathnameStackToGoBack:u}})},redirectToInternationalScreen:i=>{e(fe(!1,i));const d=Qt(s,l,i),u=D(r.state?.pathnameStackToGoBack,r.pathname);p(d,{state:{pathnameStackToGoBack:u}})},redirectToBillsScreen:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);e(Ie({})),p(i,{state:{pathnameStackToGoBack:d}})},redirectToBillDetailPage:()=>{t.navigate("../")},deleteBill:()=>{l!=null&&e(Pt(l))},onAttachmentClick:(i,d)=>{const u=Pe(s,i,d);window.open(`${u}`,"_blank")},onBackClick:()=>{const i=z(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ne(s);p(d,{state:{pathnameStackToGoBack:i.newStack}})},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(qe({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}},addVendorContactEmail(i,d){e(Qa(i,d,l))},onWiseVerifyClick:()=>{let i="";i=Xn()?"https://sandbox.transferwise.tech":"https://wise.com";const d=`${i}/login`;window.open(d,"_blank")},onVendorSelected:i=>{e(Ka(!0,i,l))},onSignUpAccountClick:()=>{t.hasZeniAccountsAdminAccess?window.open(`/${s}/checking/promo`,"_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onMoveMoneyClick:()=>{t.isZeniAccountsUser?window.open(`/${s}/checking/transfer`):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onInternationalWireVerifyClick:()=>{window.open(`/${s}/bills/international-wire`)},onFetchLinkTokenClick:(i,d)=>{e(Ja("bill_pay_detail",i,d))},onEstablishConnectionClick:i=>{e(qa(i,n,"bill_pay_detail","bill_pay"))},onUpdatePaymentAccountStatus:(i,d,u)=>{e(Wa(i,d,"bill_pay","bill_pay_detail",u))},onEstablishConnectionSuccess:()=>{e(Za("bill_pay","bill_pay_detail")),e(Ha({billId:l,withdrawFromAccountId:o.newAddedBillPaymentAccountId,withdrawFromList:o.withdrawFromList}))}}})(Kn);function ft(){const e=K(),t=Q(),l=re(),{billId:n,tenantEmailDomain:c}=te(),{useFeatureGate:r,useDynamicConfig:p}=oe(),{isFeatureEnabled:o,isFeatureGateLoading:s}=r(y.isVendorMagicLinkFeatureEnabled),{isFeatureEnabled:i}=r(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:d}=r(y.isBillPayCommentingEnabled),{isFeatureEnabled:u}=r(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:h}=r(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=r(y.isRecurringBillsFeatureEnabled),{isFeatureEnabled:m}=r(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=r(y.isShaDisabled),{isFeatureEnabled:A}=r(y.isOurDisabled),{isFeatureEnabled:T}=r(y.isBillPayDetectInsufficientFundsEnabled),{configValue:I}=p(Ee.zeniAccountsConfig),k=Ga(I),{configValue:H}=p(Ee.sameDayAchDisablementConfig),M=Oa(H),_=L.getSignedInUser(),F=v(N=>Z(N)),x=v(N=>Ne(N,h,m,n)),$=Yt(F?.companyId,{clearParams:x.fetchState==="Completed"}),{isAiCfoOpen:U,setIsAiCfoOpen:B}=Je(),{isAiCfoAccessEnabled:O,onAskAiCfoClick:W}=tt({isAiCfoOpen:U,setIsAiCfoOpen:B,mobileExploreReferrer:"Bill Details"});at({isDataReady:x.fetchState==="Completed"});const q=F.companyId??L.getSignedInUserTenant(c)?.companyId,J=!!F.companyZeniAccountInfo?.info?.isZeniAccountEnabled,G=ke(),le=_t(G?.loggedInUserRoleMap),X=Gt(G?.loggedInUserRoleMap),w=ue(G?.loggedInUserRoleMap),se=xt(F.userRole);if(f.useEffect(()=>{n!=null&&l(Bt(n))},[n]),_==null)throw Error("Can't access address page without signing in...");const Fe=v(N=>Na(N.accountState,N.accountListState,"billPayAccountList")),Ce={pathname:"../",search:t.search};return x.isDeleted===!0||x.billStage=="paid"||x.fetchState=="Not-Started"?a.jsx(ee,{to:Ce}):x.deleteStatus.fetchState==="In-Progress"||s?a.jsx(ce,{fetchState:x.deleteStatus.fetchState}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:N=>(Ae=>{n!=null&&x.deleteStatus.fetchState!=="Completed"&&Ae.trackBillPayEditBill(n,x.isRecurring)})(N)}),a.jsx(Ui,{initialOpenThreadRequest:$??void 0,location:t,navigate:e,currentTenant:F,billId:n,companyId:q,billDetailsView:x,isMagicLinkEnabled:o,isVendorRecommendationEnabled:h,isLocalCurrencyEnabled:u,uncategorizedAccounts:Fe,isInternationalPaymentShaVsOurEnabled:i,vendor:x.vendor,isBillPayCommentingEnabled:d,isShaDisabled:b,isOurDisabled:A,isRecurringBillsFeatureEnabled:g,isAccountsEnabled:J,hasZeniAccountsAdminAccess:le,isZeniAccountsUser:X,isBillPayAdmin:w,isSuperAdmin:se,accountsPromoConfig:k,isDetectInsufficientFundsEnabled:T,sameDayAchDisablementConfig:M,isAiCfoAccessEnabled:O,onAskAiCfoClick:W})]})}const It=(e,t,l)=>{let n=`/${e}/bill/`;return l==null?n=t!=null?n.concat(`new/vendor/${encodeURIComponent(t)}/edit`):n.concat("new/vendor/create"):(n=n.concat(`${encodeURIComponent(l)}/edit/vendor/`),n=t!=null?n.concat(`${encodeURIComponent(t)}/edit`):n.concat("create")),n},Mi=(e,t)=>{let l=`/${e}/bill/`;return l=t===void 0?l.concat("new/review"):l.concat(`${t}/edit/review`),l},_i=(e,t,l)=>{let n=`/${e}/bill/`;return n=l!=null?n.concat(`${encodeURIComponent(l)}/edit/`):n.concat("new/"),n=n.concat(`vendor/${encodeURIComponent(t)}/edit/ach`),n},Gi=(e,t,l)=>{let n=`/${e}/bill/`;return n=l!=null?n.concat(`${encodeURIComponent(l)}/edit/`):n.concat("new/"),n=n.concat(`vendor/${encodeURIComponent(t)}/edit/domestic`),n},R="paymentDetails",Oi=(e,t,l,n,c,r,p)=>{const o={invoiceNumber:t.whatFor.invoiceNumber,memo:t.whatFor.memo,invoiceDate:t.whatFor.invoiceDate?be(t.whatFor.invoiceDate.toString()):Ot(),billDueDate:t.whatFor.billDueDate?be(t.whatFor.billDueDate.toString()):void 0,currencyCode:t.whatFor.currency,recipientCurrencyCode:t.whatFor.recipientCurrency,isInvoiceDateAutoUpdated:t.whatFor.isInvoiceDateAutoUpdated},s={paymentDate:t[R]?.paymentDate?be(t[R].paymentDate.toString()):void 0,paymentType:t[R]?.paymentType!=null?t[R]?.paymentType:void 0,paymentTo:r?.id,withdrawFrom:e.withdrawFromList.find(b=>b.id===t[R]?.withdrawFrom?.selectedOption),internationalTransferFeeBearerPaymentMethod:t[R]?.paymentType?.method!=null&&t[R].paymentType.method.includes(en)&&p?.vendorCurrencyCode===Se.currencyCode&&c?t[R]?.internationalTransferFeeBearerPaymentMethod:void 0,conversionRate:e.paymentDetailsSection?.conversionRate},i=r?.type==="Contact"?r?.email:void 0,d=!!i,u=t[R]?.recurringPaymentType?.selectedOption===Vi.recurringBill.paymentTypeOptions[1],h={isActive:e.recurringConfig?.isActive??!1,currentInstance:e.recurringConfig?.currentInstance,isApprovalRequired:t[R]?.recurringPaymentDetails?.requireApproval?.selectedOption==="all",frequency:tn(t[R]?.recurringPaymentDetails?.frequency?.selectedOption),endDate:t[R]?.recurringPaymentDetails?.endDateSelector?.date!=null?be(t[R]?.recurringPaymentDetails?.endDateSelector.date.toString()):void 0,startDate:t[R]?.recurringPaymentDetails?.startDate?be(t[R]?.recurringPaymentDetails?.startDate.toString()):void 0,endDateSelectorOptionType:t[R]?.recurringPaymentDetails?.endDateSelector?.type,totalPaymentCycles:t[R]?.recurringPaymentDetails?.endDateSelector?.recurringCount??0,updateRecurringBills:t[R]?.recurringPaymentDetails?.updateRecurringBills},g=Ni(e.accountList.accounts,e.classList.classes,e.lineDetailSection,t.lineItems,n,l),m=Object.keys(g).length>0?Qn(g):e.editBillInitialDetails?.recipientTotalAmount;return{showVendorGptRecommendationText:e.showVendorGptRecommendationText,vendor:p,whatForSection:o,paymentDetailsSection:s,isCancelled:e.isCancelled,totalAmount:m,recipientTotalAmount:m,file:e.file,updatesByLineId:g,toAccountVendorEmail:i,isCollectToAccountInfoFromVendorContact:d,isRecurring:u,recurringConfig:h}},Ni=(e,t,l,n,c,r)=>{const p={};return n.forEach(o=>{let s,i;o.account.selectedOption!=null&&(s=e.find(u=>u.qboId===o.account.selectedOption||u.accountId===o.account.selectedOption)),o.class?.selectedOption!=null&&(i=t.find(u=>u.classId===o.class.selectedOption));const d=Yn(l[o.lineId],o,c,r);p[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??Se.currencyCode,currencySymbol:o.currency?.currencySymbol??Se.currencySymbol},recipientAmount:{amount:o.recipientAmount??0,currencyCode:o.recipientCurrency?.currencyCode??Se.currencyCode,currencySymbol:o.recipientCurrency?.currencySymbol??Se.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}}),p},zi=V.div`
92
+ `,{common:{currency:Se},spendManagement:{billPay:{billDetails:Vi}},appName:$i}=Qe.getLocalizedStrings(),Ui=Y(function(e,t){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=z(t.location.state?.pathnameStackToGoBack);let p=!0;r.poppedPathname?.includes("bills")===!0&&(p=!1);const o=e.entityAutoCompleteState.autoCompleteText.common,s=We(e,"common");let i=`${l?.firstName} ${l?.lastName}`;const d=je(l);t.billId!=null&&t.billDetailsView!=null&&(i=`${t.billDetailsView.createdBy?.firstName??$i} ${t.billDetailsView.createdBy?.lastName??""}`),d||!t.billDetailsView.createdBy?.email?.includes("zeni.ai")||(i="Zeni");const u=t.billDetailsView.editBillInitialDetails?.totalAmount?.amount,h=za(t.billDetailsView.paymentDetailsSection?.paymentType?.method),g=t.currentTenant.createTime,m=Ot(),b=t.sameDayAchDisablementConfig.newTenantTenureLimitMonths,A=g.add(b,"month").isAfter(m),T=!!(t.billDetailsView.billStage==="draft"&&h&&u!=null&&u>0)&&!Nt(u,t.billDetailsView.approvalRules.allApprovalRules,l),I=Z(e);return{billDetails:t.billDetailsView,isAccountingClassesEnabled:Dt(e),billId:t.billId,createdBy:i,createTime:t.billDetailsView?.createTime,authParams:c,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,analytics:j,showBackButton:p,isAdmin:t.isBillPayAdmin,isSuperAdmin:t.isSuperAdmin,connectedAccountProvider:I.company?.featuresActivationInfo.connectedAccountProvider??"",customerSearchAutoCompleteData:{autoCompleteText:o,entityAutoCompleteView:s},showMarkAsPaidInfo:T,isZeniUser:d,isNewUser:A,sameDayAchDisablementConfig:t.sameDayAchDisablementConfig}},function(e,t){const{billId:l,companyId:n,currentTenant:c,location:r,navigate:p,billDetailsView:o}=t,{tenantEmailDomain:s}=c;return{editVendor:i=>{e(st(i));const d=It(s,i,l),u=D(r.state?.pathnameStackToGoBack,r.pathname);p(d,{state:{pathnameStackToGoBack:u}})},chooseNewVendor:i=>{const d=i??t.billDetailsView.addBillAutoFields.tentativeVendorName;d!=null&&e(Zt(d,!1)),e(Ht({localData:{vendorName:i??t.billDetailsView.addBillAutoFields.tentativeVendorName}})),e(st());const u=It(s,void 0,l),h=D(r.state?.pathnameStackToGoBack,r.pathname);p(u,{state:{pathnameStackToGoBack:h}})},onInvoiceUpload:i=>{i!=null&&e(Ze(i,t.isVendorRecommendationEnabled))},updateShowAutofill:i=>{e(ze(i))},onSaveChangesToLocalStore:(i,d,u,h,g)=>{const m=Oi(t.billDetailsView,{...i,paymentDetails:{...i?.paymentDetails,paymentDate:g}},u,d,t.isInternationalPaymentShaVsOurEnabled,h,t.vendor);e(Xa({billDetailLocalData:m,billId:l}))},saveBillDetails:()=>{e(Oe("draft",!1,!1,l)),e(ie("common"))},updateBillDetailSaveBillCode:()=>{e(zt("draft"))},reviewBillDetails:()=>{const i=Mi(s,l),d=D(r.state?.pathnameStackToGoBack,r.pathname);p(i,{state:{pathnameStackToGoBack:d,message:"coming_from_edit_page"}})},discardBillDetailsFromLocalStore:({billId:i})=>{e(Ie({billId:i}))},clearBillPayReviewLocalState:()=>e(Ya()),onClickDismiss:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);p(i,{state:{pathnameStackToGoBack:d}})},onClickDiscard:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);p(i,{state:{pathnameStackToGoBack:d}})},setBillDetailPageMode:i=>{if(i==="edit_bill"){let d=window.location.pathname;d=d.concat("/edit");const u=D(r.state?.pathnameStackToGoBack,r.pathname);p(d,{state:{pathnameStackToGoBack:u}})}},redirectToACHScreen:i=>{e(fe(!1,i));const d=_i(s,i,l),u=D(r.state?.pathnameStackToGoBack,r.pathname);p(d,{state:{pathnameStackToGoBack:u}})},redirectToWireScreen:i=>{e(fe(!1,i));const d=Gi(s,i,l),u=D(r.state?.pathnameStackToGoBack,r.pathname);p(d,{state:{pathnameStackToGoBack:u}})},redirectToInternationalScreen:i=>{e(fe(!1,i));const d=Qt(s,l,i),u=D(r.state?.pathnameStackToGoBack,r.pathname);p(d,{state:{pathnameStackToGoBack:u}})},redirectToBillsScreen:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);e(Ie({})),p(i,{state:{pathnameStackToGoBack:d}})},redirectToBillDetailPage:()=>{t.navigate("../")},deleteBill:()=>{l!=null&&e(Pt(l))},onAttachmentClick:(i,d)=>{const u=Pe(s,i,d);window.open(`${u}`,"_blank")},onBackClick:()=>{const i=z(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ne(s);p(d,{state:{pathnameStackToGoBack:i.newStack}})},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(qe({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}},addVendorContactEmail(i,d){e(Qa(i,d,l))},onWiseVerifyClick:()=>{let i="";i=Xn()?"https://sandbox.transferwise.tech":"https://wise.com";const d=`${i}/login`;window.open(d,"_blank")},onVendorSelected:i=>{e(Ka(!0,i,l))},onSignUpAccountClick:()=>{t.hasZeniAccountsAdminAccess?window.open(`/${s}/checking/promo`,"_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onMoveMoneyClick:()=>{t.isZeniAccountsUser?window.open(`/${s}/checking/transfer`):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onInternationalWireVerifyClick:()=>{window.open(`/${s}/bills/international-wire`)},onFetchLinkTokenClick:(i,d)=>{e(Ja("bill_pay_detail",i,d))},onEstablishConnectionClick:i=>{e(qa(i,n,"bill_pay_detail","bill_pay"))},onUpdatePaymentAccountStatus:(i,d,u)=>{e(Wa(i,d,"bill_pay","bill_pay_detail",u))},onEstablishConnectionSuccess:()=>{e(Za("bill_pay","bill_pay_detail")),e(Ha({billId:l,withdrawFromAccountId:o.newAddedBillPaymentAccountId,withdrawFromList:o.withdrawFromList}))}}})(Kn);function ft(){const e=K(),t=Q(),l=re(),{billId:n,tenantEmailDomain:c}=te(),{useFeatureGate:r,useDynamicConfig:p}=oe(),{isFeatureEnabled:o,isFeatureGateLoading:s}=r(y.isVendorMagicLinkFeatureEnabled),{isFeatureEnabled:i}=r(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:d}=r(y.isBillPayCommentingEnabled),{isFeatureEnabled:u}=r(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:h}=r(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=r(y.isRecurringBillsFeatureEnabled),{isFeatureEnabled:m}=r(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=r(y.isShaDisabled),{isFeatureEnabled:A}=r(y.isOurDisabled),{isFeatureEnabled:T}=r(y.isBillPayDetectInsufficientFundsEnabled),{configValue:I}=p(Ee.zeniAccountsConfig),k=Ga(I),{configValue:H}=p(Ee.sameDayAchDisablementConfig),M=Oa(H),_=L.getSignedInUser(),F=v(N=>Z(N)),B=v(N=>Ne(N,h,m,n)),$=Yt(F?.companyId,{clearParams:B.fetchState==="Completed"}),{isAiCfoOpen:U,setIsAiCfoOpen:x}=Je(),{isAiCfoAccessEnabled:O,onAskAiCfoClick:W}=tt({isAiCfoOpen:U,setIsAiCfoOpen:x,mobileExploreReferrer:"Bill Details"});at({isDataReady:B.fetchState==="Completed"});const q=F.companyId??L.getSignedInUserTenant(c)?.companyId,J=!!F.companyZeniAccountInfo?.info?.isZeniAccountEnabled,G=ke(),le=_t(G?.loggedInUserRoleMap),X=Gt(G?.loggedInUserRoleMap),w=ue(G?.loggedInUserRoleMap),se=Bt(F.userRole);if(f.useEffect(()=>{n!=null&&l(xt(n))},[n]),_==null)throw Error("Can't access address page without signing in...");const Fe=v(N=>Na(N.accountState,N.accountListState,"billPayAccountList")),Ce={pathname:"../",search:t.search};return B.isDeleted===!0||B.billStage=="paid"||B.fetchState=="Not-Started"?a.jsx(ee,{to:Ce}):B.deleteStatus.fetchState==="In-Progress"||s?a.jsx(ce,{fetchState:B.deleteStatus.fetchState}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:N=>(Ae=>{n!=null&&B.deleteStatus.fetchState!=="Completed"&&Ae.trackBillPayEditBill(n,B.isRecurring)})(N)}),a.jsx(Ui,{initialOpenThreadRequest:$??void 0,location:t,navigate:e,currentTenant:F,billId:n,companyId:q,billDetailsView:B,isMagicLinkEnabled:o,isVendorRecommendationEnabled:h,isLocalCurrencyEnabled:u,uncategorizedAccounts:Fe,isInternationalPaymentShaVsOurEnabled:i,vendor:B.vendor,isBillPayCommentingEnabled:d,isShaDisabled:b,isOurDisabled:A,isRecurringBillsFeatureEnabled:g,isAccountsEnabled:J,hasZeniAccountsAdminAccess:le,isZeniAccountsUser:X,isBillPayAdmin:w,isSuperAdmin:se,accountsPromoConfig:k,isDetectInsufficientFundsEnabled:T,sameDayAchDisablementConfig:M,isAiCfoAccessEnabled:O,onAskAiCfoClick:W})]})}const It=(e,t,l)=>{let n=`/${e}/bill/`;return l==null?n=t!=null?n.concat(`new/vendor/${encodeURIComponent(t)}/edit`):n.concat("new/vendor/create"):(n=n.concat(`${encodeURIComponent(l)}/edit/vendor/`),n=t!=null?n.concat(`${encodeURIComponent(t)}/edit`):n.concat("create")),n},Mi=(e,t)=>{let l=`/${e}/bill/`;return l=t===void 0?l.concat("new/review"):l.concat(`${t}/edit/review`),l},_i=(e,t,l)=>{let n=`/${e}/bill/`;return n=l!=null?n.concat(`${encodeURIComponent(l)}/edit/`):n.concat("new/"),n=n.concat(`vendor/${encodeURIComponent(t)}/edit/ach`),n},Gi=(e,t,l)=>{let n=`/${e}/bill/`;return n=l!=null?n.concat(`${encodeURIComponent(l)}/edit/`):n.concat("new/"),n=n.concat(`vendor/${encodeURIComponent(t)}/edit/domestic`),n},R="paymentDetails",Oi=(e,t,l,n,c,r,p)=>{const o={invoiceNumber:t.whatFor.invoiceNumber,memo:t.whatFor.memo,invoiceDate:t.whatFor.invoiceDate?be(t.whatFor.invoiceDate.toString()):Ot(),billDueDate:t.whatFor.billDueDate?be(t.whatFor.billDueDate.toString()):void 0,currencyCode:t.whatFor.currency,recipientCurrencyCode:t.whatFor.recipientCurrency,isInvoiceDateAutoUpdated:t.whatFor.isInvoiceDateAutoUpdated},s={paymentDate:t[R]?.paymentDate?be(t[R].paymentDate.toString()):void 0,paymentType:t[R]?.paymentType!=null?t[R]?.paymentType:void 0,paymentTo:r?.id,withdrawFrom:e.withdrawFromList.find(b=>b.id===t[R]?.withdrawFrom?.selectedOption),internationalTransferFeeBearerPaymentMethod:t[R]?.paymentType?.method!=null&&t[R].paymentType.method.includes(en)&&p?.vendorCurrencyCode===Se.currencyCode&&c?t[R]?.internationalTransferFeeBearerPaymentMethod:void 0,conversionRate:e.paymentDetailsSection?.conversionRate},i=r?.type==="Contact"?r?.email:void 0,d=!!i,u=t[R]?.recurringPaymentType?.selectedOption===Vi.recurringBill.paymentTypeOptions[1],h={isActive:e.recurringConfig?.isActive??!1,currentInstance:e.recurringConfig?.currentInstance,isApprovalRequired:t[R]?.recurringPaymentDetails?.requireApproval?.selectedOption==="all",frequency:tn(t[R]?.recurringPaymentDetails?.frequency?.selectedOption),endDate:t[R]?.recurringPaymentDetails?.endDateSelector?.date!=null?be(t[R]?.recurringPaymentDetails?.endDateSelector.date.toString()):void 0,startDate:t[R]?.recurringPaymentDetails?.startDate?be(t[R]?.recurringPaymentDetails?.startDate.toString()):void 0,endDateSelectorOptionType:t[R]?.recurringPaymentDetails?.endDateSelector?.type,totalPaymentCycles:t[R]?.recurringPaymentDetails?.endDateSelector?.recurringCount??0,updateRecurringBills:t[R]?.recurringPaymentDetails?.updateRecurringBills},g=Ni(e.accountList.accounts,e.classList.classes,e.lineDetailSection,t.lineItems,n,l),m=Object.keys(g).length>0?Qn(g):e.editBillInitialDetails?.recipientTotalAmount;return{showVendorGptRecommendationText:e.showVendorGptRecommendationText,vendor:p,whatForSection:o,paymentDetailsSection:s,isCancelled:e.isCancelled,totalAmount:m,recipientTotalAmount:m,file:e.file,updatesByLineId:g,toAccountVendorEmail:i,isCollectToAccountInfoFromVendorContact:d,isRecurring:u,recurringConfig:h}},Ni=(e,t,l,n,c,r)=>{const p={};return n.forEach(o=>{let s,i;o.account.selectedOption!=null&&(s=e.find(u=>u.qboId===o.account.selectedOption||u.accountId===o.account.selectedOption)),o.class?.selectedOption!=null&&(i=t.find(u=>u.classId===o.class.selectedOption));const d=Yn(l[o.lineId],o,c,r);p[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??Se.currencyCode,currencySymbol:o.currency?.currencySymbol??Se.currencySymbol},recipientAmount:{amount:o.recipientAmount??0,currencyCode:o.recipientCurrency?.currencyCode??Se.currencyCode,currencySymbol:o.recipientCurrency?.currencySymbol??Se.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}}),p},zi=V.div`
93
93
  display: flex;
94
94
  height: 100vh;
95
95
  width: 100%;
@@ -116,4 +116,4 @@ import{j as a}from"./liveblocks-CGYIz1sf.js";import{j as K,h as re,u as Q,l as t
116
116
  align-items: center;
117
117
  background-color: ${e=>e.theme.colors.grey4};
118
118
  box-shadow: ${e=>`0px 2px ${E.sp1} ${e.theme.colors.dropShadowNormal}`};
119
- `,Ki=Y(function(e,t){const l=L.getSignedInUser(),n=Wt(e,t.billId),c=gn(e),r=je(l),p=n.totalAmount.amount,o=n.billPayInfo?.stage.code!=="scheduled"&&c.allApprovalRules.length>0&&!Nt(p,c.allApprovalRules,l);return{billDetails:n,billId:t.billId,billpayApprovalView:c,analytics:j,isApprovalRequiredForMarkAsPaid:o,isZeniUser:r}},function(e,t){const{location:l,billId:n,currentTenant:c,navigate:r}=t,{tenantEmailDomain:p}=c;return{redirectToBillsScreen:()=>{const o=ne(c.tenantEmailDomain),s=D(l.state?.pathnameStackToGoBack,l.pathname);r(o,{state:{pathnameStackToGoBack:s}})},discardBillDetailsFromLocalStore:()=>{e(Ie({}))},saveBillDetails:(o,s)=>{o&&e(Tt({billId:n,data:s})),e(Oe(o?"paid":"pending_approval",o,!1,n))},discardOutsideZeniPaymentData:()=>{e(jt({billId:n}))},updateBillDetailSaveBillCode:()=>{e(zt("pending_approval"))},onClickEdit:()=>{t.navigate("../",{relative:"path"})},onAttachmentClick:(o,s)=>{const i=Pe(p,o,s);window.open(`${i}`,"_blank")},retryPayment:()=>{t.billId!=null&&e(Be(t.billId,"retry"))}}})(ni);function Ct(){const e=K(),t=re(),l=Q(),{billId:n}=te(),{useFeatureGate:c}=oe(),{isFeatureEnabled:r}=c(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:p}=c(y.isBillPayDetectInsufficientFundsEnabled),o=we(),s=L.getSignedInUser(),{isFeatureEnabled:i}=c(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:d}=c(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:u}=c(y.isBillPayCommentingEnabled),h=z(l.state?.pathnameStackToGoBack),{poppedPathname:g}=h,{isFeatureEnabled:m}=c(y.isRecurringBillsFeatureEnabled),b=v(I=>Z(I)),A=v(I=>Wt(I,n)),T=A.fetchState??"Not-Started";if(f.useEffect(()=>(window.onbeforeunload=function(){return e(l,{state:{message:""}}),!0},()=>{window.onbeforeunload=null}),[e]),f.useEffect(()=>{l.state?.message!=="coming_from_edit_page"&&e(`../${n}`)},[]),f.useEffect(()=>{const I=A.vendor?.name,k=A.vendor?.id,H=A.totalAmount.amount,M=A.recipientTotalAmount.amount,_=A.invoiceNumber;I&&k&&t(hn(I,k,H,M,_,n))},[]),g==null)return a.jsx(ee,{to:`../${n}`});if(s==null)throw Error("Can't access address page without signing in...");return T==="In-Progress"?a.jsx(wt,{windowSize:o,children:a.jsx(ai,{})}):a.jsx(wt,{windowSize:o,children:a.jsx(Ki,{location:l,navigate:e,currentTenant:b,billId:n,isBillPayCommentingEnabled:u,isLocalCurrencyEnabled:i,isVendorRecommendationEnabled:d,isInternationalPaymentShaVsOurEnabled:r,isRecurringBillsFeatureEnabled:m,isDetectInsufficientFundsEnabled:p})})}const Qi=Y(function(e,t){const{vendorId:l}=t,n=e.entityAutoCompleteState.autoCompleteText.common,c=We(e,"common"),r=l!=null?"edit":"create",p=Z(e),o=L.getSignedInUser(),s=p.tenantId,i={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:s??""};return{vendorViewDetails:t.vendorViewDetails,screenType:r,filesEndPoint:`${Jt.fileMicroServiceBaseUrl}`,authParams:i,analytics:j,vendorSearchAutoCompleteData:{autoCompleteText:n,entityAutoCompleteView:c}}},function(e,t){const{billId:l,currentTenant:n,navigate:c,location:r,vendorId:p,themeState:o}=t,{tenantEmailDomain:s}=n;return{onSaveVendor:i=>{e(Dn(p??void 0,t.billId)),i!=null&&e(jn(i))},saveVendorDetailLocalData:i=>{e(Ht({vendorId:p,localData:i}))},saveContactsInVendorDetailLocalData:i=>{e(En({vendorId:p,contacts:i}))},resetVendorDetailLocalData:()=>{e(dt(p))},updateSelectedVendorForCreate:i=>{e(Bn(i))},navigateToBankDetailPage:(i,d)=>{let u;i==="wire"?u=d==="international"?Qt(s,t.billId,p):mi(s,t.billId,p):u=ui(s,t.billId,p);const h=D(r.state?.pathnameStackToGoBack,r.pathname);c(u,{state:{pathnameStackToGoBack:h}})},onRemoveBankAccount:(i,d)=>{e(d===!0?An(i,"vendor",p):xn(i,"vendor",p))},navigateToMailingAddressPage:i=>{const d=et(s,i,l),u=D(r.state?.pathnameStackToGoBack,r.pathname);c(d,{state:{pathnameStackToGoBack:u}})},updateFilesEntity:i=>{e(Cn({files:i}))},onEditFileName:(i,d)=>{e(wn(i,d.split(".")[0]))},handleZeniLogoClick:()=>{o.toggle()},updateSaveFetchState:()=>{p==null&&e(dt(t.vendorViewDetails.newVendorState?.vendorBasic?.id)),e(kn("Not-Started",p))},onVendorSelected:i=>{i!=null&&e(vn(i,!0))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(qe({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}},onBackClick:()=>{e(ie("common"));const i=z(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??pi(n.tenantEmailDomain,t.billId);c(d,{state:{pathnameStackToGoBack:i.newStack}})},onGetOtp:i=>{e(In(i,"BillPayVendor"))},onResendOtp:i=>{e(fn(i,"BillPayVendor"))},onVerifyOtp:(i,d)=>{e(Sn(i,d,"BillPayVendor"))},onVerifyOtpSuccess:(i,d,u)=>{e(yn(i,d,u))},onFetchAndUpdateVendorRecommendations:i=>{e(Zt(i,!1))}}})(si),xe=()=>{const e=K(),t=re(),l=ii(),n=Q(),{billId:c,vendorId:r}=te(),p=v(b=>Z(b)),{useFeatureGate:o}=oe(),{isFeatureEnabled:s}=o(y.isBillPayLocalCurrencyFeatureEnabled),[i,d]=f.useState(!1),u=v(b=>b.vendorViewState.newVendorState.fetchStatus.fetchState),h=v(b=>ve(b,r)),g=v(b=>r!==void 0?b.vendorViewState.editVendorStateById[r]?.fetchStatus??"Not-Started":"Not-Started"),m=r!==void 0?g:u;return f.useEffect(()=>{i===!1&&m==="Not-Started"&&r!=null&&(t(fe(!1,r)),d(!0))},[i,m,r]),h.fetchState==="Not-Started"||h.fetchState==="In-Progress"?a.jsx(oi,{}):m==="Error"?a.jsx(li,{onGoHome:()=>e("../",{replace:!0}),onReload:()=>window.location.reload()}):a.jsxs(a.Fragment,{children:[a.jsx(Xe,{vendorId:r,billId:c}),a.jsx(Qi,{navigate:e,location:n,themeState:l,currentTenant:p,vendorId:r,billId:c,vendorViewDetails:h,isLocalCurrencyEnabled:s})]})},Yi=Y(function(e,t){const{companyId:l}=t;return{billPaySetupView:Tn(e,l),analytics:j,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",videoUrl:"https://player.vimeo.com/video/787873426?h=9d9389b1dc&badge=0&autopause=0&player_id=0&app_id=58479"}},function(e,t){const{companyId:l,navigate:n}=t;return{onButtonClick:()=>{e(Pn(l))},onBackClick:()=>{n("../..",{relative:"path"})},onSetupBillPaySuccess:()=>{n("../bills/setup",{relative:"path"})}}})(ri),Xi=()=>{const e=K(),t=Q(),{tenantEmailDomain:l}=te(),[n,c]=f.useState(!1),r=me(),p=v(g=>Z(g)),o=p.companyId??L.getSignedInUserTenant(l)?.companyId,s=L.getSignedInUser(),i=ke(),d=!!p.companyBillPayInfo?.info?.isBillPayTOSAccepted,u=ue(i?.loggedInUserRoleMap),h=g=>{c(g)};if(s==null)throw Error("Can't access bill pay promo page without signing in...");return p.companyBillPayInfo?.info?.isBillPayEnabled===!0?a.jsx(ee,{to:"../../../bills"}):d===!0&&u===!0?a.jsx(ee,{to:"../../bills/setup"}):d===!1||i!=null&&He(p,i.loggedInUserRoleMap)?a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:g=>(m=>m.trackPageLoaded(Kt.Event.billPayPromoPage))(g)}),a.jsx(Xt,{isAppContentDrawerOpen:n,handleDrawerToggle:h}),a.jsx(Yi,{companyId:o,navigate:e,location:t,onClickMenuIcon:()=>{h(!0)}})]}):a.jsx(ce,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Fo(){const e=v(U=>Z(U)),t=ke(),l=ue(t?.loggedInUserRoleMap),n=me(),{useFeatureGate:c}=oe(),{isFeatureEnabled:r}=c(y.isBillPayLocalCurrencyFeatureEnabled),p=r===!0?Ji:Hi,{isFeatureEnabled:o}=c(y.isDebitCardFeatureEnabled),s=Ut(o,e),i=Mt(e),d=Q(),u=e?.userRole!=null&&At(e?.userRole),h=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!u)&&ue(t?.loggedInUserRoleMap),g=$t(t?.loggedInUserRoleMap),m=(e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!u)&&Fn(t?.loggedInUserRoleMap),{isFeatureEnabled:b}=c(y.isDepositAccountsFeatureEnabled),A=b&&!u&&_t(t?.loggedInUserRoleMap),{isFeatureEnabled:T}=c(y.isChargeCardFeatureEnabled),I=ci(e,T,o)&&!u&&Rn(t?.loggedInUserRoleMap),k=Ln(t?.loggedInUserRoleMap),H=Gt(t?.loggedInUserRoleMap),M=Vn(t?.loggedInUserRoleMap),_=$n(t?.loggedInUserRoleMap),F=Un(t?.loggedInUserRoleMap),x=Mn(t?.loggedInUserRoleMap),{tenantEmailDomain:$}=te();return a.jsxs(sa,{children:[d.pathname.includes("/bills")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"setup",element:a.jsx(Re,{isBillPayAdminLevelAccess:h,isUserHasOnlyBillPayAccess:g,isReimbursementAdminLevelAccess:m,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:I,isUserHasOnlyCardAccess:k,productType:"bill_pay",type:"setup"})}),a.jsx(S,{path:"verification",element:a.jsx(Re,{isBillPayAdminLevelAccess:h,isUserHasOnlyBillPayAccess:g,isReimbursementAdminLevelAccess:m,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:I,isUserHasOnlyCardAccess:k,productType:"bill_pay",type:"verification"})}),a.jsx(S,{path:"promo",element:a.jsx(Xi,{})}),a.jsx(S,{path:"approval-rules/*",element:h?a.jsx(hi,{}):a.jsx(gi,{isUserHasZeniAccountsAccess:H,isUserHasChargeCardAccess:_,isUserHasBillPayAccess:F,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:M,isTenantBankingOnly:s,tenantEmailDomain:$??""})}),a.jsx(S,{path:"international-wire",element:a.jsx(Re,{isBillPayAdminLevelAccess:h,isUserHasOnlyBillPayAccess:g,isReimbursementAdminLevelAccess:m,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:I,isUserHasOnlyCardAccess:k,productType:"bill_pay",type:"international-wire"})}),e.companyBillPayInfo?.info?.isBillPayEnabled===!0&&a.jsx(S,{path:"*",element:a.jsx(Fi,{})}),(s===!0||i===!0)&&a.jsx(S,{path:"/*",element:a.jsx(ea,{})}),e.companyBillPayInfo?.info?.isBillPayTOSAccepted===!0&&l&&a.jsx(S,{path:"*",element:a.jsx(ee,{to:"../setup"})}),t!=null&&He(e,t.loggedInUserRoleMap)&&a.jsx(S,{path:"*",element:a.jsx(ee,{to:"../promo"})})]}):d.pathname.includes("/bill")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"new",element:a.jsx(C,{appContent:a.jsx(ft,{})})}),a.jsx(S,{path:":billId",element:a.jsx(C,{appContent:a.jsx(Si,{})})}),a.jsx(S,{path:":billId/edit",element:a.jsx(C,{appContent:a.jsx(ft,{})})}),a.jsx(S,{path:"new/review",element:a.jsx(C,{appContent:a.jsx(Ct,{})})}),a.jsx(S,{path:":billId/edit/review",element:a.jsx(C,{appContent:a.jsx(Ct,{})})}),a.jsx(S,{path:"/:billId/:addressType",element:a.jsx(C,{appContent:a.jsx(mt,{isSubPage:!0})})}),a.jsx(S,{path:"/new/:addressType",element:a.jsx(C,{appContent:a.jsx(mt,{isSubPage:!0})})}),a.jsx(S,{path:"new/vendor/create",element:a.jsx(C,{appContent:a.jsx(xe,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit",element:a.jsx(C,{appContent:a.jsx(xe,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/international",element:a.jsx(C,{appContent:a.jsx(p,{})})}),a.jsx(S,{path:"new/vendor/create/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/create/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/create/international",element:a.jsx(C,{appContent:a.jsx(p,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(C,{appContent:a.jsx(p,{})})}),a.jsx(S,{path:":billId/edit/vendor/create",element:a.jsx(C,{appContent:a.jsx(xe,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit",element:a.jsx(C,{appContent:a.jsx(xe,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/international",element:a.jsx(C,{appContent:a.jsx(p,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(C,{appContent:a.jsx(p,{})})}),a.jsx(S,{path:"*",element:a.jsx(De,{})})]}):a.jsx(S,{path:"*",element:a.jsx(ce,{fetchState:"In-Progress",style:{backgroundColor:n.colors.grey5,boxShadow:`0px 2px ${E.sp1} ${n.colors.dropShadowNormal}`}})}),a.jsx(S,{path:"*",element:a.jsx(De,{})})]})}export{Fo as default};
119
+ `,Ki=Y(function(e,t){const l=L.getSignedInUser(),n=Wt(e,t.billId),c=gn(e),r=je(l),p=n.totalAmount.amount,o=n.billPayInfo?.stage.code!=="scheduled"&&c.allApprovalRules.length>0&&!Nt(p,c.allApprovalRules,l);return{billDetails:n,billId:t.billId,billpayApprovalView:c,analytics:j,isApprovalRequiredForMarkAsPaid:o,isZeniUser:r}},function(e,t){const{location:l,billId:n,currentTenant:c,navigate:r}=t,{tenantEmailDomain:p}=c;return{redirectToBillsScreen:()=>{const o=ne(c.tenantEmailDomain),s=D(l.state?.pathnameStackToGoBack,l.pathname);r(o,{state:{pathnameStackToGoBack:s}})},discardBillDetailsFromLocalStore:()=>{e(Ie({}))},saveBillDetails:(o,s)=>{o&&e(Tt({billId:n,data:s})),e(Oe(o?"paid":"pending_approval",o,!1,n))},discardOutsideZeniPaymentData:()=>{e(jt({billId:n}))},updateBillDetailSaveBillCode:()=>{e(zt("pending_approval"))},onClickEdit:()=>{t.navigate("../",{relative:"path"})},onAttachmentClick:(o,s)=>{const i=Pe(p,o,s);window.open(`${i}`,"_blank")},retryPayment:()=>{t.billId!=null&&e(xe(t.billId,"retry"))}}})(ni);function Ct(){const e=K(),t=re(),l=Q(),{billId:n}=te(),{useFeatureGate:c}=oe(),{isFeatureEnabled:r}=c(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:p}=c(y.isBillPayDetectInsufficientFundsEnabled),o=we(),s=L.getSignedInUser(),{isFeatureEnabled:i}=c(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:d}=c(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:u}=c(y.isBillPayCommentingEnabled),h=z(l.state?.pathnameStackToGoBack),{poppedPathname:g}=h,{isFeatureEnabled:m}=c(y.isRecurringBillsFeatureEnabled),b=v(I=>Z(I)),A=v(I=>Wt(I,n)),T=A.fetchState??"Not-Started";if(f.useEffect(()=>(window.onbeforeunload=function(){return e(l,{state:{message:""}}),!0},()=>{window.onbeforeunload=null}),[e]),f.useEffect(()=>{l.state?.message!=="coming_from_edit_page"&&e(`../${n}`)},[]),f.useEffect(()=>{const I=A.vendor?.name,k=A.vendor?.id,H=A.totalAmount.amount,M=A.recipientTotalAmount.amount,_=A.invoiceNumber;I&&k&&t(hn(I,k,H,M,_,n))},[]),g==null)return a.jsx(ee,{to:`../${n}`});if(s==null)throw Error("Can't access address page without signing in...");return T==="In-Progress"?a.jsx(wt,{windowSize:o,children:a.jsx(ai,{})}):a.jsx(wt,{windowSize:o,children:a.jsx(Ki,{location:l,navigate:e,currentTenant:b,billId:n,isBillPayCommentingEnabled:u,isLocalCurrencyEnabled:i,isVendorRecommendationEnabled:d,isInternationalPaymentShaVsOurEnabled:r,isRecurringBillsFeatureEnabled:m,isDetectInsufficientFundsEnabled:p})})}const Qi=Y(function(e,t){const{vendorId:l}=t,n=e.entityAutoCompleteState.autoCompleteText.common,c=We(e,"common"),r=l!=null?"edit":"create",p=Z(e),o=L.getSignedInUser(),s=p.tenantId,i={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:s??""};return{vendorViewDetails:t.vendorViewDetails,screenType:r,filesEndPoint:`${Jt.fileMicroServiceBaseUrl}`,authParams:i,analytics:j,vendorSearchAutoCompleteData:{autoCompleteText:n,entityAutoCompleteView:c}}},function(e,t){const{billId:l,currentTenant:n,navigate:c,location:r,vendorId:p,themeState:o}=t,{tenantEmailDomain:s}=n;return{onSaveVendor:i=>{e(Dn(p??void 0,t.billId)),i!=null&&e(jn(i))},saveVendorDetailLocalData:i=>{e(Ht({vendorId:p,localData:i}))},saveContactsInVendorDetailLocalData:i=>{e(En({vendorId:p,contacts:i}))},resetVendorDetailLocalData:()=>{e(dt(p))},updateSelectedVendorForCreate:i=>{e(xn(i))},navigateToBankDetailPage:(i,d)=>{let u;i==="wire"?u=d==="international"?Qt(s,t.billId,p):mi(s,t.billId,p):u=ui(s,t.billId,p);const h=D(r.state?.pathnameStackToGoBack,r.pathname);c(u,{state:{pathnameStackToGoBack:h}})},onRemoveBankAccount:(i,d)=>{e(d===!0?An(i,"vendor",p):Bn(i,"vendor",p))},navigateToMailingAddressPage:i=>{const d=et(s,i,l),u=D(r.state?.pathnameStackToGoBack,r.pathname);c(d,{state:{pathnameStackToGoBack:u}})},updateFilesEntity:i=>{e(Cn({files:i}))},onEditFileName:(i,d)=>{e(wn(i,d.split(".")[0]))},handleZeniLogoClick:()=>{o.toggle()},updateSaveFetchState:()=>{p==null&&e(dt(t.vendorViewDetails.newVendorState?.vendorBasic?.id)),e(kn("Not-Started",p))},onVendorSelected:i=>{i!=null&&e(vn(i,!0))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(qe({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}},onBackClick:()=>{e(ie("common"));const i=z(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??pi(n.tenantEmailDomain,t.billId);c(d,{state:{pathnameStackToGoBack:i.newStack}})},onGetOtp:i=>{e(In(i,"BillPayVendor"))},onResendOtp:i=>{e(fn(i,"BillPayVendor"))},onVerifyOtp:(i,d)=>{e(Sn(i,d,"BillPayVendor"))},onVerifyOtpSuccess:(i,d,u)=>{e(yn(i,d,u))},onFetchAndUpdateVendorRecommendations:i=>{e(Zt(i,!1))}}})(si),Be=()=>{const e=K(),t=re(),l=ii(),n=Q(),{billId:c,vendorId:r}=te(),p=v(b=>Z(b)),{useFeatureGate:o}=oe(),{isFeatureEnabled:s}=o(y.isBillPayLocalCurrencyFeatureEnabled),[i,d]=f.useState(!1),u=v(b=>b.vendorViewState.newVendorState.fetchStatus.fetchState),h=v(b=>ve(b,r)),g=v(b=>r!==void 0?b.vendorViewState.editVendorStateById[r]?.fetchStatus??"Not-Started":"Not-Started"),m=r!==void 0?g:u;return f.useEffect(()=>{i===!1&&m==="Not-Started"&&r!=null&&(t(fe(!1,r)),d(!0))},[i,m,r]),h.fetchState==="Not-Started"||h.fetchState==="In-Progress"?a.jsx(oi,{}):m==="Error"?a.jsx(li,{onGoHome:()=>e("../",{replace:!0}),onReload:()=>window.location.reload()}):a.jsxs(a.Fragment,{children:[a.jsx(Xe,{vendorId:r,billId:c}),a.jsx(Qi,{navigate:e,location:n,themeState:l,currentTenant:p,vendorId:r,billId:c,vendorViewDetails:h,isLocalCurrencyEnabled:s})]})},Yi=Y(function(e,t){const{companyId:l}=t;return{billPaySetupView:Tn(e,l),analytics:j,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",videoUrl:"https://player.vimeo.com/video/787873426?h=9d9389b1dc&badge=0&autopause=0&player_id=0&app_id=58479"}},function(e,t){const{companyId:l,navigate:n}=t;return{onButtonClick:()=>{e(Pn(l))},onBackClick:()=>{n("../..",{relative:"path"})},onSetupBillPaySuccess:()=>{n("../bills/setup",{relative:"path"})}}})(ri),Xi=()=>{const e=K(),t=Q(),{tenantEmailDomain:l}=te(),[n,c]=f.useState(!1),r=me(),p=v(g=>Z(g)),o=p.companyId??L.getSignedInUserTenant(l)?.companyId,s=L.getSignedInUser(),i=ke(),d=!!p.companyBillPayInfo?.info?.isBillPayTOSAccepted,u=ue(i?.loggedInUserRoleMap),h=g=>{c(g)};if(s==null)throw Error("Can't access bill pay promo page without signing in...");return p.companyBillPayInfo?.info?.isBillPayEnabled===!0?a.jsx(ee,{to:"../../../bills"}):d===!0&&u===!0?a.jsx(ee,{to:"../../bills/setup"}):d===!1||i!=null&&He(p,i.loggedInUserRoleMap)?a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:g=>(m=>m.trackPageLoaded(Kt.Event.billPayPromoPage))(g)}),a.jsx(Xt,{isAppContentDrawerOpen:n,handleDrawerToggle:h}),a.jsx(Yi,{companyId:o,navigate:e,location:t,onClickMenuIcon:()=>{h(!0)}})]}):a.jsx(ce,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Fo(){const e=v(U=>Z(U)),t=ke(),l=ue(t?.loggedInUserRoleMap),n=me(),{useFeatureGate:c}=oe(),{isFeatureEnabled:r}=c(y.isBillPayLocalCurrencyFeatureEnabled),p=r===!0?Ji:Hi,{isFeatureEnabled:o}=c(y.isDebitCardFeatureEnabled),s=Ut(o,e),i=Mt(e),d=Q(),u=e?.userRole!=null&&At(e?.userRole),h=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!u)&&ue(t?.loggedInUserRoleMap),g=$t(t?.loggedInUserRoleMap),m=(e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!u)&&Fn(t?.loggedInUserRoleMap),{isFeatureEnabled:b}=c(y.isDepositAccountsFeatureEnabled),A=b&&!u&&_t(t?.loggedInUserRoleMap),{isFeatureEnabled:T}=c(y.isChargeCardFeatureEnabled),I=ci(e,T,o)&&!u&&Rn(t?.loggedInUserRoleMap),k=Ln(t?.loggedInUserRoleMap),H=Gt(t?.loggedInUserRoleMap),M=Vn(t?.loggedInUserRoleMap),_=$n(t?.loggedInUserRoleMap),F=Un(t?.loggedInUserRoleMap),B=Mn(t?.loggedInUserRoleMap),{tenantEmailDomain:$}=te();return a.jsxs(sa,{children:[d.pathname.includes("/bills")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"setup",element:a.jsx(Re,{isBillPayAdminLevelAccess:h,isUserHasOnlyBillPayAccess:g,isReimbursementAdminLevelAccess:m,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:I,isUserHasOnlyCardAccess:k,productType:"bill_pay",type:"setup"})}),a.jsx(S,{path:"verification",element:a.jsx(Re,{isBillPayAdminLevelAccess:h,isUserHasOnlyBillPayAccess:g,isReimbursementAdminLevelAccess:m,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:I,isUserHasOnlyCardAccess:k,productType:"bill_pay",type:"verification"})}),a.jsx(S,{path:"promo",element:a.jsx(Xi,{})}),a.jsx(S,{path:"approval-rules/*",element:h?a.jsx(hi,{}):a.jsx(gi,{isUserHasZeniAccountsAccess:H,isUserHasChargeCardAccess:_,isUserHasBillPayAccess:F,isUserHasReimbursementAccess:B,isUserHasTreasuryAccess:M,isTenantBankingOnly:s,tenantEmailDomain:$??""})}),a.jsx(S,{path:"international-wire",element:a.jsx(Re,{isBillPayAdminLevelAccess:h,isUserHasOnlyBillPayAccess:g,isReimbursementAdminLevelAccess:m,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:I,isUserHasOnlyCardAccess:k,productType:"bill_pay",type:"international-wire"})}),e.companyBillPayInfo?.info?.isBillPayEnabled===!0&&a.jsx(S,{path:"*",element:a.jsx(Fi,{})}),(s===!0||i===!0)&&a.jsx(S,{path:"/*",element:a.jsx(ea,{})}),e.companyBillPayInfo?.info?.isBillPayTOSAccepted===!0&&l&&a.jsx(S,{path:"*",element:a.jsx(ee,{to:"../setup"})}),t!=null&&He(e,t.loggedInUserRoleMap)&&a.jsx(S,{path:"*",element:a.jsx(ee,{to:"../promo"})})]}):d.pathname.includes("/bill")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"new",element:a.jsx(C,{appContent:a.jsx(ft,{})})}),a.jsx(S,{path:":billId",element:a.jsx(C,{appContent:a.jsx(Si,{})})}),a.jsx(S,{path:":billId/edit",element:a.jsx(C,{appContent:a.jsx(ft,{})})}),a.jsx(S,{path:"new/review",element:a.jsx(C,{appContent:a.jsx(Ct,{})})}),a.jsx(S,{path:":billId/edit/review",element:a.jsx(C,{appContent:a.jsx(Ct,{})})}),a.jsx(S,{path:"/:billId/:addressType",element:a.jsx(C,{appContent:a.jsx(mt,{isSubPage:!0})})}),a.jsx(S,{path:"/new/:addressType",element:a.jsx(C,{appContent:a.jsx(mt,{isSubPage:!0})})}),a.jsx(S,{path:"new/vendor/create",element:a.jsx(C,{appContent:a.jsx(Be,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit",element:a.jsx(C,{appContent:a.jsx(Be,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/international",element:a.jsx(C,{appContent:a.jsx(p,{})})}),a.jsx(S,{path:"new/vendor/create/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/create/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/create/international",element:a.jsx(C,{appContent:a.jsx(p,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(C,{appContent:a.jsx(p,{})})}),a.jsx(S,{path:":billId/edit/vendor/create",element:a.jsx(C,{appContent:a.jsx(Be,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit",element:a.jsx(C,{appContent:a.jsx(Be,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/international",element:a.jsx(C,{appContent:a.jsx(p,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(C,{appContent:a.jsx(p,{})})}),a.jsx(S,{path:"*",element:a.jsx(De,{})})]}):a.jsx(S,{path:"*",element:a.jsx(ce,{fetchState:"In-Progress",style:{backgroundColor:n.colors.grey5,boxShadow:`0px 2px ${E.sp1} ${n.colors.dropShadowNormal}`}})}),a.jsx(S,{path:"*",element:a.jsx(De,{})})]})}export{Fo as default};
@@ -1,4 +1,4 @@
1
- import{j as k}from"./liveblocks-CGYIz1sf.js";import{a as V}from"./sentry-ClGNqxTu.js";import{j as ae,u as ne,h as se,l as ie,g as C,N as oe,k as re}from"./core--8kDo-LJ.js";import{S as ce,i as ue,aI as de,z,O as pe,d as B,aa as x,f as M,bq as le,ao as me,r as E,ap as P}from"./index-h4jm-UQJ.js";import{M4 as fe,eM as G,rt as ye,GE as Se,xa as ge,zT as Ie,Cq as he,D3 as be,DY as Oe,Mr as De,Ms as Te,Mt as ke,Mu as Ce,Mv as Ve,I_ as we,Lt as Ae,Ja as Ne,k2 as _e,fA as ve,fz as Fe,fy as xe,pB as Me,ps as ze,pp as Be,jW as Ee,rC as Pe,rA as R,bB as L,rO as U,cr as Re}from"./zeni-epic-state-Cb3mJiT_.js";import{n as Le}from"./mui-COKu087d.js";import{c as j}from"./routePaths-NcYvgIlg.js";import{M as Ue}from"./MobileAppDrawer-CimbS3hY.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new e.Error().stack;d&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[d]="62671ef0-a242-4d5a-ac57-b033f9423a09",e._sentryDebugIdIdentifier="sentry-dbid-62671ef0-a242-4d5a-ac57-b033f9423a09")}catch{}})();const je=Le.div`
1
+ import{j as k}from"./liveblocks-BGrTvYCQ.js";import{a as V}from"./sentry-B-sG2CiU.js";import{j as ae,u as ne,h as se,l as ie,g as C,N as oe,k as re}from"./core-cQ_UGuA8.js";import{S as ce,i as ue,aI as de,z,w as pe,d as B,aa as x,f as M,bq as le,ao as me,v as E,ap as P}from"./index-DaFoFUBf.js";import{M4 as fe,eM as G,rt as ye,GE as Se,xa as ge,zT as Ie,Cq as he,D3 as be,DY as De,Mr as Oe,Ms as Te,Mt as ke,Mu as Ce,Mv as Ve,I_ as we,Lt as Ae,Ja as Ne,k2 as _e,fA as ve,fz as Fe,fy as xe,pB as Me,ps as ze,pp as Be,jW as Ee,rC as Pe,rA as R,bB as L,rO as U,cr as Re}from"./zeni-epic-state-BObvmHAZ.js";import{n as Le}from"./mui-bgnk9Y8D.js";import{c as j}from"./routePaths-Dbo9mbXz.js";import{M as Ue}from"./MobileAppDrawer-OybL2Okz.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new e.Error().stack;d&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[d]="f2e8213d-45cc-4223-837b-31a38487f644",e._sentryDebugIdIdentifier="sentry-dbid-f2e8213d-45cc-4223-837b-31a38487f644")}catch{}})();const je=Le.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,4 +6,4 @@ import{j as k}from"./liveblocks-CGYIz1sf.js";import{a as V}from"./sentry-ClGNqxT
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,Ge=re(function(e,d){const{businessVerificationDetails:i}=d,r=G(e),y=z.getSignedInUser(),S=r.tenantId,l={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},b=we(d.roleMap)&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",t=Ae(e.companyConfigState),s=Ne(e.userRoleConfigState);return{businessVerificationDetails:i,verficationDetailsFetchState:i.fetchState,isRefreshingViewInBackground:i.isRefreshingViewInBackground,allNationalityCountries:i.allNationalityCountries,filesEndPoint:`${me.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:b,allIndustries:t.companyIndustries??[],companyTitles:s.companyTitles}},function(e,d){const{companyId:i,productType:r,currentTenant:y,navigate:S,location:l}=d,{tenantEmailDomain:b}=y;return{onCompanyDetailsChanged:t=>{const{companyDescription:s,companyIndustry:p,companyIndustryType:D,companyLegalName:T,companyTaxId:g,companyWebsite:m,companyPhone:I,primaryContactEmail:c,primaryContactName:n,primaryContactUserId:u,primaryContactSyncToken:O,syncToken:f,fileIds:a,incDate:o,typeOfIncorporation:w,stateOfIncorporation:A,sourceOfFunds:N,companySubIndustry:_,countriesOfOperations:h,companySourceOfFunds:q,companySourceOfFundsDescription:W,transactionVolume:Z,transactionVolumeDescription:$,purposeOfAccount:J,purposeOfAccountDescription:Y,regulatedStatus:H,regulatedStatusDescription:K,usNexus:Q,usNexusTypes:X}=t,v=D?.selectedOption,ee={companyId:i,companyDescription:s,companyIndustry:p.selectedOption,companyIndustryType:v==null||v===""?void 0:v,companyLegalName:T,taxIdOrEIN:g,website:m!=""&&m!=null?Re(m):void 0,phone:I,syncToken:f,fileIds:a,incDate:o!=null?L(o?.toString()):o,typeOfIncorporation:w?.selectedOption??"",stateOfIncorporation:A?.selectedOption??"",sourceOfFunds:N?.selectedOption??"",companySubIndustry:_?.selectedOption??"",countriesOfOperations:h?.selectedOptions.map(F=>F.length===2?F:P(F))??[],companySourceOfFunds:q?.selectedOption??"",companySourceOfFundsDescription:W,transactionVolume:Z?.selectedOption??"",transactionVolumeDescription:$,purposeOfAccount:J?.selectedOption??"",purposeOfAccountDescription:Y,regulatedStatus:H??"",regulatedStatusDescription:K,usNexus:Q,usNexusTypes:X?.selectedOptions??[]},te={userId:u,firstName:n.firstName,lastName:n.lastName,email:c,syncToken:O};e(U({companyDetails:ee,primaryContactDetails:te}))},onCompanyOfficerUpdated:t=>{const s=t.map(p=>{const{officerType:D,userId:T,name:g,email:m,nationalityCountryCode:I,ssn:c,dob:n,phone:u,syncToken:O,selectDocument:f,role:a,ownership:o,isSelectedForVerification:w,userVerificationStatus:A,treasuryUserVerificationStatus:N,fileIds:_}=p;let h;return f.selectDocumentType==="driverLicense"?h="driving_license":f.selectDocumentType==="passport"?h="passport":f.selectDocumentType==="stateId"?h="id_document":f.selectDocumentType==="ssnCard"&&(h="social_security_card"),{officerType:D,userId:T,firstName:g.firstName,lastName:g.lastName,email:m,ssn:c,nationalityCountryCode:I?.selectedOption!=null?P(I.selectedOption):void 0,phone:u,birthday:n!=null?L(n?.toString()):n,syncToken:O,titleAtCompany:a.selectedOption,ownershipInCompany:o,documentTypeSelectedForVerification:h,isSelectedForVerification:w,userVerificationStatus:A,treasuryUserVerificationStatus:N,fileIds:_,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(U({officers:s}))},onSaveDetailsClick:t=>{e(R(i,t,r))},onSendForVerificationClick:t=>{e(R(i,t,r,!0))},onAddressClick:t=>{const s=j(b,t),p=E(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onRegisteredAddressClick:t=>{const s=j(b,t),p=E(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onBackClick:()=>{e(Pe({companyId:i})),S("../setup")},updateFilesEntity:t=>{e(Ee({files:t}))},onDeleteFile:t=>{e(Be(t))},onDeleteFileList:t=>{e(ze(t))},onEditFileName:(t,s)=>{e(Me(t,s.split(".")[0]))},onGetOtp:t=>{e(xe(t,"SpendManagementSetup"))},onResendOtp:t=>{e(Fe(t,"SpendManagementSetup"))},onVerifyOtp:(t,s)=>{e(ve(t,s,"SpendManagementSetup"))},saveNewAddressInLocalStore:(t,s)=>{e(_e({addressType:t,addressToCreate:s}))}}})(le),Qe=({productType:e})=>{const d=ae(),i=ne(),r=se(),[y,S]=V.useState(!1),[l,b]=V.useState(!1),{tenantEmailDomain:t}=ie(),s=ce(),{useDynamicConfig:p}=ue(),{configValue:D}=p(de.zeniAccountsConfig),T=fe(D),g=C(a=>{switch(e){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}}),m=C(a=>a.companyConfigState.fetchState),I=C(a=>a.userRoleConfigState.fetchState),c=C(a=>G(a)),n=c.companyId??z.getSignedInUserTenant(t)?.companyId;if(V.useEffect(()=>{m==="Not-Started"&&r(ye()),I==="Not-Started"&&r(Se(!0))},[m,I,r]),V.useEffect(()=>{if(!y&&g==="Not-Started"&&n!=null)switch(S(!0),e){case"zeni_accounts":r(Oe(n,!0));break;case"zeni_treasury":r(be(n,!0));break;case"reimbursement":r(he(n,!0));break;case"charge_cards":r(Ie(n,!0));break;default:r(ge(n,!0))}},[y,g,n,r]),z.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let u;switch(e){case"zeni_accounts":u=c.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":u=c.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":u=c.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||c.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":u=c.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:u=c.companyBillPayInfo?.info?.isBillPayTOSAccepted}const O=a=>{b(a)},f=C(a=>{let o;switch(e){case"zeni_accounts":o=Ve(a,n);break;case"zeni_treasury":o=Ce(a,n);break;case"charge_cards":o=ke(a,n);break;case"reimbursement":o=Te(a,n);break;default:o=De(a,n)}return o});return u===!1?k.jsx(oe,{to:"../promo"}):k.jsxs(je,{children:[k.jsx(pe,{analytics:B,onLoad:a=>(o=>{switch(e){case"zeni_accounts":return o.trackPageLoaded(M.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return o.trackPageLoaded(M.Event.reimbursementBusinessVerification);default:return o.trackPageLoaded(M.Event.billPayBusinessVerification,x(i)?"Settings":void 0)}})(a)}),x(i)?k.jsx(Ue,{isAppContentDrawerOpen:l,handleDrawerToggle:O}):null,k.jsx(Ge,{businessVerificationDetails:f,navigate:d,location:i,companyId:n,analytics:B,currentTenant:c,productType:e,isSettings:x(i),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{O(!0)},maxInsuredAmount:T.maxInsuredAmount})]})};export{Qe as B};
9
+ `,Ge=re(function(e,d){const{businessVerificationDetails:i}=d,r=G(e),y=z.getSignedInUser(),S=r.tenantId,l={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},b=we(d.roleMap)&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",t=Ae(e.companyConfigState),s=Ne(e.userRoleConfigState);return{businessVerificationDetails:i,verficationDetailsFetchState:i.fetchState,isRefreshingViewInBackground:i.isRefreshingViewInBackground,allNationalityCountries:i.allNationalityCountries,filesEndPoint:`${me.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:b,allIndustries:t.companyIndustries??[],companyTitles:s.companyTitles}},function(e,d){const{companyId:i,productType:r,currentTenant:y,navigate:S,location:l}=d,{tenantEmailDomain:b}=y;return{onCompanyDetailsChanged:t=>{const{companyDescription:s,companyIndustry:p,companyIndustryType:O,companyLegalName:T,companyTaxId:g,companyWebsite:m,companyPhone:I,primaryContactEmail:c,primaryContactName:n,primaryContactUserId:u,primaryContactSyncToken:D,syncToken:f,fileIds:a,incDate:o,typeOfIncorporation:w,stateOfIncorporation:A,sourceOfFunds:N,companySubIndustry:_,countriesOfOperations:h,companySourceOfFunds:q,companySourceOfFundsDescription:W,transactionVolume:Z,transactionVolumeDescription:$,purposeOfAccount:J,purposeOfAccountDescription:Y,regulatedStatus:H,regulatedStatusDescription:K,usNexus:Q,usNexusTypes:X}=t,v=O?.selectedOption,ee={companyId:i,companyDescription:s,companyIndustry:p.selectedOption,companyIndustryType:v==null||v===""?void 0:v,companyLegalName:T,taxIdOrEIN:g,website:m!=""&&m!=null?Re(m):void 0,phone:I,syncToken:f,fileIds:a,incDate:o!=null?L(o?.toString()):o,typeOfIncorporation:w?.selectedOption??"",stateOfIncorporation:A?.selectedOption??"",sourceOfFunds:N?.selectedOption??"",companySubIndustry:_?.selectedOption??"",countriesOfOperations:h?.selectedOptions.map(F=>F.length===2?F:P(F))??[],companySourceOfFunds:q?.selectedOption??"",companySourceOfFundsDescription:W,transactionVolume:Z?.selectedOption??"",transactionVolumeDescription:$,purposeOfAccount:J?.selectedOption??"",purposeOfAccountDescription:Y,regulatedStatus:H??"",regulatedStatusDescription:K,usNexus:Q,usNexusTypes:X?.selectedOptions??[]},te={userId:u,firstName:n.firstName,lastName:n.lastName,email:c,syncToken:D};e(U({companyDetails:ee,primaryContactDetails:te}))},onCompanyOfficerUpdated:t=>{const s=t.map(p=>{const{officerType:O,userId:T,name:g,email:m,nationalityCountryCode:I,ssn:c,dob:n,phone:u,syncToken:D,selectDocument:f,role:a,ownership:o,isSelectedForVerification:w,userVerificationStatus:A,treasuryUserVerificationStatus:N,fileIds:_}=p;let h;return f.selectDocumentType==="driverLicense"?h="driving_license":f.selectDocumentType==="passport"?h="passport":f.selectDocumentType==="stateId"?h="id_document":f.selectDocumentType==="ssnCard"&&(h="social_security_card"),{officerType:O,userId:T,firstName:g.firstName,lastName:g.lastName,email:m,ssn:c,nationalityCountryCode:I?.selectedOption!=null?P(I.selectedOption):void 0,phone:u,birthday:n!=null?L(n?.toString()):n,syncToken:D,titleAtCompany:a.selectedOption,ownershipInCompany:o,documentTypeSelectedForVerification:h,isSelectedForVerification:w,userVerificationStatus:A,treasuryUserVerificationStatus:N,fileIds:_,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(U({officers:s}))},onSaveDetailsClick:t=>{e(R(i,t,r))},onSendForVerificationClick:t=>{e(R(i,t,r,!0))},onAddressClick:t=>{const s=j(b,t),p=E(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onRegisteredAddressClick:t=>{const s=j(b,t),p=E(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onBackClick:()=>{e(Pe({companyId:i})),S("../setup")},updateFilesEntity:t=>{e(Ee({files:t}))},onDeleteFile:t=>{e(Be(t))},onDeleteFileList:t=>{e(ze(t))},onEditFileName:(t,s)=>{e(Me(t,s.split(".")[0]))},onGetOtp:t=>{e(xe(t,"SpendManagementSetup"))},onResendOtp:t=>{e(Fe(t,"SpendManagementSetup"))},onVerifyOtp:(t,s)=>{e(ve(t,s,"SpendManagementSetup"))},saveNewAddressInLocalStore:(t,s)=>{e(_e({addressType:t,addressToCreate:s}))}}})(le),Qe=({productType:e})=>{const d=ae(),i=ne(),r=se(),[y,S]=V.useState(!1),[l,b]=V.useState(!1),{tenantEmailDomain:t}=ie(),s=ce(),{useDynamicConfig:p}=ue(),{configValue:O}=p(de.zeniAccountsConfig),T=fe(O),g=C(a=>{switch(e){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}}),m=C(a=>a.companyConfigState.fetchState),I=C(a=>a.userRoleConfigState.fetchState),c=C(a=>G(a)),n=c.companyId??z.getSignedInUserTenant(t)?.companyId;if(V.useEffect(()=>{m==="Not-Started"&&r(ye()),I==="Not-Started"&&r(Se(!0))},[m,I,r]),V.useEffect(()=>{if(!y&&g==="Not-Started"&&n!=null)switch(S(!0),e){case"zeni_accounts":r(De(n,!0));break;case"zeni_treasury":r(be(n,!0));break;case"reimbursement":r(he(n,!0));break;case"charge_cards":r(Ie(n,!0));break;default:r(ge(n,!0))}},[y,g,n,r]),z.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let u;switch(e){case"zeni_accounts":u=c.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":u=c.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":u=c.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||c.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":u=c.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:u=c.companyBillPayInfo?.info?.isBillPayTOSAccepted}const D=a=>{b(a)},f=C(a=>{let o;switch(e){case"zeni_accounts":o=Ve(a,n);break;case"zeni_treasury":o=Ce(a,n);break;case"charge_cards":o=ke(a,n);break;case"reimbursement":o=Te(a,n);break;default:o=Oe(a,n)}return o});return u===!1?k.jsx(oe,{to:"../promo"}):k.jsxs(je,{children:[k.jsx(pe,{analytics:B,onLoad:a=>(o=>{switch(e){case"zeni_accounts":return o.trackPageLoaded(M.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return o.trackPageLoaded(M.Event.reimbursementBusinessVerification);default:return o.trackPageLoaded(M.Event.billPayBusinessVerification,x(i)?"Settings":void 0)}})(a)}),x(i)?k.jsx(Ue,{isAppContentDrawerOpen:l,handleDrawerToggle:D}):null,k.jsx(Ge,{businessVerificationDetails:f,navigate:d,location:i,companyId:n,analytics:B,currentTenant:c,productType:e,isSettings:x(i),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{D(!0)},maxInsuredAmount:T.maxInsuredAmount})]})};export{Qe as B};