@zeniai/web-app-ui 5.1.63-dev → 5.1.64-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AddressRoutes-DTd0NBaA.js +1 -0
- package/dist/assets/{AddressScreen-GAHyIX-c.js → AddressScreen-BnC-xeNO.js} +2 -2
- package/dist/assets/AiCfoScreen-D7S1jmtC.js +22 -0
- package/dist/assets/BillPayApprovalRoutes-BKtx1kJ3.js +1 -0
- package/dist/assets/BillPayRoutes-g07_m1Yx.js +119 -0
- package/dist/assets/BusinessVerificationPageScreen-CpGRtjnS.js +9 -0
- package/dist/assets/ChargeCardRoutes-WsjwCttT.js +71 -0
- package/dist/assets/CompanyPassportScreen-Cx74K6-1.js +1 -0
- package/dist/assets/ConnectionAuthScreen-BIRo2BaP.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-L8PntkLo.js +1 -0
- package/dist/assets/CustomerOnboardingRoutes-BV1QbewZ.js +23 -0
- package/dist/assets/DashboardRoutes-ClXxpw2D.js +20 -0
- package/dist/assets/DefaultTenantHome-k3m2vfzP.js +1 -0
- package/dist/assets/DomesticWireDetailScreen-DuPKfc2x.js +18 -0
- package/dist/assets/DrawerScreen-1fdGLdyV.js +1 -0
- package/dist/assets/EntityDetailRoutes-Brh486Q-.js +1 -0
- package/dist/assets/ExpenseAutomationRoutes-DNJSb5io.js +25 -0
- package/dist/assets/FeaturePreviewScreen-wzurtqwt.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-0mV19jgL.js +1 -0
- package/dist/assets/MagicLinkRoutes-D6TmVWte.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-C6WlM5JI.js +12 -0
- package/dist/assets/MobileAppDrawer-w7Ih7RbS.js +1 -0
- package/dist/assets/NotFoundScreen-BNcKpH4N.js +1 -0
- package/dist/assets/NotificationRoutes-CQSd1khI.js +1 -0
- package/dist/assets/OAuthConsentScreen-BbKUoIMi.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-DeUji8s7.js +1 -0
- package/dist/assets/PeopleRoutes-Bv6D04K8.js +22 -0
- package/dist/assets/PerformanceRoutes-B4uBsUKn.js +1 -0
- package/dist/assets/{Preview-C7zW6Q7F.js → Preview-44tjfNzS.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-BDzJBSaJ.js → QBOConnectionScreen-Dppvtafz.js} +1 -1
- package/dist/assets/ReferralListScreen-BH3bO2h_.js +5 -0
- package/dist/assets/ReimbursementApprovalRoutes-DrhBbGrt.js +1 -0
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-_CUcSO8M.js +1 -0
- package/dist/assets/ReimbursementRoutes-Ck88YnRC.js +68 -0
- package/dist/assets/ReportsRoutes-EgjleUVF.js +1 -0
- package/dist/assets/RewardsRoutes-Cs04goLx.js +1 -0
- package/dist/assets/ScreenRoutes-DAVGJEPC.js +2 -0
- package/dist/assets/SettingsRoutes-CGwpR34_.js +57 -0
- package/dist/assets/SetupPagesScreen-DVYIUml2.js +29 -0
- package/dist/assets/SignInScreen-BfIi8mxH.js +1 -0
- package/dist/assets/SignOutScreen-CRjp33Uq.js +9 -0
- package/dist/assets/TaskListScreen-zDige7Qx.js +9 -0
- package/dist/assets/TaskRoutes-DZSVbSVg.js +9 -0
- package/dist/assets/TransactionDetailRoutes-CAIheVGH.js +1 -0
- package/dist/assets/TransactionDetailScreen-Nhb9Cdoj.js +5 -0
- package/dist/assets/TransactionListRoutes-CCSHgT8f.js +1 -0
- package/dist/assets/TreasuryRoutes-BEe2hzHB.js +37 -0
- package/dist/assets/{VendorsRoutes-7KkgbfcW.js → VendorsRoutes-DkoRIuON.js} +27 -27
- package/dist/assets/WiseConfirmationScreen-C2xx_UCS.js +12 -0
- package/dist/assets/ZeniAccountRoutes-CAOHS1Ia.js +57 -0
- package/dist/assets/ZeniAccountStatementScreen-CO_1LwB4.js +9 -0
- package/dist/assets/{accountMappingHelper-BPzhOzDQ.js → accountMappingHelper-CDd_SN9l.js} +1 -1
- package/dist/assets/{analytics-Bqx0zRxd.js → analytics-CStLmwuB.js} +1 -1
- package/dist/assets/{analyticsHelper-d524teZu.js → analyticsHelper-DLbyZBKc.js} +1 -1
- package/dist/assets/{core-Bv1T7LZC.js → core-DvGkVhX0.js} +2 -2
- package/dist/assets/{decodeURIComponentSafe-CgJ-EbJc.js → decodeURIComponentSafe-D3G61A3x.js} +1 -1
- package/dist/assets/dnd-DVf98RdY.js +6 -0
- package/dist/assets/{empty-BGU_c4p_.js → empty-C73IrULF.js} +1 -1
- package/dist/assets/empty-C94l7QZZ.js +1 -0
- package/dist/assets/{emptyVideoElement-D0DWhAqS.js → emptyVideoElement-C0Gsi5o3.js} +1 -1
- package/dist/assets/epic-6iIIFADw.js +2 -0
- package/dist/assets/getLocaleForTenant-cEMfjXsu.js +1 -0
- package/dist/assets/index-CR_F8qmF.js +1 -0
- package/dist/assets/{index-CwcEF-q7.js → index-ChP5wU0r.js} +38720 -44339
- package/dist/assets/{index-B-VkC3pW.js → index-D4KKzLMy.js} +1 -1
- package/dist/assets/{index-C7MHnpYf.js → index-D82ghQVK.js} +1 -1
- package/dist/assets/{index-BcMhlMw0.js → index-DBkI4Pc2.js} +1 -1
- package/dist/assets/{index-Bf0yAk1h.js → index-DH8DxHEc.js} +2 -2
- package/dist/assets/{empty-DZLujeFc.js → index-DKlRxDbB.js} +1 -1
- package/dist/assets/{index-BfDh5m3J.js → index-Dm6nOQvo.js} +1 -1
- package/dist/assets/{index-BUmr5maU.css → index-R6GjjTB3.css} +1 -1
- package/dist/assets/{lexical-DtmspfR6.js → lexical-BStGoUxq.js} +1 -1
- package/dist/assets/{liveblocks-DC3GaKoW.js → liveblocks-CfHMBm08.js} +1 -1
- package/dist/assets/{lottie-BAdftm7g.js → lottie-Byecfo2L.js} +1 -1
- package/dist/assets/{mui-VYhJrGDQ.js → mui-D2FQmczV.js} +1 -1
- package/dist/assets/{pathToGoBack-BPhnwklb.js → pathToGoBack-DSTCEkoM.js} +1 -1
- package/dist/assets/{pdf-DyfSqkK5.js → pdf-CojJ326Z.js} +4 -4
- package/dist/assets/{pdf-lib-CPh8no6v.js → pdf-lib-D37uSEI7.js} +1 -1
- package/dist/assets/{plaid-BlhDSPsk.js → plaid-DzUK2ot_.js} +1 -1
- package/dist/assets/{pusher-DGAKVhUw.js → pusher-9dHg1-dz.js} +1 -1
- package/dist/assets/{react-EkeFt_9c.js → react-8lRluBI7.js} +1 -1
- package/dist/assets/{react-mFsTSWE1.js → react-C8Da0Bh3.js} +1 -1
- package/dist/assets/{react-D_wg-5Ag.js → react-CpxXCBmF.js} +1 -1
- package/dist/assets/{react-D4kHPPtw.js → react-D0gT4wkv.js} +1 -1
- package/dist/assets/{react-BJZHoUnV.js → react-DgijNfbO.js} +1 -1
- package/dist/assets/{react-B1_zGwIA.js → react-DhZhbZXR.js} +1 -1
- package/dist/assets/{recharts-D979ncoh.js → recharts-CnIvro2v.js} +3 -3
- package/dist/assets/{routePaths-CjJlLbxf.js → routePaths-CL9hJjr9.js} +1 -1
- package/dist/assets/{sentry-CuaXjR5n.js → sentry-0vIaNqsr.js} +1 -1
- package/dist/assets/{url-DXrWvdUh.js → url-D3bpmQ93.js} +1 -1
- package/dist/assets/{url-73U0aVt0.js → url-DBgQsa85.js} +1 -1
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-DsMWHBWn.js +1 -0
- package/dist/assets/useAskAiCfoHostNavButtonProps-RTOhQENK.js +1 -0
- package/dist/assets/{useDeviceId-BVyTAih4.js → useDeviceId-BXBJZ6FP.js} +1 -1
- package/dist/assets/useInitialThreadRequest-CLh-E-cE.js +1 -0
- package/dist/assets/{utils-DPYDOv00.js → utils-DF5mLbko.js} +2 -2
- package/dist/assets/withTransactionSidePanel-rHr5DjOB.js +21 -0
- package/dist/assets/zeni-epic-state-D_HFZhXl.js +13 -0
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AddressRoutes-DiGYiZdH.js +0 -1
- package/dist/assets/AiCfoScreen-D2sAwMZS.js +0 -22
- package/dist/assets/BillPayApprovalRoutes-BglCJxi-.js +0 -1
- package/dist/assets/BillPayRoutes-7zp9D6x8.js +0 -119
- package/dist/assets/BusinessVerificationPageScreen-DMq3tKTs.js +0 -9
- package/dist/assets/CardsAiCfoScreen--ED2OEzt.js +0 -14
- package/dist/assets/ChargeCardRoutes-CMdGvjPJ.js +0 -71
- package/dist/assets/CompanyPassportScreen-DMJdNz2u.js +0 -1
- package/dist/assets/ConnectionAuthScreen-CC4jwpJn.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-Bqsz81r8.js +0 -1
- package/dist/assets/CustomerOnboardingRoutes-DfaM8hGj.js +0 -30
- package/dist/assets/DashboardRoutes-BCVeePc3.js +0 -20
- package/dist/assets/DefaultTenantHome-BKFAUyCt.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-WRSPX-4X.js +0 -18
- package/dist/assets/DrawerScreen-DaMuYUCn.js +0 -1
- package/dist/assets/EntityDetailRoutes-Bcvb-t4n.js +0 -1
- package/dist/assets/ExpenseAutomationRoutes-BMNILnav.js +0 -25
- package/dist/assets/FeaturePreviewScreen-D4Ah53J7.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-DRjMsB35.js +0 -1
- package/dist/assets/MagicLinkRoutes-Dtjlc8Bf.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-D1bS19KK.js +0 -12
- package/dist/assets/MobileAppDrawer-PDN1hPUR.js +0 -1
- package/dist/assets/NotFoundScreen-CKyavEYX.js +0 -1
- package/dist/assets/NotificationRoutes-BP3RNHOU.js +0 -1
- package/dist/assets/OAuthConsentScreen-CWy6K8Uy.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-BCTBlqwg.js +0 -1
- package/dist/assets/PeopleRoutes-84yTwmWw.js +0 -22
- package/dist/assets/PerformanceRoutes-BQUXWKZE.js +0 -1
- package/dist/assets/ReferralListScreen-CXBkdn17.js +0 -5
- package/dist/assets/ReimbursementApprovalRoutes-DFKDTo2d.js +0 -1
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-77M2HLZ2.js +0 -1
- package/dist/assets/ReimbursementRoutes-YhP6hHRt.js +0 -68
- package/dist/assets/ReportsRoutes-wzqHii7q.js +0 -1
- package/dist/assets/RewardsRoutes-DfmbXNc8.js +0 -1
- package/dist/assets/ScreenRoutes-DvRF1Ugr.js +0 -2
- package/dist/assets/SettingsRoutes-xpOSQOkw.js +0 -57
- package/dist/assets/SetupPagesScreen-CrjLDbOm.js +0 -29
- package/dist/assets/SignInScreen-Ck9zXfCr.js +0 -1
- package/dist/assets/SignOutScreen-DSoi64zr.js +0 -9
- package/dist/assets/TaskListScreen-Cs7VLiUm.js +0 -9
- package/dist/assets/TaskRoutes-dkq9ikjL.js +0 -9
- package/dist/assets/TransactionDetailRoutes-2AtDo3dT.js +0 -1
- package/dist/assets/TransactionDetailScreen-CWpk0UU1.js +0 -5
- package/dist/assets/TransactionListRoutes-lHRZBvxi.js +0 -1
- package/dist/assets/TreasuryRoutes-C4iGPRK3.js +0 -37
- package/dist/assets/WiseConfirmationScreen-DshLBzeW.js +0 -12
- package/dist/assets/ZeniAccountRoutes-pWTshbAJ.js +0 -73
- package/dist/assets/ZeniAccountStatementScreen-DEwEWZ2Q.js +0 -9
- package/dist/assets/dnd-CrtLd1r-.js +0 -6
- package/dist/assets/epic-C0x_kZHk.js +0 -2
- package/dist/assets/getLocaleForTenant-DTwWZ3TG.js +0 -1
- package/dist/assets/index-Bgxmla6x.js +0 -1
- package/dist/assets/index-Dvxx9UaB.js +0 -1
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-BQUVbUQb.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-XSnEPSCB.js +0 -1
- package/dist/assets/useCashManagementBanner-Cqvytrqk.js +0 -1
- package/dist/assets/useChargeCardPusherEvents-DWEn28bl.js +0 -1
- package/dist/assets/useEmailConnectResultRefresh-iMxOBvVh.js +0 -1
- package/dist/assets/useInitialThreadRequest-BsceBU6n.js +0 -1
- package/dist/assets/withTransactionSidePanel-BzY2xiGY.js +0 -21
- package/dist/assets/zeni-epic-state-DuQa9FMz.js +0 -13
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-DC3GaKoW.js";import{a}from"./sentry-CuaXjR5n.js";import{u,g as m,h as g,N as p}from"./core-Bv1T7LZC.js";import{z as d,B as b,t as y,d as f,f as h}from"./index-CwcEF-q7.js";import{gt as x,gu as I,Mg as w}from"./zeni-epic-state-DuQa9FMz.js";import{n as j}from"./mui-VYhJrGDQ.js";import"./recharts-D979ncoh.js";import"./analytics-Bqx0zRxd.js";import"./plaid-BlhDSPsk.js";import"./dnd-CrtLd1r-.js";import"./stripe-DMRn4zHo.js";import"./lottie-BAdftm7g.js";import"./lexical-DtmspfR6.js";import"./pdf-DyfSqkK5.js";import"./utils-DPYDOv00.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]="bd914856-cd2e-4957-b956-2a7bfde0e7cf",e._sentryDebugIdIdentifier="sentry-dbid-bd914856-cd2e-4957-b956-2a7bfde0e7cf")}catch{}})();function $(){const e=u(),t=m(),i=g(),n=a.useRef(!1),c=d.isSignedIn(),r=t.state?.message==="logout",o=r||c;return a.useEffect(()=>{o&&!n.current&&(n.current=!0,setTimeout(()=>{try{d.clearAll(),e(x()),e(I(!1)),w(),y.reset(),f.trackLogout(h.Event.logoutSuccess),f.resetUserIdentity()}catch(l){console.error("Error during sign out:",l)}finally{r||i("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(v,{children:s.jsx(b,{fetchState:"In-Progress"})}):s.jsx(p,{to:"../",replace:!0})}const v=j.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
height: 100vh;
|
|
4
|
-
width: 100%;
|
|
5
|
-
flex: 1 1 auto;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: center;
|
|
8
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`;export{$ as default};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-DC3GaKoW.js";import{a as G}from"./sentry-CuaXjR5n.js";import{h as K,u as _,g as v,j as b,i as z,n as M}from"./core-Bv1T7LZC.js";import{z as R,W,U as p,X as J,w as O,d as Z,f as H,d9 as Q,n as g,p as V}from"./index-CwcEF-q7.js";import{eW as q,TI as F,J1 as C,TJ as x,TE as X,Ip as y,TK as Y,Ix as E,HT as aa,J2 as S,TL as B,fy as ea,IU as ta,IZ as sa,IM as oa,IK as w,I_ as na,IH as ia,TM as la,TN as ra,TO as ca,TP as ka,TQ as T,ei as da,TR as ua,TS as pa}from"./zeni-epic-state-DuQa9FMz.js";import{n as Ta}from"./mui-VYhJrGDQ.js";import{u as ma}from"./useAskAiCfoHostNavButtonProps-XSnEPSCB.js";import{M as ga}from"./MobileAppDrawer-PDN1hPUR.js";import"./recharts-D979ncoh.js";import"./analytics-Bqx0zRxd.js";import"./plaid-BlhDSPsk.js";import"./dnd-CrtLd1r-.js";import"./stripe-DMRn4zHo.js";import"./lottie-BAdftm7g.js";import"./lexical-DtmspfR6.js";import"./pdf-DyfSqkK5.js";import"./utils-DPYDOv00.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]="33cb75d4-20d5-496c-a16c-99578a93d61f",e._sentryDebugIdIdentifier="sentry-dbid-33cb75d4-20d5-496c-a16c-99578a93d61f")}catch{}})();const fa=Ta.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
min-height: 100%;
|
|
4
|
-
width: 100%;
|
|
5
|
-
flex: 1 1 auto;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: center;
|
|
8
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,ha=M(function(e,t){const o=F(e,t.isTaskTemplatesEnabled),{taskGroupId:c}=t,n=c!=null&&c!==""?{...o,taskGroupsWithTasksList:o.taskGroupsWithTasksList.map(l=>({...l,tasks:l.tasks.filter(a=>a.taskGroupIds.includes(c))})).filter(l=>l.tasks.length>0)}:o,d=X(e),i=R.isZeniUser();return{taskListView:n,tagListView:d,localData:n.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:i}},function(e,t){const{navigate:o,currentTenant:c,location:n,isTaskTemplatesEnabled:d}=t,{tenantEmailDomain:i}=c,{groupByKey:l}=t.uiState;return{onTaskManagementRowClick:a=>{const s=L(i,a),k=g(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:k}})},onReloadTasks:()=>{e(C(!0,d))},onTabChange:a=>{e(ka(a))},onParentTaskClick:a=>{const s=L(i,a);window.open(s,"_blank","noopener")},bulkUpdateTasks:(a,s)=>{e(w(a,null,s))},onNewTaskClick:()=>{if(t.localData.defaultTaskGroupId!=null){const a=I(i,t.localData.defaultTaskGroupId),s=g(n.state?.pathnameStackToGoBack,n.pathname);o(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{e(B({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{e(ca({filters:a}))},onSearchTextChanged:a=>{e(ra({searchText:a}))},onReloadCards:()=>{e(C(!0,d))},onBackClick:()=>{if(n.state?.message==="triggerBackClick"){const a=V(n.state?.pathnameStackToGoBack),s=a.poppedPathname??"../";o(s,{state:{pathnameStackToGoBack:a.newStack}})}else o("../")},updateLocalData:a=>{e(la({localData:a}))},resetLocalData:()=>{e(x({taskGroupById:t.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{e(ia(t.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{e(w(t.localData.selectedTaskIds,a,na(t.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{e(oa(a))},onAddNewTaskToTaskGroup:a=>{if(t.localData.defaultTaskGroupId!=null){const s=Da(l,a);e(y({taskDetailLocalData:s}));const k=I(i,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),f=g(n.state?.pathnameStackToGoBack,n.pathname);o(k,{state:{pathnameStackToGoBack:f,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{e(sa(t.localData.selectedTaskIds.length>0?t.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{e(ta(a,s))},onTimeSpentUpdate:(a,s)=>{e(S({task:a,updates:s}))},onShowToast:a=>{e(ea(a))},onGroupByFilterChange:a=>{e(B({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{e(S({task:a,updates:s}))},onCreateTagClick:(a,s)=>{e(aa(a,s))},handleGroupTemplateClick:a=>{e(E(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{e(E(a,[s]))},handleNewTaskInitialization:a=>{if(e(y({taskDetailLocalData:{...Y,name:a}})),t.localData.defaultTaskGroupId!=null){const s=I(i,t.localData.defaultTaskGroupId),k=g(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:k,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{o(`/${i}/tasks/group/${a}`)},onQuickResponsesClick:()=>{o(`/${i}/tasks/quick-responses`)}}})(Q);function ja(){const e=K(),t=_(),o=v(),c=R.getSignedInUser(),n=b(r=>q(r)),{taskGroupId:d}=z(),{useFeatureGate:i}=W(),{isFeatureEnabled:l}=i(p.isTaskTemplatesEnabled),{isFeatureEnabled:a}=i(p.isTaskCannedResponsesEnabled),{isFeatureEnabled:s}=i(p.isTaskCategorizationEnabled),{isFeatureEnabled:k}=i(p.isTaskBulkResolutionEnabled),{isFeatureEnabled:f}=i(p.isTaskGroupAssigneesEnabled),{isFeatureEnabled:A}=i(p.isTaskRecurringParentEnabled),[P,N]=G.useState(!1),h=b(r=>F(r,l)),D=b(r=>r.taskGroupState),m=h.fetchState,{isAiCfoAccessEnabled:U,onAskAiCfoClick:j}=ma({mobileExploreReferrer:"Task Checklist"});if(J({isDataReady:m==="Completed"}),G.useEffect(()=>{t(C(!1,l))},[n?.tenantId,t,l]),G.useEffect(()=>{m==="Completed"&&t(x({taskGroupById:D.taskGroupById}))},[m,D.taskGroupById]),c==null)throw Error("Can't access task list page without signing in...");return u.jsxs(u.Fragment,{children:[m==="Completed"?u.jsx(O,{analytics:Z,onLoad:r=>($=>$.trackPageLoaded(H.Event.taskListPage))(r)}):null,u.jsxs(fa,{children:[u.jsx(ga,{isAppContentDrawerOpen:P,handleDrawerToggle:r=>{N(r)}}),u.jsx(ha,{location:o,navigate:e,currentTenant:n,taskGroupId:d,taskGroupState:D,localData:h.localData,uiState:h.uiState,isTaskTemplatesEnabled:l,taskListFetchState:m,isTaskCategorizationEnabled:s,isTaskCannedResponsesEnabled:a,isTaskBulkResolutionEnabled:k,isTaskGroupAssigneesEnabled:f,isTaskRecurringParentEnabled:A,isAiCfoAccessEnabled:U,onAskAiCfoClick:j})]})]})}const L=(e,t)=>`/${e}/tasks/${encodeURIComponent(t)}`,I=(e,t)=>`/${e}/tasks/new/${t}`,Da=(e,t)=>{if(e==="assignee"){const o=t.split(",");return{...T.taskDetailLocalData,assignee:o}}if(e==="priority"){const o=da(t);return{...T.taskDetailLocalData,priority:o}}if(e==="status"){const o=ua(t);return{...T.taskDetailLocalData,status:o}}if(e==="tag"){const o=t.split(",");return{...T.taskDetailLocalData,tagIds:o}}if(e==="dueDate"){const o=pa(t);return{...T.taskDetailLocalData,dueDate:o}}return{...T.taskDetailLocalData}};export{ja as default};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{j as n}from"./liveblocks-DC3GaKoW.js";import se from"./NotFoundScreen-CKyavEYX.js";import{a as c}from"./sentry-CuaXjR5n.js";import{h as H,u as O,j as g,g as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-Bv1T7LZC.js";import{I4 as W,I7 as le,I1 as de,eW as Z,TE as M,Il as K,H_ as pe,IR as ue,IK as ke,TF as Q,TG as q,HW as me,HT as fe,rC as ge,rq as he,l5 as Ie,If as Se,TH as Te,Iw as be,It as Ee,Ia as Ce,Iq as Ge,Ip as De}from"./zeni-epic-state-DuQa9FMz.js";import{z as G,d7 as xe,r as we,W as ye,U as b,p as X,n as v,w as je,d as z,f as ve,d8 as Re,h as V,au as Fe}from"./index-CwcEF-q7.js";import{n as Ue}from"./mui-VYhJrGDQ.js";import{u as Be}from"./useInitialThreadRequest-BsceBU6n.js";import{M as Pe}from"./MobileAppDrawer-PDN1hPUR.js";import Le from"./TaskListScreen-Cs7VLiUm.js";import"./recharts-D979ncoh.js";import"./analytics-Bqx0zRxd.js";import"./plaid-BlhDSPsk.js";import"./dnd-CrtLd1r-.js";import"./stripe-DMRn4zHo.js";import"./lottie-BAdftm7g.js";import"./lexical-DtmspfR6.js";import"./pdf-DyfSqkK5.js";import"./utils-DPYDOv00.js";import"./useAskAiCfoHostNavButtonProps-XSnEPSCB.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]="d312b52b-9b7a-40ca-8fca-04c626b73eaa",e._sentryDebugIdIdentifier="sentry-dbid-d312b52b-9b7a-40ca-8fca-04c626b73eaa")}catch{}})();function $e(){const e=H(),t=O(),s=G.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(W())},[t]),k=c.useCallback((o,h,I)=>{t(le({name:o,content:h,cannedResponseId:I}))},[t]),a=c.useCallback(o=>{t(de({cannedResponseId:o}))},[t]);if(s==null)throw Error("Can't access quick responses page without signing in...");return n.jsx(xe,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let A,_=[];const Ne=re(function(e,t){const{location:s,taskGroupId:u}=t,r=Q(e,t.taskId),d=Z(e),l=r.taskGroupId??u,k=l!=null?q(e.taskGroupState,l):void 0,a=G.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},I=M(e),{tenantEmailDomain:D}=d,E=r.recurringSourceTaskId,x=E!=null?`${V.appUrl}/${D}/tasks/${encodeURIComponent(E)}`:void 0;var S;return{taskDetailSelectorView:r,authParams:h,isZeniUser:G.isZeniUser(),userGroupList:((S=e.userGroupsState.userGroupByUserGroupId)!==A&&(A=S,_=Object.values(S)),_),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Fe.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${V.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:I,taskGroupName:l!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map(p=>q(e.taskGroupState,p)).filter(p=>p!=null&&!p.isDeleted).map(p=>({id:p.id,name:p.name,isDefault:p.isDefault}))}},function(e,t){const{taskId:s,navigate:u,currentTenant:r,location:d,taskGroupId:l}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ge(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ce(t.taskId))},onSnoozeTask:(a,o)=>{e(Ee(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=X(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=R(k),o=v(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Se(s))},updateFilesEntity:a=>{e(Ie({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(ge(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(K(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(W())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(Re);function j(){const e=H(),t=O(),s=ne(),u=we(),{taskId:r,taskGroupId:d}=oe(),l=g(i=>Z(i)),k=Be(l?.companyId),{useFeatureGate:a}=ye(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:I}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:E}=a(b.isTaskGroupAssigneesEnabled),[x,S]=c.useState(!1),[p,Y]=c.useState(!1),[F,J]=c.useState(!1),[U,ee]=c.useState(!1),[B,w]=c.useState(!1),T=c.useRef(!1),C=g(i=>i.taskListState.updateTasksFetchState.fetchState),P=g(i=>M(i)),L=g(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(Y(!0),t(K(!1,r)))},[p,t]),c.useEffect(()=>{F||P.fetchState==="Completed"||(J(!0),t(pe()))},[F,t,P.fetchState]),c.useEffect(()=>{U||L==="Completed"||(ee(!0),t(ue()))},[U,t,L]);const ae=c.useCallback(()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),w(!0))},[t,r]);c.useEffect(()=>{if(B)if(C!=="In-Progress"){if(T.current){if(C==="Error")return w(!1),void(T.current=!1);if(C==="Completed"){w(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=X(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=R(i);e(m,{state:{pathnameStackToGoBack:v(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0},[B,C,l,s,e]);const $=g(i=>Q(i,r)),y=$.fetchState,N=G.getSignedInUser();if(N==null)throw Error("Can't access task detail page without signing in...");if(y==="Error"&&$.error?.code===400){const{tenantEmailDomain:i}=l,m=R(i),te=v(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[y==="Completed"?n.jsx(je,{analytics:z,onLoad:i=>(m=>m.trackPageLoaded(ve.Event.taskDetailPage))(i)}):null,n.jsxs(qe,{children:[n.jsx(Pe,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{S(i)}}),n.jsx(Ne,{analytics:z,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:N,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:y,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:I,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:E})]})]})}const qe=Ue.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
min-height: 100%;
|
|
4
|
-
width: 100%;
|
|
5
|
-
flex: 1 1 auto;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: center;
|
|
8
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,R=e=>`/${e}/tasks`;function ia(){return n.jsxs(ce,{children:[n.jsx(f,{path:"/new",element:n.jsx(j,{})}),n.jsx(f,{path:"/new/:taskGroupId",element:n.jsx(j,{})}),n.jsx(f,{path:"/group/:taskGroupId",element:n.jsx(Le,{})}),n.jsx(f,{path:"/quick-responses",element:n.jsx($e,{})}),n.jsx(f,{path:"/:taskId",element:n.jsx(j,{})}),n.jsx(f,{path:"*",element:n.jsx(se,{})})]})}export{ia as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t}from"./liveblocks-DC3GaKoW.js";import i from"./NotFoundScreen-CKyavEYX.js";import{T as r}from"./TransactionDetailScreen-CWpk0UU1.js";import"./sentry-CuaXjR5n.js";import{o as s,p as o}from"./core-Bv1T7LZC.js";import"./zeni-epic-state-DuQa9FMz.js";import"./recharts-D979ncoh.js";import"./index-CwcEF-q7.js";import"./mui-VYhJrGDQ.js";import"./analytics-Bqx0zRxd.js";import"./plaid-BlhDSPsk.js";import"./dnd-CrtLd1r-.js";import"./stripe-DMRn4zHo.js";import"./lottie-BAdftm7g.js";import"./lexical-DtmspfR6.js";import"./pdf-DyfSqkK5.js";import"./utils-DPYDOv00.js";import"./useAskAiCfoHostNavButtonProps-XSnEPSCB.js";import"./decodeURIComponentSafe-CgJ-EbJc.js";import"./routePaths-CjJlLbxf.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]="a4852925-22e4-4d6c-b9c0-7fe8ce24ec96",e._sentryDebugIdIdentifier="sentry-dbid-a4852925-22e4-4d6c-b9c0-7fe8ce24ec96")}catch{}})();function k(){return t.jsxs(s,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{k as default};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{j as x}from"./liveblocks-DC3GaKoW.js";import{a as i}from"./sentry-CuaXjR5n.js";import{u as W,k as Ke,j as S,s as fe,g as ge,h as Te,i as be,N as Qe,n as Xe}from"./core-Bv1T7LZC.js";import{nO as he,eW as Q,gp as Ze,Oe as et,m$ as tt,mJ as at,bn as nt,cT as Ee,bs as Ie,ra as q,Nd as H,Of as ve,Og as oe,ND as De,kI as Ce,Oh as ke,NI as se,NJ as ce,lx as Ae,K8 as ie,N7 as M,kC as Oe,kA as Ue,kM as ot,nB as st,Oi as ct,Oj as it,vn as K,kH as xe,Jt as we,cY as rt,cZ as lt,Ok as dt,N6 as ut,Ol as mt,vj as pt,Om as ft,On as ht,Oo as yt,Op as St,Oq as gt,kL as Tt,Or as bt,Os as Et,N8 as It,Ot as vt,Ou as Dt,Ov as Ct,Jn as kt,Jd as At,JC as Ot,kN as Ut,K9 as ye,nG as xt}from"./zeni-epic-state-DuQa9FMz.js";import{W as J,U as w,z as _e,aQ as Pe,m as wt,Z as _t,aR as Pt,x as Ft,p as ae,I as Vt,aS as Bt,n as ne,X as Nt,aT as Rt,d as Fe,aU as Lt,au as zt,a2 as te}from"./index-CwcEF-q7.js";import{n as Gt,S as jt,D as $t}from"./mui-VYhJrGDQ.js";import{u as Mt}from"./useAskAiCfoHostNavButtonProps-XSnEPSCB.js";import{d as Ve}from"./decodeURIComponentSafe-CgJ-EbJc.js";import{h as Be,c as Ne,g as Wt,e as qt}from"./routePaths-CjJlLbxf.js";import{u as Ht}from"./utils-DPYDOv00.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]="750b5a4b-ea97-4997-bd71-88dea0b2c4f7",t._sentryDebugIdIdentifier="sentry-dbid-750b5a4b-ea97-4997-bd71-88dea0b2c4f7")}catch{}})();function Jt(t=!0){const e=W(),s=Ke(),{useFeatureGate:a}=J(),{isFeatureEnabled:n}=a(w.isCreateTransferEntryFromExpenseEnabled);i.useEffect(()=>{if(!t||n!==!0)return;const o=c=>{const r=s.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return r!=="In-Progress"&&r!=="Completed"};o("transferEntryEligible")&&e(he({kind:"transferEntryEligible"})),o("creditCardOnlyEligible")&&e(he({kind:"creditCardOnlyEligible"}))},[t,n,e,s])}function Yt(t,e){const s=function(){const r=W(),[p,g]=i.useState(!1),[A,y]=i.useState(null),[m,O]=i.useState(null),{useDynamicConfig:T}=J(),{configValue:f,isDynamicConfigLoading:C}=T("transaction_categorization_config"),v=!C&&f?.capitalization_enabled===!0,k=S(h=>Q(h)),b=k.companyId,U=S(h=>Ze(h.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$"),{capitalizableAccounts:_,capitalizableAccountOverrides:B,dismissedAccounts:z}=S(h=>{const E=h.tenantState.currentTenantId,u=E!=null?h.tenantState.tenantsById[E]:void 0;return{capitalizableAccounts:u?.capitalizableAccounts??null,capitalizableAccountOverrides:u?.capitalizableAccountOverrides??null,dismissedAccounts:u?.capitalizationOnboardingDismissedAccounts??null}},fe),G=i.useRef(_);G.current=_;const N=i.useRef(B);N.current=B;const P=i.useRef(z);P.current=z;const R=S(h=>et(h.accountState),fe),I=i.useMemo(()=>{const h={};for(const E of R)E.accountId!=null&&E.accountName!=null&&(h[E.accountId]=E.accountName);return h},[R]),l=m!=null?I[m]??null:null,j=i.useCallback(h=>{if(!v)return;const E=G.current;if(E==null)return;const u=E.accounts??[],$=new Set(h),X=N.current??{},Y=P.current;for(const L of u)if($.has(L.accountId)&&X[L.accountId]==null&&Y?.[L.accountId]==null)return y(L.classificationType),O(L.accountId),void g(!0)},[v]),D=i.useCallback((h,E)=>{r(tt(b,h,E,!0)),g(!1),y(null),O(null)},[r,b]),F=i.useCallback(()=>{m!=null&&(r(at(b,m)),g(!1),y(null),O(null))},[r,b,m]);return{showPopup:p&&v,popupType:A,popupAccountId:m,popupAccountName:l,currencySymbol:U,checkAndShowPopup:j,handleSubmit:D,handleDismiss:F}}(),a=i.useRef(void 0),n=i.useRef([]),o=i.useRef(s.checkAndShowPopup);o.current=s.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect(()=>{t==="In-Progress"&&(n.current=c.current()),t==="Completed"&&a.current==="In-Progress"&&n.current.length>0&&(o.current(n.current),n.current=[]),a.current=t},[t]),s}const re=()=>{const t=_e.getSignedInUser(),{useFeatureGate:e}=J(),{isFeatureEnabled:s}=e(w.isChainOfThoughtEnabled);return i.useMemo(()=>nt(t)&&s,[t,s])};function Re(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function ha(t,e){const s=W(),{useFeatureGate:a,useDynamicConfig:n}=J(),o=S(u=>Q(u)),c=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),r=o.userRole!=null&&Ee(o.userRole),p=o.userRole!=null&&Ie(o.userRole),{isFeatureEnabled:g}=a(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:A}=a(w.isExpenseAutomationEnabled),{configValue:y}=n(Pe.enableUncategorizedExpenseCategory),m=y?.uncategorized_expense_category_enabled===!0,O=re(),T=i.useMemo(()=>({id:t,type:q(e)}),[t,e]),f=S(u=>H(u,T)),C=f?.transactionDetailUpdateStatus?.fetchState,v=f?.transactionDetailLocalData?.lineItemById,k=S(u=>{const $=H(u,T)?.transactionDetailLocalData.vendorUpdates?.id;return $==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[$]?.saveStatus.fetchState??"Not-Started"}),b=i.useMemo(()=>f?.fetchState==="Completed"?Re(f?.transaction):void 0,[f?.fetchState,f?.transaction]),U=S(u=>{if(b!=null)return ve(u.customerIncomeState,u.vendorExpenseState,u.trendState,b,"month")}),_=S(u=>oe(u)),B=S(u=>{if(b!=null)return De(u.trendWithTransactionsState,b,"TransactionDetail")}),z=o.company?.companyInfo.firstMonthOfFY??1,G=S(u=>Ce(u.accountState,u.accountListState,"accountList")),[N,P]=i.useState(!1),[R,I]=i.useState(!1),[l,j]=i.useState(!1);i.useEffect(()=>{P(!1),I(!1),j(!1)},[t,e]);const D=i.useCallback(()=>{P(!1),I(!1)},[]),[F,h]=i.useState(!1),E=B?.selectedPeriod?.timePeriod;return i.useEffect(()=>{l||f==null||f.transaction==null||(s(ke({id:f.transaction.id,type:f.transaction.type})),j(!0)),b!=null&&(!c||r&&p===!1)&&(N?R||U==null||(I(!0),s(ie(b,"TransactionDetail",{timeframe:"month",timePeriod:E??U}))):(s(se()),s(ce()),P(!0),s(Ae(b))))},[s,l,f?.fetchState,f?.transaction,b,c,r,p,N,R,U,E]),i.useEffect(()=>{_.newVendorState?.vendorDetailLocalData?.vendorName!=null?h(!0):h(!1)},[_.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect(()=>()=>{s(M("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:c,isUserHasDashboardAccess:r,isUserHasInvestorOrBankerAccess:p,isVendorBulkUpdateOnTransactionEnabled:g,isExpenseAutomationEnabled:A,isUncategorizedExpenseCategoryEnabled:m,isChainOfThoughtEnabled:O,selectedTransaction:T,transactionDetail:f,rawDetailSaveStatus:C,rawDetailLineItemById:v,vendorSaveStatus:k,tranEntity:b,defaultTrendTransactionTimePeriod:U,vendorViewDetails:_,uiState:B,firstMonthOfFY:z,uncategorizedAccounts:G,resetTrendIsFetchedStates:D,isCreateVendorDrawerOpen:F,setIsCreateVendorDrawerOpen:h}}const Kt={overlayWidth:new Ft(100,100,58)},Qt=({isOpen:t,onSaveVendor:e,onSaveSuccess:s,onCancel:a,vendorViewDetails:n})=>{const o=wt(),c=_t(),r=W(),p=S(y=>oe(y)),g=()=>{a()},A={vendorDetailView:n??p,onSaveSuccess:()=>{r(Ue()),r(ot("Not-Started")),s()},onSaveVendor:e,onCancelClick:g,saveVendorDetailLocalData:y=>{r(Oe({vendorId:void 0,localData:y}))}};return x.jsx($t,{anchor:"right",open:t,PaperProps:{style:{width:Kt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:g,children:x.jsx(Xt,{onClick:y=>y.stopPropagation(),children:x.jsx(Pt,{...A})})})},Xt=Gt(jt)`
|
|
2
|
-
display: flex;
|
|
3
|
-
min-height: 100%;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
`;function Zt(t,e){t(st({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:q(e.transactionType),sourceTransactionType:q(e.sourceTransactionType)}))}function ea({currentTransactionId:t,enabled:e=!0,buildPath:s,beforeNavigate:a,navigate:n,navigateState:o}){const c=S(p=>p.createTransferEntryState.lastTransferEntryReplacement),r=i.useRef(null);i.useEffect(()=>{if(!e||c==null||t==null||r.current===c)return;const{previousTransactionId:p,newTransactionId:g}=c;t.id===p.id&&t.type===p.type&&(r.current=c,a?.(),n(s(g),{replace:!0,state:o}))},[e,c,t,s,a,n,o])}const ta=({closeDrawerHandler:t,overrideTransactionId:e,overrideTransactionType:s})=>{const a=ge(),n=Te(),o=W(),c=re(),{transactionTypeEncoded:r,transactionId:p}=be(),g=e??p,A=s??Ve(r??"");let y;Be(g,A)&&(y={id:g,type:q(A)});const m=y!=null?S(T=>H(T,y)):void 0,O=()=>{const T=ae(a.state?.pathnameStackToGoBack),f=T.poppedPathname??((C=2)=>{let v="../";for(let k=0;k<C;k++)v=`${v}../`;return v})(1);n(f,{state:{pathnameStackToGoBack:T.newStack}})};return{transactionId:y,onSaveVendor:()=>{o(xe(y,void 0))},onSaveSuccess:()=>{if(m!=null&&m?.transaction&&m?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&m?.transactionDetailLocalData.vendorUpdates?.id!=null){const T=m?.transactionDetailLocalData.vendorUpdates,f={id:m?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:m?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:T?.name,qboId:m?.transactionDetailLocalData.vendorUpdates?.qboId??""},C={transactionId:{id:m?.transaction?.id,type:m?.transaction?.type},transaction:m?.transaction,lineIds:m?.transaction?.lines?.map(v=>v.id)??[]};o(K({entity:f,amount:m?.transaction?.amount.amount,transactionDetails:C,flowType:"detail",isFetchCOT:c}))}O()},onCancel:()=>{y!=null&&o(ct({transactionId:y})),o(Ue()),o(it()),t(!0),O()}}},aa=Xe(function(t,e){const s=H(t,e.selectedTransaction);let a;s==null&&console.warn("Check if the you've selected the transaction before getting the details");const n=_e.getSignedInUser(),o=t.tenantState.currentTenantId,c={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""};s!=null&&s.fetchState==="Completed"&&s.transaction!=null&&e.entity!=null&&(a=dt(t,e.entity,"TransactionDetail"));const r=t.entityAutoCompleteState.autoCompleteText.common,p=ut(t,"common"),g=Q(t);return{transactionDetail:s,transactionAttachmentEndpointToDownload:`${te}/transaction_attachment`,transactionAttachmentsEndpointToFetch:g.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${te}/transaction_attachments_accounting_provider`:`${te}/transaction_attachments`,attachmentUploadEndpoint:`${zt.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:a,analytics:Fe,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:r,entityAutoCompleteView:p},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails")}},function(t,e){const{isCOTEnabled:s}=e;return{onBackClick:()=>{if(t(M("common")),e.onBackClick!=null)return void e.onBackClick();const a=ae(e.location.state?.pathnameStackToGoBack),n=a.poppedPathname??Le(2);e.navigate(n,{state:{pathnameStackToGoBack:a.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(a,n)=>{e.transaction!=null&&t(xt({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:a,customerId:n}))},onTransactionClick:a=>{e.resetTrendIsFetchedStates(),t(se()),t(ce());const n=ne(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Ne(a,e.tenantEmailDomain),{state:{pathnameStackToGoBack:n}})},onTrendSelectedPeriodChange:a=>{if(a==null)e.defaultTrendTransactionTimePeriod!=null&&t(ye(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const n=a.currentTimePeriod==null?a.addTimePeriod:{startDate:a.addTimePeriod.startDate,endDate:a.currentTimePeriod.endDate};t(ie(e.entity,"TransactionDetail",{timeframe:a.timeframe,timePeriod:a.addTimePeriod})),t(ye(e.entity,"TransactionDetail",{timeframe:a.timeframe,timePeriod:n}))}},onSaveUpdates:(a,n,o,c)=>{t(c===!0&&o!=null?xe(a,o,!0,e.isExpenseAutomationEnabled,e.isUncategorizedExpenseCategoryEnabled):Ut({transactionId:a,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:n,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled})),t(M("common"))},onUploadAttachmentAttachment:a=>{t(Ot(a))},onDeleteAttachment:a=>{e.transaction!=null&&t(At(a,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(a,n)=>{t(kt({transactionId:a,transactionLocalData:n}))},onUpdateAllChecked:(a,n,o,c)=>{e.transaction!=null&&t(Ct(e.selectedTransaction,e.transaction,a,n,o,c))},onResetLineItemsCategoryClassInLocalData:(a,n,o,c,r,p)=>{t(Dt(a,n,o,c,r,p))},onChangeCategoryClassWhenUpdateAllIsChecked:(a,n)=>{e.transaction!=null&&t(vt({id:e.transaction.id,type:e.transaction.type},e.transaction,a,n))},onSaveSuccess:()=>{const a=ae(e.location.state?.pathnameStackToGoBack);if(a.poppedPathname!=null){const n=Ht(a.poppedPathname,"/").split("/"),o=n[n.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(o)&&e.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${Wt(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${qt(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{t(we(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(a,n)=>{a.trim().length>=2?t(It({searchString:a,entityType:n,searchOrigin:"common"})):a.trim().length===0&&t(M("common"))},onCancelAutoComplete:()=>{t(M("common"))}},onFetchRecommendationsForEntity:(a,n,o,c)=>{t(K({entity:a,amount:n,transactionDetails:o,flowType:"detail",isFetchCOT:s}))},clearRecommendationForLineId:a=>{const{transactionId:n,transaction:o,lineId:c}=a;t(Et(n,o,c))},resetUpdateErrorState:()=>{const a={id:e.selectedTransaction.id,type:e.selectedTransaction.type};t(bt(a))},onSaveVendorInLocalData:(a,n,o,c,r)=>{if(t(Tt({transactionId:a,vendorUpdates:n,entity:o})),n.id!=null&&o!=null&&c!=null&&r!=null&&t(K({entity:o,amount:c,transactionDetails:r,flowType:"detail",isFetchCOT:s})),t(Oe({vendorId:n.id?n.id:void 0,localData:{vendorName:n.name,vendorId:n.id?n.id:void 0}})),!n.id&&e.transaction!=null){const p=e.transaction,g=ne(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(p.type??"")}/${p.id}/vendor/create`,{state:{pathnameStackToGoBack:g}})}},onSaveCustomerInLocalData:(a,n,o,c,r)=>{t(gt({transactionId:a,customerUpdates:n,entity:o})),n.id!=null&&o!=null&&c!=null&&r!=null&&t(K({entity:o,amount:c,transactionDetails:r,flowType:"detail",isFetchCOT:s}))},onUpdateAllTranactionsWithCurrentVendorChecked:a=>{t(St({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:a}))},onClickUpdateVendorToAllLineItems:(a,n,o)=>{t(yt(a,n,o))},onResetVendorToAllLineItems:(a,n,o)=>{t(ht(a,n,o))},saveLatestSelectedEntity:(a,n,o)=>{t(ft({transactionId:a,lineId:n,entity:o}))},updateVendorBulkRecommendationsFetchStatus:(a,n)=>{t(pt(a,n))},setIsVendorUpdateAllChecked:(a,n,o)=>{t(mt(a,n,o))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?a=>Zt(t,a):void 0}})(Lt);function ya(){const t=Te(),e=W(),s=ge(),{useFeatureGate:a,useDynamicConfig:n}=J(),o=Vt(),c=S(d=>Q(d)),r=c.userRole.includes("charge_card_user")||c.userRole.includes("charge_card_admin"),p=c.userRole!=null&&Ee(c.userRole),g=c.userRole!=null&&Ie(c.userRole),{isFeatureEnabled:A}=a(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:y}=a(w.isExpenseAutomationEnabled),{configValue:m}=n(Pe.enableUncategorizedExpenseCategory),O=m?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:T,transactionTypeEncoded:f,transactionId:C}=be(),[v,k]=i.useState(!1),b=Ve(f??""),U=Be(C,b),_=S(d=>d.transactionVendorViewState),B=re(),{isFeatureEnabled:z}=a(w.isTransactionCommentingEnabled),{isFeatureEnabled:G}=a(w.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:N}=a(w.isProjectsTransactionsEnabled),P=o?.currentTenant?.companyId,R=o?.currentTenant?.companyName,I=i.useMemo(()=>{if(U)return{id:C,type:q(b)}},[U,C,b]),l=I!=null?S(d=>H(d,I)):void 0,j=l?.transactionDetailLocalData.vendorUpdates?.id!=null?_.editVendorStateById[l?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",D=l?.fetchState==="Completed"?Re(l?.transaction):void 0,F=S(d=>D!=null?ve(d.customerIncomeState,d.vendorExpenseState,d.trendState,D,"month"):void 0),h=S(d=>oe(d)),E=S(d=>D!=null?De(d.trendWithTransactionsState,D,"TransactionDetail"):void 0),u=c.company?.companyInfo.firstMonthOfFY??1,$=S(d=>Ce(d.accountState,d.accountListState,"accountList")),[X,Y]=i.useState(!1),[L,le]=i.useState(!1),[ze,de]=i.useState(!1),Ge=i.useCallback(d=>Ne(d,T??"")+s.search,[T,s.search]),je=i.useCallback(()=>{de(!1)},[]);ea({currentTransactionId:I,enabled:T!=null&&T!=="",buildPath:Ge,beforeNavigate:je,navigate:t,navigateState:s.state});const ue=()=>{Y(!1),le(!1)},me=Bt();Jt();const Z=i.useRef(l?.transaction);Z.current=l?.transaction;const $e=l?.transactionDetailUpdateStatus?.fetchState,V=Yt($e,()=>{const d=[];if(Z.current!=null)for(const ee of Z.current.lines??[])"account"in ee&&ee.account?.accountId!=null&&d.push(ee.account.accountId);return d});i.useEffect(()=>{I!=null&&l!=null&&l.fetchState==="Not-Started"&&(e(we(I,!1)),ue())},[e,I,l?.fetchState]),i.useEffect(()=>{if(I!=null&&l?.fetchState==="Error"){const d=ne(s.state?.pathnameStackToGoBack,s.pathname);t("page-not-found",{replace:!0,state:me?{pathnameStackToGoBack:d,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:d,message:"pageNotFound",origin:"transaction_detail"}})}},[I,l?.fetchState,t,s.state,s.pathname,me]),i.useEffect(()=>{ze||l==null||l.transaction==null||(e(ke({id:l.transaction.id,type:l.transaction.type})),de(!0)),D==null&&l?.fetchState==="Completed"&&Se(l?.transaction),D!=null&&(!r||p&&g===!1)&&(X?L||F==null||(le(!0),e(ie(D,"TransactionDetail",{timeframe:"month",timePeriod:E?.selectedPeriod?.timePeriod??F}))):(e(se()),e(ce()),Se(l?.transaction),Y(!0),e(Ae(D))))},[l?.fetchState,l?.transaction,F,r]),i.useEffect(()=>{h.newVendorState?.vendorDetailLocalData?.vendorName!=null?k(!0):k(!1)},[h.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect(()=>()=>{e(M("common"))},[]);const Me=[f,C].filter(d=>d!=null),{transactionId:pe,onSaveVendor:We,onSaveSuccess:qe,onCancel:He}=ta({closeDrawerHandler:d=>{k(!1),t(d?"../":"../..")}}),{isAiCfoAccessEnabled:Je,onAskAiCfoClick:Ye}=Mt({mobileExploreReferrer:"Transaction Details"});return Nt({isDataReady:l?.fetchState==="Completed"}),U?x.jsxs(x.Fragment,{children:[pe!=null&&v&&x.jsx(Qt,{isOpen:v,transactionId:pe,onSaveVendor:We,onSaveSuccess:qe,onCancel:He}),x.jsx(aa,{hideDeleteAttachment:!0,firstMonthOfFY:u,isDisabled:l?.transaction?.type==="transfer"&&o?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:T,location:s,navigate:t,selectedTransaction:I,entity:D,isCOTEnabled:B,defaultTrendTransactionTimePeriod:F,resetTrendIsFetchedStates:ue,transaction:l?.transaction,uncategorizedAccounts:$,vendorSaveStatus:j,isVendorBulkUpdateOnTransactionEnabled:A,isCreateTransferEntryFromExpenseEnabled:G,isExpenseAutomationEnabled:y,isUncategorizedExpenseCategoryEnabled:O,isAiCfoAccessEnabled:Je,onAskAiCfoClick:Ye,isTransactionCommentingEnabled:z,isProjectsTransactionsEnabled:N,companyId:P,companyName:R}),V.showPopup&&V.popupType!=null&&x.jsx(Rt,{popupType:V.popupType,currencySymbol:V.currencySymbol,accountId:V.popupAccountId??"",accountName:V.popupAccountName??"",onSubmit:V.handleSubmit,onDismiss:V.handleDismiss})]}):x.jsx(Qe,{to:Le(Me.length)})}const Le=(t=2)=>{let e="../";for(let s=0;s<t;s++)e=`${e}../`;return e},Se=t=>{if(t!=null){const{transactionCategory:e,transactionClass:s}=na(t),a=oa(t);Fe.trackTransactionDetails(t.account?.accountId,t.account?.accountName,t.id,a,e.length>0?e:void 0,s.length>0?s:void 0,t.type,t.amount,t.memo,t.lines?.length??0,t.attachments?.map(n=>n.fileName))}},na=t=>{const e=[],s=[];return t.lines?.forEach(a=>{switch(a.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const n=a;n!=null&&n.account!=null&&n.account.accountName?.length>0&&e.push(n.account.accountName),n.class!=null&&n.class.className?.length>0&&s.push(n.class.className);break}}}),{transactionCategory:e,transactionClass:s}},oa=t=>rt(t)===!0?t.customer?.name??"":lt(t)===!0?t.vendor?.name??"":t.memo!=null?t.memo:t.type;export{Qt as C,ya as T,Jt as a,Yt as b,ta as c,aa as d,ea as e,re as f,Zt as g,ha as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-DC3GaKoW.js";import{h as K,g as U,u as Q,i as H,j as h,N as z,n as X,o as ve,p as j}from"./core-Bv1T7LZC.js";import{eW as W,qR as Z,jW as u,RE as ee,J$ as De,bo as le,RF as be,kx as te,NF as ae,RG as ue,RH as Pe,bE as Y,JX as ye,RI as Ee,RJ as me,RK as je,J_ as Ae,RL as xe,RM as pe,RN as Me,RO as ge,RP as Le,RQ as Ce,RR as fe,Lb as Be}from"./zeni-epic-state-DuQa9FMz.js";import{a as de,W as ne,U as q,d as G,co as ce,n as N,p as oe,T as Fe,s as Re}from"./index-CwcEF-q7.js";import"./mui-VYhJrGDQ.js";import{a as g}from"./sentry-CuaXjR5n.js";import{w as se}from"./withTransactionSidePanel-BzY2xiGY.js";import{p as ie,c as re}from"./routePaths-CjJlLbxf.js";import{v as Oe}from"./utils-DPYDOv00.js";import{d as b}from"./decodeURIComponentSafe-CgJ-EbJc.js";import{Z as Ge}from"./ZeniAccountStatementScreen-DEwEWZ2Q.js";import"./recharts-D979ncoh.js";import"./analytics-Bqx0zRxd.js";import"./plaid-BlhDSPsk.js";import"./dnd-CrtLd1r-.js";import"./stripe-DMRn4zHo.js";import"./lottie-BAdftm7g.js";import"./lexical-DtmspfR6.js";import"./pdf-DyfSqkK5.js";import"./useAskAiCfoHostNavButtonProps-XSnEPSCB.js";import"./TransactionDetailScreen-CWpk0UU1.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="66c8b417-401a-4da9-9f8b-06020ecf04c0",a._sentryDebugIdIdentifier="sentry-dbid-66c8b417-401a-4da9-9f8b-06020ecf04c0")}catch{}})();const ze=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],V=a=>Oe(a),we=X(function(a,e){const t=be(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,V(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=V(e.selectedAccount.tranListType),m=Je(t,n,c,l,e.bookCloseDate);G.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:m},type:V(e.selectedAccount.tranListType)})),a(De(l,u(m),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(u(m))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=N(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:V(e.selectedAccount.tranListType)}))}}})(ce),J=se(function({...a}){const e=K(),t=U(),n=Q(),c=t.pathname.split("/").find(r=>ze.includes(r)),o=c??"uncategorized-expense",{tenantEmailDomain:l}=H(),m=de.getLocalizedStrings(),{accountType:S,title:T,subTitle:D}=_e(o),y="month",I=h(r=>W(r)),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(q.isProjectsTransactionsEnabled),x=h(r=>Z(r))&&k,{dataAvailable:C,initialTimeframeTick:P}=$e(o,p,I.bookCloseDate),[B,E]=g.useState(!1),[F,R]=g.useState(void 0),f=g.useMemo(()=>{const r=u(P);return{tranListType:o,accountType:ee(S),title:T,subTitle:D,timeframe:y,period:r}},[o,y,S,C]);g.useEffect(()=>{if(!B&&f!=null){E(!0),G.trackTransactionList(void 0,void 0,void 0,f.title);const r=V(f.tranListType);n(De(r,f.period,!0,r==="missingReceipts"?m.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[B,f,n]);let M=f;return f!=null&&F!=null&&(M={...f,period:F}),c==null||M==null?s.jsx(z,{to:"../"}):s.jsx(we,{firstMonthOfFY:p,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:C,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>R(r),...a})}),_e=a=>{let e="",t="";const n=de.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.uncategorizedTransactionList.expense.title;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.uncategorizedTransactionList.missingReceipt.title}return{accountType:e,title:t,subTitle:""}},$e=(a,e,t)=>{const n=le();let c=le().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ie(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Je=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Ve=X(function(a,e){const t=Ee(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??he();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(ye(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=N(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}})(ce),qe=se(function({referrerType:a,...e}){const t=K(),n=U(),c=Q(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:S,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=H(),p=b(l??""),A=b(m??""),k=b(S??""),x=b(I??""),C=h(d=>Pe(d.transactionListState,A,p,k)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),R=h(d=>W(d)),f=R.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),w=h(d=>Z(d))&&r;let i;const O=Ne(p,A,k,T,D,y,x);if(O){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ue(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{P||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))},[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,S,T,D,y,I].filter(d=>d!=null);return O&&L!=null?s.jsx(Ve,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(z,{to:he($.length)})}),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ne=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Ue=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),We=X(function(a,e){const t=xe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Se();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(Ae(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=N(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}})(ce),Ke=se(function({referrerType:a,...e}){const t=K(),n=U(),c=Q(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:S,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=H(),p=b(l??""),A=b(m??""),k=b(S??""),x=b(I??""),C=h(d=>je(d.transactionListState,A,p,k)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),R=h(d=>W(d)),f=R.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),w=h(d=>Z(d))&&r;let i;const O=Qe(p,A,k,T,D,y,x);if(O){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=He(C?.dateRange,d);i={accountId:A,accountType:ee(p),projectId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{P||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))},[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,S,T,D,y,I].filter(d=>d!=null);return O&&L!=null?s.jsx(We,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(z,{to:Se($.length)})}),Se=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Qe=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,He=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Xe=X(function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Ce(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ie();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(ge(e.selectedAccount.accountId,e.selectedAccount.accountType,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=N(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=tt(e.tenantEmailDomain),n=N(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ce),Te=se(function({referrerType:a,...e}){const t=K(),n=U(),c=Q(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:S,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=H(),p=b(l??""),A=b(m??""),k=b(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=h(v=>Me(v.transactionListState,A,p)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),R=h(v=>W(v)),f=R.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=R.company?.companyInfo.firstMonthOfFY??1;let r;const w=Ze(p,A,S,T,D,k);if(w){const v={startDate:Y(T,"YYYY-MM-DD"),endDate:Y(D,"YYYY-MM-DD")},Ye=et(C?.dateRange,v);r={accountId:A,accountType:ee(p),title:k,timeframe:S,period:Ye}}let i=r;r!=null&&E!=null&&(i={...r,period:E});const{useFeatureGate:O}=ne(),{isFeatureEnabled:L}=O(q.isTransactionCommentingEnabled),{isFeatureEnabled:$}=O(q.isProjectsTransactionsEnabled),d=h(v=>Z(v))&&$,{areTenantIdsInSync:_}=Fe();g.useEffect(()=>{!P&&r!=null&&_&&(B(!0),G.trackTransactionList(r.accountId,void 0,a,r.title),c(ge(r.accountId,r.accountType,r.period,void 0,!1,x)))},[P,r,c,_]);const ke=[l,m,S,T,D,y].filter(v=>v!=null);return w&&i!=null?s.jsx(Xe,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:f,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:v=>F(v),...e}):s.jsx(z,{to:Ie(ke.length)})}),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ze=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&Y(n,"YYYY-MM-DD").isValid()&&Y(c,"YYYY-MM-DD").isValid()&&o!=null,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),tt=a=>`/${a}/transactions/${Be}/statements`;function kt(){const a=U().state?.referrer,e=h(n=>n.expenseAutomationViewState.selectedPeriodByTenantId)[h(n=>W(n)).tenantId],t=Re();return s.jsxs(ve,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(Ge,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(J,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(J,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(J,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(J,{})}),s.jsx(j,{path:"/missing-receipts/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(J,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(qe,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Ke,{referrerType:a})})]})}export{kt as default};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./liveblocks-DC3GaKoW.js";import{h as L,g as U,u as P,i as O,j as y,N as B,n as N,o as we,p as k}from"./core-Bv1T7LZC.js";import{cp as G,eW as D,Qn as R,Gm as ae,fW as Q,G4 as ne,Qp as Ie,Gp as ke,Ql as be,Qm as se,QC as je,Et as Ee,ub as Ae,Qr as ve,GI as De,Qo as re,cS as q,yq as oe,fB as Fe,fD as Be,RB as Le,RC as Ue,G5 as Pe,RD as Re,G6 as Me,Gf as Ve,bs as Oe,bJ as Ne,cA as Ge,bK as _e,co as ze,fV as $e,bt as We,LW as Qe,cn as qe}from"./zeni-epic-state-DuQa9FMz.js";import{I as _,ar as He,z as E,w as z,d as b,ch as Ze,ci as Ke,cj as W,Z as H,m as Je,T as Xe,X as Ye,W as ie,U as A,x as et,B as tt,ck as at,au as Z,n as nt,cl as st,p as K,cm as rt,D as X,cn as ot,a9 as it}from"./index-CwcEF-q7.js";import{D as ct,n as M,S as lt}from"./mui-VYhJrGDQ.js";import ut from"./NotFoundScreen-CKyavEYX.js";import{S as Y}from"./SetupPagesScreen-CrjLDbOm.js";import{a as p}from"./sentry-CuaXjR5n.js";import{u as dt}from"./useAskAiCfoHostNavButtonProps-XSnEPSCB.js";import{u as pt}from"./useInitialThreadRequest-BsceBU6n.js";import{u as mt}from"./useCashManagementBanner-Cqvytrqk.js";import{M as ce}from"./MobileAppDrawer-PDN1hPUR.js";import{F as ft}from"./FeaturePreviewScreen-D4Ah53J7.js";import{a as ee}from"./analyticsHelper-d524teZu.js";import"./recharts-D979ncoh.js";import"./analytics-Bqx0zRxd.js";import"./plaid-BlhDSPsk.js";import"./dnd-CrtLd1r-.js";import"./stripe-DMRn4zHo.js";import"./lottie-BAdftm7g.js";import"./lexical-DtmspfR6.js";import"./pdf-DyfSqkK5.js";import"./utils-DPYDOv00.js";import"./routePaths-CjJlLbxf.js";import"./BusinessVerificationPageScreen-DMq3tKTs.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]="62532d49-7397-4a80-9924-e1287bfab56e",t._sentryDebugIdIdentifier="sentry-dbid-62532d49-7397-4a80-9924-e1287bfab56e")}catch{}})();const yt=N(function(t,a){const{companyId:n}=a;return{treasurySetupView:R(t,n),analytics:b}},function(t,a){const{navigate:n,analytics:o,treasurySetupView:m}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const s=m.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(s.riskScore,ee(s)),t(ke(!0))},onUpdateFundAllocation:s=>{o.trackTreasuryAllocationAction("update",ee(s)),t(Ie(s))}}})(Ze);function gt(){const t=L(),a=U(),n=P(),{tenantEmailDomain:o}=O(),m=_(),s=y(I=>I.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),f=He(s),r=G(m?.loggedInUserRoleMap),[l,i]=p.useState(!1),[u,T]=p.useState(!1),[d,c]=p.useState(!1),h=y(I=>D(I)),g=E.getSignedInUserTenant(o)?.companyId??h.companyId,C=E.getSignedInUser(),S=y(I=>R(I,g)),w=y(I=>I.treasurySetupViewState.fetchState),x=y(I=>I.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=y(I=>I.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(C==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect(()=>{l||w!=="Not-Started"||g==null||(i(!0),n(ae(g,!0,!1)))},[l,w,g,n]),p.useEffect(()=>{d||F!=="Not-Started"||g==null||(c(!0),n(Q()))},[d,F,g,n]),p.useEffect(()=>{u||x!=="Not-Started"||g==null||(T(!0),n(ne()))},[u,x,g,n]),p.useEffect(()=>{f==="In-Progress"&&s==="Completed"&&t("../")},[f,s,t]),h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(B,{to:"../promo"});const v=h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||w!=="Completed";return e.jsxs(e.Fragment,{children:[!v&&e.jsx(z,{analytics:b,onLoad:()=>{}}),e.jsx(yt,{navigate:t,location:a,companyId:g,isEditMode:!0,isLoading:v,isReadOnly:!r,treasurySetupView:S,analytics:b})]})}const ht=N(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:je(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:R(t,n)}},function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:m}=a,s=o.treasuryTransferMoneyLocalData,f=m.fundAllocationLocalData;return{onCancelClick:()=>{W(a.analytics,"cancel",s,f,"Transfer"),t(se()),n("../")},onTransferClick:()=>{W(a.analytics,"confirm",s,f,"Transfer"),t(De())},onSaveChangesToLocalStore:r=>{t(ve(r))},onFetchLinkTokenClick:r=>{t(Ae("treasury_setup",r))},onEstablishConnectionClick:r=>{t(Ee(r,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(Ke),St=({isFirstTransfer:t})=>{const a=L(),{tenantEmailDomain:n}=O(),o=P(),[m,s]=p.useState(!1),[f,r]=p.useState(!1),[l,i]=p.useState(!1),[u,T]=p.useState(!1),d=y(x=>x.treasurySetupViewState.fetchState),c=y(x=>x.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),h=y(x=>x.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),g=y(x=>D(x)),C=E.getSignedInUserTenant(n)?.companyId??g.companyId,S=y(x=>be(x)),w=y(x=>R(x,C));if(E.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect(()=>{f||d!=="Not-Started"||C==null||(r(!0),o(ae(C,!0,!1)))},[f,d,C,o]),p.useEffect(()=>{l||c!=="Not-Started"||C==null||(i(!0),o(Q()))},[l,c,C,o]),p.useEffect(()=>{u||h!=="Not-Started"||C==null||(T(!0),o(ne()))},[u,h,C,o]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:b,onLoad:()=>{}}),e.jsx(ht,{analytics:b,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{s(!1),o(se())},currentTenant:g,treasurySetupView:w,showReviewContent:m,maxInsuredAmount:5e5,onReviewClick:()=>{W(b,"review",S.treasuryTransferMoneyLocalData,w.fundAllocationLocalData,"Transfer"),s(!0)},isFirstTransfer:t,setShowReviewContent:s,onBackClick:()=>{}})]})},xt=M.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
min-height: 100%;
|
|
4
|
-
width: 100%;
|
|
5
|
-
flex: 1 1 auto;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: center;
|
|
8
|
-
background-color: ${t=>t.theme.colors.grey4};
|
|
9
|
-
`,Ct={overlayWidth:new et(100,100,48)},Tt=N(function(t,a){const n=re(t),{companyId:o}=a;return{treasuryDetail:n,treasurySetupView:R(t,o),downloadEndPoint:`${Z.bankingMicroServiceBaseUrl}/1.0/treasury-account/statements?query={"statement_type":"tax_statement"}`}},function(t,a){const{navigate:n,currentTenant:o,location:m,handleDrawerToggle:s,analytics:f,isCashManagementFeatureEnabled:r}=a,{tenantEmailDomain:l}=o;return{onSettingsClick:()=>{f.trackAccountsListPageClicked("Settings Icon"),n("setup")},onReloadTransactions:()=>{t(oe(!0))},handleTreasuryOptionSelection:i=>{let u="page-not-found";i==="editPortfolio"?u=wt(l):i==="statements"?u=It(l):i==="taxLetter"?u=kt(l):i==="settings"&&(u=bt(l));const T=nt(m.state?.pathnameStackToGoBack,m.pathname);n(u,{state:{pathnameStackToGoBack:T}})},onColumnSortConfigChanged:(i,u)=>{t(Le({uiState:{sortKey:i,sortOrder:u}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{s(!0)},onAutoTransferClick:()=>{n(r?"../../checking/cash_management/auto-transfer":"../../checking/auto-transfer")},onCashManagementClick:()=>{n(`/${l}/checking/cash_management`)}}})(at);function $({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=U(),o=L(),m=P(),s=H(),f=Je(),r=y(j=>D(j)),{tenantEmailDomain:l}=O(),i=r.companyId??E.getSignedInUserTenant(l)?.companyId,[u,T]=p.useState(!1),d=y(j=>re(j)),c=d.fetchState,h=d.accountSummary?.totalBalance?.amount,g=y(j=>j.treasurySetupViewState.treasuryFundsDetails?.fetchStatus),C=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",S=_(),w=!!r.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=G(S?.loggedInUserRoleMap),F=q(S?.loggedInUserRoleMap),{areTenantIdsInSync:v}=Xe();p.useEffect(()=>{c==="Not-Started"&&!u&&v&&(T(!0),m(oe(!0)))},[u,m,c,v]),p.useEffect(()=>{d.transactionsFetchState.fetchState==="Completed"&&d.transactions.length===0&&!n.pathname.includes("transfer")&&x&&o("./transfer")},[d.transactionsFetchState.fetchState,d.transactions.length]);const I=()=>{o("..")},[le,ue]=p.useState(!1),J=j=>{ue(j)},{isAiCfoAccessEnabled:de,onAskAiCfoClick:pe}=dt({mobileExploreReferrer:"Treasury"});Ye({isDataReady:c==="Completed"});const me=mt(),{useFeatureGate:V}=ie(),{isFeatureEnabled:fe}=V(A.isDebitCardFeatureEnabled),{isFeatureEnabled:ye}=V(A.isAutoTransferRuleEnabled),{isFeatureEnabled:ge}=V(A.isTreasuryCommentingEnabled),{isFeatureEnabled:he}=V(A.isCashManagementFeatureEnabled),Se=pt(i,{clearParams:c==="Completed"&&g?.fetchState==="Completed"}),xe=Fe(r),Ce=Be(fe,r);if(xe===!0&&Ce!==!0)return e.jsx(ft,{});if(C){const j=g?.fetchState!=="Completed"||d.accountSummaryFetchState.fetchState!=="Completed";return e.jsxs(e.Fragment,{children:[d.accountSummaryFetchState.fetchState==="Completed"&&g?.fetchState==="Completed"&&t===!1&&a===!1?e.jsx(z,{analytics:b,onLoad:()=>{}}):null,e.jsx(ct,{onClose:I,anchor:"right",open:a||t,transitionDuration:250,PaperProps:{style:{width:Ct.overlayWidth.valuePercentage(s),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:f.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsxs(jt,{onClick:Te=>Te.stopPropagation(),children:[t===!0?e.jsx(St,{isFirstTransfer:d.transactions.length===0||h===0}):null,a===!0?e.jsx(gt,{}):null]})}),e.jsxs(xt,{windowSize:s,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:J}),e.jsx(Tt,{treasuryDetailsView:d,isAutoTransferRuleEnabled:ye,navigate:o,currentTenant:r,location:n,companyId:i,analytics:b,cashManagementBannerProps:me,isCashManagementFeatureEnabled:he,isTreasuryCommentingEnabled:ge,handleDrawerToggle:J,initialOpenThreadRequest:Se,isLoading:j,isAiCfoAccessEnabled:de,onAskAiCfoClick:pe})]})]})}return w&&x?e.jsx(B,{to:"../setup"}):r.companyTreasuryInfo?.info&&!w&&F?e.jsx(B,{to:"../promo",state:n.state}):e.jsx(tt,{fetchState:"In-Progress",style:{backgroundColor:f.colors.grey5}})}const wt=t=>`/${t}/treasury/edit-portfolio`,It=t=>`/${t}/treasury/statements`,kt=t=>`/${t}/treasury/tax-letter`,bt=t=>`/${t}/treasury/setup`,jt=M(lt)`
|
|
10
|
-
display: flex;
|
|
11
|
-
min-height: 100%;
|
|
12
|
-
flex-direction: column;
|
|
13
|
-
`,Et=M.div`
|
|
14
|
-
display: flex;
|
|
15
|
-
height: 100vh;
|
|
16
|
-
width: 100%;
|
|
17
|
-
flex: 1 1 auto;
|
|
18
|
-
flex-direction: column;
|
|
19
|
-
align-items: center;
|
|
20
|
-
background-color: ${t=>t.theme.colors.grey4};
|
|
21
|
-
`;function At(){const t=L(),a=P(),n=H(),o=U(),m=`${Z.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[s,f]=p.useState(!1),r=y(c=>Ue(c));p.useEffect(()=>{s||r.fetchState!=="Not-Started"||(f(!0),a(Pe(!1)))},[s,r.fetchState,a]);const l=E.getSignedInUser(),i=y(c=>D(c)),u={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i.tenantId??""},T=i.company?.companyInfo.companyLegalName??i.companyName;if(l==null)throw Error("Can't access statements page without signing in...");const d=r.fetchState!=="Completed";return e.jsx(Et,{windowSize:n,children:e.jsx(st,{currentTenantCompanyName:T,statementListView:r,isLoading:d,onBackClick:()=>{const c=K(o.state?.pathnameStackToGoBack),h=c.poppedPathname??"..";t(h,{state:{pathnameStackToGoBack:c.newStack}})},authParams:u,downloadEndPoint:m})})}const vt=M.div`
|
|
22
|
-
display: flex;
|
|
23
|
-
height: 100vh;
|
|
24
|
-
width: 100%;
|
|
25
|
-
flex: 1 1 auto;
|
|
26
|
-
flex-direction: column;
|
|
27
|
-
align-items: center;
|
|
28
|
-
background-color: ${t=>t.theme.colors.grey4};
|
|
29
|
-
`;function Dt(){const t=L(),a=H(),n=U(),o=P(),m=`${Z.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[s,f]=p.useState(!1),r=y(c=>Re(c));p.useEffect(()=>{s||r.fetchState!=="Not-Started"||(f(!0),o(Me(!1)))},[s,r.fetchState,o]);const l=E.getSignedInUser(),i=y(c=>D(c)),u={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i.tenantId??""},T=i.company?.companyInfo.companyLegalName??i.companyName;if(l==null)throw Error("Can't access tax letter page without signing in...");const d=r.fetchState!=="Completed";return e.jsx(vt,{windowSize:a,children:e.jsx(rt,{currentTenantCompanyName:T,taxLetterListView:r,isLoading:d,onBackClick:()=>{const c=K(n.state?.pathnameStackToGoBack),h=c.poppedPathname??"..";t(h,{state:{pathnameStackToGoBack:c.newStack}})},authParams:u,downloadEndPoint:m})})}const Ft=N(function(t,a){const{companyId:n}=a,o=R(t,n);return{treasurySetupView:o,isSetupComplete:o.companyTreasuryInfo?.businessVerificationStatus?.code==="verified",videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk",meetingUrl:"https://meetings.hubspot.com/yoshi-araki/treasury-product-schedule-demo-link?embed=true"}},function(t,a){const{navigate:n,companyId:o}=a;return{onSetupButtonClick:()=>{t(Ve(o))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:m=>{n(m?"..":"../setup",{relative:"path"})}}})(ot),Bt=()=>{const t=L(),a=U(),n=P(),{tenantEmailDomain:o}=O(),[m,s]=p.useState(!1),f=y(S=>D(S)),[r,l]=p.useState(!1),i=y(S=>S.treasurySetupViewState.treasuryFundsDetails?.fetchStatus);p.useEffect(()=>{r||i?.fetchState!=="Not-Started"||u==null||(l(!0),n(Q()))},[i,n]);const u=E.getSignedInUserTenant(o)?.companyId??f.companyId,T=E.getSignedInUser(),d=!!f.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,c=S=>{s(S)};if(T==null)throw Error("Can't access treasury promo page without signing in...");const h=_(),g=G(h?.loggedInUserRoleMap),C=q(h?.loggedInUserRoleMap);if(d&&g)return e.jsx(B,{to:"../../treasury/setup"});if(f.company?.companyTreasuryInfo&&(!d&&g||C)){if(a.state?.message==="activation"){const S=K(a.state?.pathnameStackToGoBack);t(a.pathname,{state:{...a.state,message:void 0,pathnameStackToGoBack:S.newStack}})}return i?.fetchState!=="Completed"?e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})}):e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:b,onLoad:S=>(w=>w.trackTreasuryPromoView("Treasury Promo Page"))(S)}),e.jsx(ce,{isAppContentDrawerOpen:m,handleDrawerToggle:c}),e.jsx(Ft,{analytics:b,navigate:t,companyId:u,onClickMenuIcon:()=>{c(!0)}})]})}return e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})})},te=M.div`
|
|
30
|
-
display: flex;
|
|
31
|
-
width: 100%;
|
|
32
|
-
height: 100%;
|
|
33
|
-
flex-direction: row;
|
|
34
|
-
justify-content: center;
|
|
35
|
-
align-items: center;
|
|
36
|
-
background-color: ${t=>t.theme.colors.grey5};
|
|
37
|
-
`;function sa(){const t=U(),a=y(v=>D(v)),{useFeatureGate:n}=ie(),{isFeatureEnabled:o}=n(A.isTreasuryEnabled),m=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,s=_(),f=q(s?.loggedInUserRoleMap),r=a?.userRole!=null&&Oe(a?.userRole),l=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!r)&&Ne(s?.loggedInUserRoleMap),i=Ge(s?.loggedInUserRoleMap),u=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!r)&&_e(s?.loggedInUserRoleMap),{isFeatureEnabled:T}=n(A.isDepositAccountsFeatureEnabled),d=T&&!r&&ze(s?.loggedInUserRoleMap),c=a.company!=null&&$e(a.company),h=o&&c===!0&&!r&&G(s?.loggedInUserRoleMap),{isFeatureEnabled:g}=n(A.isChargeCardFeatureEnabled),{isFeatureEnabled:C}=n(A.isDebitCardFeatureEnabled),S=it(a,g,C)&&!r&&We(s?.loggedInUserRoleMap),w=Qe(s?.loggedInUserRoleMap),x=qe(s?.loggedInUserRoleMap),F=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified";return e.jsxs(we,{children:[x?null:e.jsx(k,{path:"setup",element:e.jsx(Y,{isBillPayAdminLevelAccess:l,isReimbursementAdminLevelAccess:u,isZeniAccountAdminLevelAccess:d,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:h,isUserHasOnlyCardAccess:w,isUserHasOnlyBillPayAccess:i,productType:"zeni_treasury",type:"setup"})}),x?null:e.jsx(k,{path:"verification",element:e.jsx(Y,{isBillPayAdminLevelAccess:l,isUserHasOnlyBillPayAccess:i,isReimbursementAdminLevelAccess:u,isZeniAccountAdminLevelAccess:d,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:h,isUserHasOnlyCardAccess:w,productType:"zeni_treasury",type:"verification"})}),e.jsx(k,{path:"promo",element:e.jsx(Bt,{})}),e.jsx(k,{path:"statements",element:e.jsx(At,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(Dt,{})}),F?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"/",element:e.jsx($,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),h?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"edit-portfolio",element:e.jsx($,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(k,{path:"transfer",element:e.jsx($,{isTransferDrawerOpen:!0,isEditPortfolioDrawerOpen:!1})})]}):null,e.jsx(k,{path:"*",element:e.jsx(ut,{})})]}):m&&h?e.jsx(k,{path:"*",element:e.jsx(B,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&f?e.jsx(k,{path:"*",element:e.jsx(B,{to:"../promo",state:t.state})}):e.jsx(k,{path:"*",element:null})]})}export{sa as default};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./liveblocks-DC3GaKoW.js";import{a as f}from"./sentry-CuaXjR5n.js";import{t as u,u as h,j as y,N as I}from"./core-Bv1T7LZC.js";import{Md as b,fz as w,Bg as j}from"./zeni-epic-state-DuQa9FMz.js";import{z as l,B as x,A as S,R as D}from"./index-CwcEF-q7.js";import{n as c}from"./mui-VYhJrGDQ.js";import"./recharts-D979ncoh.js";import"./analytics-Bqx0zRxd.js";import"./plaid-BlhDSPsk.js";import"./dnd-CrtLd1r-.js";import"./stripe-DMRn4zHo.js";import"./lottie-BAdftm7g.js";import"./lexical-DtmspfR6.js";import"./pdf-DyfSqkK5.js";import"./utils-DPYDOv00.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]="cfd5dc36-d759-4c4a-86f7-6b865a3f1ea7",e._sentryDebugIdIdentifier="sentry-dbid-cfd5dc36-d759-4c4a-86f7-6b865a3f1ea7")}catch{}})();const q=()=>{const[e]=u(),t=e.get("code")??"",s=e.get("state")??"",g=e.get("profileId")??"",[n,p]=f.useState(!1),a=h(),i=y(m=>b(m)),r=l.getSignedInUser(),d=l.getSignedInUserTenantWithId(s);if(r==null||d==null)return o.jsx(I,{to:"/signin/auth",replace:!0});if(r==null)throw Error("Can't access this page without signing in...");return w(r.userId,r.zeniSessionId,d?.tenantId),f.useEffect(()=>{n||(p(!0),a(j(t,g,s)))},[n,a]),i.fetchState==="Error"?o.jsx(E,{children:o.jsx(_,{children:i.error?.message??""})}):(i.fetchState==="Completed"&&window.close(),o.jsx(x,{fetchState:"In-Progress"}))},E=c.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
width: 100%;
|
|
4
|
-
height: 100vh;
|
|
5
|
-
flex-direction: row;
|
|
6
|
-
justify-content: center;
|
|
7
|
-
align-items: center;
|
|
8
|
-
background-color: ${e=>e.theme.colors.grey5};
|
|
9
|
-
`,_=c(D.LargeRegular)`
|
|
10
|
-
display: flex;
|
|
11
|
-
color: ${S.important};
|
|
12
|
-
`;export{q as default};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./liveblocks-DC3GaKoW.js";import{u as _,h as W,i as G,j as D,N as Y,n as q,g as X,o as Ve,p as f}from"./core-Bv1T7LZC.js";import{Rc as He,Rd as Un,Bl as Mn,Re as zn,Rf as $n,bH as Vn,Rg as Ne,Do as Ze,Rh as We,eW as M,yo as Ge,fV as we,co as se,cp as qe,yi as Hn,Ri as Nn,Rj as Zn,yl as Wn,ys as ye,yf as Gn,yc as qn,Rk as Qe,Br as Qn,Q0 as ue,Rl as Yn,H2 as Kn,N6 as Xn,H4 as Jn,le as Be,Rm as ea,rC as Ye,rq as Ke,l5 as Xe,l8 as Fe,N7 as Oe,N8 as na,Rn as aa,l7 as ta,lu as sa,kY as oa,jv as ra,ju as ia,Ro as ca,Rp as xe,GL as la,Rq as da,Rr as ua,PV as Ae,Rs as Le,Rt as pa,Hf as ma,QC as fa,Et as Je,ub as en,Ru as ha,Hc as ga,Rv as nn,cQ as De,Bs as an,fW as ya,fB as tn,fD as ke,Hh as xa,En as Ca,H9 as wa,Rw as sn,Rx as on,GN as rn,GX as _e,Ry as Aa,Qs as Da,Hj as ka,bs as Sa,bJ as Ia,cA as ba,bK as ja,bt as va,LW as Ea}from"./zeni-epic-state-DuQa9FMz.js";import{Z as z,c4 as Pa,I as oe,W as Z,U as P,z as I,a2 as Se,c5 as Ta,m as $,B as pe,c6 as Ra,x as J,p as cn,ar as Ba,af as Ue,d as L,c7 as Fa,au as Ie,c8 as Oa,w as me,c9 as La,f as be,aQ as K,ca as _a,T as Ua,X as ln,ac as Ma,cb as Me,cc as za,n as de,cd as $a,ce as Va,cf as Ha,a9 as Na,o as Za}from"./index-CwcEF-q7.js";import{n as B,D as ee,S as ne}from"./mui-VYhJrGDQ.js";import{a as p}from"./sentry-CuaXjR5n.js";import{u as dn}from"./useCashManagementBanner-Cqvytrqk.js";import N from"./NotFoundScreen-CKyavEYX.js";import{S as ze}from"./SetupPagesScreen-CrjLDbOm.js";import{F as un}from"./FeaturePreviewScreen-D4Ah53J7.js";import{M as fe}from"./MobileAppDrawer-PDN1hPUR.js";import{A as Wa,D as Ga,V as qa}from"./DomesticWireDetailScreen-WRSPX-4X.js";import{A as Qa}from"./AddressScreen-GAHyIX-c.js";import{u as pn}from"./useAskAiCfoHostNavButtonProps-XSnEPSCB.js";import{Z as Ya}from"./ZeniAccountStatementScreen-DEwEWZ2Q.js";import"./recharts-D979ncoh.js";import"./analytics-Bqx0zRxd.js";import"./plaid-BlhDSPsk.js";import"./dnd-CrtLd1r-.js";import"./stripe-DMRn4zHo.js";import"./lottie-BAdftm7g.js";import"./lexical-DtmspfR6.js";import"./pdf-DyfSqkK5.js";import"./utils-DPYDOv00.js";import"./analyticsHelper-d524teZu.js";import"./routePaths-CjJlLbxf.js";import"./BusinessVerificationPageScreen-DMq3tKTs.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new n.Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="4f7cc4a1-9029-4b8c-96bf-066d3f9d4d1a",n._sentryDebugIdIdentifier="sentry-dbid-4f7cc4a1-9029-4b8c-96bf-066d3f9d4d1a")}catch{}})();const Ka=B.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
min-height: 100%;
|
|
4
|
-
width: 100%;
|
|
5
|
-
flex: 1 1 auto;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: center;
|
|
8
|
-
background-color: ${n=>n.theme.colors.grey4};
|
|
9
|
-
`,Xa=q(function(n){const a=He(n);return{sweepAmount:a.sweepAmount,primaryAccount:a.primaryFundingAccount,treasurySummary:a.treasurySummary,initialRisk:a.formData.risk,initialFrequency:a.formData.frequency,initialMemo:a.formData.memo,isSaving:a.saveStatus.fetchState==="In-Progress"}},function(n,a){const{navigate:o}=a,t=s=>({amount:Vn[s],currencyCode:"USD",currencySymbol:"$"});return{onExit:()=>o(-1),onRiskChange:s=>{n($n({bufferAmount:t(s)}))},onSaveDraft:({risk:s,frequency:r,memo:c})=>{n(zn({bufferAmount:t(s),frequency:r,memo:c}))},onConfirm:()=>{n(Mn())}}})(Pa);function Ja(){const n=_(),a=W(),o=z(),{tenantEmailDomain:t}=G(),s=D(c=>He(c)),r=s.saveStatus.fetchState;return p.useEffect(()=>{r==="Completed"&&(n(Un()),a(`/${t}/checking/cash_management`))},[n,a,r,t]),s.primaryFundingAccount==null?e.jsx(Y,{to:`/${t}/checking/cash_management`,replace:!0}):e.jsx(Ka,{windowSize:o,children:e.jsx(Xa,{navigate:a})})}function mn({isEditDrawerOpen:n=!1}={}){const a=_(),o=W(),t=X(),{ruleId:s,tenantEmailDomain:r}=G(),c=oe(),{useFeatureGate:d}=Z(),u=D(x=>Ne(x)),h=D(x=>Ze(x.depositAccountState,x.depositAccountListState)),w=D(x=>We(x)),i=D(x=>M(x)),{isFeatureEnabled:l}=d(P.isTreasuryEnabled),m=u?.fetchState??"Not-Started",y=i?.companyId??(r==null?void 0:I.getSignedInUserTenant(r)?.companyId);p.useEffect(()=>{m==="Not-Started"&&y!=null&&a(Ge(!0))},[a,m,y]);const A=u?.fetchState!=="Completed";if(A)return{autoTransferRulePageProps:void 0,isLoading:A};const b=i?.company!=null&&we(i.company),C=!!(l&&b),k=se(c?.loggedInUserRoleMap)||qe(c?.loggedInUserRoleMap),g=I.getSignedInUser(),j={userId:g?.userId??"",sessionId:g?.zeniSessionId??"",tenantId:i?.tenantId??""},T=!!t.state?.scrollToAddRule;return{isLoading:A,autoTransferRulePageProps:{autoTransferRuleView:u,companyName:i?.companyName??"",hasAdminLevelAccess:k,includeTreasuryOption:C,transferLimit:5e5,authParams:j,currentTenant:i,depositAccountListView:h,downloadAccountDetailEndPoint:`${Se}/account_details`,editingRuleId:s,isEditDrawerOpen:n,scrollToAddRule:T,zeniAccountsConfigDetail:w,onBackClick:()=>o(".."),onCreateRule:()=>{a(qn())},onUpdateRule:x=>{a(ye(x))},onDeleteClick:x=>{a(Gn(x))},onPauseClick:x=>{a(ye(x,!0,!1))},onResumeClick:x=>{a(ye(x,!1,!0))},onActivityClick:(x,R)=>{a(Wn(x,R))},onUpdateRuleLocalData:x=>{a(Zn(x))},clearRuleLocalData:()=>{a(Nn())},onEditClick:x=>{o(`./${x}/edit`)},onEditDrawerClose:()=>{o("../../",{relative:"path"})},onReviewClick:()=>{a(Hn())}}}}const et=B.div`
|
|
10
|
-
display: flex;
|
|
11
|
-
min-height: 100%;
|
|
12
|
-
width: 100%;
|
|
13
|
-
flex: 1 1 auto;
|
|
14
|
-
flex-direction: column;
|
|
15
|
-
align-items: center;
|
|
16
|
-
background-color: ${n=>n.theme.colors.grey4};
|
|
17
|
-
`,nt=q(function(n){const a=Qe(n);return{bufferAmount:{amount:1e4,currencyCode:"USD",currencySymbol:"$"},cashBalance:a.cashBalance,cashFlowTotal:a.cashflow,inflows:a.totalInFlow,isOutflowsLoading:a.banner.fetchState!=="Completed",outflowItems:a.outflowEvents,outflows:a.totalOutFlow,projectionData:a.projectionData,totalCash:a.totalCash,treasuryBalance:a.treasuryBalance}},function(n,a){const{navigate:o}=a;return{onBackClick:()=>{o(-1)}}})(Ta);function ie({isAutoTransferRulesTabActive:n=!1,isEditDrawerOpen:a=!1}){const o=_(),t=W(),s=z(),r=D(w=>Qe(w)).banner.fetchState;p.useEffect(()=>{r==="Not-Started"&&o(Qn(!1))},[o,r]);const{autoTransferRulePageProps:c,isLoading:d}=mn({isEditDrawerOpen:a}),u=dn(),h=n?"autoTransferRules":"overview";return e.jsx(et,{windowSize:s,children:e.jsx(nt,{initialTab:h,autoTransferRulePageProps:c,cashManagementBannerProps:u,isAutoTransferRulesLoading:d,navigate:t})})}const at=B.div`
|
|
18
|
-
display: flex;
|
|
19
|
-
min-height: 100%;
|
|
20
|
-
width: 100%;
|
|
21
|
-
flex: 1 1 auto;
|
|
22
|
-
flex-direction: column;
|
|
23
|
-
align-items: center;
|
|
24
|
-
background-color: ${n=>n.theme.colors.grey4};
|
|
25
|
-
`;function $e({isEditDrawerOpen:n}){const a=$(),[o,t]=p.useState(!1),{autoTransferRulePageProps:s,isLoading:r}=mn({isEditDrawerOpen:n});return r||s==null?e.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:a.colors.grey5}}):e.jsxs(at,{children:[e.jsx(fe,{isAppContentDrawerOpen:o,handleDrawerToggle:c=>{t(c)}}),e.jsx(Ra,{...s})]})}const tt={overlayWidth:new J(100,100,58)},st=({vendorId:n,isDrawerOpen:a,closeDrawerHandler:o})=>{const t=_(),s=$(),r=z();if(I.getSignedInUser()==null)throw Error("Can't access ach account page without signing in...");return e.jsx(ee,{onClose:()=>{o(!0),t(ue())},anchor:"right",open:a,PaperProps:{style:{width:tt.overlayWidth.valuePercentage(r),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsx(ot,{onClick:c=>c.stopPropagation(),children:e.jsx(Wa,{vendorIdParam:n,accountContext:"express-pay"})})})},ot=B(ne)`
|
|
26
|
-
display: flex;
|
|
27
|
-
min-height: 100%;
|
|
28
|
-
flex-direction: column;
|
|
29
|
-
`,rt={overlayWidth:new J(100,100,58)},it=({isDrawerOpen:n,closeDrawerHandler:a})=>{const o=_(),t=$(),s=z();if(I.getSignedInUser()==null)throw Error("Can't access address page without signing in...");return e.jsx(ee,{onClose:()=>{a(!0),o(ue())},anchor:"right",open:n,PaperProps:{style:{width:rt.overlayWidth.valuePercentage(s),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:t.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsx(ct,{onClick:r=>r.stopPropagation(),children:e.jsx(Qa,{accountContext:"express-pay",addressTypeParam:"vendor_address"})})})},ct=B(ne)`
|
|
30
|
-
display: flex;
|
|
31
|
-
min-height: 100%;
|
|
32
|
-
flex-direction: column;
|
|
33
|
-
`,lt={overlayWidth:new J(100,100,58)},dt=({vendorId:n,isDrawerOpen:a,closeDrawerHandler:o})=>{const t=_(),s=$(),r=z();if(I.getSignedInUser()==null)throw Error("Can't access ach account page without signing in...");return e.jsx(ee,{onClose:()=>{o(!0),t(ue())},anchor:"right",open:a,PaperProps:{style:{width:lt.overlayWidth.valuePercentage(r),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsx(ut,{onClick:c=>c.stopPropagation(),children:e.jsx(Ga,{vendorIdParam:n,accountContext:"express-pay"})})})},ut=B(ne)`
|
|
34
|
-
display: flex;
|
|
35
|
-
min-height: 100%;
|
|
36
|
-
flex-direction: column;
|
|
37
|
-
`,pt=B.div`
|
|
38
|
-
display: flex;
|
|
39
|
-
height: 100vh;
|
|
40
|
-
width: 100%;
|
|
41
|
-
flex: 1 1 auto;
|
|
42
|
-
flex-direction: column;
|
|
43
|
-
align-items: center;
|
|
44
|
-
background-color: ${n=>n.theme.colors.grey4};
|
|
45
|
-
`,mt=q(function(n,a){const o=M(n),t=I.getSignedInUser(),s=o.tenantId,r={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:s??""},c=a.expressPayDetails,d=n.entityAutoCompleteState.autoCompleteText.common,u=Xn(n,"common");return{expressPayDetails:c,fileProps:{authParams:r,filesEndPoint:`${Ie.fileMicroServiceBaseUrl}`},vendorSearchAutoCompleteData:{autoCompleteText:d,entityAutoCompleteView:u},analytics:a.analytics}},function(n,a){const{navigate:o}=a;return{onSaveVendor:t=>{n(ia(t,void 0,void 0,!0))},saveVendorDetailLocalData:(t,s)=>{n(Fe({vendorId:s,localData:t}))},saveExpressPayLocalData:t=>{n(ra({localData:t}))},onVendorSelected:t=>{t!=null&&n(oa(t,!1))},updateSelectedVendorForCreate:t=>{n(sa(t))},initializeVendorAddress:()=>{n(ta())},resetVendorSaveStatus:t=>{n(aa({vendorId:t}))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(t,s)=>{t.trim().length>=2?n(na({searchString:t,entityType:s,searchOrigin:"common"})):t.trim().length===0&&n(Oe("common"))},onCancelAutoComplete:()=>{n(Oe("common"))}},chooseNewVendor:t=>{n(Fe({localData:{vendorName:t}}))},onClickAddAccount:t=>{t.method.toLowerCase().indexOf("ach")!==-1?o("./add-ach",{relative:"path"}):t.method.toLowerCase().indexOf("wire")!==-1&&t.method.toLowerCase().indexOf("domestic")!==-1&&o("./add-wire",{relative:"path"})},updateFilesEntity:t=>{n(Xe({files:t}))},onDeleteFile:t=>{n(Ke(t))},onEditFileName:(t,s)=>{n(Ye(t,s.split(".")[0]))},onBackClick:t=>{t!=null&&n(Be(t)),n(Be()),n(ea()),n(ue()),o("../",{relative:"path"})},onSchedulePayment:()=>{n(Jn())}}})(Fa);function ce({isAddACHDrawerOpen:n,isAddWireDrawerOpen:a,isAddAddressDrawerOpen:o}){const t=W(),s=X(),r=_(),[c,d]=p.useState(!1),{tenantEmailDomain:u}=G(),h=oe(),w=D(v=>v.expressPayState.fetchState),i=D(v=>M(v)),l=D(v=>Yn(v)),m=l.expressPayLocalData?.vendorId,y=i.companyId??I.getSignedInUserTenant(u)?.companyId,[A,b]=p.useState(!1),[C,k]=p.useState(!1),[g,j]=p.useState(!1),T=cn(s.state?.pathnameStackToGoBack),{poppedPathname:x}=T,R=x?.split("/"),V=R?.[R.length-1];p.useEffect(()=>{n===!0?b(!0):(b(!1),document.body.style.overflow="auto")},[n]),p.useEffect(()=>{a===!0?k(!0):(k(!1),document.body.style.overflow="auto")},[a]),p.useEffect(()=>{o===!0?j(!0):(j(!1),document.body.style.overflow="auto")},[o]),p.useEffect(()=>{w==="Not-Started"&&r(Kn(!0,!0))},[w,r]);const F=Ba(l.vendorViewDetails.bankAccountCreationState?.fetchState);if(p.useEffect(()=>{F==="In-Progress"&&l.vendorViewDetails.bankAccountCreationState?.fetchState==="Completed"&&E()},[F,l.vendorViewDetails.bankAccountCreationState?.fetchState]),I.getSignedInUser()==null)throw Error("Can't access express pay page without signing in...");const U=v=>{d(v)},E=()=>{b(!1),k(!1),t("../",{relative:"path"})};return e.jsxs(pt,{children:[Ue(s)?e.jsx(fe,{isAppContentDrawerOpen:c,handleDrawerToggle:U}):null,A===!0?e.jsx(st,{vendorId:m,closeDrawerHandler:E,isDrawerOpen:A}):null,C===!0?e.jsx(dt,{vendorId:m,closeDrawerHandler:E,isDrawerOpen:C}):null,g===!0?e.jsx(it,{closeDrawerHandler:E,isDrawerOpen:g}):null,e.jsx(qa,{vendorId:m,isExpressPayPage:!0}),e.jsx(mt,{navigate:t,location:s,companyId:y,accountId:V,analytics:L,currentTenant:i,vendorId:m,roleMap:h?.loggedInUserRoleMap,isSettings:Ue(s),expressPayDetails:l,onClickMenuIcon:()=>{U(!0)}})]})}const ft={overlayWidth:new J(100,100,58)},ht=({authParams:n,downloadAccountDetailEndPoint:a,isAccountInfoDrawerOpen:o,zeniBankAccountDetail:t,closeDrawerHandler:s})=>{const r=$(),c=z(),d=D(i=>We(i)),u=D(i=>M(i));if(I.getSignedInUser()==null)throw Error("Can't access Account detail page without signing in...");const h=()=>{s(!0)},w={depositAccount:t,onDismissClick:h,zeniAccountsConfigDetail:d,authParams:n,downloadAccountDetailEndPoint:a,currentTenant:u};return e.jsx(ee,{anchor:"right",open:o,PaperProps:{style:{width:ft.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:r.colors.black,opacity:.75,cursor:"pointer"}}},onClose:()=>h(),children:e.jsx(gt,{onClick:i=>i.stopPropagation(),children:e.jsx(Oa,{...w})})})},gt=B(ne)`
|
|
46
|
-
display: flex;
|
|
47
|
-
min-height: 100%;
|
|
48
|
-
flex-direction: column;
|
|
49
|
-
`,yt={overlayWidth:new J(100,100,58)},fn=({isCheckDepositDrawerOpen:n,closeDrawerHandler:a})=>{const o=$(),t=z(),s=_(),r=D(i=>M(i)),c=I.getSignedInUser(),d=r.tenantId,u={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:d??""};if(c==null)throw Error("Can't access check deposit page without signing in...");const h=D(i=>ca(i)),w={analytics:L,checkDeposit:h,filesEndPoint:`${Ie.fileMicroServiceBaseUrl}`,authParams:u,onSaveChangesToLocalStore:i=>{s(da(i))},updateFilesEntity:i=>{s(Xe({files:i}))},onAnotherTransferClick:()=>{s(xe())},onDeleteFile:i=>{s(Ke(i))},onEditFileName:(i,l)=>{s(Ye(i,l.split(".")[0]))},onCheckDpositClick:()=>{s(la())},onDismissClick:()=>{a(!0),s(xe())}};return e.jsxs(e.Fragment,{children:[e.jsx(me,{analytics:L,onLoad:i=>(l=>l.trackPageLoaded(be.Event.accountsDepositCheckFormViewed))(i)}),e.jsx(ee,{anchor:"right",open:n,PaperProps:{style:{width:yt.overlayWidth.valuePercentage(t),boxShadow:"none",zIndex:8}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.75,cursor:"pointer"}}},onClose:(i,l)=>(l==="backdropClick"||l==="escapeKeyDown")&&(a(!0),void s(xe())),children:e.jsx(xt,{onClick:i=>i.stopPropagation(),children:e.jsx(La,{...w})})})]})},xt=B(ne)`
|
|
50
|
-
display: flex;
|
|
51
|
-
min-height: 100%;
|
|
52
|
-
flex-direction: column;
|
|
53
|
-
`,Ct={overlayWidth:new J(100,100,58)},wt=q(function(n,a){const o=a.currentTenant?.companyId;return{plaidConnectionDetails:fa(n,o,"zeni_accounts","external_account").plaidConnectionDetails,depositAccountListView:Ze(n.depositAccountState,n.depositAccountListState)}},function(n,a){return{onReviewClick:()=>n(ga()),clearReviewTransferDetail:()=>n(ha()),onFetchLinkTokenClick:o=>{n(en("external_account",o))},onEstablishConnectionClick:o=>{n(Je(o,a.currentTenant?.companyId,"external_account",void 0,"link_external_account"))}}})(_a),hn=({isTransferDrawerOpen:n,authParams:a,downloadAccountDetailEndPoint:o,closeDrawerHandler:t,zeniAccountsConfig:s})=>{const r=D(g=>ua(g)),c=D(g=>M(g)),d=$(),u=z(),h=_(),{accountId:w}=G(),[i,l]=p.useState("achTransfer"),[m,y]=p.useState(!1);if(I.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const{useDynamicConfig:A}=Z(),{configValue:b}=A(K.zeniAccountsConfig),C=Ae(b),k=()=>{t(!0),h(Le())};return p.useEffect(()=>{r.reviewTransferDetail.fetchState==="Completed"&&y(!0)},[y,r.reviewTransferDetail.fetchState]),e.jsxs(e.Fragment,{children:[e.jsx(me,{analytics:L,onLoad:g=>(j=>j.trackPageLoaded(be.Event.zeniAccountsTransferFormViewed))(g)}),e.jsx(ee,{onClose:()=>{(i==="achTransfer"&&m===!1||i==="achTransfer"&&m&&r.fetchState==="Completed")&&k()},anchor:"right",open:n,PaperProps:{style:{width:Ct.overlayWidth.valuePercentage(u),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsx(At,{onClick:g=>g.stopPropagation(),children:e.jsx(wt,{analytics:L,transferDetails:r,authParams:a,downloadAccountDetailEndPoint:o,onTransferClick:()=>{L.trackTransferBetweenAccountsFormClicked("Transfer",r.reviewTransferDetail.reviewTransferMoney.isShowDailyAchLimitWarning?"Review Split Transfer":"Review Transfer",r.transferDetailLocalData.transferFrom?.label,r.transferDetailLocalData.transferTo?.label,r.transferDetailLocalData.amount.amount,r.reviewTransferDetail.reviewTransferMoney.isShowDailyAchLimitWarning,r.reviewTransferDetail.reviewTransferMoney.transferSchedules.length,r.transferDetailLocalData.transferFrom?.accType==="paymentAccount"&&r.transferDetailLocalData.transferTo?.accType==="depositAccount"&&s.zeniAccountsConfigDetail.depositProductConfig.depositProducts?.[0].range?.[1]!=null&&r.transferDetailLocalData.amount.amount>s.zeniAccountsConfigDetail.depositProductConfig.depositProducts[0].range[1]),h(ma(w))},onDismissClick:k,onSaveChangesToLocalStore:g=>{h(pa(g))},onAnotherTransferClick:()=>{y(!1),h(Le())},currentTenant:c,zeniAccountsConfigDetail:s,currentDrawerContent:i,setCurrentDrawerContent:l,showReviewContent:m,setShowReviewContent:y,onBackClick:()=>{},maxInsuredAmount:C.maxInsuredAmount})})})]})},At=B(ne)`
|
|
54
|
-
display: flex;
|
|
55
|
-
min-height: 100%;
|
|
56
|
-
flex-direction: column;
|
|
57
|
-
`,Dt=B.div`
|
|
58
|
-
display: flex;
|
|
59
|
-
min-height: 100%;
|
|
60
|
-
width: 100%;
|
|
61
|
-
flex: 1 1 auto;
|
|
62
|
-
flex-direction: column;
|
|
63
|
-
align-items: center;
|
|
64
|
-
background-color: ${n=>n.theme.colors.grey4};
|
|
65
|
-
`,kt=q(function(n,a){return{zeniAccountListView:nn(n),isExpressPayEnabled:a.isExpressPayEnabled,analytics:a.analytics}},function(n,a){const{navigate:o,currentTenant:t,location:s,companyId:r,handleDrawerToggle:c,analytics:d,isBillPayEnabled:u,isCashManagementFeatureEnabled:h,isDebitCardFeatureEnabled:w}=a,{tenantEmailDomain:i}=t;return{onZeniAccountClick:(l,m)=>{d.trackAccountsListPageClicked("Accounts Row Item Click",m,"active");const y=St(i,l),A=de(s.state?.pathnameStackToGoBack,s.pathname);o(y,{state:{pathnameStackToGoBack:A}})},onSettingsClick:()=>{d.trackAccountsListPageClicked("Settings Icon"),o("setup")},onReloadTransactions:()=>{n(an(!1))},handleMoveMoneyOptionSelection:(l,m)=>{let y="page-not-found";l==="sendMoney"&&(y=Cn(i)),l==="payBill"?y=gn(t,u,w):l==="transfer"?(y=yn(i),m!=null&&n(sn(m))):l==="checkDeposit"&&(y=xn(i));const A=de(s.state?.pathnameStackToGoBack,s.pathname);o(y,{state:{pathnameStackToGoBack:A}})},unlinkPaymentAccount:(l,m)=>{d.trackAccountsListPageClicked("Unlink Account",m),n(wa(l))},onFetchLinkTokenClick:(l,m)=>{n(en("external_account",l,m))},onUpdatePaymentAccountStatus:(l,m,y)=>{n(Ca(l,m,"zeni_accounts","external_account",y))},onEstablishConnectionClick:l=>{n(Je(l,r,"external_account",void 0,"link_external_account"))},onCreateCheckingClick:l=>{n(xa(l))},onClickMenuIcon:()=>{c(!0)},onTreasuryGetStartedClick:()=>{o("../../treasury/promo")},onAutoTransferClick:l=>{const m=h?"./cash_management/auto-transfer":"./auto-transfer";l?o(m,{state:{...s.state,scrollToAddRule:!0}}):o(m)},onCashManagementClick:()=>{o(It(i))}}})(za);function Ce({isTransferDrawerOpen:n,isCheckDepositDrawerOpen:a}){const o=X(),t=W(),s=_(),r=z(),{tenantEmailDomain:c}=G(),{useDynamicConfig:d,useFeatureGate:u}=Z(),h=$(),{configValue:w}=d(K.zeniAccountsConfig),{isFeatureEnabled:i}=u(P.isTreasuryEnabled),{isFeatureEnabled:l}=u(P.isDebitCardFeatureEnabled),{isFeatureEnabled:m}=u(P.isAutoTransferRuleEnabled),{isFeatureEnabled:y}=u(P.isCheckingCommentingEnabled),{isFeatureEnabled:A}=u(P.isCashManagementFeatureEnabled),b=Ae(w),C=D(O=>M(O)),k=C.companyId??I.getSignedInUserTenant(c)?.companyId,{configValue:g}=d(K.expressPayConfig),j=g.is_enable_all_tenants===!0||g.tenant_ids!=null&&g.tenant_ids.includes(C.tenantId),[T,x]=p.useState(!1),[R,V]=p.useState(!1),[F,U]=p.useState(!1),[E,v]=p.useState(!1),S=D(O=>nn(O)),H=S.fetchState,ae=D(O=>Ne(O)),re=ae?.fetchState??"Not-Started",te=!!C.companyZeniAccountInfo?.info?.isZeniAccountEnabled,Q=oe(),je=!!C.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted,wn=!!C.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,An=se(Q?.loggedInUserRoleMap),Dn=De(Q?.loggedInUserRoleMap),kn=!!C.companyBillPayInfo?.info?.isBillPayEnabled,ve=I.getSignedInUser(),Sn={userId:ve?.userId??"",sessionId:ve?.zeniSessionId??"",tenantId:C.tenantId??""},In=`${Se}/account_details`,{areTenantIdsInSync:Ee}=Ua();p.useEffect(()=>{!T&&Ee&&(x(!0),s(an(!1)))},[T,s,H,Ee]),p.useEffect(()=>{!R&&re==="Not-Started"&&k&&(V(!0),s(Ge(!0)))},[R,re,k,s]),p.useEffect(()=>{n!=null&&n===!0?U(!0):(U(!1),document.body.style.overflow="auto")},[n]),p.useEffect(()=>{v(a!=null&&a===!0)},[a]);const Pe=()=>{U(!1),t("..")},[bn,jn]=p.useState(!1),Te=O=>{jn(O)},{isAiCfoAccessEnabled:vn,onAskAiCfoClick:En}=pn({mobileExploreReferrer:"Checking Accounts"});ln({isDataReady:H==="Completed"});const Pn=dn(),Tn=C.company!=null&&we(C.company),he=(i&&Tn)===!0&&!wn,[Rn,Bn]=p.useState(!1),ge=D(O=>O.treasurySetupViewState.treasuryFundsDetails),Fn=ge.fundsDetails,On=Ma(Fn);p.useEffect(()=>{he!==!0||Rn||ge?.fetchStatus.fetchState!=="Not-Started"||(Bn(!0),s(ya()))},[ge.fetchStatus,s]);const Ln=tn(C),_n=ke(l,C);return Ln===!0&&_n!==!0?e.jsx(un,{}):te?e.jsxs(e.Fragment,{children:[S.fetchState==="Completed"&&F===!1&&E===!1?e.jsx(me,{analytics:L,onLoad:O=>(Re=>{Re.trackAccountsListPageViewed(S.depositAccountsSelectorView.depositAccounts.length,S.externalAccountsSelectorView.paymentAccounts.length,Me(S.summary?.totalBalance.available.amount??0),Me(S.summary?.totalInterest.available.amount??0),S.zeniAccountsConfig.zeniAccountsConfigDetail.annualPercentageYield),he&&Re.trackTreasuryPromoView("Checking Promo Banner")})(O)}):null,F===!0?e.jsx(hn,{closeDrawerHandler:Pe,isTransferDrawerOpen:F,zeniAccountsConfig:S.zeniAccountsConfig,authParams:Sn,downloadAccountDetailEndPoint:In}):null,E===!0?e.jsx(fn,{closeDrawerHandler:Pe,isCheckDepositDrawerOpen:E}):null,e.jsxs(Dt,{windowSize:r,children:[e.jsx(fe,{isAppContentDrawerOpen:bn,handleDrawerToggle:Te}),e.jsx(kt,{zeniBankListView:S,navigate:t,currentTenant:C,location:o,companyId:k,analytics:L,cashManagementBannerProps:Pn,maxInsuredAmount:b.maxInsuredAmount,isExpressPayEnabled:j,isBillPayEnabled:kn,isCashManagementFeatureEnabled:A,isCheckingCommentingEnabled:y,isDebitCardFeatureEnabled:l,isAutoTransferRuleEnabled:m,handleDrawerToggle:Te,showTreasuryPromo:he,treasuryYieldPercentage:On,treasuryInsuredAmount:5e5,isAiCfoAccessEnabled:vn,onAskAiCfoClick:En})]})]}):je&&An?e.jsx(Y,{to:"../setup"}):C.companyZeniAccountInfo?.info&&!je&&Dn?e.jsx(Y,{to:"../promo",state:o.state}):e.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:h.colors.grey5}})}const gn=(n,a,o)=>{const t=ke(o,n),{tenantEmailDomain:s}=n;return t===!0||a===!1?`/${s}/bills`:`/${s}/bill/new`},St=(n,a)=>`/${n}/checking/${a}`,yn=(n,a)=>a==null?`/${n}/checking/transfer`:`/${n}/checking/${a}/transfer`,xn=(n,a)=>a==null?`/${n}/checking/check-deposit`:`/${n}/checking/${a}/check-deposit`,Cn=n=>`/${n}/checking/express-pay`,It=n=>`/${n}/checking/cash_management`,bt=B.div`
|
|
66
|
-
display: flex;
|
|
67
|
-
width: 100%;
|
|
68
|
-
flex: 1 1 auto;
|
|
69
|
-
flex-direction: column;
|
|
70
|
-
align-items: center;
|
|
71
|
-
min-height: 100vh;
|
|
72
|
-
background-color: ${n=>n.theme.colors.grey4};
|
|
73
|
-
`,jt=q(function(n,a){const{currentTenant:o}=a,t=on(n,a.accountId),s=I.getSignedInUser(),r=n.tenantState.currentTenantId,c={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:r??""},d=t.accountDetail?.id??"";return{currentTenantCompanyName:o.companyName??"",authParams:c,downloadEndPoint:`${Ie.bankingMicroServiceBaseUrl}/1.0/deposit-accounts/${d}`,zeniAccountDetail:t,isExpressPayEnabled:a.isExpressPayEnabled,fetchState:t.fetchState}},function(n,a){const{navigate:o,currentTenant:t,location:s,accountId:r}=a,{tenantEmailDomain:c}=t;return{handleMoveMoneyOptionSelection:(d,u)=>{let h="page-not-found";d==="sendMoney"?h=Cn(c):d==="payBill"?h=gn(t,a.isBillPayEnabled,a.isDebitCardFeatureEnabled):d==="transfer"?(h=yn(c,r),u!=null&&n(sn(u))):d==="checkDeposit"?(h=xn(c,r),u!=null&&n(Aa(u))):d==="accountStatement"&&(h=Et(c,r));const w=de(s.state?.pathnameStackToGoBack,s.pathname);o(h,{state:{pathnameStackToGoBack:w}})},onAccountDetailClick:()=>{const d=vt(c,r),u=de(s.state?.pathnameStackToGoBack,s.pathname);o(d,{state:{pathnameStackToGoBack:u}})},onEditNameClick:d=>{n(_e(r,"editName",d))},onReloadZeniAccountDetailPage:()=>{n(rn(r,!1))},onCloseAccountClick:()=>{n(_e(r,"closeAccount",""))},onBackClick:()=>{o("../",{relative:"path"})}}})($a);function le({isTransferDrawerOpen:n,isCheckDepositDrawerOpen:a,isAccountInfoDrawerOpen:o}){const t=X(),s=W(),r=_(),c=z(),{tenantEmailDomain:d,accountId:u}=G(),{useDynamicConfig:h}=Z(),{useFeatureGate:w}=Z(),{isFeatureEnabled:i}=w(P.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=w(P.isCheckingCommentingEnabled),m=D(Q=>M(Q)),{configValue:y}=h(K.expressPayConfig),A=y.is_enable_all_tenants===!0||y.tenant_ids!=null&&y.tenant_ids.includes(m.tenantId),b=!!m.companyBillPayInfo?.info?.isBillPayEnabled,C=I.getSignedInUser(),k=m.companyId??I.getSignedInUserTenant(d)?.companyId,g={userId:C?.userId??"",sessionId:C?.zeniSessionId??"",tenantId:m.tenantId??""},j=`${Se}/account_details`,[T,x]=p.useState(!1),[R,V]=p.useState(!1),[F,U]=p.useState(!1),[E,v]=p.useState(!1),S=D(Q=>on(Q,u??"")),H=S.fetchState,{isAiCfoAccessEnabled:ae,onAskAiCfoClick:re}=pn({mobileExploreReferrer:"Checking Account Detail"});ln({isDataReady:H==="Completed"}),p.useEffect(()=>{T||(r(rn(u??"",!1)),x(!0))},[T,r,H]),p.useEffect(()=>{v(o!=null&&o===!0)},[o]),p.useEffect(()=>{n!=null&&n===!0?V(!0):(V(!1),document.body.style.overflow="auto")},[n]),p.useEffect(()=>{U(a!=null&&a===!0)},[a]);const te=()=>{v(!1),s("..")};return e.jsxs(e.Fragment,{children:[E===!0&&S.accountDetail!=null?e.jsx(ht,{authParams:g,downloadAccountDetailEndPoint:j,closeDrawerHandler:te,isAccountInfoDrawerOpen:E,zeniBankAccountDetail:S.accountDetail}):null,R===!0?e.jsx(hn,{closeDrawerHandler:te,isTransferDrawerOpen:R,zeniAccountsConfig:S.zeniAccountsConfig,authParams:g,downloadAccountDetailEndPoint:j}):null,F===!0?e.jsx(fn,{closeDrawerHandler:te,isCheckDepositDrawerOpen:F}):null,e.jsx(bt,{windowSize:c,children:e.jsx(jt,{navigate:s,currentTenant:m,location:t,companyId:k,isDebitCardFeatureEnabled:i,accountId:u??"",isBillPayEnabled:b,isCheckingCommentingEnabled:l,isExpressPayEnabled:A,isAiCfoAccessEnabled:ae,onAskAiCfoClick:re})})]})}const vt=(n,a)=>`/${n}/checking/${a}/account-info`,Et=(n,a)=>`/${n}/checking/${a}/statements`,Pt=q(function(n,a){const{companyId:o}=a;return{zeniAccountSetupView:Da(n,o),meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true"}},function(n,a){const{navigate:o,companyId:t}=a;return{onSetupButtonClick:()=>{L.trackAccountsPromoPageClicked("Setup Accounts"),n(ka(t))},onBackClick:()=>{o("../..",{relative:"path"})},onSetupZeniAccountSuccess:()=>{o("../setup",{relative:"path"})}}})(Ha),Tt=()=>{const n=W(),a=X(),{tenantEmailDomain:o}=G(),{useDynamicConfig:t}=Z(),s=$(),[r,c]=p.useState(!1),[d,u]=p.useState(!1),h=D(g=>M(g)),{configValue:w}=t(K.zeniAccountsConfig),i=Ae(w);p.useEffect(()=>{d===!1&&a.state?.message==="activation"&&u(!0)},[a.state]);const l=I.getSignedInUserTenant(o)?.companyId??h.companyId,m=I.getSignedInUser(),y=!!h.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted,A=g=>{c(g)};if(m==null)throw Error("Can't access Zeni account promo page without signing in...");const b=oe(),C=se(b?.loggedInUserRoleMap),k=De(b?.loggedInUserRoleMap);if(y&&C)return e.jsx(Y,{to:"../../checking/setup"});if(h.company?.companyZeniAccountInfo&&(!y&&C||k)){if(a.state?.message==="activation"){const g=cn(a.state?.pathnameStackToGoBack);n(a.pathname,{state:{...a.state,message:void 0,pathnameStackToGoBack:g.newStack}})}return e.jsxs(e.Fragment,{children:[e.jsx(Va,{showConfetti:d}),e.jsx(me,{analytics:L,onLoad:g=>(j=>j.trackPageLoaded(be.Event.accountsPromoPageViewed))(g)}),e.jsx(fe,{isAppContentDrawerOpen:r,handleDrawerToggle:A}),e.jsx(Pt,{analytics:L,navigate:n,companyId:l,onClickMenuIcon:()=>{A(!0)},maxAnnualPercentageYield:i.maxAnnualPercentageYield,maxInsuredAmount:i.maxInsuredAmount,exampleBankBalance:3e6})]})}return e.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:s.colors.grey5}})};function rs(){const n=X(),a=D(ae=>M(ae)),o=$(),{useFeatureGate:t,useDynamicConfig:s}=Z(),r=oe(),c=se(r?.loggedInUserRoleMap),d=De(r?.loggedInUserRoleMap),u=!!a.company?.companyZeniAccountInfo.isZeniAccountEnabled,h=!!a.company?.companyZeniAccountInfo.isZeniAccountTOSAccepted,{isFeatureEnabled:w}=t(P.isChargeCardFeatureEnabled),{isFeatureEnabled:i}=t(P.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=t(P.isTreasuryEnabled),m=tn(a),y=ke(i,a),A=a?.userRole!=null&&Sa(a?.userRole),b=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!A)&&Ia(r?.loggedInUserRoleMap),C=ba(r?.loggedInUserRoleMap),k=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!A)&&ja(r?.loggedInUserRoleMap),{isFeatureEnabled:g}=t(P.isDepositAccountsFeatureEnabled),j=g&&!A,{configValue:T}=s(K.expressPayConfig),x=T.is_enable_all_tenants===!0||T.tenant_ids!=null&&T.tenant_ids.includes(a.tenantId),{isFeatureEnabled:R}=t(P.isAutoTransferRuleEnabled),V=a.company!=null&&we(a.company),F=l&&V===!0&&!A,{isFeatureEnabled:U}=t(P.isCashManagementFeatureEnabled),E=Na(a,w,i)&&!A&&va(r?.loggedInUserRoleMap),v=Ea(r?.loggedInUserRoleMap),S=j&&se(r?.loggedInUserRoleMap),H=S||qe(r?.loggedInUserRoleMap);return e.jsxs(Ve,{children:[e.jsx(f,{path:"setup",element:e.jsx(ze,{isBillPayAdminLevelAccess:b,isUserHasOnlyBillPayAccess:C,isReimbursementAdminLevelAccess:k,isZeniAccountAdminLevelAccess:S,isChargeCardAdminLevelAccess:E,isUserHasOnlyCardAccess:v,productType:"zeni_accounts",type:"setup"})}),e.jsx(f,{path:"verification",element:e.jsx(ze,{isBillPayAdminLevelAccess:b,isUserHasOnlyBillPayAccess:C,isReimbursementAdminLevelAccess:k,isZeniAccountAdminLevelAccess:S,isChargeCardAdminLevelAccess:E,isUserHasOnlyCardAccess:v,productType:"zeni_accounts",type:"verification"})}),R?e.jsxs(e.Fragment,{children:[e.jsx(f,{path:"auto-transfer",element:e.jsx($e,{})}),H?e.jsx(f,{path:"auto-transfer/:ruleId/edit",element:e.jsx($e,{isEditDrawerOpen:!0})}):null]}):e.jsx(f,{path:"auto-transfer",element:e.jsx(N,{})}),U&&u&&F?e.jsxs(e.Fragment,{children:[e.jsx(f,{path:"cash_management",element:e.jsx(ie,{})}),R?e.jsxs(e.Fragment,{children:[e.jsx(f,{path:"cash_management/auto-transfer",element:e.jsx(ie,{isAutoTransferRulesTabActive:!0})}),H?e.jsxs(e.Fragment,{children:[e.jsx(f,{path:"cash_management/auto-transfer/:ruleId/edit",element:e.jsx(ie,{isAutoTransferRulesTabActive:!0,isEditDrawerOpen:!0})}),e.jsx(f,{path:"cash_management/:ruleId/edit",element:e.jsx(ie,{isAutoTransferRulesTabActive:!0,isEditDrawerOpen:!0})})]}):null]}):e.jsx(f,{path:"cash_management/auto-transfer",element:e.jsx(N,{})}),e.jsx(f,{path:"cash_management/auto_sweep",element:e.jsx(Ja,{})})]}):e.jsxs(e.Fragment,{children:[e.jsx(f,{path:"cash_management",element:e.jsx(N,{})}),e.jsx(f,{path:"cash_management/auto-transfer",element:e.jsx(N,{})}),e.jsx(f,{path:"cash_management/auto_sweep",element:e.jsx(N,{})})]}),x&&c?e.jsxs(e.Fragment,{children:[e.jsx(f,{path:"express-pay",element:e.jsx(ce,{})}),e.jsx(f,{path:"express-pay/add-ach",element:e.jsx(ce,{isAddACHDrawerOpen:!0})}),e.jsx(f,{path:"express-pay/add-wire/add-address",element:e.jsx(ce,{isAddAddressDrawerOpen:!0})}),e.jsx(f,{path:"express-pay/add-wire",element:e.jsx(ce,{isAddWireDrawerOpen:!0})})]}):e.jsx(f,{path:"express-pay",element:e.jsx(N,{})}),e.jsx(f,{path:"promo",element:e.jsx(Tt,{})}),m&&!y?e.jsx(f,{path:"/*",element:e.jsx(un,{})}):u?e.jsxs(e.Fragment,{children:[e.jsx(f,{path:"/",element:e.jsx(Ce,{})}),e.jsx(f,{path:"transfer",element:e.jsx(Ce,{isTransferDrawerOpen:!0})}),e.jsx(f,{path:"check-deposit",element:e.jsx(Ce,{isCheckDepositDrawerOpen:!0})}),e.jsx(f,{path:":accountId/*",element:e.jsx(Rt,{})}),e.jsx(f,{path:"*",element:e.jsx(N,{})})]}):h&&c?e.jsx(f,{path:"*",element:e.jsx(Y,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&d?e.jsx(f,{path:"*",element:e.jsx(Y,{to:"../promo",state:n.state})}):e.jsx(f,{path:"*",element:e.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:o.colors.grey5,boxShadow:`0px 2px ${Za.sp1} ${o.colors.dropShadowNormal}`}})})]})}function Rt(){return e.jsxs(Ve,{children:[e.jsx(f,{path:"/",element:e.jsx(le,{})}),e.jsx(f,{path:"account-info",element:e.jsx(le,{isAccountInfoDrawerOpen:!0})}),e.jsx(f,{path:"transfer",element:e.jsx(le,{isTransferDrawerOpen:!0})}),e.jsx(f,{path:"check-deposit",element:e.jsx(le,{isCheckDepositDrawerOpen:!0})}),e.jsx(f,{path:"statements",element:e.jsx(Ya,{})}),e.jsx(f,{path:"*",element:e.jsx(N,{})})]})}export{rs as default};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{j as i}from"./liveblocks-DC3GaKoW.js";import{a as f}from"./sentry-CuaXjR5n.js";import{h as x,u as B,g as L,i as $,j as p}from"./core-Bv1T7LZC.js";import{Lb as s,La as j,Rz as v,eW as z,RA as C}from"./zeni-epic-state-DuQa9FMz.js";import{Z as T,au as g,m as D,z as E,B as P,cg as N,p as U}from"./index-CwcEF-q7.js";import{n as _}from"./mui-VYhJrGDQ.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]="8dbd90e8-57c5-467d-bd64-118b060fc112",e._sentryDebugIdIdentifier="sentry-dbid-8dbd90e8-57c5-467d-bd64-118b060fc112")}catch{}})();const A=_.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
height: 100vh;
|
|
4
|
-
width: 100%;
|
|
5
|
-
flex: 1 1 auto;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: center;
|
|
8
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`;function q(){const e=x(),n=B(),d=T(),l=L();let{accountId:a}=$(),m=`${g.bankingMicroServiceBaseUrl}/1.0/deposit-accounts/${a}`;a==null&&l.pathname.includes(`${s}/statements`)&&(a=s,m=`${g.bankingMicroServiceBaseUrl}/1.0/${s}`);const[u,b]=f.useState(!1),h=D();f.useEffect(()=>{u||(b(!0),n(j(a??"",!1)))},[u,n]);const o=p(t=>v(t,a??"")),y=()=>{const t=U(l.state?.pathnameStackToGoBack),S=t.poppedPathname??"..";e(S,{state:{pathnameStackToGoBack:t.newStack}})},c=E.getSignedInUser(),r=p(t=>z(t)),I={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:r.tenantId??""},w=C(a??"")===!0?s:o.zeniAccountDetail?.accountLast4??"",k=r.company?.companyInfo.companyLegalName??r.companyName;if(c==null)throw Error("Can't access address page without signing in...");return o.fetchState!=="Completed"?i.jsx(P,{fetchState:"In-Progress",style:{backgroundColor:h.colors.grey5}}):i.jsx(A,{windowSize:d,children:i.jsx(N,{currentTenantCompanyName:k,statementListView:o,accountLast4:w,onBackClick:y,authParams:I,downloadEndPoint:m})})}export{q as Z};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{a as v,p as ae,c as V,g as ce,b as et}from"./sentry-CuaXjR5n.js";import{b as ue}from"./core-Bv1T7LZC.js";import{j as de}from"./liveblocks-DC3GaKoW.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new r.Error().stack;t&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[t]="e8b9acf7-4d19-41ef-8baf-d9b60390117c",r._sentryDebugIdIdentifier="sentry-dbid-e8b9acf7-4d19-41ef-8baf-d9b60390117c")}catch{}})();const mt=v.createContext({dragDropManager:void 0});function p(r,t,...e){if(ae!==void 0&&t===void 0)throw new Error("invariant requires an error message argument");if(!r){let i;if(t===void 0)i=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let n=0;i=new Error(t.replace(/%s/g,function(){return e[n++]})),i.name="Invariant Violation"}throw i.framesToPop=1,i}}function Yt(r){return typeof r=="object"}const yt="dnd-core/INIT_COORDS",Dt="dnd-core/BEGIN_DRAG",$t="dnd-core/PUBLISH_DRAG_SOURCE",Z="dnd-core/HOVER",bt="dnd-core/DROP",St="dnd-core/END_DRAG";function It(r,t){return{type:yt,payload:{sourceClientOffset:t||null,clientOffset:r||null}}}const he={type:yt,payload:{clientOffset:null,sourceClientOffset:null}};function le(r){return function(t=[],e={publishSource:!0}){const{publishSource:i=!0,clientOffset:n,getSourceClientOffset:s}=e,o=r.getMonitor(),a=r.getRegistry();r.dispatch(It(n)),function(f,h,m){p(!h.isDragging(),"Cannot call beginDrag while dragging."),f.forEach(function(y){p(m.getSource(y),"Expected sourceIds to be registered.")})}(t,o,a);const c=function(f,h){let m=null;for(let y=f.length-1;y>=0;y--)if(h.canDragSource(f[y])){m=f[y];break}return m}(t,o);if(c==null)return void r.dispatch(he);let u=null;if(n){if(!s)throw new Error("getSourceClientOffset must be defined");(function(f){p(typeof f=="function","When clientOffset is provided, getSourceClientOffset must be a function.")})(s),u=s(c)}r.dispatch(It(n,u));const d=a.getSource(c).beginDrag(o,c);if(d==null)return;(function(f){p(Yt(f),"Item must be an object.")})(d),a.pinSource(c);const g=a.getSourceType(c);return{type:Dt,payload:{itemType:g,item:d,sourceId:c,clientOffset:n||null,sourceClientOffset:u||null,isSourcePublic:!!i}}}}function ge(r,t,e){return t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}function fe(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{},i=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(e).filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),i.forEach(function(n){ge(r,n,e[n])})}return r}function pe(r){return function(t={}){const e=r.getMonitor(),i=r.getRegistry();(function(s){p(s.isDragging(),"Cannot call drop while not dragging."),p(!s.didDrop(),"Cannot call drop twice during one drag operation.")})(e),function(s){const o=s.getTargetIds().filter(s.canDropOnTarget,s);return o.reverse(),o}(e).forEach((s,o)=>{const a=function(u,d,g,f){const h=g.getTarget(u);let m=h?h.drop(f,u):void 0;return function(y){p(y===void 0||Yt(y),"Drop result must either be an object or undefined.")}(m),m===void 0&&(m=d===0?{}:f.getDropResult()),m}(s,o,i,e),c={type:bt,payload:{dropResult:fe({},t,a)}};r.dispatch(c)})}}function ve(r){return function(){const t=r.getMonitor(),e=r.getRegistry();(function(n){p(n.isDragging(),"Cannot call endDrag while not dragging.")})(t);const i=t.getSourceId();return i!=null&&(e.getSource(i,!0).endDrag(t,i),e.unpinSource()),{type:St}}}function ut(r,t){return t===null?r===null:Array.isArray(r)?r.some(e=>e===t):r===t}function me(r){return function(t,{clientOffset:e}={}){(function(o){p(Array.isArray(o),"Expected targetIds to be an array.")})(t);const i=t.slice(0),n=r.getMonitor(),s=r.getRegistry();return function(o,a,c){for(let u=o.length-1;u>=0;u--){const d=o[u];ut(a.getTargetType(d),c)||o.splice(u,1)}}(i,s,n.getItemType()),function(o,a,c){p(a.isDragging(),"Cannot call hover while not dragging."),p(!a.didDrop(),"Cannot call hover after drop.");for(let u=0;u<o.length;u++){const d=o[u];p(o.lastIndexOf(d)===u,"Expected targetIds to be unique in the passed array."),p(c.getTarget(d),"Expected targetIds to be registered.")}}(i,n,s),function(o,a,c){o.forEach(function(u){c.getTarget(u).hover(a,u)})}(i,n,s),{type:Z,payload:{targetIds:i,clientOffset:e||null}}}}function ye(r){return function(){if(r.getMonitor().isDragging())return{type:$t}}}class De{receiveBackend(t){this.backend=t}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const t=this,{dispatch:e}=this.store,i=function(n){return{beginDrag:le(n),publishDragSource:ye(n),hover:me(n),drop:pe(n),endDrag:ve(n)}}(this);return Object.keys(i).reduce((n,s)=>{const o=i[s];var a;return n[s]=(a=o,(...c)=>{const u=a.apply(t,c);u!==void 0&&e(u)}),n},{})}dispatch(t){this.store.dispatch(t)}constructor(t,e){this.isSetUp=!1,this.handleRefCountChange=()=>{const i=this.store.getState().refCount>0;this.backend&&(i&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!i&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=t,this.monitor=e,t.subscribe(this.handleRefCountChange)}}function Ct(r,t){return{x:r.x-t.x,y:r.y-t.y}}const Y=[],Ot=[];Y.__IS_NONE__=!0,Ot.__IS_ALL__=!0;class be{subscribeToStateChange(t,e={}){const{handlerIds:i}=e;p(typeof t=="function","listener must be a function."),p(i===void 0||Array.isArray(i),"handlerIds, when specified, must be an array of strings.");let n=this.store.getState().stateId;return this.store.subscribe(()=>{const s=this.store.getState(),o=s.stateId;try{o===n||o===n+1&&!function(c,u){if(c===Y)return!1;if(c===Ot||u===void 0)return!0;const d=(g=c,u.filter(f=>g.indexOf(f)>-1));var g;return d.length>0}(s.dirtyHandlerIds,i)||t()}finally{n=o}})}subscribeToOffsetChange(t){p(typeof t=="function","listener must be a function.");let e=this.store.getState().dragOffset;return this.store.subscribe(()=>{const i=this.store.getState().dragOffset;i!==e&&(e=i,t())})}canDragSource(t){if(!t)return!1;const e=this.registry.getSource(t);return p(e,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()&&e.canDrag(this,t)}canDropOnTarget(t){if(!t)return!1;const e=this.registry.getTarget(t);return p(e,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop()?!1:ut(this.registry.getTargetType(t),this.getItemType())&&e.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const e=this.registry.getSource(t,!0);return p(e,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()||!this.isSourcePublic()?!1:this.registry.getSourceType(t)===this.getItemType()&&e.isDragging(this,t)}isOverTarget(t,e={shallow:!1}){if(!t)return!1;const{shallow:i}=e;if(!this.isDragging())return!1;const n=this.registry.getTargetType(t),s=this.getItemType();if(s&&!ut(n,s))return!1;const o=this.getTargetIds();if(!o.length)return!1;const a=o.indexOf(t);return i?a===o.length-1:a>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return function(t){const{clientOffset:e,initialClientOffset:i,initialSourceClientOffset:n}=t;return e&&i&&n?Ct(function(s,o){return{x:s.x+o.x,y:s.y+o.y}}(e,n),i):null}(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return function(t){const{clientOffset:e,initialClientOffset:i}=t;return e&&i?Ct(e,i):null}(this.store.getState().dragOffset)}constructor(t,e){this.store=t,this.registry=e}}const Nt=V!==void 0?V:self,Pt=Nt.MutationObserver||Nt.WebKitMutationObserver;function Xt(r){return function(){const t=setTimeout(i,0),e=setInterval(i,50);function i(){clearTimeout(t),clearInterval(e),r()}}}const Se=typeof Pt=="function"?function(r){let t=1;const e=new Pt(r),i=document.createTextNode("");return e.observe(i,{characterData:!0}),function(){t=-t,i.data=t}}:Xt;class Oe{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,e){this.onError=t,this.release=e,this.task=null}}const qt=new class{enqueueTask(r){const{queue:t,requestFlush:e}=this;t.length||(e(),this.flushing=!0),t[t.length]=r}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:r}=this;for(;this.index<r.length;){const t=this.index;if(this.index++,r[t].call(),this.index>this.capacity){for(let e=0,i=r.length-this.index;e<i;e++)r[e]=r[e+this.index];r.length-=this.index,this.index=0}}r.length=0,this.index=0,this.flushing=!1},this.registerPendingError=r=>{this.pendingErrors.push(r),this.requestErrorThrow()},this.requestFlush=Se(this.flush),this.requestErrorThrow=Xt(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}},Te=new class{create(r){const t=this.freeTasks,e=t.length?t.pop():new Oe(this.onError,i=>t[t.length]=i);return e.task=r,e}constructor(r){this.onError=r,this.freeTasks=[]}}(qt.registerPendingError),Tt="dnd-core/ADD_SOURCE",wt="dnd-core/ADD_TARGET",Et="dnd-core/REMOVE_SOURCE",Q="dnd-core/REMOVE_TARGET";function dt(r,t){t&&Array.isArray(r)?r.forEach(e=>dt(e,!1)):p(typeof r=="string"||typeof r=="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var I;(function(r){r.SOURCE="SOURCE",r.TARGET="TARGET"})(I||(I={}));let we=0;function Ee(r){const t=(we++).toString();switch(r){case I.SOURCE:return`S${t}`;case I.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${r}`)}}function Mt(r){switch(r[0]){case"S":return I.SOURCE;case"T":return I.TARGET;default:throw new Error(`Cannot parse handler ID: ${r}`)}}function xt(r,t){const e=r.entries();let i=!1;do{const{done:n,value:[,s]}=e.next();if(s===t)return!0;i=!!n}while(!i);return!1}class Ie{addSource(t,e){dt(t),function(n){p(typeof n.canDrag=="function","Expected canDrag to be a function."),p(typeof n.beginDrag=="function","Expected beginDrag to be a function."),p(typeof n.endDrag=="function","Expected endDrag to be a function.")}(e);const i=this.addHandler(I.SOURCE,t,e);return this.store.dispatch(function(n){return{type:Tt,payload:{sourceId:n}}}(i)),i}addTarget(t,e){dt(t,!0),function(n){p(typeof n.canDrop=="function","Expected canDrop to be a function."),p(typeof n.hover=="function","Expected hover to be a function."),p(typeof n.drop=="function","Expected beginDrag to be a function.")}(e);const i=this.addHandler(I.TARGET,t,e);return this.store.dispatch(function(n){return{type:wt,payload:{targetId:n}}}(i)),i}containsHandler(t){return xt(this.dragSources,t)||xt(this.dropTargets,t)}getSource(t,e=!1){return p(this.isSourceId(t),"Expected a valid source ID."),e&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return p(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return p(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return p(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return Mt(t)===I.SOURCE}isTargetId(t){return Mt(t)===I.TARGET}removeSource(t){var e;p(this.getSource(t),"Expected an existing source."),this.store.dispatch(function(i){return{type:Et,payload:{sourceId:i}}}(t)),e=()=>{this.dragSources.delete(t),this.types.delete(t)},qt.enqueueTask(Te.create(e))}removeTarget(t){p(this.getTarget(t),"Expected an existing target."),this.store.dispatch(function(e){return{type:Q,payload:{targetId:e}}}(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const e=this.getSource(t);p(e,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=e}unpinSource(){p(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,e,i){const n=Ee(t);return this.types.set(n,e),t===I.SOURCE?this.dragSources.set(n,i):t===I.TARGET&&this.dropTargets.set(n,i),n}constructor(t){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=t}}const Ce=(r,t)=>r===t;function Ne(r=Y,t){switch(t.type){case Z:break;case Tt:case wt:case Q:case Et:return Y;default:return Ot}const{targetIds:e=[],prevTargetIds:i=[]}=t.payload,n=function(c,u){const d=new Map,g=h=>{d.set(h,d.has(h)?d.get(h)+1:1)};c.forEach(g),u.forEach(g);const f=[];return d.forEach((h,m)=>{h===1&&f.push(m)}),f}(e,i);if(!(n.length>0||!function(c,u,d=Ce){if(c.length!==u.length)return!1;for(let g=0;g<c.length;++g)if(!d(c[g],u[g]))return!1;return!0}(e,i)))return Y;const o=i[i.length-1],a=e[e.length-1];return o!==a&&(o&&n.push(o),a&&n.push(a)),n}function Pe(r,t,e){return t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}const kt={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Me(r=kt,t){const{payload:e}=t;switch(t.type){case yt:case Dt:return{initialSourceClientOffset:e.sourceClientOffset,initialClientOffset:e.clientOffset,clientOffset:e.clientOffset};case Z:return i=r.clientOffset,n=e.clientOffset,!i&&!n||i&&n&&i.x===n.x&&i.y===n.y?r:function(s){for(var o=1;o<arguments.length;o++){var a=arguments[o]!=null?arguments[o]:{},c=Object.keys(a);typeof Object.getOwnPropertySymbols=="function"&&(c=c.concat(Object.getOwnPropertySymbols(a).filter(function(u){return Object.getOwnPropertyDescriptor(a,u).enumerable}))),c.forEach(function(u){Pe(s,u,a[u])})}return s}({},r,{clientOffset:e.clientOffset});case St:case bt:return kt;default:return r}var i,n}function xe(r,t,e){return t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}function j(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{},i=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(e).filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),i.forEach(function(n){xe(r,n,e[n])})}return r}const ke={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Re(r=ke,t){const{payload:e}=t;switch(t.type){case Dt:return j({},r,{itemType:e.itemType,item:e.item,sourceId:e.sourceId,isSourcePublic:e.isSourcePublic,dropResult:null,didDrop:!1});case $t:return j({},r,{isSourcePublic:!0});case Z:return j({},r,{targetIds:e.targetIds});case Q:return r.targetIds.indexOf(e.targetId)===-1?r:j({},r,{targetIds:(i=r.targetIds,n=e.targetId,i.filter(s=>s!==n))});case bt:return j({},r,{dropResult:e.dropResult,didDrop:!0,targetIds:[]});case St:return j({},r,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return r}var i,n}function Le(r=0,t){switch(t.type){case Tt:case wt:return r+1;case Et:case Q:return r-1;default:return r}}function _e(r=0){return r+1}function je(r,t,e){return t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}function Ae(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{},i=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(e).filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),i.forEach(function(n){je(r,n,e[n])})}return r}function He(r={},t){return{dirtyHandlerIds:Ne(r.dirtyHandlerIds,{type:t.type,payload:Ae({},t.payload,{prevTargetIds:(e=r,i="dragOperation.targetIds",n=[],i.split(".").reduce((s,o)=>s&&s[o]?s[o]:n||null,e))})}),dragOffset:Me(r.dragOffset,t),refCount:Le(r.refCount,t),dragOperation:Re(r.dragOperation,t),stateId:_e(r.stateId)};var e,i,n}function Ue(r,t=void 0,e={},i=!1){const n=function(c){const u=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return ue(He,c&&u&&u({name:"dnd-core",instanceId:"dnd-core"}))}(i),s=new be(n,new Ie(n)),o=new De(n,s),a=r(o,t,e);return o.receiveBackend(a),o}function Fe(r,t){if(r==null)return{};var e,i,n=function(o,a){if(o==null)return{};var c,u,d={},g=Object.keys(o);for(u=0;u<g.length;u++)c=g[u],a.indexOf(c)>=0||(d[c]=o[c]);return d}(r,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(r);for(i=0;i<s.length;i++)e=s[i],t.indexOf(e)>=0||Object.prototype.propertyIsEnumerable.call(r,e)&&(n[e]=r[e])}return n}let Rt=0;const X=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var Lt,_t,Be=v.memo(function(r){var{children:t}=r,e=Fe(r,["children"]);const[i,n]=function(s){if("manager"in s)return[{dragDropManager:s.manager},!1];const o=function(c,u=jt(),d,g){const f=u;return f[X]||(f[X]={dragDropManager:Ue(c,u,d,g)}),f[X]}(s.backend,s.context,s.options,s.debugMode),a=!s.context;return[o,a]}(e);return v.useEffect(()=>{if(n){const s=jt();return++Rt,()=>{--Rt==0&&(s[X]=null)}}},[]),de.jsx(mt.Provider,{value:i,children:t})});function jt(){return V!==void 0?V:window}var We=(_t||(_t=1,Lt=function r(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var i,n,s;if(Array.isArray(t)){if((i=t.length)!=e.length)return!1;for(n=i;n--!=0;)if(!r(t[n],e[n]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();if((i=(s=Object.keys(t)).length)!==Object.keys(e).length)return!1;for(n=i;n--!=0;)if(!Object.prototype.hasOwnProperty.call(e,s[n]))return!1;for(n=i;n--!=0;){var o=s[n];if(!r(t[o],e[o]))return!1}return!0}return t!=t&&e!=e}),Lt);const Ye=ce(We),k=typeof window<"u"?v.useLayoutEffect:v.useEffect;function Gt(r,t,e){const[i,n]=v.useState(()=>t(r)),s=v.useCallback(()=>{const o=t(r);Ye(i,o)||(n(o),e&&e())},[i,r,e]);return k(s),[i,s]}function Kt(r,t,e){return function(i,n,s){const[o,a]=Gt(i,n,s);return k(function(){const c=i.getHandlerId();if(c!=null)return i.subscribeToStateChange(a,{handlerIds:[c]})},[i,a]),o}(t,r||(()=>({})),()=>e.reconnect())}function zt(r,t){const e=[...t||[]];return t==null&&typeof r!="function"&&e.push(r),v.useMemo(()=>typeof r=="function"?r():r,e)}function $e(r){return v.useMemo(()=>r.hooks.dragSource(),[r])}function Xe(r){return v.useMemo(()=>r.hooks.dragPreview(),[r])}let rt=!1,nt=!1;class qe{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){p(!rt,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return rt=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{rt=!1}}isDragging(){if(!this.sourceId)return!1;p(!nt,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return nt=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{nt=!1}}subscribeToStateChange(t,e){return this.internalMonitor.subscribeToStateChange(t,e)}isDraggingSource(t){return this.internalMonitor.isDraggingSource(t)}isOverTarget(t,e){return this.internalMonitor.isOverTarget(t,e)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(t){return this.internalMonitor.subscribeToOffsetChange(t)}canDragSource(t){return this.internalMonitor.canDragSource(t)}canDropOnTarget(t){return this.internalMonitor.canDropOnTarget(t)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.sourceId=null,this.internalMonitor=t.getMonitor()}}let it=!1;class Ge{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,e){return this.internalMonitor.subscribeToStateChange(t,e)}canDrop(){if(!this.targetId)return!1;p(!it,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return it=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{it=!1}}isOver(t){return!!this.targetId&&this.internalMonitor.isOverTarget(this.targetId,t)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.targetId=null,this.internalMonitor=t.getMonitor()}}function ht(r,t,e,i){let n;if(n!==void 0)return!!n;if(r===t)return!0;if(typeof r!="object"||!r||typeof t!="object"||!t)return!1;const s=Object.keys(r),o=Object.keys(t);if(s.length!==o.length)return!1;const a=Object.prototype.hasOwnProperty.bind(t);for(let c=0;c<s.length;c++){const u=s[c];if(!a(u))return!1;const d=r[u],g=t[u];if(n=void 0,n===!1||n===void 0&&d!==g)return!1}return!0}function lt(r){return r!==null&&typeof r=="object"&&Object.prototype.hasOwnProperty.call(r,"current")}function Ke(r){return(t=null,e=null)=>{if(!v.isValidElement(t)){const n=t;return r(n,e),n}const i=t;return function(n){if(typeof n.type=="string")return;const s=n.type.displayName||n.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${s} into a <div>, or turn it into a drag source or a drop target itself.`)}(i),function(n,s){const o=n.ref;return p(typeof o!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),o?v.cloneElement(n,{ref:a=>{At(o,a),At(s,a)}}):v.cloneElement(n,{ref:s})}(i,e?n=>r(n,e):r)}}function Vt(r){const t={};return Object.keys(r).forEach(e=>{const i=r[e];if(e.endsWith("Ref"))t[e]=r[e];else{const n=Ke(i);t[e]=()=>n}}),t}function At(r,t){typeof r=="function"?r(t):r.current=t}class ze{receiveHandlerId(t){this.handlerId!==t&&(this.handlerId=t,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(t){this.dragSourceOptionsInternal=t}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(t){this.dragPreviewOptionsInternal=t}reconnect(){const t=this.reconnectDragSource();this.reconnectDragPreview(t)}reconnectDragSource(){const t=this.dragSource,e=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return e&&this.disconnectDragSource(),this.handlerId?t?(e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=t,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,t,this.dragSourceOptions)),e):(this.lastConnectedDragSource=t,e):e}reconnectDragPreview(t=!1){const e=this.dragPreview,i=t||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();i&&this.disconnectDragPreview(),this.handlerId&&(e?i&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=e,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,e,this.dragPreviewOptions)):this.lastConnectedDragPreview=e)}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!ht(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!ht(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(t){this.hooks=Vt({dragSource:(e,i)=>{this.clearDragSource(),this.dragSourceOptions=i||null,lt(e)?this.dragSourceRef=e:this.dragSourceNode=e,this.reconnectDragSource()},dragPreview:(e,i)=>{this.clearDragPreview(),this.dragPreviewOptions=i||null,lt(e)?this.dragPreviewRef=e:this.dragPreviewNode=e,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=t}}class Ve{get connectTarget(){return this.dropTarget}reconnect(){const t=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();t&&this.disconnectDropTarget();const e=this.dropTarget;this.handlerId&&(e?t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=e,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,e,this.dropTargetOptions)):this.lastConnectedDropTarget=e)}receiveHandlerId(t){t!==this.handlerId&&(this.handlerId=t,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(t){this.dropTargetOptionsInternal=t}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!ht(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(t){this.hooks=Vt({dropTarget:(e,i)=>{this.clearDropTarget(),this.dropTargetOptions=i,lt(e)?this.dropTargetRef=e:this.dropTargetNode=e,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}}function R(){const{dragDropManager:r}=v.useContext(mt);return p(r!=null,"Expected drag drop context"),r}class Je{beginDrag(){const t=this.spec,e=this.monitor;let i=null;return i=typeof t.item=="object"?t.item:typeof t.item=="function"?t.item(e):{},i??null}canDrag(){const t=this.spec,e=this.monitor;return typeof t.canDrag=="boolean"?t.canDrag:typeof t.canDrag!="function"||t.canDrag(e)}isDragging(t,e){const i=this.spec,n=this.monitor,{isDragging:s}=i;return s?s(n):e===t.getSourceId()}endDrag(){const t=this.spec,e=this.monitor,i=this.connector,{end:n}=t;n&&n(e.getItem(),e),i.reconnect()}constructor(t,e,i){this.spec=t,this.monitor=e,this.connector=i}}function Ze(r,t,e){const i=R(),n=function(o,a,c){const u=v.useMemo(()=>new Je(o,a,c),[a,c]);return v.useEffect(()=>{u.spec=o},[o]),u}(r,t,e),s=function(o){return v.useMemo(()=>{const a=o.type;return p(a!=null,"spec.type must be defined"),a},[o])}(r);k(function(){if(s!=null){const[o,a]=function(c,u,d){const g=d.getRegistry(),f=g.addSource(c,u);return[f,()=>g.removeSource(f)]}(s,n,i);return t.receiveHandlerId(o),e.receiveHandlerId(o),a}},[i,t,e,n,s])}function Sr(r,t){const e=zt(r,t);p(!e.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const i=function(){const s=R();return v.useMemo(()=>new qe(s),[s])}(),n=function(s,o){const a=R(),c=v.useMemo(()=>new ze(a.getBackend()),[a]);return k(()=>(c.dragSourceOptions=s||null,c.reconnect(),()=>c.disconnectDragSource()),[c,s]),k(()=>(c.dragPreviewOptions=o||null,c.reconnect(),()=>c.disconnectDragPreview()),[c,o]),c}(e.options,e.previewOptions);return Ze(e,i,n),[Kt(e.collect,i,n),$e(n),Xe(n)]}function Qe(r){return v.useMemo(()=>r.hooks.dropTarget(),[r])}class tr{canDrop(){const t=this.spec,e=this.monitor;return!t.canDrop||t.canDrop(e.getItem(),e)}hover(){const t=this.spec,e=this.monitor;t.hover&&t.hover(e.getItem(),e)}drop(){const t=this.spec,e=this.monitor;if(t.drop)return t.drop(e.getItem(),e)}constructor(t,e){this.spec=t,this.monitor=e}}function er(r,t,e){const i=R(),n=function(o,a){const c=v.useMemo(()=>new tr(o,a),[a]);return v.useEffect(()=>{c.spec=o},[o]),c}(r,t),s=function(o){const{accept:a}=o;return v.useMemo(()=>(p(o.accept!=null,"accept must be defined"),Array.isArray(a)?a:[a]),[a])}(r);k(function(){const[o,a]=function(c,u,d){const g=d.getRegistry(),f=g.addTarget(c,u);return[f,()=>g.removeTarget(f)]}(s,n,i);return t.receiveHandlerId(o),e.receiveHandlerId(o),a},[i,t,n,e,s.map(o=>o.toString()).join("|")])}function Or(r,t){const e=zt(r,t),i=function(){const s=R();return v.useMemo(()=>new Ge(s),[s])}(),n=function(s){const o=R(),a=v.useMemo(()=>new Ve(o.getBackend()),[o]);return k(()=>(a.dropTargetOptions=s||null,a.reconnect(),()=>a.disconnectDropTarget()),[s]),a}(e.options);return er(e,i,n),[Kt(e.collect,i,n),Qe(n)]}function Jt(r){let t=null;return()=>(t==null&&(t=r()),t)}class rr{enter(t){const e=this.entered.length;return this.entered=function(i,n){const s=new Set,o=c=>s.add(c);i.forEach(o),n.forEach(o);const a=[];return s.forEach(c=>a.push(c)),a}(this.entered.filter(i=>this.isNodeInDocument(i)&&(!i.contains||i.contains(t))),[t]),e===0&&this.entered.length>0}leave(t){const e=this.entered.length;var i,n;return this.entered=(i=this.entered.filter(this.isNodeInDocument),n=t,i.filter(s=>s!==n)),e>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class nr{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(t=>{Object.defineProperty(this.item,t,{configurable:!0,enumerable:!0,get:()=>(console.warn(`Browser doesn't allow reading "${t}" until the drop event.`),null)})})}loadDataTransfer(t){if(t){const e={};Object.keys(this.config.exposeProperties).forEach(i=>{const n=this.config.exposeProperties[i];n!=null&&(e[i]={value:n(t,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,e)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(t,e){return e===t.getSourceId()}endDrag(){}constructor(t){this.config=t,this.item={},this.initializeExposedProperties()}}const Zt="__NATIVE_FILE__",Qt="__NATIVE_URL__",te="__NATIVE_TEXT__",ee="__NATIVE_HTML__",Ht=Object.freeze(Object.defineProperty({__proto__:null,FILE:Zt,HTML:ee,TEXT:te,URL:Qt},Symbol.toStringTag,{value:"Module"}));function st(r,t,e){const i=t.reduce((n,s)=>n||r.getData(s),"");return i??e}const gt={[Zt]:{exposeProperties:{files:r=>Array.prototype.slice.call(r.files),items:r=>r.items,dataTransfer:r=>r},matchesTypes:["Files"]},[ee]:{exposeProperties:{html:(r,t)=>st(r,t,""),dataTransfer:r=>r},matchesTypes:["Html","text/html"]},[Qt]:{exposeProperties:{urls:(r,t)=>st(r,t,"").split(`
|
|
2
|
-
`),dataTransfer:r=>r},matchesTypes:["Url","text/uri-list"]},[te]:{exposeProperties:{text:(r,t)=>st(r,t,""),dataTransfer:r=>r},matchesTypes:["Text","text/plain"]}};function ot(r){if(!r)return null;const t=Array.prototype.slice.call(r.types||[]);return Object.keys(gt).filter(e=>{const i=gt[e];return!!i?.matchesTypes&&i.matchesTypes.some(n=>t.indexOf(n)>-1)})[0]||null}const ir=Jt(()=>/firefox/i.test(navigator.userAgent)),Ut=Jt(()=>!!window.safari);class Ft{interpolate(t){const{xs:e,ys:i,c1s:n,c2s:s,c3s:o}=this;let a=e.length-1;if(t===e[a])return i[a];let c,u=0,d=o.length-1;for(;u<=d;){c=Math.floor(.5*(u+d));const h=e[c];if(h<t)u=c+1;else{if(!(h>t))return i[c];d=c-1}}a=Math.max(0,d);const g=t-e[a],f=g*g;return i[a]+n[a]*g+s[a]*f+o[a]*g*f}constructor(t,e){const{length:i}=t,n=[];for(let h=0;h<i;h++)n.push(h);n.sort((h,m)=>t[h]<t[m]?-1:1);const s=[],o=[];let a,c;for(let h=0;h<i-1;h++)a=t[h+1]-t[h],c=e[h+1]-e[h],s.push(a),o.push(c/a);const u=[o[0]];for(let h=0;h<s.length-1;h++){const m=o[h],y=o[h+1];if(m*y<=0)u.push(0);else{a=s[h];const S=s[h+1],O=a+S;u.push(3*O/((O+S)/m+(O+a)/y))}}u.push(o[o.length-1]);const d=[],g=[];let f;for(let h=0;h<u.length-1;h++){f=o[h];const m=u[h],y=1/s[h],S=m+u[h+1]-f-f;d.push((f-m-S)*y),g.push(S*y*y)}this.xs=t,this.ys=e,this.c1s=u,this.c2s=d,this.c3s=g}}function re(r){const t=r.nodeType===1?r:r.parentElement;if(!t)return null;const{top:e,left:i}=t.getBoundingClientRect();return{x:i,y:e}}function q(r){return{x:r.clientX,y:r.clientY}}function sr(r,t,e,i,n){const s=(o=t).nodeName==="IMG"&&(ir()||!(!((a=document.documentElement)===null||a===void 0)&&a.contains(o)));var o,a;const c=re(s?r:t),u={x:e.x-c.x,y:e.y-c.y},{offsetWidth:d,offsetHeight:g}=r,{anchorX:f,anchorY:h}=i,{dragPreviewWidth:m,dragPreviewHeight:y}=function(b,L,tt,A){let H=b?L.width:tt,_=b?L.height:A;return Ut()&&b&&(_/=window.devicePixelRatio,H/=window.devicePixelRatio),{dragPreviewWidth:H,dragPreviewHeight:_}}(s,t,d,g),{offsetX:S,offsetY:O}=n,D=O===0||O;return{x:S===0||S?S:new Ft([0,.5,1],[u.x,u.x/d*m,u.x+m-d]).interpolate(f),y:D?O:(()=>{let b=new Ft([0,.5,1],[u.y,u.y/g*y,u.y+y-g]).interpolate(h);return Ut()&&s&&(b+=(window.devicePixelRatio-1)*y),b})()}}let or=class{get window(){return this.globalContext?this.globalContext:typeof window<"u"?window:void 0}get document(){var r;return!((r=this.globalContext)===null||r===void 0)&&r.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var r;return((r=this.optionsArgs)===null||r===void 0?void 0:r.rootElement)||this.window}constructor(r,t){this.ownerDocument=null,this.globalContext=r,this.optionsArgs=t}};function ar(r,t,e){return t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}function Bt(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{},i=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(i=i.concat(Object.getOwnPropertySymbols(e).filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),i.forEach(function(n){ar(r,n,e[n])})}return r}class cr{profile(){var t,e;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((t=this.dragStartSourceIds)===null||t===void 0?void 0:t.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((e=this.dragOverTargetIds)===null||e===void 0?void 0:e.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const t=this.rootElement;if(t!==void 0){if(t.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");t.__isReactDndBackendSetUp=!0,this.addEventListeners(t)}}teardown(){const t=this.rootElement;var e;t!==void 0&&(t.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId&&((e=this.window)===null||e===void 0||e.cancelAnimationFrame(this.asyncEndDragFrameId)))}connectDragPreview(t,e,i){return this.sourcePreviewNodeOptions.set(t,i),this.sourcePreviewNodes.set(t,e),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDragSource(t,e,i){this.sourceNodes.set(t,e),this.sourceNodeOptions.set(t,i);const n=o=>this.handleDragStart(o,t),s=o=>this.handleSelectStart(o);return e.setAttribute("draggable","true"),e.addEventListener("dragstart",n),e.addEventListener("selectstart",s),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),e.removeEventListener("dragstart",n),e.removeEventListener("selectstart",s),e.setAttribute("draggable","false")}}connectDropTarget(t,e){const i=o=>this.handleDragEnter(o,t),n=o=>this.handleDragOver(o,t),s=o=>this.handleDrop(o,t);return e.addEventListener("dragenter",i),e.addEventListener("dragover",n),e.addEventListener("drop",s),()=>{e.removeEventListener("dragenter",i),e.removeEventListener("dragover",n),e.removeEventListener("drop",s)}}addEventListeners(t){t.addEventListener&&(t.addEventListener("dragstart",this.handleTopDragStart),t.addEventListener("dragstart",this.handleTopDragStartCapture,!0),t.addEventListener("dragend",this.handleTopDragEndCapture,!0),t.addEventListener("dragenter",this.handleTopDragEnter),t.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.addEventListener("dragover",this.handleTopDragOver),t.addEventListener("dragover",this.handleTopDragOverCapture,!0),t.addEventListener("drop",this.handleTopDrop),t.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(t){t.removeEventListener&&(t.removeEventListener("dragstart",this.handleTopDragStart),t.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),t.removeEventListener("dragend",this.handleTopDragEndCapture,!0),t.removeEventListener("dragenter",this.handleTopDragEnter),t.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.removeEventListener("dragover",this.handleTopDragOver),t.removeEventListener("dragover",this.handleTopDragOverCapture,!0),t.removeEventListener("drop",this.handleTopDrop),t.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const t=this.monitor.getSourceId(),e=this.sourceNodeOptions.get(t);return Bt({dropEffect:this.altKeyPressed?"copy":"move"},e||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const t=this.monitor.getSourceId();return Bt({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(t)||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(Ht).some(e=>Ht[e]===t)}beginDragNativeItem(t,e){this.clearCurrentDragSourceNode(),this.currentNativeSource=function(i,n){const s=gt[i];if(!s)throw new Error(`native type ${i} has no configuration`);const o=new nr(s);return o.loadDataTransfer(n),o}(t,e),this.currentNativeHandle=this.registry.addSource(t,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(t){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=t,this.mouseMoveTimeoutTimer=setTimeout(()=>{var e;return(e=this.rootElement)===null||e===void 0?void 0:e.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},1e3)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){var t;return this.currentDragSourceNode=null,this.rootElement&&((t=this.window)===null||t===void 0||t.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)),this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(t,e){t.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(e))}handleDragEnter(t,e){this.dragEnterTargetIds.unshift(e)}handleDragOver(t,e){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(e)}handleDrop(t,e){this.dropTargetIds.unshift(e)}constructor(t,e,i){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=n=>{const s=this.sourceNodes.get(n);return s&&re(s)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=n=>!!(n&&this.document&&this.document.body&&this.document.body.contains(n)),this.endDragIfSourceWasRemovedFromDOM=()=>{const n=this.currentDragSourceNode;n==null||this.isNodeInDocument(n)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=n=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(n||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=n=>{if(n.defaultPrevented)return;const{dragStartSourceIds:s}=this;this.dragStartSourceIds=null;const o=q(n);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(s||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:o});const{dataTransfer:a}=n,c=ot(a);if(this.monitor.isDragging()){if(a&&typeof a.setDragImage=="function"){const d=this.monitor.getSourceId(),g=this.sourceNodes.get(d),f=this.sourcePreviewNodes.get(d)||g;if(f){const{anchorX:h,anchorY:m,offsetX:y,offsetY:S}=this.getCurrentSourcePreviewNodeOptions(),O=sr(g,f,o,{anchorX:h,anchorY:m},{offsetX:y,offsetY:S});a.setDragImage(f,O.x,O.y)}}try{a?.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(n.target);const{captureDraggingState:u}=this.getCurrentSourcePreviewNodeOptions();u?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(c)this.beginDragNativeItem(c);else{if(a&&!a.types&&(n.target&&!n.target.hasAttribute||!n.target.hasAttribute("draggable")))return;n.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=n=>{var s;if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()&&((s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(n.dataTransfer)),!this.enterLeaveCounter.enter(n.target)||this.monitor.isDragging())return;const{dataTransfer:o}=n,a=ot(o);a&&this.beginDragNativeItem(a,o)},this.handleTopDragEnter=n=>{const{dragEnterTargetIds:s}=this;this.dragEnterTargetIds=[],this.monitor.isDragging()&&(this.altKeyPressed=n.altKey,s.length>0&&this.actions.hover(s,{clientOffset:q(n)}),s.some(o=>this.monitor.canDropOnTarget(o))&&(n.preventDefault(),n.dataTransfer&&(n.dataTransfer.dropEffect=this.getCurrentDropEffect())))},this.handleTopDragOverCapture=n=>{var s;this.dragOverTargetIds=[],this.isDraggingNativeItem()&&((s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(n.dataTransfer))},this.handleTopDragOver=n=>{const{dragOverTargetIds:s}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging())return n.preventDefault(),void(n.dataTransfer&&(n.dataTransfer.dropEffect="none"));this.altKeyPressed=n.altKey,this.lastClientOffset=q(n),this.scheduleHover(s),(s||[]).some(o=>this.monitor.canDropOnTarget(o))?(n.preventDefault(),n.dataTransfer&&(n.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?n.preventDefault():(n.preventDefault(),n.dataTransfer&&(n.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=n=>{this.isDraggingNativeItem()&&n.preventDefault(),this.enterLeaveCounter.leave(n.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=n=>{var s;this.dropTargetIds=[],this.isDraggingNativeItem()?(n.preventDefault(),(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(n.dataTransfer)):ot(n.dataTransfer)&&n.preventDefault(),this.enterLeaveCounter.reset()},this.handleTopDrop=n=>{const{dropTargetIds:s}=this;this.dropTargetIds=[],this.actions.hover(s,{clientOffset:q(n)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=n=>{const s=n.target;typeof s.dragDrop=="function"&&(s.tagName==="INPUT"||s.tagName==="SELECT"||s.tagName==="TEXTAREA"||s.isContentEditable||(n.preventDefault(),s.dragDrop()))},this.options=new or(e,i),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new rr(this.isNodeInDocument)}}const Tr=function(r,t,e){return new cr(r,t,e)};var M,ne=(r,t,e)=>{if(!t.has(r))throw TypeError("Cannot "+e)},l=(r,t,e)=>(ne(r,t,"read from private field"),e?e.call(r):t.get(r)),E=(r,t,e)=>{if(t.has(r))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(r):t.set(r,e)},x=(r,t,e,i)=>(ne(r,t,"write to private field"),t.set(r,e),e),ur=class{constructor(){E(this,M,void 0),this.register=r=>{l(this,M).push(r)},this.unregister=r=>{let t;for(;(t=l(this,M).indexOf(r))!==-1;)l(this,M).splice(t,1)},this.backendChanged=r=>{for(let t of l(this,M))t.backendChanged(r)},x(this,M,[])}};M=new WeakMap;var T,B,w,C,N,ft,pt,vt,G,K,W,z=class{constructor(r,t,e){if(E(this,T,void 0),E(this,B,void 0),E(this,w,void 0),E(this,C,void 0),E(this,N,void 0),E(this,ft,(i,n,s)=>{if(!s.backend)throw new Error(`You must specify a 'backend' property in your Backend entry: ${JSON.stringify(s)}`);let o=s.backend(i,n,s.options),a=s.id,c=!s.id&&o&&o.constructor;if(c&&(a=o.constructor.name),!a)throw new Error(`You must specify an 'id' property in your Backend entry: ${JSON.stringify(s)}
|
|
3
|
-
see this guide: https://github.com/louisbrunner/dnd-multi-backend/tree/master/packages/react-dnd-multi-backend#migrating-from-5xx`);if(c&&console.warn(`Deprecation notice: You are using a pipeline which doesn't include backends' 'id'.
|
|
4
|
-
This might be unsupported in the future, please specify 'id' explicitely for every backend.`),l(this,w)[a])throw new Error(`You must specify a unique 'id' property in your Backend entry:
|
|
5
|
-
${JSON.stringify(s)} (conflicts with: ${JSON.stringify(l(this,w)[a])})`);return{id:a,instance:o,preview:s.preview??!1,transition:s.transition,skipDispatchOnTransition:s.skipDispatchOnTransition??!1}}),this.setup=()=>{if(!(typeof window>"u")){if(z.isSetUp)throw new Error("Cannot have two MultiBackends at the same time.");z.isSetUp=!0,l(this,pt).call(this,window),l(this,w)[l(this,T)].instance.setup()}},this.teardown=()=>{typeof window>"u"||(z.isSetUp=!1,l(this,vt).call(this,window),l(this,w)[l(this,T)].instance.teardown())},this.connectDragSource=(i,n,s)=>l(this,W).call(this,"connectDragSource",i,n,s),this.connectDragPreview=(i,n,s)=>l(this,W).call(this,"connectDragPreview",i,n,s),this.connectDropTarget=(i,n,s)=>l(this,W).call(this,"connectDropTarget",i,n,s),this.profile=()=>l(this,w)[l(this,T)].instance.profile(),this.previewEnabled=()=>l(this,w)[l(this,T)].preview,this.previewsList=()=>l(this,B),this.backendsList=()=>l(this,C),E(this,pt,i=>{l(this,C).forEach(n=>{n.transition&&i.addEventListener(n.transition.event,l(this,G))})}),E(this,vt,i=>{l(this,C).forEach(n=>{n.transition&&i.removeEventListener(n.transition.event,l(this,G))})}),E(this,G,i=>{let n=l(this,T);if(l(this,C).some(s=>!(s.id===l(this,T)||!s.transition||!s.transition.check(i))&&(x(this,T,s.id),!0)),l(this,T)!==n){l(this,w)[n].instance.teardown(),Object.keys(l(this,N)).forEach(a=>{let c=l(this,N)[a];c.unsubscribe(),c.unsubscribe=l(this,K).call(this,c.func,...c.args)}),l(this,B).backendChanged(this);let s=l(this,w)[l(this,T)];if(s.instance.setup(),s.skipDispatchOnTransition)return;let o=new i.constructor(i.type,i);i.target?.dispatchEvent(o)}}),E(this,K,(i,n,s,o)=>l(this,w)[l(this,T)].instance[i](n,s,o)),E(this,W,(i,n,s,o)=>{let a=`${i}_${n}`,c=l(this,K).call(this,i,n,s,o);return l(this,N)[a]={func:i,args:[n,s,o],unsubscribe:c},()=>{l(this,N)[a].unsubscribe(),delete l(this,N)[a]}}),!e||!e.backends||e.backends.length<1)throw new Error(`You must specify at least one Backend, if you are coming from 2.x.x (or don't understand this error)
|
|
6
|
-
see this guide: https://github.com/louisbrunner/dnd-multi-backend/tree/master/packages/react-dnd-multi-backend#migrating-from-2xx`);x(this,B,new ur),x(this,w,{}),x(this,C,[]),e.backends.forEach(i=>{let n=l(this,ft).call(this,r,t,i);l(this,w)[n.id]=n,l(this,C).push(n)}),x(this,T,l(this,C)[0].id),x(this,N,{})}},ie=z;T=new WeakMap,B=new WeakMap,w=new WeakMap,C=new WeakMap,N=new WeakMap,ft=new WeakMap,pt=new WeakMap,vt=new WeakMap,G=new WeakMap,K=new WeakMap,W=new WeakMap,ie.isSetUp=!1;var dr=(r,t,e)=>new ie(r,t,e),se=(r,t)=>({event:r,check:t}),wr=se("touchstart",r=>{let t=r;return t.touches!==null&&t.touches!==void 0}),Er=se("mousedown",r=>r.type.indexOf("touch")===-1&&r.type.indexOf("mouse")!==-1),at=(r,t)=>({x:r.x-t.x,y:r.y-t.y}),hr=(r,t)=>{let e=r.getClientOffset();if(e===null)return null;if(!t.current||!t.current.getBoundingClientRect)return at(e,(s=>{let o=s.getInitialClientOffset(),a=s.getInitialSourceClientOffset();return o===null||a===null?{x:0,y:0}:at(o,a)})(r));let i=t.current.getBoundingClientRect(),n={x:i.width/2,y:i.height/2};return at(e,n)},lr=r=>{let t=`translate(${r.x.toFixed(1)}px, ${r.y.toFixed(1)}px)`;return{pointerEvents:"none",position:"fixed",top:0,left:0,transform:t,WebkitTransform:t}},gr=()=>{let r=v.useRef(null),t=function(e){const i=R().getMonitor(),[n,s]=Gt(i,e);return v.useEffect(()=>i.subscribeToOffsetChange(s)),v.useEffect(()=>i.subscribeToStateChange(s)),n}(e=>({currentOffset:hr(e,r),isDragging:e.isDragging(),itemType:e.getItemType(),item:e.getItem(),monitor:e}));return t.isDragging&&t.currentOffset!==null?{display:!0,itemType:t.itemType,item:t.item,style:lr(t.currentOffset),monitor:t.monitor,ref:r}:{display:!1}};v.createContext(void 0);var P,fr=v.createContext(null),Ir=({portal:r,...t})=>{let[e,i]=v.useState(null);return et.createElement(fr.Provider,{value:r??e},et.createElement(Be,{backend:dr,...t}),r?null:et.createElement("div",{ref:i}))},Cr=()=>{let r=(()=>{let[e,i]=v.useState(!1),n=v.useContext(mt);return v.useEffect(()=>{let s=n?.dragDropManager?.getBackend(),o={backendChanged:a=>{i(a.previewEnabled())}};return i(s.previewEnabled()),s.previewsList().register(o),()=>{s.previewsList().unregister(o)}},[n,n.dragDropManager]),e})(),t=gr();return r?t:{display:!1}};(function(r){r.mouse="mouse",r.touch="touch",r.keyboard="keyboard"})(P||(P={}));class pr{get delay(){var t;return(t=this.args.delay)!==null&&t!==void 0?t:0}get scrollAngleRanges(){return this.args.scrollAngleRanges}get getDropTargetElementsAtPoint(){return this.args.getDropTargetElementsAtPoint}get ignoreContextMenu(){var t;return(t=this.args.ignoreContextMenu)!==null&&t!==void 0&&t}get enableHoverOutsideTarget(){var t;return(t=this.args.enableHoverOutsideTarget)!==null&&t!==void 0&&t}get enableKeyboardEvents(){var t;return(t=this.args.enableKeyboardEvents)!==null&&t!==void 0&&t}get enableMouseEvents(){var t;return(t=this.args.enableMouseEvents)!==null&&t!==void 0&&t}get enableTouchEvents(){var t;return(t=this.args.enableTouchEvents)===null||t===void 0||t}get touchSlop(){return this.args.touchSlop||0}get delayTouchStart(){var t,e,i,n;return(n=(i=(t=this.args)===null||t===void 0?void 0:t.delayTouchStart)!==null&&i!==void 0?i:(e=this.args)===null||e===void 0?void 0:e.delay)!==null&&n!==void 0?n:0}get delayMouseStart(){var t,e,i,n;return(n=(i=(t=this.args)===null||t===void 0?void 0:t.delayMouseStart)!==null&&i!==void 0?i:(e=this.args)===null||e===void 0?void 0:e.delay)!==null&&n!==void 0?n:0}get window(){return this.context&&this.context.window?this.context.window:typeof window<"u"?window:void 0}get document(){var t;return!((t=this.context)===null||t===void 0)&&t.document?this.context.document:this.window?this.window.document:void 0}get rootElement(){var t;return((t=this.args)===null||t===void 0?void 0:t.rootElement)||this.document}constructor(t,e){this.args=t,this.context=e}}const vr=1,mr=0;function ct(r){return r.button===void 0||r.button===mr}function oe(r){return!!r.targetTouches}function J(r,t){return oe(r)?function(e,i){return e.targetTouches.length===1?J(e.targetTouches[0]):i&&e.touches.length===1&&e.touches[0].target===i.target?J(e.touches[0]):void 0}(r,t):{x:r.clientX,y:r.clientY}}const Wt=(()=>{let r=!1;try{addEventListener("test",()=>{},Object.defineProperty({},"passive",{get:()=>(r=!0,!0)}))}catch{}return r})(),F={[P.mouse]:{start:"mousedown",move:"mousemove",end:"mouseup",contextmenu:"contextmenu"},[P.touch]:{start:"touchstart",move:"touchmove",end:"touchend"},[P.keyboard]:{keydown:"keydown"}};class ${profile(){var t;return{sourceNodes:this.sourceNodes.size,sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,targetNodes:this.targetNodes.size,dragOverTargetIds:((t=this.dragOverTargetIds)===null||t===void 0?void 0:t.length)||0}}get document(){return this.options.document}setup(){const t=this.options.rootElement;t&&(p(!$.isSetUp,"Cannot have two Touch backends at the same time."),$.isSetUp=!0,this.addEventListener(t,"start",this.getTopMoveStartHandler()),this.addEventListener(t,"start",this.handleTopMoveStartCapture,!0),this.addEventListener(t,"move",this.handleTopMove),this.addEventListener(t,"move",this.handleTopMoveCapture,!0),this.addEventListener(t,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.addEventListener(t,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.addEventListener(t,"keydown",this.handleCancelOnEscape,!0))}teardown(){const t=this.options.rootElement;t&&($.isSetUp=!1,this._mouseClientOffset={},this.removeEventListener(t,"start",this.handleTopMoveStartCapture,!0),this.removeEventListener(t,"start",this.handleTopMoveStart),this.removeEventListener(t,"move",this.handleTopMoveCapture,!0),this.removeEventListener(t,"move",this.handleTopMove),this.removeEventListener(t,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.removeEventListener(t,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.removeEventListener(t,"keydown",this.handleCancelOnEscape,!0),this.uninstallSourceNodeRemovalObserver())}addEventListener(t,e,i,n=!1){const s=Wt?{capture:n,passive:!1}:n;this.listenerTypes.forEach(function(o){const a=F[o][e];a&&t.addEventListener(a,i,s)})}removeEventListener(t,e,i,n=!1){const s=Wt?{capture:n,passive:!1}:n;this.listenerTypes.forEach(function(o){const a=F[o][e];a&&t.removeEventListener(a,i,s)})}connectDragSource(t,e){const i=this.handleMoveStart.bind(this,t);return this.sourceNodes.set(t,e),this.addEventListener(e,"start",i),()=>{this.sourceNodes.delete(t),this.removeEventListener(e,"start",i)}}connectDragPreview(t,e,i){return this.sourcePreviewNodeOptions.set(t,i),this.sourcePreviewNodes.set(t,e),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDropTarget(t,e){const i=this.options.rootElement;if(!this.document||!i)return()=>{};const n=s=>{if(!this.document||!i||!this.monitor.isDragging())return;let o;switch(s.type){case F.mouse.move:o={x:s.clientX,y:s.clientY};break;case F.touch.move:var a,c;o={x:((a=s.touches[0])===null||a===void 0?void 0:a.clientX)||0,y:((c=s.touches[0])===null||c===void 0?void 0:c.clientY)||0}}const u=o!=null?this.document.elementFromPoint(o.x,o.y):void 0,d=u&&e.contains(u);return u===e||d?this.handleMove(s,t):void 0};return this.addEventListener(this.document.body,"move",n),this.targetNodes.set(t,e),()=>{this.document&&(this.targetNodes.delete(t),this.removeEventListener(this.document.body,"move",n))}}getTopMoveStartHandler(){return this.options.delayTouchStart||this.options.delayMouseStart?this.handleTopMoveStartDelay:this.handleTopMoveStart}installSourceNodeRemovalObserver(t){this.uninstallSourceNodeRemovalObserver(),this.draggedSourceNode=t,this.draggedSourceNodeRemovalObserver=new MutationObserver(()=>{t&&!t.parentElement&&(this.resurrectSourceNode(),this.uninstallSourceNodeRemovalObserver())}),t&&t.parentElement&&this.draggedSourceNodeRemovalObserver.observe(t.parentElement,{childList:!0})}resurrectSourceNode(){this.document&&this.draggedSourceNode&&(this.draggedSourceNode.style.display="none",this.draggedSourceNode.removeAttribute("data-reactid"),this.document.body.appendChild(this.draggedSourceNode))}uninstallSourceNodeRemovalObserver(){this.draggedSourceNodeRemovalObserver&&this.draggedSourceNodeRemovalObserver.disconnect(),this.draggedSourceNodeRemovalObserver=void 0,this.draggedSourceNode=void 0}constructor(t,e,i){this.getSourceClientOffset=n=>{const s=this.sourceNodes.get(n);return s&&function(o){const a=o.nodeType===1?o:o.parentElement;if(!a)return;const{top:c,left:u}=a.getBoundingClientRect();return{x:u,y:c}}(s)},this.handleTopMoveStartCapture=n=>{ct(n)&&(this.moveStartSourceIds=[])},this.handleMoveStart=n=>{Array.isArray(this.moveStartSourceIds)&&this.moveStartSourceIds.unshift(n)},this.handleTopMoveStart=n=>{if(!ct(n))return;const s=J(n);s&&(oe(n)&&(this.lastTargetTouchFallback=n.targetTouches[0]),this._mouseClientOffset=s),this.waitingForDelay=!1},this.handleTopMoveStartDelay=n=>{if(!ct(n))return;const s=n.type===F.touch.start?this.options.delayTouchStart:this.options.delayMouseStart;this.timeout=setTimeout(this.handleTopMoveStart.bind(this,n),s),this.waitingForDelay=!0},this.handleTopMoveCapture=()=>{this.dragOverTargetIds=[]},this.handleMove=(n,s)=>{this.dragOverTargetIds&&this.dragOverTargetIds.unshift(s)},this.handleTopMove=n=>{if(this.timeout&&clearTimeout(this.timeout),!this.document||this.waitingForDelay)return;const{moveStartSourceIds:s,dragOverTargetIds:o}=this,a=this.options.enableHoverOutsideTarget,c=J(n,this.lastTargetTouchFallback);if(!c)return;if(this._isScrolling||!this.monitor.isDragging()&&function(D,b,L,tt,A){if(!A)return!1;const H=180*Math.atan2(tt-b,L-D)/Math.PI+180;for(let _=0;_<A.length;++_){const U=A[_];if(U&&(U.start==null||H>=U.start)&&(U.end==null||H<=U.end))return!0}return!1}(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,c.x,c.y,this.options.scrollAngleRanges))return void(this._isScrolling=!0);var u,d,g,f;if(!this.monitor.isDragging()&&this._mouseClientOffset.hasOwnProperty("x")&&s&&(u=this._mouseClientOffset.x||0,d=this._mouseClientOffset.y||0,g=c.x,f=c.y,Math.sqrt(Math.pow(Math.abs(g-u),2)+Math.pow(Math.abs(f-d),2))>(this.options.touchSlop?this.options.touchSlop:0))&&(this.moveStartSourceIds=void 0,this.actions.beginDrag(s,{clientOffset:this._mouseClientOffset,getSourceClientOffset:this.getSourceClientOffset,publishSource:!1})),!this.monitor.isDragging())return;const h=this.sourceNodes.get(this.monitor.getSourceId());this.installSourceNodeRemovalObserver(h),this.actions.publishDragSource(),n.cancelable&&n.preventDefault();const m=(o||[]).map(D=>this.targetNodes.get(D)).filter(D=>!!D),y=this.options.getDropTargetElementsAtPoint?this.options.getDropTargetElementsAtPoint(c.x,c.y,m):this.document.elementsFromPoint(c.x,c.y),S=[];for(const D in y){if(!y.hasOwnProperty(D))continue;let b=y[D];for(b!=null&&S.push(b);b;)b=b.parentElement,b&&S.indexOf(b)===-1&&S.push(b)}const O=S.filter(D=>m.indexOf(D)>-1).map(D=>this._getDropTargetId(D)).filter(D=>!!D).filter((D,b,L)=>L.indexOf(D)===b);if(a)for(const D in this.targetNodes){const b=this.targetNodes.get(D);if(h&&b&&b.contains(h)&&O.indexOf(D)===-1){O.unshift(D);break}}O.reverse(),this.actions.hover(O,{clientOffset:c})},this._getDropTargetId=n=>{const s=this.targetNodes.keys();let o=s.next();for(;o.done===!1;){const a=o.value;if(n===this.targetNodes.get(a))return a;o=s.next()}},this.handleTopMoveEndCapture=n=>{this._isScrolling=!1,this.lastTargetTouchFallback=void 0,function(s){return s.buttons===void 0||!(s.buttons&vr)}(n)&&(this.monitor.isDragging()&&!this.monitor.didDrop()?(n.cancelable&&n.preventDefault(),this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.drop(),this.actions.endDrag()):this.moveStartSourceIds=void 0)},this.handleCancelOnEscape=n=>{n.key==="Escape"&&this.monitor.isDragging()&&(this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.endDrag())},this.options=new pr(i,e),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.sourceNodes=new Map,this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.targetNodes=new Map,this.listenerTypes=[],this._mouseClientOffset={},this._isScrolling=!1,this.options.enableMouseEvents&&this.listenerTypes.push(P.mouse),this.options.enableTouchEvents&&this.listenerTypes.push(P.touch),this.options.enableKeyboardEvents&&this.listenerTypes.push(P.keyboard)}}const Nr=function(r,t={},e={}){return new $(r,t,e)};export{Be as D,Tr as H,Er as O,wr as S,Nr as T,Sr as a,Cr as b,Ir as g,Or as u};
|