@zeniai/web-app-ui 5.0.47-dev → 5.0.48-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.
- package/dist/assets/AddressRoutes-g_S9tXfT.js +1 -0
- package/dist/assets/AddressScreen-C2Pdt_bq.js +9 -0
- package/dist/assets/{AiCfoScreen-Dy0ngxwx.js → AiCfoScreen-Bpnjeq7V.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-CrCZo1WX.js → BillPayApprovalRoutes-WIACRA6B.js} +1 -1
- package/dist/assets/{BillPayRoutes-DDyHfonl.js → BillPayRoutes-Cl3RqP7N.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-BxjaxZuH.js → BusinessVerificationPageScreen-BaDjUQw1.js} +2 -2
- package/dist/assets/{ChargeCardRoutes-DcpKBVQT.js → ChargeCardRoutes-CC5bDkHl.js} +8 -8
- package/dist/assets/{CompanyPassportScreen-CgW1dnJn.js → CompanyPassportScreen-DSjn5RV_.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-vMZLkcV3.js → ConnectionAuthScreen-BmM-FOt_.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-D6Wjhidr.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-s988saQL.js → CustomerOnboardingRoutes-B3jdgE0f.js} +3 -3
- package/dist/assets/{DashboardRoutes-DgnDAkL_.js → DashboardRoutes-DdT_Y42s.js} +3 -3
- package/dist/assets/{DefaultTenantHome-B-SHxqLQ.js → DefaultTenantHome-DamwtKVm.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-Dq7eTlwY.js +18 -0
- package/dist/assets/DrawerScreen-CZJI9dis.js +1 -0
- package/dist/assets/{EntityDetailRoutes-BAhm1zeL.js → EntityDetailRoutes-CCZjRoaK.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-Cvu7HEu6.js → ExpenseAutomationRoutes-C0g_h5Bq.js} +4 -4
- package/dist/assets/FeaturePreviewScreen-Dtyet701.js +1 -0
- package/dist/assets/MagicLinkRoutes-OTGKhSFN.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-DVEUwpX5.js +12 -0
- package/dist/assets/{MobileAppDrawer-Ef3X4Fzb.js → MobileAppDrawer-D25b_bdO.js} +1 -1
- package/dist/assets/NotFoundScreen-C_R6jGEp.js +1 -0
- package/dist/assets/{NotificationRoutes-DpwexPtm.js → NotificationRoutes-BoTdon-B.js} +1 -1
- package/dist/assets/PandLWithForecastRoutes-B2ImYfbh.js +1 -0
- package/dist/assets/PeopleRoutes-CVo7q-3K.js +22 -0
- package/dist/assets/PerformanceRoutes-CEQsEs7o.js +1 -0
- package/dist/assets/{Preview-2vVFFBSj.js → Preview-Unt76wQt.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-BoiMcDVw.js → QBOConnectionScreen-CgvXukjZ.js} +1 -1
- package/dist/assets/{ReferralListScreen-CgXmj7hx.js → ReferralListScreen-2ts8iKsm.js} +2 -2
- package/dist/assets/ReimbursementApprovalRoutes-SIsIp9uZ.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DuEXG3jm.js → ReimbursementApprovalRuleDetailScreen-EvJFbHZ_.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-Cr6PauNV.js → ReimbursementRoutes-Ddbd312R.js} +4 -4
- package/dist/assets/{ReportsRoutes-ByfZTDNw.js → ReportsRoutes-Cy_IpMxr.js} +1 -1
- package/dist/assets/RewardsRoutes-BYadKe9G.js +1 -0
- package/dist/assets/ScreenRoutes-bFwU6xQj.js +2 -0
- package/dist/assets/{SettingsRoutes-CbDRobln.js → SettingsRoutes-n0JcYOBn.js} +7 -7
- package/dist/assets/{SetupPagesScreen-CPo2z27i.js → SetupPagesScreen-BUHI1NUC.js} +5 -5
- package/dist/assets/SignInScreen-D17U0n02.js +1 -0
- package/dist/assets/SignOutScreen--k3X_izn.js +9 -0
- package/dist/assets/{TaskListScreen-BipSwck5.js → TaskListScreen-CzZw-t2z.js} +2 -2
- package/dist/assets/TaskRoutes-CRYjlzbB.js +9 -0
- package/dist/assets/TransactionDetailRoutes-BTWL8leD.js +1 -0
- package/dist/assets/{TransactionDetailScreen-D-otE4g5.js → TransactionDetailScreen-Cn7pRp3Q.js} +2 -2
- package/dist/assets/{TransactionListRoutes-BSLYVfPM.js → TransactionListRoutes-D12F9dhf.js} +1 -1
- package/dist/assets/TreasuryRoutes-BUlDXs_P.js +37 -0
- package/dist/assets/{VendorsRoutes-C2vY3MKD.js → VendorsRoutes-CD5smolJ.js} +1 -1
- package/dist/assets/WiseConfirmationScreen-DPEiJ8-l.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-g-O0oc6j.js → ZeniAccountRoutes-DcXqQtKj.js} +10 -10
- package/dist/assets/ZeniAccountStatementScreen-BuItZxm7.js +9 -0
- package/dist/assets/{accountMappingHelper-CTC7-Kd6.js → accountMappingHelper-CHBH046Z.js} +1 -1
- package/dist/assets/{analytics-BhR0Eyx_.js → analytics-CjaLm2aW.js} +1 -1
- package/dist/assets/{analyticsHelper-D1nvm2nR.js → analyticsHelper-CN7Nq3lV.js} +1 -1
- package/dist/assets/{core-Cdq60qo2.js → core-CNW5dhSg.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-CW5UPx0X.js → decodeURIComponentSafe-B2xCvVcj.js} +1 -1
- package/dist/assets/{dnd-C5mFjQbz.js → dnd-ClE4Qbeo.js} +1 -1
- package/dist/assets/{empty-B3ZLFVLQ.js → empty-Cv4UzZSs.js} +1 -1
- package/dist/assets/{empty-C5iQh14-.js → empty-CzR1IqVo.js} +1 -1
- package/dist/assets/{emptyVideoElement-CyORVf3h.js → emptyVideoElement-BfLoCNri.js} +1 -1
- package/dist/assets/{epic-697N7A8N.js → epic-lJxVH4pZ.js} +1 -1
- package/dist/assets/{getLocaleForTenant-C91rVEZw.js → getLocaleForTenant-BfZYl7x_.js} +1 -1
- package/dist/assets/{index-CVO4xqoT.js → index-2XXzCcMZ.js} +1 -1
- package/dist/assets/{index-Dw56iIWa.js → index-B3PgHzaN.js} +1 -1
- package/dist/assets/{index-BeeMx9t-.js → index-CloG9Nyt.js} +1 -1
- package/dist/assets/{index-g11nC_Lx.js → index-Cme59vnn.js} +1 -1
- package/dist/assets/{index-BpWzrs9H.js → index-D49e6fWF.js} +659 -659
- package/dist/assets/{index-DL9i_A6L.js → index-VPfWeHIr.js} +1 -1
- package/dist/assets/{index-Cm6YydAV.js → index-xdNu2kl-.js} +2 -2
- package/dist/assets/{lexical-BCj3da1v.js → lexical-DEVzuyw-.js} +1 -1
- package/dist/assets/{liveblocks-hpnVVVlc.js → liveblocks-BDeoGIJv.js} +1 -1
- package/dist/assets/{lottie-BtCtoFeH.js → lottie-CQ8A0eX4.js} +1 -1
- package/dist/assets/{mui-ynECkfLu.js → mui-B2x4GL6c.js} +1 -1
- package/dist/assets/{pathToGoBack-Dl7WmWMw.js → pathToGoBack-BIOg1-1o.js} +1 -1
- package/dist/assets/{pdf-BKaKF43v.js → pdf-BMb5In2P.js} +4 -4
- package/dist/assets/{pdf-lib-Kcy49ZfF.js → pdf-lib-C4_ugcOf.js} +1 -1
- package/dist/assets/{plaid-DidRbURA.js → plaid-HF30yiu5.js} +1 -1
- package/dist/assets/{pusher-CRjYpoam.js → pusher-DH-SktSp.js} +1 -1
- package/dist/assets/{react-DOR-QNER.js → react-8CEPj-fD.js} +1 -1
- package/dist/assets/{react-Bb67b7tr.js → react-BM3p6urJ.js} +1 -1
- package/dist/assets/{react-bZnNcLQg.js → react-CEJ6LOB9.js} +1 -1
- package/dist/assets/{react-tihBNw6z.js → react-ChWdjMb7.js} +1 -1
- package/dist/assets/{react-7a-xd53W.js → react-TPqJ8Ki2.js} +1 -1
- package/dist/assets/{react-BK7JpOvV.js → react-WbcpzszY.js} +1 -1
- package/dist/assets/{recharts-BbQNhA0n.js → recharts-BNFkXXxt.js} +1 -1
- package/dist/assets/{routePaths-CEq58Kqb.js → routePaths-CISchqL4.js} +1 -1
- package/dist/assets/{sentry-DH_qeXRn.js → sentry-DjiAD8iq.js} +1 -1
- package/dist/assets/{url-DlxL7dTF.js → url-DtTK63_K.js} +1 -1
- package/dist/assets/{url-xCGw-jZA.js → url-o9f2bKFL.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-Dg-8Yu9N.js +1 -0
- package/dist/assets/{useDeviceId-CbDi43uB.js → useDeviceId-BaDJArGA.js} +1 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-BIyPKoCX.js +1 -0
- package/dist/assets/{useInitialThreadRequest-BsvgUZ_f.js → useInitialThreadRequest-D5k70f5t.js} +1 -1
- package/dist/assets/{utils-DPwnlBkL.js → utils-C3tzQnc0.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-DSJCzv5s.js → withTransactionSidePanel-Crse1y6I.js} +3 -3
- package/dist/assets/{zeni-epic-state-tV-RqOC7.js → zeni-epic-state-km4S-bKq.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +2 -2
- package/dist/assets/AddressRoutes-BTIgEg1I.js +0 -1
- package/dist/assets/AddressScreen-DAL5Az_Z.js +0 -9
- package/dist/assets/CustomerOnboardingAuthScreen-C0xXMmiA.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-DKXGDxWF.js +0 -18
- package/dist/assets/DrawerScreen-AXCzDhaS.js +0 -1
- package/dist/assets/FeaturePreviewScreen-C8oMq2By.js +0 -1
- package/dist/assets/MagicLinkRoutes-Yal2u-FN.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-DpljhnkP.js +0 -12
- package/dist/assets/NotFoundScreen-BOhSaXME.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-CjMFWB8-.js +0 -1
- package/dist/assets/PeopleRoutes-Bv48H8wa.js +0 -22
- package/dist/assets/PerformanceRoutes-C0DL6Aeh.js +0 -1
- package/dist/assets/ReimbursementApprovalRoutes-Dq0uaU6m.js +0 -1
- package/dist/assets/RewardsRoutes-DdkLhl3B.js +0 -1
- package/dist/assets/ScreenRoutes-B46DorqW.js +0 -2
- package/dist/assets/SignInScreen-CcJpX9CN.js +0 -1
- package/dist/assets/SignOutScreen-Dsz2CBS2.js +0 -9
- package/dist/assets/TaskRoutes-DSMjOI4m.js +0 -9
- package/dist/assets/TransactionDetailRoutes-Ci36YcTC.js +0 -1
- package/dist/assets/TreasuryRoutes-C4mJxe9d.js +0 -37
- package/dist/assets/WiseConfirmationScreen-C5inuoOH.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-CJ-wpZji.js +0 -9
- package/dist/assets/useAskAiCfoHostNavButtonProps-CQV6us3b.js +0 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-B23baiex.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-BDeoGIJv.js";import{A as d}from"./AddressScreen-C2Pdt_bq.js";import i from"./NotFoundScreen-C_R6jGEp.js";import"./sentry-DjiAD8iq.js";import{n as s,o as r}from"./core-CNW5dhSg.js";import"./zeni-epic-state-km4S-bKq.js";import"./recharts-BNFkXXxt.js";import"./index-D49e6fWF.js";import"./mui-B2x4GL6c.js";import"./analytics-CjaLm2aW.js";import"./plaid-HF30yiu5.js";import"./dnd-ClE4Qbeo.js";import"./stripe-DMRn4zHo.js";import"./lottie-CQ8A0eX4.js";import"./lexical-DEVzuyw-.js";import"./pdf-BMb5In2P.js";import"./utils-C3tzQnc0.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-BDeoGIJv.js";import{a as h}from"./sentry-DjiAD8iq.js";import{j as T,h as _,u as j,l as E,g as B,k as M}from"./core-CNW5dhSg.js";import{q as $,h as D,z as L,A as K,B as N,x as J,e as C,g as m,n as z,k as b,p as F}from"./index-D49e6fWF.js";import{J0 as k,gN as R,eN as U,J1 as q,c0 as G,J2 as O,k7 as V}from"./zeni-epic-state-km4S-bKq.js";import{n as H}from"./mui-B2x4GL6c.js";import Q from"./NotFoundScreen-C_R6jGEp.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]="c1fa4f97-aa98-4831-929c-ac2927df04fb",e._sentryDebugIdIdentifier="sentry-dbid-c1fa4f97-aa98-4831-929c-ac2927df04fb")}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=U(e),a=t.roleMap!=null&&q(t.roleMap),r=i||c==="user_address"||G(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=$(),x=D(),I=L.getSignedInUser(),[g,v]=h.useState(s==null),p=B(S=>s!=null?k(S,s).fetchState:"Not-Started"),A=K();if(I==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(R(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:x.colors.grey5}}):s!=null&&p==="Error"?(a(`${w(1)}/new`,{replace:!0}),d.jsx(d.Fragment,{})):d.jsxs(d.Fragment,{children:[d.jsx(J,{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:A?.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-
|
|
1
|
+
import{j as h}from"./liveblocks-BDeoGIJv.js";import{a as r}from"./sentry-DjiAD8iq.js";import{h as oe,j as ne,u as ie,g as j,l as re,k as le}from"./core-CNW5dhSg.js";import{I as ce,cF as ue,z as de,q as me,cG as pe,cH as fe,cI as he,cJ as q,x as Se,e as v,M as G,cK as ge,cL as Ce,g as be,a1 as ke,cM as we,N as Ie,s as Ee,p as V,aX as Pe,cN as Te}from"./index-D49e6fWF.js";import{fE as ye,f3 as H,eN as _e,hr as xe,Py as ve,eM as Ue,hB as Ae,hx as Qe,fu as Oe,fo as Fe,fh as De,fl as $,fp as Le,fq as Me,fr as Be,fs as Ne,ft as Re}from"./zeni-epic-state-km4S-bKq.js";import{D as je,n as U,P as Ge,S as Ve}from"./mui-B2x4GL6c.js";import{p as $e}from"./pathToGoBack-BIOg1-1o.js";import"./recharts-BNFkXXxt.js";import"./analytics-CjaLm2aW.js";import"./plaid-HF30yiu5.js";import"./dnd-ClE4Qbeo.js";import"./stripe-DMRn4zHo.js";import"./lottie-CQ8A0eX4.js";import"./lexical-DEVzuyw-.js";import"./pdf-BMb5In2P.js";import"./utils-C3tzQnc0.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]="e74f6a35-5dce-48a0-b6b6-24ba6eb877ea",s._sentryDebugIdIdentifier="sentry-dbid-e74f6a35-5dce-48a0-b6b6-24ba6eb877ea")}catch{}})();const W="chat-response-generated",qe=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=Me(n.type),t=n.metadata.chat_session_id??null,{currentChatSession:I,currentQuestionAnswer:g,currentQuestionAnswerSummary:E}=q(S,t);c!=="answer"?v.trackAICFOChatResponseGenerated(c,g?.question.questionText??"",n.text,t,Te(E,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(Ne({chatSessionId:n.metadata.chat_session_id,responseType:c,fetchState:{fetchState:"Completed",error:void 0}})),s(Re({chatSessionId:n.metadata.chat_session_id,answerPayload:n,userId:d}))}},onSubmit:(e,o,n,c)=>{e&&Pe(s,e,o,f,S,d,c,n)},updateCurrentInput:e=>{s($(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{s(Le(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{p(-1)},onCloseClick:()=>{const e=V(a.state?.pathnameStackToGoBack),o=e.poppedPathname??$e(1);p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack}}),s($(""))},togglePageView:()=>{const e=V(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(De());const e=Ee(a.state?.pathnameStackToGoBack,a.pathname);p(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{s(Fe({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:E}=pe({isFileUploadEnabled:s,tenantEmailDomain:I}),A=fe({currentTenant:c,currentChatSessionId:t,aiCfoView:l}),C=d.state,b=C?.aiCfoInitialQuestion,Q=!!C?.aiCfoShouldSubmit,[z,P]=r.useState(null),[J,T]=r.useState(!1),O=r.useRef(!1);r.useEffect(()=>{O.current||b==null||b===""||(P(b),T(Q),O.current=!0)},[b,Q]);const K=r.useCallback(()=>{P(null),T(!1)},[]),F=r.useMemo(()=>new URLSearchParams(d.search),[d.search]),D=F.get("ref")??C?.aiCfoRef,y=F.get("emailRefId")??C?.aiCfoEmailRefId,L=r.useRef(!1);r.useEffect(()=>{L.current||D!=="month-end-email"||y==null||t!=null||e==null||(a(xe("controller",e.userId,y,"MONTH_END_EMAIL")),L.current=!0)},[D,y,t,a,e]);const k=l.uiState.lastContextMessage;r.useEffect(()=>{k!=null&&k!==""&&t!=null&&(P(k),T(!0),a(ve()))},[k,t,a]);const X=c.masterTOSInfo,w=X?.isMasterTOSAccepted??!1,{visitedSessions:M}=he(t),_=l.fetchState,x=l.uiState.chatSessionsNextPageToken.hasMore||!l.uiState.chatSessionsFirstPageFetched,B=t!=null?l.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",N=t==null||(l.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),R=l.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:Y}=q(R,t),Z=Y.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:M.map(u=>`private-chat-${u}.${W}`),eventCallback:(u,se,ae)=>ae.onEventReceived(u,se)}),[M]);if(r.useEffect(()=>{_!=="In-Progress"&&x&&a(Ae())},[_,x,a]),r.useEffect(()=>{t!=null&&B!=="In-Progress"&&N&&e!=null&&_==="Completed"&&!x&&a(Qe(t,e.userId))},[B,N,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)}),G(n)&&A.drawerElement,h.jsx(qe,{...ee,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:R,openOnboardingPage:()=>f(!0),userId:e.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:o,location:d,isSubmitting:te,isEmptyChatWithSession:Z,customPageTitle:S,currentTenant:c,emailLinkQuestion:z??void 0,autoSubmitEmailLinkQuestion:J,onEmailLinkQuestionProcessed:K,onMenuClick:G(n)?A.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:E,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(Oe(c.userRoleId)),f(!1)}})})})]})},He=U(Ve)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-
|
|
1
|
+
import{j as l}from"./liveblocks-BDeoGIJv.js";import{a as y}from"./sentry-DjiAD8iq.js";import{j as B,u as U,h as j,g as v,N as $,k as T,l as N,n as O,o as h}from"./core-CNW5dhSg.js";import{eN as L,Mj as A,L$ as b,x9 as w,x3 as F,x7 as x,wY as M,M1 as W,w$ as q,xb as z,xa as C}from"./zeni-epic-state-km4S-bKq.js";import{h as P,z as k,B as V,a1 as Y,bx as G,aa as _,by as H}from"./index-D49e6fWF.js";import"./mui-B2x4GL6c.js";import{i as J}from"./ReimbursementApprovalRuleDetailScreen-EvJFbHZ_.js";import K from"./NotFoundScreen-C_R6jGEp.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]="da225e2a-cb3c-4443-84b7-ce29c94436cf",e._sentryDebugIdIdentifier="sentry-dbid-da225e2a-cb3c-4443-84b7-ce29c94436cf")}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(W(!1))},onBackClick:()=>{_(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(M(a))},onEditRuleClick:a=>{a!=null?(e(x(a)),t(`./${a}/edit`)):(e(x()),t("./new"))}}})(Y(G)),X=()=>{const e=B(),o=U(),t=j(),[p,a]=y.useState(!1),[u,s]=y.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>L(i)),r=v(i=>A(i)),g=v(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 f={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(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(Q,{currentTenant:c,location:o,navigate:e,...f})},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(f=>{const i=f.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),R=f.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:f.stepType.selectedOption,actors:m,operator:m.length>1?f.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(w()),s==="approval_update"||d?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(z())},onSaveRuleSuccess:()=>{t("../")}}})(H);function D(){const e=B(),o=j(),t=U(),{approvalRuleId:p}=N(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>A(r)),[n,c]=y.useState(!1);if(y.useEffect(()=>{n||(c(!0),o(q(!0)))}),y.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),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(X,{})}),l.jsx(h,{path:"/new",element:l.jsx(D,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(h,{path:"*",element:l.jsx(K,{})})]})}export{se as B};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-hpnVVVlc.js";import{j as K,h as re,u as Q,l as te,g as k,N as ee,k as X,i as la,n as sa,o as y}from"./core-Cdq60qo2.js";import{eN as Z,LB as Ge,bv as At,GE as ra,bo as xt,bD as pe,LC as Bt,wt as Et,xD as Ue,x0 as ca,bn as je,LD as da,LE as ua,c0 as pa,LF as ma,jr as Dt,LG as jt,LH as Tt,yc as Oe,wI as Be,LI as ba,wh as it,LJ as ha,Bo as ga,wl as Sa,wr as Pt,LK as Ie,LL as Ne,xE as ze,LM as ya,LN as fa,xH as Ze,LO as Ia,xU as ka,LP as Ft,xo as ot,xt as va,LQ as wa,LR as ue,LS as Rt,LT as Lt,LU as Vt,fI as Ca,wN as Me,cv as $t,LV as Aa,gD as xa,LW as Ba,LX as Ea,eT as Ut,eR as Mt,LY as He,LZ as Da,L_ as ja,Jk as We,L$ as Ta,Jl as ie,Jm as qe,M0 as Pa,M1 as Fa,M2 as Ra,xv as lt,xs as La,M3 as Va,M4 as $a,M5 as Ua,xe as Ma,M6 as _a,M7 as Ga,M8 as Oa,cj as _t,cL as Gt,jC as Na,bJ as za,bq as Ot,bK as Nt,vz as Za,M9 as Ha,Bb as Wa,Bh as qa,s6 as Ja,xF as Ka,yj as Qa,jP as fe,Ma as Xa,Mb as zt,kh as Ya,jJ as Zt,k2 as Ht,k1 as st,bC as be,bI as en,Mc as tn,Md as ke,il as an,Me as rt,Mf as nn,iq as on,iL as ln,yx as sn,Mg as rn,ka as cn,yn as dn,Mh as ct,yr as un,yw as pn,yt as mn,yl as bn,Mi as Wt,wC as hn,Mj as gn,Mk as Sn,fA as yn,fz as fn,fy as In,jS as kn,k8 as dt,kj as vn,pF as wn,j$ as Cn,yp as An,iw as xn,ko as Bn,Ml as En,io as Dn,pw as jn,Mm as Tn,xk as Pn,bE as Fn,bs as Rn,Il as Ln,cN as Vn,cM as $n,cu as Un,cA as Mn}from"./zeni-epic-state-tV-RqOC7.js";import{h as me,z as L,A as ve,J as Je,a as oe,d as S,aI as Ee,x as ce,o as E,y as Te,e as j,b4 as _n,p as z,O as Ke,s as D,k as we,b5 as ut,b6 as pt,b7 as Gn,af as On,H as Nn,aC as zn,F as qt,D as Qe,U as Xe,b8 as Zn,ao as Jt,b9 as Hn,K as Wn,g as Kt,a1 as qn,ba as Jn,bb as Kn,bc as Qn,bd as Xn,be as Yn,bf as ei,bg as ti,bh as ai,bi as ni,w as ii,bj as oi,b0 as li,bk as si,bl as ri,a4 as ci}from"./index-BpWzrs9H.js";import{n as V,S as di}from"./mui-ynECkfLu.js";import{A as mt}from"./AddressScreen-DAL5Az_Z.js";import{g as ne,a as Pe,i as Qt,V as Ye,b as et,c as ui,v as pi,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-DKXGDxWF.js";import{a as f}from"./sentry-DH_qeXRn.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-CQV6us3b.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-B23baiex.js";import{u as Xt}from"./useInitialThreadRequest-BsvgUZ_f.js";import De from"./NotFoundScreen-BOhSaXME.js";import{D as bi}from"./DrawerScreen-AXCzDhaS.js";import{M as Yt}from"./MobileAppDrawer-Ef3X4Fzb.js";import{F as ea}from"./FeaturePreviewScreen-C8oMq2By.js";import{S as Re}from"./SetupPagesScreen-CPo2z27i.js";import{B as hi}from"./BillPayApprovalRoutes-CrCZo1WX.js";import{FallBackRoute as gi}from"./ScreenRoutes-B46DorqW.js";import"./recharts-BbQNhA0n.js";import"./analytics-BhR0Eyx_.js";import"./plaid-DidRbURA.js";import"./dnd-C5mFjQbz.js";import"./stripe-DMRn4zHo.js";import"./lottie-BtCtoFeH.js";import"./lexical-BCj3da1v.js";import"./pdf-BKaKF43v.js";import"./utils-DPwnlBkL.js";import"./analyticsHelper-D1nvm2nR.js";import"./routePaths-CEq58Kqb.js";import"./BusinessVerificationPageScreen-BxjaxZuH.js";import"./ReimbursementApprovalRuleDetailScreen-DuEXG3jm.js";import"./getLocaleForTenant-C91rVEZw.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]="3dd7438c-d2e7-4d2e-8843-4ed9007893fa",e._sentryDebugIdIdentifier="sentry-dbid-3dd7438c-d2e7-4d2e-8843-4ed9007893fa")}catch{}})();const Si=X(function(e,t){const l=Ge(e,t.billId),n=L.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},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 i=je(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,ua(t.currentTenant),n);d=m,p=b}const h=pa(t.currentTenant?.userRole??[]),g=l.transactionDetails!=null&&ma(l.transactionDetails,h,n);return{billDetails:l,isAccountingClassesEnabled:Dt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:h,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ne(u),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Ie({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Pt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(Sa(l,s))},onSaveRealTimeApprovals:o=>{e(ga(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ha({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(it(l,o.type,"")):e(it(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Pe(u,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ba({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Tt({data:i,billId:l})),e(Oe(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(_n);function yi(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=L.getSignedInUser(),u=ve(),o=k(w=>Z(w)),s=k(w=>Ge(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Xt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoOpen:p,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:p,setIsAiCfoOpen:h,mobileExploreReferrer:"Bill Details"});at({isDataReady:s.fetchState==="Completed"});const b=o?.userRole!=null&&At(o?.userRole),A=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b,[T,I]=f.useState(!1),[v,H]=f.useState(!1),[M,_]=f.useState(!1),{useFeatureGate:F,useDynamicConfig:x}=oe(),{isFeatureEnabled:$}=F(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=F(S.isBillPayCommentingEnabled),{isFeatureEnabled:B}=F(S.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=x(Ee.zeniAssistConfig),W=ra(o),q=xt(o.userRole),J=A&&pe(u?.loggedInUserRoleMap),G=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(S.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=F(S.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&W===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||J||s.allApprovers.find(w=>w.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,J,o.isZeni,W,r]),f.useEffect(()=>{n!=null&&t(Bt(n))},[n]),f.useEffect(()=>{T||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(I(!0),t(Et(n??"",$,G,!1)))},[T,s,n,t]),f.useEffect(()=>{v||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,G,Y,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(ca()))},[v,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(ee,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(ce,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${E.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:w=>(se=>{n!=null&&se.trackBillPayBillDetails(n,s.isRecurring)})(w)}),a.jsx(Si,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:U,isRealTimeApprovalEnabled:M,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:G,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const Se=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=X(function(e,t){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Jt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:j,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:E.sp10,paddingRight:E.sp3,paddingBottom:"15px",paddingLeft:E.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=L.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ze(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(ka({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(ze(n))},onDeleteClick:()=>{e(Ia({billId:t.billId})),j?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(zn);function C({appContent:e}){const t=re(),l=K(),{billId:n}=te(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=oe(),{isFeatureEnabled:h}=d(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(S.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(S.billPaySetupShowInternationalPaymentByWise),{configValue:A}=p(Ee.zeniAssistConfig),T=A.user_ids!=null&&i?.userId!=null&&A.user_ids.includes(i?.userId),I=k(w=>Z(w)),[v,H]=f.useState(!1),[M,_]=f.useState(!1),[F,x]=f.useState(!1),[$,U]=f.useState(),B=k(w=>Ne(w,h,m,n));let O=B.fetchState,W=B.file,q=B.showAutofill;const J=k(w=>Ge(w,n??""));u===!1&&(O=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const G=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{n==null&&t(ze(!0))},[n,t]),f.useEffect(()=>{O==="Not-Started"&&(u&&M?_(!1):!u&&v&&H(!1))},[n]),f.useEffect(()=>{v||n==null||u||(H(!0),t(Et(n,g,T,!1)),M||(_(!0),t(Ue(!1,g,T,b,n)))),u&&!M&&(_(!0),t(Ue(!1,g,T,b,n)))},[v,M,u,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","yes"),t(fa({replaceBillData:!0,billId:n})),t(Ze($,h,n))},onCancelClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","no"),t(ya({file:$,billId:n}))}},Y=f.useCallback(()=>{const w=z(c.state?.pathnameStackToGoBack),se=w.poppedPathname??ne(I.tenantEmailDomain);t(Ie({billId:n})),l(se,{state:{pathnameStackToGoBack:w.newStack}})},[c.state,I.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(O==="Error"||J.fetchState==="Error")return a.jsx(De,{});if(O!="Completed")return n==null&&o!=="small"?a.jsx(ut,{fallback:Y,children:a.jsxs(Le,{windowSize:o,children:[a.jsx(gt,{}),a.jsx(Ve,{}),a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:void 0,setShowConfirmationPopup:x,setPayload:U,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:G}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{isNewBill:!0})})]})}):a.jsxs(Le,{windowSize:o,children:[o==="small"||q?null:a.jsx(ht,{children:a.jsx(ta,{onClick:Y,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(Gn,{}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{isNewBill:n==null})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(ut,{fallback:Y,children:a.jsxs(Le,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(On,{titleComponent:a.jsx(xi,{children:Se.overwriteTitle}),descriptionComponent:a.jsx(Bi,{children:Se.overwriteDescription}),primaryButtonText:Se.buttons.yes,secondaryButtonText:Se.buttons.no,action:le,isEditPopup:!0}):null,o==="small"||q?null:a.jsx(ht,{children:a.jsx(Ii,{})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:q,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:ki(u,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:vi(u,B),isInitialEdit:!!B.isInitialEdit,billStage:w}),a.jsx($e,{windowSize:o,children:e})]})})}}function Ii(){const{triggerBack:e}=Zn();return a.jsx(ta,{onClick:e,"data-testid":"nav-bar-back-click"})}function ki(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(wi,{children:[a.jsx(Ci,{children:`${Se.recurringBill.recurringCycle}
|
|
1
|
+
import{j as a}from"./liveblocks-BDeoGIJv.js";import{j as K,h as re,u as Q,l as te,g as k,N as ee,k as X,i as la,n as sa,o as y}from"./core-CNW5dhSg.js";import{eN as Z,LB as Ge,bv as At,GE as ra,bo as xt,bD as pe,LC as Bt,wt as Et,xD as Ue,x0 as ca,bn as je,LD as da,LE as ua,c0 as pa,LF as ma,jr as Dt,LG as jt,LH as Tt,yc as Oe,wI as Be,LI as ba,wh as it,LJ as ha,Bo as ga,wl as Sa,wr as Pt,LK as Ie,LL as Ne,xE as ze,LM as ya,LN as fa,xH as Ze,LO as Ia,xU as ka,LP as Ft,xo as ot,xt as va,LQ as wa,LR as ue,LS as Rt,LT as Lt,LU as Vt,fI as Ca,wN as Me,cv as $t,LV as Aa,gD as xa,LW as Ba,LX as Ea,eT as Ut,eR as Mt,LY as He,LZ as Da,L_ as ja,Jk as We,L$ as Ta,Jl as ie,Jm as qe,M0 as Pa,M1 as Fa,M2 as Ra,xv as lt,xs as La,M3 as Va,M4 as $a,M5 as Ua,xe as Ma,M6 as _a,M7 as Ga,M8 as Oa,cj as _t,cL as Gt,jC as Na,bJ as za,bq as Ot,bK as Nt,vz as Za,M9 as Ha,Bb as Wa,Bh as qa,s6 as Ja,xF as Ka,yj as Qa,jP as fe,Ma as Xa,Mb as zt,kh as Ya,jJ as Zt,k2 as Ht,k1 as st,bC as be,bI as en,Mc as tn,Md as ke,il as an,Me as rt,Mf as nn,iq as on,iL as ln,yx as sn,Mg as rn,ka as cn,yn as dn,Mh as ct,yr as un,yw as pn,yt as mn,yl as bn,Mi as Wt,wC as hn,Mj as gn,Mk as Sn,fA as yn,fz as fn,fy as In,jS as kn,k8 as dt,kj as vn,pF as wn,j$ as Cn,yp as An,iw as xn,ko as Bn,Ml as En,io as Dn,pw as jn,Mm as Tn,xk as Pn,bE as Fn,bs as Rn,Il as Ln,cN as Vn,cM as $n,cu as Un,cA as Mn}from"./zeni-epic-state-km4S-bKq.js";import{h as me,z as L,A as ve,I as Je,a as oe,d as S,aI as Ee,B as ce,o as E,x as Te,e as j,b4 as _n,p as z,N as Ke,s as D,q as we,b5 as ut,b6 as pt,b7 as Gn,af as On,F as Nn,aC as zn,y as qt,D as Qe,G as Xe,b8 as Zn,ao as Jt,b9 as Hn,J as Wn,g as Kt,a1 as qn,ba as Jn,bb as Kn,bc as Qn,bd as Xn,be as Yn,bf as ei,bg as ti,bh as ai,bi as ni,w as ii,bj as oi,b0 as li,bk as si,bl as ri,a4 as ci}from"./index-D49e6fWF.js";import{n as V,S as di}from"./mui-B2x4GL6c.js";import{A as mt}from"./AddressScreen-C2Pdt_bq.js";import{g as ne,a as Pe,i as Qt,V as Ye,b as et,c as ui,v as pi,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-Dq7eTlwY.js";import{a as f}from"./sentry-DjiAD8iq.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-Dg-8Yu9N.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-BIyPKoCX.js";import{u as Xt}from"./useInitialThreadRequest-D5k70f5t.js";import De from"./NotFoundScreen-C_R6jGEp.js";import{D as bi}from"./DrawerScreen-CZJI9dis.js";import{M as Yt}from"./MobileAppDrawer-D25b_bdO.js";import{F as ea}from"./FeaturePreviewScreen-Dtyet701.js";import{S as Re}from"./SetupPagesScreen-BUHI1NUC.js";import{B as hi}from"./BillPayApprovalRoutes-WIACRA6B.js";import{FallBackRoute as gi}from"./ScreenRoutes-bFwU6xQj.js";import"./recharts-BNFkXXxt.js";import"./analytics-CjaLm2aW.js";import"./plaid-HF30yiu5.js";import"./dnd-ClE4Qbeo.js";import"./stripe-DMRn4zHo.js";import"./lottie-CQ8A0eX4.js";import"./lexical-DEVzuyw-.js";import"./pdf-BMb5In2P.js";import"./utils-C3tzQnc0.js";import"./analyticsHelper-CN7Nq3lV.js";import"./routePaths-CISchqL4.js";import"./BusinessVerificationPageScreen-BaDjUQw1.js";import"./ReimbursementApprovalRuleDetailScreen-EvJFbHZ_.js";import"./getLocaleForTenant-BfZYl7x_.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]="e3debf8b-fd46-4655-9ada-7f79b1e17f17",e._sentryDebugIdIdentifier="sentry-dbid-e3debf8b-fd46-4655-9ada-7f79b1e17f17")}catch{}})();const Si=X(function(e,t){const l=Ge(e,t.billId),n=L.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},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 i=je(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,ua(t.currentTenant),n);d=m,p=b}const h=pa(t.currentTenant?.userRole??[]),g=l.transactionDetails!=null&&ma(l.transactionDetails,h,n);return{billDetails:l,isAccountingClassesEnabled:Dt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:h,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ne(u),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Ie({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Pt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(Sa(l,s))},onSaveRealTimeApprovals:o=>{e(ga(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ha({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(it(l,o.type,"")):e(it(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Pe(u,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ba({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Tt({data:i,billId:l})),e(Oe(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(_n);function yi(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=L.getSignedInUser(),u=ve(),o=k(w=>Z(w)),s=k(w=>Ge(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Xt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoOpen:p,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:p,setIsAiCfoOpen:h,mobileExploreReferrer:"Bill Details"});at({isDataReady:s.fetchState==="Completed"});const b=o?.userRole!=null&&At(o?.userRole),A=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b,[T,I]=f.useState(!1),[v,H]=f.useState(!1),[M,_]=f.useState(!1),{useFeatureGate:F,useDynamicConfig:x}=oe(),{isFeatureEnabled:$}=F(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=F(S.isBillPayCommentingEnabled),{isFeatureEnabled:B}=F(S.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=x(Ee.zeniAssistConfig),W=ra(o),q=xt(o.userRole),J=A&&pe(u?.loggedInUserRoleMap),G=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(S.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=F(S.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&W===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||J||s.allApprovers.find(w=>w.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,J,o.isZeni,W,r]),f.useEffect(()=>{n!=null&&t(Bt(n))},[n]),f.useEffect(()=>{T||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(I(!0),t(Et(n??"",$,G,!1)))},[T,s,n,t]),f.useEffect(()=>{v||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,G,Y,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(ca()))},[v,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(ee,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(ce,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${E.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:w=>(se=>{n!=null&&se.trackBillPayBillDetails(n,s.isRecurring)})(w)}),a.jsx(Si,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:U,isRealTimeApprovalEnabled:M,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:G,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const Se=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=X(function(e,t){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Jt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:j,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:E.sp10,paddingRight:E.sp3,paddingBottom:"15px",paddingLeft:E.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=L.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ze(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(ka({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(ze(n))},onDeleteClick:()=>{e(Ia({billId:t.billId})),j?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(zn);function C({appContent:e}){const t=re(),l=K(),{billId:n}=te(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=oe(),{isFeatureEnabled:h}=d(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(S.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(S.billPaySetupShowInternationalPaymentByWise),{configValue:A}=p(Ee.zeniAssistConfig),T=A.user_ids!=null&&i?.userId!=null&&A.user_ids.includes(i?.userId),I=k(w=>Z(w)),[v,H]=f.useState(!1),[M,_]=f.useState(!1),[F,x]=f.useState(!1),[$,U]=f.useState(),B=k(w=>Ne(w,h,m,n));let O=B.fetchState,W=B.file,q=B.showAutofill;const J=k(w=>Ge(w,n??""));u===!1&&(O=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const G=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{n==null&&t(ze(!0))},[n,t]),f.useEffect(()=>{O==="Not-Started"&&(u&&M?_(!1):!u&&v&&H(!1))},[n]),f.useEffect(()=>{v||n==null||u||(H(!0),t(Et(n,g,T,!1)),M||(_(!0),t(Ue(!1,g,T,b,n)))),u&&!M&&(_(!0),t(Ue(!1,g,T,b,n)))},[v,M,u,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","yes"),t(fa({replaceBillData:!0,billId:n})),t(Ze($,h,n))},onCancelClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","no"),t(ya({file:$,billId:n}))}},Y=f.useCallback(()=>{const w=z(c.state?.pathnameStackToGoBack),se=w.poppedPathname??ne(I.tenantEmailDomain);t(Ie({billId:n})),l(se,{state:{pathnameStackToGoBack:w.newStack}})},[c.state,I.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(O==="Error"||J.fetchState==="Error")return a.jsx(De,{});if(O!="Completed")return n==null&&o!=="small"?a.jsx(ut,{fallback:Y,children:a.jsxs(Le,{windowSize:o,children:[a.jsx(gt,{}),a.jsx(Ve,{}),a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:void 0,setShowConfirmationPopup:x,setPayload:U,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:G}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{isNewBill:!0})})]})}):a.jsxs(Le,{windowSize:o,children:[o==="small"||q?null:a.jsx(ht,{children:a.jsx(ta,{onClick:Y,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(Gn,{}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{isNewBill:n==null})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(ut,{fallback:Y,children:a.jsxs(Le,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(On,{titleComponent:a.jsx(xi,{children:Se.overwriteTitle}),descriptionComponent:a.jsx(Bi,{children:Se.overwriteDescription}),primaryButtonText:Se.buttons.yes,secondaryButtonText:Se.buttons.no,action:le,isEditPopup:!0}):null,o==="small"||q?null:a.jsx(ht,{children:a.jsx(Ii,{})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:q,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:ki(u,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:vi(u,B),isInitialEdit:!!B.isInitialEdit,billStage:w}),a.jsx($e,{windowSize:o,children:e})]})})}}function Ii(){const{triggerBack:e}=Zn();return a.jsx(ta,{onClick:e,"data-testid":"nav-bar-back-click"})}function ki(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(wi,{children:[a.jsx(Ci,{children:`${Se.recurringBill.recurringCycle}
|
|
2
2
|
${n}/${c}`}),a.jsx(Ai,{})]}):void 0}function vi(e,t){const l=t.billActivities?.[0],n=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||n)}const ht=V.div`
|
|
3
3
|
margin-bottom: 20px;
|
|
4
4
|
margin-top: 20px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as k}from"./liveblocks-
|
|
1
|
+
import{j as k}from"./liveblocks-BDeoGIJv.js";import{a as V}from"./sentry-DjiAD8iq.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-CNW5dhSg.js";import{A as ce,a as ue,aI as de,z as E,x as pe,e as M,aa as v,g as z,bt as le,ao as me,s as B,ap as P}from"./index-D49e6fWF.js";import{M7 as fe,eN as G,rx as ye,GI as Se,xe as ge,zX as Ie,Cu as he,D7 as be,E0 as De,Mu as Oe,Mv as Te,Mw as ke,Mx as Ce,My as Ve,J1 as we,Lw as Ae,Jd as Ne,k7 as _e,fA as xe,fz as Fe,fy as ve,pF as ze,pw as Ee,pt as Me,j$ as Be,rG as Pe,rE as R,bC as L,rS as j,ct as Re}from"./zeni-epic-state-km4S-bKq.js";import{n as Le}from"./mui-B2x4GL6c.js";import{c as U}from"./routePaths-CISchqL4.js";import{M as je}from"./MobileAppDrawer-D25b_bdO.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]="9bc905d4-1682-4f25-ad4d-1d4917c78697",e._sentryDebugIdIdentifier="sentry-dbid-9bc905d4-1682-4f25-ad4d-1d4917c78697")}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-hpnVVVlc.js";import{a as V}from"./sentry-DH_qeXR
|
|
|
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??""},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:$,companySourceOfFundsDescription:q,transactionVolume:J,transactionVolumeDescription:Z,purposeOfAccount:W,purposeOfAccountDescription:X,regulatedStatus:H,regulatedStatusDescription:K,usNexus:Q,usNexusTypes:Y}=t,
|
|
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:$,companySourceOfFundsDescription:q,transactionVolume:J,transactionVolumeDescription:Z,purposeOfAccount:W,purposeOfAccountDescription:X,regulatedStatus:H,regulatedStatusDescription:K,usNexus:Q,usNexusTypes:Y}=t,x=O?.selectedOption,ee={companyId:i,companyDescription:s,companyIndustry:p.selectedOption,companyIndustryType:x==null||x===""?void 0:x,companyLegalName:T,taxIdOrEIN:g,website:m!=""&&m!=null?Re(m):void 0,phone:I,syncToken:f,fileIds:a,incDate:o!=null?L(o?.toString()):o,typeOfIncorporation:w?.selectedOption??"",stateOfIncorporation:A?.selectedOption??"",sourceOfFunds:N?.selectedOption??"",companySubIndustry:_?.selectedOption??"",countriesOfOperations:h?.selectedOptions.map(F=>F.length===2?F:P(F))??[],companySourceOfFunds:$?.selectedOption??"",companySourceOfFundsDescription:q,transactionVolume:J?.selectedOption??"",transactionVolumeDescription:Z,purposeOfAccount:W?.selectedOption??"",purposeOfAccountDescription:X,regulatedStatus:H??"",regulatedStatusDescription:K,usNexus:Q,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?P(I.selectedOption):void 0,phone:u,birthday:n!=null?L(n?.toString()):n,syncToken:D,titleAtCompany:a.selectedOption,ownershipInCompany:o,documentTypeSelectedForVerification:h,isSelectedForVerification:w,userVerificationStatus:A,treasuryUserVerificationStatus:N,fileIds:_,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(j({officers:s}))},onSaveDetailsClick:t=>{e(R(i,t,r))},onSendForVerificationClick:t=>{e(R(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(Pe({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(ve(t,"SpendManagementSetup"))},onResendOtp:t=>{e(Fe(t,"SpendManagementSetup"))},onVerifyOtp:(t,s)=>{e(xe(t,s,"SpendManagementSetup"))},saveNewAddressInLocalStore:(t,s)=>{e(_e({addressType:t,addressToCreate:s}))}}})(le),Qe=({productType:e})=>{const d=ae(),i=ne(),r=se(),[y,S]=V.useState(!1),[l,b]=V.useState(!1),{tenantEmailDomain:t}=ie(),s=ce(),{useDynamicConfig:p}=ue(),{configValue:O}=p(de.zeniAccountsConfig),T=fe(O),g=C(a=>{switch(e){case"zeni_accounts":return a.zeniAccountSetupViewState.fetchState;case"reimbursement":return a.remiSetupViewState.fetchState;case"charge_cards":return a.chargeCardSetupViewState.fetchState;case"zeni_treasury":return a.treasurySetupViewState.fetchState;default:return a.billPaySetupViewState.fetchState}}),m=C(a=>a.companyConfigState.fetchState),I=C(a=>a.userRoleConfigState.fetchState),c=C(a=>G(a)),n=c.companyId??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,v(i)?"Settings":void 0)}})(a)}),v(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:v(i),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{D(!0)},maxInsuredAmount:T.maxInsuredAmount})]})};export{Qe as B};
|