@zeniai/web-app-ui 5.0.70-qa → 5.0.71-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 (141) hide show
  1. package/dist/assets/AddressRoutes-DkpE57wD.js +1 -0
  2. package/dist/assets/AddressScreen-IPMb-Lqg.js +9 -0
  3. package/dist/assets/AiCfoScreen-DxwryQBf.js +11 -0
  4. package/dist/assets/BillPayApprovalRoutes-B33P7K39.js +1 -0
  5. package/dist/assets/{BillPayRoutes-CZhvS7X4.js → BillPayRoutes-D2OQNHTr.js} +17 -17
  6. package/dist/assets/{BusinessVerificationPageScreen-DS8yDRTx.js → BusinessVerificationPageScreen-BI3GYpKu.js} +2 -2
  7. package/dist/assets/ChargeCardRoutes-DZTXpkWd.js +71 -0
  8. package/dist/assets/CompanyPassportScreen-kKTXGF13.js +1 -0
  9. package/dist/assets/ConnectionAuthScreen-CYS4bJsi.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-CFcE03ug.js +1 -0
  11. package/dist/assets/CustomerOnboardingRoutes-jk197VvK.js +23 -0
  12. package/dist/assets/{DashboardRoutes-BSQu3xMl.js → DashboardRoutes-Ckl1eEC2.js} +3 -3
  13. package/dist/assets/DefaultTenantHome-TLtEW787.js +1 -0
  14. package/dist/assets/DomesticWireDetailScreen-BkEDowN8.js +18 -0
  15. package/dist/assets/DrawerScreen-B_tMe04S.js +1 -0
  16. package/dist/assets/EntityDetailRoutes-DlKVqtyC.js +1 -0
  17. package/dist/assets/ExpenseAutomationRoutes-BqK3TSEk.js +25 -0
  18. package/dist/assets/FeaturePreviewScreen-aYYY9m7f.js +1 -0
  19. package/dist/assets/MagicLinkRoutes-BLaYeloO.js +72 -0
  20. package/dist/assets/{MagicLinkSignInScreen-CkYMgnfC.js → MagicLinkSignInScreen-CUegQSoi.js} +1 -1
  21. package/dist/assets/MobileAppDrawer-BDT0TmvR.js +1 -0
  22. package/dist/assets/NotFoundScreen-C4aqnA8_.js +1 -0
  23. package/dist/assets/{NotificationRoutes-17FmFpDt.js → NotificationRoutes-BblXuLTj.js} +1 -1
  24. package/dist/assets/OAuthConsentScreen-sykQomv8.js +1 -0
  25. package/dist/assets/PandLWithForecastRoutes-CBrTW5wX.js +1 -0
  26. package/dist/assets/{PeopleRoutes-DCpSQt8d.js → PeopleRoutes-B9d9GdEF.js} +5 -5
  27. package/dist/assets/PerformanceRoutes-BFJ-jyRc.js +1 -0
  28. package/dist/assets/{Preview-CJ0Bmv63.js → Preview-IJkS64Sk.js} +1 -1
  29. package/dist/assets/{QBOConnectionScreen-DiY0aEcB.js → QBOConnectionScreen-DQkFbpJH.js} +1 -1
  30. package/dist/assets/ReferralListScreen-CyoB8VnU.js +5 -0
  31. package/dist/assets/ReimbursementApprovalRoutes-B00fD8b9.js +1 -0
  32. package/dist/assets/ReimbursementApprovalRuleDetailScreen-DMdpETrG.js +1 -0
  33. package/dist/assets/{ReimbursementRoutes-CvnLlTDQ.js → ReimbursementRoutes-u-qnVfy0.js} +7 -7
  34. package/dist/assets/ReportsRoutes-CqNp_xpd.js +1 -0
  35. package/dist/assets/RewardsRoutes-R2VgDdnw.js +1 -0
  36. package/dist/assets/ScreenRoutes-9MMqpDv8.js +2 -0
  37. package/dist/assets/{SettingsRoutes-BzxQN_Az.js → SettingsRoutes-KHzSnNUm.js} +7 -7
  38. package/dist/assets/{SetupPagesScreen-tsJgjmfM.js → SetupPagesScreen-Cdo59_U5.js} +5 -5
  39. package/dist/assets/SignInScreen-DX4DUgMU.js +1 -0
  40. package/dist/assets/SignOutScreen-DOTJzbce.js +9 -0
  41. package/dist/assets/TaskListScreen-C1G-Z2qb.js +9 -0
  42. package/dist/assets/TaskRoutes-DeZTJnM4.js +9 -0
  43. package/dist/assets/TransactionDetailRoutes-CxGTwTQr.js +1 -0
  44. package/dist/assets/TransactionDetailScreen-DbXqL9Dv.js +5 -0
  45. package/dist/assets/{TransactionListRoutes-C7qZdmUZ.js → TransactionListRoutes-r3XEp13P.js} +1 -1
  46. package/dist/assets/{TreasuryRoutes-c0G3A1dL.js → TreasuryRoutes-Cp7F7y4J.js} +6 -6
  47. package/dist/assets/{VendorsRoutes-B3BHswUk.js → VendorsRoutes-BBf47BBb.js} +15 -15
  48. package/dist/assets/WiseConfirmationScreen-BZsn9iwu.js +12 -0
  49. package/dist/assets/{ZeniAccountRoutes-DOB227kl.js → ZeniAccountRoutes--fSibHTb.js} +12 -12
  50. package/dist/assets/ZeniAccountStatementScreen-BKbkGQh4.js +9 -0
  51. package/dist/assets/{accountMappingHelper-dHb9X7tX.js → accountMappingHelper-COFGwnKa.js} +1 -1
  52. package/dist/assets/{analytics-COzTMS9t.js → analytics-CgF6EPDF.js} +1 -1
  53. package/dist/assets/{analyticsHelper-CQQBcwi_.js → analyticsHelper-DUlInMOD.js} +1 -1
  54. package/dist/assets/{core-DMKpdX6V.js → core-C_ZreJAw.js} +1 -1
  55. package/dist/assets/{decodeURIComponentSafe-kaKdrE3i.js → decodeURIComponentSafe-BP018w8C.js} +1 -1
  56. package/dist/assets/{dnd-B4MKAlTf.js → dnd-C3uQO7Bn.js} +1 -1
  57. package/dist/assets/empty-D-N5n4Nc.js +1 -0
  58. package/dist/assets/{empty-_gHzexXT.js → empty-wr1Sjolf.js} +1 -1
  59. package/dist/assets/{emptyVideoElement-Ba3zd13y.js → emptyVideoElement-DDjbVU1E.js} +1 -1
  60. package/dist/assets/epic-DKrR9LyJ.js +2 -0
  61. package/dist/assets/getLocaleForTenant-C-vhBCTM.js +1 -0
  62. package/dist/assets/index-BYIPlMHr.js +2 -0
  63. package/dist/assets/{index-B-S1sw2q.js → index-CGS6zWWp.js} +17206 -15688
  64. package/dist/assets/index-CUa_5F-3.js +1 -0
  65. package/dist/assets/{index-1s98NswJ.js → index-CWsQVRWF.js} +1 -1
  66. package/dist/assets/{index-DgRsL-zD.js → index-CnROQyBG.js} +2 -2
  67. package/dist/assets/index-DJtUADrm.js +1 -0
  68. package/dist/assets/{index-P5Uv4EpL.js → index-DpCPl3KC.js} +1 -1
  69. package/dist/assets/{index-CapqGJKF.js → index-T4vVJHIk.js} +1 -1
  70. package/dist/assets/{lexical-ChtLw4s9.js → lexical-E_ubWL4u.js} +1 -1
  71. package/dist/assets/{liveblocks-CqGMBzbB.js → liveblocks-BdePShct.js} +1 -1
  72. package/dist/assets/{lottie-BflCEFtX.js → lottie-CUKBWgbe.js} +1 -1
  73. package/dist/assets/{mui-C4peJOR0.js → mui-BtnH6ELy.js} +1 -1
  74. package/dist/assets/{pathToGoBack-CHCqWOFU.js → pathToGoBack-Bg0yBLYd.js} +1 -1
  75. package/dist/assets/{pdf-C6aRryDe.js → pdf-CH0jWS01.js} +4 -4
  76. package/dist/assets/{pdf-lib-BMPC_qNx.js → pdf-lib-th4agIPv.js} +1 -1
  77. package/dist/assets/{plaid-DWM21M_R.js → plaid-CLHQ0yLv.js} +1 -1
  78. package/dist/assets/{pusher-DqpEa1pu.js → pusher-DTlPALAn.js} +1 -1
  79. package/dist/assets/{react-YdR2ykUN.js → react-4Ap2VUmu.js} +1 -1
  80. package/dist/assets/{react-B4FfdgNG.js → react-B1z9ZoMC.js} +1 -1
  81. package/dist/assets/{react-Brr3hJcV.js → react-BYz405pF.js} +1 -1
  82. package/dist/assets/{react-5UT9NFJ3.js → react-Bxo6GPqK.js} +1 -1
  83. package/dist/assets/{react-6AGaHHFp.js → react-COj3_dzF.js} +1 -1
  84. package/dist/assets/{react-CmDKO3IZ.js → react-CcfFphdJ.js} +1 -1
  85. package/dist/assets/{recharts-DEvckcqQ.js → recharts-CHr9O26_.js} +1 -1
  86. package/dist/assets/{routePaths-DwcIzItv.js → routePaths-DZkWYInw.js} +1 -1
  87. package/dist/assets/{sentry-By_w3AbQ.js → sentry-CX_3yQh7.js} +1 -1
  88. package/dist/assets/{url-B4q4O9pf.js → url-BBCQjahk.js} +1 -1
  89. package/dist/assets/{url-XDFiNkBY.js → url-CcaHVDFu.js} +1 -1
  90. package/dist/assets/useAskAiCfoHostNavButtonProps-Nsv7MqoG.js +1 -0
  91. package/dist/assets/{useDeviceId-DH6-WcAx.js → useDeviceId-DtlEyHOn.js} +1 -1
  92. package/dist/assets/useFetchSuggestedQuestionsWhenReady-C86A67zi.js +1 -0
  93. package/dist/assets/useInitialThreadRequest-AyrSL871.js +1 -0
  94. package/dist/assets/{utils-CSUcsfYh.js → utils-Dw8b4HCO.js} +1 -1
  95. package/dist/assets/{withTransactionSidePanel-yqBBfrLp.js → withTransactionSidePanel-BmH5jBz_.js} +2 -2
  96. package/dist/assets/zeni-epic-state-H6DZSSlf.js +13 -0
  97. package/dist/index.html +1 -1
  98. package/package.json +4 -4
  99. package/dist/assets/AddressRoutes-BTfuI9Bw.js +0 -1
  100. package/dist/assets/AddressScreen-jTT04DFx.js +0 -9
  101. package/dist/assets/AiCfoScreen-BIhlfQQ_.js +0 -11
  102. package/dist/assets/BillPayApprovalRoutes-C44-nGT6.js +0 -1
  103. package/dist/assets/ChargeCardRoutes-C7ZPgkk_.js +0 -71
  104. package/dist/assets/CompanyPassportScreen-Dh1MJ-Ph.js +0 -1
  105. package/dist/assets/ConnectionAuthScreen-B4w8rGYZ.js +0 -11
  106. package/dist/assets/CustomerOnboardingAuthScreen-BVLhDDfh.js +0 -1
  107. package/dist/assets/CustomerOnboardingRoutes-BeOGrGwK.js +0 -23
  108. package/dist/assets/DefaultTenantHome-f0BMdnqq.js +0 -1
  109. package/dist/assets/DomesticWireDetailScreen-Dcgzj1nk.js +0 -18
  110. package/dist/assets/DrawerScreen-BIAu5bA1.js +0 -1
  111. package/dist/assets/EntityDetailRoutes-BMnEqgs2.js +0 -1
  112. package/dist/assets/ExpenseAutomationRoutes-G2jBVNVU.js +0 -25
  113. package/dist/assets/FeaturePreviewScreen-D6Uxvt0_.js +0 -1
  114. package/dist/assets/MagicLinkRoutes-BJg4uTJC.js +0 -72
  115. package/dist/assets/MobileAppDrawer-CQwwOR5p.js +0 -1
  116. package/dist/assets/NotFoundScreen-C_3ycSKf.js +0 -1
  117. package/dist/assets/PandLWithForecastRoutes-DEaEOUDv.js +0 -1
  118. package/dist/assets/PerformanceRoutes-Clc6K-Sz.js +0 -1
  119. package/dist/assets/ReferralListScreen-Dq2B0WMt.js +0 -5
  120. package/dist/assets/ReimbursementApprovalRoutes-hJy0lLcU.js +0 -1
  121. package/dist/assets/ReimbursementApprovalRuleDetailScreen-DdLOedPE.js +0 -1
  122. package/dist/assets/ReportsRoutes-CWkv155p.js +0 -1
  123. package/dist/assets/RewardsRoutes-Bl8kgQI_.js +0 -1
  124. package/dist/assets/ScreenRoutes-Bpg_5BOg.js +0 -2
  125. package/dist/assets/SignInScreen-Dd8ZY6ef.js +0 -1
  126. package/dist/assets/SignOutScreen-B069qVqp.js +0 -9
  127. package/dist/assets/TaskListScreen-FDYDQZ8O.js +0 -9
  128. package/dist/assets/TaskRoutes-DOluYvA-.js +0 -9
  129. package/dist/assets/TransactionDetailRoutes-CKqmkQac.js +0 -1
  130. package/dist/assets/TransactionDetailScreen-CuOcn9Eq.js +0 -5
  131. package/dist/assets/WiseConfirmationScreen-BtsNW7qm.js +0 -12
  132. package/dist/assets/ZeniAccountStatementScreen-CCaF_hvY.js +0 -9
  133. package/dist/assets/empty-CuM4id4M.js +0 -1
  134. package/dist/assets/epic-B57XJqsg.js +0 -2
  135. package/dist/assets/getLocaleForTenant-DIj12PGu.js +0 -1
  136. package/dist/assets/index-CciFFvoQ.js +0 -1
  137. package/dist/assets/index-Ips891mX.js +0 -1
  138. package/dist/assets/useAskAiCfoHostNavButtonProps-CjhdCks2.js +0 -1
  139. package/dist/assets/useFetchSuggestedQuestionsWhenReady-CU6v8eqg.js +0 -1
  140. package/dist/assets/useInitialThreadRequest-BqzvhNbA.js +0 -1
  141. package/dist/assets/zeni-epic-state-dcVRrD1h.js +0 -14
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-BdePShct.js";import{A as i}from"./AddressScreen-IPMb-Lqg.js";import s from"./NotFoundScreen-C4aqnA8_.js";import"./sentry-CX_3yQh7.js";import{n as d,o as r}from"./core-C_ZreJAw.js";import"./zeni-epic-state-H6DZSSlf.js";import"./recharts-CHr9O26_.js";import"./index-CGS6zWWp.js";import"./mui-BtnH6ELy.js";import"./analytics-CgF6EPDF.js";import"./plaid-CLHQ0yLv.js";import"./dnd-C3uQO7Bn.js";import"./stripe-DMRn4zHo.js";import"./lottie-CUKBWgbe.js";import"./lexical-E_ubWL4u.js";import"./pdf-CH0jWS01.js";import"./utils-Dw8b4HCO.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]="7f1b944a-9a7d-4e6b-b1ef-dc3a07ec71ea",t._sentryDebugIdIdentifier="sentry-dbid-7f1b944a-9a7d-4e6b-b1ef-dc3a07ec71ea")}catch{}})();function _(){return e.jsxs(d,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(i,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(i,{})}),e.jsx(r,{path:"*",element:e.jsx(s,{})})]})}export{_ as default};
@@ -0,0 +1,9 @@
1
+ import{j as n}from"./liveblocks-BdePShct.js";import{a as b}from"./sentry-CX_3yQh7.js";import{j as T,h as _,u as j,l as E,g as B,k as M}from"./core-C_ZreJAw.js";import{Z as $,m as D,z as L,k as K,B as O,A as N,c as C,f as S,O as z,i as h,q as F}from"./index-CGS6zWWp.js";import{Jm as k,gN as J,eO as R,Jn as U,c1 as q,Jo as G,k7 as V}from"./zeni-epic-state-H6DZSSlf.js";import{n as H}from"./mui-BtnH6ELy.js";import Z from"./NotFoundScreen-C4aqnA8_.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]="fa5e5047-e2c0-4417-929f-aebbfbe4e495",e._sentryDebugIdIdentifier="sentry-dbid-fa5e5047-e2c0-4417-929f-aebbfbe4e495")}catch{}})();const Q=H.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=M(function(e,t){const{addressId:o,isSubPage:i,addressType:c}=t,l=R(e),a=t.roleMap!=null&&U(t.roleMap),r=i||c==="user_address"||q(l?.userRole??[])||a?void 0:"readonly";if(o==null){const s=G(c,e);return{addressToEdit:s?.addressToCreate,loadingState:s?.status?.fetchState,googleAPIKey:h.googleMapsAPIKey,isDisabled:r,isSubPage:i,dontShowSaveConfirmationPopup:t.dontShowSaveConfirmation}}const d=k(e,o);return{addressToEdit:d.address,loadingState:d.fetchState,googleAPIKey:h.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,d=F(r?.pathnameStackToGoBack);let s=d.poppedPathname??w();const u=r?.queryParams;if(u){const f=new URLSearchParams(u).toString();f&&(s=`${s}?${f}`)}o(s,{state:{pathnameStackToGoBack:d.newStack}})}};return{onSubmitHandler:a=>{const r=X(a);e(V({addressType:c,addressToCreate:r})),C?.trackSaveAddressClicked(S.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)}}})(z);function ne({isSubPage:e,hideAddressSubTitle:t=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=T(),r=_(),d=j(),{addressId:s,addressType:u}=E(),f=$(),I=D(),v=L.getSignedInUser(),[g,x]=b.useState(s==null),p=B(m=>s!=null?k(m,s).fetchState:"Not-Started"),A=K();if(v==null)throw Error("Can't access address page without signing in...");const P=m=>m.trackPageLoaded(s!=null?S.Event.editAddress:S.Event.addAddress),y=l??u;return b.useEffect(()=>{g||s==null||(x(!0),r(J(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"?n.jsx(O,{fetchState:p,style:{backgroundColor:I.colors.grey5}}):s!=null&&p==="Error"?(a(`${w(1)}/new`,{replace:!0}),n.jsx(n.Fragment,{})):n.jsxs(n.Fragment,{children:[n.jsx(N,{analytics:C,onLoad:P}),n.jsx(Q,{windowSize:f,children:n.jsx(W,{location:d,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:t,addressId:s,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:A?.loggedInUserRoleMap})})]}):n.jsx(Z,{})}const w=(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{ne as A,X as t};
@@ -0,0 +1,11 @@
1
+ import{j as h}from"./liveblocks-BdePShct.js";import{a as r}from"./sentry-CX_3yQh7.js";import{h as oe,j as ne,u as ie,g as V,l as re,k as le}from"./core-C_ZreJAw.js";import{Q as ce,cK as ue,z as de,Z as me,cL as pe,cM as fe,cN as he,cO as G,A as Se,c as U,U as j,cP as ge,cQ as Ce,f as be,a3 as ke,cR as we,W as Ie,s as Ee,q as $,aZ as Pe,cS as Te}from"./index-CGS6zWWp.js";import{fE as ye,f3 as W,eO as _e,hr as xe,PV as Ue,eN as ve,hB as Qe,hx as Ae,fu as Oe,fo as De,fh as Fe,fl as q,fp as Be,fq as Le,fr as Me,fs as Re,ft as Ne}from"./zeni-epic-state-H6DZSSlf.js";import{D as Ve,n as v,P as je,S as $e}from"./mui-BtnH6ELy.js";import{p as qe}from"./pathToGoBack-Bg0yBLYd.js";import"./recharts-CHr9O26_.js";import"./analytics-CgF6EPDF.js";import"./plaid-CLHQ0yLv.js";import"./dnd-C3uQO7Bn.js";import"./stripe-DMRn4zHo.js";import"./lottie-CUKBWgbe.js";import"./lexical-E_ubWL4u.js";import"./pdf-CH0jWS01.js";import"./utils-Dw8b4HCO.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new s.Error().stack;i&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[i]="cec80e45-ae0c-4aa1-b366-b67cdf11d82b",s._sentryDebugIdIdentifier="sentry-dbid-cec80e45-ae0c-4aa1-b366-b67cdf11d82b")}catch{}})();const z="chat-response-generated",Ge=le(function(s,i){const a=W(s),m=i.isSubmitting;return{showSampleQuestions:i.sessionFromUrl==="explore"&&a.uiState.currentChatSessionId==null,aiCfoView:a,isSubmitting:m,isNewChatSession:i.sessionFromUrl==="new_chat"||i.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Ie}/tableDownload`,emailLinkQuestion:i.emailLinkQuestion,autoSubmitEmailLinkQuestion:i.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:i.onEmailLinkQuestionProcessed,isFileUploadEnabled:i.isFileUploadEnabled,isUploadPromoVisible:i.isUploadPromoVisible,onUploadPromoClose:i.onUploadPromoClose}},function(s,i){const{location:a,currentTenant:m,userId:d,navigate:p,currentChatSessionId:f,allSessionsWithOrderedQuestionAnswers:S,setIsAiCfoOpen:l}=i;return{onEventReceived:(e,o)=>{if(e===z&&typeof o.text=="string"&&typeof o.metadata=="object"){const n=o,c=Le(n.type),t=n.metadata.chat_session_id??null,{currentChatSession:I,currentQuestionAnswer:g,currentQuestionAnswerSummary:E}=G(S,t);c!=="answer"?U.trackAICFOChatResponseGenerated(c,g?.question.questionText??"",n.text,t,Te(E,I),n.metadata.message_id??null):U.trackAICFOChatAnswerGenerated(n.text,g?.question.questionText??"",(n.follow_up_questions?.length??0)>0,!!n.assumptions,!!n.insights,n.visualization!=null,Me(n.visualization?.type??"")??null,t,n.summarized_title,n.metadata.message_id??null),s(Re({chatSessionId:n.metadata.chat_session_id,responseType:c,fetchState:{fetchState:"Completed",error:void 0}})),s(Ne({chatSessionId:n.metadata.chat_session_id,answerPayload:n,userId:d}))}},onSubmit:(e,o,n,c)=>{e&&Pe(s,e,o,f,S,d,c,n)},updateCurrentInput:e=>{s(q(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{s(Be(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{p(-1)},onCloseClick:()=>{const e=$(a.state?.pathnameStackToGoBack),o=e.poppedPathname??qe(1);p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack}}),s(q(""))},togglePageView:()=>{const e=$(a.state?.pathnameStackToGoBack),o=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),l(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{p(-1)},onNewChatClick:()=>{f!=null&&s(Fe());const e=Ee(a.state?.pathnameStackToGoBack,a.pathname);p(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{s(De({questionAnswerId:e,isCollapsed:o}))},onMenuClick:i.onMenuClick}})(ke(we)),dt=({isFileUploadEnabled:s})=>{const{setIsAiCfoOpen:i}=ce(),a=oe(),m=ne(),d=ie(),[p,f]=r.useState(!1);r.useEffect(()=>{a(ye())},[a]);const{customPageTitle:S}=ue(),l=V(u=>W(u)),e=de.getSignedInUser(),{session_id:o}=re(),n=me(),c=V(u=>_e(u)),t=l.uiState.currentChatSessionId,I=c.tenantEmailDomain,{handleUploadPromoClose:g,isUploadPromoVisible:E}=pe({isFileUploadEnabled:s,tenantEmailDomain:I}),Q=fe({currentTenant:c,currentChatSessionId:t,aiCfoView:l}),C=d.state,b=C?.aiCfoInitialQuestion,A=!!C?.aiCfoShouldSubmit,[H,P]=r.useState(null),[K,T]=r.useState(!1),O=r.useRef(!1);r.useEffect(()=>{O.current||b==null||b===""||(P(b),T(A),O.current=!0)},[b,A]);const Y=r.useCallback(()=>{P(null),T(!1)},[]),D=r.useMemo(()=>new URLSearchParams(d.search),[d.search]),F=D.get("ref")??C?.aiCfoRef,y=D.get("emailRefId")??C?.aiCfoEmailRefId,B=r.useRef(!1);r.useEffect(()=>{B.current||F!=="month-end-email"||y==null||t!=null||e==null||(a(xe("controller",e.userId,y,"MONTH_END_EMAIL")),B.current=!0)},[F,y,t,a,e]);const k=l.uiState.lastContextMessage;r.useEffect(()=>{k!=null&&k!==""&&t!=null&&(P(k),T(!0),a(Ue()))},[k,t,a]);const Z=c.masterTOSInfo,w=Z?.isMasterTOSAccepted??!1,{visitedSessions:L}=he(t),_=l.fetchState,x=l.uiState.chatSessionsNextPageToken.hasMore||!l.uiState.chatSessionsFirstPageFetched,M=t!=null?l.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",R=t==null||(l.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),N=l.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:X}=G(N,t),J=X.length===0;r.useEffect(()=>{w||m("../dashboard",{state:{...d.state,message:"open_ai_cfo_drawer"}})},[w]),r.useEffect(()=>{t!=null&&o!==t&&m(`../ai-cfo/${t}`,{state:{...d.state}})},[t,o]),r.useEffect(()=>{o!=null&&t==null&&o!=="new_chat"&&o!=="explore"&&a(ve({sessionId:o,agentId:"controller"}))},[]);const ee=r.useMemo(()=>({events:L.map(u=>`private-encrypted-chat-${u}.${z}`),eventCallback:(u,se,ae)=>ae.onEventReceived(u,se)}),[L]);if(r.useEffect(()=>{_!=="In-Progress"&&x&&a(Qe())},[_,x,a]),r.useEffect(()=>{t!=null&&M!=="In-Progress"&&R&&e!=null&&_==="Completed"&&!x&&a(Ae(t,e.userId))},[M,R,t,e,a]),e==null||o==null)throw Error("Can't access AI Controller page without signing in...");const te=t!=null&&l.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";return h.jsxs(ze,{children:[h.jsx(Se,{analytics:U,onLoad:u=>u.trackPageLoaded(be.Event.aiCFOPage)}),j(n)&&Q.drawerElement,h.jsx(Ge,{...ee,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:N,openOnboardingPage:()=>f(!0),userId:e.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:o,location:d,isSubmitting:te,isEmptyChatWithSession:J,customPageTitle:S,currentTenant:c,emailLinkQuestion:H??void 0,autoSubmitEmailLinkQuestion:K,onEmailLinkQuestionProcessed:Y,onMenuClick:j(n)?Q.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:E,onUploadPromoClose:g}),h.jsx(Ve,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:He,style:{width:`${ge}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:h.jsx(We,{onClick:u=>u.stopPropagation(),children:h.jsx(Ce,{isTOSAccepted:w,acceptMasterTOSState:l.masterTOSAcceptanceState,customPageTitle:S,onCloseClick:()=>f(!1),onCompleteClick:()=>{w||c.userRoleId==null||a(Oe(c.userRoleId)),f(!1)}})})})]})},We=v($e)`
2
+ display: flex;
3
+ min-height: 100%;
4
+ flex-direction: column;
5
+ `,ze=v.div`
6
+ height: 100vh;
7
+ width: 100%;
8
+ `,He=v(je)`
9
+ box-shadow: ${({theme:s})=>s.colors.elevation2};
10
+ color: ${({theme:s})=>s.colors.grey4};
11
+ `;export{dt as default};
@@ -0,0 +1 @@
1
+ import{j as l}from"./liveblocks-BdePShct.js";import{a as y}from"./sentry-CX_3yQh7.js";import{j as B,u as U,h as j,g as f,N as $,k as T,l as O,n as F,o as h}from"./core-C_ZreJAw.js";import{eO as N,MF as A,Ml as b,x9 as w,x3 as L,x7 as x,wY as M,Mn as z,w$ as W,xb as q,xa as C}from"./zeni-epic-state-H6DZSSlf.js";import{m as P,z as k,B as V,a3 as Y,bz as G,ac as _,bA as H}from"./index-CGS6zWWp.js";import"./mui-BtnH6ELy.js";import{i as J}from"./ReimbursementApprovalRuleDetailScreen-DMdpETrG.js";import K from"./NotFoundScreen-C4aqnA8_.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]="938536ab-ccac-4424-be12-7857793b062a",e._sentryDebugIdIdentifier="sentry-dbid-938536ab-ccac-4424-be12-7857793b062a")}catch{}})();const I="bill-approval-rule-update",Q=T(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:n}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(I)&&e(z(!1))},onBackClick:()=>{_(n)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(M(a))},onEditRuleClick:a=>{a!=null?(e(x(a)),t(`./${a}/edit`)):(e(x()),t("./new"))}}})(Y(G)),X=()=>{const e=B(),o=U(),t=j(),[n,a]=y.useState(!1),[u,s]=y.useState(!1),d=P(),p=f(i=>i.billPaySetupApproverViewState.fetchState),c=f(i=>N(i)),r=f(i=>A(i)),g=f(i=>b(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(w())},[g]),y.useEffect(()=>{n||p!=="Not-Started"||(a(!0),t(L(!0)))},[n,p,t]),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),t(x())),e("./new"))},[u,r,t]);const v={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${I}`]:[],eventCallback:(i,R,m)=>{i.endsWith(I)&&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(Q,{currentTenant:c,location:o,navigate:e,...v})},Z=T(function(e,o){const t=b(e),n=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=n==="approval_create"&&t.allApprovalRules.length!==0;let u=t.allApprovalRules.length===0;return o.approvalRuleId&&(u=t.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:u,approvalUpdateActionType:n}},function(e,o){const{navigate:t,approvalUpdateDataView:n,approverViewData:a,approvalRuleId:u}=o,s=n.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:p=>{const c=r=>{const g=[];return r.forEach(v=>{const i=v.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),R=v.actors.selectedNonUsers.map(S=>{const E=!!J(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),m=i.concat(R);g.push({action:v.stepType.selectedOption,actors:m,operator:m.length>1?v.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:p.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:p.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:p.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:p.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(w()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(w()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(q())},onSaveRuleSuccess:()=>{t("../")}}})(H);function D(){const e=B(),o=j(),t=U(),{approvalRuleId:n}=O(),a=k.getSignedInUser(),u=P(),s=f(r=>b(r)),d=f(r=>A(r)),[p,c]=y.useState(!1);if(y.useEffect(()=>{p||(c(!0),o(W(!0)))}),y.useEffect(()=>{d.fetchState==="Not-Started"&&e(n!=null?"../../":"../")},[d,n]),a==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:n,approverViewData:d,location:t})}function se(){return l.jsxs(F,{children:[l.jsx(h,{path:"/",element:l.jsx(X,{})}),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(K,{})})]})}export{se as B};
@@ -1,23 +1,23 @@
1
- import{j as a}from"./liveblocks-CqGMBzbB.js";import{j as K,h as se,u as Q,l as ae,g as v,N as te,k as X,i as na,n as ia,o as S}from"./core-DMKpdX6V.js";import{eN as Z,LA as Me,bv as It,GD as oa,bo as wt,bD as pe,LB as xt,ws as Bt,xC as Ve,w$ as la,bn as De,LC as sa,LD as ra,c0 as ca,LE as da,jq as Ct,LF as At,LG as Et,yb as _e,wH as Ce,LH as ua,wg as tt,LI as pa,Bn as ma,wk as ba,wq as Dt,LJ as ke,LK as Ge,xD as Ne,LL as ha,LM as ga,xG as Oe,LN as ya,xT as Sa,LO as jt,xn as at,xs as fa,LP as ka,LQ as ue,LR as Tt,LS as Pt,LT as Ft,fH as va,wM as $e,cv as Rt,LU as Ia,gC as wa,LV as xa,LW as Ba,eT as Lt,eR as Vt,LX as ze,LY as Ca,LZ as Aa,Jj as Ze,L_ as Ea,Jk as oe,Jl as He,L$ as Da,M0 as ja,M1 as Ta,xu as nt,xr as Pa,M2 as Fa,M3 as Ra,M4 as La,xd as Va,M5 as $a,M6 as Ua,M7 as Ma,cj as $t,cL as Ut,jB as _a,bJ as Ga,bq as Mt,bK as _t,vy as Na,M8 as Oa,Ba as za,Bg as Za,s5 as Ha,xE as Wa,yi as qa,jO as fe,M9 as Ja,Ma as Gt,kg as Ka,jI as Nt,k1 as Ot,k0 as it,bC as be,bI as Qa,Mb as Xa,Mc as ve,ik as Ya,Md as ot,Me as en,ip as tn,iK as an,yw as nn,Mf as on,k9 as ln,ym as sn,Mg as lt,yq as rn,yv as cn,ys as dn,yk as un,Mh as zt,wB as pn,Mi as mn,Mj as bn,fz as hn,fy as gn,fx as yn,jR as Sn,k7 as st,ki as fn,pE as kn,j_ as vn,yo as In,iv as wn,kn as xn,Mk as Bn,im as Cn,pv as An,Ml as En,xj as Dn,bE as jn,bs as Tn,Ik as Pn,cN as Fn,cM as Rn,cu as Ln,cA as Vn}from"./zeni-epic-state-dcVRrD1h.js";import{h as me,z as L,j as Ie,p as le,m as y,aJ as Ae,B as re,o as A,C as je,c as D,b5 as $n,w as z,U as We,y as E,r as we,b6 as rt,b7 as ct,b8 as Un,ag as Mn,H as _n,aD as Gn,F as Zt,D as qe,J as Je,b9 as Nn,ap as Ht,ba as On,N as zn,e as Wt,a1 as Zn,bb as Hn,bc as Wn,bd as qn,be as Jn,bf as Kn,bg as Qn,bh as Xn,bi as Yn,bj as ei,A as ti,bk as ai,b1 as ni,bl as ii,bm as oi,a5 as li}from"./index-B-S1sw2q.js";import{n as U,S as si}from"./mui-C4peJOR0.js";import{A as dt}from"./AddressScreen-jTT04DFx.js";import{g as ie,a as Te,i as qt,V as Ke,b as Qe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-Dcgzj1nk.js";import{a as f}from"./sentry-By_w3AbQ.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-CjhdCks2.js";import{c as Ye}from"./useFetchSuggestedQuestionsWhenReady-CU6v8eqg.js";import{u as Jt}from"./useInitialThreadRequest-BqzvhNbA.js";import Ee from"./NotFoundScreen-C_3ycSKf.js";import{D as ui}from"./DrawerScreen-BIAu5bA1.js";import{M as Kt}from"./MobileAppDrawer-CQwwOR5p.js";import{F as Qt}from"./FeaturePreviewScreen-D6Uxvt0_.js";import{S as Pe}from"./SetupPagesScreen-tsJgjmfM.js";import{B as pi}from"./BillPayApprovalRoutes-C44-nGT6.js";import{FallBackRoute as mi}from"./ScreenRoutes-Bpg_5BOg.js";import"./recharts-DEvckcqQ.js";import"./analytics-COzTMS9t.js";import"./plaid-DWM21M_R.js";import"./dnd-B4MKAlTf.js";import"./stripe-DMRn4zHo.js";import"./lottie-BflCEFtX.js";import"./lexical-ChtLw4s9.js";import"./pdf-C6aRryDe.js";import"./utils-CSUcsfYh.js";import"./analyticsHelper-CQQBcwi_.js";import"./routePaths-DwcIzItv.js";import"./BusinessVerificationPageScreen-DS8yDRTx.js";import"./ReimbursementApprovalRuleDetailScreen-DdLOedPE.js";import"./getLocaleForTenant-DIj12PGu.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]="106d6a2f-5dca-4348-9e74-e779d9698f7c",e._sentryDebugIdIdentifier="sentry-dbid-106d6a2f-5dca-4348-9e74-e779d9698f7c")}catch{}})();const bi=X(function(e,t){const l=Me(e,t.billId),i=L.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const n=De(i);n||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=sa(l.billActivities,ra(t.currentTenant),i);d=g,p=b}const m=ca(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&da(l.transactionDetails,m,i);return{billDetails:l,isAccountingClassesEnabled:Ct(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${We}/transaction_attachment`,signedInUser:i,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:n}},function(e,t){const{billId:l,currentTenant:i,location:c,navigate:r}=t,{tenantEmailDomain:u}=i;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ce(l,"retry")):e(Ce(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const n=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(n,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ce(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(_e(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(At({billId:l}))}}})($n);function hi(){const e=K(),t=se(),l=Q(),{billId:i}=ae(),c=me(),r=L.getSignedInUser(),u=Ie(),o=v(N=>Z(N)),s=v(N=>Me(N,i??"")),n=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Jt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!n}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Xe({mobileExploreReferrer:"Bill Details"});Ye({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&It(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,k]=f.useState(!1),[j,x]=f.useState(!1),[B,_]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:M}=le(),{isFeatureEnabled:V}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:G}=M(Ae.zeniAssistConfig),C=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),$=G.user_ids!=null&&r?.userId!=null&&G.user_ids.includes(r?.userId),{isFeatureEnabled:J}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{V&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&C===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(N=>N.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,C,r]),f.useEffect(()=>{i!=null&&t(xt(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Bt(i??"",V,$,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(x(!0),t(Ve(!1,V,$,Y,i)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[j,s,i,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(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${A.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:N=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(N)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:V,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:B,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:J,hasZeniAssistAccess:$,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=qe.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=X(function(e,t){const l=L.getSignedInUser(),i=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:A.sp10,paddingRight:A.sp3,paddingBottom:"15px",paddingLeft:A.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=L.getSignedInUser();return{onInvoiceUpload:i=>{i!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(i),t.setShowConfirmationPopup(!0)):e(Oe(i,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:i=>{e(Sa({fetchState:{fetchState:i,error:void 0},billId:t.billId}))},onSkipAutofill:i=>{D?.trackBillPaySkipAutofill(),e(Ne(i))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Gn);function w({appContent:e}){const t=se(),l=K(),{billId:i}=ae(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:k}=p(Ae.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),x=v(F=>Z(F)),[B,_]=f.useState(!1),[T,M]=f.useState(!1),[V,I]=f.useState(!1),[H,G]=f.useState(),C=v(F=>Ge(F,m,g,i));let q=C.fetchState,W=C.file,$=C.showAutofill;const J=v(F=>Me(F,i??""));u===!1&&(q=J.fetchState,W=J.transactionDetails?.attachments?.[0],$=!1);const Y=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;f.useEffect(()=>{i==null&&t(Ne(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?M(!1):!u&&B&&_(!1))},[i]),f.useEffect(()=>{B||i==null||u||(_(!0),t(Bt(i,h,j,!1)),T||(M(!0),t(Ve(!1,h,j,b,i)))),u&&!T&&(M(!0),t(Ve(!1,h,j,b,i)))},[B,T,u,i,t]);const N={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,n?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:i})),t(Oe(H,m,i))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,n?.userEmail??"","no"),t(ha({file:H,billId:i}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(x.tenantEmailDomain);t(ke({billId:i})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,x.tenantEmailDomain,i,t,l]);if(n==null)throw Error("Can't access address page without signing in...");if(q==="Error"||J.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return i==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Re,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:!0,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:G,showActionButtons:!1,isInitialEdit:!!C.isInitialEdit,billStage:Y}),a.jsx(Le,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||$?null:a.jsx(pt,{children:a.jsx(Xt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Un,{}),a.jsx(Le,{windowSize:o,children:a.jsx(ct,{isNewBill:i==null})})]});{const F=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[$&&o!=="small"?a.jsx(mt,{}):null,V?a.jsx(Mn,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:N,isEditPopup:!0}):null,o==="small"||$?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:$,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,J,C),setShowConfirmationPopup:I,setPayload:G,showActionButtons:fi(u,C),isInitialEdit:!!C.isInitialEdit,billStage:F}),a.jsx(Le,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=Nn();return a.jsx(Xt,{onClick:e,"data-testid":"nav-bar-back-click"})}function Si(e,t,l){let i,c;return e?(i=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(i=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(ki,{children:[a.jsx(vi,{children:`${ye.recurringBill.recurringCycle}
2
- ${i}/${c}`}),a.jsx(Ii,{})]}):void 0}function fi(e,t){const l=t.billActivities?.[0],i=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||i)}const pt=U.div`
1
+ import{j as a}from"./liveblocks-BdePShct.js";import{j as K,h as se,u as X,l as ae,g as v,N as te,k as Y,i as na,n as ia,o as S}from"./core-C_ZreJAw.js";import{eO as Z,LX as Ue,bv as It,GS as oa,bo as wt,bE as pe,LY as xt,wt as Bt,xD as Ve,x0 as la,bn as De,LZ as sa,L_ as ra,c1 as ca,L$ as da,jr as Ct,M0 as At,M1 as Et,yc as _e,wI as Ce,M2 as ua,wh as tt,M3 as pa,Bo as ma,wl as ba,wr as Dt,M4 as ke,M5 as Ge,xE as Oe,M6 as ha,M7 as ga,xH as Ne,M8 as ya,xU as Sa,M9 as jt,xo as at,xt as fa,Ma as ka,Mb as ue,Mc as Tt,Md as Pt,Me as Ft,fI as va,wN as $e,cw as Rt,Mf as Ia,gD as wa,Mg as xa,Mh as Ba,eU as Mt,eS as Vt,Mi as ze,Mj as Ca,Mk as Aa,JG as Ze,Ml as Ea,JH as oe,JI as He,Mm as Da,Mn as ja,Mo as Ta,xv as nt,xs as Pa,Mp as Fa,Mq as Ra,Mr as Ma,xe as Va,Ms as $a,Mt as La,Mu as Ua,ck as $t,cM as Lt,jC as _a,bK as Ga,bq as Ut,bL as _t,vz as Oa,Mv as Na,Bb as za,Bh as Za,s6 as Ha,xF as Wa,yj as qa,jP as fe,Mw as Ja,Mx as Gt,kh as Ka,jJ as Ot,k2 as Nt,k1 as it,bD as be,bJ as Xa,My as Ya,Mz as ve,il as Qa,MA as ot,MB as en,iq as tn,iL as an,yx as nn,MC as on,ka as ln,yn as sn,MD as lt,yr as rn,yw as cn,yt as dn,yl as un,ME as zt,wC as pn,MF as mn,MG as bn,fA as hn,fz as gn,fy as yn,jS as Sn,k8 as st,kj as fn,pF as kn,j$ as vn,yp as In,iw as wn,ko as xn,MH as Bn,io as Cn,pw as An,MI as En,xk as Dn,bF as jn,bs as Tn,IC as Pn,cO as Fn,cN as Rn,cv as Mn,cB as Vn}from"./zeni-epic-state-H6DZSSlf.js";import{m as me,z as M,k as Ie,y as le,$ as y,aK as Ae,B as re,o as A,A as je,c as D,b6 as $n,q as z,W as We,s as E,Z as we,b7 as rt,b8 as ct,b9 as Ln,ah as Un,G as _n,aE as Gn,E as Zt,D as qe,H as Je,ba as On,aq as Ht,bb as Nn,R as zn,f as Wt,a3 as Zn,bc as Hn,bd as Wn,be as qn,bf as Jn,bg as Kn,bh as Xn,bi as Yn,bj as Qn,bk as ei,V as ti,bl as ai,b2 as ni,bm as ii,bn as oi,a6 as li}from"./index-CGS6zWWp.js";import{n as L,S as si}from"./mui-BtnH6ELy.js";import{A as dt}from"./AddressScreen-IPMb-Lqg.js";import{g as ie,a as Te,i as qt,V as Ke,b as Xe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-BkEDowN8.js";import{a as f}from"./sentry-CX_3yQh7.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-Nsv7MqoG.js";import{c as Qe}from"./useFetchSuggestedQuestionsWhenReady-C86A67zi.js";import{u as Jt}from"./useInitialThreadRequest-AyrSL871.js";import Ee from"./NotFoundScreen-C4aqnA8_.js";import{D as ui}from"./DrawerScreen-B_tMe04S.js";import{M as Kt}from"./MobileAppDrawer-BDT0TmvR.js";import{F as Xt}from"./FeaturePreviewScreen-aYYY9m7f.js";import{S as Pe}from"./SetupPagesScreen-Cdo59_U5.js";import{B as pi}from"./BillPayApprovalRoutes-B33P7K39.js";import{FallBackRoute as mi}from"./ScreenRoutes-9MMqpDv8.js";import"./recharts-CHr9O26_.js";import"./analytics-CgF6EPDF.js";import"./plaid-CLHQ0yLv.js";import"./dnd-C3uQO7Bn.js";import"./stripe-DMRn4zHo.js";import"./lottie-CUKBWgbe.js";import"./lexical-E_ubWL4u.js";import"./pdf-CH0jWS01.js";import"./utils-Dw8b4HCO.js";import"./analyticsHelper-DUlInMOD.js";import"./routePaths-DZkWYInw.js";import"./BusinessVerificationPageScreen-BI3GYpKu.js";import"./ReimbursementApprovalRuleDetailScreen-DMdpETrG.js";import"./getLocaleForTenant-C-vhBCTM.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]="c9c7a035-5df7-447e-bbf6-d38c12d656c7",e._sentryDebugIdIdentifier="sentry-dbid-c9c7a035-5df7-447e-bbf6-d38c12d656c7")}catch{}})();const bi=Y(function(e,t){const l=Ue(e,t.billId),i=M.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const n=De(i);n||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=sa(l.billActivities,ra(t.currentTenant),i);d=g,p=b}const m=ca(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&da(l.transactionDetails,m,i);return{billDetails:l,isAccountingClassesEnabled:Ct(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${We}/transaction_attachment`,signedInUser:i,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:n}},function(e,t){const{billId:l,currentTenant:i,location:c,navigate:r}=t,{tenantEmailDomain:u}=i;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ce(l,"retry")):e(Ce(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const n=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(n,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ce(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(_e(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(At({billId:l}))}}})($n);function hi(){const e=K(),t=se(),l=X(),{billId:i}=ae(),c=me(),r=M.getSignedInUser(),u=Ie(),o=v(O=>Z(O)),s=v(O=>Ue(O,i??"")),n=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Jt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!n}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Ye({mobileExploreReferrer:"Bill Details"});Qe({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&It(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,k]=f.useState(!1),[j,x]=f.useState(!1),[B,_]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:U}=le(),{isFeatureEnabled:V}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:G}=U(Ae.zeniAssistConfig),C=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),$=G.user_ids!=null&&r?.userId!=null&&G.user_ids.includes(r?.userId),{isFeatureEnabled:J}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Q}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{V&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&C===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(O=>O.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,C,r]),f.useEffect(()=>{i!=null&&t(xt(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Bt(i??"",V,$,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(x(!0),t(Ve(!1,V,$,Q,i)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[j,s,i,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(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${A.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:O=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(O)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:V,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:B,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:J,hasZeniAssistAccess:$,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=qe.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=Y(function(e,t){const l=M.getSignedInUser(),i=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:A.sp10,paddingRight:A.sp3,paddingBottom:"15px",paddingLeft:A.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=M.getSignedInUser();return{onInvoiceUpload:i=>{i!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(i),t.setShowConfirmationPopup(!0)):e(Ne(i,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:i=>{e(Sa({fetchState:{fetchState:i,error:void 0},billId:t.billId}))},onSkipAutofill:i=>{D?.trackBillPaySkipAutofill(),e(Oe(i))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Gn);function w({appContent:e}){const t=se(),l=K(),{billId:i}=ae(),c=X(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=M.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:k}=p(Ae.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),x=v(F=>Z(F)),[B,_]=f.useState(!1),[T,U]=f.useState(!1),[V,I]=f.useState(!1),[H,G]=f.useState(),C=v(F=>Ge(F,m,g,i));let q=C.fetchState,W=C.file,$=C.showAutofill;const J=v(F=>Ue(F,i??""));u===!1&&(q=J.fetchState,W=J.transactionDetails?.attachments?.[0],$=!1);const Q=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;f.useEffect(()=>{i==null&&t(Oe(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?U(!1):!u&&B&&_(!1))},[i]),f.useEffect(()=>{B||i==null||u||(_(!0),t(Bt(i,h,j,!1)),T||(U(!0),t(Ve(!1,h,j,b,i)))),u&&!T&&(U(!0),t(Ve(!1,h,j,b,i)))},[B,T,u,i,t]);const O={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Q??"",F,n?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:i})),t(Ne(H,m,i))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Q??"",F,n?.userEmail??"","no"),t(ha({file:H,billId:i}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(x.tenantEmailDomain);t(ke({billId:i})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,x.tenantEmailDomain,i,t,l]);if(n==null)throw Error("Can't access address page without signing in...");if(q==="Error"||J.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return i==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Re,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:!0,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:G,showActionButtons:!1,isInitialEdit:!!C.isInitialEdit,billStage:Q}),a.jsx(Me,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||$?null:a.jsx(pt,{children:a.jsx(Yt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Ln,{}),a.jsx(Me,{windowSize:o,children:a.jsx(ct,{isNewBill:i==null})})]});{const F=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[$&&o!=="small"?a.jsx(mt,{}):null,V?a.jsx(Un,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:O,isEditPopup:!0}):null,o==="small"||$?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:$,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,J,C),setShowConfirmationPopup:I,setPayload:G,showActionButtons:fi(u,C),isInitialEdit:!!C.isInitialEdit,billStage:F}),a.jsx(Me,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=On();return a.jsx(Yt,{onClick:e,"data-testid":"nav-bar-back-click"})}function Si(e,t,l){let i,c;return e?(i=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(i=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(ki,{children:[a.jsx(vi,{children:`${ye.recurringBill.recurringCycle}
2
+ ${i}/${c}`}),a.jsx(Ii,{})]}):void 0}function fi(e,t){const l=t.billActivities?.[0],i=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||i)}const pt=L.div`
3
3
  margin-bottom: 20px;
4
4
  margin-top: 20px;
5
5
  margin-left: ${A.sp5};
6
6
  position: absolute;
7
7
  display: flex;
8
8
  align-items: center;
9
- `,ki=U.div`
9
+ `,ki=L.div`
10
10
  display: flex;
11
11
  justify-content: center;
12
12
  align-items: center;
13
13
  padding-top: 9px;
14
14
  gap: ${A.sp2};
15
15
  margin-bottom: -${A.sp2};
16
- `,vi=U(Je.StandardMedium)``,Ii=U(e=>f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M3.35001 15L3.35001 10.125C3.35001 6.81129 6.0363 4.125 9.35001 4.125H16.475M16.475 4.125L13.85 1.5M16.475 4.125L13.85 6.75",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M20.6 9V13.875C20.6 17.1887 17.9137 19.875 14.6 19.875H7.47501M7.47501 19.875L10.1 22.5M7.47501 19.875L10.1 17.25",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})))`
16
+ `,vi=L(Je.StandardMedium)``,Ii=L(e=>f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M3.35001 15L3.35001 10.125C3.35001 6.81129 6.0363 4.125 9.35001 4.125H16.475M16.475 4.125L13.85 1.5M16.475 4.125L13.85 6.75",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M20.6 9V13.875C20.6 17.1887 17.9137 19.875 14.6 19.875H7.47501M7.47501 19.875L10.1 22.5M7.47501 19.875L10.1 17.25",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})))`
17
17
  color: ${e=>e.theme.colors.hero};
18
18
  height: ${A.sp3};
19
19
  width: ${A.sp3};
20
- `,Xt=U(e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M10 13L5 8L10 3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})))`
20
+ `,Yt=L(e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M10 13L5 8L10 3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})))`
21
21
  width: ${A.sp3};
22
22
  height: ${A.sp3};
23
23
  cursor: pointer;
@@ -25,7 +25,7 @@ import{j as a}from"./liveblocks-CqGMBzbB.js";import{j as K,h as se,u as Q,l as a
25
25
  &:hover {
26
26
  color: ${e=>e.theme.colors.primary};
27
27
  }
28
- `,Fe=U.div`
28
+ `,Fe=L.div`
29
29
  display: flex;
30
30
  height: 100vh;
31
31
  flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
@@ -43,7 +43,7 @@ import{j as a}from"./liveblocks-CqGMBzbB.js";import{j as K,h as se,u as Q,l as a
43
43
  z-index: 3;
44
44
  display: ${e=>e.windowSize==="small"?"none":"block"};
45
45
  }
46
- `,Re=U.div`
46
+ `,Re=L.div`
47
47
  position: absolute;
48
48
  top: 56px;
49
49
  left: 0;
@@ -51,7 +51,7 @@ import{j as a}from"./liveblocks-CqGMBzbB.js";import{j as K,h as se,u as Q,l as a
51
51
  height: 1px;
52
52
  background-color: ${e=>e.theme.colors.grey2};
53
53
  z-index: 3;
54
- `,mt=U.div`
54
+ `,mt=L.div`
55
55
  position: fixed;
56
56
  top: 0;
57
57
  left: 0;
@@ -59,25 +59,25 @@ import{j as a}from"./liveblocks-CqGMBzbB.js";import{j as K,h as se,u as Q,l as a
59
59
  bottom: 0;
60
60
  background-color: ${_n.overlayBackgroundBlack};
61
61
  z-index: 5;
62
- `,Le=U.div`
62
+ `,Me=L.div`
63
63
  display: flex;
64
64
  flex-direction: column;
65
65
  width: ${e=>`${gi.containerWidth.value(e.windowSize)}%`};
66
66
  ${e=>e.windowSize!=="small"?"overflow: auto;":""}
67
- `,wi=U(Je.H6Regular)`
67
+ `,wi=L(Je.H6Regular)`
68
68
  margin-top: ${A.sp7};
69
69
  padding-left: ${A.sp8};
70
70
  padding-right: ${A.sp8};
71
71
  color: ${e=>e.theme.colors.primary};
72
72
  word-break: break-word;
73
- `,xi=U(Je.LargeRegularSp)`
73
+ `,xi=L(Je.LargeRegularSp)`
74
74
  color: ${e=>e.theme.colors.hero};
75
75
  padding-left: ${A.sp8};
76
76
  padding-right: ${A.sp8};
77
77
  margin-bottom: 30px;
78
78
  margin-top: ${A.sp4};
79
79
  white-space: pre-line;
80
- `,Bi=X(function(e,t){return{billsReviewView:jt(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(ue())},onCloseReviewItem:l=>{e(ka(l))},onProceedForBulkActionClick:(l,i)=>{switch(l){case"send_for_approval":e(fa());break;case"approve":case"review":e(at("approved",i??""));break;case"reject":e(at("rejected",i??""))}}}})(On);function Ci(){const e=K(),t=v(i=>i.billsBulkActionViewState.bulkSubmissionFetchState.fetchState),{billsForReview:l}=v(i=>jt(i));return f.useEffect(()=>{t!=="Completed"&&l.length!==0||e("./")},[t,l.length]),a.jsx(Bi,{navigate:e,analytics:D})}const ne=Aa(),Yt="bulk-operation-update",Ue="bill-approval-rule-update",{spendManagement:Ai,common:bt}=qe.getLocalizedStrings(),ht=Ai.billPay.bulkActions,Ei=U.div`
80
+ `,Bi=Y(function(e,t){return{billsReviewView:jt(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(ue())},onCloseReviewItem:l=>{e(ka(l))},onProceedForBulkActionClick:(l,i)=>{switch(l){case"send_for_approval":e(fa());break;case"approve":case"review":e(at("approved",i??""));break;case"reject":e(at("rejected",i??""))}}}})(Nn);function Ci(){const e=K(),t=v(i=>i.billsBulkActionViewState.bulkSubmissionFetchState.fetchState),{billsForReview:l}=v(i=>jt(i));return f.useEffect(()=>{t!=="Completed"&&l.length!==0||e("./")},[t,l.length]),a.jsx(Bi,{navigate:e,analytics:D})}const ne=Aa(),Qt="bulk-operation-update",Le="bill-approval-rule-update",{spendManagement:Ai,common:bt}=qe.getLocalizedStrings(),ht=Ai.billPay.bulkActions,Ei=L.div`
81
81
  display: flex;
82
82
  min-height: 100%;
83
83
  width: 100%;
@@ -85,11 +85,11 @@ import{j as a}from"./liveblocks-CqGMBzbB.js";import{j as K,h as se,u as Q,l as a
85
85
  flex-direction: column;
86
86
  align-items: center;
87
87
  background-color: ${e=>e.theme.colors.grey4};
88
- `,Di=X(function(e,t){const l=L.getSignedInUser(),i=De(l),c=Ft(e,ne,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 u=e.entityAutoCompleteState.autoCompleteText.common,o=Ze(e,"common"),s=e.tenantState.currentTenantId,n=Z(e),d=n?.companyName??"",p={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},m=e.billListState.downloadUIState.downloadState,h=c.fetchState,g=Ea(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:h,analytics:D,botEmail:c.billPayBotEmail,searchText:c.searchText,filters:c.filters,vendorSearchAutoCompleteData:{autoCompleteText:u,entityAutoCompleteView:o},downloadParams:{authParams:p,companyName:d,timePeriod:ne,spendManagementEndPoint:`${We}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:m,isBulkActionAllowed:c.billListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:c.billListBulkActionInfo?.billsSelectedForBulkAction,allowedBulkActions:c.billListBulkActionInfo?.allowedBulkActions,isZeniUser:i,billPayApprovalRulesAffectedEntityIds:g.affectedEntityIds}},function(e,t){const{navigate:l,currentTenant:i,location:c,period:r}=t,{tenantEmailDomain:u}=i;return{updateTabToState:o=>{e(ue()),e(Tt(o))},onSubtabChange:o=>{e(ue()),e(Pt(o))},onTransactionClick:(o,s)=>{const n=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);l(n,{state:{pathnameStackToGoBack:d}})},onClickSetupIcon:()=>{const o=Ti(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);l(o,{state:{pathnameStackToGoBack:s}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;D?.trackBillPayNewBill();const s=`/${o}/bill/new`,n=E(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(s,{state:{pathnameStackToGoBack:n}})},onSearchTextChanged:o=>{e($a(o))},onReloadTransactions:()=>{e($e(r,!0,t.isShowDeletedBillsEnabled,t.isInternationalWireEnabled)),e(Va(i.companyId,!0))},onNavigateToSettings:()=>{l("../bills/setup")},onBackClick:()=>{l("../",{relative:"path"})},onFiltersChange:o=>{e(La({filters:o})),o.categories.every(s=>s.field!=null&&s.values?.length!==0)&&D.trackSpendManagmentFilterChange("bill_pay",o.categories.map(s=>`${s.field}-${JSON.stringify(s.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&D.trackSpendManagementDownloadClick("bill_pay"),e(Ra({uiState:{downloadState:o}}))},updateBulkActionList:o=>{e(Fa(o))},removeAllTransactionsFromBulkActionList:()=>{e(ue())},onProceedForBulkActionClick:(o,s)=>{switch(o){case"delete":case"cancel":e(Pa(o,s??""));break;case"send_for_approval":e(nt("send_for_approval")),t.navigate("./bulk-review");break;case"approve":e(nt("approve")),t.navigate("./bulk-review");break;case"review":e(Ta()),t.navigate("./bulk-review")}},onBillPayApprovalRulesEventReceived:o=>{o.endsWith(Ue)&&e(ja(!1))},onEventReceived:o=>{o===Yt&&e(Da())},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(He({searchString:o,entityType:"vendor",searchOrigin:"common"})):o.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}}}})(Zn(Hn));function ji(){const e=K(),t=se(),l=Q(),i=we(),c=l.state,r=Ie(),[u,o]=f.useState(!1),[s,n]=f.useState(null),d=na("/:tenantEmailDomain/bills/bulk-review")!=null;f.useEffect(()=>(c?.tab!=null&&c?.subTab!=null&&(t(Tt(c?.tab)),t(Pt(c?.subTab))),()=>{t(ue())}),[]);const p=L.getSignedInUser(),m=v(P=>Z(P)),{areTenantIdsInSync:h}=zn(),[g,b]=f.useState(!1),{useFeatureGate:k}=le(),{isFeatureEnabled:j}=k(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:x}=k(y.isBillPayCommentingEnabled),{isFeatureEnabled:B}=k(y.isReimbursementCommentingEnabled),{isFeatureEnabled:_}=k(y.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:T}=k(y.isBillPayBulkActionEnabled),{isFeatureEnabled:M}=k(y.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:V}=k(y.isBillPayDetectInsufficientFundsEnabled),I=v(P=>Ft(P,ne,T,p?.userId)),{isFeatureEnabled:H}=k(y.isDebitCardFeatureEnabled),G=I.fetchState,{isAiCfoAccessEnabled:C,onAskAiCfoClick:q}=Xe({mobileExploreReferrer:"Bills List"});Ye({isDataReady:G==="Completed"});const W=!!m.companyBillPayInfo?.info?.isBillPayTOSAccepted,$=!!m.companyBillPayInfo?.info?.isBillPayEnabled,J=v(P=>va(P.companyState,m.companyId)),Y=J?.company.featuresActivationInfo.connectedAccountProvider;if(f.useEffect(()=>{!g&&$&&h&&(b(!0),t($e(ne,!0,j,M)))},[g,ne,h,t]),p==null)throw Error("Can't access address page without signing in...");const N=(P,de)=>{t(Ca({uiState:{sortKey:P,sortOrder:de},period:ne}))},ee=Rt(r?.loggedInUserRoleMap),F=pe(r?.loggedInUserRoleMap),ce=P=>{o(P)},{billsProcessed:O,billsProcessing:xe}=v(P=>Ia(P));f.useEffect(()=>{O===xe&&s!=null&&(t(wa({messageSection:"bill_pay_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_bill_",variableValue:O>1?ht.bills:ht.bill},{variableName:"_has_",variableValue:O>1?bt.texts.have:bt.texts.has},{variableName:"_action_",variableValue:xa(s)}]})),t(Ba()),setTimeout(()=>{t($e(ne,!0,j,!0,M))},3e3),n(null))},[O,xe]);const ea={events:m.companyId!=null?[`private-${m.companyId}.${Yt}`,`private-${m.companyId}.${Ue}`]:[],eventCallback:(P,de,et)=>{P.endsWith(Ue)?et.onBillPayApprovalRulesEventReceived?.(P):de?.entity_type==="bill"&&(n(de.operation_type),et.onEventReceived(P))}},ta=Lt(H,m),aa=Vt(m);return l.pathname.endsWith("/bills/")||l.pathname.endsWith("/bills")||l.pathname.endsWith("/bills/bulk-review")?ta===!0||aa===!0?a.jsx(Qt,{}):$?a.jsxs(a.Fragment,{children:[G==="Completed"?a.jsx(je,{analytics:D,onLoad:P=>(de=>de.trackPageLoaded(Wt.Event.billPayHome))(P)}):null,a.jsxs(Ei,{windowSize:i,children:[a.jsx(Kt,{isAppContentDrawerOpen:u,handleDrawerToggle:ce}),a.jsx(ui,{isOpen:d,drawerLeftMargin:new Zt(0,0,300,600),onClose:()=>{e("./"),t(ue())},children:a.jsx(Pi,{onClick:P=>P.stopPropagation(),children:a.jsx(Ci,{})})}),a.jsx(Di,{location:l,navigate:e,currentTenant:m,entity:"bill_pay",isBillPayCommentingEnabled:x,isReimbursementCommentingEnabled:B,period:ne,isAdmin:!1,uiState:I.uiState,onColumnSortConfigChanged:N,isUserHasOnlyBillpayAccess:ee,isShowDeletedBillsEnabled:j,isShowDeletedReimbursementEnabled:_,isBulkActionEnabled:T,roleMap:r?.loggedInUserRoleMap,onClickMenuIcon:()=>{ce(!0)},isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:Y,bulkSubmissionLimit:I.billBulkSubmissionLimit,bulkSubmissionFetchState:I.billListBulkActionInfo.bulkSubmissionFetchState,isRecurringBillInBulkActionList:I.billListBulkActionInfo.isRecurringBillInBulkActionList,isInternationalWireEnabled:M,isDetectInsufficientFundsEnabled:V,isAiCfoAccessEnabled:C,onAskAiCfoClick:q,...ea})]})]}):W===!0&&F===!0?a.jsx(te,{to:"../setup"}):r!=null&&ze(m,r.loggedInUserRoleMap)?a.jsx(te,{to:"../promo"}):a.jsx(re,{fetchState:G}):a.jsx(Ee,{})}const Ti=e=>`/${e}/bills/setup`,Pi=U(si)`
88
+ `,Di=Y(function(e,t){const l=M.getSignedInUser(),i=De(l),c=Ft(e,ne,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 u=e.entityAutoCompleteState.autoCompleteText.common,o=Ze(e,"common"),s=e.tenantState.currentTenantId,n=Z(e),d=n?.companyName??"",p={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},m=e.billListState.downloadUIState.downloadState,h=c.fetchState,g=Ea(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:h,analytics:D,botEmail:c.billPayBotEmail,searchText:c.searchText,filters:c.filters,vendorSearchAutoCompleteData:{autoCompleteText:u,entityAutoCompleteView:o},downloadParams:{authParams:p,companyName:d,timePeriod:ne,spendManagementEndPoint:`${We}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:m,isBulkActionAllowed:c.billListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:c.billListBulkActionInfo?.billsSelectedForBulkAction,allowedBulkActions:c.billListBulkActionInfo?.allowedBulkActions,isZeniUser:i,billPayApprovalRulesAffectedEntityIds:g.affectedEntityIds}},function(e,t){const{navigate:l,currentTenant:i,location:c,period:r}=t,{tenantEmailDomain:u}=i;return{updateTabToState:o=>{e(ue()),e(Tt(o))},onSubtabChange:o=>{e(ue()),e(Pt(o))},onTransactionClick:(o,s)=>{const n=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);l(n,{state:{pathnameStackToGoBack:d}})},onClickSetupIcon:()=>{const o=Ti(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);l(o,{state:{pathnameStackToGoBack:s}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;D?.trackBillPayNewBill();const s=`/${o}/bill/new`,n=E(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(s,{state:{pathnameStackToGoBack:n}})},onSearchTextChanged:o=>{e($a(o))},onReloadTransactions:()=>{e($e(r,!0,t.isShowDeletedBillsEnabled,t.isInternationalWireEnabled)),e(Va(i.companyId,!0))},onNavigateToSettings:()=>{l("../bills/setup")},onBackClick:()=>{l("../",{relative:"path"})},onFiltersChange:o=>{e(Ma({filters:o})),o.categories.every(s=>s.field!=null&&s.values?.length!==0)&&D.trackSpendManagmentFilterChange("bill_pay",o.categories.map(s=>`${s.field}-${JSON.stringify(s.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&D.trackSpendManagementDownloadClick("bill_pay"),e(Ra({uiState:{downloadState:o}}))},updateBulkActionList:o=>{e(Fa(o))},removeAllTransactionsFromBulkActionList:()=>{e(ue())},onProceedForBulkActionClick:(o,s)=>{switch(o){case"delete":case"cancel":e(Pa(o,s??""));break;case"send_for_approval":e(nt("send_for_approval")),t.navigate("./bulk-review");break;case"approve":e(nt("approve")),t.navigate("./bulk-review");break;case"review":e(Ta()),t.navigate("./bulk-review")}},onBillPayApprovalRulesEventReceived:o=>{o.endsWith(Le)&&e(ja(!1))},onEventReceived:o=>{o===Qt&&e(Da())},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(He({searchString:o,entityType:"vendor",searchOrigin:"common"})):o.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}}}})(Zn(Hn));function ji(){const e=K(),t=se(),l=X(),i=we(),c=l.state,r=Ie(),[u,o]=f.useState(!1),[s,n]=f.useState(null),d=na("/:tenantEmailDomain/bills/bulk-review")!=null;f.useEffect(()=>(c?.tab!=null&&c?.subTab!=null&&(t(Tt(c?.tab)),t(Pt(c?.subTab))),()=>{t(ue())}),[]);const p=M.getSignedInUser(),m=v(P=>Z(P)),{areTenantIdsInSync:h}=zn(),[g,b]=f.useState(!1),{useFeatureGate:k}=le(),{isFeatureEnabled:j}=k(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:x}=k(y.isBillPayCommentingEnabled),{isFeatureEnabled:B}=k(y.isReimbursementCommentingEnabled),{isFeatureEnabled:_}=k(y.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:T}=k(y.isBillPayBulkActionEnabled),{isFeatureEnabled:U}=k(y.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:V}=k(y.isBillPayDetectInsufficientFundsEnabled),I=v(P=>Ft(P,ne,T,p?.userId)),{isFeatureEnabled:H}=k(y.isDebitCardFeatureEnabled),G=I.fetchState,{isAiCfoAccessEnabled:C,onAskAiCfoClick:q}=Ye({mobileExploreReferrer:"Bills List"});Qe({isDataReady:G==="Completed"});const W=!!m.companyBillPayInfo?.info?.isBillPayTOSAccepted,$=!!m.companyBillPayInfo?.info?.isBillPayEnabled,J=v(P=>va(P.companyState,m.companyId)),Q=J?.company.featuresActivationInfo.connectedAccountProvider;if(f.useEffect(()=>{!g&&$&&h&&(b(!0),t($e(ne,!0,j,U)))},[g,ne,h,t]),p==null)throw Error("Can't access address page without signing in...");const O=(P,de)=>{t(Ca({uiState:{sortKey:P,sortOrder:de},period:ne}))},ee=Rt(r?.loggedInUserRoleMap),F=pe(r?.loggedInUserRoleMap),ce=P=>{o(P)},{billsProcessed:N,billsProcessing:xe}=v(P=>Ia(P));f.useEffect(()=>{N===xe&&s!=null&&(t(wa({messageSection:"bill_pay_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_bill_",variableValue:N>1?ht.bills:ht.bill},{variableName:"_has_",variableValue:N>1?bt.texts.have:bt.texts.has},{variableName:"_action_",variableValue:xa(s)}]})),t(Ba()),setTimeout(()=>{t($e(ne,!0,j,!0,U))},3e3),n(null))},[N,xe]);const ea={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${Qt}`,`private-encrypted-${m.companyId}.${Le}`]:[],eventCallback:(P,de,et)=>{P.endsWith(Le)?et.onBillPayApprovalRulesEventReceived?.(P):de?.entity_type==="bill"&&(n(de.operation_type),et.onEventReceived(P))}},ta=Mt(H,m),aa=Vt(m);return l.pathname.endsWith("/bills/")||l.pathname.endsWith("/bills")||l.pathname.endsWith("/bills/bulk-review")?ta===!0||aa===!0?a.jsx(Xt,{}):$?a.jsxs(a.Fragment,{children:[G==="Completed"?a.jsx(je,{analytics:D,onLoad:P=>(de=>de.trackPageLoaded(Wt.Event.billPayHome))(P)}):null,a.jsxs(Ei,{windowSize:i,children:[a.jsx(Kt,{isAppContentDrawerOpen:u,handleDrawerToggle:ce}),a.jsx(ui,{isOpen:d,drawerLeftMargin:new Zt(0,0,300,600),onClose:()=>{e("./"),t(ue())},children:a.jsx(Pi,{onClick:P=>P.stopPropagation(),children:a.jsx(Ci,{})})}),a.jsx(Di,{location:l,navigate:e,currentTenant:m,entity:"bill_pay",isBillPayCommentingEnabled:x,isReimbursementCommentingEnabled:B,period:ne,isAdmin:!1,uiState:I.uiState,onColumnSortConfigChanged:O,isUserHasOnlyBillpayAccess:ee,isShowDeletedBillsEnabled:j,isShowDeletedReimbursementEnabled:_,isBulkActionEnabled:T,roleMap:r?.loggedInUserRoleMap,onClickMenuIcon:()=>{ce(!0)},isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:Q,bulkSubmissionLimit:I.billBulkSubmissionLimit,bulkSubmissionFetchState:I.billListBulkActionInfo.bulkSubmissionFetchState,isRecurringBillInBulkActionList:I.billListBulkActionInfo.isRecurringBillInBulkActionList,isInternationalWireEnabled:U,isDetectInsufficientFundsEnabled:V,isAiCfoAccessEnabled:C,onAskAiCfoClick:q,...ea})]})]}):W===!0&&F===!0?a.jsx(te,{to:"../setup"}):r!=null&&ze(m,r.loggedInUserRoleMap)?a.jsx(te,{to:"../promo"}):a.jsx(re,{fetchState:G}):a.jsx(Ee,{})}const Ti=e=>`/${e}/bills/setup`,Pi=L(si)`
89
89
  display: flex;
90
90
  min-height: 100%;
91
91
  flex-direction: column;
92
- `,{common:{currency:Se},spendManagement:{billPay:{billDetails:Fi}},appName:Ri}=qe.getLocalizedStrings(),Li=X(function(e,t){const l=L.getSignedInUser(),i=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},r=z(t.location.state?.pathnameStackToGoBack);let u=!0;r.poppedPathname?.includes("bills")===!0&&(u=!1);const o=e.entityAutoCompleteState.autoCompleteText.common,s=Ze(e,"common");let n=`${l?.firstName} ${l?.lastName}`;const d=De(l);t.billId!=null&&t.billDetailsView!=null&&(n=`${t.billDetailsView.createdBy?.firstName??Ri} ${t.billDetailsView.createdBy?.lastName??""}`),d||!t.billDetailsView.createdBy?.email?.includes("zeni.ai")||(n="Zeni");const p=t.billDetailsView.editBillInitialDetails?.totalAmount?.amount,m=Ga(t.billDetailsView.paymentDetailsSection?.paymentType?.method),h=t.currentTenant.createTime,g=Mt(),b=t.sameDayAchDisablementConfig.newTenantTenureLimitMonths,k=h.add(b,"month").isAfter(g),j=!!(t.billDetailsView.billStage==="draft"&&m&&p!=null&&p>0)&&!_t(p,t.billDetailsView.approvalRules.allApprovalRules,l),x=Z(e);return{billDetails:t.billDetailsView,isAccountingClassesEnabled:Ct(e),billId:t.billId,createdBy:n,createTime:t.billDetailsView?.createTime,authParams:c,transactionAttachmentEndpoint:`${We}/transaction_attachment`,analytics:D,showBackButton:u,isAdmin:t.isBillPayAdmin,isSuperAdmin:t.isSuperAdmin,connectedAccountProvider:x.company?.featuresActivationInfo.connectedAccountProvider??"",customerSearchAutoCompleteData:{autoCompleteText:o,entityAutoCompleteView:s},showMarkAsPaidInfo:j,isZeniUser:d,isNewUser:k,sameDayAchDisablementConfig:t.sameDayAchDisablementConfig}},function(e,t){const{billId:l,companyId:i,currentTenant:c,location:r,navigate:u,billDetailsView:o}=t,{tenantEmailDomain:s}=c;return{editVendor:n=>{e(it(n));const d=yt(s,n,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},chooseNewVendor:n=>{const d=n??t.billDetailsView.addBillAutoFields.tentativeVendorName;d!=null&&e(Nt(d,!1)),e(Ot({localData:{vendorName:n??t.billDetailsView.addBillAutoFields.tentativeVendorName}})),e(it());const p=yt(s,void 0,l),m=E(r.state?.pathnameStackToGoBack,r.pathname);u(p,{state:{pathnameStackToGoBack:m}})},onInvoiceUpload:n=>{n!=null&&e(Oe(n,t.isVendorRecommendationEnabled))},updateShowAutofill:n=>{e(Ne(n))},onSaveChangesToLocalStore:(n,d,p,m,h)=>{const g=Mi(t.billDetailsView,{...n,paymentDetails:{...n?.paymentDetails,paymentDate:h}},p,d,t.isInternationalPaymentShaVsOurEnabled,m,t.vendor);e(Ka({billDetailLocalData:g,billId:l}))},saveBillDetails:()=>{e(_e("draft",!1,!1,l)),e(oe("common"))},updateBillDetailSaveBillCode:()=>{e(Gt("draft"))},reviewBillDetails:()=>{const n=Vi(s,l),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(n,{state:{pathnameStackToGoBack:d,message:"coming_from_edit_page"}})},discardBillDetailsFromLocalStore:({billId:n})=>{e(ke({billId:n}))},clearBillPayReviewLocalState:()=>e(Ja()),onClickDismiss:()=>{const n=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(n,{state:{pathnameStackToGoBack:d}})},onClickDiscard:()=>{const n=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(n,{state:{pathnameStackToGoBack:d}})},setBillDetailPageMode:n=>{if(n==="edit_bill"){let d=window.location.pathname;d=d.concat("/edit");const p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})}},redirectToACHScreen:n=>{e(fe(!1,n));const d=$i(s,n,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToWireScreen:n=>{e(fe(!1,n));const d=Ui(s,n,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToInternationalScreen:n=>{e(fe(!1,n));const d=qt(s,l,n),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToBillsScreen:()=>{const n=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);e(ke({})),u(n,{state:{pathnameStackToGoBack:d}})},redirectToBillDetailPage:()=>{t.navigate("../")},deleteBill:()=>{l!=null&&e(Dt(l))},onAttachmentClick:(n,d)=>{const p=Te(s,n,d);window.open(`${p}`,"_blank")},onBackClick:()=>{const n=z(t.location.state?.pathnameStackToGoBack),d=n.poppedPathname??ie(s);u(d,{state:{pathnameStackToGoBack:n.newStack}})},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,d)=>{n.trim().length>=2?e(He({searchString:n,entityType:d,searchOrigin:"common"})):n.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}},addVendorContactEmail(n,d){e(qa(n,d,l))},onWiseVerifyClick:()=>{let n="";n=Kn()?"https://sandbox.transferwise.tech":"https://wise.com";const d=`${n}/login`;window.open(d,"_blank")},onVendorSelected:n=>{e(Wa(!0,n,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:(n,d)=>{e(Ha("bill_pay_detail",n,d))},onEstablishConnectionClick:n=>{e(Za(n,i,"bill_pay_detail","bill_pay"))},onUpdatePaymentAccountStatus:(n,d,p)=>{e(za(n,d,"bill_pay","bill_pay_detail",p))},onEstablishConnectionSuccess:()=>{e(Na("bill_pay","bill_pay_detail")),e(Oa({billId:l,withdrawFromAccountId:o.newAddedBillPaymentAccountId,withdrawFromList:o.withdrawFromList}))}}})(Wn);function gt(){const e=K(),t=Q(),l=se(),{billId:i,tenantEmailDomain:c}=ae(),{useFeatureGate:r,useDynamicConfig:u}=le(),{isFeatureEnabled:o,isFeatureGateLoading:s}=r(y.isVendorMagicLinkFeatureEnabled),{isFeatureEnabled:n}=r(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:d}=r(y.isBillPayCommentingEnabled),{isFeatureEnabled:p}=r(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:m}=r(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=r(y.isRecurringBillsFeatureEnabled),{isFeatureEnabled:g}=r(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=r(y.isShaDisabled),{isFeatureEnabled:k}=r(y.isOurDisabled),{isFeatureEnabled:j}=r(y.isBillPayDetectInsufficientFundsEnabled),{configValue:x}=u(Ae.zeniAccountsConfig),B=Ua(x),{configValue:_}=u(Ae.sameDayAchDisablementConfig),T=Ma(_),M=L.getSignedInUser(),V=v(O=>Z(O)),I=v(O=>Ge(O,m,g,i)),H=Jt(V?.companyId,{clearParams:I.fetchState==="Completed"}),{isAiCfoAccessEnabled:G,onAskAiCfoClick:C}=Xe({mobileExploreReferrer:"Bill Details"});Ye({isDataReady:I.fetchState==="Completed"});const q=V.companyId??L.getSignedInUserTenant(c)?.companyId,W=!!V.companyZeniAccountInfo?.info?.isZeniAccountEnabled,$=Ie(),J=$t($?.loggedInUserRoleMap),Y=Ut($?.loggedInUserRoleMap),N=pe($?.loggedInUserRoleMap),ee=wt(V.userRole);if(f.useEffect(()=>{i!=null&&l(xt(i))},[i]),M==null)throw Error("Can't access address page without signing in...");const F=v(O=>_a(O.accountState,O.accountListState,"billPayAccountList")),ce={pathname:"../",search:t.search};return I.isDeleted===!0||I.billStage=="paid"||I.fetchState=="Not-Started"?a.jsx(te,{to:ce}):I.deleteStatus.fetchState==="In-Progress"||s?a.jsx(re,{fetchState:I.deleteStatus.fetchState}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:O=>(xe=>{i!=null&&I.deleteStatus.fetchState!=="Completed"&&xe.trackBillPayEditBill(i,I.isRecurring)})(O)}),a.jsx(Li,{initialOpenThreadRequest:H??void 0,location:t,navigate:e,currentTenant:V,billId:i,companyId:q,billDetailsView:I,isMagicLinkEnabled:o,isVendorRecommendationEnabled:m,isLocalCurrencyEnabled:p,uncategorizedAccounts:F,isInternationalPaymentShaVsOurEnabled:n,vendor:I.vendor,isBillPayCommentingEnabled:d,isShaDisabled:b,isOurDisabled:k,isRecurringBillsFeatureEnabled:h,isAccountsEnabled:W,hasZeniAccountsAdminAccess:J,isZeniAccountsUser:Y,isBillPayAdmin:N,isSuperAdmin:ee,accountsPromoConfig:B,isDetectInsufficientFundsEnabled:j,sameDayAchDisablementConfig:T,isAiCfoAccessEnabled:G,onAskAiCfoClick:C})]})}const yt=(e,t,l)=>{let i=`/${e}/bill/`;return l==null?i=t!=null?i.concat(`new/vendor/${encodeURIComponent(t)}/edit`):i.concat("new/vendor/create"):(i=i.concat(`${encodeURIComponent(l)}/edit/vendor/`),i=t!=null?i.concat(`${encodeURIComponent(t)}/edit`):i.concat("create")),i},Vi=(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 i=`/${e}/bill/`;return i=l!=null?i.concat(`${encodeURIComponent(l)}/edit/`):i.concat("new/"),i=i.concat(`vendor/${encodeURIComponent(t)}/edit/ach`),i},Ui=(e,t,l)=>{let i=`/${e}/bill/`;return i=l!=null?i.concat(`${encodeURIComponent(l)}/edit/`):i.concat("new/"),i=i.concat(`vendor/${encodeURIComponent(t)}/edit/domestic`),i},R="paymentDetails",Mi=(e,t,l,i,c,r,u)=>{const o={invoiceNumber:t.whatFor.invoiceNumber,memo:t.whatFor.memo,invoiceDate:t.whatFor.invoiceDate?be(t.whatFor.invoiceDate.toString()):Mt(),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(Qa)&&u?.vendorCurrencyCode===Se.currencyCode&&c?t[R]?.internationalTransferFeeBearerPaymentMethod:void 0,conversionRate:e.paymentDetailsSection?.conversionRate},n=r?.type==="Contact"?r?.email:void 0,d=!!n,p=t[R]?.recurringPaymentType?.selectedOption===Fi.recurringBill.paymentTypeOptions[1],m={isActive:e.recurringConfig?.isActive??!1,currentInstance:e.recurringConfig?.currentInstance,isApprovalRequired:t[R]?.recurringPaymentDetails?.requireApproval?.selectedOption==="all",frequency:Xa(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},h=_i(e.accountList.accounts,e.classList.classes,e.lineDetailSection,t.lineItems,i,l),g=Object.keys(h).length>0?qn(h):e.editBillInitialDetails?.recipientTotalAmount;return{showVendorGptRecommendationText:e.showVendorGptRecommendationText,vendor:u,whatForSection:o,paymentDetailsSection:s,isCancelled:e.isCancelled,totalAmount:g,recipientTotalAmount:g,file:e.file,updatesByLineId:h,toAccountVendorEmail:n,isCollectToAccountInfoFromVendorContact:d,isRecurring:p,recurringConfig:m}},_i=(e,t,l,i,c,r)=>{const u={};return i.forEach(o=>{let s,n;o.account.selectedOption!=null&&(s=e.find(p=>p.qboId===o.account.selectedOption||p.accountId===o.account.selectedOption)),o.class?.selectedOption!=null&&(n=t.find(p=>p.classId===o.class.selectedOption));const d=Jn(l[o.lineId],o,c,r);u[o.lineId]={...l[o.lineId],...o,platformLineDetailType:l[o.lineId]?.platformLineDetailType??"account_based_expense_line_detail",amount:{amount:o.amount??0,currencyCode:o.currency?.currencyCode??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:n,billable:o.billable?.selectedOption??"not_billable",customer:{id:d?.id??"",name:d?.name??"",qboId:d?.qboId,logo:d?.logo},type:"journal_entry_transaction_line",isCategoryMiscategorized:!1,isClassMiscategorized:!1}}),u},Gi=U.div`
92
+ `,{common:{currency:Se},spendManagement:{billPay:{billDetails:Fi}},appName:Ri}=qe.getLocalizedStrings(),Mi=Y(function(e,t){const l=M.getSignedInUser(),i=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},r=z(t.location.state?.pathnameStackToGoBack);let u=!0;r.poppedPathname?.includes("bills")===!0&&(u=!1);const o=e.entityAutoCompleteState.autoCompleteText.common,s=Ze(e,"common");let n=`${l?.firstName} ${l?.lastName}`;const d=De(l);t.billId!=null&&t.billDetailsView!=null&&(n=`${t.billDetailsView.createdBy?.firstName??Ri} ${t.billDetailsView.createdBy?.lastName??""}`),d||!t.billDetailsView.createdBy?.email?.includes("zeni.ai")||(n="Zeni");const p=t.billDetailsView.editBillInitialDetails?.totalAmount?.amount,m=Ga(t.billDetailsView.paymentDetailsSection?.paymentType?.method),h=t.currentTenant.createTime,g=Ut(),b=t.sameDayAchDisablementConfig.newTenantTenureLimitMonths,k=h.add(b,"month").isAfter(g),j=!!(t.billDetailsView.billStage==="draft"&&m&&p!=null&&p>0)&&!_t(p,t.billDetailsView.approvalRules.allApprovalRules,l),x=Z(e);return{billDetails:t.billDetailsView,isAccountingClassesEnabled:Ct(e),billId:t.billId,createdBy:n,createTime:t.billDetailsView?.createTime,authParams:c,transactionAttachmentEndpoint:`${We}/transaction_attachment`,analytics:D,showBackButton:u,isAdmin:t.isBillPayAdmin,isSuperAdmin:t.isSuperAdmin,connectedAccountProvider:x.company?.featuresActivationInfo.connectedAccountProvider??"",customerSearchAutoCompleteData:{autoCompleteText:o,entityAutoCompleteView:s},showMarkAsPaidInfo:j,isZeniUser:d,isNewUser:k,sameDayAchDisablementConfig:t.sameDayAchDisablementConfig}},function(e,t){const{billId:l,companyId:i,currentTenant:c,location:r,navigate:u,billDetailsView:o}=t,{tenantEmailDomain:s}=c;return{editVendor:n=>{e(it(n));const d=yt(s,n,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},chooseNewVendor:n=>{const d=n??t.billDetailsView.addBillAutoFields.tentativeVendorName;d!=null&&e(Ot(d,!1)),e(Nt({localData:{vendorName:n??t.billDetailsView.addBillAutoFields.tentativeVendorName}})),e(it());const p=yt(s,void 0,l),m=E(r.state?.pathnameStackToGoBack,r.pathname);u(p,{state:{pathnameStackToGoBack:m}})},onInvoiceUpload:n=>{n!=null&&e(Ne(n,t.isVendorRecommendationEnabled))},updateShowAutofill:n=>{e(Oe(n))},onSaveChangesToLocalStore:(n,d,p,m,h)=>{const g=Ui(t.billDetailsView,{...n,paymentDetails:{...n?.paymentDetails,paymentDate:h}},p,d,t.isInternationalPaymentShaVsOurEnabled,m,t.vendor);e(Ka({billDetailLocalData:g,billId:l}))},saveBillDetails:()=>{e(_e("draft",!1,!1,l)),e(oe("common"))},updateBillDetailSaveBillCode:()=>{e(Gt("draft"))},reviewBillDetails:()=>{const n=Vi(s,l),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(n,{state:{pathnameStackToGoBack:d,message:"coming_from_edit_page"}})},discardBillDetailsFromLocalStore:({billId:n})=>{e(ke({billId:n}))},clearBillPayReviewLocalState:()=>e(Ja()),onClickDismiss:()=>{const n=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(n,{state:{pathnameStackToGoBack:d}})},onClickDiscard:()=>{const n=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(n,{state:{pathnameStackToGoBack:d}})},setBillDetailPageMode:n=>{if(n==="edit_bill"){let d=window.location.pathname;d=d.concat("/edit");const p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})}},redirectToACHScreen:n=>{e(fe(!1,n));const d=$i(s,n,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToWireScreen:n=>{e(fe(!1,n));const d=Li(s,n,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToInternationalScreen:n=>{e(fe(!1,n));const d=qt(s,l,n),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToBillsScreen:()=>{const n=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);e(ke({})),u(n,{state:{pathnameStackToGoBack:d}})},redirectToBillDetailPage:()=>{t.navigate("../")},deleteBill:()=>{l!=null&&e(Dt(l))},onAttachmentClick:(n,d)=>{const p=Te(s,n,d);window.open(`${p}`,"_blank")},onBackClick:()=>{const n=z(t.location.state?.pathnameStackToGoBack),d=n.poppedPathname??ie(s);u(d,{state:{pathnameStackToGoBack:n.newStack}})},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,d)=>{n.trim().length>=2?e(He({searchString:n,entityType:d,searchOrigin:"common"})):n.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}},addVendorContactEmail(n,d){e(qa(n,d,l))},onWiseVerifyClick:()=>{let n="";n=Kn()?"https://sandbox.transferwise.tech":"https://wise.com";const d=`${n}/login`;window.open(d,"_blank")},onVendorSelected:n=>{e(Wa(!0,n,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:(n,d)=>{e(Ha("bill_pay_detail",n,d))},onEstablishConnectionClick:n=>{e(Za(n,i,"bill_pay_detail","bill_pay"))},onUpdatePaymentAccountStatus:(n,d,p)=>{e(za(n,d,"bill_pay","bill_pay_detail",p))},onEstablishConnectionSuccess:()=>{e(Oa("bill_pay","bill_pay_detail")),e(Na({billId:l,withdrawFromAccountId:o.newAddedBillPaymentAccountId,withdrawFromList:o.withdrawFromList}))}}})(Wn);function gt(){const e=K(),t=X(),l=se(),{billId:i,tenantEmailDomain:c}=ae(),{useFeatureGate:r,useDynamicConfig:u}=le(),{isFeatureEnabled:o,isFeatureGateLoading:s}=r(y.isVendorMagicLinkFeatureEnabled),{isFeatureEnabled:n}=r(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:d}=r(y.isBillPayCommentingEnabled),{isFeatureEnabled:p}=r(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:m}=r(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=r(y.isRecurringBillsFeatureEnabled),{isFeatureEnabled:g}=r(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=r(y.isShaDisabled),{isFeatureEnabled:k}=r(y.isOurDisabled),{isFeatureEnabled:j}=r(y.isBillPayDetectInsufficientFundsEnabled),{configValue:x}=u(Ae.zeniAccountsConfig),B=La(x),{configValue:_}=u(Ae.sameDayAchDisablementConfig),T=Ua(_),U=M.getSignedInUser(),V=v(N=>Z(N)),I=v(N=>Ge(N,m,g,i)),H=Jt(V?.companyId,{clearParams:I.fetchState==="Completed"}),{isAiCfoAccessEnabled:G,onAskAiCfoClick:C}=Ye({mobileExploreReferrer:"Bill Details"});Qe({isDataReady:I.fetchState==="Completed"});const q=V.companyId??M.getSignedInUserTenant(c)?.companyId,W=!!V.companyZeniAccountInfo?.info?.isZeniAccountEnabled,$=Ie(),J=$t($?.loggedInUserRoleMap),Q=Lt($?.loggedInUserRoleMap),O=pe($?.loggedInUserRoleMap),ee=wt(V.userRole);if(f.useEffect(()=>{i!=null&&l(xt(i))},[i]),U==null)throw Error("Can't access address page without signing in...");const F=v(N=>_a(N.accountState,N.accountListState,"billPayAccountList")),ce={pathname:"../",search:t.search};return I.isDeleted===!0||I.billStage=="paid"||I.fetchState=="Not-Started"?a.jsx(te,{to:ce}):I.deleteStatus.fetchState==="In-Progress"||s?a.jsx(re,{fetchState:I.deleteStatus.fetchState}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:N=>(xe=>{i!=null&&I.deleteStatus.fetchState!=="Completed"&&xe.trackBillPayEditBill(i,I.isRecurring)})(N)}),a.jsx(Mi,{initialOpenThreadRequest:H??void 0,location:t,navigate:e,currentTenant:V,billId:i,companyId:q,billDetailsView:I,isMagicLinkEnabled:o,isVendorRecommendationEnabled:m,isLocalCurrencyEnabled:p,uncategorizedAccounts:F,isInternationalPaymentShaVsOurEnabled:n,vendor:I.vendor,isBillPayCommentingEnabled:d,isShaDisabled:b,isOurDisabled:k,isRecurringBillsFeatureEnabled:h,isAccountsEnabled:W,hasZeniAccountsAdminAccess:J,isZeniAccountsUser:Q,isBillPayAdmin:O,isSuperAdmin:ee,accountsPromoConfig:B,isDetectInsufficientFundsEnabled:j,sameDayAchDisablementConfig:T,isAiCfoAccessEnabled:G,onAskAiCfoClick:C})]})}const yt=(e,t,l)=>{let i=`/${e}/bill/`;return l==null?i=t!=null?i.concat(`new/vendor/${encodeURIComponent(t)}/edit`):i.concat("new/vendor/create"):(i=i.concat(`${encodeURIComponent(l)}/edit/vendor/`),i=t!=null?i.concat(`${encodeURIComponent(t)}/edit`):i.concat("create")),i},Vi=(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 i=`/${e}/bill/`;return i=l!=null?i.concat(`${encodeURIComponent(l)}/edit/`):i.concat("new/"),i=i.concat(`vendor/${encodeURIComponent(t)}/edit/ach`),i},Li=(e,t,l)=>{let i=`/${e}/bill/`;return i=l!=null?i.concat(`${encodeURIComponent(l)}/edit/`):i.concat("new/"),i=i.concat(`vendor/${encodeURIComponent(t)}/edit/domestic`),i},R="paymentDetails",Ui=(e,t,l,i,c,r,u)=>{const o={invoiceNumber:t.whatFor.invoiceNumber,memo:t.whatFor.memo,invoiceDate:t.whatFor.invoiceDate?be(t.whatFor.invoiceDate.toString()):Ut(),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(Xa)&&u?.vendorCurrencyCode===Se.currencyCode&&c?t[R]?.internationalTransferFeeBearerPaymentMethod:void 0,conversionRate:e.paymentDetailsSection?.conversionRate},n=r?.type==="Contact"?r?.email:void 0,d=!!n,p=t[R]?.recurringPaymentType?.selectedOption===Fi.recurringBill.paymentTypeOptions[1],m={isActive:e.recurringConfig?.isActive??!1,currentInstance:e.recurringConfig?.currentInstance,isApprovalRequired:t[R]?.recurringPaymentDetails?.requireApproval?.selectedOption==="all",frequency:Ya(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},h=_i(e.accountList.accounts,e.classList.classes,e.lineDetailSection,t.lineItems,i,l),g=Object.keys(h).length>0?qn(h):e.editBillInitialDetails?.recipientTotalAmount;return{showVendorGptRecommendationText:e.showVendorGptRecommendationText,vendor:u,whatForSection:o,paymentDetailsSection:s,isCancelled:e.isCancelled,totalAmount:g,recipientTotalAmount:g,file:e.file,updatesByLineId:h,toAccountVendorEmail:n,isCollectToAccountInfoFromVendorContact:d,isRecurring:p,recurringConfig:m}},_i=(e,t,l,i,c,r)=>{const u={};return i.forEach(o=>{let s,n;o.account.selectedOption!=null&&(s=e.find(p=>p.qboId===o.account.selectedOption||p.accountId===o.account.selectedOption)),o.class?.selectedOption!=null&&(n=t.find(p=>p.classId===o.class.selectedOption));const d=Jn(l[o.lineId],o,c,r);u[o.lineId]={...l[o.lineId],...o,platformLineDetailType:l[o.lineId]?.platformLineDetailType??"account_based_expense_line_detail",amount:{amount:o.amount??0,currencyCode:o.currency?.currencyCode??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:n,billable:o.billable?.selectedOption??"not_billable",customer:{id:d?.id??"",name:d?.name??"",qboId:d?.qboId,logo:d?.logo},type:"journal_entry_transaction_line",isCategoryMiscategorized:!1,isClassMiscategorized:!1}}),u},Gi=L.div`
93
93
  display: flex;
94
94
  height: 100vh;
95
95
  width: 100%;
@@ -98,7 +98,7 @@ import{j as a}from"./liveblocks-CqGMBzbB.js";import{j as K,h as se,u as Q,l as a
98
98
  align-items: center;
99
99
  background-color: ${e=>e.theme.colors.grey4};
100
100
  box-shadow: ${e=>`0px 2px ${A.sp1} ${e.theme.colors.dropShadowNormal}`};
101
- `,Ni=X(function(e,t){const{vendorId:l,billId:i}=t,c=ve(e,l),r=Ge(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,i);return{billId:i,isDisabled:c.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:c,file:r.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{billId:l,navigate:i,location:c,vendorId:r,currentTenant:u}=t,{tenantEmailDomain:o}=u;return{onFetchBankNameBySwift:s=>{e(an(s))},onSaveHandler:()=>{e(tn(t.bankAccountContext,r))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:n}=s;e(en({data:n}))},onCancel:()=>{(()=>{const s=z(c.state?.pathnameStackToGoBack),n=s.poppedPathname??St();i(n,{state:{pathnameStackToGoBack:s.newStack}})})(),e(ot())},onAddressClick:s=>{const n=Qe(o,s,l),d=E(c.state?.pathnameStackToGoBack,c.pathname);i(n,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(Ya({fetchState:"Not-Started"}));const s=z(t.location.state?.pathnameStackToGoBack),n=s.poppedPathname??St(0);t.navigate(n,{state:{pathnameStackToGoBack:s.newStack}}),e(ot())}}})(Qn);function Oi(){const e=K(),t=Q(),l=we(),{vendorId:i,billId:c}=ae(),{useFeatureGate:r}=le(),u=me(),o=L.getSignedInUser(),s=v(g=>Z(g)),n=z(t.state?.pathnameStackToGoBack),d=n.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail",p=v(g=>ve(g,i)),{isFeatureEnabled:m}=r(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=r(y.isDepositAccountsFeatureEnabled);if(o==null)throw Error("Can't access address page without signing in...");return d==="billDetail"&&p.editVendorState?.saveStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:p.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:u.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${u.colors.dropShadowNormal}`}}):a.jsxs(Gi,{windowSize:l,children:[a.jsx(Ke,{vendorId:i,billId:c}),a.jsx(Ni,{location:t,navigate:e,billId:c,vendorId:i,currentTenant:s,bankAccountContext:d,isVendorRecommendationEnabled:m,isZeniAccountsFeatureEnabled:h})]})}const St=(e=2)=>{let t="../";for(let l=0;l<e;l++)t=`${t}../`;return t},zi=U.div`
101
+ `,Oi=Y(function(e,t){const{vendorId:l,billId:i}=t,c=ve(e,l),r=Ge(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,i);return{billId:i,isDisabled:c.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:c,file:r.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{billId:l,navigate:i,location:c,vendorId:r,currentTenant:u}=t,{tenantEmailDomain:o}=u;return{onFetchBankNameBySwift:s=>{e(an(s))},onSaveHandler:()=>{e(tn(t.bankAccountContext,r))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:n}=s;e(en({data:n}))},onCancel:()=>{(()=>{const s=z(c.state?.pathnameStackToGoBack),n=s.poppedPathname??St();i(n,{state:{pathnameStackToGoBack:s.newStack}})})(),e(ot())},onAddressClick:s=>{const n=Xe(o,s,l),d=E(c.state?.pathnameStackToGoBack,c.pathname);i(n,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(Qa({fetchState:"Not-Started"}));const s=z(t.location.state?.pathnameStackToGoBack),n=s.poppedPathname??St(0);t.navigate(n,{state:{pathnameStackToGoBack:s.newStack}}),e(ot())}}})(Xn);function Ni(){const e=K(),t=X(),l=we(),{vendorId:i,billId:c}=ae(),{useFeatureGate:r}=le(),u=me(),o=M.getSignedInUser(),s=v(g=>Z(g)),n=z(t.state?.pathnameStackToGoBack),d=n.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail",p=v(g=>ve(g,i)),{isFeatureEnabled:m}=r(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=r(y.isDepositAccountsFeatureEnabled);if(o==null)throw Error("Can't access address page without signing in...");return d==="billDetail"&&p.editVendorState?.saveStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:p.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:u.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${u.colors.dropShadowNormal}`}}):a.jsxs(Gi,{windowSize:l,children:[a.jsx(Ke,{vendorId:i,billId:c}),a.jsx(Oi,{location:t,navigate:e,billId:c,vendorId:i,currentTenant:s,bankAccountContext:d,isVendorRecommendationEnabled:m,isZeniAccountsFeatureEnabled:h})]})}const St=(e=2)=>{let t="../";for(let l=0;l<e;l++)t=`${t}../`;return t},zi=L.div`
102
102
  display: flex;
103
103
  height: 100vh;
104
104
  width: 100%;
@@ -107,7 +107,7 @@ import{j as a}from"./liveblocks-CqGMBzbB.js";import{j as K,h as se,u as Q,l as a
107
107
  align-items: center;
108
108
  background-color: ${e=>e.theme.colors.grey4};
109
109
  box-shadow: ${e=>`0px 2px ${A.sp1} ${e.theme.colors.dropShadowNormal}`};
110
- `,Zi=X(function(e,t){const{vendorId:l}=t,i=ve(e,l),c=l!=null?i.editVendorState?.vendorDetailLocalData?.vendorType:i.newVendorState?.vendorDetailLocalData?.vendorType,r=on(e,c||"international_business",t.billId),u=i.editVendorState??i.newVendorState,o=t.billId!=null?e.editBillDetailViewState.editBillStateById[ln(t.billId)].billDetailLocalData.recipientTotalAmount?.amount:e.editBillDetailViewState.newBillState.billDetailLocalData.recipientTotalAmount?.amount;return{internationalWireView:r,vendorViewDetails:i,bankAccountContext:t.bankAccountContext,vendorType:c||"international_business",addressType:"vendor_address",addressToEdit:u?.vendorNewAddressStatus?.addressToCreate,mailingAddress:u?.vendorAddress,billAmount:o??0}},function(e,t){const{billId:l,navigate:i,location:c,vendorId:r,currentTenant:u}=t,{tenantEmailDomain:o}=u;return{onSaveHandler:()=>{e(un(t.bankAccountContext,r))},onAccountDetailsUpdated:(s,n,d,p)=>{e(cn(s)),p&&e(dn(n,d))},onCurrencyUpdated:(s,n,d)=>{e(rn(s,n,d,!1))},onCancel:()=>{(()=>{const s=z(c.state?.pathnameStackToGoBack),n=s.poppedPathname??ft();i(n,{state:{pathnameStackToGoBack:s.newStack}})})(),e(lt())},onAddressClick:s=>{const n=Qe(o,s,l),d=E(c.state?.pathnameStackToGoBack,c.pathname);i(n,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(sn({fetchState:"Not-Started"}));const s=z(t.location.state?.pathnameStackToGoBack),n=s.poppedPathname??ft(0);t.navigate(n,{state:{pathnameStackToGoBack:s.newStack}}),e(lt())}}})(Xn);function Hi(){const e=K(),t=Q(),l=we(),{vendorId:i,billId:c}=ae(),r=se(),u=me(),o=L.getSignedInUser(),s=v(B=>Z(B)),n=z(t.state?.pathnameStackToGoBack),[d,p]=f.useState(!1),m=v(B=>B.vendorViewState.newVendorState.fetchStatus.fetchState),h=v(B=>i!=null?B.vendorViewState.editVendorStateById[i]?.fetchStatus.fetchState??"Not-Started":"Not-Started"),g=i!==void 0?h:m;f.useEffect(()=>{d===!1&&g==="Not-Started"&&i!=null&&(r(fe(!1,i)),p(!0))},[d,g,i]);const[b,k]=f.useState(!1);f.useEffect(()=>{b||g==="In-Progress"||(k(!0),r(nn(c,i)))},[b,g,r]);const j=n.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail",x=v(B=>ve(B,i));if(o==null)throw Error("Can't access international wire page without signing in...");return j==="billDetail"&&x.editVendorState?.saveStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:x.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:u.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${u.colors.dropShadowNormal}`}}):a.jsxs(zi,{windowSize:l,children:[a.jsx(Ke,{vendorId:i,billId:c}),a.jsx(Zi,{location:t,navigate:e,billId:c,vendorId:i,currentTenant:s,bankAccountContext:j})]})}const ft=(e=2)=>{let t="../";for(let l=0;l<e;l++)t=`${t}../`;return t},kt=U.div`
110
+ `,Zi=Y(function(e,t){const{vendorId:l}=t,i=ve(e,l),c=l!=null?i.editVendorState?.vendorDetailLocalData?.vendorType:i.newVendorState?.vendorDetailLocalData?.vendorType,r=on(e,c||"international_business",t.billId),u=i.editVendorState??i.newVendorState,o=t.billId!=null?e.editBillDetailViewState.editBillStateById[ln(t.billId)].billDetailLocalData.recipientTotalAmount?.amount:e.editBillDetailViewState.newBillState.billDetailLocalData.recipientTotalAmount?.amount;return{internationalWireView:r,vendorViewDetails:i,bankAccountContext:t.bankAccountContext,vendorType:c||"international_business",addressType:"vendor_address",addressToEdit:u?.vendorNewAddressStatus?.addressToCreate,mailingAddress:u?.vendorAddress,billAmount:o??0}},function(e,t){const{billId:l,navigate:i,location:c,vendorId:r,currentTenant:u}=t,{tenantEmailDomain:o}=u;return{onSaveHandler:()=>{e(un(t.bankAccountContext,r))},onAccountDetailsUpdated:(s,n,d,p)=>{e(cn(s)),p&&e(dn(n,d))},onCurrencyUpdated:(s,n,d)=>{e(rn(s,n,d,!1))},onCancel:()=>{(()=>{const s=z(c.state?.pathnameStackToGoBack),n=s.poppedPathname??ft();i(n,{state:{pathnameStackToGoBack:s.newStack}})})(),e(lt())},onAddressClick:s=>{const n=Xe(o,s,l),d=E(c.state?.pathnameStackToGoBack,c.pathname);i(n,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(sn({fetchState:"Not-Started"}));const s=z(t.location.state?.pathnameStackToGoBack),n=s.poppedPathname??ft(0);t.navigate(n,{state:{pathnameStackToGoBack:s.newStack}}),e(lt())}}})(Yn);function Hi(){const e=K(),t=X(),l=we(),{vendorId:i,billId:c}=ae(),r=se(),u=me(),o=M.getSignedInUser(),s=v(B=>Z(B)),n=z(t.state?.pathnameStackToGoBack),[d,p]=f.useState(!1),m=v(B=>B.vendorViewState.newVendorState.fetchStatus.fetchState),h=v(B=>i!=null?B.vendorViewState.editVendorStateById[i]?.fetchStatus.fetchState??"Not-Started":"Not-Started"),g=i!==void 0?h:m;f.useEffect(()=>{d===!1&&g==="Not-Started"&&i!=null&&(r(fe(!1,i)),p(!0))},[d,g,i]);const[b,k]=f.useState(!1);f.useEffect(()=>{b||g==="In-Progress"||(k(!0),r(nn(c,i)))},[b,g,r]);const j=n.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail",x=v(B=>ve(B,i));if(o==null)throw Error("Can't access international wire page without signing in...");return j==="billDetail"&&x.editVendorState?.saveStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:x.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:u.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${u.colors.dropShadowNormal}`}}):a.jsxs(zi,{windowSize:l,children:[a.jsx(Ke,{vendorId:i,billId:c}),a.jsx(Zi,{location:t,navigate:e,billId:c,vendorId:i,currentTenant:s,bankAccountContext:j})]})}const ft=(e=2)=>{let t="../";for(let l=0;l<e;l++)t=`${t}../`;return t},kt=L.div`
111
111
  display: flex;
112
112
  height: 100vh;
113
113
  width: 100%;
@@ -116,4 +116,4 @@ import{j as a}from"./liveblocks-CqGMBzbB.js";import{j as K,h as se,u as Q,l as a
116
116
  align-items: center;
117
117
  background-color: ${e=>e.theme.colors.grey4};
118
118
  box-shadow: ${e=>`0px 2px ${A.sp1} ${e.theme.colors.dropShadowNormal}`};
119
- `,Wi=X(function(e,t){const l=L.getSignedInUser(),i=zt(e,t.billId),c=mn(e),r=De(l),u=i.totalAmount.amount,o=i.billPayInfo?.stage.code!=="scheduled"&&c.allApprovalRules.length>0&&!_t(u,c.allApprovalRules,l);return{billDetails:i,billId:t.billId,billpayApprovalView:c,analytics:D,isApprovalRequiredForMarkAsPaid:o,isZeniUser:r}},function(e,t){const{location:l,billId:i,currentTenant:c,navigate:r}=t,{tenantEmailDomain:u}=c;return{redirectToBillsScreen:()=>{const o=ie(c.tenantEmailDomain),s=E(l.state?.pathnameStackToGoBack,l.pathname);r(o,{state:{pathnameStackToGoBack:s}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},saveBillDetails:(o,s)=>{o&&e(Et({billId:i,data:s})),e(_e(o?"paid":"pending_approval",o,!1,i))},discardOutsideZeniPaymentData:()=>{e(At({billId:i}))},updateBillDetailSaveBillCode:()=>{e(Gt("pending_approval"))},onClickEdit:()=>{t.navigate("../",{relative:"path"})},onAttachmentClick:(o,s)=>{const n=Te(u,o,s);window.open(`${n}`,"_blank")},retryPayment:()=>{t.billId!=null&&e(Ce(t.billId,"retry"))}}})(ei);function vt(){const e=K(),t=se(),l=Q(),{billId:i}=ae(),{useFeatureGate:c}=le(),{isFeatureEnabled:r}=c(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:u}=c(y.isBillPayDetectInsufficientFundsEnabled),o=we(),s=L.getSignedInUser(),{isFeatureEnabled:n}=c(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:d}=c(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:p}=c(y.isBillPayCommentingEnabled),m=z(l.state?.pathnameStackToGoBack),{poppedPathname:h}=m,{isFeatureEnabled:g}=c(y.isRecurringBillsFeatureEnabled),b=v(x=>Z(x)),k=v(x=>zt(x,i)),j=k.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(`../${i}`)},[]),f.useEffect(()=>{const x=k.vendor?.name,B=k.vendor?.id,_=k.totalAmount.amount,T=k.recipientTotalAmount.amount,M=k.invoiceNumber;x&&B&&t(pn(x,B,_,T,M,i))},[]),h==null)return a.jsx(te,{to:`../${i}`});if(s==null)throw Error("Can't access address page without signing in...");return j==="In-Progress"?a.jsx(kt,{windowSize:o,children:a.jsx(Yn,{})}):a.jsx(kt,{windowSize:o,children:a.jsx(Wi,{location:l,navigate:e,currentTenant:b,billId:i,isBillPayCommentingEnabled:p,isLocalCurrencyEnabled:n,isVendorRecommendationEnabled:d,isInternationalPaymentShaVsOurEnabled:r,isRecurringBillsFeatureEnabled:g,isDetectInsufficientFundsEnabled:u})})}const qi=X(function(e,t){const{vendorId:l}=t,i=e.entityAutoCompleteState.autoCompleteText.common,c=Ze(e,"common"),r=l!=null?"edit":"create",u=Z(e),o=L.getSignedInUser(),s=u.tenantId,n={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:s??""};return{vendorViewDetails:t.vendorViewDetails,screenType:r,filesEndPoint:`${Ht.fileMicroServiceBaseUrl}`,authParams:n,analytics:D,vendorSearchAutoCompleteData:{autoCompleteText:i,entityAutoCompleteView:c}}},function(e,t){const{billId:l,currentTenant:i,navigate:c,location:r,vendorId:u,themeState:o}=t,{tenantEmailDomain:s}=i;return{onSaveVendor:n=>{e(Cn(u??void 0,t.billId)),n!=null&&e(An(n))},saveVendorDetailLocalData:n=>{e(Ot({vendorId:u,localData:n}))},saveContactsInVendorDetailLocalData:n=>{e(Bn({vendorId:u,contacts:n}))},resetVendorDetailLocalData:()=>{e(st(u))},updateSelectedVendorForCreate:n=>{e(xn(n))},navigateToBankDetailPage:(n,d)=>{let p;n==="wire"?p=d==="international"?qt(s,t.billId,u):di(s,t.billId,u):p=ci(s,t.billId,u);const m=E(r.state?.pathnameStackToGoBack,r.pathname);c(p,{state:{pathnameStackToGoBack:m}})},onRemoveBankAccount:(n,d)=>{e(d===!0?In(n,"vendor",u):wn(n,"vendor",u))},navigateToMailingAddressPage:n=>{const d=Qe(s,n,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);c(d,{state:{pathnameStackToGoBack:p}})},updateFilesEntity:n=>{e(vn({files:n}))},onEditFileName:(n,d)=>{e(kn(n,d.split(".")[0]))},handleZeniLogoClick:()=>{o.toggle()},updateSaveFetchState:()=>{u==null&&e(st(t.vendorViewDetails.newVendorState?.vendorBasic?.id)),e(fn("Not-Started",u))},onVendorSelected:n=>{n!=null&&e(Sn(n,!0))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,d)=>{n.trim().length>=2?e(He({searchString:n,entityType:d,searchOrigin:"common"})):n.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}},onBackClick:()=>{e(oe("common"));const n=z(t.location.state?.pathnameStackToGoBack),d=n.poppedPathname??ri(i.tenantEmailDomain,t.billId);c(d,{state:{pathnameStackToGoBack:n.newStack}})},onGetOtp:n=>{e(yn(n,"BillPayVendor"))},onResendOtp:n=>{e(gn(n,"BillPayVendor"))},onVerifyOtp:(n,d)=>{e(hn(n,d,"BillPayVendor"))},onVerifyOtpSuccess:(n,d,p)=>{e(bn(n,d,p))},onFetchAndUpdateVendorRecommendations:n=>{e(Nt(n,!1))}}})(ii),Be=()=>{const e=K(),t=se(),l=ti(),i=Q(),{billId:c,vendorId:r}=ae(),u=v(b=>Z(b)),{useFeatureGate:o}=le(),{isFeatureEnabled:s}=o(y.isBillPayLocalCurrencyFeatureEnabled),[n,d]=f.useState(!1),p=v(b=>b.vendorViewState.newVendorState.fetchStatus.fetchState),m=v(b=>ve(b,r)),h=v(b=>r!==void 0?b.vendorViewState.editVendorStateById[r]?.fetchStatus??"Not-Started":"Not-Started"),g=r!==void 0?h:p;return f.useEffect(()=>{n===!1&&g==="Not-Started"&&r!=null&&(t(fe(!1,r)),d(!0))},[n,g,r]),m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?a.jsx(ai,{}):g==="Error"?a.jsx(ni,{onGoHome:()=>e("../",{replace:!0}),onReload:()=>window.location.reload()}):a.jsxs(a.Fragment,{children:[a.jsx(Ke,{vendorId:r,billId:c}),a.jsx(qi,{navigate:e,location:i,themeState:l,currentTenant:u,vendorId:r,billId:c,vendorViewDetails:m,isLocalCurrencyEnabled:s})]})},Ji=X(function(e,t){const{companyId:l}=t;return{billPaySetupView:En(e,l),analytics:D,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:i}=t;return{onButtonClick:()=>{e(Dn(l))},onBackClick:()=>{i("../..",{relative:"path"})},onSetupBillPaySuccess:()=>{i("../bills/setup",{relative:"path"})}}})(oi),Ki=()=>{const e=K(),t=Q(),{tenantEmailDomain:l}=ae(),[i,c]=f.useState(!1),r=me(),u=v(h=>Z(h)),o=u.companyId??L.getSignedInUserTenant(l)?.companyId,s=L.getSignedInUser(),n=Ie(),d=!!u.companyBillPayInfo?.info?.isBillPayTOSAccepted,p=pe(n?.loggedInUserRoleMap),m=h=>{c(h)};if(s==null)throw Error("Can't access bill pay promo page without signing in...");return u.companyBillPayInfo?.info?.isBillPayEnabled===!0?a.jsx(te,{to:"../../../bills"}):d===!0&&p===!0?a.jsx(te,{to:"../../bills/setup"}):d===!1||n!=null&&ze(u,n.loggedInUserRoleMap)?a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:h=>(g=>g.trackPageLoaded(Wt.Event.billPayPromoPage))(h)}),a.jsx(Kt,{isAppContentDrawerOpen:i,handleDrawerToggle:m}),a.jsx(Ji,{companyId:o,navigate:e,location:t,onClickMenuIcon:()=>{m(!0)}})]}):a.jsx(re,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function jo(){const e=v(G=>Z(G)),t=Ie(),l=pe(t?.loggedInUserRoleMap),i=me(),{useFeatureGate:c}=le(),{isFeatureEnabled:r}=c(y.isBillPayLocalCurrencyFeatureEnabled),u=r===!0?Hi:Oi,{isFeatureEnabled:o}=c(y.isDebitCardFeatureEnabled),s=Lt(o,e),n=Vt(e),d=Q(),p=e?.userRole!=null&&It(e?.userRole),m=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&pe(t?.loggedInUserRoleMap),h=Rt(t?.loggedInUserRoleMap),g=(e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p)&&jn(t?.loggedInUserRoleMap),{isFeatureEnabled:b}=c(y.isDepositAccountsFeatureEnabled),k=b&&!p&&$t(t?.loggedInUserRoleMap),{isFeatureEnabled:j}=c(y.isChargeCardFeatureEnabled),x=li(e,j,o)&&!p&&Tn(t?.loggedInUserRoleMap),B=Pn(t?.loggedInUserRoleMap),_=Ut(t?.loggedInUserRoleMap),T=Fn(t?.loggedInUserRoleMap),M=Rn(t?.loggedInUserRoleMap),V=Ln(t?.loggedInUserRoleMap),I=Vn(t?.loggedInUserRoleMap),{tenantEmailDomain:H}=ae();return a.jsxs(ia,{children:[d.pathname.includes("/bills")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"setup",element:a.jsx(Pe,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:x,isUserHasOnlyCardAccess:B,productType:"bill_pay",type:"setup"})}),a.jsx(S,{path:"verification",element:a.jsx(Pe,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:x,isUserHasOnlyCardAccess:B,productType:"bill_pay",type:"verification"})}),a.jsx(S,{path:"promo",element:a.jsx(Ki,{})}),a.jsx(S,{path:"approval-rules/*",element:m?a.jsx(pi,{}):a.jsx(mi,{isUserHasZeniAccountsAccess:_,isUserHasChargeCardAccess:M,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:I,isUserHasTreasuryAccess:T,isTenantBankingOnly:s,tenantEmailDomain:H??""})}),a.jsx(S,{path:"international-wire",element:a.jsx(Pe,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:x,isUserHasOnlyCardAccess:B,productType:"bill_pay",type:"international-wire"})}),e.companyBillPayInfo?.info?.isBillPayEnabled===!0&&a.jsx(S,{path:"*",element:a.jsx(ji,{})}),(s===!0||n===!0)&&a.jsx(S,{path:"/*",element:a.jsx(Qt,{})}),e.companyBillPayInfo?.info?.isBillPayTOSAccepted===!0&&l&&a.jsx(S,{path:"*",element:a.jsx(te,{to:"../setup"})}),t!=null&&ze(e,t.loggedInUserRoleMap)&&a.jsx(S,{path:"*",element:a.jsx(te,{to:"../promo"})})]}):d.pathname.includes("/bill")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"new",element:a.jsx(w,{appContent:a.jsx(gt,{})})}),a.jsx(S,{path:":billId",element:a.jsx(w,{appContent:a.jsx(hi,{})})}),a.jsx(S,{path:":billId/edit",element:a.jsx(w,{appContent:a.jsx(gt,{})})}),a.jsx(S,{path:"new/review",element:a.jsx(w,{appContent:a.jsx(vt,{})})}),a.jsx(S,{path:":billId/edit/review",element:a.jsx(w,{appContent:a.jsx(vt,{})})}),a.jsx(S,{path:"/:billId/:addressType",element:a.jsx(w,{appContent:a.jsx(dt,{isSubPage:!0})})}),a.jsx(S,{path:"/new/:addressType",element:a.jsx(w,{appContent:a.jsx(dt,{isSubPage:!0})})}),a.jsx(S,{path:"new/vendor/create",element:a.jsx(w,{appContent:a.jsx(Be,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit",element:a.jsx(w,{appContent:a.jsx(Be,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:"new/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create",element:a.jsx(w,{appContent:a.jsx(Be,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit",element:a.jsx(w,{appContent:a.jsx(Be,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:"*",element:a.jsx(Ee,{})})]}):a.jsx(S,{path:"*",element:a.jsx(re,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${i.colors.dropShadowNormal}`}})}),a.jsx(S,{path:"*",element:a.jsx(Ee,{})})]})}export{jo as default};
119
+ `,Wi=Y(function(e,t){const l=M.getSignedInUser(),i=zt(e,t.billId),c=mn(e),r=De(l),u=i.totalAmount.amount,o=i.billPayInfo?.stage.code!=="scheduled"&&c.allApprovalRules.length>0&&!_t(u,c.allApprovalRules,l);return{billDetails:i,billId:t.billId,billpayApprovalView:c,analytics:D,isApprovalRequiredForMarkAsPaid:o,isZeniUser:r}},function(e,t){const{location:l,billId:i,currentTenant:c,navigate:r}=t,{tenantEmailDomain:u}=c;return{redirectToBillsScreen:()=>{const o=ie(c.tenantEmailDomain),s=E(l.state?.pathnameStackToGoBack,l.pathname);r(o,{state:{pathnameStackToGoBack:s}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},saveBillDetails:(o,s)=>{o&&e(Et({billId:i,data:s})),e(_e(o?"paid":"pending_approval",o,!1,i))},discardOutsideZeniPaymentData:()=>{e(At({billId:i}))},updateBillDetailSaveBillCode:()=>{e(Gt("pending_approval"))},onClickEdit:()=>{t.navigate("../",{relative:"path"})},onAttachmentClick:(o,s)=>{const n=Te(u,o,s);window.open(`${n}`,"_blank")},retryPayment:()=>{t.billId!=null&&e(Ce(t.billId,"retry"))}}})(ei);function vt(){const e=K(),t=se(),l=X(),{billId:i}=ae(),{useFeatureGate:c}=le(),{isFeatureEnabled:r}=c(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:u}=c(y.isBillPayDetectInsufficientFundsEnabled),o=we(),s=M.getSignedInUser(),{isFeatureEnabled:n}=c(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:d}=c(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:p}=c(y.isBillPayCommentingEnabled),m=z(l.state?.pathnameStackToGoBack),{poppedPathname:h}=m,{isFeatureEnabled:g}=c(y.isRecurringBillsFeatureEnabled),b=v(x=>Z(x)),k=v(x=>zt(x,i)),j=k.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(`../${i}`)},[]),f.useEffect(()=>{const x=k.vendor?.name,B=k.vendor?.id,_=k.totalAmount.amount,T=k.recipientTotalAmount.amount,U=k.invoiceNumber;x&&B&&t(pn(x,B,_,T,U,i))},[]),h==null)return a.jsx(te,{to:`../${i}`});if(s==null)throw Error("Can't access address page without signing in...");return j==="In-Progress"?a.jsx(kt,{windowSize:o,children:a.jsx(Qn,{})}):a.jsx(kt,{windowSize:o,children:a.jsx(Wi,{location:l,navigate:e,currentTenant:b,billId:i,isBillPayCommentingEnabled:p,isLocalCurrencyEnabled:n,isVendorRecommendationEnabled:d,isInternationalPaymentShaVsOurEnabled:r,isRecurringBillsFeatureEnabled:g,isDetectInsufficientFundsEnabled:u})})}const qi=Y(function(e,t){const{vendorId:l}=t,i=e.entityAutoCompleteState.autoCompleteText.common,c=Ze(e,"common"),r=l!=null?"edit":"create",u=Z(e),o=M.getSignedInUser(),s=u.tenantId,n={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:s??""};return{vendorViewDetails:t.vendorViewDetails,screenType:r,filesEndPoint:`${Ht.fileMicroServiceBaseUrl}`,authParams:n,analytics:D,vendorSearchAutoCompleteData:{autoCompleteText:i,entityAutoCompleteView:c}}},function(e,t){const{billId:l,currentTenant:i,navigate:c,location:r,vendorId:u,themeState:o}=t,{tenantEmailDomain:s}=i;return{onSaveVendor:n=>{e(Cn(u??void 0,t.billId)),n!=null&&e(An(n))},saveVendorDetailLocalData:n=>{e(Nt({vendorId:u,localData:n}))},saveContactsInVendorDetailLocalData:n=>{e(Bn({vendorId:u,contacts:n}))},resetVendorDetailLocalData:()=>{e(st(u))},updateSelectedVendorForCreate:n=>{e(xn(n))},navigateToBankDetailPage:(n,d)=>{let p;n==="wire"?p=d==="international"?qt(s,t.billId,u):di(s,t.billId,u):p=ci(s,t.billId,u);const m=E(r.state?.pathnameStackToGoBack,r.pathname);c(p,{state:{pathnameStackToGoBack:m}})},onRemoveBankAccount:(n,d)=>{e(d===!0?In(n,"vendor",u):wn(n,"vendor",u))},navigateToMailingAddressPage:n=>{const d=Xe(s,n,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);c(d,{state:{pathnameStackToGoBack:p}})},updateFilesEntity:n=>{e(vn({files:n}))},onEditFileName:(n,d)=>{e(kn(n,d.split(".")[0]))},handleZeniLogoClick:()=>{o.toggle()},updateSaveFetchState:()=>{u==null&&e(st(t.vendorViewDetails.newVendorState?.vendorBasic?.id)),e(fn("Not-Started",u))},onVendorSelected:n=>{n!=null&&e(Sn(n,!0))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,d)=>{n.trim().length>=2?e(He({searchString:n,entityType:d,searchOrigin:"common"})):n.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}},onBackClick:()=>{e(oe("common"));const n=z(t.location.state?.pathnameStackToGoBack),d=n.poppedPathname??ri(i.tenantEmailDomain,t.billId);c(d,{state:{pathnameStackToGoBack:n.newStack}})},onGetOtp:n=>{e(yn(n,"BillPayVendor"))},onResendOtp:n=>{e(gn(n,"BillPayVendor"))},onVerifyOtp:(n,d)=>{e(hn(n,d,"BillPayVendor"))},onVerifyOtpSuccess:(n,d,p)=>{e(bn(n,d,p))},onFetchAndUpdateVendorRecommendations:n=>{e(Ot(n,!1))}}})(ii),Be=()=>{const e=K(),t=se(),l=ti(),i=X(),{billId:c,vendorId:r}=ae(),u=v(b=>Z(b)),{useFeatureGate:o}=le(),{isFeatureEnabled:s}=o(y.isBillPayLocalCurrencyFeatureEnabled),[n,d]=f.useState(!1),p=v(b=>b.vendorViewState.newVendorState.fetchStatus.fetchState),m=v(b=>ve(b,r)),h=v(b=>r!==void 0?b.vendorViewState.editVendorStateById[r]?.fetchStatus??"Not-Started":"Not-Started"),g=r!==void 0?h:p;return f.useEffect(()=>{n===!1&&g==="Not-Started"&&r!=null&&(t(fe(!1,r)),d(!0))},[n,g,r]),m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?a.jsx(ai,{}):g==="Error"?a.jsx(ni,{onGoHome:()=>e("../",{replace:!0}),onReload:()=>window.location.reload()}):a.jsxs(a.Fragment,{children:[a.jsx(Ke,{vendorId:r,billId:c}),a.jsx(qi,{navigate:e,location:i,themeState:l,currentTenant:u,vendorId:r,billId:c,vendorViewDetails:m,isLocalCurrencyEnabled:s})]})},Ji=Y(function(e,t){const{companyId:l}=t;return{billPaySetupView:En(e,l),analytics:D,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:i}=t;return{onButtonClick:()=>{e(Dn(l))},onBackClick:()=>{i("../..",{relative:"path"})},onSetupBillPaySuccess:()=>{i("../bills/setup",{relative:"path"})}}})(oi),Ki=()=>{const e=K(),t=X(),{tenantEmailDomain:l}=ae(),[i,c]=f.useState(!1),r=me(),u=v(h=>Z(h)),o=u.companyId??M.getSignedInUserTenant(l)?.companyId,s=M.getSignedInUser(),n=Ie(),d=!!u.companyBillPayInfo?.info?.isBillPayTOSAccepted,p=pe(n?.loggedInUserRoleMap),m=h=>{c(h)};if(s==null)throw Error("Can't access bill pay promo page without signing in...");return u.companyBillPayInfo?.info?.isBillPayEnabled===!0?a.jsx(te,{to:"../../../bills"}):d===!0&&p===!0?a.jsx(te,{to:"../../bills/setup"}):d===!1||n!=null&&ze(u,n.loggedInUserRoleMap)?a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:h=>(g=>g.trackPageLoaded(Wt.Event.billPayPromoPage))(h)}),a.jsx(Kt,{isAppContentDrawerOpen:i,handleDrawerToggle:m}),a.jsx(Ji,{companyId:o,navigate:e,location:t,onClickMenuIcon:()=>{m(!0)}})]}):a.jsx(re,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function jo(){const e=v(G=>Z(G)),t=Ie(),l=pe(t?.loggedInUserRoleMap),i=me(),{useFeatureGate:c}=le(),{isFeatureEnabled:r}=c(y.isBillPayLocalCurrencyFeatureEnabled),u=r===!0?Hi:Ni,{isFeatureEnabled:o}=c(y.isDebitCardFeatureEnabled),s=Mt(o,e),n=Vt(e),d=X(),p=e?.userRole!=null&&It(e?.userRole),m=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&pe(t?.loggedInUserRoleMap),h=Rt(t?.loggedInUserRoleMap),g=(e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p)&&jn(t?.loggedInUserRoleMap),{isFeatureEnabled:b}=c(y.isDepositAccountsFeatureEnabled),k=b&&!p&&$t(t?.loggedInUserRoleMap),{isFeatureEnabled:j}=c(y.isChargeCardFeatureEnabled),x=li(e,j,o)&&!p&&Tn(t?.loggedInUserRoleMap),B=Pn(t?.loggedInUserRoleMap),_=Lt(t?.loggedInUserRoleMap),T=Fn(t?.loggedInUserRoleMap),U=Rn(t?.loggedInUserRoleMap),V=Mn(t?.loggedInUserRoleMap),I=Vn(t?.loggedInUserRoleMap),{tenantEmailDomain:H}=ae();return a.jsxs(ia,{children:[d.pathname.includes("/bills")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"setup",element:a.jsx(Pe,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:x,isUserHasOnlyCardAccess:B,productType:"bill_pay",type:"setup"})}),a.jsx(S,{path:"verification",element:a.jsx(Pe,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:x,isUserHasOnlyCardAccess:B,productType:"bill_pay",type:"verification"})}),a.jsx(S,{path:"promo",element:a.jsx(Ki,{})}),a.jsx(S,{path:"approval-rules/*",element:m?a.jsx(pi,{}):a.jsx(mi,{isUserHasZeniAccountsAccess:_,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:I,isUserHasTreasuryAccess:T,isTenantBankingOnly:s,tenantEmailDomain:H??""})}),a.jsx(S,{path:"international-wire",element:a.jsx(Pe,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:x,isUserHasOnlyCardAccess:B,productType:"bill_pay",type:"international-wire"})}),e.companyBillPayInfo?.info?.isBillPayEnabled===!0&&a.jsx(S,{path:"*",element:a.jsx(ji,{})}),(s===!0||n===!0)&&a.jsx(S,{path:"/*",element:a.jsx(Xt,{})}),e.companyBillPayInfo?.info?.isBillPayTOSAccepted===!0&&l&&a.jsx(S,{path:"*",element:a.jsx(te,{to:"../setup"})}),t!=null&&ze(e,t.loggedInUserRoleMap)&&a.jsx(S,{path:"*",element:a.jsx(te,{to:"../promo"})})]}):d.pathname.includes("/bill")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"new",element:a.jsx(w,{appContent:a.jsx(gt,{})})}),a.jsx(S,{path:":billId",element:a.jsx(w,{appContent:a.jsx(hi,{})})}),a.jsx(S,{path:":billId/edit",element:a.jsx(w,{appContent:a.jsx(gt,{})})}),a.jsx(S,{path:"new/review",element:a.jsx(w,{appContent:a.jsx(vt,{})})}),a.jsx(S,{path:":billId/edit/review",element:a.jsx(w,{appContent:a.jsx(vt,{})})}),a.jsx(S,{path:"/:billId/:addressType",element:a.jsx(w,{appContent:a.jsx(dt,{isSubPage:!0})})}),a.jsx(S,{path:"/new/:addressType",element:a.jsx(w,{appContent:a.jsx(dt,{isSubPage:!0})})}),a.jsx(S,{path:"new/vendor/create",element:a.jsx(w,{appContent:a.jsx(Be,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit",element:a.jsx(w,{appContent:a.jsx(Be,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:"new/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create",element:a.jsx(w,{appContent:a.jsx(Be,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit",element:a.jsx(w,{appContent:a.jsx(Be,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:"*",element:a.jsx(Ee,{})})]}):a.jsx(S,{path:"*",element:a.jsx(re,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5,boxShadow:`0px 2px ${A.sp1} ${i.colors.dropShadowNormal}`}})}),a.jsx(S,{path:"*",element:a.jsx(Ee,{})})]})}export{jo as default};
@@ -1,4 +1,4 @@
1
- import{j as k}from"./liveblocks-CqGMBzbB.js";import{a as V}from"./sentry-By_w3AbQ.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-DMKpdX6V.js";import{j as ce,p as ue,aJ as de,z as E,C as pe,c as M,ab as x,e as z,bu as le,ap as me,y as B,aq as R}from"./index-B-S1sw2q.js";import{M6 as fe,eN as G,rw as ye,GH as Se,xd as ge,zW as Ie,Ct as be,D6 as he,D$ as De,Mt as Oe,Mu as Te,Mv as ke,Mw as Ce,Mx as Ve,J0 as we,Lv as Ne,Jc as Ae,k6 as _e,fz as ve,fy as Fe,fx as xe,pE as ze,pv as Ee,ps as Me,j_ as Be,rF as Re,rD as P,bC as L,rR as j,ct as Pe}from"./zeni-epic-state-dcVRrD1h.js";import{n as Le}from"./mui-C4peJOR0.js";import{c as U}from"./routePaths-DwcIzItv.js";import{M as je}from"./MobileAppDrawer-CQwwOR5p.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]="0ab430a6-516f-443d-a450-b876c5d0c805",e._sentryDebugIdIdentifier="sentry-dbid-0ab430a6-516f-443d-a450-b876c5d0c805")}catch{}})();const Ue=Le.div`
1
+ import{j as k}from"./liveblocks-BdePShct.js";import{a as V}from"./sentry-CX_3yQh7.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-C_ZreJAw.js";import{k as ce,y as ue,aK as de,z as E,A as pe,c as M,ac as x,f as z,bv as le,aq as me,s as B,ar as R}from"./index-CGS6zWWp.js";import{Mt as fe,eO as G,rx as ye,GW as Se,xe as ge,zX as Ie,Cu as he,D7 as be,E0 as De,MQ as Oe,MR as Te,MS as ke,MT as Ce,MU as Ve,Jn as we,LS as Ae,Jz as Ne,k7 as _e,fA as Fe,fz as ve,fy as xe,pF as ze,pw as Ee,pt as Me,j$ as Be,rG as Re,rE as P,bD as L,rS as U,cu as Pe}from"./zeni-epic-state-H6DZSSlf.js";import{n as Le}from"./mui-BtnH6ELy.js";import{c as j}from"./routePaths-DZkWYInw.js";import{M as Ue}from"./MobileAppDrawer-BDT0TmvR.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]="9bff8de9-8922-4eba-9221-1067561c4831",e._sentryDebugIdIdentifier="sentry-dbid-9bff8de9-8922-4eba-9221-1067561c4831")}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-CqGMBzbB.js";import{a as V}from"./sentry-By_w3Ab
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=E.getSignedInUser(),S=r.tenantId,l={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},h=we(d.roleMap)&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",t=Ne(e.companyConfigState),s=Ae(e.userRoleConfigState);return{businessVerificationDetails:i,verficationDetailsFetchState:i.fetchState,isRefreshingViewInBackground:i.isRefreshingViewInBackground,allNationalityCountries:i.allNationalityCountries,filesEndPoint:`${me.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:h,allIndustries:t.companyIndustries??[],companyTitles:s.companyTitles}},function(e,d){const{companyId:i,productType:r,currentTenant:y,navigate:S,location:l}=d,{tenantEmailDomain:h}=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:N,sourceOfFunds:A,companySubIndustry:_,countriesOfOperations:b,companySourceOfFunds:q,companySourceOfFundsDescription:J,transactionVolume:$,transactionVolumeDescription:W,purposeOfAccount:Z,purposeOfAccountDescription:H,regulatedStatus:K,regulatedStatusDescription:Q,usNexus:X,usNexusTypes:Y}=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?Pe(m):void 0,phone:I,syncToken:f,fileIds:a,incDate:o!=null?L(o?.toString()):o,typeOfIncorporation:w?.selectedOption??"",stateOfIncorporation:N?.selectedOption??"",sourceOfFunds:A?.selectedOption??"",companySubIndustry:_?.selectedOption??"",countriesOfOperations:b?.selectedOptions.map(F=>F.length===2?F:R(F))??[],companySourceOfFunds:q?.selectedOption??"",companySourceOfFundsDescription:J,transactionVolume:$?.selectedOption??"",transactionVolumeDescription:W,purposeOfAccount:Z?.selectedOption??"",purposeOfAccountDescription:H,regulatedStatus:K??"",regulatedStatusDescription:Q,usNexus:X,usNexusTypes:Y?.selectedOptions??[]},te={userId:u,firstName:n.firstName,lastName:n.lastName,email:c,syncToken:D};e(j({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:N,treasuryUserVerificationStatus:A,fileIds:_}=p;let b;return f.selectDocumentType==="driverLicense"?b="driving_license":f.selectDocumentType==="passport"?b="passport":f.selectDocumentType==="stateId"?b="id_document":f.selectDocumentType==="ssnCard"&&(b="social_security_card"),{officerType:O,userId:T,firstName:g.firstName,lastName:g.lastName,email:m,ssn:c,nationalityCountryCode:I?.selectedOption!=null?R(I.selectedOption):void 0,phone:u,birthday:n!=null?L(n?.toString()):n,syncToken:D,titleAtCompany:a.selectedOption,ownershipInCompany:o,documentTypeSelectedForVerification:b,isSelectedForVerification:w,userVerificationStatus:N,treasuryUserVerificationStatus:A,fileIds:_,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(j({officers:s}))},onSaveDetailsClick:t=>{e(P(i,t,r))},onSendForVerificationClick:t=>{e(P(i,t,r,!0))},onAddressClick:t=>{const s=U(h,t),p=B(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onRegisteredAddressClick:t=>{const s=U(h,t),p=B(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onBackClick:()=>{e(Re({companyId:i})),S("../setup")},updateFilesEntity:t=>{e(Be({files:t}))},onDeleteFile:t=>{e(Me(t))},onDeleteFileList:t=>{e(Ee(t))},onEditFileName:(t,s)=>{e(ze(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),Xe=({productType:e})=>{const d=ae(),i=ne(),r=se(),[y,S]=V.useState(!1),[l,h]=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??E.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(he(n,!0));break;case"reimbursement":r(be(n,!0));break;case"charge_cards":r(Ie(n,!0));break;default:r(ge(n,!0))}},[y,g,n,r]),E.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=>{h(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(Ue,{children:[k.jsx(pe,{analytics:M,onLoad:a=>(o=>{switch(e){case"zeni_accounts":return o.trackPageLoaded(z.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return o.trackPageLoaded(z.Event.reimbursementBusinessVerification);default:return o.trackPageLoaded(z.Event.billPayBusinessVerification,x(i)?"Settings":void 0)}})(a)}),x(i)?k.jsx(je,{isAppContentDrawerOpen:l,handleDrawerToggle:D}):null,k.jsx(Ge,{businessVerificationDetails:f,navigate:d,location:i,companyId:n,analytics:M,currentTenant:c,productType:e,isSettings:x(i),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{D(!0)},maxInsuredAmount:T.maxInsuredAmount})]})};export{Xe as B};
9
+ `,Ge=re(function(e,d){const{businessVerificationDetails:i}=d,r=G(e),y=E.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:$,transactionVolume:J,transactionVolumeDescription:W,purposeOfAccount:Z,purposeOfAccountDescription:K,regulatedStatus:Q,regulatedStatusDescription:X,usNexus:H,usNexusTypes:Y}=t,F=O?.selectedOption,ee={companyId:i,companyDescription:s,companyIndustry:p.selectedOption,companyIndustryType:F==null||F===""?void 0:F,companyLegalName:T,taxIdOrEIN:g,website:m!=""&&m!=null?Pe(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(v=>v.length===2?v:R(v))??[],companySourceOfFunds:q?.selectedOption??"",companySourceOfFundsDescription:$,transactionVolume:J?.selectedOption??"",transactionVolumeDescription:W,purposeOfAccount:Z?.selectedOption??"",purposeOfAccountDescription:K,regulatedStatus:Q??"",regulatedStatusDescription:X,usNexus:H,usNexusTypes:Y?.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?R(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(P(i,t,r))},onSendForVerificationClick:t=>{e(P(i,t,r,!0))},onAddressClick:t=>{const s=j(b,t),p=B(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onRegisteredAddressClick:t=>{const s=j(b,t),p=B(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onBackClick:()=>{e(Re({companyId:i})),S("../setup")},updateFilesEntity:t=>{e(Be({files:t}))},onDeleteFile:t=>{e(Me(t))},onDeleteFileList:t=>{e(Ee(t))},onEditFileName:(t,s)=>{e(ze(t,s.split(".")[0]))},onGetOtp:t=>{e(xe(t,"SpendManagementSetup"))},onResendOtp:t=>{e(ve(t,"SpendManagementSetup"))},onVerifyOtp:(t,s)=>{e(Fe(t,s,"SpendManagementSetup"))},saveNewAddressInLocalStore:(t,s)=>{e(_e({addressType:t,addressToCreate:s}))}}})(le),He=({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??E.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]),E.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:M,onLoad:a=>(o=>{switch(e){case"zeni_accounts":return o.trackPageLoaded(z.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return o.trackPageLoaded(z.Event.reimbursementBusinessVerification);default:return o.trackPageLoaded(z.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:M,currentTenant:c,productType:e,isSettings:x(i),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{D(!0)},maxInsuredAmount:T.maxInsuredAmount})]})};export{He as B};