@zeniai/web-app-ui 5.1.19-qa → 5.1.20-qa

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 (116) hide show
  1. package/dist/assets/AddressRoutes-BXMIlSTb.js +1 -0
  2. package/dist/assets/AddressScreen-CjLQE8F3.js +9 -0
  3. package/dist/assets/{AiCfoScreen-CuzxWz_S.js → AiCfoScreen-COG2flaI.js} +5 -5
  4. package/dist/assets/{BillPayApprovalRoutes-B3t0yngo.js → BillPayApprovalRoutes-cecdJlYU.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-DpbVMcmn.js → BillPayRoutes-CWmCSCXV.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-JQs-1sFZ.js → BusinessVerificationPageScreen-ow69Wdnb.js} +2 -2
  7. package/dist/assets/{ChargeCardRoutes-CDHTUBYy.js → ChargeCardRoutes-BQjkBvaR.js} +10 -10
  8. package/dist/assets/{CompanyPassportScreen-Ch2epTwN.js → CompanyPassportScreen-wGuw6nrC.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-DpRUq6ze.js → ConnectionAuthScreen-BRBF64cO.js} +1 -1
  10. package/dist/assets/CustomerOnboardingAuthScreen-BzDYbX94.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-DcIv-DzY.js → CustomerOnboardingRoutes-DhgfvMTb.js} +4 -4
  12. package/dist/assets/{DashboardRoutes-DxpU77bI.js → DashboardRoutes-B8YORLtS.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-BfT17Gvw.js → DefaultTenantHome-C_SB_0pi.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-avYzSuvB.js → DomesticWireDetailScreen-B0I-XVOq.js} +3 -3
  15. package/dist/assets/DrawerScreen-C28AzR-_.js +1 -0
  16. package/dist/assets/EntityDetailRoutes-DpBE8R0L.js +1 -0
  17. package/dist/assets/{ExpenseAutomationRoutes-BcHDBHiv.js → ExpenseAutomationRoutes-CjvhJSRR.js} +1 -1
  18. package/dist/assets/{FeaturePreviewScreen-BAmTzzrj.js → FeaturePreviewScreen-CNpXIisp.js} +1 -1
  19. package/dist/assets/{HubSpotOAuthCallbackScreen-B23SvUNt.js → HubSpotOAuthCallbackScreen-CtNFNtZf.js} +1 -1
  20. package/dist/assets/MagicLinkRoutes-Ctd9-k7o.js +72 -0
  21. package/dist/assets/MagicLinkSignInScreen-BimKVzfO.js +12 -0
  22. package/dist/assets/{MobileAppDrawer-naJjFnDb.js → MobileAppDrawer-BPTcRRBp.js} +1 -1
  23. package/dist/assets/NotFoundScreen-B__1dupq.js +1 -0
  24. package/dist/assets/{NotificationRoutes-Bq8VJmwT.js → NotificationRoutes-B6VxXPmE.js} +1 -1
  25. package/dist/assets/OAuthConsentScreen-CLwgo45N.js +1 -0
  26. package/dist/assets/{PandLWithForecastRoutes-CDkULALB.js → PandLWithForecastRoutes-BzI7Jnag.js} +1 -1
  27. package/dist/assets/{PeopleRoutes-KHinGLfv.js → PeopleRoutes-HH2apdxr.js} +1 -1
  28. package/dist/assets/PerformanceRoutes-81OvqD2T.js +1 -0
  29. package/dist/assets/{Preview-WyBDjHSN.js → Preview-CVswbusF.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-BEBX4IUV.js → QBOConnectionScreen-1sg28M5z.js} +1 -1
  31. package/dist/assets/ReferralListScreen-CDv4r3zP.js +5 -0
  32. package/dist/assets/{ReimbursementApprovalRoutes-B0rpTNP9.js → ReimbursementApprovalRoutes-DAnacrd-.js} +1 -1
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BCvdld9V.js → ReimbursementApprovalRuleDetailScreen-UB01OSuZ.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-D1EKDj2K.js → ReimbursementRoutes-BudlAJyL.js} +1 -1
  35. package/dist/assets/{ReportsRoutes-DlfuOJMm.js → ReportsRoutes-CWs4_ChN.js} +1 -1
  36. package/dist/assets/RewardsRoutes-BvO8B7Zb.js +1 -0
  37. package/dist/assets/{ScreenRoutes-CPffc7sR.js → ScreenRoutes-zrmKnyw0.js} +2 -2
  38. package/dist/assets/{SettingsRoutes-CSNnKonU.js → SettingsRoutes-BfCDh5la.js} +6 -6
  39. package/dist/assets/{SetupPagesScreen-DhzTJYKJ.js → SetupPagesScreen-CGvclNp8.js} +1 -1
  40. package/dist/assets/{SignInScreen-CsNpygic.js → SignInScreen-C22I5CRo.js} +1 -1
  41. package/dist/assets/{SignOutScreen-BIdV_C0Q.js → SignOutScreen-BToYQbTA.js} +1 -1
  42. package/dist/assets/{TaskListScreen-CbpezfGT.js → TaskListScreen-CPXhJGMg.js} +2 -2
  43. package/dist/assets/{TaskRoutes-CRmENGlB.js → TaskRoutes-D0U1evnV.js} +2 -2
  44. package/dist/assets/{TransactionDetailRoutes-BCi51su3.js → TransactionDetailRoutes-CTPQlClN.js} +1 -1
  45. package/dist/assets/{TransactionDetailScreen-DzFJFnkS.js → TransactionDetailScreen-BMJ9pcvt.js} +2 -2
  46. package/dist/assets/{TransactionListRoutes-Di58L4DD.js → TransactionListRoutes-CKZKgDMw.js} +1 -1
  47. package/dist/assets/TreasuryRoutes-DzeUslRt.js +37 -0
  48. package/dist/assets/{VendorsRoutes-SLQunhqi.js → VendorsRoutes-LEgPzpGO.js} +10 -10
  49. package/dist/assets/WiseConfirmationScreen-Cze1njel.js +12 -0
  50. package/dist/assets/{ZeniAccountRoutes-BfEURRIG.js → ZeniAccountRoutes-CzRdD1-H.js} +9 -9
  51. package/dist/assets/ZeniAccountStatementScreen-LZ2-VOHt.js +9 -0
  52. package/dist/assets/{accountMappingHelper-BN803kfl.js → accountMappingHelper-DSYys5zM.js} +1 -1
  53. package/dist/assets/{analytics-Bt-6aSwp.js → analytics-RHZXXukl.js} +1 -1
  54. package/dist/assets/{analyticsHelper-yc2vJb1S.js → analyticsHelper-B48RdZxU.js} +1 -1
  55. package/dist/assets/{core-DA33MFkN.js → core-Cu9_V7DI.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-Dp2pNC7r.js → decodeURIComponentSafe-DwKi2VH1.js} +1 -1
  57. package/dist/assets/{dnd-vhylj_Eh.js → dnd-cSRmPjhK.js} +1 -1
  58. package/dist/assets/{empty-BkOHZhZ_.js → empty-Dh9k7Mlu.js} +1 -1
  59. package/dist/assets/{empty-C3vQ9p7W.js → empty-H4DS2HhT.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-DqXx_3iz.js → emptyVideoElement-C8hpwYyz.js} +1 -1
  61. package/dist/assets/{epic-DOohCIB-.js → epic-Cf6_0VZK.js} +1 -1
  62. package/dist/assets/getLocaleForTenant-CQ6kIMFQ.js +1 -0
  63. package/dist/assets/{index-B0KYqmOA.js → index-BXA-O4AL.js} +1 -1
  64. package/dist/assets/{index-CAgO0fyi.js → index-BaDODbvC.js} +9900 -9888
  65. package/dist/assets/{index-BIecxFT-.js → index-C7WXzlOi.js} +1 -1
  66. package/dist/assets/{index-BDGZBSxD.js → index-C8Sg0_Jq.js} +1 -1
  67. package/dist/assets/{index-C10P_vbj.js → index-DPX9rfvS.js} +1 -1
  68. package/dist/assets/{index-Dd3yljav.js → index-DrYfTQW_.js} +1 -1
  69. package/dist/assets/{index-CLexxx1X.js → index-J0IBMNGj.js} +1 -1
  70. package/dist/assets/{index-Daus_KEs.js → index-Tpz76u84.js} +2 -2
  71. package/dist/assets/{lexical-CvOa6Yk0.js → lexical-B-UHoQhE.js} +1 -1
  72. package/dist/assets/{liveblocks-DENVUg9q.js → liveblocks-1RWQirWE.js} +1 -1
  73. package/dist/assets/{lottie-BT3ic1mv.js → lottie-qz5T1VFo.js} +1 -1
  74. package/dist/assets/{mui-D6faDY4H.js → mui-D8xl37lU.js} +1 -1
  75. package/dist/assets/{pathToGoBack-Dpj_uhjQ.js → pathToGoBack-CS9uZra5.js} +1 -1
  76. package/dist/assets/{pdf-DcKpVBQA.js → pdf-Dny5wh2o.js} +4 -4
  77. package/dist/assets/{pdf-lib-BChZu1hi.js → pdf-lib-CxZmdrsT.js} +1 -1
  78. package/dist/assets/{plaid-WpCusSjr.js → plaid-CM1lGBpq.js} +1 -1
  79. package/dist/assets/{pusher-BxdG568H.js → pusher-BYJa2T8d.js} +1 -1
  80. package/dist/assets/{react-BIK8RdLM.js → react-B9GoOkzp.js} +1 -1
  81. package/dist/assets/{react-CP7WlKlB.js → react-BbJn2EQe.js} +1 -1
  82. package/dist/assets/{react-cBSmH1hl.js → react-CErU_1yP.js} +1 -1
  83. package/dist/assets/{react-GQ6ntsPB.js → react-CITkb_ne.js} +1 -1
  84. package/dist/assets/{react-CvIqlY8S.js → react-H_61_T3L.js} +1 -1
  85. package/dist/assets/{react-BHVVGiJF.js → react-dY49GOzE.js} +1 -1
  86. package/dist/assets/{recharts-Cqn7-bzR.js → recharts-DFGRflCT.js} +1 -1
  87. package/dist/assets/{routePaths-li_k_voj.js → routePaths-fc5DDlJm.js} +1 -1
  88. package/dist/assets/{sentry-BAjw0qw4.js → sentry-LUgCZnRx.js} +1 -1
  89. package/dist/assets/{url-C_Ezxzjh.js → url-BkSN4Ht6.js} +1 -1
  90. package/dist/assets/{url-Ckuey0dJ.js → url-N3s043Uw.js} +1 -1
  91. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-xRdY9uIS.js → useAiCfoDashboardSuggestedQuestionsChips-BjonjuyY.js} +1 -1
  92. package/dist/assets/useAskAiCfoHostNavButtonProps-BoysBhZD.js +1 -0
  93. package/dist/assets/{useDeviceId-BDljgxSq.js → useDeviceId-Cuegkfr2.js} +1 -1
  94. package/dist/assets/{useInitialThreadRequest-CUw4ci1w.js → useInitialThreadRequest-BggytmMN.js} +1 -1
  95. package/dist/assets/{utils-sY58mrq9.js → utils-C0WjER8w.js} +1 -1
  96. package/dist/assets/{withTransactionSidePanel-Bv5QqHdk.js → withTransactionSidePanel-Cts5wE1j.js} +2 -2
  97. package/dist/assets/{zeni-epic-state-PjsyjhMR.js → zeni-epic-state-C-Iw-Pw8.js} +3 -3
  98. package/dist/index.html +1 -1
  99. package/package.json +2 -2
  100. package/dist/assets/AddressRoutes-BGLDekgt.js +0 -1
  101. package/dist/assets/AddressScreen-DqPYWg9M.js +0 -9
  102. package/dist/assets/CustomerOnboardingAuthScreen-Cx-dvQml.js +0 -1
  103. package/dist/assets/DrawerScreen-B8TxbRqf.js +0 -1
  104. package/dist/assets/EntityDetailRoutes-FF-eobJW.js +0 -1
  105. package/dist/assets/MagicLinkRoutes-CbGsnLVK.js +0 -72
  106. package/dist/assets/MagicLinkSignInScreen-B4sMirTJ.js +0 -12
  107. package/dist/assets/NotFoundScreen-YtiZH5DD.js +0 -1
  108. package/dist/assets/OAuthConsentScreen-D_hYt32m.js +0 -1
  109. package/dist/assets/PerformanceRoutes-CqpQ2aAq.js +0 -1
  110. package/dist/assets/ReferralListScreen-DJHO4P5A.js +0 -5
  111. package/dist/assets/RewardsRoutes-D9uUstPx.js +0 -1
  112. package/dist/assets/TreasuryRoutes-9Ch4Tf-E.js +0 -37
  113. package/dist/assets/WiseConfirmationScreen-BfumPBOp.js +0 -12
  114. package/dist/assets/ZeniAccountStatementScreen-BjghPGLW.js +0 -9
  115. package/dist/assets/getLocaleForTenant-ChawDfM5.js +0 -1
  116. package/dist/assets/useAskAiCfoHostNavButtonProps-Dtxt7fE2.js +0 -1
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-1RWQirWE.js";import{A as d}from"./AddressScreen-CjLQE8F3.js";import i from"./NotFoundScreen-B__1dupq.js";import"./sentry-LUgCZnRx.js";import{o as s,p as r}from"./core-Cu9_V7DI.js";import"./zeni-epic-state-C-Iw-Pw8.js";import"./recharts-DFGRflCT.js";import"./index-BaDODbvC.js";import"./mui-D8xl37lU.js";import"./analytics-RHZXXukl.js";import"./plaid-CM1lGBpq.js";import"./dnd-cSRmPjhK.js";import"./stripe-DMRn4zHo.js";import"./lottie-qz5T1VFo.js";import"./lexical-B-UHoQhE.js";import"./pdf-Dny5wh2o.js";import"./utils-C0WjER8w.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]="4677917c-1bd8-4b00-9bd0-d308073173a3",t._sentryDebugIdIdentifier="sentry-dbid-4677917c-1bd8-4b00-9bd0-d308073173a3")}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-1RWQirWE.js";import{a as h}from"./sentry-LUgCZnRx.js";import{h as T,u as _,g as E,i as j,j as B,n as K}from"./core-Cu9_V7DI.js";import{J as M,h as $,z as D,k as L,B as R,r as z,c as C,e as S,Z as F,i as b,p as N}from"./index-BaDODbvC.js";import{Kd as k,h1 as U,eP as G,Ke as O,c2 as V,Kf as q,km as H}from"./zeni-epic-state-C-Iw-Pw8.js";import{n as J}from"./mui-D8xl37lU.js";import Z from"./NotFoundScreen-B__1dupq.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]="69242fcf-e700-4172-90e5-4fe3af0531f2",e._sentryDebugIdIdentifier="sentry-dbid-69242fcf-e700-4172-90e5-4fe3af0531f2")}catch{}})();const Q=J.div`
2
+ display: flex;
3
+ height: 100vh;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey4};
9
+ `,W=K(function(e,t){const{addressId:o,isSubPage:i,addressType:c}=t,l=G(e),a=t.roleMap!=null&&O(t.roleMap),r=i||c==="user_address"||V(l?.userRole??[])||a?void 0:"readonly";if(o==null){const s=q(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=N(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=X(a);e(H({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)}}})(F);function de({isSubPage:e,hideAddressSubTitle:t=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=T(),r=_(),n=E(),{addressId:s,addressType:u}=j(),f=M(),I=$(),v=D.getSignedInUser(),[g,x]=h.useState(s==null),p=B(m=>s!=null?k(m,s).fetchState:"Not-Started"),A=L();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 h.useEffect(()=>{g||s==null||(x(!0),r(U(s,!1)))},[g,s,r]),y==null||y.match(/(user_address|company_address|company_registered_address|vendor_address|officer_([1-9]|10)_address)$/g)?!g&&p==="Not-Started"||g&&p==="In-Progress"?d.jsx(R,{fetchState:p,style:{backgroundColor:I.colors.grey5}}):s!=null&&p==="Error"?(a(`${w(1)}/new`,{replace:!0}),d.jsx(d.Fragment,{})):d.jsxs(d.Fragment,{children:[d.jsx(z,{analytics:C,onLoad:P}),d.jsx(Q,{windowSize:f,children:d.jsx(W,{location:n,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:t,addressId:s,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:A?.loggedInUserRoleMap})})]}):d.jsx(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{de as A,X as t};
@@ -1,22 +1,22 @@
1
- import{j as c}from"./liveblocks-DENVUg9q.js";import{a as r}from"./sentry-BAjw0qw4.js";import{u as ge,h as Ce,g as Ie,j as Y,i as ke,n as be}from"./core-DA33MFkN.js";import{W as we,z as xe,j as Pe,cR as Ee,cS as Te,b4 as X,cT as ve,b3 as K,p as D,Z as L,c as I,cU as F,cV as ye,cW as Qe,a1 as _e,e as Oe,a7 as Ae,cX as je,a2 as Ue,n as Le,b0 as Fe,cY as Re}from"./index-CAgO0fyi.js";import{fI as De,eO as ee,eP as Be,hH as Me,QY as Ve,eS as Ge,hR as Ne,hN as $e,eQ as R,ft as qe,fm as We,fq as J,fu as He,fv as ze,fw as Ye,fx as Xe,fy as Je}from"./zeni-epic-state-PjsyjhMR.js";import{D as Ze,n as k,S as Ke,P as et}from"./mui-D6faDY4H.js";import{u as tt}from"./useAiCfoDashboardSuggestedQuestionsChips-xRdY9uIS.js";import{p as st}from"./pathToGoBack-Dpj_uhjQ.js";import"./recharts-Cqn7-bzR.js";import"./analytics-Bt-6aSwp.js";import"./plaid-WpCusSjr.js";import"./dnd-vhylj_Eh.js";import"./stripe-DMRn4zHo.js";import"./lottie-BT3ic1mv.js";import"./lexical-CvOa6Yk0.js";import"./pdf-DcKpVBQA.js";import"./utils-sY58mrq9.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new a.Error().stack;i&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[i]="59579dc2-cafd-4f2f-a91f-c13659ca6bd0",a._sentryDebugIdIdentifier="sentry-dbid-59579dc2-cafd-4f2f-a91f-c13659ca6bd0")}catch{}})();const te="chat-response-generated",ot=be(function(a,i){const s=ee(a),m=i.isSubmitting;return{showSampleQuestions:i.sessionFromUrl==="explore"&&s.uiState.currentChatSessionId==null,aiCfoView:s,isSubmitting:m,isNewChatSession:i.sessionFromUrl==="new_chat"||i.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Ue}/tableDownload`,emailLinkQuestion:i.emailLinkQuestion,autoSubmitEmailLinkQuestion:i.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:i.onEmailLinkQuestionProcessed,routedInitialQuestionSource:i.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:i.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:i.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:i.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:i.isFileUploadEnabled,isUploadPromoVisible:i.isUploadPromoVisible,onUploadPromoClose:i.onUploadPromoClose}},function(a,i){const{location:s,currentTenant:m,userId:l,navigate:f,currentChatSessionId:h,allSessionsWithOrderedQuestionAnswers:d,setIsAiCfoOpen:S}=i;return{onEventReceived:(e,p)=>{if(e===te&&typeof p.text=="string"&&typeof p.metadata=="object"){const o=p,u=ze(o.type),t=o.metadata.chat_session_id??null,{currentChatSession:E,currentQuestionAnswer:b,currentQuestionAnswerSummary:T}=K(d,t);u!=="answer"?I.trackAICFOChatResponseGenerated(u,b?.question.questionText??"",o.text,t,Re(T,E),o.metadata.message_id??null):I.trackAICFOChatAnswerGenerated(o.text,b?.question.questionText??"",(o.follow_up_questions?.length??0)>0,!!o.assumptions,!!o.insights,o.visualization!=null,Ye(o.visualization?.type??"")??null,t,o.summarized_title,o.metadata.message_id??null),a(Xe({chatSessionId:o.metadata.chat_session_id,responseType:u,fetchState:{fetchState:"Completed",error:void 0}})),a(Je({chatSessionId:o.metadata.chat_session_id,answerPayload:o,userId:l}))}},onSubmit:(e,p,o,u)=>{e&&Fe(a,e,p,h,d,l,u,o)},updateCurrentInput:e=>{a(J(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{a(He(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{f(-1)},onCloseClick:()=>{const e=D(s.state?.pathnameStackToGoBack),p=e.poppedPathname??st(1);f(p,{state:{...s.state,pathnameStackToGoBack:e.newStack}}),a(J(""))},togglePageView:()=>{const e=D(s.state?.pathnameStackToGoBack),p=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;f(p,{state:{...s.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),S(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{f(-1)},onNewChatClick:()=>{h!=null&&a(We());const e=Le(s.state?.pathnameStackToGoBack,s.pathname);f(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,p)=>{a(qe({questionAnswerId:e,isCollapsed:p}))},onMenuClick:i.onMenuClick}})(Ae(je)),Et=({isFileUploadEnabled:a})=>{const{setIsAiCfoOpen:i}=we(),s=ge(),m=Ce(),l=Ie(),[f,h]=r.useState(!1);r.useEffect(()=>{s(De())},[s]);const d=Y(n=>ee(n)),S=xe.getSignedInUser(),{session_id:e}=ke(),p=Pe(),o=_e(p),u=Y(n=>Be(n)),t=d.uiState.currentChatSessionId,E=u.tenantEmailDomain,{handleUploadPromoClose:b,isUploadPromoVisible:T}=Ee({isFileUploadEnabled:a,tenantEmailDomain:E}),v=Te({currentTenant:u,currentChatSessionId:t,aiCfoView:d}),{isSuggestedQuestionsLoading:se,suggestedPromptQuestions:oe}=tt(),w=l.state,x=w?.aiCfoInitialQuestion,B=!!w?.aiCfoShouldSubmit;r.useEffect(()=>{const n=l.state;if(n?.[X]!==!0)return;h(!0);const g={...n};delete g[X],m(l,{replace:!0,state:g})},[l.pathname,l.search,l.state,m]);const[ae,y]=r.useState(null),[ne,Q]=r.useState(!1),[ie,_]=r.useState(void 0),[re,O]=r.useState(void 0),M=r.useRef(!1);r.useEffect(()=>{if(!M.current&&x!=null&&x!==""){const n=l.state;y(x),Q(B),_(n?.aiCfoInitialSubmissionSource!=null?n.aiCfoInitialSubmissionSource:void 0);const g=n?.aiCfoSuggestionIndex;O(typeof g=="number"?g:void 0),M.current=!0}},[x,B,l.state]);const le=r.useCallback(()=>{y(null),Q(!1),_(void 0),O(void 0)},[]),V=r.useMemo(()=>new URLSearchParams(l.search),[l.search]),G=V.get("ref")??w?.aiCfoRef,A=V.get("emailRefId")??w?.aiCfoEmailRefId,N=r.useRef(!1);r.useEffect(()=>{N.current||G!=="month-end-email"||A==null||t!=null||S==null||(s(Me("controller",S.userId,A,"MONTH_END_EMAIL")),N.current=!0)},[G,A,t,s,S]);const P=d.uiState.lastContextMessage;r.useEffect(()=>{P!=null&&P!==""&&t!=null&&(y(P),Q(!0),_(void 0),O(void 0),s(Ve()))},[P,t,s]);const ce=u.masterTOSInfo,C=ce?.isMasterTOSAccepted??!1,{visitedSessions:$}=ve(t),j=d.fetchState,U=d.uiState.chatSessionsNextPageToken.hasMore||!d.uiState.chatSessionsFirstPageFetched,q=t!=null?d.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",W=t==null||(d.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),H=d.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:ue}=K(H,t),de=ue.length===0;r.useEffect(()=>{C||o||m("../dashboard",{state:{...l.state,message:"open_ai_cfo_drawer"}})},[C,o,m,l.state]);const me=r.useCallback(()=>{const n=D(l.state?.pathnameStackToGoBack),g=u.tenantEmailDomain;m(n.poppedPathname??(g!=null?`/${g}/dashboard`:".."),{state:{...l.state,pathnameStackToGoBack:n.newStack}})},[u.tenantEmailDomain,l.state,m]);r.useEffect(()=>{t!=null&&e!==t&&m(`../ai-cfo/${t}`,{state:{...l.state}})},[t,e]),r.useEffect(()=>{e!=null&&t==null&&e!=="new_chat"&&e!=="explore"&&s(Ge({sessionId:e,agentId:"controller"}))},[]);const pe=r.useMemo(()=>({events:$.map(n=>`private-encrypted-chat-${n}.${te}`),eventCallback:(n,g,Se)=>Se.onEventReceived(n,g)}),[$]);r.useEffect(()=>{j!=="In-Progress"&&U&&s(Ne())},[j,U,s]),r.useEffect(()=>{t!=null&&q!=="In-Progress"&&W&&S!=null&&j==="Completed"&&!U&&s($e(t,S.userId))},[q,W,t,S,s]);const z=n=>n.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(S==null||e==null)throw Error("Can't access AI Controller page without signing in...");const he=t!=null&&d.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";if(!C&&o)return c.jsxs(nt,{children:[c.jsx(L,{analytics:I,onLoad:z}),v.drawerElement,c.jsx(it,{children:c.jsx(Z,{children:c.jsx(F,{isTOSAccepted:!1,acceptMasterTOSState:d.masterTOSAcceptanceState,onCloseClick:me,onCompleteClick:()=>{u.userRoleId!=null&&s(R(u.userRoleId))}})})})]});const fe=c.jsxs(c.Fragment,{children:[f&&!C?c.jsx(L,{analytics:I,onLoad:z}):null,c.jsx(F,{isTOSAccepted:C,acceptMasterTOSState:d.masterTOSAcceptanceState,showHeader:!1,togglePageView:C?()=>h(!1):void 0,onCloseClick:()=>h(!1),onCompleteClick:()=>{C||u.userRoleId==null||s(R(u.userRoleId)),h(!1)}})]});return c.jsxs(c.Fragment,{children:[c.jsxs(at,{children:[c.jsx(L,{analytics:I,onLoad:n=>n.trackPageLoaded(Oe.Event.aiCFOPage)}),o&&v.drawerElement,c.jsx(ot,{...pe,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:H,openOnboardingPage:()=>h(!0),userId:S.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:e,location:l,isSubmitting:he,isEmptyChatWithSession:de,currentTenant:u,emailLinkQuestion:ae??void 0,autoSubmitEmailLinkQuestion:ne,onEmailLinkQuestionProcessed:le,routedInitialQuestionSource:ie,routedInitialQuestionSuggestionIndex:re,onMenuClick:o?v.open:void 0,isFileUploadEnabled:a,isUploadPromoVisible:T,onUploadPromoClose:b,exploreSuggestedPromptQuestions:oe,exploreSuggestedPromptQuestionsLoading:se}),f&&o?c.jsx(Ze,{anchor:"right",open:f,transitionDuration:250,PaperProps:{component:rt,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>h(!1),children:c.jsx(Z,{onClick:n=>n.stopPropagation(),children:c.jsx(F,{isTOSAccepted:C,acceptMasterTOSState:d.masterTOSAcceptanceState,onCloseClick:()=>h(!1),onCompleteClick:()=>{C||u.userRoleId==null||s(R(u.userRoleId)),h(!1)}})})}):null]}),f&&!o?c.jsx(ye,{open:f,onClose:()=>h(!1),children:c.jsx(Qe,{children:fe})}):null]})},Z=k(Ke)`
1
+ import{j as c}from"./liveblocks-1RWQirWE.js";import{a as r}from"./sentry-LUgCZnRx.js";import{u as ge,h as Ce,g as Ie,j as Y,i as be,n as ke}from"./core-Cu9_V7DI.js";import{O as we,z as xe,J as Pe,cR as Ee,cS as Te,b4 as X,cT as ve,b3 as Z,p as D,r as L,c as I,cU as F,cV as ye,cW as Qe,a1 as _e,e as Oe,a7 as Ae,cX as Ue,a2 as je,m as Le,b0 as Fe,cY as Re}from"./index-BaDODbvC.js";import{fI as De,eO as ee,eP as Be,hH as Me,QY as Ve,eS as Ge,hR as Ne,hN as $e,eQ as R,ft as qe,fm as We,fq as J,fu as ze,fv as He,fw as Ye,fx as Xe,fy as Je}from"./zeni-epic-state-C-Iw-Pw8.js";import{D as Ke,n as b,S as Ze,P as et}from"./mui-D8xl37lU.js";import{u as tt}from"./useAiCfoDashboardSuggestedQuestionsChips-BjonjuyY.js";import{p as st}from"./pathToGoBack-CS9uZra5.js";import"./recharts-DFGRflCT.js";import"./analytics-RHZXXukl.js";import"./plaid-CM1lGBpq.js";import"./dnd-cSRmPjhK.js";import"./stripe-DMRn4zHo.js";import"./lottie-qz5T1VFo.js";import"./lexical-B-UHoQhE.js";import"./pdf-Dny5wh2o.js";import"./utils-C0WjER8w.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new a.Error().stack;i&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[i]="50f74dd6-4c70-4421-8526-34dbeadb7206",a._sentryDebugIdIdentifier="sentry-dbid-50f74dd6-4c70-4421-8526-34dbeadb7206")}catch{}})();const te="chat-response-generated",ot=ke(function(a,i){const s=ee(a),m=i.isSubmitting;return{showSampleQuestions:i.sessionFromUrl==="explore"&&s.uiState.currentChatSessionId==null,aiCfoView:s,isSubmitting:m,isNewChatSession:i.sessionFromUrl==="new_chat"||i.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${je}/tableDownload`,emailLinkQuestion:i.emailLinkQuestion,autoSubmitEmailLinkQuestion:i.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:i.onEmailLinkQuestionProcessed,routedInitialQuestionSource:i.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:i.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:i.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:i.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:i.isFileUploadEnabled,isUploadPromoVisible:i.isUploadPromoVisible,onUploadPromoClose:i.onUploadPromoClose}},function(a,i){const{location:s,currentTenant:m,userId:l,navigate:S,currentChatSessionId:h,allSessionsWithOrderedQuestionAnswers:d,setIsAiCfoOpen:f}=i;return{onEventReceived:(e,p)=>{if(e===te&&typeof p.text=="string"&&typeof p.metadata=="object"){const o=p,u=He(o.type),t=o.metadata.chat_session_id??null,{currentChatSession:E,currentQuestionAnswer:k,currentQuestionAnswerSummary:T}=Z(d,t);u!=="answer"?I.trackAICFOChatResponseGenerated(u,k?.question.questionText??"",o.text,t,Re(T,E),o.metadata.message_id??null):I.trackAICFOChatAnswerGenerated(o.text,k?.question.questionText??"",(o.follow_up_questions?.length??0)>0,!!o.assumptions,!!o.insights,o.visualization!=null,Ye(o.visualization?.type??"")??null,t,o.summarized_title,o.metadata.message_id??null),a(Xe({chatSessionId:o.metadata.chat_session_id,responseType:u,fetchState:{fetchState:"Completed",error:void 0}})),a(Je({chatSessionId:o.metadata.chat_session_id,answerPayload:o,userId:l}))}},onSubmit:(e,p,o,u)=>{e&&Fe(a,e,p,h,d,l,u,o)},updateCurrentInput:e=>{a(J(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{a(ze(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{S(-1)},onCloseClick:()=>{const e=D(s.state?.pathnameStackToGoBack),p=e.poppedPathname??st(1);S(p,{state:{...s.state,pathnameStackToGoBack:e.newStack}}),a(J(""))},togglePageView:()=>{const e=D(s.state?.pathnameStackToGoBack),p=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;S(p,{state:{...s.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),f(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{S(-1)},onNewChatClick:()=>{h!=null&&a(We());const e=Le(s.state?.pathnameStackToGoBack,s.pathname);S(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,p)=>{a(qe({questionAnswerId:e,isCollapsed:p}))},onMenuClick:i.onMenuClick}})(Ae(Ue)),Et=({isFileUploadEnabled:a})=>{const{setIsAiCfoOpen:i}=we(),s=ge(),m=Ce(),l=Ie(),[S,h]=r.useState(!1);r.useEffect(()=>{s(De())},[s]);const d=Y(n=>ee(n)),f=xe.getSignedInUser(),{session_id:e}=be(),p=Pe(),o=_e(p),u=Y(n=>Be(n)),t=d.uiState.currentChatSessionId,E=u.tenantEmailDomain,{handleUploadPromoClose:k,isUploadPromoVisible:T}=Ee({isFileUploadEnabled:a,tenantEmailDomain:E}),v=Te({currentTenant:u,currentChatSessionId:t,aiCfoView:d}),{isSuggestedQuestionsLoading:se,suggestedPromptQuestions:oe}=tt(),w=l.state,x=w?.aiCfoInitialQuestion,B=!!w?.aiCfoShouldSubmit;r.useEffect(()=>{const n=l.state;if(n?.[X]!==!0)return;h(!0);const g={...n};delete g[X],m(l,{replace:!0,state:g})},[l.pathname,l.search,l.state,m]);const[ae,y]=r.useState(null),[ne,Q]=r.useState(!1),[ie,_]=r.useState(void 0),[re,O]=r.useState(void 0),M=r.useRef(!1);r.useEffect(()=>{if(!M.current&&x!=null&&x!==""){const n=l.state;y(x),Q(B),_(n?.aiCfoInitialSubmissionSource!=null?n.aiCfoInitialSubmissionSource:void 0);const g=n?.aiCfoSuggestionIndex;O(typeof g=="number"?g:void 0),M.current=!0}},[x,B,l.state]);const le=r.useCallback(()=>{y(null),Q(!1),_(void 0),O(void 0)},[]),V=r.useMemo(()=>new URLSearchParams(l.search),[l.search]),G=V.get("ref")??w?.aiCfoRef,A=V.get("emailRefId")??w?.aiCfoEmailRefId,N=r.useRef(!1);r.useEffect(()=>{N.current||G!=="month-end-email"||A==null||t!=null||f==null||(s(Me("controller",f.userId,A,"MONTH_END_EMAIL")),N.current=!0)},[G,A,t,s,f]);const P=d.uiState.lastContextMessage;r.useEffect(()=>{P!=null&&P!==""&&t!=null&&(y(P),Q(!0),_(void 0),O(void 0),s(Ve()))},[P,t,s]);const ce=u.masterTOSInfo,C=ce?.isMasterTOSAccepted??!1,{visitedSessions:$}=ve(t),U=d.fetchState,j=d.uiState.chatSessionsNextPageToken.hasMore||!d.uiState.chatSessionsFirstPageFetched,q=t!=null?d.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",W=t==null||(d.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),z=d.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:ue}=Z(z,t),de=ue.length===0;r.useEffect(()=>{C||o||m("../dashboard",{state:{...l.state,message:"open_ai_cfo_drawer"}})},[C,o,m,l.state]);const me=r.useCallback(()=>{const n=D(l.state?.pathnameStackToGoBack),g=u.tenantEmailDomain;m(n.poppedPathname??(g!=null?`/${g}/dashboard`:".."),{state:{...l.state,pathnameStackToGoBack:n.newStack}})},[u.tenantEmailDomain,l.state,m]);r.useEffect(()=>{t!=null&&e!==t&&m(`../ai-cfo/${t}`,{state:{...l.state}})},[t,e]),r.useEffect(()=>{e!=null&&t==null&&e!=="new_chat"&&e!=="explore"&&s(Ge({sessionId:e,agentId:"controller"}))},[]);const pe=r.useMemo(()=>({events:$.map(n=>`private-encrypted-chat-${n}.${te}`),eventCallback:(n,g,fe)=>fe.onEventReceived(n,g)}),[$]);r.useEffect(()=>{U!=="In-Progress"&&j&&s(Ne())},[U,j,s]),r.useEffect(()=>{t!=null&&q!=="In-Progress"&&W&&f!=null&&U==="Completed"&&!j&&s($e(t,f.userId))},[q,W,t,f,s]);const H=n=>n.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(f==null||e==null)throw Error("Can't access AI Controller page without signing in...");const he=t!=null&&d.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";if(!C&&o)return c.jsxs(nt,{children:[c.jsx(L,{analytics:I,onLoad:H}),v.drawerElement,c.jsx(it,{children:c.jsx(K,{children:c.jsx(F,{isTOSAccepted:!1,acceptMasterTOSState:d.masterTOSAcceptanceState,onCloseClick:me,onCompleteClick:()=>{u.userRoleId!=null&&s(R(u.userRoleId))}})})})]});const Se=c.jsxs(c.Fragment,{children:[S&&!C?c.jsx(L,{analytics:I,onLoad:H}):null,c.jsx(F,{isTOSAccepted:C,acceptMasterTOSState:d.masterTOSAcceptanceState,showHeader:!1,togglePageView:C?()=>h(!1):void 0,onCloseClick:()=>h(!1),onCompleteClick:()=>{C||u.userRoleId==null||s(R(u.userRoleId)),h(!1)}})]});return c.jsxs(c.Fragment,{children:[c.jsxs(at,{children:[c.jsx(L,{analytics:I,onLoad:n=>n.trackPageLoaded(Oe.Event.aiCFOPage)}),o&&v.drawerElement,c.jsx(ot,{...pe,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:z,openOnboardingPage:()=>h(!0),userId:f.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:e,location:l,isSubmitting:he,isEmptyChatWithSession:de,currentTenant:u,emailLinkQuestion:ae??void 0,autoSubmitEmailLinkQuestion:ne,onEmailLinkQuestionProcessed:le,routedInitialQuestionSource:ie,routedInitialQuestionSuggestionIndex:re,onMenuClick:o?v.open:void 0,isFileUploadEnabled:a,isUploadPromoVisible:T,onUploadPromoClose:k,exploreSuggestedPromptQuestions:oe,exploreSuggestedPromptQuestionsLoading:se}),S&&o?c.jsx(Ke,{anchor:"right",open:S,transitionDuration:250,PaperProps:{component:rt,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>h(!1),children:c.jsx(K,{onClick:n=>n.stopPropagation(),children:c.jsx(F,{isTOSAccepted:C,acceptMasterTOSState:d.masterTOSAcceptanceState,onCloseClick:()=>h(!1),onCompleteClick:()=>{C||u.userRoleId==null||s(R(u.userRoleId)),h(!1)}})})}):null]}),S&&!o?c.jsx(ye,{open:S,onClose:()=>h(!1),children:c.jsx(Qe,{children:Se})}):null]})},K=b(Ze)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
5
- `,at=k.div`
5
+ `,at=b.div`
6
6
  height: 100vh;
7
7
  width: 100%;
8
- `,nt=k.div`
8
+ `,nt=b.div`
9
9
  height: 100vh;
10
10
  width: 100%;
11
11
  display: flex;
12
12
  flex-direction: column;
13
13
  min-height: 0;
14
- `,it=k.div`
14
+ `,it=b.div`
15
15
  flex: 1;
16
16
  min-height: 0;
17
17
  display: flex;
18
18
  flex-direction: column;
19
- `,rt=k(et)`
19
+ `,rt=b(et)`
20
20
  box-shadow: ${({theme:a})=>a.colors.elevation2};
21
21
  color: ${({theme:a})=>a.colors.grey4};
22
22
  `;export{Et as default};
@@ -1 +1 @@
1
- import{j as l}from"./liveblocks-DENVUg9q.js";import{a as f}from"./sentry-BAjw0qw4.js";import{h as U,g as B,u as j,j as v,N,n as T,i as $,o as O,p as h}from"./core-DA33MFkN.js";import{eP as F,Nw as R,Nc as b,xW as x,xQ as L,xU as w,xJ as W,Ne as q,xM as z,xY as G,xX as C}from"./zeni-epic-state-PjsyjhMR.js";import{h as P,z as k,B as V,a7 as J,bF as M,af as _,bG as Q}from"./index-CAgO0fyi.js";import"./mui-D6faDY4H.js";import{i as X}from"./ReimbursementApprovalRuleDetailScreen-BCvdld9V.js";import Y from"./NotFoundScreen-YtiZH5DD.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]="ed366604-6900-4a1e-9dde-fc51de552f4a",e._sentryDebugIdIdentifier="sentry-dbid-ed366604-6900-4a1e-9dde-fc51de552f4a")}catch{}})();const I="bill-approval-rule-update",H=T(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(I)&&e(q(!1))},onBackClick:()=>{_(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(W(a))},onEditRuleClick:a=>{a!=null?(e(w(a)),t(`./${a}/edit`)):(e(w()),t("./new"))}}})(J(M)),K=()=>{const e=U(),o=B(),t=j(),[p,a]=f.useState(!1),[u,s]=f.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>F(i)),r=v(i=>R(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(f.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(x())},[g]),f.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(L(!0)))},[p,n,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");f.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(w())),e("./new"))},[u,r,t]);const y={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${I}`]:[],eventCallback:(i,A,m)=>{i.endsWith(I)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx(N,{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(H,{currentTenant:c,location:o,navigate:e,...y})},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=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(y=>{const i=y.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),A=y.actors.selectedNonUsers.map(S=>{const E=!!X(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),m=i.concat(A);g.push({action:y.stepType.selectedOption,actors:m,operator:m.length>1?y.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(x()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(x()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(G())},onSaveRuleSuccess:()=>{t("../")}}})(Q);function D(){const e=U(),o=j(),t=B(),{approvalRuleId:p}=$(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>R(r)),[n,c]=f.useState(!1);if(f.useEffect(()=>{n||(c(!0),o(z(!0)))}),f.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(V,{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(K,{})}),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(Y,{})})]})}export{se as B};
1
+ import{j as l}from"./liveblocks-1RWQirWE.js";import{a as f}from"./sentry-LUgCZnRx.js";import{h as U,g as B,u as j,j as v,N,n as T,i as $,o as O,p as h}from"./core-Cu9_V7DI.js";import{eP as F,Nw as R,Nc as b,xW as x,xQ as L,xU as w,xJ as W,Ne as q,xM as z,xY as G,xX as C}from"./zeni-epic-state-C-Iw-Pw8.js";import{h as P,z as k,B as V,a7 as J,bF as M,af as _,bG as Q}from"./index-BaDODbvC.js";import"./mui-D8xl37lU.js";import{i as X}from"./ReimbursementApprovalRuleDetailScreen-UB01OSuZ.js";import Y from"./NotFoundScreen-B__1dupq.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]="ed366604-6900-4a1e-9dde-fc51de552f4a",e._sentryDebugIdIdentifier="sentry-dbid-ed366604-6900-4a1e-9dde-fc51de552f4a")}catch{}})();const I="bill-approval-rule-update",H=T(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(I)&&e(q(!1))},onBackClick:()=>{_(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(W(a))},onEditRuleClick:a=>{a!=null?(e(w(a)),t(`./${a}/edit`)):(e(w()),t("./new"))}}})(J(M)),K=()=>{const e=U(),o=B(),t=j(),[p,a]=f.useState(!1),[u,s]=f.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>F(i)),r=v(i=>R(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(f.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(x())},[g]),f.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(L(!0)))},[p,n,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");f.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(w())),e("./new"))},[u,r,t]);const y={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${I}`]:[],eventCallback:(i,A,m)=>{i.endsWith(I)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx(N,{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(H,{currentTenant:c,location:o,navigate:e,...y})},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=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(y=>{const i=y.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),A=y.actors.selectedNonUsers.map(S=>{const E=!!X(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),m=i.concat(A);g.push({action:y.stepType.selectedOption,actors:m,operator:m.length>1?y.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(x()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(x()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(G())},onSaveRuleSuccess:()=>{t("../")}}})(Q);function D(){const e=U(),o=j(),t=B(),{approvalRuleId:p}=$(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>R(r)),[n,c]=f.useState(!1);if(f.useEffect(()=>{n||(c(!0),o(z(!0)))}),f.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(V,{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(K,{})}),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(Y,{})})]})}export{se as B};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-DENVUg9q.js";import{h as Y,u as se,g as J,i as ae,j as v,N as te,n as X,l as na,o as ia,p as S}from"./core-DA33MFkN.js";import{eP as Z,MO as _e,bt as It,HI as oa,bo as wt,bF as pe,MP as xt,xe as Ct,yo as $e,xN as la,bn as De,MQ as sa,MR as ra,c2 as ca,MS as da,jG as Bt,MT as At,MU as Et,yZ as Le,xt as Be,MV as ua,x2 as tt,MW as pa,C9 as ma,x6 as ba,xc as Dt,MX as ke,MY as Me,yp as Ge,MZ as ha,M_ as ga,ys as Oe,M$ as ya,yF as Sa,N0 as jt,y9 as at,ye as fa,N1 as ka,N2 as ue,N3 as Tt,N4 as Pt,N5 as Ft,fM as va,xy as Ne,cx as Rt,N6 as Ia,gT as wa,N7 as xa,N8 as Ca,e_ as Vt,eY as $t,N9 as ze,Na as Ba,Nb as Aa,Kx as Ze,Nc as Ea,Ky as oe,Kz as He,Nd as Da,Ne as ja,Nf as Ta,yg as nt,yd as Pa,Ng as Fa,Nh as Ra,Ni as Va,x$ as $a,Nj as Na,Nk as Ua,Nl as _a,cl as Nt,cM as Ut,jR as La,bL as Ma,bq as _t,bM as Lt,wk as Ga,Nm as Oa,BY as za,C2 as Za,sR as Ha,yq as Wa,z4 as qa,k2 as fe,Nn as Ka,No as Mt,kw as Ya,jY as Gt,kh as Ot,kg as it,bE as be,bK as Ja,Np as Xa,Nq as ve,iB as Qa,Nr as ot,Ns as en,iF as tn,i_ as an,zi as nn,Nt as on,kp as ln,z8 as sn,Nu as lt,zc as rn,zh as cn,ze as dn,z6 as un,Nv as zt,xn as pn,Nw as mn,Nx as bn,fE as hn,fD as gn,fC as yn,k5 as Sn,kn as st,ky as fn,qo as kn,ke as vn,za as In,iL as wn,kD as xn,Ny as Cn,iD as Bn,qf as An,Nz as En,y5 as Dn,bG as jn,bs as Tn,Js as Pn,cO as Fn,cN as Rn,cw as Vn,cC as $n}from"./zeni-epic-state-PjsyjhMR.js";import{h as me,z as V,k as Ie,_ as We,v as le,I as y,aN as Ae,B as re,o as A,Z as je,c as D,bc as Nn,p as z,a2 as qe,n as E,j as we,bd as rt,be as ct,bf as Un,ak as _n,y as Ln,aH as Mn,w as Zt,D as Ke,C as Ye,bg as Gn,at as Ht,bh as On,X as zn,e as Wt,a7 as Zn,bi as Hn,bj as Wn,bk as qn,bl as Kn,bm as Yn,bn as Jn,bo as Xn,bp as Qn,bq as ei,O as ti,br as ai,b7 as ni,bs as ii,bt as oi,a9 as li}from"./index-CAgO0fyi.js";import{n as U,S as si}from"./mui-D6faDY4H.js";import{A as dt}from"./AddressScreen-DqPYWg9M.js";import{g as ie,a as Te,i as qt,V as Je,b as Xe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-avYzSuvB.js";import{a as f}from"./sentry-BAjw0qw4.js";import{u as Qe}from"./useAskAiCfoHostNavButtonProps-Dtxt7fE2.js";import{u as Kt}from"./useInitialThreadRequest-CUw4ci1w.js";import Ee from"./NotFoundScreen-YtiZH5DD.js";import{D as ui}from"./DrawerScreen-B8TxbRqf.js";import{M as Yt}from"./MobileAppDrawer-naJjFnDb.js";import{F as Jt}from"./FeaturePreviewScreen-BAmTzzrj.js";import{S as Pe}from"./SetupPagesScreen-DhzTJYKJ.js";import{B as pi}from"./BillPayApprovalRoutes-B3t0yngo.js";import{FallBackRoute as mi}from"./ScreenRoutes-CPffc7sR.js";import"./recharts-Cqn7-bzR.js";import"./analytics-Bt-6aSwp.js";import"./plaid-WpCusSjr.js";import"./dnd-vhylj_Eh.js";import"./stripe-DMRn4zHo.js";import"./lottie-BT3ic1mv.js";import"./lexical-CvOa6Yk0.js";import"./pdf-DcKpVBQA.js";import"./utils-sY58mrq9.js";import"./analyticsHelper-yc2vJb1S.js";import"./routePaths-li_k_voj.js";import"./BusinessVerificationPageScreen-JQs-1sFZ.js";import"./ReimbursementApprovalRuleDetailScreen-BCvdld9V.js";import"./getLocaleForTenant-ChawDfM5.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]="44c70d37-0020-4d83-87fa-55773b4c7f59",e._sentryDebugIdIdentifier="sentry-dbid-44c70d37-0020-4d83-87fa-55773b4c7f59")}catch{}})();const bi=X(function(e,t){const l=_e(e,t.billId),i=V.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:Bt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/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(Be(l,"retry")):e(Be(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(Be(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(Le(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(At({billId:l}))}}})(Nn);function hi(){const e=Y(),t=se(),l=J(),{billId:i}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=v(G=>Z(G)),s=v(G=>_e(G,i??"")),n=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Kt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!n}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Qe({mobileExploreReferrer:"Bill Details"});We({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),[C,L]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:_}=le(),{isFeatureEnabled:$}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:M}=_(Ae.zeniAssistConfig),B=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),N=M.user_ids!=null&&r?.userId!=null&&M.user_ids.includes(r?.userId),{isFeatureEnabled:K}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Q}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&B===!1?L(!1):L(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(G=>G.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,B,r]),f.useEffect(()=>{i!=null&&t(xt(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Ct(i??"",$,N,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(x(!0),t($e(!1,$,N,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:G=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(G)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:C,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:K,hasZeniAssistAccess:N,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=Ke.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=X(function(e,t){const l=V.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=V.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(Ge(i))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Mn);function w({appContent:e}){const t=se(),l=Y(),{billId:i}=ae(),c=J(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=V.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)),[C,L]=f.useState(!1),[T,_]=f.useState(!1),[$,I]=f.useState(!1),[H,M]=f.useState(),B=v(F=>Me(F,m,g,i));let q=B.fetchState,W=B.file,N=B.showAutofill;const K=v(F=>_e(F,i??""));u===!1&&(q=K.fetchState,W=K.transactionDetails?.attachments?.[0],N=!1);const Q=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{i==null&&t(Ge(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?_(!1):!u&&C&&L(!1))},[i]),f.useEffect(()=>{C||i==null||u||(L(!0),t(Ct(i,h,j,!1)),T||(_(!0),t($e(!1,h,j,b,i)))),u&&!T&&(_(!0),t($e(!1,h,j,b,i)))},[C,T,u,i,t]);const G={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(Oe(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"||K.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:B.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:M,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:Q}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||N?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(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:i==null})})]});{const F=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[N&&o!=="small"?a.jsx(mt,{}):null,$?a.jsx(_n,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:G,isEditPopup:!0}):null,o==="small"||N?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:N,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,K,B),setShowConfirmationPopup:I,setPayload:M,showActionButtons:fi(u,B),isInitialEdit:!!B.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=Gn();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-1RWQirWE.js";import{h as Y,u as se,g as J,i as ae,j as v,N as te,n as X,l as na,o as ia,p as S}from"./core-Cu9_V7DI.js";import{eP as Z,MO as _e,bt as It,HI as oa,bo as wt,bF as pe,MP as xt,xe as Ct,yo as $e,xN as la,bn as De,MQ as sa,MR as ra,c2 as ca,MS as da,jG as Bt,MT as At,MU as Et,yZ as Le,xt as Be,MV as ua,x2 as tt,MW as pa,C9 as ma,x6 as ba,xc as Dt,MX as ke,MY as Me,yp as Ge,MZ as ha,M_ as ga,ys as Oe,M$ as ya,yF as Sa,N0 as jt,y9 as at,ye as fa,N1 as ka,N2 as ue,N3 as Tt,N4 as Pt,N5 as Ft,fM as va,xy as Ne,cx as Rt,N6 as Ia,gT as wa,N7 as xa,N8 as Ca,e_ as Vt,eY as $t,N9 as ze,Na as Ba,Nb as Aa,Kx as Ze,Nc as Ea,Ky as oe,Kz as He,Nd as Da,Ne as ja,Nf as Ta,yg as nt,yd as Pa,Ng as Fa,Nh as Ra,Ni as Va,x$ as $a,Nj as Na,Nk as Ua,Nl as _a,cl as Nt,cM as Ut,jR as La,bL as Ma,bq as _t,bM as Lt,wk as Ga,Nm as Oa,BY as za,C2 as Za,sR as Ha,yq as Wa,z4 as qa,k2 as fe,Nn as Ka,No as Mt,kw as Ya,jY as Gt,kh as Ot,kg as it,bE as be,bK as Ja,Np as Xa,Nq as ve,iB as Qa,Nr as ot,Ns as en,iF as tn,i_ as an,zi as nn,Nt as on,kp as ln,z8 as sn,Nu as lt,zc as rn,zh as cn,ze as dn,z6 as un,Nv as zt,xn as pn,Nw as mn,Nx as bn,fE as hn,fD as gn,fC as yn,k5 as Sn,kn as st,ky as fn,qo as kn,ke as vn,za as In,iL as wn,kD as xn,Ny as Cn,iD as Bn,qf as An,Nz as En,y5 as Dn,bG as jn,bs as Tn,Js as Pn,cO as Fn,cN as Rn,cw as Vn,cC as $n}from"./zeni-epic-state-C-Iw-Pw8.js";import{h as me,z as V,k as Ie,_ as We,v as le,T as y,aN as Ae,B as re,o as A,r as je,c as D,bc as Nn,p as z,a2 as qe,m as E,J as we,bd as rt,be as ct,bf as Un,ak as _n,y as Ln,aH as Mn,x as Zt,D as Ke,A as Ye,bg as Gn,at as Ht,bh as On,X as zn,e as Wt,a7 as Zn,bi as Hn,bj as Wn,bk as qn,bl as Kn,bm as Yn,bn as Jn,bo as Xn,bp as Qn,bq as ei,n as ti,br as ai,b7 as ni,bs as ii,bt as oi,a9 as li}from"./index-BaDODbvC.js";import{n as U,S as si}from"./mui-D8xl37lU.js";import{A as dt}from"./AddressScreen-CjLQE8F3.js";import{g as ie,a as Te,i as qt,V as Je,b as Xe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-B0I-XVOq.js";import{a as f}from"./sentry-LUgCZnRx.js";import{u as Qe}from"./useAskAiCfoHostNavButtonProps-BoysBhZD.js";import{u as Kt}from"./useInitialThreadRequest-BggytmMN.js";import Ee from"./NotFoundScreen-B__1dupq.js";import{D as ui}from"./DrawerScreen-C28AzR-_.js";import{M as Yt}from"./MobileAppDrawer-BPTcRRBp.js";import{F as Jt}from"./FeaturePreviewScreen-CNpXIisp.js";import{S as Pe}from"./SetupPagesScreen-CGvclNp8.js";import{B as pi}from"./BillPayApprovalRoutes-cecdJlYU.js";import{FallBackRoute as mi}from"./ScreenRoutes-zrmKnyw0.js";import"./recharts-DFGRflCT.js";import"./analytics-RHZXXukl.js";import"./plaid-CM1lGBpq.js";import"./dnd-cSRmPjhK.js";import"./stripe-DMRn4zHo.js";import"./lottie-qz5T1VFo.js";import"./lexical-B-UHoQhE.js";import"./pdf-Dny5wh2o.js";import"./utils-C0WjER8w.js";import"./analyticsHelper-B48RdZxU.js";import"./routePaths-fc5DDlJm.js";import"./BusinessVerificationPageScreen-ow69Wdnb.js";import"./ReimbursementApprovalRuleDetailScreen-UB01OSuZ.js";import"./getLocaleForTenant-CQ6kIMFQ.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]="9824e10d-4d54-4dc7-ae3f-50cc6efa2949",e._sentryDebugIdIdentifier="sentry-dbid-9824e10d-4d54-4dc7-ae3f-50cc6efa2949")}catch{}})();const bi=X(function(e,t){const l=_e(e,t.billId),i=V.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:Bt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/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(Be(l,"retry")):e(Be(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(Be(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(Le(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(At({billId:l}))}}})(Nn);function hi(){const e=Y(),t=se(),l=J(),{billId:i}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=v(G=>Z(G)),s=v(G=>_e(G,i??"")),n=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Kt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!n}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Qe({mobileExploreReferrer:"Bill Details"});We({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),[C,L]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:_}=le(),{isFeatureEnabled:$}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:M}=_(Ae.zeniAssistConfig),B=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),N=M.user_ids!=null&&r?.userId!=null&&M.user_ids.includes(r?.userId),{isFeatureEnabled:K}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Q}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&B===!1?L(!1):L(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(G=>G.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,B,r]),f.useEffect(()=>{i!=null&&t(xt(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Ct(i??"",$,N,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(x(!0),t($e(!1,$,N,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:G=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(G)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:C,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:K,hasZeniAssistAccess:N,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=Ke.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=X(function(e,t){const l=V.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=V.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(Ge(i))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Mn);function w({appContent:e}){const t=se(),l=Y(),{billId:i}=ae(),c=J(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=V.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)),[C,L]=f.useState(!1),[T,_]=f.useState(!1),[$,I]=f.useState(!1),[H,M]=f.useState(),B=v(F=>Me(F,m,g,i));let q=B.fetchState,W=B.file,N=B.showAutofill;const K=v(F=>_e(F,i??""));u===!1&&(q=K.fetchState,W=K.transactionDetails?.attachments?.[0],N=!1);const Q=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{i==null&&t(Ge(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?_(!1):!u&&C&&L(!1))},[i]),f.useEffect(()=>{C||i==null||u||(L(!0),t(Ct(i,h,j,!1)),T||(_(!0),t($e(!1,h,j,b,i)))),u&&!T&&(_(!0),t($e(!1,h,j,b,i)))},[C,T,u,i,t]);const G={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(Oe(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"||K.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:B.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:M,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:Q}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||N?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(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:i==null})})]});{const F=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[N&&o!=="small"?a.jsx(mt,{}):null,$?a.jsx(_n,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:G,isEditPopup:!0}):null,o==="small"||N?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:N,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,K,B),setShowConfirmationPopup:I,setPayload:M,showActionButtons:fi(u,B),isInitialEdit:!!B.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=Gn();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=U.div`
3
3
  margin-bottom: 20px;
4
4
  margin-top: 20px;
@@ -1,4 +1,4 @@
1
- import{j as T}from"./liveblocks-DENVUg9q.js";import{a as N}from"./sentry-BAjw0qw4.js";import{h as ae,g as ne,u as se,i as ie,j as C,N as oe,n as re}from"./core-DA33MFkN.js";import{k as ce,v as ue,aN as de,z as B,Z as pe,c as z,af as x,e as E,bB as le,at as me,n as P,au as M}from"./index-CAgO0fyi.js";import{Nk as fe,eP as q,sg as ye,HM as Se,x$ as ge,AI as Ie,Df as he,DU as be,EN as De,NH as ke,NI as Oe,NJ as Te,NK as Ce,NL as Ne,Ke as Ve,MJ as we,Kq as Ae,km as _e,fE as ve,fD as Fe,fC as xe,qo as Ee,qf as Be,qc as ze,ke as Pe,sp as Me,sn as R,bE as L,sB as U,cv as Re}from"./zeni-epic-state-PjsyjhMR.js";import{n as Le}from"./mui-D6faDY4H.js";import{d as j}from"./routePaths-li_k_voj.js";import{M as Ue}from"./MobileAppDrawer-naJjFnDb.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]="c7c5382a-a931-40c0-9ee7-4bf173fa8744",e._sentryDebugIdIdentifier="sentry-dbid-c7c5382a-a931-40c0-9ee7-4bf173fa8744")}catch{}})();const je=Le.div`
1
+ import{j as T}from"./liveblocks-1RWQirWE.js";import{a as N}from"./sentry-LUgCZnRx.js";import{h as ae,g as ne,u as se,i as ie,j as C,N as oe,n as re}from"./core-Cu9_V7DI.js";import{k as ce,v as ue,aN as de,z as B,r as pe,c as z,af as x,e as E,bB as le,at as me,m as P,au as M}from"./index-BaDODbvC.js";import{Nk as fe,eP as q,sg as ye,HM as Se,x$ as ge,AI as Ie,Df as be,DU as he,EN as De,NH as ke,NI as Oe,NJ as Te,NK as Ce,NL as Ne,Ke as Ve,MJ as we,Kq as Ae,km as _e,fE as ve,fD as Fe,fC as xe,qo as Ee,qf as Be,qc as ze,ke as Pe,sp as Me,sn as R,bE as L,sB as U,cv as Re}from"./zeni-epic-state-C-Iw-Pw8.js";import{n as Le}from"./mui-D8xl37lU.js";import{d as j}from"./routePaths-fc5DDlJm.js";import{M as Ue}from"./MobileAppDrawer-BPTcRRBp.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]="2f50f9c5-43a2-4427-b2d9-a29bbe8ffee1",e._sentryDebugIdIdentifier="sentry-dbid-2f50f9c5-43a2-4427-b2d9-a29bbe8ffee1")}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 T}from"./liveblocks-DENVUg9q.js";import{a as N}from"./sentry-BAjw0qw
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,qe=re(function(e,d){const{businessVerificationDetails:i}=d,r=q(e),y=B.getSignedInUser(),S=r.tenantId,l={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},b=Ve(d.roleMap)&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",t=we(e.companyConfigState),s=Ae(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:k,companyLegalName:O,companyTaxId:g,companyWebsite:m,companyPhone:I,primaryContactEmail:c,primaryContactName:n,primaryContactUserId:u,primaryContactSyncToken:D,syncToken:f,fileIds:a,incDate:o,typeOfIncorporation:V,stateOfIncorporation:w,sourceOfFunds:A,companySubIndustry:_,countriesOfOperations:h,companySourceOfFunds:G,companySourceOfFundsDescription:K,transactionVolume:Z,transactionVolumeDescription:$,purposeOfAccount:H,purposeOfAccountDescription:J,regulatedStatus:W,regulatedStatusDescription:Q,usNexus:X,usNexusTypes:Y}=t,v=k?.selectedOption,ee={companyId:i,companyDescription:s,companyIndustry:p.selectedOption,companyIndustryType:v==null||v===""?void 0:v,companyLegalName:O,taxIdOrEIN:g,website:m!=""&&m!=null?Re(m):void 0,phone:I,syncToken:f,fileIds:a,incDate:o!=null?L(o?.toString()):o,typeOfIncorporation:V?.selectedOption??"",stateOfIncorporation:w?.selectedOption??"",sourceOfFunds:A?.selectedOption??"",companySubIndustry:_?.selectedOption??"",countriesOfOperations:h?.selectedOptions.map(F=>F.length===2?F:M(F))??[],companySourceOfFunds:G?.selectedOption??"",companySourceOfFundsDescription:K,transactionVolume:Z?.selectedOption??"",transactionVolumeDescription:$,purposeOfAccount:H?.selectedOption??"",purposeOfAccountDescription:J,regulatedStatus:W??"",regulatedStatusDescription:Q,usNexus:X,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:k,userId:O,name:g,email:m,nationalityCountryCode:I,ssn:c,dob:n,phone:u,syncToken:D,selectDocument:f,role:a,ownership:o,isSelectedForVerification:V,userVerificationStatus:w,treasuryUserVerificationStatus:A,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:k,userId:O,firstName:g.firstName,lastName:g.lastName,email:m,ssn:c,nationalityCountryCode:I?.selectedOption!=null?M(I.selectedOption):void 0,phone:u,birthday:n!=null?L(n?.toString()):n,syncToken:D,titleAtCompany:a.selectedOption,ownershipInCompany:o,documentTypeSelectedForVerification:h,isSelectedForVerification:V,userVerificationStatus:w,treasuryUserVerificationStatus:A,fileIds:_,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(U({officers:s}))},onSaveDetailsClick:t=>{e(R(i,t,r))},onSendForVerificationClick:t=>{e(R(i,t,r,!0))},onAddressClick:t=>{const s=j(b,t),p=P(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onRegisteredAddressClick:t=>{const s=j(b,t),p=P(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onBackClick:()=>{e(Me({companyId:i})),S("../setup")},updateFilesEntity:t=>{e(Pe({files:t}))},onDeleteFile:t=>{e(ze(t))},onDeleteFileList:t=>{e(Be(t))},onEditFileName:(t,s)=>{e(Ee(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]=N.useState(!1),[l,b]=N.useState(!1),{tenantEmailDomain:t}=ie(),s=ce(),{useDynamicConfig:p}=ue(),{configValue:k}=p(de.zeniAccountsConfig),O=fe(k),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=>q(a)),n=c.companyId??B.getSignedInUserTenant(t)?.companyId;if(N.useEffect(()=>{m==="Not-Started"&&r(ye()),I==="Not-Started"&&r(Se(!0))},[m,I,r]),N.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]),B.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=Ne(a,n);break;case"zeni_treasury":o=Ce(a,n);break;case"charge_cards":o=Te(a,n);break;case"reimbursement":o=Oe(a,n);break;default:o=ke(a,n)}return o});return u===!1?T.jsx(oe,{to:"../promo"}):T.jsxs(je,{children:[T.jsx(pe,{analytics:z,onLoad:a=>(o=>{switch(e){case"zeni_accounts":return o.trackPageLoaded(E.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return o.trackPageLoaded(E.Event.reimbursementBusinessVerification);default:return o.trackPageLoaded(E.Event.billPayBusinessVerification,x(i)?"Settings":void 0)}})(a)}),x(i)?T.jsx(Ue,{isAppContentDrawerOpen:l,handleDrawerToggle:D}):null,T.jsx(qe,{businessVerificationDetails:f,navigate:d,location:i,companyId:n,analytics:z,currentTenant:c,productType:e,isSettings:x(i),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{D(!0)},maxInsuredAmount:O.maxInsuredAmount})]})};export{Xe as B};
9
+ `,qe=re(function(e,d){const{businessVerificationDetails:i}=d,r=q(e),y=B.getSignedInUser(),S=r.tenantId,l={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},h=Ve(d.roleMap)&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",t=we(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:k,companyLegalName:O,companyTaxId:g,companyWebsite:m,companyPhone:I,primaryContactEmail:c,primaryContactName:n,primaryContactUserId:u,primaryContactSyncToken:D,syncToken:f,fileIds:a,incDate:o,typeOfIncorporation:V,stateOfIncorporation:w,sourceOfFunds:A,companySubIndustry:_,countriesOfOperations:b,companySourceOfFunds:G,companySourceOfFundsDescription:K,transactionVolume:$,transactionVolumeDescription:H,purposeOfAccount:J,purposeOfAccountDescription:Z,regulatedStatus:W,regulatedStatusDescription:Q,usNexus:X,usNexusTypes:Y}=t,v=k?.selectedOption,ee={companyId:i,companyDescription:s,companyIndustry:p.selectedOption,companyIndustryType:v==null||v===""?void 0:v,companyLegalName:O,taxIdOrEIN:g,website:m!=""&&m!=null?Re(m):void 0,phone:I,syncToken:f,fileIds:a,incDate:o!=null?L(o?.toString()):o,typeOfIncorporation:V?.selectedOption??"",stateOfIncorporation:w?.selectedOption??"",sourceOfFunds:A?.selectedOption??"",companySubIndustry:_?.selectedOption??"",countriesOfOperations:b?.selectedOptions.map(F=>F.length===2?F:M(F))??[],companySourceOfFunds:G?.selectedOption??"",companySourceOfFundsDescription:K,transactionVolume:$?.selectedOption??"",transactionVolumeDescription:H,purposeOfAccount:J?.selectedOption??"",purposeOfAccountDescription:Z,regulatedStatus:W??"",regulatedStatusDescription:Q,usNexus:X,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:k,userId:O,name:g,email:m,nationalityCountryCode:I,ssn:c,dob:n,phone:u,syncToken:D,selectDocument:f,role:a,ownership:o,isSelectedForVerification:V,userVerificationStatus:w,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:k,userId:O,firstName:g.firstName,lastName:g.lastName,email:m,ssn:c,nationalityCountryCode:I?.selectedOption!=null?M(I.selectedOption):void 0,phone:u,birthday:n!=null?L(n?.toString()):n,syncToken:D,titleAtCompany:a.selectedOption,ownershipInCompany:o,documentTypeSelectedForVerification:b,isSelectedForVerification:V,userVerificationStatus:w,treasuryUserVerificationStatus:A,fileIds:_,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(U({officers:s}))},onSaveDetailsClick:t=>{e(R(i,t,r))},onSendForVerificationClick:t=>{e(R(i,t,r,!0))},onAddressClick:t=>{const s=j(h,t),p=P(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onRegisteredAddressClick:t=>{const s=j(h,t),p=P(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onBackClick:()=>{e(Me({companyId:i})),S("../setup")},updateFilesEntity:t=>{e(Pe({files:t}))},onDeleteFile:t=>{e(ze(t))},onDeleteFileList:t=>{e(Be(t))},onEditFileName:(t,s)=>{e(Ee(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]=N.useState(!1),[l,h]=N.useState(!1),{tenantEmailDomain:t}=ie(),s=ce(),{useDynamicConfig:p}=ue(),{configValue:k}=p(de.zeniAccountsConfig),O=fe(k),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=>q(a)),n=c.companyId??B.getSignedInUserTenant(t)?.companyId;if(N.useEffect(()=>{m==="Not-Started"&&r(ye()),I==="Not-Started"&&r(Se(!0))},[m,I,r]),N.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]),B.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=Ne(a,n);break;case"zeni_treasury":o=Ce(a,n);break;case"charge_cards":o=Te(a,n);break;case"reimbursement":o=Oe(a,n);break;default:o=ke(a,n)}return o});return u===!1?T.jsx(oe,{to:"../promo"}):T.jsxs(je,{children:[T.jsx(pe,{analytics:z,onLoad:a=>(o=>{switch(e){case"zeni_accounts":return o.trackPageLoaded(E.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return o.trackPageLoaded(E.Event.reimbursementBusinessVerification);default:return o.trackPageLoaded(E.Event.billPayBusinessVerification,x(i)?"Settings":void 0)}})(a)}),x(i)?T.jsx(Ue,{isAppContentDrawerOpen:l,handleDrawerToggle:D}):null,T.jsx(qe,{businessVerificationDetails:f,navigate:d,location:i,companyId:n,analytics:z,currentTenant:c,productType:e,isSettings:x(i),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{D(!0)},maxInsuredAmount:O.maxInsuredAmount})]})};export{Xe as B};