@zeniai/web-app-ui 5.3.50-qa → 5.3.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/{AccountMappingScreen-CQ7H13AJ.js → AccountMappingScreen-B_fgGC93.js} +1 -1
- package/dist/assets/{ActualMatchingMatchDetailScreen-CiDidq0s.js → ActualMatchingMatchDetailScreen-ikXtEKwi.js} +1 -1
- package/dist/assets/AddressRoutes-C8S7gDv2.js +1 -0
- package/dist/assets/{AddressScreen-Bpb3fVmC.js → AddressScreen-CbT6uv6I.js} +1 -1
- package/dist/assets/{AiCfoScreen-QnyN7vBU.js → AiCfoScreen-DfyYoDqG.js} +1 -1
- package/dist/assets/{AppDrawer-C0gwz2JB.js → AppDrawer-mu7ycbk8.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-3EoXz0ZY.js → BillPayApprovalRoutes-CknU7mwh.js} +1 -1
- package/dist/assets/{BillPayRoutes-M6mZc5N-.js → BillPayRoutes-Dab4Lv9I.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-Nce7icz0.js → BusinessVerificationPageScreen-pHiRAFhL.js} +1 -1
- package/dist/assets/{CardsAiCfoScreen-DtOqwcGQ.js → CardsAiCfoScreen-D361jHJH.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-Dd-PxeHo.js → ChargeCardRoutes-CKtFRGHw.js} +1 -1
- package/dist/assets/{CompanyPassportScreen-49ty9VyO.js → CompanyPassportScreen-B2uwHchn.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-BXYkaDxo.js → ConnectionAuthScreen-Co2Gq7ws.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-Ca7OSsdg.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-XyONN9ww.js → CustomerOnboardingRoutes-7fWlDVF_.js} +1 -1
- package/dist/assets/{DashboardRoutes-dkthXH1f.js → DashboardRoutes-Bjdlm30G.js} +1 -1
- package/dist/assets/{DefaultTenantHome-CrymQf_N.js → DefaultTenantHome-Dfnzea8-.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-B7Wh2S3T.js → DomesticWireDetailScreen-EjxcD88e.js} +1 -1
- package/dist/assets/{DrawerScreen-ClAWgRZL.js → DrawerScreen-BXUZLhOQ.js} +1 -1
- package/dist/assets/{EntityDetailRoutes-Bci8_0b4.js → EntityDetailRoutes-BPBuXfdV.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-CBA2iWWZ.js → ExpenseAutomationRoutes-C3_3tauz.js} +1 -1
- package/dist/assets/{FeaturePreviewScreen-B5y1DAdh.js → FeaturePreviewScreen-CVSsRSRt.js} +1 -1
- package/dist/assets/{HubSpotOAuthCallbackScreen-CxZT5Xg0.js → HubSpotOAuthCallbackScreen-C0le1wc_.js} +1 -1
- package/dist/assets/{InboxNotificationsProvider-C4Mxy7-U.js → InboxNotificationsProvider-DGF7zUT5.js} +1 -1
- package/dist/assets/InvoicingRoutes-C0ncpiOU.js +2 -0
- package/dist/assets/{MagicLinkRoutes-ZSHjgrvL.js → MagicLinkRoutes-BFAq8G59.js} +1 -1
- package/dist/assets/{MagicLinkSignInScreen-CaYKvMpE.js → MagicLinkSignInScreen-DJPBAc7a.js} +1 -1
- package/dist/assets/{MobileAppDrawer-yEi_dlxO.js → MobileAppDrawer-BR5bPsUA.js} +1 -1
- package/dist/assets/NotFoundScreen-Bs6jlvSW.js +1 -0
- package/dist/assets/{NotificationRoutes-BnRbqfhI.js → NotificationRoutes--RK95rni.js} +1 -1
- package/dist/assets/{OAuthConsentScreen-BNUaqcAm.js → OAuthConsentScreen-DFq3gVzH.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-DsyrosDN.js → PandLWithForecastRoutes-0w_j-_X8.js} +1 -1
- package/dist/assets/{PaymentLinkScreen-DhAsW9ww.js → PaymentLinkScreen-DTThbeQW.js} +1 -1
- package/dist/assets/{PeopleRoutes-Slg7y6En.js → PeopleRoutes-hj0tExCw.js} +1 -1
- package/dist/assets/{PerformanceRoutes-DkaD6CAf.js → PerformanceRoutes-KCu8tZ8L.js} +1 -1
- package/dist/assets/{Preview-D3nFS6CS.js → Preview-CL5JOwkW.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-d5CTtraJ.js → QBOConnectionScreen-CjiaoAEy.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-DJ4bkGDP.js → ReimbursementApprovalRoutes-B_Sln0sl.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CCuMPoSQ.js → ReimbursementApprovalRuleDetailScreen-Ci4A_vGT.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-UoeOjPcY.js → ReimbursementRoutes-CYup41Xj.js} +1 -1
- package/dist/assets/{ReportsRoutes-DLgdpJm_.js → ReportsRoutes-DbEpEdcA.js} +1 -1
- package/dist/assets/{RewardsRoutes-C8Bk8JZD.js → RewardsRoutes-rrdbBIHj.js} +1 -1
- package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-CbzZSAqb.js → ScheduleDetailsPrepaidExpensesScreen-Du3o3smk.js} +1 -1
- package/dist/assets/{ScreenRoutes-BFJdqr7A.js → ScreenRoutes-CwbD03ss.js} +2 -2
- package/dist/assets/{SettingsRoutes-ssqLUH47.js → SettingsRoutes-D-wxWAud.js} +1 -1
- package/dist/assets/{SetupPagesScreen-Dofrysh_.js → SetupPagesScreen-C9dw8W4L.js} +1 -1
- package/dist/assets/{SignInScreen-2tgX27MZ.js → SignInScreen-DLbFHc0Z.js} +1 -1
- package/dist/assets/{SignOutScreen-DBUf9AUK.js → SignOutScreen-ChtEJ69Z.js} +1 -1
- package/dist/assets/{TaskListScreen-BvWmomDK.js → TaskListScreen-pzfHHZL9.js} +1 -1
- package/dist/assets/{TaskRoutes-CxfTcH7l.js → TaskRoutes-C8ixfF_K.js} +1 -1
- package/dist/assets/TransactionDetailRoutes-Cid-1lkg.js +1 -0
- package/dist/assets/{TransactionDetailScreen-CJaRW_q2.js → TransactionDetailScreen-CxDwuuF_.js} +1 -1
- package/dist/assets/{TransactionListRoutes-Co9yJGWM.js → TransactionListRoutes-BPYKZEc9.js} +1 -1
- package/dist/assets/{TreasuryRoutes-Can8ukgJ.js → TreasuryRoutes-CiS0ghvk.js} +1 -1
- package/dist/assets/{VendorsRoutes-CBDR6q2p.js → VendorsRoutes-DWH4y4fQ.js} +1 -1
- package/dist/assets/{WiseConfirmationScreen-7BKBvNTr.js → WiseConfirmationScreen-CAHKrI7T.js} +1 -1
- package/dist/assets/{ZeniAccountRoutes-Btl8MnMC.js → ZeniAccountRoutes-B32R3mCM.js} +1 -1
- package/dist/assets/{ZeniAccountStatementScreen-CPlmGVIe.js → ZeniAccountStatementScreen-CPBp7ImC.js} +1 -1
- package/dist/assets/{accountMappingHelper-C49jxhGs.js → accountMappingHelper-3Hm_-9n-.js} +1 -1
- package/dist/assets/{analytics-CqtBdMPM.js → analytics-D_bfwrdA.js} +1 -1
- package/dist/assets/{analyticsHelper-CMH3f5Mv.js → analyticsHelper-BCS-l0Hm.js} +1 -1
- package/dist/assets/{core-D9_r48xZ.js → core-C5ZG3tJS.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-DyEaiyWX.js → decodeURIComponentSafe-ukN1WN7f.js} +1 -1
- package/dist/assets/{dnd-BCAK2sIw.js → dnd-C67Dx0fq.js} +1 -1
- package/dist/assets/{empty-BoonXjm8.js → empty-CytNejfB.js} +1 -1
- package/dist/assets/{empty-DHCuvVpz.js → empty-D8AdB3zX.js} +1 -1
- package/dist/assets/{emptyVideoElement-DDkVcaiD.js → emptyVideoElement-DRkRIcLt.js} +1 -1
- package/dist/assets/{epic-DVDsBNia.js → epic-Dij6qtSX.js} +1 -1
- package/dist/assets/{expenseAutomationHelper-Bmn0IF_K.js → expenseAutomationHelper-TRaObTJj.js} +1 -1
- package/dist/assets/{getLocaleForTenant-CgHoQ1eD.js → getLocaleForTenant-C4S7jDsD.js} +1 -1
- package/dist/assets/{index-CYjuawf_.js → index-B7_eMJP9.js} +1 -1
- package/dist/assets/{index-BYMHtOlo.js → index-BJSiEm2J.js} +1 -1
- package/dist/assets/{index-DmXcZyli.js → index-BQn16-dp.js} +1 -1
- package/dist/assets/{index-9Ja3Lqmf.js → index-BUVBGxEt.js} +1 -1
- package/dist/assets/{index-dTLcnBHt.js → index-BkMAt9Jn.js} +1 -1
- package/dist/assets/{index-bQlS7Nxz.js → index-C-mLGw3d.js} +1 -1
- package/dist/assets/{index-BWlvyCtM.js → index-CHAUl04f.js} +6 -6
- package/dist/assets/{index-DNkFQuNQ.js → index-GiMM0ckT.js} +2 -2
- package/dist/assets/{lexical-2BO6qHmP.js → lexical-BpFcNSrv.js} +1 -1
- package/dist/assets/{liveblocks-BIpuBqDU.js → liveblocks-DsNaXx1Y.js} +1 -1
- package/dist/assets/{lottie-CDi-6upx.js → lottie-x1U_1T_X.js} +1 -1
- package/dist/assets/{mui-81_cRiBE.js → mui-BWEZqJM6.js} +1 -1
- package/dist/assets/{pathToGoBack-B4fU8Azr.js → pathToGoBack-Bx2jKiUl.js} +1 -1
- package/dist/assets/{pdf-Bb_1563M.js → pdf-Da5t4yqS.js} +3 -3
- package/dist/assets/{pdf-lib-CJ09PoKW.js → pdf-lib-BkS3YoMW.js} +1 -1
- package/dist/assets/{plaid-BDcnIkZ0.js → plaid-B_2YsVA4.js} +1 -1
- package/dist/assets/{pusher-Ct1YtECO.js → pusher-BHd7HOLE.js} +1 -1
- package/dist/assets/{react-903GIdr_.js → react-BQz1q-qh.js} +1 -1
- package/dist/assets/{react-Ad5cTmQt.js → react-CLpDx285.js} +1 -1
- package/dist/assets/{react-GWNxCIDF.js → react-CXAUR01O.js} +1 -1
- package/dist/assets/{react-CD8gkbD7.js → react-Cl3JZyLA.js} +1 -1
- package/dist/assets/{react-B3Wl6nG2.js → react-CluwtJMc.js} +1 -1
- package/dist/assets/{react-CWdNL9zh.js → react-aer_dY1C.js} +1 -1
- package/dist/assets/{recharts-D2tzVFIn.js → recharts-Cbxp2ciV.js} +1 -1
- package/dist/assets/{routePaths-Clggvdtc.js → routePaths-B9I9gBKX.js} +1 -1
- package/dist/assets/{sentry-B2ljjuRI.js → sentry-D4qoEIco.js} +1 -1
- package/dist/assets/{stripSplatSuffix-UCDmTxu6.js → stripSplatSuffix-Ca96gi6n.js} +1 -1
- package/dist/assets/{url-DyU7tVdi.js → url-C1Mc-kLe.js} +1 -1
- package/dist/assets/{url-BpHe0UXt.js → url-rUBTkYeh.js} +1 -1
- package/dist/assets/{useActualMatchingMatchDetail-Cu82mAOm.js → useActualMatchingMatchDetail-DLemcCW2.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-D4jhuxYc.js → useAiCfoDashboardSuggestedQuestionsChips-CJKPWqKp.js} +1 -1
- package/dist/assets/{useAskAiCfoHostNavButtonProps-0qWmdvwE.js → useAskAiCfoHostNavButtonProps-CeD5Zw-D.js} +1 -1
- package/dist/assets/{useChargeCardPusherEvents-Bqb5brTt.js → useChargeCardPusherEvents-D0ho77Y5.js} +1 -1
- package/dist/assets/{useDeviceId-CrjinlLp.js → useDeviceId-D51quroZ.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-BEnYjVgX.js → useEmailConnectResultRefresh-BcoabO7K.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-D_wVO4z2.js → useInitialThreadRequest-uHraoUFG.js} +1 -1
- package/dist/assets/{useTaskManagerAccess-DFbLYKBq.js → useTaskManagerAccess-DyYkiipc.js} +1 -1
- package/dist/assets/{utils-DajTl1fi.js → utils-DBZ_QSme.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-CJP44IF0.js → withTransactionSidePanel-DRYGp088.js} +1 -1
- package/dist/assets/{zeni-epic-state-D8p_bjl4.js → zeni-epic-state-BcPOXb6_.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/AddressRoutes-B6YbK3vV.js +0 -1
- package/dist/assets/CustomerOnboardingAuthScreen-ydHqVzP0.js +0 -1
- package/dist/assets/InvoicingRoutes-BUMLkBJ7.js +0 -2
- package/dist/assets/NotFoundScreen-DYgKmfND.js +0 -1
- package/dist/assets/TransactionDetailRoutes-OdKQWakM.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as m}from"./liveblocks-
|
|
1
|
+
import{j as m}from"./liveblocks-DsNaXx1Y.js";import{a as g}from"./sentry-D4qoEIco.js";import{h as w,u as T,g as k,i as x,j as O,l as E}from"./core-C5ZG3tJS.js";import{z as C,bs as F,a9 as P,k as V,S as j,o as b,bt as A,af as L,aH as U,p as B}from"./index-CHAUl04f.js";import{fF as N,gI as M,BA as _,gD as z,c8 as R,Y5 as Y,bn as G,uT as H,uH as Z,mz as $,o8 as S,Y6 as q,bE as J,cE as D,oj as K,ot as Q}from"./zeni-epic-state-BcPOXb6_.js";import"./mui-BWEZqJM6.js";import{d as W}from"./routePaths-B9I9gBKX.js";import{M as X}from"./MobileAppDrawer-BR5bPsUA.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]="ba31037c-1156-4e9a-bc04-4f3ecf8e824f",n._sentryDebugIdIdentifier="sentry-dbid-ba31037c-1156-4e9a-bc04-4f3ecf8e824f")}catch{}})();const ee=E((function(n){const a=z(n),i=C.getSignedInUser(),p=N(n),c=p.tenantId,l={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=R(p?.userRole??[])&&a.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=Y(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:l,filesEndPoint:`${L.fileMicroServiceBaseUrl}`,isZeniUser:G(i)}}),(function(n,a){const{companyId:i,currentTenant:p,navigate:c,location:l}=a,{tenantEmailDomain:f}=p;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(l.state?.pathnameStackToGoBack,l.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,v={companyInfo:{...t,website:u!=""&&u!=null?D(u):void 0,meetingLink:y!=""&&y!=null?D(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:v}))},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]))}}}))(A);function de(){const n=w(),a=T(),i=k(),{tenantEmailDomain:p}=x(),[c,l]=g.useState(!1),[f,e]=g.useState(!1),t=O((s=>s.companyViewState.passportView.fetchState)),o=O((s=>s.companyConfigState.fetchState)),r=O((s=>N(s))),d=r.companyId??C.getSignedInUserTenant(p)?.companyId;if(C.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect((()=>{c||t!=="Not-Started"||d==null||(l(!0),a(M(d)))}),[c,t,d,a]),g.useEffect((()=>{o==="Not-Started"&&a(_())}),[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:V,onLoad:s=>s.trackPageLoaded(j.Event.companyPassport,b(i)?"Settings":"Company Passport")}),b(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:n,location:i,isLoading:y,currentTenant:r,isSettings:b(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as I}from"./liveblocks-
|
|
1
|
+
import{j as I}from"./liveblocks-DsNaXx1Y.js";import{a as o}from"./sentry-D4qoEIco.js";import{u as P,h as R,g as H,j as C,N as w}from"./core-C5ZG3tJS.js";import{TM as q,fF as z,gl as G,pS as M,gM as A,gk as Q,gi as V,Ua as B,gh as O}from"./zeni-epic-state-BcPOXb6_.js";import{u as J,z as E,L as D,G as K,F as W}from"./index-CHAUl04f.js";import{n as X}from"./mui-BWEZqJM6.js";import{P as h,a as _}from"./AccountMappingScreen-B_fgGC93.js";import{t as Y}from"./getLocaleForTenant-C4S7jDsD.js";import{g as Z,Q as ee}from"./QBOConnectionScreen-CjiaoAEy.js";import"./recharts-Cbxp2ciV.js";import"./analytics-D_bfwrdA.js";import"./plaid-B_2YsVA4.js";import"./dnd-C67Dx0fq.js";import"./stripe-cKAAJElX.js";import"./lottie-x1U_1T_X.js";import"./lexical-BpFcNSrv.js";import"./pdf-Da5t4yqS.js";import"./utils-DBZ_QSme.js";import"./MobileAppDrawer-BR5bPsUA.js";import"./InboxNotificationsProvider-DGF7zUT5.js";import"./useTaskManagerAccess-DyYkiipc.js";import"./accountMappingHelper-3Hm_-9n-.js";import"./empty-D8AdB3zX.js";import"./pdf-lib-BkS3YoMW.js";import"./index-BJSiEm2J.js";import"./url-C1Mc-kLe.js";import"./index-BUVBGxEt.js";import"./decodeURIComponentSafe-ukN1WN7f.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]="d28d3cc5-43af-447c-ad47-1f839244c983",t._sentryDebugIdIdentifier="sentry-dbid-d28d3cc5-43af-447c-ad47-1f839244c983")}catch{}})();const te=X.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex: 1 1 auto;
|
|
4
4
|
flex-direction: row;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as i}from"./liveblocks-DsNaXx1Y.js";import{z as m}from"./index-CHAUl04f.js";import{g as n}from"./QBOConnectionScreen-CjiaoAEy.js";import"./sentry-D4qoEIco.js";import{g as p,N as a}from"./core-C5ZG3tJS.js";import"./zeni-epic-state-BcPOXb6_.js";import"./recharts-Cbxp2ciV.js";import"./mui-BWEZqJM6.js";import"./analytics-D_bfwrdA.js";import"./plaid-B_2YsVA4.js";import"./dnd-C67Dx0fq.js";import"./stripe-cKAAJElX.js";import"./lottie-x1U_1T_X.js";import"./lexical-BpFcNSrv.js";import"./pdf-Da5t4yqS.js";import"./utils-DBZ_QSme.js";import"./empty-D8AdB3zX.js";import"./pdf-lib-BkS3YoMW.js";import"./index-BJSiEm2J.js";import"./url-C1Mc-kLe.js";import"./index-BUVBGxEt.js";import"./decodeURIComponentSafe-ukN1WN7f.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]="a1205b81-d106-415b-bd92-85aeae53ace3",t._sentryDebugIdIdentifier="sentry-dbid-a1205b81-d106-415b-bd92-85aeae53ace3")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=n(t.search),s=m.getSignedInUser()?.userId??"";if(f(o,r,e,s)===!0){const d=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(a,{to:d})}return i.jsx(a,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
|
package/dist/assets/{CustomerOnboardingRoutes-XyONN9ww.js → CustomerOnboardingRoutes-7fWlDVF_.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-DsNaXx1Y.js";import{t as Tt,A as $e}from"./AddressScreen-CbT6uv6I.js";import wt from"./NotFoundScreen-Bs6jlvSW.js";import{a as d,t as Me}from"./sentry-D4qoEIco.js";import{h as _e,g as Ee,u as se,i as xe,j as T,N as Q,q as At,l as it,n as Pt,o as H}from"./core-C5ZG3tJS.js";import{fF as Y,d_ as Te,dZ as we,bq as Dt,U1 as jt,bR as Bt,pQ as Ft,Bk as Vt,Bn as Ut,Vo as Rt,Vp as Lt,lu as Oe,lx as ct,UE as Nt,b$ as Gt,c8 as fe,BO as Ae,Bz as $t,Vq as me,BP as dt,Sb as Mt,mH as ut,di as lt,Vr as Qt,Vs as Kt,uA as zt,Ur as Ce,hV as qt,Uq as be,hS as Ht,Gb as Zt,uE as Jt,hK as Wt,hN as Qe,Vt as pt,Vu as Xt,LY as Yt,Vv as en,M0 as tn,Bq as nn,Vw as an,Vx as on,ls as sn,lv as rn,B$ as cn,BB as mt,BN as dn,bE as Ke,cE as un,B_ as ze,uT as ln,uH as pn,mz as mn,gG as gn,gF as fn,gE as yn,Vy as hn,Bt as Cn,C0 as bn,C3 as Sn,C6 as In,Cc as kn,dj as On}from"./zeni-epic-state-BcPOXb6_.js";import{z,c as Pe,A as W,X as vn,p as q,a9 as re,k as g,aF as _n,aj as gt,a2 as En,M as ft,Q as yt,j as X,_ as ge,S as ve,aG as xn,F as qe,r as He,af as Tn,aH as Ze,aI as wn,aJ as An}from"./index-CHAUl04f.js";import{n as De}from"./mui-BWEZqJM6.js";import{g as Pn,h as Dn,q as ie}from"./QBOConnectionScreen-CjiaoAEy.js";import{u as jn,a as Bn}from"./useEmailConnectResultRefresh-BcoabO7K.js";import{u as Fn}from"./useChargeCardPusherEvents-D0ho77Y5.js";import"./recharts-Cbxp2ciV.js";import"./analytics-D_bfwrdA.js";import"./plaid-B_2YsVA4.js";import"./dnd-C67Dx0fq.js";import"./stripe-cKAAJElX.js";import"./lottie-x1U_1T_X.js";import"./lexical-BpFcNSrv.js";import"./pdf-Da5t4yqS.js";import"./utils-DBZ_QSme.js";import"./empty-D8AdB3zX.js";import"./pdf-lib-BkS3YoMW.js";import"./index-BJSiEm2J.js";import"./url-C1Mc-kLe.js";import"./index-BUVBGxEt.js";import"./decodeURIComponentSafe-ukN1WN7f.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="3011676d-065d-4925-b8b1-d09c5e06f0ea",e._sentryDebugIdIdentifier="sentry-dbid-3011676d-065d-4925-b8b1-d09c5e06f0ea")}catch{}})();const Je=e=>{switch(e){case"Complete":return"yes";case"Pending Review":case"Incomplete":return"partially";default:return"no"}},Vn=()=>{const e=_e(),l=Ee(),i=se(),[a,p]=d.useState(!1),[u,c]=d.useState(!1),{tenantEmailDomain:v}=xe(),t=z.getSignedInUser(),{useFeatureGate:n}=Pe(),{isFeatureEnabled:C}=n(W.isApAgingFeatureEnabled),{isFeatureEnabled:o}=n(W.isArAgingFeatureEnabled),{isFeatureEnabled:A}=n(W.isReferralFeatureEnabled),{isFeatureEnabled:w}=n(W.isDebitCardFeatureEnabled),k=vn(),O=T((S=>Y(S))),P=T((S=>S.onboardingCustomerViewState.fetchState)),_=O.excludedResources,F=O.companyId??z.getSignedInUserTenant(v)?.companyId;if(t==null)throw Error("Can't access onboarding flow without signing in...");const m=Te(w,O),b=we(O),D=[],U=_?.resources?.find((S=>S.resource==="/reports/top_expenses"))==null,h=_?.resources?.find((S=>S.resource==="/reports/task_card"))==null,r=O?.userRole!=null&&Dt(O?.userRole),E=_?.resources?.find((S=>S.resource==="/bills"))==null&&!r,x=_?.resources?.find((S=>S.resource==="/reimbursements"))==null;U===!1&&D.push("top_expenses"),h===!1&&D.push("task_card"),E===!1&&D.push("bill_pay_card","bill_pay_promo_card"),x===!1&&D.push("reimbursement_card","reimbursement_promo_card"),D.push("zeni_accounts_promo_card","treasury_promo_card"),A===!1&&D.push("rewards_card");const f=T((S=>{const V=[];C===!1&&V.push("accounts_payable_aging"),o===!1&&V.push("accounts_receivable_aging"),V.push("zeni_accounts_promo_card","treasury_promo_card"),A===!1&&V.push("rewards_card"),k===!1&&V.push("expense_automation_card");const Z=jt(S,V);return Bt(Z.reportsInOrder.map(($=>({fetchState:$.fetchState,error:$.error})))).fetchState}));d.useEffect((()=>{P!=="Completed"||a||m||b||(p(!0),i(Ft(t.userId,F,O.tenantId,!0,!1,D)))}),[a,P,m,b,t,O.tenantId,i]);const j=d.useRef(!1),N=d.useCallback((()=>{const S={pathnameStackToGoBack:q(l.state?.pathnameStackToGoBack,l.pathname),message:"activation"};e(m?"../../checking":b?"../../cards":"../../dashboard",{state:S})}),[e,l,m,b]),G=d.useCallback((()=>{j.current||(j.current=!0,N())}),[N]);if(d.useEffect((()=>{const S=setTimeout((()=>c(!0)),3e3);return()=>clearTimeout(S)}),[]),d.useEffect((()=>{const S=setTimeout(G,6e3);return()=>clearTimeout(S)}),[G]),d.useEffect((()=>{m||b||!u||f!=="Completed"&&f!=="Error"||G()}),[u,f,m,b,G]),P!=="Completed")return s.jsx(Q,{to:"../"});const L=O.company?.companyOnboardingInfo?.onboardingInfo,ee={timeSinceQuoteSign:L?.onboardingTimeSinceQuoteSigned??"",timeSinceQuoteSignInMinutes:L?.onboardingToQuoteSignMinutes??0,isKybDone:Je(L?.businessVerified?.status),isKycDone:Je(L?.identityVerified?.status),paymentType:"",paymentSource:"",qboConnectionSource:L?.accountingConnectionCreationMode??""};return s.jsxs(s.Fragment,{children:[s.jsx(re,{analytics:g,onLoad:S=>S.trackOnboardingDashboardActivation(ee)}),s.jsx(_n,{show:!0,onComplete:G})]})},Se=["reading_books","finance_graph","reconciliation","cfo_foundation"],Ie=["llm_fine_tuning","rag_knowledge_graph","personalized_context"],We=(e,l)=>{const i=new Map(e.map((a=>[a.key,a])));return l.map((a=>{return p=i.get(a)?.status,p==="starting"||p==="building"?p:"idle";var p}))},Xe=(e,l)=>{if(e.length===0)return!1;const i=new Map(e.map((a=>[a.key,a])));return l.every((a=>i.get(a)?.status==="ready"))},Ye=De.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
background-color: ${e=>e.theme.colors.grey4};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-BIpuBqDU.js";import{i as q,j as _,g as H,u as z,h as J,l as ne,k as oa,n as ft,o as F,N as yn}from"./core-D9_r48xZ.js";import{fF as L,VK as He,bE as sa,br as Ee,X5 as vn,ka as An,X6 as Xt,X7 as In,kd as gt,X8 as Qe,X9 as En,ki as Tn,Xa as Yt,Xb as xn,km as bt,Xc as We,Xd as Dn,Xe as wn,W2 as Pn,lo as On,Xf as Fn,bn as Je,Xg as ra,WI as ue,bc as ia,lC as ca,ll as la,WK as me,WJ as ae,fE as da,ga as jn,gq as Ct,Xh as Rn,Xi as Bn,Xj as ua,Xk as Oe,DV as Me,DW as Ue,Ei as Te,Ec as pe,D_ as Le,Xl as Mn,b$ as Ve,Xm as Un,Xn as Ln,Xo as ma,Xp as Fe,Xq as Vn,ei as et,A6 as pa,Xr as Xn,Xs as ha,Xt as Yn,Xu as Gn,Xv as Nn,Xw as St,UG as kt,u6 as xe,l$ as De,Es as yt,Ad as $n,Ak as zn,Xx as Kn,Xy as qn,DX as Gt,Xz as Qn,A9 as Ae,A4 as fa,XA as be,XB as Nt,XC as Wn,XD as vt,UF as At,Ch as ga,XE as Zn,XF as ba,XG as Hn,XH as Jn,XI as eo,XJ as It,Cw as to,CD as ao,XK as no,XL as oo,DZ as $t,XM as so,Cf as Ca,XN as Ce,XO as zt,XP as ro,bq as _a,Ex as Sa,XQ as io,XR as ka,XS as co,XT as lo,XU as uo,XV as Et,Ep as mo,Er as po,XW as ho,XX as fo,DY as Kt,XY as go,Ev as ya,XZ as _e,X_ as qt,X$ as bo,Y0 as Co,Y1 as va,lQ as Aa,pX as Ia,lV as Ea,pV as Ta,pU as xa,pT as Da,BE as _o,dc as So,pQ as ko,U1 as yo,q5 as vo,Y2 as Ao,Y3 as Io,Y4 as Eo,b5 as Tt,p$ as To,ic as xo,gI as Do,p_ as wo,le as Po,pY as Oo,pW as Fo,d_ as jo,dZ as Ro}from"./zeni-epic-state-D8p_bjl4.js";import{z as V,aw as oe,p as j,k as T,G as Q,bc as Bo,at as Xe,a9 as Ye,bd as wa,S as N,be as Mo,bf as Pa,E as Uo,bg as Lo,bh as Vo,a as Oa,a2 as Fa,e as ja,as as Xo,bi as Yo,ap as Go,c as we,bj as Ra,s as ce,bk as Ba,bl as Ma,av as Ua,bm as No,aj as Ge,Q as Ne,A as X,bn as $o,X as zo,j as Ko,a5 as qo,ar as Qo,bo as Wo,bp as Zo,bq as Ho,br as Ie}from"./index-BWlvyCtM.js";import{n as xt}from"./mui-81_cRiBE.js";import{a as b}from"./sentry-B2ljjuRI.js";import{w as La}from"./withTransactionSidePanel-CJP44IF0.js";import{c as Va,t as Pe,f as he,b as Dt,a as wt,v as Jo}from"./routePaths-Clggvdtc.js";import{u as se}from"./useAskAiCfoHostNavButtonProps-0qWmdvwE.js";import Be from"./NotFoundScreen-DYgKmfND.js";import{u as Pt}from"./useInitialThreadRequest-D_wVO4z2.js";import{t as Xa}from"./analyticsHelper-CMH3f5Mv.js";import{C as es}from"./CompanyPassportScreen-49ty9VyO.js";import{u as ts}from"./useAiCfoDashboardSuggestedQuestionsChips-D4jhuxYc.js";import{F as as}from"./FeaturePreviewScreen-B5y1DAdh.js";import"./recharts-D2tzVFIn.js";import"./analytics-CqtBdMPM.js";import"./plaid-BDcnIkZ0.js";import"./dnd-BCAK2sIw.js";import"./stripe-cKAAJElX.js";import"./lottie-CDi-6upx.js";import"./lexical-2BO6qHmP.js";import"./pdf-Bb_1563M.js";import"./utils-DajTl1fi.js";import"./TransactionDetailScreen-CJaRW_q2.js";import"./decodeURIComponentSafe-DyEaiyWX.js";import"./expenseAutomationHelper-Bmn0IF_K.js";import"./stripSplatSuffix-UCDmTxu6.js";import"./MobileAppDrawer-yEi_dlxO.js";import"./InboxNotificationsProvider-C4Mxy7-U.js";import"./useTaskManagerAccess-DFbLYKBq.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="36a41aa5-a677-4cad-8b83-58799b648179",e._sentryDebugIdIdentifier="sentry-dbid-36a41aa5-a677-4cad-8b83-58799b648179")}catch{}})();const ns=La((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=q(),s=V.getSignedInUser(),i=_((E=>E.tenantState.currentTenantId)),l=_((E=>L(E))),{tenantEmailDomain:m}=q(),p=H(),h=l?.companyName??"",f={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=b.useMemo((()=>({authParams:f,companyName:h,downloadEndPoint:`${oe}/agingDetailedReport`,timezone:He()})),[]),u=b.useMemo((()=>r!=null?sa(r):Ee()),[r]),C=z(),g=J(),k=_((E=>vn(E,u,o))),I=b.useCallback((()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&C(An(o,u))}),[u]),v=b.useCallback((()=>{g("../../",{relative:"path"})}),[]),S=b.useCallback(((E,B)=>{C(Xt({sortKey:E,sortOrder:B}))}),[]),x=b.useCallback((E=>{C(Xt({downloadState:E}))}),[]),P=b.useCallback((E=>{if(e)e(E.transactionId,E.transactionType);else if(m!=null){const B=Va({id:E.transactionId,type:E.transactionType},m);g(B);const y=j(p.state?.pathnameStackToGoBack,p.pathname);g(B,{state:{pathnameStackToGoBack:y}})}}),[m,e]),D=b.useCallback((()=>{k.vendor!=null&&T.trackApAgingDetail("AP Aging",u.format(Q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)}),[k.vendor,u]);return b.useEffect((()=>{I()}),[]),b.useEffect((()=>{k.fetchState==="Completed"&&D()}),[D,k.fetchState]),d.jsx(Bo,{apAgingDetail:k,downloadParams:c,reportDate:u,analytics:T,onTransactionClick:P,onReload:I,onBackClick:v,onColumnSortConfigChanged:S,updateDownloadStateHandler:x,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),os=()=>{const e=z(),a=J(),t=_((S=>In(S))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=se({mobileExploreReferrer:"AP Aging"});Xe({isDataReady:t.fetchState==="Completed"});const r=V.getSignedInUser(),s=_((S=>S.tenantState.currentTenantId)),i=_((S=>L(S))),l=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},p=b.useMemo((()=>({authParams:m,companyName:l,downloadEndPoint:`${oe}/agingReport`,timezone:He()})),[]),h=t.apAgingUIState.selectedDate??Ee(),f=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(gt(h))}),[]);b.useEffect((()=>{f()}),[]);const c=b.useCallback((()=>{a("../",{relative:"path"})}),[]),u=b.useCallback((S=>{e(Qe({searchString:S}))}),[]),C=b.useCallback(((S,x)=>{e(Qe({sortKey:x,sortOrder:S}))}),[]),g=b.useCallback((S=>{a(`./${S}/${h.format(Q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[h]),k=b.useCallback((S=>{e(Qe({downloadState:S}))}),[]),I=b.useCallback(((S,x)=>{}),[]),v=b.useCallback(((S,x)=>{e(Qe({selectedDate:S,agingDateSelectionType:x})),e(gt(S))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ye,{analytics:T,onLoad:S=>S.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(wa,{uiState:t.apAgingUIState,report:t,downloadParams:p,analytics:T,onReloadReport:f,onBackClick:c,onSearchTextChange:u,onSortOrderChange:C,onEntityNameClick:g,updateDownloadStateHandler:k,onSelectedDateChanged:v,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},ss=La((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=q(),s=V.getSignedInUser(),i=_((D=>L(D))),{tenantEmailDomain:l}=q(),m=H(),p=i.companyName,h={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},f=b.useMemo((()=>({authParams:h,companyName:p,downloadEndPoint:`${oe}/agingDetailedReport`,timezone:He()})),[]),c=b.useMemo((()=>r!=null?sa(r):Ee()),[r]),u=z(),C=J(),g=_((D=>En(D,c,o))),k=b.useCallback((()=>{o!=null&&g.fetchState!=="In-Progress"&&g.fetchState!=="Completed"&&u(Tn(o,c))}),[c]),I=b.useCallback((()=>{C("../../",{relative:"path"})}),[]),v=b.useCallback(((D,E)=>{u(Yt({sortKey:D,sortOrder:E}))}),[]),S=b.useCallback((D=>{u(Yt({downloadState:D}))}),[]),x=b.useCallback((D=>{if(e)e(D.transactionId,D.transactionType);else if(l!=null){const E=Va({id:D.transactionId,type:D.transactionType},l);C(E);const B=j(m.state?.pathnameStackToGoBack,m.pathname);C(E,{state:{pathnameStackToGoBack:B}})}}),[l,e]),P=b.useCallback((()=>{g.customer!=null&&T.trackArAgingDetail("AR Aging",c.format(Q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),g.customer.id,g.customer.name)}),[g.customer,c]);return b.useEffect((()=>{k()}),[]),b.useEffect((()=>{g.fetchState==="Completed"&&P()}),[g.fetchState,P]),d.jsx(Mo,{arAgingDetail:g,downloadParams:f,reportDate:c,analytics:T,onTransactionClick:x,onReload:k,onBackClick:I,onColumnSortConfigChanged:v,updateDownloadStateHandler:S,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),rs=()=>{const e=z(),a=J(),t=_((v=>xn(v))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=se({mobileExploreReferrer:"AR Aging"});Xe({isDataReady:t.fetchState==="Completed"});const r=V.getSignedInUser(),s=_((v=>L(v))),i=s.companyName,l={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo((()=>({authParams:l,companyName:i,downloadEndPoint:`${oe}/agingReport`,timezone:He()})),[]),p=t.arAgingUIState.selectedDate??Ee(),h=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(bt(p))}),[]);b.useEffect((()=>{h()}),[]);const f=b.useCallback((()=>{a("../",{relative:"path"})}),[]),c=b.useCallback((v=>{e(We({searchString:v}))}),[]),u=b.useCallback(((v,S)=>{e(We({sortKey:S,sortOrder:v}))}),[]),C=b.useCallback((v=>{a(`./${v}/${p.format(Q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[p]),g=b.useCallback((v=>{e(We({downloadState:v}))}),[]),k=b.useCallback(((v,S)=>{e(We({selectedDate:v,agingDateSelectionType:S})),e(bt(v))}),[]),I=b.useCallback(((v,S)=>{e(Dn({nodeId:v,isCollapsed:S}))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ye,{analytics:T,onLoad:v=>v.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(wa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:T,onReloadReport:h,onBackClick:f,onSearchTextChange:c,onSortOrderChange:u,onEntityNameClick:C,updateDownloadStateHandler:g,onSelectedDateChanged:k,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ya=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function Ga(e,a){const t=Pn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Pe(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=j(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(On(n,o))}}}const is=ne((function(e){const a=wn(e).accountsInOrder.map(((t,n)=>Ya(t,n)));return{sectionTitle:Q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,fetchState:e.cashBalanceState.fetchState,analytics:T}}),Ga)(Pa),cs=ne((function(e){const a=Fn(e).accountsInOrder.map(((o,r)=>Ya(o,r))),t=V.getSignedInUser(),n=Je(t);return{sectionTitle:Q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:T}}),Ga)(Pa);function ls(){const e=J(),a=H(),{tenantEmailDomain:t}=q(),n=_((o=>L(o).company?.companyInfo.firstMonthOfFY??1));return _((o=>o.cashBalanceState.fetchState))==="Error"?d.jsx(Be,{}):d.jsx(is,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,firstMonthOfFY:n})}function ds(){const e=J(),a=H(),{tenantEmailDomain:t}=q(),n=_((o=>L(o).company?.companyInfo.firstMonthOfFY??1));return _((o=>o.cardBalanceState.fetchState))==="Error"?d.jsx(Be,{}):d.jsx(cs,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,firstMonthOfFY:n})}const us=xt.div`
|
|
1
|
+
import{j as d}from"./liveblocks-DsNaXx1Y.js";import{i as q,j as _,g as H,u as z,h as J,l as ne,k as oa,n as ft,o as F,N as yn}from"./core-C5ZG3tJS.js";import{fF as L,VK as He,bE as sa,br as Ee,X5 as vn,ka as An,X6 as Xt,X7 as In,kd as gt,X8 as Qe,X9 as En,ki as Tn,Xa as Yt,Xb as xn,km as bt,Xc as We,Xd as Dn,Xe as wn,W2 as Pn,lo as On,Xf as Fn,bn as Je,Xg as ra,WI as ue,bc as ia,lC as ca,ll as la,WK as me,WJ as ae,fE as da,ga as jn,gq as Ct,Xh as Rn,Xi as Bn,Xj as ua,Xk as Oe,DV as Me,DW as Ue,Ei as Te,Ec as pe,D_ as Le,Xl as Mn,b$ as Ve,Xm as Un,Xn as Ln,Xo as ma,Xp as Fe,Xq as Vn,ei as et,A6 as pa,Xr as Xn,Xs as ha,Xt as Yn,Xu as Gn,Xv as Nn,Xw as St,UG as kt,u6 as xe,l$ as De,Es as yt,Ad as $n,Ak as zn,Xx as Kn,Xy as qn,DX as Gt,Xz as Qn,A9 as Ae,A4 as fa,XA as be,XB as Nt,XC as Wn,XD as vt,UF as At,Ch as ga,XE as Zn,XF as ba,XG as Hn,XH as Jn,XI as eo,XJ as It,Cw as to,CD as ao,XK as no,XL as oo,DZ as $t,XM as so,Cf as Ca,XN as Ce,XO as zt,XP as ro,bq as _a,Ex as Sa,XQ as io,XR as ka,XS as co,XT as lo,XU as uo,XV as Et,Ep as mo,Er as po,XW as ho,XX as fo,DY as Kt,XY as go,Ev as ya,XZ as _e,X_ as qt,X$ as bo,Y0 as Co,Y1 as va,lQ as Aa,pX as Ia,lV as Ea,pV as Ta,pU as xa,pT as Da,BE as _o,dc as So,pQ as ko,U1 as yo,q5 as vo,Y2 as Ao,Y3 as Io,Y4 as Eo,b5 as Tt,p$ as To,ic as xo,gI as Do,p_ as wo,le as Po,pY as Oo,pW as Fo,d_ as jo,dZ as Ro}from"./zeni-epic-state-BcPOXb6_.js";import{z as V,aw as oe,p as j,k as T,G as Q,bc as Bo,at as Xe,a9 as Ye,bd as wa,S as N,be as Mo,bf as Pa,E as Uo,bg as Lo,bh as Vo,a as Oa,a2 as Fa,e as ja,as as Xo,bi as Yo,ap as Go,c as we,bj as Ra,s as ce,bk as Ba,bl as Ma,av as Ua,bm as No,aj as Ge,Q as Ne,A as X,bn as $o,X as zo,j as Ko,a5 as qo,ar as Qo,bo as Wo,bp as Zo,bq as Ho,br as Ie}from"./index-CHAUl04f.js";import{n as xt}from"./mui-BWEZqJM6.js";import{a as b}from"./sentry-D4qoEIco.js";import{w as La}from"./withTransactionSidePanel-DRYGp088.js";import{c as Va,t as Pe,f as he,b as Dt,a as wt,v as Jo}from"./routePaths-B9I9gBKX.js";import{u as se}from"./useAskAiCfoHostNavButtonProps-CeD5Zw-D.js";import Be from"./NotFoundScreen-Bs6jlvSW.js";import{u as Pt}from"./useInitialThreadRequest-uHraoUFG.js";import{t as Xa}from"./analyticsHelper-BCS-l0Hm.js";import{C as es}from"./CompanyPassportScreen-B2uwHchn.js";import{u as ts}from"./useAiCfoDashboardSuggestedQuestionsChips-CJKPWqKp.js";import{F as as}from"./FeaturePreviewScreen-CVSsRSRt.js";import"./recharts-Cbxp2ciV.js";import"./analytics-D_bfwrdA.js";import"./plaid-B_2YsVA4.js";import"./dnd-C67Dx0fq.js";import"./stripe-cKAAJElX.js";import"./lottie-x1U_1T_X.js";import"./lexical-BpFcNSrv.js";import"./pdf-Da5t4yqS.js";import"./utils-DBZ_QSme.js";import"./TransactionDetailScreen-CxDwuuF_.js";import"./decodeURIComponentSafe-ukN1WN7f.js";import"./expenseAutomationHelper-TRaObTJj.js";import"./stripSplatSuffix-Ca96gi6n.js";import"./MobileAppDrawer-BR5bPsUA.js";import"./InboxNotificationsProvider-DGF7zUT5.js";import"./useTaskManagerAccess-DyYkiipc.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="36a41aa5-a677-4cad-8b83-58799b648179",e._sentryDebugIdIdentifier="sentry-dbid-36a41aa5-a677-4cad-8b83-58799b648179")}catch{}})();const ns=La((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=q(),s=V.getSignedInUser(),i=_((E=>E.tenantState.currentTenantId)),l=_((E=>L(E))),{tenantEmailDomain:m}=q(),p=H(),h=l?.companyName??"",f={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=b.useMemo((()=>({authParams:f,companyName:h,downloadEndPoint:`${oe}/agingDetailedReport`,timezone:He()})),[]),u=b.useMemo((()=>r!=null?sa(r):Ee()),[r]),C=z(),g=J(),k=_((E=>vn(E,u,o))),I=b.useCallback((()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&C(An(o,u))}),[u]),v=b.useCallback((()=>{g("../../",{relative:"path"})}),[]),S=b.useCallback(((E,B)=>{C(Xt({sortKey:E,sortOrder:B}))}),[]),x=b.useCallback((E=>{C(Xt({downloadState:E}))}),[]),P=b.useCallback((E=>{if(e)e(E.transactionId,E.transactionType);else if(m!=null){const B=Va({id:E.transactionId,type:E.transactionType},m);g(B);const y=j(p.state?.pathnameStackToGoBack,p.pathname);g(B,{state:{pathnameStackToGoBack:y}})}}),[m,e]),D=b.useCallback((()=>{k.vendor!=null&&T.trackApAgingDetail("AP Aging",u.format(Q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)}),[k.vendor,u]);return b.useEffect((()=>{I()}),[]),b.useEffect((()=>{k.fetchState==="Completed"&&D()}),[D,k.fetchState]),d.jsx(Bo,{apAgingDetail:k,downloadParams:c,reportDate:u,analytics:T,onTransactionClick:P,onReload:I,onBackClick:v,onColumnSortConfigChanged:S,updateDownloadStateHandler:x,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),os=()=>{const e=z(),a=J(),t=_((S=>In(S))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=se({mobileExploreReferrer:"AP Aging"});Xe({isDataReady:t.fetchState==="Completed"});const r=V.getSignedInUser(),s=_((S=>S.tenantState.currentTenantId)),i=_((S=>L(S))),l=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},p=b.useMemo((()=>({authParams:m,companyName:l,downloadEndPoint:`${oe}/agingReport`,timezone:He()})),[]),h=t.apAgingUIState.selectedDate??Ee(),f=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(gt(h))}),[]);b.useEffect((()=>{f()}),[]);const c=b.useCallback((()=>{a("../",{relative:"path"})}),[]),u=b.useCallback((S=>{e(Qe({searchString:S}))}),[]),C=b.useCallback(((S,x)=>{e(Qe({sortKey:x,sortOrder:S}))}),[]),g=b.useCallback((S=>{a(`./${S}/${h.format(Q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[h]),k=b.useCallback((S=>{e(Qe({downloadState:S}))}),[]),I=b.useCallback(((S,x)=>{}),[]),v=b.useCallback(((S,x)=>{e(Qe({selectedDate:S,agingDateSelectionType:x})),e(gt(S))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ye,{analytics:T,onLoad:S=>S.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(wa,{uiState:t.apAgingUIState,report:t,downloadParams:p,analytics:T,onReloadReport:f,onBackClick:c,onSearchTextChange:u,onSortOrderChange:C,onEntityNameClick:g,updateDownloadStateHandler:k,onSelectedDateChanged:v,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},ss=La((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=q(),s=V.getSignedInUser(),i=_((D=>L(D))),{tenantEmailDomain:l}=q(),m=H(),p=i.companyName,h={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},f=b.useMemo((()=>({authParams:h,companyName:p,downloadEndPoint:`${oe}/agingDetailedReport`,timezone:He()})),[]),c=b.useMemo((()=>r!=null?sa(r):Ee()),[r]),u=z(),C=J(),g=_((D=>En(D,c,o))),k=b.useCallback((()=>{o!=null&&g.fetchState!=="In-Progress"&&g.fetchState!=="Completed"&&u(Tn(o,c))}),[c]),I=b.useCallback((()=>{C("../../",{relative:"path"})}),[]),v=b.useCallback(((D,E)=>{u(Yt({sortKey:D,sortOrder:E}))}),[]),S=b.useCallback((D=>{u(Yt({downloadState:D}))}),[]),x=b.useCallback((D=>{if(e)e(D.transactionId,D.transactionType);else if(l!=null){const E=Va({id:D.transactionId,type:D.transactionType},l);C(E);const B=j(m.state?.pathnameStackToGoBack,m.pathname);C(E,{state:{pathnameStackToGoBack:B}})}}),[l,e]),P=b.useCallback((()=>{g.customer!=null&&T.trackArAgingDetail("AR Aging",c.format(Q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),g.customer.id,g.customer.name)}),[g.customer,c]);return b.useEffect((()=>{k()}),[]),b.useEffect((()=>{g.fetchState==="Completed"&&P()}),[g.fetchState,P]),d.jsx(Mo,{arAgingDetail:g,downloadParams:f,reportDate:c,analytics:T,onTransactionClick:x,onReload:k,onBackClick:I,onColumnSortConfigChanged:v,updateDownloadStateHandler:S,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),rs=()=>{const e=z(),a=J(),t=_((v=>xn(v))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=se({mobileExploreReferrer:"AR Aging"});Xe({isDataReady:t.fetchState==="Completed"});const r=V.getSignedInUser(),s=_((v=>L(v))),i=s.companyName,l={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo((()=>({authParams:l,companyName:i,downloadEndPoint:`${oe}/agingReport`,timezone:He()})),[]),p=t.arAgingUIState.selectedDate??Ee(),h=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(bt(p))}),[]);b.useEffect((()=>{h()}),[]);const f=b.useCallback((()=>{a("../",{relative:"path"})}),[]),c=b.useCallback((v=>{e(We({searchString:v}))}),[]),u=b.useCallback(((v,S)=>{e(We({sortKey:S,sortOrder:v}))}),[]),C=b.useCallback((v=>{a(`./${v}/${p.format(Q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[p]),g=b.useCallback((v=>{e(We({downloadState:v}))}),[]),k=b.useCallback(((v,S)=>{e(We({selectedDate:v,agingDateSelectionType:S})),e(bt(v))}),[]),I=b.useCallback(((v,S)=>{e(Dn({nodeId:v,isCollapsed:S}))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ye,{analytics:T,onLoad:v=>v.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(wa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:T,onReloadReport:h,onBackClick:f,onSearchTextChange:c,onSortOrderChange:u,onEntityNameClick:C,updateDownloadStateHandler:g,onSelectedDateChanged:k,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ya=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function Ga(e,a){const t=Pn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Pe(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=j(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(On(n,o))}}}const is=ne((function(e){const a=wn(e).accountsInOrder.map(((t,n)=>Ya(t,n)));return{sectionTitle:Q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,fetchState:e.cashBalanceState.fetchState,analytics:T}}),Ga)(Pa),cs=ne((function(e){const a=Fn(e).accountsInOrder.map(((o,r)=>Ya(o,r))),t=V.getSignedInUser(),n=Je(t);return{sectionTitle:Q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:T}}),Ga)(Pa);function ls(){const e=J(),a=H(),{tenantEmailDomain:t}=q(),n=_((o=>L(o).company?.companyInfo.firstMonthOfFY??1));return _((o=>o.cashBalanceState.fetchState))==="Error"?d.jsx(Be,{}):d.jsx(is,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,firstMonthOfFY:n})}function ds(){const e=J(),a=H(),{tenantEmailDomain:t}=q(),n=_((o=>L(o).company?.companyInfo.firstMonthOfFY??1));return _((o=>o.cardBalanceState.fetchState))==="Error"?d.jsx(Be,{}):d.jsx(cs,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,firstMonthOfFY:n})}const us=xt.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex: 1 1 auto;
|
|
4
4
|
min-height: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as v}from"./liveblocks-
|
|
1
|
+
import{j as v}from"./liveblocks-DsNaXx1Y.js";import{a as u}from"./sentry-D4qoEIco.js";import{u as y,j as b,l as w,g as A,N}from"./core-C5ZG3tJS.js";import{TM as U,fF as _,gl as k,TN as L,pS as R,TO as z}from"./zeni-epic-state-BcPOXb6_.js";import{u as O,z as f,L as C,t as I,G as j,b as $}from"./index-CHAUl04f.js";import"./mui-BWEZqJM6.js";import{t as P}from"./getLocaleForTenant-C4S7jDsD.js";import"./recharts-Cbxp2ciV.js";import"./analytics-D_bfwrdA.js";import"./plaid-B_2YsVA4.js";import"./dnd-C67Dx0fq.js";import"./stripe-cKAAJElX.js";import"./lottie-x1U_1T_X.js";import"./lexical-BpFcNSrv.js";import"./pdf-Da5t4yqS.js";import"./utils-DBZ_QSme.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="a8381dc1-57b3-4c40-8c27-a32d9a054992",t._sentryDebugIdIdentifier="sentry-dbid-a8381dc1-57b3-4c40-8c27-a32d9a054992")}catch{}})();const G=w((function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}}))((function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map((l=>l.tenantEmailDomain)),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const T=E(r.pathname);if(T!=null)c=`../${o.tenantEmailDomain}/${T}`,m="comingFromV2UrlPath",T==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce(((l,x)=>l||i.split("/").find((D=>D===x))!=null),!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const F=$(c,p);return v.jsx(N,{to:F,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}}));function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=O(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b((e=>U(e))),n=b((e=>e.tenantState.fetchState)),i=b((e=>e.tenantState.error)),a=b((e=>e.tenantState.activeTenantFetchState.fetchState)),c=b((e=>_(e))),d=f.getSignedInUser();return u.useLayoutEffect((()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(C.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)}),[a,n]),u.useEffect((()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(C.TENANT_FETCHING),t(k(d.userId,e))))}),[n,a,d,t]),u.useEffect((()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))}),[n,a,i,d,t]),u.useEffect((()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())}),[m.tenantsCoreDetailsInOrder,n]),u.useEffect((()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(j.updateAppLocaleID(P(c)),o())}),[n,a,c]),v.jsx(G,{})}const Q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],q={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of Q)if(t.toLocaleLowerCase().includes(s))return q[s]}export{oe as default};
|
package/dist/assets/{DomesticWireDetailScreen-B7Wh2S3T.js → DomesticWireDetailScreen-EjxcD88e.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-
|
|
1
|
+
import{j as l}from"./liveblocks-DsNaXx1Y.js";import{h as w,g as C,j as h,l as A,i as V}from"./core-C5ZG3tJS.js";import{YK as k,YR as _,gG as K,gF as L,gE as W,kP as J,WJ as q,uK as M,fF as B,Yh as D,kN as F,YL as S,YU as T,kL as G,l6 as j}from"./zeni-epic-state-BcPOXb6_.js";import{bN as Q,a2 as N,c as R,z as U,E as O,a5 as p,A as v,a8 as Y,bO as X,F as Z,bP as ee,p as te}from"./index-CHAUl04f.js";import{n as z}from"./mui-BWEZqJM6.js";import"./sentry-D4qoEIco.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]="7cc414b5-e20c-45f7-b138-eac7a1fb16aa",e._sentryDebugIdIdentifier="sentry-dbid-7cc414b5-e20c-45f7-b138-eac7a1fb16aa")}catch{}})();const ae=A(null,(function(e,t){return{onSaveVendor:a=>{e(J(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(q("common")),a!=null&&e(M(a))},onGetOtp:a=>{e(W(a,"BillPayVendor"))},onResendOtp:a=>{e(L(a,"BillPayVendor"))},onVerifyOtp:(a,n)=>{e(K(a,n,"BillPayVendor"))},onVerifyOtpSuccess:(a,n,o)=>{e(_(a,n,o))}}}))(Q);function H({vendorId:e,billId:t,isExpressPayPage:a}){const n=w(),o=C(),s=h((r=>k(r,e)));return l.jsx(ae,{location:o,navigate:n,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:a??!1})}const ne=z.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as c}from"./liveblocks-
|
|
1
|
+
import{j as c}from"./liveblocks-DsNaXx1Y.js";import{a2 as d,ac as f,E as l}from"./index-CHAUl04f.js";import{D as b}from"./mui-BWEZqJM6.js";import"./sentry-D4qoEIco.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]="c4a1a051-122a-4bbe-9cb2-6f5c19e6b4ff",e._sentryDebugIdIdentifier="sentry-dbid-c4a1a051-122a-4bbe-9cb2-6f5c19e6b4ff")}catch{}})();const p={drawerLeftMargin:new f(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:n,onClose:t}=e,a=d(),s=o?.valuePx(a)??p.drawerLeftMargin.valuePx(a),i=l();return c.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.8,cursor:"pointer"}}},onClose:t,children:n})}export{h as D};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-DsNaXx1Y.js";import{a as c}from"./sentry-D4qoEIco.js";import{h as B,u as A,g as G,i as F,j as d,N,l as q,n as $,o as O}from"./core-C5ZG3tJS.js";import{WN as _,fF as M,W3 as R,m$ as Y,S4 as k,WS as z,WI as J,l$ as K,S5 as P,W8 as V,W9 as H,WK as L,WJ as Q}from"./zeni-epic-state-BcPOXb6_.js";import{b9 as U,k as X,a5 as Z,p as tt}from"./index-CHAUl04f.js";import"./mui-BWEZqJM6.js";import{d as b}from"./decodeURIComponentSafe-ukN1WN7f.js";import{w as et}from"./withTransactionSidePanel-DRYGp088.js";import{f as at,c as nt}from"./routePaths-B9I9gBKX.js";import"./recharts-Cbxp2ciV.js";import"./analytics-D_bfwrdA.js";import"./plaid-B_2YsVA4.js";import"./dnd-C67Dx0fq.js";import"./stripe-cKAAJElX.js";import"./lottie-x1U_1T_X.js";import"./lexical-BpFcNSrv.js";import"./pdf-Da5t4yqS.js";import"./utils-DBZ_QSme.js";import"./useAskAiCfoHostNavButtonProps-CeD5Zw-D.js";import"./TransactionDetailScreen-CxDwuuF_.js";import"./useInitialThreadRequest-uHraoUFG.js";import"./expenseAutomationHelper-TRaObTJj.js";import"./stripSplatSuffix-Ca96gi6n.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="e08a97ac-9c8c-472a-9b50-5bd7334867cc",a._sentryDebugIdIdentifier="sentry-dbid-e08a97ac-9c8c-472a-9b50-5bd7334867cc")}catch{}})();const ot=q((function(a,t){const e=t.entity,o=z(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:J(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:K(a)}}),(function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,l=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:l}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(L({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Q("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(V()),a(H()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??I();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(P(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(P(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}}))(U),it=et((function({entityType:a,...t}){const e=B(),o=A(),l=G(),[m,T]=c.useState(!1),[h,D]=c.useState(!1),{tenantEmailDomain:C,entityIdEncoded:W,entityNameEncoded:x}=F(),r=b(W??""),p=b(x??""),u=rt(r,p),j=[r,p].filter((n=>n!=null)),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=d((n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter"))),v=d((n=>M(n).company?.companyInfo.firstMonthOfFY??1)),f=d((n=>R(n.trendWithTransactionsState,i,"EntityDetail")));c.useEffect((()=>{m===!1&&u===!0&&(T(!0),o(Y(i)))}),[m,u,i]);const S=d((n=>n.trendState.fetchState)),E=f?.selectedPeriod?.timePeriod??g,w=(function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y})(f?.selectedPeriod?.timePeriod,g);return c.useEffect((()=>{m===!0&&h===!1&&S==="Completed"&&(D(!0),E!=null&&o(k(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:E})))}),[m,h,S]),u?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:C,location:l,navigate:e,entity:i,defaultTransactionTimePeriod:w,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(N,{to:I(j.length)})})),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,I=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function vt({entityType:a}){return s.jsx($,{children:s.jsx(O,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{vt as EntityDetailRoutes,vt as default};
|
package/dist/assets/{ExpenseAutomationRoutes-CBA2iWWZ.js → ExpenseAutomationRoutes-C3_3tauz.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as b}from"./liveblocks-
|
|
1
|
+
import{j as b}from"./liveblocks-DsNaXx1Y.js";import{u as he,h as nt,g as be,j as _,i as Ue,t as Yn,l as Hn,n as Kn,o as He,N as Qn}from"./core-C5ZG3tJS.js";import{fF as ke,a0U as Zn,q0 as _e,U3 as Xn,z$ as es,a0V as ts,a0W as as,a0X as ns,a0Y as gt,a0Z as Qe,gh as bt,a0_ as ca,eW as ss,g0 as os,a0$ as ia,a10 as Ze,qT as cs,uN as is,gS as ls,gQ as rs,a11 as ds,r4 as us,rd as ms,qb as ps,qp as wa,gP as re,gR as hs,a12 as Ss,qL as Ra,re as gs,qm as Cs,qh as fs,uT as Is,gO as Me,a13 as tt,C9 as Da,Mp as Fa,a14 as _a,Fs as Ma,a15 as ks,eZ as bs,e$ as Ts,sP as Tt,WO as la,WQ as Ps,m2 as ys,WR as vs,m9 as Es,dl as As,Ds as Pt,a16 as xs,a17 as ws,fm as yt,sD as ra,WI as Rs,a18 as Ds,a19 as Fs,mb as _s,a1a as Ms,R5 as Os,ma as Us,l$ as Bs,qE as Oa,rj as at,tp as Ua,tL as Vs,TV as Ba,ri as da,rl as Va,rn as js,bE as zs,ny as $s,nv as Ls,rm as Xe,rk as pe,a1b as Gs,rE as ua,a1c as Ns,a1d as qs,sH as Js,sI as Ws,WE as Ys,VK as Hs,a0m as Ks,a1e as Qs,WK as ma,WJ as Ke,a1f as pa,mq as Zs,a1g as Xs,a1h as eo,a1i as to,a1j as ao,qz as no,a1k as so,a1l as oo,a1m as co,ru as io,md as lo,m4 as ro,a1n as uo,mc as ha,W$ as mo,a1o as po,a1p as ho,uo as So,t$ as go,t_ as Ct,a1q as Co,a1r as fo,a1s as Io,a1t as ko,nJ as bo,br as To,nE as Sa,nq as Po,a1u as yo,g$ as vo,nB as Eo,sR as Ao,sT as xo,sA as wo,VN as Ro,VO as Do,EW as Fo,EV as _o,Fa as Mo,a1v as ga,sG as Oo,a1w as Uo,rU as Bo,r_ as Vo,s9 as jo,rX as zo,a1x as $o,s8 as Lo,sM as Go,a1y as No,sZ as qo,su as Jo,t2 as Wo,sz as Yo,rF as Ho,a1z as Ko,qX as Qo,qv as Zo,qC as Ca,rp as Xo,a1A as ec,a1B as tc,a1C as ac,a1D as nc,a1E as sc,a1F as oc,t6 as cc,a1G as ic,a1H as lc,a1I as fa,uz as rc,tS as dc,tH as Ia,tF as uc,a1J as mc,tu as pc,t9 as hc,tI as Sc,a1K as gc,a1L as Cc,tf as fc,a1M as Ic,ta as kc,te as bc,tc as Tc,tO as Pc}from"./zeni-epic-state-BcPOXb6_.js";import ja from"./NotFoundScreen-Bs6jlvSW.js";import{a as s,R as za}from"./sentry-D4qoEIco.js";import{n as Te,S as yc}from"./mui-BWEZqJM6.js";import{c as Be,A as H,k as Z,p as te,ar as $a,at as La,dP as vc,dQ as Ec,J as Ga,z as st,dR as Ac,dS as xc,dT as wc,af as Oe,dU as Rc,dV as ka,bb as ba,dW as Dc,a8 as Na,dX as Fc,j as et,a as _c,dY as Mc,dZ as Oc,M as Uc,Q as Bc,d_ as Vc,d$ as jc,e0 as zc,b5 as $c,bs as Lc,ac as Gc,b6 as Nc,b7 as qc,G as Jc,w as Wc,e1 as Yc,aw as Ta,e2 as Hc}from"./index-CHAUl04f.js";import{u as qa}from"./useAskAiCfoHostNavButtonProps-CeD5Zw-D.js";import{g as Pa,b as Kc,c as Qc,h as Zc,a as Xc,i as ei,r as ti,C as ai}from"./TransactionDetailScreen-CxDwuuF_.js";import{u as ni}from"./useActualMatchingMatchDetail-DLemcCW2.js";import{d as si}from"./decodeURIComponentSafe-ukN1WN7f.js";import{m as Ja,a as Wa}from"./expenseAutomationHelper-TRaObTJj.js";import{u as Ya,a as Ha,w as oi}from"./withTransactionSidePanel-DRYGp088.js";import{b as ci,S as ii,a as li,J as ri}from"./ScheduleDetailsPrepaidExpensesScreen-Du3o3smk.js";import{s as ya,i as Ka,h as di,v as ui,c as mi}from"./routePaths-B9I9gBKX.js";import{a as ft}from"./accountMappingHelper-3Hm_-9n-.js";import{D as pi}from"./DrawerScreen-BXUZLhOQ.js";import"./recharts-Cbxp2ciV.js";import"./analytics-D_bfwrdA.js";import"./plaid-B_2YsVA4.js";import"./dnd-C67Dx0fq.js";import"./stripe-cKAAJElX.js";import"./lottie-x1U_1T_X.js";import"./lexical-BpFcNSrv.js";import"./pdf-Da5t4yqS.js";import"./utils-DBZ_QSme.js";import"./useInitialThreadRequest-uHraoUFG.js";import"./stripSplatSuffix-Ca96gi6n.js";import"./pathToGoBack-Bx2jKiUl.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new t.Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="98ed79a9-d81d-4d8a-81da-6b4d577fd409",t._sentryDebugIdIdentifier="sentry-dbid-98ed79a9-d81d-4d8a-81da-6b4d577fd409")}catch{}})();const hi=()=>{const t=he(),n=nt(),f=be(),I=_((C=>ke(C))),{useFeatureGate:k}=Be(),{isFeatureEnabled:o}=k(H.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:r}=k(H.aiAuditScorePercentage),E=_((C=>C.expenseAutomationViewState.selectedPeriodByTenantId)),l=_((C=>Zn(C,I.tenantId))),{isAiCfoAccessEnabled:S,onAskAiCfoClick:R}=qa({mobileExploreReferrer:"Month-End Close Overview"}),x=s.useCallback(((C,h,z=!1)=>{t(_e({tenantId:h,period:{month:C.month,year:C.year},refreshViewInBackground:z}))}),[]),m=s.useCallback((C=>{const h=f.state?.referrer;l.monthEndCloseChecks?.auditSummary!=null&&Z.trackMonthCloseAuditPage(C.month,C.year,l.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",l.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,h??null),t(Xn(I.tenantId,C))}),[I.tenantId,l.monthEndCloseChecks?.auditSummary,l.monthEndCloseChecks?.reportEmailSentDate]),g=E[I.tenantId],u=s.useCallback((()=>{const C=f.state?.referrer;l.monthEndCloseChecks?.auditSummary!=null&&Z.trackMonthCloseAuditPage(g.month,g.year,l.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",l.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,C??null),x(g,I.tenantId,!0)}),[x,g,I.tenantId,l.monthEndCloseChecks?.auditSummary,l.monthEndCloseChecks?.reportEmailSentDate]),F=te(f.state?.pathnameStackToGoBack,f.pathname),A=s.useCallback((()=>{if(l.monthEndCloseChecks!=null&&g!=null){const C=l.monthEndCloseChecks.monthEndCloseCheckList.find((h=>h.progress<100));if(C!=null)return void n(`./${C.id}/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:F,message:"comingFromOverview"}});n(`./month_end_insights/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:F,message:"comingFromOverview"}})}}),[l.monthEndCloseChecks,g]),{areTenantIdsInSync:p}=$a();return La({isDataReady:l.fetchState==="Completed"}),s.useEffect((()=>{g!=null&&l.fetchState!=="In-Progress"&&l.fetchState!=="Completed"&&p&&x(g,I.tenantId)}),[x,g,l.fetchState,I.tenantId,p]),s.useEffect((()=>{g!=null&&l.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&l.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&p&&t(es(g))}),[g,l.monthClosePerformanceTrendFetchStatus.fetchState,p]),s.useEffect((()=>{const C=setInterval((()=>{l.fetchState!=="In-Progress"&&l.fetchState==="Completed"&&u()}),3e5);return()=>clearInterval(C)}),[l.fetchState]),s.useEffect((()=>{if(l.fetchState==="Completed"&&l.monthEndCloseChecks?.auditSummary!=null){const C=f.state?.referrer;Z.trackMonthCloseAuditPage(l.selectedPeriod.month,l.selectedPeriod.year,l.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",l.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,C??null)}}),[l.fetchState,l.selectedPeriod,l.monthEndCloseChecks?.auditSummary,l.monthEndCloseChecks?.reportEmailSentDate]),b.jsx(Si,{children:b.jsx(vc,{monthEndCloseChecksView:l,isRealtimeInsightsFeatureEnabled:o,onMonthEndCheckClick:C=>{n(`./${C}/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:F,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:m,handleReviewButtonClick:A,onBackClick:()=>{n("../../dashboard")},onReload:u,isAiCfoAccessEnabled:S,onAskAiCfoClick:R,aiAuditScorePercentageEnabled:r})})},Si=Te.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-DsNaXx1Y.js";import{a as r}from"./sentry-D4qoEIco.js";import{ax as l,ay as p,W as f,a5 as m}from"./index-CHAUl04f.js";import"./mui-BWEZqJM6.js";import c from"./NotFoundScreen-Bs6jlvSW.js";import{h as u,g as b}from"./core-C5ZG3tJS.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="47d12613-0e32-45ea-a185-3bfe94200392",e._sentryDebugIdIdentifier="sentry-dbid-47d12613-0e32-45ea-a185-3bfe94200392")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback((()=>{window.open("https://www.zeni.ai/demo/request","_blank")}),[]),i=r.useCallback((()=>{(()=>{const n=m(a.state?.pathnameStackToGoBack),d=n.poppedPathname??k();e(d,{state:{pathnameStackToGoBack:n.newStack}})})()}),[]),o=l(a.pathname);return o!=null?s.jsx(p,{menuItem:f(o),onDemoClick:t,onGoBack:i}):s.jsx(c,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r}from"./sentry-
|
|
1
|
+
import{a as r}from"./sentry-D4qoEIco.js";import{u as l,h as f,g as m}from"./core-C5ZG3tJS.js";import{hY as p,Uq as g,Ur as _}from"./zeni-epic-state-BcPOXb6_.js";import{u as b,L as h,z as y}from"./index-CHAUl04f.js";import"./liveblocks-DsNaXx1Y.js";import"./recharts-Cbxp2ciV.js";import"./mui-BWEZqJM6.js";import"./analytics-D_bfwrdA.js";import"./plaid-B_2YsVA4.js";import"./dnd-C67Dx0fq.js";import"./stripe-cKAAJElX.js";import"./lottie-x1U_1T_X.js";import"./lexical-BpFcNSrv.js";import"./pdf-Da5t4yqS.js";import"./utils-DBZ_QSme.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="77204d44-70b9-4fc1-8ae7-6c28d778ce03",e._sentryDebugIdIdentifier="sentry-dbid-77204d44-70b9-4fc1-8ae7-6c28d778ce03")}catch{}})();function j(){const e=l(),n=f(),o=m(),{setLoading:i,clearAllLoading:u}=b(),s=r.useRef(!1);return r.useLayoutEffect((()=>{i(h.CONNECTION_AUTH)}),[i]),r.useEffect((()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&c!=null){const t=JSON.parse(c);e(p(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}u();const d=y.getActiveTenantForUser();n(d?.tenantEmailDomain!=null?`/${d.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})}),[]),null}export{j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as s}from"./liveblocks-
|
|
1
|
+
import{n as s}from"./liveblocks-DsNaXx1Y.js";import{j as d}from"./core-C5ZG3tJS.js";import{fF as a}from"./zeni-epic-state-BcPOXb6_.js";import"./sentry-D4qoEIco.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]="7ecf9165-dd2c-4040-9e65-c840c8a3aad6",e._sentryDebugIdIdentifier="sentry-dbid-7ecf9165-dd2c-4040-9e65-c840c8a3aad6")}catch{}})();const h=()=>d((e=>a(e))).tenantId==null?{inboxNotifications:[],isLoading:!1,isFetchingMore:!1,hasFetchedAll:!0,fetchMore:()=>null}:(()=>{const{inboxNotifications:e,isLoading:o,isFetchingMore:i,hasFetchedAll:t,fetchMore:n}=s();return{inboxNotifications:e,isLoading:o,isFetchingMore:i,hasFetchedAll:t,fetchMore:n}})();export{h as u};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-DsNaXx1Y.js";import{a as r}from"./sentry-D4qoEIco.js";import{u as P,h as L,i as R,j as C,t as K,l as O,s as H,g as G,N as B,n as te,o as x}from"./core-C5ZG3tJS.js";import{a9 as st,k as p,ar as T,S as m,cc as ct,cd as rt,ce as lt,cf as dt,cg as ut,ch as gt,ci as mt,cj as vt,ck as pt,cl as ft,cm as St,cn as ht,p as W,co as It,cp as Ct,af as ae,cq as Et,cr as kt,z as ye,cs as yt,ct as xt,cu as bt,cv as jt,cw as Dt,cx as Pt,cy as Lt,cz as At,Q as $t,aj as mn,cA as Ft,cB as wt,cC as Rt,cD as Tt,cE as $e,cF as _t,cG as Ot,cH as Mt,cI as Nt,cJ as Ut,cK as Bt,t as ze,j as vn,cL as Vt,cM as Ht,cN as qt,cO as zt,cP as Zt,cQ as Qt,cR as Kt}from"./index-CHAUl04f.js";import"./mui-BWEZqJM6.js";import{A as Z}from"./AddressScreen-CbT6uv6I.js";import M from"./NotFoundScreen-Bs6jlvSW.js";import{ZE as Gt,ZF as Wt,vl as Ze,ZG as Q,vO as se,ZH as Fe,ZI as ce,wp as xe,ww as Yt,wB as pn,ZJ as we,wt as fn,y3 as Qe,vN as Ke,ZK as Jt,ZL as Sn,wM as be,ZM as re,wQ as Xt,ZN as ei,ZO as hn,wT as In,y_ as ni,ZP as ve,ZQ as Ge,ZR as Cn,vL as ti,ZS as ii,vF as oi,ZT as ai,yg as si,ZU as En,yp as We,ZV as ci,ym as ri,ZW as Re,gh as li,ZX as ee,ZY as ne,x6 as di,vT as Ye,vY as kn,vW as ui,vQ as gi,w$ as mi,v_ as vi,x8 as pi,ZZ as je,xh as yn,xf as Y,xd as le,xc as fi,Z_ as xn,yv as Je,Z$ as Si,vM as bn,_0 as Te,w7 as De,w4 as Pe,wh as jn,wg as _e,w1 as hi,wa as Dn,wj as ie,fF as Oe,Vr as Pn,vP as Me,we as Ii,wf as Ci,wd as Ei,_1 as ki,wR as yi,wN as Ln,_2 as An,vz as Xe,_3 as xi,vv as bi,_4 as ji,yB as Di,yF as q,yA as Pi,xJ as Ne,_5 as Li,_6 as $n,yO as en,_7 as Ai,yL as $i,_8 as Fn,xM as Fi,xN as V,xQ as wi,_9 as wn,x_ as Ie,_a as Ri,x7 as Rn,TZ as Tn,_b as Ti,y8 as _i,_c as _n,_d as Oi,_e as Mi,_f as Ni,zD as Ui,_g as Bi,_h as On,yV as Mn,_i as Nn,zB as Ce,_j as Vi,zy as Hi,_k as qi,_l as zi,_m as Zi,_n as Qi,_o as Ki,_p as nn,_q as Gi,eg as Wi,zH as Yi,_r as Ue,xr as Ji,xm as Xi,_s as de,xC as Un,xu as ue,xt as eo,xx as Bn,_t as no,xs as to,_u as Vn,y$ as Hn,zq as tn,zl as io,_v as oo,z0 as ao,_w as so,zr as co,zv as ro,_x as Be,wr as qn,zc as lo,ws as uo,_y as go,_z as zn,c8 as mo,ms as vo,mt as po,_A as on,wq as ge,gl as fo,mz as So,zi as Zn,zT as ho,zf as Qn,uT as Io,zQ as an,uH as Co,zN as sn,hS as Eo,Uq as cn,Ur as ko,Gb as Kn,hK as yo,_B as xo,Vg as bo,_C as jo,zY as Ee,zZ as Do,_D as Po,_E as Gn,zW as Lo,_F as Ao,_G as $o,yc as Fo,_H as wo}from"./zeni-epic-state-BcPOXb6_.js";import{M as Ro}from"./MobileAppDrawer-BR5bPsUA.js";import{q as me}from"./QBOConnectionScreen-CjiaoAEy.js";import"./recharts-Cbxp2ciV.js";import"./analytics-D_bfwrdA.js";import"./plaid-B_2YsVA4.js";import"./dnd-C67Dx0fq.js";import"./stripe-cKAAJElX.js";import"./lottie-x1U_1T_X.js";import"./lexical-BpFcNSrv.js";import"./pdf-Da5t4yqS.js";import"./utils-DBZ_QSme.js";import"./InboxNotificationsProvider-DGF7zUT5.js";import"./useTaskManagerAccess-DyYkiipc.js";import"./empty-D8AdB3zX.js";import"./pdf-lib-BkS3YoMW.js";import"./index-BJSiEm2J.js";import"./url-C1Mc-kLe.js";import"./index-BUVBGxEt.js";import"./decodeURIComponentSafe-ukN1WN7f.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="ce373500-0e7d-4b1b-8cb6-a80994028ab1",t._sentryDebugIdIdentifier="sentry-dbid-ce373500-0e7d-4b1b-8cb6-a80994028ab1")}catch{}})();const $=({event:t,isReady:e=!0})=>e?s.jsx(st,{analytics:p,onLoad:n=>n.trackPageLoaded(t)}):null;function N(...t){return t.some((e=>e==="Error"))}function To(){const t=P(),e=L(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=T(),[a,o]=r.useState(""),[c,d]=r.useState(""),[l,v]=r.useState(null),u=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),{fetchState:g,hasMore:S,items:f,nextCursor:h,auditLogEntityRouteOptions:D,auditLogListSortFieldOptions:b}=C(Gt),k=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),y=`/${n??""}/invoicing`,I=r.useCallback(((A,U)=>{const _=Wt(y,A,U,D);_!=null&&(p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{entity:A,entityId:U,fromScreen:"audit_log"}),e(_))}),[D,e,y]);r.useEffect((()=>{const A=setTimeout((()=>d(a)),300);return()=>clearTimeout(A)}),[a]),r.useEffect((()=>{i&&t(Ze({filters:k,keepExistingListItems:!1,sort:u}))}),[i,k,u,t]);const j=g==="Not-Started"||g==="In-Progress"&&f.length===0,E=g==="In-Progress"&&f.length>0,F=g==="Completed";return N(g)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingAuditLogPage,isReady:F}),s.jsx(ct,{auditLogEntityRouteOptions:D,auditLogListSortFieldOptions:b,entries:f,hasMore:S,isLoading:j,isLoadingMore:E,searchValue:a,sortState:l,onEntityLinkClick:I,onLoadMore:()=>{S&&h!=null&&t(Ze({cursor:h,filters:k,keepExistingListItems:!0,sort:u}))},onSearchChange:o,onSortChange:v})]})}function pe(t,e=!1){const n=P(),i=C((c=>Q(c).productNextCursor!=null)),a=C((c=>Q(c).productNextCursor)),o=C((c=>Q(c).productFetchState.fetchState));r.useEffect((()=>{t&&(e&&o!=="Not-Started"||n(se({filters:{type:"addon|charge"},keepExistingListItems:!1})))}),[t,n,e]),r.useEffect((()=>{t&&o!=="In-Progress"&&i&&a!=null&&n(se({cursor:a,filters:{type:"addon|charge"},keepExistingListItems:!0}))}),[t,n,o,i,a])}function fe(t,e,n,i){const[a,o]=r.useState(0),[c,d]=r.useState(!1),l=r.useRef(t);return r.useEffect((()=>{const v=l.current==="In-Progress";l.current=t,t==="Completed"&&v&&n!=null&&(d(!0),i(n))}),[t,n,i]),r.useEffect((()=>{c&&!e&&(d(!1),o((v=>v+1)))}),[c,e]),a}const _o=new Set(["plan"]),Oo=O((function(t,e){const{view:n}=e;return{applicableItemOptions:n.applicableItemOptions,qboAccountHierarchy:n.qboAccountHierarchy,qboClassHierarchy:n.qboClassHierarchy,qboIncomeAccountIds:n.qboIncomeAccountIds,catalogItemLifecycleActionOptions:n.catalogItemLifecycleActionOptions,catalogProductLifecycleActionOptions:n.catalogProductLifecycleActionOptions,tierTypeOptionsByPricingModel:n.catalogTierTypeOptionsByPricingModel,periodUnitOptions:n.periodUnitOptions,trialEndActionOptions:n.trialEndActionOptions,trialUnitOptions:n.trialUnitOptions,typeOptions:n.typeOptions,isLoading:e.isLoading,isRunningLifecycleAction:n.actionState.fetchState==="In-Progress",isSaving:n.fetchState==="In-Progress",itemId:e.itemId,localData:n.localData,plan:n.plan}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{itemId:i}=e;return{onBack:()=>e.navigate(`${n}/catalog`),onLifecycleAction:i!==""?a=>{i!==""&&t(fn({action:a,id:i}))}:void 0,onEditChange:a=>{i!==""&&t(we({id:i,localData:a}))},onSaveEdit:()=>{p.trackInvoicingActionClick(m.Event.invoicingCatalogItemEdited,{itemId:i}),t(pn({id:i}))},onSubFamilyLifecycleAction:(a,o)=>{i!==""&&t(Yt({action:o,id:a,parentItemId:i}))}}}))(rt);function Mo(){const t=P(),e=L(),{item_id:n,tenantEmailDomain:i}=R(),[a]=K(),{areTenantIdsInSync:o}=T(),c=(d=a.get("kind"))!=null&&_o.has(d)?d:"plan";var d;const l=C((k=>Fe(k,n))),{pageFetchState:v}=l,u=v.fetchState;r.useEffect((()=>(t(ce({id:n})),()=>{t(ce({id:n}))})),[t,n]),r.useEffect((()=>{o&&t(xe({id:n,kind:c}))}),[o,n,c,t]);const g=r.useCallback((k=>t(xe({cacheOverride:!0,id:k,kind:c}))),[t,c]),S=fe(l.fetchState,l.isFormLoading,n,g),f=u==="Completed"&&!l.isFormLoading;pe(o,!0);const[h,D]=r.useState(f?n:void 0);r.useEffect((()=>{n!=null&&f&&D(n)}),[n,f]);const b=h!==n&&(u==="Not-Started"||u==="In-Progress"||l.isFormLoading);return N(u)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingCatalogItemDetailPage,isReady:f}),s.jsx(Oo,{navigate:e,tenantEmailDomain:i,itemId:n??"",kind:c,isLoading:b,view:l},S)]})}const No=new Set(["addon","charge","plan"]),Uo=new Set(["plan"]),Bo=O((function(t,e){const n=Fe(t,e.itemId);return{fieldHelp:n.fieldHelp,qboClassHierarchy:n.qboClassHierarchy,qboAccountHierarchy:n.qboAccountHierarchy,qboIncomeAccountIds:n.qboIncomeAccountIds,applicabilityValues:n.applicabilityValues,periodUnitOptions:n.periodUnitOptions,trialEndActionOptions:n.trialEndActionOptions,trialUnitOptions:n.trialUnitOptions,typeOptions:n.typeOptions,applicableItemOptions:n.applicableItemOptions,defaultType:e.isEdit?void 0:e.defaultType,errorMessage:n.fetchState==="Error"?n.error?.message??"Failed to save catalog item.":void 0,isSubmitting:n.fetchState==="In-Progress",isLoading:n.isFormLoading,localData:n.localData,mode:n.mode,pricingModelValues:n.pricingModelValues,prorationValues:n.prorationValues,tierTypeOptionsByPricingModel:n.catalogTierTypeOptionsByPricingModel,tierTypeValues:n.tierTypeValues}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,i=e.isEdit?"edit":"create",{itemId:a}=e,o=a!=null?`${n}/catalog/${encodeURIComponent(a)}`:`${n}/catalog`;return{onBack:()=>e.navigate(o),onCancel:()=>{p.trackInvoicingActionClick(m.Event.invoicingCatalogItemFormCancelled),t(ce({id:a})),e.navigate(`${n}/catalog`)},onChange:c=>{t(we({id:a,localData:c}))},onSubmit:()=>{p.trackInvoicingActionClick(m.Event.invoicingCatalogItemSaved,{mode:i}),t(pn({id:a}))}}}))(lt);function Vo(){const t=P(),e=L(),{item_id:n,tenantEmailDomain:i}=R(),[a]=K(),{areTenantIdsInSync:o}=T(),c=n!=null,d=a.get("type"),l=d!=null&&No.has(d)?d:void 0,v=(u=a.get("kind"))!=null&&Uo.has(u)?u:"plan";var u;const g=C((S=>Fe(S,n)));return pe(o,!0),r.useEffect((()=>{o&&t(xe({id:n,kind:v}))}),[o,n,v,t]),r.useEffect((()=>{c||l==null||g.localData.catalogType===l||t(we({localData:{...g.localData,catalogType:l}}))}),[c,l,g.localData?.catalogType,t]),r.useEffect((()=>{if(g.fetchState==="Completed"){const S=g.savedItemId??n,f=S!=null?`/${i}/invoicing/catalog/${encodeURIComponent(S)}`:`/${i}/invoicing/catalog`;e(f),t(ce({id:n}))}}),[g.fetchState,g.savedItemId,n,t,e,i]),s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingCatalogItemFormPage}),s.jsx(Bo,{navigate:e,tenantEmailDomain:i,defaultType:l,isEdit:c,itemId:n})]})}const Ho={addons:"addon",all:"item",charges:"charge",plans:"plan"},qo=O((function(t,e){const n=Q(t),i=e.activeTab==="plans",a=e.activeTab==="all",o=i?n.plans:a?[...n.plans,...n.products]:n.products,c=i||a&&n.fetchState==="In-Progress"?n.fetchState:n.productFetchState.fetchState;return{catalogItemLifecycleActionOptions:n.catalogItemLifecycleActionOptions,counts:n.count,countsLoading:n.countsFetchState.fetchState==="Not-Started"||n.countsFetchState.fetchState==="In-Progress",hasMore:i?n.planNextCursor!=null:a&&n.planNextCursor!=null||n.productNextCursor!=null,isLoading:c==="Not-Started"||c==="In-Progress"&&o.length===0,isLoadingMore:c==="In-Progress"&&o.length>0,plans:n.plans,productColumns:n.productColumns,products:n.products}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,i=e.activeTab==="plans",a=e.activeTab==="all",o=i?e.planNextCursor:e.productNextCursor;return{activeTab:e.activeTab,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onTabChange:e.onTabChange,onImportCsv:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportCsvClicked,{entity:"catalog"}),e.navigate(`${n}/data_import`)},onAddItem:()=>{const c=Ho[e.activeTab];p.trackInvoicingActionClick(m.Event.invoicingAddCatalogItemClicked,{itemType:c}),e.navigate(`${n}/catalog/new?type=${c}`)},onItemClick:(c,d)=>{p.trackInvoicingActionClick(m.Event.invoicingCatalogItemRowClicked,{itemId:d}),e.navigate(`${n}/catalog/${encodeURIComponent(d)}`)},onCatalogItemLifecycleAction:(c,d)=>{t(fn({action:Jt(d),id:c}))},onLoadMore:()=>{if(a)return e.planNextCursor!=null&&t(Ke({cursor:e.planNextCursor,filters:e.planFilters,keepExistingListItems:!0,sort:e.sort})),void(e.productNextCursor!=null&&t(se({cursor:e.productNextCursor,filters:e.productFilters,keepExistingListItems:!0,sort:e.sort})));o!=null&&t(i?Ke({cursor:o,filters:e.planFilters,keepExistingListItems:!0,sort:e.sort}):se({cursor:o,filters:e.productFilters,keepExistingListItems:!0,sort:e.sort}))}}}))(dt);function zo(){const t=P(),e=L(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=T(),[a,o]=r.useState(""),[c,d]=r.useState("plans"),[l,v]=r.useState(""),[u,g]=r.useState(null),S=r.useMemo((()=>u!=null?{dir:u.direction,field:u.columnKey}:void 0),[u]),f=l.trim()!==""?l.trim():void 0,h=r.useMemo((()=>({search:f,type:"plan"})),[f]),D=r.useMemo((()=>({search:f,type:"addon|charge"})),[f]),b=C((A=>Q(A))),k=b.planFilters.search,y=b.planSort,I=b.planNextCursor,j=b.productNextCursor,E=b.fetchState==="Completed",F=b.runningActionId??null;return r.useEffect((()=>{const A=setTimeout((()=>v(a)),300);return()=>clearTimeout(A)}),[a]),r.useEffect((()=>{i&&t(Qe({cacheOverride:!1,planFilters:h,productFilters:D,planSort:S,productSort:S}))}),[i,t,h,D,S]),r.useEffect((()=>{i&&(f!==k||S?.field!==y?.field||S?.dir!==y?.dir)&&t(Qe({cacheOverride:!0,planFilters:h,productFilters:D,planSort:S,productSort:S}))}),[k,y,i,t,h,D,f,S]),N(b.fetchState)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingCatalogPage,isReady:E}),s.jsx(qo,{navigate:e,tenantEmailDomain:n,activeTab:c,searchValue:a,sortState:u,planFilters:h,productFilters:D,sort:S,planNextCursor:I,productNextCursor:j,runningCatalogItemActionId:F,onSearchChange:o,onTabChange:d,onSortChange:g})]})}const Zo=O((function(t,e){const n=Sn(t,e.couponId);return{fieldHelp:n.fieldHelp,applyOnOptions:n.applyOnOptions,discountTypeOptions:n.discountTypeOptions,durationTypeOptions:n.durationTypeOptions,errorMessage:n.fetchState==="Error"?n.error?.message??"Failed to save coupon.":void 0,isQboConnected:n.isQboConnected,isQboPickerDataLoading:n.isQboPickerDataLoading,isSubmitting:n.fetchState==="In-Progress",isLoading:n.isFormLoading,localData:n.localData,mode:n.mode,periodUnitOptions:n.periodUnitOptions,qboAccountHierarchy:n.qboAccountHierarchy,qboIncomeAccountIds:n.qboIncomeAccountIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{couponId:i}=e,a=i!=null?"edit":"create",o=i!=null?`${n}/discounts/${encodeURIComponent(i)}`:`${n}/discounts`;return{onBack:()=>e.navigate(o),onCancel:()=>{p.trackInvoicingActionClick(m.Event.invoicingCouponFormCancelled),t(re({id:i})),e.navigate(`${n}/discounts`)},onChange:c=>{t(ei({id:i,localData:c}))},onSubmit:()=>{p.trackInvoicingActionClick(m.Event.invoicingCouponSaved,{mode:a}),t(Xt({id:i}))}}}))(ut);function Qo(){const t=P(),e=L(),{coupon_id:n,tenantEmailDomain:i}=R(),{areTenantIdsInSync:a}=T(),{fetchState:o,savedCouponId:c}=C((d=>Sn(d,n)));return r.useEffect((()=>{a&&t(be({id:n}))}),[a,n,t]),r.useEffect((()=>{if(o==="Completed"){const d=c??n,l=d!=null?`/${i}/invoicing/discounts/${encodeURIComponent(d)}`:`/${i}/invoicing/discounts`;e(l),t(re({id:n}))}}),[o,c,n,t,e,i]),s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingCouponFormPage}),s.jsx(Zo,{couponId:n,navigate:e,tenantEmailDomain:i})]})}const Ko=O((function(t){const e=hn(t);return{fieldHelp:e.fieldHelp,customers:e.customers,planNames:e.planNames,errorMessage:e.fetchState==="Error"?e.error?.message??"Failed to create invoice. Please try again.":void 0,isSubmitting:e.fetchState==="In-Progress",localData:e.localData,settings:e.settings}}),(function(t){return{dispatch:t}}),(function(t,{dispatch:e},n){const i=`/${n.tenantEmailDomain}/invoicing`;return{...t,onCancel:()=>{p.trackInvoicingActionClick(m.Event.invoicingCreateInvoiceCancelled),n.navigate(`${i}/invoices`)},onChange:a=>{e(Cn(a))},onSubmit:()=>{const a=ii(t.localData);p.trackInvoicingActionClick(m.Event.invoicingInvoiceCreated,{customerId:a.customer_id,lineItemCount:a.line_items?.length}),e(oi(a))}}}))(mt);function Go(){const t=P(),e=L(),{tenantEmailDomain:n}=R(),[i]=K(),{areTenantIdsInSync:a}=T(),o=i.get("customerId"),c=C((I=>hn(I))),d=c.fetchState,l=c.localData,v=c.savedInvoiceId,u=C(In),g=C((I=>ni(I))),S=C(ve),f=g.fetchState==="Not-Started"||g.fetchState==="In-Progress"&&u==null,h=S.fetchState==="Not-Started"||S.fetchState==="In-Progress"&&S.customers.length===0,D=f||h,b=g.fetchState==="Completed"&&S.fetchState==="Completed";r.useEffect((()=>(t(Ge()),()=>{t(Ge())})),[t]);const k=r.useRef(!1);r.useEffect((()=>{k.current||o==null||o===""||l.customerId!==""||(k.current=!0,t(Cn({...l,customerId:o})))}),[o,l,t]),r.useEffect((()=>{a&&t(ti({cacheOverride:!1}))}),[a,t]);const y=r.useRef(d);return r.useEffect((()=>{const I=y.current;if(y.current=d,I!=="Completed"&&d==="Completed"){const j=v!=null?`/${n}/invoicing/invoices/${encodeURIComponent(v)}`:`/${n}/invoicing/invoices`;e(j)}}),[d,v,e,n]),s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingCreateInvoicePage,isReady:b}),D?s.jsx(gt,{}):s.jsx(Ko,{navigate:e,tenantEmailDomain:n})]})}const Wo=O((function(t,e){const{detailView:n}=e;return{fieldHelp:e.detailView.fieldHelp,creditNote:n.creditNote,creditNoteId:e.creditNoteId,isLoading:n.fetchState==="Not-Started"||n.fetchState==="In-Progress"}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{onBack:()=>e.navigate(`${n}/credits`),onCustomerClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{customerId:i,fromScreen:"credit_detail",toScreen:"customer"}),e.navigate(`${n}/customers/${encodeURIComponent(i)}`)},onInvoiceClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{fromScreen:"credit_detail",invoiceId:i,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}`)},onSubscriptionClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{fromScreen:"credit_detail",subscriptionId:i,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(i)}`)}}}))(vt);function Yo(){const t=P(),e=L(),{credit_note_id:n,tenantEmailDomain:i}=R(),{areTenantIdsInSync:a}=T(),o=C((d=>ai(d,n??""))),c=o.fetchState==="Completed";return r.useEffect((()=>{a&&n!=null&&t(si({id:n}))}),[a,n,t]),N(o.fetchState)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingCreditDetailPage,isReady:c}),s.jsx(Wo,{navigate:e,tenantEmailDomain:i,creditNoteId:n??"",detailView:o})]})}const Jo=O((function(t){const e=En(t),{fetchState:n}=e;return{columns:e.columns,counts:e.count,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",creditNotes:e.creditNotes,hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.creditNotes.length===0,isLoadingMore:n==="In-Progress"&&e.creditNotes.length>0,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onStatusChange:e.onStatusChange,onImportCsv:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportCsvClicked,{entity:"credits"}),e.navigate(`${n}/data_import`)},onCreditNoteClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingCreditNoteRowClicked,{creditNoteId:i}),e.navigate(`${n}/credits/${encodeURIComponent(i)}`)},onLoadMore:()=>{e.nextCursor!=null&&t(ri({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(pt);function Xo(){const t=P(),e=L(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=T(),[a,o]=r.useState(""),[c,d]=r.useState(""),[l,v]=r.useState(null),u=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),g=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:S,appliedSearch:f,appliedSort:h,nextCursor:D,creditNoteListFetchState:b}=C((y=>{const I=En(y);return{activeStatus:I.activeTab,appliedSearch:I.filters.search,appliedSort:I.sort,nextCursor:I.nextCursor,creditNoteListFetchState:I.fetchState}}),H),k=b==="Completed";return r.useEffect((()=>{const y=setTimeout((()=>d(a)),300);return()=>clearTimeout(y)}),[a]),r.useEffect((()=>{i&&t(We({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(g.search!==f||u?.field!==h?.field||u?.dir!==h?.dir)&&t(We({cacheOverride:!0,filters:g,sort:u}))}),[i,t,g,u,f,h]),N(b)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingCreditsListPage,isReady:k}),s.jsx(Jo,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:a,sortState:l,filters:g,sort:u,nextCursor:D,onSearchChange:o,onStatusChange:y=>t(ci(y)),onSortChange:v})]})}const Wn=(t,e,n)=>{const i=`/${t}/invoicing/customers/`;return n!=null?`${i}${encodeURIComponent(n)}/${e}/`:`${i}new/${e}/`},ea=O((function(t,e){const{editView:n,hasLoadedRecord:i}=e;return{fieldHelp:n.fieldHelp,billingAddressLabel:n.billingAddressLabel,hasUnsavedBillingAddress:n.hasUnsavedBillingAddress,customerTypeOptions:n.customerTypeOptions,netTermDayOptions:n.netTermDayOptions,taxabilityOptions:n.taxabilityOptions,customer:n.record.invoicingCustomer,invoices:n.record.invoices.slice(0,5),isLoading:!i&&(n.pageFetchState.fetchState==="Not-Started"||n.pageFetchState.fetchState==="In-Progress"||n.isFormLoading),hasPaymentLinkEmailPreviewFailed:n.emailPreviewFetchState.fetchState==="Error",isPaymentLinkEmailPreviewLoading:n.emailPreviewFetchState.fetchState==="In-Progress",isSaving:n.fetchState==="In-Progress",paymentLinkEmailPreview:n.emailPreview,isSendingPaymentLink:n.record.sendLinkState.fetchState==="In-Progress",localData:n.localData,paymentMethods:n.record.paymentMethods,sendPaymentLinkErrorMessage:n.record.sendLinkState.fetchState==="Error"?n.record.sendLinkState.error?.message??"Failed to send payment link.":void 0,sentPaymentLinkEmail:n.record.sendLinkState.fetchState==="Completed"?n.record.sentPaymentLinkEmail:void 0,sentPaymentLinkMagicUrl:n.record.sendLinkState.fetchState==="Completed"?n.record.sentPaymentLinkMagicUrl:void 0,stripeConnected:n.record.stripeConnected}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{customerId:i}=e;return{onBack:()=>e.navigate(`${n}/customers`),onChange:a=>{t(je({id:i,localData:a}))},onCreateInvoice:()=>e.navigate(`${n}/invoices/create`),onInvoiceClick:a=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{fromScreen:"customer_detail",invoiceId:a,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(a)}`)},onCreatePromotionalCredits:()=>e.onCreatePromotionalCredits(),onNewSubscription:()=>e.navigate(`${n}/subscriptions/new`),onDiscardEdit:()=>{t(Y(le)),t(fi({id:i}))},onOpenAddress:()=>{const a=Wn(e.tenantEmailDomain??"",le,i),o=W(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(a,{state:{pathnameStackToGoBack:o}})},onOpenPaymentSettings:()=>e.navigate(`${n}/settings/payment-destination`),onSaveEdit:a=>{p.trackInvoicingActionClick(m.Event.invoicingCustomerEdited,{customerId:i}),t(je({id:i,localData:a})),t(yn({id:i}))},onFetchPaymentLinkEmailPreview:a=>t(pi({cacheOverride:a,customerId:i})),onSendPaymentLink:(a,o,c)=>t(vi({body:c,customerId:i,email:a,subject:o})),onSubscriptionClick:a=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{fromScreen:"customer_detail",subscriptionId:a,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(a)}`)}}}))(ht);function na(){const t=P(),e=L(),n=G(),{customer_id:i,tenantEmailDomain:a}=R(),{areTenantIdsInSync:o}=T(),c=C((_=>Re(_,i))),d=c.pageFetchState.fetchState,l=d==="Completed"&&!c.isFormLoading,[v,u]=r.useState(!1),[g,S]=r.useState(!1),[f,h]=r.useState(l?i:void 0);r.useEffect((()=>{i!=null&&l&&h(i)}),[i,l]);const D=f===i,{plaidTokenFetchState:b,promotionalCreditSubmitState:k}=c,{paymentMethodSaveState:y,setupIntentFetchState:I,stripeConnected:j}=c.record,E=r.useRef(c.record.sendLinkState.fetchState);r.useEffect((()=>{const _=c.record.sendLinkState.fetchState;E.current!=="Error"&&_==="Error"&&t(li({messageSection:"common",messageText:"failed",showStatusIcon:!0,type:"error"})),E.current=_}),[t,c.record.sendLinkState.fetchState]);const F=I.fetchState==="Error"?I.error?.message??"Failed to start card setup.":y.fetchState==="Error"?y.error?.message??"Failed to save payment method.":b.fetchState==="Error"?b.error?.message??"Failed to connect bank account.":void 0;r.useEffect((()=>(t(ee()),t(ne()),()=>{t(ee()),t(ne())})),[t]),r.useEffect((()=>{n.state?.openPromotionalCreditsDialog===!0&&(S(!0),e(n.pathname,{replace:!0,state:null}))}),[n.pathname,n.state,e]),r.useEffect((()=>{o&&i!=null&&t(di({id:i}))}),[o,i,t]),r.useEffect((()=>{o&&i!=null&&j&&t(Ye({customerId:i}))}),[o,i,t,j]);const A=r.useCallback((_=>t(kn({id:_}))),[t]),U=fe(c.fetchState,c.isFormLoading,i,A);return N(d)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingCustomerDetailPage,isReady:l}),s.jsx(ea,{customerId:i??"",editView:c,hasLoadedRecord:D,location:n,navigate:e,tenantEmailDomain:a,onAddPaymentMethod:()=>{t(ee()),i!=null&&j&&t(Ye({customerId:i})),u(!0)},onCreatePromotionalCredits:()=>{t(ne()),S(!0)}},U),s.jsx(ft,{errorMessage:F,isCreatingSetupIntent:I.fetchState==="In-Progress",isSaving:y.fetchState==="In-Progress",open:v,plaidLinkToken:c.record.plaidLinkToken,saveSucceeded:y.fetchState==="Completed",setupIntent:c.record.setupIntent,stripeConnected:j,onChooseCard:()=>{i!=null&&t(gi({customerId:i}))},onClose:()=>{u(!1),t(ee())},onSavePaymentMethod:_=>{i!=null&&t(ui({customerId:i,data:_}))}}),s.jsx(St,{currentBalance:c.record.invoicingCustomer?.promotionalCredits,currencyCode:c.record.invoicingCustomer?.preferredCurrencyCode,errorMessage:k.fetchState==="Error"?k.error?.message??"Failed to add promotional credits.":void 0,isSubmitting:k.fetchState==="In-Progress",open:g,submitSucceeded:k.fetchState==="Completed",onClose:()=>{S(!1),t(ne())},onSubmit:({amount:_,description:X})=>{i!=null&&t(mi({amount:_,customerId:i,currencyCode:c.record.invoicingCustomer?.preferredCurrencyCode,description:X}))}})]})}const ta=O((function(t,e){const n=Re(t,e.customerId);return{fieldHelp:n.fieldHelp,billingAddressLabel:n.billingAddressLabel,customerTypeOptions:n.customerTypeOptions,netTermDayOptions:n.netTermDayOptions,taxabilityOptions:n.taxabilityOptions,errorMessage:n.fetchState==="Error"?n.error?.message??"Failed to save customer.":void 0,isSubmitting:n.fetchState==="In-Progress",isLoading:n.isFormLoading,localData:n.localData,mode:n.mode}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{customerId:i}=e,a=i!=null?"edit":"create",o=i!=null?`${n}/customers/${encodeURIComponent(i)}`:`${n}/customers`;return{onBack:()=>e.navigate(o),onCancel:()=>{p.trackInvoicingActionClick(m.Event.invoicingCustomerFormCancelled),t(xn({id:i})),t(Y(le)),e.navigate(`${n}/customers`)},onChange:c=>{t(je({id:i,localData:c}))},onOpenAddress:()=>{const c=Wn(e.tenantEmailDomain??"",le,i),d=W(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(c,{state:{pathnameStackToGoBack:d}})},onSubmit:()=>{p.trackInvoicingActionClick(m.Event.invoicingCustomerSaved,{mode:a}),t(yn({id:i}))}}}))(It);function ia(){const t=P(),e=L(),n=G(),{customer_id:i,tenantEmailDomain:a}=R(),{areTenantIdsInSync:o}=T(),{fetchState:c,savedCustomerId:d}=C((l=>Re(l,i)));return r.useEffect((()=>{o&&i!=null&&t(kn({id:i}))}),[o,i,t]),r.useEffect((()=>{if(c==="Completed"){const l=d??i,v=l!=null?`/${a}/invoicing/customers/${encodeURIComponent(l)}`:`/${a}/invoicing/customers`;e(v),t(xn({id:i}))}}),[c,d,i,t,e,a]),s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingCustomerFormPage}),s.jsx(ta,{customerId:i,location:n,navigate:e,tenantEmailDomain:a})]})}const oa=O((function(t){const e=ve(t),{fetchState:n}=e;return{addressesById:t.addressState.addressesById,columns:e.columns,counts:e.count,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",customers:e.customers,hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.customers.length===0,isLoadingMore:n==="In-Progress"&&e.customers.length>0,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onStatusChange:e.onStatusChange,onSortChange:e.onSortChange,onAddCustomer:()=>{p.trackInvoicingActionClick(m.Event.invoicingAddCustomerClicked),e.navigate(`${n}/customers/new`)},onCustomerClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingCustomerRowClicked,{customerId:i}),e.navigate(`${n}/customers/${encodeURIComponent(i)}`)},onImportCsv:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportCsvClicked,{entity:"customers"}),e.navigate(`${n}/data_import`)},onRowAction:(i,a)=>{switch(a){case"createInvoice":e.navigate(`${n}/invoices/create?customerId=${encodeURIComponent(i)}`);break;case"newSubscription":e.navigate(`${n}/subscriptions/new?customerId=${encodeURIComponent(i)}`);break;case"createPromotionalCredits":e.navigate(`${n}/customers/${encodeURIComponent(i)}`,{state:{openPromotionalCreditsDialog:!0}})}},onLoadMore:()=>{e.nextCursor!=null&&t(bn({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(Ct);function aa(){const t=P(),e=L(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=T(),[a,o]=r.useState(""),[c,d]=r.useState(""),[l,v]=r.useState(null),u=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),g=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:S,appliedSearch:f,appliedSort:h,nextCursor:D,customerListFetchState:b}=C((y=>{const I=ve(y);return{activeStatus:I.activeTab,appliedSearch:I.filters.search,appliedSort:I.sort,nextCursor:I.nextCursor,customerListFetchState:I.fetchState}}),H),k=b==="Completed";return r.useEffect((()=>{const y=setTimeout((()=>d(a)),300);return()=>clearTimeout(y)}),[a]),r.useEffect((()=>{i&&t(Je({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(g.search!==f||u?.field!==h?.field||u?.dir!==h?.dir)&&t(Je({cacheOverride:!0,filters:g,sort:u}))}),[i,t,g,u,f,h]),N(b)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingCustomersListPage,isReady:k}),s.jsx(oa,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:a,sortState:l,filters:g,sort:u,nextCursor:D,onSearchChange:o,onStatusChange:y=>t(Si(y)),onSortChange:v})]})}const Le=(t,e)=>e==null?void 0:t.sessionDetail[e]??t.sessions.find((n=>n.id===e)),sa=O((function(t,e){const{filters:n,sessionId:i,view:a}=e,o=i==null?void 0:a.diagnosticsBySession[i],c=o?.fetch.fetchState??"Not-Started";return{diagnostics:o?.items??[],errorMessage:c==="Error"?o?.fetch.error?.message:void 0,expired:o?.expired??!1,filters:n,hasMore:o?.nextCursor!=null,isLoading:c==="Not-Started"||c==="In-Progress",isLoadingMore:c==="In-Progress"&&(o?.items.length??0)>0,session:Le(a,i)}}),(function(t,e){const{downloadUrl:n,filters:i,navigate:a,sessionId:o,tenantEmailDomain:c,view:d}=e,l=o==null?void 0:d.diagnosticsBySession[o],v=Le(d,o),u=d.actionStateByKind.retry?.fetchState==="In-Progress",g=d.actionStateByKind.rollback?.fetchState==="In-Progress",S=v?.status==="done"&&v.rollback_available_until!=null&&new Date(v.rollback_available_until).getTime()>Date.now()&&!g;return{onBack:()=>a(`/${c}/invoicing/data_import`),onDownloadCsv:()=>{n!=null&&window.open(n,"_blank","noopener")},onFiltersChange:e.onFiltersChange,onLoadMore:()=>{o!=null&&l?.nextCursor!=null&&t(Pe({...i,cursor:l.nextCursor,sessionId:o}))},onRetry:v?.status!=="failed"||u?void 0:()=>{o!=null&&t(_e(o))},onRollback:S?()=>{o!=null&&t(jn(o))}:void 0}}))(Et);function ca(){const t=P(),e=L(),{sessionId:n,tenantEmailDomain:i}=R(),{areTenantIdsInSync:a}=T(),[o,c]=r.useState({}),d=C(Te),l=Le(d,n),v=n==null?void 0:d.diagnosticsBySession[n];r.useEffect((()=>{a&&n!=null&&t(De(n))}),[a,t,n]),r.useEffect((()=>{if(!a||n==null)return;const f=setTimeout((()=>{t(Pe({...o,sessionId:n}))}),300);return()=>clearTimeout(f)}),[a,t,o,n]);const u=l?.status==="scanning"||l?.status==="importing";r.useEffect((()=>{if(!a||n==null||!u)return;const f=setInterval((()=>{t(De(n)),t(Pe({...o,sessionId:n}))}),3e3);return()=>clearInterval(f)}),[a,t,o,u,n]);const g=r.useMemo((()=>{if(n==null)return;const f=new URLSearchParams;o.moduleId!=null&&f.set("module_id",o.moduleId),o.level!=null&&f.set("level",o.level),o.outcome!=null&&f.set("outcome",o.outcome),o.search!=null&&o.search.trim()!==""&&f.set("search",o.search.trim());const h=f.toString();return`${ae?.invoicingMicroServiceBaseUrl??""}/1.0/data-import/${encodeURIComponent(n)}/issues.csv${h===""?"":`?${h}`}`}),[o,n]),S=v?.fetch.fetchState??"Not-Started";return N(S)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingDataImportHubPage,isReady:l!=null&&S!=="Not-Started"}),s.jsx(sa,{downloadUrl:g,filters:o,navigate:e,sessionId:n,tenantEmailDomain:i,view:d,onFiltersChange:c})]})}const Yn=t=>`invoicing_active_migration:${t}`,oe=(t,e)=>{if(t!=null&&t!=="")try{const n=Yn(t);e==null?sessionStorage.removeItem(n):sessionStorage.setItem(n,e)}catch{}},ra=O((function(t,e){const{sessions:n,sessionsFetch:i,statusFetch:a,statusRows:o}=e.view;return{isLoading:!(a.fetchState!=="Not-Started"&&a.fetchState!=="In-Progress"||o.length!==0||i.fetchState!=="Not-Started"&&i.fetchState!=="In-Progress"),sessions:n,statusRows:o}}),(function(t,e){const{navigate:n,tenantEmailDomain:i}=e,a=o=>{const c=o??null;t(ie(c)),oe(i,c),n(`/${i}/invoicing/data_import/migrate`)};return{onContinueSession:o=>{p.trackInvoicingActionClick(m.Event.invoicingImportSessionAction,{action:"continue",sessionId:o}),a(o)},onNewImport:()=>{p.trackInvoicingActionClick(m.Event.invoicingNewImportClicked),a()},onRetrySession:o=>{p.trackInvoicingActionClick(m.Event.invoicingImportSessionAction,{action:"retry",sessionId:o}),t(_e(o)),a(o)},onRollbackSession:o=>{p.trackInvoicingActionClick(m.Event.invoicingImportSessionAction,{action:"rollback",sessionId:o}),t(jn(o))},onViewSession:o=>{p.trackInvoicingActionClick(m.Event.invoicingImportSessionAction,{action:"view_details",sessionId:o}),n(`/${i}/invoicing/data_import/${encodeURIComponent(o)}`)}}}))(kt);function la(){const t=P(),e=L(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=T(),a=C(Te);r.useEffect((()=>{i&&(t(hi()),t(Dn()))}),[i,t]);const o=a.statusFetch.fetchState==="Completed"&&a.sessionsFetch.fetchState==="Completed";return s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingDataImportHubPage,isReady:o}),s.jsx(ra,{navigate:e,tenantEmailDomain:n,view:a})]})}const da=O((function(t,e){const{activeId:n,integrationsView:i,settings:a,view:o}=e,{actionStateByKind:c,sessionDetail:d,sessions:l}=o,v=i.externalConnections?.revenue?.find((g=>g.connectionName==="chargebee")),u=n!=null?d[n]:void 0;return{chargebeeConnected:a?.chargebee_connected===!0||(v?.isValid??!1),chargebeeConnectorAvailable:v!=null,chargebeeSite:a?.chargebee_site,connectError:c.connect?.error?.message,connecting:c.connect?.fetchState==="In-Progress",retrying:c.retry?.fetchState==="In-Progress",session:u??l.find((g=>g.id===n)),starting:c.start?.fetchState==="In-Progress",uploading:c.upload?.fetchState==="In-Progress"}}),(function(t,e){const{activeId:n,navigate:i,tenantEmailDomain:a}=e;return{onBack:e.onBack,onDownloadTemplates:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportTemplatesDownloaded);const o=ae?.invoicingMicroServiceBaseUrl,c=o!=null&&o.length>0?o:"";window.open(`${c}/1.0/data-import/templates`,"_blank","noopener")},onFetchFromChargebee:()=>{p.trackInvoicingActionClick(m.Event.invoicingChargebeeConnectClicked),t(Ei())},onGoToIntegrations:()=>{i(`/${a}/invoicing/settings`)},onGoToOverview:()=>i(`/${a}/invoicing/overview`),onRetry:()=>{n!=null&&t(_e(n))},onSaveLater:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportSavedForLater),e.onBack()},onStartImport:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportStarted),n!=null&&t(Ci(n))},onUpload:o=>{p.trackInvoicingActionClick(m.Event.invoicingImportFileUploaded),t(Ii({files:o}))},onViewDetails:n==null?void 0:()=>i(`/${a}/invoicing/data_import/${encodeURIComponent(n)}`)}}))(yt);function ua(){const t=P(),e=L(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=T(),a=C(In),o=C(Oe).companyId??ye.getSignedInUserTenant(n??"")?.companyId,c=C((f=>Pn(f,o))),d=C(Te),{activeMigrationSessionId:l}=d,v=l??void 0,u=v!=null?d.sessionDetail[v]??d.sessions.find((f=>f.id===v)):void 0;r.useEffect((()=>{i&&(t(Me()),t(Dn()))}),[i,t]),r.useEffect((()=>{if(l!=null)return;const f=(h=>{if(h==null||h==="")return null;try{return sessionStorage.getItem(Yn(h))}catch{return null}})(n);f!=null&&t(ie(f))}),[l,t,n]),r.useEffect((()=>{oe(n,l)}),[l,n]);const g=u?.status,S=g==="scanning"||g==="importing";return r.useEffect((()=>{if(!i||v==null||!S)return;const f=setInterval((()=>{t(De(v))}),3e3);return()=>clearInterval(f)}),[i,v,S,t]),r.useEffect((()=>{g==="done"&&(t(ie(null)),oe(n,null))}),[t,g,n]),s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingDataImportMigratePage}),s.jsx(da,{activeId:v,integrationsView:c,navigate:e,settings:a,tenantEmailDomain:n,view:d,onBack:()=>{t(ie(null)),oe(n,null),e(`/${n}/invoicing/data_import`)}})]})}const ga=O((function(t,e){const{editView:n}=e;return{fieldHelp:n.fieldHelp,coupon:n.coupon,discountLifecycleActionOptions:e.discountLifecycleActionOptions,discountsAccountName:n.discountsAccountName,isLoading:!e.hasLoadedRecord&&(n.pageFetchState.fetchState==="Not-Started"||n.pageFetchState.fetchState==="In-Progress"),isRunningLifecycleAction:e.isRunningLifecycleAction,isSaving:n.fetchState==="In-Progress"}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{couponId:i}=e;return{onBack:()=>e.navigate(`${n}/discounts`),onLifecycleAction:a=>{t(Ln({action:a,id:i}))},onSaveEdit:a=>{p.trackInvoicingActionClick(m.Event.invoicingCouponEdited,{couponId:i}),t(yi({data:a,id:i}))}}}))(xt);function ma(){const t=P(),e=L(),{coupon_id:n,tenantEmailDomain:i}=R(),{areTenantIdsInSync:a}=T(),o=C((h=>ki(h,n))),c=o.actionState.fetchState==="In-Progress",d=o.pageFetchState.fetchState,l=d==="Completed",[v,u]=r.useState(l?n:void 0);r.useEffect((()=>{n!=null&&l&&u(n)}),[n,l]);const g=v===n;r.useEffect((()=>(t(re({id:n})),()=>{t(re({id:n}))})),[n,t]),r.useEffect((()=>{a&&t(be({id:n}))}),[a,n,t]);const S=r.useCallback((h=>t(be({cacheOverride:!0,id:h}))),[t]),f=fe(o.fetchState,o.isFormLoading,n,S);return N(d)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingDiscountDetailPage,isReady:l}),s.jsx(ga,{hasLoadedRecord:g,couponId:n??"",discountLifecycleActionOptions:o.discountLifecycleActionOptions,editView:o,isRunningLifecycleAction:c,navigate:e,tenantEmailDomain:i},f)]})}const va=O((function(t){const e=An(t),{fetchState:n}=e;return{columns:e.columns,counts:e.count,discountLifecycleActionOptions:e.discountLifecycleActionOptions,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",coupons:e.coupons,hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.coupons.length===0,isLoadingMore:n==="In-Progress"&&e.coupons.length>0,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onStatusChange:e.onStatusChange,onSortChange:e.onSortChange,onCouponClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingDiscountRowClicked,{couponId:i}),e.navigate(`${n}/discounts/${encodeURIComponent(i)}`)},onCreateCoupon:()=>{p.trackInvoicingActionClick(m.Event.invoicingCreateCouponClicked),e.navigate(`${n}/discounts/new`)},onImportCsv:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportCsvClicked,{entity:"discounts"}),e.navigate(`${n}/data_import`)},onDiscountLifecycleAction:(i,a)=>{t(Ln({action:a,id:i}))},onLoadMore:()=>{e.nextCursor!=null&&t(bi({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(bt);function pa(){const t=P(),e=L(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=T(),[a,o]=r.useState(""),[c,d]=r.useState(""),[l,v]=r.useState(null),u=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),g=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:S,appliedSearch:f,appliedSort:h,nextCursor:D,couponListFetchState:b,runningDiscountActionId:k}=C((I=>{const j=An(I);return{activeStatus:j.activeTab,appliedSearch:j.filters.search,appliedSort:j.sort,nextCursor:j.nextCursor,couponListFetchState:j.fetchState,runningDiscountActionId:j.runningActionId??null}}),H),y=b==="Completed";return r.useEffect((()=>{const I=setTimeout((()=>d(a)),300);return()=>clearTimeout(I)}),[a]),r.useEffect((()=>{i&&t(Xe({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(g.search!==f||u?.field!==h?.field||u?.dir!==h?.dir)&&t(Xe({cacheOverride:!0,filters:g,sort:u}))}),[i,t,g,u,f,h]),N(b)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingDiscountsListPage,isReady:y}),s.jsx(va,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:a,sortState:l,filters:g,sort:u,nextCursor:D,runningDiscountActionId:k,onSearchChange:o,onStatusChange:I=>t(xi(I)),onSortChange:v})]})}const fa=O((function(t,e){const{readView:n}=e;return{fieldHelp:e.readView.fieldHelp,caseId:e.caseId,dunningAttempts:e.dunningAttempts,dunningCase:n.dunningCase,isLoading:n.fetchState==="Not-Started"||n.fetchState==="In-Progress",isRunningAction:n.actionState.fetchState==="In-Progress"}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{caseId:i}=e,a=i!=="";return{onBack:()=>e.navigate(`${n}/dunning`),onInvoiceClick:o=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{caseId:i,fromScreen:"dunning_detail",invoiceId:o,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(o)}`)},onCancel:a?()=>t(q({action:"cancel",id:i})):void 0,onResolve:a?()=>{p.trackInvoicingActionClick(m.Event.invoicingDunningAction,{action:"resolve",caseId:i}),t(q({action:"resolve",id:i}))}:void 0,onResume:a?()=>{p.trackInvoicingActionClick(m.Event.invoicingDunningAction,{action:"resume",caseId:i}),t(q({action:"resume",id:i}))}:void 0,onRetry:a?()=>{p.trackInvoicingActionClick(m.Event.invoicingDunningAction,{action:"retry",caseId:i}),t(q({action:"retry",id:i}))}:void 0}}))(Dt);function Sa(){const t=P(),e=L(),{case_id:n,tenantEmailDomain:i}=R(),{areTenantIdsInSync:a}=T(),o=C((E=>ji(E,n??""))),c=o.fetchState==="Completed",d=o.dunningCase?.invoiceID,[l,v]=r.useState("idle"),[u,g]=r.useState(!1),[S,f]=r.useState(),[h,D]=r.useState(!1),b=r.useCallback((()=>{v("idle"),g(!1),f(void 0),D(!1)}),[]),k=r.useCallback((()=>{if(n==null)return;t(Di({id:n})),v("idle"),g(!1);const E=o.emailPreview.preview;f(E==null?void 0:{body:E.body,cc:E.cc,subject:E.subject,to:E.to}),D(!0)}),[n,t,o.emailPreview.preview]),y=r.useCallback((E=>{n!=null&&l!=="pending"&&(g(!1),v("pending"),p.trackInvoicingActionClick(m.Event.invoicingDunningAction,{action:"send-email",caseId:n}),t(q({action:"send-email",body:E,id:n})))}),[n,t,l]),I=r.useMemo((()=>o.emailPreview.preview==null?void 0:{bodyToken:o.emailPreview.preview.bodyToken,renderedHtmlTemplate:o.emailPreview.preview.renderedHtmlTemplate,subjectToken:o.emailPreview.preview.subjectToken}),[o.emailPreview.preview]);r.useEffect((()=>{a&&n!=null&&t(Pi({id:n}))}),[a,n,t]),r.useEffect((()=>{a&&d!=null&&t(Ne({invoiceId:d}))}),[a,d,t]),r.useEffect((()=>{v("idle"),g(!1),f(void 0),D(!1)}),[n]),r.useEffect((()=>{a||(v("idle"),g(!1),f(void 0),D(!1))}),[a]),r.useEffect((()=>{h&&S==null&&o.emailPreview.preview!=null&&f({body:o.emailPreview.preview.body,cc:o.emailPreview.preview.cc,subject:o.emailPreview.preview.subject,to:o.emailPreview.preview.to})}),[o.emailPreview.preview,S,h]),r.useEffect((()=>{l==="pending"&&(o.actionState.fetchState!=="In-Progress"?u&&o.actionState.fetchState==="Completed"?(n!=null&&t(Li({id:n})),b()):u&&o.actionState.fetchState==="Error"&&v("failed"):g(!0))}),[n,b,t,l,u,o.actionState.fetchState]);const j=d!=null&&o.linkedInvoice?.id===d?o.linkedInvoice.dunningAttempts:void 0;return N(o.fetchState)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingDunningDetailPage,isReady:c}),s.jsx(fa,{navigate:e,tenantEmailDomain:i,caseId:n??"",readView:o,dunningAttempts:j,onSendEmail:k}),s.jsx(jt,{initialDraft:S,isPreviewLoading:o.emailPreview.fetchState==="Not-Started"||o.emailPreview.fetchState==="In-Progress",isSending:l==="pending",onClose:b,onSend:y,open:h,preview:I,previewErrorMessage:o.emailPreview.fetchState==="Error"?o.emailPreview.error?.message:void 0,sendErrorMessage:l==="failed"?o.actionState.error?.message:void 0})]})}const ha=O((function(t){const e=$n(t),{fetchState:n}=e;return{columns:e.columns,counts:e.count,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",dunningCases:e.dunningCases,hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.dunningCases.length===0,isLoadingMore:n==="In-Progress"&&e.dunningCases.length>0,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onStatusChange:e.onStatusChange,onImportCsv:()=>e.navigate(`${n}/data_import`),onDunningCaseClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingDunningCaseRowClicked,{caseId:i}),e.navigate(`${n}/dunning/${encodeURIComponent(i)}`)},onRowAction:(i,a)=>{a!=="retry"&&a!=="resume"&&a!=="resolve"&&a!=="cancel"||t(q({action:a,id:i}))},onLoadMore:()=>{e.nextCursor!=null&&t($i({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(Pt);function Ia(){const t=P(),e=L(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=T(),[a,o]=r.useState(""),[c,d]=r.useState(""),[l,v]=r.useState(null),u=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),g=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:S,appliedSearch:f,appliedSort:h,nextCursor:D,dunningCaseListFetchState:b}=C((y=>{const I=$n(y);return{activeStatus:I.activeTab,appliedSearch:I.filters.search,appliedSort:I.sort,nextCursor:I.nextCursor,dunningCaseListFetchState:I.fetchState}}),H),k=b==="Completed";return r.useEffect((()=>{const y=setTimeout((()=>d(a)),300);return()=>clearTimeout(y)}),[a]),r.useEffect((()=>{i&&t(en({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(g.search!==f||u?.field!==h?.field||u?.dir!==h?.dir)&&t(en({cacheOverride:!0,filters:g,sort:u}))}),[i,t,g,u,f,h]),N(b)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingDunningListPage,isReady:k}),s.jsx(ha,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:a,sortState:l,filters:g,sort:u,nextCursor:D,onSearchChange:o,onStatusChange:y=>t(Ai(y)),onSortChange:v})]})}const Ca=O((function(t,e){const{view:n}=e;return{fieldHelp:e.view.fieldHelp,billingAddress:n.billingAddress,invoice:n.invoice,invoiceId:e.invoiceId,shippingAddress:n.shippingAddress,isLoading:!e.hasLoadedRecord&&(n.pageFetchState.fetchState==="Not-Started"||n.pageFetchState.fetchState==="In-Progress"),isSaving:n.actionState.fetchState==="In-Progress",isVoiding:n.actionState.fetchState==="In-Progress"}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{invoiceId:i}=e;return{onBack:()=>e.navigate(`${n}/invoices`),onCustomerClick:a=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{customerId:a,fromScreen:"invoice_detail",toScreen:"customer"}),e.navigate(`${n}/customers/${encodeURIComponent(a)}`)},onIssueCreditNote:()=>{p.trackInvoicingActionClick(m.Event.invoicingCreditNoteIssued,{invoiceId:i}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}/issue-credit-note`)},onRecordPayment:()=>{p.trackInvoicingActionClick(m.Event.invoicingRecordPaymentClicked,{fromScreen:"invoice_detail",invoiceId:i}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}/record-payment`)},onRegenerate:()=>{p.trackInvoicingActionClick(m.Event.invoicingInvoiceRegenerated,{invoiceId:i}),t(V({action:"regenerate",invoiceId:i}))},onSaveEdit:a=>{p.trackInvoicingActionClick(m.Event.invoicingInvoiceEdited,{invoiceId:i}),t(wi({data:{due_date:a.due_date!==""?a.due_date:void 0,notes:a.notes.trim()!==""?a.notes.split(`
|
|
2
|
+
`).map((o=>o.trim())).filter((o=>o!=="")).map((o=>({note:o}))):void 0,po_number:a.po_number!==""?a.po_number:null},invoiceId:i}))},onSendReminder:()=>{p.trackInvoicingActionClick(m.Event.invoicingInvoiceReminderSent,{invoiceId:i}),t(V({action:"send-reminder",invoiceId:i}))},onSubscriptionClick:a=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{fromScreen:"invoice_detail",subscriptionId:a,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(a)}`)},onVoid:a=>{p.trackInvoicingActionClick(m.Event.invoicingInvoiceVoided,{invoiceId:i}),t(V({action:"void",invoiceId:i,body:a}))}}}))(Lt);function Ea(){const t=P(),e=L(),{invoice_id:n,tenantEmailDomain:i}=R(),{areTenantIdsInSync:a}=T(),o=C((g=>Fn(g,n??""))),c=o.pageFetchState.fetchState,d=c==="Completed",[l,v]=r.useState(d?n:void 0);r.useEffect((()=>{n!=null&&d&&v(n)}),[n,d]);const u=l===n;return r.useEffect((()=>{a&&n!=null&&t(Fi({invoiceId:n}))}),[a,n,t]),N(c)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingInvoiceDetailPage,isReady:d}),s.jsx(Ca,{invoiceId:n??"",hasLoadedRecord:u,navigate:e,tenantEmailDomain:i,view:o})]})}const ka=O((function(t){const e=wn(t),{fetchState:n}=e;return{counts:e.counts,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",hasMore:e.nextCursor!=null,invoices:e.invoices,statusOptions:e.statusOptions,isLoading:n==="Not-Started"||n==="In-Progress"&&e.invoices.length===0,isLoadingMore:n==="In-Progress"&&e.invoices.length>0,kpis:e.kpis,kpisLoading:e.kpisFetchState.fetchState==="Not-Started"||e.kpisFetchState.fetchState==="In-Progress"&&e.kpis==null,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onStatusChange:e.onStatusChange,onCreateInvoice:()=>{p.trackInvoicingActionClick(m.Event.invoicingCreateInvoiceClicked),e.navigate(`${n}/invoices/create`)},onImportCsv:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportCsvClicked,{entity:"invoices"}),e.navigate(`${n}/data_import`)},onInvoiceClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingInvoiceRowClicked,{invoiceId:i}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}`)},onRowAction:(i,a)=>{switch(a){case"recordPayment":e.navigate(`${n}/invoices/${encodeURIComponent(i)}/record-payment`);break;case"issueCreditNote":e.navigate(`${n}/invoices/${encodeURIComponent(i)}/issue-credit-note`);break;case"sendReminder":t(V({action:"send-reminder",invoiceId:i}));break;case"regenerate":t(V({action:"regenerate",invoiceId:i}));break;case"void":t(V({action:"void",invoiceId:i}))}},onVoidInvoice:(i,a)=>{p.trackInvoicingActionClick(m.Event.invoicingInvoiceVoided,{invoiceId:i}),t(V({action:"void",invoiceId:i,body:a}))},onLoadMore:()=>{e.nextCursor!=null&&t(Rn({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(At);function ya(){const t=P(),e=L(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=T(),[a,o]=r.useState(""),[c,d]=r.useState(""),[l,v]=r.useState(null),u=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),g=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:S,appliedSearch:f,appliedSort:h,nextCursor:D,invoiceListFetchState:b,voidingInvoiceId:k}=C((I=>{const j=wn(I);return{activeStatus:j.activeTab,appliedSearch:j.filters.search,appliedSort:I.invoicingInvoiceListState.sort,nextCursor:j.nextCursor,invoiceListFetchState:j.fetchState,voidingInvoiceId:j.runningActionId}}),H),y=b==="Completed";return r.useEffect((()=>{const I=setTimeout((()=>d(a)),300);return()=>clearTimeout(I)}),[a]),r.useEffect((()=>{i&&t(Ie({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(g.search!==f||u?.field!==h?.field||u?.dir!==h?.dir)&&t(Ie({cacheOverride:!0,filters:g,sort:u}))}),[i,t,g,u,f,h]),N(b)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingInvoicesListPage,isReady:y}),s.jsx(ka,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:a,sortState:l,filters:g,sort:u,nextCursor:D,voidingInvoiceId:k,onSearchChange:o,onStatusChange:I=>{t(Ri(I)),t(Ie({cacheOverride:!1,filters:g,sort:u}))},onSortChange:v})]})}function rn(){const t=P(),e=L(),{tenantEmailDomain:n}=R(),i=$t(),a=mn(),[o,c]=r.useState(!1),{acceptTermsState:d,status:l}=C(Tn),v=Ti(i?.loggedInUserRoleMap),u=`/${n}/invoicing`,g=S=>{c(S)};return l==="completed"?s.jsx(B,{to:`${u}/overview`,replace:!0}):l==="settings"&&v?s.jsx(B,{to:`${u}/settings`,replace:!0}):s.jsxs(s.Fragment,{children:[s.jsx(Ro,{isAppContentDrawerOpen:o,handleDrawerToggle:g}),s.jsx(Ft,{analytics:p,isAccepting:d.fetchState==="In-Progress",isReadOnlyUser:!v,meetingUrl:a("invoicing_promo"),onAcceptClick:()=>{t(_i())},onBackClick:()=>{e(`/${n}`)},onClickMenuIcon:()=>{g(!0)}})]})}const xa=O((function(t,e){const n=_n(t,e.invoiceId),{invoice:i,localData:a,reasonCodeOptions:o,submitState:c,typeOptions:d}=n;return{fieldHelp:n.fieldHelp,amountDue:i?.amountDue,currencyCode:i?.currencyCode??"USD",customerName:i?.customerName??"",errorMessage:c.fetchState==="Error"?c.error?.message??"Failed to issue credit note. Please try again.":void 0,invoiceNumber:i?.invoiceNumber??e.invoiceId,isSubmitting:c.fetchState==="In-Progress",localData:a,reasonCodeOptions:o,typeOptions:d}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing/invoices/${encodeURIComponent(e.invoiceId)}`,i=()=>e.navigate(n);return{onBack:i,onCancel:i,onChange:a=>{t(Bi({localData:a}))},onSubmit:()=>{p.trackInvoicingActionClick(m.Event.invoicingCreditNoteIssued,{invoiceId:e.invoiceId}),t(Ui())}}}))(wt);function ba(){const t=P(),e=L(),{invoice_id:n,tenantEmailDomain:i}=R(),{areTenantIdsInSync:a}=T(),{fetchState:o,invoice:c,isPageReady:d,issuedCreditNoteId:l,submitState:v}=C((f=>_n(f,n??""))),u=`/${i}/invoicing`,g=r.useRef(null);r.useEffect((()=>{t(Oi()),g.current=null}),[t,n]),r.useEffect((()=>{a&&n!=null&&t(Ne({invoiceId:n}))}),[a,t,n]),r.useEffect((()=>{c!=null&&n!=null&&o==="Completed"&&g.current!==n&&(g.current=n,t(Mi({localData:Ni(c)})))}),[t,o,c,n]);const S=r.useRef(v.fetchState);return r.useEffect((()=>{const f=S.current;S.current=v.fetchState,f!=="Completed"&&v.fetchState==="Completed"&&l!=null&&e(`${u}/credits/${encodeURIComponent(l)}`)}),[l,e,v.fetchState,u]),s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingInvoiceDetailPage,isReady:d}),s.jsx(xa,{invoiceId:n??"",navigate:e,tenantEmailDomain:i})]})}const ja=O((function(t){return{invoicingOverview:On(t)}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{onRefresh:()=>{t(Mn(e.selectedPeriod,!0))},onSubscriptionClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingSubscriptionTileClicked,{subscriptionId:i}),e.navigate(`${n}/subscriptions/${i}`)},onViewInvoices:()=>{p.trackInvoicingActionClick(m.Event.invoicingViewInvoicesClicked),e.navigate(`${n}/invoices`)},onViewPayments:()=>{p.trackInvoicingActionClick(m.Event.invoicingViewPaymentsClicked),e.navigate(`${n}/payments`)}}}))(Rt);function Da(){const t=P(),e=L(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=T(),[a]=r.useState((()=>{const c=new Date;return{month:c.getMonth()+1,year:c.getFullYear()}})),o=C((c=>On(c).fetchState))==="Completed";return r.useEffect((()=>{i&&t(Mn(a))}),[i,t,a]),s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingOverviewPage,isReady:o}),s.jsx(ja,{navigate:e,selectedPeriod:a,tenantEmailDomain:n})]})}const Pa=O((function(t){const e=Nn(t),{fetchState:n}=e;return{columns:e.columns,hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.transactions.length===0,isLoadingMore:n==="In-Progress"&&e.transactions.length>0,tabIds:e.tabIds,transactions:e.transactions}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{activeType:e.activeType,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onTypeChange:e.onTypeChange,onViewTransactionCustomer:e.onViewTransactionCustomer,onViewTransactionInvoice:e.onViewTransactionInvoice,onImportCsv:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportCsvClicked,{entity:"payments"}),e.navigate(`${n}/data_import`)},onTransactionClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingPaymentRowClicked,{transactionId:i}),e.navigate(`${n}/payments/${encodeURIComponent(i)}`)},onLoadMore:()=>{e.nextCursor!=null&&t(Hi({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(Tt);function La(){const t=P(),e=L(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=T(),[a,o]=r.useState(""),[c,d]=r.useState(""),[l,v]=r.useState(null),u=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),g=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeType:S,appliedSearch:f,appliedSort:h,nextCursor:D,transactionListFetchState:b,transactions:k}=C((F=>{const A=Nn(F);return{activeType:A.activeTab,appliedSearch:A.filters.search,appliedSort:A.sort,nextCursor:A.nextCursor,transactionListFetchState:A.fetchState,transactions:A.transactions}}),H),y=b==="Completed",I=`/${n}/invoicing`,j=r.useCallback((F=>{const A=k.find((_=>_.id===F)),U=A?.linkedInvoices?.[0]?.invoiceID??A?.invoiceID;U!=null&&(p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{fromScreen:"payments_list",invoiceId:U,toScreen:"invoice"}),e(`${I}/invoices/${encodeURIComponent(U)}`))}),[e,I,k]),E=r.useCallback((F=>{const A=k.find((U=>U.id===F))?.customerID;A!=null&&(p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{customerId:A,fromScreen:"payments_list",toScreen:"customer"}),e(`${I}/customers/${encodeURIComponent(A)}`))}),[e,I,k]);return r.useEffect((()=>{const F=setTimeout((()=>d(a)),300);return()=>clearTimeout(F)}),[a]),r.useEffect((()=>{i&&t(Ce({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(g.search!==f||u?.field!==h?.field||u?.dir!==h?.dir)&&t(Ce({cacheOverride:!0,filters:g,sort:u}))}),[i,t,g,u,f,h]),N(b)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingPaymentsListPage,isReady:y}),s.jsx(Pa,{navigate:e,tenantEmailDomain:n,activeType:S,searchValue:a,sortState:l,filters:g,sort:u,nextCursor:D,onSearchChange:o,onTypeChange:F=>{t(Vi(F)),t(Ce({cacheOverride:!1,filters:g,sort:u}))},onSortChange:v,onViewTransactionCustomer:E,onViewTransactionInvoice:j})]})}const Aa=t=>{const e=[t.firstName,t.lastName].filter((n=>n!=null&&n.trim()!=="")).join(" ").trim();return(t.company!=null&&t.company.trim()!==""?t.company.trim():"")||e||(t.email!=null&&t.email.trim()!==""?t.email.trim():"")||t.id};function ln(){const t=P(),e=L(),{invoice_id:n,tenantEmailDomain:i}=R(),{areTenantIdsInSync:a}=T(),o=n!=null&&n!=="",c=C(ve),d=C((E=>qi(E))),l=C(zi),v=C((E=>Fn(E,n??""))),u=v.invoice,g=`/${i}/invoicing`,S=r.useRef(null),f=r.useRef("");r.useEffect((()=>{t(Zi()),S.current=null,f.current=""}),[t,n]),r.useEffect((()=>{a&&t(o&&n!=null?Ne({invoiceId:n}):bn({filters:{},keepExistingListItems:!1}))}),[a,t,n,o]),r.useEffect((()=>{o&&u!=null&&n!=null&&v.fetchState==="Completed"&&S.current!==n&&(S.current=n,t(Qi({contextInvoiceId:n,localData:Ki(u)})))}),[t,u,n,v.fetchState,o]),r.useEffect((()=>{if(o)return;const E=d.localData.customerId;E!==""&&E!==f.current&&(f.current=E,t(Rn({filters:{customerId:E},keepExistingListItems:!1})),d.localData.invoiceToLink!==""&&t(nn({localData:{...d.localData,customerId:E,invoiceToLink:""}})))}),[t,d.localData,o]);const h=r.useRef(l.fetchState);r.useEffect((()=>{const E=h.current;if(h.current=l.fetchState,E!=="Completed"&&l.fetchState==="Completed"){if(l.recordedInvoiceId!=null)return void e(`${g}/invoices/${encodeURIComponent(l.recordedInvoiceId)}`);e(`${g}/payments`)}}),[e,l.fetchState,l.recordedInvoiceId,g]);const D=r.useMemo((()=>c.customers.map((E=>({id:E.id,name:Aa(E)})))),[c.customers]),b=C((E=>Gi(E,d.localData.customerId))),k=r.useMemo((()=>b.map((E=>{return{amountDue:(F=E.amountDue,A=Wi.currencySymbol,Ot("0,0.00",F,A)),amountDueValue:E.amountDue,id:E.id,label:E.invoiceNumber};var F,A}))),[b]),y=r.useMemo((()=>{if(!o||u==null)return;const E=u.currencyCode??"USD",F=u.amountDue?.amount??0;return{amountDue:$e("0,0.00",u.amountDue),amountDueValue:F,currencyCode:E,customerName:u.customerName??u.customerID,invoiceId:u.id,invoiceNumber:u.invoiceNumber??u.id}}),[u,o]),I=o?`${g}/invoices/${encodeURIComponent(n??"")}`:`${g}/payments`,j=!o||v.fetchState==="Completed"&&d.localData.invoiceToLink!=="";return s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingRecordPaymentPage,isReady:j}),s.jsx(_t,{customers:D,fieldHelp:d.fieldHelp,errorMessage:l.fetchState==="Error"?l.error?.message??"Failed to record payment. Please try again.":void 0,gatewayOptions:d.gatewayOptions,invoiceContext:y,invoiceOptions:k,isSubmitting:l.fetchState==="In-Progress",localData:d.localData,mode:o?"invoice":"customer",paymentMethodOptions:d.paymentMethodOptions,onBack:()=>{e(I)},onCancel:()=>{p.trackInvoicingActionClick(m.Event.invoicingRecordPaymentCancelled),e(I)},onChange:E=>{t(nn({localData:E}))},onSubmit:()=>{p.trackInvoicingActionClick(m.Event.invoicingPaymentRecorded,{customerId:d.localData.customerId,invoiceId:o?n:d.localData.invoiceToLink,paymentMethod:d.localData.paymentMethod}),t(Yi(o?n??void 0:void 0))}})]})}const Jn=(t,e,n)=>{const i=`/${t}/invoicing/subscriptions/`;return n!=null?`${i}${encodeURIComponent(n)}/${e}/`:`${i}new/${e}/`},$a=(t,e)=>{if(t==null)return;const n=$e("0,0",t);return e!=null?`${n}/${e}`:n},Xn=(t,e,n)=>{const i=[t,$a(e,n)].filter((a=>a!=null&&a!=="")).join(" · ");return i!==""?i:void 0},dn=t=>t.priceCode!=null&&t.priceCode.trim()!=="",Fa=t=>({billingCycles:t.billingCycles,billingPeriod:t.period,billingPeriodUnit:t.periodUnit,label:t.name??t.id,subtitle:Xn(t.productCode,t.price,t.periodUnit),value:t.priceCode}),wa=t=>({label:t.name??t.couponCode??t.id,value:t.couponCode??t.id}),Ra=O((function(t,e){const{editView:n}=e,i=n.subscription,a=i?.status,o=a!=null&&e.commercialEditAllowedFromStatuses.includes(a);return{cancelReasonCodeOptions:n.cancelReasonCodeOptions,fieldHelp:n.fieldHelp,addons:n.products.filter((c=>c.itemType==="addon")).filter(dn).map((c=>({label:c.name??c.id,subtitle:Xn(c.productCode,c.price,c.periodUnit),value:c.priceCode}))),canEditCommercial:o,coupons:n.coupons.map(wa),isLoading:!e.hasLoadedRecord&&(n.pageFetchState.fetchState==="Not-Started"||n.pageFetchState.fetchState==="In-Progress"||n.isFormLoading),isRunningAction:n.actionState.fetchState==="In-Progress",isSaving:n.fetchState==="In-Progress",lifecycleActionOptions:e.lifecycleActionOptions,localData:n.localData,plans:n.plans.filter(dn).map(Fa),shippingAddressLabel:n.shippingAddressLabel,hasUnsavedShippingAddress:n.hasUnsavedShippingAddress,subscription:i}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{subscriptionId:i}=e,a=i!=="",o=(c,d)=>{p.trackInvoicingActionClick(m.Event.invoicingSubscriptionLifecycleAction,{action:c,subscriptionId:i}),t(Bn({action:c,id:i,body:d}))};return{onBack:()=>e.navigate(`${n}/subscriptions`),onChange:c=>{t(de({id:i,localData:c}))},onChangeTermEnd:a?c=>{const d=c?.trim()??"";d!==""&&o("change_term_end",{term_ends_at:d})}:void 0,onCustomerClick:c=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{customerId:c,fromScreen:"subscription_detail",toScreen:"customer"}),window.open(`${n}/customers/${encodeURIComponent(c)}`,"_blank","noopener,noreferrer")},onDiscardEdit:()=>{t(Y(ue)),t(eo({id:i}))},onOpenAddress:()=>{const c=Jn(e.tenantEmailDomain??"",ue,i),d=W(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(c,{state:{pathnameStackToGoBack:d}})},onViewInvoices:()=>e.navigate(`${n}/invoices`),onSaveEdit:c=>{p.trackInvoicingActionClick(m.Event.invoicingSubscriptionEdited,{subscriptionId:i}),t(de({id:i,localData:c})),t(Un({id:i}))},onCancelSubscription:a?c=>{o("cancel",{cancel_reason_code:c.cancelReasonCode,end_of_term:!1,...c.cancelReason!=null&&c.cancelReason.trim()!==""?{cancel_reason:c.cancelReason.trim()}:{}})}:void 0,onLifecycleAction:a?(c,d)=>{c!=="pause"?o(c):o(c,d!=null&&d.trim()!==""?{resume_date:d.trim()}:void 0)}:void 0}}))(Mt);function Ta(){const t=P(),e=L(),n=G(),{subscription_id:i,tenantEmailDomain:a}=R(),{areTenantIdsInSync:o}=T(),c=C((k=>Ue(k,i))),{subscriptionCommercialEditAllowedFromStatuses:d,subscriptionLifecycleActionOptions:l,subscriptionMetadataEditAllowedFromStatuses:v}=c,u=c.pageFetchState.fetchState,g=u==="Completed"&&!c.isFormLoading,[S,f]=r.useState(g?i:void 0);r.useEffect((()=>{i!=null&&g&&f(i)}),[i,g]);const h=S===i;pe(o),r.useEffect((()=>{o&&i!=null&&t(Ji({id:i}))}),[o,i,t]);const D=r.useCallback((k=>t(Xi({id:k}))),[t]),b=fe(c.fetchState,c.isFormLoading,i,D);return N(u)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingSubscriptionDetailPage,isReady:g}),s.jsx(Ra,{hasLoadedRecord:h,commercialEditAllowedFromStatuses:d,editView:c,lifecycleActionOptions:l,location:n,metadataEditAllowedFromStatuses:v,navigate:e,subscriptionId:i??"",tenantEmailDomain:a},b)]})}const _a=t=>{const e=[t.firstName,t.lastName].filter((n=>n!=null&&n.trim()!=="")).join(" ").trim();return(t.company!=null&&t.company.trim()!==""?t.company.trim():"")||e||(t.email!=null&&t.email.trim()!==""?t.email.trim():"")||t.id},Oa=(t,e)=>{if(t==null)return;const n=$e("0,0",t);return e!=null?`${n}/${e}`:n},Ae=(t,e,n)=>{const i=[t,Oa(e,n)].filter((a=>a!=null&&a!=="")).join(" · ");return i!==""?i:void 0},Ma=t=>({label:_a(t),value:t.id}),ke=t=>t.priceCode!=null&&t.priceCode.trim()!=="",Na=t=>({billingCycles:t.billingCycles,billingPeriod:t.period,billingPeriodUnit:t.periodUnit,label:t.name??t.id,subtitle:Ae(t.productCode,t.price,t.periodUnit),trialPeriod:t.trialPeriod,trialPeriodUnit:t.trialPeriodUnit,value:t.priceCode}),Ua=t=>({label:t.name??t.couponCode??t.id,value:t.couponCode??t.id}),Ba=O((function(t,e){const n=Ue(t,e.subscriptionId);return{fieldHelp:n.fieldHelp,addons:n.products.filter((i=>i.itemType==="addon")).filter(ke).map((i=>({label:i.name??i.id,subtitle:Ae(i.productCode,i.price,i.periodUnit),value:i.priceCode}))),charges:n.products.filter((i=>i.itemType==="charge")).filter(ke).map((i=>({label:i.name??i.id,subtitle:Ae(i.productCode,i.price,void 0),value:i.priceCode}))),coupons:n.coupons.map(Ua),customers:n.customers.map(Ma),errorMessage:n.fetchState==="Error"?n.error?.message??"Failed to save subscription.":void 0,isSubmitting:n.fetchState==="In-Progress",isLoading:n.isFormLoading,localData:n.localData,mode:n.mode,plans:n.plans.filter(ke).map(Na),shippingAddressLabel:n.shippingAddressLabel}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{subscriptionId:i}=e,a=i!=null?"edit":"create";return{onCancel:()=>{p.trackInvoicingActionClick(m.Event.invoicingSubscriptionFormCancelled),t(Vn({id:i})),t(Y(ue)),i==null?e.navigate(`${n}/subscriptions`):e.navigate(`${n}/subscriptions/${encodeURIComponent(i)}`)},onChange:o=>{t(de({id:i,localData:o}))},onOpenAddress:()=>{const o=Jn(e.tenantEmailDomain??"",ue,i),c=W(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(o,{state:{pathnameStackToGoBack:c}})},onSubmit:()=>{p.trackInvoicingActionClick(m.Event.invoicingSubscriptionSaved,{mode:a}),t(Un({id:i}))}}}))(Nt);function Va(){const t=P(),e=L(),n=G(),{subscription_id:i,tenantEmailDomain:a}=R(),[o]=K(),{areTenantIdsInSync:c}=T(),d=o.get("customerId"),{fetchState:l,savedSubscriptionId:v}=C((S=>no(S,i))),u=C((S=>Ue(S,i).localData));pe(c),r.useEffect((()=>{c&&t(to({subscriptionId:i}))}),[c,i,t]);const g=r.useRef(!1);return r.useEffect((()=>{g.current||i!=null||d==null||d===""||u.customerId!==""||(g.current=!0,t(de({id:i,localData:{...u,customerId:d}})))}),[d,i,u,t]),r.useEffect((()=>{if(l==="Completed"){const S=v??i,f=S!=null?`/${a}/invoicing/subscriptions/${encodeURIComponent(S)}`:`/${a}/invoicing/subscriptions`;e(f),t(Vn({id:i}))}}),[l,v,i,t,e,a]),s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingSubscriptionFormPage}),s.jsx(Ba,{location:n,navigate:e,subscriptionId:i,tenantEmailDomain:a})]})}const Ha=O((function(t){const e=Hn(t),{fetchState:n}=e;return{columns:e.columns,counts:e.count,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.subscriptions.length===0,isLoadingMore:n==="In-Progress"&&e.subscriptions.length>0,cancelReasonCodeOptions:e.cancelReasonCodeOptions,lifecycleActionOptions:e.subscriptionLifecycleActionOptions,subscriptions:e.subscriptions,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,i=(a,o,c)=>{p.trackInvoicingActionClick(m.Event.invoicingSubscriptionLifecycleAction,{action:o,subscriptionId:a}),t(Bn({action:o,id:a,body:c}))};return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onStatusChange:e.onStatusChange,onAddSubscription:()=>{p.trackInvoicingActionClick(m.Event.invoicingAddSubscriptionClicked),e.navigate(`${n}/subscriptions/new`)},onImportCsv:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportCsvClicked,{entity:"subscriptions"}),e.navigate(`${n}/data_import`)},onChangeTermEnd:(a,o)=>{const c=o?.trim()??"";c!==""&&i(a,"change_term_end",{term_ends_at:c})},onSubscriptionAction:(a,o,c)=>{o!=="pause"?i(a,o):i(a,o,c!=null&&c.trim()!==""?{resume_date:c.trim()}:void 0)},onCancelSubscription:(a,o)=>{i(a,"cancel",{cancel_reason_code:o.cancelReasonCode,end_of_term:!1,...o.cancelReason!=null&&o.cancelReason.trim()!==""?{cancel_reason:o.cancelReason.trim()}:{}})},onSubscriptionClick:a=>{p.trackInvoicingActionClick(m.Event.invoicingSubscriptionRowClicked,{subscriptionId:a}),e.navigate(`${n}/subscriptions/${encodeURIComponent(a)}`)},onViewSubscriptionInvoices:()=>{e.navigate(`${n}/invoices`)},onLoadMore:()=>{e.nextCursor!=null&&t(ao({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(Ut);function qa(){const t=P(),e=L(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=T(),[a,o]=r.useState(""),[c,d]=r.useState(""),[l,v]=r.useState(null),u=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),g=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:S,appliedSearch:f,appliedSort:h,nextCursor:D,subscriptionListFetchState:b,runningActionSubscriptionId:k}=C((j=>{const E=Hn(j);return{activeStatus:E.activeTab,appliedSearch:E.filters.search,appliedSort:E.sort,nextCursor:E.nextCursor,subscriptionListFetchState:E.fetchState,runningActionSubscriptionId:E.runningActionId??null}}),H),y=b==="Completed";r.useEffect((()=>{const j=setTimeout((()=>d(a)),300);return()=>clearTimeout(j)}),[a]),r.useEffect((()=>{i&&t(tn({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(g.search!==f||u?.field!==h?.field||u?.dir!==h?.dir)&&t(tn({cacheOverride:!0,filters:g,sort:u}))}),[i,t,g,u,f,h]);const I=r.useRef(k);return r.useEffect((()=>{const j=I.current!=null&&k==null;I.current=k,j&&i&&t(io())}),[k,i,t]),N(b)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingSubscriptionsListPage,isReady:y}),s.jsx(Ha,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:a,sortState:l,filters:g,sort:u,nextCursor:D,runningActionSubscriptionId:k,onSearchChange:o,onStatusChange:j=>t(oo(j)),onSortChange:v})]})}const za=O((function(t,e){const{readView:n}=e;return{isLoading:n.fetchState==="Not-Started"||n.fetchState==="In-Progress",isRunningAction:n.actionState.fetchState==="In-Progress",transaction:n.transaction,transactionId:e.transactionId}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{transactionId:i}=e;return{onBack:()=>e.navigate(`${n}/payments`),onCustomerClick:a=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{customerId:a,fromScreen:"transaction_detail",toScreen:"customer"}),e.navigate(`${n}/customers/${encodeURIComponent(a)}`)},onInvoiceClick:a=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{fromScreen:"transaction_detail",invoiceId:a,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(a)}`)},onSubscriptionClick:a=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{fromScreen:"transaction_detail",subscriptionId:a,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(a)}`)},onCapture:i!==""?()=>{p.trackInvoicingActionClick(m.Event.invoicingTransactionCaptured,{transactionId:i}),t(ro({action:"capture",id:i}))}:void 0}}))(Bt);function Za(){const t=P(),e=L(),{tenantEmailDomain:n,transaction_id:i}=R(),{areTenantIdsInSync:a}=T(),o=C((d=>so(d,i??""))),c=o.fetchState==="Completed";return r.useEffect((()=>{a&&i!=null&&t(co({id:i}))}),[a,i,t]),N(o.fetchState)?s.jsx(M,{}):s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingTransactionDetailPage,isReady:c}),s.jsx(za,{navigate:e,tenantEmailDomain:n,transactionId:i??"",readView:o})]})}function et(t={}){const{enabled:e=!0,fetchSyncHealth:n=!1,loadAccountingPickers:i=!1,reuseCached:a=!1}=t,o=P(),{areTenantIdsInSync:c}=T(),d=C(Be),l=d.connection?.connected===!0,v=d.connectionFetchState.fetchState;return r.useEffect((()=>{e&&c&&(a&&v!=="Not-Started"||o(qn()),n&&o(lo()))}),[c,o,e,n,a]),r.useEffect((()=>{e&&c&&l&&i&&o(uo())}),[c,o,e,l,i]),{isQboConnected:l,qboView:d}}const Qa={branding:"invoicing_branding_save",dunning:"invoicing_dunning_settings_save",quickbooks:"invoicing_qbo_settings_save"};function J(t){const e=P(),{areTenantIdsInSync:n}=T(),{tenantEmailDomain:i}=R(),{fetchState:a,fieldHelp:o,logoFile:c,saveState:d,settings:l,stripeConnectState:v}=C(go),{configError:u,configFetchState:g,dunningScheduleActionOptions:S,qboAccountMappingKindOptions:f,qboCustomerMatchingOptions:h,qboSyncStatusOptions:D}=C(zn),b=C(Be);et({enabled:t==="quickbooks",fetchSyncHealth:!0,loadAccountingPickers:!0});const k=C(Oe),y=t==="dunning"||t==="quickbooks",I=k.companyId??ye.getSignedInUserTenant(i??"")?.companyId,j=C((w=>Pn(w,I))),E=mo(k.userRole??[]),F=k.tenantId??"",A=ye.getSignedInUser(),U={userId:A?.userId??"",sessionId:A?.zeniSessionId??"",tenantId:F},_=c?.fileId,X=C((w=>_!=null&&_!==""?vo(w,_):void 0)),Ve=C((w=>_!=null&&_!==""?po(w,_):void 0)),nt=_!=null&&_!==""&&X!=null?{[_]:X}:{},tt=_!=null&&_!==""&&Ve!=null?{[_]:Ve}:{};r.useEffect((()=>(e(on()),()=>{e(on())})),[e]),r.useEffect((()=>{n&&(a!=="Not-Started"&&a!=="Error"||e(Me()))}),[n,e,a]),r.useEffect((()=>{n&&y&&g==="Not-Started"&&e(ge())}),[n,e,g,y]),r.useEffect((()=>{if(!n)return;const w=A?.userId;w!=null&&w!==""&&F!==""&&ze.shouldFetchActiveTenant(F)&&(ze.markActiveTenantFetchStarted(F),e(fo(w,F,A?.zeniSessionId)))}),[n,e,A?.userId,A?.zeniSessionId,F]);const it=S.length>0||f.length>0,ot=a==="Not-Started"||a==="In-Progress"&&l==null||y&&!it&&(g==="Not-Started"||g==="In-Progress"),at=a==="Completed"&&(!y||g==="Completed"),He=j.externalConnections?.revenue?.find((w=>w.connectionName==="chargebee"))?.connectionId,Se=ae?.invoicingMicroServiceBaseUrl,qe=Se!=null&&Se.length>0?`${Se}/1.0/webhooks/stripe`:"",he={deleteConnectionError:j.externalConnections?.deleteConnectionError?.message,deleteConnectionState:j.externalConnections?.deleteConnectionState??"Not-Started",integrationsView:j,isAdmin:E,isStripeBusy:v.fetchState==="In-Progress",onConnectStripe:w=>e(sn(w)),onDisconnect:(w,z)=>{F!==""&&e(yo(F,w,cn(z)))},onDisconnectStripe:()=>e(an()),onReconnectQBO:()=>{const w=k.tenantEmailDomain??i??"";me.init("/connection/auth",w),me.handleClick()},onRefreshQBO:()=>{j.integrations.refreshQBO.fetchState!=="In-Progress"&&e(Kn())},onSaveChargeBeeCredentials:(w,z)=>{He!=null&&F!==""&&e(Eo(F,He,cn("revenue"),ko("chargebee"),{api_key:w,site:z}))},saveChargeBeeError:j.externalConnections?.saveAPIKeyConnectionError?.message,saveChargeBeeState:j.externalConnections?.saveAPIKeyConnectionState??"Not-Started",settings:l,stripeError:v.fetchState==="Error"?v.error?.message??"Failed to connect Stripe. Check your keys and try again.":void 0,stripeWebhookUrl:qe};return{authParams:U,deleteFileStatusById:nt,fieldHelp:o,dunningScheduleActionOptions:S,filesEndPoint:ae?.fileMicroServiceBaseUrl??"",integrationsSectionProps:he,isInvoicingPageReady:at,isLoading:ot,isSaving:d.fetchState==="In-Progress",isStripeBusy:v.fetchState==="In-Progress",logoFile:c,qboAccountMappingKindOptions:f,qboCustomerMatchingOptions:h,qboSyncStatusOptions:D,qboView:b,saveErrorMessage:d.fetchState==="Error"?d.error?.message??"Failed to save settings.":y&&g==="Error"?u?.message??"Failed to load invoicing configuration.":void 0,settings:l,stripeError:v.fetchState==="Error"?v.error?.message??"Failed to connect Stripe. Check your keys and try again.":void 0,stripeWebhookUrl:qe,updateFileStatusById:tt,onConnectStripe:w=>e(sn(w)),onDeleteFile:w=>e(Co(w,F)),onDisconnectStripe:()=>e(an()),onEditFileName:(w,z)=>e(Io(w,z,F)),onReconnectQBO:he.onReconnectQBO,onRefreshQBO:he.onRefreshQBO,onRetryQboSyncTask:w=>e(Qn(w)),onSave:w=>{p.trackInvoicingActionClick(m.Event.invoicingSettingsSaved,{tab:t??"hub"}),e(ho({settings:w,snackbarSection:Qa[t??""]}))},onStartQboBackfill:w=>e(Zn(w)),updateFilesEntity:w=>{p.trackInvoicingActionClick(m.Event.invoicingLogoUploaded),e(So({files:w}))}}}function un({appContent:t}){const e=L(),n=G(),i=P(),{tenantEmailDomain:a}=R(),o=J("branding"),c=C((v=>xo(v))),d=C((v=>bo(Ee,v)?.addressToCreate));r.useEffect((()=>{c.saveState.fetchState==="Completed"&&(i(jo()),i(Y(Ee)))}),[c.saveState.fetchState,i]);const l=vn(c.saveState.fetchState);return r.useEffect((()=>{l==="In-Progress"&&c.saveState.fetchState==="Completed"&&e("..")}),[l,c.saveState.fetchState,e]),s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingSettingsPage,isReady:o.isInvoicingPageReady}),s.jsx(Vt,{address:d,fieldHelp:c.fieldHelp,addressLabel:c.addressLabel,appContent:t,authParams:o.authParams,dateFormatOptions:c.dateFormatOptions,deleteFileStatusById:o.deleteFileStatusById,filesEndPoint:o.filesEndPoint,isLoading:o.isLoading,isSaving:o.isSaving,localData:c.localData,logoFile:o.logoFile,saveErrorMessage:o.saveErrorMessage,settings:o.settings,updateFileStatusById:o.updateFileStatusById,onBackClick:()=>e(".."),onChange:v=>{i(Po({localData:v}))},onDeleteFile:o.onDeleteFile,onEditFileName:o.onEditFileName,onOpenAddress:()=>{const v=`/${a}/invoicing/settings/branding/${Ee}/`,u=W(n.state?.pathnameStackToGoBack,n.pathname);e(v,{state:{pathnameStackToGoBack:u}})},onSubmit:()=>i(Do()),updateFilesEntity:o.updateFilesEntity})]})}function Ka(){const t=L(),e=J("dunning");return s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingSettingsPage,isReady:e.isInvoicingPageReady}),s.jsx(Ht,{dunningScheduleActionOptions:e.dunningScheduleActionOptions,isLoading:e.isLoading,isSaving:e.isSaving,saveErrorMessage:e.saveErrorMessage,settings:e.settings,onBackClick:()=>t(".."),onSave:e.onSave})]})}function Ga(){const t=L(),e=J("integrations");return s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingSettingsPage,isReady:e.isInvoicingPageReady}),s.jsx(qt,{integrationsSectionProps:{...e.integrationsSectionProps,onConfigureQBO:()=>t("../quickbooks"),onOpenPaymentDestination:()=>t("../payment-destination")},isLoading:e.isLoading,onBackClick:()=>t("..")})]})}function Wa(){const t=L(),e=J("payment-destination");return s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingSettingsPage,isReady:e.isInvoicingPageReady}),s.jsx(zt,{fieldHelp:e.fieldHelp,isLoading:e.isLoading,isStripeBusy:e.isStripeBusy,saveErrorMessage:e.saveErrorMessage,settings:e.settings,stripeError:e.stripeError,stripeWebhookUrl:e.stripeWebhookUrl,onBackClick:()=>t(".."),onConnectStripe:e.onConnectStripe})]})}const Ya=O((function(t){const e=Gn(t);return{accountMappingKindOptions:e.accountMappingKindOptions,fieldHelp:e.fieldHelp,accounts:e.accounts,connection:e.connection,customerMatchingOptions:e.customerMatchingOptions,isBackfilling:e.backfillState.fetchState==="In-Progress",isLoading:e.isLoading,isSaving:e.saveState.fetchState==="In-Progress",isSyncEnabledSaved:e.isSyncEnabledSaved,localData:e.localData,nestedAccountHierarchy:e.nestedAccountHierarchy,retryFetchStateByTaskId:e.retryFetchStateByTaskId,saveErrorMessage:e.saveState.fetchState==="Error"?e.saveState.error?.message:void 0,syncHealth:e.syncHealth,syncStatusOptions:e.syncStatusOptions}}),(function(t){return{onChange:e=>{t($o({localData:e}))},onReset:()=>{t(Ao())},onRetryTask:e=>{t(Qn(e))},onSave:()=>{p.trackInvoicingActionClick(m.Event.invoicingSettingsSaved,{tab:"quickbooks"}),t(Lo())},onStartBackfill:e=>{t(Zn(e))}}}))(Zt);function Ja(){const t=P(),e=L(),{tenantEmailDomain:n}=R(),i=C(Oe),{configFetchState:a,settingsFetchState:o}=C(Gn);return r.useEffect((()=>{o!=="Not-Started"&&o!=="Error"||t(Me())}),[t,o]),r.useEffect((()=>{a==="Not-Started"&&t(ge())}),[a,t]),et({fetchSyncHealth:!0,loadAccountingPickers:!0}),s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingSettingsPage}),s.jsx(Ya,{onBackClick:()=>e(".."),onReconnect:()=>{me.init("/connection/auth",i.tenantEmailDomain??n??""),me.handleClick()},onRefresh:()=>t(Kn())})]})}const Xa={"payment-destination":"payment-destination",general:"branding",integrations:null,dunning:"dunning"};function es(){const t=mn(),e=P(),n=L(),[i,a]=K(),o=J(),{canEnableInvoicing:c,isEnablingInvoicing:d,isInvoicingEnabled:l,isQboConfigured:v,isStripeConnected:u}=C(zn),g=i.get("tab");return r.useEffect((()=>{if(g==null)return;const S=Xa[g];a({},{replace:!0}),S!=null&&n(S,{replace:!0})}),[g,n,a]),s.jsxs(s.Fragment,{children:[s.jsx($,{event:m.Event.invoicingSettingsPage,isReady:o.isInvoicingPageReady}),s.jsx(Qt,{analytics:p,integrationsSectionProps:{...o.integrationsSectionProps,onConfigureQBO:()=>n("quickbooks"),onOpenPaymentDestination:()=>n("payment-destination")},isEnablingInvoicing:d,isLoading:o.isLoading,meetingUrl:t("invoicing_settings"),settings:o.settings,onBrandingClick:()=>n("branding"),onDunningClick:()=>n("dunning"),canEnableInvoicing:c,isQboConfigured:v,isStripePaymentsReady:u,onEnableInvoicingClick:l?void 0:()=>{e(Fo())}})]})}function gn(){return s.jsxs(te,{children:[s.jsx(x,{index:!0,element:s.jsx(es,{})}),s.jsx(x,{path:"payment-destination",element:s.jsx(Wa,{})}),s.jsx(x,{path:"branding",element:s.jsx(un,{})}),s.jsx(x,{path:"branding/:addressType",element:s.jsx(un,{appContent:s.jsx(Z,{isSubPage:!0,hideAddressBackButton:!0})})}),s.jsx(x,{path:"integrations",element:s.jsx(Ga,{})}),s.jsx(x,{path:"dunning",element:s.jsx(Ka,{})}),s.jsx(x,{path:"quickbooks",element:s.jsx(Ja,{})}),s.jsx(x,{path:"*",element:s.jsx(B,{to:"..",replace:!0})})]})}function Ps(){const t=P(),e=L(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=T(),{enableState:a,fetchState:o,status:c}=C(Tn),d=vn(a.fetchState),l=`/${n}/invoicing`,v=r.useRef(!1),u=C((g=>Be(g).connectionFetchState.fetchState));return r.useEffect((()=>{i&&(o!=="Not-Started"?o!=="Error"||v.current||(v.current=!0,t(ge({cacheOverride:!1}))):t(ge({cacheOverride:!1})))}),[i,t,o]),r.useEffect((()=>{i&&u==="Not-Started"&&t(qn())}),[i,t,u]),r.useEffect((()=>{d==="In-Progress"&&a.fetchState==="Completed"&&(e(`${l}/catalog`),t(wo()))}),[d,a.fetchState,l,t,e]),c==null&&o!=="Error"?s.jsx(Kt,{fetchState:"In-Progress"}):c==="not_started"?s.jsxs(te,{children:[s.jsx(x,{path:"promo",element:s.jsx(rn,{})}),s.jsx(x,{path:"*",element:s.jsx(B,{to:`${l}/promo`,replace:!0})})]}):c==="settings"?s.jsxs(te,{children:[s.jsx(x,{path:"promo",element:s.jsx(rn,{})}),s.jsx(x,{path:"settings/*",element:s.jsx(gn,{})}),s.jsx(x,{path:"*",element:s.jsx(B,{to:`${l}/settings`,replace:!0})})]}):s.jsxs(te,{children:[s.jsx(x,{path:"/",element:s.jsx(B,{to:"overview",replace:!0})}),s.jsx(x,{path:"overview",element:s.jsx(Da,{})}),s.jsx(x,{path:"promo",element:s.jsx(B,{to:`${l}/overview`,replace:!0})}),s.jsx(x,{path:"customers",element:s.jsx(aa,{})}),s.jsx(x,{path:"customers/new",element:s.jsx(ia,{})}),s.jsx(x,{path:"customers/new/:addressType",element:s.jsx(Z,{})}),s.jsx(x,{path:"customers/:customer_id",element:s.jsx(na,{})}),s.jsx(x,{path:"customers/:customer_id/:addressType",element:s.jsx(Z,{})}),s.jsx(x,{path:"subscriptions",element:s.jsx(qa,{})}),s.jsx(x,{path:"subscriptions/new",element:s.jsx(Va,{})}),s.jsx(x,{path:"subscriptions/new/:addressType",element:s.jsx(Z,{})}),s.jsx(x,{path:"subscriptions/:subscription_id",element:s.jsx(Ta,{})}),s.jsx(x,{path:"subscriptions/:subscription_id/:addressType",element:s.jsx(Z,{})}),s.jsx(x,{path:"invoices",element:s.jsx(ya,{})}),s.jsx(x,{path:"invoices/create",element:s.jsx(Go,{})}),s.jsx(x,{path:"invoices/:invoice_id",element:s.jsx(Ea,{})}),s.jsx(x,{path:"invoices/:invoice_id/record-payment",element:s.jsx(ln,{})}),s.jsx(x,{path:"invoices/:invoice_id/issue-credit-note",element:s.jsx(ba,{})}),s.jsx(x,{path:"payments",element:s.jsx(La,{})}),s.jsx(x,{path:"payments/record",element:s.jsx(ln,{})}),s.jsx(x,{path:"payments/:transaction_id",element:s.jsx(Za,{})}),s.jsx(x,{path:"credits",element:s.jsx(Xo,{})}),s.jsx(x,{path:"credits/:credit_note_id",element:s.jsx(Yo,{})}),s.jsx(x,{path:"discounts",element:s.jsx(pa,{})}),s.jsx(x,{path:"discounts/new",element:s.jsx(Qo,{})}),s.jsx(x,{path:"discounts/:coupon_id",element:s.jsx(ma,{})}),s.jsx(x,{path:"dunning",element:s.jsx(Ia,{})}),s.jsx(x,{path:"dunning/:case_id",element:s.jsx(Sa,{})}),s.jsx(x,{path:"catalog",element:s.jsx(zo,{})}),s.jsx(x,{path:"catalog/new",element:s.jsx(Vo,{})}),s.jsx(x,{path:"catalog/:item_id",element:s.jsx(Mo,{})}),s.jsx(x,{path:"settings/*",element:s.jsx(gn,{})}),s.jsx(x,{path:"audit_log",element:s.jsx(To,{})}),s.jsx(x,{path:"data_import",element:s.jsx(la,{})}),s.jsx(x,{path:"data_import/migrate",element:s.jsx(ua,{})}),s.jsx(x,{path:"data_import/:sessionId",element:s.jsx(ca,{})}),s.jsx(x,{path:"*",element:s.jsx(M,{})})]})}export{Ps as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t}from"./liveblocks-
|
|
1
|
+
import{j as t}from"./liveblocks-DsNaXx1Y.js";import{i as S,l as g,h as C,g as y,u as ee,t as te,j as E,N as ae,n as ne,o as p}from"./core-C5ZG3tJS.js";import{Uj as k,Uk as v,Ul as T,Jn as D,J9 as U,Um as A,Un as oe,Uo as ie,Jd as se,gi as $,Jk as le,Jh as re}from"./zeni-epic-state-BcPOXb6_.js";import{a2 as x,F as r,a3 as de,k as j,_ as G,a4 as ce,a5 as me,a6 as pe,p as J,c as ue,A as he,a7 as ge,M as xe,E as fe,f as we,a8 as be,a9 as Se,a0 as ye,aa as ke,ab as ve,ac as je,ad as $e}from"./index-CHAUl04f.js";import{n as m}from"./mui-BWEZqJM6.js";import f from"./NotFoundScreen-Bs6jlvSW.js";import{a as I}from"./sentry-D4qoEIco.js";import"./recharts-Cbxp2ciV.js";import"./analytics-D_bfwrdA.js";import"./plaid-B_2YsVA4.js";import"./dnd-C67Dx0fq.js";import"./stripe-cKAAJElX.js";import"./lottie-x1U_1T_X.js";import"./lexical-BpFcNSrv.js";import"./pdf-Da5t4yqS.js";import"./utils-DBZ_QSme.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="215308ec-6645-4dc0-9906-fb5fe8c62704",e._sentryDebugIdIdentifier="sentry-dbid-215308ec-6645-4dc0-9906-fb5fe8c62704")}catch{}})();const Ie=m.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as g}from"./liveblocks-
|
|
1
|
+
import{j as g}from"./liveblocks-DsNaXx1Y.js";import{a as u}from"./sentry-D4qoEIco.js";import{u as O,g as _,h as w,t as V,j as l,N as U}from"./core-C5ZG3tJS.js";import{z as r,E as M,G as P,O as A,k as N,S as $,$ as G,a0 as R,V as W}from"./index-CHAUl04f.js";import{fF as q,TO as B,Uf as H,U6 as J,gi as K,gk as Q,Ub as X,gU as Y,dj as Z,Ug as ee,Uh as te}from"./zeni-epic-state-BcPOXb6_.js";import{n as ne}from"./mui-BWEZqJM6.js";import{u as se}from"./useDeviceId-D51quroZ.js";import{f as ae}from"./analyticsHelper-BCS-l0Hm.js";import{t as ie}from"./getLocaleForTenant-C4S7jDsD.js";import"./recharts-Cbxp2ciV.js";import"./analytics-D_bfwrdA.js";import"./plaid-B_2YsVA4.js";import"./dnd-C67Dx0fq.js";import"./stripe-cKAAJElX.js";import"./lottie-x1U_1T_X.js";import"./lexical-BpFcNSrv.js";import"./pdf-Da5t4yqS.js";import"./utils-DBZ_QSme.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="e7345052-c2c5-4fc0-bcc6-a8332d93deec",t._sentryDebugIdIdentifier="sentry-dbid-e7345052-c2c5-4fc0-bcc6-a8332d93deec")}catch{}})();const T=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function Te(){const t=O(),a=_(),m=w(),[b]=V(),n=b.get("token"),p=b.get("stytch_token_type"),f=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:c,twoFAPhoneNumber:D,magicLinkEmail:d,verifyDeviceFetchState:x,resendVerifyDeviceOTPFetchState:z}=l((e=>e.tenantState)),S=l((e=>e.tenantState.fetchState)),y=l((e=>e.tenantState.activeTenantFetchState.fetchState)),h=l((e=>e.tenantState.signInState)),I=l((e=>e.tenantState.magicLinkSignInFetchState.fetchState)),s=l((e=>e.tenantState.loggedInUser)),o=l((e=>q(e))),k=l((e=>B(e))),C=r.getSignedInUser(),v=M().mode;u.useEffect((()=>{s?.zeniSessionId==null&&n!=null&&T(n,p)&&i!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t(H(n,i,f)))}),[n,p,t,i,f,s?.zeniSessionId]),u.useEffect((()=>{h!=="In-Progress"||S!=="Completed"&&y!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(J(k.tenantsInOrder),s.zeniSessionId),K(s.userId,s.zeniSessionId,o.tenantId),t(Q(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),P.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,k.tenantsInOrder),Y().then((()=>{const e=W();e!=null&&A(e)})),setTimeout((()=>{N.trackLogin($.Event.loginSuccess,"email",Z(o.productSettings))}),2e3))}),[h,S,y,s,o,k,v,a.state,t]);const E=u.useCallback((()=>{m("/signin/auth")}),[m]),j=u.useCallback((()=>{i!=null&&c!=null&&d!=null&&t(ee(i,d,c))}),[i,c,t,d]),F=u.useCallback((e=>{i!=null&&n!=null&&d!=null&&c!=null&&t(te(e,i,d,c))}),[i,n,t,d,c]);if(I==="Completed"&&c!=null)return g.jsx(G,{phoneNumber:D,verifyOtpFetchState:x.fetchState,resendVerifyDeviceOTPFetchState:z,onResendOtp:j,onVerifyOtp:F,onCancelVerifyDevice:E});if(h==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||C!=null){const e=a.state?.origin??"/";return g.jsx(U,{to:e,state:{...a.state,origin:""}})}if(!T(n,p)||f==null||I==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return g.jsx(U,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||I==="Error"&&s?.zeniSessionId==null)}})}return g.jsx(oe,{"data-testid":"smooth-loader",children:g.jsx(R,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
|
|
2
2
|
position: fixed;
|
|
3
3
|
top: 0;
|
|
4
4
|
left: 0;
|