@zeniai/web-app-ui 5.0.52-dev → 5.0.53-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-D2DRkabM.js +1 -0
- package/dist/assets/{AddressScreen-DUppO0v9.js → AddressScreen-Dz7dukxj.js} +2 -2
- package/dist/assets/AiCfoScreen-BZewpLje.js +11 -0
- package/dist/assets/{BillPayApprovalRoutes-BBwzt0Yv.js → BillPayApprovalRoutes-CJR4AuBS.js} +1 -1
- package/dist/assets/{BillPayRoutes-uzwpElCr.js → BillPayRoutes-DnKnqkZc.js} +7 -7
- package/dist/assets/{BusinessVerificationPageScreen-B-xYgrU6.js → BusinessVerificationPageScreen-CIapP8vT.js} +2 -2
- package/dist/assets/{ChargeCardRoutes-CzHXXe2R.js → ChargeCardRoutes-C_dKBRuF.js} +1 -1
- package/dist/assets/CompanyPassportScreen-CO0ra3b3.js +1 -0
- package/dist/assets/ConnectionAuthScreen-BzFFitvW.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-D-b9p5yP.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-BwQeoVBC.js → CustomerOnboardingRoutes-DAfAcoCp.js} +4 -4
- package/dist/assets/{DashboardRoutes-BUqI4Cc0.js → DashboardRoutes-D-Yad_Gu.js} +3 -3
- package/dist/assets/{DefaultTenantHome-I8Od3JVH.js → DefaultTenantHome-CoIL9zlW.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-DmlqBc99.js +18 -0
- package/dist/assets/DrawerScreen-Ojlk_glq.js +1 -0
- package/dist/assets/EntityDetailRoutes-BUJ_kkZN.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-CmosQIFV.js → ExpenseAutomationRoutes-BeIoMNyV.js} +3 -3
- package/dist/assets/FeaturePreviewScreen-XMp6Ks_m.js +1 -0
- package/dist/assets/MagicLinkRoutes-Qs5jpSqt.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-C7anMkyc.js +12 -0
- package/dist/assets/{MobileAppDrawer-Ch_dkO8z.js → MobileAppDrawer--t6IvFv1.js} +1 -1
- package/dist/assets/NotFoundScreen-DwnzoLJU.js +1 -0
- package/dist/assets/{NotificationRoutes-DKcGAYWb.js → NotificationRoutes-sTDUm3UC.js} +1 -1
- package/dist/assets/PandLWithForecastRoutes-C7spTjMj.js +1 -0
- package/dist/assets/PeopleRoutes-tT0eCYuT.js +22 -0
- package/dist/assets/PerformanceRoutes-CK0d_z0a.js +1 -0
- package/dist/assets/{Preview-C8CjsHbo.js → Preview-6f9LxPkS.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-Onqn0btO.js → QBOConnectionScreen-DUGBXHYt.js} +1 -1
- package/dist/assets/{ReferralListScreen-DP-pmrc-.js → ReferralListScreen-Cf0Eqtgm.js} +2 -2
- package/dist/assets/{ReimbursementApprovalRoutes-6bMlKgzH.js → ReimbursementApprovalRoutes-VgH79DJX.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-C13510At.js → ReimbursementApprovalRuleDetailScreen-COa1H9AX.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-CeASWzxU.js → ReimbursementRoutes-B1ZkkbHf.js} +6 -6
- package/dist/assets/{ReportsRoutes-C8NoWmOj.js → ReportsRoutes-DE0ZO7KW.js} +1 -1
- package/dist/assets/RewardsRoutes--KPLXTbA.js +1 -0
- package/dist/assets/ScreenRoutes-DjE90VcS.js +2 -0
- package/dist/assets/{SettingsRoutes-1ZlX7Q5h.js → SettingsRoutes-BxKE1ve9.js} +7 -7
- package/dist/assets/{SetupPagesScreen-BJLzY18z.js → SetupPagesScreen-CQlX6aNj.js} +5 -5
- package/dist/assets/SignInScreen-CjjSOtbr.js +1 -0
- package/dist/assets/SignOutScreen-Cff_01TR.js +9 -0
- package/dist/assets/{TaskListScreen-CoxKSDBN.js → TaskListScreen-Bgae74H_.js} +2 -2
- package/dist/assets/TaskRoutes-BFnfWd1X.js +9 -0
- package/dist/assets/TransactionDetailRoutes-BqiPhNjn.js +1 -0
- package/dist/assets/{TransactionDetailScreen-BzuYNaM6.js → TransactionDetailScreen-PaWtkTEH.js} +2 -2
- package/dist/assets/{TransactionListRoutes-CZN3kVuH.js → TransactionListRoutes-DHWR3aVx.js} +1 -1
- package/dist/assets/{TreasuryRoutes-CDbHC1ud.js → TreasuryRoutes-NSgI8Cqk.js} +5 -5
- package/dist/assets/{VendorsRoutes-DVIYw3C9.js → VendorsRoutes-pV_XlyDs.js} +1 -1
- package/dist/assets/WiseConfirmationScreen-ryAAdtIC.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-DSf9Fyu-.js → ZeniAccountRoutes-CKJA4fI8.js} +10 -10
- package/dist/assets/{ZeniAccountStatementScreen-6fe1R3g0.js → ZeniAccountStatementScreen-BoeVpxsO.js} +2 -2
- package/dist/assets/{accountMappingHelper-DbsU5f-I.js → accountMappingHelper-Blov7ltS.js} +1 -1
- package/dist/assets/{analytics-dCAT-sHe.js → analytics-DMOhZ7ep.js} +1 -1
- package/dist/assets/{analyticsHelper-cZJjlMLA.js → analyticsHelper-CcQrbJpT.js} +1 -1
- package/dist/assets/{core-CFeBRNT2.js → core-BpuExePz.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-n41T8k0p.js → decodeURIComponentSafe-BRoMr-Xr.js} +1 -1
- package/dist/assets/{dnd-B97JkZHN.js → dnd-Ool1WkEK.js} +1 -1
- package/dist/assets/{empty-OWRww1ZI.js → empty-BBb-0fG-.js} +1 -1
- package/dist/assets/{empty-DLc2Fl0S.js → empty-BUF0u-3V.js} +1 -1
- package/dist/assets/{emptyVideoElement-BSbvcjsk.js → emptyVideoElement-Uzds3hpE.js} +1 -1
- package/dist/assets/epic-CrZKkaDL.js +2 -0
- package/dist/assets/{getLocaleForTenant-3enaSwsq.js → getLocaleForTenant-CjnKm7X5.js} +1 -1
- package/dist/assets/{index-CMh3-nxR.js → index-64WyzcEc.js} +1 -1
- package/dist/assets/{index-CY1RyVhG.js → index-6Rjzb8Pu.js} +1 -1
- package/dist/assets/{index-CChL82zp.js → index-B2-OsYcb.js} +1 -1
- package/dist/assets/{index-CeOX_EPF.js → index-CPMhopDR.js} +2 -2
- package/dist/assets/{index-Xbw0F7cT.js → index-CiibyDuy.js} +1 -1
- package/dist/assets/{index-BgAqzVN-.js → index-Cx6RZ5wc.js} +1 -1
- package/dist/assets/{index-DqjQxzff.js → index-DidLjpq0.js} +13814 -13807
- package/dist/assets/{lexical-qfgvtXN9.js → lexical-9B5gs5tG.js} +1 -1
- package/dist/assets/{liveblocks-B5kNfPMX.js → liveblocks-3WpI1obg.js} +1 -1
- package/dist/assets/{lottie-DBJX4kzt.js → lottie-DFxKNIfK.js} +1 -1
- package/dist/assets/{mui-CdWoU1P3.js → mui-Bpme9BmU.js} +1 -1
- package/dist/assets/{pathToGoBack-CRbDFluC.js → pathToGoBack-JibONr5D.js} +1 -1
- package/dist/assets/{pdf-btSs-oeP.js → pdf-CAA7iyNe.js} +4 -4
- package/dist/assets/{pdf-lib-DtoGaD83.js → pdf-lib-CRl3mCcE.js} +1 -1
- package/dist/assets/{plaid-BtUsVD04.js → plaid-CTMaHWW7.js} +1 -1
- package/dist/assets/{pusher-P-ZkAQwH.js → pusher-By_9ihm6.js} +1 -1
- package/dist/assets/{react-B3Pd89v5.js → react-B9l5xNkw.js} +1 -1
- package/dist/assets/{react-DRVFd15b.js → react-C9RjToco.js} +1 -1
- package/dist/assets/{react-DoVi3sqS.js → react-CHKpQfw4.js} +1 -1
- package/dist/assets/{react-CjYyY07F.js → react-CyvOMBtf.js} +1 -1
- package/dist/assets/{react-C6tPPw2y.js → react-DMWTUnLu.js} +1 -1
- package/dist/assets/{react-BKHO4frM.js → react-Df7GsDYV.js} +1 -1
- package/dist/assets/{recharts-Blc5CD1k.js → recharts-D5_tB-NC.js} +1 -1
- package/dist/assets/{routePaths-DmlKjqFK.js → routePaths-D7d1SJs7.js} +1 -1
- package/dist/assets/{sentry-tUkEj5F1.js → sentry-z6zkwC0R.js} +1 -1
- package/dist/assets/{url-CKNm9b8o.js → url-C-EF6k4f.js} +1 -1
- package/dist/assets/{url-CdUOJaXS.js → url-CVCmlGqq.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-D5Yjge45.js +1 -0
- package/dist/assets/{useDeviceId-BbnEFhNU.js → useDeviceId-C8t7Lzes.js} +1 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-Bjj9kjVA.js +1 -0
- package/dist/assets/{useInitialThreadRequest-DcK2Ntoj.js → useInitialThreadRequest-C2mjRKeW.js} +1 -1
- package/dist/assets/{utils-C-s_aaYV.js → utils-Cb7KsPLv.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-C1ZCVyta.js → withTransactionSidePanel-C5hIBso3.js} +2 -2
- package/dist/assets/{zeni-epic-state-BDLHO2z4.js → zeni-epic-state-RQBIdQMH.js} +6 -6
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/AddressRoutes-ByK34Nkv.js +0 -1
- package/dist/assets/AiCfoScreen-BpyzUjuE.js +0 -11
- package/dist/assets/CompanyPassportScreen-B2JEo2qd.js +0 -1
- package/dist/assets/ConnectionAuthScreen-1pJ2T25i.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-Bz4XPpgo.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-DsIRwxGz.js +0 -18
- package/dist/assets/DrawerScreen-B9VUPvG9.js +0 -1
- package/dist/assets/EntityDetailRoutes-Di-NARtq.js +0 -1
- package/dist/assets/FeaturePreviewScreen-D9loXVU6.js +0 -1
- package/dist/assets/MagicLinkRoutes-C-enwTzu.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-lg6b2bn0.js +0 -12
- package/dist/assets/NotFoundScreen-DHD7hd9-.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-BgoW8SD7.js +0 -1
- package/dist/assets/PeopleRoutes-CzzUDUEU.js +0 -22
- package/dist/assets/PerformanceRoutes-BvIRTO8r.js +0 -1
- package/dist/assets/RewardsRoutes-DaQQnoJH.js +0 -1
- package/dist/assets/ScreenRoutes-CQlAz61c.js +0 -2
- package/dist/assets/SignInScreen-CmtJJCNv.js +0 -1
- package/dist/assets/SignOutScreen-CTAkPk9V.js +0 -9
- package/dist/assets/TaskRoutes-DIhS3vkG.js +0 -9
- package/dist/assets/TransactionDetailRoutes-BFba8WDw.js +0 -1
- package/dist/assets/WiseConfirmationScreen-Chv2D10i.js +0 -12
- package/dist/assets/epic-BiCEoXIv.js +0 -2
- package/dist/assets/useAskAiCfoHostNavButtonProps-XVobODAU.js +0 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-DoHZcRGr.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-3WpI1obg.js";import{A as d}from"./AddressScreen-Dz7dukxj.js";import i from"./NotFoundScreen-DwnzoLJU.js";import"./sentry-z6zkwC0R.js";import{n as s,o as r}from"./core-BpuExePz.js";import"./zeni-epic-state-RQBIdQMH.js";import"./recharts-D5_tB-NC.js";import"./index-DidLjpq0.js";import"./mui-Bpme9BmU.js";import"./analytics-DMOhZ7ep.js";import"./plaid-CTMaHWW7.js";import"./dnd-Ool1WkEK.js";import"./stripe-DMRn4zHo.js";import"./lottie-DFxKNIfK.js";import"./lexical-9B5gs5tG.js";import"./pdf-CAA7iyNe.js";import"./utils-Cb7KsPLv.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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as r}from"./liveblocks-
|
|
1
|
+
import{j as r}from"./liveblocks-3WpI1obg.js";import{a as m}from"./sentry-z6zkwC0R.js";import{j as T,h as _,u as j,l as E,g as B,k as M}from"./core-BpuExePz.js";import{q as $,h as D,z as L,A as K,B as J,x as N,e as C,g as S,n as z,j as h,p as F}from"./index-DidLjpq0.js";import{J0 as k,gM as R,eN as U,J1 as q,c0 as G,J2 as O,k6 as V}from"./zeni-epic-state-RQBIdQMH.js";import{n as H}from"./mui-Bpme9BmU.js";import Q from"./NotFoundScreen-DwnzoLJU.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]="02f34ea7-ce9f-4445-9bb0-3bbbdb5a8d1e",e._sentryDebugIdIdentifier="sentry-dbid-02f34ea7-ce9f-4445-9bb0-3bbbdb5a8d1e")}catch{}})();const W=H.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{j as r}from"./liveblocks-B5kNfPMX.js";import{a as h}from"./sentry-tUkEj5F
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
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),d=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:
|
|
9
|
+
`,X=M(function(e,t){const{addressId:o,isSubPage:i,addressType:c}=t,l=U(e),a=t.roleMap!=null&&q(t.roleMap),d=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:h.googleMapsAPIKey,isDisabled:d,isSubPage:i,dontShowSaveConfirmationPopup:t.dontShowSaveConfirmation}}const n=k(e,o);return{addressToEdit:n.address,loadingState:n.fetchState,googleAPIKey:h.googleMapsAPIKey,isDisabled:d}},function(e,t){const{navigate:o,location:i,addressType:c}=t,l=a=>{if(a==="express-pay")o("../express-pay/add-wire");else{const d=i.state,n=F(d?.pathnameStackToGoBack);let s=n.poppedPathname??w();const u=d?.queryParams;if(u){const g=new URLSearchParams(u).toString();g&&(s=`${s}?${g}`)}o(s,{state:{pathnameStackToGoBack:n.newStack}})}};return{onSubmitHandler:a=>{const d=Y(a);e(V({addressType:c,addressToCreate:d})),C?.trackSaveAddressClicked(S.Event.saveAddressClicked,{street:a.street.addressString,city:a.city,state:a.state,country:a.country.selectedOption??"",postalCode:a.postalCode,suite:a.suite,secondaryInfo:a.secondaryInfo}),l(t.bankAccountContext)},onCancel:()=>{l(t.bankAccountContext)}}})(z);function re({isSubPage:e,hideAddressSubTitle:t=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=T(),d=_(),n=j(),{addressId:s,addressType:u}=E(),g=$(),x=D(),A=L.getSignedInUser(),[f,I]=m.useState(s==null),p=B(b=>s!=null?k(b,s).fetchState:"Not-Started"),v=K();if(A==null)throw Error("Can't access address page without signing in...");const P=b=>b.trackPageLoaded(s!=null?S.Event.editAddress:S.Event.addAddress),y=l??u;return m.useEffect(()=>{f||s==null||(I(!0),d(R(s,!1)))},[f,s,d]),y==null||y.match(/(user_address|company_address|company_registered_address|vendor_address|officer_([1-9]|10)_address)$/g)?!f&&p==="Not-Started"||f&&p==="In-Progress"?r.jsx(J,{fetchState:p,style:{backgroundColor:x.colors.grey5}}):s!=null&&p==="Error"?(a(`${w(1)}/new`,{replace:!0}),r.jsx(r.Fragment,{})):r.jsxs(r.Fragment,{children:[r.jsx(N,{analytics:C,onLoad:P}),r.jsx(W,{windowSize:g,children:r.jsx(X,{location:n,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:t,addressId:s,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:v?.loggedInUserRoleMap})})]}):r.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{re as A,Y as t};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{j as h}from"./liveblocks-3WpI1obg.js";import{a as r}from"./sentry-z6zkwC0R.js";import{h as oe,j as ne,u as ie,g as G,l as re,k as le}from"./core-BpuExePz.js";import{G as ce,cF as ue,z as de,q as me,cG as pe,cH as fe,cI as he,cJ as $,x as Se,e as v,J as j,cK as ge,cL as Ce,g as ke,a1 as we,cM as be,N as Ie,s as Pe,p as q,aX as Ee,cN as Te}from"./index-DidLjpq0.js";import{fD as ye,f2 as H,eN as _e,hq as xe,Py as ve,eM as Ue,hA as Ae,hw as Qe,ft as Oe,fn as De,fg as Fe,fk as V,fo as Me,fp as Le,fq as Be,fr as Ne,fs as Re}from"./zeni-epic-state-RQBIdQMH.js";import{D as Ge,n as U,P as je,S as qe}from"./mui-Bpme9BmU.js";import{p as Ve}from"./pathToGoBack-JibONr5D.js";import"./recharts-D5_tB-NC.js";import"./analytics-DMOhZ7ep.js";import"./plaid-CTMaHWW7.js";import"./dnd-Ool1WkEK.js";import"./stripe-DMRn4zHo.js";import"./lottie-DFxKNIfK.js";import"./lexical-9B5gs5tG.js";import"./pdf-CAA7iyNe.js";import"./utils-Cb7KsPLv.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]="03272e9a-1e2d-4439-9ddd-cf53af3f685c",s._sentryDebugIdIdentifier="sentry-dbid-03272e9a-1e2d-4439-9ddd-cf53af3f685c")}catch{}})();const W="chat-response-generated",$e=le(function(s,i){const a=H(s),m=i.isSubmitting;return{showSampleQuestions:i.sessionFromUrl==="explore"&&a.uiState.currentChatSessionId==null,aiCfoView:a,isSubmitting:m,isNewChatSession:i.sessionFromUrl==="new_chat"||i.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Ie}/tableDownload`,emailLinkQuestion:i.emailLinkQuestion,autoSubmitEmailLinkQuestion:i.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:i.onEmailLinkQuestionProcessed,isFileUploadEnabled:i.isFileUploadEnabled,isUploadPromoVisible:i.isUploadPromoVisible,onUploadPromoClose:i.onUploadPromoClose}},function(s,i){const{location:a,currentTenant:m,userId:d,navigate:p,currentChatSessionId:f,allSessionsWithOrderedQuestionAnswers:S,setIsAiCfoOpen:l}=i;return{onEventReceived:(e,o)=>{if(e===W&&typeof o.text=="string"&&typeof o.metadata=="object"){const n=o,c=Le(n.type),t=n.metadata.chat_session_id??null,{currentChatSession:I,currentQuestionAnswer:g,currentQuestionAnswerSummary:P}=$(S,t);c!=="answer"?v.trackAICFOChatResponseGenerated(c,g?.question.questionText??"",n.text,t,Te(P,I),n.metadata.message_id??null):v.trackAICFOChatAnswerGenerated(n.text,g?.question.questionText??"",(n.follow_up_questions?.length??0)>0,!!n.assumptions,!!n.insights,n.visualization!=null,Be(n.visualization?.type??"")??null,t,n.summarized_title,n.metadata.message_id??null),s(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&&Ee(s,e,o,f,S,d,c,n)},updateCurrentInput:e=>{s(V(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{s(Me(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{p(-1)},onCloseClick:()=>{const e=q(a.state?.pathnameStackToGoBack),o=e.poppedPathname??Ve(1);p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack}}),s(V(""))},togglePageView:()=>{const e=q(a.state?.pathnameStackToGoBack),o=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),l(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{p(-1)},onNewChatClick:()=>{f!=null&&s(Fe());const e=Pe(a.state?.pathnameStackToGoBack,a.pathname);p(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{s(De({questionAnswerId:e,isCollapsed:o}))},onMenuClick:i.onMenuClick}})(we(be)),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=G(u=>H(u)),e=de.getSignedInUser(),{session_id:o}=re(),n=me(),c=G(u=>_e(u)),t=l.uiState.currentChatSessionId,I=c.tenantEmailDomain,{handleUploadPromoClose:g,isUploadPromoVisible:P}=pe({isFileUploadEnabled:s,tenantEmailDomain:I}),A=fe({currentTenant:c,currentChatSessionId:t,aiCfoView:l}),C=d.state,k=C?.aiCfoInitialQuestion,Q=!!C?.aiCfoShouldSubmit,[z,E]=r.useState(null),[J,T]=r.useState(!1),O=r.useRef(!1);r.useEffect(()=>{O.current||k==null||k===""||(E(k),T(Q),O.current=!0)},[k,Q]);const K=r.useCallback(()=>{E(null),T(!1)},[]),D=r.useMemo(()=>new URLSearchParams(d.search),[d.search]),F=D.get("ref")??C?.aiCfoRef,y=D.get("emailRefId")??C?.aiCfoEmailRefId,M=r.useRef(!1);r.useEffect(()=>{M.current||F!=="month-end-email"||y==null||t!=null||e==null||(a(xe("controller",e.userId,y,"MONTH_END_EMAIL")),M.current=!0)},[F,y,t,a,e]);const w=l.uiState.lastContextMessage;r.useEffect(()=>{w!=null&&w!==""&&t!=null&&(E(w),T(!0),a(ve()))},[w,t,a]);const X=c.masterTOSInfo,b=X?.isMasterTOSAccepted??!1,{visitedSessions:L}=he(t),_=l.fetchState,x=l.uiState.chatSessionsNextPageToken.hasMore||!l.uiState.chatSessionsFirstPageFetched,B=t!=null?l.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",N=t==null||(l.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),R=l.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:Y}=$(R,t),Z=Y.length===0;r.useEffect(()=>{b||m("../dashboard",{state:{...d.state,message:"open_ai_cfo_drawer"}})},[b]),r.useEffect(()=>{t!=null&&o!==t&&m(`../ai-cfo/${t}`,{state:{...d.state}})},[t,o]),r.useEffect(()=>{o!=null&&t==null&&o!=="new_chat"&&o!=="explore"&&a(Ue({sessionId:o,agentId:"controller"}))},[]);const ee=r.useMemo(()=>({events:L.map(u=>`private-chat-${u}.${W}`),eventCallback:(u,se,ae)=>ae.onEventReceived(u,se)}),[L]);if(r.useEffect(()=>{_!=="In-Progress"&&x&&a(Ae())},[_,x,a]),r.useEffect(()=>{t!=null&&B!=="In-Progress"&&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(ke.Event.aiCFOPage)}),j(n)&&A.drawerElement,h.jsx($e,{...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:j(n)?A.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:P,onUploadPromoClose:g}),h.jsx(Ge,{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:b,acceptMasterTOSState:l.masterTOSAcceptanceState,customPageTitle:S,onCloseClick:()=>f(!1),onCompleteClick:()=>{b||c.userRoleId==null||a(Oe(c.userRoleId)),f(!1)}})})})]})},He=U(qe)`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
`,We=U.div`
|
|
6
|
+
height: 100vh;
|
|
7
|
+
width: 100%;
|
|
8
|
+
`,ze=U(je)`
|
|
9
|
+
box-shadow: ${({theme:s})=>s.colors.elevation2};
|
|
10
|
+
color: ${({theme:s})=>s.colors.grey4};
|
|
11
|
+
`;export{dt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-
|
|
1
|
+
import{j as l}from"./liveblocks-3WpI1obg.js";import{a as y}from"./sentry-z6zkwC0R.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-BpuExePz.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-RQBIdQMH.js";import{h as P,z as k,B as V,a1 as Y,bx as G,aa as _,by as H}from"./index-DidLjpq0.js";import"./mui-Bpme9BmU.js";import{i as J}from"./ReimbursementApprovalRuleDetailScreen-COa1H9AX.js";import K from"./NotFoundScreen-DwnzoLJU.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-B5kNfPMX.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-CFeBRNT2.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-BDLHO2z4.js";import{h as me,z as L,A as ve,K as Je,a as oe,p as S,aI as Ee,B as ce,o as E,C as Te,e as j,b4 as _n,n as z,R as Ke,v as D,q as we,b5 as ut,b6 as pt,b7 as Gn,af as On,G as Nn,aC as zn,E as qt,D as Qe,I as Xe,b8 as Zn,ao as Jt,b9 as Hn,M 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,y as ii,bj as oi,b0 as li,bk as si,bl as ri,a4 as ci}from"./index-DqjQxzff.js";import{n as V,S as di}from"./mui-CdWoU1P3.js";import{A as mt}from"./AddressScreen-DUppO0v9.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-DsIRwxGz.js";import{a as f}from"./sentry-tUkEj5F1.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-XVobODAU.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-DoHZcRGr.js";import{u as Xt}from"./useInitialThreadRequest-DcK2Ntoj.js";import De from"./NotFoundScreen-DHD7hd9-.js";import{D as bi}from"./DrawerScreen-B9VUPvG9.js";import{M as Yt}from"./MobileAppDrawer-Ch_dkO8z.js";import{F as ea}from"./FeaturePreviewScreen-D9loXVU6.js";import{S as Re}from"./SetupPagesScreen-BJLzY18z.js";import{B as hi}from"./BillPayApprovalRoutes-BBwzt0Yv.js";import{FallBackRoute as gi}from"./ScreenRoutes-CQlAz61c.js";import"./recharts-Blc5CD1k.js";import"./analytics-dCAT-sHe.js";import"./plaid-BtUsVD04.js";import"./dnd-B97JkZHN.js";import"./stripe-DMRn4zHo.js";import"./lottie-DBJX4kzt.js";import"./lexical-qfgvtXN9.js";import"./pdf-btSs-oeP.js";import"./utils-C-s_aaYV.js";import"./analyticsHelper-cZJjlMLA.js";import"./routePaths-DmlKjqFK.js";import"./BusinessVerificationPageScreen-B-xYgrU6.js";import"./ReimbursementApprovalRuleDetailScreen-C13510At.js";import"./getLocaleForTenant-3enaSwsq.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]="8fb5d2eb-144d-4e6d-b391-e727bab65d65",e._sentryDebugIdIdentifier="sentry-dbid-8fb5d2eb-144d-4e6d-b391-e727bab65d65")}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-3WpI1obg.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 S}from"./core-BpuExePz.js";import{eN as Z,LB as Ge,bv as At,GE as ra,bo as xt,bD as ue,LC as Bt,wt as Et,xD as Ue,x0 as ca,bn as je,LD as da,LE as pa,c0 as ua,LF as ma,jq 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 ya,wr as Pt,LK as Ie,LL as Ne,xE as ze,LM as Sa,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 pe,LS as Rt,LT as Lt,LU as Vt,fH as Ca,wN as Me,cv as $t,LV as Aa,gC 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,jB 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,jO as fe,Ma as Xa,Mb as zt,kg as Ya,jI as Zt,k1 as Ht,k0 as st,bC as be,bI as en,Mc as tn,Md as ke,ik as an,Me as rt,Mf as nn,ip as on,iK as ln,yx as sn,Mg as rn,k9 as cn,yn as dn,Mh as ct,yr as pn,yw as un,yt as mn,yl as bn,Mi as Wt,wC as hn,Mj as gn,Mk as yn,fz as Sn,fy as fn,fx as In,jR as kn,k7 as dt,ki as vn,pF as wn,j_ as Cn,yp as An,iv as xn,kn as Bn,Ml as En,im 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-RQBIdQMH.js";import{h as me,z as L,A as ve,G as Je,a as oe,d as y,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 pt,b6 as ut,b7 as Gn,af as On,E as Nn,aC as zn,y as qt,D as Qe,Z as Xe,b8 as Zn,ao as Jt,b9 as Hn,I 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-DidLjpq0.js";import{n as V,S as di}from"./mui-Bpme9BmU.js";import{A as mt}from"./AddressScreen-Dz7dukxj.js";import{g as ne,a as Pe,i as Qt,V as Ye,b as et,c as pi,v as ui,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-DmlqBc99.js";import{a as f}from"./sentry-z6zkwC0R.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-D5Yjge45.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-Bjj9kjVA.js";import{u as Xt}from"./useInitialThreadRequest-C2mjRKeW.js";import De from"./NotFoundScreen-DwnzoLJU.js";import{D as bi}from"./DrawerScreen-Ojlk_glq.js";import{M as Yt}from"./MobileAppDrawer--t6IvFv1.js";import{F as ea}from"./FeaturePreviewScreen-XMp6Ks_m.js";import{S as Re}from"./SetupPagesScreen-CQlX6aNj.js";import{B as hi}from"./BillPayApprovalRoutes-CJR4AuBS.js";import{FallBackRoute as gi}from"./ScreenRoutes-DjE90VcS.js";import"./recharts-D5_tB-NC.js";import"./analytics-DMOhZ7ep.js";import"./plaid-CTMaHWW7.js";import"./dnd-Ool1WkEK.js";import"./stripe-DMRn4zHo.js";import"./lottie-DFxKNIfK.js";import"./lexical-9B5gs5tG.js";import"./pdf-CAA7iyNe.js";import"./utils-Cb7KsPLv.js";import"./analyticsHelper-CcQrbJpT.js";import"./routePaths-D7d1SJs7.js";import"./BusinessVerificationPageScreen-CIapP8vT.js";import"./ReimbursementApprovalRuleDetailScreen-COa1H9AX.js";import"./getLocaleForTenant-CjnKm7X5.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]="81f969a9-80fb-43ce-a840-3904c7c22229",e._sentryDebugIdIdentifier="sentry-dbid-81f969a9-80fb-43ce-a840-3904c7c22229")}catch{}})();const yi=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??""},p=z(t.location.state?.pathnameStackToGoBack);let o=!0;p.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=je(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,u=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,pa(t.currentTenant),n);d=m,u=b}const h=ua(t.currentTenant?.userRole??[]),g=l.transactionDetails!=null&&ma(l.transactionDetails,h,n);return{billDetails:l,isAccountingClassesEnabled:Dt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:h,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:u,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:p}=n;return{redirectToBillsScreen:()=>{const o=ne(p),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Ie({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Pt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(ya(l,s))},onSaveRealTimeApprovals:o=>{e(ga(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ha({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(it(l,o.type,"")):e(it(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Pe(p,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(p);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ba({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Tt({data:i,billId:l})),e(Oe(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(_n);function Si(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=L.getSignedInUser(),p=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:u,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:u,setIsAiCfoOpen:h,mobileExploreReferrer:"Bill Details"});at({isDataReady:s.fetchState==="Completed"});const b=o?.userRole!=null&&At(o?.userRole),A=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b,[T,I]=f.useState(!1),[v,H]=f.useState(!1),[M,_]=f.useState(!1),{useFeatureGate:F,useDynamicConfig:x}=oe(),{isFeatureEnabled:$}=F(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=F(y.isBillPayCommentingEnabled),{isFeatureEnabled:B}=F(y.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=x(Ee.zeniAssistConfig),W=ra(o),q=xt(o.userRole),J=A&&ue(p?.loggedInUserRoleMap),G=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=F(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&W===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||J||s.allApprovers.find(w=>w.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,J,o.isZeni,W,r]),f.useEffect(()=>{n!=null&&t(Bt(n))},[n]),f.useEffect(()=>{T||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(I(!0),t(Et(n??"",$,G,!1)))},[T,s,n,t]),f.useEffect(()=>{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(yi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:U,isRealTimeApprovalEnabled:M,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:G,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const ye=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=X(function(e,t){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,p=r&&t.file==null;return{uploadInvoiceEndPoint:`${Jt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:j,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:p,style:{paddingTop:E.sp10,paddingRight:E.sp3,paddingBottom:"15px",paddingLeft:E.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=L.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ze(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(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,p=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:u}=oe(),{isFeatureEnabled:h}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:A}=u(Ee.zeniAssistConfig),T=A.user_ids!=null&&i?.userId!=null&&A.user_ids.includes(i?.userId),I=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??""));p===!1&&(O=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const G=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{n==null&&t(ze(!0))},[n,t]),f.useEffect(()=>{O==="Not-Started"&&(p&&M?_(!1):!p&&v&&H(!1))},[n]),f.useEffect(()=>{v||n==null||p||(H(!0),t(Et(n,g,T,!1)),M||(_(!0),t(Ue(!1,g,T,b,n)))),p&&!M&&(_(!0),t(Ue(!1,g,T,b,n)))},[v,M,p,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","yes"),t(fa({replaceBillData:!0,billId:n})),t(Ze($,h,n))},onCancelClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(G??"",w,i?.userEmail??"","no"),t(Sa({file:$,billId:n}))}},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(pt,{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(ut,{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(ut,{isNewBill:n==null})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(pt,{fallback:Y,children:a.jsxs(Le,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(On,{titleComponent:a.jsx(xi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Bi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:le,isEditPopup:!0}):null,o==="small"||q?null:a.jsx(ht,{children:a.jsx(Ii,{})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:q,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:ki(p,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:vi(p,B),isInitialEdit:!!B.isInitialEdit,billStage:w}),a.jsx($e,{windowSize:o,children:e})]})})}}function Ii(){const{triggerBack:e}=Zn();return a.jsx(ta,{onClick:e,"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:`${ye.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;
|
|
@@ -77,7 +77,7 @@ import{j as a}from"./liveblocks-B5kNfPMX.js";import{j as K,h as re,u as Q,l as t
|
|
|
77
77
|
margin-bottom: 30px;
|
|
78
78
|
margin-top: ${E.sp4};
|
|
79
79
|
white-space: pre-line;
|
|
80
|
-
`,Ei=X(function(e,t){return{billsReviewView:Ft(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(
|
|
80
|
+
`,Ei=X(function(e,t){return{billsReviewView:Ft(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(pe())},onCloseReviewItem:l=>{e(wa(l))},onProceedForBulkActionClick:(l,n)=>{switch(l){case"send_for_approval":e(va());break;case"approve":case"review":e(ot("approved",n??""));break;case"reject":e(ot("rejected",n??""))}}}})(Hn);function Di(){const e=K(),t=k(n=>n.billsBulkActionViewState.bulkSubmissionFetchState.fetchState),{billsForReview:l}=k(n=>Ft(n));return f.useEffect(()=>{t!=="Completed"&&l.length!==0||e("./")},[t,l.length]),a.jsx(Ei,{navigate:e,analytics:j})}const ae=ja(),aa="bulk-operation-update",_e="bill-approval-rule-update",{spendManagement:ji,common:yt}=Qe.getLocalizedStrings(),St=ji.billPay.bulkActions,Ti=V.div`
|
|
81
81
|
display: flex;
|
|
82
82
|
min-height: 100%;
|
|
83
83
|
width: 100%;
|
|
@@ -85,11 +85,11 @@ import{j as a}from"./liveblocks-B5kNfPMX.js";import{j as K,h as re,u as Q,l as t
|
|
|
85
85
|
flex-direction: column;
|
|
86
86
|
align-items: center;
|
|
87
87
|
background-color: ${e=>e.theme.colors.grey4};
|
|
88
|
-
`,Pi=X(function(e,t){const l=L.getSignedInUser(),n=je(l),c=Vt(e,ae,t.isBulkActionEnabled,l?.userId);let r=c.allSubTabs;t.isUserHasOnlyBillpayAccess&&t.roleMap&&c.currentTab==="pending_approval"&&(t.roleMap.bill_pay_analyst?r=r.filter(b=>b==="all"||b==="overdue"||b==="rejected"||b==="deleted"):t.roleMap.bill_pay_approver&&(r=r.filter(b=>b==="all"||b==="awaiting_my_approval"||b==="overdue"||b==="rejected"||b==="deleted"))),t.isShowDeletedBillsEnabled===!1&&(r=r.filter(b=>b!=="deleted"));const
|
|
88
|
+
`,Pi=X(function(e,t){const l=L.getSignedInUser(),n=je(l),c=Vt(e,ae,t.isBulkActionEnabled,l?.userId);let r=c.allSubTabs;t.isUserHasOnlyBillpayAccess&&t.roleMap&&c.currentTab==="pending_approval"&&(t.roleMap.bill_pay_analyst?r=r.filter(b=>b==="all"||b==="overdue"||b==="rejected"||b==="deleted"):t.roleMap.bill_pay_approver&&(r=r.filter(b=>b==="all"||b==="awaiting_my_approval"||b==="overdue"||b==="rejected"||b==="deleted"))),t.isShowDeletedBillsEnabled===!1&&(r=r.filter(b=>b!=="deleted"));const p=e.entityAutoCompleteState.autoCompleteText.common,o=We(e,"common"),s=e.tenantState.currentTenantId,i=Z(e),d=i?.companyName??"",u={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},h=e.billListState.downloadUIState.downloadState,g=c.fetchState,m=Ta(e);return{transactionList:t.isShowDeletedBillsEnabled?c.transactions:c.transactions.filter(b=>b.isDeleted===!1),currentTab:c.currentTab,currentSubTab:c.currentSubTab,approvalCount:c.approvalCount,allSubTabs:r,fetchState:g,analytics:j,botEmail:c.billPayBotEmail,searchText:c.searchText,filters:c.filters,vendorSearchAutoCompleteData:{autoCompleteText:p,entityAutoCompleteView:o},downloadParams:{authParams:u,companyName:d,timePeriod:ae,spendManagementEndPoint:`${Ke}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:h,isBulkActionAllowed:c.billListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:c.billListBulkActionInfo?.billsSelectedForBulkAction,allowedBulkActions:c.billListBulkActionInfo?.allowedBulkActions,isZeniUser:n,billPayApprovalRulesAffectedEntityIds:m.affectedEntityIds}},function(e,t){const{navigate:l,currentTenant:n,location:c,period:r}=t,{tenantEmailDomain:p}=n;return{updateTabToState:o=>{e(pe()),e(Rt(o))},onSubtabChange:o=>{e(pe()),e(Lt(o))},onTransactionClick:(o,s)=>{const i=Pe(p,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);l(i,{state:{pathnameStackToGoBack:d}})},onClickSetupIcon:()=>{const o=Ri(p),s=D(c.state?.pathnameStackToGoBack,c.pathname);l(o,{state:{pathnameStackToGoBack:s}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;j?.trackBillPayNewBill();const s=`/${o}/bill/new`,i=D(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(s,{state:{pathnameStackToGoBack:i}})},onSearchTextChanged:o=>{e(_a(o))},onReloadTransactions:()=>{e(Me(r,!0,t.isShowDeletedBillsEnabled,t.isInternationalWireEnabled)),e(Ma(n.companyId,!0))},onNavigateToSettings:()=>{l("../bills/setup")},onBackClick:()=>{l("../",{relative:"path"})},onFiltersChange:o=>{e(Ua({filters:o})),o.categories.every(s=>s.field!=null&&s.values?.length!==0)&&j.trackSpendManagmentFilterChange("bill_pay",o.categories.map(s=>`${s.field}-${JSON.stringify(s.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&j.trackSpendManagementDownloadClick("bill_pay"),e($a({uiState:{downloadState:o}}))},updateBulkActionList:o=>{e(Va(o))},removeAllTransactionsFromBulkActionList:()=>{e(pe())},onProceedForBulkActionClick:(o,s)=>{switch(o){case"delete":case"cancel":e(La(o,s??""));break;case"send_for_approval":e(lt("send_for_approval")),t.navigate("./bulk-review");break;case"approve":e(lt("approve")),t.navigate("./bulk-review");break;case"review":e(Ra()),t.navigate("./bulk-review")}},onBillPayApprovalRulesEventReceived:o=>{o.endsWith(_e)&&e(Fa(!1))},onEventReceived:o=>{o===aa&&e(Pa())},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(qe({searchString:o,entityType:"vendor",searchOrigin:"common"})):o.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}}}})(qn(Jn));function Fi(){const{isAiCfoOpen:e,setIsAiCfoOpen:t}=Je(),l=K(),n=re(),c=Q(),r=we(),p=c.state,o=ve(),[s,i]=f.useState(!1),[d,u]=f.useState(null),h=la("/:tenantEmailDomain/bills/bulk-review")!=null;f.useEffect(()=>(p?.tab!=null&&p?.subTab!=null&&(n(Rt(p?.tab)),n(Lt(p?.subTab))),()=>{n(pe())}),[]);const g=L.getSignedInUser(),m=k(P=>Z(P)),{areTenantIdsInSync:b}=Wn(),[A,T]=f.useState(!1),{useFeatureGate:I}=oe(),{isFeatureEnabled:v}=I(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:H}=I(y.isBillPayCommentingEnabled),{isFeatureEnabled:M}=I(y.isReimbursementCommentingEnabled),{isFeatureEnabled:_}=I(y.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:F}=I(y.isBillPayBulkActionEnabled),{isFeatureEnabled:x}=I(y.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:$}=I(y.isBillPayDetectInsufficientFundsEnabled),U=k(P=>Vt(P,ae,F,g?.userId)),{isFeatureEnabled:B}=I(y.isDebitCardFeatureEnabled),O=U.fetchState,{isAiCfoAccessEnabled:W,onAskAiCfoClick:q}=tt({isAiCfoOpen:e,setIsAiCfoOpen:t,mobileExploreReferrer:"Bills List"});at({isDataReady:O==="Completed"});const J=!!m.companyBillPayInfo?.info?.isBillPayTOSAccepted,G=!!m.companyBillPayInfo?.info?.isBillPayEnabled,le=k(P=>Ca(P.companyState,m.companyId)),Y=le?.company.featuresActivationInfo.connectedAccountProvider;if(f.useEffect(()=>{!A&&G&&b&&(T(!0),n(Me(ae,!0,v,x)))},[A,ae,b,n]),g==null)throw Error("Can't access address page without signing in...");const w=(P,de)=>{n(Da({uiState:{sortKey:P,sortOrder:de},period:ae}))},se=$t(o?.loggedInUserRoleMap),Fe=ue(o?.loggedInUserRoleMap),Ce=P=>{i(P)},{billsProcessed:N,billsProcessing:Ae}=k(P=>Aa(P));f.useEffect(()=>{N===Ae&&d!=null&&(n(xa({messageSection:"bill_pay_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_bill_",variableValue:N>1?St.bills:St.bill},{variableName:"_has_",variableValue:N>1?yt.texts.have:yt.texts.has},{variableName:"_action_",variableValue:Ba(d)}]})),n(Ea()),setTimeout(()=>{n(Me(ae,!0,v,!0,x))},3e3),u(null))},[N,Ae]);const na={events:m.companyId!=null?[`private-${m.companyId}.${aa}`,`private-${m.companyId}.${_e}`]:[],eventCallback:(P,de,nt)=>{P.endsWith(_e)?nt.onBillPayApprovalRulesEventReceived?.(P):de?.entity_type==="bill"&&(u(de.operation_type),nt.onEventReceived(P))}},ia=Ut(B,m),oa=Mt(m);return c.pathname.endsWith("/bills/")||c.pathname.endsWith("/bills")||c.pathname.endsWith("/bills/bulk-review")?ia===!0||oa===!0?a.jsx(ea,{}):G?a.jsxs(a.Fragment,{children:[O==="Completed"?a.jsx(Te,{analytics:j,onLoad:P=>(de=>de.trackPageLoaded(Kt.Event.billPayHome))(P)}):null,a.jsxs(Ti,{windowSize:r,children:[a.jsx(Yt,{isAppContentDrawerOpen:s,handleDrawerToggle:Ce}),a.jsx(bi,{isOpen:h,drawerLeftMargin:new qt(0,0,300,600),onClose:()=>{l("./"),n(pe())},children:a.jsx(Li,{onClick:P=>P.stopPropagation(),children:a.jsx(Di,{})})}),a.jsx(Pi,{location:c,navigate:l,currentTenant:m,entity:"bill_pay",isBillPayCommentingEnabled:H,isReimbursementCommentingEnabled:M,period:ae,isAdmin:!1,uiState:U.uiState,onColumnSortConfigChanged:w,isUserHasOnlyBillpayAccess:se,isShowDeletedBillsEnabled:v,isShowDeletedReimbursementEnabled:_,isBulkActionEnabled:F,roleMap:o?.loggedInUserRoleMap,onClickMenuIcon:()=>{Ce(!0)},isDownloadEnabled:U.isDownloadEnabled,connectedAccountProvider:Y,bulkSubmissionLimit:U.billBulkSubmissionLimit,bulkSubmissionFetchState:U.billListBulkActionInfo.bulkSubmissionFetchState,isRecurringBillInBulkActionList:U.billListBulkActionInfo.isRecurringBillInBulkActionList,isInternationalWireEnabled:x,isDetectInsufficientFundsEnabled:$,isAiCfoAccessEnabled:W,onAskAiCfoClick:q,...na})]})]}):J===!0&&Fe===!0?a.jsx(ee,{to:"../setup"}):o!=null&&He(m,o.loggedInUserRoleMap)?a.jsx(ee,{to:"../promo"}):a.jsx(ce,{fetchState:O}):a.jsx(De,{})}const Ri=e=>`/${e}/bills/setup`,Li=V(di)`
|
|
89
89
|
display: flex;
|
|
90
90
|
min-height: 100%;
|
|
91
91
|
flex-direction: column;
|
|
92
|
-
`,{common:{currency:ye},spendManagement:{billPay:{billDetails:Vi}},appName:$i}=Qe.getLocalizedStrings(),Ui=X(function(e,t){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=z(t.location.state?.pathnameStackToGoBack);let u=!0;r.poppedPathname?.includes("bills")===!0&&(u=!1);const o=e.entityAutoCompleteState.autoCompleteText.common,s=We(e,"common");let i=`${l?.firstName} ${l?.lastName}`;const d=je(l);t.billId!=null&&t.billDetailsView!=null&&(i=`${t.billDetailsView.createdBy?.firstName??$i} ${t.billDetailsView.createdBy?.lastName??""}`),d||!t.billDetailsView.createdBy?.email?.includes("zeni.ai")||(i="Zeni");const p=t.billDetailsView.editBillInitialDetails?.totalAmount?.amount,h=za(t.billDetailsView.paymentDetailsSection?.paymentType?.method),g=t.currentTenant.createTime,m=Ot(),b=t.sameDayAchDisablementConfig.newTenantTenureLimitMonths,A=g.add(b,"month").isAfter(m),T=!!(t.billDetailsView.billStage==="draft"&&h&&p!=null&&p>0)&&!Nt(p,t.billDetailsView.approvalRules.allApprovalRules,l),I=Z(e);return{billDetails:t.billDetailsView,isAccountingClassesEnabled:Dt(e),billId:t.billId,createdBy:i,createTime:t.billDetailsView?.createTime,authParams:c,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,analytics:j,showBackButton:u,isAdmin:t.isBillPayAdmin,isSuperAdmin:t.isSuperAdmin,connectedAccountProvider:I.company?.featuresActivationInfo.connectedAccountProvider??"",customerSearchAutoCompleteData:{autoCompleteText:o,entityAutoCompleteView:s},showMarkAsPaidInfo:T,isZeniUser:d,isNewUser:A,sameDayAchDisablementConfig:t.sameDayAchDisablementConfig}},function(e,t){const{billId:l,companyId:n,currentTenant:c,location:r,navigate:u,billDetailsView:o}=t,{tenantEmailDomain:s}=c;return{editVendor:i=>{e(st(i));const d=It(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},chooseNewVendor:i=>{const d=i??t.billDetailsView.addBillAutoFields.tentativeVendorName;d!=null&&e(Zt(d,!1)),e(Ht({localData:{vendorName:i??t.billDetailsView.addBillAutoFields.tentativeVendorName}})),e(st());const p=It(s,void 0,l),h=D(r.state?.pathnameStackToGoBack,r.pathname);u(p,{state:{pathnameStackToGoBack:h}})},onInvoiceUpload:i=>{i!=null&&e(Ze(i,t.isVendorRecommendationEnabled))},updateShowAutofill:i=>{e(ze(i))},onSaveChangesToLocalStore:(i,d,p,h,g)=>{const m=Oi(t.billDetailsView,{...i,paymentDetails:{...i?.paymentDetails,paymentDate:g}},p,d,t.isInternationalPaymentShaVsOurEnabled,h,t.vendor);e(Ya({billDetailLocalData:m,billId:l}))},saveBillDetails:()=>{e(Oe("draft",!1,!1,l)),e(ie("common"))},updateBillDetailSaveBillCode:()=>{e(zt("draft"))},reviewBillDetails:()=>{const i=Mi(s,l),d=D(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d,message:"coming_from_edit_page"}})},discardBillDetailsFromLocalStore:({billId:i})=>{e(Ie({billId:i}))},clearBillPayReviewLocalState:()=>e(Xa()),onClickDismiss:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d}})},onClickDiscard:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d}})},setBillDetailPageMode:i=>{if(i==="edit_bill"){let d=window.location.pathname;d=d.concat("/edit");const p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})}},redirectToACHScreen:i=>{e(fe(!1,i));const d=_i(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToWireScreen:i=>{e(fe(!1,i));const d=Gi(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToInternationalScreen:i=>{e(fe(!1,i));const d=Qt(s,l,i),p=D(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToBillsScreen:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);e(Ie({})),u(i,{state:{pathnameStackToGoBack:d}})},redirectToBillDetailPage:()=>{t.navigate("../")},deleteBill:()=>{l!=null&&e(Pt(l))},onAttachmentClick:(i,d)=>{const p=Pe(s,i,d);window.open(`${p}`,"_blank")},onBackClick:()=>{const i=z(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ne(s);u(d,{state:{pathnameStackToGoBack:i.newStack}})},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(qe({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}},addVendorContactEmail(i,d){e(Qa(i,d,l))},onWiseVerifyClick:()=>{let i="";i=Yn()?"https://sandbox.transferwise.tech":"https://wise.com";const d=`${i}/login`;window.open(d,"_blank")},onVendorSelected:i=>{e(Ka(!0,i,l))},onSignUpAccountClick:()=>{t.hasZeniAccountsAdminAccess?window.open(`/${s}/checking/promo`,"_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onMoveMoneyClick:()=>{t.isZeniAccountsUser?window.open(`/${s}/checking/transfer`):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onInternationalWireVerifyClick:()=>{window.open(`/${s}/bills/international-wire`)},onFetchLinkTokenClick:(i,d)=>{e(Ja("bill_pay_detail",i,d))},onEstablishConnectionClick:i=>{e(qa(i,n,"bill_pay_detail","bill_pay"))},onUpdatePaymentAccountStatus:(i,d,p)=>{e(Wa(i,d,"bill_pay","bill_pay_detail",p))},onEstablishConnectionSuccess:()=>{e(Za("bill_pay","bill_pay_detail")),e(Ha({billId:l,withdrawFromAccountId:o.newAddedBillPaymentAccountId,withdrawFromList:o.withdrawFromList}))}}})(Kn);function ft(){const e=K(),t=Q(),l=re(),{billId:n,tenantEmailDomain:c}=te(),{useFeatureGate:r,useDynamicConfig:u}=oe(),{isFeatureEnabled:o,isFeatureGateLoading:s}=r(S.isVendorMagicLinkFeatureEnabled),{isFeatureEnabled:i}=r(S.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:d}=r(S.isBillPayCommentingEnabled),{isFeatureEnabled:p}=r(S.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:h}=r(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=r(S.isRecurringBillsFeatureEnabled),{isFeatureEnabled:m}=r(S.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=r(S.isShaDisabled),{isFeatureEnabled:A}=r(S.isOurDisabled),{isFeatureEnabled:T}=r(S.isBillPayDetectInsufficientFundsEnabled),{configValue:I}=u(Ee.zeniAccountsConfig),v=Ga(I),{configValue:H}=u(Ee.sameDayAchDisablementConfig),M=Oa(H),_=L.getSignedInUser(),F=k(N=>Z(N)),x=k(N=>Ne(N,h,m,n)),$=Xt(F?.companyId,{clearParams:x.fetchState==="Completed"}),{isAiCfoOpen:U,setIsAiCfoOpen:B}=Je(),{isAiCfoAccessEnabled:O,onAskAiCfoClick:W}=tt({isAiCfoOpen:U,setIsAiCfoOpen:B,mobileExploreReferrer:"Bill Details"});at({isDataReady:x.fetchState==="Completed"});const q=F.companyId??L.getSignedInUserTenant(c)?.companyId,J=!!F.companyZeniAccountInfo?.info?.isZeniAccountEnabled,G=ve(),le=_t(G?.loggedInUserRoleMap),Y=Gt(G?.loggedInUserRoleMap),w=pe(G?.loggedInUserRoleMap),se=xt(F.userRole);if(f.useEffect(()=>{n!=null&&l(Bt(n))},[n]),_==null)throw Error("Can't access address page without signing in...");const Fe=k(N=>Na(N.accountState,N.accountListState,"billPayAccountList")),Ce={pathname:"../",search:t.search};return x.isDeleted===!0||x.billStage=="paid"||x.fetchState=="Not-Started"?a.jsx(ee,{to:Ce}):x.deleteStatus.fetchState==="In-Progress"||s?a.jsx(ce,{fetchState:x.deleteStatus.fetchState}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:N=>(Ae=>{n!=null&&x.deleteStatus.fetchState!=="Completed"&&Ae.trackBillPayEditBill(n,x.isRecurring)})(N)}),a.jsx(Ui,{initialOpenThreadRequest:$??void 0,location:t,navigate:e,currentTenant:F,billId:n,companyId:q,billDetailsView:x,isMagicLinkEnabled:o,isVendorRecommendationEnabled:h,isLocalCurrencyEnabled:p,uncategorizedAccounts:Fe,isInternationalPaymentShaVsOurEnabled:i,vendor:x.vendor,isBillPayCommentingEnabled:d,isShaDisabled:b,isOurDisabled:A,isRecurringBillsFeatureEnabled:g,isAccountsEnabled:J,hasZeniAccountsAdminAccess:le,isZeniAccountsUser:Y,isBillPayAdmin:w,isSuperAdmin:se,accountsPromoConfig:v,isDetectInsufficientFundsEnabled:T,sameDayAchDisablementConfig:M,isAiCfoAccessEnabled:O,onAskAiCfoClick:W})]})}const It=(e,t,l)=>{let n=`/${e}/bill/`;return l==null?n=t!=null?n.concat(`new/vendor/${encodeURIComponent(t)}/edit`):n.concat("new/vendor/create"):(n=n.concat(`${encodeURIComponent(l)}/edit/vendor/`),n=t!=null?n.concat(`${encodeURIComponent(t)}/edit`):n.concat("create")),n},Mi=(e,t)=>{let l=`/${e}/bill/`;return l=t===void 0?l.concat("new/review"):l.concat(`${t}/edit/review`),l},_i=(e,t,l)=>{let n=`/${e}/bill/`;return n=l!=null?n.concat(`${encodeURIComponent(l)}/edit/`):n.concat("new/"),n=n.concat(`vendor/${encodeURIComponent(t)}/edit/ach`),n},Gi=(e,t,l)=>{let n=`/${e}/bill/`;return n=l!=null?n.concat(`${encodeURIComponent(l)}/edit/`):n.concat("new/"),n=n.concat(`vendor/${encodeURIComponent(t)}/edit/domestic`),n},R="paymentDetails",Oi=(e,t,l,n,c,r,u)=>{const o={invoiceNumber:t.whatFor.invoiceNumber,memo:t.whatFor.memo,invoiceDate:t.whatFor.invoiceDate?be(t.whatFor.invoiceDate.toString()):Ot(),billDueDate:t.whatFor.billDueDate?be(t.whatFor.billDueDate.toString()):void 0,currencyCode:t.whatFor.currency,recipientCurrencyCode:t.whatFor.recipientCurrency,isInvoiceDateAutoUpdated:t.whatFor.isInvoiceDateAutoUpdated},s={paymentDate:t[R]?.paymentDate?be(t[R].paymentDate.toString()):void 0,paymentType:t[R]?.paymentType!=null?t[R]?.paymentType:void 0,paymentTo:r?.id,withdrawFrom:e.withdrawFromList.find(b=>b.id===t[R]?.withdrawFrom?.selectedOption),internationalTransferFeeBearerPaymentMethod:t[R]?.paymentType?.method!=null&&t[R].paymentType.method.includes(en)&&u?.vendorCurrencyCode===ye.currencyCode&&c?t[R]?.internationalTransferFeeBearerPaymentMethod:void 0,conversionRate:e.paymentDetailsSection?.conversionRate},i=r?.type==="Contact"?r?.email:void 0,d=!!i,p=t[R]?.recurringPaymentType?.selectedOption===Vi.recurringBill.paymentTypeOptions[1],h={isActive:e.recurringConfig?.isActive??!1,currentInstance:e.recurringConfig?.currentInstance,isApprovalRequired:t[R]?.recurringPaymentDetails?.requireApproval?.selectedOption==="all",frequency:tn(t[R]?.recurringPaymentDetails?.frequency?.selectedOption),endDate:t[R]?.recurringPaymentDetails?.endDateSelector?.date!=null?be(t[R]?.recurringPaymentDetails?.endDateSelector.date.toString()):void 0,startDate:t[R]?.recurringPaymentDetails?.startDate?be(t[R]?.recurringPaymentDetails?.startDate.toString()):void 0,endDateSelectorOptionType:t[R]?.recurringPaymentDetails?.endDateSelector?.type,totalPaymentCycles:t[R]?.recurringPaymentDetails?.endDateSelector?.recurringCount??0,updateRecurringBills:t[R]?.recurringPaymentDetails?.updateRecurringBills},g=Ni(e.accountList.accounts,e.classList.classes,e.lineDetailSection,t.lineItems,n,l),m=Object.keys(g).length>0?Qn(g):e.editBillInitialDetails?.recipientTotalAmount;return{showVendorGptRecommendationText:e.showVendorGptRecommendationText,vendor:u,whatForSection:o,paymentDetailsSection:s,isCancelled:e.isCancelled,totalAmount:m,recipientTotalAmount:m,file:e.file,updatesByLineId:g,toAccountVendorEmail:i,isCollectToAccountInfoFromVendorContact:d,isRecurring:p,recurringConfig:h}},Ni=(e,t,l,n,c,r)=>{const u={};return n.forEach(o=>{let s,i;o.account.selectedOption!=null&&(s=e.find(p=>p.qboId===o.account.selectedOption||p.accountId===o.account.selectedOption)),o.class?.selectedOption!=null&&(i=t.find(p=>p.classId===o.class.selectedOption));const d=Xn(l[o.lineId],o,c,r);u[o.lineId]={...l[o.lineId],...o,platformLineDetailType:l[o.lineId]?.platformLineDetailType??"account_based_expense_line_detail",amount:{amount:o.amount??0,currencyCode:o.currency?.currencyCode??ye.currencyCode,currencySymbol:o.currency?.currencySymbol??ye.currencySymbol},recipientAmount:{amount:o.recipientAmount??0,currencyCode:o.recipientCurrency?.currencyCode??ye.currencyCode,currencySymbol:o.recipientCurrency?.currencySymbol??ye.currencySymbol},id:o.lineId,lineDescription:o.lineDescription??"",account:s,class:i,billable:o.billable?.selectedOption??"not_billable",customer:{id:d?.id??"",name:d?.name??"",qboId:d?.qboId,logo:d?.logo},type:"journal_entry_transaction_line",isCategoryMiscategorized:!1,isClassMiscategorized:!1}}),u},zi=V.div`
|
|
92
|
+
`,{common:{currency:Se},spendManagement:{billPay:{billDetails:Vi}},appName:$i}=Qe.getLocalizedStrings(),Ui=X(function(e,t){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=z(t.location.state?.pathnameStackToGoBack);let p=!0;r.poppedPathname?.includes("bills")===!0&&(p=!1);const o=e.entityAutoCompleteState.autoCompleteText.common,s=We(e,"common");let i=`${l?.firstName} ${l?.lastName}`;const d=je(l);t.billId!=null&&t.billDetailsView!=null&&(i=`${t.billDetailsView.createdBy?.firstName??$i} ${t.billDetailsView.createdBy?.lastName??""}`),d||!t.billDetailsView.createdBy?.email?.includes("zeni.ai")||(i="Zeni");const u=t.billDetailsView.editBillInitialDetails?.totalAmount?.amount,h=za(t.billDetailsView.paymentDetailsSection?.paymentType?.method),g=t.currentTenant.createTime,m=Ot(),b=t.sameDayAchDisablementConfig.newTenantTenureLimitMonths,A=g.add(b,"month").isAfter(m),T=!!(t.billDetailsView.billStage==="draft"&&h&&u!=null&&u>0)&&!Nt(u,t.billDetailsView.approvalRules.allApprovalRules,l),I=Z(e);return{billDetails:t.billDetailsView,isAccountingClassesEnabled:Dt(e),billId:t.billId,createdBy:i,createTime:t.billDetailsView?.createTime,authParams:c,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,analytics:j,showBackButton:p,isAdmin:t.isBillPayAdmin,isSuperAdmin:t.isSuperAdmin,connectedAccountProvider:I.company?.featuresActivationInfo.connectedAccountProvider??"",customerSearchAutoCompleteData:{autoCompleteText:o,entityAutoCompleteView:s},showMarkAsPaidInfo:T,isZeniUser:d,isNewUser:A,sameDayAchDisablementConfig:t.sameDayAchDisablementConfig}},function(e,t){const{billId:l,companyId:n,currentTenant:c,location:r,navigate:p,billDetailsView:o}=t,{tenantEmailDomain:s}=c;return{editVendor:i=>{e(st(i));const d=It(s,i,l),u=D(r.state?.pathnameStackToGoBack,r.pathname);p(d,{state:{pathnameStackToGoBack:u}})},chooseNewVendor:i=>{const d=i??t.billDetailsView.addBillAutoFields.tentativeVendorName;d!=null&&e(Zt(d,!1)),e(Ht({localData:{vendorName:i??t.billDetailsView.addBillAutoFields.tentativeVendorName}})),e(st());const u=It(s,void 0,l),h=D(r.state?.pathnameStackToGoBack,r.pathname);p(u,{state:{pathnameStackToGoBack:h}})},onInvoiceUpload:i=>{i!=null&&e(Ze(i,t.isVendorRecommendationEnabled))},updateShowAutofill:i=>{e(ze(i))},onSaveChangesToLocalStore:(i,d,u,h,g)=>{const m=Oi(t.billDetailsView,{...i,paymentDetails:{...i?.paymentDetails,paymentDate:g}},u,d,t.isInternationalPaymentShaVsOurEnabled,h,t.vendor);e(Ya({billDetailLocalData:m,billId:l}))},saveBillDetails:()=>{e(Oe("draft",!1,!1,l)),e(ie("common"))},updateBillDetailSaveBillCode:()=>{e(zt("draft"))},reviewBillDetails:()=>{const i=Mi(s,l),d=D(r.state?.pathnameStackToGoBack,r.pathname);p(i,{state:{pathnameStackToGoBack:d,message:"coming_from_edit_page"}})},discardBillDetailsFromLocalStore:({billId:i})=>{e(Ie({billId:i}))},clearBillPayReviewLocalState:()=>e(Xa()),onClickDismiss:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);p(i,{state:{pathnameStackToGoBack:d}})},onClickDiscard:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);p(i,{state:{pathnameStackToGoBack:d}})},setBillDetailPageMode:i=>{if(i==="edit_bill"){let d=window.location.pathname;d=d.concat("/edit");const u=D(r.state?.pathnameStackToGoBack,r.pathname);p(d,{state:{pathnameStackToGoBack:u}})}},redirectToACHScreen:i=>{e(fe(!1,i));const d=_i(s,i,l),u=D(r.state?.pathnameStackToGoBack,r.pathname);p(d,{state:{pathnameStackToGoBack:u}})},redirectToWireScreen:i=>{e(fe(!1,i));const d=Gi(s,i,l),u=D(r.state?.pathnameStackToGoBack,r.pathname);p(d,{state:{pathnameStackToGoBack:u}})},redirectToInternationalScreen:i=>{e(fe(!1,i));const d=Qt(s,l,i),u=D(r.state?.pathnameStackToGoBack,r.pathname);p(d,{state:{pathnameStackToGoBack:u}})},redirectToBillsScreen:()=>{const i=ne(s),d=D(r.state?.pathnameStackToGoBack,r.pathname);e(Ie({})),p(i,{state:{pathnameStackToGoBack:d}})},redirectToBillDetailPage:()=>{t.navigate("../")},deleteBill:()=>{l!=null&&e(Pt(l))},onAttachmentClick:(i,d)=>{const u=Pe(s,i,d);window.open(`${u}`,"_blank")},onBackClick:()=>{const i=z(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ne(s);p(d,{state:{pathnameStackToGoBack:i.newStack}})},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(qe({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}},addVendorContactEmail(i,d){e(Qa(i,d,l))},onWiseVerifyClick:()=>{let i="";i=Yn()?"https://sandbox.transferwise.tech":"https://wise.com";const d=`${i}/login`;window.open(d,"_blank")},onVendorSelected:i=>{e(Ka(!0,i,l))},onSignUpAccountClick:()=>{t.hasZeniAccountsAdminAccess?window.open(`/${s}/checking/promo`,"_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onMoveMoneyClick:()=>{t.isZeniAccountsUser?window.open(`/${s}/checking/transfer`):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onInternationalWireVerifyClick:()=>{window.open(`/${s}/bills/international-wire`)},onFetchLinkTokenClick:(i,d)=>{e(Ja("bill_pay_detail",i,d))},onEstablishConnectionClick:i=>{e(qa(i,n,"bill_pay_detail","bill_pay"))},onUpdatePaymentAccountStatus:(i,d,u)=>{e(Wa(i,d,"bill_pay","bill_pay_detail",u))},onEstablishConnectionSuccess:()=>{e(Za("bill_pay","bill_pay_detail")),e(Ha({billId:l,withdrawFromAccountId:o.newAddedBillPaymentAccountId,withdrawFromList:o.withdrawFromList}))}}})(Kn);function ft(){const e=K(),t=Q(),l=re(),{billId:n,tenantEmailDomain:c}=te(),{useFeatureGate:r,useDynamicConfig:p}=oe(),{isFeatureEnabled:o,isFeatureGateLoading:s}=r(y.isVendorMagicLinkFeatureEnabled),{isFeatureEnabled:i}=r(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:d}=r(y.isBillPayCommentingEnabled),{isFeatureEnabled:u}=r(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:h}=r(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=r(y.isRecurringBillsFeatureEnabled),{isFeatureEnabled:m}=r(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=r(y.isShaDisabled),{isFeatureEnabled:A}=r(y.isOurDisabled),{isFeatureEnabled:T}=r(y.isBillPayDetectInsufficientFundsEnabled),{configValue:I}=p(Ee.zeniAccountsConfig),v=Ga(I),{configValue:H}=p(Ee.sameDayAchDisablementConfig),M=Oa(H),_=L.getSignedInUser(),F=k(N=>Z(N)),x=k(N=>Ne(N,h,m,n)),$=Xt(F?.companyId,{clearParams:x.fetchState==="Completed"}),{isAiCfoOpen:U,setIsAiCfoOpen:B}=Je(),{isAiCfoAccessEnabled:O,onAskAiCfoClick:W}=tt({isAiCfoOpen:U,setIsAiCfoOpen:B,mobileExploreReferrer:"Bill Details"});at({isDataReady:x.fetchState==="Completed"});const q=F.companyId??L.getSignedInUserTenant(c)?.companyId,J=!!F.companyZeniAccountInfo?.info?.isZeniAccountEnabled,G=ve(),le=_t(G?.loggedInUserRoleMap),Y=Gt(G?.loggedInUserRoleMap),w=ue(G?.loggedInUserRoleMap),se=xt(F.userRole);if(f.useEffect(()=>{n!=null&&l(Bt(n))},[n]),_==null)throw Error("Can't access address page without signing in...");const Fe=k(N=>Na(N.accountState,N.accountListState,"billPayAccountList")),Ce={pathname:"../",search:t.search};return x.isDeleted===!0||x.billStage=="paid"||x.fetchState=="Not-Started"?a.jsx(ee,{to:Ce}):x.deleteStatus.fetchState==="In-Progress"||s?a.jsx(ce,{fetchState:x.deleteStatus.fetchState}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:N=>(Ae=>{n!=null&&x.deleteStatus.fetchState!=="Completed"&&Ae.trackBillPayEditBill(n,x.isRecurring)})(N)}),a.jsx(Ui,{initialOpenThreadRequest:$??void 0,location:t,navigate:e,currentTenant:F,billId:n,companyId:q,billDetailsView:x,isMagicLinkEnabled:o,isVendorRecommendationEnabled:h,isLocalCurrencyEnabled:u,uncategorizedAccounts:Fe,isInternationalPaymentShaVsOurEnabled:i,vendor:x.vendor,isBillPayCommentingEnabled:d,isShaDisabled:b,isOurDisabled:A,isRecurringBillsFeatureEnabled:g,isAccountsEnabled:J,hasZeniAccountsAdminAccess:le,isZeniAccountsUser:Y,isBillPayAdmin:w,isSuperAdmin:se,accountsPromoConfig:v,isDetectInsufficientFundsEnabled:T,sameDayAchDisablementConfig:M,isAiCfoAccessEnabled:O,onAskAiCfoClick:W})]})}const It=(e,t,l)=>{let n=`/${e}/bill/`;return l==null?n=t!=null?n.concat(`new/vendor/${encodeURIComponent(t)}/edit`):n.concat("new/vendor/create"):(n=n.concat(`${encodeURIComponent(l)}/edit/vendor/`),n=t!=null?n.concat(`${encodeURIComponent(t)}/edit`):n.concat("create")),n},Mi=(e,t)=>{let l=`/${e}/bill/`;return l=t===void 0?l.concat("new/review"):l.concat(`${t}/edit/review`),l},_i=(e,t,l)=>{let n=`/${e}/bill/`;return n=l!=null?n.concat(`${encodeURIComponent(l)}/edit/`):n.concat("new/"),n=n.concat(`vendor/${encodeURIComponent(t)}/edit/ach`),n},Gi=(e,t,l)=>{let n=`/${e}/bill/`;return n=l!=null?n.concat(`${encodeURIComponent(l)}/edit/`):n.concat("new/"),n=n.concat(`vendor/${encodeURIComponent(t)}/edit/domestic`),n},R="paymentDetails",Oi=(e,t,l,n,c,r,p)=>{const o={invoiceNumber:t.whatFor.invoiceNumber,memo:t.whatFor.memo,invoiceDate:t.whatFor.invoiceDate?be(t.whatFor.invoiceDate.toString()):Ot(),billDueDate:t.whatFor.billDueDate?be(t.whatFor.billDueDate.toString()):void 0,currencyCode:t.whatFor.currency,recipientCurrencyCode:t.whatFor.recipientCurrency,isInvoiceDateAutoUpdated:t.whatFor.isInvoiceDateAutoUpdated},s={paymentDate:t[R]?.paymentDate?be(t[R].paymentDate.toString()):void 0,paymentType:t[R]?.paymentType!=null?t[R]?.paymentType:void 0,paymentTo:r?.id,withdrawFrom:e.withdrawFromList.find(b=>b.id===t[R]?.withdrawFrom?.selectedOption),internationalTransferFeeBearerPaymentMethod:t[R]?.paymentType?.method!=null&&t[R].paymentType.method.includes(en)&&p?.vendorCurrencyCode===Se.currencyCode&&c?t[R]?.internationalTransferFeeBearerPaymentMethod:void 0,conversionRate:e.paymentDetailsSection?.conversionRate},i=r?.type==="Contact"?r?.email:void 0,d=!!i,u=t[R]?.recurringPaymentType?.selectedOption===Vi.recurringBill.paymentTypeOptions[1],h={isActive:e.recurringConfig?.isActive??!1,currentInstance:e.recurringConfig?.currentInstance,isApprovalRequired:t[R]?.recurringPaymentDetails?.requireApproval?.selectedOption==="all",frequency:tn(t[R]?.recurringPaymentDetails?.frequency?.selectedOption),endDate:t[R]?.recurringPaymentDetails?.endDateSelector?.date!=null?be(t[R]?.recurringPaymentDetails?.endDateSelector.date.toString()):void 0,startDate:t[R]?.recurringPaymentDetails?.startDate?be(t[R]?.recurringPaymentDetails?.startDate.toString()):void 0,endDateSelectorOptionType:t[R]?.recurringPaymentDetails?.endDateSelector?.type,totalPaymentCycles:t[R]?.recurringPaymentDetails?.endDateSelector?.recurringCount??0,updateRecurringBills:t[R]?.recurringPaymentDetails?.updateRecurringBills},g=Ni(e.accountList.accounts,e.classList.classes,e.lineDetailSection,t.lineItems,n,l),m=Object.keys(g).length>0?Qn(g):e.editBillInitialDetails?.recipientTotalAmount;return{showVendorGptRecommendationText:e.showVendorGptRecommendationText,vendor:p,whatForSection:o,paymentDetailsSection:s,isCancelled:e.isCancelled,totalAmount:m,recipientTotalAmount:m,file:e.file,updatesByLineId:g,toAccountVendorEmail:i,isCollectToAccountInfoFromVendorContact:d,isRecurring:u,recurringConfig:h}},Ni=(e,t,l,n,c,r)=>{const p={};return n.forEach(o=>{let s,i;o.account.selectedOption!=null&&(s=e.find(u=>u.qboId===o.account.selectedOption||u.accountId===o.account.selectedOption)),o.class?.selectedOption!=null&&(i=t.find(u=>u.classId===o.class.selectedOption));const d=Xn(l[o.lineId],o,c,r);p[o.lineId]={...l[o.lineId],...o,platformLineDetailType:l[o.lineId]?.platformLineDetailType??"account_based_expense_line_detail",amount:{amount:o.amount??0,currencyCode:o.currency?.currencyCode??Se.currencyCode,currencySymbol:o.currency?.currencySymbol??Se.currencySymbol},recipientAmount:{amount:o.recipientAmount??0,currencyCode:o.recipientCurrency?.currencyCode??Se.currencyCode,currencySymbol:o.recipientCurrency?.currencySymbol??Se.currencySymbol},id:o.lineId,lineDescription:o.lineDescription??"",account:s,class:i,billable:o.billable?.selectedOption??"not_billable",customer:{id:d?.id??"",name:d?.name??"",qboId:d?.qboId,logo:d?.logo},type:"journal_entry_transaction_line",isCategoryMiscategorized:!1,isClassMiscategorized:!1}}),p},zi=V.div`
|
|
93
93
|
display: flex;
|
|
94
94
|
height: 100vh;
|
|
95
95
|
width: 100%;
|
|
@@ -98,7 +98,7 @@ import{j as a}from"./liveblocks-B5kNfPMX.js";import{j as K,h as re,u as Q,l as t
|
|
|
98
98
|
align-items: center;
|
|
99
99
|
background-color: ${e=>e.theme.colors.grey4};
|
|
100
100
|
box-shadow: ${e=>`0px 2px ${E.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
101
|
-
`,Zi=X(function(e,t){const{vendorId:l,billId:n}=t,c=ke(e,l),r=Ne(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,n);return{billId:n,isDisabled:c.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:c,file:r.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{billId:l,navigate:n,location:c,vendorId:r,currentTenant:
|
|
101
|
+
`,Zi=X(function(e,t){const{vendorId:l,billId:n}=t,c=ke(e,l),r=Ne(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,n);return{billId:n,isDisabled:c.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:c,file:r.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{billId:l,navigate:n,location:c,vendorId:r,currentTenant:p}=t,{tenantEmailDomain:o}=p;return{onFetchBankNameBySwift:s=>{e(ln(s))},onSaveHandler:()=>{e(on(t.bankAccountContext,r))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:i}=s;e(nn({data:i}))},onCancel:()=>{(()=>{const s=z(c.state?.pathnameStackToGoBack),i=s.poppedPathname??kt();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(rt())},onAddressClick:s=>{const i=et(o,s,l),d=D(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(an({fetchState:"Not-Started"}));const s=z(t.location.state?.pathnameStackToGoBack),i=s.poppedPathname??kt(0);t.navigate(i,{state:{pathnameStackToGoBack:s.newStack}}),e(rt())}}})(ei);function Hi(){const e=K(),t=Q(),l=we(),{vendorId:n,billId:c}=te(),{useFeatureGate:r}=oe(),p=me(),o=L.getSignedInUser(),s=k(m=>Z(m)),i=z(t.state?.pathnameStackToGoBack),d=i.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail",u=k(m=>ke(m,n)),{isFeatureEnabled:h}=r(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=r(y.isDepositAccountsFeatureEnabled);if(o==null)throw Error("Can't access address page without signing in...");return d==="billDetail"&&u.editVendorState?.saveStatus.fetchState==="In-Progress"?a.jsx(ce,{fetchState:u.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:p.colors.grey5,boxShadow:`0px 2px ${E.sp1} ${p.colors.dropShadowNormal}`}}):a.jsxs(zi,{windowSize:l,children:[a.jsx(Ye,{vendorId:n,billId:c}),a.jsx(Zi,{location:t,navigate:e,billId:c,vendorId:n,currentTenant:s,bankAccountContext:d,isVendorRecommendationEnabled:h,isZeniAccountsFeatureEnabled:g})]})}const kt=(e=2)=>{let t="../";for(let l=0;l<e;l++)t=`${t}../`;return t},Wi=V.div`
|
|
102
102
|
display: flex;
|
|
103
103
|
height: 100vh;
|
|
104
104
|
width: 100%;
|
|
@@ -107,7 +107,7 @@ import{j as a}from"./liveblocks-B5kNfPMX.js";import{j as K,h as re,u as Q,l as t
|
|
|
107
107
|
align-items: center;
|
|
108
108
|
background-color: ${e=>e.theme.colors.grey4};
|
|
109
109
|
box-shadow: ${e=>`0px 2px ${E.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
110
|
-
`,qi=X(function(e,t){const{vendorId:l}=t,n=ke(e,l),c=l!=null?n.editVendorState?.vendorDetailLocalData?.vendorType:n.newVendorState?.vendorDetailLocalData?.vendorType,r=rn(e,c||"international_business",t.billId),
|
|
110
|
+
`,qi=X(function(e,t){const{vendorId:l}=t,n=ke(e,l),c=l!=null?n.editVendorState?.vendorDetailLocalData?.vendorType:n.newVendorState?.vendorDetailLocalData?.vendorType,r=rn(e,c||"international_business",t.billId),p=n.editVendorState??n.newVendorState,o=t.billId!=null?e.editBillDetailViewState.editBillStateById[cn(t.billId)].billDetailLocalData.recipientTotalAmount?.amount:e.editBillDetailViewState.newBillState.billDetailLocalData.recipientTotalAmount?.amount;return{internationalWireView:r,vendorViewDetails:n,bankAccountContext:t.bankAccountContext,vendorType:c||"international_business",addressType:"vendor_address",addressToEdit:p?.vendorNewAddressStatus?.addressToCreate,mailingAddress:p?.vendorAddress,billAmount:o??0}},function(e,t){const{billId:l,navigate:n,location:c,vendorId:r,currentTenant:p}=t,{tenantEmailDomain:o}=p;return{onSaveHandler:()=>{e(bn(t.bankAccountContext,r))},onAccountDetailsUpdated:(s,i,d,u)=>{e(un(s)),u&&e(mn(i,d))},onCurrencyUpdated:(s,i,d)=>{e(pn(s,i,d,!1))},onCancel:()=>{(()=>{const s=z(c.state?.pathnameStackToGoBack),i=s.poppedPathname??vt();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(ct())},onAddressClick:s=>{const i=et(o,s,l),d=D(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(dn({fetchState:"Not-Started"}));const s=z(t.location.state?.pathnameStackToGoBack),i=s.poppedPathname??vt(0);t.navigate(i,{state:{pathnameStackToGoBack:s.newStack}}),e(ct())}}})(ti);function Ji(){const e=K(),t=Q(),l=we(),{vendorId:n,billId:c}=te(),r=re(),p=me(),o=L.getSignedInUser(),s=k(v=>Z(v)),i=z(t.state?.pathnameStackToGoBack),[d,u]=f.useState(!1),h=k(v=>v.vendorViewState.newVendorState.fetchStatus.fetchState),g=k(v=>n!=null?v.vendorViewState.editVendorStateById[n]?.fetchStatus.fetchState??"Not-Started":"Not-Started"),m=n!==void 0?g:h;f.useEffect(()=>{d===!1&&m==="Not-Started"&&n!=null&&(r(fe(!1,n)),u(!0))},[d,m,n]);const[b,A]=f.useState(!1);f.useEffect(()=>{b||m==="In-Progress"||(A(!0),r(sn(c,n)))},[b,m,r]);const T=i.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail",I=k(v=>ke(v,n));if(o==null)throw Error("Can't access international wire page without signing in...");return T==="billDetail"&&I.editVendorState?.saveStatus.fetchState==="In-Progress"?a.jsx(ce,{fetchState:I.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:p.colors.grey5,boxShadow:`0px 2px ${E.sp1} ${p.colors.dropShadowNormal}`}}):a.jsxs(Wi,{windowSize:l,children:[a.jsx(Ye,{vendorId:n,billId:c}),a.jsx(qi,{location:t,navigate:e,billId:c,vendorId:n,currentTenant:s,bankAccountContext:T})]})}const vt=(e=2)=>{let t="../";for(let l=0;l<e;l++)t=`${t}../`;return t},wt=V.div`
|
|
111
111
|
display: flex;
|
|
112
112
|
height: 100vh;
|
|
113
113
|
width: 100%;
|
|
@@ -116,4 +116,4 @@ import{j as a}from"./liveblocks-B5kNfPMX.js";import{j as K,h as re,u as Q,l as t
|
|
|
116
116
|
align-items: center;
|
|
117
117
|
background-color: ${e=>e.theme.colors.grey4};
|
|
118
118
|
box-shadow: ${e=>`0px 2px ${E.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
119
|
-
`,Ki=X(function(e,t){const l=L.getSignedInUser(),n=Wt(e,t.billId),c=gn(e),r=je(l),u=n.totalAmount.amount,o=n.billPayInfo?.stage.code!=="scheduled"&&c.allApprovalRules.length>0&&!Nt(u,c.allApprovalRules,l);return{billDetails:n,billId:t.billId,billpayApprovalView:c,analytics:j,isApprovalRequiredForMarkAsPaid:o,isZeniUser:r}},function(e,t){const{location:l,billId:n,currentTenant:c,navigate:r}=t,{tenantEmailDomain:u}=c;return{redirectToBillsScreen:()=>{const o=ne(c.tenantEmailDomain),s=D(l.state?.pathnameStackToGoBack,l.pathname);r(o,{state:{pathnameStackToGoBack:s}})},discardBillDetailsFromLocalStore:()=>{e(Ie({}))},saveBillDetails:(o,s)=>{o&&e(Tt({billId:n,data:s})),e(Oe(o?"paid":"pending_approval",o,!1,n))},discardOutsideZeniPaymentData:()=>{e(jt({billId:n}))},updateBillDetailSaveBillCode:()=>{e(zt("pending_approval"))},onClickEdit:()=>{t.navigate("../",{relative:"path"})},onAttachmentClick:(o,s)=>{const i=Pe(u,o,s);window.open(`${i}`,"_blank")},retryPayment:()=>{t.billId!=null&&e(Be(t.billId,"retry"))}}})(ni);function Ct(){const e=K(),t=re(),l=Q(),{billId:n}=te(),{useFeatureGate:c}=oe(),{isFeatureEnabled:r}=c(S.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:u}=c(S.isBillPayDetectInsufficientFundsEnabled),o=we(),s=L.getSignedInUser(),{isFeatureEnabled:i}=c(S.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:d}=c(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:p}=c(S.isBillPayCommentingEnabled),h=z(l.state?.pathnameStackToGoBack),{poppedPathname:g}=h,{isFeatureEnabled:m}=c(S.isRecurringBillsFeatureEnabled),b=k(I=>Z(I)),A=k(I=>Wt(I,n)),T=A.fetchState??"Not-Started";if(f.useEffect(()=>(window.onbeforeunload=function(){return e(l,{state:{message:""}}),!0},()=>{window.onbeforeunload=null}),[e]),f.useEffect(()=>{l.state?.message!=="coming_from_edit_page"&&e(`../${n}`)},[]),f.useEffect(()=>{const I=A.vendor?.name,v=A.vendor?.id,H=A.totalAmount.amount,M=A.recipientTotalAmount.amount,_=A.invoiceNumber;I&&v&&t(hn(I,v,H,M,_,n))},[]),g==null)return a.jsx(ee,{to:`../${n}`});if(s==null)throw Error("Can't access address page without signing in...");return T==="In-Progress"?a.jsx(wt,{windowSize:o,children:a.jsx(ai,{})}):a.jsx(wt,{windowSize:o,children:a.jsx(Ki,{location:l,navigate:e,currentTenant:b,billId:n,isBillPayCommentingEnabled:p,isLocalCurrencyEnabled:i,isVendorRecommendationEnabled:d,isInternationalPaymentShaVsOurEnabled:r,isRecurringBillsFeatureEnabled:m,isDetectInsufficientFundsEnabled:u})})}const Qi=X(function(e,t){const{vendorId:l}=t,n=e.entityAutoCompleteState.autoCompleteText.common,c=We(e,"common"),r=l!=null?"edit":"create",u=Z(e),o=L.getSignedInUser(),s=u.tenantId,i={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:s??""};return{vendorViewDetails:t.vendorViewDetails,screenType:r,filesEndPoint:`${Jt.fileMicroServiceBaseUrl}`,authParams:i,analytics:j,vendorSearchAutoCompleteData:{autoCompleteText:n,entityAutoCompleteView:c}}},function(e,t){const{billId:l,currentTenant:n,navigate:c,location:r,vendorId:u,themeState:o}=t,{tenantEmailDomain:s}=n;return{onSaveVendor:i=>{e(Dn(u??void 0,t.billId)),i!=null&&e(jn(i))},saveVendorDetailLocalData:i=>{e(Ht({vendorId:u,localData:i}))},saveContactsInVendorDetailLocalData:i=>{e(En({vendorId:u,contacts:i}))},resetVendorDetailLocalData:()=>{e(dt(u))},updateSelectedVendorForCreate:i=>{e(Bn(i))},navigateToBankDetailPage:(i,d)=>{let p;i==="wire"?p=d==="international"?Qt(s,t.billId,u):mi(s,t.billId,u):p=pi(s,t.billId,u);const h=D(r.state?.pathnameStackToGoBack,r.pathname);c(p,{state:{pathnameStackToGoBack:h}})},onRemoveBankAccount:(i,d)=>{e(d===!0?An(i,"vendor",u):xn(i,"vendor",u))},navigateToMailingAddressPage:i=>{const d=et(s,i,l),p=D(r.state?.pathnameStackToGoBack,r.pathname);c(d,{state:{pathnameStackToGoBack:p}})},updateFilesEntity:i=>{e(Cn({files:i}))},onEditFileName:(i,d)=>{e(wn(i,d.split(".")[0]))},handleZeniLogoClick:()=>{o.toggle()},updateSaveFetchState:()=>{u==null&&e(dt(t.vendorViewDetails.newVendorState?.vendorBasic?.id)),e(vn("Not-Started",u))},onVendorSelected:i=>{i!=null&&e(kn(i,!0))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(qe({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}},onBackClick:()=>{e(ie("common"));const i=z(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ui(n.tenantEmailDomain,t.billId);c(d,{state:{pathnameStackToGoBack:i.newStack}})},onGetOtp:i=>{e(In(i,"BillPayVendor"))},onResendOtp:i=>{e(fn(i,"BillPayVendor"))},onVerifyOtp:(i,d)=>{e(yn(i,d,"BillPayVendor"))},onVerifyOtpSuccess:(i,d,p)=>{e(Sn(i,d,p))},onFetchAndUpdateVendorRecommendations:i=>{e(Zt(i,!1))}}})(si),xe=()=>{const e=K(),t=re(),l=ii(),n=Q(),{billId:c,vendorId:r}=te(),u=k(b=>Z(b)),{useFeatureGate:o}=oe(),{isFeatureEnabled:s}=o(S.isBillPayLocalCurrencyFeatureEnabled),[i,d]=f.useState(!1),p=k(b=>b.vendorViewState.newVendorState.fetchStatus.fetchState),h=k(b=>ke(b,r)),g=k(b=>r!==void 0?b.vendorViewState.editVendorStateById[r]?.fetchStatus??"Not-Started":"Not-Started"),m=r!==void 0?g:p;return f.useEffect(()=>{i===!1&&m==="Not-Started"&&r!=null&&(t(fe(!1,r)),d(!0))},[i,m,r]),h.fetchState==="Not-Started"||h.fetchState==="In-Progress"?a.jsx(oi,{}):m==="Error"?a.jsx(li,{onGoHome:()=>e("../",{replace:!0}),onReload:()=>window.location.reload()}):a.jsxs(a.Fragment,{children:[a.jsx(Ye,{vendorId:r,billId:c}),a.jsx(Qi,{navigate:e,location:n,themeState:l,currentTenant:u,vendorId:r,billId:c,vendorViewDetails:h,isLocalCurrencyEnabled:s})]})},Xi=X(function(e,t){const{companyId:l}=t;return{billPaySetupView:Tn(e,l),analytics:j,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",videoUrl:"https://player.vimeo.com/video/787873426?h=9d9389b1dc&badge=0&autopause=0&player_id=0&app_id=58479"}},function(e,t){const{companyId:l,navigate:n}=t;return{onButtonClick:()=>{e(Pn(l))},onBackClick:()=>{n("../..",{relative:"path"})},onSetupBillPaySuccess:()=>{n("../bills/setup",{relative:"path"})}}})(ri),Yi=()=>{const e=K(),t=Q(),{tenantEmailDomain:l}=te(),[n,c]=f.useState(!1),r=me(),u=k(g=>Z(g)),o=u.companyId??L.getSignedInUserTenant(l)?.companyId,s=L.getSignedInUser(),i=ve(),d=!!u.companyBillPayInfo?.info?.isBillPayTOSAccepted,p=pe(i?.loggedInUserRoleMap),h=g=>{c(g)};if(s==null)throw Error("Can't access bill pay promo page without signing in...");return u.companyBillPayInfo?.info?.isBillPayEnabled===!0?a.jsx(ee,{to:"../../../bills"}):d===!0&&p===!0?a.jsx(ee,{to:"../../bills/setup"}):d===!1||i!=null&&He(u,i.loggedInUserRoleMap)?a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:g=>(m=>m.trackPageLoaded(Kt.Event.billPayPromoPage))(g)}),a.jsx(Yt,{isAppContentDrawerOpen:n,handleDrawerToggle:h}),a.jsx(Xi,{companyId:o,navigate:e,location:t,onClickMenuIcon:()=>{h(!0)}})]}):a.jsx(ce,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Fo(){const e=k(U=>Z(U)),t=ve(),l=pe(t?.loggedInUserRoleMap),n=me(),{useFeatureGate:c}=oe(),{isFeatureEnabled:r}=c(S.isBillPayLocalCurrencyFeatureEnabled),u=r===!0?Ji:Hi,{isFeatureEnabled:o}=c(S.isDebitCardFeatureEnabled),s=Ut(o,e),i=Mt(e),d=Q(),p=e?.userRole!=null&&At(e?.userRole),h=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&pe(t?.loggedInUserRoleMap),g=$t(t?.loggedInUserRoleMap),m=(e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p)&&Fn(t?.loggedInUserRoleMap),{isFeatureEnabled:b}=c(S.isDepositAccountsFeatureEnabled),A=b&&!p&&_t(t?.loggedInUserRoleMap),{isFeatureEnabled:T}=c(S.isChargeCardFeatureEnabled),I=ci(e,T,o)&&!p&&Rn(t?.loggedInUserRoleMap),v=Ln(t?.loggedInUserRoleMap),H=Gt(t?.loggedInUserRoleMap),M=Vn(t?.loggedInUserRoleMap),_=$n(t?.loggedInUserRoleMap),F=Un(t?.loggedInUserRoleMap),x=Mn(t?.loggedInUserRoleMap),{tenantEmailDomain:$}=te();return a.jsxs(sa,{children:[d.pathname.includes("/bills")?a.jsxs(a.Fragment,{children:[a.jsx(y,{path:"setup",element:a.jsx(Re,{isBillPayAdminLevelAccess:h,isUserHasOnlyBillPayAccess:g,isReimbursementAdminLevelAccess:m,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:I,isUserHasOnlyCardAccess:v,productType:"bill_pay",type:"setup"})}),a.jsx(y,{path:"verification",element:a.jsx(Re,{isBillPayAdminLevelAccess:h,isUserHasOnlyBillPayAccess:g,isReimbursementAdminLevelAccess:m,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:I,isUserHasOnlyCardAccess:v,productType:"bill_pay",type:"verification"})}),a.jsx(y,{path:"promo",element:a.jsx(Yi,{})}),a.jsx(y,{path:"approval-rules/*",element:h?a.jsx(hi,{}):a.jsx(gi,{isUserHasZeniAccountsAccess:H,isUserHasChargeCardAccess:_,isUserHasBillPayAccess:F,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:M,isTenantBankingOnly:s,tenantEmailDomain:$??""})}),a.jsx(y,{path:"international-wire",element:a.jsx(Re,{isBillPayAdminLevelAccess:h,isUserHasOnlyBillPayAccess:g,isReimbursementAdminLevelAccess:m,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:I,isUserHasOnlyCardAccess:v,productType:"bill_pay",type:"international-wire"})}),e.companyBillPayInfo?.info?.isBillPayEnabled===!0&&a.jsx(y,{path:"*",element:a.jsx(Fi,{})}),(s===!0||i===!0)&&a.jsx(y,{path:"/*",element:a.jsx(ea,{})}),e.companyBillPayInfo?.info?.isBillPayTOSAccepted===!0&&l&&a.jsx(y,{path:"*",element:a.jsx(ee,{to:"../setup"})}),t!=null&&He(e,t.loggedInUserRoleMap)&&a.jsx(y,{path:"*",element:a.jsx(ee,{to:"../promo"})})]}):d.pathname.includes("/bill")?a.jsxs(a.Fragment,{children:[a.jsx(y,{path:"new",element:a.jsx(C,{appContent:a.jsx(ft,{})})}),a.jsx(y,{path:":billId",element:a.jsx(C,{appContent:a.jsx(yi,{})})}),a.jsx(y,{path:":billId/edit",element:a.jsx(C,{appContent:a.jsx(ft,{})})}),a.jsx(y,{path:"new/review",element:a.jsx(C,{appContent:a.jsx(Ct,{})})}),a.jsx(y,{path:":billId/edit/review",element:a.jsx(C,{appContent:a.jsx(Ct,{})})}),a.jsx(y,{path:"/:billId/:addressType",element:a.jsx(C,{appContent:a.jsx(mt,{isSubPage:!0})})}),a.jsx(y,{path:"/new/:addressType",element:a.jsx(C,{appContent:a.jsx(mt,{isSubPage:!0})})}),a.jsx(y,{path:"new/vendor/create",element:a.jsx(C,{appContent:a.jsx(xe,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit",element:a.jsx(C,{appContent:a.jsx(xe,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(y,{path:"new/vendor/:vendorId/edit/international",element:a.jsx(C,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:"new/vendor/create/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(y,{path:"new/vendor/create/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(y,{path:"new/vendor/create/international",element:a.jsx(C,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/international",element:a.jsx(C,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:":billId/edit/vendor/create",element:a.jsx(C,{appContent:a.jsx(xe,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit",element:a.jsx(C,{appContent:a.jsx(xe,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(y,{path:":billId/edit/vendor/:vendorId/edit/international",element:a.jsx(C,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(y,{path:":billId/edit/vendor/create/international",element:a.jsx(C,{appContent:a.jsx(u,{})})}),a.jsx(y,{path:"*",element:a.jsx(De,{})})]}):a.jsx(y,{path:"*",element:a.jsx(ce,{fetchState:"In-Progress",style:{backgroundColor:n.colors.grey5,boxShadow:`0px 2px ${E.sp1} ${n.colors.dropShadowNormal}`}})}),a.jsx(y,{path:"*",element:a.jsx(De,{})})]})}export{Fo as default};
|
|
119
|
+
`,Ki=X(function(e,t){const l=L.getSignedInUser(),n=Wt(e,t.billId),c=gn(e),r=je(l),p=n.totalAmount.amount,o=n.billPayInfo?.stage.code!=="scheduled"&&c.allApprovalRules.length>0&&!Nt(p,c.allApprovalRules,l);return{billDetails:n,billId:t.billId,billpayApprovalView:c,analytics:j,isApprovalRequiredForMarkAsPaid:o,isZeniUser:r}},function(e,t){const{location:l,billId:n,currentTenant:c,navigate:r}=t,{tenantEmailDomain:p}=c;return{redirectToBillsScreen:()=>{const o=ne(c.tenantEmailDomain),s=D(l.state?.pathnameStackToGoBack,l.pathname);r(o,{state:{pathnameStackToGoBack:s}})},discardBillDetailsFromLocalStore:()=>{e(Ie({}))},saveBillDetails:(o,s)=>{o&&e(Tt({billId:n,data:s})),e(Oe(o?"paid":"pending_approval",o,!1,n))},discardOutsideZeniPaymentData:()=>{e(jt({billId:n}))},updateBillDetailSaveBillCode:()=>{e(zt("pending_approval"))},onClickEdit:()=>{t.navigate("../",{relative:"path"})},onAttachmentClick:(o,s)=>{const i=Pe(p,o,s);window.open(`${i}`,"_blank")},retryPayment:()=>{t.billId!=null&&e(Be(t.billId,"retry"))}}})(ni);function Ct(){const e=K(),t=re(),l=Q(),{billId:n}=te(),{useFeatureGate:c}=oe(),{isFeatureEnabled:r}=c(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:p}=c(y.isBillPayDetectInsufficientFundsEnabled),o=we(),s=L.getSignedInUser(),{isFeatureEnabled:i}=c(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:d}=c(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:u}=c(y.isBillPayCommentingEnabled),h=z(l.state?.pathnameStackToGoBack),{poppedPathname:g}=h,{isFeatureEnabled:m}=c(y.isRecurringBillsFeatureEnabled),b=k(I=>Z(I)),A=k(I=>Wt(I,n)),T=A.fetchState??"Not-Started";if(f.useEffect(()=>(window.onbeforeunload=function(){return e(l,{state:{message:""}}),!0},()=>{window.onbeforeunload=null}),[e]),f.useEffect(()=>{l.state?.message!=="coming_from_edit_page"&&e(`../${n}`)},[]),f.useEffect(()=>{const I=A.vendor?.name,v=A.vendor?.id,H=A.totalAmount.amount,M=A.recipientTotalAmount.amount,_=A.invoiceNumber;I&&v&&t(hn(I,v,H,M,_,n))},[]),g==null)return a.jsx(ee,{to:`../${n}`});if(s==null)throw Error("Can't access address page without signing in...");return T==="In-Progress"?a.jsx(wt,{windowSize:o,children:a.jsx(ai,{})}):a.jsx(wt,{windowSize:o,children:a.jsx(Ki,{location:l,navigate:e,currentTenant:b,billId:n,isBillPayCommentingEnabled:u,isLocalCurrencyEnabled:i,isVendorRecommendationEnabled:d,isInternationalPaymentShaVsOurEnabled:r,isRecurringBillsFeatureEnabled:m,isDetectInsufficientFundsEnabled:p})})}const Qi=X(function(e,t){const{vendorId:l}=t,n=e.entityAutoCompleteState.autoCompleteText.common,c=We(e,"common"),r=l!=null?"edit":"create",p=Z(e),o=L.getSignedInUser(),s=p.tenantId,i={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:s??""};return{vendorViewDetails:t.vendorViewDetails,screenType:r,filesEndPoint:`${Jt.fileMicroServiceBaseUrl}`,authParams:i,analytics:j,vendorSearchAutoCompleteData:{autoCompleteText:n,entityAutoCompleteView:c}}},function(e,t){const{billId:l,currentTenant:n,navigate:c,location:r,vendorId:p,themeState:o}=t,{tenantEmailDomain:s}=n;return{onSaveVendor:i=>{e(Dn(p??void 0,t.billId)),i!=null&&e(jn(i))},saveVendorDetailLocalData:i=>{e(Ht({vendorId:p,localData:i}))},saveContactsInVendorDetailLocalData:i=>{e(En({vendorId:p,contacts:i}))},resetVendorDetailLocalData:()=>{e(dt(p))},updateSelectedVendorForCreate:i=>{e(Bn(i))},navigateToBankDetailPage:(i,d)=>{let u;i==="wire"?u=d==="international"?Qt(s,t.billId,p):mi(s,t.billId,p):u=ui(s,t.billId,p);const h=D(r.state?.pathnameStackToGoBack,r.pathname);c(u,{state:{pathnameStackToGoBack:h}})},onRemoveBankAccount:(i,d)=>{e(d===!0?An(i,"vendor",p):xn(i,"vendor",p))},navigateToMailingAddressPage:i=>{const d=et(s,i,l),u=D(r.state?.pathnameStackToGoBack,r.pathname);c(d,{state:{pathnameStackToGoBack:u}})},updateFilesEntity:i=>{e(Cn({files:i}))},onEditFileName:(i,d)=>{e(wn(i,d.split(".")[0]))},handleZeniLogoClick:()=>{o.toggle()},updateSaveFetchState:()=>{p==null&&e(dt(t.vendorViewDetails.newVendorState?.vendorBasic?.id)),e(vn("Not-Started",p))},onVendorSelected:i=>{i!=null&&e(kn(i,!0))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(qe({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(ie("common"))},onCancelAutoComplete:()=>{e(ie("common"))}},onBackClick:()=>{e(ie("common"));const i=z(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??pi(n.tenantEmailDomain,t.billId);c(d,{state:{pathnameStackToGoBack:i.newStack}})},onGetOtp:i=>{e(In(i,"BillPayVendor"))},onResendOtp:i=>{e(fn(i,"BillPayVendor"))},onVerifyOtp:(i,d)=>{e(Sn(i,d,"BillPayVendor"))},onVerifyOtpSuccess:(i,d,u)=>{e(yn(i,d,u))},onFetchAndUpdateVendorRecommendations:i=>{e(Zt(i,!1))}}})(si),xe=()=>{const e=K(),t=re(),l=ii(),n=Q(),{billId:c,vendorId:r}=te(),p=k(b=>Z(b)),{useFeatureGate:o}=oe(),{isFeatureEnabled:s}=o(y.isBillPayLocalCurrencyFeatureEnabled),[i,d]=f.useState(!1),u=k(b=>b.vendorViewState.newVendorState.fetchStatus.fetchState),h=k(b=>ke(b,r)),g=k(b=>r!==void 0?b.vendorViewState.editVendorStateById[r]?.fetchStatus??"Not-Started":"Not-Started"),m=r!==void 0?g:u;return f.useEffect(()=>{i===!1&&m==="Not-Started"&&r!=null&&(t(fe(!1,r)),d(!0))},[i,m,r]),h.fetchState==="Not-Started"||h.fetchState==="In-Progress"?a.jsx(oi,{}):m==="Error"?a.jsx(li,{onGoHome:()=>e("../",{replace:!0}),onReload:()=>window.location.reload()}):a.jsxs(a.Fragment,{children:[a.jsx(Ye,{vendorId:r,billId:c}),a.jsx(Qi,{navigate:e,location:n,themeState:l,currentTenant:p,vendorId:r,billId:c,vendorViewDetails:h,isLocalCurrencyEnabled:s})]})},Xi=X(function(e,t){const{companyId:l}=t;return{billPaySetupView:Tn(e,l),analytics:j,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",videoUrl:"https://player.vimeo.com/video/787873426?h=9d9389b1dc&badge=0&autopause=0&player_id=0&app_id=58479"}},function(e,t){const{companyId:l,navigate:n}=t;return{onButtonClick:()=>{e(Pn(l))},onBackClick:()=>{n("../..",{relative:"path"})},onSetupBillPaySuccess:()=>{n("../bills/setup",{relative:"path"})}}})(ri),Yi=()=>{const e=K(),t=Q(),{tenantEmailDomain:l}=te(),[n,c]=f.useState(!1),r=me(),p=k(g=>Z(g)),o=p.companyId??L.getSignedInUserTenant(l)?.companyId,s=L.getSignedInUser(),i=ve(),d=!!p.companyBillPayInfo?.info?.isBillPayTOSAccepted,u=ue(i?.loggedInUserRoleMap),h=g=>{c(g)};if(s==null)throw Error("Can't access bill pay promo page without signing in...");return p.companyBillPayInfo?.info?.isBillPayEnabled===!0?a.jsx(ee,{to:"../../../bills"}):d===!0&&u===!0?a.jsx(ee,{to:"../../bills/setup"}):d===!1||i!=null&&He(p,i.loggedInUserRoleMap)?a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:g=>(m=>m.trackPageLoaded(Kt.Event.billPayPromoPage))(g)}),a.jsx(Yt,{isAppContentDrawerOpen:n,handleDrawerToggle:h}),a.jsx(Xi,{companyId:o,navigate:e,location:t,onClickMenuIcon:()=>{h(!0)}})]}):a.jsx(ce,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Fo(){const e=k(U=>Z(U)),t=ve(),l=ue(t?.loggedInUserRoleMap),n=me(),{useFeatureGate:c}=oe(),{isFeatureEnabled:r}=c(y.isBillPayLocalCurrencyFeatureEnabled),p=r===!0?Ji:Hi,{isFeatureEnabled:o}=c(y.isDebitCardFeatureEnabled),s=Ut(o,e),i=Mt(e),d=Q(),u=e?.userRole!=null&&At(e?.userRole),h=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!u)&&ue(t?.loggedInUserRoleMap),g=$t(t?.loggedInUserRoleMap),m=(e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!u)&&Fn(t?.loggedInUserRoleMap),{isFeatureEnabled:b}=c(y.isDepositAccountsFeatureEnabled),A=b&&!u&&_t(t?.loggedInUserRoleMap),{isFeatureEnabled:T}=c(y.isChargeCardFeatureEnabled),I=ci(e,T,o)&&!u&&Rn(t?.loggedInUserRoleMap),v=Ln(t?.loggedInUserRoleMap),H=Gt(t?.loggedInUserRoleMap),M=Vn(t?.loggedInUserRoleMap),_=$n(t?.loggedInUserRoleMap),F=Un(t?.loggedInUserRoleMap),x=Mn(t?.loggedInUserRoleMap),{tenantEmailDomain:$}=te();return a.jsxs(sa,{children:[d.pathname.includes("/bills")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"setup",element:a.jsx(Re,{isBillPayAdminLevelAccess:h,isUserHasOnlyBillPayAccess:g,isReimbursementAdminLevelAccess:m,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:I,isUserHasOnlyCardAccess:v,productType:"bill_pay",type:"setup"})}),a.jsx(S,{path:"verification",element:a.jsx(Re,{isBillPayAdminLevelAccess:h,isUserHasOnlyBillPayAccess:g,isReimbursementAdminLevelAccess:m,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:I,isUserHasOnlyCardAccess:v,productType:"bill_pay",type:"verification"})}),a.jsx(S,{path:"promo",element:a.jsx(Yi,{})}),a.jsx(S,{path:"approval-rules/*",element:h?a.jsx(hi,{}):a.jsx(gi,{isUserHasZeniAccountsAccess:H,isUserHasChargeCardAccess:_,isUserHasBillPayAccess:F,isUserHasReimbursementAccess:x,isUserHasTreasuryAccess:M,isTenantBankingOnly:s,tenantEmailDomain:$??""})}),a.jsx(S,{path:"international-wire",element:a.jsx(Re,{isBillPayAdminLevelAccess:h,isUserHasOnlyBillPayAccess:g,isReimbursementAdminLevelAccess:m,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:I,isUserHasOnlyCardAccess:v,productType:"bill_pay",type:"international-wire"})}),e.companyBillPayInfo?.info?.isBillPayEnabled===!0&&a.jsx(S,{path:"*",element:a.jsx(Fi,{})}),(s===!0||i===!0)&&a.jsx(S,{path:"/*",element:a.jsx(ea,{})}),e.companyBillPayInfo?.info?.isBillPayTOSAccepted===!0&&l&&a.jsx(S,{path:"*",element:a.jsx(ee,{to:"../setup"})}),t!=null&&He(e,t.loggedInUserRoleMap)&&a.jsx(S,{path:"*",element:a.jsx(ee,{to:"../promo"})})]}):d.pathname.includes("/bill")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"new",element:a.jsx(C,{appContent:a.jsx(ft,{})})}),a.jsx(S,{path:":billId",element:a.jsx(C,{appContent:a.jsx(Si,{})})}),a.jsx(S,{path:":billId/edit",element:a.jsx(C,{appContent:a.jsx(ft,{})})}),a.jsx(S,{path:"new/review",element:a.jsx(C,{appContent:a.jsx(Ct,{})})}),a.jsx(S,{path:":billId/edit/review",element:a.jsx(C,{appContent:a.jsx(Ct,{})})}),a.jsx(S,{path:"/:billId/:addressType",element:a.jsx(C,{appContent:a.jsx(mt,{isSubPage:!0})})}),a.jsx(S,{path:"/new/:addressType",element:a.jsx(C,{appContent:a.jsx(mt,{isSubPage:!0})})}),a.jsx(S,{path:"new/vendor/create",element:a.jsx(C,{appContent:a.jsx(xe,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit",element:a.jsx(C,{appContent:a.jsx(xe,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/international",element:a.jsx(C,{appContent:a.jsx(p,{})})}),a.jsx(S,{path:"new/vendor/create/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/create/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/create/international",element:a.jsx(C,{appContent:a.jsx(p,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(C,{appContent:a.jsx(p,{})})}),a.jsx(S,{path:":billId/edit/vendor/create",element:a.jsx(C,{appContent:a.jsx(xe,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit",element:a.jsx(C,{appContent:a.jsx(xe,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/international",element:a.jsx(C,{appContent:a.jsx(p,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(C,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(C,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(C,{appContent:a.jsx(p,{})})}),a.jsx(S,{path:"*",element:a.jsx(De,{})})]}):a.jsx(S,{path:"*",element:a.jsx(ce,{fetchState:"In-Progress",style:{backgroundColor:n.colors.grey5,boxShadow:`0px 2px ${E.sp1} ${n.colors.dropShadowNormal}`}})}),a.jsx(S,{path:"*",element:a.jsx(De,{})})]})}export{Fo as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as k}from"./liveblocks-
|
|
1
|
+
import{j as k}from"./liveblocks-3WpI1obg.js";import{a as V}from"./sentry-z6zkwC0R.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-BpuExePz.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-DidLjpq0.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,k6 as _e,fz as xe,fy as Fe,fx 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-RQBIdQMH.js";import{n as Le}from"./mui-Bpme9BmU.js";import{c as U}from"./routePaths-D7d1SJs7.js";import{M as je}from"./MobileAppDrawer--t6IvFv1.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]="d40d5495-616a-4695-bc57-86f99fdbf36d",e._sentryDebugIdIdentifier="sentry-dbid-d40d5495-616a-4695-bc57-86f99fdbf36d")}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-B5kNfPMX.js";import{a as V}from"./sentry-tUkEj5F
|
|
|
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??""},
|
|
9
|
+
`,Ge=re(function(e,d){const{businessVerificationDetails:i}=d,r=G(e),y=E.getSignedInUser(),S=r.tenantId,l={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},b=we(d.roleMap)&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",t=Ae(e.companyConfigState),s=Ne(e.userRoleConfigState);return{businessVerificationDetails:i,verficationDetailsFetchState:i.fetchState,isRefreshingViewInBackground:i.isRefreshingViewInBackground,allNationalityCountries:i.allNationalityCountries,filesEndPoint:`${me.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:b,allIndustries:t.companyIndustries??[],companyTitles:s.companyTitles}},function(e,d){const{companyId:i,productType:r,currentTenant:y,navigate:S,location:l}=d,{tenantEmailDomain:b}=y;return{onCompanyDetailsChanged:t=>{const{companyDescription:s,companyIndustry:p,companyIndustryType:O,companyLegalName:T,companyTaxId:g,companyWebsite:m,companyPhone:I,primaryContactEmail:c,primaryContactName:n,primaryContactUserId:u,primaryContactSyncToken:D,syncToken:f,fileIds:a,incDate:o,typeOfIncorporation:w,stateOfIncorporation:A,sourceOfFunds:N,companySubIndustry:_,countriesOfOperations:h,companySourceOfFunds:q,companySourceOfFundsDescription:J,transactionVolume:Z,transactionVolumeDescription:$,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:q?.selectedOption??"",companySourceOfFundsDescription:J,transactionVolume:Z?.selectedOption??"",transactionVolumeDescription:$,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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-B5kNfPMX.js";import{j as ue,l as la,h as me,g as S,u as ye,k as ge,N as ya,q as mt,n as Qt,o as te}from"./core-CFeBRNT2.js";import{eN as ie,bs as Be,N_ as _a,eR as Se,eS as Ie,eT as Ae,fP as Me,cq as ze,N$ as $e,O0 as $a,sM as Sa,jz as Ia,O1 as Aa,gD as ca,ze as aa,zg as Ga,zh as Ya,jp as Ct,O2 as Ge,z2 as pt,O3 as Xt,O4 as Jt,z5 as wa,O5 as en,Mr as Pa,qY as ht,zb as Za,gO as an,O6 as ft,O7 as Ye,bq as tn,O8 as nn,fA as Ta,fz as Fa,zL as rn,fy as va,M7 as sn,O9 as gt,cj as bt,cL as on,Mq as ua,Al as cn,Oa as rt,zX as Oa,Ob as yt,Am as dn,MR as ln,An as un,Bh as mn,s6 as Cn,Bb as pn,zw as St,zp as hn,Oc as fn,fR as gn,zF as It,zJ as At,fQ as bn,Od as yn,A7 as Et,Oe as Sn,Of as In,Og as An,zH as kt,zs as Dt,z8 as _t,zB as wt,zz as Pt,zD as En,zf as st,Oh as Tt,Oi as xa,zU as Ea,J6 as Ft,cM as Ka,Oj as kn,Ok as Dn,Ol as _n,Om as wn,zR as Ha,Ae as Pn,Aa as Tn,zN as Fn,Ac as vn,A2 as On,A4 as xn,On as vt,Ak as Ot,GE as Bn,Oo as Ln,Op as Rn,Oq as Un,Or as xt,Os as jn,AH as Nn,zW as Bt,zQ as da,zV as Vn,Ot as Hn,Ou as Mn,y$ as zn,Ov as Lt,Ow as Rt,Ox as $n,z1 as Gn,z0 as ot,Oy as Yn,Oz as Zn,OA as Kn,J2 as Wn,OB as Wa,OC as qn,vC as Ut,k7 as Qn,gE as Xn,AM as Jn,OD as jt,OE as er,AN as ar,OF as tr,dc as nr,sG as rr,AC as sr,Aw as xe,bv as or,bD as ir,cv as cr,bE as dr,Il as lr}from"./zeni-epic-state-BDLHO2z4.js";import{z as J,A as Re,a as oe,p as Z,B as Ze,bX as Ba,c6 as ur,n as ve,c7 as mr,c8 as Cr,q as ma,aI as Fe,v as be,be as qa,c9 as pr,E as Ca,j as La,h as Qa,e as Q,D as Xa,ca as hr,K as Nt,al as Ja,bq as Je,cb as Ma,cc as fr,C as et,a1 as gr,cd as br,ao as Vt,R as za,M as Ht,g as Mt,ce as yr,cf as Sr,cg as Ir,ch as Ar,ci as Er,o as ka,cj as kr,ck as Dr,cl as ja,y as _r,cm as wr,cn as Pr,co as Tr,cp as Fr,a4 as vr}from"./index-DqjQxzff.js";import{n as _e,D as zt,S as Or}from"./mui-CdWoU1P3.js";import{a as c}from"./sentry-tUkEj5F1.js";import{g as fe,a as pa,b as $t,c as Ee,d as ke,e as Le,f as Ue,A as xr,h as at,P as Br,i as tt,s as ea,j as Gt,k as He,l as Yt,m as Lr,n as Zt,p as Rr,S as it}from"./SetupPagesScreen-BJLzY18z.js";import Ra from"./NotFoundScreen-DHD7hd9-.js";import{M as ha}from"./MobileAppDrawer-Ch_dkO8z.js";import{u as Kt}from"./useAskAiCfoHostNavButtonProps-XVobODAU.js";import{c as Wt}from"./useFetchSuggestedQuestionsWhenReady-DoHZcRGr.js";import{v as ct}from"./utils-C-s_aaYV.js";import{t as Ur}from"./AddressScreen-DUppO0v9.js";import"./recharts-Blc5CD1k.js";import"./analytics-dCAT-sHe.js";import"./plaid-BtUsVD04.js";import"./dnd-B97JkZHN.js";import"./stripe-DMRn4zHo.js";import"./lottie-DBJX4kzt.js";import"./lexical-qfgvtXN9.js";import"./pdf-btSs-oeP.js";import"./analyticsHelper-cZJjlMLA.js";import"./routePaths-DmlKjqFK.js";import"./BusinessVerificationPageScreen-B-xYgrU6.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]="1f1d306c-b44d-43b9-9018-f571b22e13e5",e._sentryDebugIdIdentifier="sentry-dbid-1f1d306c-b44d-43b9-9018-f571b22e13e5")}catch{}})();function jr(){const e=ue(),{cardId:t}=la(),a=me(),r=J.getSignedInUser(),n=S(G=>ie(G)),u=Re(),m=Be(u?.loggedInUserRoleMap),{useFeatureGate:C}=oe();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[I,o]=c.useState(!1),i=S(G=>_a(G).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const D=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=C(Z.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:B}=C(Z.isDebitCardFeatureEnabled),v=Se(n),k=Ie(n),h=Ae(B,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ee({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:h}),l=ke({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),w=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,L=S(G=>Me(G,n.companyId)),j=ze(L.controllers),{creditAccount:T,creditAccountRepayment:P}=S(G=>$e(G)),N=S(G=>G.classListState.fetchState),p=!D&&l&&f,d=S(G=>$a(G,t,p,l)),[_,F]=c.useState(!1),U=d.chargeCard,M=U?.cardCreatedByUser?.userId,W=S(G=>M!=null?Sa(G.userRoleState,M):void 0),y=W?.accountingClassIDs[0],O=S(G=>y!=null?Ia(G.classState,{classId:y,reportId:"class_list"}):void 0),$=U?.cardHolderUser?.userId,R=S(G=>$!=null?Sa(G.userRoleState,$):void 0),Y=R?.accountingClassIDs[0],E=S(G=>Y!=null?Ia(G.classState,{classId:Y,reportId:"class_list"}):void 0),q=U?.type.code==="business_physical_credit_card"||U?.type.code==="business_physical_debit_card",K=U?.type.code==="business_physical_debit_card";c.useEffect(()=>{i&&I===!1&&q&&(o(!0),setTimeout(()=>{a(Aa()),K&&a(ca({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[i,I,q,K]),c.useEffect(()=>{_||d.fetchState==="Completed"||d.fetchState==="In-Progress"||t==null||(F(!0),a(aa(t,p,!1)))},[_,d,t,a]),c.useEffect(()=>{if(d.fetchState==="Completed"&&(q===!1||q&&U?.status?.code!=="active"||U?.cardHolderUserId!==r.userId||i===!1&&I===!1||U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card")){const G=fe(n.tenantEmailDomain,t,r,U,i);e(G)}},[d.fetchState,i,q]),c.useEffect(()=>{T.fetchState!=="Completed"&&T.fetchState!=="In-Progress"&&l&&f&&m&&a(Ga()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&l&&f&&m&&a(Ya()),N!=="Completed"&&N!=="In-Progress"&&a(Ct())},[T.fetchState,P.fetchState,a,l,f,m,N]);const z=()=>{if(r!=null&&t!=null){a(Aa());const G=fe(n.tenantEmailDomain,t,r);e(G)}},Ce=U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card",ae=Le(l,g,w,f),x=pa(l,f,m,T,P),pe=$t(Ce,d);return d.fetchState!=="Completed"?s.jsx(Ze,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(Ba,{showConfetti:i}),s.jsx(ur,{onGotItClick:z,isDebitCard:U?.type.code==="business_physical_debit_card",controllerEmails:j,isChargeCardFeatureEnabled:l,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:w,isChargeCardSetupEnabled:f,productInformation:ae,creditAccountInformation:x,debitAccountInformation:pe,chargeCardDetailView:d,creditAccount:T,classListFetchState:N,creditAccountRepayment:P,cardIssuedByRoles:W?.userRoles,cardIssuedByDepartmentName:O?.className,cardHolderRoles:R?.userRoles,cardHolderDepartmentName:E?.className})]})}const Nr=ge(function(e){const t=Ge(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(Xt({uiState:{sortKey:t,sortOrder:a}}))}}})(Cr);function Vr(){const e=ue(),t=me(),a=ye(),r=J.getSignedInUser(),n=S(o=>ie(o)),[u,m]=c.useState(!1),C=S(o=>Ge(o)),I=c.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),i=o.poppedPathname??Hr(n.tenantEmailDomain);e(i,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(c.useEffect(()=>{u||C.fetchState==="Completed"||C.fetchState==="In-Progress"||(m(!0),t(pt()))},[u,C,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return C.fetchState==="In-Progress"?s.jsx(mr,{onBackClick:I}):C.cashbackSummary.cashbackEarned.amount===0&&C.fetchState==="Completed"?s.jsx(Ra,{}):s.jsx(Nr,{onBackClick:I})}const Hr=e=>`/${e}/cards`,Mr={containerWidth:new Ca(100,58)},zr=({appContent:e})=>{const t=ma(),a=me(),r=ue(),{cardId:n}=la(),u=ye(),{useDynamicConfig:m}=oe(),[C,I]=c.useState(!1),[o,i]=c.useState(!1),[D,A]=c.useState(!1),[f,B]=c.useState(!1),v=J.getSignedInUser();if(v==null)throw Error("Can't access onboarding card page without signing in...");const k=S(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=m(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,g=S(E=>Jt(E,n)),l=g.chargeCard,w=S(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:L}=oe(),{isFeatureEnabled:j}=L(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=L(Z.isDebitCardFeatureEnabled),P=Ae(T,k),N=Ee({isDebitCardFeatureEnabled:T,isBankingOnlyTenant:P}),p=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,d=k.userRole.includes("charge_card_user"),_=Se(k),F=Ie(k),U=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,M=ke({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:j,isBookKeepingTenant:F,isDebitCardProductVisible:N,chargeCardsCreditAccountLimit:U}),W=!d&&M&&p;c.useEffect(()=>{C===!1&&w!=="In-Progress"&&w!=="Completed"&&(a(wa()),I(!0)),o===!1&&g.fetchState==="Not-Started"&&(i(!0),a(aa(n,W,M)))},[o,g.fetchState,C,w]);const y=l?.type.code==="business_physical_credit_card"||l?.type.code==="business_physical_debit_card";c.useEffect(()=>{if(g.fetchState==="Completed"){if(D===!1&&(y===!1||y&&l?.status?.code!=="inactive"||l?.cardHolderUserId!==v.userId)){const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);r(E,{state:{pathnameStackToGoBack:q}})}else if(D&&g.isRefreshingViewInBackground===!1&&l?.status?.code==="active"){a(en({chargeCardId:n}));const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);a(Pa()),r(E,{state:{pathnameStackToGoBack:q}})}}},[g.fetchState,l?.type.code,D,g.isRefreshingViewInBackground]);const O=J.getZeniOtpTokenForCardHolder(n),$=S(E=>ht(E.userState,v.userId)),R=()=>{l?.status?.code!=="active"&&a(Za(n,!0))};c.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&l?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&D===!1&&(setTimeout(R,3e3),A(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,l?.cardActivationAttemptHistory]);const Y=E=>{B(E)};if(w!=="Completed"||l==null)return s.jsx(Ze,{fetchState:"In-Progress"});if(l.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if($?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Yr,{children:[s.jsx(ha,{isAppContentDrawerOpen:f,handleDrawerToggle:Y}),s.jsx($r,{cardId:n,card:l,shippingAddressId:l.shippingAddressId,phone:$.phone,signedInUser:v,isSandboxEnv:qa(),chargeCardDetailState:g,signedInUserToken:O,navigate:r,currentTenant:k,location:u,maxChargeCardActivationAttempts:b[n]!=null?b[n]:h.default_max_charge_card_activation_attempts!=null?h.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{Y(!0)}}),e!=null?s.jsx(Gr,{windowSize:t,children:e}):null]})},$r=ge(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const u=an(e.addressState,a);if(u==null)throw Error("Can't access shippingAddress.");const m=ft(e,n),C=t.updateStatus,I=Ye(e,!1,!1,!1);let o=!1;I.fetchState==="Completed"&&I.cards.length<=1&&(o=!0);const i=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(tn())||i,showMenuIcon:o,shippingAddress:u,vgsVaultId:La.cardVaultId,twoFAView:m,activationWaitStatus:C,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:u,chargeCardDetailState:m}=t,C=m.chargeCard?.cardProviderID,{tenantEmailDomain:I}=u;return{onGetOtp:o=>{C!=null&&e(va(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(rn(r,o))},onResendOtp:o=>{C!=null&&e(Fa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{C!=null&&e(Ta(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&J.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(nn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ue(I):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(pr),Gr=_e.div`
|
|
1
|
+
import{j as s}from"./liveblocks-3WpI1obg.js";import{j as ue,l as la,h as me,g as S,u as ye,k as ge,N as ya,q as mt,n as Qt,o as te}from"./core-BpuExePz.js";import{eN as ie,bs as Be,N_ as _a,eR as Se,eS as Ie,eT as Ae,fO as Me,cq as ze,N$ as $e,O0 as $a,sM as Sa,jy as Ia,O1 as Aa,gC as ca,ze as aa,zg as Ga,zh as Ya,jo as Ct,O2 as Ge,z2 as pt,O3 as Xt,O4 as Jt,z5 as wa,O5 as en,Mr as Pa,qY as ht,zb as Za,gN as an,O6 as ft,O7 as Ye,bq as tn,O8 as nn,fz as Ta,fy as Fa,zL as rn,fx as va,M7 as sn,O9 as gt,cj as bt,cL as on,Mq as ua,Al as cn,Oa as rt,zX as Oa,Ob as yt,Am as dn,MR as ln,An as un,Bh as mn,s6 as Cn,Bb as pn,zw as St,zp as hn,Oc as fn,fQ as gn,zF as It,zJ as At,fP as bn,Od as yn,A7 as Et,Oe as Sn,Of as In,Og as An,zH as kt,zs as Dt,z8 as _t,zB as wt,zz as Pt,zD as En,zf as st,Oh as Tt,Oi as xa,zU as Ea,J6 as Ft,cM as Ka,Oj as kn,Ok as Dn,Ol as _n,Om as wn,zR as Ha,Ae as Pn,Aa as Tn,zN as Fn,Ac as vn,A2 as On,A4 as xn,On as vt,Ak as Ot,GE as Bn,Oo as Ln,Op as Rn,Oq as Un,Or as xt,Os as jn,AH as Nn,zW as Bt,zQ as da,zV as Vn,Ot as Hn,Ou as Mn,y$ as zn,Ov as Lt,Ow as Rt,Ox as $n,z1 as Gn,z0 as ot,Oy as Yn,Oz as Zn,OA as Kn,J2 as Wn,OB as Wa,OC as qn,vC as Ut,k6 as Qn,gD as Xn,AM as Jn,OD as jt,OE as er,AN as ar,OF as tr,dc as nr,sG as rr,AC as sr,Aw as xe,bv as or,bD as ir,cv as cr,bE as dr,Il as lr}from"./zeni-epic-state-RQBIdQMH.js";import{z as J,A as Re,a as oe,d as Z,B as Ze,bX as Ba,c6 as ur,p as ve,c7 as mr,c8 as Cr,q as ma,aI as Fe,s as be,be as qa,c9 as pr,y as Ca,j as La,h as Qa,e as Q,D as Xa,ca as hr,G as Nt,al as Ja,bq as Je,cb as Ma,cc as fr,x as et,a1 as gr,cd as br,ao as Vt,N as za,I as Ht,g as Mt,ce as yr,cf as Sr,cg as Ir,ch as Ar,ci as Er,o as ka,cj as kr,ck as Dr,cl as ja,w as _r,cm as wr,cn as Pr,co as Tr,cp as Fr,a4 as vr}from"./index-DidLjpq0.js";import{n as _e,D as zt,S as Or}from"./mui-Bpme9BmU.js";import{a as c}from"./sentry-z6zkwC0R.js";import{g as fe,a as pa,b as $t,c as Ee,d as ke,e as Le,f as Ue,A as xr,h as at,P as Br,i as tt,s as ea,j as Gt,k as He,l as Yt,m as Lr,n as Zt,p as Rr,S as it}from"./SetupPagesScreen-CQlX6aNj.js";import Ra from"./NotFoundScreen-DwnzoLJU.js";import{M as ha}from"./MobileAppDrawer--t6IvFv1.js";import{u as Kt}from"./useAskAiCfoHostNavButtonProps-D5Yjge45.js";import{c as Wt}from"./useFetchSuggestedQuestionsWhenReady-Bjj9kjVA.js";import{v as ct}from"./utils-Cb7KsPLv.js";import{t as Ur}from"./AddressScreen-Dz7dukxj.js";import"./recharts-D5_tB-NC.js";import"./analytics-DMOhZ7ep.js";import"./plaid-CTMaHWW7.js";import"./dnd-Ool1WkEK.js";import"./stripe-DMRn4zHo.js";import"./lottie-DFxKNIfK.js";import"./lexical-9B5gs5tG.js";import"./pdf-CAA7iyNe.js";import"./analyticsHelper-CcQrbJpT.js";import"./routePaths-D7d1SJs7.js";import"./BusinessVerificationPageScreen-CIapP8vT.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]="4204ac0d-7126-43d1-a904-0f0a4b4d3e0f",e._sentryDebugIdIdentifier="sentry-dbid-4204ac0d-7126-43d1-a904-0f0a4b4d3e0f")}catch{}})();function jr(){const e=ue(),{cardId:t}=la(),a=me(),r=J.getSignedInUser(),n=S(G=>ie(G)),u=Re(),m=Be(u?.loggedInUserRoleMap),{useFeatureGate:C}=oe();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[I,o]=c.useState(!1),i=S(G=>_a(G).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const D=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=C(Z.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:B}=C(Z.isDebitCardFeatureEnabled),v=Se(n),k=Ie(n),h=Ae(B,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ee({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:h}),l=ke({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),w=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,L=S(G=>Me(G,n.companyId)),j=ze(L.controllers),{creditAccount:T,creditAccountRepayment:P}=S(G=>$e(G)),N=S(G=>G.classListState.fetchState),p=!D&&l&&f,d=S(G=>$a(G,t,p,l)),[_,F]=c.useState(!1),U=d.chargeCard,M=U?.cardCreatedByUser?.userId,W=S(G=>M!=null?Sa(G.userRoleState,M):void 0),y=W?.accountingClassIDs[0],O=S(G=>y!=null?Ia(G.classState,{classId:y,reportId:"class_list"}):void 0),$=U?.cardHolderUser?.userId,R=S(G=>$!=null?Sa(G.userRoleState,$):void 0),Y=R?.accountingClassIDs[0],E=S(G=>Y!=null?Ia(G.classState,{classId:Y,reportId:"class_list"}):void 0),q=U?.type.code==="business_physical_credit_card"||U?.type.code==="business_physical_debit_card",K=U?.type.code==="business_physical_debit_card";c.useEffect(()=>{i&&I===!1&&q&&(o(!0),setTimeout(()=>{a(Aa()),K&&a(ca({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[i,I,q,K]),c.useEffect(()=>{_||d.fetchState==="Completed"||d.fetchState==="In-Progress"||t==null||(F(!0),a(aa(t,p,!1)))},[_,d,t,a]),c.useEffect(()=>{if(d.fetchState==="Completed"&&(q===!1||q&&U?.status?.code!=="active"||U?.cardHolderUserId!==r.userId||i===!1&&I===!1||U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card")){const G=fe(n.tenantEmailDomain,t,r,U,i);e(G)}},[d.fetchState,i,q]),c.useEffect(()=>{T.fetchState!=="Completed"&&T.fetchState!=="In-Progress"&&l&&f&&m&&a(Ga()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&l&&f&&m&&a(Ya()),N!=="Completed"&&N!=="In-Progress"&&a(Ct())},[T.fetchState,P.fetchState,a,l,f,m,N]);const z=()=>{if(r!=null&&t!=null){a(Aa());const G=fe(n.tenantEmailDomain,t,r);e(G)}},Ce=U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card",ae=Le(l,g,w,f),x=pa(l,f,m,T,P),pe=$t(Ce,d);return d.fetchState!=="Completed"?s.jsx(Ze,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(Ba,{showConfetti:i}),s.jsx(ur,{onGotItClick:z,isDebitCard:U?.type.code==="business_physical_debit_card",controllerEmails:j,isChargeCardFeatureEnabled:l,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:w,isChargeCardSetupEnabled:f,productInformation:ae,creditAccountInformation:x,debitAccountInformation:pe,chargeCardDetailView:d,creditAccount:T,classListFetchState:N,creditAccountRepayment:P,cardIssuedByRoles:W?.userRoles,cardIssuedByDepartmentName:O?.className,cardHolderRoles:R?.userRoles,cardHolderDepartmentName:E?.className})]})}const Nr=ge(function(e){const t=Ge(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(Xt({uiState:{sortKey:t,sortOrder:a}}))}}})(Cr);function Vr(){const e=ue(),t=me(),a=ye(),r=J.getSignedInUser(),n=S(o=>ie(o)),[u,m]=c.useState(!1),C=S(o=>Ge(o)),I=c.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),i=o.poppedPathname??Hr(n.tenantEmailDomain);e(i,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(c.useEffect(()=>{u||C.fetchState==="Completed"||C.fetchState==="In-Progress"||(m(!0),t(pt()))},[u,C,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return C.fetchState==="In-Progress"?s.jsx(mr,{onBackClick:I}):C.cashbackSummary.cashbackEarned.amount===0&&C.fetchState==="Completed"?s.jsx(Ra,{}):s.jsx(Nr,{onBackClick:I})}const Hr=e=>`/${e}/cards`,Mr={containerWidth:new Ca(100,58)},zr=({appContent:e})=>{const t=ma(),a=me(),r=ue(),{cardId:n}=la(),u=ye(),{useDynamicConfig:m}=oe(),[C,I]=c.useState(!1),[o,i]=c.useState(!1),[D,A]=c.useState(!1),[f,B]=c.useState(!1),v=J.getSignedInUser();if(v==null)throw Error("Can't access onboarding card page without signing in...");const k=S(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=m(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,g=S(E=>Jt(E,n)),l=g.chargeCard,w=S(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:L}=oe(),{isFeatureEnabled:j}=L(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=L(Z.isDebitCardFeatureEnabled),P=Ae(T,k),N=Ee({isDebitCardFeatureEnabled:T,isBankingOnlyTenant:P}),p=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,d=k.userRole.includes("charge_card_user"),_=Se(k),F=Ie(k),U=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,M=ke({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:j,isBookKeepingTenant:F,isDebitCardProductVisible:N,chargeCardsCreditAccountLimit:U}),W=!d&&M&&p;c.useEffect(()=>{C===!1&&w!=="In-Progress"&&w!=="Completed"&&(a(wa()),I(!0)),o===!1&&g.fetchState==="Not-Started"&&(i(!0),a(aa(n,W,M)))},[o,g.fetchState,C,w]);const y=l?.type.code==="business_physical_credit_card"||l?.type.code==="business_physical_debit_card";c.useEffect(()=>{if(g.fetchState==="Completed"){if(D===!1&&(y===!1||y&&l?.status?.code!=="inactive"||l?.cardHolderUserId!==v.userId)){const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);r(E,{state:{pathnameStackToGoBack:q}})}else if(D&&g.isRefreshingViewInBackground===!1&&l?.status?.code==="active"){a(en({chargeCardId:n}));const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);a(Pa()),r(E,{state:{pathnameStackToGoBack:q}})}}},[g.fetchState,l?.type.code,D,g.isRefreshingViewInBackground]);const O=J.getZeniOtpTokenForCardHolder(n),$=S(E=>ht(E.userState,v.userId)),R=()=>{l?.status?.code!=="active"&&a(Za(n,!0))};c.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&l?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&D===!1&&(setTimeout(R,3e3),A(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,l?.cardActivationAttemptHistory]);const Y=E=>{B(E)};if(w!=="Completed"||l==null)return s.jsx(Ze,{fetchState:"In-Progress"});if(l.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if($?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Yr,{children:[s.jsx(ha,{isAppContentDrawerOpen:f,handleDrawerToggle:Y}),s.jsx($r,{cardId:n,card:l,shippingAddressId:l.shippingAddressId,phone:$.phone,signedInUser:v,isSandboxEnv:qa(),chargeCardDetailState:g,signedInUserToken:O,navigate:r,currentTenant:k,location:u,maxChargeCardActivationAttempts:b[n]!=null?b[n]:h.default_max_charge_card_activation_attempts!=null?h.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{Y(!0)}}),e!=null?s.jsx(Gr,{windowSize:t,children:e}):null]})},$r=ge(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const u=an(e.addressState,a);if(u==null)throw Error("Can't access shippingAddress.");const m=ft(e,n),C=t.updateStatus,I=Ye(e,!1,!1,!1);let o=!1;I.fetchState==="Completed"&&I.cards.length<=1&&(o=!0);const i=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(tn())||i,showMenuIcon:o,shippingAddress:u,vgsVaultId:La.cardVaultId,twoFAView:m,activationWaitStatus:C,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:u,chargeCardDetailState:m}=t,C=m.chargeCard?.cardProviderID,{tenantEmailDomain:I}=u;return{onGetOtp:o=>{C!=null&&e(va(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(rn(r,o))},onResendOtp:o=>{C!=null&&e(Fa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{C!=null&&e(Ta(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&J.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(nn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ue(I):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(pr),Gr=_e.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
width: ${e=>`${Mr.containerWidth.value(e.windowSize)}%`};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as m}from"./liveblocks-3WpI1obg.js";import{a as g}from"./sentry-z6zkwC0R.js";import{j as v,h as x,u as k,l as T,g as O,k as E}from"./core-BpuExePz.js";import{z as b,b0 as F,x as P,e as L,g as V,aa as N,b1 as j,ao as A,ap as U,s as B}from"./index-DidLjpq0.js";import{eN as D,fB as _,rx as M,fw as R,c0 as z,Lw as G,bn as Y,pF as H,pt as Z,j_ as $,lu as S,Lx as q,bC as J,ct as C,lC as K,lF as Q}from"./zeni-epic-state-RQBIdQMH.js";import"./mui-Bpme9BmU.js";import{c as W}from"./routePaths-D7d1SJs7.js";import{M as X}from"./MobileAppDrawer--t6IvFv1.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new n.Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="f88c579b-f4d3-4fa2-bf46-9e62c0f73a29",n._sentryDebugIdIdentifier="sentry-dbid-f88c579b-f4d3-4fa2-bf46-9e62c0f73a29")}catch{}})();const ee=E(function(n){const a=R(n),i=b.getSignedInUser(),l=D(n),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=z(l?.userRole??[])&&a.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=G(n.companyConfigState),t=n.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:a.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:a,allIndustries:e.companyIndustries??[],allNationalityCountries:t,isDisabled:f,authParams:p,filesEndPoint:`${A.fileMicroServiceBaseUrl}`,isZeniUser:Y(i)}},function(n,a){const{companyId:i,currentTenant:l,navigate:c,location:p}=a,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let t=e.href;t.includes("http")||(t="https://".concat(t)),window.open(t,"_blank")},onSaveAll:()=>{n(Q())},onAddressClick:e=>{const t=W(f,e),o=B(p.state?.pathnameStackToGoBack,p.pathname);c(t,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{n(K({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:t,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=t,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,w={companyInfo:{...t,website:u!=""&&u!=null?C(u):void 0,meetingLink:y!=""&&y!=null?C(y):void 0,industry:t.industry.selectedOption,companyIndustryType:t.companyIndustryType?.selectedOption??void 0,companySubIndustry:t.companySubIndustry?.selectedOption??void 0,businessModel:t.businessModel.selectedOption??"",companySourceOfFunds:t.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:t.companySourceOfFundsDescription??void 0,countriesOfOperations:t.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:U(I))??[],transactionVolume:t.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:t.transactionVolumeDescription??void 0,regulatedStatus:t.regulatedStatus??void 0,regulatedStatusDescription:t.regulatedStatusDescription??void 0,usNexus:t.usNexus??void 0,usNexusTypes:t.usNexusTypes?.selectedOptions??[],purposeOfAccount:t.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:t.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?J(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};n(S({companyDetails:w}))},onPrimaryContactDetailsUpdated:e=>{n(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{n(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{n(q(e))},onCompanyOfficerUpdated:e=>{n(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{n($({files:e}))},onDeleteFile:e=>{n(Z(e))},onEditFileName:(e,t)=>{n(H(e,t.split(".")[0]))}}})(j);function de(){const n=v(),a=x(),i=k(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),t=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>D(s)),d=r.companyId??b.getSignedInUserTenant(l)?.companyId;if(b.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||t!=="Not-Started"||d==null||(p(!0),a(_(d)))},[c,t,d,a]),g.useEffect(()=>{o==="Not-Started"&&a(M())},[o,a]);const u=s=>{e(s)},y=t==="Not-Started"||t==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&t==="Error"?m.jsx(F,{onGoHome:()=>n("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:L,onLoad:s=>s.trackPageLoaded(V.Event.companyPassport,N(i)?"Settings":"Company Passport")}),N(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:n,location:i,isLoading:y,currentTenant:r,isSettings:N(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{j as C}from"./liveblocks-3WpI1obg.js";import{a}from"./sentry-z6zkwC0R.js";import{h as D,u as v,g as u,N as w}from"./core-BpuExePz.js";import{Ih as O,eN as A,fi as _,ml as U,fK as E,fh as j,eO as L,Io as F}from"./zeni-epic-state-RQBIdQMH.js";import{u as $,z as c,L as g,D as k,o as H}from"./index-DidLjpq0.js";import{n as z}from"./mui-Bpme9BmU.js";import{t as R}from"./getLocaleForTenant-CjnKm7X5.js";import{g as P,Q as G}from"./QBOConnectionScreen-DUGBXHYt.js";import"./recharts-D5_tB-NC.js";import"./analytics-DMOhZ7ep.js";import"./plaid-CTMaHWW7.js";import"./dnd-Ool1WkEK.js";import"./stripe-DMRn4zHo.js";import"./lottie-DFxKNIfK.js";import"./lexical-9B5gs5tG.js";import"./pdf-CAA7iyNe.js";import"./utils-Cb7KsPLv.js";import"./empty-BBb-0fG-.js";import"./pdf-lib-CRl3mCcE.js";import"./index-CiibyDuy.js";import"./url-CVCmlGqq.js";import"./index-B2-OsYcb.js";import"./decodeURIComponentSafe-BRoMr-Xr.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="0ae4bc04-71c6-498a-885b-aaa1e72bddfe",t._sentryDebugIdIdentifier="sentry-dbid-0ae4bc04-71c6-498a-885b-aaa1e72bddfe")}catch{}})();const K=z.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
flex: 1 1 auto;
|
|
4
|
+
flex-direction: row;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
align-items: center;
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 100vh;
|
|
9
|
+
background-color: ${t=>t.theme.colors.background};
|
|
10
|
+
box-shadow: ${t=>`0px 2px ${H.sp1} ${t.theme.colors.dropShadowNormal}`};
|
|
11
|
+
`;function pe(){const t=D(),i=v(),{setLoading:d,clearAllLoading:b}=$(),p=a.useRef(!1),f=a.useRef(!1),{code:x,realmId:N,state:T}=P(i.search),y=x!==""&&N!==""&&T!=="",I=u(l=>O(l)),e=u(l=>A(l)),n=u(l=>l.tenantState.fetchState),r=u(l=>l.tenantState.activeTenantFetchState.fetchState),o=c.getSignedInUser(),m=c.getActiveTenantForUser()?.tenantId,s=e?.externalConnections?.fetchState,h=e?.externalConnections?.saveConnectionState,S=e.externalConnections?.accounting[0]?.isValid;return a.useLayoutEffect(()=>{d(g.CONNECTION_AUTH)},[d]),a.useEffect(()=>{p.current||o==null||m==null||(p.current=!0,n==="Completed"||r!=="Not-Started"&&r!=="Error"||(d(g.TENANT_FETCHING),t(_(o.userId,m))))},[p,n,d]),a.useEffect(()=>{e.tenantId==null&&!f.current&&o!=null&&(f.current=!0,!(m==null||m!=null&&(r==="Completed"||r==="Error"))||n!=="Not-Started"&&n!=="Error"||t(U(o.userId)))},[f,n,r]),a.useEffect(()=>{o==null||e?.tenantId==null||e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||s==="In-Progress"||h!=="Error"||(d(g.CONNECTION_AUTH),t(E(o.userId,e.tenantId)))},[h]),a.useEffect(()=>{n!=="Completed"&&r!=="Completed"||o==null||e?.tenantId==null||(t(j(e.tenantId)),c.saveActiveTenantDomainForUser(e.tenantEmailDomain),L(o?.userId,o?.zeniSessionId,e.tenantId),k.updateAppLocaleID(R(F(e))),e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||s==="In-Progress"||o==null||e==null||t(E(o.userId,e.tenantId)))},[n,r,s]),a.useEffect(()=>{I.tenantsCoreDetailsInOrder.length>0&&n==="Completed"&&c.saveSignedInUserTenants(I.tenantsCoreDetailsInOrder)},[I.tenantsCoreDetailsInOrder.length,n]),a.useEffect(()=>{n!=="Completed"&&n!=="Error"||r!=="Completed"&&r!=="Error"||s!=="Completed"&&s!=="Error"||b()},[n,r,s]),e==null||n!=="Completed"&&r!=="Completed"||s!=="Completed"?null:y||S===!1?C.jsx(K,{children:C.jsx(G,{})}):C.jsx(w,{to:"/",replace:!0})}export{pe as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as d}from"./liveblocks-3WpI1obg.js";import{z as n}from"./index-DidLjpq0.js";import{g as p}from"./QBOConnectionScreen-DUGBXHYt.js";import"./sentry-z6zkwC0R.js";import{u as a,N as i}from"./core-BpuExePz.js";import"./zeni-epic-state-RQBIdQMH.js";import"./recharts-D5_tB-NC.js";import"./mui-Bpme9BmU.js";import"./analytics-DMOhZ7ep.js";import"./plaid-CTMaHWW7.js";import"./dnd-Ool1WkEK.js";import"./stripe-DMRn4zHo.js";import"./lottie-DFxKNIfK.js";import"./lexical-9B5gs5tG.js";import"./pdf-CAA7iyNe.js";import"./utils-Cb7KsPLv.js";import"./empty-BBb-0fG-.js";import"./pdf-lib-CRl3mCcE.js";import"./index-CiibyDuy.js";import"./url-CVCmlGqq.js";import"./index-B2-OsYcb.js";import"./decodeURIComponentSafe-BRoMr-Xr.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]="b68d0d57-e81d-4cfb-97e6-d4dd5e5b7ebd",t._sentryDebugIdIdentifier="sentry-dbid-b68d0d57-e81d-4cfb-97e6-d4dd5e5b7ebd")}catch{}})();const U=()=>{const t=a(),{code:o,realmId:r,state:e}=p(t.search),s=n.getSignedInUser()?.userId??"";if(f(o,r,e,s)===!0){const m=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return d.jsx(i,{to:m})}return d.jsx(i,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
|