@zeniai/web-app-ui 5.0.61-qa → 5.0.62-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 (115) hide show
  1. package/dist/assets/AddressRoutes-CWbtPs0T.js +1 -0
  2. package/dist/assets/AddressScreen-BeHKG8v1.js +9 -0
  3. package/dist/assets/{AiCfoScreen-BP9Ft687.js → AiCfoScreen-BJfPMTeD.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-tYr_9OWR.js → BillPayApprovalRoutes-72raP4Au.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-DmhKosIo.js → BillPayRoutes-CEWbGQhV.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-DHwpyl1f.js → BusinessVerificationPageScreen-BUCm7Odf.js} +2 -2
  7. package/dist/assets/{ChargeCardRoutes-DdDzkKLF.js → ChargeCardRoutes-CGWte3py.js} +8 -8
  8. package/dist/assets/{CompanyPassportScreen-BK2OTKJu.js → CompanyPassportScreen-BmSdom0e.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-k86NOnxb.js → ConnectionAuthScreen-DF0fkXNR.js} +1 -1
  10. package/dist/assets/CustomerOnboardingAuthScreen--LKCq1mD.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-ibn4fZkx.js → CustomerOnboardingRoutes-COxgmIX3.js} +1 -1
  12. package/dist/assets/{DashboardRoutes-DsyeD2-B.js → DashboardRoutes-B9AUZ_Md.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-Dn3Q39m4.js → DefaultTenantHome-Bce_0IOJ.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-D6Fv4KmF.js → DomesticWireDetailScreen-BVFVWlSA.js} +3 -3
  15. package/dist/assets/DrawerScreen-BWViotCB.js +1 -0
  16. package/dist/assets/{EntityDetailRoutes-B6fpxmHW.js → EntityDetailRoutes-CKRWkL2F.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-hPdcTllf.js → ExpenseAutomationRoutes-DDrxLrQX.js} +1 -1
  18. package/dist/assets/FeaturePreviewScreen-Bu3Nmz6L.js +1 -0
  19. package/dist/assets/MagicLinkRoutes-Cdzcjinn.js +72 -0
  20. package/dist/assets/MagicLinkSignInScreen-XzPOaXDf.js +12 -0
  21. package/dist/assets/{MobileAppDrawer-BsEeVHGJ.js → MobileAppDrawer-BuQb2buy.js} +1 -1
  22. package/dist/assets/NotFoundScreen-DXPtR234.js +1 -0
  23. package/dist/assets/{NotificationRoutes-CCNPEsKp.js → NotificationRoutes-DQOd5pN1.js} +1 -1
  24. package/dist/assets/{PandLWithForecastRoutes-wJ4pN9t1.js → PandLWithForecastRoutes-Ch0vhwLL.js} +1 -1
  25. package/dist/assets/{PeopleRoutes-uXI358fF.js → PeopleRoutes-DxzAopRH.js} +9 -9
  26. package/dist/assets/{PerformanceRoutes-DOyVY_Ow.js → PerformanceRoutes-BOLxnqNA.js} +1 -1
  27. package/dist/assets/{Preview-CIDoApcd.js → Preview-C1kzMAT1.js} +1 -1
  28. package/dist/assets/{QBOConnectionScreen-BH7qNWPW.js → QBOConnectionScreen-DowWnT4I.js} +1 -1
  29. package/dist/assets/ReferralListScreen-Dj04SxiV.js +5 -0
  30. package/dist/assets/ReimbursementApprovalRoutes-Dce13zkV.js +1 -0
  31. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CEnbrTbv.js → ReimbursementApprovalRuleDetailScreen-CErT0hoJ.js} +1 -1
  32. package/dist/assets/{ReimbursementRoutes-BT2-7Gsa.js → ReimbursementRoutes-DbOJcy-l.js} +1 -1
  33. package/dist/assets/ReportsRoutes-m8OaVZVD.js +1 -0
  34. package/dist/assets/RewardsRoutes-Bhpz6tDz.js +1 -0
  35. package/dist/assets/ScreenRoutes-D3nR_ZAq.js +2 -0
  36. package/dist/assets/{SettingsRoutes-CLa1lnt-.js → SettingsRoutes-DXnpxjv_.js} +1 -1
  37. package/dist/assets/{SetupPagesScreen-CwdMwDRP.js → SetupPagesScreen-RaBTeZ3X.js} +5 -5
  38. package/dist/assets/{SignInScreen-DnvXxvnM.js → SignInScreen-BdxXXdlE.js} +1 -1
  39. package/dist/assets/SignOutScreen-Bpj0-554.js +9 -0
  40. package/dist/assets/TaskListScreen-DucJZ5Tc.js +9 -0
  41. package/dist/assets/TaskRoutes-BauTuLET.js +9 -0
  42. package/dist/assets/TransactionDetailRoutes-DkbxIzsT.js +1 -0
  43. package/dist/assets/{TransactionDetailScreen-DKG_MhFF.js → TransactionDetailScreen-DB2dMdqL.js} +2 -2
  44. package/dist/assets/{TransactionListRoutes-BSDQcv3U.js → TransactionListRoutes-SZ1iphEM.js} +1 -1
  45. package/dist/assets/{TreasuryRoutes-AWertsO5.js → TreasuryRoutes-CGEviXlY.js} +6 -6
  46. package/dist/assets/{VendorsRoutes-DW9oOFbY.js → VendorsRoutes-CIeivuDV.js} +1 -1
  47. package/dist/assets/WiseConfirmationScreen-C2YdpQUX.js +12 -0
  48. package/dist/assets/{ZeniAccountRoutes-Bu65VebN.js → ZeniAccountRoutes-WZ6oPa1B.js} +1 -1
  49. package/dist/assets/ZeniAccountStatementScreen-BcTdJcif.js +9 -0
  50. package/dist/assets/{accountMappingHelper-C_yfNaYk.js → accountMappingHelper-Bqj2mJfi.js} +1 -1
  51. package/dist/assets/{analytics-BMapadfi.js → analytics-B_uP5uGX.js} +1 -1
  52. package/dist/assets/{analyticsHelper-hJglLz67.js → analyticsHelper-CsFRydiU.js} +1 -1
  53. package/dist/assets/{core-Bycbr_zS.js → core-Cgen4kAj.js} +1 -1
  54. package/dist/assets/{decodeURIComponentSafe-D8oY1hc9.js → decodeURIComponentSafe-DztnZ-A4.js} +1 -1
  55. package/dist/assets/{dnd-Jwp37Hwc.js → dnd-DhFfs1wM.js} +1 -1
  56. package/dist/assets/{empty-BVzRSYkS.js → empty-CfLsUtpF.js} +1 -1
  57. package/dist/assets/{empty-DvEtWNNn.js → empty-Dt-07Rye.js} +1 -1
  58. package/dist/assets/{emptyVideoElement-wwbaO4KU.js → emptyVideoElement-v9g3UWiq.js} +1 -1
  59. package/dist/assets/{epic-C4FCGNFQ.js → epic-lM2FfDOS.js} +1 -1
  60. package/dist/assets/{getLocaleForTenant-hR2ZjLdG.js → getLocaleForTenant-Di1C7dV7.js} +1 -1
  61. package/dist/assets/{index-Co9dF_xb.js → index-BkCX5jRI.js} +1 -1
  62. package/dist/assets/{index-DB8zvt4r.js → index-C_giOD7z.js} +1 -1
  63. package/dist/assets/{index-C5fsf-f7.js → index-CiK_CtQ4.js} +1 -1
  64. package/dist/assets/{index-DmSlLFfZ.js → index-Dprn4SY3.js} +1 -1
  65. package/dist/assets/{index-Bo8i__Uw.js → index-Dwqwe5m-.js} +1 -1
  66. package/dist/assets/{index-D75hXUaQ.js → index-nofE1fwv.js} +2 -2
  67. package/dist/assets/{index-CkPLyKrL.js → index-trlF__w8.js} +12793 -12793
  68. package/dist/assets/{lexical-BFKF8Nqm.js → lexical-DJV7tysr.js} +1 -1
  69. package/dist/assets/{liveblocks-yYJhhlwl.js → liveblocks-CF908iAG.js} +1 -1
  70. package/dist/assets/{lottie-CQftbn5o.js → lottie-Ega9gP0x.js} +1 -1
  71. package/dist/assets/{mui-uwIb-0_u.js → mui-C7dUqSqV.js} +1 -1
  72. package/dist/assets/{pathToGoBack-6NBe70Qs.js → pathToGoBack-C7m35zDG.js} +1 -1
  73. package/dist/assets/{pdf-Clano961.js → pdf-CSmOdS_B.js} +3 -3
  74. package/dist/assets/{pdf-lib-qkfMQ_yu.js → pdf-lib-D5gPNITG.js} +1 -1
  75. package/dist/assets/{plaid-BtVuBiv6.js → plaid-CChs9PMx.js} +1 -1
  76. package/dist/assets/{pusher-CR1v05zD.js → pusher-C5oHaaZM.js} +1 -1
  77. package/dist/assets/{react-BwcG0A5u.js → react-CU9NYGdL.js} +1 -1
  78. package/dist/assets/{react-BjTfXtJu.js → react-CVXgK0Ih.js} +1 -1
  79. package/dist/assets/{react-BSMOFxva.js → react-ClL_vZpV.js} +1 -1
  80. package/dist/assets/{react-B-NPms-H.js → react-CrvQ92fR.js} +1 -1
  81. package/dist/assets/{react-DrnPjRY_.js → react-CsMGsa1f.js} +1 -1
  82. package/dist/assets/{react-D5gy2Tue.js → react-DrZcp68n.js} +1 -1
  83. package/dist/assets/{recharts-DgZ04ot6.js → recharts-Dyhe2tpB.js} +1 -1
  84. package/dist/assets/{routePaths-CMggNZ1T.js → routePaths-CqnfURaJ.js} +1 -1
  85. package/dist/assets/{sentry-CbgVFeom.js → sentry-cfxuOFew.js} +1 -1
  86. package/dist/assets/{url-CACUy1v-.js → url-B1qVva4A.js} +1 -1
  87. package/dist/assets/{url-Bvrri-wo.js → url-DOBNPG6D.js} +1 -1
  88. package/dist/assets/{useAskAiCfoHostNavButtonProps-C7xPewG5.js → useAskAiCfoHostNavButtonProps-C2mAQ-5p.js} +1 -1
  89. package/dist/assets/{useDeviceId-DGCuWe9z.js → useDeviceId-43L8M3To.js} +1 -1
  90. package/dist/assets/{useFetchSuggestedQuestionsWhenReady-DmtdISaY.js → useFetchSuggestedQuestionsWhenReady-B5mF_k6O.js} +1 -1
  91. package/dist/assets/{useInitialThreadRequest-DBrdowkN.js → useInitialThreadRequest-CME_1dn5.js} +1 -1
  92. package/dist/assets/{utils-CUNvYJ5h.js → utils-DumEze_M.js} +1 -1
  93. package/dist/assets/{withTransactionSidePanel-VWqgYGxS.js → withTransactionSidePanel-Dq1wepy8.js} +1 -1
  94. package/dist/assets/{zeni-epic-state-CIfm8mou.js → zeni-epic-state-DrGehtra.js} +3 -3
  95. package/dist/index.html +1 -1
  96. package/package.json +2 -2
  97. package/dist/assets/AddressRoutes-CVfu5Dox.js +0 -1
  98. package/dist/assets/AddressScreen-7k7vjaFG.js +0 -9
  99. package/dist/assets/CustomerOnboardingAuthScreen-DbwBw2uW.js +0 -1
  100. package/dist/assets/DrawerScreen-Dzpv8ixO.js +0 -1
  101. package/dist/assets/FeaturePreviewScreen-CZ4kSWCz.js +0 -1
  102. package/dist/assets/MagicLinkRoutes-Bg0SJwWd.js +0 -72
  103. package/dist/assets/MagicLinkSignInScreen-3waOEQgZ.js +0 -12
  104. package/dist/assets/NotFoundScreen-BnQ9IpWO.js +0 -1
  105. package/dist/assets/ReferralListScreen-CTukyk1g.js +0 -5
  106. package/dist/assets/ReimbursementApprovalRoutes-DcSHObaL.js +0 -1
  107. package/dist/assets/ReportsRoutes-JuhC6wWc.js +0 -1
  108. package/dist/assets/RewardsRoutes-DSOl9Z0M.js +0 -1
  109. package/dist/assets/ScreenRoutes-Ck32XMYo.js +0 -2
  110. package/dist/assets/SignOutScreen-CL2ZVx-I.js +0 -9
  111. package/dist/assets/TaskListScreen-DCK_sYz_.js +0 -9
  112. package/dist/assets/TaskRoutes-BPawNp5H.js +0 -9
  113. package/dist/assets/TransactionDetailRoutes-DNNxQ-Pu.js +0 -1
  114. package/dist/assets/WiseConfirmationScreen-CfuT7R3M.js +0 -12
  115. package/dist/assets/ZeniAccountStatementScreen-D1W40t46.js +0 -9
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-CF908iAG.js";import{A as d}from"./AddressScreen-BeHKG8v1.js";import i from"./NotFoundScreen-DXPtR234.js";import"./sentry-cfxuOFew.js";import{n as s,o as r}from"./core-Cgen4kAj.js";import"./zeni-epic-state-DrGehtra.js";import"./recharts-Dyhe2tpB.js";import"./index-trlF__w8.js";import"./mui-C7dUqSqV.js";import"./analytics-B_uP5uGX.js";import"./plaid-CChs9PMx.js";import"./dnd-DhFfs1wM.js";import"./stripe-DMRn4zHo.js";import"./lottie-Ega9gP0x.js";import"./lexical-DJV7tysr.js";import"./pdf-CSmOdS_B.js";import"./utils-DumEze_M.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="4bd15e18-5b5f-4be1-8d33-8bd696c76da2",t._sentryDebugIdIdentifier="sentry-dbid-4bd15e18-5b5f-4be1-8d33-8bd696c76da2")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(d,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(d,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
@@ -0,0 +1,9 @@
1
+ import{j as d}from"./liveblocks-CF908iAG.js";import{a as h}from"./sentry-cfxuOFew.js";import{j as T,h as _,u as j,l as E,g as B,k as M}from"./core-Cgen4kAj.js";import{q as $,h as D,z as L,j as K,B as N,A as R,d as C,f as m,w as z,k as b,n as F}from"./index-trlF__w8.js";import{I$ as k,gM as U,eN as q,J0 as G,c0 as J,J1 as O,k6 as V}from"./zeni-epic-state-DrGehtra.js";import{n as H}from"./mui-C7dUqSqV.js";import Q from"./NotFoundScreen-DXPtR234.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]="15bcc565-359a-4e12-9c99-2467f8f64885",e._sentryDebugIdIdentifier="sentry-dbid-15bcc565-359a-4e12-9c99-2467f8f64885")}catch{}})();const W=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
+ `,X=M(function(e,t){const{addressId:o,isSubPage:i,addressType:c}=t,l=q(e),a=t.roleMap!=null&&G(t.roleMap),r=i||c==="user_address"||J(l?.userRole??[])||a?void 0:"readonly";if(o==null){const s=O(c,e);return{addressToEdit:s?.addressToCreate,loadingState:s?.status?.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:r,isSubPage:i,dontShowSaveConfirmationPopup:t.dontShowSaveConfirmation}}const n=k(e,o);return{addressToEdit:n.address,loadingState:n.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:r}},function(e,t){const{navigate:o,location:i,addressType:c}=t,l=a=>{if(a==="express-pay")o("../express-pay/add-wire");else{const r=i.state,n=F(r?.pathnameStackToGoBack);let s=n.poppedPathname??w();const u=r?.queryParams;if(u){const f=new URLSearchParams(u).toString();f&&(s=`${s}?${f}`)}o(s,{state:{pathnameStackToGoBack:n.newStack}})}};return{onSubmitHandler:a=>{const r=Y(a);e(V({addressType:c,addressToCreate:r})),C?.trackSaveAddressClicked(m.Event.saveAddressClicked,{street:a.street.addressString,city:a.city,state:a.state,country:a.country.selectedOption??"",postalCode:a.postalCode,suite:a.suite,secondaryInfo:a.secondaryInfo}),l(t.bankAccountContext)},onCancel:()=>{l(t.bankAccountContext)}}})(z);function de({isSubPage:e,hideAddressSubTitle:t=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=T(),r=_(),n=j(),{addressId:s,addressType:u}=E(),f=$(),I=D(),A=L.getSignedInUser(),[g,v]=h.useState(s==null),p=B(S=>s!=null?k(S,s).fetchState:"Not-Started"),x=K();if(A==null)throw Error("Can't access address page without signing in...");const P=S=>S.trackPageLoaded(s!=null?m.Event.editAddress:m.Event.addAddress),y=l??u;return h.useEffect(()=>{g||s==null||(v(!0),r(U(s,!1)))},[g,s,r]),y==null||y.match(/(user_address|company_address|company_registered_address|vendor_address|officer_([1-9]|10)_address)$/g)?!g&&p==="Not-Started"||g&&p==="In-Progress"?d.jsx(N,{fetchState:p,style:{backgroundColor:I.colors.grey5}}):s!=null&&p==="Error"?(a(`${w(1)}/new`,{replace:!0}),d.jsx(d.Fragment,{})):d.jsxs(d.Fragment,{children:[d.jsx(R,{analytics:C,onLoad:P}),d.jsx(W,{windowSize:f,children:d.jsx(X,{location:n,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:t,addressId:s,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:x?.loggedInUserRoleMap})})]}):d.jsx(Q,{})}const w=(e=2)=>{let t="../";for(let o=0;o<e;o++)t=`${t}../`;return t},Y=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng});export{de as A,Y as t};
@@ -1,4 +1,4 @@
1
- import{j as h}from"./liveblocks-yYJhhlwl.js";import{a as r}from"./sentry-CbgVFeom.js";import{h as oe,j as ne,u as ie,g as j,l as re,k as le}from"./core-Bycbr_zS.js";import{K as ce,cG as ue,z as de,q as me,cH as pe,cI as fe,cJ as he,cK as $,y as Se,d as v,O as q,cL as ge,cM as Ce,f as be,a1 as ke,cN as we,Q as Ie,s as Pe,r as G,aY as Ee,cO as Te}from"./index-CkPLyKrL.js";import{fD as ye,f2 as H,eN as _e,hq as xe,Px as ve,eM as Ue,hA as Ae,hw as Oe,ft as Qe,fn as De,fg as Fe,fk as V,fo as Me,fp as Le,fq as Be,fr as Re,fs as Ne}from"./zeni-epic-state-CIfm8mou.js";import{D as je,n as U,P as qe,S as Ge}from"./mui-uwIb-0_u.js";import{p as Ve}from"./pathToGoBack-6NBe70Qs.js";import"./recharts-DgZ04ot6.js";import"./analytics-BMapadfi.js";import"./plaid-BtVuBiv6.js";import"./dnd-Jwp37Hwc.js";import"./stripe-DMRn4zHo.js";import"./lottie-CQftbn5o.js";import"./lexical-BFKF8Nqm.js";import"./pdf-Clano961.js";import"./utils-CUNvYJ5h.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]="b69bcb8d-8605-41f7-923c-0d2cc83ef758",s._sentryDebugIdIdentifier="sentry-dbid-b69bcb8d-8605-41f7-923c-0d2cc83ef758")}catch{}})();const W="chat-response-generated",$e=le(function(s,i){const a=H(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===W&&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:P}=$(S,t);c!=="answer"?v.trackAICFOChatResponseGenerated(c,g?.question.questionText??"",n.text,t,Te(P,I),n.metadata.message_id??null):v.trackAICFOChatAnswerGenerated(n.text,g?.question.questionText??"",(n.follow_up_questions?.length??0)>0,!!n.assumptions,!!n.insights,n.visualization!=null,Be(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&&Ee(s,e,o,f,S,d,c,n)},updateCurrentInput:e=>{s(V(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{s(Me(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{p(-1)},onCloseClick:()=>{const e=G(a.state?.pathnameStackToGoBack),o=e.poppedPathname??Ve(1);p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack}}),s(V(""))},togglePageView:()=>{const e=G(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=Pe(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=j(u=>H(u)),e=de.getSignedInUser(),{session_id:o}=re(),n=me(),c=j(u=>_e(u)),t=l.uiState.currentChatSessionId,I=c.tenantEmailDomain,{handleUploadPromoClose:g,isUploadPromoVisible:P}=pe({isFileUploadEnabled:s,tenantEmailDomain:I}),A=fe({currentTenant:c,currentChatSessionId:t,aiCfoView:l}),C=d.state,b=C?.aiCfoInitialQuestion,O=!!C?.aiCfoShouldSubmit,[z,E]=r.useState(null),[K,T]=r.useState(!1),Q=r.useRef(!1);r.useEffect(()=>{Q.current||b==null||b===""||(E(b),T(O),Q.current=!0)},[b,O]);const Y=r.useCallback(()=>{E(null),T(!1)},[]),D=r.useMemo(()=>new URLSearchParams(d.search),[d.search]),F=D.get("ref")??C?.aiCfoRef,y=D.get("emailRefId")??C?.aiCfoEmailRefId,M=r.useRef(!1);r.useEffect(()=>{M.current||F!=="month-end-email"||y==null||t!=null||e==null||(a(xe("controller",e.userId,y,"MONTH_END_EMAIL")),M.current=!0)},[F,y,t,a,e]);const k=l.uiState.lastContextMessage;r.useEffect(()=>{k!=null&&k!==""&&t!=null&&(E(k),T(!0),a(ve()))},[k,t,a]);const J=c.masterTOSInfo,w=J?.isMasterTOSAccepted??!1,{visitedSessions:L}=he(t),_=l.fetchState,x=l.uiState.chatSessionsNextPageToken.hasMore||!l.uiState.chatSessionsFirstPageFetched,B=t!=null?l.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",R=t==null||(l.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),N=l.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:Z}=$(N,t),X=Z.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(Ue({sessionId:o,agentId:"controller"}))},[]);const ee=r.useMemo(()=>({events:L.map(u=>`private-chat-${u}.${W}`),eventCallback:(u,se,ae)=>ae.onEventReceived(u,se)}),[L]);if(r.useEffect(()=>{_!=="In-Progress"&&x&&a(Ae())},[_,x,a]),r.useEffect(()=>{t!=null&&B!=="In-Progress"&&R&&e!=null&&_==="Completed"&&!x&&a(Oe(t,e.userId))},[B,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(We,{children:[h.jsx(Se,{analytics:v,onLoad:u=>u.trackPageLoaded(be.Event.aiCFOPage)}),q(n)&&A.drawerElement,h.jsx($e,{...ee,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:N,openOnboardingPage:()=>f(!0),userId:e.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:o,location:d,isSubmitting:te,isEmptyChatWithSession:X,customPageTitle:S,currentTenant:c,emailLinkQuestion:z??void 0,autoSubmitEmailLinkQuestion:K,onEmailLinkQuestionProcessed:Y,onMenuClick:q(n)?A.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:P,onUploadPromoClose:g}),h.jsx(je,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:ze,style:{width:`${ge}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:h.jsx(He,{onClick:u=>u.stopPropagation(),children:h.jsx(Ce,{isTOSAccepted:w,acceptMasterTOSState:l.masterTOSAcceptanceState,customPageTitle:S,onCloseClick:()=>f(!1),onCompleteClick:()=>{w||c.userRoleId==null||a(Qe(c.userRoleId)),f(!1)}})})})]})},He=U(Ge)`
1
+ import{j as h}from"./liveblocks-CF908iAG.js";import{a as r}from"./sentry-cfxuOFew.js";import{h as oe,j as ne,u as ie,g as j,l as re,k as le}from"./core-Cgen4kAj.js";import{K as ce,cG as ue,z as de,q as me,cH as pe,cI as fe,cJ as he,cK as $,A as Se,d as v,O as q,cL as ge,cM as Ce,f as be,a1 as ke,cN as we,Q as Ie,s as Pe,n as G,aY as Ee,cO as Te}from"./index-trlF__w8.js";import{fD as ye,f2 as H,eN as _e,hq as xe,Px as ve,eM as Ue,hA as Ae,hw as Oe,ft as Qe,fn as De,fg as Fe,fk as V,fo as Me,fp as Le,fq as Be,fr as Re,fs as Ne}from"./zeni-epic-state-DrGehtra.js";import{D as je,n as U,P as qe,S as Ge}from"./mui-C7dUqSqV.js";import{p as Ve}from"./pathToGoBack-C7m35zDG.js";import"./recharts-Dyhe2tpB.js";import"./analytics-B_uP5uGX.js";import"./plaid-CChs9PMx.js";import"./dnd-DhFfs1wM.js";import"./stripe-DMRn4zHo.js";import"./lottie-Ega9gP0x.js";import"./lexical-DJV7tysr.js";import"./pdf-CSmOdS_B.js";import"./utils-DumEze_M.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]="7bd1083e-e5c8-49d1-b300-c4d6c6d5bb07",s._sentryDebugIdIdentifier="sentry-dbid-7bd1083e-e5c8-49d1-b300-c4d6c6d5bb07")}catch{}})();const W="chat-response-generated",$e=le(function(s,i){const a=H(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===W&&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:P}=$(S,t);c!=="answer"?v.trackAICFOChatResponseGenerated(c,g?.question.questionText??"",n.text,t,Te(P,I),n.metadata.message_id??null):v.trackAICFOChatAnswerGenerated(n.text,g?.question.questionText??"",(n.follow_up_questions?.length??0)>0,!!n.assumptions,!!n.insights,n.visualization!=null,Be(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&&Ee(s,e,o,f,S,d,c,n)},updateCurrentInput:e=>{s(V(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{s(Me(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{p(-1)},onCloseClick:()=>{const e=G(a.state?.pathnameStackToGoBack),o=e.poppedPathname??Ve(1);p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack}}),s(V(""))},togglePageView:()=>{const e=G(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=Pe(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=j(u=>H(u)),e=de.getSignedInUser(),{session_id:o}=re(),n=me(),c=j(u=>_e(u)),t=l.uiState.currentChatSessionId,I=c.tenantEmailDomain,{handleUploadPromoClose:g,isUploadPromoVisible:P}=pe({isFileUploadEnabled:s,tenantEmailDomain:I}),A=fe({currentTenant:c,currentChatSessionId:t,aiCfoView:l}),C=d.state,b=C?.aiCfoInitialQuestion,O=!!C?.aiCfoShouldSubmit,[z,E]=r.useState(null),[K,T]=r.useState(!1),Q=r.useRef(!1);r.useEffect(()=>{Q.current||b==null||b===""||(E(b),T(O),Q.current=!0)},[b,O]);const Y=r.useCallback(()=>{E(null),T(!1)},[]),D=r.useMemo(()=>new URLSearchParams(d.search),[d.search]),F=D.get("ref")??C?.aiCfoRef,y=D.get("emailRefId")??C?.aiCfoEmailRefId,M=r.useRef(!1);r.useEffect(()=>{M.current||F!=="month-end-email"||y==null||t!=null||e==null||(a(xe("controller",e.userId,y,"MONTH_END_EMAIL")),M.current=!0)},[F,y,t,a,e]);const k=l.uiState.lastContextMessage;r.useEffect(()=>{k!=null&&k!==""&&t!=null&&(E(k),T(!0),a(ve()))},[k,t,a]);const J=c.masterTOSInfo,w=J?.isMasterTOSAccepted??!1,{visitedSessions:L}=he(t),_=l.fetchState,x=l.uiState.chatSessionsNextPageToken.hasMore||!l.uiState.chatSessionsFirstPageFetched,B=t!=null?l.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",R=t==null||(l.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),N=l.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:Z}=$(N,t),X=Z.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(Ue({sessionId:o,agentId:"controller"}))},[]);const ee=r.useMemo(()=>({events:L.map(u=>`private-chat-${u}.${W}`),eventCallback:(u,se,ae)=>ae.onEventReceived(u,se)}),[L]);if(r.useEffect(()=>{_!=="In-Progress"&&x&&a(Ae())},[_,x,a]),r.useEffect(()=>{t!=null&&B!=="In-Progress"&&R&&e!=null&&_==="Completed"&&!x&&a(Oe(t,e.userId))},[B,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(We,{children:[h.jsx(Se,{analytics:v,onLoad:u=>u.trackPageLoaded(be.Event.aiCFOPage)}),q(n)&&A.drawerElement,h.jsx($e,{...ee,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:N,openOnboardingPage:()=>f(!0),userId:e.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:o,location:d,isSubmitting:te,isEmptyChatWithSession:X,customPageTitle:S,currentTenant:c,emailLinkQuestion:z??void 0,autoSubmitEmailLinkQuestion:K,onEmailLinkQuestionProcessed:Y,onMenuClick:q(n)?A.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:P,onUploadPromoClose:g}),h.jsx(je,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:ze,style:{width:`${ge}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:h.jsx(He,{onClick:u=>u.stopPropagation(),children:h.jsx(Ce,{isTOSAccepted:w,acceptMasterTOSState:l.masterTOSAcceptanceState,customPageTitle:S,onCloseClick:()=>f(!1),onCompleteClick:()=>{w||c.userRoleId==null||a(Qe(c.userRoleId)),f(!1)}})})})]})},He=U(Ge)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as l}from"./liveblocks-yYJhhlwl.js";import{a as y}from"./sentry-CbgVFeom.js";import{j as U,u as B,h as j,g as f,N as $,k as T,l as N,n as O,o as h}from"./core-Bycbr_zS.js";import{eN as L,Mi as A,L_ as b,x8 as w,x2 as F,x6 as x,wX as z,M0 as M,w_ as W,xa as q,x9 as C}from"./zeni-epic-state-CIfm8mou.js";import{h as P,z as k,w as _,a1 as X,by as G,ab as V,bz as H}from"./index-CkPLyKrL.js";import"./mui-uwIb-0_u.js";import{i as J}from"./ReimbursementApprovalRuleDetailScreen-CEnbrTbv.js";import K from"./NotFoundScreen-BnQ9IpWO.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]="a3467574-a05e-4125-8018-02e7e617c25e",e._sentryDebugIdIdentifier="sentry-dbid-a3467574-a05e-4125-8018-02e7e617c25e")}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:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(I)&&e(M(!1))},onBackClick:()=>{V(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(z(a))},onEditRuleClick:a=>{a!=null?(e(x(a)),t(`./${a}/edit`)):(e(x()),t("./new"))}}})(X(G)),Y=()=>{const e=U(),o=B(),t=j(),[p,a]=y.useState(!1),[u,s]=y.useState(!1),d=P(),n=f(i=>i.billPaySetupApproverViewState.fetchState),c=f(i=>L(i)),r=f(i=>A(i)),g=f(i=>b(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(w())},[g]),y.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(F(!0)))},[p,n,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-${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(_,{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),p=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=p==="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:p}},function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:a,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=V(o.location);return{onApprovalRuleDataUpdated:n=>{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:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(w()),s==="approval_update"||d?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=U(),o=j(),t=B(),{approvalRuleId:p}=N(),a=k.getSignedInUser(),u=P(),s=f(r=>b(r)),d=f(r=>A(r)),[n,c]=y.useState(!1);if(y.useEffect(()=>{n||(c(!0),o(W(!0)))}),y.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),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(_,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Z,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:t})}function se(){return l.jsxs(O,{children:[l.jsx(h,{path:"/",element:l.jsx(Y,{})}),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
+ import{j as l}from"./liveblocks-CF908iAG.js";import{a as y}from"./sentry-cfxuOFew.js";import{j as B,u as U,h as j,g as f,N as $,k as T,l as N,n as O,o as b}from"./core-Cgen4kAj.js";import{eN as L,Mi as A,L_ as h,x8 as w,x2 as F,x6 as x,wX as z,M0 as M,w_ as W,xa as q,x9 as C}from"./zeni-epic-state-DrGehtra.js";import{h as P,z as k,B as _,a1 as X,by as G,ab as V,bz as H}from"./index-trlF__w8.js";import"./mui-C7dUqSqV.js";import{i as J}from"./ReimbursementApprovalRuleDetailScreen-CErT0hoJ.js";import K from"./NotFoundScreen-DXPtR234.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]="1652140b-cd3b-4b71-94a3-d1be6dd93611",e._sentryDebugIdIdentifier="sentry-dbid-1652140b-cd3b-4b71-94a3-d1be6dd93611")}catch{}})();const I="bill-approval-rule-update",Q=T(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:h(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(I)&&e(M(!1))},onBackClick:()=>{V(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(z(a))},onEditRuleClick:a=>{a!=null?(e(x(a)),t(`./${a}/edit`)):(e(x()),t("./new"))}}})(X(G)),Y=()=>{const e=B(),o=U(),t=j(),[p,a]=y.useState(!1),[u,s]=y.useState(!1),d=P(),n=f(i=>i.billPaySetupApproverViewState.fetchState),c=f(i=>L(i)),r=f(i=>A(i)),g=f(i=>h(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(w())},[g]),y.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(F(!0)))},[p,n,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-${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(_,{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=h(e),p=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=p==="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:p}},function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:a,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=V(o.location);return{onApprovalRuleDataUpdated:n=>{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:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(w()),s==="approval_update"||d?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:p}=N(),a=k.getSignedInUser(),u=P(),s=f(r=>h(r)),d=f(r=>A(r)),[n,c]=y.useState(!1);if(y.useEffect(()=>{n||(c(!0),o(W(!0)))}),y.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),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(_,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Z,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:t})}function se(){return l.jsxs(O,{children:[l.jsx(b,{path:"/",element:l.jsx(Y,{})}),l.jsx(b,{path:"/new",element:l.jsx(D,{})}),l.jsx(b,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(b,{path:"*",element:l.jsx(K,{})})]})}export{se as B};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-yYJhhlwl.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-Bycbr_zS.js";import{eN as Z,LA as Ue,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 Oe,LL as ha,LM as ga,xG as Ne,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 Ma,M7 as Ua,cj as $t,cL as Mt,jB as _a,bJ as Ga,bq as Ut,bK as _t,vy as Oa,M8 as Na,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 Ot,k1 as Nt,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-CIfm8mou.js";import{h as me,z as L,j as Ie,a as le,p as y,aJ as Ae,w as re,o as A,y as je,d as D,b5 as $n,r as z,Q as We,s as E,q as we,b6 as rt,b7 as ct,b8 as Mn,ag as Un,F as _n,aD as Gn,C as Zt,D as qe,G as Je,b9 as On,ap as Ht,ba as Nn,M as zn,f 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,$ as ti,bk as ai,b1 as ni,bl as ii,bm as oi,a5 as li}from"./index-CkPLyKrL.js";import{n as M,S as si}from"./mui-uwIb-0_u.js";import{A as dt}from"./AddressScreen-7k7vjaFG.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-D6Fv4KmF.js";import{a as f}from"./sentry-CbgVFeom.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-C7xPewG5.js";import{c as Ye}from"./useFetchSuggestedQuestionsWhenReady-DmtdISaY.js";import{u as Jt}from"./useInitialThreadRequest-DBrdowkN.js";import Ee from"./NotFoundScreen-BnQ9IpWO.js";import{D as ui}from"./DrawerScreen-Dzpv8ixO.js";import{M as Kt}from"./MobileAppDrawer-BsEeVHGJ.js";import{F as Qt}from"./FeaturePreviewScreen-CZ4kSWCz.js";import{S as Pe}from"./SetupPagesScreen-CwdMwDRP.js";import{B as pi}from"./BillPayApprovalRoutes-tYr_9OWR.js";import{FallBackRoute as mi}from"./ScreenRoutes-Ck32XMYo.js";import"./recharts-DgZ04ot6.js";import"./analytics-BMapadfi.js";import"./plaid-BtVuBiv6.js";import"./dnd-Jwp37Hwc.js";import"./stripe-DMRn4zHo.js";import"./lottie-CQftbn5o.js";import"./lexical-BFKF8Nqm.js";import"./pdf-Clano961.js";import"./utils-CUNvYJ5h.js";import"./analyticsHelper-hJglLz67.js";import"./routePaths-CMggNZ1T.js";import"./BusinessVerificationPageScreen-DHwpyl1f.js";import"./ReimbursementApprovalRuleDetailScreen-CEnbrTbv.js";import"./getLocaleForTenant-hR2ZjLdG.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]="94cbfca2-38d5-494a-8a00-be58da16d4fa",e._sentryDebugIdIdentifier="sentry-dbid-94cbfca2-38d5-494a-8a00-be58da16d4fa")}catch{}})();const bi=X(function(e,t){const l=Ue(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(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}=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: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: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(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,$,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: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=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(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=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,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 Y=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(Y??"",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(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(Mn,{}),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(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(Le,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=On();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}
1
+ import{j as a}from"./liveblocks-CF908iAG.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-Cgen4kAj.js";import{eN as Z,LA as Ue,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 Oe,LL as ha,LM as ga,xG as Ne,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 Ma,M7 as Ua,cj as $t,cL as Mt,jB as _a,bJ as Ga,bq as Ut,bK as _t,vy as Oa,M8 as Na,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 Ot,k1 as Nt,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-DrGehtra.js";import{h as me,z as L,j as Ie,a as le,p as y,aJ as Ae,B as re,o as A,A as je,d as D,b5 as $n,n as z,Q as We,s as E,q as we,b6 as rt,b7 as ct,b8 as Mn,ag as Un,G as _n,aD as Gn,F as Zt,D as qe,H as Je,b9 as On,ap as Ht,ba as Nn,M as zn,f 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,v as ti,bk as ai,b1 as ni,bl as ii,bm as oi,a5 as li}from"./index-trlF__w8.js";import{n as M,S as si}from"./mui-C7dUqSqV.js";import{A as dt}from"./AddressScreen-BeHKG8v1.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-BVFVWlSA.js";import{a as f}from"./sentry-cfxuOFew.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-C2mAQ-5p.js";import{c as Ye}from"./useFetchSuggestedQuestionsWhenReady-B5mF_k6O.js";import{u as Jt}from"./useInitialThreadRequest-CME_1dn5.js";import Ee from"./NotFoundScreen-DXPtR234.js";import{D as ui}from"./DrawerScreen-BWViotCB.js";import{M as Kt}from"./MobileAppDrawer-BuQb2buy.js";import{F as Qt}from"./FeaturePreviewScreen-Bu3Nmz6L.js";import{S as Pe}from"./SetupPagesScreen-RaBTeZ3X.js";import{B as pi}from"./BillPayApprovalRoutes-72raP4Au.js";import{FallBackRoute as mi}from"./ScreenRoutes-D3nR_ZAq.js";import"./recharts-Dyhe2tpB.js";import"./analytics-B_uP5uGX.js";import"./plaid-CChs9PMx.js";import"./dnd-DhFfs1wM.js";import"./stripe-DMRn4zHo.js";import"./lottie-Ega9gP0x.js";import"./lexical-DJV7tysr.js";import"./pdf-CSmOdS_B.js";import"./utils-DumEze_M.js";import"./analyticsHelper-CsFRydiU.js";import"./routePaths-CqnfURaJ.js";import"./BusinessVerificationPageScreen-BUCm7Odf.js";import"./ReimbursementApprovalRuleDetailScreen-CErT0hoJ.js";import"./getLocaleForTenant-Di1C7dV7.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]="6fea99ea-feed-497b-a763-fe5fcae4594c",e._sentryDebugIdIdentifier="sentry-dbid-6fea99ea-feed-497b-a763-fe5fcae4594c")}catch{}})();const bi=X(function(e,t){const l=Ue(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(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}=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: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: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(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,$,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: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=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(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=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,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 Y=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(Y??"",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(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(Mn,{}),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(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(Le,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=On();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
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=M.div`
3
3
  margin-bottom: 20px;
4
4
  margin-top: 20px;
@@ -1,4 +1,4 @@
1
- import{j as k}from"./liveblocks-yYJhhlwl.js";import{a as V}from"./sentry-CbgVFeom.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-Bycbr_zS.js";import{j as ce,a as ue,aJ as de,z as E,y as pe,d as M,ab as x,f as z,bu as le,ap as me,s as B,aq as R}from"./index-CkPLyKrL.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-CIfm8mou.js";import{n as Le}from"./mui-uwIb-0_u.js";import{c as U}from"./routePaths-CMggNZ1T.js";import{M as je}from"./MobileAppDrawer-BsEeVHGJ.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]="608465d5-bb6b-4f88-8939-58c66718295e",e._sentryDebugIdIdentifier="sentry-dbid-608465d5-bb6b-4f88-8939-58c66718295e")}catch{}})();const Ue=Le.div`
1
+ import{j as k}from"./liveblocks-CF908iAG.js";import{a as V}from"./sentry-cfxuOFew.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-Cgen4kAj.js";import{j as ce,a as ue,aJ as de,z as E,A as pe,d as M,ab as x,f as z,bu as le,ap as me,s as B,aq as R}from"./index-trlF__w8.js";import{M6 as fe,eN as G,rw as ye,GH as Se,xd as ge,zW as Ie,Ct as he,D6 as be,D$ as De,Mt as Oe,Mu as Te,Mv as ke,Mw as Ce,Mx as Ve,J0 as we,Lv as Ae,Jc as Ne,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-DrGehtra.js";import{n as Le}from"./mui-C7dUqSqV.js";import{c as U}from"./routePaths-CqnfURaJ.js";import{M as je}from"./MobileAppDrawer-BuQb2buy.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]="02e3eed2-6b65-4789-92ad-1fdcc4f55590",e._sentryDebugIdIdentifier="sentry-dbid-02e3eed2-6b65-4789-92ad-1fdcc4f55590")}catch{}})();const Ue=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-yYJhhlwl.js";import{a as V}from"./sentry-CbgVFeo
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: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:A?.selectedOption??"",sourceOfFunds:N?.selectedOption??"",companySubIndustry:_?.selectedOption??"",countriesOfOperations:h?.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: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(j({officers:s}))},onSaveDetailsClick:t=>{e(P(i,t,r))},onSendForVerificationClick:t=>{e(P(i,t,r,!0))},onAddressClick:t=>{const s=U(b,t),p=B(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onRegisteredAddressClick:t=>{const s=U(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(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,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(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};