@zeniai/web-app-ui 5.3.62-dev → 5.3.63-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AccountMappingScreen-DwM3_WTC.js → AccountMappingScreen-BRZHYOUR.js} +1 -1
- package/dist/assets/{ActualMatchingMatchDetailScreen---3NQIlW.js → ActualMatchingMatchDetailScreen-CT_TfQgQ.js} +1 -1
- package/dist/assets/AddressRoutes-CisWqyoC.js +1 -0
- package/dist/assets/{AddressScreen-DwDn6adU.js → AddressScreen-CrINuapd.js} +1 -1
- package/dist/assets/{AiCfoScreen-CmI1WP3p.js → AiCfoScreen-BXw0LDjo.js} +1 -1
- package/dist/assets/{AppDrawer-CqAnDatC.js → AppDrawer-DZIMVdFc.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-uF3lLPXa.js → BillPayApprovalRoutes-Dp_PkbIk.js} +1 -1
- package/dist/assets/{BillPayRoutes-CxGXv0Eb.js → BillPayRoutes-CUUjBefv.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-CWJBny4J.js → BusinessVerificationPageScreen-DFamYzxa.js} +1 -1
- package/dist/assets/{CardsAiCfoScreen-DTmIk225.js → CardsAiCfoScreen-Cx5KkOYw.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-CBA-C6S5.js → ChargeCardRoutes-DzIBuJeY.js} +1 -1
- package/dist/assets/{CompanyPassportScreen-C0r5_u0C.js → CompanyPassportScreen-CENbDnLW.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-D97ZGKWy.js → ConnectionAuthScreen-DTyZxcME.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-zLmHJyqv.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-BFK8USjA.js → CustomerOnboardingRoutes-CjmJGGJm.js} +1 -1
- package/dist/assets/{DashboardRoutes-CIiFmVuR.js → DashboardRoutes-ByHBLKcB.js} +1 -1
- package/dist/assets/{DefaultTenantHome-BWhhfpNZ.js → DefaultTenantHome-Dm9FOXup.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-C8g5HYbF.js → DomesticWireDetailScreen-086WQWRB.js} +1 -1
- package/dist/assets/{DrawerScreen-jGeXohet.js → DrawerScreen-B5BqRZEJ.js} +1 -1
- package/dist/assets/{EntityDetailRoutes-DDbPZyaE.js → EntityDetailRoutes-BuN3sXNp.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-BhSlFN1-.js → ExpenseAutomationRoutes-Ce3IicTe.js} +1 -1
- package/dist/assets/{FeaturePreviewScreen-t-KcIePh.js → FeaturePreviewScreen-D54Nwanb.js} +1 -1
- package/dist/assets/{HubSpotOAuthCallbackScreen-B9Xsd5UE.js → HubSpotOAuthCallbackScreen-BRUwb2B6.js} +1 -1
- package/dist/assets/{InboxNotificationsProvider-DcarX1j5.js → InboxNotificationsProvider-x0fdv66l.js} +1 -1
- package/dist/assets/InvoicingRoutes-IQsFojD0.js +2 -0
- package/dist/assets/{MagicLinkRoutes-CfUJpVA_.js → MagicLinkRoutes-C5BKMtwW.js} +1 -1
- package/dist/assets/{MagicLinkSignInScreen-BR70G8WN.js → MagicLinkSignInScreen-9LYlxmop.js} +1 -1
- package/dist/assets/{MobileAppDrawer-DqgtjBKX.js → MobileAppDrawer-DX2JnkbM.js} +1 -1
- package/dist/assets/NotFoundScreen-CtgFRYZy.js +1 -0
- package/dist/assets/{NotificationRoutes-C1V1-m3K.js → NotificationRoutes-DICT3yoM.js} +1 -1
- package/dist/assets/{OAuthConsentScreen-UVKKdhYW.js → OAuthConsentScreen-BmiLDdxn.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-x9MBz-SJ.js → PandLWithForecastRoutes-DAq9XRB1.js} +1 -1
- package/dist/assets/{PaymentLinkScreen-BtszXnNs.js → PaymentLinkScreen-Cz1wlNqO.js} +1 -1
- package/dist/assets/{PeopleRoutes-By-929Rc.js → PeopleRoutes-DgYtveDU.js} +1 -1
- package/dist/assets/{PerformanceRoutes-DwUVercL.js → PerformanceRoutes-B6iTINLg.js} +1 -1
- package/dist/assets/{Preview-Dxr01VGI.js → Preview-Dz6yJNce.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-Chdjbcg8.js → QBOConnectionScreen-D8eeXRWb.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-DVM8rE5F.js → ReimbursementApprovalRoutes-CE6y6IwA.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-Bf1LI70e.js → ReimbursementApprovalRuleDetailScreen-BT_O_PEv.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-ByU4nWbt.js → ReimbursementRoutes-BmOT-3C-.js} +1 -1
- package/dist/assets/{ReportsRoutes-Be1H67SI.js → ReportsRoutes-CqUKv9Uh.js} +1 -1
- package/dist/assets/{RewardsRoutes-iweGs61q.js → RewardsRoutes-D5CR9NnI.js} +1 -1
- package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-HIrqgD7A.js → ScheduleDetailsPrepaidExpensesScreen-CLEogplJ.js} +1 -1
- package/dist/assets/{ScreenRoutes-CFuAOQvL.js → ScreenRoutes-xDjhbdP1.js} +2 -2
- package/dist/assets/{SettingsRoutes-CYdVWZYv.js → SettingsRoutes-QcMcR-j3.js} +1 -1
- package/dist/assets/{SetupPagesScreen-BccJSzRN.js → SetupPagesScreen-fuvb0IYd.js} +1 -1
- package/dist/assets/{SignInScreen-DM0sUU51.js → SignInScreen-ekGlkjLH.js} +1 -1
- package/dist/assets/{SignOutScreen-Bs1NyDBL.js → SignOutScreen-9NJIr2hr.js} +1 -1
- package/dist/assets/{TaskListScreen-DQj6h_q_.js → TaskListScreen-C2urPjKT.js} +1 -1
- package/dist/assets/{TaskRoutes-DY92MrHK.js → TaskRoutes-BuzkCbPW.js} +1 -1
- package/dist/assets/TransactionDetailRoutes-D99Yv6kv.js +1 -0
- package/dist/assets/{TransactionDetailScreen-fc6wRDCa.js → TransactionDetailScreen-CQr1YyP0.js} +1 -1
- package/dist/assets/{TransactionListRoutes-DoEWtZb8.js → TransactionListRoutes-BTidVr9Z.js} +1 -1
- package/dist/assets/{TreasuryRoutes-BwZlVh2U.js → TreasuryRoutes-CbD79DO8.js} +1 -1
- package/dist/assets/{VendorsRoutes-rWAhbgUX.js → VendorsRoutes-CCYu89Uf.js} +1 -1
- package/dist/assets/{WiseConfirmationScreen-twAmgAST.js → WiseConfirmationScreen-B0HeU8Sh.js} +1 -1
- package/dist/assets/{ZeniAccountRoutes-BqSVR2HC.js → ZeniAccountRoutes-CoRmS3Mc.js} +1 -1
- package/dist/assets/{ZeniAccountStatementScreen-xKZWX655.js → ZeniAccountStatementScreen-BnpFJ5jB.js} +1 -1
- package/dist/assets/{accountMappingHelper-DpfYWNe6.js → accountMappingHelper-tmyjt9rr.js} +1 -1
- package/dist/assets/{analytics-CiEh1qKr.js → analytics-C3e3An3a.js} +1 -1
- package/dist/assets/{analyticsHelper-DHPcRAai.js → analyticsHelper-BEL0ra9X.js} +1 -1
- package/dist/assets/{core-Caq7Zbsp.js → core-CHD8T-IM.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-DmjyT4t5.js → decodeURIComponentSafe-p_nrn8Pg.js} +1 -1
- package/dist/assets/{dnd-DwckO6rX.js → dnd-Dwi6R-ey.js} +1 -1
- package/dist/assets/{empty-Dl3LsHNf.js → empty-CZC5CrVC.js} +1 -1
- package/dist/assets/{empty-CviwvzhB.js → empty-CeRjDJvl.js} +1 -1
- package/dist/assets/{emptyVideoElement-0ADxBh21.js → emptyVideoElement-BQ5qxpg6.js} +1 -1
- package/dist/assets/{epic-DqqOk9a9.js → epic-BW8jUHg5.js} +1 -1
- package/dist/assets/{expenseAutomationHelper-B83Qa5Jl.js → expenseAutomationHelper-kGR6VZFG.js} +1 -1
- package/dist/assets/{getLocaleForTenant-YgJPw-1W.js → getLocaleForTenant-D-or0iZO.js} +1 -1
- package/dist/assets/{index-BsIiLcaT.js → index-BMy5YH8G.js} +1 -1
- package/dist/assets/{index-Bi5Vnzzf.js → index-BVHBHjSe.js} +1 -1
- package/dist/assets/{index-DZj1fENq.js → index-C1KaIuMT.js} +1 -1
- package/dist/assets/{index-BggnOuo1.js → index-CKiMoeFX.js} +1 -1
- package/dist/assets/{index-DOXJLxdR.js → index-DKH4PK2B.js} +8 -9
- package/dist/assets/{index-BLBexBOn.js → index-XRUedCJ0.js} +1 -1
- package/dist/assets/{index-De1Gw5gW.js → index-w09kaOHP.js} +1 -1
- package/dist/assets/{index-B3LhL1WI.js → index-yiW1aZfy.js} +2 -2
- package/dist/assets/{lexical-mmp2B1vq.js → lexical-CMNdypK6.js} +1 -1
- package/dist/assets/{liveblocks-CIxx6Ub6.js → liveblocks-e6rGc1UF.js} +1 -1
- package/dist/assets/{lottie-CrKh4Q_r.js → lottie-B778bt56.js} +1 -1
- package/dist/assets/{mui-DI0hUuFr.js → mui-NTaF3UaY.js} +1 -1
- package/dist/assets/{pathToGoBack-Ch5lrOj1.js → pathToGoBack-3T3qt1CN.js} +1 -1
- package/dist/assets/{pdf-BlhN83fm.js → pdf-Bx92ZlM_.js} +3 -3
- package/dist/assets/{pdf-lib-WBpN-CHj.js → pdf-lib-CSbJ_JNk.js} +1 -1
- package/dist/assets/{plaid-CXvI7t9H.js → plaid-DdTo7m1-.js} +1 -1
- package/dist/assets/{pusher-BZAjVztW.js → pusher-TnSBrmnt.js} +1 -1
- package/dist/assets/{react-BsygV86H.js → react-B75Gnqob.js} +1 -1
- package/dist/assets/{react-BHfk4QRe.js → react-BRi8TcMI.js} +1 -1
- package/dist/assets/{react-tooGqts4.js → react-Ba46BK4D.js} +1 -1
- package/dist/assets/{react-rmAoHvXj.js → react-COkaiBQo.js} +1 -1
- package/dist/assets/{react-BqA23JAy.js → react-Ci1ltUcy.js} +1 -1
- package/dist/assets/{react-XoZ7aD8C.js → react-DJOUavGZ.js} +1 -1
- package/dist/assets/{recharts-DKmpCGIA.js → recharts-C6xUtcdL.js} +1 -1
- package/dist/assets/{routePaths-C1OqXYGB.js → routePaths-CGyE-cU7.js} +1 -1
- package/dist/assets/{sentry-BCPOyc0G.js → sentry-DsyKtMW2.js} +1 -1
- package/dist/assets/{stripSplatSuffix-Dmnnw5Oe.js → stripSplatSuffix-CKrdD9MQ.js} +1 -1
- package/dist/assets/{url-CdxI2rEH.js → url-ClJewK9Y.js} +1 -1
- package/dist/assets/{url-JduagIhH.js → url-Zl9uXQ4e.js} +1 -1
- package/dist/assets/{useActualMatchingMatchDetail-6t8vcRTI.js → useActualMatchingMatchDetail-Cc17Q5Tv.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BO7_rPaJ.js → useAiCfoDashboardSuggestedQuestionsChips-CHbHmZzx.js} +1 -1
- package/dist/assets/{useAskAiCfoHostNavButtonProps-BvhP40c_.js → useAskAiCfoHostNavButtonProps-BcCbRGDK.js} +1 -1
- package/dist/assets/{useChargeCardPusherEvents-2nVivR1x.js → useChargeCardPusherEvents-BWi4_PP5.js} +1 -1
- package/dist/assets/{useDeviceId-2NJBbYPM.js → useDeviceId-VsdzmSZI.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-QqukN5jp.js → useEmailConnectResultRefresh-ClXdZp-6.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-uu8NipM7.js → useInitialThreadRequest-DDr_z_RH.js} +1 -1
- package/dist/assets/{useTaskManagerAccess-DxrmaJfc.js → useTaskManagerAccess-CUv6a62x.js} +1 -1
- package/dist/assets/{useTaskManagerPusherEvents-D5Hm7um3.js → useTaskManagerPusherEvents-DCIopLVZ.js} +1 -1
- package/dist/assets/{utils-rX2IEvjD.js → utils-CCA3F0sZ.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-C1wVwRW0.js → withTransactionSidePanel-B_xgLNm6.js} +1 -1
- package/dist/assets/{zeni-epic-state-DROyxOLw.js → zeni-epic-state-BO3zdDfL.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/AddressRoutes-CRWje5aU.js +0 -1
- package/dist/assets/CustomerOnboardingAuthScreen-DREpIR3e.js +0 -1
- package/dist/assets/InvoicingRoutes-BQHOoyRc.js +0 -2
- package/dist/assets/NotFoundScreen-C2GrPpNy.js +0 -1
- package/dist/assets/TransactionDetailRoutes-BFj2-oES.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as m}from"./liveblocks-
|
|
1
|
+
import{j as m}from"./liveblocks-e6rGc1UF.js";import{a as g}from"./sentry-DsyKtMW2.js";import{h as w,u as k,g as x,i as T,j as O,l as E}from"./core-CHD8T-IM.js";import{z as D,bt as F,a9 as P,k as V,U as j,r as C,bu as L,af as A,aH as U,p as B}from"./index-DKH4PK2B.js";import{fF as h,gI as M,BE as _,gD as z,c8 as R,Yh as Y,bn as G,uX as H,uL as X,mz as Z,o8 as S,Yi as $,bE as q,cE as N,oj as J,ot as K}from"./zeni-epic-state-BO3zdDfL.js";import"./mui-NTaF3UaY.js";import{d as Q}from"./routePaths-CGyE-cU7.js";import{M as W}from"./MobileAppDrawer-DX2JnkbM.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new a.Error().stack;n&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[n]="8609d434-5141-455f-aa13-f87d4ea761ef",a._sentryDebugIdIdentifier="sentry-dbid-8609d434-5141-455f-aa13-f87d4ea761ef")}catch{}})();const ee=E((function(a){const n=z(a),i=D.getSignedInUser(),p=h(a),c=p.tenantId,l={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=R(p?.userRole??[])&&n.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=Y(a.companyConfigState),t=a.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:n.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:n,allIndustries:e.companyIndustries??[],allNationalityCountries:t,isDisabled:f,authParams:l,filesEndPoint:`${A.fileMicroServiceBaseUrl}`,isZeniUser:G(i)}}),(function(a,n){const{companyId:i,currentTenant:p,navigate:c,location:l}=n,{tenantEmailDomain:f}=p;return{onScheduleClick:e=>{let t=e.href;t.includes("http")||(t="https://".concat(t)),window.open(t,"_blank")},onSaveAll:()=>{a(K())},onAddressClick:e=>{const t=Q(f,e),o=B(l.state?.pathnameStackToGoBack,l.pathname);c(t,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{a(J({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:b}=r,v={companyInfo:{...t,website:u!=""&&u!=null?N(u):void 0,meetingLink:y!=""&&y!=null?N(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?q(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:b.selectedOptions.map((I=>parseInt(I))),fileId:r.fileIds[0]}};a(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{a(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{a(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=>{a($(e))},onCompanyOfficerUpdated:e=>{a(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=>{a(Z({files:e}))},onDeleteFile:e=>{a(X(e))},onEditFileName:(e,t)=>{a(H(e,t.split(".")[0]))}}}))(L);function de(){const a=w(),n=k(),i=x(),{tenantEmailDomain:p}=T(),[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=>h(s))),d=r.companyId??D.getSignedInUserTenant(p)?.companyId;if(D.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect((()=>{c||t!=="Not-Started"||d==null||(l(!0),n(M(d)))}),[c,t,d,n]),g.useEffect((()=>{o==="Not-Started"&&n(_())}),[o,n]);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:()=>a("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:V,onLoad:s=>s.trackPageLoaded(j.Event.companyPassport,C(i)?"Settings":"Company Passport")}),C(i)?m.jsx(W,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:a,location:i,isLoading:y,currentTenant:r,isSettings:C(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-e6rGc1UF.js";import{a as o}from"./sentry-DsyKtMW2.js";import{u as P,h as R,g as H,j as C,N as w}from"./core-CHD8T-IM.js";import{TX as q,fF as z,gl as G,pS as J,gM as A,gk as M,gi as Q,Ul as V,gh as O}from"./zeni-epic-state-BO3zdDfL.js";import{u as X,z as E,L as D,G as B,J as K}from"./index-DKH4PK2B.js";import{n as W}from"./mui-NTaF3UaY.js";import{P as h,a as _}from"./AccountMappingScreen-BRZHYOUR.js";import{t as Y}from"./getLocaleForTenant-D-or0iZO.js";import{g as Z,Q as ee}from"./QBOConnectionScreen-D8eeXRWb.js";import"./recharts-C6xUtcdL.js";import"./analytics-C3e3An3a.js";import"./plaid-DdTo7m1-.js";import"./dnd-Dwi6R-ey.js";import"./stripe-cKAAJElX.js";import"./lottie-B778bt56.js";import"./lexical-CMNdypK6.js";import"./pdf-Bx92ZlM_.js";import"./utils-CCA3F0sZ.js";import"./MobileAppDrawer-DX2JnkbM.js";import"./InboxNotificationsProvider-x0fdv66l.js";import"./useTaskManagerAccess-CUv6a62x.js";import"./accountMappingHelper-tmyjt9rr.js";import"./empty-CeRjDJvl.js";import"./pdf-lib-CSbJ_JNk.js";import"./index-BVHBHjSe.js";import"./url-ClJewK9Y.js";import"./index-CKiMoeFX.js";import"./decodeURIComponentSafe-p_nrn8Pg.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]="29afd1c4-a201-482e-97d8-eda3675690cc",t._sentryDebugIdIdentifier="sentry-dbid-29afd1c4-a201-482e-97d8-eda3675690cc")}catch{}})();const te=W.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-e6rGc1UF.js";import{z as m}from"./index-DKH4PK2B.js";import{g as n}from"./QBOConnectionScreen-D8eeXRWb.js";import"./sentry-DsyKtMW2.js";import{g as p,N as a}from"./core-CHD8T-IM.js";import"./zeni-epic-state-BO3zdDfL.js";import"./recharts-C6xUtcdL.js";import"./mui-NTaF3UaY.js";import"./analytics-C3e3An3a.js";import"./plaid-DdTo7m1-.js";import"./dnd-Dwi6R-ey.js";import"./stripe-cKAAJElX.js";import"./lottie-B778bt56.js";import"./lexical-CMNdypK6.js";import"./pdf-Bx92ZlM_.js";import"./utils-CCA3F0sZ.js";import"./empty-CeRjDJvl.js";import"./pdf-lib-CSbJ_JNk.js";import"./index-BVHBHjSe.js";import"./url-ClJewK9Y.js";import"./index-CKiMoeFX.js";import"./decodeURIComponentSafe-p_nrn8Pg.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-BFK8USjA.js → CustomerOnboardingRoutes-CjmJGGJm.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-e6rGc1UF.js";import{t as Tt,A as $e}from"./AddressScreen-CrINuapd.js";import wt from"./NotFoundScreen-CtgFRYZy.js";import{a as d,t as Me}from"./sentry-DsyKtMW2.js";import{h as _e,g as xe,u as se,i as Ee,j as T,N as Q,q as At,l as it,n as Pt,o as H}from"./core-CHD8T-IM.js";import{fF as Y,d_ as Te,dZ as we,bq as Dt,Uc as jt,bR as Bt,pQ as Ft,Bo as Vt,Br as Ut,Vz as Rt,VA as Lt,lu as Oe,lx as ct,UP as Nt,b$ as Gt,c8 as fe,BS as Ae,BD as $t,VB as me,BT as dt,Sm as Mt,mH as ut,di as lt,VC as Qt,VD as Kt,uE as zt,UC as Ce,hV as qt,UB as be,hS as Ht,Gh as Jt,uI as Zt,hK as Wt,hN as Qe,VE as pt,VF as Xt,M7 as Yt,VG as en,Mb as tn,Bu as nn,VH as an,VI as on,ls as sn,lv as rn,C3 as cn,BF as mt,BR as dn,bE as Ke,cE as un,C2 as ze,uX as ln,uL as pn,mz as mn,gG as gn,gF as fn,gE as yn,VJ as hn,Bx as Cn,C4 as bn,C7 as Sn,Ca as In,Cg as kn,dj as On}from"./zeni-epic-state-BO3zdDfL.js";import{z,N as Pe,f as W,Q as vn,p as q,a9 as re,k as g,aF as _n,aj as gt,a2 as xn,F as ft,W as yt,l as X,_ as ge,U as ve,aG as En,J as qe,x as He,af as Tn,aH as Je,aI as wn,aJ as An}from"./index-DKH4PK2B.js";import{n as De}from"./mui-NTaF3UaY.js";import{g as Pn,h as Dn,q as ie}from"./QBOConnectionScreen-D8eeXRWb.js";import{u as jn,a as Bn}from"./useEmailConnectResultRefresh-ClXdZp-6.js";import{u as Fn}from"./useChargeCardPusherEvents-BWi4_PP5.js";import"./recharts-C6xUtcdL.js";import"./analytics-C3e3An3a.js";import"./plaid-DdTo7m1-.js";import"./dnd-Dwi6R-ey.js";import"./stripe-cKAAJElX.js";import"./lottie-B778bt56.js";import"./lexical-CMNdypK6.js";import"./pdf-Bx92ZlM_.js";import"./utils-CCA3F0sZ.js";import"./empty-CeRjDJvl.js";import"./pdf-lib-CSbJ_JNk.js";import"./index-BVHBHjSe.js";import"./url-ClJewK9Y.js";import"./index-CKiMoeFX.js";import"./decodeURIComponentSafe-p_nrn8Pg.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]="1eeda9c6-7ead-4ef6-9398-c5d925fef5a0",e._sentryDebugIdIdentifier="sentry-dbid-1eeda9c6-7ead-4ef6-9398-c5d925fef5a0")}catch{}})();const Ze=e=>{switch(e){case"Complete":return"yes";case"Pending Review":case"Incomplete":return"partially";default:return"no"}},Vn=()=>{const e=_e(),l=xe(),i=se(),[a,p]=d.useState(!1),[u,c]=d.useState(!1),{tenantEmailDomain:v}=Ee(),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),x=_?.resources?.find((S=>S.resource==="/bills"))==null&&!r,E=_?.resources?.find((S=>S.resource==="/reimbursements"))==null;U===!1&&D.push("top_expenses"),h===!1&&D.push("task_card"),x===!1&&D.push("bill_pay_card","bill_pay_promo_card"),E===!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 J=jt(S,V);return Bt(J.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:Ze(L?.businessVerified?.status),isKycDone:Ze(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-CIxx6Ub6.js";import{i as K,j as _,g as Z,u as $,h as H,l as ne,k as oa,n as ht,o as P,N as vn}from"./core-Caq7Zbsp.js";import{fF as B,VV as He,bE as sa,br as Ee,Xh as En,ka as Tn,Xi as Vt,Xj as wn,kd as ft,Xk as Qe,Xl as xn,ki as Dn,Xm as Gt,Xn as Pn,km as gt,Xo as We,Xp as On,Xq as Fn,Wd as jn,lo as Rn,Xr as Mn,bn as Je,Xs as ra,WT as le,bc as ia,lC as ca,ll as la,WV as de,WU as ae,fE as da,ga as Bn,gq as bt,Xt as Un,Xu as Ln,Xv as ua,Xw as Oe,D$ as Be,E0 as Ue,Eo as Te,Ei as ue,E4 as Le,Xx as Yn,b$ as Ye,Xy as Vn,Xz as Gn,XA as ma,XB as Fe,XC as Nn,ei as et,Aa as pa,XD as Xn,XE as ha,XF as $n,XG as zn,XH as Kn,XI as St,UR as _t,ua as we,l$ as xe,Ey as kt,Ah as qn,Ao as Qn,XJ as Wn,XK as Zn,E1 as Nt,XL as Hn,Ad as Ie,A8 as fa,XM as ge,XN as Xt,XO as Jn,XP as yt,UQ as At,Cl as ga,XQ as eo,XR as ba,XS as to,XT as ao,XU as no,XV as It,CA as oo,CH as so,XW as ro,XX as io,E3 as $t,XY as co,Cj as Ca,XZ as be,X_ as zt,X$ as lo,bq as Sa,ED as _a,Y0 as uo,Y1 as ka,Y2 as mo,Y3 as po,Y4 as ho,Y5 as vt,Ev as fo,Ex as go,Y6 as bo,Y7 as Co,E2 as Kt,Y8 as So,EB as ya,Y9 as Ce,Ya as qt,Yb as _o,Yc as ko,Yd as Aa,lQ as Ia,pX as va,lV as Ea,pV as Ta,pU as wa,pT as xa,BI as yo,dc as Ao,pQ as Io,Uc as vo,q5 as Eo,Ye as To,Yf as wo,Yg as xo,b5 as Et,p$ as Do,ic as Po,gI as Oo,p_ as Fo,le as jo,pY as Ro,pW as Mo,d_ as Bo,dZ as Uo}from"./zeni-epic-state-DROyxOLw.js";import{z as U,aw as oe,p as O,k as w,G as q,bc as Lo,at as Ve,a9 as Ge,bd as Da,U as N,be as Yo,bf as Pa,E as Vo,bg as Go,bh as No,a as Oa,a2 as Fa,d as ja,as as Xo,bi as $o,ap as zo,N as Tt,bj as Ra,y as re,bk as Ma,bl as Ba,av as Ua,bm as Ko,aj as Ne,W as Xe,bn as qo,X as Qo,bo as Wo,f as G,Q as Zo,l as Ho,a5 as Jo,ar as es,bp as ts,bq as as,br as ns,bs as ve}from"./index-DOXJLxdR.js";import{n as wt}from"./mui-DI0hUuFr.js";import{a as b}from"./sentry-BCPOyc0G.js";import{w as La}from"./withTransactionSidePanel-C1wVwRW0.js";import{c as Ya,t as De,f as me,b as xt,a as Dt,v as os}from"./routePaths-C1OqXYGB.js";import{u as se}from"./useAskAiCfoHostNavButtonProps-BvhP40c_.js";import Me from"./NotFoundScreen-C2GrPpNy.js";import{u as Pt}from"./useInitialThreadRequest-uu8NipM7.js";import{t as Va}from"./analyticsHelper-DHPcRAai.js";import{C as ss}from"./CompanyPassportScreen-C0r5_u0C.js";import{u as rs}from"./useAiCfoDashboardSuggestedQuestionsChips-BO7_rPaJ.js";import{F as is}from"./FeaturePreviewScreen-t-KcIePh.js";import"./recharts-DKmpCGIA.js";import"./analytics-CiEh1qKr.js";import"./plaid-CXvI7t9H.js";import"./dnd-DwckO6rX.js";import"./stripe-cKAAJElX.js";import"./lottie-CrKh4Q_r.js";import"./lexical-mmp2B1vq.js";import"./pdf-BlhN83fm.js";import"./utils-rX2IEvjD.js";import"./TransactionDetailScreen-fc6wRDCa.js";import"./decodeURIComponentSafe-DmjyT4t5.js";import"./expenseAutomationHelper-B83Qa5Jl.js";import"./stripSplatSuffix-Dmnnw5Oe.js";import"./MobileAppDrawer-DqgtjBKX.js";import"./InboxNotificationsProvider-DcarX1j5.js";import"./useTaskManagerAccess-DxrmaJfc.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]="e7666a96-794c-42c9-a215-bb83356cc962",e._sentryDebugIdIdentifier="sentry-dbid-e7666a96-794c-42c9-a215-bb83356cc962")}catch{}})();const cs=La((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=U.getSignedInUser(),i=_((S=>S.tenantState.currentTenantId)),l=_((S=>B(S))),{tenantEmailDomain:m}=K(),p=Z(),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=$(),g=H(),y=_((S=>En(S,u,o))),E=b.useCallback((()=>{o!=null&&y.fetchState!=="In-Progress"&&y.fetchState!=="Completed"&&C(Tn(o,u))}),[u]),I=b.useCallback((()=>{g("../../",{relative:"path"})}),[]),k=b.useCallback(((S,A)=>{C(Vt({sortKey:S,sortOrder:A}))}),[]),T=b.useCallback((S=>{C(Vt({downloadState:S}))}),[]),R=b.useCallback((S=>{if(e)e(S.transactionId,S.transactionType);else if(m!=null){const A=Ya({id:S.transactionId,type:S.transactionType},m);g(A);const L=O(p.state?.pathnameStackToGoBack,p.pathname);g(A,{state:{pathnameStackToGoBack:L}})}}),[m,e]),x=b.useCallback((()=>{y.vendor!=null&&w.trackApAgingDetail("AP Aging",u.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),y.vendor.id,y.vendor.name)}),[y.vendor,u]);return b.useEffect((()=>{E()}),[]),b.useEffect((()=>{y.fetchState==="Completed"&&x()}),[x,y.fetchState]),d.jsx(Lo,{apAgingDetail:y,downloadParams:c,reportDate:u,analytics:w,onTransactionClick:R,onReload:E,onBackClick:I,onColumnSortConfigChanged:k,updateDownloadStateHandler:T,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),ls=()=>{const e=$(),a=H(),t=_((k=>wn(k))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=se({mobileExploreReferrer:"AP Aging"});Ve({isDataReady:t.fetchState==="Completed"});const r=U.getSignedInUser(),s=_((k=>k.tenantState.currentTenantId)),i=_((k=>B(k))),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(ft(h))}),[]);b.useEffect((()=>{f()}),[]);const c=b.useCallback((()=>{a("../",{relative:"path"})}),[]),u=b.useCallback((k=>{e(Qe({searchString:k}))}),[]),C=b.useCallback(((k,T)=>{e(Qe({sortKey:T,sortOrder:k}))}),[]),g=b.useCallback((k=>{a(`./${k}/${h.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[h]),y=b.useCallback((k=>{e(Qe({downloadState:k}))}),[]),E=b.useCallback(((k,T)=>{}),[]),I=b.useCallback(((k,T)=>{e(Qe({selectedDate:k,agingDateSelectionType:T})),e(ft(k))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ge,{analytics:w,onLoad:k=>k.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(Da,{uiState:t.apAgingUIState,report:t,downloadParams:p,analytics:w,onReloadReport:f,onBackClick:c,onSearchTextChange:u,onSortOrderChange:C,onEntityNameClick:g,updateDownloadStateHandler:y,onSelectedDateChanged:I,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},ds=La((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=U.getSignedInUser(),i=_((x=>B(x))),{tenantEmailDomain:l}=K(),m=Z(),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=$(),C=H(),g=_((x=>xn(x,c,o))),y=b.useCallback((()=>{o!=null&&g.fetchState!=="In-Progress"&&g.fetchState!=="Completed"&&u(Dn(o,c))}),[c]),E=b.useCallback((()=>{C("../../",{relative:"path"})}),[]),I=b.useCallback(((x,S)=>{u(Gt({sortKey:x,sortOrder:S}))}),[]),k=b.useCallback((x=>{u(Gt({downloadState:x}))}),[]),T=b.useCallback((x=>{if(e)e(x.transactionId,x.transactionType);else if(l!=null){const S=Ya({id:x.transactionId,type:x.transactionType},l);C(S);const A=O(m.state?.pathnameStackToGoBack,m.pathname);C(S,{state:{pathnameStackToGoBack:A}})}}),[l,e]),R=b.useCallback((()=>{g.customer!=null&&w.trackArAgingDetail("AR Aging",c.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),g.customer.id,g.customer.name)}),[g.customer,c]);return b.useEffect((()=>{y()}),[]),b.useEffect((()=>{g.fetchState==="Completed"&&R()}),[g.fetchState,R]),d.jsx(Yo,{arAgingDetail:g,downloadParams:f,reportDate:c,analytics:w,onTransactionClick:T,onReload:y,onBackClick:E,onColumnSortConfigChanged:I,updateDownloadStateHandler:k,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),us=()=>{const e=$(),a=H(),t=_((I=>Pn(I))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=se({mobileExploreReferrer:"AR Aging"});Ve({isDataReady:t.fetchState==="Completed"});const r=U.getSignedInUser(),s=_((I=>B(I))),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(gt(p))}),[]);b.useEffect((()=>{h()}),[]);const f=b.useCallback((()=>{a("../",{relative:"path"})}),[]),c=b.useCallback((I=>{e(We({searchString:I}))}),[]),u=b.useCallback(((I,k)=>{e(We({sortKey:k,sortOrder:I}))}),[]),C=b.useCallback((I=>{a(`./${I}/${p.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[p]),g=b.useCallback((I=>{e(We({downloadState:I}))}),[]),y=b.useCallback(((I,k)=>{e(We({selectedDate:I,agingDateSelectionType:k})),e(gt(I))}),[]),E=b.useCallback(((I,k)=>{e(On({nodeId:I,isCollapsed:k}))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ge,{analytics:w,onLoad:I=>I.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(Da,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:w,onReloadReport:h,onBackClick:f,onSearchTextChange:c,onSortOrderChange:u,onEntityNameClick:C,updateDownloadStateHandler:g,onSelectedDateChanged:y,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ga=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function Na(e,a){const t=jn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=De(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Rn(n,o))}}}const ms=ne((function(e){const a=Fn(e).accountsInOrder.map(((t,n)=>Ga(t,n)));return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,fetchState:e.cashBalanceState.fetchState,analytics:w}}),Na)(Pa),ps=ne((function(e){const a=Mn(e).accountsInOrder.map(((o,r)=>Ga(o,r))),t=U.getSignedInUser(),n=Je(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:w}}),Na)(Pa);function hs(){const e=H(),a=Z(),{tenantEmailDomain:t}=K(),n=_((o=>B(o).company?.companyInfo.firstMonthOfFY??1));return _((o=>o.cashBalanceState.fetchState))==="Error"?d.jsx(Me,{}):d.jsx(ms,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,firstMonthOfFY:n})}function fs(){const e=H(),a=Z(),{tenantEmailDomain:t}=K(),n=_((o=>B(o).company?.companyInfo.firstMonthOfFY??1));return _((o=>o.cardBalanceState.fetchState))==="Error"?d.jsx(Me,{}):d.jsx(ps,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,firstMonthOfFY:n})}const gs=wt.div`
|
|
1
|
+
import{j as d}from"./liveblocks-e6rGc1UF.js";import{i as K,j as _,g as Z,u as $,h as H,l as ne,k as oa,n as ht,o as P,N as vn}from"./core-CHD8T-IM.js";import{fF as B,VV as He,bE as sa,br as Ee,Xh as En,ka as Tn,Xi as Vt,Xj as wn,kd as ft,Xk as Qe,Xl as xn,ki as Dn,Xm as Gt,Xn as Pn,km as gt,Xo as We,Xp as On,Xq as Fn,Wd as jn,lo as Rn,Xr as Mn,bn as Je,Xs as ra,WT as le,bc as ia,lC as ca,ll as la,WV as de,WU as ae,fE as da,ga as Bn,gq as bt,Xt as Un,Xu as Ln,Xv as ua,Xw as Oe,D$ as Be,E0 as Ue,Eo as Te,Ei as ue,E4 as Le,Xx as Yn,b$ as Ye,Xy as Vn,Xz as Gn,XA as ma,XB as Fe,XC as Nn,ei as et,Aa as pa,XD as Xn,XE as ha,XF as $n,XG as zn,XH as Kn,XI as St,UR as _t,ua as we,l$ as xe,Ey as kt,Ah as qn,Ao as Qn,XJ as Wn,XK as Zn,E1 as Nt,XL as Hn,Ad as Ie,A8 as fa,XM as ge,XN as Xt,XO as Jn,XP as yt,UQ as At,Cl as ga,XQ as eo,XR as ba,XS as to,XT as ao,XU as no,XV as It,CA as oo,CH as so,XW as ro,XX as io,E3 as $t,XY as co,Cj as Ca,XZ as be,X_ as zt,X$ as lo,bq as Sa,ED as _a,Y0 as uo,Y1 as ka,Y2 as mo,Y3 as po,Y4 as ho,Y5 as vt,Ev as fo,Ex as go,Y6 as bo,Y7 as Co,E2 as Kt,Y8 as So,EB as ya,Y9 as Ce,Ya as qt,Yb as _o,Yc as ko,Yd as Aa,lQ as Ia,pX as va,lV as Ea,pV as Ta,pU as wa,pT as xa,BI as yo,dc as Ao,pQ as Io,Uc as vo,q5 as Eo,Ye as To,Yf as wo,Yg as xo,b5 as Et,p$ as Do,ic as Po,gI as Oo,p_ as Fo,le as jo,pY as Ro,pW as Mo,d_ as Bo,dZ as Uo}from"./zeni-epic-state-BO3zdDfL.js";import{z as U,aw as oe,p as O,k as w,G as q,bc as Lo,at as Ve,a9 as Ge,bd as Da,U as N,be as Yo,bf as Pa,E as Vo,bg as Go,bh as No,a as Oa,a2 as Fa,d as ja,as as Xo,bi as $o,ap as zo,N as Tt,bj as Ra,y as re,bk as Ma,bl as Ba,av as Ua,bm as Ko,aj as Ne,W as Xe,bn as qo,X as Qo,bo as Wo,f as G,Q as Zo,l as Ho,a5 as Jo,ar as es,bp as ts,bq as as,br as ns,bs as ve}from"./index-DKH4PK2B.js";import{n as wt}from"./mui-NTaF3UaY.js";import{a as b}from"./sentry-DsyKtMW2.js";import{w as La}from"./withTransactionSidePanel-B_xgLNm6.js";import{c as Ya,t as De,f as me,b as xt,a as Dt,v as os}from"./routePaths-CGyE-cU7.js";import{u as se}from"./useAskAiCfoHostNavButtonProps-BcCbRGDK.js";import Me from"./NotFoundScreen-CtgFRYZy.js";import{u as Pt}from"./useInitialThreadRequest-DDr_z_RH.js";import{t as Va}from"./analyticsHelper-BEL0ra9X.js";import{C as ss}from"./CompanyPassportScreen-CENbDnLW.js";import{u as rs}from"./useAiCfoDashboardSuggestedQuestionsChips-CHbHmZzx.js";import{F as is}from"./FeaturePreviewScreen-D54Nwanb.js";import"./recharts-C6xUtcdL.js";import"./analytics-C3e3An3a.js";import"./plaid-DdTo7m1-.js";import"./dnd-Dwi6R-ey.js";import"./stripe-cKAAJElX.js";import"./lottie-B778bt56.js";import"./lexical-CMNdypK6.js";import"./pdf-Bx92ZlM_.js";import"./utils-CCA3F0sZ.js";import"./TransactionDetailScreen-CQr1YyP0.js";import"./decodeURIComponentSafe-p_nrn8Pg.js";import"./expenseAutomationHelper-kGR6VZFG.js";import"./stripSplatSuffix-CKrdD9MQ.js";import"./MobileAppDrawer-DX2JnkbM.js";import"./InboxNotificationsProvider-x0fdv66l.js";import"./useTaskManagerAccess-CUv6a62x.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]="e7666a96-794c-42c9-a215-bb83356cc962",e._sentryDebugIdIdentifier="sentry-dbid-e7666a96-794c-42c9-a215-bb83356cc962")}catch{}})();const cs=La((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=U.getSignedInUser(),i=_((S=>S.tenantState.currentTenantId)),l=_((S=>B(S))),{tenantEmailDomain:m}=K(),p=Z(),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=$(),g=H(),y=_((S=>En(S,u,o))),E=b.useCallback((()=>{o!=null&&y.fetchState!=="In-Progress"&&y.fetchState!=="Completed"&&C(Tn(o,u))}),[u]),I=b.useCallback((()=>{g("../../",{relative:"path"})}),[]),k=b.useCallback(((S,A)=>{C(Vt({sortKey:S,sortOrder:A}))}),[]),T=b.useCallback((S=>{C(Vt({downloadState:S}))}),[]),R=b.useCallback((S=>{if(e)e(S.transactionId,S.transactionType);else if(m!=null){const A=Ya({id:S.transactionId,type:S.transactionType},m);g(A);const L=O(p.state?.pathnameStackToGoBack,p.pathname);g(A,{state:{pathnameStackToGoBack:L}})}}),[m,e]),x=b.useCallback((()=>{y.vendor!=null&&w.trackApAgingDetail("AP Aging",u.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),y.vendor.id,y.vendor.name)}),[y.vendor,u]);return b.useEffect((()=>{E()}),[]),b.useEffect((()=>{y.fetchState==="Completed"&&x()}),[x,y.fetchState]),d.jsx(Lo,{apAgingDetail:y,downloadParams:c,reportDate:u,analytics:w,onTransactionClick:R,onReload:E,onBackClick:I,onColumnSortConfigChanged:k,updateDownloadStateHandler:T,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),ls=()=>{const e=$(),a=H(),t=_((k=>wn(k))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=se({mobileExploreReferrer:"AP Aging"});Ve({isDataReady:t.fetchState==="Completed"});const r=U.getSignedInUser(),s=_((k=>k.tenantState.currentTenantId)),i=_((k=>B(k))),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(ft(h))}),[]);b.useEffect((()=>{f()}),[]);const c=b.useCallback((()=>{a("../",{relative:"path"})}),[]),u=b.useCallback((k=>{e(Qe({searchString:k}))}),[]),C=b.useCallback(((k,T)=>{e(Qe({sortKey:T,sortOrder:k}))}),[]),g=b.useCallback((k=>{a(`./${k}/${h.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[h]),y=b.useCallback((k=>{e(Qe({downloadState:k}))}),[]),E=b.useCallback(((k,T)=>{}),[]),I=b.useCallback(((k,T)=>{e(Qe({selectedDate:k,agingDateSelectionType:T})),e(ft(k))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ge,{analytics:w,onLoad:k=>k.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(Da,{uiState:t.apAgingUIState,report:t,downloadParams:p,analytics:w,onReloadReport:f,onBackClick:c,onSearchTextChange:u,onSortOrderChange:C,onEntityNameClick:g,updateDownloadStateHandler:y,onSelectedDateChanged:I,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},ds=La((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=U.getSignedInUser(),i=_((x=>B(x))),{tenantEmailDomain:l}=K(),m=Z(),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=$(),C=H(),g=_((x=>xn(x,c,o))),y=b.useCallback((()=>{o!=null&&g.fetchState!=="In-Progress"&&g.fetchState!=="Completed"&&u(Dn(o,c))}),[c]),E=b.useCallback((()=>{C("../../",{relative:"path"})}),[]),I=b.useCallback(((x,S)=>{u(Gt({sortKey:x,sortOrder:S}))}),[]),k=b.useCallback((x=>{u(Gt({downloadState:x}))}),[]),T=b.useCallback((x=>{if(e)e(x.transactionId,x.transactionType);else if(l!=null){const S=Ya({id:x.transactionId,type:x.transactionType},l);C(S);const A=O(m.state?.pathnameStackToGoBack,m.pathname);C(S,{state:{pathnameStackToGoBack:A}})}}),[l,e]),R=b.useCallback((()=>{g.customer!=null&&w.trackArAgingDetail("AR Aging",c.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),g.customer.id,g.customer.name)}),[g.customer,c]);return b.useEffect((()=>{y()}),[]),b.useEffect((()=>{g.fetchState==="Completed"&&R()}),[g.fetchState,R]),d.jsx(Yo,{arAgingDetail:g,downloadParams:f,reportDate:c,analytics:w,onTransactionClick:T,onReload:y,onBackClick:E,onColumnSortConfigChanged:I,updateDownloadStateHandler:k,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),us=()=>{const e=$(),a=H(),t=_((I=>Pn(I))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=se({mobileExploreReferrer:"AR Aging"});Ve({isDataReady:t.fetchState==="Completed"});const r=U.getSignedInUser(),s=_((I=>B(I))),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(gt(p))}),[]);b.useEffect((()=>{h()}),[]);const f=b.useCallback((()=>{a("../",{relative:"path"})}),[]),c=b.useCallback((I=>{e(We({searchString:I}))}),[]),u=b.useCallback(((I,k)=>{e(We({sortKey:k,sortOrder:I}))}),[]),C=b.useCallback((I=>{a(`./${I}/${p.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[p]),g=b.useCallback((I=>{e(We({downloadState:I}))}),[]),y=b.useCallback(((I,k)=>{e(We({selectedDate:I,agingDateSelectionType:k})),e(gt(I))}),[]),E=b.useCallback(((I,k)=>{e(On({nodeId:I,isCollapsed:k}))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ge,{analytics:w,onLoad:I=>I.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(Da,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:w,onReloadReport:h,onBackClick:f,onSearchTextChange:c,onSortOrderChange:u,onEntityNameClick:C,updateDownloadStateHandler:g,onSelectedDateChanged:y,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ga=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function Na(e,a){const t=jn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=De(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Rn(n,o))}}}const ms=ne((function(e){const a=Fn(e).accountsInOrder.map(((t,n)=>Ga(t,n)));return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,fetchState:e.cashBalanceState.fetchState,analytics:w}}),Na)(Pa),ps=ne((function(e){const a=Mn(e).accountsInOrder.map(((o,r)=>Ga(o,r))),t=U.getSignedInUser(),n=Je(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:w}}),Na)(Pa);function hs(){const e=H(),a=Z(),{tenantEmailDomain:t}=K(),n=_((o=>B(o).company?.companyInfo.firstMonthOfFY??1));return _((o=>o.cashBalanceState.fetchState))==="Error"?d.jsx(Me,{}):d.jsx(ms,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,firstMonthOfFY:n})}function fs(){const e=H(),a=Z(),{tenantEmailDomain:t}=K(),n=_((o=>B(o).company?.companyInfo.firstMonthOfFY??1));return _((o=>o.cardBalanceState.fetchState))==="Error"?d.jsx(Me,{}):d.jsx(ps,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,firstMonthOfFY:n})}const gs=wt.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-e6rGc1UF.js";import{a as u}from"./sentry-DsyKtMW2.js";import{u as y,j as b,l as w,g as A,N}from"./core-CHD8T-IM.js";import{TX as U,fF as _,gl as k,TY as L,pS as R,TZ as z}from"./zeni-epic-state-BO3zdDfL.js";import{u as j,z as f,L as C,t as I,G as O,b as $}from"./index-DKH4PK2B.js";import"./mui-NTaF3UaY.js";import{t as P}from"./getLocaleForTenant-D-or0iZO.js";import"./recharts-C6xUtcdL.js";import"./analytics-C3e3An3a.js";import"./plaid-DdTo7m1-.js";import"./dnd-Dwi6R-ey.js";import"./stripe-cKAAJElX.js";import"./lottie-B778bt56.js";import"./lexical-CMNdypK6.js";import"./pdf-Bx92ZlM_.js";import"./utils-CCA3F0sZ.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]="c7c68b6d-a0fe-4cb6-8fa0-27eb89e9b7fb",t._sentryDebugIdIdentifier="sentry-dbid-c7c68b6d-a0fe-4cb6-8fa0-27eb89e9b7fb")}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}=j(),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||(O.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-C8g5HYbF.js → DomesticWireDetailScreen-086WQWRB.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-
|
|
1
|
+
import{j as l}from"./liveblocks-e6rGc1UF.js";import{h as w,g as C,j as h,l as E,i as V}from"./core-CHD8T-IM.js";import{YW as k,Z1 as Y,gG as _,gF as J,gE as L,kP as Q,WU as X,uO as q,fF as B,Yt as D,kN as F,YX as S,Z4 as T,kL as G,l6 as j}from"./zeni-epic-state-BO3zdDfL.js";import{bO as K,a2 as N,N as R,z as U,E as O,a5 as p,f as v,a8 as Z,bP as M,J as z,bQ as ee,p as te}from"./index-DKH4PK2B.js";import{n as H}from"./mui-NTaF3UaY.js";import"./sentry-DsyKtMW2.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]="1c63d510-9693-4128-af09-09ff161340db",e._sentryDebugIdIdentifier="sentry-dbid-1c63d510-9693-4128-af09-09ff161340db")}catch{}})();const ae=E(null,(function(e,t){return{onSaveVendor:a=>{e(Q(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(X("common")),a!=null&&e(q(a))},onGetOtp:a=>{e(L(a,"BillPayVendor"))},onResendOtp:a=>{e(J(a,"BillPayVendor"))},onVerifyOtp:(a,n)=>{e(_(a,n,"BillPayVendor"))},onVerifyOtpSuccess:(a,n,o)=>{e(Y(a,n,o))}}}))(K);function W({vendorId:e,billId:t,isExpressPayPage:a}){const n=w(),o=C(),s=h((d=>k(d,e)));return l.jsx(ae,{location:o,navigate:n,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:a??!1})}const ne=H.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-e6rGc1UF.js";import{a2 as d,ac as f,E as l}from"./index-DKH4PK2B.js";import{D as b}from"./mui-NTaF3UaY.js";import"./sentry-DsyKtMW2.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-e6rGc1UF.js";import{a as d}from"./sentry-DsyKtMW2.js";import{h as B,u as A,g as G,i as F,j as l,N as q,l as $,n as N,o as O}from"./core-CHD8T-IM.js";import{WZ as _,fF as M,We as R,m$ as V,Sf as b,X2 as Y,WT as z,l$ as U,Sg as S,Wj as X,Wk as Z,WV as H,WU as J}from"./zeni-epic-state-BO3zdDfL.js";import{b9 as K,k as L,a5 as Q,p as tt}from"./index-DKH4PK2B.js";import"./mui-NTaF3UaY.js";import{d as k}from"./decodeURIComponentSafe-p_nrn8Pg.js";import{w as et}from"./withTransactionSidePanel-B_xgLNm6.js";import{f as at,c as nt}from"./routePaths-CGyE-cU7.js";import"./recharts-C6xUtcdL.js";import"./analytics-C3e3An3a.js";import"./plaid-DdTo7m1-.js";import"./dnd-Dwi6R-ey.js";import"./stripe-cKAAJElX.js";import"./lottie-B778bt56.js";import"./lexical-CMNdypK6.js";import"./pdf-Bx92ZlM_.js";import"./utils-CCA3F0sZ.js";import"./useAskAiCfoHostNavButtonProps-BcCbRGDK.js";import"./TransactionDetailScreen-CQr1YyP0.js";import"./useInitialThreadRequest-DDr_z_RH.js";import"./expenseAutomationHelper-kGR6VZFG.js";import"./stripSplatSuffix-CKrdD9MQ.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]="2f66b6e9-a790-460e-89c6-eaab7fd60429",a._sentryDebugIdIdentifier="sentry-dbid-2f66b6e9-a790-460e-89c6-eaab7fd60429")}catch{}})();const ot=$((function(a,t){const e=t.entity,o=Y(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:z(a,"common")},trendWithTransactionsReport:o,analytics:L,isAccountingClassesEnabled:U(a)}}),(function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(H({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(J("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(X()),a(Z()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Q(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(S(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(b(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}}))(K),it=et((function({entityType:a,...t}){const e=B(),o=A(),c=G(),[m,T]=d.useState(!1),[h,g]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:W,entityNameEncoded:j}=F(),r=k(W??""),p=k(j??""),f=rt(r,p),w=[r,p].filter((n=>n!=null)),i={name:p,id:r,type:a,zeniId:r,qboId:r},D=l((n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter"))),x=l((n=>M(n).company?.companyInfo.firstMonthOfFY??1)),u=l((n=>R(n.trendWithTransactionsState,i,"EntityDetail")));d.useEffect((()=>{m===!1&&f===!0&&(T(!0),o(V(i)))}),[m,f,i]);const E=l((n=>n.trendState.fetchState)),P=u?.selectedPeriod?.timePeriod??D,v=(function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y})(u?.selectedPeriod?.timePeriod,D);return d.useEffect((()=>{m===!0&&h===!1&&E==="Completed"&&(g(!0),P!=null&&o(b(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))}),[m,h,E]),f?s.jsx(ot,{firstMonthOfFY:x,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),g(!1)},...t}):s.jsx(q,{to:I(w.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 xt({entityType:a}){return s.jsx(N,{children:s.jsx(O,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{xt as EntityDetailRoutes,xt as default};
|
package/dist/assets/{ExpenseAutomationRoutes-BhSlFN1-.js → ExpenseAutomationRoutes-Ce3IicTe.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as b}from"./liveblocks-
|
|
1
|
+
import{j as b}from"./liveblocks-e6rGc1UF.js";import{u as he,h as nt,g as be,j as _,i as Oe,t as Wn,l as Yn,n as Hn,o as He,N as Kn}from"./core-CHD8T-IM.js";import{fF as ke,a14 as Xn,q0 as _e,Ue as Qn,A3 as Zn,a15 as es,a16 as ts,a17 as as,a18 as gt,a19 as Xe,gh as bt,a1a as ca,eW as ns,g0 as ss,a1b as ia,a1c as Qe,qT as os,uR as cs,gS as is,gQ as ls,a1d as rs,r4 as ds,rd as us,qb as ms,qp as wa,gP as re,gR as ps,a1e as hs,qL as Ra,re as Ss,qm as gs,qh as Cs,uX as fs,gO as Me,a1f as tt,Cd as Da,MA as Fa,a1g as _a,Fy as Ma,a1h as Is,eZ as ks,e$ as bs,sS as Tt,W_ as la,X0 as Ts,m2 as Ps,X1 as ys,m9 as Es,dl as vs,Dw as Pt,a1i as As,a1j as xs,fm as yt,sG as ra,WT as ws,a1k as Rs,a1l as Ds,mb as Fs,a1m as _s,Rg as Ms,ma as Us,l$ as Os,qE as Ua,rj as at,tt as Oa,tP as Bs,U4 as Ba,ri as da,rl as Va,rn as Vs,bE as js,ny as Ls,nv as zs,rm as Ze,rk as pe,a1n as $s,rE as ua,a1o as Gs,a1p as Ns,sK as qs,sL as Js,WP as Ws,VV as Ys,a0y as Hs,a1q as Ks,WV as ma,WU as Ke,a1r as pa,mq as Xs,a1s as Qs,a1t as Zs,a1u as eo,a1v as to,qz as ao,a1w as no,a1x as so,a1y as oo,ru as co,md as io,m4 as lo,a1z as ro,mc as ha,Xb as uo,a1A as mo,a1B as po,us as ho,u3 as So,u2 as Ct,a1C as go,a1D as Co,a1E as fo,a1F as Io,nJ as ko,br as bo,nE as Sa,nq as To,a1G as Po,g$ as yo,nB as Eo,sU as vo,sW as Ao,sD as xo,VY as wo,VZ as Ro,F0 as Do,E$ as Fo,Fg as _o,a1H as ga,sJ as Mo,a1I as Uo,rU as Oo,r_ as Bo,s9 as Vo,rX as jo,a1J as Lo,s8 as zo,sP as $o,a1K as Go,t0 as No,sx as qo,t6 as Jo,sC as Wo,rF as Yo,a1L as Ho,qX as Ko,qv as Xo,qC as Ca,rp as Qo,a1M as Zo,a1N as ec,a1O as tc,a1P as ac,a1Q as nc,a1R as sc,a1S as oc,ta as cc,a1T as ic,a1U as lc,a1V as fa,uD as rc,tW as dc,tL as Ia,tJ as uc,a1W as mc,ty as pc,td as hc,tM as Sc,a1X as gc,a1Y as Cc,tj as fc,a1Z as Ic,te as kc,ti as bc,tg as Tc,tS as Pc}from"./zeni-epic-state-BO3zdDfL.js";import ja from"./NotFoundScreen-CtgFRYZy.js";import{a as s,R as La}from"./sentry-DsyKtMW2.js";import{n as Te,S as yc}from"./mui-NTaF3UaY.js";import{N as Be,f as X,k as Q,p as te,ar as za,at as $a,dP as Ec,dQ as vc,O as Ga,z as st,dR as Ac,dS as xc,dT as wc,af as Ue,dU as Rc,dV as ka,bb as ba,dW as Dc,a8 as Na,dX as Fc,l as et,a as _c,dY as Mc,dZ as Uc,F as Oc,W as Bc,d_ as Vc,d$ as jc,e0 as Lc,b5 as zc,bt as $c,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-DKH4PK2B.js";import{u as qa}from"./useAskAiCfoHostNavButtonProps-BcCbRGDK.js";import{g as Pa,b as Kc,c as Xc,h as Qc,a as Zc,i as ei,r as ti,C as ai}from"./TransactionDetailScreen-CQr1YyP0.js";import{u as ni}from"./useActualMatchingMatchDetail-Cc17Q5Tv.js";import{d as si}from"./decodeURIComponentSafe-p_nrn8Pg.js";import{m as Ja,a as Wa}from"./expenseAutomationHelper-kGR6VZFG.js";import{u as Ya,a as Ha,w as oi}from"./withTransactionSidePanel-B_xgLNm6.js";import{b as ci,S as ii,a as li,J as ri}from"./ScheduleDetailsPrepaidExpensesScreen-CLEogplJ.js";import{s as ya,i as Ka,h as di,v as ui,c as mi}from"./routePaths-CGyE-cU7.js";import{a as ft}from"./accountMappingHelper-tmyjt9rr.js";import{D as pi}from"./DrawerScreen-B5BqRZEJ.js";import"./recharts-C6xUtcdL.js";import"./analytics-C3e3An3a.js";import"./plaid-DdTo7m1-.js";import"./dnd-Dwi6R-ey.js";import"./stripe-cKAAJElX.js";import"./lottie-B778bt56.js";import"./lexical-CMNdypK6.js";import"./pdf-Bx92ZlM_.js";import"./utils-CCA3F0sZ.js";import"./useInitialThreadRequest-DDr_z_RH.js";import"./stripSplatSuffix-CKrdD9MQ.js";import"./pathToGoBack-3T3qt1CN.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]="b9bdfee1-3a03-48dc-b4d2-c341b9f9ed12",t._sentryDebugIdIdentifier="sentry-dbid-b9bdfee1-3a03-48dc-b4d2-c341b9f9ed12")}catch{}})();const hi=()=>{const t=he(),n=nt(),f=be(),I=_((C=>ke(C))),{useFeatureGate:k}=Be(),{isFeatureEnabled:o}=k(X.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:r}=k(X.aiAuditScorePercentage),v=_((C=>C.expenseAutomationViewState.selectedPeriodByTenantId)),l=_((C=>Xn(C,I.tenantId))),{isAiCfoAccessEnabled:S,onAskAiCfoClick:R}=qa({mobileExploreReferrer:"Month-End Close Overview"}),x=s.useCallback(((C,h,L=!1)=>{t(_e({tenantId:h,period:{month:C.month,year:C.year},refreshViewInBackground:L}))}),[]),m=s.useCallback((C=>{const h=f.state?.referrer;l.monthEndCloseChecks?.auditSummary!=null&&Q.trackMonthCloseAuditPage(C.month,C.year,l.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",l.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,h??null),t(Qn(I.tenantId,C))}),[I.tenantId,l.monthEndCloseChecks?.auditSummary,l.monthEndCloseChecks?.reportEmailSentDate]),g=v[I.tenantId],u=s.useCallback((()=>{const C=f.state?.referrer;l.monthEndCloseChecks?.auditSummary!=null&&Q.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}=za();return $a({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(Zn(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;Q.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(Ec,{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-e6rGc1UF.js";import{a as r}from"./sentry-DsyKtMW2.js";import{ax as l,ay as p,R as m,a5 as b}from"./index-DKH4PK2B.js";import"./mui-NTaF3UaY.js";import f from"./NotFoundScreen-CtgFRYZy.js";import{h as c,g as u}from"./core-CHD8T-IM.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]="84290e3a-b5eb-4a67-b663-116401857d00",e._sentryDebugIdIdentifier="sentry-dbid-84290e3a-b5eb-4a67-b663-116401857d00")}catch{}})();const _=()=>{const e=c(),a=u(),t=r.useCallback((()=>{window.open("https://www.zeni.ai/demo/request","_blank")}),[]),i=r.useCallback((()=>{(()=>{const n=b(a.state?.pathnameStackToGoBack),d=n.poppedPathname??k();e(d,{state:{pathnameStackToGoBack:n.newStack}})})()}),[]),o=l(a.pathname);return o!=null?s.jsx(p,{menuItem:m(o),onDemoClick:t,onGoBack:i}):s.jsx(f,{})},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-DsyKtMW2.js";import{u as l,h as f,g as m}from"./core-CHD8T-IM.js";import{hY as p,UB as g,UC as _}from"./zeni-epic-state-BO3zdDfL.js";import{u as b,L as h,z as y}from"./index-DKH4PK2B.js";import"./liveblocks-e6rGc1UF.js";import"./recharts-C6xUtcdL.js";import"./mui-NTaF3UaY.js";import"./analytics-C3e3An3a.js";import"./plaid-DdTo7m1-.js";import"./dnd-Dwi6R-ey.js";import"./stripe-cKAAJElX.js";import"./lottie-B778bt56.js";import"./lexical-CMNdypK6.js";import"./pdf-Bx92ZlM_.js";import"./utils-CCA3F0sZ.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]="2a93d830-e3af-449b-98b3-7756e027ec7c",e._sentryDebugIdIdentifier="sentry-dbid-2a93d830-e3af-449b-98b3-7756e027ec7c")}catch{}})();function j(){const e=l(),n=f(),o=m(),{setLoading:i,clearAllLoading:d}=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}))}d();const u=y.getActiveTenantForUser();n(u?.tenantEmailDomain!=null?`/${u.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-e6rGc1UF.js";import{j as d}from"./core-CHD8T-IM.js";import{fF as a}from"./zeni-epic-state-BO3zdDfL.js";import"./sentry-DsyKtMW2.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 a}from"./liveblocks-e6rGc1UF.js";import{a as r}from"./sentry-DsyKtMW2.js";import{u as A,h as P,i as F,j as k,t as Z,l as O,s as H,g as W,N as B,n as oe,o as j}from"./core-CHD8T-IM.js";import{a9 as tt,k as v,ar as R,U as u,cd as it,ce as ot,cf as at,cg as st,ch as ct,ci as rt,cj as lt,ck as dt,cl as ut,cm as gt,cn as mt,co as vt,p as X,cp as pt,cq as St,z as G,af as ce,cr as ft,cs as ht,ct as It,cu as Ct,cv as kt,cw as Et,cx as yt,cy as xt,cz as bt,cA as jt,W as Dt,aj as un,cB as At,cC as Pt,cD as Lt,cE as $t,cF as wt,cG as _t,cH as Ft,cI as Rt,cJ as Tt,cK as Ot,cL as Mt,t as qe,l as $e,cM as Nt,cN as Ut,cO as Bt,cP as Vt,cQ as Ht,cR as qt,cS as zt}from"./index-DKH4PK2B.js";import"./mui-NTaF3UaY.js";import{A as Q}from"./AddressScreen-CrINuapd.js";import M from"./NotFoundScreen-CtgFRYZy.js";import{ZQ as Qt,ZR as Kt,vp as ze,ZS as K,vS as re,ZT as we,ZU as le,wt as be,wA as Gt,wF as gn,ZV as _e,wx as mn,y7 as Qe,vR as Ke,ZW as Zt,ZX as vn,wQ as je,ZY as de,wU as Wt,ZZ as Xt,Z_ as pn,wX as Sn,z2 as Jt,Z$ as Se,_0 as Ge,_1 as fn,vP as Yt,_2 as ei,vJ as ni,_3 as ti,yk as ii,_4 as hn,yt as Ze,_5 as oi,yq as ai,_6 as Fe,gh as Re,_7 as te,_8 as ie,xa as si,vX as We,w0 as In,v_ as ci,vU as ri,x3 as li,w2 as di,xc as ui,_9 as De,xl as Cn,xj as J,xh as ue,xg as gi,_a as kn,yz as Xe,_b as mi,vQ as En,_c as Te,fF as fe,wb as Ae,w8 as Pe,wl as yn,wk as Oe,w5 as vi,we as xn,wn as ae,VC as bn,vT as Me,wi as pi,wj as Si,wh as fi,_d as hi,wV as Ii,wR as jn,_e as Dn,vD as Je,_f as Ci,vz as ki,_g as Ei,yF as yi,yJ as q,yE as xi,xN as he,_h as bi,_i as An,yS as Ye,_j as ji,yP as Di,_k as Pn,xQ as Ai,xR as V,xU as Pi,_l as Ln,y2 as Ee,_m as Li,xb as $n,U8 as wn,_n as $i,yc as wi,_o as _n,_p as _i,_q as Fi,_r as Ri,zH as Ti,_s as Oi,_t as Fn,yZ as Rn,_u as Tn,zF as ye,_v as Mi,zC as Ni,_w as Ui,_x as Bi,_y as Vi,_z as Hi,_A as qi,_B as en,_C as zi,eg as Qi,zL as Ki,_D as Ne,xv as Gi,xq as Zi,_E as ge,xG as On,xy as me,xx as Wi,xB as Mn,_F as Xi,xw as Ji,_G as Nn,z3 as Un,zu as nn,zp as Yi,_H as eo,z4 as no,_I as to,zv as io,zz as oo,_J as Ue,wv as Bn,zg as ao,ww as so,_K as co,_L as Vn,c8 as ro,ms as lo,mt as uo,_M as tn,wu as ve,gl as go,mz as mo,zm as Hn,zX as vo,zj as qn,uX as po,zU as on,uL as So,zR as an,hS as fo,UB as sn,UC as ho,Gh as zn,hK as Io,_N as Co,Vr as ko,_O as Eo,A0 as xe,A1 as yo,_P as xo,_Q as Qn,z_ as bo,_R as jo,_S as Do,yg as Ao,_T as Po}from"./zeni-epic-state-BO3zdDfL.js";import{M as Lo}from"./MobileAppDrawer-DX2JnkbM.js";import{q as pe}from"./QBOConnectionScreen-D8eeXRWb.js";import"./recharts-C6xUtcdL.js";import"./analytics-C3e3An3a.js";import"./plaid-DdTo7m1-.js";import"./dnd-Dwi6R-ey.js";import"./stripe-cKAAJElX.js";import"./lottie-B778bt56.js";import"./lexical-CMNdypK6.js";import"./pdf-Bx92ZlM_.js";import"./utils-CCA3F0sZ.js";import"./InboxNotificationsProvider-x0fdv66l.js";import"./useTaskManagerAccess-CUv6a62x.js";import"./empty-CeRjDJvl.js";import"./pdf-lib-CSbJ_JNk.js";import"./index-BVHBHjSe.js";import"./url-ClJewK9Y.js";import"./index-CKiMoeFX.js";import"./decodeURIComponentSafe-p_nrn8Pg.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]="1299e822-ef52-448e-8335-8786314f704f",t._sentryDebugIdIdentifier="sentry-dbid-1299e822-ef52-448e-8335-8786314f704f")}catch{}})();const $=({event:t,isReady:e=!0})=>e?a.jsx(tt,{analytics:v,onLoad:n=>n.trackPageLoaded(t)}):null;function N(...t){return t.some((e=>e==="Error"))}function $o(){const t=A(),e=P(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[o,s]=r.useState(""),[c,d]=r.useState(""),[l,p]=r.useState(null),g=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),{fetchState:m,hasMore:S,items:f,nextCursor:h,auditLogEntityRouteOptions:E,auditLogListSortFieldOptions:I}=k(Qt),y=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),b=`/${n??""}/invoicing`,C=r.useCallback(((L,U)=>{const T=Kt(b,L,U,E);T!=null&&(v.trackInvoicingActionClick(u.Event.invoicingEntityLinkClicked,{entity:L,entityId:U,fromScreen:"audit_log"}),e(T))}),[E,e,b]);r.useEffect((()=>{const L=setTimeout((()=>d(o)),300);return()=>clearTimeout(L)}),[o]),r.useEffect((()=>{i&&t(ze({filters:y,keepExistingListItems:!1,sort:g}))}),[i,y,g,t]);const D=m==="Not-Started"||m==="In-Progress"&&f.length===0,x=m==="In-Progress"&&f.length>0,w=m==="Completed";return N(m)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingAuditLogPage,isReady:w}),a.jsx(it,{auditLogEntityRouteOptions:E,auditLogListSortFieldOptions:I,entries:f,hasMore:S,isLoading:D,isLoadingMore:x,searchValue:o,sortState:l,onEntityLinkClick:C,onLoadMore:()=>{S&&h!=null&&t(ze({cursor:h,filters:y,keepExistingListItems:!0,sort:g}))},onSearchChange:s,onSortChange:p})]})}function Ie(t,e=!1){const n=A(),i=k((c=>K(c).productNextCursor!=null)),o=k((c=>K(c).productNextCursor)),s=k((c=>K(c).productFetchState.fetchState));r.useEffect((()=>{t&&(e&&s!=="Not-Started"||n(re({filters:{type:"addon|charge"},keepExistingListItems:!1})))}),[t,n,e]),r.useEffect((()=>{t&&s!=="In-Progress"&&i&&o!=null&&n(re({cursor:o,filters:{type:"addon|charge"},keepExistingListItems:!0}))}),[t,n,s,i,o])}function Y(t,e,n,i){const[o,s]=r.useState(0),[c,d]=r.useState(!1),l=r.useRef(t);return r.useEffect((()=>{const p=l.current==="In-Progress";l.current=t,t==="Completed"&&p&&n!=null&&(d(!0),i(n))}),[t,n,i]),r.useEffect((()=>{c&&!e&&(d(!1),s((p=>p+1)))}),[c,e]),o}const wo=new Set(["plan"]),_o=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!==""?o=>{i!==""&&t(mn({action:o,id:i}))}:void 0,onEditChange:o=>{i!==""&&t(_e({id:i,localData:o}))},onSaveEdit:()=>{v.trackInvoicingActionClick(u.Event.invoicingCatalogItemEdited,{itemId:i}),t(gn({id:i}))},onSubFamilyLifecycleAction:(o,s)=>{i!==""&&t(Gt({action:s,id:o,parentItemId:i}))}}}))(ot);function Fo(){const t=A(),e=P(),{item_id:n,tenantEmailDomain:i}=F(),[o]=Z(),{areTenantIdsInSync:s}=R(),c=(d=o.get("kind"))!=null&&wo.has(d)?d:"plan";var d;const l=k((y=>we(y,n))),{pageFetchState:p}=l,g=p.fetchState;r.useEffect((()=>(t(le({id:n})),()=>{t(le({id:n}))})),[t,n]),r.useEffect((()=>{s&&t(be({id:n,kind:c}))}),[s,n,c,t]);const m=r.useCallback((y=>t(be({cacheOverride:!0,id:y,kind:c}))),[t,c]),S=Y(l.fetchState,l.isFormLoading,n,m),f=g==="Completed"&&!l.isFormLoading;Ie(s,!0);const[h,E]=r.useState(f?n:void 0);r.useEffect((()=>{n!=null&&f&&E(n)}),[n,f]);const I=h!==n&&(g==="Not-Started"||g==="In-Progress"||l.isFormLoading);return N(g)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingCatalogItemDetailPage,isReady:f}),a.jsx(_o,{navigate:e,tenantEmailDomain:i,itemId:n??"",kind:c,isLoading:I,view:l},S)]})}const Ro=new Set(["addon","charge","plan"]),To=new Set(["plan"]),Oo=O((function(t,e){const n=we(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:o}=e,s=o!=null?`${n}/catalog/${encodeURIComponent(o)}`:`${n}/catalog`;return{onBack:()=>e.navigate(s),onCancel:()=>{v.trackInvoicingActionClick(u.Event.invoicingCatalogItemFormCancelled),t(le({id:o})),e.navigate(`${n}/catalog`)},onChange:c=>{t(_e({id:o,localData:c}))},onSubmit:()=>{v.trackInvoicingActionClick(u.Event.invoicingCatalogItemSaved,{mode:i}),t(gn({id:o}))}}}))(at);function Mo(){const t=A(),e=P(),{item_id:n,tenantEmailDomain:i}=F(),[o]=Z(),{areTenantIdsInSync:s}=R(),c=n!=null,d=o.get("type"),l=d!=null&&Ro.has(d)?d:void 0,p=(g=o.get("kind"))!=null&&To.has(g)?g:"plan";var g;const m=k((S=>we(S,n)));return Ie(s,!0),r.useEffect((()=>{s&&t(be({id:n,kind:p}))}),[s,n,p,t]),r.useEffect((()=>{c||l==null||m.localData.catalogType===l||t(_e({localData:{...m.localData,catalogType:l}}))}),[c,l,m.localData?.catalogType,t]),r.useEffect((()=>{if(m.fetchState==="Completed"){const S=m.savedItemId??n,f=S!=null?`/${i}/invoicing/catalog/${encodeURIComponent(S)}`:`/${i}/invoicing/catalog`;e(f),t(le({id:n}))}}),[m.fetchState,m.savedItemId,n,t,e,i]),a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingCatalogItemFormPage}),a.jsx(Oo,{navigate:e,tenantEmailDomain:i,defaultType:l,isEdit:c,itemId:n})]})}const No={addons:"addon",all:"item",charges:"charge",plans:"plan"},Uo=O((function(t,e){const n=K(t),i=e.activeTab==="plans",o=e.activeTab==="all",s=i?n.plans:o?[...n.plans,...n.products]:n.products,c=i||o&&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:o&&n.planNextCursor!=null||n.productNextCursor!=null,isLoading:c==="Not-Started"||c==="In-Progress"&&s.length===0,isLoadingMore:c==="In-Progress"&&s.length>0,plans:n.plans,productColumns:n.productColumns,products:n.products}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,i=e.activeTab==="plans",o=e.activeTab==="all",s=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:()=>{v.trackInvoicingActionClick(u.Event.invoicingImportCsvClicked,{entity:"catalog"}),e.navigate(`${n}/data_import`)},onAddItem:()=>{const c=No[e.activeTab];v.trackInvoicingActionClick(u.Event.invoicingAddCatalogItemClicked,{itemType:c}),e.navigate(`${n}/catalog/new?type=${c}`)},onItemClick:(c,d)=>{v.trackInvoicingActionClick(u.Event.invoicingCatalogItemRowClicked,{itemId:d}),e.navigate(`${n}/catalog/${encodeURIComponent(d)}`)},onCatalogItemLifecycleAction:(c,d)=>{v.trackInvoicingActionClick(u.Event.invoicingCatalogItemLifecycleAction,{action:d,fromScreen:"catalog_list",itemId:c}),t(mn({action:Zt(d),id:c}))},onLoadMore:()=>{if(o)return e.planNextCursor!=null&&t(Ke({cursor:e.planNextCursor,filters:e.planFilters,keepExistingListItems:!0,sort:e.sort})),void(e.productNextCursor!=null&&t(re({cursor:e.productNextCursor,filters:e.productFilters,keepExistingListItems:!0,sort:e.sort})));s!=null&&t(i?Ke({cursor:s,filters:e.planFilters,keepExistingListItems:!0,sort:e.sort}):re({cursor:s,filters:e.productFilters,keepExistingListItems:!0,sort:e.sort}))}}}))(st);function Bo(){const t=A(),e=P(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[o,s]=r.useState(""),[c,d]=r.useState("plans"),[l,p]=r.useState(""),[g,m]=r.useState(null),S=r.useMemo((()=>g!=null?{dir:g.direction,field:g.columnKey}:void 0),[g]),f=l.trim()!==""?l.trim():void 0,h=r.useMemo((()=>({search:f,type:"plan"})),[f]),E=r.useMemo((()=>({search:f,type:"addon|charge"})),[f]),I=k((L=>K(L))),y=I.planFilters.search,b=I.planSort,C=I.planNextCursor,D=I.productNextCursor,x=I.fetchState==="Completed",w=I.runningActionId??null;return r.useEffect((()=>{const L=setTimeout((()=>p(o)),300);return()=>clearTimeout(L)}),[o]),r.useEffect((()=>{i&&t(Qe({cacheOverride:!1,planFilters:h,productFilters:E,planSort:S,productSort:S}))}),[i,t,h,E,S]),r.useEffect((()=>{i&&(f!==y||S?.field!==b?.field||S?.dir!==b?.dir)&&t(Qe({cacheOverride:!0,planFilters:h,productFilters:E,planSort:S,productSort:S}))}),[y,b,i,t,h,E,f,S]),N(I.fetchState)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingCatalogPage,isReady:x}),a.jsx(Uo,{navigate:e,tenantEmailDomain:n,activeTab:c,searchValue:o,sortState:g,planFilters:h,productFilters:E,sort:S,planNextCursor:C,productNextCursor:D,runningCatalogItemActionId:w,onSearchChange:s,onTabChange:d,onSortChange:m})]})}const Vo=O((function(t,e){const n=vn(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,o=i!=null?"edit":"create",s=i!=null?`${n}/discounts/${encodeURIComponent(i)}`:`${n}/discounts`;return{onBack:()=>e.navigate(s),onCancel:()=>{v.trackInvoicingActionClick(u.Event.invoicingCouponFormCancelled),t(de({id:i})),e.navigate(`${n}/discounts`)},onChange:c=>{t(Xt({id:i,localData:c}))},onSubmit:()=>{v.trackInvoicingActionClick(u.Event.invoicingCouponSaved,{mode:o}),t(Wt({id:i}))}}}))(ct);function Ho(){const t=A(),e=P(),{coupon_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:o}=R(),{fetchState:s,savedCouponId:c}=k((d=>vn(d,n)));return r.useEffect((()=>{o&&t(je({id:n}))}),[o,n,t]),r.useEffect((()=>{if(s==="Completed"){const d=c??n,l=d!=null?`/${i}/invoicing/discounts/${encodeURIComponent(d)}`:`/${i}/invoicing/discounts`;e(l),t(de({id:n}))}}),[s,c,n,t,e,i]),a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingCouponFormPage}),a.jsx(Vo,{couponId:n,navigate:e,tenantEmailDomain:i})]})}const qo=O((function(t){const e=pn(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:()=>{v.trackInvoicingActionClick(u.Event.invoicingCreateInvoiceCancelled),n.navigate(`${i}/invoices`)},onChange:o=>{e(fn(o))},onSubmit:()=>{const o=ei(t.localData);v.trackInvoicingActionClick(u.Event.invoicingInvoiceCreated,{customerId:o.customer_id,lineItemCount:o.line_items?.length}),e(ni(o))}}}))(lt);function zo(){const t=A(),e=P(),{tenantEmailDomain:n}=F(),[i]=Z(),{areTenantIdsInSync:o}=R(),s=i.get("customerId"),c=k((C=>pn(C))),d=c.fetchState,l=c.localData,p=c.savedInvoiceId,g=k(Sn),m=k((C=>Jt(C))),S=k(Se),f=m.fetchState==="Not-Started"||m.fetchState==="In-Progress"&&g==null,h=S.fetchState==="Not-Started"||S.fetchState==="In-Progress"&&S.customers.length===0,E=f||h,I=m.fetchState==="Completed"&&S.fetchState==="Completed";r.useEffect((()=>(t(Ge()),()=>{t(Ge())})),[t]);const y=r.useRef(!1);r.useEffect((()=>{y.current||s==null||s===""||l.customerId!==""||(y.current=!0,t(fn({...l,customerId:s})))}),[s,l,t]),r.useEffect((()=>{o&&t(Yt({cacheOverride:!1}))}),[o,t]);const b=r.useRef(d);return r.useEffect((()=>{const C=b.current;if(b.current=d,C!=="Completed"&&d==="Completed"){const D=p!=null?`/${n}/invoicing/invoices/${encodeURIComponent(p)}`:`/${n}/invoicing/invoices`;e(D)}}),[d,p,e,n]),a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingCreateInvoicePage,isReady:I}),E?a.jsx(rt,{}):a.jsx(qo,{navigate:e,tenantEmailDomain:n})]})}const Qo=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=>{v.trackInvoicingActionClick(u.Event.invoicingEntityLinkClicked,{customerId:i,fromScreen:"credit_detail",toScreen:"customer"}),e.navigate(`${n}/customers/${encodeURIComponent(i)}`)},onInvoiceClick:i=>{v.trackInvoicingActionClick(u.Event.invoicingEntityLinkClicked,{fromScreen:"credit_detail",invoiceId:i,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}`)},onSubscriptionClick:i=>{v.trackInvoicingActionClick(u.Event.invoicingEntityLinkClicked,{fromScreen:"credit_detail",subscriptionId:i,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(i)}`)}}}))(dt);function Ko(){const t=A(),e=P(),{credit_note_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:o}=R(),s=k((d=>ti(d,n??""))),c=s.fetchState==="Completed";return r.useEffect((()=>{o&&n!=null&&t(ii({id:n}))}),[o,n,t]),N(s.fetchState)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingCreditDetailPage,isReady:c}),a.jsx(Qo,{navigate:e,tenantEmailDomain:i,creditNoteId:n??"",detailView:s})]})}const Go=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",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:()=>{v.trackInvoicingActionClick(u.Event.invoicingImportCsvClicked,{entity:"credits"}),e.navigate(`${n}/data_import`)},onCreditNoteClick:i=>{v.trackInvoicingActionClick(u.Event.invoicingCreditNoteRowClicked,{creditNoteId:i}),e.navigate(`${n}/credits/${encodeURIComponent(i)}`)},onLoadMore:()=>{e.nextCursor!=null&&t(ai({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(ut);function Zo(){const t=A(),e=P(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[o,s]=r.useState(""),[c,d]=r.useState(""),[l,p]=r.useState(null),g=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),m=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:S,appliedSearch:f,appliedSort:h,nextCursor:E,creditNoteListFetchState:I}=k((b=>{const C=hn(b);return{activeStatus:C.activeTab,appliedSearch:C.filters.search,appliedSort:C.sort,nextCursor:C.nextCursor,creditNoteListFetchState:C.fetchState}}),H),y=I==="Completed";return r.useEffect((()=>{const b=setTimeout((()=>d(o)),300);return()=>clearTimeout(b)}),[o]),r.useEffect((()=>{i&&t(Ze({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||g?.field!==h?.field||g?.dir!==h?.dir)&&t(Ze({cacheOverride:!0,filters:m,sort:g}))}),[i,t,m,g,f,h]),N(I)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingCreditsListPage,isReady:y}),a.jsx(Go,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:o,sortState:l,filters:m,sort:g,nextCursor:E,onSearchChange:s,onStatusChange:b=>t(oi(b)),onSortChange:p})]})}const Kn=(t,e,n)=>{const i=`/${t}/invoicing/customers/`;return n!=null?`${i}${encodeURIComponent(n)}/${e}/`:`${i}new/${e}/`},Wo=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:o=>{t(De({id:i,localData:o}))},onCreateInvoice:()=>e.navigate(`${n}/invoices/create`),onInvoiceClick:o=>{v.trackInvoicingActionClick(u.Event.invoicingEntityLinkClicked,{fromScreen:"customer_detail",invoiceId:o,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(o)}`)},onCreatePromotionalCredits:()=>e.onCreatePromotionalCredits(),onNewSubscription:()=>e.navigate(`${n}/subscriptions/new`),onDiscardEdit:()=>{t(J(ue)),t(gi({id:i}))},onOpenAddress:()=>{const o=Kn(e.tenantEmailDomain??"",ue,i),s=X(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(o,{state:{pathnameStackToGoBack:s}})},onOpenPaymentSettings:()=>e.navigate(`${n}/settings/payment-destination`),onSaveEdit:o=>{v.trackInvoicingActionClick(u.Event.invoicingCustomerEdited,{customerId:i}),t(De({id:i,localData:o})),t(Cn({id:i}))},onFetchPaymentLinkEmailPreview:o=>t(ui({cacheOverride:o,customerId:i})),onSendPaymentLink:(o,s,c)=>t(di({body:c,customerId:i,email:o,subject:s})),onSubscriptionClick:o=>{v.trackInvoicingActionClick(u.Event.invoicingEntityLinkClicked,{fromScreen:"customer_detail",subscriptionId:o,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(o)}`)}}}))(vt);function Xo(){const t=A(),e=P(),n=W(),{customer_id:i,tenantEmailDomain:o}=F(),{areTenantIdsInSync:s}=R(),c=k((T=>Fe(T,i))),d=c.pageFetchState.fetchState,l=d==="Completed"&&!c.isFormLoading,[p,g]=r.useState(!1),[m,S]=r.useState(!1),[f,h]=r.useState(l?i:void 0);r.useEffect((()=>{i!=null&&l&&h(i)}),[i,l]);const E=f===i,{plaidTokenFetchState:I,promotionalCreditSubmitState:y}=c,{paymentMethodSaveState:b,setupIntentFetchState:C,stripeConnected:D}=c.record,x=r.useRef(c.record.sendLinkState.fetchState);r.useEffect((()=>{const T=c.record.sendLinkState.fetchState;x.current!=="Error"&&T==="Error"&&t(Re({messageSection:"common",messageText:"failed",showStatusIcon:!0,type:"error"})),x.current=T}),[t,c.record.sendLinkState.fetchState]);const w=C.fetchState==="Error"?C.error?.message??"Failed to start card setup.":b.fetchState==="Error"?b.error?.message??"Failed to save payment method.":I.fetchState==="Error"?I.error?.message??"Failed to connect bank account.":void 0;r.useEffect((()=>(t(te()),t(ie()),()=>{t(te()),t(ie())})),[t]),r.useEffect((()=>{n.state?.openPromotionalCreditsDialog===!0&&(S(!0),e(n.pathname,{replace:!0,state:null}))}),[n.pathname,n.state,e]),r.useEffect((()=>{s&&i!=null&&t(si({id:i}))}),[s,i,t]),r.useEffect((()=>{s&&i!=null&&D&&t(We({customerId:i}))}),[s,i,t,D]);const L=r.useCallback((T=>t(In({id:T}))),[t]),U=Y(c.fetchState,c.isFormLoading,i,L);return N(d)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingCustomerDetailPage,isReady:l}),a.jsx(Wo,{customerId:i??"",editView:c,hasLoadedRecord:E,location:n,navigate:e,tenantEmailDomain:o,onAddPaymentMethod:()=>{t(te()),i!=null&&D&&t(We({customerId:i})),g(!0)},onCreatePromotionalCredits:()=>{t(ie()),S(!0)}},U),a.jsx(gt,{errorMessage:w,isCreatingSetupIntent:C.fetchState==="In-Progress",isSaving:b.fetchState==="In-Progress",open:p,plaidLinkToken:c.record.plaidLinkToken,saveSucceeded:b.fetchState==="Completed",setupIntent:c.record.setupIntent,stripeConnected:D,onChooseCard:()=>{i!=null&&t(ri({customerId:i}))},onClose:()=>{g(!1),t(te())},onSavePaymentMethod:T=>{i!=null&&t(ci({customerId:i,data:T}))}}),a.jsx(mt,{currentBalance:c.record.invoicingCustomer?.promotionalCredits,currencyCode:c.record.invoicingCustomer?.preferredCurrencyCode,errorMessage:y.fetchState==="Error"?y.error?.message??"Failed to add promotional credits.":void 0,isSubmitting:y.fetchState==="In-Progress",open:m,submitSucceeded:y.fetchState==="Completed",onClose:()=>{S(!1),t(ie())},onSubmit:({amount:T,description:ne})=>{i!=null&&t(li({amount:T,customerId:i,currencyCode:c.record.invoicingCustomer?.preferredCurrencyCode,description:ne}))}})]})}const Jo=O((function(t,e){const n=Fe(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,o=i!=null?"edit":"create",s=i!=null?`${n}/customers/${encodeURIComponent(i)}`:`${n}/customers`;return{onBack:()=>e.navigate(s),onCancel:()=>{v.trackInvoicingActionClick(u.Event.invoicingCustomerFormCancelled),t(kn({id:i})),t(J(ue)),e.navigate(`${n}/customers`)},onChange:c=>{t(De({id:i,localData:c}))},onOpenAddress:()=>{const c=Kn(e.tenantEmailDomain??"",ue,i),d=X(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(c,{state:{pathnameStackToGoBack:d}})},onSubmit:()=>{v.trackInvoicingActionClick(u.Event.invoicingCustomerSaved,{mode:o}),t(Cn({id:i}))}}}))(pt);function Yo(){const t=A(),e=P(),n=W(),{customer_id:i,tenantEmailDomain:o}=F(),{areTenantIdsInSync:s}=R(),{fetchState:c,savedCustomerId:d}=k((l=>Fe(l,i)));return r.useEffect((()=>{s&&i!=null&&t(In({id:i}))}),[s,i,t]),r.useEffect((()=>{if(c==="Completed"){const l=d??i,p=l!=null?`/${o}/invoicing/customers/${encodeURIComponent(l)}`:`/${o}/invoicing/customers`;e(p),t(kn({id:i}))}}),[c,d,i,t,e,o]),a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingCustomerFormPage}),a.jsx(Jo,{customerId:i,location:n,navigate:e,tenantEmailDomain:o})]})}const ea=O((function(t){const e=Se(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:()=>{v.trackInvoicingActionClick(u.Event.invoicingAddCustomerClicked),e.navigate(`${n}/customers/new`)},onCustomerClick:i=>{v.trackInvoicingActionClick(u.Event.invoicingCustomerRowClicked,{customerId:i}),e.navigate(`${n}/customers/${encodeURIComponent(i)}`)},onImportCsv:()=>{v.trackInvoicingActionClick(u.Event.invoicingImportCsvClicked,{entity:"customers"}),e.navigate(`${n}/data_import`)},onRowAction:(i,o)=>{switch(o){case"createInvoice":v.trackInvoicingActionClick(u.Event.invoicingCreateInvoiceClicked,{customerId:i,fromScreen:"customers_list"}),e.navigate(`${n}/invoices/create?customerId=${encodeURIComponent(i)}`);break;case"newSubscription":v.trackInvoicingActionClick(u.Event.invoicingAddSubscriptionClicked,{customerId:i,fromScreen:"customers_list"}),e.navigate(`${n}/subscriptions/new?customerId=${encodeURIComponent(i)}`);break;case"createPromotionalCredits":v.trackInvoicingActionClick(u.Event.invoicingPromotionalCreditsClicked,{customerId:i,fromScreen:"customers_list"}),e.navigate(`${n}/customers/${encodeURIComponent(i)}`,{state:{openPromotionalCreditsDialog:!0}})}},onLoadMore:()=>{e.nextCursor!=null&&t(En({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(St);function na(){const t=A(),e=P(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[o,s]=r.useState(""),[c,d]=r.useState(""),[l,p]=r.useState(null),g=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),m=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:S,appliedSearch:f,appliedSort:h,nextCursor:E,customerListFetchState:I}=k((b=>{const C=Se(b);return{activeStatus:C.activeTab,appliedSearch:C.filters.search,appliedSort:C.sort,nextCursor:C.nextCursor,customerListFetchState:C.fetchState}}),H),y=I==="Completed";return r.useEffect((()=>{const b=setTimeout((()=>d(o)),300);return()=>clearTimeout(b)}),[o]),r.useEffect((()=>{i&&t(Xe({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||g?.field!==h?.field||g?.dir!==h?.dir)&&t(Xe({cacheOverride:!0,filters:m,sort:g}))}),[i,t,m,g,f,h]),N(I)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingCustomersListPage,isReady:y}),a.jsx(ea,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:o,sortState:l,filters:m,sort:g,nextCursor:E,onSearchChange:s,onStatusChange:b=>t(mi(b)),onSortChange:p})]})}const Le=(t,e)=>e==null?void 0:t.sessionDetail[e]??t.sessions.find((n=>n.id===e)),ta=O((function(t,e){const{authParams:n,csvDownloadUrl:i,filters:o,sessionId:s,view:c}=e,d=s==null?void 0:c.diagnosticsBySession[s],l=d?.fetch.fetchState??"Not-Started";return{authParams:n,csvDownloadUrl:i,diagnostics:d?.items??[],errorMessage:l==="Error"?d?.fetch.error?.message:void 0,expired:d?.expired??!1,filters:o,hasMore:d?.nextCursor!=null,isLoading:l==="Not-Started"||l==="In-Progress",isLoadingMore:l==="In-Progress"&&(d?.items.length??0)>0,session:Le(c,s)}}),(function(t,e){const{filters:n,navigate:i,sessionId:o,tenantEmailDomain:s,view:c}=e,d=o==null?void 0:c.diagnosticsBySession[o],l=Le(c,o),p=c.actionStateByKind.retry?.fetchState==="In-Progress",g=c.actionStateByKind.rollback?.fetchState==="In-Progress",m=l?.status==="done"&&l.rollback_available_until!=null&&new Date(l.rollback_available_until).getTime()>Date.now()&&!g;return{onBack:()=>i(`/${s}/invoicing/data_import`),onDownloadError:()=>{t(Re({messageSection:"invoicing_data_import_download",messageText:"failed",showStatusIcon:!0,type:"error"}))},onFiltersChange:e.onFiltersChange,onLoadMore:()=>{o!=null&&d?.nextCursor!=null&&t(Pe({...n,cursor:d.nextCursor,sessionId:o}))},onRetry:l?.status!=="failed"||p?void 0:()=>{o!=null&&t(Oe(o))},onRollback:m?()=>{o!=null&&t(yn(o))}:void 0}}))(ft);function ia(){const t=A(),e=P(),{sessionId:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:o}=R(),[s,c]=r.useState({}),d=k(Te),l=k(fe),p=r.useMemo((()=>{const E=G.getSignedInUser();return{userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:l.tenantId}}),[l.tenantId]),g=Le(d,n),m=n==null?void 0:d.diagnosticsBySession[n];r.useEffect((()=>{o&&n!=null&&t(Ae(n))}),[o,t,n]),r.useEffect((()=>{if(!o||n==null)return;const E=setTimeout((()=>{t(Pe({...s,sessionId:n}))}),300);return()=>clearTimeout(E)}),[o,t,s,n]);const S=g?.status==="scanning"||g?.status==="importing";r.useEffect((()=>{if(!o||n==null||!S)return;const E=setInterval((()=>{t(Ae(n)),t(Pe({...s,sessionId:n}))}),3e3);return()=>clearInterval(E)}),[o,t,s,S,n]);const f=r.useMemo((()=>{if(n==null)return"";const E=new URLSearchParams;s.moduleId!=null&&E.set("module_id",s.moduleId),s.level!=null&&E.set("level",s.level),s.outcome!=null&&E.set("outcome",s.outcome),s.search!=null&&s.search.trim()!==""&&E.set("search",s.search.trim());const I=E.toString();return`${ce?.invoicingMicroServiceBaseUrl??""}/1.0/data-import/${encodeURIComponent(n)}/issues.csv${I===""?"":`?${I}`}`}),[s,n]),h=m?.fetch.fetchState??"Not-Started";return N(h)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingDataImportHubPage,isReady:g!=null&&h!=="Not-Started"}),a.jsx(ta,{authParams:p,csvDownloadUrl:f,filters:s,navigate:e,sessionId:n,tenantEmailDomain:i,view:d,onFiltersChange:c})]})}const Gn=t=>`invoicing_active_migration:${t}`,se=(t,e)=>{if(t!=null&&t!=="")try{const n=Gn(t);e==null?sessionStorage.removeItem(n):sessionStorage.setItem(n,e)}catch{}},oa=O((function(t,e){const{sessions:n,sessionsFetch:i,statusFetch:o,statusRows:s}=e.view;return{isLoading:!(o.fetchState!=="Not-Started"&&o.fetchState!=="In-Progress"||s.length!==0||i.fetchState!=="Not-Started"&&i.fetchState!=="In-Progress"),sessions:n,statusRows:s}}),(function(t,e){const{navigate:n,tenantEmailDomain:i}=e,o=s=>{const c=s??null;t(ae(c)),se(i,c),n(`/${i}/invoicing/data_import/migrate`)};return{onContinueSession:s=>{v.trackInvoicingActionClick(u.Event.invoicingImportSessionAction,{action:"continue",sessionId:s}),o(s)},onNewImport:()=>{v.trackInvoicingActionClick(u.Event.invoicingNewImportClicked),o()},onRetrySession:s=>{v.trackInvoicingActionClick(u.Event.invoicingImportSessionAction,{action:"retry",sessionId:s}),t(Oe(s)),o(s)},onRollbackSession:s=>{v.trackInvoicingActionClick(u.Event.invoicingImportSessionAction,{action:"rollback",sessionId:s}),t(yn(s))},onViewSession:s=>{v.trackInvoicingActionClick(u.Event.invoicingImportSessionAction,{action:"view_details",sessionId:s}),n(`/${i}/invoicing/data_import/${encodeURIComponent(s)}`)}}}))(ht);function aa(){const t=A(),e=P(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),o=k(Te);r.useEffect((()=>{i&&(t(vi()),t(xn()))}),[i,t]);const s=o.statusFetch.fetchState==="Completed"&&o.sessionsFetch.fetchState==="Completed";return a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingDataImportHubPage,isReady:s}),a.jsx(oa,{navigate:e,tenantEmailDomain:n,view:o})]})}const sa=O((function(t,e){const{activeId:n,authParams:i,integrationsView:o,settings:s,templatesDownloadUrl:c,view:d}=e,{actionStateByKind:l,sessionDetail:p,sessions:g}=d,m=o.externalConnections?.revenue?.find((f=>f.connectionName==="chargebee")),S=n!=null?p[n]:void 0;return{authParams:i,templatesDownloadUrl:c,chargebeeConnected:s?.chargebee_connected===!0||(m?.isValid??!1),chargebeeConnectorAvailable:m!=null,chargebeeSite:s?.chargebee_site,connectError:l.connect?.error?.message,connecting:l.connect?.fetchState==="In-Progress",retrying:l.retry?.fetchState==="In-Progress",session:S??g.find((f=>f.id===n)),starting:l.start?.fetchState==="In-Progress",uploading:l.upload?.fetchState==="In-Progress"}}),(function(t,e){const{activeId:n,navigate:i,tenantEmailDomain:o}=e;return{onBack:e.onBack,onDownloadError:()=>{t(Re({messageSection:"invoicing_data_import_download",messageText:"failed",showStatusIcon:!0,type:"error"}))},onDownloadTemplates:()=>{v.trackInvoicingActionClick(u.Event.invoicingImportTemplatesDownloaded)},onFetchFromChargebee:()=>{v.trackInvoicingActionClick(u.Event.invoicingChargebeeConnectClicked),t(fi())},onGoToIntegrations:()=>{i(`/${o}/invoicing/settings`)},onGoToOverview:()=>i(`/${o}/invoicing/overview`),onRetry:()=>{n!=null&&t(Oe(n))},onSaveLater:()=>{v.trackInvoicingActionClick(u.Event.invoicingImportSavedForLater),e.onBack()},onStartImport:()=>{v.trackInvoicingActionClick(u.Event.invoicingImportStarted),n!=null&&t(Si(n))},onUpload:s=>{v.trackInvoicingActionClick(u.Event.invoicingImportFileUploaded),t(pi({files:s}))},onViewDetails:n==null?void 0:()=>i(`/${o}/invoicing/data_import/${encodeURIComponent(n)}`)}}))(It);function ca(){const t=A(),e=P(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),o=k(Sn),s=k(fe),c=r.useMemo((()=>{const I=G.getSignedInUser();return{userId:I?.userId??"",sessionId:I?.zeniSessionId??"",tenantId:s.tenantId}}),[s.tenantId]),d=`${ce?.invoicingMicroServiceBaseUrl??""}/1.0/data-import/templates`,l=s.companyId??G.getSignedInUserTenant(n??"")?.companyId,p=k((I=>bn(I,l))),g=k(Te),{activeMigrationSessionId:m}=g,S=m??void 0,f=S!=null?g.sessionDetail[S]??g.sessions.find((I=>I.id===S)):void 0;r.useEffect((()=>{i&&(t(Me()),t(xn()))}),[i,t]),r.useEffect((()=>{if(m!=null)return;const I=(y=>{if(y==null||y==="")return null;try{return sessionStorage.getItem(Gn(y))}catch{return null}})(n);I!=null&&t(ae(I))}),[m,t,n]),r.useEffect((()=>{se(n,m)}),[m,n]);const h=f?.status,E=h==="scanning"||h==="importing";return r.useEffect((()=>{if(!i||S==null||!E)return;const I=setInterval((()=>{t(Ae(S))}),3e3);return()=>clearInterval(I)}),[i,S,E,t]),r.useEffect((()=>{h==="done"&&(t(ae(null)),se(n,null))}),[t,h,n]),a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingDataImportMigratePage}),a.jsx(sa,{activeId:S,authParams:c,integrationsView:p,navigate:e,settings:o,templatesDownloadUrl:d,tenantEmailDomain:n,view:g,onBack:()=>{t(ae(null)),se(n,null),e(`/${n}/invoicing/data_import`)}})]})}const ra=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:o=>{t(jn({action:o,id:i}))},onSaveEdit:o=>{v.trackInvoicingActionClick(u.Event.invoicingCouponEdited,{couponId:i}),t(Ii({data:o,id:i}))}}}))(Ct);function la(){const t=A(),e=P(),{coupon_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:o}=R(),s=k((h=>hi(h,n))),c=s.actionState.fetchState==="In-Progress",d=s.pageFetchState.fetchState,l=d==="Completed",[p,g]=r.useState(l?n:void 0);r.useEffect((()=>{n!=null&&l&&g(n)}),[n,l]);const m=p===n;r.useEffect((()=>(t(de({id:n})),()=>{t(de({id:n}))})),[n,t]),r.useEffect((()=>{o&&t(je({id:n}))}),[o,n,t]);const S=r.useCallback((h=>t(je({cacheOverride:!0,id:h}))),[t]),f=Y(s.fetchState,s.isFormLoading,n,S);return N(d)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingDiscountDetailPage,isReady:l}),a.jsx(ra,{hasLoadedRecord:m,couponId:n??"",discountLifecycleActionOptions:s.discountLifecycleActionOptions,editView:s,isRunningLifecycleAction:c,navigate:e,tenantEmailDomain:i},f)]})}const da=O((function(t){const e=Dn(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=>{v.trackInvoicingActionClick(u.Event.invoicingDiscountRowClicked,{couponId:i}),e.navigate(`${n}/discounts/${encodeURIComponent(i)}`)},onCreateCoupon:()=>{v.trackInvoicingActionClick(u.Event.invoicingCreateCouponClicked),e.navigate(`${n}/discounts/new`)},onImportCsv:()=>{v.trackInvoicingActionClick(u.Event.invoicingImportCsvClicked,{entity:"discounts"}),e.navigate(`${n}/data_import`)},onDiscountLifecycleAction:(i,o)=>{v.trackInvoicingActionClick(u.Event.invoicingCouponLifecycleAction,{action:o,couponId:i,fromScreen:"discounts_list"}),t(jn({action:o,id:i}))},onLoadMore:()=>{e.nextCursor!=null&&t(ki({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(kt);function ua(){const t=A(),e=P(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[o,s]=r.useState(""),[c,d]=r.useState(""),[l,p]=r.useState(null),g=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),m=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:S,appliedSearch:f,appliedSort:h,nextCursor:E,couponListFetchState:I,runningDiscountActionId:y}=k((C=>{const D=Dn(C);return{activeStatus:D.activeTab,appliedSearch:D.filters.search,appliedSort:D.sort,nextCursor:D.nextCursor,couponListFetchState:D.fetchState,runningDiscountActionId:D.runningActionId??null}}),H),b=I==="Completed";return r.useEffect((()=>{const C=setTimeout((()=>d(o)),300);return()=>clearTimeout(C)}),[o]),r.useEffect((()=>{i&&t(Je({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||g?.field!==h?.field||g?.dir!==h?.dir)&&t(Je({cacheOverride:!0,filters:m,sort:g}))}),[i,t,m,g,f,h]),N(I)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingDiscountsListPage,isReady:b}),a.jsx(da,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:o,sortState:l,filters:m,sort:g,nextCursor:E,runningDiscountActionId:y,onSearchChange:s,onStatusChange:C=>t(Ci(C)),onSortChange:p})]})}const ga=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,o=i!=="";return{onBack:()=>e.navigate(`${n}/dunning`),onInvoiceClick:s=>{v.trackInvoicingActionClick(u.Event.invoicingEntityLinkClicked,{caseId:i,fromScreen:"dunning_detail",invoiceId:s,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(s)}`)},onCancel:o?()=>t(q({action:"cancel",id:i})):void 0,onResolve:o?()=>{v.trackInvoicingActionClick(u.Event.invoicingDunningAction,{action:"resolve",caseId:i}),t(q({action:"resolve",id:i}))}:void 0,onResume:o?()=>{v.trackInvoicingActionClick(u.Event.invoicingDunningAction,{action:"resume",caseId:i}),t(q({action:"resume",id:i}))}:void 0,onRetry:o?()=>{v.trackInvoicingActionClick(u.Event.invoicingDunningAction,{action:"retry",caseId:i}),t(q({action:"retry",id:i}))}:void 0}}))(yt);function ma(){const t=A(),e=P(),{case_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:o}=R(),s=k((x=>Ei(x,n??""))),c=s.fetchState==="Completed",d=s.dunningCase?.invoiceID,[l,p]=r.useState("idle"),[g,m]=r.useState(!1),[S,f]=r.useState(),[h,E]=r.useState(!1),I=r.useCallback((()=>{p("idle"),m(!1),f(void 0),E(!1)}),[]),y=r.useCallback((()=>{if(n==null)return;t(yi({id:n})),p("idle"),m(!1);const x=s.emailPreview.preview;f(x==null?void 0:{body:x.body,cc:x.cc,subject:x.subject,to:x.to}),E(!0)}),[n,t,s.emailPreview.preview]),b=r.useCallback((x=>{n!=null&&l!=="pending"&&(m(!1),p("pending"),v.trackInvoicingActionClick(u.Event.invoicingDunningAction,{action:"send-email",caseId:n}),t(q({action:"send-email",body:x,id:n})))}),[n,t,l]),C=r.useMemo((()=>s.emailPreview.preview==null?void 0:{bodyToken:s.emailPreview.preview.bodyToken,renderedHtmlTemplate:s.emailPreview.preview.renderedHtmlTemplate,subjectToken:s.emailPreview.preview.subjectToken}),[s.emailPreview.preview]);r.useEffect((()=>{o&&n!=null&&t(xi({id:n}))}),[o,n,t]),r.useEffect((()=>{o&&d!=null&&t(he({invoiceId:d}))}),[o,d,t]),r.useEffect((()=>{p("idle"),m(!1),f(void 0),E(!1)}),[n]),r.useEffect((()=>{o||(p("idle"),m(!1),f(void 0),E(!1))}),[o]),r.useEffect((()=>{h&&S==null&&s.emailPreview.preview!=null&&f({body:s.emailPreview.preview.body,cc:s.emailPreview.preview.cc,subject:s.emailPreview.preview.subject,to:s.emailPreview.preview.to})}),[s.emailPreview.preview,S,h]),r.useEffect((()=>{l==="pending"&&(s.actionState.fetchState!=="In-Progress"?g&&s.actionState.fetchState==="Completed"?(n!=null&&t(bi({id:n})),I()):g&&s.actionState.fetchState==="Error"&&p("failed"):m(!0))}),[n,I,t,l,g,s.actionState.fetchState]);const D=d!=null&&s.linkedInvoice?.id===d?s.linkedInvoice.dunningAttempts:void 0;return N(s.fetchState)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingDunningDetailPage,isReady:c}),a.jsx(ga,{navigate:e,tenantEmailDomain:i,caseId:n??"",readView:s,dunningAttempts:D,onSendEmail:y}),a.jsx(Et,{initialDraft:S,isPreviewLoading:s.emailPreview.fetchState==="Not-Started"||s.emailPreview.fetchState==="In-Progress",isSending:l==="pending",onClose:I,onSend:b,open:h,preview:C,previewErrorMessage:s.emailPreview.fetchState==="Error"?s.emailPreview.error?.message:void 0,sendErrorMessage:l==="failed"?s.actionState.error?.message:void 0})]})}const va=O((function(t){const e=An(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=>{v.trackInvoicingActionClick(u.Event.invoicingDunningCaseRowClicked,{caseId:i}),e.navigate(`${n}/dunning/${encodeURIComponent(i)}`)},onRowAction:(i,o)=>{o!=="retry"&&o!=="resume"&&o!=="resolve"&&o!=="cancel"||(v.trackInvoicingActionClick(u.Event.invoicingDunningAction,{action:o,caseId:i,fromScreen:"dunning_list"}),t(q({action:o,id:i})))},onLoadMore:()=>{e.nextCursor!=null&&t(Di({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(xt);function pa(){const t=A(),e=P(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[o,s]=r.useState(""),[c,d]=r.useState(""),[l,p]=r.useState(null),g=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),m=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:S,appliedSearch:f,appliedSort:h,nextCursor:E,dunningCaseListFetchState:I}=k((b=>{const C=An(b);return{activeStatus:C.activeTab,appliedSearch:C.filters.search,appliedSort:C.sort,nextCursor:C.nextCursor,dunningCaseListFetchState:C.fetchState}}),H),y=I==="Completed";return r.useEffect((()=>{const b=setTimeout((()=>d(o)),300);return()=>clearTimeout(b)}),[o]),r.useEffect((()=>{i&&t(Ye({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||g?.field!==h?.field||g?.dir!==h?.dir)&&t(Ye({cacheOverride:!0,filters:m,sort:g}))}),[i,t,m,g,f,h]),N(I)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingDunningListPage,isReady:y}),a.jsx(va,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:o,sortState:l,filters:m,sort:g,nextCursor:E,onSearchChange:s,onStatusChange:b=>t(ji(b)),onSortChange:p})]})}const Sa=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:o=>{v.trackInvoicingActionClick(u.Event.invoicingEntityLinkClicked,{customerId:o,fromScreen:"invoice_detail",toScreen:"customer"}),e.navigate(`${n}/customers/${encodeURIComponent(o)}`)},onIssueCreditNote:()=>{v.trackInvoicingActionClick(u.Event.invoicingCreditNoteIssued,{invoiceId:i}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}/issue-credit-note`)},onRecordPayment:()=>{v.trackInvoicingActionClick(u.Event.invoicingRecordPaymentClicked,{fromScreen:"invoice_detail",invoiceId:i}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}/record-payment`)},onRegenerate:()=>{v.trackInvoicingActionClick(u.Event.invoicingInvoiceRegenerated,{invoiceId:i}),t(V({action:"regenerate",invoiceId:i}))},onSaveEdit:o=>{v.trackInvoicingActionClick(u.Event.invoicingInvoiceEdited,{invoiceId:i}),t(Pi({data:{due_date:o.due_date!==""?o.due_date:void 0,notes:o.notes.trim()!==""?o.notes.split(`
|
|
2
|
+
`).map((s=>s.trim())).filter((s=>s!=="")).map((s=>({note:s}))):void 0,po_number:o.po_number!==""?o.po_number:null},invoiceId:i}))},onSendReminder:()=>{v.trackInvoicingActionClick(u.Event.invoicingInvoiceReminderSent,{invoiceId:i}),t(V({action:"send-reminder",invoiceId:i}))},onSubscriptionClick:o=>{v.trackInvoicingActionClick(u.Event.invoicingEntityLinkClicked,{fromScreen:"invoice_detail",subscriptionId:o,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(o)}`)},onVoid:o=>{v.trackInvoicingActionClick(u.Event.invoicingInvoiceVoided,{invoiceId:i}),t(V({action:"void",invoiceId:i,body:o}))}}}))(bt);function fa(){const t=A(),e=P(),{invoice_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:o}=R(),s=k((f=>Pn(f,n??""))),c=s.pageFetchState.fetchState,d=c==="Completed",[l,p]=r.useState(d?n:void 0);r.useEffect((()=>{n!=null&&d&&p(n)}),[n,d]);const g=l===n;r.useEffect((()=>{o&&n!=null&&t(Ai({invoiceId:n}))}),[o,n,t]);const m=r.useCallback((f=>t(he({invoiceId:f}))),[t]),S=Y(s.actionState.fetchState,s.fetchState==="In-Progress",n,m);return N(c)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingInvoiceDetailPage,isReady:d}),a.jsx(Sa,{invoiceId:n??"",hasLoadedRecord:g,navigate:e,tenantEmailDomain:i,view:s},S)]})}const ha=O((function(t){const e=Ln(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:()=>{v.trackInvoicingActionClick(u.Event.invoicingCreateInvoiceClicked),e.navigate(`${n}/invoices/create`)},onImportCsv:()=>{v.trackInvoicingActionClick(u.Event.invoicingImportCsvClicked,{entity:"invoices"}),e.navigate(`${n}/data_import`)},onInvoiceClick:i=>{v.trackInvoicingActionClick(u.Event.invoicingInvoiceRowClicked,{invoiceId:i}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}`)},onRowAction:(i,o)=>{switch(o){case"recordPayment":v.trackInvoicingActionClick(u.Event.invoicingRecordPaymentClicked,{fromScreen:"invoices_list",invoiceId:i}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}/record-payment`);break;case"issueCreditNote":v.trackInvoicingActionClick(u.Event.invoicingCreditNoteIssued,{fromScreen:"invoices_list",invoiceId:i}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}/issue-credit-note`);break;case"sendReminder":v.trackInvoicingActionClick(u.Event.invoicingInvoiceReminderSent,{fromScreen:"invoices_list",invoiceId:i}),t(V({action:"send-reminder",invoiceId:i}));break;case"regenerate":v.trackInvoicingActionClick(u.Event.invoicingInvoiceRegenerated,{fromScreen:"invoices_list",invoiceId:i}),t(V({action:"regenerate",invoiceId:i}));break;case"void":v.trackInvoicingActionClick(u.Event.invoicingInvoiceVoided,{fromScreen:"invoices_list",invoiceId:i}),t(V({action:"void",invoiceId:i}))}},onVoidInvoice:(i,o)=>{v.trackInvoicingActionClick(u.Event.invoicingInvoiceVoided,{fromScreen:"invoices_list",invoiceId:i}),t(V({action:"void",invoiceId:i,body:o}))},onLoadMore:()=>{e.nextCursor!=null&&t($n({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(jt);function Ia(){const t=A(),e=P(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[o,s]=r.useState(""),[c,d]=r.useState(""),[l,p]=r.useState(null),g=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),m=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:S,appliedSearch:f,appliedSort:h,nextCursor:E,invoiceListFetchState:I,voidingInvoiceId:y}=k((C=>{const D=Ln(C);return{activeStatus:D.activeTab,appliedSearch:D.filters.search,appliedSort:C.invoicingInvoiceListState.sort,nextCursor:D.nextCursor,invoiceListFetchState:D.fetchState,voidingInvoiceId:D.runningActionId}}),H),b=I==="Completed";return r.useEffect((()=>{const C=setTimeout((()=>d(o)),300);return()=>clearTimeout(C)}),[o]),r.useEffect((()=>{i&&t(Ee({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||g?.field!==h?.field||g?.dir!==h?.dir)&&t(Ee({cacheOverride:!0,filters:m,sort:g}))}),[i,t,m,g,f,h]),N(I)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingInvoicesListPage,isReady:b}),a.jsx(ha,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:o,sortState:l,filters:m,sort:g,nextCursor:E,voidingInvoiceId:y,onSearchChange:s,onStatusChange:C=>{t(Li(C)),t(Ee({cacheOverride:!1,filters:m,sort:g}))},onSortChange:p})]})}function cn(){const t=A(),e=P(),{tenantEmailDomain:n}=F(),i=Dt(),o=un(),[s,c]=r.useState(!1),{acceptTermsState:d,status:l}=k(wn),p=$i(i?.loggedInUserRoleMap),g=`/${n}/invoicing`,m=S=>{c(S)};return l==="completed"?a.jsx(B,{to:`${g}/overview`,replace:!0}):l==="settings"&&p?a.jsx(B,{to:`${g}/settings`,replace:!0}):a.jsxs(a.Fragment,{children:[a.jsx(Lo,{isAppContentDrawerOpen:s,handleDrawerToggle:m}),a.jsx(At,{analytics:v,isAccepting:d.fetchState==="In-Progress",isReadOnlyUser:!p,meetingUrl:o("invoicing_promo"),onAcceptClick:()=>{t(wi())},onBackClick:()=>{e(`/${n}`)},onClickMenuIcon:()=>{m(!0)}})]})}const Ca=O((function(t,e){const n=_n(t,e.invoiceId),{invoice:i,localData:o,reasonCodeOptions:s,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:o,reasonCodeOptions:s,typeOptions:d}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing/invoices/${encodeURIComponent(e.invoiceId)}`,i=()=>e.navigate(n);return{onBack:i,onCancel:i,onChange:o=>{t(Oi({localData:o}))},onSubmit:()=>{v.trackInvoicingActionClick(u.Event.invoicingCreditNoteIssued,{invoiceId:e.invoiceId}),t(Ti())}}}))(Pt);function ka(){const t=A(),e=P(),{invoice_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:o}=R(),{fetchState:s,invoice:c,isPageReady:d,issuedCreditNoteId:l,submitState:p}=k((f=>_n(f,n??""))),g=`/${i}/invoicing`,m=r.useRef(null);r.useEffect((()=>{t(_i()),m.current=null}),[t,n]),r.useEffect((()=>{o&&n!=null&&t(he({invoiceId:n}))}),[o,t,n]),r.useEffect((()=>{c!=null&&n!=null&&s==="Completed"&&m.current!==n&&(m.current=n,t(Fi({localData:Ri(c)})))}),[t,s,c,n]);const S=r.useRef(p.fetchState);return r.useEffect((()=>{const f=S.current;S.current=p.fetchState,f!=="Completed"&&p.fetchState==="Completed"&&l!=null&&e(`${g}/credits/${encodeURIComponent(l)}`)}),[l,e,p.fetchState,g]),a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingInvoiceDetailPage,isReady:d}),a.jsx(Ca,{invoiceId:n??"",navigate:e,tenantEmailDomain:i})]})}const Ea=O((function(t){return{invoicingOverview:Fn(t)}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{onRefresh:()=>{t(Rn(e.selectedPeriod,!0))},onSubscriptionClick:i=>{v.trackInvoicingActionClick(u.Event.invoicingSubscriptionTileClicked,{subscriptionId:i}),e.navigate(`${n}/subscriptions/${i}`)},onViewInvoices:()=>{v.trackInvoicingActionClick(u.Event.invoicingViewInvoicesClicked),e.navigate(`${n}/invoices`)},onViewPayments:()=>{v.trackInvoicingActionClick(u.Event.invoicingViewPaymentsClicked),e.navigate(`${n}/payments`)}}}))(Lt);function ya(){const t=A(),e=P(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[o]=r.useState((()=>{const c=new Date;return{month:c.getMonth()+1,year:c.getFullYear()}})),s=k((c=>Fn(c).fetchState))==="Completed";return r.useEffect((()=>{i&&t(Rn(o))}),[i,t,o]),a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingOverviewPage,isReady:s}),a.jsx(Ea,{navigate:e,selectedPeriod:o,tenantEmailDomain:n})]})}const xa=O((function(t){const e=Tn(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:()=>{v.trackInvoicingActionClick(u.Event.invoicingImportCsvClicked,{entity:"payments"}),e.navigate(`${n}/data_import`)},onTransactionClick:i=>{v.trackInvoicingActionClick(u.Event.invoicingPaymentRowClicked,{transactionId:i}),e.navigate(`${n}/payments/${encodeURIComponent(i)}`)},onLoadMore:()=>{e.nextCursor!=null&&t(Ni({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))($t);function ba(){const t=A(),e=P(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[o,s]=r.useState(""),[c,d]=r.useState(""),[l,p]=r.useState(null),g=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),m=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeType:S,appliedSearch:f,appliedSort:h,nextCursor:E,transactionListFetchState:I,transactions:y}=k((w=>{const L=Tn(w);return{activeType:L.activeTab,appliedSearch:L.filters.search,appliedSort:L.sort,nextCursor:L.nextCursor,transactionListFetchState:L.fetchState,transactions:L.transactions}}),H),b=I==="Completed",C=`/${n}/invoicing`,D=r.useCallback((w=>{const L=y.find((T=>T.id===w)),U=L?.linkedInvoices?.[0]?.invoiceID??L?.invoiceID;U!=null&&(v.trackInvoicingActionClick(u.Event.invoicingEntityLinkClicked,{fromScreen:"payments_list",invoiceId:U,toScreen:"invoice"}),e(`${C}/invoices/${encodeURIComponent(U)}`))}),[e,C,y]),x=r.useCallback((w=>{const L=y.find((U=>U.id===w))?.customerID;L!=null&&(v.trackInvoicingActionClick(u.Event.invoicingEntityLinkClicked,{customerId:L,fromScreen:"payments_list",toScreen:"customer"}),e(`${C}/customers/${encodeURIComponent(L)}`))}),[e,C,y]);return r.useEffect((()=>{const w=setTimeout((()=>d(o)),300);return()=>clearTimeout(w)}),[o]),r.useEffect((()=>{i&&t(ye({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||g?.field!==h?.field||g?.dir!==h?.dir)&&t(ye({cacheOverride:!0,filters:m,sort:g}))}),[i,t,m,g,f,h]),N(I)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingPaymentsListPage,isReady:b}),a.jsx(xa,{navigate:e,tenantEmailDomain:n,activeType:S,searchValue:o,sortState:l,filters:m,sort:g,nextCursor:E,onSearchChange:s,onTypeChange:w=>{t(Mi(w)),t(ye({cacheOverride:!1,filters:m,sort:g}))},onSortChange:p,onViewTransactionCustomer:x,onViewTransactionInvoice:D})]})}const ja=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 rn(){const t=A(),e=P(),{invoice_id:n,tenantEmailDomain:i}=F(),{areTenantIdsInSync:o}=R(),s=n!=null&&n!=="",c=k(Se),d=k((x=>Ui(x))),l=k(Bi),p=k((x=>Pn(x,n??""))),g=p.invoice,m=`/${i}/invoicing`,S=r.useRef(null),f=r.useRef("");r.useEffect((()=>{t(Vi()),S.current=null,f.current=""}),[t,n]),r.useEffect((()=>{o&&t(s&&n!=null?he({invoiceId:n}):En({filters:{},keepExistingListItems:!1}))}),[o,t,n,s]),r.useEffect((()=>{s&&g!=null&&n!=null&&p.fetchState==="Completed"&&S.current!==n&&(S.current=n,t(Hi({contextInvoiceId:n,localData:qi(g)})))}),[t,g,n,p.fetchState,s]),r.useEffect((()=>{if(s)return;const x=d.localData.customerId;x!==""&&x!==f.current&&(f.current=x,t($n({filters:{customerId:x},keepExistingListItems:!1})),d.localData.invoiceToLink!==""&&t(en({localData:{...d.localData,customerId:x,invoiceToLink:""}})))}),[t,d.localData,s]);const h=r.useRef(l.fetchState);r.useEffect((()=>{const x=h.current;if(h.current=l.fetchState,x!=="Completed"&&l.fetchState==="Completed"){if(l.recordedInvoiceId!=null)return void e(`${m}/invoices/${encodeURIComponent(l.recordedInvoiceId)}`);e(`${m}/payments`)}}),[e,l.fetchState,l.recordedInvoiceId,m]);const E=r.useMemo((()=>c.customers.map((x=>({id:x.id,name:ja(x)})))),[c.customers]),I=k((x=>zi(x,d.localData.customerId))),y=r.useMemo((()=>I.map((x=>{return{amountDue:(w=x.amountDue,L=Qi.currencySymbol,Ft("0,0.00",w,L)),amountDueValue:x.amountDue,id:x.id,label:x.invoiceNumber};var w,L}))),[I]),b=r.useMemo((()=>{if(!s||g==null)return;const x=g.currencyCode??"USD",w=g.amountDue?.amount??0;return{amountDue:wt("0,0.00",g.amountDue),amountDueValue:w,currencyCode:x,customerName:g.customerName??g.customerID,invoiceId:g.id,invoiceNumber:g.invoiceNumber??g.id}}),[g,s]),C=s?`${m}/invoices/${encodeURIComponent(n??"")}`:`${m}/payments`,D=!s||p.fetchState==="Completed"&&d.localData.invoiceToLink!=="";return a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingRecordPaymentPage,isReady:D}),a.jsx(_t,{customers:E,fieldHelp:d.fieldHelp,errorMessage:l.fetchState==="Error"?l.error?.message??"Failed to record payment. Please try again.":void 0,gatewayOptions:d.gatewayOptions,invoiceContext:b,invoiceOptions:y,isSubmitting:l.fetchState==="In-Progress",localData:d.localData,mode:s?"invoice":"customer",paymentMethodOptions:d.paymentMethodOptions,onBack:()=>{e(C)},onCancel:()=>{v.trackInvoicingActionClick(u.Event.invoicingRecordPaymentCancelled),e(C)},onChange:x=>{t(en({localData:x}))},onSubmit:()=>{v.trackInvoicingActionClick(u.Event.invoicingPaymentRecorded,{customerId:d.localData.customerId,invoiceId:s?n:d.localData.invoiceToLink,paymentMethod:d.localData.paymentMethod}),t(Ki(s?n??void 0:void 0))}})]})}const Zn=(t,e,n)=>{const i=`/${t}/invoicing/subscriptions/`;return n!=null?`${i}${encodeURIComponent(n)}/${e}/`:`${i}new/${e}/`},Da=O((function(t,e){const{editView:n}=e,i=n.subscription,o=i?.status,s=o!=null&&e.commercialEditAllowedFromStatuses.includes(o);return{cancelReasonCodeOptions:n.cancelReasonCodeOptions,fieldHelp:n.fieldHelp,addons:n.addons,canEditCommercial:s,charges:n.charges,coupons:n.coupons,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,shippingAddressLabel:n.shippingAddressLabel,hasUnsavedShippingAddress:n.hasUnsavedShippingAddress,subscription:i}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{subscriptionId:i}=e,o=i!=="",s=(c,d)=>{v.trackInvoicingActionClick(u.Event.invoicingSubscriptionLifecycleAction,{action:c,subscriptionId:i}),t(Mn({action:c,id:i,body:d}))};return{onBack:()=>e.navigate(`${n}/subscriptions`),onChange:c=>{t(ge({id:i,localData:c}))},onChangeTermEnd:o?c=>{const d=c?.trim()??"";d!==""&&s("change_term_end",{term_ends_at:d})}:void 0,onCustomerClick:c=>{v.trackInvoicingActionClick(u.Event.invoicingEntityLinkClicked,{customerId:c,fromScreen:"subscription_detail",toScreen:"customer"}),window.open(`${n}/customers/${encodeURIComponent(c)}`,"_blank","noopener,noreferrer")},onDiscardEdit:()=>{t(J(me)),t(Wi({id:i}))},onOpenAddress:()=>{const c=Zn(e.tenantEmailDomain??"",me,i),d=X(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(c,{state:{pathnameStackToGoBack:d}})},onViewInvoices:()=>e.navigate(`${n}/invoices`),onSaveEdit:c=>{v.trackInvoicingActionClick(u.Event.invoicingSubscriptionEdited,{subscriptionId:i}),t(ge({id:i,localData:c})),t(On({id:i}))},onCancelSubscription:o?c=>{s("cancel",{cancel_reason_code:c.cancelReasonCode,end_of_term:!1,...c.cancelReason!=null&&c.cancelReason.trim()!==""?{cancel_reason:c.cancelReason.trim()}:{}})}:void 0,onLifecycleAction:o?(c,d)=>{c!=="pause"?s(c):s(c,d!=null&&d.trim()!==""?{resume_date:d.trim()}:void 0)}:void 0}}))(Rt);function Aa(){const t=A(),e=P(),n=W(),{subscription_id:i,tenantEmailDomain:o}=F(),{areTenantIdsInSync:s}=R(),c=k((y=>Ne(y,i))),{subscriptionCommercialEditAllowedFromStatuses:d,subscriptionLifecycleActionOptions:l,subscriptionMetadataEditAllowedFromStatuses:p}=c,g=c.pageFetchState.fetchState,m=g==="Completed"&&!c.isFormLoading,[S,f]=r.useState(m?i:void 0);r.useEffect((()=>{i!=null&&m&&f(i)}),[i,m]);const h=S===i;Ie(s),r.useEffect((()=>{s&&i!=null&&t(Gi({id:i}))}),[s,i,t]);const E=r.useCallback((y=>t(Zi({id:y}))),[t]),I=Y(c.fetchState,c.isFormLoading,i,E);return N(g)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingSubscriptionDetailPage,isReady:m}),a.jsx(Da,{hasLoadedRecord:h,commercialEditAllowedFromStatuses:d,editView:c,lifecycleActionOptions:l,location:n,metadataEditAllowedFromStatuses:p,navigate:e,subscriptionId:i??"",tenantEmailDomain:o},I)]})}const Pa=O((function(t,e){const n=Ne(t,e.subscriptionId);return{fieldHelp:n.fieldHelp,addons:n.addons,charges:n.charges,coupons:n.coupons,customers:n.customers,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,shippingAddressLabel:n.shippingAddressLabel}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{subscriptionId:i}=e,o=i!=null?"edit":"create";return{onCancel:()=>{v.trackInvoicingActionClick(u.Event.invoicingSubscriptionFormCancelled),t(Nn({id:i})),t(J(me)),i==null?e.navigate(`${n}/subscriptions`):e.navigate(`${n}/subscriptions/${encodeURIComponent(i)}`)},onChange:s=>{t(ge({id:i,localData:s}))},onOpenAddress:()=>{const s=Zn(e.tenantEmailDomain??"",me,i),c=X(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(s,{state:{pathnameStackToGoBack:c}})},onSubmit:()=>{v.trackInvoicingActionClick(u.Event.invoicingSubscriptionSaved,{mode:o}),t(On({id:i}))}}}))(Tt);function La(){const t=A(),e=P(),n=W(),{subscription_id:i,tenantEmailDomain:o}=F(),[s]=Z(),{areTenantIdsInSync:c}=R(),d=s.get("customerId"),{fetchState:l,savedSubscriptionId:p}=k((S=>Xi(S,i))),g=k((S=>Ne(S,i).localData));Ie(c),r.useEffect((()=>{c&&t(Ji({subscriptionId:i}))}),[c,i,t]);const m=r.useRef(!1);return r.useEffect((()=>{m.current||i!=null||d==null||d===""||g.customerId!==""||(m.current=!0,t(ge({id:i,localData:{...g,customerId:d}})))}),[d,i,g,t]),r.useEffect((()=>{if(l==="Completed"){const S=p??i,f=S!=null?`/${o}/invoicing/subscriptions/${encodeURIComponent(S)}`:`/${o}/invoicing/subscriptions`;e(f),t(Nn({id:i}))}}),[l,p,i,t,e,o]),a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingSubscriptionFormPage}),a.jsx(Pa,{location:n,navigate:e,subscriptionId:i,tenantEmailDomain:o})]})}const $a=O((function(t){const e=Un(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=(o,s,c)=>{v.trackInvoicingActionClick(u.Event.invoicingSubscriptionLifecycleAction,{action:s,subscriptionId:o}),t(Mn({action:s,id:o,body:c}))};return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onStatusChange:e.onStatusChange,onAddSubscription:()=>{v.trackInvoicingActionClick(u.Event.invoicingAddSubscriptionClicked),e.navigate(`${n}/subscriptions/new`)},onImportCsv:()=>{v.trackInvoicingActionClick(u.Event.invoicingImportCsvClicked,{entity:"subscriptions"}),e.navigate(`${n}/data_import`)},onChangeTermEnd:(o,s)=>{const c=s?.trim()??"";c!==""&&i(o,"change_term_end",{term_ends_at:c})},onSubscriptionAction:(o,s,c)=>{s!=="pause"?i(o,s):i(o,s,c!=null&&c.trim()!==""?{resume_date:c.trim()}:void 0)},onCancelSubscription:(o,s)=>{i(o,"cancel",{cancel_reason_code:s.cancelReasonCode,end_of_term:!1,...s.cancelReason!=null&&s.cancelReason.trim()!==""?{cancel_reason:s.cancelReason.trim()}:{}})},onSubscriptionClick:o=>{v.trackInvoicingActionClick(u.Event.invoicingSubscriptionRowClicked,{subscriptionId:o}),e.navigate(`${n}/subscriptions/${encodeURIComponent(o)}`)},onViewSubscriptionInvoices:()=>{e.navigate(`${n}/invoices`)},onLoadMore:()=>{e.nextCursor!=null&&t(no({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(Ot);function wa(){const t=A(),e=P(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),[o,s]=r.useState(""),[c,d]=r.useState(""),[l,p]=r.useState(null),g=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),m=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:S,appliedSearch:f,appliedSort:h,nextCursor:E,subscriptionListFetchState:I,runningActionSubscriptionId:y}=k((D=>{const x=Un(D);return{activeStatus:x.activeTab,appliedSearch:x.filters.search,appliedSort:x.sort,nextCursor:x.nextCursor,subscriptionListFetchState:x.fetchState,runningActionSubscriptionId:x.runningActionId??null}}),H),b=I==="Completed";r.useEffect((()=>{const D=setTimeout((()=>d(o)),300);return()=>clearTimeout(D)}),[o]),r.useEffect((()=>{i&&t(nn({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(m.search!==f||g?.field!==h?.field||g?.dir!==h?.dir)&&t(nn({cacheOverride:!0,filters:m,sort:g}))}),[i,t,m,g,f,h]);const C=r.useRef(y);return r.useEffect((()=>{const D=C.current!=null&&y==null;C.current=y,D&&i&&t(Yi())}),[y,i,t]),N(I)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingSubscriptionsListPage,isReady:b}),a.jsx($a,{navigate:e,tenantEmailDomain:n,activeStatus:S,searchValue:o,sortState:l,filters:m,sort:g,nextCursor:E,runningActionSubscriptionId:y,onSearchChange:s,onStatusChange:D=>t(eo(D)),onSortChange:p})]})}const _a=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:o=>{v.trackInvoicingActionClick(u.Event.invoicingEntityLinkClicked,{customerId:o,fromScreen:"transaction_detail",toScreen:"customer"}),e.navigate(`${n}/customers/${encodeURIComponent(o)}`)},onInvoiceClick:o=>{v.trackInvoicingActionClick(u.Event.invoicingEntityLinkClicked,{fromScreen:"transaction_detail",invoiceId:o,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(o)}`)},onSubscriptionClick:o=>{v.trackInvoicingActionClick(u.Event.invoicingEntityLinkClicked,{fromScreen:"transaction_detail",subscriptionId:o,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(o)}`)},onCapture:i!==""?()=>{v.trackInvoicingActionClick(u.Event.invoicingTransactionCaptured,{transactionId:i}),t(oo({action:"capture",id:i}))}:void 0}}))(Mt);function Fa(){const t=A(),e=P(),{tenantEmailDomain:n,transaction_id:i}=F(),{areTenantIdsInSync:o}=R(),s=k((d=>to(d,i??""))),c=s.fetchState==="Completed";return r.useEffect((()=>{o&&i!=null&&t(io({id:i}))}),[o,i,t]),N(s.fetchState)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingTransactionDetailPage,isReady:c}),a.jsx(_a,{navigate:e,tenantEmailDomain:n,transactionId:i??"",readView:s})]})}function Wn(t={}){const{enabled:e=!0,fetchSyncHealth:n=!1,loadAccountingPickers:i=!1,reuseCached:o=!1}=t,s=A(),{areTenantIdsInSync:c}=R(),d=k(Ue),l=d.connection?.connected===!0,p=d.connectionFetchState.fetchState;return r.useEffect((()=>{e&&c&&(o&&p!=="Not-Started"||s(Bn()),n&&s(ao()))}),[c,s,e,n,o]),r.useEffect((()=>{e&&c&&l&&i&&s(so())}),[c,s,e,l,i]),{isQboConnected:l,qboView:d}}const Ra={branding:"invoicing_branding_save",dunning:"invoicing_dunning_settings_save",quickbooks:"invoicing_qbo_settings_save"};function ee(t){const e=A(),{areTenantIdsInSync:n}=R(),{tenantEmailDomain:i}=F(),{fetchState:o,fieldHelp:s,logoFile:c,saveState:d,settings:l,stripeConnectState:p}=k(co),{configError:g,configFetchState:m,dunningScheduleActionOptions:S,qboAccountMappingKindOptions:f,qboCustomerMatchingOptions:h,qboSyncStatusOptions:E}=k(Vn),I=k(Ue);Wn({enabled:t==="quickbooks",fetchSyncHealth:!0,loadAccountingPickers:!0});const y=k(fe),b=t==="dunning"||t==="quickbooks",C=y.companyId??G.getSignedInUserTenant(i??"")?.companyId,D=k((_=>bn(_,C))),x=ro(y.userRole??[]),w=y.tenantId??"",L=G.getSignedInUser(),U={userId:L?.userId??"",sessionId:L?.zeniSessionId??"",tenantId:w},T=c?.fileId,ne=k((_=>T!=null&&T!==""?lo(_,T):void 0)),Be=k((_=>T!=null&&T!==""?uo(_,T):void 0)),Xn=T!=null&&T!==""&&ne!=null?{[T]:ne}:{},Jn=T!=null&&T!==""&&Be!=null?{[T]:Be}:{};r.useEffect((()=>(e(tn()),()=>{e(tn())})),[e]),r.useEffect((()=>{n&&(o!=="Not-Started"&&o!=="Error"||e(Me()))}),[n,e,o]),r.useEffect((()=>{n&&b&&m==="Not-Started"&&e(ve())}),[n,e,m,b]),r.useEffect((()=>{if(!n)return;const _=L?.userId;_!=null&&_!==""&&w!==""&&qe.shouldFetchActiveTenant(w)&&(qe.markActiveTenantFetchStarted(w),e(go(_,w,L?.zeniSessionId)))}),[n,e,L?.userId,L?.zeniSessionId,w]);const Yn=S.length>0||f.length>0,et=o==="Not-Started"||o==="In-Progress"&&l==null||b&&!Yn&&(m==="Not-Started"||m==="In-Progress"),nt=o==="Completed"&&(!b||m==="Completed"),Ve=D.externalConnections?.revenue?.find((_=>_.connectionName==="chargebee"))?.connectionId,Ce=ce?.invoicingMicroServiceBaseUrl,He=Ce!=null&&Ce.length>0?`${Ce}/1.0/webhooks/stripe`:"",ke={deleteConnectionError:D.externalConnections?.deleteConnectionError?.message,deleteConnectionState:D.externalConnections?.deleteConnectionState??"Not-Started",integrationsView:D,isAdmin:x,isStripeBusy:p.fetchState==="In-Progress",onConnectStripe:_=>e(an(_)),onDisconnect:(_,z)=>{w!==""&&e(Io(w,_,sn(z)))},onDisconnectStripe:()=>e(on()),onReconnectQBO:()=>{const _=y.tenantEmailDomain??i??"";pe.init("/connection/auth",_),pe.handleClick()},onRefreshQBO:()=>{D.integrations.refreshQBO.fetchState!=="In-Progress"&&e(zn())},onSaveChargeBeeCredentials:(_,z)=>{Ve!=null&&w!==""&&e(fo(w,Ve,sn("revenue"),ho("chargebee"),{api_key:_,site:z}))},saveChargeBeeError:D.externalConnections?.saveAPIKeyConnectionError?.message,saveChargeBeeState:D.externalConnections?.saveAPIKeyConnectionState??"Not-Started",settings:l,stripeError:p.fetchState==="Error"?p.error?.message??"Failed to connect Stripe. Check your keys and try again.":void 0,stripeWebhookUrl:He};return{authParams:U,deleteFileStatusById:Xn,fieldHelp:s,dunningScheduleActionOptions:S,filesEndPoint:ce?.fileMicroServiceBaseUrl??"",integrationsSectionProps:ke,isInvoicingPageReady:nt,isLoading:et,isSaving:d.fetchState==="In-Progress",isStripeBusy:p.fetchState==="In-Progress",logoFile:c,qboAccountMappingKindOptions:f,qboCustomerMatchingOptions:h,qboSyncStatusOptions:E,qboView:I,saveErrorMessage:d.fetchState==="Error"?d.error?.message??"Failed to save settings.":b&&m==="Error"?g?.message??"Failed to load invoicing configuration.":void 0,settings:l,stripeError:p.fetchState==="Error"?p.error?.message??"Failed to connect Stripe. Check your keys and try again.":void 0,stripeWebhookUrl:He,updateFileStatusById:Jn,onConnectStripe:_=>e(an(_)),onDeleteFile:_=>e(So(_,w)),onDisconnectStripe:()=>e(on()),onEditFileName:(_,z)=>e(po(_,z.split(".")[0],w)),onReconnectQBO:ke.onReconnectQBO,onRefreshQBO:ke.onRefreshQBO,onRetryQboSyncTask:_=>e(qn(_)),onSave:_=>{v.trackInvoicingActionClick(u.Event.invoicingSettingsSaved,{tab:t??"hub"}),e(vo({settings:_,snackbarSection:Ra[t??""]}))},onStartQboBackfill:_=>e(Hn(_)),updateFilesEntity:_=>{v.trackInvoicingActionClick(u.Event.invoicingLogoUploaded),e(mo({files:_}))}}}function ln({appContent:t}){const e=P(),n=W(),i=A(),{tenantEmailDomain:o}=F(),s=ee("branding"),c=k((p=>Co(p))),d=k((p=>ko(xe,p)?.addressToCreate));r.useEffect((()=>{c.saveState.fetchState==="Completed"&&(i(Eo()),i(J(xe)))}),[c.saveState.fetchState,i]);const l=$e(c.saveState.fetchState);return r.useEffect((()=>{l==="In-Progress"&&c.saveState.fetchState==="Completed"&&e("..")}),[l,c.saveState.fetchState,e]),a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingSettingsPage,isReady:s.isInvoicingPageReady}),a.jsx(Nt,{address:d,fieldHelp:c.fieldHelp,addressLabel:c.addressLabel,appContent:t,authParams:s.authParams,dateFormatOptions:c.dateFormatOptions,deleteFileStatusById:s.deleteFileStatusById,filesEndPoint:s.filesEndPoint,isLoading:s.isLoading,isSaving:s.isSaving,localData:c.localData,logoFile:s.logoFile,saveErrorMessage:s.saveErrorMessage,settings:s.settings,updateFileStatusById:s.updateFileStatusById,onBackClick:()=>e(".."),onChange:p=>{i(xo({localData:p}))},onDeleteFile:s.onDeleteFile,onEditFileName:s.onEditFileName,onOpenAddress:()=>{const p=`/${o}/invoicing/settings/branding/${xe}/`,g=X(n.state?.pathnameStackToGoBack,n.pathname);e(p,{state:{pathnameStackToGoBack:g}})},onSubmit:()=>i(yo()),updateFilesEntity:s.updateFilesEntity})]})}function Ta(){const t=P(),e=ee("dunning");return a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingSettingsPage,isReady:e.isInvoicingPageReady}),a.jsx(Ut,{dunningScheduleActionOptions:e.dunningScheduleActionOptions,isLoading:e.isLoading,isSaving:e.isSaving,saveErrorMessage:e.saveErrorMessage,settings:e.settings,onBackClick:()=>t(".."),onSave:e.onSave})]})}function Oa(){const t=P(),e=ee("integrations");return a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingSettingsPage,isReady:e.isInvoicingPageReady}),a.jsx(Bt,{integrationsSectionProps:{...e.integrationsSectionProps,onConfigureQBO:()=>t("../quickbooks"),onOpenPaymentDestination:()=>t("../payment-destination")},isLoading:e.isLoading,onBackClick:()=>t("..")})]})}function Ma(){const t=P(),e=ee("payment-destination");return a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingSettingsPage,isReady:e.isInvoicingPageReady}),a.jsx(Vt,{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 Na=O((function(t){const e=Qn(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(Do({localData:e}))},onReset:()=>{t(jo())},onRetryTask:e=>{t(qn(e))},onSave:()=>{v.trackInvoicingActionClick(u.Event.invoicingSettingsSaved,{tab:"quickbooks"}),t(bo())},onStartBackfill:e=>{t(Hn(e))}}}))(Ht);function Ua(){const t=A(),e=P(),{tenantEmailDomain:n}=F(),i=k(fe),{configFetchState:o,saveState:s,settingsFetchState:c}=k(Qn),d=$e(s.fetchState);return r.useEffect((()=>{d==="In-Progress"&&s.fetchState==="Completed"&&e("..")}),[e,d,s.fetchState]),r.useEffect((()=>{c!=="Not-Started"&&c!=="Error"||t(Me())}),[t,c]),r.useEffect((()=>{o==="Not-Started"&&t(ve())}),[o,t]),Wn({fetchSyncHealth:!0,loadAccountingPickers:!0}),a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingSettingsPage}),a.jsx(Na,{onBackClick:()=>e(".."),onReconnect:()=>{pe.init("/connection/auth",i.tenantEmailDomain??n??""),pe.handleClick()},onRefresh:()=>t(zn())})]})}const Ba={"payment-destination":"payment-destination",general:"branding",integrations:null,dunning:"dunning"};function Va(){const t=un(),e=A(),n=P(),[i,o]=Z(),s=ee(),{canEnableInvoicing:c,isEnablingInvoicing:d,isInvoicingEnabled:l,isQboConfigured:p,isStripeConnected:g}=k(Vn),m=i.get("tab");return r.useEffect((()=>{if(m==null)return;const S=Ba[m];o({},{replace:!0}),S!=null&&n(S,{replace:!0})}),[m,n,o]),a.jsxs(a.Fragment,{children:[a.jsx($,{event:u.Event.invoicingSettingsPage,isReady:s.isInvoicingPageReady}),a.jsx(qt,{analytics:v,integrationsSectionProps:{...s.integrationsSectionProps,onConfigureQBO:()=>n("quickbooks"),onOpenPaymentDestination:()=>n("payment-destination")},isEnablingInvoicing:d,isLoading:s.isLoading,meetingUrl:t("invoicing_settings"),settings:s.settings,onBrandingClick:()=>n("branding"),onDunningClick:()=>n("dunning"),canEnableInvoicing:c,isQboConfigured:p,isStripePaymentsReady:g,onEnableInvoicingClick:l?void 0:()=>{e(Ao())}})]})}function dn(){return a.jsxs(oe,{children:[a.jsx(j,{index:!0,element:a.jsx(Va,{})}),a.jsx(j,{path:"payment-destination",element:a.jsx(Ma,{})}),a.jsx(j,{path:"branding",element:a.jsx(ln,{})}),a.jsx(j,{path:"branding/:addressType",element:a.jsx(ln,{appContent:a.jsx(Q,{isSubPage:!0,hideAddressBackButton:!0})})}),a.jsx(j,{path:"integrations",element:a.jsx(Oa,{})}),a.jsx(j,{path:"dunning",element:a.jsx(Ta,{})}),a.jsx(j,{path:"quickbooks",element:a.jsx(Ua,{})}),a.jsx(j,{path:"*",element:a.jsx(B,{to:"..",replace:!0})})]})}function Ss(){const t=A(),e=P(),{tenantEmailDomain:n}=F(),{areTenantIdsInSync:i}=R(),{enableState:o,fetchState:s,status:c}=k(wn),d=$e(o.fetchState),l=`/${n}/invoicing`,p=r.useRef(!1),g=k((m=>Ue(m).connectionFetchState.fetchState));return r.useEffect((()=>{i&&(s!=="Not-Started"?s!=="Error"||p.current||(p.current=!0,t(ve({cacheOverride:!1}))):t(ve({cacheOverride:!1})))}),[i,t,s]),r.useEffect((()=>{i&&g==="Not-Started"&&t(Bn())}),[i,t,g]),r.useEffect((()=>{d==="In-Progress"&&o.fetchState==="Completed"&&(e(`${l}/catalog`),t(Po()))}),[d,o.fetchState,l,t,e]),c==null&&s!=="Error"?a.jsx(zt,{fetchState:"In-Progress"}):c==="not_started"?a.jsxs(oe,{children:[a.jsx(j,{path:"promo",element:a.jsx(cn,{})}),a.jsx(j,{path:"*",element:a.jsx(B,{to:`${l}/promo`,replace:!0})})]}):c==="settings"?a.jsxs(oe,{children:[a.jsx(j,{path:"promo",element:a.jsx(cn,{})}),a.jsx(j,{path:"settings/*",element:a.jsx(dn,{})}),a.jsx(j,{path:"*",element:a.jsx(B,{to:`${l}/settings`,replace:!0})})]}):a.jsxs(oe,{children:[a.jsx(j,{path:"/",element:a.jsx(B,{to:"overview",replace:!0})}),a.jsx(j,{path:"overview",element:a.jsx(ya,{})}),a.jsx(j,{path:"promo",element:a.jsx(B,{to:`${l}/overview`,replace:!0})}),a.jsx(j,{path:"customers",element:a.jsx(na,{})}),a.jsx(j,{path:"customers/new",element:a.jsx(Yo,{})}),a.jsx(j,{path:"customers/new/:addressType",element:a.jsx(Q,{})}),a.jsx(j,{path:"customers/:customer_id",element:a.jsx(Xo,{})}),a.jsx(j,{path:"customers/:customer_id/:addressType",element:a.jsx(Q,{})}),a.jsx(j,{path:"subscriptions",element:a.jsx(wa,{})}),a.jsx(j,{path:"subscriptions/new",element:a.jsx(La,{})}),a.jsx(j,{path:"subscriptions/new/:addressType",element:a.jsx(Q,{})}),a.jsx(j,{path:"subscriptions/:subscription_id",element:a.jsx(Aa,{})}),a.jsx(j,{path:"subscriptions/:subscription_id/:addressType",element:a.jsx(Q,{})}),a.jsx(j,{path:"invoices",element:a.jsx(Ia,{})}),a.jsx(j,{path:"invoices/create",element:a.jsx(zo,{})}),a.jsx(j,{path:"invoices/:invoice_id",element:a.jsx(fa,{})}),a.jsx(j,{path:"invoices/:invoice_id/record-payment",element:a.jsx(rn,{})}),a.jsx(j,{path:"invoices/:invoice_id/issue-credit-note",element:a.jsx(ka,{})}),a.jsx(j,{path:"payments",element:a.jsx(ba,{})}),a.jsx(j,{path:"payments/record",element:a.jsx(rn,{})}),a.jsx(j,{path:"payments/:transaction_id",element:a.jsx(Fa,{})}),a.jsx(j,{path:"credits",element:a.jsx(Zo,{})}),a.jsx(j,{path:"credits/:credit_note_id",element:a.jsx(Ko,{})}),a.jsx(j,{path:"discounts",element:a.jsx(ua,{})}),a.jsx(j,{path:"discounts/new",element:a.jsx(Ho,{})}),a.jsx(j,{path:"discounts/:coupon_id",element:a.jsx(la,{})}),a.jsx(j,{path:"dunning",element:a.jsx(pa,{})}),a.jsx(j,{path:"dunning/:case_id",element:a.jsx(ma,{})}),a.jsx(j,{path:"catalog",element:a.jsx(Bo,{})}),a.jsx(j,{path:"catalog/new",element:a.jsx(Mo,{})}),a.jsx(j,{path:"catalog/:item_id",element:a.jsx(Fo,{})}),a.jsx(j,{path:"settings/*",element:a.jsx(dn,{})}),a.jsx(j,{path:"audit_log",element:a.jsx($o,{})}),a.jsx(j,{path:"data_import",element:a.jsx(aa,{})}),a.jsx(j,{path:"data_import/migrate",element:a.jsx(ca,{})}),a.jsx(j,{path:"data_import/:sessionId",element:a.jsx(ia,{})}),a.jsx(j,{path:"*",element:a.jsx(M,{})})]})}export{Ss as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as t}from"./liveblocks-
|
|
1
|
+
import{j as t}from"./liveblocks-e6rGc1UF.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-CHD8T-IM.js";import{Uu as k,Uv as v,Uw as T,Jy as D,Jk as U,Ux as B,Uy as oe,Uz as ie,Jo as se,gi as $,Jv as le,Js as re}from"./zeni-epic-state-BO3zdDfL.js";import{a2 as x,J as r,a3 as de,k as j,_ as G,a4 as ce,a5 as me,a6 as pe,p as J,N as ue,f as he,a7 as ge,F as xe,E as fe,e 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-DKH4PK2B.js";import{n as m}from"./mui-NTaF3UaY.js";import f from"./NotFoundScreen-CtgFRYZy.js";import{a as I}from"./sentry-DsyKtMW2.js";import"./recharts-C6xUtcdL.js";import"./analytics-C3e3An3a.js";import"./plaid-DdTo7m1-.js";import"./dnd-Dwi6R-ey.js";import"./stripe-cKAAJElX.js";import"./lottie-B778bt56.js";import"./lexical-CMNdypK6.js";import"./pdf-Bx92ZlM_.js";import"./utils-CCA3F0sZ.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]="6de49a9c-e956-4832-85a2-fab455119f03",e._sentryDebugIdIdentifier="sentry-dbid-6de49a9c-e956-4832-85a2-fab455119f03")}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 u}from"./liveblocks-
|
|
1
|
+
import{j as u}from"./liveblocks-e6rGc1UF.js";import{a as g}from"./sentry-DsyKtMW2.js";import{u as O,g as _,h as w,t as M,j as l,N as L}from"./core-CHD8T-IM.js";import{z as r,E as P,G as V,T as A,k as N,U as $,$ as q,a0 as G,Y as R}from"./index-DKH4PK2B.js";import{fF as W,TZ as Y,Uq as Z,Uh as B,gi as H,gk as J,Um as K,gU as Q,dj as X,Ur as ee,Us as te}from"./zeni-epic-state-BO3zdDfL.js";import{n as ne}from"./mui-NTaF3UaY.js";import{u as se}from"./useDeviceId-VsdzmSZI.js";import{f as ae}from"./analyticsHelper-BEL0ra9X.js";import{t as ie}from"./getLocaleForTenant-D-or0iZO.js";import"./recharts-C6xUtcdL.js";import"./analytics-C3e3An3a.js";import"./plaid-DdTo7m1-.js";import"./dnd-Dwi6R-ey.js";import"./stripe-cKAAJElX.js";import"./lottie-B778bt56.js";import"./lexical-CMNdypK6.js";import"./pdf-Bx92ZlM_.js";import"./utils-CCA3F0sZ.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]="0ab82f79-c1f2-4b52-97be-58b8803cd4d3",t._sentryDebugIdIdentifier="sentry-dbid-0ab82f79-c1f2-4b52-97be-58b8803cd4d3")}catch{}})();const T=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function Te(){const t=O(),a=_(),m=w(),[k]=M(),n=k.get("token"),p=k.get("stytch_token_type"),f=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:C,magicLinkEmail:c,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=>W(e))),b=l((e=>Y(e))),D=r.getSignedInUser(),v=P().mode;g.useEffect((()=>{s?.zeniSessionId==null&&n!=null&&T(n,p)&&i!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t(Z(n,i,f)))}),[n,p,t,i,f,s?.zeniSessionId]),g.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(B(b.tenantsInOrder),s.zeniSessionId),H(s.userId,s.zeniSessionId,o.tenantId),t(J(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(K("Completed")),V.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,b.tenantsInOrder),Q().then((()=>{const e=R();e!=null&&A(e)})),setTimeout((()=>{N.trackLogin($.Event.loginSuccess,"email",X(o.productSettings))}),2e3))}),[h,S,y,s,o,b,v,a.state,t]);const E=g.useCallback((()=>{m("/signin/auth")}),[m]),j=g.useCallback((()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))}),[i,d,t,c]),F=g.useCallback((e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))}),[i,n,t,c,d]);if(I==="Completed"&&d!=null)return u.jsx(q,{phoneNumber:C,verifyOtpFetchState:x.fetchState,resendVerifyDeviceOTPFetchState:z,onResendOtp:j,onVerifyOtp:F,onCancelVerifyDevice:E});if(h==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||D!=null){const e=a.state?.origin??"/";return u.jsx(L,{to:e,state:{...a.state,origin:""}})}if(!T(n,p)||f==null||I==="Error"){const e=a.state?.origin??"/",U=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(L,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:U,magicLinkExpired:!U&&(r.isMagicLinkTriggered(n??"")||I==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(G,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
|
|
2
2
|
position: fixed;
|
|
3
3
|
top: 0;
|
|
4
4
|
left: 0;
|