@zeniai/web-app-ui 5.1.50-qa → 5.1.51-qa
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AddressRoutes-gPXkxz7s.js +1 -0
- package/dist/assets/AddressScreen-DHENiPsE.js +9 -0
- package/dist/assets/{AiCfoScreen-CU17MHVZ.js → AiCfoScreen-BDeqJ8PX.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-DI3GeN36.js → BillPayApprovalRoutes-re8xxMBE.js} +1 -1
- package/dist/assets/{BillPayRoutes-P7Y6TLRl.js → BillPayRoutes-BKu8tYXF.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-B6nnpXHm.js → BusinessVerificationPageScreen-7ydI8UR9.js} +2 -2
- package/dist/assets/{CardsAiCfoScreen-C86bVfoq.js → CardsAiCfoScreen-QyowC-mN.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-B7sSoo6a.js → ChargeCardRoutes-BbZEL-b5.js} +8 -8
- package/dist/assets/CompanyPassportScreen-AZhDXSZE.js +1 -0
- package/dist/assets/ConnectionAuthScreen-DDij7-L5.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-DO3NyaR6.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-p6Uk3iSA.js → CustomerOnboardingRoutes-COHKYeEq.js} +5 -5
- package/dist/assets/{DashboardRoutes-DNmUL7Mt.js → DashboardRoutes-B1cE2wJc.js} +1 -1
- package/dist/assets/{DefaultTenantHome-CArToClw.js → DefaultTenantHome-DivCz85L.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-Du8m5leq.js → DomesticWireDetailScreen-Bx2DINVR.js} +4 -4
- package/dist/assets/DrawerScreen-BtLrlXnn.js +1 -0
- package/dist/assets/EntityDetailRoutes-CTo7No6n.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-c8htRkth.js → ExpenseAutomationRoutes-pmgLYKV-.js} +3 -3
- package/dist/assets/FeaturePreviewScreen-9NvuDbvP.js +1 -0
- package/dist/assets/{HubSpotOAuthCallbackScreen-Bz7yvuoV.js → HubSpotOAuthCallbackScreen-BrjX8V0E.js} +1 -1
- package/dist/assets/MagicLinkRoutes-Dn4g326h.js +72 -0
- package/dist/assets/{MagicLinkSignInScreen-B6HjyZXP.js → MagicLinkSignInScreen-CTkVv0M2.js} +1 -1
- package/dist/assets/{MobileAppDrawer-Di4Asbvj.js → MobileAppDrawer-CjoW3Rax.js} +1 -1
- package/dist/assets/NotFoundScreen-FcrdBNP0.js +1 -0
- package/dist/assets/{NotificationRoutes-D30uoziM.js → NotificationRoutes-DE-Z8DSv.js} +1 -1
- package/dist/assets/OAuthConsentScreen-Swpq9wju.js +1 -0
- package/dist/assets/{PandLWithForecastRoutes-BNImskJm.js → PandLWithForecastRoutes-C3Yczwgv.js} +1 -1
- package/dist/assets/{PeopleRoutes-iIMj8eLi.js → PeopleRoutes-ZidIbEdd.js} +1 -1
- package/dist/assets/PerformanceRoutes-VzYGFOXy.js +1 -0
- package/dist/assets/{Preview-CKm-UT5u.js → Preview-OiplHjn8.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-BRLzEkDk.js → QBOConnectionScreen-B8QVReQm.js} +1 -1
- package/dist/assets/ReferralListScreen-Cnd7u4T9.js +5 -0
- package/dist/assets/{ReimbursementApprovalRoutes-f5ArhwXZ.js → ReimbursementApprovalRoutes-DOhkjING.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-T0juC1PH.js → ReimbursementApprovalRuleDetailScreen-BgYFphfr.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-BSjsp3vu.js → ReimbursementRoutes-BeD0lwna.js} +5 -5
- package/dist/assets/{ReportsRoutes-DCLcYlo7.js → ReportsRoutes-CPI-jy1F.js} +1 -1
- package/dist/assets/RewardsRoutes-Vdol6ACr.js +1 -0
- package/dist/assets/{ScreenRoutes-DdzWD1U9.js → ScreenRoutes-B24ySlpK.js} +2 -2
- package/dist/assets/{SettingsRoutes-XvLWREEF.js → SettingsRoutes-D7qVKl5_.js} +1 -1
- package/dist/assets/{SetupPagesScreen-BHoPLick.js → SetupPagesScreen-DtddTp_T.js} +5 -5
- package/dist/assets/SignInScreen-u3NwSgsj.js +1 -0
- package/dist/assets/SignOutScreen-Djs9TXWR.js +9 -0
- package/dist/assets/TaskListScreen-DMgU1v4z.js +9 -0
- package/dist/assets/{TaskRoutes-Cl6WmGjc.js → TaskRoutes-Cmtr7KFm.js} +2 -2
- package/dist/assets/{TransactionDetailRoutes-DG6Ytg87.js → TransactionDetailRoutes-CjrDVjtT.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-wFSRY2vY.js → TransactionDetailScreen-ABqf1zzA.js} +1 -1
- package/dist/assets/{TransactionListRoutes-CwzK16MP.js → TransactionListRoutes-uZihQK3F.js} +1 -1
- package/dist/assets/{TreasuryRoutes-B9PQeIn4.js → TreasuryRoutes-ZtY_hGM6.js} +6 -6
- package/dist/assets/{VendorsRoutes-CWH9LrHd.js → VendorsRoutes-DcUkIEvd.js} +10 -10
- package/dist/assets/WiseConfirmationScreen-DYcjQlfc.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-Du2IGRi6.js → ZeniAccountRoutes-Cbm2k-08.js} +11 -11
- package/dist/assets/ZeniAccountStatementScreen-Ciuw5n7i.js +9 -0
- package/dist/assets/{accountMappingHelper-D75TOEDA.js → accountMappingHelper-DDqSB3xQ.js} +1 -1
- package/dist/assets/{analytics-CkXhIYGA.js → analytics-DoyQ8ezf.js} +1 -1
- package/dist/assets/{analyticsHelper-BTLx1JWo.js → analyticsHelper-CvGdvadP.js} +1 -1
- package/dist/assets/{core-B5TeChD4.js → core-CQnSJ9vO.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-DXB7OyA3.js → decodeURIComponentSafe-BprI0TcI.js} +1 -1
- package/dist/assets/{dnd-CWnSyq9-.js → dnd-DoHm848q.js} +1 -1
- package/dist/assets/{empty-r-IKwqcp.js → empty-BZMPWXIo.js} +1 -1
- package/dist/assets/{empty-D1f-cCDu.js → empty-DjW_4H8B.js} +1 -1
- package/dist/assets/{emptyVideoElement-B8V1wuPO.js → emptyVideoElement-CD9clJu_.js} +1 -1
- package/dist/assets/{epic-DuAKKq3W.js → epic-2G17lmbK.js} +1 -1
- package/dist/assets/{getLocaleForTenant-yKPZZnim.js → getLocaleForTenant-CAvD8CfA.js} +1 -1
- package/dist/assets/{index-B0QsCXA7.js → index-B6GtF9yZ.js} +2 -2
- package/dist/assets/{index-CGTF1rlJ.js → index-BtlQ6O6E.js} +1 -1
- package/dist/assets/{index-DDl-KBgR.js → index-C6MtcitK.js} +1 -1
- package/dist/assets/{index-C_NwT3-k.js → index-CF7DasjB.js} +1 -1
- package/dist/assets/{index-BfRRBBMI.js → index-Ci7GqulV.js} +1 -1
- package/dist/assets/{index-R3BgB7Uo.js → index-DgHQU_66.js} +1 -1
- package/dist/assets/{index-Kq1a616O.js → index-KsPtT3xm.js} +1 -1
- package/dist/assets/{index-DLvmOqpd.js → index-W83PhAZh.js} +14061 -13986
- package/dist/assets/{lexical-D7c0ykAW.js → lexical-WXHH1XHj.js} +1 -1
- package/dist/assets/{liveblocks-C-n95g0A.js → liveblocks-DvKPzrwo.js} +1 -1
- package/dist/assets/{lottie-zNHYqEBz.js → lottie-DNsrs-P3.js} +1 -1
- package/dist/assets/{mui-Da8iY16Z.js → mui-sKCdI-e6.js} +1 -1
- package/dist/assets/{pathToGoBack-nrN7wX5B.js → pathToGoBack-DDBtlyQ4.js} +1 -1
- package/dist/assets/{pdf-BM7gJkYi.js → pdf-iXI4qQyj.js} +4 -4
- package/dist/assets/{pdf-lib-BVCnHm-C.js → pdf-lib-C9eLuUx2.js} +1 -1
- package/dist/assets/{plaid-kqYG7b9d.js → plaid-BOu_8LCE.js} +1 -1
- package/dist/assets/{pusher-CLZoiBO8.js → pusher-BxMucY8d.js} +1 -1
- package/dist/assets/{react-BggCpRGR.js → react-BY08R1tD.js} +1 -1
- package/dist/assets/{react-B40ow9gH.js → react-BfWAIeRe.js} +1 -1
- package/dist/assets/{react-CbGrXN5I.js → react-Bfv7BUzV.js} +1 -1
- package/dist/assets/{react-zGBF6iFI.js → react-CHbhfie6.js} +1 -1
- package/dist/assets/{react-C3y2xvic.js → react-DVBLaOmV.js} +1 -1
- package/dist/assets/{react-C-sHFsWu.js → react-DW2tK8z_.js} +1 -1
- package/dist/assets/{recharts--v-RQjOV.js → recharts-Cv5d-Vxs.js} +1 -1
- package/dist/assets/{routePaths-2w3X-cgQ.js → routePaths-stnXzrYV.js} +1 -1
- package/dist/assets/{sentry-lku8kjDH.js → sentry-Be8twC83.js} +1 -1
- package/dist/assets/{url-CRmtHtjd.js → url-AlENSCVt.js} +1 -1
- package/dist/assets/{url-ByXYagPi.js → url-CuDHWvgT.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-B3aexdxF.js → useAiCfoDashboardSuggestedQuestionsChips-CKfyn0VP.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-DAlpTVgV.js +1 -0
- package/dist/assets/useCashManagementBanner-D8slgHwh.js +1 -0
- package/dist/assets/{useDeviceId-bV7jqaoy.js → useDeviceId-KC-rY1dP.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-CzZzqfSl.js → useInitialThreadRequest-BDAn-AM4.js} +1 -1
- package/dist/assets/{utils-Dw1Jg_v9.js → utils-BcJ2NV01.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-Cey9nHHc.js → withTransactionSidePanel-B9fglQqM.js} +4 -4
- package/dist/assets/{zeni-epic-state-BzDw8pi_.js → zeni-epic-state-DKeO4Z0C.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +2 -2
- package/dist/assets/AddressRoutes-g9hsklrH.js +0 -1
- package/dist/assets/AddressScreen-CROQK-4n.js +0 -9
- package/dist/assets/CompanyPassportScreen-Cgus-IIN.js +0 -1
- package/dist/assets/ConnectionAuthScreen-BQrFf5wV.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-DPNE702o.js +0 -1
- package/dist/assets/DrawerScreen-m2dilTdj.js +0 -1
- package/dist/assets/EntityDetailRoutes-BR5FqZ6H.js +0 -1
- package/dist/assets/FeaturePreviewScreen-BN_uvK-S.js +0 -1
- package/dist/assets/MagicLinkRoutes-DAvXqhJs.js +0 -72
- package/dist/assets/NotFoundScreen-C6d7g4SD.js +0 -1
- package/dist/assets/OAuthConsentScreen-ChiMp_o9.js +0 -1
- package/dist/assets/PerformanceRoutes-Di1aWI-4.js +0 -1
- package/dist/assets/ReferralListScreen-qJwU61pa.js +0 -5
- package/dist/assets/RewardsRoutes-22WA6TT7.js +0 -1
- package/dist/assets/SignInScreen-CNtwWkn8.js +0 -1
- package/dist/assets/SignOutScreen-BvFuH3BL.js +0 -9
- package/dist/assets/TaskListScreen-CaQaxe3c.js +0 -9
- package/dist/assets/WiseConfirmationScreen-2rmdb0s6.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-C6xjVyVS.js +0 -9
- package/dist/assets/useAskAiCfoHostNavButtonProps-CKXnZIoK.js +0 -1
- package/dist/assets/useCashManagementBanner-H0sv1SAg.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-DvKPzrwo.js";import{A as d}from"./AddressScreen-DHENiPsE.js";import i from"./NotFoundScreen-FcrdBNP0.js";import"./sentry-Be8twC83.js";import{o as s,p as r}from"./core-CQnSJ9vO.js";import"./zeni-epic-state-DKeO4Z0C.js";import"./recharts-Cv5d-Vxs.js";import"./index-W83PhAZh.js";import"./mui-sKCdI-e6.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.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]="cd0ff2b4-1e27-4329-addf-f475e5a9db34",t._sentryDebugIdIdentifier="sentry-dbid-cd0ff2b4-1e27-4329-addf-f475e5a9db34")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(d,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(d,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as d}from"./liveblocks-DvKPzrwo.js";import{a as h}from"./sentry-Be8twC83.js";import{h as T,u as _,g as j,i as M,j as E,n as B}from"./core-CQnSJ9vO.js";import{K as $,m as D,z as K,j as L,B as R,w as z,c as C,e as S,p as F,h as b,q as N}from"./index-W83PhAZh.js";import{Ml as w,hP as U,eW as q,Mm as G,c7 as O,Mn as V,l8 as H}from"./zeni-epic-state-DKeO4Z0C.js";import{n as W}from"./mui-sKCdI-e6.js";import J from"./NotFoundScreen-FcrdBNP0.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]="240cb2c5-cb36-44e3-88d3-52eec673364b",e._sentryDebugIdIdentifier="sentry-dbid-240cb2c5-cb36-44e3-88d3-52eec673364b")}catch{}})();const Q=W.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100vh;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`,X=B(function(e,t){const{addressId:o,isSubPage:i,addressType:c}=t,l=q(e),a=t.roleMap!=null&&G(t.roleMap),r=i||c==="user_address"||O(l?.userRole??[])||a?void 0:"readonly";if(o==null){const s=V(c,e);return{addressToEdit:s?.addressToCreate,loadingState:s?.status?.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:r,isSubPage:i,dontShowSaveConfirmationPopup:t.dontShowSaveConfirmation}}const n=w(e,o);return{addressToEdit:n.address,loadingState:n.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:r}},function(e,t){const{navigate:o,location:i,addressType:c}=t,l=a=>{if(a==="express-pay")o("../express-pay/add-wire");else{const r=i.state,n=N(r?.pathnameStackToGoBack);let s=n.poppedPathname??I();const u=r?.queryParams;if(u){const g=new URLSearchParams(u).toString();g&&(s=`${s}?${g}`)}o(s,{state:{pathnameStackToGoBack:n.newStack}})}};return{onSubmitHandler:a=>{const r=Y(a);e(H({addressType:c,addressToCreate:r})),C?.trackSaveAddressClicked(S.Event.saveAddressClicked,{street:a.street.addressString,city:a.city,state:a.state,country:a.country.selectedOption??"",postalCode:a.postalCode,suite:a.suite,secondaryInfo:a.secondaryInfo}),l(t.bankAccountContext)},onCancel:()=>{l(t.bankAccountContext)}}})(F);function de({isSubPage:e,hideAddressSubTitle:t=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=T(),r=_(),n=j(),{addressId:s,addressType:u}=M(),g=$(),k=D(),v=K.getSignedInUser(),[p,x]=h.useState(s==null),f=E(m=>s!=null?w(m,s).fetchState:"Not-Started"),A=L();if(v==null)throw Error("Can't access address page without signing in...");const P=m=>m.trackPageLoaded(s!=null?S.Event.editAddress:S.Event.addAddress),y=l??u;return h.useEffect(()=>{p||s==null||(x(!0),r(U(s,!1)))},[p,s,r]),y==null||y.match(/(user_address|company_address|company_registered_address|vendor_address|officer_([1-9]|10)_address)$/g)?!p&&f==="Not-Started"||p&&f==="In-Progress"?d.jsx(R,{fetchState:f,style:{backgroundColor:k.colors.grey5}}):s!=null&&f==="Error"?(a(`${I(1)}/new`,{replace:!0}),d.jsx(d.Fragment,{})):d.jsxs(d.Fragment,{children:[d.jsx(z,{analytics:C,onLoad:P}),d.jsx(Q,{windowSize:g,children:d.jsx(X,{location:n,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:t,addressId:s,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:A?.loggedInUserRoleMap})})]}):d.jsx(J,{})}const I=(e=2)=>{let t="../";for(let o=0;o<e;o++)t=`${t}../`;return t},Y=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng});export{de as A,Y as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-
|
|
1
|
+
import{j as d}from"./liveblocks-DvKPzrwo.js";import{a as l}from"./sentry-Be8twC83.js";import{u as ge,h as Ce,g as Ie,j as X,i as ke,n as be}from"./core-CQnSJ9vO.js";import{X as we,z as xe,K as Pe,d9 as Ee,da as ye,b6 as K,db as Te,b5 as Y,q as D,w as F,c as I,dc as L,dd as ve,de as Qe,a1 as _e,e as Ae,a7 as Oe,df as je,a2 as Ue,dg as Fe,dh as Le,r as Be,b1 as De,di as Re}from"./index-W83PhAZh.js";import{gk as Me,eV as ee,eW as Ge,iv as Ve,Ts as $e,f0 as Ne,iF as qe,iB as We,eX as B,f7 as ze,fZ as He,fC as Xe,fG as Z,f_ as Ke,f$ as Ze,g0 as Je,g1 as Ye,g2 as et}from"./zeni-epic-state-DKeO4Z0C.js";import{D as tt,n as k,S as st,P as ot}from"./mui-sKCdI-e6.js";import{u as at}from"./useAiCfoDashboardSuggestedQuestionsChips-CKfyn0VP.js";import{p as nt}from"./pathToGoBack-DDBtlyQ4.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new t.Error().stack;r&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[r]="c64a6bec-030a-4774-a131-985270df8ada",t._sentryDebugIdIdentifier="sentry-dbid-c64a6bec-030a-4774-a131-985270df8ada")}catch{}})();const te="chat-response-generated",it=be(function(t,r){const s=ee(t),m=r.isSubmitting,n=s.uiState?.currentChatSessionId,p=n!=null?ze(t.aiCfoState,n):[];return{showSampleQuestions:r.sessionFromUrl==="explore"&&s.uiState.currentChatSessionId==null,aiCfoView:s,isSubmitting:m,isNewChatSession:r.sessionFromUrl==="new_chat"||r.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Ue}/tableDownload`,emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,routedInitialQuestionSource:r.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:r.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:r.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:r.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:r.isFileUploadEnabled,isUploadPromoVisible:r.isUploadPromoVisible,onUploadPromoClose:r.onUploadPromoClose,syntheticAnswers:p,resolveSyntheticAnswerCardTile:Le(t),resolveSyntheticAnswerPolicyTile:Fe(t)}},function(t,r){const{location:s,currentTenant:m,userId:n,navigate:p,currentChatSessionId:S,allSessionsWithOrderedQuestionAnswers:u,setIsAiCfoOpen:f}=r;return{onEventReceived:(e,h)=>{if(e===te&&typeof h.text=="string"&&typeof h.metadata=="object"){const a=h,c=Ze(a.type),o=a.metadata.chat_session_id??null,{currentChatSession:E,currentQuestionAnswer:b,currentQuestionAnswerSummary:y}=Y(u,o);c!=="answer"?I.trackAICFOChatResponseGenerated(c,b?.question.questionText??"",a.text,o,Re(y,E),a.metadata.message_id??null):I.trackAICFOChatAnswerGenerated(a.text,b?.question.questionText??"",(a.follow_up_questions?.length??0)>0,!!a.assumptions,!!a.insights,a.visualization!=null,Je(a.visualization?.type??"")??null,o,a.summarized_title,a.metadata.message_id??null),t(Ye({chatSessionId:a.metadata.chat_session_id,responseType:c,fetchState:{fetchState:"Completed",error:void 0}})),t(et({chatSessionId:a.metadata.chat_session_id,answerPayload:a,userId:n}))}},onSubmit:(e,h,a,c)=>{e&&De(t,e,h,S,u,n,c,a)},updateCurrentInput:e=>{t(Z(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{t(Ke(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{p(-1)},onCloseClick:()=>{const e=D(s.state?.pathnameStackToGoBack),h=e.poppedPathname??nt(1);p(h,{state:{...s.state,pathnameStackToGoBack:e.newStack}}),t(Z(""))},togglePageView:()=>{const e=D(s.state?.pathnameStackToGoBack),h=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;p(h,{state:{...s.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),f(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{p(-1)},onNewChatClick:()=>{S!=null&&t(Xe());const e=Be(s.state?.pathnameStackToGoBack,s.pathname);p(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,h)=>{t(He({questionAnswerId:e,isCollapsed:h}))},onMenuClick:r.onMenuClick}})(Oe(je)),vt=({isFileUploadEnabled:t})=>{const{setIsAiCfoOpen:r}=we(),s=ge(),m=Ce(),n=Ie(),[p,S]=l.useState(!1);l.useEffect(()=>{s(Me())},[s]);const u=X(i=>ee(i)),f=xe.getSignedInUser(),{session_id:e}=ke(),h=Pe(),a=_e(h),c=X(i=>Ge(i)),o=u.uiState.currentChatSessionId,E=c.tenantEmailDomain,{handleUploadPromoClose:b,isUploadPromoVisible:y}=Ee({isFileUploadEnabled:t,tenantEmailDomain:E}),T=ye({currentTenant:c,currentChatSessionId:o,aiCfoView:u}),{isSuggestedQuestionsLoading:se,suggestedPromptQuestions:oe}=at(),w=n.state,x=w?.aiCfoInitialQuestion,R=!!w?.aiCfoShouldSubmit;l.useEffect(()=>{const i=n.state;if(i?.[K]!==!0)return;S(!0);const g={...i};delete g[K],m(n,{replace:!0,state:g})},[n.pathname,n.search,n.state,m]);const[ae,v]=l.useState(null),[ne,Q]=l.useState(!1),[ie,_]=l.useState(void 0),[re,A]=l.useState(void 0),M=l.useRef(!1);l.useEffect(()=>{if(!M.current&&x!=null&&x!==""){const i=n.state;v(x),Q(R),_(i?.aiCfoInitialSubmissionSource!=null?i.aiCfoInitialSubmissionSource:void 0);const g=i?.aiCfoSuggestionIndex;A(typeof g=="number"?g:void 0),M.current=!0}},[x,R,n.state]);const le=l.useCallback(()=>{v(null),Q(!1),_(void 0),A(void 0)},[]),G=l.useMemo(()=>new URLSearchParams(n.search),[n.search]),V=G.get("ref")??w?.aiCfoRef,O=G.get("emailRefId")??w?.aiCfoEmailRefId,$=l.useRef(!1);l.useEffect(()=>{$.current||V!=="month-end-email"||O==null||o!=null||f==null||(s(Ve("controller",f.userId,O,"MONTH_END_EMAIL")),$.current=!0)},[V,O,o,s,f]);const P=u.uiState.lastContextMessage;l.useEffect(()=>{P!=null&&P!==""&&o!=null&&(v(P),Q(!0),_(void 0),A(void 0),s($e()))},[P,o,s]);const de=c.masterTOSInfo,C=de?.isMasterTOSAccepted??!1,{visitedSessions:N}=Te(o),j=u.fetchState,U=u.uiState.chatSessionsNextPageToken.hasMore||!u.uiState.chatSessionsFirstPageFetched,q=o!=null?u.fetchChatSessionHistoryByChatSessionId?.[o]?.fetchState??"Not-Started":"Not-Started",W=o==null||(u.uiState.chatHistoryNextPageToken[o]?.hasMore??!0),z=u.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:ce}=Y(z,o),ue=ce.length===0;l.useEffect(()=>{C||a||m("../dashboard",{state:{...n.state,message:"open_ai_cfo_drawer"}})},[C,a,m,n.state]);const me=l.useCallback(()=>{const i=D(n.state?.pathnameStackToGoBack),g=c.tenantEmailDomain;m(i.poppedPathname??(g!=null?`/${g}/dashboard`:".."),{state:{...n.state,pathnameStackToGoBack:i.newStack}})},[c.tenantEmailDomain,n.state,m]);l.useEffect(()=>{o!=null&&e!==o&&m(`../ai-cfo/${o}`,{state:{...n.state}})},[o,e]),l.useEffect(()=>{e!=null&&o==null&&e!=="new_chat"&&e!=="explore"&&s(Ne({sessionId:e,agentId:"controller"}))},[]);const pe=l.useMemo(()=>({events:N.map(i=>`private-encrypted-chat-${i}.${te}`),eventCallback:(i,g,fe)=>fe.onEventReceived(i,g)}),[N]);l.useEffect(()=>{j!=="In-Progress"&&U&&s(qe())},[j,U,s]),l.useEffect(()=>{o!=null&&q!=="In-Progress"&&W&&f!=null&&j==="Completed"&&!U&&s(We(o,f.userId))},[q,W,o,f,s]);const H=i=>i.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(f==null||e==null)throw Error("Can't access AI Controller page without signing in...");const he=o!=null&&u.responseStateByChatSessionId?.[o]?.answer?.fetchState==="In-Progress";if(!C&&a)return d.jsxs(lt,{children:[d.jsx(F,{analytics:I,onLoad:H}),T.drawerElement,d.jsx(dt,{children:d.jsx(J,{children:d.jsx(L,{isTOSAccepted:!1,acceptMasterTOSState:u.masterTOSAcceptanceState,onCloseClick:me,onCompleteClick:()=>{c.userRoleId!=null&&s(B(c.userRoleId))}})})})]});const Se=d.jsxs(d.Fragment,{children:[p&&!C?d.jsx(F,{analytics:I,onLoad:H}):null,d.jsx(L,{isTOSAccepted:C,acceptMasterTOSState:u.masterTOSAcceptanceState,showHeader:!1,togglePageView:C?()=>S(!1):void 0,onCloseClick:()=>S(!1),onCompleteClick:()=>{C||c.userRoleId==null||s(B(c.userRoleId)),S(!1)}})]});return d.jsxs(d.Fragment,{children:[d.jsxs(rt,{children:[d.jsx(F,{analytics:I,onLoad:i=>i.trackPageLoaded(Ae.Event.aiCFOPage)}),a&&T.drawerElement,d.jsx(it,{...pe,currentChatSessionId:o,allSessionsWithOrderedQuestionAnswers:z,openOnboardingPage:()=>S(!0),userId:f.userId,setIsAiCfoOpen:r,navigate:m,sessionFromUrl:e,location:n,isSubmitting:he,isEmptyChatWithSession:ue,currentTenant:c,emailLinkQuestion:ae??void 0,autoSubmitEmailLinkQuestion:ne,onEmailLinkQuestionProcessed:le,routedInitialQuestionSource:ie,routedInitialQuestionSuggestionIndex:re,onMenuClick:a?T.open:void 0,isFileUploadEnabled:t,isUploadPromoVisible:y,onUploadPromoClose:b,exploreSuggestedPromptQuestions:oe,exploreSuggestedPromptQuestionsLoading:se}),p&&a?d.jsx(tt,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:ct,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>S(!1),children:d.jsx(J,{onClick:i=>i.stopPropagation(),children:d.jsx(L,{isTOSAccepted:C,acceptMasterTOSState:u.masterTOSAcceptanceState,onCloseClick:()=>S(!1),onCompleteClick:()=>{C||c.userRoleId==null||s(B(c.userRoleId)),S(!1)}})})}):null]}),p&&!a?d.jsx(ve,{open:p,onClose:()=>S(!1),children:d.jsx(Qe,{children:Se})}):null]})},J=k(st)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as c}from"./liveblocks-C-n95g0A.js";import{a as v}from"./sentry-lku8kjDH.js";import{h as B,g as P,u as j,j as y,N as q,n as U,i as K,o as ee,p as x}from"./core-B5TeChD4.js";import{eW as k,PC as A,Pi as g,zf as E,z3 as J,zb as R,yZ as Z,Pk as G,z0 as te,z4 as H,zh as M,zg as D}from"./zeni-epic-state-BzDw8pi_.js";import{m as O,z as V,B as T,a7 as Q,bI as ae,af as _,bz as X,bJ as oe,bK as le,bL as pe}from"./index-DLvmOqpd.js";import"./mui-Da8iY16Z.js";import{i as se}from"./ReimbursementApprovalRuleDetailScreen-T0juC1PH.js";import re from"./NotFoundScreen-C6d7g4SD.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},p=new e.Error().stack;p&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[p]="cca95110-3b3b-4fe8-85a0-3054d7c07256",e._sentryDebugIdIdentifier="sentry-dbid-cca95110-3b3b-4fe8-85a0-3054d7c07256")}catch{}})();const N="bill-approval-rule-update",ne=U(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:g(e).billPaySetupApproverViewUpdateData}},function(e,p){const{navigate:t,location:s}=p;return{onApprovalRulesEventReceived:a=>{a.endsWith(N)&&e(G(!1))},onBackClick:()=>{_(s)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(Z(a,!1))},onEditRuleClick:a=>{a!=null?(e(R(a)),t(`./${a}/edit`)):(e(R()),t("./new"))}}})(Q(ae)),ie=()=>{const e=B(),p=P(),t=j(),[s,a]=v.useState(!1),[i,r]=v.useState(!1),d=O(),o=y(l=>l.billPaySetupApproverViewState.fetchState),u=y(l=>k(l)),n=y(l=>A(l)),f=y(l=>g(l).billPaySetupApproverViewUpdateData);if(v.useEffect(()=>{f?.updateStatus.fetchState==="Completed"&&t(E())},[f]),v.useEffect(()=>{s||o!=="Not-Started"||(a(!0),t(J(!0,!0,!1)))},[s,o,t]),V.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");v.useEffect(()=>{n.allApprovalRules.length===0&&n.fetchState==="Completed"&&(i||(r(!0),t(R())),e("./new"))},[i,n,t]);const m={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${N}`]:[],eventCallback:(l,w,h)=>{l.endsWith(N)&&h.onApprovalRulesEventReceived(l)}};return u.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?c.jsx(q,{to:"../../promo"}):u.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||n.fetchState!=="Completed"&&n.fetchState!=="Error"?c.jsx(T,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):c.jsx(ne,{currentTenant:u,location:p,navigate:e,...m})},F="bill-approval-rule-update",ce=U(function(e){const p=A(e),t=g(e).billPaySetupApproverViewUpdateData,s={};for(const i of Object.values(e.contactState.contactById))i?.id!=null&&(s[i.id]=i.fullName);const a={};for(const i of Object.values(e.classState.classesByKey))i?.classId!=null&&(a[i.classId]=i.className);return{approvalView:p,billPaySetupApproverViewUpdateData:t,vendorNamesById:s,departmentNamesById:a}},function(e,p){const{navigate:t,location:s}=p;return{onApprovalRulesEventReceived:a=>{a.endsWith(F)&&e(G(!1))},onBackClick:()=>{_(s)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(Z(a,!0))},onEditRuleClick:a=>{a!=null?(e(R(a)),t(`./${a}/edit`)):(e(R()),t("./new"))},onReorderRules:a=>{e(te(a,!0))}}})(Q(oe)),ue=()=>{const e=y(t=>k(t)),{isApprovalRulesV3Enabled:p}=X(e?.tenantId);return p?c.jsx(de,{}):c.jsx(ie,{})},de=()=>{const e=B(),p=P(),t=j(),[s,a]=v.useState(!1),[i,r]=v.useState(!1),d=O(),o=y(l=>l.billPaySetupApproverViewState.fetchState),u=y(l=>k(l)),n=y(l=>A(l)),f=y(l=>g(l).billPaySetupApproverViewUpdateData);if(v.useEffect(()=>{f?.updateStatus.fetchState==="Completed"&&t(E())},[f]),v.useEffect(()=>{s||o!=="Not-Started"||(a(!0),t(J(!0,!0,!0)))},[s,o,t]),V.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");v.useEffect(()=>{n.allApprovalRules.length===0&&n.fetchState==="Completed"&&(i||(r(!0),t(R())),e("./new"))},[i,n,t]);const m={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${F}`]:[],eventCallback:(l,w,h)=>{l.endsWith(F)&&h.onApprovalRulesEventReceived(l)}};return u.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?c.jsx(q,{to:"../../promo"}):u.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||n.fetchState!=="Completed"&&n.fetchState!=="Error"?c.jsx(T,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):c.jsx(ce,{currentTenant:u,location:p,navigate:e,...m})},ve=U(function(e,p){const t=g(e),s=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=s==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return p.approvalRuleId&&(i=t.allApprovalRules.findIndex(r=>r.approvalRuleId===p.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:i,approvalUpdateActionType:s}},function(e,p){const{navigate:t,approvalUpdateDataView:s,approverViewData:a,approvalRuleId:i}=p,r=s.billPaySetupApproverViewUpdateData?.type,d=_(p.location);return{onApprovalRuleDataUpdated:o=>{const u=f=>{const m=[];return f.forEach(l=>{const w=l.actors.selectedUsers.map(b=>({type:"user",userId:b.userId,isImplicitActor:!1})),h=l.actors.selectedNonUsers.map(b=>{const I=!!se(b.value);return{type:I?"attribute":"role",subType:b.value,userId:void 0,idType:void 0,isImplicitActor:!I}}),S=w.concat(h);m.push({action:l.stepType.selectedOption,actors:S,operator:S.length>1?l.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),m},n={amount:{type:"amount",comparator:"range",min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const f={criteria:n,steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingBills.includes("applyToExistingBills")};e(D(f))}else{const f={approvalRuleId:i,criteria:n,steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingBills.includes("applyToExistingBills")};e(D(f))}},onResetClick:()=>{e(E()),r==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),r==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(M(!1))},onSaveRuleSuccess:()=>{t("../")}}})(le);function fe(){const e=B(),p=j(),t=P(),{approvalRuleId:s}=K(),a=V.getSignedInUser(),i=O(),r=y(n=>g(n)),d=y(n=>A(n)),[o,u]=v.useState(!1);if(v.useEffect(()=>{o||(u(!0),p(H(!0)))}),v.useEffect(()=>{d.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[d,s]),a==null)throw Error("Can't access address page without signing in...");return r.approverListFetchStatus.fetchState=="Not-Started"||r.approverListFetchStatus.fetchState==="In-Progress"?c.jsx(T,{fetchState:r.approverListFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):c.jsx(ve,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:d,location:t})}const ye=U(function(e,p){const t=g(e),s=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=[],i={};for(const r of Object.values(e.contactState.contactById))r?.id!=null&&(a.push(r.id),i[r.id]=r.fullName);return{localData:t,approvalUpdateActionType:s,allVendorIds:a,vendorNamesById:i,editingRuleId:s==="approval_update"?p.approvalRuleId:void 0,allApprovalRulesWithUser:A(e).allApprovalRules}},function(e,p){const{navigate:t,approvalUpdateDataView:s,approverViewData:a,approvalRuleId:i}=p,r=s.billPaySetupApproverViewUpdateData?.type,d=_(p.location);return{onApprovalRuleDataUpdated:o=>{const u=S=>{const b=[];return S.forEach(I=>{const $=I.actorKind?.selectedOption,z=I.selectedRole?.selectedOption;let C=[];$==="role"&&z!=null?C=[{type:"attribute",subType:z,userId:void 0,idType:void 0,isImplicitActor:!1}]:$==="specific_person"&&(C=(I.persons?.selectedUsers??[]).map(Y=>({type:"user",userId:Y.userId,isImplicitActor:!1})));const L=I.action??"require_approval";b.push({action:L,actors:C,operator:C.length>1?L==="require_approval"?"or":"and":"is"})}),b},n=o.amountCriteria,f=o.vendorCriteria,m=o.departmentCriteria,l={};if(n!=null&&n.comparator.selectedOption!=null){const S=n.comparator.selectedOption;l.amount={type:"amount",comparator:S,min:S==="less_than"?void 0:n.min,max:S==="greater_than"?void 0:n.max}}const w=f?.selection.selectedOptions??[];w.length>0&&(l.vendor={type:"vendor",operator:f?.operator.selectedOption??"is",vendorIds:w});const h=m?.selection.selectedOptions??[];if(h.length>0&&(l.department={type:"department",operator:m?.operator.selectedOption??"is",departmentIds:h}),r==="approval_create"){const S={name:o.name,description:o.description,separationOfDuties:o.separationOfDuties,isFallback:o.isFallback,criteria:l,steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingBills.includes("applyToExistingBills")};e(D(S))}else{const S={approvalRuleId:i,name:o.name,description:o.description,separationOfDuties:o.separationOfDuties,isFallback:o.isFallback,criteria:l,steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingBills.includes("applyToExistingBills")};e(D(S))}},onResetClick:()=>{e(E()),r==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),r==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(M(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:o=>{e(R(o)),t(r==="approval_update"?`../../${o}/edit`:`../${o}/edit`)}}})(pe);function W(){const e=y(t=>k(t)),{isApprovalRulesV3Enabled:p}=X(e?.tenantId);return p?c.jsx(Se,{}):c.jsx(fe,{})}function Se(){const e=B(),p=j(),t=P(),{approvalRuleId:s}=K(),a=V.getSignedInUser(),i=O(),r=y(n=>g(n)),d=y(n=>A(n)),[o,u]=v.useState(!1);if(v.useEffect(()=>{o||(u(!0),p(H(!0)))}),v.useEffect(()=>{d.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[d,s]),a==null)throw Error("Can't access address page without signing in...");return r.approverListFetchStatus.fetchState=="Not-Started"||r.approverListFetchStatus.fetchState==="In-Progress"?c.jsx(T,{fetchState:r.approverListFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):c.jsx(ye,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:d,location:t},s??"new")}function Ee(){return c.jsxs(ee,{children:[c.jsx(x,{path:"/",element:c.jsx(ue,{})}),c.jsx(x,{path:"/new",element:c.jsx(W,{})}),c.jsx(x,{path:"/:approvalRuleId/edit",element:c.jsx(W,{})}),c.jsx(x,{path:"*",element:c.jsx(re,{})})]})}export{Ee as B};
|
|
1
|
+
import{j as c}from"./liveblocks-DvKPzrwo.js";import{a as v}from"./sentry-Be8twC83.js";import{h as B,g as P,u as j,j as y,N as q,n as U,i as K,o as ee,p as x}from"./core-CQnSJ9vO.js";import{eW as k,PC as A,Pi as g,zf as E,z3 as J,zb as R,yZ as Z,Pk as G,z0 as te,z4 as H,zh as M,zg as D}from"./zeni-epic-state-DKeO4Z0C.js";import{m as O,z as V,B as T,a7 as Q,bI as ae,af as _,bz as X,bJ as oe,bK as le,bL as pe}from"./index-W83PhAZh.js";import"./mui-sKCdI-e6.js";import{i as se}from"./ReimbursementApprovalRuleDetailScreen-BgYFphfr.js";import re from"./NotFoundScreen-FcrdBNP0.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},p=new e.Error().stack;p&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[p]="cca95110-3b3b-4fe8-85a0-3054d7c07256",e._sentryDebugIdIdentifier="sentry-dbid-cca95110-3b3b-4fe8-85a0-3054d7c07256")}catch{}})();const N="bill-approval-rule-update",ne=U(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:g(e).billPaySetupApproverViewUpdateData}},function(e,p){const{navigate:t,location:s}=p;return{onApprovalRulesEventReceived:a=>{a.endsWith(N)&&e(G(!1))},onBackClick:()=>{_(s)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(Z(a,!1))},onEditRuleClick:a=>{a!=null?(e(R(a)),t(`./${a}/edit`)):(e(R()),t("./new"))}}})(Q(ae)),ie=()=>{const e=B(),p=P(),t=j(),[s,a]=v.useState(!1),[i,r]=v.useState(!1),d=O(),o=y(l=>l.billPaySetupApproverViewState.fetchState),u=y(l=>k(l)),n=y(l=>A(l)),f=y(l=>g(l).billPaySetupApproverViewUpdateData);if(v.useEffect(()=>{f?.updateStatus.fetchState==="Completed"&&t(E())},[f]),v.useEffect(()=>{s||o!=="Not-Started"||(a(!0),t(J(!0,!0,!1)))},[s,o,t]),V.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");v.useEffect(()=>{n.allApprovalRules.length===0&&n.fetchState==="Completed"&&(i||(r(!0),t(R())),e("./new"))},[i,n,t]);const m={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${N}`]:[],eventCallback:(l,w,h)=>{l.endsWith(N)&&h.onApprovalRulesEventReceived(l)}};return u.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?c.jsx(q,{to:"../../promo"}):u.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||n.fetchState!=="Completed"&&n.fetchState!=="Error"?c.jsx(T,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):c.jsx(ne,{currentTenant:u,location:p,navigate:e,...m})},F="bill-approval-rule-update",ce=U(function(e){const p=A(e),t=g(e).billPaySetupApproverViewUpdateData,s={};for(const i of Object.values(e.contactState.contactById))i?.id!=null&&(s[i.id]=i.fullName);const a={};for(const i of Object.values(e.classState.classesByKey))i?.classId!=null&&(a[i.classId]=i.className);return{approvalView:p,billPaySetupApproverViewUpdateData:t,vendorNamesById:s,departmentNamesById:a}},function(e,p){const{navigate:t,location:s}=p;return{onApprovalRulesEventReceived:a=>{a.endsWith(F)&&e(G(!1))},onBackClick:()=>{_(s)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(Z(a,!0))},onEditRuleClick:a=>{a!=null?(e(R(a)),t(`./${a}/edit`)):(e(R()),t("./new"))},onReorderRules:a=>{e(te(a,!0))}}})(Q(oe)),ue=()=>{const e=y(t=>k(t)),{isApprovalRulesV3Enabled:p}=X(e?.tenantId);return p?c.jsx(de,{}):c.jsx(ie,{})},de=()=>{const e=B(),p=P(),t=j(),[s,a]=v.useState(!1),[i,r]=v.useState(!1),d=O(),o=y(l=>l.billPaySetupApproverViewState.fetchState),u=y(l=>k(l)),n=y(l=>A(l)),f=y(l=>g(l).billPaySetupApproverViewUpdateData);if(v.useEffect(()=>{f?.updateStatus.fetchState==="Completed"&&t(E())},[f]),v.useEffect(()=>{s||o!=="Not-Started"||(a(!0),t(J(!0,!0,!0)))},[s,o,t]),V.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");v.useEffect(()=>{n.allApprovalRules.length===0&&n.fetchState==="Completed"&&(i||(r(!0),t(R())),e("./new"))},[i,n,t]);const m={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${F}`]:[],eventCallback:(l,w,h)=>{l.endsWith(F)&&h.onApprovalRulesEventReceived(l)}};return u.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?c.jsx(q,{to:"../../promo"}):u.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||n.fetchState!=="Completed"&&n.fetchState!=="Error"?c.jsx(T,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):c.jsx(ce,{currentTenant:u,location:p,navigate:e,...m})},ve=U(function(e,p){const t=g(e),s=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=s==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return p.approvalRuleId&&(i=t.allApprovalRules.findIndex(r=>r.approvalRuleId===p.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:i,approvalUpdateActionType:s}},function(e,p){const{navigate:t,approvalUpdateDataView:s,approverViewData:a,approvalRuleId:i}=p,r=s.billPaySetupApproverViewUpdateData?.type,d=_(p.location);return{onApprovalRuleDataUpdated:o=>{const u=f=>{const m=[];return f.forEach(l=>{const w=l.actors.selectedUsers.map(b=>({type:"user",userId:b.userId,isImplicitActor:!1})),h=l.actors.selectedNonUsers.map(b=>{const I=!!se(b.value);return{type:I?"attribute":"role",subType:b.value,userId:void 0,idType:void 0,isImplicitActor:!I}}),S=w.concat(h);m.push({action:l.stepType.selectedOption,actors:S,operator:S.length>1?l.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),m},n={amount:{type:"amount",comparator:"range",min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const f={criteria:n,steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingBills.includes("applyToExistingBills")};e(D(f))}else{const f={approvalRuleId:i,criteria:n,steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingBills.includes("applyToExistingBills")};e(D(f))}},onResetClick:()=>{e(E()),r==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),r==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(M(!1))},onSaveRuleSuccess:()=>{t("../")}}})(le);function fe(){const e=B(),p=j(),t=P(),{approvalRuleId:s}=K(),a=V.getSignedInUser(),i=O(),r=y(n=>g(n)),d=y(n=>A(n)),[o,u]=v.useState(!1);if(v.useEffect(()=>{o||(u(!0),p(H(!0)))}),v.useEffect(()=>{d.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[d,s]),a==null)throw Error("Can't access address page without signing in...");return r.approverListFetchStatus.fetchState=="Not-Started"||r.approverListFetchStatus.fetchState==="In-Progress"?c.jsx(T,{fetchState:r.approverListFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):c.jsx(ve,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:d,location:t})}const ye=U(function(e,p){const t=g(e),s=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=[],i={};for(const r of Object.values(e.contactState.contactById))r?.id!=null&&(a.push(r.id),i[r.id]=r.fullName);return{localData:t,approvalUpdateActionType:s,allVendorIds:a,vendorNamesById:i,editingRuleId:s==="approval_update"?p.approvalRuleId:void 0,allApprovalRulesWithUser:A(e).allApprovalRules}},function(e,p){const{navigate:t,approvalUpdateDataView:s,approverViewData:a,approvalRuleId:i}=p,r=s.billPaySetupApproverViewUpdateData?.type,d=_(p.location);return{onApprovalRuleDataUpdated:o=>{const u=S=>{const b=[];return S.forEach(I=>{const $=I.actorKind?.selectedOption,z=I.selectedRole?.selectedOption;let C=[];$==="role"&&z!=null?C=[{type:"attribute",subType:z,userId:void 0,idType:void 0,isImplicitActor:!1}]:$==="specific_person"&&(C=(I.persons?.selectedUsers??[]).map(Y=>({type:"user",userId:Y.userId,isImplicitActor:!1})));const L=I.action??"require_approval";b.push({action:L,actors:C,operator:C.length>1?L==="require_approval"?"or":"and":"is"})}),b},n=o.amountCriteria,f=o.vendorCriteria,m=o.departmentCriteria,l={};if(n!=null&&n.comparator.selectedOption!=null){const S=n.comparator.selectedOption;l.amount={type:"amount",comparator:S,min:S==="less_than"?void 0:n.min,max:S==="greater_than"?void 0:n.max}}const w=f?.selection.selectedOptions??[];w.length>0&&(l.vendor={type:"vendor",operator:f?.operator.selectedOption??"is",vendorIds:w});const h=m?.selection.selectedOptions??[];if(h.length>0&&(l.department={type:"department",operator:m?.operator.selectedOption??"is",departmentIds:h}),r==="approval_create"){const S={name:o.name,description:o.description,separationOfDuties:o.separationOfDuties,isFallback:o.isFallback,criteria:l,steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingBills.includes("applyToExistingBills")};e(D(S))}else{const S={approvalRuleId:i,name:o.name,description:o.description,separationOfDuties:o.separationOfDuties,isFallback:o.isFallback,criteria:l,steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingBills.includes("applyToExistingBills")};e(D(S))}},onResetClick:()=>{e(E()),r==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),r==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(M(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:o=>{e(R(o)),t(r==="approval_update"?`../../${o}/edit`:`../${o}/edit`)}}})(pe);function W(){const e=y(t=>k(t)),{isApprovalRulesV3Enabled:p}=X(e?.tenantId);return p?c.jsx(Se,{}):c.jsx(fe,{})}function Se(){const e=B(),p=j(),t=P(),{approvalRuleId:s}=K(),a=V.getSignedInUser(),i=O(),r=y(n=>g(n)),d=y(n=>A(n)),[o,u]=v.useState(!1);if(v.useEffect(()=>{o||(u(!0),p(H(!0)))}),v.useEffect(()=>{d.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[d,s]),a==null)throw Error("Can't access address page without signing in...");return r.approverListFetchStatus.fetchState=="Not-Started"||r.approverListFetchStatus.fetchState==="In-Progress"?c.jsx(T,{fetchState:r.approverListFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):c.jsx(ye,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:d,location:t},s??"new")}function Ee(){return c.jsxs(ee,{children:[c.jsx(x,{path:"/",element:c.jsx(ue,{})}),c.jsx(x,{path:"/new",element:c.jsx(W,{})}),c.jsx(x,{path:"/:approvalRuleId/edit",element:c.jsx(W,{})}),c.jsx(x,{path:"*",element:c.jsx(re,{})})]})}export{Ee as B};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-C-n95g0A.js";import{h as K,u as se,g as Q,i as ae,j as v,N as te,n as Y,l as na,o as ia,p as S}from"./core-B5TeChD4.js";import{eW as Z,OU as Ue,bt as It,JS as oa,bo as wt,bJ as pe,OV as At,yu as Bt,zJ as $e,z5 as la,bn as De,OW as sa,OX as ra,c7 as ca,OY as da,ks as Ct,OZ as xt,O_ as Et,Ai as Ge,yJ as Ce,O$ as ua,yi as tt,P0 as pa,Ee as ma,ym as ba,ys as Dt,P1 as ke,P2 as Me,zK as Oe,P3 as ha,P4 as ga,zN as Ne,P5 as ya,z_ as Sa,P6 as Pt,zu as at,zz as fa,P7 as ka,P8 as ue,P9 as jt,Pa as Tt,Pb as Ft,go as va,yO as Le,cB as Rt,Pc as Ia,f9 as wa,Pd as Aa,Pe as Ba,fe as Vt,fc as $t,Pf as ze,Pg as Ca,Ph as xa,ME as Ze,Pi as Ea,MF as oe,MG as He,Pj as Da,Pk as Pa,Pl as ja,zB as nt,zy as Ta,Pm as Fa,Pn as Ra,Po as Va,zk as $a,Pp as La,Pq as _a,Pr as Ua,cp as Lt,cR as _t,kD as Ga,bP as Ma,bq as Ut,bQ as Gt,xA as Oa,Ps as Na,E1 as za,E7 as Za,t_ as Ha,zL as Wa,Ap as qa,kQ as fe,Pt as Ja,Pu as Mt,li as Ka,kK as Ot,l3 as Nt,l2 as it,bE as be,bO as Qa,Pv as Ya,Pw as ve,jn as Xa,Px as ot,Py as en,jr as tn,jM as an,AD as nn,Pz as on,lb as ln,At as sn,PA as lt,Ax as rn,AC as cn,Az as dn,Ar as un,PB as zt,yD as pn,PC as mn,PD as bn,gg as hn,gf as gn,ge as yn,kT as Sn,l9 as st,lk as fn,ry as kn,l0 as vn,Av as In,jx as wn,lp as An,PE as Bn,jp as Cn,rp as xn,PF as En,zq as Dn,bK as Pn,bs as jn,LA as Tn,cT as Fn,cS as Rn,cA as Vn,cH as $n}from"./zeni-epic-state-BzDw8pi_.js";import{m as me,z as V,j as Ie,_ as We,N as le,f as y,aN as xe,B as re,d as x,w as Pe,c as D,be as Ln,p as z,a2 as qe,r as E,K as we,bf as rt,bg as ct,bh as _n,ak as Un,C as Gn,aH as Mn,y as Zt,D as Je,E as Ke,bi as On,at as Ht,bj as Nn,Y as zn,g as Wt,a7 as Zn,bk as Hn,bl as Wn,bm as qn,bn as Jn,bo as Kn,bp as Qn,bq as Yn,br as Xn,bs as ei,H as ti,bt as ai,b9 as ni,bu as ii,bv as oi,a9 as li}from"./index-DLvmOqpd.js";import{n as _,S as si}from"./mui-Da8iY16Z.js";import{A as dt}from"./AddressScreen-CROQK-4n.js";import{g as ie,a as je,i as qt,V as Qe,b as Ye,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-Du8m5leq.js";import{a as f}from"./sentry-lku8kjDH.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-CKXnZIoK.js";import{u as Jt}from"./useInitialThreadRequest-CzZzqfSl.js";import Ee from"./NotFoundScreen-C6d7g4SD.js";import{D as ui}from"./DrawerScreen-m2dilTdj.js";import{M as Kt}from"./MobileAppDrawer-Di4Asbvj.js";import{F as Qt}from"./FeaturePreviewScreen-BN_uvK-S.js";import{S as Te}from"./SetupPagesScreen-BHoPLick.js";import{B as pi}from"./BillPayApprovalRoutes-DI3GeN36.js";import{FallBackRoute as mi}from"./ScreenRoutes-DdzWD1U9.js";import"./recharts--v-RQjOV.js";import"./analytics-CkXhIYGA.js";import"./plaid-kqYG7b9d.js";import"./dnd-CWnSyq9-.js";import"./stripe-DMRn4zHo.js";import"./lottie-zNHYqEBz.js";import"./lexical-D7c0ykAW.js";import"./pdf-BM7gJkYi.js";import"./utils-Dw1Jg_v9.js";import"./analyticsHelper-BTLx1JWo.js";import"./routePaths-2w3X-cgQ.js";import"./BusinessVerificationPageScreen-B6nnpXHm.js";import"./ReimbursementApprovalRuleDetailScreen-T0juC1PH.js";import"./getLocaleForTenant-yKPZZnim.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]="25dc4e6a-0d78-4089-9781-c50991ebd355",e._sentryDebugIdIdentifier="sentry-dbid-25dc4e6a-0d78-4089-9781-c50991ebd355")}catch{}})();const bi=Y(function(e,t){const l=Ue(e,t.billId),n=V.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=De(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=sa(l.billActivities,ra(t.currentTenant),n);d=g,p=b}const m=ca(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&da(l.transactionDetails,m,n);return{billDetails:l,isAccountingClassesEnabled:Ct(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ce(l,"retry")):e(Ce(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=je(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ce(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Et({data:i,billId:l})),e(Ge(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(xt({billId:l}))}}})(Ln);function hi(){const e=K(),t=se(),l=Q(),{billId:n}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=v(O=>Z(O)),s=v(O=>Ue(O,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Jt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Xe({mobileExploreReferrer:"Bill Details"});We({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&It(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,k]=f.useState(!1),[P,A]=f.useState(!1),[B,G]=f.useState(!1),{useFeatureGate:j,useDynamicConfig:U}=le(),{isFeatureEnabled:$}=j(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=j(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=j(y.isBillPayDetectInsufficientFundsEnabled),{configValue:M}=U(xe.zeniAssistConfig),C=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),L=M.user_ids!=null&&r?.userId!=null&&M.user_ids.includes(r?.userId),{isFeatureEnabled:J}=j(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=j(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&C===!1?G(!1):G(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(O=>O.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,C,r]),f.useEffect(()=>{n!=null&&t(At(n))},[n]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Bt(n??"",$,L,!1)))},[b,s,n,t]),f.useEffect(()=>{P||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(A(!0),t($e(!1,$,L,X,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[P,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(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${x.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Pe,{analytics:D,onLoad:O=>(ee=>{n!=null&&ee.trackBillPayBillDetails(n,s.isRecurring)})(O)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:B,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:J,hasZeniAssistAccess:L,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=Je.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=Y(function(e,t){const l=V.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:x.sp10,paddingRight:x.sp3,paddingBottom:"15px",paddingLeft:x.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=V.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ne(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(Sa({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{D?.trackBillPaySkipAutofill(),e(Oe(n))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Mn);function w({appContent:e}){const t=se(),l=K(),{billId:n}=ae(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=V.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:k}=p(xe.zeniAssistConfig),P=k.user_ids!=null&&i?.userId!=null&&k.user_ids.includes(i?.userId),A=v(F=>Z(F)),[B,G]=f.useState(!1),[j,U]=f.useState(!1),[$,I]=f.useState(!1),[H,M]=f.useState(),C=v(F=>Me(F,m,g,n));let q=C.fetchState,W=C.file,L=C.showAutofill;const J=v(F=>Ue(F,n??""));u===!1&&(q=J.fetchState,W=J.transactionDetails?.attachments?.[0],L=!1);const X=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;f.useEffect(()=>{n==null&&t(Oe(!0))},[n,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&j?U(!1):!u&&B&&G(!1))},[n]),f.useEffect(()=>{B||n==null||u||(G(!0),t(Bt(n,h,P,!1)),j||(U(!0),t($e(!1,h,P,b,n)))),u&&!j&&(U(!0),t($e(!1,h,P,b,n)))},[B,j,u,n,t]);const O={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(X??"",F,i?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:n})),t(Ne(H,m,n))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(X??"",F,i?.userEmail??"","no"),t(ha({file:H,billId:n}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(A.tenantEmailDomain);t(ke({billId:n})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,A.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(q==="Error"||J.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return n==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Re,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:M,showActionButtons:!1,isInitialEdit:!!C.isInitialEdit,billStage:X}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||L?null:a.jsx(pt,{children:a.jsx(Yt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(_n,{}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:n==null})})]});{const F=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[L&&o!=="small"?a.jsx(mt,{}):null,$?a.jsx(Un,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Ai,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:O,isEditPopup:!0}):null,o==="small"||L?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:L,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,J,C),setShowConfirmationPopup:I,setPayload:M,showActionButtons:fi(u,C),isInitialEdit:!!C.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=On();return a.jsx(Yt,{onClick:e,"data-testid":"nav-bar-back-click"})}function Si(e,t,l){let 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(ki,{children:[a.jsx(vi,{children:`${ye.recurringBill.recurringCycle}
|
|
1
|
+
import{j as a}from"./liveblocks-DvKPzrwo.js";import{h as K,u as se,g as Q,i as ae,j as v,N as te,n as Y,l as na,o as ia,p as S}from"./core-CQnSJ9vO.js";import{eW as Z,OU as Ue,bt as It,JS as oa,bo as wt,bJ as pe,OV as At,yu as Bt,zJ as $e,z5 as la,bn as De,OW as sa,OX as ra,c7 as ca,OY as da,ks as Ct,OZ as xt,O_ as Et,Ai as Ge,yJ as Ce,O$ as ua,yi as tt,P0 as pa,Ee as ma,ym as ba,ys as Dt,P1 as ke,P2 as Me,zK as Oe,P3 as ha,P4 as ga,zN as Ne,P5 as ya,z_ as Sa,P6 as Pt,zu as at,zz as fa,P7 as ka,P8 as ue,P9 as jt,Pa as Tt,Pb as Ft,go as va,yO as Le,cB as Rt,Pc as Ia,f9 as wa,Pd as Aa,Pe as Ba,fe as Vt,fc as $t,Pf as ze,Pg as Ca,Ph as xa,ME as Ze,Pi as Ea,MF as oe,MG as He,Pj as Da,Pk as Pa,Pl as ja,zB as nt,zy as Ta,Pm as Fa,Pn as Ra,Po as Va,zk as $a,Pp as La,Pq as _a,Pr as Ua,cp as Lt,cR as _t,kD as Ga,bP as Ma,bq as Ut,bQ as Gt,xA as Oa,Ps as Na,E1 as za,E7 as Za,t_ as Ha,zL as Wa,Ap as qa,kQ as fe,Pt as Ja,Pu as Mt,li as Ka,kK as Ot,l3 as Nt,l2 as it,bE as be,bO as Qa,Pv as Ya,Pw as ve,jn as Xa,Px as ot,Py as en,jr as tn,jM as an,AD as nn,Pz as on,lb as ln,At as sn,PA as lt,Ax as rn,AC as cn,Az as dn,Ar as un,PB as zt,yD as pn,PC as mn,PD as bn,gg as hn,gf as gn,ge as yn,kT as Sn,l9 as st,lk as fn,ry as kn,l0 as vn,Av as In,jx as wn,lp as An,PE as Bn,jp as Cn,rp as xn,PF as En,zq as Dn,bK as Pn,bs as jn,LA as Tn,cT as Fn,cS as Rn,cA as Vn,cH as $n}from"./zeni-epic-state-DKeO4Z0C.js";import{m as me,z as V,j as Ie,_ as We,H as le,x as y,aN as xe,B as re,o as x,w as Pe,c as D,be as Ln,q as z,a2 as qe,r as E,K as we,bf as rt,bg as ct,bh as _n,ak as Un,C as Gn,aH as Mn,A as Zt,D as Je,F as Ke,bi as On,at as Ht,bj as Nn,Y as zn,e as Wt,a7 as Zn,bk as Hn,bl as Wn,bm as qn,bn as Jn,bo as Kn,bp as Qn,bq as Yn,br as Xn,bs as ei,W as ti,bt as ai,b9 as ni,bu as ii,bv as oi,a9 as li}from"./index-W83PhAZh.js";import{n as _,S as si}from"./mui-sKCdI-e6.js";import{A as dt}from"./AddressScreen-DHENiPsE.js";import{g as ie,a as je,i as qt,V as Qe,b as Ye,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-Bx2DINVR.js";import{a as f}from"./sentry-Be8twC83.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-DAlpTVgV.js";import{u as Jt}from"./useInitialThreadRequest-BDAn-AM4.js";import Ee from"./NotFoundScreen-FcrdBNP0.js";import{D as ui}from"./DrawerScreen-BtLrlXnn.js";import{M as Kt}from"./MobileAppDrawer-CjoW3Rax.js";import{F as Qt}from"./FeaturePreviewScreen-9NvuDbvP.js";import{S as Te}from"./SetupPagesScreen-DtddTp_T.js";import{B as pi}from"./BillPayApprovalRoutes-re8xxMBE.js";import{FallBackRoute as mi}from"./ScreenRoutes-B24ySlpK.js";import"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";import"./utils-BcJ2NV01.js";import"./analyticsHelper-CvGdvadP.js";import"./routePaths-stnXzrYV.js";import"./BusinessVerificationPageScreen-7ydI8UR9.js";import"./ReimbursementApprovalRuleDetailScreen-BgYFphfr.js";import"./getLocaleForTenant-CAvD8CfA.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]="facbf018-442c-4c8d-aac2-daa593751651",e._sentryDebugIdIdentifier="sentry-dbid-facbf018-442c-4c8d-aac2-daa593751651")}catch{}})();const bi=Y(function(e,t){const l=Ue(e,t.billId),n=V.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=De(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=sa(l.billActivities,ra(t.currentTenant),n);d=g,p=b}const m=ca(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&da(l.transactionDetails,m,n);return{billDetails:l,isAccountingClassesEnabled:Ct(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ce(l,"retry")):e(Ce(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=je(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ce(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Et({data:i,billId:l})),e(Ge(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(xt({billId:l}))}}})(Ln);function hi(){const e=K(),t=se(),l=Q(),{billId:n}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=v(O=>Z(O)),s=v(O=>Ue(O,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Jt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Xe({mobileExploreReferrer:"Bill Details"});We({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&It(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,k]=f.useState(!1),[P,A]=f.useState(!1),[B,G]=f.useState(!1),{useFeatureGate:j,useDynamicConfig:U}=le(),{isFeatureEnabled:$}=j(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=j(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=j(y.isBillPayDetectInsufficientFundsEnabled),{configValue:M}=U(xe.zeniAssistConfig),C=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),L=M.user_ids!=null&&r?.userId!=null&&M.user_ids.includes(r?.userId),{isFeatureEnabled:J}=j(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=j(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&C===!1?G(!1):G(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(O=>O.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,C,r]),f.useEffect(()=>{n!=null&&t(At(n))},[n]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Bt(n??"",$,L,!1)))},[b,s,n,t]),f.useEffect(()=>{P||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(A(!0),t($e(!1,$,L,X,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[P,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(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${x.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Pe,{analytics:D,onLoad:O=>(ee=>{n!=null&&ee.trackBillPayBillDetails(n,s.isRecurring)})(O)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:B,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:J,hasZeniAssistAccess:L,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=Je.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=Y(function(e,t){const l=V.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:x.sp10,paddingRight:x.sp3,paddingBottom:"15px",paddingLeft:x.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=V.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ne(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(Sa({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{D?.trackBillPaySkipAutofill(),e(Oe(n))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Mn);function w({appContent:e}){const t=se(),l=K(),{billId:n}=ae(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=V.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:k}=p(xe.zeniAssistConfig),P=k.user_ids!=null&&i?.userId!=null&&k.user_ids.includes(i?.userId),A=v(F=>Z(F)),[B,G]=f.useState(!1),[j,U]=f.useState(!1),[$,I]=f.useState(!1),[H,M]=f.useState(),C=v(F=>Me(F,m,g,n));let q=C.fetchState,W=C.file,L=C.showAutofill;const J=v(F=>Ue(F,n??""));u===!1&&(q=J.fetchState,W=J.transactionDetails?.attachments?.[0],L=!1);const X=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;f.useEffect(()=>{n==null&&t(Oe(!0))},[n,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&j?U(!1):!u&&B&&G(!1))},[n]),f.useEffect(()=>{B||n==null||u||(G(!0),t(Bt(n,h,P,!1)),j||(U(!0),t($e(!1,h,P,b,n)))),u&&!j&&(U(!0),t($e(!1,h,P,b,n)))},[B,j,u,n,t]);const O={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(X??"",F,i?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:n})),t(Ne(H,m,n))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(X??"",F,i?.userEmail??"","no"),t(ha({file:H,billId:n}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(A.tenantEmailDomain);t(ke({billId:n})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,A.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(q==="Error"||J.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return n==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Re,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:M,showActionButtons:!1,isInitialEdit:!!C.isInitialEdit,billStage:X}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||L?null:a.jsx(pt,{children:a.jsx(Yt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(_n,{}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:n==null})})]});{const F=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[L&&o!=="small"?a.jsx(mt,{}):null,$?a.jsx(Un,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Ai,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:O,isEditPopup:!0}):null,o==="small"||L?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:L,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,J,C),setShowConfirmationPopup:I,setPayload:M,showActionButtons:fi(u,C),isInitialEdit:!!C.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=On();return a.jsx(Yt,{onClick:e,"data-testid":"nav-bar-back-click"})}function Si(e,t,l){let 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(ki,{children:[a.jsx(vi,{children:`${ye.recurringBill.recurringCycle}
|
|
2
2
|
${n}/${c}`}),a.jsx(Ii,{})]}):void 0}function fi(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 pt=_.div`
|
|
3
3
|
margin-bottom: 20px;
|
|
4
4
|
margin-top: 20px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as k}from"./liveblocks-
|
|
1
|
+
import{j as k}from"./liveblocks-DvKPzrwo.js";import{a as V}from"./sentry-Be8twC83.js";import{h as ae,g as ne,u as se,i as ie,j as C,N as oe,n as re}from"./core-CQnSJ9vO.js";import{j as ce,H as ue,aN as de,z,w as pe,c as E,af as P,e as x,bE as le,at as me,r as B,au as R}from"./index-W83PhAZh.js";import{Pq as fe,eW as G,tp as ye,JV as Se,zk as ge,CL as Ie,Fn as he,G0 as be,H0 as Oe,PN as Te,PO as De,PP as ke,PQ as Ce,PR as Ve,Mm as we,OP as Ne,Mx as Ae,l8 as _e,gg as Fe,gf as ve,ge as Pe,ry as xe,rp as ze,rm as Ee,l0 as Be,ty as Re,tw as M,bE as L,tK as j,cz as Me}from"./zeni-epic-state-DKeO4Z0C.js";import{n as Le}from"./mui-sKCdI-e6.js";import{d as U}from"./routePaths-stnXzrYV.js";import{M as je}from"./MobileAppDrawer-CjoW3Rax.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]="14578d3e-1a1b-4463-a86b-a02d442f767a",e._sentryDebugIdIdentifier="sentry-dbid-14578d3e-1a1b-4463-a86b-a02d442f767a")}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-C-n95g0A.js";import{a as V}from"./sentry-lku8kjD
|
|
|
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=z.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=Ne(e.companyConfigState),s=Ae(e.userRoleConfigState);return{businessVerificationDetails:i,verficationDetailsFetchState:i.fetchState,isRefreshingViewInBackground:i.isRefreshingViewInBackground,allNationalityCountries:i.allNationalityCountries,filesEndPoint:`${me.fileMicroServiceBaseUrl}`,authParams:l,isDisabled: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:T,companyLegalName:D,companyTaxId:g,companyWebsite:m,companyPhone:I,primaryContactEmail:c,primaryContactName:n,primaryContactUserId:u,primaryContactSyncToken:O,syncToken:f,fileIds:a,incDate:o,typeOfIncorporation:w,stateOfIncorporation:N,sourceOfFunds:A,companySubIndustry:_,countriesOfOperations:h,companySourceOfFunds:q,companySourceOfFundsDescription:
|
|
9
|
+
`,Ge=re(function(e,d){const{businessVerificationDetails:i}=d,r=G(e),y=z.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=Ne(e.companyConfigState),s=Ae(e.userRoleConfigState);return{businessVerificationDetails:i,verficationDetailsFetchState:i.fetchState,isRefreshingViewInBackground:i.isRefreshingViewInBackground,allNationalityCountries:i.allNationalityCountries,filesEndPoint:`${me.fileMicroServiceBaseUrl}`,authParams:l,isDisabled: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:T,companyLegalName:D,companyTaxId:g,companyWebsite:m,companyPhone:I,primaryContactEmail:c,primaryContactName:n,primaryContactUserId:u,primaryContactSyncToken:O,syncToken:f,fileIds:a,incDate:o,typeOfIncorporation:w,stateOfIncorporation:N,sourceOfFunds:A,companySubIndustry:_,countriesOfOperations:h,companySourceOfFunds:q,companySourceOfFundsDescription:H,transactionVolume:W,transactionVolumeDescription:Z,purposeOfAccount:$,purposeOfAccountDescription:J,regulatedStatus:K,regulatedStatusDescription:Q,usNexus:X,usNexusTypes:Y}=t,F=T?.selectedOption,ee={companyId:i,companyDescription:s,companyIndustry:p.selectedOption,companyIndustryType:F==null||F===""?void 0:F,companyLegalName:D,taxIdOrEIN:g,website:m!=""&&m!=null?Me(m):void 0,phone:I,syncToken:f,fileIds:a,incDate:o!=null?L(o?.toString()):o,typeOfIncorporation:w?.selectedOption??"",stateOfIncorporation:N?.selectedOption??"",sourceOfFunds:A?.selectedOption??"",companySubIndustry:_?.selectedOption??"",countriesOfOperations:h?.selectedOptions.map(v=>v.length===2?v:R(v))??[],companySourceOfFunds:q?.selectedOption??"",companySourceOfFundsDescription:H,transactionVolume:W?.selectedOption??"",transactionVolumeDescription:Z,purposeOfAccount:$?.selectedOption??"",purposeOfAccountDescription:J,regulatedStatus:K??"",regulatedStatusDescription:Q,usNexus:X,usNexusTypes:Y?.selectedOptions??[]},te={userId:u,firstName:n.firstName,lastName:n.lastName,email:c,syncToken:O};e(j({companyDetails:ee,primaryContactDetails:te}))},onCompanyOfficerUpdated:t=>{const s=t.map(p=>{const{officerType:T,userId:D,name:g,email:m,nationalityCountryCode:I,ssn:c,dob:n,phone:u,syncToken:O,selectDocument:f,role:a,ownership:o,isSelectedForVerification:w,userVerificationStatus:N,treasuryUserVerificationStatus:A,fileIds:_}=p;let h;return f.selectDocumentType==="driverLicense"?h="driving_license":f.selectDocumentType==="passport"?h="passport":f.selectDocumentType==="stateId"?h="id_document":f.selectDocumentType==="ssnCard"&&(h="social_security_card"),{officerType:T,userId:D,firstName:g.firstName,lastName:g.lastName,email:m,ssn:c,nationalityCountryCode:I?.selectedOption!=null?R(I.selectedOption):void 0,phone:u,birthday:n!=null?L(n?.toString()):n,syncToken:O,titleAtCompany:a.selectedOption,ownershipInCompany:o,documentTypeSelectedForVerification:h,isSelectedForVerification:w,userVerificationStatus:N,treasuryUserVerificationStatus:A,fileIds:_,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(j({officers:s}))},onSaveDetailsClick:t=>{e(M(i,t,r))},onSendForVerificationClick:t=>{e(M(i,t,r,!0))},onAddressClick:t=>{const s=U(b,t),p=B(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onRegisteredAddressClick:t=>{const s=U(b,t),p=B(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onBackClick:()=>{e(Re({companyId:i})),S("../setup")},updateFilesEntity:t=>{e(Be({files:t}))},onDeleteFile:t=>{e(Ee(t))},onDeleteFileList:t=>{e(ze(t))},onEditFileName:(t,s)=>{e(xe(t,s.split(".")[0]))},onGetOtp:t=>{e(Pe(t,"SpendManagementSetup"))},onResendOtp:t=>{e(ve(t,"SpendManagementSetup"))},onVerifyOtp:(t,s)=>{e(Fe(t,s,"SpendManagementSetup"))},saveNewAddressInLocalStore:(t,s)=>{e(_e({addressType:t,addressToCreate:s}))}}})(le),Xe=({productType:e})=>{const d=ae(),i=ne(),r=se(),[y,S]=V.useState(!1),[l,b]=V.useState(!1),{tenantEmailDomain:t}=ie(),s=ce(),{useDynamicConfig:p}=ue(),{configValue:T}=p(de.zeniAccountsConfig),D=fe(T),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??z.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(Oe(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]),z.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 O=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=De(a,n);break;default:o=Te(a,n)}return o});return u===!1?k.jsx(oe,{to:"../promo"}):k.jsxs(Ue,{children:[k.jsx(pe,{analytics:E,onLoad:a=>(o=>{switch(e){case"zeni_accounts":return o.trackPageLoaded(x.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return o.trackPageLoaded(x.Event.reimbursementBusinessVerification);default:return o.trackPageLoaded(x.Event.billPayBusinessVerification,P(i)?"Settings":void 0)}})(a)}),P(i)?k.jsx(je,{isAppContentDrawerOpen:l,handleDrawerToggle:O}):null,k.jsx(Ge,{businessVerificationDetails:f,navigate:d,location:i,companyId:n,analytics:E,currentTenant:c,productType:e,isSettings:P(i),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{O(!0)},maxInsuredAmount:D.maxInsuredAmount})]})};export{Xe as B};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as b}from"./liveblocks-
|
|
1
|
+
import{j as b}from"./liveblocks-DvKPzrwo.js";import{a as i}from"./sentry-Be8twC83.js";import{n as W}from"./utils-BcJ2NV01.js";import{u as Ie,h as we,g as Ee,j as T,i as ke,n as ve}from"./core-CQnSJ9vO.js";import{X as Ae,H as Te,x as z,z as Fe,d9 as Oe,db as Ue,b5 as ee,w as _e,c as V,dc as G,dj as xe,D as Qe,e as De,a7 as Le,df as $e,a2 as Ve,dk as je,b1 as Re,di as He}from"./index-W83PhAZh.js";import{gk as Me,g5 as Ne,g6 as X,g7 as qe,fQ as te,g8 as Be,g9 as We,eV as se,eW as ze,ga as Ge,f0 as Xe,iF as Ye,iB as Je,eX as Y,fJ as Ke,fK as Ze,fL as et,fM as tt,fN as st,fO as at,fP as ot,fR as nt,fS as it,fT as J,bE as K,fU as rt,fV as lt,fW as dt,fX as ct,fY as ut,fZ as mt,fC as ft,fG as Z,f_ as pt,f$ as Ct,g0 as ht,g1 as St,g2 as gt,g3 as bt,g4 as Pt}from"./zeni-epic-state-DKeO4Z0C.js";import{D as yt,n as R,P as It,S as wt}from"./mui-sKCdI-e6.js";import{d as Et}from"./recharts-Cv5d-Vxs.js";import"./analytics-DoyQ8ezf.js";import"./plaid-BOu_8LCE.js";import"./dnd-DoHm848q.js";import"./stripe-DMRn4zHo.js";import"./lottie-DNsrs-P3.js";import"./lexical-WXHH1XHj.js";import"./pdf-iXI4qQyj.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="ecc3bac9-f169-4f2d-8bf4-789308bb1165",e._sentryDebugIdIdentifier="sentry-dbid-ecc3bac9-f169-4f2d-8bf4-789308bb1165")}catch{}})();const kt=e=>Pt(e,!1),vt=e=>bt(e.name,!1),ae="chat-response-generated",oe="cards/ask",ne="card_policy_hero";function j(e){return`/${e}/cards`}function ie(e){return`/${e}/cards/policy`}const At=ve(function(e,r){const s=se(e),C=r.isSubmitting,c=e.cardPolicyState,m=Ke(c),d=Ze(c),h=et(c);return{showSampleQuestions:r.sessionFromUrl==="new_chat"&&s.uiState.currentChatSessionId==null,aiCfoView:s,isSubmitting:C,isNewChatSession:r.sessionFromUrl==="new_chat",isFullView:!0,tableDownloadEndPoint:`${Ve}/tableDownload`,emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,isFileUploadEnabled:r.isFileUploadEnabled,isUploadPromoVisible:r.isUploadPromoVisible,onUploadPromoClose:r.onUploadPromoClose,allUsers:r.allUsers,cardPolicyCategorySearchOptions:m.map(kt),cardPolicyVendorSearchOptions:d.map(vt),cardPolicyIsVendorSearchLoading:h==="In-Progress",cardPolicyDocumentUploadState:ot(c),cardPolicyUploadedFileName:at(c),cardPolicyFormDraft:st(e.createCardPolicyState),cardsCreationFormDraft:tt(e)}},function(e,r){const{location:s,currentTenant:C,userId:c,navigate:m,currentChatSessionId:d,allSessionsWithOrderedQuestionAnswers:h,isAiCardCreationEnabled:E,isCardPolicyEnabled:P,cardPolicyPageContext:k}=r,f=C.tenantEmailDomain,O=s.state?.referrer,u=O===ne?ie(f):j(f);return{onEventReceived:(a,l)=>{if(a===ae&&typeof l.text=="string"&&typeof l.metadata=="object"){const t=l,n=Ct(t.type),p=t.metadata.chat_session_id??null,{currentChatSession:U,currentQuestionAnswer:v,currentQuestionAnswerSummary:y}=ee(h,p);n!=="answer"?V.trackAICFOChatResponseGenerated(n,v?.question.questionText??"",t.text,p,He(y,U),t.metadata.message_id??null):V.trackAICFOChatAnswerGenerated(t.text,v?.question.questionText??"",(t.follow_up_questions?.length??0)>0,!!t.assumptions,!!t.insights,t.visualization!=null,ht(t.visualization?.type??"")??null,p,t.summarized_title,t.metadata.message_id??null),e(St({chatSessionId:t.metadata.chat_session_id,responseType:n,fetchState:{fetchState:"Completed",error:void 0}})),e(gt({chatSessionId:t.metadata.chat_session_id,answerPayload:t,userId:c}))}},onSubmit:(a,l,t,n)=>{a&&Re(e,a,l,d,h,c,n,t,k)},updateCurrentInput:a=>{e(Z(a))},onStopSubmit:()=>{},onUpdateScrollYOffset:a=>{e(pt(a))},onSelectSampleQuestion:()=>{},onBackClick:()=>{m(-1)},onCloseClick:()=>{m(u,{state:{...s.state}}),e(Z(""))},togglePageView:()=>{m(u,{state:{...s.state}}),r.setIsAiCfoOpen(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{m(-1)},onNewChatClick:()=>{d!=null&&e(ft()),m(function(a){return`/${a}/${oe}`}(f),{state:{...s.state}})},onToggleCotCollapsed:(a,l)=>{e(mt({questionAnswerId:a,isCollapsed:l}))},onCardsCreationFormChange:E?a=>{e(ut(a))}:void 0,onCardsCreationFormSubmit:E?(a,l)=>{const t=lt(a);t.length!==0&&(e(dt(t)),e(ct({sourceChatSessionId:d??void 0})),d!=null&&e(J({chatSessionId:d,id:W(),kind:"creating_cards",createdAt:K(""),sourceQuestionAnswerId:l})),r.setIsAiCfoOpen(!0),m(j(f),{state:{...s.state}}))}:void 0,onCardPolicyFormChange:P?a=>{e(rt(a))}:void 0,onCardPolicyFormSubmit:P?(a,l)=>{const t=je({values:a});e(it({templates:[t],sourceChatSessionId:d})),d!=null&&e(J({chatSessionId:d,id:W(),kind:"creating_policy",createdAt:K(""),sourceQuestionAnswerId:l})),r.setIsAiCfoOpen(!0),m(`/${f}/cards/policy`,{state:{...s.state}})}:void 0,onCardPolicyUploadDocument:P?(a,l,t)=>{a.length!==0&&e(nt(a,l,t))}:void 0,onCardPolicyRemoveDocument:P?()=>{e(te())}:void 0}})(Le($e)),{spendManagement:{chargeCard:{cardsAiCfoHero:re,cardPolicyAiCfoHero:le}}}=Qe.getLocalizedStrings(),F=re.pageTitle,Tt=le.pageTitle,Ft=re.chatHeaderSubtitle,Ot=le.chatHeaderSubtitle,Xt=({isFileUploadEnabled:e})=>{const{setIsAiCfoOpen:r}=Ae(),s=Ie(),C=we(),c=Ee(),[m,d]=i.useState(!1),{useFeatureGate:h}=Te(),{isFeatureEnabled:E}=h(z.isAiCardCreationEnabled),{isFeatureEnabled:P}=h(z.isCardPolicyEnabled);i.useEffect(()=>{s(Me())},[s]),i.useEffect(()=>(s(Ne()),s(X()),s(qe("cardHolderCandidate",!1)),()=>{s(te())}),[s]);const k=T(o=>Be(o).fetchState);i.useEffect(()=>{k==="Not-Started"&&s(We(!1,!1,!1))},[k,s]);const f=i.useMemo(()=>Et(o=>{s(X(o))},250),[s]);i.useEffect(()=>()=>{f.cancel()},[f]);const O=i.useCallback(o=>{f(o)},[f]),u=T(o=>se(o)),a=Fe.getSignedInUser(),{session_id:l}=ke(),t=T(o=>ze(o)),n=u.uiState.currentChatSessionId,p=t.tenantEmailDomain,{handleUploadPromoClose:U,isUploadPromoVisible:v}=Oe({isFileUploadEnabled:e,tenantEmailDomain:p}),y=c.state,S=y?.aiCfoInitialQuestion??null,_=!!y?.aiCfoShouldSubmit,I=y?.referrer===ne,de=I?"card_policy":void 0,ce=i.useMemo(()=>({title:I?Tt:F,subtitle:I?Ot:Ft}),[I]),[ue,x]=i.useState(null),[me,Q]=i.useState(!1),D=i.useRef(!1);i.useEffect(()=>{D.current||S==null||S===""||(x(S),Q(_),D.current=!0)},[S,_]);const fe=i.useCallback(()=>{x(null),Q(!1)},[]),pe=t.masterTOSInfo,g=pe?.isMasterTOSAccepted??!1,A=i.useRef(null);i.useEffect(()=>{if(g&&A.current!=null){const{question:o,shouldSubmit:w}=A.current;A.current=null,x(o),Q(w),D.current=!1}},[g]);const{visitedSessions:H}=Ue(n),L=u.fetchState,$=u.uiState.chatSessionsNextPageToken.hasMore||!u.uiState.chatSessionsFirstPageFetched,M=n!=null?u.fetchChatSessionHistoryByChatSessionId?.[n]?.fetchState??"Not-Started":"Not-Started",N=n==null||(u.uiState.chatHistoryNextPageToken[n]?.hasMore??!0),q=u.allSessionsWithOrderedQuestionAnswers,B=T(o=>Ge(o.userState,o.userRoleState,o.userListViewState,"cardHolderCandidate")).users,Ce=i.useMemo(()=>B.map(o=>o.user).filter(o=>o!=null),[B]),{currentSessionQuestionAnswers:he}=ee(q,n),Se=he.length===0;i.useEffect(()=>{n!=null&&l!==n&&C(function(o,w){return`/${o}/${oe}/${w}`}(p,n),{state:{...c.state},replace:!0})},[n,l,p,C,c.state]),i.useEffect(()=>{l!=null&&n==null&&l!=="new_chat"&&s(Xe({sessionId:l,agentId:"controller"}))},[]);const ge=i.useMemo(()=>({events:H.map(o=>`private-encrypted-chat-${o}.${ae}`),eventCallback:(o,w,ye)=>ye.onEventReceived(o,w)}),[H]);if(i.useEffect(()=>{L!=="In-Progress"&&$&&s(Ye())},[L,$,s]),i.useEffect(()=>{n!=null&&M!=="In-Progress"&&N&&a!=null&&L==="Completed"&&!$&&s(Je(n,a.userId))},[M,N,n,a,s]),a==null)throw Error("Can't access Cards AI CFO page without signing in...");const be=l??"new_chat",Pe=n!=null&&u.responseStateByChatSessionId?.[n]?.answer?.fetchState==="In-Progress";return b.jsxs(_t,{children:[b.jsx(_e,{analytics:V,onLoad:o=>o.trackPageLoaded(De.Event.aiCFOPage)}),g?b.jsx(At,{...ge,currentChatSessionId:n,allSessionsWithOrderedQuestionAnswers:q,allUsers:Ce,isAiCardCreationEnabled:E,isCardPolicyEnabled:P,openOnboardingPage:()=>d(!0),userId:a.userId,setIsAiCfoOpen:r,navigate:C,sessionFromUrl:be,location:c,isSubmitting:Pe,isEmptyChatWithSession:Se,customPageTitle:F,chatHeader:ce,currentTenant:t,emailLinkQuestion:ue??void 0,autoSubmitEmailLinkQuestion:me,onEmailLinkQuestionProcessed:fe,isFileUploadEnabled:e,isUploadPromoVisible:v,onUploadPromoClose:U,onCardPolicyVendorSearchTextChange:O,cardPolicyPageContext:de}):b.jsx(G,{isTOSAccepted:g,acceptMasterTOSState:u.masterTOSAcceptanceState,customPageTitle:F,onCloseClick:()=>{C(I?ie(p):j(p),{state:{...c.state}})},onCompleteClick:()=>{g||t.userRoleId==null||(S!=null&&S!==""&&(A.current={question:S,shouldSubmit:_}),s(Y(t.userRoleId)))}}),b.jsx(yt,{anchor:"right",open:m,transitionDuration:250,PaperProps:{component:xt,style:{width:`${xe}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>d(!1),children:b.jsx(Ut,{onClick:o=>o.stopPropagation(),children:b.jsx(G,{isTOSAccepted:g,acceptMasterTOSState:u.masterTOSAcceptanceState,customPageTitle:F,onCloseClick:()=>d(!1),onCompleteClick:()=>{g||t.userRoleId==null||s(Y(t.userRoleId)),d(!1)}})})})]})},Ut=R(wt)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|